@hippovideo/video-sdk 0.0.34-beta.5 → 0.0.34-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/app/{0-bundle-hippo-ysm8n1kgqze-08957f9806c6276d9f00.js → 0-bundle-hippo-pn9q461vlsk-08957f9806c6276d9f00.js} +0 -0
  2. package/app/{0-bundle-hippo-ysm8n1kgqze-08957f9806c6276d9f00.js.gz → 0-bundle-hippo-pn9q461vlsk-08957f9806c6276d9f00.js.gz} +0 -0
  3. package/app/{1-bundle-hippo-ysm8n1kgqze-216595e3d0f6d2c5c631.js → 1-bundle-hippo-pn9q461vlsk-216595e3d0f6d2c5c631.js} +0 -0
  4. package/app/{1-bundle-hippo-ysm8n1kgqze-216595e3d0f6d2c5c631.js.gz → 1-bundle-hippo-pn9q461vlsk-216595e3d0f6d2c5c631.js.gz} +0 -0
  5. package/app/{10-bundle-hippo-ysm8n1kgqze-3dfb6c46e9b346662eef.js → 10-bundle-hippo-pn9q461vlsk-3dfb6c46e9b346662eef.js} +0 -0
  6. package/app/{10-bundle-hippo-ysm8n1kgqze-3dfb6c46e9b346662eef.js.gz → 10-bundle-hippo-pn9q461vlsk-3dfb6c46e9b346662eef.js.gz} +0 -0
  7. package/app/{11-bundle-hippo-ysm8n1kgqze-7245c6b5d7803013d601.js → 11-bundle-hippo-pn9q461vlsk-7245c6b5d7803013d601.js} +0 -0
  8. package/app/{11-bundle-hippo-ysm8n1kgqze-7245c6b5d7803013d601.js.gz → 11-bundle-hippo-pn9q461vlsk-7245c6b5d7803013d601.js.gz} +0 -0
  9. package/app/{12-bundle-hippo-ysm8n1kgqze-1cfb791b2e028b9b6d27.js → 12-bundle-hippo-pn9q461vlsk-1cfb791b2e028b9b6d27.js} +0 -0
  10. package/app/{12-bundle-hippo-ysm8n1kgqze-1cfb791b2e028b9b6d27.js.gz → 12-bundle-hippo-pn9q461vlsk-1cfb791b2e028b9b6d27.js.gz} +0 -0
  11. package/app/{13-bundle-hippo-ysm8n1kgqze-3c83dea49a59907e4d53.js → 13-bundle-hippo-pn9q461vlsk-3c83dea49a59907e4d53.js} +0 -0
  12. package/app/{13-bundle-hippo-ysm8n1kgqze-3c83dea49a59907e4d53.js.gz → 13-bundle-hippo-pn9q461vlsk-3c83dea49a59907e4d53.js.gz} +0 -0
  13. package/app/{14-bundle-hippo-ysm8n1kgqze-2abb878bafc6041ee050.js → 14-bundle-hippo-pn9q461vlsk-2abb878bafc6041ee050.js} +0 -0
  14. package/app/{14-bundle-hippo-ysm8n1kgqze-2abb878bafc6041ee050.js.gz → 14-bundle-hippo-pn9q461vlsk-2abb878bafc6041ee050.js.gz} +0 -0
  15. package/app/{15-bundle-hippo-ysm8n1kgqze-74979dc2bbb79e0543b8.js → 15-bundle-hippo-pn9q461vlsk-74979dc2bbb79e0543b8.js} +0 -0
  16. package/app/{15-bundle-hippo-ysm8n1kgqze-74979dc2bbb79e0543b8.js.gz → 15-bundle-hippo-pn9q461vlsk-74979dc2bbb79e0543b8.js.gz} +0 -0
  17. package/app/{16-bundle-hippo-ysm8n1kgqze-ec086de025861034db1a.js → 16-bundle-hippo-pn9q461vlsk-ec086de025861034db1a.js} +0 -0
  18. package/app/{16-bundle-hippo-ysm8n1kgqze-ec086de025861034db1a.js.gz → 16-bundle-hippo-pn9q461vlsk-ec086de025861034db1a.js.gz} +0 -0
  19. package/app/{17-bundle-hippo-ysm8n1kgqze-49b8a129d409f654d682.js → 17-bundle-hippo-pn9q461vlsk-49b8a129d409f654d682.js} +0 -0
  20. package/app/{17-bundle-hippo-ysm8n1kgqze-49b8a129d409f654d682.js.gz → 17-bundle-hippo-pn9q461vlsk-49b8a129d409f654d682.js.gz} +0 -0
  21. package/app/{18-bundle-hippo-ysm8n1kgqze-cad1165853d3b30add81.js → 18-bundle-hippo-pn9q461vlsk-cad1165853d3b30add81.js} +0 -0
  22. package/app/{18-bundle-hippo-ysm8n1kgqze-cad1165853d3b30add81.js.gz → 18-bundle-hippo-pn9q461vlsk-cad1165853d3b30add81.js.gz} +0 -0
  23. package/app/{19-bundle-hippo-ysm8n1kgqze-2a72f55d3ea49f5cf810.js → 19-bundle-hippo-pn9q461vlsk-2a72f55d3ea49f5cf810.js} +0 -0
  24. package/app/{19-bundle-hippo-ysm8n1kgqze-2a72f55d3ea49f5cf810.js.gz → 19-bundle-hippo-pn9q461vlsk-2a72f55d3ea49f5cf810.js.gz} +0 -0
  25. package/app/{2-bundle-hippo-ysm8n1kgqze-6b6bda45e47ca233df62.js → 2-bundle-hippo-pn9q461vlsk-6b6bda45e47ca233df62.js} +0 -0
  26. package/app/{2-bundle-hippo-ysm8n1kgqze-6b6bda45e47ca233df62.js.gz → 2-bundle-hippo-pn9q461vlsk-6b6bda45e47ca233df62.js.gz} +0 -0
  27. package/app/{20-bundle-hippo-ysm8n1kgqze-593b58e73634706c91aa.js → 20-bundle-hippo-pn9q461vlsk-593b58e73634706c91aa.js} +0 -0
  28. package/app/{20-bundle-hippo-ysm8n1kgqze-593b58e73634706c91aa.js.gz → 20-bundle-hippo-pn9q461vlsk-593b58e73634706c91aa.js.gz} +0 -0
  29. package/app/{21-bundle-hippo-ysm8n1kgqze-e24996b4e440b38de361.js → 21-bundle-hippo-pn9q461vlsk-e24996b4e440b38de361.js} +0 -0
  30. package/app/{21-bundle-hippo-ysm8n1kgqze-e24996b4e440b38de361.js.gz → 21-bundle-hippo-pn9q461vlsk-e24996b4e440b38de361.js.gz} +0 -0
  31. package/app/{22-bundle-hippo-ysm8n1kgqze-c9e4b6f66899f7afbf34.js → 22-bundle-hippo-pn9q461vlsk-c9e4b6f66899f7afbf34.js} +0 -0
  32. package/app/{22-bundle-hippo-ysm8n1kgqze-c9e4b6f66899f7afbf34.js.gz → 22-bundle-hippo-pn9q461vlsk-c9e4b6f66899f7afbf34.js.gz} +0 -0
  33. package/app/{23-bundle-hippo-ysm8n1kgqze-19130183231088b22eaa.js → 23-bundle-hippo-pn9q461vlsk-19130183231088b22eaa.js} +0 -0
  34. package/app/{23-bundle-hippo-ysm8n1kgqze-19130183231088b22eaa.js.gz → 23-bundle-hippo-pn9q461vlsk-19130183231088b22eaa.js.gz} +0 -0
  35. package/app/{24-bundle-hippo-ysm8n1kgqze-8ff91214b2d59d4f0725.js → 24-bundle-hippo-pn9q461vlsk-8ff91214b2d59d4f0725.js} +0 -0
  36. package/app/{24-bundle-hippo-ysm8n1kgqze-8ff91214b2d59d4f0725.js.gz → 24-bundle-hippo-pn9q461vlsk-8ff91214b2d59d4f0725.js.gz} +0 -0
  37. package/app/{25-bundle-hippo-ysm8n1kgqze-663d8bac6b0eddb22c5d.js → 25-bundle-hippo-pn9q461vlsk-663d8bac6b0eddb22c5d.js} +0 -0
  38. package/app/{25-bundle-hippo-ysm8n1kgqze-663d8bac6b0eddb22c5d.js.gz → 25-bundle-hippo-pn9q461vlsk-663d8bac6b0eddb22c5d.js.gz} +0 -0
  39. package/app/{26-bundle-hippo-ysm8n1kgqze-c5b12ae8a9d01e7f4c63.js → 26-bundle-hippo-pn9q461vlsk-c5b12ae8a9d01e7f4c63.js} +0 -0
  40. package/app/{26-bundle-hippo-ysm8n1kgqze-c5b12ae8a9d01e7f4c63.js.gz → 26-bundle-hippo-pn9q461vlsk-c5b12ae8a9d01e7f4c63.js.gz} +0 -0
  41. package/app/{27-bundle-hippo-ysm8n1kgqze-4a11460dbdd6b5b05a86.js → 27-bundle-hippo-pn9q461vlsk-4a11460dbdd6b5b05a86.js} +0 -0
  42. package/app/{27-bundle-hippo-ysm8n1kgqze-4a11460dbdd6b5b05a86.js.gz → 27-bundle-hippo-pn9q461vlsk-4a11460dbdd6b5b05a86.js.gz} +0 -0
  43. package/app/{28-bundle-hippo-ysm8n1kgqze-e1bdd5fc4ca9e85187ff.js → 28-bundle-hippo-pn9q461vlsk-e1bdd5fc4ca9e85187ff.js} +0 -0
  44. package/app/{28-bundle-hippo-ysm8n1kgqze-e1bdd5fc4ca9e85187ff.js.gz → 28-bundle-hippo-pn9q461vlsk-e1bdd5fc4ca9e85187ff.js.gz} +0 -0
  45. package/app/{29-bundle-hippo-ysm8n1kgqze-9e319121997740942e43.js → 29-bundle-hippo-pn9q461vlsk-9e319121997740942e43.js} +0 -0
  46. package/app/{29-bundle-hippo-ysm8n1kgqze-9e319121997740942e43.js.gz → 29-bundle-hippo-pn9q461vlsk-9e319121997740942e43.js.gz} +0 -0
  47. package/app/{3-bundle-hippo-ysm8n1kgqze-70cfdccd04af1626a9fe.js → 3-bundle-hippo-pn9q461vlsk-70cfdccd04af1626a9fe.js} +0 -0
  48. package/app/{3-bundle-hippo-ysm8n1kgqze-70cfdccd04af1626a9fe.js.gz → 3-bundle-hippo-pn9q461vlsk-70cfdccd04af1626a9fe.js.gz} +0 -0
  49. package/app/{30-bundle-hippo-ysm8n1kgqze-8e9909a0f42f840926ae.js → 30-bundle-hippo-pn9q461vlsk-8e9909a0f42f840926ae.js} +0 -0
  50. package/app/{30-bundle-hippo-ysm8n1kgqze-8e9909a0f42f840926ae.js.gz → 30-bundle-hippo-pn9q461vlsk-8e9909a0f42f840926ae.js.gz} +0 -0
  51. package/app/{31-bundle-hippo-ysm8n1kgqze-7ac5b853e0734f081e19.js → 31-bundle-hippo-pn9q461vlsk-7ac5b853e0734f081e19.js} +0 -0
  52. package/app/{31-bundle-hippo-ysm8n1kgqze-7ac5b853e0734f081e19.js.gz → 31-bundle-hippo-pn9q461vlsk-7ac5b853e0734f081e19.js.gz} +0 -0
  53. package/app/{32-bundle-hippo-ysm8n1kgqze-ed623b0d782b98a7f13a.js → 32-bundle-hippo-pn9q461vlsk-ed623b0d782b98a7f13a.js} +0 -0
  54. package/app/{32-bundle-hippo-ysm8n1kgqze-ed623b0d782b98a7f13a.js.gz → 32-bundle-hippo-pn9q461vlsk-ed623b0d782b98a7f13a.js.gz} +0 -0
  55. package/app/{33-bundle-hippo-ysm8n1kgqze-f05983958313e72c180a.js → 33-bundle-hippo-pn9q461vlsk-f05983958313e72c180a.js} +0 -0
  56. package/app/{33-bundle-hippo-ysm8n1kgqze-f05983958313e72c180a.js.gz → 33-bundle-hippo-pn9q461vlsk-f05983958313e72c180a.js.gz} +0 -0
  57. package/app/{34-bundle-hippo-ysm8n1kgqze-aeb7e656755c64511921.js → 34-bundle-hippo-pn9q461vlsk-aeb7e656755c64511921.js} +0 -0
  58. package/app/{34-bundle-hippo-ysm8n1kgqze-aeb7e656755c64511921.js.gz → 34-bundle-hippo-pn9q461vlsk-aeb7e656755c64511921.js.gz} +0 -0
  59. package/app/{35-bundle-hippo-ysm8n1kgqze-3691c31cf1ab7b36db36.js → 35-bundle-hippo-pn9q461vlsk-3691c31cf1ab7b36db36.js} +0 -0
  60. package/app/{35-bundle-hippo-ysm8n1kgqze-3691c31cf1ab7b36db36.js.gz → 35-bundle-hippo-pn9q461vlsk-3691c31cf1ab7b36db36.js.gz} +0 -0
  61. package/app/{4-bundle-hippo-ysm8n1kgqze-5b4f3b421398553a353f.js → 4-bundle-hippo-pn9q461vlsk-5b4f3b421398553a353f.js} +0 -0
  62. package/app/{4-bundle-hippo-ysm8n1kgqze-5b4f3b421398553a353f.js.gz → 4-bundle-hippo-pn9q461vlsk-5b4f3b421398553a353f.js.gz} +0 -0
  63. package/app/{6-bundle-hippo-ysm8n1kgqze-da2d8e4490480d0badfe.js → 6-bundle-hippo-pn9q461vlsk-da2d8e4490480d0badfe.js} +0 -0
  64. package/app/{6-bundle-hippo-ysm8n1kgqze-da2d8e4490480d0badfe.js.gz → 6-bundle-hippo-pn9q461vlsk-da2d8e4490480d0badfe.js.gz} +0 -0
  65. package/app/{7-bundle-hippo-ysm8n1kgqze-554adf341c11f4709554.js → 7-bundle-hippo-pn9q461vlsk-554adf341c11f4709554.js} +0 -0
  66. package/app/{7-bundle-hippo-ysm8n1kgqze-554adf341c11f4709554.js.gz → 7-bundle-hippo-pn9q461vlsk-554adf341c11f4709554.js.gz} +0 -0
  67. package/app/{8-bundle-hippo-ysm8n1kgqze-c81c773dc7c617b3fa36.js → 8-bundle-hippo-pn9q461vlsk-c81c773dc7c617b3fa36.js} +0 -0
  68. package/app/{8-bundle-hippo-ysm8n1kgqze-c81c773dc7c617b3fa36.js.gz → 8-bundle-hippo-pn9q461vlsk-c81c773dc7c617b3fa36.js.gz} +0 -0
  69. package/app/{9-bundle-hippo-ysm8n1kgqze-4d500f5462bab8545edd.js → 9-bundle-hippo-pn9q461vlsk-4d500f5462bab8545edd.js} +0 -0
  70. package/app/{9-bundle-hippo-ysm8n1kgqze-4d500f5462bab8545edd.js.gz → 9-bundle-hippo-pn9q461vlsk-4d500f5462bab8545edd.js.gz} +0 -0
  71. package/app/hv_recorder.js +2 -2
  72. package/app/hv_recorder.js.gz +0 -0
  73. package/app/webpack-common-manifest.json +70 -70
  74. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.HVRecorder=t():e.HVRecorder=t()}(window,(function(){return function(e){function t(t){for(var i,r,o=t[0],a=t[1],s=0,c=[];s<o.length;s++)r=o[s],Object.prototype.hasOwnProperty.call(n,r)&&n[r]&&c.push(n[r][0]),n[r]=0;for(i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i]);for(l&&l(t);c.length;)c.shift()()}var i={},n={5:0};function r(t){if(i[t])return i[t].exports;var n=i[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.e=function(e){var t=[],i=n[e];if(0!==i)if(i)t.push(i[2]);else{var o=new Promise((function(t,r){i=n[e]=[t,r]}));t.push(i[2]=o);var a,s=document.createElement("script");s.charset="utf-8",s.timeout=120,r.nc&&s.setAttribute("nonce",r.nc),s.src=function(e){return r.p+""+e+"-bundle-hippo-ysm8n1kgqze-"+{0:"08957f9806c6276d9f00",1:"216595e3d0f6d2c5c631",2:"6b6bda45e47ca233df62",3:"70cfdccd04af1626a9fe",4:"5b4f3b421398553a353f",6:"da2d8e4490480d0badfe",7:"554adf341c11f4709554",8:"c81c773dc7c617b3fa36",9:"4d500f5462bab8545edd",10:"3dfb6c46e9b346662eef",11:"7245c6b5d7803013d601",12:"1cfb791b2e028b9b6d27",13:"3c83dea49a59907e4d53",14:"2abb878bafc6041ee050",15:"74979dc2bbb79e0543b8",16:"ec086de025861034db1a",17:"49b8a129d409f654d682",18:"cad1165853d3b30add81",19:"2a72f55d3ea49f5cf810",20:"593b58e73634706c91aa",21:"e24996b4e440b38de361",22:"c9e4b6f66899f7afbf34",23:"19130183231088b22eaa",24:"8ff91214b2d59d4f0725",25:"663d8bac6b0eddb22c5d",26:"c5b12ae8a9d01e7f4c63",27:"4a11460dbdd6b5b05a86",28:"e1bdd5fc4ca9e85187ff",29:"9e319121997740942e43",30:"8e9909a0f42f840926ae",31:"7ac5b853e0734f081e19",32:"ed623b0d782b98a7f13a",33:"f05983958313e72c180a",34:"aeb7e656755c64511921",35:"3691c31cf1ab7b36db36"}[e]+".js"}(e);var l=new Error;a=function(t){s.onerror=s.onload=null,clearTimeout(c);var i=n[e];if(0!==i){if(i){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;l.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",l.name="ChunkLoadError",l.type=r,l.request=o,i[1](l)}n[e]=void 0}};var c=setTimeout((function(){a({type:"timeout",target:s})}),12e4);s.onerror=s.onload=a,document.head.appendChild(s)}return Promise.all(t)},r.m=e,r.c=i,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="https://antojoy-video-server.s3.us-west-2.amazonaws.com/recorder/beta/0.0.34-beta.5/app/",r.oe=function(e){throw console.error(e),e},void 0!==r&&Object.defineProperty(r,"p",{get:function(){try{if("string"!=typeof hvExtensionChunkDomain)throw new Error("WebpackRequireFrom: 'hvExtensionChunkDomain' is not a string or not available at runtime. See https://github.com/agoldis/webpack-require-from#troubleshooting");return hvExtensionChunkDomain}catch(e){return console.error(e),"https://antojoy-video-server.s3.us-west-2.amazonaws.com/recorder/beta/0.0.34-beta.5/app/"}},set:function(e){console.warn("WebpackRequireFrom: something is trying to override webpack public path. Ignoring the new value"+e+".")}});var o=window.webpackJsonpHVRecorder=window.webpackJsonpHVRecorder||[],a=o.push.bind(o);o.push=t,o=o.slice();for(var s=0;s<o.length;s++)t(o[s]);var l=a;return r(r.s=429)}([function(e,t,i){var n;
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.HVRecorder=t():e.HVRecorder=t()}(window,(function(){return function(e){function t(t){for(var i,r,o=t[0],a=t[1],s=0,c=[];s<o.length;s++)r=o[s],Object.prototype.hasOwnProperty.call(n,r)&&n[r]&&c.push(n[r][0]),n[r]=0;for(i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i]);for(l&&l(t);c.length;)c.shift()()}var i={},n={5:0};function r(t){if(i[t])return i[t].exports;var n=i[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.e=function(e){var t=[],i=n[e];if(0!==i)if(i)t.push(i[2]);else{var o=new Promise((function(t,r){i=n[e]=[t,r]}));t.push(i[2]=o);var a,s=document.createElement("script");s.charset="utf-8",s.timeout=120,r.nc&&s.setAttribute("nonce",r.nc),s.src=function(e){return r.p+""+e+"-bundle-hippo-pn9q461vlsk-"+{0:"08957f9806c6276d9f00",1:"216595e3d0f6d2c5c631",2:"6b6bda45e47ca233df62",3:"70cfdccd04af1626a9fe",4:"5b4f3b421398553a353f",6:"da2d8e4490480d0badfe",7:"554adf341c11f4709554",8:"c81c773dc7c617b3fa36",9:"4d500f5462bab8545edd",10:"3dfb6c46e9b346662eef",11:"7245c6b5d7803013d601",12:"1cfb791b2e028b9b6d27",13:"3c83dea49a59907e4d53",14:"2abb878bafc6041ee050",15:"74979dc2bbb79e0543b8",16:"ec086de025861034db1a",17:"49b8a129d409f654d682",18:"cad1165853d3b30add81",19:"2a72f55d3ea49f5cf810",20:"593b58e73634706c91aa",21:"e24996b4e440b38de361",22:"c9e4b6f66899f7afbf34",23:"19130183231088b22eaa",24:"8ff91214b2d59d4f0725",25:"663d8bac6b0eddb22c5d",26:"c5b12ae8a9d01e7f4c63",27:"4a11460dbdd6b5b05a86",28:"e1bdd5fc4ca9e85187ff",29:"9e319121997740942e43",30:"8e9909a0f42f840926ae",31:"7ac5b853e0734f081e19",32:"ed623b0d782b98a7f13a",33:"f05983958313e72c180a",34:"aeb7e656755c64511921",35:"3691c31cf1ab7b36db36"}[e]+".js"}(e);var l=new Error;a=function(t){s.onerror=s.onload=null,clearTimeout(c);var i=n[e];if(0!==i){if(i){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;l.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",l.name="ChunkLoadError",l.type=r,l.request=o,i[1](l)}n[e]=void 0}};var c=setTimeout((function(){a({type:"timeout",target:s})}),12e4);s.onerror=s.onload=a,document.head.appendChild(s)}return Promise.all(t)},r.m=e,r.c=i,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="https://antojoy-video-server.s3.us-west-2.amazonaws.com/recorder/beta/0.0.34-beta.6/app/",r.oe=function(e){throw console.error(e),e},void 0!==r&&Object.defineProperty(r,"p",{get:function(){try{if("string"!=typeof hvExtensionChunkDomain)throw new Error("WebpackRequireFrom: 'hvExtensionChunkDomain' is not a string or not available at runtime. See https://github.com/agoldis/webpack-require-from#troubleshooting");return hvExtensionChunkDomain}catch(e){return console.error(e),"https://antojoy-video-server.s3.us-west-2.amazonaws.com/recorder/beta/0.0.34-beta.6/app/"}},set:function(e){console.warn("WebpackRequireFrom: something is trying to override webpack public path. Ignoring the new value"+e+".")}});var o=window.webpackJsonpHVRecorder=window.webpackJsonpHVRecorder||[],a=o.push.bind(o);o.push=t,o=o.slice();for(var s=0;s<o.length;s++)t(o[s]);var l=a;return r(r.s=429)}([function(e,t,i){var n;
2
2
  /*!
3
3
  * jQuery JavaScript Library v3.6.0
4
4
  * https://jquery.com/
@@ -92,7 +92,7 @@ var n;n=function(){return function(){var e={686:function(e,t,i){"use strict";i.d
92
92
  * Copyright jQuery Foundation and other contributors
93
93
  * Released under the MIT license.
94
94
  * http://jquery.org/license
95
- */!function(a){"use strict";r=[i(0),i(378),i(49),i(88)],void 0===(o="function"==typeof(n=function(e){var t=!1;return e(document).on("mouseup",(function(){t=!1})),e.widget("ui.mouse",{version:"1.13.2",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.on("mousedown."+this.widgetName,(function(e){return t._mouseDown(e)})).on("click."+this.widgetName,(function(i){if(!0===e.data(i.target,t.widgetName+".preventClickEvent"))return e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1})),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var n=this,r=1===i.which,o=!("string"!=typeof this.options.cancel||!i.target.nodeName)&&e(i.target).closest(this.options.cancel).length;return!(r&&!o&&this._mouseCapture(i))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout((function(){n.mouseDelayMet=!0}),this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=!1!==this._mouseStart(i),!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+".preventClickEvent")&&e.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return n._mouseMove(e)},this._mouseUpDelegate=function(e){return n._mouseUp(e)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0))}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(i){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,i.target===this._mouseDownEvent.target&&e.data(i.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(i)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,t=!1,i.preventDefault()},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})?n.apply(t,r):n)||(e.exports=o)}()},function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i(34),r=i(113);function o(e,t,i){var o,a,s,l,c,d=function(){var n=Object(r.a)()-a;t>n?o=setTimeout(d,t-n):(o=null,i||(l=e.apply(c,s)),o||(s=c=null))},u=Object(n.a)((function(n){return c=this,s=n,a=Object(r.a)(),o||(o=setTimeout(d,t),i&&(l=e.apply(c,s))),l}));return u.cancel=function(){clearTimeout(o),o=s=c=null},u}},function(e,t,i){var n=i(673),r=i(674),o=i(675),a=i(676);e.exports=function(e){return n(e)||r(e)||o(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);t.f=o?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},function(e,t,i){var n=i(19),r=i(38),o=n.document,a=r(o)&&r(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},function(e,t,i){var n=i(136),r=i(158),o=n("keys");e.exports=function(e){return o[e]||(o[e]=r(e))}},function(e,t,i){var n=i(67),r=i(102),o=i(54),a=function(e){return function(t,i,a){var s,l=n(t),c=o(l),d=r(a,c);if(e&&i!=i){for(;c>d;)if((s=l[d++])!=s)return!0}else for(;c>d;d++)if((e||d in l)&&l[d]===i)return e||d||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,i){var n=i(12),r=i(13),o=i(32),a=i(104),s=i(71),l=i(233),c=function(){},d=[],u=s("Reflect","construct"),p=/^\s*(?:class|function)\b/,h=n(p.exec),f=!p.exec(c),m=function(e){if(!o(e))return!1;try{return u(c,d,e),!0}catch(e){return!1}},g=function(e){if(!o(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!h(p,l(e))}catch(e){return!0}};g.sham=!0,e.exports=!u||r((function(){var e;return m(m.call)||!m(Object)||!m((function(){e=!0}))||e}))?g:m},function(e,t,i){var n=i(28),r=i(105),o=i(48).f,a=n("unscopables"),s=Array.prototype;null==s[a]&&o(s,a,{configurable:!0,value:r(null)}),e.exports=function(e){s[a][e]=!0}},function(e,t,i){var n=i(39),r=i(32),o=i(53),a=i(184),s=i(435),l=a("IE_PROTO"),c=Object,d=c.prototype;e.exports=s?c.getPrototypeOf:function(e){var t=o(e);if(n(t,l))return t[l];var i=t.constructor;return r(i)&&t instanceof i?i.prototype:t instanceof c?d:null}},function(e,t,i){var n=i(41),r=i(235),o=i(80),a=i(28)("species");e.exports=function(e,t){var i,s=n(e).constructor;return void 0===s||o(i=n(s)[a])?t:r(i)}},function(e,t,i){var n=i(107),r=i(31),o=i(41),a=i(121),s=i(240),l=i(54),c=i(81),d=i(192),u=i(167),p=i(302),h=TypeError,f=function(e,t){this.stopped=e,this.result=t},m=f.prototype;e.exports=function(e,t,i){var g,v,y,b,w,S,C,k=i&&i.that,x=!(!i||!i.AS_ENTRIES),_=!(!i||!i.IS_RECORD),E=!(!i||!i.IS_ITERATOR),T=!(!i||!i.INTERRUPTED),P=n(t,k),I=function(e){return g&&p(g,"normal",e),new f(!0,e)},A=function(e){return x?(o(e),T?P(e[0],e[1],I):P(e[0],e[1])):T?P(e,I):P(e)};if(_)g=e.iterator;else if(E)g=e;else{if(!(v=u(e)))throw h(a(e)+" is not iterable");if(s(v)){for(y=0,b=l(e);b>y;y++)if((w=A(e[y]))&&c(m,w))return w;return new f(!1)}g=d(e,v)}for(S=_?e.next:g.next;!(C=r(S,g)).done;){try{w=A(C.value)}catch(e){p(g,"throw",e)}if("object"==typeof w&&w&&c(m,w))return w}return new f(!1)}},function(e,t,i){var n=i(31),r=i(75),o=i(41),a=i(121),s=i(167),l=TypeError;e.exports=function(e,t){var i=arguments.length<2?s(e):t;if(r(i))return o(n(i,e));throw l(a(e)+" is not iterable")}},function(e,t,i){var n=i(28)("iterator"),r=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){r=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!r)return!1;var i=!1;try{var o={};o[n]=function(){return{next:function(){return{done:i=!0}}}},e(o)}catch(e){}return i}},function(e,t,i){"use strict";var n,r,o=i(31),a=i(12),s=i(42),l=i(306),c=i(242),d=i(136),u=i(105),p=i(63).get,h=i(307),f=i(308),m=d("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,v=g,y=a("".charAt),b=a("".indexOf),w=a("".replace),S=a("".slice),C=(r=/b*/g,o(g,n=/a/,"a"),o(g,r,"a"),0!==n.lastIndex||0!==r.lastIndex),k=c.BROKEN_CARET,x=void 0!==/()??/.exec("")[1];(C||x||k||h||f)&&(v=function(e){var t,i,n,r,a,c,d,h=this,f=p(h),_=s(e),E=f.raw;if(E)return E.lastIndex=h.lastIndex,t=o(v,E,_),h.lastIndex=E.lastIndex,t;var T=f.groups,P=k&&h.sticky,I=o(l,h),A=h.source,R=0,O=_;if(P&&(I=w(I,"y",""),-1===b(I,"g")&&(I+="g"),O=S(_,h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==y(_,h.lastIndex-1))&&(A="(?: "+A+")",O=" "+O,R++),i=new RegExp("^(?:"+A+")",I)),x&&(i=new RegExp("^"+A+"$(?!\\s)",I)),C&&(n=h.lastIndex),r=o(g,P?i:h,O),P?r?(r.input=S(r.input,R),r[0]=S(r[0],R),r.index=h.lastIndex,h.lastIndex+=r[0].length):h.lastIndex=0:C&&r&&(h.lastIndex=h.global?r.index+r[0].length:n),x&&r&&r.length>1&&o(m,r[0],i,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(r[a]=void 0)})),r&&T)for(r.groups=c=u(null),a=0;a<T.length;a++)c[(d=T[a])[0]]=r[d[1]];return r}),e.exports=v},function(e,t,i){"use strict";i(55);var n=i(12),r=i(52),o=i(194),a=i(13),s=i(28),l=i(82),c=s("species"),d=RegExp.prototype;e.exports=function(e,t,i,u){var p=s(e),h=!a((function(){var t={};return t[p]=function(){return 7},7!=""[e](t)})),f=h&&!a((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[c]=function(){return i},i.flags="",i[p]=/./[p]),i.exec=function(){return t=!0,null},i[p](""),!t}));if(!h||!f||i){var m=n(/./[p]),g=t(p,""[e],(function(e,t,i,r,a){var s=n(e),l=t.exec;return l===o||l===d.exec?h&&!a?{done:!0,value:m(t,i,r)}:{done:!0,value:s(i,t,r)}:{done:!1}}));r(String.prototype,e,g[0]),r(d,p,g[1])}u&&l(d[p],"sham",!0)}},function(e,t,i){var n=i(31),r=i(41),o=i(32),a=i(100),s=i(194),l=TypeError;e.exports=function(e,t){var i=e.exec;if(o(i)){var c=n(i,e,t);return null!==c&&r(c),c}if("RegExp"===a(e))return n(s,e,t);throw l("RegExp#exec called on incompatible receiver")}},function(e,t){e.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},function(e,t,i){"use strict";var n=i(15),r=i(12),o=i(156),a=i(67),s=i(170),l=r([].join),c=o!=Object,d=s("join",",");n({target:"Array",proto:!0,forced:c||!d},{join:function(e){return l(a(this),void 0===e?",":e)}})},function(e,t,i){"use strict";var n=i(31),r=i(195),o=i(41),a=i(80),s=i(70),l=i(478),c=i(42),d=i(120),u=i(196);r("search",(function(e,t,i){return[function(t){var i=s(this),r=a(t)?void 0:d(t,e);return r?n(r,t,i):new RegExp(t)[e](c(i))},function(e){var n=o(this),r=c(e),a=i(t,n,r);if(a.done)return a.value;var s=n.lastIndex;l(s,0)||(n.lastIndex=0);var d=u(n,r);return l(n.lastIndex,s)||(n.lastIndex=s),null===d?-1:d.index}]}))},function(e,t,i){var n=i(45),r=i(252).populateHostPrefix;function o(e,t,i,r){var o=[e,t].join("/");o=o.replace(/\/+/g,"/");var a={},s=!1;if(n.each(i.members,(function(e,t){var i=r[e];if(null!=i)if("uri"===t.location){var l=new RegExp("\\{"+t.name+"(\\+)?\\}");o=o.replace(l,(function(e,t){return(t?n.uriEscapePath:n.uriEscape)(String(i))}))}else"querystring"===t.location&&(s=!0,"list"===t.type?a[t.name]=i.map((function(e){return n.uriEscape(t.member.toWireFormat(e).toString())})):"map"===t.type?n.each(i,(function(e,t){Array.isArray(t)?a[e]=t.map((function(e){return n.uriEscape(String(e))})):a[e]=n.uriEscape(String(t))})):a[t.name]=n.uriEscape(t.toWireFormat(i).toString()))})),s){o+=o.indexOf("?")>=0?"&":"?";var l=[];n.arrayEach(Object.keys(a).sort(),(function(e){Array.isArray(a[e])||(a[e]=[a[e]]);for(var t=0;t<a[e].length;t++)l.push(n.uriEscape(String(e))+"="+a[e][t])})),o+=l.join("&")}return o}e.exports={buildRequest:function(e){!function(e){e.httpRequest.method=e.service.api.operations[e.operation].httpMethod}(e),function(e){var t=e.service.api.operations[e.operation],i=t.input,n=o(e.httpRequest.endpoint.path,t.httpPath,i,e.params);e.httpRequest.path=n}(e),function(e){var t=e.service.api.operations[e.operation];n.each(t.input.members,(function(t,i){var r=e.params[t];null!=r&&("headers"===i.location&&"map"===i.type?n.each(r,(function(t,n){e.httpRequest.headers[i.name+t]=n})):"header"===i.location&&(r=i.toWireFormat(r).toString(),i.isJsonValue&&(r=n.base64.encode(r)),e.httpRequest.headers[i.name]=r))}))}(e),r(e)},extractError:function(){},extractData:function(e){var t=e.request,i={},r=e.httpResponse,o=t.service.api.operations[t.operation].output,a={};n.each(r.headers,(function(e,t){a[e.toLowerCase()]=t})),n.each(o.members,(function(e,t){var o=(t.name||e).toLowerCase();if("headers"===t.location&&"map"===t.type){i[e]={};var s=t.isLocationName?t.name:"",l=new RegExp("^"+s+"(.+)","i");n.each(r.headers,(function(t,n){var r=t.match(l);null!==r&&(i[e][r[1]]=n)}))}else if("header"===t.location){if(void 0!==a[o]){var c=t.isJsonValue?n.base64.decode(a[o]):a[o];i[e]=t.toType(c)}}else"statusCode"===t.location&&(i[e]=parseInt(r.statusCode,10))})),e.data=i},generateURI:o}},function(e,t,i){var n=i(142).Buffer;"undefined"!=typeof ArrayBuffer&&void 0===ArrayBuffer.isView&&(ArrayBuffer.isView=function(e){return r.indexOf(Object.prototype.toString.call(e))>-1});var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]","[object DataView]"];e.exports={isEmptyData:function(e){return"string"==typeof e?0===e.length:0===e.byteLength},convertToBuffer:function(e){return"string"==typeof e&&(e=new n(e,"utf8")),ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,i){var n=i(32),r=i(38),o=i(139);e.exports=function(e,t,i){var a,s;return o&&n(a=t.constructor)&&a!==i&&r(s=a.prototype)&&s!==i.prototype&&o(e,s),e}},function(e,t,i){"use strict";var n=i(15),r=i(141).trim;n({target:"String",proto:!0,forced:i(255)("trim")},{trim:function(){return r(this)}})},function(e,t,i){var n=i(15),r=i(344);n({target:"Array",stat:!0,forced:!i(193)((function(e){Array.from(e)}))},{from:r})},function(e,t,i){var n=i(573),r=i(574),o=i(575),a=i(576),s=i(577);function l(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=r,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},function(e,t,i){var n=i(176);e.exports=function(e,t){for(var i=e.length;i--;)if(n(e[i][0],t))return i;return-1}},function(e,t,i){var n=i(87).Symbol;e.exports=n},function(e,t,i){var n=i(123)(Object,"create");e.exports=n},function(e,t,i){var n=i(597);e.exports=function(e,t){var i=e.__data__;return n(t)?i["string"==typeof t?"string":"hash"]:i.map}},function(e,t,i){var n=i(258),r=i(360);e.exports=function(e){return null!=e&&r(e.length)&&!n(e)}},function(e,t,i){i(663)},function(e,t,i){var n=i(52);e.exports=function(e,t,i){for(var r in t)n(e,r,t[r],i);return e}},function(e,t,i){i(369)},function(e,t,i){"use strict";var n=i(31),r=i(195),o=i(41),a=i(80),s=i(83),l=i(42),c=i(70),d=i(120),u=i(243),p=i(196);r("match",(function(e,t,i){return[function(t){var i=c(this),r=a(t)?void 0:d(t,e);return r?n(r,t,i):new RegExp(t)[e](l(i))},function(e){var n=o(this),r=l(e),a=i(t,n,r);if(a.done)return a.value;if(!n.global)return p(n,r);var c=n.unicode;n.lastIndex=0;for(var d,h=[],f=0;null!==(d=p(n,r));){var m=l(d[0]);h[f]=m,""===m&&(n.lastIndex=u(r,s(n.lastIndex),c)),f++}return 0===f?null:h}]}))},function(e,t,i){"use strict";var n=i(15),r=i(37),o=i(19),a=i(12),s=i(39),l=i(32),c=i(81),d=i(42),u=i(48).f,p=i(290),h=o.Symbol,f=h&&h.prototype;if(r&&l(h)&&(!("description"in f)||void 0!==h().description)){var m={},g=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:d(arguments[0]),t=c(f,this)?new h(e):void 0===e?h():h(e);return""===e&&(m[t]=!0),t};p(g,h),g.prototype=f,f.constructor=g;var v="Symbol(test)"==String(h("test")),y=a(f.valueOf),b=a(f.toString),w=/^Symbol\((.*)\)[^)]+$/,S=a("".replace),C=a("".slice);u(f,"description",{configurable:!0,get:function(){var e=y(this);if(s(m,e))return"";var t=b(e),i=v?C(t,7,-1):S(t,w,"$1");return""===i?void 0:i}}),n({global:!0,constructor:!0,forced:!0},{Symbol:g})}},function(e,t,i){var n=i(33),r=i(190),o=n.aTypedArrayConstructor,a=n.getTypedArrayConstructor;e.exports=function(e){return o(r(e,a(e)))}},function(e,t,i){"use strict";i.d(t,"a",(function(){return p}));var n=i(46),r=i.n(n),o=i(47),a=i.n(o),s=(i(96),i(26)),l=i.n(s),c=i(130),d=i(147),u=i(6),p=function(){function e(t){var i=t.token,n=t.email,o=t.tokenType;r()(this,e),this.token=i,this.tokenType=o;var a={baseURL:(window._HVDomain||"https://www.hippovideo.io")+d.a,headers:{accept:"application/json"}};if(o===u.e.AUTHENTICATION_TOKEN){var s="".concat(o,"$$").concat(i,"$$").concat(n);a.headers.Authorization="Basic ".concat(btoa(s))}if(o===u.e.RECORDER_SDK_TOKEN){var c="".concat(o,"$$").concat(i);a.headers.Authorization="Basic ".concat(btoa(c))}this.axiosInstance=l.a.create(a)}return a()(e,[{key:"authenticateToken",value:function(){return Object(c.a)({axiosInstance:this.axiosInstance,url:"/authenticate",method:"post"})}},{key:"getBrandingInfo",value:function(){return Object(c.a)({axiosInstance:this.axiosInstance,url:"/branding_info",method:"get"})}},{key:"saveVideoTitle",value:function(e){var t={title:e.title,asset_id:e.assetId};return console.log("HERE "),Object(c.a)({axiosInstance:this.axiosInstance,url:"/video_title",method:"put",jsonData:t})}},{key:"submitVideo",value:function(e){var t={id:e.assetId};return console.log("HERE "),Object(c.a)({axiosInstance:this.axiosInstance,url:"/submit",method:"post",jsonData:t})}}]),e}()},function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var n=i(11),r=i(35),o=i(57);function a(e,t){t=function(e){for(var t={},i=e.length,n=0;n<i;++n)t[e[n]]=!0;return{contains:function(e){return!0===t[e]},push:function(i){return t[i]=!0,e.push(i)}}}(t);var i=n.n.length,a=e.constructor,s=Object(r.a)(a)&&a.prototype||n.c,l="constructor";for(Object(o.a)(e,l)&&!t.contains(l)&&t.push(l);i--;)(l=n.n[i])in e&&e[l]!==s[l]&&!t.contains(l)&&t.push(l)}},function(e,t,i){var n,r;n=[i(16),i(17)],void 0===(r=function(e,t){return function(e){function t(e,t){return e.h("eq",t,{block:i},{key:t.get(["type"],!1),value:"barLoading"},"h")}function i(e,t){return e.w('<div id="').f(t.get(["id"],!1),t,"h").w("_").f(t.get(["type"],!1),t,"h").w('_id" class="bar-loading-outer-container ').f(t.get(["id"],!1),t,"h").w("-").f(t.get(["type"],!1),t,"h").w('-class"><div class="bar-loading"><div></div><div></div><div></div><div></div></div></div>')}e.register("templates/common/loading",t),t.__dustBody=!0,i.__dustBody=!0}(e),function(t,i){var n;return e.render("templates/common/loading",t,(function(e,t){if("function"==typeof i)try{i(e,t)}catch(e){}if(e)throw e;n=t})),n}}.apply(t,n))||(e.exports=r)},function(e,t,i){"use strict";e.exports=i(666)},function(e,t,i){"use strict";i(51),i(24),i(58),i(64),i(212),i(214);var n,r=i(1),o=i.n(r),a=i(4),s=i.n(a),l=i(3).c.video(n||(n=s()(["\n width: 100%;\n border-radius: 15px;\n"]))),c=Object(r.forwardRef)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.stream,i=arguments.length>1?arguments[1]:void 0;return Object(r.useEffect)((function(){(t||i)&&("srcObject"in i.current?i.current.srcObject=t:i.current.src=window.URL.createObjectURL(t),i.current.onloadedmetadata=function(){i.current.play()})}),[t,i]),o.a.createElement(l,{ref:i,autoplay:!0,muted:!0})}));t.a=c},function(e,t,i){"use strict";var n,r=i(1),o=i.n(r),a=i(4),s=i.n(a),l=i(3).c.canvas(n||(n=s()(["\n position: absolute;\n opacity: 0;\n left: 0;\n"]))),c=Object(r.forwardRef)((function(e,t){return o.a.createElement(l,{ref:t})}));t.a=c},function(e,t){var i={init:function(e){e||(e="undefined"!=typeof window&&window._i18n&&window._i18n.locale?window._i18n.locale:"undefined"!=typeof document&&document.documentElement.lang?document.documentElement.lang:"undefined"!=typeof navigator&&(navigator.languages||navigator.language||navigator.userLanguage)?((e=navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage)||"root").toLowerCase():"root");var t=this["__"+e]||this.__root;if(t)for(var i in t)this[i]=t[i];for(var i in this.__root)void 0===this[i]&&(this[i]=this.__root[i])}};i.init(),e.exports=i},function(e,t,i){var n,r;n=[i(0),i(10),i(25),i(568),i(149),i(144),i(145)],void 0===(r=function(e,t,i,n,r){return r.extend({template:n})}.apply(t,n))||(e.exports=r)},function(e,t,i){var n=i(638);e.exports=function(e,t){return n(e,t)}},function(e,t,i){var n,r;n=[i(0),i(10),i(25),i(22),i(734),i(30),i(8)],void 0===(r=function(e,t,i,n,r,o,a){"use strict";return a=a.default,{UPLOAD_REQUEST:0,PREVIEW_REQUEST:1,RENDER_REQUEST:2,MERGE_RENDER_REQUEST:3,COMPRESS_REQUEST:4,CONVERT_REQUEST:5,GIF_REQUEST:6,STREAMING_REQUEST:7,PERSONALIZATION_REQUEST:8,GENERATE_ANIMATED_PREVIEW_REQUEST:9,VIRTUAL_BG_OPERATION:20,initialize:function(t,i,s){return{interval:null==t?3e3:t,pollTimeout:(new Date).getTime()/1e3+(null==i?7200:i),latestWindow:[],init:function(){this.operationIdArray=[],this.assetId=void 0,this.expectedOperationType=void 0,this.operationId=void 0,this.pollErrorCount=0,this.timeRemaining=void 0,this.pollingAction,this.clientLogSent=!1},getStatus:function(e,t,i,n,r){this.init(),e&&e.constructor===Array?(this.operationIdArray=e,this.operationId=this.operationIdArray.pop()):this.operationId=e,this.waitingHandler=t,this.progressHandler=i,this.completeHandler=n,this.errorHandler=r,this.ping()},getAssetStatus:function(e,t,i,n,r,o,a){this.init(),this.assetId=e,this.waitingHandler=t,this.progressHandler=i,this.completeHandler=n,this.errorHandler=r,this.expectedOperationType=o,this.forExtnVBG=a,this.ping()},ping:function(){if("stop"!==this.pollingAction)if((new Date).getTime()/1e3>this.pollTimeout)this.errorHandler&&this.errorHandler(n.pingTooLong);else if(null!=this.operationId||null!=this.assetId){var t=this;r.statusOf(s,this.operationId,this.assetId,this.expectedOperationType,(function(e){if(e){if(null===e||"null"===e||""===JSON.stringify(e).trim())return setTimeout((function(){t.ping()}),t.interval),void a.postErrorsToLog({stackTrace:"Null value returned for statuspoller ",assetId:t.assetId,operationId:t.operationId});if(void 0===e.status&&e.operation_id)setTimeout((function(){t.ping()}),t.interval);else{if("error"==e.status)t.pollErrorCount++,t.pollErrorCount<=4&&setTimeout((function(){t.ping()}),t.interval),console.log("error!!!");else if(50==e.status)t.waitingHandler&&t.waitingHandler(e.data.text),setTimeout((function(){t.ping()}),t.interval);else if(51==e.status||52==e.status){if(e.data.progress>=0&&e.data.progress<=100&&(t.latestWindow.push(e.data),t.latestWindow.length>3&&t.latestWindow.splice(0,t.latestWindow.length-3)),t.latestWindow.length>1){var i=t.latestWindow[t.latestWindow.length-1].progress-t.latestWindow[0].progress,r=t.latestWindow[t.latestWindow.length-1].ts-t.latestWindow[0].ts;i>0&&r>0&&(t.timeRemaining=Math.round(r*(100-t.latestWindow[t.latestWindow.length-1].progress)/i))}t.progressHandler&&t.progressHandler(e.data.text,e.data.progress,t.timeRemaining),setTimeout((function(){t.ping()}),t.interval)}if(("error"==e.status&&t.pollErrorCount>4||54==e.status)&&t.errorHandler){var o=n.somethingWentWrong;null!=e.data&&null!=e.data.text&&(o=e.data.text);var s={reason:o,state:e.data.state};t.errorHandler(s)}53==e.status&&(null!=t.expectedOperationType&&e.operationtype!=t.expectedOperationType?(e.data.text=n.processPending,t.progressHandler(e.data.text,e.data.progress,t.timeRemaining,e.operationtype,e.status),setTimeout((function(){t.ping()}),t.interval)):t.operationIdArray&&t.operationIdArray.length>0?(t.operationId=t.operationIdArray.pop(),t.ping()):t.completeHandler&&t.completeHandler(e))}}else setTimeout((function(){t.ping()}),t.interval)}),(function(i){if(setTimeout((function(){t.ping()}),t.interval),!t.clientLogSent){var n=new o({digest:e("#digest").val()}),r={authoringAssetId:t.assetId,description:"STATUS_POLLER_ERROR",stackTrace:"Error while connecting server status from server. assetId-"+t.assetId+" status-"+i.status};n.logClientData([r],!1,(function(){}),(function(){})),t.clientLogSent=!0}}),this.forExtnVBG)}},stop:function(){this.pollingAction="stop"}}}}}.apply(t,n))||(e.exports=r)},function(e,t,i){"use strict";(function(e){i.d(t,"a",(function(){return y}));i(94);var n=i(46),r=i.n(n),o=i(47),a=i.n(o),s=i(56),l=i.n(s),c=i(61),d=i.n(c),u=i(43),p=i.n(u),h=(i(86),i(24),i(25)),f=i.n(h),m=i(414),g=i.n(m);function v(e){var t=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(e){return!1}}();return function(){var i,n=p()(e);if(t){var r=p()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return d()(this,i)}}var y=function(t){l()(n,t);var i=v(n);function n(){return r()(this,n),i.apply(this,arguments)}return a()(n,[{key:"initialize",value:function(t){this.id=t.id,this.showAsModal=t.showAsModal,this.isVirtualBg=t.isVirtualBg,this.$el=e("#".concat(this.id))}},{key:"render",value:function(){var t=this,i=!0;"true"==e("#isTestimonial").val()&&(i=!1),g()({showAsModal:this.showAsModal,showHippoIcon:i,isVirtualBg:this.isVirtualBg},(function(i,n){t.$el.empty().append(e(n)),t.$el.find("#progressBackdrop").show(),t.$el.removeClass("hide")}))}},{key:"remove",value:function(){var e=this;setTimeout((function(){e.$el.empty().addClass("hide")}),800)}},{key:"updateValues",value:function(e,t){this.updateProgress(e),this.updateProgressText(t)}},{key:"updateProgress",value:function(e){var t=0===e?0:20;this.$el.find("#progressFillStrip").animate({width:"".concat(e,"%")},t)}},{key:"updateProgressText",value:function(e){this.$el.find("#progressText").text(e)}}]),n}(f.a.View)}).call(this,i(0))},function(e,t,i){"use strict";i.d(t,"a",(function(){return js})),i.d(t,"b",(function(){return qs}));i(244),i(50),i(24),i(59),i(73);var n=i(92),r=i.n(n),o=i(62),a=i.n(o),s=i(1),l=i.n(s);function c(e,t){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,c(e,t)}function u(e,t){if(null==e)return{};var i,n,r={},o=Object.keys(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}var p=i(69),h=i.n(p),f=!1,m=l.a.createContext(null),g=function(e){return e.scrollTop},v="entering",y="entered",b=function(e){function t(t,i){var n;n=e.call(this,t,i)||this;var r,o=i&&!i.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?o?(r="exited",n.appearStatus=v):r=y:r=t.unmountOnExit||t.mountOnEnter?"unmounted":"exited",n.state={status:r},n.nextCallback=null,n}d(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&"unmounted"===t.status?{status:"exited"}:null};var i=t.prototype;return i.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},i.componentDidUpdate=function(e){var t=null;if(e!==this.props){var i=this.state.status;this.props.in?i!==v&&i!==y&&(t=v):i!==v&&i!==y||(t="exiting")}this.updateStatus(!1,t)},i.componentWillUnmount=function(){this.cancelNextCallback()},i.getTimeouts=function(){var e,t,i,n=this.props.timeout;return e=t=i=n,null!=n&&"number"!=typeof n&&(e=n.exit,t=n.enter,i=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:i}},i.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===v){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:h.a.findDOMNode(this);i&&g(i)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},i.performEnter=function(e){var t=this,i=this.props.enter,n=this.context?this.context.isMounting:e,r=this.props.nodeRef?[n]:[h.a.findDOMNode(this),n],o=r[0],a=r[1],s=this.getTimeouts(),l=n?s.appear:s.enter;!e&&!i||f?this.safeSetState({status:y},(function(){t.props.onEntered(o)})):(this.props.onEnter(o,a),this.safeSetState({status:v},(function(){t.props.onEntering(o,a),t.onTransitionEnd(l,(function(){t.safeSetState({status:y},(function(){t.props.onEntered(o,a)}))}))})))},i.performExit=function(){var e=this,t=this.props.exit,i=this.getTimeouts(),n=this.props.nodeRef?void 0:h.a.findDOMNode(this);t&&!f?(this.props.onExit(n),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(n),e.onTransitionEnd(i.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))},i.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},i.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},i.setNextCallback=function(e){var t=this,i=!0;return this.nextCallback=function(n){i&&(i=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},i.onTransitionEnd=function(e,t){this.setNextCallback(t);var i=this.props.nodeRef?this.props.nodeRef.current:h.a.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(i&&!n){if(this.props.addEndListener){var r=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],o=r[0],a=r[1];this.props.addEndListener(o,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},i.render=function(){var e=this.state.status;if("unmounted"===e)return null;var t=this.props,i=t.children,n=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,u(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return l.a.createElement(m.Provider,{value:null},"function"==typeof i?i(e,n):l.a.cloneElement(l.a.Children.only(i),n))},t}(l.a.Component);function w(){}b.contextType=m,b.propTypes={},b.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:w,onEntering:w,onEntered:w,onExit:w,onExiting:w,onExited:w},b.UNMOUNTED="unmounted",b.EXITED="exited",b.ENTERING=v,b.ENTERED=y,b.EXITING="exiting";var S,C,k=b;var x="out-in",_="in-out",E=function(e,t,i){return function(){var n;e.props[t]&&(n=e.props)[t].apply(n,arguments),i()}},T=((S={})[x]=function(e){var t=e.current,i=e.changeState;return l.a.cloneElement(t,{in:!1,onExited:E(t,"onExited",(function(){i(v,null)}))})},S[_]=function(e){var t=e.current,i=e.changeState,n=e.children;return[t,l.a.cloneElement(n,{in:!0,onEntered:E(n,"onEntered",(function(){i(v)}))})]},S),P=((C={})[x]=function(e){var t=e.children,i=e.changeState;return l.a.cloneElement(t,{in:!0,onEntered:E(t,"onEntered",(function(){i(y,l.a.cloneElement(t,{in:!0}))}))})},C[_]=function(e){var t=e.current,i=e.children,n=e.changeState;return[l.a.cloneElement(t,{in:!1,onExited:E(t,"onExited",(function(){n(y,l.a.cloneElement(i,{in:!0}))}))}),l.a.cloneElement(i,{in:!0})]},C),I=function(e){function t(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];return(t=e.call.apply(e,[this].concat(n))||this).state={status:y,current:null},t.appeared=!1,t.changeState=function(e,i){void 0===i&&(i=t.state.current),t.setState({status:e,current:i})},t}d(t,e);var i=t.prototype;return i.componentDidMount=function(){this.appeared=!0},t.getDerivedStateFromProps=function(e,t){return null==e.children?{current:null}:t.status===v&&e.mode===_?{status:v}:!t.current||(i=t.current,n=e.children,i===n||l.a.isValidElement(i)&&l.a.isValidElement(n)&&null!=i.key&&i.key===n.key)?{current:l.a.cloneElement(e.children,{in:!0})}:{status:"exiting"};var i,n},i.render=function(){var e,t=this.props,i=t.children,n=t.mode,r=this.state,o=r.status,a=r.current,s={children:i,current:a,changeState:this.changeState,status:o};switch(o){case v:e=P[n](s);break;case"exiting":e=T[n](s);break;case y:e=a}return l.a.createElement(m.Provider,{value:{isMounting:!this.appeared}},e)},t}(l.a.Component);I.propTypes={},I.defaultProps={mode:x};function A(){return(A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function R(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var O=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return n=t,void((i=e).classList?i.classList.remove(n):"string"==typeof i.className?i.className=R(i.className,n):i.setAttribute("class",R(i.className&&i.className.baseVal||"",n)));var i,n}))},N=function(e){function t(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];return(t=e.call.apply(e,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,i){var n=t.resolveArguments(e,i),r=n[0],o=n[1];t.removeClasses(r,"exit"),t.addClass(r,o?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,i)},t.onEntering=function(e,i){var n=t.resolveArguments(e,i),r=n[0],o=n[1]?"appear":"enter";t.addClass(r,o,"active"),t.props.onEntering&&t.props.onEntering(e,i)},t.onEntered=function(e,i){var n=t.resolveArguments(e,i),r=n[0],o=n[1]?"appear":"enter";t.removeClasses(r,o),t.addClass(r,o,"done"),t.props.onEntered&&t.props.onEntered(e,i)},t.onExit=function(e){var i=t.resolveArguments(e)[0];t.removeClasses(i,"appear"),t.removeClasses(i,"enter"),t.addClass(i,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var i=t.resolveArguments(e)[0];t.addClass(i,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var i=t.resolveArguments(e)[0];t.removeClasses(i,"exit"),t.addClass(i,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,i){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,i]},t.getClassNames=function(e){var i=t.props.classNames,n="string"==typeof i,r=n?""+(n&&i?i+"-":"")+e:i[e];return{baseClassName:r,activeClassName:n?r+"-active":i[e+"Active"],doneClassName:n?r+"-done":i[e+"Done"]}},t}d(t,e);var i=t.prototype;return i.addClass=function(e,t,i){var n=this.getClassNames(t)[i+"ClassName"],r=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===i&&r&&(n+=" "+r),"active"===i&&e&&g(e),n&&(this.appliedClasses[t][i]=n,function(e,t){e&&t&&t.split(" ").forEach((function(t){return n=t,void((i=e).classList?i.classList.add(n):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(i,n)||("string"==typeof i.className?i.className=i.className+" "+n:i.setAttribute("class",(i.className&&i.className.baseVal||"")+" "+n)));var i,n}))}(e,n))},i.removeClasses=function(e,t){var i=this.appliedClasses[t],n=i.base,r=i.active,o=i.done;this.appliedClasses[t]={},n&&O(e,n),r&&O(e,r),o&&O(e,o)},i.render=function(){var e=this.props,t=(e.classNames,u(e,["classNames"]));return l.a.createElement(k,A({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(l.a.Component);N.defaultProps={classNames:""},N.propTypes={};var D=N,L=i(3),M=(i(477),i(7)),B=i(44),F=i(18),V=i(36);const U=({tokenType:e,integrationType:t,userId:i})=>{let n=`${(new Date).getTime()}$$${e}$$${t}`;return i&&(n+="$$"+i),btoa(n)};var z=i(26),H=i.n(z),j=i(112),q=i.n(j),$=i(390),W=i.n($),G=i(273),K=i.n(G);const Y="INFO",J="ERROR",X="DEBUG",Q="WARN",Z=[Y,"TRACE"];var ee=i(6);const{MESSAGE:te,LOG_SOURCE:ie,APP_NAME:ne,INITIATOR:re,LOG_TYPE:oe,REQUEST_PATH:ae,DATE_TIME:se,REQUEST_BROWSER:le,USER_ID:ce,LOG_UID:de,INTEGRATION_TYPE:ue,ASSET_ID:pe}={APP_NAME:"app_name",TENANT_ID:"tenant_id",API_TOTAL_TIME:"api_total_time",VIEW_TIME:"view_time",REQUEST_TIME:"req_time",METHOD_NAME:"method_name",LINE_NUMBER:"line_num",LOG_LEVEL:"log_level",DATE_TIME:"datetime",USER_ID:"user_id",REQUEST_ID:"request_id",REQUEST_PATH:"req_path",REQUEST_METHOD:"req_method",REQUEST_METHOD_NAME:"req_action",REQUEST_QUERY_PARAMS:"req_query_params",REQUEST_PARAMETERS:"req_params",REQUEST_PATH_PARAMETERS:"req_path_params",REQUEST_REFERER:"req_referer",IS_REQUEST:"is_req",MESSAGE:"msg",REQUEST_IP:"request_ip",LOG_SOURCE:"log_source",ERROR_TRACE:"error_trace",LOG_TYPE:"log_type",EVENT_NAME:"event_name",METRIC_NAME:"metric_name",METRIC_TYPE:"metric_Type",METRIC_VALUE:"metric_value",ASSET_ID:"asset_id",REQUEST_BROWSER:"browser",INITIATOR:"initiator",RECORD_ID:"record_id",ENCRYPTED:"encrypted",FAILED_LOG_COUNT:"failed_log_count",LOG_UID:"log_uid",INTEGRATION_TYPE:"integration_type"};class he{constructor({module:e,integrationType:t=ee.q.PRODUCT,assetId:i,logUID:n,tokenType:r,token:o}){this.origin=window&&window._HVDomain||"https://www.hippovideo.io",this.assetId=i||-1,this.logUID=n||U({integrationType:t,tokenType:r}),this.module=e,this.tokenType=r,this.token=o,this.integrationType=t,this.logBuffer=this._getLogsFromLocalStorage()}updateParams({assetId:e,logUID:t}){e&&(this.assetId=e),t&&(this.logUID=t)}log(e,t={}){const i={asset_id:this.assetId,logUID:this.logUID,module:this.module,...t};console.log(`[${X}] :: ${e} :: ${i}`)}info(e,t={}){this._logData(Y,e,t)}error(e,t={}){this._logData(J,e,t)}warn(e,t={}){this._logData(Q,e,t)}_logData(e,t,i){i[te]=t,i[pe]=this.assetId,i[ie]="HV_CLIENT",i[ne]=this.module||"HV_CLIENT",i[re]=this.initiator,i[oe]=e,i[ae]=location?location.href:"Unable to locate request path",i[se]=this._getZuluTimeInUTC(),i[le]=navigator.userAgent&&navigator.userAgent.toString(),i[ce]=this._getUserId(),this.logUID&&(i[de]=this.logUID),this.integrationType&&(i[ue]=this.integrationType),this._pushLogRecord(i);let n=!0;"production"===(()=>{if(window){if(window.HippoVideo&&window.HippoVideo.AppRegistry&&window.HippoVideo.AppRegistry.isStageEnvironment)return"stage";if(window.location){if(window.location.origin&&(window.location.origin.endsWith(".hippowiz.com")||window.location.origin.endsWith(".hippovideo.us")))return"stage";if(-1!==window.location.origin.indexOf("localhost")||-1!==window.location.origin.indexOf("127.0.0.1"))return"local"}}return"production"})()&&Z.includes(e)&&(n=!1),n&&console.log(`[${e}] :: ${t} `,i)}_getUserId(){try{return window.HippoVideo&&HippoVideo.data.api.getProperty("userId")||this.userId}catch(e){}return null}_getZuluTimeInUTC(){return(new Date).toISOString().replace("T"," ").slice(0,23)}async _pushLogRecord(e,t){try{await this._getFederateTokenAndUpdateConfig();const i=this._constructLogRecord(e);this.firehose.putRecord(i,t||((e,t)=>{e&&(this._fallback([i]),console.error("COULD NOT PUSH LOG ",e))}))}catch(e){t&&t("exception: "+JSON.stringify(e))}}async _pushLogRecordInBatch(e,t){try{const i=e.map(e=>this._constructLogRecord(e));await this._getFederateTokenAndUpdateConfig();const n={Records:i,DeliveryStreamName:this.streamName};this.firehose.putRecordBatch(n,t||((e,t)=>{e&&(this._fallback(i),console.error("COULD NOT PUSH LOG ",e))}))}catch(e){t&&t("exception: "+JSON.stringify(e))}}_fallback(e){this.logBuffer=this.logBuffer.concat(...e),this._pushLogRecordInBatch(e,(e,t)=>{if(e){if(this.logBuffer.length>10){const e=this.logBuffer.map(e=>this._deconstructLogRecord(e));return this.logDataToServer({logIdentifierText:"Kinesis failed logs",data:e}),void this._clearLocalLogs()}this._addLogsToLocalStorage([...this.logBuffer])}})}_clearLocalLogs(){try{this.logBuffer=[],localStorage.removeItem("hv_failed_logs")}catch(e){}}_addLogsToLocalStorage(e){try{localStorage.setItem("hv_failed_logs",JSON.stringify(e))}catch(e){}}_getLogsFromLocalStorage(){try{const e=localStorage.getItem("hv_failed_logs");if(e)return JSON.parse(e)}catch(e){}return[]}_constructLogRecord(e){return{Record:{Data:"_"+this._getZuluTimeInUTC()+"_\t"+JSON.stringify(e)},DeliveryStreamName:this.streamName}}_deconstructLogRecord(e){try{const t=e.Record.Data.split("_\t");return{date:t[0],data:JSON.parse(t[1])}}catch(e){}return e}_setAWSCredentials(){const e=1e3*(window.HippoVideo&&window.HippoVideo.AppRegistry&&window.HippoVideo.AppRegistry.KinesisApiTimeout?Number(window.HippoVideo.AppRegistry.KinesisApiTimeout):10);this.streamName=this.cognitoConfig.stream_name;try{this.cognitoIdentityCredentials.clearCachedId()}catch(e){}this.cognitoIdentityCredentials=new q.a({IdentityId:this.cognitoConfig.identity_id,Logins:{"cognito-identity.amazonaws.com":this.cognitoConfig.token}},{region:"us-east-1",httpOptions:{timeout:e}});let t={region:"us-east-1",credentials:this.cognitoIdentityCredentials,httpOptions:{timeout:e}};this.firehose=new W.a(t)}async _sendRequest(e){try{return[await H()({method:"get",baseURL:this.origin,url:"/api/internal/log/identity",params:e,headers:{accept:"application/json"}}),null]}catch(e){return[null,e]}}_getFederateTokenAndUpdateConfig(e){return new Promise(async(t,i)=>{const n=()=>{this._setAWSCredentials(),e&&e(),t()};if(window.HippoVideo&&HippoVideo.isDelivery)HippoVideo.logCognito?(this.cognitoConfig=HippoVideo.logCognito,n()):i();else{const e=()=>{try{let e=this.cognitoConfigWithExpiry;if(!e){let t=localStorage.getItem("hv-logger-ftkn");if(!t)return null;e=JSON.parse(t)}return t(e.expiry)?(localStorage.removeItem("hv-logger-ftkn"),null):("string"==typeof e&&(e=JSON.parse(e)),JSON.parse(e.value))}catch(e){console.warn("Local storage permission error",e)}return null},t=e=>{const t=new Date,i=new Date(e);return t.getTime()>i.getTime()},r=e=>{try{this.cognitoConfigWithExpiry=JSON.stringify({value:JSON.stringify(e),expiry:new Date((new Date).getTime()+36e5)}),localStorage.setItem("hv-logger-ftkn",this.cognitoConfigWithExpiry)}catch(e){console.warn("Local storage permission error",e)}};this.cognitoConfig=e();let o=null;if(this.tokenType===ee.e.GUEST&&(o={token_type:this.tokenType,token:this.token}),this.cognitoConfig)n();else{const[e,t]=await this._sendRequest(o);if(e){const t=e.data;t&&t.status?(delete t.status,this.cognitoConfig=t,r(t),n()):i()}t&&i()}}})}logDataToServer({logIdentifierText:e,...t}){const i=K.a.initialize({digest:this.token,maxLogSize:1,verbose:!1});i.startSavingLogs(this.assetId,this.logUID);const n={asset_id:this.assetId,logUID:this.logUID,module:this.module,...t};i&&i.log(e,JSON.stringify(n)),i.stopSavingLogs()}}var fe=i(276),me=i(147),ge=i(79);class ve{constructor(e){const t=window._HVDomain||"https://www.hippovideo.io";this.token=e.token,this.tokenType=e.tokenType,this.email=e.email,this.cancelSources={create_recording:H.a.CancelToken.source(),import_video:H.a.CancelToken.source(),import_convert:H.a.CancelToken.source()};let i=me.a;this.tokenType===ee.e.GUEST&&(i=fe.a),this.tokenType===ee.e.VIDEO_PLAY_TOKEN&&(i=fe.b);const n={baseURL:t+i,headers:{accept:"application/json"}};if(this.tokenType===ee.e.RECORDER_SDK_TOKEN){let e=`${this.tokenType}$$${this.token}`;n.headers.Authorization="Basic "+btoa(e)}if(this.tokenType===ee.e.AUTHENTICATION_TOKEN){let e=`${this.tokenType}$$${this.token}$$${this.email}`;n.headers.Authorization="Basic "+btoa(e)}this.axiosInstance=H.a.create(n)}_getRttValue(){try{return navigator.connection.rtt}catch(e){}return-1}createRecording({configuration:e,logUID:t}){let i={recording_configuration:JSON.stringify(e),logUID:t,rtt:this._getRttValue()},n={cancelToken:this.cancelSources.create_recording.token};return this.tokenType===ee.e.GUEST&&(i.token=this.token),this._sendRequest({url:"/record/new",method:"post",jsonData:i,additionalReqConfig:n})}cancelRequest({type:e}){e&&("create_recording"===e&&(this.cancelSources.create_recording.cancel(),this.cancelSources.create_recording=H.a.CancelToken.source()),"import_video"===e&&(this.cancelSources.import_video.cancel(),this.cancelSources.import_video=H.a.CancelToken.source()),"import_convert"===e&&(this.cancelSources.import_convert.cancel(),this.cancelSources.import_convert=H.a.CancelToken.source()))}convertVideo({assetId:e,videoId:t,compressionRequired:i,saveAsNew:n,token:r,convertSpeed:o}){let a={asset_id:e,video_id:t,compression_required:i,save_as_new:n};o&&(a.convert_speed=o),r&&(a.token=r);let s={cancelToken:this.cancelSources.import_convert.token};return this._sendRequest({url:"/convert",method:"post",formData:a,additionalReqConfig:s})}getImportedDetails({assetId:e}){let t="/import_details";return this.tokenType===ee.e.GUEST&&(t=`${t}/${this.token}`),this._sendRequest({url:t,method:"get",params:{asset_id:e}})}createVideoImport(e){let t={asset_id:e.assetId,file_name:e.fileName?e.fileName:"",description:e.description?e.description:"",size:e.size,tags:e.tags?e.tags:"",from_advanced_edit:e.fromAdvancedEdit,record_from_mobile:e.isMobile,contact_id:e.contactId,is_intro_outro_video:e.isIntroOutroVideo,logUID:e.logUID};e.token&&(t.token=e.token,t.referer=e.source),e.uniqueId&&(t.unique_id=e.uniqueId);let i={cancelToken:this.cancelSources.import_video.token};return this._sendRequest({url:"/import/new",method:"post",formData:t,additionalReqConfig:i})}mergeAndRender({assetId:e,projectJson:t,renderFrom:i}){const n=ge.a.serializeProjectJSON(JSON.parse(JSON.stringify(t)));let r={asset_id:e,data:JSON.stringify(n),render_from:i};const o=ge.a.getAuthDataInDom();for(const e in o)r[e]=o[e];return"video_token"===this.tokenType&&(r.token=this.token),this._sendRequest({url:"/render_video",method:"post",formData:r})}completeUpload({assetId:e,webcamId:t,screenId:i,recordingConfiguration:n,token:r}){let o={recording_configuration:n,asset_id:e};return t&&(o.webcam_id=t),i&&(o.screen_id=i),r&&(o.token=r),this._sendRequest({url:"/compress",method:"post",jsonData:o})}setRecordError({errorState:e,logUID:t}){const i={error_state:e,uid:t};return this.tokenType===ee.e.GUEST&&(i.token=this.token),this._sendRequest({url:"/set_record_error",method:"post",jsonData:i})}getFederatedAwsToken({region:e}){const t={region:e};return this._sendRequest({url:"/federated_aws_token",method:"get",params:t})}async _sendRequest({method:e="get",url:t,jsonData:i=null,formData:n=null,params:r={},headers:o={},additionalReqConfig:a={}}){try{let s=n;if(n){if("object"==typeof n&&null!==n){let e=new FormData;for(const t in n)e.append(t,n[t]);s=e}o["Content-Type"]="application/x-www-form-urlencoded"}i&&(o["Content-Type"]="application/json");const l={url:t,method:e,data:i||s,headers:o,params:r,...a};return[await this.axiosInstance.request(l),null]}catch(e){if(H.a.isCancel(e)){return[null,{message:e.message,is_cancelled:!0}]}return[null,e]}}}var ye=i(0),be=i.n(ye),we=i(274),Se=i.n(we),Ce=i(14),ke=i.n(Ce);i(30);const xe=()=>window.HippoVideo&&window.HippoVideo.AppRegistry&&window.HippoVideo.AppRegistry.isStageEnvironment||window.location.hostname.endsWith(".hippowiz.com")||window.location.hostname.endsWith(".hippovideo.us")?"stage":-1!==window.location.href.indexOf("localhost")||-1!==window.location.host.indexOf("127.0.0.1")?"local":"production";class _e{constructor(e){const t=e.bucket,i=e.key,n=e.acl;this.recorderModel=e.recorderModel,this.assetId=e.asset_id,this.digest=e.digest,this.IDENTITY_POOL_ID="local"==xe()?"us-east-1:8e44cb6f-5bb6-47a0-b6f7-e682b1827dc4":"us-east-1:df0a8fb6-f7ad-417c-be80-cdba8aa4a215",this.region="us-east-1",t&&-1!==t.indexOf("-in")&&(this.IDENTITY_POOL_ID="local"==xe()?"ap-south-1:3b87476b-e4de-43e1-85e9-9f24f060b566":"ap-south-1:b4a79053-b71d-4a2e-851b-c1a3fc4a403f",this.region="ap-south-1"),this.userUploadBucket=t,this.userUploadKey=i,this.initialized=!1,this.acl=n,this.userUploadId=void 0;let r="true"==(be()("#isFreePlan").val()||"");this.useAccelerate=e.useAccelerate||!r,this.finishedBlobUpload=!1,this.uploadQueue=[],this.uploadStatsData={},this.uploadError=!1,this.MAX_UPLOAD_TRIES=5,this.uploadPartHandlers=[],this.isChrome=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}startMultiartUpload(){let e=this;return new Promise((t,i)=>{this.updateCredentials().then(()=>{let n={Bucket:e.userUploadBucket,Key:e.userUploadKey,ACL:e.acl};e.s3.createMultipartUpload(n,(function(r,o){r?-1!=JSON.stringify(r).indexOf("NetworkingError")?setTimeout(()=>e.retryCreateMultipartUpload(n,t,i),5e3):i(r):(e.userUploadId=o.UploadId,e.initialized=!0,t())}))}).catch(i)})}retryCreateMultipartUpload(e,t,i){let n=this;this.s3.createMultipartUpload(e,(function(r,o){r?-1!=JSON.stringify(r).indexOf("NetworkingError")?setTimeout(()=>n.retryCreateMultipartUpload(e,t,i),5e3):i(r):(n.userUploadId=o.UploadId,n.initialized=!0,t())}))}updateCredentials(){return new Promise(async(e,t)=>{const[i,n]=await this.recorderModel.getFederatedAwsToken({region:this.region});if(i){const t=i.data;this.setS3Credentials(t),e()}n&&(console.error("error updating credentials",n),-1!=JSON.stringify(n).indexOf("Network Error")?this.retryUpdateCredentials(e,t):t(n))})}async retryUpdateCredentials(e,t){const[i,n]=await this.recorderModel.getFederatedAwsToken({region:this.region});if(i){const t=i.data;this.setS3Credentials(t),e()}n&&-1!=JSON.stringify(n).indexOf("Network Error")&&setTimeout(()=>this.retryUpdateCredentials(e,t),5e3)}setS3Credentials(e){if(e.error)return console.error("error getting federated aws token",e),void reject(e.error);const t=1e3*(window.HippoVideo&&window.HippoVideo.AppRegistry&&window.HippoVideo.AppRegistry.S3ApiTimeout?Number(window.HippoVideo.AppRegistry.S3ApiTimeout):600);try{this.cognitoIdentityCredentials.clearCachedId()}catch(e){}this.cognitoIdentityCredentials=new q.a({IdentityPoolId:this.IDENTITY_POOL_ID,IdentityId:e.identity_id,Logins:{"cognito-identity.amazonaws.com":e.token}},{region:this.region,httpOptions:{timeout:t},maxRetries:0}),ke.a.events.on("retry",(function(e){if("RequestTimeTooSkewed"===e.error.name){let t=Date.parse(e.httpResponse.headers.date),i=(new Date).getTime();ke.a.config.systemClockOffset=t-i,e.error.retryable=!0}})),this.s3=new Se.a({apiVersion:"2006-03-01",region:this.region,credentials:this.cognitoIdentityCredentials,params:{Bucket:this.bucket},useAccelerateEndpoint:this.useAccelerate,httpOptions:{timeout:t},maxRetries:0})}refreshCognitoCredentials(){this.cognitoIdentityCredentials&&this.cognitoIdentityCredentials.refresh(e=>{console.error("REFRESH COGNITO CRED ",e)})}getCognitoIdentityCredentialsObject(e){return new q.a({IdentityPoolId:this.IDENTITY_POOL_ID,IdentityId:e.identity_id,Logins:{"cognito-identity.amazonaws.com":e.token}},{region:this.region,httpOptions:{timeout:AWS_API_TIMEOUT}})}uploadPart(e,t,i,n,r){console.info("S3Uploader.uploadBlob uploading");const o=i.size;let a={Bucket:this.userUploadBucket,Key:this.userUploadKey,PartNumber:t,UploadId:this.userUploadId,Body:i};return this.s3.uploadPart(a,(function(i,a){i?r(e,i,t):n(e,o,{ETag:a.ETag,PartNumber:Number(this.request.params.PartNumber)})}))}uploadPartSuccess(e){console.info("part upload complete",e)}uploadPartError(e,t){console.error("UPLOAD ERROR ",e,"Params ",t)}finishMultipartUpload(e){const t=this;return new Promise((i,n)=>{e.sort((function(e,t){return e.PartNumber-t.PartNumber}));let r={Bucket:t.userUploadBucket,Key:t.userUploadKey,UploadId:t.userUploadId,MultipartUpload:{Parts:e}};t.s3.completeMultipartUpload(r,(function(e,o){e?(console.error(e,e.stack),-1!=JSON.stringify(e).indexOf("Network Error")?setTimeout(()=>t.retryFinishMultipartUpload(r,i,n),5e3):n({error:e,assetId:t.assetId})):i({data:o,assetId:t.assetId})}))})}async retryFinishMultipartUpload(e,t,i){let n=this;this.s3.completeMultipartUpload(e,(function(r,o){r?(console.error(r,r.stack),-1!=JSON.stringify(r).indexOf("Network Error")?setTimeout(()=>n.retryFinishMultipartUpload(e,t,i),5e3):i({error:r,assetId:n.assetId})):t({data:o,assetId:n.assetId})}))}cancelMultipartUpload(e){return new Promise((t,i)=>{for(let t in e){const i=e[t];try{i.abort()}catch(e){}}const n={Bucket:this.userUploadBucket,Key:this.userUploadKey,UploadId:this.userUploadId};this.s3.abortMultipartUpload(n,(function(e,n){e?(console.error("error while aborting multipartupload",{error:e}),i(e)):(console.warn("aborted multipartupload",{res:n}),t(n))}))})}onUploadPartProgress(){that.uploadStatsData[this.params.PartNumber].completed=progress.loaded;var e=Math.round(progress.loaded/progress.total*100),t=(new Date).getTime();if(curProgressCallStartTime=t,navigator.connection&&rttValues.push(navigator.connection.rtt),(new Date).getTime()/1e3-rttValueLastUpdated>=pushRttValuePerXSeconds){e=Math.round(progress.loaded/progress.total*100);for(var i=(new Date).getTime(),n=uploadParams.Body.size*e/100/(i-startTime),r=0,o=0;o<rttValues.length;o++)r+=rttValues[o];console.info("RTT VALUE UPDATE",{asset_id:that.assetId,part_num:Number(that.fileUploadRates.length+e/100||0),on_upload_complete:!1,rtt:Number(r/rttValues.length||0),avg_upload_rate:Number(n||0),is_finished:that.finishedRecording,media_type:that.type,user_upload_key:that.userUploadKey}),rttValueLastUpdated=(new Date).getTime()/1e3}that.calculateProgress()}async uploadFile(e,t){try{const i=this;await this.updateCredentials();const n={Bucket:i.userUploadBucket,Key:i.userUploadKey,Body:e,ACL:i.acl};return[await this._startS3Upload(n,t),null]}catch(e){return[null,e]}}cancelFileUpload(){try{setTimeout(this.uploadResponse.abort.bind(this.uploadResponse),1e3)}catch(e){}}_startS3Upload(e,t){return new Promise((i,n)=>{this.uploadResponse=this.s3.upload(e,(function(e,t){e?(-1!=JSON.stringify(e).indexOf("TimeoutError")||-1!=JSON.stringify(e).indexOf("Timeout")||JSON.stringify(e).indexOf("NetworkingError"),console.error("There was an error uploading video: ",e),n(e.message)):i(t)})).on("httpUploadProgress",(function(e){t&&t(e)}))})}sendAbortRequest(e){var t=this,i={Bucket:t.userUploadBucket,Key:t.userUploadKey,UploadId:t.userUploadId};t.s3.abortMultipartUpload(i,(function(i,n){i?console.error("error while aborting multipartupload",{error:i}):console.warn("aborted multipartupload",{res:n}),e(t)}))}abortCurrentUploads(e){for(var t in e.uploadPartHandlers)try{e.uploadPartHandlers.hasOwnProperty(t)&&(e.uploadPartHandlers[t].params&&(e.uploadStatsData[e.uploadPartHandlers[t].params.PartNumber].completed=0),e.uploadPartHandlers[t].abort(),delete e.uploadPartHandlers[t])}catch(e){}e.uploadPartHandlers={}}}let Ee,Te;const Pe=new WeakMap,Ie=new WeakMap,Ae=new WeakMap,Re=new WeakMap,Oe=new WeakMap;let Ne={get(e,t,i){if(e instanceof IDBTransaction){if("done"===t)return Ie.get(e);if("objectStoreNames"===t)return e.objectStoreNames||Ae.get(e);if("store"===t)return i.objectStoreNames[1]?void 0:i.objectStore(i.objectStoreNames[0])}return Me(e[t])},set:(e,t,i)=>(e[t]=i,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function De(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(Te||(Te=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Be(this),t),Me(Pe.get(this))}:function(...t){return Me(e.apply(Be(this),t))}:function(t,...i){const n=e.call(Be(this),t,...i);return Ae.set(n,t.sort?t.sort():[t]),Me(n)}}function Le(e){return"function"==typeof e?De(e):(e instanceof IDBTransaction&&function(e){if(Ie.has(e))return;const t=new Promise((t,i)=>{const n=()=>{e.removeEventListener("complete",r),e.removeEventListener("error",o),e.removeEventListener("abort",o)},r=()=>{t(),n()},o=()=>{i(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",r),e.addEventListener("error",o),e.addEventListener("abort",o)});Ie.set(e,t)}(e),t=e,(Ee||(Ee=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,Ne):e);var t}function Me(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,i)=>{const n=()=>{e.removeEventListener("success",r),e.removeEventListener("error",o)},r=()=>{t(Me(e.result)),n()},o=()=>{i(e.error),n()};e.addEventListener("success",r),e.addEventListener("error",o)});return t.then(t=>{t instanceof IDBCursor&&Pe.set(t,e)}).catch(()=>{}),Oe.set(t,e),t}(e);if(Re.has(e))return Re.get(e);const t=Le(e);return t!==e&&(Re.set(e,t),Oe.set(t,e)),t}const Be=e=>Oe.get(e);function Fe(e,t,{blocked:i,upgrade:n,blocking:r,terminated:o}={}){const a=indexedDB.open(e,t),s=Me(a);return n&&a.addEventListener("upgradeneeded",e=>{n(Me(a.result),e.oldVersion,e.newVersion,Me(a.transaction))}),i&&a.addEventListener("blocked",()=>i()),s.then(e=>{o&&e.addEventListener("close",()=>o()),r&&e.addEventListener("versionchange",()=>r())}).catch(()=>{}),s}const Ve=["get","getKey","getAll","getAllKeys","count"],Ue=["put","add","delete","clear"],ze=new Map;function He(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(ze.get(t))return ze.get(t);const i=t.replace(/FromIndex$/,""),n=t!==i,r=Ue.includes(i);if(!(i in(n?IDBIndex:IDBObjectStore).prototype)||!r&&!Ve.includes(i))return;const o=async function(e,...t){const o=this.transaction(e,r?"readwrite":"readonly");let a=o.store;return n&&(a=a.index(t.shift())),(await Promise.all([a[i](...t),r&&o.done]))[0]};return ze.set(t,o),o}Ne=(e=>({...e,get:(t,i,n)=>He(t,i)||e.get(t,i,n),has:(t,i)=>!!He(t,i)||e.has(t,i)}))(Ne);const je={SCREEN:"screen",WEBCAM:"webcam"},qe=e=>"hippo_video_db_"+e,$e=async(e,t,i,n)=>{try{return await e.add(t,n,i),!0}catch(e){return console.error("EXCEPTION WHILE ADDING DATA ",e),!1}},We=async(e,t)=>{try{return await e.clear(t),!0}catch(e){return console.warn("EXCEPTION WHILE CLEARING STORE ",e),!1}};class Ge{constructor(e,t,i){this.videoId=e,this.screen=t,this.webcam=i}async initialize(){try{this.db||(this.db=await((e,t,i)=>Fe(qe(e),1,{upgrade(e){t&&e.createObjectStore(je.SCREEN),i&&e.createObjectStore(je.WEBCAM)}}))(this.videoId,this.screen,this.webcam)),this.incompleAssetsDb||(this.incompleAssetsDb=await Fe("hippo_video_incomplete_uploads",1,{upgrade(e){e.createObjectStore("videos")}})),await(async(e,t,i)=>!!await e.get(t,i))(this.incompleAssetsDb,"videos",this.videoId)||await $e(this.incompleAssetsDb,"videos",this.videoId,new Date)}catch(e){console.error("OPEN DB EXCEPTION",e)}}async addData(e,t,i){try{if(this.videoId){this.db||await this.initialize();let n=!0,r=!0;return e===je.SCREEN&&(n=await $e(this.db,je.SCREEN,t,i)),e===je.WEBCAM&&(r=await $e(this.db,je.WEBCAM,t,i)),!(!n||!r)}}catch(e){console.error("ADD EXECEPTION ",e)}return!1}getData(e,t){let i=je.WEBCAM;return e===je.SCREEN&&(i=je.SCREEN),new Promise(async(e,n)=>{try{e(await this.db.get(i,t))}catch(e){console.error(e),n(e)}})}async getAllData(){for(let e in je)try{let t=je[e];const i=this.db.transaction(t).objectStore(t);let n=[];for(;;){let e=await i.openCursor();if(n.push(e.value),e=await e.continue(),!e)break}}catch(e){console.error(e)}}async clearData(e){await(async(e,t,i)=>{console.log(e,t,i);try{return await e.delete(t,i),!0}catch(e){return console.error("EXCEPTION WHILE DELETING KEY ",e),!1}})(this.incompleAssetsDb,"videos",e)||console.error("KEY DELETION FAILED");await(async e=>(await We(e,je.SCREEN),await We(e,je.WEBCAM),!0))(this.db)||console.error("STORE CLEAR FAILED"),this.db.close(),this.incompleAssetsDb.close(),this.db=null,this.incompleAssetsDb=null;var t;return await(t=qe(e),new Promise((e,i)=>{const n=window.indexedDB.deleteDatabase(t);n.onerror=t=>{console.error("Error deleting database.",t),e(!1)},n.onsuccess=t=>{console.log("Database deleted successfully"),e(!0)}}))||console.error("DB DELETION FAILED"),!0}}const Ke={SCREEN:1,WEBCAM:2,FILE:3},Ye={1:"screen",2:"webcam"};class Je{constructor({webCam:e,audio:t,screenRecord:i,file:n,recorderModel:r,uploadProgressCallback:o}){this.recorderModel=r,this.uploaderData={},this.uploaderParts={},this.uploadedParts={},this.indexedDBWriteStatus={},this.currentUploaderDataSize={},this.totalUploaderDataSize={},this.uploaders={},this.incompleteUploadParts={},this.uploadersCompleted={},this.uploadCompleted={},this.uploadPartHandlers={},this.uploadCompletedSize={},this.uploadEntitiesForEachFile={},this.finishUploadCalled=!1,this.uploadProgressCallback=o,this.uploadProgressDetails={type:"upload"},this.uploadStartTime=null,this.optimalUploadTime=1400,this.uploadTimeThreshold=85e3,this.desirableProcessCount={},this.uploadQueue={},this.latestUploadTime={},this.uploadError={},this.currentProcessCount={},this.uploadStats={},this.uploadRetries={},this.activeUploaderTypes=[],this.cognitoError={},this.UPLOAD_RETRY_INTERVAL=5e3,(e||t)&&this.addUploader(Ke.WEBCAM),i&&this.addUploader(Ke.SCREEN),n&&this.addUploader(Ke.FILE),this.checkAndCompleteMultipartUpload=this.checkAndCompleteMultipartUpload.bind(this),this.onUploadPartSuccess=this.onUploadPartSuccess.bind(this),this.onUploadPartFailure=this.onUploadPartFailure.bind(this),this.sendUploadProgress=this.sendUploadProgress.bind(this),this.calculateProgress=this.calculateProgress.bind(this)}initializeUploaders(e){return new Promise(async(t,i)=>{this.uploaderConfig=e,this.videoIDBManager=new Ge(e.asset_id,e.screenRecord,e.webcamId),this.videoIDBManager.initialize();try{e.webcamId&&await this.initializeUploader(Ke.WEBCAM),e.screenRecord&&await this.initializeUploader(Ke.SCREEN),t()}catch(e){this.uploadError[e.type]=!0,i(e)}})}addUploader(e){this.activeUploaderTypes.push(e),this.uploaderData[e]={},this.indexedDBWriteStatus[e]={},this.uploadCompletedSize[e]=0,this.uploadCompleted[e]={},this.uploadedParts[e]=[],this.incompleteUploadParts[e]=[],this.uploadersCompleted[e]=!1,this.currentUploaderDataSize[e]=0,this.totalUploaderDataSize[e]=0,this.uploaderParts[e]=1,this.uploadQueue[e]=[],this.uploadRetries[e]={},this.uploadError[e]=!1,this.desirableProcessCount[e]=1,this.currentProcessCount[e]=0,this.uploadStats[e]={},this.cognitoError[e]=!1}initializeUploader(e){return new Promise((t,i)=>{if(!e||!Object.values(Ke).includes(e))throw new Error("INVALID_UPLOADER_TYPE");let n={bucket:this.uploaderConfig.uploadBucket,acl:"private",digest:this.uploaderConfig.digest,asset_id:this.uploaderConfig.asset_id,recorderModel:this.recorderModel};e===Ke.WEBCAM&&(n.key=this.uploaderConfig.webcamKey),e===Ke.SCREEN&&(n.key=this.uploaderConfig.screenKey);const r=new _e(n);r.startMultiartUpload().then(()=>{this.uploaders[e]=r,this.uploadPartHandlers[e]={},this.checkAndUpload(e),this.uploadStartTime=new Date,t()}).catch(t=>i({type:e,error:t}))})}retryUpload(){return new Promise((e,t)=>{let i=0;this.activeUploaderTypes.forEach(n=>{this.uploadError[n]?(this.resetUploaders(n),this.initializeUploader(n).then(()=>{i++,i===this.activeUploaderTypes.length&&(this.uploadError[n]=!1,e())}).catch(e=>{this.uploadError[e.type]=!0,t(e)})):i++})})}resetUploaders(e){this.uploaders[e]=null,this.uploadCompletedSize[e]=0,this.uploadCompleted[e]={},this.uploadedParts[e]=[],this.incompleteUploadParts[e]=[],this.uploadersCompleted[e]=!1,this.currentUploaderDataSize[e]=0,this.uploadRetries[e]={},this.uploadProgressDetails={type:"upload"},this.uploadError[e]=!1,this.desirableProcessCount[e]=1,this.currentProcessCount[e]=0,this.uploadStats[e]={}}calculateProgress(e){let t=e&&e.loaded||0,i=e&&e.total||0;if(!e){if(this.uploadProgressDetails.partError)for(let e in this.uploadCompletedSize)t+=this.uploadCompletedSize[e];else for(let e in this.uploadCompleted){const i=this.uploadCompleted[e];for(let e in i)t+=i[e]}for(let e in this.totalUploaderDataSize)i+=this.totalUploaderDataSize[e]}let n=t/((new Date-this.uploadStartTime)/1e3),r=null,o=0;return n>0&&(r=Math.round((i-t)/n),o=Math.round(t/i*100)),{type:"upload",totalSize:i,totalUploaded:t,completedPercent:o,timeRemaining:r,partError:this.uploadProgressDetails.partError,completed:!1}}setUploadProgressCallback(e){this.uploadProgressCallback?e=this.uploadProgressCallback:this.uploadProgressCallback=e,e(this.uploadProgressDetails)}getUploadProgressDetails(){return this.uploadProgressDetails}isUploadComplete(){return!!this.uploadProgressDetails&&!!this.uploadProgressDetails.completed}onDataAvailable(e,t){if(!e||!Object.values(Ke).includes(e))throw new Error("INVALID_UPLOADER_TYPE");if(!this.uploaderData.hasOwnProperty(e))throw new Error("UPLOADER_NOT_FOUND");const i=this.uploaderParts[e];this.uploaderData[e][i]||(this.uploaderData[e][i]=[]),this.uploaderData[e][i].push(t);const n=this.getDataSize(t);if(this.currentUploaderDataSize[e]+=n,this.totalUploaderDataSize[e]+=n,this.currentUploaderDataSize[e]>5242880||this.finishUploadCalled){this.uploadQueue[e].push({partNumber:i}),this.currentUploaderDataSize[e]=0,this.uploadRetries[e][i]=0,this.uploadStats[e][i]={},this.indexedDBWriteStatus[e][i]=!1;const t=e===Ke.SCREEN?je.SCREEN:je.WEBCAM;this.uploaders[e]&&(this.videoIDBManager.addData(t,i,this.uploaderData[e][i])&&(this.indexedDBWriteStatus[e][i]=!0,delete this.uploaderData[e][i]),this.checkAndUpload(e)),!this.finishUploadCalled&&this.uploaderParts[e]++}}async checkAndUpload(e){if(!this.uploadError[e]){if(this.latestUploadTime[e]){const t=Math.floor(this.uploadTimeThreshold/this.latestUploadTime[e]);this.latestUploadTime[e]<this.uploadTimeThreshold?(this.slowUpload=!1,this.desirableProcessCount[e]=Math.max(Math.round(.75*t),1)):(this.slowUpload=!0,this.desirableProcessCount[e]=Math.max(t,1))}if(this.cognitoError[e])try{await this.uploaders[e].updateCredentials()}catch(e){}if(this.currentProcessCount[e]<this.desirableProcessCount[e]){let t=Math.min(this.desirableProcessCount[e]-this.currentProcessCount[e],this.uploadQueue[e].length);for(;t>0;){const i=this.uploadQueue[e].pop(0);this.uploadStats[e][i.partNumber]||(this.uploadStats[e][i.partNumber]={}),this.uploadStats[e][i.partNumber].start=(new Date).getTime(),this.constructAndUploadBlob(e,i.partNumber),this.currentProcessCount[e]++,t--}}}}sendUploadProgress(){this.uploadProgressCallback&&this.uploadProgressCallback(this.uploadProgressDetails)}async constructAndUploadBlob(e,t){const i=this;let n=this.uploaderData[e][t];if(this.indexedDBWriteStatus[e][t]){let i=e===Ke.SCREEN?je.SCREEN:je.WEBCAM;n=await this.videoIDBManager.getData(i,t)}let r=new Blob(n,{type:"video/webm"});this.incompleteUploadParts[e]=this.incompleteUploadParts[e].filter(e=>t!==e),this.uploaders[e]?(this.uploadPartHandlers[e][t]=this.uploaders[e].uploadPart(e,t,r,this.onUploadPartSuccess,this.onUploadPartFailure),this.uploadPartHandlers[e][t].on("httpUploadProgress",n=>{this.uploadProgressDetails.partError=!1,i.uploadCompleted[e][t]=n.loaded,i.uploadProgressDetails=i.calculateProgress(),i.sendUploadProgress()})):this.incompleteUploadParts[e].push(t)}finishUpload(){this.finishUploadCalled=!0;const e=this;return new Promise((t,i)=>{if(Object.keys(this.uploaders).length===this.activeUploaderTypes.length)e.checkAndCompleteMultipartUpload(t,i);else{const n=setInterval(()=>{Object.keys(this.uploaders).length===this.activeUploaderTypes.length?(clearInterval(n),e.checkAndCompleteMultipartUpload(t,i)):console.warn("UPLOADER STILL NOT INITALIZED")},1e3)}})}checkAndCompleteMultipartUpload(e,t){for(let i of Object.values(Ke)){if(!this.uploaders[i])continue;if(this.uploadersCompleted[i])continue;this.checkAndUpload(i);const n=setInterval(()=>{this.uploadError[i]&&clearInterval(n),this.uploaderParts[i]===this.uploadedParts[i].length&&(clearInterval(n),this.uploaders[i].finishMultipartUpload(this.uploadedParts[i]).then(({data:n,assetId:r})=>{if(window.isError)return this.uploadProgressDetails&&(this.uploadProgressDetails.error=!0,this.uploadProgressDetails.errorType="MULTIPART_FINISH",this.sendUploadProgress()),void t(r);this.uploadersCompleted[i]=!0,this.isAllUploadCompleted()&&(this.uploadProgressDetails&&(this.uploadProgressDetails.completed=!0,this.sendUploadProgress()),e(r),this.videoIDBManager.clearData(r))}).catch(({error:e,assetId:i})=>{this.uploadProgressDetails&&(this.uploadProgressDetails.error=!0,this.uploadProgressDetails.errorType="MULTIPART_FINISH",this.sendUploadProgress()),t(i)}))},1e3)}}isAllUploadCompleted(){let e=!0;for(let t of Object.values(Ke))!1===this.uploadersCompleted[t]&&(e=!1);return e}onUploadPartSuccess(e,t,i){this.uploadProgressDetails.partError=!1,this.uploadCompletedSize[e]+=t,this.uploadedParts[e].push(i),this.currentProcessCount[e]--;const n=i.PartNumber,r=(new Date).getTime()-this.uploadStats[e][i.PartNumber].start;this.uploadStats[e][i.PartNumber].tt=r,t>=5242880&&(this.latestUploadTime[e]=r),this.incompleteUploadParts[e]=this.incompleteUploadParts[e].filter(e=>e!==n),this.checkAndUpload(e)}onUploadPartFailure(e,t,i){this.uploadProgressDetails.partError=!0,this.uploadProgressDetails=this.calculateProgress(),-1==JSON.stringify(t).indexOf("RequestAbortedError")&&(-1!=JSON.stringify(t).indexOf("TimeoutError")||-1!=JSON.stringify(t).indexOf("Timeout")||JSON.stringify(t).indexOf("NetworkingError"),console.error("s3.uploadPart error ",{partNumber:i,error:t}),-1!=JSON.stringify(t).indexOf("CredentialsError")&&(this.cognitoError[e]=!0),this.currentProcessCount[e]--,this.uploadError[e]||setTimeout(()=>{this.latestUploadTime[e]=9999999,this.uploadStats[e][i].start=(new Date).getTime(),this.uploadRetries[e][i]+=1,this.uploadQueue[e].push({partNumber:i}),this.uploadStats[e][i].retries=this.uploadRetries[e][i],this.uploadStats[e][i].completed=0,this.checkAndUpload(e)},this.UPLOAD_RETRY_INTERVAL),this.incompleteUploadParts[e].includes(i)||this.incompleteUploadParts[e].push(i))}uploadFile(e,t,i){e&&(e.recorderModel=this.recorderModel),this.uploadStartTime=new Date,this.fileUploader=new _e(e);return this.fileUploader.uploadFile(t,e=>{i&&i(this.calculateProgress(e))})}cancelImport(){this.fileUploader&&this.fileUploader.cancelFileUpload()}cancelMultipartUpload(){for(let e of Object.values(Ke))this.uploadPartHandlers[e]&&this.uploaders[e].cancelMultipartUpload(this.uploadPartHandlers[e])}async getObjectUrls({recordingConfig:e}){const t={};for(let i of Object.values(Ke)){const n=this.uploaderParts[i];let r=[];for(let e=1;e<=n;e++){let t=this.uploaderData[i][e];if(this.indexedDBWriteStatus[i][e]){let n=i===Ke.SCREEN?je.SCREEN:je.WEBCAM;t=await this.videoIDBManager.getData(n,e)}r=r.concat(t)}let o="video";i!==Ke.WEBCAM||e.webCam||(o="audio");let a=o+"/mp4";MediaRecorder.isTypeSupported("video/webm")&&(a="video/webm"),r.length>0&&(t[Ye[i]]=URL.createObjectURL(new Blob(r,{type:a})))}return t}getDataSize(e){return e.size?e.size:e.byteLength}destroy(){}}var Xe=i(130);class Qe{constructor({token:e,tokenType:t,email:i}){const n={baseURL:(window._HVDomain||"https://www.hippovideo.io")+me.a,headers:{accept:"application/json"}};if(t===ee.e.RECORDER_SDK_TOKEN){let i=`${t}$$${e}`;n.headers.Authorization="Basic "+btoa(i)}if(t===ee.e.AUTHENTICATION_TOKEN){let r=`${t}$$${e}$$${i}`;n.headers.Authorization="Basic "+btoa(r)}this.axiosInstance=H.a.create(n)}statusOf({operationId:e,assetId:t,expectedOperationType:i}){const n={operation_id:e,asset_id:t,expected_operation_type:i};return Object(Xe.a)({axiosInstance:this.axiosInstance,url:"/video/status",method:"get",params:n})}}var Ze=i(224),et=i.n(Ze);class tt{constructor({interval:e=3e3,pollTimeout:t=7200,token:i,tokenType:n,email:r}){this.interval=e,t=(new Date).getTime()/1e3+t,this.latestWindow=[],this.token=i,this.tokenType=n,this.statusPollerModel=new Qe({token:i,tokenType:n,email:r}),this.logger=new he({module:"VIDEO_STATUS_POLLER",tokenType:n,token:i})}getStatus({operationId:e,waitingHandler:t,progressHandler:i,completeHandler:n,errorHandler:r}){this.setDefaults(),e&&e.constructor===Array?(this.operationIdArray=e,this.operationId=this.operationIdArray.pop()):this.operationId=e,this.waitingHandler=t,this.progressHandler=i,this.completeHandler=n,this.errorHandler=r,this.ping()}async ping(){if("stop"===this.pollingAction)return;if((new Date).getTime()/1e3>this.pollTimeout)return void(this.errorHandler&&this.errorHandler(et.a.pingTooLong));if(null==this.operationId&&null==this.assetId)return;const[e,t]=await this.statusPollerModel.statusOf({operationId:this.operationId,assetId:this.assetId,expectedOperationType:this.expectedOperationType});if(e){let t=e.data;if(console.log("EVENT ",t,this.interval),!t)return void setTimeout(()=>this.ping(),this.interval);if(null===t||"null"===t||""===JSON.stringify(t).trim())return setTimeout(()=>this.ping(),this.interval),void this.logger.error("Event is empty",{stackTrace:"Null value returned for statuspoller ",assetId:this.assetId,operationId:this.operationId});if(void 0===t.status&&t.operation_id)return void setTimeout(()=>this.ping(),this.interval);if("error"==t.status)this.pollErrorCount++,this.pollErrorCount<=4&&setTimeout(()=>this.ping(),this.interval);else if(50==t.status)this.waitingHandler&&this.waitingHandler(t.data.text),setTimeout(()=>this.ping(),this.interval);else if(51==t.status||52==t.status){if(t.data.progress>=0&&t.data.progress<=100&&(this.latestWindow.push(t.data),this.latestWindow.length>3&&this.latestWindow.splice(0,this.latestWindow.length-3)),this.latestWindow.length>1){var i=this.latestWindow[this.latestWindow.length-1].progress-this.latestWindow[0].progress,n=this.latestWindow[this.latestWindow.length-1].ts-this.latestWindow[0].ts;i>0&&n>0&&(this.timeRemaining=Math.round(n*(100-this.latestWindow[this.latestWindow.length-1].progress)/i))}this.progressHandler&&this.progressHandler(t.data.text,t.data.progress,this.timeRemaining),setTimeout(()=>this.ping(),this.interval)}if(("error"==t.status&&this.pollErrorCount>4||54==t.status)&&this.errorHandler){var r=et.a.somethingWentWrong;null!=t.data&&null!=t.data.text&&(r=t.data.text);var o={reason:r,state:t.data.state};this.errorHandler(o)}53==t.status&&(null!=this.expectedOperationType&&t.operationtype!=this.expectedOperationType?(t.data.text=et.a.processPending,this.progressHandler(t.data.text,t.data.progress,this.timeRemaining,t.operationtype,t.status),setTimeout(()=>this.ping(),this.interval)):this.operationIdArray&&this.operationIdArray.length>0?(this.operationId=this.operationIdArray.pop(),this.ping()):this.completeHandler&&this.completeHandler(t))}if(t&&(setTimeout(()=>this.ping(),this.interval),!this.clientLogSent)){var a={authoringAssetId:this.assetId,description:"STATUS_POLLER_ERROR",stackTrace:"Error while connecting server status from server. assetId-"+this.assetId+" status-"+t.status};this.logger.error("STATUS POLLER ERROR",a),this.clientLogSent=!0}}stop(){this.pollingAction="stop"}setDefaults(){this.operationIdArray=[],this.assetId=void 0,this.expectedOperationType=void 0,this.operationId=void 0,this.pollErrorCount=0,this.timeRemaining=void 0,this.pollingAction,this.clientLogSent=!1}}var it=i(129),nt=i.n(it),rt=i(226),ot=i.n(rt);const at=({webcam:e=!0,audio:t=!0})=>new Promise((i,n)=>{st({webcam:e,audio:t}).then(({error:e})=>{e?n():i()}).catch(n)}),st=({webcam:e=!0,audio:t=!0})=>new Promise((i,n)=>{navigator.mediaDevices.enumerateDevices().then(n=>{let r=null;const o={};e&&(o.webcam=[]),t&&(o.audio=[]),n.forEach(i=>{if((e||"videoinput"!==i.kind)&&(t||"audioinput"!==i.kind)&&["audioinput","videoinput"].includes(i.kind)){if(""===i.deviceId&&""===i.label)return void(r="DEVICE_PERMISSION_NOT_GRANTED");"videoinput"===i.kind&&o.webcam.push(i),"audioinput"===i.kind&&o.audio.push(i)}}),i({error:r,devices:o})}).catch(n)}),lt=e=>{let t="Low";return e>=1920?t="High":e>=1024&&(t="Good"),t};var ct=class{constructor({recordingConfiguration:e,token:t,tokenType:i,email:n,integrationType:r=ee.q.PRODUCT,extensionId:o,initiator:a,logID:s,recorderAPIUtils:l,recorderId:c,recorderEvtClass:d}){if(!e)throw new Error("INVALID_CONFIGURATION");this.recordingConfiguration=e,this.token=t,this.tokenType=i,this.email=n,this.recordDetails={},this.recorderId=c,this.recorderEvtClass=d,this.recorderInitiator=a,this.preprocessCompleted=!1,this.uploadCompleted=!1,this.integrationType=r,this.currentWebcamStreamConfig=null,this.currentScreenStreamConfig=null,this.createRecordingRef=null,this.deliveryToken=null,this.projectJson=null,this.extensionRecording=!1,this.recorderAPIUtils=l,this.extensionAvailable=!1,this.webcamConstraints=ee.j,this.audioConstraints=ee.f,this.screenConstraints=ee.g,this.logUID=s||U({integrationType:r,tokenType:i}),this.exponentialBackoff={retryCount:0},this.logger=new he({integrationType:r,module:"RECORDER_CORE",logUID:this.logUID,tokenType:i,token:t}),this.recorderModel=new ve({token:t,tokenType:i,email:n}),this.extensionAvailable=!1,this.logger.info("[RECORDER_INITIALIZED]",{recording_configuration:e})}updateConfig({recordingConfiguration:e,logID:t}){return e&&(this.recordingConfiguration=e),t&&(this.logID=t),this.logger.info("[RECORER_CONFIG_UPDATED]",{recording_configuration:e,log_id:t}),this}updateConstraints(e){let t=Object(V.m)({...e,oldWebcamConstraints:this.webcamConstraints,oldAudioConstraints:this.audioConstraints,oldScreenConstraints:this.screenConstraints});t.screen&&(this.screenConstraints=t.screen),t.audio&&(this.audioConstraints=t.audio),t.webcam&&(this.webcamConstraints=t.webcam)}getStreamConfig(){let e={};if(this.recordingConfiguration.screenRecord){const t={audio:this.recordingConfiguration.systemAudio,video:{frameRate:ee.h,height:Object(V.g)(this.recordingConfiguration.resolution).height,width:Object(V.g)(this.recordingConfiguration.resolution).width}};e.screen=t}if(this.recordingConfiguration.audio||this.recordingConfiguration.webCam){const t={audio:this.recordingConfiguration.audio,video:this.recordingConfiguration.webCam};this.recordingConfiguration.webCam&&(t.video={},this.recordingConfiguration.webcamSourceId&&(t.video.deviceId=this.recordingConfiguration.webcamSourceId),this.recordingConfiguration.aspectRatio&&"default"!==this.recordingConfiguration.aspectRatio&&(t.video.aspectRatio=this.recordingConfiguration.aspectRatio)),this.recordingConfiguration.audio&&(t.audio={},this.recordingConfiguration.audioSourceId&&(t.audio.deviceId=this.recordingConfiguration.audioSourceId)),e.webcam=t}return e}isExtensionAvailable(){return new Promise((e,t)=>{try{Object(V.j)(this.integrationType).then(t=>{e(t)}).catch(()=>{t()})}catch(e){t()}})}createRecording(){this.uploadCompleted=!1,this.createRecordingError=!1,this.exponentialBackoff.retryCount=0,this.activateWarning(),this.logger.info("[CREATE_RECORDING]",{recording_configuration:this.recordingConfiguration});const{webCam:e,audio:t,screenRecord:i}=this.recordingConfiguration;return this.s3UploadManager=new Je({webCam:e,audio:t,screenRecord:i,recorderModel:this.recorderModel}),this.recordType=ee.c.RECORD,this._sendCreateRecordingRequest()}sendCreateRecordingRequest(){return!this.createRecordingError||(this.logger.info("[SENDING_CREATE_RECORDING_REQUEST]"),this.exponentialBackoff.retryCount=ee.m,this.exponentialBackoff.setTimeoutRef&&clearTimeout(this.exponentialBackoff.setTimeoutRef),this.recorderModel.cancelRequest({type:"create_recording"}),this._sendCreateRecordingRequest())}createVideoImport({params:e,uploadStartedCallback:t,updateProgress:i,file:n}){this.uploadCompleted=!1,this.createRecordingError=!1,this.activateWarning(this.logger),this.s3UploadManager=new Je({file:!0,recorderModel:this.recorderModel});const r=this;return this.recordType=ee.c.IMPORT,this.logger.info("[IMPORT_VIDEO_REQUEST]",{params:e}),new Promise(async(o,a)=>{const[s,l]=await this.recorderModel.createVideoImport({logUID:this.logUID,...e});if(this.logger.info("[IMPORT_VIDEO_RESPONSE]",{success:s,error:l}),s){const e=s.data;this._updateRecordDetails(e);const l={bucket:e.upload_bucket,key:e.upload_key,digest:this.token,acl:"private"},c=e.authoring_asset_id;t&&t();const[d,u]=await r.s3UploadManager.uploadFile(l,n,e=>{i(e)});if(this.logger.info("[VIDEO_UPLOAD_COMPLETED]",{success:d,error:u}),d){i({type:"upload",completedPercent:100,completed:!0}),r.uploadCompleted=!0;const[t,n]=await r.recorderModel.convertVideo({assetId:c,videoId:e.upload_video_id,compressionRequired:!1,saveAsNew:!0,token:this.token,convertSpeed:"lessonly"==this.integrationType?"ultrafast":void 0});if(this.logger.info("[VIDEO_CONVERSION_COMPLETED]",{success:t,error:n}),t){const e=t.data;r.videoConverting({convertVideoResponse:e,assetId:c,updateProgress:i,resolve:o,reject:a})}n&&(this.removeWarning(),a(n))}u&&(this.removeWarning(),a(u),i({type:"upload",completedPercent:0,completed:!1}))}l&&(this.removeWarning(),a(l))})}cancelVideoImport(){this.s3UploadManager.cancelImport();try{this.recorderModel.cancelRequest({type:"import_video"}),this.recorderModel.cancelRequest({type:"import_convert"}),this.importStatusPoller&&this.importStatusPoller.stop()}catch(e){}}async closeAudioContext(){try{this.audioContext&&await this.audioContext.close()}catch(e){}}getStream(e={}){let{preview:t}=e;this.preview=t;let i=this.getStreamConfig(),{webcam:n=ee.i,screen:r=ee.g}=i;t&&(delete i.screen,r=null),!1===this.recordingConfiguration.webCam&&!1===this.recordingConfiguration.audio&&(n=!1),!1===this.recordingConfiguration.screenRecord&&(r=!1);let o={};return this.logger.info("[GET_STREAMS]",{options:i}),this.closeAudioContext(),new Promise(async(e,a)=>{if(this.extensionAvailable){const t={type:"get_stream",configuration:i};return void Object(V.b)({integrationType:this.integrationType,message:t}).then(t=>{"get_stream_response"===t.type&&e({_type:"url",webcamStream:t.url})}).catch(e=>{console.error(e)})}let s=!1;n&&!this.webcamStream&&(s=!0),r&&!this.screenStream&&(s=!0);const{isWebcamVideoConfigSame:l,isWebcamAudioConfigSame:c,isScreenConfigSame:d}=this.isStreamConfigSame(n,r);if(l&&c&&d&&!s)return e({message:"no_config_change",screenStream:this.screenStream,webcamStream:this.webcamStream}),void this.logger.info("[STREAM_CONFIGS_SAME]",{oldConfig:{webcam:this.currentWebcamStreamConfig,screen:this.currentScreenStreamConfig},newConfig:{webcam:n,screen:r}});t&&this.currentWebcamStreamConfig?((!this.currentWebcamStreamConfig.video&&n.video||n.video&&!l)&&this.stopWebcamStream(),(!this.currentWebcamStreamConfig.audio&&n.audio||n.audio&&!c)&&this.stopWebcamStream()):l&&c||this.stopWebcamStream(),!d&&r&&this.stopScreenStream(),this.updateConstraints({webcam:n&&n.video,audio:n&&n.audio,screen:r});try{if(r){const e=await this.getScreenStream(r);this.screenStream=e,o.screenStream=e}if(n){const e=await this.getWebcamStream(n);this.webcamStream=e,o.webcamStream=e}e(o)}catch(e){return this.recorderModel.setRecordError({errorState:e.type,logUID:this.logUID}),void a(e)}})}getWebcamStream(e){if(e.video){let t=Object.assign({},ee.j,e.video);e.video=t}return this.webcamError=!1,new Promise((t,i)=>{if(this.webcamStream)return t(this.webcamStream);this.currentWebcamStreamConfig=e;const n=setTimeout(()=>{this.webcamError=Object(V.n)("webcam",{name:"WebcamReadTimeout",message:"Timeout in fetching the stream"}),i(this.webcamError)},5e3);this.webcamStreamRequestInprogress=!0,navigator.mediaDevices.getUserMedia(e).then(e=>{this.webcamStreamRequestInprogress=!1,clearTimeout(n),this.webcamStream=e,t(e)}).catch(e=>{this.webcamStreamRequestInprogress=!1,clearTimeout(n),this.logger.info("[GET_WEBCAM_STREAM]",{error:e}),this.webcamError=Object(V.n)("webcam",e),i(this.webcamError)})})}getScreenStream(e){return new Promise((t,i)=>{if(this.screenStream)return t(this.screenStream);this.currentScreenStreamConfig=e,"function"==typeof navigator.getDisplayMedia?navigator.getDisplayMedia().then(e=>{this.screenStream=e,t(e)}).catch(e=>{this.logger.info("[GET_SCREEN_STREAM]",{error:e}),i(Object(V.n)("screen",e))}):navigator.mediaDevices.getDisplayMedia(e).then(e=>{this.screenStream=e,t(e)}).catch(e=>{this.logger.info("[GET_SCREEN_STREAM]",{error:e}),i(Object(V.n)("screen",e))})})}pauseRecording(){if(this.recordingPaused)return{status:!0};this.pauseRecordingTimer();let{screenRecord:e,webCam:t,audio:i}=this.recordingConfiguration;return e&&this.screenRecorder.pause(),(t||i)&&this.webcamRecorder.pause(),this.recordingPaused=!0,{status:!0}}resumeRecording(e=0){return this.recordingPaused?(setTimeout(()=>{this.resumeRecordingTimer();let{screenRecord:e,webCam:t,audio:i}=this.recordingConfiguration;e&&this.screenRecorder.resume(),(t||i)&&this.webcamRecorder.resume(),this.recordingPaused=!1},e),{status:!0}):{status:!0}}pauseStream({audio:e,webcam:t,screen:i}){try{if(t||e){const i=this.webcamStream.getTracks();e&&(i.filter(e=>"audio"===e.kind)[0].enabled=!1),t&&(i.filter(e=>"video"===e.kind)[0].enabled=!1)}if(i){this.screenStream.getTracks().forEach(e=>{e.enabled=!1})}return{status:!0}}catch(e){return{status:!1,error:e}}}resumeStream({audio:e,webcam:t,screen:i}){try{if(t||e){const i=this.webcamStream.getTracks();e&&(i.filter(e=>"audio"===e.kind)[0].enabled=!0),t&&(i.filter(e=>"video"===e.kind)[0].enabled=!0)}if(i){this.screenStream.getTracks().forEach(e=>{e.enabled=!0})}return{status:!0}}catch(e){return{status:!1,error:e}}}stopOnlyWebcamStream(){if(!this.webcamStream)return;this.logger.info("[STOPPING_WEBCAM_ONLY_STREAM] ",{preview:this.preview});let e=!0;try{this.webcamStream.getTracks().forEach(t=>{"video"===t.kind&&t.stop(),"audio"===t.kind&&(e=!1)})}catch(e){}e&&(this.webcamStream=null)}stopOnlyMicStream(){if(!this.webcamStream)return;this.closeAudioContext(),this.logger.info("[STOPPING_AUDIO_STREAM]");let e=!0;try{this.webcamStream.getTracks().forEach(t=>{"audio"===t.kind&&t.stop(),"video"===t.kind&&(e=!1)})}catch(e){}e&&(this.webcamStream=null)}stopWebcamStream(){if(this.webcamStream){this.logger.info("[STOPPING_WEBCAM_STREAM] ",{preview:this.preview});try{this.webcamStream.getTracks().forEach(e=>{e.stop()})}catch(e){}this.webcamStream=null}}stopScreenStream(){if(this.screenStream){this.logger.info("[STOPPING_SCREEN_STREAM]");try{this.screenStream.getTracks().forEach(e=>{e.stop()})}catch(e){}this.screenStream=null}}stopStreams(){this.stopWebcamStream(),this.stopScreenStream()}checkMicVolumeStatus(e){this.closeAudioContext();const t=new AudioContext;this.audioContext=t;const i=t.createAnalyser(),n=t.createMediaStreamSource(this.webcamStream),r=t.createScriptProcessor(2048,1,1);i.smoothingTimeConstant=.8,i.fftSize=1024,n.connect(i),i.connect(r),r.connect(t.destination),r.onaudioprocess=()=>{const t=new Uint8Array(i.frequencyBinCount);i.getByteFrequencyData(t);0===t.reduce((e,t)=>e+t,0)/t.length?this.noVolumeInitialTime&&(new Date).getTime()-this.noVolumeInitialTime>1e4?(e({error:!0,type:"NO_VOLUME"}),this.noVolumeInitialTime=null):this.noVolumeInitialTime||(this.noVolumeInitialTime=(new Date).getTime()):this.noVolumeInitialTime&&(e({error:!1}),this.noVolumeInitialTime=null)}}startExtensionRecording(){return Object(V.a)({integrationType:this.integrationType})}startRecording(e){this.logger.info("[START_RECORDING]",{settings:e});let t=this;e=e||{},this.resetRecording();const{externalStopStreamCallback:i,timerCallback:n}=e;if(this.setTimerCallback(n),this.recordingConfiguration.maxRecordingTime?this.maxRecordingTime=this.recordingConfiguration.maxRecordingTime:this.maxRecordingTime=null,this.extensionAvailable)return Object(V.p)({recordingConfiguration:this.recordingConfiguration,integrationType:this.integrationType,eventListerClass:this.recorderEvtClass});if(this.webcamStream){let n={mimeType:"video/mp4"};MediaRecorder.isTypeSupported("video/webm")&&(n.mimeType="video/webm"),null!=this.recordingConfiguration.webcamBitRate&&(n.videoBitsPerSecond=1e3*this.recordingConfiguration.webcamBitRate),this.webcamRecorder=new MediaRecorder(this.webcamStream,n),this.webcamRecorder.ondataavailable=e=>{t.s3UploadManager.onDataAvailable(Ke.WEBCAM,e.data)},this.webcamRecorder.onstop=e=>{this.logger.info("[WEBCAM_STREAM_STOPPED]")},this.webcamStream.onended=()=>{this.logger.info("[WEBCAM_STREAM_STOPPED_EXTERNALLY]"),i&&this.screenRecorder&&!this.recordingConfiguration.screenRecord&&i()},this.logger.info("[START_WEBCAM_RECORDING]",{settings:e}),this.webcamRecorder.start(500)}if(this.screenStream){let e="video/mp4";MediaRecorder.isTypeSupported("video/webm")&&(e="video/webm"),(window.opr&&opr.addons||window.opera||navigator.userAgent.indexOf(" OPR/")>=0)&&(e="video/webm;codecs=vp8");let n={mimeType:e};this.screenRecorder=new MediaRecorder(this.screenStream,n),this.screenRecorder.ondataavailable=e=>{t.s3UploadManager.onDataAvailable(Ke.SCREEN,e.data)},this.screenRecorder.onstop=e=>{this.logger.info("[STOP_SCREEN_RECORDING]")},this.logger.info("[START_SCREEN_RECORDING]"),this.screenRecorder.start(500),this.screenStream.onended=()=>{this.logger.info("[SCREEN_RECORDING_STOPPED_STREAM_ENDED]"),i&&i()},this.screenStream.getVideoTracks()[0].onended=()=>{i&&this.screenRecorder&&i()},this.screenStream.getVideoTracks()[0].onmute=()=>{this.logger.info("[SCREEN_RECORDING_MUTED]"),console.error("screen stream muted")},this.screenStream.getVideoTracks()[0].onunmute=()=>{this.logger.info("[SCREEN_RECORDING_UNMUTED]")}}this.startRecordingTimer()}resetRecording(){this.projectJson=null}setTimerCallback(e){this.timerCallback=e}startRecordingTimer(){this.reverseTimer&&this.maxRecordingTime?this.timer=this.maxRecordingTime:this.timer=0,this.clearTimerInterval(),this.startTimer()}startTimer(){this.timerInterval=setInterval(()=>{this.reverseTimer&&this.maxRecordingTime?this.timer--:this.timer++,this.timerCallback&&this.timerCallback(this.timer)},1e3)}pauseRecordingTimer(){this.clearTimerInterval()}resumeRecordingTimer(){this.startTimer()}clearTimerInterval(){clearInterval(this.timerInterval)}finishRecording(e={}){const{progress:t}=e;if(this.postRecordProgressCallback=t,this.logger.info("[FINISH_RECORDING_CALLED]"),this.extensionAvailable)return Object(V.c)(this.integrationType);const i=this.stopRecording();return this.clearTimerInterval(),this.stopStreams(),i.then(e=>{this.uploadCompleteError=!1,this.completeUpload(e)}).catch(e=>{this.removeWarning(),this.uploadCompleteError=!0}),t&&this.setUploadProgressCallback(t),i}setProjectJson(e){this.projectJson=e}setRecordDetails(e){this.recordDetails=e}setExtensionRecording(e){this.extensionRecording=e}cancelRecordingWithoutStream(){return this.logger.info("[CANCEL_RECORIDNG_WITHOUT_STREAM]"),this.removeWarning(),this.stopRecorder(),this.stopScreenStream(),this.recordingPaused=!1,this.s3UploadManager.cancelMultipartUpload()}cancelRecording(){return this.logger.info("[CANCEL_RECORIDNG]"),this.removeWarning(),this.stopRecorder(),this.stopStreams(),this.recordingPaused=!1,this.s3UploadManager.cancelMultipartUpload()}getRecordingObjectUrls(){if(!this.extensionAvailable)try{return this.s3UploadManager.getObjectUrls({recordingConfig:this.recordingConfiguration})}catch(e){}return{}}getRecordingConfiguration(){return this.recordingConfiguration}retryUpload(){return this.logger.info("[RETRY_UPLOAD]"),new Promise((e,t)=>{this.s3UploadManager.retryUpload().then(()=>{this.uploadInitError=!1,this.s3UploadManager.finishUpload().then(e=>{this.uploadCompleteError=!1,this.completeUpload(e)}).catch(e=>{this.uploadCompleteError=!0}),e()}).catch(e=>{t(e),this.s3UploadManager.cancelMultipartUpload()})})}getUploadDetails(){return new Promise((e,t)=>{this.extensionAvailable?Object(V.h)(this.integrationType).then(i=>{i?e({completed:i.status===ee.r.UPLOADED,error:i.status===ee.r.FAILED,completedPercent:i.progress.progress,timeRemaining:i.progress.remainingTime}):t({error:"INVALID_RESPONSE"})}).catch(e=>{t({error:e})}):e(this.s3UploadManager.getUploadProgressDetails())})}isUploadComplete(){return this.extensionRecording&&Object(V.h)(this.integrationType).then(e=>{e&&(this.uploadCompleted=e.status===ee.r.UPLOADED)}).catch(()=>{}),this.uploadCompleted}isPreprocessComplete(){return new Promise((e,t)=>{this.preprocessCompleteCheckInterval=setInterval(()=>{this.projectJson&&e(this.projectJson),this.preprocessError&&t(this.preprocessError),(this.projectJson||this.preprocessError)&&clearInterval(this.preprocessCompleteCheckInterval)},500)})}removePreprocessCompleteCheck(){this.preprocessCompleteCheckInterval&&clearInterval(this.preprocessCompleteCheckInterval)}getRecordDetails(){return new Promise((e,t)=>{this.recordDetails.asset_id?e(this.recordDetails):this.recorderDetailsCheckInterval=setInterval(()=>{this.recordDetails.asset_id&&(e(this.recordDetails),clearInterval(this.recorderDetailsCheckInterval)),this.createRecordError&&t("create_recording_error")},1e3)})}cancelGetRecordDetails(){this.recorderDetailsCheckInterval&&clearInterval(this.recorderDetailsCheckInterval)}async completeUpload(e,t=0){this.logger.info("[RECORDING_UPLOAD_COMPLETED]");const[i,n]=await this.recorderModel.completeUpload({assetId:e,webcamId:this.createRecordingRef.webcamId,screenId:this.createRecordingRef.screenId,recordingConfiguration:this.recordingConfiguration,token:this.token});if(this.logger.info("[COMPLETE_UPLOAD_RESPONSE]",{success:i,error:n}),i){const t=i.data;this.removeWarning(),this.uploadCompleted=!0;let n=t.hippo_recorder;this.startPollingForStatus(e,n,[])}if(n){if(t>1)return this.removeWarning();this.completeUpload(e,++t)}}startPollingForStatus(e,t,i){let n=t.pop();if(null==n)this.saveVideoSuccess(e,i);else{new tt({interval:2e3,token:this.token,tokenType:this.tokenType,email:this.email}).getStatus({operationId:n,waitingHandler:e=>{this.postRecordProgressCallback&&this.postRecordProgressCallback({type:"preprocess",completedPercent:"N/A",completed:!1,message:"Waiting for video to be uploaded",time_remaining:"N/A"})},progressHandler:(e,t,i)=>{this.postRecordProgressCallback&&this.postRecordProgressCallback({type:"preprocess",completedPercent:t,completed:!1,message:e,time_remaining:i})},completeHandler:n=>{if(4==n.operationtype){this.logger.info("[RECORDING_PREPROCESS_COMPLETE]",{event:n}),this.postRecordProgressCallback&&this.postRecordProgressCallback({type:"preprocess",completedPercent:100,completed:!0,message:"Preprocess completed",recordDetails:this.recordDetails});let r={},o=n.data;r.id=o.id,r.duration=o.duration<0?o.audioduration:o.duration,r.type=o.videotype,r.offset=o.offset,i||(i=[]),i.push(r),this.startPollingForStatus(e,t,i)}},errorHandler:e=>{console.error(e)}})}}async saveVideoSuccess(e,t){const i=this;let n=0;const r={version:"2.0",footageList:[],clips:[],totalVideoTracks:3,trackNames:["Screen recording","Webcam","Track 3"],canvasWidth:384,canvasHeight:216,resolution:"720"};let o=0;for(let e=0;e<t.length;e++){let i=t[e];o=0==e?i.duration:Math.min(i.duration,o)}this.recordingConfiguration.sourceConfig||(this.recordingConfiguration.sourceConfig={}),(!this.recordingConfiguration.sourceConfig.webcam||this.recordingConfiguration.sourceConfig.webcam.width<=0||this.recordingConfiguration.sourceConfig.webcam.height<=0)&&(this.recordingConfiguration.sourceConfig.webcam={width:288,height:216}),(!this.recordingConfiguration.sourceConfig.screen||this.recordingConfiguration.sourceConfig.screen.width<=0||this.recordingConfiguration.sourceConfig.screen.height<=0)&&(this.recordingConfiguration.sourceConfig.screen={width:384,height:216});for(let e=0;e<t.length;e++){let i=t[e];r.footageList.push(i.id);let l={};l.id=i.id,l.duration=i.duration,l.containsVideo=1!=i.type||this.recordingConfiguration.webCam,l.containsAudio=1==i.type&&this.recordingConfiguration.audio;let c={xpos:0};if(1==i.type&&t.length>1){let e=Object(V.i)(this.recordingConfiguration.sourceConfig.webcam,this.recordingConfiguration.sourceConfig.screen,this.recordingConfiguration.webcamPosition,this.recordingConfiguration.webcamSize);c.width=e.width,c.height=e.height,c.xpos=e.x,c.ypos=e.y}else{var a;a=1==i.type?this.recordingConfiguration.sourceConfig.webcam:this.recordingConfiguration.sourceConfig.screen;var s=Object(V.d)(a,{width:384,height:216});c.width=s.width,c.height=s.height,c.xpos=s.x,c.ypos=s.y,r.crop={x:s.x,y:s.y,w:s.width,h:s.height}}0==i.type?l.type="screenrecord":l.type="webcam",c.opacity=1,c.volume=this.recordingConfiguration.audio?1:0,c.fadein=0,c.fadeout=0;let d={position:1e-4};d.id=n++,d.start=0,d.end=o,d.track=1==i.type?2:1,d.footage=l,d.deleted=!1,d.properties=c,r.clips.push(d)}if(this.setProjectJson(r),this.projectJson=r,"local"==Object(V.e)()){const[t,n]=await this.recorderModel.mergeAndRender({assetId:e,projectJson:r,renderFrom:"embedded_video"});t&&(new nt.a).deliveryUrgentVideos(i.deliveryToken,(function(e){})),n&&console.error(n)}else(new nt.a).deliveryUrgentVideos(i.deliveryToken,(function(e){}))}generateDummyPJForImport(e){let t,i;e.width/e.height>384/216?(t=384,i=384*e.height/e.width):(i=216,t=216*e.width/e.height);const n={w:t,h:i,x:(384-t)/2,y:(216-i)/2},r={deleted:!1,end:e.duration,id:0,position:"0.00010",start:0,track:1,footage:{id:e.source_id,duration:e.duration,containsVideo:e.contains_video,containsAudio:e.contains_audio,type:"webcam"},properties:{xpos:n.x,ypos:n.y,width:t,height:i,volume:1,opacity:1,fadein:0,fadeout:0}};return{canvasWidth:384,canvasHeight:216,resolution:1080,totalVideoTracks:1,trackNames:["Imported Video"],version:"2.0",footageList:[e.source_id],clips:[r],crop:n}}stopRecording(){return this.logger.info("[STOP_RECORIDNG]"),this.stopRecorder(),this.s3UploadManager.finishUpload()}stopRecorder(){if(this.logger.info("[STOP_RECORDER]"),this.clearTimerInterval(),this.webcamRecorder||this.screenRecorder){for(const e of[this.webcamRecorder,this.screenRecorder])if(e)try{e&&e.stop()}catch(e){}this.webcamRecorder=null,this.screenRecorder=null}}retryMultipartUploadFinish(){return this.logger.info("[RETRY_MULTIPART_UPLOAD_FINISH]"),this.s3UploadManager.finishUpload().then(e=>{this.uploadCompleteError=!1,this.completeUpload(e)}).catch(e=>{this.uploadCompleteError=!0,console.error(e)})}setUploadProgressCallback(e){return this.s3UploadManager.setUploadProgressCallback(e)}createRecordingExponentialBackoff(){this.currentTime||(this.currentTime=new Date),this.exponentialBackoff.retryCount<ee.m&&(this.exponentialBackoff.retryCount+=1,this.exponentialBackoff.setTimeoutRef=setTimeout(()=>{this._sendCreateRecordingRequest()},ee.l*this.exponentialBackoff.retryCount))}initializeUploadManager({data:e,deliveryToken:t}){this.logger.info("[UPLOAD_MANAGER_INITIALIZED]",{data:e}),this.createRecordingRef=e,this.deliveryToken=t,this.s3UploadManager.initializeUploaders(e).catch(e=>{console.error("Upload initialize error ",e),this.uploadInitError=!0})}_sendCreateRecordingRequest(){return new Promise(async(e,t)=>{const[i,n]=await this.recorderModel.createRecording({configuration:this.recordingConfiguration,logUID:this.logUID});if(this.logger.info("[CREATE_RECORDING_RESPONSE]",{success:i,error:n}),i){const t=i.data;this.createRecordingError=!1,this._updateRecordDetails(t),this.recorderAPIUtils&&this.recorderAPIUtils.sendEvent("record_details",{asset_id:this.recordDetails.asset_id,token:this.recordDetails.delivery_token,embed_url:this.recordDetails.embedLink,embed_preview_url:this.recordDetails.embeddedPreviewLink,play_url:this.recordDetails.recordedUrl,thumbnail_url:this.recordDetails.publicThumbnail,thumbnail_play_url:this.recordDetails.publicPlayThumbnail}),e(this.recordDetails),this.recordDetails&&this.initializeUploadManager({data:this.recordDetails,deliveryToken:t.delivery_token}),this.updateCurrentWebcamDimensions()}n&&(n&&n.is_cancelled?console.warn(n):(t(n),this.createRecordingError=!0,this.createRecordingExponentialBackoff()))})}_updateRecordDetails(e){if(!e.status)return this.logger.info("[CREATE_RECORDING_ERROR]",{create_recording_response:e}),void(this.recordDetails=e);this.recordDetails=Object(V.o)({createRecResponse:e,recordingConfiguration:this.recordingConfiguration,digest:this.token})}videoConverting({convertVideoResponse:e,assetId:t,updateProgress:i,resolve:n,reject:r}){this.removeWarning(),this.importStatusPoller=new tt({interval:2e3,token:this.token,tokenType:this.tokenType,email:this.email});const o=this;this.importStatusPoller.getStatus({operationId:e,waitingHandler:e=>{i({type:"processing",completedPercent:0,completed:!1,message:"Waiting for upload to complete"})},progressHandler:(e,t,n)=>{const r=Object(V.k)(n);i({type:"processing",completedPercent:t,completed:!1,timeRemaining:r,message:e})},completeHandler:e=>{i({type:"processing",completedPercent:100,completed:!0,message:"Completed",recordDetails:this.recordDetails}),o.onImportConvertComplete(e,t,n,r)},errorHandler:e=>{this.logger.info("[VIDEO_CONVERSION_PROCESSING_ERROR]",{error:e}),r(e)}})}renderVideo(e){return this.recorderModel.mergeAndRender(e)}async onImportConvertComplete(e,t,i,n){this.logger.info("[VIDEO_CONVERSION_PROCESSING_SUCCESS]",{success:e});let r=-1;!e.data||null==e.data.duration&&null==e.data.audioduration?e.data&&e.data.data instanceof Array&&null!=e.data.data[0]&&(r=null!=e.data.data[0].duration?e.data.data[0].duration:e.data.data[0].audioduration):r=null!=e.data.duration?e.data.duration:e.data.audioduration;const[o,a]=await this.recorderModel.getImportedDetails({assetId:t});if(this.logger.info("[GET_IMPORT_DETAILS]",{success:o,error:a}),o){const e=o.data,t=0==e.contains_video&&1==e.contains_audio;"local"==Object(V.e)()&&(e.projectjson=this.generateDummyPJForImport(e)),t&&delete e.projectjson.crop,this.projectJson=e.projectjson,this.setProjectJson(this.projectJson),i&&i(e)}a&&n(a)}isStreamConfigSame(e=!1,t=!1){let i=!0,n=!0,r=!0;return(e||this.currentWebcamStreamConfig)&&(i=ot()(e&&e.video,this.currentWebcamStreamConfig&&this.currentWebcamStreamConfig.video),n=ot()(e&&e.audio,this.currentWebcamStreamConfig&&this.currentWebcamStreamConfig.audio)),(t||this.currentScreenStreamConfig)&&(r=ot()(t,this.currentScreenStreamConfig)),{isWebcamVideoConfigSame:i,isWebcamAudioConfigSame:n,isScreenConfigSame:r}}updateCurrentWebcamDimensions(){try{const e=this.webcamStream.getVideoTracks()[0].getSettings();this.recordingConfiguration.sourceConfig||(this.recordingConfiguration.sourceConfig={}),this.recordingConfiguration.sourceConfig.webcam={width:e.width,height:e.height}}catch(e){}}activateWarning(){Object(V.q)(this.logger)}removeWarning(){Object(V.l)()}destroy(){this.s3UploadManager=null}},dt=i(218);i(84);var ut,pt,ht,ft,mt,gt,vt,yt,bt=i(222),wt={createAudioMeter:function(e,t,i,n){var r=e.createScriptProcessor(512);return r.onaudioprocess=this.volumeAudioProcess,r.clipping=!1,r.lastClip=0,r.volume=0,r.clipLevel=t||.98,r.averaging=i||.95,r.clipLag=n||750,r.connect(e.destination),r.checkClipping=function(){return!!this.clipping&&(this.lastClip+this.clipLag<window.performance.now()&&(this.clipping=!1),this.clipping)},r.shutdown=function(){this.disconnect(),this.onaudioprocess=null},r},volumeAudioProcess:function(e){for(var t,i=e.inputBuffer.getChannelData(0),n=i.length,r=0,o=0;o<n;o++)t=i[o],Math.abs(t)>=this.clipLevel&&(this.clipping=!0,this.lastClip=window.performance.now()),r+=t*t;var a=Math.sqrt(r/n);this.volume=Math.max(a,this.volume*this.averaging)}},St=(i(110),i(4)),Ct=i.n(St),kt=L.c.div(ut||(ut=Ct()(["\n width: 640px;\n height: 360px;\n background-color: #2E2E2E;\n border-radius: 15px;\n"]))),xt=L.c.div(pt||(pt=Ct()(["\n max-width: 160px;\n width: 20%;\n position: relative;\n div:first-of-type {\n height: 0;\n padding-bottom: 100%;\n }\n"]))),_t=L.c.div(ht||(ht=Ct()(["\n position: absolute;\n display: flex;\n justify-content: center;\n top: 0;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: #0A0A0A;\n align-items: center;\n"]))),Et=L.c.img(ft||(ft=Ct()(["\n height: 50%;\n"]))),Tt=L.c.div(mt||(mt=Ct()(["\n display: flex;\n flex-flow: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n"]))),Pt=L.c.div(gt||(gt=Ct()(["\n &::before {\n content: '';\n background: transparent;\n border: 2px solid rgba(255,255,255,0.15);\n opacity: 1;\n transform: scale(0.45);\n border-radius: 50%;\n box-sizing: border-box;\n display: block;\n height: 200%;\n left: -50%;\n position: absolute;\n top: -50%;\n width: 200%;\n will-change: transform;\n }\n &::after {\n border-radius: 50%;\n box-sizing: border-box;\n content: '';\n display: block;\n height: 200%;\n left: -50%;\n position: absolute;\n top: -50%;\n width: 200%;\n will-change: transform;\n background: transparent radial-gradient(closest-side at 50% 50%, #000000 0%, #121212 0%, #0000002B 100%) 0% 0% no-repeat padding-box;;\n transform: ",";\n transition: transform 300ms steps(6,jump-none) 50ms;\n }\n"])),(function(e){return e.$scale?"scale(".concat(parseFloat(e.$scale),")"):"scale(.5)"})),It=Object(L.c)(Pt)(vt||(vt=Ct()(["\n animation: "," .225s step-end,"," .075s ease .225s;\n"])),At,At),At=Object(L.d)(yt||(yt=Ct()(["\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n"]))),Rt="url",Ot=Object(M.e)("/svg/audio-on.svg");function Nt(e){var t=e.stream,i=e.streamType,n=e.audioIcon,r=void 0===n?Ot:n,o=e.errorCallback,a=Object(s.useRef)(),c=Object(s.useRef)(),d=Object(s.useRef)(!1),u=Object(s.useState)(0),p=u[0],h=u[1];return Object(s.useEffect)((function(){return function(){console.log("AUDIO METER EXITING PROPERLY"),d.current=!0,c.current&&(window.cancelAnimationFrame(c.current),c.current=null)}}),[]),Object(s.useEffect)((function(){if(t&&i!==Rt)try{if(t.getAudioTracks().length){var e=new AudioContext,n=e.createMediaStreamSource(t);a.current=wt.createAudioMeter(e),n.connect(a.current),console.log("DRAWING AUDIO METER"),function e(t){if(!d.current){var i=13*a.current.volume;i<=.5&&.5!=p?h(.5):i>.5&&i<=.55&&.55!=p?h(.55):i>.55&&i<=.6&&.6!=p?h(.6):i>.6&&i<=.65&&.65!=p?h(.65):i>.65&&.7!=p&&h(.7)}setTimeout((function(){c.current=window.requestAnimationFrame(e)}),50)}()}}catch(e){o&&o(e),console.log(e)}}),[t]),l.a.createElement(kt,null,l.a.createElement(Tt,null,l.a.createElement(xt,null,l.a.createElement("div",null),l.a.createElement(It,{$scale:p}),l.a.createElement(_t,null,l.a.createElement(Et,{src:r,alt:"Mic"})))))}var Dt,Lt,Mt,Bt,Ft,Vt,Ut,zt,Ht,jt,qt,$t,Wt=i(223),Gt=L.c.div(Dt||(Dt=Ct()(["\n width: 100%;\n height: 100%;\n"]))),Kt=L.c.iframe(Lt||(Lt=Ct()(["\n width: 100%;\n height: 100%;\n border: none;\n border-radius: 3px;\n"]))),Yt=L.c.div(Mt||(Mt=Ct()(["\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n"]))),Jt=L.c.div(Bt||(Bt=Ct()(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n"]))),Xt=(L.c.img(Ft||(Ft=Ct()(["\n display: block;\n height: 143px;\n width: 68px;\n object-position: bottom;\n object-fit: contain;\n"]))),L.c.div(Vt||(Vt=Ct()(["\n height: 60%;\n position: relative;\n display: flex;\n align-items: flex-end;\n"]))),L.c.div(Ut||(Ut=Ct()(["\n position: relative;\n display: flex;\n"])))),Qt="url";function Zt(e){var t=e.stream,i=e.streamType,n=e.webcam,r=e.mic,o=e.audioIcon,a=e.preview,s=e.lightingCanvasRef,c=e.videoElementRef,d=t;return i===Qt&&(d="".concat(t,"?webcam=true")),l.a.createElement(Yt,null,l.a.createElement(Jt,null,!t&&l.a.createElement("div",null,"Waiting for permission"),n&&i===Qt&&l.a.createElement(Gt,{className:"hv-ext-webcam-preview"},l.a.createElement(Kt,{src:"".concat(d)})),t&&i!==Qt&&l.a.createElement(Xt,null,n&&l.a.createElement(bt.a,{stream:t,ref:c}),n&&t&&a&&l.a.createElement(Wt.a,{ref:s}),!n&&r&&l.a.createElement(Nt,{stream:t,audioIcon:o,streamType:i}))))}L.c.div(zt||(zt=Ct()(["\n position: relative;\n display: flex;\n"]))),L.c.div(Ht||(Ht=Ct()(["\n position: absolute;\n height: 25px;\n width: 2px;\n left: 22px;\n border: 0px;\n"])));var ei,ti=L.c.div(jt||(jt=Ct()(['\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border-radius: 3px;\n & > span {\n font-family: "Open Sans";\n }\n /* Disable button text select by default */\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Old versions of Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none; /* Non-prefixed version, currently\n supported by Chrome, Edge, Opera and Firefox */\n']))),ii=Object(L.c)(ti)(qt||(qt=Ct()(["\n height: 45px;\n margin-top: 3px;\n background-color: #434141;\n & > img {\n height: 10px;\n margin-bottom: 3px;\n }\n & > span {\n font-size: 9px;\n color: ",";\n }\n"])),(function(e){return e.checked?"#37C689":"#EFEFEF"})),ni=Object(L.c)(ti)($t||($t=Ct()(["\n width: 85px;\n height: 85px;\n border-radius: 8px;\n margin: 10px;\n opacity: 0.77;\n transition: 0.3s;\n display: ",";\n border: ",";\n background-color: #0a0a0a;\n pointer-events: ",';\n & > span {\n font-family: "Open Sans";\n font-size: 8px;\n color: ',";\n font-weight: 600;\n }\n & > img {\n height: 28px;\n margin-bottom: 5px !important;\n transition: 0.4s;\n filter: ",";\n ",";\n }\n &:after {\n content: '';\n position: absolute;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background-color: #16C669;\n background-image: url(",");\n background-repeat: no-repeat;\n background-position: center;\n background-size: 50%;\n top: 5px;\n right: 5px;\n transition: 0.3s;\n transform: scale(0);\n }\n ",";\n &:active {\n transform: scale(0.8);\n }\n"])),(function(e){return!e.checked&&e.recordingStarted?"none":"inherit"}),(function(e){return e.checked&&!e.recordingStarted?"2px solid #37C689;":"2px solid #0a0a0a;"}),(function(e){return e.recordingStarted?"none":"all"}),(function(e){return e.recordingStarted?"#FFFFFF":e.checked?"#37C689":"#FFFFFF"}),(function(e){return e.recordingStarted?"brightness(0) saturate(100%) invert(100%) sepia(18%) saturate(2%) hue-rotate(146deg) brightness(110%) contrast(101%)":"none"}),(function(e){if("webcam"==e.type&&!e.checked)return"\n -transform: scale(1.7);\n -margin-top: -1px;"}),(function(e){return e.tickUrl}),(function(e){if(e.checked&&!e.recordingStarted)return"\n &:after {\n // content: '';\n // position: absolute;\n // width: 10px;\n // height: 10px;\n // border-radius: 50%;\n // background-color: #16C669;\n // background-image: url('/svg/tick-white.svg');\n // background-repeat: no-repeat;\n // background-position: center;\n // background-size: 50%;\n // bottom: -5px;\n transform: scale(1);\n }"})),ri=1,oi=2;function ai(e){var t=e.type,i=e.checked,n=e.label,r=e.onClick,o=e.optionType,a=e.recordingStarted,s=function(e){switch(e){case"webcam":return i?Object(M.e)("/svg/rapi/webcam-on.svg"):Object(M.e)("/svg/rapi/webcam-off.svg");case"screen":return i?Object(M.e)("/svg/rapi/screen-on.svg"):Object(M.e)("/svg/rapi/screen-off.svg");default:return i?Object(M.e)("/svg/rapi/mic-on.svg"):Object(M.e)("/svg/rapi/mic-off.svg")}};return o===ri?l.a.createElement(ni,{onClick:function(){return r(t)},checked:i,recordingStarted:a,type:t,tickUrl:Object(M.e)("/svg/tick-white.svg")},l.a.createElement(l.a.Fragment,null,l.a.createElement("img",{src:s(t)})),l.a.createElement("span",null,n)):l.a.createElement(ii,{onClick:function(){return r(t)},checked:i},l.a.createElement("img",{src:s(t)}),l.a.createElement("span",null,n))}var si,li,ci,di=L.c.div(ei||(ei=Ct()(["\n position: absolute;\n width: 60px;\n height: 165px;\n background-color: rgba(0,0,0,0.8);\n right: 0;\n top: 20%;\n border-radius: 7px 0 0 7px;\n padding: 7px 3px;\n z-index: 11;\n"])));function ui(e){var t=e.handleOptionsSelect,i=e.userSelect,n=e.webcam,r=e.screen,o=e.mic,a=e.screenEnabled,s=e.webcamEnabled,c=e.micEnabled;return l.a.createElement(di,null,(i||s)&&l.a.createElement(ai,{type:"webcam",onClick:function(){return t("webcam")},checked:n,previewEnabled:!n,label:"WEBCAM",optionType:oi}),(i||a)&&l.a.createElement(ai,{type:"screen",onClick:function(){return t("screen")},checked:r,previewEnabled:!r,label:"SCREEN RECORD",optionType:oi}),(i||c)&&l.a.createElement(ai,{type:"mic",onClick:function(){return t("mic")},checked:o,previewEnabled:!o,label:"MIC",optionType:oi}))}var pi,hi=L.c.div(si||(si=Ct()(["\n position: ",";\n width: 100%;\n display: flex;\n height: 100%;\n background-color: rgba(47, 48, 49, 0.86);\n top: 0;\n z-index: 10;\n border-radius: ",";\n left: 0;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n"])),(function(e){return e.screen?"fixed":"absolute"}),(function(e){return e.screen?"0":"10px"})),fi=L.c.div(li||(li=Ct()(["\n width: 135PX;\n height: 135PX;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 15;\n border-radius: 50%;\n background-color: transparent;\n border: 7px solid #ECEDF4;\n"]))),mi=L.c.div(ci||(ci=Ct()(["\n position: absolute;\n font: normal normal normal 71px/97px Open Sans;\n font-weight: 600;\n color: #E5E9F5;\n width: 40px;\n letter-spacing: 1.28px;\n"])));function gi(e){var t=e.time,i=e.screen,n=e.timerCallback,r=e.onCountdownComplete,o=parseInt(t)||3,a=Object(s.useState)(o),c=a[0],d=a[1];return Object(s.useEffect)((function(){n(c)}),[c]),Object(s.useEffect)((function(){if(1!==c){var e=setTimeout((function(){d(c-1)}),1e3);return function(){return clearTimeout(e)}}setTimeout((function(){r&&r()}),1e3)})),l.a.createElement(hi,{screen:i},l.a.createElement(fi,null,l.a.createElement(mi,null,c)))}var vi=L.c.div(pi||(pi=Ct()(["\n display: flex;\n margin: ",";\n justify-content:",";\n -width: 300px;\n margin: 0 auto;\n background-color: #2E2E2E;\n border: none;\n"])),(function(e){return e.previewEnabled?"0 auto":"none"}),(function(e){return e.previewEnabled,"center"}));function yi(e){var t=e.userSelect,i=e.screenEnabled,n=e.webcamEnabled,r=e.micEnabled,o=e.screen,a=e.webcam,s=e.mic,c=e.recordingStarted,d=e.handleOptionsSelect;return l.a.createElement(vi,{previewEnabled:!o},(i||t)&&l.a.createElement(ai,{type:"screen",onClick:function(){return d("screen")},checked:o,previewEnabled:!o,label:"SCREEN RECORD",recordingStarted:c,optionType:ri}),(t||n)&&l.a.createElement(ai,{type:"webcam",onClick:function(){return d("webcam")},checked:a,previewEnabled:!a,label:"WEBCAM",recordingStarted:c,optionType:ri}),(t||r)&&l.a.createElement(ai,{type:"mic",onClick:function(){return d("mic")},checked:s,previewEnabled:!s,label:"MICROPHONE",recordingStarted:c,optionType:ri}))}var bi=i(402);class wi{constructor(e){console.log("DATA ",e);const t=window._HVDomain||"https://www.hippovideo.io";this.token=e.token,this.tokenType=e.tokenType,this.email=e.email;const i={baseURL:t+bi.a,headers:{accept:"application/json"}};if(this.tokenType===ee.e.RECORDER_SDK_TOKEN){let e=`${this.tokenType}$$${this.token}`;i.headers.Authorization="Basic "+btoa(e)}if(this.tokenType===ee.e.AUTHENTICATION_TOKEN){let e=`${this.tokenType}$$${this.token}$$${this.email}`;i.headers.Authorization="Basic "+btoa(e)}this.axiosInstance=H.a.create(i)}getAllScripts(e){return this._sendRequest({method:"get",params:e})}async _sendRequest({method:e="get",url:t="",jsonData:i=null,formData:n=null,params:r={},headers:o={},additionalReqConfig:a={}}){try{let s=n;if(n){if("object"==typeof n&&null!==n){let e=new FormData;for(const t in n)e.append(t,n[t]);s=e}o["Content-Type"]="application/x-www-form-urlencoded"}i&&(o["Content-Type"]="application/json");const l={url:t,method:e,data:i||s,headers:o,params:r,...a};console.log("REQUEST CONFIG ",l);return[await this.axiosInstance.request(l),null]}catch(e){if(console.log("ERROR >>>> ",e),H.a.isCancel(e)){return[null,{message:e.message,is_cancelled:!0}]}return[null,e]}}}i(94);var Si=i(46),Ci=i.n(Si),ki=i(47),xi=i.n(ki),_i=i(56),Ei=i.n(_i),Ti=i(61),Pi=i.n(Ti),Ii=i(43),Ai=i.n(Ii),Ri=(i(204),i(86),i(99),i(66),i(55),i(108),i(370),i(174),i(51),i(58),i(64),i(212),i(214),i(199),i(10)),Oi=i(25),Ni=i.n(Oi),Di=i(403),Li=i.n(Di),Mi=i(404),Bi=i.n(Mi),Fi=i(131),Vi=i.n(Fi),Ui=i(128),zi=i.n(Ui),Hi=i(5),ji=i.n(Hi),qi=i(2);const $i=e=>{e.preventDefault();var t=e.originalEvent.clipboardData?e.originalEvent.clipboardData.getData("text/plain"):window.clipboardData.getData("Text");if(document.queryCommandSupported("insertText"))document.execCommand("insertText",!1,t);else{var i=document.getSelection().getRangeAt(0);i.deleteContents();var n=document.createTextNode(t);i.insertNode(n),i.selectNodeContents(n),i.collapse(!1);var r=window.getSelection();r.removeAllRanges(),r.addRange(i)}};function Wi(e){var t=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(e){return!1}}();return function(){var i,n=Ai()(e);if(t){var r=Ai()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return Pi()(this,i)}}var Gi=function(e){Ei()(i,e);var t=Wi(i);function i(){return Ci()(this,i),t.apply(this,arguments)}return xi()(i,[{key:"initialize",value:function(e){HippoVideo.UserProfile||(HippoVideo.UserProfile={}),this.prompterId=e.promptContainer||"teleprompterSiblingDiv";var t=(HippoVideo.UserProfile.userFirstName+" "+HippoVideo.UserProfile.userLastName).trim();this.mergeFieldValues={"Lead Name":t,"Lead Email":HippoVideo.UserProfile.userEmail,"Lead Company Name":HippoVideo.UserProfile.userCompanyName},this.mergeFieldValues=Ri.default.extend({},this.mergeFieldValues,e.mergeFieldValues||{}),this.sdkTeleprompter=e.sdkTeleprompter||!1,this.origin=this.sdkTeleprompter?qi.default.getHippoAssetsDomain():"",this.initialTop=e.initialTop||0,this.lastLineHeight=e.lastLineHeight||60,this.minFontSize=e.minFontSize||15,this.maxFontSize=e.maxFontSize||45,this.minLineSpace=e.minLineSpace||1,this.maxLineSpace=e.maxLineSpace||3,this.minSpeedVal=e.minSpeed||1,this.maxSpeedVal=e.maxSpeed||10,this.newRecorderScreen="newRecorderScreen"==e.from,this.initialScroll=0,this.scrollTimerDown=void 0,this.scriptSelected=!1,this.defaultScriptId=e.defaultScriptId,this.enableChangeScript=null==e.enableChangeScript||e.enableChangeScript,this.settingModel=new zi.a({settingTabName:ji.a.wizSetting.VIDEO_SCRIPT,guestToken:e.guestToken}),this.prompterModel=e.prompterModel,this.callback=e.callback,this.fromChecklistProspecting=e.fromChecklistProspecting,this.fromChecklistInviteVideo=e.fromChecklistInviteVideo,this.initLineSpace(),this.initSpeed(),this.initTextSize(),this.userEmail=HippoVideo.UserProfile.userEmail,this.spaceAllowedTags=["TEXTAREA","INPUT"],this.promptStarted=!1,this.promptCompleted=!1,this.scrollTimeout=50,this.prompterSpeedVal=10,this.nextStep=1,this.allScripts=[],this.showFirstVideoScript=!1,this.isRendered=!1,this.render()}},{key:"bindEvents",value:function(){this.enableDisablePrompter=this.enableDisablePrompter.bind(this),this.selectVideoScript=this.selectVideoScript.bind(this),this.initPrompt=this.initPrompt.bind(this),this.startPrompt=this.startPrompt.bind(this),this.keyPressEvent=this.keyPressEvent.bind(this),this.setSpeedProperties=this.setSpeedProperties.bind(this),this.restartPrompt=this.restartPrompt.bind(this),this.resetPrompt=this.resetPrompt.bind(this),this.changeTextWithMFValues=this.changeTextWithMFValues.bind(this),this.changeVideoScript=this.changeVideoScript.bind(this),this.textSizeIncrease=this.textSizeIncrease.bind(this),this.textSizeDecrease=this.textSizeDecrease.bind(this),this.speedIncrease=this.speedIncrease.bind(this),this.speedDecrease=this.speedDecrease.bind(this),this.lineSpaceIncrease=this.lineSpaceIncrease.bind(this),this.lineSpaceDecrease=this.lineSpaceDecrease.bind(this),this.addNewScriptFromPrompt=this.addNewScriptFromPrompt.bind(this),this.speedSliderChange=this.speedSliderChange.bind(this),this.allScriptsFetchSuccess=this.allScriptsFetchSuccess.bind(this),this.allScriptsFetchFailure=this.allScriptsFetchFailure.bind(this),this.addNewScriptFromAllScripts=this.addNewScriptFromAllScripts.bind(this),this.addNewScriptFromMyScripts=this.addNewScriptFromMyScripts.bind(this),this.refreshVideoPrompter=this.refreshVideoPrompter.bind(this),this.changeVideoScriptWithId=this.changeVideoScriptWithId.bind(this),this.handleTabChange=this.handleTabChange.bind(this)}},{key:"initEvents",value:function(){this.delegate("click",".script-list",this.selectVideoScript),this.delegate("click","#changeScriptId",this.changeVideoScript),this.delegate("click","#addNewScriptFromPrompt",this.addNewScriptFromPrompt),this.delegate("click","#addNewScriptFromAllScripts",this.addNewScriptFromAllScripts),this.delegate("click","#addNewScriptFromMyScripts",this.addNewScriptFromMyScripts),this.delegate("click","#refreshPrompterPages",this.refreshVideoPrompter),this.delegate("click",".tab-title",this.handleTabChange),be()("#enableScriptId").on("click",this.enableDisablePrompter),be()("#disableScriptId").on("click",this.enableDisablePrompter),be()("#speedDecreaseId").on("click",this.speedDecrease),be()("#speedIncreaseId").on("click",this.speedIncrease),be()("#textSizeIncrease").on("click",this.textSizeIncrease),be()("#textSizeDecrease").on("click",this.textSizeDecrease),be()("#lineSpaceIncrease").on("click",this.lineSpaceIncrease),be()("#lineSpaceDecrease").on("click",this.lineSpaceDecrease),be()("#teleprompterId").off("paste").on("paste",$i),be()(document).off("keydown"),be()(document).on("keydown",this.keyPressEvent)}},{key:"render",value:function(){var e=this,t={to_prompt:!0};this.prompterModel?this.prompterModel.getAllScripts(t).then((function(t){return e.allScriptsFetchSuccess(t)})).catch((function(t){return e.allScriptsFetchFailure(t)})):this.settingModel.getAllVideoScript(t,(function(t){e.allScriptsFetchSuccess(t)}),(function(t){e.allScriptsFetchFailure(t)}))}},{key:"allScriptsFetchSuccess",value:function(e){this.$el.empty();var t={inactive_minus:this.inActiveMinus,inactive_plus:this.inActivePlus,inactive_minus_linespace:this.inActiveMinusLine,inactive_plus_linespace:this.inActivePlusLine,inactive_minus_speed:this.inActiveMinusSpeed,inactive_plus_speed:this.inActivePlusSpeed,newRecorderScreen:this.newRecorderScreen,origin:this.origin};if(this.sdkTeleprompter){var i=e[0],n=e[1];if(n)return this.allScriptsFetchFailure(n);this.$el.append(Bi()(Ri.default.extend({},t,i.data,Vi.a)))}else this.$el.append(Li()(Ri.default.extend({},t,e,Vi.a)));this.mergeFieldValues["Lead Company Name"]=e.company_name,this.bindEvents(),this.initEvents(),this.prompterModel||be()(document).foundation(),null!=this.defaultScriptId&&(0==this.defaultScriptId?be()("#allVideoScripts .script-list").first().click():be()("#allVideoScripts").find("#"+this.defaultScriptId).click()),this.enableChangeScript||be()("#changeScriptId").remove(),this.callback&&this.callback();var r=qi.default.getLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId),o=qi.default.getLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId),a=qi.default.getLocalStorageValue("prompt-speed-"+HippoVideo.UserProfile.userId);r&&be()("#teleprompterId").css("line-height",r),o&&be()("#teleprompterId").css("font-size",o+"px"),a&&!isNaN(a)?(parseInt(a)>10&&(a=parseInt(a)/10),be()("#speedSliderId").attr("data-value",a).text(a)):(a=5,be()("#speedSliderId").attr("data-value",a).text(a)),(this.fromChecklistProspecting||this.fromChecklistInviteVideo)&&(this.myScripts=e.my_scripts,this.enableChecklistTeleprompterScript()),this.allScripts=e.all_scripts,this.showFirstVideoScript&&this.displayFirstVideoScript(),this.isRendered=!0}},{key:"allScriptsFetchFailure",value:function(e){console.log("ERROR >>> ",e)}},{key:"enableFirstVideoScript",value:function(){this.showFirstVideoScript=!0}},{key:"displayFirstVideoScript",value:function(){if(!HippoVideo.data.api.getProperty("videosCreatedByUser")&&1==HippoVideo.data.api.getProperty("isSalesUser")&&1==HippoVideo.data.api.getProperty("isTrialPlan")){var e=this.getFirstVideoScript();e&&(this.enableDisablePrompter(),HippoVideo.data.api.getProperty("isNewRecordScreenEnabled")&&(be()(".hvrecorder-promptscript-container").removeClass("disp-none"),be()("#videoPrompterContainer").removeClass("disp-none"),be()("#toggleTeleprompterMenu input").attr("checked",!0),qi.default.setLocalStorageValue("hv-prompt-enable-"+this.userId,!0)),this.changeVideoScriptWithId(e.id),this.enableFirstVideoScriptTooltip())}}},{key:"enableFirstVideoScriptTooltip",value:function(){be()("#enableScriptId, #disableScriptId").addClass("newpr-tooltip").attr("tooltip-hippo",Vi.a.videoPrompter.firstVideoTooltip),qi.default.trackInThirdPartyTools("FV - teleprompter tooltip",{email:this.userEmail})}},{key:"getFirstVideoScript",value:function(){return this.allScripts.filter((function(e){return e.is_first_script}))[0]}},{key:"enableChecklistTeleprompterScript",value:function(){var e=this;this.myScripts&&(this.enableDisablePrompter(),this.myScripts.forEach((function(t){(e.fromChecklistProspecting&&"Prospecting video"==t.title||e.fromChecklistInviteVideo&&"Event invite video / greetings video"==t.title)&&e.changeVideoScriptWithId(t.id)})))}},{key:"initPrompt",value:function(){this.promptheight=be()("#teleprompterId").height(),this.promptTop=this.$el.find("#"+this.prompterId).css("top");var e=be()("#teleprompterId").outerHeight(!0);be()("#teleprompterSiblingDiv").css("min-height",e),"auto"==this.promptTop?this.promptTop=this.$el.find("#"+this.prompterId).position().top:this.promptTop=parseInt(this.promptTop.substr(0,this.promptTop.length-2))}},{key:"refreshVideoPrompter",value:function(){qi.default.trackInThirdPartyTools("Video Prompt refresh clicked",{email:this.userEmail}),this.render(),be()("#refreshPrompterPages").addClass("refreshing")}},{key:"selectVideoScript",value:function(e){var t=e.currentTarget.dataset.text;t=this.changeTextWithMFValues(t),be()("#teleprompterId").text(t),this.$el.find("#"+this.prompterId).css("top","auto"),this.$el.find("#scriptListId, #scriptTypesId").addClass("hide"),this.$el.find("#promptSettingsContainer").removeClass("hide"),this.initPrompt(),this.scriptSelected=!0,this.selectedScriptId=e.currentTarget.id,be()("#telepromterColumnContainer").scrollTop(0),qi.default.trackInThirdPartyTools("Video Prompt on record - script selected",{email:this.userEmail})}},{key:"changeVideoScriptWithId",value:function(e){if(this.$el.find("#"+e).length>0){var t=this.$el.find("#"+e).attr("data-text");t=this.changeTextWithMFValues(t),be()("#teleprompterId").text(t),this.$el.find("#"+this.prompterId).css("top","auto"),this.$el.find("#scriptListId, #scriptTypesId").addClass("hide"),this.$el.find("#promptSettingsContainer").removeClass("hide"),this.initPrompt(),this.scriptSelected=!0,this.selectedScriptId=e,qi.default.trackInThirdPartyTools("Video Prompt on record - script selected",{email:this.userEmail})}}},{key:"changeTextWithMFValues",value:function(e){for(var t in this.mergeFieldValues){var i=this.mergeFieldValues[t];if(i){var n="\\${"+t+"}";e=e.replace(new RegExp(n,"g"),i)}}return e}},{key:"enableDisablePrompter",value:function(){this.$el.toggleClass("disp-none"),be()("#videoPrompterNote, .ed-prompter-link").toggleClass("hide"),be()("#enableScriptId").hasClass("hide")?this.scriptSelected=!1:this.scriptSelected=!0,this.restartPrompt(),this.resetPrompt(),this.$el.find("#promptSettingsContainer").addClass("hide"),this.$el.find("#scriptTypesId, #scriptListId").removeClass("hide"),this.scriptSelected=!1,be()("#teleprompterId").attr("contenteditable","true"),be()("#promptPropertiesId .font-size").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .linespace-container").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .font-size").removeClass("show-tooltip"),be()("#promptPropertiesId .linespace-container").removeClass("show-tooltip"),be()("#telepromterColumnContainer").removeClass("disable-teleprompt-scroll");var e=be()("#enableScriptId").hasClass("hide")?"enabled":"disabled";qi.default.trackInThirdPartyTools("Sales - teleprompter clicked "+e,{email:this.userEmail})}},{key:"keyPressEvent",value:function(e){var t=e.keyCode;this.spaceAllowedTags.includes(e.target.nodeName)||this.$el.find("#teleprompterId").is(":focus")||32!=t||(e.preventDefault(),e.stopPropagation()),this.$el.find("#teleprompterId").is(":focus")||32==t&&(this.promptStarted?(be()("#teleprompterId").attr("contenteditable","true"),be()("#promptPropertiesId .font-size").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .linespace-container").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .font-size").removeClass("show-tooltip"),be()("#promptPropertiesId .linespace-container").removeClass("show-tooltip"),be()("#telepromterColumnContainer").removeClass("disable-teleprompt-scroll"),this.stopPrompt(),this.promptStarted=!1,this.promptCompleted=!1):(this.startPrompt(),this.promptStarted=!0),1==this.promptCompleted&&this.restartPrompt(),qi.default.trackInThirdPartyTools("Video Prompt on record - space pressed",{email:this.userEmail}))}},{key:"startPrompt",value:function(){if(this.scriptSelected)if(this.initPrompt(),parseInt(this.promptTop)>=-1*this.promptheight+this.lastLineHeight){this.$el.find("#"+this.prompterId).css("top",parseInt(this.promptTop)-this.nextStep),be()("#promptPropertiesId .font-size").addClass("show-tooltip"),be()("#promptPropertiesId .linespace-container").addClass("show-tooltip"),be()("#telepromterColumnContainer").addClass("disable-teleprompt-scroll");var e=-1*(parseInt(this.promptTop)-this.nextStep);setTimeout((function(){be()("#telepromterColumnContainer").scrollTop(e)}),1),be()("#teleprompterId").attr("contenteditable","false"),this.scrollTimerDown&&this.stopPrompt(),this.scrollTimerDown=setTimeout(this.startPrompt,this.scrollTimeout)}else be()("#teleprompterId").attr("contenteditable","true"),be()("#promptPropertiesId .font-size").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .linespace-container").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .font-size").removeClass("show-tooltip"),be()("#promptPropertiesId .linespace-container").removeClass("show-tooltip"),be()("#telepromterColumnContainer").removeClass("disable-teleprompt-scroll"),this.stopPrompt()}},{key:"isScriptSelected",value:function(){return this.scriptSelected}},{key:"getSelectedScriptId",value:function(){return this.selectedScriptId}},{key:"getTeleprompterTrackingParams",value:function(){return{"prompt-line-space":parseFloat(qi.default.getLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId)),"prompt-speed-val":parseInt(this.$el.find("#speedSliderId").attr("data-value")),"prompt-font-size":parseInt(be()("#teleprompterId").css("font-size"))}}},{key:"stopPrompt",value:function(){if(this.scrollTimerDown){clearTimeout(this.scrollTimerDown);var e=-1*(parseInt(this.promptTop)-this.nextStep);be()("#teleprompterId").outerHeight()-89<=e&&(this.promptCompleted=!0)}}},{key:"restartPrompt",value:function(){this.resetPrompt(),this.startPrompt()}},{key:"resetPrompt",value:function(){this.stopPrompt(),this.$el.find("#"+this.prompterId).animate({top:this.initialTop}),be()("#telepromterColumnContainer").scrollTop(this.initialScroll)}},{key:"changeVideoScript",value:function(){this.$el.find("#promptSettingsContainer").addClass("hide"),this.$el.find("#scriptTypesId, #scriptListId").removeClass("hide"),this.scriptSelected=!1,qi.default.trackInThirdPartyTools("Video Prompt on record - change script clicked",{email:this.userEmail})}},{key:"textSizeIncrease",value:function(){var e=parseInt(be()("#teleprompterId").css("font-size"));if(e>=this.maxFontSize)this.$el.find("#textSizeIncrease").addClass("in-active");else{this.resetPrompt(),this.$el.find("#textSizeDecrease").removeClass("in-active"),(e+=5)>=this.maxFontSize&&this.$el.find("#textSizeIncrease").addClass("in-active"),be()("#teleprompterId").css("font-size",e+"px");var t=be()("#teleprompterId").outerHeight(!0);be()("#teleprompterSiblingDiv").css("min-height",t),qi.default.setLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId,e),qi.default.trackInThirdPartyTools("Video Prompt on record - text size increased",{email:this.userEmail})}}},{key:"textSizeDecrease",value:function(){var e=parseInt(be()("#teleprompterId").css("font-size"));if(e<=this.minFontSize)this.$el.find("#textSizeDecrease").addClass("in-active");else{this.resetPrompt(),this.$el.find("#textSizeIncrease").removeClass("in-active"),(e-=5)<=this.minFontSize&&this.$el.find("#textSizeDecrease").addClass("in-active"),be()("#teleprompterId").css("font-size",e+"px");var t=be()("#teleprompterId").outerHeight(!0);be()("#teleprompterSiblingDiv").css("min-height",t),qi.default.setLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId,e),qi.default.trackInThirdPartyTools("Video Prompt on record - text size decreased",{email:this.userEmail})}}},{key:"speedIncrease",value:function(){var e=parseInt(this.$el.find("#speedSliderId").attr("data-value")),t=e+1,i=parseInt(this.$el.find("#speedSliderId").attr("data-max"));e>=i||(this.$el.find(".speed-plus-container").removeClass("in-active"),e+=1,this.$el.find("#speedSliderId").attr("data-value",e).text(e),this.setSpeedProperties(),t>=i&&this.$el.find(".speed-plus-container").addClass("in-active"),this.$el.find(".speed-minus-container").removeClass("in-active"),qi.default.trackInThirdPartyTools("Video Prompt on record - speed increased",{email:this.userEmail}))}},{key:"speedDecrease",value:function(){var e=parseInt(this.$el.find("#speedSliderId").attr("data-value")),t=e-1,i=parseInt(this.$el.find("#speedSliderId").attr("data-min"));e<=i||(this.$el.find(".speed-minus-container").removeClass("in-active"),e-=1,this.$el.find("#speedSliderId").attr("data-value",e).text(e),this.setSpeedProperties(),t<=i&&this.$el.find(".speed-minus-container").addClass("in-active"),this.$el.find(".speed-plus-container").removeClass("in-active"),qi.default.trackInThirdPartyTools("Video Prompt on record - speed decreased",{email:this.userEmail}))}},{key:"lineSpaceIncrease",value:function(){var e=parseFloat(qi.default.getLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId));if(e>=this.maxLineSpace)this.$el.find("#lineSpaceIncrease").addClass("in-active");else{this.resetPrompt(),this.$el.find("#lineSpaceDecrease").removeClass("in-active"),(e+=.25)>=this.maxLineSpace&&this.$el.find("#lineSpaceIncrease").addClass("in-active"),be()("#teleprompterId").css("line-height",e);var t=be()("#teleprompterId").outerHeight(!0);be()("#teleprompterSiblingDiv").css("min-height",t),qi.default.setLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId,e),qi.default.trackInThirdPartyTools("Video Prompt on record - line space increased",{email:this.userEmail})}}},{key:"lineSpaceDecrease",value:function(){var e=parseFloat(qi.default.getLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId));if(e<=this.minLineSpace)this.$el.find("#lineSpaceDecrease").addClass("in-active");else{this.resetPrompt(),this.$el.find("#lineSpaceIncrease").removeClass("in-active"),(e-=.25)<=this.minLineSpace&&this.$el.find("#lineSpaceDecrease").addClass("in-active"),be()("#teleprompterId").css("line-height",e);var t=be()("#teleprompterId").outerHeight(!0);be()("#teleprompterSiblingDiv").css("min-height",t),qi.default.setLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId,e),qi.default.trackInThirdPartyTools("Video Prompt on record - line sapce decreased",{email:this.userEmail})}}},{key:"hidePromptProperties",value:function(){console.log("HIDE CALLED"),this.$el.find("#promptPropertiesId").addClass("hide")}},{key:"showPromptProperties",value:function(){this.$el.find("#promptPropertiesId").removeClass("hide")}},{key:"addNewScriptFromPrompt",value:function(){if(qi.default.trackInThirdPartyTools("Video Prompt on record - right side add new script clicked",{email:this.userEmail}),HippoVideo&&HippoVideo.AppRegistry&&HippoVideo.AppRegistry.isDeepIntg){var e=new URL(window.location.protocol+"//"+window.location.host+"/video-scripts/home"),t={authentication_token:HippoVideo.UserProfile.authToken,email:HippoVideo.UserProfile.userEmail,open_new:!0};e.search=new URLSearchParams(t).toString(),window.open(e)}else window.open("/video-scripts/home?open_new=true","_blank");window.opener=null}},{key:"addNewScriptFromAllScripts",value:function(){qi.default.trackInThirdPartyTools("Video Prompt on record - add new script clicked from all scripts",{email:this.userEmail}),window.open("/video-scripts/home?open_new=true","_blank"),window.opener=null}},{key:"addNewScriptFromMyScripts",value:function(){if(qi.default.trackInThirdPartyTools("Video Prompt on record - add new script clicked from my scripts",{email:this.userEmail}),HippoVideo&&HippoVideo.AppRegistry&&HippoVideo.AppRegistry.isDeepIntg){var e=new URL(window.location.protocol+"//"+window.location.host+"/video-scripts/home"),t={authentication_token:HippoVideo.UserProfile.authToken,email:HippoVideo.UserProfile.userEmail,open_new:!0};e.search=new URLSearchParams(t).toString(),window.open(e)}else window.open("/video-scripts/home?open_new=true","_blank");window.opener=null}},{key:"handleTabChange",value:function(e){e.preventDefault(),be()(".tab-title").removeClass("active"),be()(".content").removeClass("active"),be()(e.target.attributes[0].nodeValue).addClass("active"),be()(e.target.attributes[0].nodeValue+"Title").addClass("active");var t=e.target.getAttribute("data-tab");be()("#"+t).addClass("active"),be()("#"+t+"Title").addClass("active")}},{key:"speedSliderChange",value:function(){qi.default.trackInThirdPartyTools("Video Prompt on record - speed slider changed",{email:this.userEmail}),this.setSpeedProperties()}},{key:"setSpeedProperties",value:function(){var e=parseInt(this.$el.find("#speedSliderId").attr("data-value"));qi.default.setLocalStorageValue("prompt-speed-"+HippoVideo.UserProfile.userId,e),this.nextStep=1,this.scrollTimeout=(parseInt(this.$el.find("#speedSliderId").attr("data-max"))-e)*this.prompterSpeedVal,this.restartPrompt()}},{key:"setDefaultSpeed",value:function(e){var t=parseInt(this.$el.find("#speedSliderId").attr("data-value"));e&&!isNaN(e)&&(this.$el.find("#speedSliderId").attr("data-value",e).text(e),t=e),this.nextStep=1,this.scrollTimeout=(parseInt(this.$el.find("#speedSliderId").attr("data-max"))-t)*this.prompterSpeedVal}},{key:"initLineSpace",value:function(){var e=qi.default.getLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId);null==e?(qi.default.setLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId,this.minLineSpace),this.inActiveMinusLine=!0,this.inActivePlusLine=!1):e>=this.maxLineSpace?(qi.default.setLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId,this.maxLineSpace),this.inActiveMinusLine=!1,this.inActivePlusLine=!0):e<=this.minLineSpace&&(qi.default.setLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId,this.minLineSpace),this.inActiveMinusLine=!0,this.inActivePlusLine=!1)}},{key:"initTextSize",value:function(){var e=qi.default.getLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId),t=e;null==e?(t=this.minFontSize,qi.default.setLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId,t),this.inActiveMinus=!0,this.inActivePlus=!1):e>=this.maxFontSize?(t=this.maxFontSize,qi.default.setLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId,t),this.inActiveMinus=!1,this.inActivePlus=!0):e<=this.minFontSize&&(t=this.minFontSize,qi.default.setLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId,t),this.inActiveMinus=!0,this.inActivePlus=!1),be()("#teleprompterId").css("font-size",t+"px")}},{key:"initSpeed",value:function(){var e=qi.default.getLocalStorageValue("prompt-speed-"+HippoVideo.UserProfile.userId),t=e;null==e?(qi.default.setLocalStorageValue("prompt-speed-"+HippoVideo.UserProfile.userId,this.minSpeedVal),t=this.minSpeedVal,this.inActiveMinusSpeed=!0,this.inActivePlusSpeed=!1):e>=this.maxSpeedVal?(qi.default.setLocalStorageValue("prompt-speed-"+HippoVideo.UserProfile.userId,this.maxSpeedVal),t=this.maxSpeedVal,this.inActiveMinusSpeed=!1,this.inActivePlusSpeed=!0):e<=this.minSpeedVal&&(qi.default.setLocalStorageValue("prompt-speed-"+HippoVideo.UserProfile.userId,this.minSpeedVal),t=this.minSpeedVal,this.inActiveMinusSpeed=!0,this.inActivePlusSpeed=!1),this.$el.find("#speedSliderId").text(t)}},{key:"destroy",value:function(){be()(document).off("keydown",this.keyPressEvent),this.undelegateEvents()}}]),i}(Ni.a.View),Ki=(i(74),i(116),i(153),i(154),i(89)),Yi=i.n(Ki),Ji=i(127),Xi=i(405),Qi=i.n(Xi),Zi=i(180);function en(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function tn(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?en(Object(i),!0).forEach((function(t){Yi()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):en(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function nn(e){var t=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(e){return!1}}();return function(){var i,n=Ai()(e);if(t){var r=Ai()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return Pi()(this,i)}}var rn=function(e){Ei()(i,e);var t=nn(i);function i(){return Ci()(this,i),t.apply(this,arguments)}return xi()(i,[{key:"initialize",value:function(e){HippoVideo.UserProfile||(HippoVideo.UserProfile={}),this.prompterId=e.promptContainer||"teleprompterSiblingDiv";var t=(HippoVideo.UserProfile.userFirstName+" "+HippoVideo.UserProfile.userLastName).trim();this.mergeFieldValues={"Lead Name":t,"Lead Email":HippoVideo.UserProfile.userEmail,"Lead Company Name":HippoVideo.UserProfile.userCompanyName},this.mergeFieldValues=Object(Ji.a)({},this.mergeFieldValues,e.mergeFieldValues||{}),this.newRecorderScreen="newRecorderScreen"==e.from,this.activeTab="allVideoScripts",this.scriptSelected=!1,this.defaultScriptId=e.defaultScriptId,this.enableChangeScript=null==e.enableChangeScript||e.enableChangeScript,this.settingModel=new zi.a({settingTabName:ji.a.wizSetting.VIDEO_SCRIPT,guestToken:e.guestToken}),this.prompterModel=e.prompterModel,this.callback=e.callback,this.fromChecklistProspecting=e.fromChecklistProspecting,this.fromChecklistInviteVideo=e.fromChecklistInviteVideo,this.getAudioVolume=e.getAudioVolume,this.userEmail=HippoVideo.UserProfile.userEmail,this.spaceAllowedTags=["TEXTAREA","INPUT"],this.promptStarted=!1,this.promptCompleted=!1,this.allScripts=[],this.showFirstVideoScript=!1,this.isRendered=!1,this.render()}},{key:"bindEvents",value:function(){this.enableDisablePrompter=this.enableDisablePrompter.bind(this),this.selectVideoScript=this.selectVideoScript.bind(this),this.startPrompt=this.startPrompt.bind(this),this.keyPressEvent=this.keyPressEvent.bind(this),this.restartPrompt=this.restartPrompt.bind(this),this.resetPrompt=this.resetPrompt.bind(this),this.changeTextWithMFValues=this.changeTextWithMFValues.bind(this),this.changeVideoScript=this.changeVideoScript.bind(this),this.textSizeRange=this.textSizeRange.bind(this),this.lineSpaceRange=this.lineSpaceRange.bind(this),this.speedRange=this.speedRange.bind(this),this.addNewScriptFromPrompt=this.addNewScriptFromPrompt.bind(this),this.allScriptsFetchSuccess=this.allScriptsFetchSuccess.bind(this),this.allScriptsFetchFailure=this.allScriptsFetchFailure.bind(this),this.addNewScriptFromAllScripts=this.addNewScriptFromAllScripts.bind(this),this.addNewScriptFromMyScripts=this.addNewScriptFromMyScripts.bind(this),this.refreshVideoPrompter=this.refreshVideoPrompter.bind(this),this.changeVideoScriptWithId=this.changeVideoScriptWithId.bind(this),this.handleTabChange=this.handleTabChange.bind(this),this.speedOption=this.speedOption.bind(this),this.scriptSearch=this.scriptSearch.bind(this)}},{key:"initEvents",value:function(){this.delegate("click",".script-list",this.selectVideoScript),this.delegate("click","#changeScriptId",this.changeVideoScript),be()("#addNewScriptFromPrompt").on("click",this.addNewScriptFromPrompt),be()("#addNewScriptFromAllScripts").on("click",this.addNewScriptFromAllScripts),be()("#addNewScriptFromMyScripts").on("click",this.addNewScriptFromMyScripts),be()(".tab-title").on("click",this.handleTabChange),be()("#refreshPrompterPages").on("click",this.refreshVideoPrompter),be()("#enableScriptId").on("click",this.enableDisablePrompter),be()("#disableScriptId").on("click",this.enableDisablePrompter),be()("#textSizeRange").on("change",this.textSizeRange),be()("#lineSpaceRange").on("change",this.lineSpaceRange),be()("#speedRange").on("change",this.speedRange),be()("#speedOption").on("change",this.speedOption),be()("#scriptSearch").on("input",this.scriptSearch),be()(".scrollDetail").on("click",this.scrollDetail),be()(".scrollDetailclose").on("click",this.scrollDetail),be()("#teleprompterId").off("paste").on("paste",$i),be()(document).off("keydown"),be()(document).on("keydown",this.keyPressEvent);var e=this;be()("#telepromterColumnContainer").on("mousedown wheel DOMMouseScroll mousewheel keyup",Object(Zi.a)((function(){be()("#telepromterColumnContainer").stop(!0)}),500,!0)),be()("#telepromterColumnContainer").on("mousedown wheel DOMMouseScroll mousewheel keyup",Object(Zi.a)((function(){e.promptStarted&&e.startPrompt()}),250))}},{key:"render",value:function(){var e=this;this.prompterModel?this.prompterModel.getAllScripts(data).then((function(t){e.scriptResponse=t,e.allScriptsFetchSuccess(t)})).catch((function(t){return e.allScriptsFetchFailure(t)})):this.settingModel.getAllVideoScript({to_prompt:!0,filter_by:1},(function(t){e.scriptResponse=t,e.settingModel.getAllVideoScript({to_prompt:!0,filter_by:2},(function(t){e.scriptResponse.shared_scripts=t.all_scripts,e.allScriptsFetchSuccess(e.scriptResponse)}),(function(t){e.allScriptsFetchSuccess(e.scriptResponse),e.allScriptsFetchFailure(t)})),e.settingModel.getAllVideoScript({to_prompt:!0,filter_by:3},(function(t){e.scriptResponse.my_scripts=t.all_scripts,e.allScriptsFetchSuccess(e.scriptResponse)}),(function(t){e.allScriptsFetchSuccess(e.scriptResponse),e.allScriptsFetchFailure(t)}))}),(function(t){return e.allScriptsFetchFailure(t)}))}},{key:"allScriptsFetchSuccess",value:function(e){this.$el.empty();var t={newRecorderScreen:this.newRecorderScreen,activeTab:this.activeTab};this.$el.append(Qi()(Object(Ji.a)({},t,e,Vi.a))),this.mergeFieldValues["Lead Company Name"]=e.company_name,this.bindEvents(),this.initEvents(),this.prompterModel||be()(document).foundation(),null!=this.defaultScriptId&&(0==this.defaultScriptId?be()("#allVideoScripts .script-list").first().click():be()("#allVideoScripts").find("#"+this.defaultScriptId).click()),this.enableChangeScript||be()("#changeScriptId").remove(),this.callback&&this.callback();var i=qi.default.getLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId),n=qi.default.getLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId),r=qi.default.getLocalStorageValue("prompt-speed-"+HippoVideo.UserProfile.userId),o=qi.default.getLocalStorageValue("prompt-speed-type-"+HippoVideo.UserProfile.userId);(i<1.25||i>2.5)&&(i=1),(n<20||n>40)&&(n=30),(r<1||r>7)&&(r=2),i&&(be()("#lineSpaceRange").val(i),be()("#teleprompterId").css("line-height",i),be()("#lineSpaceCount").text(i)),n&&(be()("#textSizeRange").val(n),be()("#teleprompterId").css("font-size",n+"px"),be()("#textSizeCount").text(n)),r&&!isNaN(r)&&(be()("#speedRange").val(r),be()("#speedCount").text(r)),be()("#speedOption").val(o||"auto"),"voice"===o&&this.speedOption(),(this.fromChecklistProspecting||this.fromChecklistInviteVideo)&&(this.myScripts=e.my_scripts,this.enableChecklistTeleprompterScript()),this.allScripts=e.all_scripts,qi.default.getLocalStorageValue("prompt-enable-"+HippoVideo.UserProfile.userId)&&this.openPrompter(),this.showFirstVideoScript&&this.displayFirstVideoScript(),this.isRendered=!0}},{key:"allScriptsFetchFailure",value:function(e){console.log("ERROR >>> ",e)}},{key:"enableFirstVideoScript",value:function(){this.showFirstVideoScript=!0}},{key:"scriptSearch",value:function(e){var t;e.preventDefault(),e.stopPropagation();var i,n,r,o,a,s,l=null==e||null===(t=e.target.value)||void 0===t?void 0:t.toLowerCase();l?(i=null===(o=this.scriptResponse.all_scripts)||void 0===o?void 0:o.filter((function(e){var t;return-1!==(null===(t=e.title)||void 0===t?void 0:t.toLowerCase().indexOf(l))})),n=null===(a=this.scriptResponse.my_scripts)||void 0===a?void 0:a.filter((function(e){var t;return-1!==(null===(t=e.title)||void 0===t?void 0:t.toLowerCase().indexOf(l))})),r=null===(s=this.scriptResponse.shared_scripts)||void 0===s?void 0:s.filter((function(e){var t;return-1!==(null===(t=e.title)||void 0===t?void 0:t.toLowerCase().indexOf(l))}))):(i=this.scriptResponse.all_scripts,n=this.scriptResponse.my_scripts,r=this.scriptResponse.shared_scripts);this.allScriptsFetchSuccess(tn(tn({},this.scriptResponse),{},{all_scripts:i,my_scripts:n,shared_scripts:r,initialSearchValue:l}));var c=be()("#scriptSearch").val();be()("#scriptSearch").focus().val("").val(c)}},{key:"displayFirstVideoScript",value:function(){if(!HippoVideo.data.api.getProperty("videosCreatedByUser")&&1==HippoVideo.data.api.getProperty("isSalesUser")&&1==HippoVideo.data.api.getProperty("isTrialPlan")){var e=this.getFirstVideoScript();e&&(this.enableDisablePrompter(),this.openPrompter(),this.changeVideoScriptWithId(e.id),this.enableFirstVideoScriptTooltip())}}},{key:"openPrompter",value:function(){be()("#toggleTeleprompterMenu input").attr("checked",!0),be()(".hvrecorder-promptscript-container").removeClass("disp-none"),be()("#videoPrompterContainer").removeClass("disp-none"),be()("#promptHelptextControl").removeClass("disp-none")}},{key:"enableFirstVideoScriptTooltip",value:function(){be()("#enableScriptId, #disableScriptId").addClass("newpr-tooltip").attr("tooltip-hippo",Vi.a.videoPrompter.firstVideoTooltip),qi.default.trackInThirdPartyTools("FV - teleprompter tooltip",{email:this.userEmail})}},{key:"getFirstVideoScript",value:function(){return this.allScripts.filter((function(e){return e.is_first_script}))[0]}},{key:"enableChecklistTeleprompterScript",value:function(){var e=this;this.myScripts&&(this.enableDisablePrompter(),this.myScripts.forEach((function(t){(e.fromChecklistProspecting&&"Prospecting video"==t.title||e.fromChecklistInviteVideo&&"Event invite video / greetings video"==t.title)&&e.changeVideoScriptWithId(t.id)})))}},{key:"refreshVideoPrompter",value:function(e){e.preventDefault(),e.stopPropagation(),qi.default.trackInThirdPartyTools("Video Prompt refresh clicked",{email:this.userEmail}),this.render(),be()("#refreshPrompterPages").addClass("refreshing")}},{key:"selectVideoScript",value:function(e){var t=e.currentTarget.dataset.text;t=this.changeTextWithMFValues(t),be()("#teleprompterId").text(t),this.$el.find("#"+this.prompterId).css("top","auto"),this.$el.find("#scriptListId, #scriptTypesId").addClass("hide"),this.$el.find("#promptSettingsContainer").removeClass("hide"),this.scriptSelected=!0,this.selectedScriptId=e.currentTarget.id,be()("#telepromterColumnContainer").scrollTop(0),qi.default.trackInThirdPartyTools("Video Prompt on record - script selected",{email:this.userEmail})}},{key:"changeVideoScriptWithId",value:function(e){if(this.$el.find("#"+e).length>0){var t=this.$el.find("#"+e).attr("data-text");t=this.changeTextWithMFValues(t),be()("#teleprompterId").text(t),this.$el.find("#"+this.prompterId).css("top","auto"),this.$el.find("#scriptListId, #scriptTypesId").addClass("hide"),this.$el.find("#promptSettingsContainer").removeClass("hide"),this.scriptSelected=!0,this.selectedScriptId=e,qi.default.trackInThirdPartyTools("Video Prompt on record - script selected",{email:this.userEmail})}}},{key:"changeTextWithMFValues",value:function(e){for(var t in this.mergeFieldValues){var i=this.mergeFieldValues[t];if(i){var n="\\${"+t+"}";e=e.replace(new RegExp(n,"g"),i)}}return e}},{key:"enableDisablePrompter",value:function(){this.$el.toggleClass("disp-none"),be()("#videoPrompterNote, .ed-prompter-link").toggleClass("hide"),be()("#enableScriptId").hasClass("hide")?this.scriptSelected=!1:this.scriptSelected=!0,this.restartPrompt(),this.resetPrompt(),this.$el.find("#promptSettingsContainer").addClass("hide"),this.$el.find("#scriptTypesId, #scriptListId").removeClass("hide"),this.scriptSelected=!1,be()("#teleprompterId").attr("contenteditable","true"),be()("#promptPropertiesId .font-size").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .linespace-container").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .font-size").removeClass("show-tooltip"),be()("#promptPropertiesId .linespace-container").removeClass("show-tooltip"),be()("#telepromterColumnContainer").removeClass("disable-teleprompt-scroll");var e=be()("#enableScriptId").hasClass("hide")?"enabled":"disabled";qi.default.trackInThirdPartyTools("Sales - teleprompter clicked "+e,{email:this.userEmail})}},{key:"keyPressEvent",value:function(e){var t=e.keyCode;this.spaceAllowedTags.includes(e.target.nodeName)||this.$el.find("#teleprompterId").is(":focus")||32!=t||(e.preventDefault(),e.stopPropagation()),this.$el.find("#teleprompterId").is(":focus")||32==t&&(this.promptStarted?(be()("#teleprompterId").attr("contenteditable","true"),be()("#promptPropertiesId .font-size").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .linespace-container").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .font-size").removeClass("show-tooltip"),be()("#promptPropertiesId .linespace-container").removeClass("show-tooltip"),be()("#telepromterColumnContainer").removeClass("disable-teleprompt-scroll"),this.stopPrompt(),this.promptCompleted=!1):(1==this.promptCompleted?this.restartPrompt():this.startPrompt(),this.promptStarted=!0),qi.default.trackInThirdPartyTools("Video Prompt on record - space pressed",{email:this.userEmail}))}},{key:"speedOption",value:function(){this.resetPrompt();var e=be()("#speedOption").val();if("auto"===e)be()(document).off("keydown"),be()(document).on("keydown",this.keyPressEvent),clearInterval(this.myInterval),this.myInterval=void 0,be()("#speedRange").show(),be()("#speedCount").show(),this.startPrompt();else{be()(document).off("keydown"),be()("#speedRange").hide(),be()("#speedCount").hide(),this.audioMeterFlow();var t=this;!t.getExtensionAudioVolume&&window.addEventListener("message",(function(e){e.data.type&&"audioMeter"==e.data.type&&(t.getExtensionAudioVolume=e.data.volume)}))}qi.default.setLocalStorageValue("prompt-speed-type-"+HippoVideo.UserProfile.userId,e),qi.default.trackInThirdPartyTools("Video Prompt on record - speed option changed ".concat(e),{email:this.userEmail})}},{key:"scrollDetail",value:function(){be()("#scrollDetailModal").toggle()}},{key:"audioMeterFlow",value:function(){var e=this,t=0,i=0;this.myInterval=setInterval((function(){if("auto"!==be()("#speedOption").val()){var n=100*(e.getExtensionAudioVolume||e.getAudioVolume());t+=n,i++,n>=1.6&&(!e.promptStarted&&!e.promptCompleted&&e.startPrompt(),t=0,i=0),i>5&&(t/i<1.6&&!e.promptCompleted&&e.stopPrompt(),t=0,i=0)}}),100)}},{key:"startPrompt",value:function(){if(this.scriptSelected){var e=this;this.stopPrompt(!0),this.promptStarted=!0,be()("#promptPropertiesId .font-size").addClass("show-tooltip"),be()("#promptPropertiesId .linespace-container").addClass("show-tooltip"),be()("#teleprompterId").attr("contenteditable","false");var t=(be()("#teleprompterId").outerHeight(!0)||0)-(be()("#telepromterColumnContainer").height()||0);be()("#telepromterColumnContainer").animate({scrollTop:t},{duration:(t-(be()("#telepromterColumnContainer").scrollTop()||1))/t*9500*(t/700)*(parseInt(be()("#speedRange").prop("max"))+1-parseInt(be()("#speedRange").val())),easing:"linear",step:function(e,t){},complete:function(){e.promptCompleted=!0,be()("#teleprompterId").attr("contenteditable","true"),be()("#promptPropertiesId .font-size").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .linespace-container").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .font-size").removeClass("show-tooltip"),be()("#promptPropertiesId .linespace-container").removeClass("show-tooltip"),be()("#telepromterColumnContainer").removeClass("disable-teleprompt-scroll"),e.stopPrompt()}})}}},{key:"isScriptSelected",value:function(){return this.scriptSelected}},{key:"getSelectedScriptId",value:function(){return this.selectedScriptId}},{key:"getTeleprompterTrackingParams",value:function(){return{"prompt-line-space":parseFloat(qi.default.getLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId)),"prompt-speed-val":parseInt(this.$el.find("#speedRange").val()),"prompt-font-size":parseInt(be()("#teleprompterId").css("font-size"))}}},{key:"stopPrompt",value:function(){be()("#telepromterColumnContainer").stop(!0),be()("#teleprompterId").off("input"),this.promptStarted=!1}},{key:"restartPrompt",value:function(){this.resetPrompt(),this.startPrompt()}},{key:"resetPrompt",value:function(){this.promptCompleted=!1,this.stopPrompt(),be()("#telepromterColumnContainer").stop(!0),be()("#telepromterColumnContainer").scrollTop(0)}},{key:"changeVideoScript",value:function(){this.stopPrompt(),this.$el.find("#promptSettingsContainer").addClass("hide"),this.$el.find("#scriptTypesId, #scriptListId").removeClass("hide"),this.scriptSelected=!1,qi.default.trackInThirdPartyTools("Video Prompt on record - change script clicked",{email:this.userEmail})}},{key:"textSizeRange",value:function(){var e=parseFloat(qi.default.getLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId)),t=this.$el.find("#textSizeRange").val();be()("#textSizeCount").text(t),this.resetPrompt(),be()("#teleprompterId").css("font-size",t+"px");var i=be()("#teleprompterId").outerHeight(!0);be()("#teleprompterSiblingDiv").css("min-height",i),qi.default.setLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId,t),qi.default.trackInThirdPartyTools("Video Prompt on record - text size ".concat(t>e?"increased":"decreased"),{email:this.userEmail})}},{key:"speedRange",value:function(){var e=parseInt(this.$el.find("#speedRange").val());this.$el.find("#speedCount").text(e);var t=qi.default.setLocalStorageValue("prompt-speed-"+HippoVideo.UserProfile.userId);this.restartPrompt(),qi.default.setLocalStorageValue("prompt-speed-"+HippoVideo.UserProfile.userId,e),qi.default.trackInThirdPartyTools("Video Prompt on record - speed ".concat(e>t?"increased":"decreased"),{email:this.userEmail})}},{key:"lineSpaceRange",value:function(){var e=parseFloat(qi.default.getLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId)),t=this.$el.find("#lineSpaceRange").val();be()("#lineSpaceCount").text(t),this.resetPrompt(),be()("#teleprompterId").css("line-height",t);var i=be()("#teleprompterId").outerHeight(!0);be()("#teleprompterSiblingDiv").css("min-height",i),qi.default.setLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId,t),qi.default.trackInThirdPartyTools("Video Prompt on record - line space ".concat(t>e?"increased":"decreased"),{email:this.userEmail})}},{key:"hidePromptProperties",value:function(){this.$el.find("#promptPropertiesId").hide()}},{key:"showPromptProperties",value:function(){this.$el.find("#promptPropertiesId").show()}},{key:"addNewScriptFromPrompt",value:function(e){if(e.preventDefault(),e.stopPropagation(),qi.default.trackInThirdPartyTools("Video Prompt on record - right side add new script clicked",{email:this.userEmail}),HippoVideo&&HippoVideo.AppRegistry&&HippoVideo.AppRegistry.isDeepIntg){var t=new URL(window.location.protocol+"//"+window.location.host+"/video-scripts/home"),i={authentication_token:HippoVideo.UserProfile.authToken,email:HippoVideo.UserProfile.userEmail,open_new:!0};t.search=new URLSearchParams(i).toString(),window.open(t)}else window.open("/video-scripts/home?open_new=true","_blank");window.opener=null}},{key:"addNewScriptFromAllScripts",value:function(e){e.preventDefault(),e.stopPropagation(),qi.default.trackInThirdPartyTools("Video Prompt on record - add new script clicked from all scripts",{email:this.userEmail}),window.open("/video-scripts/home?open_new=true","_blank"),window.opener=null}},{key:"addNewScriptFromMyScripts",value:function(e){if(e.preventDefault(),e.stopPropagation(),qi.default.trackInThirdPartyTools("Video Prompt on record - add new script clicked from my scripts",{email:this.userEmail}),HippoVideo&&HippoVideo.AppRegistry&&HippoVideo.AppRegistry.isDeepIntg){var t=new URL(window.location.protocol+"//"+window.location.host+"/video-scripts/home"),i={authentication_token:HippoVideo.UserProfile.authToken,email:HippoVideo.UserProfile.userEmail,open_new:!0};t.search=new URLSearchParams(i).toString(),window.open(t)}else window.open("/video-scripts/home?open_new=true","_blank");window.opener=null}},{key:"handleTabChange",value:function(e){e.preventDefault(),e.stopPropagation(),this.scriptSearch(e),be()(".tab-title").removeClass("active"),be()(".content").removeClass("active"),this.activeTab=e.target.attributes[0].nodeValue,be()(e.target.attributes[0].nodeValue).addClass("active"),be()(e.target.attributes[0].nodeValue+"Title").addClass("active");var t=e.target.getAttribute("data-tab");be()("#"+t).addClass("active"),be()("#"+t+"Title").addClass("active")}},{key:"destroy",value:function(){be()(document).off("keydown",this.keyPressEvent),this.undelegateEvents()}}]),i}(Ni.a.View);var on,an,sn,ln,cn,dn,un=function(e){return window.HippoVideo&&window.HippoVideo.data&&HippoVideo.data.api.getProperty("isNewRecordScreenEnabled")&&"newRecorderScreen"===e.from?new rn(e):new Gi(e)},pn=L.c.div(on||(on=Ct()(["\n width: 100%;\n margin: auto;\n position: absolute;\n left: 50%;\n top: 0;\n transform: translateX(-50%);\n z-index: 11;\n -background: transparent linear-gradient(180deg, #000000 0%, #000000CC 83%, #00000000 100%) 0% 0% no-repeat padding-box;\n background: rgba(0,0,0,0.5);\n -border: 1px solid #dbdbdb;\n transition: opacity 0.5s linear, transform 0.2s linear;\n border-radius: 15px 15px 0 0;\n"])));function hn(e){var t=e.countdownStarted,i=e.recordingStarted,n=Object(s.useRef)(),r=Object(s.useRef)(),o=Object(s.useContext)(B.a).authentication,a=function(){n.current.setDefaultSpeed(1)};return Object(s.useEffect)((function(){t&&n.current&&(n.current.resetPrompt(),n.current.hidePromptProperties())}),[t]),Object(s.useEffect)((function(){n.current&&(i?n.current.restartPrompt():(n.current.resetPrompt(),n.current.showPromptProperties()))}),[i]),Object(s.useLayoutEffect)((function(){var e=new wi({token:o.token,tokenType:o.tokenType,email:o.email});return n.current=new un({el:r.current,defaultScriptId:0,prompterModel:e,sdkTeleprompter:!0,enableChangeScript:!1,callback:a}),function(){n.current.destroy(),n.current=null}}),[]),n.current&&!n.current.isScriptSelected()&&i?null:l.a.createElement(pn,{ref:r})}var fn,mn=L.c.div(an||(an=Ct()(["\n position: absolute;\n z-index: 30;\n background: #212126;\n width: 240px;\n box-shadow: 0px 8px 12px rgba(0,0,0,0.1);\n border: 1px solid #34343C;\n bottom: 100%;\n left: 10px;\n border-radius: 5px;\n padding: 8px 5px 12px 5px;\n"]))),gn=L.c.div(sn||(sn=Ct()(["\n width: 90%;\n margin: 0 auto;\n text-align: left;\n"]))),vn=L.c.div(ln||(ln=Ct()(["\n color: #C3C3C3;\n font: normal normal 600 14px/16px Open Sans;\n border-bottom: 1px solid #34343C;\n height: 30px;\n display: flex;\n align-items: center;\n"]))),yn=L.c.div(cn||(cn=Ct()(["\n font: normal normal 600 13px/16px Open Sans;\n color: #C3C3C3;\n margin-top: 5px;\n > span {\n color: #FC3B52;\n }\n"]))),bn=L.c.div(dn||(dn=Ct()(["\n font: italic normal normal 13px/16px Open Sans;\n color: #C3C3C3;\n margin-top: 5px;\n line-height: 18px;\n"])));function wn(e){var t=e.info;return l.a.createElement(mn,null,l.a.createElement(gn,null,l.a.createElement(vn,null,"Lighting Info"),l.a.createElement(yn,null,"Status: ",l.a.createElement("span",null,t.status)),l.a.createElement(bn,null,t.message)))}var Sn,Cn,kn,xn,_n,En,Tn=L.c.div(fn||(fn=Ct()(["\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n & > span {\n font-size: 12px;\n color: #D8D8D8;\n }\n & > img {\n margin-left: 5px;\n margin-right: 5px;\n }\n"])));function Pn(e){var t=e.lightingCanvas,i=e.videoElement,n=Object(s.useState)(!1),r=n[0],o=n[1],a=Object(s.useState)({}),c=a[0],d=a[1],u=i||window&&window.videoPreviewRef&&window.videoPreviewRef.current,p=t||window&&window.lightingCanvasRef&&window.lightingCanvasRef.current,h=Object(s.useRef)();Object(s.useEffect)((function(){return function(){return clearTimeout(h.current)}}),[]),Object(s.useEffect)((function(){if(p&&u){var e=p.getContext("2d"),t=u.offsetWidth,i=t/16*9;p.width=t/15,p.height=i/15,f(u,p,e)}return function(){return clearTimeout(h.current)}}),[p,u,window.videoPreviewRef]);var f=function e(t,i,n){if(0!==i.width&&0!==i.height){n.drawImage(t,0,0,t.videoWidth,t.videoHeight,0,0,i.width,i.height);for(var r=n.getImageData(0,0,i.width,i.height),o=0,a=0;a<r.data.length;a+=4)o+=.21*r.data[a]+.72*r.data[a+1]+.07*r.data[a+2];var s={};(o/=r.data.length)<20?(s.status="Poor",s.message="Your light source is poor. Please move to a better light source."):o<40?(s.status="Good",s.message="Your light source is good. You can improve further by moving to a better light source."):(s.status="Excellent",s.message="Your light source is excellent. Happy recording!"),h.current=setTimeout((function(){window.requestAnimationFrame((function(){e(t,i,n)}))}),1e3),d(s)}};return l.a.createElement(Tn,{onMouseEnter:function(){return o(!0)},onMouseLeave:function(){return o(!1)}},r&&l.a.createElement(wn,{info:c}),l.a.createElement("img",{src:Object(M.e)("/svg/rapi/lighting-icon.svg"),width:"14"}),l.a.createElement("span",null,"Lighting"),l.a.createElement("img",{src:Object(M.e)("/svg/rapi/info-circle-grey.svg"),width:"10"}))}var In,An=L.c.div(Sn||(Sn=Ct()(["\n position: absolute;\n z-index: 30;\n width: 240px;\n bottom: 100%;\n left: -75%;\n background-color: #212126;\n border: 1px solid #34343C;\n border-radius: 6px;\n box-shadow: 0px 8px 12px #00000066;\n"]))),Rn=L.c.div(Cn||(Cn=Ct()(["\n font: normal normal 400 14px/16px Open Sans;\n color: #C3C3C3;\n height: 35px;\n width: 90%;\n display: flex;\n margin: 0 auto;\n align-items: center;\n border-bottom: 1px solid #34343C;\n"]))),On=L.c.div(kn||(kn=Ct()(["\n margin-top: 5px;\n display: flex;\n flex-flow: column;\n justify-content: space-evenly;\n min-height: 150px;\n max-height: 200px;\n"]))),Nn=L.c.div(xn||(xn=Ct()(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 90%;\n margin: 0 auto;\n min-height: 40px;\n max-height: 60px;\n background-color: #292929;\n border-radius: 6px;\n"]))),Dn=L.c.div(_n||(_n=Ct()(["\n max-width: 50%;\n font: italic normal normal 13px/16px Open Sans;\n color: #C3C3C3;\n margin-left: 10px;\n text-align: left;\n"]))),Ln=L.c.div(En||(En=Ct()(["\n font: normal normal 600 14px/16px Open Sans;\n color: #FFFFFF;\n margin-right: 10px;\n"])));function Mn(e){var t=e.webcamQualityInfo,i=void 0===t?{}:t;return l.a.createElement(An,null,l.a.createElement(Rn,null,"Current Webcam Info"),l.a.createElement(On,null,l.a.createElement(Nn,null,l.a.createElement(Dn,null,"Frame rate"),l.a.createElement(Ln,null,i.frameRate)),l.a.createElement(Nn,null,l.a.createElement(Dn,null,"Resolution"),l.a.createElement(Ln,null,i.resolution)),l.a.createElement(Nn,null,l.a.createElement(Dn,null,"Quality"),l.a.createElement(Ln,null,i.quality))))}var Bn,Fn=L.c.div(In||(In=Ct()(["\n display: flex;\n align-items: center;\n justify-content: left;\n position: relative;\n & > span {\n font-size: 12px;\n color: #D8D8D8;\n }\n & > img {\n margin-left: 5px;\n margin-right: 5px;\n }\n"])));function Vn(e){var t=e.webcamQualityInfo,i=Object(s.useState)(!1),n=i[0],r=i[1];return l.a.createElement(Fn,{onMouseEnter:function(){return r(!0)},onMouseLeave:function(){return r(!1)}},n&&l.a.createElement(Mn,{webcamQualityInfo:t}),l.a.createElement("img",{src:Object(M.e)("/svg/rapi/info-white.svg"),width:"14"}),l.a.createElement("span",null,"Video Quality"))}var Un,zn,Hn,jn,qn=L.c.div(Bn||(Bn=Ct()(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n & > span {\n font-size: 11px;\n color: #fff;\n }\n"]))),$n=i(406),Wn=i.n($n),Gn=L.c.div(Un||(Un=Ct()(["\n position: relative;\n"]))),Kn=L.c.label(zn||(zn=Ct()(['\n position: absolute;\n top: 7px;\n left: 0;\n width: 41px;\n height: 19px;\n border-radius: 20px;\n background: #43454E;\n cursor: pointer;\n &::after {\n content: "";\n display: block;\n border-radius: 50%;\n width: 15px;\n height: 15px;\n margin: 2px;\n background: #ffffff;\n box-shadow: 1px 3px 3px 1px rgba(0, 0, 0, 0.2);\n transition: 0.2s;\n }\n']))),Yn=L.c.input(Hn||(Hn=Ct()(["\n opacity: 0;\n z-index: 1;\n border-radius: 15px !important;\n margin: 0 !important; /* Foundation is overriding these styles!!!! */\n width: 42px !important; /* Foundation is overriding these styles!!!! */\n height: 26px !important; /* Foundation is overriding these styles!!!! */\n &:checked + ",' {\n background: #37C689;\n &::after {\n content: "";\n display: block;\n border-radius: 50%;\n width: 15px;\n height: 15px;\n margin-left: 22px;\n transition: 0.2s;\n }\n }\n'])),Kn);function Jn(e){var t=e.selected,i=e.onToggle,n=Object(s.useRef)(Wn()("hv-toggle-"));return l.a.createElement(Gn,null,l.a.createElement(Yn,{id:n.current,onChange:i,type:"checkbox",checked:t}),l.a.createElement(Kn,{htmlFor:n.current}))}function Xn(e){var t=e.showTeleprompter,i=e.onTeleprompterToggle;return l.a.createElement(qn,null,l.a.createElement(Jn,{selected:t,onToggle:i}))}var Qn=L.c.div(jn||(jn=Ct()(["\n background-color: #43454E;\n width: 31px;\n height: 31px;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n z-index: 10;\n img {\n width: ",";\n }\n"])),(function(e){return e.type===Zn.PAUSE_RESUME?"10px":"12px"})),Zn={PAUSE_RESUME:1,ABORT:2};function er(e){var t=e.type,i=e.recordingPaused,n=e.onAbortRecording,r=e.onPauseResumeRecording;return l.a.createElement(Qn,{onClick:function(e){t===Zn.PAUSE_RESUME&&r(e),t===Zn.ABORT&&n(e)},type:t},l.a.createElement("img",{src:t===Zn.PAUSE_RESUME?i?Object(M.e)("/svg/rapi/resume-recording.svg"):Object(M.e)("/svg/rapi/pause-recording.svg"):t===Zn.ABORT?Object(M.e)("/svg/rapi/abort-recording.svg"):void 0}))}i(371),i(78);var tr,ir=i(181),nr=i.n(ir),rr=(i(85),L.c.div(tr||(tr=Ct()(["\n position: relative;\n width: 100%;\n max-width: 150px;\n height: 100%;\n background-color: #121212;\n border-radius: 2px;\n transition: all .5s ease;\n box-shadow: 0px 8px 12px #00000066;\n font: normal normal normal 12px/14px Open Sans;\n text-transform: capitalize;\n color: #FFFFFF;\n text-align: left;\n\n .dropdown-select {\n cursor: ",";\n display: block;\n padding: 10px 30px 10px 10px;\n div {\n text-overflow: ellipsis;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n }\n img {\n position: absolute;\n right: 10px;\n top: 15px;\n }\n }\n\n .dropdown-menu {\n position: absolute;\n width: 100%;\n left: 0;\n margin-top: 1px;\n max-height: 144px;\n overflow-y: auto;\n z-index: 9;\n background-color: #121212;\n border-radius: 2px;\n\n li {\n padding: 10px;\n transition: all .2s ease-in-out;\n cursor: pointer;\n list-style: none;\n &:hover {\n background: #000;\n }\n }\n }\n"])),(function(e){return e.enabled?"pointer":"not-allowed"})));function or(e){var t=e.defaultLabel,i=void 0===t?"Default":t,n=e.items,r=void 0===n?[]:n,o=e.onChange,a=e.disabled,c=void 0!==a&&a,d=Object(s.useState)(),u=d[0],p=d[1],h=Object(s.useState)(!1),f=h[0],m=h[1];return l.a.createElement(rr,{className:"dropdown",enabled:!c},l.a.createElement("div",{className:"dropdown-select",onClick:function(){return!c&&m(!f)}},l.a.createElement("div",null,u||i),l.a.createElement("img",{src:Object(M.e)("/svg/rapi/down-arrow-black.svg")})),f&&l.a.createElement("ul",{className:"dropdown-menu"},r.map((function(e,t){return l.a.createElement("li",{"data-value":e.value,onClick:function(){return t=e.value,i=e.label,p(i),m(!1),void(o&&o(t));var t,i},key:t},e.label)}))))}var ar,sr,lr,cr,dr,ur,pr=1,hr=2;function fr(e){var t,i=e.type,n=e.handleSourceChange,r=e.selectedDevice,o=e.disabled,a=Object(s.useState)([]),c=a[0],d=a[1],u=Object(s.useState)(!0),p=u[0],h=u[1],f=Object(s.useRef)();t=i==pr?{webcam:!0,audio:!1}:{audio:!0,webcam:!1};Object(s.useEffect)((function(){if(f.current&&!o){var e=setInterval((function(){at({webcam:i===pr,audio:i!==pr}).then((function(){clearInterval(e),m()})).catch((function(e){return console.error("PERMISSION ERROR ",e)}))}),2e3);return function(){return clearInterval(e)}}}),[p,o]),Object(s.useEffect)((function(){m()}),[]);var m=function(){st(t).then((function(e){var t=e.error,i=e.devices;if(t)f.current=t,h(!1);else{var n=[];i.audio&&i.audio.forEach((function(e){n.push({value:e.deviceId,label:e.label})})),i.webcam&&i.webcam.forEach((function(e){n.push({value:e.deviceId,label:e.label})})),f.current=null,d(n),h(!1)}})).catch((function(e){console.log(e.name+": "+e.message),h(!1)}))};return function(){if(p)return l.a.createElement(or,{items:[{value:"-1",label:"Fetching the device info"}],disabled:!0});if(f.current)return l.a.createElement(or,{items:[{value:"-1",label:"Permission not given"}],disabled:!0});if(0===c.length)return l.a.createElement(or,{items:[{value:"-1",label:"No devices found"}],disabled:!0});var e=r||"default",t=nr()(c),i=(r&&c.forEach((function(e){if(e.value===r)return e.label})),"Default");return console.log("DEVICES ",t,e),l.a.createElement(or,{items:t,onChange:n,defaultLabel:i,defaultValue:e,disabled:o})}()}var mr,gr=L.c.div(ar||(ar=Ct()(["\n position: absolute;\n width: 345px;\n bottom: 80px;\n left: 30%;\n z-index: 30;\n background-color: #212126;\n border-radius: 5px;\n"]))),vr=L.c.div(sr||(sr=Ct()(["\n color: #fff;\n text-align: left;\n padding: 15px;\n border-bottom: 1px solid #333339;\n"]))),yr=L.c.div(lr||(lr=Ct()(["\n width: 100%;\n margin: 0 auto;\n padding: 15px;\n"]))),br=L.c.div(cr||(cr=Ct()(["\n margin: 0 auto 20px;\n display: flex;\n align-items: center;\n"]))),wr=L.c.label(dr||(dr=Ct()(["\n display: inline-block;\n vertical-align: middle;\n width: 100px;\n font-size: 13px;\n font-weight: 400;\n color: #fff;\n text-align: left;\n"]))),Sr=L.c.div(ur||(ur=Ct()(["\n width: 200px;\n"]))),Cr=function(){for(var e=[],t=0,i=Object.entries(ee.b);t<i.length;t++){var n=i[t],r=n[0],o=n[1];e.push({label:r,value:o})}return e}(),kr=Object(s.forwardRef)((function(e,t){var i=e.webcam,n=e.audio,r=(e.aspectRatio,e.webcamSourceId),o=e.audioSourceId,a=e.onSourceSelection,c=Object(s.useState)(),d=c[0],u=c[1],p=Object(s.useState)(),h=p[0],f=p[1],m=Object(s.useState)(),g=m[0],v=m[1];Object(s.useEffect)((function(){y()}),[g,h,d]);var y=function(){var e={};n&&h&&(e.audio=h),i&&d&&(e.webcam=d),i&&g&&(e.aspectRatio=g),a&&a(e)};return l.a.createElement(gr,{ref:t},l.a.createElement(vr,null,"Settings"),l.a.createElement(yr,null,i&&l.a.createElement(br,null,l.a.createElement(wr,null,"Webcam"),l.a.createElement(Sr,null,l.a.createElement(fr,{handleSourceChange:function(e){u(e)},type:pr,selectedDevice:d||r}))),n&&l.a.createElement(br,null,l.a.createElement(wr,null,"Microphone"),l.a.createElement(Sr,null,l.a.createElement(fr,{handleSourceChange:function(e){f(e)},type:hr,selectedDevice:h||o}))),i&&l.a.createElement(br,null,l.a.createElement(wr,null,"Aspect Ratio"),l.a.createElement(Sr,null,l.a.createElement(or,{defaultLabel:"16:9",items:Cr,onChange:function(e){v(e)}})))))})),xr=L.c.div(mr||(mr=Ct()(["\n display: flex;\n align-items: center;\n justify-content: center;\n & > span {\n position: relative;\n width: 35px;\n height: 35px;\n border-radius: 50%;\n background-color: #43454E;\n cursor: ",";\n opacity: ",";\n\n & > img {\n margin-top: 10px;\n }\n }\n"])),(function(e){return e.enabled?"pointer":"default"}),(function(e){return e.enabled?"1":"0.3"}));function _r(e){var t=e.webcam,i=e.mic,n=e.webcamSourceId,r=e.audioSourceId,o=e.aspectRatio,a=e.onSourceSelection,c=Object(s.useState)(!1),d=c[0],u=c[1],p=Object(s.useRef)(),h=Object(s.useRef)(),f=function(e){!p.current||p.current.contains(e.target)||h.current.contains(e.target)||d&&u(!1)};return Object(s.useEffect)((function(){if(d)return document.addEventListener("mousedown",f),function(){document.removeEventListener("mousedown",f)}}),[p,d]),l.a.createElement(xr,{enabled:t||i},l.a.createElement("span",{onClick:function(){return(t||i)&&u(!d)}},l.a.createElement("img",{ref:h,src:Object(M.e)("/svg/rapi/settings-white.svg"),width:"15"})),d&&l.a.createElement(kr,{ref:p,webcam:t,audio:i,webcamSourceId:n,audioSourceId:r,aspectRatio:o,onSourceSelection:a}))}i(96);var Er,Tr,Pr,Ir,Ar,Rr,Or,Nr,Dr,Lr,Mr,Br=L.c.div(Er||(Er=Ct()(["\n width: 100%;\n"]))),Fr=L.c.iframe(Tr||(Tr=Ct()(["\n width: 100%;\n height: 95%;\n border: 1px solid #ddd;\n border-radius: 8px;\n"]))),Vr=L.c.div(Pr||(Pr=Ct()(["\n position: relative;\n margin: 0;\n"]))),Ur=Object(L.c)(Vr)(Ir||(Ir=Ct()(["\n height: 100%;\n right: 0;\n"]))),zr=Object(L.c)(Vr)(Ar||(Ar=Ct()(["\n width: 60%;\n display: flex;\n align-items: center;\n padding-right: 10px;\n"]))),Hr=L.c.canvas(Rr||(Rr=Ct()(["\n display: block;\n width: 100%;\n height: 100%;\n border-radius: 3px;\n background: #ebebeb 0% 0% no-repeat padding-box;\n"]))),jr=L.c.img(Or||(Or=Ct()(["\n display: block;\n height: 20px;\n width: 20px;\n padding: 4px;\n margin-right: 10px;\n background-color: #525252;\n border-radius: 50%;\n\n // @media only screen and (min-width: 540px) {\n // height: 26px;\n // }\n // @media only screen and (min-width: 720px) {\n // height: 32px;\n // }\n"]))),qr=L.c.div(Nr||(Nr=Ct()(["\n\n"]))),$r=Object(L.c)(qr)(Dr||(Dr=Ct()(["\n height: 90%;\n margin: 0 auto;\n @media only screen and (min-width: 540px) {\n height: 90%;\n }\n @media only screen and (min-width: 720px) {\n height: 91%;\n }\n"]))),Wr=Object(L.c)(qr)(Lr||(Lr=Ct()(["\n width: 80%;\n height: 6px;\n"]))),Gr="url",Kr=1,Yr=2;function Jr(e){var t=e.type,i=e.stream,n=e.streamType,r=e.showIcon,o=e.errorCallback,a=Object(s.useRef)(),c=Object(s.useRef)(),d=Object(s.useRef)();console.log("AUDIO METER ",i,n);var u=function e(i){var n=a.current;null!=n&&(t===Kr?function(e,t){var i,n,r,o,a,s=t.getContext("2d"),l=t.width,c=t.height,d=e*c*5,u=(r=200,o=50,a=255,(i=2*d)<(n=0)?o:i>r?a:(i-n)*(a-o)/(r-n)+o);s.clearRect(0,0,l,c),s.fillStyle="#000",s.fillRect(0,c,l,-3),s.fillStyle="rgb(".concat(Math.floor(u),", ").concat(Math.floor(205-u/2),", 50)"),s.fillRect(0,c,l,-d)}(c.current.volume,n):function(e,t){var i=t.getContext("2d"),n=t.width,r=t.height,o=e*n*5;i.clearRect(0,0,n,r),i.fillStyle="#F5B93F",i.fillRect(0,0,3,n),i.fillRect(0,0,o,n)}(c.current.volume,n)),d.current=window.requestAnimationFrame(e)};Object(s.useEffect)((function(){if(i&&n!==Gr){try{if(i.getAudioTracks().length){var e=new AudioContext,t=e.createMediaStreamSource(i);c.current=wt.createAudioMeter(e),setTimeout((function(){c.current&&0===c.current.volume&&console.log("WARNING FAULTY MIC")}),2e3),t.connect(c.current),console.log("DRAWING AUDIO METER"),u()}}catch(e){o&&o(e),console.log(e)}return function(){console.log("AUDIO METER EXITING PROPERLY"),d.current&&(window.cancelAnimationFrame(d.current),d.current=null)}}}),[i]);var p=i;n===Gr&&(p="".concat(i,"?mic=true"));return function(){switch(t){case t===Kr:return l.a.createElement(Ur,null,n===Gr?l.a.createElement(Br,null,l.a.createElement(Fr,{src:p})):l.a.createElement($r,null,l.a.createElement(Hr,{ref:a})),r&&l.a.createElement(jr,{src:Object(M.e)("/svg/audio-on.svg"),alt:"Mic"}));default:return l.a.createElement(zr,null,r&&l.a.createElement(jr,{src:Object(M.e)("/svg/audio-on.svg"),alt:"Mic"}),n===Gr?l.a.createElement(Br,null,l.a.createElement(Fr,{src:p})):l.a.createElement(Wr,null,l.a.createElement(Hr,{ref:a})))}}()}var Xr,Qr,Zr,eo,to=L.c.div(Mr||(Mr=Ct()(["\n display: flex;\n align-items: center;\n justify-content: right;\n"])));function io(e){var t=e.stream,i=e.streamType,n=e.showIcon;return l.a.createElement(to,null,l.a.createElement(Jr,{type:Yr,stream:t,streamType:i,showIcon:n}))}function no(e){var t=e.recorder,i=Object(s.useState)(0),n=i[0],r=i[1];Object(s.useEffect)((function(){t.setTimerCallback((function(e){return r(e)}))}),[]);return l.a.createElement("div",null,function(){if(n<0)return"0m:0s";var e=parseInt(n,10),t=Math.floor(e/3600),i=Math.floor((e-3600*t)/60),r=e-3600*t-60*i;t<10&&(t="0"+t),i<10&&(i="0"+i),r<10&&(r="0"+r);var o="".concat(i,":").concat(r);return parseInt(t)>0&&(o="".concat(t,"h:").concat(i,"m:").concat(r,"s")),o}())}var ro,oo,ao,so,lo,co=L.c.div(Xr||(Xr=Ct()(["\n display: flex;\n align-items: center;\n justify-content: center;\n"]))),uo=L.c.div(Qr||(Qr=Ct()(["\n width: ",";\n position: relative;\n border-radius: 25px;\n height: ",";\n z-index: 1;\n background-color: ",";\n"])),(function(e){return e.recording?"100px":"auto"}),(function(e){return e.recording?"50px":"auto"}),(function(e){return e.recording?"#43454E":"transparent"})),po=L.c.div(Zr||(Zr=Ct()(["\n position: absolute;\n font-size: 11px;\n color: #ffffff;\n right: 10px;\n top: 35%;\n"]))),ho=L.c.div(eo||(eo=Ct()(["\n width: ",";\n height: ",";\n border-radius: ",";\n left: ",";\n top: ",";\n background-color: rgb(221, 52, 65);\n margin: 0;\n position: relative;\n cursor: pointer;\n &:before {\n position: absolute;\n content: '';\n left: ",";\n top: ",";\n width: ",";\n height: ",";\n z-index: ",";\n border-radius: 50%;\n background-color: ",";\n border: ",";\n margin: 0;\n }\n"])),(function(e){return e.recording?"24px":"34px"}),(function(e){return e.recording?"24px":"34px"}),(function(e){return e.recording?"6px":"50%"}),(function(e){return e.recording?"13px":""}),(function(e){return e.recording?"13px":""}),(function(e){return e.recording?"-10px":"-6px"}),(function(e){return e.recording?"-10px":"-6px"}),(function(e){return e.recording?"44px":"42px"}),(function(e){return e.recording?"44px":"42px"}),(function(e){return e.recording?"-1":"1"}),(function(e){return e.recording?"#FFFFFF":"transparent"}),(function(e){return e.recording?"none":"2px solid rgb(221, 52, 65)"}));function fo(e){var t=e.recorder,i=e.recordingStarted,n=e.onStopRecording,r=e.onStartRecording;return l.a.createElement(co,null,l.a.createElement(uo,{recording:i},l.a.createElement(ho,{recording:i,onClick:function(){return i?n():r()}}),i&&l.a.createElement(po,null,l.a.createElement(no,{recorder:t}))))}var mo,go,vo,yo,bo,wo,So=L.c.div(ro||(ro=Ct()(['\n width: 100%;\n height: 60px;\n position: absolute;\n bottom: 0;\n left: 0;\n background-color: rgba(0,0,0,0.6);\n border-radius: 0 0 15px 15px;\n display: grid;\n grid-template-columns: repeat(2, 1fr) 2fr 2fr;\n font-family: "Open Sans";\n justify-content: center;\n']))),Co=L.c.div(oo||(oo=Ct()(["\n grid-column-start: ",";\n min-width: 200px;\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n place-items: center;\n"])),(function(e){return!e.webcam||e.recordingStarted?"3":"auto"})),ko=L.c.div(ao||(ao=Ct()(["\n position: absolute;\n bottom: 100%;\n text-align: center;\n width: 100%;\n color: #FFFFFF;\n background-color: inherit;\n font: ",";\n > span {\n color: #DD3441;\n font: normal normal 600 16px/22px Open Sans;\n }\n"])),(function(e){return e.recordingStarted?"normal normal normal 12px/17px Open Sans":"normal normal 600 16px/22px Open Sans"})),xo=L.c.div(so||(so=Ct()(["\n\n"]))),_o=L.c.div(lo||(lo=Ct()(["\n color: #fff;\n font-size: 10px;\n"])));function Eo(e){var t=e.recorder,i=e.recordingStarted,n=e.screen,r=e.webcam,o=e.mic,a=e.stream,s=e.streamType,c=e.webcamSourceId,d=e.audioSourceId,u=e.aspectRatio,p=e.onSourceSelection,h=e.showTeleprompter,f=e.onTeleprompterToggle,m=e.teleprompterEnabled,g=e.onAbortRecording,v=e.onPauseResumeRecording,y=e.recordingPaused,b=e.onStartRecording,w=e.onStopRecording,S=e.lightingCanvas,C=e.videoElement,k=e.webcamQualityInfo;return l.a.createElement(So,null,i&&h?l.a.createElement(ko,{recordingStarted:!0},"Note: Press Space to Play/Pause video prompting"):i?void 0:l.a.createElement(ko,null,"Press ",l.a.createElement("span",null,"Record")," to start!"),r&&!i&&l.a.createElement(l.a.Fragment,null,l.a.createElement(Pn,{lightingCanvas:S,videoElement:C}),l.a.createElement(Vn,{webcamQualityInfo:k})),l.a.createElement(Co,{webcam:r,recordingStarted:i},!i&&l.a.createElement(_r,{webcam:r,mic:o,webcamSourceId:c,audioSourceId:d,aspectRatio:u,onSourceSelection:p}),i&&l.a.createElement(er,{type:Zn.ABORT,onAbortRecording:g}),l.a.createElement(fo,{recorder:t,recordingStarted:i,onStartRecording:b,onStopRecording:w}),i&&l.a.createElement(er,{type:Zn.PAUSE_RESUME,onPauseResumeRecording:v,recordingPaused:y}),!i&&!n&&m&&l.a.createElement(xo,null,l.a.createElement(Xn,{showTeleprompter:h,onTeleprompterToggle:f}),l.a.createElement(_o,null,"Teleprompter"))),(r||n)&&o&&a&&l.a.createElement(io,{stream:a,streamType:s,showIcon:!0}))}var To,Po,Io,Ao,Ro,Oo=L.c.div(mo||(mo=Ct()(["\n -width: 80%;\n -margin: 0 auto;\n display: grid;\n grid-template-columns: 1fr 1fr;\n margin-top: 15px;\n position: relative;\n z-index: 20;\n"]))),No=L.c.div(go||(go=Ct()(["\n display: grid;\n align-items: center;\n grid-template-columns: 1fr 4fr;\n -padding-left: 20px;\n padding-right: 10px;\n ","\n"])),(function(e){return e.disabled&&"opacity: 0.4; cursor: not-allowed"})),Do=L.c.div(vo||(vo=Ct()(["\n -background-color: #f5fdf9;\n -border: 1px solid #39ce8e;\n border-radius: 4px;\n width: 40px;\n height: 35px;\n filter: grayscale(1);\n text-align: right;\n & > img {\n height: 15px;\n margin-top: 9px;\n }\n"]))),Lo=L.c.div(yo||(yo=Ct()(["\n width: 40px;\n height: 35px;\n filter: grayscale(1);\n text-align: right;\n & > img {\n height: 15px;\n margin-top: 9px;\n transform: scale(1.2);\n }\n"]))),Mo=L.c.div(bo||(bo=Ct()(["\n margin-left: 15px;\n width: 165px;\n"]))),Bo=L.c.div(wo||(wo=Ct()(["\n display: grid;\n align-items: center;\n grid-template-columns: 1fr 4fr;\n padding-left: 10px;\n -padding-right: 20px;\n ","\n"])),(function(e){return e.disabled&&"opacity: 0.4; cursor: not-allowed"}));function Fo(e){var t=e.webcam,i=e.audio,n=e.handleWebcamSourceChange,r=e.handleAudioSourceChange;return l.a.createElement(Oo,null,l.a.createElement(No,{disabled:!t},l.a.createElement(Do,null,l.a.createElement("img",{src:Object(M.e)("/svg/rapi/webcam-on.svg")})),l.a.createElement(Mo,null,l.a.createElement(fr,{handleSourceChange:n,type:pr,disabled:!t}))),l.a.createElement(Bo,{disabled:!i},l.a.createElement(Lo,null,l.a.createElement("img",{src:Object(M.e)("/svg/rapi/mic-on.svg")})),l.a.createElement(Mo,null,l.a.createElement(fr,{handleSourceChange:r,type:hr,disabled:!i}))))}var Vo,Uo,zo=L.c.div(To||(To=Ct()([""]))),Ho=L.c.div(Po||(Po=Ct()(["\n text-align: center;\n color: #C3C3C3;\n font: normal normal normal 14px/18px Open Sans;\n width: 75%;\n letter-spacing: 0.2px;\n margin: 0 auto;\n"]))),jo=L.c.video(Io||(Io=Ct()(["\n height: 280px;\n"]))),qo=L.c.div(Ao||(Ao=Ct()(["\n width: 90%;\n margin: 15px auto 0 auto;\n text-align: center;\n"]))),$o=L.c.div(Ro||(Ro=Ct()(["\n font: normal normal normal 12px/17px Open Sans;\n color: #FFFFFF;\n letter-spacing: 0.5px;\n margin-top: 10px;\n cursor: pointer;\n"])));function Wo(e){var t=e.permissionError,i=e.webcam,n=e.mic,r=e.onPermissionGranted,o=(e.showClose,e.onClose);Object(s.useEffect)((function(){var e=ee.k[t.type];if(!(isNaN(parseInt(e))||parseInt(e)-1e3>=100)){var o=setInterval((function(){at({webcam:i,mic:n}).then((function(){clearInterval(o),console.log("SUCCESS CAN GO BACK TO THE RECORD SCREEN"),r()})).catch((function(){console.log("PERMISSION NOT YET GRANTED")}))}),1e3);return function(){clearInterval(o)}}}));return l.a.createElement(zo,null,l.a.createElement(qo,null,l.a.createElement(jo,{src:function(){if(t)switch(t.type){case ee.k.WEBCAM_PERMISSION_DENIED:return Object(M.e)("/hippo_videos/WebcamMicPermissionError.mp4");case ee.k.SCREEN_PERMISSION_DENIED:return Object(M.e)("/hippo_videos/ScreenShareCancelError.mp4");case ee.k.SCREEN_PERMISSION_DENIED:case ee.k.SYSTEM_SCREEN_PERMISSION_DENIED:default:return Object(M.e)("/hippo_videos/WebcamAudioSettings.mp4")}return"http://localhost:3000/hippo_videos/WebcamAudioSettings.mp4"}(),autoPlay:!0,muted:!0,loop:!0})),l.a.createElement(Ho,null,function(){if(!t)return"Unknown error";switch(t.type){case ee.k.WEBCAM_PERMISSION_DENIED:return"Webcam permission denied";case ee.k.WEBCAM_NOT_FOUND:return"Webcam device not found";case ee.k.WEBCAM_READ_TIMEOUT:return"Could not start the webcam device. Please restart your browser or system and try again";case ee.k.SCREEN_PERMISSION_DENIED:case ee.k.SYSTEM_SCREEN_PERMISSION_DENIED:return"Please provide system permission to record";case ee.k.SCREEN_PERMISSION_DENIED:return"Please provide permission to record screen";case ee.k.SCREEN_NOT_READABLE_ERROR:return"Error in starting screen recording. Please restart your browser or system and try again";default:return"Unknown device error"}}()),l.a.createElement($o,{onClick:function(e){e.preventDefault(),o&&o()}},"Close"))}var Go,Ko,Yo,Jo,Xo,Qo,Zo,ea=L.c.div(Vo||(Vo=Ct()(['\n position: relative;\n width: 30px;\n height: 30px;\n opacity: 0.7;\n cursor: pointer;\n &:hover {\n opacity: 1;\n }\n &:before,\n &:after {\n position: absolute;\n right: 14px;\n top: 4px;\n content: " ";\n height: 20px;\n width: 2px;\n background-color: #FFFFFF;\n }\n &:before {\n transform: rotate(45deg);\n }\n &:after {\n transform: rotate(-45deg);\n }\n']))),ta=Object(L.c)(ea)(Uo||(Uo=Ct()(["\n background-color: #121212;\n border-radius: 4px;\n"])));function ia(e){var t=e.withBorder,i=void 0!==t&&t,n=e.onClose;return i?l.a.createElement(ta,{onClick:n}):l.a.createElement(ea,{onClick:n})}var na,ra=L.c.div(Go||(Go=Ct()(["\n position: relative;\n border-radius: 15px;\n margin: 0 auto;\n width: 640px;\n min-height: 360px;\n max-height: 500px;\n background-color: #2E2E2E;\n display: grid;\n place-items: center;\n"]))),oa=L.c.div(Ko||(Ko=Ct()(["\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: #000;\n top: 0;\n left: 0;\n border-radius: 15px;\n z-index: 100;\n"]))),aa=L.c.div(Yo||(Yo=Ct()(["\n background: transparent linear-gradient(180deg, #000000 0%, #000000CC 83%, #00000000 100%) 0% 0% no-repeat padding-box;\n font: normal normal 600 14px/16px Open Sans;\n color: ",";\n height: 45px;\n display: flex;\n position: absolute;\n justify-content: center;\n align-items: center;\n top: 0;\n width: 100%;\n left: 0;\n z-index: 10;\n border-radius: 15px 15px 0 0;\n opacity: 0.72;\n"])),(function(e){return e.startedRecording?"#DE3232":"#FFFFFF"})),sa=L.c.div(Jo||(Jo=Ct()(["\n display: grid;\n margin-top: -30px;\n"]))),la=L.c.div(Xo||(Xo=Ct()(["\n display: flex;\n flex-flow: column;\n"]))),ca=L.c.div(Qo||(Qo=Ct()(["\n position: absolute;\n width: 275px;\n bottom: 85px;\n box-shadow: 0px 8px 12px #00000066;\n border: 1px solid #34343C;\n background-color: #212126;\n padding: 5px 15px;\n border-radius: 10px;\n z-index: 10;\n text-align: left;\n .mic-error-modal-header {\n display: flex;\n align-items: center;\n color: #C3C3C3;\n font: normal normal 600 12px/10px Open Sans;\n img {\n margin-right: 10px;\n width: 16px;\n }\n }\n .mic-error-modal-content {\n font: italic normal normal 12px/13px Open Sans;\n color: #C3C3C3;\n padding: 10px 0px;\n line-height: 1.4em;\n }\n"]))),da=L.c.div(Zo||(Zo=Ct()(["\n position: absolute;\n right: -35px;\n top: 0px;\n"]))),ua=L.c.div(na||(na=Ct()(["\n width: 100%;\n height: 100%;\n border-radius: inherit;\n background: rgba(0,0,0,0.6);\n position: absolute;\n z-index: 500;\n .hv-cancel-record-modal {\n display: flex;\n justify-content: center;\n flex-flow: column;\n height: 100%;\n align-items: center;\n &-text {\n color: #fff;\n margin-bottom: 25px;\n }\n &-cancel-option {\n margin-right: 15px;\n }\n }\n"]))),pa=i(21);function ha(e){var t=e.text,i=e.confirmText,n=e.cancelText,r=e.onConfirm,o=e.onCancel;return l.a.createElement(ua,null,l.a.createElement("div",{className:"hv-cancel-record-modal"},l.a.createElement("div",{className:"hv-cancel-record-modal-text"},t),l.a.createElement("div",{className:"hv-cancel-record-modal-options-wrapper"},l.a.createElement(pa.f,{className:"hv-cancel-record-modal-cancel-option",text:n,onClickHandler:o}),l.a.createElement(pa.f,{className:"hv-cancel-record-modal-confirm-option",textColor:pa.d.BLACK,fillColor:pa.c.LIGHT_GRAY,text:i,onClickHandler:r}))))}function fa(e){var t=e.recorder,i=e.recorderAPIUtils,n=e.onFinishRecording,o=e.onRecordingCancel,c=(e.onCloseRecorder,e.extensionAvailable),d=e.handlePopupClose,u=e.action,p=t.getRecordingConfiguration(),h=Object(s.useContext)(B.a).recorderInitOptions,f=h.record_config,m=h.inline,g=f.show_selectable_options,v=f.teleprompter,y=f.screen,b=f.webcam,w=f.mic,S=!1!==y,C=!1!==b,k=!1!==w,x=0!=g,_=Object(s.useState)(S),E=_[0],T=_[1],P=Object(s.useState)(C),I=P[0],A=P[1],R=Object(s.useState)(k),O=R[0],N=R[1],D=Object(s.useState)({}),L=D[0],V=D[1],U=Object(s.useState)(!1),z=U[0],H=U[1],j=Object(s.useState)(!1),q=j[0],$=j[1],W=Object(s.useState)(!1),G=W[0],K=W[1],Y=Object(s.useState)(!1),J=Y[0],X=Y[1],Q=Object(s.useState)(!1),Z=Q[0],te=Q[1],ie=Object(s.useState)({}),ne=ie[0],re=ie[1],oe=Object(s.useState)(!1),ae=oe[0],se=oe[1],le=Object(s.useState)(!1),ce=le[0],de=le[1],ue=Object(s.useState)(!1),pe=ue[0],he=ue[1],fe=Object(s.useRef)({}),me=Object(s.useRef)(),ge=Object(s.useRef)(),ve=Object(s.useRef)(),ye=Object(s.useRef)(!1),be=Object(s.useRef)();Object(s.useEffect)((function(){if(be.current=!0,!c)return u===F.a.PRE_RECORD?Se({preview:!0}):Ce(),function(){return be.current=!1}}),[u]),Object(s.useEffect)((function(){if(L.webcamStream){var e=(e=>{const t=e.getVideoTracks()[0];let i={frameRate:"N/A",resolution:"N/A",quality:"N/A"};if(t){const e=t.getSettings();if(e){const{width:t,height:n,frameRate:r}=e;r&&(i.frameRate=r.toFixed(2)),t&&(i.quality=lt(t)),t&&n&&(i.resolution=`${t} x ${n}`)}}return i})(L.webcamStream);re(e)}}),[L]),Object(s.useEffect)((function(){p.screenRecord=E,p.webCam=I,p.audio=O,t.updateConfig({recordingConfiguration:p}),Se({preview:!0})}),[E,I,O]),Object(s.useEffect)((function(){if(i&&L)return E?void(I?i.sendEvent("_show_webcam_preview",{stream:L.webcamStream}):i.sendEvent("_remove_webcam_preview")):i.sendEvent("_remove_webcam_preview")}),[E,I,L]),Object(s.useEffect)((function(){if(G)if(z)$(!1),H(!1),t.resumeRecording();else{if(!m&&p.screenRecord&&i&&i.sendEvent("hide_frame"),c)return void t.startExtensionRecording().then((function(){X(!0),$(!1)}));xe(),X(!0),$(!1)}}),[G]),Object(s.useEffect)((function(){ae&&I&&at({webcam:!0}).catch((function(){return i.sendEvent("_remove_webcam_preview")}))}),[ae]);var we=function(e){var t=e.error;be.current&&(t&&!ce&&de(!0),t||de(!1))},Se=function(e){var i=e.preview;if((!i||I||O)&&!ye.current)return new Promise((function(e,n){try{ye.current=!0,t.getStream({preview:i}).then((function(i){var n=i.webcamStream,r=i.screenStream,o=i.message,a=i._type;ye.current=!1,"no_config_change"===o&&console.log("STREAM UNCHANGED"),O&&t.checkMicVolumeStatus(we),ve.current=null;var s=a||"stream";V({type:s,webcamStream:n,screenStream:r}),e({type:s,webcamStream:n,screenStream:r})})).catch((function(e){ye.current=!1,ve.current=e,se(!0),n(e)}))}catch(e){ye.current=!1,n(e)}}))},Ce=function(){return ve.current?se(!0):c&&p.screenRecord?(setExtensionRecInitializing(!0),void xe().then((function(){setExtensionRecInitializing(!1),$(!0)}))):void Se({preview:!1}).then((function(e){if(c)return setExtensionRecInitializing(!0),void xe().then((function(){setExtensionRecInitializing(!1),$(!0)}));i.sendEvent("record_started"),i.sendEvent("_record_started",{showWebcamPreview:p.screenRecord&&p.webCam,stream:e&&e.webcamStream,showMarkupTools:p.screenRecord}),ke(),$(!0)}))},ke=function(){t.createRecording(p).then((function(e){e.status&&(p.webcam={key:e.webcamKey,bucket:e.uploadBucket},p.screen={key:e.screenKey,bucket:e.uploadBucket},t.updateConfig({recordingConfiguration:p}),fe.current=e)})).catch((function(e){console.error("CREATE RECORDING ERROR ",e)}))},xe=function(){return t.startRecording({externalStopStreamCallback:_e})},_e=function(){var e=r()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.sendEvent("record_stopped"),t.finishRecording().then((function(e){c&&n()})).catch((function(e){console.error("ASSET_ID",e)})),c){e.next=8;break}return e.t0=n,e.next=6,t.getRecordingObjectUrls();case 6:e.t1=e.sent,(0,e.t0)(e.t1);case 8:H(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ee=function(){he(!1),H(!1),t.resumeRecording()},Te=function(){var e=0;return E&&e++,I&&e++,O&&e++,e>1},Pe=function(e){var i=e.webcam,n=e.audio,r=e.aspectRatio;if(i||n||r){var o=0;i&&i!==p.webcamSourceId&&(p.webcamSourceId=i,o++),n&&n!==p.audioSourceId&&(p.audioSourceId=n,o++),r&&r!==p.aspectRatio&&(p.aspectRatio=r,o++),console.info("FETCH STREAM 3 ",o),t.updateConfig({recordingConfiguration:p}),o>0&&Se({preview:!0})}},Ie=function(e){if(x)switch(function(e){if(ve.current){var t=ee.k[ve.current.type],i="webcam";parseInt(t)-1e3>=100&&(i="screen"),"screen"===e&&"screen"===i&&E&&(ve.current=null),"webcam"!==e&&"mic"!==e||"webcam"!==i||!("webcam"===e&&I||"mic"===e&&O)||(ve.current=null)}}(e),e){case"screen":if(E&&!Te())return;T(!E);break;case"webcam":if(I&&!Te())return;A(!I);break;case"mic":if(O&&!Te())return;N(!O)}},Ae=function(){ve.current.type===ee.k.SCREEN_PERMISSION_DENIED&&(ve.current=null),se(!1)};return l.a.createElement(ra,null,!m&&!J&&l.a.createElement(da,null,l.a.createElement(ia,{withBorder:!0,onClose:d})),pe&&l.a.createElement(ha,{text:"Do you want to cancel the recording?",confirmText:"Yes",cancelText:"No",onConfirm:function(){i.sendEvent("record_cancelled"),t.cancelRecordingWithoutStream(),he(!1),X(!1),H(!1),K(!1),o()},onCancel:function(){he(!1),K(!1),$(!0)}}),!Z&&!q&&l.a.createElement(aa,{startedRecording:J},J&&z?"Recording paused":J?"Recording in progress":"Record Preview"),q&&l.a.createElement(gi,{timerCallback:function(e){i.sendEvent("countdown_timer",{time_left:e})},screen:E,onCountdownComplete:function(){i.sendEvent("countdown_complete"),K(!0)}}),O&&ce&&l.a.createElement(ca,null,l.a.createElement("div",{className:"mic-error-modal-header"},l.a.createElement("img",{src:Object(M.e)("/svg/rapi/error-circle-red.svg")}),"Microphone audio error"),l.a.createElement("div",{className:"mic-error-modal-content"},"No volume detected. Please check your microphone before continuing recording.")),Z&&!E&&l.a.createElement(hn,{countdownStarted:q,recordingStarted:J}),l.a.createElement(la,null,E&&l.a.createElement(sa,null,l.a.createElement(yi,{screenEnabled:y,webcamEnabled:b,micEnabled:w,userSelect:x,recordingStarted:J,screen:E,webcam:I,mic:O,handleOptionsSelect:Ie})),E&&!J&&l.a.createElement(l.a.Fragment,null,l.a.createElement(Fo,{webcam:I,audio:O,webcamSourceId:p.webcamSourceId,audioSourceId:p.audioSourceId,handleWebcamSourceChange:function(e){return Pe({webcam:e})},handleAudioSourceChange:function(e){return Pe({audio:e})}}))),ae&&l.a.createElement(oa,null,l.a.createElement(Wo,{permissionError:ve.current,webcam:I,mic:O,showClose:!0,onClose:Ae,onPermissionGranted:function(){ve.current=null,Ae(),Se({preview:!0})}})),!E&&l.a.createElement(Zt,{stream:L.webcamStream,streamType:L.type,webcam:I,mic:O,audioIcon:ce?Object(M.e)("/svg/rapi/mic-error-main-red.svg"):Object(M.e)("/svg/audio-on.svg"),preview:!J,lightingCanvasRef:me,videoElementRef:ge}),!E&&!J&&x&&l.a.createElement(ui,{screenEnabled:y,webcamEnabled:b,micEnabled:w,userSelect:x,screen:E,webcam:I,mic:O,handleOptionsSelect:Ie}),l.a.createElement(Eo,{recorder:t,recordingStarted:J,screen:E,webcam:I,mic:O,stream:L.webcamStream,streamType:L.type,webcamSourceId:p.webcamSourceId,audioSourceId:p.audioSourceId,aspectRatio:p.aspectRatio,onSourceSelection:Pe,showTeleprompter:Z,onTeleprompterToggle:function(){return te(!Z)},teleprompterEnabled:v,onAbortRecording:function(){t.pauseRecording(),H(!0),K(!1),he(!0)},onPauseResumeRecording:function(){z?(Ee(),i.sendEvent("record_resumed")):(i.sendEvent("record_paused"),t.pauseRecording(),H(!0))},recordingPaused:z,onStartRecording:Ce,onStopRecording:_e,lightingCanvas:me.current,videoElement:ge.current,webcamQualityInfo:ne}))}var ma,ga=i(278),va=i.n(ga),ya=L.c.div(ma||(ma=Ct()(["\n display: flex;\n justify-content: center;\n flex-flow: column;\n align-items: center;\n height: 350px;\n border: 1px solid #E5E5E5;\n border-radius: 14px;\n .close-recorder-options-warpper {\n margin-top: 20px;\n }\n"])));function ba(e){var t=e.onVideoCancelRevert,i=e.onRecorderClose;return l.a.createElement(ya,null,l.a.createElement("p",null,"Are you sure you want to cancel the recording?"),l.a.createElement("div",{className:"close-recorder-options-warpper"},l.a.createElement(pa.f,{text:"Cancel Recording",onClickHandler:function(){console.log("RECORDER CANCEL VIDEO"),i(),console.log("Cancel recording")},style:{marginRight:"10px"}}),l.a.createElement(pa.f,{text:"Go Back",onClickHandler:function(){t(),console.log("Go back")}})))}var wa,Sa=i(407),Ca=i.n(Sa),ka=L.c.div(wa||(wa=Ct()(["\n margin: 0 auto;\n"])));function xa(e){var t=e.importVideoUrl,i=e.screenUrl,n=e.webcamUrl,r=e.thumbnailUrl,o=e.isAudioOnly,a=e.recordingConfiguration,c=e.customColors,d=e.onVideoPlayerInitialize,u=Object(s.useRef)(),p=Object(s.useRef)(),h=function(){if(i)return n};return Object(s.useEffect)((function(){u.current&&(p.current=new Ca.a(function(){var e;if(a&&a.screenRecord&&a.webCam){var s={width:288,height:216};a.sourceConfig&&a.sourceConfig.webcam&&(s=a.sourceConfig.webcam),e=qi.default.fitCenterLayout(s,{width:384,height:216})}return{el:u.current,fromSDK:!0,id:"preview-video",src:t||i||n||void 0,audioSrc:h(),fullscreenControl:!1,primaryVideoLayout:e,customColors:c,isAudioOnly:o,integType:"generic_embed",thumbnail:r}}()),d(p.current),p.current.show(),setTimeout((function(){p.current.resizePlayerForWindow()}),1e3))}),[u,p,n,i]),l.a.createElement(s.Fragment,null,l.a.createElement(ka,{ref:u}))}var _a,Ea,Ta=i(412),Pa=L.c.div(_a||(_a=Ct()(["\n background: ",";\n height: 100%;\n border-radius: inherit;\n transition: width 0.2s ease-in;\n"])),(function(e){return e.primaryColor}));function Ia(e){var t=e.completedPercent,i=e.error,n=Object(s.useContext)(B.a),r=n&&n.theme&&n.theme.primaryColor;return r||(r="#FD7564"),i?l.a.createElement(Pa,{primaryColor:r,style:{width:"0%"}}):l.a.createElement(Pa,{primaryColor:r,style:{width:"".concat(t,"%")}})}var Aa,Ra,Oa,Na,Da,La=L.c.div(Ea||(Ea=Ct()(["\n position: relative;\n height: 8px;\n width: 100%;\n border-radius: 50px;\n border: none;\n background-color: #EDEDED;\n"])));function Ma(e){return l.a.createElement(La,null,l.a.createElement(Ia,e))}var Ba=L.c.div(Aa||(Aa=Ct()(["\n border: ",";\n width: 100%;\n background-color: ",";\n border-radius: 8px;\n padding: 20px 15px;\n margin-bottom: 15px;\n ","\n &.upload-progress-enter {\n max-height: 0px;\n overflow: hidden;\n }\n &.upload-progress-enter-active {\n max-height: 100px;\n overflow: auto;\n transition: max-height 500ms ease-in;\n }\n &.upload-progress-exit {\n max-height: 100px;\n border: none;\n }\n &.upload-progress-exit-active {\n max-height: 0px;\n border: none;\n overflow: hidden;\n transition: max-height 500ms ease-in;\n }\n"])),(function(e){return e.progressType===Ha.IMPORT?"none":"1px solid #E6E6E6"}),(function(e){return e.progressType===Ha.IMPORT?"transparent":"#FFFFFF"}),(function(e){return e.progressType!==Ha.IMPORT&&"box-shadow: 0px 8px 12px #0000001A;"})),Fa=L.c.div(Ra||(Ra=Ct()(["\n display: flex;\n justify-content: space-between;\n padding: 10px 0 5px 0;\n"]))),Va=L.c.div(Oa||(Oa=Ct()(["\n font-size: 13px;\n font-family: 'Open Sans';\n color: ",";\n"])),(function(e){return e.progressType===Ha.IMPORT?"#FFFFFF":"#4B4C4C"})),Ua=L.c.div(Na||(Na=Ct()(["\n font-family: 'Open Sans';\n font-size: 12px;\n color: ",";\n"])),(function(e){return e.progressType===Ha.IMPORT?"#FFFFFF":"#4B4C4C"})),za=L.c.div(Da||(Da=Ct()(["\n text-align: right;\n font-family: 'Open Sans';\n font-size: 12px;\n color: ",";\n padding: 5px 0 10px 0;\n"])),(function(e){return e.progressType===Ha.IMPORT?"#D5D5D5":"#848383"})),Ha={RECORD:1,IMPORT:2};function ja(e){var t=e.progressStatus,i=e.timeRemainingStatus,n=e.uploadProgress,r=e.type,o=n.completedPercent,a=void 0===o?0:o,c=n.type,d=Object(s.useRef)(),u=Object(s.useRef)();return Object(s.useEffect)((function(){return d.current=0,u.current=null,function(){d.current=0,u.current=null}}),[]),n.error&&(d.current=0),(n.completed||100!==n.completedPercent)&&(u.current===c&&"upload"!=n.type?d.current<a&&(d.current=a):(u.current=c,d.current=a)),l.a.createElement(Ba,{progressType:r},l.a.createElement(Fa,null,l.a.createElement(Va,{progressType:r},t),l.a.createElement(Ua,{progressType:r},"".concat(d.current,"%"))),l.a.createElement(Ma,{completedPercent:d.current,error:n.error}),l.a.createElement(za,{progressType:r},i))}var qa,$a={completedPercent:0,type:"upload"};function Wa(e){var t=e.showUploadProgress,i=e.recorder,n=e.onUploadComplete,r=e.onUploadError,o=Object(s.useState)($a),a=o[0],c=o[1],d=Object(s.useRef)(),u=Object(M.f)(a);return Object(s.useEffect)((function(){if(!d.current)return d.current=setInterval((function(){try{if(!t)return clearInterval(d.current),void(d.current=null);i.getUploadDetails().then((function(e){return e&&e.completed?(n(),clearInterval(d.current),void(d.current=null)):e&&e.error?(r(e.errorType),clearInterval(d.current),void(d.current=null)):void c(e)})).catch((function(e){console.error("UPLOAD STATUS FETCH ERROR ",e),clearInterval(d.current),d.current=null}))}catch(e){console.error("UPLOAD PROGRESS EX ",e)}}),1e3),function(){clearInterval(d.current),d.current=null}})),l.a.createElement(D,{in:t,timeout:300,unmountOnExit:!0,classNames:"upload-progress"},l.a.createElement(ja,{type:Ha.RECORD,timeRemainingStatus:u,uploadProgress:a,progressStatus:"Uploading Video"}))}var Ga,Ka=L.c.div(qa||(qa=Ct()(["\n box-shadow: 0px 8px 12px #0000001a;\n border: 1px solid #E6E6E6;\n padding: 20px 35px;\n margin: 10px 0;\n border-radius: 8px;\n .error-widget {\n &-text {\n margin-bottom: 10px;\n text-align: left;\n }\n &-cta-wrapper {\n text-align: right;\n button:last-of-type {\n margin-right: 20px;\n }\n }\n &-retry-button-wrapper {\n display: inline;\n }\n &-download-button-wrapper {\n display: inline;\n }\n }\n"])));function Ya(e){var t=e.error,i=e.onRetry,n=e.recordingSource,r="Error in create recording";"UPLOAD_ERROR"===t.type&&(r="Error while uploading video");var o="Retry";"UPLOAD_ERROR"===t.type&&(o="Retry Upload");return l.a.createElement(Ka,null,l.a.createElement("div",{className:"error-widget-text"},r),l.a.createElement("div",{className:"error-widget-cta-wrapper"},l.a.createElement("div",{className:"error-widget-download-button-wrapper"},"UPLOAD_ERROR"===t.type&&l.a.createElement(pa.f,{style:{marginRight:"20px"},icon:Object(M.e)("/svg/rapi/download-icon.svg"),text:"Download Recording",options:function(){if("UPLOAD_ERROR"===t.type){var e=[];if(n)for(var i in n){var r=n[i];e.push({link:r,linkType:"download",downloadName:"Testing the name",linkName:"Download ".concat(i," source")})}return e}}(),buttonFeature:pa.b.DROPDOWN})),l.a.createElement("div",{className:"error-widget-retry-button-wrapper"},l.a.createElement(pa.f,{text:o,onClickHandler:i}))))}var Ja=L.c.div(Ga||(Ga=Ct()(['\n margin: 15px 0;\n height: 45px;\n text-align: left;\n position: relative;\n .title-wrapper {\n display: flex;\n align-items: center;\n cursor: pointer;\n div {\n font: normal normal 600 16px/33px Open Sans;\n }\n img {\n margin-left: 10px;\n\n }\n }\n .title-input-wrapper {\n width: 350px;\n position: relative;\n display: flex;\n align-items: center;\n input {\n border: 1px solid #cccccc;\n box-shadow: 0px 3px 6px #00000012;\n border-radius: 4px;\n width: 100%;\n padding: 5px 60px 5px 10px;\n font: normal normal normal 16px/33px Open Sans;\n }\n .title-close {\n position: absolute;\n width: 20px;\n height: 20px;\n opacity: 0.3;\n right: 0px;\n cursor: pointer;\n &:hover {\n opacity: 1;\n }\n &::before,\n &::after {\n position: absolute;\n content: " ";\n height: 18px;\n width: 2px;\n background-color: #333;\n }\n &::before {\n transform: rotate(45deg);\n }\n &::after {\n transform: rotate(-45deg);\n }\n }\n\n .title-save {\n right: 45px;\n bottom: 15px;\n opacity: 0.8;\n position: absolute;\n display: inline-block;\n transform: rotate(45deg);\n height: 20px;\n width: 10px;\n border-bottom: 2px solid #37c689;\n border-right: 2px solid #37c689;\n cursor: pointer;\n &:hover {\n opacity: 1;\n }\n }\n }\n'])));function Xa(e){var t=e.onTitleSave,i=e.videoTitle||"New Recording",n=Object(s.useState)(i),r=n[0],o=n[1],a=Object(s.useState)(!1),c=a[0],d=a[1],u=function(){r.length>0?t(r):t("New Recording"),d(!1)};return l.a.createElement(Ja,null,c?l.a.createElement("div",{className:"title-input-wrapper"},l.a.createElement("input",{type:"text",onChange:function(e){return o(e.target.value)},onBlur:u,onKeyDown:function(e){"Enter"===e.key&&u()},value:r}),l.a.createElement("div",{className:"title-save",onClick:u}),l.a.createElement("div",{className:"title-close",onClick:function(){return d(!1)}})):l.a.createElement("div",{className:"title-wrapper",onClick:function(){return d(!0)}},l.a.createElement("div",null,r),l.a.createElement("img",{src:Object(M.e)("/svg/rapi/pen.svg")})))}function Qa(e){var t=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(e){return!1}}();return function(){var i,n=Ai()(e);if(t){var r=Ai()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return Pi()(this,i)}}var Za,es,ts,is,ns=function(e){Ei()(i,e);var t=Qa(i);function i(e){var n;Ci()(this,i),n=t.call(this,e);var r=e.onRetry;return n.state={hasError:!1},n.onRetry=r,n}return xi()(i,[{key:"componentDidCatch",value:function(e,t){console.log("ERROR in catch >>>> ",e,t)}},{key:"render",value:function(){return this.state.hasError?l.a.createElement("div",null,l.a.createElement("span",null,"Could not load the resource due to network failure.")):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return console.log("ERROR >>>> ",e),{hasError:!0}}}]),i}(s.Component),rs=L.c.div(Za||(Za=Ct()(["\n display: flex;\n width: 100%;\n position: relative;\n justify-content: space-between;\n flex-direction: row;\n align-items: center;\n margin: 0 auto;\n"]))),os=L.c.div(es||(es=Ct()(["\n margin-top: 10px;\n"]))),as=L.c.div(ts||(ts=Ct()(["\n margin-top: 10px;\n display: block;\n right: 0;\n"])));function ss(e){var t=e.urls,i=e.token,n=e.tokenType,r=e.recorder,o=e.integrationType,a=e.importCompleteResponse,c=e.recordingConfiguration,d=e.onRecorderClose,u=e.onVideoCancel,p=e.extensionAvailable,h=(e.handleShowUploadProgress,e.recorderAPIModel),f=e.onEditClick,m=e.recorderAPIUtils,g=Object(s.useContext)(B.a),v=g.theme,y=g.recorderInitOptions,b=y.show_video_title,w=y.edit,S=y.record_config,C=(void 0===S?{}:S).show_cancel_submit,k=void 0===C||C,x=t&&t.webcam,_=t&&t.screen,E=a&&a.signed_url,T=a&&0==a.contains_video&&1==a.contains_audio||c&&!c.webCam&&!c.screenRecord&&c.audio,P="lessonly"==qi.default.getQueryParams().type||"lessonly"==qi.default.getQueryParams().integration_type,I=Object(s.useState)(!1),A=I[0],R=I[1],O=Object(s.useState)(),N=O[0],D=O[1],L=Object(s.useState)(),F=L[0],V=L[1],U=Object(s.useState)("Edit Video"),z=U[0],H=U[1],j=Object(s.useState)(),q=j[0],$=j[1],W=r&&r.isUploadComplete(),G=Object(s.useState)(W),K=G[0],Y=G[1],J=Object(s.useState)(!1),X=J[0],Q=J[1],Z=Object(s.useState)(!1),ee=(Z[0],Z[1]),te=r.createRecordingError,ie=r.uploadInitError,ne=Object(s.useRef)();Object(s.useEffect)((function(){K&&!p&&m.sendEvent("source_uploaded")}),[K]),Object(s.useEffect)((function(){H(A?"Preview Video":"Edit Video")}),[A]),Object(s.useEffect)((function(){f&&f(A)}),[A,f]),Object(s.useEffect)((function(){if(a&&a.projectjson)$(a.projectjson);else if(!te)return r.isPreprocessComplete().then((function(e){$(e)})).catch((function(){console.error("ERROR IN PREPROCESS STEP")})),function(){r.removePreprocessCompleteCheck()}}),[]);var re=function(){return!0},oe=function(e){V(e)},ae=function(e){D(e)},se=function(){var e={};return P&&(e.primaryColor="#4A90E2",e.secondaryColor="#69a8e3",e.bgColor="#ebeaea"),e},le=function(){r.sendCreateRecordingRequest().then((function(){ee(!1),de()})).catch((function(){ee(!1)})),ee(!0)},ce=function(){r.retryUpload().then((function(){ee(!1),de()})).catch((function(){ee(!1)})),Q(!1),ee(!0)},de=function(){r.removePreprocessCompleteCheck(),r.isPreprocessComplete().then((function(e){$(e)})).catch((function(){console.error("ERROR IN PREPROCESS STEP")}))},ue=void 0!==q,pe=!(K||te||ie||X||a);return l.a.createElement(l.a.Fragment,null,!a&&l.a.createElement(Wa,{showUploadProgress:pe,recorder:r,onUploadComplete:function(){Y(!0)},onUploadError:function(){Q(!0)}}),b&&l.a.createElement(Xa,{videoTitle:ne.current,onTitleSave:function(e){ne.current=e,h.saveVideoTitle({title:e,assetId:r.recordDetails&&r.recordDetails.asset_id})}}),(te||ie||X)&&l.a.createElement(Ya,{error:{type:te?"RECORDING_ERROR":"UPLOAD_ERROR"},onRetry:te?le:ce,recordingSource:t}),l.a.createElement(ns,null,l.a.createElement(s.Suspense,{fallback:l.a.createElement("div",null,"Loading ...")},l.a.createElement(xa,{importVideoUrl:E,screenUrl:_,webcamUrl:x,isAudioOnly:T,thumbnailUrl:null,recordingConfiguration:c,onVideoPlayerInitialize:oe,customColors:se()}))),w&&l.a.createElement(ns,null,l.a.createElement(s.Suspense,{fallback:l.a.createElement(l.a.Fragment,null)},l.a.createElement(Ta.a,{showSimpleEditor:A,videoPlayerView:F,recorder:r,recorderApiModel:h,token:i,tokenType:n,integrationType:o,isPersonalisationEnabled:re(),customColors:se(),footageUrls:{},projectJson:q,onSimpleEditorInitialize:ae}))),l.a.createElement(rs,null,l.a.createElement(os,null,!A&&w&&l.a.createElement(pa.f,{icon:Object(M.e)("/svg/rapi/pen.svg"),text:z,borderColor:pa.a.TRANSPARENT,fillColor:pa.c.TRANSPARENT,textColor:pa.d.BLUE,loading:!ue,onClickHandler:function(){return R(!A)},enabled:ue})),l.a.createElement(as,null,!A&&k&&l.a.createElement(pa.f,{text:"Close",textCapitalize:!0,borderColor:pa.a.TRANSPARENT,fillColor:pa.c.TRANSPARENT,textColor:pa.d.BLUE,onClickHandler:function(){u()},style:{marginRight:"10px"}}),!A&&l.a.createElement(pa.f,{text:"Submit",textCapitalize:!0,onClickHandler:function(){!function(){var e=r.recordDetails&&r.recordDetails.asset_id;if(e?h.submitVideo({assetId:e}):console.error("asset id not available in recorder"),e){var t={asset_id:r.recordDetails.asset_id,token:r.recordDetails.delivery_token,embed_url:r.recordDetails.embedLink,embed_preview_url:r.recordDetails.embeddedPreviewLink,play_url:r.recordDetails.recordedUrl,thumbnail_url:r.recordDetails.publicThumbnail,thumbnail_play_url:r.recordDetails.publicPlayThumbnail};m.sendEvent("video_submitted",t)}r.isUploadComplete()||m.sendEvent("_show_upload_progress",{recorder:r,theme:v}),d()}()},enabled:!te}),A&&l.a.createElement(pa.f,{text:"Cancel Edit",textCapitalize:!0,borderColor:pa.a.TRANSPARENT,fillColor:pa.c.TRANSPARENT,textColor:pa.d.BLUE,onClickHandler:function(){N&&(N.cancel(),R(!A))},style:{marginRight:"10px"}}),A&&l.a.createElement(pa.f,{text:"Save Edit",textCapitalize:!0,onClickHandler:function(){N&&(N.save(),R(!A))}}))))}var ls,cs=L.c.div(is||(is=Ct()([""])));function ds(e){return l.a.createElement(cs,null,l.a.createElement(Wa,e))}var us=L.c.div(ls||(ls=Ct()(["\n padding: 20px;\n"])));function ps(e){var t=Object(s.useState)(!1),i=t[0],n=t[1],r=Object(s.useState)(!1),o=r[0],a=r[1];return l.a.createElement(us,null,o&&l.a.createElement(ds,e),!o&&i&&l.a.createElement(ba,va()({},e,{onVideoCancelRevert:function(){n(!1)}})),!o&&!i&&l.a.createElement(ss,va()({},e,{onVideoCancel:function(){n(!0)},handleShowUploadProgress:function(){a(!0)}})))}i(109);var hs,fs,ms,gs,vs=L.c.div(hs||(hs=Ct()(["\n width: 75%;\n height: 80%;\n padding: 20px;\n border: 2px dashed #ACB7C4;\n border-radius: 5px;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n cursor: pointer;\n"])));function ys(e){var t=e.onFileUpload,i=e.isMobile,n=Object(s.useRef)(),r=Object(s.useRef)(),o=Object(s.useRef)(),a=Object(s.useState)(!1),c=a[0],d=a[1],u=function(e){return e.type&&["video","audio"].includes(e.type.split("/")[0])},p=function(e){console.log("IMPORT FILE CHANGED !!!!");var i=e.target.files[0];t(i)};return l.a.createElement(l.a.Fragment,null,l.a.createElement(vs,{ref:n,onClick:function(){console.log("IMPORT CLICK"),i?o.current.click():r.current.click()},onDrop:function(e){e.preventDefault(),console.log("DROPPED ",e);var i=null;try{if(e.dataTransfer.items){for(var n=0;n<e.dataTransfer.items.length;n++)if("file"===e.dataTransfer.items[n].kind&&u(e.dataTransfer.items[n].getAsFile())){i=e.dataTransfer.items[n].getAsFile();break}}else for(var r=0;r<e.dataTransfer.files.length;r++)if(u(e.dataTransfer.files[r])){i=e.dataTransfer.files[r];break}}catch(e){console.log("EXCEPTION ",e)}i?(i.size>ee.n?console.log("FILE SIZE GREATER THAN 5GB!!!!"):t(i),console.log("NAME : ",i.name," SIZE : ",i.size)):console.log("FILE NOT SUPPORTED !!!")},onDragOver:function(e){e.preventDefault(),!c&&d(!0)},onDragLeave:function(e){e.preventDefault(),c&&d(!1)},style:function(){if(c)return{borderColor:"#FFFFFF"}}()},l.a.createElement("img",{src:"/svg/upload.svg",alt:"upload",style:{width:"55px"}}),l.a.createElement("div",{style:{margin:"12px 0 0",fontSize:"13px",fontWeight:"400",color:"#E3E3E3"}},"Drag and drop"),l.a.createElement("div",{style:{margin:"0",fontSize:"14px",fontWeight:"400",color:"#8C8C8C"}},"your file here, or"," ",l.a.createElement("span",{style:{color:"#4FA3CB",textDecoration:"underline",cursor:"pointer"}},"browse"))),l.a.createElement("input",{type:"file",ref:r,onChange:p,style:{display:"none"},accept:"video/*,audio/*,video/mp4,video/x-m4v,video/*;capture=camcorder,microphone"}),l.a.createElement("input",{type:"file",ref:o,onChange:p,style:{display:"none"},accept:"video/*,audio/*,video/mp4,video/x-m4v,video/*;capture=camcorder,microphone",capture:!0}))}function bs(e){var t=e.progress,i=e.uploadStatus,n=e.onCancelImport,r=null,o=Object(M.f)(t);return i===Es.INPROGRESS?(console.log("PROGRESS ",t),t&&"upload"===t.type&&(r="Uploading Video"),t&&"processing"===t.type&&(r="Processing video")):i===Es.INITIALIZED&&(r="Initializing Upload"),l.a.createElement("div",{style:{width:"90%"}},l.a.createElement(ja,{progressStatus:r,uploadProgress:t,timeRemainingStatus:o,type:Ha.IMPORT}),l.a.createElement(pa.f,{borderColor:pa.a.DARK_GRAY,fillColor:pa.c.TRANSPARENT,text:"Cancel",onClickHandler:n}))}var ws,Ss,Cs,ks=L.c.div(fs||(fs=Ct()(["\n width: 100%;\n height: 147px;\n min-height: 360px;\n max-height: 500px;\n background-color: #212126;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 5px;\n"]))),xs=L.c.div(ms||(ms=Ct()(["\n width: 90%;\n margin: 0 auto;\n position: relative;\n"]))),_s=L.c.div(gs||(gs=Ct()(["\n position: absolute;\n right: -35px;\n top: 0px;\n"]))),Es={INACTIVE:0,INITIALIZED:1,INPROGRESS:2},Ts={completedPercent:0,type:"upload"};function Ps(e){var t=e.file,i=e.isMobile,n=e.digest,r=e.recorder,o=e.recorderClose,a=(e.directImport,e.importCompletedCallback),c=e.handlePopupClose,d=Object(s.useState)(Es.INACTIVE),u=d[0],p=d[1],h=Object(s.useState)(Ts),f=h[0],m=h[1],g=Object(s.useContext)(B.a).recorderInitOptions.inline;Object(s.useEffect)((function(){t&&v(t)}),[t]);var v=function(e){if(e){var t={fileName:e.name,size:e.size/1024,fromAdvancedEdit:!1,token:n,isMobile:i};r.createVideoImport({params:t,uploadStartedCallback:y,updateProgress:b,file:e}).then((function(e){console.log("PREVIEW RESPONSE ",e),a(e)})).catch((function(e){console.log("ERROR >> ",e)})),p(Es.INITIALIZED)}},y=function(){p(Es.INPROGRESS)},b=function(e){m(e)};return console.log("UPLOAD STATUS ",u,t,f),l.a.createElement(xs,null,l.a.createElement(ks,null,!g&&u===Es.INACTIVE&&l.a.createElement(_s,null,l.a.createElement(ia,{withBorder:!0,onClose:c})),!t&&u===Es.INACTIVE&&l.a.createElement(ys,{isMobile:i,onFileUpload:v}),u!==Es.INACTIVE&&l.a.createElement(bs,{progress:f,uploadStatus:u,onCancelImport:function(){if(r.cancelVideoImport(),t)return o&&o();p(Es.INACTIVE),m(Ts)}})))}var Is=L.c.div(ws||(ws=Ct()([""]))),As=L.c.div(Ss||(Ss=Ct()([""]))),Rs=L.c.div(Cs||(Cs=Ct()([""])));function Os(e){var t=e.type,i=e.recorder,n=e.uploadCompleted,o=e.onRecorderClose,c=Object(s.useState)(!1),d=c[0],u=c[1],p=Object(s.useState)(),h=(p[0],p[1],function(){try{i.retryUpload().catch((function(e){u(!1)}))}catch(e){console.log("CATCH EX ",e)}u(!0)}),f=function(){var e=r()(a.a.mark((function e(){var t,n,r,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.getRecordingObjectUrls();case 2:if(t=e.sent,!(Object.keys(t).length>0)){e.next=9;break}for(r in n=[],t)t.hasOwnProperty(r)&&(o=t[r],n.push(l.a.createElement("a",{key:r,href:"".concat(o),download:!0},"Download ".concat(r," recording"))));return e.abrupt("return",l.a.createElement("div",null,n,l.a.createElement("div",null,l.a.createElement(pa.f,{text:"Retry upload",onClickHandler:h}))));case 9:pa.f;case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(s.useEffect)((function(){}),[d]),l.a.createElement(Is,null,d&&l.a.createElement(ja,{recorder:i,onUploadComplete:function(){n?n():o&&o()},onUploadError:function(){u(!1)}}),!d&&l.a.createElement(l.a.Fragment,null,l.a.createElement(As,null,function(){if(t===F.b.UPLOAD)return"Error when uploading video"}()),l.a.createElement(Rs,null,f())))}var Ns,Ds,Ls,Ms=i(133),Bs=i.n(Ms),Fs=L.c.div(Ns||(Ns=Ct()(["\n &.screen-enter {\n opacity: 0;\n transform: translateX(100%);\n }\n\n &.screen-enter-active {\n opacity: 1;\n transform: translateX(0);\n }\n\n &.screen-enter-active {\n transition: opacity 300ms, transform 300ms;\n transition-delay: 50ms;\n }\n"]))),Vs=["active","children"];function Us(e){var t=e.active,i=e.children,n=Bs()(e,Vs);return l.a.createElement(D,{in:t,classNames:"screen",timeout:400,unmountOnExit:!0},l.a.createElement(Fs,n,t&&i))}var zs=L.c.div(Ds||(Ds=Ct()(["\n overflow-x: hidden;\n overflow-y: scroll;\n width: 720px;\n position: relative;\n background-color: ",';\n margin: 0 auto;\n text-align: center;\n transition: height 500ms ease-in;\n font-family: "proxima-nova", "Open Sans", "Helvetica Neue", sans-serif !important;\n'])),(function(e){switch(e.action){case F.a.POST_RECORD:return"#FFFFFF";default:return"transparent"}})),Hs=(L.c.div(Ls||(Ls=Ct()(["\n height: 45px;\n display: flex;\n align-items: center;\n font: normal normal 600 16px/16px Open Sans;\n color: #C3C3C3;\n border-bottom: 1px solid #34343C;\n justify-content: space-between;\n padding: 0 25px;\n"]))),["start_recording","import_video","hv_stop_recording","source_uploaded","record_stopped","preprocess_complete","source_video","record_initiated","record_details","open_widget"]),js={RECORDER:1,IMPORTER:2};function qs(e){var t=e.type,i=e.settings,n=e.token,o=e.tokenType,c=void 0===o?ee.e.RECORDER_SDK_TOKEN:o,d=e.initiator,u=void 0===d?F.c.RECORDER_SDK:d,p=e.integrationType,h=void 0===p?ee.q.GENERIC_RECORDER:p,f=e.extensionId,m=e.email,g=e.userId,v=e.eventListenerClass,y=e.recorderClassName,b=e.eventCallback,w={fromPopup:!0,separateLayer:!1,systemAudio:!0,aspectRatio:ee.b.SIXTEEN_NINE,initiator:u,highlights:!0,resolution:720},S=Object(s.useState)(!1),C=S[0],k=S[1],x=Object(s.useState)(),_=x[0],E=x[1],T=function(){var e=Object(s.useState)(0),t=(e[0],e[1]);return function(){return t((function(e){return e+1}))}}(),P=n||Object(M.d)(),I=Object(s.useRef)(w),A=Object(s.useRef)({}),R=Object(s.useRef)(new M.b({eventCallback:b})),O=Object(s.useRef)(),N=Object(s.useRef)(),D=Object(s.useRef)(),V=Object(s.useRef)(),z=Object(s.useRef)(),H=Object(s.useRef)(),j=Object(s.useRef)({}),q=Object(s.useRef)(!1),$=Object(s.useRef)(U({tokenType:c,userId:g,integrationType:h})),W=Object(s.useRef)(),G=Object(s.useRef)(),K=function(){$.current=U({tokenType:c,userId:g,integrationType:h}),Q(i);var e=new ct({recordingConfiguration:I.current,tokenType:c,token:P,email:m,extensionId:f,recorderId:y,recorderEvtClass:v,logID:$.current,recorderAPIUtils:R.current,integrationType:h,initiator:u,extensionAvailable:G.current});E(e)},Y=Object(s.useState)(null),J=Y[0],X=Y[1];Object(s.useEffect)((function(){O.current||(O.current=new dt.a({token:P,email:m,tokenType:c})),K(),i.inline&&!1!==i.inline.open&&(!C&&k(!0),t==js.IMPORTER?(q.current=!1,X(F.a.IMPORT_VIDEO)):X(F.a.PRE_RECORD))}),[]);var Q=function(e){null!=e&&e.record_config&&(I.current.screenRecord=!1,I.current.webCam=!1,I.current.audio=!1,0!=e.record_config.screen&&(I.current.screenRecord=!0),0!=e.record_config.webcam&&(I.current.webCam=!0),0!=e.record_config.mic&&(I.current.audio=!0),_&&_.updateConfig({recordingConfiguration:I.current}))};Object(s.useEffect)((function(){_&&i&&Q(i)}),[_]),Object(s.useEffect)((function(){i&&function(e){var t={};for(var i in B.b.recorderInitOptions)e&&e.hasOwnProperty(i)?t[i]=e[i]:t[i]=B.b.recorderInitOptions[i];j.current={theme:B.b.theme,recorderInitOptions:t,authentication:{token:n,tokenType:c,email:m}}}(i)}),[]);var Z=function(e){var t;if(e.detail&&e.detail.extension){var i=e.detail;delete i.extension,R.current.sendEvent(e.type,i)}"record_details"===e.type&&e.detail&&(_.setExtensionRecording(!0),_.setRecordDetails(e.detail)),"open_widget"===e.type&&(C||J||(K(),k(!0),X(F.a.PRE_RECORD),T())),"start_recording"===e.type&&(void 0!==e.detail.extension_available&&(G.current=e.detail.extension_available),K(),ie(e.detail.recording_configuration),!C&&k(!0),X(F.a.RECORD),T()),"hv_stop_recording"===e.type&&ne(),"preprocess_complete"===e.type&&_.setProjectJson(e.detail.project_json),"source_video"===e.type&&(D.current={},"webcam"===e.detail.type&&(D.current.webcam=e.detail.url),"screen"===e.detail.type&&(D.current.screen=e.detail.url),!C&&k(!0),X(F.a.POST_RECORD)),"import_video"===e.type&&(R.current.sendEvent("show_frame"),N.current=e.detail.file,K(),!C&&k(!0),q.current=!0,X(F.a.IMPORT_VIDEO));try{t="hippovideo"==e.data.initiator?e.data:JSON.parse(e.data)}catch(e){return}if("hippovideo"==t.initiator){if("record_initiated"===t.type&&t.detail&&t.detail.recording_with_extension&&(_.setExtensionRecording(t.detail.recording_with_extension),_.setRecordDetails(t.detail.record_details),_.stopStreams(),X(null)),"hv_initialize_recorder"===t.type){var n={};for(var r in B.b.recorderInitOptions)t.detail&&t.detail.settings&&t.detail.settings.hasOwnProperty(r)?n[r]=t.detail.settings[r]:n[r]=B.b.recorderInitOptions[r];n.theme=B.b.theme,j.current=n}"hv_source_video"===t.type&&(D.current={},"webcam"===t.detail.type&&(D.current.webcam=t.detail.url),"screen"===t.detail.type&&(D.current.screen=t.detail.url),R.current.sendEvent("show_frame"),!C&&k(!0),X(F.a.POST_RECORD)),"hv_start_recording"==t.type&&(ie(t.detail),!C&&k(!0),X(F.a.RECORD)),"hv_stop_recording"===t.type&&ne(),"hv_import_video"===t.type&&(R.current.sendEvent("show_frame"),importTypeRef.current=t.detail.type,K(),!C&&k(!0),X(F.a.IMPORT_VIDEO)),t.type,"hv_preprocess_complete"===t.type&&_.setProjectJson(t.detail.project_json)}},te=Object(s.useCallback)((function(){var e;i.inline&&i.inline.open?(delete(e=I.current).screenRecord,delete e.webCam,delete e.audio,I.current=e,_.updateConfig({recordingConfiguration:I.current}),_.isUploadComplete()&&K(),!C&&k(!0),t===js.IMPORTER?X(F.a.IMPORT_VIDEO):X(F.a.PRE_RECORD)):(k(!1),X(null),_.stopStreams(),R.current.sendEvent("_close_popup"))}),[i,_]),ie=function(e){if(e){R.current.sendEvent("show_frame");var t=Object.assign({},I.current);null!=e.resolution&&(t.resolution=e.resolution),null!=e.initiator&&(t.initiator=e.initiator),null!=e.screenRecord&&(t.screenRecord=e.screenRecord),null!=e.webCam&&(t.webCam=e.webCam),null!=e.audio&&(t.audio=e.audio),null!=e.uniqueId&&(t.uniqueId=e.uniqueId),null!=e.webcamBitRate&&(t.webcamBitRate=e.webcamBitRate),null!=e.aspectRatio&&(t.aspectRatio=e.aspectRatio),null!=e.teleprompter&&(A.current.showTeleprompter=e.teleprompter),null!=e.timer&&(t.timer=e.timer),null!=e.recordingWithExtension&&(t.recordingWithExtension=e.recordingWithExtension),null!=e.show_preview&&(A.current.showRecordPreview=e.show_preview),null!=e.showFaceCue&&(A.current.showFaceCue=e.showFaceCue),null!=e.showLightingFeedback&&(A.current.showLightingFeedback=e.showLightingFeedback),null!=e.fromProductReview&&(t.fromProductReview=e.fromProductReview),null!=e.fromChristmasTemplate&&(t.my_video=!0);var i=parseInt(e.timer);null!=i&&!isNaN(i)&&Math.round(i)>0&&(A.current.recordingLimit=1e3*Math.round(i)),I.current=t,_.updateConfig({recordingConfiguration:I.current})}};Object(s.useEffect)((function(){return window.addEventListener("message",Z),Hs.forEach((function(e){W.current.addEventListener(e,Z)})),function(){window.removeEventListener("message",Z),Hs.forEach((function(e){W.current.removeEventListener(e,Z)}))}}));var ne=function(){var e=r()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _.finishRecording(),i.inline||!C&&k(!0),e.t0=re,e.next=5,_.getRecordingObjectUrls();case 5:e.t1=e.sent,(0,e.t0)(e.t1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),re=function(e){D.current=e,R.current.sendEvent("record_stopped",{removeWebcamPreview:!0,removeMarkupTools:!0}),_.getUploadDetails().then((function(e){e.error?(H.current=F.b.UPLOAD,X(F.a.ERROR)):h!==ee.q.PRODUCT||u!==F.c.EXTENSION?X(F.a.POST_RECORD):e.completed?(k(!1),X(null)):X(F.a.UPLOAD_STATUS)})).catch((function(){H.current=F.b.UPLOAD,X(F.a.ERROR)}))},oe=function(e){V.current=e,X(F.a.POST_RECORD)},ae=function(e){e===F.a.ERROR?X(F.a.POST_RECORD):(R.current.sendEvent("source_uploaded"),te())},se=function(){i.inline&&i.inline.open&&(K(),X(F.a.PRE_RECORD))},le=function(){return J?l.a.createElement(B.a.Provider,{value:j.current},[F.a.PRE_RECORD,F.a.RECORD].includes(J)&&l.a.createElement(fa,{recorder:_,action:J,handlePopupClose:de,onFinishRecording:re,onRecordingCancel:se,recorderAPIUtils:R.current,extensionAvailable:G.current}),l.a.createElement(Us,{active:J===F.a.POST_RECORD},l.a.createElement(ps,{urls:D.current,token:P,tokenType:c,onEditClick:ce,recorderAPIModel:O.current,integrationType:h,recorder:_,recorderAPIUtils:R.current,extensionAvailable:G.current,recordingConfiguration:I.current,onRecorderClose:te,importCompleteResponse:V.current})),l.a.createElement(Us,{active:J===F.a.IMPORT_VIDEO},l.a.createElement(Ps,{file:N.current,recorder:_,recorderAPIModel:O.current,isMobile:!1,digest:P,recorderClose:te,handlePopupClose:de,directImport:q.current,importCompletedCallback:oe})),l.a.createElement(Us,{active:J===F.a.ERROR},l.a.createElement(Os,{recorder:_,type:H.current,onRecorderClose:te,uploadCompleted:function(){return ae(F.a.ERROR)}})),l.a.createElement(Us,{active:J===F.a.UPLOAD_STATUS},l.a.createElement(ds,{showUploadProgress:!0,recorder:_,onUploadComplete:ae,onUploadError:function(){return X(F.a.ERROR)}}))):null},ce=function(e){e&&R.current.sendEvent("edit_enabled"),z.current.style.maxHeight=e?"700px":""};Object(s.useLayoutEffect)((function(){setTimeout((function(){R.current.sendEvent("sdk_loaded");try{var e=performance.getEntriesByType("navigation")[0].duration,t=new he({integrationType:h,module:"RECORDER_API",logUID:$.current,tokenType:c,token:P});t&&t.info("RECORDER_API_PAGE_LOAD_TIME",{loadTime:e})}catch(e){}}),500)}),[]);var de=function(){te()};return l.a.createElement(l.a.Fragment,null,C&&l.a.createElement(L.a,{theme:j.current.theme},l.a.createElement(zs,{action:J,ref:z,className:"".concat(y)},le())),l.a.createElement("input",{type:"hidden",ref:W,className:"".concat(v)}))}},function(e,t,i){var n=i(31),r=i(38),o=i(134),a=i(120),s=i(431),l=i(28),c=TypeError,d=l("toPrimitive");e.exports=function(e,t){if(!r(e)||o(e))return e;var i,l=a(e,d);if(l){if(void 0===t&&(t="default"),i=n(l,e,t),!r(i)||o(i))return i;throw c("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},function(e,t,i){var n=i(19),r=i(232),o=n["__core-js_shared__"]||r("__core-js_shared__",{});e.exports=o},function(e,t,i){var n=i(19),r=Object.defineProperty;e.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch(i){n[e]=t}return t}},function(e,t,i){var n=i(12),r=i(32),o=i(231),a=n(Function.toString);r(o.inspectSource)||(o.inspectSource=function(e){return a(e)}),e.exports=o.inspectSource},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,i){var n=i(187),r=i(121),o=TypeError;e.exports=function(e){if(n(e))return e;throw o(r(e)+" is not a constructor")}},function(e,t,i){var n={};n[i(28)("toStringTag")]="z",e.exports="[object z]"===String(n)},function(e,t,i){"use strict";var n=i(71),r=i(48),o=i(28),a=i(37),s=o("species");e.exports=function(e){var t=n(e),i=r.f;a&&t&&!t[s]&&i(t,s,{configurable:!0,get:function(){return this}})}},function(e,t){var i=TypeError;e.exports=function(e,t){if(e<t)throw i("Not enough arguments");return e}},function(e,t){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},function(e,t,i){var n=i(28),r=i(162),o=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||a[o]===e)}},function(e,t,i){var n=i(12),r=i(77),o=i(42),a=i(70),s=n("".charAt),l=n("".charCodeAt),c=n("".slice),d=function(e){return function(t,i){var n,d,u=o(a(t)),p=r(i),h=u.length;return p<0||p>=h?e?"":void 0:(n=l(u,p))<55296||n>56319||p+1===h||(d=l(u,p+1))<56320||d>57343?e?s(u,p):n:e?c(u,p,p+2):d-56320+(n-55296<<10)+65536}};e.exports={codeAt:d(!1),charAt:d(!0)}},function(e,t,i){var n=i(13),r=i(19).RegExp,o=n((function(){var e=r("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),a=o||n((function(){return!r("a","y").sticky})),s=o||n((function(){var e=r("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:o}},function(e,t,i){"use strict";var n=i(241).charAt;e.exports=function(e,t,i){return t+(i?n(e,t).length:1)}},function(e,t,i){var n=i(15),r=i(309);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==r},{assign:r})},function(e,t,i){var n=i(457);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},function(e,t,i){"use strict";(function(t){var n=i(68),r=i(463),o=i(314),a={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var l,c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(l=i(315)),l),transformRequest:[function(e,t){return r(t,"Accept"),r(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)||t&&"application/json"===t["Content-Type"]?(s(t,"application/json"),function(e,t,i){if(n.isString(e))try{return(t||JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(i||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,i=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,a=!i&&"json"===this.responseType;if(a||r&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw o(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(a)})),e.exports=c}).call(this,i(72))},function(e,t,i){var n=i(38),r=i(100),o=i(28)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==r(e))}},function(e,t){},function(e,t,i){var n=i(45),r=i(250),o=i(251),a=i(252).populateHostPrefix;e.exports={buildRequest:function(e){var t=e.httpRequest,i=e.service.api,n=i.targetPrefix+"."+i.operations[e.operation].name,o=i.jsonVersion||"1.0",s=i.operations[e.operation].input,l=new r;1===o&&(o="1.0"),t.body=l.build(e.params||{},s),t.headers["Content-Type"]="application/x-amz-json-"+o,t.headers["X-Amz-Target"]=n,a(e)},extractError:function(e){var t={},i=e.httpResponse;if(t.code=i.headers["x-amzn-errortype"]||"UnknownError","string"==typeof t.code&&(t.code=t.code.split(":")[0]),i.body.length>0)try{var r=JSON.parse(i.body.toString()),o=r.__type||r.code||r.Code;o&&(t.code=o.split("#").pop()),"RequestEntityTooLarge"===t.code?t.message="Request body must be less than 1 MB":t.message=r.message||r.Message||null}catch(r){t.statusCode=i.statusCode,t.message=i.statusMessage}else t.statusCode=i.statusCode,t.message=i.statusCode.toString();e.error=n.error(new Error,t)},extractData:function(e){var t=e.httpResponse.body.toString()||"{}";if(!1===e.request.service.config.convertResponseTypes)e.data=JSON.parse(t);else{var i=e.request.service.api.operations[e.request.operation].output||{},n=new o;e.data=n.parse(t,i)}}}},function(e,t,i){var n=i(45);function r(){}function o(e,t){if(t&&null!=e)switch(t.type){case"structure":return function(e,t){if(t.isDocument)return e;var i={};return n.each(e,(function(e,n){var r=t.members[e];if(r){if("body"!==r.location)return;var a=r.isLocationName?r.name:e,s=o(n,r);void 0!==s&&(i[a]=s)}})),i}(e,t);case"map":return function(e,t){var i={};return n.each(e,(function(e,n){var r=o(n,t.value);void 0!==r&&(i[e]=r)})),i}(e,t);case"list":return function(e,t){var i=[];return n.arrayEach(e,(function(e){var n=o(e,t.member);void 0!==n&&i.push(n)})),i}(e,t);default:return function(e,t){return t.toWireFormat(e)}(e,t)}}r.prototype.build=function(e,t){return JSON.stringify(o(e,t))},e.exports=r},function(e,t,i){var n=i(45);function r(){}function o(e,t){if(t&&void 0!==e)switch(t.type){case"structure":return function(e,t){if(null==e)return;if(t.isDocument)return e;var i={},r=t.members;return n.each(r,(function(t,n){var r=n.isLocationName?n.name:t;if(Object.prototype.hasOwnProperty.call(e,r)){var a=o(e[r],n);void 0!==a&&(i[t]=a)}})),i}(e,t);case"map":return function(e,t){if(null==e)return;var i={};return n.each(e,(function(e,n){var r=o(n,t.value);i[e]=void 0===r?null:r})),i}(e,t);case"list":return function(e,t){if(null==e)return;var i=[];return n.arrayEach(e,(function(e){var n=o(e,t.member);void 0===n?i.push(null):i.push(n)})),i}(e,t);default:return function(e,t){return t.toType(e)}(e,t)}}r.prototype.parse=function(e,t){return o(JSON.parse(e),t)},e.exports=r},function(e,t,i){var n=i(45),r=i(14);e.exports={populateHostPrefix:function(e){if(!e.service.config.hostPrefixEnabled)return e;var t,i,o,a=e.service.api.operations[e.operation];if(function(e){var t=e.service.api,i=t.operations[e.operation],r=t.endpointOperation&&t.endpointOperation===n.string.lowerFirst(i.name);return"NULL"!==i.endpointDiscoveryRequired||!0===r}(e))return e;if(a.endpoint&&a.endpoint.hostPrefix){var s=function(e,t,i){return n.each(i.members,(function(i,r){if(!0===r.hostLabel){if("string"!=typeof t[i]||""===t[i])throw n.error(new Error,{message:"Parameter "+i+" should be a non-empty string.",code:"InvalidParameter"});var o=new RegExp("\\{"+i+"\\}","g");e=e.replace(o,t[i])}})),e}(a.endpoint.hostPrefix,e.params,a.input);!function(e,t){e.host&&(e.host=t+e.host);e.hostname&&(e.hostname=t+e.hostname)}(e.httpRequest.endpoint,s),t=e.httpRequest.endpoint.hostname,i=t.split("."),o=/^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]$/,n.arrayEach(i,(function(e){if(!e.length||e.length<1||e.length>63)throw n.error(new Error,{code:"ValidationError",message:"Hostname label length should be between 1 to 63 characters, inclusive."});if(!o.test(e))throw r.util.error(new Error,{code:"ValidationError",message:e+" is not hostname compatible."})}))}return e}}},function(e,t,i){var n=i(45),r=i(490);function o(e,t){n.each(t,(function(t,i){"globalEndpoint"!==t&&(void 0!==e.config[t]&&null!==e.config[t]||(e.config[t]=i))}))}e.exports={configureEndpoint:function(e){for(var t=function(e){var t=e.config.region,i=function(e){if(!e)return null;var t=e.split("-");return t.length<3?null:t.slice(0,t.length-2).join("-")+"-*"}(t),n=e.api.endpointPrefix;return[[t,n],[i,n],[t,"*"],[i,"*"],["*",n],["*","*"]].map((function(e){return e[0]&&e[1]?e.join("/"):null}))}(e),i=e.config.useFipsEndpoint,n=e.config.useDualstackEndpoint,a=0;a<t.length;a++){var s=t[a];if(s){var l=i?n?r.dualstackFipsRules:r.fipsRules:n?r.dualstackRules:r.rules;if(Object.prototype.hasOwnProperty.call(l,s)){var c=l[s];return"string"==typeof c&&(c=r.patterns[c]),e.isGlobalEndpoint=!!c.globalEndpoint,c.signingRegion&&(e.signingRegion=c.signingRegion),c.signatureVersion||(c.signatureVersion="v4"),void o(e,c)}}}},getEndpointSuffix:function(e){for(var t={"^(us|eu|ap|sa|ca|me)\\-\\w+\\-\\d+$":"amazonaws.com","^cn\\-\\w+\\-\\d+$":"amazonaws.com.cn","^us\\-gov\\-\\w+\\-\\d+$":"amazonaws.com","^us\\-iso\\-\\w+\\-\\d+$":"c2s.ic.gov","^us\\-isob\\-\\w+\\-\\d+$":"sc2s.sgov.gov"},i=Object.keys(t),n=0;n<i.length;n++){var r=RegExp(i[n]),o=t[i[n]];if(r.test(e))return o}return"amazonaws.com"}}},function(e,t,i){!function(e){"use strict";function t(e){return null!==e&&"[object Array]"===Object.prototype.toString.call(e)}function i(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}function n(e,r){if(e===r)return!0;if(Object.prototype.toString.call(e)!==Object.prototype.toString.call(r))return!1;if(!0===t(e)){if(e.length!==r.length)return!1;for(var o=0;o<e.length;o++)if(!1===n(e[o],r[o]))return!1;return!0}if(!0===i(e)){var a={};for(var s in e)if(hasOwnProperty.call(e,s)){if(!1===n(e[s],r[s]))return!1;a[s]=!0}for(var l in r)if(hasOwnProperty.call(r,l)&&!0!==a[l])return!1;return!0}return!1}function r(e){if(""===e||!1===e||null===e)return!0;if(t(e)&&0===e.length)return!0;if(i(e)){for(var n in e)if(e.hasOwnProperty(n))return!1;return!0}return!1}var o;o="function"==typeof String.prototype.trimLeft?function(e){return e.trimLeft()}:function(e){return e.match(/^\s*(.*)/)[1]};var a=0,s=2,l={0:"number",1:"any",2:"string",3:"array",4:"object",5:"boolean",6:"expression",7:"null",8:"Array<number>",9:"Array<string>"},c={".":"Dot","*":"Star",",":"Comma",":":"Colon","{":"Lbrace","}":"Rbrace","]":"Rbracket","(":"Lparen",")":"Rparen","@":"Current"},d={"<":!0,">":!0,"=":!0,"!":!0},u={" ":!0,"\t":!0,"\n":!0};function p(e){return e>="0"&&e<="9"||"-"===e}function h(){}h.prototype={tokenize:function(e){var t,i,n,r,o=[];for(this._current=0;this._current<e.length;)if((r=e[this._current])>="a"&&r<="z"||r>="A"&&r<="Z"||"_"===r)t=this._current,i=this._consumeUnquotedIdentifier(e),o.push({type:"UnquotedIdentifier",value:i,start:t});else if(void 0!==c[e[this._current]])o.push({type:c[e[this._current]],value:e[this._current],start:this._current}),this._current++;else if(p(e[this._current]))n=this._consumeNumber(e),o.push(n);else if("["===e[this._current])n=this._consumeLBracket(e),o.push(n);else if('"'===e[this._current])t=this._current,i=this._consumeQuotedIdentifier(e),o.push({type:"QuotedIdentifier",value:i,start:t});else if("'"===e[this._current])t=this._current,i=this._consumeRawStringLiteral(e),o.push({type:"Literal",value:i,start:t});else if("`"===e[this._current]){t=this._current;var a=this._consumeLiteral(e);o.push({type:"Literal",value:a,start:t})}else if(void 0!==d[e[this._current]])o.push(this._consumeOperator(e));else if(void 0!==u[e[this._current]])this._current++;else if("&"===e[this._current])t=this._current,this._current++,"&"===e[this._current]?(this._current++,o.push({type:"And",value:"&&",start:t})):o.push({type:"Expref",value:"&",start:t});else{if("|"!==e[this._current]){var s=new Error("Unknown character:"+e[this._current]);throw s.name="LexerError",s}t=this._current,this._current++,"|"===e[this._current]?(this._current++,o.push({type:"Or",value:"||",start:t})):o.push({type:"Pipe",value:"|",start:t})}return o},_consumeUnquotedIdentifier:function(e){var t,i=this._current;for(this._current++;this._current<e.length&&((t=e[this._current])>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||"_"===t);)this._current++;return e.slice(i,this._current)},_consumeQuotedIdentifier:function(e){var t=this._current;this._current++;for(var i=e.length;'"'!==e[this._current]&&this._current<i;){var n=this._current;"\\"!==e[n]||"\\"!==e[n+1]&&'"'!==e[n+1]?n++:n+=2,this._current=n}return this._current++,JSON.parse(e.slice(t,this._current))},_consumeRawStringLiteral:function(e){var t=this._current;this._current++;for(var i=e.length;"'"!==e[this._current]&&this._current<i;){var n=this._current;"\\"!==e[n]||"\\"!==e[n+1]&&"'"!==e[n+1]?n++:n+=2,this._current=n}return this._current++,e.slice(t+1,this._current-1).replace("\\'","'")},_consumeNumber:function(e){var t=this._current;this._current++;for(var i=e.length;p(e[this._current])&&this._current<i;)this._current++;return{type:"Number",value:parseInt(e.slice(t,this._current)),start:t}},_consumeLBracket:function(e){var t=this._current;return this._current++,"?"===e[this._current]?(this._current++,{type:"Filter",value:"[?",start:t}):"]"===e[this._current]?(this._current++,{type:"Flatten",value:"[]",start:t}):{type:"Lbracket",value:"[",start:t}},_consumeOperator:function(e){var t=this._current,i=e[t];return this._current++,"!"===i?"="===e[this._current]?(this._current++,{type:"NE",value:"!=",start:t}):{type:"Not",value:"!",start:t}:"<"===i?"="===e[this._current]?(this._current++,{type:"LTE",value:"<=",start:t}):{type:"LT",value:"<",start:t}:">"===i?"="===e[this._current]?(this._current++,{type:"GTE",value:">=",start:t}):{type:"GT",value:">",start:t}:"="===i&&"="===e[this._current]?(this._current++,{type:"EQ",value:"==",start:t}):void 0},_consumeLiteral:function(e){this._current++;for(var t,i=this._current,n=e.length;"`"!==e[this._current]&&this._current<n;){var r=this._current;"\\"!==e[r]||"\\"!==e[r+1]&&"`"!==e[r+1]?r++:r+=2,this._current=r}var a=o(e.slice(i,this._current));return a=a.replace("\\`","`"),t=this._looksLikeJSON(a)?JSON.parse(a):JSON.parse('"'+a+'"'),this._current++,t},_looksLikeJSON:function(e){if(""===e)return!1;if('[{"'.indexOf(e[0])>=0)return!0;if(["true","false","null"].indexOf(e)>=0)return!0;if(!("-0123456789".indexOf(e[0])>=0))return!1;try{return JSON.parse(e),!0}catch(e){return!1}}};var f={};function m(){}function g(e){this.runtime=e}function v(e){this._interpreter=e,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[a]}]},avg:{_func:this._functionAvg,_signature:[{types:[8]}]},ceil:{_func:this._functionCeil,_signature:[{types:[a]}]},contains:{_func:this._functionContains,_signature:[{types:[s,3]},{types:[1]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[s]},{types:[s]}]},floor:{_func:this._functionFloor,_signature:[{types:[a]}]},length:{_func:this._functionLength,_signature:[{types:[s,3,4]}]},map:{_func:this._functionMap,_signature:[{types:[6]},{types:[3]}]},max:{_func:this._functionMax,_signature:[{types:[8,9]}]},merge:{_func:this._functionMerge,_signature:[{types:[4],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[3]},{types:[6]}]},sum:{_func:this._functionSum,_signature:[{types:[8]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[s]},{types:[s]}]},min:{_func:this._functionMin,_signature:[{types:[8,9]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[3]},{types:[6]}]},type:{_func:this._functionType,_signature:[{types:[1]}]},keys:{_func:this._functionKeys,_signature:[{types:[4]}]},values:{_func:this._functionValues,_signature:[{types:[4]}]},sort:{_func:this._functionSort,_signature:[{types:[9,8]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[3]},{types:[6]}]},join:{_func:this._functionJoin,_signature:[{types:[s]},{types:[9]}]},reverse:{_func:this._functionReverse,_signature:[{types:[s,3]}]},to_array:{_func:this._functionToArray,_signature:[{types:[1]}]},to_string:{_func:this._functionToString,_signature:[{types:[1]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[1]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[1],variadic:!0}]}}}f.EOF=0,f.UnquotedIdentifier=0,f.QuotedIdentifier=0,f.Rbracket=0,f.Rparen=0,f.Comma=0,f.Rbrace=0,f.Number=0,f.Current=0,f.Expref=0,f.Pipe=1,f.Or=2,f.And=3,f.EQ=5,f.GT=5,f.LT=5,f.GTE=5,f.LTE=5,f.NE=5,f.Flatten=9,f.Star=20,f.Filter=21,f.Dot=40,f.Not=45,f.Lbrace=50,f.Lbracket=55,f.Lparen=60,m.prototype={parse:function(e){this._loadTokens(e),this.index=0;var t=this.expression(0);if("EOF"!==this._lookahead(0)){var i=this._lookaheadToken(0),n=new Error("Unexpected token type: "+i.type+", value: "+i.value);throw n.name="ParserError",n}return t},_loadTokens:function(e){var t=(new h).tokenize(e);t.push({type:"EOF",value:"",start:e.length}),this.tokens=t},expression:function(e){var t=this._lookaheadToken(0);this._advance();for(var i=this.nud(t),n=this._lookahead(0);e<f[n];)this._advance(),i=this.led(n,i),n=this._lookahead(0);return i},_lookahead:function(e){return this.tokens[this.index+e].type},_lookaheadToken:function(e){return this.tokens[this.index+e]},_advance:function(){this.index++},nud:function(e){var t,i;switch(e.type){case"Literal":return{type:"Literal",value:e.value};case"UnquotedIdentifier":return{type:"Field",name:e.value};case"QuotedIdentifier":var n={type:"Field",name:e.value};if("Lparen"===this._lookahead(0))throw new Error("Quoted identifier not allowed for function names.");return n;case"Not":return{type:"NotExpression",children:[t=this.expression(f.Not)]};case"Star":return t=null,{type:"ValueProjection",children:[{type:"Identity"},t="Rbracket"===this._lookahead(0)?{type:"Identity"}:this._parseProjectionRHS(f.Star)]};case"Filter":return this.led(e.type,{type:"Identity"});case"Lbrace":return this._parseMultiselectHash();case"Flatten":return{type:"Projection",children:[{type:"Flatten",children:[{type:"Identity"}]},t=this._parseProjectionRHS(f.Flatten)]};case"Lbracket":return"Number"===this._lookahead(0)||"Colon"===this._lookahead(0)?(t=this._parseIndexExpression(),this._projectIfSlice({type:"Identity"},t)):"Star"===this._lookahead(0)&&"Rbracket"===this._lookahead(1)?(this._advance(),this._advance(),{type:"Projection",children:[{type:"Identity"},t=this._parseProjectionRHS(f.Star)]}):this._parseMultiselectList();case"Current":return{type:"Current"};case"Expref":return{type:"ExpressionReference",children:[i=this.expression(f.Expref)]};case"Lparen":for(var r=[];"Rparen"!==this._lookahead(0);)"Current"===this._lookahead(0)?(i={type:"Current"},this._advance()):i=this.expression(0),r.push(i);return this._match("Rparen"),r[0];default:this._errorToken(e)}},led:function(e,t){var i;switch(e){case"Dot":var n=f.Dot;return"Star"!==this._lookahead(0)?{type:"Subexpression",children:[t,i=this._parseDotRHS(n)]}:(this._advance(),{type:"ValueProjection",children:[t,i=this._parseProjectionRHS(n)]});case"Pipe":return{type:"Pipe",children:[t,i=this.expression(f.Pipe)]};case"Or":return{type:"OrExpression",children:[t,i=this.expression(f.Or)]};case"And":return{type:"AndExpression",children:[t,i=this.expression(f.And)]};case"Lparen":for(var r,o=t.name,a=[];"Rparen"!==this._lookahead(0);)"Current"===this._lookahead(0)?(r={type:"Current"},this._advance()):r=this.expression(0),"Comma"===this._lookahead(0)&&this._match("Comma"),a.push(r);return this._match("Rparen"),{type:"Function",name:o,children:a};case"Filter":var s=this.expression(0);return this._match("Rbracket"),{type:"FilterProjection",children:[t,i="Flatten"===this._lookahead(0)?{type:"Identity"}:this._parseProjectionRHS(f.Filter),s]};case"Flatten":return{type:"Projection",children:[{type:"Flatten",children:[t]},this._parseProjectionRHS(f.Flatten)]};case"EQ":case"NE":case"GT":case"GTE":case"LT":case"LTE":return this._parseComparator(t,e);case"Lbracket":var l=this._lookaheadToken(0);return"Number"===l.type||"Colon"===l.type?(i=this._parseIndexExpression(),this._projectIfSlice(t,i)):(this._match("Star"),this._match("Rbracket"),{type:"Projection",children:[t,i=this._parseProjectionRHS(f.Star)]});default:this._errorToken(this._lookaheadToken(0))}},_match:function(e){if(this._lookahead(0)!==e){var t=this._lookaheadToken(0),i=new Error("Expected "+e+", got: "+t.type);throw i.name="ParserError",i}this._advance()},_errorToken:function(e){var t=new Error("Invalid token ("+e.type+'): "'+e.value+'"');throw t.name="ParserError",t},_parseIndexExpression:function(){if("Colon"===this._lookahead(0)||"Colon"===this._lookahead(1))return this._parseSliceExpression();var e={type:"Index",value:this._lookaheadToken(0).value};return this._advance(),this._match("Rbracket"),e},_projectIfSlice:function(e,t){var i={type:"IndexExpression",children:[e,t]};return"Slice"===t.type?{type:"Projection",children:[i,this._parseProjectionRHS(f.Star)]}:i},_parseSliceExpression:function(){for(var e=[null,null,null],t=0,i=this._lookahead(0);"Rbracket"!==i&&t<3;){if("Colon"===i)t++,this._advance();else{if("Number"!==i){var n=this._lookahead(0),r=new Error("Syntax error, unexpected token: "+n.value+"("+n.type+")");throw r.name="Parsererror",r}e[t]=this._lookaheadToken(0).value,this._advance()}i=this._lookahead(0)}return this._match("Rbracket"),{type:"Slice",children:e}},_parseComparator:function(e,t){return{type:"Comparator",name:t,children:[e,this.expression(f[t])]}},_parseDotRHS:function(e){var t=this._lookahead(0);return["UnquotedIdentifier","QuotedIdentifier","Star"].indexOf(t)>=0?this.expression(e):"Lbracket"===t?(this._match("Lbracket"),this._parseMultiselectList()):"Lbrace"===t?(this._match("Lbrace"),this._parseMultiselectHash()):void 0},_parseProjectionRHS:function(e){var t;if(f[this._lookahead(0)]<10)t={type:"Identity"};else if("Lbracket"===this._lookahead(0))t=this.expression(e);else if("Filter"===this._lookahead(0))t=this.expression(e);else{if("Dot"!==this._lookahead(0)){var i=this._lookaheadToken(0),n=new Error("Sytanx error, unexpected token: "+i.value+"("+i.type+")");throw n.name="ParserError",n}this._match("Dot"),t=this._parseDotRHS(e)}return t},_parseMultiselectList:function(){for(var e=[];"Rbracket"!==this._lookahead(0);){var t=this.expression(0);if(e.push(t),"Comma"===this._lookahead(0)&&(this._match("Comma"),"Rbracket"===this._lookahead(0)))throw new Error("Unexpected token Rbracket")}return this._match("Rbracket"),{type:"MultiSelectList",children:e}},_parseMultiselectHash:function(){for(var e,t,i,n=[],r=["UnquotedIdentifier","QuotedIdentifier"];;){if(e=this._lookaheadToken(0),r.indexOf(e.type)<0)throw new Error("Expecting an identifier token, got: "+e.type);if(t=e.value,this._advance(),this._match("Colon"),i={type:"KeyValuePair",name:t,value:this.expression(0)},n.push(i),"Comma"===this._lookahead(0))this._match("Comma");else if("Rbrace"===this._lookahead(0)){this._match("Rbrace");break}}return{type:"MultiSelectHash",children:n}}},g.prototype={search:function(e,t){return this.visit(e,t)},visit:function(e,o){var a,s,l,c,d,u,p,h,f;switch(e.type){case"Field":return null!==o&&i(o)?void 0===(u=o[e.name])?null:u:null;case"Subexpression":for(l=this.visit(e.children[0],o),f=1;f<e.children.length;f++)if(null===(l=this.visit(e.children[1],l)))return null;return l;case"IndexExpression":return p=this.visit(e.children[0],o),this.visit(e.children[1],p);case"Index":if(!t(o))return null;var m=e.value;return m<0&&(m=o.length+m),void 0===(l=o[m])&&(l=null),l;case"Slice":if(!t(o))return null;var g=e.children.slice(0),v=this.computeSliceParams(o.length,g),y=v[0],b=v[1],w=v[2];if(l=[],w>0)for(f=y;f<b;f+=w)l.push(o[f]);else for(f=y;f>b;f+=w)l.push(o[f]);return l;case"Projection":var S=this.visit(e.children[0],o);if(!t(S))return null;for(h=[],f=0;f<S.length;f++)null!==(s=this.visit(e.children[1],S[f]))&&h.push(s);return h;case"ValueProjection":if(!i(S=this.visit(e.children[0],o)))return null;h=[];var C=function(e){for(var t=Object.keys(e),i=[],n=0;n<t.length;n++)i.push(e[t[n]]);return i}(S);for(f=0;f<C.length;f++)null!==(s=this.visit(e.children[1],C[f]))&&h.push(s);return h;case"FilterProjection":if(!t(S=this.visit(e.children[0],o)))return null;var k=[],x=[];for(f=0;f<S.length;f++)r(a=this.visit(e.children[2],S[f]))||k.push(S[f]);for(var _=0;_<k.length;_++)null!==(s=this.visit(e.children[1],k[_]))&&x.push(s);return x;case"Comparator":switch(c=this.visit(e.children[0],o),d=this.visit(e.children[1],o),e.name){case"EQ":l=n(c,d);break;case"NE":l=!n(c,d);break;case"GT":l=c>d;break;case"GTE":l=c>=d;break;case"LT":l=c<d;break;case"LTE":l=c<=d;break;default:throw new Error("Unknown comparator: "+e.name)}return l;case"Flatten":var E=this.visit(e.children[0],o);if(!t(E))return null;var T=[];for(f=0;f<E.length;f++)t(s=E[f])?T.push.apply(T,s):T.push(s);return T;case"Identity":return o;case"MultiSelectList":if(null===o)return null;for(h=[],f=0;f<e.children.length;f++)h.push(this.visit(e.children[f],o));return h;case"MultiSelectHash":if(null===o)return null;var P;for(h={},f=0;f<e.children.length;f++)h[(P=e.children[f]).name]=this.visit(P.value,o);return h;case"OrExpression":return r(a=this.visit(e.children[0],o))&&(a=this.visit(e.children[1],o)),a;case"AndExpression":return!0===r(c=this.visit(e.children[0],o))?c:this.visit(e.children[1],o);case"NotExpression":return r(c=this.visit(e.children[0],o));case"Literal":return e.value;case"Pipe":return p=this.visit(e.children[0],o),this.visit(e.children[1],p);case"Current":return o;case"Function":var I=[];for(f=0;f<e.children.length;f++)I.push(this.visit(e.children[f],o));return this.runtime.callFunction(e.name,I);case"ExpressionReference":var A=e.children[0];return A.jmespathType="Expref",A;default:throw new Error("Unknown node type: "+e.type)}},computeSliceParams:function(e,t){var i=t[0],n=t[1],r=t[2],o=[null,null,null];if(null===r)r=1;else if(0===r){var a=new Error("Invalid slice, step cannot be 0");throw a.name="RuntimeError",a}var s=r<0;return i=null===i?s?e-1:0:this.capSliceRange(e,i,r),n=null===n?s?-1:e:this.capSliceRange(e,n,r),o[0]=i,o[1]=n,o[2]=r,o},capSliceRange:function(e,t,i){return t<0?(t+=e)<0&&(t=i<0?-1:0):t>=e&&(t=i<0?e-1:e),t}},v.prototype={callFunction:function(e,t){var i=this.functionTable[e];if(void 0===i)throw new Error("Unknown function: "+e+"()");return this._validateArgs(e,t,i._signature),i._func.call(this,t)},_validateArgs:function(e,t,i){var n,r,o,a;if(i[i.length-1].variadic){if(t.length<i.length)throw n=1===i.length?" argument":" arguments",new Error("ArgumentError: "+e+"() takes at least"+i.length+n+" but received "+t.length)}else if(t.length!==i.length)throw n=1===i.length?" argument":" arguments",new Error("ArgumentError: "+e+"() takes "+i.length+n+" but received "+t.length);for(var s=0;s<i.length;s++){a=!1,r=i[s].types,o=this._getTypeName(t[s]);for(var c=0;c<r.length;c++)if(this._typeMatches(o,r[c],t[s])){a=!0;break}if(!a){var d=r.map((function(e){return l[e]})).join(",");throw new Error("TypeError: "+e+"() expected argument "+(s+1)+" to be type "+d+" but received type "+l[o]+" instead.")}}},_typeMatches:function(e,t,i){if(1===t)return!0;if(9!==t&&8!==t&&3!==t)return e===t;if(3===t)return 3===e;if(3===e){var n;8===t?n=a:9===t&&(n=s);for(var r=0;r<i.length;r++)if(!this._typeMatches(this._getTypeName(i[r]),n,i[r]))return!1;return!0}},_getTypeName:function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return s;case"[object Number]":return a;case"[object Array]":return 3;case"[object Boolean]":return 5;case"[object Null]":return 7;case"[object Object]":return"Expref"===e.jmespathType?6:4}},_functionStartsWith:function(e){return 0===e[0].lastIndexOf(e[1])},_functionEndsWith:function(e){var t=e[0],i=e[1];return-1!==t.indexOf(i,t.length-i.length)},_functionReverse:function(e){if(this._getTypeName(e[0])===s){for(var t=e[0],i="",n=t.length-1;n>=0;n--)i+=t[n];return i}var r=e[0].slice(0);return r.reverse(),r},_functionAbs:function(e){return Math.abs(e[0])},_functionCeil:function(e){return Math.ceil(e[0])},_functionAvg:function(e){for(var t=0,i=e[0],n=0;n<i.length;n++)t+=i[n];return t/i.length},_functionContains:function(e){return e[0].indexOf(e[1])>=0},_functionFloor:function(e){return Math.floor(e[0])},_functionLength:function(e){return i(e[0])?Object.keys(e[0]).length:e[0].length},_functionMap:function(e){for(var t=[],i=this._interpreter,n=e[0],r=e[1],o=0;o<r.length;o++)t.push(i.visit(n,r[o]));return t},_functionMerge:function(e){for(var t={},i=0;i<e.length;i++){var n=e[i];for(var r in n)t[r]=n[r]}return t},_functionMax:function(e){if(e[0].length>0){if(this._getTypeName(e[0][0])===a)return Math.max.apply(Math,e[0]);for(var t=e[0],i=t[0],n=1;n<t.length;n++)i.localeCompare(t[n])<0&&(i=t[n]);return i}return null},_functionMin:function(e){if(e[0].length>0){if(this._getTypeName(e[0][0])===a)return Math.min.apply(Math,e[0]);for(var t=e[0],i=t[0],n=1;n<t.length;n++)t[n].localeCompare(i)<0&&(i=t[n]);return i}return null},_functionSum:function(e){for(var t=0,i=e[0],n=0;n<i.length;n++)t+=i[n];return t},_functionType:function(e){switch(this._getTypeName(e[0])){case a:return"number";case s:return"string";case 3:return"array";case 4:return"object";case 5:return"boolean";case 6:return"expref";case 7:return"null"}},_functionKeys:function(e){return Object.keys(e[0])},_functionValues:function(e){for(var t=e[0],i=Object.keys(t),n=[],r=0;r<i.length;r++)n.push(t[i[r]]);return n},_functionJoin:function(e){var t=e[0];return e[1].join(t)},_functionToArray:function(e){return 3===this._getTypeName(e[0])?e[0]:[e[0]]},_functionToString:function(e){return this._getTypeName(e[0])===s?e[0]:JSON.stringify(e[0])},_functionToNumber:function(e){var t,i=this._getTypeName(e[0]);return i===a?e[0]:i!==s||(t=+e[0],isNaN(t))?null:t},_functionNotNull:function(e){for(var t=0;t<e.length;t++)if(7!==this._getTypeName(e[t]))return e[t];return null},_functionSort:function(e){var t=e[0].slice(0);return t.sort(),t},_functionSortBy:function(e){var t=e[0].slice(0);if(0===t.length)return t;var i=this._interpreter,n=e[1],r=this._getTypeName(i.visit(n,t[0]));if([a,s].indexOf(r)<0)throw new Error("TypeError");for(var o=this,l=[],c=0;c<t.length;c++)l.push([c,t[c]]);l.sort((function(e,t){var a=i.visit(n,e[1]),s=i.visit(n,t[1]);if(o._getTypeName(a)!==r)throw new Error("TypeError: expected "+r+", received "+o._getTypeName(a));if(o._getTypeName(s)!==r)throw new Error("TypeError: expected "+r+", received "+o._getTypeName(s));return a>s?1:a<s?-1:e[0]-t[0]}));for(var d=0;d<l.length;d++)t[d]=l[d][1];return t},_functionMaxBy:function(e){for(var t,i,n=e[1],r=e[0],o=this.createKeyFunction(n,[a,s]),l=-1/0,c=0;c<r.length;c++)(i=o(r[c]))>l&&(l=i,t=r[c]);return t},_functionMinBy:function(e){for(var t,i,n=e[1],r=e[0],o=this.createKeyFunction(n,[a,s]),l=1/0,c=0;c<r.length;c++)(i=o(r[c]))<l&&(l=i,t=r[c]);return t},createKeyFunction:function(e,t){var i=this,n=this._interpreter;return function(r){var o=n.visit(e,r);if(t.indexOf(i._getTypeName(o))<0){var a="TypeError: expected one of "+t+", received "+i._getTypeName(o);throw new Error(a)}return o}}},e.tokenize=function(e){return(new h).tokenize(e)},e.compile=function(e){return(new m).parse(e)},e.search=function(e,t){var i=new m,n=new v,r=new g(n);n._interpreter=r;var o=i.parse(t);return r.search(o,e)},e.strictDeepEqual=n}(t)},function(e,t,i){var n=i(137).PROPER,r=i(13),o=i(197);e.exports=function(e){return r((function(){return!!o[e]()||"​…᠎"!=="​…᠎"[e]()||n&&o[e].name!==e}))}},function(e,t,i){"use strict";var n=i(121),r=TypeError;e.exports=function(e,t){if(!delete e[t])throw r("Cannot delete property "+n(t)+" of "+n(e))}},function(e,t,i){var n=i(123)(i(87),"Map");e.exports=n},function(e,t,i){var n=i(146),r=i(124);e.exports=function(e){if(!r(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,i){var n=i(355);e.exports=function(e,t,i){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}},function(e,t){var i=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||i)}},function(e,t,i){(function(e){var n=i(87),r=i(612),o=t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===o?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||r;e.exports=l}).call(this,i(202)(e))},function(e,t,i){var n=i(614),r=i(615),o=i(616),a=o&&o.isTypedArray,s=a?r(a):n;e.exports=s},function(e,t){},function(e,t,i){var n=i(171),r=Math.floor,o=function(e,t){var i=e.length,l=r(i/2);return i<8?a(e,t):s(e,o(n(e,0,l),t),o(n(e,l),t),t)},a=function(e,t){for(var i,n,r=e.length,o=1;o<r;){for(n=o,i=e[o];n&&t(e[n-1],i)>0;)e[n]=e[--n];n!==o++&&(e[n]=i)}return e},s=function(e,t,i,n){for(var r=t.length,o=i.length,a=0,s=0;a<r||s<o;)e[a+s]=a<r&&s<o?n(t[a],i[s])<=0?t[a++]:i[s++]:a<r?t[a++]:i[s++];return e};e.exports=o},function(e,t,i){"use strict";var n=i(15),r=i(677);n({target:"String",proto:!0,forced:i(678)("link")},{link:function(e){return r(this,"a","href",e)}})},function(e,t,i){i(679);var n=i(15),r=i(373);n({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==r},{trimStart:r})},function(e,t,i){i(680);var n=i(15),r=i(374);n({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==r},{trimEnd:r})},function(e,t,i){"use strict";var n=i(15),r=i(12),o=i(75),a=i(53),s=i(54),l=i(256),c=i(42),d=i(13),u=i(264),p=i(170),h=i(375),f=i(376),m=i(118),g=i(377),v=[],y=r(v.sort),b=r(v.push),w=d((function(){v.sort(void 0)})),S=d((function(){v.sort(null)})),C=p("sort"),k=!d((function(){if(m)return m<70;if(!(h&&h>3)){if(f)return!0;if(g)return g<603;var e,t,i,n,r="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:i=3;break;case 68:case 71:i=4;break;default:i=2}for(n=0;n<47;n++)v.push({k:t+n,v:i})}for(v.sort((function(e,t){return t.v-e.v})),n=0;n<v.length;n++)t=v[n].k.charAt(0),r.charAt(r.length-1)!==t&&(r+=t);return"DGBEFHACIJK"!==r}}));n({target:"Array",proto:!0,forced:w||!S||!C||!k},{sort:function(e){void 0!==e&&o(e);var t=a(this);if(k)return void 0===e?y(t):y(t,e);var i,n,r=[],d=s(t);for(n=0;n<d;n++)n in t&&b(r,t[n]);for(u(r,function(e){return function(t,i){return void 0===i?-1:void 0===t?1:void 0!==e?+e(t,i)||0:c(t)>c(i)?1:-1}}(e)),i=s(r),n=0;n<i;)t[n]=r[n++];for(;n<d;)l(t,n++);return t}})},function(e,t,i){i(347)("iterator")},function(e,t){},function(e,t,i){var n=i(75),r=i(53),o=i(156),a=i(54),s=TypeError,l=function(e){return function(t,i,l,c){n(i);var d=r(t),u=o(d),p=a(d),h=e?p-1:0,f=e?-1:1;if(l<2)for(;;){if(h in u){c=u[h],h+=f;break}if(h+=f,e?h<0:p<=h)throw s("Reduce of empty array with no initial value")}for(;e?h>=0:p>h;h+=f)h in u&&(c=i(c,u[h],h,d));return c}};e.exports={left:l(!1),right:l(!0)}},function(e,t,i){var n=i(15),r=i(12),o=i(159),a=i(38),s=i(39),l=i(48).f,c=i(101),d=i(345),u=i(384),p=i(158),h=i(748),f=!1,m=p("meta"),g=0,v=function(e){l(e,m,{value:{objectID:"O"+g++,weakData:{}}})},y=e.exports={enable:function(){y.enable=function(){},f=!0;var e=c.f,t=r([].splice),i={};i[m]=1,e(i).length&&(c.f=function(i){for(var n=e(i),r=0,o=n.length;r<o;r++)if(n[r]===m){t(n,r,1);break}return n},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:d.f}))},fastKey:function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!s(e,m)){if(!u(e))return"F";if(!t)return"E";v(e)}return e[m].objectID},getWeakData:function(e,t){if(!s(e,m)){if(!u(e))return!0;if(!t)return!1;v(e)}return e[m].weakData},onFreeze:function(e){return h&&f&&u(e)&&!s(e,m)&&v(e),e}};o[m]=!0},function(e,t,i){var n,r;n=[i(30)],void 0===(r=function(e){"use strict";return{initialize:function(t){return this.MAX_LOGS_SIZE=null!=t.maxLogSize?t.maxLogSize:5,this.PUSH_LOGS_INTERVAL=1e4,this.COOLDOWN_PERIOD=3e5,this.SAFE_KILL_TIMEOUT=108e5,this.VERBOSE=null==t.verbose||t.verbose,this.ENABLE_SAVING_LOGS=!0,this.saveLogs=!1,this.lastLogsPushedTime=0,this.buffer=[],this.digest=t.digest,this.enabled=t.enabled,this.digest?this.videoModel=new e({digest:this.digest}):this.videoModel=new e,this},log:function(e){this.saveLog("log",arguments),this.VERBOSE&&console.log.apply(console,arguments)},info:function(e){this.saveLog("info",arguments),this.VERBOSE&&console.info.apply(console,arguments)},warn:function(e){this.saveLog("warn",arguments),this.VERBOSE&&console.warn.apply(console,arguments)},error:function(e){this.saveLog("error",arguments),this.VERBOSE&&console.error.apply(console,arguments)},saveLog:function(e,t){try{if(this.saveLogs&&this.ENABLE_SAVING_LOGS){var i,n=(new Date).toISOString();try{i=n+" : "+JSON.stringify(t)}catch(e){i=n+" : "+JSON.stringify(t[0])}var r={authoringAssetId:this.assetId,description:e,stackTrace:i};this.buffer.push(r),this.buffer.length>=this.MAX_LOGS_SIZE&&this.pushLogsToServer()}}catch(e){console.log("error adding logs ",e)}},pushLogsToServer:function(){if(!((new Date).getTime()-this.lastLogsPushedTime<2e3||0==this.ENABLE_SAVING_LOGS||this.buffer.length<=0)&&this.assetId){this.lastLogsPushedTime=(new Date).getTime();var e=this.buffer,t=this;this.videoModel.logClientData(this.buffer,this.enabled,(function(){}),(function(){console.log("error pushing logs to server");var i=e;i.concat(t.buffer),t.buffer=i})),this.buffer=[]}},startSavingLogs:function(e){if(0!=this.ENABLE_SAVING_LOGS){this.assetId=e,clearTimeout(this.stopSavingTimeout),this.safeKillTimeout=setTimeout(this.stopSavingLogs,this.SAFE_KILL_TIMEOUT),this.saveLogs=!0;var t=this;this.saveLogsInterval=setInterval((function(){t.pushLogsToServer()}),this.PUSH_LOGS_INTERVAL)}},stopSavingLogs:function(){if(0!=this.ENABLE_SAVING_LOGS){clearTimeout(this.safeKillTimeout);var e=this;this.stopSavingTimeout=setTimeout((function(){e.saveLogs=!1,e.pushLogsToServer(),clearInterval(e.saveLogsInterval)}),e.COOLDOWN_PERIOD),this.pushLogsToServer()}}}}.apply(t,n))||(e.exports=r)},function(e,t,i){i(173);var n=i(14),r=n.Service,o=n.apiLoader;o.services.s3={},n.S3=r.defineService("s3",["2006-03-01"]),i(558),Object.defineProperty(o.services.s3,"2006-03-01",{get:function(){var e=i(561);return e.paginators=i(562).pagination,e.waiters=i(563).waiters,e},enumerable:!0,configurable:!0}),e.exports=n.S3},function(e,t,i){"use strict";i.r(t);i(115),i(99),i(24),i(0);var n=i(5),r=i.n(n),o=i(91),a=i(391),s=i.n(a),l=i(112),c=i.n(l),d=i(20),u={},p={},h={},f={},m={},g=[],v={},y={};y[r.a.analytics.VIDEO_STATS]={seconds:10,calls:20},y[r.a.analytics.FIRST_FRAME_LOAD]={calls:1},y[r.a.analytics.UPDATE_BANDWIDTH]={calls:1},y[r.a.analytics.CLOSE_EVENT]={calls:1};var b={};b[r.a.kinesisDataStreamType.VIDEO_ANALYTICS]=JSON.parse(o).videoAnalyticsIdentity,b[r.a.kinesisDataStreamType.VIDEO_PAGE_REPORTS]=JSON.parse(o).videoAnalyticsIdentity;var w={};w[r.a.kinesisDataStreamType.VIDEO_ANALYTICS]=JSON.parse(o).videoAnalyticsFallback,w[r.a.kinesisDataStreamType.VIDEO_PAGE_REPORTS]=JSON.parse(o).videoAnalyticsFallback;var S=1e3*(window.HippoVideo&&window.HippoVideo.AppRegistry&&window.HippoVideo.AppRegistry.KinesisApiTimeout?Number(window.HippoVideo.AppRegistry.KinesisApiTimeout):10);window.onbeforeunload=function(){for(var e in u)try{u[e].clearCachedId()}catch(e){}};var C={setAnalayticsCognito:function(e,t){if(e&&t)try{if(u[e])try{u[e].clearCachedId()}catch(e){}u[e]=new c.a({IdentityId:t.identity_id,Logins:{"cognito-identity.amazonaws.com":t.token}},{region:t.region,httpOptions:{timeout:S}}),m[e]=t.stream_name,p[e]=t.region,f[e]=t.bean_stalk_environment,h[e]=null,this._initKinesis(e)}catch(e){console.log(e)}},pushRecord:function(e,t,i,n){if(this.isValidKinesisRequest(i)){n=null==n||n,i.stream_type=e,f[e]&&(i.bean_stalk_environment=f[e]),i.recordCreatedTime=(new Date).getTime()/1e3,i.recordCreatedFrom="client";var r=this;u[e]?r._pushRecord(e,t,i,n,(function(e){}),(function(o){r._refreshToken(e,i,(function(o){r.setAnalayticsCognito(e,o),r._pushRecord(e,t,i,n,(function(e){}),(function(n){r._fallback(e,t,i)}))}),(function(n){r._fallback(e,t,i)}))})):r._fallback(e,t,i)}},isValidKinesisRequest:function(e){if(!y[e.type])return!0;var t=e.video_uuid?e.video_uuid:e.page_uuid;if(t){if(v[t]&&v[t][e.type])return!1;var i=(new Date).getTime(),n=y[e.type].seconds?i-1e3*y[e.type].seconds:0;return g.filter((function(i){return i.id==t&&i.type==e.type&&i.time>n})).length>y[e.type].calls?(v[t]||(v[t]={}),v[t][e.type]=!0,!1):(g.push({id:t,type:e.type,time:i}),!0)}return!1},_refreshToken:function(e,t,i,n){var o=b[e],a={};e==r.a.kinesisDataStreamType.VIDEO_ANALYTICS?a.token=t.token:e==r.a.kinesisDataStreamType.VIDEO_PAGE_REPORTS&&(a.page_id=t.page_id),d.default.call({method:"POST",url:o,data:a,success:function(e){e.status?i(e):n&&n()},error:n})},_pushRecord:function(e,t,i,n,r,o){if(h[e]){h[e].config.update({httpOptions:{xhrAsync:n}});var a={Data:JSON.stringify(i),PartitionKey:String(t),StreamName:m[e]};h[e].putRecord(a,(function(e,t){e?o&&o(e):r(t)}))}else o&&o()},_initKinesis:function(e){h[e]||(h[e]=new s.a({credentials:u[e],region:p[e],httpOptions:{timeout:S}}))},_fallback:function(e,t,i){var n=w[e],o={data:i,partition_key:t};e==r.a.kinesisDataStreamType.VIDEO_ANALYTICS?o.token=i.token:e==r.a.kinesisDataStreamType.VIDEO_PAGE_REPORTS&&(o.page_id=i.page_id),d.default.call({method:"POST",url:n,data:o,success:function(e){},error:function(e){}})}};t.default=C},function(e){e.exports=JSON.parse('{"a":"/api/internal/video/guest","b":"/video/embed"}')},function(e,t,i){"use strict";var n=i(221),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return n.isMemo(e)?a:s[e.$$typeof]||r}s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[n.Memo]=a;var c=Object.defineProperty,d=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,i,n){if("string"!=typeof i){if(f){var r=h(i);r&&r!==f&&e(t,r,n)}var a=d(i);u&&(a=a.concat(u(i)));for(var s=l(t),m=l(i),g=0;g<a.length;++g){var v=a[g];if(!(o[v]||n&&n[v]||m&&m[v]||s&&s[v])){var y=p(i,v);try{c(t,v,y)}catch(e){}}}}return t}},function(e,t){function i(){return e.exports=i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,i.apply(this,arguments)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){(function(e){!function(t){"use strict";var n,r;function o(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function a(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new o,this.dtree=new o}String.prototype.codePointAt||(n=function(){try{var e={},t=Object.defineProperty,i=t(e,e,e)&&t}catch(e){}return i}(),r=function(e){if(null==this)throw TypeError();var t=String(this),i=t.length,n=e?Number(e):0;if(n!=n&&(n=0),!(n<0||i<=n)){var r,o=t.charCodeAt(n);return 55296<=o&&o<=56319&&n+1<i&&56320<=(r=t.charCodeAt(n+1))&&r<=57343?1024*(o-55296)+r-56320+65536:o}},n?n(String.prototype,"codePointAt",{value:r,configurable:!0,writable:!0}):String.prototype.codePointAt=r);var s=new o,l=new o,c=new Uint8Array(30),d=new Uint16Array(30),u=new Uint8Array(30),p=new Uint16Array(30),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f=new o,m=new Uint8Array(320);function g(e,t,i,n){var r,o;for(r=0;r<i;++r)e[r]=0;for(r=0;r<30-i;++r)e[r+i]=r/i|0;for(o=n,r=0;r<30;++r)t[r]=o,o+=1<<e[r]}var v=new Uint16Array(16);function y(e,t,i,n){var r,o;for(r=0;r<16;++r)e.table[r]=0;for(r=0;r<n;++r)e.table[t[i+r]]++;for(r=o=e.table[0]=0;r<16;++r)v[r]=o,o+=e.table[r];for(r=0;r<n;++r)t[i+r]&&(e.trans[v[t[i+r]]++]=r)}function b(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var t=1&e.tag;return e.tag>>>=1,t}function w(e,t,i){if(!t)return i;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var n=e.tag&65535>>>16-t;return e.tag>>>=t,e.bitcount-=t,n+i}function S(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;for(var i=0,n=0,r=0,o=e.tag;n=2*n+(1&o),o>>>=1,++r,i+=t.table[r],0<=(n-=t.table[r]););return e.tag=o,e.bitcount-=r,t.trans[i+n]}function C(e,t,i){var n,r,o,a,s,l;for(n=w(e,5,257),r=w(e,5,1),o=w(e,4,4),a=0;a<19;++a)m[a]=0;for(a=0;a<o;++a){var c=w(e,3,0);m[h[a]]=c}for(y(f,m,0,19),s=0;s<n+r;){var d=S(e,f);switch(d){case 16:var u=m[s-1];for(l=w(e,2,3);l;--l)m[s++]=u;break;case 17:for(l=w(e,3,3);l;--l)m[s++]=0;break;case 18:for(l=w(e,7,11);l;--l)m[s++]=0;break;default:m[s++]=d}}y(t,m,0,n),y(i,m,n,r)}function k(e,t,i){for(;;){var n,r,o,a,s=S(e,t);if(256===s)return 0;if(s<256)e.dest[e.destLen++]=s;else for(n=w(e,c[s-=257],d[s]),r=S(e,i),a=o=e.destLen-w(e,u[r],p[r]);a<o+n;++a)e.dest[e.destLen++]=e.dest[a]}}function x(e){for(var t,i;8<e.bitcount;)e.sourceIndex--,e.bitcount-=8;if((t=256*(t=e.source[e.sourceIndex+1])+e.source[e.sourceIndex])!==(65535&~(256*e.source[e.sourceIndex+3]+e.source[e.sourceIndex+2])))return-3;for(e.sourceIndex+=4,i=t;i;--i)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,0}function _(e,t,i,n,r){return Math.pow(1-r,3)*e+3*Math.pow(1-r,2)*r*t+3*(1-r)*Math.pow(r,2)*i+Math.pow(r,3)*n}function E(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}function T(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}function P(e){throw new Error(e)}function I(e,t){e||P(t)}!function(e,t){var i;for(i=0;i<7;++i)e.table[i]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,i=0;i<24;++i)e.trans[i]=256+i;for(i=0;i<144;++i)e.trans[24+i]=i;for(i=0;i<8;++i)e.trans[168+i]=280+i;for(i=0;i<112;++i)e.trans[176+i]=144+i;for(i=0;i<5;++i)t.table[i]=0;for(t.table[5]=32,i=0;i<32;++i)t.trans[i]=i}(s,l),g(c,d,4,3),g(u,p,2,1),c[28]=0,d[28]=258,E.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},E.prototype.addPoint=function(e,t){"number"==typeof e&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))},E.prototype.addX=function(e){this.addPoint(e,null)},E.prototype.addY=function(e){this.addPoint(null,e)},E.prototype.addBezier=function(e,t,i,n,r,o,a,s){var l=this,c=[e,t],d=[i,n],u=[r,o],p=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var h=0;h<=1;h++){var f=6*c[h]-12*d[h]+6*u[h],m=-3*c[h]+9*d[h]-9*u[h]+3*p[h],g=3*d[h]-3*c[h];if(0!==m){var v=Math.pow(f,2)-4*g*m;if(!(v<0)){var y=(-f+Math.sqrt(v))/(2*m);0<y&&y<1&&(0===h&&l.addX(_(c[h],d[h],u[h],p[h],y)),1===h&&l.addY(_(c[h],d[h],u[h],p[h],y)));var b=(-f-Math.sqrt(v))/(2*m);0<b&&b<1&&(0===h&&l.addX(_(c[h],d[h],u[h],p[h],b)),1===h&&l.addY(_(c[h],d[h],u[h],p[h],b)))}}else{if(0===f)continue;var w=-g/f;0<w&&w<1&&(0===h&&l.addX(_(c[h],d[h],u[h],p[h],w)),1===h&&l.addY(_(c[h],d[h],u[h],p[h],w)))}}},E.prototype.addQuad=function(e,t,i,n,r,o){var a=e+2/3*(i-e),s=t+2/3*(n-t),l=a+1/3*(r-e),c=s+1/3*(o-t);this.addBezier(e,t,a,s,l,c,r,o)},T.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},T.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},T.prototype.curveTo=T.prototype.bezierCurveTo=function(e,t,i,n,r,o){this.commands.push({type:"C",x1:e,y1:t,x2:i,y2:n,x:r,y:o})},T.prototype.quadTo=T.prototype.quadraticCurveTo=function(e,t,i,n){this.commands.push({type:"Q",x1:e,y1:t,x:i,y:n})},T.prototype.close=T.prototype.closePath=function(){this.commands.push({type:"Z"})},T.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof E){var t=e;return this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),void this.close()}Array.prototype.push.apply(this.commands,e)},T.prototype.getBoundingBox=function(){for(var e=new E,t=0,i=0,n=0,r=0,o=0;o<this.commands.length;o++){var a=this.commands[o];switch(a.type){case"M":e.addPoint(a.x,a.y),t=n=a.x,i=r=a.y;break;case"L":e.addPoint(a.x,a.y),n=a.x,r=a.y;break;case"Q":e.addQuad(n,r,a.x1,a.y1,a.x,a.y),n=a.x,r=a.y;break;case"C":e.addBezier(n,r,a.x1,a.y1,a.x2,a.y2,a.x,a.y),n=a.x,r=a.y;break;case"Z":n=t,r=i;break;default:throw new Error("Unexpected path command "+a.type)}}return e.isEmpty()&&e.addPoint(0,0),e},T.prototype.draw=function(e){e.beginPath();for(var t=0;t<this.commands.length;t+=1){var i=this.commands[t];"M"===i.type?e.moveTo(i.x,i.y):"L"===i.type?e.lineTo(i.x,i.y):"C"===i.type?e.bezierCurveTo(i.x1,i.y1,i.x2,i.y2,i.x,i.y):"Q"===i.type?e.quadraticCurveTo(i.x1,i.y1,i.x,i.y):"Z"===i.type&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},T.prototype.toPathData=function(e){function t(){for(var t,i=arguments,n="",r=0;r<arguments.length;r+=1){var o=i[r];0<=o&&0<r&&(n+=" "),n+=(t=o,Math.round(t)===t?""+Math.round(t):t.toFixed(e))}return n}e=void 0!==e?e:2;for(var i="",n=0;n<this.commands.length;n+=1){var r=this.commands[n];"M"===r.type?i+="M"+t(r.x,r.y):"L"===r.type?i+="L"+t(r.x,r.y):"C"===r.type?i+="C"+t(r.x1,r.y1,r.x2,r.y2,r.x,r.y):"Q"===r.type?i+="Q"+t(r.x1,r.y1,r.x,r.y):"Z"===r.type&&(i+="Z")}return i},T.prototype.toSVG=function(e){var t='<path d="';return t+=this.toPathData(e),t+='"',this.fill&&"black"!==this.fill&&(null===this.fill?t+=' fill="none"':t+=' fill="'+this.fill+'"'),this.stroke&&(t+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),t+"/>"},T.prototype.toDOMElement=function(e){var t=this.toPathData(e),i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",t),i};var A={fail:P,argument:I,assert:I},R=2147483648,O={},N={},D={};function L(e){return function(){return e}}N.BYTE=function(e){return A.argument(0<=e&&e<=255,"Byte value should be between 0 and 255."),[e]},D.BYTE=L(1),N.CHAR=function(e){return[e.charCodeAt(0)]},D.CHAR=L(1),N.CHARARRAY=function(e){for(var t=[],i=0;i<e.length;i+=1)t[i]=e.charCodeAt(i);return t},D.CHARARRAY=function(e){return e.length},N.USHORT=function(e){return[e>>8&255,255&e]},D.USHORT=L(2),N.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},D.SHORT=L(2),N.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},D.UINT24=L(3),N.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},D.ULONG=L(4),N.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},D.LONG=L(4),N.FIXED=N.ULONG,D.FIXED=D.ULONG,N.FWORD=N.SHORT,D.FWORD=D.SHORT,N.UFWORD=N.USHORT,D.UFWORD=D.USHORT,N.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},D.LONGDATETIME=L(8),N.TAG=function(e){return A.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},D.TAG=L(4),N.Card8=N.BYTE,D.Card8=D.BYTE,N.Card16=N.USHORT,D.Card16=D.USHORT,N.OffSize=N.BYTE,D.OffSize=D.BYTE,N.SID=N.USHORT,D.SID=D.USHORT,N.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?N.NUMBER16(e):N.NUMBER32(e)},D.NUMBER=function(e){return N.NUMBER(e).length},N.NUMBER16=function(e){return[28,e>>8&255,255&e]},D.NUMBER16=L(3),N.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},D.NUMBER32=L(5),N.REAL=function(e){var t=e.toString(),i=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(i){var n=parseFloat("1e"+((i[2]?+i[2]:0)+i[1].length));t=(Math.round(e*n)/n).toString()}for(var r="",o=0,a=t.length;o<a;o+=1){var s=t[o];r+="e"===s?"-"===t[++o]?"c":"b":"."===s?"a":"-"===s?"e":s}for(var l=[30],c=0,d=(r+=1&r.length?"f":"ff").length;c<d;c+=2)l.push(parseInt(r.substr(c,2),16));return l},D.REAL=function(e){return N.REAL(e).length},N.NAME=N.CHARARRAY,D.NAME=D.CHARARRAY,N.STRING=N.CHARARRAY,D.STRING=D.CHARARRAY,O.UTF8=function(e,t,i){for(var n=[],r=i,o=0;o<r;o++,t+=1)n[o]=e.getUint8(t);return String.fromCharCode.apply(null,n)},O.UTF16=function(e,t,i){for(var n=[],r=i/2,o=0;o<r;o++,t+=2)n[o]=e.getUint16(t);return String.fromCharCode.apply(null,n)},N.UTF16=function(e){for(var t=[],i=0;i<e.length;i+=1){var n=e.charCodeAt(i);t[t.length]=n>>8&255,t[t.length]=255&n}return t},D.UTF16=function(e){return 2*e.length};var M={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,i,n){var r=M[n];if(void 0!==r){for(var o="",a=0;a<i;a++){var s=e.getUint8(t+a);o+=s<=127?String.fromCharCode(s):r[127&s]}return o}};var B,F="function"==typeof WeakMap&&new WeakMap;function V(e){return-128<=e&&e<=127}function U(e,t,i){for(var n=0,r=e.length;t<r&&n<64&&0===e[t];)++t,++n;return i.push(128|n-1),t}function z(e,t,i){for(var n=0,r=e.length,o=t;o<r&&n<64;){var a=e[o];if(!V(a))break;if(0===a&&o+1<r&&0===e[o+1])break;++o,++n}i.push(n-1);for(var s=t;s<o;++s)i.push(e[s]+256&255);return o}function H(e,t,i){for(var n=0,r=e.length,o=t;o<r&&n<64;){var a=e[o];if(0===a)break;if(V(a)&&o+1<r&&V(e[o+1]))break;++o,++n}i.push(64|n-1);for(var s=t;s<o;++s){var l=e[s];i.push(l+65536>>8&255,l+256&255)}return o}N.MACSTRING=function(e,t){var i=function(e){if(!B)for(var t in B={},M)B[t]=new String(t);var i=B[e];if(void 0!==i){if(F){var n=F.get(i);if(void 0!==n)return n}var r=M[e];if(void 0!==r){for(var o={},a=0;a<r.length;a++)o[r.charCodeAt(a)]=a+128;return F&&F.set(i,o),o}}}(t);if(void 0!==i){for(var n=[],r=0;r<e.length;r++){var o=e.charCodeAt(r);if(128<=o&&void 0===(o=i[o]))return;n[r]=o}return n}},D.MACSTRING=function(e,t){var i=N.MACSTRING(e,t);return void 0!==i?i.length:0},N.VARDELTAS=function(e){for(var t=0,i=[];t<e.length;){var n=e[t];t=0===n?U(e,t,i):-128<=n&&n<=127?z(e,t,i):H(e,t,i)}return i},N.INDEX=function(e){for(var t=1,i=[t],n=[],r=0;r<e.length;r+=1){var o=N.OBJECT(e[r]);Array.prototype.push.apply(n,o),t+=o.length,i.push(t)}if(0===n.length)return[0,0];for(var a=[],s=1+Math.floor(Math.log(t)/Math.log(2))/8|0,l=[void 0,N.BYTE,N.USHORT,N.UINT24,N.ULONG][s],c=0;c<i.length;c+=1){var d=l(i[c]);Array.prototype.push.apply(a,d)}return Array.prototype.concat(N.Card16(e.length),N.OffSize(s),a,n)},D.INDEX=function(e){return N.INDEX(e).length},N.DICT=function(e){for(var t=[],i=Object.keys(e),n=i.length,r=0;r<n;r+=1){var o=parseInt(i[r],0),a=e[o];t=(t=t.concat(N.OPERAND(a.value,a.type))).concat(N.OPERATOR(o))}return t},D.DICT=function(e){return N.DICT(e).length},N.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},N.OPERAND=function(e,t){var i=[];if(Array.isArray(t))for(var n=0;n<t.length;n+=1)A.argument(e.length===t.length,"Not enough arguments given for type"+t),i=i.concat(N.OPERAND(e[n],t[n]));else if("SID"===t)i=i.concat(N.NUMBER(e));else if("offset"===t)i=i.concat(N.NUMBER32(e));else if("number"===t)i=i.concat(N.NUMBER(e));else{if("real"!==t)throw new Error("Unknown operand type "+t);i=i.concat(N.REAL(e))}return i},N.OP=N.BYTE,D.OP=D.BYTE;var j="function"==typeof WeakMap&&new WeakMap;function q(e,t,i){for(var n=0;n<t.length;n+=1){var r=t[n];this[r.name]=r.value}if(this.tableName=e,this.fields=t,i)for(var o=Object.keys(i),a=0;a<o.length;a+=1){var s=o[a],l=i[s];void 0!==this[s]&&(this[s]=l)}}function $(e,t,i){void 0===i&&(i=t.length);var n=new Array(t.length+1);n[0]={name:e+"Count",type:"USHORT",value:i};for(var r=0;r<t.length;r++)n[r+1]={name:e+r,type:"USHORT",value:t[r]};return n}function W(e,t,i){var n=t.length,r=new Array(n+1);r[0]={name:e+"Count",type:"USHORT",value:n};for(var o=0;o<n;o++)r[o+1]={name:e+o,type:"TABLE",value:i(t[o],o)};return r}function G(e,t,i){var n=t.length,r=[];r[0]={name:e+"Count",type:"USHORT",value:n};for(var o=0;o<n;o++)r=r.concat(i(t[o],o));return r}function K(e){1===e.format?q.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat($("glyph",e.glyphs))):A.assert(!1,"Can't create coverage table format 2 yet.")}function Y(e){q.call(this,"scriptListTable",G("scriptRecord",e,(function(e,t){var i=e.script,n=i.defaultLangSys;return A.assert(!!n,"Unable to write GSUB: script "+e.tag+" has no default language system."),[{name:"scriptTag"+t,type:"TAG",value:e.tag},{name:"script"+t,type:"TABLE",value:new q("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new q("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:n.reqFeatureIndex}].concat($("featureIndex",n.featureIndexes)))}].concat(G("langSys",i.langSysRecords,(function(e,t){var i=e.langSys;return[{name:"langSysTag"+t,type:"TAG",value:e.tag},{name:"langSys"+t,type:"TABLE",value:new q("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:i.reqFeatureIndex}].concat($("featureIndex",i.featureIndexes)))}]}))))}]})))}function J(e){q.call(this,"featureListTable",G("featureRecord",e,(function(e,t){var i=e.feature;return[{name:"featureTag"+t,type:"TAG",value:e.tag},{name:"feature"+t,type:"TABLE",value:new q("featureTable",[{name:"featureParams",type:"USHORT",value:i.featureParams}].concat($("lookupListIndex",i.lookupListIndexes)))}]})))}function X(e,t){q.call(this,"lookupListTable",W("lookup",e,(function(e){var i=t[e.lookupType];return A.assert(!!i,"Unable to write GSUB lookup type "+e.lookupType+" tables."),new q("lookupTable",[{name:"lookupType",type:"USHORT",value:e.lookupType},{name:"lookupFlag",type:"USHORT",value:e.lookupFlag}].concat(W("subtable",e.subtables,i)))})))}N.CHARSTRING=function(e){if(j){var t=j.get(e);if(void 0!==t)return t}for(var i=[],n=e.length,r=0;r<n;r+=1){var o=e[r];i=i.concat(N[o.type](o.value))}return j&&j.set(e,i),i},D.CHARSTRING=function(e){return N.CHARSTRING(e).length},N.OBJECT=function(e){var t=N[e.type];return A.argument(void 0!==t,"No encoding function for type "+e.type),t(e.value)},D.OBJECT=function(e){var t=D[e.type];return A.argument(void 0!==t,"No sizeOf function for type "+e.type),t(e.value)},N.TABLE=function(e){for(var t=[],i=e.fields.length,n=[],r=[],o=0;o<i;o+=1){var a=e.fields[o],s=N[a.type];A.argument(void 0!==s,"No encoding function for field type "+a.type+" ("+a.name+")");var l=e[a.name];void 0===l&&(l=a.value);var c=s(l);"TABLE"===a.type?(r.push(t.length),t=t.concat([0,0]),n.push(c)):t=t.concat(c)}for(var d=0;d<n.length;d+=1){var u=r[d],p=t.length;A.argument(p<65536,"Table "+e.tableName+" too big."),t[u]=p>>8,t[u+1]=255&p,t=t.concat(n[d])}return t},D.TABLE=function(e){for(var t=0,i=e.fields.length,n=0;n<i;n+=1){var r=e.fields[n],o=D[r.type];A.argument(void 0!==o,"No sizeOf function for field type "+r.type+" ("+r.name+")");var a=e[r.name];void 0===a&&(a=r.value),t+=o(a),"TABLE"===r.type&&(t+=2)}return t},N.RECORD=N.TABLE,D.RECORD=D.TABLE,N.LITERAL=function(e){return e},D.LITERAL=function(e){return e.length},q.prototype.encode=function(){return N.TABLE(this)},q.prototype.sizeOf=function(){return D.TABLE(this)};var Q={Table:q,Record:q,Coverage:(K.prototype=Object.create(q.prototype)).constructor=K,ScriptList:(Y.prototype=Object.create(q.prototype)).constructor=Y,FeatureList:(J.prototype=Object.create(q.prototype)).constructor=J,LookupList:(X.prototype=Object.create(q.prototype)).constructor=X,ushortList:$,tableList:W,recordList:G};function Z(e,t){return e.getUint8(t)}function ee(e,t){return e.getUint16(t,!1)}function te(e,t){return e.getUint32(t,!1)}function ie(e,t){return e.getInt16(t,!1)+e.getUint16(t+2,!1)/65535}var ne={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function re(e,t){this.data=e,this.offset=t,this.relativeOffset=0}re.prototype.parseByte=function(){var e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},re.prototype.parseChar=function(){var e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},re.prototype.parseCard8=re.prototype.parseByte,re.prototype.parseCard16=re.prototype.parseUShort=function(){var e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},re.prototype.parseSID=re.prototype.parseUShort,re.prototype.parseOffset16=re.prototype.parseUShort,re.prototype.parseShort=function(){var e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},re.prototype.parseF2Dot14=function(){var e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},re.prototype.parseOffset32=re.prototype.parseULong=function(){var e=te(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},re.prototype.parseFixed=function(){var e=ie(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},re.prototype.parseString=function(e){var t=this.data,i=this.offset+this.relativeOffset,n="";this.relativeOffset+=e;for(var r=0;r<e;r++)n+=String.fromCharCode(t.getUint8(i+r));return n},re.prototype.parseTag=function(){return this.parseString(4)},re.prototype.parseLongDateTime=function(){var e=te(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},re.prototype.parseVersion=function(e){var t=ee(this.data,this.offset+this.relativeOffset),i=ee(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,void 0===e&&(e=4096),t+i/e/10},re.prototype.skip=function(e,t){void 0===t&&(t=1),this.relativeOffset+=ne[e]*t},re.prototype.parseULongList=function(e){void 0===e&&(e=this.parseULong());for(var t=new Array(e),i=this.data,n=this.offset+this.relativeOffset,r=0;r<e;r++)t[r]=i.getUint32(n),n+=4;return this.relativeOffset+=4*e,t},re.prototype.parseOffset16List=re.prototype.parseUShortList=function(e){void 0===e&&(e=this.parseUShort());for(var t=new Array(e),i=this.data,n=this.offset+this.relativeOffset,r=0;r<e;r++)t[r]=i.getUint16(n),n+=2;return this.relativeOffset+=2*e,t},re.prototype.parseShortList=function(e){for(var t=new Array(e),i=this.data,n=this.offset+this.relativeOffset,r=0;r<e;r++)t[r]=i.getInt16(n),n+=2;return this.relativeOffset+=2*e,t},re.prototype.parseByteList=function(e){for(var t=new Array(e),i=this.data,n=this.offset+this.relativeOffset,r=0;r<e;r++)t[r]=i.getUint8(n++);return this.relativeOffset+=e,t},re.prototype.parseList=function(e,t){t||(t=e,e=this.parseUShort());for(var i=new Array(e),n=0;n<e;n++)i[n]=t.call(this);return i},re.prototype.parseList32=function(e,t){t||(t=e,e=this.parseULong());for(var i=new Array(e),n=0;n<e;n++)i[n]=t.call(this);return i},re.prototype.parseRecordList=function(e,t){t||(t=e,e=this.parseUShort());for(var i=new Array(e),n=Object.keys(t),r=0;r<e;r++){for(var o={},a=0;a<n.length;a++){var s=n[a],l=t[s];o[s]=l.call(this)}i[r]=o}return i},re.prototype.parseRecordList32=function(e,t){t||(t=e,e=this.parseULong());for(var i=new Array(e),n=Object.keys(t),r=0;r<e;r++){for(var o={},a=0;a<n.length;a++){var s=n[a],l=t[s];o[s]=l.call(this)}i[r]=o}return i},re.prototype.parseStruct=function(e){if("function"==typeof e)return e.call(this);for(var t=Object.keys(e),i={},n=0;n<t.length;n++){var r=t[n],o=e[r];i[r]=o.call(this)}return i},re.prototype.parseValueRecord=function(e){if(void 0===e&&(e=this.parseUShort()),0!==e){var t={};return 1&e&&(t.xPlacement=this.parseShort()),2&e&&(t.yPlacement=this.parseShort()),4&e&&(t.xAdvance=this.parseShort()),8&e&&(t.yAdvance=this.parseShort()),16&e&&(t.xPlaDevice=void 0,this.parseShort()),32&e&&(t.yPlaDevice=void 0,this.parseShort()),64&e&&(t.xAdvDevice=void 0,this.parseShort()),128&e&&(t.yAdvDevice=void 0,this.parseShort()),t}},re.prototype.parseValueRecordList=function(){for(var e=this.parseUShort(),t=this.parseUShort(),i=new Array(t),n=0;n<t;n++)i[n]=this.parseValueRecord(e);return i},re.prototype.parsePointer=function(e){var t=this.parseOffset16();if(0<t)return new re(this.data,this.offset+t).parseStruct(e)},re.prototype.parsePointer32=function(e){var t=this.parseOffset32();if(0<t)return new re(this.data,this.offset+t).parseStruct(e)},re.prototype.parseListOfLists=function(e){for(var t=this,i=this.parseOffset16List(),n=i.length,r=this.relativeOffset,o=new Array(n),a=0;a<n;a++){var s=i[a];if(0!==s)if(t.relativeOffset=s,e){for(var l=t.parseOffset16List(),c=new Array(l.length),d=0;d<l.length;d++)t.relativeOffset=s+l[d],c[d]=e.call(t);o[a]=c}else o[a]=t.parseUShortList();else o[a]=void 0}return this.relativeOffset=r,o},re.prototype.parseCoverage=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort(),i=this.parseUShort();if(1===t)return{format:1,glyphs:this.parseUShortList(i)};if(2!==t)throw new Error("0x"+e.toString(16)+": Coverage format must be 1 or 2.");for(var n=new Array(i),r=0;r<i;r++)n[r]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:n}},re.prototype.parseClassDef=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(1===t)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(2===t)return{format:2,ranges:this.parseRecordList({start:re.uShort,end:re.uShort,classId:re.uShort})};throw new Error("0x"+e.toString(16)+": ClassDef format must be 1 or 2.")},re.list=function(e,t){return function(){return this.parseList(e,t)}},re.list32=function(e,t){return function(){return this.parseList32(e,t)}},re.recordList=function(e,t){return function(){return this.parseRecordList(e,t)}},re.recordList32=function(e,t){return function(){return this.parseRecordList32(e,t)}},re.pointer=function(e){return function(){return this.parsePointer(e)}},re.pointer32=function(e){return function(){return this.parsePointer32(e)}},re.tag=re.prototype.parseTag,re.byte=re.prototype.parseByte,re.uShort=re.offset16=re.prototype.parseUShort,re.uShortList=re.prototype.parseUShortList,re.uLong=re.offset32=re.prototype.parseULong,re.uLongList=re.prototype.parseULongList,re.struct=re.prototype.parseStruct,re.coverage=re.prototype.parseCoverage,re.classDef=re.prototype.parseClassDef;var oe={reserved:re.uShort,reqFeatureIndex:re.uShort,featureIndexes:re.uShortList};re.prototype.parseScriptList=function(){return this.parsePointer(re.recordList({tag:re.tag,script:re.pointer({defaultLangSys:re.pointer(oe),langSysRecords:re.recordList({tag:re.tag,langSys:re.pointer(oe)})})}))||[]},re.prototype.parseFeatureList=function(){return this.parsePointer(re.recordList({tag:re.tag,feature:re.pointer({featureParams:re.offset16,lookupListIndexes:re.uShortList})}))||[]},re.prototype.parseLookupList=function(e){return this.parsePointer(re.list(re.pointer((function(){var t=this.parseUShort();A.argument(1<=t&&t<=9,"GPOS/GSUB lookup type "+t+" unknown.");var i=this.parseUShort(),n=16&i;return{lookupType:t,lookupFlag:i,subtables:this.parseList(re.pointer(e[t])),markFilteringSet:n?this.parseUShort():void 0}}))))||[]},re.prototype.parseFeatureVariationsList=function(){return this.parsePointer32((function(){var e=this.parseUShort(),t=this.parseUShort();return A.argument(1===e&&t<1,"GPOS/GSUB feature variations table unknown."),this.parseRecordList32({conditionSetOffset:re.offset32,featureTableSubstitutionOffset:re.offset32})}))||[]};var ae={getByte:Z,getCard8:Z,getUShort:ee,getCard16:ee,getShort:function(e,t){return e.getInt16(t,!1)},getULong:te,getFixed:ie,getTag:function(e,t){for(var i="",n=t;n<t+4;n+=1)i+=String.fromCharCode(e.getInt8(n));return i},getOffset:function(e,t,i){for(var n=0,r=0;r<i;r+=1)n<<=8,n+=e.getUint8(t+r);return n},getBytes:function(e,t,i){for(var n=[],r=t;r<i;r+=1)n.push(e.getUint8(r));return n},bytesToString:function(e){for(var t="",i=0;i<e.length;i+=1)t+=String.fromCharCode(e[i]);return t},Parser:re},se=function(e,t){var i={};i.version=ae.getUShort(e,t),A.argument(0===i.version,"cmap table version should be 0."),i.numTables=ae.getUShort(e,t+2);for(var n=-1,r=i.numTables-1;0<=r;r-=1){var o=ae.getUShort(e,t+4+8*r),a=ae.getUShort(e,t+4+8*r+2);if(3===o&&(0===a||1===a||10===a)||0===o&&(0===a||1===a||2===a||3===a||4===a)){n=ae.getULong(e,t+4+8*r+4);break}}if(-1===n)throw new Error("No valid cmap sub-tables found.");var s=new ae.Parser(e,t+n);if(i.format=s.parseUShort(),12===i.format)!function(e,t){var i;t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong(),e.groupCount=i=t.parseULong(),e.glyphIndexMap={};for(var n=0;n<i;n+=1)for(var r=t.parseULong(),o=t.parseULong(),a=t.parseULong(),s=r;s<=o;s+=1)e.glyphIndexMap[s]=a,a++}(i,s);else{if(4!==i.format)throw new Error("Only format 4 and 12 cmap tables are supported (found format "+i.format+").");!function(e,t,i,n,r){var o;e.length=t.parseUShort(),e.language=t.parseUShort(),e.segCount=o=t.parseUShort()>>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new ae.Parser(i,n+r+14),s=new ae.Parser(i,n+r+16+2*o),l=new ae.Parser(i,n+r+16+4*o),c=new ae.Parser(i,n+r+16+6*o),d=n+r+16+8*o,u=0;u<o-1;u+=1)for(var p=void 0,h=a.parseUShort(),f=s.parseUShort(),m=l.parseShort(),g=c.parseUShort(),v=f;v<=h;v+=1)0!==g?(d=c.offset+c.relativeOffset-2,d+=g,d+=2*(v-f),0!==(p=ae.getUShort(i,d))&&(p=p+m&65535)):p=v+m&65535,e.glyphIndexMap[v]=p}(i,s,e,t,n)}return i},le=function(e){var t,i=!0;for(t=e.length-1;0<t;t-=1)if(65535<e.get(t).unicode){console.log("Adding CMAP format 12 (needed!)"),i=!1;break}var n=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:i?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:i?12:20}];i||(n=n.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),n=n.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);var r,o,a,s=new Q.Table("cmap",n);for(s.segments=[],t=0;t<e.length;t+=1){for(var l=e.get(t),c=0;c<l.unicodes.length;c+=1)r=s,o=l.unicodes[c],a=t,r.segments.push({end:o,start:o,delta:-(o-a),offset:0,glyphIndex:a});s.segments=s.segments.sort((function(e,t){return e.start-t.start}))}s.segments.push({end:65535,start:65535,delta:1,offset:0});var d=s.segments.length,u=0,p=[],h=[],f=[],m=[],g=[],v=[];for(t=0;t<d;t+=1){var y=s.segments[t];y.end<=65535&&y.start<=65535?(p=p.concat({name:"end_"+t,type:"USHORT",value:y.end}),h=h.concat({name:"start_"+t,type:"USHORT",value:y.start}),f=f.concat({name:"idDelta_"+t,type:"SHORT",value:y.delta}),m=m.concat({name:"idRangeOffset_"+t,type:"USHORT",value:y.offset}),void 0!==y.glyphId&&(g=g.concat({name:"glyph_"+t,type:"USHORT",value:y.glyphId}))):u+=1,i||void 0===y.glyphIndex||(v=(v=(v=v.concat({name:"cmap12Start_"+t,type:"ULONG",value:y.start})).concat({name:"cmap12End_"+t,type:"ULONG",value:y.end})).concat({name:"cmap12Glyph_"+t,type:"ULONG",value:y.glyphIndex}))}if(s.segCountX2=2*(d-u),s.searchRange=2*Math.pow(2,Math.floor(Math.log(d-u)/Math.log(2))),s.entrySelector=Math.log(s.searchRange/2)/Math.log(2),s.rangeShift=s.segCountX2-s.searchRange,s.fields=s.fields.concat(p),s.fields.push({name:"reservedPad",type:"USHORT",value:0}),s.fields=s.fields.concat(h),s.fields=s.fields.concat(f),s.fields=s.fields.concat(m),s.fields=s.fields.concat(g),s.cmap4Length=14+2*p.length+2+2*h.length+2*f.length+2*m.length+2*g.length,!i){var b=16+4*v.length;s.cmap12Offset=20+s.cmap4Length,s.fields=s.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:b},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:v.length/3}]),s.fields=s.fields.concat(v)}return s},ce=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],de=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],ue=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],pe=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function he(e){this.font=e}function fe(e){this.cmap=e}function me(e,t){this.encoding=e,this.charset=t}function ge(e){switch(e.version){case 1:this.names=pe.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(var t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<pe.length?this.names[t]=pe[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-pe.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(var i=0;i<e.numberOfGlyphs;i++)this.names[i]=pe[i+e.glyphNameIndex[i]];break;case 3:default:this.names=[]}}he.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),i=this.font.glyphs;if(i)for(var n=0;n<i.length;n+=1)for(var r=i.get(n),o=0;o<r.unicodes.length;o+=1)if(r.unicodes[o]===t)return n;return null},fe.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0},me.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),i=this.encoding[t];return this.charset.indexOf(i)},ge.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},ge.prototype.glyphIndexToName=function(e){return this.names[e]};var ve=function(e,t,i,n,r){e.beginPath(),e.moveTo(t,i),e.lineTo(n,r),e.stroke()};function ye(e){this.bindConstructorValues(e)}function be(e,t,i){Object.defineProperty(e,t,{get:function(){return e.path,e[i]},set:function(t){e[i]=t},enumerable:!0,configurable:!0})}function we(e,t){if(this.font=e,this.glyphs={},Array.isArray(t))for(var i=0;i<t.length;i++)this.glyphs[i]=t[i];this.length=t&&t.length||0}ye.prototype.bindConstructorValues=function(e){var t,i;this.index=e.index||0,this.name=e.name||null,this.unicode=e.unicode||void 0,this.unicodes=e.unicodes||void 0!==e.unicode?[e.unicode]:[],e.xMin&&(this.xMin=e.xMin),e.yMin&&(this.yMin=e.yMin),e.xMax&&(this.xMax=e.xMax),e.yMax&&(this.yMax=e.yMax),e.advanceWidth&&(this.advanceWidth=e.advanceWidth),Object.defineProperty(this,"path",(t=e.path,i=t||new T,{configurable:!0,get:function(){return"function"==typeof i&&(i=i()),i},set:function(e){i=e}}))},ye.prototype.addUnicode=function(e){0===this.unicodes.length&&(this.unicode=e),this.unicodes.push(e)},ye.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},ye.prototype.getPath=function(e,t,i,n,r){var o,a;e=void 0!==e?e:0,t=void 0!==t?t:0,i=void 0!==i?i:72,n||(n={});var s=n.xScale,l=n.yScale;if(n.hinting&&r&&r.hinting&&(a=this.path&&r.hinting.exec(this,i)),a)o=r.hinting.getCommands(a),e=Math.round(e),t=Math.round(t),s=l=1;else{o=this.path.commands;var c=1/this.path.unitsPerEm*i;void 0===s&&(s=c),void 0===l&&(l=c)}for(var d=new T,u=0;u<o.length;u+=1){var p=o[u];"M"===p.type?d.moveTo(e+p.x*s,t+-p.y*l):"L"===p.type?d.lineTo(e+p.x*s,t+-p.y*l):"Q"===p.type?d.quadraticCurveTo(e+p.x1*s,t+-p.y1*l,e+p.x*s,t+-p.y*l):"C"===p.type?d.curveTo(e+p.x1*s,t+-p.y1*l,e+p.x2*s,t+-p.y2*l,e+p.x*s,t+-p.y*l):"Z"===p.type&&d.closePath()}return d},ye.prototype.getContours=function(){if(void 0===this.points)return[];for(var e=[],t=[],i=0;i<this.points.length;i+=1){var n=this.points[i];t.push(n),n.lastPointOfContour&&(e.push(t),t=[])}return A.argument(0===t.length,"There are still points left in the current contour."),e},ye.prototype.getMetrics=function(){for(var e=this.path.commands,t=[],i=[],n=0;n<e.length;n+=1){var r=e[n];"Z"!==r.type&&(t.push(r.x),i.push(r.y)),"Q"!==r.type&&"C"!==r.type||(t.push(r.x1),i.push(r.y1)),"C"===r.type&&(t.push(r.x2),i.push(r.y2))}var o={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,i),xMax:Math.max.apply(null,t),yMax:Math.max.apply(null,i),leftSideBearing:this.leftSideBearing};return isFinite(o.xMin)||(o.xMin=0),isFinite(o.xMax)||(o.xMax=this.advanceWidth),isFinite(o.yMin)||(o.yMin=0),isFinite(o.yMax)||(o.yMax=0),o.rightSideBearing=this.advanceWidth-o.leftSideBearing-(o.xMax-o.xMin),o},ye.prototype.draw=function(e,t,i,n,r){this.getPath(t,i,n,r).draw(e)},ye.prototype.drawPoints=function(e,t,i,n){function r(t,i,n,r){var o=2*Math.PI;e.beginPath();for(var a=0;a<t.length;a+=1)e.moveTo(i+t[a].x*r,n+t[a].y*r),e.arc(i+t[a].x*r,n+t[a].y*r,2,0,o,!1);e.closePath(),e.fill()}t=void 0!==t?t:0,i=void 0!==i?i:0,n=void 0!==n?n:24;for(var o=1/this.path.unitsPerEm*n,a=[],s=[],l=this.path,c=0;c<l.commands.length;c+=1){var d=l.commands[c];void 0!==d.x&&a.push({x:d.x,y:-d.y}),void 0!==d.x1&&s.push({x:d.x1,y:-d.y1}),void 0!==d.x2&&s.push({x:d.x2,y:-d.y2})}e.fillStyle="blue",r(a,t,i,o),e.fillStyle="red",r(s,t,i,o)},ye.prototype.drawMetrics=function(e,t,i,n){var r;t=void 0!==t?t:0,i=void 0!==i?i:0,n=void 0!==n?n:24,r=1/this.path.unitsPerEm*n,e.lineWidth=1,e.strokeStyle="black",ve(e,t,-1e4,t,1e4),ve(e,-1e4,i,1e4,i);var o=this.xMin||0,a=this.yMin||0,s=this.xMax||0,l=this.yMax||0,c=this.advanceWidth||0;e.strokeStyle="blue",ve(e,t+o*r,-1e4,t+o*r,1e4),ve(e,t+s*r,-1e4,t+s*r,1e4),ve(e,-1e4,i+-a*r,1e4,i+-a*r),ve(e,-1e4,i+-l*r,1e4,i+-l*r),e.strokeStyle="green",ve(e,t+c*r,-1e4,t+c*r,1e4)},we.prototype.get=function(e){return"function"==typeof this.glyphs[e]&&(this.glyphs[e]=this.glyphs[e]()),this.glyphs[e]},we.prototype.push=function(e,t){this.glyphs[e]=t,this.length++};var Se={GlyphSet:we,glyphLoader:function(e,t){return new ye({index:t,font:e})},ttfGlyphLoader:function(e,t,i,n,r,o){return function(){var a=new ye({index:t,font:e});return a.path=function(){i(a,n,r);var t=o(e.glyphs,a);return t.unitsPerEm=e.unitsPerEm,t},be(a,"xMin","_xMin"),be(a,"xMax","_xMax"),be(a,"yMin","_yMin"),be(a,"yMax","_yMax"),a}},cffGlyphLoader:function(e,t,i,n){return function(){var r=new ye({index:t,font:e});return r.path=function(){var t=i(e,r,n);return t.unitsPerEm=e.unitsPerEm,t},r}}};function Ce(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i+=1)if(!Ce(e[i],t[i]))return!1;return!0}return!1}function ke(e){return e.length<1240?107:e.length<33900?1131:32768}function xe(e,t,i){var n,r,o=[],a=[],s=ae.getCard16(e,t);if(0!==s){var l=ae.getByte(e,t+2);n=t+(s+1)*l+2;for(var c=t+3,d=0;d<s+1;d+=1)o.push(ae.getOffset(e,c,l)),c+=l;r=n+o[s]}else r=t+2;for(var u=0;u<o.length-1;u+=1){var p=ae.getBytes(e,n+o[u],n+o[u+1]);i&&(p=i(p)),a.push(p)}return{objects:a,startOffset:t,endOffset:r}}function _e(e,t){if(28===t)return e.parseByte()<<8|e.parseByte();if(29===t)return e.parseByte()<<24|e.parseByte()<<16|e.parseByte()<<8|e.parseByte();if(30===t)return function(e){for(var t="",i=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var n=e.parseByte(),r=n>>4,o=15&n;if(15===r)break;if(t+=i[r],15===o)break;t+=i[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Ee(e,t,i){t=void 0!==t?t:0;var n=new ae.Parser(e,t),r=[],o=[];for(i=void 0!==i?i:e.length;n.relativeOffset<i;){var a=n.parseByte();a<=21?(12===a&&(a=1200+n.parseByte()),r.push([a,o]),o=[]):o.push(_e(n,a))}return function(e){for(var t={},i=0;i<e.length;i+=1){var n,r=e[i][0],o=e[i][1];if(n=1===o.length?o[0]:o,t.hasOwnProperty(r)&&!isNaN(t[r]))throw new Error("Object "+t+" already has key "+r);t[r]=n}return t}(r)}function Te(e,t){return t<=390?ce[t]:e[t-391]}function Pe(e,t,i){for(var n,r={},o=0;o<t.length;o+=1){var a=t[o];if(Array.isArray(a.type)){var s=[];s.length=a.type.length;for(var l=0;l<a.type.length;l++)void 0===(n=void 0!==e[a.op]?e[a.op][l]:void 0)&&(n=void 0!==a.value&&void 0!==a.value[l]?a.value[l]:null),"SID"===a.type[l]&&(n=Te(i,n)),s[l]=n;r[a.name]=s}else void 0===(n=e[a.op])&&(n=void 0!==a.value?a.value:null),"SID"===a.type&&(n=Te(i,n)),r[a.name]=n}return r}var Ie=[{name:"version",op:0,type:"SID"},{name:"notice",op:1,type:"SID"},{name:"copyright",op:1200,type:"SID"},{name:"fullName",op:2,type:"SID"},{name:"familyName",op:3,type:"SID"},{name:"weight",op:4,type:"SID"},{name:"isFixedPitch",op:1201,type:"number",value:0},{name:"italicAngle",op:1202,type:"number",value:0},{name:"underlinePosition",op:1203,type:"number",value:-100},{name:"underlineThickness",op:1204,type:"number",value:50},{name:"paintType",op:1205,type:"number",value:0},{name:"charstringType",op:1206,type:"number",value:2},{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"uniqueId",op:13,type:"number"},{name:"fontBBox",op:5,type:["number","number","number","number"],value:[0,0,0,0]},{name:"strokeWidth",op:1208,type:"number",value:0},{name:"xuid",op:14,type:[],value:null},{name:"charset",op:15,type:"offset",value:0},{name:"encoding",op:16,type:"offset",value:0},{name:"charStrings",op:17,type:"offset",value:0},{name:"private",op:18,type:["number","offset"],value:[0,0]},{name:"ros",op:1230,type:["SID","SID","number"]},{name:"cidFontVersion",op:1231,type:"number",value:0},{name:"cidFontRevision",op:1232,type:"number",value:0},{name:"cidFontType",op:1233,type:"number",value:0},{name:"cidCount",op:1234,type:"number",value:8720},{name:"uidBase",op:1235,type:"number"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"fontName",op:1238,type:"SID"}],Ae=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}];function Re(e,t,i,n){return Pe(Ee(e,t,i),Ae,n)}function Oe(e,t,i,n){for(var r,o,a=[],s=0;s<i.length;s+=1){var l=(o=n,Pe(Ee(r=new DataView(new Uint8Array(i[s]).buffer),0,r.byteLength),Ie,o));l._subrs=[],l._subrsBias=0;var c=l.private[0],d=l.private[1];if(0!==c&&0!==d){var u=Re(e,d+t,c,n);if(l._defaultWidthX=u.defaultWidthX,l._nominalWidthX=u.nominalWidthX,0!==u.subrs){var p=xe(e,d+u.subrs+t);l._subrs=p.objects,l._subrsBias=ke(l._subrs)}l._privateDict=u}a.push(l)}return a}function Ne(e,t,i){var n,r,o,a,s,l,c,d,u=new T,p=[],h=0,f=!1,m=!1,g=0,v=0;if(e.isCIDFont){var y=e.tables.cff.topDict._fdSelect[t.index],b=e.tables.cff.topDict._fdArray[y];s=b._subrs,l=b._subrsBias,c=b._defaultWidthX,d=b._nominalWidthX}else s=e.tables.cff.topDict._subrs,l=e.tables.cff.topDict._subrsBias,c=e.tables.cff.topDict._defaultWidthX,d=e.tables.cff.topDict._nominalWidthX;var w=c;function S(e,t){m&&u.closePath(),u.moveTo(e,t),m=!0}function C(){p.length%2!=0&&!f&&(w=p.shift()+d),h+=p.length>>1,p.length=0,f=!0}return function i(c){for(var y,b,k,x,_,E,T,P,I,A,R,O,N=0;N<c.length;){var D=c[N];switch(N+=1,D){case 1:case 3:C();break;case 4:1<p.length&&!f&&(w=p.shift()+d,f=!0),v+=p.pop(),S(g,v);break;case 5:for(;0<p.length;)g+=p.shift(),v+=p.shift(),u.lineTo(g,v);break;case 6:for(;0<p.length&&(g+=p.shift(),u.lineTo(g,v),0!==p.length);)v+=p.shift(),u.lineTo(g,v);break;case 7:for(;0<p.length&&(v+=p.shift(),u.lineTo(g,v),0!==p.length);)g+=p.shift(),u.lineTo(g,v);break;case 8:for(;0<p.length;)n=g+p.shift(),r=v+p.shift(),o=n+p.shift(),a=r+p.shift(),g=o+p.shift(),v=a+p.shift(),u.curveTo(n,r,o,a,g,v);break;case 10:_=p.pop()+l,(E=s[_])&&i(E);break;case 11:return;case 12:switch(D=c[N],N+=1,D){case 35:n=g+p.shift(),r=v+p.shift(),o=n+p.shift(),a=r+p.shift(),T=o+p.shift(),P=a+p.shift(),I=T+p.shift(),A=P+p.shift(),R=I+p.shift(),O=A+p.shift(),g=R+p.shift(),v=O+p.shift(),p.shift(),u.curveTo(n,r,o,a,T,P),u.curveTo(I,A,R,O,g,v);break;case 34:n=g+p.shift(),r=v,o=n+p.shift(),a=r+p.shift(),T=o+p.shift(),P=a,I=T+p.shift(),A=a,R=I+p.shift(),O=v,g=R+p.shift(),u.curveTo(n,r,o,a,T,P),u.curveTo(I,A,R,O,g,v);break;case 36:n=g+p.shift(),r=v+p.shift(),o=n+p.shift(),a=r+p.shift(),T=o+p.shift(),P=a,I=T+p.shift(),A=a,R=I+p.shift(),O=A+p.shift(),g=R+p.shift(),u.curveTo(n,r,o,a,T,P),u.curveTo(I,A,R,O,g,v);break;case 37:n=g+p.shift(),r=v+p.shift(),o=n+p.shift(),a=r+p.shift(),T=o+p.shift(),P=a+p.shift(),I=T+p.shift(),A=P+p.shift(),R=I+p.shift(),O=A+p.shift(),Math.abs(R-g)>Math.abs(O-v)?g=R+p.shift():v=O+p.shift(),u.curveTo(n,r,o,a,T,P),u.curveTo(I,A,R,O,g,v);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+D),p.length=0}break;case 14:0<p.length&&!f&&(w=p.shift()+d,f=!0),m&&(u.closePath(),m=!1);break;case 18:C();break;case 19:case 20:C(),N+=h+7>>3;break;case 21:2<p.length&&!f&&(w=p.shift()+d,f=!0),v+=p.pop(),S(g+=p.pop(),v);break;case 22:1<p.length&&!f&&(w=p.shift()+d,f=!0),S(g+=p.pop(),v);break;case 23:C();break;case 24:for(;2<p.length;)n=g+p.shift(),r=v+p.shift(),o=n+p.shift(),a=r+p.shift(),g=o+p.shift(),v=a+p.shift(),u.curveTo(n,r,o,a,g,v);g+=p.shift(),v+=p.shift(),u.lineTo(g,v);break;case 25:for(;6<p.length;)g+=p.shift(),v+=p.shift(),u.lineTo(g,v);n=g+p.shift(),r=v+p.shift(),o=n+p.shift(),a=r+p.shift(),g=o+p.shift(),v=a+p.shift(),u.curveTo(n,r,o,a,g,v);break;case 26:for(p.length%2&&(g+=p.shift());0<p.length;)n=g,r=v+p.shift(),o=n+p.shift(),a=r+p.shift(),g=o,v=a+p.shift(),u.curveTo(n,r,o,a,g,v);break;case 27:for(p.length%2&&(v+=p.shift());0<p.length;)n=g+p.shift(),r=v,o=n+p.shift(),a=r+p.shift(),g=o+p.shift(),v=a,u.curveTo(n,r,o,a,g,v);break;case 28:y=c[N],b=c[N+1],p.push((y<<24|b<<16)>>16),N+=2;break;case 29:_=p.pop()+e.gsubrsBias,(E=e.gsubrs[_])&&i(E);break;case 30:for(;0<p.length&&(n=g,r=v+p.shift(),o=n+p.shift(),a=r+p.shift(),g=o+p.shift(),v=a+(1===p.length?p.shift():0),u.curveTo(n,r,o,a,g,v),0!==p.length);)n=g+p.shift(),r=v,o=n+p.shift(),a=r+p.shift(),v=a+p.shift(),g=o+(1===p.length?p.shift():0),u.curveTo(n,r,o,a,g,v);break;case 31:for(;0<p.length&&(n=g+p.shift(),r=v,o=n+p.shift(),a=r+p.shift(),v=a+p.shift(),g=o+(1===p.length?p.shift():0),u.curveTo(n,r,o,a,g,v),0!==p.length);)n=g,r=v+p.shift(),o=n+p.shift(),a=r+p.shift(),g=o+p.shift(),v=a+(1===p.length?p.shift():0),u.curveTo(n,r,o,a,g,v);break;default:D<32?console.log("Glyph "+t.index+": unknown operator "+D):D<247?p.push(D-139):D<251?(y=c[N],N+=1,p.push(256*(D-247)+y+108)):D<255?(y=c[N],N+=1,p.push(256*-(D-251)-y-108)):(y=c[N],b=c[N+1],k=c[N+2],x=c[N+3],N+=4,p.push((y<<24|b<<16|k<<8|x)/65536))}}}(i),t.advanceWidth=w,u}function De(e,t){var i,n=ce.indexOf(e);return 0<=n&&(i=n),0<=(n=t.indexOf(e))?i=n+ce.length:(i=ce.length+t.length,t.push(e)),i}function Le(e,t,i){for(var n={},r=0;r<e.length;r+=1){var o=e[r],a=t[o.name];void 0===a||Ce(a,o.value)||("SID"===o.type&&(a=De(a,i)),n[o.op]={name:o.name,type:o.type,value:a})}return n}function Me(e,t){var i=new Q.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return i.dict=Le(Ie,e,t),i}function Be(e){var t=new Q.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return t.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],t}function Fe(e){var t=[],i=e.path;t.push({name:"width",type:"NUMBER",value:e.advanceWidth});for(var n=0,r=0,o=0;o<i.commands.length;o+=1){var a=void 0,s=void 0,l=i.commands[o];if("Q"===l.type&&(l={type:"C",x:l.x,y:l.y,x1:1/3*n+2/3*l.x1,y1:1/3*r+2/3*l.y1,x2:1/3*l.x+2/3*l.x1,y2:1/3*l.y+2/3*l.y1}),"M"===l.type)a=Math.round(l.x-n),s=Math.round(l.y-r),t.push({name:"dx",type:"NUMBER",value:a}),t.push({name:"dy",type:"NUMBER",value:s}),t.push({name:"rmoveto",type:"OP",value:21}),n=Math.round(l.x),r=Math.round(l.y);else if("L"===l.type)a=Math.round(l.x-n),s=Math.round(l.y-r),t.push({name:"dx",type:"NUMBER",value:a}),t.push({name:"dy",type:"NUMBER",value:s}),t.push({name:"rlineto",type:"OP",value:5}),n=Math.round(l.x),r=Math.round(l.y);else if("C"===l.type){var c=Math.round(l.x1-n),d=Math.round(l.y1-r),u=Math.round(l.x2-l.x1),p=Math.round(l.y2-l.y1);a=Math.round(l.x-l.x2),s=Math.round(l.y-l.y2),t.push({name:"dx1",type:"NUMBER",value:c}),t.push({name:"dy1",type:"NUMBER",value:d}),t.push({name:"dx2",type:"NUMBER",value:u}),t.push({name:"dy2",type:"NUMBER",value:p}),t.push({name:"dx",type:"NUMBER",value:a}),t.push({name:"dy",type:"NUMBER",value:s}),t.push({name:"rrcurveto",type:"OP",value:8}),n=Math.round(l.x),r=Math.round(l.y)}}return t.push({name:"endchar",type:"OP",value:14}),t}var Ve=function(e,t,i){i.tables.cff={};var n,r,o,a=xe(e,xe(e,(n=e,r=t,(o={}).formatMajor=ae.getCard8(n,r),o.formatMinor=ae.getCard8(n,r+1),o.size=ae.getCard8(n,r+2),o.offsetSize=ae.getCard8(n,r+3),o.startOffset=r,o.endOffset=r+4,o).endOffset,ae.bytesToString).endOffset),s=xe(e,a.endOffset,ae.bytesToString),l=xe(e,s.endOffset);i.gsubrs=l.objects,i.gsubrsBias=ke(i.gsubrs);var c=Oe(e,t,a.objects,s.objects);if(1!==c.length)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+c.length);var d=c[0];if((i.tables.cff.topDict=d)._privateDict&&(i.defaultWidthX=d._privateDict.defaultWidthX,i.nominalWidthX=d._privateDict.nominalWidthX),void 0!==d.ros[0]&&void 0!==d.ros[1]&&(i.isCIDFont=!0),i.isCIDFont){var u=d.fdArray,p=d.fdSelect;if(0===u||0===p)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");var h=Oe(e,t,xe(e,u+=t).objects,s.objects);d._fdArray=h,p+=t,d._fdSelect=function(e,t,i,n){var r,o=[],a=new ae.Parser(e,t),s=a.parseCard8();if(0===s)for(var l=0;l<i;l++){if(n<=(r=a.parseCard8()))throw new Error("CFF table CID Font FDSelect has bad FD index value "+r+" (FD count "+n+")");o.push(r)}else{if(3!==s)throw new Error("CFF Table CID Font FDSelect table has unsupported format "+s);var c,d=a.parseCard16(),u=a.parseCard16();if(0!==u)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+u);for(var p=0;p<d;p++){if(r=a.parseCard8(),c=a.parseCard16(),n<=r)throw new Error("CFF table CID Font FDSelect has bad FD index value "+r+" (FD count "+n+")");if(i<c)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+c);for(;u<c;u++)o.push(r);u=c}if(c!==i)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+c)}return o}(e,p,i.numGlyphs,h.length)}var f=t+d.private[1],m=Re(e,f,d.private[0],s.objects);if(i.defaultWidthX=m.defaultWidthX,i.nominalWidthX=m.nominalWidthX,0!==m.subrs){var g=xe(e,f+m.subrs);i.subrs=g.objects,i.subrsBias=ke(i.subrs)}else i.subrs=[],i.subrsBias=0;var v=xe(e,t+d.charStrings);i.nGlyphs=v.objects.length;var y=function(e,t,i,n){var r,o,a=new ae.Parser(e,t);i-=1;var s=[".notdef"],l=a.parseCard8();if(0===l)for(var c=0;c<i;c+=1)r=a.parseSID(),s.push(Te(n,r));else if(1===l)for(;s.length<=i;){r=a.parseSID(),o=a.parseCard8();for(var d=0;d<=o;d+=1)s.push(Te(n,r)),r+=1}else{if(2!==l)throw new Error("Unknown charset format "+l);for(;s.length<=i;){r=a.parseSID(),o=a.parseCard16();for(var u=0;u<=o;u+=1)s.push(Te(n,r)),r+=1}}return s}(e,t+d.charset,i.nGlyphs,s.objects);0===d.encoding?i.cffEncoding=new me(de,y):1===d.encoding?i.cffEncoding=new me(ue,y):i.cffEncoding=function(e,t,i){var n,r={},o=new ae.Parser(e,t),a=o.parseCard8();if(0===a)for(var s=o.parseCard8(),l=0;l<s;l+=1)r[n=o.parseCard8()]=l;else{if(1!==a)throw new Error("Unknown encoding format "+a);var c=o.parseCard8();n=1;for(var d=0;d<c;d+=1)for(var u=o.parseCard8(),p=o.parseCard8(),h=u;h<=u+p;h+=1)r[h]=n,n+=1}return new me(r,i)}(e,t+d.encoding,y),i.encoding=i.encoding||i.cffEncoding,i.glyphs=new Se.GlyphSet(i);for(var b=0;b<i.nGlyphs;b+=1){var w=v.objects[b];i.glyphs.push(b,Se.cffGlyphLoader(i,b,Ne,w))}},Ue=function(e,t){for(var i,n=new Q.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),r=1/t.unitsPerEm,o={version:t.version,fullName:t.fullName,familyName:t.familyName,weight:t.weightName,fontBBox:t.fontBBox||[0,0,0,0],fontMatrix:[r,0,0,r,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},a=[],s=1;s<e.length;s+=1)i=e.get(s),a.push(i.name);var l=[];n.header=new Q.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}]),n.nameIndex=function(e){var t=new Q.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);t.names=[];for(var i=0;i<e.length;i+=1)t.names.push({name:"name_"+i,type:"NAME",value:e[i]});return t}([t.postScriptName]);var c,d,u,p=Me(o,l);n.topDictIndex=Be(p),n.globalSubrIndex=new Q.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}]),n.charsets=function(e,t){for(var i=new Q.Record("Charsets",[{name:"format",type:"Card8",value:0}]),n=0;n<e.length;n+=1){var r=De(e[n],t);i.fields.push({name:"glyph_"+n,type:"SID",value:r})}return i}(a,l),n.charStringsIndex=function(e){for(var t=new Q.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),i=0;i<e.length;i+=1){var n=e.get(i),r=Fe(n);t.charStrings.push({name:n.name,type:"CHARSTRING",value:r})}return t}(e),n.privateDict=(c={},d=l,(u=new Q.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}])).dict=Le(Ae,c,d),u),n.stringIndex=function(e){var t=new Q.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);t.strings=[];for(var i=0;i<e.length;i+=1)t.strings.push({name:"string_"+i,type:"STRING",value:e[i]});return t}(l);var h=n.header.sizeOf()+n.nameIndex.sizeOf()+n.topDictIndex.sizeOf()+n.stringIndex.sizeOf()+n.globalSubrIndex.sizeOf();return o.charset=h,o.encoding=0,o.charStrings=o.charset+n.charsets.sizeOf(),o.private[1]=o.charStrings+n.charStringsIndex.sizeOf(),p=Me(o,l),n.topDictIndex=Be(p),n},ze=function(e,t){var i={},n=new ae.Parser(e,t);return i.version=n.parseVersion(),i.fontRevision=Math.round(1e3*n.parseFixed())/1e3,i.checkSumAdjustment=n.parseULong(),i.magicNumber=n.parseULong(),A.argument(1594834165===i.magicNumber,"Font header has wrong magic number."),i.flags=n.parseUShort(),i.unitsPerEm=n.parseUShort(),i.created=n.parseLongDateTime(),i.modified=n.parseLongDateTime(),i.xMin=n.parseShort(),i.yMin=n.parseShort(),i.xMax=n.parseShort(),i.yMax=n.parseShort(),i.macStyle=n.parseUShort(),i.lowestRecPPEM=n.parseUShort(),i.fontDirectionHint=n.parseShort(),i.indexToLocFormat=n.parseShort(),i.glyphDataFormat=n.parseShort(),i},He=function(e){var t=Math.round((new Date).getTime()/1e3)+2082844800,i=t;return e.createdTimestamp&&(i=e.createdTimestamp+2082844800),new Q.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:i},{name:"modified",type:"LONGDATETIME",value:t},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],e)},je=function(e,t){var i={},n=new ae.Parser(e,t);return i.version=n.parseVersion(),i.ascender=n.parseShort(),i.descender=n.parseShort(),i.lineGap=n.parseShort(),i.advanceWidthMax=n.parseUShort(),i.minLeftSideBearing=n.parseShort(),i.minRightSideBearing=n.parseShort(),i.xMaxExtent=n.parseShort(),i.caretSlopeRise=n.parseShort(),i.caretSlopeRun=n.parseShort(),i.caretOffset=n.parseShort(),n.relativeOffset+=8,i.metricDataFormat=n.parseShort(),i.numberOfHMetrics=n.parseUShort(),i},qe=function(e){return new Q.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],e)},$e=function(e,t,i,n,r){for(var o,a,s=new ae.Parser(e,t),l=0;l<n;l+=1){l<i&&(o=s.parseUShort(),a=s.parseShort());var c=r.get(l);c.advanceWidth=o,c.leftSideBearing=a}},We=function(e){for(var t=new Q.Table("hmtx",[]),i=0;i<e.length;i+=1){var n=e.get(i),r=n.advanceWidth||0,o=n.leftSideBearing||0;t.fields.push({name:"advanceWidth_"+i,type:"USHORT",value:r}),t.fields.push({name:"leftSideBearing_"+i,type:"SHORT",value:o})}return t},Ge=function(e){for(var t=new Q.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:e.length}]),i="",n=12+4*e.length,r=0;r<e.length;++r){var o=i.indexOf(e[r]);o<0&&(o=i.length,i+=e[r]),t.fields.push({name:"offset "+r,type:"USHORT",value:n+o}),t.fields.push({name:"length "+r,type:"USHORT",value:e[r].length})}return t.fields.push({name:"stringPool",type:"CHARARRAY",value:i}),t},Ke=function(e,t){var i=new ae.Parser(e,t),n=i.parseULong();A.argument(1===n,"Unsupported ltag table version."),i.skip("uLong",1);for(var r=i.parseULong(),o=[],a=0;a<r;a++){for(var s="",l=t+i.parseUShort(),c=i.parseUShort(),d=l;d<l+c;++d)s+=String.fromCharCode(e.getInt8(d));o.push(s)}return o},Ye=function(e,t){var i={},n=new ae.Parser(e,t);return i.version=n.parseVersion(),i.numGlyphs=n.parseUShort(),1===i.version&&(i.maxPoints=n.parseUShort(),i.maxContours=n.parseUShort(),i.maxCompositePoints=n.parseUShort(),i.maxCompositeContours=n.parseUShort(),i.maxZones=n.parseUShort(),i.maxTwilightPoints=n.parseUShort(),i.maxStorage=n.parseUShort(),i.maxFunctionDefs=n.parseUShort(),i.maxInstructionDefs=n.parseUShort(),i.maxStackElements=n.parseUShort(),i.maxSizeOfInstructions=n.parseUShort(),i.maxComponentElements=n.parseUShort(),i.maxComponentDepth=n.parseUShort()),i},Je=function(e){return new Q.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])},Xe=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],Qe={0:"en",1:"fr",2:"de",3:"it",4:"nl",5:"sv",6:"es",7:"da",8:"pt",9:"no",10:"he",11:"ja",12:"ar",13:"fi",14:"el",15:"is",16:"mt",17:"tr",18:"hr",19:"zh-Hant",20:"ur",21:"hi",22:"th",23:"ko",24:"lt",25:"pl",26:"hu",27:"es",28:"lv",29:"se",30:"fo",31:"fa",32:"ru",33:"zh",34:"nl-BE",35:"ga",36:"sq",37:"ro",38:"cz",39:"sk",40:"si",41:"yi",42:"sr",43:"mk",44:"bg",45:"uk",46:"be",47:"uz",48:"kk",49:"az-Cyrl",50:"az-Arab",51:"hy",52:"ka",53:"mo",54:"ky",55:"tg",56:"tk",57:"mn-CN",58:"mn",59:"ps",60:"ks",61:"ku",62:"sd",63:"bo",64:"ne",65:"sa",66:"mr",67:"bn",68:"as",69:"gu",70:"pa",71:"or",72:"ml",73:"kn",74:"ta",75:"te",76:"si",77:"my",78:"km",79:"lo",80:"vi",81:"id",82:"tl",83:"ms",84:"ms-Arab",85:"am",86:"ti",87:"om",88:"so",89:"sw",90:"rw",91:"rn",92:"ny",93:"mg",94:"eo",128:"cy",129:"eu",130:"ca",131:"la",132:"qu",133:"gn",134:"ay",135:"tt",136:"ug",137:"dz",138:"jv",139:"su",140:"gl",141:"af",142:"br",143:"iu",144:"gd",145:"gv",146:"ga",147:"to",148:"el-polyton",149:"kl",150:"az",151:"nn"},Ze={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},et={1078:"af",1052:"sq",1156:"gsw",1118:"am",5121:"ar-DZ",15361:"ar-BH",3073:"ar",2049:"ar-IQ",11265:"ar-JO",13313:"ar-KW",12289:"ar-LB",4097:"ar-LY",6145:"ary",8193:"ar-OM",16385:"ar-QA",1025:"ar-SA",10241:"ar-SY",7169:"aeb",14337:"ar-AE",9217:"ar-YE",1067:"hy",1101:"as",2092:"az-Cyrl",1068:"az",1133:"ba",1069:"eu",1059:"be",2117:"bn",1093:"bn-IN",8218:"bs-Cyrl",5146:"bs",1150:"br",1026:"bg",1027:"ca",3076:"zh-HK",5124:"zh-MO",2052:"zh",4100:"zh-SG",1028:"zh-TW",1155:"co",1050:"hr",4122:"hr-BA",1029:"cs",1030:"da",1164:"prs",1125:"dv",2067:"nl-BE",1043:"nl",3081:"en-AU",10249:"en-BZ",4105:"en-CA",9225:"en-029",16393:"en-IN",6153:"en-IE",8201:"en-JM",17417:"en-MY",5129:"en-NZ",13321:"en-PH",18441:"en-SG",7177:"en-ZA",11273:"en-TT",2057:"en-GB",1033:"en",12297:"en-ZW",1061:"et",1080:"fo",1124:"fil",1035:"fi",2060:"fr-BE",3084:"fr-CA",1036:"fr",5132:"fr-LU",6156:"fr-MC",4108:"fr-CH",1122:"fy",1110:"gl",1079:"ka",3079:"de-AT",1031:"de",5127:"de-LI",4103:"de-LU",2055:"de-CH",1032:"el",1135:"kl",1095:"gu",1128:"ha",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig",1057:"id",1117:"iu",2141:"iu-Latn",2108:"ga",1076:"xh",1077:"zu",1040:"it",2064:"it-CH",1041:"ja",1099:"kn",1087:"kk",1107:"km",1158:"quc",1159:"rw",1089:"sw",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1062:"lv",1063:"lt",2094:"dsb",1134:"lb",1071:"mk",2110:"ms-BN",1086:"ms",1100:"ml",1082:"mt",1153:"mi",1146:"arn",1102:"mr",1148:"moh",1104:"mn",2128:"mn-CN",1121:"ne",1044:"nb",2068:"nn",1154:"oc",1096:"or",1123:"ps",1045:"pl",1046:"pt",2070:"pt-PT",1094:"pa",1131:"qu-BO",2155:"qu-EC",3179:"qu",1048:"ro",1047:"rm",1049:"ru",9275:"smn",4155:"smj-NO",5179:"smj",3131:"se-FI",1083:"se",2107:"se-SE",8251:"sms",6203:"sma-NO",7227:"sms",1103:"sa",7194:"sr-Cyrl-BA",3098:"sr",6170:"sr-Latn-BA",2074:"sr-Latn",1132:"nso",1074:"tn",1115:"si",1051:"sk",1060:"sl",11274:"es-AR",16394:"es-BO",13322:"es-CL",9226:"es-CO",5130:"es-CR",7178:"es-DO",12298:"es-EC",17418:"es-SV",4106:"es-GT",18442:"es-HN",2058:"es-MX",19466:"es-NI",6154:"es-PA",15370:"es-PY",10250:"es-PE",20490:"es-PR",3082:"es",1034:"es",21514:"es-US",14346:"es-UY",8202:"es-VE",2077:"sv-FI",1053:"sv",1114:"syr",1064:"tg",2143:"tzm",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1055:"tr",1090:"tk",1152:"ug",1058:"uk",1070:"hsb",1056:"ur",2115:"uz-Cyrl",1091:"uz",1066:"vi",1106:"cy",1160:"wo",1157:"sah",1144:"ii",1130:"yo"};function tt(e,t,i){switch(e){case 0:if(65535===t)return"und";if(i)return i[t];break;case 1:return Qe[t];case 3:return et[t]}}var it="utf-16",nt={0:"macintosh",1:"x-mac-japanese",2:"x-mac-chinesetrad",3:"x-mac-korean",6:"x-mac-greek",7:"x-mac-cyrillic",9:"x-mac-devanagai",10:"x-mac-gurmukhi",11:"x-mac-gujarati",12:"x-mac-oriya",13:"x-mac-bengali",14:"x-mac-tamil",15:"x-mac-telugu",16:"x-mac-kannada",17:"x-mac-malayalam",18:"x-mac-sinhalese",19:"x-mac-burmese",20:"x-mac-khmer",21:"x-mac-thai",22:"x-mac-lao",23:"x-mac-georgian",24:"x-mac-armenian",25:"x-mac-chinesesimp",26:"x-mac-tibetan",27:"x-mac-mongolian",28:"x-mac-ethiopic",29:"x-mac-ce",30:"x-mac-vietnamese",31:"x-mac-extarabic"},rt={15:"x-mac-icelandic",17:"x-mac-turkish",18:"x-mac-croatian",24:"x-mac-ce",25:"x-mac-ce",26:"x-mac-ce",27:"x-mac-ce",28:"x-mac-ce",30:"x-mac-icelandic",37:"x-mac-romanian",38:"x-mac-ce",39:"x-mac-ce",40:"x-mac-ce",143:"x-mac-inuit",146:"x-mac-gaelic"};function ot(e,t,i){switch(e){case 0:return it;case 1:return rt[i]||nt[t];case 3:if(1===t||10===t)return it}}function at(e){var t={};for(var i in e)t[e[i]]=parseInt(i);return t}function st(e,t,i,n,r,o){return new Q.Record("NameRecord",[{name:"platformID",type:"USHORT",value:e},{name:"encodingID",type:"USHORT",value:t},{name:"languageID",type:"USHORT",value:i},{name:"nameID",type:"USHORT",value:n},{name:"length",type:"USHORT",value:r},{name:"offset",type:"USHORT",value:o}])}function lt(e,t){var i=function(e,t){var i=e.length,n=t.length-i+1;e:for(var r=0;r<n;r++)for(;r<n;r++){for(var o=0;o<i;o++)if(t[r+o]!==e[o])continue e;return r}return-1}(e,t);if(i<0){i=t.length;for(var n=0,r=e.length;n<r;++n)t.push(e[n])}return i}var ct=function(e,t,i){for(var n={},r=new ae.Parser(e,t),o=r.parseUShort(),a=r.parseUShort(),s=r.offset+r.parseUShort(),l=0;l<a;l++){var c,d=r.parseUShort(),u=r.parseUShort(),p=r.parseUShort(),h=r.parseUShort(),f=Xe[h]||h,m=r.parseUShort(),g=r.parseUShort(),v=tt(d,p,i),y=ot(d,u,p);if(void 0!==y&&void 0!==v)if(c=y===it?O.UTF16(e,s+g,m):O.MACSTRING(e,s+g,m,y)){var b=n[f];void 0===b&&(b=n[f]={}),b[v]=c}}return 1===o&&r.parseUShort(),n},dt=function(e,t){var i,n=[],r={},o=at(Xe);for(var a in e){var s=o[a];if(void 0===s&&(s=a),i=parseInt(s),isNaN(i))throw new Error('Name table entry "'+a+'" does not exist, see nameTableNames for complete list.');r[i]=e[a],n.push(i)}for(var l=at(Qe),c=at(et),d=[],u=[],p=0;p<n.length;p++){var h=r[i=n[p]];for(var f in h){var m=h[f],g=1,v=l[f],y=Ze[v],b=ot(g,y,v),w=N.MACSTRING(m,b);void 0===w&&(g=0,(v=t.indexOf(f))<0&&(v=t.length,t.push(f)),y=4,w=N.UTF16(m));var S=lt(w,u);d.push(st(g,y,v,i,w.length,S));var C=c[f];if(void 0!==C){var k=N.UTF16(m),x=lt(k,u);d.push(st(3,1,C,i,k.length,x))}}}d.sort((function(e,t){return e.platformID-t.platformID||e.encodingID-t.encodingID||e.languageID-t.languageID||e.nameID-t.nameID}));for(var _=new Q.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:d.length},{name:"stringOffset",type:"USHORT",value:6+12*d.length}]),E=0;E<d.length;E++)_.fields.push({name:"record_"+E,type:"RECORD",value:d[E]});return _.fields.push({name:"strings",type:"LITERAL",value:u}),_},ut=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}],pt=function(e,t){var i={},n=new ae.Parser(e,t);i.version=n.parseUShort(),i.xAvgCharWidth=n.parseShort(),i.usWeightClass=n.parseUShort(),i.usWidthClass=n.parseUShort(),i.fsType=n.parseUShort(),i.ySubscriptXSize=n.parseShort(),i.ySubscriptYSize=n.parseShort(),i.ySubscriptXOffset=n.parseShort(),i.ySubscriptYOffset=n.parseShort(),i.ySuperscriptXSize=n.parseShort(),i.ySuperscriptYSize=n.parseShort(),i.ySuperscriptXOffset=n.parseShort(),i.ySuperscriptYOffset=n.parseShort(),i.yStrikeoutSize=n.parseShort(),i.yStrikeoutPosition=n.parseShort(),i.sFamilyClass=n.parseShort(),i.panose=[];for(var r=0;r<10;r++)i.panose[r]=n.parseByte();return i.ulUnicodeRange1=n.parseULong(),i.ulUnicodeRange2=n.parseULong(),i.ulUnicodeRange3=n.parseULong(),i.ulUnicodeRange4=n.parseULong(),i.achVendID=String.fromCharCode(n.parseByte(),n.parseByte(),n.parseByte(),n.parseByte()),i.fsSelection=n.parseUShort(),i.usFirstCharIndex=n.parseUShort(),i.usLastCharIndex=n.parseUShort(),i.sTypoAscender=n.parseShort(),i.sTypoDescender=n.parseShort(),i.sTypoLineGap=n.parseShort(),i.usWinAscent=n.parseUShort(),i.usWinDescent=n.parseUShort(),1<=i.version&&(i.ulCodePageRange1=n.parseULong(),i.ulCodePageRange2=n.parseULong()),2<=i.version&&(i.sxHeight=n.parseShort(),i.sCapHeight=n.parseShort(),i.usDefaultChar=n.parseUShort(),i.usBreakChar=n.parseUShort(),i.usMaxContent=n.parseUShort()),i},ht=function(e){return new Q.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],e)},ft=function(e){for(var t=0;t<ut.length;t+=1){var i=ut[t];if(e>=i.begin&&e<i.end)return t}return-1},mt=function(e,t){var i={},n=new ae.Parser(e,t);switch(i.version=n.parseVersion(),i.italicAngle=n.parseFixed(),i.underlinePosition=n.parseShort(),i.underlineThickness=n.parseShort(),i.isFixedPitch=n.parseULong(),i.minMemType42=n.parseULong(),i.maxMemType42=n.parseULong(),i.minMemType1=n.parseULong(),i.maxMemType1=n.parseULong(),i.version){case 1:i.names=pe.slice();break;case 2:i.numberOfGlyphs=n.parseUShort(),i.glyphNameIndex=new Array(i.numberOfGlyphs);for(var r=0;r<i.numberOfGlyphs;r++)i.glyphNameIndex[r]=n.parseUShort();i.names=[];for(var o=0;o<i.numberOfGlyphs;o++)if(i.glyphNameIndex[o]>=pe.length){var a=n.parseChar();i.names.push(n.parseString(a))}break;case 2.5:i.numberOfGlyphs=n.parseUShort(),i.offset=new Array(i.numberOfGlyphs);for(var s=0;s<i.numberOfGlyphs;s++)i.offset[s]=n.parseChar()}return i},gt=function(){return new Q.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])},vt=new Array(9);vt[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(re.coverage),deltaGlyphId:this.parseUShort()}:2===t?{substFormat:2,coverage:this.parsePointer(re.coverage),substitute:this.parseOffset16List()}:void A.assert(!1,"0x"+e.toString(16)+": lookup type 1 format must be 1 or 2.")},vt[2]=function(){var e=this.parseUShort();return A.argument(1===e,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(re.coverage),sequences:this.parseListOfLists()}},vt[3]=function(){var e=this.parseUShort();return A.argument(1===e,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(re.coverage),alternateSets:this.parseListOfLists()}},vt[4]=function(){var e=this.parseUShort();return A.argument(1===e,"GSUB ligature table identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(re.coverage),ligatureSets:this.parseListOfLists((function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}}))}};var yt={sequenceIndex:re.uShort,lookupListIndex:re.uShort};vt[5]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(1===t)return{substFormat:t,coverage:this.parsePointer(re.coverage),ruleSets:this.parseListOfLists((function(){var e=this.parseUShort(),t=this.parseUShort();return{input:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,yt)}}))};if(2===t)return{substFormat:t,coverage:this.parsePointer(re.coverage),classDef:this.parsePointer(re.classDef),classSets:this.parseListOfLists((function(){var e=this.parseUShort(),t=this.parseUShort();return{classes:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,yt)}}))};if(3===t){var i=this.parseUShort(),n=this.parseUShort();return{substFormat:t,coverages:this.parseList(i,re.pointer(re.coverage)),lookupRecords:this.parseRecordList(n,yt)}}A.assert(!1,"0x"+e.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},vt[6]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(re.coverage),chainRuleSets:this.parseListOfLists((function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(yt)}}))}:2===t?{substFormat:2,coverage:this.parsePointer(re.coverage),backtrackClassDef:this.parsePointer(re.classDef),inputClassDef:this.parsePointer(re.classDef),lookaheadClassDef:this.parsePointer(re.classDef),chainClassSet:this.parseListOfLists((function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(yt)}}))}:3===t?{substFormat:3,backtrackCoverage:this.parseList(re.pointer(re.coverage)),inputCoverage:this.parseList(re.pointer(re.coverage)),lookaheadCoverage:this.parseList(re.pointer(re.coverage)),lookupRecords:this.parseRecordList(yt)}:void A.assert(!1,"0x"+e.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},vt[7]=function(){var e=this.parseUShort();A.argument(1===e,"GSUB Extension Substitution subtable identifier-format must be 1");var t=this.parseUShort(),i=new re(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:vt[t].call(i)}},vt[8]=function(){var e=this.parseUShort();return A.argument(1===e,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(re.coverage),backtrackCoverage:this.parseList(re.pointer(re.coverage)),lookaheadCoverage:this.parseList(re.pointer(re.coverage)),substitutes:this.parseUShortList()}};var bt=new Array(9);bt[1]=function(e){return 1===e.substFormat?new Q.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Q.Coverage(e.coverage)},{name:"deltaGlyphID",type:"USHORT",value:e.deltaGlyphId}]):new Q.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new Q.Coverage(e.coverage)}].concat(Q.ushortList("substitute",e.substitute)))},bt[3]=function(e){return A.assert(1===e.substFormat,"Lookup type 3 substFormat must be 1."),new Q.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Q.Coverage(e.coverage)}].concat(Q.tableList("altSet",e.alternateSets,(function(e){return new Q.Table("alternateSetTable",Q.ushortList("alternate",e))}))))},bt[4]=function(e){return A.assert(1===e.substFormat,"Lookup type 4 substFormat must be 1."),new Q.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Q.Coverage(e.coverage)}].concat(Q.tableList("ligSet",e.ligatureSets,(function(e){return new Q.Table("ligatureSetTable",Q.tableList("ligature",e,(function(e){return new Q.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:e.ligGlyph}].concat(Q.ushortList("component",e.components,e.components.length+1)))})))}))))};var wt=function(e,t){var i=new re(e,t=t||0),n=i.parseVersion(1);return A.argument(1===n||1.1===n,"Unsupported GSUB table version."),1===n?{version:n,scripts:i.parseScriptList(),features:i.parseFeatureList(),lookups:i.parseLookupList(vt)}:{version:n,scripts:i.parseScriptList(),features:i.parseFeatureList(),lookups:i.parseLookupList(vt),variations:i.parseFeatureVariationsList()}},St=function(e){return new Q.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new Q.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new Q.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new Q.LookupList(e.lookups,bt)}])},Ct=function(e,t){var i=new ae.Parser(e,t),n=i.parseULong();A.argument(1===n,"Unsupported META table version."),i.parseULong(),i.parseULong();for(var r=i.parseULong(),o={},a=0;a<r;a++){var s=i.parseTag(),l=i.parseULong(),c=i.parseULong(),d=O.UTF8(e,t+l,c);o[s]=d}return o},kt=function(e){var t=Object.keys(e).length,i="",n=16+12*t,r=new Q.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:n},{name:"numTags",type:"ULONG",value:t}]);for(var o in e){var a=i.length;i+=e[o],r.fields.push({name:"tag "+o,type:"TAG",value:o}),r.fields.push({name:"offset "+o,type:"ULONG",value:n+a}),r.fields.push({name:"length "+o,type:"ULONG",value:e[o].length})}return r.fields.push({name:"stringPool",type:"CHARARRAY",value:i}),r};function xt(e){return Math.log(e)/Math.log(2)|0}function _t(e){for(;e.length%4!=0;)e.push(0);for(var t=0,i=0;i<e.length;i+=4)t+=(e[i]<<24)+(e[i+1]<<16)+(e[i+2]<<8)+e[i+3];return t%Math.pow(2,32)}function Et(e,t,i,n){return new Q.Record("Table Record",[{name:"tag",type:"TAG",value:void 0!==e?e:""},{name:"checkSum",type:"ULONG",value:void 0!==t?t:0},{name:"offset",type:"ULONG",value:void 0!==i?i:0},{name:"length",type:"ULONG",value:void 0!==n?n:0}])}function Tt(e){var t=new Q.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);t.tables=e,t.numTables=e.length;var i=Math.pow(2,xt(t.numTables));t.searchRange=16*i,t.entrySelector=xt(i),t.rangeShift=16*t.numTables-t.searchRange;for(var n=[],r=[],o=t.sizeOf()+Et().sizeOf()*t.numTables;o%4!=0;)o+=1,r.push({name:"padding",type:"BYTE",value:0});for(var a=0;a<e.length;a+=1){var s=e[a];A.argument(4===s.tableName.length,"Table name"+s.tableName+" is invalid.");var l=s.sizeOf(),c=Et(s.tableName,_t(s.encode()),o,l);for(n.push({name:c.tag+" Table Record",type:"RECORD",value:c}),r.push({name:s.tableName+" table",type:"RECORD",value:s}),o+=l,A.argument(!isNaN(o),"Something went wrong calculating the offset.");o%4!=0;)o+=1,r.push({name:"padding",type:"BYTE",value:0})}return n.sort((function(e,t){return e.value.tag>t.value.tag?1:-1})),t.fields=t.fields.concat(n),t.fields=t.fields.concat(r),t}function Pt(e,t,i){for(var n=0;n<t.length;n+=1){var r=e.charToGlyphIndex(t[n]);if(0<r)return e.glyphs.get(r).getMetrics()}return i}var It=function(e){for(var t,i=[],n=[],r=[],o=[],a=[],s=[],l=[],c=0,d=0,u=0,p=0,h=0,f=0;f<e.glyphs.length;f+=1){var m=e.glyphs.get(f),g=0|m.unicode;if(isNaN(m.advanceWidth))throw new Error("Glyph "+m.name+" ("+f+"): advanceWidth is not a number.");(g<t||void 0===t)&&0<g&&(t=g),c<g&&(c=g);var v=ft(g);if(v<32)d|=1<<v;else if(v<64)u|=1<<v-32;else if(v<96)p|=1<<v-64;else{if(!(v<123))throw new Error("Unicode ranges bits > 123 are reserved for internal usage");h|=1<<v-96}if(".notdef"!==m.name){var y=m.getMetrics();i.push(y.xMin),n.push(y.yMin),r.push(y.xMax),o.push(y.yMax),s.push(y.leftSideBearing),l.push(y.rightSideBearing),a.push(m.advanceWidth)}}var b={xMin:Math.min.apply(null,i),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,r),yMax:Math.max.apply(null,o),advanceWidthMax:Math.max.apply(null,a),advanceWidthAvg:function(e){for(var t=0,i=0;i<e.length;i+=1)t+=e[i];return t/e.length}(a),minLeftSideBearing:Math.min.apply(null,s),maxLeftSideBearing:Math.max.apply(null,s),minRightSideBearing:Math.min.apply(null,l)};b.ascender=e.ascender,b.descender=e.descender;var w=He({flags:3,unitsPerEm:e.unitsPerEm,xMin:b.xMin,yMin:b.yMin,xMax:b.xMax,yMax:b.yMax,lowestRecPPEM:3,createdTimestamp:e.createdTimestamp}),S=qe({ascender:b.ascender,descender:b.descender,advanceWidthMax:b.advanceWidthMax,minLeftSideBearing:b.minLeftSideBearing,minRightSideBearing:b.minRightSideBearing,xMaxExtent:b.maxLeftSideBearing+(b.xMax-b.xMin),numberOfHMetrics:e.glyphs.length}),C=Je(e.glyphs.length),k=ht({xAvgCharWidth:Math.round(b.advanceWidthAvg),usWeightClass:e.tables.os2.usWeightClass,usWidthClass:e.tables.os2.usWidthClass,usFirstCharIndex:t,usLastCharIndex:c,ulUnicodeRange1:d,ulUnicodeRange2:u,ulUnicodeRange3:p,ulUnicodeRange4:h,fsSelection:e.tables.os2.fsSelection,sTypoAscender:b.ascender,sTypoDescender:b.descender,sTypoLineGap:0,usWinAscent:b.yMax,usWinDescent:Math.abs(b.yMin),ulCodePageRange1:1,sxHeight:Pt(e,"xyvw",{yMax:Math.round(b.ascender/2)}).yMax,sCapHeight:Pt(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",b).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0}),x=We(e.glyphs),_=le(e.glyphs),E=e.getEnglishName("fontFamily"),T=e.getEnglishName("fontSubfamily"),P=E+" "+T,I=e.getEnglishName("postScriptName");I||(I=E.replace(/\s/g,"")+"-"+T);var A={};for(var R in e.names)A[R]=e.names[R];A.uniqueID||(A.uniqueID={en:e.getEnglishName("manufacturer")+":"+P}),A.postScriptName||(A.postScriptName={en:I}),A.preferredFamily||(A.preferredFamily=e.names.fontFamily),A.preferredSubfamily||(A.preferredSubfamily=e.names.fontSubfamily);var O=[],N=dt(A,O),D=0<O.length?Ge(O):void 0,L=gt(),M=Ue(e.glyphs,{version:e.getEnglishName("version"),fullName:P,familyName:E,weightName:T,postScriptName:I,unitsPerEm:e.unitsPerEm,fontBBox:[0,b.yMin,b.ascender,b.advanceWidthMax]}),B=e.metas&&0<Object.keys(e.metas).length?kt(e.metas):void 0,F=[w,S,C,k,N,_,L,M,x];D&&F.push(D),e.tables.gsub&&F.push(St(e.tables.gsub)),B&&F.push(B);for(var V=Tt(F),U=_t(V.encode()),z=V.fields,H=!1,j=0;j<z.length;j+=1)if("head table"===z[j].name){z[j].value.checkSumAdjustment=2981146554-U,H=!0;break}if(!H)throw new Error("Could not find head table with checkSum to adjust.");return V};function At(e,t){for(var i=0,n=e.length-1;i<=n;){var r=i+n>>>1,o=e[r].tag;if(o===t)return r;o<t?i=r+1:n=r-1}return-i-1}function Rt(e,t){for(var i=0,n=e.length-1;i<=n;){var r=i+n>>>1,o=e[r];if(o===t)return r;o<t?i=r+1:n=r-1}return-i-1}function Ot(e,t){for(var i,n=0,r=e.length-1;n<=r;){var o=n+r>>>1,a=(i=e[o]).start;if(a===t)return i;a<t?n=o+1:r=o-1}if(0<n)return t>(i=e[n-1]).end?0:i}function Nt(e,t){this.font=e,this.tableName=t}function Dt(e){Nt.call(this,e,"gpos")}function Lt(e){Nt.call(this,e,"gsub")}function Mt(e,t){var i=e.length;if(i!==t.length)return!1;for(var n=0;n<i;n++)if(e[n]!==t[n])return!1;return!0}function Bt(e,t,i){for(var n=e.subtables,r=0;r<n.length;r++){var o=n[r];if(o.substFormat===t)return o}if(i)return n.push(i),i}function Ft(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),n=0;n<e.length;++n)i[n]=e[n];return t}function Vt(e,t){if(!e)throw t}function Ut(e,t,i,n,r){var o;return 0<(t&n)?(o=e.parseByte(),0==(t&r)&&(o=-o),i+o):0<(t&r)?i:i+e.parseShort()}function zt(e,t,i){var n,r,o=new ae.Parser(t,i);if(e.numberOfContours=o.parseShort(),e._xMin=o.parseShort(),e._yMin=o.parseShort(),e._xMax=o.parseShort(),e._yMax=o.parseShort(),0<e.numberOfContours){for(var a=e.endPointIndices=[],s=0;s<e.numberOfContours;s+=1)a.push(o.parseUShort());e.instructionLength=o.parseUShort(),e.instructions=[];for(var l=0;l<e.instructionLength;l+=1)e.instructions.push(o.parseByte());var c=a[a.length-1]+1;n=[];for(var d=0;d<c;d+=1)if(r=o.parseByte(),n.push(r),0<(8&r))for(var u=o.parseByte(),p=0;p<u;p+=1)n.push(r),d+=1;if(A.argument(n.length===c,"Bad flags."),0<a.length){var h,f=[];if(0<c){for(var m=0;m<c;m+=1)r=n[m],(h={}).onCurve=!!(1&r),h.lastPointOfContour=0<=a.indexOf(m),f.push(h);for(var g=0,v=0;v<c;v+=1)r=n[v],(h=f[v]).x=Ut(o,r,g,2,16),g=h.x;for(var y=0,b=0;b<c;b+=1)r=n[b],(h=f[b]).y=Ut(o,r,y,4,32),y=h.y}e.points=f}else e.points=[]}else if(0===e.numberOfContours)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];for(var w=!0;w;){n=o.parseUShort();var S={glyphIndex:o.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};0<(1&n)?0<(2&n)?(S.dx=o.parseShort(),S.dy=o.parseShort()):S.matchedPoints=[o.parseUShort(),o.parseUShort()]:0<(2&n)?(S.dx=o.parseChar(),S.dy=o.parseChar()):S.matchedPoints=[o.parseByte(),o.parseByte()],0<(8&n)?S.xScale=S.yScale=o.parseF2Dot14():0<(64&n)?(S.xScale=o.parseF2Dot14(),S.yScale=o.parseF2Dot14()):0<(128&n)&&(S.xScale=o.parseF2Dot14(),S.scale01=o.parseF2Dot14(),S.scale10=o.parseF2Dot14(),S.yScale=o.parseF2Dot14()),e.components.push(S),w=!!(32&n)}if(256&n){e.instructionLength=o.parseUShort(),e.instructions=[];for(var C=0;C<e.instructionLength;C+=1)e.instructions.push(o.parseByte())}}}function Ht(e,t){for(var i=[],n=0;n<e.length;n+=1){var r=e[n],o={x:t.xScale*r.x+t.scale01*r.y+t.dx,y:t.scale10*r.x+t.yScale*r.y+t.dy,onCurve:r.onCurve,lastPointOfContour:r.lastPointOfContour};i.push(o)}return i}function jt(e){var t=new T;if(!e)return t;for(var i=function(e){for(var t=[],i=[],n=0;n<e.length;n+=1){var r=e[n];i.push(r),r.lastPointOfContour&&(t.push(i),i=[])}return A.argument(0===i.length,"There are still points left in the current contour."),t}(e),n=0;n<i.length;++n){var r=i[n],o=null,a=r[r.length-1],s=r[0];if(a.onCurve)t.moveTo(a.x,a.y);else if(s.onCurve)t.moveTo(s.x,s.y);else{var l={x:.5*(a.x+s.x),y:.5*(a.y+s.y)};t.moveTo(l.x,l.y)}for(var c=0;c<r.length;++c)if(o=a,a=s,s=r[(c+1)%r.length],a.onCurve)t.lineTo(a.x,a.y);else{var d=s;o.onCurve||(a.x,o.x,a.y,o.y),s.onCurve||(d={x:.5*(a.x+s.x),y:.5*(a.y+s.y)}),t.quadraticCurveTo(a.x,a.y,d.x,d.y)}t.closePath()}return t}function qt(e,t){if(t.isComposite)for(var i=0;i<t.components.length;i+=1){var n=t.components[i],r=e.get(n.glyphIndex);if(r.getPath(),r.points){var o=void 0;if(void 0===n.matchedPoints)o=Ht(r.points,n);else{if(n.matchedPoints[0]>t.points.length-1||n.matchedPoints[1]>r.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[n.matchedPoints[0]],s=r.points[n.matchedPoints[1]],l={xScale:n.xScale,scale01:n.scale01,scale10:n.scale10,yScale:n.yScale,dx:0,dy:0};s=Ht([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=Ht(r.points,l)}t.points=t.points.concat(o)}}return jt(t.points)}(Dt.prototype=Nt.prototype={searchTag:At,binSearch:Rt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map((function(e){return e.tag})):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,i=0;i<e.scripts.length;i++){var n=e.scripts[i].tag;if("DFLT"===n)return n;"latn"===n&&(t=!0)}return t?"latn":void 0}},getScriptTable:function(e,t){var i=this.getTable(t);if(i){e=e||"DFLT";var n=i.scripts,r=At(i.scripts,e);if(0<=r)return n[r].script;if(t){var o={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return n.splice(-1-r,0,o),o.script}}},getLangSysTable:function(e,t,i){var n=this.getScriptTable(e,i);if(n){if(!t||"dflt"===t||"DFLT"===t)return n.defaultLangSys;var r=At(n.langSysRecords,t);if(0<=r)return n.langSysRecords[r].langSys;if(i){var o={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return n.langSysRecords.splice(-1-r,0,o),o.langSys}}},getFeatureTable:function(e,t,i,n){var r=this.getLangSysTable(e,t,n);if(r){for(var o,a=r.featureIndexes,s=this.font.tables[this.tableName].features,l=0;l<a.length;l++)if((o=s[a[l]]).tag===i)return o.feature;if(n){var c=s.length;return A.assert(0===c||i>=s[c-1].tag,"Features must be added in alphabetical order."),o={tag:i,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(c),o.feature}}},getLookupTables:function(e,t,i,n,r){var o=this.getFeatureTable(e,t,i,r),a=[];if(o){for(var s,l=o.lookupListIndexes,c=this.font.tables[this.tableName].lookups,d=0;d<l.length;d++)(s=c[l[d]]).lookupType===n&&a.push(s);if(0===a.length&&r){s={lookupType:n,lookupFlag:0,subtables:[],markFilteringSet:void 0};var u=c.length;return c.push(s),l.push(u),[s]}}return a},getGlyphClass:function(e,t){switch(e.format){case 1:return e.startGlyph<=t&&t<e.startGlyph+e.classes.length?e.classes[t-e.startGlyph]:0;case 2:var i=Ot(e.ranges,t);return i?i.classId:0}},getCoverageIndex:function(e,t){switch(e.format){case 1:var i=Rt(e.glyphs,t);return 0<=i?i:-1;case 2:var n=Ot(e.ranges,t);return n?n.index+t-n.start:-1}},expandCoverage:function(e){if(1===e.format)return e.glyphs;for(var t=[],i=e.ranges,n=0;n<i.length;n++)for(var r=i[n],o=r.start,a=r.end,s=o;s<=a;s++)t.push(s);return t}}).init=function(){var e=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(e)},Dt.prototype.getKerningValue=function(e,t,i){for(var n=0;n<e.length;n++)for(var r=e[n].subtables,o=0;o<r.length;o++){var a=r[o],s=this.getCoverageIndex(a.coverage,t);if(!(s<0))switch(a.posFormat){case 1:for(var l=a.pairSets[s],c=0;c<l.length;c++){var d=l[c];if(d.secondGlyph===i)return d.value1&&d.value1.xAdvance||0}break;case 2:var u=this.getGlyphClass(a.classDef1,t),p=this.getGlyphClass(a.classDef2,i),h=a.classRecords[u][p];return h.value1&&h.value1.xAdvance||0}}return 0},Dt.prototype.getKerningTables=function(e,t){if(this.font.tables.gpos)return this.getLookupTables(e,t,"kern",2)},(Lt.prototype=Nt.prototype).createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},Lt.prototype.getSingle=function(e,t,i){for(var n=[],r=this.getLookupTables(t,i,e,1),o=0;o<r.length;o++)for(var a=r[o].subtables,s=0;s<a.length;s++){var l=a[s],c=this.expandCoverage(l.coverage),d=void 0;if(1===l.substFormat){var u=l.deltaGlyphId;for(d=0;d<c.length;d++){var p=c[d];n.push({sub:p,by:p+u})}}else{var h=l.substitute;for(d=0;d<c.length;d++)n.push({sub:c[d],by:h[d]})}}return n},Lt.prototype.getAlternates=function(e,t,i){for(var n=[],r=this.getLookupTables(t,i,e,3),o=0;o<r.length;o++)for(var a=r[o].subtables,s=0;s<a.length;s++)for(var l=a[s],c=this.expandCoverage(l.coverage),d=l.alternateSets,u=0;u<c.length;u++)n.push({sub:c[u],by:d[u]});return n},Lt.prototype.getLigatures=function(e,t,i){for(var n=[],r=this.getLookupTables(t,i,e,4),o=0;o<r.length;o++)for(var a=r[o].subtables,s=0;s<a.length;s++)for(var l=a[s],c=this.expandCoverage(l.coverage),d=l.ligatureSets,u=0;u<c.length;u++)for(var p=c[u],h=d[u],f=0;f<h.length;f++){var m=h[f];n.push({sub:[p].concat(m.components),by:m.ligGlyph})}return n},Lt.prototype.addSingle=function(e,t,i,n){var r=Bt(this.getLookupTables(i,n,e,1,!0)[0],2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});A.assert(1===r.coverage.format,"Ligature: unable to modify coverage table format "+r.coverage.format);var o=t.sub,a=this.binSearch(r.coverage.glyphs,o);a<0&&(a=-1-a,r.coverage.glyphs.splice(a,0,o),r.substitute.splice(a,0,0)),r.substitute[a]=t.by},Lt.prototype.addAlternate=function(e,t,i,n){var r=Bt(this.getLookupTables(i,n,e,3,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});A.assert(1===r.coverage.format,"Ligature: unable to modify coverage table format "+r.coverage.format);var o=t.sub,a=this.binSearch(r.coverage.glyphs,o);a<0&&(a=-1-a,r.coverage.glyphs.splice(a,0,o),r.alternateSets.splice(a,0,0)),r.alternateSets[a]=t.by},Lt.prototype.addLigature=function(e,t,i,n){var r=this.getLookupTables(i,n,e,4,!0)[0],o=r.subtables[0];o||(o={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},r.subtables[0]=o),A.assert(1===o.coverage.format,"Ligature: unable to modify coverage table format "+o.coverage.format);var a=t.sub[0],s=t.sub.slice(1),l={ligGlyph:t.by,components:s},c=this.binSearch(o.coverage.glyphs,a);if(0<=c){for(var d=o.ligatureSets[c],u=0;u<d.length;u++)if(Mt(d[u].components,s))return;d.push(l)}else c=-1-c,o.coverage.glyphs.splice(c,0,a),o.ligatureSets.splice(c,0,[l])},Lt.prototype.getFeature=function(e,t,i){if(/ss\d\d/.test(e))return this.getSingle(e,t,i);switch(e){case"aalt":case"salt":return this.getSingle(e,t,i).concat(this.getAlternates(e,t,i));case"dlig":case"liga":case"rlig":return this.getLigatures(e,t,i)}},Lt.prototype.add=function(e,t,i,n){if(/ss\d\d/.test(e))return this.addSingle(e,t,i,n);switch(e){case"aalt":case"salt":return"number"==typeof t.by?this.addSingle(e,t,i,n):this.addAlternate(e,t,i,n);case"dlig":case"liga":case"rlig":return this.addLigature(e,t,i,n)}};var $t,Wt,Gt,Kt,Yt={getPath:jt,parse:function(e,t,i,n){for(var r=new Se.GlyphSet(n),o=0;o<i.length-1;o+=1){var a=i[o];a!==i[o+1]?r.push(o,Se.ttfGlyphLoader(n,o,zt,e,t+a,qt)):r.push(o,Se.glyphLoader(n,o))}return r}};function Jt(e){this.font=e,this.getCommands=function(e){return Yt.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function Xt(e){return e}function Qt(e){return Math.sign(e)*Math.round(Math.abs(e))}function Zt(e){return Math.sign(e)*Math.round(Math.abs(2*e))/2}function ei(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function ti(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function ii(e){return Math.sign(e)*Math.floor(Math.abs(e))}var ni=function(e){var t=this.srPeriod,i=this.srPhase,n=1;return e<0&&(e=-e,n=-1),e+=this.srThreshold-i,e=Math.trunc(e/t)*t,(e+=i)<0?i*n:e*n},ri={x:1,y:0,axis:"x",distance:function(e,t,i,n){return(i?e.xo:e.x)-(n?t.xo:t.x)},interpolate:function(e,t,i,n){var r,o,a,s,l,c,d;if(!n||n===this)return r=e.xo-t.xo,o=e.xo-i.xo,l=t.x-t.xo,c=i.x-i.xo,0===(d=(a=Math.abs(r))+(s=Math.abs(o)))?void(e.x=e.xo+(l+c)/2):void(e.x=e.xo+(l*s+c*a)/d);r=n.distance(e,t,!0,!0),o=n.distance(e,i,!0,!0),l=n.distance(t,t,!1,!0),c=n.distance(i,i,!1,!0),0!==(d=(a=Math.abs(r))+(s=Math.abs(o)))?ri.setRelative(e,e,(l*s+c*a)/d,n,!0):ri.setRelative(e,e,(l+c)/2,n,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,t,i,n,r){if(n&&n!==this){var o=r?t.xo:t.x,a=r?t.yo:t.y,s=o+i*n.x,l=a+i*n.y;e.x=s+(e.y-l)/n.normalSlope}else e.x=(r?t.xo:t.x)+i},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},oi={x:0,y:1,axis:"y",distance:function(e,t,i,n){return(i?e.yo:e.y)-(n?t.yo:t.y)},interpolate:function(e,t,i,n){var r,o,a,s,l,c,d;if(!n||n===this)return r=e.yo-t.yo,o=e.yo-i.yo,l=t.y-t.yo,c=i.y-i.yo,0===(d=(a=Math.abs(r))+(s=Math.abs(o)))?void(e.y=e.yo+(l+c)/2):void(e.y=e.yo+(l*s+c*a)/d);r=n.distance(e,t,!0,!0),o=n.distance(e,i,!0,!0),l=n.distance(t,t,!1,!0),c=n.distance(i,i,!1,!0),0!==(d=(a=Math.abs(r))+(s=Math.abs(o)))?oi.setRelative(e,e,(l*s+c*a)/d,n,!0):oi.setRelative(e,e,(l+c)/2,n,!0)},normalSlope:0,setRelative:function(e,t,i,n,r){if(n&&n!==this){var o=r?t.xo:t.x,a=r?t.yo:t.y,s=o+i*n.x,l=a+i*n.y;e.y=l+n.normalSlope*(e.x-s)}else e.y=(r?t.yo:t.y)+i},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};function ai(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}function si(e,t){var i=Math.sqrt(e*e+t*t);return t/=i,1==(e/=i)&&0===t?ri:0===e&&1===t?oi:new ai(e,t)}function li(e,t,i,n){this.x=this.xo=Math.round(64*e)/64,this.y=this.yo=Math.round(64*t)/64,this.lastPointOfContour=i,this.onCurve=n,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Object.freeze(ri),Object.freeze(oi),ai.prototype.distance=function(e,t,i,n){return this.x*ri.distance(e,t,i,n)+this.y*oi.distance(e,t,i,n)},ai.prototype.interpolate=function(e,t,i,n){var r,o,a,s,l,c,d;a=n.distance(e,t,!0,!0),s=n.distance(e,i,!0,!0),r=n.distance(t,t,!1,!0),o=n.distance(i,i,!1,!0),0!==(d=(l=Math.abs(a))+(c=Math.abs(s)))?this.setRelative(e,e,(r*c+o*l)/d,n,!0):this.setRelative(e,e,(r+o)/2,n,!0)},ai.prototype.setRelative=function(e,t,i,n,r){n=n||this;var o=r?t.xo:t.x,a=r?t.yo:t.y,s=o+i*n.x,l=a+i*n.y,c=n.normalSlope,d=this.slope,u=e.x,p=e.y;e.x=(d*u-c*s+l-p)/(d-c),e.y=d*(e.x-u)+p},ai.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0},li.prototype.nextTouched=function(e){for(var t=this.nextPointOnContour;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},li.prototype.prevTouched=function(e){for(var t=this.prevPointOnContour;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};var ci=Object.freeze(new li(0,0)),di={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function ui(e,t){switch(this.env=e,this.stack=[],this.prog=t,e){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=ri,this.round=Qt}}function pi(e){for(var t=e.tZone=new Array(e.gZone.length),i=0;i<t.length;i++)t[i]=new li(0,0)}function hi(e,t){var i,n=e.prog,r=e.ip,o=1;do{if(88===(i=n[++r]))o++;else if(89===i)o--;else if(64===i)r+=n[r+1]+1;else if(65===i)r+=2*n[r+1]+1;else if(176<=i&&i<=183)r+=i-176+1;else if(184<=i&&i<=191)r+=2*(i-184+1);else if(t&&1===o&&27===i)break}while(0<o);e.ip=r}function fi(e,i){t.DEBUG&&console.log(i.step,"SVTCA["+e.axis+"]"),i.fv=i.pv=i.dpv=e}function mi(e,i){t.DEBUG&&console.log(i.step,"SPVTCA["+e.axis+"]"),i.pv=i.dpv=e}function gi(e,i){t.DEBUG&&console.log(i.step,"SFVTCA["+e.axis+"]"),i.fv=e}function vi(e,i){var n,r,o=i.stack,a=o.pop(),s=o.pop(),l=i.z2[a],c=i.z1[s];t.DEBUG&&console.log("SPVTL["+e+"]",a,s),r=e?(n=l.y-c.y,c.x-l.x):(n=c.x-l.x,c.y-l.y),i.pv=i.dpv=si(n,r)}function yi(e,i){var n,r,o=i.stack,a=o.pop(),s=o.pop(),l=i.z2[a],c=i.z1[s];t.DEBUG&&console.log("SFVTL["+e+"]",a,s),r=e?(n=l.y-c.y,c.x-l.x):(n=c.x-l.x,c.y-l.y),i.fv=si(n,r)}function bi(e){t.DEBUG&&console.log(e.step,"POP[]"),e.stack.pop()}function wi(e,i){var n=i.stack.pop(),r=i.z0[n],o=i.fv,a=i.pv;t.DEBUG&&console.log(i.step,"MDAP["+e+"]",n);var s=a.distance(r,ci);e&&(s=i.round(s)),o.setRelative(r,ci,s,a),o.touch(r),i.rp0=i.rp1=n}function Si(e,i){var n,r,o,a=i.z2,s=a.length-2;t.DEBUG&&console.log(i.step,"IUP["+e.axis+"]");for(var l=0;l<s;l++)n=a[l],e.touched(n)||(r=n.prevTouched(e))!==n&&(r===(o=n.nextTouched(e))&&e.setRelative(n,n,e.distance(r,r,!1,!0),e,!0),e.interpolate(n,r,o,e))}function Ci(e,i){for(var n=i.stack,r=e?i.rp1:i.rp2,o=(e?i.z0:i.z1)[r],a=i.fv,s=i.pv,l=i.loop,c=i.z2;l--;){var d=n.pop(),u=c[d],p=s.distance(o,o,!1,!0);a.setRelative(u,u,p,s),a.touch(u),t.DEBUG&&console.log(i.step,(1<i.loop?"loop "+(i.loop-l)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",d)}i.loop=1}function ki(e,i){var n=i.stack,r=e?i.rp1:i.rp2,o=(e?i.z0:i.z1)[r],a=i.fv,s=i.pv,l=n.pop(),c=i.z2[i.contours[l]],d=c;t.DEBUG&&console.log(i.step,"SHC["+e+"]",l);for(var u=s.distance(o,o,!1,!0);d!==o&&a.setRelative(d,d,u,s),(d=d.nextPointOnContour)!==c;);}function xi(e,i){var n,r,o=i.stack,a=e?i.rp1:i.rp2,s=(e?i.z0:i.z1)[a],l=i.fv,c=i.pv,d=o.pop();switch(t.DEBUG&&console.log(i.step,"SHZ["+e+"]",d),d){case 0:n=i.tZone;break;case 1:n=i.gZone;break;default:throw new Error("Invalid zone")}for(var u=c.distance(s,s,!1,!0),p=n.length-2,h=0;h<p;h++)r=n[h],l.setRelative(r,r,u,c)}function _i(e,i){var n=i.stack,r=n.pop()/64,o=n.pop(),a=i.z1[o],s=i.z0[i.rp0],l=i.fv,c=i.pv;l.setRelative(a,s,r,c),l.touch(a),t.DEBUG&&console.log(i.step,"MSIRP["+e+"]",r,o),i.rp1=i.rp0,i.rp2=o,e&&(i.rp0=o)}function Ei(e,i){var n=i.stack,r=n.pop(),o=n.pop(),a=i.z0[o],s=i.fv,l=i.pv,c=i.cvt[r];t.DEBUG&&console.log(i.step,"MIAP["+e+"]",r,"(",c,")",o);var d=l.distance(a,ci);e&&(Math.abs(d-c)<i.cvCutIn&&(d=c),d=i.round(d)),s.setRelative(a,ci,d,l),0===i.zp0&&(a.xo=a.x,a.yo=a.y),s.touch(a),i.rp0=i.rp1=o}function Ti(e,i){var n=i.stack,r=n.pop(),o=i.z2[r];t.DEBUG&&console.log(i.step,"GC["+e+"]",r),n.push(64*i.dpv.distance(o,ci,e,!1))}function Pi(e,i){var n=i.stack,r=n.pop(),o=n.pop(),a=i.z1[r],s=i.z0[o],l=i.dpv.distance(s,a,e,e);t.DEBUG&&console.log(i.step,"MD["+e+"]",r,o,"->",l),i.stack.push(Math.round(64*l))}function Ii(e,i){var n=i.stack,r=n.pop(),o=i.fv,a=i.pv,s=i.ppem,l=i.deltaBase+16*(e-1),c=i.deltaShift,d=i.z0;t.DEBUG&&console.log(i.step,"DELTAP["+e+"]",r,n);for(var u=0;u<r;u++){var p=n.pop(),h=n.pop();if(l+((240&h)>>4)===s){var f=(15&h)-8;0<=f&&f++,t.DEBUG&&console.log(i.step,"DELTAPFIX",p,"by",f*c);var m=d[p];o.setRelative(m,m,f*c,a)}}}function Ai(e,i){var n=i.stack,r=n.pop();t.DEBUG&&console.log(i.step,"ROUND[]"),n.push(64*i.round(r/64))}function Ri(e,i){var n=i.stack,r=n.pop(),o=i.ppem,a=i.deltaBase+16*(e-1),s=i.deltaShift;t.DEBUG&&console.log(i.step,"DELTAC["+e+"]",r,n);for(var l=0;l<r;l++){var c=n.pop(),d=n.pop();if(a+((240&d)>>4)===o){var u=(15&d)-8;0<=u&&u++;var p=u*s;t.DEBUG&&console.log(i.step,"DELTACFIX",c,"by",p),i.cvt[c]+=p}}}function Oi(e,i){var n,r,o=i.stack,a=o.pop(),s=o.pop(),l=i.z2[a],c=i.z1[s];t.DEBUG&&console.log(i.step,"SDPVTL["+e+"]",a,s),r=e?(n=l.y-c.y,c.x-l.x):(n=c.x-l.x,c.y-l.y),i.dpv=si(n,r)}function Ni(e,i){var n=i.stack,r=i.prog,o=i.ip;t.DEBUG&&console.log(i.step,"PUSHB["+e+"]");for(var a=0;a<e;a++)n.push(r[++o]);i.ip=o}function Di(e,i){var n=i.ip,r=i.prog,o=i.stack;t.DEBUG&&console.log(i.ip,"PUSHW["+e+"]");for(var a=0;a<e;a++){var s=r[++n]<<8|r[++n];32768&s&&(s=-(1+(65535^s))),o.push(s)}i.ip=n}function Li(e,i,n,r,o,a){var s,l,c,d,u=a.stack,p=e&&u.pop(),h=u.pop(),f=a.rp0,m=a.z0[f],g=a.z1[h],v=a.minDis,y=a.fv,b=a.dpv;c=0<=(l=s=b.distance(g,m,!0,!0))?1:-1,l=Math.abs(l),e&&(d=a.cvt[p],r&&Math.abs(l-d)<a.cvCutIn&&(l=d)),n&&l<v&&(l=v),r&&(l=a.round(l)),y.setRelative(g,m,c*l,b),y.touch(g),t.DEBUG&&console.log(a.step,(e?"MIRP[":"MDRP[")+(i?"M":"m")+(n?">":"_")+(r?"R":"_")+(0===o?"Gr":1===o?"Bl":2===o?"Wh":"")+"]",e?p+"("+a.cvt[p]+","+d+")":"",h,"(d =",s,"->",c*l,")"),a.rp1=a.rp0,a.rp2=h,i&&(a.rp0=h)}function Mi(e){this.char=e,this.state={},this.activeState=null}function Bi(e,t,i){this.contextName=i,this.startIndex=e,this.endOffset=t}function Fi(e,t,i){this.contextName=e,this.openRange=null,this.ranges=[],this.checkStart=t,this.checkEnd=i}function Vi(e,t){this.context=e,this.index=t,this.length=e.length,this.current=e[t],this.backtrack=e.slice(0,t),this.lookahead=e.slice(t+1)}function Ui(e){this.eventId=e,this.subscribers=[]}function zi(e){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],function(e){var t=this,i=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];i.forEach((function(e){Object.defineProperty(t.events,e,{value:new Ui(e)})})),e&&i.forEach((function(i){var n=e[i];"function"==typeof n&&t.events[i].subscribe(n)})),["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"].forEach((function(e){t.events[e].subscribe(t.updateContextsRanges)}))}.call(this,e)}function Hi(e){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e)}function ji(e){return/[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(e)}function qi(e){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(e)}Jt.prototype.exec=function(e,i){if("number"!=typeof i)throw new Error("Point size is not a number!");if(!(2<this._errorState)){var n=this.font,r=this._prepState;if(!r||r.ppem!==i){var o=this._fpgmState;if(!o){ui.prototype=di,(o=this._fpgmState=new ui("fpgm",n.tables.fpgm)).funcs=[],o.font=n,t.DEBUG&&(console.log("---EXEC FPGM---"),o.step=-1);try{Wt(o)}catch(e){return console.log("Hinting error in FPGM:"+e),void(this._errorState=3)}}ui.prototype=o,(r=this._prepState=new ui("prep",n.tables.prep)).ppem=i;var a=n.tables.cvt;if(a)for(var s=r.cvt=new Array(a.length),l=i/n.unitsPerEm,c=0;c<a.length;c++)s[c]=a[c]*l;else r.cvt=[];t.DEBUG&&(console.log("---EXEC PREP---"),r.step=-1);try{Wt(r)}catch(e){this._errorState<2&&console.log("Hinting error in PREP:"+e),this._errorState=2}}if(!(1<this._errorState))try{return Gt(e,r)}catch(e){return this._errorState<1&&(console.log("Hinting error:"+e),console.log("Note: further hinting errors are silenced")),void(this._errorState=1)}}},Gt=function(e,i){var n,r,o,a=i.ppem/i.font.unitsPerEm,s=a,l=e.components;if(ui.prototype=i,l){var c=i.font;r=[],n=[];for(var d=0;d<l.length;d++){var u=l[d],p=c.glyphs.get(u.glyphIndex);o=new ui("glyf",p.instructions),t.DEBUG&&(console.log("---EXEC COMP "+d+"---"),o.step=-1),Kt(p,o,a,s);for(var h=Math.round(u.dx*a),f=Math.round(u.dy*s),m=o.gZone,g=o.contours,v=0;v<m.length;v++){var y=m[v];y.xTouched=y.yTouched=!1,y.xo=y.x=y.x+h,y.yo=y.y=y.y+f}var b=r.length;r.push.apply(r,m);for(var w=0;w<g.length;w++)n.push(g[w]+b)}e.instructions&&!o.inhibitGridFit&&((o=new ui("glyf",e.instructions)).gZone=o.z0=o.z1=o.z2=r,o.contours=n,r.push(new li(0,0),new li(Math.round(e.advanceWidth*a),0)),t.DEBUG&&(console.log("---EXEC COMPOSITE---"),o.step=-1),Wt(o),r.length-=2)}else o=new ui("glyf",e.instructions),t.DEBUG&&(console.log("---EXEC GLYPH---"),o.step=-1),Kt(e,o,a,s),r=o.gZone;return r},Kt=function(e,i,n,r){for(var o,a,s,l=e.points||[],c=l.length,d=i.gZone=i.z0=i.z1=i.z2=[],u=i.contours=[],p=0;p<c;p++)o=l[p],d[p]=new li(o.x*n,o.y*r,o.lastPointOfContour,o.onCurve);for(var h=0;h<c;h++)o=d[h],a||(a=o,u.push(h)),o.lastPointOfContour?((o.nextPointOnContour=a).prevPointOnContour=o,a=void 0):(s=d[h+1],(o.nextPointOnContour=s).prevPointOnContour=o);if(!i.inhibitGridFit){if(t.DEBUG){console.log("PROCESSING GLYPH",i.stack);for(var f=0;f<c;f++)console.log(f,d[f].x,d[f].y)}if(d.push(new li(0,0),new li(Math.round(e.advanceWidth*n),0)),Wt(i),d.length-=2,t.DEBUG){console.log("FINISHED GLYPH",i.stack);for(var m=0;m<c;m++)console.log(m,d[m].x,d[m].y)}}},Wt=function(e){var i=e.prog;if(i){var n,r=i.length;for(e.ip=0;e.ip<r;e.ip++){if(t.DEBUG&&e.step++,!(n=$t[i[e.ip]]))throw new Error("unknown instruction: 0x"+Number(i[e.ip]).toString(16));n(e)}}},$t=[fi.bind(void 0,oi),fi.bind(void 0,ri),mi.bind(void 0,oi),mi.bind(void 0,ri),gi.bind(void 0,oi),gi.bind(void 0,ri),vi.bind(void 0,0),vi.bind(void 0,1),yi.bind(void 0,0),yi.bind(void 0,1),function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"SPVFS[]",n,r),e.pv=e.dpv=si(r,n)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"SPVFS[]",n,r),e.fv=si(r,n)},function(e){var i=e.stack,n=e.pv;t.DEBUG&&console.log(e.step,"GPV[]"),i.push(16384*n.x),i.push(16384*n.y)},function(e){var i=e.stack,n=e.fv;t.DEBUG&&console.log(e.step,"GFV[]"),i.push(16384*n.x),i.push(16384*n.y)},function(e){e.fv=e.pv,t.DEBUG&&console.log(e.step,"SFVTPV[]")},function(e){var i=e.stack,n=i.pop(),r=i.pop(),o=i.pop(),a=i.pop(),s=i.pop(),l=e.z0,c=e.z1,d=l[n],u=l[r],p=c[o],h=c[a],f=e.z2[s];t.DEBUG&&console.log("ISECT[], ",n,r,o,a,s);var m=d.x,g=d.y,v=u.x,y=u.y,b=p.x,w=p.y,S=h.x,C=h.y,k=(m-v)*(w-C)-(g-y)*(b-S),x=m*y-g*v,_=b*C-w*S;f.x=(x*(b-S)-_*(m-v))/k,f.y=(x*(w-C)-_*(g-y))/k},function(e){e.rp0=e.stack.pop(),t.DEBUG&&console.log(e.step,"SRP0[]",e.rp0)},function(e){e.rp1=e.stack.pop(),t.DEBUG&&console.log(e.step,"SRP1[]",e.rp1)},function(e){e.rp2=e.stack.pop(),t.DEBUG&&console.log(e.step,"SRP2[]",e.rp2)},function(e){var i=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZP0[]",i),e.zp0=i){case 0:e.tZone||pi(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var i=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZP1[]",i),e.zp1=i){case 0:e.tZone||pi(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var i=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZP2[]",i),e.zp2=i){case 0:e.tZone||pi(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var i=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZPS[]",i),e.zp0=e.zp1=e.zp2=i,i){case 0:e.tZone||pi(e),e.z0=e.z1=e.z2=e.tZone;break;case 1:e.z0=e.z1=e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){e.loop=e.stack.pop(),t.DEBUG&&console.log(e.step,"SLOOP[]",e.loop)},function(e){t.DEBUG&&console.log(e.step,"RTG[]"),e.round=Qt},function(e){t.DEBUG&&console.log(e.step,"RTHG[]"),e.round=ei},function(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SMD[]",i),e.minDis=i/64},function(e){t.DEBUG&&console.log(e.step,"ELSE[]"),hi(e,!1)},function(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"JMPR[]",i),e.ip+=i-1},function(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SCVTCI[]",i),e.cvCutIn=i/64},void 0,void 0,function(e){var i=e.stack;t.DEBUG&&console.log(e.step,"DUP[]"),i.push(i[i.length-1])},bi,function(e){t.DEBUG&&console.log(e.step,"CLEAR[]"),e.stack.length=0},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"SWAP[]"),i.push(n),i.push(r)},function(e){var i=e.stack;t.DEBUG&&console.log(e.step,"DEPTH[]"),i.push(i.length)},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"CINDEX[]",n),i.push(i[i.length-n])},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"MINDEX[]",n),i.push(i.splice(i.length-n,1)[0])},void 0,void 0,void 0,function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"LOOPCALL[]",n,r);var o=e.ip,a=e.prog;e.prog=e.funcs[n];for(var s=0;s<r;s++)Wt(e),t.DEBUG&&console.log(++e.step,s+1<r?"next loopcall":"done loopcall",s);e.ip=o,e.prog=a},function(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"CALL[]",i);var n=e.ip,r=e.prog;e.prog=e.funcs[i],Wt(e),e.ip=n,e.prog=r,t.DEBUG&&console.log(++e.step,"returning from",i)},function(e){if("fpgm"!==e.env)throw new Error("FDEF not allowed here");var i=e.stack,n=e.prog,r=e.ip,o=i.pop(),a=r;for(t.DEBUG&&console.log(e.step,"FDEF[]",o);45!==n[++r];);e.ip=r,e.funcs[o]=n.slice(a+1,r)},void 0,wi.bind(void 0,0),wi.bind(void 0,1),Si.bind(void 0,oi),Si.bind(void 0,ri),Ci.bind(void 0,0),Ci.bind(void 0,1),ki.bind(void 0,0),ki.bind(void 0,1),xi.bind(void 0,0),xi.bind(void 0,1),function(e){for(var i=e.stack,n=e.loop,r=e.fv,o=i.pop()/64,a=e.z2;n--;){var s=i.pop(),l=a[s];t.DEBUG&&console.log(e.step,(1<e.loop?"loop "+(e.loop-n)+": ":"")+"SHPIX[]",s,o),r.setRelative(l,l,o),r.touch(l)}e.loop=1},function(e){for(var i=e.stack,n=e.rp1,r=e.rp2,o=e.loop,a=e.z0[n],s=e.z1[r],l=e.fv,c=e.dpv,d=e.z2;o--;){var u=i.pop(),p=d[u];t.DEBUG&&console.log(e.step,(1<e.loop?"loop "+(e.loop-o)+": ":"")+"IP[]",u,n,"<->",r),l.interpolate(p,a,s,c),l.touch(p)}e.loop=1},_i.bind(void 0,0),_i.bind(void 0,1),function(e){for(var i=e.stack,n=e.rp0,r=e.z0[n],o=e.loop,a=e.fv,s=e.pv,l=e.z1;o--;){var c=i.pop(),d=l[c];t.DEBUG&&console.log(e.step,(1<e.loop?"loop "+(e.loop-o)+": ":"")+"ALIGNRP[]",c),a.setRelative(d,r,0,s),a.touch(d)}e.loop=1},function(e){t.DEBUG&&console.log(e.step,"RTDG[]"),e.round=Zt},Ei.bind(void 0,0),Ei.bind(void 0,1),function(e){var i=e.prog,n=e.ip,r=e.stack,o=i[++n];t.DEBUG&&console.log(e.step,"NPUSHB[]",o);for(var a=0;a<o;a++)r.push(i[++n]);e.ip=n},function(e){var i=e.ip,n=e.prog,r=e.stack,o=n[++i];t.DEBUG&&console.log(e.step,"NPUSHW[]",o);for(var a=0;a<o;a++){var s=n[++i]<<8|n[++i];32768&s&&(s=-(1+(65535^s))),r.push(s)}e.ip=i},function(e){var i=e.stack,n=e.store;n||(n=e.store=[]);var r=i.pop(),o=i.pop();t.DEBUG&&console.log(e.step,"WS",r,o),n[o]=r},function(e){var i=e.stack,n=e.store,r=i.pop();t.DEBUG&&console.log(e.step,"RS",r);var o=n&&n[r]||0;i.push(o)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"WCVTP",n,r),e.cvt[r]=n/64},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"RCVT",n),i.push(64*e.cvt[n])},Ti.bind(void 0,0),Ti.bind(void 0,1),void 0,Pi.bind(void 0,0),Pi.bind(void 0,1),function(e){t.DEBUG&&console.log(e.step,"MPPEM[]"),e.stack.push(e.ppem)},void 0,function(e){t.DEBUG&&console.log(e.step,"FLIPON[]"),e.autoFlip=!0},void 0,void 0,function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"LT[]",n,r),i.push(r<n?1:0)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"LTEQ[]",n,r),i.push(r<=n?1:0)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"GT[]",n,r),i.push(n<r?1:0)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"GTEQ[]",n,r),i.push(n<=r?1:0)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"EQ[]",n,r),i.push(n===r?1:0)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"NEQ[]",n,r),i.push(n!==r?1:0)},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"ODD[]",n),i.push(Math.trunc(n)%2?1:0)},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"EVEN[]",n),i.push(Math.trunc(n)%2?0:1)},function(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"IF[]",i),i||(hi(e,!0),t.DEBUG&&console.log(e.step,"EIF[]"))},function(e){t.DEBUG&&console.log(e.step,"EIF[]")},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"AND[]",n,r),i.push(n&&r?1:0)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"OR[]",n,r),i.push(n||r?1:0)},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"NOT[]",n),i.push(n?0:1)},Ii.bind(void 0,1),function(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SDB[]",i),e.deltaBase=i},function(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SDS[]",i),e.deltaShift=Math.pow(.5,i)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"ADD[]",n,r),i.push(r+n)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"SUB[]",n,r),i.push(r-n)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"DIV[]",n,r),i.push(64*r/n)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"MUL[]",n,r),i.push(r*n/64)},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"ABS[]",n),i.push(Math.abs(n))},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"NEG[]",n),i.push(-n)},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"FLOOR[]",n),i.push(64*Math.floor(n/64))},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"CEILING[]",n),i.push(64*Math.ceil(n/64))},Ai.bind(void 0,0),Ai.bind(void 0,1),Ai.bind(void 0,2),Ai.bind(void 0,3),void 0,void 0,void 0,void 0,function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"WCVTF[]",n,r),e.cvt[r]=n*e.ppem/e.font.unitsPerEm},Ii.bind(void 0,2),Ii.bind(void 0,3),Ri.bind(void 0,1),Ri.bind(void 0,2),Ri.bind(void 0,3),function(e){var i,n=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SROUND[]",n),e.round=ni,192&n){case 0:i=.5;break;case 64:i=1;break;case 128:i=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=i,48&n){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*i;break;case 32:e.srPhase=.5*i;break;case 48:e.srPhase=.75*i;break;default:throw new Error("invalid SROUND value")}n&=15,e.srThreshold=0===n?0:(n/8-.5)*i},function(e){var i,n=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"S45ROUND[]",n),e.round=ni,192&n){case 0:i=Math.sqrt(2)/2;break;case 64:i=Math.sqrt(2);break;case 128:i=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=i,48&n){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*i;break;case 32:e.srPhase=.5*i;break;case 48:e.srPhase=.75*i;break;default:throw new Error("invalid S45ROUND value")}n&=15,e.srThreshold=0===n?0:(n/8-.5)*i},void 0,void 0,function(e){t.DEBUG&&console.log(e.step,"ROFF[]"),e.round=Xt},void 0,function(e){t.DEBUG&&console.log(e.step,"RUTG[]"),e.round=ti},function(e){t.DEBUG&&console.log(e.step,"RDTG[]"),e.round=ii},bi,bi,void 0,void 0,void 0,void 0,void 0,function(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SCANCTRL[]",i)},Oi.bind(void 0,0),Oi.bind(void 0,1),function(e){var i=e.stack,n=i.pop(),r=0;t.DEBUG&&console.log(e.step,"GETINFO[]",n),1&n&&(r=35),32&n&&(r|=4096),i.push(r)},void 0,function(e){var i=e.stack,n=i.pop(),r=i.pop(),o=i.pop();t.DEBUG&&console.log(e.step,"ROLL[]"),i.push(r),i.push(n),i.push(o)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"MAX[]",n,r),i.push(Math.max(r,n))},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"MIN[]",n,r),i.push(Math.min(r,n))},function(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SCANTYPE[]",i)},function(e){var i=e.stack.pop(),n=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"INSTCTRL[]",i,n),i){case 1:return void(e.inhibitGridFit=!!n);case 2:return void(e.ignoreCvt=!!n);default:throw new Error("invalid INSTCTRL[] selector")}},void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,Ni.bind(void 0,1),Ni.bind(void 0,2),Ni.bind(void 0,3),Ni.bind(void 0,4),Ni.bind(void 0,5),Ni.bind(void 0,6),Ni.bind(void 0,7),Ni.bind(void 0,8),Di.bind(void 0,1),Di.bind(void 0,2),Di.bind(void 0,3),Di.bind(void 0,4),Di.bind(void 0,5),Di.bind(void 0,6),Di.bind(void 0,7),Di.bind(void 0,8),Li.bind(void 0,0,0,0,0,0),Li.bind(void 0,0,0,0,0,1),Li.bind(void 0,0,0,0,0,2),Li.bind(void 0,0,0,0,0,3),Li.bind(void 0,0,0,0,1,0),Li.bind(void 0,0,0,0,1,1),Li.bind(void 0,0,0,0,1,2),Li.bind(void 0,0,0,0,1,3),Li.bind(void 0,0,0,1,0,0),Li.bind(void 0,0,0,1,0,1),Li.bind(void 0,0,0,1,0,2),Li.bind(void 0,0,0,1,0,3),Li.bind(void 0,0,0,1,1,0),Li.bind(void 0,0,0,1,1,1),Li.bind(void 0,0,0,1,1,2),Li.bind(void 0,0,0,1,1,3),Li.bind(void 0,0,1,0,0,0),Li.bind(void 0,0,1,0,0,1),Li.bind(void 0,0,1,0,0,2),Li.bind(void 0,0,1,0,0,3),Li.bind(void 0,0,1,0,1,0),Li.bind(void 0,0,1,0,1,1),Li.bind(void 0,0,1,0,1,2),Li.bind(void 0,0,1,0,1,3),Li.bind(void 0,0,1,1,0,0),Li.bind(void 0,0,1,1,0,1),Li.bind(void 0,0,1,1,0,2),Li.bind(void 0,0,1,1,0,3),Li.bind(void 0,0,1,1,1,0),Li.bind(void 0,0,1,1,1,1),Li.bind(void 0,0,1,1,1,2),Li.bind(void 0,0,1,1,1,3),Li.bind(void 0,1,0,0,0,0),Li.bind(void 0,1,0,0,0,1),Li.bind(void 0,1,0,0,0,2),Li.bind(void 0,1,0,0,0,3),Li.bind(void 0,1,0,0,1,0),Li.bind(void 0,1,0,0,1,1),Li.bind(void 0,1,0,0,1,2),Li.bind(void 0,1,0,0,1,3),Li.bind(void 0,1,0,1,0,0),Li.bind(void 0,1,0,1,0,1),Li.bind(void 0,1,0,1,0,2),Li.bind(void 0,1,0,1,0,3),Li.bind(void 0,1,0,1,1,0),Li.bind(void 0,1,0,1,1,1),Li.bind(void 0,1,0,1,1,2),Li.bind(void 0,1,0,1,1,3),Li.bind(void 0,1,1,0,0,0),Li.bind(void 0,1,1,0,0,1),Li.bind(void 0,1,1,0,0,2),Li.bind(void 0,1,1,0,0,3),Li.bind(void 0,1,1,0,1,0),Li.bind(void 0,1,1,0,1,1),Li.bind(void 0,1,1,0,1,2),Li.bind(void 0,1,1,0,1,3),Li.bind(void 0,1,1,1,0,0),Li.bind(void 0,1,1,1,0,1),Li.bind(void 0,1,1,1,0,2),Li.bind(void 0,1,1,1,0,3),Li.bind(void 0,1,1,1,1,0),Li.bind(void 0,1,1,1,1,1),Li.bind(void 0,1,1,1,1,2),Li.bind(void 0,1,1,1,1,3)],Mi.prototype.setState=function(e,t){return this.state[e]=t,this.activeState={key:e,value:this.state[e]},this.activeState},Mi.prototype.getState=function(e){return this.state[e]||null},zi.prototype.inboundIndex=function(e){return 0<=e&&e<this.tokens.length},zi.prototype.composeRUD=function(e){var t=this,i=e.map((function(e){return t[e[0]].apply(t,e.slice(1).concat(!0))})),n=function(e){return"object"==typeof e&&e.hasOwnProperty("FAIL")};if(i.every(n))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:i.filter(n)};this.dispatch("composeRUD",[i.filter((function(e){return!n(e)}))])},zi.prototype.replaceRange=function(e,t,i,n){t=null!==t?t:this.tokens.length;var r=i.every((function(e){return e instanceof Mi}));if(!isNaN(e)&&this.inboundIndex(e)&&r){var o=this.tokens.splice.apply(this.tokens,[e,t].concat(i));return n||this.dispatch("replaceToken",[e,t,i]),[o,i]}return{FAIL:"replaceRange: invalid tokens or startIndex."}},zi.prototype.replaceToken=function(e,t,i){if(!isNaN(e)&&this.inboundIndex(e)&&t instanceof Mi){var n=this.tokens.splice(e,1,t);return i||this.dispatch("replaceToken",[e,t]),[n[0],t]}return{FAIL:"replaceToken: invalid token or index."}},zi.prototype.removeRange=function(e,t,i){t=isNaN(t)?this.tokens.length:t;var n=this.tokens.splice(e,t);return i||this.dispatch("removeRange",[n,e,t]),n},zi.prototype.removeToken=function(e,t){if(isNaN(e)||!this.inboundIndex(e))return{FAIL:"removeToken: invalid token index."};var i=this.tokens.splice(e,1);return t||this.dispatch("removeToken",[i,e]),i},zi.prototype.insertToken=function(e,t,i){return e.every((function(e){return e instanceof Mi}))?(this.tokens.splice.apply(this.tokens,[t,0].concat(e)),i||this.dispatch("insertToken",[e,t]),e):{FAIL:"insertToken: invalid token(s)."}},zi.prototype.registerModifier=function(e,t,i){this.events.newToken.subscribe((function(n,r){var o=[n,r],a=[n,r];if(null===t||!0===t.apply(this,o)){var s=i.apply(this,a);n.setState(e,s)}})),this.registeredModifiers.push(e)},Ui.prototype.subscribe=function(e){return"function"==typeof e?this.subscribers.push(e)-1:{FAIL:"invalid '"+this.eventId+"' event handler"}},Ui.prototype.unsubscribe=function(e){this.subscribers.splice(e,1)},Vi.prototype.setCurrentIndex=function(e){this.index=e,this.current=this.context[e],this.backtrack=this.context.slice(0,e),this.lookahead=this.context.slice(e+1)},Vi.prototype.get=function(e){switch(!0){case 0===e:return this.current;case e<0&&Math.abs(e)<=this.backtrack.length:return this.backtrack.slice(e)[0];case 0<e&&e<=this.lookahead.length:return this.lookahead[e-1];default:return null}},zi.prototype.rangeToText=function(e){if(e instanceof Bi)return this.getRangeTokens(e).map((function(e){return e.char})).join("")},zi.prototype.getText=function(){return this.tokens.map((function(e){return e.char})).join("")},zi.prototype.getContext=function(e){return this.registeredContexts[e]||null},zi.prototype.on=function(e,t){var i=this.events[e];return i?i.subscribe(t):null},zi.prototype.dispatch=function(e,t){var i=this,n=this.events[e];n instanceof Ui&&n.subscribers.forEach((function(e){e.apply(i,t||[])}))},zi.prototype.registerContextChecker=function(e,t,i){if(this.getContext(e))return{FAIL:"context name '"+e+"' is already registered."};if("function"!=typeof t)return{FAIL:"missing context start check."};if("function"!=typeof i)return{FAIL:"missing context end check."};var n=new Fi(e,t,i);return this.registeredContexts[e]=n,this.contextCheckers.push(n),n},zi.prototype.getRangeTokens=function(e){var t=e.startIndex+e.endOffset;return[].concat(this.tokens.slice(e.startIndex,t))},zi.prototype.getContextRanges=function(e){var t=this.getContext(e);return t?t.ranges:{FAIL:"context checker '"+e+"' is not registered."}},zi.prototype.resetContextsRanges=function(){var e=this.registeredContexts;for(var t in e)e.hasOwnProperty(t)&&(e[t].ranges=[])},zi.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var e=this.tokens.map((function(e){return e.char})),t=0;t<e.length;t++){var i=new Vi(e,t);this.runContextCheck(i)}this.dispatch("updateContextsRanges",[this.registeredContexts])},zi.prototype.setEndOffset=function(e,t){var i=new Bi(this.getContext(t).openRange.startIndex,e,t),n=this.getContext(t).ranges;return i.rangeId=t+"."+n.length,n.push(i),this.getContext(t).openRange=null,i},zi.prototype.runContextCheck=function(e){var t=this,i=e.index;this.contextCheckers.forEach((function(n){var r=n.contextName,o=t.getContext(r).openRange;if(!o&&n.checkStart(e)&&(o=new Bi(i,null,r),t.getContext(r).openRange=o,t.dispatch("contextStart",[r,i])),o&&n.checkEnd(e)){var a=i-o.startIndex+1,s=t.setEndOffset(a,r);t.dispatch("contextEnd",[r,s])}}))},zi.prototype.tokenize=function(e){this.tokens=[],this.resetContextsRanges();var t=Array.from(e);this.dispatch("start");for(var i=0;i<t.length;i++){var n=t[i],r=new Vi(t,i);this.dispatch("next",[r]),this.runContextCheck(r);var o=new Mi(n);this.tokens.push(o),this.dispatch("newToken",[o,r])}return this.dispatch("end",[this.tokens]),this.tokens};var $i={arabicWordStartCheck:function(e){var t=e.current,i=e.get(-1);return null===i&&Hi(t)||!Hi(i)&&Hi(t)},arabicWordEndCheck:function(e){var t=e.get(1);return null===t||!Hi(t)}},Wi={arabicSentenceStartCheck:function(e){var t=e.current,i=e.get(-1);return(Hi(t)||qi(t))&&!Hi(i)},arabicSentenceEndCheck:function(e){var t=e.get(1);switch(!0){case null===t:return!0;case!Hi(t)&&!qi(t):var i=/\s/.test(t);if(!i)return!0;if(i&&!e.lookahead.some((function(e){return Hi(e)||qi(e)})))return!0;break;default:return!1}}};function Gi(e){var t=this.features.arab,i=this.tokenizer.getRangeTokens(e);if(1!==i.length){var n=function(e,i,n){if(t.hasOwnProperty(e)){var r,o=(r=t[e].lookup(n)||null,1===r.length&&12===r[0].id&&r[0].substitution)[0];return 0<=o?i.setState(e,o):void 0}},r=new Vi(i,0),o=new Vi(i.map((function(e){return e.char})),0);i.forEach((function(e,t){if(!qi(e.char)){r.setCurrentIndex(t),o.setCurrentIndex(t);var i=0;switch(function(e){for(var t=[].concat(e.backtrack),i=t.length-1;0<=i;i--){var n=t[i],r=ji(n),o=qi(n);if(!r&&!o)return!0;if(r)return!1}return!1}(o)&&(i|=1),function(e){if(ji(e.current))return!1;for(var t=0;t<e.lookahead.length;t++)if(!qi(e.lookahead[t]))return!0;return!1}(o)&&(i|=2),i){case 0:return;case 1:n("fina",e,r);break;case 2:n("init",e,r);break;case 3:n("medi",e,r)}}}))}}function Ki(e){this.baseDir=e||"ltr",this.tokenizer=new zi,this.features=[]}function Yi(){if(-1===this.tokenizer.registeredModifiers.indexOf("glyphIndex"))throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function Ji(){var e=this;this.features.hasOwnProperty("arab")&&this.features.arab.hasOwnProperty("rlig")&&(Yi.call(this),this.tokenizer.getContextRanges("arabicWord").forEach((function(t){(function(e){var t=this.features.arab;if(t.hasOwnProperty("rlig"))for(var i=this.tokenizer.getRangeTokens(e),n=0;n<i.length;n++){var r=new Vi(i,n),o=t.rlig.lookup(r)||null,a=1===o.length&&63===o[0].id&&o[0].substitution,s=1===o.length&&41===o[0].id&&o[0].substitution[0],l=i[n];if(s){l.setState("rlig",[s.ligGlyph]);for(var c=0;c<s.components.length;c++){var d=s.components[c],u=r.get(c+1);u.activeState.value===d&&(u.state.deleted=!0)}}else if(a){var p=a&&1===a.length&&12===a[0].id&&a[0].substitution;p&&0<=p&&l.setState("rlig",p)}}}).call(e,t)})))}Ki.prototype.setText=function(e){this.text=e},Ki.prototype.contextChecks={arabicWordCheck:$i,arabicSentenceCheck:Wi},Ki.prototype.subscribeArabicForms=function(e){var t=this;this.tokenizer.events.contextEnd.subscribe((function(i,n){if("arabicWord"===i)return Gi.call(t.tokenizer,n,e)}))},Ki.prototype.applyFeatures=function(e){for(var t=0;t<e.length;t++){var i=e[t];if(i){var n=i.script;this.features[n]||(this.features[n]={}),this.features[n][i.tag]=i}}},Ki.prototype.registerModifier=function(e,t,i){this.tokenizer.registerModifier(e,t,i)},Ki.prototype.processText=function(e){this.text&&this.text===e||(this.setText(e),function(){return function(){var e=this.contextChecks.arabicWordCheck;return this.tokenizer.registerContextChecker("arabicWord",e.arabicWordStartCheck,e.arabicWordEndCheck)}.call(this),function(){var e=this.contextChecks.arabicSentenceCheck;return this.tokenizer.registerContextChecker("arabicSentence",e.arabicSentenceStartCheck,e.arabicSentenceEndCheck)}.call(this),this.tokenizer.tokenize(this.text)}.call(this),function(){var e=this;this.features.hasOwnProperty("arab")&&(Yi.call(this),this.tokenizer.getContextRanges("arabicWord").forEach((function(t){Gi.call(e,t)})))}.call(this),Ji.call(this),function(){var e=this;this.tokenizer.getContextRanges("arabicSentence").forEach((function(t){var i=e.tokenizer.getRangeTokens(t);e.tokenizer.replaceRange(t.startIndex,t.endOffset,i.reverse())}))}.call(this))},Ki.prototype.getBidiText=function(e){return this.processText(e),this.tokenizer.getText()},Ki.prototype.getTextGlyphs=function(e){this.processText(e);for(var t=[],i=0;i<this.tokenizer.tokens.length;i++){var n=this.tokenizer.tokens[i];if(!n.state.deleted){var r=n.activeState.value;t.push(Array.isArray(r)?r[0]:r)}}return t};var Xi="ltr";function Qi(e,t){this.font=e,this.features={},Xi=t||Xi}function Zi(e,t,i,n){this.tag=e,this.featureRef=t,this.lookups=i.lookups,this.script=n}function en(e){this.table=e}function tn(e){this.ligatureSets=e}function nn(e,t,i){this.lookups=e,this.subtable=i,this.lookupTable=t,i.hasOwnProperty("coverage")&&(this.coverage=new en(i.coverage)),i.hasOwnProperty("inputCoverage")&&(this.inputCoverage=i.inputCoverage.map((function(e){return new en(e)}))),i.hasOwnProperty("backtrackCoverage")&&(this.backtrackCoverage=i.backtrackCoverage.map((function(e){return new en(e)}))),i.hasOwnProperty("lookaheadCoverage")&&(this.lookaheadCoverage=i.lookaheadCoverage.map((function(e){return new en(e)}))),i.hasOwnProperty("ligatureSets")&&(this.ligatureSets=new tn(i.ligatureSets))}function rn(e,t){this.index=e,this.subtables=t[e].subtables.map((function(i){return new nn(t,t[e],i)}))}function on(e,t){this.lookups=t.map((function(t){return new rn(t,e)}))}function an(e,t){for(var i=[],n=0;n<e.length;n++){var r=e[n],o=t.current.activeState.value;o=Array.isArray(o)?o[0]:o;var a=r.lookup(o);-1!==a&&i.push(a)}return i.length!==e.length?-1:i}function sn(e){(e=e||{}).empty||(Vt(e.familyName,"When creating a new Font object, familyName is required."),Vt(e.styleName,"When creating a new Font object, styleName is required."),Vt(e.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Vt(e.ascender,"When creating a new Font object, ascender is required."),Vt(e.descender,"When creating a new Font object, descender is required."),Vt(e.descender<0,"Descender should be negative (e.g. -512)."),this.names={fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||(e.familyName+e.styleName).replace(/\s/g,"")},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}},this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.tables={os2:{usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,fsSelection:e.fsSelection||this.fsSelectionValues.REGULAR}}),this.supported=!0,this.glyphs=new Se.GlyphSet(this,e.glyphs||[]),this.encoding=new he(this),this.position=new Dt(this),this.substitution=new Lt(this),this.tables=this.tables||{},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:"truetype"===this.outlinesFormat?this._hinting=new Jt(this):void 0}})}function ln(e,t,i,n){var r={},o=new ae.Parser(e,t);r.name=n[o.parseUShort()]||{},o.skip("uShort",1),r.coordinates={};for(var a=0;a<i.length;++a)r.coordinates[i[a].tag]=o.parseFixed();return r}tn.prototype.lookup=function(e,t){for(var i=this.ligatureSets[t],n=function(e,t){if(e.length>t.length)return null;for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},r=0;r<i.length;r++){var o=i[r],a=e.lookahead.map((function(e){return e.activeState.value}));if("rtl"===Xi&&a.reverse(),n(o.components,a))return o}return null},rn.prototype.lookup=function(e){for(var t=[],i=0;i<this.subtables.length;i++){var n=this.subtables[i].lookup(e);(null!==n||n.length)&&(t=t.concat(n))}return t},nn.prototype.lookup=function(e){var t=[],i=this.lookupTable.lookupType,n=this.subtable.substFormat;if(1===i&&2===n){var r=function(e){var t=e.current.activeState.value;t=Array.isArray(t)?t[0]:t;var i=this.coverage.lookup(t);return-1===i?[]:[this.subtable.substitute[i]]}.call(this,e);0<r.length&&t.push({id:12,substitution:r})}if(6===i&&3===n){var o=function(e){var t=this.inputCoverage.length+this.lookaheadCoverage.length+this.backtrackCoverage.length;if(e.context.length<t)return[];var i=an(this.inputCoverage,e);if(-1===i)return[];var n=this.inputCoverage.length-1;if(e.lookahead.length<this.lookaheadCoverage.length)return[];for(var r=e.lookahead.slice(n);r.length&&qi(r[0].char);)r.shift();var o=new Vi(r,0),a=an(this.lookaheadCoverage,o),s=[].concat(e.backtrack);for(s.reverse();s.length&&qi(s[0].char);)s.shift();if(s.length<this.backtrackCoverage.length)return[];var l=new Vi(s,0),c=an(this.backtrackCoverage,l),d=[];if(i.length===this.inputCoverage.length&&a.length===this.lookaheadCoverage.length&&c.length===this.backtrackCoverage.length)for(var u=this.subtable.lookupRecords,p=0;p<u.length;p++)for(var h=u[p],f=0;f<i.length;f++){var m=new Vi([e.get(f)],0),g=new rn(h.lookupListIndex,this.lookups).lookup(m);d=d.concat(g)}return d}.call(this,e);0<o.length&&t.push({id:63,substitution:o})}if(4===i&&1===n){var a=function(e){var t=e.current.activeState.value,i=this.coverage.lookup(t);if(-1===i)return[];var n=this.ligatureSets.lookup(e,i);return n?[n]:[]}.call(this,e);0<a.length&&t.push({id:41,substitution:a})}return t},en.prototype.lookup=function(e){if(!e)return-1;switch(this.table.format){case 1:return this.table.glyphs.indexOf(e);case 2:for(var t=this.table.ranges,i=0;i<t.length;i++){var n=t[i];if(e>=n.start&&e<=n.end){var r=e-n.start;return n.index+r}}break;default:return-1}return-1},Zi.prototype.lookup=function(e){for(var t=[],i=0;i<this.lookups.length;i++){var n=this.lookups[i].lookup(e);(null!==n||n.length)&&(t=t.concat(n))}return t},Qi.prototype.getScriptFeaturesIndexes=function(e){if(!e)return[];if(!this.font.tables.gsub)return[];for(var t=this.font.tables.gsub.scripts,i=0;i<t.length;i++){var n=t[i];if(n.tag===e)return n.script.defaultLangSys.featureIndexes;var r=n.langSysRecords;if(r)for(var o=0;o<r.length;o++){var a=r[o];if(a.tag===e)return a.langSys.featureIndexes}}return[]},Qi.prototype.mapTagsToFeatures=function(e,t){for(var i={},n=0;n<e.length;n++){var r=e[n].feature,o=e[n].tag,a=new on(this.font.tables.gsub.lookups,r.lookupListIndexes);i[o]=new Zi(o,r,a,t)}this.features[t].tags=i},Qi.prototype.getScriptFeatures=function(e){var t=this.features[e];if(this.features.hasOwnProperty(e))return t;var i=this.getScriptFeaturesIndexes(e);if(!i)return null;var n=this.font.tables.gsub;return t=i.map((function(e){return n.features[e]})),this.features[e]=t,this.mapTagsToFeatures(t,e),t},Qi.prototype.getFeature=function(e){return this.font?(this.features.hasOwnProperty(e.script)||this.getScriptFeatures(e.script),this.features[e.script].tags[e.tag]||null):{FAIL:"No font was found"}},sn.prototype.hasChar=function(e){return null!==this.encoding.charToGlyphIndex(e)},sn.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},sn.prototype.charToGlyph=function(e){var t=this.charToGlyphIndex(e),i=this.glyphs.get(t);return i||(i=this.glyphs.get(0)),i},sn.prototype.stringToGlyphs=function(e,t){var i=this;t=t||this.defaultRenderOptions;var n=new Ki;n.registerModifier("glyphIndex",null,(function(e){return i.charToGlyphIndex(e.char)}));var r=new Qi(this);n.applyFeatures(["init","medi","fina","rlig"].map((function(e){var t={tag:e,script:"arab"},i=r.getFeature(t);if(i)return i})));var o=n.getTextGlyphs(e),a=o.length;if(t.features){var s=t.script||this.substitution.getDefaultScriptName(),l=[];t.features.liga&&(l=l.concat(this.substitution.getFeature("liga",s,t.language))),t.features.rlig&&(l=l.concat(this.substitution.getFeature("rlig",s,t.language)));for(var c=0;c<a;c+=1)for(var d=0;d<l.length;d++){for(var u=l[d],p=u.sub,h=p.length,f=0;f<h&&p[f]===o[c+f];)f++;f===h&&(o.splice(c,h,u.by),a=a-h+1)}}for(var m=new Array(a),g=this.glyphs.get(0),v=0;v<a;v+=1)m[v]=i.glyphs.get(o[v])||g;return m},sn.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},sn.prototype.nameToGlyph=function(e){var t=this.nameToGlyphIndex(e),i=this.glyphs.get(t);return i||(i=this.glyphs.get(0)),i},sn.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""},sn.prototype.getKerningValue=function(e,t){e=e.index||e,t=t.index||t;var i=this.position.defaultKerningTables;return i?this.position.getKerningValue(i,e,t):this.kerningPairs[e+","+t]||0},sn.prototype.defaultRenderOptions={kerning:!0,features:{liga:!0,rlig:!0}},sn.prototype.forEachGlyph=function(e,t,i,n,r,o){t=void 0!==t?t:0,i=void 0!==i?i:0,n=void 0!==n?n:72,r=r||this.defaultRenderOptions;var a,s=1/this.unitsPerEm*n,l=this.stringToGlyphs(e,r);if(r.kerning){var c=r.script||this.position.getDefaultScriptName();a=this.position.getKerningTables(c,r.language)}for(var d=0;d<l.length;d+=1){var u=l[d];o.call(this,u,t,i,n,r),u.advanceWidth&&(t+=u.advanceWidth*s),r.kerning&&d<l.length-1&&(t+=(a?this.position.getKerningValue(a,u.index,l[d+1].index):this.getKerningValue(u,l[d+1]))*s),r.letterSpacing?t+=r.letterSpacing*n:r.tracking&&(t+=r.tracking/1e3*n)}return t},sn.prototype.getPath=function(e,t,i,n,r){var o=new T;return this.forEachGlyph(e,t,i,n,r,(function(e,t,i,n){var a=e.getPath(t,i,n,r,this);o.extend(a)})),o},sn.prototype.getPaths=function(e,t,i,n,r){var o=[];return this.forEachGlyph(e,t,i,n,r,(function(e,t,i,n){var a=e.getPath(t,i,n,r,this);o.push(a)})),o},sn.prototype.getAdvanceWidth=function(e,t,i){return this.forEachGlyph(e,0,0,t,i,(function(){}))},sn.prototype.draw=function(e,t,i,n,r,o){this.getPath(t,i,n,r,o).draw(e)},sn.prototype.drawPoints=function(e,t,i,n,r,o){this.forEachGlyph(t,i,n,r,o,(function(t,i,n,r){t.drawPoints(e,i,n,r)}))},sn.prototype.drawMetrics=function(e,t,i,n,r,o){this.forEachGlyph(t,i,n,r,o,(function(t,i,n,r){t.drawMetrics(e,i,n,r)}))},sn.prototype.getEnglishName=function(e){var t=this.names[e];if(t)return t.en},sn.prototype.validate=function(){var e=this;function t(t){var i=e.getEnglishName(t);i&&i.trim().length}t("fontFamily"),t("weightName"),t("manufacturer"),t("copyright"),t("version"),this.unitsPerEm},sn.prototype.toTables=function(){return It(this)},sn.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},sn.prototype.toArrayBuffer=function(){for(var e=this.toTables().encode(),t=new ArrayBuffer(e.length),i=new Uint8Array(t),n=0;n<e.length;n++)i[n]=e[n];return t},sn.prototype.download=function(t){var n=this.getEnglishName("fontFamily"),r=this.getEnglishName("fontSubfamily");t=t||n.replace(/\s/g,"")+"-"+r+".otf";var o=this.toArrayBuffer();if("undefined"!=typeof window)if(window.URL=window.URL||window.webkitURL,window.URL){var a=new DataView(o),s=new Blob([a],{type:"font/opentype"}),l=document.createElement("a");l.href=window.URL.createObjectURL(s),l.download=t;var c=document.createEvent("MouseEvents");c.initEvent("click",!0,!1),l.dispatchEvent(c)}else console.warn("Font file could not be downloaded. Try using a different browser.");else{var d=i(270),u=function(t){for(var i=new e(t.byteLength),n=new Uint8Array(t),r=0;r<i.length;++r)i[r]=n[r];return i}(o);d.writeFileSync(t,u)}},sn.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},sn.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9},sn.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};var cn=function(e,t,i){var n=new ae.Parser(e,t),r=n.parseULong();A.argument(65536===r,"Unsupported fvar table version.");var o=n.parseOffset16();n.skip("uShort",1);for(var a,s,l,c,d,u=n.parseUShort(),p=n.parseUShort(),h=n.parseUShort(),f=n.parseUShort(),m=[],g=0;g<u;g++)m.push((a=e,s=t+o+g*p,l=i,d=c=void 0,c={},d=new ae.Parser(a,s),c.tag=d.parseTag(),c.minValue=d.parseFixed(),c.defaultValue=d.parseFixed(),c.maxValue=d.parseFixed(),d.skip("uShort",1),c.name=l[d.parseUShort()]||{},c));for(var v=[],y=t+o+u*p,b=0;b<h;b++)v.push(ln(e,y+b*f,m,i));return{axes:m,instances:v}},dn=new Array(10);dn[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{posFormat:1,coverage:this.parsePointer(re.coverage),value:this.parseValueRecord()}:2===t?{posFormat:2,coverage:this.parsePointer(re.coverage),values:this.parseValueRecordList()}:void A.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},dn[2]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();A.assert(1===t||2===t,"0x"+e.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");var i=this.parsePointer(re.coverage),n=this.parseUShort(),r=this.parseUShort();if(1===t)return{posFormat:t,coverage:i,valueFormat1:n,valueFormat2:r,pairSets:this.parseList(re.pointer(re.list((function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(n),value2:this.parseValueRecord(r)}}))))};if(2===t){var o=this.parsePointer(re.classDef),a=this.parsePointer(re.classDef),s=this.parseUShort(),l=this.parseUShort();return{posFormat:t,coverage:i,valueFormat1:n,valueFormat2:r,classDef1:o,classDef2:a,class1Count:s,class2Count:l,classRecords:this.parseList(s,re.list(l,(function(){return{value1:this.parseValueRecord(n),value2:this.parseValueRecord(r)}})))}}},dn[3]=function(){return{error:"GPOS Lookup 3 not supported"}},dn[4]=function(){return{error:"GPOS Lookup 4 not supported"}},dn[5]=function(){return{error:"GPOS Lookup 5 not supported"}},dn[6]=function(){return{error:"GPOS Lookup 6 not supported"}},dn[7]=function(){return{error:"GPOS Lookup 7 not supported"}},dn[8]=function(){return{error:"GPOS Lookup 8 not supported"}},dn[9]=function(){return{error:"GPOS Lookup 9 not supported"}},new Array(10);var un=function(e,t){var i=new re(e,t=t||0),n=i.parseVersion(1);return A.argument(1===n||1.1===n,"Unsupported GPOS table version "+n),1===n?{version:n,scripts:i.parseScriptList(),features:i.parseFeatureList(),lookups:i.parseLookupList(dn)}:{version:n,scripts:i.parseScriptList(),features:i.parseFeatureList(),lookups:i.parseLookupList(dn),variations:i.parseFeatureVariationsList()}},pn=function(e,t){var i=new ae.Parser(e,t),n=i.parseUShort();if(0===n)return function(e){var t={};e.skip("uShort");var i=e.parseUShort();A.argument(0===i,"Unsupported kern sub-table version."),e.skip("uShort",2);var n=e.parseUShort();e.skip("uShort",3);for(var r=0;r<n;r+=1){var o=e.parseUShort(),a=e.parseUShort(),s=e.parseShort();t[o+","+a]=s}return t}(i);if(1===n)return function(e){var t={};e.skip("uShort"),1<e.parseULong()&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");var i=255&e.parseUShort();if(e.skip("uShort"),0===i){var n=e.parseUShort();e.skip("uShort",3);for(var r=0;r<n;r+=1){var o=e.parseUShort(),a=e.parseUShort(),s=e.parseShort();t[o+","+a]=s}}return t}(i);throw new Error("Unsupported kern table version ("+n+").")},hn=function(e,t,i,n){for(var r=new ae.Parser(e,t),o=n?r.parseUShort:r.parseULong,a=[],s=0;s<i+1;s+=1){var l=o.call(r);n&&(l*=2),a.push(l)}return a};function fn(e,t){i(270).readFile(e,(function(e,i){if(e)return t(e.message);t(null,Ft(i))}))}function mn(e,t){var i=new XMLHttpRequest;i.open("get",e,!0),i.responseType="arraybuffer",i.onload=function(){return i.response?t(null,i.response):t("Font could not be loaded: "+i.statusText)},i.onerror=function(){t("Font could not be loaded")},i.send()}function gn(e,t){for(var i=[],n=12,r=0;r<t;r+=1){var o=ae.getTag(e,n),a=ae.getULong(e,n+4),s=ae.getULong(e,n+8),l=ae.getULong(e,n+12);i.push({tag:o,checksum:a,offset:s,length:l,compression:!1}),n+=16}return i}function vn(e,t){if("WOFF"!==t.compression)return{data:e,offset:t.offset};var i=new Uint8Array(e.buffer,t.offset+2,t.compressedLength-2),n=new Uint8Array(t.length);if(function(e,t){var i,n,r=new a(e,t);do{switch(i=b(r),w(r,2,0)){case 0:n=x(r);break;case 1:n=k(r,s,l);break;case 2:C(r,r.ltree,r.dtree),n=k(r,r.ltree,r.dtree);break;default:n=-3}if(0!==n)throw new Error("Data error")}while(!i);r.destLen<r.dest.length?"function"==typeof r.dest.slice?r.dest.slice(0,r.destLen):r.dest.subarray(0,r.destLen):r.dest}(i,n),n.byteLength!==t.length)throw new Error("Decompression error: "+t.tag+" decompressed length doesn't match recorded length");return{data:new DataView(n.buffer,0),offset:0}}function yn(e){var t,i,n,r,o,a,s,l,c,d,u,p,h,f,m=new sn({empty:!0}),g=new DataView(e,0),v=[],y=ae.getTag(g,0);if(y===String.fromCharCode(0,1,0,0)||"true"===y||"typ1"===y)m.outlinesFormat="truetype",v=gn(g,n=ae.getUShort(g,4));else if("OTTO"===y)m.outlinesFormat="cff",v=gn(g,n=ae.getUShort(g,4));else{if("wOFF"!==y)throw new Error("Unsupported OpenType signature "+y);var b=ae.getTag(g,4);if(b===String.fromCharCode(0,1,0,0))m.outlinesFormat="truetype";else{if("OTTO"!==b)throw new Error("Unsupported OpenType flavor "+y);m.outlinesFormat="cff"}v=function(e,t){for(var i=[],n=44,r=0;r<t;r+=1){var o,a=ae.getTag(e,n),s=ae.getULong(e,n+4),l=ae.getULong(e,n+8),c=ae.getULong(e,n+12);o=l<c&&"WOFF",i.push({tag:a,offset:s,compression:o,compressedLength:l,length:c}),n+=20}return i}(g,n=ae.getUShort(g,12))}for(var w=0;w<n;w+=1){var S=v[w],C=void 0;switch(S.tag){case"cmap":C=vn(g,S),m.tables.cmap=se(C.data,C.offset),m.encoding=new fe(m.tables.cmap);break;case"cvt ":C=vn(g,S),f=new ae.Parser(C.data,C.offset),m.tables.cvt=f.parseShortList(S.length/2);break;case"fvar":o=S;break;case"fpgm":C=vn(g,S),f=new ae.Parser(C.data,C.offset),m.tables.fpgm=f.parseByteList(S.length);break;case"head":C=vn(g,S),m.tables.head=ze(C.data,C.offset),m.unitsPerEm=m.tables.head.unitsPerEm,t=m.tables.head.indexToLocFormat;break;case"hhea":C=vn(g,S),m.tables.hhea=je(C.data,C.offset),m.ascender=m.tables.hhea.ascender,m.descender=m.tables.hhea.descender,m.numberOfHMetrics=m.tables.hhea.numberOfHMetrics;break;case"hmtx":c=S;break;case"ltag":C=vn(g,S),i=Ke(C.data,C.offset);break;case"maxp":C=vn(g,S),m.tables.maxp=Ye(C.data,C.offset),m.numGlyphs=m.tables.maxp.numGlyphs;break;case"name":p=S;break;case"OS/2":C=vn(g,S),m.tables.os2=pt(C.data,C.offset);break;case"post":C=vn(g,S),m.tables.post=mt(C.data,C.offset),m.glyphNames=new ge(m.tables.post);break;case"prep":C=vn(g,S),f=new ae.Parser(C.data,C.offset),m.tables.prep=f.parseByteList(S.length);break;case"glyf":a=S;break;case"loca":u=S;break;case"CFF ":r=S;break;case"kern":d=S;break;case"GPOS":s=S;break;case"GSUB":l=S;break;case"meta":h=S}}var k=vn(g,p);if(m.tables.name=ct(k.data,k.offset,i),m.names=m.tables.name,a&&u){var x=0===t,_=vn(g,u),E=hn(_.data,_.offset,m.numGlyphs,x),T=vn(g,a);m.glyphs=Yt.parse(T.data,T.offset,E,m)}else{if(!r)throw new Error("Font doesn't contain TrueType or CFF outlines.");var P=vn(g,r);Ve(P.data,P.offset,m)}var I=vn(g,c);if($e(I.data,I.offset,m.numberOfHMetrics,m.numGlyphs,m.glyphs),function(e){for(var t,i=e.tables.cmap.glyphIndexMap,n=Object.keys(i),r=0;r<n.length;r+=1){var o=n[r],a=i[o];(t=e.glyphs.get(a)).addUnicode(parseInt(o))}for(var s=0;s<e.glyphs.length;s+=1)t=e.glyphs.get(s),e.cffEncoding?e.isCIDFont?t.name="gid"+s:t.name=e.cffEncoding.charset[s]:e.glyphNames.names&&(t.name=e.glyphNames.glyphIndexToName(s))}(m),d){var A=vn(g,d);m.kerningPairs=pn(A.data,A.offset)}else m.kerningPairs={};if(s){var R=vn(g,s);m.tables.gpos=un(R.data,R.offset),m.position.init()}if(l){var O=vn(g,l);m.tables.gsub=wt(O.data,O.offset)}if(o){var N=vn(g,o);m.tables.fvar=cn(N.data,N.offset,m.names)}if(h){var D=vn(g,h);m.tables.meta=Ct(D.data,D.offset),m.metas=m.tables.meta}return m}t.Font=sn,t.Glyph=ye,t.Path=T,t.BoundingBox=E,t._parse=ae,t.parse=yn,t.load=function(e,t){("undefined"==typeof window?fn:mn)(e,(function(e,i){if(e)return t(e);var n;try{n=yn(i)}catch(e){return t(e,null)}return t(null,n)}))},t.loadSync=function(e){return yn(Ft(i(270).readFileSync(e)))},Object.defineProperty(t,"__esModule",{value:!0})}(t)}).call(this,i(142).Buffer)},function(e,t,i){var n,r;n=[i(16),i(17)],void 0===(r=function(e,t){return function(e){function t(e,t){return e.w('<div class="import-drive import-body-container hide" id="importVideoLibraryl"><div class="hv-header-library-wrapper"><div class="hv-header-action-wrapper"><div class="hv-videoCatFilter-wrapper hide" id="videoCatFilter"><div class="video-library-cat-label"><label> ').f(t.get(["categoryLable"],!1),t,"h").w(' </label></div><div class="video-library-cat-select"><select class="hide" id="videoCatList"><option value="0">All assets</option>').s(t.get(["categories"],!1),t,{block:i},{}).w('</select><select class="hide" id="testimonialCatList">').s(t.get(["testimonialcategories"],!1),t,{block:n},{}).w('</select></div></div>\x3c!-- <div class="hv-header-popup-wrapper"><span class="fetching-videos-loading hide"><div class="spinner-loading"></div><span class="loading-msg"> ').f(t.get(["loading"],!1),t,"h").w(' </span></span></div> --\x3e<div class="tag-filter"><div class="video-library-cat-label"><label> Tags </label></div><div id="libCategories"></div></div><div class="hv-videoLibrarySearch-container hide" style="margin-right: 15px;" id="videoLibrarySearch"><div class="hv-search-box-wrapper"><input class="no-margin" id="importVideoLibrarySearch" placeholder="').f(t.get(["searchNameAndTags"],!1),t,"h").w('" type="text"><div class="hv-search-icon-wrapper"><img class="" id="searchIcon" src="/img/search-icon.png"><img class="disp-none" id="clear-icon" src="/svg/dark-blue-cross-icon.svg"></div></div></div></div><div class="hv-content-type-container disp-none"><div class="hv-content-type-wrapper"><label>Content Type</label><div class="hv-content-type-tags selected" data-id="fetch_videos" id="content-type-videos">Videos</div><div class="hv-content-type-tags" data-id="fetch_images" id="content-type-images">Images</div><div class="hv-content-type-tags" data-id="fetch_documents" id="content-type-documents">Documents</div></div></div></div><div class="import-drive-container import-web-content image-gallery main-gallery custom-scroll" id="importVideoLibraryContainer"><div id="importVideoLibraryContent" class="import-images-container ').f(t.get(["totalVideos"],!1),t,"h").w(" ").f(t.get(["offset"],!1),t,"h").w('"></div><div class="import-library-spin-loading hide"><div class="spinner-loading"></div><span class="loading-msg"> ').f(t.get(["loading"],!1),t,"h").w(' </span></div><div id="importVideoLibrayEmptyState" class="web-search-empty text-center hide"><img src="/svg/empty-result.svg" alt="No results" class="empty-search-icon"/><div class="result-info"> ').f(t.get(["emptyResults"],!1),t,"h").w(' </div></div><span class="fetching-library-videos-loading hide"><div class="spinner-loading"></div><span class="loading-msg"> ').f(t.get(["loading"],!1),t,"h").w(' </span></span>\x3c!-- <div id="loadMoreLibraryVideo" class="text-right load-more hide"> ').f(t.get(["loadMore"],!1),t,"h").w(" </div> --\x3e</div></div>")}function i(e,t){return e.w('<option value="').f(t.get(["id"],!1),t,"h").w('">').f(t.get(["name"],!1),t,"h").w("</option>")}function n(e,t){return e.w('<option value="').f(t.get(["id"],!1),t,"h").w('">').f(t.get(["name"],!1),t,"h").w("</option>")}e.register("templates/partials/import_from_video_library",t),t.__dustBody=!0,i.__dustBody=!0,n.__dustBody=!0}(e),function(t,i){var n;return e.render("templates/partials/import_from_video_library",t,(function(e,t){if("function"==typeof i)try{i(e,t)}catch(e){}if(e)throw e;n=t})),n}}.apply(t,n))||(e.exports=r)},function(e,t,i){var n,r;n=[i(16),i(17)],void 0===(r=function(e,t){return function(e){function t(e,t){return e.s(t.get(["libraries"],!1),t,{block:i},{})}function i(e,t){return e.h("ne",t,{block:n},{key:t.get(["current_asset_id"],!1),value:t.get(["id"],!1)},"h")}function n(e,t){return e.h("ne",t,{block:r},{key:t.get(["asset_type"],!1),value:6},"h")}function r(e,t){return e.x(t.get(["media_id"],!1),t,{block:o},{})}function o(e,t){return e.w('<div class="image pull-left" ').h("eq",t,{else:a,block:c},{key:t.get(["asset_type"],!1),value:19},"h").w(' data-asset-details="').f(t.get(["id"],!1),t,"h").w("-").f(t.get(["media_id"],!1),t,"h").w("-").x(t.get(["is_compressed"],!1),t,{else:d,block:u},{}).w('" data-is-document="').f(t.get(["is_document"],!1),t,"h").w('" data-is-image="').f(t.get(["is_image"],!1),t,"h").w('" data-file-ext="').f(t.get(["file_ext"],!1),t,"h").w('" data-token="').f(t.get(["token"],!1),t,"h").w('"><img src="').f(t.get(["thumb"],!1),t,"h").w('" class="gallery-view gallery-video" alt="image" data-name="').f(t.get(["title"],!1),t,"h").w('" data-duration="').f(t.get(["duration"],!1),t,"h").w('" data-resourceId="').f(t.get(["id"],!1),t,"h").w('" data-category="').f(t.get(["category"],!1),t,"h").w('" /><div class="media-details clearfix"><div class="pull-left media-name" style="margin-top: 18px;"> ').f(t.get(["title"],!1),t,"h").w(' </div><div class="pull-right media-duration"> </div></div><div class="hv-select-wrapper"><img src="/svg/check-white.svg" alt="tick"/></div><input type="hidden" data-thumbnail="').f(t.get(["thumb"],!1),t,"h").w('" data-asset="').f(t.get(["id"],!1),t,"h").w('" ></div>')}function a(e,t){return e.w('id="').f(t.get(["id"],!1),t,"h").w("-").f(t.get(["media_id"],!1),t,"h").w("-").x(t.get(["is_compressed"],!1),t,{else:s,block:l},{}).w('"')}function s(e,t){return e.w("false")}function l(e,t){return e.w("true")}function c(e,t){return e.w('id="').f(t.get(["media_id"],!1),t,"h").w('"')}function d(e,t){return e.w("false")}function u(e,t){return e.w("true")}e.register("templates/partials/import_library_view",t),t.__dustBody=!0,i.__dustBody=!0,n.__dustBody=!0,r.__dustBody=!0,o.__dustBody=!0,a.__dustBody=!0,s.__dustBody=!0,l.__dustBody=!0,c.__dustBody=!0,d.__dustBody=!0,u.__dustBody=!0}(e),function(t,i){var n;return e.render("templates/partials/import_library_view",t,(function(e,t){if("function"==typeof i)try{i(e,t)}catch(e){}if(e)throw e;n=t})),n}}.apply(t,n))||(e.exports=r)},function(e,t,i){(function(){"use strict";i(94),i(74),i(116),i(153),i(66),i(154),i(51),i(58),i(745),i(64);var e=i(751),n=i(111);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i(96),i(99),i(24);var r=e(i(181)),o=e(i(46)),a=e(i(47)),s=e(i(295)),l=e(i(56)),c=e(i(61)),d=e(i(43)),u=e(i(89)),p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var i=m(t);if(i&&i.has(e))return i.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}r.default=e,i&&i.set(e,r);return r}(i(1)),h=e(i(769)),f=i(771);function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(m=function(e){return e?i:t})(e)}function g(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function v(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?g(Object(i),!0).forEach((function(t){(0,u.default)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):g(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function y(e){var t=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(e){return!1}}();return function(){var i,n=(0,d.default)(e);if(t){var r=(0,d.default)(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return(0,c.default)(this,i)}}var b=function(e){(0,l.default)(i,e);var t=y(i);function i(e){var n;return(0,o.default)(this,i),n=t.call(this,e),(0,u.default)((0,s.default)(n),"addTags",(function(e){n.setState((function(t){return v(v({},t),{},{selectedTags:[].concat((0,r.default)(t.selectedTags||[]),[e.entry])})}))})),(0,u.default)((0,s.default)(n),"removeTags",(function(e){n.setState((function(t){var i;return v(v({},t||[]),{},{selectedTags:null===(i=t.selectedTags)||void 0===i?void 0:i.filter((function(t){return t.id!==e.id}))})}))})),(0,u.default)((0,s.default)(n),"render",(function(){var e=n.state,t=e.selectedTags,i=e.availableTags,r=n.props,o=r.testId,a=r.title,s=r.bordered,l=r.maxChars;return p.default.createElement("div",{className:"tags-wrapper".concat(s?"-filter":""," ").concat(null!=t&&t.length?"scalable-tags":"")},p.default.createElement(h.default,{placeholder:"Enter something",dropdownPlaceholder:"Choose one or more tags",title:a||"Filter by Tags",selectedOptions:{objectArr:t||[],valueKey:"name",idKey:"id"},availableOptions:{objectArr:i,valueKey:"name",idKey:"id"},maxChars:l||22,onAdd:n.addTags,onRemove:n.removeTags,testId:o,bordered:s,isStrict:!0}))})),n.state={availableTags:[],selectedTags:null},n}return(0,a.default)(i,[{key:"componentDidMount",value:function(){var e=this,t=this.props.savedData;(0,f.getManageTagsApi)({}).then((function(i){var n=i.rows;if(e.setState({availableTags:n}),t){var r=n.filter((function(e){return t.some((function(t){return e.id===t}))}));e.setState({selectedTags:r})}}))}},{key:"componentDidUpdate",value:function(e,t){var i=this.state.selectedTags,n=this.props.actionHandler;n&&i&&e.selectedTags!==i&&n(i)}},{key:"getSelectedState",value:function(){return this.state.selectedTags}}]),i}(p.Component);t.default=b}).call(window)},function(e,t,i){"use strict";var n=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,r=function(e){var t=Object.create(null);return function(i){return void 0===t[i]&&(t[i]=e(i)),t[i]}}((function(e){return n.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));t.a=r},,function(e,t,i){var n=i(135);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,i){var n=i(37),r=i(13),o=i(183);e.exports=!n&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},function(e,t,i){var n=i(37),r=i(13);e.exports=n&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},function(e,t,i){var n=i(13),r=i(32),o=i(39),a=i(37),s=i(137).CONFIGURABLE,l=i(233),c=i(63),d=c.enforce,u=c.get,p=Object.defineProperty,h=a&&!n((function(){return 8!==p((function(){}),"length",{value:8}).length})),f=String(String).split("String"),m=e.exports=function(e,t,i){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!o(e,"name")||s&&e.name!==t)&&(a?p(e,"name",{value:t,configurable:!0}):e.name=t),h&&i&&o(i,"arity")&&e.length!==i.arity&&p(e,"length",{value:i.arity});try{i&&o(i,"constructor")&&i.constructor?a&&p(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=d(e);return o(n,"source")||(n.source=f.join("string"==typeof t?t:"")),e};Function.prototype.toString=m((function(){return r(this)&&u(this).source||l(this)}),"toString")},function(e,t,i){var n=i(19),r=i(32),o=n.WeakMap;e.exports=r(o)&&/native code/.test(String(o))},function(e,t,i){var n=i(39),r=i(291),o=i(95),a=i(48);e.exports=function(e,t,i){for(var s=r(t),l=a.f,c=o.f,d=0;d<s.length;d++){var u=s[d];n(e,u)||i&&n(i,u)||l(e,u,c(t,u))}}},function(e,t,i){var n=i(71),r=i(12),o=i(101),a=i(186),s=i(41),l=r([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(s(e)),i=a.f;return i?l(t,i(e)):t}},function(e,t,i){var n=i(12),r=i(39),o=i(67),a=i(185).indexOf,s=i(159),l=n([].push);e.exports=function(e,t){var i,n=o(e),c=0,d=[];for(i in n)!r(s,i)&&r(n,i)&&l(d,i);for(;t.length>c;)r(n,i=t[c++])&&(~a(d,i)||l(d,i));return d}},function(e,t,i){var n=i(37),r=i(287),o=i(48),a=i(41),s=i(67),l=i(161);t.f=n&&!r?Object.defineProperties:function(e,t){a(e);for(var i,n=s(t),r=l(t),c=r.length,d=0;c>d;)o.f(e,i=r[d++],n[i]);return e}},function(e,t,i){var n=i(71);e.exports=n("document","documentElement")},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){"use strict";var n=i(15),r=i(31),o=i(76),a=i(137),s=i(32),l=i(297),c=i(189),d=i(139),u=i(106),p=i(82),h=i(52),f=i(28),m=i(162),g=i(298),v=a.PROPER,y=a.CONFIGURABLE,b=g.IteratorPrototype,w=g.BUGGY_SAFARI_ITERATORS,S=f("iterator"),C=function(){return this};e.exports=function(e,t,i,a,f,g,k){l(i,t,a);var x,_,E,T=function(e){if(e===f&&O)return O;if(!w&&e in A)return A[e];switch(e){case"keys":case"values":case"entries":return function(){return new i(this,e)}}return function(){return new i(this)}},P=t+" Iterator",I=!1,A=e.prototype,R=A[S]||A["@@iterator"]||f&&A[f],O=!w&&R||T(f),N="Array"==t&&A.entries||R;if(N&&(x=c(N.call(new e)))!==Object.prototype&&x.next&&(o||c(x)===b||(d?d(x,b):s(x[S])||h(x,S,C)),u(x,P,!0,!0),o&&(m[P]=C)),v&&"values"==f&&R&&"values"!==R.name&&(!o&&y?p(A,"name","values"):(I=!0,O=function(){return r(R,this)})),f)if(_={values:T("values"),keys:g?O:T("keys"),entries:T("entries")},k)for(E in _)(w||I||!(E in A))&&h(A,E,_[E]);else n({target:t,proto:!0,forced:w||I},_);return o&&!k||A[S]===O||h(A,S,O,{name:f}),m[t]=O,_}},function(e,t,i){"use strict";var n=i(298).IteratorPrototype,r=i(105),o=i(117),a=i(106),s=i(162),l=function(){return this};e.exports=function(e,t,i,c){var d=t+" Iterator";return e.prototype=r(n,{next:o(+!c,i)}),a(e,d,!1,!0),s[d]=l,e}},function(e,t,i){"use strict";var n,r,o,a=i(13),s=i(32),l=i(38),c=i(105),d=i(189),u=i(52),p=i(28),h=i(76),f=p("iterator"),m=!1;[].keys&&("next"in(o=[].keys())?(r=d(d(o)))!==Object.prototype&&(n=r):m=!0),!l(n)||a((function(){var e={};return n[f].call(e)!==e}))?n={}:h&&(n=c(n)),s(n[f])||u(n,f,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:m}},function(e,t,i){var n,r,o,a,s=i(19),l=i(103),c=i(107),d=i(32),u=i(39),p=i(13),h=i(294),f=i(138),m=i(183),g=i(238),v=i(300),y=i(163),b=s.setImmediate,w=s.clearImmediate,S=s.process,C=s.Dispatch,k=s.Function,x=s.MessageChannel,_=s.String,E=0,T={};try{n=s.location}catch(e){}var P=function(e){if(u(T,e)){var t=T[e];delete T[e],t()}},I=function(e){return function(){P(e)}},A=function(e){P(e.data)},R=function(e){s.postMessage(_(e),n.protocol+"//"+n.host)};b&&w||(b=function(e){g(arguments.length,1);var t=d(e)?e:k(e),i=f(arguments,1);return T[++E]=function(){l(t,void 0,i)},r(E),E},w=function(e){delete T[e]},y?r=function(e){S.nextTick(I(e))}:C&&C.now?r=function(e){C.now(I(e))}:x&&!v?(a=(o=new x).port2,o.port1.onmessage=A,r=c(a.postMessage,a)):s.addEventListener&&d(s.postMessage)&&!s.importScripts&&n&&"file:"!==n.protocol&&!p(R)?(r=R,s.addEventListener("message",A,!1)):r="onreadystatechange"in m("script")?function(e){h.appendChild(m("script")).onreadystatechange=function(){h.removeChild(this),P(e)}}:function(e){setTimeout(I(e),0)}),e.exports={set:b,clear:w}},function(e,t,i){var n=i(119);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},function(e,t){e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},function(e,t,i){var n=i(31),r=i(41),o=i(120);e.exports=function(e,t,i){var a,s;r(e);try{if(!(a=o(e,"return"))){if("throw"===t)throw i;return i}a=n(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw i;if(s)throw a;return r(a),i}},function(e,t,i){var n=i(164),r=i(193),o=i(165).CONSTRUCTOR;e.exports=o||!r((function(e){n.all(e).then(void 0,(function(){}))}))},function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(e,t,i){var n=i(183)("span").classList,r=n&&n.constructor&&n.constructor.prototype;e.exports=r===Object.prototype?void 0:r},function(e,t,i){"use strict";var n=i(41);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},function(e,t,i){var n=i(13),r=i(19).RegExp;e.exports=n((function(){var e=r(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}))},function(e,t,i){var n=i(13),r=i(19).RegExp;e.exports=n((function(){var e=r("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},function(e,t,i){"use strict";var n=i(37),r=i(12),o=i(31),a=i(13),s=i(161),l=i(186),c=i(182),d=i(53),u=i(156),p=Object.assign,h=Object.defineProperty,f=r([].concat);e.exports=!p||a((function(){if(n&&1!==p({b:1},p(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},i=Symbol();return e[i]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!=p({},e)[i]||"abcdefghijklmnopqrst"!=s(p({},t)).join("")}))?function(e,t){for(var i=d(e),r=arguments.length,a=1,p=l.f,h=c.f;r>a;)for(var m,g=u(arguments[a++]),v=p?f(s(g),p(g)):s(g),y=v.length,b=0;y>b;)m=v[b++],n&&!o(h,g,m)||(i[m]=g[m]);return i}:p},function(e,t,i){"use strict";
95
+ */!function(a){"use strict";r=[i(0),i(378),i(49),i(88)],void 0===(o="function"==typeof(n=function(e){var t=!1;return e(document).on("mouseup",(function(){t=!1})),e.widget("ui.mouse",{version:"1.13.2",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.on("mousedown."+this.widgetName,(function(e){return t._mouseDown(e)})).on("click."+this.widgetName,(function(i){if(!0===e.data(i.target,t.widgetName+".preventClickEvent"))return e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1})),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var n=this,r=1===i.which,o=!("string"!=typeof this.options.cancel||!i.target.nodeName)&&e(i.target).closest(this.options.cancel).length;return!(r&&!o&&this._mouseCapture(i))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout((function(){n.mouseDelayMet=!0}),this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=!1!==this._mouseStart(i),!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+".preventClickEvent")&&e.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return n._mouseMove(e)},this._mouseUpDelegate=function(e){return n._mouseUp(e)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0))}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(i){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,i.target===this._mouseDownEvent.target&&e.data(i.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(i)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,t=!1,i.preventDefault()},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})?n.apply(t,r):n)||(e.exports=o)}()},function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i(34),r=i(113);function o(e,t,i){var o,a,s,l,c,d=function(){var n=Object(r.a)()-a;t>n?o=setTimeout(d,t-n):(o=null,i||(l=e.apply(c,s)),o||(s=c=null))},u=Object(n.a)((function(n){return c=this,s=n,a=Object(r.a)(),o||(o=setTimeout(d,t),i&&(l=e.apply(c,s))),l}));return u.cancel=function(){clearTimeout(o),o=s=c=null},u}},function(e,t,i){var n=i(673),r=i(674),o=i(675),a=i(676);e.exports=function(e){return n(e)||r(e)||o(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);t.f=o?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},function(e,t,i){var n=i(19),r=i(38),o=n.document,a=r(o)&&r(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},function(e,t,i){var n=i(136),r=i(158),o=n("keys");e.exports=function(e){return o[e]||(o[e]=r(e))}},function(e,t,i){var n=i(67),r=i(102),o=i(54),a=function(e){return function(t,i,a){var s,l=n(t),c=o(l),d=r(a,c);if(e&&i!=i){for(;c>d;)if((s=l[d++])!=s)return!0}else for(;c>d;d++)if((e||d in l)&&l[d]===i)return e||d||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,i){var n=i(12),r=i(13),o=i(32),a=i(104),s=i(71),l=i(233),c=function(){},d=[],u=s("Reflect","construct"),p=/^\s*(?:class|function)\b/,h=n(p.exec),f=!p.exec(c),m=function(e){if(!o(e))return!1;try{return u(c,d,e),!0}catch(e){return!1}},g=function(e){if(!o(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!h(p,l(e))}catch(e){return!0}};g.sham=!0,e.exports=!u||r((function(){var e;return m(m.call)||!m(Object)||!m((function(){e=!0}))||e}))?g:m},function(e,t,i){var n=i(28),r=i(105),o=i(48).f,a=n("unscopables"),s=Array.prototype;null==s[a]&&o(s,a,{configurable:!0,value:r(null)}),e.exports=function(e){s[a][e]=!0}},function(e,t,i){var n=i(39),r=i(32),o=i(53),a=i(184),s=i(435),l=a("IE_PROTO"),c=Object,d=c.prototype;e.exports=s?c.getPrototypeOf:function(e){var t=o(e);if(n(t,l))return t[l];var i=t.constructor;return r(i)&&t instanceof i?i.prototype:t instanceof c?d:null}},function(e,t,i){var n=i(41),r=i(235),o=i(80),a=i(28)("species");e.exports=function(e,t){var i,s=n(e).constructor;return void 0===s||o(i=n(s)[a])?t:r(i)}},function(e,t,i){var n=i(107),r=i(31),o=i(41),a=i(121),s=i(240),l=i(54),c=i(81),d=i(192),u=i(167),p=i(302),h=TypeError,f=function(e,t){this.stopped=e,this.result=t},m=f.prototype;e.exports=function(e,t,i){var g,v,y,b,w,S,C,k=i&&i.that,x=!(!i||!i.AS_ENTRIES),_=!(!i||!i.IS_RECORD),E=!(!i||!i.IS_ITERATOR),T=!(!i||!i.INTERRUPTED),P=n(t,k),I=function(e){return g&&p(g,"normal",e),new f(!0,e)},A=function(e){return x?(o(e),T?P(e[0],e[1],I):P(e[0],e[1])):T?P(e,I):P(e)};if(_)g=e.iterator;else if(E)g=e;else{if(!(v=u(e)))throw h(a(e)+" is not iterable");if(s(v)){for(y=0,b=l(e);b>y;y++)if((w=A(e[y]))&&c(m,w))return w;return new f(!1)}g=d(e,v)}for(S=_?e.next:g.next;!(C=r(S,g)).done;){try{w=A(C.value)}catch(e){p(g,"throw",e)}if("object"==typeof w&&w&&c(m,w))return w}return new f(!1)}},function(e,t,i){var n=i(31),r=i(75),o=i(41),a=i(121),s=i(167),l=TypeError;e.exports=function(e,t){var i=arguments.length<2?s(e):t;if(r(i))return o(n(i,e));throw l(a(e)+" is not iterable")}},function(e,t,i){var n=i(28)("iterator"),r=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){r=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!r)return!1;var i=!1;try{var o={};o[n]=function(){return{next:function(){return{done:i=!0}}}},e(o)}catch(e){}return i}},function(e,t,i){"use strict";var n,r,o=i(31),a=i(12),s=i(42),l=i(306),c=i(242),d=i(136),u=i(105),p=i(63).get,h=i(307),f=i(308),m=d("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,v=g,y=a("".charAt),b=a("".indexOf),w=a("".replace),S=a("".slice),C=(r=/b*/g,o(g,n=/a/,"a"),o(g,r,"a"),0!==n.lastIndex||0!==r.lastIndex),k=c.BROKEN_CARET,x=void 0!==/()??/.exec("")[1];(C||x||k||h||f)&&(v=function(e){var t,i,n,r,a,c,d,h=this,f=p(h),_=s(e),E=f.raw;if(E)return E.lastIndex=h.lastIndex,t=o(v,E,_),h.lastIndex=E.lastIndex,t;var T=f.groups,P=k&&h.sticky,I=o(l,h),A=h.source,R=0,O=_;if(P&&(I=w(I,"y",""),-1===b(I,"g")&&(I+="g"),O=S(_,h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==y(_,h.lastIndex-1))&&(A="(?: "+A+")",O=" "+O,R++),i=new RegExp("^(?:"+A+")",I)),x&&(i=new RegExp("^"+A+"$(?!\\s)",I)),C&&(n=h.lastIndex),r=o(g,P?i:h,O),P?r?(r.input=S(r.input,R),r[0]=S(r[0],R),r.index=h.lastIndex,h.lastIndex+=r[0].length):h.lastIndex=0:C&&r&&(h.lastIndex=h.global?r.index+r[0].length:n),x&&r&&r.length>1&&o(m,r[0],i,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(r[a]=void 0)})),r&&T)for(r.groups=c=u(null),a=0;a<T.length;a++)c[(d=T[a])[0]]=r[d[1]];return r}),e.exports=v},function(e,t,i){"use strict";i(55);var n=i(12),r=i(52),o=i(194),a=i(13),s=i(28),l=i(82),c=s("species"),d=RegExp.prototype;e.exports=function(e,t,i,u){var p=s(e),h=!a((function(){var t={};return t[p]=function(){return 7},7!=""[e](t)})),f=h&&!a((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[c]=function(){return i},i.flags="",i[p]=/./[p]),i.exec=function(){return t=!0,null},i[p](""),!t}));if(!h||!f||i){var m=n(/./[p]),g=t(p,""[e],(function(e,t,i,r,a){var s=n(e),l=t.exec;return l===o||l===d.exec?h&&!a?{done:!0,value:m(t,i,r)}:{done:!0,value:s(i,t,r)}:{done:!1}}));r(String.prototype,e,g[0]),r(d,p,g[1])}u&&l(d[p],"sham",!0)}},function(e,t,i){var n=i(31),r=i(41),o=i(32),a=i(100),s=i(194),l=TypeError;e.exports=function(e,t){var i=e.exec;if(o(i)){var c=n(i,e,t);return null!==c&&r(c),c}if("RegExp"===a(e))return n(s,e,t);throw l("RegExp#exec called on incompatible receiver")}},function(e,t){e.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},function(e,t,i){"use strict";var n=i(15),r=i(12),o=i(156),a=i(67),s=i(170),l=r([].join),c=o!=Object,d=s("join",",");n({target:"Array",proto:!0,forced:c||!d},{join:function(e){return l(a(this),void 0===e?",":e)}})},function(e,t,i){"use strict";var n=i(31),r=i(195),o=i(41),a=i(80),s=i(70),l=i(478),c=i(42),d=i(120),u=i(196);r("search",(function(e,t,i){return[function(t){var i=s(this),r=a(t)?void 0:d(t,e);return r?n(r,t,i):new RegExp(t)[e](c(i))},function(e){var n=o(this),r=c(e),a=i(t,n,r);if(a.done)return a.value;var s=n.lastIndex;l(s,0)||(n.lastIndex=0);var d=u(n,r);return l(n.lastIndex,s)||(n.lastIndex=s),null===d?-1:d.index}]}))},function(e,t,i){var n=i(45),r=i(252).populateHostPrefix;function o(e,t,i,r){var o=[e,t].join("/");o=o.replace(/\/+/g,"/");var a={},s=!1;if(n.each(i.members,(function(e,t){var i=r[e];if(null!=i)if("uri"===t.location){var l=new RegExp("\\{"+t.name+"(\\+)?\\}");o=o.replace(l,(function(e,t){return(t?n.uriEscapePath:n.uriEscape)(String(i))}))}else"querystring"===t.location&&(s=!0,"list"===t.type?a[t.name]=i.map((function(e){return n.uriEscape(t.member.toWireFormat(e).toString())})):"map"===t.type?n.each(i,(function(e,t){Array.isArray(t)?a[e]=t.map((function(e){return n.uriEscape(String(e))})):a[e]=n.uriEscape(String(t))})):a[t.name]=n.uriEscape(t.toWireFormat(i).toString()))})),s){o+=o.indexOf("?")>=0?"&":"?";var l=[];n.arrayEach(Object.keys(a).sort(),(function(e){Array.isArray(a[e])||(a[e]=[a[e]]);for(var t=0;t<a[e].length;t++)l.push(n.uriEscape(String(e))+"="+a[e][t])})),o+=l.join("&")}return o}e.exports={buildRequest:function(e){!function(e){e.httpRequest.method=e.service.api.operations[e.operation].httpMethod}(e),function(e){var t=e.service.api.operations[e.operation],i=t.input,n=o(e.httpRequest.endpoint.path,t.httpPath,i,e.params);e.httpRequest.path=n}(e),function(e){var t=e.service.api.operations[e.operation];n.each(t.input.members,(function(t,i){var r=e.params[t];null!=r&&("headers"===i.location&&"map"===i.type?n.each(r,(function(t,n){e.httpRequest.headers[i.name+t]=n})):"header"===i.location&&(r=i.toWireFormat(r).toString(),i.isJsonValue&&(r=n.base64.encode(r)),e.httpRequest.headers[i.name]=r))}))}(e),r(e)},extractError:function(){},extractData:function(e){var t=e.request,i={},r=e.httpResponse,o=t.service.api.operations[t.operation].output,a={};n.each(r.headers,(function(e,t){a[e.toLowerCase()]=t})),n.each(o.members,(function(e,t){var o=(t.name||e).toLowerCase();if("headers"===t.location&&"map"===t.type){i[e]={};var s=t.isLocationName?t.name:"",l=new RegExp("^"+s+"(.+)","i");n.each(r.headers,(function(t,n){var r=t.match(l);null!==r&&(i[e][r[1]]=n)}))}else if("header"===t.location){if(void 0!==a[o]){var c=t.isJsonValue?n.base64.decode(a[o]):a[o];i[e]=t.toType(c)}}else"statusCode"===t.location&&(i[e]=parseInt(r.statusCode,10))})),e.data=i},generateURI:o}},function(e,t,i){var n=i(142).Buffer;"undefined"!=typeof ArrayBuffer&&void 0===ArrayBuffer.isView&&(ArrayBuffer.isView=function(e){return r.indexOf(Object.prototype.toString.call(e))>-1});var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]","[object DataView]"];e.exports={isEmptyData:function(e){return"string"==typeof e?0===e.length:0===e.byteLength},convertToBuffer:function(e){return"string"==typeof e&&(e=new n(e,"utf8")),ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,i){var n=i(32),r=i(38),o=i(139);e.exports=function(e,t,i){var a,s;return o&&n(a=t.constructor)&&a!==i&&r(s=a.prototype)&&s!==i.prototype&&o(e,s),e}},function(e,t,i){"use strict";var n=i(15),r=i(141).trim;n({target:"String",proto:!0,forced:i(255)("trim")},{trim:function(){return r(this)}})},function(e,t,i){var n=i(15),r=i(344);n({target:"Array",stat:!0,forced:!i(193)((function(e){Array.from(e)}))},{from:r})},function(e,t,i){var n=i(573),r=i(574),o=i(575),a=i(576),s=i(577);function l(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=r,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,e.exports=l},function(e,t,i){var n=i(176);e.exports=function(e,t){for(var i=e.length;i--;)if(n(e[i][0],t))return i;return-1}},function(e,t,i){var n=i(87).Symbol;e.exports=n},function(e,t,i){var n=i(123)(Object,"create");e.exports=n},function(e,t,i){var n=i(597);e.exports=function(e,t){var i=e.__data__;return n(t)?i["string"==typeof t?"string":"hash"]:i.map}},function(e,t,i){var n=i(258),r=i(360);e.exports=function(e){return null!=e&&r(e.length)&&!n(e)}},function(e,t,i){i(663)},function(e,t,i){var n=i(52);e.exports=function(e,t,i){for(var r in t)n(e,r,t[r],i);return e}},function(e,t,i){i(369)},function(e,t,i){"use strict";var n=i(31),r=i(195),o=i(41),a=i(80),s=i(83),l=i(42),c=i(70),d=i(120),u=i(243),p=i(196);r("match",(function(e,t,i){return[function(t){var i=c(this),r=a(t)?void 0:d(t,e);return r?n(r,t,i):new RegExp(t)[e](l(i))},function(e){var n=o(this),r=l(e),a=i(t,n,r);if(a.done)return a.value;if(!n.global)return p(n,r);var c=n.unicode;n.lastIndex=0;for(var d,h=[],f=0;null!==(d=p(n,r));){var m=l(d[0]);h[f]=m,""===m&&(n.lastIndex=u(r,s(n.lastIndex),c)),f++}return 0===f?null:h}]}))},function(e,t,i){"use strict";var n=i(15),r=i(37),o=i(19),a=i(12),s=i(39),l=i(32),c=i(81),d=i(42),u=i(48).f,p=i(290),h=o.Symbol,f=h&&h.prototype;if(r&&l(h)&&(!("description"in f)||void 0!==h().description)){var m={},g=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:d(arguments[0]),t=c(f,this)?new h(e):void 0===e?h():h(e);return""===e&&(m[t]=!0),t};p(g,h),g.prototype=f,f.constructor=g;var v="Symbol(test)"==String(h("test")),y=a(f.valueOf),b=a(f.toString),w=/^Symbol\((.*)\)[^)]+$/,S=a("".replace),C=a("".slice);u(f,"description",{configurable:!0,get:function(){var e=y(this);if(s(m,e))return"";var t=b(e),i=v?C(t,7,-1):S(t,w,"$1");return""===i?void 0:i}}),n({global:!0,constructor:!0,forced:!0},{Symbol:g})}},function(e,t,i){var n=i(33),r=i(190),o=n.aTypedArrayConstructor,a=n.getTypedArrayConstructor;e.exports=function(e){return o(r(e,a(e)))}},function(e,t,i){"use strict";i.d(t,"a",(function(){return p}));var n=i(46),r=i.n(n),o=i(47),a=i.n(o),s=(i(96),i(26)),l=i.n(s),c=i(130),d=i(147),u=i(6),p=function(){function e(t){var i=t.token,n=t.email,o=t.tokenType;r()(this,e),this.token=i,this.tokenType=o;var a={baseURL:(window._HVDomain||"https://www.hippovideo.io")+d.a,headers:{accept:"application/json"}};if(o===u.e.AUTHENTICATION_TOKEN){var s="".concat(o,"$$").concat(i,"$$").concat(n);a.headers.Authorization="Basic ".concat(btoa(s))}if(o===u.e.RECORDER_SDK_TOKEN){var c="".concat(o,"$$").concat(i);a.headers.Authorization="Basic ".concat(btoa(c))}this.axiosInstance=l.a.create(a)}return a()(e,[{key:"authenticateToken",value:function(){return Object(c.a)({axiosInstance:this.axiosInstance,url:"/authenticate",method:"post"})}},{key:"getBrandingInfo",value:function(){return Object(c.a)({axiosInstance:this.axiosInstance,url:"/branding_info",method:"get"})}},{key:"saveVideoTitle",value:function(e){var t={title:e.title,asset_id:e.assetId};return console.log("HERE "),Object(c.a)({axiosInstance:this.axiosInstance,url:"/video_title",method:"put",jsonData:t})}},{key:"submitVideo",value:function(e){var t={id:e.assetId};return console.log("HERE "),Object(c.a)({axiosInstance:this.axiosInstance,url:"/submit",method:"post",jsonData:t})}}]),e}()},function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var n=i(11),r=i(35),o=i(57);function a(e,t){t=function(e){for(var t={},i=e.length,n=0;n<i;++n)t[e[n]]=!0;return{contains:function(e){return!0===t[e]},push:function(i){return t[i]=!0,e.push(i)}}}(t);var i=n.n.length,a=e.constructor,s=Object(r.a)(a)&&a.prototype||n.c,l="constructor";for(Object(o.a)(e,l)&&!t.contains(l)&&t.push(l);i--;)(l=n.n[i])in e&&e[l]!==s[l]&&!t.contains(l)&&t.push(l)}},function(e,t,i){var n,r;n=[i(16),i(17)],void 0===(r=function(e,t){return function(e){function t(e,t){return e.h("eq",t,{block:i},{key:t.get(["type"],!1),value:"barLoading"},"h")}function i(e,t){return e.w('<div id="').f(t.get(["id"],!1),t,"h").w("_").f(t.get(["type"],!1),t,"h").w('_id" class="bar-loading-outer-container ').f(t.get(["id"],!1),t,"h").w("-").f(t.get(["type"],!1),t,"h").w('-class"><div class="bar-loading"><div></div><div></div><div></div><div></div></div></div>')}e.register("templates/common/loading",t),t.__dustBody=!0,i.__dustBody=!0}(e),function(t,i){var n;return e.render("templates/common/loading",t,(function(e,t){if("function"==typeof i)try{i(e,t)}catch(e){}if(e)throw e;n=t})),n}}.apply(t,n))||(e.exports=r)},function(e,t,i){"use strict";e.exports=i(666)},function(e,t,i){"use strict";i(51),i(24),i(58),i(64),i(212),i(214);var n,r=i(1),o=i.n(r),a=i(4),s=i.n(a),l=i(3).c.video(n||(n=s()(["\n width: 100%;\n border-radius: 15px;\n"]))),c=Object(r.forwardRef)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.stream,i=arguments.length>1?arguments[1]:void 0;return Object(r.useEffect)((function(){(t||i)&&("srcObject"in i.current?i.current.srcObject=t:i.current.src=window.URL.createObjectURL(t),i.current.onloadedmetadata=function(){i.current.play()})}),[t,i]),o.a.createElement(l,{ref:i,autoplay:!0,muted:!0})}));t.a=c},function(e,t,i){"use strict";var n,r=i(1),o=i.n(r),a=i(4),s=i.n(a),l=i(3).c.canvas(n||(n=s()(["\n position: absolute;\n opacity: 0;\n left: 0;\n"]))),c=Object(r.forwardRef)((function(e,t){return o.a.createElement(l,{ref:t})}));t.a=c},function(e,t){var i={init:function(e){e||(e="undefined"!=typeof window&&window._i18n&&window._i18n.locale?window._i18n.locale:"undefined"!=typeof document&&document.documentElement.lang?document.documentElement.lang:"undefined"!=typeof navigator&&(navigator.languages||navigator.language||navigator.userLanguage)?((e=navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage)||"root").toLowerCase():"root");var t=this["__"+e]||this.__root;if(t)for(var i in t)this[i]=t[i];for(var i in this.__root)void 0===this[i]&&(this[i]=this.__root[i])}};i.init(),e.exports=i},function(e,t,i){var n,r;n=[i(0),i(10),i(25),i(568),i(149),i(144),i(145)],void 0===(r=function(e,t,i,n,r){return r.extend({template:n})}.apply(t,n))||(e.exports=r)},function(e,t,i){var n=i(638);e.exports=function(e,t){return n(e,t)}},function(e,t,i){var n,r;n=[i(0),i(10),i(25),i(22),i(734),i(30),i(8)],void 0===(r=function(e,t,i,n,r,o,a){"use strict";return a=a.default,{UPLOAD_REQUEST:0,PREVIEW_REQUEST:1,RENDER_REQUEST:2,MERGE_RENDER_REQUEST:3,COMPRESS_REQUEST:4,CONVERT_REQUEST:5,GIF_REQUEST:6,STREAMING_REQUEST:7,PERSONALIZATION_REQUEST:8,GENERATE_ANIMATED_PREVIEW_REQUEST:9,VIRTUAL_BG_OPERATION:20,initialize:function(t,i,s){return{interval:null==t?3e3:t,pollTimeout:(new Date).getTime()/1e3+(null==i?7200:i),latestWindow:[],init:function(){this.operationIdArray=[],this.assetId=void 0,this.expectedOperationType=void 0,this.operationId=void 0,this.pollErrorCount=0,this.timeRemaining=void 0,this.pollingAction,this.clientLogSent=!1},getStatus:function(e,t,i,n,r){this.init(),e&&e.constructor===Array?(this.operationIdArray=e,this.operationId=this.operationIdArray.pop()):this.operationId=e,this.waitingHandler=t,this.progressHandler=i,this.completeHandler=n,this.errorHandler=r,this.ping()},getAssetStatus:function(e,t,i,n,r,o,a){this.init(),this.assetId=e,this.waitingHandler=t,this.progressHandler=i,this.completeHandler=n,this.errorHandler=r,this.expectedOperationType=o,this.forExtnVBG=a,this.ping()},ping:function(){if("stop"!==this.pollingAction)if((new Date).getTime()/1e3>this.pollTimeout)this.errorHandler&&this.errorHandler(n.pingTooLong);else if(null!=this.operationId||null!=this.assetId){var t=this;r.statusOf(s,this.operationId,this.assetId,this.expectedOperationType,(function(e){if(e){if(null===e||"null"===e||""===JSON.stringify(e).trim())return setTimeout((function(){t.ping()}),t.interval),void a.postErrorsToLog({stackTrace:"Null value returned for statuspoller ",assetId:t.assetId,operationId:t.operationId});if(void 0===e.status&&e.operation_id)setTimeout((function(){t.ping()}),t.interval);else{if("error"==e.status)t.pollErrorCount++,t.pollErrorCount<=4&&setTimeout((function(){t.ping()}),t.interval),console.log("error!!!");else if(50==e.status)t.waitingHandler&&t.waitingHandler(e.data.text),setTimeout((function(){t.ping()}),t.interval);else if(51==e.status||52==e.status){if(e.data.progress>=0&&e.data.progress<=100&&(t.latestWindow.push(e.data),t.latestWindow.length>3&&t.latestWindow.splice(0,t.latestWindow.length-3)),t.latestWindow.length>1){var i=t.latestWindow[t.latestWindow.length-1].progress-t.latestWindow[0].progress,r=t.latestWindow[t.latestWindow.length-1].ts-t.latestWindow[0].ts;i>0&&r>0&&(t.timeRemaining=Math.round(r*(100-t.latestWindow[t.latestWindow.length-1].progress)/i))}t.progressHandler&&t.progressHandler(e.data.text,e.data.progress,t.timeRemaining),setTimeout((function(){t.ping()}),t.interval)}if(("error"==e.status&&t.pollErrorCount>4||54==e.status)&&t.errorHandler){var o=n.somethingWentWrong;null!=e.data&&null!=e.data.text&&(o=e.data.text);var s={reason:o,state:e.data.state};t.errorHandler(s)}53==e.status&&(null!=t.expectedOperationType&&e.operationtype!=t.expectedOperationType?(e.data.text=n.processPending,t.progressHandler(e.data.text,e.data.progress,t.timeRemaining,e.operationtype,e.status),setTimeout((function(){t.ping()}),t.interval)):t.operationIdArray&&t.operationIdArray.length>0?(t.operationId=t.operationIdArray.pop(),t.ping()):t.completeHandler&&t.completeHandler(e))}}else setTimeout((function(){t.ping()}),t.interval)}),(function(i){if(setTimeout((function(){t.ping()}),t.interval),!t.clientLogSent){var n=new o({digest:e("#digest").val()}),r={authoringAssetId:t.assetId,description:"STATUS_POLLER_ERROR",stackTrace:"Error while connecting server status from server. assetId-"+t.assetId+" status-"+i.status};n.logClientData([r],!1,(function(){}),(function(){})),t.clientLogSent=!0}}),this.forExtnVBG)}},stop:function(){this.pollingAction="stop"}}}}}.apply(t,n))||(e.exports=r)},function(e,t,i){"use strict";(function(e){i.d(t,"a",(function(){return y}));i(94);var n=i(46),r=i.n(n),o=i(47),a=i.n(o),s=i(56),l=i.n(s),c=i(61),d=i.n(c),u=i(43),p=i.n(u),h=(i(86),i(24),i(25)),f=i.n(h),m=i(414),g=i.n(m);function v(e){var t=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(e){return!1}}();return function(){var i,n=p()(e);if(t){var r=p()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return d()(this,i)}}var y=function(t){l()(n,t);var i=v(n);function n(){return r()(this,n),i.apply(this,arguments)}return a()(n,[{key:"initialize",value:function(t){this.id=t.id,this.showAsModal=t.showAsModal,this.isVirtualBg=t.isVirtualBg,this.$el=e("#".concat(this.id))}},{key:"render",value:function(){var t=this,i=!0;"true"==e("#isTestimonial").val()&&(i=!1),g()({showAsModal:this.showAsModal,showHippoIcon:i,isVirtualBg:this.isVirtualBg},(function(i,n){t.$el.empty().append(e(n)),t.$el.find("#progressBackdrop").show(),t.$el.removeClass("hide")}))}},{key:"remove",value:function(){var e=this;setTimeout((function(){e.$el.empty().addClass("hide")}),800)}},{key:"updateValues",value:function(e,t){this.updateProgress(e),this.updateProgressText(t)}},{key:"updateProgress",value:function(e){var t=0===e?0:20;this.$el.find("#progressFillStrip").animate({width:"".concat(e,"%")},t)}},{key:"updateProgressText",value:function(e){this.$el.find("#progressText").text(e)}}]),n}(f.a.View)}).call(this,i(0))},function(e,t,i){"use strict";i.d(t,"a",(function(){return js})),i.d(t,"b",(function(){return qs}));i(244),i(50),i(24),i(59),i(73);var n=i(92),r=i.n(n),o=i(62),a=i.n(o),s=i(1),l=i.n(s);function c(e,t){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,c(e,t)}function u(e,t){if(null==e)return{};var i,n,r={},o=Object.keys(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}var p=i(69),h=i.n(p),f=!1,m=l.a.createContext(null),g=function(e){return e.scrollTop},v="entering",y="entered",b=function(e){function t(t,i){var n;n=e.call(this,t,i)||this;var r,o=i&&!i.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?o?(r="exited",n.appearStatus=v):r=y:r=t.unmountOnExit||t.mountOnEnter?"unmounted":"exited",n.state={status:r},n.nextCallback=null,n}d(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&"unmounted"===t.status?{status:"exited"}:null};var i=t.prototype;return i.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},i.componentDidUpdate=function(e){var t=null;if(e!==this.props){var i=this.state.status;this.props.in?i!==v&&i!==y&&(t=v):i!==v&&i!==y||(t="exiting")}this.updateStatus(!1,t)},i.componentWillUnmount=function(){this.cancelNextCallback()},i.getTimeouts=function(){var e,t,i,n=this.props.timeout;return e=t=i=n,null!=n&&"number"!=typeof n&&(e=n.exit,t=n.enter,i=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:i}},i.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===v){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:h.a.findDOMNode(this);i&&g(i)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},i.performEnter=function(e){var t=this,i=this.props.enter,n=this.context?this.context.isMounting:e,r=this.props.nodeRef?[n]:[h.a.findDOMNode(this),n],o=r[0],a=r[1],s=this.getTimeouts(),l=n?s.appear:s.enter;!e&&!i||f?this.safeSetState({status:y},(function(){t.props.onEntered(o)})):(this.props.onEnter(o,a),this.safeSetState({status:v},(function(){t.props.onEntering(o,a),t.onTransitionEnd(l,(function(){t.safeSetState({status:y},(function(){t.props.onEntered(o,a)}))}))})))},i.performExit=function(){var e=this,t=this.props.exit,i=this.getTimeouts(),n=this.props.nodeRef?void 0:h.a.findDOMNode(this);t&&!f?(this.props.onExit(n),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(n),e.onTransitionEnd(i.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))},i.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},i.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},i.setNextCallback=function(e){var t=this,i=!0;return this.nextCallback=function(n){i&&(i=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},i.onTransitionEnd=function(e,t){this.setNextCallback(t);var i=this.props.nodeRef?this.props.nodeRef.current:h.a.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(i&&!n){if(this.props.addEndListener){var r=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],o=r[0],a=r[1];this.props.addEndListener(o,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},i.render=function(){var e=this.state.status;if("unmounted"===e)return null;var t=this.props,i=t.children,n=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,u(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return l.a.createElement(m.Provider,{value:null},"function"==typeof i?i(e,n):l.a.cloneElement(l.a.Children.only(i),n))},t}(l.a.Component);function w(){}b.contextType=m,b.propTypes={},b.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:w,onEntering:w,onEntered:w,onExit:w,onExiting:w,onExited:w},b.UNMOUNTED="unmounted",b.EXITED="exited",b.ENTERING=v,b.ENTERED=y,b.EXITING="exiting";var S,C,k=b;var x="out-in",_="in-out",E=function(e,t,i){return function(){var n;e.props[t]&&(n=e.props)[t].apply(n,arguments),i()}},T=((S={})[x]=function(e){var t=e.current,i=e.changeState;return l.a.cloneElement(t,{in:!1,onExited:E(t,"onExited",(function(){i(v,null)}))})},S[_]=function(e){var t=e.current,i=e.changeState,n=e.children;return[t,l.a.cloneElement(n,{in:!0,onEntered:E(n,"onEntered",(function(){i(v)}))})]},S),P=((C={})[x]=function(e){var t=e.children,i=e.changeState;return l.a.cloneElement(t,{in:!0,onEntered:E(t,"onEntered",(function(){i(y,l.a.cloneElement(t,{in:!0}))}))})},C[_]=function(e){var t=e.current,i=e.children,n=e.changeState;return[l.a.cloneElement(t,{in:!1,onExited:E(t,"onExited",(function(){n(y,l.a.cloneElement(i,{in:!0}))}))}),l.a.cloneElement(i,{in:!0})]},C),I=function(e){function t(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];return(t=e.call.apply(e,[this].concat(n))||this).state={status:y,current:null},t.appeared=!1,t.changeState=function(e,i){void 0===i&&(i=t.state.current),t.setState({status:e,current:i})},t}d(t,e);var i=t.prototype;return i.componentDidMount=function(){this.appeared=!0},t.getDerivedStateFromProps=function(e,t){return null==e.children?{current:null}:t.status===v&&e.mode===_?{status:v}:!t.current||(i=t.current,n=e.children,i===n||l.a.isValidElement(i)&&l.a.isValidElement(n)&&null!=i.key&&i.key===n.key)?{current:l.a.cloneElement(e.children,{in:!0})}:{status:"exiting"};var i,n},i.render=function(){var e,t=this.props,i=t.children,n=t.mode,r=this.state,o=r.status,a=r.current,s={children:i,current:a,changeState:this.changeState,status:o};switch(o){case v:e=P[n](s);break;case"exiting":e=T[n](s);break;case y:e=a}return l.a.createElement(m.Provider,{value:{isMounting:!this.appeared}},e)},t}(l.a.Component);I.propTypes={},I.defaultProps={mode:x};function A(){return(A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function R(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var O=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return n=t,void((i=e).classList?i.classList.remove(n):"string"==typeof i.className?i.className=R(i.className,n):i.setAttribute("class",R(i.className&&i.className.baseVal||"",n)));var i,n}))},N=function(e){function t(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];return(t=e.call.apply(e,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,i){var n=t.resolveArguments(e,i),r=n[0],o=n[1];t.removeClasses(r,"exit"),t.addClass(r,o?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,i)},t.onEntering=function(e,i){var n=t.resolveArguments(e,i),r=n[0],o=n[1]?"appear":"enter";t.addClass(r,o,"active"),t.props.onEntering&&t.props.onEntering(e,i)},t.onEntered=function(e,i){var n=t.resolveArguments(e,i),r=n[0],o=n[1]?"appear":"enter";t.removeClasses(r,o),t.addClass(r,o,"done"),t.props.onEntered&&t.props.onEntered(e,i)},t.onExit=function(e){var i=t.resolveArguments(e)[0];t.removeClasses(i,"appear"),t.removeClasses(i,"enter"),t.addClass(i,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var i=t.resolveArguments(e)[0];t.addClass(i,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var i=t.resolveArguments(e)[0];t.removeClasses(i,"exit"),t.addClass(i,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,i){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,i]},t.getClassNames=function(e){var i=t.props.classNames,n="string"==typeof i,r=n?""+(n&&i?i+"-":"")+e:i[e];return{baseClassName:r,activeClassName:n?r+"-active":i[e+"Active"],doneClassName:n?r+"-done":i[e+"Done"]}},t}d(t,e);var i=t.prototype;return i.addClass=function(e,t,i){var n=this.getClassNames(t)[i+"ClassName"],r=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===i&&r&&(n+=" "+r),"active"===i&&e&&g(e),n&&(this.appliedClasses[t][i]=n,function(e,t){e&&t&&t.split(" ").forEach((function(t){return n=t,void((i=e).classList?i.classList.add(n):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(i,n)||("string"==typeof i.className?i.className=i.className+" "+n:i.setAttribute("class",(i.className&&i.className.baseVal||"")+" "+n)));var i,n}))}(e,n))},i.removeClasses=function(e,t){var i=this.appliedClasses[t],n=i.base,r=i.active,o=i.done;this.appliedClasses[t]={},n&&O(e,n),r&&O(e,r),o&&O(e,o)},i.render=function(){var e=this.props,t=(e.classNames,u(e,["classNames"]));return l.a.createElement(k,A({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(l.a.Component);N.defaultProps={classNames:""},N.propTypes={};var D=N,L=i(3),M=(i(477),i(7)),B=i(44),F=i(18),V=i(36);const U=({tokenType:e,integrationType:t,userId:i})=>{let n=`${(new Date).getTime()}$$${e}$$${t}`;return i&&(n+="$$"+i),btoa(n)};var z=i(26),H=i.n(z),j=i(112),q=i.n(j),$=i(390),W=i.n($),G=i(273),K=i.n(G);const Y="INFO",J="ERROR",X="DEBUG",Q="WARN",Z=[Y,"TRACE"];var ee=i(6);const{MESSAGE:te,LOG_SOURCE:ie,APP_NAME:ne,INITIATOR:re,LOG_TYPE:oe,REQUEST_PATH:ae,DATE_TIME:se,REQUEST_BROWSER:le,USER_ID:ce,LOG_UID:de,INTEGRATION_TYPE:ue,ASSET_ID:pe}={APP_NAME:"app_name",TENANT_ID:"tenant_id",API_TOTAL_TIME:"api_total_time",VIEW_TIME:"view_time",REQUEST_TIME:"req_time",METHOD_NAME:"method_name",LINE_NUMBER:"line_num",LOG_LEVEL:"log_level",DATE_TIME:"datetime",USER_ID:"user_id",REQUEST_ID:"request_id",REQUEST_PATH:"req_path",REQUEST_METHOD:"req_method",REQUEST_METHOD_NAME:"req_action",REQUEST_QUERY_PARAMS:"req_query_params",REQUEST_PARAMETERS:"req_params",REQUEST_PATH_PARAMETERS:"req_path_params",REQUEST_REFERER:"req_referer",IS_REQUEST:"is_req",MESSAGE:"msg",REQUEST_IP:"request_ip",LOG_SOURCE:"log_source",ERROR_TRACE:"error_trace",LOG_TYPE:"log_type",EVENT_NAME:"event_name",METRIC_NAME:"metric_name",METRIC_TYPE:"metric_Type",METRIC_VALUE:"metric_value",ASSET_ID:"asset_id",REQUEST_BROWSER:"browser",INITIATOR:"initiator",RECORD_ID:"record_id",ENCRYPTED:"encrypted",FAILED_LOG_COUNT:"failed_log_count",LOG_UID:"log_uid",INTEGRATION_TYPE:"integration_type"};class he{constructor({module:e,integrationType:t=ee.q.PRODUCT,assetId:i,logUID:n,tokenType:r,token:o}){this.origin=window&&window._HVDomain||"https://www.hippovideo.io",this.assetId=i||-1,this.logUID=n||U({integrationType:t,tokenType:r}),this.module=e,this.tokenType=r,this.token=o,this.integrationType=t,this.logBuffer=this._getLogsFromLocalStorage()}updateParams({assetId:e,logUID:t}){e&&(this.assetId=e),t&&(this.logUID=t)}log(e,t={}){const i={asset_id:this.assetId,logUID:this.logUID,module:this.module,...t};console.log(`[${X}] :: ${e} :: ${i}`)}info(e,t={}){this._logData(Y,e,t)}error(e,t={}){this._logData(J,e,t)}warn(e,t={}){this._logData(Q,e,t)}_logData(e,t,i){i[te]=t,i[pe]=this.assetId,i[ie]="HV_CLIENT",i[ne]=this.module||"HV_CLIENT",i[re]=this.initiator,i[oe]=e,i[ae]=location?location.href:"Unable to locate request path",i[se]=this._getZuluTimeInUTC(),i[le]=navigator.userAgent&&navigator.userAgent.toString(),i[ce]=this._getUserId(),this.logUID&&(i[de]=this.logUID),this.integrationType&&(i[ue]=this.integrationType),this._pushLogRecord(i);let n=!0;"production"===(()=>{if(window){if(window.HippoVideo&&window.HippoVideo.AppRegistry&&window.HippoVideo.AppRegistry.isStageEnvironment)return"stage";if(window.location){if(window.location.origin&&(window.location.origin.endsWith(".hippowiz.com")||window.location.origin.endsWith(".hippovideo.us")))return"stage";if(-1!==window.location.origin.indexOf("localhost")||-1!==window.location.origin.indexOf("127.0.0.1"))return"local"}}return"production"})()&&Z.includes(e)&&(n=!1),n&&console.log(`[${e}] :: ${t} `,i)}_getUserId(){try{return window.HippoVideo&&HippoVideo.data.api.getProperty("userId")||this.userId}catch(e){}return null}_getZuluTimeInUTC(){return(new Date).toISOString().replace("T"," ").slice(0,23)}async _pushLogRecord(e,t){try{await this._getFederateTokenAndUpdateConfig();const i=this._constructLogRecord(e);this.firehose.putRecord(i,t||((e,t)=>{e&&(this._fallback([i]),console.error("COULD NOT PUSH LOG ",e))}))}catch(e){t&&t("exception: "+JSON.stringify(e))}}async _pushLogRecordInBatch(e,t){try{const i=e.map(e=>this._constructLogRecord(e));await this._getFederateTokenAndUpdateConfig();const n={Records:i,DeliveryStreamName:this.streamName};this.firehose.putRecordBatch(n,t||((e,t)=>{e&&(this._fallback(i),console.error("COULD NOT PUSH LOG ",e))}))}catch(e){t&&t("exception: "+JSON.stringify(e))}}_fallback(e){this.logBuffer=this.logBuffer.concat(...e),this._pushLogRecordInBatch(e,(e,t)=>{if(e){if(this.logBuffer.length>10){const e=this.logBuffer.map(e=>this._deconstructLogRecord(e));return this.logDataToServer({logIdentifierText:"Kinesis failed logs",data:e}),void this._clearLocalLogs()}this._addLogsToLocalStorage([...this.logBuffer])}})}_clearLocalLogs(){try{this.logBuffer=[],localStorage.removeItem("hv_failed_logs")}catch(e){}}_addLogsToLocalStorage(e){try{localStorage.setItem("hv_failed_logs",JSON.stringify(e))}catch(e){}}_getLogsFromLocalStorage(){try{const e=localStorage.getItem("hv_failed_logs");if(e)return JSON.parse(e)}catch(e){}return[]}_constructLogRecord(e){return{Record:{Data:"_"+this._getZuluTimeInUTC()+"_\t"+JSON.stringify(e)},DeliveryStreamName:this.streamName}}_deconstructLogRecord(e){try{const t=e.Record.Data.split("_\t");return{date:t[0],data:JSON.parse(t[1])}}catch(e){}return e}_setAWSCredentials(){const e=1e3*(window.HippoVideo&&window.HippoVideo.AppRegistry&&window.HippoVideo.AppRegistry.KinesisApiTimeout?Number(window.HippoVideo.AppRegistry.KinesisApiTimeout):10);this.streamName=this.cognitoConfig.stream_name;try{this.cognitoIdentityCredentials.clearCachedId()}catch(e){}this.cognitoIdentityCredentials=new q.a({IdentityId:this.cognitoConfig.identity_id,Logins:{"cognito-identity.amazonaws.com":this.cognitoConfig.token}},{region:"us-east-1",httpOptions:{timeout:e}});let t={region:"us-east-1",credentials:this.cognitoIdentityCredentials,httpOptions:{timeout:e}};this.firehose=new W.a(t)}async _sendRequest(e){try{return[await H()({method:"get",baseURL:this.origin,url:"/api/internal/log/identity",params:e,headers:{accept:"application/json"}}),null]}catch(e){return[null,e]}}_getFederateTokenAndUpdateConfig(e){return new Promise(async(t,i)=>{const n=()=>{this._setAWSCredentials(),e&&e(),t()};if(window.HippoVideo&&HippoVideo.isDelivery)HippoVideo.logCognito?(this.cognitoConfig=HippoVideo.logCognito,n()):i();else{const e=()=>{try{let e=this.cognitoConfigWithExpiry;if(!e){let t=localStorage.getItem("hv-logger-ftkn");if(!t)return null;e=JSON.parse(t)}return t(e.expiry)?(localStorage.removeItem("hv-logger-ftkn"),null):("string"==typeof e&&(e=JSON.parse(e)),JSON.parse(e.value))}catch(e){console.warn("Local storage permission error",e)}return null},t=e=>{const t=new Date,i=new Date(e);return t.getTime()>i.getTime()},r=e=>{try{this.cognitoConfigWithExpiry=JSON.stringify({value:JSON.stringify(e),expiry:new Date((new Date).getTime()+36e5)}),localStorage.setItem("hv-logger-ftkn",this.cognitoConfigWithExpiry)}catch(e){console.warn("Local storage permission error",e)}};this.cognitoConfig=e();let o=null;if(this.tokenType===ee.e.GUEST&&(o={token_type:this.tokenType,token:this.token}),this.cognitoConfig)n();else{const[e,t]=await this._sendRequest(o);if(e){const t=e.data;t&&t.status?(delete t.status,this.cognitoConfig=t,r(t),n()):i()}t&&i()}}})}logDataToServer({logIdentifierText:e,...t}){const i=K.a.initialize({digest:this.token,maxLogSize:1,verbose:!1});i.startSavingLogs(this.assetId,this.logUID);const n={asset_id:this.assetId,logUID:this.logUID,module:this.module,...t};i&&i.log(e,JSON.stringify(n)),i.stopSavingLogs()}}var fe=i(276),me=i(147),ge=i(79);class ve{constructor(e){const t=window._HVDomain||"https://www.hippovideo.io";this.token=e.token,this.tokenType=e.tokenType,this.email=e.email,this.cancelSources={create_recording:H.a.CancelToken.source(),import_video:H.a.CancelToken.source(),import_convert:H.a.CancelToken.source()};let i=me.a;this.tokenType===ee.e.GUEST&&(i=fe.a),this.tokenType===ee.e.VIDEO_PLAY_TOKEN&&(i=fe.b);const n={baseURL:t+i,headers:{accept:"application/json"}};if(this.tokenType===ee.e.RECORDER_SDK_TOKEN){let e=`${this.tokenType}$$${this.token}`;n.headers.Authorization="Basic "+btoa(e)}if(this.tokenType===ee.e.AUTHENTICATION_TOKEN){let e=`${this.tokenType}$$${this.token}$$${this.email}`;n.headers.Authorization="Basic "+btoa(e)}this.axiosInstance=H.a.create(n)}_getRttValue(){try{return navigator.connection.rtt}catch(e){}return-1}createRecording({configuration:e,logUID:t}){let i={recording_configuration:JSON.stringify(e),logUID:t,rtt:this._getRttValue()},n={cancelToken:this.cancelSources.create_recording.token};return this.tokenType===ee.e.GUEST&&(i.token=this.token),this._sendRequest({url:"/record/new",method:"post",jsonData:i,additionalReqConfig:n})}cancelRequest({type:e}){e&&("create_recording"===e&&(this.cancelSources.create_recording.cancel(),this.cancelSources.create_recording=H.a.CancelToken.source()),"import_video"===e&&(this.cancelSources.import_video.cancel(),this.cancelSources.import_video=H.a.CancelToken.source()),"import_convert"===e&&(this.cancelSources.import_convert.cancel(),this.cancelSources.import_convert=H.a.CancelToken.source()))}convertVideo({assetId:e,videoId:t,compressionRequired:i,saveAsNew:n,token:r,convertSpeed:o}){let a={asset_id:e,video_id:t,compression_required:i,save_as_new:n};o&&(a.convert_speed=o),r&&(a.token=r);let s={cancelToken:this.cancelSources.import_convert.token};return this._sendRequest({url:"/convert",method:"post",formData:a,additionalReqConfig:s})}getImportedDetails({assetId:e}){let t="/import_details";return this.tokenType===ee.e.GUEST&&(t=`${t}/${this.token}`),this._sendRequest({url:t,method:"get",params:{asset_id:e}})}createVideoImport(e){let t={asset_id:e.assetId,file_name:e.fileName?e.fileName:"",description:e.description?e.description:"",size:e.size,tags:e.tags?e.tags:"",from_advanced_edit:e.fromAdvancedEdit,record_from_mobile:e.isMobile,contact_id:e.contactId,is_intro_outro_video:e.isIntroOutroVideo,logUID:e.logUID};e.token&&(t.token=e.token,t.referer=e.source),e.uniqueId&&(t.unique_id=e.uniqueId);let i={cancelToken:this.cancelSources.import_video.token};return this._sendRequest({url:"/import/new",method:"post",formData:t,additionalReqConfig:i})}mergeAndRender({assetId:e,projectJson:t,renderFrom:i}){const n=ge.a.serializeProjectJSON(JSON.parse(JSON.stringify(t)));let r={asset_id:e,data:JSON.stringify(n),render_from:i};const o=ge.a.getAuthDataInDom();for(const e in o)r[e]=o[e];return"video_token"===this.tokenType&&(r.token=this.token),this._sendRequest({url:"/render_video",method:"post",formData:r})}completeUpload({assetId:e,webcamId:t,screenId:i,recordingConfiguration:n,token:r}){let o={recording_configuration:n,asset_id:e};return t&&(o.webcam_id=t),i&&(o.screen_id=i),r&&(o.token=r),this._sendRequest({url:"/compress",method:"post",jsonData:o})}setRecordError({errorState:e,logUID:t}){const i={error_state:e,uid:t};return this.tokenType===ee.e.GUEST&&(i.token=this.token),this._sendRequest({url:"/set_record_error",method:"post",jsonData:i})}getFederatedAwsToken({region:e}){const t={region:e};return this._sendRequest({url:"/federated_aws_token",method:"get",params:t})}async _sendRequest({method:e="get",url:t,jsonData:i=null,formData:n=null,params:r={},headers:o={},additionalReqConfig:a={}}){try{let s=n;if(n){if("object"==typeof n&&null!==n){let e=new FormData;for(const t in n)e.append(t,n[t]);s=e}o["Content-Type"]="application/x-www-form-urlencoded"}i&&(o["Content-Type"]="application/json");const l={url:t,method:e,data:i||s,headers:o,params:r,...a};return[await this.axiosInstance.request(l),null]}catch(e){if(H.a.isCancel(e)){return[null,{message:e.message,is_cancelled:!0}]}return[null,e]}}}var ye=i(0),be=i.n(ye),we=i(274),Se=i.n(we),Ce=i(14),ke=i.n(Ce);i(30);const xe=()=>window.HippoVideo&&window.HippoVideo.AppRegistry&&window.HippoVideo.AppRegistry.isStageEnvironment||window.location.hostname.endsWith(".hippowiz.com")||window.location.hostname.endsWith(".hippovideo.us")?"stage":-1!==window.location.href.indexOf("localhost")||-1!==window.location.host.indexOf("127.0.0.1")?"local":"production";class _e{constructor(e){const t=e.bucket,i=e.key,n=e.acl;this.recorderModel=e.recorderModel,this.assetId=e.asset_id,this.digest=e.digest,this.IDENTITY_POOL_ID="local"==xe()?"us-east-1:8e44cb6f-5bb6-47a0-b6f7-e682b1827dc4":"us-east-1:df0a8fb6-f7ad-417c-be80-cdba8aa4a215",this.region="us-east-1",t&&-1!==t.indexOf("-in")&&(this.IDENTITY_POOL_ID="local"==xe()?"ap-south-1:3b87476b-e4de-43e1-85e9-9f24f060b566":"ap-south-1:b4a79053-b71d-4a2e-851b-c1a3fc4a403f",this.region="ap-south-1"),this.userUploadBucket=t,this.userUploadKey=i,this.initialized=!1,this.acl=n,this.userUploadId=void 0;let r="true"==(be()("#isFreePlan").val()||"");this.useAccelerate=e.useAccelerate||!r,this.finishedBlobUpload=!1,this.uploadQueue=[],this.uploadStatsData={},this.uploadError=!1,this.MAX_UPLOAD_TRIES=5,this.uploadPartHandlers=[],this.isChrome=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}startMultiartUpload(){let e=this;return new Promise((t,i)=>{this.updateCredentials().then(()=>{let n={Bucket:e.userUploadBucket,Key:e.userUploadKey,ACL:e.acl};e.s3.createMultipartUpload(n,(function(r,o){r?-1!=JSON.stringify(r).indexOf("NetworkingError")?setTimeout(()=>e.retryCreateMultipartUpload(n,t,i),5e3):i(r):(e.userUploadId=o.UploadId,e.initialized=!0,t())}))}).catch(i)})}retryCreateMultipartUpload(e,t,i){let n=this;this.s3.createMultipartUpload(e,(function(r,o){r?-1!=JSON.stringify(r).indexOf("NetworkingError")?setTimeout(()=>n.retryCreateMultipartUpload(e,t,i),5e3):i(r):(n.userUploadId=o.UploadId,n.initialized=!0,t())}))}updateCredentials(){return new Promise(async(e,t)=>{const[i,n]=await this.recorderModel.getFederatedAwsToken({region:this.region});if(i){const t=i.data;this.setS3Credentials(t),e()}n&&(console.error("error updating credentials",n),-1!=JSON.stringify(n).indexOf("Network Error")?this.retryUpdateCredentials(e,t):t(n))})}async retryUpdateCredentials(e,t){const[i,n]=await this.recorderModel.getFederatedAwsToken({region:this.region});if(i){const t=i.data;this.setS3Credentials(t),e()}n&&-1!=JSON.stringify(n).indexOf("Network Error")&&setTimeout(()=>this.retryUpdateCredentials(e,t),5e3)}setS3Credentials(e){if(e.error)return console.error("error getting federated aws token",e),void reject(e.error);const t=1e3*(window.HippoVideo&&window.HippoVideo.AppRegistry&&window.HippoVideo.AppRegistry.S3ApiTimeout?Number(window.HippoVideo.AppRegistry.S3ApiTimeout):600);try{this.cognitoIdentityCredentials.clearCachedId()}catch(e){}this.cognitoIdentityCredentials=new q.a({IdentityPoolId:this.IDENTITY_POOL_ID,IdentityId:e.identity_id,Logins:{"cognito-identity.amazonaws.com":e.token}},{region:this.region,httpOptions:{timeout:t},maxRetries:0}),ke.a.events.on("retry",(function(e){if("RequestTimeTooSkewed"===e.error.name){let t=Date.parse(e.httpResponse.headers.date),i=(new Date).getTime();ke.a.config.systemClockOffset=t-i,e.error.retryable=!0}})),this.s3=new Se.a({apiVersion:"2006-03-01",region:this.region,credentials:this.cognitoIdentityCredentials,params:{Bucket:this.bucket},useAccelerateEndpoint:this.useAccelerate,httpOptions:{timeout:t},maxRetries:0})}refreshCognitoCredentials(){this.cognitoIdentityCredentials&&this.cognitoIdentityCredentials.refresh(e=>{console.error("REFRESH COGNITO CRED ",e)})}getCognitoIdentityCredentialsObject(e){return new q.a({IdentityPoolId:this.IDENTITY_POOL_ID,IdentityId:e.identity_id,Logins:{"cognito-identity.amazonaws.com":e.token}},{region:this.region,httpOptions:{timeout:AWS_API_TIMEOUT}})}uploadPart(e,t,i,n,r){console.info("S3Uploader.uploadBlob uploading");const o=i.size;let a={Bucket:this.userUploadBucket,Key:this.userUploadKey,PartNumber:t,UploadId:this.userUploadId,Body:i};return this.s3.uploadPart(a,(function(i,a){i?r(e,i,t):n(e,o,{ETag:a.ETag,PartNumber:Number(this.request.params.PartNumber)})}))}uploadPartSuccess(e){console.info("part upload complete",e)}uploadPartError(e,t){console.error("UPLOAD ERROR ",e,"Params ",t)}finishMultipartUpload(e){const t=this;return new Promise((i,n)=>{e.sort((function(e,t){return e.PartNumber-t.PartNumber}));let r={Bucket:t.userUploadBucket,Key:t.userUploadKey,UploadId:t.userUploadId,MultipartUpload:{Parts:e}};t.s3.completeMultipartUpload(r,(function(e,o){e?(console.error(e,e.stack),-1!=JSON.stringify(e).indexOf("Network Error")?setTimeout(()=>t.retryFinishMultipartUpload(r,i,n),5e3):n({error:e,assetId:t.assetId})):i({data:o,assetId:t.assetId})}))})}async retryFinishMultipartUpload(e,t,i){let n=this;this.s3.completeMultipartUpload(e,(function(r,o){r?(console.error(r,r.stack),-1!=JSON.stringify(r).indexOf("Network Error")?setTimeout(()=>n.retryFinishMultipartUpload(e,t,i),5e3):i({error:r,assetId:n.assetId})):t({data:o,assetId:n.assetId})}))}cancelMultipartUpload(e){return new Promise((t,i)=>{for(let t in e){const i=e[t];try{i.abort()}catch(e){}}const n={Bucket:this.userUploadBucket,Key:this.userUploadKey,UploadId:this.userUploadId};this.s3.abortMultipartUpload(n,(function(e,n){e?(console.error("error while aborting multipartupload",{error:e}),i(e)):(console.warn("aborted multipartupload",{res:n}),t(n))}))})}onUploadPartProgress(){that.uploadStatsData[this.params.PartNumber].completed=progress.loaded;var e=Math.round(progress.loaded/progress.total*100),t=(new Date).getTime();if(curProgressCallStartTime=t,navigator.connection&&rttValues.push(navigator.connection.rtt),(new Date).getTime()/1e3-rttValueLastUpdated>=pushRttValuePerXSeconds){e=Math.round(progress.loaded/progress.total*100);for(var i=(new Date).getTime(),n=uploadParams.Body.size*e/100/(i-startTime),r=0,o=0;o<rttValues.length;o++)r+=rttValues[o];console.info("RTT VALUE UPDATE",{asset_id:that.assetId,part_num:Number(that.fileUploadRates.length+e/100||0),on_upload_complete:!1,rtt:Number(r/rttValues.length||0),avg_upload_rate:Number(n||0),is_finished:that.finishedRecording,media_type:that.type,user_upload_key:that.userUploadKey}),rttValueLastUpdated=(new Date).getTime()/1e3}that.calculateProgress()}async uploadFile(e,t){try{const i=this;await this.updateCredentials();const n={Bucket:i.userUploadBucket,Key:i.userUploadKey,Body:e,ACL:i.acl};return[await this._startS3Upload(n,t),null]}catch(e){return[null,e]}}cancelFileUpload(){try{setTimeout(this.uploadResponse.abort.bind(this.uploadResponse),1e3)}catch(e){}}_startS3Upload(e,t){return new Promise((i,n)=>{this.uploadResponse=this.s3.upload(e,(function(e,t){e?(-1!=JSON.stringify(e).indexOf("TimeoutError")||-1!=JSON.stringify(e).indexOf("Timeout")||JSON.stringify(e).indexOf("NetworkingError"),console.error("There was an error uploading video: ",e),n(e.message)):i(t)})).on("httpUploadProgress",(function(e){t&&t(e)}))})}sendAbortRequest(e){var t=this,i={Bucket:t.userUploadBucket,Key:t.userUploadKey,UploadId:t.userUploadId};t.s3.abortMultipartUpload(i,(function(i,n){i?console.error("error while aborting multipartupload",{error:i}):console.warn("aborted multipartupload",{res:n}),e(t)}))}abortCurrentUploads(e){for(var t in e.uploadPartHandlers)try{e.uploadPartHandlers.hasOwnProperty(t)&&(e.uploadPartHandlers[t].params&&(e.uploadStatsData[e.uploadPartHandlers[t].params.PartNumber].completed=0),e.uploadPartHandlers[t].abort(),delete e.uploadPartHandlers[t])}catch(e){}e.uploadPartHandlers={}}}let Ee,Te;const Pe=new WeakMap,Ie=new WeakMap,Ae=new WeakMap,Re=new WeakMap,Oe=new WeakMap;let Ne={get(e,t,i){if(e instanceof IDBTransaction){if("done"===t)return Ie.get(e);if("objectStoreNames"===t)return e.objectStoreNames||Ae.get(e);if("store"===t)return i.objectStoreNames[1]?void 0:i.objectStore(i.objectStoreNames[0])}return Me(e[t])},set:(e,t,i)=>(e[t]=i,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function De(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(Te||(Te=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Be(this),t),Me(Pe.get(this))}:function(...t){return Me(e.apply(Be(this),t))}:function(t,...i){const n=e.call(Be(this),t,...i);return Ae.set(n,t.sort?t.sort():[t]),Me(n)}}function Le(e){return"function"==typeof e?De(e):(e instanceof IDBTransaction&&function(e){if(Ie.has(e))return;const t=new Promise((t,i)=>{const n=()=>{e.removeEventListener("complete",r),e.removeEventListener("error",o),e.removeEventListener("abort",o)},r=()=>{t(),n()},o=()=>{i(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",r),e.addEventListener("error",o),e.addEventListener("abort",o)});Ie.set(e,t)}(e),t=e,(Ee||(Ee=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,Ne):e);var t}function Me(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,i)=>{const n=()=>{e.removeEventListener("success",r),e.removeEventListener("error",o)},r=()=>{t(Me(e.result)),n()},o=()=>{i(e.error),n()};e.addEventListener("success",r),e.addEventListener("error",o)});return t.then(t=>{t instanceof IDBCursor&&Pe.set(t,e)}).catch(()=>{}),Oe.set(t,e),t}(e);if(Re.has(e))return Re.get(e);const t=Le(e);return t!==e&&(Re.set(e,t),Oe.set(t,e)),t}const Be=e=>Oe.get(e);function Fe(e,t,{blocked:i,upgrade:n,blocking:r,terminated:o}={}){const a=indexedDB.open(e,t),s=Me(a);return n&&a.addEventListener("upgradeneeded",e=>{n(Me(a.result),e.oldVersion,e.newVersion,Me(a.transaction))}),i&&a.addEventListener("blocked",()=>i()),s.then(e=>{o&&e.addEventListener("close",()=>o()),r&&e.addEventListener("versionchange",()=>r())}).catch(()=>{}),s}const Ve=["get","getKey","getAll","getAllKeys","count"],Ue=["put","add","delete","clear"],ze=new Map;function He(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(ze.get(t))return ze.get(t);const i=t.replace(/FromIndex$/,""),n=t!==i,r=Ue.includes(i);if(!(i in(n?IDBIndex:IDBObjectStore).prototype)||!r&&!Ve.includes(i))return;const o=async function(e,...t){const o=this.transaction(e,r?"readwrite":"readonly");let a=o.store;return n&&(a=a.index(t.shift())),(await Promise.all([a[i](...t),r&&o.done]))[0]};return ze.set(t,o),o}Ne=(e=>({...e,get:(t,i,n)=>He(t,i)||e.get(t,i,n),has:(t,i)=>!!He(t,i)||e.has(t,i)}))(Ne);const je={SCREEN:"screen",WEBCAM:"webcam"},qe=e=>"hippo_video_db_"+e,$e=async(e,t,i,n)=>{try{return await e.add(t,n,i),!0}catch(e){return console.error("EXCEPTION WHILE ADDING DATA ",e),!1}},We=async(e,t)=>{try{return await e.clear(t),!0}catch(e){return console.warn("EXCEPTION WHILE CLEARING STORE ",e),!1}};class Ge{constructor(e,t,i){this.videoId=e,this.screen=t,this.webcam=i}async initialize(){try{this.db||(this.db=await((e,t,i)=>Fe(qe(e),1,{upgrade(e){t&&e.createObjectStore(je.SCREEN),i&&e.createObjectStore(je.WEBCAM)}}))(this.videoId,this.screen,this.webcam)),this.incompleAssetsDb||(this.incompleAssetsDb=await Fe("hippo_video_incomplete_uploads",1,{upgrade(e){e.createObjectStore("videos")}})),await(async(e,t,i)=>!!await e.get(t,i))(this.incompleAssetsDb,"videos",this.videoId)||await $e(this.incompleAssetsDb,"videos",this.videoId,new Date)}catch(e){console.error("OPEN DB EXCEPTION",e)}}async addData(e,t,i){try{if(this.videoId){this.db||await this.initialize();let n=!0,r=!0;return e===je.SCREEN&&(n=await $e(this.db,je.SCREEN,t,i)),e===je.WEBCAM&&(r=await $e(this.db,je.WEBCAM,t,i)),!(!n||!r)}}catch(e){console.error("ADD EXECEPTION ",e)}return!1}getData(e,t){let i=je.WEBCAM;return e===je.SCREEN&&(i=je.SCREEN),new Promise(async(e,n)=>{try{e(await this.db.get(i,t))}catch(e){console.error(e),n(e)}})}async getAllData(){for(let e in je)try{let t=je[e];const i=this.db.transaction(t).objectStore(t);let n=[];for(;;){let e=await i.openCursor();if(n.push(e.value),e=await e.continue(),!e)break}}catch(e){console.error(e)}}async clearData(e){await(async(e,t,i)=>{console.log(e,t,i);try{return await e.delete(t,i),!0}catch(e){return console.error("EXCEPTION WHILE DELETING KEY ",e),!1}})(this.incompleAssetsDb,"videos",e)||console.error("KEY DELETION FAILED");await(async e=>(await We(e,je.SCREEN),await We(e,je.WEBCAM),!0))(this.db)||console.error("STORE CLEAR FAILED"),this.db.close(),this.incompleAssetsDb.close(),this.db=null,this.incompleAssetsDb=null;var t;return await(t=qe(e),new Promise((e,i)=>{const n=window.indexedDB.deleteDatabase(t);n.onerror=t=>{console.error("Error deleting database.",t),e(!1)},n.onsuccess=t=>{console.log("Database deleted successfully"),e(!0)}}))||console.error("DB DELETION FAILED"),!0}}const Ke={SCREEN:1,WEBCAM:2,FILE:3},Ye={1:"screen",2:"webcam"};class Je{constructor({webCam:e,audio:t,screenRecord:i,file:n,recorderModel:r,uploadProgressCallback:o}){this.recorderModel=r,this.uploaderData={},this.uploaderParts={},this.uploadedParts={},this.indexedDBWriteStatus={},this.currentUploaderDataSize={},this.totalUploaderDataSize={},this.uploaders={},this.incompleteUploadParts={},this.uploadersCompleted={},this.uploadCompleted={},this.uploadPartHandlers={},this.uploadCompletedSize={},this.uploadEntitiesForEachFile={},this.finishUploadCalled=!1,this.uploadProgressCallback=o,this.uploadProgressDetails={type:"upload"},this.uploadStartTime=null,this.optimalUploadTime=1400,this.uploadTimeThreshold=85e3,this.desirableProcessCount={},this.uploadQueue={},this.latestUploadTime={},this.uploadError={},this.currentProcessCount={},this.uploadStats={},this.uploadRetries={},this.activeUploaderTypes=[],this.cognitoError={},this.UPLOAD_RETRY_INTERVAL=5e3,(e||t)&&this.addUploader(Ke.WEBCAM),i&&this.addUploader(Ke.SCREEN),n&&this.addUploader(Ke.FILE),this.checkAndCompleteMultipartUpload=this.checkAndCompleteMultipartUpload.bind(this),this.onUploadPartSuccess=this.onUploadPartSuccess.bind(this),this.onUploadPartFailure=this.onUploadPartFailure.bind(this),this.sendUploadProgress=this.sendUploadProgress.bind(this),this.calculateProgress=this.calculateProgress.bind(this)}initializeUploaders(e){return new Promise(async(t,i)=>{this.uploaderConfig=e,this.videoIDBManager=new Ge(e.asset_id,e.screenRecord,e.webcamId),this.videoIDBManager.initialize();try{e.webcamId&&await this.initializeUploader(Ke.WEBCAM),e.screenRecord&&await this.initializeUploader(Ke.SCREEN),t()}catch(e){this.uploadError[e.type]=!0,i(e)}})}addUploader(e){this.activeUploaderTypes.push(e),this.uploaderData[e]={},this.indexedDBWriteStatus[e]={},this.uploadCompletedSize[e]=0,this.uploadCompleted[e]={},this.uploadedParts[e]=[],this.incompleteUploadParts[e]=[],this.uploadersCompleted[e]=!1,this.currentUploaderDataSize[e]=0,this.totalUploaderDataSize[e]=0,this.uploaderParts[e]=1,this.uploadQueue[e]=[],this.uploadRetries[e]={},this.uploadError[e]=!1,this.desirableProcessCount[e]=1,this.currentProcessCount[e]=0,this.uploadStats[e]={},this.cognitoError[e]=!1}initializeUploader(e){return new Promise((t,i)=>{if(!e||!Object.values(Ke).includes(e))throw new Error("INVALID_UPLOADER_TYPE");let n={bucket:this.uploaderConfig.uploadBucket,acl:"private",digest:this.uploaderConfig.digest,asset_id:this.uploaderConfig.asset_id,recorderModel:this.recorderModel};e===Ke.WEBCAM&&(n.key=this.uploaderConfig.webcamKey),e===Ke.SCREEN&&(n.key=this.uploaderConfig.screenKey);const r=new _e(n);r.startMultiartUpload().then(()=>{this.uploaders[e]=r,this.uploadPartHandlers[e]={},this.checkAndUpload(e),this.uploadStartTime=new Date,t()}).catch(t=>i({type:e,error:t}))})}retryUpload(){return new Promise((e,t)=>{let i=0;this.activeUploaderTypes.forEach(n=>{this.uploadError[n]?(this.resetUploaders(n),this.initializeUploader(n).then(()=>{i++,i===this.activeUploaderTypes.length&&(this.uploadError[n]=!1,e())}).catch(e=>{this.uploadError[e.type]=!0,t(e)})):i++})})}resetUploaders(e){this.uploaders[e]=null,this.uploadCompletedSize[e]=0,this.uploadCompleted[e]={},this.uploadedParts[e]=[],this.incompleteUploadParts[e]=[],this.uploadersCompleted[e]=!1,this.currentUploaderDataSize[e]=0,this.uploadRetries[e]={},this.uploadProgressDetails={type:"upload"},this.uploadError[e]=!1,this.desirableProcessCount[e]=1,this.currentProcessCount[e]=0,this.uploadStats[e]={}}calculateProgress(e){let t=e&&e.loaded||0,i=e&&e.total||0;if(!e){if(this.uploadProgressDetails.partError)for(let e in this.uploadCompletedSize)t+=this.uploadCompletedSize[e];else for(let e in this.uploadCompleted){const i=this.uploadCompleted[e];for(let e in i)t+=i[e]}for(let e in this.totalUploaderDataSize)i+=this.totalUploaderDataSize[e]}let n=t/((new Date-this.uploadStartTime)/1e3),r=null,o=0;return n>0&&(r=Math.round((i-t)/n),o=Math.round(t/i*100)),{type:"upload",totalSize:i,totalUploaded:t,completedPercent:o,timeRemaining:r,partError:this.uploadProgressDetails.partError,completed:!1}}setUploadProgressCallback(e){this.uploadProgressCallback?e=this.uploadProgressCallback:this.uploadProgressCallback=e,e(this.uploadProgressDetails)}getUploadProgressDetails(){return this.uploadProgressDetails}isUploadComplete(){return!!this.uploadProgressDetails&&!!this.uploadProgressDetails.completed}onDataAvailable(e,t){if(!e||!Object.values(Ke).includes(e))throw new Error("INVALID_UPLOADER_TYPE");if(!this.uploaderData.hasOwnProperty(e))throw new Error("UPLOADER_NOT_FOUND");const i=this.uploaderParts[e];this.uploaderData[e][i]||(this.uploaderData[e][i]=[]),this.uploaderData[e][i].push(t);const n=this.getDataSize(t);if(this.currentUploaderDataSize[e]+=n,this.totalUploaderDataSize[e]+=n,this.currentUploaderDataSize[e]>5242880||this.finishUploadCalled){this.uploadQueue[e].push({partNumber:i}),this.currentUploaderDataSize[e]=0,this.uploadRetries[e][i]=0,this.uploadStats[e][i]={},this.indexedDBWriteStatus[e][i]=!1;const t=e===Ke.SCREEN?je.SCREEN:je.WEBCAM;this.uploaders[e]&&(this.videoIDBManager.addData(t,i,this.uploaderData[e][i])&&(this.indexedDBWriteStatus[e][i]=!0,delete this.uploaderData[e][i]),this.checkAndUpload(e)),!this.finishUploadCalled&&this.uploaderParts[e]++}}async checkAndUpload(e){if(!this.uploadError[e]){if(this.latestUploadTime[e]){const t=Math.floor(this.uploadTimeThreshold/this.latestUploadTime[e]);this.latestUploadTime[e]<this.uploadTimeThreshold?(this.slowUpload=!1,this.desirableProcessCount[e]=Math.max(Math.round(.75*t),1)):(this.slowUpload=!0,this.desirableProcessCount[e]=Math.max(t,1))}if(this.cognitoError[e])try{await this.uploaders[e].updateCredentials()}catch(e){}if(this.currentProcessCount[e]<this.desirableProcessCount[e]){let t=Math.min(this.desirableProcessCount[e]-this.currentProcessCount[e],this.uploadQueue[e].length);for(;t>0;){const i=this.uploadQueue[e].pop(0);this.uploadStats[e][i.partNumber]||(this.uploadStats[e][i.partNumber]={}),this.uploadStats[e][i.partNumber].start=(new Date).getTime(),this.constructAndUploadBlob(e,i.partNumber),this.currentProcessCount[e]++,t--}}}}sendUploadProgress(){this.uploadProgressCallback&&this.uploadProgressCallback(this.uploadProgressDetails)}async constructAndUploadBlob(e,t){const i=this;let n=this.uploaderData[e][t];if(this.indexedDBWriteStatus[e][t]){let i=e===Ke.SCREEN?je.SCREEN:je.WEBCAM;n=await this.videoIDBManager.getData(i,t)}let r=new Blob(n,{type:"video/webm"});this.incompleteUploadParts[e]=this.incompleteUploadParts[e].filter(e=>t!==e),this.uploaders[e]?(this.uploadPartHandlers[e][t]=this.uploaders[e].uploadPart(e,t,r,this.onUploadPartSuccess,this.onUploadPartFailure),this.uploadPartHandlers[e][t].on("httpUploadProgress",n=>{this.uploadProgressDetails.partError=!1,i.uploadCompleted[e][t]=n.loaded,i.uploadProgressDetails=i.calculateProgress(),i.sendUploadProgress()})):this.incompleteUploadParts[e].push(t)}finishUpload(){this.finishUploadCalled=!0;const e=this;return new Promise((t,i)=>{if(Object.keys(this.uploaders).length===this.activeUploaderTypes.length)e.checkAndCompleteMultipartUpload(t,i);else{const n=setInterval(()=>{Object.keys(this.uploaders).length===this.activeUploaderTypes.length?(clearInterval(n),e.checkAndCompleteMultipartUpload(t,i)):console.warn("UPLOADER STILL NOT INITALIZED")},1e3)}})}checkAndCompleteMultipartUpload(e,t){for(let i of Object.values(Ke)){if(!this.uploaders[i])continue;if(this.uploadersCompleted[i])continue;this.checkAndUpload(i);const n=setInterval(()=>{this.uploadError[i]&&clearInterval(n),this.uploaderParts[i]===this.uploadedParts[i].length&&(clearInterval(n),this.uploaders[i].finishMultipartUpload(this.uploadedParts[i]).then(({data:n,assetId:r})=>{if(window.isError)return this.uploadProgressDetails&&(this.uploadProgressDetails.error=!0,this.uploadProgressDetails.errorType="MULTIPART_FINISH",this.sendUploadProgress()),void t(r);this.uploadersCompleted[i]=!0,this.isAllUploadCompleted()&&(this.uploadProgressDetails&&(this.uploadProgressDetails.completed=!0,this.sendUploadProgress()),e(r),this.videoIDBManager.clearData(r))}).catch(({error:e,assetId:i})=>{this.uploadProgressDetails&&(this.uploadProgressDetails.error=!0,this.uploadProgressDetails.errorType="MULTIPART_FINISH",this.sendUploadProgress()),t(i)}))},1e3)}}isAllUploadCompleted(){let e=!0;for(let t of Object.values(Ke))!1===this.uploadersCompleted[t]&&(e=!1);return e}onUploadPartSuccess(e,t,i){this.uploadProgressDetails.partError=!1,this.uploadCompletedSize[e]+=t,this.uploadedParts[e].push(i),this.currentProcessCount[e]--;const n=i.PartNumber,r=(new Date).getTime()-this.uploadStats[e][i.PartNumber].start;this.uploadStats[e][i.PartNumber].tt=r,t>=5242880&&(this.latestUploadTime[e]=r),this.incompleteUploadParts[e]=this.incompleteUploadParts[e].filter(e=>e!==n),this.checkAndUpload(e)}onUploadPartFailure(e,t,i){this.uploadProgressDetails.partError=!0,this.uploadProgressDetails=this.calculateProgress(),-1==JSON.stringify(t).indexOf("RequestAbortedError")&&(-1!=JSON.stringify(t).indexOf("TimeoutError")||-1!=JSON.stringify(t).indexOf("Timeout")||JSON.stringify(t).indexOf("NetworkingError"),console.error("s3.uploadPart error ",{partNumber:i,error:t}),-1!=JSON.stringify(t).indexOf("CredentialsError")&&(this.cognitoError[e]=!0),this.currentProcessCount[e]--,this.uploadError[e]||setTimeout(()=>{this.latestUploadTime[e]=9999999,this.uploadStats[e][i].start=(new Date).getTime(),this.uploadRetries[e][i]+=1,this.uploadQueue[e].push({partNumber:i}),this.uploadStats[e][i].retries=this.uploadRetries[e][i],this.uploadStats[e][i].completed=0,this.checkAndUpload(e)},this.UPLOAD_RETRY_INTERVAL),this.incompleteUploadParts[e].includes(i)||this.incompleteUploadParts[e].push(i))}uploadFile(e,t,i){e&&(e.recorderModel=this.recorderModel),this.uploadStartTime=new Date,this.fileUploader=new _e(e);return this.fileUploader.uploadFile(t,e=>{i&&i(this.calculateProgress(e))})}cancelImport(){this.fileUploader&&this.fileUploader.cancelFileUpload()}cancelMultipartUpload(){for(let e of Object.values(Ke))this.uploadPartHandlers[e]&&this.uploaders[e].cancelMultipartUpload(this.uploadPartHandlers[e])}async getObjectUrls({recordingConfig:e}){const t={};for(let i of Object.values(Ke)){const n=this.uploaderParts[i];let r=[];for(let e=1;e<=n;e++){let t=this.uploaderData[i][e];if(this.indexedDBWriteStatus[i][e]){let n=i===Ke.SCREEN?je.SCREEN:je.WEBCAM;t=await this.videoIDBManager.getData(n,e)}r=r.concat(t)}let o="video";i!==Ke.WEBCAM||e.webCam||(o="audio");let a=o+"/mp4";MediaRecorder.isTypeSupported("video/webm")&&(a="video/webm"),r.length>0&&(t[Ye[i]]=URL.createObjectURL(new Blob(r,{type:a})))}return t}getDataSize(e){return e.size?e.size:e.byteLength}destroy(){}}var Xe=i(130);class Qe{constructor({token:e,tokenType:t,email:i}){const n={baseURL:(window._HVDomain||"https://www.hippovideo.io")+me.a,headers:{accept:"application/json"}};if(t===ee.e.RECORDER_SDK_TOKEN){let i=`${t}$$${e}`;n.headers.Authorization="Basic "+btoa(i)}if(t===ee.e.AUTHENTICATION_TOKEN){let r=`${t}$$${e}$$${i}`;n.headers.Authorization="Basic "+btoa(r)}this.axiosInstance=H.a.create(n)}statusOf({operationId:e,assetId:t,expectedOperationType:i}){const n={operation_id:e,asset_id:t,expected_operation_type:i};return Object(Xe.a)({axiosInstance:this.axiosInstance,url:"/video/status",method:"get",params:n})}}var Ze=i(224),et=i.n(Ze);class tt{constructor({interval:e=3e3,pollTimeout:t=7200,token:i,tokenType:n,email:r}){this.interval=e,t=(new Date).getTime()/1e3+t,this.latestWindow=[],this.token=i,this.tokenType=n,this.statusPollerModel=new Qe({token:i,tokenType:n,email:r}),this.logger=new he({module:"VIDEO_STATUS_POLLER",tokenType:n,token:i})}getStatus({operationId:e,waitingHandler:t,progressHandler:i,completeHandler:n,errorHandler:r}){this.setDefaults(),e&&e.constructor===Array?(this.operationIdArray=e,this.operationId=this.operationIdArray.pop()):this.operationId=e,this.waitingHandler=t,this.progressHandler=i,this.completeHandler=n,this.errorHandler=r,this.ping()}async ping(){if("stop"===this.pollingAction)return;if((new Date).getTime()/1e3>this.pollTimeout)return void(this.errorHandler&&this.errorHandler(et.a.pingTooLong));if(null==this.operationId&&null==this.assetId)return;const[e,t]=await this.statusPollerModel.statusOf({operationId:this.operationId,assetId:this.assetId,expectedOperationType:this.expectedOperationType});if(e){let t=e.data;if(console.log("EVENT ",t,this.interval),!t)return void setTimeout(()=>this.ping(),this.interval);if(null===t||"null"===t||""===JSON.stringify(t).trim())return setTimeout(()=>this.ping(),this.interval),void this.logger.error("Event is empty",{stackTrace:"Null value returned for statuspoller ",assetId:this.assetId,operationId:this.operationId});if(void 0===t.status&&t.operation_id)return void setTimeout(()=>this.ping(),this.interval);if("error"==t.status)this.pollErrorCount++,this.pollErrorCount<=4&&setTimeout(()=>this.ping(),this.interval);else if(50==t.status)this.waitingHandler&&this.waitingHandler(t.data.text),setTimeout(()=>this.ping(),this.interval);else if(51==t.status||52==t.status){if(t.data.progress>=0&&t.data.progress<=100&&(this.latestWindow.push(t.data),this.latestWindow.length>3&&this.latestWindow.splice(0,this.latestWindow.length-3)),this.latestWindow.length>1){var i=this.latestWindow[this.latestWindow.length-1].progress-this.latestWindow[0].progress,n=this.latestWindow[this.latestWindow.length-1].ts-this.latestWindow[0].ts;i>0&&n>0&&(this.timeRemaining=Math.round(n*(100-this.latestWindow[this.latestWindow.length-1].progress)/i))}this.progressHandler&&this.progressHandler(t.data.text,t.data.progress,this.timeRemaining),setTimeout(()=>this.ping(),this.interval)}if(("error"==t.status&&this.pollErrorCount>4||54==t.status)&&this.errorHandler){var r=et.a.somethingWentWrong;null!=t.data&&null!=t.data.text&&(r=t.data.text);var o={reason:r,state:t.data.state};this.errorHandler(o)}53==t.status&&(null!=this.expectedOperationType&&t.operationtype!=this.expectedOperationType?(t.data.text=et.a.processPending,this.progressHandler(t.data.text,t.data.progress,this.timeRemaining,t.operationtype,t.status),setTimeout(()=>this.ping(),this.interval)):this.operationIdArray&&this.operationIdArray.length>0?(this.operationId=this.operationIdArray.pop(),this.ping()):this.completeHandler&&this.completeHandler(t))}if(t&&(setTimeout(()=>this.ping(),this.interval),!this.clientLogSent)){var a={authoringAssetId:this.assetId,description:"STATUS_POLLER_ERROR",stackTrace:"Error while connecting server status from server. assetId-"+this.assetId+" status-"+t.status};this.logger.error("STATUS POLLER ERROR",a),this.clientLogSent=!0}}stop(){this.pollingAction="stop"}setDefaults(){this.operationIdArray=[],this.assetId=void 0,this.expectedOperationType=void 0,this.operationId=void 0,this.pollErrorCount=0,this.timeRemaining=void 0,this.pollingAction,this.clientLogSent=!1}}var it=i(129),nt=i.n(it),rt=i(226),ot=i.n(rt);const at=({webcam:e=!0,audio:t=!0})=>new Promise((i,n)=>{st({webcam:e,audio:t}).then(({error:e})=>{e?n():i()}).catch(n)}),st=({webcam:e=!0,audio:t=!0})=>new Promise((i,n)=>{navigator.mediaDevices.enumerateDevices().then(n=>{let r=null;const o={};e&&(o.webcam=[]),t&&(o.audio=[]),n.forEach(i=>{if((e||"videoinput"!==i.kind)&&(t||"audioinput"!==i.kind)&&["audioinput","videoinput"].includes(i.kind)){if(""===i.deviceId&&""===i.label)return void(r="DEVICE_PERMISSION_NOT_GRANTED");"videoinput"===i.kind&&o.webcam.push(i),"audioinput"===i.kind&&o.audio.push(i)}}),i({error:r,devices:o})}).catch(n)}),lt=e=>{let t="Low";return e>=1920?t="High":e>=1024&&(t="Good"),t};var ct=class{constructor({recordingConfiguration:e,token:t,tokenType:i,email:n,integrationType:r=ee.q.PRODUCT,extensionId:o,initiator:a,logID:s,recorderAPIUtils:l,recorderId:c,recorderEvtClass:d}){if(!e)throw new Error("INVALID_CONFIGURATION");this.recordingConfiguration=e,this.token=t,this.tokenType=i,this.email=n,this.recordDetails={},this.recorderId=c,this.recorderEvtClass=d,this.recorderInitiator=a,this.preprocessCompleted=!1,this.uploadCompleted=!1,this.integrationType=r,this.currentWebcamStreamConfig=null,this.currentScreenStreamConfig=null,this.createRecordingRef=null,this.deliveryToken=null,this.projectJson=null,this.extensionRecording=!1,this.recorderAPIUtils=l,this.extensionAvailable=!1,this.webcamConstraints=ee.j,this.audioConstraints=ee.f,this.screenConstraints=ee.g,this.logUID=s||U({integrationType:r,tokenType:i}),this.exponentialBackoff={retryCount:0},this.logger=new he({integrationType:r,module:"RECORDER_CORE",logUID:this.logUID,tokenType:i,token:t}),this.recorderModel=new ve({token:t,tokenType:i,email:n}),this.extensionAvailable=!1,this.logger.info("[RECORDER_INITIALIZED]",{recording_configuration:e})}updateConfig({recordingConfiguration:e,logID:t}){return e&&(this.recordingConfiguration=e),t&&(this.logID=t),this.logger.info("[RECORER_CONFIG_UPDATED]",{recording_configuration:e,log_id:t}),this}updateConstraints(e){let t=Object(V.m)({...e,oldWebcamConstraints:this.webcamConstraints,oldAudioConstraints:this.audioConstraints,oldScreenConstraints:this.screenConstraints});t.screen&&(this.screenConstraints=t.screen),t.audio&&(this.audioConstraints=t.audio),t.webcam&&(this.webcamConstraints=t.webcam)}getStreamConfig(){let e={};if(this.recordingConfiguration.screenRecord){const t={audio:this.recordingConfiguration.systemAudio,video:{frameRate:ee.h,height:Object(V.g)(this.recordingConfiguration.resolution).height,width:Object(V.g)(this.recordingConfiguration.resolution).width}};e.screen=t}if(this.recordingConfiguration.audio||this.recordingConfiguration.webCam){const t={audio:this.recordingConfiguration.audio,video:this.recordingConfiguration.webCam};this.recordingConfiguration.webCam&&(t.video={},this.recordingConfiguration.webcamSourceId&&(t.video.deviceId=this.recordingConfiguration.webcamSourceId),this.recordingConfiguration.aspectRatio&&"default"!==this.recordingConfiguration.aspectRatio&&(t.video.aspectRatio=this.recordingConfiguration.aspectRatio)),this.recordingConfiguration.audio&&(t.audio={},this.recordingConfiguration.audioSourceId&&(t.audio.deviceId=this.recordingConfiguration.audioSourceId)),e.webcam=t}return e}isExtensionAvailable(){return new Promise((e,t)=>{try{Object(V.j)(this.integrationType).then(t=>{e(t)}).catch(()=>{t()})}catch(e){t()}})}createRecording(){this.uploadCompleted=!1,this.createRecordingError=!1,this.exponentialBackoff.retryCount=0,this.activateWarning(),this.logger.info("[CREATE_RECORDING]",{recording_configuration:this.recordingConfiguration});const{webCam:e,audio:t,screenRecord:i}=this.recordingConfiguration;return this.s3UploadManager=new Je({webCam:e,audio:t,screenRecord:i,recorderModel:this.recorderModel}),this.recordType=ee.c.RECORD,this._sendCreateRecordingRequest()}sendCreateRecordingRequest(){return!this.createRecordingError||(this.logger.info("[SENDING_CREATE_RECORDING_REQUEST]"),this.exponentialBackoff.retryCount=ee.m,this.exponentialBackoff.setTimeoutRef&&clearTimeout(this.exponentialBackoff.setTimeoutRef),this.recorderModel.cancelRequest({type:"create_recording"}),this._sendCreateRecordingRequest())}createVideoImport({params:e,uploadStartedCallback:t,updateProgress:i,file:n}){this.uploadCompleted=!1,this.createRecordingError=!1,this.activateWarning(this.logger),this.s3UploadManager=new Je({file:!0,recorderModel:this.recorderModel});const r=this;return this.recordType=ee.c.IMPORT,this.logger.info("[IMPORT_VIDEO_REQUEST]",{params:e}),new Promise(async(o,a)=>{const[s,l]=await this.recorderModel.createVideoImport({logUID:this.logUID,...e});if(this.logger.info("[IMPORT_VIDEO_RESPONSE]",{success:s,error:l}),s){const e=s.data;this._updateRecordDetails(e);const l={bucket:e.upload_bucket,key:e.upload_key,digest:this.token,acl:"private"},c=e.authoring_asset_id;t&&t();const[d,u]=await r.s3UploadManager.uploadFile(l,n,e=>{i(e)});if(this.logger.info("[VIDEO_UPLOAD_COMPLETED]",{success:d,error:u}),d){i({type:"upload",completedPercent:100,completed:!0}),r.uploadCompleted=!0;const[t,n]=await r.recorderModel.convertVideo({assetId:c,videoId:e.upload_video_id,compressionRequired:!1,saveAsNew:!0,token:this.token,convertSpeed:"lessonly"==this.integrationType?"ultrafast":void 0});if(this.logger.info("[VIDEO_CONVERSION_COMPLETED]",{success:t,error:n}),t){const e=t.data;r.videoConverting({convertVideoResponse:e,assetId:c,updateProgress:i,resolve:o,reject:a})}n&&(this.removeWarning(),a(n))}u&&(this.removeWarning(),a(u),i({type:"upload",completedPercent:0,completed:!1}))}l&&(this.removeWarning(),a(l))})}cancelVideoImport(){this.s3UploadManager.cancelImport();try{this.recorderModel.cancelRequest({type:"import_video"}),this.recorderModel.cancelRequest({type:"import_convert"}),this.importStatusPoller&&this.importStatusPoller.stop()}catch(e){}}async closeAudioContext(){try{this.audioContext&&await this.audioContext.close()}catch(e){}}getStream(e={}){let{preview:t}=e;this.preview=t;let i=this.getStreamConfig(),{webcam:n=ee.i,screen:r=ee.g}=i;t&&(delete i.screen,r=null),!1===this.recordingConfiguration.webCam&&!1===this.recordingConfiguration.audio&&(n=!1),!1===this.recordingConfiguration.screenRecord&&(r=!1);let o={};return this.logger.info("[GET_STREAMS]",{options:i}),this.closeAudioContext(),new Promise(async(e,a)=>{if(this.extensionAvailable){const t={type:"get_stream",configuration:i};return void Object(V.b)({integrationType:this.integrationType,message:t}).then(t=>{"get_stream_response"===t.type&&e({_type:"url",webcamStream:t.url})}).catch(e=>{console.error(e)})}let s=!1;n&&!this.webcamStream&&(s=!0),r&&!this.screenStream&&(s=!0);const{isWebcamVideoConfigSame:l,isWebcamAudioConfigSame:c,isScreenConfigSame:d}=this.isStreamConfigSame(n,r);if(l&&c&&d&&!s)return e({message:"no_config_change",screenStream:this.screenStream,webcamStream:this.webcamStream}),void this.logger.info("[STREAM_CONFIGS_SAME]",{oldConfig:{webcam:this.currentWebcamStreamConfig,screen:this.currentScreenStreamConfig},newConfig:{webcam:n,screen:r}});t&&this.currentWebcamStreamConfig?((!this.currentWebcamStreamConfig.video&&n.video||n.video&&!l)&&this.stopWebcamStream(),(!this.currentWebcamStreamConfig.audio&&n.audio||n.audio&&!c)&&this.stopWebcamStream()):l&&c||this.stopWebcamStream(),!d&&r&&this.stopScreenStream(),this.updateConstraints({webcam:n&&n.video,audio:n&&n.audio,screen:r});try{if(r){const e=await this.getScreenStream(r);this.screenStream=e,o.screenStream=e}if(n){const e=await this.getWebcamStream(n);this.webcamStream=e,o.webcamStream=e}e(o)}catch(e){return this.recorderModel.setRecordError({errorState:e.type,logUID:this.logUID}),void a(e)}})}getWebcamStream(e){if(e.video){let t=Object.assign({},ee.j,e.video);e.video=t}return this.webcamError=!1,new Promise((t,i)=>{if(this.webcamStream)return t(this.webcamStream);this.currentWebcamStreamConfig=e;const n=setTimeout(()=>{this.webcamError=Object(V.n)("webcam",{name:"WebcamReadTimeout",message:"Timeout in fetching the stream"}),i(this.webcamError)},5e3);this.webcamStreamRequestInprogress=!0,navigator.mediaDevices.getUserMedia(e).then(e=>{this.webcamStreamRequestInprogress=!1,clearTimeout(n),this.webcamStream=e,t(e)}).catch(e=>{this.webcamStreamRequestInprogress=!1,clearTimeout(n),this.logger.info("[GET_WEBCAM_STREAM]",{error:e}),this.webcamError=Object(V.n)("webcam",e),i(this.webcamError)})})}getScreenStream(e){return new Promise((t,i)=>{if(this.screenStream)return t(this.screenStream);this.currentScreenStreamConfig=e,"function"==typeof navigator.getDisplayMedia?navigator.getDisplayMedia().then(e=>{this.screenStream=e,t(e)}).catch(e=>{this.logger.info("[GET_SCREEN_STREAM]",{error:e}),i(Object(V.n)("screen",e))}):navigator.mediaDevices.getDisplayMedia(e).then(e=>{this.screenStream=e,t(e)}).catch(e=>{this.logger.info("[GET_SCREEN_STREAM]",{error:e}),i(Object(V.n)("screen",e))})})}pauseRecording(){if(this.recordingPaused)return{status:!0};this.pauseRecordingTimer();let{screenRecord:e,webCam:t,audio:i}=this.recordingConfiguration;return e&&this.screenRecorder.pause(),(t||i)&&this.webcamRecorder.pause(),this.recordingPaused=!0,{status:!0}}resumeRecording(e=0){return this.recordingPaused?(setTimeout(()=>{this.resumeRecordingTimer();let{screenRecord:e,webCam:t,audio:i}=this.recordingConfiguration;e&&this.screenRecorder.resume(),(t||i)&&this.webcamRecorder.resume(),this.recordingPaused=!1},e),{status:!0}):{status:!0}}pauseStream({audio:e,webcam:t,screen:i}){try{if(t||e){const i=this.webcamStream.getTracks();e&&(i.filter(e=>"audio"===e.kind)[0].enabled=!1),t&&(i.filter(e=>"video"===e.kind)[0].enabled=!1)}if(i){this.screenStream.getTracks().forEach(e=>{e.enabled=!1})}return{status:!0}}catch(e){return{status:!1,error:e}}}resumeStream({audio:e,webcam:t,screen:i}){try{if(t||e){const i=this.webcamStream.getTracks();e&&(i.filter(e=>"audio"===e.kind)[0].enabled=!0),t&&(i.filter(e=>"video"===e.kind)[0].enabled=!0)}if(i){this.screenStream.getTracks().forEach(e=>{e.enabled=!0})}return{status:!0}}catch(e){return{status:!1,error:e}}}stopOnlyWebcamStream(){if(!this.webcamStream)return;this.logger.info("[STOPPING_WEBCAM_ONLY_STREAM] ",{preview:this.preview});let e=!0;try{this.webcamStream.getTracks().forEach(t=>{"video"===t.kind&&t.stop(),"audio"===t.kind&&(e=!1)})}catch(e){}e&&(this.webcamStream=null)}stopOnlyMicStream(){if(!this.webcamStream)return;this.closeAudioContext(),this.logger.info("[STOPPING_AUDIO_STREAM]");let e=!0;try{this.webcamStream.getTracks().forEach(t=>{"audio"===t.kind&&t.stop(),"video"===t.kind&&(e=!1)})}catch(e){}e&&(this.webcamStream=null)}stopWebcamStream(){if(this.webcamStream){this.logger.info("[STOPPING_WEBCAM_STREAM] ",{preview:this.preview});try{this.webcamStream.getTracks().forEach(e=>{e.stop()})}catch(e){}this.webcamStream=null}}stopScreenStream(){if(this.screenStream){this.logger.info("[STOPPING_SCREEN_STREAM]");try{this.screenStream.getTracks().forEach(e=>{e.stop()})}catch(e){}this.screenStream=null}}stopStreams(){this.stopWebcamStream(),this.stopScreenStream()}checkMicVolumeStatus(e){this.closeAudioContext();const t=new AudioContext;this.audioContext=t;const i=t.createAnalyser(),n=t.createMediaStreamSource(this.webcamStream),r=t.createScriptProcessor(2048,1,1);i.smoothingTimeConstant=.8,i.fftSize=1024,n.connect(i),i.connect(r),r.connect(t.destination),r.onaudioprocess=()=>{const t=new Uint8Array(i.frequencyBinCount);i.getByteFrequencyData(t);0===t.reduce((e,t)=>e+t,0)/t.length?this.noVolumeInitialTime&&(new Date).getTime()-this.noVolumeInitialTime>1e4?(e({error:!0,type:"NO_VOLUME"}),this.noVolumeInitialTime=null):this.noVolumeInitialTime||(this.noVolumeInitialTime=(new Date).getTime()):this.noVolumeInitialTime&&(e({error:!1}),this.noVolumeInitialTime=null)}}startExtensionRecording(){return Object(V.a)({integrationType:this.integrationType})}startRecording(e){this.logger.info("[START_RECORDING]",{settings:e});let t=this;e=e||{},this.resetRecording();const{externalStopStreamCallback:i,timerCallback:n}=e;if(this.setTimerCallback(n),this.recordingConfiguration.maxRecordingTime?this.maxRecordingTime=this.recordingConfiguration.maxRecordingTime:this.maxRecordingTime=null,this.extensionAvailable)return Object(V.p)({recordingConfiguration:this.recordingConfiguration,integrationType:this.integrationType,eventListerClass:this.recorderEvtClass});if(this.webcamStream){let n={mimeType:"video/mp4"};MediaRecorder.isTypeSupported("video/webm")&&(n.mimeType="video/webm"),null!=this.recordingConfiguration.webcamBitRate&&(n.videoBitsPerSecond=1e3*this.recordingConfiguration.webcamBitRate),this.webcamRecorder=new MediaRecorder(this.webcamStream,n),this.webcamRecorder.ondataavailable=e=>{t.s3UploadManager.onDataAvailable(Ke.WEBCAM,e.data)},this.webcamRecorder.onstop=e=>{this.logger.info("[WEBCAM_STREAM_STOPPED]")},this.webcamStream.onended=()=>{this.logger.info("[WEBCAM_STREAM_STOPPED_EXTERNALLY]"),i&&this.screenRecorder&&!this.recordingConfiguration.screenRecord&&i()},this.logger.info("[START_WEBCAM_RECORDING]",{settings:e}),this.webcamRecorder.start(500)}if(this.screenStream){let e="video/mp4";MediaRecorder.isTypeSupported("video/webm")&&(e="video/webm"),(window.opr&&opr.addons||window.opera||navigator.userAgent.indexOf(" OPR/")>=0)&&(e="video/webm;codecs=vp8");let n={mimeType:e};this.screenRecorder=new MediaRecorder(this.screenStream,n),this.screenRecorder.ondataavailable=e=>{t.s3UploadManager.onDataAvailable(Ke.SCREEN,e.data)},this.screenRecorder.onstop=e=>{this.logger.info("[STOP_SCREEN_RECORDING]")},this.logger.info("[START_SCREEN_RECORDING]"),this.screenRecorder.start(500),this.screenStream.onended=()=>{this.logger.info("[SCREEN_RECORDING_STOPPED_STREAM_ENDED]"),i&&i()},this.screenStream.getVideoTracks()[0].onended=()=>{i&&this.screenRecorder&&i()},this.screenStream.getVideoTracks()[0].onmute=()=>{this.logger.info("[SCREEN_RECORDING_MUTED]"),console.error("screen stream muted")},this.screenStream.getVideoTracks()[0].onunmute=()=>{this.logger.info("[SCREEN_RECORDING_UNMUTED]")}}this.startRecordingTimer()}resetRecording(){this.projectJson=null}setTimerCallback(e){this.timerCallback=e}startRecordingTimer(){this.reverseTimer&&this.maxRecordingTime?this.timer=this.maxRecordingTime:this.timer=0,this.clearTimerInterval(),this.startTimer()}startTimer(){this.timerInterval=setInterval(()=>{this.reverseTimer&&this.maxRecordingTime?this.timer--:this.timer++,this.timerCallback&&this.timerCallback(this.timer)},1e3)}pauseRecordingTimer(){this.clearTimerInterval()}resumeRecordingTimer(){this.startTimer()}clearTimerInterval(){clearInterval(this.timerInterval)}finishRecording(e={}){const{progress:t}=e;if(this.postRecordProgressCallback=t,this.logger.info("[FINISH_RECORDING_CALLED]"),this.extensionAvailable)return Object(V.c)(this.integrationType);const i=this.stopRecording();return this.clearTimerInterval(),this.stopStreams(),i.then(e=>{this.uploadCompleteError=!1,this.completeUpload(e)}).catch(e=>{this.removeWarning(),this.uploadCompleteError=!0}),t&&this.setUploadProgressCallback(t),i}setProjectJson(e){this.projectJson=e}setRecordDetails(e){this.recordDetails=e}setExtensionRecording(e){this.extensionRecording=e}cancelRecordingWithoutStream(){return this.logger.info("[CANCEL_RECORIDNG_WITHOUT_STREAM]"),this.removeWarning(),this.stopRecorder(),this.stopScreenStream(),this.recordingPaused=!1,this.s3UploadManager.cancelMultipartUpload()}cancelRecording(){return this.logger.info("[CANCEL_RECORIDNG]"),this.removeWarning(),this.stopRecorder(),this.stopStreams(),this.recordingPaused=!1,this.s3UploadManager.cancelMultipartUpload()}getRecordingObjectUrls(){if(!this.extensionAvailable)try{return this.s3UploadManager.getObjectUrls({recordingConfig:this.recordingConfiguration})}catch(e){}return{}}getRecordingConfiguration(){return this.recordingConfiguration}retryUpload(){return this.logger.info("[RETRY_UPLOAD]"),new Promise((e,t)=>{this.s3UploadManager.retryUpload().then(()=>{this.uploadInitError=!1,this.s3UploadManager.finishUpload().then(e=>{this.uploadCompleteError=!1,this.completeUpload(e)}).catch(e=>{this.uploadCompleteError=!0}),e()}).catch(e=>{t(e),this.s3UploadManager.cancelMultipartUpload()})})}getUploadDetails(){return new Promise((e,t)=>{this.extensionAvailable?Object(V.h)(this.integrationType).then(i=>{i?e({completed:this.isUploadComplete(),error:i.status===ee.r.FAILED,completedPercent:i.progress.progress,timeRemaining:i.progress.remainingTime}):t({error:"INVALID_RESPONSE"})}).catch(e=>{t({error:e})}):e(this.s3UploadManager.getUploadProgressDetails())})}isUploadComplete(){return this.extensionRecording&&Object(V.h)(this.integrationType).then(e=>{e&&(this.uploadCompleted=e.status===ee.r.UPLOADED)}).catch(()=>{}),this.uploadCompleted}isPreprocessComplete(){return new Promise((e,t)=>{this.preprocessCompleteCheckInterval=setInterval(()=>{this.projectJson&&e(this.projectJson),this.preprocessError&&t(this.preprocessError),(this.projectJson||this.preprocessError)&&clearInterval(this.preprocessCompleteCheckInterval)},500)})}removePreprocessCompleteCheck(){this.preprocessCompleteCheckInterval&&clearInterval(this.preprocessCompleteCheckInterval)}getRecordDetails(){return new Promise((e,t)=>{this.recordDetails.asset_id?e(this.recordDetails):this.recorderDetailsCheckInterval=setInterval(()=>{this.recordDetails.asset_id&&(e(this.recordDetails),clearInterval(this.recorderDetailsCheckInterval)),this.createRecordError&&t("create_recording_error")},1e3)})}cancelGetRecordDetails(){this.recorderDetailsCheckInterval&&clearInterval(this.recorderDetailsCheckInterval)}async completeUpload(e,t=0){this.logger.info("[RECORDING_UPLOAD_COMPLETED]");const[i,n]=await this.recorderModel.completeUpload({assetId:e,webcamId:this.createRecordingRef.webcamId,screenId:this.createRecordingRef.screenId,recordingConfiguration:this.recordingConfiguration,token:this.token});if(this.logger.info("[COMPLETE_UPLOAD_RESPONSE]",{success:i,error:n}),i){const t=i.data;this.removeWarning(),this.uploadCompleted=!0;let n=t.hippo_recorder;this.startPollingForStatus(e,n,[])}if(n){if(t>1)return this.removeWarning();this.completeUpload(e,++t)}}startPollingForStatus(e,t,i){let n=t.pop();if(null==n)this.saveVideoSuccess(e,i);else{new tt({interval:2e3,token:this.token,tokenType:this.tokenType,email:this.email}).getStatus({operationId:n,waitingHandler:e=>{this.postRecordProgressCallback&&this.postRecordProgressCallback({type:"preprocess",completedPercent:"N/A",completed:!1,message:"Waiting for video to be uploaded",time_remaining:"N/A"})},progressHandler:(e,t,i)=>{this.postRecordProgressCallback&&this.postRecordProgressCallback({type:"preprocess",completedPercent:t,completed:!1,message:e,time_remaining:i})},completeHandler:n=>{if(4==n.operationtype){this.logger.info("[RECORDING_PREPROCESS_COMPLETE]",{event:n}),this.postRecordProgressCallback&&this.postRecordProgressCallback({type:"preprocess",completedPercent:100,completed:!0,message:"Preprocess completed",recordDetails:this.recordDetails});let r={},o=n.data;r.id=o.id,r.duration=o.duration<0?o.audioduration:o.duration,r.type=o.videotype,r.offset=o.offset,i||(i=[]),i.push(r),this.startPollingForStatus(e,t,i)}},errorHandler:e=>{console.error(e)}})}}async saveVideoSuccess(e,t){const i=this;let n=0;const r={version:"2.0",footageList:[],clips:[],totalVideoTracks:3,trackNames:["Screen recording","Webcam","Track 3"],canvasWidth:384,canvasHeight:216,resolution:"720"};let o=0;for(let e=0;e<t.length;e++){let i=t[e];o=0==e?i.duration:Math.min(i.duration,o)}this.recordingConfiguration.sourceConfig||(this.recordingConfiguration.sourceConfig={}),(!this.recordingConfiguration.sourceConfig.webcam||this.recordingConfiguration.sourceConfig.webcam.width<=0||this.recordingConfiguration.sourceConfig.webcam.height<=0)&&(this.recordingConfiguration.sourceConfig.webcam={width:288,height:216}),(!this.recordingConfiguration.sourceConfig.screen||this.recordingConfiguration.sourceConfig.screen.width<=0||this.recordingConfiguration.sourceConfig.screen.height<=0)&&(this.recordingConfiguration.sourceConfig.screen={width:384,height:216});for(let e=0;e<t.length;e++){let i=t[e];r.footageList.push(i.id);let l={};l.id=i.id,l.duration=i.duration,l.containsVideo=1!=i.type||this.recordingConfiguration.webCam,l.containsAudio=1==i.type&&this.recordingConfiguration.audio;let c={xpos:0};if(1==i.type&&t.length>1){let e=Object(V.i)(this.recordingConfiguration.sourceConfig.webcam,this.recordingConfiguration.sourceConfig.screen,this.recordingConfiguration.webcamPosition,this.recordingConfiguration.webcamSize);c.width=e.width,c.height=e.height,c.xpos=e.x,c.ypos=e.y}else{var a;a=1==i.type?this.recordingConfiguration.sourceConfig.webcam:this.recordingConfiguration.sourceConfig.screen;var s=Object(V.d)(a,{width:384,height:216});c.width=s.width,c.height=s.height,c.xpos=s.x,c.ypos=s.y,r.crop={x:s.x,y:s.y,w:s.width,h:s.height}}0==i.type?l.type="screenrecord":l.type="webcam",c.opacity=1,c.volume=this.recordingConfiguration.audio?1:0,c.fadein=0,c.fadeout=0;let d={position:1e-4};d.id=n++,d.start=0,d.end=o,d.track=1==i.type?2:1,d.footage=l,d.deleted=!1,d.properties=c,r.clips.push(d)}if(this.setProjectJson(r),this.projectJson=r,"local"==Object(V.e)()){const[t,n]=await this.recorderModel.mergeAndRender({assetId:e,projectJson:r,renderFrom:"embedded_video"});t&&(new nt.a).deliveryUrgentVideos(i.deliveryToken,(function(e){})),n&&console.error(n)}else(new nt.a).deliveryUrgentVideos(i.deliveryToken,(function(e){}))}generateDummyPJForImport(e){let t,i;e.width/e.height>384/216?(t=384,i=384*e.height/e.width):(i=216,t=216*e.width/e.height);const n={w:t,h:i,x:(384-t)/2,y:(216-i)/2},r={deleted:!1,end:e.duration,id:0,position:"0.00010",start:0,track:1,footage:{id:e.source_id,duration:e.duration,containsVideo:e.contains_video,containsAudio:e.contains_audio,type:"webcam"},properties:{xpos:n.x,ypos:n.y,width:t,height:i,volume:1,opacity:1,fadein:0,fadeout:0}};return{canvasWidth:384,canvasHeight:216,resolution:1080,totalVideoTracks:1,trackNames:["Imported Video"],version:"2.0",footageList:[e.source_id],clips:[r],crop:n}}stopRecording(){return this.logger.info("[STOP_RECORIDNG]"),this.stopRecorder(),this.s3UploadManager.finishUpload()}stopRecorder(){if(this.logger.info("[STOP_RECORDER]"),this.clearTimerInterval(),this.webcamRecorder||this.screenRecorder){for(const e of[this.webcamRecorder,this.screenRecorder])if(e)try{e&&e.stop()}catch(e){}this.webcamRecorder=null,this.screenRecorder=null}}retryMultipartUploadFinish(){return this.logger.info("[RETRY_MULTIPART_UPLOAD_FINISH]"),this.s3UploadManager.finishUpload().then(e=>{this.uploadCompleteError=!1,this.completeUpload(e)}).catch(e=>{this.uploadCompleteError=!0,console.error(e)})}setUploadProgressCallback(e){return this.s3UploadManager.setUploadProgressCallback(e)}createRecordingExponentialBackoff(){this.currentTime||(this.currentTime=new Date),this.exponentialBackoff.retryCount<ee.m&&(this.exponentialBackoff.retryCount+=1,this.exponentialBackoff.setTimeoutRef=setTimeout(()=>{this._sendCreateRecordingRequest()},ee.l*this.exponentialBackoff.retryCount))}initializeUploadManager({data:e,deliveryToken:t}){this.logger.info("[UPLOAD_MANAGER_INITIALIZED]",{data:e}),this.createRecordingRef=e,this.deliveryToken=t,this.s3UploadManager.initializeUploaders(e).catch(e=>{console.error("Upload initialize error ",e),this.uploadInitError=!0})}_sendCreateRecordingRequest(){return new Promise(async(e,t)=>{const[i,n]=await this.recorderModel.createRecording({configuration:this.recordingConfiguration,logUID:this.logUID});if(this.logger.info("[CREATE_RECORDING_RESPONSE]",{success:i,error:n}),i){const t=i.data;this.createRecordingError=!1,this._updateRecordDetails(t),this.recorderAPIUtils&&this.recorderAPIUtils.sendEvent("record_details",{asset_id:this.recordDetails.asset_id,token:this.recordDetails.delivery_token,embed_url:this.recordDetails.embedLink,embed_preview_url:this.recordDetails.embeddedPreviewLink,play_url:this.recordDetails.recordedUrl,thumbnail_url:this.recordDetails.publicThumbnail,thumbnail_play_url:this.recordDetails.publicPlayThumbnail}),e(this.recordDetails),this.recordDetails&&this.initializeUploadManager({data:this.recordDetails,deliveryToken:t.delivery_token}),this.updateCurrentWebcamDimensions()}n&&(n&&n.is_cancelled?console.warn(n):(t(n),this.createRecordingError=!0,this.createRecordingExponentialBackoff()))})}_updateRecordDetails(e){if(!e.status)return this.logger.info("[CREATE_RECORDING_ERROR]",{create_recording_response:e}),void(this.recordDetails=e);this.recordDetails=Object(V.o)({createRecResponse:e,recordingConfiguration:this.recordingConfiguration,digest:this.token})}videoConverting({convertVideoResponse:e,assetId:t,updateProgress:i,resolve:n,reject:r}){this.removeWarning(),this.importStatusPoller=new tt({interval:2e3,token:this.token,tokenType:this.tokenType,email:this.email});const o=this;this.importStatusPoller.getStatus({operationId:e,waitingHandler:e=>{i({type:"processing",completedPercent:0,completed:!1,message:"Waiting for upload to complete"})},progressHandler:(e,t,n)=>{const r=Object(V.k)(n);i({type:"processing",completedPercent:t,completed:!1,timeRemaining:r,message:e})},completeHandler:e=>{i({type:"processing",completedPercent:100,completed:!0,message:"Completed",recordDetails:this.recordDetails}),o.onImportConvertComplete(e,t,n,r)},errorHandler:e=>{this.logger.info("[VIDEO_CONVERSION_PROCESSING_ERROR]",{error:e}),r(e)}})}renderVideo(e){return this.recorderModel.mergeAndRender(e)}async onImportConvertComplete(e,t,i,n){this.logger.info("[VIDEO_CONVERSION_PROCESSING_SUCCESS]",{success:e});let r=-1;!e.data||null==e.data.duration&&null==e.data.audioduration?e.data&&e.data.data instanceof Array&&null!=e.data.data[0]&&(r=null!=e.data.data[0].duration?e.data.data[0].duration:e.data.data[0].audioduration):r=null!=e.data.duration?e.data.duration:e.data.audioduration;const[o,a]=await this.recorderModel.getImportedDetails({assetId:t});if(this.logger.info("[GET_IMPORT_DETAILS]",{success:o,error:a}),o){const e=o.data,t=0==e.contains_video&&1==e.contains_audio;"local"==Object(V.e)()&&(e.projectjson=this.generateDummyPJForImport(e)),t&&delete e.projectjson.crop,this.projectJson=e.projectjson,this.setProjectJson(this.projectJson),i&&i(e)}a&&n(a)}isStreamConfigSame(e=!1,t=!1){let i=!0,n=!0,r=!0;return(e||this.currentWebcamStreamConfig)&&(i=ot()(e&&e.video,this.currentWebcamStreamConfig&&this.currentWebcamStreamConfig.video),n=ot()(e&&e.audio,this.currentWebcamStreamConfig&&this.currentWebcamStreamConfig.audio)),(t||this.currentScreenStreamConfig)&&(r=ot()(t,this.currentScreenStreamConfig)),{isWebcamVideoConfigSame:i,isWebcamAudioConfigSame:n,isScreenConfigSame:r}}updateCurrentWebcamDimensions(){try{const e=this.webcamStream.getVideoTracks()[0].getSettings();this.recordingConfiguration.sourceConfig||(this.recordingConfiguration.sourceConfig={}),this.recordingConfiguration.sourceConfig.webcam={width:e.width,height:e.height}}catch(e){}}activateWarning(){Object(V.q)(this.logger)}removeWarning(){Object(V.l)()}destroy(){this.s3UploadManager=null}},dt=i(218);i(84);var ut,pt,ht,ft,mt,gt,vt,yt,bt=i(222),wt={createAudioMeter:function(e,t,i,n){var r=e.createScriptProcessor(512);return r.onaudioprocess=this.volumeAudioProcess,r.clipping=!1,r.lastClip=0,r.volume=0,r.clipLevel=t||.98,r.averaging=i||.95,r.clipLag=n||750,r.connect(e.destination),r.checkClipping=function(){return!!this.clipping&&(this.lastClip+this.clipLag<window.performance.now()&&(this.clipping=!1),this.clipping)},r.shutdown=function(){this.disconnect(),this.onaudioprocess=null},r},volumeAudioProcess:function(e){for(var t,i=e.inputBuffer.getChannelData(0),n=i.length,r=0,o=0;o<n;o++)t=i[o],Math.abs(t)>=this.clipLevel&&(this.clipping=!0,this.lastClip=window.performance.now()),r+=t*t;var a=Math.sqrt(r/n);this.volume=Math.max(a,this.volume*this.averaging)}},St=(i(110),i(4)),Ct=i.n(St),kt=L.c.div(ut||(ut=Ct()(["\n width: 640px;\n height: 360px;\n background-color: #2E2E2E;\n border-radius: 15px;\n"]))),xt=L.c.div(pt||(pt=Ct()(["\n max-width: 160px;\n width: 20%;\n position: relative;\n div:first-of-type {\n height: 0;\n padding-bottom: 100%;\n }\n"]))),_t=L.c.div(ht||(ht=Ct()(["\n position: absolute;\n display: flex;\n justify-content: center;\n top: 0;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: #0A0A0A;\n align-items: center;\n"]))),Et=L.c.img(ft||(ft=Ct()(["\n height: 50%;\n"]))),Tt=L.c.div(mt||(mt=Ct()(["\n display: flex;\n flex-flow: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n"]))),Pt=L.c.div(gt||(gt=Ct()(["\n &::before {\n content: '';\n background: transparent;\n border: 2px solid rgba(255,255,255,0.15);\n opacity: 1;\n transform: scale(0.45);\n border-radius: 50%;\n box-sizing: border-box;\n display: block;\n height: 200%;\n left: -50%;\n position: absolute;\n top: -50%;\n width: 200%;\n will-change: transform;\n }\n &::after {\n border-radius: 50%;\n box-sizing: border-box;\n content: '';\n display: block;\n height: 200%;\n left: -50%;\n position: absolute;\n top: -50%;\n width: 200%;\n will-change: transform;\n background: transparent radial-gradient(closest-side at 50% 50%, #000000 0%, #121212 0%, #0000002B 100%) 0% 0% no-repeat padding-box;;\n transform: ",";\n transition: transform 300ms steps(6,jump-none) 50ms;\n }\n"])),(function(e){return e.$scale?"scale(".concat(parseFloat(e.$scale),")"):"scale(.5)"})),It=Object(L.c)(Pt)(vt||(vt=Ct()(["\n animation: "," .225s step-end,"," .075s ease .225s;\n"])),At,At),At=Object(L.d)(yt||(yt=Ct()(["\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n"]))),Rt="url",Ot=Object(M.e)("/svg/audio-on.svg");function Nt(e){var t=e.stream,i=e.streamType,n=e.audioIcon,r=void 0===n?Ot:n,o=e.errorCallback,a=Object(s.useRef)(),c=Object(s.useRef)(),d=Object(s.useRef)(!1),u=Object(s.useState)(0),p=u[0],h=u[1];return Object(s.useEffect)((function(){return function(){console.log("AUDIO METER EXITING PROPERLY"),d.current=!0,c.current&&(window.cancelAnimationFrame(c.current),c.current=null)}}),[]),Object(s.useEffect)((function(){if(t&&i!==Rt)try{if(t.getAudioTracks().length){var e=new AudioContext,n=e.createMediaStreamSource(t);a.current=wt.createAudioMeter(e),n.connect(a.current),console.log("DRAWING AUDIO METER"),function e(t){if(!d.current){var i=13*a.current.volume;i<=.5&&.5!=p?h(.5):i>.5&&i<=.55&&.55!=p?h(.55):i>.55&&i<=.6&&.6!=p?h(.6):i>.6&&i<=.65&&.65!=p?h(.65):i>.65&&.7!=p&&h(.7)}setTimeout((function(){c.current=window.requestAnimationFrame(e)}),50)}()}}catch(e){o&&o(e),console.log(e)}}),[t]),l.a.createElement(kt,null,l.a.createElement(Tt,null,l.a.createElement(xt,null,l.a.createElement("div",null),l.a.createElement(It,{$scale:p}),l.a.createElement(_t,null,l.a.createElement(Et,{src:r,alt:"Mic"})))))}var Dt,Lt,Mt,Bt,Ft,Vt,Ut,zt,Ht,jt,qt,$t,Wt=i(223),Gt=L.c.div(Dt||(Dt=Ct()(["\n width: 100%;\n height: 100%;\n"]))),Kt=L.c.iframe(Lt||(Lt=Ct()(["\n width: 100%;\n height: 100%;\n border: none;\n border-radius: 3px;\n"]))),Yt=L.c.div(Mt||(Mt=Ct()(["\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n"]))),Jt=L.c.div(Bt||(Bt=Ct()(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n"]))),Xt=(L.c.img(Ft||(Ft=Ct()(["\n display: block;\n height: 143px;\n width: 68px;\n object-position: bottom;\n object-fit: contain;\n"]))),L.c.div(Vt||(Vt=Ct()(["\n height: 60%;\n position: relative;\n display: flex;\n align-items: flex-end;\n"]))),L.c.div(Ut||(Ut=Ct()(["\n position: relative;\n display: flex;\n"])))),Qt="url";function Zt(e){var t=e.stream,i=e.streamType,n=e.webcam,r=e.mic,o=e.audioIcon,a=e.preview,s=e.lightingCanvasRef,c=e.videoElementRef,d=t;return i===Qt&&(d="".concat(t,"?webcam=true")),l.a.createElement(Yt,null,l.a.createElement(Jt,null,!t&&l.a.createElement("div",null,"Waiting for permission"),n&&i===Qt&&l.a.createElement(Gt,{className:"hv-ext-webcam-preview"},l.a.createElement(Kt,{src:"".concat(d)})),t&&i!==Qt&&l.a.createElement(Xt,null,n&&l.a.createElement(bt.a,{stream:t,ref:c}),n&&t&&a&&l.a.createElement(Wt.a,{ref:s}),!n&&r&&l.a.createElement(Nt,{stream:t,audioIcon:o,streamType:i}))))}L.c.div(zt||(zt=Ct()(["\n position: relative;\n display: flex;\n"]))),L.c.div(Ht||(Ht=Ct()(["\n position: absolute;\n height: 25px;\n width: 2px;\n left: 22px;\n border: 0px;\n"])));var ei,ti=L.c.div(jt||(jt=Ct()(['\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border-radius: 3px;\n & > span {\n font-family: "Open Sans";\n }\n /* Disable button text select by default */\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Old versions of Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none; /* Non-prefixed version, currently\n supported by Chrome, Edge, Opera and Firefox */\n']))),ii=Object(L.c)(ti)(qt||(qt=Ct()(["\n height: 45px;\n margin-top: 3px;\n background-color: #434141;\n & > img {\n height: 10px;\n margin-bottom: 3px;\n }\n & > span {\n font-size: 9px;\n color: ",";\n }\n"])),(function(e){return e.checked?"#37C689":"#EFEFEF"})),ni=Object(L.c)(ti)($t||($t=Ct()(["\n width: 85px;\n height: 85px;\n border-radius: 8px;\n margin: 10px;\n opacity: 0.77;\n transition: 0.3s;\n display: ",";\n border: ",";\n background-color: #0a0a0a;\n pointer-events: ",';\n & > span {\n font-family: "Open Sans";\n font-size: 8px;\n color: ',";\n font-weight: 600;\n }\n & > img {\n height: 28px;\n margin-bottom: 5px !important;\n transition: 0.4s;\n filter: ",";\n ",";\n }\n &:after {\n content: '';\n position: absolute;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background-color: #16C669;\n background-image: url(",");\n background-repeat: no-repeat;\n background-position: center;\n background-size: 50%;\n top: 5px;\n right: 5px;\n transition: 0.3s;\n transform: scale(0);\n }\n ",";\n &:active {\n transform: scale(0.8);\n }\n"])),(function(e){return!e.checked&&e.recordingStarted?"none":"inherit"}),(function(e){return e.checked&&!e.recordingStarted?"2px solid #37C689;":"2px solid #0a0a0a;"}),(function(e){return e.recordingStarted?"none":"all"}),(function(e){return e.recordingStarted?"#FFFFFF":e.checked?"#37C689":"#FFFFFF"}),(function(e){return e.recordingStarted?"brightness(0) saturate(100%) invert(100%) sepia(18%) saturate(2%) hue-rotate(146deg) brightness(110%) contrast(101%)":"none"}),(function(e){if("webcam"==e.type&&!e.checked)return"\n -transform: scale(1.7);\n -margin-top: -1px;"}),(function(e){return e.tickUrl}),(function(e){if(e.checked&&!e.recordingStarted)return"\n &:after {\n // content: '';\n // position: absolute;\n // width: 10px;\n // height: 10px;\n // border-radius: 50%;\n // background-color: #16C669;\n // background-image: url('/svg/tick-white.svg');\n // background-repeat: no-repeat;\n // background-position: center;\n // background-size: 50%;\n // bottom: -5px;\n transform: scale(1);\n }"})),ri=1,oi=2;function ai(e){var t=e.type,i=e.checked,n=e.label,r=e.onClick,o=e.optionType,a=e.recordingStarted,s=function(e){switch(e){case"webcam":return i?Object(M.e)("/svg/rapi/webcam-on.svg"):Object(M.e)("/svg/rapi/webcam-off.svg");case"screen":return i?Object(M.e)("/svg/rapi/screen-on.svg"):Object(M.e)("/svg/rapi/screen-off.svg");default:return i?Object(M.e)("/svg/rapi/mic-on.svg"):Object(M.e)("/svg/rapi/mic-off.svg")}};return o===ri?l.a.createElement(ni,{onClick:function(){return r(t)},checked:i,recordingStarted:a,type:t,tickUrl:Object(M.e)("/svg/tick-white.svg")},l.a.createElement(l.a.Fragment,null,l.a.createElement("img",{src:s(t)})),l.a.createElement("span",null,n)):l.a.createElement(ii,{onClick:function(){return r(t)},checked:i},l.a.createElement("img",{src:s(t)}),l.a.createElement("span",null,n))}var si,li,ci,di=L.c.div(ei||(ei=Ct()(["\n position: absolute;\n width: 60px;\n height: 165px;\n background-color: rgba(0,0,0,0.8);\n right: 0;\n top: 20%;\n border-radius: 7px 0 0 7px;\n padding: 7px 3px;\n z-index: 11;\n"])));function ui(e){var t=e.handleOptionsSelect,i=e.userSelect,n=e.webcam,r=e.screen,o=e.mic,a=e.screenEnabled,s=e.webcamEnabled,c=e.micEnabled;return l.a.createElement(di,null,(i||s)&&l.a.createElement(ai,{type:"webcam",onClick:function(){return t("webcam")},checked:n,previewEnabled:!n,label:"WEBCAM",optionType:oi}),(i||a)&&l.a.createElement(ai,{type:"screen",onClick:function(){return t("screen")},checked:r,previewEnabled:!r,label:"SCREEN RECORD",optionType:oi}),(i||c)&&l.a.createElement(ai,{type:"mic",onClick:function(){return t("mic")},checked:o,previewEnabled:!o,label:"MIC",optionType:oi}))}var pi,hi=L.c.div(si||(si=Ct()(["\n position: ",";\n width: 100%;\n display: flex;\n height: 100%;\n background-color: rgba(47, 48, 49, 0.86);\n top: 0;\n z-index: 10;\n border-radius: ",";\n left: 0;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n"])),(function(e){return e.screen?"fixed":"absolute"}),(function(e){return e.screen?"0":"10px"})),fi=L.c.div(li||(li=Ct()(["\n width: 135PX;\n height: 135PX;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 15;\n border-radius: 50%;\n background-color: transparent;\n border: 7px solid #ECEDF4;\n"]))),mi=L.c.div(ci||(ci=Ct()(["\n position: absolute;\n font: normal normal normal 71px/97px Open Sans;\n font-weight: 600;\n color: #E5E9F5;\n width: 40px;\n letter-spacing: 1.28px;\n"])));function gi(e){var t=e.time,i=e.screen,n=e.timerCallback,r=e.onCountdownComplete,o=parseInt(t)||3,a=Object(s.useState)(o),c=a[0],d=a[1];return Object(s.useEffect)((function(){n(c)}),[c]),Object(s.useEffect)((function(){if(1!==c){var e=setTimeout((function(){d(c-1)}),1e3);return function(){return clearTimeout(e)}}setTimeout((function(){r&&r()}),1e3)})),l.a.createElement(hi,{screen:i},l.a.createElement(fi,null,l.a.createElement(mi,null,c)))}var vi=L.c.div(pi||(pi=Ct()(["\n display: flex;\n margin: ",";\n justify-content:",";\n -width: 300px;\n margin: 0 auto;\n background-color: #2E2E2E;\n border: none;\n"])),(function(e){return e.previewEnabled?"0 auto":"none"}),(function(e){return e.previewEnabled,"center"}));function yi(e){var t=e.userSelect,i=e.screenEnabled,n=e.webcamEnabled,r=e.micEnabled,o=e.screen,a=e.webcam,s=e.mic,c=e.recordingStarted,d=e.handleOptionsSelect;return l.a.createElement(vi,{previewEnabled:!o},(i||t)&&l.a.createElement(ai,{type:"screen",onClick:function(){return d("screen")},checked:o,previewEnabled:!o,label:"SCREEN RECORD",recordingStarted:c,optionType:ri}),(t||n)&&l.a.createElement(ai,{type:"webcam",onClick:function(){return d("webcam")},checked:a,previewEnabled:!a,label:"WEBCAM",recordingStarted:c,optionType:ri}),(t||r)&&l.a.createElement(ai,{type:"mic",onClick:function(){return d("mic")},checked:s,previewEnabled:!s,label:"MICROPHONE",recordingStarted:c,optionType:ri}))}var bi=i(402);class wi{constructor(e){console.log("DATA ",e);const t=window._HVDomain||"https://www.hippovideo.io";this.token=e.token,this.tokenType=e.tokenType,this.email=e.email;const i={baseURL:t+bi.a,headers:{accept:"application/json"}};if(this.tokenType===ee.e.RECORDER_SDK_TOKEN){let e=`${this.tokenType}$$${this.token}`;i.headers.Authorization="Basic "+btoa(e)}if(this.tokenType===ee.e.AUTHENTICATION_TOKEN){let e=`${this.tokenType}$$${this.token}$$${this.email}`;i.headers.Authorization="Basic "+btoa(e)}this.axiosInstance=H.a.create(i)}getAllScripts(e){return this._sendRequest({method:"get",params:e})}async _sendRequest({method:e="get",url:t="",jsonData:i=null,formData:n=null,params:r={},headers:o={},additionalReqConfig:a={}}){try{let s=n;if(n){if("object"==typeof n&&null!==n){let e=new FormData;for(const t in n)e.append(t,n[t]);s=e}o["Content-Type"]="application/x-www-form-urlencoded"}i&&(o["Content-Type"]="application/json");const l={url:t,method:e,data:i||s,headers:o,params:r,...a};console.log("REQUEST CONFIG ",l);return[await this.axiosInstance.request(l),null]}catch(e){if(console.log("ERROR >>>> ",e),H.a.isCancel(e)){return[null,{message:e.message,is_cancelled:!0}]}return[null,e]}}}i(94);var Si=i(46),Ci=i.n(Si),ki=i(47),xi=i.n(ki),_i=i(56),Ei=i.n(_i),Ti=i(61),Pi=i.n(Ti),Ii=i(43),Ai=i.n(Ii),Ri=(i(204),i(86),i(99),i(66),i(55),i(108),i(370),i(174),i(51),i(58),i(64),i(212),i(214),i(199),i(10)),Oi=i(25),Ni=i.n(Oi),Di=i(403),Li=i.n(Di),Mi=i(404),Bi=i.n(Mi),Fi=i(131),Vi=i.n(Fi),Ui=i(128),zi=i.n(Ui),Hi=i(5),ji=i.n(Hi),qi=i(2);const $i=e=>{e.preventDefault();var t=e.originalEvent.clipboardData?e.originalEvent.clipboardData.getData("text/plain"):window.clipboardData.getData("Text");if(document.queryCommandSupported("insertText"))document.execCommand("insertText",!1,t);else{var i=document.getSelection().getRangeAt(0);i.deleteContents();var n=document.createTextNode(t);i.insertNode(n),i.selectNodeContents(n),i.collapse(!1);var r=window.getSelection();r.removeAllRanges(),r.addRange(i)}};function Wi(e){var t=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(e){return!1}}();return function(){var i,n=Ai()(e);if(t){var r=Ai()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return Pi()(this,i)}}var Gi=function(e){Ei()(i,e);var t=Wi(i);function i(){return Ci()(this,i),t.apply(this,arguments)}return xi()(i,[{key:"initialize",value:function(e){HippoVideo.UserProfile||(HippoVideo.UserProfile={}),this.prompterId=e.promptContainer||"teleprompterSiblingDiv";var t=(HippoVideo.UserProfile.userFirstName+" "+HippoVideo.UserProfile.userLastName).trim();this.mergeFieldValues={"Lead Name":t,"Lead Email":HippoVideo.UserProfile.userEmail,"Lead Company Name":HippoVideo.UserProfile.userCompanyName},this.mergeFieldValues=Ri.default.extend({},this.mergeFieldValues,e.mergeFieldValues||{}),this.sdkTeleprompter=e.sdkTeleprompter||!1,this.origin=this.sdkTeleprompter?qi.default.getHippoAssetsDomain():"",this.initialTop=e.initialTop||0,this.lastLineHeight=e.lastLineHeight||60,this.minFontSize=e.minFontSize||15,this.maxFontSize=e.maxFontSize||45,this.minLineSpace=e.minLineSpace||1,this.maxLineSpace=e.maxLineSpace||3,this.minSpeedVal=e.minSpeed||1,this.maxSpeedVal=e.maxSpeed||10,this.newRecorderScreen="newRecorderScreen"==e.from,this.initialScroll=0,this.scrollTimerDown=void 0,this.scriptSelected=!1,this.defaultScriptId=e.defaultScriptId,this.enableChangeScript=null==e.enableChangeScript||e.enableChangeScript,this.settingModel=new zi.a({settingTabName:ji.a.wizSetting.VIDEO_SCRIPT,guestToken:e.guestToken}),this.prompterModel=e.prompterModel,this.callback=e.callback,this.fromChecklistProspecting=e.fromChecklistProspecting,this.fromChecklistInviteVideo=e.fromChecklistInviteVideo,this.initLineSpace(),this.initSpeed(),this.initTextSize(),this.userEmail=HippoVideo.UserProfile.userEmail,this.spaceAllowedTags=["TEXTAREA","INPUT"],this.promptStarted=!1,this.promptCompleted=!1,this.scrollTimeout=50,this.prompterSpeedVal=10,this.nextStep=1,this.allScripts=[],this.showFirstVideoScript=!1,this.isRendered=!1,this.render()}},{key:"bindEvents",value:function(){this.enableDisablePrompter=this.enableDisablePrompter.bind(this),this.selectVideoScript=this.selectVideoScript.bind(this),this.initPrompt=this.initPrompt.bind(this),this.startPrompt=this.startPrompt.bind(this),this.keyPressEvent=this.keyPressEvent.bind(this),this.setSpeedProperties=this.setSpeedProperties.bind(this),this.restartPrompt=this.restartPrompt.bind(this),this.resetPrompt=this.resetPrompt.bind(this),this.changeTextWithMFValues=this.changeTextWithMFValues.bind(this),this.changeVideoScript=this.changeVideoScript.bind(this),this.textSizeIncrease=this.textSizeIncrease.bind(this),this.textSizeDecrease=this.textSizeDecrease.bind(this),this.speedIncrease=this.speedIncrease.bind(this),this.speedDecrease=this.speedDecrease.bind(this),this.lineSpaceIncrease=this.lineSpaceIncrease.bind(this),this.lineSpaceDecrease=this.lineSpaceDecrease.bind(this),this.addNewScriptFromPrompt=this.addNewScriptFromPrompt.bind(this),this.speedSliderChange=this.speedSliderChange.bind(this),this.allScriptsFetchSuccess=this.allScriptsFetchSuccess.bind(this),this.allScriptsFetchFailure=this.allScriptsFetchFailure.bind(this),this.addNewScriptFromAllScripts=this.addNewScriptFromAllScripts.bind(this),this.addNewScriptFromMyScripts=this.addNewScriptFromMyScripts.bind(this),this.refreshVideoPrompter=this.refreshVideoPrompter.bind(this),this.changeVideoScriptWithId=this.changeVideoScriptWithId.bind(this),this.handleTabChange=this.handleTabChange.bind(this)}},{key:"initEvents",value:function(){this.delegate("click",".script-list",this.selectVideoScript),this.delegate("click","#changeScriptId",this.changeVideoScript),this.delegate("click","#addNewScriptFromPrompt",this.addNewScriptFromPrompt),this.delegate("click","#addNewScriptFromAllScripts",this.addNewScriptFromAllScripts),this.delegate("click","#addNewScriptFromMyScripts",this.addNewScriptFromMyScripts),this.delegate("click","#refreshPrompterPages",this.refreshVideoPrompter),this.delegate("click",".tab-title",this.handleTabChange),be()("#enableScriptId").on("click",this.enableDisablePrompter),be()("#disableScriptId").on("click",this.enableDisablePrompter),be()("#speedDecreaseId").on("click",this.speedDecrease),be()("#speedIncreaseId").on("click",this.speedIncrease),be()("#textSizeIncrease").on("click",this.textSizeIncrease),be()("#textSizeDecrease").on("click",this.textSizeDecrease),be()("#lineSpaceIncrease").on("click",this.lineSpaceIncrease),be()("#lineSpaceDecrease").on("click",this.lineSpaceDecrease),be()("#teleprompterId").off("paste").on("paste",$i),be()(document).off("keydown"),be()(document).on("keydown",this.keyPressEvent)}},{key:"render",value:function(){var e=this,t={to_prompt:!0};this.prompterModel?this.prompterModel.getAllScripts(t).then((function(t){return e.allScriptsFetchSuccess(t)})).catch((function(t){return e.allScriptsFetchFailure(t)})):this.settingModel.getAllVideoScript(t,(function(t){e.allScriptsFetchSuccess(t)}),(function(t){e.allScriptsFetchFailure(t)}))}},{key:"allScriptsFetchSuccess",value:function(e){this.$el.empty();var t={inactive_minus:this.inActiveMinus,inactive_plus:this.inActivePlus,inactive_minus_linespace:this.inActiveMinusLine,inactive_plus_linespace:this.inActivePlusLine,inactive_minus_speed:this.inActiveMinusSpeed,inactive_plus_speed:this.inActivePlusSpeed,newRecorderScreen:this.newRecorderScreen,origin:this.origin};if(this.sdkTeleprompter){var i=e[0],n=e[1];if(n)return this.allScriptsFetchFailure(n);this.$el.append(Bi()(Ri.default.extend({},t,i.data,Vi.a)))}else this.$el.append(Li()(Ri.default.extend({},t,e,Vi.a)));this.mergeFieldValues["Lead Company Name"]=e.company_name,this.bindEvents(),this.initEvents(),this.prompterModel||be()(document).foundation(),null!=this.defaultScriptId&&(0==this.defaultScriptId?be()("#allVideoScripts .script-list").first().click():be()("#allVideoScripts").find("#"+this.defaultScriptId).click()),this.enableChangeScript||be()("#changeScriptId").remove(),this.callback&&this.callback();var r=qi.default.getLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId),o=qi.default.getLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId),a=qi.default.getLocalStorageValue("prompt-speed-"+HippoVideo.UserProfile.userId);r&&be()("#teleprompterId").css("line-height",r),o&&be()("#teleprompterId").css("font-size",o+"px"),a&&!isNaN(a)?(parseInt(a)>10&&(a=parseInt(a)/10),be()("#speedSliderId").attr("data-value",a).text(a)):(a=5,be()("#speedSliderId").attr("data-value",a).text(a)),(this.fromChecklistProspecting||this.fromChecklistInviteVideo)&&(this.myScripts=e.my_scripts,this.enableChecklistTeleprompterScript()),this.allScripts=e.all_scripts,this.showFirstVideoScript&&this.displayFirstVideoScript(),this.isRendered=!0}},{key:"allScriptsFetchFailure",value:function(e){console.log("ERROR >>> ",e)}},{key:"enableFirstVideoScript",value:function(){this.showFirstVideoScript=!0}},{key:"displayFirstVideoScript",value:function(){if(!HippoVideo.data.api.getProperty("videosCreatedByUser")&&1==HippoVideo.data.api.getProperty("isSalesUser")&&1==HippoVideo.data.api.getProperty("isTrialPlan")){var e=this.getFirstVideoScript();e&&(this.enableDisablePrompter(),HippoVideo.data.api.getProperty("isNewRecordScreenEnabled")&&(be()(".hvrecorder-promptscript-container").removeClass("disp-none"),be()("#videoPrompterContainer").removeClass("disp-none"),be()("#toggleTeleprompterMenu input").attr("checked",!0),qi.default.setLocalStorageValue("hv-prompt-enable-"+this.userId,!0)),this.changeVideoScriptWithId(e.id),this.enableFirstVideoScriptTooltip())}}},{key:"enableFirstVideoScriptTooltip",value:function(){be()("#enableScriptId, #disableScriptId").addClass("newpr-tooltip").attr("tooltip-hippo",Vi.a.videoPrompter.firstVideoTooltip),qi.default.trackInThirdPartyTools("FV - teleprompter tooltip",{email:this.userEmail})}},{key:"getFirstVideoScript",value:function(){return this.allScripts.filter((function(e){return e.is_first_script}))[0]}},{key:"enableChecklistTeleprompterScript",value:function(){var e=this;this.myScripts&&(this.enableDisablePrompter(),this.myScripts.forEach((function(t){(e.fromChecklistProspecting&&"Prospecting video"==t.title||e.fromChecklistInviteVideo&&"Event invite video / greetings video"==t.title)&&e.changeVideoScriptWithId(t.id)})))}},{key:"initPrompt",value:function(){this.promptheight=be()("#teleprompterId").height(),this.promptTop=this.$el.find("#"+this.prompterId).css("top");var e=be()("#teleprompterId").outerHeight(!0);be()("#teleprompterSiblingDiv").css("min-height",e),"auto"==this.promptTop?this.promptTop=this.$el.find("#"+this.prompterId).position().top:this.promptTop=parseInt(this.promptTop.substr(0,this.promptTop.length-2))}},{key:"refreshVideoPrompter",value:function(){qi.default.trackInThirdPartyTools("Video Prompt refresh clicked",{email:this.userEmail}),this.render(),be()("#refreshPrompterPages").addClass("refreshing")}},{key:"selectVideoScript",value:function(e){var t=e.currentTarget.dataset.text;t=this.changeTextWithMFValues(t),be()("#teleprompterId").text(t),this.$el.find("#"+this.prompterId).css("top","auto"),this.$el.find("#scriptListId, #scriptTypesId").addClass("hide"),this.$el.find("#promptSettingsContainer").removeClass("hide"),this.initPrompt(),this.scriptSelected=!0,this.selectedScriptId=e.currentTarget.id,be()("#telepromterColumnContainer").scrollTop(0),qi.default.trackInThirdPartyTools("Video Prompt on record - script selected",{email:this.userEmail})}},{key:"changeVideoScriptWithId",value:function(e){if(this.$el.find("#"+e).length>0){var t=this.$el.find("#"+e).attr("data-text");t=this.changeTextWithMFValues(t),be()("#teleprompterId").text(t),this.$el.find("#"+this.prompterId).css("top","auto"),this.$el.find("#scriptListId, #scriptTypesId").addClass("hide"),this.$el.find("#promptSettingsContainer").removeClass("hide"),this.initPrompt(),this.scriptSelected=!0,this.selectedScriptId=e,qi.default.trackInThirdPartyTools("Video Prompt on record - script selected",{email:this.userEmail})}}},{key:"changeTextWithMFValues",value:function(e){for(var t in this.mergeFieldValues){var i=this.mergeFieldValues[t];if(i){var n="\\${"+t+"}";e=e.replace(new RegExp(n,"g"),i)}}return e}},{key:"enableDisablePrompter",value:function(){this.$el.toggleClass("disp-none"),be()("#videoPrompterNote, .ed-prompter-link").toggleClass("hide"),be()("#enableScriptId").hasClass("hide")?this.scriptSelected=!1:this.scriptSelected=!0,this.restartPrompt(),this.resetPrompt(),this.$el.find("#promptSettingsContainer").addClass("hide"),this.$el.find("#scriptTypesId, #scriptListId").removeClass("hide"),this.scriptSelected=!1,be()("#teleprompterId").attr("contenteditable","true"),be()("#promptPropertiesId .font-size").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .linespace-container").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .font-size").removeClass("show-tooltip"),be()("#promptPropertiesId .linespace-container").removeClass("show-tooltip"),be()("#telepromterColumnContainer").removeClass("disable-teleprompt-scroll");var e=be()("#enableScriptId").hasClass("hide")?"enabled":"disabled";qi.default.trackInThirdPartyTools("Sales - teleprompter clicked "+e,{email:this.userEmail})}},{key:"keyPressEvent",value:function(e){var t=e.keyCode;this.spaceAllowedTags.includes(e.target.nodeName)||this.$el.find("#teleprompterId").is(":focus")||32!=t||(e.preventDefault(),e.stopPropagation()),this.$el.find("#teleprompterId").is(":focus")||32==t&&(this.promptStarted?(be()("#teleprompterId").attr("contenteditable","true"),be()("#promptPropertiesId .font-size").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .linespace-container").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .font-size").removeClass("show-tooltip"),be()("#promptPropertiesId .linespace-container").removeClass("show-tooltip"),be()("#telepromterColumnContainer").removeClass("disable-teleprompt-scroll"),this.stopPrompt(),this.promptStarted=!1,this.promptCompleted=!1):(this.startPrompt(),this.promptStarted=!0),1==this.promptCompleted&&this.restartPrompt(),qi.default.trackInThirdPartyTools("Video Prompt on record - space pressed",{email:this.userEmail}))}},{key:"startPrompt",value:function(){if(this.scriptSelected)if(this.initPrompt(),parseInt(this.promptTop)>=-1*this.promptheight+this.lastLineHeight){this.$el.find("#"+this.prompterId).css("top",parseInt(this.promptTop)-this.nextStep),be()("#promptPropertiesId .font-size").addClass("show-tooltip"),be()("#promptPropertiesId .linespace-container").addClass("show-tooltip"),be()("#telepromterColumnContainer").addClass("disable-teleprompt-scroll");var e=-1*(parseInt(this.promptTop)-this.nextStep);setTimeout((function(){be()("#telepromterColumnContainer").scrollTop(e)}),1),be()("#teleprompterId").attr("contenteditable","false"),this.scrollTimerDown&&this.stopPrompt(),this.scrollTimerDown=setTimeout(this.startPrompt,this.scrollTimeout)}else be()("#teleprompterId").attr("contenteditable","true"),be()("#promptPropertiesId .font-size").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .linespace-container").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .font-size").removeClass("show-tooltip"),be()("#promptPropertiesId .linespace-container").removeClass("show-tooltip"),be()("#telepromterColumnContainer").removeClass("disable-teleprompt-scroll"),this.stopPrompt()}},{key:"isScriptSelected",value:function(){return this.scriptSelected}},{key:"getSelectedScriptId",value:function(){return this.selectedScriptId}},{key:"getTeleprompterTrackingParams",value:function(){return{"prompt-line-space":parseFloat(qi.default.getLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId)),"prompt-speed-val":parseInt(this.$el.find("#speedSliderId").attr("data-value")),"prompt-font-size":parseInt(be()("#teleprompterId").css("font-size"))}}},{key:"stopPrompt",value:function(){if(this.scrollTimerDown){clearTimeout(this.scrollTimerDown);var e=-1*(parseInt(this.promptTop)-this.nextStep);be()("#teleprompterId").outerHeight()-89<=e&&(this.promptCompleted=!0)}}},{key:"restartPrompt",value:function(){this.resetPrompt(),this.startPrompt()}},{key:"resetPrompt",value:function(){this.stopPrompt(),this.$el.find("#"+this.prompterId).animate({top:this.initialTop}),be()("#telepromterColumnContainer").scrollTop(this.initialScroll)}},{key:"changeVideoScript",value:function(){this.$el.find("#promptSettingsContainer").addClass("hide"),this.$el.find("#scriptTypesId, #scriptListId").removeClass("hide"),this.scriptSelected=!1,qi.default.trackInThirdPartyTools("Video Prompt on record - change script clicked",{email:this.userEmail})}},{key:"textSizeIncrease",value:function(){var e=parseInt(be()("#teleprompterId").css("font-size"));if(e>=this.maxFontSize)this.$el.find("#textSizeIncrease").addClass("in-active");else{this.resetPrompt(),this.$el.find("#textSizeDecrease").removeClass("in-active"),(e+=5)>=this.maxFontSize&&this.$el.find("#textSizeIncrease").addClass("in-active"),be()("#teleprompterId").css("font-size",e+"px");var t=be()("#teleprompterId").outerHeight(!0);be()("#teleprompterSiblingDiv").css("min-height",t),qi.default.setLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId,e),qi.default.trackInThirdPartyTools("Video Prompt on record - text size increased",{email:this.userEmail})}}},{key:"textSizeDecrease",value:function(){var e=parseInt(be()("#teleprompterId").css("font-size"));if(e<=this.minFontSize)this.$el.find("#textSizeDecrease").addClass("in-active");else{this.resetPrompt(),this.$el.find("#textSizeIncrease").removeClass("in-active"),(e-=5)<=this.minFontSize&&this.$el.find("#textSizeDecrease").addClass("in-active"),be()("#teleprompterId").css("font-size",e+"px");var t=be()("#teleprompterId").outerHeight(!0);be()("#teleprompterSiblingDiv").css("min-height",t),qi.default.setLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId,e),qi.default.trackInThirdPartyTools("Video Prompt on record - text size decreased",{email:this.userEmail})}}},{key:"speedIncrease",value:function(){var e=parseInt(this.$el.find("#speedSliderId").attr("data-value")),t=e+1,i=parseInt(this.$el.find("#speedSliderId").attr("data-max"));e>=i||(this.$el.find(".speed-plus-container").removeClass("in-active"),e+=1,this.$el.find("#speedSliderId").attr("data-value",e).text(e),this.setSpeedProperties(),t>=i&&this.$el.find(".speed-plus-container").addClass("in-active"),this.$el.find(".speed-minus-container").removeClass("in-active"),qi.default.trackInThirdPartyTools("Video Prompt on record - speed increased",{email:this.userEmail}))}},{key:"speedDecrease",value:function(){var e=parseInt(this.$el.find("#speedSliderId").attr("data-value")),t=e-1,i=parseInt(this.$el.find("#speedSliderId").attr("data-min"));e<=i||(this.$el.find(".speed-minus-container").removeClass("in-active"),e-=1,this.$el.find("#speedSliderId").attr("data-value",e).text(e),this.setSpeedProperties(),t<=i&&this.$el.find(".speed-minus-container").addClass("in-active"),this.$el.find(".speed-plus-container").removeClass("in-active"),qi.default.trackInThirdPartyTools("Video Prompt on record - speed decreased",{email:this.userEmail}))}},{key:"lineSpaceIncrease",value:function(){var e=parseFloat(qi.default.getLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId));if(e>=this.maxLineSpace)this.$el.find("#lineSpaceIncrease").addClass("in-active");else{this.resetPrompt(),this.$el.find("#lineSpaceDecrease").removeClass("in-active"),(e+=.25)>=this.maxLineSpace&&this.$el.find("#lineSpaceIncrease").addClass("in-active"),be()("#teleprompterId").css("line-height",e);var t=be()("#teleprompterId").outerHeight(!0);be()("#teleprompterSiblingDiv").css("min-height",t),qi.default.setLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId,e),qi.default.trackInThirdPartyTools("Video Prompt on record - line space increased",{email:this.userEmail})}}},{key:"lineSpaceDecrease",value:function(){var e=parseFloat(qi.default.getLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId));if(e<=this.minLineSpace)this.$el.find("#lineSpaceDecrease").addClass("in-active");else{this.resetPrompt(),this.$el.find("#lineSpaceIncrease").removeClass("in-active"),(e-=.25)<=this.minLineSpace&&this.$el.find("#lineSpaceDecrease").addClass("in-active"),be()("#teleprompterId").css("line-height",e);var t=be()("#teleprompterId").outerHeight(!0);be()("#teleprompterSiblingDiv").css("min-height",t),qi.default.setLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId,e),qi.default.trackInThirdPartyTools("Video Prompt on record - line sapce decreased",{email:this.userEmail})}}},{key:"hidePromptProperties",value:function(){console.log("HIDE CALLED"),this.$el.find("#promptPropertiesId").addClass("hide")}},{key:"showPromptProperties",value:function(){this.$el.find("#promptPropertiesId").removeClass("hide")}},{key:"addNewScriptFromPrompt",value:function(){if(qi.default.trackInThirdPartyTools("Video Prompt on record - right side add new script clicked",{email:this.userEmail}),HippoVideo&&HippoVideo.AppRegistry&&HippoVideo.AppRegistry.isDeepIntg){var e=new URL(window.location.protocol+"//"+window.location.host+"/video-scripts/home"),t={authentication_token:HippoVideo.UserProfile.authToken,email:HippoVideo.UserProfile.userEmail,open_new:!0};e.search=new URLSearchParams(t).toString(),window.open(e)}else window.open("/video-scripts/home?open_new=true","_blank");window.opener=null}},{key:"addNewScriptFromAllScripts",value:function(){qi.default.trackInThirdPartyTools("Video Prompt on record - add new script clicked from all scripts",{email:this.userEmail}),window.open("/video-scripts/home?open_new=true","_blank"),window.opener=null}},{key:"addNewScriptFromMyScripts",value:function(){if(qi.default.trackInThirdPartyTools("Video Prompt on record - add new script clicked from my scripts",{email:this.userEmail}),HippoVideo&&HippoVideo.AppRegistry&&HippoVideo.AppRegistry.isDeepIntg){var e=new URL(window.location.protocol+"//"+window.location.host+"/video-scripts/home"),t={authentication_token:HippoVideo.UserProfile.authToken,email:HippoVideo.UserProfile.userEmail,open_new:!0};e.search=new URLSearchParams(t).toString(),window.open(e)}else window.open("/video-scripts/home?open_new=true","_blank");window.opener=null}},{key:"handleTabChange",value:function(e){e.preventDefault(),be()(".tab-title").removeClass("active"),be()(".content").removeClass("active"),be()(e.target.attributes[0].nodeValue).addClass("active"),be()(e.target.attributes[0].nodeValue+"Title").addClass("active");var t=e.target.getAttribute("data-tab");be()("#"+t).addClass("active"),be()("#"+t+"Title").addClass("active")}},{key:"speedSliderChange",value:function(){qi.default.trackInThirdPartyTools("Video Prompt on record - speed slider changed",{email:this.userEmail}),this.setSpeedProperties()}},{key:"setSpeedProperties",value:function(){var e=parseInt(this.$el.find("#speedSliderId").attr("data-value"));qi.default.setLocalStorageValue("prompt-speed-"+HippoVideo.UserProfile.userId,e),this.nextStep=1,this.scrollTimeout=(parseInt(this.$el.find("#speedSliderId").attr("data-max"))-e)*this.prompterSpeedVal,this.restartPrompt()}},{key:"setDefaultSpeed",value:function(e){var t=parseInt(this.$el.find("#speedSliderId").attr("data-value"));e&&!isNaN(e)&&(this.$el.find("#speedSliderId").attr("data-value",e).text(e),t=e),this.nextStep=1,this.scrollTimeout=(parseInt(this.$el.find("#speedSliderId").attr("data-max"))-t)*this.prompterSpeedVal}},{key:"initLineSpace",value:function(){var e=qi.default.getLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId);null==e?(qi.default.setLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId,this.minLineSpace),this.inActiveMinusLine=!0,this.inActivePlusLine=!1):e>=this.maxLineSpace?(qi.default.setLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId,this.maxLineSpace),this.inActiveMinusLine=!1,this.inActivePlusLine=!0):e<=this.minLineSpace&&(qi.default.setLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId,this.minLineSpace),this.inActiveMinusLine=!0,this.inActivePlusLine=!1)}},{key:"initTextSize",value:function(){var e=qi.default.getLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId),t=e;null==e?(t=this.minFontSize,qi.default.setLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId,t),this.inActiveMinus=!0,this.inActivePlus=!1):e>=this.maxFontSize?(t=this.maxFontSize,qi.default.setLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId,t),this.inActiveMinus=!1,this.inActivePlus=!0):e<=this.minFontSize&&(t=this.minFontSize,qi.default.setLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId,t),this.inActiveMinus=!0,this.inActivePlus=!1),be()("#teleprompterId").css("font-size",t+"px")}},{key:"initSpeed",value:function(){var e=qi.default.getLocalStorageValue("prompt-speed-"+HippoVideo.UserProfile.userId),t=e;null==e?(qi.default.setLocalStorageValue("prompt-speed-"+HippoVideo.UserProfile.userId,this.minSpeedVal),t=this.minSpeedVal,this.inActiveMinusSpeed=!0,this.inActivePlusSpeed=!1):e>=this.maxSpeedVal?(qi.default.setLocalStorageValue("prompt-speed-"+HippoVideo.UserProfile.userId,this.maxSpeedVal),t=this.maxSpeedVal,this.inActiveMinusSpeed=!1,this.inActivePlusSpeed=!0):e<=this.minSpeedVal&&(qi.default.setLocalStorageValue("prompt-speed-"+HippoVideo.UserProfile.userId,this.minSpeedVal),t=this.minSpeedVal,this.inActiveMinusSpeed=!0,this.inActivePlusSpeed=!1),this.$el.find("#speedSliderId").text(t)}},{key:"destroy",value:function(){be()(document).off("keydown",this.keyPressEvent),this.undelegateEvents()}}]),i}(Ni.a.View),Ki=(i(74),i(116),i(153),i(154),i(89)),Yi=i.n(Ki),Ji=i(127),Xi=i(405),Qi=i.n(Xi),Zi=i(180);function en(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function tn(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?en(Object(i),!0).forEach((function(t){Yi()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):en(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function nn(e){var t=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(e){return!1}}();return function(){var i,n=Ai()(e);if(t){var r=Ai()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return Pi()(this,i)}}var rn=function(e){Ei()(i,e);var t=nn(i);function i(){return Ci()(this,i),t.apply(this,arguments)}return xi()(i,[{key:"initialize",value:function(e){HippoVideo.UserProfile||(HippoVideo.UserProfile={}),this.prompterId=e.promptContainer||"teleprompterSiblingDiv";var t=(HippoVideo.UserProfile.userFirstName+" "+HippoVideo.UserProfile.userLastName).trim();this.mergeFieldValues={"Lead Name":t,"Lead Email":HippoVideo.UserProfile.userEmail,"Lead Company Name":HippoVideo.UserProfile.userCompanyName},this.mergeFieldValues=Object(Ji.a)({},this.mergeFieldValues,e.mergeFieldValues||{}),this.newRecorderScreen="newRecorderScreen"==e.from,this.activeTab="allVideoScripts",this.scriptSelected=!1,this.defaultScriptId=e.defaultScriptId,this.enableChangeScript=null==e.enableChangeScript||e.enableChangeScript,this.settingModel=new zi.a({settingTabName:ji.a.wizSetting.VIDEO_SCRIPT,guestToken:e.guestToken}),this.prompterModel=e.prompterModel,this.callback=e.callback,this.fromChecklistProspecting=e.fromChecklistProspecting,this.fromChecklistInviteVideo=e.fromChecklistInviteVideo,this.getAudioVolume=e.getAudioVolume,this.userEmail=HippoVideo.UserProfile.userEmail,this.spaceAllowedTags=["TEXTAREA","INPUT"],this.promptStarted=!1,this.promptCompleted=!1,this.allScripts=[],this.showFirstVideoScript=!1,this.isRendered=!1,this.render()}},{key:"bindEvents",value:function(){this.enableDisablePrompter=this.enableDisablePrompter.bind(this),this.selectVideoScript=this.selectVideoScript.bind(this),this.startPrompt=this.startPrompt.bind(this),this.keyPressEvent=this.keyPressEvent.bind(this),this.restartPrompt=this.restartPrompt.bind(this),this.resetPrompt=this.resetPrompt.bind(this),this.changeTextWithMFValues=this.changeTextWithMFValues.bind(this),this.changeVideoScript=this.changeVideoScript.bind(this),this.textSizeRange=this.textSizeRange.bind(this),this.lineSpaceRange=this.lineSpaceRange.bind(this),this.speedRange=this.speedRange.bind(this),this.addNewScriptFromPrompt=this.addNewScriptFromPrompt.bind(this),this.allScriptsFetchSuccess=this.allScriptsFetchSuccess.bind(this),this.allScriptsFetchFailure=this.allScriptsFetchFailure.bind(this),this.addNewScriptFromAllScripts=this.addNewScriptFromAllScripts.bind(this),this.addNewScriptFromMyScripts=this.addNewScriptFromMyScripts.bind(this),this.refreshVideoPrompter=this.refreshVideoPrompter.bind(this),this.changeVideoScriptWithId=this.changeVideoScriptWithId.bind(this),this.handleTabChange=this.handleTabChange.bind(this),this.speedOption=this.speedOption.bind(this),this.scriptSearch=this.scriptSearch.bind(this)}},{key:"initEvents",value:function(){this.delegate("click",".script-list",this.selectVideoScript),this.delegate("click","#changeScriptId",this.changeVideoScript),be()("#addNewScriptFromPrompt").on("click",this.addNewScriptFromPrompt),be()("#addNewScriptFromAllScripts").on("click",this.addNewScriptFromAllScripts),be()("#addNewScriptFromMyScripts").on("click",this.addNewScriptFromMyScripts),be()(".tab-title").on("click",this.handleTabChange),be()("#refreshPrompterPages").on("click",this.refreshVideoPrompter),be()("#enableScriptId").on("click",this.enableDisablePrompter),be()("#disableScriptId").on("click",this.enableDisablePrompter),be()("#textSizeRange").on("change",this.textSizeRange),be()("#lineSpaceRange").on("change",this.lineSpaceRange),be()("#speedRange").on("change",this.speedRange),be()("#speedOption").on("change",this.speedOption),be()("#scriptSearch").on("input",this.scriptSearch),be()(".scrollDetail").on("click",this.scrollDetail),be()(".scrollDetailclose").on("click",this.scrollDetail),be()("#teleprompterId").off("paste").on("paste",$i),be()(document).off("keydown"),be()(document).on("keydown",this.keyPressEvent);var e=this;be()("#telepromterColumnContainer").on("mousedown wheel DOMMouseScroll mousewheel keyup",Object(Zi.a)((function(){be()("#telepromterColumnContainer").stop(!0)}),500,!0)),be()("#telepromterColumnContainer").on("mousedown wheel DOMMouseScroll mousewheel keyup",Object(Zi.a)((function(){e.promptStarted&&e.startPrompt()}),250))}},{key:"render",value:function(){var e=this;this.prompterModel?this.prompterModel.getAllScripts(data).then((function(t){e.scriptResponse=t,e.allScriptsFetchSuccess(t)})).catch((function(t){return e.allScriptsFetchFailure(t)})):this.settingModel.getAllVideoScript({to_prompt:!0,filter_by:1},(function(t){e.scriptResponse=t,e.settingModel.getAllVideoScript({to_prompt:!0,filter_by:2},(function(t){e.scriptResponse.shared_scripts=t.all_scripts,e.allScriptsFetchSuccess(e.scriptResponse)}),(function(t){e.allScriptsFetchSuccess(e.scriptResponse),e.allScriptsFetchFailure(t)})),e.settingModel.getAllVideoScript({to_prompt:!0,filter_by:3},(function(t){e.scriptResponse.my_scripts=t.all_scripts,e.allScriptsFetchSuccess(e.scriptResponse)}),(function(t){e.allScriptsFetchSuccess(e.scriptResponse),e.allScriptsFetchFailure(t)}))}),(function(t){return e.allScriptsFetchFailure(t)}))}},{key:"allScriptsFetchSuccess",value:function(e){this.$el.empty();var t={newRecorderScreen:this.newRecorderScreen,activeTab:this.activeTab};this.$el.append(Qi()(Object(Ji.a)({},t,e,Vi.a))),this.mergeFieldValues["Lead Company Name"]=e.company_name,this.bindEvents(),this.initEvents(),this.prompterModel||be()(document).foundation(),null!=this.defaultScriptId&&(0==this.defaultScriptId?be()("#allVideoScripts .script-list").first().click():be()("#allVideoScripts").find("#"+this.defaultScriptId).click()),this.enableChangeScript||be()("#changeScriptId").remove(),this.callback&&this.callback();var i=qi.default.getLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId),n=qi.default.getLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId),r=qi.default.getLocalStorageValue("prompt-speed-"+HippoVideo.UserProfile.userId),o=qi.default.getLocalStorageValue("prompt-speed-type-"+HippoVideo.UserProfile.userId);(i<1.25||i>2.5)&&(i=1),(n<20||n>40)&&(n=30),(r<1||r>7)&&(r=2),i&&(be()("#lineSpaceRange").val(i),be()("#teleprompterId").css("line-height",i),be()("#lineSpaceCount").text(i)),n&&(be()("#textSizeRange").val(n),be()("#teleprompterId").css("font-size",n+"px"),be()("#textSizeCount").text(n)),r&&!isNaN(r)&&(be()("#speedRange").val(r),be()("#speedCount").text(r)),be()("#speedOption").val(o||"auto"),"voice"===o&&this.speedOption(),(this.fromChecklistProspecting||this.fromChecklistInviteVideo)&&(this.myScripts=e.my_scripts,this.enableChecklistTeleprompterScript()),this.allScripts=e.all_scripts,qi.default.getLocalStorageValue("prompt-enable-"+HippoVideo.UserProfile.userId)&&this.openPrompter(),this.showFirstVideoScript&&this.displayFirstVideoScript(),this.isRendered=!0}},{key:"allScriptsFetchFailure",value:function(e){console.log("ERROR >>> ",e)}},{key:"enableFirstVideoScript",value:function(){this.showFirstVideoScript=!0}},{key:"scriptSearch",value:function(e){var t;e.preventDefault(),e.stopPropagation();var i,n,r,o,a,s,l=null==e||null===(t=e.target.value)||void 0===t?void 0:t.toLowerCase();l?(i=null===(o=this.scriptResponse.all_scripts)||void 0===o?void 0:o.filter((function(e){var t;return-1!==(null===(t=e.title)||void 0===t?void 0:t.toLowerCase().indexOf(l))})),n=null===(a=this.scriptResponse.my_scripts)||void 0===a?void 0:a.filter((function(e){var t;return-1!==(null===(t=e.title)||void 0===t?void 0:t.toLowerCase().indexOf(l))})),r=null===(s=this.scriptResponse.shared_scripts)||void 0===s?void 0:s.filter((function(e){var t;return-1!==(null===(t=e.title)||void 0===t?void 0:t.toLowerCase().indexOf(l))}))):(i=this.scriptResponse.all_scripts,n=this.scriptResponse.my_scripts,r=this.scriptResponse.shared_scripts);this.allScriptsFetchSuccess(tn(tn({},this.scriptResponse),{},{all_scripts:i,my_scripts:n,shared_scripts:r,initialSearchValue:l}));var c=be()("#scriptSearch").val();be()("#scriptSearch").focus().val("").val(c)}},{key:"displayFirstVideoScript",value:function(){if(!HippoVideo.data.api.getProperty("videosCreatedByUser")&&1==HippoVideo.data.api.getProperty("isSalesUser")&&1==HippoVideo.data.api.getProperty("isTrialPlan")){var e=this.getFirstVideoScript();e&&(this.enableDisablePrompter(),this.openPrompter(),this.changeVideoScriptWithId(e.id),this.enableFirstVideoScriptTooltip())}}},{key:"openPrompter",value:function(){be()("#toggleTeleprompterMenu input").attr("checked",!0),be()(".hvrecorder-promptscript-container").removeClass("disp-none"),be()("#videoPrompterContainer").removeClass("disp-none"),be()("#promptHelptextControl").removeClass("disp-none")}},{key:"enableFirstVideoScriptTooltip",value:function(){be()("#enableScriptId, #disableScriptId").addClass("newpr-tooltip").attr("tooltip-hippo",Vi.a.videoPrompter.firstVideoTooltip),qi.default.trackInThirdPartyTools("FV - teleprompter tooltip",{email:this.userEmail})}},{key:"getFirstVideoScript",value:function(){return this.allScripts.filter((function(e){return e.is_first_script}))[0]}},{key:"enableChecklistTeleprompterScript",value:function(){var e=this;this.myScripts&&(this.enableDisablePrompter(),this.myScripts.forEach((function(t){(e.fromChecklistProspecting&&"Prospecting video"==t.title||e.fromChecklistInviteVideo&&"Event invite video / greetings video"==t.title)&&e.changeVideoScriptWithId(t.id)})))}},{key:"refreshVideoPrompter",value:function(e){e.preventDefault(),e.stopPropagation(),qi.default.trackInThirdPartyTools("Video Prompt refresh clicked",{email:this.userEmail}),this.render(),be()("#refreshPrompterPages").addClass("refreshing")}},{key:"selectVideoScript",value:function(e){var t=e.currentTarget.dataset.text;t=this.changeTextWithMFValues(t),be()("#teleprompterId").text(t),this.$el.find("#"+this.prompterId).css("top","auto"),this.$el.find("#scriptListId, #scriptTypesId").addClass("hide"),this.$el.find("#promptSettingsContainer").removeClass("hide"),this.scriptSelected=!0,this.selectedScriptId=e.currentTarget.id,be()("#telepromterColumnContainer").scrollTop(0),qi.default.trackInThirdPartyTools("Video Prompt on record - script selected",{email:this.userEmail})}},{key:"changeVideoScriptWithId",value:function(e){if(this.$el.find("#"+e).length>0){var t=this.$el.find("#"+e).attr("data-text");t=this.changeTextWithMFValues(t),be()("#teleprompterId").text(t),this.$el.find("#"+this.prompterId).css("top","auto"),this.$el.find("#scriptListId, #scriptTypesId").addClass("hide"),this.$el.find("#promptSettingsContainer").removeClass("hide"),this.scriptSelected=!0,this.selectedScriptId=e,qi.default.trackInThirdPartyTools("Video Prompt on record - script selected",{email:this.userEmail})}}},{key:"changeTextWithMFValues",value:function(e){for(var t in this.mergeFieldValues){var i=this.mergeFieldValues[t];if(i){var n="\\${"+t+"}";e=e.replace(new RegExp(n,"g"),i)}}return e}},{key:"enableDisablePrompter",value:function(){this.$el.toggleClass("disp-none"),be()("#videoPrompterNote, .ed-prompter-link").toggleClass("hide"),be()("#enableScriptId").hasClass("hide")?this.scriptSelected=!1:this.scriptSelected=!0,this.restartPrompt(),this.resetPrompt(),this.$el.find("#promptSettingsContainer").addClass("hide"),this.$el.find("#scriptTypesId, #scriptListId").removeClass("hide"),this.scriptSelected=!1,be()("#teleprompterId").attr("contenteditable","true"),be()("#promptPropertiesId .font-size").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .linespace-container").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .font-size").removeClass("show-tooltip"),be()("#promptPropertiesId .linespace-container").removeClass("show-tooltip"),be()("#telepromterColumnContainer").removeClass("disable-teleprompt-scroll");var e=be()("#enableScriptId").hasClass("hide")?"enabled":"disabled";qi.default.trackInThirdPartyTools("Sales - teleprompter clicked "+e,{email:this.userEmail})}},{key:"keyPressEvent",value:function(e){var t=e.keyCode;this.spaceAllowedTags.includes(e.target.nodeName)||this.$el.find("#teleprompterId").is(":focus")||32!=t||(e.preventDefault(),e.stopPropagation()),this.$el.find("#teleprompterId").is(":focus")||32==t&&(this.promptStarted?(be()("#teleprompterId").attr("contenteditable","true"),be()("#promptPropertiesId .font-size").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .linespace-container").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .font-size").removeClass("show-tooltip"),be()("#promptPropertiesId .linespace-container").removeClass("show-tooltip"),be()("#telepromterColumnContainer").removeClass("disable-teleprompt-scroll"),this.stopPrompt(),this.promptCompleted=!1):(1==this.promptCompleted?this.restartPrompt():this.startPrompt(),this.promptStarted=!0),qi.default.trackInThirdPartyTools("Video Prompt on record - space pressed",{email:this.userEmail}))}},{key:"speedOption",value:function(){this.resetPrompt();var e=be()("#speedOption").val();if("auto"===e)be()(document).off("keydown"),be()(document).on("keydown",this.keyPressEvent),clearInterval(this.myInterval),this.myInterval=void 0,be()("#speedRange").show(),be()("#speedCount").show(),this.startPrompt();else{be()(document).off("keydown"),be()("#speedRange").hide(),be()("#speedCount").hide(),this.audioMeterFlow();var t=this;!t.getExtensionAudioVolume&&window.addEventListener("message",(function(e){e.data.type&&"audioMeter"==e.data.type&&(t.getExtensionAudioVolume=e.data.volume)}))}qi.default.setLocalStorageValue("prompt-speed-type-"+HippoVideo.UserProfile.userId,e),qi.default.trackInThirdPartyTools("Video Prompt on record - speed option changed ".concat(e),{email:this.userEmail})}},{key:"scrollDetail",value:function(){be()("#scrollDetailModal").toggle()}},{key:"audioMeterFlow",value:function(){var e=this,t=0,i=0;this.myInterval=setInterval((function(){if("auto"!==be()("#speedOption").val()){var n=100*(e.getExtensionAudioVolume||e.getAudioVolume());t+=n,i++,n>=1.6&&(!e.promptStarted&&!e.promptCompleted&&e.startPrompt(),t=0,i=0),i>5&&(t/i<1.6&&!e.promptCompleted&&e.stopPrompt(),t=0,i=0)}}),100)}},{key:"startPrompt",value:function(){if(this.scriptSelected){var e=this;this.stopPrompt(!0),this.promptStarted=!0,be()("#promptPropertiesId .font-size").addClass("show-tooltip"),be()("#promptPropertiesId .linespace-container").addClass("show-tooltip"),be()("#teleprompterId").attr("contenteditable","false");var t=(be()("#teleprompterId").outerHeight(!0)||0)-(be()("#telepromterColumnContainer").height()||0);be()("#telepromterColumnContainer").animate({scrollTop:t},{duration:(t-(be()("#telepromterColumnContainer").scrollTop()||1))/t*9500*(t/700)*(parseInt(be()("#speedRange").prop("max"))+1-parseInt(be()("#speedRange").val())),easing:"linear",step:function(e,t){},complete:function(){e.promptCompleted=!0,be()("#teleprompterId").attr("contenteditable","true"),be()("#promptPropertiesId .font-size").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .linespace-container").removeClass("disable-teleprompt-options"),be()("#promptPropertiesId .font-size").removeClass("show-tooltip"),be()("#promptPropertiesId .linespace-container").removeClass("show-tooltip"),be()("#telepromterColumnContainer").removeClass("disable-teleprompt-scroll"),e.stopPrompt()}})}}},{key:"isScriptSelected",value:function(){return this.scriptSelected}},{key:"getSelectedScriptId",value:function(){return this.selectedScriptId}},{key:"getTeleprompterTrackingParams",value:function(){return{"prompt-line-space":parseFloat(qi.default.getLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId)),"prompt-speed-val":parseInt(this.$el.find("#speedRange").val()),"prompt-font-size":parseInt(be()("#teleprompterId").css("font-size"))}}},{key:"stopPrompt",value:function(){be()("#telepromterColumnContainer").stop(!0),be()("#teleprompterId").off("input"),this.promptStarted=!1}},{key:"restartPrompt",value:function(){this.resetPrompt(),this.startPrompt()}},{key:"resetPrompt",value:function(){this.promptCompleted=!1,this.stopPrompt(),be()("#telepromterColumnContainer").stop(!0),be()("#telepromterColumnContainer").scrollTop(0)}},{key:"changeVideoScript",value:function(){this.stopPrompt(),this.$el.find("#promptSettingsContainer").addClass("hide"),this.$el.find("#scriptTypesId, #scriptListId").removeClass("hide"),this.scriptSelected=!1,qi.default.trackInThirdPartyTools("Video Prompt on record - change script clicked",{email:this.userEmail})}},{key:"textSizeRange",value:function(){var e=parseFloat(qi.default.getLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId)),t=this.$el.find("#textSizeRange").val();be()("#textSizeCount").text(t),this.resetPrompt(),be()("#teleprompterId").css("font-size",t+"px");var i=be()("#teleprompterId").outerHeight(!0);be()("#teleprompterSiblingDiv").css("min-height",i),qi.default.setLocalStorageValue("prompt-text-font-"+HippoVideo.UserProfile.userId,t),qi.default.trackInThirdPartyTools("Video Prompt on record - text size ".concat(t>e?"increased":"decreased"),{email:this.userEmail})}},{key:"speedRange",value:function(){var e=parseInt(this.$el.find("#speedRange").val());this.$el.find("#speedCount").text(e);var t=qi.default.setLocalStorageValue("prompt-speed-"+HippoVideo.UserProfile.userId);this.restartPrompt(),qi.default.setLocalStorageValue("prompt-speed-"+HippoVideo.UserProfile.userId,e),qi.default.trackInThirdPartyTools("Video Prompt on record - speed ".concat(e>t?"increased":"decreased"),{email:this.userEmail})}},{key:"lineSpaceRange",value:function(){var e=parseFloat(qi.default.getLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId)),t=this.$el.find("#lineSpaceRange").val();be()("#lineSpaceCount").text(t),this.resetPrompt(),be()("#teleprompterId").css("line-height",t);var i=be()("#teleprompterId").outerHeight(!0);be()("#teleprompterSiblingDiv").css("min-height",i),qi.default.setLocalStorageValue("prompt-line-space-"+HippoVideo.UserProfile.userId,t),qi.default.trackInThirdPartyTools("Video Prompt on record - line space ".concat(t>e?"increased":"decreased"),{email:this.userEmail})}},{key:"hidePromptProperties",value:function(){this.$el.find("#promptPropertiesId").hide()}},{key:"showPromptProperties",value:function(){this.$el.find("#promptPropertiesId").show()}},{key:"addNewScriptFromPrompt",value:function(e){if(e.preventDefault(),e.stopPropagation(),qi.default.trackInThirdPartyTools("Video Prompt on record - right side add new script clicked",{email:this.userEmail}),HippoVideo&&HippoVideo.AppRegistry&&HippoVideo.AppRegistry.isDeepIntg){var t=new URL(window.location.protocol+"//"+window.location.host+"/video-scripts/home"),i={authentication_token:HippoVideo.UserProfile.authToken,email:HippoVideo.UserProfile.userEmail,open_new:!0};t.search=new URLSearchParams(i).toString(),window.open(t)}else window.open("/video-scripts/home?open_new=true","_blank");window.opener=null}},{key:"addNewScriptFromAllScripts",value:function(e){e.preventDefault(),e.stopPropagation(),qi.default.trackInThirdPartyTools("Video Prompt on record - add new script clicked from all scripts",{email:this.userEmail}),window.open("/video-scripts/home?open_new=true","_blank"),window.opener=null}},{key:"addNewScriptFromMyScripts",value:function(e){if(e.preventDefault(),e.stopPropagation(),qi.default.trackInThirdPartyTools("Video Prompt on record - add new script clicked from my scripts",{email:this.userEmail}),HippoVideo&&HippoVideo.AppRegistry&&HippoVideo.AppRegistry.isDeepIntg){var t=new URL(window.location.protocol+"//"+window.location.host+"/video-scripts/home"),i={authentication_token:HippoVideo.UserProfile.authToken,email:HippoVideo.UserProfile.userEmail,open_new:!0};t.search=new URLSearchParams(i).toString(),window.open(t)}else window.open("/video-scripts/home?open_new=true","_blank");window.opener=null}},{key:"handleTabChange",value:function(e){e.preventDefault(),e.stopPropagation(),this.scriptSearch(e),be()(".tab-title").removeClass("active"),be()(".content").removeClass("active"),this.activeTab=e.target.attributes[0].nodeValue,be()(e.target.attributes[0].nodeValue).addClass("active"),be()(e.target.attributes[0].nodeValue+"Title").addClass("active");var t=e.target.getAttribute("data-tab");be()("#"+t).addClass("active"),be()("#"+t+"Title").addClass("active")}},{key:"destroy",value:function(){be()(document).off("keydown",this.keyPressEvent),this.undelegateEvents()}}]),i}(Ni.a.View);var on,an,sn,ln,cn,dn,un=function(e){return window.HippoVideo&&window.HippoVideo.data&&HippoVideo.data.api.getProperty("isNewRecordScreenEnabled")&&"newRecorderScreen"===e.from?new rn(e):new Gi(e)},pn=L.c.div(on||(on=Ct()(["\n width: 100%;\n margin: auto;\n position: absolute;\n left: 50%;\n top: 0;\n transform: translateX(-50%);\n z-index: 11;\n -background: transparent linear-gradient(180deg, #000000 0%, #000000CC 83%, #00000000 100%) 0% 0% no-repeat padding-box;\n background: rgba(0,0,0,0.5);\n -border: 1px solid #dbdbdb;\n transition: opacity 0.5s linear, transform 0.2s linear;\n border-radius: 15px 15px 0 0;\n"])));function hn(e){var t=e.countdownStarted,i=e.recordingStarted,n=Object(s.useRef)(),r=Object(s.useRef)(),o=Object(s.useContext)(B.a).authentication,a=function(){n.current.setDefaultSpeed(1)};return Object(s.useEffect)((function(){t&&n.current&&(n.current.resetPrompt(),n.current.hidePromptProperties())}),[t]),Object(s.useEffect)((function(){n.current&&(i?n.current.restartPrompt():(n.current.resetPrompt(),n.current.showPromptProperties()))}),[i]),Object(s.useLayoutEffect)((function(){var e=new wi({token:o.token,tokenType:o.tokenType,email:o.email});return n.current=new un({el:r.current,defaultScriptId:0,prompterModel:e,sdkTeleprompter:!0,enableChangeScript:!1,callback:a}),function(){n.current.destroy(),n.current=null}}),[]),n.current&&!n.current.isScriptSelected()&&i?null:l.a.createElement(pn,{ref:r})}var fn,mn=L.c.div(an||(an=Ct()(["\n position: absolute;\n z-index: 30;\n background: #212126;\n width: 240px;\n box-shadow: 0px 8px 12px rgba(0,0,0,0.1);\n border: 1px solid #34343C;\n bottom: 100%;\n left: 10px;\n border-radius: 5px;\n padding: 8px 5px 12px 5px;\n"]))),gn=L.c.div(sn||(sn=Ct()(["\n width: 90%;\n margin: 0 auto;\n text-align: left;\n"]))),vn=L.c.div(ln||(ln=Ct()(["\n color: #C3C3C3;\n font: normal normal 600 14px/16px Open Sans;\n border-bottom: 1px solid #34343C;\n height: 30px;\n display: flex;\n align-items: center;\n"]))),yn=L.c.div(cn||(cn=Ct()(["\n font: normal normal 600 13px/16px Open Sans;\n color: #C3C3C3;\n margin-top: 5px;\n > span {\n color: #FC3B52;\n }\n"]))),bn=L.c.div(dn||(dn=Ct()(["\n font: italic normal normal 13px/16px Open Sans;\n color: #C3C3C3;\n margin-top: 5px;\n line-height: 18px;\n"])));function wn(e){var t=e.info;return l.a.createElement(mn,null,l.a.createElement(gn,null,l.a.createElement(vn,null,"Lighting Info"),l.a.createElement(yn,null,"Status: ",l.a.createElement("span",null,t.status)),l.a.createElement(bn,null,t.message)))}var Sn,Cn,kn,xn,_n,En,Tn=L.c.div(fn||(fn=Ct()(["\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n & > span {\n font-size: 12px;\n color: #D8D8D8;\n }\n & > img {\n margin-left: 5px;\n margin-right: 5px;\n }\n"])));function Pn(e){var t=e.lightingCanvas,i=e.videoElement,n=Object(s.useState)(!1),r=n[0],o=n[1],a=Object(s.useState)({}),c=a[0],d=a[1],u=i||window&&window.videoPreviewRef&&window.videoPreviewRef.current,p=t||window&&window.lightingCanvasRef&&window.lightingCanvasRef.current,h=Object(s.useRef)();Object(s.useEffect)((function(){return function(){return clearTimeout(h.current)}}),[]),Object(s.useEffect)((function(){if(p&&u){var e=p.getContext("2d"),t=u.offsetWidth,i=t/16*9;p.width=t/15,p.height=i/15,f(u,p,e)}return function(){return clearTimeout(h.current)}}),[p,u,window.videoPreviewRef]);var f=function e(t,i,n){if(0!==i.width&&0!==i.height){n.drawImage(t,0,0,t.videoWidth,t.videoHeight,0,0,i.width,i.height);for(var r=n.getImageData(0,0,i.width,i.height),o=0,a=0;a<r.data.length;a+=4)o+=.21*r.data[a]+.72*r.data[a+1]+.07*r.data[a+2];var s={};(o/=r.data.length)<20?(s.status="Poor",s.message="Your light source is poor. Please move to a better light source."):o<40?(s.status="Good",s.message="Your light source is good. You can improve further by moving to a better light source."):(s.status="Excellent",s.message="Your light source is excellent. Happy recording!"),h.current=setTimeout((function(){window.requestAnimationFrame((function(){e(t,i,n)}))}),1e3),d(s)}};return l.a.createElement(Tn,{onMouseEnter:function(){return o(!0)},onMouseLeave:function(){return o(!1)}},r&&l.a.createElement(wn,{info:c}),l.a.createElement("img",{src:Object(M.e)("/svg/rapi/lighting-icon.svg"),width:"14"}),l.a.createElement("span",null,"Lighting"),l.a.createElement("img",{src:Object(M.e)("/svg/rapi/info-circle-grey.svg"),width:"10"}))}var In,An=L.c.div(Sn||(Sn=Ct()(["\n position: absolute;\n z-index: 30;\n width: 240px;\n bottom: 100%;\n left: -75%;\n background-color: #212126;\n border: 1px solid #34343C;\n border-radius: 6px;\n box-shadow: 0px 8px 12px #00000066;\n"]))),Rn=L.c.div(Cn||(Cn=Ct()(["\n font: normal normal 400 14px/16px Open Sans;\n color: #C3C3C3;\n height: 35px;\n width: 90%;\n display: flex;\n margin: 0 auto;\n align-items: center;\n border-bottom: 1px solid #34343C;\n"]))),On=L.c.div(kn||(kn=Ct()(["\n margin-top: 5px;\n display: flex;\n flex-flow: column;\n justify-content: space-evenly;\n min-height: 150px;\n max-height: 200px;\n"]))),Nn=L.c.div(xn||(xn=Ct()(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 90%;\n margin: 0 auto;\n min-height: 40px;\n max-height: 60px;\n background-color: #292929;\n border-radius: 6px;\n"]))),Dn=L.c.div(_n||(_n=Ct()(["\n max-width: 50%;\n font: italic normal normal 13px/16px Open Sans;\n color: #C3C3C3;\n margin-left: 10px;\n text-align: left;\n"]))),Ln=L.c.div(En||(En=Ct()(["\n font: normal normal 600 14px/16px Open Sans;\n color: #FFFFFF;\n margin-right: 10px;\n"])));function Mn(e){var t=e.webcamQualityInfo,i=void 0===t?{}:t;return l.a.createElement(An,null,l.a.createElement(Rn,null,"Current Webcam Info"),l.a.createElement(On,null,l.a.createElement(Nn,null,l.a.createElement(Dn,null,"Frame rate"),l.a.createElement(Ln,null,i.frameRate)),l.a.createElement(Nn,null,l.a.createElement(Dn,null,"Resolution"),l.a.createElement(Ln,null,i.resolution)),l.a.createElement(Nn,null,l.a.createElement(Dn,null,"Quality"),l.a.createElement(Ln,null,i.quality))))}var Bn,Fn=L.c.div(In||(In=Ct()(["\n display: flex;\n align-items: center;\n justify-content: left;\n position: relative;\n & > span {\n font-size: 12px;\n color: #D8D8D8;\n }\n & > img {\n margin-left: 5px;\n margin-right: 5px;\n }\n"])));function Vn(e){var t=e.webcamQualityInfo,i=Object(s.useState)(!1),n=i[0],r=i[1];return l.a.createElement(Fn,{onMouseEnter:function(){return r(!0)},onMouseLeave:function(){return r(!1)}},n&&l.a.createElement(Mn,{webcamQualityInfo:t}),l.a.createElement("img",{src:Object(M.e)("/svg/rapi/info-white.svg"),width:"14"}),l.a.createElement("span",null,"Video Quality"))}var Un,zn,Hn,jn,qn=L.c.div(Bn||(Bn=Ct()(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n & > span {\n font-size: 11px;\n color: #fff;\n }\n"]))),$n=i(406),Wn=i.n($n),Gn=L.c.div(Un||(Un=Ct()(["\n position: relative;\n"]))),Kn=L.c.label(zn||(zn=Ct()(['\n position: absolute;\n top: 7px;\n left: 0;\n width: 41px;\n height: 19px;\n border-radius: 20px;\n background: #43454E;\n cursor: pointer;\n &::after {\n content: "";\n display: block;\n border-radius: 50%;\n width: 15px;\n height: 15px;\n margin: 2px;\n background: #ffffff;\n box-shadow: 1px 3px 3px 1px rgba(0, 0, 0, 0.2);\n transition: 0.2s;\n }\n']))),Yn=L.c.input(Hn||(Hn=Ct()(["\n opacity: 0;\n z-index: 1;\n border-radius: 15px !important;\n margin: 0 !important; /* Foundation is overriding these styles!!!! */\n width: 42px !important; /* Foundation is overriding these styles!!!! */\n height: 26px !important; /* Foundation is overriding these styles!!!! */\n &:checked + ",' {\n background: #37C689;\n &::after {\n content: "";\n display: block;\n border-radius: 50%;\n width: 15px;\n height: 15px;\n margin-left: 22px;\n transition: 0.2s;\n }\n }\n'])),Kn);function Jn(e){var t=e.selected,i=e.onToggle,n=Object(s.useRef)(Wn()("hv-toggle-"));return l.a.createElement(Gn,null,l.a.createElement(Yn,{id:n.current,onChange:i,type:"checkbox",checked:t}),l.a.createElement(Kn,{htmlFor:n.current}))}function Xn(e){var t=e.showTeleprompter,i=e.onTeleprompterToggle;return l.a.createElement(qn,null,l.a.createElement(Jn,{selected:t,onToggle:i}))}var Qn=L.c.div(jn||(jn=Ct()(["\n background-color: #43454E;\n width: 31px;\n height: 31px;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n z-index: 10;\n img {\n width: ",";\n }\n"])),(function(e){return e.type===Zn.PAUSE_RESUME?"10px":"12px"})),Zn={PAUSE_RESUME:1,ABORT:2};function er(e){var t=e.type,i=e.recordingPaused,n=e.onAbortRecording,r=e.onPauseResumeRecording;return l.a.createElement(Qn,{onClick:function(e){t===Zn.PAUSE_RESUME&&r(e),t===Zn.ABORT&&n(e)},type:t},l.a.createElement("img",{src:t===Zn.PAUSE_RESUME?i?Object(M.e)("/svg/rapi/resume-recording.svg"):Object(M.e)("/svg/rapi/pause-recording.svg"):t===Zn.ABORT?Object(M.e)("/svg/rapi/abort-recording.svg"):void 0}))}i(371),i(78);var tr,ir=i(181),nr=i.n(ir),rr=(i(85),L.c.div(tr||(tr=Ct()(["\n position: relative;\n width: 100%;\n max-width: 150px;\n height: 100%;\n background-color: #121212;\n border-radius: 2px;\n transition: all .5s ease;\n box-shadow: 0px 8px 12px #00000066;\n font: normal normal normal 12px/14px Open Sans;\n text-transform: capitalize;\n color: #FFFFFF;\n text-align: left;\n\n .dropdown-select {\n cursor: ",";\n display: block;\n padding: 10px 30px 10px 10px;\n div {\n text-overflow: ellipsis;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n }\n img {\n position: absolute;\n right: 10px;\n top: 15px;\n }\n }\n\n .dropdown-menu {\n position: absolute;\n width: 100%;\n left: 0;\n margin-top: 1px;\n max-height: 144px;\n overflow-y: auto;\n z-index: 9;\n background-color: #121212;\n border-radius: 2px;\n\n li {\n padding: 10px;\n transition: all .2s ease-in-out;\n cursor: pointer;\n list-style: none;\n &:hover {\n background: #000;\n }\n }\n }\n"])),(function(e){return e.enabled?"pointer":"not-allowed"})));function or(e){var t=e.defaultLabel,i=void 0===t?"Default":t,n=e.items,r=void 0===n?[]:n,o=e.onChange,a=e.disabled,c=void 0!==a&&a,d=Object(s.useState)(),u=d[0],p=d[1],h=Object(s.useState)(!1),f=h[0],m=h[1];return l.a.createElement(rr,{className:"dropdown",enabled:!c},l.a.createElement("div",{className:"dropdown-select",onClick:function(){return!c&&m(!f)}},l.a.createElement("div",null,u||i),l.a.createElement("img",{src:Object(M.e)("/svg/rapi/down-arrow-black.svg")})),f&&l.a.createElement("ul",{className:"dropdown-menu"},r.map((function(e,t){return l.a.createElement("li",{"data-value":e.value,onClick:function(){return t=e.value,i=e.label,p(i),m(!1),void(o&&o(t));var t,i},key:t},e.label)}))))}var ar,sr,lr,cr,dr,ur,pr=1,hr=2;function fr(e){var t,i=e.type,n=e.handleSourceChange,r=e.selectedDevice,o=e.disabled,a=Object(s.useState)([]),c=a[0],d=a[1],u=Object(s.useState)(!0),p=u[0],h=u[1],f=Object(s.useRef)();t=i==pr?{webcam:!0,audio:!1}:{audio:!0,webcam:!1};Object(s.useEffect)((function(){if(f.current&&!o){var e=setInterval((function(){at({webcam:i===pr,audio:i!==pr}).then((function(){clearInterval(e),m()})).catch((function(e){return console.error("PERMISSION ERROR ",e)}))}),2e3);return function(){return clearInterval(e)}}}),[p,o]),Object(s.useEffect)((function(){m()}),[]);var m=function(){st(t).then((function(e){var t=e.error,i=e.devices;if(t)f.current=t,h(!1);else{var n=[];i.audio&&i.audio.forEach((function(e){n.push({value:e.deviceId,label:e.label})})),i.webcam&&i.webcam.forEach((function(e){n.push({value:e.deviceId,label:e.label})})),f.current=null,d(n),h(!1)}})).catch((function(e){console.log(e.name+": "+e.message),h(!1)}))};return function(){if(p)return l.a.createElement(or,{items:[{value:"-1",label:"Fetching the device info"}],disabled:!0});if(f.current)return l.a.createElement(or,{items:[{value:"-1",label:"Permission not given"}],disabled:!0});if(0===c.length)return l.a.createElement(or,{items:[{value:"-1",label:"No devices found"}],disabled:!0});var e=r||"default",t=nr()(c),i=(r&&c.forEach((function(e){if(e.value===r)return e.label})),"Default");return console.log("DEVICES ",t,e),l.a.createElement(or,{items:t,onChange:n,defaultLabel:i,defaultValue:e,disabled:o})}()}var mr,gr=L.c.div(ar||(ar=Ct()(["\n position: absolute;\n width: 345px;\n bottom: 80px;\n left: 30%;\n z-index: 30;\n background-color: #212126;\n border-radius: 5px;\n"]))),vr=L.c.div(sr||(sr=Ct()(["\n color: #fff;\n text-align: left;\n padding: 15px;\n border-bottom: 1px solid #333339;\n"]))),yr=L.c.div(lr||(lr=Ct()(["\n width: 100%;\n margin: 0 auto;\n padding: 15px;\n"]))),br=L.c.div(cr||(cr=Ct()(["\n margin: 0 auto 20px;\n display: flex;\n align-items: center;\n"]))),wr=L.c.label(dr||(dr=Ct()(["\n display: inline-block;\n vertical-align: middle;\n width: 100px;\n font-size: 13px;\n font-weight: 400;\n color: #fff;\n text-align: left;\n"]))),Sr=L.c.div(ur||(ur=Ct()(["\n width: 200px;\n"]))),Cr=function(){for(var e=[],t=0,i=Object.entries(ee.b);t<i.length;t++){var n=i[t],r=n[0],o=n[1];e.push({label:r,value:o})}return e}(),kr=Object(s.forwardRef)((function(e,t){var i=e.webcam,n=e.audio,r=(e.aspectRatio,e.webcamSourceId),o=e.audioSourceId,a=e.onSourceSelection,c=Object(s.useState)(),d=c[0],u=c[1],p=Object(s.useState)(),h=p[0],f=p[1],m=Object(s.useState)(),g=m[0],v=m[1];Object(s.useEffect)((function(){y()}),[g,h,d]);var y=function(){var e={};n&&h&&(e.audio=h),i&&d&&(e.webcam=d),i&&g&&(e.aspectRatio=g),a&&a(e)};return l.a.createElement(gr,{ref:t},l.a.createElement(vr,null,"Settings"),l.a.createElement(yr,null,i&&l.a.createElement(br,null,l.a.createElement(wr,null,"Webcam"),l.a.createElement(Sr,null,l.a.createElement(fr,{handleSourceChange:function(e){u(e)},type:pr,selectedDevice:d||r}))),n&&l.a.createElement(br,null,l.a.createElement(wr,null,"Microphone"),l.a.createElement(Sr,null,l.a.createElement(fr,{handleSourceChange:function(e){f(e)},type:hr,selectedDevice:h||o}))),i&&l.a.createElement(br,null,l.a.createElement(wr,null,"Aspect Ratio"),l.a.createElement(Sr,null,l.a.createElement(or,{defaultLabel:"16:9",items:Cr,onChange:function(e){v(e)}})))))})),xr=L.c.div(mr||(mr=Ct()(["\n display: flex;\n align-items: center;\n justify-content: center;\n & > span {\n position: relative;\n width: 35px;\n height: 35px;\n border-radius: 50%;\n background-color: #43454E;\n cursor: ",";\n opacity: ",";\n\n & > img {\n margin-top: 10px;\n }\n }\n"])),(function(e){return e.enabled?"pointer":"default"}),(function(e){return e.enabled?"1":"0.3"}));function _r(e){var t=e.webcam,i=e.mic,n=e.webcamSourceId,r=e.audioSourceId,o=e.aspectRatio,a=e.onSourceSelection,c=Object(s.useState)(!1),d=c[0],u=c[1],p=Object(s.useRef)(),h=Object(s.useRef)(),f=function(e){!p.current||p.current.contains(e.target)||h.current.contains(e.target)||d&&u(!1)};return Object(s.useEffect)((function(){if(d)return document.addEventListener("mousedown",f),function(){document.removeEventListener("mousedown",f)}}),[p,d]),l.a.createElement(xr,{enabled:t||i},l.a.createElement("span",{onClick:function(){return(t||i)&&u(!d)}},l.a.createElement("img",{ref:h,src:Object(M.e)("/svg/rapi/settings-white.svg"),width:"15"})),d&&l.a.createElement(kr,{ref:p,webcam:t,audio:i,webcamSourceId:n,audioSourceId:r,aspectRatio:o,onSourceSelection:a}))}i(96);var Er,Tr,Pr,Ir,Ar,Rr,Or,Nr,Dr,Lr,Mr,Br=L.c.div(Er||(Er=Ct()(["\n width: 100%;\n"]))),Fr=L.c.iframe(Tr||(Tr=Ct()(["\n width: 100%;\n height: 95%;\n border: 1px solid #ddd;\n border-radius: 8px;\n"]))),Vr=L.c.div(Pr||(Pr=Ct()(["\n position: relative;\n margin: 0;\n"]))),Ur=Object(L.c)(Vr)(Ir||(Ir=Ct()(["\n height: 100%;\n right: 0;\n"]))),zr=Object(L.c)(Vr)(Ar||(Ar=Ct()(["\n width: 60%;\n display: flex;\n align-items: center;\n padding-right: 10px;\n"]))),Hr=L.c.canvas(Rr||(Rr=Ct()(["\n display: block;\n width: 100%;\n height: 100%;\n border-radius: 3px;\n background: #ebebeb 0% 0% no-repeat padding-box;\n"]))),jr=L.c.img(Or||(Or=Ct()(["\n display: block;\n height: 20px;\n width: 20px;\n padding: 4px;\n margin-right: 10px;\n background-color: #525252;\n border-radius: 50%;\n\n // @media only screen and (min-width: 540px) {\n // height: 26px;\n // }\n // @media only screen and (min-width: 720px) {\n // height: 32px;\n // }\n"]))),qr=L.c.div(Nr||(Nr=Ct()(["\n\n"]))),$r=Object(L.c)(qr)(Dr||(Dr=Ct()(["\n height: 90%;\n margin: 0 auto;\n @media only screen and (min-width: 540px) {\n height: 90%;\n }\n @media only screen and (min-width: 720px) {\n height: 91%;\n }\n"]))),Wr=Object(L.c)(qr)(Lr||(Lr=Ct()(["\n width: 80%;\n height: 6px;\n"]))),Gr="url",Kr=1,Yr=2;function Jr(e){var t=e.type,i=e.stream,n=e.streamType,r=e.showIcon,o=e.errorCallback,a=Object(s.useRef)(),c=Object(s.useRef)(),d=Object(s.useRef)();console.log("AUDIO METER ",i,n);var u=function e(i){var n=a.current;null!=n&&(t===Kr?function(e,t){var i,n,r,o,a,s=t.getContext("2d"),l=t.width,c=t.height,d=e*c*5,u=(r=200,o=50,a=255,(i=2*d)<(n=0)?o:i>r?a:(i-n)*(a-o)/(r-n)+o);s.clearRect(0,0,l,c),s.fillStyle="#000",s.fillRect(0,c,l,-3),s.fillStyle="rgb(".concat(Math.floor(u),", ").concat(Math.floor(205-u/2),", 50)"),s.fillRect(0,c,l,-d)}(c.current.volume,n):function(e,t){var i=t.getContext("2d"),n=t.width,r=t.height,o=e*n*5;i.clearRect(0,0,n,r),i.fillStyle="#F5B93F",i.fillRect(0,0,3,n),i.fillRect(0,0,o,n)}(c.current.volume,n)),d.current=window.requestAnimationFrame(e)};Object(s.useEffect)((function(){if(i&&n!==Gr){try{if(i.getAudioTracks().length){var e=new AudioContext,t=e.createMediaStreamSource(i);c.current=wt.createAudioMeter(e),setTimeout((function(){c.current&&0===c.current.volume&&console.log("WARNING FAULTY MIC")}),2e3),t.connect(c.current),console.log("DRAWING AUDIO METER"),u()}}catch(e){o&&o(e),console.log(e)}return function(){console.log("AUDIO METER EXITING PROPERLY"),d.current&&(window.cancelAnimationFrame(d.current),d.current=null)}}}),[i]);var p=i;n===Gr&&(p="".concat(i,"?mic=true"));return function(){switch(t){case t===Kr:return l.a.createElement(Ur,null,n===Gr?l.a.createElement(Br,null,l.a.createElement(Fr,{src:p})):l.a.createElement($r,null,l.a.createElement(Hr,{ref:a})),r&&l.a.createElement(jr,{src:Object(M.e)("/svg/audio-on.svg"),alt:"Mic"}));default:return l.a.createElement(zr,null,r&&l.a.createElement(jr,{src:Object(M.e)("/svg/audio-on.svg"),alt:"Mic"}),n===Gr?l.a.createElement(Br,null,l.a.createElement(Fr,{src:p})):l.a.createElement(Wr,null,l.a.createElement(Hr,{ref:a})))}}()}var Xr,Qr,Zr,eo,to=L.c.div(Mr||(Mr=Ct()(["\n display: flex;\n align-items: center;\n justify-content: right;\n"])));function io(e){var t=e.stream,i=e.streamType,n=e.showIcon;return l.a.createElement(to,null,l.a.createElement(Jr,{type:Yr,stream:t,streamType:i,showIcon:n}))}function no(e){var t=e.recorder,i=Object(s.useState)(0),n=i[0],r=i[1];Object(s.useEffect)((function(){t.setTimerCallback((function(e){return r(e)}))}),[]);return l.a.createElement("div",null,function(){if(n<0)return"0m:0s";var e=parseInt(n,10),t=Math.floor(e/3600),i=Math.floor((e-3600*t)/60),r=e-3600*t-60*i;t<10&&(t="0"+t),i<10&&(i="0"+i),r<10&&(r="0"+r);var o="".concat(i,":").concat(r);return parseInt(t)>0&&(o="".concat(t,"h:").concat(i,"m:").concat(r,"s")),o}())}var ro,oo,ao,so,lo,co=L.c.div(Xr||(Xr=Ct()(["\n display: flex;\n align-items: center;\n justify-content: center;\n"]))),uo=L.c.div(Qr||(Qr=Ct()(["\n width: ",";\n position: relative;\n border-radius: 25px;\n height: ",";\n z-index: 1;\n background-color: ",";\n"])),(function(e){return e.recording?"100px":"auto"}),(function(e){return e.recording?"50px":"auto"}),(function(e){return e.recording?"#43454E":"transparent"})),po=L.c.div(Zr||(Zr=Ct()(["\n position: absolute;\n font-size: 11px;\n color: #ffffff;\n right: 10px;\n top: 35%;\n"]))),ho=L.c.div(eo||(eo=Ct()(["\n width: ",";\n height: ",";\n border-radius: ",";\n left: ",";\n top: ",";\n background-color: rgb(221, 52, 65);\n margin: 0;\n position: relative;\n cursor: pointer;\n &:before {\n position: absolute;\n content: '';\n left: ",";\n top: ",";\n width: ",";\n height: ",";\n z-index: ",";\n border-radius: 50%;\n background-color: ",";\n border: ",";\n margin: 0;\n }\n"])),(function(e){return e.recording?"24px":"34px"}),(function(e){return e.recording?"24px":"34px"}),(function(e){return e.recording?"6px":"50%"}),(function(e){return e.recording?"13px":""}),(function(e){return e.recording?"13px":""}),(function(e){return e.recording?"-10px":"-6px"}),(function(e){return e.recording?"-10px":"-6px"}),(function(e){return e.recording?"44px":"42px"}),(function(e){return e.recording?"44px":"42px"}),(function(e){return e.recording?"-1":"1"}),(function(e){return e.recording?"#FFFFFF":"transparent"}),(function(e){return e.recording?"none":"2px solid rgb(221, 52, 65)"}));function fo(e){var t=e.recorder,i=e.recordingStarted,n=e.onStopRecording,r=e.onStartRecording;return l.a.createElement(co,null,l.a.createElement(uo,{recording:i},l.a.createElement(ho,{recording:i,onClick:function(){return i?n():r()}}),i&&l.a.createElement(po,null,l.a.createElement(no,{recorder:t}))))}var mo,go,vo,yo,bo,wo,So=L.c.div(ro||(ro=Ct()(['\n width: 100%;\n height: 60px;\n position: absolute;\n bottom: 0;\n left: 0;\n background-color: rgba(0,0,0,0.6);\n border-radius: 0 0 15px 15px;\n display: grid;\n grid-template-columns: repeat(2, 1fr) 2fr 2fr;\n font-family: "Open Sans";\n justify-content: center;\n']))),Co=L.c.div(oo||(oo=Ct()(["\n grid-column-start: ",";\n min-width: 200px;\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n place-items: center;\n"])),(function(e){return!e.webcam||e.recordingStarted?"3":"auto"})),ko=L.c.div(ao||(ao=Ct()(["\n position: absolute;\n bottom: 100%;\n text-align: center;\n width: 100%;\n color: #FFFFFF;\n background-color: inherit;\n font: ",";\n > span {\n color: #DD3441;\n font: normal normal 600 16px/22px Open Sans;\n }\n"])),(function(e){return e.recordingStarted?"normal normal normal 12px/17px Open Sans":"normal normal 600 16px/22px Open Sans"})),xo=L.c.div(so||(so=Ct()(["\n\n"]))),_o=L.c.div(lo||(lo=Ct()(["\n color: #fff;\n font-size: 10px;\n"])));function Eo(e){var t=e.recorder,i=e.recordingStarted,n=e.screen,r=e.webcam,o=e.mic,a=e.stream,s=e.streamType,c=e.webcamSourceId,d=e.audioSourceId,u=e.aspectRatio,p=e.onSourceSelection,h=e.showTeleprompter,f=e.onTeleprompterToggle,m=e.teleprompterEnabled,g=e.onAbortRecording,v=e.onPauseResumeRecording,y=e.recordingPaused,b=e.onStartRecording,w=e.onStopRecording,S=e.lightingCanvas,C=e.videoElement,k=e.webcamQualityInfo;return l.a.createElement(So,null,i&&h?l.a.createElement(ko,{recordingStarted:!0},"Note: Press Space to Play/Pause video prompting"):i?void 0:l.a.createElement(ko,null,"Press ",l.a.createElement("span",null,"Record")," to start!"),r&&!i&&l.a.createElement(l.a.Fragment,null,l.a.createElement(Pn,{lightingCanvas:S,videoElement:C}),l.a.createElement(Vn,{webcamQualityInfo:k})),l.a.createElement(Co,{webcam:r,recordingStarted:i},!i&&l.a.createElement(_r,{webcam:r,mic:o,webcamSourceId:c,audioSourceId:d,aspectRatio:u,onSourceSelection:p}),i&&l.a.createElement(er,{type:Zn.ABORT,onAbortRecording:g}),l.a.createElement(fo,{recorder:t,recordingStarted:i,onStartRecording:b,onStopRecording:w}),i&&l.a.createElement(er,{type:Zn.PAUSE_RESUME,onPauseResumeRecording:v,recordingPaused:y}),!i&&!n&&m&&l.a.createElement(xo,null,l.a.createElement(Xn,{showTeleprompter:h,onTeleprompterToggle:f}),l.a.createElement(_o,null,"Teleprompter"))),(r||n)&&o&&a&&l.a.createElement(io,{stream:a,streamType:s,showIcon:!0}))}var To,Po,Io,Ao,Ro,Oo=L.c.div(mo||(mo=Ct()(["\n -width: 80%;\n -margin: 0 auto;\n display: grid;\n grid-template-columns: 1fr 1fr;\n margin-top: 15px;\n position: relative;\n z-index: 20;\n"]))),No=L.c.div(go||(go=Ct()(["\n display: grid;\n align-items: center;\n grid-template-columns: 1fr 4fr;\n -padding-left: 20px;\n padding-right: 10px;\n ","\n"])),(function(e){return e.disabled&&"opacity: 0.4; cursor: not-allowed"})),Do=L.c.div(vo||(vo=Ct()(["\n -background-color: #f5fdf9;\n -border: 1px solid #39ce8e;\n border-radius: 4px;\n width: 40px;\n height: 35px;\n filter: grayscale(1);\n text-align: right;\n & > img {\n height: 15px;\n margin-top: 9px;\n }\n"]))),Lo=L.c.div(yo||(yo=Ct()(["\n width: 40px;\n height: 35px;\n filter: grayscale(1);\n text-align: right;\n & > img {\n height: 15px;\n margin-top: 9px;\n transform: scale(1.2);\n }\n"]))),Mo=L.c.div(bo||(bo=Ct()(["\n margin-left: 15px;\n width: 165px;\n"]))),Bo=L.c.div(wo||(wo=Ct()(["\n display: grid;\n align-items: center;\n grid-template-columns: 1fr 4fr;\n padding-left: 10px;\n -padding-right: 20px;\n ","\n"])),(function(e){return e.disabled&&"opacity: 0.4; cursor: not-allowed"}));function Fo(e){var t=e.webcam,i=e.audio,n=e.handleWebcamSourceChange,r=e.handleAudioSourceChange;return l.a.createElement(Oo,null,l.a.createElement(No,{disabled:!t},l.a.createElement(Do,null,l.a.createElement("img",{src:Object(M.e)("/svg/rapi/webcam-on.svg")})),l.a.createElement(Mo,null,l.a.createElement(fr,{handleSourceChange:n,type:pr,disabled:!t}))),l.a.createElement(Bo,{disabled:!i},l.a.createElement(Lo,null,l.a.createElement("img",{src:Object(M.e)("/svg/rapi/mic-on.svg")})),l.a.createElement(Mo,null,l.a.createElement(fr,{handleSourceChange:r,type:hr,disabled:!i}))))}var Vo,Uo,zo=L.c.div(To||(To=Ct()([""]))),Ho=L.c.div(Po||(Po=Ct()(["\n text-align: center;\n color: #C3C3C3;\n font: normal normal normal 14px/18px Open Sans;\n width: 75%;\n letter-spacing: 0.2px;\n margin: 0 auto;\n"]))),jo=L.c.video(Io||(Io=Ct()(["\n height: 280px;\n"]))),qo=L.c.div(Ao||(Ao=Ct()(["\n width: 90%;\n margin: 15px auto 0 auto;\n text-align: center;\n"]))),$o=L.c.div(Ro||(Ro=Ct()(["\n font: normal normal normal 12px/17px Open Sans;\n color: #FFFFFF;\n letter-spacing: 0.5px;\n margin-top: 10px;\n cursor: pointer;\n"])));function Wo(e){var t=e.permissionError,i=e.webcam,n=e.mic,r=e.onPermissionGranted,o=(e.showClose,e.onClose);Object(s.useEffect)((function(){var e=ee.k[t.type];if(!(isNaN(parseInt(e))||parseInt(e)-1e3>=100)){var o=setInterval((function(){at({webcam:i,mic:n}).then((function(){clearInterval(o),console.log("SUCCESS CAN GO BACK TO THE RECORD SCREEN"),r()})).catch((function(){console.log("PERMISSION NOT YET GRANTED")}))}),1e3);return function(){clearInterval(o)}}}));return l.a.createElement(zo,null,l.a.createElement(qo,null,l.a.createElement(jo,{src:function(){if(t)switch(t.type){case ee.k.WEBCAM_PERMISSION_DENIED:return Object(M.e)("/hippo_videos/WebcamMicPermissionError.mp4");case ee.k.SCREEN_PERMISSION_DENIED:return Object(M.e)("/hippo_videos/ScreenShareCancelError.mp4");case ee.k.SCREEN_PERMISSION_DENIED:case ee.k.SYSTEM_SCREEN_PERMISSION_DENIED:default:return Object(M.e)("/hippo_videos/WebcamAudioSettings.mp4")}return"http://localhost:3000/hippo_videos/WebcamAudioSettings.mp4"}(),autoPlay:!0,muted:!0,loop:!0})),l.a.createElement(Ho,null,function(){if(!t)return"Unknown error";switch(t.type){case ee.k.WEBCAM_PERMISSION_DENIED:return"Webcam permission denied";case ee.k.WEBCAM_NOT_FOUND:return"Webcam device not found";case ee.k.WEBCAM_READ_TIMEOUT:return"Could not start the webcam device. Please restart your browser or system and try again";case ee.k.SCREEN_PERMISSION_DENIED:case ee.k.SYSTEM_SCREEN_PERMISSION_DENIED:return"Please provide system permission to record";case ee.k.SCREEN_PERMISSION_DENIED:return"Please provide permission to record screen";case ee.k.SCREEN_NOT_READABLE_ERROR:return"Error in starting screen recording. Please restart your browser or system and try again";default:return"Unknown device error"}}()),l.a.createElement($o,{onClick:function(e){e.preventDefault(),o&&o()}},"Close"))}var Go,Ko,Yo,Jo,Xo,Qo,Zo,ea=L.c.div(Vo||(Vo=Ct()(['\n position: relative;\n width: 30px;\n height: 30px;\n opacity: 0.7;\n cursor: pointer;\n &:hover {\n opacity: 1;\n }\n &:before,\n &:after {\n position: absolute;\n right: 14px;\n top: 4px;\n content: " ";\n height: 20px;\n width: 2px;\n background-color: #FFFFFF;\n }\n &:before {\n transform: rotate(45deg);\n }\n &:after {\n transform: rotate(-45deg);\n }\n']))),ta=Object(L.c)(ea)(Uo||(Uo=Ct()(["\n background-color: #121212;\n border-radius: 4px;\n"])));function ia(e){var t=e.withBorder,i=void 0!==t&&t,n=e.onClose;return i?l.a.createElement(ta,{onClick:n}):l.a.createElement(ea,{onClick:n})}var na,ra=L.c.div(Go||(Go=Ct()(["\n position: relative;\n border-radius: 15px;\n margin: 0 auto;\n width: 640px;\n min-height: 360px;\n max-height: 500px;\n background-color: #2E2E2E;\n display: grid;\n place-items: center;\n"]))),oa=L.c.div(Ko||(Ko=Ct()(["\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: #000;\n top: 0;\n left: 0;\n border-radius: 15px;\n z-index: 100;\n"]))),aa=L.c.div(Yo||(Yo=Ct()(["\n background: transparent linear-gradient(180deg, #000000 0%, #000000CC 83%, #00000000 100%) 0% 0% no-repeat padding-box;\n font: normal normal 600 14px/16px Open Sans;\n color: ",";\n height: 45px;\n display: flex;\n position: absolute;\n justify-content: center;\n align-items: center;\n top: 0;\n width: 100%;\n left: 0;\n z-index: 10;\n border-radius: 15px 15px 0 0;\n opacity: 0.72;\n"])),(function(e){return e.startedRecording?"#DE3232":"#FFFFFF"})),sa=L.c.div(Jo||(Jo=Ct()(["\n display: grid;\n margin-top: -30px;\n"]))),la=L.c.div(Xo||(Xo=Ct()(["\n display: flex;\n flex-flow: column;\n"]))),ca=L.c.div(Qo||(Qo=Ct()(["\n position: absolute;\n width: 275px;\n bottom: 85px;\n box-shadow: 0px 8px 12px #00000066;\n border: 1px solid #34343C;\n background-color: #212126;\n padding: 5px 15px;\n border-radius: 10px;\n z-index: 10;\n text-align: left;\n .mic-error-modal-header {\n display: flex;\n align-items: center;\n color: #C3C3C3;\n font: normal normal 600 12px/10px Open Sans;\n img {\n margin-right: 10px;\n width: 16px;\n }\n }\n .mic-error-modal-content {\n font: italic normal normal 12px/13px Open Sans;\n color: #C3C3C3;\n padding: 10px 0px;\n line-height: 1.4em;\n }\n"]))),da=L.c.div(Zo||(Zo=Ct()(["\n position: absolute;\n right: -35px;\n top: 0px;\n"]))),ua=L.c.div(na||(na=Ct()(["\n width: 100%;\n height: 100%;\n border-radius: inherit;\n background: rgba(0,0,0,0.6);\n position: absolute;\n z-index: 500;\n .hv-cancel-record-modal {\n display: flex;\n justify-content: center;\n flex-flow: column;\n height: 100%;\n align-items: center;\n &-text {\n color: #fff;\n margin-bottom: 25px;\n }\n &-cancel-option {\n margin-right: 15px;\n }\n }\n"]))),pa=i(21);function ha(e){var t=e.text,i=e.confirmText,n=e.cancelText,r=e.onConfirm,o=e.onCancel;return l.a.createElement(ua,null,l.a.createElement("div",{className:"hv-cancel-record-modal"},l.a.createElement("div",{className:"hv-cancel-record-modal-text"},t),l.a.createElement("div",{className:"hv-cancel-record-modal-options-wrapper"},l.a.createElement(pa.f,{className:"hv-cancel-record-modal-cancel-option",text:n,onClickHandler:o}),l.a.createElement(pa.f,{className:"hv-cancel-record-modal-confirm-option",textColor:pa.d.BLACK,fillColor:pa.c.LIGHT_GRAY,text:i,onClickHandler:r}))))}function fa(e){var t=e.recorder,i=e.recorderAPIUtils,n=e.onFinishRecording,o=e.onRecordingCancel,c=(e.onCloseRecorder,e.extensionAvailable),d=e.handlePopupClose,u=e.action,p=t.getRecordingConfiguration(),h=Object(s.useContext)(B.a).recorderInitOptions,f=h.record_config,m=h.inline,g=f.show_selectable_options,v=f.teleprompter,y=f.screen,b=f.webcam,w=f.mic,S=!1!==y,C=!1!==b,k=!1!==w,x=0!=g,_=Object(s.useState)(S),E=_[0],T=_[1],P=Object(s.useState)(C),I=P[0],A=P[1],R=Object(s.useState)(k),O=R[0],N=R[1],D=Object(s.useState)({}),L=D[0],V=D[1],U=Object(s.useState)(!1),z=U[0],H=U[1],j=Object(s.useState)(!1),q=j[0],$=j[1],W=Object(s.useState)(!1),G=W[0],K=W[1],Y=Object(s.useState)(!1),J=Y[0],X=Y[1],Q=Object(s.useState)(!1),Z=Q[0],te=Q[1],ie=Object(s.useState)({}),ne=ie[0],re=ie[1],oe=Object(s.useState)(!1),ae=oe[0],se=oe[1],le=Object(s.useState)(!1),ce=le[0],de=le[1],ue=Object(s.useState)(!1),pe=ue[0],he=ue[1],fe=Object(s.useRef)({}),me=Object(s.useRef)(),ge=Object(s.useRef)(),ve=Object(s.useRef)(),ye=Object(s.useRef)(!1),be=Object(s.useRef)();Object(s.useEffect)((function(){if(be.current=!0,!c)return u===F.a.PRE_RECORD?Se({preview:!0}):Ce(),function(){return be.current=!1}}),[u]),Object(s.useEffect)((function(){if(L.webcamStream){var e=(e=>{const t=e.getVideoTracks()[0];let i={frameRate:"N/A",resolution:"N/A",quality:"N/A"};if(t){const e=t.getSettings();if(e){const{width:t,height:n,frameRate:r}=e;r&&(i.frameRate=r.toFixed(2)),t&&(i.quality=lt(t)),t&&n&&(i.resolution=`${t} x ${n}`)}}return i})(L.webcamStream);re(e)}}),[L]),Object(s.useEffect)((function(){p.screenRecord=E,p.webCam=I,p.audio=O,t.updateConfig({recordingConfiguration:p}),Se({preview:!0})}),[E,I,O]),Object(s.useEffect)((function(){if(i&&L)return E?void(I?i.sendEvent("_show_webcam_preview",{stream:L.webcamStream}):i.sendEvent("_remove_webcam_preview")):i.sendEvent("_remove_webcam_preview")}),[E,I,L]),Object(s.useEffect)((function(){if(G)if(z)$(!1),H(!1),t.resumeRecording();else{if(!m&&p.screenRecord&&i&&i.sendEvent("hide_frame"),c)return void t.startExtensionRecording().then((function(){X(!0),$(!1)}));xe(),X(!0),$(!1)}}),[G]),Object(s.useEffect)((function(){ae&&I&&at({webcam:!0}).catch((function(){return i.sendEvent("_remove_webcam_preview")}))}),[ae]);var we=function(e){var t=e.error;be.current&&(t&&!ce&&de(!0),t||de(!1))},Se=function(e){var i=e.preview;if((!i||I||O)&&!ye.current)return new Promise((function(e,n){try{ye.current=!0,t.getStream({preview:i}).then((function(i){var n=i.webcamStream,r=i.screenStream,o=i.message,a=i._type;ye.current=!1,"no_config_change"===o&&console.log("STREAM UNCHANGED"),O&&t.checkMicVolumeStatus(we),ve.current=null;var s=a||"stream";V({type:s,webcamStream:n,screenStream:r}),e({type:s,webcamStream:n,screenStream:r})})).catch((function(e){ye.current=!1,ve.current=e,se(!0),n(e)}))}catch(e){ye.current=!1,n(e)}}))},Ce=function(){return ve.current?se(!0):c&&p.screenRecord?(setExtensionRecInitializing(!0),void xe().then((function(){setExtensionRecInitializing(!1),$(!0)}))):void Se({preview:!1}).then((function(e){if(c)return setExtensionRecInitializing(!0),void xe().then((function(){setExtensionRecInitializing(!1),$(!0)}));i.sendEvent("record_started"),i.sendEvent("_record_started",{showWebcamPreview:p.screenRecord&&p.webCam,stream:e&&e.webcamStream,showMarkupTools:p.screenRecord}),ke(),$(!0)}))},ke=function(){t.createRecording(p).then((function(e){e.status&&(p.webcam={key:e.webcamKey,bucket:e.uploadBucket},p.screen={key:e.screenKey,bucket:e.uploadBucket},t.updateConfig({recordingConfiguration:p}),fe.current=e)})).catch((function(e){console.error("CREATE RECORDING ERROR ",e)}))},xe=function(){return t.startRecording({externalStopStreamCallback:_e})},_e=function(){var e=r()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.sendEvent("record_stopped"),t.finishRecording().then((function(e){c&&n()})).catch((function(e){console.error("ASSET_ID",e)})),c){e.next=8;break}return e.t0=n,e.next=6,t.getRecordingObjectUrls();case 6:e.t1=e.sent,(0,e.t0)(e.t1);case 8:H(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ee=function(){he(!1),H(!1),t.resumeRecording()},Te=function(){var e=0;return E&&e++,I&&e++,O&&e++,e>1},Pe=function(e){var i=e.webcam,n=e.audio,r=e.aspectRatio;if(i||n||r){var o=0;i&&i!==p.webcamSourceId&&(p.webcamSourceId=i,o++),n&&n!==p.audioSourceId&&(p.audioSourceId=n,o++),r&&r!==p.aspectRatio&&(p.aspectRatio=r,o++),console.info("FETCH STREAM 3 ",o),t.updateConfig({recordingConfiguration:p}),o>0&&Se({preview:!0})}},Ie=function(e){if(x)switch(function(e){if(ve.current){var t=ee.k[ve.current.type],i="webcam";parseInt(t)-1e3>=100&&(i="screen"),"screen"===e&&"screen"===i&&E&&(ve.current=null),"webcam"!==e&&"mic"!==e||"webcam"!==i||!("webcam"===e&&I||"mic"===e&&O)||(ve.current=null)}}(e),e){case"screen":if(E&&!Te())return;T(!E);break;case"webcam":if(I&&!Te())return;A(!I);break;case"mic":if(O&&!Te())return;N(!O)}},Ae=function(){ve.current.type===ee.k.SCREEN_PERMISSION_DENIED&&(ve.current=null),se(!1)};return l.a.createElement(ra,null,!m&&!J&&l.a.createElement(da,null,l.a.createElement(ia,{withBorder:!0,onClose:d})),pe&&l.a.createElement(ha,{text:"Do you want to cancel the recording?",confirmText:"Yes",cancelText:"No",onConfirm:function(){i.sendEvent("record_cancelled"),t.cancelRecordingWithoutStream(),he(!1),X(!1),H(!1),K(!1),o()},onCancel:function(){he(!1),K(!1),$(!0)}}),!Z&&!q&&l.a.createElement(aa,{startedRecording:J},J&&z?"Recording paused":J?"Recording in progress":"Record Preview"),q&&l.a.createElement(gi,{timerCallback:function(e){i.sendEvent("countdown_timer",{time_left:e})},screen:E,onCountdownComplete:function(){i.sendEvent("countdown_complete"),K(!0)}}),O&&ce&&l.a.createElement(ca,null,l.a.createElement("div",{className:"mic-error-modal-header"},l.a.createElement("img",{src:Object(M.e)("/svg/rapi/error-circle-red.svg")}),"Microphone audio error"),l.a.createElement("div",{className:"mic-error-modal-content"},"No volume detected. Please check your microphone before continuing recording.")),Z&&!E&&l.a.createElement(hn,{countdownStarted:q,recordingStarted:J}),l.a.createElement(la,null,E&&l.a.createElement(sa,null,l.a.createElement(yi,{screenEnabled:y,webcamEnabled:b,micEnabled:w,userSelect:x,recordingStarted:J,screen:E,webcam:I,mic:O,handleOptionsSelect:Ie})),E&&!J&&l.a.createElement(l.a.Fragment,null,l.a.createElement(Fo,{webcam:I,audio:O,webcamSourceId:p.webcamSourceId,audioSourceId:p.audioSourceId,handleWebcamSourceChange:function(e){return Pe({webcam:e})},handleAudioSourceChange:function(e){return Pe({audio:e})}}))),ae&&l.a.createElement(oa,null,l.a.createElement(Wo,{permissionError:ve.current,webcam:I,mic:O,showClose:!0,onClose:Ae,onPermissionGranted:function(){ve.current=null,Ae(),Se({preview:!0})}})),!E&&l.a.createElement(Zt,{stream:L.webcamStream,streamType:L.type,webcam:I,mic:O,audioIcon:ce?Object(M.e)("/svg/rapi/mic-error-main-red.svg"):Object(M.e)("/svg/audio-on.svg"),preview:!J,lightingCanvasRef:me,videoElementRef:ge}),!E&&!J&&x&&l.a.createElement(ui,{screenEnabled:y,webcamEnabled:b,micEnabled:w,userSelect:x,screen:E,webcam:I,mic:O,handleOptionsSelect:Ie}),l.a.createElement(Eo,{recorder:t,recordingStarted:J,screen:E,webcam:I,mic:O,stream:L.webcamStream,streamType:L.type,webcamSourceId:p.webcamSourceId,audioSourceId:p.audioSourceId,aspectRatio:p.aspectRatio,onSourceSelection:Pe,showTeleprompter:Z,onTeleprompterToggle:function(){return te(!Z)},teleprompterEnabled:v,onAbortRecording:function(){t.pauseRecording(),H(!0),K(!1),he(!0)},onPauseResumeRecording:function(){z?(Ee(),i.sendEvent("record_resumed")):(i.sendEvent("record_paused"),t.pauseRecording(),H(!0))},recordingPaused:z,onStartRecording:Ce,onStopRecording:_e,lightingCanvas:me.current,videoElement:ge.current,webcamQualityInfo:ne}))}var ma,ga=i(278),va=i.n(ga),ya=L.c.div(ma||(ma=Ct()(["\n display: flex;\n justify-content: center;\n flex-flow: column;\n align-items: center;\n height: 350px;\n border: 1px solid #E5E5E5;\n border-radius: 14px;\n .close-recorder-options-warpper {\n margin-top: 20px;\n }\n"])));function ba(e){var t=e.onVideoCancelRevert,i=e.onRecorderClose;return l.a.createElement(ya,null,l.a.createElement("p",null,"Are you sure you want to cancel the recording?"),l.a.createElement("div",{className:"close-recorder-options-warpper"},l.a.createElement(pa.f,{text:"Cancel Recording",onClickHandler:function(){console.log("RECORDER CANCEL VIDEO"),i(),console.log("Cancel recording")},style:{marginRight:"10px"}}),l.a.createElement(pa.f,{text:"Go Back",onClickHandler:function(){t(),console.log("Go back")}})))}var wa,Sa=i(407),Ca=i.n(Sa),ka=L.c.div(wa||(wa=Ct()(["\n margin: 0 auto;\n"])));function xa(e){var t=e.importVideoUrl,i=e.screenUrl,n=e.webcamUrl,r=e.thumbnailUrl,o=e.isAudioOnly,a=e.recordingConfiguration,c=e.customColors,d=e.onVideoPlayerInitialize,u=Object(s.useRef)(),p=Object(s.useRef)(),h=function(){if(i)return n};return Object(s.useEffect)((function(){u.current&&(p.current=new Ca.a(function(){var e;if(a&&a.screenRecord&&a.webCam){var s={width:288,height:216};a.sourceConfig&&a.sourceConfig.webcam&&(s=a.sourceConfig.webcam),e=qi.default.fitCenterLayout(s,{width:384,height:216})}return{el:u.current,fromSDK:!0,id:"preview-video",src:t||i||n||void 0,audioSrc:h(),fullscreenControl:!1,primaryVideoLayout:e,customColors:c,isAudioOnly:o,integType:"generic_embed",thumbnail:r}}()),d(p.current),p.current.show(),setTimeout((function(){p.current.resizePlayerForWindow()}),1e3))}),[u,p,n,i]),l.a.createElement(s.Fragment,null,l.a.createElement(ka,{ref:u}))}var _a,Ea,Ta=i(412),Pa=L.c.div(_a||(_a=Ct()(["\n background: ",";\n height: 100%;\n border-radius: inherit;\n transition: width 0.2s ease-in;\n"])),(function(e){return e.primaryColor}));function Ia(e){var t=e.completedPercent,i=e.error,n=Object(s.useContext)(B.a),r=n&&n.theme&&n.theme.primaryColor;return r||(r="#FD7564"),i?l.a.createElement(Pa,{primaryColor:r,style:{width:"0%"}}):l.a.createElement(Pa,{primaryColor:r,style:{width:"".concat(t,"%")}})}var Aa,Ra,Oa,Na,Da,La=L.c.div(Ea||(Ea=Ct()(["\n position: relative;\n height: 8px;\n width: 100%;\n border-radius: 50px;\n border: none;\n background-color: #EDEDED;\n"])));function Ma(e){return l.a.createElement(La,null,l.a.createElement(Ia,e))}var Ba=L.c.div(Aa||(Aa=Ct()(["\n border: ",";\n width: 100%;\n background-color: ",";\n border-radius: 8px;\n padding: 20px 15px;\n margin-bottom: 15px;\n ","\n &.upload-progress-enter {\n max-height: 0px;\n overflow: hidden;\n }\n &.upload-progress-enter-active {\n max-height: 100px;\n overflow: auto;\n transition: max-height 500ms ease-in;\n }\n &.upload-progress-exit {\n max-height: 100px;\n border: none;\n }\n &.upload-progress-exit-active {\n max-height: 0px;\n border: none;\n overflow: hidden;\n transition: max-height 500ms ease-in;\n }\n"])),(function(e){return e.progressType===Ha.IMPORT?"none":"1px solid #E6E6E6"}),(function(e){return e.progressType===Ha.IMPORT?"transparent":"#FFFFFF"}),(function(e){return e.progressType!==Ha.IMPORT&&"box-shadow: 0px 8px 12px #0000001A;"})),Fa=L.c.div(Ra||(Ra=Ct()(["\n display: flex;\n justify-content: space-between;\n padding: 10px 0 5px 0;\n"]))),Va=L.c.div(Oa||(Oa=Ct()(["\n font-size: 13px;\n font-family: 'Open Sans';\n color: ",";\n"])),(function(e){return e.progressType===Ha.IMPORT?"#FFFFFF":"#4B4C4C"})),Ua=L.c.div(Na||(Na=Ct()(["\n font-family: 'Open Sans';\n font-size: 12px;\n color: ",";\n"])),(function(e){return e.progressType===Ha.IMPORT?"#FFFFFF":"#4B4C4C"})),za=L.c.div(Da||(Da=Ct()(["\n text-align: right;\n font-family: 'Open Sans';\n font-size: 12px;\n color: ",";\n padding: 5px 0 10px 0;\n"])),(function(e){return e.progressType===Ha.IMPORT?"#D5D5D5":"#848383"})),Ha={RECORD:1,IMPORT:2};function ja(e){var t=e.progressStatus,i=e.timeRemainingStatus,n=e.uploadProgress,r=e.type,o=n.completedPercent,a=void 0===o?0:o,c=n.type,d=Object(s.useRef)(),u=Object(s.useRef)();return Object(s.useEffect)((function(){return d.current=0,u.current=null,function(){d.current=0,u.current=null}}),[]),n.error&&(d.current=0),(n.completed||100!==n.completedPercent)&&(u.current===c&&"upload"!=n.type?d.current<a&&(d.current=a):(u.current=c,d.current=a)),l.a.createElement(Ba,{progressType:r},l.a.createElement(Fa,null,l.a.createElement(Va,{progressType:r},t),l.a.createElement(Ua,{progressType:r},"".concat(d.current,"%"))),l.a.createElement(Ma,{completedPercent:d.current,error:n.error}),l.a.createElement(za,{progressType:r},i))}var qa,$a={completedPercent:0,type:"upload"};function Wa(e){var t=e.showUploadProgress,i=e.recorder,n=e.onUploadComplete,r=e.onUploadError,o=Object(s.useState)($a),a=o[0],c=o[1],d=Object(s.useRef)(),u=Object(M.f)(a);return Object(s.useEffect)((function(){if(!d.current)return d.current=setInterval((function(){try{if(!t)return clearInterval(d.current),void(d.current=null);i.getUploadDetails().then((function(e){return e&&e.completed?(n(),clearInterval(d.current),void(d.current=null)):e&&e.error?(r(e.errorType),clearInterval(d.current),void(d.current=null)):void c(e)})).catch((function(e){console.error("UPLOAD STATUS FETCH ERROR ",e),clearInterval(d.current),d.current=null}))}catch(e){console.error("UPLOAD PROGRESS EX ",e)}}),1e3),function(){clearInterval(d.current),d.current=null}})),l.a.createElement(D,{in:t,timeout:300,unmountOnExit:!0,classNames:"upload-progress"},l.a.createElement(ja,{type:Ha.RECORD,timeRemainingStatus:u,uploadProgress:a,progressStatus:"Uploading Video"}))}var Ga,Ka=L.c.div(qa||(qa=Ct()(["\n box-shadow: 0px 8px 12px #0000001a;\n border: 1px solid #E6E6E6;\n padding: 20px 35px;\n margin: 10px 0;\n border-radius: 8px;\n .error-widget {\n &-text {\n margin-bottom: 10px;\n text-align: left;\n }\n &-cta-wrapper {\n text-align: right;\n button:last-of-type {\n margin-right: 20px;\n }\n }\n &-retry-button-wrapper {\n display: inline;\n }\n &-download-button-wrapper {\n display: inline;\n }\n }\n"])));function Ya(e){var t=e.error,i=e.onRetry,n=e.recordingSource,r="Error in create recording";"UPLOAD_ERROR"===t.type&&(r="Error while uploading video");var o="Retry";"UPLOAD_ERROR"===t.type&&(o="Retry Upload");return l.a.createElement(Ka,null,l.a.createElement("div",{className:"error-widget-text"},r),l.a.createElement("div",{className:"error-widget-cta-wrapper"},l.a.createElement("div",{className:"error-widget-download-button-wrapper"},"UPLOAD_ERROR"===t.type&&l.a.createElement(pa.f,{style:{marginRight:"20px"},icon:Object(M.e)("/svg/rapi/download-icon.svg"),text:"Download Recording",options:function(){if("UPLOAD_ERROR"===t.type){var e=[];if(n)for(var i in n){var r=n[i];e.push({link:r,linkType:"download",downloadName:"Testing the name",linkName:"Download ".concat(i," source")})}return e}}(),buttonFeature:pa.b.DROPDOWN})),l.a.createElement("div",{className:"error-widget-retry-button-wrapper"},l.a.createElement(pa.f,{text:o,onClickHandler:i}))))}var Ja=L.c.div(Ga||(Ga=Ct()(['\n margin: 15px 0;\n height: 45px;\n text-align: left;\n position: relative;\n .title-wrapper {\n display: flex;\n align-items: center;\n cursor: pointer;\n div {\n font: normal normal 600 16px/33px Open Sans;\n }\n img {\n margin-left: 10px;\n\n }\n }\n .title-input-wrapper {\n width: 350px;\n position: relative;\n display: flex;\n align-items: center;\n input {\n border: 1px solid #cccccc;\n box-shadow: 0px 3px 6px #00000012;\n border-radius: 4px;\n width: 100%;\n padding: 5px 60px 5px 10px;\n font: normal normal normal 16px/33px Open Sans;\n }\n .title-close {\n position: absolute;\n width: 20px;\n height: 20px;\n opacity: 0.3;\n right: 0px;\n cursor: pointer;\n &:hover {\n opacity: 1;\n }\n &::before,\n &::after {\n position: absolute;\n content: " ";\n height: 18px;\n width: 2px;\n background-color: #333;\n }\n &::before {\n transform: rotate(45deg);\n }\n &::after {\n transform: rotate(-45deg);\n }\n }\n\n .title-save {\n right: 45px;\n bottom: 15px;\n opacity: 0.8;\n position: absolute;\n display: inline-block;\n transform: rotate(45deg);\n height: 20px;\n width: 10px;\n border-bottom: 2px solid #37c689;\n border-right: 2px solid #37c689;\n cursor: pointer;\n &:hover {\n opacity: 1;\n }\n }\n }\n'])));function Xa(e){var t=e.onTitleSave,i=e.videoTitle||"New Recording",n=Object(s.useState)(i),r=n[0],o=n[1],a=Object(s.useState)(!1),c=a[0],d=a[1],u=function(){r.length>0?t(r):t("New Recording"),d(!1)};return l.a.createElement(Ja,null,c?l.a.createElement("div",{className:"title-input-wrapper"},l.a.createElement("input",{type:"text",onChange:function(e){return o(e.target.value)},onBlur:u,onKeyDown:function(e){"Enter"===e.key&&u()},value:r}),l.a.createElement("div",{className:"title-save",onClick:u}),l.a.createElement("div",{className:"title-close",onClick:function(){return d(!1)}})):l.a.createElement("div",{className:"title-wrapper",onClick:function(){return d(!0)}},l.a.createElement("div",null,r),l.a.createElement("img",{src:Object(M.e)("/svg/rapi/pen.svg")})))}function Qa(e){var t=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(e){return!1}}();return function(){var i,n=Ai()(e);if(t){var r=Ai()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return Pi()(this,i)}}var Za,es,ts,is,ns=function(e){Ei()(i,e);var t=Qa(i);function i(e){var n;Ci()(this,i),n=t.call(this,e);var r=e.onRetry;return n.state={hasError:!1},n.onRetry=r,n}return xi()(i,[{key:"componentDidCatch",value:function(e,t){console.log("ERROR in catch >>>> ",e,t)}},{key:"render",value:function(){return this.state.hasError?l.a.createElement("div",null,l.a.createElement("span",null,"Could not load the resource due to network failure.")):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return console.log("ERROR >>>> ",e),{hasError:!0}}}]),i}(s.Component),rs=L.c.div(Za||(Za=Ct()(["\n display: flex;\n width: 100%;\n position: relative;\n justify-content: space-between;\n flex-direction: row;\n align-items: center;\n margin: 0 auto;\n"]))),os=L.c.div(es||(es=Ct()(["\n margin-top: 10px;\n"]))),as=L.c.div(ts||(ts=Ct()(["\n margin-top: 10px;\n display: block;\n right: 0;\n"])));function ss(e){var t=e.urls,i=e.token,n=e.tokenType,r=e.recorder,o=e.integrationType,a=e.importCompleteResponse,c=e.recordingConfiguration,d=e.onRecorderClose,u=e.onVideoCancel,p=e.extensionAvailable,h=(e.handleShowUploadProgress,e.recorderAPIModel),f=e.onEditClick,m=e.recorderAPIUtils,g=Object(s.useContext)(B.a),v=g.theme,y=g.recorderInitOptions,b=y.show_video_title,w=y.edit,S=y.record_config,C=(void 0===S?{}:S).show_cancel_submit,k=void 0===C||C,x=t&&t.webcam,_=t&&t.screen,E=a&&a.signed_url,T=a&&0==a.contains_video&&1==a.contains_audio||c&&!c.webCam&&!c.screenRecord&&c.audio,P="lessonly"==qi.default.getQueryParams().type||"lessonly"==qi.default.getQueryParams().integration_type,I=Object(s.useState)(!1),A=I[0],R=I[1],O=Object(s.useState)(),N=O[0],D=O[1],L=Object(s.useState)(),F=L[0],V=L[1],U=Object(s.useState)("Edit Video"),z=U[0],H=U[1],j=Object(s.useState)(),q=j[0],$=j[1],W=r&&r.isUploadComplete(),G=Object(s.useState)(W),K=G[0],Y=G[1],J=Object(s.useState)(!1),X=J[0],Q=J[1],Z=Object(s.useState)(!1),ee=(Z[0],Z[1]),te=r.createRecordingError,ie=r.uploadInitError,ne=Object(s.useRef)();Object(s.useEffect)((function(){K&&!p&&m.sendEvent("source_uploaded")}),[K]),Object(s.useEffect)((function(){H(A?"Preview Video":"Edit Video")}),[A]),Object(s.useEffect)((function(){f&&f(A)}),[A,f]),Object(s.useEffect)((function(){if(a&&a.projectjson)$(a.projectjson);else if(!te)return r.isPreprocessComplete().then((function(e){$(e)})).catch((function(){console.error("ERROR IN PREPROCESS STEP")})),function(){r.removePreprocessCompleteCheck()}}),[]);var re=function(){return!0},oe=function(e){V(e)},ae=function(e){D(e)},se=function(){var e={};return P&&(e.primaryColor="#4A90E2",e.secondaryColor="#69a8e3",e.bgColor="#ebeaea"),e},le=function(){r.sendCreateRecordingRequest().then((function(){ee(!1),de()})).catch((function(){ee(!1)})),ee(!0)},ce=function(){r.retryUpload().then((function(){ee(!1),de()})).catch((function(){ee(!1)})),Q(!1),ee(!0)},de=function(){r.removePreprocessCompleteCheck(),r.isPreprocessComplete().then((function(e){$(e)})).catch((function(){console.error("ERROR IN PREPROCESS STEP")}))},ue=void 0!==q,pe=!(K||te||ie||X||a);return l.a.createElement(l.a.Fragment,null,!a&&l.a.createElement(Wa,{showUploadProgress:pe,recorder:r,onUploadComplete:function(){Y(!0)},onUploadError:function(){Q(!0)}}),b&&l.a.createElement(Xa,{videoTitle:ne.current,onTitleSave:function(e){ne.current=e,h.saveVideoTitle({title:e,assetId:r.recordDetails&&r.recordDetails.asset_id})}}),(te||ie||X)&&l.a.createElement(Ya,{error:{type:te?"RECORDING_ERROR":"UPLOAD_ERROR"},onRetry:te?le:ce,recordingSource:t}),l.a.createElement(ns,null,l.a.createElement(s.Suspense,{fallback:l.a.createElement("div",null,"Loading ...")},l.a.createElement(xa,{importVideoUrl:E,screenUrl:_,webcamUrl:x,isAudioOnly:T,thumbnailUrl:null,recordingConfiguration:c,onVideoPlayerInitialize:oe,customColors:se()}))),w&&l.a.createElement(ns,null,l.a.createElement(s.Suspense,{fallback:l.a.createElement(l.a.Fragment,null)},l.a.createElement(Ta.a,{showSimpleEditor:A,videoPlayerView:F,recorder:r,recorderApiModel:h,token:i,tokenType:n,integrationType:o,isPersonalisationEnabled:re(),customColors:se(),footageUrls:{},projectJson:q,onSimpleEditorInitialize:ae}))),l.a.createElement(rs,null,l.a.createElement(os,null,!A&&w&&l.a.createElement(pa.f,{icon:Object(M.e)("/svg/rapi/pen.svg"),text:z,borderColor:pa.a.TRANSPARENT,fillColor:pa.c.TRANSPARENT,textColor:pa.d.BLUE,loading:!ue,onClickHandler:function(){return R(!A)},enabled:ue})),l.a.createElement(as,null,!A&&k&&l.a.createElement(pa.f,{text:"Close",textCapitalize:!0,borderColor:pa.a.TRANSPARENT,fillColor:pa.c.TRANSPARENT,textColor:pa.d.BLUE,onClickHandler:function(){u()},style:{marginRight:"10px"}}),!A&&l.a.createElement(pa.f,{text:"Submit",textCapitalize:!0,onClickHandler:function(){!function(){var e=r.recordDetails&&r.recordDetails.asset_id;if(e?h.submitVideo({assetId:e}):console.error("asset id not available in recorder"),e){var t={asset_id:r.recordDetails.asset_id,token:r.recordDetails.delivery_token,embed_url:r.recordDetails.embedLink,embed_preview_url:r.recordDetails.embeddedPreviewLink,play_url:r.recordDetails.recordedUrl,thumbnail_url:r.recordDetails.publicThumbnail,thumbnail_play_url:r.recordDetails.publicPlayThumbnail};m.sendEvent("video_submitted",t)}r.isUploadComplete()||m.sendEvent("_show_upload_progress",{recorder:r,theme:v}),d()}()},enabled:!te}),A&&l.a.createElement(pa.f,{text:"Cancel Edit",textCapitalize:!0,borderColor:pa.a.TRANSPARENT,fillColor:pa.c.TRANSPARENT,textColor:pa.d.BLUE,onClickHandler:function(){N&&(N.cancel(),R(!A))},style:{marginRight:"10px"}}),A&&l.a.createElement(pa.f,{text:"Save Edit",textCapitalize:!0,onClickHandler:function(){N&&(N.save(),R(!A))}}))))}var ls,cs=L.c.div(is||(is=Ct()([""])));function ds(e){return l.a.createElement(cs,null,l.a.createElement(Wa,e))}var us=L.c.div(ls||(ls=Ct()(["\n padding: 20px;\n"])));function ps(e){var t=Object(s.useState)(!1),i=t[0],n=t[1],r=Object(s.useState)(!1),o=r[0],a=r[1];return l.a.createElement(us,null,o&&l.a.createElement(ds,e),!o&&i&&l.a.createElement(ba,va()({},e,{onVideoCancelRevert:function(){n(!1)}})),!o&&!i&&l.a.createElement(ss,va()({},e,{onVideoCancel:function(){n(!0)},handleShowUploadProgress:function(){a(!0)}})))}i(109);var hs,fs,ms,gs,vs=L.c.div(hs||(hs=Ct()(["\n width: 75%;\n height: 80%;\n padding: 20px;\n border: 2px dashed #ACB7C4;\n border-radius: 5px;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n cursor: pointer;\n"])));function ys(e){var t=e.onFileUpload,i=e.isMobile,n=Object(s.useRef)(),r=Object(s.useRef)(),o=Object(s.useRef)(),a=Object(s.useState)(!1),c=a[0],d=a[1],u=function(e){return e.type&&["video","audio"].includes(e.type.split("/")[0])},p=function(e){console.log("IMPORT FILE CHANGED !!!!");var i=e.target.files[0];t(i)};return l.a.createElement(l.a.Fragment,null,l.a.createElement(vs,{ref:n,onClick:function(){console.log("IMPORT CLICK"),i?o.current.click():r.current.click()},onDrop:function(e){e.preventDefault(),console.log("DROPPED ",e);var i=null;try{if(e.dataTransfer.items){for(var n=0;n<e.dataTransfer.items.length;n++)if("file"===e.dataTransfer.items[n].kind&&u(e.dataTransfer.items[n].getAsFile())){i=e.dataTransfer.items[n].getAsFile();break}}else for(var r=0;r<e.dataTransfer.files.length;r++)if(u(e.dataTransfer.files[r])){i=e.dataTransfer.files[r];break}}catch(e){console.log("EXCEPTION ",e)}i?(i.size>ee.n?console.log("FILE SIZE GREATER THAN 5GB!!!!"):t(i),console.log("NAME : ",i.name," SIZE : ",i.size)):console.log("FILE NOT SUPPORTED !!!")},onDragOver:function(e){e.preventDefault(),!c&&d(!0)},onDragLeave:function(e){e.preventDefault(),c&&d(!1)},style:function(){if(c)return{borderColor:"#FFFFFF"}}()},l.a.createElement("img",{src:"/svg/upload.svg",alt:"upload",style:{width:"55px"}}),l.a.createElement("div",{style:{margin:"12px 0 0",fontSize:"13px",fontWeight:"400",color:"#E3E3E3"}},"Drag and drop"),l.a.createElement("div",{style:{margin:"0",fontSize:"14px",fontWeight:"400",color:"#8C8C8C"}},"your file here, or"," ",l.a.createElement("span",{style:{color:"#4FA3CB",textDecoration:"underline",cursor:"pointer"}},"browse"))),l.a.createElement("input",{type:"file",ref:r,onChange:p,style:{display:"none"},accept:"video/*,audio/*,video/mp4,video/x-m4v,video/*;capture=camcorder,microphone"}),l.a.createElement("input",{type:"file",ref:o,onChange:p,style:{display:"none"},accept:"video/*,audio/*,video/mp4,video/x-m4v,video/*;capture=camcorder,microphone",capture:!0}))}function bs(e){var t=e.progress,i=e.uploadStatus,n=e.onCancelImport,r=null,o=Object(M.f)(t);return i===Es.INPROGRESS?(console.log("PROGRESS ",t),t&&"upload"===t.type&&(r="Uploading Video"),t&&"processing"===t.type&&(r="Processing video")):i===Es.INITIALIZED&&(r="Initializing Upload"),l.a.createElement("div",{style:{width:"90%"}},l.a.createElement(ja,{progressStatus:r,uploadProgress:t,timeRemainingStatus:o,type:Ha.IMPORT}),l.a.createElement(pa.f,{borderColor:pa.a.DARK_GRAY,fillColor:pa.c.TRANSPARENT,text:"Cancel",onClickHandler:n}))}var ws,Ss,Cs,ks=L.c.div(fs||(fs=Ct()(["\n width: 100%;\n height: 147px;\n min-height: 360px;\n max-height: 500px;\n background-color: #212126;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 5px;\n"]))),xs=L.c.div(ms||(ms=Ct()(["\n width: 90%;\n margin: 0 auto;\n position: relative;\n"]))),_s=L.c.div(gs||(gs=Ct()(["\n position: absolute;\n right: -35px;\n top: 0px;\n"]))),Es={INACTIVE:0,INITIALIZED:1,INPROGRESS:2},Ts={completedPercent:0,type:"upload"};function Ps(e){var t=e.file,i=e.isMobile,n=e.digest,r=e.recorder,o=e.recorderClose,a=(e.directImport,e.importCompletedCallback),c=e.handlePopupClose,d=Object(s.useState)(Es.INACTIVE),u=d[0],p=d[1],h=Object(s.useState)(Ts),f=h[0],m=h[1],g=Object(s.useContext)(B.a).recorderInitOptions.inline;Object(s.useEffect)((function(){t&&v(t)}),[t]);var v=function(e){if(e){var t={fileName:e.name,size:e.size/1024,fromAdvancedEdit:!1,token:n,isMobile:i};r.createVideoImport({params:t,uploadStartedCallback:y,updateProgress:b,file:e}).then((function(e){console.log("PREVIEW RESPONSE ",e),a(e)})).catch((function(e){console.log("ERROR >> ",e)})),p(Es.INITIALIZED)}},y=function(){p(Es.INPROGRESS)},b=function(e){m(e)};return console.log("UPLOAD STATUS ",u,t,f),l.a.createElement(xs,null,l.a.createElement(ks,null,!g&&u===Es.INACTIVE&&l.a.createElement(_s,null,l.a.createElement(ia,{withBorder:!0,onClose:c})),!t&&u===Es.INACTIVE&&l.a.createElement(ys,{isMobile:i,onFileUpload:v}),u!==Es.INACTIVE&&l.a.createElement(bs,{progress:f,uploadStatus:u,onCancelImport:function(){if(r.cancelVideoImport(),t)return o&&o();p(Es.INACTIVE),m(Ts)}})))}var Is=L.c.div(ws||(ws=Ct()([""]))),As=L.c.div(Ss||(Ss=Ct()([""]))),Rs=L.c.div(Cs||(Cs=Ct()([""])));function Os(e){var t=e.type,i=e.recorder,n=e.uploadCompleted,o=e.onRecorderClose,c=Object(s.useState)(!1),d=c[0],u=c[1],p=Object(s.useState)(),h=(p[0],p[1],function(){try{i.retryUpload().catch((function(e){u(!1)}))}catch(e){console.log("CATCH EX ",e)}u(!0)}),f=function(){var e=r()(a.a.mark((function e(){var t,n,r,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.getRecordingObjectUrls();case 2:if(t=e.sent,!(Object.keys(t).length>0)){e.next=9;break}for(r in n=[],t)t.hasOwnProperty(r)&&(o=t[r],n.push(l.a.createElement("a",{key:r,href:"".concat(o),download:!0},"Download ".concat(r," recording"))));return e.abrupt("return",l.a.createElement("div",null,n,l.a.createElement("div",null,l.a.createElement(pa.f,{text:"Retry upload",onClickHandler:h}))));case 9:pa.f;case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(s.useEffect)((function(){}),[d]),l.a.createElement(Is,null,d&&l.a.createElement(ja,{recorder:i,onUploadComplete:function(){n?n():o&&o()},onUploadError:function(){u(!1)}}),!d&&l.a.createElement(l.a.Fragment,null,l.a.createElement(As,null,function(){if(t===F.b.UPLOAD)return"Error when uploading video"}()),l.a.createElement(Rs,null,f())))}var Ns,Ds,Ls,Ms=i(133),Bs=i.n(Ms),Fs=L.c.div(Ns||(Ns=Ct()(["\n &.screen-enter {\n opacity: 0;\n transform: translateX(100%);\n }\n\n &.screen-enter-active {\n opacity: 1;\n transform: translateX(0);\n }\n\n &.screen-enter-active {\n transition: opacity 300ms, transform 300ms;\n transition-delay: 50ms;\n }\n"]))),Vs=["active","children"];function Us(e){var t=e.active,i=e.children,n=Bs()(e,Vs);return l.a.createElement(D,{in:t,classNames:"screen",timeout:400,unmountOnExit:!0},l.a.createElement(Fs,n,t&&i))}var zs=L.c.div(Ds||(Ds=Ct()(["\n overflow-x: hidden;\n overflow-y: scroll;\n width: 720px;\n position: relative;\n background-color: ",';\n margin: 0 auto;\n text-align: center;\n transition: height 500ms ease-in;\n font-family: "proxima-nova", "Open Sans", "Helvetica Neue", sans-serif !important;\n'])),(function(e){switch(e.action){case F.a.POST_RECORD:return"#FFFFFF";default:return"transparent"}})),Hs=(L.c.div(Ls||(Ls=Ct()(["\n height: 45px;\n display: flex;\n align-items: center;\n font: normal normal 600 16px/16px Open Sans;\n color: #C3C3C3;\n border-bottom: 1px solid #34343C;\n justify-content: space-between;\n padding: 0 25px;\n"]))),["start_recording","import_video","hv_stop_recording","source_uploaded","record_stopped","preprocess_complete","source_video","record_initiated","record_details","open_widget"]),js={RECORDER:1,IMPORTER:2};function qs(e){var t=e.type,i=e.settings,n=e.token,o=e.tokenType,c=void 0===o?ee.e.RECORDER_SDK_TOKEN:o,d=e.initiator,u=void 0===d?F.c.RECORDER_SDK:d,p=e.integrationType,h=void 0===p?ee.q.GENERIC_RECORDER:p,f=e.extensionId,m=e.email,g=e.userId,v=e.eventListenerClass,y=e.recorderClassName,b=e.eventCallback,w={fromPopup:!0,separateLayer:!1,systemAudio:!0,aspectRatio:ee.b.SIXTEEN_NINE,initiator:u,highlights:!0,resolution:720},S=Object(s.useState)(!1),C=S[0],k=S[1],x=Object(s.useState)(),_=x[0],E=x[1],T=function(){var e=Object(s.useState)(0),t=(e[0],e[1]);return function(){return t((function(e){return e+1}))}}(),P=n||Object(M.d)(),I=Object(s.useRef)(w),A=Object(s.useRef)({}),R=Object(s.useRef)(new M.b({eventCallback:b})),O=Object(s.useRef)(),N=Object(s.useRef)(),D=Object(s.useRef)(),V=Object(s.useRef)(),z=Object(s.useRef)(),H=Object(s.useRef)(),j=Object(s.useRef)({}),q=Object(s.useRef)(!1),$=Object(s.useRef)(U({tokenType:c,userId:g,integrationType:h})),W=Object(s.useRef)(),G=Object(s.useRef)(),K=function(){$.current=U({tokenType:c,userId:g,integrationType:h}),Q(i);var e=new ct({recordingConfiguration:I.current,tokenType:c,token:P,email:m,extensionId:f,recorderId:y,recorderEvtClass:v,logID:$.current,recorderAPIUtils:R.current,integrationType:h,initiator:u,extensionAvailable:G.current});E(e)},Y=Object(s.useState)(null),J=Y[0],X=Y[1];Object(s.useEffect)((function(){O.current||(O.current=new dt.a({token:P,email:m,tokenType:c})),K(),i.inline&&!1!==i.inline.open&&(!C&&k(!0),t==js.IMPORTER?(q.current=!1,X(F.a.IMPORT_VIDEO)):X(F.a.PRE_RECORD))}),[]);var Q=function(e){null!=e&&e.record_config&&(I.current.screenRecord=!1,I.current.webCam=!1,I.current.audio=!1,0!=e.record_config.screen&&(I.current.screenRecord=!0),0!=e.record_config.webcam&&(I.current.webCam=!0),0!=e.record_config.mic&&(I.current.audio=!0),_&&_.updateConfig({recordingConfiguration:I.current}))};Object(s.useEffect)((function(){_&&i&&Q(i)}),[_]),Object(s.useEffect)((function(){i&&function(e){var t={};for(var i in B.b.recorderInitOptions)e&&e.hasOwnProperty(i)?t[i]=e[i]:t[i]=B.b.recorderInitOptions[i];j.current={theme:B.b.theme,recorderInitOptions:t,authentication:{token:n,tokenType:c,email:m}}}(i)}),[]);var Z=function(e){var t;if(e.detail&&e.detail.extension){var i=e.detail;delete i.extension,R.current.sendEvent(e.type,i)}"record_details"===e.type&&e.detail&&(_.setExtensionRecording(!0),_.setRecordDetails(e.detail)),"open_widget"===e.type&&(C||J||(K(),k(!0),X(F.a.PRE_RECORD),T())),"start_recording"===e.type&&(void 0!==e.detail.extension_available&&(G.current=e.detail.extension_available),K(),ie(e.detail.recording_configuration),!C&&k(!0),X(F.a.RECORD),T()),"hv_stop_recording"===e.type&&ne(),"preprocess_complete"===e.type&&_.setProjectJson(e.detail.project_json),"source_video"===e.type&&(D.current={},"webcam"===e.detail.type&&(D.current.webcam=e.detail.url),"screen"===e.detail.type&&(D.current.screen=e.detail.url),!C&&k(!0),X(F.a.POST_RECORD)),"import_video"===e.type&&(R.current.sendEvent("show_frame"),N.current=e.detail.file,K(),!C&&k(!0),q.current=!0,X(F.a.IMPORT_VIDEO));try{t="hippovideo"==e.data.initiator?e.data:JSON.parse(e.data)}catch(e){return}if("hippovideo"==t.initiator){if("record_initiated"===t.type&&t.detail&&t.detail.recording_with_extension&&(_.setExtensionRecording(t.detail.recording_with_extension),_.setRecordDetails(t.detail.record_details),_.stopStreams(),X(null)),"hv_initialize_recorder"===t.type){var n={};for(var r in B.b.recorderInitOptions)t.detail&&t.detail.settings&&t.detail.settings.hasOwnProperty(r)?n[r]=t.detail.settings[r]:n[r]=B.b.recorderInitOptions[r];n.theme=B.b.theme,j.current=n}"hv_source_video"===t.type&&(D.current={},"webcam"===t.detail.type&&(D.current.webcam=t.detail.url),"screen"===t.detail.type&&(D.current.screen=t.detail.url),R.current.sendEvent("show_frame"),!C&&k(!0),X(F.a.POST_RECORD)),"hv_start_recording"==t.type&&(ie(t.detail),!C&&k(!0),X(F.a.RECORD)),"hv_stop_recording"===t.type&&ne(),"hv_import_video"===t.type&&(R.current.sendEvent("show_frame"),importTypeRef.current=t.detail.type,K(),!C&&k(!0),X(F.a.IMPORT_VIDEO)),t.type,"hv_preprocess_complete"===t.type&&_.setProjectJson(t.detail.project_json)}},te=Object(s.useCallback)((function(){var e;i.inline&&i.inline.open?(delete(e=I.current).screenRecord,delete e.webCam,delete e.audio,I.current=e,_.updateConfig({recordingConfiguration:I.current}),_.isUploadComplete()&&K(),!C&&k(!0),t===js.IMPORTER?X(F.a.IMPORT_VIDEO):X(F.a.PRE_RECORD)):(k(!1),X(null),_.stopStreams(),R.current.sendEvent("_close_popup"))}),[i,_]),ie=function(e){if(e){R.current.sendEvent("show_frame");var t=Object.assign({},I.current);null!=e.resolution&&(t.resolution=e.resolution),null!=e.initiator&&(t.initiator=e.initiator),null!=e.screenRecord&&(t.screenRecord=e.screenRecord),null!=e.webCam&&(t.webCam=e.webCam),null!=e.audio&&(t.audio=e.audio),null!=e.uniqueId&&(t.uniqueId=e.uniqueId),null!=e.webcamBitRate&&(t.webcamBitRate=e.webcamBitRate),null!=e.aspectRatio&&(t.aspectRatio=e.aspectRatio),null!=e.teleprompter&&(A.current.showTeleprompter=e.teleprompter),null!=e.timer&&(t.timer=e.timer),null!=e.recordingWithExtension&&(t.recordingWithExtension=e.recordingWithExtension),null!=e.show_preview&&(A.current.showRecordPreview=e.show_preview),null!=e.showFaceCue&&(A.current.showFaceCue=e.showFaceCue),null!=e.showLightingFeedback&&(A.current.showLightingFeedback=e.showLightingFeedback),null!=e.fromProductReview&&(t.fromProductReview=e.fromProductReview),null!=e.fromChristmasTemplate&&(t.my_video=!0);var i=parseInt(e.timer);null!=i&&!isNaN(i)&&Math.round(i)>0&&(A.current.recordingLimit=1e3*Math.round(i)),I.current=t,_.updateConfig({recordingConfiguration:I.current})}};Object(s.useEffect)((function(){return window.addEventListener("message",Z),Hs.forEach((function(e){W.current.addEventListener(e,Z)})),function(){window.removeEventListener("message",Z),Hs.forEach((function(e){W.current.removeEventListener(e,Z)}))}}));var ne=function(){var e=r()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _.finishRecording(),i.inline||!C&&k(!0),e.t0=re,e.next=5,_.getRecordingObjectUrls();case 5:e.t1=e.sent,(0,e.t0)(e.t1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),re=function(e){D.current=e,R.current.sendEvent("record_stopped",{removeWebcamPreview:!0,removeMarkupTools:!0}),_.getUploadDetails().then((function(e){e.error?(H.current=F.b.UPLOAD,X(F.a.ERROR)):h!==ee.q.PRODUCT||u!==F.c.EXTENSION?X(F.a.POST_RECORD):e.completed?(k(!1),X(null)):X(F.a.UPLOAD_STATUS)})).catch((function(){H.current=F.b.UPLOAD,X(F.a.ERROR)}))},oe=function(e){V.current=e,X(F.a.POST_RECORD)},ae=function(e){e===F.a.ERROR?X(F.a.POST_RECORD):(R.current.sendEvent("source_uploaded"),te())},se=function(){i.inline&&i.inline.open&&(K(),X(F.a.PRE_RECORD))},le=function(){return J?l.a.createElement(B.a.Provider,{value:j.current},[F.a.PRE_RECORD,F.a.RECORD].includes(J)&&l.a.createElement(fa,{recorder:_,action:J,handlePopupClose:de,onFinishRecording:re,onRecordingCancel:se,recorderAPIUtils:R.current,extensionAvailable:G.current}),l.a.createElement(Us,{active:J===F.a.POST_RECORD},l.a.createElement(ps,{urls:D.current,token:P,tokenType:c,onEditClick:ce,recorderAPIModel:O.current,integrationType:h,recorder:_,recorderAPIUtils:R.current,extensionAvailable:G.current,recordingConfiguration:I.current,onRecorderClose:te,importCompleteResponse:V.current})),l.a.createElement(Us,{active:J===F.a.IMPORT_VIDEO},l.a.createElement(Ps,{file:N.current,recorder:_,recorderAPIModel:O.current,isMobile:!1,digest:P,recorderClose:te,handlePopupClose:de,directImport:q.current,importCompletedCallback:oe})),l.a.createElement(Us,{active:J===F.a.ERROR},l.a.createElement(Os,{recorder:_,type:H.current,onRecorderClose:te,uploadCompleted:function(){return ae(F.a.ERROR)}})),l.a.createElement(Us,{active:J===F.a.UPLOAD_STATUS},l.a.createElement(ds,{showUploadProgress:!0,recorder:_,onUploadComplete:ae,onUploadError:function(){return X(F.a.ERROR)}}))):null},ce=function(e){e&&R.current.sendEvent("edit_enabled"),z.current.style.maxHeight=e?"700px":""};Object(s.useLayoutEffect)((function(){setTimeout((function(){R.current.sendEvent("sdk_loaded");try{var e=performance.getEntriesByType("navigation")[0].duration,t=new he({integrationType:h,module:"RECORDER_API",logUID:$.current,tokenType:c,token:P});t&&t.info("RECORDER_API_PAGE_LOAD_TIME",{loadTime:e})}catch(e){}}),500)}),[]);var de=function(){te()};return l.a.createElement(l.a.Fragment,null,C&&l.a.createElement(L.a,{theme:j.current.theme},l.a.createElement(zs,{action:J,ref:z,className:"".concat(y)},le())),l.a.createElement("input",{type:"hidden",ref:W,className:"".concat(v)}))}},function(e,t,i){var n=i(31),r=i(38),o=i(134),a=i(120),s=i(431),l=i(28),c=TypeError,d=l("toPrimitive");e.exports=function(e,t){if(!r(e)||o(e))return e;var i,l=a(e,d);if(l){if(void 0===t&&(t="default"),i=n(l,e,t),!r(i)||o(i))return i;throw c("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},function(e,t,i){var n=i(19),r=i(232),o=n["__core-js_shared__"]||r("__core-js_shared__",{});e.exports=o},function(e,t,i){var n=i(19),r=Object.defineProperty;e.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch(i){n[e]=t}return t}},function(e,t,i){var n=i(12),r=i(32),o=i(231),a=n(Function.toString);r(o.inspectSource)||(o.inspectSource=function(e){return a(e)}),e.exports=o.inspectSource},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,i){var n=i(187),r=i(121),o=TypeError;e.exports=function(e){if(n(e))return e;throw o(r(e)+" is not a constructor")}},function(e,t,i){var n={};n[i(28)("toStringTag")]="z",e.exports="[object z]"===String(n)},function(e,t,i){"use strict";var n=i(71),r=i(48),o=i(28),a=i(37),s=o("species");e.exports=function(e){var t=n(e),i=r.f;a&&t&&!t[s]&&i(t,s,{configurable:!0,get:function(){return this}})}},function(e,t){var i=TypeError;e.exports=function(e,t){if(e<t)throw i("Not enough arguments");return e}},function(e,t){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},function(e,t,i){var n=i(28),r=i(162),o=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||a[o]===e)}},function(e,t,i){var n=i(12),r=i(77),o=i(42),a=i(70),s=n("".charAt),l=n("".charCodeAt),c=n("".slice),d=function(e){return function(t,i){var n,d,u=o(a(t)),p=r(i),h=u.length;return p<0||p>=h?e?"":void 0:(n=l(u,p))<55296||n>56319||p+1===h||(d=l(u,p+1))<56320||d>57343?e?s(u,p):n:e?c(u,p,p+2):d-56320+(n-55296<<10)+65536}};e.exports={codeAt:d(!1),charAt:d(!0)}},function(e,t,i){var n=i(13),r=i(19).RegExp,o=n((function(){var e=r("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),a=o||n((function(){return!r("a","y").sticky})),s=o||n((function(){var e=r("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:o}},function(e,t,i){"use strict";var n=i(241).charAt;e.exports=function(e,t,i){return t+(i?n(e,t).length:1)}},function(e,t,i){var n=i(15),r=i(309);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==r},{assign:r})},function(e,t,i){var n=i(457);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},function(e,t,i){"use strict";(function(t){var n=i(68),r=i(463),o=i(314),a={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var l,c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(l=i(315)),l),transformRequest:[function(e,t){return r(t,"Accept"),r(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)||t&&"application/json"===t["Content-Type"]?(s(t,"application/json"),function(e,t,i){if(n.isString(e))try{return(t||JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(i||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,i=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,a=!i&&"json"===this.responseType;if(a||r&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw o(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(a)})),e.exports=c}).call(this,i(72))},function(e,t,i){var n=i(38),r=i(100),o=i(28)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==r(e))}},function(e,t){},function(e,t,i){var n=i(45),r=i(250),o=i(251),a=i(252).populateHostPrefix;e.exports={buildRequest:function(e){var t=e.httpRequest,i=e.service.api,n=i.targetPrefix+"."+i.operations[e.operation].name,o=i.jsonVersion||"1.0",s=i.operations[e.operation].input,l=new r;1===o&&(o="1.0"),t.body=l.build(e.params||{},s),t.headers["Content-Type"]="application/x-amz-json-"+o,t.headers["X-Amz-Target"]=n,a(e)},extractError:function(e){var t={},i=e.httpResponse;if(t.code=i.headers["x-amzn-errortype"]||"UnknownError","string"==typeof t.code&&(t.code=t.code.split(":")[0]),i.body.length>0)try{var r=JSON.parse(i.body.toString()),o=r.__type||r.code||r.Code;o&&(t.code=o.split("#").pop()),"RequestEntityTooLarge"===t.code?t.message="Request body must be less than 1 MB":t.message=r.message||r.Message||null}catch(r){t.statusCode=i.statusCode,t.message=i.statusMessage}else t.statusCode=i.statusCode,t.message=i.statusCode.toString();e.error=n.error(new Error,t)},extractData:function(e){var t=e.httpResponse.body.toString()||"{}";if(!1===e.request.service.config.convertResponseTypes)e.data=JSON.parse(t);else{var i=e.request.service.api.operations[e.request.operation].output||{},n=new o;e.data=n.parse(t,i)}}}},function(e,t,i){var n=i(45);function r(){}function o(e,t){if(t&&null!=e)switch(t.type){case"structure":return function(e,t){if(t.isDocument)return e;var i={};return n.each(e,(function(e,n){var r=t.members[e];if(r){if("body"!==r.location)return;var a=r.isLocationName?r.name:e,s=o(n,r);void 0!==s&&(i[a]=s)}})),i}(e,t);case"map":return function(e,t){var i={};return n.each(e,(function(e,n){var r=o(n,t.value);void 0!==r&&(i[e]=r)})),i}(e,t);case"list":return function(e,t){var i=[];return n.arrayEach(e,(function(e){var n=o(e,t.member);void 0!==n&&i.push(n)})),i}(e,t);default:return function(e,t){return t.toWireFormat(e)}(e,t)}}r.prototype.build=function(e,t){return JSON.stringify(o(e,t))},e.exports=r},function(e,t,i){var n=i(45);function r(){}function o(e,t){if(t&&void 0!==e)switch(t.type){case"structure":return function(e,t){if(null==e)return;if(t.isDocument)return e;var i={},r=t.members;return n.each(r,(function(t,n){var r=n.isLocationName?n.name:t;if(Object.prototype.hasOwnProperty.call(e,r)){var a=o(e[r],n);void 0!==a&&(i[t]=a)}})),i}(e,t);case"map":return function(e,t){if(null==e)return;var i={};return n.each(e,(function(e,n){var r=o(n,t.value);i[e]=void 0===r?null:r})),i}(e,t);case"list":return function(e,t){if(null==e)return;var i=[];return n.arrayEach(e,(function(e){var n=o(e,t.member);void 0===n?i.push(null):i.push(n)})),i}(e,t);default:return function(e,t){return t.toType(e)}(e,t)}}r.prototype.parse=function(e,t){return o(JSON.parse(e),t)},e.exports=r},function(e,t,i){var n=i(45),r=i(14);e.exports={populateHostPrefix:function(e){if(!e.service.config.hostPrefixEnabled)return e;var t,i,o,a=e.service.api.operations[e.operation];if(function(e){var t=e.service.api,i=t.operations[e.operation],r=t.endpointOperation&&t.endpointOperation===n.string.lowerFirst(i.name);return"NULL"!==i.endpointDiscoveryRequired||!0===r}(e))return e;if(a.endpoint&&a.endpoint.hostPrefix){var s=function(e,t,i){return n.each(i.members,(function(i,r){if(!0===r.hostLabel){if("string"!=typeof t[i]||""===t[i])throw n.error(new Error,{message:"Parameter "+i+" should be a non-empty string.",code:"InvalidParameter"});var o=new RegExp("\\{"+i+"\\}","g");e=e.replace(o,t[i])}})),e}(a.endpoint.hostPrefix,e.params,a.input);!function(e,t){e.host&&(e.host=t+e.host);e.hostname&&(e.hostname=t+e.hostname)}(e.httpRequest.endpoint,s),t=e.httpRequest.endpoint.hostname,i=t.split("."),o=/^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]$/,n.arrayEach(i,(function(e){if(!e.length||e.length<1||e.length>63)throw n.error(new Error,{code:"ValidationError",message:"Hostname label length should be between 1 to 63 characters, inclusive."});if(!o.test(e))throw r.util.error(new Error,{code:"ValidationError",message:e+" is not hostname compatible."})}))}return e}}},function(e,t,i){var n=i(45),r=i(490);function o(e,t){n.each(t,(function(t,i){"globalEndpoint"!==t&&(void 0!==e.config[t]&&null!==e.config[t]||(e.config[t]=i))}))}e.exports={configureEndpoint:function(e){for(var t=function(e){var t=e.config.region,i=function(e){if(!e)return null;var t=e.split("-");return t.length<3?null:t.slice(0,t.length-2).join("-")+"-*"}(t),n=e.api.endpointPrefix;return[[t,n],[i,n],[t,"*"],[i,"*"],["*",n],["*","*"]].map((function(e){return e[0]&&e[1]?e.join("/"):null}))}(e),i=e.config.useFipsEndpoint,n=e.config.useDualstackEndpoint,a=0;a<t.length;a++){var s=t[a];if(s){var l=i?n?r.dualstackFipsRules:r.fipsRules:n?r.dualstackRules:r.rules;if(Object.prototype.hasOwnProperty.call(l,s)){var c=l[s];return"string"==typeof c&&(c=r.patterns[c]),e.isGlobalEndpoint=!!c.globalEndpoint,c.signingRegion&&(e.signingRegion=c.signingRegion),c.signatureVersion||(c.signatureVersion="v4"),void o(e,c)}}}},getEndpointSuffix:function(e){for(var t={"^(us|eu|ap|sa|ca|me)\\-\\w+\\-\\d+$":"amazonaws.com","^cn\\-\\w+\\-\\d+$":"amazonaws.com.cn","^us\\-gov\\-\\w+\\-\\d+$":"amazonaws.com","^us\\-iso\\-\\w+\\-\\d+$":"c2s.ic.gov","^us\\-isob\\-\\w+\\-\\d+$":"sc2s.sgov.gov"},i=Object.keys(t),n=0;n<i.length;n++){var r=RegExp(i[n]),o=t[i[n]];if(r.test(e))return o}return"amazonaws.com"}}},function(e,t,i){!function(e){"use strict";function t(e){return null!==e&&"[object Array]"===Object.prototype.toString.call(e)}function i(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}function n(e,r){if(e===r)return!0;if(Object.prototype.toString.call(e)!==Object.prototype.toString.call(r))return!1;if(!0===t(e)){if(e.length!==r.length)return!1;for(var o=0;o<e.length;o++)if(!1===n(e[o],r[o]))return!1;return!0}if(!0===i(e)){var a={};for(var s in e)if(hasOwnProperty.call(e,s)){if(!1===n(e[s],r[s]))return!1;a[s]=!0}for(var l in r)if(hasOwnProperty.call(r,l)&&!0!==a[l])return!1;return!0}return!1}function r(e){if(""===e||!1===e||null===e)return!0;if(t(e)&&0===e.length)return!0;if(i(e)){for(var n in e)if(e.hasOwnProperty(n))return!1;return!0}return!1}var o;o="function"==typeof String.prototype.trimLeft?function(e){return e.trimLeft()}:function(e){return e.match(/^\s*(.*)/)[1]};var a=0,s=2,l={0:"number",1:"any",2:"string",3:"array",4:"object",5:"boolean",6:"expression",7:"null",8:"Array<number>",9:"Array<string>"},c={".":"Dot","*":"Star",",":"Comma",":":"Colon","{":"Lbrace","}":"Rbrace","]":"Rbracket","(":"Lparen",")":"Rparen","@":"Current"},d={"<":!0,">":!0,"=":!0,"!":!0},u={" ":!0,"\t":!0,"\n":!0};function p(e){return e>="0"&&e<="9"||"-"===e}function h(){}h.prototype={tokenize:function(e){var t,i,n,r,o=[];for(this._current=0;this._current<e.length;)if((r=e[this._current])>="a"&&r<="z"||r>="A"&&r<="Z"||"_"===r)t=this._current,i=this._consumeUnquotedIdentifier(e),o.push({type:"UnquotedIdentifier",value:i,start:t});else if(void 0!==c[e[this._current]])o.push({type:c[e[this._current]],value:e[this._current],start:this._current}),this._current++;else if(p(e[this._current]))n=this._consumeNumber(e),o.push(n);else if("["===e[this._current])n=this._consumeLBracket(e),o.push(n);else if('"'===e[this._current])t=this._current,i=this._consumeQuotedIdentifier(e),o.push({type:"QuotedIdentifier",value:i,start:t});else if("'"===e[this._current])t=this._current,i=this._consumeRawStringLiteral(e),o.push({type:"Literal",value:i,start:t});else if("`"===e[this._current]){t=this._current;var a=this._consumeLiteral(e);o.push({type:"Literal",value:a,start:t})}else if(void 0!==d[e[this._current]])o.push(this._consumeOperator(e));else if(void 0!==u[e[this._current]])this._current++;else if("&"===e[this._current])t=this._current,this._current++,"&"===e[this._current]?(this._current++,o.push({type:"And",value:"&&",start:t})):o.push({type:"Expref",value:"&",start:t});else{if("|"!==e[this._current]){var s=new Error("Unknown character:"+e[this._current]);throw s.name="LexerError",s}t=this._current,this._current++,"|"===e[this._current]?(this._current++,o.push({type:"Or",value:"||",start:t})):o.push({type:"Pipe",value:"|",start:t})}return o},_consumeUnquotedIdentifier:function(e){var t,i=this._current;for(this._current++;this._current<e.length&&((t=e[this._current])>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||"_"===t);)this._current++;return e.slice(i,this._current)},_consumeQuotedIdentifier:function(e){var t=this._current;this._current++;for(var i=e.length;'"'!==e[this._current]&&this._current<i;){var n=this._current;"\\"!==e[n]||"\\"!==e[n+1]&&'"'!==e[n+1]?n++:n+=2,this._current=n}return this._current++,JSON.parse(e.slice(t,this._current))},_consumeRawStringLiteral:function(e){var t=this._current;this._current++;for(var i=e.length;"'"!==e[this._current]&&this._current<i;){var n=this._current;"\\"!==e[n]||"\\"!==e[n+1]&&"'"!==e[n+1]?n++:n+=2,this._current=n}return this._current++,e.slice(t+1,this._current-1).replace("\\'","'")},_consumeNumber:function(e){var t=this._current;this._current++;for(var i=e.length;p(e[this._current])&&this._current<i;)this._current++;return{type:"Number",value:parseInt(e.slice(t,this._current)),start:t}},_consumeLBracket:function(e){var t=this._current;return this._current++,"?"===e[this._current]?(this._current++,{type:"Filter",value:"[?",start:t}):"]"===e[this._current]?(this._current++,{type:"Flatten",value:"[]",start:t}):{type:"Lbracket",value:"[",start:t}},_consumeOperator:function(e){var t=this._current,i=e[t];return this._current++,"!"===i?"="===e[this._current]?(this._current++,{type:"NE",value:"!=",start:t}):{type:"Not",value:"!",start:t}:"<"===i?"="===e[this._current]?(this._current++,{type:"LTE",value:"<=",start:t}):{type:"LT",value:"<",start:t}:">"===i?"="===e[this._current]?(this._current++,{type:"GTE",value:">=",start:t}):{type:"GT",value:">",start:t}:"="===i&&"="===e[this._current]?(this._current++,{type:"EQ",value:"==",start:t}):void 0},_consumeLiteral:function(e){this._current++;for(var t,i=this._current,n=e.length;"`"!==e[this._current]&&this._current<n;){var r=this._current;"\\"!==e[r]||"\\"!==e[r+1]&&"`"!==e[r+1]?r++:r+=2,this._current=r}var a=o(e.slice(i,this._current));return a=a.replace("\\`","`"),t=this._looksLikeJSON(a)?JSON.parse(a):JSON.parse('"'+a+'"'),this._current++,t},_looksLikeJSON:function(e){if(""===e)return!1;if('[{"'.indexOf(e[0])>=0)return!0;if(["true","false","null"].indexOf(e)>=0)return!0;if(!("-0123456789".indexOf(e[0])>=0))return!1;try{return JSON.parse(e),!0}catch(e){return!1}}};var f={};function m(){}function g(e){this.runtime=e}function v(e){this._interpreter=e,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[a]}]},avg:{_func:this._functionAvg,_signature:[{types:[8]}]},ceil:{_func:this._functionCeil,_signature:[{types:[a]}]},contains:{_func:this._functionContains,_signature:[{types:[s,3]},{types:[1]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[s]},{types:[s]}]},floor:{_func:this._functionFloor,_signature:[{types:[a]}]},length:{_func:this._functionLength,_signature:[{types:[s,3,4]}]},map:{_func:this._functionMap,_signature:[{types:[6]},{types:[3]}]},max:{_func:this._functionMax,_signature:[{types:[8,9]}]},merge:{_func:this._functionMerge,_signature:[{types:[4],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[3]},{types:[6]}]},sum:{_func:this._functionSum,_signature:[{types:[8]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[s]},{types:[s]}]},min:{_func:this._functionMin,_signature:[{types:[8,9]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[3]},{types:[6]}]},type:{_func:this._functionType,_signature:[{types:[1]}]},keys:{_func:this._functionKeys,_signature:[{types:[4]}]},values:{_func:this._functionValues,_signature:[{types:[4]}]},sort:{_func:this._functionSort,_signature:[{types:[9,8]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[3]},{types:[6]}]},join:{_func:this._functionJoin,_signature:[{types:[s]},{types:[9]}]},reverse:{_func:this._functionReverse,_signature:[{types:[s,3]}]},to_array:{_func:this._functionToArray,_signature:[{types:[1]}]},to_string:{_func:this._functionToString,_signature:[{types:[1]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[1]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[1],variadic:!0}]}}}f.EOF=0,f.UnquotedIdentifier=0,f.QuotedIdentifier=0,f.Rbracket=0,f.Rparen=0,f.Comma=0,f.Rbrace=0,f.Number=0,f.Current=0,f.Expref=0,f.Pipe=1,f.Or=2,f.And=3,f.EQ=5,f.GT=5,f.LT=5,f.GTE=5,f.LTE=5,f.NE=5,f.Flatten=9,f.Star=20,f.Filter=21,f.Dot=40,f.Not=45,f.Lbrace=50,f.Lbracket=55,f.Lparen=60,m.prototype={parse:function(e){this._loadTokens(e),this.index=0;var t=this.expression(0);if("EOF"!==this._lookahead(0)){var i=this._lookaheadToken(0),n=new Error("Unexpected token type: "+i.type+", value: "+i.value);throw n.name="ParserError",n}return t},_loadTokens:function(e){var t=(new h).tokenize(e);t.push({type:"EOF",value:"",start:e.length}),this.tokens=t},expression:function(e){var t=this._lookaheadToken(0);this._advance();for(var i=this.nud(t),n=this._lookahead(0);e<f[n];)this._advance(),i=this.led(n,i),n=this._lookahead(0);return i},_lookahead:function(e){return this.tokens[this.index+e].type},_lookaheadToken:function(e){return this.tokens[this.index+e]},_advance:function(){this.index++},nud:function(e){var t,i;switch(e.type){case"Literal":return{type:"Literal",value:e.value};case"UnquotedIdentifier":return{type:"Field",name:e.value};case"QuotedIdentifier":var n={type:"Field",name:e.value};if("Lparen"===this._lookahead(0))throw new Error("Quoted identifier not allowed for function names.");return n;case"Not":return{type:"NotExpression",children:[t=this.expression(f.Not)]};case"Star":return t=null,{type:"ValueProjection",children:[{type:"Identity"},t="Rbracket"===this._lookahead(0)?{type:"Identity"}:this._parseProjectionRHS(f.Star)]};case"Filter":return this.led(e.type,{type:"Identity"});case"Lbrace":return this._parseMultiselectHash();case"Flatten":return{type:"Projection",children:[{type:"Flatten",children:[{type:"Identity"}]},t=this._parseProjectionRHS(f.Flatten)]};case"Lbracket":return"Number"===this._lookahead(0)||"Colon"===this._lookahead(0)?(t=this._parseIndexExpression(),this._projectIfSlice({type:"Identity"},t)):"Star"===this._lookahead(0)&&"Rbracket"===this._lookahead(1)?(this._advance(),this._advance(),{type:"Projection",children:[{type:"Identity"},t=this._parseProjectionRHS(f.Star)]}):this._parseMultiselectList();case"Current":return{type:"Current"};case"Expref":return{type:"ExpressionReference",children:[i=this.expression(f.Expref)]};case"Lparen":for(var r=[];"Rparen"!==this._lookahead(0);)"Current"===this._lookahead(0)?(i={type:"Current"},this._advance()):i=this.expression(0),r.push(i);return this._match("Rparen"),r[0];default:this._errorToken(e)}},led:function(e,t){var i;switch(e){case"Dot":var n=f.Dot;return"Star"!==this._lookahead(0)?{type:"Subexpression",children:[t,i=this._parseDotRHS(n)]}:(this._advance(),{type:"ValueProjection",children:[t,i=this._parseProjectionRHS(n)]});case"Pipe":return{type:"Pipe",children:[t,i=this.expression(f.Pipe)]};case"Or":return{type:"OrExpression",children:[t,i=this.expression(f.Or)]};case"And":return{type:"AndExpression",children:[t,i=this.expression(f.And)]};case"Lparen":for(var r,o=t.name,a=[];"Rparen"!==this._lookahead(0);)"Current"===this._lookahead(0)?(r={type:"Current"},this._advance()):r=this.expression(0),"Comma"===this._lookahead(0)&&this._match("Comma"),a.push(r);return this._match("Rparen"),{type:"Function",name:o,children:a};case"Filter":var s=this.expression(0);return this._match("Rbracket"),{type:"FilterProjection",children:[t,i="Flatten"===this._lookahead(0)?{type:"Identity"}:this._parseProjectionRHS(f.Filter),s]};case"Flatten":return{type:"Projection",children:[{type:"Flatten",children:[t]},this._parseProjectionRHS(f.Flatten)]};case"EQ":case"NE":case"GT":case"GTE":case"LT":case"LTE":return this._parseComparator(t,e);case"Lbracket":var l=this._lookaheadToken(0);return"Number"===l.type||"Colon"===l.type?(i=this._parseIndexExpression(),this._projectIfSlice(t,i)):(this._match("Star"),this._match("Rbracket"),{type:"Projection",children:[t,i=this._parseProjectionRHS(f.Star)]});default:this._errorToken(this._lookaheadToken(0))}},_match:function(e){if(this._lookahead(0)!==e){var t=this._lookaheadToken(0),i=new Error("Expected "+e+", got: "+t.type);throw i.name="ParserError",i}this._advance()},_errorToken:function(e){var t=new Error("Invalid token ("+e.type+'): "'+e.value+'"');throw t.name="ParserError",t},_parseIndexExpression:function(){if("Colon"===this._lookahead(0)||"Colon"===this._lookahead(1))return this._parseSliceExpression();var e={type:"Index",value:this._lookaheadToken(0).value};return this._advance(),this._match("Rbracket"),e},_projectIfSlice:function(e,t){var i={type:"IndexExpression",children:[e,t]};return"Slice"===t.type?{type:"Projection",children:[i,this._parseProjectionRHS(f.Star)]}:i},_parseSliceExpression:function(){for(var e=[null,null,null],t=0,i=this._lookahead(0);"Rbracket"!==i&&t<3;){if("Colon"===i)t++,this._advance();else{if("Number"!==i){var n=this._lookahead(0),r=new Error("Syntax error, unexpected token: "+n.value+"("+n.type+")");throw r.name="Parsererror",r}e[t]=this._lookaheadToken(0).value,this._advance()}i=this._lookahead(0)}return this._match("Rbracket"),{type:"Slice",children:e}},_parseComparator:function(e,t){return{type:"Comparator",name:t,children:[e,this.expression(f[t])]}},_parseDotRHS:function(e){var t=this._lookahead(0);return["UnquotedIdentifier","QuotedIdentifier","Star"].indexOf(t)>=0?this.expression(e):"Lbracket"===t?(this._match("Lbracket"),this._parseMultiselectList()):"Lbrace"===t?(this._match("Lbrace"),this._parseMultiselectHash()):void 0},_parseProjectionRHS:function(e){var t;if(f[this._lookahead(0)]<10)t={type:"Identity"};else if("Lbracket"===this._lookahead(0))t=this.expression(e);else if("Filter"===this._lookahead(0))t=this.expression(e);else{if("Dot"!==this._lookahead(0)){var i=this._lookaheadToken(0),n=new Error("Sytanx error, unexpected token: "+i.value+"("+i.type+")");throw n.name="ParserError",n}this._match("Dot"),t=this._parseDotRHS(e)}return t},_parseMultiselectList:function(){for(var e=[];"Rbracket"!==this._lookahead(0);){var t=this.expression(0);if(e.push(t),"Comma"===this._lookahead(0)&&(this._match("Comma"),"Rbracket"===this._lookahead(0)))throw new Error("Unexpected token Rbracket")}return this._match("Rbracket"),{type:"MultiSelectList",children:e}},_parseMultiselectHash:function(){for(var e,t,i,n=[],r=["UnquotedIdentifier","QuotedIdentifier"];;){if(e=this._lookaheadToken(0),r.indexOf(e.type)<0)throw new Error("Expecting an identifier token, got: "+e.type);if(t=e.value,this._advance(),this._match("Colon"),i={type:"KeyValuePair",name:t,value:this.expression(0)},n.push(i),"Comma"===this._lookahead(0))this._match("Comma");else if("Rbrace"===this._lookahead(0)){this._match("Rbrace");break}}return{type:"MultiSelectHash",children:n}}},g.prototype={search:function(e,t){return this.visit(e,t)},visit:function(e,o){var a,s,l,c,d,u,p,h,f;switch(e.type){case"Field":return null!==o&&i(o)?void 0===(u=o[e.name])?null:u:null;case"Subexpression":for(l=this.visit(e.children[0],o),f=1;f<e.children.length;f++)if(null===(l=this.visit(e.children[1],l)))return null;return l;case"IndexExpression":return p=this.visit(e.children[0],o),this.visit(e.children[1],p);case"Index":if(!t(o))return null;var m=e.value;return m<0&&(m=o.length+m),void 0===(l=o[m])&&(l=null),l;case"Slice":if(!t(o))return null;var g=e.children.slice(0),v=this.computeSliceParams(o.length,g),y=v[0],b=v[1],w=v[2];if(l=[],w>0)for(f=y;f<b;f+=w)l.push(o[f]);else for(f=y;f>b;f+=w)l.push(o[f]);return l;case"Projection":var S=this.visit(e.children[0],o);if(!t(S))return null;for(h=[],f=0;f<S.length;f++)null!==(s=this.visit(e.children[1],S[f]))&&h.push(s);return h;case"ValueProjection":if(!i(S=this.visit(e.children[0],o)))return null;h=[];var C=function(e){for(var t=Object.keys(e),i=[],n=0;n<t.length;n++)i.push(e[t[n]]);return i}(S);for(f=0;f<C.length;f++)null!==(s=this.visit(e.children[1],C[f]))&&h.push(s);return h;case"FilterProjection":if(!t(S=this.visit(e.children[0],o)))return null;var k=[],x=[];for(f=0;f<S.length;f++)r(a=this.visit(e.children[2],S[f]))||k.push(S[f]);for(var _=0;_<k.length;_++)null!==(s=this.visit(e.children[1],k[_]))&&x.push(s);return x;case"Comparator":switch(c=this.visit(e.children[0],o),d=this.visit(e.children[1],o),e.name){case"EQ":l=n(c,d);break;case"NE":l=!n(c,d);break;case"GT":l=c>d;break;case"GTE":l=c>=d;break;case"LT":l=c<d;break;case"LTE":l=c<=d;break;default:throw new Error("Unknown comparator: "+e.name)}return l;case"Flatten":var E=this.visit(e.children[0],o);if(!t(E))return null;var T=[];for(f=0;f<E.length;f++)t(s=E[f])?T.push.apply(T,s):T.push(s);return T;case"Identity":return o;case"MultiSelectList":if(null===o)return null;for(h=[],f=0;f<e.children.length;f++)h.push(this.visit(e.children[f],o));return h;case"MultiSelectHash":if(null===o)return null;var P;for(h={},f=0;f<e.children.length;f++)h[(P=e.children[f]).name]=this.visit(P.value,o);return h;case"OrExpression":return r(a=this.visit(e.children[0],o))&&(a=this.visit(e.children[1],o)),a;case"AndExpression":return!0===r(c=this.visit(e.children[0],o))?c:this.visit(e.children[1],o);case"NotExpression":return r(c=this.visit(e.children[0],o));case"Literal":return e.value;case"Pipe":return p=this.visit(e.children[0],o),this.visit(e.children[1],p);case"Current":return o;case"Function":var I=[];for(f=0;f<e.children.length;f++)I.push(this.visit(e.children[f],o));return this.runtime.callFunction(e.name,I);case"ExpressionReference":var A=e.children[0];return A.jmespathType="Expref",A;default:throw new Error("Unknown node type: "+e.type)}},computeSliceParams:function(e,t){var i=t[0],n=t[1],r=t[2],o=[null,null,null];if(null===r)r=1;else if(0===r){var a=new Error("Invalid slice, step cannot be 0");throw a.name="RuntimeError",a}var s=r<0;return i=null===i?s?e-1:0:this.capSliceRange(e,i,r),n=null===n?s?-1:e:this.capSliceRange(e,n,r),o[0]=i,o[1]=n,o[2]=r,o},capSliceRange:function(e,t,i){return t<0?(t+=e)<0&&(t=i<0?-1:0):t>=e&&(t=i<0?e-1:e),t}},v.prototype={callFunction:function(e,t){var i=this.functionTable[e];if(void 0===i)throw new Error("Unknown function: "+e+"()");return this._validateArgs(e,t,i._signature),i._func.call(this,t)},_validateArgs:function(e,t,i){var n,r,o,a;if(i[i.length-1].variadic){if(t.length<i.length)throw n=1===i.length?" argument":" arguments",new Error("ArgumentError: "+e+"() takes at least"+i.length+n+" but received "+t.length)}else if(t.length!==i.length)throw n=1===i.length?" argument":" arguments",new Error("ArgumentError: "+e+"() takes "+i.length+n+" but received "+t.length);for(var s=0;s<i.length;s++){a=!1,r=i[s].types,o=this._getTypeName(t[s]);for(var c=0;c<r.length;c++)if(this._typeMatches(o,r[c],t[s])){a=!0;break}if(!a){var d=r.map((function(e){return l[e]})).join(",");throw new Error("TypeError: "+e+"() expected argument "+(s+1)+" to be type "+d+" but received type "+l[o]+" instead.")}}},_typeMatches:function(e,t,i){if(1===t)return!0;if(9!==t&&8!==t&&3!==t)return e===t;if(3===t)return 3===e;if(3===e){var n;8===t?n=a:9===t&&(n=s);for(var r=0;r<i.length;r++)if(!this._typeMatches(this._getTypeName(i[r]),n,i[r]))return!1;return!0}},_getTypeName:function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return s;case"[object Number]":return a;case"[object Array]":return 3;case"[object Boolean]":return 5;case"[object Null]":return 7;case"[object Object]":return"Expref"===e.jmespathType?6:4}},_functionStartsWith:function(e){return 0===e[0].lastIndexOf(e[1])},_functionEndsWith:function(e){var t=e[0],i=e[1];return-1!==t.indexOf(i,t.length-i.length)},_functionReverse:function(e){if(this._getTypeName(e[0])===s){for(var t=e[0],i="",n=t.length-1;n>=0;n--)i+=t[n];return i}var r=e[0].slice(0);return r.reverse(),r},_functionAbs:function(e){return Math.abs(e[0])},_functionCeil:function(e){return Math.ceil(e[0])},_functionAvg:function(e){for(var t=0,i=e[0],n=0;n<i.length;n++)t+=i[n];return t/i.length},_functionContains:function(e){return e[0].indexOf(e[1])>=0},_functionFloor:function(e){return Math.floor(e[0])},_functionLength:function(e){return i(e[0])?Object.keys(e[0]).length:e[0].length},_functionMap:function(e){for(var t=[],i=this._interpreter,n=e[0],r=e[1],o=0;o<r.length;o++)t.push(i.visit(n,r[o]));return t},_functionMerge:function(e){for(var t={},i=0;i<e.length;i++){var n=e[i];for(var r in n)t[r]=n[r]}return t},_functionMax:function(e){if(e[0].length>0){if(this._getTypeName(e[0][0])===a)return Math.max.apply(Math,e[0]);for(var t=e[0],i=t[0],n=1;n<t.length;n++)i.localeCompare(t[n])<0&&(i=t[n]);return i}return null},_functionMin:function(e){if(e[0].length>0){if(this._getTypeName(e[0][0])===a)return Math.min.apply(Math,e[0]);for(var t=e[0],i=t[0],n=1;n<t.length;n++)t[n].localeCompare(i)<0&&(i=t[n]);return i}return null},_functionSum:function(e){for(var t=0,i=e[0],n=0;n<i.length;n++)t+=i[n];return t},_functionType:function(e){switch(this._getTypeName(e[0])){case a:return"number";case s:return"string";case 3:return"array";case 4:return"object";case 5:return"boolean";case 6:return"expref";case 7:return"null"}},_functionKeys:function(e){return Object.keys(e[0])},_functionValues:function(e){for(var t=e[0],i=Object.keys(t),n=[],r=0;r<i.length;r++)n.push(t[i[r]]);return n},_functionJoin:function(e){var t=e[0];return e[1].join(t)},_functionToArray:function(e){return 3===this._getTypeName(e[0])?e[0]:[e[0]]},_functionToString:function(e){return this._getTypeName(e[0])===s?e[0]:JSON.stringify(e[0])},_functionToNumber:function(e){var t,i=this._getTypeName(e[0]);return i===a?e[0]:i!==s||(t=+e[0],isNaN(t))?null:t},_functionNotNull:function(e){for(var t=0;t<e.length;t++)if(7!==this._getTypeName(e[t]))return e[t];return null},_functionSort:function(e){var t=e[0].slice(0);return t.sort(),t},_functionSortBy:function(e){var t=e[0].slice(0);if(0===t.length)return t;var i=this._interpreter,n=e[1],r=this._getTypeName(i.visit(n,t[0]));if([a,s].indexOf(r)<0)throw new Error("TypeError");for(var o=this,l=[],c=0;c<t.length;c++)l.push([c,t[c]]);l.sort((function(e,t){var a=i.visit(n,e[1]),s=i.visit(n,t[1]);if(o._getTypeName(a)!==r)throw new Error("TypeError: expected "+r+", received "+o._getTypeName(a));if(o._getTypeName(s)!==r)throw new Error("TypeError: expected "+r+", received "+o._getTypeName(s));return a>s?1:a<s?-1:e[0]-t[0]}));for(var d=0;d<l.length;d++)t[d]=l[d][1];return t},_functionMaxBy:function(e){for(var t,i,n=e[1],r=e[0],o=this.createKeyFunction(n,[a,s]),l=-1/0,c=0;c<r.length;c++)(i=o(r[c]))>l&&(l=i,t=r[c]);return t},_functionMinBy:function(e){for(var t,i,n=e[1],r=e[0],o=this.createKeyFunction(n,[a,s]),l=1/0,c=0;c<r.length;c++)(i=o(r[c]))<l&&(l=i,t=r[c]);return t},createKeyFunction:function(e,t){var i=this,n=this._interpreter;return function(r){var o=n.visit(e,r);if(t.indexOf(i._getTypeName(o))<0){var a="TypeError: expected one of "+t+", received "+i._getTypeName(o);throw new Error(a)}return o}}},e.tokenize=function(e){return(new h).tokenize(e)},e.compile=function(e){return(new m).parse(e)},e.search=function(e,t){var i=new m,n=new v,r=new g(n);n._interpreter=r;var o=i.parse(t);return r.search(o,e)},e.strictDeepEqual=n}(t)},function(e,t,i){var n=i(137).PROPER,r=i(13),o=i(197);e.exports=function(e){return r((function(){return!!o[e]()||"​…᠎"!=="​…᠎"[e]()||n&&o[e].name!==e}))}},function(e,t,i){"use strict";var n=i(121),r=TypeError;e.exports=function(e,t){if(!delete e[t])throw r("Cannot delete property "+n(t)+" of "+n(e))}},function(e,t,i){var n=i(123)(i(87),"Map");e.exports=n},function(e,t,i){var n=i(146),r=i(124);e.exports=function(e){if(!r(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,i){var n=i(355);e.exports=function(e,t,i){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}},function(e,t){var i=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||i)}},function(e,t,i){(function(e){var n=i(87),r=i(612),o=t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===o?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||r;e.exports=l}).call(this,i(202)(e))},function(e,t,i){var n=i(614),r=i(615),o=i(616),a=o&&o.isTypedArray,s=a?r(a):n;e.exports=s},function(e,t){},function(e,t,i){var n=i(171),r=Math.floor,o=function(e,t){var i=e.length,l=r(i/2);return i<8?a(e,t):s(e,o(n(e,0,l),t),o(n(e,l),t),t)},a=function(e,t){for(var i,n,r=e.length,o=1;o<r;){for(n=o,i=e[o];n&&t(e[n-1],i)>0;)e[n]=e[--n];n!==o++&&(e[n]=i)}return e},s=function(e,t,i,n){for(var r=t.length,o=i.length,a=0,s=0;a<r||s<o;)e[a+s]=a<r&&s<o?n(t[a],i[s])<=0?t[a++]:i[s++]:a<r?t[a++]:i[s++];return e};e.exports=o},function(e,t,i){"use strict";var n=i(15),r=i(677);n({target:"String",proto:!0,forced:i(678)("link")},{link:function(e){return r(this,"a","href",e)}})},function(e,t,i){i(679);var n=i(15),r=i(373);n({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==r},{trimStart:r})},function(e,t,i){i(680);var n=i(15),r=i(374);n({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==r},{trimEnd:r})},function(e,t,i){"use strict";var n=i(15),r=i(12),o=i(75),a=i(53),s=i(54),l=i(256),c=i(42),d=i(13),u=i(264),p=i(170),h=i(375),f=i(376),m=i(118),g=i(377),v=[],y=r(v.sort),b=r(v.push),w=d((function(){v.sort(void 0)})),S=d((function(){v.sort(null)})),C=p("sort"),k=!d((function(){if(m)return m<70;if(!(h&&h>3)){if(f)return!0;if(g)return g<603;var e,t,i,n,r="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:i=3;break;case 68:case 71:i=4;break;default:i=2}for(n=0;n<47;n++)v.push({k:t+n,v:i})}for(v.sort((function(e,t){return t.v-e.v})),n=0;n<v.length;n++)t=v[n].k.charAt(0),r.charAt(r.length-1)!==t&&(r+=t);return"DGBEFHACIJK"!==r}}));n({target:"Array",proto:!0,forced:w||!S||!C||!k},{sort:function(e){void 0!==e&&o(e);var t=a(this);if(k)return void 0===e?y(t):y(t,e);var i,n,r=[],d=s(t);for(n=0;n<d;n++)n in t&&b(r,t[n]);for(u(r,function(e){return function(t,i){return void 0===i?-1:void 0===t?1:void 0!==e?+e(t,i)||0:c(t)>c(i)?1:-1}}(e)),i=s(r),n=0;n<i;)t[n]=r[n++];for(;n<d;)l(t,n++);return t}})},function(e,t,i){i(347)("iterator")},function(e,t){},function(e,t,i){var n=i(75),r=i(53),o=i(156),a=i(54),s=TypeError,l=function(e){return function(t,i,l,c){n(i);var d=r(t),u=o(d),p=a(d),h=e?p-1:0,f=e?-1:1;if(l<2)for(;;){if(h in u){c=u[h],h+=f;break}if(h+=f,e?h<0:p<=h)throw s("Reduce of empty array with no initial value")}for(;e?h>=0:p>h;h+=f)h in u&&(c=i(c,u[h],h,d));return c}};e.exports={left:l(!1),right:l(!0)}},function(e,t,i){var n=i(15),r=i(12),o=i(159),a=i(38),s=i(39),l=i(48).f,c=i(101),d=i(345),u=i(384),p=i(158),h=i(748),f=!1,m=p("meta"),g=0,v=function(e){l(e,m,{value:{objectID:"O"+g++,weakData:{}}})},y=e.exports={enable:function(){y.enable=function(){},f=!0;var e=c.f,t=r([].splice),i={};i[m]=1,e(i).length&&(c.f=function(i){for(var n=e(i),r=0,o=n.length;r<o;r++)if(n[r]===m){t(n,r,1);break}return n},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:d.f}))},fastKey:function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!s(e,m)){if(!u(e))return"F";if(!t)return"E";v(e)}return e[m].objectID},getWeakData:function(e,t){if(!s(e,m)){if(!u(e))return!0;if(!t)return!1;v(e)}return e[m].weakData},onFreeze:function(e){return h&&f&&u(e)&&!s(e,m)&&v(e),e}};o[m]=!0},function(e,t,i){var n,r;n=[i(30)],void 0===(r=function(e){"use strict";return{initialize:function(t){return this.MAX_LOGS_SIZE=null!=t.maxLogSize?t.maxLogSize:5,this.PUSH_LOGS_INTERVAL=1e4,this.COOLDOWN_PERIOD=3e5,this.SAFE_KILL_TIMEOUT=108e5,this.VERBOSE=null==t.verbose||t.verbose,this.ENABLE_SAVING_LOGS=!0,this.saveLogs=!1,this.lastLogsPushedTime=0,this.buffer=[],this.digest=t.digest,this.enabled=t.enabled,this.digest?this.videoModel=new e({digest:this.digest}):this.videoModel=new e,this},log:function(e){this.saveLog("log",arguments),this.VERBOSE&&console.log.apply(console,arguments)},info:function(e){this.saveLog("info",arguments),this.VERBOSE&&console.info.apply(console,arguments)},warn:function(e){this.saveLog("warn",arguments),this.VERBOSE&&console.warn.apply(console,arguments)},error:function(e){this.saveLog("error",arguments),this.VERBOSE&&console.error.apply(console,arguments)},saveLog:function(e,t){try{if(this.saveLogs&&this.ENABLE_SAVING_LOGS){var i,n=(new Date).toISOString();try{i=n+" : "+JSON.stringify(t)}catch(e){i=n+" : "+JSON.stringify(t[0])}var r={authoringAssetId:this.assetId,description:e,stackTrace:i};this.buffer.push(r),this.buffer.length>=this.MAX_LOGS_SIZE&&this.pushLogsToServer()}}catch(e){console.log("error adding logs ",e)}},pushLogsToServer:function(){if(!((new Date).getTime()-this.lastLogsPushedTime<2e3||0==this.ENABLE_SAVING_LOGS||this.buffer.length<=0)&&this.assetId){this.lastLogsPushedTime=(new Date).getTime();var e=this.buffer,t=this;this.videoModel.logClientData(this.buffer,this.enabled,(function(){}),(function(){console.log("error pushing logs to server");var i=e;i.concat(t.buffer),t.buffer=i})),this.buffer=[]}},startSavingLogs:function(e){if(0!=this.ENABLE_SAVING_LOGS){this.assetId=e,clearTimeout(this.stopSavingTimeout),this.safeKillTimeout=setTimeout(this.stopSavingLogs,this.SAFE_KILL_TIMEOUT),this.saveLogs=!0;var t=this;this.saveLogsInterval=setInterval((function(){t.pushLogsToServer()}),this.PUSH_LOGS_INTERVAL)}},stopSavingLogs:function(){if(0!=this.ENABLE_SAVING_LOGS){clearTimeout(this.safeKillTimeout);var e=this;this.stopSavingTimeout=setTimeout((function(){e.saveLogs=!1,e.pushLogsToServer(),clearInterval(e.saveLogsInterval)}),e.COOLDOWN_PERIOD),this.pushLogsToServer()}}}}.apply(t,n))||(e.exports=r)},function(e,t,i){i(173);var n=i(14),r=n.Service,o=n.apiLoader;o.services.s3={},n.S3=r.defineService("s3",["2006-03-01"]),i(558),Object.defineProperty(o.services.s3,"2006-03-01",{get:function(){var e=i(561);return e.paginators=i(562).pagination,e.waiters=i(563).waiters,e},enumerable:!0,configurable:!0}),e.exports=n.S3},function(e,t,i){"use strict";i.r(t);i(115),i(99),i(24),i(0);var n=i(5),r=i.n(n),o=i(91),a=i(391),s=i.n(a),l=i(112),c=i.n(l),d=i(20),u={},p={},h={},f={},m={},g=[],v={},y={};y[r.a.analytics.VIDEO_STATS]={seconds:10,calls:20},y[r.a.analytics.FIRST_FRAME_LOAD]={calls:1},y[r.a.analytics.UPDATE_BANDWIDTH]={calls:1},y[r.a.analytics.CLOSE_EVENT]={calls:1};var b={};b[r.a.kinesisDataStreamType.VIDEO_ANALYTICS]=JSON.parse(o).videoAnalyticsIdentity,b[r.a.kinesisDataStreamType.VIDEO_PAGE_REPORTS]=JSON.parse(o).videoAnalyticsIdentity;var w={};w[r.a.kinesisDataStreamType.VIDEO_ANALYTICS]=JSON.parse(o).videoAnalyticsFallback,w[r.a.kinesisDataStreamType.VIDEO_PAGE_REPORTS]=JSON.parse(o).videoAnalyticsFallback;var S=1e3*(window.HippoVideo&&window.HippoVideo.AppRegistry&&window.HippoVideo.AppRegistry.KinesisApiTimeout?Number(window.HippoVideo.AppRegistry.KinesisApiTimeout):10);window.onbeforeunload=function(){for(var e in u)try{u[e].clearCachedId()}catch(e){}};var C={setAnalayticsCognito:function(e,t){if(e&&t)try{if(u[e])try{u[e].clearCachedId()}catch(e){}u[e]=new c.a({IdentityId:t.identity_id,Logins:{"cognito-identity.amazonaws.com":t.token}},{region:t.region,httpOptions:{timeout:S}}),m[e]=t.stream_name,p[e]=t.region,f[e]=t.bean_stalk_environment,h[e]=null,this._initKinesis(e)}catch(e){console.log(e)}},pushRecord:function(e,t,i,n){if(this.isValidKinesisRequest(i)){n=null==n||n,i.stream_type=e,f[e]&&(i.bean_stalk_environment=f[e]),i.recordCreatedTime=(new Date).getTime()/1e3,i.recordCreatedFrom="client";var r=this;u[e]?r._pushRecord(e,t,i,n,(function(e){}),(function(o){r._refreshToken(e,i,(function(o){r.setAnalayticsCognito(e,o),r._pushRecord(e,t,i,n,(function(e){}),(function(n){r._fallback(e,t,i)}))}),(function(n){r._fallback(e,t,i)}))})):r._fallback(e,t,i)}},isValidKinesisRequest:function(e){if(!y[e.type])return!0;var t=e.video_uuid?e.video_uuid:e.page_uuid;if(t){if(v[t]&&v[t][e.type])return!1;var i=(new Date).getTime(),n=y[e.type].seconds?i-1e3*y[e.type].seconds:0;return g.filter((function(i){return i.id==t&&i.type==e.type&&i.time>n})).length>y[e.type].calls?(v[t]||(v[t]={}),v[t][e.type]=!0,!1):(g.push({id:t,type:e.type,time:i}),!0)}return!1},_refreshToken:function(e,t,i,n){var o=b[e],a={};e==r.a.kinesisDataStreamType.VIDEO_ANALYTICS?a.token=t.token:e==r.a.kinesisDataStreamType.VIDEO_PAGE_REPORTS&&(a.page_id=t.page_id),d.default.call({method:"POST",url:o,data:a,success:function(e){e.status?i(e):n&&n()},error:n})},_pushRecord:function(e,t,i,n,r,o){if(h[e]){h[e].config.update({httpOptions:{xhrAsync:n}});var a={Data:JSON.stringify(i),PartitionKey:String(t),StreamName:m[e]};h[e].putRecord(a,(function(e,t){e?o&&o(e):r(t)}))}else o&&o()},_initKinesis:function(e){h[e]||(h[e]=new s.a({credentials:u[e],region:p[e],httpOptions:{timeout:S}}))},_fallback:function(e,t,i){var n=w[e],o={data:i,partition_key:t};e==r.a.kinesisDataStreamType.VIDEO_ANALYTICS?o.token=i.token:e==r.a.kinesisDataStreamType.VIDEO_PAGE_REPORTS&&(o.page_id=i.page_id),d.default.call({method:"POST",url:n,data:o,success:function(e){},error:function(e){}})}};t.default=C},function(e){e.exports=JSON.parse('{"a":"/api/internal/video/guest","b":"/video/embed"}')},function(e,t,i){"use strict";var n=i(221),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return n.isMemo(e)?a:s[e.$$typeof]||r}s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[n.Memo]=a;var c=Object.defineProperty,d=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,i,n){if("string"!=typeof i){if(f){var r=h(i);r&&r!==f&&e(t,r,n)}var a=d(i);u&&(a=a.concat(u(i)));for(var s=l(t),m=l(i),g=0;g<a.length;++g){var v=a[g];if(!(o[v]||n&&n[v]||m&&m[v]||s&&s[v])){var y=p(i,v);try{c(t,v,y)}catch(e){}}}}return t}},function(e,t){function i(){return e.exports=i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,i.apply(this,arguments)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){(function(e){!function(t){"use strict";var n,r;function o(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function a(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new o,this.dtree=new o}String.prototype.codePointAt||(n=function(){try{var e={},t=Object.defineProperty,i=t(e,e,e)&&t}catch(e){}return i}(),r=function(e){if(null==this)throw TypeError();var t=String(this),i=t.length,n=e?Number(e):0;if(n!=n&&(n=0),!(n<0||i<=n)){var r,o=t.charCodeAt(n);return 55296<=o&&o<=56319&&n+1<i&&56320<=(r=t.charCodeAt(n+1))&&r<=57343?1024*(o-55296)+r-56320+65536:o}},n?n(String.prototype,"codePointAt",{value:r,configurable:!0,writable:!0}):String.prototype.codePointAt=r);var s=new o,l=new o,c=new Uint8Array(30),d=new Uint16Array(30),u=new Uint8Array(30),p=new Uint16Array(30),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f=new o,m=new Uint8Array(320);function g(e,t,i,n){var r,o;for(r=0;r<i;++r)e[r]=0;for(r=0;r<30-i;++r)e[r+i]=r/i|0;for(o=n,r=0;r<30;++r)t[r]=o,o+=1<<e[r]}var v=new Uint16Array(16);function y(e,t,i,n){var r,o;for(r=0;r<16;++r)e.table[r]=0;for(r=0;r<n;++r)e.table[t[i+r]]++;for(r=o=e.table[0]=0;r<16;++r)v[r]=o,o+=e.table[r];for(r=0;r<n;++r)t[i+r]&&(e.trans[v[t[i+r]]++]=r)}function b(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var t=1&e.tag;return e.tag>>>=1,t}function w(e,t,i){if(!t)return i;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var n=e.tag&65535>>>16-t;return e.tag>>>=t,e.bitcount-=t,n+i}function S(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;for(var i=0,n=0,r=0,o=e.tag;n=2*n+(1&o),o>>>=1,++r,i+=t.table[r],0<=(n-=t.table[r]););return e.tag=o,e.bitcount-=r,t.trans[i+n]}function C(e,t,i){var n,r,o,a,s,l;for(n=w(e,5,257),r=w(e,5,1),o=w(e,4,4),a=0;a<19;++a)m[a]=0;for(a=0;a<o;++a){var c=w(e,3,0);m[h[a]]=c}for(y(f,m,0,19),s=0;s<n+r;){var d=S(e,f);switch(d){case 16:var u=m[s-1];for(l=w(e,2,3);l;--l)m[s++]=u;break;case 17:for(l=w(e,3,3);l;--l)m[s++]=0;break;case 18:for(l=w(e,7,11);l;--l)m[s++]=0;break;default:m[s++]=d}}y(t,m,0,n),y(i,m,n,r)}function k(e,t,i){for(;;){var n,r,o,a,s=S(e,t);if(256===s)return 0;if(s<256)e.dest[e.destLen++]=s;else for(n=w(e,c[s-=257],d[s]),r=S(e,i),a=o=e.destLen-w(e,u[r],p[r]);a<o+n;++a)e.dest[e.destLen++]=e.dest[a]}}function x(e){for(var t,i;8<e.bitcount;)e.sourceIndex--,e.bitcount-=8;if((t=256*(t=e.source[e.sourceIndex+1])+e.source[e.sourceIndex])!==(65535&~(256*e.source[e.sourceIndex+3]+e.source[e.sourceIndex+2])))return-3;for(e.sourceIndex+=4,i=t;i;--i)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,0}function _(e,t,i,n,r){return Math.pow(1-r,3)*e+3*Math.pow(1-r,2)*r*t+3*(1-r)*Math.pow(r,2)*i+Math.pow(r,3)*n}function E(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}function T(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}function P(e){throw new Error(e)}function I(e,t){e||P(t)}!function(e,t){var i;for(i=0;i<7;++i)e.table[i]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,i=0;i<24;++i)e.trans[i]=256+i;for(i=0;i<144;++i)e.trans[24+i]=i;for(i=0;i<8;++i)e.trans[168+i]=280+i;for(i=0;i<112;++i)e.trans[176+i]=144+i;for(i=0;i<5;++i)t.table[i]=0;for(t.table[5]=32,i=0;i<32;++i)t.trans[i]=i}(s,l),g(c,d,4,3),g(u,p,2,1),c[28]=0,d[28]=258,E.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},E.prototype.addPoint=function(e,t){"number"==typeof e&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))},E.prototype.addX=function(e){this.addPoint(e,null)},E.prototype.addY=function(e){this.addPoint(null,e)},E.prototype.addBezier=function(e,t,i,n,r,o,a,s){var l=this,c=[e,t],d=[i,n],u=[r,o],p=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var h=0;h<=1;h++){var f=6*c[h]-12*d[h]+6*u[h],m=-3*c[h]+9*d[h]-9*u[h]+3*p[h],g=3*d[h]-3*c[h];if(0!==m){var v=Math.pow(f,2)-4*g*m;if(!(v<0)){var y=(-f+Math.sqrt(v))/(2*m);0<y&&y<1&&(0===h&&l.addX(_(c[h],d[h],u[h],p[h],y)),1===h&&l.addY(_(c[h],d[h],u[h],p[h],y)));var b=(-f-Math.sqrt(v))/(2*m);0<b&&b<1&&(0===h&&l.addX(_(c[h],d[h],u[h],p[h],b)),1===h&&l.addY(_(c[h],d[h],u[h],p[h],b)))}}else{if(0===f)continue;var w=-g/f;0<w&&w<1&&(0===h&&l.addX(_(c[h],d[h],u[h],p[h],w)),1===h&&l.addY(_(c[h],d[h],u[h],p[h],w)))}}},E.prototype.addQuad=function(e,t,i,n,r,o){var a=e+2/3*(i-e),s=t+2/3*(n-t),l=a+1/3*(r-e),c=s+1/3*(o-t);this.addBezier(e,t,a,s,l,c,r,o)},T.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},T.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},T.prototype.curveTo=T.prototype.bezierCurveTo=function(e,t,i,n,r,o){this.commands.push({type:"C",x1:e,y1:t,x2:i,y2:n,x:r,y:o})},T.prototype.quadTo=T.prototype.quadraticCurveTo=function(e,t,i,n){this.commands.push({type:"Q",x1:e,y1:t,x:i,y:n})},T.prototype.close=T.prototype.closePath=function(){this.commands.push({type:"Z"})},T.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof E){var t=e;return this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),void this.close()}Array.prototype.push.apply(this.commands,e)},T.prototype.getBoundingBox=function(){for(var e=new E,t=0,i=0,n=0,r=0,o=0;o<this.commands.length;o++){var a=this.commands[o];switch(a.type){case"M":e.addPoint(a.x,a.y),t=n=a.x,i=r=a.y;break;case"L":e.addPoint(a.x,a.y),n=a.x,r=a.y;break;case"Q":e.addQuad(n,r,a.x1,a.y1,a.x,a.y),n=a.x,r=a.y;break;case"C":e.addBezier(n,r,a.x1,a.y1,a.x2,a.y2,a.x,a.y),n=a.x,r=a.y;break;case"Z":n=t,r=i;break;default:throw new Error("Unexpected path command "+a.type)}}return e.isEmpty()&&e.addPoint(0,0),e},T.prototype.draw=function(e){e.beginPath();for(var t=0;t<this.commands.length;t+=1){var i=this.commands[t];"M"===i.type?e.moveTo(i.x,i.y):"L"===i.type?e.lineTo(i.x,i.y):"C"===i.type?e.bezierCurveTo(i.x1,i.y1,i.x2,i.y2,i.x,i.y):"Q"===i.type?e.quadraticCurveTo(i.x1,i.y1,i.x,i.y):"Z"===i.type&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},T.prototype.toPathData=function(e){function t(){for(var t,i=arguments,n="",r=0;r<arguments.length;r+=1){var o=i[r];0<=o&&0<r&&(n+=" "),n+=(t=o,Math.round(t)===t?""+Math.round(t):t.toFixed(e))}return n}e=void 0!==e?e:2;for(var i="",n=0;n<this.commands.length;n+=1){var r=this.commands[n];"M"===r.type?i+="M"+t(r.x,r.y):"L"===r.type?i+="L"+t(r.x,r.y):"C"===r.type?i+="C"+t(r.x1,r.y1,r.x2,r.y2,r.x,r.y):"Q"===r.type?i+="Q"+t(r.x1,r.y1,r.x,r.y):"Z"===r.type&&(i+="Z")}return i},T.prototype.toSVG=function(e){var t='<path d="';return t+=this.toPathData(e),t+='"',this.fill&&"black"!==this.fill&&(null===this.fill?t+=' fill="none"':t+=' fill="'+this.fill+'"'),this.stroke&&(t+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),t+"/>"},T.prototype.toDOMElement=function(e){var t=this.toPathData(e),i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",t),i};var A={fail:P,argument:I,assert:I},R=2147483648,O={},N={},D={};function L(e){return function(){return e}}N.BYTE=function(e){return A.argument(0<=e&&e<=255,"Byte value should be between 0 and 255."),[e]},D.BYTE=L(1),N.CHAR=function(e){return[e.charCodeAt(0)]},D.CHAR=L(1),N.CHARARRAY=function(e){for(var t=[],i=0;i<e.length;i+=1)t[i]=e.charCodeAt(i);return t},D.CHARARRAY=function(e){return e.length},N.USHORT=function(e){return[e>>8&255,255&e]},D.USHORT=L(2),N.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},D.SHORT=L(2),N.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},D.UINT24=L(3),N.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},D.ULONG=L(4),N.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},D.LONG=L(4),N.FIXED=N.ULONG,D.FIXED=D.ULONG,N.FWORD=N.SHORT,D.FWORD=D.SHORT,N.UFWORD=N.USHORT,D.UFWORD=D.USHORT,N.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},D.LONGDATETIME=L(8),N.TAG=function(e){return A.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},D.TAG=L(4),N.Card8=N.BYTE,D.Card8=D.BYTE,N.Card16=N.USHORT,D.Card16=D.USHORT,N.OffSize=N.BYTE,D.OffSize=D.BYTE,N.SID=N.USHORT,D.SID=D.USHORT,N.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?N.NUMBER16(e):N.NUMBER32(e)},D.NUMBER=function(e){return N.NUMBER(e).length},N.NUMBER16=function(e){return[28,e>>8&255,255&e]},D.NUMBER16=L(3),N.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},D.NUMBER32=L(5),N.REAL=function(e){var t=e.toString(),i=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(i){var n=parseFloat("1e"+((i[2]?+i[2]:0)+i[1].length));t=(Math.round(e*n)/n).toString()}for(var r="",o=0,a=t.length;o<a;o+=1){var s=t[o];r+="e"===s?"-"===t[++o]?"c":"b":"."===s?"a":"-"===s?"e":s}for(var l=[30],c=0,d=(r+=1&r.length?"f":"ff").length;c<d;c+=2)l.push(parseInt(r.substr(c,2),16));return l},D.REAL=function(e){return N.REAL(e).length},N.NAME=N.CHARARRAY,D.NAME=D.CHARARRAY,N.STRING=N.CHARARRAY,D.STRING=D.CHARARRAY,O.UTF8=function(e,t,i){for(var n=[],r=i,o=0;o<r;o++,t+=1)n[o]=e.getUint8(t);return String.fromCharCode.apply(null,n)},O.UTF16=function(e,t,i){for(var n=[],r=i/2,o=0;o<r;o++,t+=2)n[o]=e.getUint16(t);return String.fromCharCode.apply(null,n)},N.UTF16=function(e){for(var t=[],i=0;i<e.length;i+=1){var n=e.charCodeAt(i);t[t.length]=n>>8&255,t[t.length]=255&n}return t},D.UTF16=function(e){return 2*e.length};var M={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,i,n){var r=M[n];if(void 0!==r){for(var o="",a=0;a<i;a++){var s=e.getUint8(t+a);o+=s<=127?String.fromCharCode(s):r[127&s]}return o}};var B,F="function"==typeof WeakMap&&new WeakMap;function V(e){return-128<=e&&e<=127}function U(e,t,i){for(var n=0,r=e.length;t<r&&n<64&&0===e[t];)++t,++n;return i.push(128|n-1),t}function z(e,t,i){for(var n=0,r=e.length,o=t;o<r&&n<64;){var a=e[o];if(!V(a))break;if(0===a&&o+1<r&&0===e[o+1])break;++o,++n}i.push(n-1);for(var s=t;s<o;++s)i.push(e[s]+256&255);return o}function H(e,t,i){for(var n=0,r=e.length,o=t;o<r&&n<64;){var a=e[o];if(0===a)break;if(V(a)&&o+1<r&&V(e[o+1]))break;++o,++n}i.push(64|n-1);for(var s=t;s<o;++s){var l=e[s];i.push(l+65536>>8&255,l+256&255)}return o}N.MACSTRING=function(e,t){var i=function(e){if(!B)for(var t in B={},M)B[t]=new String(t);var i=B[e];if(void 0!==i){if(F){var n=F.get(i);if(void 0!==n)return n}var r=M[e];if(void 0!==r){for(var o={},a=0;a<r.length;a++)o[r.charCodeAt(a)]=a+128;return F&&F.set(i,o),o}}}(t);if(void 0!==i){for(var n=[],r=0;r<e.length;r++){var o=e.charCodeAt(r);if(128<=o&&void 0===(o=i[o]))return;n[r]=o}return n}},D.MACSTRING=function(e,t){var i=N.MACSTRING(e,t);return void 0!==i?i.length:0},N.VARDELTAS=function(e){for(var t=0,i=[];t<e.length;){var n=e[t];t=0===n?U(e,t,i):-128<=n&&n<=127?z(e,t,i):H(e,t,i)}return i},N.INDEX=function(e){for(var t=1,i=[t],n=[],r=0;r<e.length;r+=1){var o=N.OBJECT(e[r]);Array.prototype.push.apply(n,o),t+=o.length,i.push(t)}if(0===n.length)return[0,0];for(var a=[],s=1+Math.floor(Math.log(t)/Math.log(2))/8|0,l=[void 0,N.BYTE,N.USHORT,N.UINT24,N.ULONG][s],c=0;c<i.length;c+=1){var d=l(i[c]);Array.prototype.push.apply(a,d)}return Array.prototype.concat(N.Card16(e.length),N.OffSize(s),a,n)},D.INDEX=function(e){return N.INDEX(e).length},N.DICT=function(e){for(var t=[],i=Object.keys(e),n=i.length,r=0;r<n;r+=1){var o=parseInt(i[r],0),a=e[o];t=(t=t.concat(N.OPERAND(a.value,a.type))).concat(N.OPERATOR(o))}return t},D.DICT=function(e){return N.DICT(e).length},N.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},N.OPERAND=function(e,t){var i=[];if(Array.isArray(t))for(var n=0;n<t.length;n+=1)A.argument(e.length===t.length,"Not enough arguments given for type"+t),i=i.concat(N.OPERAND(e[n],t[n]));else if("SID"===t)i=i.concat(N.NUMBER(e));else if("offset"===t)i=i.concat(N.NUMBER32(e));else if("number"===t)i=i.concat(N.NUMBER(e));else{if("real"!==t)throw new Error("Unknown operand type "+t);i=i.concat(N.REAL(e))}return i},N.OP=N.BYTE,D.OP=D.BYTE;var j="function"==typeof WeakMap&&new WeakMap;function q(e,t,i){for(var n=0;n<t.length;n+=1){var r=t[n];this[r.name]=r.value}if(this.tableName=e,this.fields=t,i)for(var o=Object.keys(i),a=0;a<o.length;a+=1){var s=o[a],l=i[s];void 0!==this[s]&&(this[s]=l)}}function $(e,t,i){void 0===i&&(i=t.length);var n=new Array(t.length+1);n[0]={name:e+"Count",type:"USHORT",value:i};for(var r=0;r<t.length;r++)n[r+1]={name:e+r,type:"USHORT",value:t[r]};return n}function W(e,t,i){var n=t.length,r=new Array(n+1);r[0]={name:e+"Count",type:"USHORT",value:n};for(var o=0;o<n;o++)r[o+1]={name:e+o,type:"TABLE",value:i(t[o],o)};return r}function G(e,t,i){var n=t.length,r=[];r[0]={name:e+"Count",type:"USHORT",value:n};for(var o=0;o<n;o++)r=r.concat(i(t[o],o));return r}function K(e){1===e.format?q.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat($("glyph",e.glyphs))):A.assert(!1,"Can't create coverage table format 2 yet.")}function Y(e){q.call(this,"scriptListTable",G("scriptRecord",e,(function(e,t){var i=e.script,n=i.defaultLangSys;return A.assert(!!n,"Unable to write GSUB: script "+e.tag+" has no default language system."),[{name:"scriptTag"+t,type:"TAG",value:e.tag},{name:"script"+t,type:"TABLE",value:new q("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new q("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:n.reqFeatureIndex}].concat($("featureIndex",n.featureIndexes)))}].concat(G("langSys",i.langSysRecords,(function(e,t){var i=e.langSys;return[{name:"langSysTag"+t,type:"TAG",value:e.tag},{name:"langSys"+t,type:"TABLE",value:new q("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:i.reqFeatureIndex}].concat($("featureIndex",i.featureIndexes)))}]}))))}]})))}function J(e){q.call(this,"featureListTable",G("featureRecord",e,(function(e,t){var i=e.feature;return[{name:"featureTag"+t,type:"TAG",value:e.tag},{name:"feature"+t,type:"TABLE",value:new q("featureTable",[{name:"featureParams",type:"USHORT",value:i.featureParams}].concat($("lookupListIndex",i.lookupListIndexes)))}]})))}function X(e,t){q.call(this,"lookupListTable",W("lookup",e,(function(e){var i=t[e.lookupType];return A.assert(!!i,"Unable to write GSUB lookup type "+e.lookupType+" tables."),new q("lookupTable",[{name:"lookupType",type:"USHORT",value:e.lookupType},{name:"lookupFlag",type:"USHORT",value:e.lookupFlag}].concat(W("subtable",e.subtables,i)))})))}N.CHARSTRING=function(e){if(j){var t=j.get(e);if(void 0!==t)return t}for(var i=[],n=e.length,r=0;r<n;r+=1){var o=e[r];i=i.concat(N[o.type](o.value))}return j&&j.set(e,i),i},D.CHARSTRING=function(e){return N.CHARSTRING(e).length},N.OBJECT=function(e){var t=N[e.type];return A.argument(void 0!==t,"No encoding function for type "+e.type),t(e.value)},D.OBJECT=function(e){var t=D[e.type];return A.argument(void 0!==t,"No sizeOf function for type "+e.type),t(e.value)},N.TABLE=function(e){for(var t=[],i=e.fields.length,n=[],r=[],o=0;o<i;o+=1){var a=e.fields[o],s=N[a.type];A.argument(void 0!==s,"No encoding function for field type "+a.type+" ("+a.name+")");var l=e[a.name];void 0===l&&(l=a.value);var c=s(l);"TABLE"===a.type?(r.push(t.length),t=t.concat([0,0]),n.push(c)):t=t.concat(c)}for(var d=0;d<n.length;d+=1){var u=r[d],p=t.length;A.argument(p<65536,"Table "+e.tableName+" too big."),t[u]=p>>8,t[u+1]=255&p,t=t.concat(n[d])}return t},D.TABLE=function(e){for(var t=0,i=e.fields.length,n=0;n<i;n+=1){var r=e.fields[n],o=D[r.type];A.argument(void 0!==o,"No sizeOf function for field type "+r.type+" ("+r.name+")");var a=e[r.name];void 0===a&&(a=r.value),t+=o(a),"TABLE"===r.type&&(t+=2)}return t},N.RECORD=N.TABLE,D.RECORD=D.TABLE,N.LITERAL=function(e){return e},D.LITERAL=function(e){return e.length},q.prototype.encode=function(){return N.TABLE(this)},q.prototype.sizeOf=function(){return D.TABLE(this)};var Q={Table:q,Record:q,Coverage:(K.prototype=Object.create(q.prototype)).constructor=K,ScriptList:(Y.prototype=Object.create(q.prototype)).constructor=Y,FeatureList:(J.prototype=Object.create(q.prototype)).constructor=J,LookupList:(X.prototype=Object.create(q.prototype)).constructor=X,ushortList:$,tableList:W,recordList:G};function Z(e,t){return e.getUint8(t)}function ee(e,t){return e.getUint16(t,!1)}function te(e,t){return e.getUint32(t,!1)}function ie(e,t){return e.getInt16(t,!1)+e.getUint16(t+2,!1)/65535}var ne={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function re(e,t){this.data=e,this.offset=t,this.relativeOffset=0}re.prototype.parseByte=function(){var e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},re.prototype.parseChar=function(){var e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},re.prototype.parseCard8=re.prototype.parseByte,re.prototype.parseCard16=re.prototype.parseUShort=function(){var e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},re.prototype.parseSID=re.prototype.parseUShort,re.prototype.parseOffset16=re.prototype.parseUShort,re.prototype.parseShort=function(){var e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},re.prototype.parseF2Dot14=function(){var e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},re.prototype.parseOffset32=re.prototype.parseULong=function(){var e=te(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},re.prototype.parseFixed=function(){var e=ie(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},re.prototype.parseString=function(e){var t=this.data,i=this.offset+this.relativeOffset,n="";this.relativeOffset+=e;for(var r=0;r<e;r++)n+=String.fromCharCode(t.getUint8(i+r));return n},re.prototype.parseTag=function(){return this.parseString(4)},re.prototype.parseLongDateTime=function(){var e=te(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},re.prototype.parseVersion=function(e){var t=ee(this.data,this.offset+this.relativeOffset),i=ee(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,void 0===e&&(e=4096),t+i/e/10},re.prototype.skip=function(e,t){void 0===t&&(t=1),this.relativeOffset+=ne[e]*t},re.prototype.parseULongList=function(e){void 0===e&&(e=this.parseULong());for(var t=new Array(e),i=this.data,n=this.offset+this.relativeOffset,r=0;r<e;r++)t[r]=i.getUint32(n),n+=4;return this.relativeOffset+=4*e,t},re.prototype.parseOffset16List=re.prototype.parseUShortList=function(e){void 0===e&&(e=this.parseUShort());for(var t=new Array(e),i=this.data,n=this.offset+this.relativeOffset,r=0;r<e;r++)t[r]=i.getUint16(n),n+=2;return this.relativeOffset+=2*e,t},re.prototype.parseShortList=function(e){for(var t=new Array(e),i=this.data,n=this.offset+this.relativeOffset,r=0;r<e;r++)t[r]=i.getInt16(n),n+=2;return this.relativeOffset+=2*e,t},re.prototype.parseByteList=function(e){for(var t=new Array(e),i=this.data,n=this.offset+this.relativeOffset,r=0;r<e;r++)t[r]=i.getUint8(n++);return this.relativeOffset+=e,t},re.prototype.parseList=function(e,t){t||(t=e,e=this.parseUShort());for(var i=new Array(e),n=0;n<e;n++)i[n]=t.call(this);return i},re.prototype.parseList32=function(e,t){t||(t=e,e=this.parseULong());for(var i=new Array(e),n=0;n<e;n++)i[n]=t.call(this);return i},re.prototype.parseRecordList=function(e,t){t||(t=e,e=this.parseUShort());for(var i=new Array(e),n=Object.keys(t),r=0;r<e;r++){for(var o={},a=0;a<n.length;a++){var s=n[a],l=t[s];o[s]=l.call(this)}i[r]=o}return i},re.prototype.parseRecordList32=function(e,t){t||(t=e,e=this.parseULong());for(var i=new Array(e),n=Object.keys(t),r=0;r<e;r++){for(var o={},a=0;a<n.length;a++){var s=n[a],l=t[s];o[s]=l.call(this)}i[r]=o}return i},re.prototype.parseStruct=function(e){if("function"==typeof e)return e.call(this);for(var t=Object.keys(e),i={},n=0;n<t.length;n++){var r=t[n],o=e[r];i[r]=o.call(this)}return i},re.prototype.parseValueRecord=function(e){if(void 0===e&&(e=this.parseUShort()),0!==e){var t={};return 1&e&&(t.xPlacement=this.parseShort()),2&e&&(t.yPlacement=this.parseShort()),4&e&&(t.xAdvance=this.parseShort()),8&e&&(t.yAdvance=this.parseShort()),16&e&&(t.xPlaDevice=void 0,this.parseShort()),32&e&&(t.yPlaDevice=void 0,this.parseShort()),64&e&&(t.xAdvDevice=void 0,this.parseShort()),128&e&&(t.yAdvDevice=void 0,this.parseShort()),t}},re.prototype.parseValueRecordList=function(){for(var e=this.parseUShort(),t=this.parseUShort(),i=new Array(t),n=0;n<t;n++)i[n]=this.parseValueRecord(e);return i},re.prototype.parsePointer=function(e){var t=this.parseOffset16();if(0<t)return new re(this.data,this.offset+t).parseStruct(e)},re.prototype.parsePointer32=function(e){var t=this.parseOffset32();if(0<t)return new re(this.data,this.offset+t).parseStruct(e)},re.prototype.parseListOfLists=function(e){for(var t=this,i=this.parseOffset16List(),n=i.length,r=this.relativeOffset,o=new Array(n),a=0;a<n;a++){var s=i[a];if(0!==s)if(t.relativeOffset=s,e){for(var l=t.parseOffset16List(),c=new Array(l.length),d=0;d<l.length;d++)t.relativeOffset=s+l[d],c[d]=e.call(t);o[a]=c}else o[a]=t.parseUShortList();else o[a]=void 0}return this.relativeOffset=r,o},re.prototype.parseCoverage=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort(),i=this.parseUShort();if(1===t)return{format:1,glyphs:this.parseUShortList(i)};if(2!==t)throw new Error("0x"+e.toString(16)+": Coverage format must be 1 or 2.");for(var n=new Array(i),r=0;r<i;r++)n[r]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:n}},re.prototype.parseClassDef=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(1===t)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(2===t)return{format:2,ranges:this.parseRecordList({start:re.uShort,end:re.uShort,classId:re.uShort})};throw new Error("0x"+e.toString(16)+": ClassDef format must be 1 or 2.")},re.list=function(e,t){return function(){return this.parseList(e,t)}},re.list32=function(e,t){return function(){return this.parseList32(e,t)}},re.recordList=function(e,t){return function(){return this.parseRecordList(e,t)}},re.recordList32=function(e,t){return function(){return this.parseRecordList32(e,t)}},re.pointer=function(e){return function(){return this.parsePointer(e)}},re.pointer32=function(e){return function(){return this.parsePointer32(e)}},re.tag=re.prototype.parseTag,re.byte=re.prototype.parseByte,re.uShort=re.offset16=re.prototype.parseUShort,re.uShortList=re.prototype.parseUShortList,re.uLong=re.offset32=re.prototype.parseULong,re.uLongList=re.prototype.parseULongList,re.struct=re.prototype.parseStruct,re.coverage=re.prototype.parseCoverage,re.classDef=re.prototype.parseClassDef;var oe={reserved:re.uShort,reqFeatureIndex:re.uShort,featureIndexes:re.uShortList};re.prototype.parseScriptList=function(){return this.parsePointer(re.recordList({tag:re.tag,script:re.pointer({defaultLangSys:re.pointer(oe),langSysRecords:re.recordList({tag:re.tag,langSys:re.pointer(oe)})})}))||[]},re.prototype.parseFeatureList=function(){return this.parsePointer(re.recordList({tag:re.tag,feature:re.pointer({featureParams:re.offset16,lookupListIndexes:re.uShortList})}))||[]},re.prototype.parseLookupList=function(e){return this.parsePointer(re.list(re.pointer((function(){var t=this.parseUShort();A.argument(1<=t&&t<=9,"GPOS/GSUB lookup type "+t+" unknown.");var i=this.parseUShort(),n=16&i;return{lookupType:t,lookupFlag:i,subtables:this.parseList(re.pointer(e[t])),markFilteringSet:n?this.parseUShort():void 0}}))))||[]},re.prototype.parseFeatureVariationsList=function(){return this.parsePointer32((function(){var e=this.parseUShort(),t=this.parseUShort();return A.argument(1===e&&t<1,"GPOS/GSUB feature variations table unknown."),this.parseRecordList32({conditionSetOffset:re.offset32,featureTableSubstitutionOffset:re.offset32})}))||[]};var ae={getByte:Z,getCard8:Z,getUShort:ee,getCard16:ee,getShort:function(e,t){return e.getInt16(t,!1)},getULong:te,getFixed:ie,getTag:function(e,t){for(var i="",n=t;n<t+4;n+=1)i+=String.fromCharCode(e.getInt8(n));return i},getOffset:function(e,t,i){for(var n=0,r=0;r<i;r+=1)n<<=8,n+=e.getUint8(t+r);return n},getBytes:function(e,t,i){for(var n=[],r=t;r<i;r+=1)n.push(e.getUint8(r));return n},bytesToString:function(e){for(var t="",i=0;i<e.length;i+=1)t+=String.fromCharCode(e[i]);return t},Parser:re},se=function(e,t){var i={};i.version=ae.getUShort(e,t),A.argument(0===i.version,"cmap table version should be 0."),i.numTables=ae.getUShort(e,t+2);for(var n=-1,r=i.numTables-1;0<=r;r-=1){var o=ae.getUShort(e,t+4+8*r),a=ae.getUShort(e,t+4+8*r+2);if(3===o&&(0===a||1===a||10===a)||0===o&&(0===a||1===a||2===a||3===a||4===a)){n=ae.getULong(e,t+4+8*r+4);break}}if(-1===n)throw new Error("No valid cmap sub-tables found.");var s=new ae.Parser(e,t+n);if(i.format=s.parseUShort(),12===i.format)!function(e,t){var i;t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong(),e.groupCount=i=t.parseULong(),e.glyphIndexMap={};for(var n=0;n<i;n+=1)for(var r=t.parseULong(),o=t.parseULong(),a=t.parseULong(),s=r;s<=o;s+=1)e.glyphIndexMap[s]=a,a++}(i,s);else{if(4!==i.format)throw new Error("Only format 4 and 12 cmap tables are supported (found format "+i.format+").");!function(e,t,i,n,r){var o;e.length=t.parseUShort(),e.language=t.parseUShort(),e.segCount=o=t.parseUShort()>>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new ae.Parser(i,n+r+14),s=new ae.Parser(i,n+r+16+2*o),l=new ae.Parser(i,n+r+16+4*o),c=new ae.Parser(i,n+r+16+6*o),d=n+r+16+8*o,u=0;u<o-1;u+=1)for(var p=void 0,h=a.parseUShort(),f=s.parseUShort(),m=l.parseShort(),g=c.parseUShort(),v=f;v<=h;v+=1)0!==g?(d=c.offset+c.relativeOffset-2,d+=g,d+=2*(v-f),0!==(p=ae.getUShort(i,d))&&(p=p+m&65535)):p=v+m&65535,e.glyphIndexMap[v]=p}(i,s,e,t,n)}return i},le=function(e){var t,i=!0;for(t=e.length-1;0<t;t-=1)if(65535<e.get(t).unicode){console.log("Adding CMAP format 12 (needed!)"),i=!1;break}var n=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:i?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:i?12:20}];i||(n=n.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),n=n.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);var r,o,a,s=new Q.Table("cmap",n);for(s.segments=[],t=0;t<e.length;t+=1){for(var l=e.get(t),c=0;c<l.unicodes.length;c+=1)r=s,o=l.unicodes[c],a=t,r.segments.push({end:o,start:o,delta:-(o-a),offset:0,glyphIndex:a});s.segments=s.segments.sort((function(e,t){return e.start-t.start}))}s.segments.push({end:65535,start:65535,delta:1,offset:0});var d=s.segments.length,u=0,p=[],h=[],f=[],m=[],g=[],v=[];for(t=0;t<d;t+=1){var y=s.segments[t];y.end<=65535&&y.start<=65535?(p=p.concat({name:"end_"+t,type:"USHORT",value:y.end}),h=h.concat({name:"start_"+t,type:"USHORT",value:y.start}),f=f.concat({name:"idDelta_"+t,type:"SHORT",value:y.delta}),m=m.concat({name:"idRangeOffset_"+t,type:"USHORT",value:y.offset}),void 0!==y.glyphId&&(g=g.concat({name:"glyph_"+t,type:"USHORT",value:y.glyphId}))):u+=1,i||void 0===y.glyphIndex||(v=(v=(v=v.concat({name:"cmap12Start_"+t,type:"ULONG",value:y.start})).concat({name:"cmap12End_"+t,type:"ULONG",value:y.end})).concat({name:"cmap12Glyph_"+t,type:"ULONG",value:y.glyphIndex}))}if(s.segCountX2=2*(d-u),s.searchRange=2*Math.pow(2,Math.floor(Math.log(d-u)/Math.log(2))),s.entrySelector=Math.log(s.searchRange/2)/Math.log(2),s.rangeShift=s.segCountX2-s.searchRange,s.fields=s.fields.concat(p),s.fields.push({name:"reservedPad",type:"USHORT",value:0}),s.fields=s.fields.concat(h),s.fields=s.fields.concat(f),s.fields=s.fields.concat(m),s.fields=s.fields.concat(g),s.cmap4Length=14+2*p.length+2+2*h.length+2*f.length+2*m.length+2*g.length,!i){var b=16+4*v.length;s.cmap12Offset=20+s.cmap4Length,s.fields=s.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:b},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:v.length/3}]),s.fields=s.fields.concat(v)}return s},ce=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],de=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],ue=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],pe=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function he(e){this.font=e}function fe(e){this.cmap=e}function me(e,t){this.encoding=e,this.charset=t}function ge(e){switch(e.version){case 1:this.names=pe.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(var t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<pe.length?this.names[t]=pe[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-pe.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(var i=0;i<e.numberOfGlyphs;i++)this.names[i]=pe[i+e.glyphNameIndex[i]];break;case 3:default:this.names=[]}}he.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),i=this.font.glyphs;if(i)for(var n=0;n<i.length;n+=1)for(var r=i.get(n),o=0;o<r.unicodes.length;o+=1)if(r.unicodes[o]===t)return n;return null},fe.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0},me.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),i=this.encoding[t];return this.charset.indexOf(i)},ge.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},ge.prototype.glyphIndexToName=function(e){return this.names[e]};var ve=function(e,t,i,n,r){e.beginPath(),e.moveTo(t,i),e.lineTo(n,r),e.stroke()};function ye(e){this.bindConstructorValues(e)}function be(e,t,i){Object.defineProperty(e,t,{get:function(){return e.path,e[i]},set:function(t){e[i]=t},enumerable:!0,configurable:!0})}function we(e,t){if(this.font=e,this.glyphs={},Array.isArray(t))for(var i=0;i<t.length;i++)this.glyphs[i]=t[i];this.length=t&&t.length||0}ye.prototype.bindConstructorValues=function(e){var t,i;this.index=e.index||0,this.name=e.name||null,this.unicode=e.unicode||void 0,this.unicodes=e.unicodes||void 0!==e.unicode?[e.unicode]:[],e.xMin&&(this.xMin=e.xMin),e.yMin&&(this.yMin=e.yMin),e.xMax&&(this.xMax=e.xMax),e.yMax&&(this.yMax=e.yMax),e.advanceWidth&&(this.advanceWidth=e.advanceWidth),Object.defineProperty(this,"path",(t=e.path,i=t||new T,{configurable:!0,get:function(){return"function"==typeof i&&(i=i()),i},set:function(e){i=e}}))},ye.prototype.addUnicode=function(e){0===this.unicodes.length&&(this.unicode=e),this.unicodes.push(e)},ye.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},ye.prototype.getPath=function(e,t,i,n,r){var o,a;e=void 0!==e?e:0,t=void 0!==t?t:0,i=void 0!==i?i:72,n||(n={});var s=n.xScale,l=n.yScale;if(n.hinting&&r&&r.hinting&&(a=this.path&&r.hinting.exec(this,i)),a)o=r.hinting.getCommands(a),e=Math.round(e),t=Math.round(t),s=l=1;else{o=this.path.commands;var c=1/this.path.unitsPerEm*i;void 0===s&&(s=c),void 0===l&&(l=c)}for(var d=new T,u=0;u<o.length;u+=1){var p=o[u];"M"===p.type?d.moveTo(e+p.x*s,t+-p.y*l):"L"===p.type?d.lineTo(e+p.x*s,t+-p.y*l):"Q"===p.type?d.quadraticCurveTo(e+p.x1*s,t+-p.y1*l,e+p.x*s,t+-p.y*l):"C"===p.type?d.curveTo(e+p.x1*s,t+-p.y1*l,e+p.x2*s,t+-p.y2*l,e+p.x*s,t+-p.y*l):"Z"===p.type&&d.closePath()}return d},ye.prototype.getContours=function(){if(void 0===this.points)return[];for(var e=[],t=[],i=0;i<this.points.length;i+=1){var n=this.points[i];t.push(n),n.lastPointOfContour&&(e.push(t),t=[])}return A.argument(0===t.length,"There are still points left in the current contour."),e},ye.prototype.getMetrics=function(){for(var e=this.path.commands,t=[],i=[],n=0;n<e.length;n+=1){var r=e[n];"Z"!==r.type&&(t.push(r.x),i.push(r.y)),"Q"!==r.type&&"C"!==r.type||(t.push(r.x1),i.push(r.y1)),"C"===r.type&&(t.push(r.x2),i.push(r.y2))}var o={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,i),xMax:Math.max.apply(null,t),yMax:Math.max.apply(null,i),leftSideBearing:this.leftSideBearing};return isFinite(o.xMin)||(o.xMin=0),isFinite(o.xMax)||(o.xMax=this.advanceWidth),isFinite(o.yMin)||(o.yMin=0),isFinite(o.yMax)||(o.yMax=0),o.rightSideBearing=this.advanceWidth-o.leftSideBearing-(o.xMax-o.xMin),o},ye.prototype.draw=function(e,t,i,n,r){this.getPath(t,i,n,r).draw(e)},ye.prototype.drawPoints=function(e,t,i,n){function r(t,i,n,r){var o=2*Math.PI;e.beginPath();for(var a=0;a<t.length;a+=1)e.moveTo(i+t[a].x*r,n+t[a].y*r),e.arc(i+t[a].x*r,n+t[a].y*r,2,0,o,!1);e.closePath(),e.fill()}t=void 0!==t?t:0,i=void 0!==i?i:0,n=void 0!==n?n:24;for(var o=1/this.path.unitsPerEm*n,a=[],s=[],l=this.path,c=0;c<l.commands.length;c+=1){var d=l.commands[c];void 0!==d.x&&a.push({x:d.x,y:-d.y}),void 0!==d.x1&&s.push({x:d.x1,y:-d.y1}),void 0!==d.x2&&s.push({x:d.x2,y:-d.y2})}e.fillStyle="blue",r(a,t,i,o),e.fillStyle="red",r(s,t,i,o)},ye.prototype.drawMetrics=function(e,t,i,n){var r;t=void 0!==t?t:0,i=void 0!==i?i:0,n=void 0!==n?n:24,r=1/this.path.unitsPerEm*n,e.lineWidth=1,e.strokeStyle="black",ve(e,t,-1e4,t,1e4),ve(e,-1e4,i,1e4,i);var o=this.xMin||0,a=this.yMin||0,s=this.xMax||0,l=this.yMax||0,c=this.advanceWidth||0;e.strokeStyle="blue",ve(e,t+o*r,-1e4,t+o*r,1e4),ve(e,t+s*r,-1e4,t+s*r,1e4),ve(e,-1e4,i+-a*r,1e4,i+-a*r),ve(e,-1e4,i+-l*r,1e4,i+-l*r),e.strokeStyle="green",ve(e,t+c*r,-1e4,t+c*r,1e4)},we.prototype.get=function(e){return"function"==typeof this.glyphs[e]&&(this.glyphs[e]=this.glyphs[e]()),this.glyphs[e]},we.prototype.push=function(e,t){this.glyphs[e]=t,this.length++};var Se={GlyphSet:we,glyphLoader:function(e,t){return new ye({index:t,font:e})},ttfGlyphLoader:function(e,t,i,n,r,o){return function(){var a=new ye({index:t,font:e});return a.path=function(){i(a,n,r);var t=o(e.glyphs,a);return t.unitsPerEm=e.unitsPerEm,t},be(a,"xMin","_xMin"),be(a,"xMax","_xMax"),be(a,"yMin","_yMin"),be(a,"yMax","_yMax"),a}},cffGlyphLoader:function(e,t,i,n){return function(){var r=new ye({index:t,font:e});return r.path=function(){var t=i(e,r,n);return t.unitsPerEm=e.unitsPerEm,t},r}}};function Ce(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i+=1)if(!Ce(e[i],t[i]))return!1;return!0}return!1}function ke(e){return e.length<1240?107:e.length<33900?1131:32768}function xe(e,t,i){var n,r,o=[],a=[],s=ae.getCard16(e,t);if(0!==s){var l=ae.getByte(e,t+2);n=t+(s+1)*l+2;for(var c=t+3,d=0;d<s+1;d+=1)o.push(ae.getOffset(e,c,l)),c+=l;r=n+o[s]}else r=t+2;for(var u=0;u<o.length-1;u+=1){var p=ae.getBytes(e,n+o[u],n+o[u+1]);i&&(p=i(p)),a.push(p)}return{objects:a,startOffset:t,endOffset:r}}function _e(e,t){if(28===t)return e.parseByte()<<8|e.parseByte();if(29===t)return e.parseByte()<<24|e.parseByte()<<16|e.parseByte()<<8|e.parseByte();if(30===t)return function(e){for(var t="",i=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var n=e.parseByte(),r=n>>4,o=15&n;if(15===r)break;if(t+=i[r],15===o)break;t+=i[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Ee(e,t,i){t=void 0!==t?t:0;var n=new ae.Parser(e,t),r=[],o=[];for(i=void 0!==i?i:e.length;n.relativeOffset<i;){var a=n.parseByte();a<=21?(12===a&&(a=1200+n.parseByte()),r.push([a,o]),o=[]):o.push(_e(n,a))}return function(e){for(var t={},i=0;i<e.length;i+=1){var n,r=e[i][0],o=e[i][1];if(n=1===o.length?o[0]:o,t.hasOwnProperty(r)&&!isNaN(t[r]))throw new Error("Object "+t+" already has key "+r);t[r]=n}return t}(r)}function Te(e,t){return t<=390?ce[t]:e[t-391]}function Pe(e,t,i){for(var n,r={},o=0;o<t.length;o+=1){var a=t[o];if(Array.isArray(a.type)){var s=[];s.length=a.type.length;for(var l=0;l<a.type.length;l++)void 0===(n=void 0!==e[a.op]?e[a.op][l]:void 0)&&(n=void 0!==a.value&&void 0!==a.value[l]?a.value[l]:null),"SID"===a.type[l]&&(n=Te(i,n)),s[l]=n;r[a.name]=s}else void 0===(n=e[a.op])&&(n=void 0!==a.value?a.value:null),"SID"===a.type&&(n=Te(i,n)),r[a.name]=n}return r}var Ie=[{name:"version",op:0,type:"SID"},{name:"notice",op:1,type:"SID"},{name:"copyright",op:1200,type:"SID"},{name:"fullName",op:2,type:"SID"},{name:"familyName",op:3,type:"SID"},{name:"weight",op:4,type:"SID"},{name:"isFixedPitch",op:1201,type:"number",value:0},{name:"italicAngle",op:1202,type:"number",value:0},{name:"underlinePosition",op:1203,type:"number",value:-100},{name:"underlineThickness",op:1204,type:"number",value:50},{name:"paintType",op:1205,type:"number",value:0},{name:"charstringType",op:1206,type:"number",value:2},{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"uniqueId",op:13,type:"number"},{name:"fontBBox",op:5,type:["number","number","number","number"],value:[0,0,0,0]},{name:"strokeWidth",op:1208,type:"number",value:0},{name:"xuid",op:14,type:[],value:null},{name:"charset",op:15,type:"offset",value:0},{name:"encoding",op:16,type:"offset",value:0},{name:"charStrings",op:17,type:"offset",value:0},{name:"private",op:18,type:["number","offset"],value:[0,0]},{name:"ros",op:1230,type:["SID","SID","number"]},{name:"cidFontVersion",op:1231,type:"number",value:0},{name:"cidFontRevision",op:1232,type:"number",value:0},{name:"cidFontType",op:1233,type:"number",value:0},{name:"cidCount",op:1234,type:"number",value:8720},{name:"uidBase",op:1235,type:"number"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"fontName",op:1238,type:"SID"}],Ae=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}];function Re(e,t,i,n){return Pe(Ee(e,t,i),Ae,n)}function Oe(e,t,i,n){for(var r,o,a=[],s=0;s<i.length;s+=1){var l=(o=n,Pe(Ee(r=new DataView(new Uint8Array(i[s]).buffer),0,r.byteLength),Ie,o));l._subrs=[],l._subrsBias=0;var c=l.private[0],d=l.private[1];if(0!==c&&0!==d){var u=Re(e,d+t,c,n);if(l._defaultWidthX=u.defaultWidthX,l._nominalWidthX=u.nominalWidthX,0!==u.subrs){var p=xe(e,d+u.subrs+t);l._subrs=p.objects,l._subrsBias=ke(l._subrs)}l._privateDict=u}a.push(l)}return a}function Ne(e,t,i){var n,r,o,a,s,l,c,d,u=new T,p=[],h=0,f=!1,m=!1,g=0,v=0;if(e.isCIDFont){var y=e.tables.cff.topDict._fdSelect[t.index],b=e.tables.cff.topDict._fdArray[y];s=b._subrs,l=b._subrsBias,c=b._defaultWidthX,d=b._nominalWidthX}else s=e.tables.cff.topDict._subrs,l=e.tables.cff.topDict._subrsBias,c=e.tables.cff.topDict._defaultWidthX,d=e.tables.cff.topDict._nominalWidthX;var w=c;function S(e,t){m&&u.closePath(),u.moveTo(e,t),m=!0}function C(){p.length%2!=0&&!f&&(w=p.shift()+d),h+=p.length>>1,p.length=0,f=!0}return function i(c){for(var y,b,k,x,_,E,T,P,I,A,R,O,N=0;N<c.length;){var D=c[N];switch(N+=1,D){case 1:case 3:C();break;case 4:1<p.length&&!f&&(w=p.shift()+d,f=!0),v+=p.pop(),S(g,v);break;case 5:for(;0<p.length;)g+=p.shift(),v+=p.shift(),u.lineTo(g,v);break;case 6:for(;0<p.length&&(g+=p.shift(),u.lineTo(g,v),0!==p.length);)v+=p.shift(),u.lineTo(g,v);break;case 7:for(;0<p.length&&(v+=p.shift(),u.lineTo(g,v),0!==p.length);)g+=p.shift(),u.lineTo(g,v);break;case 8:for(;0<p.length;)n=g+p.shift(),r=v+p.shift(),o=n+p.shift(),a=r+p.shift(),g=o+p.shift(),v=a+p.shift(),u.curveTo(n,r,o,a,g,v);break;case 10:_=p.pop()+l,(E=s[_])&&i(E);break;case 11:return;case 12:switch(D=c[N],N+=1,D){case 35:n=g+p.shift(),r=v+p.shift(),o=n+p.shift(),a=r+p.shift(),T=o+p.shift(),P=a+p.shift(),I=T+p.shift(),A=P+p.shift(),R=I+p.shift(),O=A+p.shift(),g=R+p.shift(),v=O+p.shift(),p.shift(),u.curveTo(n,r,o,a,T,P),u.curveTo(I,A,R,O,g,v);break;case 34:n=g+p.shift(),r=v,o=n+p.shift(),a=r+p.shift(),T=o+p.shift(),P=a,I=T+p.shift(),A=a,R=I+p.shift(),O=v,g=R+p.shift(),u.curveTo(n,r,o,a,T,P),u.curveTo(I,A,R,O,g,v);break;case 36:n=g+p.shift(),r=v+p.shift(),o=n+p.shift(),a=r+p.shift(),T=o+p.shift(),P=a,I=T+p.shift(),A=a,R=I+p.shift(),O=A+p.shift(),g=R+p.shift(),u.curveTo(n,r,o,a,T,P),u.curveTo(I,A,R,O,g,v);break;case 37:n=g+p.shift(),r=v+p.shift(),o=n+p.shift(),a=r+p.shift(),T=o+p.shift(),P=a+p.shift(),I=T+p.shift(),A=P+p.shift(),R=I+p.shift(),O=A+p.shift(),Math.abs(R-g)>Math.abs(O-v)?g=R+p.shift():v=O+p.shift(),u.curveTo(n,r,o,a,T,P),u.curveTo(I,A,R,O,g,v);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+D),p.length=0}break;case 14:0<p.length&&!f&&(w=p.shift()+d,f=!0),m&&(u.closePath(),m=!1);break;case 18:C();break;case 19:case 20:C(),N+=h+7>>3;break;case 21:2<p.length&&!f&&(w=p.shift()+d,f=!0),v+=p.pop(),S(g+=p.pop(),v);break;case 22:1<p.length&&!f&&(w=p.shift()+d,f=!0),S(g+=p.pop(),v);break;case 23:C();break;case 24:for(;2<p.length;)n=g+p.shift(),r=v+p.shift(),o=n+p.shift(),a=r+p.shift(),g=o+p.shift(),v=a+p.shift(),u.curveTo(n,r,o,a,g,v);g+=p.shift(),v+=p.shift(),u.lineTo(g,v);break;case 25:for(;6<p.length;)g+=p.shift(),v+=p.shift(),u.lineTo(g,v);n=g+p.shift(),r=v+p.shift(),o=n+p.shift(),a=r+p.shift(),g=o+p.shift(),v=a+p.shift(),u.curveTo(n,r,o,a,g,v);break;case 26:for(p.length%2&&(g+=p.shift());0<p.length;)n=g,r=v+p.shift(),o=n+p.shift(),a=r+p.shift(),g=o,v=a+p.shift(),u.curveTo(n,r,o,a,g,v);break;case 27:for(p.length%2&&(v+=p.shift());0<p.length;)n=g+p.shift(),r=v,o=n+p.shift(),a=r+p.shift(),g=o+p.shift(),v=a,u.curveTo(n,r,o,a,g,v);break;case 28:y=c[N],b=c[N+1],p.push((y<<24|b<<16)>>16),N+=2;break;case 29:_=p.pop()+e.gsubrsBias,(E=e.gsubrs[_])&&i(E);break;case 30:for(;0<p.length&&(n=g,r=v+p.shift(),o=n+p.shift(),a=r+p.shift(),g=o+p.shift(),v=a+(1===p.length?p.shift():0),u.curveTo(n,r,o,a,g,v),0!==p.length);)n=g+p.shift(),r=v,o=n+p.shift(),a=r+p.shift(),v=a+p.shift(),g=o+(1===p.length?p.shift():0),u.curveTo(n,r,o,a,g,v);break;case 31:for(;0<p.length&&(n=g+p.shift(),r=v,o=n+p.shift(),a=r+p.shift(),v=a+p.shift(),g=o+(1===p.length?p.shift():0),u.curveTo(n,r,o,a,g,v),0!==p.length);)n=g,r=v+p.shift(),o=n+p.shift(),a=r+p.shift(),g=o+p.shift(),v=a+(1===p.length?p.shift():0),u.curveTo(n,r,o,a,g,v);break;default:D<32?console.log("Glyph "+t.index+": unknown operator "+D):D<247?p.push(D-139):D<251?(y=c[N],N+=1,p.push(256*(D-247)+y+108)):D<255?(y=c[N],N+=1,p.push(256*-(D-251)-y-108)):(y=c[N],b=c[N+1],k=c[N+2],x=c[N+3],N+=4,p.push((y<<24|b<<16|k<<8|x)/65536))}}}(i),t.advanceWidth=w,u}function De(e,t){var i,n=ce.indexOf(e);return 0<=n&&(i=n),0<=(n=t.indexOf(e))?i=n+ce.length:(i=ce.length+t.length,t.push(e)),i}function Le(e,t,i){for(var n={},r=0;r<e.length;r+=1){var o=e[r],a=t[o.name];void 0===a||Ce(a,o.value)||("SID"===o.type&&(a=De(a,i)),n[o.op]={name:o.name,type:o.type,value:a})}return n}function Me(e,t){var i=new Q.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return i.dict=Le(Ie,e,t),i}function Be(e){var t=new Q.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return t.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],t}function Fe(e){var t=[],i=e.path;t.push({name:"width",type:"NUMBER",value:e.advanceWidth});for(var n=0,r=0,o=0;o<i.commands.length;o+=1){var a=void 0,s=void 0,l=i.commands[o];if("Q"===l.type&&(l={type:"C",x:l.x,y:l.y,x1:1/3*n+2/3*l.x1,y1:1/3*r+2/3*l.y1,x2:1/3*l.x+2/3*l.x1,y2:1/3*l.y+2/3*l.y1}),"M"===l.type)a=Math.round(l.x-n),s=Math.round(l.y-r),t.push({name:"dx",type:"NUMBER",value:a}),t.push({name:"dy",type:"NUMBER",value:s}),t.push({name:"rmoveto",type:"OP",value:21}),n=Math.round(l.x),r=Math.round(l.y);else if("L"===l.type)a=Math.round(l.x-n),s=Math.round(l.y-r),t.push({name:"dx",type:"NUMBER",value:a}),t.push({name:"dy",type:"NUMBER",value:s}),t.push({name:"rlineto",type:"OP",value:5}),n=Math.round(l.x),r=Math.round(l.y);else if("C"===l.type){var c=Math.round(l.x1-n),d=Math.round(l.y1-r),u=Math.round(l.x2-l.x1),p=Math.round(l.y2-l.y1);a=Math.round(l.x-l.x2),s=Math.round(l.y-l.y2),t.push({name:"dx1",type:"NUMBER",value:c}),t.push({name:"dy1",type:"NUMBER",value:d}),t.push({name:"dx2",type:"NUMBER",value:u}),t.push({name:"dy2",type:"NUMBER",value:p}),t.push({name:"dx",type:"NUMBER",value:a}),t.push({name:"dy",type:"NUMBER",value:s}),t.push({name:"rrcurveto",type:"OP",value:8}),n=Math.round(l.x),r=Math.round(l.y)}}return t.push({name:"endchar",type:"OP",value:14}),t}var Ve=function(e,t,i){i.tables.cff={};var n,r,o,a=xe(e,xe(e,(n=e,r=t,(o={}).formatMajor=ae.getCard8(n,r),o.formatMinor=ae.getCard8(n,r+1),o.size=ae.getCard8(n,r+2),o.offsetSize=ae.getCard8(n,r+3),o.startOffset=r,o.endOffset=r+4,o).endOffset,ae.bytesToString).endOffset),s=xe(e,a.endOffset,ae.bytesToString),l=xe(e,s.endOffset);i.gsubrs=l.objects,i.gsubrsBias=ke(i.gsubrs);var c=Oe(e,t,a.objects,s.objects);if(1!==c.length)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+c.length);var d=c[0];if((i.tables.cff.topDict=d)._privateDict&&(i.defaultWidthX=d._privateDict.defaultWidthX,i.nominalWidthX=d._privateDict.nominalWidthX),void 0!==d.ros[0]&&void 0!==d.ros[1]&&(i.isCIDFont=!0),i.isCIDFont){var u=d.fdArray,p=d.fdSelect;if(0===u||0===p)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");var h=Oe(e,t,xe(e,u+=t).objects,s.objects);d._fdArray=h,p+=t,d._fdSelect=function(e,t,i,n){var r,o=[],a=new ae.Parser(e,t),s=a.parseCard8();if(0===s)for(var l=0;l<i;l++){if(n<=(r=a.parseCard8()))throw new Error("CFF table CID Font FDSelect has bad FD index value "+r+" (FD count "+n+")");o.push(r)}else{if(3!==s)throw new Error("CFF Table CID Font FDSelect table has unsupported format "+s);var c,d=a.parseCard16(),u=a.parseCard16();if(0!==u)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+u);for(var p=0;p<d;p++){if(r=a.parseCard8(),c=a.parseCard16(),n<=r)throw new Error("CFF table CID Font FDSelect has bad FD index value "+r+" (FD count "+n+")");if(i<c)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+c);for(;u<c;u++)o.push(r);u=c}if(c!==i)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+c)}return o}(e,p,i.numGlyphs,h.length)}var f=t+d.private[1],m=Re(e,f,d.private[0],s.objects);if(i.defaultWidthX=m.defaultWidthX,i.nominalWidthX=m.nominalWidthX,0!==m.subrs){var g=xe(e,f+m.subrs);i.subrs=g.objects,i.subrsBias=ke(i.subrs)}else i.subrs=[],i.subrsBias=0;var v=xe(e,t+d.charStrings);i.nGlyphs=v.objects.length;var y=function(e,t,i,n){var r,o,a=new ae.Parser(e,t);i-=1;var s=[".notdef"],l=a.parseCard8();if(0===l)for(var c=0;c<i;c+=1)r=a.parseSID(),s.push(Te(n,r));else if(1===l)for(;s.length<=i;){r=a.parseSID(),o=a.parseCard8();for(var d=0;d<=o;d+=1)s.push(Te(n,r)),r+=1}else{if(2!==l)throw new Error("Unknown charset format "+l);for(;s.length<=i;){r=a.parseSID(),o=a.parseCard16();for(var u=0;u<=o;u+=1)s.push(Te(n,r)),r+=1}}return s}(e,t+d.charset,i.nGlyphs,s.objects);0===d.encoding?i.cffEncoding=new me(de,y):1===d.encoding?i.cffEncoding=new me(ue,y):i.cffEncoding=function(e,t,i){var n,r={},o=new ae.Parser(e,t),a=o.parseCard8();if(0===a)for(var s=o.parseCard8(),l=0;l<s;l+=1)r[n=o.parseCard8()]=l;else{if(1!==a)throw new Error("Unknown encoding format "+a);var c=o.parseCard8();n=1;for(var d=0;d<c;d+=1)for(var u=o.parseCard8(),p=o.parseCard8(),h=u;h<=u+p;h+=1)r[h]=n,n+=1}return new me(r,i)}(e,t+d.encoding,y),i.encoding=i.encoding||i.cffEncoding,i.glyphs=new Se.GlyphSet(i);for(var b=0;b<i.nGlyphs;b+=1){var w=v.objects[b];i.glyphs.push(b,Se.cffGlyphLoader(i,b,Ne,w))}},Ue=function(e,t){for(var i,n=new Q.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),r=1/t.unitsPerEm,o={version:t.version,fullName:t.fullName,familyName:t.familyName,weight:t.weightName,fontBBox:t.fontBBox||[0,0,0,0],fontMatrix:[r,0,0,r,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},a=[],s=1;s<e.length;s+=1)i=e.get(s),a.push(i.name);var l=[];n.header=new Q.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}]),n.nameIndex=function(e){var t=new Q.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);t.names=[];for(var i=0;i<e.length;i+=1)t.names.push({name:"name_"+i,type:"NAME",value:e[i]});return t}([t.postScriptName]);var c,d,u,p=Me(o,l);n.topDictIndex=Be(p),n.globalSubrIndex=new Q.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}]),n.charsets=function(e,t){for(var i=new Q.Record("Charsets",[{name:"format",type:"Card8",value:0}]),n=0;n<e.length;n+=1){var r=De(e[n],t);i.fields.push({name:"glyph_"+n,type:"SID",value:r})}return i}(a,l),n.charStringsIndex=function(e){for(var t=new Q.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),i=0;i<e.length;i+=1){var n=e.get(i),r=Fe(n);t.charStrings.push({name:n.name,type:"CHARSTRING",value:r})}return t}(e),n.privateDict=(c={},d=l,(u=new Q.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}])).dict=Le(Ae,c,d),u),n.stringIndex=function(e){var t=new Q.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);t.strings=[];for(var i=0;i<e.length;i+=1)t.strings.push({name:"string_"+i,type:"STRING",value:e[i]});return t}(l);var h=n.header.sizeOf()+n.nameIndex.sizeOf()+n.topDictIndex.sizeOf()+n.stringIndex.sizeOf()+n.globalSubrIndex.sizeOf();return o.charset=h,o.encoding=0,o.charStrings=o.charset+n.charsets.sizeOf(),o.private[1]=o.charStrings+n.charStringsIndex.sizeOf(),p=Me(o,l),n.topDictIndex=Be(p),n},ze=function(e,t){var i={},n=new ae.Parser(e,t);return i.version=n.parseVersion(),i.fontRevision=Math.round(1e3*n.parseFixed())/1e3,i.checkSumAdjustment=n.parseULong(),i.magicNumber=n.parseULong(),A.argument(1594834165===i.magicNumber,"Font header has wrong magic number."),i.flags=n.parseUShort(),i.unitsPerEm=n.parseUShort(),i.created=n.parseLongDateTime(),i.modified=n.parseLongDateTime(),i.xMin=n.parseShort(),i.yMin=n.parseShort(),i.xMax=n.parseShort(),i.yMax=n.parseShort(),i.macStyle=n.parseUShort(),i.lowestRecPPEM=n.parseUShort(),i.fontDirectionHint=n.parseShort(),i.indexToLocFormat=n.parseShort(),i.glyphDataFormat=n.parseShort(),i},He=function(e){var t=Math.round((new Date).getTime()/1e3)+2082844800,i=t;return e.createdTimestamp&&(i=e.createdTimestamp+2082844800),new Q.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:i},{name:"modified",type:"LONGDATETIME",value:t},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],e)},je=function(e,t){var i={},n=new ae.Parser(e,t);return i.version=n.parseVersion(),i.ascender=n.parseShort(),i.descender=n.parseShort(),i.lineGap=n.parseShort(),i.advanceWidthMax=n.parseUShort(),i.minLeftSideBearing=n.parseShort(),i.minRightSideBearing=n.parseShort(),i.xMaxExtent=n.parseShort(),i.caretSlopeRise=n.parseShort(),i.caretSlopeRun=n.parseShort(),i.caretOffset=n.parseShort(),n.relativeOffset+=8,i.metricDataFormat=n.parseShort(),i.numberOfHMetrics=n.parseUShort(),i},qe=function(e){return new Q.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],e)},$e=function(e,t,i,n,r){for(var o,a,s=new ae.Parser(e,t),l=0;l<n;l+=1){l<i&&(o=s.parseUShort(),a=s.parseShort());var c=r.get(l);c.advanceWidth=o,c.leftSideBearing=a}},We=function(e){for(var t=new Q.Table("hmtx",[]),i=0;i<e.length;i+=1){var n=e.get(i),r=n.advanceWidth||0,o=n.leftSideBearing||0;t.fields.push({name:"advanceWidth_"+i,type:"USHORT",value:r}),t.fields.push({name:"leftSideBearing_"+i,type:"SHORT",value:o})}return t},Ge=function(e){for(var t=new Q.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:e.length}]),i="",n=12+4*e.length,r=0;r<e.length;++r){var o=i.indexOf(e[r]);o<0&&(o=i.length,i+=e[r]),t.fields.push({name:"offset "+r,type:"USHORT",value:n+o}),t.fields.push({name:"length "+r,type:"USHORT",value:e[r].length})}return t.fields.push({name:"stringPool",type:"CHARARRAY",value:i}),t},Ke=function(e,t){var i=new ae.Parser(e,t),n=i.parseULong();A.argument(1===n,"Unsupported ltag table version."),i.skip("uLong",1);for(var r=i.parseULong(),o=[],a=0;a<r;a++){for(var s="",l=t+i.parseUShort(),c=i.parseUShort(),d=l;d<l+c;++d)s+=String.fromCharCode(e.getInt8(d));o.push(s)}return o},Ye=function(e,t){var i={},n=new ae.Parser(e,t);return i.version=n.parseVersion(),i.numGlyphs=n.parseUShort(),1===i.version&&(i.maxPoints=n.parseUShort(),i.maxContours=n.parseUShort(),i.maxCompositePoints=n.parseUShort(),i.maxCompositeContours=n.parseUShort(),i.maxZones=n.parseUShort(),i.maxTwilightPoints=n.parseUShort(),i.maxStorage=n.parseUShort(),i.maxFunctionDefs=n.parseUShort(),i.maxInstructionDefs=n.parseUShort(),i.maxStackElements=n.parseUShort(),i.maxSizeOfInstructions=n.parseUShort(),i.maxComponentElements=n.parseUShort(),i.maxComponentDepth=n.parseUShort()),i},Je=function(e){return new Q.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])},Xe=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],Qe={0:"en",1:"fr",2:"de",3:"it",4:"nl",5:"sv",6:"es",7:"da",8:"pt",9:"no",10:"he",11:"ja",12:"ar",13:"fi",14:"el",15:"is",16:"mt",17:"tr",18:"hr",19:"zh-Hant",20:"ur",21:"hi",22:"th",23:"ko",24:"lt",25:"pl",26:"hu",27:"es",28:"lv",29:"se",30:"fo",31:"fa",32:"ru",33:"zh",34:"nl-BE",35:"ga",36:"sq",37:"ro",38:"cz",39:"sk",40:"si",41:"yi",42:"sr",43:"mk",44:"bg",45:"uk",46:"be",47:"uz",48:"kk",49:"az-Cyrl",50:"az-Arab",51:"hy",52:"ka",53:"mo",54:"ky",55:"tg",56:"tk",57:"mn-CN",58:"mn",59:"ps",60:"ks",61:"ku",62:"sd",63:"bo",64:"ne",65:"sa",66:"mr",67:"bn",68:"as",69:"gu",70:"pa",71:"or",72:"ml",73:"kn",74:"ta",75:"te",76:"si",77:"my",78:"km",79:"lo",80:"vi",81:"id",82:"tl",83:"ms",84:"ms-Arab",85:"am",86:"ti",87:"om",88:"so",89:"sw",90:"rw",91:"rn",92:"ny",93:"mg",94:"eo",128:"cy",129:"eu",130:"ca",131:"la",132:"qu",133:"gn",134:"ay",135:"tt",136:"ug",137:"dz",138:"jv",139:"su",140:"gl",141:"af",142:"br",143:"iu",144:"gd",145:"gv",146:"ga",147:"to",148:"el-polyton",149:"kl",150:"az",151:"nn"},Ze={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},et={1078:"af",1052:"sq",1156:"gsw",1118:"am",5121:"ar-DZ",15361:"ar-BH",3073:"ar",2049:"ar-IQ",11265:"ar-JO",13313:"ar-KW",12289:"ar-LB",4097:"ar-LY",6145:"ary",8193:"ar-OM",16385:"ar-QA",1025:"ar-SA",10241:"ar-SY",7169:"aeb",14337:"ar-AE",9217:"ar-YE",1067:"hy",1101:"as",2092:"az-Cyrl",1068:"az",1133:"ba",1069:"eu",1059:"be",2117:"bn",1093:"bn-IN",8218:"bs-Cyrl",5146:"bs",1150:"br",1026:"bg",1027:"ca",3076:"zh-HK",5124:"zh-MO",2052:"zh",4100:"zh-SG",1028:"zh-TW",1155:"co",1050:"hr",4122:"hr-BA",1029:"cs",1030:"da",1164:"prs",1125:"dv",2067:"nl-BE",1043:"nl",3081:"en-AU",10249:"en-BZ",4105:"en-CA",9225:"en-029",16393:"en-IN",6153:"en-IE",8201:"en-JM",17417:"en-MY",5129:"en-NZ",13321:"en-PH",18441:"en-SG",7177:"en-ZA",11273:"en-TT",2057:"en-GB",1033:"en",12297:"en-ZW",1061:"et",1080:"fo",1124:"fil",1035:"fi",2060:"fr-BE",3084:"fr-CA",1036:"fr",5132:"fr-LU",6156:"fr-MC",4108:"fr-CH",1122:"fy",1110:"gl",1079:"ka",3079:"de-AT",1031:"de",5127:"de-LI",4103:"de-LU",2055:"de-CH",1032:"el",1135:"kl",1095:"gu",1128:"ha",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig",1057:"id",1117:"iu",2141:"iu-Latn",2108:"ga",1076:"xh",1077:"zu",1040:"it",2064:"it-CH",1041:"ja",1099:"kn",1087:"kk",1107:"km",1158:"quc",1159:"rw",1089:"sw",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1062:"lv",1063:"lt",2094:"dsb",1134:"lb",1071:"mk",2110:"ms-BN",1086:"ms",1100:"ml",1082:"mt",1153:"mi",1146:"arn",1102:"mr",1148:"moh",1104:"mn",2128:"mn-CN",1121:"ne",1044:"nb",2068:"nn",1154:"oc",1096:"or",1123:"ps",1045:"pl",1046:"pt",2070:"pt-PT",1094:"pa",1131:"qu-BO",2155:"qu-EC",3179:"qu",1048:"ro",1047:"rm",1049:"ru",9275:"smn",4155:"smj-NO",5179:"smj",3131:"se-FI",1083:"se",2107:"se-SE",8251:"sms",6203:"sma-NO",7227:"sms",1103:"sa",7194:"sr-Cyrl-BA",3098:"sr",6170:"sr-Latn-BA",2074:"sr-Latn",1132:"nso",1074:"tn",1115:"si",1051:"sk",1060:"sl",11274:"es-AR",16394:"es-BO",13322:"es-CL",9226:"es-CO",5130:"es-CR",7178:"es-DO",12298:"es-EC",17418:"es-SV",4106:"es-GT",18442:"es-HN",2058:"es-MX",19466:"es-NI",6154:"es-PA",15370:"es-PY",10250:"es-PE",20490:"es-PR",3082:"es",1034:"es",21514:"es-US",14346:"es-UY",8202:"es-VE",2077:"sv-FI",1053:"sv",1114:"syr",1064:"tg",2143:"tzm",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1055:"tr",1090:"tk",1152:"ug",1058:"uk",1070:"hsb",1056:"ur",2115:"uz-Cyrl",1091:"uz",1066:"vi",1106:"cy",1160:"wo",1157:"sah",1144:"ii",1130:"yo"};function tt(e,t,i){switch(e){case 0:if(65535===t)return"und";if(i)return i[t];break;case 1:return Qe[t];case 3:return et[t]}}var it="utf-16",nt={0:"macintosh",1:"x-mac-japanese",2:"x-mac-chinesetrad",3:"x-mac-korean",6:"x-mac-greek",7:"x-mac-cyrillic",9:"x-mac-devanagai",10:"x-mac-gurmukhi",11:"x-mac-gujarati",12:"x-mac-oriya",13:"x-mac-bengali",14:"x-mac-tamil",15:"x-mac-telugu",16:"x-mac-kannada",17:"x-mac-malayalam",18:"x-mac-sinhalese",19:"x-mac-burmese",20:"x-mac-khmer",21:"x-mac-thai",22:"x-mac-lao",23:"x-mac-georgian",24:"x-mac-armenian",25:"x-mac-chinesesimp",26:"x-mac-tibetan",27:"x-mac-mongolian",28:"x-mac-ethiopic",29:"x-mac-ce",30:"x-mac-vietnamese",31:"x-mac-extarabic"},rt={15:"x-mac-icelandic",17:"x-mac-turkish",18:"x-mac-croatian",24:"x-mac-ce",25:"x-mac-ce",26:"x-mac-ce",27:"x-mac-ce",28:"x-mac-ce",30:"x-mac-icelandic",37:"x-mac-romanian",38:"x-mac-ce",39:"x-mac-ce",40:"x-mac-ce",143:"x-mac-inuit",146:"x-mac-gaelic"};function ot(e,t,i){switch(e){case 0:return it;case 1:return rt[i]||nt[t];case 3:if(1===t||10===t)return it}}function at(e){var t={};for(var i in e)t[e[i]]=parseInt(i);return t}function st(e,t,i,n,r,o){return new Q.Record("NameRecord",[{name:"platformID",type:"USHORT",value:e},{name:"encodingID",type:"USHORT",value:t},{name:"languageID",type:"USHORT",value:i},{name:"nameID",type:"USHORT",value:n},{name:"length",type:"USHORT",value:r},{name:"offset",type:"USHORT",value:o}])}function lt(e,t){var i=function(e,t){var i=e.length,n=t.length-i+1;e:for(var r=0;r<n;r++)for(;r<n;r++){for(var o=0;o<i;o++)if(t[r+o]!==e[o])continue e;return r}return-1}(e,t);if(i<0){i=t.length;for(var n=0,r=e.length;n<r;++n)t.push(e[n])}return i}var ct=function(e,t,i){for(var n={},r=new ae.Parser(e,t),o=r.parseUShort(),a=r.parseUShort(),s=r.offset+r.parseUShort(),l=0;l<a;l++){var c,d=r.parseUShort(),u=r.parseUShort(),p=r.parseUShort(),h=r.parseUShort(),f=Xe[h]||h,m=r.parseUShort(),g=r.parseUShort(),v=tt(d,p,i),y=ot(d,u,p);if(void 0!==y&&void 0!==v)if(c=y===it?O.UTF16(e,s+g,m):O.MACSTRING(e,s+g,m,y)){var b=n[f];void 0===b&&(b=n[f]={}),b[v]=c}}return 1===o&&r.parseUShort(),n},dt=function(e,t){var i,n=[],r={},o=at(Xe);for(var a in e){var s=o[a];if(void 0===s&&(s=a),i=parseInt(s),isNaN(i))throw new Error('Name table entry "'+a+'" does not exist, see nameTableNames for complete list.');r[i]=e[a],n.push(i)}for(var l=at(Qe),c=at(et),d=[],u=[],p=0;p<n.length;p++){var h=r[i=n[p]];for(var f in h){var m=h[f],g=1,v=l[f],y=Ze[v],b=ot(g,y,v),w=N.MACSTRING(m,b);void 0===w&&(g=0,(v=t.indexOf(f))<0&&(v=t.length,t.push(f)),y=4,w=N.UTF16(m));var S=lt(w,u);d.push(st(g,y,v,i,w.length,S));var C=c[f];if(void 0!==C){var k=N.UTF16(m),x=lt(k,u);d.push(st(3,1,C,i,k.length,x))}}}d.sort((function(e,t){return e.platformID-t.platformID||e.encodingID-t.encodingID||e.languageID-t.languageID||e.nameID-t.nameID}));for(var _=new Q.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:d.length},{name:"stringOffset",type:"USHORT",value:6+12*d.length}]),E=0;E<d.length;E++)_.fields.push({name:"record_"+E,type:"RECORD",value:d[E]});return _.fields.push({name:"strings",type:"LITERAL",value:u}),_},ut=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}],pt=function(e,t){var i={},n=new ae.Parser(e,t);i.version=n.parseUShort(),i.xAvgCharWidth=n.parseShort(),i.usWeightClass=n.parseUShort(),i.usWidthClass=n.parseUShort(),i.fsType=n.parseUShort(),i.ySubscriptXSize=n.parseShort(),i.ySubscriptYSize=n.parseShort(),i.ySubscriptXOffset=n.parseShort(),i.ySubscriptYOffset=n.parseShort(),i.ySuperscriptXSize=n.parseShort(),i.ySuperscriptYSize=n.parseShort(),i.ySuperscriptXOffset=n.parseShort(),i.ySuperscriptYOffset=n.parseShort(),i.yStrikeoutSize=n.parseShort(),i.yStrikeoutPosition=n.parseShort(),i.sFamilyClass=n.parseShort(),i.panose=[];for(var r=0;r<10;r++)i.panose[r]=n.parseByte();return i.ulUnicodeRange1=n.parseULong(),i.ulUnicodeRange2=n.parseULong(),i.ulUnicodeRange3=n.parseULong(),i.ulUnicodeRange4=n.parseULong(),i.achVendID=String.fromCharCode(n.parseByte(),n.parseByte(),n.parseByte(),n.parseByte()),i.fsSelection=n.parseUShort(),i.usFirstCharIndex=n.parseUShort(),i.usLastCharIndex=n.parseUShort(),i.sTypoAscender=n.parseShort(),i.sTypoDescender=n.parseShort(),i.sTypoLineGap=n.parseShort(),i.usWinAscent=n.parseUShort(),i.usWinDescent=n.parseUShort(),1<=i.version&&(i.ulCodePageRange1=n.parseULong(),i.ulCodePageRange2=n.parseULong()),2<=i.version&&(i.sxHeight=n.parseShort(),i.sCapHeight=n.parseShort(),i.usDefaultChar=n.parseUShort(),i.usBreakChar=n.parseUShort(),i.usMaxContent=n.parseUShort()),i},ht=function(e){return new Q.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],e)},ft=function(e){for(var t=0;t<ut.length;t+=1){var i=ut[t];if(e>=i.begin&&e<i.end)return t}return-1},mt=function(e,t){var i={},n=new ae.Parser(e,t);switch(i.version=n.parseVersion(),i.italicAngle=n.parseFixed(),i.underlinePosition=n.parseShort(),i.underlineThickness=n.parseShort(),i.isFixedPitch=n.parseULong(),i.minMemType42=n.parseULong(),i.maxMemType42=n.parseULong(),i.minMemType1=n.parseULong(),i.maxMemType1=n.parseULong(),i.version){case 1:i.names=pe.slice();break;case 2:i.numberOfGlyphs=n.parseUShort(),i.glyphNameIndex=new Array(i.numberOfGlyphs);for(var r=0;r<i.numberOfGlyphs;r++)i.glyphNameIndex[r]=n.parseUShort();i.names=[];for(var o=0;o<i.numberOfGlyphs;o++)if(i.glyphNameIndex[o]>=pe.length){var a=n.parseChar();i.names.push(n.parseString(a))}break;case 2.5:i.numberOfGlyphs=n.parseUShort(),i.offset=new Array(i.numberOfGlyphs);for(var s=0;s<i.numberOfGlyphs;s++)i.offset[s]=n.parseChar()}return i},gt=function(){return new Q.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])},vt=new Array(9);vt[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(re.coverage),deltaGlyphId:this.parseUShort()}:2===t?{substFormat:2,coverage:this.parsePointer(re.coverage),substitute:this.parseOffset16List()}:void A.assert(!1,"0x"+e.toString(16)+": lookup type 1 format must be 1 or 2.")},vt[2]=function(){var e=this.parseUShort();return A.argument(1===e,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(re.coverage),sequences:this.parseListOfLists()}},vt[3]=function(){var e=this.parseUShort();return A.argument(1===e,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(re.coverage),alternateSets:this.parseListOfLists()}},vt[4]=function(){var e=this.parseUShort();return A.argument(1===e,"GSUB ligature table identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(re.coverage),ligatureSets:this.parseListOfLists((function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}}))}};var yt={sequenceIndex:re.uShort,lookupListIndex:re.uShort};vt[5]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(1===t)return{substFormat:t,coverage:this.parsePointer(re.coverage),ruleSets:this.parseListOfLists((function(){var e=this.parseUShort(),t=this.parseUShort();return{input:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,yt)}}))};if(2===t)return{substFormat:t,coverage:this.parsePointer(re.coverage),classDef:this.parsePointer(re.classDef),classSets:this.parseListOfLists((function(){var e=this.parseUShort(),t=this.parseUShort();return{classes:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,yt)}}))};if(3===t){var i=this.parseUShort(),n=this.parseUShort();return{substFormat:t,coverages:this.parseList(i,re.pointer(re.coverage)),lookupRecords:this.parseRecordList(n,yt)}}A.assert(!1,"0x"+e.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},vt[6]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{substFormat:1,coverage:this.parsePointer(re.coverage),chainRuleSets:this.parseListOfLists((function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(yt)}}))}:2===t?{substFormat:2,coverage:this.parsePointer(re.coverage),backtrackClassDef:this.parsePointer(re.classDef),inputClassDef:this.parsePointer(re.classDef),lookaheadClassDef:this.parsePointer(re.classDef),chainClassSet:this.parseListOfLists((function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(yt)}}))}:3===t?{substFormat:3,backtrackCoverage:this.parseList(re.pointer(re.coverage)),inputCoverage:this.parseList(re.pointer(re.coverage)),lookaheadCoverage:this.parseList(re.pointer(re.coverage)),lookupRecords:this.parseRecordList(yt)}:void A.assert(!1,"0x"+e.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},vt[7]=function(){var e=this.parseUShort();A.argument(1===e,"GSUB Extension Substitution subtable identifier-format must be 1");var t=this.parseUShort(),i=new re(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:vt[t].call(i)}},vt[8]=function(){var e=this.parseUShort();return A.argument(1===e,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(re.coverage),backtrackCoverage:this.parseList(re.pointer(re.coverage)),lookaheadCoverage:this.parseList(re.pointer(re.coverage)),substitutes:this.parseUShortList()}};var bt=new Array(9);bt[1]=function(e){return 1===e.substFormat?new Q.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Q.Coverage(e.coverage)},{name:"deltaGlyphID",type:"USHORT",value:e.deltaGlyphId}]):new Q.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new Q.Coverage(e.coverage)}].concat(Q.ushortList("substitute",e.substitute)))},bt[3]=function(e){return A.assert(1===e.substFormat,"Lookup type 3 substFormat must be 1."),new Q.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Q.Coverage(e.coverage)}].concat(Q.tableList("altSet",e.alternateSets,(function(e){return new Q.Table("alternateSetTable",Q.ushortList("alternate",e))}))))},bt[4]=function(e){return A.assert(1===e.substFormat,"Lookup type 4 substFormat must be 1."),new Q.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Q.Coverage(e.coverage)}].concat(Q.tableList("ligSet",e.ligatureSets,(function(e){return new Q.Table("ligatureSetTable",Q.tableList("ligature",e,(function(e){return new Q.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:e.ligGlyph}].concat(Q.ushortList("component",e.components,e.components.length+1)))})))}))))};var wt=function(e,t){var i=new re(e,t=t||0),n=i.parseVersion(1);return A.argument(1===n||1.1===n,"Unsupported GSUB table version."),1===n?{version:n,scripts:i.parseScriptList(),features:i.parseFeatureList(),lookups:i.parseLookupList(vt)}:{version:n,scripts:i.parseScriptList(),features:i.parseFeatureList(),lookups:i.parseLookupList(vt),variations:i.parseFeatureVariationsList()}},St=function(e){return new Q.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new Q.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new Q.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new Q.LookupList(e.lookups,bt)}])},Ct=function(e,t){var i=new ae.Parser(e,t),n=i.parseULong();A.argument(1===n,"Unsupported META table version."),i.parseULong(),i.parseULong();for(var r=i.parseULong(),o={},a=0;a<r;a++){var s=i.parseTag(),l=i.parseULong(),c=i.parseULong(),d=O.UTF8(e,t+l,c);o[s]=d}return o},kt=function(e){var t=Object.keys(e).length,i="",n=16+12*t,r=new Q.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:n},{name:"numTags",type:"ULONG",value:t}]);for(var o in e){var a=i.length;i+=e[o],r.fields.push({name:"tag "+o,type:"TAG",value:o}),r.fields.push({name:"offset "+o,type:"ULONG",value:n+a}),r.fields.push({name:"length "+o,type:"ULONG",value:e[o].length})}return r.fields.push({name:"stringPool",type:"CHARARRAY",value:i}),r};function xt(e){return Math.log(e)/Math.log(2)|0}function _t(e){for(;e.length%4!=0;)e.push(0);for(var t=0,i=0;i<e.length;i+=4)t+=(e[i]<<24)+(e[i+1]<<16)+(e[i+2]<<8)+e[i+3];return t%Math.pow(2,32)}function Et(e,t,i,n){return new Q.Record("Table Record",[{name:"tag",type:"TAG",value:void 0!==e?e:""},{name:"checkSum",type:"ULONG",value:void 0!==t?t:0},{name:"offset",type:"ULONG",value:void 0!==i?i:0},{name:"length",type:"ULONG",value:void 0!==n?n:0}])}function Tt(e){var t=new Q.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);t.tables=e,t.numTables=e.length;var i=Math.pow(2,xt(t.numTables));t.searchRange=16*i,t.entrySelector=xt(i),t.rangeShift=16*t.numTables-t.searchRange;for(var n=[],r=[],o=t.sizeOf()+Et().sizeOf()*t.numTables;o%4!=0;)o+=1,r.push({name:"padding",type:"BYTE",value:0});for(var a=0;a<e.length;a+=1){var s=e[a];A.argument(4===s.tableName.length,"Table name"+s.tableName+" is invalid.");var l=s.sizeOf(),c=Et(s.tableName,_t(s.encode()),o,l);for(n.push({name:c.tag+" Table Record",type:"RECORD",value:c}),r.push({name:s.tableName+" table",type:"RECORD",value:s}),o+=l,A.argument(!isNaN(o),"Something went wrong calculating the offset.");o%4!=0;)o+=1,r.push({name:"padding",type:"BYTE",value:0})}return n.sort((function(e,t){return e.value.tag>t.value.tag?1:-1})),t.fields=t.fields.concat(n),t.fields=t.fields.concat(r),t}function Pt(e,t,i){for(var n=0;n<t.length;n+=1){var r=e.charToGlyphIndex(t[n]);if(0<r)return e.glyphs.get(r).getMetrics()}return i}var It=function(e){for(var t,i=[],n=[],r=[],o=[],a=[],s=[],l=[],c=0,d=0,u=0,p=0,h=0,f=0;f<e.glyphs.length;f+=1){var m=e.glyphs.get(f),g=0|m.unicode;if(isNaN(m.advanceWidth))throw new Error("Glyph "+m.name+" ("+f+"): advanceWidth is not a number.");(g<t||void 0===t)&&0<g&&(t=g),c<g&&(c=g);var v=ft(g);if(v<32)d|=1<<v;else if(v<64)u|=1<<v-32;else if(v<96)p|=1<<v-64;else{if(!(v<123))throw new Error("Unicode ranges bits > 123 are reserved for internal usage");h|=1<<v-96}if(".notdef"!==m.name){var y=m.getMetrics();i.push(y.xMin),n.push(y.yMin),r.push(y.xMax),o.push(y.yMax),s.push(y.leftSideBearing),l.push(y.rightSideBearing),a.push(m.advanceWidth)}}var b={xMin:Math.min.apply(null,i),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,r),yMax:Math.max.apply(null,o),advanceWidthMax:Math.max.apply(null,a),advanceWidthAvg:function(e){for(var t=0,i=0;i<e.length;i+=1)t+=e[i];return t/e.length}(a),minLeftSideBearing:Math.min.apply(null,s),maxLeftSideBearing:Math.max.apply(null,s),minRightSideBearing:Math.min.apply(null,l)};b.ascender=e.ascender,b.descender=e.descender;var w=He({flags:3,unitsPerEm:e.unitsPerEm,xMin:b.xMin,yMin:b.yMin,xMax:b.xMax,yMax:b.yMax,lowestRecPPEM:3,createdTimestamp:e.createdTimestamp}),S=qe({ascender:b.ascender,descender:b.descender,advanceWidthMax:b.advanceWidthMax,minLeftSideBearing:b.minLeftSideBearing,minRightSideBearing:b.minRightSideBearing,xMaxExtent:b.maxLeftSideBearing+(b.xMax-b.xMin),numberOfHMetrics:e.glyphs.length}),C=Je(e.glyphs.length),k=ht({xAvgCharWidth:Math.round(b.advanceWidthAvg),usWeightClass:e.tables.os2.usWeightClass,usWidthClass:e.tables.os2.usWidthClass,usFirstCharIndex:t,usLastCharIndex:c,ulUnicodeRange1:d,ulUnicodeRange2:u,ulUnicodeRange3:p,ulUnicodeRange4:h,fsSelection:e.tables.os2.fsSelection,sTypoAscender:b.ascender,sTypoDescender:b.descender,sTypoLineGap:0,usWinAscent:b.yMax,usWinDescent:Math.abs(b.yMin),ulCodePageRange1:1,sxHeight:Pt(e,"xyvw",{yMax:Math.round(b.ascender/2)}).yMax,sCapHeight:Pt(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",b).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0}),x=We(e.glyphs),_=le(e.glyphs),E=e.getEnglishName("fontFamily"),T=e.getEnglishName("fontSubfamily"),P=E+" "+T,I=e.getEnglishName("postScriptName");I||(I=E.replace(/\s/g,"")+"-"+T);var A={};for(var R in e.names)A[R]=e.names[R];A.uniqueID||(A.uniqueID={en:e.getEnglishName("manufacturer")+":"+P}),A.postScriptName||(A.postScriptName={en:I}),A.preferredFamily||(A.preferredFamily=e.names.fontFamily),A.preferredSubfamily||(A.preferredSubfamily=e.names.fontSubfamily);var O=[],N=dt(A,O),D=0<O.length?Ge(O):void 0,L=gt(),M=Ue(e.glyphs,{version:e.getEnglishName("version"),fullName:P,familyName:E,weightName:T,postScriptName:I,unitsPerEm:e.unitsPerEm,fontBBox:[0,b.yMin,b.ascender,b.advanceWidthMax]}),B=e.metas&&0<Object.keys(e.metas).length?kt(e.metas):void 0,F=[w,S,C,k,N,_,L,M,x];D&&F.push(D),e.tables.gsub&&F.push(St(e.tables.gsub)),B&&F.push(B);for(var V=Tt(F),U=_t(V.encode()),z=V.fields,H=!1,j=0;j<z.length;j+=1)if("head table"===z[j].name){z[j].value.checkSumAdjustment=2981146554-U,H=!0;break}if(!H)throw new Error("Could not find head table with checkSum to adjust.");return V};function At(e,t){for(var i=0,n=e.length-1;i<=n;){var r=i+n>>>1,o=e[r].tag;if(o===t)return r;o<t?i=r+1:n=r-1}return-i-1}function Rt(e,t){for(var i=0,n=e.length-1;i<=n;){var r=i+n>>>1,o=e[r];if(o===t)return r;o<t?i=r+1:n=r-1}return-i-1}function Ot(e,t){for(var i,n=0,r=e.length-1;n<=r;){var o=n+r>>>1,a=(i=e[o]).start;if(a===t)return i;a<t?n=o+1:r=o-1}if(0<n)return t>(i=e[n-1]).end?0:i}function Nt(e,t){this.font=e,this.tableName=t}function Dt(e){Nt.call(this,e,"gpos")}function Lt(e){Nt.call(this,e,"gsub")}function Mt(e,t){var i=e.length;if(i!==t.length)return!1;for(var n=0;n<i;n++)if(e[n]!==t[n])return!1;return!0}function Bt(e,t,i){for(var n=e.subtables,r=0;r<n.length;r++){var o=n[r];if(o.substFormat===t)return o}if(i)return n.push(i),i}function Ft(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),n=0;n<e.length;++n)i[n]=e[n];return t}function Vt(e,t){if(!e)throw t}function Ut(e,t,i,n,r){var o;return 0<(t&n)?(o=e.parseByte(),0==(t&r)&&(o=-o),i+o):0<(t&r)?i:i+e.parseShort()}function zt(e,t,i){var n,r,o=new ae.Parser(t,i);if(e.numberOfContours=o.parseShort(),e._xMin=o.parseShort(),e._yMin=o.parseShort(),e._xMax=o.parseShort(),e._yMax=o.parseShort(),0<e.numberOfContours){for(var a=e.endPointIndices=[],s=0;s<e.numberOfContours;s+=1)a.push(o.parseUShort());e.instructionLength=o.parseUShort(),e.instructions=[];for(var l=0;l<e.instructionLength;l+=1)e.instructions.push(o.parseByte());var c=a[a.length-1]+1;n=[];for(var d=0;d<c;d+=1)if(r=o.parseByte(),n.push(r),0<(8&r))for(var u=o.parseByte(),p=0;p<u;p+=1)n.push(r),d+=1;if(A.argument(n.length===c,"Bad flags."),0<a.length){var h,f=[];if(0<c){for(var m=0;m<c;m+=1)r=n[m],(h={}).onCurve=!!(1&r),h.lastPointOfContour=0<=a.indexOf(m),f.push(h);for(var g=0,v=0;v<c;v+=1)r=n[v],(h=f[v]).x=Ut(o,r,g,2,16),g=h.x;for(var y=0,b=0;b<c;b+=1)r=n[b],(h=f[b]).y=Ut(o,r,y,4,32),y=h.y}e.points=f}else e.points=[]}else if(0===e.numberOfContours)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];for(var w=!0;w;){n=o.parseUShort();var S={glyphIndex:o.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};0<(1&n)?0<(2&n)?(S.dx=o.parseShort(),S.dy=o.parseShort()):S.matchedPoints=[o.parseUShort(),o.parseUShort()]:0<(2&n)?(S.dx=o.parseChar(),S.dy=o.parseChar()):S.matchedPoints=[o.parseByte(),o.parseByte()],0<(8&n)?S.xScale=S.yScale=o.parseF2Dot14():0<(64&n)?(S.xScale=o.parseF2Dot14(),S.yScale=o.parseF2Dot14()):0<(128&n)&&(S.xScale=o.parseF2Dot14(),S.scale01=o.parseF2Dot14(),S.scale10=o.parseF2Dot14(),S.yScale=o.parseF2Dot14()),e.components.push(S),w=!!(32&n)}if(256&n){e.instructionLength=o.parseUShort(),e.instructions=[];for(var C=0;C<e.instructionLength;C+=1)e.instructions.push(o.parseByte())}}}function Ht(e,t){for(var i=[],n=0;n<e.length;n+=1){var r=e[n],o={x:t.xScale*r.x+t.scale01*r.y+t.dx,y:t.scale10*r.x+t.yScale*r.y+t.dy,onCurve:r.onCurve,lastPointOfContour:r.lastPointOfContour};i.push(o)}return i}function jt(e){var t=new T;if(!e)return t;for(var i=function(e){for(var t=[],i=[],n=0;n<e.length;n+=1){var r=e[n];i.push(r),r.lastPointOfContour&&(t.push(i),i=[])}return A.argument(0===i.length,"There are still points left in the current contour."),t}(e),n=0;n<i.length;++n){var r=i[n],o=null,a=r[r.length-1],s=r[0];if(a.onCurve)t.moveTo(a.x,a.y);else if(s.onCurve)t.moveTo(s.x,s.y);else{var l={x:.5*(a.x+s.x),y:.5*(a.y+s.y)};t.moveTo(l.x,l.y)}for(var c=0;c<r.length;++c)if(o=a,a=s,s=r[(c+1)%r.length],a.onCurve)t.lineTo(a.x,a.y);else{var d=s;o.onCurve||(a.x,o.x,a.y,o.y),s.onCurve||(d={x:.5*(a.x+s.x),y:.5*(a.y+s.y)}),t.quadraticCurveTo(a.x,a.y,d.x,d.y)}t.closePath()}return t}function qt(e,t){if(t.isComposite)for(var i=0;i<t.components.length;i+=1){var n=t.components[i],r=e.get(n.glyphIndex);if(r.getPath(),r.points){var o=void 0;if(void 0===n.matchedPoints)o=Ht(r.points,n);else{if(n.matchedPoints[0]>t.points.length-1||n.matchedPoints[1]>r.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[n.matchedPoints[0]],s=r.points[n.matchedPoints[1]],l={xScale:n.xScale,scale01:n.scale01,scale10:n.scale10,yScale:n.yScale,dx:0,dy:0};s=Ht([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=Ht(r.points,l)}t.points=t.points.concat(o)}}return jt(t.points)}(Dt.prototype=Nt.prototype={searchTag:At,binSearch:Rt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map((function(e){return e.tag})):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,i=0;i<e.scripts.length;i++){var n=e.scripts[i].tag;if("DFLT"===n)return n;"latn"===n&&(t=!0)}return t?"latn":void 0}},getScriptTable:function(e,t){var i=this.getTable(t);if(i){e=e||"DFLT";var n=i.scripts,r=At(i.scripts,e);if(0<=r)return n[r].script;if(t){var o={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return n.splice(-1-r,0,o),o.script}}},getLangSysTable:function(e,t,i){var n=this.getScriptTable(e,i);if(n){if(!t||"dflt"===t||"DFLT"===t)return n.defaultLangSys;var r=At(n.langSysRecords,t);if(0<=r)return n.langSysRecords[r].langSys;if(i){var o={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return n.langSysRecords.splice(-1-r,0,o),o.langSys}}},getFeatureTable:function(e,t,i,n){var r=this.getLangSysTable(e,t,n);if(r){for(var o,a=r.featureIndexes,s=this.font.tables[this.tableName].features,l=0;l<a.length;l++)if((o=s[a[l]]).tag===i)return o.feature;if(n){var c=s.length;return A.assert(0===c||i>=s[c-1].tag,"Features must be added in alphabetical order."),o={tag:i,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(c),o.feature}}},getLookupTables:function(e,t,i,n,r){var o=this.getFeatureTable(e,t,i,r),a=[];if(o){for(var s,l=o.lookupListIndexes,c=this.font.tables[this.tableName].lookups,d=0;d<l.length;d++)(s=c[l[d]]).lookupType===n&&a.push(s);if(0===a.length&&r){s={lookupType:n,lookupFlag:0,subtables:[],markFilteringSet:void 0};var u=c.length;return c.push(s),l.push(u),[s]}}return a},getGlyphClass:function(e,t){switch(e.format){case 1:return e.startGlyph<=t&&t<e.startGlyph+e.classes.length?e.classes[t-e.startGlyph]:0;case 2:var i=Ot(e.ranges,t);return i?i.classId:0}},getCoverageIndex:function(e,t){switch(e.format){case 1:var i=Rt(e.glyphs,t);return 0<=i?i:-1;case 2:var n=Ot(e.ranges,t);return n?n.index+t-n.start:-1}},expandCoverage:function(e){if(1===e.format)return e.glyphs;for(var t=[],i=e.ranges,n=0;n<i.length;n++)for(var r=i[n],o=r.start,a=r.end,s=o;s<=a;s++)t.push(s);return t}}).init=function(){var e=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(e)},Dt.prototype.getKerningValue=function(e,t,i){for(var n=0;n<e.length;n++)for(var r=e[n].subtables,o=0;o<r.length;o++){var a=r[o],s=this.getCoverageIndex(a.coverage,t);if(!(s<0))switch(a.posFormat){case 1:for(var l=a.pairSets[s],c=0;c<l.length;c++){var d=l[c];if(d.secondGlyph===i)return d.value1&&d.value1.xAdvance||0}break;case 2:var u=this.getGlyphClass(a.classDef1,t),p=this.getGlyphClass(a.classDef2,i),h=a.classRecords[u][p];return h.value1&&h.value1.xAdvance||0}}return 0},Dt.prototype.getKerningTables=function(e,t){if(this.font.tables.gpos)return this.getLookupTables(e,t,"kern",2)},(Lt.prototype=Nt.prototype).createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},Lt.prototype.getSingle=function(e,t,i){for(var n=[],r=this.getLookupTables(t,i,e,1),o=0;o<r.length;o++)for(var a=r[o].subtables,s=0;s<a.length;s++){var l=a[s],c=this.expandCoverage(l.coverage),d=void 0;if(1===l.substFormat){var u=l.deltaGlyphId;for(d=0;d<c.length;d++){var p=c[d];n.push({sub:p,by:p+u})}}else{var h=l.substitute;for(d=0;d<c.length;d++)n.push({sub:c[d],by:h[d]})}}return n},Lt.prototype.getAlternates=function(e,t,i){for(var n=[],r=this.getLookupTables(t,i,e,3),o=0;o<r.length;o++)for(var a=r[o].subtables,s=0;s<a.length;s++)for(var l=a[s],c=this.expandCoverage(l.coverage),d=l.alternateSets,u=0;u<c.length;u++)n.push({sub:c[u],by:d[u]});return n},Lt.prototype.getLigatures=function(e,t,i){for(var n=[],r=this.getLookupTables(t,i,e,4),o=0;o<r.length;o++)for(var a=r[o].subtables,s=0;s<a.length;s++)for(var l=a[s],c=this.expandCoverage(l.coverage),d=l.ligatureSets,u=0;u<c.length;u++)for(var p=c[u],h=d[u],f=0;f<h.length;f++){var m=h[f];n.push({sub:[p].concat(m.components),by:m.ligGlyph})}return n},Lt.prototype.addSingle=function(e,t,i,n){var r=Bt(this.getLookupTables(i,n,e,1,!0)[0],2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});A.assert(1===r.coverage.format,"Ligature: unable to modify coverage table format "+r.coverage.format);var o=t.sub,a=this.binSearch(r.coverage.glyphs,o);a<0&&(a=-1-a,r.coverage.glyphs.splice(a,0,o),r.substitute.splice(a,0,0)),r.substitute[a]=t.by},Lt.prototype.addAlternate=function(e,t,i,n){var r=Bt(this.getLookupTables(i,n,e,3,!0)[0],1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});A.assert(1===r.coverage.format,"Ligature: unable to modify coverage table format "+r.coverage.format);var o=t.sub,a=this.binSearch(r.coverage.glyphs,o);a<0&&(a=-1-a,r.coverage.glyphs.splice(a,0,o),r.alternateSets.splice(a,0,0)),r.alternateSets[a]=t.by},Lt.prototype.addLigature=function(e,t,i,n){var r=this.getLookupTables(i,n,e,4,!0)[0],o=r.subtables[0];o||(o={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},r.subtables[0]=o),A.assert(1===o.coverage.format,"Ligature: unable to modify coverage table format "+o.coverage.format);var a=t.sub[0],s=t.sub.slice(1),l={ligGlyph:t.by,components:s},c=this.binSearch(o.coverage.glyphs,a);if(0<=c){for(var d=o.ligatureSets[c],u=0;u<d.length;u++)if(Mt(d[u].components,s))return;d.push(l)}else c=-1-c,o.coverage.glyphs.splice(c,0,a),o.ligatureSets.splice(c,0,[l])},Lt.prototype.getFeature=function(e,t,i){if(/ss\d\d/.test(e))return this.getSingle(e,t,i);switch(e){case"aalt":case"salt":return this.getSingle(e,t,i).concat(this.getAlternates(e,t,i));case"dlig":case"liga":case"rlig":return this.getLigatures(e,t,i)}},Lt.prototype.add=function(e,t,i,n){if(/ss\d\d/.test(e))return this.addSingle(e,t,i,n);switch(e){case"aalt":case"salt":return"number"==typeof t.by?this.addSingle(e,t,i,n):this.addAlternate(e,t,i,n);case"dlig":case"liga":case"rlig":return this.addLigature(e,t,i,n)}};var $t,Wt,Gt,Kt,Yt={getPath:jt,parse:function(e,t,i,n){for(var r=new Se.GlyphSet(n),o=0;o<i.length-1;o+=1){var a=i[o];a!==i[o+1]?r.push(o,Se.ttfGlyphLoader(n,o,zt,e,t+a,qt)):r.push(o,Se.glyphLoader(n,o))}return r}};function Jt(e){this.font=e,this.getCommands=function(e){return Yt.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function Xt(e){return e}function Qt(e){return Math.sign(e)*Math.round(Math.abs(e))}function Zt(e){return Math.sign(e)*Math.round(Math.abs(2*e))/2}function ei(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function ti(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function ii(e){return Math.sign(e)*Math.floor(Math.abs(e))}var ni=function(e){var t=this.srPeriod,i=this.srPhase,n=1;return e<0&&(e=-e,n=-1),e+=this.srThreshold-i,e=Math.trunc(e/t)*t,(e+=i)<0?i*n:e*n},ri={x:1,y:0,axis:"x",distance:function(e,t,i,n){return(i?e.xo:e.x)-(n?t.xo:t.x)},interpolate:function(e,t,i,n){var r,o,a,s,l,c,d;if(!n||n===this)return r=e.xo-t.xo,o=e.xo-i.xo,l=t.x-t.xo,c=i.x-i.xo,0===(d=(a=Math.abs(r))+(s=Math.abs(o)))?void(e.x=e.xo+(l+c)/2):void(e.x=e.xo+(l*s+c*a)/d);r=n.distance(e,t,!0,!0),o=n.distance(e,i,!0,!0),l=n.distance(t,t,!1,!0),c=n.distance(i,i,!1,!0),0!==(d=(a=Math.abs(r))+(s=Math.abs(o)))?ri.setRelative(e,e,(l*s+c*a)/d,n,!0):ri.setRelative(e,e,(l+c)/2,n,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,t,i,n,r){if(n&&n!==this){var o=r?t.xo:t.x,a=r?t.yo:t.y,s=o+i*n.x,l=a+i*n.y;e.x=s+(e.y-l)/n.normalSlope}else e.x=(r?t.xo:t.x)+i},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},oi={x:0,y:1,axis:"y",distance:function(e,t,i,n){return(i?e.yo:e.y)-(n?t.yo:t.y)},interpolate:function(e,t,i,n){var r,o,a,s,l,c,d;if(!n||n===this)return r=e.yo-t.yo,o=e.yo-i.yo,l=t.y-t.yo,c=i.y-i.yo,0===(d=(a=Math.abs(r))+(s=Math.abs(o)))?void(e.y=e.yo+(l+c)/2):void(e.y=e.yo+(l*s+c*a)/d);r=n.distance(e,t,!0,!0),o=n.distance(e,i,!0,!0),l=n.distance(t,t,!1,!0),c=n.distance(i,i,!1,!0),0!==(d=(a=Math.abs(r))+(s=Math.abs(o)))?oi.setRelative(e,e,(l*s+c*a)/d,n,!0):oi.setRelative(e,e,(l+c)/2,n,!0)},normalSlope:0,setRelative:function(e,t,i,n,r){if(n&&n!==this){var o=r?t.xo:t.x,a=r?t.yo:t.y,s=o+i*n.x,l=a+i*n.y;e.y=l+n.normalSlope*(e.x-s)}else e.y=(r?t.yo:t.y)+i},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};function ai(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}function si(e,t){var i=Math.sqrt(e*e+t*t);return t/=i,1==(e/=i)&&0===t?ri:0===e&&1===t?oi:new ai(e,t)}function li(e,t,i,n){this.x=this.xo=Math.round(64*e)/64,this.y=this.yo=Math.round(64*t)/64,this.lastPointOfContour=i,this.onCurve=n,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Object.freeze(ri),Object.freeze(oi),ai.prototype.distance=function(e,t,i,n){return this.x*ri.distance(e,t,i,n)+this.y*oi.distance(e,t,i,n)},ai.prototype.interpolate=function(e,t,i,n){var r,o,a,s,l,c,d;a=n.distance(e,t,!0,!0),s=n.distance(e,i,!0,!0),r=n.distance(t,t,!1,!0),o=n.distance(i,i,!1,!0),0!==(d=(l=Math.abs(a))+(c=Math.abs(s)))?this.setRelative(e,e,(r*c+o*l)/d,n,!0):this.setRelative(e,e,(r+o)/2,n,!0)},ai.prototype.setRelative=function(e,t,i,n,r){n=n||this;var o=r?t.xo:t.x,a=r?t.yo:t.y,s=o+i*n.x,l=a+i*n.y,c=n.normalSlope,d=this.slope,u=e.x,p=e.y;e.x=(d*u-c*s+l-p)/(d-c),e.y=d*(e.x-u)+p},ai.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0},li.prototype.nextTouched=function(e){for(var t=this.nextPointOnContour;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},li.prototype.prevTouched=function(e){for(var t=this.prevPointOnContour;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};var ci=Object.freeze(new li(0,0)),di={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function ui(e,t){switch(this.env=e,this.stack=[],this.prog=t,e){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=ri,this.round=Qt}}function pi(e){for(var t=e.tZone=new Array(e.gZone.length),i=0;i<t.length;i++)t[i]=new li(0,0)}function hi(e,t){var i,n=e.prog,r=e.ip,o=1;do{if(88===(i=n[++r]))o++;else if(89===i)o--;else if(64===i)r+=n[r+1]+1;else if(65===i)r+=2*n[r+1]+1;else if(176<=i&&i<=183)r+=i-176+1;else if(184<=i&&i<=191)r+=2*(i-184+1);else if(t&&1===o&&27===i)break}while(0<o);e.ip=r}function fi(e,i){t.DEBUG&&console.log(i.step,"SVTCA["+e.axis+"]"),i.fv=i.pv=i.dpv=e}function mi(e,i){t.DEBUG&&console.log(i.step,"SPVTCA["+e.axis+"]"),i.pv=i.dpv=e}function gi(e,i){t.DEBUG&&console.log(i.step,"SFVTCA["+e.axis+"]"),i.fv=e}function vi(e,i){var n,r,o=i.stack,a=o.pop(),s=o.pop(),l=i.z2[a],c=i.z1[s];t.DEBUG&&console.log("SPVTL["+e+"]",a,s),r=e?(n=l.y-c.y,c.x-l.x):(n=c.x-l.x,c.y-l.y),i.pv=i.dpv=si(n,r)}function yi(e,i){var n,r,o=i.stack,a=o.pop(),s=o.pop(),l=i.z2[a],c=i.z1[s];t.DEBUG&&console.log("SFVTL["+e+"]",a,s),r=e?(n=l.y-c.y,c.x-l.x):(n=c.x-l.x,c.y-l.y),i.fv=si(n,r)}function bi(e){t.DEBUG&&console.log(e.step,"POP[]"),e.stack.pop()}function wi(e,i){var n=i.stack.pop(),r=i.z0[n],o=i.fv,a=i.pv;t.DEBUG&&console.log(i.step,"MDAP["+e+"]",n);var s=a.distance(r,ci);e&&(s=i.round(s)),o.setRelative(r,ci,s,a),o.touch(r),i.rp0=i.rp1=n}function Si(e,i){var n,r,o,a=i.z2,s=a.length-2;t.DEBUG&&console.log(i.step,"IUP["+e.axis+"]");for(var l=0;l<s;l++)n=a[l],e.touched(n)||(r=n.prevTouched(e))!==n&&(r===(o=n.nextTouched(e))&&e.setRelative(n,n,e.distance(r,r,!1,!0),e,!0),e.interpolate(n,r,o,e))}function Ci(e,i){for(var n=i.stack,r=e?i.rp1:i.rp2,o=(e?i.z0:i.z1)[r],a=i.fv,s=i.pv,l=i.loop,c=i.z2;l--;){var d=n.pop(),u=c[d],p=s.distance(o,o,!1,!0);a.setRelative(u,u,p,s),a.touch(u),t.DEBUG&&console.log(i.step,(1<i.loop?"loop "+(i.loop-l)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",d)}i.loop=1}function ki(e,i){var n=i.stack,r=e?i.rp1:i.rp2,o=(e?i.z0:i.z1)[r],a=i.fv,s=i.pv,l=n.pop(),c=i.z2[i.contours[l]],d=c;t.DEBUG&&console.log(i.step,"SHC["+e+"]",l);for(var u=s.distance(o,o,!1,!0);d!==o&&a.setRelative(d,d,u,s),(d=d.nextPointOnContour)!==c;);}function xi(e,i){var n,r,o=i.stack,a=e?i.rp1:i.rp2,s=(e?i.z0:i.z1)[a],l=i.fv,c=i.pv,d=o.pop();switch(t.DEBUG&&console.log(i.step,"SHZ["+e+"]",d),d){case 0:n=i.tZone;break;case 1:n=i.gZone;break;default:throw new Error("Invalid zone")}for(var u=c.distance(s,s,!1,!0),p=n.length-2,h=0;h<p;h++)r=n[h],l.setRelative(r,r,u,c)}function _i(e,i){var n=i.stack,r=n.pop()/64,o=n.pop(),a=i.z1[o],s=i.z0[i.rp0],l=i.fv,c=i.pv;l.setRelative(a,s,r,c),l.touch(a),t.DEBUG&&console.log(i.step,"MSIRP["+e+"]",r,o),i.rp1=i.rp0,i.rp2=o,e&&(i.rp0=o)}function Ei(e,i){var n=i.stack,r=n.pop(),o=n.pop(),a=i.z0[o],s=i.fv,l=i.pv,c=i.cvt[r];t.DEBUG&&console.log(i.step,"MIAP["+e+"]",r,"(",c,")",o);var d=l.distance(a,ci);e&&(Math.abs(d-c)<i.cvCutIn&&(d=c),d=i.round(d)),s.setRelative(a,ci,d,l),0===i.zp0&&(a.xo=a.x,a.yo=a.y),s.touch(a),i.rp0=i.rp1=o}function Ti(e,i){var n=i.stack,r=n.pop(),o=i.z2[r];t.DEBUG&&console.log(i.step,"GC["+e+"]",r),n.push(64*i.dpv.distance(o,ci,e,!1))}function Pi(e,i){var n=i.stack,r=n.pop(),o=n.pop(),a=i.z1[r],s=i.z0[o],l=i.dpv.distance(s,a,e,e);t.DEBUG&&console.log(i.step,"MD["+e+"]",r,o,"->",l),i.stack.push(Math.round(64*l))}function Ii(e,i){var n=i.stack,r=n.pop(),o=i.fv,a=i.pv,s=i.ppem,l=i.deltaBase+16*(e-1),c=i.deltaShift,d=i.z0;t.DEBUG&&console.log(i.step,"DELTAP["+e+"]",r,n);for(var u=0;u<r;u++){var p=n.pop(),h=n.pop();if(l+((240&h)>>4)===s){var f=(15&h)-8;0<=f&&f++,t.DEBUG&&console.log(i.step,"DELTAPFIX",p,"by",f*c);var m=d[p];o.setRelative(m,m,f*c,a)}}}function Ai(e,i){var n=i.stack,r=n.pop();t.DEBUG&&console.log(i.step,"ROUND[]"),n.push(64*i.round(r/64))}function Ri(e,i){var n=i.stack,r=n.pop(),o=i.ppem,a=i.deltaBase+16*(e-1),s=i.deltaShift;t.DEBUG&&console.log(i.step,"DELTAC["+e+"]",r,n);for(var l=0;l<r;l++){var c=n.pop(),d=n.pop();if(a+((240&d)>>4)===o){var u=(15&d)-8;0<=u&&u++;var p=u*s;t.DEBUG&&console.log(i.step,"DELTACFIX",c,"by",p),i.cvt[c]+=p}}}function Oi(e,i){var n,r,o=i.stack,a=o.pop(),s=o.pop(),l=i.z2[a],c=i.z1[s];t.DEBUG&&console.log(i.step,"SDPVTL["+e+"]",a,s),r=e?(n=l.y-c.y,c.x-l.x):(n=c.x-l.x,c.y-l.y),i.dpv=si(n,r)}function Ni(e,i){var n=i.stack,r=i.prog,o=i.ip;t.DEBUG&&console.log(i.step,"PUSHB["+e+"]");for(var a=0;a<e;a++)n.push(r[++o]);i.ip=o}function Di(e,i){var n=i.ip,r=i.prog,o=i.stack;t.DEBUG&&console.log(i.ip,"PUSHW["+e+"]");for(var a=0;a<e;a++){var s=r[++n]<<8|r[++n];32768&s&&(s=-(1+(65535^s))),o.push(s)}i.ip=n}function Li(e,i,n,r,o,a){var s,l,c,d,u=a.stack,p=e&&u.pop(),h=u.pop(),f=a.rp0,m=a.z0[f],g=a.z1[h],v=a.minDis,y=a.fv,b=a.dpv;c=0<=(l=s=b.distance(g,m,!0,!0))?1:-1,l=Math.abs(l),e&&(d=a.cvt[p],r&&Math.abs(l-d)<a.cvCutIn&&(l=d)),n&&l<v&&(l=v),r&&(l=a.round(l)),y.setRelative(g,m,c*l,b),y.touch(g),t.DEBUG&&console.log(a.step,(e?"MIRP[":"MDRP[")+(i?"M":"m")+(n?">":"_")+(r?"R":"_")+(0===o?"Gr":1===o?"Bl":2===o?"Wh":"")+"]",e?p+"("+a.cvt[p]+","+d+")":"",h,"(d =",s,"->",c*l,")"),a.rp1=a.rp0,a.rp2=h,i&&(a.rp0=h)}function Mi(e){this.char=e,this.state={},this.activeState=null}function Bi(e,t,i){this.contextName=i,this.startIndex=e,this.endOffset=t}function Fi(e,t,i){this.contextName=e,this.openRange=null,this.ranges=[],this.checkStart=t,this.checkEnd=i}function Vi(e,t){this.context=e,this.index=t,this.length=e.length,this.current=e[t],this.backtrack=e.slice(0,t),this.lookahead=e.slice(t+1)}function Ui(e){this.eventId=e,this.subscribers=[]}function zi(e){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],function(e){var t=this,i=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];i.forEach((function(e){Object.defineProperty(t.events,e,{value:new Ui(e)})})),e&&i.forEach((function(i){var n=e[i];"function"==typeof n&&t.events[i].subscribe(n)})),["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"].forEach((function(e){t.events[e].subscribe(t.updateContextsRanges)}))}.call(this,e)}function Hi(e){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e)}function ji(e){return/[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(e)}function qi(e){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(e)}Jt.prototype.exec=function(e,i){if("number"!=typeof i)throw new Error("Point size is not a number!");if(!(2<this._errorState)){var n=this.font,r=this._prepState;if(!r||r.ppem!==i){var o=this._fpgmState;if(!o){ui.prototype=di,(o=this._fpgmState=new ui("fpgm",n.tables.fpgm)).funcs=[],o.font=n,t.DEBUG&&(console.log("---EXEC FPGM---"),o.step=-1);try{Wt(o)}catch(e){return console.log("Hinting error in FPGM:"+e),void(this._errorState=3)}}ui.prototype=o,(r=this._prepState=new ui("prep",n.tables.prep)).ppem=i;var a=n.tables.cvt;if(a)for(var s=r.cvt=new Array(a.length),l=i/n.unitsPerEm,c=0;c<a.length;c++)s[c]=a[c]*l;else r.cvt=[];t.DEBUG&&(console.log("---EXEC PREP---"),r.step=-1);try{Wt(r)}catch(e){this._errorState<2&&console.log("Hinting error in PREP:"+e),this._errorState=2}}if(!(1<this._errorState))try{return Gt(e,r)}catch(e){return this._errorState<1&&(console.log("Hinting error:"+e),console.log("Note: further hinting errors are silenced")),void(this._errorState=1)}}},Gt=function(e,i){var n,r,o,a=i.ppem/i.font.unitsPerEm,s=a,l=e.components;if(ui.prototype=i,l){var c=i.font;r=[],n=[];for(var d=0;d<l.length;d++){var u=l[d],p=c.glyphs.get(u.glyphIndex);o=new ui("glyf",p.instructions),t.DEBUG&&(console.log("---EXEC COMP "+d+"---"),o.step=-1),Kt(p,o,a,s);for(var h=Math.round(u.dx*a),f=Math.round(u.dy*s),m=o.gZone,g=o.contours,v=0;v<m.length;v++){var y=m[v];y.xTouched=y.yTouched=!1,y.xo=y.x=y.x+h,y.yo=y.y=y.y+f}var b=r.length;r.push.apply(r,m);for(var w=0;w<g.length;w++)n.push(g[w]+b)}e.instructions&&!o.inhibitGridFit&&((o=new ui("glyf",e.instructions)).gZone=o.z0=o.z1=o.z2=r,o.contours=n,r.push(new li(0,0),new li(Math.round(e.advanceWidth*a),0)),t.DEBUG&&(console.log("---EXEC COMPOSITE---"),o.step=-1),Wt(o),r.length-=2)}else o=new ui("glyf",e.instructions),t.DEBUG&&(console.log("---EXEC GLYPH---"),o.step=-1),Kt(e,o,a,s),r=o.gZone;return r},Kt=function(e,i,n,r){for(var o,a,s,l=e.points||[],c=l.length,d=i.gZone=i.z0=i.z1=i.z2=[],u=i.contours=[],p=0;p<c;p++)o=l[p],d[p]=new li(o.x*n,o.y*r,o.lastPointOfContour,o.onCurve);for(var h=0;h<c;h++)o=d[h],a||(a=o,u.push(h)),o.lastPointOfContour?((o.nextPointOnContour=a).prevPointOnContour=o,a=void 0):(s=d[h+1],(o.nextPointOnContour=s).prevPointOnContour=o);if(!i.inhibitGridFit){if(t.DEBUG){console.log("PROCESSING GLYPH",i.stack);for(var f=0;f<c;f++)console.log(f,d[f].x,d[f].y)}if(d.push(new li(0,0),new li(Math.round(e.advanceWidth*n),0)),Wt(i),d.length-=2,t.DEBUG){console.log("FINISHED GLYPH",i.stack);for(var m=0;m<c;m++)console.log(m,d[m].x,d[m].y)}}},Wt=function(e){var i=e.prog;if(i){var n,r=i.length;for(e.ip=0;e.ip<r;e.ip++){if(t.DEBUG&&e.step++,!(n=$t[i[e.ip]]))throw new Error("unknown instruction: 0x"+Number(i[e.ip]).toString(16));n(e)}}},$t=[fi.bind(void 0,oi),fi.bind(void 0,ri),mi.bind(void 0,oi),mi.bind(void 0,ri),gi.bind(void 0,oi),gi.bind(void 0,ri),vi.bind(void 0,0),vi.bind(void 0,1),yi.bind(void 0,0),yi.bind(void 0,1),function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"SPVFS[]",n,r),e.pv=e.dpv=si(r,n)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"SPVFS[]",n,r),e.fv=si(r,n)},function(e){var i=e.stack,n=e.pv;t.DEBUG&&console.log(e.step,"GPV[]"),i.push(16384*n.x),i.push(16384*n.y)},function(e){var i=e.stack,n=e.fv;t.DEBUG&&console.log(e.step,"GFV[]"),i.push(16384*n.x),i.push(16384*n.y)},function(e){e.fv=e.pv,t.DEBUG&&console.log(e.step,"SFVTPV[]")},function(e){var i=e.stack,n=i.pop(),r=i.pop(),o=i.pop(),a=i.pop(),s=i.pop(),l=e.z0,c=e.z1,d=l[n],u=l[r],p=c[o],h=c[a],f=e.z2[s];t.DEBUG&&console.log("ISECT[], ",n,r,o,a,s);var m=d.x,g=d.y,v=u.x,y=u.y,b=p.x,w=p.y,S=h.x,C=h.y,k=(m-v)*(w-C)-(g-y)*(b-S),x=m*y-g*v,_=b*C-w*S;f.x=(x*(b-S)-_*(m-v))/k,f.y=(x*(w-C)-_*(g-y))/k},function(e){e.rp0=e.stack.pop(),t.DEBUG&&console.log(e.step,"SRP0[]",e.rp0)},function(e){e.rp1=e.stack.pop(),t.DEBUG&&console.log(e.step,"SRP1[]",e.rp1)},function(e){e.rp2=e.stack.pop(),t.DEBUG&&console.log(e.step,"SRP2[]",e.rp2)},function(e){var i=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZP0[]",i),e.zp0=i){case 0:e.tZone||pi(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var i=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZP1[]",i),e.zp1=i){case 0:e.tZone||pi(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var i=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZP2[]",i),e.zp2=i){case 0:e.tZone||pi(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){var i=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZPS[]",i),e.zp0=e.zp1=e.zp2=i,i){case 0:e.tZone||pi(e),e.z0=e.z1=e.z2=e.tZone;break;case 1:e.z0=e.z1=e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}},function(e){e.loop=e.stack.pop(),t.DEBUG&&console.log(e.step,"SLOOP[]",e.loop)},function(e){t.DEBUG&&console.log(e.step,"RTG[]"),e.round=Qt},function(e){t.DEBUG&&console.log(e.step,"RTHG[]"),e.round=ei},function(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SMD[]",i),e.minDis=i/64},function(e){t.DEBUG&&console.log(e.step,"ELSE[]"),hi(e,!1)},function(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"JMPR[]",i),e.ip+=i-1},function(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SCVTCI[]",i),e.cvCutIn=i/64},void 0,void 0,function(e){var i=e.stack;t.DEBUG&&console.log(e.step,"DUP[]"),i.push(i[i.length-1])},bi,function(e){t.DEBUG&&console.log(e.step,"CLEAR[]"),e.stack.length=0},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"SWAP[]"),i.push(n),i.push(r)},function(e){var i=e.stack;t.DEBUG&&console.log(e.step,"DEPTH[]"),i.push(i.length)},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"CINDEX[]",n),i.push(i[i.length-n])},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"MINDEX[]",n),i.push(i.splice(i.length-n,1)[0])},void 0,void 0,void 0,function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"LOOPCALL[]",n,r);var o=e.ip,a=e.prog;e.prog=e.funcs[n];for(var s=0;s<r;s++)Wt(e),t.DEBUG&&console.log(++e.step,s+1<r?"next loopcall":"done loopcall",s);e.ip=o,e.prog=a},function(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"CALL[]",i);var n=e.ip,r=e.prog;e.prog=e.funcs[i],Wt(e),e.ip=n,e.prog=r,t.DEBUG&&console.log(++e.step,"returning from",i)},function(e){if("fpgm"!==e.env)throw new Error("FDEF not allowed here");var i=e.stack,n=e.prog,r=e.ip,o=i.pop(),a=r;for(t.DEBUG&&console.log(e.step,"FDEF[]",o);45!==n[++r];);e.ip=r,e.funcs[o]=n.slice(a+1,r)},void 0,wi.bind(void 0,0),wi.bind(void 0,1),Si.bind(void 0,oi),Si.bind(void 0,ri),Ci.bind(void 0,0),Ci.bind(void 0,1),ki.bind(void 0,0),ki.bind(void 0,1),xi.bind(void 0,0),xi.bind(void 0,1),function(e){for(var i=e.stack,n=e.loop,r=e.fv,o=i.pop()/64,a=e.z2;n--;){var s=i.pop(),l=a[s];t.DEBUG&&console.log(e.step,(1<e.loop?"loop "+(e.loop-n)+": ":"")+"SHPIX[]",s,o),r.setRelative(l,l,o),r.touch(l)}e.loop=1},function(e){for(var i=e.stack,n=e.rp1,r=e.rp2,o=e.loop,a=e.z0[n],s=e.z1[r],l=e.fv,c=e.dpv,d=e.z2;o--;){var u=i.pop(),p=d[u];t.DEBUG&&console.log(e.step,(1<e.loop?"loop "+(e.loop-o)+": ":"")+"IP[]",u,n,"<->",r),l.interpolate(p,a,s,c),l.touch(p)}e.loop=1},_i.bind(void 0,0),_i.bind(void 0,1),function(e){for(var i=e.stack,n=e.rp0,r=e.z0[n],o=e.loop,a=e.fv,s=e.pv,l=e.z1;o--;){var c=i.pop(),d=l[c];t.DEBUG&&console.log(e.step,(1<e.loop?"loop "+(e.loop-o)+": ":"")+"ALIGNRP[]",c),a.setRelative(d,r,0,s),a.touch(d)}e.loop=1},function(e){t.DEBUG&&console.log(e.step,"RTDG[]"),e.round=Zt},Ei.bind(void 0,0),Ei.bind(void 0,1),function(e){var i=e.prog,n=e.ip,r=e.stack,o=i[++n];t.DEBUG&&console.log(e.step,"NPUSHB[]",o);for(var a=0;a<o;a++)r.push(i[++n]);e.ip=n},function(e){var i=e.ip,n=e.prog,r=e.stack,o=n[++i];t.DEBUG&&console.log(e.step,"NPUSHW[]",o);for(var a=0;a<o;a++){var s=n[++i]<<8|n[++i];32768&s&&(s=-(1+(65535^s))),r.push(s)}e.ip=i},function(e){var i=e.stack,n=e.store;n||(n=e.store=[]);var r=i.pop(),o=i.pop();t.DEBUG&&console.log(e.step,"WS",r,o),n[o]=r},function(e){var i=e.stack,n=e.store,r=i.pop();t.DEBUG&&console.log(e.step,"RS",r);var o=n&&n[r]||0;i.push(o)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"WCVTP",n,r),e.cvt[r]=n/64},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"RCVT",n),i.push(64*e.cvt[n])},Ti.bind(void 0,0),Ti.bind(void 0,1),void 0,Pi.bind(void 0,0),Pi.bind(void 0,1),function(e){t.DEBUG&&console.log(e.step,"MPPEM[]"),e.stack.push(e.ppem)},void 0,function(e){t.DEBUG&&console.log(e.step,"FLIPON[]"),e.autoFlip=!0},void 0,void 0,function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"LT[]",n,r),i.push(r<n?1:0)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"LTEQ[]",n,r),i.push(r<=n?1:0)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"GT[]",n,r),i.push(n<r?1:0)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"GTEQ[]",n,r),i.push(n<=r?1:0)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"EQ[]",n,r),i.push(n===r?1:0)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"NEQ[]",n,r),i.push(n!==r?1:0)},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"ODD[]",n),i.push(Math.trunc(n)%2?1:0)},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"EVEN[]",n),i.push(Math.trunc(n)%2?0:1)},function(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"IF[]",i),i||(hi(e,!0),t.DEBUG&&console.log(e.step,"EIF[]"))},function(e){t.DEBUG&&console.log(e.step,"EIF[]")},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"AND[]",n,r),i.push(n&&r?1:0)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"OR[]",n,r),i.push(n||r?1:0)},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"NOT[]",n),i.push(n?0:1)},Ii.bind(void 0,1),function(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SDB[]",i),e.deltaBase=i},function(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SDS[]",i),e.deltaShift=Math.pow(.5,i)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"ADD[]",n,r),i.push(r+n)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"SUB[]",n,r),i.push(r-n)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"DIV[]",n,r),i.push(64*r/n)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"MUL[]",n,r),i.push(r*n/64)},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"ABS[]",n),i.push(Math.abs(n))},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"NEG[]",n),i.push(-n)},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"FLOOR[]",n),i.push(64*Math.floor(n/64))},function(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"CEILING[]",n),i.push(64*Math.ceil(n/64))},Ai.bind(void 0,0),Ai.bind(void 0,1),Ai.bind(void 0,2),Ai.bind(void 0,3),void 0,void 0,void 0,void 0,function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"WCVTF[]",n,r),e.cvt[r]=n*e.ppem/e.font.unitsPerEm},Ii.bind(void 0,2),Ii.bind(void 0,3),Ri.bind(void 0,1),Ri.bind(void 0,2),Ri.bind(void 0,3),function(e){var i,n=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SROUND[]",n),e.round=ni,192&n){case 0:i=.5;break;case 64:i=1;break;case 128:i=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=i,48&n){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*i;break;case 32:e.srPhase=.5*i;break;case 48:e.srPhase=.75*i;break;default:throw new Error("invalid SROUND value")}n&=15,e.srThreshold=0===n?0:(n/8-.5)*i},function(e){var i,n=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"S45ROUND[]",n),e.round=ni,192&n){case 0:i=Math.sqrt(2)/2;break;case 64:i=Math.sqrt(2);break;case 128:i=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=i,48&n){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*i;break;case 32:e.srPhase=.5*i;break;case 48:e.srPhase=.75*i;break;default:throw new Error("invalid S45ROUND value")}n&=15,e.srThreshold=0===n?0:(n/8-.5)*i},void 0,void 0,function(e){t.DEBUG&&console.log(e.step,"ROFF[]"),e.round=Xt},void 0,function(e){t.DEBUG&&console.log(e.step,"RUTG[]"),e.round=ti},function(e){t.DEBUG&&console.log(e.step,"RDTG[]"),e.round=ii},bi,bi,void 0,void 0,void 0,void 0,void 0,function(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SCANCTRL[]",i)},Oi.bind(void 0,0),Oi.bind(void 0,1),function(e){var i=e.stack,n=i.pop(),r=0;t.DEBUG&&console.log(e.step,"GETINFO[]",n),1&n&&(r=35),32&n&&(r|=4096),i.push(r)},void 0,function(e){var i=e.stack,n=i.pop(),r=i.pop(),o=i.pop();t.DEBUG&&console.log(e.step,"ROLL[]"),i.push(r),i.push(n),i.push(o)},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"MAX[]",n,r),i.push(Math.max(r,n))},function(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"MIN[]",n,r),i.push(Math.min(r,n))},function(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SCANTYPE[]",i)},function(e){var i=e.stack.pop(),n=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"INSTCTRL[]",i,n),i){case 1:return void(e.inhibitGridFit=!!n);case 2:return void(e.ignoreCvt=!!n);default:throw new Error("invalid INSTCTRL[] selector")}},void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,Ni.bind(void 0,1),Ni.bind(void 0,2),Ni.bind(void 0,3),Ni.bind(void 0,4),Ni.bind(void 0,5),Ni.bind(void 0,6),Ni.bind(void 0,7),Ni.bind(void 0,8),Di.bind(void 0,1),Di.bind(void 0,2),Di.bind(void 0,3),Di.bind(void 0,4),Di.bind(void 0,5),Di.bind(void 0,6),Di.bind(void 0,7),Di.bind(void 0,8),Li.bind(void 0,0,0,0,0,0),Li.bind(void 0,0,0,0,0,1),Li.bind(void 0,0,0,0,0,2),Li.bind(void 0,0,0,0,0,3),Li.bind(void 0,0,0,0,1,0),Li.bind(void 0,0,0,0,1,1),Li.bind(void 0,0,0,0,1,2),Li.bind(void 0,0,0,0,1,3),Li.bind(void 0,0,0,1,0,0),Li.bind(void 0,0,0,1,0,1),Li.bind(void 0,0,0,1,0,2),Li.bind(void 0,0,0,1,0,3),Li.bind(void 0,0,0,1,1,0),Li.bind(void 0,0,0,1,1,1),Li.bind(void 0,0,0,1,1,2),Li.bind(void 0,0,0,1,1,3),Li.bind(void 0,0,1,0,0,0),Li.bind(void 0,0,1,0,0,1),Li.bind(void 0,0,1,0,0,2),Li.bind(void 0,0,1,0,0,3),Li.bind(void 0,0,1,0,1,0),Li.bind(void 0,0,1,0,1,1),Li.bind(void 0,0,1,0,1,2),Li.bind(void 0,0,1,0,1,3),Li.bind(void 0,0,1,1,0,0),Li.bind(void 0,0,1,1,0,1),Li.bind(void 0,0,1,1,0,2),Li.bind(void 0,0,1,1,0,3),Li.bind(void 0,0,1,1,1,0),Li.bind(void 0,0,1,1,1,1),Li.bind(void 0,0,1,1,1,2),Li.bind(void 0,0,1,1,1,3),Li.bind(void 0,1,0,0,0,0),Li.bind(void 0,1,0,0,0,1),Li.bind(void 0,1,0,0,0,2),Li.bind(void 0,1,0,0,0,3),Li.bind(void 0,1,0,0,1,0),Li.bind(void 0,1,0,0,1,1),Li.bind(void 0,1,0,0,1,2),Li.bind(void 0,1,0,0,1,3),Li.bind(void 0,1,0,1,0,0),Li.bind(void 0,1,0,1,0,1),Li.bind(void 0,1,0,1,0,2),Li.bind(void 0,1,0,1,0,3),Li.bind(void 0,1,0,1,1,0),Li.bind(void 0,1,0,1,1,1),Li.bind(void 0,1,0,1,1,2),Li.bind(void 0,1,0,1,1,3),Li.bind(void 0,1,1,0,0,0),Li.bind(void 0,1,1,0,0,1),Li.bind(void 0,1,1,0,0,2),Li.bind(void 0,1,1,0,0,3),Li.bind(void 0,1,1,0,1,0),Li.bind(void 0,1,1,0,1,1),Li.bind(void 0,1,1,0,1,2),Li.bind(void 0,1,1,0,1,3),Li.bind(void 0,1,1,1,0,0),Li.bind(void 0,1,1,1,0,1),Li.bind(void 0,1,1,1,0,2),Li.bind(void 0,1,1,1,0,3),Li.bind(void 0,1,1,1,1,0),Li.bind(void 0,1,1,1,1,1),Li.bind(void 0,1,1,1,1,2),Li.bind(void 0,1,1,1,1,3)],Mi.prototype.setState=function(e,t){return this.state[e]=t,this.activeState={key:e,value:this.state[e]},this.activeState},Mi.prototype.getState=function(e){return this.state[e]||null},zi.prototype.inboundIndex=function(e){return 0<=e&&e<this.tokens.length},zi.prototype.composeRUD=function(e){var t=this,i=e.map((function(e){return t[e[0]].apply(t,e.slice(1).concat(!0))})),n=function(e){return"object"==typeof e&&e.hasOwnProperty("FAIL")};if(i.every(n))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:i.filter(n)};this.dispatch("composeRUD",[i.filter((function(e){return!n(e)}))])},zi.prototype.replaceRange=function(e,t,i,n){t=null!==t?t:this.tokens.length;var r=i.every((function(e){return e instanceof Mi}));if(!isNaN(e)&&this.inboundIndex(e)&&r){var o=this.tokens.splice.apply(this.tokens,[e,t].concat(i));return n||this.dispatch("replaceToken",[e,t,i]),[o,i]}return{FAIL:"replaceRange: invalid tokens or startIndex."}},zi.prototype.replaceToken=function(e,t,i){if(!isNaN(e)&&this.inboundIndex(e)&&t instanceof Mi){var n=this.tokens.splice(e,1,t);return i||this.dispatch("replaceToken",[e,t]),[n[0],t]}return{FAIL:"replaceToken: invalid token or index."}},zi.prototype.removeRange=function(e,t,i){t=isNaN(t)?this.tokens.length:t;var n=this.tokens.splice(e,t);return i||this.dispatch("removeRange",[n,e,t]),n},zi.prototype.removeToken=function(e,t){if(isNaN(e)||!this.inboundIndex(e))return{FAIL:"removeToken: invalid token index."};var i=this.tokens.splice(e,1);return t||this.dispatch("removeToken",[i,e]),i},zi.prototype.insertToken=function(e,t,i){return e.every((function(e){return e instanceof Mi}))?(this.tokens.splice.apply(this.tokens,[t,0].concat(e)),i||this.dispatch("insertToken",[e,t]),e):{FAIL:"insertToken: invalid token(s)."}},zi.prototype.registerModifier=function(e,t,i){this.events.newToken.subscribe((function(n,r){var o=[n,r],a=[n,r];if(null===t||!0===t.apply(this,o)){var s=i.apply(this,a);n.setState(e,s)}})),this.registeredModifiers.push(e)},Ui.prototype.subscribe=function(e){return"function"==typeof e?this.subscribers.push(e)-1:{FAIL:"invalid '"+this.eventId+"' event handler"}},Ui.prototype.unsubscribe=function(e){this.subscribers.splice(e,1)},Vi.prototype.setCurrentIndex=function(e){this.index=e,this.current=this.context[e],this.backtrack=this.context.slice(0,e),this.lookahead=this.context.slice(e+1)},Vi.prototype.get=function(e){switch(!0){case 0===e:return this.current;case e<0&&Math.abs(e)<=this.backtrack.length:return this.backtrack.slice(e)[0];case 0<e&&e<=this.lookahead.length:return this.lookahead[e-1];default:return null}},zi.prototype.rangeToText=function(e){if(e instanceof Bi)return this.getRangeTokens(e).map((function(e){return e.char})).join("")},zi.prototype.getText=function(){return this.tokens.map((function(e){return e.char})).join("")},zi.prototype.getContext=function(e){return this.registeredContexts[e]||null},zi.prototype.on=function(e,t){var i=this.events[e];return i?i.subscribe(t):null},zi.prototype.dispatch=function(e,t){var i=this,n=this.events[e];n instanceof Ui&&n.subscribers.forEach((function(e){e.apply(i,t||[])}))},zi.prototype.registerContextChecker=function(e,t,i){if(this.getContext(e))return{FAIL:"context name '"+e+"' is already registered."};if("function"!=typeof t)return{FAIL:"missing context start check."};if("function"!=typeof i)return{FAIL:"missing context end check."};var n=new Fi(e,t,i);return this.registeredContexts[e]=n,this.contextCheckers.push(n),n},zi.prototype.getRangeTokens=function(e){var t=e.startIndex+e.endOffset;return[].concat(this.tokens.slice(e.startIndex,t))},zi.prototype.getContextRanges=function(e){var t=this.getContext(e);return t?t.ranges:{FAIL:"context checker '"+e+"' is not registered."}},zi.prototype.resetContextsRanges=function(){var e=this.registeredContexts;for(var t in e)e.hasOwnProperty(t)&&(e[t].ranges=[])},zi.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var e=this.tokens.map((function(e){return e.char})),t=0;t<e.length;t++){var i=new Vi(e,t);this.runContextCheck(i)}this.dispatch("updateContextsRanges",[this.registeredContexts])},zi.prototype.setEndOffset=function(e,t){var i=new Bi(this.getContext(t).openRange.startIndex,e,t),n=this.getContext(t).ranges;return i.rangeId=t+"."+n.length,n.push(i),this.getContext(t).openRange=null,i},zi.prototype.runContextCheck=function(e){var t=this,i=e.index;this.contextCheckers.forEach((function(n){var r=n.contextName,o=t.getContext(r).openRange;if(!o&&n.checkStart(e)&&(o=new Bi(i,null,r),t.getContext(r).openRange=o,t.dispatch("contextStart",[r,i])),o&&n.checkEnd(e)){var a=i-o.startIndex+1,s=t.setEndOffset(a,r);t.dispatch("contextEnd",[r,s])}}))},zi.prototype.tokenize=function(e){this.tokens=[],this.resetContextsRanges();var t=Array.from(e);this.dispatch("start");for(var i=0;i<t.length;i++){var n=t[i],r=new Vi(t,i);this.dispatch("next",[r]),this.runContextCheck(r);var o=new Mi(n);this.tokens.push(o),this.dispatch("newToken",[o,r])}return this.dispatch("end",[this.tokens]),this.tokens};var $i={arabicWordStartCheck:function(e){var t=e.current,i=e.get(-1);return null===i&&Hi(t)||!Hi(i)&&Hi(t)},arabicWordEndCheck:function(e){var t=e.get(1);return null===t||!Hi(t)}},Wi={arabicSentenceStartCheck:function(e){var t=e.current,i=e.get(-1);return(Hi(t)||qi(t))&&!Hi(i)},arabicSentenceEndCheck:function(e){var t=e.get(1);switch(!0){case null===t:return!0;case!Hi(t)&&!qi(t):var i=/\s/.test(t);if(!i)return!0;if(i&&!e.lookahead.some((function(e){return Hi(e)||qi(e)})))return!0;break;default:return!1}}};function Gi(e){var t=this.features.arab,i=this.tokenizer.getRangeTokens(e);if(1!==i.length){var n=function(e,i,n){if(t.hasOwnProperty(e)){var r,o=(r=t[e].lookup(n)||null,1===r.length&&12===r[0].id&&r[0].substitution)[0];return 0<=o?i.setState(e,o):void 0}},r=new Vi(i,0),o=new Vi(i.map((function(e){return e.char})),0);i.forEach((function(e,t){if(!qi(e.char)){r.setCurrentIndex(t),o.setCurrentIndex(t);var i=0;switch(function(e){for(var t=[].concat(e.backtrack),i=t.length-1;0<=i;i--){var n=t[i],r=ji(n),o=qi(n);if(!r&&!o)return!0;if(r)return!1}return!1}(o)&&(i|=1),function(e){if(ji(e.current))return!1;for(var t=0;t<e.lookahead.length;t++)if(!qi(e.lookahead[t]))return!0;return!1}(o)&&(i|=2),i){case 0:return;case 1:n("fina",e,r);break;case 2:n("init",e,r);break;case 3:n("medi",e,r)}}}))}}function Ki(e){this.baseDir=e||"ltr",this.tokenizer=new zi,this.features=[]}function Yi(){if(-1===this.tokenizer.registeredModifiers.indexOf("glyphIndex"))throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function Ji(){var e=this;this.features.hasOwnProperty("arab")&&this.features.arab.hasOwnProperty("rlig")&&(Yi.call(this),this.tokenizer.getContextRanges("arabicWord").forEach((function(t){(function(e){var t=this.features.arab;if(t.hasOwnProperty("rlig"))for(var i=this.tokenizer.getRangeTokens(e),n=0;n<i.length;n++){var r=new Vi(i,n),o=t.rlig.lookup(r)||null,a=1===o.length&&63===o[0].id&&o[0].substitution,s=1===o.length&&41===o[0].id&&o[0].substitution[0],l=i[n];if(s){l.setState("rlig",[s.ligGlyph]);for(var c=0;c<s.components.length;c++){var d=s.components[c],u=r.get(c+1);u.activeState.value===d&&(u.state.deleted=!0)}}else if(a){var p=a&&1===a.length&&12===a[0].id&&a[0].substitution;p&&0<=p&&l.setState("rlig",p)}}}).call(e,t)})))}Ki.prototype.setText=function(e){this.text=e},Ki.prototype.contextChecks={arabicWordCheck:$i,arabicSentenceCheck:Wi},Ki.prototype.subscribeArabicForms=function(e){var t=this;this.tokenizer.events.contextEnd.subscribe((function(i,n){if("arabicWord"===i)return Gi.call(t.tokenizer,n,e)}))},Ki.prototype.applyFeatures=function(e){for(var t=0;t<e.length;t++){var i=e[t];if(i){var n=i.script;this.features[n]||(this.features[n]={}),this.features[n][i.tag]=i}}},Ki.prototype.registerModifier=function(e,t,i){this.tokenizer.registerModifier(e,t,i)},Ki.prototype.processText=function(e){this.text&&this.text===e||(this.setText(e),function(){return function(){var e=this.contextChecks.arabicWordCheck;return this.tokenizer.registerContextChecker("arabicWord",e.arabicWordStartCheck,e.arabicWordEndCheck)}.call(this),function(){var e=this.contextChecks.arabicSentenceCheck;return this.tokenizer.registerContextChecker("arabicSentence",e.arabicSentenceStartCheck,e.arabicSentenceEndCheck)}.call(this),this.tokenizer.tokenize(this.text)}.call(this),function(){var e=this;this.features.hasOwnProperty("arab")&&(Yi.call(this),this.tokenizer.getContextRanges("arabicWord").forEach((function(t){Gi.call(e,t)})))}.call(this),Ji.call(this),function(){var e=this;this.tokenizer.getContextRanges("arabicSentence").forEach((function(t){var i=e.tokenizer.getRangeTokens(t);e.tokenizer.replaceRange(t.startIndex,t.endOffset,i.reverse())}))}.call(this))},Ki.prototype.getBidiText=function(e){return this.processText(e),this.tokenizer.getText()},Ki.prototype.getTextGlyphs=function(e){this.processText(e);for(var t=[],i=0;i<this.tokenizer.tokens.length;i++){var n=this.tokenizer.tokens[i];if(!n.state.deleted){var r=n.activeState.value;t.push(Array.isArray(r)?r[0]:r)}}return t};var Xi="ltr";function Qi(e,t){this.font=e,this.features={},Xi=t||Xi}function Zi(e,t,i,n){this.tag=e,this.featureRef=t,this.lookups=i.lookups,this.script=n}function en(e){this.table=e}function tn(e){this.ligatureSets=e}function nn(e,t,i){this.lookups=e,this.subtable=i,this.lookupTable=t,i.hasOwnProperty("coverage")&&(this.coverage=new en(i.coverage)),i.hasOwnProperty("inputCoverage")&&(this.inputCoverage=i.inputCoverage.map((function(e){return new en(e)}))),i.hasOwnProperty("backtrackCoverage")&&(this.backtrackCoverage=i.backtrackCoverage.map((function(e){return new en(e)}))),i.hasOwnProperty("lookaheadCoverage")&&(this.lookaheadCoverage=i.lookaheadCoverage.map((function(e){return new en(e)}))),i.hasOwnProperty("ligatureSets")&&(this.ligatureSets=new tn(i.ligatureSets))}function rn(e,t){this.index=e,this.subtables=t[e].subtables.map((function(i){return new nn(t,t[e],i)}))}function on(e,t){this.lookups=t.map((function(t){return new rn(t,e)}))}function an(e,t){for(var i=[],n=0;n<e.length;n++){var r=e[n],o=t.current.activeState.value;o=Array.isArray(o)?o[0]:o;var a=r.lookup(o);-1!==a&&i.push(a)}return i.length!==e.length?-1:i}function sn(e){(e=e||{}).empty||(Vt(e.familyName,"When creating a new Font object, familyName is required."),Vt(e.styleName,"When creating a new Font object, styleName is required."),Vt(e.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Vt(e.ascender,"When creating a new Font object, ascender is required."),Vt(e.descender,"When creating a new Font object, descender is required."),Vt(e.descender<0,"Descender should be negative (e.g. -512)."),this.names={fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||(e.familyName+e.styleName).replace(/\s/g,"")},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}},this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.tables={os2:{usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,fsSelection:e.fsSelection||this.fsSelectionValues.REGULAR}}),this.supported=!0,this.glyphs=new Se.GlyphSet(this,e.glyphs||[]),this.encoding=new he(this),this.position=new Dt(this),this.substitution=new Lt(this),this.tables=this.tables||{},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:"truetype"===this.outlinesFormat?this._hinting=new Jt(this):void 0}})}function ln(e,t,i,n){var r={},o=new ae.Parser(e,t);r.name=n[o.parseUShort()]||{},o.skip("uShort",1),r.coordinates={};for(var a=0;a<i.length;++a)r.coordinates[i[a].tag]=o.parseFixed();return r}tn.prototype.lookup=function(e,t){for(var i=this.ligatureSets[t],n=function(e,t){if(e.length>t.length)return null;for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},r=0;r<i.length;r++){var o=i[r],a=e.lookahead.map((function(e){return e.activeState.value}));if("rtl"===Xi&&a.reverse(),n(o.components,a))return o}return null},rn.prototype.lookup=function(e){for(var t=[],i=0;i<this.subtables.length;i++){var n=this.subtables[i].lookup(e);(null!==n||n.length)&&(t=t.concat(n))}return t},nn.prototype.lookup=function(e){var t=[],i=this.lookupTable.lookupType,n=this.subtable.substFormat;if(1===i&&2===n){var r=function(e){var t=e.current.activeState.value;t=Array.isArray(t)?t[0]:t;var i=this.coverage.lookup(t);return-1===i?[]:[this.subtable.substitute[i]]}.call(this,e);0<r.length&&t.push({id:12,substitution:r})}if(6===i&&3===n){var o=function(e){var t=this.inputCoverage.length+this.lookaheadCoverage.length+this.backtrackCoverage.length;if(e.context.length<t)return[];var i=an(this.inputCoverage,e);if(-1===i)return[];var n=this.inputCoverage.length-1;if(e.lookahead.length<this.lookaheadCoverage.length)return[];for(var r=e.lookahead.slice(n);r.length&&qi(r[0].char);)r.shift();var o=new Vi(r,0),a=an(this.lookaheadCoverage,o),s=[].concat(e.backtrack);for(s.reverse();s.length&&qi(s[0].char);)s.shift();if(s.length<this.backtrackCoverage.length)return[];var l=new Vi(s,0),c=an(this.backtrackCoverage,l),d=[];if(i.length===this.inputCoverage.length&&a.length===this.lookaheadCoverage.length&&c.length===this.backtrackCoverage.length)for(var u=this.subtable.lookupRecords,p=0;p<u.length;p++)for(var h=u[p],f=0;f<i.length;f++){var m=new Vi([e.get(f)],0),g=new rn(h.lookupListIndex,this.lookups).lookup(m);d=d.concat(g)}return d}.call(this,e);0<o.length&&t.push({id:63,substitution:o})}if(4===i&&1===n){var a=function(e){var t=e.current.activeState.value,i=this.coverage.lookup(t);if(-1===i)return[];var n=this.ligatureSets.lookup(e,i);return n?[n]:[]}.call(this,e);0<a.length&&t.push({id:41,substitution:a})}return t},en.prototype.lookup=function(e){if(!e)return-1;switch(this.table.format){case 1:return this.table.glyphs.indexOf(e);case 2:for(var t=this.table.ranges,i=0;i<t.length;i++){var n=t[i];if(e>=n.start&&e<=n.end){var r=e-n.start;return n.index+r}}break;default:return-1}return-1},Zi.prototype.lookup=function(e){for(var t=[],i=0;i<this.lookups.length;i++){var n=this.lookups[i].lookup(e);(null!==n||n.length)&&(t=t.concat(n))}return t},Qi.prototype.getScriptFeaturesIndexes=function(e){if(!e)return[];if(!this.font.tables.gsub)return[];for(var t=this.font.tables.gsub.scripts,i=0;i<t.length;i++){var n=t[i];if(n.tag===e)return n.script.defaultLangSys.featureIndexes;var r=n.langSysRecords;if(r)for(var o=0;o<r.length;o++){var a=r[o];if(a.tag===e)return a.langSys.featureIndexes}}return[]},Qi.prototype.mapTagsToFeatures=function(e,t){for(var i={},n=0;n<e.length;n++){var r=e[n].feature,o=e[n].tag,a=new on(this.font.tables.gsub.lookups,r.lookupListIndexes);i[o]=new Zi(o,r,a,t)}this.features[t].tags=i},Qi.prototype.getScriptFeatures=function(e){var t=this.features[e];if(this.features.hasOwnProperty(e))return t;var i=this.getScriptFeaturesIndexes(e);if(!i)return null;var n=this.font.tables.gsub;return t=i.map((function(e){return n.features[e]})),this.features[e]=t,this.mapTagsToFeatures(t,e),t},Qi.prototype.getFeature=function(e){return this.font?(this.features.hasOwnProperty(e.script)||this.getScriptFeatures(e.script),this.features[e.script].tags[e.tag]||null):{FAIL:"No font was found"}},sn.prototype.hasChar=function(e){return null!==this.encoding.charToGlyphIndex(e)},sn.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},sn.prototype.charToGlyph=function(e){var t=this.charToGlyphIndex(e),i=this.glyphs.get(t);return i||(i=this.glyphs.get(0)),i},sn.prototype.stringToGlyphs=function(e,t){var i=this;t=t||this.defaultRenderOptions;var n=new Ki;n.registerModifier("glyphIndex",null,(function(e){return i.charToGlyphIndex(e.char)}));var r=new Qi(this);n.applyFeatures(["init","medi","fina","rlig"].map((function(e){var t={tag:e,script:"arab"},i=r.getFeature(t);if(i)return i})));var o=n.getTextGlyphs(e),a=o.length;if(t.features){var s=t.script||this.substitution.getDefaultScriptName(),l=[];t.features.liga&&(l=l.concat(this.substitution.getFeature("liga",s,t.language))),t.features.rlig&&(l=l.concat(this.substitution.getFeature("rlig",s,t.language)));for(var c=0;c<a;c+=1)for(var d=0;d<l.length;d++){for(var u=l[d],p=u.sub,h=p.length,f=0;f<h&&p[f]===o[c+f];)f++;f===h&&(o.splice(c,h,u.by),a=a-h+1)}}for(var m=new Array(a),g=this.glyphs.get(0),v=0;v<a;v+=1)m[v]=i.glyphs.get(o[v])||g;return m},sn.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},sn.prototype.nameToGlyph=function(e){var t=this.nameToGlyphIndex(e),i=this.glyphs.get(t);return i||(i=this.glyphs.get(0)),i},sn.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""},sn.prototype.getKerningValue=function(e,t){e=e.index||e,t=t.index||t;var i=this.position.defaultKerningTables;return i?this.position.getKerningValue(i,e,t):this.kerningPairs[e+","+t]||0},sn.prototype.defaultRenderOptions={kerning:!0,features:{liga:!0,rlig:!0}},sn.prototype.forEachGlyph=function(e,t,i,n,r,o){t=void 0!==t?t:0,i=void 0!==i?i:0,n=void 0!==n?n:72,r=r||this.defaultRenderOptions;var a,s=1/this.unitsPerEm*n,l=this.stringToGlyphs(e,r);if(r.kerning){var c=r.script||this.position.getDefaultScriptName();a=this.position.getKerningTables(c,r.language)}for(var d=0;d<l.length;d+=1){var u=l[d];o.call(this,u,t,i,n,r),u.advanceWidth&&(t+=u.advanceWidth*s),r.kerning&&d<l.length-1&&(t+=(a?this.position.getKerningValue(a,u.index,l[d+1].index):this.getKerningValue(u,l[d+1]))*s),r.letterSpacing?t+=r.letterSpacing*n:r.tracking&&(t+=r.tracking/1e3*n)}return t},sn.prototype.getPath=function(e,t,i,n,r){var o=new T;return this.forEachGlyph(e,t,i,n,r,(function(e,t,i,n){var a=e.getPath(t,i,n,r,this);o.extend(a)})),o},sn.prototype.getPaths=function(e,t,i,n,r){var o=[];return this.forEachGlyph(e,t,i,n,r,(function(e,t,i,n){var a=e.getPath(t,i,n,r,this);o.push(a)})),o},sn.prototype.getAdvanceWidth=function(e,t,i){return this.forEachGlyph(e,0,0,t,i,(function(){}))},sn.prototype.draw=function(e,t,i,n,r,o){this.getPath(t,i,n,r,o).draw(e)},sn.prototype.drawPoints=function(e,t,i,n,r,o){this.forEachGlyph(t,i,n,r,o,(function(t,i,n,r){t.drawPoints(e,i,n,r)}))},sn.prototype.drawMetrics=function(e,t,i,n,r,o){this.forEachGlyph(t,i,n,r,o,(function(t,i,n,r){t.drawMetrics(e,i,n,r)}))},sn.prototype.getEnglishName=function(e){var t=this.names[e];if(t)return t.en},sn.prototype.validate=function(){var e=this;function t(t){var i=e.getEnglishName(t);i&&i.trim().length}t("fontFamily"),t("weightName"),t("manufacturer"),t("copyright"),t("version"),this.unitsPerEm},sn.prototype.toTables=function(){return It(this)},sn.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},sn.prototype.toArrayBuffer=function(){for(var e=this.toTables().encode(),t=new ArrayBuffer(e.length),i=new Uint8Array(t),n=0;n<e.length;n++)i[n]=e[n];return t},sn.prototype.download=function(t){var n=this.getEnglishName("fontFamily"),r=this.getEnglishName("fontSubfamily");t=t||n.replace(/\s/g,"")+"-"+r+".otf";var o=this.toArrayBuffer();if("undefined"!=typeof window)if(window.URL=window.URL||window.webkitURL,window.URL){var a=new DataView(o),s=new Blob([a],{type:"font/opentype"}),l=document.createElement("a");l.href=window.URL.createObjectURL(s),l.download=t;var c=document.createEvent("MouseEvents");c.initEvent("click",!0,!1),l.dispatchEvent(c)}else console.warn("Font file could not be downloaded. Try using a different browser.");else{var d=i(270),u=function(t){for(var i=new e(t.byteLength),n=new Uint8Array(t),r=0;r<i.length;++r)i[r]=n[r];return i}(o);d.writeFileSync(t,u)}},sn.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},sn.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9},sn.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};var cn=function(e,t,i){var n=new ae.Parser(e,t),r=n.parseULong();A.argument(65536===r,"Unsupported fvar table version.");var o=n.parseOffset16();n.skip("uShort",1);for(var a,s,l,c,d,u=n.parseUShort(),p=n.parseUShort(),h=n.parseUShort(),f=n.parseUShort(),m=[],g=0;g<u;g++)m.push((a=e,s=t+o+g*p,l=i,d=c=void 0,c={},d=new ae.Parser(a,s),c.tag=d.parseTag(),c.minValue=d.parseFixed(),c.defaultValue=d.parseFixed(),c.maxValue=d.parseFixed(),d.skip("uShort",1),c.name=l[d.parseUShort()]||{},c));for(var v=[],y=t+o+u*p,b=0;b<h;b++)v.push(ln(e,y+b*f,m,i));return{axes:m,instances:v}},dn=new Array(10);dn[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();return 1===t?{posFormat:1,coverage:this.parsePointer(re.coverage),value:this.parseValueRecord()}:2===t?{posFormat:2,coverage:this.parsePointer(re.coverage),values:this.parseValueRecordList()}:void A.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},dn[2]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();A.assert(1===t||2===t,"0x"+e.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");var i=this.parsePointer(re.coverage),n=this.parseUShort(),r=this.parseUShort();if(1===t)return{posFormat:t,coverage:i,valueFormat1:n,valueFormat2:r,pairSets:this.parseList(re.pointer(re.list((function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(n),value2:this.parseValueRecord(r)}}))))};if(2===t){var o=this.parsePointer(re.classDef),a=this.parsePointer(re.classDef),s=this.parseUShort(),l=this.parseUShort();return{posFormat:t,coverage:i,valueFormat1:n,valueFormat2:r,classDef1:o,classDef2:a,class1Count:s,class2Count:l,classRecords:this.parseList(s,re.list(l,(function(){return{value1:this.parseValueRecord(n),value2:this.parseValueRecord(r)}})))}}},dn[3]=function(){return{error:"GPOS Lookup 3 not supported"}},dn[4]=function(){return{error:"GPOS Lookup 4 not supported"}},dn[5]=function(){return{error:"GPOS Lookup 5 not supported"}},dn[6]=function(){return{error:"GPOS Lookup 6 not supported"}},dn[7]=function(){return{error:"GPOS Lookup 7 not supported"}},dn[8]=function(){return{error:"GPOS Lookup 8 not supported"}},dn[9]=function(){return{error:"GPOS Lookup 9 not supported"}},new Array(10);var un=function(e,t){var i=new re(e,t=t||0),n=i.parseVersion(1);return A.argument(1===n||1.1===n,"Unsupported GPOS table version "+n),1===n?{version:n,scripts:i.parseScriptList(),features:i.parseFeatureList(),lookups:i.parseLookupList(dn)}:{version:n,scripts:i.parseScriptList(),features:i.parseFeatureList(),lookups:i.parseLookupList(dn),variations:i.parseFeatureVariationsList()}},pn=function(e,t){var i=new ae.Parser(e,t),n=i.parseUShort();if(0===n)return function(e){var t={};e.skip("uShort");var i=e.parseUShort();A.argument(0===i,"Unsupported kern sub-table version."),e.skip("uShort",2);var n=e.parseUShort();e.skip("uShort",3);for(var r=0;r<n;r+=1){var o=e.parseUShort(),a=e.parseUShort(),s=e.parseShort();t[o+","+a]=s}return t}(i);if(1===n)return function(e){var t={};e.skip("uShort"),1<e.parseULong()&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");var i=255&e.parseUShort();if(e.skip("uShort"),0===i){var n=e.parseUShort();e.skip("uShort",3);for(var r=0;r<n;r+=1){var o=e.parseUShort(),a=e.parseUShort(),s=e.parseShort();t[o+","+a]=s}}return t}(i);throw new Error("Unsupported kern table version ("+n+").")},hn=function(e,t,i,n){for(var r=new ae.Parser(e,t),o=n?r.parseUShort:r.parseULong,a=[],s=0;s<i+1;s+=1){var l=o.call(r);n&&(l*=2),a.push(l)}return a};function fn(e,t){i(270).readFile(e,(function(e,i){if(e)return t(e.message);t(null,Ft(i))}))}function mn(e,t){var i=new XMLHttpRequest;i.open("get",e,!0),i.responseType="arraybuffer",i.onload=function(){return i.response?t(null,i.response):t("Font could not be loaded: "+i.statusText)},i.onerror=function(){t("Font could not be loaded")},i.send()}function gn(e,t){for(var i=[],n=12,r=0;r<t;r+=1){var o=ae.getTag(e,n),a=ae.getULong(e,n+4),s=ae.getULong(e,n+8),l=ae.getULong(e,n+12);i.push({tag:o,checksum:a,offset:s,length:l,compression:!1}),n+=16}return i}function vn(e,t){if("WOFF"!==t.compression)return{data:e,offset:t.offset};var i=new Uint8Array(e.buffer,t.offset+2,t.compressedLength-2),n=new Uint8Array(t.length);if(function(e,t){var i,n,r=new a(e,t);do{switch(i=b(r),w(r,2,0)){case 0:n=x(r);break;case 1:n=k(r,s,l);break;case 2:C(r,r.ltree,r.dtree),n=k(r,r.ltree,r.dtree);break;default:n=-3}if(0!==n)throw new Error("Data error")}while(!i);r.destLen<r.dest.length?"function"==typeof r.dest.slice?r.dest.slice(0,r.destLen):r.dest.subarray(0,r.destLen):r.dest}(i,n),n.byteLength!==t.length)throw new Error("Decompression error: "+t.tag+" decompressed length doesn't match recorded length");return{data:new DataView(n.buffer,0),offset:0}}function yn(e){var t,i,n,r,o,a,s,l,c,d,u,p,h,f,m=new sn({empty:!0}),g=new DataView(e,0),v=[],y=ae.getTag(g,0);if(y===String.fromCharCode(0,1,0,0)||"true"===y||"typ1"===y)m.outlinesFormat="truetype",v=gn(g,n=ae.getUShort(g,4));else if("OTTO"===y)m.outlinesFormat="cff",v=gn(g,n=ae.getUShort(g,4));else{if("wOFF"!==y)throw new Error("Unsupported OpenType signature "+y);var b=ae.getTag(g,4);if(b===String.fromCharCode(0,1,0,0))m.outlinesFormat="truetype";else{if("OTTO"!==b)throw new Error("Unsupported OpenType flavor "+y);m.outlinesFormat="cff"}v=function(e,t){for(var i=[],n=44,r=0;r<t;r+=1){var o,a=ae.getTag(e,n),s=ae.getULong(e,n+4),l=ae.getULong(e,n+8),c=ae.getULong(e,n+12);o=l<c&&"WOFF",i.push({tag:a,offset:s,compression:o,compressedLength:l,length:c}),n+=20}return i}(g,n=ae.getUShort(g,12))}for(var w=0;w<n;w+=1){var S=v[w],C=void 0;switch(S.tag){case"cmap":C=vn(g,S),m.tables.cmap=se(C.data,C.offset),m.encoding=new fe(m.tables.cmap);break;case"cvt ":C=vn(g,S),f=new ae.Parser(C.data,C.offset),m.tables.cvt=f.parseShortList(S.length/2);break;case"fvar":o=S;break;case"fpgm":C=vn(g,S),f=new ae.Parser(C.data,C.offset),m.tables.fpgm=f.parseByteList(S.length);break;case"head":C=vn(g,S),m.tables.head=ze(C.data,C.offset),m.unitsPerEm=m.tables.head.unitsPerEm,t=m.tables.head.indexToLocFormat;break;case"hhea":C=vn(g,S),m.tables.hhea=je(C.data,C.offset),m.ascender=m.tables.hhea.ascender,m.descender=m.tables.hhea.descender,m.numberOfHMetrics=m.tables.hhea.numberOfHMetrics;break;case"hmtx":c=S;break;case"ltag":C=vn(g,S),i=Ke(C.data,C.offset);break;case"maxp":C=vn(g,S),m.tables.maxp=Ye(C.data,C.offset),m.numGlyphs=m.tables.maxp.numGlyphs;break;case"name":p=S;break;case"OS/2":C=vn(g,S),m.tables.os2=pt(C.data,C.offset);break;case"post":C=vn(g,S),m.tables.post=mt(C.data,C.offset),m.glyphNames=new ge(m.tables.post);break;case"prep":C=vn(g,S),f=new ae.Parser(C.data,C.offset),m.tables.prep=f.parseByteList(S.length);break;case"glyf":a=S;break;case"loca":u=S;break;case"CFF ":r=S;break;case"kern":d=S;break;case"GPOS":s=S;break;case"GSUB":l=S;break;case"meta":h=S}}var k=vn(g,p);if(m.tables.name=ct(k.data,k.offset,i),m.names=m.tables.name,a&&u){var x=0===t,_=vn(g,u),E=hn(_.data,_.offset,m.numGlyphs,x),T=vn(g,a);m.glyphs=Yt.parse(T.data,T.offset,E,m)}else{if(!r)throw new Error("Font doesn't contain TrueType or CFF outlines.");var P=vn(g,r);Ve(P.data,P.offset,m)}var I=vn(g,c);if($e(I.data,I.offset,m.numberOfHMetrics,m.numGlyphs,m.glyphs),function(e){for(var t,i=e.tables.cmap.glyphIndexMap,n=Object.keys(i),r=0;r<n.length;r+=1){var o=n[r],a=i[o];(t=e.glyphs.get(a)).addUnicode(parseInt(o))}for(var s=0;s<e.glyphs.length;s+=1)t=e.glyphs.get(s),e.cffEncoding?e.isCIDFont?t.name="gid"+s:t.name=e.cffEncoding.charset[s]:e.glyphNames.names&&(t.name=e.glyphNames.glyphIndexToName(s))}(m),d){var A=vn(g,d);m.kerningPairs=pn(A.data,A.offset)}else m.kerningPairs={};if(s){var R=vn(g,s);m.tables.gpos=un(R.data,R.offset),m.position.init()}if(l){var O=vn(g,l);m.tables.gsub=wt(O.data,O.offset)}if(o){var N=vn(g,o);m.tables.fvar=cn(N.data,N.offset,m.names)}if(h){var D=vn(g,h);m.tables.meta=Ct(D.data,D.offset),m.metas=m.tables.meta}return m}t.Font=sn,t.Glyph=ye,t.Path=T,t.BoundingBox=E,t._parse=ae,t.parse=yn,t.load=function(e,t){("undefined"==typeof window?fn:mn)(e,(function(e,i){if(e)return t(e);var n;try{n=yn(i)}catch(e){return t(e,null)}return t(null,n)}))},t.loadSync=function(e){return yn(Ft(i(270).readFileSync(e)))},Object.defineProperty(t,"__esModule",{value:!0})}(t)}).call(this,i(142).Buffer)},function(e,t,i){var n,r;n=[i(16),i(17)],void 0===(r=function(e,t){return function(e){function t(e,t){return e.w('<div class="import-drive import-body-container hide" id="importVideoLibraryl"><div class="hv-header-library-wrapper"><div class="hv-header-action-wrapper"><div class="hv-videoCatFilter-wrapper hide" id="videoCatFilter"><div class="video-library-cat-label"><label> ').f(t.get(["categoryLable"],!1),t,"h").w(' </label></div><div class="video-library-cat-select"><select class="hide" id="videoCatList"><option value="0">All assets</option>').s(t.get(["categories"],!1),t,{block:i},{}).w('</select><select class="hide" id="testimonialCatList">').s(t.get(["testimonialcategories"],!1),t,{block:n},{}).w('</select></div></div>\x3c!-- <div class="hv-header-popup-wrapper"><span class="fetching-videos-loading hide"><div class="spinner-loading"></div><span class="loading-msg"> ').f(t.get(["loading"],!1),t,"h").w(' </span></span></div> --\x3e<div class="tag-filter"><div class="video-library-cat-label"><label> Tags </label></div><div id="libCategories"></div></div><div class="hv-videoLibrarySearch-container hide" style="margin-right: 15px;" id="videoLibrarySearch"><div class="hv-search-box-wrapper"><input class="no-margin" id="importVideoLibrarySearch" placeholder="').f(t.get(["searchNameAndTags"],!1),t,"h").w('" type="text"><div class="hv-search-icon-wrapper"><img class="" id="searchIcon" src="/img/search-icon.png"><img class="disp-none" id="clear-icon" src="/svg/dark-blue-cross-icon.svg"></div></div></div></div><div class="hv-content-type-container disp-none"><div class="hv-content-type-wrapper"><label>Content Type</label><div class="hv-content-type-tags selected" data-id="fetch_videos" id="content-type-videos">Videos</div><div class="hv-content-type-tags" data-id="fetch_images" id="content-type-images">Images</div><div class="hv-content-type-tags" data-id="fetch_documents" id="content-type-documents">Documents</div></div></div></div><div class="import-drive-container import-web-content image-gallery main-gallery custom-scroll" id="importVideoLibraryContainer"><div id="importVideoLibraryContent" class="import-images-container ').f(t.get(["totalVideos"],!1),t,"h").w(" ").f(t.get(["offset"],!1),t,"h").w('"></div><div class="import-library-spin-loading hide"><div class="spinner-loading"></div><span class="loading-msg"> ').f(t.get(["loading"],!1),t,"h").w(' </span></div><div id="importVideoLibrayEmptyState" class="web-search-empty text-center hide"><img src="/svg/empty-result.svg" alt="No results" class="empty-search-icon"/><div class="result-info"> ').f(t.get(["emptyResults"],!1),t,"h").w(' </div></div><span class="fetching-library-videos-loading hide"><div class="spinner-loading"></div><span class="loading-msg"> ').f(t.get(["loading"],!1),t,"h").w(' </span></span>\x3c!-- <div id="loadMoreLibraryVideo" class="text-right load-more hide"> ').f(t.get(["loadMore"],!1),t,"h").w(" </div> --\x3e</div></div>")}function i(e,t){return e.w('<option value="').f(t.get(["id"],!1),t,"h").w('">').f(t.get(["name"],!1),t,"h").w("</option>")}function n(e,t){return e.w('<option value="').f(t.get(["id"],!1),t,"h").w('">').f(t.get(["name"],!1),t,"h").w("</option>")}e.register("templates/partials/import_from_video_library",t),t.__dustBody=!0,i.__dustBody=!0,n.__dustBody=!0}(e),function(t,i){var n;return e.render("templates/partials/import_from_video_library",t,(function(e,t){if("function"==typeof i)try{i(e,t)}catch(e){}if(e)throw e;n=t})),n}}.apply(t,n))||(e.exports=r)},function(e,t,i){var n,r;n=[i(16),i(17)],void 0===(r=function(e,t){return function(e){function t(e,t){return e.s(t.get(["libraries"],!1),t,{block:i},{})}function i(e,t){return e.h("ne",t,{block:n},{key:t.get(["current_asset_id"],!1),value:t.get(["id"],!1)},"h")}function n(e,t){return e.h("ne",t,{block:r},{key:t.get(["asset_type"],!1),value:6},"h")}function r(e,t){return e.x(t.get(["media_id"],!1),t,{block:o},{})}function o(e,t){return e.w('<div class="image pull-left" ').h("eq",t,{else:a,block:c},{key:t.get(["asset_type"],!1),value:19},"h").w(' data-asset-details="').f(t.get(["id"],!1),t,"h").w("-").f(t.get(["media_id"],!1),t,"h").w("-").x(t.get(["is_compressed"],!1),t,{else:d,block:u},{}).w('" data-is-document="').f(t.get(["is_document"],!1),t,"h").w('" data-is-image="').f(t.get(["is_image"],!1),t,"h").w('" data-file-ext="').f(t.get(["file_ext"],!1),t,"h").w('" data-token="').f(t.get(["token"],!1),t,"h").w('"><img src="').f(t.get(["thumb"],!1),t,"h").w('" class="gallery-view gallery-video" alt="image" data-name="').f(t.get(["title"],!1),t,"h").w('" data-duration="').f(t.get(["duration"],!1),t,"h").w('" data-resourceId="').f(t.get(["id"],!1),t,"h").w('" data-category="').f(t.get(["category"],!1),t,"h").w('" /><div class="media-details clearfix"><div class="pull-left media-name" style="margin-top: 18px;"> ').f(t.get(["title"],!1),t,"h").w(' </div><div class="pull-right media-duration"> </div></div><div class="hv-select-wrapper"><img src="/svg/check-white.svg" alt="tick"/></div><input type="hidden" data-thumbnail="').f(t.get(["thumb"],!1),t,"h").w('" data-asset="').f(t.get(["id"],!1),t,"h").w('" ></div>')}function a(e,t){return e.w('id="').f(t.get(["id"],!1),t,"h").w("-").f(t.get(["media_id"],!1),t,"h").w("-").x(t.get(["is_compressed"],!1),t,{else:s,block:l},{}).w('"')}function s(e,t){return e.w("false")}function l(e,t){return e.w("true")}function c(e,t){return e.w('id="').f(t.get(["media_id"],!1),t,"h").w('"')}function d(e,t){return e.w("false")}function u(e,t){return e.w("true")}e.register("templates/partials/import_library_view",t),t.__dustBody=!0,i.__dustBody=!0,n.__dustBody=!0,r.__dustBody=!0,o.__dustBody=!0,a.__dustBody=!0,s.__dustBody=!0,l.__dustBody=!0,c.__dustBody=!0,d.__dustBody=!0,u.__dustBody=!0}(e),function(t,i){var n;return e.render("templates/partials/import_library_view",t,(function(e,t){if("function"==typeof i)try{i(e,t)}catch(e){}if(e)throw e;n=t})),n}}.apply(t,n))||(e.exports=r)},function(e,t,i){(function(){"use strict";i(94),i(74),i(116),i(153),i(66),i(154),i(51),i(58),i(745),i(64);var e=i(751),n=i(111);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i(96),i(99),i(24);var r=e(i(181)),o=e(i(46)),a=e(i(47)),s=e(i(295)),l=e(i(56)),c=e(i(61)),d=e(i(43)),u=e(i(89)),p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var i=m(t);if(i&&i.has(e))return i.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}r.default=e,i&&i.set(e,r);return r}(i(1)),h=e(i(769)),f=i(771);function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(m=function(e){return e?i:t})(e)}function g(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function v(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?g(Object(i),!0).forEach((function(t){(0,u.default)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):g(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function y(e){var t=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(e){return!1}}();return function(){var i,n=(0,d.default)(e);if(t){var r=(0,d.default)(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return(0,c.default)(this,i)}}var b=function(e){(0,l.default)(i,e);var t=y(i);function i(e){var n;return(0,o.default)(this,i),n=t.call(this,e),(0,u.default)((0,s.default)(n),"addTags",(function(e){n.setState((function(t){return v(v({},t),{},{selectedTags:[].concat((0,r.default)(t.selectedTags||[]),[e.entry])})}))})),(0,u.default)((0,s.default)(n),"removeTags",(function(e){n.setState((function(t){var i;return v(v({},t||[]),{},{selectedTags:null===(i=t.selectedTags)||void 0===i?void 0:i.filter((function(t){return t.id!==e.id}))})}))})),(0,u.default)((0,s.default)(n),"render",(function(){var e=n.state,t=e.selectedTags,i=e.availableTags,r=n.props,o=r.testId,a=r.title,s=r.bordered,l=r.maxChars;return p.default.createElement("div",{className:"tags-wrapper".concat(s?"-filter":""," ").concat(null!=t&&t.length?"scalable-tags":"")},p.default.createElement(h.default,{placeholder:"Enter something",dropdownPlaceholder:"Choose one or more tags",title:a||"Filter by Tags",selectedOptions:{objectArr:t||[],valueKey:"name",idKey:"id"},availableOptions:{objectArr:i,valueKey:"name",idKey:"id"},maxChars:l||22,onAdd:n.addTags,onRemove:n.removeTags,testId:o,bordered:s,isStrict:!0}))})),n.state={availableTags:[],selectedTags:null},n}return(0,a.default)(i,[{key:"componentDidMount",value:function(){var e=this,t=this.props.savedData;(0,f.getManageTagsApi)({}).then((function(i){var n=i.rows;if(e.setState({availableTags:n}),t){var r=n.filter((function(e){return t.some((function(t){return e.id===t}))}));e.setState({selectedTags:r})}}))}},{key:"componentDidUpdate",value:function(e,t){var i=this.state.selectedTags,n=this.props.actionHandler;n&&i&&e.selectedTags!==i&&n(i)}},{key:"getSelectedState",value:function(){return this.state.selectedTags}}]),i}(p.Component);t.default=b}).call(window)},function(e,t,i){"use strict";var n=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,r=function(e){var t=Object.create(null);return function(i){return void 0===t[i]&&(t[i]=e(i)),t[i]}}((function(e){return n.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));t.a=r},,function(e,t,i){var n=i(135);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,i){var n=i(37),r=i(13),o=i(183);e.exports=!n&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},function(e,t,i){var n=i(37),r=i(13);e.exports=n&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},function(e,t,i){var n=i(13),r=i(32),o=i(39),a=i(37),s=i(137).CONFIGURABLE,l=i(233),c=i(63),d=c.enforce,u=c.get,p=Object.defineProperty,h=a&&!n((function(){return 8!==p((function(){}),"length",{value:8}).length})),f=String(String).split("String"),m=e.exports=function(e,t,i){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!o(e,"name")||s&&e.name!==t)&&(a?p(e,"name",{value:t,configurable:!0}):e.name=t),h&&i&&o(i,"arity")&&e.length!==i.arity&&p(e,"length",{value:i.arity});try{i&&o(i,"constructor")&&i.constructor?a&&p(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=d(e);return o(n,"source")||(n.source=f.join("string"==typeof t?t:"")),e};Function.prototype.toString=m((function(){return r(this)&&u(this).source||l(this)}),"toString")},function(e,t,i){var n=i(19),r=i(32),o=n.WeakMap;e.exports=r(o)&&/native code/.test(String(o))},function(e,t,i){var n=i(39),r=i(291),o=i(95),a=i(48);e.exports=function(e,t,i){for(var s=r(t),l=a.f,c=o.f,d=0;d<s.length;d++){var u=s[d];n(e,u)||i&&n(i,u)||l(e,u,c(t,u))}}},function(e,t,i){var n=i(71),r=i(12),o=i(101),a=i(186),s=i(41),l=r([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(s(e)),i=a.f;return i?l(t,i(e)):t}},function(e,t,i){var n=i(12),r=i(39),o=i(67),a=i(185).indexOf,s=i(159),l=n([].push);e.exports=function(e,t){var i,n=o(e),c=0,d=[];for(i in n)!r(s,i)&&r(n,i)&&l(d,i);for(;t.length>c;)r(n,i=t[c++])&&(~a(d,i)||l(d,i));return d}},function(e,t,i){var n=i(37),r=i(287),o=i(48),a=i(41),s=i(67),l=i(161);t.f=n&&!r?Object.defineProperties:function(e,t){a(e);for(var i,n=s(t),r=l(t),c=r.length,d=0;c>d;)o.f(e,i=r[d++],n[i]);return e}},function(e,t,i){var n=i(71);e.exports=n("document","documentElement")},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){"use strict";var n=i(15),r=i(31),o=i(76),a=i(137),s=i(32),l=i(297),c=i(189),d=i(139),u=i(106),p=i(82),h=i(52),f=i(28),m=i(162),g=i(298),v=a.PROPER,y=a.CONFIGURABLE,b=g.IteratorPrototype,w=g.BUGGY_SAFARI_ITERATORS,S=f("iterator"),C=function(){return this};e.exports=function(e,t,i,a,f,g,k){l(i,t,a);var x,_,E,T=function(e){if(e===f&&O)return O;if(!w&&e in A)return A[e];switch(e){case"keys":case"values":case"entries":return function(){return new i(this,e)}}return function(){return new i(this)}},P=t+" Iterator",I=!1,A=e.prototype,R=A[S]||A["@@iterator"]||f&&A[f],O=!w&&R||T(f),N="Array"==t&&A.entries||R;if(N&&(x=c(N.call(new e)))!==Object.prototype&&x.next&&(o||c(x)===b||(d?d(x,b):s(x[S])||h(x,S,C)),u(x,P,!0,!0),o&&(m[P]=C)),v&&"values"==f&&R&&"values"!==R.name&&(!o&&y?p(A,"name","values"):(I=!0,O=function(){return r(R,this)})),f)if(_={values:T("values"),keys:g?O:T("keys"),entries:T("entries")},k)for(E in _)(w||I||!(E in A))&&h(A,E,_[E]);else n({target:t,proto:!0,forced:w||I},_);return o&&!k||A[S]===O||h(A,S,O,{name:f}),m[t]=O,_}},function(e,t,i){"use strict";var n=i(298).IteratorPrototype,r=i(105),o=i(117),a=i(106),s=i(162),l=function(){return this};e.exports=function(e,t,i,c){var d=t+" Iterator";return e.prototype=r(n,{next:o(+!c,i)}),a(e,d,!1,!0),s[d]=l,e}},function(e,t,i){"use strict";var n,r,o,a=i(13),s=i(32),l=i(38),c=i(105),d=i(189),u=i(52),p=i(28),h=i(76),f=p("iterator"),m=!1;[].keys&&("next"in(o=[].keys())?(r=d(d(o)))!==Object.prototype&&(n=r):m=!0),!l(n)||a((function(){var e={};return n[f].call(e)!==e}))?n={}:h&&(n=c(n)),s(n[f])||u(n,f,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:m}},function(e,t,i){var n,r,o,a,s=i(19),l=i(103),c=i(107),d=i(32),u=i(39),p=i(13),h=i(294),f=i(138),m=i(183),g=i(238),v=i(300),y=i(163),b=s.setImmediate,w=s.clearImmediate,S=s.process,C=s.Dispatch,k=s.Function,x=s.MessageChannel,_=s.String,E=0,T={};try{n=s.location}catch(e){}var P=function(e){if(u(T,e)){var t=T[e];delete T[e],t()}},I=function(e){return function(){P(e)}},A=function(e){P(e.data)},R=function(e){s.postMessage(_(e),n.protocol+"//"+n.host)};b&&w||(b=function(e){g(arguments.length,1);var t=d(e)?e:k(e),i=f(arguments,1);return T[++E]=function(){l(t,void 0,i)},r(E),E},w=function(e){delete T[e]},y?r=function(e){S.nextTick(I(e))}:C&&C.now?r=function(e){C.now(I(e))}:x&&!v?(a=(o=new x).port2,o.port1.onmessage=A,r=c(a.postMessage,a)):s.addEventListener&&d(s.postMessage)&&!s.importScripts&&n&&"file:"!==n.protocol&&!p(R)?(r=R,s.addEventListener("message",A,!1)):r="onreadystatechange"in m("script")?function(e){h.appendChild(m("script")).onreadystatechange=function(){h.removeChild(this),P(e)}}:function(e){setTimeout(I(e),0)}),e.exports={set:b,clear:w}},function(e,t,i){var n=i(119);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},function(e,t){e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},function(e,t,i){var n=i(31),r=i(41),o=i(120);e.exports=function(e,t,i){var a,s;r(e);try{if(!(a=o(e,"return"))){if("throw"===t)throw i;return i}a=n(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw i;if(s)throw a;return r(a),i}},function(e,t,i){var n=i(164),r=i(193),o=i(165).CONSTRUCTOR;e.exports=o||!r((function(e){n.all(e).then(void 0,(function(){}))}))},function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(e,t,i){var n=i(183)("span").classList,r=n&&n.constructor&&n.constructor.prototype;e.exports=r===Object.prototype?void 0:r},function(e,t,i){"use strict";var n=i(41);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},function(e,t,i){var n=i(13),r=i(19).RegExp;e.exports=n((function(){var e=r(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}))},function(e,t,i){var n=i(13),r=i(19).RegExp;e.exports=n((function(){var e=r("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},function(e,t,i){"use strict";var n=i(37),r=i(12),o=i(31),a=i(13),s=i(161),l=i(186),c=i(182),d=i(53),u=i(156),p=Object.assign,h=Object.defineProperty,f=r([].concat);e.exports=!p||a((function(){if(n&&1!==p({b:1},p(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},i=Symbol();return e[i]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!=p({},e)[i]||"abcdefghijklmnopqrst"!=s(p({},t)).join("")}))?function(e,t){for(var i=d(e),r=arguments.length,a=1,p=l.f,h=c.f;r>a;)for(var m,g=u(arguments[a++]),v=p?f(s(g),p(g)):s(g),y=v.length,b=0;y>b;)m=v[b++],n&&!o(h,g,m)||(i[m]=g[m]);return i}:p},function(e,t,i){"use strict";
96
96
  /*
97
97
  object-assign
98
98
  (c) Sindre Sorhus