@clickview/lite 0.103.0-rc.0 → 0.103.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +640 -640
- package/dist/bundles.json +1 -1
- package/dist/en.json +1 -1
- package/dist/scripts/{BXosUOUS.chunk.js → 14z5Gy8L.chunk.js} +2 -2
- package/dist/scripts/{BXosUOUS.chunk.js.map → 14z5Gy8L.chunk.js.map} +1 -1
- package/dist/scripts/{BqkK_0Jk2.chunk.js → B4AZn1xm2.chunk.js} +2 -2
- package/dist/scripts/{BqkK_0Jk2.chunk.js.map → B4AZn1xm2.chunk.js.map} +1 -1
- package/dist/scripts/{_wBbQ-0z2.chunk.js → BBndy2td2.chunk.js} +2 -2
- package/dist/scripts/{_wBbQ-0z2.chunk.js.map → BBndy2td2.chunk.js.map} +1 -1
- package/dist/scripts/{BhgNNQjX.chunk.js → BOQck-Qs.chunk.js} +2 -2
- package/dist/scripts/{BhgNNQjX.chunk.js.map → BOQck-Qs.chunk.js.map} +1 -1
- package/dist/scripts/{BCTM3KG42.chunk.js → BQNOt7_Q2.chunk.js} +2 -2
- package/dist/scripts/{BCTM3KG42.chunk.js.map → BQNOt7_Q2.chunk.js.map} +1 -1
- package/dist/scripts/{DBdkd4Ag2.chunk.js → BTXOoJko2.chunk.js} +3 -3
- package/dist/scripts/{DBdkd4Ag2.chunk.js.map → BTXOoJko2.chunk.js.map} +1 -1
- package/dist/scripts/{wmwWqIeA.chunk.js → BTr5dJhb.chunk.js} +2 -2
- package/dist/scripts/{wmwWqIeA.chunk.js.map → BTr5dJhb.chunk.js.map} +1 -1
- package/dist/scripts/{B-aaIChO2.chunk.js → BTugVIIN2.chunk.js} +2 -2
- package/dist/scripts/{B-aaIChO2.chunk.js.map → BTugVIIN2.chunk.js.map} +1 -1
- package/dist/scripts/{_eRiDJm1.chunk.js → Ba4uGz_V.chunk.js} +2 -2
- package/dist/scripts/{_eRiDJm1.chunk.js.map → Ba4uGz_V.chunk.js.map} +1 -1
- package/dist/scripts/{Bx6qaXLc.chunk.js → Bdbe2u0R.chunk.js} +2 -2
- package/dist/scripts/{Bx6qaXLc.chunk.js.map → Bdbe2u0R.chunk.js.map} +1 -1
- package/dist/scripts/{syYCrnUX.chunk.js → BgoVmaXQ.chunk.js} +2 -2
- package/dist/scripts/{syYCrnUX.chunk.js.map → BgoVmaXQ.chunk.js.map} +1 -1
- package/dist/scripts/{B5DWwtp0.chunk.js → BjA9XV5y.chunk.js} +2 -2
- package/dist/scripts/{B5DWwtp0.chunk.js.map → BjA9XV5y.chunk.js.map} +1 -1
- package/dist/scripts/{Dp8z_udC.chunk.js → BoT5D3IL.chunk.js} +2 -2
- package/dist/scripts/{Dp8z_udC.chunk.js.map → BoT5D3IL.chunk.js.map} +1 -1
- package/dist/scripts/{BYMMqtaN.chunk.js → BqdHoEFM.chunk.js} +2 -2
- package/dist/scripts/{BYMMqtaN.chunk.js.map → BqdHoEFM.chunk.js.map} +1 -1
- package/dist/scripts/{BIvmcqND2.chunk.js → CCUznsdX2.chunk.js} +2 -2
- package/dist/scripts/{BIvmcqND2.chunk.js.map → CCUznsdX2.chunk.js.map} +1 -1
- package/dist/scripts/{BsNCh4UD.chunk.js → CFqL2Hm5.chunk.js} +3 -3
- package/dist/scripts/{BsNCh4UD.chunk.js.map → CFqL2Hm5.chunk.js.map} +1 -1
- package/dist/scripts/{BE8Ze3Fa2.chunk.js → CHmbcl4Y2.chunk.js} +2 -2
- package/dist/scripts/{BE8Ze3Fa2.chunk.js.map → CHmbcl4Y2.chunk.js.map} +1 -1
- package/dist/scripts/{RuVwpX36.chunk.js → CWCtYUUU.chunk.js} +2 -2
- package/dist/scripts/{RuVwpX36.chunk.js.map → CWCtYUUU.chunk.js.map} +1 -1
- package/dist/scripts/{CO8EIpI8.chunk.js → CXUrMkZu.chunk.js} +2 -2
- package/dist/scripts/{CO8EIpI8.chunk.js.map → CXUrMkZu.chunk.js.map} +1 -1
- package/dist/scripts/{DLqG-wwP.chunk.js → CYrelpYt.chunk.js} +2 -2
- package/dist/scripts/{DLqG-wwP.chunk.js.map → CYrelpYt.chunk.js.map} +1 -1
- package/dist/scripts/{Drx3PvJj.chunk.js → Cc9f2ux0.chunk.js} +2 -2
- package/dist/scripts/{Drx3PvJj.chunk.js.map → Cc9f2ux0.chunk.js.map} +1 -1
- package/dist/scripts/Cj_F4Lv92.chunk.js +2 -0
- package/dist/scripts/{C8l37H7t2.chunk.js.map → Cj_F4Lv92.chunk.js.map} +1 -1
- package/dist/scripts/{B5M-3wpn.chunk.js → CjwT65ug.chunk.js} +2 -2
- package/dist/scripts/{B5M-3wpn.chunk.js.map → CjwT65ug.chunk.js.map} +1 -1
- package/dist/scripts/{Dd23z1_x2.chunk.js → CvSpUZcJ2.chunk.js} +2 -2
- package/dist/scripts/{Dd23z1_x2.chunk.js.map → CvSpUZcJ2.chunk.js.map} +1 -1
- package/dist/scripts/{QrUfkwZX.chunk.js → DFleEz5_.chunk.js} +2 -2
- package/dist/scripts/{QrUfkwZX.chunk.js.map → DFleEz5_.chunk.js.map} +1 -1
- package/dist/scripts/{ygwO7HPs2.chunk.js → DIaT_eGy2.chunk.js} +2 -2
- package/dist/scripts/{ygwO7HPs2.chunk.js.map → DIaT_eGy2.chunk.js.map} +1 -1
- package/dist/scripts/{DXRsxBJw.chunk.js → DTliAJ8L.chunk.js} +2 -2
- package/dist/scripts/{DXRsxBJw.chunk.js.map → DTliAJ8L.chunk.js.map} +1 -1
- package/dist/scripts/{CfVIZBcI2.chunk.js → DXkvlC_92.chunk.js} +2 -2
- package/dist/scripts/{CfVIZBcI2.chunk.js.map → DXkvlC_92.chunk.js.map} +1 -1
- package/dist/scripts/{DE5jvfAx2.chunk.js → D_t70KgV2.chunk.js} +2 -2
- package/dist/scripts/{DE5jvfAx2.chunk.js.map → D_t70KgV2.chunk.js.map} +1 -1
- package/dist/scripts/{Dc01PBv1.chunk.js → Dn2EPvQj.chunk.js} +2 -2
- package/dist/scripts/{Dc01PBv1.chunk.js.map → Dn2EPvQj.chunk.js.map} +1 -1
- package/dist/scripts/{C4CuJJXy2.chunk.js → Dvl1XgHV2.chunk.js} +2 -2
- package/dist/scripts/{C4CuJJXy2.chunk.js.map → Dvl1XgHV2.chunk.js.map} +1 -1
- package/dist/scripts/{YzhKditE.chunk.js → ESLgHTNq.chunk.js} +2 -2
- package/dist/scripts/{YzhKditE.chunk.js.map → ESLgHTNq.chunk.js.map} +1 -1
- package/dist/scripts/{DfSzsD3P.chunk.js → FysETOFv.chunk.js} +2 -2
- package/dist/scripts/{DfSzsD3P.chunk.js.map → FysETOFv.chunk.js.map} +1 -1
- package/dist/scripts/{OmYpHs7g.chunk.js → _Cm5O72d.chunk.js} +3 -3
- package/dist/scripts/{OmYpHs7g.chunk.js.map → _Cm5O72d.chunk.js.map} +1 -1
- package/dist/scripts/{app-BzCWmnrr.js → app-k0jrat-b.js} +4 -4
- package/dist/scripts/{app-BzCWmnrr.js.map → app-k0jrat-b.js.map} +1 -1
- package/dist/scripts/{C46080Xd.chunk.js → dxqgnrOi.chunk.js} +2 -2
- package/dist/scripts/{C46080Xd.chunk.js.map → dxqgnrOi.chunk.js.map} +1 -1
- package/package.json +1 -1
- package/dist/scripts/C8l37H7t2.chunk.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e,t}from"./DAXXjFlN.chunk.js";import{n,r,t as i}from"./D8uRDrkd.chunk.js";import{_ as a,u as o}from"./BftnFbcr.chunk.js";import{t as s}from"./e57H3T-k.chunk.js";import{t as c}from"./C2w0pmFW.chunk.js";import{t as l}from"./wrLrTezN.chunk.js";import{t as u}from"./BVnMI-dl.chunk.js";import{M as d,N as f}from"./J0QUvPGS.chunk.js";import{t as p}from"./C1SLt-ar.chunk.js";import{U as m,_ as h,a as g,l as _,y as v,z as y}from"./NlCAcBdo.chunk.js";import{n as b,t as x}from"./BzfCWDOl.chunk.js";import{t as S}from"./C5j5LRut2.chunk.js";import{t as C}from"./BDwjs8qz2.chunk.js";import{t as w}from"./B3TDTJSl.chunk.js";import{n as T,r as E}from"./BRcHS92O2.chunk.js";import{t as D}from"./DXeT_p8s2.chunk.js";import{n as O,t as k}from"./D9a0OIfi2.chunk.js";import{t as A}from"./Bbp2U9GK2.chunk.js";import{n as j}from"./BGGL8m_U2.chunk.js";import{t as M}from"./DCBtWC6W.chunk.js";import{n as ee}from"./BIzu5ufQ.chunk.js";import{t as N}from"./9LNlP5yJ.chunk.js";import{n as P,t as te}from"./ClVhjUGI.chunk.js";import{t as ne}from"./E5Pmu4O7.chunk.js";import{t as F}from"./D5yUWL7p.chunk.js";import{t as I}from"./BxYKQEUG2.chunk.js";import{t as L}from"./dEqScqMh2.chunk.js";import{t as R}from"./D1EthTiX.chunk.js";import{t as re}from"./BVk9tE02.chunk.js";import{n as ie}from"./bWC12YrP.chunk.js";import{t as ae}from"./C7HU4huj.chunk.js";import{n as oe,r as se,t as z}from"./BGswYbRT.chunk.js";import{t as ce}from"./o_O53MMd.chunk.js";import{t as B}from"./9kSpxveW.chunk.js";import{t as le}from"./C-THHyTP.chunk.js";import{t as ue}from"./DDJBf9pK.chunk.js";import{t as de}from"./DUXPuDp7.chunk.js";import{t as fe}from"./DSuhq1Rt2.chunk.js";import{t as pe}from"./Dp6QHgBL2.chunk.js";import{t as me}from"./ByszCPst2.chunk.js";import{t as he}from"./B44BW79X.chunk.js";import{t as ge}from"./BfiSXcgz2.chunk.js";import{t as _e}from"./DGA_eT2h2.chunk.js";import{t as ve}from"./Dg1mFtY2.chunk.js";import{t as ye}from"./BBEIIgZ6.chunk.js";import{t as be}from"./CHL4nrKG.chunk.js";import{n as xe,t as Se}from"./CWMwyVGJ2.chunk.js";import{t as Ce}from"./CfTTKh6M.chunk.js";import{t as we}from"./lPQgHDFT.chunk.js";import{n as Te,t as Ee}from"./Ib9eoq_Y.chunk.js";import{d as De,i as V,m as Oe,n as ke,p as Ae,r as je,t as Me}from"./DXRsxBJw.chunk.js";import{n as Ne,t as Pe}from"./DLqG-wwP.chunk.js";import{t as Fe}from"./C3Wa868y.chunk.js";import"./BXosUOUS.chunk.js";import"./DfSzsD3P.chunk.js";import{t as Ie}from"./D5nbPgu6.chunk.js";import{n as Le,t as Re}from"./CsOC2WrI.chunk.js";import{i as ze,r as Be}from"./j59ag8H4.chunk.js";import{a as Ve,o as He,s as Ue,t as We}from"./C_-lTHCv.chunk.js";import{t as Ge}from"./VMYkPZfT.chunk.js";import{t as Ke}from"./D7hSSm4r2.chunk.js";import{t as qe}from"./BoTN63OZ2.chunk.js";import{t as Je}from"./BiKac8UT2.chunk.js";var H=e(c()),U=l(),Ye=e(j()),Xe=e(ee()),Ze=function(e){return e[e.View=0]=`View`,e[e.Create=1]=`Create`,e}({}),Qe=class extends D{constructor(){super(`Could not connect to submit interactive results`)}get name(){return`InternetConnectivityError`}get dialogOptions(){return{title:`Connection issues`,text:`There seems to be an issue with your internet connection. Refresh the page to try again. `,buttons:[{text:`Refresh`,className:`btn btn-dark`,success:!0}]}}onDone(){window.location.reload()}},$e=class{constructor(e){this.options=e,this.save=this.save.bind(this)}start(e){e&&(this.resultId=e),this.startSession()}async startSession(){if(this.resultId)return;let{interactiveId:e,metadataId:t,userId:n,customerId:r,shareId:i,playerApi:o}=this.options,s={interactiveId:e,metadataId:t,userId:n,customerId:r,shareId:i,anonymous:!n};n||(s.anonymous=!0,s.sessionId=w.getClientSessionData(null)?.windowId);try{let e=await Oe.post(o+`interactive/start-session`,JSON.stringify(s));this.resultId=e.resultId}catch{a.throw(new Qe)}}async save(e,t){this.resultId||await this.startSession();let n={resultId:this.resultId,interactionId:e,results:t};try{await Oe.post(this.options.playerApi+`interactive/save-actions`,JSON.stringify(n),void 0,!1)}catch(e){console.log(e),a.throw(new Qe)}}},W={svg:`_svg_q8zfb_1`,iconButton:`_iconButton_q8zfb_6`,iconWithText:`_iconWithText_q8zfb_10`,iconOnly:`_iconOnly_q8zfb_22`};function et(e){let{className:t,svg:n,children:r,...a}=e,o=`${t} ${W.iconButton}`;return r?o+=` ${W.iconWithText}`:o+=` ${W.iconOnly}`,(0,U.jsxs)(A,{className:o,...a,children:[(0,U.jsx)(i,{svg:n,className:W.svg}),r]})}function tt(e){let{isCreate:t,open:n,showTypeSelector:r}=e;return!t||n?(0,U.jsx)(U.Fragment,{}):(0,U.jsx)(et,{className:`btn btn-outline-dark cv-add-question`,onClick:r,svg:ue,children:`Add question`})}function G(e){return(0,U.jsx)(`div`,{className:`cv-interactive-question`,children:(0,U.jsx)(`div`,{className:`mb-2 h4`,dangerouslySetInnerHTML:{__html:s.sanitize(e.interaction.data.annotation).replace(/<(a)(.*?)>/g,`<$1 target="_blank" $2>`)}})})}function nt(e){return(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,...e,children:(0,U.jsx)(`path`,{d:`M10.6191 3.42871C11.5658 3.42875 12.3329 4.19596 12.333 5.14258V11.1426H19.7139C20.6606 11.1426 21.4287 11.9106 21.4287 12.8574V18.8574C21.4286 19.8041 20.6605 20.5713 19.7139 20.5713H9.42871C8.48203 20.5713 7.71402 19.8041 7.71387 18.8574V17.1426H4.61914C3.67241 17.1426 2.90535 16.3754 2.90527 15.4287V5.14258C2.90542 4.19593 3.67246 3.42871 4.61914 3.42871H10.6191ZM9.42871 12C9.00014 12 8.57129 12.4289 8.57129 12.8574V18.8574C8.57144 19.3307 8.95542 19.7139 9.42871 19.7139H19.7139C20.1872 19.7139 20.5711 19.3307 20.5713 18.8574V12.8574C20.5713 12.384 20.1873 12 19.7139 12H9.42871ZM19.292 13.7139C19.7143 13.714 19.7139 13.9883 19.7139 13.9883V17.7207C19.7138 17.7297 19.7073 17.9998 19.292 18C18.8765 18 18.8579 17.7299 18.8574 17.7207V13.9883C18.8574 13.9883 18.8694 13.7139 19.292 13.7139ZM10.5 15.4004C10.7761 15.4004 11 15.6242 11 15.9004C10.9998 16.1764 10.776 16.4004 10.5 16.4004C10.224 16.4004 10.0002 16.1764 10 15.9004C10 15.6242 10.2239 15.4004 10.5 15.4004ZM4.61914 4.28613C4.14585 4.28613 3.76187 4.66932 3.76172 5.14258V15.4287C3.76179 15.902 4.1458 16.2861 4.61914 16.2861H7.71387V12.8574C7.71387 11.5717 8.57157 11.1426 9.42871 11.1426H11.4766V5.14258C11.4764 4.66934 11.0924 4.28617 10.6191 4.28613H4.61914ZM17 3.5C18.2431 3.5 19.5 4.49193 19.5 6V7.79297L20.6465 6.64648C20.8417 6.45122 21.1583 6.45122 21.3535 6.64648C21.5488 6.84175 21.5488 7.15825 21.3535 7.35352L19 9.70703L16.6465 7.35352C16.4512 7.15825 16.4512 6.84175 16.6465 6.64648C16.8417 6.45122 17.1583 6.45122 17.3535 6.64648L18.5 7.79297V6C18.5 5.10807 17.7569 4.5 17 4.5H14C13.7239 4.5 13.5 4.27614 13.5 4C13.5 3.72386 13.7239 3.5 14 3.5H17ZM9.48242 5.14258C9.48462 5.14258 9.76169 5.14454 9.76172 5.56543C9.76172 5.98634 9.48469 5.9999 9.48242 6H5.75C5.75 6 5.47656 5.98807 5.47656 5.56543C5.47659 5.14286 5.75 5.14258 5.75 5.14258H9.48242Z`,fill:`currentColor`})})}var rt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}e.default=function e(n,r){t(this,e),this.x=n,this.y=r}})),it=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),n=r(rt());function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function a(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function o(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}e.default=function(e){o(r,e);function r(){return i(this,r),a(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return t(r,[{key:`update`,value:function(e){this.x=e.x,this.y=e.y}},{key:`moveByAngle`,value:function(e,t){var n=e+Math.PI/2;this.x+=Math.sin(n)*t,this.y-=Math.cos(n)*t}},{key:`equalsTo`,value:function(e){return this.x===e.x&&this.y===e.y}},{key:`getDifferenceTo`,value:function(e){return new n.default(this.x-e.x,this.y-e.y)}},{key:`getDistanceTo`,value:function(e){var t=this.getDifferenceTo(e);return Math.sqrt(t.x**2+t.y**2)}},{key:`getAngleTo`,value:function(e){var t=this.getDifferenceTo(e);return Math.atan2(t.y,t.x)}},{key:`toObject`,value:function(){return{x:this.x,y:this.y}}}]),r}(n.default)})),at=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),n=r(it());function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var a=30;e.default=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.radius,o=r===void 0?a:r,s=t.enabled,c=s===void 0||s,l=t.initialPoint,u=l===void 0?{x:0,y:0}:l;i(this,e),this.radius=o,this._isEnabled=c,this.pointer=new n.default(u.x,u.y),this.brush=new n.default(u.x,u.y),this.angle=0,this.distance=0,this._hasMoved=!1}return t(e,[{key:`enable`,value:function(){this._isEnabled=!0}},{key:`disable`,value:function(){this._isEnabled=!1}},{key:`isEnabled`,value:function(){return this._isEnabled}},{key:`setRadius`,value:function(e){this.radius=e}},{key:`getRadius`,value:function(){return this.radius}},{key:`getBrushCoordinates`,value:function(){return this.brush.toObject()}},{key:`getPointerCoordinates`,value:function(){return this.pointer.toObject()}},{key:`getBrush`,value:function(){return this.brush}},{key:`getPointer`,value:function(){return this.pointer}},{key:`getAngle`,value:function(){return this.angle}},{key:`getDistance`,value:function(){return this.distance}},{key:`brushHasMoved`,value:function(){return this._hasMoved}},{key:`update`,value:function(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).both,n=t!==void 0&&t;return this._hasMoved=!1,this.pointer.equalsTo(e)&&!n?!1:(this.pointer.update(e),n?(this._hasMoved=!0,this.brush.update(e),!0):(this._isEnabled?(this.distance=this.pointer.getDistanceTo(this.brush),this.angle=this.pointer.getAngleTo(this.brush),this.distance>this.radius&&(this.brush.moveByAngle(this.angle,this.distance-this.radius),this._hasMoved=!0)):(this.distance=0,this.angle=0,this.brush.update(e),this._hasMoved=!0),!0))}}]),e}()})),ot=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LazyPoint=e.Point=e.LazyBrush=void 0;var t=i(at()),n=i(rt()),r=i(it());function i(e){return e&&e.__esModule?e:{default:e}}e.LazyBrush=t.default,e.Point=n.default,e.LazyPoint=r.default})),st=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function n(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}e.default=function(){function e(t,r){n(this,e),this.x=t,this.y=r}return t(e,[{key:`update`,value:function(e){this.x=e.x,this.y=e.y}},{key:`getDifferenceTo`,value:function(t){return new e(this.x-t.x,this.y-t.y)}},{key:`getDistanceTo`,value:function(e){var t=this.getDifferenceTo(e);return Math.sqrt(t.x**2+t.y**2)}}]),e}()})),ct=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),n=r(st());function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var a=1e-6;e.default=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.segments,a=r===void 0?50:r,o=t.iterationLimit,s=o===void 0?100:o;i(this,e),this.p1=new n.default,this.p2=new n.default,this.segments=a,this.iterationLimit=s}return t(e,[{key:`drawToCanvas`,value:function(e,t,n,r){this.p1.update(t),this.p2.update(n);var i=this.p1.x>this.p2.x,a=i?this.p2:this.p1,o=i?this.p1:this.p2,s=a.getDistanceTo(o),c=[],l=!0;if(s<r)if(o.x-a.x>.01){var u=o.x-a.x,d=o.y-a.y,f=-this.getCatenaryParameter(u,d,r,this.iterationLimit),p=(f*Math.log((r+d)/(r-d))-u)*.5,m=f*Math.cosh(p/f),h=a.x-p,g=a.y-m;c=this.getCurve(f,a,o,h,g,this.segments),l=!1}else{var _=(a.x+o.x)*.5,v=(a.y+o.y+r)*.5;c=[[a.x,a.y],[_,v],[o.x,o.y]]}else c=[[a.x,a.y],[o.x,o.y]];return l?this.drawLine(c,e):this.drawCurve(c,e),c}},{key:`getCatenaryParameter`,value:function(e,t,n,r){for(var i=Math.sqrt(n*n-t*t)/e,o=Math.acosh(i)+1,s=-1,c=0;Math.abs(o-s)>a&&c<r;)s=o,o-=(Math.sinh(o)-i*o)/(Math.cosh(o)-i),c++;return e/(2*o)}},{key:`getCurve`,value:function(e,t,n,r,i,a){for(var o=[t.x,e*Math.cosh((t.x-r)/e)+i],s=n.x-t.x,c=a-1,l=0;l<c;l++){var u=t.x+s*(l+.5)/c,d=e*Math.cosh((u-r)/e)+i;o.push(u,d)}return o.push(n.x,e*Math.cosh((n.x-r)/e)+i),o}},{key:`drawLine`,value:function(e,t){t.moveTo(e[0][0],e[0][1]),t.lineTo(e[1][0],e[1][1])}},{key:`drawCurve`,value:function(e,t){var n=e.length*.5-1,r=e[2],i=e[3],a=[];t.moveTo(e[0],e[1]);for(var o=2;o<n;o++){var s=e[o*2],c=e[o*2+1],l=(s+r)*.5,u=(c+i)*.5;a.push([r,i,l,u]),t.quadraticCurveTo(r,i,l,u),r=s,i=c}return n=e.length,t.quadraticCurveTo(e[n-4],e[n-3],e[n-2],e[n-1]),a}}]),e}()})),lt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Point=e.Catenary=void 0;var t=r(ct()),n=r(st());function r(e){return e&&e.__esModule?e:{default:e}}e.Catenary=t.default,e.Point=n.default})),ut=ot(),dt=lt();function ft(){return ft=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ft.apply(this,arguments)}function pt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function mt(e,t,n){return t&&pt(e.prototype,t),n&&pt(e,n),e}function ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gt=Object.freeze({x:0,y:0,untransformedX:0,untransformedY:0}),_t=Object.freeze({canvasWidth:0,canvasHeight:0,left:0,top:0,right:0,bottom:0,viewMin:gt,viewMax:gt}),vt=Object.freeze({a:1,b:0,c:0,d:1,e:0,f:0}),yt=function(){function e(e){var t=this,n=e.scaleExtents,r=e.documentSize;ht(this,`_scaleExtents`,void 0),ht(this,`_documentSize`,void 0),ht(this,`_canvas`,null),ht(this,`_view`,{scale:1,x:0,y:0}),ht(this,`_viewChangeListeners`,new Set),ht(this,`setScale`,function(e){t.setView({scale:e})}),ht(this,`clampView`,function(e){var n=e.scale,r=e.x,i=e.y,a=t.scaleExtents,o=a.min,s=a.max,c=t.documentSize,l=c.width,u=c.height,d=t.canvasRect||_t,f=d.left,p=d.top,m=d.right,h=d.bottom,g=m-f,_=h-p,v=g/2,y=-(l*t._view.scale-g/2),b=_/2,x=-(u*t._view.scale-_/2);return{scale:Math.min(Math.max(n,o),s),x:Math.min(Math.max(r,y),v),y:Math.min(Math.max(i,x),b)}}),ht(this,`resetView`,function(){t.setView({scale:1,x:0,y:0})}),ht(this,`setView`,function(e){var n=t.clampView(ft({},t._view,e||{})),r=t._view,i=r.scale,a=r.x,o=r.y;return(n.scale!==i||n.x!==a||n.y!==o)&&(t._view=n,t._viewChangeListeners.forEach(function(e){return e&&e(n)})),ft({},t._view)}),ht(this,`scaleAtClientPoint`,function(e,n){var r=t.clientPointToViewPoint(n),i=t.clampView(ft({},t._view,{scale:t._view.scale+e})),a=t.viewPointToClientPoint(r,i);return i.x=t._view.x-(a.clientX-n.clientX),i.y=t._view.y-(a.clientY-n.clientY),t.setView(i)}),ht(this,`clientPointToViewPoint`,function(e,n){var r=e.clientX,i=e.clientY;n===void 0&&(n=t._view);var a=t.canvasRect||_t,o=a.left,s=a.top,c=r-o,l=i-s;return{x:(c-n.x)/n.scale,y:(l-n.y)/n.scale,relativeClientX:c,relativeClientY:l}}),ht(this,`viewPointToClientPoint`,function(e,n){var r=e.x,i=e.y;n===void 0&&(n=t._view);var a=t.canvasRect||_t,o=a.left,s=a.top,c=r*n.scale+n.x,l=i*n.scale+n.y,u=c+o,d=l+s;return{clientX:u,clientY:d,relativeX:c,relativeY:l,x:u,y:d}}),ht(this,`attachViewChangeListener`,function(e){t._viewChangeListeners.add(e)}),this._scaleExtents=n,this._documentSize=r}return mt(e,[{key:`canvas`,get:function(){return this._canvas},set:function(e){this._canvas=e,this.setView()}},{key:`scale`,get:function(){return this._view.scale}},{key:`x`,get:function(){return this._view.x},set:function(e){this.setView({x:e})}},{key:`y`,get:function(){return this._view.y},set:function(e){this.setView({y:e})}},{key:`view`,get:function(){return ft({},this._view)}},{key:`scaleExtents`,get:function(){return ft({},this._scaleExtents)},set:function(e){var t=e.min,n=e.max;this._scaleExtents={min:t,max:n},this.setView()}},{key:`documentSize`,get:function(){return ft({},this._documentSize)},set:function(e){var t=e.width,n=e.height;this._documentSize={width:t,height:n},this.setView()}},{key:`transformMatrix`,get:function(){return{a:this._view.scale,b:0,c:0,d:this._view.scale,e:this._view.x,f:this._view.y}}},{key:`canvasBounds`,get:function(){if(this._canvas){var e=this._canvas.getBoundingClientRect(),t=e.left,n=e.top,r=e.right,i=e.bottom;return{viewMin:this.clientPointToViewPoint({clientX:t,clientY:n}),viewMax:this.clientPointToViewPoint({clientX:r,clientY:i}),left:t,top:n,right:r,bottom:i,canvasWidth:this._canvas.width,canvasHeight:this._canvas.height}}else return}},{key:`canvasRect`,get:function(){if(this.canvas)return this.canvas.getBoundingClientRect()}}]),e}();function bt(e){var t=e===void 0?{}:e,n=t.ctx,r=t.img,i=t.x,a=t.y,o=t.w,s=t.h,c=t.offsetX,l=t.offsetY;typeof i!=`number`&&(i=0),typeof a!=`number`&&(a=0),typeof o!=`number`&&(o=n.canvas.width),typeof s!=`number`&&(s=n.canvas.height),typeof c!=`number`&&(c=.5),typeof l!=`number`&&(l=.5),c<0&&(c=0),l<0&&(l=0),c>1&&(c=1),l>1&&(l=1);var u=r.width,d=r.height,f=Math.min(o/u,s/d),p=u*f,m=d*f,h,g,_,v,y=1;p<o&&(y=o/p),Math.abs(y-1)<1e-14&&m<s&&(y=s/m),p*=y,m*=y,_=u/(p/o),v=d/(m/s),h=(u-_)*c,g=(d-v)*l,h<0&&(h=0),g<0&&(g=0),_>u&&(_=u),v>d&&(v=d),n.drawImage(r,h,g,_,v,i,a,o,s)}var xt=void 0;function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var St=10,Ct=250,wt=function(e){return e.preventDefault(),xt},Tt=function(){var e=this;K(this,`handleMouseWheel`,function(t,n){var r=n.props,i=r.disabled,a=r.enablePanAndZoom,o=r.mouseZoomFactor;return i?new Et:(a&&t.ctrlKey&&(t.preventDefault(),n.coordSystem.scaleAtClientPoint(o*t.deltaY,Nt(t))),e)}),K(this,`handleDrawStart`,function(e,t){return t.props.disabled?new Et:e.ctrlKey&&t.props.enablePanAndZoom?new Dt().handleDrawStart(e,t):new Ot().handleDrawStart(e,t)}),K(this,`handleDrawMove`,function(t,n){if(n.props.disabled)return new Et;var r=Pt(n.coordSystem,t),i=r.x,a=r.y;return n.lazy.update({x:i,y:a}),e}),K(this,`handleDrawEnd`,function(t,n){return n.props.disabled?new Et:e})},Et=function(){var e=this;K(this,`handleMouseWheel`,function(t,n){return n.props.disabled?e:new Tt().handleMouseWheel(t,n)}),K(this,`handleDrawStart`,function(t,n){return n.props.disabled?e:new Tt().handleDrawStart(t,n)}),K(this,`handleDrawMove`,function(t,n){return n.props.disabled?e:new Tt().handleDrawMove(t,n)}),K(this,`handleDrawEnd`,function(t,n){return n.props.disabled?e:new Tt().handleDrawEnd(t,n)})},Dt=function(){var e=this;K(this,`handleMouseWheel`,wt.bind(this)),K(this,`handleDrawStart`,function(t,n){return t.preventDefault(),e.dragStart=Nt(t),e.panStart={x:n.coordSystem.x,y:n.coordSystem.y},e}),K(this,`handleDrawMove`,function(t,n){t.preventDefault();var r=Nt(t),i=r.clientX,a=r.clientY,o=i-e.dragStart.clientX,s=a-e.dragStart.clientY;return n.coordSystem.setView({x:e.panStart.x+o,y:e.panStart.y+s}),e}),K(this,`handleDrawEnd`,function(){return new Tt})},Ot=function(){var e=this;K(this,`handleMouseWheel`,wt.bind(this)),K(this,`handleDrawStart`,function(t,n){var r=n.props.enablePanAndZoom;return t.preventDefault(),!t.touches||!t.touches.length||!r?new jt().handleDrawStart(t,n):r&&t.touches&&t.touches.length>=2?new kt().handleDrawStart(t,n):e.handleDrawMove(t,n)}),K(this,`handleDrawMove`,function(t,n){if(t.preventDefault(),t.touches&&t.touches.length>=2)return new kt().handleDrawStart(t,n);var r=Nt(t);return e.deferredPoints.push(r),new Date().valueOf()-e.startTimestamp<Ct&&(e.startClientPoint===null&&(e.startClientPoint=r),Math.abs(r.clientX-e.startClientPoint.clientX)+Math.abs(r.clientY-e.startClientPoint.clientY)<St)?e:e.issueDeferredPoints(n)}),K(this,`handleDrawEnd`,function(t,n){return e.issueDeferredPoints(n).handleDrawEnd(t,n)}),K(this,`issueDeferredPoints`,function(t){for(var n=new jt,r=0;r<e.deferredPoints.length;r++){var i=e.deferredPoints[r],a=new Mt(i);n=(r===0?n.handleDrawStart:n.handleDrawMove)(a,t)}return n}),this.startClientPoint=null,this.startTimestamp=new Date().valueOf(),this.deferredPoints=[]},kt=function(){var e=this;K(this,`handleMouseWheel`,wt.bind(this)),K(this,`handleDrawStart`,function(t,n){return t.preventDefault(),!t.touches||t.touches.length<2?new Tt:(e.start=e.getTouchMetrics(t),e.panStart={x:n.coordSystem.x,y:n.coordSystem.y},e.scaleStart=n.coordSystem.scale,e)}),K(this,`handleDrawMove`,function(t,n){if(t.preventDefault(),!t.touches||t.touches.length<2)return new Tt;var r=e.recentMetrics=e.getTouchMetrics(t),i=r.centroid,a=r.distance;if(Math.abs(a-e.start.distance)>=St)return new q(e).handleDrawMove(t,n);var o=i.clientX-e.start.centroid.clientX,s=i.clientY-e.start.centroid.clientY;return Math.abs(o)+Math.abs(s)>=St?new At(e).handleDrawMove(t,n):e}),K(this,`handleDrawEnd`,function(){return new Tt}),K(this,`getTouchMetrics`,function(e){var t=Nt(e.touches[0]),n=t.clientX,r=t.clientY,i=Nt(e.touches[1]),a=i.clientX,o=i.clientY,s=a-n,c=o-r;return{t1:{clientX:n,clientY:r},t2:{clientX:a,clientY:o},distance:Math.sqrt(s*s+c*c),centroid:{clientX:(n+a)/2,clientY:(r+o)/2}}})},At=function(e){var t=this;K(this,`handleMouseWheel`,wt.bind(this)),K(this,`handleDrawStart`,function(){return t}),K(this,`handleDrawMove`,function(e,n){if(e.preventDefault(),!e.touches||e.touches.length<2)return new Tt;var r=t.scaleOrPanState,i=r.recentMetrics=r.getTouchMetrics(e),a=i.centroid;i.distance;var o=a.clientX-r.start.centroid.clientX,s=a.clientY-r.start.centroid.clientY;return n.setView({x:r.panStart.x+o,y:r.panStart.y+s}),t}),K(this,`handleDrawEnd`,function(){return new Tt}),this.scaleOrPanState=e},q=function(e){var t=this;K(this,`handleMouseWheel`,wt.bind(this)),K(this,`handleDrawStart`,function(){return t}),K(this,`handleDrawMove`,function(e,n){if(e.preventDefault(),!e.touches||e.touches.length<2)return new Tt;var r=t.scaleOrPanState,i=r.recentMetrics=r.getTouchMetrics(e),a=i.centroid,o=i.distance,s=r.scaleStart*(o/r.start.distance)-n.coordSystem.scale;return n.coordSystem.scaleAtClientPoint(s,a),t}),K(this,`handleDrawEnd`,function(){return new Tt}),this.scaleOrPanState=e},jt=function(){var e=this;K(this,`handleMouseWheel`,wt.bind(this)),K(this,`handleDrawStart`,function(t,n){if(t.preventDefault(),t.touches&&t.touches.length){var r=Pt(n.coordSystem,t),i=r.x,a=r.y;n.lazy.update({x:i,y:a},{both:!0})}return e.handleDrawMove(t,n)}),K(this,`handleDrawMove`,function(t,n){t.preventDefault();var r=Pt(n.coordSystem,t),i=r.x,a=r.y;n.lazy.update({x:i,y:a});var o=!n.lazy.isEnabled();return(!e.isDrawing||o)&&(n.points.push(n.clampPointToDocument(n.lazy.brush.toObject())),e.isDrawing=!0),n.points.push(n.clampPointToDocument(n.lazy.brush.toObject())),n.drawPoints({points:n.points,brushColor:n.props.brushColor,brushRadius:n.props.brushRadius}),e}),K(this,`handleDrawEnd`,function(t,n){return t.preventDefault(),e.handleDrawMove(t,n),n.saveLine(),new Tt}),this.isDrawing=!1},Mt=function(e){var t=e.clientX,n=e.clientY;K(this,`preventDefault`,function(){}),this.clientX=t,this.clientY=n,this.touches=[{clientX:t,clientY:n}]};function Nt(e){var t=e.clientX,n=e.clientY;return e.changedTouches&&e.changedTouches.length>0&&(t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY),{clientX:t,clientY:n}}function Pt(e,t){return e.clientPointToViewPoint(Nt(t))}var Ft=!1;try{var It={get passive(){return Ft=!0,!1}};window.addEventListener(`test`,It,It),window.removeEventListener(`test`,It,It)}catch{Ft=!1}function Lt(e){return Ft?{passive:e}:e}function Rt(e,t){var n;if(typeof Symbol>`u`||e[Symbol.iterator]==null){if(Array.isArray(e)||(n=zt(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
1
|
+
import{o as e,t}from"./DAXXjFlN.chunk.js";import{n,r,t as i}from"./D8uRDrkd.chunk.js";import{_ as a,u as o}from"./BftnFbcr.chunk.js";import{t as s}from"./e57H3T-k.chunk.js";import{t as c}from"./C2w0pmFW.chunk.js";import{t as l}from"./wrLrTezN.chunk.js";import{t as u}from"./BVnMI-dl.chunk.js";import{M as d,N as f}from"./J0QUvPGS.chunk.js";import{t as p}from"./C1SLt-ar.chunk.js";import{U as m,_ as h,a as g,l as _,y as v,z as y}from"./NlCAcBdo.chunk.js";import{n as b,t as x}from"./BzfCWDOl.chunk.js";import{t as S}from"./C5j5LRut2.chunk.js";import{t as C}from"./BDwjs8qz2.chunk.js";import{t as w}from"./B3TDTJSl.chunk.js";import{n as T,r as E}from"./BRcHS92O2.chunk.js";import{t as D}from"./DXeT_p8s2.chunk.js";import{n as O,t as k}from"./D9a0OIfi2.chunk.js";import{t as A}from"./Bbp2U9GK2.chunk.js";import{n as j}from"./BGGL8m_U2.chunk.js";import{t as M}from"./DCBtWC6W.chunk.js";import{n as ee}from"./BIzu5ufQ.chunk.js";import{t as N}from"./9LNlP5yJ.chunk.js";import{n as P,t as te}from"./ClVhjUGI.chunk.js";import{t as ne}from"./E5Pmu4O7.chunk.js";import{t as F}from"./D5yUWL7p.chunk.js";import{t as I}from"./BxYKQEUG2.chunk.js";import{t as L}from"./dEqScqMh2.chunk.js";import{t as R}from"./D1EthTiX.chunk.js";import{t as re}from"./BVk9tE02.chunk.js";import{n as ie}from"./bWC12YrP.chunk.js";import{t as ae}from"./C7HU4huj.chunk.js";import{n as oe,r as se,t as z}from"./BGswYbRT.chunk.js";import{t as ce}from"./o_O53MMd.chunk.js";import{t as B}from"./9kSpxveW.chunk.js";import{t as le}from"./C-THHyTP.chunk.js";import{t as ue}from"./DDJBf9pK.chunk.js";import{t as de}from"./DUXPuDp7.chunk.js";import{t as fe}from"./DSuhq1Rt2.chunk.js";import{t as pe}from"./Dp6QHgBL2.chunk.js";import{t as me}from"./ByszCPst2.chunk.js";import{t as he}from"./B44BW79X.chunk.js";import{t as ge}from"./BfiSXcgz2.chunk.js";import{t as _e}from"./DGA_eT2h2.chunk.js";import{t as ve}from"./Dg1mFtY2.chunk.js";import{t as ye}from"./BBEIIgZ6.chunk.js";import{t as be}from"./CHL4nrKG.chunk.js";import{n as xe,t as Se}from"./CWMwyVGJ2.chunk.js";import{t as Ce}from"./CfTTKh6M.chunk.js";import{t as we}from"./lPQgHDFT.chunk.js";import{n as Te,t as Ee}from"./Ib9eoq_Y.chunk.js";import{d as De,i as V,m as Oe,n as ke,p as Ae,r as je,t as Me}from"./DTliAJ8L.chunk.js";import{n as Ne,t as Pe}from"./CYrelpYt.chunk.js";import{t as Fe}from"./C3Wa868y.chunk.js";import"./14z5Gy8L.chunk.js";import"./FysETOFv.chunk.js";import{t as Ie}from"./D5nbPgu6.chunk.js";import{n as Le,t as Re}from"./CsOC2WrI.chunk.js";import{i as ze,r as Be}from"./j59ag8H4.chunk.js";import{a as Ve,o as He,s as Ue,t as We}from"./C_-lTHCv.chunk.js";import{t as Ge}from"./VMYkPZfT.chunk.js";import{t as Ke}from"./D7hSSm4r2.chunk.js";import{t as qe}from"./BoTN63OZ2.chunk.js";import{t as Je}from"./BiKac8UT2.chunk.js";var H=e(c()),U=l(),Ye=e(j()),Xe=e(ee()),Ze=function(e){return e[e.View=0]=`View`,e[e.Create=1]=`Create`,e}({}),Qe=class extends D{constructor(){super(`Could not connect to submit interactive results`)}get name(){return`InternetConnectivityError`}get dialogOptions(){return{title:`Connection issues`,text:`There seems to be an issue with your internet connection. Refresh the page to try again. `,buttons:[{text:`Refresh`,className:`btn btn-dark`,success:!0}]}}onDone(){window.location.reload()}},$e=class{constructor(e){this.options=e,this.save=this.save.bind(this)}start(e){e&&(this.resultId=e),this.startSession()}async startSession(){if(this.resultId)return;let{interactiveId:e,metadataId:t,userId:n,customerId:r,shareId:i,playerApi:o}=this.options,s={interactiveId:e,metadataId:t,userId:n,customerId:r,shareId:i,anonymous:!n};n||(s.anonymous=!0,s.sessionId=w.getClientSessionData(null)?.windowId);try{let e=await Oe.post(o+`interactive/start-session`,JSON.stringify(s));this.resultId=e.resultId}catch{a.throw(new Qe)}}async save(e,t){this.resultId||await this.startSession();let n={resultId:this.resultId,interactionId:e,results:t};try{await Oe.post(this.options.playerApi+`interactive/save-actions`,JSON.stringify(n),void 0,!1)}catch(e){console.log(e),a.throw(new Qe)}}},W={svg:`_svg_q8zfb_1`,iconButton:`_iconButton_q8zfb_6`,iconWithText:`_iconWithText_q8zfb_10`,iconOnly:`_iconOnly_q8zfb_22`};function et(e){let{className:t,svg:n,children:r,...a}=e,o=`${t} ${W.iconButton}`;return r?o+=` ${W.iconWithText}`:o+=` ${W.iconOnly}`,(0,U.jsxs)(A,{className:o,...a,children:[(0,U.jsx)(i,{svg:n,className:W.svg}),r]})}function tt(e){let{isCreate:t,open:n,showTypeSelector:r}=e;return!t||n?(0,U.jsx)(U.Fragment,{}):(0,U.jsx)(et,{className:`btn btn-outline-dark cv-add-question`,onClick:r,svg:ue,children:`Add question`})}function G(e){return(0,U.jsx)(`div`,{className:`cv-interactive-question`,children:(0,U.jsx)(`div`,{className:`mb-2 h4`,dangerouslySetInnerHTML:{__html:s.sanitize(e.interaction.data.annotation).replace(/<(a)(.*?)>/g,`<$1 target="_blank" $2>`)}})})}function nt(e){return(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,...e,children:(0,U.jsx)(`path`,{d:`M10.6191 3.42871C11.5658 3.42875 12.3329 4.19596 12.333 5.14258V11.1426H19.7139C20.6606 11.1426 21.4287 11.9106 21.4287 12.8574V18.8574C21.4286 19.8041 20.6605 20.5713 19.7139 20.5713H9.42871C8.48203 20.5713 7.71402 19.8041 7.71387 18.8574V17.1426H4.61914C3.67241 17.1426 2.90535 16.3754 2.90527 15.4287V5.14258C2.90542 4.19593 3.67246 3.42871 4.61914 3.42871H10.6191ZM9.42871 12C9.00014 12 8.57129 12.4289 8.57129 12.8574V18.8574C8.57144 19.3307 8.95542 19.7139 9.42871 19.7139H19.7139C20.1872 19.7139 20.5711 19.3307 20.5713 18.8574V12.8574C20.5713 12.384 20.1873 12 19.7139 12H9.42871ZM19.292 13.7139C19.7143 13.714 19.7139 13.9883 19.7139 13.9883V17.7207C19.7138 17.7297 19.7073 17.9998 19.292 18C18.8765 18 18.8579 17.7299 18.8574 17.7207V13.9883C18.8574 13.9883 18.8694 13.7139 19.292 13.7139ZM10.5 15.4004C10.7761 15.4004 11 15.6242 11 15.9004C10.9998 16.1764 10.776 16.4004 10.5 16.4004C10.224 16.4004 10.0002 16.1764 10 15.9004C10 15.6242 10.2239 15.4004 10.5 15.4004ZM4.61914 4.28613C4.14585 4.28613 3.76187 4.66932 3.76172 5.14258V15.4287C3.76179 15.902 4.1458 16.2861 4.61914 16.2861H7.71387V12.8574C7.71387 11.5717 8.57157 11.1426 9.42871 11.1426H11.4766V5.14258C11.4764 4.66934 11.0924 4.28617 10.6191 4.28613H4.61914ZM17 3.5C18.2431 3.5 19.5 4.49193 19.5 6V7.79297L20.6465 6.64648C20.8417 6.45122 21.1583 6.45122 21.3535 6.64648C21.5488 6.84175 21.5488 7.15825 21.3535 7.35352L19 9.70703L16.6465 7.35352C16.4512 7.15825 16.4512 6.84175 16.6465 6.64648C16.8417 6.45122 17.1583 6.45122 17.3535 6.64648L18.5 7.79297V6C18.5 5.10807 17.7569 4.5 17 4.5H14C13.7239 4.5 13.5 4.27614 13.5 4C13.5 3.72386 13.7239 3.5 14 3.5H17ZM9.48242 5.14258C9.48462 5.14258 9.76169 5.14454 9.76172 5.56543C9.76172 5.98634 9.48469 5.9999 9.48242 6H5.75C5.75 6 5.47656 5.98807 5.47656 5.56543C5.47659 5.14286 5.75 5.14258 5.75 5.14258H9.48242Z`,fill:`currentColor`})})}var rt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}e.default=function e(n,r){t(this,e),this.x=n,this.y=r}})),it=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),n=r(rt());function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function a(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function o(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}e.default=function(e){o(r,e);function r(){return i(this,r),a(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return t(r,[{key:`update`,value:function(e){this.x=e.x,this.y=e.y}},{key:`moveByAngle`,value:function(e,t){var n=e+Math.PI/2;this.x+=Math.sin(n)*t,this.y-=Math.cos(n)*t}},{key:`equalsTo`,value:function(e){return this.x===e.x&&this.y===e.y}},{key:`getDifferenceTo`,value:function(e){return new n.default(this.x-e.x,this.y-e.y)}},{key:`getDistanceTo`,value:function(e){var t=this.getDifferenceTo(e);return Math.sqrt(t.x**2+t.y**2)}},{key:`getAngleTo`,value:function(e){var t=this.getDifferenceTo(e);return Math.atan2(t.y,t.x)}},{key:`toObject`,value:function(){return{x:this.x,y:this.y}}}]),r}(n.default)})),at=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),n=r(it());function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var a=30;e.default=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.radius,o=r===void 0?a:r,s=t.enabled,c=s===void 0||s,l=t.initialPoint,u=l===void 0?{x:0,y:0}:l;i(this,e),this.radius=o,this._isEnabled=c,this.pointer=new n.default(u.x,u.y),this.brush=new n.default(u.x,u.y),this.angle=0,this.distance=0,this._hasMoved=!1}return t(e,[{key:`enable`,value:function(){this._isEnabled=!0}},{key:`disable`,value:function(){this._isEnabled=!1}},{key:`isEnabled`,value:function(){return this._isEnabled}},{key:`setRadius`,value:function(e){this.radius=e}},{key:`getRadius`,value:function(){return this.radius}},{key:`getBrushCoordinates`,value:function(){return this.brush.toObject()}},{key:`getPointerCoordinates`,value:function(){return this.pointer.toObject()}},{key:`getBrush`,value:function(){return this.brush}},{key:`getPointer`,value:function(){return this.pointer}},{key:`getAngle`,value:function(){return this.angle}},{key:`getDistance`,value:function(){return this.distance}},{key:`brushHasMoved`,value:function(){return this._hasMoved}},{key:`update`,value:function(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).both,n=t!==void 0&&t;return this._hasMoved=!1,this.pointer.equalsTo(e)&&!n?!1:(this.pointer.update(e),n?(this._hasMoved=!0,this.brush.update(e),!0):(this._isEnabled?(this.distance=this.pointer.getDistanceTo(this.brush),this.angle=this.pointer.getAngleTo(this.brush),this.distance>this.radius&&(this.brush.moveByAngle(this.angle,this.distance-this.radius),this._hasMoved=!0)):(this.distance=0,this.angle=0,this.brush.update(e),this._hasMoved=!0),!0))}}]),e}()})),ot=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LazyPoint=e.Point=e.LazyBrush=void 0;var t=i(at()),n=i(rt()),r=i(it());function i(e){return e&&e.__esModule?e:{default:e}}e.LazyBrush=t.default,e.Point=n.default,e.LazyPoint=r.default})),st=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function n(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}e.default=function(){function e(t,r){n(this,e),this.x=t,this.y=r}return t(e,[{key:`update`,value:function(e){this.x=e.x,this.y=e.y}},{key:`getDifferenceTo`,value:function(t){return new e(this.x-t.x,this.y-t.y)}},{key:`getDistanceTo`,value:function(e){var t=this.getDifferenceTo(e);return Math.sqrt(t.x**2+t.y**2)}}]),e}()})),ct=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),n=r(st());function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var a=1e-6;e.default=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.segments,a=r===void 0?50:r,o=t.iterationLimit,s=o===void 0?100:o;i(this,e),this.p1=new n.default,this.p2=new n.default,this.segments=a,this.iterationLimit=s}return t(e,[{key:`drawToCanvas`,value:function(e,t,n,r){this.p1.update(t),this.p2.update(n);var i=this.p1.x>this.p2.x,a=i?this.p2:this.p1,o=i?this.p1:this.p2,s=a.getDistanceTo(o),c=[],l=!0;if(s<r)if(o.x-a.x>.01){var u=o.x-a.x,d=o.y-a.y,f=-this.getCatenaryParameter(u,d,r,this.iterationLimit),p=(f*Math.log((r+d)/(r-d))-u)*.5,m=f*Math.cosh(p/f),h=a.x-p,g=a.y-m;c=this.getCurve(f,a,o,h,g,this.segments),l=!1}else{var _=(a.x+o.x)*.5,v=(a.y+o.y+r)*.5;c=[[a.x,a.y],[_,v],[o.x,o.y]]}else c=[[a.x,a.y],[o.x,o.y]];return l?this.drawLine(c,e):this.drawCurve(c,e),c}},{key:`getCatenaryParameter`,value:function(e,t,n,r){for(var i=Math.sqrt(n*n-t*t)/e,o=Math.acosh(i)+1,s=-1,c=0;Math.abs(o-s)>a&&c<r;)s=o,o-=(Math.sinh(o)-i*o)/(Math.cosh(o)-i),c++;return e/(2*o)}},{key:`getCurve`,value:function(e,t,n,r,i,a){for(var o=[t.x,e*Math.cosh((t.x-r)/e)+i],s=n.x-t.x,c=a-1,l=0;l<c;l++){var u=t.x+s*(l+.5)/c,d=e*Math.cosh((u-r)/e)+i;o.push(u,d)}return o.push(n.x,e*Math.cosh((n.x-r)/e)+i),o}},{key:`drawLine`,value:function(e,t){t.moveTo(e[0][0],e[0][1]),t.lineTo(e[1][0],e[1][1])}},{key:`drawCurve`,value:function(e,t){var n=e.length*.5-1,r=e[2],i=e[3],a=[];t.moveTo(e[0],e[1]);for(var o=2;o<n;o++){var s=e[o*2],c=e[o*2+1],l=(s+r)*.5,u=(c+i)*.5;a.push([r,i,l,u]),t.quadraticCurveTo(r,i,l,u),r=s,i=c}return n=e.length,t.quadraticCurveTo(e[n-4],e[n-3],e[n-2],e[n-1]),a}}]),e}()})),lt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Point=e.Catenary=void 0;var t=r(ct()),n=r(st());function r(e){return e&&e.__esModule?e:{default:e}}e.Catenary=t.default,e.Point=n.default})),ut=ot(),dt=lt();function ft(){return ft=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ft.apply(this,arguments)}function pt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function mt(e,t,n){return t&&pt(e.prototype,t),n&&pt(e,n),e}function ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gt=Object.freeze({x:0,y:0,untransformedX:0,untransformedY:0}),_t=Object.freeze({canvasWidth:0,canvasHeight:0,left:0,top:0,right:0,bottom:0,viewMin:gt,viewMax:gt}),vt=Object.freeze({a:1,b:0,c:0,d:1,e:0,f:0}),yt=function(){function e(e){var t=this,n=e.scaleExtents,r=e.documentSize;ht(this,`_scaleExtents`,void 0),ht(this,`_documentSize`,void 0),ht(this,`_canvas`,null),ht(this,`_view`,{scale:1,x:0,y:0}),ht(this,`_viewChangeListeners`,new Set),ht(this,`setScale`,function(e){t.setView({scale:e})}),ht(this,`clampView`,function(e){var n=e.scale,r=e.x,i=e.y,a=t.scaleExtents,o=a.min,s=a.max,c=t.documentSize,l=c.width,u=c.height,d=t.canvasRect||_t,f=d.left,p=d.top,m=d.right,h=d.bottom,g=m-f,_=h-p,v=g/2,y=-(l*t._view.scale-g/2),b=_/2,x=-(u*t._view.scale-_/2);return{scale:Math.min(Math.max(n,o),s),x:Math.min(Math.max(r,y),v),y:Math.min(Math.max(i,x),b)}}),ht(this,`resetView`,function(){t.setView({scale:1,x:0,y:0})}),ht(this,`setView`,function(e){var n=t.clampView(ft({},t._view,e||{})),r=t._view,i=r.scale,a=r.x,o=r.y;return(n.scale!==i||n.x!==a||n.y!==o)&&(t._view=n,t._viewChangeListeners.forEach(function(e){return e&&e(n)})),ft({},t._view)}),ht(this,`scaleAtClientPoint`,function(e,n){var r=t.clientPointToViewPoint(n),i=t.clampView(ft({},t._view,{scale:t._view.scale+e})),a=t.viewPointToClientPoint(r,i);return i.x=t._view.x-(a.clientX-n.clientX),i.y=t._view.y-(a.clientY-n.clientY),t.setView(i)}),ht(this,`clientPointToViewPoint`,function(e,n){var r=e.clientX,i=e.clientY;n===void 0&&(n=t._view);var a=t.canvasRect||_t,o=a.left,s=a.top,c=r-o,l=i-s;return{x:(c-n.x)/n.scale,y:(l-n.y)/n.scale,relativeClientX:c,relativeClientY:l}}),ht(this,`viewPointToClientPoint`,function(e,n){var r=e.x,i=e.y;n===void 0&&(n=t._view);var a=t.canvasRect||_t,o=a.left,s=a.top,c=r*n.scale+n.x,l=i*n.scale+n.y,u=c+o,d=l+s;return{clientX:u,clientY:d,relativeX:c,relativeY:l,x:u,y:d}}),ht(this,`attachViewChangeListener`,function(e){t._viewChangeListeners.add(e)}),this._scaleExtents=n,this._documentSize=r}return mt(e,[{key:`canvas`,get:function(){return this._canvas},set:function(e){this._canvas=e,this.setView()}},{key:`scale`,get:function(){return this._view.scale}},{key:`x`,get:function(){return this._view.x},set:function(e){this.setView({x:e})}},{key:`y`,get:function(){return this._view.y},set:function(e){this.setView({y:e})}},{key:`view`,get:function(){return ft({},this._view)}},{key:`scaleExtents`,get:function(){return ft({},this._scaleExtents)},set:function(e){var t=e.min,n=e.max;this._scaleExtents={min:t,max:n},this.setView()}},{key:`documentSize`,get:function(){return ft({},this._documentSize)},set:function(e){var t=e.width,n=e.height;this._documentSize={width:t,height:n},this.setView()}},{key:`transformMatrix`,get:function(){return{a:this._view.scale,b:0,c:0,d:this._view.scale,e:this._view.x,f:this._view.y}}},{key:`canvasBounds`,get:function(){if(this._canvas){var e=this._canvas.getBoundingClientRect(),t=e.left,n=e.top,r=e.right,i=e.bottom;return{viewMin:this.clientPointToViewPoint({clientX:t,clientY:n}),viewMax:this.clientPointToViewPoint({clientX:r,clientY:i}),left:t,top:n,right:r,bottom:i,canvasWidth:this._canvas.width,canvasHeight:this._canvas.height}}else return}},{key:`canvasRect`,get:function(){if(this.canvas)return this.canvas.getBoundingClientRect()}}]),e}();function bt(e){var t=e===void 0?{}:e,n=t.ctx,r=t.img,i=t.x,a=t.y,o=t.w,s=t.h,c=t.offsetX,l=t.offsetY;typeof i!=`number`&&(i=0),typeof a!=`number`&&(a=0),typeof o!=`number`&&(o=n.canvas.width),typeof s!=`number`&&(s=n.canvas.height),typeof c!=`number`&&(c=.5),typeof l!=`number`&&(l=.5),c<0&&(c=0),l<0&&(l=0),c>1&&(c=1),l>1&&(l=1);var u=r.width,d=r.height,f=Math.min(o/u,s/d),p=u*f,m=d*f,h,g,_,v,y=1;p<o&&(y=o/p),Math.abs(y-1)<1e-14&&m<s&&(y=s/m),p*=y,m*=y,_=u/(p/o),v=d/(m/s),h=(u-_)*c,g=(d-v)*l,h<0&&(h=0),g<0&&(g=0),_>u&&(_=u),v>d&&(v=d),n.drawImage(r,h,g,_,v,i,a,o,s)}var xt=void 0;function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var St=10,Ct=250,wt=function(e){return e.preventDefault(),xt},Tt=function(){var e=this;K(this,`handleMouseWheel`,function(t,n){var r=n.props,i=r.disabled,a=r.enablePanAndZoom,o=r.mouseZoomFactor;return i?new Et:(a&&t.ctrlKey&&(t.preventDefault(),n.coordSystem.scaleAtClientPoint(o*t.deltaY,Nt(t))),e)}),K(this,`handleDrawStart`,function(e,t){return t.props.disabled?new Et:e.ctrlKey&&t.props.enablePanAndZoom?new Dt().handleDrawStart(e,t):new Ot().handleDrawStart(e,t)}),K(this,`handleDrawMove`,function(t,n){if(n.props.disabled)return new Et;var r=Pt(n.coordSystem,t),i=r.x,a=r.y;return n.lazy.update({x:i,y:a}),e}),K(this,`handleDrawEnd`,function(t,n){return n.props.disabled?new Et:e})},Et=function(){var e=this;K(this,`handleMouseWheel`,function(t,n){return n.props.disabled?e:new Tt().handleMouseWheel(t,n)}),K(this,`handleDrawStart`,function(t,n){return n.props.disabled?e:new Tt().handleDrawStart(t,n)}),K(this,`handleDrawMove`,function(t,n){return n.props.disabled?e:new Tt().handleDrawMove(t,n)}),K(this,`handleDrawEnd`,function(t,n){return n.props.disabled?e:new Tt().handleDrawEnd(t,n)})},Dt=function(){var e=this;K(this,`handleMouseWheel`,wt.bind(this)),K(this,`handleDrawStart`,function(t,n){return t.preventDefault(),e.dragStart=Nt(t),e.panStart={x:n.coordSystem.x,y:n.coordSystem.y},e}),K(this,`handleDrawMove`,function(t,n){t.preventDefault();var r=Nt(t),i=r.clientX,a=r.clientY,o=i-e.dragStart.clientX,s=a-e.dragStart.clientY;return n.coordSystem.setView({x:e.panStart.x+o,y:e.panStart.y+s}),e}),K(this,`handleDrawEnd`,function(){return new Tt})},Ot=function(){var e=this;K(this,`handleMouseWheel`,wt.bind(this)),K(this,`handleDrawStart`,function(t,n){var r=n.props.enablePanAndZoom;return t.preventDefault(),!t.touches||!t.touches.length||!r?new jt().handleDrawStart(t,n):r&&t.touches&&t.touches.length>=2?new kt().handleDrawStart(t,n):e.handleDrawMove(t,n)}),K(this,`handleDrawMove`,function(t,n){if(t.preventDefault(),t.touches&&t.touches.length>=2)return new kt().handleDrawStart(t,n);var r=Nt(t);return e.deferredPoints.push(r),new Date().valueOf()-e.startTimestamp<Ct&&(e.startClientPoint===null&&(e.startClientPoint=r),Math.abs(r.clientX-e.startClientPoint.clientX)+Math.abs(r.clientY-e.startClientPoint.clientY)<St)?e:e.issueDeferredPoints(n)}),K(this,`handleDrawEnd`,function(t,n){return e.issueDeferredPoints(n).handleDrawEnd(t,n)}),K(this,`issueDeferredPoints`,function(t){for(var n=new jt,r=0;r<e.deferredPoints.length;r++){var i=e.deferredPoints[r],a=new Mt(i);n=(r===0?n.handleDrawStart:n.handleDrawMove)(a,t)}return n}),this.startClientPoint=null,this.startTimestamp=new Date().valueOf(),this.deferredPoints=[]},kt=function(){var e=this;K(this,`handleMouseWheel`,wt.bind(this)),K(this,`handleDrawStart`,function(t,n){return t.preventDefault(),!t.touches||t.touches.length<2?new Tt:(e.start=e.getTouchMetrics(t),e.panStart={x:n.coordSystem.x,y:n.coordSystem.y},e.scaleStart=n.coordSystem.scale,e)}),K(this,`handleDrawMove`,function(t,n){if(t.preventDefault(),!t.touches||t.touches.length<2)return new Tt;var r=e.recentMetrics=e.getTouchMetrics(t),i=r.centroid,a=r.distance;if(Math.abs(a-e.start.distance)>=St)return new q(e).handleDrawMove(t,n);var o=i.clientX-e.start.centroid.clientX,s=i.clientY-e.start.centroid.clientY;return Math.abs(o)+Math.abs(s)>=St?new At(e).handleDrawMove(t,n):e}),K(this,`handleDrawEnd`,function(){return new Tt}),K(this,`getTouchMetrics`,function(e){var t=Nt(e.touches[0]),n=t.clientX,r=t.clientY,i=Nt(e.touches[1]),a=i.clientX,o=i.clientY,s=a-n,c=o-r;return{t1:{clientX:n,clientY:r},t2:{clientX:a,clientY:o},distance:Math.sqrt(s*s+c*c),centroid:{clientX:(n+a)/2,clientY:(r+o)/2}}})},At=function(e){var t=this;K(this,`handleMouseWheel`,wt.bind(this)),K(this,`handleDrawStart`,function(){return t}),K(this,`handleDrawMove`,function(e,n){if(e.preventDefault(),!e.touches||e.touches.length<2)return new Tt;var r=t.scaleOrPanState,i=r.recentMetrics=r.getTouchMetrics(e),a=i.centroid;i.distance;var o=a.clientX-r.start.centroid.clientX,s=a.clientY-r.start.centroid.clientY;return n.setView({x:r.panStart.x+o,y:r.panStart.y+s}),t}),K(this,`handleDrawEnd`,function(){return new Tt}),this.scaleOrPanState=e},q=function(e){var t=this;K(this,`handleMouseWheel`,wt.bind(this)),K(this,`handleDrawStart`,function(){return t}),K(this,`handleDrawMove`,function(e,n){if(e.preventDefault(),!e.touches||e.touches.length<2)return new Tt;var r=t.scaleOrPanState,i=r.recentMetrics=r.getTouchMetrics(e),a=i.centroid,o=i.distance,s=r.scaleStart*(o/r.start.distance)-n.coordSystem.scale;return n.coordSystem.scaleAtClientPoint(s,a),t}),K(this,`handleDrawEnd`,function(){return new Tt}),this.scaleOrPanState=e},jt=function(){var e=this;K(this,`handleMouseWheel`,wt.bind(this)),K(this,`handleDrawStart`,function(t,n){if(t.preventDefault(),t.touches&&t.touches.length){var r=Pt(n.coordSystem,t),i=r.x,a=r.y;n.lazy.update({x:i,y:a},{both:!0})}return e.handleDrawMove(t,n)}),K(this,`handleDrawMove`,function(t,n){t.preventDefault();var r=Pt(n.coordSystem,t),i=r.x,a=r.y;n.lazy.update({x:i,y:a});var o=!n.lazy.isEnabled();return(!e.isDrawing||o)&&(n.points.push(n.clampPointToDocument(n.lazy.brush.toObject())),e.isDrawing=!0),n.points.push(n.clampPointToDocument(n.lazy.brush.toObject())),n.drawPoints({points:n.points,brushColor:n.props.brushColor,brushRadius:n.props.brushRadius}),e}),K(this,`handleDrawEnd`,function(t,n){return t.preventDefault(),e.handleDrawMove(t,n),n.saveLine(),new Tt}),this.isDrawing=!1},Mt=function(e){var t=e.clientX,n=e.clientY;K(this,`preventDefault`,function(){}),this.clientX=t,this.clientY=n,this.touches=[{clientX:t,clientY:n}]};function Nt(e){var t=e.clientX,n=e.clientY;return e.changedTouches&&e.changedTouches.length>0&&(t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY),{clientX:t,clientY:n}}function Pt(e,t){return e.clientPointToViewPoint(Nt(t))}var Ft=!1;try{var It={get passive(){return Ft=!0,!1}};window.addEventListener(`test`,It,It),window.removeEventListener(`test`,It,It)}catch{Ft=!1}function Lt(e){return Ft?{passive:e}:e}function Rt(e,t){var n;if(typeof Symbol>`u`||e[Symbol.iterator]==null){if(Array.isArray(e)||(n=zt(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return n=e[Symbol.iterator](),n.next.bind(n)}function zt(e,t){if(e){if(typeof e==`string`)return Bt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bt(e,t)}}function Bt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Vt(){return Vt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vt.apply(this,arguments)}function J(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Ht(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ut(e,t){return{x:e.x+(t.x-e.x)/2,y:e.y+(t.y-e.y)/2}}var Wt={display:`block`,position:`absolute`},Gt=[`grid`,`drawing`,`temp`,`interface`],Kt=function(e){Ht(t,e);function t(t){var n=e.call(this,t)||this;return Y(J(n),`undo`,function(){var e=[];n.lines.length?e=n.lines.slice(0,-1):n.erasedLines.length&&(e=n.erasedLines.pop()),n.clearExceptErasedLines(),n.simulateDrawingLines({lines:e,immediate:!0}),n.triggerOnChange()}),Y(J(n),`eraseAll`,function(){n.erasedLines.push([].concat(n.lines)),n.clearExceptErasedLines(),n.triggerOnChange()}),Y(J(n),`clear`,function(){n.erasedLines=[],n.clearExceptErasedLines(),n.resetView()}),Y(J(n),`resetView`,function(){return n.coordSystem.resetView()}),Y(J(n),`setView`,function(e){return n.coordSystem.setView(e)}),Y(J(n),`getSaveData`,function(){return JSON.stringify({lines:n.lines,width:n.props.canvasWidth,height:n.props.canvasHeight})}),Y(J(n),`getDataURL`,function(e,t,r){var i=n.canvas.drawing,a=i.getContext(`2d`),o=i.width,s=i.height,c=a.getImageData(0,0,o,s),l=a.globalCompositeOperation;if(a.globalCompositeOperation=`destination-over`,t){if(!n.props.imgSrc)return`Background image source not set`;n.drawImage()}else r!=null&&(a.fillStyle=r,a.fillRect(0,0,o,s));e||=`png`;var u=i.toDataURL(`image/`+e);return a.clearRect(0,0,o,s),a.putImageData(c,0,0),a.globalCompositeOperation=l,u}),Y(J(n),`loadSaveData`,function(e,t){if(t===void 0&&(t=n.props.immediateLoading),typeof e!=`string`)throw Error(`saveData needs to be of type string!`);var r=JSON.parse(e),i=r.lines,a=r.width,o=r.height;if(!i||typeof i.push!=`function`)throw Error(`saveData.lines needs to be an array!`);if(n.clear(),a===n.props.canvasWidth&&o===n.props.canvasHeight)n.simulateDrawingLines({lines:i,immediate:t});else{var s=n.props.canvasWidth/a,c=n.props.canvasHeight/o,l=(s+c)/2;n.simulateDrawingLines({lines:i.map(function(e){return Vt({},e,{points:e.points.map(function(e){return{x:e.x*s,y:e.y*c}}),brushRadius:e.brushRadius*l})}),immediate:t})}}),Y(J(n),`componentWillUnmount`,function(){n.canvasObserver.unobserve(n.canvasContainer),n.canvas.interface&&n.canvas.interface.removeEventListener(`wheel`,n.handleWheel)}),Y(J(n),`handleWheel`,function(e){n.interactionSM=n.interactionSM.handleMouseWheel(e,J(n))}),Y(J(n),`handleDrawStart`,function(e){n.interactionSM=n.interactionSM.handleDrawStart(e,J(n)),n.mouseHasMoved=!0}),Y(J(n),`handleDrawMove`,function(e){n.interactionSM=n.interactionSM.handleDrawMove(e,J(n)),n.mouseHasMoved=!0}),Y(J(n),`handleDrawEnd`,function(e){n.interactionSM=n.interactionSM.handleDrawEnd(e,J(n)),n.mouseHasMoved=!0}),Y(J(n),`applyView`,function(){if(n.ctx.drawing&&(Gt.map(function(e){return n.ctx[e]}).forEach(function(e){n.clearWindow(e);var t=n.coordSystem.transformMatrix;e.setTransform(t.a,t.b,t.c,t.d,t.e,t.f)}),!n.deferRedrawOnViewChange)){n.drawGrid(n.ctx.grid),n.redrawImage(),n.loop({once:!0});var e=n.lines;n.lines=[],n.simulateDrawingLines({lines:e,immediate:!0})}}),Y(J(n),`handleCanvasResize`,function(e){var t=n.getSaveData();n.deferRedrawOnViewChange=!0;try{for(var r=Rt(e),i;!(i=r()).done;){var a=i.value.contentRect,o=a.width,s=a.height;n.setCanvasSize(n.canvas.interface,o,s),n.setCanvasSize(n.canvas.drawing,o,s),n.setCanvasSize(n.canvas.temp,o,s),n.setCanvasSize(n.canvas.grid,o,s),n.coordSystem.documentSize={width:o,height:s},n.drawGrid(n.ctx.grid),n.drawImage(),n.loop({once:!0})}n.loadSaveData(t,!0)}finally{n.deferRedrawOnViewChange=!1}}),Y(J(n),`clampPointToDocument`,function(e){return n.props.clampLinesToDocument?{x:Math.max(Math.min(e.x,n.props.canvasWidth),0),y:Math.max(Math.min(e.y,n.props.canvasHeight),0)}:e}),Y(J(n),`redrawImage`,function(){n.image&&n.image.complete&&bt({ctx:n.ctx.grid,img:n.image})}),Y(J(n),`simulateDrawingLines`,function(e){var t=e.lines,r=e.immediate,i=0,a=r?0:n.props.loadTimeOffset;t.forEach(function(e){var t=e.points,o=e.brushColor,s=e.brushRadius;if(r){n.drawPoints({points:t,brushColor:o,brushRadius:s}),n.points=t,n.saveLine({brushColor:o,brushRadius:s});return}for(var c=function(e){i+=a,window.setTimeout(function(){n.drawPoints({points:t.slice(0,e+1),brushColor:o,brushRadius:s})},i)},l=1;l<t.length;l++)c(l);i+=a,window.setTimeout(function(){n.points=t,n.saveLine({brushColor:o,brushRadius:s})},i)})}),Y(J(n),`setCanvasSize`,function(e,t,n){e.width=t,e.height=n,e.style.width=t,e.style.height=n}),Y(J(n),`drawPoints`,function(e){var t=e.points,r=e.brushColor,i=e.brushRadius;n.ctx.temp.lineJoin=`round`,n.ctx.temp.lineCap=`round`,n.ctx.temp.strokeStyle=r,n.clearWindow(n.ctx.temp),n.ctx.temp.lineWidth=i*2;var a=t[0],o=t[1];n.ctx.temp.moveTo(o.x,o.y),n.ctx.temp.beginPath();for(var s=1,c=t.length;s<c;s++){var l=Ut(a,o);n.ctx.temp.quadraticCurveTo(a.x,a.y,l.x,l.y),a=t[s],o=t[s+1]}n.ctx.temp.lineTo(a.x,a.y),n.ctx.temp.stroke()}),Y(J(n),`saveLine`,function(e){var t=e===void 0?{}:e,r=t.brushColor,i=t.brushRadius;n.points.length<2||(n.lines.push({points:[].concat(n.points),brushColor:r||n.props.brushColor,brushRadius:i||n.props.brushRadius}),n.points.length=0,n.inClientSpace([n.ctx.drawing,n.ctx.temp],function(){n.ctx.drawing.drawImage(n.canvas.temp,0,0,n.canvas.drawing.width,n.canvas.drawing.height)}),n.clearWindow(n.ctx.temp),n.triggerOnChange())}),Y(J(n),`triggerOnChange`,function(){n.props.onChange&&n.props.onChange(J(n))}),Y(J(n),`clearWindow`,function(e){n.inClientSpace([e],function(){return e.clearRect(0,0,e.canvas.width,e.canvas.height)})}),Y(J(n),`clearExceptErasedLines`,function(){n.lines=[],n.valuesChanged=!0,n.clearWindow(n.ctx.drawing),n.clearWindow(n.ctx.temp)}),Y(J(n),`loop`,function(e){var t=(e===void 0?{}:e).once,r=t!==void 0&&t;if(n.mouseHasMoved||n.valuesChanged){var i=n.lazy.getPointerCoordinates(),a=n.lazy.getBrushCoordinates();n.drawInterface(n.ctx.interface,i,a),n.mouseHasMoved=!1,n.valuesChanged=!1}r||window.requestAnimationFrame(function(){n.loop()})}),Y(J(n),`inClientSpace`,function(e,t){e.forEach(function(e){e.save(),e.setTransform(vt.a,vt.b,vt.c,vt.d,vt.e,vt.f)});try{t()}finally{e.forEach(function(e){return e.restore()})}}),Y(J(n),`drawImage`,function(){n.props.imgSrc&&(n.image=new Image,n.image.crossOrigin=`anonymous`,n.image.onload=n.redrawImage,n.image.src=n.props.imgSrc)}),Y(J(n),`drawGrid`,function(e){if(!n.props.hideGrid){n.clearWindow(e);var t=25,r=n.coordSystem.canvasBounds,i=r.viewMin,a=r.viewMax,o=Math.floor(i.x/t-1)*t,s=Math.floor(i.y/t-1)*t,c=a.x+t,l=a.y+t;if(e.beginPath(),e.setLineDash([5,1]),e.setLineDash([]),e.strokeStyle=n.props.gridColor,e.lineWidth=n.props.gridLineWidth,!n.props.hideGridX){for(var u=o,d=n.props.gridSizeX;u<c;)u+=d,e.moveTo(u,s),e.lineTo(u,l);e.stroke()}if(!n.props.hideGridY){for(var f=s,p=n.props.gridSizeY;f<l;)f+=p,e.moveTo(o,f),e.lineTo(c,f);e.stroke()}}}),Y(J(n),`drawInterface`,function(e,t,r){n.props.hideInterface||(n.clearWindow(e),e.beginPath(),e.fillStyle=n.props.brushColor,e.arc(r.x,r.y,n.props.brushRadius,0,Math.PI*2,!0),e.fill(),e.beginPath(),e.fillStyle=n.props.catenaryColor,e.arc(t.x,t.y,4,0,Math.PI*2,!0),e.fill(),n.lazy.isEnabled()&&(e.beginPath(),e.lineWidth=2,e.lineCap=`round`,e.setLineDash([2,4]),e.strokeStyle=n.props.catenaryColor,n.catenary.drawToCanvas(n.ctx.interface,r,t,n.chainLength),e.stroke()),e.beginPath(),e.fillStyle=n.props.catenaryColor,e.arc(r.x,r.y,2,0,Math.PI*2,!0),e.fill())}),n.canvas={},n.ctx={},n.catenary=new dt.Catenary,n.points=[],n.lines=[],n.erasedLines=[],n.mouseHasMoved=!0,n.valuesChanged=!0,n.isDrawing=!1,n.isPressing=!1,n.deferRedrawOnViewChange=!1,n.interactionSM=new Tt,n.coordSystem=new yt({scaleExtents:t.zoomExtents,documentSize:{width:t.canvasWidth,height:t.canvasHeight}}),n.coordSystem.attachViewChangeListener(n.applyView.bind(J(n))),n}var n=t.prototype;return n.componentDidMount=function(){var e=this;this.lazy=new ut.LazyBrush({radius:this.props.lazyRadius*window.devicePixelRatio,enabled:!0,initialPoint:{x:window.innerWidth/2,y:window.innerHeight/2}}),this.chainLength=this.props.lazyRadius*window.devicePixelRatio,this.canvasObserver=new Fe(function(t,n){return e.handleCanvasResize(t,n)}),this.canvasObserver.observe(this.canvasContainer),this.drawImage(),this.loop(),window.setTimeout(function(){var t=window.innerWidth/2,n=window.innerHeight/2;e.lazy.update({x:t-e.chainLength/4,y:n},{both:!0}),e.lazy.update({x:t+e.chainLength/4,y:n},{both:!1}),e.mouseHasMoved=!0,e.valuesChanged=!0,e.clearExceptErasedLines(),e.props.saveData&&e.loadSaveData(e.props.saveData)},100),this.canvas.interface&&this.canvas.interface.addEventListener(`wheel`,this.handleWheel,Lt())},n.componentDidUpdate=function(e){e.lazyRadius!==this.props.lazyRadius&&(this.chainLength=this.props.lazyRadius*window.devicePixelRatio,this.lazy.setRadius(this.props.lazyRadius*window.devicePixelRatio)),e.saveData!==this.props.saveData&&this.loadSaveData(this.props.saveData),JSON.stringify(e)!==JSON.stringify(this.props)&&(this.valuesChanged=!0),this.coordSystem.scaleExtents=this.props.zoomExtents,this.props.enablePanAndZoom||this.coordSystem.resetView(),e.imgSrc!==this.props.imgSrc&&this.drawImage()},n.render=function(){var e=this;return H.createElement(`div`,{className:this.props.className,style:Vt({display:`block`,background:this.props.backgroundColor,touchAction:`none`,width:this.props.canvasWidth,height:this.props.canvasHeight},this.props.style),ref:function(t){t&&(e.canvasContainer=t)}},Gt.map(function(t){var n=t===`interface`;return H.createElement(`canvas`,{key:t,ref:function(r){r&&(e.canvas[t]=r,e.ctx[t]=r.getContext(`2d`),n&&(e.coordSystem.canvas=r))},style:Vt({},Wt),onMouseDown:n?e.handleDrawStart:void 0,onMouseMove:n?e.handleDrawMove:void 0,onMouseUp:n?e.handleDrawEnd:void 0,onMouseOut:n?e.handleDrawEnd:void 0,onTouchStart:n?e.handleDrawStart:void 0,onTouchMove:n?e.handleDrawMove:void 0,onTouchEnd:n?e.handleDrawEnd:void 0,onTouchCancel:n?e.handleDrawEnd:void 0})}))},t}(H.PureComponent);Y(Kt,`defaultProps`,{onChange:null,loadTimeOffset:5,lazyRadius:12,brushRadius:10,brushColor:`#444`,catenaryColor:`#0a0302`,gridColor:`rgba(150,150,150,0.17)`,backgroundColor:`#FFF`,hideGrid:!1,canvasWidth:400,canvasHeight:400,disabled:!1,imgSrc:``,saveData:``,immediateLoading:!1,hideInterface:!1,gridSizeX:25,gridSizeY:25,gridLineWidth:.5,hideGridX:!1,hideGridY:!1,enablePanAndZoom:!1,mouseZoomFactor:.01,zoomExtents:{min:.33,max:3},clampLinesToDocument:!1}),Kt.propTypes={};function qt(e){return(0,U.jsx)(`svg`,{...e,children:(0,U.jsx)(`path`,{fill:`currentColor`,d:`M12.052 5.107a2.07 2.07 0 0 1 2.924 0l4.903 4.903a2.067 2.067 0 0 1 0 2.924l-6.176 6.176H20a.5.5 0 1 1 0 1h-8a1 1 0 0 1-.07-.005H8.74c-.322 0-.63-.128-.857-.355l-3.774-3.774a2.067 2.067 0 0 1 0-2.924zm2.22.705a1.07 1.07 0 0 0-1.515 0L7.99 10.577l6.418 6.418 4.765-4.765a1.07 1.07 0 0 0 0-1.515zm-9.46 7.944a1.07 1.07 0 0 0 0 1.515l3.774 3.775c.04.04.096.063.153.063h3.556l1.407-1.407-6.418-6.418z`})})}function Jt(e){return(0,U.jsx)(`svg`,{...e,children:(0,U.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,d:`M18 17.853a.6.6 0 0 0 .6-.6V15a5.1 5.1 0 0 0-5.1-5.1l-6.05.001 2.724-2.724a.6.6 0 0 0-.848-.848l-3.73 3.728a.6.6 0 0 0-.175.284q-.001.012-.004.022a1 1 0 0 0-.014.073l-.002.036-.001.028v.027l.004.047L5.4 10.5a.6.6 0 0 0 .026.179l.013.033q.01.03.023.057l.015.025a.6.6 0 0 0 .099.133l3.75 3.75a.6.6 0 0 0 .848-.848L7.445 11.1H13.5a3.9 3.9 0 0 1 3.9 3.9v2.253a.6.6 0 0 0 .6.6`,clipRule:`evenodd`})})}function Yt(e){return(0,U.jsx)(`svg`,{...e,children:(0,U.jsx)(`path`,{fill:`currentColor`,d:`M2 12a4 4 0 0 1 4-4h12a4 4 0 0 1 0 8H6a4 4 0 0 1-4-4`})})}function Xt(e){return(0,U.jsx)(`svg`,{...e,children:(0,U.jsx)(`path`,{fill:`currentColor`,d:`M3 12a2 2 0 0 1 2-2h14a2 2 0 1 1 0 4H5a2 2 0 0 1-2-2`})})}function Zt(e){return(0,U.jsx)(`svg`,{...e,children:(0,U.jsx)(`path`,{fill:`currentColor`,d:`M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1`})})}var Qt={colourButton:`_colourButton_ibsa6_1`,colourButtonSelected:`_colourButtonSelected_ibsa6_7`,canvasDrawContainer:`_canvasDrawContainer_ibsa6_11`,strokeButtonContainer:`_strokeButtonContainer_ibsa6_14`,strokeButton:`_strokeButton_ibsa6_14`,selectedButton:`_selectedButton_ibsa6_31`},$t=function(e){return e.Black=`#000000`,e.Red=`#D9584F`,e.Orange=`#F8981D`,e.Yellow=`#FFCD52`,e.Green=`#5DC786`,e.Blue=`#38A2E8`,e.Purple=`#7A76E8`,e.Grey=`#979797`,e.White=`#FFFFFF`,e}($t||{}),en=H.forwardRef(({mobile:e},t)=>{let n=H.useRef(null);H.useImperativeHandle(t,()=>n.current,[n.current]);let r=H.useRef(null),[[i,a],o]=H.useState([0,0]),[s,c]=H.useState(`#000000`),[l,u]=H.useState(2),[d,f]=H.useState(!1),[p,m]=H.useState(`#000000`);function h(){if(!r.current)return;let e=r.current.getBoundingClientRect(),t=e.width,n=e.width*.5625;o([Math.max(t,150),Math.max(n,75)])}H.useLayoutEffect(()=>{if(!r.current)return;let e=new ResizeObserver(h);return e.observe(r.current),()=>e.disconnect()},[r.current]);function g(){if(d){c(p),f(!1);return}m(s),c(`#FFFFFF`),f(!0)}function _(){d&&(c(p),f(!1))}function v(e){c(e),m(s),f(!1)}function y(){re.render((0,U.jsx)(`p`,{children:`Are you sure you want to discard your drawing?`}),{title:`Discard your drawing?`,submitButtonProps:{onClick:()=>n.current?.clear(),variant:`danger`,text:`Discard`},cancelButtonProps:{variant:`link`,text:`Cancel`}})}return(0,U.jsx)(`section`,{children:(0,U.jsxs)(`div`,{className:`d-flex align-items-start`,children:[(0,U.jsxs)(`div`,{className:`d-flex flex-lg-column`,children:[(0,U.jsx)(`ul`,{className:`me-3-lg me-2 list-unstyled`,children:Object.entries($t).slice(0,4).map(([e,t],n)=>(0,U.jsx)(`li`,{children:(0,U.jsx)(A,{className:`${Qt.colourButton} ${s===t?Qt.colourButtonSelected:``} rounded-circle`,style:{backgroundColor:t},onClick:()=>v(t),"aria-label":`Select the colour: ${e}`,children:`\xA0`})},n))}),(0,U.jsx)(`ul`,{className:`me-3-lg me-2 list-unstyled`,children:Object.entries($t).slice(4).map(([e,t],n)=>(0,U.jsx)(`li`,{children:(0,U.jsx)(A,{className:`${Qt.colourButton} ${s===t?Qt.colourButtonSelected:``} rounded-circle`,style:{backgroundColor:t},onClick:()=>v(t),"aria-label":`Select the colour: ${e}`,children:`\xA0`})},n))})]}),(0,U.jsx)(`div`,{className:`flex-grow-1 position-relative`,ref:r,children:(0,U.jsx)(`div`,{className:Qt.canvasDrawContainer,children:i&&(0,U.jsx)(Kt,{canvasHeight:a,canvasWidth:i,brushRadius:l,lazyRadius:e?0:10,hideGrid:!0,brushColor:s,className:`position-absolute top-0 left-0 border`,ref:n})})}),(0,U.jsxs)(`div`,{className:`d-flex flex-column align-self-stretch ms-2`,children:[(0,U.jsxs)(`div`,{className:`d-flex flex-column gap-2 flex-grow-1`,children:[(0,U.jsxs)(`ul`,{className:`d-lg-flex flex-column gap-2 list-unstyled d-none`,children:[(0,U.jsx)(et,{svg:be,className:`btn btn-outline-dark ${d?``:Qt.selectedButton}`,onClick:_,"aria-label":`Pen`}),(0,U.jsx)(et,{svg:qt,className:`btn btn-outline-dark mb-2 ${d?Qt.selectedButton:``}`,onClick:g,"aria-label":`Eraser`})]}),(0,U.jsxs)(`ul`,{className:`d-flex flex-column mb-2 list-unstyled`,children:[(0,U.jsx)(`li`,{className:Qt.strokeButtonContainer,children:(0,U.jsx)(et,{svg:Zt,className:`btn btn-outline-dark ${l===2?Qt.selectedButton:``} ${Qt.strokeButton}`,onClick:()=>u(2),style:{color:s===`#FFFFFF`?`#000000`:s},"aria-label":`Small stroke`})}),(0,U.jsx)(`li`,{className:Qt.strokeButtonContainer,children:(0,U.jsx)(et,{svg:Xt,className:`btn btn-outline-dark ${l===4?Qt.selectedButton:``} ${Qt.strokeButton}`,onClick:()=>u(4),style:{color:s===`#FFFFFF`?`#000000`:s},"aria-label":`Medium stroke`})}),(0,U.jsx)(`li`,{className:Qt.strokeButtonContainer,children:(0,U.jsx)(et,{svg:Yt,className:`btn btn-outline-dark ${l===8?Qt.selectedButton:``} ${Qt.strokeButton}`,onClick:()=>u(8),style:{color:s===`#FFFFFF`?`#000000`:s},"aria-label":`Large stroke`})})]})]}),(0,U.jsxs)(`ul`,{className:`d-flex flex-column gap-lg-2 list-unstyled`,children:[(0,U.jsx)(`li`,{children:(0,U.jsx)(et,{svg:Jt,className:`btn btn-outline-dark`,onClick:(()=>n.current.undo()),"aria-label":`Undo`})}),(0,U.jsx)(`li`,{children:(0,U.jsx)(et,{svg:ne,onClick:y,className:`btn btn-outline-danger d-lg-block d-none ${Qt.myRight}`,"aria-label":`Clear canvas`})})]})]})]})})}),tn={icon:`_icon_1dgfx_1`,canvasContainer:`_canvasContainer_1dgfx_5`,overlay:`_overlay_1dgfx_8`,rotateIcon:`_rotateIcon_1dgfx_16`,rotateText:`_rotateText_1dgfx_20`};function nn(e){let t=H.useRef(null),[n,r]=H.useState(!1),[i,a]=H.useState(e.player?.isFullscreen()??!1),{bgClassName:o,Svg:s}=Te.getTypeInfo(e.interaction.typeId);H.useEffect(()=>{if(!e.player)return;let t=()=>{let t=e.player.isFullscreen();a(t)};return e.player.on(`fullscreenchange`,t),()=>{e.player.off(`fullscreenchange`,t)}},[e.player]);function c(){t.current&&e.onSave(t.current.getDataURL(`image/png`))}function l(){i?r(!0):re.render((0,U.jsx)(`p`,{children:`Are you sure you want to discard your drawing?`}),{title:`Discard your drawing?`,submitButtonProps:{onClick:e.onCancel,variant:`danger`,text:`Discard`},cancelButtonProps:{variant:`link`,text:`Cancel`}})}function u(){r(!1),e.onCancel()}return(0,U.jsx)(Ue,{className:`h-100`,children:(0,U.jsxs)(`section`,{className:`d-flex flex-column h-100`,children:[(0,U.jsxs)(`div`,{className:`text-center text-body d-flex justify-content-between align-items-center p-2`,children:[(0,U.jsxs)(`div`,{className:`d-flex align-items-center`,children:[(0,U.jsx)(`span`,{className:`${tn.icon} me-3 rounded my-1 text-white align-middle d-inline-block ${o}`,children:(0,U.jsx)(s,{})}),(0,U.jsx)(`span`,{className:`text-start flex-grow-1`,children:(0,U.jsx)(`h2`,{className:`h6 mb-0`,children:(0,U.jsx)(`strong`,{children:e.interaction.name})})})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(A,{className:`btn btn-link`,onClick:l,children:`Cancel`}),(0,U.jsx)(A,{className:`btn btn-dark ms-2`,onClick:c,children:`Save`})]})]}),(0,U.jsx)(`div`,{className:`cv-timepoint bg-gray-100 flex-grow-1 rounded-bottom`,children:(0,U.jsx)(`div`,{className:`cv-timepoint-padding h-100`,children:(0,U.jsx)(`div`,{className:`cv-interactive-question`,children:(0,U.jsx)(`div`,{className:`mx-auto ${tn.canvasContainer}`,children:(0,U.jsx)(en,{ref:t,mobile:e.mobile})})})})}),n&&(0,U.jsx)(`div`,{className:`d-flex justify-content-center align-items-center ${tn.overlay}`,onClick:()=>r(!1),children:(0,U.jsx)(`div`,{className:`modal-dialog bg-white text-dark rounded shadow opacity-100`,onClick:e=>e.stopPropagation(),children:(0,U.jsxs)(`div`,{className:`modal-content`,children:[(0,U.jsxs)(`div`,{className:`modal-header border-bottom`,children:[(0,U.jsx)(`h2`,{className:`modal-title p-3 text-dark h4`,children:`Discard your drawing?`}),(0,U.jsx)(`button`,{type:`button`,className:`btn-close`,"aria-label":`Close`,onClick:()=>r(!1)})]}),(0,U.jsx)(`div`,{className:`modal-body border-bottom p-3 `,children:(0,U.jsx)(`p`,{children:`Are you sure you want to discard your drawing?`})}),(0,U.jsxs)(`div`,{className:`modal-footer p-3`,children:[(0,U.jsx)(A,{className:`btn btn-link`,onClick:()=>r(!1),children:`Cancel`}),(0,U.jsx)(A,{className:`btn btn-danger`,onClick:u,children:`Discard`})]})]})})}),e.showLandscapeReminder&&(0,U.jsxs)(`div`,{className:`text-white text-center d-flex flex-column justify-content-center align-items-center ${tn.overlay}`,children:[(0,U.jsx)(nt,{className:`${tn.rotateIcon} mb-3`}),(0,U.jsx)(`p`,{className:`fw-semibold ${tn.rotateText}`,children:`Rotate your screen to continue`})]})]})})}function rn(e){let{error:t}=e;return e.error?(0,U.jsx)(`p`,{className:`mt-2 small text-danger`,children:t}):(0,U.jsx)(U.Fragment,{})}function an(){return screen.orientation?.type?screen.orientation.type.startsWith(`landscape`):window.innerWidth>window.innerHeight}function on(e){let t=()=>{e(an())};return screen.orientation?(screen.orientation.addEventListener(`change`,t),()=>screen.orientation.removeEventListener(`change`,t)):(window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t))}var sn=768;function cn(){let[e,t]=H.useState(()=>window.innerWidth<=sn);return me(H.useCallback(()=>{t(window.innerWidth<=sn)},[])),e}function ln(e){let{player:t,mobile:n}=e,[r,i]=H.useState(!1),[a,o]=H.useState(()=>an()),s=H.useRef(!1),c=cn(),l=r&&c&&!a&&!n,u=H.useCallback(()=>{t&&(s.current=!0,t.requestFullscreen())},[t]),d=H.useCallback(()=>{s.current&&t&&(t.exitFullscreen(),s.current=!1)},[t]);return H.useEffect(()=>on(e=>{o(e)}),[]),H.useEffect(()=>{if(!r||!t)return;let e=()=>{!t.isFullscreen()&&s.current&&(s.current=!1,i(!1))};return t.on(`fullscreenchange`,e),()=>{t.off(`fullscreenchange`,e)}},[r,t]),H.useEffect(()=>{!r||!t||n||c&&!t.isFullscreen()&&u()},[c,r,t,n,u]),{showCanvas:r,showLandscapeReminder:l,openCanvas:H.useCallback(()=>{i(!0),!n&&c&&t&&!t.isFullscreen()&&u()},[c,t,n,u]),closeCanvas:H.useCallback(()=>{d(),i(!1)},[d])}}var un=`data:image/png;base64,`;function dn(e){return Object.keys(e).filter(t=>!!e[t]?.trim()).length?null:`Please submit an illustration`}async function fn(e,t,n,r){let i=e[t.actionableItems[0].id]||``;if(i.startsWith(un)){let e=i.replace(un,``);i=(Oe.hasToken(`gateway`)?await Oe.post(`${r.imageApi}v2/illustrations/base64`,`"${e}"`,{tokenName:`gateway`}):await Oe.post(`/api/image/illustrations`,`"${e}"`)).location}let a=Object.keys(e).map(e=>({actionableItemId:e,value:i}));return await n(t.id,a),{[t.actionableItems[0].id]:i}}function pn(e){let{interaction:t,state:n,fullWidthPortalNode:r,setState:a,player:o,mobile:s}=e,c=n[t.actionableItems[0].id],{showCanvas:l,showLandscapeReminder:u,openCanvas:d,closeCanvas:f}=ln({player:o,mobile:s});function p(r){a({...n,[t.actionableItems[0].id]:r}),f(),e.recalculateScroll()}function m(){f()}return(0,U.jsxs)(`div`,{className:`cv-interactive-question`,children:[(0,U.jsx)(`p`,{className:`h4 mb-3`,children:t.name}),c?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`h2`,{className:`h4`,children:`My drawing:`}),(0,U.jsx)(`img`,{className:`img-fluid border rounded mb-2`,src:c,alt:`Illustration`}),!n.submitted&&(0,U.jsxs)(A,{className:`btn btn-outline-dark text-danger border-danger`,onClick:d,children:[(0,U.jsx)(i,{svg:ne,className:`svg-container me-1`}),`Discard drawing`]})]}):(0,U.jsx)(A,{className:`btn btn-outline-dark`,onClick:d,children:`Draw my answer`}),(0,U.jsx)(rn,{error:n.error}),l&&(0,U.jsx)(z,{node:r,children:(0,U.jsx)(nn,{interaction:t,onSave:p,onCancel:m,player:o,showLandscapeReminder:u,mobile:s})})]})}function mn(e){let{interaction:t,recalculateScroll:n}=e,r=H.useCallback(e=>{e&&(e.onload=()=>{n()})},[]);return(0,U.jsx)(`div`,{className:`cv-interactive-question cv-image-interactive`,children:(0,U.jsxs)(`div`,{className:`cv-image-container text-center`,children:[(0,U.jsx)(`img`,{className:`img-fluid rounded`,src:t.data.url,ref:r}),t.data.caption&&(0,U.jsx)(U.Fragment,{children:(0,U.jsx)(`p`,{className:`mt-3 h4`,children:t.data.caption})})]})})}var hn=45,gn=`cv-missing-word-`,_n=`20pt arial`;function vn(e){let t=document.createElement(`canvas`).getContext(`2d`);return t.font=_n,t.measureText(e).width}function X(e,t){return Re.isMissingWordCorrect(t,t=>e[t])}function yn(e,t){let n=Object.keys(e).filter(t=>!!e[t]?.trim()).length;return n?n===t.actionableItems.length?null:`Please fill in all of the blanks`:`Please fill in the blanks`}var bn=(e,t,n)=>n(t.id,Object.keys(e).map(t=>({actionableItemId:t,value:e[t].toString()})));function xn(e){let{state:t,setState:n,interaction:r,showFeedback:i}=e,a=r.data.sentence.replace(/{([^{}]*)}/g,(e,t)=>`{${gn}${t}}`).split(/{([^{}]*)}/g);function o(e,r){if(r.stopPropagation(),!r.target.value){let{[e.id]:r,...i}=t;n(i,!0);return}n({[e.id]:r.target.value})}return(0,U.jsxs)(`div`,{className:`cv-interactive-question`,children:[(0,U.jsx)(`div`,{className:`mb-2 h4`,children:a.map((e,n)=>{if(!e.startsWith(gn))return e;let a=e.replace(gn,``),s=r.actionableItems.find(e=>e.order.toString()===a);if(!s)return;let c=t[s.id]||``,l=vn(s.name);if(i){let e=s.name.toLowerCase().toString()===t[s.id]?.toLowerCase().toString();return(0,U.jsxs)(H.Fragment,{children:[!e&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`del`,{className:`text-danger`,children:c}),`\xA0`]}),(0,U.jsx)(`span`,{className:`text-success`,children:s.name})]},n)}return(0,U.jsx)(`span`,{className:`cv-missing-word-input-container`,children:(0,U.jsx)(`input`,{style:{width:l/16+`rem`},onChange:e=>o(s,e),value:c,maxLength:hn,disabled:!!t.submitted,className:`cv-missing-word-input`,autoComplete:`off`})},n)})}),(0,U.jsx)(rn,{error:t.error})]})}function Sn(e,t){return Re.isMultipleChoiceCorrect(t,t=>e[t])}function Cn(e){return Object.keys(e).length?null:`Please choose an answer`}var wn=(e,t,n)=>n(t.id,Object.keys(e).map(e=>({actionableItemId:e,value:t.actionableItems.find(t=>t.id?.toString()===e?.toString())?.name})));function Tn(e){let{state:t,setState:n,interaction:r,showFeedback:a,imageApi:o,currentUser:s}=e,c=r.actionableItems.filter(e=>e.isCorrect).length===1;function l(e,r){if(!t.submitted){if(c){n(r?{[e.id]:e.id}:{},!0);return}if(!r){let{[e.id]:r,...i}=t;n(i,!0);return}n({[e.id]:e.id})}}return(0,U.jsxs)(`div`,{className:`cv-interactive-question`,children:[(0,U.jsx)(`p`,{className:`h4`,children:r.name}),!c&&(0,U.jsxs)(`div`,{className:`rounded bg-light-blue p-2 mb-2 text-small`,children:[(0,U.jsx)(i,{svg:ye,className:`d-inline-block svg-container sm align-text-bottom me-1`}),(0,U.jsxs)(`small`,{children:[(0,U.jsx)(`strong`,{children:`Multi-select: `}),`This question has multiple correct answers`]})]}),(0,U.jsx)(He,{interaction:r,showFeedback:a,onSelectAnswer:l,getSelectedAnswer:e=>t[e],imageApi:o.toString(),userInitials:S.getInitials(s.givenName,s.familyName),userAvatar:s.avatar,leftHandSidePortalNode:e.leftHandSidePortalNode,submitted:!!t.submitted}),(0,U.jsx)(rn,{error:t.error})]})}var En=H.useLayoutEffect,Dn=function(e){var t=H.useRef(e);return En(function(){t.current=e}),t},On=function(e,t){if(typeof e==`function`){e(t);return}e.current=t},kn=function(e,t){var n=H.useRef();return H.useCallback(function(r){e.current=r,n.current&&On(n.current,null),n.current=t,t&&On(t,r)},[t])},An={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`},jn=function(e){Object.keys(An).forEach(function(t){e.style.setProperty(t,An[t],`important`)})},Z=null,Mn=function(e,t){var n=e.scrollHeight;return t.sizingStyle.boxSizing===`border-box`?n+t.borderSize:n-t.paddingSize};function Nn(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),Z||(Z=document.createElement(`textarea`),Z.setAttribute(`tab-index`,`-1`),Z.setAttribute(`aria-hidden`,`true`),jn(Z)),Z.parentNode===null&&document.body.appendChild(Z);var i=e.paddingSize,a=e.borderSize,o=e.sizingStyle,s=o.boxSizing;Object.keys(o).forEach(function(e){var t=e;Z.style[t]=o[t]}),jn(Z),Z.value=t;var c=Mn(Z,e);Z.value=`x`;var l=Z.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);var d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}var Pn=function(){},Fn=function(e,t){return e.reduce(function(e,n){return e[n]=t[n],e},{})},In=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`],Ln=!!document.documentElement.currentStyle,Rn=function(e){var t=window.getComputedStyle(e);if(t===null)return null;var n=Fn(In,t),r=n.boxSizing;return r===``?null:(Ln&&r===`border-box`&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+`px`),{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)})},zn=function(e){var t=Dn(e);(0,H.useLayoutEffect)(function(){var e=function(e){t.current(e)};return window.addEventListener(`resize`,e),function(){window.removeEventListener(`resize`,e)}},[])},Bn=(0,H.forwardRef)(function(e,t){var n=e.cacheMeasurements,r=e.maxRows,i=e.minRows,a=e.onChange,o=a===void 0?Pn:a,s=e.onHeightChange,c=s===void 0?Pn:s,l=d(e,[`cacheMeasurements`,`maxRows`,`minRows`,`onChange`,`onHeightChange`]),u=l.value!==void 0,p=(0,H.useRef)(null),m=kn(p,t),h=(0,H.useRef)(0),g=(0,H.useRef)(),_=function(){var e=p.current,t=n&&g.current?g.current:Rn(e);if(t){g.current=t;var a=Nn(t,e.value||e.placeholder||`x`,i,r),o=a[0],s=a[1];h.current!==o&&(h.current=o,e.style.setProperty(`height`,o+`px`,`important`),c(o,{rowHeight:s}))}};return(0,H.useLayoutEffect)(_),zn(_),(0,H.createElement)(`textarea`,f({},l,{onChange:function(e){u||_(),o(e)},ref:m}))}),Vn=4e3;function Hn(e){return!!e.data.suggestedResponse}function Un(e,t){return Object.keys(e).filter(t=>!!e[t]?.trim()).length?e[t.actionableItems[0].id]?.length>Vn?`Max answer length is ${Vn} characters`:null:`Please provide an answer to the question`}var Wn=(e,t,n)=>n(t.id,Object.keys(e).map(t=>({actionableItemId:t,value:e[t].toString()})));function Gn(e){let{interaction:t,state:n,setState:r,showFeedback:i}=e;function a(e){r({...n,[t.actionableItems[0].id]:e.target.value})}return i?(0,U.jsxs)(`div`,{className:`cv-interactive-question`,children:[(0,U.jsx)(`p`,{className:`h4`,children:t.name}),(0,U.jsx)(`label`,{className:`h4 fw-bold`,children:`My answer`}),(0,U.jsx)(`p`,{className:`h4`,children:n[t.actionableItems[0].id]}),t.data.suggestedResponse&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`label`,{className:`h4 fw-bold`,children:`Teacher's suggested answer`}),(0,U.jsx)(`p`,{className:`h4`,children:t.data.suggestedResponse})]})]}):(0,U.jsxs)(`div`,{className:`cv-interactive-question`,children:[(0,U.jsx)(`p`,{className:`h4`,children:t.name}),(0,U.jsx)(Bn,{id:`short-answer-answer`,className:`form-control mt-2`,minRows:3,value:n[t.actionableItems[0].id]||``,onChange:a,disabled:!!n.submitted}),(0,U.jsx)(rn,{error:n.error})]})}function Kn(e,t){return t.actionableItems.filter(e=>e.isCorrect).every(t=>e[t.id]===t.name)?Ie.Correct:Ie.Incorrect}function qn(e){return Object.keys(e).length?null:`Please choose an answer`}var Jn=(e,t,n)=>n(t.id,Object.keys(e).map(t=>({actionableItemId:t,value:e[t]})));function Yn(e){let{state:t,setState:n,interaction:r,showFeedback:i,imageApi:a,currentUser:o}=e,s=r.actionableItems.find(e=>e.isCorrect);function c(e){t.submitted||n({[e.id]:e.name},!0)}return(0,U.jsxs)(`div`,{className:`cv-interactive-question`,children:[(0,U.jsx)(`p`,{className:`h4`,children:r.name}),(0,U.jsx)(Ve,{className:`justify-content-center`,interaction:r,showFeedback:i,onSelectAnswer:c,getSelectedAnswer:e=>t[e],imageApi:a.toString(),userInitials:S.getInitials(o.givenName,o.familyName),userAvatar:o.avatar}),i&&(0,U.jsxs)(`div`,{className:`text-center px-5 mt-3`,children:[(0,U.jsxs)(`p`,{className:`h4`,children:[`The answer is `,(0,U.jsx)(`strong`,{children:s.name})]}),r.data.feedback&&(0,U.jsx)(`p`,{className:`h4`,children:r.data.feedback})]}),(0,U.jsx)(rn,{error:t.error})]})}var Xn=()=>!0,Zn=()=>!1,Qn={[b.Annotation]:Zn,[b.Image]:Zn,[b.MissingWord]:Xn,[b.MultipleChoice]:Xn,[b.ShortAnswer]:Hn,[b.TrueOrFalse]:Xn,[b.Illustration]:Zn};function $n(e){return Qn[e]}var er={[b.Annotation]:G,[b.Image]:mn,[b.MissingWord]:xn,[b.MultipleChoice]:Tn,[b.ShortAnswer]:Gn,[b.TrueOrFalse]:Yn,[b.Illustration]:pn};function tr(e){return er[e]}function nr(){return``}var rr={[b.Annotation]:nr,[b.Image]:nr,[b.MissingWord]:yn,[b.MultipleChoice]:Cn,[b.ShortAnswer]:Un,[b.TrueOrFalse]:qn,[b.Illustration]:dn};function ir(e){return rr[e]}var ar={[b.Annotation]:null,[b.Image]:null,[b.MissingWord]:bn,[b.MultipleChoice]:wn,[b.ShortAnswer]:Wn,[b.TrueOrFalse]:Jn,[b.Illustration]:fn};function or(e){return ar[e]}var sr={[b.Annotation]:Re.notApplicable,[b.Image]:Re.notApplicable,[b.MissingWord]:X,[b.MultipleChoice]:Sn,[b.ShortAnswer]:Re.awaitingMarking,[b.TrueOrFalse]:Kn,[b.Illustration]:Re.awaitingMarking};function cr(e){return sr[e]}var lr={feedback:`_feedback_194my_1`};function ur(e){let{studentResults:t,interaction:n,timepoint:r,interactive:a,state:o,goToTimepoint:s,interactionNumber:c,imageCdnUrl:l}=e,u=ze(t),d=Be(n.id,u),f=o.interactions[n.id],p=cr(n.typeId)(f||{},n),m=n.typeId!==b.Annotation&&n.typeId!==b.Image,h=m;n.typeId===b.MissingWord&&d&&(h=!1);let g=n.data.suggestedResponse||n.data.feedback;return(0,U.jsxs)(`li`,{className:`mb-3 position-relative`,children:[(0,U.jsxs)(`div`,{className:`d-flex flex-wrap mb-2 cursor-pointer`,onClick:()=>s(r.id,n.id),children:[a.immediateFeedback&&(0,U.jsx)(`div`,{className:lr.feedback,children:d?p===Ie.AwaitingMarking?(0,U.jsx)(`span`,{className:`text-secondary fst-italic`,children:`Waiting to be marked`}):p===Ie.Correct?(0,U.jsxs)(`span`,{className:`text-success`,children:[`Correct\xA0`,(0,U.jsx)(i,{className:`svg-container align-middle`,svg:he})]}):p===Ie.Incorrect&&(0,U.jsxs)(`span`,{className:`text-danger`,children:[`Incorrect\xA0`,(0,U.jsx)(i,{className:`svg-container align-middle`,svg:de})]}):!1}),(0,U.jsx)(Ee,{interaction:n,iconClassName:`flex-shrink-0`,showQuestion:h,showTypeName:!0,questionClassName:`d-block w-100 mt-2`,questionNumber:c})]}),m&&!d&&(0,U.jsx)(`button`,{className:`btn btn-dark`,onClick:()=>s(r.id,n.id),children:`Answer question`}),d&&m&&(0,U.jsx)(We,{interaction:n,studentResults:t,markedStatus:Le.PendingReview,markInteraction:()=>{},imageCdnUrl:l,showFeedback:a.immediateFeedback,showAvatar:!0}),a.immediateFeedback&&d&&g&&(0,U.jsxs)(`div`,{className:`bg-light rounded p-2`,children:[(0,U.jsx)(`div`,{children:(0,U.jsx)(`strong`,{children:n.typeId===b.TrueOrFalse?`Teacher's feedback`:`Teacher's suggested response`})}),g]})]})}var dr={interaction:`_interaction_xq854_1`};function fr(e){let{interactive:t,duration:n}=e;function r(t,n,r){r.stopPropagation(),e.goToTimepoint(t,n)}return n?(0,U.jsx)(U.Fragment,{children:t.timepoints.map((e,t)=>{if(!e.interactions.length)return(0,U.jsx)(U.Fragment,{});let{bgClassName:i}=Te.getTypeInfo(e.interactions[0].typeId),a=e.visibleAt/1e3/n*100;return(0,U.jsx)(`span`,{className:`${dr.interaction} ${i}`,style:{left:`${a}%`},onClick:t=>r(e.id,e.interactions[0].id,t)},t)})}):(0,U.jsx)(U.Fragment,{})}var pr={progress:`_progress_1b6iz_1`};function mr(e){let{duration:t,progress:n,player:r}=e,[,i]=H.useState(n.length),a=[];if(n.length){let e=n[0];a.push(e),n.forEach((t,n)=>{if(n!==0){if(e.end.time+1>t.start.time&&e.start.time<t.start.time){e.end=t.end;return}e=t,a.push(e)}})}return H.useEffect(()=>{let e=()=>{i(n.length)};return r.on(`progressflush`,e),()=>r.off(`progressflush`,e)},[]),(0,U.jsx)(U.Fragment,{children:a.map((e,n)=>{let r=e.start.time/t*100,i=(1-e.end.time/t)*100;return(0,U.jsx)(`span`,{className:pr.progress,style:{left:`${r}%`,right:`${i}%`}},n)})})}function hr(e){return!!e?.toString().startsWith(`new_`)}function gr(e){let{error:t,hasChanges:n,submitted:r,spinner:i,...a}=e;return a}var _r=e=>{let{interactive:t,state:n}=e,r=0,i=0,a=0,o=!1,s=[];return t.timepoints.forEach(e=>{e.interactions.forEach(e=>{let t=n.interactions[e.id],c=cr(e.typeId)(t||{},e);c===Ie.Correct&&r++,c!==Ie.NotApplicable&&i++,c!==Ie.NotApplicable&&t?.submitted&&a++,c===Ie.AwaitingMarking&&(o=!0);let l=gr(t||{}),u=Object.keys(l).map(e=>({id:e,text:l[e]?.toString()}));u.length&&s.push({id:e.id,answeredAt:1,answers:u})})}),{correctCount:r,total:i,answered:a,studentAttempts:s,awaitingMarking:o}},vr={bar:`_bar_il6gz_1`};function yr(e){let{showSummary:t,setShowSummary:n,state:r,interactive:i,player:a,progress:o,portalNode:s}=e,c=H.useRef(null),[l,u]=H.useState(!1);function d(){n(!1),a.show(),a.play()}function f(t,n){d(),e.goToTimepoint(t,n)}function p(){d(),a.ended()&&a.currentTime(0)}function m(e){if(!c.current)return;let t=c.current.getBoundingClientRect(),n=(e.pageX-t.left)/t.width*w;d(),a.currentTime(n)}function h(){u(!0),a.gradePassbackPlugin().submit(g/_,!b)}if(!s||!t)return(0,U.jsx)(U.Fragment,{});let{correctCount:g,total:_,answered:v,studentAttempts:y,awaitingMarking:b}=_r({interactive:i,state:r}),x={user:{name:e.currentUser.givenName,surname:e.currentUser.familyName,avatar:{url:e.currentUser.avatar}},results:[{id:i.id,attempts:y}]},S=0,C=a.ended(),w=a.duration();return(0,U.jsxs)(z,{node:s,children:[(0,U.jsxs)(`div`,{className:`row pb-3`,children:[(0,U.jsx)(`div`,{className:`col-4 col-xs-12`,children:(0,U.jsx)(fe,{data:a.poster(),imageType:E.Thumbnails,imageOptions:{size:T.Medium}})}),(0,U.jsxs)(`div`,{className:`col-8 col-xs-12`,children:[(0,U.jsxs)(`span`,{className:`float-end`,children:[(0,U.jsx)(N,{svg:pe,className:`btn btn-outline-dark`,onClick:p,children:C?`Play again`:`Continue watching`}),a.gradePassbackPlugin().enabled&&(l?(0,U.jsx)(A,{className:`btn btn-dark ms-2`,onClick:()=>{},children:(0,U.jsx)(M,{as:`span`,animation:`border`,role:`status`,size:`sm`})}):(0,U.jsx)(N,{svg:he,className:`btn btn-dark ms-2`,onClick:h,children:`Submit`}))]}),(0,U.jsx)(`h1`,{className:`h3`,children:e.title}),(0,U.jsx)(`p`,{})]})]}),(0,U.jsx)(`div`,{className:`border rounder px-2 mb-3`,children:(0,U.jsxs)(`div`,{className:`cursor-pointer my-4 ${vr.bar}`,onClick:m,ref:c,children:[(0,U.jsx)(mr,{duration:w,progress:o,interactive:i,player:a}),(0,U.jsx)(fr,{duration:w,interactive:i,goToTimepoint:f})]})}),(0,U.jsx)(`h2`,{className:`h4`,children:`My Answers`}),(0,U.jsx)(`div`,{className:`d-flex justify-content-between`,children:(0,U.jsxs)(`span`,{children:[i.immediateFeedback&&(0,U.jsxs)(`div`,{children:[`Score: `,g,`/`,_]}),(0,U.jsxs)(`div`,{className:`mb-3`,children:[`You have answered\xA0`,(0,U.jsx)(`strong`,{className:v===_?``:`text-danger`,children:v}),`\xA0of `,(0,U.jsx)(`strong`,{children:_}),` questions`]})]})}),(0,U.jsx)(`div`,{className:`row`,children:(0,U.jsx)(`div`,{className:`col-lg-7 col-12`,children:(0,U.jsx)(`ul`,{className:`list-unstyled`,children:i.timepoints.reduce((t,n)=>[...t,...n.interactions.map(t=>(S++,(0,U.jsx)(ur,{studentResults:x,interaction:t,timepoint:n,interactive:i,state:r,goToTimepoint:f,interactionNumber:S,imageCdnUrl:e.imageCdnUrl},t.id)))],[])})})})]})}function br(e){let{player:t,resultsService:n,interactive:r,setShowSummary:i,mobile:a}=e,[o,s]=H.useState(!1),[c,l]=H.useState(!1),u=e.player.activePlugins_.activityStatusPlugin,d=e.player.activePlugins_.favouritePlugin;function f(){i(!0),t.pause(),t.hide()}function p(){let e=t.currentTime(),n=r.timepoints[r.timepoints.length-1];if(c){s(!0);return}e>n.visibleAt/1e3+1?s(!0):s(!1)}function m(){l(!0)}if(H.useEffect(()=>(t.on(`ended`,m),()=>t.off(`ended`,m)),[]),H.useEffect(()=>{if(!(!n||a))return t.on(`timeupdate`,p),()=>t.off(`timeupdate`,p)},[c]),!o)return null;let h=`btn btn-outline-dark cv-show-summary`;return d&&(h+=` cv-has-favourite-plugin`),u&&(h+=` cv-has-activity-status-plugin`),(0,U.jsx)(A,{className:h,onClick:f,children:t.gradePassbackPlugin().enabled?`Submit answers`:`View summary`})}function xr(e){let{resultsService:t,player:n,onShowSummary:r,mobile:i}=e,[a,o]=H.useState(!1);function s(e){o(e),r&&r(e)}function c(){s(!0),n.hide()}return H.useEffect(()=>{if(!(!t||i))return n.on(`ended`,c),()=>n.off(`ended`,c)},[]),H.useEffect(()=>{!a||!n.isFullscreen()||n.exitFullscreen()},[a]),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(br,{setShowSummary:s,...e}),(0,U.jsx)(yr,{showSummary:a,setShowSummary:s,...e})]})}function Sr(){let e=k.getLiteArticle(O.MakeInteractive);return(0,U.jsxs)(`div`,{className:`my-5 text-center`,children:[(0,U.jsx)(`h2`,{className:`h3`,children:`Select an interaction to get started`}),(0,U.jsx)(`p`,{className:`mb-0`,children:`Choose a point in the video and add a question to interact and engage your students.`}),!!e&&(0,U.jsx)(`a`,{href:e,target:`_blank`,className:`btn btn-link text-info`,children:`How do I make interactives?`})]})}function Cr(e){let{isCreate:t,interactive:n,interaction:r,portalNode:i,goToTimepoint:a,promptDelete:o}=e;if(!i)return(0,U.jsx)(U.Fragment,{});let s=n.timepoints.reduce((e,t)=>e+t.interactions.length,0);return(0,U.jsx)(z,{node:i,children:s?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`h2`,{className:`h4 mt-3`,children:[`Question List (`,s,`)`]}),(0,U.jsx)(Ge,{interactive:n,maxHeight:300,goToTimepoint:a,selectedInteractionId:r?.id,onClickDelete:t?o:void 0,experimentalInteractiveQuestions:e.experimentalInteractiveQuestions})]}):t?(0,U.jsx)(Sr,{}):(0,U.jsx)(U.Fragment,{})})}var wr=[b.Annotation,b.MissingWord,b.Illustration,b.Image,b.MultipleChoice,b.ShortAnswer,b.TrueOrFalse];function Tr(e){let{addInteraction:t,cancelTypeSelector:n,player:r,timepoint:i,open:a,isCreate:o,interaction:s,experimentalInteractiveQuestions:c}=e,[l,u]=H.useState(V(r.currentTime()||0)),d=[...wr];return c&&d.push(...Object.keys(x)),H.useEffect(()=>{let e=()=>{u(V(r.currentTime()))};return r.on(`timeupdate`,e),()=>r.off(`timeupdate`,e)},[]),s||!o||!a?(0,U.jsx)(U.Fragment,{}):(0,U.jsx)(`div`,{className:`d-flex align-items-center justify-content-center h-100`,children:(0,U.jsxs)(`div`,{className:`cv-interactive-type-selector justify-content-center align-items-center`,children:[(0,U.jsxs)(`h2`,{className:`text-center fw-bold w-100 text-body mb-3 cv-add-question-copy`,children:[i?`Add another question at:`:`Add a question at:`,` `,l]}),(0,U.jsx)(`ul`,{className:`list-unstyled row g-2 row-cols-2`,children:d.map((e,n)=>{let{name:r,bgClassName:i,Svg:a}=Te.getTypeInfo(e);return(0,U.jsx)(`li`,{className:`col`,children:(0,U.jsxs)(A,{className:`cv-type-selector rounded p-2 w-100 d-flex border justify-content-start align-items-center`,onClick:()=>t(e),children:[(0,U.jsx)(`span`,{className:`cv-create-type-icon text-shadow rounded ${i} me-2`,children:(0,U.jsx)(a,{})}),(0,U.jsx)(`div`,{className:`d-flex align-items-center justify-content-center cv-interaction-type-name text-dark`,children:r})]})},n)})}),(i||a)&&(0,U.jsx)(`div`,{className:`text-center w-100 mt-2 ${i?``:`cv-adding-first-cancel`}`,children:(0,U.jsx)(A,{className:`btn btn-link`,onClick:n,children:`Cancel`})})]})})}function Er(e){let{timepoint:t,interaction:n,promptDelete:r,optionsPortalNode:i,setView:a}=e;if(!n)return(0,U.jsx)(U.Fragment,{});let o=[];if(o.push({label:`Move time point`,onClick:()=>a(`move`)}),t.interactions.length>1){let e=hr(n.id);o.push({label:`Re-order questions`,onClick:()=>a(`reorder`),className:e?`disabled`:``})}return o.push({label:`Delete`,onClick:()=>r(n.id),className:`text-danger`}),(0,U.jsx)(z,{node:i,children:!!n&&(0,U.jsx)(ge,{actions:o,className:`p-0 mt-n2`,dropdownToggleClassName:`p-0`})})}function Dr(e){let{interaction:t,interactionState:n,onClickContinue:r,onClickSave:i,onClickCancel:a,onClickAddAnother:o,onClickDiscard:s}=e,c=hr(t.id),l=!!n?.hasChanges,u=!!n?.spinner;return(0,U.jsxs)(`div`,{className:`cv-timpoint-button-container`,children:[c?(0,U.jsx)(A,{className:`btn btn-link`,onClick:a,children:`Cancel`}):l?(0,U.jsx)(A,{className:`btn btn-link`,onClick:s,children:`Discard`}):(0,U.jsx)(A,{className:`btn btn-link`,onClick:o,children:`Add another question`}),u?(0,U.jsx)(A,{className:`btn btn-dark ms-2 cv-interactive-spinner`,onClick:()=>{},children:(0,U.jsx)(M,{as:`span`,animation:`border`,role:`status`,size:`sm`})}):c?l?(0,U.jsx)(A,{className:`btn btn-dark ms-2`,onClick:i,children:`Save`}):(0,U.jsx)(A,{className:`btn btn-dark ms-2 disabled`,onClick:()=>{},children:`Save`}):l?(0,U.jsx)(A,{className:`btn btn-dark ms-2`,onClick:i,children:`Save`}):(0,U.jsx)(et,{className:`btn btn-dark ms-2`,onClick:r,svg:pe,children:`Continue`})]})}function Or(e){let{typeId:t,interactionState:n,onClickSkip:r,numberOfInteractions:i,currentIndex:a,changeIndex:o}=e,s=!!n?.submitted,c=!!n?.hasChanges,l=!!n?.spinner,u=!!or(t),d=a<i-1;function f(){d&&o(a+1)}let p=a>0;function m(){p&&o(a-1)}function h(){c&&e.onClickSubmit()}return(0,U.jsxs)(`div`,{className:`cv-timpoint-button-container flex-wrap`,children:[!s&&u&&(0,U.jsx)(A,{className:`btn btn-link`,onClick:r,children:`Come back later`}),i>1&&a>0&&(0,U.jsx)(et,{className:`btn btn-dark ms-2 ${p?``:`disabled`}`,onClick:m,svg:F}),l?(0,U.jsx)(A,{className:`btn btn-dark ms-2 cv-interactive-spinner`,onClick:()=>{},children:(0,U.jsx)(M,{as:`span`,animation:`border`,role:`status`,size:`sm`})}):s||!u?i===1||a===i-1?(0,U.jsx)(et,{className:`btn btn-dark ms-2`,onClick:r,svg:pe,children:`Continue`}):(0,U.jsx)(A,{className:`btn btn-dark ms-2 ${d?``:`disabled`}`,onClick:f,children:`Next`}):(0,U.jsx)(A,{className:`btn btn-dark ms-2 ${c?``:`disabled`}`,onClick:h,children:`Save`})]})}function kr(e){let{isCreate:t,interaction:n,interactionState:r,continueInteractive:i,saveInteraction:a,cancel:o,addAnotherQuestion:s,discardChanges:c,submitInteractionAnswer:l,onClickSkip:u,changeIndex:d,timepoint:f,currentIndex:p}=e;return(0,U.jsx)(U.Fragment,{children:t?(0,U.jsx)(Dr,{interaction:n,interactionState:r,onClickContinue:i,onClickSave:a,onClickCancel:o,onClickAddAnother:s,onClickDiscard:()=>c()}):(0,U.jsx)(Or,{typeId:n.typeId,interactionState:r,onClickSubmit:l,onClickSkip:u,changeIndex:d,currentIndex:p,numberOfInteractions:f.interactions.length})})}function Ar(e){let{typeId:t,currentIndex:r,numberOfInteractions:a,changeIndex:o,player:s}=e,[c,l]=H.useState(V(s.currentTime()||0));H.useEffect(()=>{let e=()=>{l(V(s.currentTime()))};return s.on(`timeupdate`,e),()=>s.off(`timeupdate`,e)},[]);let{name:u,bgClassName:d}=Te.getTypeInfo(t),f=r<a-1;function p(){f&&o(r+1)}let m=r>0;function h(){m&&o(r-1)}return(0,U.jsxs)(`div`,{className:`text-center d-flex justify-content-between align-items-center p-1 ${d}`,children:[(0,U.jsx)(A,{onClick:h,className:m?``:`invisible`,children:(0,U.jsx)(i,{size:n.Medium,svg:le})}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`h6 mb-0`,children:u}),a>1&&(0,U.jsxs)(`div`,{children:[r+1,` of `,a,` at `,c]})]}),(0,U.jsx)(A,{onClick:p,className:f?``:`invisible`,children:(0,U.jsx)(i,{size:n.Medium,svg:ve})})]})}var jr={reader:`_reader_1t278_1`},Mr=[`A`,`B`,`C`,`D`];function Nr(e){if(!e.enableImmersiveReader)return(0,U.jsx)(U.Fragment,{});let{interaction:t,className:n}=e,{name:r,typeName:i}=Te.getTypeInfo(t.typeId),a=``;switch(t.typeId){case b.Annotation:a=t.data.annotation;break;case b.Image:a=t.data.caption;break;case b.MissingWord:a=t.data.sentence.replace(/{([^{}]*)}/g,()=>`<u> </u>`);break;case b.MultipleChoice:a=t.name,t.actionableItems.map((e,t)=>a+=`<br />${Mr[t]}: ${e.name}`);break;case b.ShortAnswer:a=t.name;break;case b.TrueOrFalse:a=`True or false: ${t.name}`;break}let o=t.typeId===b.Annotation||t.typeId===b.MissingWord||t.typeId===b.MultipleChoice;return(0,U.jsx)(Ke,{title:r,text:a,html:o,className:`${jr.reader} ${n||``}`,analyticsData:{id:t.interactiveId,type:i},analyticsOptions:{location:v.InteractivePlayer,entity:_.Interactive,actionType:y.Click,descriptor:g.LaunchImmersiveReader}})}function Pr(e){let{name:t,prompt:n,bgClassName:r,Svg:i}=Te.getTypeInfo(e.interaction.typeId);return(0,U.jsxs)(`div`,{className:`text-center text-body d-flex justify-content-between align-items-center px-3 pt-3`,children:[(0,U.jsxs)(`div`,{className:`d-flex align-items-center`,children:[(0,U.jsx)(`span`,{className:`cv-interaction-icon rounded my-1 text-white ${r}`,children:(0,U.jsx)(i,{})}),(0,U.jsxs)(`span`,{className:`text-start flex-grow-1`,children:[(0,U.jsx)(`div`,{className:`h5 ${n?``:`mb-0`}`,children:(0,U.jsx)(`strong`,{children:t})}),n&&(0,U.jsx)(`div`,{className:`h6 mb-0`,children:n})]})]}),(0,U.jsx)(Nr,{interaction:e.interaction,className:`ms-2`,enableImmersiveReader:e.enableImmersiveReader})]})}function Fr(e){let{isCreate:t,interaction:n,player:r,changeIndex:i,timepointState:a,timepoint:o}=e;return t?(0,U.jsx)(Ar,{typeId:n.typeId,changeIndex:i,player:r,currentIndex:a.interactionIndex,numberOfInteractions:o.interactions.length}):(0,U.jsx)(Pr,{interaction:n,enableImmersiveReader:e.enableImmersiveReader})}var Q=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):n.Immutable=r()})(e,function(){var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return o(e)?e:z(e)}t(r,n);function r(e){return s(e)?e:ce(e)}t(i,n);function i(e){return c(e)?e:B(e)}t(a,n);function a(e){return o(e)&&!l(e)?e:le(e)}function o(e){return!!(e&&e[d])}function s(e){return!!(e&&e[f])}function c(e){return!!(e&&e[p])}function l(e){return s(e)||c(e)}function u(e){return!!(e&&e[m])}n.isIterable=o,n.isKeyed=s,n.isIndexed=c,n.isAssociative=l,n.isOrdered=u,n.Keyed=r,n.Indexed=i,n.Set=a;var d=`@@__IMMUTABLE_ITERABLE__@@`,f=`@@__IMMUTABLE_KEYED__@@`,p=`@@__IMMUTABLE_INDEXED__@@`,m=`@@__IMMUTABLE_ORDERED__@@`,h=`delete`,g=5,_=1<<g,v=_-1,y={},b={value:!1},x={value:!1};function S(e){return e.value=!1,e}function C(e){e&&(e.value=!0)}function w(){}function T(e,t){t||=0;for(var n=Math.max(0,e.length-t),r=Array(n),i=0;i<n;i++)r[i]=e[i+t];return r}function E(e){return e.size===void 0&&(e.size=e.__iterate(O)),e.size}function D(e,t){if(typeof t!=`number`){var n=t>>>0;if(``+n!==t||n===4294967295)return NaN;t=n}return t<0?E(e)+t:t}function O(){return!0}function k(e,t,n){return(e===0||n!==void 0&&e<=-n)&&(t===void 0||n!==void 0&&t>=n)}function A(e,t){return M(e,t,0)}function j(e,t){return M(e,t,t)}function M(e,t,n){return e===void 0?n:e<0?Math.max(0,t+e):t===void 0?e:Math.min(t,e)}var ee=0,N=1,P=2,te=typeof Symbol==`function`&&Symbol.iterator,ne=`@@iterator`,F=te||ne;function I(e){this.next=e}I.prototype.toString=function(){return`[Iterator]`},I.KEYS=ee,I.VALUES=N,I.ENTRIES=P,I.prototype.inspect=I.prototype.toSource=function(){return this.toString()},I.prototype[F]=function(){return this};function L(e,t,n,r){var i=e===0?t:e===1?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function R(){return{value:void 0,done:!0}}function re(e){return!!oe(e)}function ie(e){return e&&typeof e.next==`function`}function ae(e){var t=oe(e);return t&&t.call(e)}function oe(e){var t=e&&(te&&e[te]||e[ne]);if(typeof t==`function`)return t}function se(e){return e&&typeof e.length==`number`}t(z,n);function z(e){return e==null?_e():o(e)?e.toSeq():be(e)}z.of=function(){return z(arguments)},z.prototype.toSeq=function(){return this},z.prototype.toString=function(){return this.__toString(`Seq {`,`}`)},z.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},z.prototype.__iterate=function(e,t){return Se(this,e,t,!0)},z.prototype.__iterator=function(e,t){return Ce(this,e,t,!0)},t(ce,z);function ce(e){return e==null?_e().toKeyedSeq():o(e)?s(e)?e.toSeq():e.fromEntrySeq():ve(e)}ce.prototype.toKeyedSeq=function(){return this},t(B,z);function B(e){return e==null?_e():o(e)?s(e)?e.entrySeq():e.toIndexedSeq():ye(e)}B.of=function(){return B(arguments)},B.prototype.toIndexedSeq=function(){return this},B.prototype.toString=function(){return this.__toString(`Seq [`,`]`)},B.prototype.__iterate=function(e,t){return Se(this,e,t,!1)},B.prototype.__iterator=function(e,t){return Ce(this,e,t,!1)},t(le,z);function le(e){return(e==null?_e():o(e)?s(e)?e.entrySeq():e:ye(e)).toSetSeq()}le.of=function(){return le(arguments)},le.prototype.toSetSeq=function(){return this},z.isSeq=he,z.Keyed=ce,z.Set=le,z.Indexed=B;var ue=`@@__IMMUTABLE_SEQ__@@`;z.prototype[ue]=!0,t(de,B);function de(e){this._array=e,this.size=e.length}de.prototype.get=function(e,t){return this.has(e)?this._array[D(this,e)]:t},de.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length-1,i=0;i<=r;i++)if(e(n[t?r-i:i],i,this)===!1)return i+1;return i},de.prototype.__iterator=function(e,t){var n=this._array,r=n.length-1,i=0;return new I(function(){return i>r?R():L(e,i,n[t?r-i++:i++])})},t(fe,ce);function fe(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}fe.prototype.get=function(e,t){return t!==void 0&&!this.has(e)?t:this._object[e]},fe.prototype.has=function(e){return this._object.hasOwnProperty(e)},fe.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,i=r.length-1,a=0;a<=i;a++){var o=r[t?i-a:a];if(e(n[o],o,this)===!1)return a+1}return a},fe.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,i=r.length-1,a=0;return new I(function(){var o=r[t?i-a:a];return a++>i?R():L(e,o,n[o])})},fe.prototype[m]=!0,t(pe,B);function pe(e){this._iterable=e,this.size=e.length||e.size}pe.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=this._iterable,r=ae(n),i=0;if(ie(r))for(var a;!(a=r.next()).done&&e(a.value,i++,this)!==!1;);return i},pe.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterable,r=ae(n);if(!ie(r))return new I(R);var i=0;return new I(function(){var t=r.next();return t.done?t:L(e,i++,t.value)})},t(me,B);function me(e){this._iterator=e,this._iteratorCache=[]}me.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n=this._iterator,r=this._iteratorCache,i=0;i<r.length;)if(e(r[i],i++,this)===!1)return i;for(var a;!(a=n.next()).done;){var o=a.value;if(r[i]=o,e(o,i++,this)===!1)break}return i},me.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterator,r=this._iteratorCache,i=0;return new I(function(){if(i>=r.length){var t=n.next();if(t.done)return t;r[i]=t.value}return L(e,i,r[i++])})};function he(e){return!!(e&&e[ue])}var ge;function _e(){return ge||=new de([])}function ve(e){var t=Array.isArray(e)?new de(e).fromEntrySeq():ie(e)?new me(e).fromEntrySeq():re(e)?new pe(e).fromEntrySeq():typeof e==`object`?new fe(e):void 0;if(!t)throw TypeError(`Expected Array or iterable object of [k, v] entries, or keyed object: `+e);return t}function ye(e){var t=xe(e);if(!t)throw TypeError(`Expected Array or iterable object of values: `+e);return t}function be(e){var t=xe(e)||typeof e==`object`&&new fe(e);if(!t)throw TypeError(`Expected Array or iterable object of values, or keyed object: `+e);return t}function xe(e){return se(e)?new de(e):ie(e)?new me(e):re(e)?new pe(e):void 0}function Se(e,t,n,r){var i=e._cache;if(i){for(var a=i.length-1,o=0;o<=a;o++){var s=i[n?a-o:o];if(t(s[1],r?s[0]:o,e)===!1)return o+1}return o}return e.__iterateUncached(t,n)}function Ce(e,t,n,r){var i=e._cache;if(i){var a=i.length-1,o=0;return new I(function(){var e=i[n?a-o:o];return o++>a?R():L(t,r?e[0]:o-1,e[1])})}return e.__iteratorUncached(t,n)}function we(e,t){return t?Te(t,e,``,{"":e}):Ee(e)}function Te(e,t,n,r){return Array.isArray(t)?e.call(r,n,B(t).map(function(n,r){return Te(e,n,r,t)})):De(t)?e.call(r,n,ce(t).map(function(n,r){return Te(e,n,r,t)})):t}function Ee(e){return Array.isArray(e)?B(e).map(Ee).toList():De(e)?ce(e).map(Ee).toMap():e}function De(e){return e&&(e.constructor===Object||e.constructor===void 0)}function V(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if(typeof e.valueOf==`function`&&typeof t.valueOf==`function`){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!!(typeof e.equals==`function`&&typeof t.equals==`function`&&e.equals(t))}function Oe(e,t){if(e===t)return!0;if(!o(t)||e.size!==void 0&&t.size!==void 0&&e.size!==t.size||e.__hash!==void 0&&t.__hash!==void 0&&e.__hash!==t.__hash||s(e)!==s(t)||c(e)!==c(t)||u(e)!==u(t))return!1;if(e.size===0&&t.size===0)return!0;var n=!l(e);if(u(e)){var r=e.entries();return t.every(function(e,t){var i=r.next().value;return i&&V(i[1],e)&&(n||V(i[0],t))})&&r.next().done}var i=!1;if(e.size===void 0)if(t.size===void 0)typeof e.cacheResult==`function`&&e.cacheResult();else{i=!0;var a=e;e=t,t=a}var d=!0,f=t.__iterate(function(t,r){if(n?!e.has(t):i?!V(t,e.get(r,y)):!V(e.get(r,y),t))return d=!1,!1});return d&&e.size===f}t(ke,B);function ke(e,t){if(!(this instanceof ke))return new ke(e,t);if(this._value=e,this.size=t===void 0?1/0:Math.max(0,t),this.size===0){if(Ae)return Ae;Ae=this}}ke.prototype.toString=function(){return this.size===0?`Repeat []`:`Repeat [ `+this._value+` `+this.size+` times ]`},ke.prototype.get=function(e,t){return this.has(e)?this._value:t},ke.prototype.includes=function(e){return V(this._value,e)},ke.prototype.slice=function(e,t){var n=this.size;return k(e,t,n)?this:new ke(this._value,j(t,n)-A(e,n))},ke.prototype.reverse=function(){return this},ke.prototype.indexOf=function(e){return V(this._value,e)?0:-1},ke.prototype.lastIndexOf=function(e){return V(this._value,e)?this.size:-1},ke.prototype.__iterate=function(e,t){for(var n=0;n<this.size;n++)if(e(this._value,n,this)===!1)return n+1;return n},ke.prototype.__iterator=function(e,t){var n=this,r=0;return new I(function(){return r<n.size?L(e,r++,n._value):R()})},ke.prototype.equals=function(e){return e instanceof ke?V(this._value,e._value):Oe(e)};var Ae;function je(e,t){if(!e)throw Error(t)}t(Me,B);function Me(e,t,n){if(!(this instanceof Me))return new Me(e,t,n);if(je(n!==0,`Cannot step a Range by 0`),e||=0,t===void 0&&(t=1/0),n=n===void 0?1:Math.abs(n),t<e&&(n=-n),this._start=e,this._end=t,this._step=n,this.size=Math.max(0,Math.ceil((t-e)/n-1)+1),this.size===0){if(Ne)return Ne;Ne=this}}Me.prototype.toString=function(){return this.size===0?`Range []`:`Range [ `+this._start+`...`+this._end+(this._step>1?` by `+this._step:``)+` ]`},Me.prototype.get=function(e,t){return this.has(e)?this._start+D(this,e)*this._step:t},Me.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},Me.prototype.slice=function(e,t){return k(e,t,this.size)?this:(e=A(e,this.size),t=j(t,this.size),t<=e?new Me(0,0):new Me(this.get(e,this._end),this.get(t,this._end),this._step))},Me.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step===0){var n=t/this._step;if(n>=0&&n<this.size)return n}return-1},Me.prototype.lastIndexOf=function(e){return this.indexOf(e)},Me.prototype.__iterate=function(e,t){for(var n=this.size-1,r=this._step,i=t?this._start+n*r:this._start,a=0;a<=n;a++){if(e(i,a,this)===!1)return a+1;i+=t?-r:r}return a},Me.prototype.__iterator=function(e,t){var n=this.size-1,r=this._step,i=t?this._start+n*r:this._start,a=0;return new I(function(){var o=i;return i+=t?-r:r,a>n?R():L(e,a++,o)})},Me.prototype.equals=function(e){return e instanceof Me?this._start===e._start&&this._end===e._end&&this._step===e._step:Oe(this,e)};var Ne;t(Pe,n);function Pe(){throw TypeError(`Abstract`)}t(Fe,Pe);function Fe(){}t(Ie,Pe);function Ie(){}t(Le,Pe);function Le(){}Pe.Keyed=Fe,Pe.Indexed=Ie,Pe.Set=Le;var Re=typeof Math.imul==`function`?Math.imul:function(e,t){e|=0,t|=0;var n=e&65535,r=t&65535;return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function ze(e){return e>>>1&1073741824|e&3221225471}function Be(e){if(e===!1||e==null||typeof e.valueOf==`function`&&(e=e.valueOf(),e===!1||e==null))return 0;if(e===!0)return 1;var t=typeof e;if(t===`number`){var n=e|0;for(n!==e&&(n^=e*4294967295);e>4294967295;)e/=4294967295,n^=e;return ze(n)}if(t===`string`)return e.length>Ye?Ve(e):He(e);if(typeof e.hashCode==`function`)return e.hashCode();if(t===`object`)return Ue(e);if(typeof e.toString==`function`)return He(e.toString());throw Error(`Value type `+t+` cannot be hashed.`)}function Ve(e){var t=Qe[e];return t===void 0&&(t=He(e),Ze===Xe&&(Ze=0,Qe={}),Ze++,Qe[e]=t),t}function He(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return ze(t)}function Ue(e){var t;if(qe&&(t=Je.get(e),t!==void 0)||(t=e[U],t!==void 0)||!Ge&&(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[U],t!==void 0||(t=Ke(e),t!==void 0)))return t;if(t=++H,H&1073741824&&(H=0),qe)Je.set(e,t);else if(We!==void 0&&We(e)===!1)throw Error(`Non-extensible objects are not allowed as keys.`);else if(Ge)Object.defineProperty(e,U,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(e.propertyIsEnumerable!==void 0&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[U]=t;else if(e.nodeType!==void 0)e[U]=t;else throw Error(`Unable to set a non-enumerable property on object.`);return t}var We=Object.isExtensible,Ge=function(){try{return Object.defineProperty({},"@",{}),!0}catch{return!1}}();function Ke(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}var qe=typeof WeakMap==`function`,Je;qe&&(Je=new WeakMap);var H=0,U=`__immutablehash__`;typeof Symbol==`function`&&(U=Symbol(U));var Ye=16,Xe=255,Ze=0,Qe={};function $e(e){je(e!==1/0,`Cannot perform this action with an infinite size.`)}t(W,Fe);function W(e){return e==null?ft():et(e)&&!u(e)?e:ft().withMutations(function(t){var n=r(e);$e(n.size),n.forEach(function(e,n){return t.set(n,e)})})}W.prototype.toString=function(){return this.__toString(`Map {`,`}`)},W.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},W.prototype.set=function(e,t){return pt(this,e,t)},W.prototype.setIn=function(e,t){return this.updateIn(e,y,function(){return t})},W.prototype.remove=function(e){return pt(this,e,y)},W.prototype.deleteIn=function(e){return this.updateIn(e,function(){return y})},W.prototype.update=function(e,t,n){return arguments.length===1?e(this):this.updateIn([e],t,n)},W.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=Ct(this,Tn(e),t,n);return r===y?void 0:r},W.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):ft()},W.prototype.merge=function(){return bt(this,void 0,arguments)},W.prototype.mergeWith=function(t){var n=e.call(arguments,1);return bt(this,t,n)},W.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,ft(),function(e){return typeof e.merge==`function`?e.merge.apply(e,n):n[n.length-1]})},W.prototype.mergeDeep=function(){return bt(this,xt,arguments)},W.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return bt(this,K(t),n)},W.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,ft(),function(e){return typeof e.mergeDeep==`function`?e.mergeDeep.apply(e,n):n[n.length-1]})},W.prototype.sort=function(e){return Gt(hn(this,e))},W.prototype.sortBy=function(e,t){return Gt(hn(this,t,e))},W.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},W.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new w)},W.prototype.asImmutable=function(){return this.__ensureOwner()},W.prototype.wasAltered=function(){return this.__altered},W.prototype.__iterator=function(e,t){return new st(this,e,t)},W.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},W.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?ut(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)};function et(e){return!!(e&&e[tt])}W.isMap=et;var tt=`@@__IMMUTABLE_MAP__@@`,G=W.prototype;G[tt]=!0,G[h]=G.remove,G.removeIn=G.deleteIn;function nt(e,t){this.ownerID=e,this.entries=t}nt.prototype.get=function(e,t,n,r){for(var i=this.entries,a=0,o=i.length;a<o;a++)if(V(n,i[a][0]))return i[a][1];return r},nt.prototype.update=function(e,t,n,r,i,a,o){for(var s=i===y,c=this.entries,l=0,u=c.length;l<u&&!V(r,c[l][0]);l++);var d=l<u;if(d?c[l][1]===i:s)return this;if(C(o),(s||!d)&&C(a),!(s&&c.length===1)){if(!d&&!s&&c.length>=Ot)return _t(e,c,r,i);var f=e&&e===this.ownerID,p=f?c:T(c);return d?s?l===u-1?p.pop():p[l]=p.pop():p[l]=[r,i]:p.push([r,i]),f?(this.entries=p,this):new nt(e,p)}};function rt(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}rt.prototype.get=function(e,t,n,r){t===void 0&&(t=Be(n));var i=1<<((e===0?t:t>>>e)&v),a=this.bitmap;return(a&i)===0?r:this.nodes[wt(a&i-1)].get(e+g,t,n,r)},rt.prototype.update=function(e,t,n,r,i,a,o){n===void 0&&(n=Be(r));var s=(t===0?n:n>>>t)&v,c=1<<s,l=this.bitmap,u=(l&c)!==0;if(!u&&i===y)return this;var d=wt(l&c-1),f=this.nodes,p=u?f[d]:void 0,m=mt(p,e,t+g,n,r,i,a,o);if(m===p)return this;if(!u&&m&&f.length>=kt)return yt(e,f,l,s,m);if(u&&!m&&f.length===2&&ht(f[d^1]))return f[d^1];if(u&&m&&f.length===1&&ht(m))return m;var h=e&&e===this.ownerID,_=u?m?l:l^c:l|c,b=u?m?Tt(f,d,m,h):Dt(f,d,h):Et(f,d,m,h);return h?(this.bitmap=_,this.nodes=b,this):new rt(e,_,b)};function it(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}it.prototype.get=function(e,t,n,r){t===void 0&&(t=Be(n));var i=(e===0?t:t>>>e)&v,a=this.nodes[i];return a?a.get(e+g,t,n,r):r},it.prototype.update=function(e,t,n,r,i,a,o){n===void 0&&(n=Be(r));var s=(t===0?n:n>>>t)&v,c=i===y,l=this.nodes,u=l[s];if(c&&!u)return this;var d=mt(u,e,t+g,n,r,i,a,o);if(d===u)return this;var f=this.count;if(!u)f++;else if(!d&&(f--,f<At))return vt(e,l,f,s);var p=e&&e===this.ownerID,m=Tt(l,s,d,p);return p?(this.count=f,this.nodes=m,this):new it(e,f,m)};function at(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}at.prototype.get=function(e,t,n,r){for(var i=this.entries,a=0,o=i.length;a<o;a++)if(V(n,i[a][0]))return i[a][1];return r},at.prototype.update=function(e,t,n,r,i,a,o){n===void 0&&(n=Be(r));var s=i===y;if(n!==this.keyHash)return s?this:(C(o),C(a),gt(this,e,t,n,[r,i]));for(var c=this.entries,l=0,u=c.length;l<u&&!V(r,c[l][0]);l++);var d=l<u;if(d?c[l][1]===i:s)return this;if(C(o),(s||!d)&&C(a),s&&u===2)return new ot(e,this.keyHash,c[l^1]);var f=e&&e===this.ownerID,p=f?c:T(c);return d?s?l===u-1?p.pop():p[l]=p.pop():p[l]=[r,i]:p.push([r,i]),f?(this.entries=p,this):new at(e,this.keyHash,p)};function ot(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}ot.prototype.get=function(e,t,n,r){return V(n,this.entry[0])?this.entry[1]:r},ot.prototype.update=function(e,t,n,r,i,a,o){var s=i===y,c=V(r,this.entry[0]);if(c?i===this.entry[1]:s)return this;if(C(o),s){C(a);return}return c?e&&e===this.ownerID?(this.entry[1]=i,this):new ot(e,this.keyHash,[r,i]):(C(a),gt(this,e,t,Be(r),[r,i]))},nt.prototype.iterate=at.prototype.iterate=function(e,t){for(var n=this.entries,r=0,i=n.length-1;r<=i;r++)if(e(n[t?i-r:r])===!1)return!1},rt.prototype.iterate=it.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,i=n.length-1;r<=i;r++){var a=n[t?i-r:r];if(a&&a.iterate(e,t)===!1)return!1}},ot.prototype.iterate=function(e,t){return e(this.entry)},t(st,I);function st(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&<(e._root)}st.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var n=t.node,r=t.index++,i;if(n.entry){if(r===0)return ct(e,n.entry)}else if(n.entries){if(i=n.entries.length-1,r<=i)return ct(e,n.entries[this._reverse?i-r:r])}else if(i=n.nodes.length-1,r<=i){var a=n.nodes[this._reverse?i-r:r];if(a){if(a.entry)return ct(e,a.entry);t=this._stack=lt(a,t)}continue}t=this._stack=this._stack.__prev}return R()};function ct(e,t){return L(e,t[0],t[1])}function lt(e,t){return{node:e,index:0,__prev:t}}function ut(e,t,n,r){var i=Object.create(G);return i.size=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}var dt;function ft(){return dt||=ut(0)}function pt(e,t,n){var r,i;if(e._root){var a=S(b),o=S(x);if(r=mt(e._root,e.__ownerID,0,void 0,t,n,a,o),!o.value)return e;i=e.size+(a.value?n===y?-1:1:0)}else{if(n===y)return e;i=1,r=new nt(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=i,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?ut(i,r):ft()}function mt(e,t,n,r,i,a,o,s){return e?e.update(t,n,r,i,a,o,s):a===y?e:(C(s),C(o),new ot(t,r,[i,a]))}function ht(e){return e.constructor===ot||e.constructor===at}function gt(e,t,n,r,i){if(e.keyHash===r)return new at(t,r,[e.entry,i]);var a=(n===0?e.keyHash:e.keyHash>>>n)&v,o=(n===0?r:r>>>n)&v,s,c=a===o?[gt(e,t,n+g,r,i)]:(s=new ot(t,r,i),a<o?[e,s]:[s,e]);return new rt(t,1<<a|1<<o,c)}function _t(e,t,n,r){e||=new w;for(var i=new ot(e,Be(n),[n,r]),a=0;a<t.length;a++){var o=t[a];i=i.update(e,0,void 0,o[0],o[1])}return i}function vt(e,t,n,r){for(var i=0,a=0,o=Array(n),s=0,c=1,l=t.length;s<l;s++,c<<=1){var u=t[s];u!==void 0&&s!==r&&(i|=c,o[a++]=u)}return new rt(e,i,o)}function yt(e,t,n,r,i){for(var a=0,o=Array(_),s=0;n!==0;s++,n>>>=1)o[s]=n&1?t[a++]:void 0;return o[r]=i,new it(e,a+1,o)}function bt(e,t,n){for(var i=[],a=0;a<n.length;a++){var s=n[a],c=r(s);o(s)||(c=c.map(function(e){return we(e)})),i.push(c)}return St(e,t,i)}function xt(e,t,n){return e&&e.mergeDeep&&o(t)?e.mergeDeep(t):V(e,t)?e:t}function K(e){return function(t,n,r){if(t&&t.mergeDeepWith&&o(n))return t.mergeDeepWith(e,n);var i=e(t,n,r);return V(t,i)?t:i}}function St(e,t,n){return n=n.filter(function(e){return e.size!==0}),n.length===0?e:e.size===0&&!e.__ownerID&&n.length===1?e.constructor(n[0]):e.withMutations(function(e){for(var r=t?function(n,r){e.update(r,y,function(e){return e===y?n:t(e,n,r)})}:function(t,n){e.set(n,t)},i=0;i<n.length;i++)n[i].forEach(r)})}function Ct(e,t,n,r){var i=e===y,a=t.next();if(a.done){var o=i?n:e,s=r(o);return s===o?e:s}je(i||e&&e.set,`invalid keyPath`);var c=a.value,l=i?y:e.get(c,y),u=Ct(l,t,n,r);return u===l?e:u===y?e.remove(c):(i?ft():e).set(c,u)}function wt(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,e&127}function Tt(e,t,n,r){var i=r?e:T(e);return i[t]=n,i}function Et(e,t,n,r){var i=e.length+1;if(r&&t+1===i)return e[t]=n,e;for(var a=Array(i),o=0,s=0;s<i;s++)s===t?(a[s]=n,o=-1):a[s]=e[s+o];return a}function Dt(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var i=Array(r),a=0,o=0;o<r;o++)o===t&&(a=1),i[o]=e[o+a];return i}var Ot=_/4,kt=_/2,At=_/4;t(q,Ie);function q(e){var t=zt();if(e==null)return t;if(jt(e))return e;var n=i(e),r=n.size;return r===0?t:($e(r),r>0&&r<_?Lt(0,r,g,null,new Pt(n.toArray())):t.withMutations(function(e){e.setSize(r),n.forEach(function(t,n){return e.set(n,t)})}))}q.of=function(){return this(arguments)},q.prototype.toString=function(){return this.__toString(`List [`,`]`)},q.prototype.get=function(e,t){if(e=D(this,e),e>=0&&e<this.size){e+=this._origin;var n=Ht(this,e);return n&&n.array[e&v]}return t},q.prototype.set=function(e,t){return Bt(this,e,t)},q.prototype.remove=function(e){return this.has(e)?e===0?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},q.prototype.insert=function(e,t){return this.splice(e,0,t)},q.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=g,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):zt()},q.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations(function(n){Y(n,0,t+e.length);for(var r=0;r<e.length;r++)n.set(t+r,e[r])})},q.prototype.pop=function(){return Y(this,0,-1)},q.prototype.unshift=function(){var e=arguments;return this.withMutations(function(t){Y(t,-e.length);for(var n=0;n<e.length;n++)t.set(n,e[n])})},q.prototype.shift=function(){return Y(this,1)},q.prototype.merge=function(){return Ut(this,void 0,arguments)},q.prototype.mergeWith=function(t){var n=e.call(arguments,1);return Ut(this,t,n)},q.prototype.mergeDeep=function(){return Ut(this,xt,arguments)},q.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return Ut(this,K(t),n)},q.prototype.setSize=function(e){return Y(this,0,e)},q.prototype.slice=function(e,t){var n=this.size;return k(e,t,n)?this:Y(this,A(e,n),j(t,n))},q.prototype.__iterator=function(e,t){var n=0,r=It(this,t);return new I(function(){var t=r();return t===Ft?R():L(e,n++,t)})},q.prototype.__iterate=function(e,t){for(var n=0,r=It(this,t),i;(i=r())!==Ft&&e(i,n++,this)!==!1;);return n},q.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Lt(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)};function jt(e){return!!(e&&e[Mt])}q.isList=jt;var Mt=`@@__IMMUTABLE_LIST__@@`,Nt=q.prototype;Nt[Mt]=!0,Nt[h]=Nt.remove,Nt.setIn=G.setIn,Nt.deleteIn=Nt.removeIn=G.removeIn,Nt.update=G.update,Nt.updateIn=G.updateIn,Nt.mergeIn=G.mergeIn,Nt.mergeDeepIn=G.mergeDeepIn,Nt.withMutations=G.withMutations,Nt.asMutable=G.asMutable,Nt.asImmutable=G.asImmutable,Nt.wasAltered=G.wasAltered;function Pt(e,t){this.array=e,this.ownerID=t}Pt.prototype.removeBefore=function(e,t,n){if(n===t?1<<t:this.array.length===0)return this;var r=n>>>t&v;if(r>=this.array.length)return new Pt([],e);var i=r===0,a;if(t>0){var o=this.array[r];if(a=o&&o.removeBefore(e,t-g,n),a===o&&i)return this}if(i&&!a)return this;var s=J(this,e);if(!i)for(var c=0;c<r;c++)s.array[c]=void 0;return a&&(s.array[r]=a),s},Pt.prototype.removeAfter=function(e,t,n){if(n===(t?1<<t:0)||this.array.length===0)return this;var r=n-1>>>t&v;if(r>=this.array.length)return this;var i;if(t>0){var a=this.array[r];if(i=a&&a.removeAfter(e,t-g,n),i===a&&r===this.array.length-1)return this}var o=J(this,e);return o.array.splice(r+1),i&&(o.array[r]=i),o};var Ft={};function It(e,t){var n=e._origin,r=e._capacity,i=Wt(r),a=e._tail;return o(e._root,e._level,0);function o(e,t,n){return t===0?s(e,n):c(e,t,n)}function s(e,o){var s=o===i?a&&a.array:e&&e.array,c=o>n?0:n-o,l=r-o;return l>_&&(l=_),function(){if(c===l)return Ft;var e=t?--l:c++;return s&&s[e]}}function c(e,i,a){var s,c=e&&e.array,l=a>n?0:n-a>>i,u=(r-a>>i)+1;return u>_&&(u=_),function(){do{if(s){var e=s();if(e!==Ft)return e;s=null}if(l===u)return Ft;var n=t?--u:l++;s=o(c&&c[n],i-g,a+(n<<i))}while(!0)}}}function Lt(e,t,n,r,i,a,o){var s=Object.create(Nt);return s.size=t-e,s._origin=e,s._capacity=t,s._level=n,s._root=r,s._tail=i,s.__ownerID=a,s.__hash=o,s.__altered=!1,s}var Rt;function zt(){return Rt||=Lt(0,0,g)}function Bt(e,t,n){if(t=D(e,t),t!==t)return e;if(t>=e.size||t<0)return e.withMutations(function(e){t<0?Y(e,t).set(0,n):Y(e,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,i=e._root,a=S(x);return t>=Wt(e._capacity)?r=Vt(r,e.__ownerID,0,t,n,a):i=Vt(i,e.__ownerID,e._level,t,n,a),a.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):Lt(e._origin,e._capacity,e._level,i,r):e}function Vt(e,t,n,r,i,a){var o=r>>>n&v,s=e&&o<e.array.length;if(!s&&i===void 0)return e;var c;if(n>0){var l=e&&e.array[o],u=Vt(l,t,n-g,r,i,a);return u===l?e:(c=J(e,t),c.array[o]=u,c)}return s&&e.array[o]===i?e:(C(a),c=J(e,t),i===void 0&&o===c.array.length-1?c.array.pop():c.array[o]=i,c)}function J(e,t){return t&&e&&t===e.ownerID?e:new Pt(e?e.array.slice():[],t)}function Ht(e,t){if(t>=Wt(e._capacity))return e._tail;if(t<1<<e._level+g){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&v],r-=g;return n}}function Y(e,t,n){t!==void 0&&(t|=0),n!==void 0&&(n|=0);var r=e.__ownerID||new w,i=e._origin,a=e._capacity,o=i+t,s=n===void 0?a:n<0?a+n:i+n;if(o===i&&s===a)return e;if(o>=s)return e.clear();for(var c=e._level,l=e._root,u=0;o+u<0;)l=new Pt(l&&l.array.length?[void 0,l]:[],r),c+=g,u+=1<<c;u&&(o+=u,i+=u,s+=u,a+=u);for(var d=Wt(a),f=Wt(s);f>=1<<c+g;)l=new Pt(l&&l.array.length?[l]:[],r),c+=g;var p=e._tail,m=f<d?Ht(e,s-1):f>d?new Pt([],r):p;if(p&&f>d&&o<a&&p.array.length){l=J(l,r);for(var h=l,_=c;_>g;_-=g){var y=d>>>_&v;h=h.array[y]=J(h.array[y],r)}h.array[d>>>g&v]=p}if(s<a&&(m&&=m.removeAfter(r,0,s)),o>=f)o-=f,s-=f,c=g,l=null,m&&=m.removeBefore(r,0,o);else if(o>i||f<d){for(u=0;l;){var b=o>>>c&v;if(b!==f>>>c&v)break;b&&(u+=(1<<c)*b),c-=g,l=l.array[b]}l&&o>i&&(l=l.removeBefore(r,c,o-u)),l&&f<d&&(l=l.removeAfter(r,c,f-u)),u&&(o-=u,s-=u)}return e.__ownerID?(e.size=s-o,e._origin=o,e._capacity=s,e._level=c,e._root=l,e._tail=m,e.__hash=void 0,e.__altered=!0,e):Lt(o,s,c,l,m)}function Ut(e,t,n){for(var r=[],a=0,s=0;s<n.length;s++){var c=n[s],l=i(c);l.size>a&&(a=l.size),o(c)||(l=l.map(function(e){return we(e)})),r.push(l)}return a>e.size&&(e=e.setSize(a)),St(e,t,r)}function Wt(e){return e<_?0:e-1>>>g<<g}t(Gt,W);function Gt(e){return e==null?Yt():Kt(e)?e:Yt().withMutations(function(t){var n=r(e);$e(n.size),n.forEach(function(e,n){return t.set(n,e)})})}Gt.of=function(){return this(arguments)},Gt.prototype.toString=function(){return this.__toString(`OrderedMap {`,`}`)},Gt.prototype.get=function(e,t){var n=this._map.get(e);return n===void 0?t:this._list.get(n)[1]},Gt.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):Yt()},Gt.prototype.set=function(e,t){return Xt(this,e,t)},Gt.prototype.remove=function(e){return Xt(this,e,y)},Gt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Gt.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],n)},t)},Gt.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Gt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?qt(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)};function Kt(e){return et(e)&&u(e)}Gt.isOrderedMap=Kt,Gt.prototype[m]=!0,Gt.prototype[h]=Gt.prototype.remove;function qt(e,t,n,r){var i=Object.create(Gt.prototype);return i.size=e?e.size:0,i._map=e,i._list=t,i.__ownerID=n,i.__hash=r,i}var Jt;function Yt(){return Jt||=qt(ft(),zt())}function Xt(e,t,n){var r=e._map,i=e._list,a=r.get(t),o=a!==void 0,s,c;if(n===y){if(!o)return e;i.size>=_&&i.size>=r.size*2?(c=i.filter(function(e,t){return e!==void 0&&a!==t}),s=c.toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(s.__ownerID=c.__ownerID=e.__ownerID)):(s=r.remove(t),c=a===i.size-1?i.pop():i.set(a,void 0))}else if(o){if(n===i.get(a)[1])return e;s=r,c=i.set(a,[t,n])}else s=r.set(t,i.size),c=i.set(i.size,[t,n]);return e.__ownerID?(e.size=s.size,e._map=s,e._list=c,e.__hash=void 0,e):qt(s,c)}t(Zt,ce);function Zt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}Zt.prototype.get=function(e,t){return this._iter.get(e,t)},Zt.prototype.has=function(e){return this._iter.has(e)},Zt.prototype.valueSeq=function(){return this._iter.valueSeq()},Zt.prototype.reverse=function(){var e=this,t=rn(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},Zt.prototype.map=function(e,t){var n=this,r=nn(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},Zt.prototype.__iterate=function(e,t){var n=this,r;return this._iter.__iterate(this._useKeys?function(t,r){return e(t,r,n)}:(r=t?bn(this):0,function(i){return e(i,t?--r:r++,n)}),t)},Zt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(N,t),r=t?bn(this):0;return new I(function(){var i=n.next();return i.done?i:L(e,t?--r:r++,i.value,i)})},Zt.prototype[m]=!0,t(Qt,B);function Qt(e){this._iter=e,this.size=e.size}Qt.prototype.includes=function(e){return this._iter.includes(e)},Qt.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate(function(t){return e(t,r++,n)},t)},Qt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(N,t),r=0;return new I(function(){var t=n.next();return t.done?t:L(e,r++,t.value,t)})},t($t,le);function $t(e){this._iter=e,this.size=e.size}$t.prototype.has=function(e){return this._iter.includes(e)},$t.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){return e(t,t,n)},t)},$t.prototype.__iterator=function(e,t){var n=this._iter.__iterator(N,t);return new I(function(){var t=n.next();return t.done?t:L(e,t.value,t.value,t)})},t(en,ce);function en(e){this._iter=e,this.size=e.size}en.prototype.entrySeq=function(){return this._iter.toSeq()},en.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){if(t){yn(t);var r=o(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}},t)},en.prototype.__iterator=function(e,t){var n=this._iter.__iterator(N,t);return new I(function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){yn(r);var i=o(r);return L(e,i?r.get(0):r[0],i?r.get(1):r[1],t)}}})},Qt.prototype.cacheResult=Zt.prototype.cacheResult=$t.prototype.cacheResult=en.prototype.cacheResult=Cn;function tn(e){var t=Sn(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Cn,t.__iterateUncached=function(t,n){var r=this;return e.__iterate(function(e,n){return t(n,e,r)!==!1},n)},t.__iteratorUncached=function(t,n){if(t===P){var r=e.__iterator(t,n);return new I(function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===N?ee:N,n)},t}function nn(e,t,n){var r=Sn(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,i){var a=e.get(r,y);return a===y?i:t.call(n,a,r,e)},r.__iterateUncached=function(r,i){var a=this;return e.__iterate(function(e,i,o){return r(t.call(n,e,i,o),i,a)!==!1},i)},r.__iteratorUncached=function(r,i){var a=e.__iterator(P,i);return new I(function(){var i=a.next();if(i.done)return i;var o=i.value,s=o[0];return L(r,s,t.call(n,o[1],s,e),i)})},r}function rn(e,t){var n=Sn(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=tn(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=Cn,n.__iterate=function(t,n){var r=this;return e.__iterate(function(e,n){return t(e,n,r)},!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function an(e,t,n,r){var i=Sn(e);return r&&(i.has=function(r){var i=e.get(r,y);return i!==y&&!!t.call(n,i,r,e)},i.get=function(r,i){var a=e.get(r,y);return a!==y&&t.call(n,a,r,e)?a:i}),i.__iterateUncached=function(i,a){var o=this,s=0;return e.__iterate(function(e,a,c){if(t.call(n,e,a,c))return s++,i(e,r?a:s-1,o)},a),s},i.__iteratorUncached=function(i,a){var o=e.__iterator(P,a),s=0;return new I(function(){for(;;){var a=o.next();if(a.done)return a;var c=a.value,l=c[0],u=c[1];if(t.call(n,u,l,e))return L(i,r?l:s++,u,a)}})},i}function on(e,t,n){var r=W().asMutable();return e.__iterate(function(i,a){r.update(t.call(n,i,a,e),0,function(e){return e+1})}),r.asImmutable()}function sn(e,t,n){var r=s(e),i=(u(e)?Gt():W()).asMutable();e.__iterate(function(a,o){i.update(t.call(n,a,o,e),function(e){return e||=[],e.push(r?[o,a]:a),e})});var a=xn(e);return i.map(function(t){return X(e,a(t))})}function cn(e,t,n,r){var i=e.size;if(t!==void 0&&(t|=0),n!==void 0&&(n|=0),k(t,n,i))return e;var a=A(t,i),o=j(n,i);if(a!==a||o!==o)return cn(e.toSeq().cacheResult(),t,n,r);var s=o-a,c;s===s&&(c=s<0?0:s);var l=Sn(e);return l.size=c===0?c:e.size&&c||void 0,!r&&he(e)&&c>=0&&(l.get=function(t,n){return t=D(this,t),t>=0&&t<c?e.get(t+a,n):n}),l.__iterateUncached=function(t,n){var i=this;if(c===0)return 0;if(n)return this.cacheResult().__iterate(t,n);var o=0,s=!0,l=0;return e.__iterate(function(e,n){if(!(s&&=o++<a))return l++,t(e,r?n:l-1,i)!==!1&&l!==c}),l},l.__iteratorUncached=function(t,n){if(c!==0&&n)return this.cacheResult().__iterator(t,n);var i=c!==0&&e.__iterator(t,n),o=0,s=0;return new I(function(){for(;o++<a;)i.next();if(++s>c)return R();var e=i.next();return r||t===N?e:t===ee?L(t,s-1,void 0,e):L(t,s-1,e.value[1],e)})},l}function ln(e,t,n){var r=Sn(e);return r.__iterateUncached=function(r,i){var a=this;if(i)return this.cacheResult().__iterate(r,i);var o=0;return e.__iterate(function(e,i,s){return t.call(n,e,i,s)&&++o&&r(e,i,a)}),o},r.__iteratorUncached=function(r,i){var a=this;if(i)return this.cacheResult().__iterator(r,i);var o=e.__iterator(P,i),s=!0;return new I(function(){if(!s)return R();var e=o.next();if(e.done)return e;var i=e.value,c=i[0],l=i[1];return t.call(n,l,c,a)?r===P?e:L(r,c,l,e):(s=!1,R())})},r}function un(e,t,n,r){var i=Sn(e);return i.__iterateUncached=function(i,a){var o=this;if(a)return this.cacheResult().__iterate(i,a);var s=!0,c=0;return e.__iterate(function(e,a,l){if(!(s&&=t.call(n,e,a,l)))return c++,i(e,r?a:c-1,o)}),c},i.__iteratorUncached=function(i,a){var o=this;if(a)return this.cacheResult().__iterator(i,a);var s=e.__iterator(P,a),c=!0,l=0;return new I(function(){var e,a,u;do{if(e=s.next(),e.done)return r||i===N?e:i===ee?L(i,l++,void 0,e):L(i,l++,e.value[1],e);var d=e.value;a=d[0],u=d[1],c&&=t.call(n,u,a,o)}while(c);return i===P?e:L(i,a,u,e)})},i}function dn(e,t){var n=s(e),i=[e].concat(t).map(function(e){return o(e)?n&&(e=r(e)):e=n?ve(e):ye(Array.isArray(e)?e:[e]),e}).filter(function(e){return e.size!==0});if(i.length===0)return e;if(i.length===1){var a=i[0];if(a===e||n&&s(a)||c(e)&&c(a))return a}var l=new de(i);return n?l=l.toKeyedSeq():c(e)||(l=l.toSetSeq()),l=l.flatten(!0),l.size=i.reduce(function(e,t){if(e!==void 0){var n=t.size;if(n!==void 0)return e+n}},0),l}function fn(e,t,n){var r=Sn(e);return r.__iterateUncached=function(r,i){var a=0,s=!1;function c(e,l){var u=this;e.__iterate(function(e,i){return(!t||l<t)&&o(e)?c(e,l+1):r(e,n?i:a++,u)===!1&&(s=!0),!s},i)}return c(e,0),a},r.__iteratorUncached=function(r,i){var a=e.__iterator(r,i),s=[],c=0;return new I(function(){for(;a;){var e=a.next();if(e.done!==!1){a=s.pop();continue}var l=e.value;if(r===P&&(l=l[1]),(!t||s.length<t)&&o(l))s.push(a),a=l.__iterator(r,i);else return n?e:L(r,c++,l,e)}return R()})},r}function pn(e,t,n){var r=xn(e);return e.toSeq().map(function(i,a){return r(t.call(n,i,a,e))}).flatten(!0)}function mn(e,t){var n=Sn(e);return n.size=e.size&&e.size*2-1,n.__iterateUncached=function(n,r){var i=this,a=0;return e.__iterate(function(e,r){return(!a||n(t,a++,i)!==!1)&&n(e,a++,i)!==!1},r),a},n.__iteratorUncached=function(n,r){var i=e.__iterator(N,r),a=0,o;return new I(function(){return(!o||a%2)&&(o=i.next(),o.done)?o:a%2?L(n,a++,t):L(n,a++,o.value,o)})},n}function hn(e,t,n){t||=wn;var r=s(e),i=0,a=e.toSeq().map(function(t,r){return[r,t,i++,n?n(t,r,e):t]}).toArray();return a.sort(function(e,n){return t(e[3],n[3])||e[2]-n[2]}).forEach(r?function(e,t){a[t].length=2}:function(e,t){a[t]=e[1]}),r?ce(a):c(e)?B(a):le(a)}function gn(e,t,n){if(t||=wn,n){var r=e.toSeq().map(function(t,r){return[t,n(t,r,e)]}).reduce(function(e,n){return _n(t,e[1],n[1])?n:e});return r&&r[0]}else return e.reduce(function(e,n){return _n(t,e,n)?n:e})}function _n(e,t,n){var r=e(n,t);return r===0&&n!==t&&(n==null||n!==n)||r>0}function vn(e,t,r){var i=Sn(e);return i.size=new de(r).map(function(e){return e.size}).min(),i.__iterate=function(e,t){for(var n=this.__iterator(N,t),r,i=0;!(r=n.next()).done&&e(r.value,i++,this)!==!1;);return i},i.__iteratorUncached=function(e,i){var a=r.map(function(e){return e=n(e),ae(i?e.reverse():e)}),o=0,s=!1;return new I(function(){var n;return s||=(n=a.map(function(e){return e.next()}),n.some(function(e){return e.done})),s?R():L(e,o++,t.apply(null,n.map(function(e){return e.value})))})},i}function X(e,t){return he(e)?t:e.constructor(t)}function yn(e){if(e!==Object(e))throw TypeError(`Expected [K, V] tuple: `+e)}function bn(e){return $e(e.size),E(e)}function xn(e){return s(e)?r:c(e)?i:a}function Sn(e){return Object.create((s(e)?ce:c(e)?B:le).prototype)}function Cn(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):z.prototype.cacheResult.call(this)}function wn(e,t){return e>t?1:e<t?-1:0}function Tn(e){var t=ae(e);if(!t){if(!se(e))throw TypeError(`Expected iterable or array-like: `+e);t=ae(n(e))}return t}t(En,Fe);function En(e,t){var n,r=function(a){if(a instanceof r)return a;if(!(this instanceof r))return new r(a);if(!n){n=!0;var o=Object.keys(e);An(i,o),i.size=o.length,i._name=t,i._keys=o,i._defaultValues=e}this._map=W(a)},i=r.prototype=Object.create(Dn);return i.constructor=r,r}En.prototype.toString=function(){return this.__toString(kn(this)+` {`,`}`)},En.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},En.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},En.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||=On(this,ft())},En.prototype.set=function(e,t){if(!this.has(e))throw Error(`Cannot set unknown key "`+e+`" on `+kn(this));var n=this._map&&this._map.set(e,t);return this.__ownerID||n===this._map?this:On(this,n)},En.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:On(this,t)},En.prototype.wasAltered=function(){return this._map.wasAltered()},En.prototype.__iterator=function(e,t){var n=this;return r(this._defaultValues).map(function(e,t){return n.get(t)}).__iterator(e,t)},En.prototype.__iterate=function(e,t){var n=this;return r(this._defaultValues).map(function(e,t){return n.get(t)}).__iterate(e,t)},En.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?On(this,t,e):(this.__ownerID=e,this._map=t,this)};var Dn=En.prototype;Dn[h]=Dn.remove,Dn.deleteIn=Dn.removeIn=G.removeIn,Dn.merge=G.merge,Dn.mergeWith=G.mergeWith,Dn.mergeIn=G.mergeIn,Dn.mergeDeep=G.mergeDeep,Dn.mergeDeepWith=G.mergeDeepWith,Dn.mergeDeepIn=G.mergeDeepIn,Dn.setIn=G.setIn,Dn.update=G.update,Dn.updateIn=G.updateIn,Dn.withMutations=G.withMutations,Dn.asMutable=G.asMutable,Dn.asImmutable=G.asImmutable;function On(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._map=t,r.__ownerID=n,r}function kn(e){return e._name||e.constructor.name||`Record`}function An(e,t){try{t.forEach(jn.bind(void 0,e))}catch{}}function jn(e,t){Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){je(this.__ownerID,`Cannot set on an immutable record.`),this.set(t,e)}})}t(Z,Le);function Z(e){return e==null?Rn():Mn(e)&&!u(e)?e:Rn().withMutations(function(t){var n=a(e);$e(n.size),n.forEach(function(e){return t.add(e)})})}Z.of=function(){return this(arguments)},Z.fromKeys=function(e){return this(r(e).keySeq())},Z.prototype.toString=function(){return this.__toString(`Set {`,`}`)},Z.prototype.has=function(e){return this._map.has(e)},Z.prototype.add=function(e){return Fn(this,this._map.set(e,!0))},Z.prototype.remove=function(e){return Fn(this,this._map.remove(e))},Z.prototype.clear=function(){return Fn(this,this._map.clear())},Z.prototype.union=function(){var t=e.call(arguments,0);return t=t.filter(function(e){return e.size!==0}),t.length===0?this:this.size===0&&!this.__ownerID&&t.length===1?this.constructor(t[0]):this.withMutations(function(e){for(var n=0;n<t.length;n++)a(t[n]).forEach(function(t){return e.add(t)})})},Z.prototype.intersect=function(){var t=e.call(arguments,0);if(t.length===0)return this;t=t.map(function(e){return a(e)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.every(function(e){return e.includes(n)})||e.remove(n)})})},Z.prototype.subtract=function(){var t=e.call(arguments,0);if(t.length===0)return this;t=t.map(function(e){return a(e)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.some(function(e){return e.includes(n)})&&e.remove(n)})})},Z.prototype.merge=function(){return this.union.apply(this,arguments)},Z.prototype.mergeWith=function(t){var n=e.call(arguments,1);return this.union.apply(this,n)},Z.prototype.sort=function(e){return zn(hn(this,e))},Z.prototype.sortBy=function(e,t){return zn(hn(this,t,e))},Z.prototype.wasAltered=function(){return this._map.wasAltered()},Z.prototype.__iterate=function(e,t){var n=this;return this._map.__iterate(function(t,r){return e(r,r,n)},t)},Z.prototype.__iterator=function(e,t){return this._map.map(function(e,t){return t}).__iterator(e,t)},Z.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):(this.__ownerID=e,this._map=t,this)};function Mn(e){return!!(e&&e[Nn])}Z.isSet=Mn;var Nn=`@@__IMMUTABLE_SET__@@`,Pn=Z.prototype;Pn[Nn]=!0,Pn[h]=Pn.remove,Pn.mergeDeep=Pn.merge,Pn.mergeDeepWith=Pn.mergeWith,Pn.withMutations=G.withMutations,Pn.asMutable=G.asMutable,Pn.asImmutable=G.asImmutable,Pn.__empty=Rn,Pn.__make=In;function Fn(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:t.size===0?e.__empty():e.__make(t)}function In(e,t){var n=Object.create(Pn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}var Ln;function Rn(){return Ln||=In(ft())}t(zn,Z);function zn(e){return e==null?Wn():Bn(e)?e:Wn().withMutations(function(t){var n=a(e);$e(n.size),n.forEach(function(e){return t.add(e)})})}zn.of=function(){return this(arguments)},zn.fromKeys=function(e){return this(r(e).keySeq())},zn.prototype.toString=function(){return this.__toString(`OrderedSet {`,`}`)};function Bn(e){return Mn(e)&&u(e)}zn.isOrderedSet=Bn;var Vn=zn.prototype;Vn[m]=!0,Vn.__empty=Wn,Vn.__make=Hn;function Hn(e,t){var n=Object.create(Vn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}var Un;function Wn(){return Un||=Hn(Yt())}t(Gn,Ie);function Gn(e){return e==null?Zn():Kn(e)?e:Zn().unshiftAll(e)}Gn.of=function(){return this(arguments)},Gn.prototype.toString=function(){return this.__toString(`Stack [`,`]`)},Gn.prototype.get=function(e,t){var n=this._head;for(e=D(this,e);n&&e--;)n=n.next;return n?n.value:t},Gn.prototype.peek=function(){return this._head&&this._head.value},Gn.prototype.push=function(){if(arguments.length===0)return this;for(var e=this.size+arguments.length,t=this._head,n=arguments.length-1;n>=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Yn(e,t)},Gn.prototype.pushAll=function(e){if(e=i(e),e.size===0)return this;$e(e.size);var t=this.size,n=this._head;return e.reverse().forEach(function(e){t++,n={value:e,next:n}}),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Yn(t,n)},Gn.prototype.pop=function(){return this.slice(1)},Gn.prototype.unshift=function(){return this.push.apply(this,arguments)},Gn.prototype.unshiftAll=function(e){return this.pushAll(e)},Gn.prototype.shift=function(){return this.pop.apply(this,arguments)},Gn.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Zn()},Gn.prototype.slice=function(e,t){if(k(e,t,this.size))return this;var n=A(e,this.size);if(j(t,this.size)!==this.size)return Ie.prototype.slice.call(this,e,t);for(var r=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):Yn(r,i)},Gn.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Yn(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Gn.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&e(r.value,n++,this)!==!1;)r=r.next;return n},Gn.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new I(function(){if(r){var t=r.value;return r=r.next,L(e,n++,t)}return R()})};function Kn(e){return!!(e&&e[qn])}Gn.isStack=Kn;var qn=`@@__IMMUTABLE_STACK__@@`,Jn=Gn.prototype;Jn[qn]=!0,Jn.withMutations=G.withMutations,Jn.asMutable=G.asMutable,Jn.asImmutable=G.asImmutable,Jn.wasAltered=G.wasAltered;function Yn(e,t,n,r){var i=Object.create(Jn);return i.size=e,i._head=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}var Xn;function Zn(){return Xn||=Yn(0)}function Qn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}n.Iterator=I,Qn(n,{toArray:function(){$e(this.size);var e=Array(this.size||0);return this.valueSeq().__iterate(function(t,n){e[n]=t}),e},toIndexedSeq:function(){return new Qt(this)},toJS:function(){return this.toSeq().map(function(e){return e&&typeof e.toJS==`function`?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&typeof e.toJSON==`function`?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new Zt(this,!0)},toMap:function(){return W(this.toKeyedSeq())},toObject:function(){$e(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e},toOrderedMap:function(){return Gt(this.toKeyedSeq())},toOrderedSet:function(){return zn(s(this)?this.valueSeq():this)},toSet:function(){return Z(s(this)?this.valueSeq():this)},toSetSeq:function(){return new $t(this)},toSeq:function(){return c(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Gn(s(this)?this.valueSeq():this)},toList:function(){return q(s(this)?this.valueSeq():this)},toString:function(){return`[Iterable]`},__toString:function(e,t){return this.size===0?e+t:e+` `+this.toSeq().map(this.__toStringMapper).join(`, `)+` `+t},concat:function(){var t=e.call(arguments,0);return X(this,dn(this,t))},includes:function(e){return this.some(function(t){return V(t,e)})},entries:function(){return this.__iterator(P)},every:function(e,t){$e(this.size);var n=!0;return this.__iterate(function(r,i,a){if(!e.call(t,r,i,a))return n=!1,!1}),n},filter:function(e,t){return X(this,an(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},findEntry:function(e,t){var n;return this.__iterate(function(r,i,a){if(e.call(t,r,i,a))return n=[i,r],!1}),n},findLastEntry:function(e,t){return this.toSeq().reverse().findEntry(e,t)},forEach:function(e,t){return $e(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){$e(this.size),e=e===void 0?`,`:``+e;var t=``,n=!0;return this.__iterate(function(r){n?n=!1:t+=e,t+=r==null?``:r.toString()}),t},keys:function(){return this.__iterator(ee)},map:function(e,t){return X(this,nn(this,e,t))},reduce:function(e,t,n){$e(this.size);var r,i;return arguments.length<2?i=!0:r=t,this.__iterate(function(t,a,o){i?(i=!1,r=t):r=e.call(n,r,t,a,o)}),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return X(this,rn(this,!0))},slice:function(e,t){return X(this,cn(this,e,t,!0))},some:function(e,t){return!this.every(rr(e),t)},sort:function(e){return X(this,hn(this,e))},values:function(){return this.__iterator(N)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return this.size===void 0?!this.some(function(){return!0}):this.size===0},count:function(e,t){return E(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return on(this,e,t)},equals:function(e){return Oe(this,e)},entrySeq:function(){var e=this;if(e._cache)return new de(e._cache);var t=e.toSeq().map(nr).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(rr(e),t)},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},first:function(){return this.find(O)},flatMap:function(e,t){return X(this,pn(this,e,t))},flatten:function(e){return X(this,fn(this,e,!0))},fromEntrySeq:function(){return new en(this)},get:function(e,t){return this.find(function(t,n){return V(n,e)},void 0,t)},getIn:function(e,t){for(var n=this,r=Tn(e),i;!(i=r.next()).done;){var a=i.value;if(n=n&&n.get?n.get(a,y):y,n===y)return t}return n},groupBy:function(e,t){return sn(this,e,t)},has:function(e){return this.get(e,y)!==y},hasIn:function(e){return this.getIn(e,y)!==y},isSubset:function(e){return e=typeof e.includes==`function`?e:n(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return e=typeof e.isSubset==`function`?e:n(e),e.isSubset(this)},keySeq:function(){return this.toSeq().map(tr).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(e){return gn(this,e)},maxBy:function(e,t){return gn(this,t,e)},min:function(e){return gn(this,e?ir(e):sr)},minBy:function(e,t){return gn(this,t?ir(t):sr,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return X(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return X(this,un(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(rr(e),t)},sortBy:function(e,t){return X(this,hn(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return X(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return X(this,ln(this,e,t))},takeUntil:function(e,t){return this.takeWhile(rr(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||=cr(this)}});var $n=n.prototype;$n[d]=!0,$n[F]=$n.values,$n.__toJS=$n.toArray,$n.__toStringMapper=ar,$n.inspect=$n.toSource=function(){return this.toString()},$n.chain=$n.flatMap,$n.contains=$n.includes,(function(){try{Object.defineProperty($n,"length",{get:function(){if(!n.noLengthWarning){var e;try{throw Error()}catch(t){e=t.stack}if(e.indexOf(`_wrapObject`)===-1)return console&&console.warn&&console.warn(`iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. `+e),this.size}}})}catch{}})(),Qn(r,{flip:function(){return X(this,tn(this))},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLastKey:function(e,t){return this.toSeq().reverse().findKey(e,t)},keyOf:function(e){return this.findKey(function(t){return V(t,e)})},lastKeyOf:function(e){return this.findLastKey(function(t){return V(t,e)})},mapEntries:function(e,t){var n=this,r=0;return X(this,this.toSeq().map(function(i,a){return e.call(t,[a,i],r++,n)}).fromEntrySeq())},mapKeys:function(e,t){var n=this;return X(this,this.toSeq().flip().map(function(r,i){return e.call(t,r,i,n)}).flip())}});var er=r.prototype;er[f]=!0,er[F]=$n.entries,er.__toJS=$n.toObject,er.__toStringMapper=function(e,t){return JSON.stringify(t)+`: `+ar(e)},Qn(i,{toKeyedSeq:function(){return new Zt(this,!1)},filter:function(e,t){return X(this,an(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.toKeyedSeq().keyOf(e);return t===void 0?-1:t},lastIndexOf:function(e){var t=this.toKeyedSeq().reverse().keyOf(e);return t===void 0?-1:t},reverse:function(){return X(this,rn(this,!1))},slice:function(e,t){return X(this,cn(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(t|0,0),n===0||n===2&&!t)return this;e=A(e,e<0?this.count():this.size);var r=this.slice(0,e);return X(this,n===1?r:r.concat(T(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.toKeyedSeq().findLastKey(e,t);return n===void 0?-1:n},first:function(){return this.get(0)},flatten:function(e){return X(this,fn(this,e,!1))},get:function(e,t){return e=D(this,e),e<0||this.size===1/0||this.size!==void 0&&e>this.size?t:this.find(function(t,n){return n===e},void 0,t)},has:function(e){return e=D(this,e),e>=0&&(this.size===void 0?this.indexOf(e)!==-1:this.size===1/0||e<this.size)},interpose:function(e){return X(this,mn(this,e))},interleave:function(){var e=[this].concat(T(arguments)),t=vn(this.toSeq(),B.of,e),n=t.flatten(!0);return t.size&&(n.size=t.size*e.length),X(this,n)},last:function(){return this.get(-1)},skipWhile:function(e,t){return X(this,un(this,e,t,!1))},zip:function(){var e=[this].concat(T(arguments));return X(this,vn(this,or,e))},zipWith:function(e){var t=T(arguments);return t[0]=this,X(this,vn(this,e,t))}}),i.prototype[p]=!0,i.prototype[m]=!0,Qn(a,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),a.prototype.has=$n.includes,Qn(ce,r.prototype),Qn(B,i.prototype),Qn(le,a.prototype),Qn(Fe,r.prototype),Qn(Ie,i.prototype),Qn(Le,a.prototype);function tr(e,t){return t}function nr(e,t){return[t,e]}function rr(e){return function(){return!e.apply(this,arguments)}}function ir(e){return function(){return-e.apply(this,arguments)}}function ar(e){return typeof e==`string`?JSON.stringify(e):e}function or(){return T(arguments)}function sr(e,t){return e<t?1:e>t?-1:0}function cr(e){if(e.size===1/0)return 0;var t=u(e),n=s(e),r=+!!t;return lr(e.__iterate(n?t?function(e,t){r=31*r+ur(Be(e),Be(t))|0}:function(e,t){r=r+ur(Be(e),Be(t))|0}:t?function(e){r=31*r+Be(e)|0}:function(e){r=r+Be(e)|0}),r)}function lr(e,t){return t=Re(t,3432918353),t=Re(t<<15|t>>>-15,461845907),t=Re(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=Re(t^t>>>16,2246822507),t=Re(t^t>>>13,3266489909),t=ze(t^t>>>16),t}function ur(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return{Iterable:n,Seq:z,Collection:Pe,Map:W,OrderedMap:Gt,List:q,Stack:Gn,Set:Z,OrderedSet:zn,Record:En,Range:Me,Repeat:ke,is:V,fromJS:we}})})),Ir=t(((e,t)=>{var n=Q().OrderedMap;t.exports={createFromArray:function(e){return n(e.map(function(e){return[e.getKey(),e]}))}}})),Lr=t(((e,t)=>{function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var r=Q(),i=r.Map,a=r.OrderedSet,o=r.Record,s=a(),c={style:s,entity:null},l=function(e){n(t,e);function t(){return e.apply(this,arguments)||this}var r=t.prototype;return r.getStyle=function(){return this.get(`style`)},r.getEntity=function(){return this.get(`entity`)},r.hasStyle=function(e){return this.getStyle().includes(e)},t.applyStyle=function(e,n){var r=e.set(`style`,e.getStyle().add(n));return t.create(r)},t.removeStyle=function(e,n){var r=e.set(`style`,e.getStyle().remove(n));return t.create(r)},t.applyEntity=function(e,n){var r=e.getEntity()===n?e:e.set(`entity`,n);return t.create(r)},t.create=function(e){if(!e)return u;var n=i({style:s,entity:null}).merge(e),r=d.get(n);if(r)return r;var a=new t(n);return d=d.set(n,a),a},t.fromJS=function(e){var n=e.style,r=e.entity;return new t({style:Array.isArray(n)?a(n):n,entity:Array.isArray(r)?a(r):r})},t}(o(c)),u=new l,d=i([[i(c),u]]);l.EMPTY=u,t.exports=l})),Rr=t(((e,t)=>{function n(e,t,n,r){if(e.size){var i=0;e.reduce(function(e,a,o){return t(e,a)||(n(e)&&r(i,o),i=o),a}),n(e.last())&&r(i,e.count())}}t.exports=n})),zr=t(((e,t)=>{function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var r=Lr(),i=Rr(),a=Q(),o=a.List,s=a.Map,c=a.OrderedSet,l=a.Record,u=a.Repeat,d=c(),f=l({key:``,type:`unstyled`,text:``,characterList:o(),depth:0,data:s()}),p=function(e){if(!e)return e;var t=e.characterList,n=e.text;return n&&!t&&(e.characterList=o(u(r.EMPTY,n.length))),e},m=function(e){n(t,e);function t(t){return e.call(this,p(t))||this}var r=t.prototype;return r.getKey=function(){return this.get(`key`)},r.getType=function(){return this.get(`type`)},r.getText=function(){return this.get(`text`)},r.getCharacterList=function(){return this.get(`characterList`)},r.getLength=function(){return this.getText().length},r.getDepth=function(){return this.get(`depth`)},r.getData=function(){return this.get(`data`)},r.getInlineStyleAt=function(e){var t=this.getCharacterList().get(e);return t?t.getStyle():d},r.getEntityAt=function(e){var t=this.getCharacterList().get(e);return t?t.getEntity():null},r.findStyleRanges=function(e,t){i(this.getCharacterList(),h,e,t)},r.findEntityRanges=function(e,t){i(this.getCharacterList(),g,e,t)},t}(f);function h(e,t){return e.getStyle()===t.getStyle()}function g(e,t){return e.getEntity()===t.getEntity()}t.exports=m})),Br=t(((e,t)=>{function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var r=Lr(),i=Rr(),a=Q(),o=a.List,s=a.Map,c=a.OrderedSet,l=a.Record,u=a.Repeat,d=c(),f={parent:null,characterList:o(),data:s(),depth:0,key:``,text:``,type:`unstyled`,children:o(),prevSibling:null,nextSibling:null},p=function(e,t){return e.getStyle()===t.getStyle()},m=function(e,t){return e.getEntity()===t.getEntity()},h=function(e){if(!e)return e;var t=e.characterList,n=e.text;return n&&!t&&(e.characterList=o(u(r.EMPTY,n.length))),e};t.exports=function(e){n(t,e);function t(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f;return e.call(this,h(t))||this}var r=t.prototype;return r.getKey=function(){return this.get(`key`)},r.getType=function(){return this.get(`type`)},r.getText=function(){return this.get(`text`)},r.getCharacterList=function(){return this.get(`characterList`)},r.getLength=function(){return this.getText().length},r.getDepth=function(){return this.get(`depth`)},r.getData=function(){return this.get(`data`)},r.getInlineStyleAt=function(e){var t=this.getCharacterList().get(e);return t?t.getStyle():d},r.getEntityAt=function(e){var t=this.getCharacterList().get(e);return t?t.getEntity():null},r.getChildKeys=function(){return this.get(`children`)},r.getParentKey=function(){return this.get(`parent`)},r.getPrevSiblingKey=function(){return this.get(`prevSibling`)},r.getNextSiblingKey=function(){return this.get(`nextSibling`)},r.findStyleRanges=function(e,t){i(this.getCharacterList(),p,e,t)},r.findEntityRanges=function(e,t){i(this.getCharacterList(),m,e,t)},t}(l(f))})),Vr=t(((e,t)=>{var n=Lr(),r=Q().Map,i={add:function(e,t,n){return a(e,t,n,!0)},remove:function(e,t,n){return a(e,t,n,!1)}};function a(e,t,i,a){var o=e.getBlockMap(),s=t.getStartKey(),c=t.getStartOffset(),l=t.getEndKey(),u=t.getEndOffset(),d=o.skipUntil(function(e,t){return t===s}).takeUntil(function(e,t){return t===l}).concat(r([[l,o.get(l)]])).map(function(e,t){var r,o;s===l?(r=c,o=u):(r=t===s?c:0,o=t===l?u:e.getLength());for(var d=e.getCharacterList(),f;r<o;)f=d.get(r),d=d.set(r,a?n.applyStyle(f,i):n.removeStyle(f,i)),r++;return e.set(`characterList`,d)});return e.merge({blockMap:o.merge(d),selectionBefore:t,selectionAfter:t})}t.exports=i})),Hr=t(((e,t)=>{var n=Lr();function r(e,t,r,i){for(var a=t,o=e.getCharacterList();a<r;)o=o.set(a,n.applyEntity(o.get(a),i)),a++;return e.set(`characterList`,o)}t.exports=r})),Ur=t(((e,t)=>{var n=Hr(),r=Q();function i(e,t,i){var a=e.getBlockMap(),o=t.getStartKey(),s=t.getStartOffset(),c=t.getEndKey(),l=t.getEndOffset(),u=a.skipUntil(function(e,t){return t===o}).takeUntil(function(e,t){return t===c}).toOrderedMap().merge(r.OrderedMap([[c,a.get(c)]])).map(function(e,t){return n(e,t===o?s:0,t===c?l:e.getLength(),i)});return e.merge({blockMap:a.merge(u),selectionBefore:t,selectionAfter:t})}t.exports=i})),Wr=t(((e,t)=>{t.exports={getRemovalRange:function(e,t,n,r,i){var a=n.split(` `);a=a.map(function(e,t){if(i===`forward`){if(t>0)return` `+e}else if(t<a.length-1)return e+` `;return e});for(var o=r,s,c,l=null,u=null,d=0;d<a.length;d++){if(c=a[d],s=o+c.length,e<s&&o<t)l===null&&(l=o),u=s;else if(l!==null)break;o=s}var f=r+n.length,p=l===r,m=u===f;return(!p&&m||p&&!m)&&(i===`forward`?u!==f&&u++:l!==r&&l--),{start:l,end:u}}}})),$=t(((e,t)=>{function n(e,t){var n=[...arguments].slice(2);if(!e){var r;if(t===void 0)r=Error(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var i=0;r=Error(t.replace(/%s/g,function(){return String(n[i++])})),r.name=`Invariant Violation`}throw r.framesToPop=1,r}}t.exports=n})),Gr=t(((e,t)=>{var n=$();function r(e,t){var r=[];return e.findEntityRanges(function(e){return e.getEntity()===t},function(e,t){r.push({start:e,end:t})}),!r.length&&n(!1),r}t.exports=r})),Kr=t(((e,t)=>{var n=Wr(),r=Gr(),i=$();function a(e,t,n,r,i){var a=r.getStartOffset(),s=r.getEndOffset(),c=t.getEntityAt(a),l=n.getEntityAt(s-1);if(!c&&!l)return r;var u=r;if(c&&c===l)u=o(e,t,u,i,c,!0,!0);else if(c&&l){var d=o(e,t,u,i,c,!1,!0),f=o(e,n,u,i,l,!1,!1);u=u.merge({anchorOffset:d.getAnchorOffset(),focusOffset:f.getFocusOffset(),isBackward:!1})}else if(c){var p=o(e,t,u,i,c,!1,!0);u=u.merge({anchorOffset:p.getStartOffset(),isBackward:!1})}else if(l){var m=o(e,n,u,i,l,!1,!1);u=u.merge({focusOffset:m.getEndOffset(),isBackward:!1})}return u}function o(e,t,a,o,s,c,l){var u=a.getStartOffset(),d=a.getEndOffset(),f=e.__get(s).getMutability(),p=l?u:d;if(f===`MUTABLE`)return a;var m=r(t,s).filter(function(e){return p<=e.end&&p>=e.start});m.length!=1&&i(!1);var h=m[0];if(f===`IMMUTABLE`)return a.merge({anchorOffset:h.start,focusOffset:h.end,isBackward:!1});c||(l?d=h.end:u=h.start);var g=n.getRemovalRange(u,d,t.getText().slice(h.start,h.end),h.start,o);return a.merge({anchorOffset:g.start,focusOffset:g.end,isBackward:!1})}t.exports=a})),qr=t(((e,t)=>{var n={},r=2**24;function i(){for(var e;e===void 0||n.hasOwnProperty(e)||!isNaN(+e);)e=Math.floor(Math.random()*r).toString(32);return n[e]=!0,e}t.exports=i})),Jr=t(((e,t)=>{var n=Br(),r=qr(),i=Q().OrderedMap,a=function(e){var t={},n;return i(e.withMutations(function(e){e.forEach(function(i,a){var o=i.getKey(),s=i.getNextSiblingKey(),c=i.getPrevSiblingKey(),l=i.getChildKeys(),u=i.getParentKey(),d=r();if(t[o]=d,s&&(e.get(s)?e.setIn([s,`prevSibling`],d):e.setIn([o,`nextSibling`],null)),c&&(e.get(c)?e.setIn([c,`nextSibling`],d):e.setIn([o,`prevSibling`],null)),u&&e.get(u)){var f=e.get(u).getChildKeys();e.setIn([u,`children`],f.set(f.indexOf(i.getKey()),d))}else e.setIn([o,`parent`],null),n&&(e.setIn([n.getKey(),`nextSibling`],d),e.setIn([o,`prevSibling`],t[n.getKey()])),n=e.get(o);l.forEach(function(t){e.get(t)?e.setIn([t,`parent`],d):e.setIn([o,`children`],i.getChildKeys().filter(function(e){return e!==t}))})})}).toArray().map(function(e){return[t[e.getKey()],e.set(`key`,t[e.getKey()])]}))},o=function(e){return i(e.toArray().map(function(e){var t=r();return[t,e.set(`key`,t)]}))};t.exports=function(e){return e.first()instanceof n?a(e):o(e)}})),Yr=t(((e,t)=>{var n=Lr(),r=Rr(),i=$();function a(e,t){var n=e.getBlockMap(),r=e.getEntityMap(),i={},a=t.getStartKey(),o=t.getStartOffset(),c=n.get(a),l=s(r,c,o);l!==c&&(i[a]=l);var u=t.getEndKey(),d=t.getEndOffset(),f=n.get(u);a===u&&(f=l);var p=s(r,f,d);return p!==f&&(i[u]=p),Object.keys(i).length?e.merge({blockMap:n.merge(i),selectionAfter:t}):e.set(`selectionAfter`,t)}function o(e,t,n){var a;return r(e,function(e,t){return e.getEntity()===t.getEntity()},function(e){return e.getEntity()===t},function(e,t){e<=n&&t>=n&&(a={start:e,end:t})}),typeof a!=`object`&&i(!1),a}function s(e,t,r){var i=t.getCharacterList(),a=r>0?i.get(r-1):void 0,s=r<i.count()?i.get(r):void 0,c=a?a.getEntity():void 0,l=s?s.getEntity():void 0;if(l&&l===c&&e.__get(l).getMutability()!==`MUTABLE`){for(var u=o(i,l,r),d=u.start,f=u.end,p;d<f;)p=i.get(d),i=i.set(d,n.applyEntity(p,null)),d++;return t.set(`characterList`,i)}return t}t.exports=a})),Xr=t(((e,t)=>{var n=Jr(),r=Yr();t.exports=function(e,t){var i=t.getStartKey(),a=t.getStartOffset(),o=t.getEndKey(),s=t.getEndOffset(),c=r(e,t).getBlockMap(),l=c.keySeq(),u=l.indexOf(i),d=l.indexOf(o)+1;return n(c.slice(u,d).map(function(e,t){var n=e.getText(),r=e.getCharacterList();return i===o?e.merge({text:n.slice(a,s),characterList:r.slice(a,s)}):t===i?e.merge({text:n.slice(a),characterList:r.slice(a)}):t===o?e.merge({text:n.slice(0,s),characterList:r.slice(0,s)}):e}))}})),Zr=t(((e,t)=>{function n(e,t,n){var r=e;if(n===r.count())t.forEach(function(e){r=r.push(e)});else if(n===0)t.reverse().forEach(function(e){r=r.unshift(e)});else{var i=r.slice(0,n),a=r.slice(n);r=i.concat(t,a).toList()}return r}t.exports=n})),Qr=t(((e,t)=>{var n=Ir(),r=Br(),i=Q(),a=Zr(),o=$(),s=Jr(),c=i.List,l=function(e,t,n,r,i,o){var s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:`REPLACE_WITH_NEW_DATA`,c=n.get(i),l=c.getText(),u=c.getCharacterList(),d=i,f=o+r.getText().length,p=null;switch(s){case`MERGE_OLD_DATA_TO_NEW_DATA`:p=r.getData().merge(c.getData());break;case`REPLACE_WITH_NEW_DATA`:p=r.getData();break}var m=c.getType();l&&m===`unstyled`&&(m=r.getType());var h=c.merge({text:l.slice(0,o)+r.getText()+l.slice(o),characterList:a(u,r.getCharacterList(),o),type:m,data:p});return e.merge({blockMap:n.set(i,h),selectionBefore:t,selectionAfter:t.merge({anchorKey:d,anchorOffset:f,focusKey:d,focusOffset:f,isBackward:!1})})},u=function(e,t,n){var r=e.getText(),i=e.getCharacterList(),a=r.slice(0,t),o=i.slice(0,t),s=n.first();return e.merge({text:a+s.getText(),characterList:o.concat(s.getCharacterList()),type:a?e.getType():s.getType(),data:s.getData()})},d=function(e,t,n){var r=e.getText(),i=e.getCharacterList(),a=r.length,o=r.slice(t,a),s=i.slice(t,a),c=n.last();return c.merge({text:c.getText()+o,characterList:c.getCharacterList().concat(s),data:c.getData()})},f=function(e,t){var n=e.getKey(),r=e,i=[];for(t.get(n)&&i.push(n);r&&r.getNextSiblingKey();){var a=r.getNextSiblingKey();if(!a)break;i.push(a),r=t.get(a)}return i},p=function(e,t,n,r){return e.withMutations(function(t){var i=n.getKey(),a=r.getKey(),o=n.getNextSiblingKey(),s=n.getParentKey(),l=f(r,e),u=l[l.length-1];if(t.get(a)?(t.setIn([i,`nextSibling`],a),t.setIn([a,`prevSibling`],i)):(t.setIn([i,`nextSibling`],r.getNextSiblingKey()),t.setIn([r.getNextSiblingKey(),`prevSibling`],i)),t.setIn([u,`nextSibling`],o),o&&t.setIn([o,`prevSibling`],u),l.forEach(function(e){return t.setIn([e,`parent`],s)}),s){var d=e.get(s).getChildKeys(),p=d.indexOf(i)+1,m=d.toArray();m.splice.apply(m,[p,0].concat(l)),t.setIn([s,`children`],c(m))}})},m=function(e,t,i,a,o,s){var c=i.first()instanceof r,l=[],f=a.size,m=i.get(o),h=a.first(),g=a.last(),_=g.getLength(),v=g.getKey(),y=c&&(!m.getChildKeys().isEmpty()||!h.getChildKeys().isEmpty());i.forEach(function(e,t){if(t!==o){l.push(e);return}y?l.push(e):l.push(u(e,s,a)),a.slice(+!y,f-1).forEach(function(e){return l.push(e)}),l.push(d(e,s,a))});var b=n.createFromArray(l);return c&&(b=p(b,i,m,h)),e.merge({blockMap:b,selectionBefore:t,selectionAfter:t.merge({anchorKey:v,anchorOffset:_,focusKey:v,focusOffset:_,isBackward:!1})})};t.exports=function(e,t,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`REPLACE_WITH_NEW_DATA`;!t.isCollapsed()&&o(!1);var a=e.getBlockMap(),c=s(n),u=t.getStartKey(),d=t.getStartOffset(),f=a.get(u);return f instanceof r&&!f.getChildKeys().isEmpty()&&o(!1),c.size===1?l(e,t,a,c.first(),u,d,i):m(e,t,a,c,u,d)}})),$r=t(((e,t)=>{var n=Q(),r=Zr(),i=$(),a=n.Repeat;function o(e,t,n,o){!t.isCollapsed()&&i(!1);var s=null;if(n!=null&&(s=n.length),s==null||s===0)return e;var c=e.getBlockMap(),l=t.getStartKey(),u=t.getStartOffset(),d=c.get(l),f=d.getText(),p=d.merge({text:f.slice(0,u)+n+f.slice(u,d.getLength()),characterList:r(d.getCharacterList(),a(o,s).toList(),u)}),m=u+s;return e.merge({blockMap:c.set(l,p),selectionAfter:t.merge({anchorOffset:m,focusOffset:m})})}t.exports=o})),ei=t(((e,t)=>{var n=Q().Map;function r(e,t,r){var i=t.getStartKey(),a=t.getEndKey(),o=e.getBlockMap(),s=o.toSeq().skipUntil(function(e,t){return t===i}).takeUntil(function(e,t){return t===a}).concat(n([[a,o.get(a)]])).map(r);return e.merge({blockMap:o.merge(s),selectionBefore:t,selectionAfter:t})}t.exports=r})),ti=t(((e,t)=>{var n=Br();t.exports=function(e,t){if(!(e instanceof n))return null;var r=e.getNextSiblingKey();if(r)return r;var i=e.getParentKey();if(!i)return null;for(var a=t.get(i);a&&!a.getNextSiblingKey();){var o=a.getParentKey();a=o?t.get(o):null}return a?a.getNextSiblingKey():null}})),ni=t(((e,t)=>{var n=Br(),r=ti(),i=Q();i.List;var a=i.Map,o=function(e,t,n){if(e){var r=t.get(e);r&&t.set(e,n(r))}},s=function(e,t){var n=[];if(!e)return n;for(var r=t.get(e);r&&r.getParentKey();){var i=r.getParentKey();i&&n.push(i),r=i?t.get(i):null}return n},c=function(e,t){var n=[];if(!e)return n;for(var i=r(e,t);i&&t.get(i);){var a=t.get(i);n.push(i),i=a.getParentKey()?r(a,t):null}return n},l=function(e,t,n){if(!e)return null;for(var r=n.get(e.getKey()).getNextSiblingKey();r&&!t.get(r);)r=n.get(r).getNextSiblingKey()||null;return r},u=function(e,t,n){if(!e)return null;for(var r=n.get(e.getKey()).getPrevSiblingKey();r&&!t.get(r);)r=n.get(r).getPrevSiblingKey()||null;return r},d=function(e,t,n,r){return e.withMutations(function(i){if(o(t.getKey(),i,function(e){return e.merge({nextSibling:l(e,i,r),prevSibling:u(e,i,r)})}),o(n.getKey(),i,function(e){return e.merge({nextSibling:l(e,i,r),prevSibling:u(e,i,r)})}),s(t.getKey(),r).forEach(function(e){return o(e,i,function(e){return e.merge({children:e.getChildKeys().filter(function(e){return i.get(e)}),nextSibling:l(e,i,r),prevSibling:u(e,i,r)})})}),o(t.getNextSiblingKey(),i,function(e){return e.merge({prevSibling:t.getPrevSiblingKey()})}),o(t.getPrevSiblingKey(),i,function(e){return e.merge({nextSibling:l(e,i,r)})}),o(n.getNextSiblingKey(),i,function(e){return e.merge({prevSibling:u(e,i,r)})}),o(n.getPrevSiblingKey(),i,function(e){return e.merge({nextSibling:n.getNextSiblingKey()})}),s(n.getKey(),r).forEach(function(e){o(e,i,function(e){return e.merge({children:e.getChildKeys().filter(function(e){return i.get(e)}),nextSibling:l(e,i,r),prevSibling:u(e,i,r)})})}),c(n,r).forEach(function(e){return o(e,i,function(e){return e.merge({nextSibling:l(e,i,r),prevSibling:u(e,i,r)})})}),e.get(t.getKey())==null&&e.get(n.getKey())!=null&&n.getParentKey()===t.getKey()&&n.getPrevSiblingKey()==null){var a=t.getPrevSiblingKey();o(n.getKey(),i,function(e){return e.merge({prevSibling:a})}),o(a,i,function(e){return e.merge({nextSibling:n.getKey()})});var d=a?e.get(a):null,f=d?d.getParentKey():null;if(t.getChildKeys().forEach(function(e){o(e,i,function(e){return e.merge({parent:f})})}),f!=null){var p=e.get(f);o(f,i,function(e){return e.merge({children:p.getChildKeys().concat(t.getChildKeys())})})}o(t.getChildKeys().find(function(t){return e.get(t).getNextSiblingKey()===null}),i,function(e){return e.merge({nextSibling:t.getNextSiblingKey()})})}})},f=function(e,t){if(t.isCollapsed())return e;var i=e.getBlockMap(),o=t.getStartKey(),c=t.getStartOffset(),l=t.getEndKey(),u=t.getEndOffset(),f=i.get(o),m=i.get(l),h=f instanceof n,g=[];if(h){var _=m.getChildKeys(),v=s(l,i);m.getNextSiblingKey()&&(g=g.concat(v)),_.isEmpty()||(g=g.concat(v.concat([l]))),g=g.concat(s(r(m,i),i))}var y=f===m?p(f.getCharacterList(),c,u):f.getCharacterList().slice(0,c).concat(m.getCharacterList().slice(u)),b=f.merge({text:f.getText().slice(0,c)+m.getText().slice(u),characterList:y}),x=h&&c===0&&u===0&&m.getParentKey()===o&&m.getPrevSiblingKey()==null?a([[o,null]]):i.toSeq().skipUntil(function(e,t){return t===o}).takeUntil(function(e,t){return t===l}).filter(function(e,t){return g.indexOf(t)===-1}).concat(a([[l,null]])).map(function(e,t){return t===o?b:null}),S=i.merge(x).filter(function(e){return!!e});return h&&f!==m&&(S=d(S,f,m,i)),e.merge({blockMap:S,selectionBefore:t,selectionAfter:t.merge({anchorKey:o,anchorOffset:c,focusKey:o,focusOffset:c,isBackward:!1})})},p=function(e,t,n){if(t===0)for(;t<n;)e=e.shift(),t++;else if(n===e.count())for(;n>t;)e=e.pop(),n--;else{var r=e.slice(0,t),i=e.slice(n);e=r.concat(i).toList()}return e};t.exports=f})),ri=t(((e,t)=>{var n=Br(),r=qr(),i=Q(),a=$(),o=ei(),s=i.List,c=i.Map,l=function(e,t,n){if(e){var r=t.get(e);r&&t.set(e,n(r))}},u=function(e,t,n){return e.withMutations(function(e){var r=t.getKey(),i=n.getKey();l(t.getParentKey(),e,function(e){var t=e.getChildKeys(),n=t.indexOf(r)+1,a=t.toArray();return a.splice(n,0,i),e.merge({children:s(a)})}),l(t.getNextSiblingKey(),e,function(e){return e.merge({prevSibling:i})}),l(r,e,function(e){return e.merge({nextSibling:i})}),l(i,e,function(e){return e.merge({prevSibling:r})})})};t.exports=function(e,t){!t.isCollapsed()&&a(!1);var i=t.getAnchorKey(),s=e.getBlockMap(),l=s.get(i),d=l.getText();if(!d){var f=l.getType();if(f===`unordered-list-item`||f===`ordered-list-item`)return o(e,t,function(e){return e.merge({type:`unstyled`,depth:0})})}var p=t.getAnchorOffset(),m=l.getCharacterList(),h=r(),g=l instanceof n,_=l.merge({text:d.slice(0,p),characterList:m.slice(0,p)}),v=_.merge({key:h,text:d.slice(p),characterList:m.slice(p),data:c()}),y=s.toSeq().takeUntil(function(e){return e===l}),b=s.toSeq().skipUntil(function(e){return e===l}).rest(),x=y.concat([[i,_],[h,v]],b).toOrderedMap();return g&&(!l.getChildKeys().isEmpty()&&a(!1),x=u(x,_,v)),e.merge({blockMap:x,selectionBefore:t,selectionAfter:t.merge({anchorKey:h,anchorOffset:0,focusKey:h,focusOffset:0,isBackward:!1})})}})),ii=t(((e,t)=>{var n=Lr(),r=Vr(),i=Ur(),a=Kr(),o=Xr(),s=Q(),c=Qr(),l=$r(),u=$(),d=ei(),f=Yr(),p=ni(),m=ri(),h=s.OrderedSet,g={replaceText:function(e,t,r,i,a){var o=p(f(e,t),t),s=n.create({style:i||h(),entity:a||null});return l(o,o.getSelectionAfter(),r,s)},insertText:function(e,t,n,r,i){return!t.isCollapsed()&&u(!1),g.replaceText(e,t,n,r,i)},moveText:function(e,t,n){var r=o(e,t),i=g.removeRange(e,t,`backward`);return g.replaceWithFragment(i,n,r)},replaceWithFragment:function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`REPLACE_WITH_NEW_DATA`,i=p(f(e,t),t);return c(i,i.getSelectionAfter(),n,r)},removeRange:function(e,t,n){var r,i,o,s;t.getIsBackward()&&(t=t.merge({anchorKey:t.getFocusKey(),anchorOffset:t.getFocusOffset(),focusKey:t.getAnchorKey(),focusOffset:t.getAnchorOffset(),isBackward:!1})),r=t.getAnchorKey(),i=t.getFocusKey(),o=e.getBlockForKey(r),s=e.getBlockForKey(i);var c=t.getStartOffset(),l=t.getEndOffset(),u=o.getEntityAt(c),d=s.getEntityAt(l-1);return r===i&&u&&u===d?p(e,a(e.getEntityMap(),o,s,t,n)):p(f(e,t),t)},splitBlock:function(e,t){var n=p(f(e,t),t);return m(n,n.getSelectionAfter())},applyInlineStyle:function(e,t,n){return r.add(e,t,n)},removeInlineStyle:function(e,t,n){return r.remove(e,t,n)},setBlockType:function(e,t,n){return d(e,t,function(e){return e.merge({type:n,depth:0})})},setBlockData:function(e,t,n){return d(e,t,function(e){return e.merge({data:n})})},mergeBlockData:function(e,t,n){return d(e,t,function(e){return e.merge({data:e.getData().merge(n)})})},applyEntity:function(e,t,n){return i(f(e,t),t,n)}};t.exports=g})),ai=t(((e,t)=>{function n(e){return Object.keys(e).map(function(t){return e[t]})}t.exports=n})),oi=t(((e,t)=>{function n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],i=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(t){r(e,t,n[t])})}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var a=Rr(),o=ai(),s=Q(),c=s.List,l=s.Repeat,u=s.Record,d=function(){return!0},f=u({start:null,end:null}),p=u({start:null,end:null,decoratorKey:null,leaves:null}),m={generate:function(e,t,n){var r=t.getLength();if(!r)return c.of(new p({start:0,end:0,decoratorKey:null,leaves:c.of(new f({start:0,end:0}))}));var i=[],o=n?n.getDecorations(t,e):c(l(null,r)),s=t.getCharacterList();return a(o,g,d,function(e,t){i.push(new p({start:e,end:t,decoratorKey:o.get(e),leaves:h(s.slice(e,t).toList(),e)}))}),c(i)},fromJS:function(e){var t=e.leaves;return new p(n({},i(e,[`leaves`]),{leaves:t==null?null:c(Array.isArray(t)?t:o(t)).map(function(e){return f(e)})}))}};function h(e,t){var n=[];return a(e.map(function(e){return e.getStyle()}).toList(),g,d,function(e,r){n.push(new f({start:e+t,end:r+t}))}),c(n)}function g(e,t){return e===t}t.exports=m})),si=t(((e,t)=>{function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var r=Q().Record;t.exports=function(e){n(t,e);function t(){return e.apply(this,arguments)||this}var r=t.prototype;return r.getType=function(){return this.get(`type`)},r.getMutability=function(){return this.get(`mutability`)},r.getData=function(){return this.get(`data`)},t}(r({type:`TOKEN`,mutability:`IMMUTABLE`,data:Object}))})),ci=t(((e,t)=>{function n(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(e){var t=Math.random()*16|0;return(e==`x`?t:t&3|8).toString(16)})}t.exports=n})),li=t(((e,t)=>{function n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],i=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(t){r(e,t,n[t])})}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=si(),a=Q(),o=$(),s=ci(),c=a.Map,l=c(),u=s();function d(e,t){console.warn(`WARNING: `+e+` will be deprecated soon!
|
|
3
3
|
Please use "`+t+`" instead.`)}var f={getLastCreatedEntityKey:function(){return d(`DraftEntity.getLastCreatedEntityKey`,`contentState.getLastCreatedEntityKey`),f.__getLastCreatedEntityKey()},create:function(e,t,n){return d(`DraftEntity.create`,`contentState.createEntity`),f.__create(e,t,n)},add:function(e){return d(`DraftEntity.add`,`contentState.addEntity`),f.__add(e)},get:function(e){return d(`DraftEntity.get`,`contentState.getEntity`),f.__get(e)},__getAll:function(){return l},__loadWithEntities:function(e){l=e,u=s()},mergeData:function(e,t){return d(`DraftEntity.mergeData`,`contentState.mergeEntityData`),f.__mergeData(e,t)},replaceData:function(e,t){return d(`DraftEntity.replaceData`,`contentState.replaceEntityData`),f.__replaceData(e,t)},__getLastCreatedEntityKey:function(){return u},__create:function(e,t,n){return f.__add(new i({type:e,mutability:t,data:n||{}}))},__add:function(e){return u=s(),l=l.set(u,e),u},__get:function(e){var t=l.get(e);return!t&&o(!1),t},__mergeData:function(e,t){var r=f.__get(e),i=n({},r.getData(),t),a=r.set(`data`,i);return l=l.set(e,a),a},__replaceData:function(e,t){var n=f.__get(e).set(`data`,t);return l=l.set(e,n),n}};t.exports=f})),ui=t(((e,t)=>{function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var r=Q().Record;t.exports=function(e){n(t,e);function t(){return e.apply(this,arguments)||this}var r=t.prototype;return r.serialize=function(){return`Anchor: `+this.getAnchorKey()+`:`+this.getAnchorOffset()+`, Focus: `+this.getFocusKey()+`:`+this.getFocusOffset()+`, Is Backward: `+String(this.getIsBackward())+`, Has Focus: `+String(this.getHasFocus())},r.getAnchorKey=function(){return this.get(`anchorKey`)},r.getAnchorOffset=function(){return this.get(`anchorOffset`)},r.getFocusKey=function(){return this.get(`focusKey`)},r.getFocusOffset=function(){return this.get(`focusOffset`)},r.getIsBackward=function(){return this.get(`isBackward`)},r.getHasFocus=function(){return this.get(`hasFocus`)},r.hasEdgeWithin=function(e,t,n){var r=this.getAnchorKey(),i=this.getFocusKey();if(r===i&&r===e){var a=this.getStartOffset(),o=this.getEndOffset();return t<=a&&a<=n||t<=o&&o<=n}if(e!==r&&e!==i)return!1;var s=e===r?this.getAnchorOffset():this.getFocusOffset();return t<=s&&n>=s},r.isCollapsed=function(){return this.getAnchorKey()===this.getFocusKey()&&this.getAnchorOffset()===this.getFocusOffset()},r.getStartKey=function(){return this.getIsBackward()?this.getFocusKey():this.getAnchorKey()},r.getStartOffset=function(){return this.getIsBackward()?this.getFocusOffset():this.getAnchorOffset()},r.getEndKey=function(){return this.getIsBackward()?this.getAnchorKey():this.getFocusKey()},r.getEndOffset=function(){return this.getIsBackward()?this.getAnchorOffset():this.getFocusOffset()},t.createEmpty=function(e){return new t({anchorKey:e,anchorOffset:0,focusKey:e,focusOffset:0,isBackward:!1,hasFocus:!1})},t}(r({anchorKey:``,anchorOffset:0,focusKey:``,focusOffset:0,isBackward:!1,hasFocus:!1}))})),di=t(((e,t)=>{t.exports=function(e){return typeof window<`u`&&window.__DRAFT_GKX?!!window.__DRAFT_GKX[e]:!1}})),fi=t(((e,t)=>{var n=RegExp(`\r`,`g`);function r(e){return e.replace(n,``)}t.exports=r})),pi=t(((e,t)=>{function n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],i=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(t){r(e,t,n[t])})}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var a=Ir(),o=Lr(),s=zr(),c=Br(),l=li(),u=ui(),d=qr(),f=ai(),p=di(),m=Q(),h=fi(),g=m.List,_=m.Record,v=m.Repeat,y=m.Map,b=m.OrderedMap,x=_({entityMap:null,blockMap:null,selectionBefore:null,selectionAfter:null}),S=p(`draft_tree_data_support`)?c:s;t.exports=function(e){i(t,e);function t(){return e.apply(this,arguments)||this}var r=t.prototype;return r.getEntityMap=function(){return l},r.getBlockMap=function(){return this.get(`blockMap`)},r.getSelectionBefore=function(){return this.get(`selectionBefore`)},r.getSelectionAfter=function(){return this.get(`selectionAfter`)},r.getBlockForKey=function(e){return this.getBlockMap().get(e)},r.getKeyBefore=function(e){return this.getBlockMap().reverse().keySeq().skipUntil(function(t){return t===e}).skip(1).first()},r.getKeyAfter=function(e){return this.getBlockMap().keySeq().skipUntil(function(t){return t===e}).skip(1).first()},r.getBlockAfter=function(e){return this.getBlockMap().skipUntil(function(t,n){return n===e}).skip(1).first()},r.getBlockBefore=function(e){return this.getBlockMap().reverse().skipUntil(function(t,n){return n===e}).skip(1).first()},r.getBlocksAsArray=function(){return this.getBlockMap().toArray()},r.getFirstBlock=function(){return this.getBlockMap().first()},r.getLastBlock=function(){return this.getBlockMap().last()},r.getPlainText=function(e){return this.getBlockMap().map(function(e){return e?e.getText():``}).join(e||`
|
|
4
4
|
`)},r.getLastCreatedEntityKey=function(){return l.__getLastCreatedEntityKey()},r.hasText=function(){var e=this.getBlockMap();return e.size>1||escape(e.first().getText()).replace(/%u200B/g,``).length>0},r.createEntity=function(e,t,n){return l.__create(e,t,n),this},r.mergeEntityData=function(e,t){return l.__mergeData(e,t),this},r.replaceEntityData=function(e,t){return l.__replaceData(e,t),this},r.addEntity=function(e){return l.__add(e),this},r.getEntity=function(e){return l.__get(e)},r.getAllEntities=function(){return l.__getAll()},r.loadWithEntities=function(e){return l.__loadWithEntities(e)},t.createFromBlockArray=function(e,n){var r=Array.isArray(e)?e:e.contentBlocks,i=a.createFromArray(r),o=i.isEmpty()?new u:u.createEmpty(i.first().getKey());return new t({blockMap:i,entityMap:n||l,selectionBefore:o,selectionAfter:o})},t.createFromText=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:/\r\n?|\n/g,r=e.split(n).map(function(e){return e=h(e),new S({key:d(),text:e,type:`unstyled`,characterList:g(v(o.EMPTY,e.length))})});return t.createFromBlockArray(r)},t.fromJS=function(e){return new t(n({},e,{blockMap:b(e.blockMap).map(t.createContentBlockFromJS),selectionBefore:new u(e.selectionBefore),selectionAfter:new u(e.selectionAfter)}))},t.createContentBlockFromJS=function(e){var t=e.characterList;return new S(n({},e,{data:y(e.data),characterList:t==null?void 0:g((Array.isArray(t)?t:f(t)).map(function(e){return o.fromJS(e)}))}))},t}(x)})),mi=t(((e,t)=>{var n=$(),r=`NEUTRAL`,i=`LTR`,a=`RTL`,o=null;function s(e){return e===i||e===a}function c(e){return!s(e)&&n(!1),e===i?`ltr`:`rtl`}function l(e,t){return!s(e)&&n(!1),!s(t)&&n(!1),e===t?null:c(e)}function u(e){o=e}function d(){u(i)}function f(){return o||this.initGlobalDir(),!o&&n(!1),o}t.exports={NEUTRAL:r,LTR:i,RTL:a,isStrong:s,getHTMLDir:c,getHTMLDirIfDifferent:l,setGlobalDir:u,initGlobalDir:d,getGlobalDir:f}})),hi=t(((e,t)=>{var n=mi(),r=$(),i={L:`A-Za-zªµºÀ-ÖØ-öø-ƺƻƼ-ƿǀ-ǃDŽ-ʓʔʕ-ʯʰ-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͷͺͻ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҂Ҋ-ԯԱ-Ֆՙ՚-՟ա-և։ःऄ-हऻऽा-ीॉ-ौॎ-ॏॐक़-ॡ।-॥०-९॰ॱॲ-ঀং-ঃঅ-ঌএ-ঐও-নপ-রলশ-হঽা-ীে-ৈো-ৌৎৗড়-ঢ়য়-ৡ০-৯ৰ-ৱ৴-৹৺ਃਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽા-ીૉો-ૌૐૠ-ૡ૦-૯૰ଂ-ଃଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽାୀେ-ୈୋ-ୌୗଡ଼-ଢ଼ୟ-ୡ୦-୯୰ୱ୲-୷ஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹா-ிு-ூெ-ைொ-ௌௐௗ௦-௯௰-௲ఁ-ఃఅ-ఌఎ-ఐఒ-నప-హఽు-ౄౘ-ౙౠ-ౡ౦-౯౿ಂ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽಾಿೀ-ೄೆೇ-ೈೊ-ೋೕ-ೖೞೠ-ೡ೦-೯ೱ-ೲം-ഃഅ-ഌഎ-ഐഒ-ഺഽാ-ീെ-ൈൊ-ൌൎൗൠ-ൡ൦-൯൰-൵൹ൺ-ൿං-ඃඅ-ඖක-නඳ-රලව-ෆා-ෑෘ-ෟ෦-෯ෲ-ෳ෴ก-ะา-ำเ-ๅๆ๏๐-๙๚-๛ກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆ໐-໙ໜ-ໟༀ༁-༃༄-༒༓༔༕-༗༚-༟༠-༩༪-༳༴༶༸༾-༿ཀ-ཇཉ-ཬཿ྅ྈ-ྌ྾-࿅࿇-࿌࿎-࿏࿐-࿔࿕-࿘࿙-࿚က-ဪါ-ာေးျ-ြဿ၀-၉၊-၏ၐ-ၕၖ-ၗၚ-ၝၡၢ-ၤၥ-ၦၧ-ၭၮ-ၰၵ-ႁႃ-ႄႇ-ႌႎႏ႐-႙ႚ-ႜ႞-႟Ⴀ-ჅჇჍა-ჺ჻ჼჽ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፠-፨፩-፼ᎀ-ᎏᎠ-Ᏼᐁ-ᙬ᙭-᙮ᙯ-ᙿᚁ-ᚚᚠ-ᛪ᛫-᛭ᛮ-ᛰᛱ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵-᜶ᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳាើ-ៅះ-ៈ។-៖ៗ៘-៚ៜ០-៩᠐-᠙ᠠ-ᡂᡃᡄ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰ-ᤱᤳ-ᤸ᥆-᥏ᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧀᧁ-ᧇᧈ-ᧉ᧐-᧙᧚ᨀ-ᨖᨙ-ᨚ᨞-᨟ᨠ-ᩔᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪉᪐-᪙᪠-᪦ᪧ᪨-᪭ᬄᬅ-ᬳᬵᬻᬽ-ᭁᭃ-᭄ᭅ-ᭋ᭐-᭙᭚-᭠᭡-᭪᭴-᭼ᮂᮃ-ᮠᮡᮦ-ᮧ᮪ᮮ-ᮯ᮰-᮹ᮺ-ᯥᯧᯪ-ᯬᯮ᯲-᯳᯼-᯿ᰀ-ᰣᰤ-ᰫᰴ-ᰵ᰻-᰿᱀-᱉ᱍ-ᱏ᱐-᱙ᱚ-ᱷᱸ-ᱽ᱾-᱿᳀-᳇᳓᳡ᳩ-ᳬᳮ-ᳱᳲ-ᳳᳵ-ᳶᴀ-ᴫᴬ-ᵪᵫ-ᵷᵸᵹ-ᶚᶛ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℴℵ-ℸℹℼ-ℿⅅ-ⅉⅎ⅏Ⅰ-ↂↃ-ↄↅ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-Ⱞⰰ-ⱞⱠ-ⱻⱼ-ⱽⱾ-ⳤⳫ-ⳮⳲ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々〆〇〡-〩〮-〯〱-〵〸-〺〻〼ぁ-ゖゝ-ゞゟァ-ヺー-ヾヿㄅ-ㄭㄱ-ㆎ㆐-㆑㆒-㆕㆖-㆟ㆠ-ㆺㇰ-ㇿ㈀-㈜㈠-㈩㈪-㉇㉈-㉏㉠-㉻㉿㊀-㊉㊊-㊰㋀-㋋㋐-㋾㌀-㍶㍻-㏝㏠-㏾㐀-䶵一-鿌ꀀ-ꀔꀕꀖ-ꒌꓐ-ꓷꓸ-ꓽ꓾-꓿ꔀ-ꘋꘌꘐ-ꘟ꘠-꘩ꘪ-ꘫꙀ-ꙭꙮꚀ-ꚛꚜ-ꚝꚠ-ꛥꛦ-ꛯ꛲-꛷Ꜣ-ꝯꝰꝱ-ꞇ꞉-꞊Ꞌ-ꞎꞐ-ꞭꞰ-Ʇꟷꟸ-ꟹꟺꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꠣ-ꠤꠧ꠰-꠵꠶-꠷ꡀ-ꡳꢀ-ꢁꢂ-ꢳꢴ-ꣃ꣎-꣏꣐-꣙ꣲ-ꣷ꣸-꣺ꣻ꤀-꤉ꤊ-ꤥ꤮-꤯ꤰ-ꥆꥒ-꥓꥟ꥠ-ꥼꦃꦄ-ꦲꦴ-ꦵꦺ-ꦻꦽ-꧀꧁-꧍ꧏ꧐-꧙꧞-꧟ꧠ-ꧤꧦꧧ-ꧯ꧰-꧹ꧺ-ꧾꨀ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ꩐-꩙꩜-꩟ꩠ-ꩯꩰꩱ-ꩶ꩷-꩹ꩺꩻꩽꩾ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂꫛ-ꫜꫝ꫞-꫟ꫠ-ꫪꫫꫮ-ꫯ꫰-꫱ꫲꫳ-ꫴꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚ꭛ꭜ-ꭟꭤ-ꭥꯀ-ꯢꯣ-ꯤꯦ-ꯧꯩ-ꯪ꯫꯬꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ-豈-舘並-龎ff-stﬓ-ﬗA-Za-zヲ-ッーア-ン゙-゚ᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,R:`־׀׃׆-א-ת-ׯװ-ײ׳-״-߀-߉ߊ-ߪߴ-ߵߺ-߿ࠀ-ࠕࠚࠤࠨ-࠰-࠾ࡀ-ࡘ-࡞-࢟יִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﭏ`,AL:`؈؋؍؛؝؞-؟ؠ-ؿـف-ي٭ٮ-ٯٱ-ۓ۔ەۥ-ۦۮ-ۯۺ-ۼ۽-۾ۿ܀-܍ܐܒ-ܯ-ݍ-ޥޱ-ࢠ-ࢲࢳ-ࣣﭐ-ﮱ﮲-﯁﯂-ﯓ-ﴽ﵀-﵏ﵐ-ﶏ-ﶒ-ﷇ-﷏ﷰ-ﷻ﷼﷾-﷿ﹰ-ﹴﹶ-ﻼ-`},a=RegExp(`[`+i.L+i.R+i.AL+`]`),o=RegExp(`[`+i.R+i.AL+`]`);function s(e){var t=a.exec(e);return t==null?null:t[0]}function c(e){var t=s(e);return t==null?n.NEUTRAL:o.exec(t)?n.RTL:n.LTR}function l(e,t){if(t||=n.NEUTRAL,!e.length)return t;var r=c(e);return r===n.NEUTRAL?t:r}function u(e,t){return t||=n.getGlobalDir(),!n.isStrong(t)&&r(!1),l(e,t)}function d(e,t){return u(e,t)===n.LTR}function f(e,t){return u(e,t)===n.RTL}t.exports={firstStrongChar:s,firstStrongCharDir:c,resolveBlockDir:l,getDirection:u,isDirectionLTR:d,isDirectionRTL:f}})),gi=t(((e,t)=>{function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=hi(),i=mi(),a=$();t.exports=function(){function e(e){n(this,`_defaultDir`,void 0),n(this,`_lastDir`,void 0),e?!i.isStrong(e)&&a(!1):e=i.getGlobalDir(),this._defaultDir=e,this.reset()}var t=e.prototype;return t.reset=function(){this._lastDir=this._defaultDir},t.getDirection=function(e){return this._lastDir=r.getDirection(e,this._lastDir),this._lastDir},e}()})),_i=t(((e,t)=>{t.exports=function(e){if(e!=null)return e;throw Error(`Got unexpected null or undefined`)}})),vi=t(((e,t)=>{var n=gi(),r=Q(),i=_i(),a=r.OrderedMap,o;t.exports={getDirectionMap:function(e,t){o?o.reset():o=new n;var s=e.getBlockMap(),c=s.valueSeq().map(function(e){return i(o).getDirection(e.getText())}),l=a(s.keySeq().zip(c));return t!=null&&r.is(t,l)?t:l}}})),yi=t(((e,t)=>{function n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],i=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(t){r(e,t,n[t])})}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=oi(),a=pi(),o=vi(),s=ui(),c=Q(),l=c.OrderedSet,u=c.Record,d=c.Stack,f=c.OrderedMap,p=c.List,m=u({allowUndo:!0,currentContent:null,decorator:null,directionMap:null,forceSelection:!1,inCompositionMode:!1,inlineStyleOverride:null,lastChangeType:null,nativelyRenderedContent:null,redoStack:d(),selection:null,treeMap:null,undoStack:d()}),h=function(){t.createEmpty=function(e){return this.createWithText(``,e)},t.createWithText=function(e,n){return t.createWithContent(a.createFromText(e),n)},t.createWithContent=function(e,n){if(e.getBlockMap().count()===0)return t.createEmpty(n);var r=e.getBlockMap().first().getKey();return t.create({currentContent:e,undoStack:d(),redoStack:d(),decorator:n||null,selection:s.createEmpty(r)})},t.create=function(e){var r=e.currentContent,i=e.decorator;return new t(new m(n({},e,{treeMap:_(r,i),directionMap:o.getDirectionMap(r)})))},t.fromJS=function(e){return new t(new m(n({},e,{directionMap:e.directionMap==null?e.directionMap:f(e.directionMap),inlineStyleOverride:e.inlineStyleOverride==null?e.inlineStyleOverride:l(e.inlineStyleOverride),nativelyRenderedContent:e.nativelyRenderedContent==null?e.nativelyRenderedContent:a.fromJS(e.nativelyRenderedContent),redoStack:e.redoStack==null?e.redoStack:d(e.redoStack.map(function(e){return a.fromJS(e)})),selection:e.selection==null?e.selection:new s(e.selection),treeMap:e.treeMap==null?e.treeMap:f(e.treeMap).map(function(e){return p(e).map(function(e){return i.fromJS(e)})}),undoStack:e.undoStack==null?e.undoStack:d(e.undoStack.map(function(e){return a.fromJS(e)})),currentContent:a.fromJS(e.currentContent)})))},t.set=function(e,n){return new t(e.getImmutable().withMutations(function(t){var r=t.get(`decorator`),i=r;n.decorator===null?i=null:n.decorator&&(i=n.decorator);var a=n.currentContent||e.getCurrentContent();if(i!==r){var o=t.get(`treeMap`),s=i&&r?y(a,a.getBlockMap(),o,i,r):_(a,i);t.merge({decorator:i,treeMap:s,nativelyRenderedContent:null});return}a!==e.getCurrentContent()&&t.set(`treeMap`,v(e,a.getBlockMap(),a.getEntityMap(),i)),t.merge(n)}))};var e=t.prototype;e.toJS=function(){return this.getImmutable().toJS()},e.getAllowUndo=function(){return this.getImmutable().get(`allowUndo`)},e.getCurrentContent=function(){return this.getImmutable().get(`currentContent`)},e.getUndoStack=function(){return this.getImmutable().get(`undoStack`)},e.getRedoStack=function(){return this.getImmutable().get(`redoStack`)},e.getSelection=function(){return this.getImmutable().get(`selection`)},e.getDecorator=function(){return this.getImmutable().get(`decorator`)},e.isInCompositionMode=function(){return this.getImmutable().get(`inCompositionMode`)},e.mustForceSelection=function(){return this.getImmutable().get(`forceSelection`)},e.getNativelyRenderedContent=function(){return this.getImmutable().get(`nativelyRenderedContent`)},e.getLastChangeType=function(){return this.getImmutable().get(`lastChangeType`)},e.getInlineStyleOverride=function(){return this.getImmutable().get(`inlineStyleOverride`)},t.setInlineStyleOverride=function(e,n){return t.set(e,{inlineStyleOverride:n})},e.getCurrentInlineStyle=function(){var e=this.getInlineStyleOverride();if(e!=null)return e;var t=this.getCurrentContent(),n=this.getSelection();return n.isCollapsed()?x(t,n):S(t,n)},e.getBlockTree=function(e){return this.getImmutable().getIn([`treeMap`,e])},e.isSelectionAtStartOfContent=function(){var e=this.getCurrentContent().getBlockMap().first().getKey();return this.getSelection().hasEdgeWithin(e,0,0)},e.isSelectionAtEndOfContent=function(){var e=this.getCurrentContent().getBlockMap().last(),t=e.getLength();return this.getSelection().hasEdgeWithin(e.getKey(),t,t)},e.getDirectionMap=function(){return this.getImmutable().get(`directionMap`)},t.acceptSelection=function(e,t){return g(e,t,!1)},t.forceSelection=function(e,t){return t.getHasFocus()||(t=t.set(`hasFocus`,!0)),g(e,t,!0)},t.moveSelectionToEnd=function(e){var n=e.getCurrentContent().getLastBlock(),r=n.getKey(),i=n.getLength();return t.acceptSelection(e,new s({anchorKey:r,anchorOffset:i,focusKey:r,focusOffset:i,isBackward:!1}))},t.moveFocusToEnd=function(e){var n=t.moveSelectionToEnd(e);return t.forceSelection(n,n.getSelection())},t.push=function(e,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;if(e.getCurrentContent()===n)return e;var a=o.getDirectionMap(n,e.getDirectionMap());if(!e.getAllowUndo())return t.set(e,{currentContent:n,directionMap:a,lastChangeType:r,selection:n.getSelectionAfter(),forceSelection:i,inlineStyleOverride:null});var s=e.getSelection(),c=e.getCurrentContent(),l=e.getUndoStack(),u=n;s!==c.getSelectionAfter()||b(e,r)?(l=l.push(c),u=u.set(`selectionBefore`,s)):(r===`insert-characters`||r===`backspace-character`||r===`delete-character`)&&(u=u.set(`selectionBefore`,c.getSelectionBefore()));var f=e.getInlineStyleOverride();[`adjust-depth`,`change-block-type`,`split-block`].indexOf(r)===-1&&(f=null);var p={currentContent:u,directionMap:a,undoStack:l,redoStack:d(),lastChangeType:r,selection:n.getSelectionAfter(),forceSelection:i,inlineStyleOverride:f};return t.set(e,p)},t.undo=function(e){if(!e.getAllowUndo())return e;var n=e.getUndoStack(),r=n.peek();if(!r)return e;var i=e.getCurrentContent(),a=o.getDirectionMap(r,e.getDirectionMap());return t.set(e,{currentContent:r,directionMap:a,undoStack:n.shift(),redoStack:e.getRedoStack().push(i),forceSelection:!0,inlineStyleOverride:null,lastChangeType:`undo`,nativelyRenderedContent:null,selection:i.getSelectionBefore()})},t.redo=function(e){if(!e.getAllowUndo())return e;var n=e.getRedoStack(),r=n.peek();if(!r)return e;var i=e.getCurrentContent(),a=o.getDirectionMap(r,e.getDirectionMap());return t.set(e,{currentContent:r,directionMap:a,undoStack:e.getUndoStack().push(i),redoStack:n.shift(),forceSelection:!0,inlineStyleOverride:null,lastChangeType:`redo`,nativelyRenderedContent:null,selection:r.getSelectionAfter()})};function t(e){r(this,`_immutable`,void 0),this._immutable=e}return e.getImmutable=function(){return this._immutable},t}();function g(e,t,n){return h.set(e,{selection:t,forceSelection:n,nativelyRenderedContent:null,inlineStyleOverride:null})}function _(e,t){return e.getBlockMap().map(function(n){return i.generate(e,n,t)}).toOrderedMap()}function v(e,t,n,r){var a=e.getCurrentContent().set(`entityMap`,n),o=a.getBlockMap();return e.getImmutable().get(`treeMap`).merge(t.toSeq().filter(function(e,t){return e!==o.get(t)}).map(function(e){return i.generate(a,e,r)}))}function y(e,t,n,r,a){return n.merge(t.toSeq().filter(function(t){return r.getDecorations(t,e)!==a.getDecorations(t,e)}).map(function(t){return i.generate(e,t,r)}))}function b(e,t){return t!==e.getLastChangeType()||t!==`insert-characters`&&t!==`backspace-character`&&t!==`delete-character`}function x(e,t){var n=t.getStartKey(),r=t.getStartOffset(),i=e.getBlockForKey(n);return r>0?i.getInlineStyleAt(r-1):i.getLength()?i.getInlineStyleAt(0):C(e,n)}function S(e,t){var n=t.getStartKey(),r=t.getStartOffset(),i=e.getBlockForKey(n);return r<i.getLength()?i.getInlineStyleAt(r):r>0?i.getInlineStyleAt(r-1):C(e,n)}function C(e,t){var n=e.getBlockMap().reverse().skipUntil(function(e,n){return n===t}).skip(1).skipUntil(function(e,t){return e.getLength()}).first();return n?n.getInlineStyleAt(n.getLength()-1):l()}t.exports=h})),bi=t(((e,t)=>{var n=Br(),r=ti(),i=Q(),a=$(),o=i.OrderedMap,s=i.List,c=function(e,t,n){if(e){var r=t.get(e);r&&t.set(e,n(r))}},l=function(e,t,n,r,i){if(!i)return e;var a=r===`after`,o=t.getKey(),l=n.getKey(),u=t.getParentKey(),d=t.getNextSiblingKey(),f=t.getPrevSiblingKey(),p=n.getParentKey(),m=a?n.getNextSiblingKey():l,h=a?l:n.getPrevSiblingKey();return e.withMutations(function(e){c(u,e,function(e){var t=e.getChildKeys();return e.merge({children:t.delete(t.indexOf(o))})}),c(f,e,function(e){return e.merge({nextSibling:d})}),c(d,e,function(e){return e.merge({prevSibling:f})}),c(m,e,function(e){return e.merge({prevSibling:o})}),c(h,e,function(e){return e.merge({nextSibling:o})}),c(p,e,function(e){var t=e.getChildKeys(),n=t.indexOf(l),r=a?n+1:n===0?0:n-1,i=t.toArray();return i.splice(r,0,o),e.merge({children:s(i)})}),c(o,e,function(e){return e.merge({nextSibling:m,prevSibling:h,parent:p})})})};t.exports=function(e,t,i,s){s===`replace`&&a(!1);var c=i.getKey(),u=t.getKey();u===c&&a(!1);var d=e.getBlockMap(),f=t instanceof n,p=[t],m=d.delete(u);f&&(p=[],m=d.withMutations(function(e){var n=t.getNextSiblingKey(),i=r(t,e);e.toSeq().skipUntil(function(e){return e.getKey()===u}).takeWhile(function(e){var t=e.getKey(),r=t===u,a=n&&t!==n,o=!n&&e.getParentKey()&&(!i||t!==i);return!!(r||a||o)}).forEach(function(t){p.push(t),e.delete(t.getKey())})}));var h=m.toSeq().takeUntil(function(e){return e===i}),g=m.toSeq().skipUntil(function(e){return e===i}).skip(1),_=p.map(function(e){return[e.getKey(),e]}),v=o();if(s===`before`){var y=e.getBlockBefore(c);!(!y||y.getKey()!==t.getKey())&&a(!1),v=h.concat([].concat(_,[[c,i]]),g).toOrderedMap()}else if(s===`after`){var b=e.getBlockAfter(c);!(!b||b.getKey()!==u)&&a(!1),v=h.concat([[c,i]].concat(_),g).toOrderedMap()}return e.merge({blockMap:l(v,t,i,s,f),selectionBefore:e.getSelectionAfter(),selectionAfter:e.getSelectionAfter().merge({anchorKey:u,focusKey:u})})}})),xi=t(((e,t)=>{function n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],i=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(t){r(e,t,n[t])})}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=Ir(),a=Lr(),o=zr(),s=Br(),c=ii(),l=yi(),u=qr(),d=di(),f=Q(),p=bi(),m=d(`draft_tree_data_support`),h=m?s:o,g=f.List,_=f.Repeat;t.exports={insertAtomicBlock:function(e,t,r){var o=e.getCurrentContent(),s=e.getSelection(),d=c.removeRange(o,s,`backward`),f=d.getSelectionAfter(),p=c.splitBlock(d,f),v=p.getSelectionAfter(),y=c.setBlockType(p,v,`atomic`),b=a.create({entity:t}),x={key:u(),type:`atomic`,text:r,characterList:g(_(b,r.length))},S={key:u(),type:`unstyled`};m&&(x=n({},x,{nextSibling:S.key}),S=n({},S,{prevSibling:x.key}));var C=[new h(x),new h(S)],w=i.createFromArray(C),T=c.replaceWithFragment(y,v,w),E=T.merge({selectionBefore:s,selectionAfter:T.getSelectionAfter().set(`hasFocus`,!0)});return l.push(e,E,`insert-fragment`)},moveAtomicBlock:function(e,t,n,r){var i=e.getCurrentContent(),a=e.getSelection(),o;if(r===`before`||r===`after`)o=p(i,t,i.getBlockForKey(r===`before`?n.getStartKey():n.getEndKey()),r);else{var s=c.removeRange(i,n,`backward`),u=s.getSelectionAfter(),d=s.getBlockForKey(u.getFocusKey());if(u.getStartOffset()===0)o=p(s,t,d,`before`);else if(u.getEndOffset()===d.getLength())o=p(s,t,d,`after`);else{var f=c.splitBlock(s,u),m=f.getSelectionAfter();o=p(f,t,f.getBlockForKey(m.getFocusKey()),`before`)}}var h=o.merge({selectionBefore:a,selectionAfter:o.getSelectionAfter().set(`hasFocus`,!0)});return l.push(e,h,`move-block`)}}})),Si=t(((e,t)=>{function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=Q().List,i=`.`,a=function(){function e(e){n(this,`_decorators`,void 0),this._decorators=e.slice()}var t=e.prototype;return t.getDecorations=function(e,t){var n=Array(e.getText().length).fill(null);return this._decorators.forEach(function(r,a){var c=0,l=r.strategy;l(e,function(e,t){o(n,e,t)&&(s(n,e,t,a+i+c),c++)},t)}),r(n)},t.getComponentForKey=function(e){var t=parseInt(e.split(i)[0],10);return this._decorators[t].component},t.getPropsForKey=function(e){var t=parseInt(e.split(i)[0],10);return this._decorators[t].props},e}();function o(e,t,n){for(var r=t;r<n;r++)if(e[r]!=null)return!1;return!0}function s(e,t,n,r){for(var i=t;i<n;i++)e[i]=r}t.exports=a})),Ci=t(((e,t)=>{function n(e){return typeof e==`object`?Object.keys(e).filter(function(t){return e[t]}).map(r).join(` `):Array.prototype.map.call(arguments,r).join(` `)}function r(e){return e.replace(/\//g,`-`)}t.exports=n})),wi=t(((e,t)=>{var n=c(),r=Ci(),i=Q().Map,a=n.createElement(`ul`,{className:r(`public/DraftStyleDefault/ul`)}),o=n.createElement(`ol`,{className:r(`public/DraftStyleDefault/ol`)}),s=n.createElement(`pre`,{className:r(`public/DraftStyleDefault/pre`)});t.exports=i({"header-one":{element:`h1`},"header-two":{element:`h2`},"header-three":{element:`h3`},"header-four":{element:`h4`},"header-five":{element:`h5`},"header-six":{element:`h6`},section:{element:`section`},article:{element:`article`},"unordered-list-item":{element:`li`,wrapper:a},"ordered-list-item":{element:`li`,wrapper:o},blockquote:{element:`blockquote`},atomic:{element:`figure`},"code-block":{element:`pre`,wrapper:s},unstyled:{element:`div`,aliasedElements:[`p`]}})})),Ti=t(((e,t)=>{t.exports={BOLD:{fontWeight:`bold`},CODE:{fontFamily:`monospace`,wordWrap:`break-word`},ITALIC:{fontStyle:`italic`},STRIKETHROUGH:{textDecoration:`line-through`},UNDERLINE:{textDecoration:`underline`}}})),Ei=t(((e,t)=>{var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(e==null)throw TypeError(`Object.assign cannot be called with null or undefined`);return Object(e)}function o(){try{if(!Object.assign)return!1;var e=new String(`abc`);if(e[5]=`de`,Object.getOwnPropertyNames(e)[0]===`5`)return!1;for(var t={},n=0;n<10;n++)t[`_`+String.fromCharCode(n)]=n;if(Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(``)!==`0123456789`)return!1;var r={};return`abcdefghijklmnopqrst`.split(``).forEach(function(e){r[e]=e}),Object.keys(Object.assign({},r)).join(``)===`abcdefghijklmnopqrst`}catch{return!1}}t.exports=o()?Object.assign:function(e,t){for(var o,s=a(e),c,l=1;l<arguments.length;l++){for(var u in o=Object(arguments[l]),o)r.call(o,u)&&(s[u]=o[u]);if(n){c=n(o);for(var d=0;d<c.length;d++)i.call(o,c[d])&&(s[c[d]]=o[c[d]])}}return s}})),Di=t(((e,t)=>{(function(n,r){var i=`0.7.41`,a=``,o=`function`,s=`undefined`,c=`object`,l=`string`,u=`major`,d=`model`,f=`name`,p=`type`,m=`vendor`,h=`version`,g=`architecture`,_=`console`,v=`mobile`,y=`tablet`,b=`smarttv`,x=`wearable`,S=`embedded`,C=`Amazon`,w=`Apple`,T=`ASUS`,E=`BlackBerry`,D=`Browser`,O=`Chrome`,k=`Edge`,A=`Firefox`,j=`Google`,M=`Honor`,ee=`Huawei`,N=`Lenovo`,P=`LG`,te=`Microsoft`,ne=`Motorola`,F=`Nvidia`,I=`OnePlus`,L=`Opera`,R=`OPPO`,re=`Samsung`,ie=`Sharp`,ae=`Sony`,oe=`Xiaomi`,se=`Zebra`,z=`Facebook`,ce=`Chromium OS`,B=`Mac OS`,le=` Browser`,ue=function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n},de=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},fe=function(e,t){return typeof e==l&&pe(t).indexOf(pe(e))!==-1},pe=function(e){return e.toLowerCase()},me=function(e){return typeof e==l?e.replace(/[^\d\.]/g,a).split(`.`)[0]:r},he=function(e,t){if(typeof e==l)return e=e.replace(/^\s\s*/,a),typeof t===s?e:e.substring(0,500)},ge=function(e,t){for(var n=0,i,a,s,l,u,d;n<t.length&&!u;){var f=t[n],p=t[n+1];for(i=a=0;i<f.length&&!u&&f[i];)if(u=f[i++].exec(e),u)for(s=0;s<p.length;s++)d=u[++a],l=p[s],typeof l==c&&l.length>0?l.length===2?typeof l[1]==o?this[l[0]]=l[1].call(this,d):this[l[0]]=l[1]:l.length===3?typeof l[1]===o&&!(l[1].exec&&l[1].test)?this[l[0]]=d?l[1].call(this,d,l[2]):r:this[l[0]]=d?d.replace(l[1],l[2]):r:l.length===4&&(this[l[0]]=d?l[3].call(this,d.replace(l[1],l[2])):r):this[l]=d||r;n+=2}},_e=function(e,t){for(var n in t)if(typeof t[n]==c&&t[n].length>0){for(var i=0;i<t[n].length;i++)if(fe(t[n][i],e))return n===`?`?r:n}else if(fe(t[n],e))return n===`?`?r:n;return t.hasOwnProperty(`*`)?t[`*`]:e},ve={"1.0":`/8`,"1.2":`/1`,"1.3":`/3`,"2.0":`/412`,"2.0.2":`/416`,"2.0.3":`/417`,"2.0.4":`/419`,"?":`/`},ye={ME:`4.90`,"NT 3.11":`NT3.51`,"NT 4.0":`NT4.0`,2e3:`NT 5.0`,XP:[`NT 5.1`,`NT 5.2`],Vista:`NT 6.0`,7:`NT 6.1`,8:`NT 6.2`,"8.1":`NT 6.3`,10:[`NT 6.4`,`NT 10.0`],RT:`ARM`},be={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[h,[f,`Chrome`]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[h,[f,`Edge`]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[f,h],[/opios[\/ ]+([\w\.]+)/i],[h,[f,L+` Mini`]],[/\bop(?:rg)?x\/([\w\.]+)/i],[h,[f,L+` GX`]],[/\bopr\/([\w\.]+)/i],[h,[f,L]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[h,[f,`Baidu`]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[h,[f,`Maxthon`]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[f,h],[/quark(?:pc)?\/([-\w\.]+)/i],[h,[f,`Quark`]],[/\bddg\/([\w\.]+)/i],[h,[f,`DuckDuckGo`]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[h,[f,`UC`+D]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[h,[f,`WeChat`]],[/konqueror\/([\w\.]+)/i],[h,[f,`Konqueror`]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[h,[f,`IE`]],[/ya(?:search)?browser\/([\w\.]+)/i],[h,[f,`Yandex`]],[/slbrowser\/([\w\.]+)/i],[h,[f,`Smart Lenovo `+D]],[/(avast|avg)\/([\w\.]+)/i],[[f,/(.+)/,`$1 Secure `+D],h],[/\bfocus\/([\w\.]+)/i],[h,[f,A+` Focus`]],[/\bopt\/([\w\.]+)/i],[h,[f,L+` Touch`]],[/coc_coc\w+\/([\w\.]+)/i],[h,[f,`Coc Coc`]],[/dolfin\/([\w\.]+)/i],[h,[f,`Dolphin`]],[/coast\/([\w\.]+)/i],[h,[f,L+` Coast`]],[/miuibrowser\/([\w\.]+)/i],[h,[f,`MIUI`+le]],[/fxios\/([\w\.-]+)/i],[h,[f,A]],[/\bqihoobrowser\/?([\w\.]*)/i],[h,[f,`360`]],[/\b(qq)\/([\w\.]+)/i],[[f,/(.+)/,`$1Browser`],h],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[f,/(.+)/,`$1`+le],h],[/samsungbrowser\/([\w\.]+)/i],[h,[f,re+` Internet`]],[/metasr[\/ ]?([\d\.]+)/i],[h,[f,`Sogou Explorer`]],[/(sogou)mo\w+\/([\d\.]+)/i],[[f,`Sogou Mobile`],h],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[f,h],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[f],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[h,f],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[f,z],h],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[f,h],[/\bgsa\/([\w\.]+) .*safari\//i],[h,[f,`GSA`]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[h,[f,`TikTok`]],[/headlesschrome(?:\/([\w\.]+)| )/i],[h,[f,O+` Headless`]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[f,O+` WebView`],h],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[h,[f,`Android `+D]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[f,h],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[h,[f,`Mobile Safari`]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[h,f],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[f,[h,_e,ve]],[/(webkit|khtml)\/([\w\.]+)/i],[f,h],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[f,`Netscape`],h],[/(wolvic|librewolf)\/([\w\.]+)/i],[f,h],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[h,[f,A+` Reality`]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[f,[h,/_/g,`.`]],[/(cobalt)\/([\w\.]+)/i],[f,[h,/master.|lts./,``]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[g,`amd64`]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[g,`ia32`]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[g,`arm64`]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[g,`armhf`]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[g,`arm`]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[g,/ower/,a,pe]],[/ sun4\w[;\)]/i],[[g,`sparc`]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[g,pe]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[d,[m,re],[p,y]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[d,[m,re],[p,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[m,w],[p,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[m,w],[p,y]],[/(macintosh);/i],[d,[m,w]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[m,ie],[p,v]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[d,[m,M],[p,y]],[/honor([-\w ]+)[;\)]/i],[d,[m,M],[p,v]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[d,[m,ee],[p,y]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[m,ee],[p,v]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[d,/_/g,` `],[m,oe],[p,y]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[d,/_/g,` `],[m,oe],[p,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[m,R],[p,v]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[d,[m,_e,{OnePlus:[`304`,`403`,`203`],"*":R}],[p,y]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[m,`Vivo`],[p,v]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[d,[m,`Realme`],[p,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[d,[m,ne],[p,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[m,ne],[p,y]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[m,P],[p,y]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[m,P],[p,v]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[d,[m,N],[p,y]],[/(nokia) (t[12][01])/i],[m,d,[p,y]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[d,/_/g,` `],[p,v],[m,`Nokia`]],[/(pixel (c|tablet))\b/i],[d,[m,j],[p,y]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[m,j],[p,v]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[d,[m,ae],[p,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,`Xperia Tablet`],[m,ae],[p,y]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[m,I],[p,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[m,C],[p,y]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,`Fire Phone $1`],[m,C],[p,v]],[/(playbook);[-\w\),; ]+(rim)/i],[d,m,[p,y]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[m,E],[p,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[m,T],[p,y]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[m,T],[p,v]],[/(nexus 9)/i],[d,[m,`HTC`],[p,y]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[m,[d,/_/g,` `],[p,v]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[d,[m,`TCL`],[p,y]],[/(itel) ((\w+))/i],[[m,pe],d,[p,_e,{tablet:[`p10001l`,`w7001`],"*":`mobile`}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[m,`Acer`],[p,y]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[m,`Meizu`],[p,v]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[d,[m,`Ulefone`],[p,v]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[d,[m,`Energizer`],[p,v]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[d,[m,`Cat`],[p,v]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[d,[m,`Smartfren`],[p,v]],[/droid.+; (a(?:015|06[35]|142p?))/i],[d,[m,`Nothing`],[p,v]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[d,[m,`Archos`],[p,y]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[d,[m,`Archos`],[p,v]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[m,d,[p,y]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[m,d,[p,v]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[m,d,[p,y]],[/(surface duo)/i],[d,[m,te],[p,y]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[m,`Fairphone`],[p,v]],[/(u304aa)/i],[d,[m,`AT&T`],[p,v]],[/\bsie-(\w*)/i],[d,[m,`Siemens`],[p,v]],[/\b(rct\w+) b/i],[d,[m,`RCA`],[p,y]],[/\b(venue[\d ]{2,7}) b/i],[d,[m,`Dell`],[p,y]],[/\b(q(?:mv|ta)\w+) b/i],[d,[m,`Verizon`],[p,y]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[d,[m,`Barnes & Noble`],[p,y]],[/\b(tm\d{3}\w+) b/i],[d,[m,`NuVision`],[p,y]],[/\b(k88) b/i],[d,[m,`ZTE`],[p,y]],[/\b(nx\d{3}j) b/i],[d,[m,`ZTE`],[p,v]],[/\b(gen\d{3}) b.+49h/i],[d,[m,`Swiss`],[p,v]],[/\b(zur\d{3}) b/i],[d,[m,`Swiss`],[p,y]],[/\b((zeki)?tb.*\b) b/i],[d,[m,`Zeki`],[p,y]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[m,`Dragon Touch`],d,[p,y]],[/\b(ns-?\w{0,9}) b/i],[d,[m,`Insignia`],[p,y]],[/\b((nxa|next)-?\w{0,9}) b/i],[d,[m,`NextBook`],[p,y]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[m,`Voice`],d,[p,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[m,`LvTel`],d,[p,v]],[/\b(ph-1) /i],[d,[m,`Essential`],[p,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[d,[m,`Envizen`],[p,y]],[/\b(trio[-\w\. ]+) b/i],[d,[m,`MachSpeed`],[p,y]],[/\btu_(1491) b/i],[d,[m,`Rotor`],[p,y]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[d,[m,F],[p,y]],[/(sprint) (\w+)/i],[m,d,[p,v]],[/(kin\.[onetw]{3})/i],[[d,/\./g,` `],[m,te],[p,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[m,se],[p,y]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[m,se],[p,v]],[/smart-tv.+(samsung)/i],[m,[p,b]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,`SmartTV`],[m,re],[p,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[m,P],[p,b]],[/(apple) ?tv/i],[m,[d,w+` TV`],[p,b]],[/crkey/i],[[d,O+`cast`],[m,j],[p,b]],[/droid.+aft(\w+)( bui|\))/i],[d,[m,C],[p,b]],[/(shield \w+ tv)/i],[d,[m,F],[p,b]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[m,ie],[p,b]],[/(bravia[\w ]+)( bui|\))/i],[d,[m,ae],[p,b]],[/(mi(tv|box)-?\w+) bui/i],[d,[m,oe],[p,b]],[/Hbbtv.*(technisat) (.*);/i],[m,d,[p,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[m,he],[d,he],[p,b]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[d,[p,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[p,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[m,d,[p,_]],[/droid.+; (shield)( bui|\))/i],[d,[m,F],[p,_]],[/(playstation \w+)/i],[d,[m,ae],[p,_]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[m,te],[p,_]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[d,[m,re],[p,x]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[m,d,[p,x]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[d,[m,R],[p,x]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[m,w],[p,x]],[/(opwwe\d{3})/i],[d,[m,I],[p,x]],[/(moto 360)/i],[d,[m,ne],[p,x]],[/(smartwatch 3)/i],[d,[m,ae],[p,x]],[/(g watch r)/i],[d,[m,P],[p,x]],[/droid.+; (wt63?0{2,3})\)/i],[d,[m,se],[p,x]],[/droid.+; (glass) \d/i],[d,[m,j],[p,x]],[/(pico) (4|neo3(?: link|pro)?)/i],[m,d,[p,x]],[/; (quest( \d| pro)?)/i],[d,[m,z],[p,x]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[m,[p,S]],[/(aeobc)\b/i],[d,[m,C],[p,S]],[/(homepod).+mac os/i],[d,[m,w],[p,S]],[/windows iot/i],[[p,S]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[d,[p,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[p,y]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,y]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[p,v]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[d,[m,`Generic`]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[h,[f,k+`HTML`]],[/(arkweb)\/([\w\.]+)/i],[f,h],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[h,[f,`Blink`]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[f,h],[/ladybird\//i],[[f,`LibWeb`]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[h,f]],os:[[/microsoft (windows) (vista|xp)/i],[f,h],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[f,[h,_e,ye]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[h,_e,ye],[f,`Windows`]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[h,/_/g,`.`],[f,`iOS`]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[f,B],[h,/_/g,`.`]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[h,f],[/(ubuntu) ([\w\.]+) like android/i],[[f,/(.+)/,`$1 Touch`],h],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[f,h],[/\(bb(10);/i],[h,[f,E]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[h,[f,`Symbian`]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[h,[f,A+` OS`]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[h,[f,`webOS`]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[h,[f,`watchOS`]],[/crkey\/([\d\.]+)/i],[h,[f,O+`cast`]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[f,ce],h],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[f,h],[/(sunos) ?([\w\.\d]*)/i],[[f,`Solaris`],h],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[f,h]]},xe=function(e,t){if(typeof e==c&&(t=e,e=r),!(this instanceof xe))return new xe(e,t).getResult();var i=typeof n!==s&&n.navigator?n.navigator:r,_=e||(i&&i.userAgent?i.userAgent:a),b=i&&i.userAgentData?i.userAgentData:r,x=t?ue(be,t):be,S=i&&i.userAgent==_;return this.getBrowser=function(){var e={};return e[f]=r,e[h]=r,ge.call(e,_,x.browser),e[u]=me(e[h]),S&&i&&i.brave&&typeof i.brave.isBrave==o&&(e[f]=`Brave`),e},this.getCPU=function(){var e={};return e[g]=r,ge.call(e,_,x.cpu),e},this.getDevice=function(){var e={};return e[m]=r,e[d]=r,e[p]=r,ge.call(e,_,x.device),S&&!e[p]&&b&&b.mobile&&(e[p]=v),S&&e[d]==`Macintosh`&&i&&typeof i.standalone!==s&&i.maxTouchPoints&&i.maxTouchPoints>2&&(e[d]=`iPad`,e[p]=y),e},this.getEngine=function(){var e={};return e[f]=r,e[h]=r,ge.call(e,_,x.engine),e},this.getOS=function(){var e={};return e[f]=r,e[h]=r,ge.call(e,_,x.os),S&&!e[f]&&b&&b.platform&&b.platform!=`Unknown`&&(e[f]=b.platform.replace(/chrome os/i,ce).replace(/macos/i,B)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return _},this.setUA=function(e){return _=typeof e==l&&e.length>500?he(e,500):e,this},this.setUA(_),this};xe.VERSION=i,xe.BROWSER=de([f,h,u]),xe.CPU=de([g]),xe.DEVICE=de([d,m,p,_,v,b,y,x,S]),xe.ENGINE=xe.OS=de([f,h]),typeof e===s?typeof define===o&&define.amd?define(function(){return xe}):typeof n!==s&&(n.UAParser=xe):(typeof t!==s&&t.exports&&(e=t.exports=xe),e.UAParser=xe);var Se=typeof n!==s&&(n.jQuery||n.Zepto);if(Se&&!Se.ua){var Ce=new xe;Se.ua=Ce.getResult(),Se.ua.get=function(){return Ce.getUA()},Se.ua.set=function(e){Ce.setUA(e);var t=Ce.getResult();for(var n in t)Se.ua[n]=t[n]}}})(typeof window==`object`?window:e)})),Oi=t(((e,t)=>{var n=Di(),r=`Unknown`,i={"Mac OS":`Mac OS X`};function a(e){return i[e]||e}function o(e){if(!e)return{major:``,minor:``};var t=e.split(`.`);return{major:t[0],minor:t[1]}}var s=new n().getResult(),c=o(s.browser.version);t.exports={browserArchitecture:s.cpu.architecture||r,browserFullVersion:s.browser.version||r,browserMinorVersion:c.minor||r,browserName:s.browser.name||r,browserVersion:s.browser.major||r,deviceName:s.device.model||r,engineName:s.engine.name||r,engineVersion:s.engine.version||r,platformArchitecture:s.cpu.architecture||r,platformName:a(s.os.name)||r,platformVersion:s.os.version||r,platformFullVersion:s.os.version||r}})),ki=t(((e,t)=>{var n=$(),r=/\./,i=/\|\|/,a=/\s+\-\s+/,o=/^(<=|<|=|>=|~>|~|>|)?\s*(.+)/,s=/^(\d*)(.*)/;function c(e,t){var n=e.split(i);return n.length>1?n.some(function(e){return T.contains(e,t)}):(e=n[0].trim(),l(e,t))}function l(e,t){var r=e.split(a);if(!(r.length>0&&r.length<=2)&&n(!1),r.length===1)return u(r[0],t);var i=r[0],o=r[1];return!(y(i)&&y(o))&&n(!1),u(`>=`+i,t)&&u(`<=`+o,t)}function u(e,t){if(e=e.trim(),e===``)return!0;var n=t.split(r),i=_(e),a=i.modifier,o=i.rangeComponents;switch(a){case`<`:return d(n,o);case`<=`:return f(n,o);case`>=`:return m(n,o);case`>`:return h(n,o);case`~`:case`~>`:return g(n,o);default:return p(n,o)}}function d(e,t){return w(e,t)===-1}function f(e,t){var n=w(e,t);return n===-1||n===0}function p(e,t){return w(e,t)===0}function m(e,t){var n=w(e,t);return n===1||n===0}function h(e,t){return w(e,t)===1}function g(e,t){var n=t.slice(),r=t.slice();r.length>1&&r.pop();var i=r.length-1,a=parseInt(r[i],10);return v(a)&&(r[i]=a+1+``),m(e,n)&&d(e,r)}function _(e){var t=e.split(r),i=t[0].match(o);return!i&&n(!1),{modifier:i[1],rangeComponents:[i[2]].concat(t.slice(1))}}function v(e){return!isNaN(e)&&isFinite(e)}function y(e){return!_(e).modifier}function b(e,t){for(var n=e.length;n<t;n++)e[n]=`0`}function x(e,t){e=e.slice(),t=t.slice(),b(e,t.length);for(var n=0;n<t.length;n++){var r=t[n].match(/^[x*]$/i);if(r&&(t[n]=e[n]=`0`,r[0]===`*`&&n===t.length-1))for(var i=n;i<e.length;i++)e[i]=`0`}return b(t,e.length),[e,t]}function S(e,t){var n=e.match(s)[1],r=t.match(s)[1],i=parseInt(n,10),a=parseInt(r,10);return v(i)&&v(a)&&i!==a?C(i,a):C(e,t)}function C(e,t){return typeof e!=typeof t&&n(!1),e>t?1:e<t?-1:0}function w(e,t){for(var n=x(e,t),r=n[0],i=n[1],a=0;a<i.length;a++){var o=S(r[a],i[a]);if(o)return o}return 0}var T={contains:function(e,t){return c(e.trim(),t.trim())}};t.exports=T})),Ai=t(((e,t)=>{var n=Object.prototype.hasOwnProperty;function r(e,t,r){if(!e)return null;var i={};for(var a in e)n.call(e,a)&&(i[a]=t.call(r,e[a],a,e));return i}t.exports=r})),ji=t(((e,t)=>{function n(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}t.exports=n})),Mi=t(((e,t)=>{var n=Oi(),r=ki(),i=Ai(),a=ji();function o(e,t,n,i){if(e===n)return!0;if(!n.startsWith(e))return!1;var a=n.slice(e.length);return t?(a=i?i(a):a,r.contains(a,t)):!1}function s(e){return n.platformName===`Windows`?e.replace(/^\s*NT/,``):e}t.exports=i({isBrowser:function(e){return o(n.browserName,n.browserFullVersion,e)},isBrowserArchitecture:function(e){return o(n.browserArchitecture,null,e)},isDevice:function(e){return o(n.deviceName,null,e)},isEngine:function(e){return o(n.engineName,n.engineVersion,e)},isPlatform:function(e){return o(n.platformName,n.platformFullVersion,e,s)},isPlatformArchitecture:function(e){return o(n.platformArchitecture,null,e)}},a)})),Ni=t(((e,t)=>{function n(e){return!e||!e.ownerDocument?document:e.ownerDocument}t.exports=n})),Pi=t(((e,t)=>{function n(e){return!e||!e.ownerDocument?!1:e.nodeType===Node.ELEMENT_NODE}t.exports=n})),Fi=t(((e,t)=>{var n=Pi();function r(e){if(n(e)){var t=e,i=t.getAttribute(`data-offset-key`);if(i)return i;for(var a=0;a<t.childNodes.length;a++){var o=r(t.childNodes[a]);if(o)return o}}return null}t.exports=r})),Ii=t(((e,t)=>{var n=Ni(),r=Fi();function i(e){for(var t=e;t&&t!==n(e).documentElement;){var i=r(t);if(i!=null)return i;t=t.parentNode}return null}t.exports=i})),Li=t(((e,t)=>{function n(e){return!e||!e.ownerDocument||!e.ownerDocument.defaultView?window:e.ownerDocument.defaultView}t.exports=n})),Ri=t(((e,t)=>{function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=Mi(),i=Ii(),a=Li(),o=Q(),s=$(),c=_i(),l=o.Map,u={subtree:!0,characterData:!0,childList:!0,characterDataOldValue:!1,attributes:!1},d=r.isBrowser(`IE <= 11`);t.exports=function(){function e(e){var t=this;n(this,`observer`,void 0),n(this,`container`,void 0),n(this,`mutations`,void 0),n(this,`onCharData`,void 0),this.container=e,this.mutations=l();var r=a(e);r.MutationObserver&&!d?this.observer=new r.MutationObserver(function(e){return t.registerMutations(e)}):this.onCharData=function(e){!(e.target instanceof Node)&&s(!1),t.registerMutation({type:`characterData`,target:e.target})}}var t=e.prototype;return t.start=function(){this.observer?this.observer.observe(this.container,u):this.container.addEventListener(`DOMCharacterDataModified`,this.onCharData)},t.stopAndFlushMutations=function(){var e=this.observer;e?(this.registerMutations(e.takeRecords()),e.disconnect()):this.container.removeEventListener(`DOMCharacterDataModified`,this.onCharData);var t=this.mutations;return this.mutations=l(),t},t.registerMutations=function(e){for(var t=0;t<e.length;t++)this.registerMutation(e[t])},t.getMutationTextContent=function(e){var t=e.type,n=e.target,r=e.removedNodes;if(t===`characterData`){if(n.textContent!==``)return d?n.textContent.replace(`
|
|
@@ -33,4 +33,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
33
33
|
${p?`cv-slide-out-down`:``}
|
|
34
34
|
${n?`cv-transitioning`:``}
|
|
35
35
|
`,children:(0,U.jsx)(jl,{...e,currentIndex:i.interactionIndex,shouldFocus:a&&!u&&!d,delayFocus:o,leftHandSidePortalNode:c,fullWidthPortalNode:l,experimentalInteractiveQuestions:s},a?.id)}),d&&(0,U.jsx)(`div`,{className:`cv-next-interaction ${i.slideIn?`cv-slide-in`:``}`,children:(0,U.jsx)(jl,{...e,currentIndex:i.nextInteractionIndex,interaction:n,interactionState:r})})]})]})}var Nl={interactions:{},timepoints:{}};function Pl(e){return e?{timepoints:{},interactions:e.actions.reduce((e,t)=>(e[t.interactionId]={...e[t.interactionId],[t.actionableItemId]:t.data,submitted:!0},e),{})}:Nl}function Fl(e,t){if(t.type===`interaction`)return{timepoints:e.timepoints,interactions:{...e.interactions,[t.id]:t.value}};if(t.type===`timepoint`)return{interactions:e.interactions,timepoints:{...e.timepoints,[t.id]:t.value}}}var Il={interactionIndex:0},Ll=e=>{let{mode:t,timepoint:n,latestSession:r}=e,i=t===Ze.Create,[a,o]=H.useReducer(Fl,null,()=>Pl(r)),s=f(n?.id),c=n?.interactions[s.interactionIndex],l=typeof s.nextInteractionIndex==`number`?n?.interactions[s.nextInteractionIndex]:null,u=p(c?.id),d=p(l?.id);function f(e){return e&&a.timepoints[e]||Il}function p(e){if(!e)return{};let t=a.interactions[e];return!t&&!i?{}:t}function m(e,t){let n=f(e);o({type:`timepoint`,id:e,value:{...n,...t}})}function h(e,t,n){let r=p(e);o({type:`interaction`,id:e,value:{...n?{}:r,...t}})}function g(e){o({type:`timepoint`,id:e,value:void 0})}function _(e){o({type:`interaction`,id:e,value:void 0})}function v(e,t){h(c.id,{...e,hasChanges:!0,error:null},t)}return{state:a,interaction:c,interactionState:u,timepointState:s,nextInteraction:l,nextInteractionState:d,getTimepointState:f,getInteractionState:p,updateTimepointState:m,updateInteractionState:h,clearTimepointState:g,clearInteractionState:_,userUpdateInteractionState:v}},Rl=!1;function zl(){return`new_${crypto.getRandomValues(new Uint32Array(1)).toString()}`}var Bl=e=>{let{interactive:t,timepoint:n,player:r,mode:i,resultsService:a,latestSession:o,analyticsService:s,imageApi:c,...l}=e,{state:u,interaction:d,interactionState:f,timepointState:p,nextInteraction:h,nextInteractionState:g,...v}=Ll({mode:i,timepoint:n,latestSession:o}),b=i===Ze.Create;function x(e){let n=0;for(;n<t.timepoints.length;){let r=t.timepoints[n],i=0;for(;i<r.interactions.length;){let t=r.interactions[i];if(t.id===e)return{localTimepoint:r,localInteraction:t};i++}n++}return{localInteraction:null,localTimepoint:null}}function S(e){let n=0;for(;n<t.timepoints.length;){let r=t.timepoints[n];if(r.id===e)return r;n++}return null}function C(e){let n=Te.getTypeInfo(e.typeId);return{id:hr(e.id)?void 0:e.id,typeId:e.typeId,type:n.typeName,interactiveId:t.id,timepointId:hr(e.timepointId)?void 0:e.timepointId,order:e.order}}function w(e,t){let n=S(e),i=n.interactions.find(e=>e.id.toString()===t.toString());r.currentTime(n.visibleAt/1e3),v.updateTimepointState(n.id,{interactionIndex:n.interactions.indexOf(i)})}async function T(e){let{localInteraction:n,localTimepoint:r}=x(e);if(!n||!r)throw Error(`Could not find the interaction and timepoint for the interactionId ${e}`);let i=C(n);hr(n.id)?s?.logUserAction(i,{actionType:y.Create,entity:_.Interaction,workflowPhase:m.Discard}):(await _c.deleteInteraction(n.id),s?.logUserAction(i,{actionType:y.Delete,entity:_.Interaction,workflowPhase:m.Complete}));let a=r.interactions.findIndex(e=>e.id===n.id);r.interactions.splice(a,1),v.clearInteractionState(n.id);let o=v.getTimepointState(r.id);if(a<o.interactionIndex&&v.updateTimepointState(r.id,{interactionIndex:o.interactionIndex-1}),r.interactions.length>0)return;hr(r.id)||await _c.deleteTimepoint(r.id);let c=t.timepoints.findIndex(e=>e.id===r.id);t.timepoints.splice(c,1),l.removeCue(r.visibleAt/1e3),v.clearTimepointState(r.id)}function E(e){if(!d){e&&e();return}let t=hr(d.id);if(!t&&!f?.hasChanges&&!p?.hasChanges){e&&e();return}let n=()=>{if(p?.hasChanges&&R(!0),t){T(d.id);return}v.clearInteractionState(d.id)};re.render((0,U.jsx)(`p`,{children:`Do you want to discard your changes?`}),{title:`Unsaved changes`,submitButtonProps:{onClick:()=>{n(),e&&e()},variant:`danger`,text:`Discard`},cancelButtonProps:{variant:`link`,text:`Cancel`}})}function D(e,t=!0){if(b){E(()=>{v.updateTimepointState(n.id,{interactionIndex:e})});return}let r=()=>{v.updateTimepointState(n.id,{nextInteractionIndex:e}),window.requestAnimationFrame(()=>{v.updateTimepointState(n.id,{nextInteractionIndex:e,slideIn:!0}),window.setTimeout(()=>{v.updateTimepointState(n.id,{interactionIndex:e,nextInteractionIndex:null,slideIn:null})},400)})};t?E(r):r()}function O(){if(p.interactionIndex+1>=n.interactions.length){l.continueInteractive();return}D(p.interactionIndex+1,!1)}function k(e){r.pause();let i=n?.id||zl(),a={id:zl(),timepointId:i,typeId:e,order:n?.interactions?.length||0,interactiveId:t.id,data:{}},o=C(a);if(s?.logUserAction(o,{actionType:y.Create,entity:_.Interaction,workflowPhase:m.Start}),n){n.interactions.push(a),D(p.interactionIndex);return}let c=r.currentTime();t.timepoints||=[],t.timepoints.push({id:i,visibleAt:c*1e3,interactiveId:t.id,shouldPause:1,interactions:[a]}),A(),l.addCue(i)}function A(){t.timepoints.sort((e,t)=>e.visibleAt>t.visibleAt?1:t.visibleAt>e.visibleAt?-1:0)}async function j(){if(!b)throw Error(`Should not be calling onClickSave while viewing an interactive`);let e=ml(d.typeId)(v.getInteractionState(d.id),d);if(e){v.updateInteractionState(d.id,{error:e});return}if(v.updateInteractionState(d.id,{spinner:!0}),hr(n.id)){let e=n.id;await _c.saveTimepoint(n),l.updateCue(e,n.id),v.clearTimepointState(e),p?.hasChanges&&(A(),R())}d.timepointId=n.id;let t=d.id;await gl(d.typeId)(v.getInteractionState(d.id),d),v.clearInteractionState(t);let r=hr(t),i=C(d);s?.logUserAction(i,{actionType:r?y.Create:y.Edit,entity:_.Interaction,workflowPhase:r?m.Complete:m.Save})}async function M(){if(i!==Ze.View)throw Error(`Should not be calling onClickSubmit while creating an interactive`);if(f.submitted){if(p.interactionIndex>=n.interactions.length){l.continueInteractive();return}D(p.interactionIndex+1);return}let e=gr(f),r=ir(d.typeId)(e,d);if(r){v.updateInteractionState(d.id,{error:r});return}let o={};if(a&&f.hasChanges){let t=or(d.typeId);if(v.updateInteractionState(d.id,{spinner:!0}),t){o=await t(e,d,a.save,{imageApi:c})||{};let n=C(d);s?.logUserAction(n,{actionType:y.Submit,entity:_.Interaction})}}if(v.updateInteractionState(d.id,{...o,submitted:!0,error:null,hasChanges:!1,spinner:!1}),!t.immediateFeedback){O();return}$n(d.typeId)(d)||O()}async function ee(){hr(n.id)||(await _c.updateTimepoint(n),A(),R())}async function N(){if(f?.hasChanges){E();return}await T(d.id),l.setOpen(!0)}function P(){D(n.interactions.length)}function te(){r.pause(),l.setOpen(!0),n&&P()}function ne(){if(n){D(p.interactionIndex-1);return}l.setOpen(!1),r.play()}function F(e){let{localInteraction:t}=x(e),n=C(t);s?.logUserAction(n,{actionType:y.Delete,entity:_.Interaction,workflowPhase:m.Start}),re.render((0,U.jsx)(`p`,{children:`Are you sure you want to delete this question?`}),{title:`Delete question`,submitButtonProps:{onClick:()=>T(e),variant:`danger`,text:`Delete question`},cancelButtonProps:{variant:`link`,text:`Cancel`}})}function I(e){let r=n.visibleAt+e*1e3,i=e>0;for(let e=0;e<t.timepoints.length;e++){let n=t.timepoints[e];r<n.visibleAt-1e3||r>n.visibleAt+1e3||(r=i?n.visibleAt+1001:n.visibleAt-1001,e=0)}return r}function L(e){let t=r.duration(),i=I(e);if(i/1e3>t||i<0)return;let a=n.visibleAt;Rl||(Rl=!0,v.updateTimepointState(n.id,{originalVisibleAt:a,hasChanges:!0})),l.moveTimepoint(i)}function R(e){!Rl&&!p?.hasChanges||(e&&p?.originalVisibleAt!==void 0&&l.moveTimepoint(p.originalVisibleAt),v.updateTimepointState(n.id,{hasChanges:void 0,originalVisibleAt:void 0}),Rl=!1)}async function ie(e){for(let t=0;t<e.length;t++)await _c.saveInteraction({...e[t],order:t});let t=n.interactions[p.interactionIndex];n.interactions=e,v.updateTimepointState(n.id,{interactionIndex:e.indexOf(t)})}return{state:u,interaction:d,interactionState:f,timepointState:p,nextInteraction:h,nextInteractionState:g,duration:r.duration(),skip:O,cancel:N,addAnotherQuestion:P,goToTimepoint:w,discardChanges:E,changeIndex:D,promptDelete:F,showTypeSelector:te,cancelTypeSelector:ne,deleteInteraction:T,saveInteraction:j,addInteraction:k,submitInteractionAnswer:M,userUpdateInteractionState:v.userUpdateInteractionState,updateTimepointTime:L,saveTimepoint:ee,clearTimepointTimeState:R,reOrderQuestions:ie}},Vl=e=>{let{player:t,track:n,interactive:r,clipOffset:i}=e,[a,o]=H.useState(!1),[s,c]=H.useState(!1),[l,u]=H.useState(null);H.useEffect(()=>(n.addEventListener(`cuechange`,p),()=>n.removeEventListener(`cuechange`,p)));function d(e){return i?e+i:e}function f(e){c(e?a:!1),o(e)}function p(){let e=n.activeCues;if(!e.length){f(!1),u(null);return}let i=r.timepoints.find(t=>t.id.toString()===e[0].text.toString());if(!i){f(!1),u(null);return}i.shouldPause&&(t.seeking()?t.one(`play`,()=>t.pause()):t.pause()),f(!0),u(i)}function m(){f(!1),t.play()}function h(e){for(let t=0;t<n.cues.length;t++){let r=n.cues[t];if(r.text.toString()===e.toString())return r}}function g(e,t){let n=h(e);n.text=t.toString(),n.originalCue_.text=t.toString()}function _(e){let r=t.currentTime();n.addCue({startTime:d(r)-.001,endTime:d(r+1),text:e}),n.trigger(`cv:cuechange`),t.paused()&&n.trigger(`cuechange`)}function v(e){e=d(e);let t=0;for(;t<n.cues.length;){let r=n.cues[t];if(r.startTime<=e&&r.endTime>=e){n.removeCue(r),n.trigger(`cv:cuechange`),n.trigger(`cuechange`);break}t++}}function y(e){let r=h(l.id);if(!r)return;let i=e/1e3;r.startTime=d(i),r.endTime=d(i+1),t.currentTime(i+.5,!0),l.visibleAt=e,n.trigger(`cv:cuechange`)}return{open:a,setOpen:f,wasOpen:s,timepoint:l,continueInteractive:m,updateCue:g,addCue:_,removeCue:v,moveTimepoint:y,getClipOffset:d}};function Hl(e){let{mode:t,player:n,timepoint:r,interaction:i,discardChanges:a,interactionState:o,timepointState:s}=e,c=ie(),l=t===Ze.Create;H.useEffect(()=>{if(l){if(hr(i?.id)||o?.hasChanges||s?.hasChanges){c.lock({id:`interactive`,title:`Are you sure you want to leave?`,text:`Your interactive still has unsaved changes`}),n.lock(e=>{a(e)});return}n.unlock(),c.unlock(`interactive`)}},[i,o?.hasChanges,r?.interactions?.length,s?.hasChanges])}function Ul(e){let t=0;return e?.timepoints?.forEach(e=>e.interactions?.forEach(()=>t++)),t>0}function Wl(e){let t=!e.parentVideo||e.parentVideo?.status===C.Published,n=Ul(e.interactive)&&t,r=[];e.onClickEditDetails&&r.push({label:`Edit details`,svg:be,button:!0,className:`btn btn-outline-dark`,onClick:e.onClickEditDetails}),e.onClickPublish&&r.push({label:`Publish`,button:!0,className:`btn btn-dark ms-2${n?``:` disabled`}`,disabled:!n,tooltip:n?``:t?`Interactives cannot be published without questions`:`Parent video must be published before interactives can be published`,onClick:i}),e.onClickCopy&&r.push({label:`Copy interactive`,button:!1,onClick:e.onClickCopy}),e.onClickDelete&&r.push({label:`Delete interactive`,button:!1,onClick:e.onClickDelete,className:`text-danger`});function i(){n&&e.onClickPublish&&e.onClickPublish()}return r.length?(0,U.jsx)(z,{node:e.portalNode,children:(0,U.jsx)(_e,{actions:r,actionsDropdownClassName:`btn btn-outline-dark ms-2`})}):(0,U.jsx)(U.Fragment,{})}function Gl(e){let{title:t,player:n,track:r,mode:i,interactive:a,imageApi:o,actionsPortalNode:s,questionListPortalNode:c,summaryPortalNode:l,resultsService:u,currentUser:d,progress:f,latestSession:p,clipOffset:m,analyticsService:h,enableImmersiveReader:g,mobile:_,parentVideo:v,experimentalInteractiveQuestions:y}=e,{open:b,timepoint:x,wasOpen:S,...C}=Vl({player:n,track:r,interactive:a,mode:i,clipOffset:m}),{interaction:w,interactionState:T,nextInteraction:E,nextInteractionState:D,timepointState:O,state:k,...A}=Bl({mode:i,interactive:a,timepoint:x,player:n,resultsService:u,latestSession:p,analyticsService:h,imageApi:o,...C});Hl({mode:i,player:n,timepoint:x,interaction:w,discardChanges:A.discardChanges,interactionState:T,timepointState:O});let j={mode:i,open:b,isCreate:i===Ze.Create,interaction:w,nextInteraction:E,timepoint:x,interactive:a,interactionState:T,nextInteractionState:D,timepointState:O,player:n};return(0,U.jsxs)(U.Fragment,{children:[!!s&&(0,U.jsx)(Wl,{interactive:a,onClickEditDetails:e.onClickEditDetails,onClickPublish:e.onClickPublish,onClickDelete:e.onClickDelete,onClickCopy:e.onClickCopy,portalNode:s,parentVideo:v}),(0,U.jsx)(tt,{...j,...A}),(0,U.jsx)(Ml,{imageApi:o,currentUser:d,mobile:_,immediateFeedback:a.immediateFeedback,delayFocus:!S,enableImmersiveReader:g,experimentalInteractiveQuestions:y,...j,...A,...C}),(0,U.jsx)(xr,{title:t,currentUser:d,state:k,portalNode:l,progress:f,resultsService:u,imageCdnUrl:o.toString(),onShowSummary:e.onShowSummary,mobile:_,...j,...A}),(0,U.jsx)(Cr,{portalNode:c,experimentalInteractiveQuestions:y,...j,...A})]})}Ae.registerComponent(`Interactive`,ke((e,t)=>(0,U.jsx)(Gl,{player:e,...t})));var Kl={continueSessionPopup:`_continueSessionPopup_19hmy_2`,popupButtons:`_popupButtons_19hmy_5`};function ql(e){let{player:t}=e;function n(){let e=t.getChild(`ContinueSession`);t.removeChild(e),e.dispose()}function r(){e.continue(!0),n()}function i(){e.continue(!1),n()}return(0,U.jsxs)(L,{title:`Continue interactive?`,closePopup:r,dialogClassName:Kl.continueSessionPopup,children:[(0,U.jsx)(`p`,{children:`It looks like you've already started this interactive. Would you like to continue your attempt or start a new one?`}),(0,U.jsxs)(R,{className:Kl.popupButtons,children:[(0,U.jsx)(R.Cancel,{text:`Start again`,onClick:i}),(0,U.jsx)(R.Submit,{variant:`dark`,text:`Continue`,onClick:r})]})]})}Ae.registerComponent(`ContinueSession`,ke((e,t)=>(0,U.jsx)(ql,{player:e,...t})));var Jl=Ae.getPlugin(`plugin`),Yl=class extends Jl{constructor(e){super(e),this.enabled=!1,this.player.ready(()=>this.initialize())}initialize(){this.onReceiveMessage=this.onReceiveMessage.bind(this),window.addEventListener(`message`,this.onReceiveMessage,!1),window.parent.postMessage(JSON.stringify({type:`cv-app-loaded`}),`*`)}dispose(){window.removeEventListener(`message`,this.onReceiveMessage)}onReceiveMessage(e){let t={};try{t=JSON.parse(e.data)}catch{return}t.type===`enable-grade-passback`&&(this.enabled=!0,window.removeEventListener(`message`,this.onReceiveMessage))}submit(e,t){let n={type:`cv-lms-submit-score`,data:{score:e,fullyGraded:t}};window.parent.postMessage(JSON.stringify(n),`*`)}};Ae.registerPlugin(`gradePassbackPlugin`,Yl);var Xl=Ae.getPlugin(`plugin`),Zl=class extends Xl{constructor(e,t){super(e),this.continueSession=!1,this.options=t,e.ready(()=>this.initialize())}initialize(){this.player.gradePassbackPlugin(),De.useMetadataTrack(this.player,`interactive`,this.onTrackLoaded.bind(this)),this.player.addClass(`cv-interactive-plugin`),this.options.resultsService&&!this.options.latestSession&&(this.startSession=this.startSession.bind(this),this.player.one(`play`,this.startSession),this.on(`dispose`,()=>{this.player.off(`play`,this.startSession)}))}startSession(){let e=this.options.latestSession?.resultId;this.continueSession||(e=null),this.options.resultsService.start(e)}onTrackLoaded(e){if(!this.options.resultsService||!this.options.latestSession){this.addChildren(e);return}this.player.addChild(`ContinueSession`,{continue:t=>{this.options.analyticsService?.logUserAction({},{actionType:y.Click,entity:_.Interactive,descriptor:t?h.ContinueSession:h.NewSession}),this.continueSession=t,this.startSession(),this.addChildren(e),this.continueSession||this.player.currentTime(0),this.player.play()}})}getClipOffset(){return this.options.clipOffset?parseFloat(this.options.clipOffset.toPrecision(4)):null}addChildren(e){this.player.addChild(`Interactive`,{...this.options,track:e,clipOffset:this.getClipOffset(),mode:this.options.mode||Ze.View,latestSession:this.continueSession&&this.options.latestSession}),this.player.controlBar.getChild(`progressControl`).getChild(`SeekBar`).addChild(new Pe(this.player,{interactive:this.options.interactive,track:e}))}};Ae.registerPlugin(`viewInteractivePlugin`,Zl);var Ql=class extends Me{constructor(e,t){super(e,t),this.totalProgress=[],Oe.setToken(`gateway`,this.options.authToken),this.options.mode===Ze.Create&&this.player.addClass(`cv-create-interactives`)}togglePreviewPreventScrubbing(){let e=this.player.preventScrubbingPlugin();e&&e.togglePreview(!e.isPreviewing)}getPlayerOptions(){let e=super.getPlayerOptions();return e.setMaxHeight=!1,this.options.embed||(e.aspectRatio=`16:9`),e.preferFullWindow=!0,e}onFlushProgress(e,t){super.onFlushProgress(e,t),this.options.mode!==Ze.Create&&this.totalProgress.push(...e)}configurePlugins(){this.player.loopVideoPlugin({allowLoop:this.options.allowLoop})}async additionalSetup(e){super.additionalSetup(e),this.setupClipPlugin(e),this.setupPreventScrubbingPlugin(e)}setupAnalyticsDependentPlugins(e){super.setupAnalyticsDependentPlugins(e),this.setupViewInteractivePlugin(e)}handleAutoplay(e){if(this.options.collectResults&&this.options.currentUser&&this.options.shareId&&e.additionalData?.latestSession){this.options.autoplay&&this.showSplash();return}super.handleAutoplay(e)}setupPreventScrubbingPlugin(e){if(!e.additionalData?.interactive)return;let t=e.additionalData.interactive,n=this.options.mode===Ze.Create||!this.options.collectResults;this.player.preventScrubbingPlugin({isEnabled:!n&&t.preventScrubbing,furthestVisitedTime:this.options.furthestVisitedTime??0})}setupClipPlugin(e){if(!e?.additionalData?.clipData)return;let t=e.additionalData.clipData;this.player.clipPlugin({startTime:t.startTime,endTime:t.endTime})}filterNewQuestionTypes(e){return{...e,timepoints:e.timepoints?.map(e=>({...e,interactions:e.interactions?.filter(e=>!x[e.typeId])})).filter(e=>!!e.interactions?.length)}}validateCollectResultsOptions(){this.options.shareId||a.throw(new o(`Must provide a shareId in order to collect interactive results`))}setupViewInteractivePlugin(e){this.track=Ne.getInteractiveTrack(this.player,e);let t=e.additionalData.interactive;this.options.experimentalInteractiveQuestions||(t=this.filterNewQuestionTypes(t));let n=e.additionalData.clipData?.startTime;this.options.collectResults&&(this.validateCollectResultsOptions(),this.resultsService=new $e({interactiveId:t.id,metadataId:e.mediaId,userId:this.options.currentUser.id,customerId:this.options.currentUser.customerId,playerApi:this.options.playerApi,shareId:this.options.shareId})),this.player.viewInteractivePlugin({interactive:t,title:e.title,mode:this.options.mode,imageApi:this.options.imageApi,resultsService:this.resultsService,actionsPortalNode:this.options.actionsPortalNode,questionListPortalNode:this.options.questionListPortalNode,summaryPortalNode:this.options.summaryPortalNode,currentUser:this.options.currentUser,latestSession:e.additionalData.latestSession,progress:this.totalProgress,parentVideo:this.options.parentVideo,clipOffset:n,analyticsService:this.analyticsService,enableImmersiveReader:this.options.enableImmersiveReader,onShowSummary:this.options.onShowSummary,onClickCopy:this.options.onClickCopy,onClickEditDetails:this.options.onClickEditDetails,onClickPublish:this.options.onClickPublish,onClickDelete:this.options.onClickDelete,mobile:this.options.mobile,experimentalInteractiveQuestions:this.options.experimentalInteractiveQuestions})}getAdditionalAnalyticsData(e){return e.additionalData?.clipData?.clipId?{clip:{id:e.additionalData?.clipData?.clipId}}:{}}getSeekBarOptions(){return{ignoreChapters:!0}}getAnalyticsPlayerType(){return`interactive-player`}setActivityStatus(e,t){this.player.activityStatusPlugin().setActivityStatus(e,t)}setNextVideo(e,t,n){this.player.nextVideoPlugin().setNextVideo(e,t,n)}};function $l(e){let{onReady:t,className:n,...r}=e,i=H.useRef(null);return H.useEffect(()=>{let e=new Ql(i.current,r);return t&&e.ready(()=>{t(Je(e))}),()=>{window.requestAnimationFrame(()=>e.dispose())}},[]),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{ref:i,className:n}),(0,U.jsx)(`div`,{id:`popup-region`})]})}export{$l as ClickViewInteractivePlayer,$l as default,Ze as t};
|
|
36
|
-
//# sourceMappingURL=
|
|
36
|
+
//# sourceMappingURL=D_t70KgV2.chunk.js.map
|