1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[17418],{33229:function(e,t,n){"use strict";n.d(t,{y:function(){return l}});var r=n(7653),i=n(93156),a=n(25157),o={defaultTabIndex:void 0,disabledTabIndex:-1};function l(e,t,n,l){void 0===l&&(l=o);var s=l.defaultTabIndex,c=l.disabledTabIndex,u=t.active,d=t.onClick,h=t.onFocus,f=t.onKeyDown,p=t.onKeyUp,m=t.onBlur,g=t.tabIndex,v=r.useState(),b=v[0],y=v[1],w=r.useState(!1),x=w[0],C=w[1],E=r.useRef(null),k=r.useCallback(function(e){x&&C(!1),null==m||m(e)},[x,m]);return[e&&(u||x),{onBlur:k,onClick:e?d:void 0,onFocus:e?h:void 0,onKeyDown:r.useCallback(function(e){i.gT(e)&&(e.preventDefault(),e.key!==b&&C(!0)),y(e.key),null==f||f(e)},[b,f]),onKeyUp:r.useCallback(function(e){var t;i.gT(e)&&(C(!1),null===(t=E.current)||void 0===t||t.click()),y(void 0),null==p||p(e)},[p,E]),ref:(0,a.lq)(E,n),tabIndex:e?void 0===g?s:g:c}]}},67824:function(e,t,n){"use strict";n.d(t,{l:function(){return o}});var r=n(17785),i=n(7653),a=n(39199),o=function(e){function t(t){var n=e.call(this,t)||this;return n.timeoutIds=[],n.requestIds=[],n.clearTimeouts=function(){if(n.timeoutIds.length>0){for(var e=0,t=n.timeoutIds;e<t.length;e++){var r=t[e];window.clearTimeout(r)}n.timeoutIds=[]}},n.cancelAnimationFrames=function(){if(n.requestIds.length>0){for(var e=0,t=n.requestIds;e<t.length;e++){var r=t[e];window.cancelAnimationFrame(r)}n.requestIds=[]}},(0,a.KV)("production")||n.validateProps(n.props),n}return(0,r.ZT)(t,e),t.prototype.componentDidUpdate=function(e,t,n){(0,a.KV)("production")||this.validateProps(this.props)},t.prototype.componentWillUnmount=function(){this.clearTimeouts(),this.cancelAnimationFrames()},t.prototype.requestAnimationFrame=function(e){var t=window.requestAnimationFrame(e);return this.requestIds.push(t),function(){return window.cancelAnimationFrame(t)}},t.prototype.setTimeout=function(e,t){var n=window.setTimeout(e,t);return this.timeoutIds.push(n),function(){return window.clearTimeout(n)}},t.prototype.validateProps=function(e){},t}(i.PureComponent)},52956:function(e,t,n){"use strict";n.d(t,{v:function(){return r}});var r={CENTER:"center",END:"end",LEFT:"left",RIGHT:"right",START:"start"}},12131:function(e,t,n){"use strict";n.d(t,{AFY:function(){return G},Alt:function(){return Y},Auc:function(){return eA},BgB:function(){return em},Bzc:function(){return eS},Cg9:function(){return e1},Cr2:function(){return eW},Csj:function(){return A},D2c:function(){return eG},Dct:function(){return tx},Enz:function(){return tt},Eye:function(){return W},FMD:function(){return ek},Fcr:function(){return tk},G07:function(){return eB},G7x:function(){return tg},GPh:function(){return ey},GdN:function(){return eM},GjQ:function(){return _},H$A:function(){return X},HC1:function(){return P},HcK:function(){return eg},Hpx:function(){return eJ},ILo:function(){return F},IRm:function(){return x},IYJ:function(){return O},J4_:function(){return R},JuP:function(){return ez},K14:function(){return tC},KCg:function(){return e2},Kgk:function(){return tv},KrR:function(){return ta},KtJ:function(){return v},Kyb:function(){return eL},LFI:function(){return eE},Lf7:function(){return tl},LiQ:function(){return ty},Lwu:function(){return ed},Mfv:function(){return tc},N1M:function(){return eY},N63:function(){return V},NL3:function(){return tP},O4S:function(){return eo},P1s:function(){return eT},P5D:function(){return td},Pyr:function(){return h},RBc:function(){return eP},RP2:function(){return es},RjW:function(){return eR},SDr:function(){return ei},SHB:function(){return tf},T5o:function(){return I},TUJ:function(){return B},TmF:function(){return Z},TwB:function(){return e9},URx:function(){return ex},Vl1:function(){return U},W$E:function(){return eO},Wi$:function(){return en},Wmm:function(){return tw},XOB:function(){return tA},XaB:function(){return eF},YHb:function(){return eX},YSh:function(){return tp},YbB:function(){return e8},YoZ:function(){return te},YuG:function(){return ev},ZA5:function(){return Q},ZA9:function(){return e0},ZoI:function(){return z},_4w:function(){return eV},_Gh:function(){return j},_Kv:function(){return tS},aSe:function(){return ti},aXM:function(){return tm},aa8:function(){return tR},abV:function(){return e4},bIF:function(){return th},bkT:function(){return eU},brc:function(){return w},cDM:function(){return to},cO4:function(){return L},cPG:function(){return ec},cm4:function(){return tb},dYo:function(){return et},dah:function(){return J},dd0:function(){return e6},dr5:function(){return k},e$L:function(){return K},eGL:function(){return eQ},eHu:function(){return ep},fgl:function(){return eC},hAT:function(){return m},hPX:function(){return el},hdN:function(){return T},hlT:function(){return eI},iEm:function(){return ej},iNe:function(){return s},jce:function(){return g},jxF:function(){return eh},ktp:function(){return e_},lnC:function(){return y},lvD:function(){return $},lzN:function(){return e7},mCh:function(){return eH},mHA:function(){return eq},mM1:function(){return eu},ntJ:function(){return q},nvt:function(){return e$},oPt:function(){return eK},oUC:function(){return S},p5I:function(){return ef},pIs:function(){return er},q01:function(){return D},qEr:function(){return ts},qNT:function(){return ee},qd:function(){return E},qrB:function(){return tu},rr$:function(){return f},rtP:function(){return ea},sfD:function(){return tT},skh:function(){return ew},t$L:function(){return eD},tj6:function(){return tn},tsZ:function(){return N},u$T:function(){return eZ},uR6:function(){return tr},ur0:function(){return p},v8x:function(){return eN},wGP:function(){return tE},xqG:function(){return e5},ySA:function(){return eb},yXI:function(){return d},yZ9:function(){return M},znr:function(){return b},zxm:function(){return e3}});var r=n(52956),i=n(37564),a=n(25117),o=n(88876),l="bp5";"undefined"!=typeof BLUEPRINT_NAMESPACE?l=BLUEPRINT_NAMESPACE:"undefined"!=typeof REACT_APP_BLUEPRINT_NAMESPACE&&(l=REACT_APP_BLUEPRINT_NAMESPACE);var s="".concat(l,"-active"),c="".concat(l,"-align-left"),u="".concat(l,"-align-right"),d="".concat(l,"-compact"),h="".concat(l,"-dark"),f="".concat(l,"-disabled"),p="".concat(l,"-fill"),m="".concat(l,"-fixed"),g="".concat(l,"-fixed-top"),v="".concat(l,"-inline"),b="".concat(l,"-interactive"),y="".concat(l,"-large"),w="".concat(l,"-loading"),x="".concat(l,"-minimal"),C="".concat(l,"-outlined"),E="".concat(l,"-multiline"),k="".concat(l,"-read-only"),S="".concat(l,"-round"),T="".concat(l,"-selected"),P="".concat(l,"-small"),M="".concat(l,"-vertical");tM(o.Ly.TOP),tM(o.Ly.BOTTOM),tM(o.Ly.LEFT),tM(o.Ly.RIGHT),tS(i.u.ZERO),tS(i.u.ONE),tS(i.u.TWO),tS(i.u.THREE),tS(i.u.FOUR),tP(a.S.PRIMARY),tP(a.S.SUCCESS),tP(a.S.WARNING),tP(a.S.DANGER);var R="".concat(l,"-text-overflow-ellipsis"),A="".concat(l,"-blockquote"),L="".concat(l,"-code"),_="".concat(l,"-code-block"),I="".concat(l,"-heading"),O="".concat(l,"-list"),D="".concat(l,"-button"),z="".concat(D,"-group"),N="".concat(D,"-spinner"),F="".concat(D,"-text"),B="".concat(l,"-card"),H="".concat(l,"-context-menu"),V="".concat(H,"-virtual-target"),j="".concat(H,"-popover"),$="".concat(H,"-backdrop"),U="".concat(l,"-control-group"),W="".concat(l,"-dialog"),G="".concat(W,"-container"),q="".concat(W,"-header"),Z="".concat(W,"-body"),X="".concat(W,"-close-button"),Y="".concat(W,"-footer"),K="".concat(W,"-footer-actions"),J="".concat(l,"-divider"),Q="".concat(l,"-editable-text"),ee="".concat(Q,"-content"),et="".concat(Q,"-editing"),en="".concat(Q,"-input"),er="".concat(Q,"-placeholder"),ei="".concat(l,"-flex-expander"),ea="".concat(l,"-html-select"),eo="".concat(l,"-input"),el="".concat(eo,"-group"),es="".concat(eo,"-left-container"),ec="".concat(eo,"-action"),eu="".concat(l,"-text-area"),ed="".concat(eu,"-auto-resize"),eh="".concat(l,"-control"),ef="".concat(eh,"
1-indicator"),ep="".concat(ef,"-child"),em="".concat(l,"-checkbox"),eg="".concat(l,"-radio"),ev="".concat(l,"-switch"),eb="".concat(ev,"-inner-text"),ey="".concat(l,"-label"),ew="".concat(l,"-menu"),ex="".concat(ew,"-item"),eC="".concat(ex,"-is-selectable"),eE="".concat(ex,"-selected-icon"),ek="".concat(ex,"-icon"),eS="".concat(ex,"-label"),eT="".concat(l,"-submenu"),eP="".concat(eT,"-icon"),eM="".concat(ew,"-divider"),eR="".concat(ew,"-header"),eA="".concat(l,"-navbar"),eL="".concat(eA,"-group"),e_="".concat(eA,"-heading"),eI="".concat(eA,"-divider"),eO="".concat(l,"-numeric-input"),eD="".concat(l,"-overflow-list"),ez="".concat(eD,"-spacer"),eN="".concat(l,"-overlay"),eF="".concat(eN,"-backdrop"),eB="".concat(eN,"-content"),eH="".concat(eN,"-inline"),eV="".concat(eN,"-open"),ej="".concat(eN,"-scroll-container"),e$="".concat(eN,"-start-focus-trap"),eU="".concat(eN,"-end-focus-trap"),eW="".concat(l,"-popover"),eG="".concat(eW,"-arrow"),eq="".concat(eW,"-backdrop"),eZ="".concat(eW,"-capturing-dismiss"),eX="".concat(eW,"-content"),eY="".concat(eW,"-placement"),eK="".concat(eW,"-dismiss"),eJ="".concat(eK,"-override"),eQ="".concat(eW,"-match-target-width"),e0="".concat(eW,"-open"),e1="".concat(eW,"-popper-escaped"),e2="".concat(eW,"-reference-hidden"),e4="".concat(eW,"-target"),e3="".concat(eW,"-transition-container"),e8="".concat(l,"-portal"),e6="".concat(l,"-slider"),e5="".concat(e6,"-axis"),e9="".concat(e6,"-handle"),e7="".concat(e6,"-label"),te="".concat(e6,"-track"),tt="".concat(e6,"-progress"),tn="".concat(l,"-start"),tr="".concat(l,"-end"),ti="".concat(l,"-spinner"),ta="".concat(ti,"-animation"),to="".concat(ti,"-head"),tl="".concat(l,"-no-spin"),ts="".concat(ti,"-track"),tc="".concat(l,"-tab"),tu="".concat(tc,"-icon"),td="".concat(tc,"-tag"),th="".concat(tc,"-indicator"),tf="".concat(th,"-wrapper"),tp="".concat(tc,"-list"),tm="".concat(tc,"-panel"),tg="".concat(tc,"s"),tv="".concat(l,"-tag"),tb="".concat(tv,"-remove"),ty="".concat(l,"-tooltip"),tw="".concat(l,"-icon"),tx="".concat(tw,"-standard"),tC="".concat(tw,"-large");function tE(){return l}function tk(e){switch(e){case r.v.LEFT:case r.v.START:return c;case r.v.RIGHT:case r.v.END:return u;default:return}}function tS(e){if(void 0!==e)return"".concat(l,"-elevation-").concat(e)}function tT(e){if(null!=e)return 0===e.indexOf("".concat(l,"-icon-"))?e:"".concat(l,"-icon-").concat(e)}function tP(e){if(null!=e&&e!==a.S.NONE)return"".concat(l,"-intent-").concat(e.toLowerCase())}function tM(e){if(void 0!==e)return"".concat(l,"-position-").concat(e)}function tR(e,t){if("small"===e)return P;if("large"===e)return y;var n,r=t.large,i=t.small;return(n={})[y]=void 0!==r&&r,n[P]=void 0!==i&&i,n}function tA(e,t){if("outlined"===e)return C;if("minimal"===e)return x;var n,r=t.minimal,i=t.outlined;return(n={})[x]=void 0!==r&&r,n[C]=void 0!==i&&i,n}},37564:function(e,t,n){"use strict";n.d(t,{u:function(){return r}});var r={ZERO:0,ONE:1,TWO:2,THREE:3,FOUR:4}},55927:function(e,t,n){"use strict";n.d(t,{A2:function(){return E},C0:function(){return O},EG:function(){return d},Fp:function(){return T},GO:function(){return b},Ig:function(){return C},J$:function(){return I},Nd:function(){return R},Q2:function(){return g},Qn:function(){return o},R6:function(){return i},T$:function(){return z},WQ:function(){return w},XY:function(){return u},YQ:function(){return k},Zc:function(){return y},an:function(){return h},b7:function(){return c},e7:function(){return l},eD:function(){return S},fq:function(){return v},kP:function(){return A},qD:function(){return F},sh:function(){return D},sy:function(){return _},vS:function(){return L},vy:function(){return a},wN:function(){return N},wT:function(){return p},x1:function(){return P},xC:function(){return s},xl:function(){return x},y4:function(){return M},yV:function(){return f},zZ:function(){return m}});var r="[Blueprint]",i=r+" clamp: max cannot be less than min",a=r+" <InputGroup> leftElement and leftIcon prop are mutually exclusive, with leftElement taking priority.",o=r+' <NavbarGroup> does not support align="center". Only "left" or "right" alignment is allowed, and align="center" will be ignored.',l=r+" <NumericInput> requires min to be no greater than max if both are defined.",s=r+" <NumericInput> requires minorStepSize to be no greater than stepSize.",c=r+" <NumericInput> requires stepSize to be no greater than majorStepSize.",u=r+" <NumericInput> requires minorStepSize to be strictly greater than zero.",d=r+" <NumericInput> requires majorStepSize to be strictly greater than zero.",h=r+" <NumericInput> requires stepSize to be strictly greater than zero.",f=r+" <NumericInput> controlled value prop does not adhere to stepSize, min, and/or max constraints.",p=r+" <OverflowList> does not support changing observeParents after mounting.",m="".concat(r," <Popover> requires renderTarget prop or a child element."),g="".concat(r,' <Popover hasBackdrop={true}> requires interactionKind="click".'),v="".concat(r," <Popover> supports only one child which is rendered as its target; additional children are ignored."),b=r+" <Popover> with children ignores renderTarget prop; use either prop or children.",y=r+" Disabling <Popover> with empty/whitespace content...",w=r+" <Popover usePortal={fal
1se}> ignores hasBackdrop",x=r+" <Popover> supports either placement or position prop, not both.",C=r+" <Popover> onInteraction is ignored when uncontrolled.",E=r+" <Popover> targetProps value is ignored when renderTarget API is used.",k=r+" <Portal> context blueprintPortalClassName must be string",S=r+" setting blueprintPortalClassName via legacy React context API is deprecated, use <PortalProvider> instead.",T=r+" <Slider> stepSize must be greater than zero.",P=r+" <Slider> labelStepSize must be greater than zero.",M=r+" <Slider> min prop must be a finite number.",R=r+" <Slider> max prop must be a finite number.",A=r+" <MultiSlider> children must be <SliderHandle>s or <SliderTrackStop>s",L=r+" <MultiSlider> labelStepSize and labelValues prop are mutually exclusive, with labelStepSize taking priority.",_=r+" <Spinner> Classes.SMALL/LARGE are ignored if size prop is set.",I=r+" <Dialog> iconName is ignored if title is omitted.",O=r+" <Dialog> isCloseButtonShown prop is ignored if title is omitted.",D=r+" <Overlay2> was used outside of a <OverlaysProvider> context. This will no longer be supported in Blueprint v6. See https://github.com/palantir/blueprint/wiki/Overlay2-migration",z=r+" <Overlay2> cannot use childRef and childRefs props simultaneously",N=r+" <Overlay2> requires childRefs prop when rendering multiple child elements",F=r+" <Overlay2> requires each child element to have a unique key prop when childRefs is used"},25117:function(e,t,n){"use strict";n.d(t,{S:function(){return r}});var r={NONE:"none",PRIMARY:"primary",SUCCESS:"success",WARNING:"warning",DANGER:"danger"}},88876:function(e,t,n){"use strict";n.d(t,{Ly:function(){return r}});var r={BOTTOM:"bottom",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",LEFT:"left",LEFT_BOTTOM:"left-bottom",LEFT_TOP:"left-top",RIGHT:"right",RIGHT_BOTTOM:"right-bottom",RIGHT_TOP:"right-top",TOP:"top",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"}},84614:function(e,t,n){"use strict";n.d(t,{B:function(){return o},g:function(){return i}});var r=n(17785),i="Blueprint5",a=["active","alignText","asyncControl","containerRef","current","elementRef","ellipsizeText","endIcon","fill","icon","iconSize","inputClassName","inputRef","intent","inline","large","loading","leftElement","leftIcon","minimal","onRemove","outlined","panel","panelClassName","popoverProps","rightElement","rightIcon","round","selectedValue","size","small","tagName","text","textClassName","variant"];function o(e,t,n){return void 0===t&&(t=a),void 0===n&&(n=!1),n&&(t=t.concat(a)),t.reduce(function(e,t){return -1!==t.indexOf("-")||e.hasOwnProperty(t)&&delete e[t],e},(0,r.pi)({},e))}},25157:function(e,t,n){"use strict";function r(e,t){null!=e&&"function"!=typeof e?e.current=t:"function"==typeof e&&e(t)}function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){e.forEach(function(e){r(e,t)})}}function a(e){return null===e?null:void 0===e.current?e:e.current}function o(e,t,n){return function(i){e[t]=i,r(n,i)}}n.d(t,{Km:function(){return o},Uq:function(){return a},k$:function(){return r},lq:function(){return i}})},13067:function(e,t,n){"use strict";function r(e,t,n){return void 0===n&&(n=function(e,t){return e===t}),null==e&&null==t||null!=e&&null!=t&&e.length===t.length&&e.every(function(e,r){return n(e,t[r])})}function i(e,t,n){if(null==e&&null==t)return!0;if(null==e||null==t||Array.isArray(e)||Array.isArray(t))return!1;if(null!=n)return a(e,t,n);var r=Object.keys(e),i=Object.keys(t);return a(e,t,{include:r})&&a(e,t,{include:i})}function a(e,t,n){return(function(e,t,n){if(null!=n&&null!=n.include)return n.include;if(null!=n&&null!=n.exclude){var r=Object.keys(e),i=Object.keys(t),a=r.concat(i).reduce(function(e,t){return e[t]=!0,e},{});return n.exclude.forEach(function(e){return delete a[e]}),Object.keys(a)}return[]})(e,t,n).every(function(n){return e.hasOwnProperty(n)===t.hasOwnProperty(n)&&e[n]===t[n]})}n.d(t,{cO:function(){return r},ms:function(){return i}})},94051:function(e,t,n){"use strict";n.d(t,{C2:function(){return a},GO:function(){return s},Sh:function(){return i},dS:function(){return l},vY:function(){return o}});var r=n(17785);function i(){return"undefined"!=typeof window&&null!=window.document}function a(e,t){return e===t||e.contains(t)}function o(e,t){var n,r=(null!==(n=null==e?void 0:e.getRootNode(t))&&void 0!==n?n:document).activeElement;return r instanceof HTMLElement?r:null}function l(e){return function(t){e.some(function(e){return t.key===e})&&(!function(e){if(null==e||null==e.closest)return!1;var t=e.closest("input, textarea, [contenteditable=true]");if(null==t)return!1;if("input"===t.tagName.toLowerCase()){var n=t.type;if("checkbox"===n||"radio"===n)return!1}return!t.readOnly}(t.target)&&t.preventDefault(),t.target.dispatchEvent(new MouseEvent("click",(0,r.pi)((0,r.pi)({},t),{view:void 0}))))}}function s(e){return Array.from(e.querySelectorAll('a[href]:not([tabindex="-1"]),button:not([disabled]):not([tabindex="-1"]),details:not([tabindex="-1"]),input:not([disabled]):not([tabindex="-1"]),select:not([disabled]):not([tabindex="-1"]),textarea:not([disabled]):not([tabindex="-1"]),[tabindex]:not
1([tabindex="-1"])'))}},71191:function(e,t,n){"use strict";function r(e){return"function"==typeof e}n.d(t,{m:function(){return r}})},39199:function(e,t,n){"use strict";n.d(t,{EL:function(){return c},KV:function(){return i},ke:function(){return u},mQ:function(){return a},uZ:function(){return o},vk:function(){return l}});var r=n(55927);function i(e){return"undefined"!=typeof NODE_ENV&&NODE_ENV===e}function a(e,t,n){return void 0===n&&(n=1e-5),Math.abs(e-t)<=n}function o(e,t,n){if(null==e)return e;if(n<t)throw Error(r.R6);return Math.min(Math.max(e,t),n)}function l(e){if(!isFinite(e))return 0;for(var t=1,n=0;Math.round(e*t)/t!==e;)t*=10,n++;return n}var s=new Map;function c(e){var t,n=null!==(t=s.get(e))&&void 0!==t?t:0;return s.set(e,n+1),"".concat(e,"-").concat(n)}function u(e){return"string"==typeof e&&0===e.trim().length}},93156:function(e,t,n){"use strict";function r(e){return"Enter"===e.key||" "===e.key}n.d(t,{Wl:function(){return a},X:function(){return o},gT:function(){return r}});var i=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"];function a(e){return i.includes(e.key)}function o(e,t,n){return t.includes(e.key)?-1:n.includes(e.key)?1:void 0}},85514:function(e,t,n){"use strict";n.d(t,{Mc:function(){return l},h7:function(){return a},qA:function(){return function e(t,n){return void 0===n&&(n=!1),null==t||""===t||!1===t||!n&&Array.isArray(t)&&(0===t.length||t.every(function(t){return e(t,!0)}))}},tV:function(){return s},vZ:function(){return o}});var r=n(7653),i=n(39199);function a(e,t,n){if(void 0===t&&(t="span"),void 0===n&&(n={}),!(null==e||"boolean"==typeof e||(0,i.ke)(e))){if("string"==typeof e||"number"==typeof e||"symbol"==typeof e.type||Array.isArray(e))return r.createElement(t,n,e);if(o(e))return Object.keys(n).length>0?r.cloneElement(e,n):e}}function o(e){return"object"==typeof e&&void 0!==e.type&&void 0!==e.props}function l(e,t){return null!=e&&null!=e.type&&null!=e.type.displayName&&e.type.displayName===t.displayName}function s(){return parseInt(r.version.split(".")[0],10)>=18}},28969:function(e,t,n){"use strict";n.d(t,{h:function(){return c}});var r=n(17785),i=n(45254),a=n.n(i),o=n(7653),l=n(12131),s=n(84614),c=o.forwardRef(function(e,t){var n,i=e.alignText,s=e.className,c=e.fill,u=e.minimal,d=e.outlined,h=e.large,f=e.size,p=e.variant,m=e.vertical,g=(0,r._T)(e,["alignText","className","fill","minimal","outlined","large","size","variant","vertical"]),v=a()(l.ZoI,((n={})[l.ur0]=c,n[l.yZ9]=m,n),l.Fcr(i),l.aa8(void 0===f?"medium":f,{large:h}),l.XOB(void 0===p?"solid":p,{minimal:u,outlined:d}),s);return o.createElement("div",(0,r.pi)({},g,{ref:t,className:v}),e.children)});c.displayName="".concat(s.g,".ButtonGroup")},38726:function(e,t,n){"use strict";n.d(t,{z:function(){return p}});var r=n(17785),i=n(45254),a=n.n(i),o=n(7653),l=n(33229),s=n(12131),c=n(85514),u=n(84614),d=n(33280),h=n(39174),f=n(68002),p=o.forwardRef(function(e,t){var n=m(e,t);return o.createElement("button",(0,r.pi)({type:"button"},(0,u.B)(e),n),g(e))});function m(e,t,n){var i,o=e.alignText,c=e.fill,u=e.large,d=e.loading,h=void 0!==d&&d,f=e.minimal,p=e.outlined,m=e.size,g=e.small,v=e.variant,b=e.disabled||h,y=(0,l.y)(!b,e,t,n),w=y[0],x=y[1],C=a()(s.q01,((i={})[s.iNe]=w,i[s.rr$]=b,i[s.ur0]=c,i[s.brc]=h,i),s.Fcr(o),s.NL3(e.intent),s.aa8(void 0===m?"medium":m,{large:u,small:g}),s.XOB(void 0===v?"solid":v,{minimal:f,outlined:p}),e.className);return(0,r.pi)((0,r.pi)({},x),{className:C,disabled:b})}function g(e){var t=e.children,n=e.ellipsizeText,r=e.endIcon,i=e.icon,l=e.loading,u=e.rightIcon,p=e.text,m=e.textClassName,g=!c.qA(p)||!c.qA(t);return o.createElement(o.Fragment,null,l&&o.createElement(h.$,{className:s.tsZ,size:h.E.SMALL}),o.createElement(d.I,{icon:i}),g&&o.createElement(f.x,{className:a()(s.ILo,m),ellipsize:n,tagName:"span"},p,t),o.createElement(d.I,{icon:null!=r?r:u}))}p.displayName="".concat(u.g,".Button"),o.forwardRef(function(e,t){var n=e.href,i=m(e,t,{defaultTabIndex:0,disabledTabIndex:-1});return o.createElement("a",(0,r.pi)({role:"button"},(0,u.B)(e),i,{"aria-disabled":i.disabled,href:i.disabled?void 0:n}),g(e))}).displayName="".concat(u.g,".AnchorButton")},30665:function(e,t,n){"use strict";n.d(t,{V:function(){return y}});var r=n(17785),i=n(45254),a=n.n(i),o=n(7653),l=n(75115),s=n(2374),c=n(12131),u=n(251
157),d=n(84614),h=n(67824),f=n(55927),p=n(39199),m=n(38726),g=n(41987),v=n(33280),b=n(66169),y=function(e){function t(t){var n=e.call(this,t)||this;n.childRef=o.createRef();var r=(0,p.EL)("bp-dialog");return n.titleId="title-".concat(r),n}return(0,r.ZT)(t,e),t.prototype.render=function(){var e,t=this.props,n=t.className,i=t.children,l=t.containerRef,s=t.style,d=t.title,h=t.role,f=(0,r._T)(t,["className","children","containerRef","style","title","role"]);return o.createElement(b.Z,(0,r.pi)({},f,{className:c.iEm,childRef:this.childRef,hasBackdrop:!0}),o.createElement("div",{className:c.AFY,ref:(0,u.lq)(l,this.childRef)},o.createElement("div",{className:a()(c.Eye,n),role:void 0===h?"dialog":h,"aria-modal":null!==(e=f.enforceFocus)&&void 0!==e?e:b.l.enforceFocus,"aria-labelledby":this.props["aria-labelledby"]||(d?this.titleId:void 0),"aria-describedby":this.props["aria-describedby"],style:s},this.maybeRenderHeader(),i)))},t.prototype.validateProps=function(e){null==e.title&&(null!=e.icon&&console.warn(f.J$),null!=e.isCloseButtonShown&&console.warn(f.C0))},t.prototype.maybeRenderCloseButton=function(){return!1!==this.props.isCloseButtonShown?o.createElement(m.z,{"aria-label":"Close",className:c.H$A,icon:o.createElement(l.E,{size:s.J.STANDARD}),onClick:this.props.onClose,variant:"minimal"}):void 0},t.prototype.maybeRenderHeader=function(){var e=this.props,t=e.icon,n=e.title;if(null!=n)return o.createElement("div",{className:c.ntJ},o.createElement(v.I,{icon:t,size:s.J.STANDARD,"aria-hidden":!0,tabIndex:-1}),o.createElement(g.H6,{id:this.titleId},n),this.maybeRenderCloseButton())},t.defaultProps={canOutsideClickClose:!0,isOpen:!1},t.displayName="".concat(d.g,".Dialog"),t}(h.l)},53466:function(e,t,n){"use strict";n.d(t,{rs:function(){return d}});var r=n(17785),i=n(45254),a=n.n(i),o=n(7653),l=n(12131),s=n(25157),c=n(84614),u=o.forwardRef(function(e,t){var n,i=e.alignIndicator,s=e.children,c=e.className,u=e.indicatorChildren,d=e.inline,h=e.inputRef,f=e.label,p=e.labelElement,m=e.large,g=e.size,v=e.style,b=e.type,y=e.typeClassName,w=e.tagName,x=(0,r._T)(e,["alignIndicator","children","className","indicatorChildren","inline","inputRef","label","labelElement","large","size","style","type","typeClassName","tagName"]),C=a()(l.jxF,y,((n={})[l.rr$]=x.disabled,n[l.KtJ]=d,n),l.Fcr(i),l.aa8(void 0===g?"medium":g,{large:m}),c);return o.createElement(void 0===w?"label":w,{className:C,ref:t,style:v},o.createElement("input",(0,r.pi)({},x,{ref:h,type:b})),o.createElement("span",{className:l.p5I},u),f,p,s)});u.displayName="".concat(c.g,".Control");var d=o.forwardRef(function(e,t){var n=e.innerLabelChecked,i=e.innerLabel,a=(0,r._T)(e,["innerLabelChecked","innerLabel"]),s=i||n?[o.createElement("div",{key:"checked",className:l.eHu},o.createElement("div",{className:l.ySA},n||i)),o.createElement("div",{key:"unchecked",className:l.eHu},o.createElement("div",{className:l.ySA},i))]:null;return o.createElement(u,(0,r.pi)({},a,{indicatorChildren:s,ref:t,type:"checkbox",typeClassName:l.YuG}))});d.displayName="".concat(c.g,".Switch"),o.forwardRef(function(e,t){return o.createElement(u,(0,r.pi)({},e,{ref:t,type:"radio",typeClassName:l.HcK}))}).displayName="".concat(c.g,".Radio"),o.forwardRef(function(e,t){var n=e.defaultIndeterminate,i=e.indeterminate,a=e.onChange,c=(0,r._T)(e,["defaultIndeterminate","indeterminate","onChange"]),d=o.useState(i||n||!1),h=d[0],f=d[1],p=o.useRef(null),m=(0,s.lq)(e.inputRef,p),g=o.useCallback(function(e){void 0===i&&f(e.target.indeterminate),null==a||a(e)},[i,a]);return o.useEffect(function(){void 0!==i&&f(i)},[i]),o.useEffect(function(){null!=p.current&&(p.current.indeterminate=h)},[p,h]),o.createElement(u,(0,r.pi)({},c,{inputRef:m,onChange:g,ref:t,type:"checkbox",typeClassName:l.BgB}))}).displayName="".concat(c.g,".Checkbox")},9065:function(e,t,n){"use strict";n.d(t,{B:function(){return p}});var r=n(17785),i=n(45254),a=n.n(i),o=n(7653),l=n(12131),s=n(67824),c=n(55927),u=n(84614),d=n(33280),h=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.state={hasPendingUpdate:!1,isComposing:!1,nextValue:n.props.value,value:n.props.value},n.cancelPendingCompositionEnd=null,n.handleCompositionStart=function(e){var t,r,i;null===(t=n.cancelPendingCompositionEnd)||void 0===t||t.call(n),n.setState({isComposing:!0}),null===(i=(r=n.props).onCompositionStart)||void 0===i||i.call(r,e)},n.handleCompositionEnd=function(e){var r,i;n.cancelPendingCompositionEnd=n.setTimeout(function(){return n.setState({isComposing:!1})},t.COMPOSITION_END_DELAY),null===(i=(r=n.props).onCompositionEnd)||void 0===i||i.call(r,e)},n.handleChange=function(e){var t,r,i=e.target.value;n.setState({nextValue:i}),null===(r=(t=n.props).onChange)||void 0===r||r.call(t,e)},n}return(0,r.ZT)(t,e),t.getDerivedStateFromProps=function(e,t){return t.isComposing||void 0===e.value?null:t.nextValue!==t.value?e.value===t.nextValue?t.hasPendingUpdate?{hasPendingUpdate:!1,value:e.value}:{value:t.nextValue}:e.value===t.value?{hasPendingUpdate:!0}:{hasPendingUpdate:!1,nextValue:e.value,value:e.value}:{hasPendingUpdate:!1,nextValue:e.value,value:e.value}},t.prototype.render=function(){var e=this.state,t=e.isComposing,n=e.hasPendingUpdate,i=e.value,a=e.nextValue,l=this.props,s=l.inputRef,c=(0,r._T)(l,["inputRef"]);return o.createElement("input",(0,r.pi)({},c,{ref:s,value:t||n?a:i,onCompositionStart:this.handleCompositionStart,onCompositionEnd:this.handleCompositionEnd,onChange:this.handleChange}))},t.displayName="".concat(u.g,".AsyncControllableInput"),t.COMPOSITION_END_DELAY=10,t}(s.l),f=["inputSize","onValueChange"],p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={},t.leftElement=null,t.rightElement=null,t.refHandlers={leftElement:function(e){return t.leftElement=e},rightElement:function(e){return t.rightElement=e}},t.handleInputChange=function(e){var n,r,i,a,o=e.target.value;null===(r=(n=t.props).onChange)||void 0===r||r.call(n,e),null===(a=(i=t.props).onValueChange)||void 0===a||a.call(i,o,e.target)},t}return(0,r.ZT)(t,e),t.prototype.render=function(){var e,t=this.props,n=t.asyncControl,i=t.className,s=t.disabled,c=t.fill,d=t.inputClassName,p=t.inputRef,m=t.inputSize,g=t.intent,v=t.large,b=t.readOnly,y=t.round,w=t.size,x=void 0===w?"medium":w,C=t.small,E=t.tagName,k=a()(l.hPX,l.NL3(g),((e={})[l.rr$]=s,e[l.dr5]=b,e[l.ur0]=c,e[l.oUC]=y,e),l.aa8(x,{large:v,small:C}),i),S=(0,r.pi)((0,r.pi)({},this.props.style),{paddingLeft:this.state.leftElementWidth,paddingRight:this.state.rightElementWidth}
1),T=(0,r.pi)((0,r.pi)({type:"text"},(0,u.B)(this.props,f,!0)),{"aria-disabled":s,className:a()(l.O4S,d),onChange:this.handleInputChange,size:null!=m?m:"number"==typeof x?x:void 0,style:S}),P=void 0!==n&&n?o.createElement(h,(0,r.pi)({},T,{inputRef:p})):o.createElement("input",(0,r.pi)({},T,{ref:p}));return o.createElement(void 0===E?"div":E,{className:k},this.maybeRenderLeftElement(),P,this.maybeRenderRightElement())},t.prototype.componentDidMount=function(){this.updateInputWidth()},t.prototype.componentDidUpdate=function(e){var t=this.props,n=t.leftElement,r=t.rightElement;(e.leftElement!==n||e.rightElement!==r)&&this.updateInputWidth()},t.prototype.validateProps=function(e){null!=e.leftElement&&null!=e.leftIcon&&console.warn(c.vy)},t.prototype.maybeRenderLeftElement=function(){var e=this.props,t=e.leftElement,n=e.leftIcon;return null!=t?o.createElement("span",{className:l.RP2,ref:this.refHandlers.leftElement},t):null!=n?o.createElement(d.I,{icon:n,"aria-hidden":!0,tabIndex:-1}):void 0},t.prototype.maybeRenderRightElement=function(){var e=this.props.rightElement;if(null!=e)return o.createElement("span",{className:l.cPG,ref:this.refHandlers.rightElement},e)},t.prototype.updateInputWidth=function(){var e=this.state,t=e.leftElementWidth,n=e.rightElementWidth;if(null!=this.leftElement){var r=this.leftElement.clientWidth;(void 0===t||Math.abs(r-t)>2)&&this.setState({leftElementWidth:r})}else this.setState({leftElementWidth:void 0});if(null!=this.rightElement){var r=this.rightElement.clientWidth;(void 0===n||Math.abs(r-n)>2)&&this.setState({rightElementWidth:r})}else this.setState({rightElementWidth:void 0})},t.displayName="".concat(u.g,".InputGroup"),t}(s.l)},20952:function(e,t,n){"use strict";n.d(t,{A:function(){return A}});var r,i,a=n(17785),o=n(45254),l=n.n(o),s=n(7653),c=n(12724),u=n(53159),d=n(39199),h=n(25157),f=n(93156),p=n(12131),m=n(88876),g=n(84614),v=n(25117),b=n(67824),y=n(55927),w=n(28969),x=n(38726),C=s.forwardRef(function(e,t){var n,r=e.children,i=e.className,o=e.fill,c=e.vertical,u=(0,a._T)(e,["children","className","fill","vertical"]),d=l()(p.Vl1,((n={})[p.ur0]=o,n[p.yZ9]=c,n),i);return s.createElement("div",(0,a.pi)({role:"group"},u,{ref:t,className:d}),r)});C.displayName="".concat(g.g,".ControlGroup");var E=n(9065);function k(e){var t=1.9.toLocaleString(e),n=1..toLocaleString(e),r=9..toLocaleString(e),i=new RegExp("".concat(n,"(.+)").concat(r)).exec(t);return i&&i[1]||"."}function S(e,t){return void 0===t&&(t="en-US"),M(e.toLocaleString(t,{roundingPriority:"morePrecision"}),t)}function T(e,t){var n=""+e;if(parseFloat(n).toString()===e.toString())return e.toString();if(void 0!==t){var r=k(t);return M(n,t).split("").map(function(e){var n;return -1!==(n=[0,1,2,3,4,5,6,7,8,9].map(function(e){return e.toLocaleString(t)}).indexOf(e))?n:e}).join("").replace(r,".")}return e.toString()}function P(e,t){if(void 0===t)return/^[Ee0-9\+\-\.]$/.test(e);var n=k(t).replace(".","\\.");return RegExp("^[Ee"+[0,1,2,3,4,5,6,7,8,9].map(function(e){return e.toLocaleString(t)}).join("")+"\\+\\-"+n+"]$").test(e)}function M(e,t){return e.replace(/[\uFF10-\uFF19]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}).split("").filter(function(e){return P(e,t)}).join("")}(r=i||(i={}))[r.DOWN=-1]="DOWN",r[r.UP=1]="UP";var R=["allowNumericCharactersOnly","buttonPosition","clampValueOnBlur","className","defaultValue","majorStepSize","minorStepSize","onButtonClick","onValueChange","selectAllOnFocus","selectAllOnIncrement","stepSize"],A=function(e){function t(){var n,r,a=e.apply(this,arguments)||this;return a.numericInputId=d.EL("numericInput"),a.state={currentImeInputInvalid:!1,shouldSelectAfterUpdate:!1,stepMaxPrecision:t.getStepMaxPrecision(a.props),value:(void 0===(n=null!==(r=a.props.value)&&void 0!==r?r:a.props.defaultValue)&&(n=""),n.toString())},a.didPasteEventJustOccur=!1,a.delta=0,a.inputElement=null,a.inputRef=(0,h.Km)(a,"inputElement",a.props.inputRef),a.incrementButtonHandlers=a.getButtonEventHandlers(i.UP),a.decrementButtonHandlers=a.getButtonEventHandlers(i.DOWN),a.getCurrentValueAsNumber=function(){return Number(T(a.state.value,a.props.locale))},a.handleButtonClick=function(e,t){var n,r,i=a.updateDelta(t,e),o=a.incrementValue(i);null===(r=(n=a.props).onButtonClick)||void 0===r||r.call(n,Number(T(o,a.props.locale)),o)},a.stopContinuousChange=function(){a.delta=0,a.clearTimeouts(),clearInterval(a.intervalId),document.removeEventListener("mouseup",a.stopContinuousChange)},a.handleContinuousChange=function(){if(void 0!==a.props.min||void 0!==a.props.max){var e,t,n,r,i=null!==(e=a.props.min)&&void 0!==e?e:-1/0,o=null!==(t=a.props.max)&&void 0!==t?t:1/0,l=a.getCurrentValueAsNumber();if(l<=i||l>=o){a.stopContinuousChange();return}}var s=a.incrementValue(a.delta);null===(r=(n=a.props).onButtonClick)||void 0===r||r.call(n,Number(T(s,a.props.locale)),s)},a.handleInputFocus=function(e){var t,n;a.setState({shouldSelectAfterUpdate:a.props.selectAllOnFocus}),null===(n=(t=a.props).onFocus)||void 0===n||n.call(t,e)},a.handleInputBlur=function(e){var t,n;if(a.setState({shouldSelectAfterUpdate:!1}),a.props.clampValueOnBlur){var r=e.target.value;a.handleNextValue(a.roundAndClampValue(r))}null===(n=(t=a.props).onBlur)||void 0===n||n.call(t,e)},a.handleInputKeyDown=function(e){if(!a.props.disabled&&!a.props.readOnly){var t,n,r=f.X(e,["ArrowDown"],["ArrowUp"]);if(void 0!==r){e.preventDefault();var i=a.updateDelta(r,e);a.incrementValue(i)}null===(n=(t=a.props).onKeyDown)||void 0===n||n.call(t,e)}},a.handleCompositionEnd=function(e){a.props.allowNumericCharactersOnly&&(a.handleNextValue(M(e.data,a.props.locale)),a.setState({currentImeInputInvalid:!1}))},a.handleCompositionUpdate=function(e){if(a.props.allowNumericCharactersOnly){var t=e.data;0===M(t,a.props.locale).length&&t.length>0?a.setState({currentImeInputInvalid:!0}):a.setState({currentImeInputInvalid:!1})}},a.handleInputKeyPress=function(e){var t,n,r;a.props.allowNumericCharactersOnly&&(r=a.props.locale,!(null==e.key||e.ctrlKey||e.altKey||e.metaKey||1!==e.ke
1y.length||P(e.key,r)))&&e.preventDefault(),null===(n=(t=a.props).onKeyPress)||void 0===n||n.call(t,e)},a.handleInputPaste=function(e){var t,n;a.didPasteEventJustOccur=!0,null===(n=(t=a.props).onPaste)||void 0===n||n.call(t,e)},a.handleInputChange=function(e){var t=e;a.props.allowNumericCharactersOnly&&a.didPasteEventJustOccur&&(a.didPasteEventJustOccur=!1,t=M(e,a.props.locale)),a.handleNextValue(t),a.setState({shouldSelectAfterUpdate:!1})},a}return(0,a.ZT)(t,e),t.getDerivedStateFromProps=function(e,n){var r,i,o={prevMaxProp:e.max,prevMinProp:e.min},l=e.min!==n.prevMinProp,s=e.max!==n.prevMaxProp,c=null!==(i=null===(r=e.value)||void 0===r?void 0:r.toString())&&void 0!==i?i:n.value,u=t.getStepMaxPrecision(e),d=c!==t.VALUE_EMPTY?t.roundAndClampValue(c,u,e.min,e.max,0,e.locale):t.VALUE_EMPTY;return(l||s)&&d!==n.value?(0,a.pi)((0,a.pi)({},o),{stepMaxPrecision:u,value:d}):(0,a.pi)((0,a.pi)({},o),{stepMaxPrecision:u,value:c})},t.getStepMaxPrecision=function(e){return null!=e.minorStepSize?d.vk(e.minorStepSize):d.vk(e.stepSize)},t.roundAndClampValue=function(e,n,r,i,a,o){var l,s,c;return(void 0===a&&(a=0),l=T(e,o),null!=e&&l-parseFloat(l)+1>=0)?S((c=Math.round((Number(T(e,o))+a)*(s=Math.pow(10,n)))/s,(0,d.uZ)(c,null!=r?r:-1/0,null!=i?i:1/0)),o):t.VALUE_EMPTY},t.prototype.render=function(){var e=this.props,t=e.buttonPosition,n=e.className,r=e.fill,i=e.large,a=e.size,o=e.small,c=l()(p.W$E,p.aa8(void 0===a?"medium":a,{large:i,small:o}),n),u=this.renderButtons();return s.createElement(C,{className:c,fill:r},t===m.Ly.LEFT&&u,this.renderInput(),t===m.Ly.RIGHT&&u)},t.prototype.componentDidUpdate=function(n,r){e.prototype.componentDidUpdate.call(this,n,r),n.inputRef!==this.props.inputRef&&((0,h.k$)(n.inputRef,null),this.inputRef=(0,h.Km)(this,"inputElement",this.props.inputRef),(0,h.k$)(this.props.inputRef,this.inputElement)),this.state.shouldSelectAfterUpdate&&(null===(i=this.inputElement)||void 0===i||i.setSelectionRange(0,this.state.value.length));var i,a,o,l=this.props.min!==n.min,s=this.props.max!==n.max,c=this.props.locale!==n.locale,u=this.state.value!==r.value;if((l||s)&&u||c&&r.value!==t.VALUE_EMPTY){var d=T(c?r.value:this.state.value,n.locale),f=S(+d,this.props.locale);null===(o=(a=this.props).onValueChange)||void 0===o||o.call(a,+d,f,this.inputElement)}},t.prototype.validateProps=function(e){var n=e.majorStepSize,r=e.max,i=e.min,a=e.minorStepSize,o=e.stepSize,l=e.value;if(null!=i&&null!=r&&i>r&&console.error(y.e7),o<=0&&console.error(y.an),a&&a<=0&&console.error(y.XY),n&&n<=0&&console.error(y.EG),a&&a>o&&console.error(y.xC),n&&n<o&&console.error(y.b7),null!=l){var s=t.getStepMaxPrecision(e),c=t.roundAndClampValue(l.toString(),s,i,r,0,this.props.locale),u=c!==l.toString(),d=S(Number(T(l,this.props.locale)),this.props.locale);u&&c!==d&&console.warn(y.yV)}},t.prototype.renderButtons=function(){var e=this.props,t=e.intent,n=e.max,r=e.min,i=e.locale,o=T(this.state.value,i),l=this.props.disabled||this.props.readOnly;return s.createElement(w.h,{className:p.hAT,key:"button-group",vertical:!0},s.createElement(x.z,(0,a.pi)({"aria-label":"increment","aria-controls":this.numericInputId,disabled:l||void 0!==n&&""!==o&&+o>=n,icon:s.createElement(c.K,null),intent:t},this.incrementButtonHandlers)),s.createElement(x.z,(0,a.pi)({"aria-label":"decrement","aria-controls":this.numericInputId,disabled:l||void 0!==r&&""!==o&&+o<=r,icon:s.createElement(u._,null),intent:t},this.decrementButtonHandlers)))},t.prototype.renderInput=function(){var e=(0,g.B)(this.props,R,!0),t=this.getCurrentValueAsNumber();return s.createElement(E.B,(0,a.pi)({asyncControl:this.props.asyncControl,autoComplete:"off",id:this.numericInputId,role:this.props.allowNumericCharactersOnly?"spinbutton":void 0},e,{"aria-valuemax":this.props.max,"aria-valuemin":this.props.min,"aria-valuenow":t,intent:this.state.currentImeInputInvalid?v.S.DANGER:this.props.intent,inputClassName:this.props.inputClassName,inputRef:this.inputRef,inputSize:this.props.inputSize,large:this.props.large,leftElement:this.props.leftElement,leftIcon:this.props.leftIcon,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onCompositionEnd:this.handleCompositionEnd,onCompositionUpdate:this.handleCompositionUpdate,onKeyDown:this.handleInputKeyDown,onKeyPress:this.handleInputKeyPress,onPaste:this.handleInputPaste,onValueChange:this.handleInputChange,rightElement:this.props.rightElement,size:this.props.size,small:this.props.small,value:this.state.value}))},t.prototype.getButtonEventHandlers=function(e){var t=this;return{onKeyDown:function(n){!t.props.disabled&&f.gT(n)&&t.handleButtonClick(n,e)},onMouseDown:function(n){t.props.disabled||(t.handleButtonClick(n,e),t.startContinuousChange())}}},t.prototype.startContinuousChange=function(){var e=this;document.addEventListener("mouseup",this.stopContinuousChange),this.setTimeout(function(){e.intervalId=window.setInterval(e.handleContinuousChange,t.CONTINUOUS_CHANGE_INTERVAL)},t.CONTINUOUS_CHANGE_DELAY)},t.prototype.handleNextValue=function(e){var t,n;null==this.props.value&&this.setState({value:e}),null===(n=(t=this.props).onValueChange)||void 0===n||n.call(t,Number(T(e,this.props.locale)),e,this.inputElement)},t.prototype.incrementValue=function(e){var n=this.state.value===t.VALUE_EMPTY?t.VALUE_ZERO:this.state.value,r=this.roundAndClampValue(n,e);return r!==this.state.value&&(this.handleNextValue(r),this.setState({shouldSelectAfterUpdate:this.props.selectAllOnIncrement})),r},t.prototype.getIncrementDelta=function(e,t,n){var r=this.props,i=r.majorStepSize,a=r.minorStepSize,o=r.stepSize;return t&&null!=i?e*i:n&&null!=a?e*a:e*o},t.prototype.roundAndClampValue=function(e,n){return void 0===n&&(n=0),t.roundAndClampValue(e,this.state.stepMaxPrecision,this.props.min,this.props.max,n,this.props.locale)},t.prototype.updateDelta=function(e,t){return this.delta=this.getIncrementDelta(e,t.shiftKey,t.altKey),this.delta}
1,t.displayName="".concat(g.g,".NumericInput"),t.VALUE_EMPTY="",t.VALUE_ZERO="0",t.defaultProps={allowNumericCharactersOnly:!0,buttonPosition:m.Ly.RIGHT,clampValueOnBlur:!1,defaultValue:t.VALUE_EMPTY,large:!1,majorStepSize:10,minorStepSize:.1,selectAllOnFocus:!1,selectAllOnIncrement:!1,size:"medium",small:!1,stepSize:1},t.CONTINUOUS_CHANGE_DELAY=300,t.CONTINUOUS_CHANGE_INTERVAL=100,t}(b.l)},41987:function(e,t,n){"use strict";n.d(t,{H6:function(){return c}});var r=n(17785),i=n(45254),a=n.n(i),o=n(7653),l=n(12131);function s(e,t){return o.forwardRef(function(n,i){var l=n.className,s=n.children,c=(0,r._T)(n,["className","children"]);return o.createElement(e,(0,r.pi)((0,r.pi)({},c),{className:a()(t,l),ref:i}),s)})}s("h1",l.T5o),s("h2",l.T5o),s("h3",l.T5o),s("h4",l.T5o),s("h5",l.T5o);var c=s("h6",l.T5o);s("blockquote",l.Csj),s("code",l.cO4),s("pre",l.GjQ),s("label",l.GPh),s("ol",l.IYJ),s("ul",l.IYJ)},33280:function(e,t,n){"use strict";n.d(t,{I:function(){return P}});var r,i,a,o=n(17785),l=n(45254),s=n.n(l),c=n(7653),u=n(2374),d=n(96834),h=n(58761),f=n(83780),p=n(76047);(r=a||(a={})).AddChild="add-child",r.AddClip="add-clip",r.AddColumnLeft="add-column-left",r.AddColumnRight="add-column-right",r.AddLocation="add-location",r.AddParent="add-parent",r.AddRowBottom="add-row-bottom",r.AddRowTop="add-row-top",r.AddToArtifact="add-to-artifact",r.AddToFolder="add-to-folder",r.Add="add",r.AimpointsTarget="aimpoints-target",r.Airplane="airplane",r.AlignCenter="align-center",r.AlignJustify="align-justify",r.AlignLeft="align-left",r.AlignRight="align-right",r.AlignmentBottom="alignment-bottom",r.AlignmentHorizontalCenter="alignment-horizontal-center",r.AlignmentLeft="alignment-left",r.AlignmentRight="alignment-right",r.AlignmentTop="alignment-top",r.AlignmentVerticalCenter="alignment-vertical-center",r.Ammunition="ammunition",r.Anchor="anchor",r.Annotation="annotation",r.Announcement="announcement",r.Antenna="antenna",r.AppHeader="app-header",r.Application="application",r.Applications="applications",r.Archive="archive",r.AreaOfInterest="area-of-interest",r.ArrayBoolean="array-boolean",r.ArrayDate="array-date",r.ArrayFloatingPoint="array-floating-point",r.ArrayNumeric="array-numeric",r.ArrayObject="array-object",r.ArrayString="array-string",r.ArrayTimestamp="array-timestamp",r.Array="array",r.ArrowBottomLeft="arrow-bottom-left",r.ArrowBottomRight="arrow-bottom-right",r.ArrowDown="arrow-down",r.ArrowLeft="arrow-left",r.ArrowRight="arrow-right",r.ArrowTopLeft="arrow-top-left",r.ArrowTopRight="arrow-top-right",r.ArrowUp="arrow-up",r.ArrowsArc="arrows-arc",r.ArrowsHorizontal="arrows-horizontal",r.ArrowsVertical="arrows-vertical",r.Asterisk="asterisk",r.At="at",r.AutomaticUpdates="automatic-updates",r.Axle="axle",r.Backlink="backlink",r.BackwardTen="backward-ten",r.Badge="badge",r.BanCircle="ban-circle",r.BankAccount="bank-account",r.Barcode="barcode",r.BinaryNumber="binary-number",r.Blank="blank",r.BlockPromote="block-promote",r.BlockedPerson="blocked-person",r.Bold="bold",r.Book="book",r.Bookmark="bookmark",r.Box="box",r.BranchLocked="branch-locked",r.BranchUnlocked="branch-unlocked",r.Briefcase="briefcase",r.BringData="bring-data",r.BringForward="bring-forward",r.BritishPound="british-pound",r.Bug="bug",r.Buggy="buggy",r.Build="build",r.Bullseye="bullseye",r.Calculator="calculator",r.Calendar="calendar",r.Camera="camera",r.CaretDown="caret-down",r.CaretLeft="caret-left",r.CaretRight="caret-right",r.CaretUp="caret-up",r.CargoShip="cargo-ship",r.CellTower="cell-tower",r.Changes="changes",r.Chart="chart",r.Chat="chat",r.ChevronBackward="chevron-backward",r.ChevronDown="chevron-down",r.ChevronForward="chevron-forward",r.ChevronLeft="chevron-left",r.ChevronRight="chevron-right",r.ChevronUp="chevron-up",r.CircleArrowDown="circle-arrow-down",r.CircleArrowLeft="circle-arrow-left",r.CircleArrowRight="circle-arrow-right",r.CircleArrowUp="circle-arrow-up",r.Circle="circle",r.Citation="citation",r.Clean="clean",r.Clip="clip",r.ClipboardFile="clipboard-file",r.Clipboard="clipboard",r.CloudDownload="cloud-download",r.CloudServer="cloud-server",r.CloudTick="cloud-tick",r.CloudUpload="cloud-upload",r.Cloud="cloud",r.CodeBlock="code-block",r.Code="code",r.Cog="cog",r.CollapseAll="collapse-
1all",r.ColorFill="color-fill",r.ColumnLayout="column-layout",r.Comment="comment",r.Comparison="comparison",r.Compass="compass",r.Compressed="compressed",r.Confirm="confirm",r.Console="console",r.Construction="construction",r.Contrast="contrast",r.Control="control",r.CreditCard="credit-card",r.Crop="crop",r.CrossCircle="cross-circle",r.Cross="cross",r.Crown="crown",r.CssStyle="css-style",r.CubeAdd="cube-add",r.CubeEdit="cube-edit",r.CubeRemove="cube-remove",r.Cube="cube",r.Cubes="cubes",r.CurlyBraces="curly-braces",r.CurvedRangeChart="curved-range-chart",r.Cut="cut",r.Cycle="cycle",r.Dashboard="dashboard",r.DataCloud="data-cloud",r.DataConnection="data-connection",r.DataLineage="data-lineage",r.DataSearch="data-search",r.DataSync="data-sync",r.Database="database",r.DeleteClip="delete-clip",r.Delete="delete",r.Delta="delta",r.DeriveColumn="derive-column",r.Desktop="desktop",r.Detection="detection",r.Diagnosis="diagnosis",r.DiagramTree="diagram-tree",r.DirectionLeft="direction-left",r.DirectionRight="direction-right",r.Disable="disable",r.Divide="divide",r.DocumentCode="document-code",r.DocumentLocked="document-locked",r.DocumentOpen="document-open",r.DocumentShare="document-share",r.Document="document",r.Dollar="dollar",r.Dot="dot",r.DoubleCaretHorizontal="double-caret-horizontal",r.DoubleCaretVertical="double-caret-vertical",r.DoubleChevronDown="double-chevron-down",r.DoubleChevronLeft="double-chevron-left",r.DoubleChevronRight="double-chevron-right",r.DoubleChevronUp="double-chevron-up",r.DoughnutChart="doughnut-chart",r.Download="download",r.DragHandleHorizontal="drag-handle-horizontal",r.DragHandleVertical="drag-handle-vertical",r.Draw="draw",r.DrawerLeftFilled="drawer-left-filled",r.DrawerLeft="drawer-left",r.DrawerRightFilled="drawer-right-filled",r.DrawerRight="drawer-right",r.DriveTime="drive-time",r.Duplicate="duplicate",r.Edit="edit",r.Eject="eject",r.Emoji="emoji",r.Endnote="endnote",r.Endorsed="endorsed",r.Envelope="envelope",r.Equals="equals",r.Eraser="eraser",r.Error="error",r.Euro="euro",r.Excavator="excavator",r.Exchange="exchange",r.ExcludeRow="exclude-row",r.ExpandAll="expand-all",r.Explain="explain",r.Export="export",r.EyeOff="eye-off",r.EyeOn="eye-on",r.EyeOpen="eye-open",r.FastBackward="fast-backward",r.FastForward="fast-forward",r.FeedSubscribed="feed-subscribed",r.Feed="feed",r.FighterJet="fighter-jet",r.Film="film",r.FilterKeep="filter-keep",r.FilterList="filter-list",r.FilterOpen="filter-open",r.FilterRemove="filter-remove",r.FilterSortAsc="filter-sort-asc",r.FilterSortDesc="filter-sort-desc",r.Filter="filter",r.Flag="flag",r.Flame="flame",r.Flash="flash",r.FloatingPoint="floating-point",r.FloppyDisk="floppy-disk",r.FlowBranch="flow-branch",r.FlowEnd="flow-end",r.FlowLinear="flow-linear",r.FlowReviewBranch="flow-review-branch",r.FlowReview="flow-review",r.Flows="flows",r.FolderClose="folder-close",r.FolderNew="folder-new",r.FolderOpen="folder-open",r.FolderSharedOpen="folder-shared-open",r.FolderShared="folder-shared",r.Follower="follower",r.Following="following",r.Font="font",r.Fork="fork",r.Form="form",r.ForwardTen="forward-ten",r.Fuel="fuel",r.FullCircle="full-circle",r.FullStackedCh
1art="full-stacked-chart",r.Fullscreen="fullscreen",r.Function="function",r.GanttChart="gantt-chart",r.Generate="generate",r.Geofence="geofence",r.Geolocation="geolocation",r.Geosearch="geosearch",r.Geotime="geotime",r.GiftBox="gift-box",r.GitBranch="git-branch",r.GitCommit="git-commit",r.GitMerge="git-merge",r.GitNewBranch="git-new-branch",r.GitPull="git-pull",r.GitPush="git-push",r.GitRepo="git-repo",r.Glass="glass",r.GlobeNetworkAdd="globe-network-add",r.GlobeNetwork="globe-network",r.Globe="globe",r.GraphRemove="graph-remove",r.Graph="graph",r.GreaterThanOrEqualTo="greater-than-or-equal-to",r.GreaterThan="greater-than",r.GridView="grid-view",r.Grid="grid",r.GroupItem="group-item",r.GroupObjects="group-objects",r.GroupedBarChart="grouped-bar-chart",r.HandDown="hand-down",r.HandLeft="hand-left",r.HandRight="hand-right",r.HandUp="hand-up",r.Hand="hand",r.Hat="hat",r.HeaderOne="header-one",r.HeaderThree="header-three",r.HeaderTwo="header-two",r.Header="header",r.Headset="headset",r.HeartBroken="heart-broken",r.Heart="heart",r.HeatGrid="heat-grid",r.Heatmap="heatmap",r.Helicopter="helicopter",r.Help="help",r.HelperManagement="helper-management",r.Hexagon="hexagon",r.HighPriority="high-priority",r.HighVoltagePole="high-voltage-pole",r.Highlight="highlight",r.History="history",r.Home="home",r.HorizontalBarChartAsc="horizontal-bar-chart-asc",r.HorizontalBarChartDesc="horizontal-bar-chart-desc",r.HorizontalBarChart="horizontal-bar-chart",r.HorizontalDistribution="horizontal-distribution",r.HorizontalInbetween="horizontal-inbetween",r.Hurricane="hurricane",r.IdNumber="id-number",r.ImageRotateLeft="image-rotate-left",r.ImageRotateRight="image-rotate-right",r.Import="import",r.InboxFiltered="inbox-filtered",r.InboxGeo="inbox-geo",r.InboxSearch="inbox-search",r.InboxUpdate="inbox-update",r.Inbox="inbox",r.InfoSign="info-sign",r.Inheritance="inheritance",r.InheritedGroup="inherited-group",r.InnerJoin="inner-join",r.Input="input",r.Insert="insert",r.Intelligence="intelligence",r.Intersection="intersection",r.IpAddress="ip-address",r.IssueClosed="issue-closed",r.IssueNew="issue-new",r.Issue="issue",r.Italic="italic",r.JoinTable="join-table",r.KeyBackspace="key-backspace",r.KeyCommand="key-command",r.KeyControl="key-control",r.KeyDelete="key-delete",r.KeyEnter="key-enter",r.KeyEscape="key-escape",r.KeyOption="key-option",r.KeyShift="key-shift",r.KeyTab="key-tab",r.Key="key",r.KnownVehicle="known-vehicle",r.LabTest="lab-test",r.Label="label",r.LayerOutline="layer-outline",r.Layer="layer",r.Layers="layers",r.LayoutAuto="layout-auto",r.LayoutBalloon="layout-balloon",r.LayoutBottomRowThreeTiles="layout-bottom-row-three-tiles",r.LayoutBottomRowTwoTiles="layout-bottom-row-two-tiles",r.LayoutCircle="layout-circle",r.LayoutGrid="layout-grid",r.LayoutGroupBy="layout-group-by",r.LayoutHierarchy="layout-hierarchy",r.LayoutLeftColumnThreeTiles="layout-left-column-three-tiles",r.LayoutLeftColumnTwoTiles="layout-left-column-two-tiles",r.LayoutLinear="layout-linear",r.LayoutRightColumnThreeTiles="layout-right-column-three-tiles",r.LayoutRightColumnTwoTiles="layout-right-column-two-tiles",r.LayoutSkewGrid="layout-skew-grid",r.LayoutSortedClusters="layout-sorted-clusters",r.LayoutThreeColumns="layout-three-columns",r.LayoutThreeRows="layout-three-rows",r.LayoutTopRowThreeTiles="layout-top-row-three-tiles",r.LayoutTopRowTwoTiles="layout-top-row-two-tiles",r.LayoutTwoColumns="layout-two-columns",r.LayoutTwoRows="layout-two-rows",r.Layout="layout",r.Learning="learning",r.LeftJoin="left-join",r.LengthenText="lengthen-text",r.LessThanOrEqualTo="less-than-or-equal-to",r.LessThan="less-than",r.Lifesaver="lifesaver",r.Lightbulb="lightbulb",r.Lightning="lightning",r.Link="link",r.LinkedSquares="linked-squares",r.ListColumns="list-columns",r.ListDetailView="list-detail-view",r.List="list",r.Locate="locate",r.Lock="lock",r.Locomotive="locomotive",r.LogIn="log-in",r.LogOut="log-out",r.LowVoltagePole="low-voltage-pole",r.Manual="manual",r.ManuallyEnteredData="manually-entered-data",r.ManyToMany="many-to-many",r.ManyToOne="many-to-one",r.MapCreate="map-create",r.MapMarker="map-marker",r.Map="map",r.Maximize="maximize",r.Media="media",r.MenuClosed="menu-closed",r.MenuOpen="menu-open",r.Menu="menu",r.MergeColumns="merge-columns",r.MergeLinks="merge-links",r.Microphone="microphone",r.Minimize="minimize",r.Minus="minus",r.MobilePhone="mobile-phone",r.MobileVideo="mobile-video",r.ModalFilled="modal-filled",r.Modal="modal",r.Model="model",r.Moon="moon",r.More="more",r.Mountain="mountain",r.Move="move",r.Mugshot="mugshot",r.MultiSelect="multi-select",r.Music="music",r.Nest="nest",r.NewDrawing="new-drawing",r.NewGridItem="new-grid-item",r.NewLayer="new-layer",r.NewLayers="new-layers",r.NewLink="new-link",r.NewObject="new-object",r.NewPerson="new-person",r.NewPrescription="new-prescription",r.NewShield="new-shield",r.NewTextBox="new-text-box",r.Ninja="ninja",r.NotEqualTo="not-equal-to",r.NotificationsAdd="notifications-add",r.NotificationsSnooze="notifications-snooze",r.NotificationsUpdated="notifications-updated",r.Notifications="notifications",r.NumberedList="numbered-list",r.Numerical="numerical",r.ObjectView="object-view",r.Office="office",r.Offline="offline",r.OilField="oil-field",r.OneColumn="one-column",r.OneToMany="one-to-many",r.OneToOne="one-to-one",r.OpenApplication="open-application",r.Outdated="outdated",r.Output="output",r.Package="package",r.PageBreak="page-break",r.PageLayout="page-layout",r.PanelStats="panel-stats",r.PanelTable="panel-table",r.Panel="panel",r.Paperclip="paperclip",r.Paragraph="paragraph",r.PasteVariable="paste-variable",r.PathSearch="path-search",r.Path="path",r.Pause="pause",r.People="people",r.Percentage="percentage",r.Person="person",r.PhoneCall="phone-call",r.PhoneForward="p
1hone-forward",r.PhoneSearch="phone-search",r.Phone="phone",r.PieChart="pie-chart",r.Pill="pill",r.Pin="pin",r.Pistol="pistol",r.PivotTable="pivot-table",r.Pivot="pivot",r.Play="play",r.Playbook="playbook",r.Plus="plus",r.PolygonFilter="polygon-filter",r.Power="power",r.PredictiveAnalysis="predictive-analysis",r.Prescription="prescription",r.Presentation="presentation",r.Print="print",r.Projects="projects",r.Properties="properties",r.Property="property",r.PublishFunction="publish-function",r.Pulse="pulse",r.Rain="rain",r.Random="random",r.RangeRing="range-ring",r.Record="record",r.RectHeight="rect-height",r.RectWidth="rect-width",r.Rectangle="rectangle",r.Redo="redo",r.Refresh="refresh",r.Regex="regex",r.RegressionChart="regression-chart",r.RemoveColumnLeft="remove-column-left",r.RemoveColumnRight="remove-column-right",r.RemoveColumn="remove-column",r.RemoveRowBottom="remove-row-bottom",r.RemoveRowTop="remove-row-top",r.Remove="remove",r.Repeat="repeat",r.Reset="reset",r.Resolve="resolve",r.Rig="rig",r.RightJoin="right-join",r.Ring="ring",r.RocketSlant="rocket-slant",r.Rocket="rocket",r.RootFolder="root-folder",r.RotateCcw="rotate-ccw",r.RotateCw="rotate-cw",r.RotateDocument="rotate-document",r.RotatePage="rotate-page",r.Route="route",r.RunHistory="run-history",r.Satellite="satellite",r.Saved="saved",r.ScatterPlot="scatter-plot",r.SearchAround="search-around",r.SearchTemplate="search-template",r.SearchText="search-text",r.Search="search",r.SegmentedControl="segmented-control",r.Select="select",r.SelectionBoxAdd="selection-box-add",r.SelectionBoxEdit="selection-box-edit",r.SelectionBoxRemove="selection-box-remove",r.SelectionBox="selection-box",r.Selection="selection",r.SendBackward="send-backward",r.SendMessage="send-message",r.SendToGraph="send-to-graph",r.SendToMap="send-to-map",r.SendTo="send-to",r.Sensor="sensor",r.SeriesAdd="series-add",r.SeriesConfiguration="series-configuration",r.SeriesDerived="series-derived",r.SeriesFiltered="series-filtered",r.SeriesSearch="series-search",r.ServerInstall="server-install",r.Server="server",r.Settings="settings",r.Shapes="shapes",r.Share="share",r.SharedFilter="shared-filter",r.Shield="shield",r.Ship="ship",r.Shop="shop",r.ShoppingCart="shopping-cart",r.ShortenText="shorten-text",r.SignalSearch="signal-search",r.SimCard="sim-card",r.Slash="slash",r.SmallCross="small-cross",r.SmallInfoSign="small-info-sign",r.SmallMinus="small-minus",r.SmallPlus="small-plus",r.SmallSquare="small-square",r.SmallTick="small-tick",r.Snowflake="snowflake",r.SoccerBall="soccer-ball",r.SocialMedia="social-media",r.SortAlphabeticalDesc="sort-alphabetical-desc",r.SortAlphabetical="sort-alphabetical",r.SortAsc="sort-asc",r.SortDesc="sort-desc",r.SortNumericalDesc="sort-numerical-desc",r.SortNumerical="sort-numerical",r.Sort="sort",r.SpellCheck="spell-check",r.SplitColumns="split-columns",r.SportsStadium="sports-stadium",r.Square="square",r.StackedChart="stacked-chart",r.StadiumGeometry="stadium-geometry",r.StarEmpty="star-empty",r.Star="star",r.StepBackward="step-backward",r.StepChart="step-chart",r.StepForward="step-forward",r.Stop="stop",r.Stopwatch="stopwatch",r.Strikethrough="strikethrough",r.Style="style",r.Subscript="subscript",r.SubtractRightJoin="subtract-right-join",r.Superscript="superscript",r.SwapHorizontal="swap-horizontal",r.SwapVertical="swap-vertical",r.Sweep="sweep",r.Switch="switch",r.SymbolCircle="symbol-circle",r.SymbolCross="symbol-cross",r.SymbolDiamond="symbol-diamond",r.SymbolRectangle="symbol-rectangle",r.SymbolSquare="symbol-square",r.SymbolTriangleDown="symbol-triangle-down",r.SymbolTriangleUp="symbol-triangle-up",r.Syringe="syringe",r.TableSync="table-sync",r.TagAdd="tag-add",r.TagPromote="tag-promote",r.TagRefresh="tag-refresh",r.TagUndo="tag-undo",r.Tag="tag",r.Tags="tags",r.TakeAction="take-action",r.Tank="tank",r.Target="target",r.Taxi="taxi",r.Team="team",r.Temperature="temperature",r.TextHighlight="text-highlight",r.ThAdd="th-add",r.ThDerived="th-derived",r.ThDisconnect="th-disconnect",r.ThFiltered="th-filtered",r.ThListAdd="th-list-add",r.ThList="th-list",r.ThVirtualAdd="th-virtual-add",r.ThVirtual="th-virtual",r.Th="th",r.ThirdParty="third-party",r.ThumbsDown="thumbs-down",r.ThumbsUp="thumbs-up",r.TickCircle="tick-circle",r.Tick="tick",r.Time="time",r.TimelineAreaChart="timeline-area-chart",r.TimelineBarChart="timeline-bar-chart",r.TimelineEvents="timeline-events",r.TimelineLineChart="timeline-line-chart",r.Tint="tint",r.Torch="torch",r.Tractor="tractor",r.Train="train",r.Translate="translate",r.Trash="trash",r.Tree="tree",r.TrendingDown="trending-down",r.TrendingUp="trending-up",r.Trophy="trophy",r.Truck="truck",r.TwoColumns="two-columns",r.Unarchive="unarchive",r.Underline="underline",r.Undo="undo",r.UngroupObjects="ungroup-objects",r.UnknownVehicle="unknown-vehicle",r.Unlink="unlink",r.Unlock="unlock",r.Unpin="unpin",r.Unresolve="unresolve",r.Updated="updated",r.Upload="upload",r.User="user",r.Variable="variable",r.Vector="vector",r.VerticalBarChartAsc="vertical-bar-chart-asc",r.VerticalBarChartDe
1sc="vertical-bar-chart-desc",r.VerticalDistribution="vertical-distribution",r.VerticalInbetween="vertical-inbetween",r.Video="video",r.Virus="virus",r.VolumeDown="volume-down",r.VolumeOff="volume-off",r.VolumeUp="volume-up",r.Walk="walk",r.WarningSign="warning-sign",r.WaterfallChart="waterfall-chart",r.Waves="waves",r.WidgetButton="widget-button",r.WidgetFooter="widget-footer",r.WidgetHeader="widget-header",r.Widget="widget",r.Wind="wind",r.WrenchRedo="wrench-redo",r.WrenchSnooze="wrench-snooze",r.WrenchTime="wrench-time",r.Wrench="wrench",r.ZoomIn="zoom-in",r.ZoomOut="zoom-out",r.ZoomToFit="zoom-to-fit",(i={})[a.AddChild]="62365",i[a.AddClip]="61697",i[a.AddColumnLeft]="61698",i[a.AddColumnRight]="61699",i[a.AddLocation]="61700",i[a.AddParent]="62366",i[a.AddRowBottom]="61701",i[a.AddRowTop]="61702",i[a.AddToArtifact]="61703",i[a.AddToFolder]="61704",i[a.Add]="61705",i[a.AimpointsTarget]="62261",i[a.Airplane]="61706",i[a.AlignCenter]="61707",i[a.AlignJustify]="61708",i[a.AlignLeft]="61709",i[a.AlignRight]="61710",i[a.AlignmentBottom]="61711",i[a.AlignmentHorizontalCenter]="61712",i[a.AlignmentLeft]="61713",i[a.AlignmentRight]="61714",i[a.AlignmentTop]="61715",i[a.AlignmentVerticalCenter]="61716",i[a.Ammunition]="62274",i[a.Anchor]="62256",i[a.Annotation]="61717",i[a.Announcement]="62358",i[a.Antenna]="61718",i[a.AppHeader]="61719",i[a.Application]="61720",i[a.Applications]="61721",i[a.Archive]="61722",i[a.AreaOfInterest]="61723",i[a.ArrayBoolean]="61724",i[a.ArrayDate]="61725",i[a.ArrayFloatingPoint]="62253",i[a.ArrayNumeric]="61726",i[a.ArrayObject]="62356",i[a.ArrayString]="61727",i[a.ArrayTimestamp]="61728",i[a.Array]="61729",i[a.ArrowBottomLeft]="61730",i[a.ArrowBottomRight]="61731",i[a.ArrowDown]="61732",i[a.ArrowLeft]="61733",i[a.ArrowRight]="61734",i[a.ArrowTopLeft]="61735",i[a.ArrowTopRight]="61736",i[a.ArrowUp]="61737",i[a.ArrowsArc]="62343",i[a.ArrowsHorizontal]="61738",i[a.ArrowsVertical]="61739",i[a.Asterisk]="61740",i[a.At]="62257",i[a.AutomaticUpdates]="61741",i[a.Axle]="62264",i[a.Backlink]="61742",i[a.BackwardTen]="62300",i[a.Badge]="61743",i[a.BanCircle]="61744",i[a.BankAccount]="61745",i[a.Barcode]="61746",i[a.BinaryNumber]="62295",i[a.Blank]="61747",i[a.BlockPromote]="62322",i[a.BlockedPerson]="61748",i[a.Bold]="61749",i[a.Book]="61750",i[a.Bookmark]="61751",i[a.Box]="61752",i[a.BranchLocked]="62374",i[a.BranchUnlocked]="62375",i[a.Briefcase]="61753",i[a.BringData]="61754",i[a.BringForward]="62292",i[a.BritishPound]="62342",i[a.Bug]="62254",i[a.Buggy]="61755",i[a.Build]="61756",i[a.Bullseye]="62297",i[a.Calculator]="61757",i[a.Calendar]="61758",i[a.Camera]="61759",i[a.CaretDown]="61760",i[a.CaretLeft]="61761",i[a.CaretRight]="61762",i[a.CaretUp]="61763",i[a.CargoShip]="61764",i[a.CellTower]="61765",i[a.Changes]="61766",i[a.Chart]="61767",i[a.Chat]="61768",i[a.ChevronBackward]="61769",i[a.ChevronDown]="61770",i[a.ChevronForward]="61771",i[a.ChevronLeft]="61772",i[a.ChevronRight]="61773",i[a.ChevronUp]="61774",i[a.CircleArrowDown]="61775",i[a.CircleArrowLeft]="61776",i[a.CircleArrowRight]="61777",i[a.CircleArrowUp]="61778",i[a.Circle]="61779",i[a.Citation]="61780",i[a.Clean]="61
1781",i[a.Clip]="61782",i[a.ClipboardFile]="62299",i[a.Clipboard]="61783",i[a.CloudDownload]="61784",i[a.CloudServer]="62298",i[a.CloudTick]="62286",i[a.CloudUpload]="61785",i[a.Cloud]="61786",i[a.CodeBlock]="61787",i[a.Code]="61788",i[a.Cog]="61789",i[a.CollapseAll]="61790",i[a.ColorFill]="62248",i[a.ColumnLayout]="61791",i[a.Comment]="61792",i[a.Comparison]="61793",i[a.Compass]="61794",i[a.Compressed]="61795",i[a.Confirm]="61796",i[a.Console]="61797",i[a.Construction]="62357",i[a.Contrast]="61798",i[a.Control]="61799",i[a.CreditCard]="61800",i[a.Crop]="62291",i[a.CrossCircle]="62262",i[a.Cross]="61801",i[a.Crown]="61802",i[a.CssStyle]="62315",i[a.CubeAdd]="61803",i[a.CubeEdit]="62339",i[a.CubeRemove]="61804",i[a.Cube]="61805",i[a.Cubes]="62323",i[a.CurlyBraces]="62296",i[a.CurvedRangeChart]="61806",i[a.Cut]="61807",i[a.Cycle]="61808",i[a.Dashboard]="61809",i[a.DataCloud]="62353",i[a.DataConnection]="61810",i[a.DataLineage]="61811",i[a.DataSearch]="62319",i[a.DataSync]="62316",i[a.Database]="61812",i[a.DeleteClip]="62371",i[a.Delete]="61813",i[a.Delta]="61814",i[a.DeriveColumn]="61815",i[a.Desktop]="61816",i[a.Detection]="62273",i[a.Diagnosis]="61817",i[a.DiagramTree]="61818",i[a.DirectionLeft]="61819",i[a.DirectionRight]="61820",i[a.Disable]="61821",i[a.Divide]="62247",i[a.DocumentCode]="62368",i[a.DocumentLocked]="62369",i[a.DocumentOpen]="61822",i[a.DocumentShare]="61823",i[a.Document]="61824",i[a.Dollar]="61825",i[a.Dot]="61826",i[a.DoubleCaretHorizontal]="61827",i[a.DoubleCaretVertical]="61828",i[a.DoubleChevronDown]="61829",i[a.DoubleChevronLeft]="61830",i[a.DoubleChevronRight]="61831",i[a.DoubleChevronUp]="61832",i[a.DoughnutChart]="61833",i[a.Download]="61834",i[a.DragHandleHorizontal]="61835",i[a.DragHandleVertical]="61836",i[a.Draw]="61837",i[a.DrawerLeftFilled]="61838",i[a.DrawerLeft]="61839",i[a.DrawerRightFilled]="61840",i[a.DrawerRight]="61841",i[a.DriveTime]="61842",i[a.Duplicate]="61843",i[a.Edit]="61844",i[a.Eject]="61845",i[a.Emoji]="61846",i[a.Endnote]="62294",i[a.Endorsed]="61847",i[a.Envelope]="61848",i[a.Equals]="61849",i[a.Eraser]="61850",i[a.Error]="61851",i[a.Euro]="61852",i[a.Excavator]="62317",i[a.Exchange]="61853",i[a.ExcludeRow]="61854",i[a.ExpandAll]="61855",i[a.Explain]="62285",i[a.Export]="61856",i[a.EyeOff]="61857",i[a.EyeOn]="61858",i[a.EyeOpen]="61859",i[a.FastBackward]="61860",i[a.FastForward]="61861",i[a.FeedSubscribed]="61862",i[a.Feed]="61863",i[a.FighterJet]="62340",i[a.Film]="61864",i[a.FilterKeep]="61865",i[a.FilterList]="61866",i[a.FilterOpen]="61867",i[a.FilterRemove]="61868",i[a.FilterSortAsc]="62350",i[a.FilterSortDesc]="62351",i[a.Filter]="61869",i[a.Flag]="61870",i[a.Flame]="61871",i[a.Flash]="61872",i[a.FloatingPoint]="62252",i[a.FloppyDisk]="61873",i[a.FlowBranch]="61874",i[a.FlowEnd]="61875",i[a.FlowLinear]="61876",i[a.FlowReviewBranch]="61877",i[a.FlowReview]="61878",i[a.Flows]="61879",i[a.FolderClose]="61880",i[a.Folder
1New]="61881",i[a.FolderOpen]="61882",i[a.FolderSharedOpen]="61883",i[a.FolderShared]="61884",i[a.Follower]="61885",i[a.Following]="61886",i[a.Font]="61887",i[a.Fork]="61888",i[a.Form]="61889",i[a.ForwardTen]="62301",i[a.Fuel]="62243",i[a.FullCircle]="61890",i[a.FullStackedChart]="61891",i[a.Fullscreen]="61892",i[a.Function]="61893",i[a.GanttChart]="61894",i[a.Generate]="62284",i[a.Geofence]="61895",i[a.Geolocation]="61896",i[a.Geosearch]="61897",i[a.Geotime]="62276",i[a.GiftBox]="62370",i[a.GitBranch]="61898",i[a.GitCommit]="61899",i[a.GitMerge]="61900",i[a.GitNewBranch]="61901",i[a.GitPull]="61902",i[a.GitPush]="61903",i[a.GitRepo]="61904",i[a.Glass]="61905",i[a.GlobeNetworkAdd]="62338",i[a.GlobeNetwork]="61906",i[a.Globe]="61907",i[a.GraphRemove]="61908",i[a.Graph]="61909",i[a.GreaterThanOrEqualTo]="61910",i[a.GreaterThan]="61911",i[a.GridView]="61912",i[a.Grid]="61913",i[a.GroupItem]="62282",i[a.GroupObjects]="61914",i[a.GroupedBarChart]="61915",i[a.HandDown]="61916",i[a.HandLeft]="61917",i[a.HandRight]="61918",i[a.HandUp]="61919",i[a.Hand]="61920",i[a.Hat]="61921",i[a.HeaderOne]="61922",i[a.HeaderThree]="61923",i[a.HeaderTwo]="61924",i[a.Header]="61925",i[a.Headset]="61926",i[a.HeartBroken]="61927",i[a.Heart]="61928",i[a.HeatGrid]="61929",i[a.Heatmap]="61930",i[a.Helicopter]="61931",i[a.Help]="61932",i[a.HelperManagement]="61933",i[a.Hexagon]="62324",i[a.HighPriority]="61934",i[a.HighVoltagePole]="62259",i[a.Highlight]="61935",i[a.History]="61936",i[a.Home]="61937",i[a.HorizontalBarChartAsc]="61938",i[a.HorizontalBarChartDesc]="61939",i[a.HorizontalBarChart]="61940",i[a.HorizontalDistribution]="61941",i[a.HorizontalInbetween]="62249",i[a.Hurricane]="61942",i[a.IdNumber]="61943",i[a.ImageRotateLeft]="61944",i[a.ImageRotateRight]="61945",i[a.Import]="61946",i[a.InboxFiltered]="61947",i[a.InboxGeo]="61948",i[a.InboxSearch]="61949",i[a.InboxUpdate]="61950",i[a.Inbox]="61951",i[a.InfoSign]="61952",i[a.Inheritance]="61953",i[a.InheritedGroup]="61954",i[a.InnerJoin]="61955",i[a.Input]="62283",i[a.Insert]="61956",i[a.Intelligence]="62263",i[a.Intersection]="61957",i[a.IpAddress]="61958",i[a.IssueClosed]="61959",i[a.IssueNew]="61960",i[a.Issue]="61961",i[a.Italic]="61962",i[a.JoinTable]="61963",i[a.KeyBackspace]="61964",i[a.KeyCommand]="61965",i[a.KeyControl]="61966",i[a.KeyDelete]="61967",i[a.KeyEnter]="61968",i[a.KeyEscape]="61969",i[a.KeyOption]="61970",i[a.KeyShift]="61971",i[a.KeyTab]="61972",i[a.Key]="61973",i[a.KnownVehicle]="61974",i[a.LabTest]="61975",i[a.Label]="61976",i[a.LayerOutline]="61977",i[a.Layer]="61978",i[a.Layers]="61979",i[a.LayoutAuto]="61980",i[a.LayoutBalloon]="61981",i[a.LayoutBottomRowThreeTiles]="62308",i[a.LayoutBottomRowTwoTiles]="62307",i[a.LayoutCircle]="61982",i[a.LayoutGrid]="61983",i[a.LayoutGroupBy]="61984",i[a.LayoutHierarchy]="61985",i[a.LayoutLeftColumnThreeTiles]="62310",i[a.LayoutLeftColumnTwoTiles]="62309",i[a.LayoutLinear]="61986",i[a.LayoutRightColumnThreeTiles]="62312",i[a.LayoutRightColumnTwoTiles]="62311",i[a.LayoutSkewGrid]="61987",i[a.LayoutSortedClusters]="61988",i[a.LayoutThreeColumns]="62305",i[a.LayoutThreeRows]="62306",i[a.LayoutTopRowThreeTiles]="62314",i[a.LayoutTopRowTwoTiles]="62313",i[a.LayoutTwoColumns]="62303",i[a.LayoutTwoRows]="62304",i[a.Layout]="61989",i[a.Learning]="61990",i[a.LeftJoin]="61991",i[a.LengthenText]="62270",i[a.LessThanOrEqualTo]="61992",i[a.LessThan]="61993",i[a.Lifesaver]="61994",i[a.Lightbulb]="61995",i[a.Lightning]="61996",i[a.Link]="61997",i[a.LinkedSquares]="62341",i[a.ListColumns]="61998",i[a.ListDetailView]="61999",i[a.List]="62000",i[a.Locate]="62001",i[a.Lock]="62002",i[a.Locomotive]="62267",i[a.LogIn]="62003",i[a.LogOut]="62004",i[a.LowVoltagePole]="62258",i[a.Manual]="62005",i[a.ManuallyEnteredData]="62006",i[a.ManyToMany]="62007",i[a.ManyToOne]="62008",i[a.MapCreate]="62009",i[a.MapMarker]="62010",i[a.Map]="62011",i[a.Maximize]="62012",i[a.Media]="62013",i[a.MenuClosed]="62014",i[a.MenuOpen]="62015",i[a.Menu]="62016",i[a.MergeColumns]="62017",i[a.MergeLinks]="62018",i[a.Microphone]="62275",i[a.Minimize]="62019",i[a.Minus]="62020",i[a.MobilePhone]="62021",i[a.MobileVideo]="62022",i[a.Mod
1alFilled]="62023",i[a.Modal]="62024",i[a.Model]="62269",i[a.Moon]="62025",i[a.More]="62026",i[a.Mountain]="62027",i[a.Move]="62028",i[a.Mugshot]="62029",i[a.MultiSelect]="62030",i[a.Music]="62031",i[a.Nest]="62032",i[a.NewDrawing]="62033",i[a.NewGridItem]="62034",i[a.NewLayer]="62035",i[a.NewLayers]="62036",i[a.NewLink]="62037",i[a.NewObject]="62038",i[a.NewPerson]="62039",i[a.NewPrescription]="62040",i[a.NewShield]="62281",i[a.NewTextBox]="62041",i[a.Ninja]="62042",i[a.NotEqualTo]="62043",i[a.NotificationsAdd]="62360",i[a.NotificationsSnooze]="62044",i[a.NotificationsUpdated]="62045",i[a.Notifications]="62046",i[a.NumberedList]="62047",i[a.Numerical]="62048",i[a.ObjectView]="62352",i[a.Office]="62049",i[a.Offline]="62050",i[a.OilField]="62051",i[a.OneColumn]="62052",i[a.OneToMany]="62053",i[a.OneToOne]="62054",i[a.OpenApplication]="62251",i[a.Outdated]="62055",i[a.Output]="62320",i[a.Package]="62325",i[a.PageBreak]="62373",i[a.PageLayout]="62056",i[a.PanelStats]="62057",i[a.PanelTable]="62058",i[a.Panel]="62337",i[a.Paperclip]="62059",i[a.Paragraph]="62060",i[a.PasteVariable]="62278",i[a.PathSearch]="62061",i[a.Path]="62062",i[a.Pause]="62063",i[a.People]="62064",i[a.Percentage]="62065",i[a.Person]="62066",i[a.PhoneCall]="62279",i[a.PhoneForward]="62280",i[a.PhoneSearch]="62359",i[a.Phone]="62067",i[a.PieChart]="62068",i[a.Pill]="62326",i[a.Pin]="62069",i[a.Pistol]="62364",i[a.PivotTable]="62070",i[a.Pivot]="62071",i[a.Play]="62072",i[a.Playbook]="62244",i[a.Plus]="62073",i[a.PolygonFilter]="62074",i[a.Power]="62075",i[a.PredictiveAnalysis]="62076",i[a.Prescription]="62077",i[a.Presentation]="62078",i[a.Print]="62079",i[a.Projects]="62080",i[a.Properties]="62081",i[a.Property]="62082",i[a.PublishFunction]="62083",i[a.Pulse]="62084",i[a.Rain]="62085",i[a.Random]="62086",i[a.RangeRing]="62321",i[a.Record]="62087",i[a.RectHeight]="62245",i[a.RectWidth]="62246",i[a.Rectangle]="62241",i[a.Redo]="62088",i[a.Refresh]="62089",i[a.Regex]="62255",i[a.RegressionChart]="62090",i[a.RemoveColumnLeft]="62091",i[a.RemoveColumnRight]="62092",i[a.RemoveColumn]="62093",i[a.RemoveRowBottom]="62094",i[a.RemoveRowTop]="62095",i[a.Remove]="62096",i[a.Repeat]="62097",i[a.Reset]="62098",i[a.Resolve]="62099",i[a.Rig]="62100",i[a.RightJoin]="62101",i[a.Ring]="62102",i[a.RocketSlant]="62103",i[a.Rocket]="62104",i[a.RootFolder]="62367",i[a.RotateCcw]="62345",i[a.RotateCw]="62344",i[a.RotateDocument]="62105",i[a.RotatePage]="62106",i[a.Route]="62107",i[a.RunHistory]="62355",i[a.Satellite]="62108",i[a.Saved]="62109",i[a.ScatterPlot]="62110",i[a.SearchAround]="62111",i[a.SearchTemplate]="62112",i[a.SearchText]="62113",i[a.Search]="62114",i[a.SegmentedControl]="62115",i[a.Select]="62116",i[a.SelectionBoxAdd]="62362",i[a.SelectionBoxEdit]="62363",i[a.SelectionBoxRemove]="62376",i[a.SelectionBox]="62361",i[a.Selection]="62117",i[a.SendBackward]="62293",i[a.SendMessage]="62118",i[a.SendToGraph]="62119",i[a.SendToMap]="62120",i[a.SendTo]="62121",i[a.Sensor]="62268",i[a.SeriesAdd]="62122",i[a.SeriesConfiguration]="62123",i[a.SeriesDerived]="62124",i[a.SeriesFiltered]="62125",i[a.SeriesSearch]="62126",i[a.ServerInstall]="62327",i[a.Server]="62328",i[a.Settings]="62127",i[a.Shapes]="62128",i[a.Share]="62129",i[a.SharedFilter]="62130",i[a.Shield]="62131",i[a.Ship]="62132",i[a.Shop]="62133",i[a.ShoppingCart]="62134",i[a.ShortenText]="62271",i[a.SignalSearch]="62135",i[a.SimCard]="62136",i[a.Slash]="62137",i[a.SmallCross]="62138",i[a.SmallInfoSign]="62260",i[a.SmallMinus]="62139",i[a.SmallPlus]="62140",i[a.SmallSquare]="62141",i[a.SmallTick]="62142",i[a.Snowflake]="62143",i[a.SoccerBall]="62288",i[a.SocialMedia]="62144",i[a.SortAlphabeticalDesc]="62145",i[a.SortAlphabetical]="62146",i[a.SortAsc]="62147",i[a.SortDesc]="62148",i[a.SortNumericalDesc]="62149",i[a.Sort
1Numerical]="62150",i[a.Sort]="62151",i[a.SpellCheck]="62272",i[a.SplitColumns]="62152",i[a.SportsStadium]="62289",i[a.Square]="62153",i[a.StackedChart]="62154",i[a.StadiumGeometry]="62155",i[a.StarEmpty]="62156",i[a.Star]="62157",i[a.StepBackward]="62158",i[a.StepChart]="62159",i[a.StepForward]="62160",i[a.Stop]="62161",i[a.Stopwatch]="62162",i[a.Strikethrough]="62163",i[a.Style]="62164",i[a.Subscript]="62265",i[a.SubtractRightJoin]="62354",i[a.Superscript]="62266",i[a.SwapHorizontal]="62165",i[a.SwapVertical]="62166",i[a.Sweep]="62372",i[a.Switch]="62167",i[a.SymbolCircle]="62168",i[a.SymbolCross]="62169",i[a.SymbolDiamond]="62170",i[a.SymbolRectangle]="62242",i[a.SymbolSquare]="62171",i[a.SymbolTriangleDown]="62172",i[a.SymbolTriangleUp]="62173",i[a.Syringe]="62174",i[a.TableSync]="62318",i[a.TagAdd]="62329",i[a.TagPromote]="62330",i[a.TagRefresh]="62331",i[a.TagUndo]="62332",i[a.Tag]="62175",i[a.Tags]="62333",i[a.TakeAction]="62176",i[a.Tank]="62177",i[a.Target]="62178",i[a.Taxi]="62179",i[a.Team]="62290",i[a.Temperature]="62180",i[a.TextHighlight]="62181",i[a.ThAdd]="62346",i[a.ThDerived]="62182",i[a.ThDisconnect]="62183",i[a.ThFiltered]="62184",i[a.ThListAdd]="62347",i[a.ThList]="62185",i[a.ThVirtualAdd]="62349",i[a.ThVirtual]="62348",i[a.Th]="62186",i[a.ThirdParty]="62187",i[a.ThumbsDown]="62188",i[a.ThumbsUp]="62189",i[a.TickCircle]="62190",i[a.Tick]="62191",i[a.Time]="62192",i[a.TimelineAreaChart]="62193",i[a.TimelineBarChart]="62194",i[a.TimelineEvents]="62195",i[a.TimelineLineChart]="62196",i[a.Tint]="62197",i[a.Torch]="62198",i[a.Tractor]="62199",i[a.Train]="62200",i[a.Translate]="62201",i[a.Trash]="62202",i[a.Tree]="62203",i[a.TrendingDown]="62204",i[a.TrendingUp]="62205",i[a.Trophy]="62287",i[a.Truck]="62206",i[a.TwoColumns]="62207",i[a.Unarchive]="62208",i[a.Underline]="62209",i[a.Undo]="62210",i[a.UngroupObjects]="62211",i[a.UnknownVehicle]="62212",i[a.Unlink]="62277",i[a.Unlock]="62213",i[a.Unpin]="62214",i[a.Unresolve]="62215",i[a.Updated]="62216",i[a.Upload]="62217",i[a.User]="62218",i[a.Variable]="62219",i[a.Vector]="62302",i[a.VerticalBarChartAsc]="62220",i[a.VerticalBarChartDesc]="62221",i[a.VerticalDistribution]="62222",i[a.
1VerticalInbetween]="62250",i[a.Video]="62223",i[a.Virus]="62224",i[a.VolumeDown]="62225",i[a.VolumeOff]="62226",i[a.VolumeUp]="62227",i[a.Walk]="62228",i[a.WarningSign]="62229",i[a.WaterfallChart]="62230",i[a.Waves]="62231",i[a.WidgetButton]="62232",i[a.WidgetFooter]="62233",i[a.WidgetHeader]="62234",i[a.Widget]="62235",i[a.Wind]="62236",i[a.WrenchRedo]="62334",i[a.WrenchSnooze]="62335",i[a.WrenchTime]="62336",i[a.Wrench]="62237",i[a.ZoomIn]="62238",i[a.ZoomOut]="62239",i[a.ZoomToFit]="62240";for(var m={},g={},v=0,b=Object.values(a);v<b.length;v++){var y=b[v];m[(0,h.Ho)(y)]=y,g[(function(e,t){var n;return void 0===t&&(t={}),void 0===(n=(0,f.pi)({delimiter:"_"},t))&&(n={}),(0,p.B)(e,(0,f.pi)({delimiter:"."},n))})(y).toUpperCase()]=y}var w=(0,d.pi)((0,d.pi)({},m),g),x=new Set(Object.values(w)),C=function(){function e(){this.defaultLoader="split-by-size",this.loadedIconPaths16=new Map,this.loadedIconPaths20=new Map}return e.setLoaderOptions=function(e){void 0!==e.loader&&(E.defaultLoader=e.loader)},e.load=function(e,t,n){return(0,d.mG)(this,void 0,void 0,function(){var r=this;return(0,d.Jh)(this,function(i){switch(i.label){case 0:return Array.isArray(e)||(e=[e]),[4,Promise.all(e.map(function(e){return r.loadImpl(e,t,n)}))];case 1:return i.sent(),[2]}})})},e.loadAll=function(e){return(0,d.mG)(this,void 0,void 0,function(){var t,n=this;return(0,d.Jh)(this,function(r){return t=Object.values(w),function(e,t){(0,d.mG)(this,void 0,void 0,function(){var n,r,i;return(0,d.Jh)(this,function(a){switch(a.label){case 0:return(n="undefined"!=typeof NODE_ENV&&"development"===NODE_ENV&&"undefined"!=typeof performance)&&(r=performance.now(),console.info("Started '".concat(e,"'..."))),[4,t()];case 1:return a.sent(),n&&(i=Math.round(performance.now()-r),console.info("Finished '".concat(e,"' in ").concat(i,"ms"))),[2]}})})}("[Blueprint] loading all icons",function(){return(0,d.mG)(n,void 0,void 0,function(){return(0,d.Jh)(this,function(n){switch(n.label){case 0:return[4,Promise.all([this.load(t,u.J.STANDARD,e),this.load(t,u.J.LARGE,e)])];case 1:return n.sent(),[2]}})})}),[2]})})},e.getPaths=function(e,t){if(this.isValidIconName(e))return(t<u.J.LARGE?E.loadedIconPaths16:E.loadedIconPaths20).get(e)},e.loadImpl=function(e,t,r){return void 0===r&&(r={}),(0,d.mG)(this,void 0,void 0,function(){var i,a,o,l,s;return(0,d.Jh)(this,function(c){switch(c.label){case 0:if(!this.isValidIconName(e))return console.error("[Blueprint] Unknown icon '".concat(e,"'")),[2];if((i=t<u.J.LARGE?E.loadedIconPaths16:E.loadedIconPaths20).has(e))return[2];return[4,function(e){return(0,d.mG)(this,void 0,void 0,function(){var t,r;return(0,d.Jh)(this,function(i){switch(i.label){case 0:if("function"!=typeof(r=void 0===(t=e.loader)?E.defaultLoader:t))return[3,1];return[2,r];case 1:if("all"!==r)return[3,3];return[4,n.e(91439).then(n.bind(n,68466))];case 2:return[2,i.sent().allPathsLoader];case 3:return[4,n.e(63569).then(n.bind(n,81174))];case 4:return[2,i.sent().splitPathsBySizeLoader]}})})}(r)];case 1:a=c.sent(),c.label=2;case 2:return c.trys.push([2,4,,5]),o=t<u.J.LARGE?u.J.STANDARD:u.J.LARGE,[4,a(e,o)];case 3:return l=c.sent(),i.set(e,l),[3,5];case 4:return s=c.sent(),console.error("[Blueprint] Unable to load ".concat(t,"px icon '").concat(e,"'"),s),[3,5];case 5:return[2]}})})},e.isValidIconName=function(e){return x.has(e)},e}(),E=new C,k=n(95975),S=n(12131),T=n(84614),P=c.forwardRef(function(e,t){var n,r,i=e.autoLoad,a=void 0===i||i,l=e.className,d=e.color,h=e.icon,f=e.intent,p=e.tagName,m=void 0===p?"span":p,g=e.svgProps,v=e.title,b=e.htmlTitle,y=(0,o._T)(e,["autoLoad","className","color","icon","intent","tagName","svgProps","title","htmlTitle"]),w=null!==(r=null!==(n=e.iconSize)&&void 0!==n?n:e.size)&&void 0!==r?r:u.J.STANDARD,x=c.useState(function(){return"string"==typeof h?C.getPaths(h,w):void 0}),E=x[0],P=x[1];if(c.useEffect(function(){var e=!1;if("string"==typeof h){var t=C.getPaths(h,w);void 0!==t?P(t):a?C.load(h,w).then(function(){e||P(C.getPaths(h,w))}).catch(function(e){console.error("[Blueprint] Icon '".concat(h,"' (").concat(w,"px) could not be loaded."),e)}
1):console.error("[Blueprint] Icon '".concat(h,"' (").concat(w,"px) is not loaded yet and autoLoad={false}, did you call Icons.load('").concat(h,"', ").concat(w,")?"))}return function(){e=!0}},[a,h,w]),null==h||"boolean"==typeof h)return null;if("string"!=typeof h)return h;if(null==E){var M=w===u.J.STANDARD?S.Dct:w===u.J.LARGE?S.K14:void 0;return c.createElement(m||"span",(0,o.pi)((0,o.pi)({"aria-hidden":!v||void 0},(0,T.B)(y)),{className:s()(S.Wmm,M,S.sfD(h),S.NL3(f),l),"data-icon":h,ref:t,title:b}))}var R=E.map(function(e,t){return c.createElement("path",{d:e,key:t,fillRule:"evenodd"})});return c.createElement(k.l,(0,o.pi)({children:R,className:s()(S.NL3(f),l),color:d,htmlTitle:b,iconName:h,ref:t,size:w,svgProps:g,tagName:m,title:v},(0,T.B)(y)))});P.displayName="".concat(T.g,".Icon")},54064:function(e,t,n){"use strict";n.d(t,{v:function(){return c}});var r=n(17785),i=n(45254),a=n.n(i),o=n(7653),l=n(12131),s=n(84614),c=function(e){var t=e.className,n=e.children,i=e.large,s=e.size,c=e.small,u=e.ulRef,d=(0,r._T)(e,["className","children","large","size","small","ulRef"]);return o.createElement("ul",(0,r.pi)({role:"menu"},d,{className:a()(t,l.skh,l.aa8(void 0===s?"medium":s,{large:i,small:c})),ref:u}),n)};c.displayName="".concat(s.g,".Menu")},59162:function(e,t,n){"use strict";n.d(t,{R:function(){return c}});var r=n(45254),i=n.n(r),a=n(7653),o=n(12131),l=n(84614),s=n(41987),c=function(e){var t=e.className,n=e.title,r=e.titleId,l=i()(n?o.RjW:o.GdN,t);return a.createElement("li",{className:l,role:"separator"},n&&a.createElement(s.H6,{id:r},n))};c.displayName="".concat(l.g,".MenuDivider")},50058:function(e,t,n){"use strict";n.d(t,{s:function(){return y}});var r=n(17785),i=n(45254),a=n.n(i),o=n(7653),l=n(96834),s=n(2374),c=n(95975),u=o.forwardRef(function(e,t){var n=e.size>=s.J.LARGE,r=n?s.J.LARGE:s.J.STANDARD,i="".concat(-1*r/.05/2);return o.createElement(c.l,(0,l.pi)({iconName:"small-tick",ref:t},e),o.createElement("path",{d:n?"M300 300C294.4000000000001 300 289.4000000000001 297.8 285.8 294.2L160 168.2L114.2 214.2C110.6 217.8 105.6 220 100 220C89 220 80 211 80 200C80 194.4 82.2 189.4 85.8 185.8L145.8 125.8C149.4 122.2 154.4 120 160 120S170.6 122.2 174.2 125.8L314.2000000000001 265.8C317.8 269.4 320 274.4 320 280C320 291 311 300 300 300z":"M240 220C234.4 220 229.4 217.8 225.8 214.2L140 128.2L94.2 174.2C90.6 177.8 85.6 180 80 180C69 180 60 171 60 160C60 154.4 62.2 149.4 65.8 145.8L125.8 85.8C129.4 82.2 134.4 80 140 80S150.6 82.2 154.2 85.8L254.2 185.8C257.8 189.4 260 194.4 260 200C260 211 251 220 240 220z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});u.defaultProps={size:s.J.STANDARD},u.displayName="Blueprint5.Icon.SmallTick";var d=o.forwardRef(function(e,t){var n=e.size>=s.J.LARGE,r=n?s.J.LARGE:s.J.STANDARD,i="".concat(-1*r/.05/2);return o.createElement(c.l,(0,l.pi)({iconName:"caret-right",ref:t},e),o.createElement("path",{d:n?"M280 200C280 206.2 277 211.4 272.6 215.2L272.8 215.4L152.8 315.4L152.6 315.2C149.2 318 144.8 320 140 320C129 320 120 311 120 300V100C120 89 129 80 140 80C144.8 80 149.2 82 152.6 84.8L152.8 84.6L272.8 184.6L272.6 184.8C277 188.6 280 193.8 280 200z":"M220 160C220 163 218.6 165.6 216.6 167.4L216.6 167.4L136.6 237.4L136.6 237.4C134.8 239 132.6 240 130 240C124.4 240 120 235.6 120 230V90C120 84.4 124.4 80 130 80C132.6 80 134.8 81 136.6 82.6C136.6 82.6 136.6 82.6 136.6 82.6L216.6 152.6L216.6 152.6C218.6 154.4 220 157 220 160z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});d.defaultProps={size:s.J.STANDARD},d.displayName="Blueprint5.Icon.CaretRight";var h=n(12131),f=n(84614),p=n(94051),m=n(33280),g=n(45470),v=n(68002),b=n(54064),y=o.forwardRef(function(e,t){var n,i,l=e.active,s=e.className,c=e.children,y=e.disabled,C=void 0!==y&&y,E=e.icon,k=e.intent,S=e.labelClassName,T=e.labelElement,P=e.multiline,M=e.popoverProps,R=void 0===M?{}:M,A=e.roleStructure,L=void 0===A?"menuitem":A,_=e.selected,I=e.shouldDismissPopover,O=e.submenuProps,D=e.text,z=e.textClassName,N=e.tagName,F=e.htmlTitle,B=(0,r._T)(e,["active","className","children","disabled","icon","intent","labelClassName","labelElement","multiline","popoverProps","roleStructure","selected","shouldDismissPopover","submenuProps","text","textClassName","tagName","htmlTitle"]),H="listoption"===L?["option",void 0,!!_]:"menuitem"===L?["none","menuitem",void 0]:"none"===L?["none",void 0,void 0]:[void 0,void 0,void 0],V=H[0],j=H[1],$=H[2],U="listoption"===L,W=U&&_,G=null!=E,q=null!=c,Z=h.NL3(k),X=a()(h.URx,Z,((n={})[h.iNe]=void 0!==l&&l,n[h.rr$]=C,n[h.oPt]=(void 0===I||I)&&!C&&!q,n[h.fgl]=U,n[h.hdN]=W,n),s),Y=null==e.label&&null==T?null:o.createElement("span",{className:a()(h.Bzc,S)},e.label,T),K=o.createElement(void 0===N?"a":N,(0,r.pi)((0,r.pi)((0,r.pi)({onKeyDown:(0,p.dS)(["Enter"," "]),role:q?"none":j,tabIndex:q?-1:0},(0,f.B)(B)),C?x:{}),{className:X}),W?o.createElement(u,{className:h.LFI}):void 0,G?o.createElement("span",{className:h.FMD},o.createElement(m.I,{icon:E,"aria-hidden":!0,tabIndex:-1})):void 0,o.createElement(v.x,{className:a()(h.ur0,z),ellipsize:!(void 0!==P&&P),title:F},void 0===D?"":D),Y,q?o.createElement(d,{className:h.RBc,title:"Open sub menu"}):void 0),J=a()(((i={})[h.P1s]=q,i));return o.createElement("li",{className:J,ref:t,role:V,"aria-selected":$},null==c?K:o.createElement(g.J,(0,r.pi)({autoFocus:!1,captureDism
1iss:!1,disabled:C,enforceFocus:!1,hoverCloseDelay:0,interactionKind:"hover",modifiers:w,targetProps:{role:j,tabIndex:0},placement:"right-start",usePortal:!1},R,{content:o.createElement(b.v,(0,r.pi)({},O),c),minimal:!0,popoverClassName:a()(h.P1s,null==R?void 0:R.popoverClassName)}),K))});y.displayName="".concat(f.g,".MenuItem");var w={flip:{enabled:!0,options:{padding:20,rootBoundary:"viewport"}},offset:{enabled:!0,options:{offset:[-5,0]}},preventOverflow:{enabled:!0,options:{padding:20,rootBoundary:"viewport"}}},x={"aria-disabled":!0,href:void 0,onClick:void 0,onMouseDown:void 0,onMouseEnter:void 0,onMouseLeave:void 0,tabIndex:-1}},55918:function(e,t,n){"use strict";n.d(t,{w:function(){return h}});var r=n(17785),i=n(45254),a=n.n(i),o=n(7653),l=n(12131),s=n(84614),c=function(e){var t=e.className,n=(0,r._T)(e,["className"]);return o.createElement("div",(0,r.pi)({className:a()(l.hlT,t)},n))};c.displayName="".concat(s.g,".NavbarDivider");var u=n(43030),d=function(e){var t=e.children,n=e.className,i=(0,r._T)(e,["children","className"]);return o.createElement("div",(0,r.pi)({className:a()(l.ktp,n)},i),t)};d.displayName="".concat(s.g,".NavbarHeading");var h=function(e){var t,n=e.children,i=e.className,s=e.fixedToTop,c=(0,r._T)(e,["children","className","fixedToTop"]),u=a()(l.Auc,((t={})[l.jce]=s,t),i);return o.createElement("div",(0,r.pi)({className:u},c),n)};h.displayName="".concat(s.g,".Navbar"),h.Divider=c,h.Group=u.f,h.Heading=d},43030:function(e,t,n){"use strict";n.d(t,{f:function(){return h}});var r=n(17785),i=n(45254),a=n.n(i),o=n(7653),l=n(52956),s=n(12131),c=n(55927),u=n(84614),d=n(4239),h=function(e){var t=e.align,n=void 0===t?l.v.START:t,i=e.children,u=e.className,h=(0,r._T)(e,["align","children","className"]),f=a()(s.Kyb,s.Fcr(n),u);return(0,d.G)(function(){n===l.v.CENTER&&console.warn(c.Qn)},[n]),o.createElement("div",(0,r.pi)({className:f},h),i)};h.displayName="".concat(u.g,".NavbarGroup")},66169:function(e,t,n){"use strict";n.d(t,{l:function(){return q},Z:function(){return Z}});var r=n(17785),i=n(45254),a=n.n(i),o=n(7653),l=n(17610),s=n(61155),c=n(31907);
1function u(e,t){return e.replace(RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var d=n(3458),h={disabled:!1},f=n(45348),p=function(e){return e.scrollTop},m="unmounted",g="exited",v="entering",b="entered",y="exiting",w=function(e){function t(t,n){r=e.call(this,t,n)||this;var r,i,a=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?a?(i=g,r.appearStatus=v):i=b:i=t.unmountOnExit||t.mountOnEnter?m:g,r.state={status:i},r.nextCallback=null,r}(0,c.Z)(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===m?{status:g}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==v&&n!==b&&(t=v):(n===v||n===b)&&(t=y)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t){if(this.cancelNextCallback(),t===v){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:d.findDOMNode(this);n&&p(n)}this.performEnter(e)}else this.performExit()}else this.props.unmountOnExit&&this.state.status===g&&this.setState({status:m})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[d.findDOMNode(this),r],a=i[0],o=i[1],l=this.getTimeouts(),s=r?l.appear:l.enter;if(!e&&!n||h.disabled){this.safeSetState({status:b},function(){t.props.onEntered(a)});return}this.props.onEnter(a,o),this.safeSetState({status:v},function(){t.props.onEntering(a,o),t.onTransitionEnd(s,function(){t.safeSetState({status:b},function(){t.props.onEntered(a,o)})})})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:d.findDOMNode(this);if(!t||h.disabled){this.safeSetState({status:g},function(){e.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:y},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:g},function(){e.props.onExited(r)})})})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:d.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(!n||r){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],a=i[0],o=i[1];this.props.addEndListener(a,o)}null!=e&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===m)return null;var t=this.props,n=t.children,r=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,(0,s.Z)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return o.createElement(f.Z.Provider,{value:null},"function"==typeof n?n(e,r):o.cloneElement(o.Children.only(n),r))},t}(o.Component);function x(){}w.contextType=f.Z,w.propTypes={},w.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:x,onEntering:x,onEntered:x,onExit:x,onExiting:x,onExited:x},w.UNMOUNTED=m,w.EXITED=g,w.ENTERING=v,w.ENTERED=b,w.EXITING=y;var C=function(e,t){return e&&t&&t.split(" ").forEach(function(t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=u(e.className,t):e.setAttribute("class",u(e.className&&e.className.baseVal||"",t))})},E=function(e){function t(){for(var t,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];
1return(t=e.call.apply(e,[this].concat(r))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var r=t.resolveArguments(e,n),i=r[0],a=r[1];t.removeClasses(i,"exit"),t.addClass(i,a?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.resolveArguments(e,n),i=r[0],a=r[1];t.addClass(i,a?"appear":"enter","active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.resolveArguments(e,n),i=r[0],a=r[1]?"appear":"enter";t.removeClasses(i,a),t.addClass(i,a,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,r="string"==typeof n,i=r?(r&&n?n+"-":"")+e:n[e],a=r?i+"-active":n[e+"Active"],o=r?i+"-done":n[e+"Done"];return{baseClassName:i,activeClassName:a,doneClassName:o}},t}(0,c.Z)(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var r,i=this.getClassNames(t)[n+"ClassName"],a=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&a&&(i+=" "+a),"active"===n&&e&&p(e),i&&(this.appliedClasses[t][n]=i,r=i,e&&r&&r.split(" ").forEach(function(t){var n,r;return n=e,r=t,void(n.classList?n.classList.add(r):(n.classList?r&&n.classList.contains(r):-1!==(" "+(n.className.baseVal||n.className)+" ").indexOf(" "+r+" "))||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)))}))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],r=n.base,i=n.active,a=n.done;this.appliedClasses[t]={},r&&C(e,r),i&&C(e,i),a&&C(e,a)},n.render=function(){var e=this.props,t=(e.classNames,(0,s.Z)(e,["classNames"]));return o.createElement(w,(0,l.Z)({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(o.Component);E.defaultProps={classNames:""},E.propTypes={};var k=n(86445),S=function(){var e=1,t=new WeakMap,n=function(r,i){return"number"==typeof r||"string"==typeof r?i?"idx-".concat(i):"val-".concat(r):t.has(r)?"uid"+t.get(r):(t.set(r,e++),n(r))};return n};S();var T=function(e){return void 0===e&&(e=""),{value:1,prefix:e,uid:S()}},P=T(),M=o.createContext(T()),R=function(e){var t=e||P,n=(t?t.prefix:"")+t.value++;return{uid:n,gen:function(e){return n+t.uid(e)}}},A=function(){var e=(0,o.useContext)(M);return(0,o.useState)(function(){return R(e)})[0]}
1,L=n(12131),_=n(25157),I=n(55927),O=n(84614),D=n(94051),z=n(39199),N=n(85514),F=o.createContext({hasProvider:!1,stack:{current:[]}}),B=n(96250),H=[],V=[],j=function(e){e(H),V.forEach(function(e){return e()})},$=function(){return H},U=function(e){return V.push(e),function(){var t=V.indexOf(e);V.splice(t,1)}};function W(e){var t=(0,_.Uq)(e);return(null!=t?(0,D.GO)(t):[]).filter(function(e){return!e.classList.contains(L.nvt)&&!e.classList.contains(L.bkT)})}var G=n(63140),q={autoFocus:!0,backdropProps:{},canEscapeKeyClose:!0,canOutsideClickClose:!0,enforceFocus:!0,hasBackdrop:!0,isOpen:!1,lazy:(0,D.Sh)(),shouldReturnFocusOnClose:!0,transitionDuration:300,transitionName:L.v8x,usePortal:!0},Z=o.forwardRef(function(e,t){var n,i,l,s,c,u,d,h,f,p,m,g,v,b,y,w,x,C,S,T,P,M,R,O=e.autoFocus,V=e.backdropClassName,q=e.backdropProps,Y=e.canEscapeKeyClose,K=e.canOutsideClickClose,J=e.childRef,Q=e.childRefs,ee=e.children,et=e.className,en=e.enforceFocus,er=e.hasBackdrop,ei=e.isOpen,ea=e.lazy,eo=e.onClose,el=e.onClosed,es=e.onClosing,ec=e.onOpened,eu=e.onOpening,ed=e.portalClassName,eh=e.portalContainer,ef=e.shouldReturnFocusOnClose,ep=e.transitionDuration,em=e.transitionName,eg=e.usePortal;n=e.childRef,i=e.childRefs,l=e.children,s=o.Children.count(l),o.useEffect(function(){!(0,z.KV)("production")&&(null!=n&&null!=i&&console.error(I.T$),s>1&&null==i&&console.error(I.wN))},[n,i,s]);var ev=(d=(u=o.useContext(F)).stack,h=u.hasProvider,f=(0,B.useSyncExternalStore)(U,$,$),p=o.useCallback(function(){return f[f.length-1]},[f]),m=o.useCallback(function(e){var t=f.findIndex(function(t){return t.id===e});return f.slice(t)},[f]),g=o.useCallback(function(){j(function(e){return e.splice(0,e.length)})},[]),v=o.useCallback(function(e){H.push(e),e.props.usePortal&&e.props.hasBackdrop&&document.body.classList.add(L._4w)},[]),b={closeOverlay:o.useCallback(function(e){var t=f.filter(function(t){return t.props.usePortal&&t.props.hasBackdrop&&t.id!==e}),n=H.findIndex(function(t){return t.id===e});n>-1&&H.splice(n,1),0===t.length&&document.body.classList.remove(L._4w)},[f]),getLastOpened:p,getThisOverlayAndDescendants:m,openOverlay:v,resetStack:g},y=o.useCallback(function(){return d.current[d.current.length-1]},[d]),w=o.useCallback(function(e){var t=d.current.findIndex(function(t){return t.id===e});return -1===t?[]:d.current.slice(t)},[d]),x=o.useCallback(function(){d.current=[]},[d]),C=o.useCallback(function(e){d.current.push(e),e.props.usePortal&&e.props.hasBackdrop&&document.body.classList.add(L._4w)},[d]),S=o.useCallback(function(e){var t=d.current.filter(function(t){return t.props.usePortal&&t.props.hasBackdrop&&t.id!==e}),n=d.current.findIndex(function(t){return t.id===e});n>-1&&d.current.splice(n,1),0===t.length&&document.body.classList.remove(L._4w)},[d]),h?{closeOverlay:S,getLastOpened:y,getThisOverlayAndDescendants:w,openOverlay:C,resetStack:x}:((0,z.KV)("development")&&console.error(I.sh),b)),eb=ev.closeOverlay,ey=ev.getLastOpened,ew=ev.getThisOverlayAndDescendants,ex=ev.openOverlay,eC=o.useState(!1),eE=eC[0],ek=eC[1],eS=o.useState(!1),eT=eS[0],eP=eS[1],eM=o.useRef(null),eR=o.useRef(null),eA=o.useRef(null),eL=o.useRef(null),e_=o.useRef(null),eI=o.useRef(null),eO=o.useCallback(function(){return requestAnimationFrame(function(){var e,t=(0,_.Uq)(eR),n=(0,D.vY)(t);null!=t&&null!=n&&(t.contains(n)||(null===(e=(0,_.Uq)(eL))||void 0===e||e.focus({preventScroll:!0}),ek(!1)))})},[]),eD=(c=A().uid,"".concat(Z.displayName,"-").concat(c)),ez=o.useRef(null),eN=o.useCallback(function(e){var t=e.composed?e.composedPath()[0]:e.target,n=(0,_.Uq)(eR);null!=n&&t instanceof Node&&!n.contains(t)&&(e.preventDefault(),e.stopImmediatePropagation(),eO())},[eO]),eF=o.useCallback(function(e){var t=e.composed?e.composedPath()[0]:e.target;ew(eD).some(function(e){var n=e.containerElement,r=(0,_.Uq)(n);return(null==r?void 0:r.contains(t))&&!r.isSameNode(t)})||null==eo||eo(e)},[ew,eD,eo]),eB=o.useMemo(function(){return(0,_.lq)(t,ez)},[t]);o.useImperativeHandle(eB,function(){return{bringFocusInsideOverlay:eO,containerElement:eR,handleDocumentFocus:eN,handleDocumentMousedown:eF,id:eD,props:{autoFocus:O,enforceFocus:en,hasBackdrop:er,usePortal:eg}}},[O,eO,en,eN,eF,er,eD,eg]);var eH=o.useCallback(function(e){"Escape"===e.key&&Y&&(null==eo||eo(e),e.stopPropagation(),e.preventDefault())},[Y,eo]),eV=o.useCallback(function(){if(null!=ez.current){var e=ey();(null==e?void 0:e.handleDocumentFocus)!==void 0&&document.removeEventListener("focus",e.handleDocumentFocus,!0),ex(ez.current),O&&(ek(!0),eO()),(0,_.k$)(eM,(0,D.vY)((0,_.Uq)(eR)))}},[O,eO,ey,ex]),ej=o.useCallback(function(){document.removeEventListener("focus",eN,!0),document.removeEventListener("mousedown",eF),eb(eD);var e,t=ey();
1void 0!==t&&t.props.autoFocus&&t.props.enforceFocus&&(null===(e=t.bringFocusInsideOverlay)||void 0===e||e.call(t),void 0!==t.handleDocumentFocus&&document.addEventListener("focus",t.handleDocumentFocus,!0))},[eb,ey,eN,eF,eD]),e$=null!==(T=o.useRef(),o.useEffect(function(){T.current=ei},[ei]),M=T.current)&&void 0!==M&&M;o.useEffect(function(){ei&&eP(!0),!e$&&ei&&eV(),e$&&!ei&&ej()},[ei,eV,ej,e$]),o.useEffect(function(){if(ei&&K&&!er)return document.addEventListener("mousedown",eF),function(){document.removeEventListener("mousedown",eF)}},[eF,ei,K,er]),o.useEffect(function(){if(ei&&en)return document.addEventListener("focus",eN,!0),function(){document.removeEventListener("focus",eN,!0)}},[eN,en,ei]);var eU=o.useRef(ej);eU.current=ej,o.useEffect(function(){return function(){eU.current()}},[]);var eW=o.useCallback(function(e){var t=(0,_.Uq)(eM);ef&&t instanceof HTMLElement&&t.focus(),null==el||el(e)},[el,ef]),eG=o.useCallback(function(){},[]),eq=o.useCallback(function(e){if(null!=J)return J;if(null!=Q){var t=e.key;if(null==t){(0,z.KV)("production")||console.error(I.qD);return}return Q[t]}},[J,Q]),eZ=o.useCallback(function(e){if(null==e||(0,z.ke)(e))return null;var t=eq(e),n=(0,N.vZ)(e)?e.props:{},r=(0,N.h7)(e,"span",{className:a()(n.className,L.G07),ref:void 0===t?eI:void 0,tabIndex:en||O?0:void 0}),i=null!=t?t:eI;return o.createElement(E,{addEndListener:eG,classNames:em,nodeRef:i,onEntered:X(ec,i),onEntering:X(eu,i),onExited:X(eW,i),onExiting:X(es,i),timeout:ep},r)},[O,en,eq,eG,eW,es,ec,eu,ep,em]),eX=o.useCallback(function(e){var t;K&&(null==eo||eo(e)),en&&eO(),null===(t=null==q?void 0:q.onMouseDown)||void 0===t||t.call(q,e)},[q,eO,K,en,eo]),eY=o.useCallback(function(e,t){return o.createElement(E,{addEndListener:eG,classNames:em,key:e,nodeRef:t.ref,timeout:ep,unmountOnExit:!0},o.createElement("div",(0,r.pi)({tabIndex:0},t)))},[eG,ep,em]),eK=o.useCallback(function(e){if(en&&!eE){var t=(0,_.Uq)(eR),n=(0,_.Uq)(e_);null!=e.relatedTarget&&(null==t?void 0:t.contains(e.relatedTarget))&&e.relatedTarget!==n&&(null==n||n.focus({preventScroll:!0}))}},[en,eE]),eJ=o.useCallback(function(e){var t;if(en&&e.shiftKey&&"Tab"===e.key){var n=W(eR).pop();null!=n?n.focus():null===(t=(0,_.Uq)(e_))||void 0===t||t.focus({preventScroll:!0})}},[en]),eQ=o.useCallback(function(e){var t,n=(0,_.Uq)(eL);if(null!=e.relatedTarget&&(null===(t=(0,_.Uq)(eR))||void 0===t?void 0:t.contains(e.relatedTarget))&&e.relatedTarget!==n){var r=W(eR).shift();eE||null==r||r===e.relatedTarget?null==n||n.focus({preventScroll:!0}):r.focus()}else{var i=W(eR).pop();null!=i?i.focus():null==n||n.focus({preventScroll:!0})}},[eE]),e0=o.useMemo(function(){return er&&ei?o.createElement(E,{classNames:em,key:"__backdrop",nodeRef:eA,timeout:ep,addEndListener:eG},o.createElement("div",(0,r.pi)({},q,{className:a()(L.XaB,V,null==q?void 0:q.className),onMouseDown:eX,ref:eA}))):null},[V,q,eX,eG,er,ei,ep,em]);if(ea&&!eT)return null;var e1=ei&&null!==(R=o.Children.map(ee,eZ))&&void 0!==R?R:[];null!==e0&&e1.unshift(e0),ei&&(O||en)&&e1.length>0&&(e1.unshift(eY("__start",{className:L.nvt,onFocus:eK,onKeyDown:eJ,ref:eL})),en&&e1.push(eY("__end",{className:L.bkT,onFocus:eQ,ref:e_})));var e2=o.createElement("div",{"aria-live":"polite",className:a()(L.v8x,((P={})[L._4w]=ei,P[L.mCh]=!eg,P),et),onKeyDown:eH,ref:eR},o.createElement(k.Z,{appear:!0,component:null},e1));return eg?o.createElement(G.h,{className:ed,container:eh},e2):e2});function X(e,t){return function(){(null==t?void 0:t.current)!=null&&(null==e||e(t.current))}}Z.defaultProps=q,Z.displayName="".concat(O.g,".Overlay2")},45470:function(e,t,n){"use strict";n.d(t,{J:function(){return eJ}});var r,i,a,o,l,s=n(17785),c=n(45254),u=n.n(c),d=n(7653),h=d.createContext(),f=d.createContext();function p(e){var t=e.children,n=d.useState(null),r=n[0],i=n[1],a=d.useRef(!1);d.useEffect(function(){return function(){a.current=!0}},[]);var o=d.useCallback(function(e){a.current||i(e)},[]);return d.createElement(h.Provider,{value:r},d.createElement(f.Provider,{value:o},t))}var m=n(40013),g=n.n(m),v=function(e){return Array.isArray(e)?e[0]:e},b=function(e){if("function"==typeof e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.apply(void 0,n)}},y=function(e,t){if("function"==typeof e)return b(e,t);null!=e&&(e.current=t)},w=function(e){return e.reduce(function(e,t){var n=t[0],r=t[1];return e[n]=r,e},{})},x="undefined"!=typeof window&&window.document&&window.document.createElement?d.useLayoutEffect:d.useEffect;function C(e){var t=e.children,n=e.innerRef,r=d.useContext(f),i=d.useCallback(function(e){y(n,e),b(r,e)},[n,r]);return d.useEffect(function(){return function(){return y(n,null)}},[]),d.useEffect(function(){g()(!!r,"`Reference` should not be used outside of a `Manager` component.")},[r]),v(t)({ref:i})}var E=n(3458);function k(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function S(e){var t=k(e).Element;return e instanceof t||e instanceof Element}function T(e){var t=k(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function P(e){if("undefined"==typeof ShadowRoot)return!1;var t=k(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}var M=Math.max,R=Math.min,A=Math.round;function L(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function _(){return!/^((?!chrome|android).)*safari/i.test(L())}function I(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&T(e)&&(i=e.offsetWidth>0&&A(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&A(r.height)/e.offsetHeight||1);
vendor: 14,344 bytes, line 1
1var o=(S(e)?k(e):window).visualViewport,l=!_()&&n,s=(r.left+(l&&o?o.offsetLeft:0))/i,c=(r.top+(l&&o?o.offsetTop:0))/a,u=r.width/i,d=r.height/a;return{width:u,height:d,top:c,right:s+u,bottom:c+d,left:s,x:s,y:c}}function O(e){var t=k(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function D(e){return e?(e.nodeName||"").toLowerCase():null}function z(e){return((S(e)?e.ownerDocument:e.document)||window.document).documentElement}function N(e){return I(z(e)).left+O(e).scrollLeft}function F(e){return k(e).getComputedStyle(e)}function B(e){var t=F(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function H(e){var t=I(e),n=e.offsetWidth,r=e.offsetHeight;return 1>=Math.abs(t.width-n)&&(n=t.width),1>=Math.abs(t.height-r)&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function V(e){return"html"===D(e)?e:e.assignedSlot||e.parentNode||(P(e)?e.host:null)||z(e)}function j(e,t){void 0===t&&(t=[]);var n,r=function e(t){return["html","body","#document"].indexOf(D(t))>=0?t.ownerDocument.body:T(t)&&B(t)?t:e(V(t))}(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),a=k(r),o=i?[a].concat(a.visualViewport||[],B(r)?r:[]):r,l=t.concat(o);return i?l:l.concat(j(V(o)))}function $(e){return T(e)&&"fixed"!==F(e).position?e.offsetParent:null}function U(e){for(var t=k(e),n=$(e);n&&["table","td","th"].indexOf(D(n))>=0&&"static"===F(n).position;)n=$(n);return n&&("html"===D(n)||"body"===D(n)&&"static"===F(n).position)?t:n||function(e){var t=/firefox/i.test(L());if(/Trident/i.test(L())&&T(e)&&"fixed"===F(e).position)return null;var n=V(e);for(P(n)&&(n=n.host);T(n)&&0>["html","body"].indexOf(D(n));){var r=F(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var W="bottom",G="right",q="left",Z="auto",X=["top",W,G,q],Y="start",K="viewport",J="popper",Q=X.reduce(function(e,t){return e.concat([t+"-"+Y,t+"-end"])},[]),ee=[].concat(X,[Z]).reduce(function(e,t){return e.concat([t,t+"-"+Y,t+"-end"])},[]),et=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"],en={placement:"bottom",modifiers:[],strategy:"absolute"};function er(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}var ei={passive:!0};function ea(e){return e.split("-")[0]}function eo(e){return e.split("-")[1]}function el(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function es(e){var t,n=e.reference,r=e.element,i=e.placement,a=i?ea(i):null,o=i?eo(i):null,l=n.x+n.width/2-r.width/2,s=n.y+n.height/2-r.height/2;switch(a){case"top":t={x:l,y:n.y-r.height};break;case W:t={x:l,y:n.y+n.height};break;case G:t={x:n.x+n.width,y:s};break;case q:t={x:n.x-r.width,y:s};break;default:t={x:n.x,y:n.y}}var c=a?el(a):null;if(null!=c){var u="y"===c?"height":"width";switch(o){case Y:t[c]=t[c]-(n[u]/2-r[u]/2);break;case"end":t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}var ec={top:"auto",right:"auto",bottom:"auto",left:"auto"};function eu(e){var t,n,r,i,a,o,l,s=e.popper,c=e.popperRect,u=e.placement,d=e.variation,h=e.offsets,f=e.position,p=e.gpuAcceleration,m=e.adaptive,g=e.roundOffsets,v=e.isFixed,b=h.x,y=void 0===b?0:b,w=h.y,x=void 0===w?0:w,C="function"==typeof g?g({x:y,y:x}):{x:y,y:x};y=C.x,x=C.y;var E=h.hasOwnProperty("x"),S=h.hasOwnProperty("y"),T=q,P="top",M=window;if(m){var R=U(s),L="clientHeight",_="clientWidth";R===k(s)&&"static"!==F(R=z(s)).position&&"absolute"===f&&(L="scrollHeight",_="scrollWidth"),("top"===u||(u===q||u===G)&&"end"===d)&&(P=W,x-=(v&&R===M&&M.visualViewport?M.visualViewport.height:R[L])-c.height,x*=p?1:-1),(u===q||("top"===u||u===W)&&"end"===d)&&(T=G,y-=(v&&R===M&&M.visualViewport?M.visualViewport.width:R[_])-c.width,y*=p?1:-1)}var I=Object.assign({position:f},m&&ec),O=!0===g?(t={x:y,y:x},n=k(s),r=t.x,i=t.y,{x:A(r*(a=n.devicePixelRatio||1))/a||0,y:A(i*a)/a||0}):{x:y,y:x};return(y=O.x,x=O.y,p)?Object.assign({},I,((l={})[P]=S?"0":"",l[T]=E?"0":"",l.transform=1>=(M.devicePixelRatio||1)?"translate("+y+"px, "+x+"px)":"translate3d("+y+"px, "+x+"px, 0)",l)):Object.assign({},I,((o={})[P]=S?x+"px":"",o[T]=E?y+"px":"",o.transform="",o))}var ed={left:"right",right:"left",bottom:"top",top:"bottom"};function eh(e){return e.replace(/left|right|bottom|top/g,function(e){return ed[e]})}var ef={start:"end",end:"start"};function ep(e){return e.replace(/start|end/g,function(e){return ef[e]})}function em(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&P(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function eg(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ev(e,t,n){var r,i,a,o,l,s,c,u,d,h;return t===K?eg(function(e,t){var n=k(e),r=z(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,l=0,s=0;if(i){a=i.width,o=i.height;var c=_();(c||!c&&"fixed"===t)&&(l=i.offsetLeft,s=i.offsetTop)}return{width:a,height:o,x:l+N(e),y:s}}(e,n)):S(t)?((r=I(t,!1,"fixed"===n)).top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r):eg((i=z(e),o=z(i),l=O(i),s=null==(a=i.ownerDocument)?void 0:a.body,c=M(o.scrollWidth,o.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),u=M(o.scrollHeight,o.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),d=-l.scrollLeft+N(i),h=-l.scrollTop,"rtl"===F(s||o).direction&&(d+=M(o.clientWidth,s?s.clientWidth:0)-c),{width:c,height:u,x:d,y:h}))}function eb(){return{top:0,right:0,bottom:0,left:0}}function ey(e){return Object.assign({},eb(),e)}function ew(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}function ex(e,t){void 0===t&&(t={});var n,r,i,a,o,l,s,c,u=t,d=u.placement,h=void 0===d?e.placement:d,f=u.strategy,p=void 0===f?e.strategy:f,m=u.boundary,g=u.rootBoundary,v=u.elementContext,b=void 0===v?J:v,y=u.altBoundary,w=u.padding,x=void 0===w?0:w,C=ey("number"!=typeof x?x:ew(x,X)),E=e.rects.popper,k=e.elements[void 0!==y&&y?b===J?"reference":J:b],P=(n=S(k)?k:k.contextElement||z(e.elements.popper),r=void 0===m?"clippingParents":m,i=void 0===g?K:g,s=(l=[].concat("clippingParents"===r?(a=j(V(n)),S(o=["absolute","fixed"].indexOf(F(n).position)>=0&&T(n)?U(n):n)?a.filter(function(e){return S(e)&&em(e,o)&&"body"!==D(e)}):[]):[].concat(r),[i]))[0],(c=l.reduce(function(e,t){var r=ev(n,t,p);return e.top=M(r.top,e.top),e.right=R(r.right,e.right),e.bottom=R(r.bottom,e.bottom),e.left=M(r.left,e.left),e},ev(n,s,p))).width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c),A=I(e.elements.reference),L=es({reference:A,element:E,strategy:"absolute",placement:h}),_=eg(Object.assign({},E,L)),O=b===J?_:A,N={top:P.top-O.top+C.top,bottom:O.bottom-P.bottom+C.bottom,left:P.left-O.left+C.left,right:O.right-P.right+C.right},B=e.modifiersData.offset;if(b===J&&B){var H=B[h];Object.keys(N).forEach(function(e){var t=[G,W].indexOf(e)>=0?1:-1,n=["top",W].indexOf(e)>=0?"y":"x";N[e]+=H[n]*t})}return N}function eC(e,t,n){return M(e,R(t,n))}function eE(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ek(e){return["top",G,W,q].some(function(t){return e[t]>=0})}var eS=(a=void 0===(i=(r={defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=void 0===i||i,o=r.resize,l=void 0===o||o,s=k(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&c.forEach(function(e){e.addEventListener("scroll",n.update,ei)}),l&&s.addEventListener("resize",n.update,ei),function(){a&&c.forEach(function(e){e.removeEventListener("scroll",n.update,ei)}),l&&s.removeEventListener("resize",n.update,ei)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=es({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=n.adaptive,a=n.roundOffsets,o=void 0===a||a,l={placement:ea(t.placement),variation:eo(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:void 0===r||r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,eu(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:void 0===i||i,roundOffsets:o})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,eu(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:o})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];T(i)&&D(i)&&(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var r=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});T(r)&&D(r)&&(Object.assign(r.style,a),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=void 0===i?[0,0]:i,o=ee.reduce(function(e,n){var r,i,o,l,s,c;return e[n]=(r=t.rects,o=[q,"top"].indexOf(i=ea(n))>=0?-1:1,s=(l="function"==typeof a?a(Object.assign({},r,{placement:n})):a)[0],c=l[1],s=s||0,c=(c||0)*o,[q,G].indexOf(i)>=0?{x:c,y:s}:{x:s,y:c}),e},{}),l=o[t.placement],s=l.x,c=l.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=s,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=o}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=void 0===i||i,o=n.altAxis,l=void 0===o||o,s=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=void 0===f||f,m=n.allowedAutoPlacements,g=t.options.placement,v=ea(g)===g,b=s||(v||!p?[eh(g)]:function(e){if(ea(e)===Z)return[];var t=eh(e);return[ep(e),t,ep(t)]}(g)),y=[g].concat(b).reduce(function(e,n){var r,i,a,o,l,s,h,f,g,v,b,y;return e.concat(ea(n)===Z?(i=(r={placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}).placement,a=r.boundary,o=r.rootBoundary,l=r.padding,s=r.flipVariations,f=void 0===(h=r.allowedAutoPlacements)?ee:h,0===(b=(v=(g=eo(i))?s?Q:Q.filter(function(e){return eo(e)===g}):X).filter(function(e){return f.indexOf(e)>=0})).length&&(b=v),Object.keys(y=b.reduce(function(e,n){return e[n]=ex(t,{placement:n,boundary:a,rootBoundary:o,padding:l})[ea(n)],e},{})).sort(function(e,t){return y[e]-y[t]})):n)},[]),w=t.rects.reference,x=t.rects.popper,C=new Map,E=!0,k=y[0],S=0;S<y.length;S++){var T=y[S],P=ea(T),M=eo(T)===Y,R=["top",W].indexOf(P)>=0,A=R?"width":"height",L=ex(t,{placement:T,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),_=R?M?G:q:M?W:"top";w[A]>x[A]&&(_=eh(_));var I=eh(_),O=[];if(a&&O.push(L[P]<=0),l&&O.push(L[_]<=0,L[I]<=0),O.every(function(e){return e})){k=T,E=!1;break}C.set(T,O)}if(E)for(var D=p?3:1,z=function(e){var t=y.find(function(t){var n=C.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return k=t,"break"},N=D;N>0&&"break"!==z(N);N--);t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=n.altAxis,o=n.boundary,l=n.rootBoundary,s=n.altBoundary,c=n.padding,u=n.tether,d=void 0===u||u,h=n.tetherOffset,f=void 0===h?0:h,p=ex(t,{boundary:o,rootBoundary:l,padding:c,altBoundary:s}),m=ea(t.placement),g=eo(t.placement),v=!g,b=el(m),y="x"===b?"y":"x",w=t.modifiersData.popperOffsets,x=t.rects.reference,C=t.rects.popper,E="function"==typeof f?f(Object.assign({},t.rects,{placement:t.placement})):f,k="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,T={x:0,y:0};if(w){if(void 0===i||i){var P,A="y"===b?"top":q,L="y"===b?W:G,_="y"===b?"height":"width",I=w[b],O=I+p[A],D=I-p[L],z=d?-C[_]/2:0,N=g===Y?x[_]:C[_],F=g===Y?-C[_]:-x[_],B=t.elements.arrow,V=d&&B?H(B):{width:0,height:0},j=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:eb(),$=j[A],Z=j[L],X=eC(0,x[_],V[_]),K=v?x[_]/2-z-X-$-k.mainAxis:N-X-$-k.mainAxis,J=v?-x[_]/2+z+X+Z+k.mainAxis:F+X+Z+k.mainAxis,Q=t.elements.arrow&&U(t.elements.arrow),ee=Q?"y"===b?Q.clientTop||0:Q.clientLeft||0:0,et=null!=(P=null==S?void 0:S[b])?P:0,en=eC(d?R(O,I+K-et-ee):O,I,d?M(D,I+J-et):D);w[b]=en,T[b]=en-I}if(void 0!==a&&a){var er,ei,es="x"===b?"top":q,ec="x"===b?W:G,eu=w[y],ed="y"===y?"height":"width",eh=eu+p[es],ef=eu-p[ec],ep=-1!==["top",q].indexOf(m),em=null!=(ei=null==S?void 0:S[y])?ei:0,eg=ep?eh:eu-x[ed]-C[ed]-em+k.altAxis,ev=ep?eu+x[ed]+C[ed]-em-k.altAxis:ef,ey=d&&ep?(er=eC(eg,eu,ev))>ev?ev:er:eC(d?eg:eh,eu,d?ev:ef);w[y]=ey,T[y]=ey-eu}t.modifiersData[r]=T}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n,r=e.state,i=e.name,a=e.options,o=r.elements.arrow,l=r.modifiersData.popperOffsets,s=ea(r.placement),c=el(s),u=[q,G].indexOf(s)>=0?"height":"width";if(o&&l){var d=ey("number"!=typeof(t="function"==typeof(t=a.padding)?t(Object.assign({},r.rects,{placement:r.placement})):t)?t:ew(t,X)),h=H(o),f="y"===c?"top":q,p="y"===c?W:G,m=r.rects.reference[u]+r.re
1cts.reference[c]-l[c]-r.rects.popper[u],g=l[c]-r.rects.reference[c],v=U(o),b=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=d[f],w=b-h[u]-d[p],x=b/2-h[u]/2+(m/2-g/2),C=eC(y,x,w);r.modifiersData[i]=((n={})[c]=C,n.centerOffset=C-x,n)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&em(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=ex(t,{elementContext:"reference"}),l=ex(t,{altBoundary:!0}),s=eE(o,r),c=eE(l,i,a),u=ek(s),d=ek(c);t.modifiersData[n]={referenceClippingOffsets:s,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}).defaultModifiers)?[]:i,l=void 0===(o=r.defaultOptions)?en:o,function(e,t,n){void 0===n&&(n=l);var r,i,o={placement:"bottom",orderedModifiers:[],options:Object.assign({},en,l),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},s=[],c=!1,u={state:o,setOptions:function(n){var r,i,c,h,f,p="function"==typeof n?n(o.options):n;d(),o.options=Object.assign({},l,o.options,p),o.scrollParents={reference:S(e)?j(e):e.contextElement?j(e.contextElement):[],popper:j(t)};var m=(i=Object.keys(r=[].concat(a,o.options.modifiers).reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{})).map(function(e){return r[e]}),c=new Map,h=new Set,f=[],i.forEach(function(e){c.set(e.name,e)}),i.forEach(function(e){h.has(e.name)||function e(t){h.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!h.has(t)){var n=c.get(t);n&&e(n)}}),f.push(t)}(e)}),et.reduce(function(e,t){return e.concat(f.filter(function(e){return e.phase===t}))},[]));return o.orderedModifiers=m.filter(function(e){return e.enabled}),o.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=e.effect;if("function"==typeof r){var i=r({state:o,name:t,instance:u,options:void 0===n?{}:n});s.push(i||function(){})}}),u.update()},forceUpdate:function(){if(!c){var e,t,n,r,i,a,l,s,d,h,f,p,m=o.elements,g=m.reference,v=m.popper;if(er(g,v)){o.rects={reference:(t=U(v),n="fixed"===o.options.strategy,r=T(t),s=T(t)&&(a=A((i=t.getBoundingClientRect()).width)/t.offsetWidth||1,l=A(i.height)/t.offsetHeight||1,1!==a||1!==l),d=z(t),h=I(g,s,n),f={scrollLeft:0,scrollTop:0},p={x:0,y:0},(r||!r&&!n)&&(("body"!==D(t)||B(d))&&(f=(e=t)!==k(e)&&T(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:O(e)),T(t)?(p=I(t,!0),p.x+=t.clientLeft,p.y+=t.clientTop):d&&(p.x=N(d))),{x:h.left+f.scrollLeft-p.x,y:h.top+f.scrollTop-p.y,width:h.width,height:h.height}),popper:H(v)},o.reset=!1,o.placement=o.options.placement,o.orderedModifiers.forEach(function(e){return o.modifiersData[e.name]=Object.assign({},e.data)});for(var b=0;b<o.orderedModifiers.length;b++){if(!0===o.reset){o.reset=!1,b=-1;continue}var y=o.orderedModifiers[b],w=y.fn,x=y.options,C=void 0===x?{}:x,E=y.name;"function"==typeof w&&(o=w({state:o,options:C,name:E,instance:u})||o)}}}},update:(r=function(){return new Promise(function(e){u.forceUpdate(),e(o)})},function(){return i||(i=new Promise(function(e){Promise.resolve().then(function(){i=void 0,e(r())})})),i}),destroy:function(){d(),c=!0}};if(!er(e,t))return u;function d(){s.forEach(function(e){return e()}),s=[]}return u.setOptions(n).then(function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)}),u}),eT=n(36015),eP=n.n(eT),eM=[],eR=function(e,t,n){void 0===n&&(n={});var r=d.useRef(null),i={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||eM},a=d.useState({styles:{popper:{position:i.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=a[0],l=a[1],s=d.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(e){var t=e.state,n=Object.keys(t.elements);E.flushSync(function(){l({styles:w(n.map(function(e){return[e,t.styles[e]||{}]})),attributes:w(n.map(function(e){return[e,t.attributes[e]]}))})})},requires:["computeStyles"]}},[]),c=d.useMemo(function(){var e={onFirstUpdate:i.onFirstUpdate,placement:i.placement,strategy:i.strategy,modifiers:[].concat(i.modifiers,[s,{name:"applyStyles",enabled:!1}])};return eP()(r.current,e)?r.current||e:(r.current=e,e)},[i.onFirstUpdate,i.placement,i.strategy,i.modifiers,s]),u=d.useRef();return x(function(){u.current&&u.current.setOptions(c)},[c]),x(function(){if(null!=e&&null!=t){var r=(n.createPopper||eS)(e,t,c);return u.current=r,function(){r.destroy(),u.current=null}}},[e,t,n.createPopper]),{state:u.current?u.current.state:null,styles:o.styles,attributes:o.attributes,update:u.current?u.current.update:null,forceUpdate:u.current?u.current.forceUpdate:null}},eA=function(){},eL=function(){return Promise.resolve(null)},e_=[];function eI(e){var t=e.placement,n=void 0===t?"bottom":t,r=e.strategy,i=void 0===r?"absolute":r,a=e.modifiers,o=void 0===a?e_:a,l=e.referenceElement,s=e.onFirstUpdate,c=e.innerRef,u=e.children,f=d.useContext(h),p=d.useState(null),m=p[0],g=p[1],b=d.useState(null),w=b[0],x=b[1];d.useEffect(function(){y(c,m)},[c,m]);
1var C=eR(l||f,m,d.useMemo(function(){return{placement:n,strategy:i,onFirstUpdate:s,modifiers:[].concat(o,[{name:"arrow",enabled:null!=w,options:{element:w}}])}},[n,i,s,o,w])),E=C.state,k=C.styles,S=C.forceUpdate,T=C.update,P=d.useMemo(function(){return{ref:g,style:k.popper,placement:E?E.placement:n,hasPopperEscaped:E&&E.modifiersData.hide?E.modifiersData.hide.hasPopperEscaped:null,isReferenceHidden:E&&E.modifiersData.hide?E.modifiersData.hide.isReferenceHidden:null,arrowProps:{style:k.arrow,ref:x},forceUpdate:S||eA,update:T||eL}},[g,x,n,E,k,T,S]);return v(u)(P)}var eO=n(25157),eD=n(12131),ez=n(85514),eN=n(93156),eF=n(94051),eB=n(39199),eH=n(84614),eV=n(67824),ej=n(55927),e$=n(66169),eU=n(3485),eW=n(59799),eG={enabled:!0,name:"matchReferenceWidth",phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;t.styles.popper.width="".concat(t.rects.reference.width,"px")},effect:function(e){var t=e.state,n=t.elements.reference.getBoundingClientRect().width;t.elements.popper.style.width="".concat(n,"px")}},eq=n(60115),eZ=n(88876),eX=(0,s.pi)((0,s.pi)({},eZ.Ly),{AUTO:"auto",AUTO_END:"auto-end",AUTO_START:"auto-start"}),eY=n(81948),eK={CLICK:"click",HOVER:"hover",HOVER_TARGET_ONLY:"hover-target"},eJ=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={hasDarkParent:!1,isClosingViaEscapeKeypress:!1,isOpen:t.getIsOpen(t.props)},t.popoverElement=null,t.popoverRef=(0,eO.Km)(t,"popoverElement",t.props.popoverRef),t.targetRef=d.createRef(),t.transitionContainerElement=d.createRef(),t.isMouseInTargetOrPopover=!1,t.lostFocusOnSamePage=!0,t.isControlled=function(){return void 0!==t.props.isOpen},t.isArrowEnabled=function(){var e,n;return!t.props.minimal&&(null===(n=null===(e=t.props.modifiers)||void 0===e?void 0:e.arrow)||void 0===n?void 0:n.enabled)!==!1},t.isHoverInteractionKind=function(){return t.props.interactionKind===eK.HOVER||t.props.interactionKind===eK.HOVER_TARGET_ONLY},t.reposition=function(){var e;return null===(e=t.popperScheduleUpdate)||void 0===e?void 0:e.call(t)},t.renderTarget=function(e){var n,r,i,a,o,l=e.ref,c=t.props,h=c.children,f=c.className,p=c.disabled,m=c.fill,g=c.openOnTargetFocus,v=c.renderTarget,b=t.state.isOpen,y=t.isControlled(),w=t.isHoverInteractionKind(),x=t.props.targetTagName;m&&(x="div");var C=(0,eO.lq)(l,t.targetRef),E=w?{onBlur:t.handleTargetBlur,onContextMenu:t.handleTargetContextMenu,onFocus:t.handleTargetFocus,onMouseEnter:t.handleMouseEnter,onMouseLeave:t.handleMouseLeave}:{onClick:t.handleTargetClick,onKeyDown:t.handleKeyDown},k=!t.getIsContentEmpty()&&!p&&g&&w?0:void 0,S=(0,s.pi)({className:u()(f,eD.abV,((n={})[eD.ZA9]=b,n[eD.iNe]=b&&!y&&!w,n)),ref:C},E),T={"aria-expanded":w?void 0:b,"aria-haspopup":t.props.interactionKind===eK.HOVER_TARGET_ONLY?void 0:null!==(i=t.props.popupKind)&&void 0!==i?i:"menu"},P=((r={})[eD.iNe]=b&&!y&&!w,r[eD.ur0]=m,r);if(void 0!==v)o=v((0,s.pi)((0,s.pi)((0,s.pi)({},S),T),{className:u()(S.className,P),isOpen:b,tabIndex:k}));else{var M=ez.h7(d.Children.toArray(h)[0]);if(void 0===M)return null;var R=d.cloneElement(M,(0,s.pi)((0,s.pi)({},T),{className:u()(M.props.className,P),disabled:!!(b&&ez.Mc(M,eW.u))||M.props.disabled,tabIndex:null!==(a=M.props.tabIndex)&&void 0!==a?a:k}));o=d.createElement(x,(0,s.pi)((0,s.pi)({},S),t.props.targetProps),R)}
1return d.createElement(eU.z,{targetRef:t.targetRef,onResize:t.reposition},o)},t.renderPopover=function(e){var n,r=t.props,i=r.autoFocus,a=r.enforceFocus,o=r.backdropProps,l=r.canEscapeKeyClose,c=r.hasBackdrop,h=r.interactionKind,f=r.usePortal,p=t.state,m=p.isClosingViaEscapeKeypress,g=p.isOpen,v=(0,eY.c3)(e.placement,t.isArrowEnabled()?e.arrowProps.style:void 0);t.popperScheduleUpdate=e.update;var b={onClick:t.handlePopoverClick,onKeyDown:function(e){return eN.gT(e)&&t.handlePopoverClick(e)}};h!==eK.HOVER&&(f||h!==eK.HOVER_TARGET_ONLY)||(b.onMouseEnter=t.handleMouseEnter,b.onMouseLeave=t.handleMouseLeave);var y=(0,eY.tJ)(e.placement),w=u()(eD.Cr2,((n={})[eD.Pyr]=t.props.inheritDarkTheme&&t.state.hasDarkParent,n[eD.IRm]=t.props.minimal,n[eD.u$T]=t.props.captureDismiss,n[eD.eGL]=t.props.matchTargetWidth,n[eD.KCg]=!0===e.isReferenceHidden,n[eD.Cg9]=!0===e.hasPopperEscaped,n),"".concat(eD.N1M,"-").concat(y),t.props.popoverClassName),x=!t.isHoverInteractionKind()&&void 0,C=!t.isHoverInteractionKind()&&(!!m||t.props.shouldReturnFocusOnClose);return d.createElement(e$.Z,{autoFocus:null!=i?i:x,backdropClassName:eD.mHA,backdropProps:o,canEscapeKeyClose:l,canOutsideClickClose:h===eK.CLICK,childRef:t.transitionContainerElement,enforceFocus:a,hasBackdrop:c,isOpen:g,lazy:t.props.lazy,onClose:t.handleOverlayClose,onClosed:t.props.onClosed,onClosing:t.props.onClosing,onOpened:t.props.onOpened,onOpening:t.props.onOpening,transitionDuration:t.props.transitionDuration,transitionName:eD.Cr2,usePortal:f,portalClassName:t.props.portalClassName,portalContainer:t.props.portalContainer,portalStopPropagationEvents:t.props.portalStopPropagationEvents,shouldReturnFocusOnClose:C},d.createElement("div",{className:eD.zxm,ref:(0,eO.lq)(e.ref,t.transitionContainerElement),style:e.style},d.createElement(eU.z,{onResize:t.reposition},d.createElement("div",(0,s.pi)({className:w,style:{transformOrigin:v},ref:t.popoverRef},b),t.isArrowEnabled()&&d.createElement(eq.QH,{arrowProps:e.arrowProps,placement:e.placement}),d.createElement("div",{className:eD.YHb},t.props.content)))))},t.handleTargetFocus=function(e){t.props.openOnTargetFocus&&t.isHoverInteractionKind()&&(null!=e.relatedTarget||t.lostFocusOnSamePage)&&t.handleMouseEnter(e)},t.handleTargetBlur=function(e){t.props.openOnTargetFocus&&t.isHoverInteractionKind()&&(null!=e.relatedTarget&&(e.relatedTarget===t.popoverElement||t.isElementInPopover(e.relatedTarget))||t.handleMouseLeave(e)),t.lostFocusOnSamePage=null!=e.relatedTarget},t.handleTargetContextMenu=function(e){e.defaultPrevented&&t.setOpenState(!1,e)},t.handleMouseEnter=function(e){t.isMouseInTargetOrPopover=!0,!t.props.usePortal&&t.isElementInPopover(e.target)&&t.props.interactionKind===eK.HOVER_TARGET_ONLY&&!t.props.openOnTargetFocus?t.handleMouseLeave(e):t.props.disabled||t.setOpenState(!0,e,t.props.hoverOpenDelay)},t.handleMouseLeave=function(e){t.isMouseInTargetOrPopover=!1,e.persist(),t.setTimeout(function(){t.isMouseInTargetOrPopover||t.setOpenState(!1,e,t.props.hoverCloseDelay)})},t.handlePopoverClick=function(e){var n,r,i,a=e.target,o=a.closest(".".concat(eD.Cr2)),l=a.closest(".".concat(eD.Cr2)),s=(null!=o?o:l)===t.getPopoverElement(),c=null!==(r=null!==(n=null==o?void 0:o.classList.contains(eD.u$T))&&void 0!==n?n:null==l?void 0:l.classList.contains(eD.u$T))&&void 0!==r&&r,u=a.closest(".".concat(eD.oPt,", .").concat(eD.Hpx)),d=null!==(i=null==u?void 0:u.classList.contains(eD.oPt))&&void 0!==i&&i,h=null!=a.closest(":disabled, .".concat(eD.rr$));d&&!h&&(!c||s)&&t.setOpenState(!1,e)},t.handleOverlayClose=function(e){if(null!=t.targetRef.current&&void 0!==e){var n,r=null!==(n=e.nativeEvent)&&void 0!==n?n:e,i=r.composed?r.composedPath()[0]:r.target;(!eF.C2(t.targetRef.current,i)||e.nativeEvent instanceof KeyboardEvent)&&t.setOpenState(!1,e)}},t.handleKeyDown=function(e){eN.gT(e)&&t.handleTargetClick(e)},t.handleTargetClick=function(e){t.state.isOpen&&t.isSimulatedButtonClick(e)||t.props.disabled||t.isElementInPopover(e.target)||(null==t.props.isOpen?t.setState(function(e){return{isOpen:!e.isOpen}}):t.setOpenState(!t.props.isOpen,e))},t.isSimulatedButtonClick=function(e){return!e.isTrusted&&e.target.matches(".".concat(eD.q01))},t}return(0,s.ZT)(t,e),t.prototype.getPopoverElement=function(){var e;return null===(e=this.popoverElement)||void 0===e?void 0:e.querySelector(".".concat(eD.Cr2))},t.prototype.getIsOpen=function(e){var t;return!e.disabled&&(null!==(t=e.isOpen)&&void 0!==t?t:e.defaultIsOpen)},t.prototype.render=function(){var e=this.props,t=e.disabled,n=e.placement,r=e.position,i=e.positioningStrategy,a=this.state.isOpen;return this.getIsContentEmpty()?(t||!1===a||eB.KV("production")||console.warn(ej.Zc),this.renderTarget({ref:eQ})):d.createElement(p,null,d.createElement(C,null,this.renderTarget),d.createElement(eI,{innerRef:this.popoverRef,placement:null!=n?n:function(e){switch(e){case eX.TOP_LEFT:return"top-start";case eX.TOP:return"top";case eX.TOP_RIGHT:return"top-end";case eX.RIGHT_TOP:return"right-start";case eX.RIGHT:return"right";case eX.RIGHT_BOTTOM:return"right-end";case eX.BOTTOM_RIGHT:return"bottom-end";case eX.BOTTOM:return"bottom";case eX.BOTTOM_LEFT:return"bottom-start";case eX.LEFT_BOTTOM:return"left-end";case eX.LEFT:return"left";case eX.LEFT_TOP:return"left-start";case"auto":case"auto-start":case"auto-end":return e;default:return function(e){throw Error("Unexpected position: "+e)}(e)}}(void 0===r?"auto":r),strategy:i,modifiers:this.getPopperModifiers()},this.renderPopover))},t.prototype.componentDidMount=function(){this.updateDarkParent()},t.prototype.componentDidUpdate=function(t,n){e.prototype.componentDidUpdate.call(this,t,n),this.updateDarkParent();var r=this.getIsOpen(this.props);null!=this.props.isOpen&&r!==this.state.isOpen?(this.setOpenState(r),this.setState({isOpen:r})):this.props.disabled&&this.state.isOpen&&null==this.props.isOpen&&this.setOpenState(!1)},t.prototype.validateProps=function(e){null==e.isOpen&&null!=e.onInteraction&&console.warn(ej.Ig),e.hasBackdrop&&!e.usePortal&&console.warn(ej.WQ),e.hasBackdrop&&e.interactionKind!==eK.CLICK&&console.warn(ej.Q2),void 0!==e.placement&&void 0!==e.position&&console.warn(ej.xl);var t=d.Children.count(e.children),n=void 0!==e.renderTarget,r=void 0!==e.targetProps;0!==t||n||console.warn(ej.zZ),t>1&&console.warn(ej.fq),t>0&&n&&console.warn(ej.GO),n&&r&&console.warn(ej.A2)},t.prototype.getPopperModifiers=function(){var e,t,n,r,i=this.props,a=i.matchTargetWidth,o=i.modifiers,l=i.modifiersCustom,c=[(0,s.pi)({enabled:this.isArrowEnabled(),name:"arrow"},null==o?void 0:o.arrow),(0,s.pi)((0,s.pi)({name:"computeStyles"},null==o?void 0:o.computeStyles),{options:(0,s.pi)({adaptive:!0,gpuAcceleration:!1},null===(e=null==o?void 0:o.computeStyles)||void 0===e?void 0:e.options)}),(0,s.pi)((0,s.pi)({enabled:this.isArrowEnabled(),name:"offset"},null==o?void 0:o.offset),{options:(0,s.pi)({offset:[0,eq.e7/2]},null===(t=null==o?void 0:o.offset)||void 0===t?void 0:t.options)}),(0,s.pi)((0,s.pi)({name:"flip"},null==o?void 0:o.flip),{options:(0,s.pi)({boundary:this.props.boundary,rootBoundary:this.props.rootBoundary},null===(n=null==o?void 0:o.flip)||void 0===n?void 0:n.options)}),(0,s.pi)((0,s.pi)({name:"preventOverflow"},null==o?void 0:o.preventOverflow),{options:(0,s.pi)({boundary:this.props.boundary,rootBoundary:this.props.rootBoundary},null===(r=null==o?void 0:o.preventOverflow)||void 0===r?void 0:r.options)})];
1return a&&c.push(eG),void 0!==l&&c.push.apply(c,l),c},t.prototype.setOpenState=function(e,t,n){var r,i,a,o,l,s,c=this;null===(i=this.cancelOpenTimeout)||void 0===i||i.call(this),void 0!==n&&n>0?(null==t||t.persist(),this.cancelOpenTimeout=this.setTimeout(function(){c.setOpenState(e,t)},n)):(null==this.props.isOpen?this.setState({isOpen:e}):null===(o=(a=this.props).onInteraction)||void 0===o||o.call(a,e,t),e||(null===(s=(l=this.props).onClose)||void 0===s||s.call(l,t),this.setState({isClosingViaEscapeKeypress:(r=null==t?void 0:t.nativeEvent)instanceof KeyboardEvent&&"Escape"===r.key})))},t.prototype.updateDarkParent=function(){var e;if(this.props.usePortal&&this.state.isOpen){var t=(null===(e=this.targetRef.current)||void 0===e?void 0:e.closest(".".concat(eD.Pyr)))!=null;this.setState({hasDarkParent:t})}},t.prototype.isElementInPopover=function(e){var t,n;return null!==(n=null===(t=this.getPopoverElement())||void 0===t?void 0:t.contains(e))&&void 0!==n&&n},t.prototype.getIsContentEmpty=function(){var e=this.props.content;return null==e||eB.ke(e)},t.displayName="".concat(eH.g,".Popover"),t.defaultProps={boundary:"clippingParents",captureDismiss:!1,defaultIsOpen:!1,disabled:!1,fill:!1,hasBackdrop:!1,hoverCloseDelay:300,hoverOpenDelay:150,inheritDarkTheme:!0,interactionKind:eK.CLICK,matchTargetWidth:!1,minimal:!1,openOnTargetFocus:!0,positioningStrategy:"absolute",renderTarget:void 0,shouldReturnFocusOnClose:!1,targetTagName:"span",transitionDuration:300,usePortal:!0},t}(eV.l);function eQ(){}},60115:function(e,t,n){"use strict";n.d(t,{QH:function(){return u},e7:function(){return s},nx:function(){return c}});var r=n(17785),i=n(7653),a=n(12131),o=n(84614),l=n(81948),s=30,c=22,u=function(e){var t=e.arrowProps,n=t.ref,o=t.style,c=e.placement;return i.createElement("div",{"aria-hidden":!0,className:a.D2c,"data-popper-arrow":!0,ref:n,style:(0,r.pi)((0,r.pi)({},o),function(e){var t=s/2-4;switch((0,l.tJ)(e)){case"top":return{bottom:-t};case"left":return{right:-t};case"bottom":return{top:-t};default:return{left:-t}}}(c))},i.createElement("svg",{viewBox:"0 0 ".concat(s," ").concat(s),style:{transform:"rotate(".concat(function(e){if(null==e)return 0;switch((0,l.tJ)(e)){case"top":return -90;case"left":return 180;case"bottom":return 90;default:return 0}}(c),"deg)")}},i.createElement("path",{className:a.D2c+"-border",d:"M8.11 6.302c1.015-.936 1.887-2.922 1.887-4.297v26c0-1.378-.868-3.357-1.888-4.297L.925 17.09c-1.237-1.14-1.233-3.034 0-4.17L8.11 6.302z"}),i.createElement("path",{className:a.D2c+"-fill",d:"M8.787 7.036c1.22-1.125 2.21-3.376 2.21-5.03V0v30-2.005c0-1.654-.983-3.9-2.21-5.03l-7.183-6.616c-.81-.746-.802-1.96 0-2.7l7.183-6.614z"})))};u.displayName="".concat(o.g,".PopoverArrow")},81948:function(e,t,n){"use strict";function r(e){return e.split("-")[0]}function i(e){return -1!==["left","right"].indexOf(e)}function a(e){switch(e){case"top":return"bottom";case"left":return"right";case"bottom":return"top";default:return"left"}}function o(e){switch(e.split("-")[1]){case"start":return"left";case"end":return"right";default:return"center"}}function l(e,t){var n=r(e);return void 0===t?i(n)?"".concat(a(n)," ").concat(o(n)):"".concat(o(n)," ").concat(a(n)):i(n)?"".concat(a(n)," ").concat(parseInt(t.top,10)+15,"px"):"".concat(parseInt(t.left,10)+15,"px ").concat(a(n))}n.d(t,{c3:function(){return l},tJ:function(){return r}})},63140:function(e,t,n){"use strict";n.d(t,{h:function(){return u}});var r=n(7653),i=n(3458),a=n(12131),o=n(84614),l=n(55927),s=n(85514),c=r.createContext({});function u(e,t){var n,o=e.className,s=e.stopPropagationEvents,u=e.container,p=e.onChildrenMount,m=e.children;void 0===t&&(t={});var g=r.useContext(c),v=null!==(n=null!=u?u:g.portalContainer)&&void 0!==n?n:"undefined"!=typeof document?document.body:void 0,b=r.useState(),y=b[0],w=b[1],x=r.useCallback(function(){var e=document.createElement("div");e.classList.add(a.YbB),d(e.classList,o),d(e.classList,g.portalClassName),h(e,s);var n=t.blueprintPortalClassName;return null!=n&&""!==n&&(console.error(l.eD),d(e.classList,n)),e},[o,g.portalClassName,t.blueprintPortalClassName,s]);return(r.useEffect(function(){if(null!=v){var e=x();return v.appendChild(e),w(e),function(){f(e,s),e.remove(),w(void 0)}}},[v,x,s]),r.useEffect(function(){null!=y&&(null==p||p())},[y,p]),r.useEffect(function(){if(null!=y)return d(y.classList,o),function(){var e;return e=y.classList,void(null!=o&&""!==o&&e.remove.apply(e,o.split(" ")))}},[o,y]),r.useEffect(function(){if(null!=y)return h(y,s),function(){return f(y,s)}},[y,s]),"undefined"==typeof document||null==y)?null:i.createPortal(m,y)}function d(e,t){null!=t&&""!==t&&e.add.apply(e,t.split(" "))}function h(e,t){null==t||t.forEach(function(t){return e.addEventListener(t,p)})}function f(e,t){null==t||t.forEach(function(t){return e.removeEventListener(t,p)})}function p(e){e.stopPropagation()}
1u.displayName="".concat(o.g,".Portal"),(0,s.tV)()||(u.contextTypes={blueprintPortalClassName:function(e,t){if(null!=e[t]&&"string"!=typeof e[t])return Error(l.YQ)}})},3485:function(e,t,n){"use strict";n.d(t,{z:function(){return o}});var r=n(17785),i=n(7653),a=n(84614),o=function(e){function t(){var t,n=e.apply(this,arguments)||this;return n.targetRef=null!==(t=n.props.targetRef)&&void 0!==t?t:i.createRef(),n.prevElement=void 0,n}return(0,r.ZT)(t,e),t.prototype.render=function(){var e=i.Children.only(this.props.children);return void 0!==this.props.targetRef?e:i.cloneElement(e,{ref:this.targetRef})},t.prototype.componentDidMount=function(){var e=this;this.observer=null!=globalThis.ResizeObserver?new ResizeObserver(function(t){var n,r;return null===(r=(n=e.props).onResize)||void 0===r?void 0:r.call(n,t)}):void 0,this.observeElement()},t.prototype.componentDidUpdate=function(e){this.observeElement(this.props.observeParents!==e.observeParents)},t.prototype.componentWillUnmount=function(){var e;null===(e=this.observer)||void 0===e||e.disconnect(),this.prevElement=void 0},t.prototype.observeElement=function(e){if(void 0===e&&(e=!1),void 0!==this.observer){if(!(this.targetRef.current instanceof Element)){this.observer.disconnect();return}if((this.targetRef.current!==this.prevElement||e)&&(this.observer.disconnect(),this.prevElement=this.targetRef.current,this.observer.observe(this.targetRef.current),this.props.observeParents))for(var t=this.targetRef.current.parentElement;null!=t;)this.observer.observe(t),t=t.parentElement}},t.displayName="".concat(a.g,".ResizeSensor"),t}(n(67824).l)},86652:function(e,t,n){"use strict";n.d(t,{i:function(){return T}});var r=n(17785),i=n(7653),a=n(25117),o=n(67824),l=n(84614),s=n(45254),c=n.n(s),u=n(12131),d=n(13067),h=n(39199),f=n(85514),p=n(71191),m=n(55927),g=n(93156);function v(e){return"".concat((100*e).toFixed(2),"%")}function b(e,t,n,r){for(var i=t<n?1:-1,a=t;a!==n+i;a+=i)e[a]=r}var y=["max","min","stepSize","tickSize","value"],w=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={isMoving:!1},t.handleElement=null,t.refHandlers={handle:function(e){return t.handleElement=e}},t.beginHandleMovement=function(e){document.addEventListener("mousemove",t.handleHandleMovement),document.addEventListener("mouseup",t.endHandleMovement),t.setState({isMoving:!0}),t.changeValue(t.clientToValue(t.mouseEventClientOffset(e)))},t.beginHandleTouchMovement=function(e){document.addEventListener("touchmove",t.handleHandleTouchMovement),document.addEventListener("touchend",t.endHandleTouchMovement),document.addEventListener("touchcancel",t.endHandleTouchMovement),t.setState({isMoving:!0}),t.changeValue(t.clientToValue(t.touchEventClientOffset(e)))},t.getStyleProperties=function(){if(null==t.handleElement)return{};var e=t.props,n=e.min,r=e.tickSizeRatio,i=e.value,a=e.vertical,o=t.getHandleMidpointAndOffset(t.handleElement,!0).handleMidpoint,l="calc(".concat(v((i-(void 0===n?0:n))*r)," - ").concat(o,"px)");return a?{bottom:l}:{left:l}},t.endHandleMovement=function(e){t.handleMoveEndedAt(t.mouseEventClientOffset(e))},t.endHandleTouchMovement=function(e){t.handleMoveEndedAt(t.touchEventClientOffset(e))},t.handleMoveEndedAt=function(e){t.removeDocumentEventListeners(),t.setState({isMoving:!1});var n,r,i=t.changeValue(t.clientToValue(e));null===(r=(n=t.props).onRelease)||void 0===r||r.call(n,i)},t.handleHandleMovement=function(e){t.handleMovedTo(t.mouseEventClientOffset(e))},t.handleHandleTouchMovement=function(e){t.handleMovedTo(t.touchEventClientOffset(e))},t.handleMovedTo=function(e){t.state.isMoving&&!t.props.disabled&&t.changeValue(t.clientToValue(e))},t.handleKeyDown=function(e){var n=t.props,r=n.stepSize,i=n.value,a=g.X(e,["ArrowLeft","ArrowDown"],["ArrowRight","ArrowUp"]);void 0!==a&&(t.changeValue(i+r*a),e.preventDefault())},t.handleKeyUp=function(e){var n,r;g.Wl(e)&&(null===(r=(n=t.props).onRelease)||void 0===r||r.call(n,t.props.value))},t}return(0,r.ZT)(t,e),t.prototype.componentDidMount=function(){this.forceUpdate()},t.prototype.render=function(){var e,t=this.props,n=t.className,a=t.disabled,o=t.label,l=t.min,s=t.max,d=t.value,h=t.vertical,f=t.htmlProps,p=this.state.isMoving;return i.createElement("span",(0,r.pi)({role:"slider",tabIndex:0},f,{className:c()(u.TwB,((e={})[u.iNe]=p,e),n),onKeyDown:a?void 0:this.handleKeyDown,onKeyUp:a?void 0:this.handleKeyUp,onMouseDown:a?void 0:this.beginHandleMovement,onTouchStart:a?void 0:this.beginHandleTouchMovement,ref:this.refHandlers.handle,style:this.getStyleProperties(),"aria-valuemin":l,"aria-valuemax":s,"aria-valuenow":d,"aria-disabled":a,"aria-orientation":h?"vertical":"horizontal"}),null==o?null:i.createElement("span",{className:u.lzN},o))},t.prototype.componentWillUnmount=function(){this.removeDocumentEventListeners()},t.prototype.clientToValue=function(e){var t=this.props,n=t.stepSize,r=t.tickSize,i=t.value,a=t.vertical;if(null==this.handleElement)return i;var o=(a?window.innerHeight-e:e)-this.getHandleElementCenterPixel(this.handleElement);return isNaN(o)?i:i+Math.round(o/(r*n))*n},t.prototype.mouseEventClientOffset=function(e){return this.props.vertical?e.clientY:e.clientX},t.prototype.touchEventClientOffset=function(e){var t=e.changedTouches[0];return this.props.vertical?t.clientY:t.clientX},t.prototype.validateProps=function(e){for(var t=0;t<y.length;t++){var n=y[t];if("number"!=typeof e[n])throw Error("[Blueprint] <Handle> requires number value for ".concat(n," prop"))}},t.prototype.changeValue=function(e,t){return void 0===t&&(t=this.props.onChange),isNaN(e=this.clamp(e))||this.props.value===e||null==t||t(e),e},t.prototype.clamp=function(e){return h.uZ(e,this.props.min,this.props.max)},t.prototype.getHandleElementCenterPixel=function(e){var t=this.getHandleMidpointAndOffset(e),n=t.handleMidpoint;return t.handleOffset+n},t.prototype.getHandleMidpointAndOffset=function(e,t){if(void 0===t&&(t=!1),null==e)return{handleMidpoint:0,handleOffset:0};var n=this.props.vertical,r=e.getBoundingClientRect();r.width=e.offsetWidth,r.height=e.offsetHeight;var i=n?t?"width":"height":t?"height":"width",a=n?window.innerHeight-(r.top+r[i]):r.left;return{handleMidpoint:r[i]/2,handleOffset:a}},t.prototype.removeDocumentEventListeners=function(){document.removeEventListener("mousemove",this.handleHandleMovement),document.removeEventListener("mouseup",this.endHandleMovement),document.removeEventListener("touchmove",this.handleHandleTouchMovement),document.removeEventListener("touchend",this.endHandleTouchMovement),document.removeEventListener("touchcancel",this.endHandleTouchMovement)}
1,t.displayName="".concat(l.g,".SliderHandle"),t}(o.l),x={PUSH:"push",NONE:"none"},C=function(){return null};C.displayName="".concat(l.g,".MultiSliderHandle");var E=function(e){function t(){var t,n,r,i,a=null!==e&&e.apply(this,arguments)||this;return a.state={labelPrecision:(n=(t=a.props).labelPrecision,i=void 0===(r=t.stepSize)?E.defaultSliderProps.stepSize:r,null==n?h.vk(i):n),tickSize:0,tickSizeRatio:0},a.handleElements=[],a.trackElement=null,a.addHandleRef=function(e){null!=e&&a.handleElements.push(e)},a.maybeHandleTrackClick=function(e){if(a.canHandleTrackEvent(e)){var t=a.nearestHandleForValue(a.handleElements,function(t){return t.mouseEventClientOffset(e)});t&&t.beginHandleMovement(e)}},a.maybeHandleTrackTouch=function(e){if(a.canHandleTrackEvent(e)){var t=a.nearestHandleForValue(a.handleElements,function(t){return t.touchEventClientOffset(e)});t&&t.beginHandleTouchMovement(e)}},a.canHandleTrackEvent=function(e){var t=e.target;return!a.props.disabled&&null==t.closest(".".concat(u.TwB))},a.getHandlerForIndex=function(e,t){return function(n){null==t||t(a.getNewHandleValues(n,e))}},a.handleChange=function(e){var t,n,r=k(a.props),i=r.map(function(e){return e.value});d.cO(e,i)||(null===(n=(t=a.props).onChange)||void 0===n||n.call(t,e),r.forEach(function(t,n){var r;i[n]!==e[n]&&(null===(r=t.onChange)||void 0===r||r.call(t,e[n]))}))},a.handleRelease=function(e){var t,n,r=k(a.props);null===(n=(t=a.props).onRelease)||void 0===n||n.call(t,e),r.forEach(function(t,n){var r;null===(r=t.onRelease)||void 0===r||r.call(t,e[n])})},a}return(0,r.ZT)(t,e),t.getDerivedStateFromProps=function(e){return{labelPrecision:t.getLabelPrecision(e)}},t.getLabelPrecision=function(e){var t=e.labelPrecision,n=e.stepSize;return null==t?h.vk(n):t},t.prototype.getSnapshotBeforeUpdate=function(e){var t=k(e);return k(this.props).length!==t.length&&(this.handleElements=[]),null}
1,t.prototype.render=function(){var e,t=this,n=c()(u.dd0,((e={})[u.rr$]=this.props.disabled,e["".concat(u.dd0,"-unlabeled")]=!1===this.props.labelRenderer,e[u.yZ9]=this.props.vertical,e),this.props.className);return i.createElement("div",{className:n,onMouseDown:this.maybeHandleTrackClick,onTouchStart:this.maybeHandleTrackTouch},i.createElement("div",{className:u.YoZ,ref:function(e){return t.trackElement=e}},this.renderTracks()),i.createElement("div",{className:u.xqG},this.renderLabels()),this.renderHandles())},t.prototype.componentDidMount=function(){this.updateTickSize()},t.prototype.componentDidUpdate=function(t,n){e.prototype.componentDidUpdate.call(this,t,n),this.updateTickSize()},t.prototype.validateProps=function(e){if(e.stepSize<=0)throw Error(m.Fp);if(void 0!==e.labelStepSize&&void 0!==e.labelValues)throw Error(m.vS);if(void 0!==e.labelStepSize&&e.labelStepSize<=0)throw Error(m.x1);if(void 0!==e.min&&!isFinite(e.min))throw Error(m.y4);if(void 0!==e.max&&!isFinite(e.max))throw Error(m.Nd);var n=!1;if(i.Children.forEach(e.children,function(e){e&&!f.Mc(e,t.Handle)&&(n=!0)}),n)throw Error(m.kP)},t.prototype.formatLabel=function(e,t){void 0===t&&(t=!1);var n=this.props.labelRenderer;return!1===n?void 0:p.m(n)?n(e,{isHandleTooltip:t}):e.toFixed(this.state.labelPrecision)},t.prototype.renderLabels=function(){var e=this;if(!1===this.props.labelRenderer)return null;var t=this.getLabelValues(),n=this.props,r=n.max,a=n.min;return t.map(function(t,n){var o=v((t-a)/(r-a)),l=e.props.vertical?{bottom:o}:{left:o};return i.createElement("div",{className:u.lzN,key:n,style:l},e.formatLabel(t))})},t.prototype.renderTracks=function(){var e=S(this.props);e.push({value:this.props.max});for(var t={value:this.props.min},n=[],r=0;r<e.length;r++){var i=e[r];n.push(this.renderTrackFill(r,t,i)),t=i}return n},t.prototype.renderTrackFill=function(e,t,n){var a=[this.getOffsetRatio(t.value),this.getOffsetRatio(n.value)].sort(function(e,t){return e-t}),o=a[0],l=a[1],s=v(o),d=v(1-l),h=this.props.vertical?{bottom:s,left:0,top:d}:{left:s,right:d,top:0},f=(0,r.pi)((0,r.pi)({},h),t.trackStyleAfter||n.trackStyleBefore||{}),p=c()(u.Enz,u.NL3(this.getTrackIntent(t,n)));return i.createElement("div",{key:"track-".concat(e),className:p,style:f})},t.prototype.renderHandles=function(){var e=this,t=this.props,n=t.disabled,r=t.max,a=t.min,o=t.stepSize,l=t.vertical,s=k(this.props);return 0===s.length?null:s.map(function(t,d){var h,f=t.value,p=t.type,m=t.className,g=t.htmlProps;return i.createElement(w,{htmlProps:g,className:c()(((h={})[u.tj6]="start"===p,h[u.uR6]="end"===p,h),m),disabled:n,key:"".concat(d,"-").concat(s.length),label:e.formatLabel(f,!0),max:r,min:a,onChange:e.getHandlerForIndex(d,e.handleChange),onRelease:e.getHandlerForIndex(d,e.handleRelease),ref:e.addHandleRef,stepSize:o,tickSize:e.state.tickSize,tickSizeRatio:e.state.tickSizeRatio,value:f,vertical:l})})},t.prototype.nearestHandleForValue=function(e,t){return function(e,t){if(0!==e.length){for(var n=e[0],r=t(n),i=1;i<e.length;i++){var a=e[i],o=t(a);o<r&&(n=a,r=o)}return n}}(e,function(e){var n=t(e);return Math.abs(e.clientToValue(n)-e.props.value)})},t.prototype.getNewHandleValues=function(e,t){var n=k(this.props).map(function(e){return e.value}),r=n.slice();r[t]=e,r.sort(function(e,t){return e-t});var i=r.indexOf(e),a=this.findFirstLockedHandleIndex(t,i);if(-1===a)b(r,t,i,e);else{var o=n[a];return b(n,t,a,o),n}return r},t.prototype.findFirstLockedHandleIndex=function(e,t){for(var n=e<t?1:-1,r=k(this.props),i=e+n;i!==t+n;i+=n)if(r[i].interactionKind!==x.PUSH)return i;return -1},t.prototype.getLabelValues=function(){var e=this.props,t=e.labelStepSize,n=e.labelValues,r=e.min,i=e.max,a=[];if(void 0!==n)a=n.slice();else for(var o=r;o<i||h.mQ(o,i);o+=null!=t?t:1)a.push(o);return a},t.prototype.getOffsetRatio=function(e){return h.uZ((e-this.props.min)*this.state.tickSizeRatio,0,1)},t.prototype.getTrackIntent=function(e,t){return this.props.showTrackFill?void 0!==e.intentAfter?e.intentAfter:void 0!==t&&void 0!==t.intentBefore?t.intentBefore:this.props.defaultTrackIntent:a.S.NONE},t.prototype.updateTickSize=function(){if(null!=this.trackElement){var e=this.props.vertical?this.trackElement.clientHeight:this.trackElement.clientWidth,t=1/(this.props.max-this.props.min);this.setState({tickSize:e*t,tickSizeRatio:t})}},t.defaultSliderProps={disabled:!1,max:10,min:0,showTrackFill:!0,stepSize:1,vertical:!1},t.defaultProps=(0,r.pi)((0,r.pi)({},t.defaultSliderProps),{defaultTrackIntent:a.S.NONE}
1),t.displayName="".concat(l.g,".MultiSlider"),t.Handle=C,t}(o.l);function k(e){return S(e,function(e){return e.interactionKind!==x.NONE})}function S(e,t){var n=e.children;void 0===t&&(t=function(){return!0});var r=i.Children.map(n,function(e){return f.Mc(e,E.Handle)&&t(e.props)?e.props:null}),a=null!=r?r:[];return(a=a.filter(function(e){return null!==e})).sort(function(e,t){return e.value-t.value}),a}var T=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.ZT)(t,e),t.prototype.render=function(){var e=this.props,t=e.initialValue,n=e.intent,a=e.value,o=e.onChange,l=e.onRelease,s=e.handleHtmlProps,c=(0,r._T)(e,["initialValue","intent","value","onChange","onRelease","handleHtmlProps"]);return i.createElement(E,(0,r.pi)({},c),i.createElement(E.Handle,{value:a,intentAfter:a<t?n:void 0,intentBefore:a>t?n:void 0,onChange:o,onRelease:l,htmlProps:s}),i.createElement(E.Handle,{value:t,interactionKind:"none"}))},t.defaultProps=(0,r.pi)((0,r.pi)({},E.defaultSliderProps),{initialValue:0,intent:a.S.PRIMARY,value:0}),t.displayName="".concat(l.g,".Slider"),t}(o.l)},39174:function(e,t,n){"use strict";n.d(t,{$:function(){return m},E:function(){return i}});var r,i,a=n(17785),o=n(45254),l=n.n(o),s=n(7653),c=n(12131),u=n(55927),d=n(84614),h=n(39199),f=n(4239);(r=i||(i={}))[r.SMALL=20]="SMALL",r[r.STANDARD=50]="STANDARD",r[r.LARGE=100]="LARGE";var p="M 50,50 m 0,-".concat(45," a ").concat(45,",").concat(45," 0 1 1 0,").concat(90," a ").concat(45,",").concat(45," 0 1 1 0,-").concat(90),m=function(e){var t,n=e.className,r=void 0===n?"":n,o=e.intent,d=e.value,m=e.tagName,b=void 0===m?"div":m,y=e.size,w=(0,a._T)(e,["className","intent","value","tagName","size"]);(0,f.G)(function(){var e=null!=y,t=r.indexOf(c.HC1)>=0||r.indexOf(c.lnC)>=0;e&&t&&console.warn(u.sy)},[r,y]);var x=g(y,r),C=Math.min(16,4*i.LARGE/x),E=280-280*(null==d?.25:(0,h.uZ)(d,0,1)),k=l()(c.aSe,c.NL3(o),((t={})[c.Lf7]=null!=d,t),r);return s.createElement(b,(0,a.pi)({"aria-label":"loading","aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":void 0===d?void 0:100*d,className:k,role:"progressbar"},w),s.createElement(b,{className:c.KrR},s.createElement("svg",{width:x,height:x,strokeWidth:C.toFixed(2),viewBox:v(C)},s.createElement("path",{className:c.qEr,d:p}),s.createElement("path",{className:c.cDM,d:p,pathLength:280,strokeDasharray:"".concat(280," ").concat(280),strokeDashoffset:E}))))};m.displayName="".concat(d.g,".Spinner");var g=function(e,t){return null==e?t.indexOf(c.HC1)>=0?i.SMALL:t.indexOf(c.lnC)>=0?i.LARGE:i.STANDARD:Math.max(10,e)},v=function(e){var t=45+e/2,n=(50-t).toFixed(2),r=(2*t).toFixed(2);return"".concat(n," ").concat(n," ").concat(r," ").concat(r)}},38872:function(e,t,n){"use strict";n.d(t,{O:function(){return d}});var r=n(17785),i=n(45254),a=n.n(i),o=n(7653),l=n(12131),s=n(67824),c=n(84614),u=n(71191),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.ZT)(t,e),t.prototype.render=function(){var e=this.props,t=e.className,n=e.panel;return o.createElement("div",{className:a()(l.aXM,t),role:"tablist"},(0,u.m)(n)?n({tabPanelId:"",tabTitleId:""}):n)},t.defaultProps={disabled:!1},t.displayName="".concat(c.g,".Tab"),t}(s.l)},74038:function(e,t,n){"use strict";n.d(t,{mQ:function(){return R}});var r=n(17785),i=n(45254),a=n.n(i),o=n(7653),l=n(12131),s=n(93156),c=n(94051),u=n(13067),d=n(84614),h=n(67824),f=n(85514),p=n(38872),m=n(71191),g=n(25117),v=n(33280),b=n(33229),y=n(68002),w=n(75115),x=n(2374),C=function(e){var t=e.className,n=e.large,r=e.onRemove,i=e.size,a=e.tabIndex,s=n||"large"===i||(null==t?void 0:t.includes(l.lnC)),c=o.useCallback(function(t){null==r||r(t,e)},[r,e]);return o.createElement("button",{"aria-label":"Remove tag",type:"button",className:l.cm4,onClick:c,tabIndex:a},o.createElement(w.E,{size:s?x.J.LARGE:x.J.STANDARD}))};C.displayName="".concat(d.g,".TagRemoveButton");var E=o.forwardRef(function(e,t){var n,i=e.children,s=e.className,c=e.endIcon,u=e.fill,h=e.icon,p=e.intent,g=e.interactive,w=e.large,x=e.minimal,E=e.multiline,k=e.onRemove,S=e.rightIcon,T=e.round,P=e.size,M=(e.tabIndex,e.htmlTitle),R=(0,r._T)(e,["children","className","endIcon","fill","icon","intent","interactive","large","minimal","multiline","onRemove","rightIcon","round","size","tabIndex","htmlTitle"]),A=m.m(k),L=null!=g?g:null!=R.onClick,_=(0,b.y)(L,e,t,{defaultTabIndex:0,disabledTabIndex:void 0}),I=_[0],O=_[1],D=a()(l.Kgk,l.NL3(p),l.aa8(void 0===P?"medium":P,{large:void 0!==w&&w}),((n={})[l.iNe]=I,n[l.ur0]=void 0!==u&&u,n[l.znr]=L,n[l.IRm]=void 0!==x&&x,n[l.oUC]=void 0!==T&&T,n),s);return o.createElement("span",(0,r.pi)({},(0,d.B)(R),O,{className:D}),o.createElement(v.I,{icon:h}),!(0,f.qA)(i)&&o.createElement(y.x,{className:l.ur0,ellipsize:!E,tagName:"span",title:M},i),o.createElement(v.I,{icon:null!=c?c:S}),A&&o.createElement(C,(0,r.pi)({},e)))});E.displayName="".concat(d.g,".Tag");var k=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleClick=function(e){return t.props.onClick(t.props.id,e)},t}return(0,r.ZT)(t,e),t.prototype.render=function(){var e=this.props,t=e.className,n=e.children,i=e.disabled,s=e.id,c=e.parentId,u=e.selected,h=e.title,f=e.icon,p=e.tagContent,m=e.tagProps,b=(0,r._T)(e,["className","children","disabled","id","parentId","selected","title","icon","tagContent","tagProps"]),y=u?g.S.PRIMARY:g.S.NONE,w=S(c,s),x=w.tabPanelId,C=w.tabTitleId;return o.createElement("div",(0,r.pi)({},(0,d.B)(b),{"aria-controls":x,"aria-disabled":i,"aria-expanded":u,"aria-selected":u,className:a()(l.Mfv,t),"data-tab-id":s,id:C,onClick:i?void 0:this.handleClick,role:"tab",tabIndex:i?void 0:u?0:-1}),null!=f&&o.createElement(v.I,{icon:f,intent:y,className:l.qrB}),h,n,null!=p&&o.createElement(E,(0,r.pi)({minimal:!0,intent:y},m,{className:a()(l.P5D,null==m?void 0:m.className)}),p))},t.displayName="".concat(d.g,".TabTitle"),t}(h.l);function S(e,t){return{tabPanelId:"".concat(l.aXM,"_").concat(e,"_").concat(t),tabTitleId:"".concat(l.Mfv,"-title_").concat(e,"_").concat(t)}}var T=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.ZT)(t,e),t.prototype.render=function(){var e=this.props,t=e.className,n=e.id,r=e.parentId,i=e.selectedTabId,s=e.panel,c=e.renderActiveTabPanelOnly,u=n===i;if(void 0!==s&&(!c||u)){var d=S(r,n),h=d.tabTitleId,f=d.tabPanelId;return o.createElement("div",{"aria-labelledby":h,"aria-hidden":!u,className:a()(l.aXM,t),id:f,role:"tabpanel"},m.m(s)?s({tabPanelId:f,tabTitleId:h}):s)}},t}(h.l),P=function(){return o.createElement("div",{className:l.SDr})},M=".".concat(l.Mfv),R=function(e){function t(t){var n=e.call(this,t)||this;n.tablistElement=null,n.refHandlers={tablist:function(e){return n.tablistElement=e}},n.handleKeyDown=function(e){var t,r=s.X(e,["ArrowLeft","ArrowUp"],["ArrowRight","ArrowDown"]);if(void 0!==r){var i=null===(t=c.vY(n.tablistElement))||void 0===t?void 0:t.closest(M);if(i){var a=n.getTabElements('[aria-disabled="false"]'),o=a.indexOf(i);if(!(o<0)){e.preventDefault();var l=a.length;a[(o+r+l)%l].focus()}}}},n.handleKeyPress=function(e){var t=e.target.closest(M);null!=t&&s.gT(e)&&(e.preventDefault(),t.click())},n.handleTabClick=function(e,t){var r,i;null===(i=(r=n.props).onChange)||void 0===i||i.call(r,e,n.state.selectedTabId,t),void 0===n.props.selectedTabId&&n.setState({selectedTabId:e})},n.renderTabPanel=function(e){var t=e.props,i=t.className,l=t.panel,s=t.id,c=t.panelClassName;if(void 0!==l)return o.createElement(T,(0,r.pi)({},e.props,{key:s,className:a()(i,c),parentId:n.props.id,selectedTabId:n.state.selectedTabId}))},n.renderTabTitle=function(e){if(A(e)){var t=e.props.id;return o.createElement(k,(0,r.pi)({},e.props,{parentId:n.props.id,onClick:n.handleTabClick,selected:t===n.state.selectedTabId}))}return e};var i=n.getInitialSelectedTabId();return n.state={selectedTabId:i},n}return(0,r.ZT)(t,e),t.getDerivedStateFromProps=function(e){var t=e.selectedTabId;return void 0!==t?{selectedTabId:t}:null},t.prototype.render=function(){var e,t=this.props,n=t.animate,r=t.children,i=t.className,s=t.fill,c=t.large,u=t.renderActiveTabPanelOnly,d=t.size,h=t.vertical,f=this.state,p=f.indicatorWrapperStyle,m=f.selectedTabId,g=o.Children.map(r,this.renderTabTitle),v=this.getTabChildren().filter(u?function(e){return e.props.id===m}:function(){return!0}).map(this.renderTabPanel),b=n?o.createElement("div",{className:l.SHB,style:p},o.createElement("div",{className:l.bIF})):null,y=a()(l.G7x,i,((e={})[l.yZ9]=h,e[l.ur0]=s,e)),w=a()(l.YSh,l.aa8(void 0===d?"medium":d,{large:c}));return o.createElement("div",{className:y},o.createElement("div",{className:w,onKeyDown:this.handleKeyDown,onKeyPress:this.handleKeyPress,ref:this.refHandlers.tablist,role:"tablist"},b,g),v)},t.prototype.componentDidMount=function(){this.moveSelectionIndicator(!1)},t.prototype.componentDidUpdate=function(e,t){this.state.selectedTabId!==t.selectedTabId?this.moveSelectionIndicator():null==t.selectedTabId||u.cO(this.getTabChildrenProps(e),this.getTabChildrenProps(),u.ms)||this.moveSelectionIndicator()},t.prototype.getInitialSelectedTabId=function(){var e=this.props,t=e.defaultSelectedTabId,n=e.selectedTabId;if(void 0!==n)return n;if(void 0!==t)return t;var r=this.getTabChildren();return 0===r.length?void 0:r[0].props.id},t.prototype.getTabChildrenProps=function(e){return void 0===e&&(e=this.props),this.getTabChildren(e).map(function(e){return e.props})},t.prototype.getTabChildren=function(e){return void 0===e&&(e=this.props),o.Children.toArray(e.children).filter(A)},t.prototype.getTabElements=function(e){return(void 0===e&&(e=""),null==this.tablistElement)?[]:Array.from(this.tablistElement.querySelectorAll(M+e))},t.prototype.moveSelectionIndicator=function(e){if(void 0===e&&(e=!0),null!=this.tablistElement&&this.props.animate){var t="".concat(M,'[data-tab-id="').concat(this.state.selectedTabId,'"]'),n=this.tablistElement.querySelector(t),r={display:"none"};if(null!=n){var i=n.clientHeight,a=n.clientWidth,o=n.offsetLeft,l=n.offsetTop;r={height:i,transform:"translateX(".concat(Math.floor(o),"px) translateY(").concat(Math.floor(l),"px)"),width:a},e||(r.transition="none")}this.setState({indicatorWrapperStyle:r})}},t.Expander=P,t.Tab=p.O,t.defaultProps={animate:!0,fill:!1,large:!1,renderActiveTabPanelOnly:!1,size:"medium",vertical:!1}
1,t.displayName="".concat(d.g,".Tabs"),t}(h.l);function A(e){return f.Mc(e,p.O)}},68002:function(e,t,n){"use strict";n.d(t,{x:function(){return d}});var r=n(17785),i=n(45254),a=n.n(i),o=n(7653),l=n(25157),s=n(12131),c=n(84614),u=(0,n(94051).Sh)()?o.useLayoutEffect:o.useEffect,d=o.forwardRef(function(e,t){var n,i=e.children,c=e.tagName,d=e.title,h=e.className,f=e.ellipsize,p=void 0!==f&&f,m=(0,r._T)(e,["children","tagName","title","className","ellipsize"]),g=o.useRef(),v=o.useMemo(function(){return(0,l.lq)(g,t)},[t]),b=o.useState(""),y=b[0],w=b[1],x=o.useState(),C=x[0],E=x[1];return u(function(){var e;(null===(e=g.current)||void 0===e?void 0:e.textContent)!=null&&(E(p&&g.current.scrollWidth>g.current.clientWidth),w(g.current.textContent))},[g,i,p]),o.createElement(void 0===c?"div":c,(0,r.pi)((0,r.pi)({},m),{className:a()(((n={})[s.J4_]=p,n),h),ref:v,title:null!=d?d:C?y:void 0}),i)});d.displayName="".concat(c.g,".Text")},59799:function(e,t,n){"use strict";n.d(t,{u:function(){return m}});var r=n(17785),i=n(45254),a=n.n(i),o=n(7653),l=n(84614),s=n(67824),c=n(12131),u=n(45470),d=n(60115),h=o.createContext([{},function(){return null}]),f=function(e,t){switch(t.type){case"FORCE_DISABLED_STATE":return{forceDisabled:!0};case"RESET_DISABLED_STATE":return{};default:return e}},p=function(e){var t=e.children,n=e.forceDisable,r=o.useReducer(f,{}),i=r[0],a=r[1],l=o.useMemo(function(){return[i,a]},[i,a]);return o.useEffect(function(){n?a({type:"FORCE_DISABLED_STATE"}):a({type:"RESET_DISABLED_STATE"})},[n]),o.createElement(h.Provider,{value:l},"function"==typeof t?t(i):t)},m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.popoverRef=o.createRef(),t.renderPopover=function(e){var n,i,l=t.props,s=l.children,h=l.compact,f=l.disabled,p=l.intent,m=l.popoverClassName,g=(0,r._T)(l,["children","compact","disabled","intent","popoverClassName"]),v=a()(c.LiQ,c.NL3(p),m,((n={})[c.yXI]=h,n));return o.createElement(u.J,(0,r.pi)({modifiers:{arrow:{enabled:!t.props.minimal},offset:{options:{offset:[0,d.nx/2]}}}},g,{autoFocus:!1,canEscapeKeyClose:!1,disabled:null!==(i=e.forceDisabled)&&void 0!==i?i:f,enforceFocus:!1,lazy:!0,popoverClassName:v,portalContainer:t.props.portalContainer,ref:t.popoverRef}),s)},t}return(0,r.ZT)(t,e),t.prototype.render=function(){var e=this;return o.createElement(h.Consumer,null,function(t){var n=t[0];return o.createElement(p,(0,r.pi)({},n),e.renderPopover)})},t.prototype.reposition=function(){var e;null===(e=this.popoverRef.current)||void 0===e||e.reposition()},t.displayName="".concat(l.g,".Tooltip"),t.defaultProps={compact:!1,hoverCloseDelay:0,hoverOpenDelay:100,interactionKind:"hover-target",minimal:!1,transitionDuration:100},t}(s.l)},4239:function(e,t,n){"use strict";n.d(t,{G:function(){return a}});var r=n(7653),i=n(39199);function a(e,t){void 0===t&&(t=[]),r.useEffect(function(){(0,i.KV)("production")||e()},t)}},58051:function(e,t,n){"use strict";n.d(t,{p:function(){return l}});var r=n(96834),i=n(7653),a=n(2374),o=n(95975),l=i.forwardRef(function(e,t){var n=e.size>=a.J.LARGE,l=n?a.J.LARGE:a.J.STANDARD,s="".concat(-1*l/.05/2);return i.createElement(o.l,(0,r.pi)({iconName:"caret-down",ref:t},e),i.createElement("path",{d:n?"M320 260C320 271 311 280 300 280H100C89 280 80 271 80 260C80 255.2 82 250.8 84.8 247.4L84.6 247.2L184.6 127.2L184.8 127.4C188.6 123 193.8 120 200 120S211.4 123 215.2 127.4L215.4 127.2L315.4 247.2L315.2 247.4C318 250.8 320 255.2 320 260z":"M240 190C240 195.6 235.6 200 230 200H90C84.4 200 80 195.6 80 190C80 187.4 81 185.2 82.6 183.4C82.6 183.4 82.6 183.4 82.6 183.4L152.6 103.4L152.6 103.4C154.4 101.4 157 100 160 100S165.6 101.4 167.4 103.4L167.4 103.4L237.4 183.4L237.4 183.4C239 185.2 240 187.4 240 190z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(s,", ").concat(s,")"),style:{transformOrigin:"center"}}))});l.defaultProps={size:a.J.STANDARD},l.displayName="Blueprint5.Icon.CaretDown"},53159:function(e,t,n){"use strict";n.d(t,{_:function(){return l}});var r=n(96834),i=n(7653),a=n(2374),o=n(95975),l=i.forwardRef(function(e,t){var n=e.size>=a.J.LARGE,l=n?a.J.LARGE:a.J.STANDARD,s="".concat(-1*l/.05/2);
1return i.createElement(o.l,(0,r.pi)({iconName:"chevron-down",ref:t},e),i.createElement("path",{d:n?"M320 280C314.4000000000001 280 309.4000000000001 277.8 305.8 274.2L200 168.2L94.2 274.2C90.6 277.8 85.6 280 80 280C69 280 60 271 60 260C60 254.4 62.2 249.4 65.8 245.8L185.8 125.8C189.4 122.2 194.4 120 200 120S210.6 122.2 214.2 125.8L334.2000000000001 245.8C337.8 249.4 340 254.4 340 260C340 271 331 280 320 280z":"M240 220C234.4 220 229.4 217.8 225.8 214.2L160 148.2L94.2 214.2C90.6 217.8 85.6 220 80 220C69 220 60 211 60 200C60 194.4 62.2 189.4 65.8 185.8L145.8 105.8C149.4 102.2 154.4 100 160 100S170.6 102.2 174.2 105.8L254.2 185.8C257.8 189.4 260 194.4 260 200C260 211 251 220 240 220z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(s,", ").concat(s,")"),style:{transformOrigin:"center"}}))});l.defaultProps={size:a.J.STANDARD},l.displayName="Blueprint5.Icon.ChevronDown"},12724:function(e,t,n){"use strict";n.d(t,{K:function(){return l}});var r=n(96834),i=n(7653),a=n(2374),o=n(95975),l=i.forwardRef(function(e,t){var n=e.size>=a.J.LARGE,l=n?a.J.LARGE:a.J.STANDARD,s="".concat(-1*l/.05/2);return i.createElement(o.l,(0,r.pi)({iconName:"chevron-up",ref:t},e),i.createElement("path",{d:n?"M334.2000000000001 154.2L214.2 274.2000000000001C210.6 277.8 205.6 280 200 280S189.4 277.8 185.8 274.2L65.8 154.2C62.2 150.6 60 145.6 60 140C60 129 69 120 80 120C85.6 120 90.6 122.2 94.2 125.8L200 231.8L305.8 126C309.4000000000001 122.2 314.4000000000001 120 320 120C331 120 340 129 340 140C340 145.6 337.8 150.6 334.2000000000001 154.2z":"M254.2 134.2L174.2 214.2C170.6 217.8 165.6 220 160 220S149.4 217.8 145.8 214.2L65.8 134.2C62.2 130.6 60 125.6 60 120C60 109 69 100 80 100C85.6 100 90.6 102.2 94.2 105.8L160 171.8L225.8 106C229.4 102.2 234.4 100 240 100C251 100 260 109 260 120C260 125.6 257.8 130.6 254.2 134.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(s,", ").concat(s,")"),style:{transformOrigin:"center"}}))});l.defaultProps={size:a.J.STANDARD},l.displayName="Blueprint5.Icon.ChevronUp"},74035:function(e,t,n){"use strict";n.d(t,{O:function(){return l}});var r=n(96834),i=n(7653),a=n(2374),o=n(95975),l=i.forwardRef(function(e,t){var n=e.size>=a.J.LARGE,l=n?a.J.LARGE:a.J.STANDARD,s="".concat(-1*l/.05/2);return i.createElement(o.l,(0,r.pi)({iconName:"clean",ref:t},e),i.createElement("path",{d:n?"M140 400L100 300L0 260.0385184L100 220L140 120L180 220L280 259.8943316L180 300zM300 200L270 130.07389L200 100.102912L270 70.137224L300 0L330 70.137224L400 100L330 130.07389z":"M240 160L216 104.07387L160 80.08233L216 56.137188L240 0L264 56.137188L320 80L264 104.07387zM100 320L70 250L0 220.102913L70 190L100 120L130 190L200 220L130 250z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(s,", ").concat(s,")"),style:{transformOrigin:"center"}}))});l.defaultProps={size:a.J.STANDARD},l.displayName="Blueprint5.Icon.Clean"},31821:function(e,t,n){"use strict";n.d(t,{X:function(){return l}});var r=n(96834),i=n(7653),a=n(2374),o=n(95975),l=i.forwardRef(function(e,t){var n=e.size>=a.J.LARGE,l=n?a.J.LARGE:a.J.STANDARD,s="".concat(-1*l/.05/2);return i.createElement(o.l,(0,r.pi)({iconName:"cross",ref:t},e),i.createElement("path",{d:n?"M228.2 200L314 285.8C317.8 289.4 320 294.4 320 300C320 311 311 320 300 320C294.4000000000001 320 289.4000000000001 317.8 285.8 314.2L200 228.2L114.2 314.2C110.6 317.8 105.6 320 100 320C89 320 80 311 80 300C80 294.4 82.2 289.4 85.8 285.8L171.8 200L86 114.2000000000001C82.2 110.6 80 105.6 80 100C80 89 89 80 100 80C105.6 80 110.6 82.2 114.2 85.8L200 171.8L285.8 86C289.4000000000001 82.2 294.4000000000001 80 300 80C311 80 320 89 320 100C320 105.6 317.8 110.6 314.2000000000001 114.2000000000001L228.2 200z":"M188.2 160L254 225.8C257.8 229.4 260 234.4 260 240C260 251 251 260 240 260C234.4 260 229.4 257.8 225.8 254.2L160 188.2L94.2 254.2C90.6 257.8 85.6 260 80 260C69 260 60 251 60 240C60 234.4 62.2 229.4 65.8 225.8L131.8 160L66 94.2C62.2 90.6 60 85.6 60 80C60 69 69 60 80 60C85.6 60 90.6 62.2 94.2 65.8L160 131.8L225.8 66C229.4 62.2 234.4 60 240 60C251 60 260 69 260 80C260 85.6 257.8 90.6 254.2 94.2L188.2 160z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(s,", ").concat(s,")"),style:{transformOrigin:"center"}}))});l.defaultProps={size:a.J.STANDARD},l.displayName="Blueprint5.Icon.Cross"},70356:function(e,t,n){"use strict";n.d(t,{S:function(){return l}});var r=n(96834),i=n(7653),a=n(2374),o=n(95975),l=i.forwardRef(function(e,t){var n=e.size>=a.J.LARGE,l=n?a.J.LARGE:a.J.STANDARD,s="".concat(-1*l/.05/2);return i.createElement(o.l,(0,r.pi)({iconName:"double-chevron-down",ref:t},e),i.createElement("path",{d:n?"M185.8 185.8C189.4 182.2 194.4 180 200 180S210.6 182.2 214.2 185.8L334.2000000000001 305.8C337.8 309.4 340 314.4 340 320C340 331 331 340 320 340C314.4000000000001 340 309.4000000000001 337.8 305.8 334.2L200 228.2L94.2 334.2C90.6 337.8 85.6 340 80 340C69 340 60 331 60 320C60 314.4 62.2 309.4 65.8 305.8L185.8 185.8zM320 220C314.4000000000001 220 309.4000000000001 217.8 305.8 214.2L200 108.2L94.2 214.2C90.6 217.8 85.6 220 80 220C69 220 60 211 60 200C60 194.4 62.2 189.4 65.8 185.8L185.8 65.8C189.4 62.2 194.4 60 200 60S210.6 62.2 214.2 65.8L334.2000000000001 185.8C337.8 189.4 340 194.4 340 200C340 211 331 220 320 220z":"M145.8 145.8C149.4 142.2 154.4 140 160 140S170.6 142.2 174.2 145.8L254.2 225.8C257.8 229.4 260 234.4 260 240C260 251 251 260 240 260C234.4 260 229.4 257.8 225.8 254.2L160 188.2L94.2 254.2C90.6 257.8 85.6 260 80 260C69 260 60 251 60 240C60 234.4 62.2 229.4 65.8 225.8L145.8 145.8zM240 160C234.4 160 229.4 157.8 225.8 154.2L160 88.2L94.2 154.2C90.6 157.8 85.6 160 80 160C69 160 60 151 60 140C60 134.4 62.2 129.4 65.8 125.8L145.8 45.8C149.4 42.2 154.4 40 160 40S170.6 42.2 174.2 45.8L254.2 125.8C257.8 129.4 260 134.4 260 140C260 151 251 160 240 160z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(s,", ").concat(s,")"),style:{transformOrigin:"center"}}))});l.defaultProps={size:a.J.STANDARD},l.displayName="Blueprint5.Icon.DoubleChevronDown"},47716:function(e,t,n){"use strict";n.d(t,{C:function(){return l}});var r=n(96834),i=n(7653),a=n(2374),o=n(95975),l=i.forwardRef(function(e,t){var n=e.size>=a.J.LARGE,l=n?a.J.LARGE:a.J.STANDARD,s="".concat(-1*l/.05/2);return i.createElement(o.l,(0,r.pi)({iconName:"double-chevron-up",ref:t},e),i.createElement("path",{d:n?"M80 180C85.6 180 90.6 182.2 94.2 185.8L200 291.8L305.8 186C309.4000000000001 182.2 314.4000000000001 180 320 180C331 180 340 189 340 200C340 205.6 337.8 210.6 334.2000000000001 214.2L214.2 334.2000000000001C210.6 337.8 205.6 340 200 340C194.4 340 189.4 337.8 185.8 334.2L65.8 214.2C62.2 210.6 60 205.6 60 200C60 189 69 180 80 180zM214.2 214.2C210.6 217.8 205.6 220 200 220C194.4 220 189.4 217.8 185.8 214.2L65.8 94.2000000000001C62.2 90.6 60 85.6 60 80C60 69 69 60 80 60C85.6 60 90.6 62.2 94.2 65.8L200 171.8L305.8 66C309.4000000000001 62.2 314.4000000000001 60 320 60C331 60 340 69 340 80C340 85.6 337.8 90.6 334.2000000000001 94.2000000000001L214.2 214.2z":"M80 160C85.6 160 90.6 162.2 94.2 165.8L160 231.8L225.8 166C229.4 162.2 234.4 160 240 160C251 160 260 169 260 180C260 185.6 257.8 190.6 254.2 194.2L174.2 274.2C170.6 277.8 165.6 280 160 280S149.4 277.8 145.8 274.2L65.8 194.2C62.2 190.6 60 185.6 60 180C60 169 69 160 80 160zM174.2 174.2C170.6 177.8 165.6 180 160 180S149.4 177.8 145.8 174.2L65.8 94.2C62.2 90.6 60 85.6 60 80C60 69 69 60 80 60C85.6 60 90.6 62.2 94.2 65.8L160 131.8L225.8 66C229.4 62.2 234.4 60 240 60C251 60 260 69 260 80C260 85.6 257.8 90.6 254.2 94.2L174.2 174.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(s,", ").concat(s,")"),style:{transformOrigin:"center"}}))});l.defaultProps={size:a.J.STANDARD},l.displayName="Blueprint5.Icon.DoubleChevronUp"},64518:function(e,t,n){"use strict";n.d(t,{F:function(){return l}});var r=n(96834),i=n(7653),a=n(2374),o=n(95975),l=i.forwardRef(function(e,t){var n=e.size>=a.J.LARGE,l=n?a.J.LARGE:a.J.STANDARD,s="".concat(-1*l/.05/2);return i.createElement(o.l,(0,r.pi)({iconName:"duplicate",ref:t},e),i.createElement("path",{d:n?"M300 320H20C9 320 0 311 0 300V20C0 9 9 0 20 0H300C311 0 320 9 320 20V300C320 311 311 320 3
100 320zM280 40H40V280H280V40zM380 400H100C89 400 80 391 80 380V340H120V360H360V120H340V80H380C391 80 400 89 400 100V380C400 391 391 400 380 400z":"M300 320H100C89 320 80 311 80 300V260H120V280H280V140H260V100H300C311 100 320 109 320 120V300C320 311 311 320 300 320zM220 240H20C9 240 0 231 0 220V20C0 9 9 0 20 0H220C231 0 240 9 240 20V220C240 231 231 240 220 240zM200 40H40V200H200V40z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(s,", ").concat(s,")"),style:{transformOrigin:"center"}}))});l.defaultProps={size:a.J.STANDARD},l.displayName="Blueprint5.Icon.Duplicate"},84271:function(e,t,n){"use strict";n.d(t,{S:function(){return l}});var r=n(96834),i=n(7653),a=n(2374),o=n(95975),l=i.forwardRef(function(e,t){var n=e.size>=a.J.LARGE,l=n?a.J.LARGE:a.J.STANDARD,s="".concat(-1*l/.05/2);return i.createElement(o.l,(0,r.pi)({iconName:"layers",ref:t},e),i.createElement("path",{d:n?"M10 262L10 262L190 162L190 162C194 160 196 160 200 160S206 160 210 162L210 162L390 262L390 262C396 266 400 272 400 280C400 288 396 294 390 298L390 298L210 398L210 398C206 400 204 400 200 400S194 400 190 398L190 398L10 298L10 298C4 294 0 288 0 280C0 272 4 266 10 262zM380 220C376 220 374 220 370 218L370 218L200 122L30 218L30 218C26 220 24 220 20 220C8 220 0 212 0 200C0 192 4 186 10 182L10 182L190 82L190 82C194 80 196 80 200 80S206 80 210 82L210 82L390 182L390 182C396 186 400 192 400 200C400 212 392 220 380 220zM380 140C376 140 374 140 370 138L370 138L200 42L30 136L30 136C26 140 24 140 20 140C8 140 0 132 0 120C0 112 4 106 10 102L10 102L190 2L190 2C194 0 196 0 200 0S206 0 210 2L210 2L390 102L390 102C396 106 400 112 400 120.0000000000001C400 132 392 140 380 140z":"M10.99952 222.2L150.9998 162.2C153.7998 160.8 156.7998 160 159.9998 160C163.1998 160 166.1998 160.8 168.9998 162.2L309 222.2C315.4 225.4 320 232.2 320 240C320 248.2 315 255.4 307.8 258.4L167.9998 318.4C165.3998 319.4 162.7998 320 159.9998 320C157.1998 320 154.5998 319.4 152.1998 318.4L12.39952 258.4C4.99952 255.4 -0.000487566 248.2 -0.000487566 240C-0.000487566 232.2 4.59952 225.4 10.99952 222.2zM300 100C296.8 100 293.8 99.2 291 97.8L159.9998 40L28.9998 98C26.1998 99.2 23.1998 100 19.99976 100C8.99976 100 -0.00024438 91 -0.00024438 80C-0.00024438 72.2 4.59976 65.4 10.99976 62.2L150.9998 2.2C153.7998 0.8 156.7998 0 159.9998 0C163.1998 0 166.1998 0.8 168.9998 2.2L309 62.2C315.4 65.4 320 72.2 320 80C320 91 311 100 300 100zM300 180.0002C296.8 180.0002 293.8 179.2002 291 177.8002L159.9998 120L28.9994 177.8C26.1994 179.2 23.1994 180 19.99938 180C8.99938 180 -0.000610352 171 -0.000610352 160C-0.000610352 152.2 4.5994 145.4 10.99938 142.2L150.9998 82.2C153.7998 80.8 156.7998 80 159.9998 80C163.1998 80 166.1998 80.8 168.9998 82.2L309 142.2002C315.4 145.4002 320 152.2002 320 160.0002C320 171.0002 311 180.0002 300 180.0002z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(s,", ").concat(s,")"),style:{transformOrigin:"center"}}))});l.defaultProps={size:a.J.STANDARD},l.displayName="Blueprint5.Icon.Layers"},50708:function(e,t,n){"use strict";n.d(t,{H:function(){return l}});var r=n(96834),i=n(7653),a=n(2374),o=n(95975),l=i.forwardRef(function(e,t){var n=e.size>=a.J.LARGE,l=n?a.J.LARGE:a.J.STANDARD,s="".concat(-1*l/.05/2);return i.createElement(o.l,(0,r.pi)({iconName:"lock",ref:t},e),i.createElement("path",{d:n?"M318.6 220H280V300.2C280 344.4 244.2 380.2 200 380.2S120 344.4 120 300.2V220H78.6C67.6 220 60 211.2 60 200.2V40.1999999999999C60 29.2 67.6 20 78.6 20H318.6C329.6 20 340 29.2 340 40.2V200.2000000000001C340 211.2 329.6 220 318.6 220zM160 220V300.2C160 322.2 178 340.2 200 340.2S240 322.2 240 300.2V220H160z":"M279.2000000000001 180H240V241C240 284.6 204.2 320 160 320S80 284.6 80 241V180H39.2C28.2 180 20 173 20 162V23.8C20 13 28.2 0 39.2 0H279.2000000000001C290.2000000000001 0 300 13 300 23.8V162C300 173 290.2 180 279.2000000000001 180zM120 180V241C120 262.8 138 280.4 160 280.4S200 262.8 200 241V180H120z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(s,", ").concat(s,")"),style:{transformOrigin:"center"}}))});l.defaultProps={size:a.J.STANDARD},l.displayName="Blueprint5.Icon.Lock"},74210:function(e,t,n){"use strict";n.d(t,{p:function(){return l}});var r=n(96834),i=n(7653),a=n(2374),o=n(95975),l=i.forwardRef(function(e,t){var n=e.size>=a.J.LARGE,l=n?a.J.LARGE:a.J.STANDARD,s="".concat(-1*l/.05/2);return i.createElement(o.l,(0,r.pi)({iconName:"media",ref:t},e),i.createElement("path",{d:n?"M300 220C322 220 340 238 340 260C340 282 322 300 300 300S260 282 260 260C260 238 278 220 300 220zM380 360H20C9 360 0 351 0 340V60C0 49 9 40 20 40H380C391 40 400 49 400 60V340C400 351 391 360 380 360zM360 100L240 200L200 160L120 260L40 100V320H360V100z":"M239.8 180.2C250.8 180.2 259.8 189.2 259.8 200.2S250.8 220.2 239.8 220.2S219.8 211.2 219.8 200.2S228.8 180.2 239.8 180.2zM299.8 280.2H19.8C8.8 280.2 -0.2 271.2 -0.2 260.2V60.2C-0.2 49.2 8.8 40.2 19.8 40.2H299.8C310.8 40.2 319.8 49.2 319.8 60.2V260.2C319.8 271.2 310.8 280.2 299.8 280.2zM279.8 100.2L179.8 160.2L159.8 120.2L99.8 200.2L39.8 100.2V240.2H279.8V100.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(s,", ").concat(s,")"),style:{transformOrigin:"center"}}))});l.defaultProps={size:a.J.STANDARD},l.displayName="Blueprint5.Icon.Media"},51453:function(e,t,n){"use strict";n.d(t,{T:function(){return l}});var r=n(96834),i=n(7653),a=n(2374),o=n(95975),l=i.forwardRef(function(e,t){var n=e.size>=a.J.LARGE,l=n?a.J.LARGE:a.J.STANDARD,s="".concat(-1*l/.05/2);return i.createElement(o.l,(0,r.pi)({iconName:"more",ref:t},e),i.createElement("path",{d:n?"M20 190A50 50 0 0 1 120 190A50 50 0 0 1 20 190M300 190A50 50 0 0 1 400 190A50 50 0 0 1 300 190M160 190A50 50 0 0 1 260 190A50 50 0 0 1 160 190":"M0 159.4A40 40 0 0 1 80 159.4A40 40 0 0 1 0 159.4M240 159.4A40 40 0 0 1 320 159.4A40 40 0 0 1 240 159.4M120 159.4A40 40 0 0 1 200 159.4A40 40 0 0 1 120 159.4",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(s,", ").concat(s,")"),style:{transformOrigin:"center"}}))});l.defaultProps={size:a.J.STANDARD},l.displayName="Blueprint5.Icon.More"},94177:function(e,t,n){"use strict";n.d(t,{o:function(){return l}});var r=n(96834),i=n(7653),a=n(2374),o=n(95975),l=i.forwardRef(function(e,t){var n=e.size>=a.J.LARGE,l=n?a.J.LARGE:a.J.STANDARD,s="".concat(-1*l/.05/2);return i.createElement(o.l,(0,r.pi)({iconName:"search",ref:t},e),i.createElement("path",{d:n?"M391.2 51.2L292.4 150C309.8 175.8 320 206.6 320 240C320 328.4 248.4 400 160 400S0 328.4 0 240S71.6 80 160 80C193.4 80 224.2 90.2 250 107.6L348.8 8.8C354.2000000000001 3.4 361.8 0 370 0C386.6 0 400 13.4 400 30C400 38.2 396.6 45.8 391.2 51.2zM160 120C93.8 120 40 173.8 40 240S93.8 360 160 360S280 306.2000000000001 280 240S226.2 120 160 120z":"M311 51.4L257.6 105C271.6 126.8 279.8 152.6 279.8 180.2C279.8 257.6 217.2 320.2 139.8 320.2S-0.2 257.6
1-0.2 180.2S62.4 40.2 139.8 40.2C167.6 40.2 193.4 48.6 215 62.4L268.6 9C274 3.6 281.6 0.2 289.8 0.2C306.4 0.2 319.8 13.6 319.8 30.2C319.8 38.4 316.4 46 311 51.4zM139.8 80.2C84.6 80.2 39.8 125 39.8 180.2S84.6 280.2 139.8 280.2S239.8 235.4 239.8 180.2S195 80.2 139.8 80.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(s,", ").concat(s,")"),style:{transformOrigin:"center"}}))});l.defaultProps={size:a.J.STANDARD},l.displayName="Blueprint5.Icon.Search"},75115:function(e,t,n){"use strict";n.d(t,{E:function(){return l}});var r=n(96834),i=n(7653),a=n(2374),o=n(95975),l=i.forwardRef(function(e,t){var n=e.size>=a.J.LARGE,l=n?a.J.LARGE:a.J.STANDARD,s="".concat(-1*l/.05/2);return i.createElement(o.l,(0,r.pi)({iconName:"small-cross",ref:t},e),i.createElement("path",{d:n?"M228.2 200L294 265.8C297.8 269.4 300 274.4 300 280C300 291 291 300 280 300C274.4000000000001 300 269.4000000000001 297.8 265.8 294.2L200 228.2L134.2 294.2C130.6 297.8 125.6 300 120 300C109 300 100 291 100 280C100 274.4 102.2 269.4 105.8 265.8L171.8 200L106 134.2000000000001C102.2 130.6 100 125.6 100 120C100 109 109 100 120 100C125.6 100 130.6 102.2 134.2 105.8L200 171.8L265.8 106C269.4000000000001 102.2 274.4000000000001 100 280 100C291 100 300 109 300 120C300 125.6 297.8 130.6 294.2000000000001 134.2000000000001L228.2 200z":"M188.2 160L234 205.8C237.8 209.4 240 214.4 240 220C240 231 231 240 220 240C214.4 240 209.4 237.8 205.8 234.2L160 188.2L114.2 234.2C110.6 237.8 105.6 240 100 240C89 240 80 231 80 220C80 214.4 82.2 209.4 85.8 205.8L131.8 160L86 114.2C82.2 110.6 80 105.6 80 100C80 89 89 80 100 80C105.6 80 110.6 82.2 114.2 85.8L160 131.8L205.8 86C209.4 82.2 214.4 80 220 80C231 80 240 89 240 100C240 105.6 237.8 110.6 234.2 114.2L188.2 160z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(s,", ").concat(s,")"),style:{transformOrigin:"center"}}))});l.defaultProps={size:a.J.STANDARD},l.displayName="Blueprint5.Icon.SmallCross"},94487:function(e,t,n){"use strict";n.d(t,{r:function(){return l}});var r=n(96834),i=n(7653),a=n(2374),o=n(95975),l=i.forwardRef(function(e,t){var n=e.size>=a.J.LARGE,l=n?a.J.LARGE:a.J.STANDARD,s="".concat(-1*l/.05/2);return i.createElement(o.l,(0,r.pi)({iconName:"trash",ref:t},e),i.createElement("path",{d:n?"M340 380H240C240 391 231 400 220 400H180C169 400 160 391 160 380H60C49 380 40 371 40 360V340H360V360C360 371 351 380 340 380zM350 320H50C44.4 320 40 315.6 40 310C40 304.4 44.4 300 50 300H60V20C60 9 69 0 80 0H320C331 0 340 9 340 20V300H350C355.6 300 360 304.4 360 310C360 315.6 355.6 320 350 320zM140 80C140 69 131 60 120 60S100 69 100 80V240C100 251 109 260 120 260S140 251 140 240V80zM220 80C220 69 211 60 200 60S180 69 180 80V240C180 251 189 260 200 260S220 251 220 240V80zM300 80C300 69 291 60 280 60S260 69 260 80V240C260 251 269 260 280 260S300 251 300 240V80z":"M289.8 240.2H29.8C24.2 240.2 19.8 235.8 19.8 230.2S24.2 220.2 29.8 220.2H39.8V20.2C39.8 9.2 48.8 0.2 59.8 0.2H259.8C270.8 0.2 279.8 9.2 279.8 20.2V220.2H289.8C295.4 220.2 299.8 224.6 299.8 230.2S295.4 240.2 289.8 240.2zM119.8 60.2C119.8 49.2 110.8 40.2 99.8 40.2S79.8 49.2 79.8 60.2V180.2C79.8 191.2 88.8 200.2 99.8 200.2S119.8 191.2 119.8 180.2V60.2zM179.8 60.2C179.8 49.2 170.8 40.2 159.8 40.2S139.8 49.2 139.8 60.2V180.2C139.8 191.2 148.8 200.2 159.8 200.2S179.8 191.2 179.8 180.2V60.2zM239.8 60.2C239.8 49.2 230.8 40.2 219.8 40.2S199.8 49.2 199.8 60.2V180.2C199.8 191.2 208.8 200.2 219.8 200.2S239.8 191.2 239.8 180.2V60.2zM279.8 300.2H199.8C199.8 311.2 190.8 320.2 179.8 320.2H139.8C128.8 320.2 119.8 311.2 119.8 300.2H39.8C28.8 300.2 19.8 291.2 19.8 280.2V260.2H299.8V280.2C299.8 291.2 290.8 300.2 279.8 300.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(s,", ").concat(s,")"),style:{transformOrigin:"center"}}))});l.defaultProps={size:a.J.STANDARD},l.displayName="Blueprint5.Icon.Trash"},28419:function(e,t,n){"use strict";n.d(t,{S:function(){return l}});var r=n(96834),i=n(7653),a=n(2374),o=n(95975),l=i.forwardRef(function(e,t){var n=e.size>=a.J.LARGE,l=n?a.J.LARGE:a.J.STANDARD,s="".concat(-1*l/.05/2);return i.createElement(o.l,(0,r.pi)({iconName:"unlock",ref:t},e),i.createElement("path",{d:n?"M280 380C235.8 380 200 344.2 200 300V220H40C29 220 20 211 20 200V40C20 29 29 20 40 20H280C291 20 300 29 300 40V200C300 211 291 220 280 220H240V300C240 322 258 340 280 340S320 322 320 300V260C320 249 329 240 340 240S360 249 360 260V300C360 344.2 324.2000000000001 380 280 380z":"M239.8 320.2C195.6 320.2 159.8 284.4 159.8 240.2V180.2H19.8C8.8 180.2 -0.2 171.2 -0.2 160.2V20.2C-0.2 9.2 8.8 0.2 19.8 0.2H259.8C270.8 0.2 279.8 9.2 279.8 20.2V160.2C279.8 171.2 270.8 180.2 259.8 180.2H199.8V240.2C199.8 262.2 217.8 280.2 239.8 280.2S279.8 262.2 279.8 240.2V220.2C279.8 209.2 288.8 200.2 299.8 200.2S319.8 209.2 319.8 220.2V240.2C319.8 284.4 284 320.2 239.8 320.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(s,", ").concat(s,")"),style:{transformOrigin:"center"}}))});l.defaultProps={size:a.J.STANDARD},l.displayName="Blueprint5.Icon.Unlock"},87105:function(e,t,n){"use strict";n.d(t,{n:function(){return l}});var r=n(96834),i=n(7653),a=n(2374),o=n(95975),l=i.forwardRef(function(e,t){var n=e.size>=a.J.LARGE,l=n?a.J.LARGE:a.J.STANDARD,s="".concat(-1*l/.05/2);return i.createElement(o.l,(0,r.pi)({iconName:"video",ref:t},e),i.createElement("path",{d:n?"M380 360H20C9 360 0 351 0 340V60C0 49 9 40 20 40H380C391 40 400 49 400 60V340C400 351 391 360 380 360zM140 120V280L260 200L140 120z":"M300 280H20C9 280 0 271 0 260V60C0 49 9 40 20 40H300C311 40 320 49 320 60V260C320 271 311 280 300 280zM100 100V220L220 160L100 100z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(s,", ").concat(s,")"),style:{transformOrigin:"center"}}))});l.defaultProps={size:a.J.STANDARD},l.displayName="Blueprint5.Icon.Video"},2374:function(e,t,n){"use strict";var r,i;n.d(t,{J:function(){return r}}),(i=r||(r={}))[i.STANDARD=16]="STANDARD",i[i.LARGE=20]="LARGE"},95975:function(e,t,n){"use strict";n.d(t,{l:function(){return u}});var r=n(96834),i=n(45254),a=n.n(i),o=n(7653),l="".concat("bp5","-icon"),s=n(2374),c=new Map,u=o.forwardRef(function(e,t){var n,i,u,d=e.children,h=e.className,f=e.color,p=e.htmlTitle,m=e.iconName,g=e.size,v=void 0===g?s.J.STANDARD:g,b=e.svgProps,y=e.tagName,w=void 0===y?"span":y,x=e.title,C=(0,r._T)(e,["children","className","color","htmlTitle","iconName","size","svgProps","tagName","title"]),E=v>=s.J.LARGE?s.J.LARGE:s.J.STANDARD,k="0 0 ".concat(E," ").concat(E),S=(n="iconTitle",u=null!==(i=c.get(n))&&void 0!==i?i:0,c.set(n,u+1),"".concat(n,"-").concat(u)),T=(0,r.pi)({fill:f,height:v,role:"img",viewBox:k,width:v},b);return null===w?o.createElement("svg",(0,r.pi)({"aria-labelledby":x?S:void 0,"data-icon":m,ref:t},T,C,{className:a()(h,null==b?void 0:b.className)}),x&&o.createElement("title",{id:S},x),d):o.createElement(w,(0,r.pi)((0,r.pi)({"aria-hidden":!x||void 0},C),{className:a()(l,"".concat(l,"-").concat(m),h),ref:t,title:p}),o.createElement("svg",(0,r.pi)({"data-icon":m},T,{className:null==b?void 0:b.className}),x&&o.createElement("title",null,x),d))});u.displayName="Blueprint5.SVGIconContainer"},88283:function(e,t,n){"use strict";n.d(t,{P:function(){return H}});
1var r,i,a=function(e,t){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var l=function(){return(l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function s(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}"function"==typeof SuppressedError&&SuppressedError;var c=n(45254),u=n.n(c),d=n(7653),h=n(25157),f=n(39199),p=n(9065),m=n(45470);(r=i||(i={})).MENU="menu",r.LISTBOX="listbox",r.TREE="tree",r.GRID="grid",r.DIALOG="dialog";var g=n(12131),v=n(93156),b=n(94051),y=n(38726),w=n(84614),x=n(67824),C=n(94177),E=n(31821),k=g.wGP(),S="".concat(k,"-select-popover"),T=n(54064),P=n(13067),M=n(17785),R=function(e){function t(t){var n=e.call(this,t)||this;return n.timeoutIds=[],n.requestIds=[],n.clearTimeouts=function(){if(n.timeoutIds.length>0){for(var e=0,t=n.timeoutIds;e<t.length;e++){var r=t[e];window.clearTimeout(r)}n.timeoutIds=[]}},n.cancelAnimationFrames=function(){if(n.requestIds.length>0){for(var e=0,t=n.requestIds;e<t.length;e++){var r=t[e];window.cancelAnimationFrame(r)}n.requestIds=[]}},(0,f.KV)("production")||n.validateProps(n.props),n}return(0,M.ZT)(t,e),t.prototype.componentDidUpdate=function(e,t,n){(0,f.KV)("production")||this.validateProps(this.props)},t.prototype.componentWillUnmount=function(){this.clearTimeouts(),this.cancelAnimationFrames()},t.prototype.requestAnimationFrame=function(e){var t=window.requestAnimationFrame(e);return this.requestIds.push(t),function(){return window.cancelAnimationFrame(t)}},t.prototype.setTimeout=function(e,t){var n=window.setTimeout(e,t);return this.timeoutIds.push(n),function(){return window.clearTimeout(n)}},t.prototype.validateProps=function(e){},t}(d.Component),A=n(71191);function L(e,t,n){return void 0===e||null==t||null==n?t===n:A.m(e)?e(t,n):t[e]===n[e]}function _(){return{__blueprintCreateNewItemBrand:"blueprint-create-new-item"}}function I(e){if(null==e)return!1;var t=Object.keys(e);return 1===t.length&&"__blueprintCreateNewItemBrand"===t[0]&&"blueprint-create-new-item"===e.__blueprintCreateNewItemBrand}function O(e){return null==e||I(e)?null:e}var D=function(e){function t(t){var n,r,i=e.call(this,t)||this;i.itemRefs=new Map,i.refHandlers={itemsParent:function(e){return i.itemsParentRef=e}},i.shouldCheckActiveItemInViewport=!1,i.expectedNextActiveItem=null,i.isEnterKeyPressed=!1,i.renderItemList=function(e){var t=i.props,n=t.initialContent,r=t.noResults,a=e.renderCreateItem(),o=function(e,t,n){if(0===e.query.length&&void 0!==n)return n;var r=e.filteredItems.map(e.renderItem).filter(function(e){return null!=e});return r.length>0?r:t}(e,null!=a?null:r,n);if(null==o&&null==a)return null;var s=i.isCreateItemFirst();return d.createElement(T.v,l({role:"listbox"},e.menuProps,{ulRef:e.itemsParentRef}),s&&a,o,!s&&a)},i.renderItem=function(e,t){if(!0!==i.props.disabled){var n=i.state,r=n.activeItem,a=n.query,o=n.filteredItems,l={active:L(i.props.itemsEqual,O(r),e),disabled:F(e,t,i.props.itemDisabled),matchesPredicate:o.indexOf(e)>=0};return i.props.itemRenderer(e,{handleClick:function(t){return i.handleItemSelect(e,t)},handleFocus:function(){return i.setActiveItem(e)},index:t,modifiers:l,query:a,ref:function(e){e?i.itemRefs.set(t,e):i.itemRefs.delete(t)}})}return null},i.renderCreateItemMenuItem=function(){if(i.isCreateItemRendered(i.state.createNewItem)){var e=i.state,t=e.activeItem,n=e.query.trim(),r=I(t);return i.props.createNewItemRenderer(n,r,function(e){i.handleItem
1Create(n,e)})}return null},i.handleItemCreate=function(e,t){var n,r,a,o,l=null===(r=(n=i.props).createNewItemFromQuery)||void 0===r?void 0:r.call(n,e);if(null!=l){for(var s=Array.isArray(l)?l:[l],c=0;c<s.length;c++){var u=s[c];null===(o=(a=i.props).onItemSelect)||void 0===o||o.call(a,u,t)}i.maybeResetQuery()}},i.handleItemSelect=function(e,t){var n,r;i.setActiveItem(e),null===(r=(n=i.props).onItemSelect)||void 0===r||r.call(n,e,t),i.maybeResetQuery()},i.handlePaste=function(e){for(var t,n=i.props,r=n.createNewItemFromQuery,a=n.onItemsPaste,o=[],l=[],s=0;s<e.length;s++){var c=e[s],u=function(e,t){var n=t.items,r=t.itemPredicate;if(A.m(r))for(var i=0;i<n.length;i++){var a=n[i];if(r(e,a,i,!0))return a}}(c,i.props);if(void 0!==u)t=u,l.push(u);else if(i.canCreateItems()){var d=null==r?void 0:r(c);if(void 0!==d){var h=Array.isArray(d)?d:[d];l.push.apply(l,h)}}else o.push(c)}i.setQuery(o.join(", "),!1),void 0!==t&&i.setActiveItem(t),null==a||a(l)},i.handleKeyDown=function(e){var t,n;if(!e.nativeEvent.isComposing){var r=e.key,a=v.X(e,["ArrowUp"],["ArrowDown"]);if(void 0!==a){e.preventDefault();var o=i.getNextActiveItem(a);null!=o&&i.setActiveItem(o)}else"Enter"===r&&(i.isEnterKeyPressed=!0)}null===(n=(t=i.props).onKeyDown)||void 0===n||n.call(t,e)},i.handleKeyUp=function(e){var t=i.props.onKeyUp,n=i.state.activeItem;"Enter"===e.key&&i.isEnterKeyPressed&&(e.preventDefault(),null==n||I(n)?i.handleItemCreate(i.state.query,e):i.handleItemSelect(n,e),i.isEnterKeyPressed=!1),null==t||t(e)},i.handleInputQueryChange=function(e){var t,n,r=null==e?"":e.target.value;i.setQuery(r),null===(n=(t=i.props).onQueryChange)||void 0===n||n.call(t,r,e)};var a=t.query,o=void 0===a?"":a,s=null===(n=t.createNewItemFromQuery)||void 0===n?void 0:n.call(t,o),c=N(o,t);return i.state={activeItem:void 0!==t.activeItem?t.activeItem:null!==(r=t.initialActiveItem)&&void 0!==r?r:B(c,t.itemDisabled),createNewItem:s,filteredItems:c,query:o},i}return o(t,e),t.ofType=function(){return t},t.prototype.render=function(){var e=this.props,t=e.className,n=e.items,r=e.renderer,i=e.itemListRenderer,a=void 0===i?this.renderItemList:i,o=e.menuProps,c=this.state,u=(c.createNewItem,s(c,["createNewItem"]));return r(l(l({},u),{className:t,handleItemSelect:this.handleItemSelect,handleKeyDown:this.handleKeyDown,handleKeyUp:this.handleKeyUp,handlePaste:this.handlePaste,handleQueryChange:this.handleInputQueryChange,itemList:a(l(l({},u),{items:n,itemsParentRef:this.refHandlers.itemsParent,menuProps:o,renderCreateItem:this.renderCreateItemMenuItem,renderItem:this.renderItem}))}))},t.prototype.componentDidUpdate=function(e){var t=this;void 0!==this.props.activeItem&&this.props.activeItem!==this.state.activeItem&&(this.shouldCheckActiveItemInViewport=!0,this.setState({activeItem:this.props.activeItem})),null!=this.props.query&&this.props.query!==e.query?this.setQuery(this.props.query,this.props.resetOnQuery,this.props):P.ms(this.props,e,{include:["items","itemListPredicate","itemPredicate"]})||this.setQuery(this.state.query),this.shouldCheckActiveItemInViewport&&(this.requestAnimationFrame(function(){return t.scrollActiveItemIntoView()}),this.shouldCheckActiveItemInViewport=!1)},t.prototype.scrollActiveItemIntoView=function(){var e=!1!==this.props.scrollToActiveItem,t=!L(this.props.itemsEqual,O(this.expectedNextActiveItem),O(this.props.activeItem));if(this.expectedNextActiveItem=null,e||!t){var n=this.getActiveElement();if(null!=this.itemsParentRef&&null!=n){var r=n.offsetTop,i=n.offsetHeight,a=this.itemsParentRef,o=a.offsetTop,l=a.scrollTop,s=a.clientHeight,c=this.getItemsParentPadding(),u=c.paddingTop,d=r+i+c.paddingBottom-o,h=r-u-o;d>=l+s?this.itemsParentRef.scrollTop=d+i-s:h<=l&&(this.itemsParentRef.scrollTop=h-i)}}},t.prototype.setQuery=function(e,t,n){void 0===t&&(t=this.props.resetOnQuery),void 0===n&&(n=this.props);var r,i=n.createNewItemFromQuery;this.shouldCheckActiveItemInViewport=!0,e!==this.state.query&&(null===(r=n.onQueryChange)||void 0===r||r.call(n,e));var a=e.trim(),o=N(a,n),l=null!=i&&""!==a?i(a):void 0;this.setState({createNewItem:l,filteredItems:o,query:e});var s=this.getActiveIndex(o);(t||s<0||F(O(this.state.activeItem),s,n.itemDisabled))&&(this.isCreateItemRendered(l)&&this.isCreateItemFirst()?this.setActiveItem(_()):this.setActiveItem(B(o,n.itemDisabled)))},t.prototype.setActiveItem=function(e){var t,n,r,i;this.expectedNextActiveItem=e,void 0===this.props.activeItem&&(this.shouldCheckActiveItemInViewport=!0,this.setState({activeItem:e}
1)),I(e)?null===(n=(t=this.props).onActiveItemChange)||void 0===n||n.call(t,null,!0):null===(i=(r=this.props).onActiveItemChange)||void 0===i||i.call(r,e,!1)},t.prototype.getActiveElement=function(){var e,t=this.state.activeItem;if(null!=this.itemsParentRef){if(I(t)){var n=this.isCreateItemFirst()?0:this.state.filteredItems.length;return this.itemsParentRef.children.item(n)}var r=this.getActiveIndex();return null!==(e=this.itemRefs.get(r))&&void 0!==e?e:this.itemsParentRef.children.item(r)}},t.prototype.getActiveIndex=function(e){void 0===e&&(e=this.state.filteredItems);var t=this.state.activeItem;if(null==t||I(t))return -1;for(var n=0;n<e.length;++n)if(L(this.props.itemsEqual,e[n],t))return n;return -1},t.prototype.getItemsParentPadding=function(){var e=getComputedStyle(this.itemsParentRef),t=e.paddingTop;return{paddingBottom:z(e.paddingBottom),paddingTop:z(t)}},t.prototype.getNextActiveItem=function(e,t){return(void 0===t&&(t=this.getActiveIndex()),this.isCreateItemRendered(this.state.createNewItem)&&(0===t&&-1===e||t===this.state.filteredItems.length-1&&1===e))?_():B(this.state.filteredItems,this.props.itemDisabled,e,t)},t.prototype.isCreateItemRendered=function(e){return this.canCreateItems()&&""!==this.state.query&&!this.wouldCreatedItemMatchSomeExistingItem(e)},t.prototype.isCreateItemFirst=function(){return"first"===this.props.createNewItemPosition},t.prototype.canCreateItems=function(){return null!=this.props.createNewItemFromQuery&&null!=this.props.createNewItemRenderer},t.prototype.wouldCreatedItemMatchSomeExistingItem=function(e){var t=this;return this.state.filteredItems.some(function(n){return(Array.isArray(e)?e:[e]).some(function(e){return L(t.props.itemsEqual,n,e)})})},t.prototype.maybeResetQuery=function(){this.props.resetOnSelect&&this.setQuery("",!0)},t.displayName="".concat(w.g,".QueryList"),t.defaultProps={disabled:!1,resetOnQuery:!0},t}(R);function z(e){return null==e?0:parseInt(e.slice(0,-2),10)}function N(e,t){var n=t.items,r=t.itemPredicate,i=t.itemListPredicate;return A.m(i)?i(e,n):A.m(r)?n.filter(function(t,n){return r(e,t,n)}):n}function F(e,t,n){return null!=n&&null!=e&&(A.m(n)?n(e,t):!!e[n])}function B(e,t,n,r){if(void 0===n&&(n=1),void 0===r&&(r=e.length-1),0===e.length)return null;var i,a=r,o=e.length-1;do if(!F(e[a=(i=a+n)<0?o:i>o?0:i],a,t))return e[a];while(a!==r&&-1!==r);return null}var H=function(e){function t(){var t,n=e.apply(this,arguments)||this;return n.state={isOpen:!1},n.inputElement=null,n.queryList=null,n.handleInputRef=(0,h.Km)(n,"inputElement",null===(t=n.props.inputProps)||void 0===t?void 0:t.inputRef),n.handleQueryListRef=function(e){return n.queryList=e},n.listboxId=f.EL("listbox"),n.renderQueryList=function(e){var t=n.props,r=t.filterable,a=t.disabled,o=t.inputProps,s=t.placeholder,c=t.popoverContentProps,h=t.popoverProps,f=void 0===h?{}:h,g=t.popoverRef,v=d.createElement(p.B,l({"aria-autocomplete":"list",leftIcon:d.createElement(C.o,null),placeholder:void 0===s?"Filter...":s,rightElement:n.maybeRenderClearButton(e.query)},void 0===o?{}:o,{inputRef:n.handleInputRef,onChange:e.handleQueryChange,value:e.query})),b=e.handleKeyDown,y=e.handleKeyUp;return d.createElement(m.J,l({autoFocus:!1,enforceFocus:!1,isOpen:n.state.isOpen,disabled:void 0!==a&&a,placement:f.position||f.placement?void 0:"bottom-start"},f,{className:u()(e.className,f.className),content:d.createElement("div",l({},void 0===c?{}:c,{onKeyDown:b,onKeyUp:y}),void 0===r||r?v:void 0,e.itemList),onClosing:n.handlePopoverClosing,onInteraction:n.handlePopoverInteraction,onOpened:n.handlePopoverOpened,onOpening:n.handlePopoverOpening,popoverClassName:u()(S,f.popoverClassName),popupKind:i.LISTBOX,ref:g,renderTarget:n.getPopoverTargetRenderer(e,n.state.isOpen)}))},n.getPopoverTargetRenderer=function(e,t){return function(r){r.isOpen;var i,a=r.ref,o=s(r,["isOpen","ref"]),c=n.props,h=c.disabled,f=c.popoverProps,p=c.popoverTargetProps,m=e.handleKeyDown,v=e.handleKeyUp,b=(void 0===f?{}:f).targetTagName;return d.createElement(void 0===b?"div":b,l(l(l({"aria-controls":n.listboxId},p),o),{"aria-disabled":h,"aria-expanded":t,className:u()(o.className,null==p?void 0:p.className,((i={})[g.ur0]=n.props.fill,i)),onKeyDown:n.withPopoverTargetPropsHandler("keydown",t?m:n.handleTargetKeyDown),onKeyUp:n.withPopoverTargetPropsHandler("keyup",t?v:void 0),ref:a,role:"combobox"}),n.props.children)}},n.withPopoverTargetPropsHandler=function(e,t){switch(e){case"keydown":return function(e){var r,i;null==t||t(e),null===(i=null===(r=n.props.popoverTargetProps)||void 0===r?void 0:r.onKeyDown)||void 0===i||i.call(r,e)};case"keyup":return function(e){var r,i;null==t||t(e),null===(i=null===(r=n.props.popoverTargetProps)||void 0===r?void 0:r.onKeyUp)||void 0===i||i.call(r,e)}}},n.handleTargetKeyDown=function(e){"ArrowUp"===e.key||"ArrowDown"===e.key?(e.preventDefault(),n.setState({isOpen:!0})):v.gT(e)&&n.setState({isOpen:!0})},n.handleItemSelect=function(e,t){var r,i,a=null==t?void 0:t.target,o=null==a?void 0:a.closest(".".concat(g.URx)),l=null==o?void 0:o.matches(".".concat(g.oPt));n.setState({isOpen:!(null==l||l)}),null===(i=(r=n.props).onItemSelect)||void 0===i||i.call(r,e,t)},n.handlePopoverInteraction=function(e,t){var r,i;n.setState({isOpen:e}),null===(i=null===(r=n.props.popoverProps)||void 0===r?void 0:r.onInteraction)||void 0===i||i.call(r,e,t)},n.handlePopoverOpening=function(e){var t,r,i;n.previousFocusedElement=null!==(t=b.vY(n.inputElement))&&void 0!==t?t:void 0,n.props.resetOnClose&&n.resetQuery(),null===(i=null===(r=n.props.popoverProps)||void 0===r?void 0:r.onOpening)||void 0===i||i.call(r,e)},n.handlePopoverOpened=function(e){var t,r;null!=n.queryList&&n.queryList.scrollActiveItemIntoView(),n.requestAnimationFrame(function(){var e,t=n.props.inputProps;!1!==(void 0===t?{}:t).autoFocus&&(null===(e=n.inputElement)||void 0===e||e.focus())}),null===(r=null===(t=n.props.popoverProps)||void 0===t?void 0:t.onOpened)||void 0===r||r.call(t,e)},n.handlePopoverClosing=function(e){var t,r;n.requestAnimationFrame(function(){void 0!==n.previousFocusedElement&&(n.previousFocusedElement.focus(),n.previousFocusedElement=void 0)}),null===(r=null===(t=n.props.popoverProps)||void 0===t?void 0:t.onClosing)||void 0===r||r.call(t,e)},n.resetQuery=function(){return n.queryList&&n.queryList.setQuery("",!0)},n}return o(t,e),t.ofType=function(){return t},t.prototype.render=function(){var e=this.props,t=(e.filterable,e.inputProps,e.menuProps),n=(e.popoverProps,s(e,["filterable","inputProps","menuProps","popoverProps"]));return d.createElement(D,l({},n,{menuProps:l(l({"aria-label":"selectable options"},t),{id:this.listboxId}),onItemSelect:this.handleItemSelect,ref:this.handleQueryListRef,renderer:this.renderQueryList}))},t.prototype.componentDidUpdate=function(e,t){var n,r,i,a,o;(null===(n=e.inputProps)||void 0===n?void 0:n.inputRef)!==(null===(r=this.props.inputProps)||void 0===r?void 0:r.inputRef)&&((0,h.k$)(null===(i=e.inputProps)||void 0===i?void 0:i.inputRef,null),this.handleInputRef=(0,h.Km)(this,"inputElement",null===(a=this.props.inputProps)||void 0===a?void 0:a.inputRef),(0,h.k$)(null===(o=this.props.inputProps)||void 0===o?void 0:o.inputRef,this.inputElement)),this.state.isOpen&&!t.isOpen&&null!=this.queryList&&this.queryList.scrollActiveItemIntoView()},t.prototype.maybeRenderClearButton=function(e){return e.length>0?d.createElement(y.z,{"aria-label":"Clear filter query",icon:d.createElement(E.X,null),onClick:this.resetQuery,title:"Clear filter query",variant:"minimal"}):void 0},t.displayName="".concat(w.g,".Select"),t}(x.l)},17081:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{className:"icon",viewBox:"0 0 1024 1024",fill:"
1currentColor"},child:[{tag:"path",attr:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-32 736H663.9V602.2h104l15.6-120.7H663.9v-77.1c0-35 9.7-58.8 59.8-58.8h63.9v-108c-11.1-1.5-49-4.8-93.2-4.8-92.2 0-155.3 56.3-155.3 159.6v89H434.9v120.7h104.3V848H176V176h672v672z"}}],content:"\n"})(e)}},43070:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{className:"icon",viewBox:"0 0 1024 1024",fill:"currentColor"},child:[{tag:"path",attr:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136V232h752v560zM610.3 476h123.4c1.3 0 2.3-3.6 2.3-8v-48c0-4.4-1-8-2.3-8H610.3c-1.3 0-2.3 3.6-2.3 8v48c0 4.4 1 8 2.3 8zm4.8 144h185.7c3.9 0 7.1-3.6 7.1-8v-48c0-4.4-3.2-8-7.1-8H615.1c-3.9 0-7.1 3.6-7.1 8v48c0 4.4 3.2 8 7.1 8zM224 673h43.9c4.2 0 7.6-3.3 7.9-7.5 3.8-50.5 46-90.5 97.2-90.5s93.4 40 97.2 90.5c.3 4.2 3.7 7.5 7.9 7.5H522a8 8 0 0 0 8-8.4c-2.8-53.3-32-99.7-74.6-126.1a111.8 111.8 0 0 0 29.1-75.5c0-61.9-49.9-112-111.4-112s-111.4 50.1-111.4 112c0 29.1 11 55.5 29.1 75.5a158.09 158.09 0 0 0-74.6 126.1c-.4 4.6 3.2 8.4 7.8 8.4zm149-262c28.5 0 51.7 23.3 51.7 52s-23.2 52-51.7 52-51.7-23.3-51.7-52 23.2-52 51.7-52z"}}],content:"\n"})(e)}},76962:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{className:"icon",viewBox:"0 0 1024 1024",fill:"currentColor"},child:[{tag:"path",attr:{d:"M512 306.9c-113.5 0-205.1 91.6-205.1 205.1S398.5 717.1 512 717.1 717.1 625.5 717.1 512 625.5 306.9 512 306.9zm0 338.4c-73.4 0-133.3-59.9-133.3-133.3S438.6 378.7 512 378.7 645.3 438.6 645.3 512 585.4 645.3 512 645.3zm213.5-394.6c-26.5 0-47.9 21.4-47.9 47.9s21.4 47.9 47.9 47.9 47.9-21.3 47.9-47.9a47.84 47.84 0 0 0-47.9-47.9zM911.8 512c0-55.2.5-109.9-2.6-165-3.1-64-17.7-120.8-64.5-167.6-46.9-46.9-103.6-61.4-167.6-64.5-55.2-3.1-109.9-2.6-165-2.6-55.2 0-109.9-.5-165 2.6-64 3.1-120.8 17.7-167.6 64.5C132.6 226.3 118.1 283 115 347c-3.1 55.2-2.6 109.9-2.6 165s-.5 109.9 2.6 165c3.1 64 17.7 120.8 64.5 167.6 46.9 46.9 103.6 61.4 167.6 64.5 55.2 3.1 109.9 2.6 165 2.6 55.2 0 109.9.5 165-2.6 64-3.1 120.8-17.7 167.6-64.5 46.9-46.9 61.4-103.6 64.5-167.6 3.2-55.1 2.6-109.8 2.6-165zm-88 235.8c-7.3 18.2-16.1 31.8-30.2 45.8-14.1 14.1-27.6 22.9-45.8 30.2C695.2 844.7 570.3 840 512 840c-58.3 0-183.3 4.7-235.9-16.1-18.2-7.3-31.8-16.1-45.8-30.2-14.1-14.1-22.9-27.6-30.2-45.8C179.3 695.2 184 570.3 184 512c0-58.3-4.7-183.3 16.1-235.9 7.3-18.2 16.1-31.8 30.2-45.8s27.6-22.9 45.8-30.2C328.7 179.3 453.7 184 512 184s183.3-4.7 235.9 16.1c18.2 7.3 31.8 16.1 45.8 30.2 14.1 14.1 22.9 27.6 30.2 45.8C844.7 328.7 840 453.7 840 512c0 58.3 4.7 183.2-16.2 235.8z"}}],content:"\n"})(e)}},17917:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{className:"icon",viewBox:"0 0 1024 1024",fill:"currentColor"},child:[{tag:"path",attr:{d:"M847.7 112H176.3c-35.5 0-64.3 28.8-64.3 64.3v671.4c0 35.5 28.8 64.3 64.3 64.3h671.4c35.5 0 64.3-28.8 64.3-64.3V176.3c0-35.5-28.8-64.3-64.3-64.3zm0 736c-447.8-.1-671.7-.2-671.7-.3.1-447.8.2-671.7.3-671.7 447.8.1 671.7.2 671.7.3-.1 447.8-.2 671.7-.3 671.7zM230.6 411.9h118.7v381.8H230.6zm59.4-52.2c37.9 0 68.8-30.8 68.8-68.8a68.8 68.8 0 1 0-137.6 0c-.1 38 30.7 68.8 68.8 68.8zm252.3 245.1c0-49.8 9.5-98 71.2-98 60.8 0 61.7 56.9 61.7 101.2v185.7h118.6V584.3c0-102.8-22.2-181.9-142.3-181.9-57.7 0-96.4 31.7-112.3 61.7h-1.6v-52.2H423.7v381.8h118.6V604.8z"}}],content:"\n"})(e)}},36836:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{className:"icon",viewBox:"0 0 1024 1024",fill:"currentColor"},child:[{tag:"path",attr:{d:"M928 254.3c-30.6 13.2-63.9 22.7-98.2 26.4a170.1 170.1 0 0 0 75-94 336.64 336.64 0 0 1-108.2 41.2A170.1 170.1 0 0 0 672 174c-94.5 0-170.5 76.6-170.5 170.6 0 13.2 1.6 26.4 4.2 39.1-141.5-7.4-267.7-75-351.6-178.5a169.32 169.32 0 0 0-23.2 86.1c0 59.2 30.1 111.4 76 142.1a172 172 0 0 1-77.1-21.7v2.1c0 82.9 58.6 151.6 136.7 167.4a180.6 180.6 0 0 1-44.9 5.8c-11.1 0-21.6-1.1-32.2-2.6C211 652 273.9 701.1 348.8 702.7c-58.6 45.9-132 72.9-211.7 72.9-14.3 0-27.5-.5-41.2-2.1C171.5 822 261.2 850 357.8 850 671.4 850 843 590.2 843 364.7c0-7.4 0-14.8-.5-22.2 33.2-24.3 62.3-54.4 85.5-88.2z"}}],content:"\n"})(e)}},65534:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{className:"icon",viewBox:"0 0 1024 1024",fill:"
1currentColor"},child:[{tag:"path",attr:{d:"M912 302.3L784 376V224c0-35.3-28.7-64-64-64H128c-35.3 0-64 28.7-64 64v576c0 35.3 28.7 64 64 64h592c35.3 0 64-28.7 64-64V648l128 73.7c21.3 12.3 48-3.1 48-27.6V330c0-24.6-26.7-40-48-27.7zM712 792H136V232h576v560zm176-167l-104-59.8V458.9L888 399v226zM208 360h112c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H208c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}}],content:"\n"})(e)}},48648:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{className:"icon",viewBox:"0 0 1024 1024",fill:"currentColor"},child:[{tag:"path",attr:{d:"M960 509.2c0-2.2 0-4.7-.1-7.6-.1-8.1-.3-17.2-.5-26.9-.8-27.9-2.2-55.7-4.4-81.9-3-36.1-7.4-66.2-13.4-88.8a139.52 139.52 0 0 0-98.3-98.5c-28.3-7.6-83.7-12.3-161.7-15.2-37.1-1.4-76.8-2.3-116.5-2.8-13.9-.2-26.8-.3-38.4-.4h-29.4c-11.6.1-24.5.2-38.4.4-39.7.5-79.4 1.4-116.5 2.8-78 3-133.5 7.7-161.7 15.2A139.35 139.35 0 0 0 82.4 304C76.3 326.6 72 356.7 69 392.8c-2.2 26.2-3.6 54-4.4 81.9-.3 9.7-.4 18.8-.5 26.9 0 2.9-.1 5.4-.1 7.6v5.6c0 2.2 0 4.7.1 7.6.1 8.1.3 17.2.5 26.9.8 27.9 2.2 55.7 4.4 81.9 3 36.1 7.4 66.2 13.4 88.8 12.8 47.9 50.4 85.7 98.3 98.5 28.2 7.6 83.7 12.3 161.7 15.2 37.1 1.4 76.8 2.3 116.5 2.8 13.9.2 26.8.3 38.4.4h29.4c11.6-.1 24.5-.2 38.4-.4 39.7-.5 79.4-1.4 116.5-2.8 78-3 133.5-7.7 161.7-15.2 47.9-12.8 85.5-50.5 98.3-98.5 6.1-22.6 10.4-52.7 13.4-88.8 2.2-26.2 3.6-54 4.4-81.9.3-9.7.4-18.8.5-26.9 0-2.9.1-5.4.1-7.6v-5.6zm-72 5.2c0 2.1 0 4.4-.1 7.1-.1 7.8-.3 16.4-.5 25.7-.7 26.6-2.1 53.2-4.2 77.9-2.7 32.2-6.5 58.6-11.2 76.3-6.2 23.1-24.4 41.4-47.4 47.5-21 5.6-73.9 10.1-145.8 12.8-36.4 1.4-75.6 2.3-114.7 2.8-13.7.2-26.4.3-37.8.3h-28.6l-37.8-.3c-39.1-.5-78.2-1.4-114.7-2.8-71.9-2.8-124.9-7.2-145.8-12.8-23-6.2-41.2-24.4-47.4-47.5-4.7-17.7-8.5-44.1-11.2-76.3-2.1-24.7-3.4-51.3-4.2-77.9-.3-9.3-.4-18-.5-25.7 0-2.7-.1-5.1-.1-7.1v-4.8c0-2.1 0-4.4.1-7.1.1-7.8.3-16.4.5-25.7.7-26.6 2.1-53.2 4.2-77.9 2.7-32.2 6.5-58.6 11.2-76.3 6.2-23.1 24.4-41.4 47.4-47.5 21-5.6 73.9-10.1 145.8-12.8 36.4-1.4 75.6-2.3 114.7-2.8 13.7-.2 26.4-.3 37.8-.3h28.6l37.8.3c39.1.5 78.2 1.4 114.7 2.8 71.9 2.8 124.9 7.2 145.8 12.8 23 6.2 41.2 24.4 47.4 47.5 4.7 17.7 8.5 44.1 11.2 76.3 2.1 24.7 3.4 51.3 4.2 77.9.3 9.3.4 18 .5 25.7 0 2.7.1 5.1.1 7.1v4.8zM423 646l232-135-232-133z"}}],content:"\n"})(e)}},31137:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{d:"M20.3847 2.87868C19.2132 1.70711 17.3137 1.70711 16.1421 2.87868L14.0202 5.00052L13.313 4.29332C12.9225 3.9028 12.2894 3.9028 11.8988 4.29332C11.5083 4.68385 11.5083 5.31701 11.8988 5.70754L17.5557 11.3644C17.9462 11.7549 18.5794 11.7549 18.9699 11.3644C19.3604 10.9739 19.3604 10.3407 18.9699 9.95018L18.2629 9.24316L20.3847 7.12132C21.5563 5.94975 21.5563 4.05025 20.3847 2.87868Z",fill:"currentColor"}},{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.9297 7.09116L4.1515 14.8693C3.22786 15.793 3.03239 17.169 3.5651 18.2842L1.99994 19.8493L3.41415 21.2635L4.97931 19.6984C6.09444 20.2311 7.4705 20.0356 8.39414 19.112L16.1723 11.3338L11.9297 7.09116ZM13.3439 11.3338L11.9297 9.91959L5.56571 16.2835C5.17518 16.6741 5.17518 17.3072 5.56571 17.6978C5.95623 18.0883 6.5894 18.0883 6.97992 17.6978L13.3439 11.3338Z",fill:"currentColor"}}],content:"\n"})(e)}},74723:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{viewBox:"0 0 512 512",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,256A128,128,0,1,0,256,384,128,128,0,0,0,128,256Zm379-54.86L400.07,18.29a37.26,37.26,0,0,0-64.14,0L229,201.14C214.76,225.52,232.58,256,261.09,256H474.91C503.42,256,521.24,225.52,507,201.14ZM480,288H320a32,32,0,0,0-32,32V480a32,32,0,0,0,32,32H480a32,32,0,0,0,32-32V320A32,32,0,0,0,480,288Z"}}]})(e)}},34008:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 100 100",enableBackground:"new 0 0 100 100",fill:"currentColor"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M86.45,23.27h-3.475V90.18c0,0.835-0.677,1.513-1.513,1.513H31.987v3.475c0,0.836,0.677,1.513,1.513,1.513l0.001,0v0h52.95\n c0.836,0,1.513-0.677,1.513-1.513V24.782C87.963,23.946,87.286,23.27,86.45,23.27z"}},{tag:"path",attr:{d:"M77.988,85.193V14.807c0-0.836-0.677-1.513-1.513-1.513h-3.475v66.911c0,0.836-0.677,1.513-1.513,1.513H22.011v3.475\n c0,0.836,0.677,1.513,1.513,1.513c0,0,0,0,0,0h52.951C77.311,86.706,77.988,86.029,77.988,85.193z"}},{tag:"path",attr:{d:"M68.013,75.218V4.832c0-0.836-0.677-1.513-1.513-1.513H13.55c-0.836,0-1.513,0.677-1.513,1.513v70.386\n c0,0.836,0.677,1.513,1.513,1.513H66.5C67.336,76.731,68.013,76.054,68.013,75.218z"}}],content:"\n"}],content:"\n"})(e)}},61389:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{viewBox:"0 0 512 512",fill:"
1currentColor"},child:[{tag:"path",attr:{d:"M430.1 347.9c-6.6-6.1-16.3-7.6-24.6-9-11.5-1.9-15.9-4-22.6-10-14.3-12.7-14.3-31.1 0-43.8l30.3-26.9c46.4-41 46.4-108.2 0-149.2-34.2-30.1-80.1-45-127.8-45-55.7 0-113.9 20.3-158.8 60.1-83.5 73.8-83.5 194.7 0 268.5 41.5 36.7 97.5 55 152.9 55.4h1.7c55.4 0 110-17.9 148.8-52.4 14.4-12.7 12-36.6.1-47.7zM120 216c0-17.7 14.3-32 32-32s32 14.3 32 32-14.3 32-32 32-32-14.3-32-32zm40 126c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm64-161c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm72 219c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48zm24-208c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]})(e)}},60602:function(e,t,n){"use strict";n.d(t,{w_:function(){return s}});var r=n(7653),i={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},a=r.createContext&&r.createContext(i),o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},l=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function s(e){return function(t){return r.createElement(c,o({attr:o({},e.attr)},t,{hasStrokes:function e(t){for(var n in t)if("_"!==n[0]){if("stroke"===n)return!0;if("object"==typeof t[n]){var r=e(t[n]);if(r)return r}else if("content"===n&&"style"===t.tag&&t[n].includes("stroke:"))return!0}return!1}(e)}),function e(t){return t&&t.map(function(t,n){return r.createElement(t.tag,o({key:n},t.attr),e(t.child))})}(e.child))}}function c(e){var t=function(t){var n,i=e.size||t.size||"1em";t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className);var a=e.attr,s=e.fill,c=e.title,u=e.hasStrokes,d=l(e,["attr","fill","title","hasStrokes"]);return r.createElement("svg",o({stroke:"currentColor",fill:s},u?null:{strokeWidth:0},t.attr,a,d,{className:n,style:o(o({color:e.color||t.color},t.style),e.style),height:i,width:i,xmlns:"http://www.w3.org/2000/svg"}),c&&r.createElement("title",null,c),e.children)};return void 0!==a?r.createElement(a.Consumer,null,function(e){return t(e)}):t(i)}},64852:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M9 10v5h2V4h2v11h2V4h2V2H9C6.79 2 5 3.79 5 6s1.79 4 4 4zm12 8l-4-4v3H5v2h12v3l4-4z"}}]})(e)}},82642:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M10 10v5h2V4h2v11h2V4h2V2h-8C7.79 2 6 3.79 6 6s1.79 4 4 4zm-2 7v-3l-4 4 4 4v-3h12v-2H8z"}}]})(e)}},75501:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17.66 8L12 2.35 6.34 8C4.78 9.56 4 11.64 4 13.64s.78 4.11 2.34 5.67 3.61 2.35 5.66 2.35 4.1-.79 5.66-2.35S20 15.64 20 13.64 19.22 9.56 17.66 8zM6 14c.01-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 17.99 12 18 14H6z"}}]})(e)}},8378:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{version:"1.1",id:"mdi-format-letter-case",viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20.06,18C20,17.83 19.91,17.54 19.86,17.11C19.19,17.81 18.38,18.16 17.45,18.16C16.62,18.16 15.93,17.92 15.4,17.45C14.87,17 14.6,16.39 14.6,15.66C14.6,14.78 14.93,14.1 15.6,13.61C16.27,13.12 17.21,12.88 18.43,12.88H19.83V12.24C19.83,11.75 19.68,11.36 19.38,11.07C19.08,10.78 18.63,10.64 18.05,10.64C17.53,10.64 17.1,10.76 16.75,11C16.4,11.25 16.23,11.54 16.23,11.89H14.77C14.77,11.46 14.92,11.05 15.22,10.65C15.5,10.25 15.93,9.94 16.44,9.71C16.95,9.5 17.5,9.36 18.13,9.36C19.11,9.36 19.87,9.6 20.42,10.09C20.97,10.58 21.26,11.25 21.28,12.11V16C21.28,16.8 21.38,17.42 21.58,17.88V18H20.06M17.66,16.88C18.11,16.88 18.54,16.77 18.95,16.56C19.35,16.35 19.65,16.07 19.83,15.73V14.16H18.7C16.93,14.16 16.04,14.63 16.04,15.57C16.04,16 16.
119,16.3 16.5,16.53C16.8,16.76 17.18,16.88 17.66,16.88M5.46,13.71H9.53L7.5,8.29L5.46,13.71M6.64,6H8.36L13.07,18H11.14L10.17,15.43H4.82L3.86,18H1.93L6.64,6Z"}}]})(e)}},73637:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{version:"1.1",id:"mdi-format-line-spacing",viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M10,13H22V11H10M10,19H22V17H10M10,7H22V5H10M6,7H8.5L5,3.5L1.5,7H4V17H1.5L5,20.5L8.5,17H6V7Z"}}]})(e)}},34136:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{version:"1.1",id:"mdi-format-list-bulleted",viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z"}}]})(e)}},92256:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{version:"1.1",id:"mdi-format-list-numbered",viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M7,13V11H21V13H7M7,19V17H21V19H7M7,7V5H21V7H7M3,8V5H2V4H4V8H3M2,17V16H5V20H2V19H4V18.5H3V17.5H4V17H2M4.25,10A0.75,0.75 0 0,1 5,10.75C5,10.95 4.92,11.14 4.79,11.27L3.12,13H5V14H2V13.08L4,11H2V10H4.25Z"}}]})(e)}},93169:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{version:"1.1",id:"mdi-format-vertical-align-bottom",viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M16,13H13V3H11V13H8L12,17L16,13M4,19V21H20V19H4Z"}}]})(e)}},36700:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{version:"1.1",id:"mdi-format-vertical-align-center",viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M8,19H11V23H13V19H16L12,15L8,19M16,5H13V1H11V5H8L12,9L16,5M4,11V13H20V11H4Z"}}]})(e)}},23260:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{version:"1.1",id:"mdi-format-vertical-align-top",viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M8,11H11V21H13V11H16L12,7L8,11M4,3V5H20V3H4Z"}}]})(e)}},81530:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4 18h12V6h-4V2H4v16zm-2 1V0h12l4 4v16H2v-1z"}}]})(e)}},83510:function(e,t,n){var r=n(60602).w_;e.exports=function(e){return r({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor"},child:[{tag:"path",attr:{d:"M0 0h20v5H0V0zm0 7h20v4H0V7zm0 6h20v3H0v-3zm0 5h20v2H0v-2z"}}]})(e)}},26843:function(e){var t;t=function(){return(function e(t,n,r){function i(o,l){if(!n[o]){if(!t[o]){if(a)return a(o,!0);var s=Error("Cannot find module '"+o+"'");throw s.code="MODULE_NOT_FOUND",s}var c=n[o]={exports:{}};t[o][0].call(c.exports,function(e){return i(t[o][1][e]||e)},c,c.exports,e,t,n,r)}return n[o].exports}for(var a=void 0,o=0;o<r.length;o++)i(r[o]);return i})({1:[function(e,t,n){"use strict";function r(e,t,n,i){this.message=e,this.expected=t,this.found=n,this.location=i,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)}(function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n})(r,Error),r.buildMessage=function(e,t){var n={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var t,n="";for(t=0;t<e.parts.length;t++)n+=e.parts[t]instanceof Array?a(e.parts[t][0])+"-"+a(e.parts[t][1]):a(e.parts[t]);return"["+(e.inverted?"^":"")+n+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function a(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}return"Expected "+function(e){var t,r,i,a=Array(e.length);for(r=0;r<e.length;r++)a[r]=n[(t=e[r]).type](t);if(a.sort(),a.length>0){for(r=1,i=1;r<a.length;r++)a[r-1]!==a[r]&&(a[i]=a[r],i++);a.length=i}switch(a.length){case 1:return a[0];
1case 2:return a[0]+" or "+a[1];default:return a.slice(0,-1).join(", ")+", or "+a[a.length-1]}}(e)+" but "+(t?'"'+i(t)+'"':"end of input")+" found."},t.exports={SyntaxError:r,parse:function(t,n){n=void 0!==n?n:{};var i,a,o,l,s,c,u,d,h={},f={start:z},p=z,m=_(",",!1),g="url(",v=_("url(",!1),b=_(")",!1),y=function(e){return e},w="format(",x=_("format(",!1),C="local(",E=_("local(",!1),k=/^[^)]/,S=I([")"],!0,!1),T=/^[ \t\r\n\f]/,P=I([" "," ","\r","\n","\f"],!1,!1),M=0,R=[{line:1,column:1}],A=0,L=[];if("startRule"in n){if(!(n.startRule in f))throw Error("Can't start parsing from rule \""+n.startRule+'".');p=f[n.startRule]}function _(e,t){return{type:"literal",text:e,ignoreCase:t}}function I(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function O(e){var n,r=R[e];if(r)return r;for(n=e-1;!R[n];)n--;for(r={line:(r=R[n]).line,column:r.column};n<e;)10===t.charCodeAt(n)?(r.line++,r.column=1):r.column++,n++;return R[e]=r,r}function D(e){M<A||(M>A&&(A=M,L=[]),L.push(e))}function z(){var e,n;return(e=function e(){var n,r,i,a,o,l;if(n=M,(r=N())!==h){for(i=[],a=H();a!==h;)i.push(a),a=H();if(i!==h){if(44===t.charCodeAt(M)?(a=",",M++):(a=h,D(m)),a!==h){for(o=[],l=H();l!==h;)o.push(l),l=H();o!==h&&(l=e())!==h?n=r=[r].concat(l):(M=n,n=h)}else M=n,n=h}else M=n,n=h}else M=n,n=h;return n===h&&(n=M,(r=N())!==h&&(r=[r]),n=r),n}())===h&&(e=M,(n="")!==h&&(n=[]),e=n),e}function N(){var e,n,r,i,a;return(e=function(){var e,n,r,i,a,o,l,s;if(e=M,(n=F())!==h){if(r=[],(i=H())!==h)for(;i!==h;)r.push(i),i=H();else r=h;r!==h&&(a=M,t.substr(M,7)===w?(o=w,M+=7):(o=h,D(x)),o!==h&&(l=B())!==h?(41===t.charCodeAt(M)?(s=")",M++):(s=h,D(b)),s!==h?a=o=y(l):(M=a,a=h)):(M=a,a=h),(i=a)!==h)?e=n={url:n,format:i}:(M=e,e=h)}else M=e,e=h;return e===h&&(e=M,(n=F())!==h&&(n={url:n}),e=n),e}())===h&&((n=M,t.substr(M,6)===C?(r=C,M+=6):(r=h,D(E)),r!==h&&(i=B())!==h&&(41===t.charCodeAt(M)?(a=")",M++):(a=h,D(b)),a!==h))?n=r={local:i}:(M=n,n=h),e=n),e}function F(){var e,n,r,i;return e=M,t.substr(M,4)===g?(n=g,M+=4):(n=h,D(v)),n!==h&&(r=B())!==h?(41===t.charCodeAt(M)?(i=")",M++):(i=h,D(b)),i!==h?e=n=y(r):(M=e,e=h)):(M=e,e=h),e}function B(){var e,n,r;if(e=[],k.test(t.charAt(M))?(n=t.charAt(M),M++):(n=h,D(S)),n!==h)for(;n!==h;)e.push(n),k.test(t.charAt(M))?(n=t.charAt(M),M++):(n=h,D(S));else e=h;return e!==h&&(r=e,e=V.extractValue(r.join(""))),e}function H(){var e;return T.test(t.charAt(M))?(e=t.charAt(M),M++):(e=h,D(P)),e}var V=e("../util");if((d=p())!==h&&M===t.length)return d;throw d!==h&&M<t.length&&D({type:"end"}),s=L,c=A<t.length?t.charAt(A):null,i=A,a=A<t.length?A+1:A,o=O(i),l=O(a),u={start:{offset:i,line:o.line,column:o.column},end:{offset:a,line:l.line,column:l.column}},new r(r.buildMessage(s,c),s,c,u)}}},{"../util":3}],2:[function(e,t,n){var r=e("./grammar");n.SyntaxError=function(e,t){this.message=e,this.offset=t},n.parse=function(e){try{return r.parse(e)}catch(e){throw new n.SyntaxError(e.message,e.offset)}},n.serialize=function(e){return e.map(function(e){var t;return e.url?(t='url("'+e.url+'")',e.format&&(t+=' format("'+e.format+'")')):t='local("'+e.local+'")',t}).join(", ")}},{"./grammar":1}],3:[function(e,t,n){var r=function(e){var t=/^"(.*)"$/,n=/^'(.*)'$/;return t.test(e)?e.replace(t,"$1"):n.test(e)?e.replace(n,"$1"):e};n.extractValue=function(e){return r(e.replace(/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/,"$1"))}},{}]},{},[2])(2)},e.exports=t()},58825:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deinterlace=void 0,t.deinterlace=function(e,t){for(var n=Array(e.length),r=e.length/t,i=[0,4,2,1],a=[8,8,4,2],o=0,l=0;l<4;l++)for(var s=i[l];s<r;s+=a[l])(function(r,i){var a=e.slice(i*t,(i+1)*t);n.splice.apply(n,[r*t,t].concat(a))})(s,o),o++;return n}},73014:function(e,t,n){"use strict";t.zw=t.vq=void 0;var r,i=(r=n(39735))&&r.__esModule?r:{default:r},a=n(75911),o=n(10290),l=n(58825),s=n(57350);t.vq=function(e){var t=new Uint8Array(e);return(0,a.parse)((0,o.buildStream)(t),i.default)};var c=function(e){for(var t=e.pixels.length,n=new Uint8ClampedArray(4*t),r=0;r<t;r++){var i=4*r,a=e.pixels[r],o=e.colorTable[a]||[0,0,0];n[i]=o[0],n[i+1]=o[1],n[i+2]=o[2],n[i+3]=a!==e.transparentIndex?255:0}return n},u=function(e,t,n){if(!e.image){console.warn("gif frame does not have associated image.");return}var r=e.image,i=r.descriptor.width*r.descriptor.height,a=(0,s.lzw)(r.data.minCodeSize,r.data.blocks,i);r.descriptor.lct.interlaced&&(a=(0,l.deinterlace)(a,r.descriptor.width));
1var o={pixels:a,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return r.descriptor.lct&&r.descriptor.lct.exists?o.colorTable=r.lct:o.colorTable=t,e.gce&&(o.delay=10*(e.gce.delay||10),o.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(o.transparentIndex=e.gce.transparentColorIndex)),n&&(o.patch=c(o)),o};t.zw=function(e,t){return e.frames.filter(function(e){return e.image}).map(function(n){return u(n,e.gct,t)})}},57350:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lzw=void 0,t.lzw=function(e,t,n){var r,i,a,o,l,s,c,u,d,h,f,p,m,g,v,b=Array(n),y=Array(4096),w=Array(4096),x=Array(4097);for(u=0,l=(i=1<<e)+1,r=i+2,c=-1,a=(1<<(o=e+1))-1;u<i;u++)y[u]=0,w[u]=u;for(d=0,h=f=p=m=g=v=0;d<n;){if(0===m){if(f<o){h+=t[v]<<f,f+=8,v++;continue}if(u=h&a,h>>=o,f-=o,u>r||u==l)break;if(u==i){a=(1<<(o=e+1))-1,r=i+2,c=-1;continue}if(-1==c){x[m++]=w[u],c=u,p=u;continue}for(s=u,u==r&&(x[m++]=p,u=c);u>i;)x[m++]=w[u],u=y[u];p=255&w[u],x[m++]=p,r<4096&&(y[r]=c,w[r]=p,(++r&a)==0&&r<4096&&(o++,a+=r)),c=s}m--,b[g++]=x[m],d++}for(d=g;d<n;d++)b[d]=0;return b}},6863:function(e,t){var n,r=r||{};r.stringify=(n={"visit_linear-gradient":function(e){return n.visit_gradient(e)},"visit_repeating-linear-gradient":function(e){return n.visit_gradient(e)},"visit_radial-gradient":function(e){return n.visit_gradient(e)},"visit_repeating-radial-gradient":function(e){return n.visit_gradient(e)},visit_gradient:function(e){var t=n.visit(e.orientation);return t&&(t+=", "),e.type+"("+t+n.visit(e.colorStops)+")"},visit_shape:function(e){var t=e.value,r=n.visit(e.at),i=n.visit(e.style);return i&&(t+=" "+i),r&&(t+=" at "+r),t},"visit_default-radial":function(e){var t="",r=n.visit(e.at);return r&&(t+=r),t},"visit_extent-keyword":function(e){var t=e.value,r=n.visit(e.at);return r&&(t+=" at "+r),t},"visit_position-keyword":function(e){return e.value},visit_position:function(e){return n.visit(e.value.x)+" "+n.visit(e.value.y)},"visit_%":function(e){return e.value+"%"},visit_em:function(e){return e.value+"em"},visit_px:function(e){return e.value+"px"},visit_calc:function(e){return"calc("+e.value+")"},visit_literal:function(e){return n.visit_color(e.value,e)},visit_hex:function(e){return n.visit_color("#"+e.value,e)},visit_rgb:function(e){return n.visit_color("rgb("+e.value.join(", ")+")",e)},visit_rgba:function(e){return n.visit_color("rgba("+e.value.join(", ")+")",e)},visit_hsl:function(e){return n.visit_color("hsl("+e.value[0]+", "+e.value[1]+"%, "+e.value[2]+"%)",e)},visit_hsla:function(e){return n.visit_color("hsla("+e.value[0]+", "+e.value[1]+"%, "+e.value[2]+"%, "+e.value[3]+")",e)},visit_var:function(e){return n.visit_color("var("+e.value+")",e)},visit_color:function(e,t){var r=e,i=n.visit(t.length);return i&&(r+=" "+i),r},visit_angular:function(e){return e.value+"deg"},visit_directional:function(e){return"to "+e.value},visit_array:function(e){var t="",r=e.length;return e.forEach(function(e,i){t+=n.visit(e),i<r-1&&(t+=", ")}),t},visit_object:function(e){return e.width&&e.height?n.visit(e.width)+" "+n.visit(e.height):""},visit:function(e){if(!e)return"";if(e instanceof Array)return n.visit_array(e);if("object"==typeof e&&!e.type)return n.visit_object(e);
1if(e.type){var t=n["visit_"+e.type];if(t)return t(e);throw Error("Missing visitor visit_"+e.type)}throw Error("Invalid node.")}},function(e){return n.visit(e)});var r=r||{};r.parse=function(){var e={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,radianValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))rad/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,varColor:/^var/i,calcValue:/^calc/i,variableName:/^(--[a-zA-Z0-9-,\s\#]+)/,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,hslColor:/^hsl/i,hslaColor:/^hsla/i},t="";function n(e){var n=Error(t+": "+e);throw n.source=t,n}function r(){return i("linear-gradient",e.linearGradient,o)||i("repeating-linear-gradient",e.repeatingLinearGradient,o)||i("radial-gradient",e.radialGradient,l)||i("repeating-radial-gradient",e.repeatingRadialGradient,l)}function i(t,r,i){return a(r,function(r){var a=i();return a&&!b(e.comma)&&n("Missing comma before color stops"),{type:t,orientation:a,colorStops:h(f)}})}function a(t,r){var i=b(t);if(i){b(e.startCall)||n("Missing (");var a=r(i);return b(e.endCall)||n("Missing )"),a}}function o(){var t=v("directional",e.sideOrCorner,1);if(t)return t;var n=v("position-keyword",e.positionKeywords,1);return n?{type:"directional",value:n.value}:v("angular",e.angleValue,1)||v("angular",e.radianValue,1)}function l(){var n,r,i=s();return i&&((n=[]).push(i),r=t,b(e.comma)&&((i=s())?n.push(i):t=r)),n}function s(){var e,t,n=((e=v("shape",/^(circle)/i,0))&&(e.style=g()||c()),e||((t=v("shape",/^(ellipse)/i,0))&&(t.style=d()||m()||c()),t));if(n)n.at=u();else{var r=c();if(r){n=r;var i=u();i&&(n.at=i)}else{var a=u();if(a)n={type:"default-radial",at:a};else{var o=d();o&&(n={type:"default-radial",at:o})}}}return n}function c(){return v("extent-keyword",e.extentKeywords,1)}function u(){if(v("position",/^at/,0)){var e=d();return e||n("Missing positioning value"),e}}function d(){var e={x:m(),y:m()};if(e.x||e.y)return{type:"position",value:e}}function h(t){var r=t(),i=[];if(r)for(i.push(r);b(e.comma);)(r=t())?i.push(r):n("One extra comma");return i}function f(){var t=v("hex",e.hexColor,1)||a(e.hslaColor,function(){var t=p();b(e.comma);var r=b(e.percentageValue),i=r?r[1]:null;b(e.comma);var a=(r=b(e.percentageValue))?r[1]:null;b(e.comma);var o=p();return i&&a||n("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[t,i,a,o]}})||a(e.hslColor,function(){b(e.percentageValue)&&n("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");var t=p();b(e.comma);var r=b(e.percentageValue),i=r?r[1]:null;b(e.comma);var a=(r=b(e.percentageValue))?r[1]:null;return i&&a||n("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[t,i,a]}})||a(e.rgbaColor,function(){return{type:"rgba",value:h(p)}})||a(e.rgbColor,function(){return{type:"rgb",value:h(p)}})||a(e.varColor,function(){return{type:"var",value:b(e.variableName)[1]}})||v("literal",e.literalColor,0);return t||n("Expected color definition"),t.length=m(),t}function p(){return b(e.number)[1]}function m(){return v("%",e.percentageValue,1)||v("position-keyword",e.positionKeywords,1)||a(e.calcValue,function(){for(var e=1,r=0;e>0&&r<t.length;){var i=t.charAt(r);"("===i?e++:")"===i&&e--,r++}e>0&&n("Missing closing parenthesis in calc() expression");var a=t.substring(0,r-1);return y(r-1),{type:"calc",value:a}})||g()}function g(){return v("px",e.pixelValue,1)||v("em",e.emValue,1)}function v(e,t,n){var r=b(t);if(r)return{type:e,value:r[n]}}function b(e){var n,r;return(r=/^[\n\r\t\s]+/.exec(t))&&y(r[0].length),(n=e.exec(t))&&y(n[0].length),n}function y(e){t=t.substr(e)}return function(e){var i;return(t=e.toString().trim()).endsWith(";
1")&&(t=t.slice(0,-1)),i=h(r),t.length>0&&n("Invalid input not EOF"),i}}(),t.parse=r.parse,t.stringify=r.stringify},63945:function(e,t,n){"use strict";var r=n(47380);t.extractCssUrl=function(e){var t,n=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/;if(!n.test(e))throw Error("Invalid url");return t=n.exec(e)[1],r.unquoteString(t.replace(/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/,"$1"))};var i=function(e){var t,n="(url\\(\\s*(?:\"[^\"]*\"|'[^']*'|[^\\(]+)\\s*\\)|[^,\\s]+)",r="(?:\\s*"+n+")+",i=RegExp(r,"g"),a=[];if(e.match(RegExp("^\\s*("+r+")(?:\\s*,\\s*("+r+"))*\\s*$"))){for(t=i.exec(e);t;)a.push(function(e){var t,r=RegExp(n,"g"),i=[];for(t=r.exec(e);t;)i.push(t[1]),t=r.exec(e);return i}(t[0])),t=i.exec(e);return a}return[]},a=function(e){var n;for(n=0;n<e.length;n++)try{return{url:t.extractCssUrl(e[n]),idx:n}}catch(e){}};t.parse=function(e){return i(e).map(function(e){var t=a(e);return t?{preUrl:e.slice(0,t.idx),url:t.url,postUrl:e.slice(t.idx+1)}:{preUrl:e}})},t.serialize=function(e){return e.map(function(e){var t=[].concat(e.preUrl);return e.url&&t.push('url("'+e.url+'")'),e.postUrl&&(t=t.concat(e.postUrl)),t.join(" ")}).join(", ")}},47380:function(e,t){"use strict";t.unquoteString=function(e){var t=/^"(.*)"$/,n=/^'(.*)'$/;return t.test(e)?e.replace(t,"$1"):n.test(e)?e.replace(n,"$1"):e},t.rulesForCssText=function(e,t){var n,r=document.implementation.createHTMLDocument(""),i=document.createElement("style");return i.textContent=e,t&&t.nonce&&(i.nonce=t.nonce),r.body.appendChild(i),n=i.sheet.cssRules,Array.prototype.slice.call(n)},t.cssRulesToText=function(e){return e.reduce(function(e,t){return e+t.cssText},"")},t.exchangeRule=function(e,n,r,i){var a=e.indexOf(n);e[a]=t.rulesForCssText(r,i)[0]},t.changeFontFaceRuleSrc=function(e,n,r,i){var a="@font-face { font-family: "+n.style.getPropertyValue("font-family")+"; ";n.style.getPropertyValue("font-style")&&(a+="font-style: "+n.style.getPropertyValue("font-style")+"; "),n.style.getPropertyValue("font-weight")&&(a+="font-weight: "+n.style.getPropertyValue("font-weight")+"; "),n.style.getPropertyValue("unicode-range")&&(a+="unicode-range: "+n.style.getPropertyValue("unicode-range")+"; "),a+="src: "+r+"}",t.exchangeRule(e,n,a,i)}},66307:function(e,t,n){"use strict";var r=n(17824),i=n(22782),a=n(61598),o=n(83507),l=n(47380),s=function(e){return e.map(function(t,n){if(n===e.length-1){var i;t={baseUrl:(i=t.baseUrl,r.joinUrl(i,"."))}}return JSON.stringify(t)})},c=function(e,t){return!1!==t.cache&&"none"!==t.cache&&t.cacheBucket?r.memoize(e,s,t.cacheBucket):e},u=function(e,t,n){var r=l.rulesForCssText(e,n);return o.loadCSSImportsForRules(r,t,n).then(function(t){return o.loadAndInlineCSSResourcesForRules(r,n).then(function(n){var i=t.errors.concat(n.errors),a=t.hasChanges||n.hasChanges;return a&&(e=l.cssRulesToText(r)),{hasChanges:a,content:e,errors:i}})})},d=function(e,t,n){var i=e.textContent;return c(u,t)(i,n,t).then(function(t){return t.hasChanges&&(e.childNodes[0].nodeValue=t.content),r.cloneArray(t.errors)})},h=function(e){var t=e.getElementsByTagName("style");return Array.prototype.filter.call(t,function(e){return!e.attributes.type||"text/css"===e.attributes.type.value})};t.loadAndInlineStyles=function(e,t){var n,i=h(e),a=[],o=[];return(n=r.clone(t)).baseUrl=n.baseUrl||r.getDocumentBaseUrl(e),Promise.all(i.map(function(e){return d(e,n,o).then(function(e){a=a.concat(e)})})).then(function(){return a})};var f=function(e,t){var n,r=e.parentNode;(t=t.trim())&&((n=e.ownerDocument.createElement("style")).type="text/css",n.appendChild(e.ownerDocument.createTextNode(t)),r.insertBefore(n,e)),r.removeChild(e)},p=function(e,t){return r.ajax(e,t).then(function(e){var n=l.rulesForCssText(e,t);return{content:e,cssRules:n}}).then(function(n){var r=o.adjustPathsOfCssResources(e,n.cssRules,t);return{content:n.content,cssRules:n.cssRules,hasChanges:r}}).then(function(e){return o.loadCSSImportsForRules(e.cssRules,[],t).then(function(t){return{content:e.content,cssRules:e.cssRules,hasChanges:e.hasChanges||t.hasChanges,errors:t.errors}})}).then(function(e){return o.loadAndInlineCSSResourcesForRules(e.cssRules,t).then(function(t){return{content:e.content,cssRules:e.cssRules,hasChanges:e.hasChanges||t.hasChanges,errors:e.errors.concat(t.errors)}})}).then(function(e){var t=e.content;return e.hasChanges&&(t=l.cssRulesToText(e.cssRules)),{content:t,errors:e.errors}})},m=function(e,t){var n=e.attributes.href.value,i=r.getDocumentBaseUrl(e.ownerDocument),a=r.clone(t);return!a.baseUrl&&i&&(a.baseUrl=i),c(p,t)(n,a).then(function(e){return{content:e.content,errors:r.cloneArray(e.errors)}})},g=function(e){var t=e.getElementsByTagName("link");return Array.prototype.filter.call(t,function(e){return e.attributes.rel&&"stylesheet"===e.attributes.rel.value&&(!e.attributes.type||"text/css"===e.attributes.type.value)})};t.loadAndInlineCssLinks=function(e,t){var n=g(e),r=[];return Promise.all(n.map(function(e){return m(e,t).then(function(t){f(e,t.content+"\n"),r=r.concat(t.errors)},function(e){r.push({resourceType:"stylesheet",url:e.url,msg:"Unable to load stylesheet "+e.url})})})).then(function(){return r})},t.loadAndInlineImages=i.inline,t.loadAndInlineScript=a.inline,t.inlineReferences=function(e,n){var r=[],i=[t.loadAndInlineImages,t.loadAndInlineStyles,t.loadAndInlineCssLinks];
1return!1!==n.inlineScripts&&i.push(t.loadAndInlineScript),Promise.all(i.map(function(t){return t(e,n).then(function(e){r=r.concat(e)})})).then(function(){return r})}},83507:function(e,t,n){"use strict";var r=n(17824),i=n(47380),a=n(63945),o=n(26843),l=function(e,t,n){e.style.setProperty(t,n,e.style.getPropertyPriority(t))},s=function(e){return e.filter(function(e){return e.type===window.CSSRule.STYLE_RULE&&(e.style.getPropertyValue("background-image")||e.style.getPropertyValue("background"))})},c=function(e){var t=[];return e.forEach(function(e){e.style.getPropertyValue("background-image")?t.push({property:"background-image",value:e.style.getPropertyValue("background-image"),rule:e}):e.style.getPropertyValue("background")&&t.push({property:"background",value:e.style.getPropertyValue("background"),rule:e})}),t},u=function(e){return e.filter(function(e){return e.type===window.CSSRule.FONT_FACE_RULE&&e.style.getPropertyValue("src")})},d=function(e){return e.filter(function(e){return e.type===window.CSSRule.IMPORT_RULE&&e.href})},h=function(e){var t=[];return e.forEach(function(e,n){e.url&&!r.isDataUri(e.url)&&t.push(n)}),t},f=function(e){var t=[];return e.forEach(function(e,n){e.url&&!r.isDataUri(e.url)&&t.push(n)}),t};t.adjustPathsOfCssResources=function(e,t,n){var p=c(s(t)),m=!1;return p.forEach(function(t){var n,i=a.parse(t.value),o=h(i);o.length>0&&(o.forEach(function(t){var n=i[t].url,a=r.joinUrl(e,n);i[t].url=a}),n=a.serialize(i),l(t.rule,t.property,n),m=!0)}),u(t).forEach(function(a){var l,s,c=a.style.getPropertyValue("src");try{l=o.parse(c)}catch(e){return}(s=f(l)).length>0&&(s.forEach(function(t){var n=l[t].url,i=r.joinUrl(e,n);l[t].url=i}),i.changeFontFaceRuleSrc(t,a,o.serialize(l,n),n),m=!0)}),d(t).forEach(function(a){var o=a.href,l=r.joinUrl(e,o);i.exchangeRule(t,a,"@import url("+l+");",n),m=!0}),m};var p=function(e,t,n){var r=e.indexOf(t);e.splice(r,1),n.forEach(function(t,n){e.splice(r+n,0,t)})},m=function(e,n,a,o){var l,s=n.href;return(s=i.unquoteString(s),l=r.joinUrl(o.baseUrl,s),a.indexOf(l)>=0)?(p(e,n,[]),Promise.resolve([])):(a.push(l),r.ajax(s,o).then(function(r){var l=i.rulesForCssText(r,o);return t.loadCSSImportsForRules(l,a,o).then(function(r){return t.adjustPathsOfCssResources(s,l,o),p(e,n,l),r.errors})},function(e){throw{resourceType:"stylesheet",url:e.url,msg:"Unable to load stylesheet "+e.url}}))};t.loadCSSImportsForRules=function(e,t,n){var r=d(e),i=[],a=!1;return Promise.all(r.map(function(r){return m(e,r,t,n).then(function(e){i=i.concat(e),a=!0},function(e){i.push(e)})})).then(function(){return{hasChanges:a,errors:i}})};var g=function(e,t){var n=a.parse(e),i=h(n),o=!1;return r.collectAndReportErrors(i.map(function(e){var i=n[e].url;return r.getDataURIForImageURL(i,t).then(function(t){n[e].url=t,o=!0},function(e){throw{resourceType:"backgroundImage",url:e.url,msg:"Unable to load background-image "+e.url}})})).then(function(e){return{backgroundValue:a.serialize(n),hasChanges:o,errors:e}})},v=function(e,t){var n=c(s(e)),r=[],i=!1;return Promise.all(n.map(function(e){return g(e.value,t).then(function(t){t.hasChanges&&(l(e.rule,e.property,t.backgroundValue),i=!0),r=r.concat(t.errors)})})).then(function(){return{hasChanges:i,errors:r}})},b=function(e,t){var n,i,a=!1;try{n=o.parse(e)}catch(e){n=[]}return i=f(n),r.collectAndReportErrors(i.map(function(e){var i=n[e],o=i.format||"woff";return r.binaryAjax(i.url,t).then(function(e){var t=btoa(e);i.url="data:font/"+o+";base64,"+t,a=!0},function(e){throw{resourceType:"fontFace",url:e.url,msg:"Unable to load font-face "+e.url}})})).then(function(e){return{srcDeclarationValue:o.serialize(n),hasChanges:a,errors:e}})},y=function(e,t){var n=u(e),r=[],a=!1;return Promise.all(n.map(function(n){return b(n.style.getPropertyValue("src"),t).then(function(o){o.hasChanges&&(i.changeFontFaceRuleSrc(e,n,o.srcDeclarationValue,t),a=!0),r=r.concat(o.errors)})})).then(function(){return{hasChanges:a,errors:r}})};t.loadAndInlineCSSResourcesForRules=function(e,t){var n=!1,r=[];return Promise.all([v,y].map(function(i){return i(e,t).then(function(e){n=n||e.hasChanges,r=r.concat(e.errors)})})).then(function(){return{hasChanges:n,errors:r}})}},22782:function(e,t,n){"use strict";var r=n(17824),i=function(e,t){var n=null;e.hasAttribute("src")?n=e.getAttribute("src"):e.hasAttributeNS("http://www.w3.org/1999/xlink","href")?n=e.getAttributeNS("http://www.w3.org/1999/xlink","href"):e.hasAttribute("href")&&(n=e.getAttribute("href"));var i=r.getDocumentBaseUrl(e.ownerDocument),a=r.clone(t);return!a.baseUrl&&i&&(a.baseUrl=i),r.getDataURIForImageURL(n,a).then(function(e){return e},function(e){throw{resourceType:"image",url:e.url,msg:"Unable to load image "+e.url}})},a=function(e){return Array.prototype.slice.call(e)};t.inline=function(e,t){var n,o=a(e.getElementsByTagName("img")),l=a(e.getElementsByTagName("image")),s=(n=e.getElementsByTagName("input"),Array.prototype.filter.call(n,function(e){return"image"===e.type})),c=(o=(o=o.concat(l)).concat(s)).filter(function(e){var t=null;return e.hasAttribute("src")?t=e.getAttribute("src"):e.hasAttributeNS("http://www.w3.org/1999/xlink","href")?t=e.getAttributeNS("http://www.w3.org/1999/xlink","href"):e.hasAttribute("href")&&(t=e.getAttribute("href")),null!==t&&!r.isDataUri(t)});return r.collectAndReportErrors(c.map(function(e){return i(e,t).then(function(t){e.attributes.src?e.attributes.src.value=t:e.attributes["xlink:href"]?e.attributes["xlink:href"].value=t:e.attributes.href&&(e.attributes.href.value=t)})}))}},61598:function(e,t,n){"use strict";var r=n(17824),i=function(e,t){var n=e.attributes.src.value,i=r.getDocumentBaseUrl(e.ownerDocument),a=r.clone(t);return!a.baseUrl&&i&&(a.baseUrl=i),r.ajax(n,a).catch(function(e){throw{resourceType:"script",url:e.url,msg:"Unable to load script "+e.url}})},a=function(e,t){e.attributes.removeNamedItem("src"),e.textContent=t.replace(/<\//g,"<\\/")},o=function(e){var t=e.getElementsByTagName("script");return Array.prototype.filter.call(t,function(e){return!!e.attributes.src})};t.inline=function(e,t){var n=o(e);return r.collectAndReportErrors(n.map(function(e){return i(e,t).then(function(t){a(e,t)})}))}},17824:function(e,t,n){"use strict";var r=n(9173);t.getDocumentBaseUrl=function(e){return"about:blank"!==e.baseURI?e.baseURI:null},t.clone=function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n},t.cloneArray=function(e){return Array.prototype.slice.apply(e,[0])},t.joinUrl=function(e,t){return e?r.resolve(e,t):t},t.isDataUri=function(e){return/^data:/.test(e)},t.collectAndReportErrors=function(e){var t=[];return Promise.all(e.map(function(e){return e.catch(function(e){t.push(e)})})).then(function(){return t})};var i=null;t.ajax=function(e,n){return new Promise(function(r,a){var o,l,s=new window.XMLHttpRequest,c=t.joinUrl(n.baseUrl,e),u=function(){a({msg:"Unable to load url",url:c})};l=!1===(o=n.cache)||"none"===o||"repeated"===o?((null===i||"repeated"!==o)&&(i=Date.now()),c+"?_="+i):c,s.addEventListener("load",function(){200===s.status||0===s.status?r(s.response):u()},!1),s.addEventListener("error",u,!1);try{s.open("GET",l,!0),s.overrideMimeType(n.mimeType),s.send(null)}catch(e){u()}})},t.binaryAjax=function(e,n){var r=t.clone(n);return r.mimeType="text/plain;
1 charset=x-user-defined",t.ajax(e,r).then(function(e){for(var t="",n=0;n<e.length;n++)t+=String.fromCharCode(255&e.charCodeAt(n));return t})};var a=function(e){var t=function(e,t){return e.substring(0,t.length)===t};return t(e,"<?xml")||t(e,"<svg")?"image/svg+xml":"image/png"};t.getDataURIForImageURL=function(e,n){return t.binaryAjax(e,n).then(function(e){var t=btoa(e);return"data:"+a(e)+";base64,"+t})};var o=[];t.memoize=function(e,t,n){if("object"!=typeof n)throw Error("cacheBucket is not an object");return function(){var r,i=Array.prototype.slice.call(arguments),a=t(i),l=(0>o.indexOf(e)&&o.push(e),o.indexOf(e));return n[l]&&n[l][a]?n[l][a]:(r=e.apply(null,i),n[l]=n[l]||{},n[l][a]=r,r)}}},75911:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loop=t.conditional=t.parse=void 0,t.parse=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r;if(Array.isArray(n))n.forEach(function(n){return e(t,n,r,i)});else if("function"==typeof n)n(t,r,i,e);else{var a=Object.keys(n)[0];Array.isArray(n[a])?(i[a]={},e(t,n[a],r,i[a])):i[a]=n[a](t,r,i,e)}return r},t.conditional=function(e,t){return function(n,r,i,a){t(n,r,i)&&a(n,e,r,i)}},t.loop=function(e,t){return function(n,r,i,a){for(var o=[],l=n.pos;t(n,r,i);){var s={};if(a(n,e,r,s),n.pos===l)break;l=n.pos,o.push(s)}return o}}},10290:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readBits=t.readArray=t.readUnsigned=t.readString=t.peekBytes=t.readBytes=t.peekByte=t.readByte=t.buildStream=void 0,t.buildStream=function(e){return{data:e,pos:0}};var n=function(){return function(e){return e.data[e.pos++]}};t.readByte=n,t.peekByte=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(t){return t.data[t.pos+e]}};var r=function(e){return function(t){return t.data.subarray(t.pos,t.pos+=e)}};t.readBytes=r,t.peekBytes=function(e){return function(t){return t.data.subarray(t.pos,t.pos+e)}},t.readString=function(e){return function(t){return Array.from(r(e)(t)).map(function(e){return String.fromCharCode(e)}).join("")}},t.readUnsigned=function(e){return function(t){var n=r(2)(t);return e?(n[1]<<8)+n[0]:(n[0]<<8)+n[1]}},t.readArray=function(e,t){return function(n,i,a){for(var o="function"==typeof t?t(n,i,a):t,l=r(e),s=Array(o),c=0;c<o;c++)s[c]=l(n);return s}};var i=function(e,t,n){for(var r=0,i=0;i<n;i++)r+=e[t+i]&&Math.pow(2,n-i-1);return r};t.readBits=function(e){return function(t){for(var r=n()(t),a=Array(8),o=0;o<8;o++)a[7-o]=!!(r&1<<o);return Object.keys(e).reduce(function(t,n){var r=e[n];return r.length?t[n]=i(a,r.index,r.length):t[n]=a[r.index],t},{})}}},39735:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(75911),i=n(10290),a={blocks:function(e){for(var t=[],n=e.data.length,r=0,a=(0,i.readByte)()(e);0!==a&&a;a=(0,i.readByte)()(e)){if(e.pos+a>=n){var o=n-e.pos;t.push((0,i.readBytes)(o)(e)),r+=o;break}t.push((0,i.readBytes)(a)(e)),r+=a}for(var l=new Uint8Array(r),s=0,c=0;c<t.length;c++)l.set(t[c],s),s+=t[c].length;return l}},o=(0,r.conditional)({gce:[{codes:(0,i.readBytes)(2)},{byteSize:(0,i.readByte)()},{extras:(0,i.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,i.readUnsigned)(!0)},{transparentColorIndex:(0,i.readByte)()},{terminator:(0,i.readByte)()}]},function(e){var t=(0,i.peekBytes)(2)(e);return 33===t[0]&&249===t[1]}),l=(0,r.conditional)({image:[{code:(0,i.readByte)()},{descriptor:[{left:(0,i.readUnsigned)(!0)},{top:(0,i.readUnsigned)(!0)},{width:(0,i.readUnsigned)(!0)},{height:(0,i.readUnsigned)(!0)},{lct:(0,i.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,r.conditional)({lct:(0,i.readArray)(3,function(e,t,n){return Math.pow(2,n.descriptor.lct.size+1)})},function(e,t,n){return n.descriptor.lct.exists}),{data:[{minCodeSize:(0,i.readByte)()},a]}]},function(e){return 44===(0,i.peekByte)()(e)}),s=(0,r.conditional)({text:[{codes:(0,i.readBytes)(2)},{blockSize:(0,i.readByte)()},{preData:function(e,t,n){return(0,i.readBytes)(n.text.blockSize)(e)}},a]},function(e){var t=(0,i.peekBytes)(2)(e);return 33===t[0]&&1===t[1]}),c=(0,r.conditional)({application:[{codes:(0,i.readBytes)(2)},{blockSize:(0,i.readByte)()},{id:function(e,t,n){return(0,i.readString)(n.blockSize)(e)}},a]},function(e){var t=(0,i.peekBytes)(2)(e);return 33===t[0]&&255===t[1]}),u=(0,r.conditional)({comment:[{codes:(0,i.readBytes)(2)},a]},function(e){var t=(0,i.peekBytes)(2)(e);return 33===t[0]&&254===t[1]}),d=[{header:[{signature:(0,i.readString)(3)},{version:(0,i.readString)(3)}]},{lsd:[{width:(0,i.readUnsigned)(!0)},{height:(0,i.readUnsigned)(!0)},{gct:(0,i.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,i.readByte)()},{pixelAspectRatio:(0,i.readByte)()}]},(0,r.conditional)({gct:(0,i.readArray)(3,function(e,t){return Math.pow(2,t.lsd.gct.size+1)})},function(e,t){return t.lsd.gct.exists}),{frames:(0,r.loop)([o,c,u,l,s],function(e){var t=(0,i.peekByte)()(e);return 33===t||44===t})}];t.default=d},97913:function(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},10908:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;
vendor: 4,757 bytes, line 1
1++n<r&&!1!==t(e[n],n,e););return e}},82930:function(e,t,n){var r=n(16610),i=n(30207);e.exports=function(e,t,n){(void 0===n||i(e[t],n))&&(void 0!==n||t in e)||r(e,t,n)}},63045:function(e,t,n){var r=n(16610),i=n(30207),a=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var o=e[t];a.call(e,t)&&i(o,n)&&(void 0!==n||t in e)||r(e,t,n)}},49769:function(e,t,n){var r=n(89028),i=n(35147);e.exports=function(e,t){return e&&r(t,i(t),e)}},3907:function(e,t,n){var r=n(89028),i=n(71885);e.exports=function(e,t){return e&&r(t,i(t),e)}},16610:function(e,t,n){var r=n(59907);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},2174:function(e,t,n){var r=n(15450),i=n(10908),a=n(63045),o=n(49769),l=n(3907),s=n(88908),c=n(19029),u=n(56365),d=n(93626),h=n(24592),f=n(31453),p=n(17121),m=n(88244),g=n(544),v=n(54768),b=n(73509),y=n(91485),w=n(51820),x=n(88873),C=n(68414),E=n(35147),k=n(71885),S="[object Arguments]",T="[object Function]",P="[object Object]",M={};M[S]=M["[object Array]"]=M["[object ArrayBuffer]"]=M["[object DataView]"]=M["[object Boolean]"]=M["[object Date]"]=M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Map]"]=M["[object Number]"]=M[P]=M["[object RegExp]"]=M["[object Set]"]=M["[object String]"]=M["[object Symbol]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M["[object Error]"]=M[T]=M["[object WeakMap]"]=!1,e.exports=function e(t,n,R,A,L,_){var I,O=1&n,D=2&n,z=4&n;if(R&&(I=L?R(t,A,L,_):R(t)),void 0!==I)return I;if(!x(t))return t;var N=b(t);if(N){if(I=m(t),!O)return c(t,I)}else{var F=p(t),B=F==T||"[object GeneratorFunction]"==F;if(y(t))return s(t,O);if(F==P||F==S||B&&!L){if(I=D||B?{}:v(t),!O)return D?d(t,l(I,t)):u(t,o(I,t))}else{if(!M[F])return L?t:{};I=g(t,F,O)}}_||(_=new r);var H=_.get(t);if(H)return H;_.set(t,I),C(t)?t.forEach(function(r){I.add(e(r,n,R,r,t,_))}):w(t)&&t.forEach(function(r,i){I.set(i,e(r,n,R,i,t,_))});var V=z?D?f:h:D?k:E,j=N?void 0:V(t);return i(j||t,function(r,i){j&&(r=t[i=r]),a(I,i,e(r,n,R,i,t,_))}),I}},58987:function(e,t,n){var r=n(88873),i=Object.create,a=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=a},48745:function(e,t,n){var r=n(17121),i=n(62743);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},49375:function(e,t,n){var r=n(17121),i=n(62743);e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},69208:function(e,t,n){var r=n(88873),i=n(99166),a=n(71914),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return a(e);var t=i(e),n=[];for(var l in e)"constructor"==l&&(t||!o.call(e,l))||n.push(l);return n}},42540:function(e,t,n){var r=n(15450),i=n(82930),a=n(92244),o=n(541),l=n(88873),s=n(71885),c=n(12693);e.exports=function e(t,n,u,d,h){t!==n&&a(n,function(a,s){if(h||(h=new r),l(a))o(t,n,s,u,e,d,h);else{var f=d?d(c(t,s),a,s+"",t,n,h):void 0;void 0===f&&(f=a),i(t,s,f)}},s)}},541:function(e,t,n){var r=n(82930),i=n(88908),a=n(21991),o=n(19029),l=n(54768),s=n(41080),c=n(73509),u=n(64709),d=n(91485),h=n(74449),f=n(88873),p=n(40598),m=n(23329),g=n(12693),v=n(80466);e.exports=function(e,t,n,b,y,w,x){var C=g(e,n),E=g(t,n),k=x.get(E);if(k){r(e,n,k);return}var S=w?w(C,E,n+"",e,t,x):void 0,T=void 0===S;if(T){var P=c(E),M=!P&&d(E),R=!P&&!M&&m(E);S=E,P||M||R?c(C)?S=C:u(C)?S=o(C):M?(T=!1,S=i(E,!0)):R?(T=!1,S=a(E,!0)):S=[]:p(E)||s(E)?(S=C,s(C)?S=v(C):(!f(C)||h(C))&&(S=l(E))):T=!1}T&&(x.set(E,S),y(S,E,b,w,x),x.delete(E)),r(e,n,S)}},99749:function(e,t,n){var r=n(65778),i=n(25912),a=n(81288);e.exports=function(e,t){return a(i(e,t,r),e+"")}},47063:function(e,t,n){var r=n(38461),i=n(59907),a=n(65778),o=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:a;e.exports=o},51032:function(e,t,n){var r=n(65778);e.exports=function(e){return"function"==typeof e?e:r}},67391:function(e,t,n){var r=n(8129);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},88908:function(e,t,n){e=n.nmd(e);var r=n(3642),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i?r.Buffer:void 0,l=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=l?l(n):new e.constructor(n);return e.copy(r),r}},28395:function(e,t,n){var r=n(67391);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},52882:function(e){var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},85492:function(e,t,n){var r=n(65085),i=r?r.prototype:void 0,a=i?i.valueOf
vendor: 5,016 bytes, line 1
1:void 0;e.exports=function(e){return a?Object(a.call(e)):{}}},21991:function(e,t,n){var r=n(67391);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},19029:function(e){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},89028:function(e,t,n){var r=n(63045),i=n(16610);e.exports=function(e,t,n,a){var o=!n;n||(n={});for(var l=-1,s=t.length;++l<s;){var c=t[l],u=a?a(n[c],e[c],c,n,e):void 0;void 0===u&&(u=e[c]),o?i(n,c,u):r(n,c,u)}return n}},56365:function(e,t,n){var r=n(89028),i=n(24729);e.exports=function(e,t){return r(e,i(e),t)}},93626:function(e,t,n){var r=n(89028),i=n(52250);e.exports=function(e,t){return r(e,i(e),t)}},80822:function(e,t,n){var r=n(99749),i=n(64091);e.exports=function(e){return r(function(t,n){var r=-1,a=n.length,o=a>1?n[a-1]:void 0,l=a>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,l&&i(n[0],n[1],l)&&(o=a<3?void 0:o,a=1),t=Object(t);++r<a;){var s=n[r];s&&e(t,s,r,o)}return t})}},59907:function(e,t,n){var r=n(64620),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},31453:function(e,t,n){var r=n(42600),i=n(52250),a=n(71885);e.exports=function(e){return r(e,a,i)}},99672:function(e,t,n){var r=n(49203)(Object.getPrototypeOf,Object);e.exports=r},52250:function(e,t,n){var r=n(73056),i=n(99672),a=n(24729),o=n(58182),l=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,a(e)),e=i(e);return t}:o;e.exports=l},88244:function(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},544:function(e,t,n){var r=n(67391),i=n(28395),a=n(52882),o=n(85492),l=n(21991);e.exports=function(e,t,n){var s=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new s(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return l(e,n);case"[object Map]":case"[object Set]":return new s;case"[object Number]":case"[object String]":return new s(e);case"[object RegExp]":return a(e);case"[object Symbol]":return o(e)}}},54768:function(e,t,n){var r=n(58987),i=n(99672),a=n(99166);e.exports=function(e){return"function"!=typeof e.constructor||a(e)?{}:r(i(e))}},71914:function(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},25912:function(e,t,n){var r=n(97913),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var a=arguments,o=-1,l=i(a.length-t,0),s=Array(l);++o<l;)s[o]=a[t+o];o=-1;for(var c=Array(t+1);++o<t;)c[o]=a[o];return c[t]=n(s),r(e,this,c)}}},12693:function(e){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},81288:function(e,t,n){var r=n(47063),i=n(27873)(r);e.exports=i},27873:function(e){var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),a=16-(i-r);if(r=i,a>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},97975:function(e,t,n){var r=n(2174);e.exports=function(e){return r(e,5)}},38461:function(e){e.exports=function(e){return function(){return e}}},48325:function(e,t,n){e.exports=n(58391)},58391:function(e,t,n){var r=n(10908),i=n(47035),a=n(51032),o=n(73509);e.exports=function(e,t){return(o(e)?r:i)(e,a(t))}},18008:function(e,t,n){var r=n(69583),i=n(51032);e.exports=function(e,t){return e&&r(e,i(t))}},64709:function(e,t,n){var r=n(15206),i=n(62743);e.exports=function(e){return i(e)&&r(e)}},51820:function(e,t,n){var r=n(48745),i=n(19040),a=n(44055),o=a&&a.isMap,l=o?i(o):r;e.exports=l},40598:function(e,t,n){var r=n(606),i=n(99672),a=n(62743),o=Object.prototype,l=Function.prototype.toString,s=o.hasOwnProperty,c=l.call(Object);e.exports=function(e){if(!a(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=s.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==c}},68414:function(e,t,n){var r=n(49375),i=n(19040),a=n(44055),o=a&&a.isSet,l=o?i(o):r;e.exports=l},24558:function(e,t,n){var r=n(606),i=n(73509),a=n(62743);e.exports=function(e){return"string"==typeof e||!i(e)&&a(e)&&"[object String]"==r(e)}},71885:function(e,t,n){var r=n(99207),i=n(69208),a=n(15206);e.exports=function(e){return a(e)?r(e,!0):i(e)}},89232:function(e,t,n){var r=n(2173),i=n(60876),a=n(67641),o=n(73509);e.exports=function(e,t){return(o(e)?r:a)(e,i(t,3))}},79491:function(e,t,n){var r=n(42540),i=n(80822)(function(e,t,n){r(e,t,n)});e.exports=i},80466:function(e,t,n){var r=n(89028),i=n(71885);e.exports=function(e){return r(e,i(e))}},15904:function(e,t,n){e.exports={lex:n(58950),parse:n(79214),stringify:n(5888)}},79198:function(e,t,n){var r=n(68571);
1function i(e){var t=[].slice.call(arguments,1);t.unshift("["+e+"]"),r.stderr.write(t.join(" ")+"\n")}t=e.exports=function(e){return i.bind(null,e)}},58950:function(e,t,n){n(79198)("lex"),e.exports=function(e){var t="",n=0,r=-1,i=0,a=1,o="before-selector",l=[o],s={},c=[],u=["media","keyframes",{name:"-webkit-keyframes",type:"keyframes",prefix:"-webkit-"},{name:"-moz-keyframes",type:"keyframes",prefix:"-moz-"},{name:"-ms-keyframes",type:"keyframes",prefix:"-ms-"},{name:"-o-keyframes",type:"keyframes",prefix:"-o-"},"font-face",{name:"import",state:"before-at-value"},{name:"charset",state:"before-at-value"},"supports","viewport",{name:"namespace",state:"before-at-value"},"document",{name:"-moz-document",type:"document",prefix:"-moz-"},"page"];function d(e){return e?l[l.length-1-e]:o}function h(t){return e[r+(t||1)]}function f(){var e=l.pop();return o=l[l.length-1],e}function p(e){return o=e,l.push(o),l.length}function m(e){var t=o;return l[l.length-1]=o=e,t}function g(t){if(1==(t||1))"\n"==e[r]?(a++,n=1):n++,r++;else{var i=e.slice(r,r+t).split("\n");i.length>1&&(a+=i.length-1,n=1),n+=i[i.length-1].length,r+=t}}function v(){s.end={line:a,col:n},c.push(s),t="",s={}}function b(e){s={type:e,start:{line:a,col:n}}}for(;g(),w=e[r];)switch(w){case" ":switch(d()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":t+=w}break;case"\n":case" ":case"\r":case"\f":switch(d()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":t+=w;break;case"at-value":"\n"===w&&(s.value=t.trim(),v(),f())}break;case":":switch(d()){case"name":s.name=t.trim(),t="",m("before-value");break;case"before-selector":t+=w,b("selector"),p("selector");break;case"before-value":m("value"),t+=w;break;default:t+=w}break;case";":switch(d()){case"name":case"before-value":case"value":t.trim().length>0&&(s.value=t.trim(),v()),m("before-name");break;case"value-paren":default:t+=w;break;case"at-value":s.value=t.trim(),v(),f();case"before-name":}break;case"{":switch(d()){case"selector":if("\\"===h(-1)){t+=w;break}s.text=t.trim(),v(),m("before-name"),i+=1;break;case"at-group":switch(s.name=t.trim(),s.type){case"font-face":case"viewport":case"page":p("before-name");break;default:p("before-selector")}v(),i+=1;break;case"name":case"at-rule":s.name=t.trim(),v(),p("before-name"),i+=1;break;case"comment":case"double-string":case"single-string":t+=w;break;case"before-value":m("value"),t+=w}break;case"}":switch(d()){case"before-name":case"name":case"before-value":case"value":t&&(s.value=t.trim()),s.name&&s.value&&v(),b("end"),v(),f(),"at-group"===d()&&(b("at-group-end"),v(),f()),i>0&&(i-=1);break;case"at-group":case"before-selector":case"selector":if("\\"===h(-1)){t+=w;break}i>0&&"at-group"===d(1)&&(b("at-group-end"),v()),i>1&&f(),i>0&&(i-=1);break;case"double-string":case"single-string":case"comment":t+=w}break;case'"':case"'":switch(d()){case"double-string":'"'===w&&"\\"!==h(-1)&&f();break;case"single-string":"'"===w&&"\\"!==h(-1)&&f();break;case"before-at-value":m("at-value"),p('"'===w?"double-string":"single-string");break;case"before-value":m("value"),p('"'===w?"double-string":"single-string");break;case"comment":break;default:"\\"!==h(-1)&&p('"'===w?"double-string":"single-string")}t+=w;break;case"/":switch(d()){case"comment":case"double-string":case"single-string":t+=w;break;case"before-value":case"selector":case"name":case"value":if("*"===h(1)){var y=function(t){var n=e.slice(r).indexOf("*/");return n>0&&n}(0);y&&g(y+1)}else"before-value"==d()&&m("value"),t+=w;break;default:"*"===h(1)?(b("comment"),p("comment"),g()):t+=w}break;case"*":switch(d()){case"comment":"/"===h(1)?(s.text=t,g(),v(),f()):t+=w;break;case"before-selector":t+=w,b("selector"),p("selector");break;case"before-value":m("value"),t+=w;break;default:t+=w}break;case"@":switch(d()){case"comment":case"double-string":case"single-string":t+=w;break;case"before-value":m("value"),t+=w;break;default:for(var w,x,C,E=!1,k=0,S=u.length;!E&&k<S;++k)(function(t){var n=r+1;return t===e.slice(n,n+t.length)})(x=(C=u[k]).name||C)&&(E=!0,b(x),p(C.state||"at-group"),g(x.length),C.prefix&&(s.prefix=C.prefix),C.type&&(s.type=C.type));E||(t+=w)}break;case"(":switch(d()){case"value":p("value-paren");break;case"before-value":m("value")}t+=w;break;case")":switch(d()){case"value-paren":f();break;case"before-value":m("value")}t+=w;break;default:switch(d()){case"before-selector":b("selector"),p("selector");break;case"before-name":b("property"),m("name");break;case"before-value":m("value");break;case"before-at-value":m("at-value")}t+=w}return c}},79214:function(e,t,n){n(79198)("parse");var r,i,a,o,l=n(58950);function s(e,t){t||(t={});for(var n,r=["type","name","value"],i={},o=0;o<r.length;++o)e[n=r[o]]&&(i[n]=t[n]||e[n]);for(o=0,r=Object.keys(t);o<r.length;++o)i[n=r[o]]||(i[n]=t[n]);return a&&(i.position={start:e.start,end:e.end}),i}function c(e){switch(e.type){case"property":case"charset":case"import":case"namespace":return s(e);case"selector":return s(e,{type:"rule",selectors:e.text.split(",").map(function(e){return e.trim()}),declarations:d(e)});case"at-group-end":i-=1;return;
1case"media":case"keyframes":case"font-face":case"supports":case"viewport":case"document":case"page":return function(e){i+=1;var t={};switch(e.type){case"font-face":case"viewport":t.declarations=d();break;case"page":t.prefix=e.prefix,t.declarations=d();break;default:t.prefix=e.prefix,t.rules=u(function(){return i})}return s(e,t)}(e);case"comment":if(r)return s(e,{text:e.text})}}function u(e){for(var t,n,r=[];(n=o.shift())&&e&&e(n);)(t=c(n))&&r.push(t);return n&&"end"!==n.type&&o.unshift(n),r}function d(){return u(function(e){return"property"===e.type||"comment"===e.type})}e.exports=function(e,t){t||(t={}),r=!!t.comments,a=!!t.position,i=0,o=Array.isArray(e)?e.slice():l(e);for(var n,s,u=[];s=o.shift();)(n=c(s))&&u.push(n);return{type:"stylesheet",stylesheet:{rules:u}}}},5888:function(e,t,n){var r,i,a,o,l,s;function c(e){if(e){o+=e;return}return i?"":Array(o).join(a||"")}function u(e){return r?"/*"+(e.text||"")+"*/"+l:""}function d(e){var t;return t=e.selectors?e.selectors.join(","+l):"@"+e.type+(e.name?" "+e.name:""),c()+t+s+f(e)+l}function h(e,t){return e.reduce(function(e,n){var r="comment"===n.type?u(n):t(n);return r&&e.push(r),e},[])}function f(e,t){var n=e.declarations,r=p;return e.rules&&(n=e.rules,r=d),(n=function(e,t){if(!e)return"";c(1);var n=h(e,t);return(c(-1),n.length)?n.join(l):""}(n,r))&&(n=l+n+(t?"":l)),"{"+n+c()+"}"}function p(e){if("property"===e.type){var t;return t=e.name?e.name+":"+s:"",c()+t+e.value+";"}}function m(e){switch(e.type){case"rule":return d(e);case"media":case"keyframes":case"font-face":case"supports":case"viewport":case"document":case"page":var t,n,r;return t="",n=e.prefix||"",e.name&&(t=" "+e.name),r="page"!==e.type,"@"+n+e.type+t+s+f(e,r)+l;case"comment":return u(e);case"import":case"charset":case"namespace":return"@"+e.type+" "+e.value+";"+l}}n(79198)("stringify"),e.exports=function(e,t){return t||(t={}),a=t.indentation||"",i=!!t.compress,r=!!t.comments,o=1,i?l=s="":(l="\n",s=" "),h(e.stylesheet.rules,m).join("\n").trim()}},2027:function(e,t,n){"use strict";n.d(t,{Pi:function(){return y},z0:function(){return c},fv:function(){return x}});var r,i,a=n(59533),o=n(7653);if(!o.useState)throw Error("mobx-react-lite requires React with Hooks support");if(!a.rC)throw Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var l=n(3458);function s(e){e()}function c(e){e||(e=s),(0,a.jQ)({reactionScheduler:e})}function u(e){return(0,a.Gf)(e)}var d=function(){function e(e){var t=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=1e4),clearTimeout(t.sweepTimeout),t.sweepTimeout=void 0;var n=Date.now();t.registrations.forEach(function(r,i){n-r.registeredAt>=e&&(t.finalize(r.value),t.registrations.delete(i))}),t.registrations.size>0&&t.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this.registrations.set(n,{value:t,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.registrations.delete(e)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){void 0===this.sweepTimeout&&(this.sweepTimeout=setTimeout(this.sweep,1e4))}}),e}(),h=new("undefined"!=typeof FinalizationRegistry?FinalizationRegistry:d)(function(e){var t;null===(t=e.reaction)||void 0===t||t.dispose(),e.reaction=null}),f=n(96250);function p(e){e.reaction=new a.le("observer".concat(e.name),function(){var t;e.stateVersion=Symbol(),null===(t=e.onStoreChange)||void 0===t||t.call(e)})}var m="function"==typeof Symbol&&Symbol.for,g=null!==(i=null===(r=Object.getOwnPropertyDescriptor(function(){},"name"))||void 0===r?void 0:r.configurable)&&void 0!==i&&i,v=m?Symbol.for("react.forward_ref"):"function"==typeof o.forwardRef&&(0,o.forwardRef)(function(e){return null}).$$typeof,b=m?Symbol.for("react.memo"):"function"==typeof o.memo&&(0,o.memo)(function(e){return null}).$$typeof;function y(e,t){if(b&&e.$$typeof===b)throw Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");var n,r=null!==(n=null==t?void 0:t.forwardRef)&&void 0!==n&&n,i=e,a=e.displayName||e.name;if(v&&e.$$typeof===v&&(r=!0,"function"!=typeof(i=e.render)))throw Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var l=function(e,t){return function(e,t){void 0===t&&(t="observed");var n,r,i=o.useRef(null);if(!i.current){var a={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(e){return h.unregister(a),a.onStoreChange=e,a.reaction||(p(a),a.stateVersion=Symbol()),function(){var e;a.onStoreChange=null,null===(e=a.reaction)||void 0===e||e.dispose(),a.reaction=null}},getSnapshot:function(){return a.stateVersion}};i.current=a}var l=i.current;if(l.reaction||(p(l),h.register(i,l,l)),o.useDebugValue(l.reaction,u),(0,f.useSyncExternalStore)(l.subscribe,l.getSnapshot,l.getSnapshot),l.reaction.track(function(){try{n=e()}catch(e){r=e}}),r)throw r;return n}(function(){return i(e,t)},a)};return l.displayName=e.displayName,g&&Object.defineProperty(l,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(l.contextTypes=e.contextTypes),r&&(l=(0,o.forwardRef)(l)),function(e,t){Object.keys(e).forEach(function(n){w[n]||Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}(e,l=(0,o.memo)(l)),l}var w={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function x(e,t){return(0,o.useState)(function(){return(0,a.LO)(e(),t,{autoBind:!0})})[0]}c(l.unstable_batchedUpdates),h.finalizeAllImmediately},9173:function(e,t,n){!function(){var t={452:function(e){"use strict";e.exports=n(45184)}},r={};function i(e){var n=r[e];if(void 0!==n)return n.exports;var a=r[e]={exports:{}},o=!0;try{t[e](a,a.exports,i),o=!1}finally{o&&delete r[e]}return a.exports}i.ab="//";var a={};!function(){var e,t=(e=i(452))&&"object"==typeof e&&"default"in e?e.default:e,n=/https?|ftp|gopher|file/;function r(e){"string"==typeof e&&(e=v(e));var r,i,a,o,l,s,c,u,d,h=(i=(r=e).auth,a=r.hostname,o=r.protocol||"",l=r.pathname||"",s=r.hash||"",c=r.query||"",u=!1,i=i?encodeURIComponent(i).replace(/%3A/i,":")+"@":"",r.host?u=i+r.host:a&&(u=i+(~a.indexOf(":")?"["+a+"]":a),r.port&&(u+=":"+r.port)),c&&"object"==typeof c&&(c=t.encode(c)),d=r.search||c&&"?"+c||"",o&&":"!==o.substr(-1)&&(o+=":"),r.slashes||(!o||n.test(o))&&!1!==u?(u="//"+(u||""),l&&"/"!==l[0]&&(l="/"+l)):u||(u=""),s&&"#"!==s[0]&&(s="#"+s),d&&"?"!==d[0]&&(d="?"+d),{protocol:o,host:u,pathname:l=l.replace(/[?#]/g,encodeURIComponent),search:d=d.replace("#","%23"),hash:s});return""+h.protocol+h.host+h.pathname+h.search+h.hash}var o="http://",l=o+"w.w",s=/^([a-z0-9.+-]*:\/\/\/)([a-z0-9.+-]:\/*)?/i,c=/https?|ftp|gopher|file/;function u(e,t){var n="string"==typeof e?v(e):e;e="object"==typeof e?r(e):e;var i=v(t),a="";n.protocol&&!n.slashes&&(a=n.protocol,e=e.replace(n.protocol,""),a+="/"===t[0]||"/"===e[0]?"/":""),a&&i.protocol&&(a="",i.slashes||(a=i.protocol,t=t.replace(i.protocol,"")));var u=e.match(s);u&&!i.protocol&&(e=e.substr((a=u[1]+(u[2]||"")).length),/^\/\/[^/]/.test(t)&&(a=a.slice(0,-1)));var d=new URL(e,l+"/"),h=new URL(t,d).toString().replace(l,""),f=i.protocol||n.protocol;return f+=n.slashes||i.slashes?"//":"",!a&&f?h=h.replace(o,f):a&&(h=h.replace(o,"")),c.test(h)||~t.indexOf(".")||"/"===e.slice(-1)||"/"===t.slice(-1)||"/"!==h.slice(-1)||(h=h.slice(0,-1)),a&&(h=a+("/"===h[0]?h.substr(1):h)),h}function d(){}d.prototype.parse=v,d.prototype.format=r,d.prototype.resolve=u,d.prototype.resolveObject=u;var h=/^https?|ftp|gopher|file/,f=/^(.*?)([#?].*)/,p=/^([a-z0-9.+-]*:)(\/{0,3})(.*)/i,m=/^([a-z0-9.+-]*:)?\/\/\/*/i,g=/^([a-z0-9.+-]*:)(\/{0,2})\[(.*)\]$/i;function v(e,n,i){if(void 0===n&&(n=!1),void 0===i&&(i=!1),e&&"object"==typeof e&&e instanceof d)return e;var a=(e=e.trim()).match(f);e=a?a[1].replace(/\\/g,"/")+a[2]:e.replace(/\\/g,"/"),g.test(e)&&"/"!==e.slice(-1)&&(e+="/");var o=!/(^javascript)/.test(e)&&e.match(p),s=m.test(e),c="";o&&(h.test(o[1])||(c=o[1].toLowerCase(),e=""+o[2]+o[3]),o[2]||(s=!1,h.test(o[1])?(c=o[1],e=""+o[3]):e="//"+o[3]),3!==o[2].length&&1!==o[2].length||(c=o[1],e="/"+o[3]));var u,v=(a?a[1]:e).match(/^https?:\/\/[^/]+(:[0-9]+)(?=\/|$)/),b=v&&v[1],y=new d,w="",x="";try{u=new URL(e)}
1catch(t){w=t,c||i||!/^\/\//.test(e)||/^\/\/.+[@.]/.test(e)||(x="/",e=e.substr(1));try{u=new URL(e,l)}catch(e){return y.protocol=c,y.href=c,y}}y.slashes=s&&!x,y.host="w.w"===u.host?"":u.host,y.hostname="w.w"===u.hostname?"":u.hostname.replace(/(\[|\])/g,""),y.protocol=w?c||null:u.protocol,y.search=u.search.replace(/\\/g,"%5C"),y.hash=u.hash.replace(/\\/g,"%5C");var C=e.split("#");!y.search&&~C[0].indexOf("?")&&(y.search="?"),y.hash||""!==C[1]||(y.hash="#"),y.query=n?t.decode(u.search.substr(1)):y.search.substr(1),y.pathname=x+(o?u.pathname.replace(/['^|`]/g,function(e){return"%"+e.charCodeAt().toString(16).toUpperCase()}).replace(/((?:%[0-9A-F]{2})+)/g,function(e,t){try{return decodeURIComponent(t).split("").map(function(e){var t=e.charCodeAt();return t>256||/^[a-z0-9]$/i.test(e)?e:"%"+t.toString(16).toUpperCase()}).join("")}catch(e){return t}}):u.pathname),"about:"===y.protocol&&"blank"===y.pathname&&(y.protocol="",y.pathname=""),w&&"/"!==e[0]&&(y.pathname=y.pathname.substr(1)),c&&!h.test(c)&&"/"!==e.slice(-1)&&"/"===y.pathname&&(y.pathname=""),y.path=y.pathname+y.search,y.auth=[u.username,u.password].map(decodeURIComponent).filter(Boolean).join(":"),y.port=u.port,b&&!y.host.endsWith(b)&&(y.host+=b,y.port=b.slice(1)),y.href=x?""+y.pathname+y.search+y.hash:r(y);var E=/^(file)/.test(y.href)?["host","hostname"]:[];return Object.keys(y).forEach(function(e){~E.indexOf(e)||(y[e]=y[e]||null)}),y}a.parse=v,a.format=r,a.resolve=u,a.resolveObject=function(e,t){return v(u(e,t))},a.Url=d}(),e.exports=a}()},45184:function(e){!function(){"use strict";var t={815:function(e){e.exports=function(e,n,r,i){n=n||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var o=/\+/g;e=e.split(n);var l=1e3;i&&"number"==typeof i.maxKeys&&(l=i.maxKeys);var s=e.length;l>0&&s>l&&(s=l);for(var c=0;c<s;++c){var u,d,h,f,p=e[c].replace(o,"%20"),m=p.indexOf(r);(m>=0?(u=p.substr(0,m),d=p.substr(m+1)):(u=p,d=""),h=decodeURIComponent(u),f=decodeURIComponent(d),Object.prototype.hasOwnProperty.call(a,h))?t(a[h])?a[h].push(f):a[h]=[a[h],f]:a[h]=f}return a};var t=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},577:function(e){var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,a,o,l){return(a=a||"&",o=o||"=",null===e&&(e=void 0),"object"==typeof e)?r(i(e),function(i){var l=encodeURIComponent(t(i))+o;return n(e[i])?r(e[i],function(e){return l+encodeURIComponent(t(e))}).join(a):l+encodeURIComponent(t(e[i]))}).join(a):l?encodeURIComponent(t(l))+o+encodeURIComponent(t(e)):""};var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function r(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var i=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var a=n[e]={exports:{}},o=!0;try{t[e](a,a.exports,r),o=!1}finally{o&&delete n[e]}return a.exports}r.ab="//";var i={};i.decode=i.parse=r(815),i.encode=i.stringify=r(577),e.exports=i}()},76047:function(e,t,n){"use strict";function r(e){return e.toLowerCase()}n.d(t,{B:function(){return o}});var i=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],a=/[^A-Z0-9]+/gi;function o(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=t.stripRegexp,s=t.transform,c=t.delimiter,u=l(l(e,void 0===n?i:n,"$1\0$2"),void 0===o?a:o,"\0"),d=0,h=u.length;"\0"===u.charAt(d);)d++;for(;"\0"===u.charAt(h-1);)h--;return u.slice(d,h).split("\0").map(void 0===s?r:s).join(void 0===c?" ":c)}function l(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce(function(e,t){return e.replace(t,n)},e)}},58761:function(e,t,n){"use strict";n.d(t,{Ho:function(){return o}});var r=n(83780),i=n(76047);function a(e,t){var n=e.charAt(0),r=e.substr(1).toLowerCase();return t>0&&n>="0"&&n<="9"?"_"+n+r:""+n.toUpperCase()+r}function o(e,t){return void 0===t&&(t={}),(0,i.B)(e,(0,r.pi)({delimiter:"",transform:a},t))}},38041:function(e,t,n){var r,i,a;i=this,a=function(e,t,n,r){var i,a,o,l,s,c,u,d,h,f,p,m,g,v,b,y,w,x,C,E,k,S,T,P,M,R,A,L,_,I,O,D,z,N,F,B,H,V,j,$,U,W,G,q,Z,X,Y,K,J,Q=(a=[],(i={}).joinUrl=function(t,n){return t?e.resolve(t,n):n},i.getConstantUniqueIdFor=function(e){return 0>a.indexOf(e)&&a.push(e),a.indexOf(e)},i.clone=function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n},o=function(e){return"object"==typeof e&&null!==e&&Object.prototype.toString.apply(e).match(/\[object (Canvas|HTMLCanvasElement|OffscreenCanvas)\]/i)},i.parseOptionalParameters=function(e){var t={canvas:null,options:{}};return null==e[0]||o(e[0])?(t.canvas=e[0]||null,t.options=i.clone(e[1])):t.options=i.clone(e[0]),t},i),ee=(l={},s=function(e,t,n){var r=e[t];return e[t]=function(){var e=Array.prototype.slice.call(arguments);return n.apply(this,[e,r])},r},l.baseUrlRespectingXhr=function(e,t){return function(){var n=new e;return s(n,"open",function(e,n){var r=e.shift(),i=e.shift(),a=Q.joinUrl(t,i);return n.apply(this,[r,a].concat(e))}),n}},l.finishNotifyingXhr=function(e){var t,n=0,r=0,i=!1,a=new Promise(function(e){t=function(){n-r<=0&&i&&e({totalCount:n})}}),o=function(){var i=new e;return s(i,"send",function(e,t){return n+=1,t.apply(this,arguments)}),i.addEventListener("load",function(){r+=1,t()}),i};return o.waitForRequestsToFinish=function(){return i=!0,t(),a},o},l),et=(c={},u=function(e){return Array.prototype.slice.call(e)},c.addClassName=function(e,t){e.className+=" "+t},c.addClassNameRecursively=function(e,t){c.addClassName(e,t),e.parentNode!==e.ownerDocument&&c.addClassNameRecursively(e.parentNode,t)},d=function(e,t){var n=e.parentStyleSheet,r=u(n.cssRules).indexOf(e);n.insertRule(t,r+1),n.deleteRule(r)},h=function(e,t){var n=e.cssText.replace(/^[^\{]+/,"");d(e,t+" "+n)},f=function(e){e.textContent=u(e.sheet.cssRules).reduce(function(e,t){return e+t.cssText},"")},p=function(e){var t=document.implementation.createHTMLDocument(""),n=document.createElement("style");n.textContent=e.textContent,t.body.appendChild(n),e.sheet=n.sheet},m=function(e,t,n){var r="((?:^|[^.#:\\w])|(?=\\W))("+t.join("|")+")(?=\\W|$)";
1u(e.querySelectorAll("style")).forEach(function(e){void 0===e.sheet&&p(e);var t=u(e.sheet.cssRules).filter(function(e){return e.selectorText&&RegExp(r,"i").test(e.selectorText)});t.length&&(t.forEach(function(e){var t=e.selectorText.replace(RegExp(r,"gi"),function(e,t,r){return t+n(r)});t!==e.selectorText&&h(e,t)}),f(e))})},c.rewriteCssSelectorWith=function(e,t,n){m(e,[t],function(){return n})},c.lowercaseCssTypeSelectors=function(e,t){m(e,t,function(e){return e.toLowerCase()})},c.findHtmlOnlyNodeNames=function(e){var t,n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r={},i={};do t=n.currentNode.tagName.toLowerCase(),"http://www.w3.org/1999/xhtml"===n.currentNode.namespaceURI?r[t]=!0:i[t]=!0;while(n.nextNode());return Object.keys(r).filter(function(e){return!i[e]})},g={},v=function(e){return Array.prototype.slice.call(e)},b={active:!0,hover:!0,focus:!1,target:!1},g.fakeUserAction=function(e,t,n){var r=e.querySelector(t),i="rasterizehtml"+n;r&&(b[n]?c.addClassNameRecursively(r,i):c.addClassName(r,i),c.rewriteCssSelectorWith(e,":"+n,"."+i))},g.persistInputValues=function(e){var t=e.querySelectorAll("input"),n=e.querySelectorAll("textarea"),r=function(e){return"checkbox"===e.type||"radio"===e.type};v(t).filter(r).forEach(function(e){e.checked?e.setAttribute("checked",""):e.removeAttribute("checked")}),v(t).filter(function(e){return!r(e)}).forEach(function(e){e.setAttribute("value",e.value)}),v(n).forEach(function(e){e.textContent=e.value})},g.rewriteTagNameSelectorsToLowerCase=function(e){c.lowercaseCssTypeSelectors(e,c.findHtmlOnlyNodeNames(e))},g),en=(y=window,w={},x=function(e,t,n,r){var i=e.createElement(t);return i.style.visibility="hidden",i.style.width=n+"px",i.style.height=r+"px",i.style.position="absolute",i.style.top=-1e4-r+"px",i.style.left=-1e4-n+"px",e.getElementsByTagName("body")[0].appendChild(i),i},w.executeJavascript=function(e,t){return new Promise(function(n){var r=x(y.document,"iframe",t.width,t.height),i=e.outerHTML,a=[],o=t.executeJsTimeout||0,l=function(){y.document.getElementsByTagName("body")[0].removeChild(r)},s=function(){n({document:r.contentDocument,errors:a,cleanUp:l})},c=r.contentWindow.XMLHttpRequest,u=ee.finishNotifyingXhr(c),d=ee.baseUrlRespectingXhr(u,t.baseUrl);r.onload=function(){(o>0?new Promise(function(e){setTimeout(e,o)}):Promise.resolve()).then(u.waitForRequestsToFinish).then(s)},r.contentDocument.open(),r.contentWindow.XMLHttpRequest=d,r.contentWindow.onerror=function(e){a.push({resourceType:"scriptExecution",msg:e})},r.contentDocument.write("<!DOCTYPE html>"),r.contentDocument.write(i),r.contentDocument.close()})},C=function(e,t,n){var r=e.createElement("iframe");return r.style.width=t+"px",r.style.height=n+"px",r.style.visibility="hidden",r.style.position="absolute",r.style.top=-1e4-n+"px",r.style.left=-1e4-t+"px",r.style.borderWidth=0,r.sandbox="allow-same-origin",r.scrolling="no",r},E=function(e,t){var n=e.querySelector(t);if(n)return n;if(e.ownerDocument.querySelector(t)===e)return e;throw{message:"Clipping selector not found"}},k=function(e,t,n,r,i){var a,o,l,s,c,u,d,h,f=Math.max(e.scrollWidth,e.clientWidth),p=Math.max(e.scrollHeight,e.clientHeight);return t?(o=(d=E(e,t).getBoundingClientRect()).top,l=d.left,s=d.width,c=d.height):(o=0,l=0,s=f,c=p),h={width:Math.max((a={width:s,height:c}).width*i,n),height:Math.max(a.height*i,r)},u=y.getComputedStyle(e.ownerDocument.documentElement).fontSize,{left:l,top:o,width:h.width,height:h.height,viewportWidth:f,viewportHeight:p,rootFontSize:u}},S=function(e,t){var n=e.tagName;return t.querySelector(n)},T=function(e){var t=e.tagName.toLowerCase();return"html"===t||"body"===t?e.outerHTML:'<body style="margin: 0;">'+e.outerHTML+"</body>"},w.calculateDocumentContentSize=function(e,t){return new Promise(function(n,r){var i,a,o,l=t.zoom||1;i=t.width,a=t.height,o=C(y.document,Math.floor(i/l),Math.floor(a/l)),y.document.getElementsByTagName("body")[0].appendChild(o),o.onload=function(){var i,a=o.contentDocument;try{i=k(S(e,a),t.clip,t.width,t.height,l),n(i)}catch(e){r(e)}finally{y.document.getElementsByTagName("body")[0].removeChild(o)}},o.contentDocument.open(),o.contentDocument.write("<!DOCTYPE html>"),o.contentDocument.write(T(e)),o.contentDocument.close()})},w.parseHtmlFragment=function(e){var t=y.document.implementation.createHTMLDocument("");t.documentElement.innerHTML=e;var n=t.querySelector("body").firstChild;if(!n)throw"Invalid source";return n},P=function(e,t){var n,r,i,a,o=/<html((?:\s+[^>]*)?)>/im.exec(t),l=y.document.implementation.createHTMLDocument("");
1if(o)for(r=0,n="<div"+o[1]+"></div>",l.documentElement.innerHTML=n,i=l.querySelector("div");r<i.attributes.length;r++)a=i.attributes[r],e.documentElement.setAttribute(a.name,a.value)},w.parseHTML=function(e){var t=y.document.implementation.createHTMLDocument("");return t.documentElement.innerHTML=e,P(t,e),t},M=function(e){try{return n.failOnParseError(e)}catch(e){throw{message:"Invalid source",originalError:e}}},w.validateXHTML=function(e){M(new DOMParser().parseFromString(e,"application/xml"))},R=null,w.loadDocument=function(e,t){return new Promise(function(n,r){var i,a,o=new window.XMLHttpRequest,l=(i=Q.joinUrl(t.baseUrl,e),"none"===(a=t.cache)||"repeated"===a?((null===R||"repeated"!==a)&&(R=Date.now()),i+"?_="+R):i),s=function(e){r({message:"Unable to load page",originalError:e})};o.addEventListener("load",function(){200===o.status||0===o.status?n(o.responseXML):s(o.statusText)},!1),o.addEventListener("error",function(e){s(e)},!1);try{o.open("GET",l,!0),o.responseType="document",o.send(null)}catch(e){s(e)}}).then(function(e){return M(e)})},w),er=(window,L={},_=function(e,t){return t?URL.createObjectURL(new Blob([e],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(e)},I=function(e){e instanceof Blob&&URL.revokeObjectURL(e)},O='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',D=function(e){return new Promise(function(t,n){var r=document.createElement("canvas"),i=new Image;i.onload=function(){var e=r.getContext("2d");try{e.drawImage(i,0,0),r.toDataURL("image/png"),t(!0)}catch(e){t(!1)}},i.onerror=n,i.src=e})},z=function(){var e=_(O,!0);return D(e).then(function(t){return I(e),!t&&D(_(O,!1)).then(function(e){return e})},function(){return!1})},L.renderSvg=function(e){return new Promise(function(t,n){var r,i,a=function(){i.onload=null,i.onerror=null},o=function(){r&&I(r)};(i=new Image).onload=function(){a(),o(),t(i)},i.onerror=function(){o(),n()},(void 0===A&&(A=new Promise(function(e,t){z().then(function(t){e(!t)},function(){t()})})),A).then(function(t){return _(e,t)}).then(function(e){r=e,i.src=r},n)})},L),ei=(N={},F=function(e,t){var n=t||1,r={width:e.width,height:e.height,"font-size":e.rootFontSize};return 1!==n&&(r.style="transform:scale("+n+"); transform-origin: 0 0;"),r},B=function(e){var t,n;return t=Math.round(e.viewportWidth),n=Math.round(e.viewportHeight),{x:-e.left,y:-e.top,width:t,height:n}},H=function(e){var t=e.style||"";e.style=t+"float: left;"},V=function(e){e.externalResourcesRequired=!0},j=function(e){var t=Object.keys(e);return t.length?" "+t.map(function(t){return t+'="'+e[t]+'"'}).join(" "):""},$=function(e,n,r){var i=t.serializeToString(e);en.validateXHTML(i);var a=B(n);return H(a),V(a),'<svg xmlns="http://www.w3.org/2000/svg"'+j(F(n,r))+'><style scoped="">html::-webkit-scrollbar { display: none; }</style><foreignObject'+j(a)+">"+i+"</foreignObject></svg>"},N.getSvgForDocument=function(e,t,n){return et.rewriteTagNameSelectorsToLowerCase(e),$(e,t,n)},N.drawDocumentAsSvg=function(e,t){return["hover","active","focus","target"].forEach(function(n){t[n]&&et.fakeUserAction(e,t[n],n)}),en.calculateDocumentContentSize(e,t).then(function(n){return N.getSvgForDocument(e,n,t.zoom)})},N),ea=(U={},W=function(e){return{message:"Error rendering page",originalError:e}},G=function(e){return er.renderSvg(e).then(function(t){return{image:t,svg:e}},function(e){throw W(e)})},q=function(e,t){try{t.getContext("2d").drawImage(e,0,0)}catch(e){throw W(e)}},U.rasterize=function(e,t,n){var i;return(i=Q.clone(n)).inlineScripts=!0===n.executeJs,r.inlineReferences(e,i).then(function(t){return n.executeJs?en.executeJavascript(e,n).then(function(e){var t=e.document;return et.persistInputValues(t),{document:t,errors:e.errors,cleanUp:e.cleanUp}}).then(function(e){return{element:e.document.documentElement,errors:t.concat(e.errors),cleanUp:e.cleanUp}}):{element:e,errors:t,cleanUp:function(){}}}).then(function(e){var r;return(r=e.element,ei.drawDocumentAsSvg(r,n).then(G).then(function(e){return t&&q(e.image,t),e})).then(function(t){return e.cleanUp(),{image:t.image,svg:t.svg,errors:e.errors}})})},U);return Z={},X=function(e,t){var n=e?e.width:300,r=e?e.height:200;return{width:void 0!==t.width?t.width:n,height:void 0!==t.height?t.height:r}},Y=function(e){var t,n=X(e.canvas,e.options);return(t=Q.clone(e.options)).width=n.width,t.height=n.height,t},Z.drawDocument=function(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1
1),n=Q.parseOptionalParameters(t),r=e.documentElement?e.documentElement:e;return ea.rasterize(r,n.canvas,Y(n))},K=function(e,t,n){var r=en.parseHTML(e);return Z.drawDocument(r,t,n)},Z.drawHTML=function(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1),n=Q.parseOptionalParameters(t);return K(e,n.canvas,n.options)},J=function(e,t,n){var r=document.implementation.createHTMLDocument("");r.replaceChild(e.documentElement,r.documentElement);var i=n?Q.clone(n):{};return n.baseUrl||(i.baseUrl=t),{document:r,options:i}},Z.drawURL=function(){var e,t,n=arguments[0],r=Array.prototype.slice.call(arguments,1),i=Q.parseOptionalParameters(r);return e=i.canvas,t=i.options,en.loadDocument(n,t).then(function(r){var i=J(r,n,t);return Z.drawDocument(i.document,e,i.options)})},Z},void 0===i&&void 0!==window&&(i=window),void 0!==(r=(function(e,t,n,r){return i.rasterizeHTML=a(e,t,n,r)}).apply(t,[n(9173),n(21227),n(2950),n(66307)]))&&(e.exports=r)},53449:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Alpha=void 0;var r=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},i=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}}(),a=n(7653),o=u(a),l=u(n(98746)),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(7062)),c=u(n(88186));function u(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var h=t.Alpha=function(e){function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);for(var e,n,r,i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r=d(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.handleChange=function(e){var t=s.calculateChange(e,r.props.hsl,r.props.direction,r.props.a,r.container);t&&"function"==typeof r.props.onChange&&r.props.onChange(t,e)},r.handleMouseDown=function(e){r.handleChange(e),window.addEventListener("mousemove",r.handleChange),window.addEventListener("mouseup",r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleChange),window.removeEventListener("mouseup",r.handleMouseUp)},d(r,n)}return!function(e,t){if("function"!=typeof t&&null!==t)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)}(t,e),i(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var e=this,t=this.props.rgb,n=(0,l.default)({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+t.r+","+t.g+","+t.b+", 0) 0%,\n rgba("+t.r+","+t.g+","+t.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:100*t.a+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+t.r+","+t.g+","+t.b+", 0) 0%,\n rgba("+t.r+","+t.g+","+t.b+", 1) 100%)"},pointer:{left:0,top:100*t.a+"%"}},overwrite:r({},this.props.style)},{vertical:"vertical"===this.props.direction,overwrite:!0});return o.default.createElement("div",{style:n.alpha},o.default.createElement("div",{style:n.checkboard},o.default.createElement(c.default,{renderers:this.props.renderers})),o.default.createElement("div",{style:n.gradient}),o.default.createElement("div",{style:n.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},o.default.createElement("div",{style:n.pointer},this.props.pointer?o.default.createElement(this.props.pointer,this.props):o.default.createElement("div",{style:n.slider}))))}}]),t}
1(a.PureComponent||a.Component);t.default=h},88186:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Checkboard=void 0;var r=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},i=n(7653),a=s(i),o=s(n(98746)),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(51849));function s(e){return e&&e.__esModule?e:{default:e}}var c=t.Checkboard=function(e){var t=e.white,n=e.grey,s=e.size,c=e.renderers,u=e.borderRadius,d=e.boxShadow,h=e.children,f=(0,o.default)({default:{grid:{borderRadius:u,boxShadow:d,absolute:"0px 0px 0px 0px",background:"url("+l.get(t,n,s,c.canvas)+") center left"}}});return(0,i.isValidElement)(h)?a.default.cloneElement(h,r({},h.props,{style:r({},h.props.style,f.grid)})):a.default.createElement("div",{style:f.grid})};c.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}},t.default=c},12323:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorWrap=void 0;var r=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},i=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}}(),a=n(7653),o=c(a),l=c(n(29860)),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(66948));function c(e){return e&&e.__esModule?e:{default:e}}var u=t.ColorWrap=function(e){var t=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return t.handleChange=function(e,n){if(s.simpleCheckForValidColor(e)){var r=s.toState(e,e.h||t.state.oldHue);t.setState(r),t.props.onChangeComplete&&t.debounce(t.props.onChangeComplete,r,n),t.props.onChange&&t.props.onChange(r,n)}},t.handleSwatchHover=function(e,n){if(s.simpleCheckForValidColor(e)){var r=s.toState(e,e.h||t.state.oldHue);t.props.onSwatchHover&&t.props.onSwatchHover(r,n)}},t.state=r({},s.toState(e.color,0)),t.debounce=(0,l.default)(function(e,t,n){e(t,n)},100),t}return!function(e,t){if("function"!=typeof t&&null!==t)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)}(n,t),i(n,[{key:"render",value:function(){var t={};return this.props.onSwatchHover&&(t.onSwatchHover=this.handleSwatchHover),o.default.createElement(e,r({},this.props,this.state,{onChange:this.handleChange},t))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return r({},s.toState(e.color,t.oldHue))}}]),n}(a.PureComponent||a.Component);return t.propTypes=r({},e.propTypes),t.defaultProps=r({},e.defaultProps,{color:{h:250,s:.5,l:.2,a:1}}),t};t.default=u},57302:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditableInput=void 0;var r=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}}(),i=n(7653),a=l(i),o=l(n(98746));function l(e){return e&&e.__esModule?e:{default:e}}var s=[38,40],c=1,u=t.EditableInput=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.handleBlur=function(){n.state.blurValue&&n.setState({value:n.state.blurValue,blurValue:null})},n.handleChange=function(e){n.setUpdatedValue(e.target.value,e)},n.handleKeyDown=function(e){var t,r=Number(String(e.target.value).replace(/%/g,""));if(!isNaN(r)&&(t=e.keyCode,s.indexOf(t)>-1)){var i=n.getArrowOffset(),a=38===e.keyCode?r+i:r-i;n.setUpdatedValue(a,e)}},n.handleDrag=function(e){if(n.props.dragLabel){var t=Math.round(n.props.value+e.movementX);t>=0&&t<=n.props.dragMax&&n.props.onChange&&n.props.onChange(n.getValueObjectWithLabel(t),e)}},n.handleMouseDown=function(e){n.props.dragLabel&&(e.preventDefault(),n.handleDrag(e),window.addEventListener("mousemove",n.handleDrag),window.addEventListener("mouseup",n.handleMouseUp))},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleDrag),window.removeEventListener("mouseup",n.handleMouseUp)},n.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},n.inputId="rc-editable-input-"+c++,n}return!function(e,t){if("function"!=typeof t&&null!==t)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)}
1(t,e),r(t,[{key:"componentDidUpdate",value:function(e,t){this.props.value!==this.state.value&&(e.value!==this.props.value||t.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(e){var t,n;return t={},(n=this.props.label)in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||1}},{key:"setUpdatedValue",value:function(e,t){var n=this.props.label?this.getValueObjectWithLabel(e):e;this.props.onChange&&this.props.onChange(n,t),this.setState({value:e})}},{key:"render",value:function(){var e=this,t=(0,o.default)({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return a.default.createElement("div",{style:t.wrap},a.default.createElement("input",{id:this.inputId,style:t.input,ref:function(t){return e.input=t},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?a.default.createElement("label",{htmlFor:this.inputId,style:t.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(i.PureComponent||i.Component);t.default=u},65570:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hue=void 0;var r=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}}(),i=n(7653),a=s(i),o=s(n(98746)),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(7027));function s(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var u=t.Hue=function(e){function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);for(var e,n,r,i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r=c(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.handleChange=function(e){var t=l.calculateChange(e,r.props.direction,r.props.hsl,r.container);t&&"function"==typeof r.props.onChange&&r.props.onChange(t,e)},r.handleMouseDown=function(e){r.handleChange(e),window.addEventListener("mousemove",r.handleChange),window.addEventListener("mouseup",r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},c(r,n)}return!function(e,t){if("function"!=typeof t&&null!==t)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)}(t,e),r(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var e=this,t=this.props.direction,n=void 0===t?"horizontal":t,r=(0,o.default)({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:100*this.props.hsl.h/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-(100*this.props.hsl.h/360)+100+"%"}}},{vertical:"vertical"===n});return a.default.createElement("div",{style:r.hue},a.default.createElement("div",{className:"hue-"+n,style:r.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},a.default.createElement("style",null,"\n .hue-horizontal {\n background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0\n 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to right, #f00 0%, #ff0\n 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n\n .hue-vertical {\n background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,\n #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,\n #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n "),a.default.createElement("div",{style:r.pointer},this.props.pointer?a.default.createElement(this.props.pointer,this.props):a.default.createElement("div",{style:r.slider}))))}}]),t}(i.PureComponent||i.Component);t.default=u},89171:function(e,t,n){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.Raised=void 0;var r=l(n(7653)),i=l(n(63074)),a=l(n(98746)),o=l(n(79491));function l(e){return e&&e.__esModule?e:{default:e}}var s=t.Raised=function(e){var t=e.zDepth,n=e.radius,i=e.background,l=e.children,s=e.styles,c=(0,a.default)((0,o.default)({default:{wrap:{position:"relative",display:"inline-block"},content:{position:"relative"},bg:{absolute:"0px 0px 0px 0px",boxShadow:"0 "+t+"px "+4*t+"px rgba(0,0,0,.24)",borderRadius:n,background:i}},"zDepth-0":{bg:{boxShadow:"none"}},"zDepth-1":{bg:{boxShadow:"0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16)"}},"zDepth-2":{bg:{boxShadow:"0 6px 20px rgba(0,0,0,.19), 0 8px 17px rgba(0,0,0,.2)"}},"zDepth-3":{bg:{boxShadow:"0 17px 50px rgba(0,0,0,.19), 0 12px 15px rgba(0,0,0,.24)"}},"zDepth-4":{bg:{boxShadow:"0 25px 55px rgba(0,0,0,.21), 0 16px 28px rgba(0,0,0,.22)"}},"zDepth-5":{bg:{boxShadow:"0 40px 77px rgba(0,0,0,.22), 0 27px 24px rgba(0,0,0,.2)"}},square:{bg:{borderRadius:"0"}},circle:{bg:{borderRadius:"50%"}}},void 0===s?{}:s),{"zDepth-1":1===t});return r.default.createElement("div",{style:c.wrap},r.default.createElement("div",{style:c.bg}),r.default.createElement("div",{style:c.content},l))};s.propTypes={background:i.default.string,zDepth:i.default.oneOf([0,1,2,3,4,5]),radius:i.default.number,styles:i.default.object},s.defaultProps={background:"#fff",zDepth:1,radius:2,styles:{}},t.default=s},59387:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Saturation=void 0;var r=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}}(),i=n(7653),a=c(i),o=c(n(98746)),l=c(n(10205)),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(17974));function c(e){return e&&e.__esModule?e:{default:e}}var u=t.Saturation=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleChange=function(e){"function"==typeof n.props.onChange&&n.throttle(n.props.onChange,s.calculateChange(e,n.props.hsl,n.container),e)},n.handleMouseDown=function(e){n.handleChange(e);var t=n.getContainerRenderWindow();t.addEventListener("mousemove",n.handleChange),t.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.throttle=(0,l.default)(function(e,t,n){e(t,n)},50),n}return!function(e,t){if("function"!=typeof t&&null!==t)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)}(t,e),r(t,[{key:"componentWillUnmount",value:function(){this.throttle.cancel(),this.unbindEventListeners()}},{key:"getContainerRenderWindow",value:function(){for(var e=this.container,t=window;!t.document.contains(e)&&t.parent!==t;)t=t.parent;return t}},{key:"unbindEventListeners",value:function(){var e=this.getContainerRenderWindow();e.removeEventListener("mousemove",this.handleChange),e.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var e=this,t=this.props.style||{},n=t.color,r=t.white,i=t.black,l=t.pointer,s=t.circle,c=(0,o.default)({default:{color:{absolute:"0px 0px 0px 0px",background:"hsl("+this.props.hsl.h+",100%, 50%)",borderRadius:this.props.radius},white:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},black:{absolute:"0px 0px 0px 0px",boxShadow:this.props.shadow,borderRadius:this.props.radius},pointer:{position:"absolute",top:-(100*this.props.hsv.v)+100+"%",left:100*this.props.hsv.s+"%",cursor:"default"},circle:{width:"4px",height:"4px",boxShadow:"0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),\n 0 0 1px 2px rgba(0,0,0,.4)",borderRadius:"50%",cursor:"hand",transform:"translate(-2px, -2px)"}},custom:{color:n,white:r,black:i,pointer:l,circle:s}},{custom:!!this.props.style});return a.default.createElement("div",{style:c.color,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},a.default.createElement("style",null,"\n .saturation-white {\n background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));\n background: linear-gradient(to right, #fff, rgba(255,255,255,0));\n }\n .saturation-black {\n background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));\n background: linear-gradient(to top, #000, rgba(0,0,0,0));\n }\n "),a.default.createElement("div",{style:c.white,className:"saturation-white"},a.default.createElement("div",{style:c.black,className:"saturation-black"}),a.default.createElement("div",{style:c.pointer},this.props.pointer?a.default.createElement(this.props.pointer,this.props):a.default.createElement("div",{style:c.circle}))))}}]),t}(i.PureComponent||i.Component);t.default=u},39095:function(e,t,n){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.Swatch=void 0;var r=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},i=s(n(7653)),a=s(n(98746)),o=n(23786),l=s(n(88186));function s(e){return e&&e.__esModule?e:{default:e}}var c=t.Swatch=function(e){var t=e.color,n=e.style,o=e.onClick,s=void 0===o?function(){}:o,c=e.onHover,u=e.title,d=void 0===u?t:u,h=e.children,f=e.focus,p=e.focusStyle,m="transparent"===t,g=(0,a.default)({default:{swatch:r({background:t,height:"100%",width:"100%",cursor:"pointer",position:"relative",outline:"none"},n,f?void 0===p?{}:p:{})}}),v={};return c&&(v.onMouseOver=function(e){return c(t,e)}),i.default.createElement("div",r({style:g.swatch,onClick:function(e){return s(t,e)},title:d,tabIndex:0,onKeyDown:function(e){return 13===e.keyCode&&s(t,e)}},v),h,m&&i.default.createElement(l.default,{borderRadius:g.swatch.borderRadius,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.1)"}))};t.default=(0,o.handleFocus)(c)},41233:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(53449);Object.defineProperty(t,"Alpha",{enumerable:!0,get:function(){return d(r).default}});var i=n(88186);Object.defineProperty(t,"Checkboard",{enumerable:!0,get:function(){return d(i).default}});var a=n(57302);Object.defineProperty(t,"EditableInput",{enumerable:!0,get:function(){return d(a).default}});var o=n(65570);Object.defineProperty(t,"Hue",{enumerable:!0,get:function(){return d(o).default}});var l=n(89171);Object.defineProperty(t,"Raised",{enumerable:!0,get:function(){return d(l).default}});var s=n(59387);Object.defineProperty(t,"Saturation",{enumerable:!0,get:function(){return d(s).default}});var c=n(12323);Object.defineProperty(t,"ColorWrap",{enumerable:!0,get:function(){return d(c).default}});var u=n(39095);function d(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"Swatch",{enumerable:!0,get:function(){return d(u).default}})},14852:function(e,t,n){"use strict";t.mG=void 0;var r=l(n(7653)),i=l(n(98746)),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(66948)),o=n(41233);function l(e){return e&&e.__esModule?e:{default:e}}t.mG=function(e){var t=e.onChange,n=e.rgb,l=e.hsl,s=e.hex,c=e.disableAlpha,u=(0,i.default)({default:{fields:{display:"flex",paddingTop:"4px"},single:{flex:"1",paddingLeft:"6px"},alpha:{flex:"1",paddingLeft:"6px"},double:{flex:"2"},input:{width:"80%",padding:"4px 10% 3px",border:"none",boxShadow:"inset 0 0 0 1px #ccc",fontSize:"11px"},label:{display:"block",textAlign:"center",fontSize:"11px",color:"#222",paddingTop:"3px",paddingBottom:"4px",textTransform:"capitalize"}},disableAlpha:{alpha:{display:"none"}}},{disableAlpha:c}),d=function(e,r){e.hex?a.isValidHex(e.hex)&&t({hex:e.hex,source:"hex"},r):e.r||e.g||e.b?t({r:e.r||n.r,g:e.g||n.g,b:e.b||n.b,a:n.a,source:"rgb"},r):e.a&&(e.a<0?e.a=0:e.a>100&&(e.a=100),e.a/=100,t({h:l.h,s:l.s,l:l.l,a:e.a,source:"rgb"},r))};return r.default.createElement("div",{style:u.fields,className:"flexbox-fix"},r.default.createElement("div",{style:u.double},r.default.createElement(o.EditableInput,{style:{input:u.input,label:u.label},label:"hex",value:s.replace("#",""),onChange:d})),r.default.createElement("div",{style:u.single},r.default.createElement(o.EditableInput,{style:{input:u.input,label:u.label},label:"r",value:n.r,onChange:d,dragLabel:"true",dragMax:"255"})),r.default.createElement("div",{style:u.single},r.default.createElement(o.EditableInput,{style:{input:u.input,label:u.label},label:"g",value:n.g,onChange:d,dragLabel:"true",dragMax:"255"})),r.default.createElement("div",{style:u.single},r.default.createElement(o.EditableInput,{style:{input:u.input,label:u.label},label:"b",value:n.b,onChange:d,dragLabel:"true",dragMax:"255"})),r.default.createElement("div",{style:u.alpha},r.default.createElement(o.EditableInput,{style:{input:u.input,label:u.label},label:"a",value:Math.round(100*n.a),onChange:d,dragLabel:"true",dragMax:"100"})))}},83103:function(e,t,n){"use strict";t.Yd=void 0;var r=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},i=s(n(7653)),a=s(n(63074)),o=s(n(98746)),l=n(41233);
1function s(e){return e&&e.__esModule?e:{default:e}}(t.Yd=function(e){var t=e.colors,n=e.onClick,a=void 0===n?function(){}:n,s=e.onSwatchHover,c=(0,o.default)({default:{colors:{margin:"0 -10px",padding:"10px 0 0 10px",borderTop:"1px solid #eee",display:"flex",flexWrap:"wrap",position:"relative"},swatchWrap:{width:"16px",height:"16px",margin:"0 10px 10px 0"},swatch:{borderRadius:"3px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15)"}},"no-presets":{colors:{display:"none"}}},{"no-presets":!t||!t.length}),u=function(e,t){a({hex:e,source:"hex"},t)};return i.default.createElement("div",{style:c.colors,className:"flexbox-fix"},t.map(function(e){var t="string"==typeof e?{color:e}:e,n=""+t.color+(t.title||"");return i.default.createElement("div",{key:n,style:c.swatchWrap},i.default.createElement(l.Swatch,r({},t,{style:c.swatch,onClick:u,onHover:s,focusStyle:{boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), 0 0 4px "+t.color}})))}))}).propTypes={colors:a.default.arrayOf(a.default.oneOfType([a.default.string,a.default.shape({color:a.default.string,title:a.default.string})])).isRequired}},7062:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateChange=function(e,t,n,r,i){var a=i.clientWidth,o=i.clientHeight,l="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,s="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,c=l-(i.getBoundingClientRect().left+window.pageXOffset),u=s-(i.getBoundingClientRect().top+window.pageYOffset);if("vertical"===n){var d=void 0;if(d=u<0?0:u>o?1:Math.round(100*u/o)/100,t.a!==d)return{h:t.h,s:t.s,l:t.l,a:d,source:"rgb"}}else{var h=void 0;if(r!==(h=c<0?0:c>a?1:Math.round(100*c/a)/100))return{h:t.h,s:t.s,l:t.l,a:h,source:"rgb"}}return null}},51849:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={},r=t.render=function(e,t,n,r){if("undefined"==typeof document&&!r)return null;var i=r?new r:document.createElement("canvas");i.width=2*n,i.height=2*n;var a=i.getContext("2d");return a?(a.fillStyle=e,a.fillRect(0,0,i.width,i.height),a.fillStyle=t,a.fillRect(0,0,n,n),a.translate(n,n),a.fillRect(0,0,n,n),i.toDataURL()):null};t.get=function(e,t,i,a){var o=e+"-"+t+"-"+i+(a?"-server":"");if(n[o])return n[o];var l=r(e,t,i,a);return n[o]=l,l}},66948:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isvalidColorString=t.red=t.getContrastingColor=t.isValidHex=t.toState=t.simpleCheckForValidColor=void 0;var r=a(n(48325)),i=a(n(4878));function a(e){return e&&e.__esModule?e:{default:e}}t.simpleCheckForValidColor=function(e){var t=0,n=0;return(0,r.default)(["r","g","b","a","h","s","l","v"],function(r){e[r]&&(t+=1,isNaN(e[r])||(n+=1),("s"===r||"l"===r)&&/^\d+%$/.test(e[r])&&(n+=1))}),t===n&&e};var o=t.toState=function(e,t){var n=e.hex?(0,i.default)(e.hex):(0,i.default)(e),r=n.toHsl(),a=n.toHsv(),o=n.toRgb(),l=n.toHex();return 0===r.s&&(r.h=t||0,a.h=t||0),{hsl:r,hex:"000000"===l&&0===o.a?"transparent":"#"+l,rgb:o,hsv:a,oldHue:e.h||t||r.h,source:e.source}};t.isValidHex=function(e){if("transparent"===e)return!0;var t="#"===String(e).charAt(0)?1:0;return e.length!==4+t&&e.length<7+t&&(0,i.default)(e).isValid()},t.getContrastingColor=function(e){if(!e)return"#fff";var t=o(e);return"transparent"===t.hex?"rgba(0,0,0,0.4)":(299*t.rgb.r+587*t.rgb.g+114*t.rgb.b)/1e3>=128?"#000":"#fff"},t.red={hsl:{a:1,h:0,l:.5,s:1},hex:"#ff0000",rgb:{r:255,g:0,b:0,a:1},hsv:{h:0,s:1,v:1,a:1}},t.isvalidColorString=function(e,t){var n=e.replace("\xb0","");return(0,i.default)(t+" ("+n+")")._ok}},7027:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateChange=function(e,t,n,r){var i=r.clientWidth,a=r.clientHeight,o="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,l="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,s=o-(r.getBoundingClientRect().left+window.pageXOffset),c=l-(r.getBoundingClientRect().top+window.pageYOffset);if("vertical"===t){var u=void 0;if(u=c<0?359:c>a?0:360*(-(100*c/a)+100)/100,n.h!==u)return{h:u,s:n.s,l:n.l,a:n.a,source:"hsl"}}else{var d=void 0;if(d=s<0?0:s>i?359:100*s/i*360/100,n.h!==d)return{h:d,s:n.s,l:n.l,a:n.a,source:"hsl"}}return null}},23786:function(e,t,n){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.handleFocus=void 0;var r,i=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},a=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}}(),o=(r=n(7653))&&r.__esModule?r:{default:r};function l(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}t.handleFocus=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function r(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r);for(var e,t,n,i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];return t=n=l(this,(e=r.__proto__||Object.getPrototypeOf(r)).call.apply(e,[this].concat(a))),n.state={focus:!1},n.handleFocus=function(){return n.setState({focus:!0})},n.handleBlur=function(){return n.setState({focus:!1})},l(n,t)}return!function(e,t){if("function"!=typeof t&&null!==t)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)}(r,n),a(r,[{key:"render",value:function(){return o.default.createElement(t,{onFocus:this.handleFocus,onBlur:this.handleBlur},o.default.createElement(e,i({},this.props,this.state)))}}]),r}(o.default.Component)}},17974:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateChange=function(e,t,n){var r=n.getBoundingClientRect(),i=r.width,a=r.height,o="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,l="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,s=o-(n.getBoundingClientRect().left+window.pageXOffset),c=l-(n.getBoundingClientRect().top+window.pageYOffset);s<0?s=0:s>i&&(s=i),c<0?c=0:c>a&&(c=a);var u=s/i,d=1-c/a;return{h:t.h,s:u,v:d,a:t.a,source:"hsv"}}},36015:function(e){var t="undefined"!=typeof Element,n="function"==typeof Map,r="function"==typeof Set,i="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;e.exports=function(e,a){try{return function e(a,o){if(a===o)return!0;if(a&&o&&"object"==typeof a&&"object"==typeof o){var l,s,c,u;if(a.constructor!==o.constructor)return!1;if(Array.isArray(a)){if((l=a.length)!=o.length)return!1;for(s=l;0!=s--;)if(!e(a[s],o[s]))return!1;return!0}if(n&&a instanceof Map&&o instanceof Map){if(a.size!==o.size)return!1;for(u=a.entries();!(s=u.next()).done;)if(!o.has(s.value[0]))return!1;for(u=a.entries();!(s=u.next()).done;)if(!e(s.value[1],o.get(s.value[0])))return!1;return!0}if(r&&a instanceof Set&&o instanceof Set){if(a.size!==o.size)return!1;for(u=a.entries();!(s=u.next()).done;)if(!o.has(s.value[0]))return!1;return!0}if(i&&ArrayBuffer.isView(a)&&ArrayBuffer.isView(o)){if((l=a.length)!=o.length)return!1;for(s=l;0!=s--;)if(a[s]!==o[s])return!1;return!0}if(a.constructor===RegExp)return a.source===o.source&&a.flags===o.flags;if(a.valueOf!==Object.prototype.valueOf&&"function"==typeof a.valueOf&&"function"==typeof o.valueOf)return a.valueOf()===o.valueOf();if(a.toString!==Object.prototype.toString&&"function"==typeof a.toString&&"function"==typeof o.toString)return a.toString()===o.toString();if((l=(c=Object.keys(a)).length)!==Object.keys(o).length)return!1;for(s=l;0!=s--;)if(!Object.prototype.hasOwnProperty.call(o,c[s]))return!1;if(t&&a instanceof Element)return!1;for(s=l;0!=s--;)if(("_owner"!==c[s]&&"__v"!==c[s]&&"__o"!==c[s]||!a.$$typeof)&&!e(a[c[s]],o[c[s]]))return!1;return!0}return a!=a&&o!=o}(e,a)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}},463:function(e,t,n){"use strict";n.d(t,{Vt:function(){return c},h_:function(){return u}});var r=n(7653),i=n(42291),a=n(46666),o=n(3458),l=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let s=e=>{let t=window.getComputedStyle(e).position;return!("absolute"===t||"relative"===t)},c=({children:e,groupProps:t,divProps:n,transform:c,transformFunc:u,parentNodeFunc:d})=>{let h=(0,a.jn)(),f=r.useRef(null),[p]=r.useState(()=>document.createElement("div")),m=r.useMemo(()=>i.createRoot(p),[p]),g=null==c||c,v=function(e=()=>{}){let t=r.useRef(e);return t.current=e,r.useCallback((...e)=>t.current.apply(null,e),[])}(()=>
1{if(g&&f.current){let e=f.current.getAbsoluteTransform().decompose();u&&(e=u(e)),p.style.position="absolute",p.style.zIndex="10",p.style.top="0px",p.style.left="0px",p.style.transform=`translate(${e.x}px, ${e.y}px) rotate(${e.rotation}deg) scaleX(${e.scaleX}) scaleY(${e.scaleY})`,p.style.transformOrigin="top left"}else p.style.position="",p.style.zIndex="",p.style.top="",p.style.left="",p.style.transform="",p.style.transformOrigin="";let e=n||{},{style:t}=e,r=l(e,["style"]);Object.assign(p.style,t),Object.assign(p,r)});return r.useLayoutEffect(()=>{var e;let t=f.current;if(!t)return;let n=d?d({stage:t.getStage()}):null===(e=t.getStage())||void 0===e?void 0:e.container();if(n)return n.appendChild(p),g&&s(n)&&(n.style.position="relative"),t.on("absoluteTransformChange",v),v(),()=>{var e;t.off("absoluteTransformChange",v),null===(e=p.parentNode)||void 0===e||e.removeChild(p)}},[g,d]),r.useLayoutEffect(()=>{v()},[n,u]),r.useLayoutEffect(()=>{queueMicrotask(()=>{(0,o.flushSync)(()=>{m.render(r.createElement(h,null,e))})})}),r.useLayoutEffect(()=>()=>{setTimeout(()=>{m.unmount()})},[]),r.createElement(a.ZA,Object.assign({ref:f},t))},u=({selector:e,enabled:t,children:n})=>{let i=r.useRef(null),o=r.useRef(null),l=r.useRef(null),s=null==t||t;return r.useLayoutEffect(()=>{if(!i.current||!o.current)return;l.current=o.current;let t=i.current.getStage().findOne(e);s&&t?o.current.moveTo(t):o.current.moveTo(i.current);let n=i.current.getLayer();if(n&&(n.batchDraw(),t)){let e=t.getLayer();if(!e)return;e.batchDraw()}},[e,s]),r.useEffect(()=>()=>{var e;null===(e=l.current)||void 0===e||e.destroy()},[]),r.createElement(a.ZA,{name:"_outer_portal",ref:i},r.createElement(a.ZA,{name:"_inner_portal",ref:o},n))};n(82070)},46666:function(e,t,n){"use strict";n.d(t,{wN:function(){return eA},Cd:function(){return eS},ZA:function(){return eC},Ee:function(){return eP},u4:function(){return eO},__:function(){return eE},mh:function(){return ex},x1:function(){return eT},y$:function(){return e_},UL:function(){return ek},Hf:function(){return eD},Vp:function(){return eL},xv:function(){return eM},XF:function(){return eR},$T:function(){return eI},jn:function(){return ey}});var r,i,a={};n.r(a),n.d(a,{appendChild:function(){return U},appendChildToContainer:function(){return W},appendInitialChild:function(){return k},cancelTimeout:function(){return F},clearContainer:function(){return er},commitMount:function(){return K},commitTextUpdate:function(){return Y},commitUpdate:function(){return J},createInstance:function(){return S},createTextInstance:function(){return T},detachDeletedInstance:function(){return ei},finalizeInitialChildren:function(){return P},getChildHostContext:function(){return z},getCurrentEventPriority:function(){return ea},getPublicInstance:function(){return M},getRootHostContext:function(){return D},hideInstance:function(){return Q},hideTextInstance:function(){return ee},idlePriority:function(){return x.unstable_IdlePriority},insertBefore:function(){return G},insertInContainerBefore:function(){return q},isPrimaryRenderer:function(){return V},noTimeout:function(){return B},now:function(){return x.unstable_now},prepareForCommit:function(){return R},preparePortalMount:function(){return A},prepareUpdate:function(){return L},removeChild:function(){return Z},removeChildFromContainer:function(){return X},resetAfterCommit:function(){return _},resetTextContent:function(){return I},run:function(){return x.unstable_runWithPriority},scheduleTimeout:function(){return N},shouldDeprioritizeSubtree:function(){return O},shouldSetTextContent:function(){return H},supportsMutation:function(){return $},unhideInstance:function(){return et},unhideTextInstance:function(){return en},warnsIfNotActing:function(){return j}}),n(8585);var o=n(7653),l=n(53713).S,s=n(81263),c=n.n(s),u=n(91270),d=n(33118);let h={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0},f=!1,p=!1,m=".react-konva-event",g=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled. 2Position of a node will be changed during drag&drop, so you should update state of the react app as well. 3Consider to add onDragMove or onDragEnd events. 4For more info see: https://github.com/konvajs/react-konva/issues/256 5`,v=`ReactKonva: You are using "zIndex" attribute for a Konva node. 6react-konva may get confused with ordering. Just define correct order of elements in your render function of a component. 7For more info see: https://github.com/konvajs/react-konva/issues/194 8`,b={};function y(e,t,n=b){if(!f&&"zIndex"in t&&(console.warn(v),f=!0),!p&&t.draggable){var r=void 0!==t.x||void 0!==t.y,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(g),p=!0)}for(var a in n)if(!h[a]){var o="on"===a.slice(0,2),l=n[a]!==t[a];if(o&&l){var s=a.substr(2).toLowerCase();"content"===s.substr(0,7)&&(s="content"+s.substr(7,1).toUpperCase()+s.substr(8)),e.off(s,n[a])}t.hasOwnProperty(a)||e.setAttr(a,void 0)}var c=t._useStrictMode,u={},d=!1;let y={};for(var a in t)if(!h[a]){var o="on"===a.slice(0,2),x=n[a]!==t[a];if(o&&x){var s=a.substr(2).toLowerCase();"content"===s.substr(0,7)&&(s="content"+s.substr(7,1).toUpperCase()+s.substr(8)),t[a]&&(y[s]=t[a])}!o&&(t[a]!==n[a]||c&&t[a]!==e.getAttr(a))&&(d=!0,u[a]=t[a])}for(var s in d&&(e.setAttrs(u),w(e)),y)e.on(s+m,y[s])}function w(e){if(!d.So.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}var x=n(19714);let C={},E={};function k(e,t){if("string"==typeof t){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),w(e)}function S(e,t,n){let r=l[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=l.Group);let i={},a={};
8for(var o in t)"on"===o.slice(0,2)?a[o]=t[o]:i[o]=t[o];let s=new r(i);return y(s,a),s}function T(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function P(e,t,n){return!1}function M(e){return e}function R(){return null}function A(){return null}function L(e,t,n,r){return E}function _(){}function I(e){}function O(e,t){return!1}function D(){return C}function z(){return C}l.Node.prototype._applyProps=y;let N=setTimeout,F=clearTimeout,B=-1;function H(e,t){return!1}let V=!1,j=!0,$=!0;function U(e,t){t.parent===e?t.moveToTop():e.add(t),w(e)}function W(e,t){t.parent===e?t.moveToTop():e.add(t),w(e)}function G(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),w(e)}function q(e,t,n){G(e,t,n)}function Z(e,t){t.destroy(),t.off(m),w(e)}function X(e,t){t.destroy(),t.off(m),w(e)}function Y(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function K(e,t,n){}function J(e,t,n,r,i){y(e,i,r)}function Q(e){e.hide(),w(e)}function ee(e){}function et(e,t){(null==t.visible||t.visible)&&e.show()}function en(e,t){}function er(e){}function ei(){}let ea=()=>u.DefaultEventPriority;var eo=Object.defineProperty,el=Object.defineProperties,es=Object.getOwnPropertyDescriptors,ec=Object.getOwnPropertySymbols,eu=Object.prototype.hasOwnProperty,ed=Object.prototype.propertyIsEnumerable,eh=(e,t,n)=>t in e?eo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ef=(e,t)=>{for(var n in t||(t={}))eu.call(t,n)&&eh(e,n,t[n]);if(ec)for(var n of ec(t))ed.call(t,n)&&eh(e,n,t[n]);return e},ep=(e,t)=>el(e,es(t));function em(e){try{return Object.defineProperties(e,{_currentRenderer:{get:()=>null,set(){}},_currentRenderer2:{get:()=>null,set(){}}})}catch(t){return e}}"undefined"!=typeof window&&((null==(r=window.document)?void 0:r.createElement)||(null==(i=window.navigator)?void 0:i.product)==="ReactNative")?o.useLayoutEffect:o.useEffect;let eg=console.error;console.error=function(){let e=[...arguments].join("");if((null==e?void 0:e.startsWith("Warning:"))&&e.includes("useContext")){console.error=eg;return}return eg.apply(this,arguments)};let ev=em(o.createContext(null));class eb extends o.Component{render(){return o.createElement(ev.Provider,{value:this._reactInternals},this.props.children)}}function ey(){let e=function(){let e=function(){let e=o.useContext(ev);if(null===e)throw Error("its-fine: useFiber must be called within a <FiberProvider />!");let t=o.useId();return o.useMemo(()=>{for(let n of[e,null==e?void 0:e.alternate]){if(!n)continue;let e=function e(t,n,r){if(!t)return;if(!0===r(t))return t;let i=n?t.return:t.child;for(;i;){let t=e(i,n,r);if(t)return t;i=n?null:i.sibling}}(n,!1,e=>{let n=e.memoizedState;for(;n;){if(n.memoizedState===t)return!0;n=n.next}});if(e)return e}},[e,t])}(),[t]=o.useState(()=>new Map);t.clear();let n=e;for(;n;){if(n.type&&"object"==typeof n.type){let e=void 0===n.type._context&&n.type.Provider===n.type?n.type:n.type._context;e&&e!==ev&&!t.has(e)&&t.set(e,o.useContext(em(e)))}n=n.return}return t}();return o.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>o.createElement(t,null,o.createElement(n.Provider,ep(ef({},r),{value:e.get(n)}))),e=>o.createElement(eb,ef({},e))),[e])}let ew=e=>{let t=o.useRef(null),n=o.useRef(null),r=o.useRef(null),i=function(e){let t=o.useRef({});return o.useLayoutEffect(()=>{t.current=e}),o.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}(e),a=ey(),s=t=>{let{forwardedRef:n}=e;n&&("function"==typeof n?n(t):n.current=t)};return o.useLayoutEffect(()=>(n.current=new l.Stage({width:e.width,height:e.height,container:t.current}),s(n.current),r.current=eO.createContainer(n.current,u.LegacyRoot,!1,null),eO.updateContainer(o.createElement(a,{},e.children),r.current),()=>{l.isBrowser&&(s(null),eO.updateContainer(null,r.current,null),n.current.destroy())}),[]),o.useLayoutEffect(()=>{s(n.current),y(n.current,e,i),eO.updateContainer(o.createElement(a,{},e.children),r.current,null)}),o.createElement("div",{ref:t,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},ex="Layer",eC="Group",eE="Label",ek="Rect",eS="Circle",eT="Line",eP="Image",eM="Text",eR="TextPath",eA="Arc",eL="Tag",e_="Path",eI="Transformer",eO=c()(a);eO.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:o.version,rendererPackageName:"react-konva"});let eD=o.forwardRef((e,t)=>
vendor: 29,164 bytes, line 8
8o.createElement(eb,{},o.createElement(ew,{...e,forwardedRef:t})))},21210:function(e,t){"use strict";t.DefaultEventPriority=16,t.LegacyRoot=0},72711:function(e,t,n){e.exports=function(e){"use strict";var t,r,i,a,o,l={},s=n(7653),c=n(19714),u=Object.assign;function d(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var h=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,f=Symbol.for("react.element"),p=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),b=Symbol.for("react.provider"),y=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),k=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var S=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var T=Symbol.iterator;function P(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=T&&e[T]||e["@@iterator"])?e:null}function M(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case m:return"Fragment";case p:return"Portal";case v:return"Profiler";case g:return"StrictMode";case x:return"Suspense";case C:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case y:return(e.displayName||"Context")+".Consumer";case b:return(e._context.displayName||"Context")+".Provider";case w:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case E:return null!==(t=e.displayName||null)?t:M(e.type)||"Memo";case k:t=e._payload,e=e._init;try{return M(e(t))}catch(e){}}return null}function R(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do 0!=(4098&(t=e).flags)&&(n=t.return),e=t.return;while(e)}return 3===t.tag?n:null}function A(e){if(R(e)!==e)throw Error(d(188))}function L(e){var t=e.alternate;if(!t){if(null===(t=R(e)))throw Error(d(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(r=i.return)){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return A(i),e;if(a===r)return A(i),t;a=a.sibling}throw Error(d(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,l=i.child;l;){if(l===n){o=!0,n=i,r=a;break}if(l===r){o=!0,r=i,n=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===n){o=!0,n=a,r=i;break}if(l===r){o=!0,r=a,n=i;break}l=l.sibling}if(!o)throw Error(d(189))}}if(n.alternate!==r)throw Error(d(190))}if(3!==n.tag)throw Error(d(188));return n.stateNode.current===n?e:t}function _(e){return null!==(e=L(e))?function e(t){if(5===t.tag||6===t.tag)return t;for(t=t.child;null!==t;){var n=e(t);if(null!==n)return n;t=t.sibling}return null}(e):null}var I,O=Array.isArray,D=e.getPublicInstance,z=e.getRootHostContext,N=e.getChildHostContext,F=e.prepareForCommit,B=e.resetAfterCommit,H=e.createInstance,V=e.appendInitialChild,j=e.finalizeInitialChildren,$=e.prepareUpdate,U=e.shouldSetTextContent,W=e.createTextInstance,G=e.scheduleTimeout,q=e.cancelTimeout,Z=e.noTimeout,X=e.isPrimaryRenderer,Y=e.supportsMutation,K=e.supportsPersistence,J=e.supportsHydration,Q=e.getInstanceFromNode,ee=e.preparePortalMount,et=e.getCurrentEventPriority,en=e.detachDeletedInstance,er=e.supportsMicrotasks,ei=e.scheduleMicrotask,ea=e.supportsTestSelectors,eo=e.findFiberRoot,el=e.getBoundingRect,es=e.getTextContent,ec=e.isHiddenSubtree,eu=e.matchAccessibilityRole,ed=e.setFocusIfFocusable,eh=e.setupIntersectionObserver,ef=e.appendChild,ep=e.appendChildToContainer,em=e.commitTextUpdate,eg=e.commitMount,ev=e.commitUpdate,eb=e.insertBefore,ey=e.insertInContainerBefore,ew=e.removeChild,ex=e.removeChildFromContainer,eC=e.resetTextContent,eE=e.hideInstance,ek=e.hideTextInstance,eS=e.unhideInstance,eT=e.unhideTextInstance,eP=e.clearContainer,eM=e.cloneInstance,eR=e.createContainerChildSet,eA=e.appendChildToContainerChildSet,eL=e.finalizeContainerChildren,e_=e.replaceContainerChildren,eI=e.cloneHiddenInstance,eO=e.cloneHiddenTextInstance,eD=e.canHydrateInstance,ez=e.canHydrateTextInstance,eN=e.canHydrateSuspenseInstance,eF=e.isSuspenseInstancePending,eB=e.isSuspenseInstanceFallback,eH=e.getSuspenseInstanceFallbackErrorDetails,eV=e.registerSuspenseInstanceRetry,ej=e.getNextHydratableSibling,e$=e.getFirstHydratableChild,eU=e.getFirstHydratableChildWithinContainer,eW=e.getFirstHydratableChildWithinSuspenseInstance,eG=e.hydrateInstance,eq=e.hydrateTextInstance,eZ=e.hydrateSuspenseInstance,eX=e.getNextHydratableInstanceAfterSuspenseInstance,eY=e.commitHydratedContainer,eK=e.commitHydratedSuspenseInstance,eJ=e.clearSuspenseBoundary,eQ=e.clearSuspenseBoundaryFromContainer,e0=e.shouldDeleteUnhydratedTailInstances,e1=e.didNotMatchHydratedContainerTextInstance,e2=e.didNotMatchHydratedTextInstance;function e4(e){if(void 0===I)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);I=t&&t[1]||""}return"\n"+I+e}var e3=!1;function e8(e,t){if(!e||e3)return"";e3=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t){if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var i=t.stack.split("\n"),a=r.stack.split("\n"),o=i.length-1,l=a.length-1;1<=o&&0<=l&&i[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==a[l]){if(1!==o||1!==l)do if(o--,0>--l||i[o]!==a[l]){var s="\n"+i[o].replace(" at new "," at ");return e.displayName&&s.includes("<anonymous>")&&(s=s.replace("<anonymous>",e.displayName)),s}while(1<=o&&0<=l);break}}}finally{e3=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?e4(e):""}var e6=Object.prototype.hasOwnProperty,e5=[],e9=-1;function e7(e){return{current:e}}function te(e){0>e9||(e.current=e5[e9],e5[e9]=null,e9--)}function tt(e,t){e5[++e9]=e.current,e.current=t}var tn={},tr=e7(tn),ti=e7(!1),ta=tn;function to(e,t){var n=e.type.contextTypes;if(!n)return tn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in n)a[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function tl(e){return null!=(e=e.childContextTypes)}function ts(){te(ti),te(tr)}function tc(e,t,n){if(tr.current!==tn)throw Error(d(168));tt(tr,t),tt(ti,n)}function tu(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in t))throw Error(d(108,function(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return M(t);case 8:return t===g?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}(e)||"Unknown",i));return u({},n,r)}function td(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||tn,ta=tr.current,tt(tr,e),tt(ti,ti.current),!0}function th(e,t,n){var r=e.stateNode;if(!r)throw Error(d(169));n?(e=tu(e,t,ta),r.__reactInternalMemoizedMergedChildContext=e,te(ti),te(tr),tt(tr,e)):te(ti),tt(ti,n)}var tf=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(tp(e)/tm|0)|0},tp=Math.log,tm=Math.LN2,tg=64,tv=4194304;function tb(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ty(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=268435455&n;if(0!==o){var l=o&~i;0!==l?r=tb(l):0!=(a&=o)&&(r=tb(a))}else 0!=(o=n&~i)?r=tb(o):0!==a&&(r=tb(a));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&i)&&((i=r&-r)>=(a=t&-t)||16===i&&0!=(4194240&a)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-tf(t)),r|=e[n],t&=~i;return r}function tw(e){return 0!=(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function tx(){var e=tg;return 0==(4194240&(tg<<=1))&&(tg=64),e}function tC(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function tE(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-tf(t)]=n}function tk(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-tf(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var tS=0;function tT(e){return 1<(e&=-e)?4<e?0!=(268435455&e)?16:536870912:4:1}var tP=c.unstable_scheduleCallback,tM=c.unstable_cancelCallback,tR=c.unstable_shouldYield,tA=c.unstable_requestPaint,tL=c.unstable_now,t_=c.unstable_ImmediatePriority,tI=c.unstable_UserBlockingPriority,tO=c.unstable_NormalPriority,tD=c.unstable_IdlePriority,tz=null,tN=null,tF="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},tB=null,tH=!1,tV=!1;function tj(e){null===tB?tB=[e]:tB.push(e)}function t$(){if(!tV&&null!==tB){tV=!0;var e=0,t=tS;try{var n=tB;for(tS=1;e<n.length;e++){var r=n[e];do r=r(!0);while(null!==r)}tB=null,tH=!1}catch(t){throw null!==tB&&(tB=tB.slice(e+1)),tP(t_,t$),t}finally{tS=t,tV=!1}}return null}var tU=[],tW=0,tG=null,tq=0,tZ=[],tX=0,tY=null,tK=1,tJ="";function tQ(e,t){tU[tW++]=tq,tU[tW++]=tG,tG=e,tq=t}function t0(e,t,n){tZ[tX++]=tK,tZ[tX++]=tJ,tZ[tX++]=tY,tY=e;var r=tK;e=tJ;var i=32-tf(r)-1;r&=~(1<<i),n+=1;var a=32-tf(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,tK=1<<32-tf(t)+i|n<<i|r,tJ=a+e}else tK=1<<a|n<<i|r,tJ=e}function t1(e){null!==e.return&&(tQ(e,1),t0(e,1,0))}function t2(e){for(;e===tG;)tG=tU[--tW],tU[tW]=null,tq=tU[--tW],tU[tW]=null;for(;e===tY;)tY=tZ[--tX],tZ[tX]=null,tJ=tZ[--tX],tZ[tX]=null,tK=tZ[--tX],tZ[tX]=null}var t4=null,t3=null,t8=!1,t6=!1,t5=null;function t9(e,t){var n=aX(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function t7(e,t){switch(e.tag){case 5:return null!==(t=eD(t,e.type,e.pendingProps))&&(e.stateNode=t,t4=e,t3=e$(t),!0);case 6:return null!==(t=ez(t,e.pendingProps))&&(e.stateNode=t,t4=e,t3=null,!0);case 13:if(null!==(t=eN(t))){var n=null!==tY?{id:tK,overflow:tJ}:null;return e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=aX(18,null,null,0)).stateNode=t,n.return=e,e.child=n,t4=e,t3=null,!0}return!1;default:return!1}}function ne(e){return 0!=(1&e.mode)&&0==(128&e.flags)}function nt(e){if(t8){var t=t3;if(t){var n=t;if(!t7(e,t)){if(ne(e))throw Error(d(418));t=ej(n);var r=t4;t&&t7(e,t)?t9(r,n):(e.flags=-4097&e.flags|2,t8=!1,t4=e)}}else{if(ne(e))throw Error(d(418));e.flags=-4097&e.flags|2,t8=!1,t4=e}}}function nn(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;t4=e}function nr(e){if(!J||e!==t4)return!1;if(!t8)return nn(e),t8=!0,!1;if(3!==e.tag&&(5!==e.tag||e0(e.type)&&!U(e.type,e.memoizedProps))){var t=t3;if(t){if(ne(e))throw ni(),Error(d(418));for(;t;)t9(e,t),t=ej(t)}}if(nn(e),13===e.tag){if(!J)throw Error(d(316));if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(d(317));t3=eX(e)}else t3=t4?ej(e.stateNode):null;return!0}function ni(){for(var e=t3;e;)e=ej(e)}function na(){J&&(t3=t4=null,t6=t8=!1)}function no(e){null===t5?t5=[e]:t5.push(e)}var nl=h.ReactCurrentBatchConfig;function ns(e,t){if(tF(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!e6.call(t,i)||!tF(e[i],t[i]))return!1}return!0}function nc(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(d(309));var r=n.stateNode}if(!r)throw Error(d(147,e));var i=r,a=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===a?t.ref:((t=function(e){var t=i.refs;null===e?delete t[a]:t[a]=e})._stringRef=a,t)}if("string"!=typeof e)throw Error(d(284));if(!n._owner)throw Error(d(290,e))}return e}function nu(e,t){throw Error(d(31,"[object Object]"===(e=Object.prototype.toString.call(t))?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function nd(e){return(0,e._init)(e._payload)}function nh(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=aK(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return(t.index=r,e)?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function o(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){return null===t||6!==t.tag?(t=a1(n,e.mode,r)).return=e:(t=i(t,n)).return=e,t}function s(e,t,n,r){var a=n.type;return a===m?u(e,t,n.props.children,r,n.key):(null!==t&&(t.elementType===a||"object"==typeof a&&null!==a&&a.$$typeof===k&&nd(a)===t.type)?(r=i(t,n.props)).ref=nc(e,t,n):(r=aJ(n.type,n.key,n.props,null,e.mode,r)).ref=nc(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=a2(n,e.mode,r)).return=e:(t=i(t,n.children||[])).return=e,t}function u(e,t,n,r,a){return null===t||7!==t.tag?(t=aQ(n,e.mode,r,a)).return=e:(t=i(t,n)).return=e,t}function h(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=a1(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case f:return(n=aJ(t.type,t.key,t.props,null,e.mode,n)).ref=nc(e,null,t),n.return=e,n;case p:return(t=a2(t,e.mode,n)).return=e,t;case k:return h(e,(0,t._init)(t._payload),n)}if(O(t)||P(t))return(t=aQ(t,e.mode,n,null)).return=e,t;nu(e,t)}return null}function g(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==i?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case f:return n.key===i?s(e,t,n,r):null;case p:return n.key===i?c(e,t,n,r):null;case k:return g(e,t,(i=n._init)(n._payload),r)}if(O(n)||P(n))return null!==i?null:u(e,t,n,r,null);nu(e,n)}return null}function v(e,t,n,r,i){if("string"==typeof r&&""!==r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case f:return s(t,e=e.get(null===r.key?n:r.key)||null,r,i);case p:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i);case k:return v(e,t,n,(0,r._init)(r._payload),i)}if(O(r)||P(r))return u(t,e=e.get(n)||null,r,i,null);nu(t,r)}return null}return function l(s,c,u,b){if("object"==typeof u&&null!==u&&u.type===m&&null===u.key&&(u=u.props.children),"object"==typeof u&&null!==u){switch(u.$$typeof){case f:e:{for(var y=u.key,w=c;null!==w;){if(w.key===y){if((y=u.type)===m){if(7===w.tag){n(s,w.sibling),(c=i(w,u.props.children)).return=s,s=c;break e}}else if(w.elementType===y||"object"==typeof y&&null!==y&&y.$$typeof===k&&nd(y)===w.type){n(s,w.sibling),(c=i(w,u.props)).ref=nc(s,w,u),c.return=s,s=c;break e}n(s,w);break}t(s,w),w=w.sibling}u.type===m?((c=aQ(u.props.children,s.mode,b,u.key)).return=s,s=c):((b=aJ(u.type,u.key,u.props,null,s.mode,b)).ref=nc(s,c,u),b.return=s,s=b)}return o(s);case p:e:{for(w=u.key;null!==c;){if(c.key===w){if(4===c.tag&&c.stateNode.containerInfo===u.containerInfo&&c.stateNode.implementation===u.implementation){n(s,c.sibling),(c=i(c,u.children||[])).return=s,s=c;break e}n(s,c);break}t(s,c),c=c.sibling}(c=a2(u,s.mode,b)).return=s,s=c}return o(s);case k:return l(s,c,(w=u._init)(u._payload),b)}if(O(u))return function(i,o,l,s){for(var c=null,u=null,d=o,f=o=0,p=null;null!==d&&f<l.length;f++){d.index>f?(p=d,d=null):p=d.sibling;var m=g(i,d,l[f],s);if(null===m){null===d&&(d=p);break}e&&d&&null===m.alternate&&t(i,d),o=a(m,o,f),null===u?c=m:u.sibling=m,u=m,d=p}if(f===l.length)return n(i,d),t8&&tQ(i,f),c;if(null===d){for(;f<l.length;f++)null!==(d=h(i,l[f],s))&&(o=a(d,o,f),null===u?c=d:u.sibling=d,u=d);return t8&&tQ(i,f),c}for(d=r(i,d);f<l.length;f++)null!==(p=v(d,i,f,l[f],s))&&(e&&null!==p.alternate&&d.delete(null===p.key?f:p.key),o=a(p,o,f),null===u?c=p:u.sibling=p,u=p);return e&&d.forEach(function(e){return t(i,e)}),t8&&tQ(i,f),c}(s,c,u,b);if(P(u))return function(i,o,l,s){var c=P(l);if("function"!=typeof c)throw Error(d(150));if(null==(l=c.call(l)))throw Error(d(151));for(var u=c=null,f=o,p=o=0,m=null,b=l.next();null!==f&&!b.done;p++,b=l.next()){f.index>p?(m=f,f=null):m=f.sibling;var y=g(i,f,b.value,s);if(null===y){null===f&&(f=m);break}e&&f&&null===y.alternate&&t(i,f),o=a(y,o,p),null===u?c=y:u.sibling=y,u=y,f=m}if(b.done)return n(i,f),t8&&tQ(i,p),c;if(null===f){for(;!b.done;p++,b=l.next())null!==(b=h(i,b.value,s))&&(o=a(b,o,p),null===u?c=b:u.sibling=b,u=b);return t8&&tQ(i,p),c}for(f=r(i,f);!b.done;p++,b=l.next())null!==(b=v(f,i,p,b.value,s))&&(e&&null!==b.alternate&&f.delete(null===b.key?p:b.key),o=a(b,o,p),null===u?c=b:u.sibling=b,u=b);return e&&f.forEach(function(e){return t(i,e)}),t8&&tQ(i,p),c}(s,c,u,b);nu(s,u)}return"string"==typeof u&&""!==u||"number"==typeof u?(u=""+u,null!==c&&6===c.tag?(n(s,c.sibling),(c=i(c,u)).return=s):(n(s,c),(c=a1(u,s.mode,b)).return=s),o(s=c)):n(s,c)}}var nf=nh(!0),np=nh(!1),nm=e7(null),ng=null,nv=null,nb=null;function ny(){nb=nv=ng=null}function nw(e,t,n){X?(tt(nm,t._currentValue),t._currentValue=n):(tt(nm,t._currentValue2),t._currentValue2=n)}function nx(e){var t=nm.current;te(nm),X?e._currentValue=t:e._currentValue2=t}function nC(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function nE(e,t){ng=e,nb=nv=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(r2=!0),e.firstContext=null)}function nk(e){var t=X?e._currentValue:e._currentValue2;if(nb!==e){if(e={context:e,memoizedValue:t,next:null},null===nv){if(null===ng)throw Error(d(308));nv=e,ng.dependencies={lanes:0,firstContext:e}}else nv=nv.next=e}return t}var nS=null;function nT(e){null===nS?nS=[e]:nS.push(e)}function nP(e,t,n,r){var i=t.interleaved;return null===i?(n.next=n,nT(t)):(n.next=i.next,i.next=n),t.interleaved=n,nM(e,r)}function nM(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var nR=!1;function nA(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function nL(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function n_(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function nI(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!=(2&i8)){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,nM(e,n)}return null===(i=r.interleaved)?(t.next=t,nT(r)):(t.next=i.next,i.next=t),r.interleaved=t,nM(e,n)}function nO(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!=(4194240&n))){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tk(e,n)}}function nD(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===a?i=a=o:a=a.next=o,n=n.next}while(null!==n);null===a?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function nz(e,t,n,r){var i=e.updateQueue;nR=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(null!==l){i.shared.pending=null;var s=l,c=s.next;s.next=null,null===o?a=c:o.next=c,o=s;var d=e.alternate;null!==d&&(l=(d=d.updateQueue).lastBaseUpdate)!==o&&(null===l?d.firstBaseUpdate=c:l.next=c,d.lastBaseUpdate=s)}if(null!==a){var h=i.baseState;for(o=0,d=c=s=null,l=a;;){var f=l.lane,p=l.eventTime;if((r&f)===f){null!==d&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,g=l;switch(f=t,p=n,g.tag){case 1:if("function"==typeof(m=g.payload)){h=m.call(p,h,f);break e}h=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(f="function"==typeof(m=g.payload)?m.call(p,h,f):m))break e;h=u({},h,f);break e;case 2:nR=!0}}null!==l.callback&&0!==l.lane&&(e.flags|=64,null===(f=i.effects)?i.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},null===d?(c=d=p,s=h):d=d.next=p,o|=f;if(null===(l=l.next)){if(null===(l=i.shared.pending))break;l=(f=l).next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}if(null===d&&(s=h),i.baseState=s,i.firstBaseUpdate=c,i.lastBaseUpdate=d,null!==(t=i.shared.interleaved)){i=t;do o|=i.lane,i=i.next;while(i!==t)}else null===a&&(i.shared.lanes=0);ar|=o,e.lanes=o,e.memoizedState=h}}function nN(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(d(191,i));i.call(r)}}}var nF={},nB=e7(nF),nH=e7(nF),nV=e7(nF);function nj(e){if(e===nF)throw Error(d(174));return e}function n$(e,t){tt(nV,t),tt(nH,e),tt(nB,nF),e=z(t),te(nB),tt(nB,e)}function nU(){te(nB),te(nH),te(nV)}function nW(e){var t=nj(nV.current),n=nj(nB.current);t=N(n,e.type,t),n!==t&&(tt(nH,e),tt(nB,t))}function nG(e){nH.current===e&&(te(nB),te(nH))}var nq=e7(0);function nZ(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||eF(n)||eB(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var nX=[];function nY(){for(var e=0;e<nX.length;e++){var t=nX[e];X?t._workInProgressVersionPrimary=null:t._workInProgressVersionSecondary=null}nX.length=0}var nK=h.ReactCurrentDispatcher,nJ=h.ReactCurrentBatchConfig,nQ=0,n0=null,n1=null,n2=null,n4=!1,n3=!1,n8=0,n6=0;function n5(){throw Error(d(321))}function n9(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!tF(e[n],t[n]))return!1;return!0}function n7(e,t,n,r,i,a){if(nQ=a,n0=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,nK.current=null===e||null===e.memoizedState?rz:rN,e=n(r,i),n3){a=0;do{if(n3=!1,n8=0,25<=a)throw Error(d(301));a+=1,n2=n1=null,t.updateQueue=null,nK.current=rF,e=n(r,i)}while(n3)}if(nK.current=rD,t=null!==n1&&null!==n1.next,nQ=0,n2=n1=n0=null,n4=!1,t)throw Error(d(300));return e}function re(){var e=0!==n8;return n8=0,e}function rt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===n2?n0.memoizedState=n2=e:n2=n2.next=e,n2}function rn(){if(null===n1){var e=n0.alternate;e=null!==e?e.memoizedState:null}else e=n1.next;var t=null===n2?n0.memoizedState:n2.next;if(null!==t)n2=t,n1=e;else{if(null===e)throw Error(d(310));e={memoizedState:(n1=e).memoizedState,baseState:n1.baseState,baseQueue:n1.baseQueue,queue:n1.queue,next:null},null===n2?n0.memoizedState=n2=e:n2=n2.next=e}return n2}function rr(e,t){return"function"==typeof t?t(e):t}function ri(e){var t=rn(),n=t.queue;if(null===n)throw Error(d(311));n.lastRenderedReducer=e;var r=n1,i=r.baseQueue,a=n.pending;if(null!==a){if(null!==i){var o=i.next;i.next=a.next,a.next=o}r.baseQueue=i=a,n.pending=null}if(null!==i){a=i.next,r=r.baseState;var l=o=null,s=null,c=a;do{var u=c.lane;if((nQ&u)===u)null!==s&&(s=s.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var h={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};null===s?(l=s=h,o=r):s=s.next=h,n0.lanes|=u,ar|=u}c=c.next}while(null!==c&&c!==a);null===s?o=r:s.next=l,tF(r,t.memoizedState)||(r2=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=s,n.lastRenderedState=r}if(null!==(e=n.interleaved)){i=e;do a=i.lane,n0.lanes|=a,ar|=a,i=i.next;while(i!==e)}else null===i&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ra(e){var t=rn(),n=t.queue;if(null===n)throw Error(d(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(null!==i){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);tF(a,t.memoizedState)||(r2=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function ro(){}function rl(e,t){var n=n0,r=rn(),i=t(),a=!tF(r.memoizedState,i);if(a&&(r.memoizedState=i,r2=!0),r=r.queue,ry(ru.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||null!==n2&&1&n2.memoizedState.tag){if(n.flags|=2048,rp(9,rc.bind(null,n,r,i,t),void 0,null),null===i6)throw Error(d(349));0!=(30&nQ)||rs(n,t,i)}return i}function rs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=n0.updateQueue)?(t={lastEffect:null,stores:null},n0.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function rc(e,t,n,r){t.value=n,t.getSnapshot=r,rd(t)&&rh(e)}function ru(e,t,n){return n(function(){rd(t)&&rh(e)})}function rd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!tF(e,n)}catch(e){return!0}}function rh(e){var t=nM(e,1);null!==t&&ak(t,e,1,-1)}function rf(e){var t=rt();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:rr,lastRenderedState:e},t.queue=e,e=e.dispatch=rL.bind(null,n0,e),[t.memoizedState,e]}function rp(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=n0.updateQueue)?(t={lastEffect:null,stores:null},n0.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function rm(){return rn().memoizedState}function rg(e,t,n,r){var i=rt();n0.flags|=e,i.memoizedState=rp(1|t,n,void 0,void 0===r?null:r)}function rv(e,t,n,r){var i=rn();r=void 0===r?null:r;var a=void 0;if(null!==n1){var o=n1.memoizedState;if(a=o.destroy,null!==r&&n9(r,o.deps)){i.memoizedState=rp(t,n,a,r);return}}n0.flags|=e,i.memoizedState=rp(1|t,n,a,r)}function rb(e,t){return rg(8390656,8,e,t)}function ry(e,t){return rv(2048,8,e,t)}function rw(e,t){return rv(4,2,e,t)}function rx(e,t){return rv(4,4,e,t)}function rC(e,t){return"function"==typeof t?(t(e=e()),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function rE(e,t,n){return n=null!=n?n.concat([e]):null,rv(4,4,rC.bind(null,t,e),n)}function rk(){}function rS(e,t){var n=rn();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&n9(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function rT(e,t){var n=rn();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&n9(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function rP(e,t,n){return 0==(21&nQ)?(e.baseState&&(e.baseState=!1,r2=!0),e.memoizedState=n):(tF(n,t)||(n=tx(),n0.lanes|=n,ar|=n,e.baseState=!0),t)}function rM(e,t){var n=tS;tS=0!==n&&4>n?n:4,e(!0);var r=nJ.transition;nJ.transition={};try{e(!1),t()}finally{tS=n,nJ.transition=r}}function rR(){return rn().memoizedState}function rA(e,t,n){var r=aE(e);n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},r_(e)?rI(t,n):null!==(n=nP(e,t,n,r))&&(ak(n,e,r,aC()),rO(n,t,r))}function rL(e,t,n){var r=aE(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(r_(e))rI(t,i);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,l=a(o,n);if(i.hasEagerState=!0,i.eagerState=l,tF(l,o)){var s=t.interleaved;
vendor: 2,418 bytes, line 8
8null===s?(i.next=i,nT(t)):(i.next=s.next,s.next=i),t.interleaved=i;return}}catch(e){}finally{}null!==(n=nP(e,t,i,r))&&(ak(n,e,r,i=aC()),rO(n,t,r))}}function r_(e){var t=e.alternate;return e===n0||null!==t&&t===n0}function rI(e,t){n3=n4=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function rO(e,t,n){if(0!=(4194240&n)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tk(e,n)}}var rD={readContext:nk,useCallback:n5,useContext:n5,useEffect:n5,useImperativeHandle:n5,useInsertionEffect:n5,useLayoutEffect:n5,useMemo:n5,useReducer:n5,useRef:n5,useState:n5,useDebugValue:n5,useDeferredValue:n5,useTransition:n5,useMutableSource:n5,useSyncExternalStore:n5,useId:n5,unstable_isNewReconciler:!1},rz={readContext:nk,useCallback:function(e,t){return rt().memoizedState=[e,void 0===t?null:t],e},useContext:nk,useEffect:rb,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,rg(4194308,4,rC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rg(4194308,4,e,t)},useInsertionEffect:function(e,t){return rg(4,2,e,t)},useMemo:function(e,t){var n=rt();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=rt();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=rA.bind(null,n0,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},rt().memoizedState=e},useState:rf,useDebugValue:rk,useDeferredValue:function(e){return rt().memoizedState=e},useTransition:function(){var e=rf(!1),t=e[0];return e=rM.bind(null,e[1]),rt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=n0,i=rt();if(t8){if(void 0===n)throw Error(d(407));n=n()}else{if(n=t(),null===i6)throw Error(d(349));0!=(30&nQ)||rs(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,rb(ru.bind(null,r,a,e),[e]),r.flags|=2048,rp(9,rc.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=rt(),t=i6.identifierPrefix;if(t8){var n=tJ,r=tK;t=":"+t+"R"+(n=(r&~(1<<32-tf(r)-1)).toString(32)+n),0<(n=n8++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=n6++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},rN={readContext:nk,useCallback:rS,useContext:nk,useEffect:ry,useImperativeHandle:rE,useInsertionEffect:rw,useLayoutEffect:rx,useMemo:rT,useReducer:ri,useRef
vendor: 15,009 bytes, line 8
8:rm,useState:function(){return ri(rr)},useDebugValue:rk,useDeferredValue:function(e){return rP(rn(),n1.memoizedState,e)},useTransition:function(){return[ri(rr)[0],rn().memoizedState]},useMutableSource:ro,useSyncExternalStore:rl,useId:rR,unstable_isNewReconciler:!1},rF={readContext:nk,useCallback:rS,useContext:nk,useEffect:ry,useImperativeHandle:rE,useInsertionEffect:rw,useLayoutEffect:rx,useMemo:rT,useReducer:ra,useRef:rm,useState:function(){return ra(rr)},useDebugValue:rk,useDeferredValue:function(e){var t=rn();return null===n1?t.memoizedState=e:rP(t,n1.memoizedState,e)},useTransition:function(){return[ra(rr)[0],rn().memoizedState]},useMutableSource:ro,useSyncExternalStore:rl,useId:rR,unstable_isNewReconciler:!1};function rB(e,t){if(e&&e.defaultProps)for(var n in t=u({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}function rH(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:u({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var rV={isMounted:function(e){return!!(e=e._reactInternals)&&R(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=aC(),i=aE(e),a=n_(r,i);a.payload=t,null!=n&&(a.callback=n),null!==(t=nI(e,a,i))&&(ak(t,e,i,r),nO(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=aC(),i=aE(e),a=n_(r,i);a.tag=1,a.payload=t,null!=n&&(a.callback=n),null!==(t=nI(e,a,i))&&(ak(t,e,i,r),nO(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=aC(),r=aE(e),i=n_(n,r);i.tag=2,null!=t&&(i.callback=t),null!==(t=nI(e,i,r))&&(ak(t,e,r,n),nO(t,e,r))}};function rj(e,t,n,r,i,a,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,o):!t.prototype||!t.prototype.isPureReactComponent||!ns(n,r)||!ns(i,a)}function r$(e,t,n){var r=!1,i=tn,a=t.contextType;return"object"==typeof a&&null!==a?a=nk(a):(i=tl(t)?ta:tr.current,a=(r=null!=(r=t.contextTypes))?to(e,i):tn),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=rV,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function rU(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&rV.enqueueReplaceState(t,t.state,null)}function rW(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},nA(e);var a=t.contextType;"object"==typeof a&&null!==a?i.context=nk(a):(a=tl(t)?ta:tr.current,i.context=to(e,a)),i.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(rH(e,t,a,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&rV.enqueueReplaceState(i,i.state,null),nz(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4194308)}function rG(e,t){try{var n="",r=t;do n+=function(e){switch(e.tag){case 5:return e4(e.type);case 16:return e4("Lazy");case 13:return e4("Suspense");case 19:return e4("SuspenseList");case 0:case 2:case 15:return e=e8(e.type,!1);case 11:return e=e8(e.type.render,!1);case 1:return e=e8(e.type,!0);default:return""}}(r),r=r.return;while(r);var i=n}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i,digest:null}}function rq(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function rZ(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var rX="function"==typeof WeakMap?WeakMap:Map;function rY(e,t,n){(n=n_(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ah||(ah=!0,af=r),rZ(e,t)},n}function rK(e,t,n){(n=n_(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){rZ(e,t)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(n.callback=function(){rZ(e,t),"function"!=typeof r&&(null===ap?ap=new Set([this]):ap.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:null!==n?n:""})}),n}function rJ(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new rX;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=aU.bind(null,e,t,n),t.then(e,e))}function rQ(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function r0(e,t,n,r,i){return 0==(1&e.mode)?e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=n_(-1,1)).tag=2,nI(n,t,1))),n.lanes|=1):(e.flags|=65536,e.lanes=i),e}var r1=h.ReactCurrentOwner,r2=!1;function r4(e,t,n,r){t.child=null===e?np(t,null,n,r):nf(t,e.child,n,r)}function r3(e,t,n,r,i){n=n.render;var a=t.ref;return(nE(t,i),r=n7(e,t,n,r,a,i),n=re(),null===e||r2)?(t8&&n&&t1(t),t.flags|=1,r4(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,im(e,t,i))}function r8(e,t,n,r,i){if(null===e){var a=n.type;return"function"!=typeof a||aY(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=aJ(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,r6(e,t,a,r,i))}if(a=e.child,0==(e.lanes&i)){var o=a.memoizedProps;if((n=null!==(n=n.compare)?n:ns)(o,r)&&e.ref===t.ref)return im(e,t,i)}return t.flags|=1,(e=aK(a,r)).ref=t.ref,e.return=t,t.child=e}function r6(e,t,n,r,i){if(null!==e){var a=e.memoizedProps;if(ns(a,r)&&e.ref===t.ref){if(r2=!1,t.pendingProps=r=a,0==(e.lanes&i))return t.lanes=e.lanes,im(e,t,i);0!=(131072&e.flags)&&(r2=!0)}}return r7(e,t,n,r,i)}function r5(e,t,n){var r=t.pendingProps,i=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode){if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},tt(ae,i7),i7|=n;else{if(0==(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,tt(ae,i7),i7|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==a?a.baseLanes:n,tt(ae,i7),i7|=r}}else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,tt(ae,i7),i7|=r;return r4(e,t,i,n),t.child}function r9(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function r7(e,t,n,r,i){var a=tl(n)?ta:tr.current;return(a=to(t,a),nE(t,i),n=n7(e,t,n,r,a,i),r=re(),null===e||r2)?(t8&&r&&t1(t),t.flags|=1,r4(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,im(e,t,i))}function ie(e,t,n,r,i){if(tl(n)){var a=!0;td(t)}else a=!1;if(nE(t,i),null===t.stateNode)ip(e,t),r$(t,n,r),rW(t,n,r,i),r=!0;else if(null===e){var o=t.stateNode,l=t.memoizedProps;o.props=l;var s=o.context,c=n.contextType;c="object"==typeof c&&null!==c?nk(c):to(t,c=tl(n)?ta:tr.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof o.getSnapshotBeforeUpdate;d||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(l!==r||s!==c)&&rU(t,o,r,c),nR=!1;var h=t.memoizedState;o.state=h,nz(t,r,o,i),s=t.memoizedState,l!==r||h!==s||ti.current||nR?("function"==typeof u&&(rH(t,n,u,r),s=t.memoizedState),(l=nR||rj(t,n,l,r,h,s,c))?(d||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.flags|=4194308)):("function"==typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),o.props=r,o.state=s,o.context=c,r=l):("function"==typeof o.componentDidMount&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,nL(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:rB(t.type,l),o.props=c,d=t.pendingProps,h=o.context,s="object"==typeof(s=n.contextType)&&null!==s?nk(s):to(t,s=tl(n)?ta:tr.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(l!==d||h!==s)&&rU(t,o,r,s),nR=!1,h=t.memoizedState,o.state=h,nz(t,r,o,i);var p=t.memoizedState;l!==d||h!==p||ti.current||nR?("function"==typeof f&&(rH(t,n,f,r),p=t.memoizedState),(c=nR||rj(t,n,c,r,h,p,s)||!1)?(u||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(r,p,s),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,p,s)),"function"==typeof o.componentDidUpdate&&(t.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof o.componentDidUpdate||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),o.props=r,o.state=p,o.context=s,r=c):("function"!=typeof o.componentDidUpdate||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return it(e,t,n,r,a,i)}function it(e,t,n,r,i,a){r9(e,t);var o=0!=(128&t.flags);if(!r&&!o)return i&&th(t,n,!1),im(e,t,a);r=t.stateNode,r1.current=t;var l=o&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=nf(t,e.child,null,a),t.child=nf(t,null,l,a)):r4(e,t,l,a),t.memoizedState=r.state,i&&th(t,n,!0),t.child}function ir(e){var t=e.stateNode;t.pendingContext?tc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&tc(e,t.context,!1),n$(e,t.containerInfo)}function ii(e,t,n,r,i){return na(),no(i),t.flags|=256,r4(e,t,n,r),t.child}var ia={dehydrated:null,treeContext:null,retryLane:0};function io(e){return{baseLanes:e,cachePool:null,transitions:null}}function il(e,t,n){var r,i=t.pendingProps,a=nq.current,o=!1,l=0!=(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!=(2&a)),r?(o=!0,t.flags&=-129):(null===e||null!==e.memoizedState)&&(a|=1),tt(nq,1&a),null===e)return(nt(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated))?(0==(1&t.mode)?t.lanes=1:eB(e)?t.lanes=8:t.lanes=1073741824,null):(l=i.children,e=i.fallback,o?(i=t.mode,o=t.child,l={mode:"hidden",children:l},0==(1&i)&&null!==o?(o.childLanes=0,o.pendingProps=l):o=a0(l,i,0,null),e=aQ(e,i,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=io(n),t.memoizedState=ia,e):is(t,l));if(null!==(a=e.memoizedState)&&null!==(r=a.dehydrated))return function(e,t,n,r,i,a,o){if(n)return 256&t.flags?(t.flags&=-257,ic(e,t,o,r=rq(Error(d(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=a0({mode:"visible",children:r.children},i,0,null),a=aQ(a,i,o,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,0!=(1&t.mode)&&nf(t,e.child,null,o),t.child.memoizedState=io(o),t.memoizedState=ia,a);if(0==(1&t.mode))return ic(e,t,o,null);if(eB(i))return r=eH(i).digest,ic(e,t,o,r=rq(a=Error(d(419)),r,void 0));if(n=0!=(o&e.childLanes),r2||n){if(null!==(r=i6)){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!=(i&(r.suspendedLanes|o))?0:i)&&i!==a.retryLane&&(a.retryLane=i,nM(e,i),ak(r,e,i,-1))}return az(),ic(e,t,o,r=rq(Error(d(421))))}return eF(i)?(t.flags|=128,t.child=e.child,eV(i,t=aG.bind(null,e)),null):(e=a.treeContext,J&&(t3=eW(i),t4=t,t8=!0,t5=null,t6=!1,null!==e&&(tZ[tX++]=tK,tZ[tX++]=tJ,tZ[tX++]=tY,tK=e.id,tJ=e.overflow,tY=t)),t=is(t,r.children),t.flags|=4096,t)}(e,t,l,i,r,a,n);if(o){o=i.fallback,l=t.mode,r=(a=e.child).sibling;var s={mode:"hidden",children:i.children};return 0==(1&l)&&t.child!==a?((i=t.child).childLanes=0,i.pendingProps=s,t.deletions=null):(i=aK(a,s)).subtreeFlags=14680064&a.subtreeFlags,null!==r?o=aK(r,o):(o=aQ(o,l,n,null),o.flags|=2),o.return=t,i.return=t,i.sibling=o,t.child=i,i=o,o=t.child,l=null===(l=e.child.memoizedState)?io(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=e.childLanes&~n,t.memoizedState=ia,i}return e=(o=e.child).sibling,i=aK(o,{mode:"visible",children:i.children}),0==(1&t.mode)&&(i.lanes=n),i.return=t,i.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function is(e,t){return(t=a0({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function ic(e,t,n,r){return null!==r&&no(r),nf(t,e.child,null,n),e=is(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function iu(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),nC(e.return,t,n)}function id(e,t,n,r,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function ih(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(r4(e,t,r.children,n),0!=(2&(r=nq.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&iu(e,n,t);else if(19===e.tag)iu(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(tt(nq,r),0==(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(i=null,n=t.child;null!==n;)null!==(e=n.alternate)&&null===nZ(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),id(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===nZ(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}id(t,!0,n,null,a);break;case"together":id(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ip(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function im(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),ar|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(d(153));if(null!==t.child){for(n=aK(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=aK(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function ig(e){e.flags|=4}function iv(e,t){if(null!==e&&e.child===t.child)return!0;
8if(0!=(16&t.flags))return!1;for(e=t.child;null!==e;){if(0!=(12854&e.flags)||0!=(12854&e.subtreeFlags))return!1;e=e.sibling}return!0}if(Y)t=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)V(e,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},r=function(){},i=function(e,t,n,r,i){(e=e.memoizedProps)!==r&&(n=$(t.stateNode,n,e,r,i,nj(nB.current)),(t.updateQueue=n)&&ig(t))},a=function(e,t,n,r){n!==r&&ig(t)};else if(K){t=function(e,n,r,i){for(var a=n.child;null!==a;){if(5===a.tag){var o=a.stateNode;r&&i&&(o=eI(o,a.type,a.memoizedProps,a)),V(e,o)}else if(6===a.tag)o=a.stateNode,r&&i&&(o=eO(o,a.memoizedProps,a)),V(e,o);else if(4!==a.tag){if(22===a.tag&&null!==a.memoizedState)null!==(o=a.child)&&(o.return=a),t(e,a,!0,!0);else if(null!==a.child){a.child.return=a,a=a.child;continue}}if(a===n)break;for(;null===a.sibling;){if(null===a.return||a.return===n)return;a=a.return}a.sibling.return=a.return,a=a.sibling}};var ib=function(e,t,n,r){for(var i=t.child;null!==i;){if(5===i.tag){var a=i.stateNode;n&&r&&(a=eI(a,i.type,i.memoizedProps,i)),eA(e,a)}else if(6===i.tag)a=i.stateNode,n&&r&&(a=eO(a,i.memoizedProps,i)),eA(e,a);else if(4!==i.tag){if(22===i.tag&&null!==i.memoizedState)null!==(a=i.child)&&(a.return=i),ib(e,i,!0,!0);else if(null!==i.child){i.child.return=i,i=i.child;continue}}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};r=function(e,t){var n=t.stateNode;if(!iv(e,t)){var r=eR(e=n.containerInfo);ib(r,t,!1,!1),n.pendingChildren=r,ig(t),eL(e,r)}},i=function(e,n,r,i,a){var o=e.stateNode,l=e.memoizedProps;if((e=iv(e,n))&&l===i)n.stateNode=o;else{var s=n.stateNode,c=nj(nB.current),u=null;l!==i&&(u=$(s,r,l,i,a,c)),e&&null===u?n.stateNode=o:(j(o=eM(o,u,r,l,i,n,e,s),r,i,a,c)&&ig(n),n.stateNode=o,e?ig(n):t(o,n,!1,!1))}},a=function(e,t,n,r){n!==r?(e=nj(nV.current),n=nj(nB.current),t.stateNode=W(r,e,n,t),ig(t)):t.stateNode=e.stateNode}}else r=function(){},i=function(){},a=function(){};function iy(e,t){if(!t8)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function iw(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}var ix=!1,iC=!1,iE="function"==typeof WeakSet?WeakSet:Set,ik=null;function iS(e,t){var n=e.ref;if(null!==n){if("function"==typeof n)try{n(null)}catch(n){a$(e,t,n)}else n.current=null}}function iT(e,t,n){try{n()}catch(n){a$(e,t,n)}}var iP=!1;function iM(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,void 0!==a&&iT(t,n,a)}i=i.next}while(i!==r)}}function iR(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function iA(e){var t=e.ref;if(null!==t){var n=e.stateNode;e=5===e.tag?D(n):n,"function"==typeof t?t(e):t.current=e}}function iL(e){return 5===e.tag||3===e.tag||4===e.tag}function i_(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||iL(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags||null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}var iI=null,iO=!1;function iD(e,t,n){for(n=n.child;null!==n;)iz(e,t,n),n=n.sibling}function iz(e,t,n){if(tN&&"function"==typeof tN.onCommitFiberUnmount)try{tN.onCommitFiberUnmount(tz,n)}catch(e){}switch(n.tag){case 5:iC||iS(n,t);case 6:if(Y){var r=iI,i=iO;iI=null,iD(e,t,n),iI=r,iO=i,null!==iI&&(iO?ex(iI,n.stateNode):ew(iI,n.stateNode))}else iD(e,t,n);break;case 18:Y&&null!==iI&&(iO?eQ(iI,n.stateNode):eJ(iI,n.stateNode));break;case 4:Y?(r=iI,i=iO,iI=n.stateNode.containerInfo,iO=!0,iD(e,t,n),iI=r,iO=i):(K&&(i=eR(r=n.stateNode.containerInfo),e_(r,i)),iD(e,t,n));break;case 0:case 11:case 14:case 15:if(!iC&&null!==(r=n.updateQueue)&&null!==(r=r.lastEffect)){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,void 0!==o&&(0!=(2&a)?iT(n,t,o):0!=(4&a)&&iT(n,t,o)),i=i.next}while(i!==r)}
8iD(e,t,n);break;case 1:if(!iC&&(iS(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){a$(n,t,e)}iD(e,t,n);break;case 21:default:iD(e,t,n);break;case 22:1&n.mode?(iC=(r=iC)||null!==n.memoizedState,iD(e,t,n),iC=r):iD(e,t,n)}}function iN(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new iE),t.forEach(function(t){var r=aq.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function iF(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var i=n[r];try{var a=t;if(Y){var o=a;e:for(;null!==o;){switch(o.tag){case 5:iI=o.stateNode,iO=!1;break e;case 3:case 4:iI=o.stateNode.containerInfo,iO=!0;break e}o=o.return}if(null===iI)throw Error(d(160));iz(e,a,i),iI=null,iO=!1}else iz(e,a,i);var l=i.alternate;null!==l&&(l.return=null),i.return=null}catch(e){a$(i,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)iB(t,e),t=t.sibling}function iB(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(iF(t,e),iH(e),4&r){try{iM(3,e,e.return),iR(3,e)}catch(t){a$(e,e.return,t)}try{iM(5,e,e.return)}catch(t){a$(e,e.return,t)}}break;case 1:iF(t,e),iH(e),512&r&&null!==n&&iS(n,n.return);break;case 5:if(iF(t,e),iH(e),512&r&&null!==n&&iS(n,n.return),Y){if(32&e.flags){var i=e.stateNode;try{eC(i)}catch(t){a$(e,e.return,t)}}if(4&r&&null!=(i=e.stateNode)){var a=e.memoizedProps;if(n=null!==n?n.memoizedProps:a,r=e.type,t=e.updateQueue,e.updateQueue=null,null!==t)try{ev(i,t,r,n,a,e)}catch(t){a$(e,e.return,t)}}}break;case 6:if(iF(t,e),iH(e),4&r&&Y){if(null===e.stateNode)throw Error(d(162));i=e.stateNode,a=e.memoizedProps,n=null!==n?n.memoizedProps:a;try{em(i,n,a)}catch(t){a$(e,e.return,t)}}break;case 3:if(iF(t,e),iH(e),4&r){if(Y&&J&&null!==n&&n.memoizedState.isDehydrated)try{eY(t.containerInfo)}catch(t){a$(e,e.return,t)}if(K){i=t.containerInfo,a=t.pendingChildren;try{e_(i,a)}catch(t){a$(e,e.return,t)}}}break;case 4:if(iF(t,e),iH(e),4&r&&K){i=(a=e.stateNode).containerInfo,a=a.pendingChildren;try{e_(i,a)}catch(t){a$(e,e.return,t)}}break;case 13:iF(t,e),iH(e),8192&(i=e.child).flags&&(a=null!==i.memoizedState,i.stateNode.isHidden=a,a&&(null===i.alternate||null===i.alternate.memoizedState)&&(as=tL())),4&r&&iN(e);break;case 22:var o=null!==n&&null!==n.memoizedState;if(1&e.mode?(iC=(n=iC)||o,iF(t,e),iC=n):iF(t,e),iH(e),8192&r){if(n=null!==e.memoizedState,(e.stateNode.isHidden=n)&&!o&&0!=(1&e.mode))for(ik=e,r=e.child;null!==r;){for(t=ik=r;null!==ik;){var l=(o=ik).child;switch(o.tag){case 0:case 11:case 14:case 15:iM(4,o,o.return);break;case 1:iS(o,o.return);var s=o.stateNode;if("function"==typeof s.componentWillUnmount){var c=o,u=o.return;try{s.props=c.memoizedProps,s.state=c.memoizedState,s.componentWillUnmount()}catch(e){a$(c,u,e)}}break;case 5:iS(o,o.return);break;case 22:if(null!==o.memoizedState){ij(t);continue}}null!==l?(l.return=o,ik=l):ij(t)}r=r.sibling}if(Y){e:if(r=null,Y)for(t=e;;){if(5===t.tag){if(null===r){r=t;try{i=t.stateNode,n?eE(i):eS(t.stateNode,t.memoizedProps)}catch(t){a$(e,e.return,t)}}}else if(6===t.tag){if(null===r)try{a=t.stateNode,n?ek(a):eT(a,t.memoizedProps)}catch(t){a$(e,e.return,t)}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;r===t&&(r=null),t=t.return}r===t&&(r=null),t.sibling.return=t.return,t=t.sibling}}}break;case 19:iF(t,e),iH(e),4&r&&iN(e);break;case 21:break;default:iF(t,e),iH(e)}}function iH(e){var t=e.flags;if(2&t){try{if(Y){t:{for(var n=e.return;null!==n;){if(iL(n)){var r=n;break t}n=n.return}throw Error(d(160))}switch(r.tag){case 5:var i=r.stateNode;32&r.flags&&(eC(i),r.flags&=-33);var a=i_(e);!function e(t,n,r){var i=t.tag;if(5===i||6===i)t=t.stateNode,n?eb(r,t,n):ef(r,t);else if(4!==i&&null!==(t=t.child))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,a,i);break;case 3:case 4:var o=r.stateNode.containerInfo,l=i_(e);!function e(t,n,r){var i=t.tag;if(5===i||6===i)t=t.stateNode,n?ey(r,t,n):ep(r,t);else if(4!==i&&null!==(t=t.child))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,l,o);break;default:throw Error(d(161))}}}catch(t){a$(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function iV(e){for(;null!==ik;){var t=ik;if(0!=(8772&t.flags)){var n=t.alternate;try{if(0!=(8772&t.flags))switch(t.tag){case 0:case 11:case 15:iC||iR(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!iC){if(null===n)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:rB(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}}var a=t.updateQueue;null!==a&&nN(t,a,r);break;case 3:var o=t.updateQueue;if(null!==o){if(n=null,null!==t.child)switch(t.child.tag){case 5:n=D(t.child.stateNode);break;case 1:n=t.child.stateNode}nN(t,o,n)}break;case 5:var l=t.stateNode;null===n&&4&t.flags&&eg(l,t.type,t.memoizedProps,t);break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(J&&null===t.memoizedState){var s=t.alternate;if(null!==s){var c=s.memoizedState;if(null!==c){var u=c.dehydrated;null!==u&&eK(u)}}}break;default:throw Error(d(163))}iC||512&t.flags&&iA(t)}catch(e){a$(t,t.return,e)}}if(t===e){ik=null;break}if(null!==(n=t.sibling)){n.return=t.return,ik=n;break}ik=t.return}}function ij(e){for(;null!==ik;){var t=ik;if(t===e){ik=null;break}var n=t.sibling;if(null!==n){n.return=t.return,ik=n;break}ik=t.return}}function i$(e){for(;null!==ik;){var t=ik;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{iR(4,t)}catch(e){a$(t,n,e)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var i=t.return;try{r.componentDidMount()}catch(e){a$(t,i,e)}}var a=t.return;try{iA(t)}catch(e){a$(t,a,e)}break;case 5:var o=t.return;try{iA(t)}catch(e){a$(t,o,e)}}}catch(e){a$(t,t.return,e)}if(t===e){ik=null;break}var l=t.sibling;if(null!==l){l.return=t.return,ik=l;break}ik=t.return}}var iU=0,iW=1,iG=2,iq=3,iZ=4;if("function"==typeof Symbol&&Symbol.for){var iX=Symbol.for;iU=iX("selector.component"),iW=iX("selector.has_pseudo_class"),iG=iX("selector.role"),iq=iX("selector.test_id"),iZ=iX("selector.text")}function iY(e){var t=Q(e);if(null!=t){if("string"!=typeof t.memoizedProps["data-testname"])throw Error(d(364));return t}if(null===(e=eo(e)))throw Error(d(362));return e.stateNode.current}function iK(e,t){switch(t.$$typeof){case iU:if(e.type===t.value)return!0;break;case iW:e:{t=t.value,e=[e,0];for(var n=0;n<e.length;){var r=e[n++],i=e[n++],a=t[i];if(5!==r.tag||!ec(r)){for(;null!=a&&iK(r,a);)a=t[++i];if(i===t.length){t=!0;break e}for(r=r.child;null!==r;)e.push(r,i),r=r.sibling}}t=!1}return t;case iG:if(5===e.tag&&eu(e.stateNode,t.value))return!0;break;case iZ:if((5===e.tag||6===e.tag)&&null!==(e=es(e))&&0<=e.indexOf(t.value))return!0;break;case iq:if(5===e.tag&&"string"==typeof(e=e.memoizedProps["data-testname"])&&e.toLowerCase()===t.value.toLowerCase())return!0;break;default:throw Error(d(365))}return!1}function iJ(e){switch(e.$$typeof){case iU:return"<"+(M(e.value)||"Unknown")+">";case iW:return":has("+(iJ(e)||"")+")";case iG:return'[role="'+e.value+'"]';
8case iZ:return'"'+e.value+'"';case iq:return'[data-testname="'+e.value+'"]';default:throw Error(d(365))}}function iQ(e,t){var n=[];e=[e,0];for(var r=0;r<e.length;){var i=e[r++],a=e[r++],o=t[a];if(5!==i.tag||!ec(i)){for(;null!=o&&iK(i,o);)o=t[++a];if(a===t.length)n.push(i);else for(i=i.child;null!==i;)e.push(i,a),i=i.sibling}}return n}function i0(e,t){if(!ea)throw Error(d(363));e=iQ(e=iY(e),t),t=[],e=Array.from(e);for(var n=0;n<e.length;){var r=e[n++];if(5===r.tag)ec(r)||t.push(r.stateNode);else for(r=r.child;null!==r;)e.push(r),r=r.sibling}return t}var i1=Math.ceil,i2=h.ReactCurrentDispatcher,i4=h.ReactCurrentOwner,i3=h.ReactCurrentBatchConfig,i8=0,i6=null,i5=null,i9=0,i7=0,ae=e7(0),at=0,an=null,ar=0,ai=0,aa=0,ao=null,al=null,as=0,ac=1/0,au=null;function ad(){ac=tL()+500}var ah=!1,af=null,ap=null,am=!1,ag=null,av=0,ab=0,ay=null,aw=-1,ax=0;function aC(){return 0!=(6&i8)?tL():-1!==aw?aw:aw=tL()}function aE(e){return 0==(1&e.mode)?1:0!=(2&i8)&&0!==i9?i9&-i9:null!==nl.transition?(0===ax&&(ax=tx()),ax):0!==(e=tS)?e:et()}function ak(e,t,n,r){if(50<ab)throw ab=0,ay=null,Error(d(185));tE(e,n,r),(0==(2&i8)||e!==i6)&&(e===i6&&(0==(2&i8)&&(ai|=n),4===at&&aR(e,i9)),aS(e,r),1===n&&0===i8&&0==(1&t.mode)&&(ad(),tH&&t$()))}function aS(e,t){var n,r=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-tf(a),l=1<<o,s=i[o];-1===s?(0==(l&n)||0!=(l&r))&&(i[o]=function(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return -1}}(l,t)):s<=t&&(e.expiredLanes|=l),a&=~l}}(e,t);var i=ty(e,e===i6?i9:0);if(0===i)null!==r&&tM(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(null!=r&&tM(r),1===t)0===e.tag?(n=aA.bind(null,e),tH=!0,tj(n)):tj(aA.bind(null,e)),er?ei(function(){0==(6&i8)&&t$()}):tP(t_,t$),r=null;else{switch(tT(i)){case 1:r=t_;break;case 4:r=tI;break;case 16:default:r=tO;break;case 536870912:r=tD}r=tP(r,aT.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function aT(e,t){if(aw=-1,ax=0,0!=(6&i8))throw Error(d(327));var n=e.callbackNode;if(aV()&&e.callbackNode!==n)return null;var r=ty(e,e===i6?i9:0);if(0===r)return null;if(0!=(30&r)||0!=(r&e.expiredLanes)||t)t=aN(e,r);else{t=r;var i=i8;i8|=2;var a=aD();for((i6!==e||i9!==t)&&(au=null,ad(),aI(e,t));;)try{!function(){for(;null!==i5&&!tR();)aF(i5)}();break}catch(t){aO(e,t)}ny(),i2.current=a,i8=i,null!==i5?t=0:(i6=null,i9=0,t=at)}if(0!==t){if(2===t&&0!==(i=tw(e))&&(r=i,t=aP(e,i)),1===t)throw n=an,aI(e,0),aR(e,r),aS(e,tL()),n;if(6===t)aR(e,r);else{if(i=e.current.alternate,0==(30&r)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!tF(a(),i))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}
vendor: 22,786 bytes, line 8
8(i)&&(2===(t=aN(e,r))&&0!==(a=tw(e))&&(r=a,t=aP(e,a)),1===t))throw n=an,aI(e,0),aR(e,r),aS(e,tL()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(d(345));case 2:case 5:aH(e,al,au);break;case 3:if(aR(e,r),(130023424&r)===r&&10<(t=as+500-tL())){if(0!==ty(e,0))break;if(((i=e.suspendedLanes)&r)!==r){aC(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=G(aH.bind(null,e,al,au),t);break}aH(e,al,au);break;case 4:if(aR(e,r),(4194240&r)===r)break;for(i=-1,t=e.eventTimes;0<r;){var o=31-tf(r);a=1<<o,(o=t[o])>i&&(i=o),r&=~a}if(r=i,10<(r=(120>(r=tL()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*i1(r/1960))-r)){e.timeoutHandle=G(aH.bind(null,e,al,au),r);break}aH(e,al,au);break;default:throw Error(d(329))}}}return aS(e,tL()),e.callbackNode===n?aT.bind(null,e):null}function aP(e,t){var n=ao;return e.current.memoizedState.isDehydrated&&(aI(e,t).flags|=256),2!==(e=aN(e,t))&&(t=al,al=n,null!==t&&aM(t)),e}function aM(e){null===al?al=e:al.push.apply(al,e)}function aR(e,t){for(t&=~aa,t&=~ai,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-tf(t),r=1<<n;e[n]=-1,t&=~r}}function aA(e){if(0!=(6&i8))throw Error(d(327));aV();var t=ty(e,0);if(0==(1&t))return aS(e,tL()),null;var n=aN(e,t);if(0!==e.tag&&2===n){var r=tw(e);0!==r&&(t=r,n=aP(e,r))}if(1===n)throw n=an,aI(e,0),aR(e,t),aS(e,tL()),n;if(6===n)throw Error(d(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,aH(e,al,au),aS(e,tL()),null}function aL(e){null!==ag&&0===ag.tag&&0==(6&i8)&&aV();var t=i8;i8|=1;var n=i3.transition,r=tS;try{if(i3.transition=null,tS=1,e)return e()}finally{tS=r,i3.transition=n,0==(6&(i8=t))&&t$()}}function a_(){i7=ae.current,te(ae)}function aI(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==Z&&(e.timeoutHandle=Z,q(n)),null!==i5)for(n=i5.return;null!==n;){var r=n;switch(t2(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&ts();break;case 3:nU(),te(ti),te(tr),nY();break;case 5:nG(r);break;case 4:nU();break;case 13:case 19:te(nq);break;case 10:nx(r.type._context);break;case 22:case 23:a_()}n=n.return}if(i6=e,i5=e=aK(e.current,null),i9=i7=t,at=0,an=null,aa=ai=ar=0,al=ao=null,null!==nS){for(t=0;t<nS.length;t++)if(null!==(r=(n=nS[t]).interleaved)){n.interleaved=null;var i=r.next,a=n.pending;if(null!==a){var o=a.next;a.next=i,r.next=o}n.pending=r}nS=null}return e}function aO(e,t){for(;;){var n=i5;try{if(ny(),nK.current=rD,n4){for(var r=n0.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}n4=!1}if(nQ=0,n2=n1=n0=null,n3=!1,n8=0,i4.current=null,null===n||null===n.return){at=1,an=t,i5=null;break}e:{var a=e,o=n.return,l=n,s=t;if(t=i9,l.flags|=32768,null!==s&&"object"==typeof s&&"function"==typeof s.then){var c=s,u=l,h=u.tag;if(0==(1&u.mode)&&(0===h||11===h||15===h)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=rQ(o);if(null!==p){p.flags&=-257,r0(p,o,l,a,t),1&p.mode&&rJ(a,c,t),t=p,s=c;var m=t.updateQueue;if(null===m){var g=new Set;g.add(s),t.updateQueue=g}else m.add(s);break e}if(0==(1&t)){rJ(a,c,t),az();break e}s=Error(d(426))}else if(t8&&1&l.mode){var v=rQ(o);if(null!==v){0==(65536&v.flags)&&(v.flags|=256),r0(v,o,l,a,t),no(rG(s,l));break e}}a=s=rG(s,l),4!==at&&(at=2),null===ao?ao=[a]:ao.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var b=rY(a,s,t);nD(a,b);break e;case 1:l=s;var y=a.type,w=a.stateNode;if(0==(128&a.flags)&&("function"==typeof y.getDerivedStateFromError||null!==w&&"function"==typeof w.componentDidCatch&&(null===ap||!ap.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var x=rK(a,l,t);nD(a,x);break e}}a=a.return}while(null!==a)}aB(n)}catch(e){t=e,i5===n&&null!==n&&(i5=n=n.return);continue}break}}function aD(){var e=i2.current;return i2.current=rD,null===e?rD:e}function az(){(0===at||3===at||2===at)&&(at=4),null===i6||0==(268435455&ar)&&0==(268435455&ai)||aR(i6,i9)}function aN(e,t){var n=i8;i8|=2;var r=aD();for((i6!==e||i9!==t)&&(au=null,aI(e,t));;)try{!function(){for(;null!==i5;)aF(i5)}();break}catch(t){aO(e,t)}if(ny(),i8=n,i2.current=r,null!==i5)throw Error(d(261));return i6=null,i9=0,at}function aF(e){var t=o(e.alternate,e,i7);e.memoizedProps=e.pendingProps,null===t?aB(e):i5=t,i4.current=null}function aB(e){var n=e;do{var o=n.alternate;if(e=n.return,0==(32768&n.flags)){if(null!==(o=function(e,n,o){var l=n.pendingProps;switch(t2(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return iw(n),null;case 1:case 17:return tl(n.type)&&ts(),iw(n),null;case 3:return o=n.stateNode,nU(),te(ti),te(tr),nY(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(null===e||null===e.child)&&(nr(n)?ig(n):null===e||e.memoizedState.isDehydrated&&0==(256&n.flags)||(n.flags|=1024,null!==t5&&(aM(t5),t5=null))),r(e,n),iw(n),null;case 5:nG(n),o=nj(nV.current);var s=n.type;if(null!==e&&null!=n.stateNode)i(e,n,s,l,o),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!l){if(null===n.stateNode)throw Error(d(166));return iw(n),null}if(e=nj(nB.current),nr(n)){if(!J)throw Error(d(175));e=eG(n.stateNode,n.type,n.memoizedProps,o,e,n,!t6),n.updateQueue=e,null!==e&&ig(n)}else{var c=H(s,l,o,e,n);t(c,n,!1,!1),n.stateNode=c,j(c,s,l,o,e)&&ig(n)}null!==n.ref&&(n.flags|=512,n.flags|=2097152)}return iw(n),null;case 6:if(e&&null!=n.stateNode)a(e,n,e.memoizedProps,l);else{if("string"!=typeof l&&null===n.stateNode)throw Error(d(166));if(e=nj(nV.current),o=nj(nB.current),nr(n)){if(!J)throw Error(d(176));if((l=eq(e=n.stateNode,o=n.memoizedProps,n,!t6))&&null!==(s=t4))switch(s.tag){case 3:e1(s.stateNode.containerInfo,e,o,0!=(1&s.mode));break;case 5:e2(s.type,s.memoizedProps,s.stateNode,e,o,0!=(1&s.mode))}l&&ig(n)}else n.stateNode=W(l,e,o,n)}return iw(n),null;case 13:if(te(nq),l=n.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(t8&&null!==t3&&0!=(1&n.mode)&&0==(128&n.flags))ni(),na(),n.flags|=98560,s=!1;else if(s=nr(n),null!==l&&null!==l.dehydrated){if(null===e){if(!s)throw Error(d(318));if(!J)throw Error(d(344));if(!(s=null!==(s=n.memoizedState)?s.dehydrated:null))throw Error(d(317));eZ(s,n)}else na(),0==(128&n.flags)&&(n.memoizedState=null),n.flags|=4;iw(n),s=!1}else null!==t5&&(aM(t5),t5=null),s=!0;if(!s)return 65536&n.flags?n:null}if(0!=(128&n.flags))return n.lanes=o,n;return(o=null!==l)!=(null!==e&&null!==e.memoizedState)&&o&&(n.child.flags|=8192,0!=(1&n.mode)&&(null===e||0!=(1&nq.current)?0===at&&(at=3):az())),null!==n.updateQueue&&(n.flags|=4),iw(n),null;case 4:return nU(),r(e,n),null===e&&ee(n.stateNode.containerInfo),iw(n),null;case 10:return nx(n.type._context),iw(n),null;case 19:if(te(nq),null===(s=n.memoizedState))return iw(n),null;if(l=0!=(128&n.flags),null===(c=s.rendering)){if(l)iy(s,!1);else{if(0!==at||null!==e&&0!=(128&e.flags))for(e=n.child;null!==e;){if(null!==(c=nZ(e))){for(n.flags|=128,iy(s,!1),null!==(e=c.updateQueue)&&(n.updateQueue=e,n.flags|=4),n.subtreeFlags=0,e=o,o=n.child;null!==o;)l=o,s=e,l.flags&=14680066,null===(c=l.alternate)?(l.childLanes=0,l.lanes=s,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=c.childLanes,l.lanes=c.lanes,l.child=c.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=c.memoizedProps,l.memoizedState=c.memoizedState,l.updateQueue=c.updateQueue,l.type=c.type,s=c.dependencies,l.dependencies=null===s?null:{lanes:s.lanes,firstContext:s.firstContext}),o=o.sibling;return tt(nq,1&nq.current|2),n.child}e=e.sibling}null!==s.tail&&tL()>ac&&(n.flags|=128,l=!0,iy(s,!1),n.lanes=4194304)}}else{if(!l){if(null!==(e=nZ(c))){if(n.flags|=128,l=!0,null!==(e=e.updateQueue)&&(n.updateQueue=e,n.flags|=4),iy(s,!0),null===s.tail&&"hidden"===s.tailMode&&!c.alternate&&!t8)return iw(n),null}else 2*tL()-s.renderingStartTime>ac&&1073741824!==o&&(n.flags|=128,l=!0,iy(s,!1),n.lanes=4194304)}s.isBackwards?(c.sibling=n.child,n.child=c):(null!==(e=s.last)?e.sibling=c:n.child=c,s.last=c)}if(null!==s.tail)return n=s.tail,s.rendering=n,s.tail=n.sibling,s.renderingStartTime=tL(),n.sibling=null,e=nq.current,tt(nq,l?1&e|2:1&e),n;return iw(n),null;case 22:case 23:return a_(),o=null!==n.memoizedState,null!==e&&null!==e.memoizedState!==o&&(n.flags|=8192),o&&0!=(1&n.mode)?0!=(1073741824&i7)&&(iw(n),Y&&6&n.subtreeFlags&&(n.flags|=8192)):iw(n),null;case 24:case 25:return null}throw Error(d(156,n.tag))}(o,n,i7))){i5=o;return}}else{if(null!==(o=function(e,t){switch(t2(t),t.tag){case 1:return tl(t.type)&&ts(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return nU(),te(ti),te(tr),nY(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return nG(t),null;case 13:if(te(nq),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(d(340));na()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return te(nq),null;case 4:return nU(),null;case 10:return nx(t.type._context),null;case 22:case 23:return a_(),null;default:return null}}(o,n))){o.flags&=32767,i5=o;return}if(null!==e)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{at=6,i5=null;return}}if(null!==(n=n.sibling)){i5=n;return}i5=n=e}while(null!==n);0===at&&(at=5)}function aH(e,t,n){var r=tS,i=i3.transition;try{i3.transition=null,tS=1,function(e,t,n,r){do aV();while(null!==ag);if(0!=(6&i8))throw Error(d(327));n=e.finishedWork;var i=e.finishedLanes;if(null!==n){if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(d(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-tf(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}(e,a),e===i6&&(i5=i6=null,i9=0),0==(2064&n.subtreeFlags)&&0==(2064&n.flags)||am||(am=!0,o=tO,l=function(){return aV(),null},tP(o,l)),a=0!=(15990&n.flags),0!=(15990&n.subtreeFlags)||a){a=i3.transition,i3.transition=null;var o,l,s,c,u,h=tS;tS=1;var f=i8;i8|=4,i4.current=null,function(e,t){for(F(e.containerInfo),ik=t;null!==ik;)if(t=(e=ik).child,0!=(1028&e.subtreeFlags)&&null!==t)t.return=e,ik=t;else for(;null!==ik;){e=ik;try{var n=e.alternate;if(0!=(1024&e.flags))switch(e.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==n){var r=n.memoizedProps,i=n.memoizedState,a=e.stateNode,o=a.getSnapshotBeforeUpdate(e.elementType===e.type?r:rB(e.type,r),i);a.__reactInternalSnapshotBeforeUpdate=o}break;case 3:Y&&eP(e.stateNode.containerInfo);break;default:throw Error(d(163))}}catch(t){a$(e,e.return,t)}if(null!==(t=e.sibling)){t.return=e.return,ik=t;break}ik=e.return}n=iP,iP=!1}(e,n),iB(n,e),B(e.containerInfo),e.current=n,s=n,c=e,u=i,ik=s,function e(t,n,r){for(var i=0!=(1&t.mode);null!==ik;){var a=ik,o=a.child;if(22===a.tag&&i){var l=null!==a.memoizedState||ix;if(!l){var s=a.alternate,c=null!==s&&null!==s.memoizedState||iC;s=ix;var u=iC;if(ix=l,(iC=c)&&!u)for(ik=a;null!==ik;)c=(l=ik).child,22===l.tag&&null!==l.memoizedState?i$(a):null!==c?(c.return=l,ik=c):i$(a);for(;null!==o;)ik=o,e(o,n,r),o=o.sibling;ik=a,ix=s,iC=u}iV(t,n,r)}else 0!=(8772&a.subtreeFlags)&&null!==o?(o.return=a,ik=o):iV(t,n,r)}}(s,c,u),tA(),i8=f,tS=h,i3.transition=a}else e.current=n;if(am&&(am=!1,ag=e,av=i),0===(a=e.pendingLanes)&&(ap=null),function(e){if(tN&&"function"==typeof tN.onCommitFiberRoot)try{tN.onCommitFiberRoot(tz,e,void 0,128==(128&e.current.flags))}catch(e){}}(n.stateNode,r),aS(e,tL()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)r((i=t[n]).value,{componentStack:i.stack,digest:i.digest});if(ah)throw ah=!1,e=af,af=null,e;0!=(1&av)&&0!==e.tag&&aV(),0!=(1&(a=e.pendingLanes))?e===ay?ab++:(ab=0,ay=e):ab=0,t$()}}(e,t,n,r)}finally{i3.transition=i,tS=r}return null}function aV(){if(null!==ag){var e=tT(av),t=i3.transition,n=tS;try{if(i3.transition=null,tS=16>e?16:e,null===ag)var r=!1;else{if(e=ag,ag=null,av=0,0!=(6&i8))throw Error(d(331));var i=i8;for(i8|=4,ik=e.current;null!==ik;){var a=ik,o=a.child;if(0!=(16&ik.flags)){var l=a.deletions;if(null!==l){for(var s=0;s<l.length;s++){var c=l[s];for(ik=c;null!==ik;){var u=ik;switch(u.tag){case 0:case 11:case 15:iM(8,u,a)}var h=u.child;if(null!==h)h.return=u,ik=h;else for(;null!==ik;){var f=(u=ik).sibling,p=u.return;if(!function e(t){var n=t.alternate;null!==n&&(t.alternate=null,e(n)),t.child=null,t.deletions=null,t.sibling=null,5===t.tag&&null!==(n=t.stateNode)&&en(n),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}(u),u===c){ik=null;break}if(null!==f){f.return=p,ik=f;break}ik=p}}}var m=a.alternate;if(null!==m){var g=m.child;if(null!==g){m.child=null;do{var v=g.sibling;g.sibling=null,g=v}while(null!==g)}}ik=a}}if(0!=(2064&a.subtreeFlags)&&null!==o)o.return=a,ik=o;else for(;null!==ik;){if(a=ik,0!=(2048&a.flags))switch(a.tag){case 0:case 11:case 15:iM(9,a,a.return)}var b=a.sibling;if(null!==b){b.return=a.return,ik=b;break}ik=a.return}}var y=e.current;for(ik=y;null!==ik;){var w=(o=ik).child;if(0!=(2064&o.subtreeFlags)&&null!==w)w.return=o,ik=w;else for(o=y;null!==ik;){if(l=ik,0!=(2048&l.flags))try{switch(l.tag){case 0:case 11:case 15:iR(9,l)}}catch(e){a$(l,l.return,e)}if(l===o){ik=null;break}var x=l.sibling;if(null!==x){x.return=l.return,ik=x;break}ik=l.return}}if(i8=i,t$(),tN&&"function"==typeof tN.onPostCommitFiberRoot)try{tN.onPostCommitFiberRoot(tz,e)}catch(e){}r=!0}return r}finally{tS=n,i3.transition=t}}return!1}function aj(e,t,n){t=rY(e,t=rG(n,t),1),e=nI(e,t,1),t=aC(),null!==e&&(tE(e,1,t),aS(e,t))}function a$(e,t,n){if(3===e.tag)aj(e,e,n);else for(;null!==t;){if(3===t.tag){aj(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===ap||!ap.has(r))){e=rK(t,e=rG(n,e),1),t=nI(t,e,1),e=aC(),null!==t&&(tE(t,1,e),aS(t,e));break}}t=t.return}}function aU(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=aC(),e.pingedLanes|=e.suspendedLanes&n,i6===e&&(i9&n)===n&&(4===at||3===at&&(130023424&i9)===i9&&500>tL()-as?aI(e,0):aa|=n),aS(e,t)}function aW(e,t){0===t&&(0==(1&e.mode)?t=1:(t=tv,0==(130023424&(tv<<=1))&&(tv=4194304)));var n=aC();null!==(e=nM(e,t))&&(tE(e,t,n),aS(e,n))}function aG(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),aW(e,n)}function aq(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(d(314))}null!==r&&r.delete(t),aW(e,n)}function aZ(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function aX(e,t,n,r){return new aZ(e,t,n,r)}function aY(e){return!(!(e=e.prototype)||!e.isReactComponent)}function aK(e,t){var n=e.alternate;return null===n?((n=aX(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function aJ(e,t,n,r,i,a){var o=2;if(r=e,"function"==typeof e)aY(e)&&(o=1);else if("string"==typeof e)o=5;else e:switch(e){case m:return aQ(n.children,i,a,t);case g:o=8,i|=8;break;case v:return(e=aX(12,n,t,2|i)).elementType=v,e.lanes=a,e;case x:return(e=aX(13,n,t,i)).elementType=x,e.lanes=a,e;case C:return(e=aX(19,n,t,i)).elementType=C,e.lanes=a,e;case S:return a0(n,i,a,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case b:o=10;break e;case y:o=9;break e;case w:o=11;break e;case E:o=14;break e;case k:o=16,r=null;break e}throw Error(d(130,null==e?e:typeof e,""))}return(t=aX(o,n,t,i)).elementType=e,t.type=r,t.lanes=a,t}function aQ(e,t,n,r){return(e=aX(7,e,r,t)).lanes=n,e}function a0(e,t,n,r){return(e=aX(22,e,r,t)).elementType=S,e.lanes=n,e.stateNode={isHidden:!1},e}function a1(e,t,n){return(e=aX(6,e,null,t)).lanes=n,e}function a2(e,t,n){return(t=aX(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function a4(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Z,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=tC(0),this.expirationTimes=tC(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tC(0),this.identifierPrefix=r,this.onRecoverableError=i,J&&(this.mutableSourceEagerHydrationData=null)}function a3(e,t,n,r,i,a,o,l,s){return e=new a4(e,t,n,l,s),1===t?(t=1,!0===a&&(t|=8)):t=0,a=aX(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},nA(a),e}function a8(e){if(!e)return tn;e=e._reactInternals;e:{if(R(e)!==e||1!==e.tag)throw Error(d(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(tl(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(d(171))}if(1===e.tag){var n=e.type;if(tl(n))return tu(e,n,t)}return t}function a6(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(d(188));throw Error(d(268,e=Object.keys(e).join(",")))}return null===(e=_(t))?null:e.stateNode}function a5(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function a9(e,t){a5(e,t),(e=e.alternate)&&a5(e,t)}function a7(e){return null===(e=_(e))?null:e.stateNode}function oe(){return null}return o=function(e,t,n){if(null!==e){if(e.memoizedProps!==t.pendingProps||ti.current)r2=!0;else{if(0==(e.lanes&n)&&0==(128&t.flags))return r2=!1,function(e,t,n){switch(t.tag){case 3:ir(t),na();break;case 5:nW(t);break;case 1:tl(t.type)&&td(t);break;case 4:n$(t,t.stateNode.containerInfo);break;case 10:nw(t,t.type._context,t.memoizedProps.value);break;case 13:var r=t.memoizedState;if(null!==r){if(null!==r.dehydrated)return tt(nq,1&nq.current),t.flags|=128,null;if(0!=(n&t.child.childLanes))return il(e,t,n);return tt(nq,1&nq.current),null!==(e=im(e,t,n))?e.sibling:null}tt(nq,1&nq.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(128&e.flags)){if(r)return ih(e,t,n);t.flags|=128}var i=t.memoizedState;if(null!==i&&(i.rendering=null,i.tail=null,i.lastEffect=null),tt(nq,nq.current),!r)return null;break;case 22:case 23:return t.lanes=0,r5(e,t,n)}return im(e,t,n)}(e,t,n);r2=0!=(131072&e.flags)}}else r2=!1,t8&&0!=(1048576&t.flags)&&t0(t,tq,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ip(e,t),e=t.pendingProps;var i=to(t,tr.current);nE(t,n),i=n7(null,t,r,e,i,n);var a=re();return t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,tl(r)?(a=!0,td(t)):a=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,nA(t),i.updater=rV,t.stateNode=i,i._reactInternals=t,rW(t,r,e,n),t=it(null,t,r,!0,a,n)):(t.tag=0,t8&&a&&t1(t),r4(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ip(e,t),e=t.pendingProps,r=(i=r._init)(r._payload),t.type=r,i=t.tag=function(e){if("function"==typeof e)return aY(e)?1:0;if(null!=e){if((e=e.$$typeof)===w)return 11;if(e===E)return 14}return 2}(r),e=rB(r,e),i){case 0:t=r7(null,t,r,e,n);break e;case 1:t=ie(null,t,r,e,n);break e;case 11:t=r3(null,t,r,e,n);break e;case 14:t=r8(null,t,r,rB(r.type,e),n);break e}throw Error(d(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:rB(r,i),r7(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:rB(r,i),ie(e,t,r,i,n);case 3:e:{if(ir(t),null===e)throw Error(d(387));r=t.pendingProps,i=(a=t.memoizedState).element,nL(e,t),nz(t,r,null,n);var o=t.memoizedState;if(r=o.element,J&&a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){i=rG(Error(d(423)),t),t=ii(e,t,r,n,i);break e}if(r!==i){i=rG(Error(d(424)),t),t=ii(e,t,r,n,i);break e}for(J&&(t3=eU(t.stateNode.containerInfo),t4=t,t8=!0,t5=null,t6=!1),n=np(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(na(),r===i){t=im(e,t,n);break e}r4(e,t,r,n)}t=t.child}return t;case 5:return nW(t),null===e&&nt(t),r=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,o=i.children,U(r,i)?o=null:null!==a&&U(r,a)&&(t.flags|=32),r9(e,t),r4(e,t,o,n),t.child;case 6:return null===e&&nt(t),null;case 13:return il(e,t,n);case 4:return n$(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=nf(t,null,r,n):r4(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:rB(r,i),r3(e,t,r,i,n);case 7:return r4(e,t,t.pendingProps,n),t.child;case 8:case 12:return r4(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,nw(t,r,o=i.value),null!==a){if(tF(a.value,o)){if(a.children===i.children&&!ti.current){t=im(e,t,n);break e}}else for(null!==(a=t.child)&&(a.return=t);null!==a;){var l=a.dependencies;if(null!==l){o=a.child;for(var s=l.firstContext;null!==s;){if(s.context===r){if(1===a.tag){(s=n_(-1,n&-n)).tag=2;var c=a.updateQueue;if(null!==c){var u=(c=c.shared).pending;null===u?s.next=s:(s.next=u.next,u.next=s),c.pending=s}}a.lanes|=n,null!==(s=a.alternate)&&(s.lanes|=n),nC(a.return,n,t),l.lanes|=n;break}s=s.next}}else if(10===a.tag)o=a.type===t.type?null:a.child;else if(18===a.tag){if(null===(o=a.return))throw Error(d(341));o.lanes|=n,null!==(l=o.alternate)&&(l.lanes|=n),nC(o,n,t),o=a.sibling}else o=a.child;if(null!==o)o.return=a;else for(o=a;null!==o;){if(o===t){o=null;break}if(null!==(a=o.sibling)){a.return=o.return,o=a;break}o=o.return}a=o}}r4(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,nE(t,n),r=r(i=nk(i)),t.flags|=1,r4(e,t,r,n),t.child;case 14:return i=rB(r=t.type,t.pendingProps),i=rB(r.type,i),r8(e,t,r,i,n);case 15:return r6(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:rB(r,i),ip(e,t),t.tag=1,tl(r)?(e=!0,td(t)):e=!1,nE(t,n),r$(t,r,i),rW(t,r,i,n),it
8(null,t,r,!0,e,n);case 19:return ih(e,t,n);case 22:return r5(e,t,n)}throw Error(d(156,t.tag))},l.attemptContinuousHydration=function(e){if(13===e.tag){var t=nM(e,134217728);null!==t&&ak(t,e,134217728,aC()),a9(e,134217728)}},l.attemptDiscreteHydration=function(e){if(13===e.tag){var t=nM(e,1);null!==t&&ak(t,e,1,aC()),a9(e,1)}},l.attemptHydrationAtCurrentPriority=function(e){if(13===e.tag){var t=aE(e),n=nM(e,t);null!==n&&ak(n,e,t,aC()),a9(e,t)}},l.attemptSynchronousHydration=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=tb(t.pendingLanes);0!==n&&(tk(t,1|n),aS(t,tL()),0==(6&i8)&&(ad(),t$()))}break;case 13:aL(function(){var t=nM(e,1);null!==t&&ak(t,e,1,aC())}),a9(e,1)}},l.batchedUpdates=function(e,t){var n=i8;i8|=1;try{return e(t)}finally{0===(i8=n)&&(ad(),tH&&t$())}},l.createComponentSelector=function(e){return{$$typeof:iU,value:e}},l.createContainer=function(e,t,n,r,i,a,o){return a3(e,t,!1,null,n,r,i,a,o)},l.createHasPseudoClassSelector=function(e){return{$$typeof:iW,value:e}},l.createHydrationContainer=function(e,t,n,r,i,a,o,l,s){return(e=a3(n,r,!0,e,i,a,o,l,s)).context=a8(null),n=e.current,(a=n_(r=aC(),i=aE(n))).callback=null!=t?t:null,nI(n,a,i),e.current.lanes=i,tE(e,i,r),aS(e,r),e},l.createPortal=function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:p,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}},l.createRoleSelector=function(e){return{$$typeof:iG,value:e}},l.createTestNameSelector=function(e){return{$$typeof:iq,value:e}},l.createTextSelector=function(e){return{$$typeof:iZ,value:e}},l.deferredUpdates=function(e){var t=tS,n=i3.transition;try{return i3.transition=null,tS=16,e()}finally{tS=t,i3.transition=n}},l.discreteUpdates=function(e,t,n,r,i){var a=tS,o=i3.transition;try{return i3.transition=null,tS=1,e(t,n,r,i)}finally{tS=a,i3.transition=o,0===i8&&ad()}},l.findAllNodes=i0,l.findBoundingRects=function(e,t){if(!ea)throw Error(d(363));t=i0(e,t),e=[];for(var n=0;n<t.length;n++)e.push(el(t[n]));for(t=e.length-1;0<t;t--){n=e[t];for(var r=n.x,i=r+n.width,a=n.y,o=a+n.height,l=t-1;0<=l;l--)if(t!==l){var s=e[l],c=s.x,u=c+s.width,h=s.y,f=h+s.height;if(r>=c&&a>=h&&i<=u&&o<=f){e.splice(t,1);break}if(r!==c||n.width!==s.width||f<a||h>o){if(!(a!==h||n.height!==s.height||u<r||c>i)){c>r&&(s.width+=c-r,s.x=r),u<i&&(s.width=i-c),e.splice(t,1);break}}else{h>a&&(s.height+=h-a,s.y=a),f<o&&(s.height=o-h),e.splice(t,1);break}}}return e},l.findHostInstance=a6,l.findHostInstanceWithNoPortals=function(e){return null===(e=null!==(e=L(e))?function e(t){if(5===t.tag||6===t.tag)return t;for(t=t.child;null!==t;){if(4!==t.tag){var n=e(t);if(null!==n)return n}t=t.sibling}return null}(e):null)?null:e.stateNode},l.findHostInstanceWithWarning=function(e){return a6(e)},l.flushControlled=function(e){var t=i8;i8|=1;var n=i3.transition,r=tS;try{i3.transition=null,tS=1,e()}finally{tS=r,i3.transition=n,0===(i8=t)&&(ad(),t$())}},l.flushPassiveEffects=aV,l.flushSync=aL,l.focusWithin=function(e,t){if(!ea)throw Error(d(363));for(t=Array.from(t=iQ(e=iY(e),t)),e=0;e<t.length;){var n=t[e++];if(!ec(n)){if(5===n.tag&&ed(n.stateNode))return!0;for(n=n.child;null!==n;)t.push(n),n=n.sibling}}return!1},l.getCurrentUpdatePriority=function(){return tS},l.getFindAllNodesFailureDescription=function(e,t){if(!ea)throw Error(d(363));var n=0,r=[];e=[iY(e),0];for(var i=0;i<e.length;){var a=e[i++],o=e[i++],l=t[o];if((5!==a.tag||!ec(a))&&(iK(a,l)&&(r.push(iJ(l)),++o>n&&(n=o)),o<t.length))for(a=a.child;null!==a;)e.push(a,o),a=a.sibling}if(n<t.length){for(e=[];n<t.length;n++)e.push(iJ(t[n]));return"findAllNodes was able to match part of the selector:\n "+r.join(" > ")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},l.getPublicRootInstance=function(e){return(e=e.current).child?5===e.child.tag?D(e.child.stateNode):e.child.stateNode:null},l.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:h.ReactCurrentDispatcher,findHostInstanceByFiber:a7,findFiberByHostInstance:e.findFiberByHostInstance||oe,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;
8if(t.isDisabled||!t.supportsFiber)e=!0;else{try{tz=t.inject(e),tN=t}catch(e){}e=!!t.checkDCE}}return e},l.isAlreadyRendering=function(){return!1},l.observeVisibleRects=function(e,t,n,r){if(!ea)throw Error(d(363));var i=eh(e=i0(e,t),n,r).disconnect;return{disconnect:function(){i()}}},l.registerMutableSourceForHydration=function(e,t){var n=t._getVersion;n=n(t._source),null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)},l.runWithPriority=function(e,t){var n=tS;try{return tS=e,t()}finally{tS=n}},l.shouldError=function(){return null},l.shouldSuspend=function(){return!1},l.updateContainer=function(e,t,n,r){var i=t.current,a=aC(),o=aE(i);return n=a8(n),null===t.context?t.context=n:t.pendingContext=n,(t=n_(a,o)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=nI(i,t,o))&&(ak(e,i,o,a),nO(e,i,o)),o},l}},91270:function(e,t,n){"use strict";e.exports=n(21210)},81263:function(e,t,n){"use strict";e.exports=n(72711)},12988:function(e,t,n){var r,i,a=n(87198),o=n(57406),l=n(7653),s=n(96587);function c(e){return e&&e.__esModule?e.default:e}function u(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}function d(e){null!==e.parentElement&&e.parentElement.removeChild(e)}function h(e){e.forEach(e=>d(e.element))}function f(e){e.forEach(e=>{!function(e,t,n){let r=e.children[n]||null;e.insertBefore(t,r)}(e.parentElement,e.element,e.oldIndex)})}function p(e,t){let n=v(e),r={parentElement:e.from},i=[];switch(n){case"normal":i=[{element:e.item,newIndex:e.newIndex,oldIndex:e.oldIndex,parentElement:e.from}];break;case"swap":i=[{element:e.item,oldIndex:e.oldIndex,newIndex:e.newIndex,...r},{element:e.swapItem,oldIndex:e.newIndex,newIndex:e.oldIndex,...r}];break;case"multidrag":i=e.oldIndicies.map((t,n)=>({element:t.multiDragElement,oldIndex:t.index,newIndex:e.newIndicies[n].index,...r}))}return i.map(e=>({...e,item:t[e.oldIndex]})).sort((e,t)=>e.oldIndex-t.oldIndex)}function m(e,t){let n=[...t];return e.concat().reverse().forEach(e=>n.splice(e.oldIndex,1)),n}function g(e,t,n,r){let i=[...t];return e.forEach(e=>{let t=r&&n&&r(e.item,n);i.splice(e.newIndex,0,t||e.item)}),i}function v(e){return e.oldIndicies&&e.oldIndicies.length>0?"multidrag":e.swapItem?"swap":"normal"}u(e.exports,"Sortable",()=>$882b6d93070905b3$re_export$Sortable),u(e.exports,"Direction",()=>$882b6d93070905b3$re_export$Direction),u(e.exports,"DOMRect",()=>$882b6d93070905b3$re_export$DOMRect),u(e.exports,"GroupOptions",()=>$882b6d93070905b3$re_export$GroupOptions),u(e.exports,"MoveEvent",()=>$882b6d93070905b3$re_export$MoveEvent),u(e.exports,"Options",()=>$882b6d93070905b3$re_export$Options),u(e.exports,"PullResult",()=>$882b6d93070905b3$re_export$PullResult),u(e.exports,"PutResult",()=>$882b6d93070905b3$re_export$PutResult),u(e.exports,"SortableEvent",()=>$882b6d93070905b3$re_export$SortableEvent),u(e.exports,"SortableOptions",()=>$882b6d93070905b3$re_export$SortableOptions),u(e.exports,"Utils",()=>$882b6d93070905b3$re_export$Utils),u(e.exports,"ReactSortable",()=>y);let b={dragging:null};class y extends l.Component{static defaultProps={clone:e=>e};constructor(e){super(e),this.ref=(0,l.createRef)();let t=[...e.list].map(e=>Object.assign(e,{chosen:!1,selected:!1}));e.setList(t,this.sortable,b),c(s)(!e.plugins,` 9Plugins prop is no longer supported.
10Instead, mount it with "Sortable.mount(new MultiDrag())" 11Please read the updated README.md at https://github.com/SortableJS/react-sortablejs. 12 `)}componentDidMount(){if(null===this.ref.current)return;let e=this.makeOptions();c(a).create(this.ref.current,e)}componentDidUpdate(e){e.disabled!==this.props.disabled&&this.sortable&&this.sortable.option("disabled",this.props.disabled)}render(){let{tag:e,style:t,className:n,id:r}=this.props;return(0,l.createElement)(e&&null!==e?e:"div",{ref:this.ref,style:t,className:n,id:r},this.getChildren())}getChildren(){let{children:e,dataIdAttr:t,selectedClass:n="sortable-selected",chosenClass:r="sortable-chosen",dragClass:i="sortable-drag",fallbackClass:a="sortable-falback",ghostClass:s="sortable-ghost",swapClass:u="sortable-swap-highlight",filter:d="sortable-filter",list:h}=this.props;if(!e||null==e)return null;let f=t||"data-id";return(0,l.Children).map(e,(e,t)=>{if(void 0===e)return;let i=h[t]||{},{className:a}=e.props,s="string"==typeof d&&{[d.replace(".","")]:!!i.filtered},u=c(o)(a,{[n]:i.selected,[r]:i.chosen,...s});return(0,l.cloneElement)(e,{[f]:e.key,className:u})})}get sortable(){let e=this.ref.current;if(null===e)return null;let t=Object.keys(e).find(e=>e.includes("Sortable"));return t?e[t]:null}makeOptions(){let e=function(e){let{list:t,setList:n,children:r,tag:i,style:a,className:o,clone:l,onAdd:s,onChange:c,onChoose:u,onClone:d,onEnd:h,onFilter:f,onRemove:p,onSort:m,onStart:g,onUnchoose:v,onUpdate:b,onMove:y,onSpill:w,onSelect:x,onDeselect:C,...E}=e;return E}(this.props);return["onAdd","onChoose","onDeselect","onEnd","onRemove","onSelect","onSpill","onStart","onUnchoose","onUpdate"].forEach(t=>e[t]=this.prepareOnHandlerPropAndDOM(t)),["onChange","onClone","onFilter","onSort"].forEach(t=>e[t]=this.prepareOnHandlerProp(t)),{...e,onMove:(e,t)=>{let{onMove:n}=this.props,r=e.willInsertAfter||-1;if(!n)return r;let i=n(e,t,this.sortable,b);return void 0!==i&&i}}}prepareOnHandlerPropAndDOM(e){return t=>{this.callOnHandlerProp(t,e),this[e](t)}}prepareOnHandlerProp(e){return t=>{this.callOnHandlerProp(t,e)}}callOnHandlerProp(e,t){let n=this.props[t];n&&n(e,this.sortable,b)}onAdd(e){let{list:t,setList:n,clone:r}=this.props,i=p(e,[...b.dragging.props.list]);h(i),n(g(i,t,e,r).map(e=>Object.assign(e,{selected:!1})),this.sortable,b)}onRemove(e){let{list:t,setList:n}=this.props,r=v(e),i=p(e,t);f(i);let a=[...t];if("clone"!==e.pullMode)a=m(i,a);else{let t=i;switch(r){case"multidrag":t=i.map((t,n)=>({...t,element:e.clones[n]}));break;case"normal":t=i.map(t=>({...t,element:e.clone}));break;default:c(s)(!0,`mode "${r}" cannot clone. Please remove "props.clone" from <ReactSortable/> when using the "${r}" plugin`)}h(t),i.forEach(t=>{let n=t.oldIndex,r=this.props.clone(t.item,e);a.splice(n,1,r)})}n(a=a.map(e=>Object.assign(e,{selected:!1})),this.sortable,b)}onUpdate(e){let{list:t,setList:n}=this.props,r=p(e,t);return h(r),f(r),n(function(e,t){let n=m(e,t);return g(e,n)}(r,t),this.sortable,b)}onStart(){b.dragging=this}onEnd(){b.dragging=null}onChoose(e){let{list:t,setList:n}=this.props;n(t.map((t,n)=>{let r=t;return n===e.oldIndex&&(r=Object.assign(t,{chosen:!0})),r}),this.sortable,b)}onUnchoose(e){let{list:t,setList:n}=this.props;n(t.map((t,n)=>{let r=t;return n===e.oldIndex&&(r=Object.assign(r,{chosen:!1})),r}),this.sortable,b)}onSpill(e){let{removeOnSpill:t,revertOnSpill:n}=this.props;t&&!n&&d(e.item)}onSelect(e){let{list:t,setList:n}=this.props,r=t.map(e=>Object.assign(e,{selected:!1}));e.newIndicies.forEach(t=>{let n=t.index;if(-1===n){console.log(`"${e.type}" had indice of "${t.index}", which is probably -1 and doesn't usually happen here.`),console.log(e);return}r[n].selected=!0}),n(r,this.sortable,b)}onDeselect(e){let{list:t,setList:n}=this.props,r=t.map(e=>Object.assign(e,{selected:!1}));e.newIndicies.forEach(e=>{let t=e.index;-1!==t&&(r[t].selected=!0)}),n(r,this.sortable,b)}}
12r=e.exports,Object.keys(i={}).forEach(function(e){"default"===e||"__esModule"===e||r.hasOwnProperty(e)||Object.defineProperty(r,e,{enumerable:!0,get:function(){return i[e]}})})},57406:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var o=i.apply(null,n);o&&e.push(o)}}else if("object"===a){if(n.toString===Object.prototype.toString)for(var l in n)r.call(n,l)&&n[l]&&e.push(l);else e.push(n.toString())}}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0!==(n=(function(){return i}).apply(t,[]))&&(e.exports=n)}()},86445:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(61155),i=n(17610),a=n(31181),o=n(31907),l=n(7653),s=n(45348);function c(e,t){var n=Object.create(null);return e&&l.Children.map(e,function(e){return e}).forEach(function(e){n[e.key]=t&&(0,l.isValidElement)(e)?t(e):e}),n}function u(e,t,n){return null!=n[t]?n[t]:e.props[t]}var d=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},h=function(e){function t(t,n){var r,i=(r=e.call(this,t,n)||this).handleExited.bind((0,a.Z)(r));return r.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},r}(0,o.Z)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,r,i=t.children,a=t.handleExited;
12return{children:t.firstRender?c(e.children,function(t){return(0,l.cloneElement)(t,{onExited:a.bind(null,t),in:!0,appear:u(t,"appear",e),enter:u(t,"enter",e),exit:u(t,"exit",e)})}):(Object.keys(r=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,i=Object.create(null),a=[];for(var o in e)o in t?a.length&&(i[o]=a,a=[]):a.push(o);var l={};for(var s in t){if(i[s])for(r=0;r<i[s].length;r++){var c=i[s][r];l[i[s][r]]=n(c)}l[s]=n(s)}for(r=0;r<a.length;r++)l[a[r]]=n(a[r]);return l}(i,n=c(e.children))).forEach(function(t){var o=r[t];if((0,l.isValidElement)(o)){var s=t in i,c=t in n,d=i[t],h=(0,l.isValidElement)(d)&&!d.props.in;c&&(!s||h)?r[t]=(0,l.cloneElement)(o,{onExited:a.bind(null,o),in:!0,exit:u(o,"exit",e),enter:u(o,"enter",e)}):c||!s||h?c&&s&&(0,l.isValidElement)(d)&&(r[t]=(0,l.cloneElement)(o,{onExited:a.bind(null,o),in:d.props.in,exit:u(o,"exit",e),enter:u(o,"enter",e)})):r[t]=(0,l.cloneElement)(o,{in:!1})}}),r),firstRender:!1}},n.handleExited=function(e,t){var n=c(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=(0,i.Z)({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,i=(0,r.Z)(e,["component","childFactory"]),a=this.state.contextValue,o=d(this.state.children).map(n);return(delete i.appear,delete i.enter,delete i.exit,null===t)?l.createElement(s.Z.Provider,{value:a},o):l.createElement(s.Z.Provider,{value:a},l.createElement(t,i,o))},t}(l.Component);h.propTypes={},h.defaultProps={component:"div",childFactory:function(e){return e}};var f=h},45348:function(e,t,n){"use strict";var r=n(7653);t.Z=r.createContext(null)},95930:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.autoprefix=void 0;var r,i=(r=n(18008))&&r.__esModule?r:{default:r},a=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},o={borderRadius:function(e){return{msBorderRadius:e,MozBorderRadius:e,OBorderRadius:e,WebkitBorderRadius:e,borderRadius:e}},boxShadow:function(e){return{msBoxShadow:e,MozBoxShadow:e,OBoxShadow:e,WebkitBoxShadow:e,boxShadow:e}},userSelect:function(e){return{WebkitTouchCallout:e,KhtmlUserSelect:e,MozUserSelect:e,msUserSelect:e,WebkitUserSelect:e,userSelect:e}},flex:function(e){return{WebkitBoxFlex:e,MozBoxFlex:e,WebkitFlex:e,msFlex:e,flex:e}},flexBasis:function(e){return{WebkitFlexBasis:e,flexBasis:e}},justifyContent:function(e){return{WebkitJustifyContent:e,justifyContent:e}},transition:function(e){return{msTransition:e,MozTransition:e,OTransition:e,WebkitTransition:e,transition:e}},transform:function(e){return{msTransform:e,MozTransform:e,OTransform:e,WebkitTransform:e,transform:e}},absolute:function(e){var t=e&&e.split(" ");return{position:"absolute",top:t&&t[0],right:t&&t[1],bottom:t&&t[2],left:t&&t[3]}},extend:function(e,t){return t[e]||{extend:e}}},l=t.autoprefix=function(e){var t={};return(0,i.default)(e,function(e,n){var r={};(0,i.default)(e,function(e,t){var n=o[t];n?r=a({},r,n(e)):r[t]=e}),t[n]=r}),t};t.default=l},37459:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.active=void 0;var r,i=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},a=(r=n(7653))&&r.__esModule?r:{default:r};function o(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var l=t.active=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function r(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r);for(var n,l,s,c=arguments.length,u=Array(c),d=0;d<c;d++)u[d]=arguments[d];return l=s=o(this,(n=r.__proto__||Object.getPrototypeOf(r)).call.apply(n,[this].concat(u))),s.state={active:!1},s.handleMouseDown=function(){return s.setState({active:!0})},s.handleMouseUp=function(){return s.setState({active:!1})},s.render=function(){return a.default.createElement(t,{onMouseDown:s.handleMouseDown,onMouseUp:s.handleMouseUp},a.default.createElement(e,i({},s.props,s.state)))},o(s,l)}return!function(e,t){if("function"!=typeof t&&null!==t)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)}(r,n),r}(a.default.Component)};t.default=l},82866:function(e,t,n){"use strict";
12Object.defineProperty(t,"__esModule",{value:!0}),t.hover=void 0;var r,i=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},a=(r=n(7653))&&r.__esModule?r:{default:r};function o(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var l=t.hover=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function r(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r);for(var n,l,s,c=arguments.length,u=Array(c),d=0;d<c;d++)u[d]=arguments[d];return l=s=o(this,(n=r.__proto__||Object.getPrototypeOf(r)).call.apply(n,[this].concat(u))),s.state={hover:!1},s.handleMouseOver=function(){return s.setState({hover:!0})},s.handleMouseOut=function(){return s.setState({hover:!1})},s.render=function(){return a.default.createElement(t,{onMouseOver:s.handleMouseOver,onMouseOut:s.handleMouseOut},a.default.createElement(e,i({},s.props,s.state)))},o(s,l)}return!function(e,t){if("function"!=typeof t&&null!==t)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)}(r,n),r}(a.default.Component)};t.default=l},69126:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flattenNames=void 0;var r=l(n(24558)),i=l(n(18008)),a=l(n(40598)),o=l(n(89232));function l(e){return e&&e.__esModule?e:{default:e}}var s=t.flattenNames=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[];return(0,o.default)(t,function(t){Array.isArray(t)?e(t).map(function(e){return n.push(e)}):(0,a.default)(t)?(0,i.default)(t,function(e,t){!0===e&&n.push(t),n.push(t+"-"+e)}):(0,r.default)(t)&&n.push(t)}),n};t.default=s},98746:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReactCSS=t.loop=t.handleActive=t.handleHover=t.hover=void 0;var r=c(n(69126)),i=c(n(17392)),a=c(n(95930)),o=c(n(82866)),l=c(n(37459)),s=c(n(47973));function c(e){return e&&e.__esModule?e:{default:e}}t.hover=o.default,t.handleHover=o.default,t.handleActive=l.default,t.loop=s.default;var u=t.ReactCSS=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var l=(0,r.default)(n),s=(0,i.default)(e,l);return(0,a.default)(s)};t.default=u},47973:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n={},r=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];n[e]=t};return 0===e&&r("first-child"),e===t-1&&r("last-child"),(0===e||e%2==0)&&r("even"),1===Math.abs(e%2)&&r("odd"),r("nth-child",e),n}},17392:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeClasses=void 0;var r=o(n(18008)),i=o(n(97975)),a=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};function o(e){return e&&e.__esModule?e:{default:e}}var l=t.mergeClasses=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.default&&(0,i.default)(e.default)||{};return t.map(function(t){var i=e[t];return i&&(0,r.default)(i,function(e,t){n[t]||(n[t]={}),n[t]=a({},n[t],i[t])}),t}),n};t.default=l},2950:function(e,t){"use strict";var n=function(e){var t=new XMLSerializer;return Array.prototype.map.call(e.childNodes,function(e){return t.serializeToString(e)}).join("")},r=[RegExp("^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)\n?</div>"),RegExp("^(.+)\n")],i=function(e){var t,i,a=n(e);for(t=0;t<r.length;t++)if(i=r[t].exec(a))return i[1]},a=function(e){if(null===e)throw Error("Parse error");var t="parsererror"===e.documentElement.tagName&&"http://www.mozilla.org/newlayout/xml/parsererror.xml"===e.documentElement.namespaceURI?e.documentElement:("xml"===e.documentElement.tagName||"html"===e.documentElement.tagName)&&e.documentElement.childNodes&&e.documentElement.childNodes.length>0&&"parsererror"===e.documentElement.childNodes[0].nodeName?e.documentElement.childNodes[0]:"html"===e.documentElement.tagName&&e.documentElement.childNodes&&e.documentElement.childNodes.length>0&&"body"===e.documentElement.childNodes[0].nodeName&&e.documentElement.childNodes[0].childNodes&&e.documentElement.childNodes[0].childNodes.length&&"parsererror"===e.documentElement.childNodes[0].childNodes[0].nodeName?e.documentElement.childNodes[0].childNodes[0]:void 0;if(void 0!==t)throw Error(i(t)||"Parse error")};t.failOnParseError=function(e){return a(e),e}},33279:function(e,t){"use strict";function n(e,t){var n=e.length;for(e.push(t);0<n;){var r=n-1>>>1,i=e[r];if(0<a(i,t))e[r]=t,e[n]=i,n=r;else break}}function r(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;for(var r=0,i=e.length,o=i>>>1;r<o;){var l=2*(r+1)-1,s=e[l],c=l+1,u=e[c];if(0>a(s,n))c<i&&0>a(u,s)?(e[r]=u,e[c]=n,r=c):(e[r]=s,e[l]=n,r=l);else if(c<i&&0>a(u,n))e[r]=u,e[c]=n,r=c;else break}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o,l=performance;t.unstable_now=function(){return l.now()}}else{var s=Date,c=s.now();t.unstable_now=function(){return s.now()-c}}var u=[],d=[],h=1,f=null,p=3,m=!1,g=!1,v=!1,b="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,w="undefined"!=typeof setImmediate?setImmediate:null;function x(e){for(var t=r(d);null!==t;){if(null===t.callback)i(d);else if(t.startTime<=e)i(d),t.sortIndex=t.expirationTime,n(u,t);else break;t=r(d)}}function C(e){if(v=!1,x(e),!g){if(null!==r(u))g=!0,I(E);else{var t=r(d);null!==t&&O(C,t.startTime-e)}}}function E(e,n){g=!1,v&&(v=!1,y(T),T=-1),m=!0;var a=p;try{for(x(n),f=r(u);null!==f&&(!(f.expirationTime>n)||e&&!R());){var o=f.callback;if("function"==typeof o){f.callback=null,p=f.priorityLevel;var l=o(f.expirationTime<=n);n=t.unstable_now(),"function"==typeof l?f.callback=l:f===r(u)&&i(u),x(n)}else i(u);f=r(u)}if(null!==f)var s=!0;else{var c=r(d);null!==c&&O(C,c.startTime-n),s=!1}return s}finally{f=null,p=a,m=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var k=!1,S=null,T=-1,P=5,M=-1;function R(){return!(t.unstable_now()-M<P)}function A(){if(null!==S){var e=t.unstable_now();M=e;var n=!0;try{n=S(!0,e)}finally{n?o():(k=!1,S=null)}}else k=!1}if("function"==typeof w)o=function(){w(A)};else if("undefined"!=typeof MessageChannel){var L=new MessageChannel,_=L.port2;L.port1.onmessage=A,o=function(){_.postMessage(null)}}else o=function(){b(A,0)};function I(e){S=e,k||(k=!0,o())}function O(e,n){T=b(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){g||m||(g=!0,I(E))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(u)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},t.unstable_scheduleCallback=function(e,i,a){var o=t.unstable_now();switch(a="object"==typeof a&&null!==a&&"number"==typeof(a=a.delay)&&0<a?o+a:o,e){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return l=a+l,e={id:h++,callback:i,priorityLevel:e,startTime:a,expirationTime:l,sortIndex:-1},a>o?(e.sortIndex=a,n(d,e),null===r(u)&&e===r(d)&&(v?(y(T),T=-1):v=!0,O(C,a-o))):(e.sortIndex=l,n(u,e),g||m||(g=!0,I(E))
12),e},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},19714:function(e,t,n){"use strict";e.exports=n(33279)},87198:function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(){return(o=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}).apply(this,arguments)}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}n.r(t),n.d(t,{MultiDrag:function(){return tc},Sortable:function(){return eV},Swap:function(){return e5}});var c=s(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),u=s(/Edge/i),d=s(/firefox/i),h=s(/safari/i)&&!s(/chrome/i)&&!s(/android/i),f=s(/iP(ad|od|hone)/i),p=s(/chrome/i)&&s(/android/i),m={capture:!1,passive:!1};function g(e,t,n){e.addEventListener(t,n,!c&&m)}function v(e,t,n){e.removeEventListener(t,n,!c&&m)}function b(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){}return!1}}function y(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function w(e,t,n,r){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&b(e,t):b(e,t))||r&&e===n)return e;if(e===n)break}while(e=y(e))}return null}var x=/\s+/g;function C(e,t,n){if(e&&t){if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(x," ").replace(" "+t+" "," ");e.className=(r+(n?" "+t:"")).replace(x," ")}}}function E(e,t,n){var r=e&&e.style;if(r){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in r||-1!==t.indexOf("webkit")||(t="-webkit-"+t),r[t]=n+("string"==typeof n?"":"px")}}function k(e,t){var n="";if("string"==typeof e)n=e;else do{var r=E(e,"transform");r&&"none"!==r&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function S(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,a=r.length;if(n)for(;i<a;i++)n(r[i],i);return r}return[]}function T(){return document.scrollingElement||document.documentElement}function P(e,t,n,r,i){if(e.getBoundingClientRect||e===window){if(e!==window&&e.parentNode&&e!==T()?(o=(a=e.getBoundingClientRect()).top,l=a.left,s=a.bottom,u=a.right,d=a.height,h=a.width):(o=0,l=0,s=window.innerHeight,u=window.innerWidth,d=window.innerHeight,h=window.innerWidth),(t||n)&&e!==window&&(i=i||e.parentNode,!c))do if(i&&i.getBoundingClientRect&&("none"!==E(i,"transform")||n&&"static"!==E(i,"position"))){var a,o,l,s,u,d,h,f=i.getBoundingClientRect();o-=f.top+parseInt(E(i,"border-top-width")),l-=f.left+parseInt(E(i,"border-left-width")),s=o+a.height,u=l+a.width;break}while(i=i.parentNode);if(r&&e!==window){var p=k(i||e),m=p&&p.a,g=p&&p.d;p&&(o/=g,l/=m,h/=m,d/=g,s=o+d,u=l+h)}return{top:o,left:l,bottom:s,right:u,width:h,height:d}}}function M(e,t,n){for(var r=I(e,!0),i=P(e)[t];r;){var a=P(r)[n];if(!("top"===n||"left"===n?i>=a:i<=a))return r;if(r===T())break;r=I(r,!1)}return!1}function R(e,t,n,r){for(var i=0,a=0,o=e.children;a<o.length;){if("none"!==o[a].style.display&&o[a]!==eV.ghost&&(r||o[a]!==eV.dragged)&&w(o[a],n.draggable,e,!1)){if(i===t)return o[a];i++}a++}return null}function A(e,t){for(var n=e.lastElementChild;
vendor: 5,475 bytes, line 12
12n&&(n===eV.ghost||"none"===E(n,"display")||t&&!b(n,t));)n=n.previousElementSibling;return n||null}function L(e,t){var n=0;if(!e||!e.parentNode)return -1;for(;e=e.previousElementSibling;)"TEMPLATE"!==e.nodeName.toUpperCase()&&e!==eV.clone&&(!t||b(e,t))&&n++;return n}function _(e){var t=0,n=0,r=T();if(e)do{var i=k(e),a=i.a,o=i.d;t+=e.scrollLeft*a,n+=e.scrollTop*o}while(e!==r&&(e=e.parentNode));return[t,n]}function I(e,t){if(!e||!e.getBoundingClientRect)return T();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=E(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return T();if(r||t)return n;r=!0}}while(n=n.parentNode);return T()}function O(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function D(e,t){return function(){if(!X){var n=arguments;1===n.length?e.call(this,n[0]):e.apply(this,n),X=setTimeout(function(){X=void 0},t)}}}function z(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function N(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function F(e,t){E(e,"position","absolute"),E(e,"top",t.top),E(e,"left",t.left),E(e,"width",t.width),E(e,"height",t.height)}function B(e){E(e,"position",""),E(e,"top",""),E(e,"left",""),E(e,"width",""),E(e,"height","")}function H(e,t,n){var r={};return Array.from(e.children).forEach(function(i){if(w(i,t.draggable,e,!1)&&!i.animated&&i!==n){var a,o,l,s,c=P(i);r.left=Math.min(null!==(a=r.left)&&void 0!==a?a:1/0,c.left),r.top=Math.min(null!==(o=r.top)&&void 0!==o?o:1/0,c.top),r.right=Math.max(null!==(l=r.right)&&void 0!==l?l:-1/0,c.right),r.bottom=Math.max(null!==(s=r.bottom)&&void 0!==s?s:-1/0,c.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var V="Sortable"+new Date().getTime(),j=[],$={initializeByDefault:!0},U={mount:function(e){for(var t in $)!$.hasOwnProperty(t)||t in e||(e[t]=$[t]);j.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),j.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var a=e+"Global";j.forEach(function(r){t[r.pluginName]&&(t[r.pluginName][a]&&t[r.pluginName][a](i({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](i({sortable:t},n)))})},initializePlugins:function(e,t,n,r){for(var i in j.forEach(function(r){var i=r.pluginName;if(e.options[i]||r.initializeByDefault){var a=new r(e,t,e.options);a.sortable=e,a.options=e.options,e[i]=a,o(n,a.defaults)}}),e.options)if(e.options.hasOwnProperty(i)){var a=this.modifyOption(e,i,e.options[i]);void 0!==a&&(e.options[i]=a)}},getEventProperties:function(e,t){var n={};return j.forEach(function(r){"function"==typeof r.eventProperties&&o(n,r.eventProperties.call(t[r.pluginName],e))}),n},modifyOption:function(e,t,n){var r;return j.forEach(function(i){e[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[t]&&(r=i.optionListeners[t].call(e[i.pluginName],n))}),r}};function W(e){var t=e.sortable,n=e.rootEl,r=e.name,a=e.targetEl,o=e.cloneEl,l=e.toEl,s=e.fromEl,d=e.oldIndex,h=e.newIndex,f=e.oldDraggableIndex,p=e.newDraggableIndex,m=e.originalEvent,g=e.putSortable,v=e.extraEventProperties;if(t=t||n&&n[V]){var b,y=t.options,w="on"+r.charAt(0).toUpperCase()+r.substr(1);!window.CustomEvent||c||u?(b=document.createEvent("Event")).initEvent(r,!0,!0):b=new CustomEvent(r,{bubbles:!0,cancelable:!0}),b.to=l||n,b.from=s||n,b.item=a||n,b.clone=o,b.oldIndex=d,b.newIndex=h,b.oldDraggableIndex=f,b.newDraggableIndex=p,b.originalEvent=m,b.pullMode=g?g.lastPutMode:void 0;var x=i(i({},v),U.getEventProperties(r,t));for(var C in x)b[C]=x[C];n&&n.dispatchEvent(b),y[w]&&y[w].call(t,b)}}var G=["evt"],q=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.evt,a=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(n,G);U.pluginEvent.bind(eV)(e,t,i({dragEl:Y,parentEl:K,ghostEl:J,rootEl:Q,nextEl:ee,lastDownEl:et,cloneEl:en,cloneHidden:er,dragStarted:eg,putSortable:ec,activeSortable:eV.active,originalEvent:r,oldIndex:ei,oldDraggableIndex:eo,newIndex:ea,newDraggableIndex:el,hideGhostForTarget:eN,unhideGhostForTarget:eF,cloneNowHidden:function(){er=!0},cloneNowShown:function(){er=!1},dispatchSortableEvent:function(e){Z({sortable:t,name:e,originalEvent:r})}},a))};function Z(e){W(i({putSortable:ec,cloneEl:en,targetEl:Y,rootEl:Q,oldIndex:ei,oldDraggableIndex:eo,newIndex:ea,newDraggableIndex:el},e))}var X,Y,K,J,Q,ee,et,en,er,ei,ea,eo,el,es,ec,eu,ed,eh,ef,ep,em,eg,ev,eb,ey,ew,ex=!1,eC=!1,eE=[],ek=!1,eS=!1,eT=[],eP=!1,eM=[],eR="undefined"!=typeof document,eA=u||c?"cssFloat":"float",eL=eR&&!p&&!f&&"draggable"in document.createElement("div"),e_=function(){if(eR){if(c)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}
vendor: 4,548 bytes, line 12
12(),eI=function(e,t){var n=E(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=R(e,0,t),a=R(e,1,t),o=i&&E(i),l=a&&E(a),s=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+P(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+P(a).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&o.float&&"none"!==o.float){var u="left"===o.float?"left":"right";return a&&("both"===l.clear||l.clear===u)?"vertical":"horizontal"}return i&&("block"===o.display||"flex"===o.display||"table"===o.display||"grid"===o.display||s>=r&&"none"===n[eA]||a&&"none"===n[eA]&&s+c>r)?"vertical":"horizontal"},eO=function(e,t,n){var r=n?e.left:e.top,i=n?e.right:e.bottom,a=n?e.width:e.height,o=n?t.left:t.top,l=n?t.right:t.bottom,s=n?t.width:t.height;return r===o||i===l||r+a/2===o+s/2},eD=function(e,t){var n;return eE.some(function(r){var i=r[V].options.emptyInsertThreshold;if(!(!i||A(r))){var a=P(r),o=e>=a.left-i&&e<=a.right+i,l=t>=a.top-i&&t<=a.bottom+i;if(o&&l)return n=r}}),n},ez=function(e){function t(e,n){return function(r,i,a,o){var l=r.options.group.name&&i.options.group.name&&r.options.group.name===i.options.group.name;if(null==e&&(n||l))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(r,i,a,o),n)(r,i,a,o);var s=(n?r:i).options.group.name;return!0===e||"string"==typeof e&&e===s||e.join&&e.indexOf(s)>-1}}var n={},r=e.group;r&&"object"==a(r)||(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},eN=function(){!e_&&J&&E(J,"display","none")},eF=function(){!e_&&J&&E(J,"display","")};eR&&!p&&document.addEventListener("click",function(e){if(eC)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),eC=!1,!1},!0);var eB=function(e){if(Y){var t=eD((e=e.touches?e.touches[0]:e).clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[V]._onDragOver(n)}}},eH=function(e){Y&&Y.parentNode[V]._isOutsideThisEl(e.target)};function eV(e,t){if(!(e&&e.nodeType&&1===e.nodeType))throw"Sortable: `el` must be an HTMLElement, not ".concat(({}).toString.call(e));this.el=e,this.options=t=o({},t),e[V]=this;var n,r,a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return eI(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==eV.supportPointer&&"PointerEvent"in window&&(!h||f),emptyInsertThreshold:5};for(var l in U.initializePlugins(this,e,a),a)l in t||(t[l]=a[l]);for(var s in ez(t),this)"_"===s.charAt(0)&&"function"==typeof this[s]&&(this[s]=this[s].bind(this));this.nativeDraggable=!t.forceFallback&&eL,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?g(e,"pointerdown",this._onTapStart):(g(e,"mousedown",this._onTapStart),g(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(g(e,"dragover",this),g(e,"dragenter",this)),eE.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),o(this,(r=[],{captureAnimationState:function(){r=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(e){if("none"!==E(e,"display")&&e!==eV.ghost){r.push({target:e,rect:P(e)});var t=i({},r[r.length-1].rect);if(e.thisAnimationDuration){var n=k(e,!0);n&&(t.top-=n.f,t.left-=n.e)}e.fromRect=t}})},addAnimationState:function(e){r.push(e)},removeAnimationState:function(e){r.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n)}return -1}(r,{target:e}),1)},animateAll:function(e){var t=this;if(!this.options.animation){clearTimeout(n),"function"==typeof e&&e();return}var i=!1,a=0;
12r.forEach(function(e){var n,r=0,o=e.target,l=o.fromRect,s=P(o),c=o.prevFromRect,u=o.prevToRect,d=e.rect,h=k(o,!0);h&&(s.top-=h.f,s.left-=h.e),o.toRect=s,o.thisAnimationDuration&&O(c,s)&&!O(l,s)&&(d.top-s.top)/(d.left-s.left)==(l.top-s.top)/(l.left-s.left)&&(n=t.options,r=Math.sqrt(Math.pow(c.top-d.top,2)+Math.pow(c.left-d.left,2))/Math.sqrt(Math.pow(c.top-u.top,2)+Math.pow(c.left-u.left,2))*n.animation),O(s,l)||(o.prevFromRect=l,o.prevToRect=s,r||(r=t.options.animation),t.animate(o,d,s,r)),r&&(i=!0,a=Math.max(a,r),clearTimeout(o.animationResetTimer),o.animationResetTimer=setTimeout(function(){o.animationTime=0,o.prevFromRect=null,o.fromRect=null,o.prevToRect=null,o.thisAnimationDuration=null},r),o.thisAnimationDuration=r)}),clearTimeout(n),i?n=setTimeout(function(){"function"==typeof e&&e()},a):"function"==typeof e&&e(),r=[]},animate:function(e,t,n,r){if(r){E(e,"transition",""),E(e,"transform","");var i=k(this.el),a=i&&i.a,o=i&&i.d,l=(t.left-n.left)/(a||1),s=(t.top-n.top)/(o||1);e.animatingX=!!l,e.animatingY=!!s,E(e,"transform","translate3d("+l+"px,"+s+"px,0)"),this.forRepaintDummy=e.offsetWidth,E(e,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),E(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout(function(){E(e,"transition",""),E(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1},r)}}}))}function ej(e,t,n,r,i,a,o,l){var s,d,h=e[V],f=h.options.onMove;return!window.CustomEvent||c||u?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=t,s.from=e,s.dragged=n,s.draggedRect=r,s.related=i||t,s.relatedRect=a||P(t),s.willInsertAfter=l,s.originalEvent=o,e.dispatchEvent(s),f&&(d=f.call(h,s,o)),d}function e$(e){e.draggable=!1}function eU(){eP=!1}function eW(e){return setTimeout(e,0)}function eG(e){return clearTimeout(e)}eV.prototype={constructor:eV,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(ev=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,Y):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,i=r.preventOnFilter,a=e.type,o=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(o||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,c=r.filter;if(function(e){eM.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var r=t[n];r.checked&&eM.push(r)}}(n),!(Y||/mousedown|pointerdown/.test(a)&&0!==e.button||r.disabled||s.isContentEditable||!this.nativeDraggable&&h&&l&&"SELECT"===l.tagName.toUpperCase()||(l=w(l,r.draggable,n,!1))&&l.animated)&&et!==l){if(ei=L(l),eo=L(l,r.draggable),"function"==typeof c){if(c.call(this,e,l,this)){Z({sortable:t,rootEl:s,name:"filter",targetEl:l,toEl:n,fromEl:n}),q("filter",t,{evt:e}),i&&e.preventDefault();return}}else if(c&&(c=c.split(",").some(function(r){if(r=w(s,r.trim(),n,!1))return Z({sortable:t,rootEl:r,name:"filter",targetEl:l,fromEl:n,toEl:n}),q("filter",t,{evt:e}),!0}))){i&&e.preventDefault();return}(!r.handle||w(s,r.handle,n,!1))&&this._prepareDragStart(e,o,l)}}},_prepareDragStart:function(e,t,n){var r,i=this,a=i.el,o=i.options,l=a.ownerDocument;if(n&&!Y&&n.parentNode===a){var s=P(n);if(Q=a,K=(Y=n).parentNode,ee=Y.nextSibling,et=n,es=o.group,eV.dragged=Y,ep=(eu={target:Y,clientX:(t||e).clientX,clientY:(t||e).clientY}).clientX-s.left,em=eu.clientY-s.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Y.style["will-change"]="all",r=function(){if(q("delayEnded",i,{evt:e}),eV.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!d&&i.nativeDraggable&&(Y.draggable=!0),i._triggerDragStart(e,t),Z({sortable:i,name:"choose",originalEvent:e}),C(Y,o.chosenClass,!0)},o.ignore.split(",").forEach(function(e){S(Y,e.trim(),e$)}),g(l,"dragover",eB),g(l,"mousemove",eB),g(l,"touchmove",eB),o.supportPointer?(g
vendor: 5,492 bytes, line 12
12(l,"pointerup",i._onDrop),this.nativeDraggable||g(l,"pointercancel",i._onDrop)):(g(l,"mouseup",i._onDrop),g(l,"touchend",i._onDrop),g(l,"touchcancel",i._onDrop)),d&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Y.draggable=!0),q("delayStart",this,{evt:e}),!o.delay||o.delayOnTouchOnly&&!t||this.nativeDraggable&&(u||c))r();else{if(eV.eventCanceled){this._onDrop();return}o.supportPointer?(g(l,"pointerup",i._disableDelayedDrag),g(l,"pointercancel",i._disableDelayedDrag)):(g(l,"mouseup",i._disableDelayedDrag),g(l,"touchend",i._disableDelayedDrag),g(l,"touchcancel",i._disableDelayedDrag)),g(l,"mousemove",i._delayedDragTouchMoveHandler),g(l,"touchmove",i._delayedDragTouchMoveHandler),o.supportPointer&&g(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(r,o.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Y&&e$(Y),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;v(e,"mouseup",this._disableDelayedDrag),v(e,"touchend",this._disableDelayedDrag),v(e,"touchcancel",this._disableDelayedDrag),v(e,"pointerup",this._disableDelayedDrag),v(e,"pointercancel",this._disableDelayedDrag),v(e,"mousemove",this._delayedDragTouchMoveHandler),v(e,"touchmove",this._delayedDragTouchMoveHandler),v(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?g(document,"pointermove",this._onTouchMove):t?g(document,"touchmove",this._onTouchMove):g(document,"mousemove",this._onTouchMove):(g(Y,"dragend",this),g(Q,"dragstart",this._onDragStart));try{document.selection?eW(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(ex=!1,Q&&Y){q("dragStarted",this,{evt:t}),this.nativeDraggable&&g(document,"dragover",eH);var n=this.options;e||C(Y,n.dragClass,!1),C(Y,n.ghostClass,!0),eV.active=this,e&&this._appendGhost(),Z({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(ed){this._lastX=ed.clientX,this._lastY=ed.clientY,eN();for(var e=document.elementFromPoint(ed.clientX,ed.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(ed.clientX,ed.clientY))!==t;)t=e;if(Y.parentNode[V]._isOutsideThisEl(e),t)do{if(t[V]&&t[V]._onDragOver({clientX:ed.clientX,clientY:ed.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break;e=t}while(t=y(t));eF()}},_onTouchMove:function(e){if(eu){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,a=J&&k(J,!0),o=J&&a&&a.a,l=J&&a&&a.d,s=f&&ew&&_(ew),c=(i.clientX-eu.clientX+r.x)/(o||1)+(s?s[0]-eT[0]:0)/(o||1),u=(i.clientY-eu.clientY+r.y)/(l||1)+(s?s[1]-eT[1]:0)/(l||1);if(!eV.active&&!ex){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(J){a?(a.e+=c-(eh||0),a.f+=u-(ef||0)):a={a:1,b:0,c:0,d:1,e:c,f:u};var d="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");E(J,"webkitTransform",d),E(J,"mozTransform",d),E(J,"msTransform",d),E(J,"transform",d),eh=c,ef=u,ed=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!J){var e=this.options.fallbackOnBody?document.body:Q,t=P(Y,!0,f,!0,e),n=this.options;if(f){for(ew=e;"static"===E(ew,"position")&&"none"===E(ew,"transform")&&ew!==document;)ew=ew.parentNode;ew!==document.body&&ew!==document.documentElement?(ew===document&&(ew=T()),t.top+=ew.scrollTop,t.left+=ew.scrollLeft):ew=T(),eT=_(ew)}C(J=Y.cloneNode(!0),n.ghostClass,!1),C(J,n.fallbackClass,!0),C(J,n.dragClass,!0),E(J,"transition",""),E(J,"transform",""),E(J,"box-sizing","border-box"),E(J,"margin",0),E(J,"top",t.top),E(J,"left",t.left),E(J,"width",t.width),E(J,"height",t.height),E(J,"opacity","0.8"),E(J,"position",f?"absolute":"fixed"),E(J,"zIndex","100000"),E(J,"pointerEvents","none"),eV.ghost=J,e.appendChild(J),E(J,"transform-origin",ep/parseInt(J.style.width)*100+"% "+em/parseInt(J.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,i=n.options;if(q("dragStart",this,{evt:e}),eV.eventCanceled){this._onDrop();return}q("setupClone",this),eV.eventCanceled||((en=N(Y)).removeAttribute("id"),en.draggable=!1,en.style["will-change"]="",this._hideClone(),C(en,this.options.chosenClass,!1),eV.clone=en),n.cloneId=eW(function(){q("clone",n),eV.eventCanceled||(n.options.removeCloneOnHide||Q.insertBefore(en,Y),n._hideClone(),Z({sortable:n,name:"clone"}))}),t||C(Y,i.dragClass,!0),t?(eC=!0,n._loopId=setInterval(n._emulateDragOver,50)):(v(document,"mouseup",n._onDrop),v(document,"touchend",n._onDrop),v(document,"touchcancel",n._onDrop),r&&(r.effectAllowed="move",i.setData&&i.setData.call(n,r,Y)),g(document,"drop",n),E(Y,"transform","translateZ(0)")),ex=!0,n._dragStartId=eW(n._dragStarted.bind(n,t,e)),g(document,"selectstart",n),eg=!0,window.getSelection().removeAllRanges(),h&&E(document.body,"user-select","none")},_onDragOver:function(e){var t,n,r,a,o=this.el,l=e.target,s=this.options,c=s.group,u=eV.active,d=es===c,h=s.sort,f=ec||u,p=this,m=!1;if(!eP){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),l=w(l,s.draggable,o,
12!0),X("dragOver"),eV.eventCanceled)return m;if(Y.contains(e.target)||l.animated&&l.animatingX&&l.animatingY||p._ignoreWhileAnimating===l)return en(!1);if(eC=!1,u&&!s.disabled&&(d?h||(r=K!==Q):ec===this||(this.lastPutMode=es.checkPull(this,u,Y,e))&&c.checkPut(this,u,Y,e))){if(a="vertical"===this._getDirection(e,l),t=P(Y),X("dragOverValid"),eV.eventCanceled)return m;if(r)return K=Q,et(),this._hideClone(),X("revert"),eV.eventCanceled||(ee?Q.insertBefore(Y,ee):Q.appendChild(Y)),en(!0);var g=A(o,s.draggable);if(!g||(b=a,y=P(A(this.el,this.options.draggable)),x=H(this.el,this.options,J),(b?e.clientX>x.right+10||e.clientY>y.bottom&&e.clientX>y.left:e.clientY>x.bottom+10||e.clientX>y.right&&e.clientY>y.top)&&!g.animated)){if(g===Y)return en(!1);if(g&&o===e.target&&(l=g),l&&(n=P(l)),!1!==ej(Q,o,Y,t,l,n,e,!!l))return et(),g&&g.nextSibling?o.insertBefore(Y,g.nextSibling):o.appendChild(Y),K=o,er(),en(!0)}else if(g&&(k=a,S=P(R(this.el,0,this.options,!0)),T=H(this.el,this.options,J),k?e.clientX<T.left-10||e.clientY<S.top&&e.clientX<S.right:e.clientY<T.top-10||e.clientY<S.bottom&&e.clientX<S.left)){var v=R(o,0,s,!0);if(v===Y)return en(!1);if(n=P(l=v),!1!==ej(Q,o,Y,t,l,n,e,!1))return et(),o.insertBefore(Y,v),K=o,er(),en(!0)}else if(l.parentNode===o){n=P(l);var b,y,x,k,S,T,_,I,O=0,D=Y.parentNode!==o,N=!eO(Y.animated&&Y.toRect||t,l.animated&&l.toRect||n,a),F=a?"top":"left",B=M(l,"top","top")||M(Y,"top","top"),j=B?B.scrollTop:void 0;if(ev!==l&&(I=n[F],ek=!1,eS=!N&&s.invertSwap||D),0!==(O=function(e,t,n,r,i,a,o,l){var s=r?e.clientY:e.clientX,c=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,h=!1;if(!o){if(l&&ey<c*i){if(!ek&&(1===eb?s>u+c*a/2:s<d-c*a/2)&&(ek=!0),ek)h=!0;else if(1===eb?s<u+ey:s>d-ey)return-eb}else if(s>u+c*(1-i)/2&&s<d-c*(1-i)/2)return L(Y)<L(t)?1:-1}return(h=h||o)&&(s<u+c*a/2||s>d-c*a/2)?s>u+c/2?1:-1:0}(e,l,n,a,N?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,eS,ev===l))){var $=L(Y);do $-=O,_=K.children[$];while(_&&("none"===E(_,"display")||_===J))}if(0===O||_===l)return en(!1);ev=l,eb=O;var U=l.nextElementSibling,W=!1,G=ej(Q,o,Y,t,l,n,e,W=1===O);if(!1!==G)return(1===G||-1===G)&&(W=1===G),eP=!0,setTimeout(eU,30),et(),W&&!U?o.appendChild(Y):l.parentNode.insertBefore(Y,W?U:l),B&&z(B,0,j-B.scrollTop),K=Y.parentNode,void 0===I||eS||(ey=Math.abs(I-P(l)[F])),er(),en(!0)}if(o.contains(Y))return en(!1)}return!1}function X(s,c){q(s,p,i({evt:e,isOwner:d,axis:a?"vertical":"horizontal",revert:r,dragRect:t,targetRect:n,canSort:h,fromSortable:f,target:l,completed:en,onMove:function(n,r){return ej(Q,o,Y,t,n,P(n),e,r)},changed:er},c))}function et(){X("dragOverAnimationCapture"),p.captureAnimationState(),p!==f&&f.captureAnimationState()}function en(t){return X("dragOverCompleted",{insertion:t}),t&&(d?u._hideClone():u._showClone(p),p!==f&&(C(Y,ec?ec.options.ghostClass:u.options.ghostClass,!1),C(Y,s.ghostClass,!0)),ec!==p&&p!==eV.active?ec=p:p===eV.active&&ec&&(ec=null),f===p&&(p._ignoreWhileAnimating=l),p.animateAll(function(){X("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(l!==Y||Y.animated)&&(l!==o||l.animated)||(ev=null),s.dragoverBubble||e.rootEl||l===document||(Y.parentNode[V]._isOutsideThisEl(e.target),t||eB(e)),!s.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function er(){ea=L(Y),el=L(Y,s.draggable),Z({sortable:p,name:"change",toEl:o,newIndex:ea,newDraggableIndex:el,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){v(document,"mousemove",this._onTouchMove),v(document,"touchmove",this._onTouchMove),v(document,"pointermove",this._onTouchMove),v(document,"dragover",eB),v(document,"mousemove",eB),v(document,"touchmove",eB)},_offUpEvents:function(){var e=this.el.ownerDocument;v(e,"mouseup",this._onDrop),v(e,"touchend",this._onDrop),v(e,"pointerup",this._onDrop),v(e,"pointercancel",this._onDrop),v(e,"touchcancel",this._onDrop),v(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;if(ea=L(Y),el=L(Y,n.draggable),q("drop",this,{evt:e}),K=Y&&Y.parentNode,ea=L(Y),el=L(Y,n.draggable),eV.eventCanceled){this._nulling(
12);return}ex=!1,eS=!1,ek=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),eG(this.cloneId),eG(this._dragStartId),this.nativeDraggable&&(v(document,"drop",this),v(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),h&&E(document.body,"user-select",""),E(Y,"transform",""),e&&(eg&&(e.cancelable&&e.preventDefault(),n.dropBubble||e.stopPropagation()),J&&J.parentNode&&J.parentNode.removeChild(J),(Q===K||ec&&"clone"!==ec.lastPutMode)&&en&&en.parentNode&&en.parentNode.removeChild(en),Y&&(this.nativeDraggable&&v(Y,"dragend",this),e$(Y),Y.style["will-change"]="",eg&&!ex&&C(Y,ec?ec.options.ghostClass:this.options.ghostClass,!1),C(Y,this.options.chosenClass,!1),Z({sortable:this,name:"unchoose",toEl:K,newIndex:null,newDraggableIndex:null,originalEvent:e}),Q!==K?(ea>=0&&(Z({rootEl:K,name:"add",toEl:K,fromEl:Q,originalEvent:e}),Z({sortable:this,name:"remove",toEl:K,originalEvent:e}),Z({rootEl:K,name:"sort",toEl:K,fromEl:Q,originalEvent:e}),Z({sortable:this,name:"sort",toEl:K,originalEvent:e})),ec&&ec.save()):ea!==ei&&ea>=0&&(Z({sortable:this,name:"update",toEl:K,originalEvent:e}),Z({sortable:this,name:"sort",toEl:K,originalEvent:e})),eV.active&&((null==ea||-1===ea)&&(ea=ei,el=eo),Z({sortable:this,name:"end",toEl:K,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){q("nulling",this),Q=Y=K=J=ee=en=et=er=eu=ed=eg=ea=el=ei=eo=ev=eb=ec=es=eV.dragged=eV.ghost=eV.clone=eV.active=null,eM.forEach(function(e){e.checked=!0}),eM.length=eh=ef=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Y&&(this._onDragOver(e),e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault());break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,r=0,i=n.length,a=this.options;r<i;r++)w(e=n[r],a.draggable,this.el,!1)&&t.push(e.getAttribute(a.dataIdAttr)||function(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}(e));return t},sort:function(e,t){var n={},r=this.el;this.toArray().forEach(function(e,t){var i=r.children[t];w(i,this.options.draggable,r,!1)&&(n[e]=i)},this),t&&this.captureAnimationState(),e.forEach(function(e){n[e]&&(r.removeChild(n[e]),r.appendChild(n[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return w(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(void 0===t)return n[e];var r=U.modifyOption(this,e,t);void 0!==r?n[e]=r:n[e]=t,"group"===e&&ez(n)},destroy:function(){q("destroy",this);var e=this.el;e[V]=null,v(e,"mousedown",this._onTapStart),v(e,"touchstart",this._onTapStart),v(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(v(e,"dragover",this),v(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),eE.splice(eE.indexOf(this.el),1),this.el=null},_hideClone:function(){er||(q("hideClone",this),eV.eventCanceled||(E(en,"display","none"),this.options.removeCloneOnHide&&en.parentNode&&en.parentNode.removeChild(en),er=!0))},_showClone:function(e){if("clone"!==e.lastPutMode){this._hideClone();return}if(er){if(q("showClone",this),eV.eventCanceled)return;Y.parentNode!=Q||this.options.group.revertClone?ee?Q.insertBefore(en,ee):Q.appendChild(en):Q.insertBefore(en,Y),this.options.group.revertClone&&this.animate(Y,en),E(en,"display",""),er=!1}}},eR&&g(document,"touchmove",function(e){(eV.active||ex)&&e.cancelable&&e.preventDefault()}),eV.utils={on:g,off:v,css:E,find:S,is:function(e,t){return!!w(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},throttle:D,closest:w,toggleClass:C,clone:N,index:L,nextTick:eW,cancelNextTick:eG,detectDirection:eI,getChild:R,expando:V},eV.get=function(e){return e[V]},eV.mount=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat(({}).toString.call(e));e.utils&&(eV.utils=i(i({}
12,eV.utils),e.utils)),U.mount(e)})},eV.create=function(e,t){return new eV(e,t)},eV.version="1.15.6";var eq,eZ,eX,eY,eK,eJ,eQ=[],e0=!1;function e1(){eQ.forEach(function(e){clearInterval(e.pid)}),eQ=[]}function e2(){clearInterval(eJ)}var e4=D(function(e,t,n,r){if(t.scroll){var i,a=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,l=t.scrollSensitivity,s=t.scrollSpeed,c=T(),u=!1;eZ!==n&&(eZ=n,e1(),eq=t.scroll,i=t.scrollFn,!0===eq&&(eq=I(n,!0)));var d=0,h=eq;do{var f=h,p=P(f),m=p.top,g=p.bottom,v=p.left,b=p.right,y=p.width,w=p.height,x=void 0,C=void 0,k=f.scrollWidth,S=f.scrollHeight,M=E(f),R=f.scrollLeft,A=f.scrollTop;f===c?(x=y<k&&("auto"===M.overflowX||"scroll"===M.overflowX||"visible"===M.overflowX),C=w<S&&("auto"===M.overflowY||"scroll"===M.overflowY||"visible"===M.overflowY)):(x=y<k&&("auto"===M.overflowX||"scroll"===M.overflowX),C=w<S&&("auto"===M.overflowY||"scroll"===M.overflowY));var L=x&&(Math.abs(b-a)<=l&&R+y<k)-(Math.abs(v-a)<=l&&!!R),_=C&&(Math.abs(g-o)<=l&&A+w<S)-(Math.abs(m-o)<=l&&!!A);if(!eQ[d])for(var O=0;O<=d;O++)eQ[O]||(eQ[O]={});(eQ[d].vx!=L||eQ[d].vy!=_||eQ[d].el!==f)&&(eQ[d].el=f,eQ[d].vx=L,eQ[d].vy=_,clearInterval(eQ[d].pid),(0!=L||0!=_)&&(u=!0,eQ[d].pid=setInterval((function(){r&&0===this.layer&&eV.active._onTouchMove(eK);var t=eQ[this.layer].vy?eQ[this.layer].vy*s:0,n=eQ[this.layer].vx?eQ[this.layer].vx*s:0;("function"!=typeof i||"continue"===i.call(eV.dragged.parentNode[V],n,t,e,eK,eQ[this.layer].el))&&z(eQ[this.layer].el,n,t)}).bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==c&&(h=I(h,!1)));e0=u}},30),e3=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,o=e.hideGhostForTarget,l=e.unhideGhostForTarget;if(t){var s=n||i;o();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(c.clientX,c.clientY);l(),s&&!s.el.contains(u)&&(a("spill"),this.onSpill({dragEl:r,putSortable:n}))}};function e8(){}function e6(){}function e5(){function e(){this.defaults={swapClass:"sortable-swap-highlight"}}return e.prototype={dragStart:function(e){e9=e.dragEl},dragOverValid:function(e){var t=e.completed,n=e.target,r=e.onMove,i=e.activeSortable,a=e.changed,o=e.cancel;if(i.options.swap){var l=this.sortable.el,s=this.options;if(n&&n!==l){var c=e9;!1!==r(n)?(C(n,s.swapClass,!0),e9=n):e9=null,c&&c!==e9&&C(c,s.swapClass,!1)}a(),t(!0),o()}},drop:function(e){var t,n,r,i,a,o=e.activeSortable,l=e.putSortable,s=e.dragEl,c=l||this.sortable,u=this.options;e9&&C(e9,u.swapClass,!1),e9&&(u.swap||l&&l.options.swap)&&s!==e9&&(c.captureAnimationState(),c!==o&&o.captureAnimationState(),t=e9,i=s.parentNode,a=t.parentNode,!i||!a||i.isEqualNode(t)||a.isEqualNode(s)||(n=L(s),r=L(t),i.isEqualNode(a)&&n<r&&r++,i.insertBefore(t,i.children[n]),a.insertBefore(s,a.children[r])),c.animateAll(),c!==o&&o.animateAll())},nulling:function(){e9=null}},o(e,{pluginName:"swap",eventProperties:function(){return{swapItem:e9}}})}e8.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=R(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:e3},o(e8,{pluginName:"revertOnSpill"}),e6.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:e3},o(e6,{pluginName:"removeOnSpill"});var e9,e7,te,tt,tn,tr,ti=[],ta=[],to=!1,tl=!1,ts=!1;function tc(){function e(e){for(var t in this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this));e.options.avoidImplicitDeselect||(e.options.supportPointer?g(document,"pointerup",this._deselectMultiDrag):(g(document,"mouseup",this._deselectMultiDrag),g(document,"touchend",this._deselectMultiDrag))),g(document,"keydown",this._checkKeyDown),g(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData:function(t,n){var r="";
12ti.length&&te===e?ti.forEach(function(e,t){r+=(t?", ":"")+e.textContent}):r=n.textContent,t.setData("Text",r)}}}return e.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(e){tt=e.dragEl},delayEnded:function(){this.isMultiDrag=~ti.indexOf(tt)},setupClone:function(e){var t=e.sortable,n=e.cancel;if(this.isMultiDrag){for(var r=0;r<ti.length;r++)ta.push(N(ti[r])),ta[r].sortableIndex=ti[r].sortableIndex,ta[r].draggable=!1,ta[r].style["will-change"]="",C(ta[r],this.options.selectedClass,!1),ti[r]===tt&&C(ta[r],this.options.chosenClass,!1);t._hideClone(),n()}},clone:function(e){var t=e.sortable,n=e.rootEl,r=e.dispatchSortableEvent,i=e.cancel;this.isMultiDrag&&!this.options.removeCloneOnHide&&ti.length&&te===t&&(tu(!0,n),r("clone"),i())},showClone:function(e){var t=e.cloneNowShown,n=e.rootEl,r=e.cancel;this.isMultiDrag&&(tu(!1,n),ta.forEach(function(e){E(e,"display","")}),t(),tr=!1,r())},hideClone:function(e){var t=this;e.sortable;var n=e.cloneNowHidden,r=e.cancel;this.isMultiDrag&&(ta.forEach(function(e){E(e,"display","none"),t.options.removeCloneOnHide&&e.parentNode&&e.parentNode.removeChild(e)}),n(),tr=!0,r())},dragStartGlobal:function(e){e.sortable,!this.isMultiDrag&&te&&te.multiDrag._deselectMultiDrag(),ti.forEach(function(e){e.sortableIndex=L(e)}),ti=ti.sort(function(e,t){return e.sortableIndex-t.sortableIndex}),ts=!0},dragStarted:function(e){var t=this,n=e.sortable;if(this.isMultiDrag){if(this.options.sort&&(n.captureAnimationState(),this.options.animation)){ti.forEach(function(e){e!==tt&&E(e,"position","absolute")});var r=P(tt,!1,!0,!0);ti.forEach(function(e){e!==tt&&F(e,r)}),tl=!0,to=!0}n.animateAll(function(){tl=!1,to=!1,t.options.animation&&ti.forEach(function(e){B(e)}),t.options.sort&&td()})}},dragOver:function(e){var t=e.target,n=e.completed,r=e.cancel;tl&&~ti.indexOf(t)&&(n(!1),r())},revert:function(e){var t,n=e.fromSortable,r=e.rootEl,i=e.sortable,a=e.dragRect;ti.length>1&&(ti.forEach(function(e){i.addAnimationState({target:e,rect:tl?P(e):a}),B(e),e.fromRect=a,n.removeAnimationState(e)}),tl=!1,t=!this.options.removeCloneOnHide,ti.forEach(function(e,n){var i=r.children[e.sortableIndex+(t?Number(n):0)];i?r.insertBefore(e,i):r.appendChild(e)}))},dragOverCompleted:function(e){var t=e.sortable,n=e.isOwner,r=e.insertion,i=e.activeSortable,a=e.parentEl,o=e.putSortable,l=this.options;if(r){if(n&&i._hideClone(),to=!1,l.animation&&ti.length>1&&(tl||!n&&!i.options.sort&&!o)){var s=P(tt,!1,!0,!0);ti.forEach(function(e){e!==tt&&(F(e,s),a.appendChild(e))}),tl=!0}if(!n){if(tl||td(),ti.length>1){var c=tr;i._showClone(t),i.options.animation&&!tr&&c&&ta.forEach(function(e){i.addAnimationState({target:e,rect:tn}),e.fromRect=tn,e.thisAnimationDuration=null})}else i._showClone(t)}}},dragOverAnimationCapture:function(e){var t=e.dragRect,n=e.isOwner,r=e.activeSortable;if(ti.forEach(function(e){e.thisAnimationDuration=null}),r.options.animation&&!n&&r.multiDrag.isMultiDrag){tn=o({},t);var i=k(tt,!0);tn.top-=i.f,tn.left-=i.e}},dragOverAnimationComplete:function(){tl&&(tl=!1,td())},drop:function(e){var t=e.originalEvent,n=e.rootEl,r=e.parentEl,i=e.sortable,a=e.dispatchSortableEvent,o=e.oldIndex,l=e.putSortable,s=l||this.sortable;if(t){var c=this.options,u=r.children;if(!ts){if(c.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),C(tt,c.selectedClass,!~ti.indexOf(tt)),~ti.indexOf(tt))ti.splice(ti.indexOf(tt),1),e7=null,W({sortable:i,rootEl:n,name:"deselect",targetEl:tt,originalEvent:t});else{if(ti.push(tt),W({sortable:i,rootEl:n,name:"select",targetEl:tt,originalEvent:t}),t.shiftKey&&e7&&i.el.contains(e7)){var d=L(e7),h=L(tt);~d&&~h&&d!==h&&function(){h>d?(a=d,e=h):(a=h,e=d+1);for(var e,a,o=c.filter;a<e;a++)!~ti.indexOf(u[a])&&w(u[a],c.draggable,r,!1)&&(o&&("function"==typeof o?o.call(i,t,u[a],i):o.split(",").some(function(e){return w(u[a],e.trim(),r,!1)}))||(C(u[a],c.selectedClass,!0),ti.push(u[a]),W({sortable:i,rootEl:n,name:"select",targetEl:u[a],originalEvent:t})))}()}else e7=tt;te=s}}if(ts&&this.isMultiDrag){if(tl=!1,(r[V].options.sort||r!==n)&&ti.length>1){var f=P(tt),p=L(tt,":not(."+this.options.selectedClass+")");if(!to&&c.animation&&(tt.thisAnimationDuration=null),s.captureAnimationState(),!to&&(c.animation&&(tt.fromRect=f,ti.forEac
12h(function(e){if(e.thisAnimationDuration=null,e!==tt){var t=tl?P(e):f;e.fromRect=t,s.addAnimationState({target:e,rect:t})}})),td(),ti.forEach(function(e){u[p]?r.insertBefore(e,u[p]):r.appendChild(e),p++}),o===L(tt))){var m=!1;ti.forEach(function(e){if(e.sortableIndex!==L(e)){m=!0;return}}),m&&(a("update"),a("sort"))}ti.forEach(function(e){B(e)}),s.animateAll()}te=s}(n===r||l&&"clone"!==l.lastPutMode)&&ta.forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)})}},nullingGlobal:function(){this.isMultiDrag=ts=!1,ta.length=0},destroyGlobal:function(){this._deselectMultiDrag(),v(document,"pointerup",this._deselectMultiDrag),v(document,"mouseup",this._deselectMultiDrag),v(document,"touchend",this._deselectMultiDrag),v(document,"keydown",this._checkKeyDown),v(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(!(void 0!==ts&&ts||te!==this.sortable||e&&w(e.target,this.options.draggable,this.sortable.el,!1))&&(!e||0===e.button))for(;ti.length;){var t=ti[0];C(t,this.options.selectedClass,!1),ti.shift(),W({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:t,originalEvent:e})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},o(e,{pluginName:"multiDrag",utils:{select:function(e){var t=e.parentNode[V];!t||!t.options.multiDrag||~ti.indexOf(e)||(te&&te!==t&&(te.multiDrag._deselectMultiDrag(),te=t),C(e,t.options.selectedClass,!0),ti.push(e))},deselect:function(e){var t=e.parentNode[V],n=ti.indexOf(e);t&&t.options.multiDrag&&~n&&(C(e,t.options.selectedClass,!1),ti.splice(n,1))}},eventProperties:function(){var e,t=this,n=[],r=[];return ti.forEach(function(e){var i;n.push({multiDragElement:e,index:e.sortableIndex}),i=tl&&e!==tt?-1:tl?L(e,":not(."+t.options.selectedClass+")"):L(e),r.push({multiDragElement:e,index:i})}),{items:function(e){if(Array.isArray(e))return l(e)}(e=ti)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return l(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),clones:[].concat(ta),oldIndicies:n,newIndicies:r}},optionListeners:{multiDragKey:function(e){return"ctrl"===(e=e.toLowerCase())?e="Control":e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})}function tu(e,t){ta.forEach(function(n,r){var i=t.children[n.sortableIndex+(e?Number(r):0)];i?t.insertBefore(n,i):t.appendChild(n)})}function td(){ti.forEach(function(e){e!==tt&&e.parentNode&&e.parentNode.removeChild(e)})}eV.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?g(document,"dragover",this._handleAutoScroll):this.options.supportPointer?g(document,"pointermove",this._handleFallbackAutoScroll):t.touches?g(document,"touchmove",this._handleFallbackAutoScroll):g(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?v(document,"dragover",this._handleAutoScroll):(v(document,"pointermove",this._handleFallbackAutoScroll),v(document,"touchmove",this._handleFallbackAutoScroll),v(document,"mousemove",this._handleFallbackAutoScroll)),e2(),e1(),clearTimeout(X),X=void 0},nulling:function(){eK=eZ=eq=e0=eJ=eX=eY=null,eQ.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,a=document.elementFromPoint(r,i);if(eK=e,t||this.options.forceAutoScrollFallback||u||c||h){e4(e,this.options,a,t);var o=I(a,!0);e0&&(!eJ||r!==eX||i!==eY)&&(eJ&&e2(),eJ=setInterval(function(){var a=I(document.elementFromPoint(r,i),!0);a!==o&&(o=a,e1()),e4(e,n.options,a,t)},10),eX=r,eY=i)}else{if(!this.options.bubbleScroll||I(a,!0)===T()){e1();return}e4(e,this.options,I(a,!1),!1)}}},o(e,{pluginName:"scroll",initializeByDefault:!0})}),eV.mount(e6,e8),t.default=eV},96587:function(e,t,n){"use strict";function r(e,t){if(!e)throw Error("Invariant failed")}n.r(t),n.d(t,{default:function(){return r}})},82070:function(e,t,n){var r=n(7653);e.exports=function(e,t,n){let i=r.useRef("loading"),a=r.useRef(),[o,l]=r.useState(0),s=r.useRef(),c=r.useRef(),u=r.useRef();return(s.current!==e||c.current!==t||u.current!==n)&&(i.current="loading",a.
12current=void 0,s.current=e,c.current=t,u.current=n),r.useLayoutEffect(function(){if(e){var r=document.createElement("img");return r.addEventListener("load",o),r.addEventListener("error",s),t&&(r.crossOrigin=t),n&&(r.referrerPolicy=n),r.src=e,function(){r.removeEventListener("load",o),r.removeEventListener("error",s)}}function o(){r.decode().catch(()=>{}).finally(()=>{i.current="loaded",a.current=r,l(Math.random())})}function s(){i.current="failed",a.current=void 0,l(Math.random())}},[e,t,n]),[a.current,i.current]}},40013:function(e){"use strict";e.exports=function(){}},21227:function(e,t){var n,r,i;r=[],void 0!==(i="function"==typeof(n=function(){var e=function(e){var t=e.value;return" "+e.name+'="'+t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")+'"'},t=function(e){var t=e.tagName;return"http://www.w3.org/1999/xhtml"===e.namespaceURI&&(t=t.toLowerCase()),t},n=function(e){return Array.prototype.map.call(e.childNodes,function(e){return i(e)}).join("")},r=function(r,i){var a="<"+t(r);return a+=!(Array.prototype.map.call(r.attributes||r.attrs,function(e){return e.name}).indexOf("xmlns")>=0)&&(i||r.namespaceURI!==r.parentNode.namespaceURI)?' xmlns="'+r.namespaceURI+'"':"",Array.prototype.forEach.call(r.attributes||r.attrs,function(t){a+=e(t)}),r.childNodes.length>0?a+=">"+n(r)+"</"+t(r)+">":a+="/>",a},i=function(e,t){var i=t&&t.rootNode;return"#document"===e.nodeName||"#document-fragment"===e.nodeName?n(e):e.tagName?r(e,i):"#text"===e.nodeName?(e.nodeValue||e.value||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"):"#comment"===e.nodeName?"<!--"+e.data.replace(/-/g,"-")+"-->":"#cdata-section"===e.nodeName?"<![CDATA["+e.nodeValue+"]]>":void 0};return{serializeToString:function(e){return i(e,{rootNode:!0}).replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")}}})?n.apply(t,r):n)&&(e.exports=i)},4878:function(e){var t;t=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}var t,n,r,i=/^\s+/,a=/\s+$/;function o(t,n){if(n=n||{},(t=t||"")instanceof o)return t;if(!(this instanceof o))return new o(t,n);var r,l,s,c,u,d,h,f,p,m,g,v,b,y,w,x,C,k,P,R,L=(l={r:0,g:0,b:0},s=1,c=null,u=null,d=null,h=!1,f=!1,"string"==typeof(r=t)&&(r=function(e){e=e.replace(i,"").replace(a,"").toLowerCase();var t,n=!1;if(E[e])e=E[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=_.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=_.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=_.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=_.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=_.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=_.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=_.hex8.exec(e))?{r:M(t[1]),g:M(t[2]),b:M(t[3]),a:M(t[4])/255,format:n?"name":"hex8"}:(t=_.hex6.exec(e))?{r:M(t[1]),g:M(t[2]),b:M(t[3]),format:n?"name":"hex"}:(t=_.hex4.exec(e))?{r:M(t[1]+""+t[1]),g:M(t[2]+""+t[2]),b:M(t[3]+""+t[3]),a:M(t[4]+""+t[4])/255,format:n?"name":"hex8"}:!!(t=_.hex3.exec(e))&&{r:M(t[1]+""+t[1]),g:M(t[2]+""+t[2]),b:M(t[3]+""+t[3]),format:n?"name":"hex"}}(r)),"object"==e(r)&&(I(r.r)&&I(r.g)&&I(r.b)?(p=r.r,m=r.g,g=r.b,l={r:255*T(p,255),g:255*T(m,255),b:255*T(g,255)},h=!0,f="%"===String(r.r).substr(-1)?"prgb":"rgb"):I(r.h)&&I(r.s)&&I(r.v)?(c=A(r.s),u=A(r.v),v=r.h,b=c,y=u,v=6*T(v,360),b=T(b,100),y=T(y,100),w=Math.floor(v),x=v-w,C=y*(1-b),k=y*(1-x*b),P=y*(1-(1-x)*b),l={r:255*[y,k,C,C,P,y][R=w%6],g:255*[P,y,y,k,C,C][R],b:255*[C,C,P,y,y,k][R]},h=!0,f="hsv"):I(r.h)&&I(r.s)&&I(r.l)&&(c=A(r.s),d=A(r.l),l=function(e,t,n){var r,i,a;function o(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=T(e,360),t=T(t,100),n=T(n,100),0===t)r=i=a=n;else{var l=n<.5?n*(1+t):n+t-n*t,s=2*n-l;r=o(s,l,e+1/3),i=o(s,l,e),a=o(s,l,e-1/3)}return{r:255*r,g:255*i,b:255*a}}(r.h,c,d),h=!0,f="hsl"),r.hasOwnProperty("a")&&(s=r.a)),s=S(s),{ok:h,format:r.format||f,r:Math.min(255,Math.max(l.r,0)),g:Math.min(255,Math.max(l.g,0)),b:Math.min(255,Math.max(l.b,0)),a:s});this._originalInput=t,this._r=L.r,this._g=L.g,this._b=L.b,this._a=L.a,this._roundA=Math.round(100*this._a)/100,this._format=n.format||L.format,this._gradientType=n.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=L.ok}function l(e,t,n){var r,i,a=Math.max(e=T(e,255),t=T(t,255),n=T(n,255)),o=Math.min(e,t,n),l=(a+o)/2;if(a==o)r=i=0;else{var s=a-o;switch(i=l>.5?s/(2-a-o):s/(a+o),a){case e:r=(t-n)/s+(t<n?6:0);break;case t:r=(n-e)/s+2;break;case n:r=(e-t)/s+4}r/=6}return{h:r,s:i,l:l}}function s(e,t,n){var r,i,a=Math.max(e=T(e,255),t=T(t,255),n=T(n,255)),o=Math.min(e,t,n),l=a-o;if(i=0===a?0:l/a,a==o)r=0;else{switch(a){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{h:r,s:i,v:a}}function c(e,t,n,r){var i=[R(Math.round(e).toString(16)),R(Math.round(t).toString(16)),R(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function u(e,t,n,r){return[R(L(r)),R(Math.round(e).toString(16)),R(Math.round(t).toString(16)),R(Math.round(n).toString(16))].join("")}function d(e,t){t=0===t?0:t||10;var n=o(e).toHsl();return n.s-=t/100,n.s=P(n.s),o(n)}function h(e,t){t=0===t?0:t||10;var n=o(e).toHsl();return n.s+=t/100,n.s=P(n.s),o(n)}function f(e){return o(e).desaturate(100)}function p(e,t){t=0===t?0:t||10;var n=o(e).toHsl();return n.l+=t/100,n.l=P(n.l),o(n)}function m(e,t){t=0===t?0:t||10;var n=o(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-(t/100*255)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-(t/100*255)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-(t/100*255)))),o(n)}function g(e,t){t=0===t?0:t||10;var n=o(e).toHsl();return n.l-=t/100,n.l=P(n.l),o(n)}function v(e,t){var n=o(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,o(n)}function b(e){var t=o(e).toHsl();return t.h=(t.h+180)%360,o(t)}function y(e,t){if(isNaN(t)||t<=0)throw Error("Argument to polyad must be a positive number");for(var n=o(e).toHsl(),r=[o(e)],i=360/t,a=1;a<t;a++)r.push(o({h:(n.h+a*i)%360,s:n.s,l:n.l}));return r}function w(e){var t=o(e).toHsl(),n=t.h;return[o(e),o({h:(n+72)%360,s:t.s,l:t.l}),o({h:(n+216)%360,s:t.s,l:t.l})]}function x(e,t,n){t=t||6,n=n||30;var r=o(e).toHsl(),i=360/n,a=[o(e)];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,a.push(o(r));return a}
vendor: 7,535 bytes, line 12
12function C(e,t){t=t||6;for(var n=o(e).toHsv(),r=n.h,i=n.s,a=n.v,l=[],s=1/t;t--;)l.push(o({h:r,s:i,v:a})),a=(a+s)%1;return l}o.prototype={isDark:function(){return 128>this.getBrightness()},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*((t=r.g/255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*((n=r.b/255)<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=S(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=s(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=s(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=l(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=l(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return c(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){var t,n,r,i,a;return t=this._r,n=this._g,r=this._b,i=this._a,a=[R(Math.round(t).toString(16)),R(Math.round(n).toString(16)),R(Math.round(r).toString(16)),R(L(i))],e&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*T(this._r,255))+"%",g:Math.round(100*T(this._g,255))+"%",b:Math.round(100*T(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*T(this._r,255))+"%, "+Math.round(100*T(this._g,255))+"%, "+Math.round(100*T(this._b,255))+"%)":"rgba("+Math.round(100*T(this._r,255))+"%, "+Math.round(100*T(this._g,255))+"%, "+Math.round(100*T(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(k[c(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+u(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var i=o(e);n="#"+u(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return!t&&r&&("hex"===e||"hex6"===e||"hex3"===e||"hex4"===e||"hex8"===e||"name"===e)?"name"===e&&0===this._a?this.toName():this.toRgbString():("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),("hex"===e||"hex6"===e)&&(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return o(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(p,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(g,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(h,arguments)},greyscale:function(){return this._applyModification(f,arguments)},spin:function(){return this._applyModification(v,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(x,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(C,arguments)},splitcomplement:function(){return this._applyCombination(w,arguments)},triad:function(){return this._applyCombination(y,[3])},tetrad:function(){return this._applyCombination(y,[4])}},o.fromRatio=function(t,n){if("object"==e(t)){var r={};for(var i in t)t.hasOwnProperty(i)&&("a"===i?r[i]=t[i]:r[i]=A(t[i]));t=r}return o(t,n)},o.equals=function(e,t){return!!e&&!!t&&o(e).toRgbString()==o(t).toRgbString()},o.random=function(){return o.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},o.mix=function(e,t,n){n=0===n?0:n||50;var r=o(e).toRgb(),i=o(t).toRgb(),a=n/100;return o({r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a})},o.readability=function(e,t){var n=o(e),r=o(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},o.isReadable=function(e,t,n){var r,i,a,l,s,c=o.readability(e,t);switch(s=!1,(i=((r=(r=n)||{level:"AA",size:"small"}).level||"AA").toUpperCase(),a=(r.size||"small").toLowerCase(),"AA"!==i&&"AAA"!==i&&(i="AA"),"small"!==a&&"large"!==a&&(a="small"),l={level:i,size:a}).level+l.size){case"AAsmall":case"AAAlarge":s=c>=4.5;break;case"AAlarge":s=c>=3;break;case"AAAsmall":s=c>=7}return s},o.mostReadable=function(e,t,n){var r,i,a,l,s=null,c=0;i=(n=n||{}).includeFallbackColors,a=n.level,l=n.size;for(var u=0;u<t.length;u++)(r=o.readability(e,t[u]))>c&&(c=r,s=o(t[u]));return o.isReadable(e,s,{level:a,size:l})||!i?s:(n.includeFallbackColors=!1,o.mostReadable(e,["#fff","#000"],n))};var E=o.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee9
120",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},k=o.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(E);function S(e){return(isNaN(e=parseFloat(e))||e<0||e>1)&&(e=1),e}function T(e,t){"string"==typeof(n=e)&&-1!=n.indexOf(".")&&1===parseFloat(n)&&(e="100%");var n,r,i="string"==typeof(r=e)&&-1!=r.indexOf("%");return(e=Math.min(t,Math.max(0,parseFloat(e))),i&&(e=parseInt(e*t,10)/100),1e-6>Math.abs(e-t))?1:e%t/parseFloat(t)}function P(e){return Math.min(1,Math.max(0,e))}function M(e){return parseInt(e,16)}function R(e){return 1==e.length?"0"+e:""+e}function A(e){return e<=1&&(e=100*e+"%"),e}function L(e){return Math.round(255*parseFloat(e)).toString(16)}var _=(n="[\\s|\\(]+("+(t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",{CSS_UNIT:new RegExp(t),rgb:RegExp("rgb"+n),rgba:RegExp("rgba"+r),hsl:RegExp("hsl"+n),hsla:RegExp("hsla"+r),hsv:RegExp("hsv"+n),hsva:RegExp("hsva"
12+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function I(e){return!!_.CSS_UNIT.exec(e)}return o},e.exports=t()},31181:function(e,t,n){"use strict";function r(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{Z:function(){return r}})},17610:function(e,t,n){"use strict";function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}n.d(t,{Z:function(){return r}})},31907:function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}n.d(t,{Z:function(){return i}})},61155:function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}n.d(t,{Z:function(){return r}})},17785:function(e,t,n){"use strict";n.d(t,{ZT:function(){return i},_T:function(){return o},pi:function(){return a}});var r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return(a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}"function"==typeof SuppressedError&&SuppressedError},96834:function(e,t,n){"use strict";n.d(t,{Jh:function(){return o},_T:function(){return i},mG:function(){return a},pi:function(){return r}});var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function i(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function a(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{s(r.next(e))}catch(e){a(e)}}function l(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(o,l)}s((r=r.apply(e,t||[])).next())})}function o(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===l[0]||2===l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}"function"==typeof SuppressedError&&SuppressedError},76413:function(e,t,n){"use strict";n.d(t,{f:function(){return o}});var r=n(33118),i=n(86587);let a=r.zA.performance&&r.zA.performance.now?function(){return r.zA.performance.now()}:function(){return new Date().getTime()};class o{constructor(e,t){this.id=o.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:a(),frameRate:0},this.func=e,this.setLayers(t)}setLayers(e){let t=[];return e&&(t=Array.isArray(e)?e:[e]),this.layers=t,this}getLayers(){return this.layers}addLayer(e){let t=this.layers,n=t.length;for(let r=0;r<n;r++)if(t[r]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){let e=o.animations,t=e.length;for(let n=0;n<t;n++)if(e[n].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=a(),o._addAnimation(this),this}stop(){return o._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.push(e),this._handleAnimation()}static _removeAnimation(e){let t=e.id,n=this.animations,r=n.length;for(let e=0;e<r;e++)if(n[e].id===t){this.animations.splice(e,1);break}}static _runFrames(){let e={},t=this.animations;for(let n=0;n<t.length;n++){let r=t[n],i=r.layers,o=r.func;r._updateFrameObject(a());let l=i.length;if(!o||!1!==o.call(r,r.frame))for(let t=0;t<l;t++){let n=i[t];void 0!==n._id&&(e[n._id]=n)}}for(let t in e)e.hasOwnProperty(t)&&e[t].batchDraw()}static _animationLoop(){o.animations.length?(o._runFrames(),i.Z.requestAnimFrame
12(o._animationLoop)):o.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,i.Z.requestAnimFrame(this._animationLoop))}}o.animations=[],o.animIdCounter=0,o.animRunning=!1},21952:function(e,t,n){"use strict";let r;n.d(t,{RF:function(){return s},Xz:function(){return l},hh:function(){return c}});var i=n(86587),a=n(50775),o=n(33118);class l{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;let t=(e||{}).pixelRatio||o.So.pixelRatio||function(){if(r)return r;let e=i.Z.createCanvasElement(),t=e.getContext("2d");return r=(o.So._global.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),i.Z.releaseCanvas(e),r}();this.pixelRatio=t,this._canvas=i.Z.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(e){let t=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/t,this.getHeight()/t)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";let t=this.pixelRatio;this.getContext()._context.scale(t,t)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";let t=this.pixelRatio;this.getContext()._context.scale(t,t)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,t){this.setWidth(e||0),this.setHeight(t||0)}toDataURL(e,t){try{return this._canvas.toDataURL(e,t)}catch(e){try{return this._canvas.toDataURL()}catch(e){return i.Z.error("Unable to get data URL. "+e.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}class s extends l{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new a.xn(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}}class c extends l{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new a.jR(this),this.setSize(e.width,e.height)}}},28837:function(e,t,n){"use strict";n.d(t,{W:function(){return o}});var r=n(71971),i=n(16006),a=n(27177);class o extends i.N{constructor(){super(...arguments),this.children=[]}getChildren(e){let t=this.children||[];return e?t.filter(e):t}hasChildren(){return this.getChildren().length>0}
12removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(0===e.length)return this;if(e.length>1){for(let t=0;t<e.length;t++)this.add(e[t]);return this}let t=e[0];return t.getParent()?t.moveTo(this):(this._validateAdd(t),t.index=this.getChildren().length,t.parent=this,t._clearCaches(),this.getChildren().push(t),this._fire("add",{child:t}),this._requestDraw()),this}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){let t=this._generalFind(e,!0);return t.length>0?t[0]:void 0}_generalFind(e,t){let n=[];return this._descendants(r=>{let i=r._isMatch(e);return i&&n.push(r),!!i&&!!t}),n}_descendants(e){for(let t of this.getChildren())if(e(t)||t.hasChildren()&&t._descendants(e))return!0;return!1}toObject(){let e=i.N.prototype.toObject.call(this);
12return e.children=[],this.getChildren().forEach(t=>{e.children.push(t.toObject())}),e}isAncestorOf(e){let t=e.getParent();for(;t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}clone(e){let t=i.N.prototype.clone.call(this,e);return this.getChildren().forEach(function(e){t.add(e.clone())}),t}getAllIntersections(e){let t=[];return this.find("Shape").forEach(n=>{n.isVisible()&&n.intersects(e)&&t.push(n)}),t}_clearSelfAndDescendantCache(e){var t;super._clearSelfAndDescendantCache(e),this.isCached()||null===(t=this.children)||void 0===t||t.forEach(function(t){t._clearSelfAndDescendantCache(e)})}_setChildrenIndices(){var e;null===(e=this.children)||void 0===e||e.forEach(function(e,t){e.index=t}),this._requestDraw()}drawScene(e,t,n){let r=this.getLayer(),i=e||r&&r.getCanvas(),a=i&&i.getContext(),o=this._getCanvasCache(),l=o&&o.scene,s=i&&i.isCache;if(!this.isVisible()&&!s)return this;if(l){a.save();let e=this.getAbsoluteTransform(t).getMatrix();a.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedSceneCanvas(a),a.restore()}else this._drawChildren("drawScene",i,t,n);return this}drawHit(e,t){if(!this.shouldDrawHit(t))return this;let n=this.getLayer(),r=e||n&&n.hitCanvas,i=r&&r.getContext(),a=this._getCanvasCache();if(a&&a.hit){i.save();let e=this.getAbsoluteTransform(t).getMatrix();i.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedHitCanvas(i),i.restore()}else this._drawChildren("drawHit",r,t);return this}_drawChildren(e,t,n,r){var i;let a=t&&t.getContext(),o=this.clipWidth(),l=this.clipHeight(),s=this.clipFunc(),c="number"==typeof o&&"number"==typeof l||s,u=n===this;if(c){let e;a.save();let t=this.getAbsoluteTransform(n),r=t.getMatrix();if(a.transform(r[0],r[1],r[2],r[3],r[4],r[5]),a.beginPath(),s)e=s.call(this,a,this);else{let e=this.clipX(),t=this.clipY();a.rect(e||0,t||0,o,l)}a.clip.apply(a,e),r=t.copy().invert().getMatrix(),a.transform(r[0],r[1],r[2],r[3],r[4],r[5])}let d=!u&&"source-over"!==this.globalCompositeOperation()&&"drawScene"===e;d&&(a.save(),a._applyGlobalCompositeOperation(this)),null===(i=this.children)||void 0===i||i.forEach(function(i){i[e](t,n,r)}),d&&a.restore(),c&&a.restore()}getClientRect(e={}){var t;let n,r,i,a;let o=e.skipTransform,l=e.relativeTo,s={x:1/0,y:1/0,width:0,height:0},c=this;null===(t=this.children)||void 0===t||t.forEach(function(t){if(!t.visible())return;let o=t.getClientRect({relativeTo:c,skipShadow:e.skipShadow,skipStroke:e.skipStroke});(0!==o.width||0!==o.height)&&(void 0===n?(n=o.x,r=o.y,i=o.x+o.width,a=o.y+o.height):(n=Math.min(n,o.x),r=Math.min(r,o.y),i=Math.max(i,o.x+o.width),a=Math.max(a,o.y+o.height)))});let u=this.find("Shape"),d=!1;for(let e=0;e<u.length;e++)if(u[e]._isVisible(this)){d=!0;break}return(s=d&&void 0!==n?{x:n,y:r,width:i-n,height:a-r}:{x:0,y:0,width:0,height:0},o)?s:this._transformedRect(s,l)}}r.F.addComponentsGetterSetter(o,"clip",["x","y","width","height"]),r.F.addGetterSetter(o,"clipX",void 0,(0,a.Kg)()),r.F.addGetterSetter(o,"clipY",void 0,(0,a.Kg)()),r.F.addGetterSetter(o,"clipWidth",void 0,(0,a.Kg)()),r.F.addGetterSetter(o,"clipHeight",void 0,(0,a.Kg)()),r.F.addGetterSetter(o,"clipFunc")},50775:function(e,t,n){"use strict";n.d(t,{II:function(){return l},_y:function(){return s},jR:function(){return u},xn:function(){return c}});var r=n(86587),i=n(33118);let a=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],o=null;function l(){if(null!==o)return o;try{let e=r.Z.createCanvasElement().getContext("2d");if(!e)return o=!1,!1;return!!e&&"filter"in e}catch(e){return o=!1,!1}}class s{constructor(e){this.canvas=e,i.So.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,t){let n=this.traceArr,i=n.length,a="",o,l,s,c;for(o=0;o<i;o++)(s=(l=n[o]).method)?(c=l.args,a+=s,e?a+="()":r.Z._isArray(c[0])?a+="(["+c.join(",")+"])":(t&&(c=c.map(e=>"number"==typeof e?Math.floor(e):e)),a+="("+c.join(",")+")")):(a+=l.property,e||(a+="="+l.val)),a+=";";return a}clearTrace(){this.traceArr=[]}_trace(e){let t=this.traceArr;t.push(e),t.length>=100&&t.shift()}reset(){let e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){let t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}_applyLineCap(e){let t=e.attrs.lineCap;t&&this.setAttr("lineCap",t)}_applyOpacity(e){let t=e.getAbsoluteOpacity();1!==t&&this.setAttr("globalAlpha",t)}_applyLineJoin(e){let t=e.attrs.lineJoin;t&&this.setAttr("lineJoin",t)}_applyMiterLimit(e){let t=e.attrs.miterLimit;null!=t&&this.setAttr("miterLimit",t)}setAttr(e,t){this._context[e]=t}arc(e,t,n,r,i,a){this._context.arc(e,t,n,r,i,a)}arcTo(e,t,n,r,i){this._context.arcTo(e,t,n,r,i)}beginPath(){this._context.beginPath()}bezierCurveTo(e,t,n,r,i,a){this._context.bezierCurveTo(e,t,n,r,i,a)}clearRect(e,t,n,r){this._context.clearRect(e,t,n,r)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,t){let n=arguments;return 2===n.length?this._context.createImageData(e,t):1===n.length?this._context.createImageData(e):void 0}createLinearGradient(e,t,n,r){return this._context.createLinearGradient(e,t,n,r)}createPattern(e,t){return this._context.createPattern(e,t)}createRadialGradient(e,t,n,r,i,a){return this._context.createRadialGradient(e,t,n,r,i,a)}drawImage(e,t,n,r,i,a,o,l,s){let c=arguments,u=this._context;3===c.length?u.drawImage(e,t,n):5===c.length?u.drawImage(e,t,n,r,i):9===c.length&&u.drawImage(e,t,n,r,i,a,o,l,s)}ellipse(e,t,n,r,i,a,o,l){this._context.ellipse(e,t,n,r,i,a,o,l)}
12isPointInPath(e,t,n,r){return n?this._context.isPointInPath(n,e,t,r):this._context.isPointInPath(e,t,r)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,t,n,r){this._context.fillRect(e,t,n,r)}strokeRect(e,t,n,r){this._context.strokeRect(e,t,n,r)}fillText(e,t,n,r){r?this._context.fillText(e,t,n,r):this._context.fillText(e,t,n)}measureText(e){return this._context.measureText(e)}getImageData(e,t,n,r){return this._context.getImageData(e,t,n,r)}lineTo(e,t){this._context.lineTo(e,t)}moveTo(e,t){this._context.moveTo(e,t)}rect(e,t,n,r){this._context.rect(e,t,n,r)}roundRect(e,t,n,r,i){this._context.roundRect(e,t,n,r,i)}putImageData(e,t,n){this._context.putImageData(e,t,n)}quadraticCurveTo(e,t,n,r){this._context.quadraticCurveTo(e,t,n,r)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,t){this._context.scale(e,t)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,t,n,r,i,a){this._context.setTransform(e,t,n,r,i,a)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,t,n,r){this._context.strokeText(e,t,n,r)}transform(e,t,n,r,i,a){this._context.transform(e,t,n,r,i,a)}translate(e,t){this._context.translate(e,t)}_enableTrace(){let e=this,t=a.length,n=this.setAttr,i,o,l=function(t){let n=e[t],i;e[t]=function(){return o=function(e){let t=[],n=e.length,i=r.Z;for(let r=0;r<n;r++){let n=e[r];i._isNumber(n)?n=Math.round(1e3*n)/1e3:i._isString(n)||(n+=""),t.push(n)}return t}(Array.prototype.slice.call(arguments,0)),i=n.apply(e,arguments),e._trace({method:t,args:o}),i}};for(i=0;i<t;i++)l(a[i]);e.setAttr=function(){n.apply(e,arguments);let t=arguments[0],r=arguments[1];("shadowOffsetX"===t||"shadowOffsetY"===t||"shadowBlur"===t)&&(r/=this.canvas.getPixelRatio()),e._trace({property:t,val:r})}}_applyGlobalCompositeOperation(e){let t=e.attrs.globalCompositeOperation;t&&"source-over"!==t&&this.setAttr("globalCompositeOperation",t)}}["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"].forEach(function(e){Object.defineProperty(s.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class c extends s{constructor(e,{willReadFrequently:t=!1}={}){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:t})}_fillColor(e){let t=e.fill();this.setAttr("fillStyle",t),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){let t=e._getLinearGradient();t&&(this.setAttr("fillStyle",t),e._fillFunc(this))}_fillRadialGradient(e){let t=e._getRadialGradient();t&&(this.setAttr("fillStyle",t),e._fillFunc(this))}_fill(e){let t=e.fill(),n=e.getFillPriority();if(t&&"color"===n){this._fillColor(e);return}let r=e.getFillPatternImage();if(r&&"pattern"===n){this._fillPattern(e);return}let i=e.getFillLinearGradientColorStops();if(i&&"linear-gradient"===n){this._fillLinearGradient(e);return}let a=e.getFillRadialGradientColorStops();if(a&&"radial-gradient"===n){this._fillRadialGradient(e);return}t?this._fillColor(e):r?this._fillPattern(e):i?this._fillLinearGradient(e):a&&this._fillRadialGradient(e)}_strokeLinearGradient(e){let t=e.getStrokeLinearGradientStartPoint(),n=e.getStrokeLinearGradientEndPoint(),r=e.getStrokeLinearGradientColorStops(),i=this.createLinearGradient(t.x,t.y,n.x,n.y);if(r){for(let e=0;e<r.length;e+=2)i.addColorStop(r[e],r[e+1]);this.setAttr("strokeStyle",i)}}_stroke(e){let t=e.dash(),n=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!n){this.save();let e=this.getCanvas().getPixelRatio();this.setTransform(e,0,0,e,0,0)}this._applyLineCap(e),t&&e.dashEnabled()&&(this.setLineDash(t),this.setAttr("lineDashOffset",e.dashOffset())),this.setAttr("lineWidth",e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),e.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),n||this.restore(
12)}}_applyShadow(e){var t,n,r;let i=null!==(t=e.getShadowRGBA())&&void 0!==t?t:"black",a=null!==(n=e.getShadowBlur())&&void 0!==n?n:5,o=null!==(r=e.getShadowOffset())&&void 0!==r?r:{x:0,y:0},l=e.getAbsoluteScale(),s=this.canvas.getPixelRatio(),c=l.x*s,u=l.y*s;this.setAttr("shadowColor",i),this.setAttr("shadowBlur",a*Math.min(Math.abs(c),Math.abs(u))),this.setAttr("shadowOffsetX",o.x*c),this.setAttr("shadowOffsetY",o.y*u)}}class u extends s{constructor(e){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr("fillStyle",e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){let t=e.getStrokeScaleEnabled();if(!t){this.save();let e=this.getCanvas().getPixelRatio();this.setTransform(e,0,0,e,0,0)}this._applyLineCap(e);let n=e.hitStrokeWidth(),r="auto"===n?e.strokeWidth():n;this.setAttr("lineWidth",r),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),t||this.restore()}}}},26867:function(e,t,n){"use strict";n.d(t,{DD:function(){return a}});var r=n(33118),i=n(86587);let a={get isDragging(){let e=!1;return a._dragElements.forEach(t=>{"dragging"===t.dragStatus&&(e=!0)}),e},justDragged:!1,get node(){let e;return a._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){let t=[];a._dragElements.forEach((n,r)=>{let{node:a}=n,o=a.getStage();o.setPointersPositions(e),void 0===n.pointerId&&(n.pointerId=i.Z._getFirstPointerId(e));let l=o._changedPointerPositions.find(e=>e.id===n.pointerId);if(l){if("dragging"!==n.dragStatus){let t=a.dragDistance();if(Math.max(Math.abs(l.x-n.startPointerPos.x),Math.abs(l.y-n.startPointerPos.y))<t||(a.startDrag({evt:e}),!a.isDragging()))return}a._setDragPosition(e,n),t.push(a)}}),t.forEach(t=>{t.getStage()&&t.fire("dragmove",{type:"dragmove",target:t,evt:e},!0)})},_endDragBefore(e){let t=[];a._dragElements.forEach(n=>{let{node:i}=n,o=i.getStage();if(e&&o.setPointersPositions(e),!o._changedPointerPositions.find(e=>e.id===n.pointerId))return;("dragging"===n.dragStatus||"stopped"===n.dragStatus)&&(a.justDragged=!0,r.So._mouseListenClick=!1,r.So._touchListenClick=!1,r.So._pointerListenClick=!1,n.dragStatus="stopped");let l=n.node.getLayer()||n.node instanceof r.So.Stage&&n.node;l&&-1===t.indexOf(l)&&t.push(l)}),t.forEach(e=>{e.draw()})},_endDragAfter(e){a._dragElements.forEach((t,n)=>{"stopped"===t.dragStatus&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),"dragging"!==t.dragStatus&&a._dragElements.delete(n)})}};r.So.isBrowser&&(window.addEventListener("mouseup",a._endDragBefore,!0),window.addEventListener("touchend",a._endDragBefore,!0),window.addEventListener("touchcancel",a._endDragBefore,!0),window.addEventListener("mousemove",a._drag),window.addEventListener("touchmove",a._drag),window.addEventListener("mouseup",a._endDragAfter,!1),window.addEventListener("touchend",a._endDragAfter,!1),window.addEventListener("touchcancel",a._endDragAfter,!1))},71971:function(e,t,n){"use strict";n.d(t,{F:function(){return a}});var r=n(86587),i=n(27177);let a={addGetterSetter(e,t,n,r,i){a.addGetter(e,t,n),a.addSetter(e,t,r,i),a.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){let i="get"+r.Z._capitalize(t);e.prototype[i]=e.prototype[i]||function(){let e=this.attrs[t];return void 0===e?n:e}},addSetter(e,t,n,i){let o="set"+r.Z._capitalize(t);e.prototype[o]||a.overWriteSetter(e,t,n,i)},overWriteSetter(e,t,n,i){let a="set"+r.Z._capitalize(t);e.prototype[a]=function(e){return n&&null!=e&&(e=n.call(this,e,t)),this._setAttr(t,e),i&&i.call(this),this}},addComponentsGetterSetter(e,t,n,o,l){let s=n.length,c=r.Z._capitalize,u="get"+c(t),d="set"+c(t);e.prototype[u]=function(){let e={};for(let r=0;r<s;r++){let i=n[r];e[i]=this.getAttr(t+c(i))}return e};let h=(0,i.uZ)(n);e.prototype[d]=function(e){let r=this.attrs[t];for(let n in o&&(e=o.call(this,e,t)),h&&h.call(this,e,t),e)e.hasOwnProperty(n)&&this._setAttr(t+c(n),e[n]);return e||n.forEach(e=>{this._setAttr(t+c(e),void 0)}),this._fireChangeEvent(t,r,e),l&&l.call(this),this},a.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){let n=r.Z._capitalize(t),i="set"+n,a="get"+n;e.prototype[t]=function(){return arguments.length?(this[i](arguments[0]),this):this[a]()}},addDeprecatedGetterSetter(e,t,n,i){r.Z.error("Adding deprecated "+t);let o="get"+r.Z._capitalize(t),l=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[o]=function(){r.Z.error(l);let e=this.attrs[t];return void 0===e?n:e},a.addSetter(e,t,i,function(){r.Z.error(l)}),a.addOverloadedGetterSetter(e,t)},backCompat(e,t){r.Z.each(t,function(t,n){let i=e.prototype[n],a="get"+r.Z._capitalize(t),o="set"+r.Z._capitalize(t);function l(){i.apply(this,arguments),r.Z.error('"'+t+'" method is deprecated and will be removed soon. Use ""'+n+'" instead.')}e.prototype[t]=l,e.prototype[a]=l,e.prototype[o]=l})},afterSetFilter(){this._filterUpToDate=!1}}},33118:function(e,t,n){"use strict";n.d(t,{DA:function(){return o},So:function(){return a},zA:function(){return i}});let r=Math.PI/180,i="undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:{},a={_global:i,version:"10.2.3",isBrowser:"undefined"!=typeof window&&("[object Window]"===({}).toString.call(window)||"[object global]"===({}).toString.call(window)),isUnminified:/param/.test((function(e){}).toString()),dblClickWindow:400,getAngle:e=>a.angleDeg?e*r:e,enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_renderBackend:"web",legacyTextRendering:!1,pixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging:()=>a.DD.isDragging,isTransforming(){var e,t;return null!==(t=null===(e=a.Transformer)||void 0===e?void 0:e.isTransforming())&&void 0!==t&&t},isDragReady:()=>!!a.DD.node,releaseCanvasOnDestroy:!0,document:i.document,_injectGlobal(e){void 0!==i.Konva&&console.error("Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."),i.Konva=e}},o=e=>{a[e.prototype.getClassName()]=e};a._injectGlobal(a)},92268:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(86587),i=n(28837),a=n(33118);class o extends i.W{_validateAdd(e){let t=e.getType();"Group"!==t&&"Shape"!==t&&r.Z.throw("You may only add groups and shapes to groups.")}}o.prototype.nodeType="Group",(0,a.DA)(o)},16006:function(e,t,n){"use strict";n.d(t,{N:function(){return x}});var r=n(21952),i=n(50775),a=n(26867),o=n(71971),l=n(33118),s=n(86587),c=n(27177);let u="absoluteOpacity",d="allEventListeners",h="absoluteTransform",f="absoluteScale",p="canvas",m="listening",g="Shape",v="stage",b="transform",y="visible",w=1;class x{constructor(e){this._id=w++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===b||e===h)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,t){let n=this._cache.get(e),r=e===b||e===h;return(void 0===n||r&&!0===n.dirty)&&(n=t.call(this),this._cache.set(e,n)),n}_calculate(e,t,n){if(!this._attachedDepsListeners.get(e)){let n=t.map(e=>e+"Change.konva").join(" ");this.on(n,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,n)}_getCanvasCache(){return this._cache.get(p)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===h&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(p)){let{scene:e,filter:t,hit:n}=this._cache.get(p);s.Z.releaseCanvas(e._canvas,t._canvas,n._canvas),this._cache.delete(p)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){let t=e||{},n={};(void 0===t.x||void 0===t.y||void 0===t.width||void 0===t.height)&&(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let i=Math.ceil(t.width||n.width),a=Math.ceil(t.height||n.height),o=t.pixelRatio,l=void 0===t.x?Math.floor(n.x):t.x,c=void 0===t.y?Math.floor(n.y):t.y,d=t.offset||0,h=t.drawBorder||!1,m=t.hitCanvasPixelRatio||1;if(!i||!a){s.Z.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}let g=Math.abs(Math.round(n.x)-l)>.5?1:0,v=Math.abs(Math.round(n.y)-c)>.5?1:0;i+=2*d+g,a+=2*d+v,l-=d,c-=d;let b=new r.RF({pixelRatio:o,width:i,height:a}),y=new r.RF({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),w=new r.hh({pixelRatio:m,width:i,height:a}
12),x=b.getContext(),C=w.getContext(),E=new r.RF({width:b.width/b.pixelRatio+Math.abs(l),height:b.height/b.pixelRatio+Math.abs(c),pixelRatio:b.pixelRatio}),k=E.getContext();return w.isCache=!0,b.isCache=!0,this._cache.delete(p),this._filterUpToDate=!1,!1===t.imageSmoothingEnabled&&(b.getContext()._context.imageSmoothingEnabled=!1,y.getContext()._context.imageSmoothingEnabled=!1),x.save(),C.save(),k.save(),x.translate(-l,-c),C.translate(-l,-c),k.translate(-l,-c),E.x=l,E.y=c,this._isUnderCache=!0,this._clearSelfAndDescendantCache(u),this._clearSelfAndDescendantCache(f),this.drawScene(b,this,E),this.drawHit(w,this),this._isUnderCache=!1,x.restore(),C.restore(),h&&(x.save(),x.beginPath(),x.rect(0,0,i,a),x.closePath(),x.setAttr("strokeStyle","red"),x.setAttr("lineWidth",5),x.stroke(),x.restore()),s.Z.releaseCanvas(E._canvas),this._cache.set(p,{scene:b,filter:y,hit:w,x:l,y:c}),this._requestDraw(),this}isCached(){return this._cache.has(p)}getClientRect(e){throw Error('abstract "getClientRect" method call')}_transformedRect(e,t){let n=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],r=1/0,i=1/0,a=-1/0,o=-1/0,l=this.getAbsoluteTransform(t);return n.forEach(function(e){let t=l.point(e);void 0===r&&(r=a=t.x,i=o=t.y),r=Math.min(r,t.x),i=Math.min(i,t.y),a=Math.max(a,t.x),o=Math.max(o,t.y)}),{x:r,y:i,width:a-r,height:o-i}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);let t=this._getCanvasCache();e.translate(t.x,t.y);let n=this._getCachedSceneCanvas(),r=n.pixelRatio;e.drawImage(n._canvas,0,0,n.width/r,n.height/r),e.restore()}_drawCachedHitCanvas(e){let t=this._getCanvasCache(),n=t.hit;e.save(),e.translate(t.x,t.y),e.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),e.restore()}_getCachedSceneCanvas(){let e=this.filters(),t=this._getCanvasCache(),n=t.scene,r=t.filter,a=r.getContext(),o,c,u,d;if(!e||0===e.length)return n;if(this._filterUpToDate)return r;let h=!0;for(let t=0;t<e.length;t++)if("string"==typeof e[t]&&(0,i.II)(),"string"!=typeof e[t]||!(0,i.II)()){h=!1;break}let f=n.pixelRatio;if(r.setSize(n.width/n.pixelRatio,n.height/n.pixelRatio),h){let t=e.join(" ");return a.save(),a.setAttr("filter",t),a.drawImage(n._canvas,0,0,n.getWidth()/f,n.getHeight()/f),a.restore(),this._filterUpToDate=!0,r}try{for(o=e.length,a.clear(),a.drawImage(n._canvas,0,0,n.getWidth()/f,n.getHeight()/f),c=a.getImageData(0,0,r.getWidth(),r.getHeight()),u=0;u<o;u++)d=e[u],"string"==typeof d&&(d=function(e){let t;let n=/(\w+)\(([^)]+)\)/g;for(;null!==(t=n.exec(e));){let[,e,n]=t;switch(e){case"blur":{let e=parseFloat(n.replace("px",""));return function(t){this.blurRadius(.5*e);let n=l.So.Filters;n&&n.Blur&&n.Blur.call(this,t)}}case"brightness":{let e=n.includes("%")?parseFloat(n)/100:parseFloat(n);return function(t){this.brightness(e);let n=l.So.Filters;n&&n.Brightness&&n.Brightness.call(this,t)}}case"contrast":{let e=parseFloat(n);return function(t){let n=100*(Math.sqrt(e)-1);this.contrast(n);let r=l.So.Filters;r&&r.Contrast&&r.Contrast.call(this,t)}}case"grayscale":return function(e){let t=l.So.Filters;t&&t.Grayscale&&t.Grayscale.call(this,e)};case"sepia":return function(e){let t=l.So.Filters;t&&t.Sepia&&t.Sepia.call(this,e)};case"invert":return function(e){let t=l.So.Filters;t&&t.Invert&&t.Invert.call(this,e)};default:s.Z.warn(`CSS filter "${e}" is not supported in fallback mode. Consider using function filters for better compatibility.`)}}return()=>{}}(d)),d.call(this,c),a.putImageData(c,0,0)}catch(e){s.Z.error("Unable to apply filter. "+e.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}return this._filterUpToDate=!0,r}on(...e){let t=e[0],n=e[1];if(e[2],this._cache&&this._cache.delete(d),3===e.length)return this._delegate.apply(this,e);let r=t.split(" ");for(let e=0;e<r.length;e++){let t=r[e].split("."),i=t[0],a=t[1]||"";this.eventListeners[i]||(this.eventListeners[i]=[]),this.eventListeners[i].push({name:a,handler:n})}return this}off(e,t){let n=(e||"").split(" "),r=n.length,i,a,o,l,s;if(this._cache&&this._cache.delete(d),!e)for(a in this.eventListeners)this._off(a);for(i=0;i<r;i++)if(l=(o=n[i].split("."))[0],s=o[1],l)this.eventListeners[l]&&this._off(l,s,t);else for(a in this.eventListeners)this._off(a,s,t);return this}
12dispatchEvent(e){let t={target:this,type:e.type,evt:e};return this.fire(e.type,t),this}addEventListener(e,t){return this.on(e,function(e){t.call(this,e.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,t,n){let r=this;return this.on(e,function(e){let i=e.target.findAncestors(t,!0,r);for(let t=0;t<i.length;t++)(e=s.Z.cloneObject(e)).currentTarget=i[t],n.call(i[t],e)}),this}remove(){return this.isDragging()&&this.stopDrag(),a.DD._dragElements.delete(this._id),a.DD._dragElements.forEach((e,t)=>{this.isAncestorOf(e.node)&&a.DD._dragElements.delete(t)}),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(h),this._clearSelfAndDescendantCache(u),this._clearSelfAndDescendantCache(f),this._clearSelfAndDescendantCache(v),this._clearSelfAndDescendantCache(y),this._clearSelfAndDescendantCache(m)}_remove(){this._clearCaches();let e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){let t="get"+s.Z._capitalize(e);return s.Z._isFunction(this[t])?this[t]():this.attrs[e]}getAncestors(){let e=this.getParent(),t=[];for(;e;)t.push(e),e=e.getParent();return t}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{let t,n;if(!e)return this;for(t in e)"children"!==t&&(n="set"+s.Z._capitalize(t),s.Z._isFunction(this[n])?this[n](e[t]):this._setAttr(t,e[t]))}),this}isListening(){return this._getCache(m,this._isListening)}_isListening(e){if(!this.listening())return!1;let t=this.getParent();return!t||t===e||this===e||t._isListening(e)}isVisible(){return this._getCache(y,this._isVisible)}_isVisible(e){if(!this.visible())return!1;let t=this.getParent();return!t||t===e||this===e||t._isVisible(e)}shouldDrawHit(e,t=!1){if(e)return this._isVisible(e)&&this._isListening(e);let n=this.getLayer(),r=!1;a.DD._dragElements.forEach(e=>{"dragging"===e.dragStatus&&("Stage"===e.node.nodeType?r=!0:e.node.getLayer()===n&&(r=!0))});let i=!t&&!l.So.hitOnDragEnabled&&(r||l.So.isTransforming());return this.isListening()&&this.isVisible()&&!i}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let e=this.getDepth(),t=this,n=0,r,i,a,o,l=this.getStage();return"Stage"!==t.nodeType&&l&&function l(s){for(a=0,r=[],i=s.length;a<i;a++)o=s[a],n++,o.nodeType!==g&&(r=r.concat(o.getChildren().slice())),o._id===t._id&&(a=i);r.length>0&&r[0].getDepth()<=e&&l(r)}(l.getChildren()),n}getDepth(){let e=0,t=this.parent;for(;t;)e++,t=t.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(b),this._clearSelfAndDescendantCache(h)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){let e=this.getStage();if(!e)return null;let t=e.getPointerPosition();if(!t)return null;let n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(e){let t=!1,n=this.parent;for(;n;){if(n.isCached()){t=!0;break}n=n.parent}t&&!e&&(e=!0);let r=this.getAbsoluteTransform(e).getMatrix(),i=new s.w,a=this.offset();return i.m=r.slice(),i.translate(a.x,a.y),i.getTranslation()}setAbsolutePosition(e){let{x:t,y:n,...r}=this._clearTransform();this.attrs.x=t,this.attrs.y=n,this._clearCache(b);let i=this._getAbsoluteTransform().copy();return i.invert(),i.translate(e.x,e.y),e={x:this.attrs.x+i.getTranslation().x,y:this.attrs.y+i.getTranslation().y},this._setTransform(r),this.setPosition({x:e.x,y:e.y}),this._clearCache(b),this._clearSelfAndDescendantCache(h),this}_setTransform(e){let t;for(t in e)this.attrs[t]=e[t]}_clearTransform(){let e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){let t=e.x,n=e.y,r=this.x(),i=this.y();return void 0!==t&&(r+=t),void 0!==n&&(i+=n),this.setPosition({x:r,y:i}),this}_eachAncestorReverse(e,t){let n=[],r=this.getParent(),i,a;if(!t||t._id!==this._id){for(n.unshift(this);r&&(!t||r._id!==t._id);)n.unshift(r),r=r.parent;for(a=0,i=n.length;a<i;a++)e(n[a])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return s.Z.warn("Node has no parent. moveToTop function is ignored."),!1;let e=this.index;return e<this.parent.getChildren().length-1&&(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0)}moveUp(){if(!this.parent)return s.Z.warn("Node has no parent. moveUp function is ignored."),!1;let e=this.index;return e<this.parent.getChildren().length-1&&(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0)}moveDown(){if(!this.parent)return s.Z.warn("Node has no parent. moveDown function is ignored."),!1;let e=this.index;return e>0&&(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0)}moveToBottom(){if(!this.parent)return s.Z.warn("Node has no parent. moveToBottom function is ignored."),!1;let e=this.index;return e>0&&(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0)}setZIndex(e){if(!this.parent)return s.Z.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&s.Z.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");let t=this.index;return this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(u,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let e=this.opacity(),t=this.getParent();return t&&!t._isUnderCache&&(e*=t.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){let e=this.getAttrs(),t,n,r,i,a={attrs:{},className:this.getClassName()};for(t in e)n=e[t],(!s.Z.isObject(n)||s.Z._isPlainObject(n)||s.Z._isArray(n))&&(r="function"==typeof this[t]&&this[t],delete e[t],i=r?r.call(this):null,e[t]=n,i!==n&&(a.attrs[t]=n));return s.Z._prepareToStringify(a)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}
12findAncestors(e,t,n){let r=[];t&&this._isMatch(e)&&r.push(this);let i=this.parent;for(;i&&i!==n;)i._isMatch(e)&&r.push(i),i=i.parent;return r}isAncestorOf(e){return!1}findAncestor(e,t,n){return this.findAncestors(e,t,n)[0]}_isMatch(e){if(!e)return!1;if("function"==typeof e)return e(this);let t=e.replace(/ /g,"").split(","),n=t.length,r,i;for(r=0;r<n;r++)if(i=t[r],s.Z.isValidSelector(i)||(s.Z.warn('Selector "'+i+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),s.Z.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),s.Z.warn("Konva is awesome, right?")),"#"===i.charAt(0)){if(this.id()===i.slice(1))return!0}else if("."===i.charAt(0)){if(this.hasName(i.slice(1)))return!0}else if(this.className===i||this.nodeType===i)return!0;return!1}getLayer(){let e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(v,this._getStage)}_getStage(){let e=this.getParent();return e?e.getStage():null}fire(e,t={},n){return t.target=t.target||this,n?this._fireAndBubble(e,t):this._fire(e,t),this}getAbsoluteTransform(e){return e?this._getAbsoluteTransform(e):this._getCache(h,this._getAbsoluteTransform)}_getAbsoluteTransform(e){let t;if(e)return t=new s.w,this._eachAncestorReverse(function(e){let n=e.transformsEnabled();"all"===n?t.multiply(e.getTransform()):"position"===n&&t.translate(e.x()-e.offsetX(),e.y()-e.offsetY())},e),t;{t=this._cache.get(h)||new s.w,this.parent?this.parent.getAbsoluteTransform().copyInto(t):t.reset();let e=this.transformsEnabled();if("all"===e)t.multiply(this.getTransform());else if("position"===e){let e=this.attrs.x||0,n=this.attrs.y||0,r=this.attrs.offsetX||0,i=this.attrs.offsetY||0;t.translate(e-r,n-i)}return t.dirty=!1,t}}getAbsoluteScale(e){let t=this;for(;t;)t._isUnderCache&&(e=t),t=t.getParent();let n=this.getAbsoluteTransform(e).decompose();return{x:n.scaleX,y:n.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(b,this._getTransform)}_getTransform(){var e,t;let n=this._cache.get(b)||new s.w;n.reset();let r=this.x(),i=this.y(),a=l.So.getAngle(this.rotation()),o=null!==(e=this.attrs.scaleX)&&void 0!==e?e:1,c=null!==(t=this.attrs.scaleY)&&void 0!==t?t:1,u=this.attrs.skewX||0,d=this.attrs.skewY||0,h=this.attrs.offsetX||0,f=this.attrs.offsetY||0;return(0!==r||0!==i)&&n.translate(r,i),0!==a&&n.rotate(a),(0!==u||0!==d)&&n.skew(u,d),(1!==o||1!==c)&&n.scale(o,c),(0!==h||0!==f)&&n.translate(-1*h,-1*f),n.dirty=!1,n}clone(e){let t=s.Z.cloneObject(this.attrs),n,r,i,a,o;for(n in e)t[n]=e[n];let l=new this.constructor(t);for(n in this.eventListeners)for(a=0,i=(r=this.eventListeners[n]).length;a<i;a++)0>(o=r[a]).name.indexOf("konva")&&(l.eventListeners[n]||(l.eventListeners[n]=[]),l.eventListeners[n].push(o));return l}_toKonvaCanvas(e){e=e||{};let t=this.getClientRect(),n=this.getStage(),i=void 0!==e.x?e.x:Math.floor(t.x),a=void 0!==e.y?e.y:Math.floor(t.y),o=e.pixelRatio||1,l=new r.RF({width:e.width||Math.ceil(t.width)||(n?n.width():0),height:e.height||Math.ceil(t.height)||(n?n.height():0),pixelRatio:o}),s=l.getContext(),c=new r.RF({width:l.width/l.pixelRatio+Math.abs(i),height:l.height/l.pixelRatio+Math.abs(a),pixelRatio:l.pixelRatio});return!1===e.imageSmoothingEnabled&&(s._context.imageSmoothingEnabled=!1),s.save(),(i||a)&&s.translate(-1*i,-1*a),this.drawScene(l,void 0,c),s.restore(),l}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){let t=(e=e||{}).mimeType||null,n=e.quality||null,r=this._toKonvaCanvas(e).toDataURL(t,n);return e.callback&&e.callback(r),r}toImage(e){return new Promise((t,n)=>{try{let n=null==e?void 0:e.callback;n&&delete e.callback,s.Z._urlToImage(this.toDataURL(e),function(e){t(e),null==n||n(e)})}catch(e){n(e)}})}toBlob(e){return new Promise((t,n)=>{try{let n=null==e?void 0:e.callback;n&&delete e.callback,this.toCanvas(e).toBlob(e=>{t(e),null==n||n(e)},null==e?void 0:e.mimeType,null==e?void 0:e.quality)}catch(e){n(e)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return void 0!==this.attrs.dragDistance?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():l.So.dragDistance}_off(e,t,n){let r=this.eventListeners[e],i,a,o;for(i=0;i<r.length;
12i++)if(a=r[i].name,o=r[i].handler,("konva"!==a||"konva"===t)&&(!t||a===t)&&(!n||n===o)){if(r.splice(i,1),0===r.length){delete this.eventListeners[e];break}i--}}_fireChangeEvent(e,t,n){this._fire(e+"Change",{oldVal:t,newVal:n})}addName(e){if(!this.hasName(e)){let t=this.name();this.name(t?t+" "+e:e)}return this}hasName(e){if(!e)return!1;let t=this.name();return!!t&&-1!==(t||"").split(/\s/g).indexOf(e)}removeName(e){let t=(this.name()||"").split(/\s/g),n=t.indexOf(e);return -1!==n&&(t.splice(n,1),this.name(t.join(" "))),this}setAttr(e,t){let n=this["set"+s.Z._capitalize(e)];return s.Z._isFunction(n)?n.call(this,t):this._setAttr(e,t),this}_requestDraw(){if(l.So.autoDrawEnabled){let e=this.getLayer()||this.getStage();null==e||e.batchDraw()}}_setAttr(e,t){let n=this.attrs[e];(n!==t||s.Z.isObject(t))&&(null==t?delete this.attrs[e]:this.attrs[e]=t,this._shouldFireChangeEvents&&this._fireChangeEvent(e,n,t),this._requestDraw())}_setComponentAttr(e,t,n){let r;void 0!==n&&((r=this.attrs[e])||(this.attrs[e]=this.getAttr(e)),this.attrs[e][t]=n,this._fireChangeEvent(e,r,n))}_fireAndBubble(e,t,n){t&&this.nodeType===g&&(t.target=this);let r=["mouseenter","mouseleave","pointerenter","pointerleave","touchenter","touchleave"];if(!(-1!==r.indexOf(e)&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||"Stage"===this.nodeType&&!n))){this._fire(e,t);let i=-1!==r.indexOf(e)&&n&&n.isAncestorOf&&n.isAncestorOf(this)&&!n.isAncestorOf(this.parent);(t&&!t.cancelBubble||!t)&&this.parent&&this.parent.isListening()&&!i&&(n&&n.parent?this._fireAndBubble.call(this.parent,e,t,n):this._fireAndBubble.call(this.parent,e,t))}}_getProtoListeners(e){var t,n;let{nodeType:r}=this,i=x.protoListenerMap.get(r)||{},a=null==i?void 0:i[e];if(void 0===a){a=[];let o=Object.getPrototypeOf(this);for(;o;){let r=null!==(n=null===(t=o.eventListeners)||void 0===t?void 0:t[e])&&void 0!==n?n:[];a.push(...r),o=Object.getPrototypeOf(o)}i[e]=a,x.protoListenerMap.set(r,i)}return a}_fire(e,t){(t=t||{}).currentTarget=this,t.type=e;let n=this._getProtoListeners(e);if(n)for(let e=0;e<n.length;e++)n[e].handler.call(this,t);let r=this.eventListeners[e];if(r)for(let e=0;e<r.length;e++)r[e].handler.call(this,t)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){let t=e?e.pointerId:void 0,n=this.getStage(),r=this.getAbsolutePosition();if(!n)return;let i=n._getPointerById(t)||n._changedPointerPositions[0]||r;a.DD._dragElements.set(this._id,{node:this,startPointerPos:i,offset:{x:i.x-r.x,y:i.y-r.y},dragStatus:"ready",pointerId:t,startEvent:e})}startDrag(e,t=!0){a.DD._dragElements.has(this._id)||this._createDragElement(e);let n=a.DD._dragElements.get(this._id);n.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:n.startEvent&&n.startEvent.evt||e&&e.evt},t)}_setDragPosition(e,t){let n=this.getStage()._getPointerById(t.pointerId);if(!n)return;let r={x:n.x-t.offset.x,y:n.y-t.offset.y},i=this.dragBoundFunc();if(void 0!==i){let t=i.call(this,r,e);t?r=t:s.Z.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}this._lastPos&&this._lastPos.x===r.x&&this._lastPos.y===r.y||(this.setAbsolutePosition(r),this._requestDraw()),this._lastPos=r}stopDrag(e){let t=a.DD._dragElements.get(this._id);t&&(t.dragStatus="stopped"),a.DD._endDragBefore(e),a.DD._endDragAfter(e)}setDraggable(e){this._setAttr("draggable",e),this._dragChange()}isDragging(){let e=a.DD._dragElements.get(this._id);return!!e&&"dragging"===e.dragStatus}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(e){if(!(!(void 0!==e.evt.button)||l.So.dragButtons.indexOf(e.evt.button)>=0)||this.isDragging())return;let t=!1;a.DD._dragElements.forEach(e=>{this.isAncestorOf(e.node)&&(t=!0)}),t||this._createDragElement(e)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;let e=a.DD._dragElements.get(this._id),t=e&&"dragging"===e.dragStatus,n=e&&"ready"===e.dragStatus;
12t?this.stopDrag():n&&a.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){let t=this.getStage();if(!t)return!1;let n={x:-e.x,y:-e.y,width:t.width()+2*e.x,height:t.height()+2*e.y};return s.Z.haveIntersection(n,this.getClientRect())}static create(e,t){return s.Z._isString(e)&&(e=JSON.parse(e)),this._createNode(e,t)}static _createNode(e,t){let n=x.prototype.getClassName.call(e),r=e.children,i,a,o;if(t&&(e.attrs.container=t),l.So[n]||(s.Z.warn('Can not find a node with class name "'+n+'". Fallback to "Shape".'),n="Shape"),i=new l.So[n](e.attrs),r)for(o=0,a=r.length;o<a;o++)i.add(x._createNode(r[o]));return i}}x.protoListenerMap=new Map,x.prototype.nodeType="Node",x.prototype._attrsAffectingSize=[],x.prototype.eventListeners={},x.prototype.on("xChange.konva yChange.konva scaleXChange.konva scaleYChange.konva skewXChange.konva skewYChange.konva rotationChange.konva offsetXChange.konva offsetYChange.konva transformsEnabledChange.konva",function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(b),this._clearSelfAndDescendantCache(h)}),x.prototype.on("visibleChange.konva",function(){this._clearSelfAndDescendantCache(y)}),x.prototype.on("listeningChange.konva",function(){this._clearSelfAndDescendantCache(m)}),x.prototype.on("opacityChange.konva",function(){this._clearSelfAndDescendantCache(u)});let C=o.F.addGetterSetter;C(x,"zIndex"),C(x,"absolutePosition"),C(x,"position"),C(x,"x",0,(0,c.Kg)()),C(x,"y",0,(0,c.Kg)()),C(x,"globalCompositeOperation","source-over",(0,c.sY)()),C(x,"opacity",1,(0,c.Kg)()),C(x,"name","",(0,c.sY)()),C(x,"id","",(0,c.sY)()),C(x,"rotation",0,(0,c.Kg)()),o.F.addComponentsGetterSetter(x,"scale",["x","y"]),C(x,"scaleX",1,(0,c.Kg)()),C(x,"scaleY",1,(0,c.Kg)()),o.F.addComponentsGetterSetter(x,"skew",["x","y"]),C(x,"skewX",0,(0,c.Kg)()),C(x,"skewY",0,(0,c.Kg)()),o.F.addComponentsGetterSetter(x,"offset",["x","y"]),C(x,"offsetX",0,(0,c.Kg)()),C(x,"offsetY",0,(0,c.Kg)()),C(x,"dragDistance",void 0,(0,c.Kg)()),C(x,"width",0,(0,c.Kg)()),C(x,"height",0,(0,c.Kg)()),C(x,"listening",!0,(0,c.I0)()),C(x,"preventDefault",!0,(0,c.I0)()),C(x,"filters",void 0,function(e){return this._filterUpToDate=!1,e}),C(x,"visible",!0,(0,c.I0)()),C(x,"transformsEnabled","all",(0,c.sY)()),C(x,"size"),C(x,"dragBoundFunc"),C(x,"draggable",!1,(0,c.I0)()),o.F.backCompat(x,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"})},24253:function(e,t,n){"use strict";n.d(t,{I5:function(){return c},Xg:function(){return u},q0:function(){return s},rl:function(){return o},yM:function(){return l}});var r=n(33118);let i=new Map,a=void 0!==r.So._global.PointerEvent;function o(e){return i.get(e)}function l(e){return{evt:e,pointerId:e.pointerId}}function s(e,t){return i.get(e)===t}function c(e,t){u(e),t.getStage()&&(i.set(e,t),a&&t._fire("gotpointercapture",l(new PointerEvent("gotpointercapture"))))}function u(e,t){let n=i.get(e);if(!n)return;let r=n.getStage();r&&r.content,i.delete(e),a&&n._fire("lostpointercapture",l(new PointerEvent("lostpointercapture")))}},34628:function(e,t,n){"use strict";let r;n.d(t,{J:function(){return g},b:function(){return v}});var i=n(33118),a=n(86587),o=n(71971),l=n(16006),s=n(27177),c=n(24253);let u="hasShadow",d="shadowRGBA",h="patternImage",f="linearGradient",p="radialGradient";function m(){return r||(r=a.Z.createCanvasElement().getContext("2d"))}let g={};class v extends l.N{constructor(e){let t;super(e);let n=0;for(;!(t=a.Z.getHitColor())||(t in g);)if(++n>=1e4){a.Z.warn("Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it."),t=a.Z.getRandomColor();break}this.colorKey=t,g[t]=this}getContext(){return a.Z.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return a.Z.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(u,this._hasShadow)}
12_hasShadow(){return this.shadowEnabled()&&0!==this.shadowOpacity()&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(h,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){let e=m().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(e&&e.setTransform){let t=new a.w;t.translate(this.fillPatternX(),this.fillPatternY()),t.rotate(i.So.getAngle(this.fillPatternRotation())),t.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),t.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());let n=t.getMatrix(),r="undefined"==typeof DOMMatrix?{a:n[0],b:n[1],c:n[2],d:n[3],e:n[4],f:n[5]}:new DOMMatrix(n);e.setTransform(r)}return e}}_getLinearGradient(){return this._getCache(f,this.__getLinearGradient)}__getLinearGradient(){let e=this.fillLinearGradientColorStops();if(e){let t=m(),n=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),i=t.createLinearGradient(n.x,n.y,r.x,r.y);for(let t=0;t<e.length;t+=2)i.addColorStop(e[t],e[t+1]);return i}}_getRadialGradient(){return this._getCache(p,this.__getRadialGradient)}__getRadialGradient(){let e=this.fillRadialGradientColorStops();if(e){let t=m(),n=this.fillRadialGradientStartPoint(),r=this.fillRadialGradientEndPoint(),i=t.createRadialGradient(n.x,n.y,this.fillRadialGradientStartRadius(),r.x,r.y,this.fillRadialGradientEndRadius());for(let t=0;t<e.length;t+=2)i.addColorStop(e[t],e[t+1]);return i}}getShadowRGBA(){return this._getCache(d,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;let e=a.Z.colorToRGBA(this.shadowColor());if(e)return"rgba("+e.r+","+e.g+","+e.b+","+e.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){let e=this.hitStrokeWidth();return"auto"===e?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){let t=this.getStage();if(!t)return!1;let n=t.bufferHitCanvas;return n.getContext().clear(),this.drawHit(n,void 0,!0),n.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return l.N.prototype.destroy.call(this),delete g[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var t;if(!(null===(t=this.attrs.perfectDrawEnabled)||void 0===t||t))return!1;let n=e||this.hasFill(),r=this.hasStroke(),i=1!==this.getAbsoluteOpacity();if(n&&r&&i)return!0;let a=this.hasShadow(),o=this.shadowForStrokeEnabled();return!!n&&!!r&&!!a&&!!o}setStrokeHitEnabled(e){a.Z.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return 0!==this.hitStrokeWidth()}getSelfRect(){let e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){let t=!1,n=this.getParent();for(;n;){if(n.isCached()){t=!0;break}n=n.getParent()}let r=e.skipTransform,i=e.relativeTo||t&&this.getStage()||void 0,a=this.getSelfRect(),o=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,l=a.width+o,s=a.height+o,c=!e.skipShadow&&this.hasShadow(),u=c?this.shadowOffsetX():0,d=c?this.shadowOffsetY():0,h=c&&this.shadowBlur()||0,f={width:l+Math.abs(u)+2*h,height:s+Math.abs(d)+2*h,x:-(o/2+h)+Math.min(u,0)+a.x,y:-(o/2+h)+Math.min(d,0)+a.y};
12return r?f:this._transformedRect(f,i)}drawScene(e,t,n){let r;let i=this.getLayer(),a=(e||i.getCanvas()).getContext(),o=this._getCanvasCache(),l=this.getSceneFunc(),s=this.hasShadow(),c=t===this;if(!this.isVisible()&&!c)return this;if(o){a.save();let e=this.getAbsoluteTransform(t).getMatrix();return a.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedSceneCanvas(a),a.restore(),this}if(!l)return this;if(a.save(),this._useBufferCanvas()){r=this.getStage();let e=n||r.bufferCanvas,i=e.getContext();n?(i.save(),i.setTransform(1,0,0,1,0,0),i.clearRect(0,0,e.width,e.height),i.restore()):i.clear(),i.save(),i._applyLineJoin(this),i._applyMiterLimit(this);let o=this.getAbsoluteTransform(t).getMatrix();i.transform(o[0],o[1],o[2],o[3],o[4],o[5]),l.call(this,i,this),i.restore();let u=e.pixelRatio;s&&a._applyShadow(this),c||(a._applyOpacity(this),a._applyGlobalCompositeOperation(this)),a.drawImage(e._canvas,e.x||0,e.y||0,e.width/u,e.height/u)}else{if(a._applyLineJoin(this),a._applyMiterLimit(this),!c){let e=this.getAbsoluteTransform(t).getMatrix();a.transform(e[0],e[1],e[2],e[3],e[4],e[5]),a._applyOpacity(this),a._applyGlobalCompositeOperation(this)}s&&a._applyShadow(this),l.call(this,a,this)}
12return a.restore(),this}drawHit(e,t,n=!1){if(!this.shouldDrawHit(t,n))return this;let r=this.getLayer(),i=e||r.hitCanvas,o=i&&i.getContext(),l=this.hitFunc()||this.sceneFunc(),s=this._getCanvasCache(),c=s&&s.hit;if(this.colorKey||a.Z.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),c){o.save();let e=this.getAbsoluteTransform(t).getMatrix();return o.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedHitCanvas(o),o.restore(),this}if(!l)return this;if(o.save(),o._applyLineJoin(this),o._applyMiterLimit(this),this!==t){let e=this.getAbsoluteTransform(t).getMatrix();o.transform(e[0],e[1],e[2],e[3],e[4],e[5])}return l.call(this,o,this),o.restore(),this}drawHitFromCache(e=0){let t=this._getCanvasCache(),n=this._getCachedSceneCanvas(),r=t.hit,i=r.getContext(),o=r.getWidth(),l=r.getHeight();i.clear(),i.drawImage(n._canvas,0,0,o,l);try{let t=i.getImageData(0,0,o,l),n=t.data,r=n.length,s=a.Z._hexToRgb(this.colorKey);for(let t=0;t<r;t+=4)n[t+3]>e?(n[t]=s.r,n[t+1]=s.g,n[t+2]=s.b,n[t+3]=255):n[t+3]=0;i.putImageData(t,0,0)}catch(e){a.Z.error("Unable to draw hit graph from cached scene canvas. "+e.message)}return this}hasPointerCapture(e){return c.q0(e,this)}setPointerCapture(e){c.I5(e,this)}releaseCapture(e){c.Xg(e,this)}}v.prototype._fillFunc=function(e){let t=this.attrs.fillRule;t?e.fill(t):e.fill()},v.prototype._strokeFunc=function(e){e.stroke()},v.prototype._fillFuncHit=function(e){let t=this.attrs.fillRule;t?e.fill(t):e.fill()},v.prototype._strokeFuncHit=function(e){e.stroke()},v.prototype._centroid=!1,v.prototype.nodeType="Shape",(0,i.DA)(v),v.prototype.eventListeners={},v.prototype.on("shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",function(){this._clearCache(u)}),v.prototype.on("shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",function(){this._clearCache(d)}),v.prototype.on("fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",function(){this._clearCache(h)}),v.prototype.on("fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",function(){this._clearCache(f)}),v.prototype.on("fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",function(){this._clearCache(p)}),o.F.addGetterSetter(v,"stroke",void 0,(0,s.if)()),o.F.addGetterSetter(v,"strokeWidth",2,(0,s.Kg)()),o.F.addGetterSetter(v,"fillAfterStrokeEnabled",!1),o.F.addGetterSetter(v,"hitStrokeWidth","auto",(0,s.hi)()),o.F.addGetterSetter(v,"strokeHitEnabled",!0,(0,s.I0)()),o.F.addGetterSetter(v,"perfectDrawEnabled",!0,(0,s.I0)()),o.F.addGetterSetter(v,"shadowForStrokeEnabled",!0,(0,s.I0)()),o.F.addGetterSetter(v,"lineJoin"),o.F.addGetterSetter(v,"lineCap"),o.F.addGetterSetter(v,"miterLimit"),o.F.addGetterSetter(v,"sceneFunc"),o.F.addGetterSetter(v,"hitFunc"),o.F.addGetterSetter(v,"dash"),o.F.addGetterSetter(v,"dashOffset",0,(0,s.Kg)()),o.F.addGetterSetter(v,"shadowColor",void 0,(0,s.sY)()),o.F.addGetterSetter(v,"shadowBlur",0,(0,s.Kg)()),o.F.addGetterSetter(v,"shadowOpacity",1,(0,s.Kg)()),o.F.addComponentsGetterSetter(v,"shadowOffset",["x","y"]),o.F.addGetterSetter(v,"shadowOffsetX",0,(0,s.Kg)()),o.F.addGetterSetter(v,"shadowOffsetY",0,(0,s.Kg)()),o.F.addGetterSetter(v,"fillPatternImage"),o.F.addGetterSetter(v,"fill",void 0,(0,s.if)()),o.F.addGetterSetter(v,"fillPatternX",0,(0,s.Kg)()),o.F.addGetterSetter(v,"fillPatternY",0,(0,s.Kg)()),o.F.addGetterSetter(v,"fillLinearGradientColorStops"),o.F.addGetterSetter(v,"strokeLinearGradientColorStops"),o.F.addGetterSetter(v,"fillRadialGradientStartRadius",0),o.F.addGetterSetter(v,"fillRadialGradientEndRadius",0),o.F.addGetterSetter(v,"fillRadialGradientColorStops"),o.F.addGetterSetter(v,"fillPatternRepeat","repeat"),o.F.addGetterSetter(v,"fillEnabled",!0),o.F.addGetterSetter(v,"strokeEnabled",!0),o.F.addGetterSetter(v,"shadowEnabled",!0),o.F.addGetterSetter(v,"dashEnabled",!0),o.F.addGetterSetter(v,"strokeScaleEnabled",!0),o.F.addGetterSetter(v,"fillPriority","color"),o.F.addComponentsGetterSetter(v,"fillPatternOffset",["x","y"]),o.F.addGetterSetter(v,"fillPatternOffsetX",0,(0,s.Kg)()),o.F.addGetterSetter(v,"fillPatternOffsetY",0,(0,s.Kg)()),o.F.addComponentsGetterSetter(v,"fillPatternScale",["x","y"]),o.F.addGetterSetter(v,"fillPatternScaleX",1,(0,s.Kg)()),o.F.addGetterSetter(v,"fillPatternScaleY",1,(0,s.Kg)()),o.F.addComponentsGetterSetter(v,"fillLinearGradientStartPoint",["x","y"]),o.F.addComponentsGetterSetter(v,"strokeLinearGradientStartPoint",["x","y"]),o.F.addGetterSetter(v,"fillLinearGradientStartPointX",0),o.F.addGetterSetter(v,"strokeLinearGradientStartPointX",0),o.F.addGetterSetter(v,"fillLinearGradientStartPointY",0),o.F.addGetterSetter(v,"strokeLinearGradientStartPointY",0),o.F.addComponentsGetterSetter(v,"fillLinearGradientEndPoint",["x","y"]),o.F.addComponentsGetterSetter(v,"strokeLinearGradientEndPoint",["x","y"]),o.F.addGetterSetter(v,"fillLinearGradientEndPointX",0),o.F.addGetterSetter(v,"strokeLinearGradientEndPointX",0),o.F.addGetterSetter(v,"fillLinearGradientEndPointY",0),o.F.addGetterSetter(v,"strokeLinearGradientEndPointY",0),o.F.addComponentsGetterSetter(v,"fillRadialGradientStartPoint",["x","y"]),o.F.addGetterSetter(v,"fillRadialGradientStartPointX",0),o.F.addGetterSetter(v,"fillRadialGradientStartPointY",0),o.F.addComponentsGetterSetter(v,"fillRadialGradientEndPoint",["x","y"]),o.F.addGetterSetter(v,"fillRadialGradientEndPointX",0),o.F.addGetterSetter(v,"fillRadialGradientEndPointY",0),o.F.addGetterSetter(v,"fillPatternRotation",0),o.F.addGetterSetter(v,"fillRule",void 0,(0,s.sY)()),o.F.backCompat(v,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})},86587:function(e,t,n){"use strict";n.d(t,{Z:function(){return m},w:function(){return o}});var r=n(33118);let i=`Konva.js unsupported environment. 13 14Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined. 15 16To use Konva.js in Node.js environment, you need to use the "canvas-backend" or "skia-backend" module. 17 18bash: npm install canvas 19js: import "konva/canvas-backend"; 20 21or 22 23bash: npm install skia-canvas 24js: import "konva/skia-backend"; 25`,a=()=>
25{if("undefined"==typeof document)throw Error(i)};class o{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new o(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){let t=this.m;return{x:t[0]*e.x+t[2]*e.y+t[4],y:t[1]*e.x+t[3]*e.y+t[5]}}translate(e,t){return this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t,this}scale(e,t){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),r=this.m[0]*t+this.m[2]*n,i=this.m[1]*t+this.m[3]*n,a=-(this.m[0]*n)+this.m[2]*t,o=-(this.m[1]*n)+this.m[3]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=a,this.m[3]=o,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,t){let n=this.m[0]+this.m[2]*t,r=this.m[1]+this.m[3]*t,i=this.m[2]+this.m[0]*e,a=this.m[3]+this.m[1]*e;return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=a,this}multiply(e){let t=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],i=this.m[1]*e.m[2]+this.m[3]*e.m[3],a=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],o=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=i,this.m[4]=a,this.m[5]=o,this}invert(){let e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,n=-this.m[1]*e,r=-this.m[2]*e,i=this.m[0]*e,a=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),o=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=i,this.m[4]=a,this.m[5]=o,this}getMatrix(){return this.m}decompose(){let e=this.m[0],t=this.m[1],n=this.m[2],r=this.m[3],i=this.m[4],a=this.m[5],o=e*r-t*n,l={x:i,y:a,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!=e||0!=t){let i=Math.sqrt(e*e+t*t);l.rotation=t>0?Math.acos(e/i):-Math.acos(e/i),l.scaleX=i,l.scaleY=o/i,l.skewX=(e*n+t*r)/o,l.skewY=0}else if(0!=n||0!=r){let i=Math.sqrt(n*n+r*r);l.rotation=Math.PI/2-(r>0?Math.acos(-n/i):-Math.acos(n/i)),l.scaleX=o/i,l.scaleY=i,l.skewX=0,l.skewY=(e*n+t*r)/o}return l.rotation=m._getRotation(l.rotation),l}}let l=Math.PI/180,s=180/Math.PI,c="Konva error: ",u={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],ol
25ive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},d=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,h=[],f=null,p="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||function(e){setTimeout(e,16)},m={_isElement:e=>!!(e&&1==e.nodeType),_isFunction:e=>!!(e&&e.constructor&&e.call&&e.apply),_isPlainObject:e=>!!e&&e.constructor===Object,_isArray:e=>"[object Array]"===Object.prototype.toString.call(e),_isNumber:e=>"[object Number]"===Object.prototype.toString.call(e)&&!isNaN(e)&&isFinite(e),_isString:e=>"[object String]"===Object.prototype.toString.call(e),_isBoolean:e=>"[object Boolean]"===Object.prototype.toString.call(e),isObject:e=>e instanceof Object,isValidSelector(e){if("string"!=typeof e)return!1;let t=e[0];return"#"===t||"."===t||t===t.toUpperCase()},_sign:e=>0===e?1:e>0?1:-1,requestAnimFrame(e){h.push(e),1===h.length&&p(function(){let e=h;h=[],e.forEach(function(e){e()})})},createCanvasElement(){a();let e=document.createElement("canvas");try{e.style=e.style||{}}catch(e){}return e},createImageElement:()=>(a(),document.createElement("img")),_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){let n=m.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex:(e,t,n)=>(16777216+(e<<16)+(t<<8)+n).toString(16).slice(1),_hexToRgb(e){let t=parseInt(e=e.replace("#",""),16);return{r:t>>16&255,g:t>>8&255,b:255&t}},getRandomColor(){let e=(16777215*Math.random()<<0).toString(16);for(;e.length<6;)e="0"+e;return"#"+e},isCanvasFarblingActive(){if(null!==f)return f;if("undefined"==typeof document)return f=!1,!1;let e=this.createCanvasElement();e.width=10,e.height=10;let t=e.getContext("2d",{willReadFrequently:!0});t.clearRect(0,0,10,10),t.fillStyle="#282828",t.fillRect(0,0,10,10);let n=t.getImageData(0,0,10,10).data,r=!1;for(let e=0;e<100;e++)if(40!==n[4*e]||40!==n[4*e+1]||40!==n[4*e+2]||255!==n[4*e+3]){r=!0;break}return f=r,this.releaseCanvas(e),f},getHitColor(){let e=this.getRandomColor();return this.isCanvasFarblingActive()?this.getSnappedHexColor(e):e},getHitColorKey(e,t,n){return this.isCanvasFarblingActive()&&(e=5*Math.round(e/5),t=5*Math.round(t/5),n=5*Math.round(n/5)),"#"+this._rgbToHex(e,t,n)},getSnappedHexColor(e){let t=this._hexToRgb(e);return"#"+this._rgbToHex(5*Math.round(t.r/5),5*Math.round(t.g/5),5*Math.round(t.b/5))},getRGB(e){let t;return e in u?{r:(t=u[e])[0],g:t[1],b:t[2]}:"#"===e[0]?this._hexToRgb(e.substring(1)):"rgb("===e.substr(0,4)?{r:parseInt((t=d.exec(e.replace(/ /g,"")))[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}:{r:0,g:0,b:0}},colorToRGBA:e=>(e=e||"black",m._namedColorToRBA(e)||m._hex3ColorToRGBA(e)||m._hex4ColorToRGBA(e)||m._hex6ColorToRGBA(e)||m._hex8ColorToRGBA(e)||m._rgbColorToRGBA(e)||m._rgbaColorToRGBA(e)||m._hslColorToRGBA(e)),_namedColorToRBA(e){let t=u[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(0===e.indexOf("rgb(")){let t=(e=e.match(/rgb\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(0===e.indexOf("rgba(")){let t=(e=e.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map((e,t)=>"%"===e.slice(-1)?3===t?parseInt(e)/100:parseInt(e)/100*255:Number(e));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex8ColorToRGBA(e){if("#"===e[0]&&9===e.length)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:parseInt(e.slice(7,9),16)/255}},_hex6ColorToRGBA(e){if("#"===e[0]&&7===e.length)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex4ColorToRGBA(e){if("#"===e[0]&&5===e.length)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:parseInt(e[4]+e[4],16)/255}},_hex3ColorToRGBA(e){if("#"===e[0]&&4===e.length)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){let t,n,r;let[i,...a]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),o=Number(a[0])/360,l=Number(a[1])/100,s=Number(a[2])/100;if(0===l)return{r:Math.round(r=255*s),g:Math.round(r),b:Math.round(r),a:1};t=s<.5?s*(1+l):s+l-s*l;let c=2*s-t,u=[0,0,0];for(let e=0;e<3;e++)(n=o+-(1/3*(e-1)))<0&&n++,n>1&&n--,r=6*n<1?c+(t-c)*6*n:2*n<1?t:3*n<2?c+(t-c)*(2/3-n)*6:c,u[e]=255*r;return{r:Math.round(u[0]),g:Math.round(u[1]),b:Math.round(u[2]),a:1}}},haveIntersection:(e,t)=>!(t.x>e.x+e.width||t.x+t.width<e.x||t.y>e.y+e.height||t.y+t.height<e.y),cloneObject(e){let t={};for(let n in e)this._isPlainObject(e[n])?t[n]=this.cloneObject(e[n]):this._isArray(e[n])?t[n]=this.cloneArray(e[n]):t[n]=e[n];return t},cloneArray:e=>e.slice(0),degToRad:e=>e*l,radToDeg:e=>e*s,_degToRad:e=>(m.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),m.degToRad(e)),_radToDeg:e=>(m.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),m.radToDeg(e)),_getRotation:e=>r.So.angleDeg?m.radToDeg(e):e,_capitalize:e=>e.charAt(0).toUpperCase()+e.slice(1),throw(e){throw Error(c+e)},error(e){console.error(c+e)},warn(e){r.So.showWarnings&&console.warn("Konva warning: "+e)},each(e,t){for(let n in e)t(n,e[n])}
25,_inRange:(e,t,n)=>t<=e&&e<n,_getProjectionToSegment(e,t,n,r,i,a){let o,l,s;let c=(e-n)*(e-n)+(t-r)*(t-r);if(0==c)o=e,l=t,s=(i-n)*(i-n)+(a-r)*(a-r);else{let u=((i-e)*(n-e)+(a-t)*(r-t))/c;u<0?(o=e,l=t,s=(e-i)*(e-i)+(t-a)*(t-a)):u>1?(o=n,l=r,s=(n-i)*(n-i)+(r-a)*(r-a)):s=((o=e+u*(n-e))-i)*(o-i)+((l=t+u*(r-t))-a)*(l-a)}return[o,l,s]},_getProjectionToLine(e,t,n){let r=m.cloneObject(e),i=Number.MAX_VALUE;return t.forEach(function(a,o){if(!n&&o===t.length-1)return;let l=t[(o+1)%t.length],s=m._getProjectionToSegment(a.x,a.y,l.x,l.y,e.x,e.y),c=s[0],u=s[1],d=s[2];d<i&&(r.x=c,r.y=u,i=d)}),r},_prepareArrayForTween(e,t,n){let r=[],i=[];if(e.length>t.length){let n=t;t=e,e=n}for(let t=0;t<e.length;t+=2)r.push({x:e[t],y:e[t+1]});for(let e=0;e<t.length;e+=2)i.push({x:t[e],y:t[e+1]});let a=[];return i.forEach(function(e){let t=m._getProjectionToLine(e,r,n);a.push(t.x),a.push(t.y)}),a},_prepareToStringify(e){let t;for(let n in e.visitedByCircularReferenceRemoval=!0,e)if(e.hasOwnProperty(n)&&e[n]&&"object"==typeof e[n]){if(t=Object.getOwnPropertyDescriptor(e,n),e[n].visitedByCircularReferenceRemoval||m._isElement(e[n])){if(!t.configurable)return null;delete e[n]}else if(null===m._prepareToStringify(e[n])){if(!t.configurable)return null;delete e[n]}}return delete e.visitedByCircularReferenceRemoval,e},_assign(e,t){for(let n in t)e[n]=t[n];return e},_getFirstPointerId:e=>e.touches?e.changedTouches[0].identifier:e.pointerId||999,releaseCanvas(...e){r.So.releaseCanvasOnDestroy&&e.forEach(e=>{e.width=0,e.height=0})},drawRoundedRectPath(e,t,n,r){let i=t<0?t:0,a=n<0?n:0;t=Math.abs(t),n=Math.abs(n);let o=0,l=0,s=0,c=0;"number"==typeof r?o=l=s=c=Math.min(r,t/2,n/2):(o=Math.min(r[0]||0,t/2,n/2),l=Math.min(r[1]||0,t/2,n/2),c=Math.min(r[2]||0,t/2,n/2),s=Math.min(r[3]||0,t/2,n/2)),e.moveTo(i+o,a),e.lineTo(i+t-l,a),e.arc(i+t-l,a+l,l,3*Math.PI/2,0,!1),e.lineTo(i+t,a+n-c),e.arc(i+t-c,a+n-c,c,0,Math.PI/2,!1),e.lineTo(i+s,a+n),e.arc(i+s,a+n-s,s,Math.PI/2,Math.PI,!1),e.lineTo(i,a+o),e.arc(i+o,a+o,o,Math.PI,3*Math.PI/2,!1)},drawRoundedPolygonPath(e,t,n,r,i){r=Math.abs(r);for(let a=0;a<n;a++){let o;let l=t[(a-1+n)%n],s=t[a],c=t[(a+1)%n],u={x:s.x-l.x,y:s.y-l.y},d={x:c.x-s.x,y:c.y-s.y},h=Math.hypot(u.x,u.y),f=Math.hypot(d.x,d.y);o="number"==typeof i?i:a<i.length?i[a]:0,o=r*Math.cos(Math.PI/n)*M
25ath.min(1,o/r*2);let p={x:u.x/h,y:u.y/h},m={x:d.x/f,y:d.y/f},g={x:s.x-p.x*o,y:s.y-p.y*o},v={x:s.x+m.x*o,y:s.y+m.y*o};0===a?e.moveTo(g.x,g.y):e.lineTo(g.x,g.y),e.arcTo(s.x,s.y,v.x,v.y,o)}}}},27177:function(e,t,n){"use strict";n.d(t,{I0:function(){return f},Jj:function(){return s},Kg:function(){return l},hi:function(){return c},if:function(){return d},q8:function(){return h},sY:function(){return u},uZ:function(){return p},xj:function(){return o}});var r=n(33118),i=n(86587);function a(e){return i.Z._isString(e)?'"'+e+'"':"[object Number]"===Object.prototype.toString.call(e)||i.Z._isBoolean(e)?e:Object.prototype.toString.call(e)}function o(e){return e>255?255:e<0?0:Math.round(e)}function l(){if(r.So.isUnminified)return function(e,t){return i.Z._isNumber(e)||i.Z.warn(a(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function s(e){if(r.So.isUnminified)return function(t,n){let r=i.Z._isNumber(t),o=i.Z._isArray(t)&&t.length==e;return r||o||i.Z.warn(a(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+e+")"),t}}function c(){if(r.So.isUnminified)return function(e,t){let n=i.Z._isNumber(e),r="auto"===e;
25return n||r||i.Z.warn(a(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function u(){if(r.So.isUnminified)return function(e,t){return i.Z._isString(e)||i.Z.warn(a(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function d(){if(r.So.isUnminified)return function(e,t){let n=i.Z._isString(e),r="[object CanvasGradient]"===Object.prototype.toString.call(e)||e&&e.addColorStop;return n||r||i.Z.warn(a(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function h(){if(r.So.isUnminified)return function(e,t){let n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(i.Z._isArray(e)?e.forEach(function(e){i.Z._isNumber(e)||i.Z.warn('"'+t+'" attribute has non numeric element '+e+". Make sure that all elements are numbers.")}):i.Z.warn(a(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function f(){if(r.So.isUnminified)return function(e,t){return!0===e||!1===e||i.Z.warn(a(e)+' is a not val
25id value for "'+t+'" attribute. The value should be a boolean.'),e}}function p(e){if(r.So.isUnminified)return function(t,n){return null==t||i.Z.isObject(t)||i.Z.warn(a(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}},53713:function(e,t,n){"use strict";n.d(t,{S:function(){return Q}});var r=n(33118),i=n(86587),a=n(16006),o=n(28837),l=n(71971),s=n(21952),c=n(26867),u=n(24253);let d="mouseleave",h="mouseover",f="mouseenter",p="mousemove",m="mousedown",g="mouseup",v="pointermove",b="pointerdown",y="pointerup",w="pointercancel",x="pointerout",C="pointerleave",E="pointerover",k="pointerenter",S="contextmenu",T="touchstart",P="touchend",M="touchmove",R="touchcancel",A="wheel",L=[[f,"_pointerenter"],[m,"_pointerdown"],[p,"_pointermove"],[g,"_pointerup"],[d,"_pointerleave"],[T,"_pointerdown"],[M,"_pointermove"],[P,"_pointerup"],[R,"_pointercancel"],[h,"_pointerover"],[A,"_wheel"],[S,"_contextmenu"],[b,"_pointerdown"],[v,"_pointermove"],[y,"_pointerup"],[w,"_pointercancel"],[C,"_pointerleave"],["lostpointercapture","_lostpointercapture"]],_={mouse:{[x]:"mouseout",[C]:d,[E]:h,[k]:f,[v]:p,[b]:m,[y]:g,[w]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[x]:"touchout",[C]:"touchleave",[E]:"touchover",[k]:"touchenter",[v]:M,[b]:T,[y]:P,[w]:R,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[x]:x,[C]:C,[E]:E,[k]:k,[v]:v,[b]:b,[y]:y,[w]:w,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},I=e=>e.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",O=e=>{let t=I(e);return"pointer"===t?r.So.pointerEventsEnabled&&_.pointer:"touch"===t?_.touch:"mouse"===t?_.mouse:void 0};function D(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&i.Z.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}let z=[];class N extends o.W{constructor(e){super(D(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),z.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{D(this.attrs)}),this._checkVisibility()}_validateAdd(e){let t="Layer"===e.getType(),n="FastLayer"===e.getType();t||n||i.Z.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;let e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if("string"==typeof e){let t;if("."===e.charAt(0)){let t=e.slice(1);e=document.getElementsByClassName(t)[0]}else t="#"!==e.charAt(0)?e:e.slice(1),e=document.getElementById(t);if(!e)throw"Can not find container in document with id "+t}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){let e=this.children,t=e.length;for(let n=0;n<t;n++)e[n].clear();return this}clone(e){return e||(e={}),e.container="undefined"!=typeof document&&document.createElement("div"),o.W.prototype.clone.call(this,e)}destroy(){super.destroy();let e=this.content;e&&i.Z._isInDocument(e)&&this.container().removeChild(e);let t=z.indexOf(this);return t>-1&&z.splice(t,1),i.Z.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){let e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(i.Z.warn("Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);"),null)}_getPointerById(e){return this._pointerPositions.find(t=>t.id===e)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){(e={...e}).x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();let t=new s.RF({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=t.getContext()._context,r=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),r.forEach(function(t){if(!t.isVisible())return;let r=t._toKonvaCanvas(e);n.drawImage(r._canvas,e.x,e.y,r.getWidth()/r.getPixelRatio(),r.getHeight()/r.getPixelRatio())}),t}getIntersection(e){if(!e)return null;let t=this.children,n=t.length-1;for(let r=n;r>=0;r--){let n=t[r].getIntersection(e);if(n)return n}return null}_resizeDOM(){let e=this.width(),t=this.height();this.content&&(this.content.style.width=e+"px",this.content.style.height=t+"px"),this.bufferCanvas.setSize(e,t),this.bufferHitCanvas.setSize(e,t),this.children.forEac
25h(n=>{n.setSize({width:e,height:t}),n.draw()})}add(e,...t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}super.add(e);let n=this.children.length;return n>5&&i.Z.warn("The stage has "+n+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),e.setSize({width:this.width(),height:this.height()}),e.draw(),r.So.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return u.q0(e,this)}setPointerCapture(e){u.I5(e,this)}releaseCapture(e){u.Xg(e,this)}getLayers(){return this.children}_bindContentEvents(){r.So.isBrowser&&L.forEach(([e,t])=>{this.content.addEventListener(e,e=>{this[t](e)},{passive:!1})})}_pointerenter(e){this.setPointersPositions(e);let t=O(e.type);t&&this._fire(t.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);let t=O(e.type);t&&this._fire(t.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let t=this[e+"targetShape"];return t&&!t.getStage()&&(t=null),t}_pointerleave(e){let t=O(e.type),n=I(e.type);if(!t)return;this.setPointersPositions(e);let i=this._getTargetShape(n),a=!(r.So.isDragging()||r.So.isTransforming())||r.So.hitOnDragEnabled;i&&a?(i._fireAndBubble(t.pointerout,{evt:e}),i._fireAndBubble(t.pointerleave,{evt:e}),this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this[n+"targetShape"]=null):a&&(this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(t.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(e){let t=O(e.type),n=I(e.type);if(!t)return;this.setPointersPositions(e);let i=!1;this._changedPointerPositions.forEach(a=>{let o=this.getIntersection(a);if(c.DD.justDragged=!1,r.So["_"+n+"ListenClick"]=!0,!o||!o.isListening()){this[n+"ClickStartShape"]=void 0;return}r.So.capturePointerEventsEnabled&&o.setPointerCapture(a.id),this[n+"ClickStartShape"]=o,o._fireAndBubble(t.pointerdown,{evt:e,pointerId:a.id}),i=!0;let l=e.type.indexOf("touch")>=0;o.preventDefault()&&e.cancelable&&l&&e.preventDefault()}),i||this._fire(t.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(e){let t=O(e.type),n=I(e.type);if(!t)return;let i=e.type.indexOf("touch")>=0||"touch"===e.pointerType;if(r.So.isDragging()&&c.DD.node.preventDefault()&&e.cancelable&&i&&e.preventDefault(),this.setPointersPositions(e),!(!(r.So.isDragging()||r.So.isTransforming())||r.So.hitOnDragEnabled))return;let a={},o=!1,l=this._getTargetShape(n);this._changedPointerPositions.forEach(r=>{let i=u.rl(r.id)||this.getIntersection(r),s=r.id,c={evt:e,pointerId:s},d=l!==i;if(d&&l&&(l._fireAndBubble(t.pointerout,{...c},i),l._fireAndBubble(t.pointerleave,{...c},i)),i){if(a[i._id])return;a[i._id]=!0}i&&i.isListening()?(o=!0,d&&(i._fireAndBubble(t.pointerover,{...c},l),i._fireAndBubble(t.pointerenter,{...c},l),this[n+"targetShape"]=i),i._fireAndBubble(t.pointermove,{...c})):l&&(this._fire(t.pointerover,{evt:e,target:this,currentTarget:this,pointerId:s}),this[n+"targetShape"]=null)}),o||this._fire(t.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){let t=O(e.type),n=I(e.type);if(!t)return;this.setPointersPositions(e);let i=this[n+"ClickStartShape"],a=this[n+"ClickEndShape"],o={},l=!1;this._changedPointerPositions.forEach(s=>{let d=u.rl(s.id)||this.getIntersection(s);if(d){if(d.releaseCapture(s.id),o[d._id])return;o[d._id]=!0}let h=s.id,f={evt:e,pointerId:h},p=!1;r.So["_"+n+"InDblClickWindow"]?(p=!0,clearTimeout(this[n+"DblTimeout"])):c.DD.justDragged||(r.So["_"+n+"InDblClickWindow"]=!0,clearTimeout(this[n+"DblTimeout"])),this[n+"DblTimeout"]=setTimeout(function(){r.So["_"+n+"InDblClickWindow"]=!1},r.So.dblClickWindow),d&&d.isListening()?(l=!0,this[n+"ClickEndShape"]=d,d._fireAndBubble(t.pointerup,{...f}),r.So["_"+n+"ListenClick"]&&i&&i===d&&(d._fireAndBubble(t.pointerclick,{...f}),p&&a&&a===d&&d._fireAndBubble(t.pointerdblclick,{...f}))):(this[n+"ClickEndShape"]=null,l||(this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),l=!0),r.So["_"+n+"ListenClick"]&&this._fire(t.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:h}),p&&this._fire(t.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:h}))}),l||this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),r.So["_"+n+"ListenClick"]=!1,e.cancelable&&"touch"!==n&&"pointer"!==n&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);let t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(S,{evt:e}):this._fire(S,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);let t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(A,{evt:e}):this._fire(A,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);let t=u.rl(e.pointerId)||this.getIntersection(this.getPointerPosition());t&&t._fireAndBubble(y,u.yM(e)),u.Xg(e.pointerId)}_lostpointercapture(e){u.Xg(e.pointerId)}setPointersPositions(e){let t=this._getContentPosition(),n=null,r=null;void 0!==(e=e||window.event).touches?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,e=>{this._pointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})}),Array.prototype.forEach.call(e.changedTouches||e.touches,e=>{this._changedPointerPositions.push({id:e.identifier,x:(e.clientX-t.left)/t.scaleX,y:(e.clientY-t.top)/t.scaleY})})):(n=(e.clientX-t.left)/t.scaleX,r=(e.clientY-t.top)/t.scaleY,this.pointerPos={x:n,y:r},this._pointerPositions=[{x:n,y:r,id:i.Z._getFirstPointerId(e)}],this._changedPointerPositions=[{x:n,y:r,id:i.Z._getFirstPointerId(e)}])}_setPointerPosition(e){i.Z.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};let e=this.content.getBoundingClientRect();
25return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new s.RF({width:this.width(),height:this.height()}),this.bufferHitCanvas=new s.hh({pixelRatio:1,width:this.width(),height:this.height()}),!r.So.isBrowser)return;let e=this.container();if(!e)throw"Stage has no container. A container is required.";e.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),e.appendChild(this.content),this._resizeDOM()}cache(){return i.Z.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(e){e.batchDraw()}),this}}N.prototype.nodeType="Stage",(0,r.DA)(N),l.F.addGetterSetter(N,"container"),r.So.isBrowser&&document.addEventListener("visibilitychange",()=>{z.forEach(e=>{e.batchDraw()})});var F=n(27177),B=n(34628);let H=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],V=H.length;class j extends o.W{constructor(e){super(e),this.canvas=new s.RF,this.hitCanvas=new s.hh({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);let t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),e<t.children.length-1?t.content.insertBefore(this.getNativeCanvasElement(),t.children[e+1].getCanvas()._canvas):t.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){a.N.prototype.moveToTop.call(this);let e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!a.N.prototype.moveUp.call(this))return!1;let e=this.getStage();return!!e&&!!e.content&&(e.content.removeChild(this.getNativeCanvasElement()),this.index<e.children.length-1?e.content.insertBefore(this.getNativeCanvasElement(),e.children[this.index+1].getCanvas()._canvas):e.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(a.N.prototype.moveDown.call(this)){let e=this.getStage();if(e){let t=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),t[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(a.N.prototype.moveToBottom.call(this)){let e=this.getStage();if(e){let t=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),t[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){let e=this.getNativeCanvasElement();return a.N.prototype.remove.call(this),e&&e.parentNode&&i.Z._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:t}){return this.canvas.setSize(e,t),this.hitCanvas.setSize(e,t),this._setSmoothEnabled(),this}_validateAdd(e){let t=e.getType();"Group"!==t&&"Shape"!==t&&i.Z.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(e){return(e={...e}).width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=void 0!==e.x?e.x:this.x(),e.y=void 0!==e.y?e.y:this.y(),a.N.prototype._toKonvaCanvas.call(this,e)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){i.Z.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}
25getHeight(){if(this.parent)return this.parent.height()}setHeight(){i.Z.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,i.Z.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;let t=1,n=!1;for(;;){for(let r=0;r<V;r++){let i=H[r],a=this._getIntersection({x:e.x+i.x*t,y:e.y+i.y*t}),o=a.shape;if(o)return o;if(n=!!a.antialiased,!a.antialiased)break}if(!n)return null;t+=1}}_getIntersection(e){let t=this.hitCanvas.pixelRatio,n=this.hitCanvas.context.getImageData(Math.round(e.x*t),Math.round(e.y*t),1,1).data,r=n[3];if(255===r){let e=i.Z.getHitColorKey(n[0],n[1],n[2]),t=B.J[e];return t?{shape:t}:{antialiased:!0}}return r>0?{antialiased:!0}:{}}drawScene(e,t,n){let r=this.getLayer(),i=e||r&&r.getCanvas();return this._fire("beforeDraw",{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),o.W.prototype.drawScene.call(this,i,t,n),this._fire("draw",{node:this}),this}drawHit(e,t){let n=this.getLayer(),r=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),o.W.prototype.drawHit.call(this,r,t),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){i.Z.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return i.Z.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;let e=this.parent;this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return i.Z.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}j.prototype.nodeType="Layer",(0,r.DA)(j),l.F.addGetterSetter(j,"imageSmoothingEnabled",!0),l.F.addGetterSetter(j,"clearBeforeDraw",!0),l.F.addGetterSetter(j,"hitGraphEnabled",!0,(0,F.I0)());class $ extends j{constructor(e){super(e),this.listening(!1),i.Z.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}$.prototype.nodeType="FastLayer",(0,r.DA)($);var U=n(92268),W=n(76413);let G={node:1,duration:1,easing:1,onFinish:1,yoyo:1},q=["fill","stroke","shadowColor"],Z=0;class X{constructor(e,t,n,r,i,a,o){this.prop=e,this.propFunc=t,this.begin=r,this._pos=r,this.duration=a,this._change=0,this.prevPos=0,this.yoyo=o,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=n,this._change=i-this.begin,this.pause()}fire(e){let t=this[e];t&&t()}setTime(e){e>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return void 0===e&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=2,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=3,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){let e=this.getTimer()-this._startTime;2===this.state?this.setTime(e):3===this.state&&this.setTime(this.duration-e)}pause(){this.state=1,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Y{constructor(e){let t,n;let a=this,o=e.node,l=o._id,s=e.easing||K.Linear,c=!!e.yoyo;t=void 0===e.duration?.3:0===e.duration?.001:e.duration,this.node=o,this._id=Z++;let u=o.getLayer()||(o instanceof r.So.Stage?o.getLayers():null);for(n in u||i.Z.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new W.f(function(){a.tween.onEnterFrame
25()},u),this.tween=new X(n,function(e){a._tweenFunc(e)},s,0,1,1e3*t,c),this._addListeners(),Y.attrs[l]||(Y.attrs[l]={}),Y.attrs[l][this._id]||(Y.attrs[l][this._id]={}),Y.tweens[l]||(Y.tweens[l]={}),e)void 0===G[n]&&this._addAttr(n,e[n]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,t){let n,r,a,o,l;let s=this.node,c=s._id,u=Y.tweens[c][e];u&&delete Y.attrs[c][u][e];let d=s.getAttr(e);if(i.Z._isArray(t)){if(n=[],r=Math.max(t.length,d.length),"points"===e&&t.length!==d.length&&(t.length>d.length?(o=d,d=i.Z._prepareArrayForTween(d,t,s.closed())):(a=t,t=i.Z._prepareArrayForTween(t,d,s.closed()))),0===e.indexOf("fill"))for(let e=0;e<r;e++)if(e%2==0)n.push(t[e]-d[e]);else{let r=i.Z.colorToRGBA(d[e]);l=i.Z.colorToRGBA(t[e]),d[e]=r,n.push({r:l.r-r.r,g:l.g-r.g,b:l.b-r.b,a:l.a-r.a})}else for(let e=0;e<r;e++)n.push(t[e]-d[e])}else -1!==q.indexOf(e)?(d=i.Z.colorToRGBA(d),n={r:(l=i.Z.colorToRGBA(t)).r-d.r,g:l.g-d.g,b:l.b-d.b,a:l.a-d.a}):n=t-d;Y.attrs[c][this._id][e]={start:d,diff:n,end:t,trueEnd:a,trueStart:o},Y.tweens[c][e]=this._id}_tweenFunc(e){let t,n,r,a,o,l,s,c;let u=this.node,d=Y.attrs[u._id][this._id];for(t in d){if(r=(n=d[t]).start,a=n.diff,c=n.end,i.Z._isArray(r)){if(o=[],s=Math.max(r.length,c.length),0===t.indexOf("fill"))for(l=0;l<s;l++)l%2==0?o.push((r[l]||0)+a[l]*e):o.push("rgba("+Math.round(r[l].r+a[l].r*e)+","+Math.round(r[l].g+a[l].g*e)+","+Math.round(r[l].b+a[l].b*e)+","+(r[l].a+a[l].a*e)+")");else for(l=0;l<s;l++)o.push((r[l]||0)+a[l]*e)}else o=-1!==q.indexOf(t)?"rgba("+Math.round(r.r+a.r*e)+","+Math.round(r.g+a.g*e)+","+Math.round(r.b+a.b*e)+","+(r.a+a.a*e)+")":r+a*e;u.setAttr(t,o)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{let e=this.node,t=Y.attrs[e._id][this._id];t.points&&t.points.trueEnd&&e.setAttr("points",t.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{let e=this.node,t=Y.attrs[e._id][this._id];t.points&&t.points.trueStart&&e.points(t.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(e){return this.tween.seek(1e3*e),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){let e=this.node._id,t=this._id,n=Y.tweens[e];for(let t in this.pause(),this.anim&&this.anim.stop(),n)delete Y.tweens[e][t];delete Y.attrs[e][t],Y.tweens[e]&&(0===Object.keys(Y.tweens[e]).length&&delete Y.tweens[e],0===Object.keys(Y.attrs[e]).length&&delete Y.attrs[e])}}Y.attrs={},Y.tweens={},a.N.prototype.to=function(e){let t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()},new Y(e).play()};let K={BackEaseIn:(e,t,n,r)=>n*(e/=r)*e*(2.70158*e-1.70158)+t,BackEaseOut:(e,t,n,r)=>n*((e=e/r-1)*e*(2.70158*e+1.70158)+1)+t,BackEaseInOut(e,t,n,r){let i=1.70158;return(e/=r/2)<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,a){let o=0;return 0===e?t:1==(e/=r)?t+n:(a||(a=.3*r),!i||i<Math.abs(n)?(i=n,o=a/4):o=a/(2*Math.PI)*Math.asin(n/i),-(i*Math.pow(2,10*(e-=1))*Math.sin(2*Math.PI*(e*r-o)/a))+t)},ElasticEaseOut(e,t,n,r,i,a){let o=0;return 0===e?t:1==(e/=r)?t+n:(a||(a=.3*r),!i||i<Math.abs(n)?(i=n,o=a/4):o=a/(2*Math.PI)*Math.asin(n/i),i*Math.pow(2,-10*e)*Math.sin(2*Math.PI*(e*r-o)/a)+n+t)},ElasticEaseInOut(e,t,n,r,i,a){let o=0;return 0===e?t:2==(e/=r/2)?t+n:(a||(a=.3*1.5*r),!i||i<Math.abs(n)?(i=n,o=a/4):o=a/(2*Math.PI)*Math.asin(n/i),e<1)?-(i*Math.pow(2,10*(e-=1))*Math.sin(2*Math.PI*(e*r-o)/a)*.5)+t:i*Math.pow(2,-10*(e-=1))*Math.sin(2*Math.PI*(e*r-o)/a)*.5+n+t},BounceEaseOut:(e,t,n,r)=>(e/=r)<1/2.75?7.5625*e*e*n+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t,BounceEaseIn:(e,t,n,r)=>n-K.BounceEaseOut(r-e,0,n,r)+t,BounceEaseInOut:(e,t,n,r)=>e<r/2?.5*K.BounceEaseIn(2*e,0,n,r)+t:.5*K.BounceEaseOut(2*e-r,0,n,r)+.5*n+t,EaseIn:(e,t,n,r)=>n*(e/=r)*e+t,EaseOut:(e,t,n,r)=>-n*(e/=r)*(e-2)+t,EaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t,StrongEaseIn:(e,t,n,r)=>n*(e/=r)*e*e*e*e+t,StrongEaseOut:(e,t,n,r)=>n*((e=e/r-1)*e*e*e*e+1)+t,StrongEaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t,Linear:(e,t,n,r)=>n*e/r+t};var J=n(50775);let Q=i.Z._assign(r.So,{Util:i.Z,Transform:i.w,Node:a.N,Container:o.W,Stage:N,stages:z,Layer:j,FastLayer:$,Group:U.Z,DD:c.DD,Shape:B.b,shapes:B.J,Animation:W.f,Tween:Y,Easings:K,Context:J._y,Canvas:s.Xz})},8585:function(e,t,n){"use strict";let r;n.d(t,{Z:function(){return eE}});var i=n(53713),a=n(71971),o=n(34628),l=n(33118),s=n(27177);class c extends o.b{_sceneFunc(e){let t=l.So.getAngle(this.angle()),n=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,t,n),e.arc(0,0,this.innerRadius(),t,0,!n),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){let e=this.innerRadius(),t=this.outerRadius(),n=this.clockwise(),r=l.So.getAngle(n?360-this.angle():this.angle()),i=Math.cos(Math.min(r,Math.PI)),a=Math.sin(Math.min(Math.max(Math.PI,r),3*Math.PI/2)),o=Math.sin(Math.min(r,Math.PI/2)),s=i*(i>0?e:t),c=a*(a>0?e:t),u=o*(o>0?t:e);return{x:s,y:n?-1*u:c,width:1*t-s,height:u-c}}}function u(e,t,n,r,i,a,o){let l=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),s=Math.sqrt(Math.pow(i-n,2)+Math.pow(a-r,2)),c=o*l/(l+s),u=o*s/(l+s);return[n-c*(i-e),r-c*(a-t),n+u*(i-e),r+u*(a-t)]}function d(e,t){let n=e.length,r=[];for(let i=2;i<n-2;i+=2){let n=u(e[i-2],e[i-1],e[i],e[i+1],e[i+2],e[i+3],t);isNaN(n[0])||(r.push(n[0]),r.push(n[1]),r.push(e[i]),r.push(e[i+1]),r.push(n[2]),r.push(n[3]))}return r}c.prototype._centroid=!0,c.prototype.className="Arc",c.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"],(0,l.DA)(c),a.F.addGetterSetter(c,"innerRadius",0,(0,s.Kg)()),a.F.addGetterSetter(c,"outerRadius",0,(0,s.Kg)()),a.F.addGetterSetter(c,"angle",0,(0,s.Kg)()),a.F.addGetterSetter(c,"clockwise",!1,(0,s.I0)());class h extends o.b{constructor(e){super(e),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(e){let t=this.points(),n=t.length,r=this.tension(),i=this.closed(),a=this.bezier();if(!n)return;let o=0;if(e.beginPath(),e.moveTo(t[0],t[1]),0!==r&&n>4){let r=this.getTensionPoints(),a=r.length;for(o=i?0:4,i||e.quadraticCurveTo(r[0],r[1],r[2],r[3]);o<a-2;)e.bezierCurveTo(r[o++],r[o++],r[o++],r[o++],r[o++],r[o++]);i||e.quadraticCurveTo(r[a-2],r[a-1],t[n-2],t[n-1])}else if(a)for(o=2;o<n;)e.bezierCurveTo(t[o++],t[o++],t[o++],t[o++],t[o++],t[o++]);else for(o=2;o<n;o+=2)e.lineTo(t[o],t[o+1]);i?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():d(this.points(),this.tension())}_getTensionPointsClosed(){let e=this.points(),t=e.length,n=this.tension(),r=u(e[t-2],e[t-1],e[0],e[1],e[2],e[3],n),i=u(e[t-4],e[t-3],e[t-2],e[t-1],e[0],e[1],n),a=d(e,n
25);return[r[2],r[3]].concat(a).concat([i[0],i[1],e[t-2],e[t-1],i[2],i[3],r[0],r[1],e[0],e[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let e,t,n=this.points();if(n.length<4)return{x:n[0]||0,y:n[1]||0,width:0,height:0};let r=(n=0!==this.tension()?[n[0],n[1],...this._getTensionPoints(),n[n.length-2],n[n.length-1]]:this.bezier()?[n[0],n[1],...function(e){let t=[[e[0],e[2],e[4],e[6]],[e[1],e[3],e[5],e[7]]],n=[];for(let e of t){let t=-3*e[0]+9*e[1]-9*e[2]+3*e[3];if(0!==t){let r=6*e[0]-12*e[1]+6*e[2],i=r*r-4*t*(-3*e[0]+3*e[1]);if(i>=0){let e=Math.sqrt(i);n.push((-r+e)/(2*t)),n.push((-r-e)/(2*t))}}}return n.filter(e=>e>0&&e<1).flatMap(e=>t.map(t=>{let n=1-e;return n*n*n*t[0]+3*n*n*e*t[1]+3*n*e*e*t[2]+e*e*e*t[3]}))}(this.points()),n[n.length-2],n[n.length-1]]:this.points())[0],i=n[0],a=n[1],o=n[1];for(let l=0;l<n.length/2;l++)e=n[2*l],t=n[2*l+1],r=Math.min(r,e),i=Math.max(i,e),a=Math.min(a,t),o=Math.max(o,t);return{x:r,y:a,width:i-r,height:o-a}}}h.prototype.className="Line",h.prototype._attrsAffectingSize=["points","bezier","tension"],(0,l.DA)(h),a.F.addGetterSetter(h,"closed",!1),a.F.addGetterSetter(h,"bezier",!1),a.F.addGetterSetter(h,"tension",0,(0,s.Kg)()),a.F.addGetterSetter(h,"points",[],(0,s.q8)());let f=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,
25-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],p=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.122555206
2571147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],m=[[1],[1,1],[1,2,1],[1,3,3,1]],g=(e,t,n)=>{let r,i;let a=n/2;r=0;for(let n=0;n<20;n++)i=a*f[20][n]+a,r+=p[20][n]*function(e,t,n){let r=b(1,n,e),i=b(1,n,t);return Math.sqrt(r*r+i*i)}(e,t,i);return a*r},v=(e,t,n)=>{void 0===n&&(n=1);let r=e[0]-2*e[1]+e[2],i=t[0]-2*t[1]+t[2],a=2*e[1]-2*e[0],o=2*t[1]-2*t[0],l=4*(r*r+i*i);if(0===l)return n*Math.sqrt(Math.pow(e[2]-e[0],2)+Math.pow(t[2]-t[0],2));let s=4*(r*a+i*o)/(2*l),c=n+s,u=(a*a+o*o)/l-s*s,d=c*c+u>0?Math.sqrt(c*c+u):0,h=s*s+u>0?Math.sqrt(s*s+u):0;return Math.sqrt(l)/2*(c*d-s*h+(s+Math.sqrt(s*s+u)!==0?u*Math.log(Math.abs((c+d)/(s+h))):0))},b=(e,t,n)=>{let r,i;let a=n.length-1;if(0===a)return 0;if(0===e){i=0;for(let e=0;e<=a;e++)i+=m[a][e]*Math.pow(1-t,a-e)*Math.pow(t,e)*n[e];return i}r=Array(a);for(let e=0;e<a;e++)r[e]=a*(n[e+1]-n[e]);return b(e-1,t,r)},y=(e,t,n)=>{let r=1,i=e/t,a=(e-n(i))/t,o=0;for(;r>.001;){let l=Math.abs(e-n(i+a))/t;if(l<r)r=l,i+=a;else{let o=Math.abs(e-n(i-a))/t;o<r?(r=o,i-=a):a/=2}if(++o>500)break}return i};class w extends o.b{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=w.parsePathData(this.data()),this.pathLength=w.getPathLength(this.dataArray)}_sceneFunc(e){let t=this.dataArray;e.beginPath();let n=!1;for(let r=0;r<t.length;r++){let i=t[r].command,a=t[r].points;switch(i){case"L":e.lineTo(a[0],a[1]);break;case"M":e.moveTo(a[0],a[1]);break;case"C":e.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"Q":e.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case"A":let o=a[0],l=a[1],s=a[2],c=a[3],u=a[4],d=a[5],h=a[6],f=a[7],p=s>c?s:c,m=s>c?1:s/c,g=s>c?c/s:1;e.translate(o,l),e.rotate(h),e.scale(m,g),e.arc(0,0,p,u,u+d,1-f),e.scale(1/m,1/g),e.rotate(-h),e.translate(-o,-l);break;case"z":n=!0,e.closePath()}}n||this.hasFill()?e.fillStrokeShape(this):e.strokeShape(this)}getSelfRect(){let e,t,n=[];this.dataArray.forEach(function(e){if("A"===e.command){let t=e.points[4],r=e.points[5],i=e.points[4]+r,a=Math.PI/180;
25if(Math.abs(t-i)<a&&(a=Math.abs(t-i)),r<0)for(let r=t-a;r>i;r-=a){let t=w.getPointOnEllipticalArc(e.points[0],e.points[1],e.points[2],e.points[3],r,0);n.push(t.x,t.y)}else for(let r=t+a;r<i;r+=a){let t=w.getPointOnEllipticalArc(e.points[0],e.points[1],e.points[2],e.points[3],r,0);n.push(t.x,t.y)}}else if("C"===e.command)for(let t=0;t<=1;t+=.01){let r=w.getPointOnCubicBezier(t,e.start.x,e.start.y,e.points[0],e.points[1],e.points[2],e.points[3],e.points[4],e.points[5]);n.push(r.x,r.y)}else n=n.concat(e.points)});let r=n[0],i=n[0],a=n[1],o=n[1];for(let l=0;l<n.length/2;l++)e=n[2*l],t=n[2*l+1],isNaN(e)||(r=Math.min(r,e),i=Math.max(i,e)),isNaN(t)||(a=Math.min(a,t),o=Math.max(o,t));return{x:r,y:a,width:i-r,height:o-a}}getLength(){return this.pathLength}getPointAtLength(e){return w.getPointAtLengthOfDataArray(e,this.dataArray)}static getLineLength(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}static getPathLength(e){let t=0;for(let n=0;n<e.length;++n)t+=e[n].pathLength;return t}static getPointAtLengthOfDataArray(e,t){let n,r=0,i=t.length;if(!i)return null;for(;r<i&&e>t[r].pathLength;)e-=t[r].pathLength,++r;if(r===i)return{x:(n=t[r-1].points.slice(-2))[0],y:n[1]};if(e<.01)return"M"===t[r].command?{x:(n=t[r].points.slice(0,2))[0],y:n[1]}:{x:t[r].start.x,y:t[r].start.y};let a=t[r],o=a.points;switch(a.command){case"L":return w.getPointOnLine(e,a.start.x,a.start.y,o[0],o[1]);case"C":return w.getPointOnCubicBezier(y(e,w.getPathLength(t),e=>g([a.start.x,o[0],o[2],o[4]],[a.start.y,o[1],o[3],o[5]],e)),a.start.x,a.start.y,o[0],o[1],o[2],o[3],o[4],o[5]);case"Q":return w.getPointOnQuadraticBezier(y(e,w.getPathLength(t),e=>v([a.start.x,o[0],o[2]],[a.start.y,o[1],o[3]],e)),a.start.x,a.start.y,o[0],o[1],o[2],o[3]);case"A":let l=o[0],s=o[1],c=o[2],u=o[3],d=o[5],h=o[6],f=o[4];return f+=d*e/a.pathLength,w.getPointOnEllipticalArc(l,s,c,u,f,h)}return null}static getPointOnLine(e,t,n,r,i,a,o){a=null!=a?a:t,o=null!=o?o:n;let l=this.getLineLength(t,n,r,i);if(l<1e-10)return{x:t,y:n};if(r===t)return{x:a,y:o+(i>n?e:-e)};let s=(i-n)/(r-t),c=Math.sqrt(e*e/(1+s*s))*(r<t?-1:1);if(1e-10>Math.abs(o-n-s*(a-t)))return{x:a+c,y:o+s*c};let u=((a-t)*(r-t)+(o-n)*(i-n))/(l*l),d=t+u*(r-t),h=n+u*(i-n),f=this.getLineLength(a,o,d,h),p=Math.sqrt(e*e-f*f),m=Math.sqrt(p*p/(1+s*s))*(r<t?-1:1);return{x:d+m,y:h+s*m}}static getPointOnCubicBezier(e,t,n,r,i,a,o,l,s){function c(e){return 3*e*(1-e)*(1-e)}return{x:e*e*e*l+3*e*e*(1-e)*a+r*c(e)+(1-e)*(1-e)*(1-e)*t,y:e*e*e*s+3*e*e*(1-e)*o+i*c(e)+(1-e)*(1-e)*(1-e)*n}}static getPointOnQuadraticBezier(e,t,n,r,i,a,o){return{x:e*e*a+2*e*(1-e)*r+(1-e)*(1-e)*t,y:e*e*o+2*e*(1-e)*i+(1-e)*(1-e)*n}}static getPointOnEllipticalArc(e,t,n,r,i,a){let o=Math.cos(a),l=Math.sin(a),s={x:n*Math.cos(i),y:r*Math.sin(i)};return{x:e+(s.x*o-s.y*l),y:t+(s.x*l+s.y*o)}}static parsePathData(e){let t;if(!e)return[];let n=e,r=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(RegExp(" ","g"),",");for(let e=0;e<r.length;e++)n=n.replace(RegExp(r[e],"g"),"|"+r[e]);let i=n.split("|"),a=[],o=[],l=0,s=0,c=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;for(let e=1;e<i.length;e++){let n=i[e],r=n.charAt(0);for(n=n.slice(1),o.length=0;t=c.exec(n);)o.push(t[0]);let u=[],d="A"===r||"a"===r?0:-1;for(let e=0,t=o.length;e<t;e++){let t=o[e];if("00"===t){u.push(0,0),d>=0&&(d+=2)>=7&&(d-=7);continue}if(d>=0){if(3===d){if(/^[01]{2}\d+(?:\.\d+)?$/.test(t)){u.push(parseInt(t[0],10)),u.push(parseInt(t[1],10)),u.push(parseFloat(t.slice(2))),(d+=3)>=7&&(d-=7);continue}if("11"===t||"10"===t||"01"===t){u.push(parseInt(t[0],10)),u.push(parseInt(t[1],10)),(d+=2)>=7&&(d-=7);continue}if("0"===t||"1"===t){u.push(parseInt(t,10)),(d+=1)>=7&&(d-=7);continue}}else if(4===d){if(/^[01]\d+(?:\.\d+)?$/.test(t)){u.push(parseInt(t[0],10)),u.push(parseFloat(t.slice(1))),(d+=2)>=7&&(d-=7);continue}if("0"===t||"1"===t){u.push(parseInt(t,10)),(d+=1)>=7&&(d-=7);continue}}let e=parseFloat(t);isNaN(e)?u.push(0):u.push(e),(d+=1)>=7&&(d-=7)}else{let e=parseFloat(t);isNaN(e)?u.push(0):u.push(e)}}for(;u.length>0;){let e,t,n,i,o,c,d,h,f,p;if(isNaN(u[0]))break;let m="",g=[],v=l,b=s;switch(r){case"l":l+=u.shift(),s+=u.shift(),m="L",g.push(l,s);break;
25case"L":l=u.shift(),s=u.shift(),g.push(l,s);break;case"m":let y=u.shift(),w=u.shift();if(l+=y,s+=w,m="M",a.length>2&&"z"===a[a.length-1].command){for(let e=a.length-2;e>=0;e--)if("M"===a[e].command){l=a[e].points[0]+y,s=a[e].points[1]+w;break}}g.push(l,s),r="l";break;case"M":l=u.shift(),s=u.shift(),m="M",g.push(l,s),r="L";break;case"h":l+=u.shift(),m="L",g.push(l,s);break;case"H":l=u.shift(),m="L",g.push(l,s);break;case"v":s+=u.shift(),m="L",g.push(l,s);break;case"V":s=u.shift(),m="L",g.push(l,s);break;case"C":g.push(u.shift(),u.shift(),u.shift(),u.shift()),l=u.shift(),s=u.shift(),g.push(l,s);break;case"c":g.push(l+u.shift(),s+u.shift(),l+u.shift(),s+u.shift()),l+=u.shift(),s+=u.shift(),m="C",g.push(l,s);break;case"S":t=l,n=s,"C"===(e=a[a.length-1]).command&&(t=l+(l-e.points[2]),n=s+(s-e.points[3])),g.push(t,n,u.shift(),u.shift()),l=u.shift(),s=u.shift(),m="C",g.push(l,s);break;case"s":t=l,n=s,"C"===(e=a[a.length-1]).command&&(t=l+(l-e.points[2]),n=s+(s-e.points[3])),g.push(t,n,l+u.shift(),s+u.shift()),l+=u.shift(),s+=u.shift(),m="C",g.push(l,s);break;case"Q":g.push(u.shift(),u.shift()),l=u.shift(),s=u.shift(),g.push(l,s);break;case"q":g.push(l+u.shift(),s+u.shift()),l+=u.shift(),s+=u.shift(),m="Q",g.push(l,s);break;case"T":t=l,n=s,"Q"===(e=a[a.length-1]).command&&(t=l+(l-e.points[0]),n=s+(s-e.points[1])),l=u.shift(),s=u.shift(),m="Q",g.push(t,n,l,s);break;case"t":t=l,n=s,"Q"===(e=a[a.length-1]).command&&(t=l+(l-e.points[0]),n=s+(s-e.points[1])),l+=u.shift(),s+=u.shift(),m="Q",g.push(t,n,l,s);break;case"A":i=u.shift(),o=u.shift(),c=u.shift(),d=u.shift(),h=u.shift(),f=l,p=s,l=u.shift(),s=u.shift(),m="A",g=this.convertEndpointToCenterParameterization(f,p,l,s,d,h,i,o,c);break;case"a":i=u.shift(),o=u.shift(),c=u.shift(),d=u.shift(),h=u.shift(),f=l,p=s,l+=u.shift(),s+=u.shift(),m="A",g=this.convertEndpointToCenterParameterization(f,p,l,s,d,h,i,o,c)}a.push({command:m||r,points:g,start:{x:v,y:b},pathLength:this.calcLength(v,b,m||r,g)})}("z"===r||"Z"===r)&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(e,t,n,r){let i,a,o,l;switch(n){case"L":return w.getLineLength(e,t,r[0],r[1]);case"C":return g([e,r[0],r[2],r[4]],[t,r[1],r[3],r[5]],1);case"Q":return v([e,r[0],r[2]],[t,r[1],r[3]],1);case"A":i=0;let s=r[4],c=r[5],u=r[4]+c,d=Math.PI/180;if(Math.abs(s-u)<d&&(d=Math.abs(s-u)),a=w.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],s,0),c<0)for(l=s-d;l>u;l-=d)o=w.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],l,0),i+=w.getLineLength(a.x,a.y,o.x,o.y),a=o;else for(l=s+d;l<u;l+=d)o=w.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],l,0),i+=w.getLineLength(a.x,a.y,o.x,o.y),a=o;return o=w.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],u,0),i+=w.getLineLength(a.x,a.y,o.x,o.y)}return 0}static convertEndpointToCenterParameterization(e,t,n,r,i,a,o,l,s){let c=Math.PI/180*s,u=Math.cos(c)*(e-n)/2+Math.sin(c)*(t-r)/2,d=-1*Math.sin(c)*(e-n)/2+Math.cos(c)*(t-r)/2,h=u*u/(o*o)+d*d/(l*l);h>1&&(o*=Math.sqrt(h),l*=Math.sqrt(h));let f=Math.sqrt((o*o*(l*l)-o*o*(d*d)-l*l*(u*u))/(o*o*(d*d)+l*l*(u*u)));i===a&&(f*=-1),isNaN(f)&&(f=0);let p=f*o*d/l,m=-(f*l)*u/o,g=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},v=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(g(e)*g(t))},b=function(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(v(e,t))},y=b([1,0],[(u-p)/o,(d-m)/l]),w=[(u-p)/o,(d-m)/l],x=[(-1*u-p)/o,(-1*d-m)/l],C=b(w,x);return -1>=v(w,x)&&(C=Math.PI),v(w,x)>=1&&(C=0),0===a&&C>0&&(C-=2*Math.PI),1===a&&C<0&&(C+=2*Math.PI),[(e+n)/2+Math.cos(c)*p-Math.sin(c)*m,(t+r)/2+Math.sin(c)*p+Math.cos(c)*m,o,l,y,C,c,a]}}w.prototype.className="Path",w.prototype._attrsAffectingSize=["data"],(0,l.DA)(w),a.F.addGetterSetter(w,"data");class x extends h{_sceneFunc(e){let t,n;super._sceneFunc(e);let r=2*Math.PI,i=this.points(),a=i,o=0!==this.tension()&&i.length>4;o&&(a=this.getTensionPoints());let l=this.pointerLength(),s=i.length;if(o){let e=[a[a.length-4],a[a.length-3],a[a.length-2],a[a.length-1],i[s-2],i[s-1]],r=w.calcLength(a[a.length-4],a[a.length-3],"C",e),o=w.getPointOnQuadraticBezier(Math.min(1,1-l/r),e[0],e[1],e[2],e[3],e[4],e[5]);t=i[s-2]-o.x,n=i[s-1]-o.y}else t=i[s-2]-i[s-4],n=i[s-1]-i[s-3];let c=(Math.atan2(n,t)+r)%r,u=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(i[s-2],i[s-1]),e.rotate(c),e.moveTo(0,0),e.lineTo(-l,u/2),e.lineTo(-l,-u/2),e.closePath(),e.restore(
25),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(i[0],i[1]),o?(t=(a[0]+a[2])/2-i[0],n=(a[1]+a[3])/2-i[1]):(t=i[2]-i[0],n=i[3]-i[1]),e.rotate((Math.atan2(-n,-t)+r)%r),e.moveTo(0,0),e.lineTo(-l,u/2),e.lineTo(-l,-u/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){let t=this.dashEnabled();t&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),t&&(this.attrs.dashEnabled=!0)}getSelfRect(){let e=super.getSelfRect(),t=this.pointerWidth()/2;return{x:e.x,y:e.y-t,width:e.width,height:e.height+2*t}}}x.prototype.className="Arrow",(0,l.DA)(x),a.F.addGetterSetter(x,"pointerLength",10,(0,s.Kg)()),a.F.addGetterSetter(x,"pointerWidth",10,(0,s.Kg)()),a.F.addGetterSetter(x,"pointerAtBeginning",!1),a.F.addGetterSetter(x,"pointerAtEnding",!0);class C extends o.b{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,2*Math.PI,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}}C.prototype._centroid=!0,C.prototype.className="Circle",C.prototype._attrsAffectingSize=["radius"],(0,l.DA)(C),a.F.addGetterSetter(C,"radius",0,(0,s.Kg)());class E extends o.b{_sceneFunc(e){let t=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),t!==n&&e.scale(1,n/t),e.arc(0,0,t,0,2*Math.PI,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radiusX()}getHeight(){return 2*this.radiusY()}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}E.prototype.className="Ellipse",E.prototype._centroid=!0,E.prototype._attrsAffectingSize=["radiusX","radiusY"],(0,l.DA)(E),a.F.addComponentsGetterSetter(E,"radius",["x","y"]),a.F.addGetterSetter(E,"radiusX",0,(0,s.Kg)()),a.F.addGetterSetter(E,"radiusY",0,(0,s.Kg)());var k=n(86587);class S extends o.b{constructor(e){super(e),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",e=>{this._removeImageLoad(e.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){let e=this.image();e&&e.complete||e&&4===e.readyState||!e||!e.addEventListener||e.addEventListener("load",this._loadListener)}_removeImageLoad(e){e&&e.removeEventListener&&e.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){let e=!!this.cornerRadius(),t=this.hasShadow();return!!e&&!!t||super._useBufferCanvas(!0)}_sceneFunc(e){let t;let n=this.getWidth(),r=this.getHeight(),i=this.cornerRadius(),a=this.attrs.image;if(a){let e=this.attrs.cropWidth,i=this.attrs.cropHeight;t=e&&i?[a,this.cropX(),this.cropY(),e,i,0,0,n,r]:[a,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(e.beginPath(),i?k.Z.drawRoundedRectPath(e,n,r,i):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)),a&&(i&&e.clip(),e.drawImage.apply(e,t))}_hitFunc(e){let t=this.width(),n=this.height(),r=this.cornerRadius();e.beginPath(),r?k.Z.drawRoundedRectPath(e,t,n,r):e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,t,n;return null!==(n=null!==(e=this.attrs.width)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.width)&&void 0!==n?n:0}getHeight(){var e,t,n;return null!==(n=null!==(e=this.attrs.height)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.height)&&void 0!==n?n:0}static fromURL(e,t,n=null){let r=k.Z.createImageElement();r.onload=function(){t(new S({image:r}))},r.onerror=n,r.crossOrigin="Anonymous",r.src=e}}S.prototype.className="Image",S.prototype._attrsAffectingSize=["image"],(0,l.DA)(S),a.F.addGetterSetter(S,"cornerRadius",0,(0,s.Jj)(4)),a.F.addGetterSetter(S,"image"),a.F.addComponentsGetterSetter(S,"crop",["x","y","width","height"]),a.F.addGetterSetter(S,"cropX",0,(0,s.Kg)()),a.F.addGetterSetter(S,"cropY",0,(0,s.Kg)()),a.F.addGetterSetter(S,"cropWidth",0,(0,s.Kg)()),a.F.addGetterSetter(S,"cropHeight",0,(0,s.Kg)());var T=n(92268);let P=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],M="right",R="down",A="left",L=P.length;class _ extends T.Z{constructor(e){super(e),this.on("add.konva",function(e){this._addListeners(e.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){let t=this,n,r=function(){t._sync()};for(n=0;n<L;n++)e.on(P[n]+"Change.konva",r)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let e=this.getText(),t=this.getTag(),n,r,i,a,o,l,s;if(e&&t){switch(n=e.width(),r=e.height(),i=t.pointerDirection(),a=t.pointerWidth(),s=t.pointerHeight(),o=0,l=0,i){case"up":o=n/2,l=-1*s;break;case M:o=n+a,l=r/2;break;case R:o=n/2,l=r+s;break;case A:o=-1*a,l=r/2}t.setAttrs({x:-1*o,y:-1*l,width:n,height:r}),e.setAttrs({x:-1*o,y:-1*l})}}}_.prototype.className="Label",(0,l.DA)(_);class I extends o.b{_sceneFunc(e){let t=this.width(),n=this.height(),r=this.pointerDirection(),i=this.pointerWidth(),a=this.pointerHeight(),o=this.cornerRadius(),l=0,s=0,c=0,u=0;
25"number"==typeof o?l=s=c=u=Math.min(o,t/2,n/2):(l=Math.min(o[0]||0,t/2,n/2),s=Math.min(o[1]||0,t/2,n/2),u=Math.min(o[2]||0,t/2,n/2),c=Math.min(o[3]||0,t/2,n/2)),e.beginPath(),e.moveTo(l,0),"up"===r&&(e.lineTo((t-i)/2,0),e.lineTo(t/2,-1*a),e.lineTo((t+i)/2,0)),e.lineTo(t-s,0),e.arc(t-s,s,s,3*Math.PI/2,0,!1),r===M&&(e.lineTo(t,(n-a)/2),e.lineTo(t+i,n/2),e.lineTo(t,(n+a)/2)),e.lineTo(t,n-u),e.arc(t-u,n-u,u,0,Math.PI/2,!1),r===R&&(e.lineTo((t+i)/2,n),e.lineTo(t/2,n+a),e.lineTo((t-i)/2,n)),e.lineTo(c,n),e.arc(c,n-c,c,Math.PI/2,Math.PI,!1),r===A&&(e.lineTo(0,(n+a)/2),e.lineTo(-1*i,n/2),e.lineTo(0,(n-a)/2)),e.lineTo(0,l),e.arc(l,l,l,Math.PI,3*Math.PI/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){let e=0,t=0,n=this.pointerWidth(),r=this.pointerHeight(),i=this.pointerDirection(),a=this.width(),o=this.height();return"up"===i?(t-=r,o+=r):i===R?o+=r:i===A?(e-=1.5*n,a+=n):i===M&&(a+=1.5*n),{x:e,y:t,width:a,height:o}}}I.prototype.className="Tag",(0,l.DA)(I),a.F.addGetterSetter(I,"pointerDirection","none"),a.F.addGetterSetter(I,"pointerWidth",0,(0,s.Kg)()),a.F.addGetterSetter(I,"pointerHeight",0,(0,s.Kg)()),a.F.addGetterSetter(I,"cornerRadius",0,(0,s.Jj)(4));class O extends o.b{_sceneFunc(e){let t=this.cornerRadius(),n=this.width(),r=this.height();e.beginPath(),t?k.Z.drawRoundedRectPath(e,n,r,t):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}}O.prototype.className="Rect",(0,l.DA)(O),a.F.addGetterSetter(O,"cornerRadius",0,(0,s.Jj)(4));class D extends o.b{_sceneFunc(e){let t=this._getPoints(),n=this.radius(),r=this.sides(),i=this.cornerRadius();if(e.beginPath(),i)k.Z.drawRoundedPolygonPath(e,t,r,n,i);else{e.moveTo(t[0].x,t[0].y);for(let n=1;n<t.length;n++)e.lineTo(t[n].x,t[n].y)}e.closePath(),e.fillStrokeShape(this)}_getPoints(){let e=this.attrs.sides,t=this.attrs.radius||0,n=[];for(let r=0;r<e;r++)n.push({x:t*Math.sin(2*r*Math.PI/e),y:-1*t*Math.cos(2*r*Math.PI/e)});return n}getSelfRect(){let e=this._getPoints(),t=e[0].x,n=e[0].x,r=e[0].y,i=e[0].y;return e.forEach(e=>{t=Math.min(t,e.x),n=Math.max(n,e.x),r=Math.min(r,e.y),i=Math.max(i,e.y)}),{x:t,y:r,width:n-t,height:i-r}}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}D.prototype.className="RegularPolygon",D.prototype._centroid=!0,D.prototype._attrsAffectingSize=["radius"],(0,l.DA)(D),a.F.addGetterSetter(D,"radius",0,(0,s.Kg)()),a.F.addGetterSetter(D,"sides",0,(0,s.Kg)()),a.F.addGetterSetter(D,"cornerRadius",0,(0,s.Jj)(4));let z=2*Math.PI;class N extends o.b{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,z,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),z,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}N.prototype.className="Ring",N.prototype._centroid=!0,N.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,l.DA)(N),a.F.addGetterSetter(N,"innerRadius",0,(0,s.Kg)()),a.F.addGetterSetter(N,"outerRadius",0,(0,s.Kg)());var F=n(76413);class B extends o.b{constructor(e){super(e),this._updated=!0,this.anim=new F.f(()=>{let e=this._updated;return this._updated=!1,e}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){let t=this.animation(),n=this.frameIndex(),r=4*n,i=this.animations()[t],a=this.frameOffsets(),o=i[r+0],l=i[r+1],s=i[r+2],c=i[r+3],u=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,s,c),e.closePath(),e.fillStrokeShape(this)),u){if(a){let r=a[t],i=2*n;
25e.drawImage(u,o,l,s,c,r[i+0],r[i+1],s,c)}else e.drawImage(u,o,l,s,c,0,0,s,c)}}_hitFunc(e){let t=this.animation(),n=this.frameIndex(),r=4*n,i=this.animations()[t],a=this.frameOffsets(),o=i[r+2],l=i[r+3];if(e.beginPath(),a){let r=a[t],i=2*n;e.rect(r[i+0],r[i+1],o,l)}else e.rect(0,0,o,l);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){let e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;let e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){let e=this.frameIndex(),t=this.animation();e<this.animations()[t].length/4-1?this.frameIndex(e+1):this.frameIndex(0)}}B.prototype.className="Sprite",(0,l.DA)(B),a.F.addGetterSetter(B,"animation"),a.F.addGetterSetter(B,"animations"),a.F.addGetterSetter(B,"frameOffsets"),a.F.addGetterSetter(B,"image"),a.F.addGetterSetter(B,"frameIndex",0,(0,s.Kg)()),a.F.addGetterSetter(B,"frameRate",17,(0,s.Kg)()),a.F.backCompat(B,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class H extends o.b{_sceneFunc(e){let t=this.innerRadius(),n=this.outerRadius(),r=this.numPoints();e.beginPath(),e.moveTo(0,0-n);for(let i=1;i<2*r;i++){let a=i%2==0?n:t,o=a*Math.sin(i*Math.PI/r),l=-1*a*Math.cos(i*Math.PI/r);e.lineTo(o,l)}e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}function V(e){return[...e].reduce((e,t,n,r)=>{if(/\p{Emoji}/u.test(t)){let i=r[n+1];i&&/\p{Emoji_Modifier}|\u200D/u.test(i)?(e.push(t+i),r[n+1]=""):e.push(t)}else/\p{Regional_Indicator}{2}/u.test(t+(r[n+1]||""))?e.push(t+r[n+1]):n>0&&/\p{Mn}|\p{Me}|\p{Mc}/u.test(t)?e[e.length-1]+=t:t&&e.push(t);return e},[])}H.prototype.className="Star",H.prototype._centroid=!0,H.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,l.DA)(H),a.F.addGetterSetter(H,"numPoints",5,(0,s.Kg)()),a.F.addGetterSetter(H,"innerRadius",0,(0,s.Kg)()),a.F.addGetterSetter(H,"outerRadius",0,(0,s.Kg)());let j="auto",$="inherit",U="justify",W="left",G="middle",q="normal",Z="none",X=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],Y=X.length;function K(){return r||(r=k.Z.createCanvasElement().getContext("2d"))}class J extends o.b{constructor(e){var t;super(((t=(t=e)||{}).fillLinearGradientColorStops||t.fillRadialGradientColorStops||t.fillPatternImage||(t.fill=t.fill||"black"),t)),this._partialTextX=0,this._partialTextY=0;for(let e=0;e<Y;e++)this.on(X[e]+"Change.konva",this._setTextData);this._setTextData()}_sceneFunc(e){var t,n;let r=this.textArr,i=r.length;if(!this.text())return;let a=this.padding(),o=this.fontSize(),s=this.lineHeight()*o,c=this.verticalAlign(),u=this.direction(),d=0,h=this.align(),f=this.getWidth(),p=this.letterSpacing(),m=this.charRenderFunc(),g=this.fill(),v=this.textDecoration(),b=this.underlineOffset(),y=-1!==v.indexOf("underline"),w=-1!==v.indexOf("line-through"),x;u=u===$?e.direction:u;let C=s/2,E=G;if(!l.So.legacyTextRendering){let e=this.measureSize("M");E="alphabetic",C=((null!==(t=e.fontBoundingBoxAscent)&&void 0!==t?t:e.actualBoundingBoxAscent)-(null!==(n=e.fontBoundingBoxDescent)&&void 0!==n?n:e.actualBoundingBoxDescent))/2+s/2}for("rtl"===u&&e.setAttr("direction",u),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",E),e.setAttr("textAlign",W),c===G?d=(this.getHeight()-i*s-2*a)/2:"bottom"===c&&(d=this.getHeight()-i*s-2*a),e.translate(a,d+a),x=0;x<i;x++){let t=0,n=r[x],c=n.text,d=n.width,v=n.lastInParagraph;if(e.save(),"right"===h?t+=f-d-2*a:"center"===h&&(t+=(f-d-2*a)/2),y){e.save(),e.beginPath();let n=null!=b?b:l.So.legacyTextRendering?Math.round(o/2):Math.round(o/4),r=t,i=C+0+n;e.moveTo(r,i);let s=h!==U||v?d:f-2*a;e.lineTo(r+Math.round(s),i),e.lineWidth=o/15;let c=this._getLinearGradient();
25e.strokeStyle=c||g,e.stroke(),e.restore()}let E=t;if("rtl"!==u&&(0!==p||h===U||m)){let n=c.split(" ").length-1,i=V(c);for(let o=0;o<i.length;o++){let l=i[o];" "!==l||v||h!==U||(t+=(f-2*a-d)/n),this._partialTextX=t,this._partialTextY=C+0,this._partialText=l,m&&(e.save(),m({char:l,index:o+r.slice(0,x).reduce((e,t)=>e+V(t.text).length,0),x:t,y:C+0,lineIndex:x,column:o,isLastInLine:v,width:this.measureSize(l).width,context:e})),e.fillStrokeShape(this),m&&e.restore(),t+=this.measureSize(l).width+p}}else 0!==p&&e.setAttr("letterSpacing",`${p}px`),this._partialTextX=t,this._partialTextY=C+0,this._partialText=c,e.fillStrokeShape(this);if(w){e.save(),e.beginPath();let t=l.So.legacyTextRendering?0:-Math.round(o/4);e.moveTo(E,C+0+t);let n=h!==U||v?d:f-2*a;e.lineTo(E+Math.round(n),C+0+t),e.lineWidth=o/15;let r=this._getLinearGradient();e.strokeStyle=r||g,e.stroke(),e.restore()}e.restore(),i>1&&(C+=s)}}_hitFunc(e){let t=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}setText(e){let t=k.Z._isString(e)?e:null==e?"":e+"";return this._setAttr("text",t),this}getWidth(){return this.attrs.width===j||void 0===this.attrs.width?this.getTextWidth()+2*this.padding():this.attrs.width}getHeight(){return this.attrs.height===j||void 0===this.attrs.height?this.fontSize()*this.textArr.length*this.lineHeight()+2*this.padding():this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return k.Z.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var t,n,r,i,a,o,l,s,c,u,d;let h=K(),f=this.fontSize(),p;h.save(),h.font=this._getContextFont(),p=h.measureText(e),h.restore(
25);let m=f/100;return{actualBoundingBoxAscent:null!==(t=p.actualBoundingBoxAscent)&&void 0!==t?t:71.58203125*m,actualBoundingBoxDescent:null!==(n=p.actualBoundingBoxDescent)&&void 0!==n?n:0,actualBoundingBoxLeft:null!==(r=p.actualBoundingBoxLeft)&&void 0!==r?r:-7.421875*m,actualBoundingBoxRight:null!==(i=p.actualBoundingBoxRight)&&void 0!==i?i:75.732421875*m,alphabeticBaseline:null!==(a=p.alphabeticBaseline)&&void 0!==a?a:0,emHeightAscent:null!==(o=p.emHeightAscent)&&void 0!==o?o:100*m,emHeightDescent:null!==(l=p.emHeightDescent)&&void 0!==l?l:-20*m,fontBoundingBoxAscent:null!==(s=p.fontBoundingBoxAscent)&&void 0!==s?s:91*m,fontBoundingBoxDescent:null!==(c=p.fontBoundingBoxDescent)&&void 0!==c?c:21*m,hangingBaseline:null!==(u=p.hangingBaseline)&&void 0!==u?u:72.80000305175781*m,ideographicBaseline:null!==(d=p.ideographicBaseline)&&void 0!==d?d:-21*m,width:p.width,height:f}}_getContextFont(){return this.fontStyle()+" "+this.fontVariant()+" "+this.fontSize()+"px "+this.fontFamily().split(",").map(e=>{let t=(e=e.trim()).indexOf(" ")>=0,n=e.indexOf('"')>=0||e.indexOf("'")>=0;return t&&!n&&(e=`"${e}"`),e}).join(", ")}_addTextLine(e){this.align()===U&&(e=e.trim());let t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}_getTextWidth(e){let t=this.letterSpacing(),n=e.length;return K().measureText(e).width+t*n}_setTextData(){let e=this.text().split("\n"),t=+this.fontSize(),n=0,r=this.lineHeight()*t,i=this.attrs.width,a=this.attrs.height,o=i!==j&&void 0!==i,l=a!==j&&void 0!==a,s=this.padding(),c=i-2*s,u=a-2*s,d=0,h=this.wrap(),f="char"!==h&&h!==Z,p=this.ellipsis();this.textArr=[],K().font=this._getContextFont();let m=p?this._getTextWidth("â¦"):0;for(let t=0,i=e.length;t<i;++t){let a=e[t],s=this._getTextWidth(a);if(o&&s>c)for(;a.length>0;){let e=0,t=V(a).length,i="",o=0;for(;e<t;){let n=e+t>>>1,s=V(a).slice(0,n+1).join(""),h=this._getTextWidth(s);(p&&l&&d+r>u?h+m:h)<=c?(e=n+1,i=s,o=h):t=n}if(i){if(f){let t;let n=V(a),r=V(i),l=n[r.length];(t=(" "===l||"-"===l)&&o<=c?r.length:Math.max(r.lastIndexOf(" "),r.lastIndexOf("-"))+1)>0&&(e=t,i=n.slice(0,e).join(""),o=this._getTextWidth(i))}if(i=i.trimRight(),this._addTextLine(i),n=Math.max(n,o),d+=r,this._shouldHandleEllipsis(d)){this._tryToAddEllipsisToLastLine();break}if((a=V(a).slice(e).join("").trimLeft()).length>0&&(s=this._getTextWidth(a))<=c){this._addTextLine(a),d+=r,n=Math.max(n,s);break}}else break}else this._addTextLine(a),d+=r,n=Math.max(n,s),this._shouldHandleEllipsis(d)&&t<i-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),l&&d+r>u)break}this.textHeight=t,this.textWidth=n}_shouldHandleEllipsis(e){let t=+this.fontSize(),n=this.lineHeight()*t,r=this.attrs.height,i=this.padding();return!(this.wrap()!==Z)||r!==j&&void 0!==r&&e+n>r-2*i}_tryToAddEllipsisToLastLine(){let e=this.attrs.width,t=this.padding(),n=this.ellipsis(),r=this.textArr[this.textArr.length-1];r&&n&&(e===j||void 0===e||this._getTextWidth(r.text+"â¦")<e-2*t||(r.text=r.text.slice(0,r.text.length-3)),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(r.text+"â¦"))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){let e=-1!==this.textDecoration().indexOf("underline")||-1!==this.textDecoration().indexOf("line-through"),t=this.hasShadow();return!!e&&!!t||super._useBufferCanvas()}}J.prototype._fillFunc=function(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)},J.prototype._strokeFunc=function(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)},J.prototype.className="Text",J.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],(0,l.DA)(J),a.F.overWriteSetter(J,"width",(0,s.hi)()),a.F.overWriteSetter(J,"height",(0,s.hi)()),a.F.addGetterSetter(J,"direction",$),a.F.addGetterSetter(J,"fontFamily","Arial"),a.F.addGetterSetter(J,"fontSize",12,(0,s.Kg)()),a.F.addGetterSetter(J,"fontStyle",q),a.F.addGetterSetter(J,"fontVariant",q),a.F.addGetterSetter(J,"padding",0,(0,s.Kg)()),a.F.addGetterSetter(J,"align",W),a.F.addGetterSetter(J,"verticalAlign","top"),a.F.addGetterSetter(J,"lineHeight",1,(0,s.Kg)()),a.F.addGetterSetter(J,"wrap","word"),a.F.addGetterSetter(J,"ellipsis",!1,(0,s.I0)()),a.F.addGetterSetter(J,"letterSpacing",0,(0,s.Kg)()),a.F.addGetterSetter(J,"text","",(0,s.sY)()),a.F.addGetterSetter(J,"textDecoration",""),a.F.addGetterSetter(J,"underlineOffset",void 0,(0,s.Kg)()),a.F.addGetterSetter(J,"charRenderFunc",void 0);let Q="normal";function ee(e){e.fillText(this.partialText,0,0)}function et(e){e.strokeText(this.partialText,0,0)}class en extends o.b{constructor(e){super(e),this.dummyCanvas=k.Z.
25createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return w.getPathLength(this.dataArray)}_getPointAtLength(e){return!this.attrs.data||e>this.pathLength?null:w.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=w.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();let t=this.textDecoration(),n=this.fill(),r=this.fontSize(),i=this.glyphInfo,a=-1!==t.indexOf("underline"),o=-1!==t.indexOf("line-through");a&&e.beginPath();for(let t=0;t<i.length;t++){e.save();let n=i[t].p0;e.translate(n.x,n.y),e.rotate(i[t].rotation),this.partialText=i[t].text,e.fillStrokeShape(this),a&&(0===t&&e.moveTo(0,r/2+1),e.lineTo(i[t].width,r/2+1)),e.restore()}if(a&&(e.strokeStyle=n,e.lineWidth=r/20,e.stroke()),o){e.beginPath();for(let t=0;t<i.length;t++){e.save();let n=i[t].p0;e.translate(n.x,n.y),e.rotate(i[t].rotation),0===t&&e.moveTo(0,0),e.lineTo(i[t].width,0),e.restore()}e.strokeStyle=n,e.lineWidth=r/20,e.stroke()}e.restore()}_hitFunc(e){e.beginPath();let t=this.glyphInfo;if(t.length>=1){let n=t[0].p0;e.moveTo(n.x,n.y)}for(let n=0;n<t.length;n++){let r=t[n].p1;e.lineTo(r.x,r.y)}e.setAttr("lineWidth",this.fontSize()),e.setAttr("strokeStyle",this.colorKey),e.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return k.Z.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(e){return J.prototype.setText.call(this,e)}_getContextFont(){return J.prototype._getContextFont.call(this)}_getTextSize(e){let t=this.dummyCanvas.getContext("2d");t.save(),t.font=this._getContextFont();let n=t.measureText(e);return t.restore(),{width:n.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){let e=V(this.text()),t=[],n=0;for(let r=0;r<e.length;r++)t.push({char:e[r],width:this._getTextSize(e[r]).width}),n+=t[r].width;let{width:r,height:i}=this._getTextSize(this.attrs.text);if(this.textWidth=n,this.textHeight=i,this.glyphInfo=[],!this.attrs.data)return null;let a=this.letterSpacing(),o=this.align(),l=this.kerningFunc(),s=Math.max(0,n-r),c=Math.max(this.textWidth+((this.attrs.text||"").length-1)*a,0),u=0;"center"===o&&(u=Math.max(0,this.pathLength/2-c/2)),"right"===o&&(u=Math.max(0,this.pathLength-c));let d=u;for(let n=0;n<t.length;n++){let r=this._getPointAtLength(d);if(!r)return;let i=t[n].char,u=t[n].width+a;if(" "===i&&"justify"===o){let e=this.text().split(" ").length-1;u+=(this.pathLength-c)/e}let h=d+u,f=this._getPointAtLength(h>this.pathLength&&h-this.pathLength<=s?this.pathLength:h);if(!f)return;let p=w.getLineLength(r.x,r.y,f.x,f.y),m=0;if(l)try{m=l(t[n-1].char,i)*this.fontSize()}catch(e){m=0}r.x+=m,f.x+=m,this.textWidth+=m;let g=w.getPointOnLine(m+p/2,r.x,r.y,f.x,f.y),v=Math.atan2(f.y-r.y,f.x-r.x);this.glyphInfo.push({transposeX:g.x,transposeY:g.y,text:e[n],rotation:v,p0:r,p1:f,width:p}),d+=u}}getSelfRect(){let e,t;if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};let n=[];this.glyphInfo.forEach(function(e){n.push(e.p0.x),n.push(e.p0.y),n.push(e.p1.x),n.push(e.p1.y)});let r=n[0]||0,i=n[0]||0,a=n[1]||0,o=n[1]||0;for(let l=0;l<n.length/2;l++)e=n[2*l],t=n[2*l+1],r=Math.min(r,e),i=Math.max(i,e),a=Math.min(a,t),o=Math.max(o,t);let l=this.fontSize();return{x:r-l/2,y:a-l/2,width:i-r+l,height:o-a+l}}destroy(){return k.Z.releaseCanvas(this.dummyCanvas),super.destroy()}}en.prototype._fillFunc=ee,en.prototype._strokeFunc=et,en.prototype._fillFuncHit=ee,en.prototype._strokeFuncHit=et,en.prototype.className="TextPath",en.prototype._attrsAffectingSize=["text","fontSize","data"],(0,l.DA)(en),a.F.addGetterSetter(en,"data"),a.F.addGetterSetter(en,"fontFamily","Arial"),a.F.addGetterSetter(en,"fontSize",12,(0,s.Kg)()),a.F.addGetterSetter(en,"fontStyle",Q),a.F.addGetterSetter(en,"align","left"),a.F.addGetterSetter(en,"letterSpacing",0,(0,s.Kg)()),a.F.addGetterSetter(en,"textBaseline","middle"),a.F.addGetterSetter(en,"fontVariant",Q),a.F.addGetterSetter(en,"text",""),a.F.addGetterSetter(en,"textDecoration",""),a.F.addGetterSetter(en,"kerningFunc",void 0);var er=n(16006);let ei="tr-konva",ea=["resizeEnabledChange","rotateAnchorOffsetChange","rotateAnchorAngleChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${ei}`).join(" "),eo="nodesRect",el=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],es={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},ec="ontouchstart"in l.So._global,eu=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];
25function ed(e,t,n){let r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return{...e,rotation:e.rotation+t,x:r,y:i}}let eh=0;class ef extends T.Z{constructor(e){super(e),this._movingAnchorName=null,this._transforming=!1,this._elementsCreated=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(ea,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return k.Z.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return ei+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();let t=e.filter(e=>!e.isAncestorOf(this)||(k.Z.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1));return this._nodes=e=t,1===e.length&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(e=>{let t=()=>{1===this.nodes().length&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),this._transforming||this.isDragging()||this.update()};if(e._attrsAffectingSize.length){let n=e._attrsAffectingSize.map(e=>e+"Change."+this._getEventNamespace()).join(" ");e.on(n,t)}e.on(el.map(e=>e+`.${this._getEventNamespace()}`).join(" "),t),e.on(`absoluteTransformChange.${this._getEventNamespace()}`,t),this._proxyDrag(e)}),this._resetTransformCache(),this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let t;e.on(`dragstart.${this._getEventNamespace()}`,n=>{t=e.getAbsolutePosition(),this.isDragging()||e===this.findOne(".back")||this.startDrag(n,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!t)return;let r=e.getAbsolutePosition(),i=r.x-t.x,a=r.y-t.y;this.nodes().forEach(t=>{if(t===e||t.isDragging())return;let r=t.getAbsolutePosition();t.setAbsolutePosition({x:r.x+i,y:r.y+a}),t.startDrag(n)}),t=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(eo),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(eo,this.__getNodeRect)}__getNodeShape(e,t=this.rotation(),n){let r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),i=e.getAbsoluteScale(n),a=e.getAbsolutePosition(n),o=r.x*i.x-e.offsetX()*i.x,s=r.y*i.y-e.offsetY()*i.y,c=(l.So.getAngle(e.getAbsoluteRotation())+2*Math.PI)%(2*Math.PI);return ed({x:a.x+o*Math.cos(c)+s*Math.sin(-c),y:a.y+s*Math.cos(c)+o*Math.sin(c),width:r.width*i.x,height:r.height*i.y,rotation:c},-l.So.getAngle(t),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};let e=[];this.nodes().map(t=>{let n=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),r=[{x:n.x,y:n.y},{x:n.x+n.width,y:n.y},{x:n.x+n.width,y:n.y+n.height},{x:n.x,y:n.y+n.height}],i=t.getAbsoluteTransform();r.forEach(function(t){let n=i.point(t);e.push(n)})});let t=new k.w;t.rotate(-l.So.getAngle(this.rotation()));let n=1/0,r=1/0,i=-1/0,a=-1/0;e.forEach(function(e){let o=t.point(e);void 0===n&&(n=i=o.x,r=a=o.y),n=Math.min(n,o.x),r=Math.min(r,o.y),i=Math.max(i,o.x),a=Math.max(a,o.y)}),t.invert();let o=t.point({x:n,y:r});return{x:o.x,y:o.y,width:i-n,height:a-r,rotation:l.So.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),eu.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater"),this._elementsCreated=!0}_createAnchor(e){let t=new O({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:ec?10:"auto"}),n=this;t.on("mousedown touchstart",function(e){n._handleMouseDown(e)}),t.on("dragstart",e=>
25{t.stopDrag(),e.cancelBubble=!0}),t.on("dragend",e=>{e.cancelBubble=!0}),t.on("mouseenter",()=>{let n=function(e,t,n){if("rotater"===e)return n;t+=k.Z.degToRad(es[e]||0);let r=(k.Z.radToDeg(t)%360+360)%360;if(k.Z._inRange(r,337.5,360)||k.Z._inRange(r,0,22.5))return"ns-resize";if(k.Z._inRange(r,22.5,67.5))return"nesw-resize";if(k.Z._inRange(r,67.5,112.5))return"ew-resize";if(k.Z._inRange(r,112.5,157.5))return"nwse-resize";if(k.Z._inRange(r,157.5,202.5))return"ns-resize";if(k.Z._inRange(r,202.5,247.5))return"nesw-resize";if(k.Z._inRange(r,247.5,292.5))return"ew-resize";else if(k.Z._inRange(r,292.5,337.5))return"nwse-resize";else return k.Z.error("Transformer has unknown angle for cursor detection: "+r),"pointer"}(e,l.So.getAngle(this.rotation()),this.rotateAnchorCursor());t.getStage().content&&(t.getStage().content.style.cursor=n),this._cursorChange=!0}),t.on("mouseout",()=>{t.getStage().content&&(t.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(t)}_createBack(){let e=new o.b({name:"back",width:0,height:0,sceneFunc(e,t){let n=t.getParent(),r=n.padding(),i=t.width(),a=t.height();if(e.beginPath(),e.rect(-r,-r,i+2*r,a+2*r),n.rotateEnabled()&&n.rotateLineVisible()){let t=n.rotateAnchorAngle(),r=n.rotateAnchorOffset(),o=k.Z.degToRad(t),l=Math.sin(o),s=-Math.cos(o),c=i/2,u=a/2,d=1/0;s<0?d=Math.min(d,-u/s):s>0&&(d=Math.min(d,(a-u)/s)),l<0?d=Math.min(d,-c/l):l>0&&(d=Math.min(d,(i-c)/l));let h=c+l*d,f=u+s*d,p=k.Z._sign(a);
25e.moveTo(h,f),e.lineTo(h+l*r*p,f+s*r*p)}e.fillStrokeShape(t)},hitFunc:(e,t)=>{if(!this.shouldOverdrawWholeArea())return;let n=this.padding();e.beginPath(),e.rect(-n,-n,t.width()+2*n,t.height()+2*n),e.fillStrokeShape(t)}});this.add(e),this._proxyDrag(e),e.on("dragstart",e=>{e.cancelBubble=!0}),e.on("dragmove",e=>{e.cancelBubble=!0}),e.on("dragend",e=>{e.cancelBubble=!0}),this.on("dragmove",e=>{this.update()})}_handleMouseDown(e){if(this._transforming)return;this._movingAnchorName=e.target.name().split(" ")[0];let t=this._getNodeRect(),n=t.width,r=t.height,i=Math.sqrt(Math.pow(n,2)+Math.pow(r,2));this.sin=Math.abs(r/i),this.cos=Math.abs(n/i),"undefined"!=typeof window&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;let a=e.target.getAbsolutePosition(),o=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:o.x-a.x,y:o.y-a.y},eh++,this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(t=>{t._fire("transformstart",{evt:e.evt,target:t})})}_handleMouseMove(e){let t,n,r,i;let a=this.findOne("."+this._movingAnchorName),o=a.getStage();o.setPointersPositions(e);let s=o.getPointerPosition(),c={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y},u=a.getAbsolutePosition();this.anchorDragBoundFunc()&&(c=this.anchorDragBoundFunc()(u,c,e)),a.setAbsolutePosition(c);let d=a.getAbsolutePosition();if(u.x===d.x&&u.y===d.y)return;if("rotater"===this._movingAnchorName){let r=this._getNodeRect();t=a.x()-r.width/2;let i=Math.atan2(-(n=-a.y()+r.height/2),t)+Math.PI/2-l.So.getAngle(this.rotateAnchorAngle());r.height<0&&(i-=Math.PI);let o=l.So.getAngle(this.rotation())+i,s=l.So.getAngle(this.rotationSnapTolerance()),c=function(e,t,n){let r=t;for(let i=0;i<e.length;i++){let a=l.So.getAngle(e[i]),o=Math.abs(a-t)%(2*Math.PI);Math.min(o,2*Math.PI-o)<n&&(r=a)}return r}(this.rotationSnaps(),o,s)-r.rotation,u=function(e,t){let n={x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)};return ed(e,t,n)}(r,c);this._fitNodesInto(u,e);return}let h=this.shiftBehavior();i="inverted"===h?this.keepRatio()&&!e.shiftKey:"none"===h?this.keepRatio():this.keepRatio()||e.shiftKey;let f=this.centeredScaling()||e.altKey;if("top-left"===this._movingAnchorName){if(i){let e=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(e.x-a.x(),2)+Math.pow(e.y-a.y(),2));let i=this.findOne(".top-left").x()>e.x?-1:1,o=this.findOne(".top-left").y()>e.y?-1:1;t=r*this.cos*i,n=r*this.sin*o,this.findOne(".top-left").x(e.x-t),this.findOne(".top-left").y(e.y-n)}}else if("top-center"===this._movingAnchorName)this.findOne(".top-left").y(a.y());else if("top-right"===this._movingAnchorName){if(i){let e=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(a.x()-e.x,2)+Math.pow(e.y-a.y(),2));let i=this.findOne(".top-right").x()<e.x?-1:1,o=this.findOne(".top-right").y()>e.y?-1:1;t=r*this.cos*i,n=r*this.sin*o,this.findOne(".top-right").x(e.x+t),this.findOne(".top-right").y(e.y-n)}var p=a.position();this.findOne(".top-left").y(p.y),this.findOne(".bottom-right").x(p.x)}else if("middle-left"===this._movingAnchorName)this.findOne(".top-left").x(a.x());else if("middle-right"===this._movingAnchorName)this.findOne(".bottom-right").x(a.x());else if("bottom-left"===this._movingAnchorName){if(i){let e=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(e.x-a.x(),2)+Math.pow(a.y()-e.y,2));let i=e.x<a.x()?-1:1,o=a.y()<e.y?-1:1;t=r*this.cos*i,n=r*this.sin*o,a.x(e.x-t),a.y(e.y+n)}p=a.position(),this.findOne(".top-left").x(p.x),this.findOne(".bottom-right").y(p.y)}else if("bottom-center"===this._movingAnchorName)this.findOne(".bottom-right").y(a.y());else if("bottom-right"===this._movingAnchorName){if(i){let e=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};r=Math.sqrt(Math.pow(a.x()-e.x,2)+Math.pow(a.y()-e.y,2));let i=this.findOne(".bottom-right").x()<e.x?-1:1,o=this.findOne(".bottom-right").y()<e.y?-1:1;t=r*this.cos*i,n=r*this.sin*o,this.findOne(".bottom-right").x(e.x+t),this.findOne(".bottom-right").y(e.y+n)}}else console.error(Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(f=this.centeredScaling()||e.altKey){let e=this.findOne(".top-left"),t=this.findOne(".bottom-right"),n=e.x(),r=e.y(),i=this.getWidth()-t.x(),a=this.getHeight()-t.y();t.move({x:-n,y:-r}),e.move({x:i,y:a})}let m=this.findOne(".top-left").getAbsolutePosition();t=m.x,n=m.y;let g=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),v=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:t,y:n,width:g,height:v,rotation:l.So.getAngle(this.rotation())},e)}_handleMouseUp(e){this._removeEvents(e)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(e){var t;if(this._transforming){this._transforming=!1,"undefined"!=typeof window&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));let n=this.getNode();eh--,this._fire("transformend",{evt:e,target:n}),null===(t=this.getLayer())||void 0===t||t.batchDraw(),n&&this._nodes.forEac
25h(t=>{var n;t._fire("transformend",{evt:e,target:t}),null===(n=t.getLayer())||void 0===n||n.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,t){let n=this._getNodeRect();if(k.Z._inRange(e.width,-(2*this.padding())-1,1)||k.Z._inRange(e.height,-(2*this.padding())-1,1)){this.update();return}let r=new k.w;if(r.rotate(l.So.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){let t=r.point({x:-(2*this.padding()),y:0});e.x+=t.x,e.y+=t.y,e.width+=2*this.padding(),this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){let t=r.point({x:2*this.padding(),y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.width+=2*this.padding()}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){let t=r.point({x:0,y:-(2*this.padding())});e.x+=t.x,e.y+=t.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=2*this.padding()}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){let t=r.point({x:0,y:2*this.padding()});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=2*this.padding()}if(this.boundBoxFunc()){let t=this.boundBoxFunc()(n,e);t?e=t:k.Z.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}let i=new k.w;i.translate(n.x,n.y),i.rotate(n.rotation),i.scale(n.width/1e7,n.height/1e7);
25let a=new k.w,o=e.width/1e7,s=e.height/1e7;!1===this.flipEnabled()?(a.translate(e.x,e.y),a.rotate(e.rotation),a.translate(e.width<0?e.width:0,e.height<0?e.height:0),a.scale(Math.abs(o),Math.abs(s))):(a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(o,s));let c=a.multiply(i.invert());this._nodes.forEach(e=>{var t;if(!e.getStage())return;let n=e.getParent().getAbsoluteTransform(),r=e.getTransform().copy();r.translate(e.offsetX(),e.offsetY());let i=new k.w;i.multiply(n.copy().invert()).multiply(c).multiply(n).multiply(r);let a=i.decompose();e.setAttrs(a),null===(t=e.getLayer())||void 0===t||t.batchDraw()}),this.rotation(k.Z._getRotation(e.rotation)),this._nodes.forEach(e=>{this._fire("transform",{evt:t,target:e}),e._fire("transform",{evt:t,target:e})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,t){this.findOne(e).setAttrs(t)}update(){var e;let t=this._getNodeRect();this.rotation(k.Z._getRotation(t.rotation));let n=t.width,r=t.height,i=this.enabledAnchors(),a=this.resizeEnabled(),o=this.padding(),l=this.anchorSize(),s=this.find("._anchor");s.forEach(e=>{e.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+o,offsetY:l/2+o,visible:a&&i.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:l/2+o,visible:a&&i.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:l/2-o,offsetY:l/2+o,visible:a&&i.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:r/2,offsetX:l/2+o,visible:a&&i.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:r/2,offsetX:l/2-o,visible:a&&i.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:l/2+o,offsetY:l/2-o,visible:a&&i.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:r,offsetY:l/2-o,visible:a&&i.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:r,offsetX:l/2-o,offsetY:l/2-o,visible:a&&i.indexOf("bottom-right")>=0});let c=this.rotateAnchorAngle(),u=this.rotateAnchorOffset(),d=k.Z.degToRad(c),h=Math.sin(d),f=-Math.cos(d),p=n/2,m=r/2,g=1/0;f<0?g=Math.min(g,-m/f):f>0&&(g=Math.min(g,(r-m)/f)),h<0?g=Math.min(g,-p/h):h>0&&(g=Math.min(g,(n-p)/h));let v=p+h*g,b=m+f*g,y=k.Z._sign(r);this._batchChangeChild(".rotater",{x:v+h*u*y,y:b+f*u*y-o*f,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(e=>e.draggable()),x:0,y:0});let w=this.anchorStyleFunc();w&&s.forEach(e=>{w(e)}),null===(e=this.getLayer())||void 0===e||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();let e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),T.Z.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}add(...e){return this._elementsCreated?(k.Z.error("You cannot add external nodes to the Transformer. Use tr.nodes([node]) instead."),this):super.add(...e)}toObject(){return er.N.prototype.toObject.call(this)}clone(e){return er.N.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}ef.isTransforming=()=>eh>0,ef.prototype.className="Transformer",(0,l.DA)(ef),a.F.addGetterSetter(ef,"enabledAnchors",eu,function(e){return e instanceof Array||k.Z.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(e){-1===eu.indexOf(e)&&k.Z.warn("Unknown anchor name: "+e+". Available names are: "+eu.join(", "))}),e||[]}),a.F.addGetterSetter(ef,"flipEnabled",!0,(0,s.I0)()),a.F.addGetterSetter(ef,"resizeEnabled",!0),a.F.addGetterSetter(ef,"anchorSize",10,(0,s.Kg)()),a.F.addGetterSetter(ef,"rotateEnabled",!0),a.F.addGetterSetter(ef,"rotateLineVisible",!0),a.F.addGetterSetter(ef,"rotationSnaps",[]),a.F.addGetterSetter(ef,"rotateAnchorOffset",50,(0,s.Kg)()),a.F.addGetterSetter(ef,"rotateAnchorAngle",0,(0,s.Kg)()),a.F.addGetterSetter(ef,"rotateAnchorCursor","crosshair"),a.F.addGetterSetter(ef,"rotationSnapTolerance",5,(0,s.Kg)()),a.F.addGetterSetter(ef,"borderEnabled",!0),a.F.addGetterSetter(ef,"anchorStroke","rgb(0, 161, 255)"),a.F.addGetterSetter(ef,"anchorStrokeWidth",1,(0,s.Kg)()),a.F.addGetterSetter(ef,"anchorFill","white"),a.F.addGetterSetter(ef,"anchorCornerRadius",0,(0,s.Kg)()),a.F.addGetterSetter(ef,"borderStroke","rgb(0, 161, 255)"),a.F.addGetterSetter(ef,"borderStrokeWidth",1,(0,s.Kg)()),a.F.addGetterSetter(ef,"borderDash"),a.F.addGetterSetter(ef,"keepRatio",!0),a.F.addGetterSetter(ef,"shiftBehavior","default"),a.F.addGetterSetter(ef,"centeredScaling",!1),a.F.addGetterSetter(ef,"ignoreStroke",!1),a.F.addGetterSetter(ef,"padding",0,(0,s.Kg)()),a.F.addGetterSetter(ef,"nodes"),a.F.addGetterSetter(ef,"node"),a.F.addGetterSetter(ef,"boundBoxFunc"),a.F.addGetterSetter(ef,"anchorDragBoundFunc"),a.F.addGetterSetter(ef,"anchorStyleFunc"),a.F.addGetterSetter(ef,"shouldOverdrawWholeArea",!1),a.F.addGetterSetter(ef,"useSingleNodeRotation",!0),a.F.backCompat(ef,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledH
25andlers:"enabledAnchors"});class ep extends o.b{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,l.So.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}function em(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}ep.prototype.className="Wedge",ep.prototype._centroid=!0,ep.prototype._attrsAffectingSize=["radius"],(0,l.DA)(ep),a.F.addGetterSetter(ep,"radius",0,(0,s.Kg)()),a.F.addGetterSetter(ep,"angle",0,(0,s.Kg)()),a.F.addGetterSetter(ep,"clockwise",!1),a.F.backCompat(ep,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});let eg=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,39
256,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],ev=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function eb(e,t,n,r,i){let a=n-t,o=i-r;return 0===a?r+o/2:0===o?r:(e-t)/a*o+r}a.F.addGetterSetter(er.N,"blurRadius",0,(0,s.Kg)(),a.F.afterSetFilter),a.F.addGetterSetter(er.N,"brightness",0,(0,s.Kg)(),a.F.afterSetFilter),a.F.addGetterSetter(er.N,"contrast",0,(0,s.Kg)(),a.F.afterSetFilter),a.F.addGetterSetter(er.N,"embossStrength",.5,(0,s.Kg)(),a.F.afterSetFilter),a.F.addGetterSetter(er.N,"embossWhiteLevel",.5,(0,s.Kg)(),a.F.afterSetFilter),a.F.addGetterSetter(er.N,"embossDirection","top-left",void 0,a.F.afterSetFilter),a.F.addGetterSetter(er.N,"embossBlend",!1,void 0,a.F.afterSetFilter),a.F.addGetterSetter(er.N,"enhance",0,(0,s.Kg)(),a.F.afterSetFilter),a.F.addGetterSetter(er.N,"hue",0,(0,s.Kg)(),a.F.afterSetFilter),a.F.addGetterSetter(er.N,"saturation",0,(0,s.Kg)(),a.F.afterSetFilter),a.F.addGetterSetter(er.N,"luminance",0,(0,s.Kg)(),a.F.afterSetFilter),a.F.addGetterSetter(er.N,"hue",0,(0,s.Kg)(),a.F.afterSetFilter),a.F.addGetterSetter(er.N,"saturation",0,(0,s.Kg)(),a.F.afterSetFilter),a.F.addGetterSetter(er.N,"value",0,(0,s.Kg)(),a.F.afterSetFilter);let ey=function(e,t,n){let r=e.data,i=t.data,a=e.width,o=e.height,l=n.polarCenterX||a/2,s=n.polarCenterY||o/2,c=Math.sqrt(l*l+s*s),u=a-l,d=o-s,h=Math.sqrt(u*u+d*d);c=h>c?h:c;let f=360/a*Math.PI/180;for(let e=0;e<a;e+=1){let t=Math.sin(e*f),n=Math.cos(e*f);for(let h=0;h<o;h+=1){u=Math.floor(l+c*h/o*n);let f=((d=Math.floor(s+c*h/o*t))*a+u)*4,p=r[f+0],m=r[f+1],g=r[f+2],v=r[f+3];i[(f=(e+h*a)*4)+0]=p,i[f+1]=m,i[f+2]=g,i[f+3]=v}}},ew=function(e,t,n){let r;let i=e.data,a=t.data,o=e.width,l=e.height,s=n.polarCenterX||o/2,c=n.polarCenterY||l/2,u=Math.sqrt(s*s+c*c),d=o-s,h=l-c,f=Math.sqrt(d*d+h*h);u=f>u?f:u;let p=n.polarRotation||0;for(d=0;d<o;d+=1)for(h=0;h<l;h+=1){let e=d-s,t=h-c,n=Math.sqrt(e*e+t*t)*l/u,f=(180*Math.atan2(t,e)/Math.PI+360+p)%360;r=Math.floor(f=f*o/360);let m=(Math.floor(n)*o+r)*4,g=i[m+0],v=i[m+1],b=i[m+2],y=i[m+3];a[(m=(h*o+d)*4)+0]=g,a[m+1]=v,a[m+2]=b,a[m+3]=y}};function ex(e,t,n){let r=(n*e.width+t)*4,i=[];return i.push(e.data[r++],e.data[r++],e.data[r++],e.data[r++]),i}function eC(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}a.F.addGetterSetter(er.N,"kaleidoscopePower",2,(0,s.Kg)(),a.F.afterSetFilter),a.F.addGetterSetter(er.N,"kaleidoscopeAngle",0,(0,s.Kg)(),a.F.afterSetFilter),a.F.addGetterSetter(er.N,"threshold",0,(0,s.Kg)(),a.F.afterSetFilter),a.F.addGetterSetter(er.N,"noise",.2,(0,s.Kg)(),a.F.afterSetFilter),a.F.addGetterSetter(er.N,"pixelSize",8,(0,s.Kg)(),a.F.afterSetFilter),a.F.addGetterSetter(er.N,"levels",.5,(0,s.Kg)(),a.F.afterSetFilter),a.F.addGetterSetter(er.N,"red",0,function(e){return(this._filterUpToDate=!1,e>255)?255:e<0?0:Math.round(e)}),a.F.addGetterSetter(er.N,"green",0,function(e){return(this._filterUpToDate=!1,e>255)?255:e<0?0:Math.round(e)}),a.F.addGetterSetter(er.N,"blue",0,s.xj,a.F.afterSetFilter),a.F.addGetterSetter(er.N,"red",0,function(e){return(this._filterUpToDate=!1,e>255)?255:e<0?0:Math.round(e)}),a.F.addGetterSetter(er.N,"green",0,function(e){return(this._filterUpToDate=!1,e>255)?255:e<0?0:Math.round(e)}),a.F.addGetterSetter(er.N,"blue",0,s.xj,a.F.afterSetFilter),a.F.addGetterSetter(er.N,"alpha",1,function(e){return(this._filterUpToDate=!1,e>1)?1:e<0?0:e}),a.F.addGetterSetter(er.N,"threshold",.5,(0,s.Kg)(),a.F.afterSetFilter);var eE=i.S.Util._assign(i.S,{Arc:c,Arrow:x,Circle:C,Ellipse:E,Image:S,Label:_,Tag:I,Line:h,Path:w,Rect:O,RegularPolygon:D,Ring:N,Sprite:B,Star:H,Text:J,TextPath:en,Transformer:ef,Wedge:ep,Filters:{Blur:function(e){let t=Math.round(this.blurRadius());t>0&&function(e,t){let n,r,i,a,o,l,s,c,u,d,h,f,p,m,g,v,b,y,w,x;let C=e.data,E=e.width,k=e.height,S=t+t+1,T=E-1,P=k-1,M=t+1,R=M*(M+1)/2,A=new em,L=eg[t],_=ev[t],I=null,O=A,D=null,z=null;for(let e=1;e<S;e++)O=O.next=new em,e===M&&(I=O);O.next=A,i=r=0;for(let e=0;e<k;e++){f=p=m=g=a=o=l=s=0,c=M*(v=C[r]),u=M*(b=C[r+1]),d=M*(y=C[r+2]),h=M*(w=C[r+3]),a+=R*v,o+=R*b,l+=R*y,s+=R*w,O=A;for(let e=0;e<M;e++)O.r=v,O.g=b,O.b=y,O.a=w,O=O.next;for(let e=1;e<M;e++)n=r+((T<e?T:e)<<2),a+=(O.r=v=C[n])*(x=M-e),o+=(O.g=b=C[n+1])*x,l+=(O.b=y=C[n+2])*x,s+=(O.a=w=C[n+3])*x,f+=v,p+=b,m+=y,g+=w,O=O.next;D=A,z=I;for(let e=0;e<E;e++)C[r+3]=w=s*L>>_,0!==w?(w=255/w,C[r]=(a*L>>_)*w,C[r+1]=(o*L>>_)*w,C[r+2]=(l*L>>_)*w):C[r]=C[r+1]=C[r+2]=0,a-=c,o-=u,l-=d,s-=h,c-=D.r,u-=D.g,d-=D.b,h-=D.a,n=i+((n=e+t+1)<T?n:T)<<2,f+=D.r=C[n],p+=D.g=C[n+1],m+=D.b=C[n+2],g+=D.a=C[n+3],a+=f,o+=p,l+=m,s+=g,D=D.next,c+=v=z.r,u+=b=z.g,d+=y=z.b,h+=w=z.a,f-=v,p-=b,m-=y,g-=w,z=z.next,r+=4;i+=E}for(let e=0;e<E;e++){p=m=g=f=o=l=s=a=0,c=M*(v=C[r=e<<2]),u=M*(b=C[r+1]),d=M*(y=C[r+2]),h=M*(w=C[r+3]),a+=R*v,o+=R*b,l+=R*y,s+=R*w,O=A;for(let e=0;e<M;e++)O.r=v,O.g=b,O.b=y,O.a=w,O=O.next;let i=E;for(let n=1;n<=t;n++)r=i+e<<2,a+=(O.r=v=C[r])*(x=M-n),o+=(O.g=b=C[r+1])*x,l+=(O.b=y=C[r+2])*x,s+=(O.a=w=C[r+3])*x,f+=v,p+=b,m+=y,g+=w,O=O.next,n<P&&(i+=E);r=e,D=A,z=I;for(let t=0;t<k;t++)C[(n=r<<2)+3]=w=s*L>>_,w>0?(w=255/w,C[n]=(a*L>>_)*w,C[n+1]=(o*L>>_)*w,C[n+2]=(l*L>>_)*w):C[n]=C[n+1]=C[n+2]=0,a-=c,o-=u,l-=d,s-=h,c-=D.r,u-=D.g,d-=D.b,h-=D.a,n=e+((n=t+M)<P?n:P)*E<<2,a+=f+=D.r=C[n],o+=p+=D.g=C[n+1],l+=m+=D.b=C[n+2],s+=g+=D.a=C[n+3],D=D.next,c+=v=z.r,u+=b=z.g,d+=y=z.b,h+=w=z.a,f-=v,p-=b,m-=y,g-=w,z=z.next,r+=E}}(e,t)},Brightness:function(e){let t=this.brightness(),n=e.data,r=n.length;for(let e=0;e<r;e+=4)n[e]=Math.min(255,n[e]*t),n[e+1]=Math.min(255,n[e+1]*t),n[e+2]=Math.min(255,n[e+2]*t)},Brighten:function(e){let t=255*this.brightness(),n=e.data,r=n.length;for(let e=0;e<r;e+=4)n[e]+=t,n[e+1]+=t,n[e+2]+=t},Contrast:function(e){let t=Math.pow((this.contrast()+100)/100,2),n=e.data,r=n.length,i=150,a=150,o=150;for(let e=0;e<r;e+=4)i=n[e],a=n[e+1],o=n[e+2],i/=255,i-=.5,i*=t,i+=.5,i*=255,a/=255,a-=.5,a*=t,a+=.5,a*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,i=i<0?0:i>255?255:i,a=a<0?0:a>255?255:a,o=o<0?0:o>255?255:o,n[e]=i,n[e+1]=a,n[e+2]=o},Emboss:function(e){var t,n,r,i,a,o,l,s,c;let u=e.data,d=e.width,h=e.height,f=Math.min(1,Math.max(0,null!==(n=null===(t=this.embossStrength)||void 0===t?void 0:t.call(this))&&void 0!==n?n:.5)),p=Math.min(1,Math.max(0,null!==(i=null===(r=this.embossWhiteLevel)||void 0===r?void 0:r.call(this))&&void 0!==i?i:.5)),m=null!==(l=({"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0})[null!==(o=null===(a=this.embossDirection)||void 0===a?void 0:a.call(this))&&void 0!==o?o:"top-left"])&&void 0!==l?l:315,g=!!(null!==(c=null===(s=this.embossBlend)||void 0===s?void 0:s.call(this))&&void 0!==c&&c),v=255*p,b=m*Math.PI/180,y=Math.cos(b),w=Math.sin(b),x=128/1020*(10*f),C=new Uint8ClampedArray(u),E=new Float32Array(d*h);for(let e=0,t=0;t<u.length;t+=4,e++)E[e]=.2126*C[t]+.7152*C[t+1]+.0722*C[t+2];let k=[-d-1,-d,-d+1,-1,0,1,d-1,d,d+1],S=e=>e<0?0:e>255?255:e;for(let e=1;e<h-1;e++)for(let t=1;t<d-1;t++){let n=e*d+t,r,i=0;r=0+-1*E[n+k[0]],i+=-1*E[n+k[0]],r+=0*E[n+k[1]],i+=-2*E[n+k[1]],r+=1*E[n+k[2]],i+=-1*E[n+k[2]],r+=-2*E[n+k[3]],i+=0*E[n+k[3]],r+=2*E[n+k[5]],i+=0*E[n+k[5]],r+=-1*E[n+k[6]],i+=1*E[n+k[6]],r+=0*E[n+k[7]],i+=2*E[n+k[7]];let a=S(v+(y*(r+=1*E[n+k[8]])+w*(i+=1*E[n+k[8]]))*x),o=4*n;if(g){let e=a-v;u[o]=S(C[o]+e),u[o+1]=S(C[o+1]+e),u[o+2]=S(C[o+2]+e),u[o+3]=C[o+3]}else u[o]=u[o+1]=u[o+2]=a,u[o+3]=C[o+3]}for(let e=0;e<d;e++){let t=4*e,n=((h-1)*d+e)*4;u[t]=C[t],u[t+1]=C[t+1],u[t+2]=C[t+2],u[t+3]=C[t+3],u[n]=C[n],u[n+1]=C[n+1],u[n+2]=C[n+2],u[n+3]=C[n+3]}for(let e=1;e<h-1;e++){let t=e*d*4,n=(e*d+(d-1))*4;u[t]=C[t],u[t+1]=C[t+1],u[t+2]=C[t+2],u[t+3]=C[t+3],u[n]=C[n],u[n+1]=C[n+1],u[n+2]=C[n+2],u[n+3]=C[n+3]}return e},Enhance:function(e){let t,n,r,i,a,o;let l=e.data,s=l.length,c=l[0],u=c,d,h=l[1],f=h,p,m=l[2],g=m,v,b=this.enhance();if(0!==b){for(let e=0;e<s;e+=4)(d=l[e+0])<c?c=d:d>u&&(u=d),(p=l[e+1])<h?h=p:p>f&&(f=p),(v=l[e+2])<m?m=v:v>g&&(g=v);if(u===c&&(u=255,c=0),f===h&&(f=255,h=0),g===m&&(g=255,m=0),b>0)t=u+b*(255-u),n=c-b*(c-0),r=f+b*(255-f),i=h-b*(h-0),a=g+b*(255-g),o=m-b*(m-0);else{let e=(u+c)*.5;t=u+b*(u-e),n=c+b*(c-e);let l=(f+h)*.5;r=f+b*(f-l),i=h+b*(h-l);let s=(g+m)*.5;a=g+b*(g-s),o=m+b*(m-s)}for(let e=0;e<s;e+=4)l[e+0]=eb(l[e+0],c,u,n,t),l[e+1]=eb(l[e+1],h,f,i,r),l[e+2]=eb(l[e+2],m,g,o,a)}},Grayscale:function(e){let t=e.data,n=t.length;for(let e=0;e<n;e+=4){let n=.34*t[e]+.5*t[e+1]+.16*t[e+2];t[e]=n,t[e+1]=n,t[e+2]=n}},HSL:function(e){let t,n,r,i;let a=e.data,o=a.length,l=Math.pow(2,this.saturation()),s=Math.abs(this.hue()+360)%360,c=127*this.luminance(),u=1*l*Math.cos(s*Math.PI/180),d=1*l*Math.sin(s*Math.PI/180),h=.299+.701*u+.167*d,f=.587-.587*u+.33*d,p=.114-.114*u-.497*d,m=.299-.299*u-.328*d,g=.587+.413*u+.035*d,v=.114-.114*u+.293*d,b=.299-.3*u+1.25*d,y=.587-.586*u-1.05*d,w=.114+.886*u-.2*d;for(let e=0;e<o;e+=4)t=a[e+0],n=a[e+1],r=a[e+2],i=a[e+3],a[e+0]=h*t+f*n+p*r+c,a[e+1]=m*t+g*n+v*r+c,a[e+2]=b*t+y*n+w*r+c,a[e+3]=i},HSV:function(e){let t=e.data,n=t.length,r=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o=r*i*Math.cos(a*Math.PI/180),l=r*i*Math.sin(a*Math.PI/180),s=.299*r+.701*o+.167*l,c=.587*r-.587*o+.33*l,u=.114*r-.114*o-.497*l,d=.299*r-.299*o-.328*l,h=.587*r+.413*o+.035*l,f=.114*r-.114*o+.293*l,p=.299*r-.3*o+1.25*l,m=.587*r-.586*o-1.05*l,g=.114*r+.886*o-.2*l;for(let e=0;e<n;e+=4){let n=t[e+0],r=t[e+1],i=t[e+2],a=t[e+3];t[e+0]=s*n+c*r+u*i,t[e+1]=d*n+h*r+f*i,t[e+2]=p*n+m*r+g*i,t[e+3]=a}},Invert:function(e){let t=e.data,n=t.length;for(let e=0;e<n;e+=4)t[e]=255-t[e],t[e+1]=255-t[e+1],t[e+2]=255-t[e+2]},Kaleidoscope:function(e){let t,n,r,i,a,o,l,s,c,u;let d=e.width,h=e.height,f=Math.round(this.kaleidoscopePower()),p=Math.floor(Math.round(this.kaleidoscopeAngle())%360*d/360);if(f<1)return;let m=k.Z.createCanvasElement();m.width=d,m.height=h;let g=m.getContext("2d").getImageData(0,0,d,h);k.Z.releaseCanvas(m),ey(e,g,{polarCenterX:d/2,polarCenterY:h/2});let v=d/Math.pow(2,f);for(;v<=8;)v*=2,f-=1;let b=v=Math.ceil(v),y=0,w=b,x=1;for(p+v>d&&(y=b,w=0,x=-1),n=0;n<h;n+=1)for(t=y;t!==w;t+=x)r=Math.round(t+p)%d,c=(d*n+r)*4,a=g.data[c+0],o=g.data[c+1],l=g.data[c+2],s=g.data[c+3],u=(d*n+t)*4,g.data[u+0]=a,g.data[u+1]=o,g.data[u+2]=l,g.data[u+3]=s;for(n=0;n<h;n+=1)for(i=0,b=Math.floor(v);i<f;i+=1){for(t=0;t<b+1;t+=1)c=(d*n+t)*4,a=g.data[c+0],o=g.data[c+1],l=g.data[c+2],s=g.data[c+3],u=(d*n+2*b-t-1)*4,g.data[u+0]=a,g.data[u+1]=o,g.data[u+2]=l,g.data[u+3]=s;b*=2}ew(g,e,{polarRotation:0})},Mask:function(e){let t=function(e,t){let n=ex(e,0,0),r=ex(e,e.width-1,0),i=ex(e,0,e.height-1),a=ex(e,e.width-1,e.height-1),o=t||10;if(eC(n,r)<o&&eC(r,a)<o&&eC(a,i)<o&&eC(i,n)<o){let t=function(e){let t=[0,0,0];for(let n=0;n<e.length;n++)t[0]+=e[n][0],t[1]+=e[n][1],t[2]+=e[n][2];return t[0]/=e.length,t[1]/=e.length,t[2]/=e.length,t}([r,n,a,i]),l=[];for(let n=0;n<e.width*e.height;n++){let r=eC(t,[e.data[4*n],e.data[4*n+1],e.data[4*n+2]]);l[n]=r<o?0:255}return l}}(e,this.threshold());return t&&(t=function(e,t,n){let r=[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),o=[];for(let l=0;l<n;l++)for(let s=0;s<t;s++){let c=l*t+s,u=0;for(let o=0;o<i;o++)for(let c=0;c<i;c++){let d=l+o-a,h=s+c-a;if(d>=0&&d<n&&h>=0&&h<t){let n=d*t+h,a=r[o*i+c];u+=e[n]*a}}
25o[c]=u}return o}(t=function(e,t,n){let r=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),o=[];for(let l=0;l<n;l++)for(let s=0;s<t;s++){let c=l*t+s,u=0;for(let o=0;o<i;o++)for(let c=0;c<i;c++){let d=l+o-a,h=s+c-a;if(d>=0&&d<n&&h>=0&&h<t){let n=d*t+h,a=r[o*i+c];u+=e[n]*a}}o[c]=u>=1020?255:0}return o}(t=function(e,t,n){let r=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),o=[];for(let l=0;l<n;l++)for(let s=0;s<t;s++){let c=l*t+s,u=0;for(let o=0;o<i;o++)for(let c=0;c<i;c++){let d=l+o-a,h=s+c-a;if(d>=0&&d<n&&h>=0&&h<t){let n=d*t+h,a=r[o*i+c];u+=e[n]*a}}o[c]=2040===u?255:0}return o}(t,e.width,e.height),e.width,e.height),e.width,e.height),function(e,t){for(let n=0;n<e.width*e.height;n++)e.data[4*n+3]=t[n]}(e,t)),e},Noise:function(e){let t=255*this.noise(),n=e.data,r=n.length,i=t/2;for(let e=0;e<r;e+=4)n[e+0]+=i-2*i*Math.random(),n[e+1]+=i-2*i*Math.random(),n[e+2]+=i-2*i*Math.random()},Pixelate:function(e){let t=Math.ceil(this.pixelSize()),n=e.width,r=e.height,i=Math.ceil(n/t),a=Math.ceil(r/t),o=e.data;if(t<=0){k.Z.error("pixelSize value can not be <= 0");return}for(let e=0;e<i;e+=1)for(let i=0;i<a;i+=1){let a=0,l=0,s=0,c=0,u=e*t,d=u+t,h=i*t,f=h+t,p=0;for(let e=u;e<d;e+=1)if(!(e>=n))for(let t=h;t<f;t+=1){if(t>=r)continue;let i=(n*t+e)*4;a+=o[i+0],l+=o[i+1],s+=o[i+2],c+=o[i+3],p+=1}a/=p,l/=p,s/=p,c/=p;for(let e=u;e<d;e+=1)if(!(e>=n))for(let t=h;t<f;t+=1){if(t>=r)continue;let i=(n*t+e)*4;o[i+0]=a,o[i+1]=l,o[i+2]=s,o[i+3]=c}}},Posterize:function(e){let t=Math.round(254*this.levels())+1,n=e.data,r=n.length,i=255/t;for(let e=0;e<r;e+=1)n[e]=Math.floor(n[e]/i)*i},RGB:function(e){let t=e.data,n=t.length,r=this.red(),i=this.green(),a=this.blue();for(let e=0;e<n;e+=4){let n=(.34*t[e]+.5*t[e+1]+.16*t[e+2])/255;t[e]=n*r,t[e+1]=n*i,t[e+2]=n*a,t[e+3]=t[e+3]}},RGBA:function(e){let t=e.data,n=t.length,r=this.red(),i=this.green(),a=this.blue(),o=this.alpha();for(let e=0;e<n;e+=4){let n=1-o;t[e]=r*o+t[e]*n,t[e+1]=i*o+t[e+1]*n,t[e+2]=a*o+t[e+2]*n}},Sepia:function(e){let t=e.data,n=t.length;for(let e=0;e<n;e+=4){let n=t[e+0],r=t[e+1],i=t[e+2];t[e+0]=Math.min(255,.393*n+.769*r+.189*i),t[e+1]=Math.min(255,.349*n+.686*r+.168*i),t[e+2]=Math.min(255,.272*n+.534*r+.131*i)}},Solarize:function(e){let t=e.data;for(let e=0;e<t.length;e+=4){let n=t[e],r=t[e+1],i=t[e+2];.2126*n+.7152*r+.0722*i>=128&&(t[e]=255-n,t[e+1]=255-r,t[e+2]=255-i)}return e},Threshold:function(e){let t=255*this.threshold(),n=e.data,r=n.length;for(let e=0;e<r;e+=1)n[e]=n[e]<t?0:255}}})},20873:function(e,t,n){"use strict";n.d(t,{R:function(){return a}});var r=n(8585);let i={warm:e=>t=>{let n=t.data;e=Math.max(0,Math.min(1,e));for(let t=0;t<n.length;t+=4)n[t]=Math.min(n[t]+30*e,255),n[t+1]=Math.min(n[t+1]+15*e,255);return t},cold:e=>t=>{let n=t.data;e=Math.max(0,Math.min(1,e));for(let t=0;t<n.length;t+=4)n[t]=Math.min(n[t]-15*e,255),n[t+1]=Math.min(n[t+1]-10*e,255),n[t+2]=Math.min(n[t+2]+15*e,255);return t},natural:e=>t=>{let n=t.data;e=Math.max(0,Math.min(1,e));for(let t=0;t<n.length;t+=4){n[t]=Math.min(n[t]*(1+.1*e),255),n[t+1]=Math.min(n[t+1]*(1+.1*e),255),n[t+2]=Math.min(n[t+2]*(1+.1*e),255);let r=(n[t]+n[t+1]+n[t+2])/3;n[t]=Math.min((n[t]-r)*(1+.2*e)+r,255),n[t+1]=Math.min((n[t+1]-r)*(1+.2*e)+r,255),n[t+2]=Math.min((n[t+2]-r)*(1+.2*e)+r,255)}return t},temperature:e=>t=>{let n=t.data;e=Math.max(-1,Math.min(1,e));for(let t=0;t<n.length;t+=4){let r=n[t],i=(n[t+1],n[t+2]);n[t]=Math.min(Math.max(r+15*e,0),255),n[t+2]=Math.min(Math.max(i-15*e,0),255)}return t},contrast:e=>t=>{let n=t.data,r=100*(e=Math.max(-1,Math.min(1,e))),i=259*(r+255)/(255*(259-r));for(let e=0;e<n.length;e+=4)n[e]=Math.min(Math.max(i*(n[e]-128)+128,0),255),n[e+1]=Math.min(Math.max(i*(n[e+1]-128)+128,0),255),n[e+2]=Math.min(Math.max(i*(n[e+2]-128)+128,0),255);return t},shadows:e=>t=>{let n=t.data;e=Math.max(-1,Math.min(1,e));for(let t=0;t<n.length;t+=4){let r=(n[t]+n[t+1]+n[t+2])/3;if(r<128){let i=1+e*(1-r/128)*2;n[t]=Math.min(Math.max(n[t]*i,0),255),n[t+1]=Math.min(Math.max(n[t+1]*i,0),255),n[t+2]=Math.min(Math.max(n[t+2]*i,0),255)}}return t},white:e=>t=>{let n=t.data;e=Math.max(-1,Math.min(1,e));for(let t=0;t<n.length;t+=4){let r=n[t],i=n[t+1],a=n[t+2],o=(r+i+a)/3;if(o>128){let l=1+(o-128)/127*e;n[t]=Math.min(Math.max(r*l,0),255),n[t+1]=Math.min(Math.max(i*l,0),255),n[t+2]=Math.min(Math.max(a*l,0),255)}}return t},black:e=>t=>{let n=t.data;e=Math.max(-1,Math.min(1,e));for(let t=0;t<n.length;t+=4){let r=n[t],i=n[t+1],a=n[t+2],o=(r+i+a)/3;if(o<128){let l=1+(128-o)/128*e;n[t]=Math.min(Math.max(r*l,0),255),n[t+1]=Math.min(Math.max(i*l,0),255),n[t+2]=Math.min(Math.max(a*l,0),255)}}return t},vibrance:e=>t=>{let n=t.data;e=Math.max(-1,Math.min(1,e));for(let t=0;t<n.length;
25t+=4){let r=n[t],i=n[t+1],a=n[t+2],o=Math.max(r,i,a),l=e<0?(1-(0===o?0:(o-(r+i+a)/3)/o))*e*1.5:.5*e;n[t]=Math.min(Math.max(r-(o-r)*l,0),255),n[t+1]=Math.min(Math.max(i-(o-i)*l,0),255),n[t+2]=Math.min(Math.max(a-(o-a)*l,0),255)}return t},saturation:e=>t=>{let n=t.data;e=Math.max(-1,Math.min(1,e));for(let t=0;t<n.length;t+=4){let r=n[t],i=n[t+1],a=n[t+2],o=.2126*r+.7152*i+.0722*a;n[t]=Math.min(Math.max(o+(r-o)*(1+e),0),255),n[t+1]=Math.min(Math.max(o+(i-o)*(1+e),0),255),n[t+2]=Math.min(Math.max(o+(a-o)*(1+e),0),255)}return t}};function a(e,t){var n;let a={filters:[]},o={};t.brightnessEnabled&&(a.filters.push(r.Z.Filters.Brighten),a.brightness=t.brightness),t.blurEnabled&&(a.filters.push(r.Z.Filters.Blur),a.blurRadius=t.blurRadius,"text"===t.type&&t.lineHeight<1&&(o.offset=t.fontSize)),t.sepiaEnabled&&a.filters.push(r.Z.Filters.Sepia),t.grayscaleEnabled&&a.filters.push(r.Z.Filters.Grayscale),t.filters.forEach((e,t)=>{let n=i[t];n&&a.filters.push(n(e.intensity))}),e.setAttrs(a),a.filters.length?e.cache(Object.assign(Object.assign({},o),{pixelRatio:t.store._elementsPixelRatio})):e.clearCache(),null===(n=e.getLayer())||void 0===n||n.batchDraw()}},79387:function(e,t,n){"use strict";let r;n.d(t,{mv:function(){return $},l6:function(){return B},jY:function(){return z},mq:function(){return H}});var i=n(7653),a=n(2027),o=n(46666),l=n(12431),s=n(8585),c=n(59533),u=n(84360),d=n(20873),h=n(218),f=n(95710),p=n(8803),m=n(38041),g=n(1032),v=n(43389),b=n(94877),y=n(77555);let w=()=>(r||((r=document.createElement("div")).id="polotno-hidden-do-not-touch",r.style.overflow="hidden",r.style.position="relative",document.body.appendChild(r),r.innerHTML=`<style>#polotno-hidden-do-not-touch {${y.p}}</style>`),r);function x(e){let t=document.createElement("div");t.innerHTML=e,t.style.display="inline-block",t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.zIndex="1000";let n=w();n.appendChild(t);let r=t.getBoundingClientRect();return n.removeChild(t),{width:r.width,height:r.height}}navigator.userAgent.includes("Firefox");let C={},E={},k=new Map;async function S({html:e,width:t,height:n,fontFamily:r,padding:i,font:a,pixelRatio:o}){let l="";if("Arial"!==r&&!a){let e=(0,g.Jf)();l=await async function(e,t){let n=`${e}|${t}`;if(k.has(n))return k.get(n);let r=`https://fonts.googleapis.com/css?family=${e}:${t}&display=swap`,i=await (await fetch(r)).text();return k.set(n,i),i}(r,e)}if(a){let e=a.styles||(a.url?[{src:`url("${a.url}")`}]:(e=>{if(E[e])return E[e];let t=(function(e){let t=[];for(let n=0;n<document.styleSheets.length;n++){let r=document.styleSheets[n];try{let n=r.cssRules;if(n)for(let r=0;r<n.length;r++){let i=n[r];i instanceof CSSFontFaceRule&&i.style.fontFamily.replace(/['"]/g,"")===e&&t.push(i)}}catch(e){console.warn(`Could not access stylesheet: ${r.href}`,e)}}return t})(e).filter(t=>t.style.fontFamily.replace(/['"]/g,"")===e).map(e=>({src:e.style.getPropertyValue("src"),fontStyle:e.style.getPropertyValue("font-style")||"normal",fontWeight:e.style.getPropertyValue("font-weight")||"normal"}));return E[e]=t,t})(r));l="",e.forEach(e=>{l+=` 26 @font-face { 27 font-family: '${r}'; 28 src: ${e.src}; 29 font-style: ${e.fontStyle||"normal"}; 30 font-weight: ${e.fontWeight||"normal"}; 31 } 32 `})}let s="";l&&(s=function(e,t){if(!e.includes("@font-face"))return"";let n=new Set,r=new Set;t&&((t.match(/font-weight:\s*(\d+|bold|normal)/gi)||[]).forEach(e=>{let t=e.split(":")[1].trim();"bold"===t?n.add("700"):"normal"===t?n.add("400"):/^\d+$/.test(t)&&n.add(t)}),(t.match(/font-style:\s*(italic|normal)/gi)||[]).forEach(e=>{"italic"===e.split(":")[1].trim().toLowerCase()&&r.add("italic")}),/<(b|strong)\b/i.test(t)&&n.add("700"),/<(i|em)\b/i.test(t)&&r.add("italic"));let i=(0,b.av)(t);i&&i.trim()&&n.add("400"),0===n.size&&n.add("400");let a=r.has("italic"),o=Array.from(new Set(i)).map(e=>e.codePointAt(0)).filter(e=>void 0!==e),l=e.split(/}\s*/).map(e=>e&&e+"}").filter(e=>/@font-face/.test(e)&&(e=>{let t=(e.match(/font-weight:\s*(\d+)/)||[])[1];if(t&&!n.has(t)||/font-style:\s*italic/.test(e)&&!a)return!1;let r=e.match(/unicode-range:\s*([^;]+);/);if(!r)return!0;let i=r[1].split(",").map(e=>{let[t,n=t]=e.replace("U+","").split("-").map(e=>parseInt(e,16));return[t,n]});return o.some(e=>i.some(([t,n])=>e>=t&&e<=n))})(e)).join("\n");return l?`<style>${l}</style>`:""}(l,e)),e+=s+y.Y;let c=t+2*i,u=n+2*i,d=document.createElement("canvas"),h=await m.drawHTML(`<div style="padding: ${i}px;" dir="auto">${e}</div>`,d,{width:c,height:u,cacheBucket:C});(0,v.Hr)(d,c*o,u*o);let f=d.getContext("2d");return null==f||f.drawImage(h.image,0,0,c,u,0,0,d.width,d.height),d}var T=n(36677),P=n(463),M=n(43808),R=n(69389),A=n(96283),L=n(21653),_=n(83063),I=n(90337);function O(e,t){if(1===t)return e;let n=s.Z.Util.colorToRGBA(e);return n?`rgba(${n.r}, ${n.g}, ${n.b}, ${n.a*t})`:e}function D(e){let t=(e||"").trim();if("<p><br></p>"===t||"<p></p>"===t)return"";if(t.startsWith("<p>")&&t.endsWith("</p>")){let e=t.slice(3,-4);if(!/(<\/?(p|div|h[1-6]|ul|ol|li|table|thead|tbody|tr|td|blockquote)\b)/i.test(e))return e}return e}let z=c.LO({enabled:!1,currentFormat:{},editor:c.LO.object({instance:null},{},{deep:!1})}),N=(0,M.Z)("div",i.forwardRef)` 33 .ql-editor { 34 outline: none; 35 } 36 .ql-clipboard { 37 pointer-events: none; 38 opacity: 0; 39 } 40 ${y.p} 41 strong { 42 font-weight: 700; 43 } 44 .ql-direction-rtl { 45 direction: rtl; 46 } 47`,F=["bold","color","font","italic","size","strike","underline","indent","list","direction"],B=e=>new l(e,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:F}),H=(e,t)=>{var n=e.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+t+"<p><br></p></div>");e.setContents(n),e.history.clear()},V=({html:e,onBlur:t,onChange:n,element:r,clickCoords:a})=>{var o;let s=i.useRef(null);i.useEffect(()=>{if(!s.current)return;let r=new l(s.current,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:F});c.z(()=>{z.editor.instance=r}),window.__polotnoQuill=r,r.on("text-change",()=>{r.getSelection()&&c.z(()=>{z.currentFormat=r.getFormat(r.getSelection())}),setTimeout(()=>{var e;let t=null===(e=s.current)||void 0===e?void 0:e.childNodes[0];t&&n(D(t.innerHTML))},10)}),H(r,e),a?function(e,t){if(!e||!t)return;let{x:n,y:r}=t;try{let t=null;if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(n,r);else if(document.caretPositionFromPoint){let e=document.caretPositionFromPoint(n,r);e&&(t=document.createRange()).setStart(e.offsetNode,e.offset)}if(t){let n=l.find(t.startContainer,!0);if(n){let r=n.offset(e.scroll)+t.startOffset;return void e.setSelection(r,0,"api")}}}catch(e){}e.setSelection(0,0,"api")}(r,a):r.setSelection(0,0,"api"),r.on("selection-change",(e,t,n)=>{e&&c.z(()=>{z.currentFormat=r.getFormat(r.getSelection())})}),s.current.childNodes[0].addEventListener("blur",e=>{let n=e.relatedTarget;(null==n||!n.classList.contains("ql-clipboard"))&&(n&&n.closest(".sketch-picker")||t())});let i=s.current.childNodes[0],o=e=>{var t,n;let i=r.getSelection();if(!i||0===i.length)return;let a=r.getText(i.index,i.length).replace(/\n$/,""),o=window.getSelection(),l="";if(o&&o.rangeCount>0){let e=o.getRangeAt(0),t=document.createElement("div");t.appendChild(e.cloneContents()),l=t.innerHTML}if(null===(t=e.clipboardData)||void 0===t||t.setData("text/plain",a),l){let t='<!DOCTYPE html><html><head><meta charset="utf-8"></head><body><!--StartFragment--><div style="white-space: pre-wrap; word-wrap: break-word;">'+l+"</div><!--EndFragment--></body></html>";null===(n=e.clipboardData)||void 0===n||n.setData("text/html",t)}e.preventDefault()},u=e=>{o(e);let t=r.getSelection();t&&t.length>0&&r.deleteText(t.index,t.length)};return i.addEventListener("copy",o),i.addEventListener("cut",u),()=>{i.removeEventListener("copy",o),i.removeEventListener("cut",u),c.z(()=>{z.editor.instance=null,z.currentFormat={}}),delete window.__polotnoQuill}},[]),i.useEffect(()=>(0,c.U5)(()=>r.text,()=>{var t,n;let i=z.editor.instance;if(!i)return;let a=i.getSelection(),o=null===(n=null===(t=s.current)||void 0===t?void 0:t.childNodes)||void 0===n?void 0:n[0];D((null==o?void 0:o.innerHTML)||"")===r.text||(H(i,e),a&&(i.setSelection(a.index,a.length),c.z(()=>{z.currentFormat=i.getFormat(i.getSelection())})))},{fireImmediately:!0}),[]),i.useEffect(()=>{window.addEventListener("blur",t);let e=e=>{var n;(null===(n=s.current)||void 0===n?void 0:n.contains(e.target))||t()};return window.addEventListener("touchstart",e),()=>{window.removeEventListener("blur",t),window.removeEventListener("touchstart",e)}},[]);let u={color:r.fill};r.fill.indexOf("gradient")>=0&&(u.backgroundColor=r.fill,u.backgroundImage=r.fill,u.backgroundSize="100% 100%",u.backgroundRepeat="repeat",u.webkitBackgroun
47dClip="text",u.MozBackgroundClip="text",u.WebkitTextFillColor="transparent",u.MozTextFillColor="transparent");let d=(0,I.e)(r);return i.createElement(N,{ref:s,style:Object.assign(Object.assign({},u),{fontSize:r.fontSize,fontWeight:r.fontWeight,textTransform:r.textTransform,width:r.a.width,fontFamily:'"'+r.fontFamily+'"',lineHeight:r.lineHeight,letterSpacing:r.letterSpacing*r.fontSize+"px",textAlign:r.align,opacity:Math.max(r.a.opacity,.2),textShadow:r.shadowEnabled?`${r.shadowOffsetX}px ${r.shadowOffsetY}px ${r.shadowBlur}px ${O(r.shadowColor,null!==(o=r.shadowOpacity)&&void 0!==o?o:1)}`:void 0,caretColor:d}),dir:(0,f.XP)((0,b.av)(r.text))})},j=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),$=(0,a.Pi)(({element:e,store:t})=>{var n,r;let a=i.useRef(null),[l,m]=i.useState(),[v,y]=i.useState(!1),[C,E]=i.useState(!1),k=i.useRef(e.height),M=t.selectedShapes.indexOf(e)>=0&&e.selectable,I=(0,h.D9)(M),D=e.fontSize/3,{textVerticalResizeEnabled:z}=u.flags,F=u.flags.autoDeleteEmptyText,B=(0,h.D9)(e.fontFamily),[H]=(0,h.Av)(t,e.fontFamily,e.fontStyle,e.fontWeight,e.text||e.placeholder),$=e._editModeEnabled;(0,T.QU)(a);let U=H?e.fontFamily:B!==e.fontFamily?B:"Arial",W=(0,p.r)(e).fill,G=(0,f.E_)(e,{fontFamily:U,color:W}),q=(0,f.E_)(e,{fontFamily:U,color:W,forEditor:!0}),Z=i.useRef([]),[,X]=i.useReducer(e=>e+1,0);i.useEffect(()=>{let e=Z.current;e.length>0&&(Z.current=[],e.forEach(e=>e()))});let{width:Y,height:K}=i.useMemo(()=>
47x(G),[G,e.width,H]);i.useEffect(()=>{if(!H)return;let n=(n,r,i,a)=>{let o=(0,R.aM)(`text ${e.id}`),l=()=>{t.history.ignore(n,r,i).then(()=>{Z.current.push(o),X()})};a?queueMicrotask(l):l()};if(!e.height)return void n(()=>{e.height||e.set({height:K})},void 0,void 0,!0);let{textOverflow:r}=u.flags;if("change-font-size"!==r||v)"resize"===r&&(z&&e.height<K&&!v&&n(()=>{e.set({height:K})},!1,!0),z||e.height===K||v||n(()=>{e.set({height:K})},!1,!0));else{let t=(e=>{let t=e.fontSize;for(let n=1;n<50;n++){let n=(0,f.E_)(Object.assign(Object.assign({},e.toJSON()),{fontSize:t}),{fontFamily:e.fontFamily}),{height:r}=x(n);if(!(e.height&&r>e.height||!u.flags.textSplitAllowed&&!e.curveEnabled&&function({html:e}){let t=document.createElement("div");t.innerHTML=e,t.style.display="inline-block",t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.zIndex="1000",t.style.whiteSpace="nowrap",t.style.visibility="hidden";let n=w();n.appendChild(t);let r=t.innerText,i=t.childNodes[0];i.style.whiteSpace="nowrap";let a=(null==r?void 0:r.split(/\s+/))||[],o=!1;for(let e=0;e<a.length;e++){let n=a[e];if(i&&(i.textContent=n,o=i.scrollWidth>t.clientWidth))break}return n.removeChild(t),o}({html:n})))break;t-=.5}return t})(e);t!==e.fontSize?n(()=>{e.set({fontSize:t})},!1,!0):e.height!==K&&(z&&e.height<K?n(()=>{e.set({height:K})},!1,!0):z||n(()=>{e.set({height:K})},!1,!0))}});let J=i.useMemo(()=>{let e={lastArgs:null,lastResult:null};return async function(t){return e.lastArgs&&e.lastResult&&JSON.stringify(e.lastArgs)===JSON.stringify(t)||(e.lastResult=await S(t),e.lastArgs=Object.assign({},t)),e.lastResult}},[]),Q=i.useRef(0),ee=i.useRef(null);i.useEffect(()=>{v||$||(async()=>{Q.current++;let n=Q.current,r=(0,R.aM)(`text ${e.id} ${n}`);ee.current&&ee.current(),ee.current=r,E(!0);let i=null,a=j?5:1;for(let r=0;r<a;r++){let a=r>0?J:S;try{var o;if(i=await a({skipCache:r>0,html:G,width:e.width||1,height:e.height||K||1,fontFamily:U,padding:D,pixelRatio:t._elementsPixelRatio,font:t.fonts.find(e=>e.fontFamily===U)||g.ER.find(e=>e.fontFamily===U)}),n!==Q.current)return;if(j&&i&&(o=i,!function(e){let t=e.getContext("2d").getImageData(0,0,e.width,e.height).data;for(let e=0;e<t.length;e+=4)if(0!==t[e+3])return!0;return!1}(o))){await new Promise(e=>setTimeout(e,50*(r+1)));continue}break}catch(t){console.error(t),(0,R.TG)(`Error rendering rich text with id ${e.id}`);break}}i?m(i):r?(r(),r=null):console.error("Finish function is called twice!"),E(!1)})()},[G,v,K,$,U,e.height,t._elementsPixelRatio,H]);let[et,en]=(0,_.$)(C,300),[er]=(0,_.$)(v,300,!0),ei=er||et;i.useEffect(()=>{var t;if(!ei)return c.EH(()=>{let t=a.current;(0,d.R)(t,e)});null===(t=a.current)||void 0===t||t.clearCache()},[l,ei,e.shadowColor,e.shadowOffsetX,e.shadowOffsetY,e.shadowOpacity]),i.useEffect(()=>{l&&!C&&ee.current&&(ee.current(),ee.current=null)},[l,C]),i.useLayoutEffect(()=>{if(!H||!e.curveEnabled)return;let t=new s.Z.TextPath({data:(0,f.A5)(e.a.width,e.a.height,e.curvePower,e.a.fontSize),text:(0,b.av)(e.text),letterSpacing:e.letterSpacing*e.a.fontSize,fontSize:e.a.fontSize,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,align:"center",textBaseline:"middle",fill:e.fill}),n=t.getSelfRect().width;if(n){let t=n-e.a.width,r=e.a.rotation*Math.PI/180,i=-t/2*Math.cos(r),a=-t/2*Math.sin(r);queueMicrotask(()=>{e.set({width:n,x:e.a.x+i,y:e.a.y+a})})}t.destroy()},[H,e.curveEnabled,e.curvePower,e.text,e.fontSize,e.fontFamily,e.fontWeight,e.fontStyle,e.letterSpacing]),i.useEffect(()=>()=>{ee.current&&ee.current()},[]),i.useEffect(()=>{I&&!M&&F&&""===(0,b.av)(e.text)&&e.removable&&!e.placeholder&&t.deleteElements([e.id])},[F,e.placeholder,e.removable,e.text,M,I]);let ea=0;"middle"===e.verticalAlign&&(ea=(e.height-K)/2),"bottom"===e.verticalAlign&&(ea=e.height-K);let eo=(0,h.Dp)({fontLoaded:H,fontFamily:e.fontFamily,fontSize:e.fontSize,lineHeight:e.lineHeight}),el=(0,A.b1)(),es=(0,f.A5)(e.a.width,K,e.curvePower,e.fontSize),ec=i.useRef(null),eu=i.useRef(null),ed=$&&e.strokeWidth>0&&!e.curveEnabled;return i.createElement(i.Fragment,null,i.createElement(o.UL,{x:e.a.x,y:e.a.y,offsetX:e.backgroundPadding*(e.fontSize*eo*.5),offsetY:e.backgroundPadding*(e.fontSize*eo*.5),rotation:e.a.rotation,hideInExport:!e.showInExport,listening:!1,visible:e.backgroundEnabled,opacity:e.backgroundOpacity*e.a.opacity,fill:e.backgroundColor,width:e.a.width+e.backgroundPadding*(e.fontSize*eo),height:e.a.height+e.backgroundPadding*(e.fontSize*eo),cornerRadius:e.backgroundCornerRadius*(e.fontSize*eo*.5)}),i.createElement(o.y$,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,data:es,stroke:"red",strokeWidth:1,visible:!1}),i.createElement(o.UL,{ref:a,name:"element",x:e.a.x,y:e.a.y,listening:e.selectable,rotation:e.a.rotation,width:e.a.width,height:e.a.height,visible:!ei,draggable:el?e.draggable&&M:e.draggable,preventDefault:!el||M,opacity:$?0:e.a.opacity,hideInExport:!e.showInExport,onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>
47{e.set({x:t.target.x(),y:t.target.y()})},id:e.id,onDblClick:t=>{e.contentEditable&&(eu.current={x:t.evt.clientX,y:t.evt.clientY},e.toggleEditMode(!0))},onDblTap:t=>{var n;if(e.contentEditable){let r=null===(n=t.evt.changedTouches)||void 0===n?void 0:n[0];eu.current=r?{x:r.clientX,y:r.clientY}:null,e.toggleEditMode(!0)}},onTransformStart:t=>{y(!0),k.current=e.height},onTransform:t=>{var n;let r=t.target,i=(null===(n=r.getStage())||void 0===n?void 0:n.findOne("Transformer")).getActiveAnchor(),a=r.scaleX();if("middle-left"===i||"middle-right"===i){let t=r.scaleX(),n=r.width()*t,i=e.fontSize,a=n;n<i&&(a=i,ec.current&&r.position(ec.current)),r.width(a),r.scaleX(1),r.scaleY(1);let o=x((0,f.E_)(Object.assign(Object.assign({},e.toJSON()),{width:a}),{fontFamily:U,color:W})).height,l=u.flags.textVerticalResizeEnabled?Math.max(o,k.current):o;r.height(l),e.set({width:r.width(),height:l,x:r.x(),y:r.y()})}else if("top-center"===i||"bottom-center"===i){let n="resize"===u.flags.textOverflow,i="number"==typeof e.lineHeight?e.lineHeight:1,a=Math.max(n?K:i*e.fontSize,t.target.height()*t.target.scaleY());r.scaleY(1),e.set({x:r.x(),y:r.y(),height:a,rotation:r.rotation()})}else r.scaleX(1),r.scaleY(1),e.set({fontSize:e.fontSize*a,letterSpacing:e.letterSpacing,width:r.width()*a,x:r.x(),y:r.y(),rotation:r.rotation(),height:r.height()*a});ec.current=t.target.position()},onTransformEnd:t=>{y(!1),E(!0);let n=t.target.scaleX();t.target.scaleX(1),t.target.scaleY(1),e.set({fontSize:e.fontSize*n,width:t.target.width()*n,x:t.target.x(),y:t.target.y(),rotation:t.target.rotation(),shadowBlur:e.shadowBlur*n,shadowOffsetX:e.shadowOffsetX*n,shadowOffsetY:e.shadowOffsetY*n,strokeWidth:e.strokeWidth*n})}}),i.createElement(o.Ee,{ref:a,image:l,x:e.a.x,y:e.a.y,offsetX:D,offsetY:D-ea,listening:!1,rotation:e.a.rotation,width:e.a.width+2*D,height:(e.a.width+2*D)*((null!==(n=null==l?void 0:l.height)&&void 0!==n?n:0)/((null==l?void 0:l.width)||1)||1),visible:!ei&&!$,opacity:e.a.opacity,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,hideInExport:!e.showInExport,editModeEnabled:e._editModeEnabled||v||ei}),(ei||ed)&&i.createElement(o.ZA,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,offsetY:-ea},i.createElement(P.Vt,{divProps:{style:{pointerEvents:"none"}}},i.createElement(N,{dangerouslySetInnerHTML:{__html:G},style:{pointerEvents:"none",opacity:e.a.opacity,textShadow:e.shadowEnabled?`${e.shadowOffsetX}px ${e.shadowOffsetY}px ${e.shadowBlur}px ${O(e.shadowColor,null!==(r=e.shadowOpacity)&&void 0!==r?r:1)}`:void 0}}))),$&&i.createElement(o.ZA,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,offsetY:-ea},i.createElement(P.Vt,null,i.createElement(V,{html:q,element:e,onChange:t=>{let n=(0,L.W)({oldText:(0,b.av)(e.text),newText:(0,b.av)(t),element:e});e.set({text:t,fontSize:n})},onBlur:t=>{e.toggleEditMode(!1),en(!0)},clickCoords:eu.current}))))})},24110:function(e,t,n){"use strict";n.d(t,{hs:function(){return h},jb:function(){return d},jn:function(){return m}});var r=n(7653),i=n(2027),a=n(46666),o=n(8803),l=n(463),s=n(77922),c=n(35219),u=n(96283);function d(e){let{x:t,y:n,width:r,height:i,rotation:a}=e.a,o=a*Math.PI/180,l={x:t+i/2*Math.cos(o+Math.PI/2),y:n+i/2*Math.sin(o+Math.PI/2)};return{middleLeft:l,middleRight:{x:l.x+r*Math.cos(o),y:l.y+r*Math.sin(o)}}}function h(e,t,n){let r=Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)),i=Math.atan2(t.y-e.y,t.x-e.x);return{x:e.x+Math.cos(i-Math.PI/2)*n/2,y:e.y+Math.sin(i-Math.PI/2)*n/2,width:r,height:n,rotation:180*i/Math.PI}}let f=(e,t)=>{let n=c.jr.anchorSize||10;return{offsetX:n/2/e,offsetY:n/2/e,width:n/e,height:n/e,cornerRadius:(c.jr.anchorCornerRadius||0)/e,fill:c.jr.anchorFill||"white",stroke:c.jr.anchorStroke||"rgb(0, 161, 255)",strokeWidth:c.jr.anchorStrokeWidth||2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:e=>{e.target.getStage().container().style.cursor="crosshair"},onMouseLeave:e=>{e.target.getStage().container().style.cursor=""},onDragStart:e=>{t.history.startTransaction()},onDragEnd:e=>{t.history.endTransaction()}}},p=(0,i.Pi)(({element:e,type:t})=>{let n=(0,o.r)(e,e.a.color,"fill"),i=(0,o.r)(e,e.a.color,"stroke"),l=Object.assign(Object.assign(Object.assign({strokeWidth:e.height,lineCap:"round",lineJoin:"round"},i),n),{opacity:e.a.opacity,hideInExport:!e.showInExport});return r.createElement(r.Fragment,null,"arrow"===t&&r.createElement(a.x1,Object.assign({points:[3*e.height,-(2*e.height),0,0,3*e.height,2*e.height]},l)),"triangle"===t&&r.createElement(a.x1,Object.assign({points:[3*e.height,-(2*e.height),0,0,3*e.height,2*e.height],closed:!0},l)),"bar"===t&&r.createElement(a.x1,Object.assign({points:[0,-(2*e.height),0,2*e.height],closed:!0},l)),"square"===t&&r.createElement(a.x1,Object.assign({points:[0,-(2*e.height),4*e.height,-(2*e.height),4*e.height,2*e.height,0,2*e.height],closed:!0}
47,l)),"circle"===t&&r.createElement(a.Cd,Object.assign({x:2*e.height,y:0,radius:2*e.height},l)))}),m=(0,i.Pi)(({element:e,store:t})=>{let n=r.useRef(null),i=r.useRef(null),c=r.useRef(null),m=e.selectable||"admin"===t.role,g=(0,u.b1)(),v=t.selectedElements.indexOf(e)>=0&&1===t.selectedElements.length,b=t.selectedShapes.indexOf(e)>=0&&e.selectable,{middleLeft:y,middleRight:w}=d(e);(0,s.de)(i,[n],[v]),(0,s.de)(c,[n],[v]);let x=(0,o.r)(e,e.a.color,"stroke");return r.createElement(r.Fragment,null,r.createElement(a.x1,Object.assign({ref:n,name:"element",id:e.id,x:e.a.x,y:e.a.y,points:[0,0,e.a.width,0],offsetY:-e.a.height/2,strokeWidth:e.a.height,hitStrokeWidth:Math.max(e.a.height,20),dash:e.dash.map(t=>t*e.a.height)},x,{rotation:e.a.rotation,opacity:e.animated("opacity"),shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,listening:m,draggable:g?e.draggable&&b:e.draggable,preventDefault:!g||b,hideInExport:!e.showInExport,onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},onTransform:t=>{let n=t.target.scaleX();t.target.scaleX(1),t.target.scaleY(1),e.set({height:e.height*n,width:e.width*n,x:t.target.x(),y:t.target.y(),rotation:t.target.rotation()})}})),r.createElement(a.ZA,{x:y.x,y:y.y,rotation:e.rotation,hideInExport:!e.showInExport,onClick:e=>{var t;return null===(t=n.current)||void 0===t?void 0:t.fire("click",e)},onTap:e=>{var t;return null===(t=n.current)||void 0===t?void 0:t.fire("tap",e)}},r.createElement(p,{element:e,type:e.startHead})),r.createElement(a.ZA,{x:w.x,y:w.y,rotation:e.rotation+180,onClick:e=>{var t;return null===(t=n.current)||void 0===t?void 0:t.fire("click",e)},onTap:e=>{var t;return null===(t=n.current)||void 0===t?void 0:t.fire("tap",e)}},r.createElement(p,{element:e,type:e.endHead})),v&&e.resizable&&r.createElement(l.h_,{selector:".page-abs-container",enabled:!0},r.createElement(a.ZA,{visible:v},r.createElement(a.UL,Object.assign({x:y.x,y:y.y,ref:i,name:"line-anchor"},f(t.scale,t),{onDragMove:t=>{let n=h(t.target.position(),w,e.height);e.set({x:n.x,y:n.y,width:n.width,rotation:n.rotation})}})),r.createElement(a.UL,Object.assign({x:w.x,y:w.y,ref:c,name:"line-anchor"},f(t.scale,t),{onDragMove:t=>{let n=h(y,t.target.position(),e.height);e.set({x:n.x,y:n.y,width:n.width,rotation:n.rotation})}})))))})},35219:function(e,t,n){"use strict";n.d(t,{jr:function(){return ay},ZP:function(){return aB},Gs:function(){return aA}});var r,i,a,o,l,s,c,u,d,h,f,p,m,g,v,b,y,w,x,C,E=n(7653),k=n(2027),S=n(59533),T=n(46666),P=n(82070),M=n(8585),R=n(218),A=n(463),L=n(69389),_=n(72365),I=n(84360),O=n(43389),D=n(20873),z=n(36677),N=n(96283),F=n(83063),B=n(8803);function H(){return document.createElement("canvas")}let V=e=>e.indexOf("data:image/svg+xml")>=0||e.indexOf(".svg")>=0,j=e=>{let[t,n]=E.useState(e);return E.useEffect(()=>{(async()=>{let r=await async function(e){if(!V(e))return e;let t=await _.uh(e),n=_.tS(t);return _.XP(n)}(e);r!==t&&n(r)})()},[e]),t};function $(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}let U={boundBoxFunc:(e,t)=>t.width<5||t.height<5?e:t,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2},W={boundBoxFunc:(e,t)=>t.width<5||t.height<5?e:t,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2},G=(e,t,n)=>Math.max(t,Math.min(n,e)),q=(e,t,n,r,i=0,a=!1,o=!0)=>{let l=Math.floor(G(e.a.width*r,1,1e4)),s=Math.floor(G(e.a.height*r,1,1e4)),c=Math.min(i*r,l/2,s/2),u=Math.max(e.a.width/n.width,e.a.height/n.height)*r,d=e.page._exportingOrRendering&&I.flags.imageDownScalingEnabled&&u<1&&!a,h=0===n.x&&0===n.y&&n.width===(null==t?void 0:t.width)&&n.height===(null==t?void 0:t.height),f=E.useMemo(()=>{if(t&&t.width&&t.height)return h&&0===c&&!d?void 0:H()},[t,c,d,h]);return E.useLayoutEffect(()=>{if(!f||!t)return;(0,O.Hr)(f,l,s);let e=f.getContext("2d");if(!e)return;c&&(e.beginPath(),e.moveTo(c,0),e.lineTo(l-c,0),e.arc(l-c,c,c,3*Math.PI/2,0,!1),e.lineTo(l,s-c),e.arc(l-c,s-c,c,0,Math.PI/2,!1),e.lineTo(c,s),e.arc(c,s-c,c,Math.PI/2,Math.PI,!1),e.lineTo(0,c),e.arc(c,c,c,Math.PI,3*Math.PI/2,!1),e.clip());let r=d?function(e,t){var n,r;let i=H();i.width=e.width,i.height=e.height;let a=Math.max(1,Math.floor(i.width*t)),o=Math.max(1,Math.floor(i.height*t));null===(n=i.getContext("2d"))||void 0===n||n.drawImage(e,0,0,i.width,i.height);let l=function(e,t,n,r,i,a,o){for(var l=new ImageData(t,n),s=new Int32Array(e.data.buffer),c=e.width,u=new Int32Array(l.data.buffer),d=l.width,h=t/a,f=n/o,p=Math.round(1/h),m=
47Math.round(1/f),g=p*m,v=0;v<l.height;v++)for(var b=0;b<d;b++){for(var y=0+Math.round(b/h)+(0+Math.round(v/f))*c,w=0,x=0,C=0,E=0,k=0;k<m;k++)for(var S=0;S<p;S++){var T=s[y+S+k*c];w+=T<<24>>>24,x+=T<<16>>>24,C+=T<<8>>>24,E+=T>>>24}w=Math.round(w/g),x=Math.round(x/g),C=Math.round(C/g),E=Math.round(E/g),u[b+v*d]=E<<24|C<<16|x<<8|w}return l}(i.getContext("2d").getImageData(0,0,i.width,i.height),a,o,0,0,i.width,i.height);return i.width=a,i.height=o,null===(r=i.getContext("2d"))||void 0===r||r.putImageData(l,0,0),i}(t,u):t,i=d?{x:Math.floor(n.x*u),y:Math.floor(n.y*u),width:Math.floor(n.width*u),height:Math.floor(n.height*u)}:n;e.drawImage(r,i.x,i.y,i.width,i.height,0,0,f.width,f.height)},[f,e.a.width,e.a.height,n.x,n.y,n.width,n.height,i,r,a,e.page._exportingOrRendering,d]),E.useEffect(()=>()=>{f&&"CANVAS"===f.nodeName&&M.Z.Util.releaseCanvas(f)},[f]),f||t},Z=H(),X=(0,k.Pi)(({element:e})=>{let t=Math.min(30,e.a.width/4,e.a.height/4),n=E.useRef(null);return E.useEffect(()=>{let e=n.current;if(!e)return;let t=new M.Z.Animation(t=>{e.rotate(((null==t?void 0:t.timeDiff)||0)/2)},e.getLayer());return t.start(),()=>{t.stop()}}),E.createElement(T.ZA,{x:e.x,y:e.y,rotation:e.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},E.createElement(T.UL,{width:e.a.width,height:e.a.height,fill:"rgba(124, 173, 212, 0.8)"}),E.createElement(T.wN,{ref:n,x:e.a.width/2,y:e.a.height/2,fill:"white",outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270}))}),Y=(0,k.Pi)(({element:e})=>{let t=Math.max(10,Math.min(30,e.a.width/25));return E.createElement(T.ZA,{x:e.x,y:e.y,rotation:e.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},E.createElement(T.UL,{width:e.a.width,height:e.a.height,fill:"rgba(223, 102, 102, 0.8)"}),E.createElement(T.xv,{text:"Can not load the image...",fontSize:t,width:e.a.width,height:e.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))}),K=(e,t="",n="")=>{let r=E.useRef(),i=()=>{var e;null===(e=r.current)||void 0===e||e.call(r),r.current=void 0};E.useEffect(()=>i,[]),E.useLayoutEffect(()=>{let a=t.slice(0,200),o=`image with id ${n} url: ${a}`;"loading"!==e||r.current||(r.current=(0,L.aM)(o)),"loading"!==e&&i(),"failed"===e&&(0,L.TG)(o)},[e])},J=(0,k.Pi)(({element:e,store:t})=>{let n,r;let[i,a]=E.useState(!1),o=E.useRef(null),l=E.useRef(null),s=t.selectedShapes.indexOf(e)>=0&&e.selectable,[c,u]=(e=>{let[t,n]=E.useReducer(e=>e+1,0),r=E.useRef("loading"),i=E.useRef(e.src),a=E.useRef(e.src);a.current!==e.src&&(a.current=e.src,r.current="loading");let o=E.useMemo(()=>V(e.src)||"svg"===e.type,[e.src,e.type]);return E.useEffect(()=>{if(!o||!e.src)return;let t=!1;return(async()=>{let a;r.current="loading",n();let o=await _.uh(e.src),l=_.tS(o);a=e.colorsReplace?_.Y_(l,e.colorsReplace||new Map):_.XP(l),t||(i.current=a,r.current="loaded",n())})(),()=>{t=!0}},[e.src,JSON.stringify(e.colorsReplace)]),o?[i.current,r.current]:[e.src,"loaded"]})(e),[d,h]=P(c,"anonymous");K("svg"!==e.type||"loaded"===u?h:"loading",e.src,e.id);let f=e.page._exportingOrRendering?1:Math.max(1,t.scale),p=t._elementsPixelRatio*f,m=(({image:e,status:t,type:n})=>{let r=E.useRef();return E.useEffect(()=>{r.current=e||r.current},[e]),"failed"!==t||"failed"!==t&&"svg"===n?r.current:void 0})({image:d,status:h,type:e.type}),g=((e,t,n)=>{let r=E.useMemo(()=>{var r,i;let{flipX:a,flipY:o}=e,l="svg"===e.type||e.src.indexOf("data:image/svg+xml")>=0||e.src.indexOf(".svg")>=0,s=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,c=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||s)&&l||e.maskSrc;if(!a&&!o&&!c)return t;if(!t||!t.width||!t.height)return null;let u=H(),d=1;"svg"===e.type&&(d=Math.max(e.a.width/t.width*n,e.a.height/t.height*n)),(0,O.Hr)(u,Math.max(t.width*d,1),Math.max(t.height*d,1));let h=a?-u.width:0,f=o?-u.height:0;return null===(r=u.getContext("2d"))||void 0===r||r.scale(a?-1:1,o?-1:1),null===(i=u.getContext("2d"))||void 0===i||i.drawImage(t,h,f,u.width,u.height),u},[e.maskSrc,e.flipX,e.flipY,t,e.a.width,e.a.height,n]);return E.useEffect(()=>()=>{r&&"CANVAS"===r.nodeName&&M.Z.Util.releaseCanvas(r)},[r]),r})(e,d||m,p),v=((e,t)=>{let n=j(e.maskSrc||""),[r,i]=P(n,"anonymous");return K(n?i:"loaded",n||"",e.id),E.useMemo(()=>
47{if(!r||!t||!t.width||!t.height)return t;let n=H();n.width=Math.max(t.width,1),n.height=Math.max(t.height,1);let i=n.getContext("2d");if(!i)return t;i.drawImage(t,0,0),i.globalCompositeOperation="source-in";let a=function(e,t){let n,r;let i=t.width/t.height;return i>=e.width/e.height?(n=e.width,r=e.width/i):(n=e.height*i,r=e.height),{x:(e.width-n)/2,y:(e.height-r)/2,width:n,height:r}}(r,e);return i.drawImage(r,a.x,a.y,a.width,a.height,0,0,t.width,t.height),n},[t,r,e.a.width,e.a.height])})(e,g)||Z,{cropX:b,cropY:y,cropWidth:w,cropHeight:x}=e.a;"loaded"!==h&&(b=y=0,w=x=1);let C=v.width*w,k=v.height*x,R=e.a.width/e.a.height,L=C/k,I=e.stretchEnabled;I?(n=C,r=k):R>=L?(n=C,r=C/R):(n=k*R,r=k);let G={x:v.width*b,y:v.height*y,width:n,height:r},J=null!==(eo=e.cornerRadius)&&void 0!==eo?eo:0,Q=e.page._exportingOrRendering?1:Math.min(2,t.scale),ee=t._elementsPixelRatio*Q,et=((e,t,n,r)=>{let[i,a]=P(j(e.clipSrc||""),"anonymous");K(e.clipSrc?a:"loaded",e.clipSrc,e.id);let o=E.useMemo(()=>{if(t&&i)return H()},[t,i]);return E.useLayoutEffect(()=>{var r;if(!i||!t||!t.width||!t.height||!i||!i.width||!i.height||!o)return;let a=H(),l=Math.max(e.a.width/i.width*n,e.a.height/i.height*n);a.width=Math.max(i.width*l,1),a.height=Math.max(i.height*l,1),null===(r=a.getContext("2d"))||void 0===r||r.drawImage(i,0,0,a.width,a.height),o.width=Math.max(t.width,1),o.height=Math.max(t.height,1);let s=o.getContext("2d");s&&(s.save(),s.drawImage(a,0,0,t.width,t.height),M.Z.Util.releaseCanvas(a),s.globalCompositeOperation="source-in",s.drawImage(t,0,0,o.width,o.height),s.restore())},[o,t,i,e.a.width,e.a.height,n,...r]),e.clipSrc&&i?o:t})(e,q(e,v,G,ee,J,i||e._cropModeEnabled||"svg"===e.type,!0),ee,[G,J,ee]),en=Math.max(e.a.width/n,e.a.height/r);E.useEffect(()=>{var t;if(!e._cropModeEnabled)return;let n=null===(t=o.current)||void 0===t?void 0:t.getStage();function r(t){e._cropModeEnabled&&t.target!==l.current&&e.toggleCropMode(!1)}function i(t){e._cropModeEnabled&&t.target.parentNode!==(null==n?void 0:n.content)&&e.toggleCropMode(!1)}return document.body.addEventListener("click",i),null==n||n.on("click",r),null==n||n.on("tap",r),()=>{document.body.removeEventListener("click",i),document.body.removeEventListener("touchstart",i),null==n||n.off("click",r),null==n||n.off("click",r)}},[e._cropModeEnabled]),E.useLayoutEffect(()=>{if(!i&&!e._cropModeEnabled)return(0,D.R)(o.current,e),(0,S.EH)(()=>{(0,D.R)(o.current,e)},{delay:100})},[et,e.page._exportingOrRendering,i,w,x,e._cropModeEnabled]),E.useLayoutEffect(()=>{var t;i||e._cropModeEnabled?null===(t=o.current)||void 0===t||t.clearCache():(0,D.R)(o.current,e)},[i,e.a.width,e.a.height,e._cropModeEnabled]),E.useEffect(()=>{(0,D.R)(o.current,e)},[e.shadowEnabled,e.shadowBlur,e.cornerRadius,e.shadowColor,e.shadowOffsetX,e.shadowOffsetY,e.shadowOpacity]);let er=E.useRef(null),ei=E.useRef(null),ea=E.useRef(null);E.useLayoutEffect(()=>{e._cropModeEnabled&&(ei.current.nodes([er.current]),ea.current.nodes([l.current]))},[e._cropModeEnabled]);var eo,el=E.useRef(null),es=E.useRef(0),ec=E.useRef(!1);let eu=t=>{var i;(null===(i=t.evt.touches)||void 0===i?void 0:i.length)>2&&t.target.stopDrag(),Math.round(t.target.x())>0&&(t.target.x(0),t.target.scaleX(1)),Math.round(t.target.y())>0&&(t.target.y(0),t.target.scaleY(1));let a=t.target.width()*t.target.scaleX(),o=t.target.height()*t.target.scaleY(),l=Math.min(1,n/a),s=Math.min(1,r/o),c=Math.min(1-l,Math.max(0,Math.round(-t.target.x())/a)),u=Math.min(1-s,Math.max(0,Math.round(-t.target.y())/o));t.target.setAttrs({x:-c*v.width,y:-u*v.height,scaleX:1,scaleY:1}),e.set({cropX:c,cropY:u,cropWidth:l,cropHeight:s})},ed=()=>{"svg"!==e.type&&e.contentEditable&&(e.stretchEnabled||setTimeout(()=>{e.toggleCropMode(!0)}))}
47,eh="svg"===e.type&&m,ef="loading"===h&&!eh,[ep]=(0,F.$)(ef,100,!1,!1),em="failed"===h,eg=!ep&&!em,ev=E.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),eb=eg?e.a.opacity:0;(0,z.QU)(o,eb);let ey=e.selectable||"admin"===t.role,ew=(0,N.b1)(),ex=(0,B.r)(e,e.borderColor,"stroke");return E.createElement(E.Fragment,null,ep&&E.createElement(X,{element:e}),em&&E.createElement(Y,{element:e}),E.createElement(T.Ee,{ref:o,name:"element",id:e.id,image:et,x:e.a.x,y:e.a.y,width:e.a.width||1,height:e.a.height||1,rotation:e.a.rotation,opacity:eb,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:G,listening:ey,draggable:ew?e.draggable&&s:e.draggable,preventDefault:!ew||s,hideInExport:!e.showInExport,onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDblClick:ed,onDblTap:ed,onTransformStart:()=>{a(!0),ev.current={cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight}},onTransform:t=>{var i;let a=t.currentTarget,o=1e-7>Math.abs(a.scaleX()-1)?1:a.scaleX(),l=1e-7>Math.abs(a.scaleY()-1)?1:a.scaleY();a.scaleX(1),a.scaleY(1);let s=null===(i=t.target.getStage())||void 0===i?void 0:i.findOne("Transformer"),c=Math.min(1-n/v.width,Math.max(0,e.cropX)),u=Math.min(1-r/v.height,Math.max(0,e.cropY)),d=s.getActiveAnchor(),h=!(d.indexOf("middle")>=0||d.indexOf("center")>=0),f=!h&&o<1&&ev.current.cropHeight>r/v.height,p=h?e.cropWidth:e.cropWidth*o;f&&(p=e.cropWidth);let m=!h&&l<1&&ev.current.cropWidth>n/v.width,g=h?e.cropHeight:e.cropHeight*l;m&&(g=e.cropHeight),I&&(p=e.cropWidth,g=e.cropHeight),e.set({cropX:c,cropY:u,x:a.x(),y:a.y(),width:a.width()*o,height:a.height()*l,rotation:t.target.rotation(),cropWidth:Math.min(p,1-c),cropHeight:Math.min(g,1-u)})},onTransformEnd:t=>{let i=t.currentTarget;e.set({width:i.width(),height:i.height(),x:i.x(),y:i.y(),rotation:t.target.rotation(),cropWidth:n/v.width,cropHeight:r/v.he
47ight}),a(!1)}}),E.createElement(T.UL,Object.assign({x:e.x,y:e.y,width:Math.max(e.a.width-e.borderSize,0),height:Math.max(e.a.height-e.borderSize,0),opacity:eb,offsetX:-e.borderSize/2,offsetY:-e.borderSize/2},ex,{strokeWidth:e.borderSize,listening:!1,visible:!!e.borderSize,rotation:e.rotation,cornerRadius:Math.max(0,J-e.borderSize),hideInExport:!e.showInExport})),e._cropModeEnabled&&E.createElement(A.h_,{selector:".page-abs-container",enabled:!0},E.createElement(T.UL,{x:-window.innerWidth/t.scale,y:-window.innerWidth/t.scale,width:window.innerWidth/t.scale*3,height:window.innerWidth/t.scale*3,fill:"rgba(0,0,0,0.3)"}),E.createElement(T.Ee,{listening:!1,image:et,x:e.x,y:e.y,width:e.a.width,height:e.a.height,rotation:e.rotation,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur}),E.createElement(T.ZA,{x:e.x,y:e.y,rotation:e.rotation,scaleX:en,scaleY:en},E.createElement(T.Ee,{image:v,ref:l,opacity:.4,draggable:!0,x:-e.cropX*v.width,y:-e.cropY*v.height,onDragMove:eu,onTransform:eu,onTouchMove:e=>{e.evt.preventDefault();let t=e.target.getStage().getPointersPositions();var n=t[0],r=t[1];let i=e.target;if(n&&!r&&!i.isDragging()&&ec.current&&(i.startDrag(),ec.current=!1),n&&r){M.Z.hitOnDragEnabled=!0,i.isDragging()&&(ec.current=!0,i.stopDrag());let t=e.target.getAbsoluteTransform().copy();t.invert();var a={x:n.x,y:n.y},o={x:r.x,y:r.y};if(!el.current)return void(el.current=$(a,o));var l=$(a,o),s=Math.sqrt(Math.pow(o.x-a.x,2)+Math.pow(o.y-a.y,2));es.current||(es.current=s);let p=i.position();var c={x:l.x-p.x,y:l.y-p.y},u=s/es.current;i.scaleX(u),i.scaleY(u);let m=t.point(l),g=t.point(el.current);var d=m.x-g.x,h=m.y-g.y,f={x:Math.min(0,l.x-c.x*u+d),y:Math.min(0,l.y-c.y*u+h)};i.position(f),es.current=s,el.current=l,eu(e)}},onTouchEnd:e=>{es.current=0,el.current=null,M.Z.hitOnDragEnabled=!1}}),E.createElement(T.$T,Object.assign({ref:ea},W)),E.createElement(T.UL,{width:n,height:r,ref:er,listening:!1,onTransform:t=>{if(e.cropX<Math.abs(t.target.x()/v.width)&&0>t.target.x()&&e.cropX>0){let n=(e.cropWidth+e.cropX)*v.width;t.target.scaleX(1),t.target.width(n)}if(e.cropY<Math.abs(t.target.y()/v.height)&&0>t.target.y()&&e.cropY>0){let n=(e.cropHeight+e.cropY)*v.height;t.target.scaleY(1),t.target.height(n)}t.target.x()<-e.cropX*v.width-1e-9&&(t.target.x(-e.cropX*v.width),t.target.scaleX(1)),t.target.y()<-e.cropY*v.height-1e-9&&(t.target.y(-e.cropY*v.height),t.target.scaleY(1));let n=Math.min(1,Math.max(0,e.cropX+t.target.x()/v.width)),r=Math.min(1,Math.max(0,t.target.y()/v.height+e.cropY)),i=t.target.width()*t.target.scaleX(),a=t.target.height()*t.target.scaleY(),o=Math.min(1-n,i/v.width),l=Math.min(1-r,a/v.height),s=t.target.getAbsolutePosition(t.target.getParent().getParent());t.target.scale({x:1,y:1}),t.target.position({x:0,y:0}),e.set({x:s.x,y:s.y,cropX:n,cropY:r,cropWidth:o,cropHeight:l,width:Math.min(i*en,v.width*(1-n)*en),height:Math.min(a*en,v.height*(1-r)*en)})}}),E.createElement(T.$T,Object.assign({ref:ei},U,{visible:e.resizable})))))});var Q=n(79387),ee=n(24110);function et(e){if(!e)throw Error("Assertion failed.")}let en=e=>{let t=(e%360+360)%360;if(0===t||90===t||180===t||270===t)return t;throw Error(`Invalid rotation ${e}.`)},er=e=>e&&e[e.length-1],ei=e=>{let t=0;for(;0===e.readBits(1)&&t<32;)t++;if(t>=32)throw Error("Invalid exponential-Golomb code.");return(1<<t)-1+e.readBits(t)},ea=e=>{let t=ei(e);return(1&t)==0?-(t>>1):t+1>>1},eo=e=>e.constructor===Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e),el=e=>e.constructor===DataView?e:ArrayBuffer.isView(e)?new DataView(e.buffer,e.byteOffset,e.byteLength):new DataView(e),es=new TextDecoder,ec=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[t,e])),eu={bt709:1,bt470bg:5,smpte170m:6,bt2020:9,smpte432:12},ed=ec(eu),eh={bt709:1,smpte170m:6,linear:8,"iec61966-2-1":13,pq:16,hlg:18},ef=ec(eh),ep={rgb:0,bt709:1,bt470bg:5,smpte170m:6,"bt2020-ncl":9},em=ec(ep),eg=e=>e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer||ArrayBuffer.isView(e);class ev{constructor(){this.currentPromise=Promise.resolve(),this.pending=0}async acquire(){let e;let t=new Promise(t=>{let n=!1;e=()=>{n||(t(),this.pending--,n=!0)}}),n=this.currentPromise;return this.currentPromise=t,this.pending++,await n,e}}let eb=e=>[...e].map(e=>e.toString(16).padStart(2,"0")).join(""),ey=e=>
47(e=(e=(e=(e=(e=e>>1&1431655765|(1431655765&e)<<1)>>2&858993459|(858993459&e)<<2)>>4&252645135|(252645135&e)<<4)>>8&16711935|(16711935&e)<<8)>>16&65535|(65535&e)<<16)>>>0,ew=(e,t,n)=>{let r=0,i=e.length-1,a=-1;for(;r<=i;){let o=r+i>>1,l=n(e[o]);l===t?(a=o,i=o-1):l<t?r=o+1:i=o-1}return a},ex=(e,t,n)=>{let r=0,i=e.length-1,a=-1;for(;r<=i;){let o=r+(i-r+1)/2|0;n(e[o])<=t?(a=o,r=o+1):i=o-1}return a},eC=(e,t,n)=>{let r=ex(e,n(t),n);e.splice(r+1,0,t)},eE=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},ek=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n]))return e[n]},eS=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n]))return n;return -1},eT=async function*(e){Symbol.iterator in e?yield*e[Symbol.iterator]():yield*e[Symbol.asyncIterator]()},eP=e=>{if(!(Symbol.iterator in e)&&!(Symbol.asyncIterator in e))throw TypeError("Argument must be an iterable or async iterable.")},eM=e=>{throw Error(`Unexpected value: ${e}`)},eR=(e,t,n)=>{let r=e.getUint8(t),i=e.getUint8(t+1),a=e.getUint8(t+2);return n?r|i<<8|a<<16:r<<16|i<<8|a},eA=(e,t,n,r)=>{n>>>=0,n&=16777215,r?(e.setUint8(t,255&n),e.setUint8(t+1,n>>>8&255),e.setUint8(t+2,n>>>16&255)):(e.setUint8(t,n>>>16&255),e.setUint8(t+1,n>>>8&255),e.setUint8(t+2,255&n))},eL=(e,t)=>({async next(){let n=await e.next();return n.done?{value:void 0,done:!0}:{value:t(n.value),done:!1}},return:()=>e.return(),throw:t=>e.throw(t),[Symbol.asyncIterator](){return this}}),e_=(e,t,n)=>Math.max(t,Math.min(n,e)),eI=e=>{let t=Math.round(e);return Math.abs(e/t-1)<10*Number.EPSILON?t:e},eO=(e,t)=>Math.round(e/t)*t,eD=(e,t)=>Math.floor(e/t)*t,ez=e=>{let t=0;for(;e;)t++,e>>=1;return t},eN=/^[a-z]{3}$/,eF=e=>eN.test(e),eB=1e6*(1+Number.EPSILON),eH=(e,t)=>{let n={...e,...t};if(e.headers||t.headers){let r=e.headers?eV(e.headers):{},i=t.headers?eV(t.headers):{},a={...r};Object.entries(i).forEach(([e,t])=>{let n=Object.keys(a).find(t=>t.toLowerCase()===e.toLowerCase());n&&delete a[n],a[e]=t}),n.headers=a}return n},eV=e=>{if(e instanceof Headers){let t={};return e.forEach((e,n)=>{t[n]=e}),t}if(Array.isArray(e)){let t={};return e.forEach(([e,n])=>{t[e]=n}),t}return e},ej=async(e,t,n,r,i)=>{let a=0;for(;;)try{return await e(t,n)}catch(n){if(i())throw n;let e=r(++a,n,t);if(null===e)throw n;if(console.error("Retrying failed fetch. Error:",n),!Number.isFinite(e)||e<0)throw TypeError("Retry delay must be a non-negative finite number.");if(e>0&&await new Promise(t=>setTimeout(t,1e3*e)),i())throw n}};class e${constructor(){this.currentPromise=Promise.resolve()}call(e){return this.currentPromise=this.currentPromise.then(e)}}let eU=null,eW=()=>null!==eU?eU:eU=!!("undefined"!=typeof navigator&&(navigator.vendor?.match(/apple/i)||/AppleWebKit/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)||/\b(iPad|iPhone|iPod)\b/.test(navigator.userAgent))),eG=null,eq=()=>null!==eG?eG:eG="undefined"!=typeof navigator&&navigator.userAgent?.includes("Firefox"),eZ=null,eX=()=>null!==eZ?eZ:eZ=!!("undefined"!=typeof navigator&&(navigator.vendor?.includes("Google Inc")||/Chrome/.test(navigator.userAgent))),eY=null,eK=()=>
47{if(null!==eY)return eY;if("undefined"==typeof navigator)return null;let e=/\bChrome\/(\d+)/.exec(navigator.userAgent);return e?eY=Number(e[1]):null},eJ=(e,t)=>-1!==e?e:t,eQ=(e,t,n,r)=>e<=r&&n<=t,e0=e=>{let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n},e1=()=>{Symbol.dispose??=Symbol("Symbol.dispose")},e2=e=>"number"==typeof e&&!Number.isNaN(e),e4=e=>{et(0!==e.den);let t=Math.abs(e.num),n=Math.abs(e.den);for(;0!==n;){let e=t%n;t=n,n=e}let r=t||1;return{num:e.num/r,den:e.den/r}},e3=(e,t)=>{if("object"!=typeof e||!e)throw TypeError(`${t} must be an object.`);if(!Number.isInteger(e.left)||e.left<0)throw TypeError(`${t}.left must be a non-negative integer.`);if(!Number.isInteger(e.top)||e.top<0)throw TypeError(`${t}.top must be a non-negative integer.`);if(!Number.isInteger(e.width)||e.width<0)throw TypeError(`${t}.width must be a non-negative integer.`);if(!Number.isInteger(e.height)||e.height<0)throw TypeError(`${t}.height must be a non-negative integer.`)};n(81001);class e8{constructor(e){this.bytes=e,this.pos=0}seekToByte(e){this.pos=8*e}readBit(){let e=Math.floor(this.pos/8),t=this.bytes[e]??0,n=7-(7&this.pos);return this.pos++,(t&1<<n)>>n}readBits(e){if(1===e)return this.readBit();let t=0;for(let n=0;n<e;n++)t<<=1,t|=this.readBit();return t}writeBits(e,t){let n=this.pos+e;for(let e=this.pos;e<n;e++){let r=Math.floor(e/8),i=this.bytes[r],a=7-(7&e);i&=~(1<<a),i|=(t&1<<n-e-1)>>n-e-1<<a,this.bytes[r]=i}this.pos=n}readAlignedByte(){if(this.pos%8!=0)throw Error("Bitstream is not byte-aligned.");let e=this.pos/8,t=this.bytes[e]??0;return this.pos+=8,t}skipBits(e){this.pos+=e}getBitsLeft(){return 8*this.bytes.length-this.pos}clone(){let e=new e8(this.bytes);return e.pos=this.pos,e}}let e6=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],e5=[-1,1,2,3,4,5,6,8],e9=e=>{if(!e||e.byteLength<2)throw TypeError("AAC description must be at least 2 bytes long.");let t=new e8(e),n=t.readBits(5);31===n&&(n=32+t.readBits(6));let r=t.readBits(4),i=null;15===r?i=t.readBits(24):r<e6.length&&(i=e6[r]);let a=t.readBits(4),o=null;return a>=1&&a<=7&&(o=e5[a]),{objectType:n,frequencyIndex:r,sampleRate:i,channelConfiguration:a,numberOfChannels:o}},e7=["pcm-s16","pcm-s16be","pcm-s24","pcm-s24be","pcm-s32","pcm-s32be","pcm-f32","pcm-f32be","pcm-f64","pcm-f64be","pcm-u8","pcm-s8","ulaw","alaw"];[...e7];let te=[{maxMacroblocks:99,maxBitrate:64e3,maxDpbMbs:396,level:10},{maxMacroblocks:396,maxBitrate:192e3,maxDpbMbs:900,level:11},{maxMacroblocks:396,maxBitrate:384e3,maxDpbMbs:2376,level:12},{maxMacroblocks:396,maxBitrate:768e3,maxDpbMbs:2376,level:13},{maxMacroblocks:396,maxBitrate:2e6,maxDpbMbs:2376,level:20},{maxMacroblocks:792,maxBitrate:4e6,maxDpbMbs:4752,level:21},{maxMacroblocks:1620,maxBitrate:4e6,maxDpbMbs:8100,level:22},{maxMacroblocks:1620,maxBitrate:1e7,maxDpbMbs:8100,level:30},{maxMacroblocks:3600,maxBitrate:14e6,maxDpbMbs:18e3,level:31},{maxMacroblocks:5120,maxBitrate:2e7,maxDpbMbs:20480,level:32},{maxMacroblocks:8192,maxBitrate:2e7,maxDpbMbs:32768,level:40},{maxMacroblocks:8192,maxBitrate:5e7,maxDpbMbs:32768,level:41},{maxMacroblocks:8704,maxBitrate:5e7,maxDpbMbs:34816,level:42},{maxMacroblocks:22080,maxBitrate:135e6,maxDpbMbs:110400,level:50},{maxMacroblocks:36864,maxBitrate:24e7,maxDpbMbs:184320,level:51},{maxMacroblocks:36864,maxBitrate:24e7,maxDpbMbs:184320,level:52},{maxMacroblocks:139264,maxBitrate:24e7,maxDpbMbs:696320,level:60},{maxMacroblocks:139264,maxBitrate:48e7,maxDpbMbs:696320,level:61},{maxMacroblocks:139264,maxBitrate:8e8,maxDpbMbs:696320,level:62}],tt=[{maxPictureSize:36864,maxBitrate:2e5,level:10},{maxPictureSize:73728,maxBitrate:8e5,level:11},{maxPictureSize:122880,maxBitrate:18e5,level:20},{maxPictureSize:245760,maxBitrate:36e5,level:21},{maxPictureSize:552960,maxBitrate:72e5,level:30},{maxPictureSize:983040,maxBitrate:12e6,level:31},{maxPictureSize:2228224,maxBitrate:18e6,level:40},{maxPictureSize:2228224,maxBitrate:3e7,level:41},{maxPictureSize:8912896,maxBitrate:6e7,level:50},{maxPictureSize:8912896,maxBitrate:12e7,level:51},{maxPictureSize:8912896,maxBitrate:18e7,level:52},{maxPictureSize:35651584,maxBitrate:18e7,level:60},{maxPictureSize:35651584,maxBitrate:24e7,level:61},{maxPictureSize:35651584,maxBitrate:48e7,level:62}],tn=".01.01.01.01.00",tr=".0.110.01.01.01.0",ti=e=>{let{codec:t,codecDescription:n,colorSpace:r,avcCodecInfo:i,hevcCodecInfo:a,vp9CodecInfo:o,av1CodecInfo:l}=e;if("avc"===t){if(et(null!==e.avcType),i){let t=new Uint8Array([i.avcProfileIndication,i.profileCompatibility,i.avcLevelIndication]);return`avc${e.avcType}.${eb(t)}`}if(!n||n.byteLength<4)throw TypeError("AVC decoder description is not provided or is not at least 4 bytes long.");return`avc${e.avcType}.${eb(n.subarray(1,4))}`}if("hevc"===t){let e,t,r,i,o,l;if(a)e=a.generalProfileSpace,t=a.generalProfileIdc,r=ey(a.generalProfileCompatibilityFlags),i=a.generalTierFlag,o=a.generalLevelIdc,l=[...a.generalConstraintIndicatorFlags];else{if(!n||n.byteLength<23)throw TypeError("HEVC decoder description is not provided or is not at least 23 bytes long.");let a=el(n),s=a.getUint8(1);e=s>>6&3,t=31&s,r=ey(a.getUint32(2)),i=s>>5&1,o=a.getUint8(12),l=[];for(let e=0;e<6;e++)l.push(a.getUint8(6+e))}let s="hev1.";for(s+=["","A","B","C"][e]+t+"."+r.toString(16).toUpperCase()+"."+(0===i?"L":"H")+o;l.length>0&&0===l[l.length-1];)l.pop();return l.length>0&&(s+="."+l.map(e=>e.toString(16).toUpperCase()).join(".")),s}if("vp8"===t)return"vp8";if("vp9"===t){if(!o){let t=e.width*e.height,n=er(tt).level;for(let e of tt)if(t<=e.maxPictureSize){n=e.level;break}return`vp09.00.${n.toString().padStart(2,"0")}.08`}let t=o.profile.toString().padStart(2,"0"),n=o.level.toString().padStart(2,"0"),r=o.bitDepth.toString().padStart(2,"0"),i=o.chromaSubsampling.toString().padStart(2,"0"),a=o.colourPrimaries.toString().padStart(2,"0"),l=o.transferCharacteristics.toString().padStart(2,"0"),s=o.matrixCoefficients.toString().padStart(2,"0"),c=o.videoFullRangeFlag.toString().padStart(2,"0"),u=`vp09.${t}.${n}.${r}.${i}`;return(u+=`.${a}.${l}.${s}.${c}`).endsWith(tn)&&(u=u.slice(0,-tn.length)),u}if("av1"===t){if(!l){let t=e.width*e.height,n=er(tt).level;for(let e of tt)if(t<=e.maxPictureSize){n=e.level;break}return`av01.0.${n.toString().padStart(2,"0")}M.08`}let t=l.profile,n=l.level.toString().padStart(2,"0"),i=l.tier?"H":"M",a=l.bitDepth.toString().padStart(2,"0"),o=l.monochrome?"1":"0",s=100*l.chromaSubsamplingX+10*l.chromaSubsamplingY+1*(l.chromaSubsamplingX&&l.chromaSubsamplingY?l.chromaSamplePosition:0),c=r?.primaries?eu[r.primaries]:1,u=r?.transfer?eh[r.transfer]:1,d=r?.matrix?ep[r.matrix]:1,h=r?.fullRange?1:0,f=`av01.${t}.${n}${i}.${a}`;return(f+=`.${o}.${s.toString().padStart(3,"0")}.${c.toString().padStart(2,"0")}.${u.toString().padStart(2,"0")}.${d.toString().padStart(2,"0")}.${h}`).endsWith(tr)&&(f=f.slice(0,-tr.length)),f}throw TypeError(`Unhandled codec '${t}'.`)},ta=e=>{let{codec:t,codecDescription:n,aacCodecInfo:r}=e;if("aac"===t){if(!r)throw TypeError("AAC codec info must be provided.");if(r.isMpeg2)return"mp4a.67";{let e;return e=null!==r.objectType?r.objectType:e9(n).objectType,`mp4a.40.${e}`}}
47if("mp3"===t)return"mp3";if("opus"===t)return"opus";if("vorbis"===t)return"vorbis";if("flac"===t)return"flac";if("ac3"===t)return"ac-3";if("eac3"===t)return"ec-3";else if(t&&e7.includes(t))return t;throw TypeError(`Unhandled codec '${t}'.`)},to=/^pcm-([usf])(\d+)+(be)?$/,tl=e=>{let t;if(et(e7.includes(e)),"ulaw"===e)return{dataType:"ulaw",sampleSize:1,littleEndian:!0,silentValue:255};if("alaw"===e)return{dataType:"alaw",sampleSize:1,littleEndian:!0,silentValue:213};let n=to.exec(e);return et(n),t="u"===n[1]?"unsigned":"s"===n[1]?"signed":"float",{dataType:t,sampleSize:Number(n[2])/8,littleEndian:"be"!==n[3],silentValue:"pcm-u8"===e?128:0}},ts=[48e3,44100,32e3],tc=[24e3,22050,16e3];(r=f||(f={}))[r.NON_IDR_SLICE=1]="NON_IDR_SLICE",r[r.SLICE_DPA=2]="SLICE_DPA",r[r.SLICE_DPB=3]="SLICE_DPB",r[r.SLICE_DPC=4]="SLICE_DPC",r[r.IDR=5]="IDR",r[r.SEI=6]="SEI",r[r.SPS=7]="SPS",r[r.PPS=8]="PPS",r[r.AUD=9]="AUD",r[r.SPS_EXT=13]="SPS_EXT",(i=p||(p={}))[i.RASL_N=8]="RASL_N",i[i.RASL_R=9]="RASL_R",i[i.BLA_W_LP=16]="BLA_W_LP",i[i.RSV_IRAP_VCL23=23]="RSV_IRAP_VCL23",i[i.VPS_NUT=32]="VPS_NUT",i[i.SPS_NUT=33]="SPS_NUT",i[i.PPS_NUT=34]="PPS_NUT",i[i.AUD_NUT=35]="AUD_NUT",i[i.PREFIX_SEI_NUT=39]="PREFIX_SEI_NUT",i[i.SUFFIX_SEI_NUT=40]="SUFFIX_SEI_NUT";let tu=function*(e){let t=0,n=-1;for(;t<e.length-2;){let r=e.indexOf(0,t);if(-1===r||r>=e.length-2)break;let i=0;if((t=r)+3<e.length&&0===e[t+1]&&0===e[t+2]&&1===e[t+3]?i=4:0===e[t+1]&&1===e[t+2]&&(i=3),0===i){t++;continue}-1!==n&&t>n&&(yield{offset:n,length:t-n}),t=n=t+i}-1!==n&&n<e.length&&(yield{offset:n,length:e.length-n})},td=function*(e,t){let n=0,r=new DataView(e.buffer,e.byteOffset,e.byteLength);for(;n+t<=e.length;){let e;1===t?e=r.getUint8(n):2===t?e=r.getUint16(n,!1):3===t?e=eR(r,n,!1):(et(4===t),e=r.getUint32(n,!1)),n+=t,yield{offset:n,length:e},n+=e}},th=(e,t)=>t.description?td(e,(3&eo(t.description)[4])+1):tu(e),tf=e=>31&e,tp=e=>{let t=[],n=e.length;for(let r=0;r<n;r++)r+2<n&&0===e[r]&&0===e[r+1]&&3===e[r+2]?(t.push(0,0),r+=2):t.push(e[r]);return new Uint8Array(t)},tm=new Uint8Array([0,0,0,1]),tg=e=>{let t=new Uint8Array(e.reduce((e,t)=>e+tm.byteLength+t.byteLength,0)),n=0;for(let r of e)t.set(tm,n),n+=tm.byteLength,t.set(r,n),n+=r.byteLength;return t},tv=(e,t)=>{let n=new Uint8Array(e.reduce((e,n)=>e+t+n.byteLength,0)),r=0;for(let i of e){let e=new DataView(n.buffer,n.byteOffset,n.byteLength);switch(t){case 1:e.setUint8(r,i.byteLength);break;case 2:e.setUint16(r,i.byteLength,!1);break;case 3:eA(e,r,i.byteLength,!1);break;case 4:e.setUint32(r,i.byteLength,!1)}r+=t,n.set(i,r),r+=i.byteLength}return n},tb=(e,t)=>t.description?tv(e,(3&eo(t.description)[4])+1):tg(e),ty=e=>{try{let t=[],n=[],r=[];for(let i of tu(e)){let a=e.subarray(i.offset,i.offset+i.length),o=tf(a[0]);o===f.SPS?t.push(a):o===f.PPS?n.push(a):o===f.SPS_EXT&&r.push(a)}if(0===t.length||0===n.length)return null;let i=t[0],a=tC(i);et(null!==a);let o=100===a.profileIdc||110===a.profileIdc||122===a.profileIdc||144===a.profileIdc;return{configurationVersion:1,avcProfileIndication:a.profileIdc,profileCompatibility:a.constraintFlags,avcLevelIndication:a.levelIdc,lengthSizeMinusOne:3,sequenceParameterSets:t,pictureParameterSets:n,chromaFormat:o?a.chromaFormatIdc:null,bitDepthLumaMinus8:o?a.bitDepthLumaMinus8:null,bitDepthChromaMinus8:o?a.bitDepthChromaMinus8:null,sequenceParameterSetExt:o?r:null}}catch(e){return console.error("Error building AVC Decoder Configuration Record:",e),null}},tw=e=>{try{let t=el(e),n=0,r=t.getUint8(n++),i=t.getUint8(n++),a=t.getUint8(n++),o=t.getUint8(n++),l=3&t.getUint8(n++),s=31&t.getUint8(n++),c=[];for(let r=0;r<s;r++){let r=t.getUint16(n,!1);n+=2,c.push(e.subarray(n,n+r)),n+=r}let u=t.getUint8(n++),d=[];for(let r=0;r<u;r++){let r=t.getUint16(n,!1);n+=2,d.push(e.subarray(n,n+r)),n+=r}let h={configurationVersion:r,avcProfileIndication:i,profileCompatibility:a,avcLevelIndication:o,lengthSizeMinusOne:l,sequenceParameterSets:c,pictureParameterSets:d,chromaFormat:null,bitDepthLumaMinus8:null,bitDepthChromaMinus8:null,sequenceParameterSetExt:null};if((100===i||110===i||122===i||144===i)&&n+4<=e.length){let r=3&t.getUint8(n++),i=7&t.getUint8(n++),a=7&t.getUint8(n++),o=t.getUint8(n++);h.chromaFormat=r,h.bitDepthLumaMinus8=i,h.bitDepthChromaMinus8=a;let l=[];for(let r=0;r<o;r++){let r=t.getUint16(n,!1);n+=2,l.push(e.subarray(n,n+r)),n+=r}h.sequenceParameterSetExt=l}return h}catch(e){return console.error("Error deserializing AVC Decoder Configuration Record:",e),null}},tx={1:{num:1,den:1},2:{num:12,den:11},3:{num:10,den:11},4:{num:16,den:11},5:{num:40,den:33},6:{num:24,den:11},7:{num:20,den:11},8:{num:32,den:11},9:{num:80,den:33},10:{num:18,den:11},11:{num:15,den:11},12:{num:64,den:33},13:{num:160,den:99},14:{num:4,den:3},15:{num:3,den:2},16:{num:2,den:1}},tC=e=>{try{let t=new e8(tp(e));t.skipBits(1),t.skipBits(2);let n=t.readBits(5);if(7!==n)return null;let r=t.readAlignedByte(),i=t.readAlignedByte(),a=t.readAlignedByte();ei(t);let o=1,l=0,s=0,c=0;if((100===r||110===r||122===r||244===r||44===r||83===r||86===r||118===r||128===r)&&(o=ei(t),3===o&&(c=t.readBits(1)),l=ei(t),s=ei(t),t.skipBits(1),t.readBits(1))){for(let e=0;e<(3!==o?8:12);e++)if(t.readBits(1)){let n=e<6?16:64,r=8,i=8;for(let e=0;e<n;e++){if(0!==i){let e=ea(t);i=(r+e+256)%256}r=0===i?r:i}}}ei(t);let u=ei(t);if(0===u)ei(t);else if(1===u){t.skipBits(1),ea(t),ea(t);let e=ei(t);for(let n=0;n<e;n++)ea(t)}ei(t),t.skipBits(1);let d=ei(t),h=ei(t),f=16*(d+1),p=16*(h+1),m=f,g=p,v=t.readBits(1);if(v||t.skipBits(1),t.skipBits(1),t.readBits(1)){let e,n;let r=ei(t),i=ei(t),a=ei(t),l=ei(t),s=0===c?o:0;if(0===s)e=1,n=2-v;else{let t=3===o?1:2,r=1===o?2:1;e=t,n=r*(2-v)}m-=e*(r+i),g-=n*(a+l)}let b=2,y=2,w=2,x=0,C={num:1,den:1},E=null,k=null;if(t.readBits(1)){if(t.readBits(1)){let e=t.readBits(8);if(255===e)C={num:t.readBits(16),den:t.readBits(16)};else{let t=tx[e];t&&(C=t)}}t.readBits(1)&&t.skipBits(1),t.readBits(1)&&(t.skipBits(3),x=t.readBits(1),t.readBits(1)&&(b=t.readBits(8),y=t.readBits(8),w=t.readBits(8))),t.readBits(1)&&(ei(t),ei(t)),t.readBits(1)&&(t.skipBits(32),t.skipBits(32),t.skipBits(1));let e=t.readBits(1);e&&tE(t);let n=t.readBits(1);n&&tE(t),(e||n)&&t.skipBits(1),t.skipBits(1),t.readBits(1)&&(t.skipBits(1),ei(t),ei(t),ei(t),ei(t),E=ei(t),k=ei(t))}if(null===E){if(et(null===k),(44===r||86===r||100===r||110===r||122===r||244===r)&&16&i)E=0,k=0;else{let e=te.find(e=>e.level>=a)??er(te),t=Math.min(Math.floor(e.maxDpbMbs/((2-v)*(h+1)*(d+1))),16);E=t,k=t}}return et(null!==k),{profileIdc:r,constraintFlags:i,levelIdc:a,frameMbsOnlyFlag:v,chromaFormatIdc:o,bitDepthLumaMinus8:l,bitDepthChromaMinus8:s,codedWidth:f,codedHeight:p,displayWidth:m,displayHeight:g,pixelAspectRatio:C,colourPrimaries:b,matrixCoefficients:w,transferCharacteristics:y,fullRangeFlag:x,numReorderFrames:E,maxDecFrameBuffering:k}}catch(e){return console.error("Error parsing AVC SPS:",e),null}},tE=e=>{let t=ei(e);e.skipBits(4),e.skipBits(4);for(let n=0;n<=t;n++)ei(e),ei(e),e.skipBits(1);e.skipBits(5),e.skipBits(5),e.skipBits(5),e.skipBits(5)},tk=(e,t)=>t.description?td(e,(3&eo(t.description)[21])+1):tu(e),tS=e=>e>>1&63,tT=e=>{try{let t=new e8(tp(e));t.skipBits(16),t.readBits(4);let n=t.readBits(3),r=t.readBits(1),{general_profile_space:i,general_tier_flag:a,general_profile_idc:o,general_profile_compatibility_flags:l,general_constraint_indicator_flags:s,general_level_idc:c}=tM(t,n);ei(t);let u=ei(t),d=0;3===u&&(d=t.readBits(1));let h=ei(t),f=ei(t),p=h,m=f;if(t.readBits(1)){let e=ei(t),n=ei(t),r=ei(t),i=ei(t),a=1,o=1,l=0===d?u:0;1===l?(a=2,o=2):2===l&&(a=2,o=1),p-=(e+n)*a,m-=(r+i)*o}let g=ei(t),v=ei(t);ei(t);let b=t.readBits(1)?0:n,y=0;for(let e=b;e<=n;e++)ei(t),y=ei(t),ei(t);ei(t),ei(t),ei(t),ei(t),ei(t),ei(t),t.readBits(1)&&t.readBits(1)&&tR(t),t.skipBits(1),t.skipBits(1),t.readBits(1)&&(t.skipBits(4),t.skipBits(4),ei(t),ei(t),t.skipBits(1));let w=ei(t);if(tA(t,w),t.readBits(1)){let e=ei(t);for(let n=0;n<e;n++)ei(t),t.skipBits(1)}t.skipBits(1),t.skipBits(1);let x=2,C=2,E=2,k=0,S=0,T={num:1,den:1};if(t.readBits(1)){let e=t_(t,n);T=e.pixelAspectRatio,x=e.colourPrimaries,C=e.transferCharacteristics,E=e.matrixCoefficients,k=e.fullRangeFlag,S=e.minSpatialSegmentationIdc}return{displayWidth:p,displayHeight:m,pixelAspectRatio:T,colourPrimaries:x,transferCharacteristics:C,matrixCoefficients:E,fullRangeFlag:k,maxDecFrameBuffering:y+1,spsMaxSubLayersMinus1:n,spsTemporalIdNestingFlag:r,generalProfileSpace:i,generalTierFlag:a,generalProfileIdc:o,generalProfileCompatibilityFlags:l,generalConstraintIndicatorFlags:s,generalLevelIdc:c,chromaFormatIdc:u,bitDepthLumaMinus8:g,bitDepthChromaMinus8:v,minSpatialSegmentationIdc:S}}catch(e){return console.error("Error parsing HEVC SPS:",e),null}},tP=e=>{try{let t=[],n=[],r=[],i=[];for(let a of tu(e)){let o=e.subarray(a.offset,a.offset+a.length),l=tS(o[0]);
47l===p.VPS_NUT?t.push(o):l===p.SPS_NUT?n.push(o):l===p.PPS_NUT?r.push(o):(l===p.PREFIX_SEI_NUT||l===p.SUFFIX_SEI_NUT)&&i.push(o)}if(0===n.length||0===r.length)return null;let a=tT(n[0]);if(!a)return null;let o=0;if(r.length>0){let e=r[0],t=new e8(tp(e));t.skipBits(16),ei(t),ei(t),t.skipBits(1),t.skipBits(1),t.skipBits(3),t.skipBits(1),t.skipBits(1),ei(t),ei(t),ea(t),t.skipBits(1),t.skipBits(1),t.readBits(1)&&ei(t),ea(t),ea(t),t.skipBits(1),t.skipBits(1),t.skipBits(1),t.skipBits(1);let n=t.readBits(1),i=t.readBits(1);o=n||i?n&&!i?2:!n&&i?3:0:0}let l=[...t.length?[{arrayCompleteness:1,nalUnitType:p.VPS_NUT,nalUnits:t}]:[],...n.length?[{arrayCompleteness:1,nalUnitType:p.SPS_NUT,nalUnits:n}]:[],...r.length?[{arrayCompleteness:1,nalUnitType:p.PPS_NUT,nalUnits:r}]:[],...i.length?[{arrayCompleteness:1,nalUnitType:tS(i[0][0]),nalUnits:i}]:[]];return{configurationVersion:1,generalProfileSpace:a.generalProfileSpace,generalTierFlag:a.generalTierFlag,generalProfileIdc:a.generalProfileIdc,generalProfileCompatibilityFlags:a.generalProfileCompatibilityFlags,generalConstraintIndicatorFlags:a.generalConstraintIndicatorFlags,generalLevelIdc:a.generalLevelIdc,minSpatialSegmentationIdc:a.minSpatialSegmentationIdc,parallelismType:o,chromaFormatIdc:a.chromaFormatIdc,bitDepthLumaMinus8:a.bitDepthLumaMinus8,bitDepthChromaMinus8:a.bitDepthChromaMinus8,avgFrameRate:0,constantFrameRate:0,numTemporalLayers:a.spsMaxSubLayersMinus1+1,temporalIdNested:a.spsTemporalIdNestingFlag,lengthSizeMinusOne:3,arrays:l}}catch(e){return console.error("Error building HEVC Decoder Configuration Record:",e),null}},tM=(e,t)=>{let n=e.readBits(2),r=e.readBits(1),i=e.readBits(5),a=0;for(let t=0;t<32;t++)a=a<<1|e.readBits(1);let o=new Uint8Array(6);for(let t=0;t<6;t++)o[t]=e.readBits(8);let l=e.readBits(8),s=[],c=[];for(let n=0;n<t;n++)s.push(e.readBits(1)),c.push(e.readBits(1));if(t>0)for(let n=t;n<8;n++)e.skipBits(2);for(let n=0;n<t;n++)s[n]&&e.skipBits(88),c[n]&&e.skipBits(8);return{general_profile_space:n,general_tier_flag:r,general_profile_idc:i,general_profile_compatibility_flags:a,general_constraint_indicator_flags:o,general_level_idc:l}},tR=e=>{for(let t=0;t<4;t++)for(let n=0;n<(3===t?2:6);n++)if(e.readBits(1)){let n=Math.min(64,1<<4+(t<<1));t>1&&ea(e);for(let t=0;t<n;t++)ea(e)}else ei(e)},tA=(e,t)=>{let n=[];for(let r=0;r<t;r++)n[r]=tL(e,r,t,n)},tL=(e,t,n,r)=>{let i=0,a=0,o=0;if(0!==t&&(a=e.readBits(1)),a){o=t===n?t-(ei(e)+1):t-1,e.readBits(1),ei(e);let a=r[o]??0;for(let t=0;t<=a;t++)e.readBits(1)||e.readBits(1);i=r[o]}else{let t=ei(e),n=ei(e);for(let n=0;n<t;n++)ei(e),e.readBits(1);for(let t=0;t<n;t++)ei(e),e.readBits(1);i=t+n}return i},t_=(e,t)=>{let n=2,r=2,i=2,a=0,o=0,l={num:1,den:1};if(e.readBits(1)){let t=e.readBits(8);if(255===t)l={num:e.readBits(16),den:e.readBits(16)};else{let e=tx[t];e&&(l=e)}}return e.readBits(1)&&e.readBits(1),e.readBits(1)&&(e.readBits(3),a=e.readBits(1),e.readBits(1)&&(n=e.readBits(8),r=e.readBits(8),i=e.readBits(8))),e.readBits(1)&&(ei(e),ei(e)),e.readBits(1),e.readBits(1),e.readBits(1),e.readBits(1)&&(ei(e),ei(e),ei(e),ei(e)),e.readBits(1)&&(e.readBits(32),e.readBits(32),e.readBits(1)&&ei(e),e.readBits(1)&&tI(e,!0,t)),e.readBits(1)&&(e.readBits(1),e.readBits(1),e.readBits(1),o=ei(e),ei(e),ei(e),ei(e),ei(e)),{pixelAspectRatio:l,colourPrimaries:n,transferCharacteristics:r,matrixCoefficients:i,fullRangeFlag:a,minSpatialSegmentationIdc:o}},tI=(e,t,n)=>{let r=!1,i=!1,a=!1;t&&(r=1===e.readBits(1),i=1===e.readBits(1),(r||i)&&((a=1===e.readBits(1))&&(e.readBits(8),e.readBits(5),e.readBits(1),e.readBits(5)),e.readBits(4),e.readBits(4),a&&e.readBits(4),e.readBits(5),e.readBits(5),e.readBits(5)));for(let t=0;t<=n;t++){let t=1===e.readBits(1),n=!0;t||(n=1===e.readBits(1));let o=!1;n?ei(e):o=1===e.readBits(1);let l=1;o||(l=ei(e)+1),r&&tO(e,l,a),i&&tO(e,l,a)}},tO=(e,t,n)=>{for(let r=0;r<t;r++)ei(e),ei(e),n&&(ei(e),ei(e)),e.readBits(1)},tD=e=>{let t=new e8(e);if(2!==t.readBits(2))return null;let n=t.readBits(1),r=(t.readBits(1)<<1)+n;if(3===r&&t.skipBits(1),1===t.readBits(1)||0!==t.readBits(1)||(t.skipBits(2),4817730!==t.readBits(24)))return null;let i=8;r>=2&&(i=t.readBits(1)?12:10);let a=t.readBits(3),o=0,l=0;if(7!==a){if(l=t.readBits(1),1===r||3===r){let e=t.readBits(1),n=t.readBits(1);o=e||n?e&&!n?2:1:3,t.skipBits(1)}else o=1}else o=3,l=1;let s=(t.readBits(16)+1)*(t.readBits(16)+1),c=er(tt).level;for(let e of tt)if(s<=e.maxPictureSize){c=e.level;break}return{profile:r,level:c,bitDepth:i,chromaSubsampling:o,videoFullRangeFlag:l,colourPrimaries:2===a?1:1===a?6:2,transferCharacteristics:2===a?1:1===a?6:2,matrixCoefficients:7===a?0:2===a?1:1===a?6:2}},tz=function*(e){let t=new e8(e),n=()=>{let e=0;for(let n=0;n<8;n++){let r=t.readAlignedByte();if(e|=(127&r)<<7*n,!(128&r))break;if(7===n&&128&r)return null}return e>=4294967296-1?null:e};for(;t.getBitsLeft()>=8;){let r;t.skipBits(1);let i=t.readBits(4),a=t.readBits(1),o=t.readBits(1);if(t.skipBits(1),a&&t.skipBits(8),o){let e=n();if(null===e)return;r=e}else r=Math.floor(t.getBitsLeft()/8);et(t.pos%8==0),yield{type:i,data:e.subarray(t.pos/8,t.pos/8+r)},t.skipBits(8*r)}},tN=e=>{for(let{type:t,data:n}of tz(e)){if(1!==t)continue;let e=new e8(n),r=e.readBits(3);e.readBits(1);let i=e.readBits(1),a=0,o=0,l=0;if(i)a=e.readBits(5);else{if(e.readBits(1)&&(e.skipBits(32),e.skipBits(32),e.readBits(1)))return null;let t=e.readBits(1);t&&(l=e.readBits(5),e.skipBits(32),e.skipBits(5),e.skipBits(5));let n=e.readBits(5);for(let r=0;r<=n;r++){e.skipBits(12);let n=e.readBits(5);if(0===r&&(a=n),n>7){let t=e.readBits(1);0===r&&(o=t)}if(t&&e.readBits(1)){let t=l+1;e.skipBits(t),e.skipBits(t),e.skipBits(1)}e.readBits(1)&&e.skipBits(4)}}let s=e.readBits(4),c=e.readBits(4),u=s+1;e.skipBits(u);let d=c+1;e.skipBits(d);if((i?0:e.readBits(1))&&(e.skipBits(4),e.skipBits(3)),e.skipBits(1),e.skipBits(1),e.skipBits(1),!i){e.skipBits(1),e.skipBits(1),e.skipBits(1),e.skipBits(1);let t=e.readBits(1);t&&(e.skipBits(1),e.skipBits(1));let n=e.readBits(1);(n?2:e.readBits(1))>0&&!e.readBits(1)&&e.skipBits(1),t&&e.skipBits(3)}e.skipBits(1),e.skipBits(1),e.skipBits(1);let h=e.readBits(1),f=8;2===r&&h?f=e.readBits(1)?12:10:r<=2&&(f=h?10:8);let p=0;1!==r&&(p=e.readBits(1));let m=1,g=1,v=0;return!p&&(0===r?(m=1,g=1):1===r?(m=0,g=0):12===f&&(m=e.readBits(1))&&(g=e.readBits(1)),m&&g&&(v=e.readBits(2))),{profile:r,level:a,tier:o,bitDepth:f,monochrome:p,chromaSubsamplingX:m,chromaSubsamplingY:g,chromaSamplePosition:v}}return null},tF=e=>{let t=el(e),n=t.getUint8(9),r=t.getUint16(10,!0),i=t.getUint32(12,!0),a=t.getInt16(16,!0),o=t.getUint8(18),l=null;return o&&(l=e.subarray(19,21+n)),{outputChannelCount:n,preSkip:r,inputSampleRate:i,outputGain:a,channelMappingFamily:o,channelMappingTable:l}},tB=[480,960,1920,2880,480,960,1920,2880,480,960,1920,2880,480,960,480,960,120,240,480,960,120,240,480,960,120,240,480,960,120,240,480,960],tH=e=>({durationInSamples:tB[e[0]>>3]}),tV=e=>{if(e.length<7)throw Error("Setup header is too short.");if(5!==e[0])throw Error("Wrong packet type in Setup header.");if("vorbis"!==String.fromCharCode(...e.slice(1,7)))throw Error("Invalid packet signature in Setup header.");let t=e.length,n=new Uint8Array(t);for(let r=0;r<t;r++)n[r]=e[t-1-r];let r=new e8(n),i=0;for(;r.getBitsLeft()>97;)if(1===r.readBits(1)){i=r.pos;break}if(0===i)throw Error("Invalid Setup header: framing bit not found.");let a=0,o=!1,l=0;for(;r.getBitsLeft()>=97;){let e=r.pos,t=r.readBits(8),n=r.readBits(16),i=r.readBits(16);if(t>63||0!==n||0!==i){r.pos=e;break}if(r.skipBits(1),++a>64)break;r.clone().readBits(6)+1===a&&(o=!0,l=a)}if(!o)throw Error("Invalid Setup header: mode header not found.");if(l>63)throw Error(`Unsupported mode count: ${l}.`);let s=l;
47r.pos=0,r.skipBits(i);let c=Array(s).fill(0);for(let e=s-1;e>=0;e--)r.skipBits(40),c[e]=r.readBits(1);return{modeBlockflags:c}},tj=(e,t,n)=>{switch(e){case"avc":for(let e of th(n,t)){let t=tf(n[e.offset]);if(t>=f.NON_IDR_SLICE&&t<=f.SLICE_DPC)break;if(t===f.IDR)return"key";if(t===f.SEI&&(!eX()||eK()>=144)){let t=tp(n.subarray(e.offset,e.offset+e.length)),r=1;do{let e=0;for(;;){let n=t[r++];if(void 0===n||(e+=n,n<255))break}let n=0;for(;;){let e=t[r++];if(void 0===e||(n+=e,e<255))break}if(6===e){let e=new e8(t);e.pos=8*r;let n=ei(e),i=e.readBits(1);if(0===n&&1===i)return"key"}r+=n}while(r<t.length-1)}}return"delta";case"hevc":for(let e of tk(n,t)){let t=tS(n[e.offset]);if(t<p.BLA_W_LP)break;if(t<=p.RSV_IRAP_VCL23)return"key"}return"delta";case"vp8":return 0==(1&n[0])?"key":"delta";case"vp9":{let e=new e8(n);if(2!==e.readBits(2))return null;let t=e.readBits(1);if(3===(e.readBits(1)<<1)+t&&e.skipBits(1),e.readBits(1))return null;return 0===e.readBits(1)?"key":"delta"}case"av1":{let e=!1;for(let{type:t,data:r}of tz(n))if(1===t){let t=new e8(r);t.skipBits(4),e=!!t.readBits(1)}else if(3===t||6===t||7===t){if(e)return"key";let t=new e8(r);if(t.readBits(1))return null;return 0===t.readBits(2)?"key":"delta"}return null}default:eM(e),et(!1)}};(a=m||(m={}))[a.STREAMINFO=0]="STREAMINFO",a[a.VORBIS_COMMENT=4]="VORBIS_COMMENT",a[a.PICTURE=6]="PICTURE";let t$=(e,t)=>{let n=el(e),r=0,i=n.getUint32(r,!0);r+=4;let a=es.decode(e.subarray(r,r+i));r+=i,i>0&&(t.raw??={},t.raw.vendor??=a);let o=n.getUint32(r,!0);r+=4;for(let i=0;i<o;i++){let i=n.getUint32(r,!0);r+=4;let a=es.decode(e.subarray(r,r+i));r+=i;let o=a.indexOf("=");if(-1===o)continue;let l=a.slice(0,o).toUpperCase(),s=a.slice(o+1);switch(t.raw??={},t.raw[l]??=s,l){case"TITLE":t.title??=s;break;case"DESCRIPTION":t.description??=s;break;case"ARTIST":t.artist??=s;break;case"ALBUM":t.album??=s;break;case"ALBUMARTIST":t.albumArtist??=s;break;case"COMMENT":t.comment??=s;break;case"LYRICS":t.lyrics??=s;break;case"TRACKNUMBER":{let e=s.split("/"),n=Number.parseInt(e[0],10),r=e[1]&&Number.parseInt(e[1],10);Number.isInteger(n)&&n>0&&(t.trackNumber??=n),r&&Number.isInteger(r)&&r>0&&(t.tracksTotal??=r)}break;case"TRACKTOTAL":{let e=Number.parseInt(s,10);Number.isInteger(e)&&e>0&&(t.tracksTotal??=e)}break;case"DISCNUMBER":{let e=s.split("/"),n=Number.parseInt(e[0],10),r=e[1]&&Number.parseInt(e[1],10);Number.isInteger(n)&&n>0&&(t.discNumber??=n),r&&Number.isInteger(r)&&r>0&&(t.discsTotal??=r)}break;case"DISCTOTAL":{let e=Number.parseInt(s,10);Number.isInteger(e)&&e>0&&(t.discsTotal??=e)}break;case"DATE":{let e=new Date(s);Number.isNaN(e.getTime())||(t.date??=e)}break;case"GENRE":t.genre??=s;break;case"METADATA_BLOCK_PICTURE":{let e=e0(s),n=el(e),r=n.getUint32(0,!1),i=n.getUint32(4,!1),a=String.fromCharCode(...e.subarray(8,8+i)),o=n.getUint32(8+i,!1),l=es.decode(e.subarray(12+i,12+i+o)),c=n.getUint32(i+o+28),u=e.subarray(i+o+32,i+o+32+c);t.images??=[],t.images.push({data:u,mimeType:a,kind:3===r?"coverFront":4===r?"coverBack":"unknown",name:void 0,description:l||void 0})}}}},tU=[2,1,2,3,3,4,4,5],tW=e=>{if(e.length<7||11!==e[0]||119!==e[1])return null;let t=new e8(e);t.skipBits(16),t.skipBits(16);let n=t.readBits(2);if(3===n)return null;let r=t.readBits(6),i=t.readBits(5);if(i>8)return null;let a=t.readBits(3),o=t.readBits(3);return(1&o)!=0&&1!==o&&t.skipBits(2),(4&o)!=0&&t.skipBits(2),2===o&&t.skipBits(2),{fscod:n,bsid:i,bsmod:a,acmod:o,lfeon:t.readBits(1),bitRateCode:Math.floor(r/2)}},tG=[128,138,192,128,140,192,160,174,240,160,176,240,192,208,288,192,210,288,224,242,336,224,244,336,256,278,384,256,280,384,320,348,480,320,350,480,384,416,576,384,418,576,448,486,672,448,488,672,512,556,768,512,558,768,640,696,960,640,698,960,768,834,1152,768,836,1152,896,974,1344,896,976,1344,1024,1114,1536,1024,1116,1536,1280,1392,1920,1280,1394,1920,1536,1670,2304,1536,1672,2304,1792,1950,2688,1792,1952,2688,2048,2228,3072,2048,2230,3072,2304,2506,3456,2304,2508,3456,2560,2786,3840,2560,2788,3840];new Uint8Array([5,4,65,67,45,51]),new Uint8Array([5,4,69,65,67,51]);let tq=[1,2,3,6],tZ=e=>{let t;if(e.length<6||11!==e[0]||119!==e[1])return null;let n=new e8(e);n.skipBits(16);let r=n.readBits(2);if(n.skipBits(3),0!==r&&2!==r)return null;let i=n.readBits(11),a=n.readBits(2),o=0;3===a?(o=n.readBits(2),t=3):t=n.readBits(2);let l=n.readBits(3),s=n.readBits(1),c=n.readBits(5);
47if(c<11||c>16)return null;let u=tq[t];return{dataRate:Math.round((i+1)*(a<3?ts[a]/1e3:tc[o]/1e3)/(16*u)),substreams:[{fscod:a,fscod2:o,bsid:c,bsmod:0,acmod:l,lfeon:s,numDepSub:0,chanLoc:0}]}},tX=e=>{if(e.length<2)return null;let t=new e8(e),n=t.readBits(13),r=t.readBits(3),i=[];for(let n=0;n<=r&&!(Math.ceil(t.pos/8)+3>e.length);n++){let e=t.readBits(2),n=t.readBits(5);t.skipBits(1),t.skipBits(1);let r=t.readBits(3),a=t.readBits(3),o=t.readBits(1);t.skipBits(3);let l=t.readBits(4),s=0;l>0?s=t.readBits(9):t.skipBits(1),i.push({fscod:e,fscod2:null,bsid:n,bsmod:r,acmod:a,lfeon:o,numDepSub:l,chanLoc:s})}return 0===i.length?null:{dataRate:n,substreams:i}},tY=e=>{let t=e.substreams[0];return(et(t),t.fscod<3)?ts[t.fscod]:null!==t.fscod2&&t.fscod2<3?tc[t.fscod2]:null},tK=e=>{let t=e.substreams[0];et(t);let n=tU[t.acmod]+t.lfeon;if(t.numDepSub>0){let e=[2,2,1,1,2,2,2,1,1];for(let r=0;r<9;r++)t.chanLoc&1<<8-r&&(n+=e[r])}return n};class tJ{constructor(e){this.input=e}}let tQ=[],t0=[],t1=new Uint8Array(0);class t2{constructor(e,t,n,r,i=-1,a,o){if(this.data=e,this.type=t,this.timestamp=n,this.duration=r,this.sequenceNumber=i,e===t1&&void 0===a)throw Error("Internal error: byteLength must be explicitly provided when constructing metadata-only packets.");if(void 0===a&&(a=e.byteLength),!(e instanceof Uint8Array))throw TypeError("data must be a Uint8Array.");if("key"!==t&&"delta"!==t)throw TypeError('type must be either "key" or "delta".');if(!Number.isFinite(n))throw TypeError("timestamp must be a number.");if(!Number.isFinite(r)||r<0)throw TypeError("duration must be a non-negative number.");if(!Number.isFinite(i))throw TypeError("sequenceNumber must be a number.");if(!Number.isInteger(a)||a<0)throw TypeError("byteLength must be a non-negative integer.");if(void 0!==o&&("object"!=typeof o||!o))throw TypeError("sideData, when provided, must be an object.");if(o?.alpha!==void 0&&!(o.alpha instanceof Uint8Array))throw TypeError("sideData.alpha, when provided, must be a Uint8Array.");if(o?.alphaByteLength!==void 0&&(!Number.isInteger(o.alphaByteLength)||o.alphaByteLength<0))throw TypeError("sideData.alphaByteLength, when provided, must be a non-negative integer.");this.byteLength=a,this.sideData=o??{},this.sideData.alpha&&void 0===this.sideData.alphaByteLength&&(this.sideData.alphaByteLength=this.sideData.alpha.byteLength)}get isMetadataOnly(){return this.data===t1}get microsecondTimestamp(){return Math.trunc(eB*this.timestamp)}get microsecondDuration(){return Math.trunc(eB*this.duration)}toEncodedVideoChunk(){if(this.isMetadataOnly)throw TypeError("Metadata-only packets cannot be converted to a video chunk.");if("undefined"==typeof EncodedVideoChunk)throw Error("Your browser does not support EncodedVideoChunk.");
47return new EncodedVideoChunk({data:this.data,type:this.type,timestamp:this.microsecondTimestamp,duration:this.microsecondDuration})}alphaToEncodedVideoChunk(e=this.type){if(!this.sideData.alpha)throw TypeError("This packet does not contain alpha side data.");if(this.isMetadataOnly)throw TypeError("Metadata-only packets cannot be converted to a video chunk.");if("undefined"==typeof EncodedVideoChunk)throw Error("Your browser does not support EncodedVideoChunk.");return new EncodedVideoChunk({data:this.sideData.alpha,type:e,timestamp:this.microsecondTimestamp,duration:this.microsecondDuration})}toEncodedAudioChunk(){if(this.isMetadataOnly)throw TypeError("Metadata-only packets cannot be converted to an audio chunk.");if("undefined"==typeof EncodedAudioChunk)throw Error("Your browser does not support EncodedAudioChunk.");return new EncodedAudioChunk({data:this.data,type:this.type,timestamp:this.microsecondTimestamp,duration:this.microsecondDuration})}static fromEncodedChunk(e,t){if(!(e instanceof EncodedVideoChunk||e instanceof EncodedAudioChunk))throw TypeError("chunk must be an EncodedVideoChunk or EncodedAudioChunk.");let n=new Uint8Array(e.byteLength);return e.copyTo(n),new t2(n,e.type,e.timestamp/1e6,(e.duration??0)/1e6,void 0,void 0,t)}clone(e){if(void 0!==e&&("object"!=typeof e||null===e))throw TypeError("options, when provided, must be an object.");if(e?.data!==void 0&&!(e.data instanceof Uint8Array))throw TypeError("options.data, when provided, must be a Uint8Array.");if(e?.type!==void 0&&"key"!==e.type&&"delta"!==e.type)throw TypeError('options.type, when provided, must be either "key" or "delta".');if(e?.timestamp!==void 0&&!Number.isFinite(e.timestamp))throw TypeError("options.timestamp, when provided, must be a number.");if(e?.duration!==void 0&&!Number.isFinite(e.duration))throw TypeError("options.duration, when provided, must be a number.");if(e?.sequenceNumber!==void 0&&!Number.isFinite(e.sequenceNumber))throw TypeError("options.sequenceNumber, when provided, must be a number.");if(e?.sideData!==void 0&&("object"!=typeof e.sideData||null===e.sideData))throw TypeError("options.sideData, when provided, must be an object.");return new t2(e?.data??this.data,e?.type??this.type,e?.timestamp??this.timestamp,e?.duration??this.duration,e?.sequenceNumber??this.sequenceNumber,this.byteLength,e?.sideData??this.sideData)}}e1();let t4=-1/0,t3=-1/0,t8=null;"undefined"!=typeof FinalizationRegistry&&(t8=new FinalizationRegistry(e=>{let t=Date.now();"video"===e.type?(t-t4>=1e3&&(console.error("A VideoSample was garbage collected without first being closed. For proper resource management, make sure to call close() on all your VideoSamples as soon as you're done using them."),t4=t),"undefined"!=typeof VideoFrame&&e.data instanceof VideoFrame&&e.data.close()):(t-t3>=1e3&&(console.error("An AudioSample was garbage collected without first being closed. For proper resource management, make sure to call close() on all your AudioSamples as soon as you're done using them."),t3=t),"undefined"!=typeof AudioData&&e.data instanceof AudioData&&e.data.close())}));let t6=["I420","I420P10","I420P12","I420A","I420AP10","I420AP12","I422","I422P10","I422P12","I422A","I422AP10","I422AP12","I444","I444P10","I444P12","I444A","I444AP10","I444AP12","NV12","RGBA","RGBX","BGRA","BGRX"],t5=new Set(t6);class t9{get codedWidth(){return this.visibleRect.width}get codedHeight(){return this.visibleRect.height}get displayWidth(){return this.rotation%180==0?this.squarePixelWidth:this.squarePixelHeight}get displayHeight(){return this.rotation%180==0?this.squarePixelHeight:this.squarePixelWidth}get microsecondTimestamp(){return Math.trunc(eB*this.timestamp)}get microsecondDuration(){return Math.trunc(eB*this.duration)}get hasAlpha(){return this.format&&this.format.includes("A")}constructor(e,t){if(this._closed=!1,e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer||ArrayBuffer.isView(e)){if(!t||"object"!=typeof t)throw TypeError("init must be an object.");if(void 0===t.format||!t5.has(t.format))throw TypeError("init.format must be one of: "+t6.join(", "));if(!Number.isInteger(t.codedWidth)||t.codedWidth<=0)throw TypeError("init.codedWidth must be a positive integer.");if(!Number.isInteger(t.codedHeight)||t.codedHeight<=0)throw TypeError("init.codedHeight must be a positive integer.");if(void 0!==t.rotation&&![0,90,180,270].includes(t.rotation))throw TypeError("init.rotation, when provided, must be 0, 90, 180, or 270.");
47if(!Number.isFinite(t.timestamp))throw TypeError("init.timestamp must be a number.");if(void 0!==t.duration&&(!Number.isFinite(t.duration)||t.duration<0))throw TypeError("init.duration, when provided, must be a non-negative number.");if(void 0!==t.layout){if(!Array.isArray(t.layout))throw TypeError("init.layout, when provided, must be an array.");for(let e of t.layout){if(!e||"object"!=typeof e||Array.isArray(e))throw TypeError("Each entry in init.layout must be an object.");if(!Number.isInteger(e.offset)||e.offset<0)throw TypeError("plane.offset must be a non-negative integer.");if(!Number.isInteger(e.stride)||e.stride<0)throw TypeError("plane.stride must be a non-negative integer.")}}if(void 0!==t.visibleRect&&e3(t.visibleRect,"init.visibleRect"),void 0!==t.displayWidth&&(!Number.isInteger(t.displayWidth)||t.displayWidth<=0))throw TypeError("init.displayWidth, when provided, must be a positive integer.");if(void 0!==t.displayHeight&&(!Number.isInteger(t.displayHeight)||t.displayHeight<=0))throw TypeError("init.displayHeight, when provided, must be a positive integer.");if(void 0!==t.displayWidth!=(void 0!==t.displayHeight))throw TypeError("init.displayWidth and init.displayHeight must be either both provided or both omitted.");this._data=eo(e).slice(),this._layout=t.layout??ni(t.format,t.codedWidth,t.codedHeight),this.format=t.format,this.rotation=t.rotation??0,this.timestamp=t.timestamp,this.duration=t.duration??0,this.colorSpace=new t7(t.colorSpace),this.visibleRect={left:t.visibleRect?.left??0,top:t.visibleRect?.top??0,width:t.visibleRect?.width??t.codedWidth,height:t.visibleRect?.height??t.codedHeight},void 0!==t.displayWidth?(this.squarePixelWidth=this.rotation%180==0?t.displayWidth:t.displayHeight,this.squarePixelHeight=this.rotation%180==0?t.displayHeight:t.displayWidth):(this.squarePixelWidth=this.codedWidth,this.squarePixelHeight=this.codedHeight)}else if("undefined"!=typeof VideoFrame&&e instanceof VideoFrame){if(t?.rotation!==void 0&&![0,90,180,270].includes(t.rotation))throw TypeError("init.rotation, when provided, must be 0, 90, 180, or 270.");if(t?.timestamp!==void 0&&!Number.isFinite(t?.timestamp))throw TypeError("init.timestamp, when provided, must be a number.");if(t?.duration!==void 0&&(!Number.isFinite(t.duration)||t.duration<0))throw TypeError("init.duration, when provided, must be a non-negative number.");t?.visibleRect!==void 0&&e3(t.visibleRect,"init.visibleRect"),this._data=e,this._layout=null,this.format=e.format,this.visibleRect={left:e.visibleRect?.x??0,top:e.visibleRect?.y??0,width:e.visibleRect?.width??e.codedWidth,height:e.visibleRect?.height??e.codedHeight},this.rotation=t?.rotation??0,this.squarePixelWidth=e.displayWidth,this.squarePixelHeight=e.displayHeight,this.timestamp=t?.timestamp??e.timestamp/1e6,this.duration=t?.duration??(e.duration??0)/1e6,this.colorSpace=new t7(e.colorSpace)}else if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof SVGImageElement&&e instanceof SVGImageElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas){if(!t||"object"!=typeof t)throw TypeError("init must be an object.");if(void 0!==t.rotation&&![0,90,180,270].includes(t.rotation))throw TypeError("init.rotation, when provided, must be 0, 90, 180, or 270.");if(!Number.isFinite(t.timestamp))throw TypeError("init.timestamp must be a number.");if(void 0!==t.duration&&(!Number.isFinite(t.duration)||t.duration<0))throw TypeError("init.duration, when provided, must be a non-negative number.");if("undefined"!=typeof VideoFrame)return new t9(new VideoFrame(e,{timestamp:Math.trunc(t.timestamp*eB),duration:Math.trunc((t.duration??0)*eB)||void 0}),t);let n=0,r=0;if("naturalWidth"in e?(n=e.naturalWidth,r=e.naturalHeight):"videoWidth"in e?(n=e.videoWidth,r=e.videoHeight):"width"in e&&(n=Number(e.width),r=Number(e.height)),!n||!r)throw TypeError("Could not determine dimensions.");let i=new OffscreenCanvas(n,r),a=i.getContext("2d",{alpha:eq(),willReadFrequently:!0});et(a),a.drawImage(e,0,0),this._data=i,this._layout=null,this.format="RGBX",this.visibleRect={left:0,top:0,width:n,height:r},this.squarePixelWidth=n,this.squarePixelHeight=r,this.rotation=t.rotation??0,this.timestamp=t.timestamp,this.duration=t.duration??0,this.colorSpace
47=new t7({matrix:"rgb",primaries:"bt709",transfer:"iec61966-2-1",fullRange:!0})}else throw TypeError("Invalid data type: Must be a BufferSource or CanvasImageSource.");this.pixelAspectRatio=e4({num:this.squarePixelWidth*this.codedHeight,den:this.squarePixelHeight*this.codedWidth}),t8?.register(this,{type:"video",data:this._data},this)}clone(){if(this._closed)throw Error("VideoSample is closed.");return(et(null!==this._data),ne(this._data))?new t9(this._data.clone(),{timestamp:this.timestamp,duration:this.duration,rotation:this.rotation}):this._data instanceof Uint8Array?(et(this._layout),new t9(this._data,{format:this.format,layout:this._layout,codedWidth:this.codedWidth,codedHeight:this.codedHeight,timestamp:this.timestamp,duration:this.duration,colorSpace:this.colorSpace,rotation:this.rotation,visibleRect:this.visibleRect,displayWidth:this.displayWidth,displayHeight:this.displayHeight})):new t9(this._data,{format:this.format,codedWidth:this.codedWidth,codedHeight:this.codedHeight,timestamp:this.timestamp,duration:this.duration,colorSpace:this.colorSpace,rotation:this.rotation,visibleRect:this.visibleRect,displayWidth:this.displayWidth,displayHeight:this.displayHeight})}close(){this._closed||(t8?.unregister(this),ne(this._data)?this._data.close():this._data=null,this._closed=!0)}allocationSize(e={}){if(nr(e),this._closed)throw Error("VideoSample is closed.");if(null===this.format)throw Error("Cannot get allocation size when format is null. Sorry!");if(et(null!==this._data),!ne(this._data)&&(e.colorSpace||e.format&&e.format!==this.format||e.layout||e.rect)){let t=this.toVideoFrame(),n=t.allocationSize(e);return t.close(),n}return ne(this._data)?this._data.allocationSize(e):this._data instanceof Uint8Array?this._data.byteLength:this.codedWidth*this.codedHeight*4}async copyTo(e,t={}){if(!eg(e))throw TypeError("destination must be an ArrayBuffer or an ArrayBuffer view.");if(nr(t),this._closed)throw Error("VideoSample is closed.");if(null===this.format)throw Error("Cannot copy video sample data when format is null. Sorry!");if(et(null!==this._data),!ne(this._data)&&(t.colorSpace||t.format&&t.format!==this.format||t.layout||t.rect)){let n=this.toVideoFrame(),r=await n.copyTo(e,t);return n.close(),r}if(ne(this._data))return this._data.copyTo(e,t);if(this._data instanceof Uint8Array)return et(this._layout),eo(e).set(this._data),this._layout;{let t=this._data.getContext("2d");et(t);let n=t.getImageData(0,0,this.codedWidth,this.codedHeight);return eo(e).set(n.data),[{offset:0,stride:4*this.codedWidth}]}}toVideoFrame(){if(this._closed)throw Error("VideoSample is closed.");return(et(null!==this._data),ne(this._data))?new VideoFrame(this._data,{timestamp:this.microsecondTimestamp,duration:this.microsecondDuration||void 0}):this._data instanceof Uint8Array?new VideoFrame(this._data,{format:this.format,codedWidth:this.codedWidth,codedHeight:this.codedHeight,timestamp:this.microsecondTimestamp,duration:this.microsecondDuration||void 0,colorSpace:this.colorSpace}):new VideoFrame(this._data,{timestamp:this.microsecondTimestamp,duration:this.microsecondDuration||void 0})}draw(e,t,n,r,i,a,o,l,s){let c=0,u=0,d=this.displayWidth,h=this.displayHeight,f=0,p=0,m=this.displayWidth,g=this.displayHeight;if(void 0!==a?(c=t,u=n,d=r,h=i,f=a,p=o,void 0!==l?(m=l,g=s):(m=d,g=h)):(f=t,p=n,void 0!==r&&(m=r,g=i)),!("undefined"!=typeof CanvasRenderingContext2D&&e instanceof CanvasRenderingContext2D||"undefined"!=typeof OffscreenCanvasRenderingContext2D&&e instanceof OffscreenCanvasRenderingContext2D))throw TypeError("context must be a CanvasRenderingContext2D or OffscreenCanvasRenderingContext2D.");if(!Number.isFinite(c))throw TypeError("sx must be a number.");if(!Number.isFinite(u))throw TypeError("sy must be a number.");if(!Number.isFinite(d)||d<0)throw TypeError("sWidth must be a non-negative number.");if(!Number.isFinite(h)||h<0)throw TypeError("sHeight must be a non-negative number.");if(!Number.isFinite(f))throw TypeError("dx must be a number.");if(!Number.isFinite(p))throw TypeError("dy must be a number.");if(!Number.isFinite(m)||m<0)throw TypeError("dWidth must be a non-negative number.");if(!Number.isFinite(g)||g<0)throw TypeError("dHeight must be a non-negative number.");if(this._closed)throw Error("VideoSample is closed.");({sx:c,sy:u,sWidth:d,sHeight:h}=this._rotateSourceRegion(c,u,d,h,this.rotation));let v=this.toCanvasImageSource();e.save();let b=f+m/2,y=p+g/2;e.translate(b,y),e.rotate(this.rotation*Math.PI/180);let w=this.rotation%180==0?1:m/g;
47e.scale(1/w,w),e.drawImage(v,c,u,d,h,-m/2,-g/2,m,g),e.restore()}drawWithFit(e,t){let n,r,i,a;if(!("undefined"!=typeof CanvasRenderingContext2D&&e instanceof CanvasRenderingContext2D||"undefined"!=typeof OffscreenCanvasRenderingContext2D&&e instanceof OffscreenCanvasRenderingContext2D))throw TypeError("context must be a CanvasRenderingContext2D or OffscreenCanvasRenderingContext2D.");if(!t||"object"!=typeof t)throw TypeError("options must be an object.");if(!["fill","contain","cover"].includes(t.fit))throw TypeError("options.fit must be 'fill', 'contain', or 'cover'.");if(void 0!==t.rotation&&![0,90,180,270].includes(t.rotation))throw TypeError("options.rotation, when provided, must be 0, 90, 180, or 270.");void 0!==t.crop&&nn(t.crop,"options.");let o=e.canvas.width,l=e.canvas.height,s=t.rotation??this.rotation,[c,u]=s%180==0?[this.squarePixelWidth,this.squarePixelHeight]:[this.squarePixelHeight,this.squarePixelWidth];t.crop&&nt(t.crop,c,u);let{sx:d,sy:h,sWidth:f,sHeight:p}=this._rotateSourceRegion(t.crop?.left??0,t.crop?.top??0,t.crop?.width??c,t.crop?.height??u,s);if("fill"===t.fit)n=0,r=0,i=o,a=l;else{let[e,s]=t.crop?[t.crop.width,t.crop.height]:[c,u],d="contain"===t.fit?Math.min(o/e,l/s):Math.max(o/e,l/s);i=e*d,a=s*d,n=(o-i)/2,r=(l-a)/2}e.save();let m=s%180==0?1:i/a;e.translate(o/2,l/2),e.rotate(s*Math.PI/180),e.scale(1/m,m),e.translate(-o/2,-l/2),e.drawImage(this.toCanvasImageSource(),d,h,f,p,n,r,i,a),e.restore()}_rotateSourceRegion(e,t,n,r,i){return 90===i?[e,t,n,r]=[t,this.squarePixelHeight-e-n,r,n]:180===i?[e,t]=[this.squarePixelWidth-e-n,this.squarePixelHeight-t-r]:270===i&&([e,t,n,r]=[this.squarePixelWidth-t-r,e,r,n]),{sx:e,sy:t,sWidth:n,sHeight:r}}toCanvasImageSource(){if(this._closed)throw Error("VideoSample is closed.");if(et(null!==this._data),!(this._data instanceof Uint8Array))return this._data;{let e=this.toVideoFrame();return queueMicrotask(()=>e.close()),e}}setRotation(e){if(![0,90,180,270].includes(e))throw TypeError("newRotation must be 0, 90, 180, or 270.");this.rotation=e}setTimestamp(e){if(!Number.isFinite(e))throw TypeError("newTimestamp must be a number.");this.timestamp=e}setDuration(e){if(!Number.isFinite(e)||e<0)throw TypeError("newDuration must be a non-negative number.");this.duration=e}[Symbol.dispose](){this.close()}}class t7{constructor(e){if(void 0!==e){if(!e||"object"!=typeof e)throw TypeError("init.colorSpace, when provided, must be an object.");let t=Object.keys(eu);if(null!=e.primaries&&!t.includes(e.primaries))throw TypeError(`init.colorSpace.primaries, when provided, must be one of ${t.join(", ")}.`);let n=Object.keys(eh);if(null!=e.transfer&&!n.includes(e.transfer))throw TypeError(`init.colorSpace.transfer, when provided, must be one of ${n.join(", ")}.`);let r=Object.keys(ep);if(null!=e.matrix&&!r.includes(e.matrix))throw TypeError(`init.colorSpace.matrix, when provided, must be one of ${r.join(", ")}.`);if(null!=e.fullRange&&"boolean"!=typeof e.fullRange)throw TypeError("init.colorSpace.fullRange, when provided, must be a boolean.")}this.primaries=e?.primaries??null,this.transfer=e?.transfer??null,this.matrix=e?.matrix??null,this.fullRange=e?.fullRange??null}toJSON(){return{primaries:this.primaries,transfer:this.transfer,matrix:this.matrix,fullRange:this.fullRange}}}let ne=e=>"undefined"!=typeof VideoFrame&&e instanceof VideoFrame,nt=(e,t,n)=>{e.left=Math.min(e.left,t),e.top=Math.min(e.top,n),e.width=Math.min(e.width,t-e.left),e.height=Math.min(e.height,n-e.top),et(e.width>=0),et(e.height>=0)},nn=(e,t)=>{if(!e||"object"!=typeof e)throw TypeError(t+"crop, when provided, must be an object.");if(!Number.isInteger(e.left)||e.left<0)throw TypeError(t+"crop.left must be a non-negative integer.");if(!Number.isInteger(e.top)||e.top<0)throw TypeError(t+"crop.top must be a non-negative integer.");if(!Number.isInteger(e.width)||e.width<0)throw TypeError(t+"crop.width must be a non-negative integer.");if(!Number.isInteger(e.height)||e.height<0)throw TypeError(t+"crop.height must be a non-negative integer.")},nr=e=>{if(!e||"object"!=typeof e)throw TypeError("options must be an object.");if(void 0!==e.colorSpace&&!["display-p3","srgb"].includes(e.colorSpace))throw TypeError("options.colorSpace, when provided, must be 'dis
47play-p3' or 'srgb'.");if(void 0!==e.format&&"string"!=typeof e.format)throw TypeError("options.format, when provided, must be a string.");if(void 0!==e.layout){if(!Array.isArray(e.layout))throw TypeError("options.layout, when provided, must be an array.");for(let t of e.layout){if(!t||"object"!=typeof t)throw TypeError("Each entry in options.layout must be an object.");if(!Number.isInteger(t.offset)||t.offset<0)throw TypeError("plane.offset must be a non-negative integer.");if(!Number.isInteger(t.stride)||t.stride<0)throw TypeError("plane.stride must be a non-negative integer.")}}if(void 0!==e.rect){if(!e.rect||"object"!=typeof e.rect)throw TypeError("options.rect, when provided, must be an object.");if(void 0!==e.rect.x&&(!Number.isInteger(e.rect.x)||e.rect.x<0))throw TypeError("options.rect.x, when provided, must be a non-negative integer.");if(void 0!==e.rect.y&&(!Number.isInteger(e.rect.y)||e.rect.y<0))throw TypeError("options.rect.y, when provided, must be a non-negative integer.");if(void 0!==e.rect.width&&(!Number.isInteger(e.rect.width)||e.rect.width<0))throw TypeError("options.rect.width, when provided, must be a non-negative integer.");if(void 0!==e.rect.height&&(!Number.isInteger(e.rect.height)||e.rect.height<0))throw TypeError("options.rect.height, when provided, must be a non-negative integer.")}},ni=(e,t,n)=>{let r=na(e),i=[],a=0;for(let e of r){let r=Math.ceil(t/e.widthDivisor),o=Math.ceil(n/e.heightDivisor),l=r*e.sampleBytes,s=l*o;i.push({offset:a,stride:l}),a+=s}return i},na=e=>{let t=(e,t,n,r,i)=>{let a=[{sampleBytes:e,widthDivisor:1,heightDivisor:1},{sampleBytes:t,widthDivisor:n,heightDivisor:r},{sampleBytes:t,widthDivisor:n,heightDivisor:r}];return i&&a.push({sampleBytes:e,widthDivisor:1,heightDivisor:1}),a};switch(e){case"I420":return t(1,1,2,2,!1);case"I420P10":case"I420P12":return t(2,2,2,2,!1);case"I420A":return t(1,1,2,2,!0);case"I420AP10":case"I420AP12":return t(2,2,2,2,!0);case"I422":return t(1,1,2,1,!1);case"I422P10":case"I422P12":return t(2,2,2,1,!1);case"I422A":return t(1,1,2,1,!0);case"I422AP10":case"I422AP12":return t(2,2,2,1,!0);case"I444":return t(1,1,1,1,!1);case"I444P10":case"I444P12":return t(2,2,1,1,!1);case"I444A":return t(1,1,1,1,!0);case"I444AP10":case"I444AP12":return t(2,2,1,1,!0);case"NV12":return[{sampleBytes:1,widthDivisor:1,heightDivisor:1},{sampleBytes:2,widthDivisor:2,heightDivisor:2}];case"RGBA":case"RGBX":case"BGRA":case"BGRX":return[{sampleBytes:4,widthDivisor:1,heightDivisor:1}];default:eM(e),et(!1)}},no=new Set(["f32","f32-planar","s16","s16-planar","s32","s32-planar","u8","u8-planar"]);class nl{get microsecondTimestamp(){return Math.trunc(eB*this.timestamp)}get microsecondDuration(){return Math.trunc(eB*this.duration)}constructor(e){if(this._closed=!1,nh(e)){if(null===e.format)throw TypeError("AudioData with null format is not supported.");this._data=e,this.format=e.format,this.sampleRate=e.sampleRate,this.numberOfFrames=e.numberOfFrames,this.numberOfChannels=e.numberOfChannels,this.timestamp=e.timestamp/1e6,this.duration=e.numberOfFrames/e.sampleRate}else{let t;if(!e||"object"!=typeof e)throw TypeError("Invalid AudioDataInit: must be an object.");if(!no.has(e.format))throw TypeError("Invalid AudioDataInit: invalid format.");if(!Number.isFinite(e.sampleRate)||e.sampleRate<=0)throw TypeError("Invalid AudioDataInit: sampleRate must be > 0.");if(!Number.isInteger(e.numberOfChannels)||0===e.numberOfChannels)throw TypeError("Invalid AudioDataInit: numberOfChannels must be an integer > 0.");if(!Number.isFinite(e?.timestamp))throw TypeError("init.timestamp must be a number.");let n=e.data.byteLength/(ns(e.format)*e.numberOfChannels);if(!Number.isInteger(n))throw TypeError("Invalid AudioDataInit: data size is not a multiple of frame size.");if(this.format=e.format,this.sampleRate=e.sampleRate,this.numberOfFrames=n,this.numberOfChannels=e.numberOfChannels,this.timestamp=e.timestamp,this.duration=n/e.sampleRate,e.data instanceof ArrayBuffer)t=new Uint8Array(e.data);else if(ArrayBuffer.isView(e.data))t=new Uint8Array(e.data.buffer,e.data.byteOffset,e.data.byteLength);else throw TypeError("Invalid AudioDataInit: data is not a BufferSource.");let r=this.numberOfFrames*this.numberOfChannels*ns(this.format);if(t.byteLength<r)throw TypeError("Invalid AudioDataInit: insufficient data size.");this._data=t}t8?.register(this,{type:"audio",data:this._data},this)}allocationSize(e){if(!e||"object"!=typeof e)throw TypeError("options must be an object.");if(!Number.isInteger(e.planeIndex)||e.planeIndex<0)throw TypeError("planeIndex must be a non-negative integer.");if(void 0!==e.format&&!no.has(e.format))throw TypeError("Invalid format.");if(void 0!==e.frameOffset&&(!Number.isInteger(e.frameOffset)||e.frameOffset<0))throw TypeError("frameOffset must be a non-negative integer.");if(void 0!==e.frameCount&&(!Number.isInteger(e.frameCount)||e.frameCount<0))throw TypeError("frameCount must be a non-negative integer.");if(this._closed)throw Error("AudioSample is closed.");let t=e.format??this.format,n=e.frameOffset??0;if(n>=this.numberOfFrames)throw RangeError("frameOffset out of range");let r=void 0!==e.frameCount?e.frameCount:this.numberOfFrames-n;if(r>this.numberOfFrames-n)throw RangeError("frameCount out of range");let i=ns(t),a=nc(t);if(a&&e.planeIndex>=this.numberOfChannels||!a&&0!==e.planeIndex)throw RangeError("planeIndex out of range");return(a?r:r*this.numberOfChannels)*i}copyTo(e,t){if(!eg(e))throw TypeError("destination must be an ArrayBuffer or an ArrayBuffer view.");if(!t||"object"!=typeof t)throw TypeError("options must be an object.");if(!Number.isInteger(t.planeIndex)||t.planeIndex<0)throw TypeError("planeIndex must be a non-negative integer.");if(void 0!==t.format&&!no.has(t.format))throw TypeError("Invalid format.");if(void 0!==t.frameOffset&&(!Number.isInteger(t.frameOffset)||t.frameOffset<0))throw TypeError("frameOffset must be a non-negative integer.");if(void 0!==t.frameCount&&(!Number.isInteger(t.frameCount)||t.frameCount<0))throw TypeError("frameCount must be a non-negative integer.");if(this._closed)throw Error("AudioSample is closed.");let{planeIndex:n,format:r,frameCount:i,frameOffset:a}=t,o=this.format,l=r??this.format;if(!l)throw Error("Destination format not determined");let s=this.numberOfFrames,c=this.numberOfChannels,u=a??0;if(u>=s)throw RangeError("frameOffset out of range");let d=void 0!==i?i:s-u;if(d>s-u)throw RangeError("frameCount out of range");let h=ns(l),f=nc(l);if(f&&n>=c||!f&&0!==n)throw RangeError("planeIndex out of range");let p=f?d:d*c;if(e.byteLength<p*h)throw RangeError("Destination buffer is too small");let m=el(e),g=nd(l);if(nh(this._data))eW()&&c>2&&l!==o?nf(this._data,m,o,l,c,n,u,d):this._data.copyTo(e,{planeIndex:n,frameOffset:u,frameCount:d,format:l});else{let e=el(this._data),t=nu(o),r=ns(o),i=nc(o);for(let a=0;a<d;a++)if(f)g(m,a*h,t(e,i?(n*s+(a+u))*r:((a+u)*c+n)*r));else for(let n=0;n<c;n++)g(m,(a*c+n)*h,t(e,i?(n*s+(a+u))*r:((a+u)*c+n)*r))}}clone(){if(this._closed)throw Error("AudioSample is closed.");if(!nh(this._data))return new nl({format:this.format,sampleRate:this.sampleRate,numberOfFrames:this.numberOfFrames,numberOfChannels:this.numberOfChannels,timestamp:this.timestamp,data:this._data});{let e=new nl(this._data.clone());return e.setTimestamp(this.timestamp),e}}close(){this._closed||(t8?.unregister(this),nh(this._data)?this._data.close():this._data=new Uint8Array(0),this._closed=!0)}toAudioData(){if(this._closed)throw Error("AudioSample is closed.");if(!nh(this._data))return new AudioData({format:this.format,sampleRate:this.sampleRate,numberOfFrames:this.numberOfFrames,numberOfChannels:this.numberOfChannels,timestamp:this.microsecondTimestamp,data:this._data.buffer instanceof ArrayBuffer?this._data.buffer:this._data.slice()});if(this._data.timestamp===this.microsecondTimestamp)return this._data.clone();if(nc(this.format)){let e=this.allocationSize({planeIndex:0,format:this.format}),t=new ArrayBuffer(e*this.numberOfChannels);for(let n=0;n<this.numberOfChannels;n++)this.copyTo(new Uint8Array(t,n*e,e),{planeIndex:n,format:this.format});return new AudioData({format:this.format,sampleRate:this.sampleRate,numberOfFrames:this.numberOfFrames,numberOfChannels:this.numberOfChannels,timestamp:this.microsecondTimestamp,data:t})}{let e=new ArrayBuffer(this.allocationSize({planeIndex:0,format:this.format}));return this.copyTo(e,{planeIndex:0,format:this.format}),new AudioData({format:this.format,sampleRate:this.sampleRate,numberOfFrames:this.numberOfFrames,numberOfChannels:this.numberOfChannels,timestamp:this.microsecondTimestamp,data:e})}}toAudioBuffer(){if(this._closed)throw Error("AudioSample is closed.");let e=new AudioBuffer({numberOfChannels:this.numberOfChannels,length:this.numberOfFrames,sampleRate:this.sampleRate}),t=new Float32Array(this.allocationSize({planeIndex:0,format:"f32-planar"})/4);for(let n=0;n<this.numberOfChannels;n++)this.copyTo(t,{planeIndex:n,format:"f32-planar"}
47),e.copyToChannel(t,n);return e}setTimestamp(e){if(!Number.isFinite(e))throw TypeError("newTimestamp must be a number.");this.timestamp=e}[Symbol.dispose](){this.close()}static*_fromAudioBuffer(e,t){if(!(e instanceof AudioBuffer))throw TypeError("audioBuffer must be an AudioBuffer.");let n=e.numberOfChannels,r=e.sampleRate,i=e.length,a=Math.floor(24e4/n),o=0,l=i;for(;l>0;){let i=Math.min(a,l),s=new Float32Array(n*i);for(let t=0;t<n;t++)e.copyFromChannel(s.subarray(t*i,(t+1)*i),t,o);yield new nl({format:"f32-planar",sampleRate:r,numberOfFrames:i,numberOfChannels:n,timestamp:t+o/r,data:s}),o+=i,l-=i}}static fromAudioBuffer(e,t){if(!(e instanceof AudioBuffer))throw TypeError("audioBuffer must be an AudioBuffer.");let n=e.numberOfChannels,r=e.sampleRate,i=e.length,a=Math.floor(24e4/n),o=0,l=i,s=[];for(;l>0;){let i=Math.min(a,l),c=new Float32Array(n*i);for(let t=0;t<n;t++)e.copyFromChannel(c.subarray(t*i,(t+1)*i),t,o);let u=new nl({format:"f32-planar",sampleRate:r,numberOfFrames:i,numberOfChannels:n,timestamp:t+o/r,data:c});s.push(u),o+=i,l-=i}return s}}let ns=e=>{switch(e){case"u8":case"u8-planar":return 1;case"s16":case"s16-planar":return 2;case"s32":case"s32-planar":case"f32":case"f32-planar":return 4;default:throw Error("Unknown AudioSampleFormat")}},nc=e=>{switch(e){case"u8-planar":case"s16-planar":case"s32-planar":case"f32-planar":return!0;default:return!1}},nu=e=>{switch(e){case"u8":case"u8-planar":return(e,t)=>(e.getUint8(t)-128)/128;case"s16":case"s16-planar":return(e,t)=>e.getInt16(t,!0)/32768;case"s32":case"s32-planar":return(e,t)=>e.getInt32(t,!0)/2147483648;case"f32":case"f32-planar":return(e,t)=>e.getFloat32(t,!0)}},nd=e=>{switch(e){case"u8":case"u8-planar":return(e,t,n)=>e.setUint8(t,e_((n+1)*127.5,0,255));case"s16":case"s16-planar":return(e,t,n)=>e.setInt16(t,e_(Math.round(32767*n),-32768,32767),!0);case"s32":case"s32-planar":return(e,t,n)=>e.setInt32(t,e_(Math.round(2147483647*n),-2147483648,2147483647),!0);case"f32":case"f32-planar":return(e,t,n)=>e.setFloat32(t,n,!0)}},nh=e=>"undefined"!=typeof AudioData&&e instanceof AudioData,nf=(e,t,n,r,i,a,o,l)=>{let s=nu(n),c=nd(r),u=ns(n),d=ns(r),h=nc(n);if(nc(r)){if(h){let r=new ArrayBuffer(l*u),i=el(r);e.copyTo(r,{planeIndex:a,frameOffset:o,frameCount:l,format:n});for(let e=0;e<l;e++){let n=e*u;c(t,e*d,s(i,n))}}else{let r=new ArrayBuffer(l*i*u),h=el(r);e.copyTo(r,{planeIndex:0,frameOffset:o,frameCount:l,format:n});for(let e=0;e<l;e++){let n=(e*i+a)*u;c(t,e*d,s(h,n))}}}else if(h){let r=new ArrayBuffer(l*u),a=el(r);for(let h=0;h<i;h++){e.copyTo(r,{planeIndex:h,frameOffset:o,frameCount:l,format:n});for(let e=0;e<l;e++){let n=e*u;c(t,(e*i+h)*d,s(a,n))}}}else{let r=new ArrayBuffer(l*i*u),a=el(r);e.copyTo(r,{planeIndex:0,frameOffset:o,frameCount:l,format:n});for(let e=0;e<l;e++)for(let n=0;n<i;n++){let r=e*i+n,o=r*u;c(t,r*d,s(a,o))}}},np=e=>{if(!e||"object"!=typeof e)throw TypeError("options must be an object.");if(void 0!==e.metadataOnly&&"boolean"!=typeof e.metadataOnly)throw TypeError("options.metadataOnly, when defined, must be a boolean.");if(void 0!==e.verifyKeyPackets&&"boolean"!=typeof e.verifyKeyPackets)throw TypeError("options.verifyKeyPackets, when defined, must be a boolean.");if(e.verifyKeyPackets&&e.metadataOnly)throw TypeError("options.verifyKeyPackets and options.metadataOnly cannot be enabled together.")},nm=e=>{if(!e2(e))throw TypeError("timestamp must be a number.")},ng=(e,t,n)=>n.verifyKeyPackets?t.then(async t=>{if(!t||"delta"===t.type)return t;let n=await e.determinePacketType(t);return n&&(t.type=n),t}):t;class nv{constructor(e){if(!(e instanceof nS))throw TypeError("track must be an InputTrack.");this._track=e}getFirstPacket(e={}){if(np(e),this._track.input._disposed)throw new iF;return ng(this._track,this._track._backing.getFirstPacket(e),e)}async getFirstKeyPacket(e={}){np(e);let t=await this.getFirstPacket(e);return t?"key"===t.type?t:this.getNextKeyPacket(t,e):null}getPacket(e,t={}){if(nm(e),np(t),this._track.input._disposed)throw new iF;return ng(this._track,this._track._backing.getPacket(e,t),t)}getNextPacket(e,t={}){if(!(e instanceof t2))throw TypeError("packet must be an EncodedPacket.");if(np(t),this._track.input._disposed)throw new iF;return ng(this._track,this._track._backing.getNextPacket(e,t),t)}async getKeyPacket(e,t={}){if(nm(e),np(t),this._track.input._disposed)throw new iF;if(!t.verifyKeyPackets)return this._track._backing.getKeyPacket(e,t);let n=await this._track._backing.getKeyPacket(e,t);return n&&(et("key"===n.type),"delta"===await this._track.determinePacketType(n))?this.getKeyPacket(n.timestamp-1/this._track.timeResolution,t):n}async getNextKeyPacket(e,t={}){if(!(e instanceof t2))throw TypeError("packet must be an EncodedPacket.");if(np(t),this._track.input._disposed)throw new iF;if(!t.verifyKeyPackets)return this._track._backing.getNextKeyPacket(e,t);let n=await this._track._backing.getNextKeyPacket(e,t);return n&&(et("key"===n.type),"delta"===await this._track.determinePacketType(n))?this.getNextKeyPacket(n,t):n}packets(e,t,n={}){if(void 0!==e&&!(e instanceof t2))throw TypeError("startPacket must be an EncodedPacket.");if(void 0!==e&&e.isMetadataOnly&&!n?.metadataOnly)throw TypeError("startPacket can only be metadata-only if options.metadataOnly is enabled.");
47if(void 0!==t&&!(t instanceof t2))throw TypeError("endPacket must be an EncodedPacket.");if(np(n),this._track.input._disposed)throw new iF;let r=[],{promise:i,resolve:a}=eE(),{promise:o,resolve:l}=eE(),s=!1,c=!1,u=null,d=[],h=()=>Math.max(2,d.length);(async()=>{let u=e??await this.getFirstPacket(n);for(;u&&!c&&!this._track.input._disposed&&!(t&&u.sequenceNumber>=t?.sequenceNumber);){if(r.length>h()){({promise:o,resolve:l}=eE()),await o;continue}r.push(u),a(),({promise:i,resolve:a}=eE()),u=await this.getNextPacket(u,n)}s=!0,a()})().catch(e=>{u||(u=e,a())});let f=this._track;return{async next(){for(;;){if(f.input._disposed)throw new iF;if(c)return{value:void 0,done:!0};if(u)throw u;if(r.length>0){let e=r.shift(),t=performance.now();for(d.push(t);d.length>0&&t-d[0]>=1e3;)d.shift();return l(),{value:e,done:!1}}else{if(s)return{value:void 0,done:!0};await i}}},return:async()=>(c=!0,l(),a(),{value:void 0,done:!0}),async throw(e){throw e},[Symbol.asyncIterator](){return this}}}}class nb{constructor(e,t){this.onSample=e,this.onError=t}}class ny{mediaSamplesInRange(e=0,t=1/0){nm(e),nm(t);let n=[],r=!1,i=null,{promise:a,resolve:o}=eE(),{promise:l,resolve:s}=eE(),c=!1,u=!1,d=!1,h=null;(async()=>{let f=await this._createDecoder(l=>{if(s(),l.timestamp>=t&&(u=!0),u){l.close();return}i&&(l.timestamp>e?(n.push(i),r=!0):i.close()),l.timestamp>=e&&(n.push(l),r=!0),i=r?null:l,n.length>0&&(o(),{promise:a,resolve:o}=eE())},e=>{h||(h=e,o())}),p=this._createPacketSink(),m=await p.getKeyPacket(e,{verifyKeyPackets:!0})??await p.getFirstKeyPacket({verifyKeyPackets:!0}),g=m,v=p.packets(m??void 0,void 0);for(await v.next();g&&!u&&!this._track.input._disposed;){let e=nw(n.length);if(n.length+f.getDecodeQueueSize()>e){({promise:l,resolve:s}=eE()),await l;continue}f.decode(g);let t=await v.next();if(t.done)break;g=t.value}await v.return(),d||this._track.input._disposed||await f.flush(),f.close(),!r&&i&&n.push(i),c=!0,o()})().catch(e=>{h||(h=e,o())});let f=this._track,p=()=>{for(let e of(i?.close(),n))e.close()};return{async next(){for(;;){if(f.input._disposed)throw p(),new iF;if(d)return{value:void 0,done:!0};if(h)throw p(),h;if(n.length>0){let e=n.shift();return s(),{value:e,done:!1}}else{if(c)return{value:void 0,done:!0};await a}}},return:async()=>(d=!0,u=!0,s(),o(),p(),{value:void 0,done:!0}),async throw(e){throw e},[Symbol.asyncIterator](){return this}}}mediaSamplesAtTimestamps(e){eP(e);let t=eT(e),n=[],r=[],{promise:i,resolve:a}=eE(),{promise:o,resolve:l}=eE(),s=!1,c=!1,u=null,d=e=>{r.push(e),a(),{promise:i,resolve:a}=eE()};(async()=>{let e=await this._createDecoder(e=>{if(l(),c){e.close();return}let t=0;for(;n.length>0&&e.timestamp-n[0]>-.0000000001;)t++,n.shift();if(t>0)for(let n=0;n<t;n++)d(n<t-1?e.clone():e);else e.close()},e=>{u||(u=e,a())}),i=this._createPacketSink(),h=null,f=null,p=-1,m=async()=>{et(f);let t=f;for(e.decode(t);t.sequenceNumber<p;){let n=nw(r.length);for(;r.length+e.getDecodeQueueSize()>n&&!c;)({promise:o,resolve:l}=eE()),await o;if(c)break;let a=await i.getNextPacket(t);et(a),e.decode(a),t=a}p=-1},g=async()=>{await e.flush();for(let e=0;e<n.length;e++)d(null);n.length=0};for await(let e of t){if(nm(e),c||this._track.input._disposed)break;let t=await i.getPacket(e),r=t&&await i.getKeyPacket(e,{verifyKeyPackets:!0});if(!r){-1!==p&&(await m(),await g()),d(null),h=null;continue}h&&(r.sequenceNumber!==f.sequenceNumber||t.timestamp<h.timestamp)&&(await m(),await g()),n.push(t.timestamp),p=Math.max(t.sequenceNumber,p),h=t,f=r}c||this._track.input._disposed||(-1!==p&&await m(),await g()),e.close(),s=!0,a()})().catch(e=>{u||(u=e,a())});let h=this._track,f=()=>{for(let e of r)e?.close()};return{async next(){for(;;){if(h.input._disposed)throw f(),new iF;if(c)return{value:void 0,done:!0};if(u)throw f(),u;if(r.length>0){let e=r.shift();return et(void 0!==e),l(),{value:e,done:!1}}else{if(s)return{value:void 0,done:!0};await i}}},return:async()=>(c=!0,l(),a(),f(),{value:void 0,done:!0}),async throw(e){throw e},[Symbol.asyncIterator](){return this}}}}let nw=e=>0===e?40:8;class nx extends nb{constructor(e,t,n,r,i,a){super(e,t),this.codec=n,this.decoderConfig=r,this.rotation=i,this.timeResolution=a,this.decoder=null,this.customDecoder=null,this.customDecoderCallSerializer
47=new e$,this.customDecoderQueueSize=0,this.inputTimestamps=[],this.sampleQueue=[],this.currentPacketIndex=0,this.raslSkipped=!1,this.alphaDecoder=null,this.alphaHadKeyframe=!1,this.colorQueue=[],this.alphaQueue=[],this.merger=null,this.mergerCreationFailed=!1,this.decodedAlphaChunkCount=0,this.alphaDecoderQueueSize=0,this.nullAlphaFrameQueue=[],this.currentAlphaPacketIndex=0,this.alphaRaslSkipped=!1;let o=tQ.find(e=>e.supports(n,r));if(o)this.customDecoder=new o,this.customDecoder.codec=n,this.customDecoder.config=r,this.customDecoder.onSample=e=>{if(!(e instanceof t9))throw TypeError("The argument passed to onSample must be a VideoSample.");this.finalizeAndEmitSample(e)},this.customDecoderCallSerializer.call(()=>this.customDecoder.init());else{let e=e=>{if(this.alphaQueue.length>0){let t=this.alphaQueue.shift();et(void 0!==t),this.mergeAlpha(e,t)}else this.colorQueue.push(e)};if("avc"===n&&this.decoderConfig.description&&eX()){let e=tw(eo(this.decoderConfig.description));if(e&&e.sequenceParameterSets.length>0){let t=tC(e.sequenceParameterSets[0]);t&&0===t.frameMbsOnlyFlag&&(this.decoderConfig={...this.decoderConfig,hardwareAcceleration:"prefer-software"})}}let t=Error("Decoding error").stack;this.decoder=new VideoDecoder({output:t=>{try{e(t)}catch(e){this.onError(e)}},error:e=>{e.stack=t,this.onError(e)}}),this.decoder.configure(this.decoderConfig)}}getDecodeQueueSize(){return this.customDecoder?this.customDecoderQueueSize:(et(this.decoder),Math.max(this.decoder.decodeQueueSize,this.alphaDecoder?.decodeQueueSize??0))}decode(e){if("hevc"===this.codec&&this.currentPacketIndex>
470&&!this.raslSkipped){if(this.hasHevcRaslPicture(e.data))return;this.raslSkipped=!0}if(this.customDecoder)this.customDecoderQueueSize++,this.customDecoderCallSerializer.call(()=>this.customDecoder.decode(e)).then(()=>this.customDecoderQueueSize--);else{if(et(this.decoder),eW()||eC(this.inputTimestamps,e.timestamp,e=>e),eX()&&0===this.currentPacketIndex&&"avc"===this.codec){let t=[];for(let n of th(e.data,this.decoderConfig)){let r=tf(e.data[n.offset]);r>=20&&r<=31||t.push(e.data.subarray(n.offset,n.offset+n.length))}e=new t2(tb(t,this.decoderConfig),e.type,e.timestamp,e.duration)}this.decoder.decode(e.toEncodedVideoChunk()),this.decodeAlphaData(e)}this.currentPacketIndex++}decodeAlphaData(e){if(!e.sideData.alpha||this.mergerCreationFailed){this.pushNullAlphaFrame();return}if(!this.merger)try{this.merger=new nC}catch(t){console.error("Due to an error, only color data will be decoded.",t),this.mergerCreationFailed=!0,this.decodeAlphaData(e);return}if(!this.alphaDecoder){let e=e=>{if(this.alphaDecoderQueueSize--,this.colorQueue.length>0){let t=this.colorQueue.shift();et(void 0!==t),this.mergeAlpha(t,e)}else this.alphaQueue.push(e);for(this.decodedAlphaChunkCount++;this.nullAlphaFrameQueue.length>0&&this.nullAlphaFrameQueue[0]===this.decodedAlphaChunkCount;)if(this.nullAlphaFrameQueue.shift(),this.colorQueue.length>0){let e=this.colorQueue.shift();et(void 0!==e),this.mergeAlpha(e,null)}else this.alphaQueue.push(null)},t=Error("Decoding error").stack;this.alphaDecoder=new VideoDecoder({output:t=>{try{e(t)}catch(e){this.onError(e)}},error:e=>{e.stack=t,this.onError(e)}}),this.alphaDecoder.configure(this.decoderConfig)}let t=tj(this.codec,this.decoderConfig,e.sideData.alpha);if(this.alphaHadKeyframe||(this.alphaHadKeyframe="key"===t),this.alphaHadKeyframe){if("hevc"===this.codec&&this.currentAlphaPacketIndex>
470&&!this.alphaRaslSkipped){if(this.hasHevcRaslPicture(e.sideData.alpha)){this.pushNullAlphaFrame();return}this.alphaRaslSkipped=!0}this.currentAlphaPacketIndex++,this.alphaDecoder.decode(e.alphaToEncodedVideoChunk(t??e.type)),this.alphaDecoderQueueSize++}else this.pushNullAlphaFrame()}pushNullAlphaFrame(){0===this.alphaDecoderQueueSize?this.alphaQueue.push(null):this.nullAlphaFrameQueue.push(this.decodedAlphaChunkCount+this.alphaDecoderQueueSize)}hasHevcRaslPicture(e){for(let t of tk(e,this.decoderConfig)){let n=tS(e[t.offset]);if(n===p.RASL_N||n===p.RASL_R)return!0}return!1}sampleHandler(e){if(eW()){if(this.sampleQueue.length>0&&e.timestamp>=er(this.sampleQueue).timestamp){for(let e of this.sampleQueue)this.finalizeAndEmitSample(e);this.sampleQueue.length=0}eC(this.sampleQueue,e,e=>e.timestamp)}else{let t=this.inputTimestamps.shift();et(void 0!==t),e.setTimestamp(t),this.finalizeAndEmitSample(e)}}finalizeAndEmitSample(e){e.setTimestamp(Math.round(e.timestamp*this.timeResolution)/this.timeResolution),e.setDuration(Math.round(e.duration*this.timeResolution)/this.timeResolution),e.setRotation(this.rotation),this.onSample(e)}mergeAlpha(e,t){if(!t){let t=new t9(e);this.sampleHandler(t);return}et(this.merger),this.merger.update(e,t),e.close(),t.close();let n=new t9(new VideoFrame(this.merger.canvas,{timestamp:e.timestamp,duration:e.duration??void 0}));this.sampleHandler(n)}async flush(){if(this.customDecoder?await this.customDecoderCallSerializer.call(()=>this.customDecoder.flush()):(et(this.decoder),await Promise.all([this.decoder.flush(),this.alphaDecoder?.flush()]),this.colorQueue.forEach(e=>e.close()),this.colorQueue.length=0,this.alphaQueue.forEach(e=>e?.close()),this.alphaQueue.length=0,this.alphaHadKeyframe=!1,this.decodedAlphaChunkCount=0,this.alphaDecoderQueueSize=0,this.nullAlphaFrameQueue.length=0,this.currentAlphaPacketIndex=0,this.alphaRaslSkipped=!1),eW()){for(let e of this.sampleQueue)this.finalizeAndEmitSample(e);this.sampleQueue.length=0}this.currentPacketIndex=0,this.raslSkipped=!1}close(){for(let e of(this.customDecoder?this.customDecoderCallSerializer.call(()=>this.customDecoder.close()):(et(this.decoder),this.decoder.close(),this.alphaDecoder?.close(),this.colorQueue.forEach(e=>e.close()),this.colorQueue.length=0,this.alphaQueue.forEach(e=>e?.close()),this.alphaQueue.length=0,this.merger?.close()),this.sampleQueue))e.close();this.sampleQueue.length=0}}class nC{constructor(){"undefined"!=typeof OffscreenCanvas?this.canvas=new OffscreenCanvas(300,150):this.canvas=document.createElement("canvas");let e=this.canvas.getContext("webgl2",{premultipliedAlpha:!1});if(!e)throw Error("Couldn't acquire WebGL 2 context.");this.gl=e,this.program=this.createProgram(),this.vao=this.createVAO(),this.colorTexture=this.createTexture(),this.alphaTexture=this.createTexture(),this.gl.useProgram(this.program),this.gl.uniform1i(this.gl.getUniformLocation(this.program,"u_colorTexture"),0),this.gl.uniform1i(this.gl.getUniformLocation(this.program,"u_alphaTexture"),1)}createProgram(){let e=this.createShader(this.gl.VERTEX_SHADER,`#version 300 es 48 in vec2 a_position; 49 in vec2 a_texCoord; 50 out vec2 v_texCoord; 51 52 void main() { 53 gl_Position = vec4(a_position, 0.0, 1.0); 54 v_texCoord = a_texCoord; 55 } 56 `),t=this.createShader(this.gl.FRAGMENT_SHADER,`#version 300 es 57 precision highp float; 58 59 uniform sampler2D u_colorTexture; 60 uniform sampler2D u_alphaTexture; 61 in vec2 v_texCoord; 62 out vec4 fragColor; 63 64 void main() { 65 vec3 color = texture(u_colorTexture, v_texCoord).rgb; 66 float alpha = texture(u_alphaTexture, v_texCoord).r; 67 fragColor = vec4(color, alpha); 68 } 69 `),n=this.gl.createProgram();return this.gl.attachShader(n,e),this.gl.attachShader(n,t),this.gl.linkProgram(n),n}createShader(e,t){let n=this.gl.createShader(e);return this.gl.shaderSource(n,t),this.gl.compileShader(n),n}createVAO(){let e=this.gl.createVertexArray();this.gl.bindVertexArray(e);let t=new Float32Array([-1,-1,0,1,1,-1,1,1,-1,1,0,0,1,1,1,0]),n=this.gl.createBuffer();this.gl.bindBuffer(this.gl.ARRAY_BUFFER,n),this.gl.bufferData(this.gl.ARRAY_BUFFER,t,this.gl.STATIC_DRAW);let r=this.gl.getAttribLocation(this.program,"a_position"),i=this.gl.getAttribLocation(this.program,"a_texCoord");return this.gl.enableVertexAttribArray(r),this.gl.vertexAttribPointer(r,2,this.gl.FLOAT,!1,16,0),this.gl.enableVertexAttribArray(i),this.gl.vertexAttribPointer(i,2,this.gl.FLOAT,!1,16,8),e}createTexture(){let e=this.gl.createTexture();return this.gl.bindTexture(this.gl.TEXTURE_2D,e),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),e}update(e,t){(e.displayWidth!==this.canvas.width||e.displayHeight!==this.canvas.height)&&(this.canvas.width=e.displayWidth,this.canvas.height=e.displayHeight),this.gl.activeTexture(this.gl.TEXTURE0),this.gl.bindTexture(this.gl.TEXTURE_2D,this.colorTexture),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,e),this.gl.activeTexture(this.gl.TEXTURE1),this.gl.bindTexture(this.gl.TEXTURE_2D,this.alphaTexture),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,t),this.gl.viewport(0,0,this.canvas.width,this.canvas.height),this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.bindVertexArray(this.vao),this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4)}close(){this.gl.getExtension("WEBGL_lose_context")?.loseContext(),this.gl=null}}class nE extends ny{constructor(e){if(!(e instanceof nT))throw TypeError("videoTrack must be an InputVideoTrack.");super(),this._track=e}async _createDecoder(e,t){if(!await this._track.canDecode())throw Error("This video track cannot be decoded by this browser. Make sure to check decodability before using a track.");let n=this._track.codec,r=this._track.rotation,i=await this._track.getDecoderConfig(),a=this._track.timeResolution;return et(n&&i),new nx(e,t,n,i,r,a)}_createPacketSink(){return new nv(this._track)}async getSample(e){for await(let t of(nm(e),this.mediaSamplesAtTimestamps([e])))return t;throw Error("Internal error: Iterator returned nothing.")}samples(e=0,t=1/0){return this.mediaSamplesInRange(e,t)}samplesAtTimestamps(e){return this.mediaSamplesAtTimestamps(e)}}class nk{constructor(e,t={}){if(this._nextCanvasIndex=0,!(e instanceof nT))throw TypeError("videoTrack must be an InputVideoTrack.");
69if(t&&"object"!=typeof t)throw TypeError("options must be an object.");if(void 0!==t.alpha&&"boolean"!=typeof t.alpha)throw TypeError("options.alpha, when provided, must be a boolean.");if(void 0!==t.width&&(!Number.isInteger(t.width)||t.width<=0))throw TypeError("options.width, when defined, must be a positive integer.");if(void 0!==t.height&&(!Number.isInteger(t.height)||t.height<=0))throw TypeError("options.height, when defined, must be a positive integer.");if(void 0!==t.fit&&!["fill","contain","cover"].includes(t.fit))throw TypeError('options.fit, when provided, must be one of "fill", "contain", or "cover".');if(void 0!==t.width&&void 0!==t.height&&void 0===t.fit)throw TypeError("When both options.width and options.height are provided, options.fit must also be provided.");if(void 0!==t.rotation&&![0,90,180,270].includes(t.rotation))throw TypeError("options.rotation, when provided, must be 0, 90, 180 or 270.");if(void 0!==t.crop&&nn(t.crop,"options."),void 0!==t.poolSize&&("number"!=typeof t.poolSize||!Number.isInteger(t.poolSize)||t.poolSize<0))throw TypeError("poolSize must be a non-negative integer.");let n=t.rotation??e.rotation,[r,i]=n%180==0?[e.squarePixelWidth,e.squarePixelHeight]:[e.squarePixelHeight,e.squarePixelWidth],a=t.crop;a&&nt(a,r,i);let[o,l]=a?[a.width,a.height]:[r,i],s=o/l;void 0!==t.width&&void 0===t.height?l=Math.round((o=t.width)/s):void 0===t.width&&void 0!==t.height?o=Math.round((l=t.height)*s):void 0!==t.width&&void 0!==t.height&&(o=t.width,l=t.height),this._videoTrack=e,this._alpha=t.alpha??!1,this._width=o,this._height=l,this._rotation=n,this._crop=a,this._fit=t.fit??"fill",this._videoSampleSink=new nE(e),this._canvasPool=Array.from({length:t.poolSize??0},()=>null)}_videoSampleToWrappedCanvas(e){let t=this._canvasPool[this._nextCanvasIndex],n=!1;t||("undefined"!=typeof document?((t=document.createElement("canvas")).width=this._width,t.height=this._height):t=new OffscreenCanvas(this._width,this._height),this._canvasPool.length>0&&(this._canvasPool[this._nextCanvasIndex]=t),n=!0),this._canvasPool.length>0&&(this._nextCanvasIndex=(this._nextCanvasIndex+1)%this._canvasPool.length);let r=t.getContext("2d",{alpha:this._alpha||eq()});et(r),r.resetTransform(),n||(!this._alpha&&eq()?(r.fillStyle="black",r.fillRect(0,0,this._width,this._height)):r.clearRect(0,0,this._width,this._height)),e.drawWithFit(r,{fit:this._fit,rotation:this._rotation,crop:this._crop});let i={canvas:t,timestamp:e.timestamp,duration:e.duration};return e.close(),i}async getCanvas(e){nm(e);let t=await this._videoSampleSink.getSample(e);return t&&this._videoSampleToWrappedCanvas(t)}canvases(e=0,t=1/0){return eL(this._videoSampleSink.samples(e,t),e=>this._videoSampleToWrappedCanvas(e))}canvasesAtTimestamps(e){return eL(this._videoSampleSink.samplesAtTimestamps(e),e=>e&&this._videoSampleToWrappedCanvas(e))}}class nS{constructor(e,t){this.input=e,this._backing=t}isVideoTrack(){return this instanceof nT}isAudioTrack(){return this instanceof nP}get id(){return this._backing.getId()}get number(){return this._backing.getNumber()}get internalCodecId(){return this._backing.getInternalCodecId()}get languageCode(){return this._backing.getLanguageCode()}get name(){return this._backing.getName()}get timeResolution(){return this._backing.getTimeResolution()}get disposition(){return this._backing.getDisposition()}getFirstTimestamp(){return this._backing.getFirstTimestamp()}computeDuration(){return this._backing.computeDuration()}async computePacketStats(e=1/0){let t=new nv(this),n=1/0,r=-1/0,i=0,a=0;for await(let o of t.packets(void 0,void 0,{metadataOnly:!0})){if(i>=e&&o.timestamp>=r)break;n=Math.min(n,o.timestamp),r=Math.max(r,o.timestamp+o.duration),i++,a+=o.byteLength}return{packetCount:i,averagePacketRate:i?Number((i/(r-n)).toPrecision(16)):0,averageBitrate:i?Number((8*a/(r-n)).toPrecision(16)):0}}}class nT extends nS{constructor(e,t){super(e,t),this._backing=t,this.pixelAspectRatio=e4({num:this._backing.getSquarePixelWidth()*this._backing.getCodedHeight(),den:this._backing.getSquarePixelHeight()*this._backing.getCodedWidth()})}get type(){return"video"}get codec(){return this._backing.getCodec()}get codedWidth(){return this._backing.getCodedWidth()}get codedHeight(){return this._backing.getCodedHeight()}get rotation(){return this._backing.getRotation()}get squarePixelWidth(){return this._backing.getSquarePixelWidth()}get squarePixelHeight(){return this._backing.getSquarePixelHeight()}get displayWidth(){return this._backing.getRotation()%180==0?this.squarePixelWidth:this.squarePixelHeight}get displayHeight(){return this._backing.getRotation()%180==0?this.squarePixelHeight:this.squarePixelWidth}getColorSpace(){return this._backing.getColorSpace()}async hasHighDynamicRange(){let e=await this._backing.getColorSpace();return"bt2020"===e.primaries||"smpte432"===e.primaries||"pg"===e.transfer||"hlg"===e.transfer||"bt2020-ncl"===e.matrix}
69canBeTransparent(){return this._backing.canBeTransparent()}getDecoderConfig(){return this._backing.getDecoderConfig()}async getCodecParameterString(){let e=await this._backing.getDecoderConfig();return e?.codec??null}async canDecode(){try{let e=await this._backing.getDecoderConfig();if(!e)return!1;let t=this._backing.getCodec();if(et(null!==t),tQ.some(n=>n.supports(t,e)))return!0;if("undefined"==typeof VideoDecoder)return!1;let n=await VideoDecoder.isConfigSupported(e);return!0===n.supported}catch(e){return console.error("Error during decodability check:",e),!1}}async determinePacketType(e){if(!(e instanceof t2))throw TypeError("packet must be an EncodedPacket.");if(e.isMetadataOnly)throw TypeError("packet must not be metadata-only to determine its type.");if(null===this.codec)return null;let t=await this.getDecoderConfig();return et(t),tj(this.codec,t,e.data)}}class nP extends nS{constructor(e,t){super(e,t),this._backing=t}get type(){return"audio"}get codec(){return this._backing.getCodec()}get numberOfChannels(){return this._backing.getNumberOfChannels()}get sampleRate(){return this._backing.getSampleRate()}getDecoderConfig(){return this._backing.getDecoderConfig()}async getCodecParameterString(){let e=await this._backing.getDecoderConfig();return e?.codec??null}async canDecode(){try{let e=await this._backing.getDecoderConfig();if(!e)return!1;let t=this._backing.getCodec();if(et(null!==t),t0.some(n=>n.supports(t,e))||e.codec.startsWith("pcm-"))return!0;{if("undefined"==typeof AudioDecoder)return!1;let t=await AudioDecoder.isConfigSupported(e);return!0===t.supported}}catch(e){return console.error("Error during decodability check:",e),!1}}async determinePacketType(e){if(!(e instanceof t2))throw TypeError("packet must be an EncodedPacket.");return null===this.codec?null:"key"}}let nM=e=>{let t=(e.hasVideo?"video/":e.hasAudio?"audio/":"application/")+(e.isQuickTime?"quicktime":"mp4");if(e.codecStrings.length>0){let n=[...new Set(e.codecStrings)];t+=`; codecs="${n.join(", ")}"`}return t};class nR{constructor(e,t){if(this.data=e,this.mimeType=t,!(e instanceof Uint8Array))throw TypeError("data must be a Uint8Array.");if("string"!=typeof t)throw TypeError("mimeType must be a string.")}}class nA{constructor(e,t,n,r){if(this.data=e,this.mimeType=t,this.name=n,this.description=r,!(e instanceof Uint8Array))throw TypeError("data must be a Uint8Array.");if(void 0!==t&&"string"!=typeof t)throw TypeError("mimeType, when provided, must be a string.");if(void 0!==n&&"string"!=typeof n)throw TypeError("name, when provided, must be a string.");if(void 0!==r&&"string"!=typeof r)throw TypeError("description, when provided, must be a string.")}}let nL={default:!0,forced:!1,original:!1,commentary:!1,hearingImpaired:!1,visuallyImpaired:!1};class n_{constructor(e){this.source=e}requestSlice(e,t){if(this.source._disposed)throw new iF;if(e<0||null!==this.fileSize&&e+t>this.fileSize)return null;let n=e+t,r=this.source._read(e,n);return r instanceof Promise?r.then(t=>t?new nI(t.bytes,t.view,t.offset,e,n):null):r?new nI(r.bytes,r.view,r.offset,e,n):null}requestSliceRange(e,t,n){if(this.source._disposed)throw new iF;if(e<0)return null;if(null!==this.fileSize)return this.requestSlice(e,e_(this.fileSize-e,t,n));{let r=this.requestSlice(e,n),i=r=>{if(r)return r;let i=r=>(et(null!==r),this.requestSlice(e,e_(r-e,t,n))),a=this.source._retrieveSize();return a instanceof Promise?a.then(i):i(a)};return r instanceof Promise?r.then(i):i(r)}}}class nI{constructor(e,t,n,r,i){this.bytes=e,this.view=t,this.offset=n,this.start=r,this.end=i,this.bufferPos=r-n}static tempFromBytes(e){return new nI(e,el(e),0,0,e.length)}get length(){return this.end-this.start}get filePos(){return this.offset+this.bufferPos}set filePos(e){this.bufferPos=e-this.offset}get remainingLength(){return Math.max(this.end-this.filePos,0)}skip(e){this.bufferPos+=e}slice(e,t=this.end-e){if(e<this.start||e+t>this.end)throw RangeError("Slicing outside of original slice.");return new nI(this.bytes,this.view,this.offset,e,e+t)}}let nO=(e,t)=>{if(e.filePos<e.start||e.filePos+t>e.end)throw RangeError(`Tried reading [${e.filePos}, ${e.filePos+t}), but slice is [${e.start}, ${e.end}). This is likely an internal error, please report it alongside the file that caused it.`)},nD=(e,t)=>{nO(e,t);let n=e.bytes.subarray(e.bufferPos,e.bufferPos+t);return e.bufferPos+=t,n},nz=e=>(nO(e,1),e.view.getUint8(e.bufferPos++)),nN=(e,t)=>{nO(e,2);let n=e.view.getUint16(e.bufferPos,t);return e.bufferPos+=2,n},nF=e=>{nO(e,2);let t=e.view.getUint16(e.bufferPos,!1);return e.bufferPos+=2,t},nB=e=>{nO(e,3);let t=eR(e.view,e.bufferPos,!1);return e.bufferPos+=3,t},nH=e=>{nO(e,2);let t=e.view.getInt16(e.bufferPos,!1);return e.bufferPos+=2,t},nV=(e,t)=>{nO(e,4);let n=e.view.getUint32(e.bufferPos,t);return e.bufferPos+=4,n},nj=e=>{nO(e,4);let t=e.view.getUint32(e.bufferPos,!1);return e.bufferPos+=4,t},n$=e=>{nO(e,4);let t=e.view.getUint32(e.bufferPos,!0);return e.bufferPos+=4,t},nU=e=>{nO(e,4);let t=e.view.getInt32(e.bufferPos,!1);return e.bufferPos+=4,t},nW=e=>{nO(e,4);let t=e.view.getInt32(e.bufferPos,!0);return e.bufferPos+=4,t},nG=(e,t)=>
69{let n,r;return t?(n=nV(e,!0),r=nV(e,!0)):(r=nV(e,!1),n=nV(e,!1)),4294967296*r+n},nq=e=>4294967296*nj(e)+nj(e),nZ=e=>4294967296*nU(e)+nj(e),nX=e=>{let t=n$(e);return 4294967296*nW(e)+t},nY=e=>{nO(e,4);let t=e.view.getFloat32(e.bufferPos,!1);return e.bufferPos+=4,t},nK=e=>{nO(e,8);let t=e.view.getFloat64(e.bufferPos,!1);return e.bufferPos+=8,t},nJ=(e,t)=>{nO(e,t);let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e.bytes[e.bufferPos++]);return n},nQ=e=>{let t=nj(e),n=nJ(e,4),r=8;1===t&&(t=nq(e),r=16);let i=t-r;return i<0?null:{name:n,totalSize:t,headerSize:r,contentSize:i}},n0=e=>nU(e)/65536,n1=e=>nU(e)/1073741824,n2=e=>{let t=0;for(let n=0;n<4;n++){t<<=7;let n=nz(e);if(t|=127&n,(128&n)==0)break}return t},n4=e=>{let t=nF(e);return e.skip(2),t=Math.min(t,e.remainingLength),es.decode(nD(e,t))},n3=e=>{let t=nQ(e);if(!t||"data"!==t.name||e.remainingLength<8)return null;let n=nj(e);e.skip(4);let r=nD(e,t.contentSize-8);switch(n){case 1:return es.decode(r);case 2:return new TextDecoder("utf-16be").decode(r);case 13:return new nR(r,"image/jpeg");case 14:return new nR(r,"image/png");case 27:return new nR(r,"image/bmp");default:return r}};class n8 extends tJ{constructor(e){super(e),this.moovSlice=null,this.currentTrack=null,this.tracks=[],this.metadataPromise=null,this.movieTimescale=-1,this.movieDurationInTimescale=-1,this.isQuickTime=!1,this.metadataTags={},this.currentMetadataKeys=null,this.isFragmented=!1,this.fragmentTrackDefaults=[],this.currentFragment=null,this.lastReadFragment=null,this.reader=e._reader}async computeDuration(){let e=await this.getTracks();return Math.max(0,...await Promise.all(e.map(e=>e.computeDuration())))}async getTracks(){return await this.readMetadata(),this.tracks.map(e=>e.inputTrack)}async getMimeType(){await this.readMetadata();let e=await Promise.all(this.tracks.map(e=>e.inputTrack.getCodecParameterString()));return nM({isQuickTime:this.isQuickTime,hasVideo:this.tracks.some(e=>e.info?.type==="video"),hasAudio:this.tracks.some(e=>e.info?.type==="audio"),codecStrings:e.filter(Boolean)})}async getMetadataTags(){return await this.readMetadata(),this.metadataTags}readMetadata(){return this.metadataPromise??=(async()=>{let e=0;for(;;){let t=this.reader.requestSliceRange(e,8,16);if(t instanceof Promise&&(t=await t),!t)break;let n=e,r=nQ(t);if(!r)break;if("ftyp"===r.name){let e=nJ(t,4);this.isQuickTime="qt "===e}else if("moov"===r.name){let e=this.reader.requestSlice(t.filePos,r.contentSize);if(e instanceof Promise&&(e=await e),!e)break;for(let t of(this.moovSlice=e,this.readContiguousBoxes(this.moovSlice),this.tracks.sort((e,t)=>Number(t.disposition.default)-Number(e.disposition.default)),this.tracks)){let e=t.editListPreviousSegmentDurations/this.movieTimescale;t.editListOffset-=Math.round(e*t.timescale)}break}e=n+r.totalSize}if(this.isFragmented&&null!==this.reader.fileSize){let e=this.reader.requestSlice(this.reader.fileSize-4,4);e instanceof Promise&&(e=await e),et(e);let t=nj(e),n=this.reader.fileSize-t;if(n>=0&&n<=this.reader.fileSize-16){let e=this.reader.requestSliceRange(n,8,16);if(e instanceof Promise&&(e=await e),e){let t=nQ(e);if(t&&"mfra"===t.name){let n=this.reader.requestSlice(e.filePos,t.contentSize);n instanceof Promise&&(n=await n),n&&this.readContiguousBoxes(n)}}}}})()}getSampleTableForTrack(e){if(e.sampleTable)return e.sampleTable;let t={sampleTimingEntries:[],sampleCompositionTimeOffsets:[],sampleSizes:[],keySampleIndices:null,chunkOffsets:[],sampleToChunk:[],presentationTimestamps:null,presentationTimestampIndexMap:null};e.sampleTable=t,et(this.moovSlice);let n=this.moovSlice.slice(e.sampleTableByteOffset);if(this.currentTrack=e,this.traverseBox(n),this.currentTrack=null,e.info?.type==="audio"&&e.info.codec&&e7.includes(e.info.codec)&&0===t.sampleCompositionTimeOffsets.length){et(e.info?.type==="audio");let n=tl(e.info.codec),r=[],i=[];for(let a=0;a<t.sampleToChunk.length;a++){let o=t.sampleToChunk[a],l=t.sampleToChunk[a+1],s=(l?l.startChunkIndex:t.chunkOffsets.length)-o.startChunkIndex;for(let a=0;a<s;a++){let l=o.startSampleIndex+a*o.samplesPerChunk,s=l+o.samplesPerChunk,c=ex(t.sampleTimingEntries,l,e=>e.startIndex),u=t.sampleTimingEntries[c],d=ex(t.sampleTimingEntries,s,e=>e.startIndex),h=t.sampleTimingEntries[d],f=u.startDecodeTimestamp+(l-u.startIndex)*u.delta,p=h.startDecodeTimestamp+(s-h.startIndex)*h.delta-f,m=er(r);m&&m.delta===p?m.count++:r.push({startIndex:o.startChunkIndex+a,startDecodeTimestamp:f,count:1,delta:p});let g=o.samplesPerChunk*n.sampleSize*e.info.numberOfChannels;i.push(g)}o.startSampleIndex=o.startChunkIndex,o.samplesPerChunk=1}t.sampleTimingEntries=r,t.sampleSizes=i}
69if(t.sampleCompositionTimeOffsets.length>0){for(let e of(t.presentationTimestamps=[],t.sampleTimingEntries))for(let n=0;n<e.count;n++)t.presentationTimestamps.push({presentationTimestamp:e.startDecodeTimestamp+n*e.delta,sampleIndex:e.startIndex+n});for(let e of t.sampleCompositionTimeOffsets)for(let n=0;n<e.count;n++){let r=e.startIndex+n,i=t.presentationTimestamps[r];i&&(i.presentationTimestamp+=e.offset)}t.presentationTimestamps.sort((e,t)=>e.presentationTimestamp-t.presentationTimestamp),t.presentationTimestampIndexMap=Array(t.presentationTimestamps.length).fill(-1);for(let e=0;e<t.presentationTimestamps.length;e++)t.presentationTimestampIndexMap[t.presentationTimestamps[e].sampleIndex]=e}return t}async readFragment(e){if(this.lastReadFragment?.moofOffset===e)return this.lastReadFragment;let t=this.reader.requestSliceRange(e,8,16);t instanceof Promise&&(t=await t),et(t);let n=nQ(t);et(n?.name==="moof");let r=this.reader.requestSlice(e,n.totalSize);r instanceof Promise&&(r=await r),et(r),this.traverseBox(r);let i=this.lastReadFragment;for(let[,t]of(et(i&&i.moofOffset===e),i.trackData)){let e=t.track,{fragmentPositionCache:n}=e;if(!t.startTimestampIsFinal){let r=e.fragmentLookupTable.find(e=>e.moofOffset===i.moofOffset);if(r)rr(t,r.timestamp);else{let e=ex(n,i.moofOffset-1,e=>e.moofOffset);-1!==e&&rr(t,n[e].endTimestamp)}t.startTimestampIsFinal=!0}let r=ex(n,t.startTimestamp,e=>e.startTimestamp);(-1===r||n[r].moofOffset!==i.moofOffset)&&n.splice(r+1,0,{moofOffset:i.moofOffset,startTimestamp:t.startTimestamp,endTimestamp:t.endTimestamp})}return i}readContiguousBoxes(e){let t=e.filePos;for(;e.filePos-t<=e.length-8&&this.traverseBox(e););}*iterateContiguousBoxes(e){let t=e.filePos;for(;e.filePos-t<=e.length-8;){let t=e.filePos,n=nQ(e);if(!n)break;yield{boxInfo:n,slice:e},e.filePos=t+n.totalSize}}traverseBox(e){let t=e.filePos,n=nQ(e);if(!n)return!1;let r=e.filePos,i=t+n.totalSize;switch(n.name){case"mdia":case"minf":case"dinf":case"mfra":case"edts":case"wave":this.readContiguousBoxes(e.slice(r,n.contentSize));break;case"mvhd":{let t=nz(e);e.skip(3),1===t?(e.skip(16),this.movieTimescale=nj(e),this.movieDurationInTimescale=nq(e)):(e.skip(8),this.movieTimescale=nj(e),this.movieDurationInTimescale=nj(e))}break;case"trak":{let t={id:-1,demuxer:this,inputTrack:null,disposition:{...nL},info:null,timescale:-1,durationInMovieTimescale:-1,durationInMediaTimescale:-1,rotation:0,internalCodecId:null,name:null,languageCode:"und",sampleTableByteOffset:-1,sampleTable:null,fragmentLookupTable:[],currentFragmentState:null,fragmentPositionCache:[],editListPreviousSegmentDurations:0,editListOffset:0};this.currentTrack=t,this.readContiguousBoxes(e.slice(r,n.contentSize)),-1!==t.id&&-1!==t.timescale&&null!==t.info&&("video"===t.info.type&&-1!==t.info.width?(t.inputTrack=new nT(this.input,new n5(t)),this.tracks.push(t)):"audio"===t.info.type&&-1!==t.info.numberOfChannels&&(t.inputTrack=new nP(this.input,new n9(t)),this.tracks.push(t))),this.currentTrack=null}break;case"tkhd":{let t=this.currentTrack;if(!t)break;let n=nz(e),r=nB(e);if(t.disposition.default=!!(1&r),0===n)e.skip(8),t.id=nj(e),e.skip(4),t.durationInMovieTimescale=nj(e);else if(1===n)e.skip(16),t.id=nj(e),e.skip(4),t.durationInMovieTimescale=nq(e);else throw Error(`Incorrect track header version ${n}.`);e.skip(16);let i=en(eO(ri([n0(e),n0(e),n1(e),n0(e),n0(e),n1(e),n0(e),n0(e),n1(e)]),90));et(0===i||90===i||180===i||270===i),t.rotation=i}break;case"elst":{let t=this.currentTrack;if(!t)break;let n=nz(e);e.skip(3);let r=!1,i=0,a=nj(e);for(let o=0;o<a;o++){let a=1===n?nq(e):nj(e),o=1===n?nZ(e):nU(e),l=n0(e);if(0!==a){if(r){console.warn("Unsupported edit list: multiple edits are not currently supported. Only using first edit.");break}if(-1===o){i+=a;continue}if(1!==l){console.warn("Unsupported edit list entry: media rate must be 1.");break}t.editListPreviousSegmentDurations=i,t.editListOffset=o,r=!0}}}break;case"mdhd":{let t=this.currentTrack;if(!t)break;let n=nz(e);e.skip(3),0===n?(e.skip(8),t.timescale=nj(e),t.durationInMediaTimescale=nj(e)):1===n&&(e.skip(16),t.timescale=nj(e),t.durationInMediaTimescale=nq(e));let r=nF(e);if(r>0){t.languageCode="";for(let e=0;e<3;e++)t.languageCode=String.fromCharCode(96+(31&r))+t.languageCode,r>>=5;eF(t.languageCode)||(t.languageCode="und")}}break;case"hdlr":{let t=this.currentTrack;if(!t)break;e.skip(8);let n=nJ(e,4);"vide"===n?t.info={type:"video",width:-1,height:-1,squarePixelWidth:-1,squarePixelHeight:-1,codec:null,codecDescription:null,colorSpace:null,avcType:null,avcCodecInfo:null,hevcCodecInfo:null,vp9CodecInfo:null,av1CodecInfo:null}:"soun"===n&&(t.info={type:"audio",numberOfChannels:-1,sampleRate:-1,codec:null,codecDescription:null,aacCodecInfo:null})}break;case"stbl":{let i=this.currentTrack;if(!i)break;i.sampleTableByteOffset=t,this.readContiguousBoxes(e.slice(r,n.contentSize))}break;case"stsd":{let t=this.currentTrack;if(!t||null===t.info||t.sampleTable)break;let n=nz(e);e.skip(3);let r=nj(e);for(let i=0;i<r;i++){let r=e.filePos,i=nQ(e);if(!i)break;t.internalCodecId=i.name;let a=i.name.toLowerCase();if("video"===t.info.type)"avc1"===a||"avc3"===a?(t.info.codec="avc",t.info.avcType="avc1"===a?1:3):"hvc1"===a||"hev1"===a?t.info.codec="hevc":"vp08"===a?t.info.codec="vp8":"vp09"===a?t.info.codec="vp9":"av01"===a?t.info.codec="av1":console.warn(`Unsupported video codec (sample entry type '${i.name}').`),e.skip(24),t.info.width=nF(e),t.info.height=nF(e),t.info.squarePixelWidth=t.info.width,t.info.squarePixelHeight=t.info.height,e.skip(50),this.readContiguousBoxes(e.slice(e.filePos,r+i.totalSize-e.filePos));else{"mp4a"===a||("opus"===a?t.info.codec="opus":"flac"===a?t.info.codec="flac":"twos"===a||"sowt"===a||"raw "===a||"in24"===a||"in32"===a||"fl32"===a||"fl64"===a||"lpcm"===a||"ipcm"===a||"fpcm"===a||("ulaw"===a?t.info.codec="ulaw":"alaw"===a?t.info.codec="alaw":"ac-3"===a?t.info.codec="ac3":"ec-3"===a?t.info.codec="eac3":console.warn(`Unsupported audio codec (sample entry type '${i.name}').`))),e.skip(8);let o=nF(e);e.skip(6);let l=nF(e),s=nF(e);e.skip(4);let c=nj(e)/65536;if(0===n&&o>0){if(1===o)e.skip(4),s=8*nj(e),e.skip(8);else if(2===o){e.skip(4),c=nK(e),l=nj(e),e.skip(4),s=nj(e);let n=nj(e);if(e.skip(8),"lpcm"===a){let e=s+7>>3,r=!!(1&n),i=!!(2&n),a=4&n?-1:0;s>0&&s<=64&&(r?32===s&&(t.info.codec=i?"pcm-f32be":"pcm-f32"):a&1<<e-1?1===e?t.info.codec="pcm-s8":2===e?t.info.codec=i?"pcm-s16be":"pcm-s16":3===e?t.info.codec=i?"pcm-s24be":"pcm-s24":4===e&&(t.info.codec=i?"pcm-s32be":"pcm-s32"):1===e&&(t.info.codec="pcm-u8")),null===t.info.codec&&console.warn("Unsupported PCM format.")}}}"opus"===t.info.codec&&(c=48e3),t.info.numberOfChannels=l,t.info.sampleRate=c,"twos"===a?8===s?t.info.codec="pcm-s8":16===s?t.info.codec="pcm-s16be":(console.warn(`Unsupported sample size ${s} for codec 'twos'.`),t.info.codec=null):"sowt"===a?8===s?t.info.codec="pcm-s8":16===s?t.info.codec="pcm-s16":(console.warn(`Unsupported sample size ${s}
69 for codec 'sowt'.`),t.info.codec=null):"raw "===a?t.info.codec="pcm-u8":"in24"===a?t.info.codec="pcm-s24be":"in32"===a?t.info.codec="pcm-s32be":"fl32"===a?t.info.codec="pcm-f32be":"fl64"===a?t.info.codec="pcm-f64be":"ipcm"===a?t.info.codec="pcm-s16be":"fpcm"===a&&(t.info.codec="pcm-f32be"),this.readContiguousBoxes(e.slice(e.filePos,r+i.totalSize-e.filePos))}}}break;case"avcC":{let t=this.currentTrack;if(!t)break;et(t.info),t.info.codecDescription=nD(e,n.contentSize)}break;case"hvcC":{let t=this.currentTrack;if(!t)break;et(t.info),t.info.codecDescription=nD(e,n.contentSize)}break;case"vpcC":{let t=this.currentTrack;if(!t)break;et(t.info?.type==="video"),e.skip(4);let n=nz(e),r=nz(e),i=nz(e),a=nz(e),o=nz(e),l=nz(e);t.info.vp9CodecInfo={profile:n,level:r,bitDepth:i>>4,chromaSubsampling:i>>1&7,videoFullRangeFlag:1&i,colourPrimaries:a,transferCharacteristics:o,matrixCoefficients:l}}break;case"av1C":{let t=this.currentTrack;if(!t)break;et(t.info?.type==="video"),e.skip(1);let n=nz(e),r=n>>5,i=nz(e),a=i>>6&1;t.info.av1CodecInfo={profile:r,level:31&n,tier:i>>7,bitDepth:2===r&&a?i>>5&1?12:10:a?10:8,monochrome:i>>4&1,chromaSubsamplingX:i>>3&1,chromaSubsamplingY:i>>2&1,chromaSamplePosition:3&i}}break;case"colr":{let t=this.currentTrack;if(!t||(et(t.info?.type==="video"),"nclx"!==nJ(e,4)))break;let n=nF(e),r=nF(e),i=nF(e),a=!!(128&nz(e));t.info.colorSpace={primaries:ed[n],transfer:ef[r],matrix:em[i],fullRange:a}}break;case"pasp":{let t=this.currentTrack;if(!t)break;et(t.info?.type==="video");let n=nj(e),r=nj(e);n>r?t.info.squarePixelWidth=Math.round(t.info.width*n/r):t.info.squarePixelHeight=Math.round(t.info.height*r/n)}break;case"esds":{let t=this.currentTrack;if(!t)break;et(t.info?.type==="audio"),e.skip(4),et(3===nz(e)),n2(e),e.skip(2);let n=nz(e);if((128&n)!=0&&e.skip(2),(64&n)!=0){let t=nz(e);e.skip(t)}(32&n)!=0&&e.skip(2),et(4===nz(e));let r=n2(e),i=e.filePos,a=nz(e);if(64===a||103===a?(t.info.codec="aac",t.info.aacCodecInfo={isMpeg2:103===a,objectType:null}):105===a||107===a?t.info.codec="mp3":221===a?t.info.codec="vorbis":console.warn(`Unsupported audio codec (objectTypeIndication ${a}) - discarding track.`),e.skip(12),r>e.filePos-i){et(5===nz(e));let n=n2(e);if(t.info.codecDescription=nD(e,n),"aac"===t.info.codec){let e=e9(t.info.codecDescription);null!==e.numberOfChannels&&(t.info.numberOfChannels=e.numberOfChannels),null!==e.sampleRate&&(t.info.sampleRate=e.sampleRate)}}}break;case"enda":{let t=this.currentTrack;if(!t)break;et(t.info?.type==="audio"),255&nF(e)&&("pcm-s16be"===t.info.codec?t.info.codec="pcm-s16":"pcm-s24be"===t.info.codec?t.info.codec="pcm-s24":"pcm-s32be"===t.info.codec?t.info.codec="pcm-s32":"pcm-f32be"===t.info.codec?t.info.codec="pcm-f32":"pcm-f64be"===t.info.codec&&(t.info.codec="pcm-f64"))}break;case"pcmC":{let t=this.currentTrack;if(!t)break;et(t.info?.type==="audio"),e.skip(4);let n=!!(1&nz(e)),r=nz(e);"pcm-s16be"===t.info.codec?n?16===r?t.info.codec="pcm-s16":24===r?t.info.codec="pcm-s24":32===r?t.info.codec="pcm-s32":(console.warn(`Invalid ipcm sample size ${r}.`),t.info.codec=null):16===r?t.info.codec="pcm-s16be":24===r?t.info.codec="pcm-s24be":32===r?t.info.codec="pcm-s32be":(console.warn(`Invalid ipcm sample size ${r}.`),t.info.codec=null):"pcm-f32be"===t.info.codec&&(n?32===r?t.info.codec="pcm-f32":64===r?t.info.codec="pcm-f64":(console.warn(`Invalid fpcm sample size ${r}.`),t.info.codec=null):32===r?t.info.codec="pcm-f32be":64===r?t.info.codec="pcm-f64be":(console.warn(`Invalid fpcm sample size ${r}.`),t.info.codec=null));break}case"dOps":{let t;let n=this.currentTrack;if(!n)break;et(n.info?.type==="audio"),e.skip(1);let r=nz(e),i=nF(e),a=nj(e),o=nH(e),l=nz(e);t=0!==l?nD(e,2+r):new Uint8Array(0);let s=new Uint8Array(19+t.byteLength),c=new DataView(s.buffer);c.setUint32(0,1332770163,!1),c.setUint32(4,1214603620,!1),c.setUint8(8,1),c.setUint8(9,r),c.setUint16(10,i,!0),c.setUint32(12,a,!0),c.setInt16(16,o,!0),c.setUint8(18,l),s.set(t,19),n.info.codecDescription=s,n.info.numberOfChannels=r}break;case"dfLa":{let t=this.currentTrack;if(!t)break;et(t.info?.type==="audio"),e.skip(4);let n=e.filePos;for(;e.filePos<i;){let n=nz(e),r=nB(e);if((127&n)===m.STREAMINFO){e.skip(10);let n=nj(e),r=n>>>12,i=(n>>9&7)+1;t.info.sampleRate=r,t.info.numberOfChannels=i,e.skip(20)}else e.skip(r);if(128&n)break}let r=e.filePos;e.filePos=n;let a=nD(e,r-n),o=new Uint8Array(4+a.byteLength);new DataView(o.buffer).setUint32(0,1716281667,!1),o.set(a,4),t.info.codecDescription=o}break;case"dac3":{let t=this.currentTrack;if(!t)break;et(t.info?.type==="audio");let n=new e8(nD(e,3)),r=n.readBits(2);n.skipBits(8);let i=n.readBits(3),a=n.readBits(1);r<3&&(t.info.sampleRate=ts[r]),t.info.numberOfChannels=tU[i]+a}break;case"dec3":{let t=this.currentTrack;if(!t)break;et(t.info?.type==="audio");let r=tX(nD(e,n.contentSize));if(!r){console.warn("Invalid dec3 box contents, ignoring.");break}let i=tY(r);null!==i&&(t.info.sampleRate=i),t.info.numberOfChannels=tK(r)}break;case"stts":{let t=this.currentTrack;if(!t||!t.sampleTable)break;e.skip(4);let n=nj(e),r=0,i=0;for(let a=0;a<n;a++){let n=nj(e),a=nj(e);t.sampleTable.sampleTimingEntries.push({startIndex:r,startDecodeTimestamp:i,count:n,delta:a}),r+=n,i+=n*a}}break;case"ctts":{let t=this.currentTrack;if(!t||!t.sampleTable)break;e.skip(4);let n=nj(e),r=0;for(let i=0;i<n;i++){let n=nj(e),i=nU(e);
69t.sampleTable.sampleCompositionTimeOffsets.push({startIndex:r,count:n,offset:i}),r+=n}}break;case"stsz":{let t=this.currentTrack;if(!t||!t.sampleTable)break;e.skip(4);let n=nj(e),r=nj(e);if(0===n)for(let n=0;n<r;n++){let n=nj(e);t.sampleTable.sampleSizes.push(n)}else t.sampleTable.sampleSizes.push(n)}break;case"stz2":{let t=this.currentTrack;if(!t||!t.sampleTable)break;e.skip(4),e.skip(3);let n=nz(e),r=nj(e),i=new e8(nD(e,Math.ceil(r*n/8)));for(let e=0;e<r;e++){let e=i.readBits(n);t.sampleTable.sampleSizes.push(e)}}break;case"stss":{let t=this.currentTrack;if(!t||!t.sampleTable)break;e.skip(4),t.sampleTable.keySampleIndices=[];let n=nj(e);for(let r=0;r<n;r++){let n=nj(e)-1;t.sampleTable.keySampleIndices.push(n)}0!==t.sampleTable.keySampleIndices[0]&&t.sampleTable.keySampleIndices.unshift(0)}break;case"stsc":{let t=this.currentTrack;if(!t||!t.sampleTable)break;e.skip(4);let n=nj(e);for(let r=0;r<n;r++){let n=nj(e)-1,r=nj(e),i=nj(e);t.sampleTable.sampleToChunk.push({startSampleIndex:-1,startChunkIndex:n,samplesPerChunk:r,sampleDescriptionIndex:i})}let r=0;for(let e=0;e<t.sampleTable.sampleToChunk.length;e++)t.sampleTable.sampleToChunk[e].startSampleIndex=r,e<t.sampleTable.sampleToChunk.length-1&&(r+=(t.sampleTable.sampleToChunk[e+1].startChunkIndex-t.sampleTable.sampleToChunk[e].startChunkIndex)*t.sampleTable.sampleToChunk[e].samplesPerChunk)}break;case"stco":{let t=this.currentTrack;if(!t||!t.sampleTable)break;e.skip(4);let n=nj(e);for(let r=0;r<n;r++){let n=nj(e);t.sampleTable.chunkOffsets.push(n)}}break;case"co64":{let t=this.currentTrack;if(!t||!t.sampleTable)break;e.skip(4);let n=nj(e);for(let r=0;r<n;r++){let n=nq(e);t.sampleTable.chunkOffsets.push(n)}}break;case"mvex":this.isFragmented=!0,this.readContiguousBoxes(e.slice(r,n.contentSize));break;case"mehd":{let t=nz(e);e.skip(3);let n=1===t?nq(e):nj(e);this.movieDurationInTimescale=n}break;case"trex":{e.skip(4);let t=nj(e),n=nj(e),r=nj(e),i=nj(e),a=nj(e);this.fragmentTrackDefaults.push({trackId:t,defaultSampleDescriptionIndex:n,defaultSampleDuration:r,defaultSampleSize:i,defaultSampleFlags:a})}break;case"tfra":{let t=nz(e);e.skip(3);let n=nj(e),r=this.tracks.find(e=>e.id===n);if(!r)break;let i=nj(e),a=[nz,nF,nB,nj],o=a[(48&i)>>4],l=a[(12&i)>>2],s=a[3&i],c=nj(e);for(let n=0;n<c;n++){let n=1===t?nq(e):nj(e),i=1===t?nq(e):nj(e);o(e),l(e),s(e),r.fragmentLookupTable.push({timestamp:n,moofOffset:i})}r.fragmentLookupTable.sort((e,t)=>e.timestamp-t.timestamp);for(let e=0;e<r.fragmentLookupTable.length-1;e++){let t=r.fragmentLookupTable[e],n=r.fragmentLookupTable[e+1];t.timestamp===n.timestamp&&(r.fragmentLookupTable.splice(e+1,1),e--)}}break;case"moof":this.currentFragment={moofOffset:t,moofSize:n.totalSize,implicitBaseDataOffset:t,trackData:new Map},this.readContiguousBoxes(e.slice(r,n.contentSize)),this.lastReadFragment=this.currentFragment,this.currentFragment=null;break;case"traf":if(et(this.currentFragment),this.readContiguousBoxes(e.slice(r,n.contentSize)),this.currentTrack){let e=this.currentFragment.trackData.get(this.currentTrack.id);if(e){let{currentFragmentState:t}=this.currentTrack;et(t),null!==t.startTimestamp&&(rr(e,t.startTimestamp),e.startTimestampIsFinal=!0)}this.currentTrack.currentFragmentState=null,this.currentTrack=null}break;case"tfhd":{et(this.currentFragment),e.skip(1);let t=nB(e),n=nj(e),r=this.tracks.find(e=>e.id===n);if(!r)break;let i=this.fragmentTrackDefaults.find(e=>e.trackId===n);this.currentTrack=r,r.currentFragmentState={baseDataOffset:this.currentFragment.implicitBaseDataOffset,sampleDescriptionIndex:i?.defaultSampleDescriptionIndex??null,defaultSampleDuration:i?.defaultSampleDuration??null,defaultSampleSize:i?.defaultSampleSize??null,defaultSampleFlags:i?.defaultSampleFlags??null,startTimestamp:null},1&t?r.currentFragmentState.baseDataOffset=nq(e):131072&t&&(r.currentFragmentState.baseDataOffset=this.currentFragment.moofOffset),2&t&&(r.currentFragmentState.sampleDescriptionIndex=nj(e)),8&t&&(r.currentFragmentState.defaultSampleDuration=nj(e)),16&t&&(r.currentFragmentState.defaultSampleSize=nj(e)),32&t&&(r.currentFragmentState.defaultSampleFlags=nj(e)),65536&t&&(r.currentFragmentState.defaultSampleDuration=0)}break;case"tfdt":{let t=this.currentTrack;if(!t)break;et(t.currentFragmentState);let n=nz(e);e.skip(3);let r=0===n?nj(e):nq(e);t.currentFragmentState.startTimestamp=r}break;case"trun":{let t=this.currentTrack;if(!t)break;
69if(et(this.currentFragment),et(t.currentFragmentState),this.currentFragment.trackData.has(t.id)){console.warn("Can't have two trun boxes for the same track in one fragment. Ignoring...");break}let n=nz(e),r=nB(e),i=!!(256&r),a=!!(512&r),o=!!(1024&r),l=!!(2048&r),s=nj(e),c=t.currentFragmentState.baseDataOffset;1&r&&(c+=nU(e));let u=null;4&r&&(u=nj(e));let d=c;if(0===s){this.currentFragment.implicitBaseDataOffset=d;break}let h=0,f={track:t,startTimestamp:0,endTimestamp:0,firstKeyFrameTimestamp:null,samples:[],presentationTimestamps:[],startTimestampIsFinal:!1};this.currentFragment.trackData.set(t.id,f);for(let r=0;r<s;r++){let s,c,p;i?s=nj(e):(et(null!==t.currentFragmentState.defaultSampleDuration),s=t.currentFragmentState.defaultSampleDuration),a?c=nj(e):(et(null!==t.currentFragmentState.defaultSampleSize),c=t.currentFragmentState.defaultSampleSize),o?p=nj(e):(et(null!==t.currentFragmentState.defaultSampleFlags),p=t.currentFragmentState.defaultSampleFlags),0===r&&null!==u&&(p=u);let m=0;l&&(m=0===n?nj(e):nU(e));let g=!(65536&p);f.samples.push({presentationTimestamp:h+m,duration:s,byteOffset:d,byteSize:c,isKeyFrame:g}),d+=c,h+=s}f.presentationTimestamps=f.samples.map((e,t)=>({presentationTimestamp:e.presentationTimestamp,sampleIndex:t})).sort((e,t)=>e.presentationTimestamp-t.presentationTimestamp);for(let e=0;e<f.presentationTimestamps.length;e++){let t=f.presentationTimestamps[e],n=f.samples[t.sampleIndex];if(null===f.firstKeyFrameTimestamp&&n.isKeyFrame&&(f.firstKeyFrameTimestamp=n.presentationTimestamp),e<f.presentationTimestamps.length-1){let r=f.presentationTimestamps[e+1];n.duration=r.presentationTimestamp-t.presentationTimestamp}}let p=f.samples[f.presentationTimestamps[0].sampleIndex],m=f.samples[er(f.presentationTimestamps).sampleIndex];f.startTimestamp=p.presentationTimestamp,f.endTimestamp=m.presentationTimestamp+m.duration,this.currentFragment.implicitBaseDataOffset=d}break;case"udta":for(let{boxInfo:t,slice:i}of this.iterateContiguousBoxes(e.slice(r,n.contentSize))){if("meta"!==t.name&&!this.currentTrack){let e=i.filePos;this.metadataTags.raw??={},"\xa9"===t.name[0]?this.metadataTags.raw[t.name]??=n4(i):this.metadataTags.raw[t.name]??=nD(i,t.contentSize),i.filePos=e}switch(t.name){case"meta":i.skip(-t.headerSize),this.traverseBox(i);break;case"\xa9nam":case"name":this.currentTrack?this.currentTrack.name=es.decode(nD(i,t.contentSize)):this.metadataTags.title??=n4(i);break;case"\xa9des":this.currentTrack||(this.metadataTags.description??=n4(i));break;case"\xa9ART":this.currentTrack||(this.metadataTags.artist??=n4(i));break;case"\xa9alb":this.currentTrack||(this.metadataTags.album??=n4(i));break;case"albr":this.currentTrack||(this.metadataTags.albumArtist??=n4(i));break;case"\xa9gen":this.currentTrack||(this.metadataTags.genre??=n4(i));break;case"\xa9day":if(!this.currentTrack){let e=new Date(n4(i));Number.isNaN(e.getTime())||(this.metadataTags.date??=e)}break;case"\xa9cmt":this.currentTrack||(this.metadataTags.comment??=n4(i));break;case"\xa9lyr":this.currentTrack||(this.metadataTags.lyrics??=n4(i))}}break;case"meta":{if(this.currentTrack)break;let t=nj(e);this.currentMetadataKeys=new Map,0!==t?this.readContiguousBoxes(e.slice(r,n.contentSize)):this.readContiguousBoxes(e.slice(r+4,n.contentSize-4)),this.currentMetadataKeys=null}break;case"keys":{if(!this.currentMetadataKeys)break;e.skip(4);let t=nj(e);for(let n=0;n<t;n++){let t=nj(e);e.skip(4);let r=es.decode(nD(e,t-8));this.currentMetadataKeys.set(n+1,r)}}break;case"ilst":if(!this.currentMetadataKeys)break;for(let{boxInfo:t,slice:i}of this.iterateContiguousBoxes(e.slice(r,n.contentSize))){let e=t.name,n=(e.charCodeAt(0)<<24)+(e.charCodeAt(1)<<16)+(e.charCodeAt(2)<<8)+e.charCodeAt(3);this.currentMetadataKeys.has(n)&&(e=this.currentMetadataKeys.get(n));let r=n3(i);switch(this.metadataTags.raw??={},this.metadataTags.raw[e]??=r,e){case"\xa9nam":case"titl":case"com.apple.quicktime.title":case"title":"string"==typeof r&&(this.metadataTags.title??=r);break;case"\xa9des":case"desc":case"dscp":case"com.apple.quicktime.description":case"description":"string"==typeof r&&(this.metadataTags.description??=r);break;case"\xa9ART":case"com.apple.quicktime.artist":case"artist":"string"==typeof r&&(this.metadataTags.artist??=r);break;
69case"\xa9alb":case"albm":case"com.apple.quicktime.album":case"album":"string"==typeof r&&(this.metadataTags.album??=r);break;case"aART":case"album_artist":"string"==typeof r&&(this.metadataTags.albumArtist??=r);break;case"\xa9cmt":case"com.apple.quicktime.comment":case"comment":"string"==typeof r&&(this.metadataTags.comment??=r);break;case"\xa9gen":case"gnre":case"com.apple.quicktime.genre":case"genre":"string"==typeof r&&(this.metadataTags.genre??=r);break;case"\xa9lyr":case"lyrics":"string"==typeof r&&(this.metadataTags.lyrics??=r);break;case"\xa9day":case"rldt":case"com.apple.quicktime.creationdate":case"date":if("string"==typeof r){let e=new Date(r);Number.isNaN(e.getTime())||(this.metadataTags.date??=e)}break;case"covr":case"com.apple.quicktime.artwork":r instanceof nR?(this.metadataTags.images??=[],this.metadataTags.images.push({data:r.data,kind:"coverFront",mimeType:r.mimeType})):r instanceof Uint8Array&&(this.metadataTags.images??=[],this.metadataTags.images.push({data:r,kind:"coverFront",mimeType:"image/*"}));break;case"track":if("string"==typeof r){let e=r.split("/"),t=Number.parseInt(e[0],10),n=e[1]&&Number.parseInt(e[1],10);Number.isInteger(t)&&t>0&&(this.metadataTags.trackNumber??=t),n&&Number.isInteger(n)&&n>0&&(this.metadataTags.tracksTotal??=n)}break;case"trkn":if(r instanceof Uint8Array&&r.length>=6){let e=el(r),t=e.getUint16(2,!1),n=e.getUint16(4,!1);t>0&&(this.metadataTags.trackNumber??=t),n>0&&(this.metadataTags.tracksTotal??=n)}break;case"disc":case"disk":if(r instanceof Uint8Array&&r.length>=6){let e=el(r),t=e.getUint16(2,!1),n=e.getUint16(4,!1);t>0&&(this.metadataTags.discNumber??=t),n>0&&(this.metadataTags.discsTotal??=n)}}}}return e.filePos=i,!0}}class n6{constructor(e){this.internalTrack=e,this.packetToSampleIndex=new WeakMap,this.packetToFragmentLocation=new WeakMap}getId(){return this.internalTrack.id}getNumber(){let e=this.internalTrack.demuxer,t=this.internalTrack.inputTrack.type,n=0;for(let r of e.tracks)if(r.inputTrack.type===t&&n++,r===this.internalTrack)break;return n}getCodec(){throw Error("Not implemented on base class.")}getInternalCodecId(){return this.internalTrack.internalCodecId}getName(){return this.internalTrack.name}getLanguageCode(){return this.internalTrack.languageCode}getTimeResolution(){return this.internalTrack.timescale}getDisposition(){return this.internalTrack.disposition}async computeDuration(){let e=await this.getPacket(1/0,{metadataOnly:!0});return(e?.timestamp??0)+(e?.duration??0)}async getFirstTimestamp(){let e=await this.getFirstPacket({metadataOnly:!0});return e?.timestamp??0}async getFirstPacket(e){let t=await this.fetchPacketForSampleIndex(0,e);return t||!this.internalTrack.demuxer.isFragmented?t:this.performFragmentedLookup(null,e=>e.trackData.get(this.internalTrack.id)?{sampleIndex:0,correctSampleFound:!0}:{sampleIndex:-1,correctSampleFound:!1},-1/0,1/0,e)}mapTimestampIntoTimescale(e){return eI(e*this.internalTrack.timescale)+this.internalTrack.editListOffset}async getPacket(e,t){let n=this.mapTimestampIntoTimescale(e),r=this.internalTrack.demuxer.getSampleTableForTrack(this.internalTrack),i=n7(r,n),a=await this.fetchPacketForSampleIndex(i,t);return ra(r)&&this.internalTrack.demuxer.isFragmented?this.performFragmentedLookup(null,e=>{let t=e.trackData.get(this.internalTrack.id);if(!t)return{sampleIndex:-1,correctSampleFound:!1};let r=ex(t.presentationTimestamps,n,e=>e.presentationTimestamp);return{sampleIndex:-1!==r?t.presentationTimestamps[r].sampleIndex:-1,correctSampleFound:-1!==r&&n<t.endTimestamp}},n,n,t):a}async getNextPacket(e,t){let n=this.packetToSampleIndex.get(e);if(void 0!==n)return this.fetchPacketForSampleIndex(n+1,t);let r=this.packetToFragmentLocation.get(e);if(void 0===r)throw Error("Packet was not created from this track.");return this.performFragmentedLookup(r.fragment,e=>{if(e===r.fragment){let t=e.trackData.get(this.internalTrack.id);if(r.sampleIndex+1<t.samples.length)return{sampleIndex:r.sampleIndex+1,correctSampleFound:!0}}else if(e.trackData.get(this.internalTrack.id))return{sampleIndex:0,correctSampleFound:!0};return{sampleIndex:-1,correctSampleFound:!1}},-1/0,1/0,t)}async getKeyPacket(e,t){let n=this.mapTimestampIntoTimescale(e),r=this.internalTrack.demuxer.getSampleTableForTrack(this.internalTrack),i=re(r,n),a=await this.fetchPacketForSampleIndex(i,t);return ra(r)&&this.internalTrack.demuxer.isFragmented?this.performFragmentedLookup(null,e=>{let t=e.trackData.get(this.internalTrack.id);
69if(!t)return{sampleIndex:-1,correctSampleFound:!1};let r=eS(t.presentationTimestamps,e=>t.samples[e.sampleIndex].isKeyFrame&&e.presentationTimestamp<=n);return{sampleIndex:-1!==r?t.presentationTimestamps[r].sampleIndex:-1,correctSampleFound:-1!==r&&n<t.endTimestamp}},n,n,t):a}async getNextKeyPacket(e,t){let n=this.packetToSampleIndex.get(e);if(void 0!==n){let e=rn(this.internalTrack.demuxer.getSampleTableForTrack(this.internalTrack),n);return this.fetchPacketForSampleIndex(e,t)}let r=this.packetToFragmentLocation.get(e);if(void 0===r)throw Error("Packet was not created from this track.");return this.performFragmentedLookup(r.fragment,e=>{if(e===r.fragment){let t=e.trackData.get(this.internalTrack.id).samples.findIndex((e,t)=>e.isKeyFrame&&t>r.sampleIndex);if(-1!==t)return{sampleIndex:t,correctSampleFound:!0}}else{let t=e.trackData.get(this.internalTrack.id);if(t&&null!==t.firstKeyFrameTimestamp){let e=t.samples.findIndex(e=>e.isKeyFrame);return et(-1!==e),{sampleIndex:e,correctSampleFound:!0}}}return{sampleIndex:-1,correctSampleFound:!1}},-1/0,1/0,t)}async fetchPacketForSampleIndex(e,t){let n;if(-1===e)return null;let r=rt(this.internalTrack.demuxer.getSampleTableForTrack(this.internalTrack),e);if(!r)return null;if(t.metadataOnly)n=t1;else{let e=this.internalTrack.demuxer.reader.requestSlice(r.sampleOffset,r.sampleSize);e instanceof Promise&&(e=await e),et(e),n=nD(e,r.sampleSize)}let i=(r.presentationTimestamp-this.internalTrack.editListOffset)/this.internalTrack.timescale,a=r.duration/this.internalTrack.timescale,o=new t2(n,r.isKeyFrame?"key":"delta",i,a,e,r.sampleSize);return this.packetToSampleIndex.set(o,e),o}async fetchPacketInFragment(e,t,n){let r;if(-1===t)return null;let i=e.trackData.get(this.internalTrack.id).samples[t];if(et(i),n.metadataOnly)r=t1;else{let e=this.internalTrack.demuxer.reader.requestSlice(i.byteOffset,i.byteSize);e instanceof Promise&&(e=await e),et(e),r=nD(e,i.byteSize)}let a=(i.presentationTimestamp-this.internalTrack.editListOffset)/this.internalTrack.timescale,o=i.duration/this.internalTrack.timescale,l=new t2(r,i.isKeyFrame?"key":"delta",a,o,e.moofOffset+t,i.byteSize);return this.packetToFragmentLocation.set(l,{fragment:e,sampleIndex:t}),l}async performFragmentedLookup(e,t,n,r,i){let a;let o=this.internalTrack.demuxer,l=null,s=null,c=-1;if(e){let{sampleIndex:n,correctSampleFound:r}=t(e);if(r)return this.fetchPacketInFragment(e,n,i);-1!==n&&(s=e,c=n)}let u=ex(this.internalTrack.fragmentLookupTable,n,e=>e.timestamp),d=-1!==u?this.internalTrack.fragmentLookupTable[u]:null,h=ex(this.internalTrack.fragmentPositionCache,n,e=>e.startTimestamp),f=-1!==h?this.internalTrack.fragmentPositionCache[h]:null,p=Math.max(d?.moofOffset??0,f?.moofOffset??0)||null;for(e?null===p||e.moofOffset>=p?(a=e.moofOffset+e.moofSize,l=e):a=p:a=p??0;;){if(l){let e=l.trackData.get(this.internalTrack.id);if(e&&e.startTimestamp>r)break}let e=o.reader.requestSliceRange(a,8,16);if(e instanceof Promise&&(e=await e),!e)break;let n=a,u=nQ(e);if(!u)break;if("moof"===u.name){let{sampleIndex:e,correctSampleFound:r}=t(l=await o.readFragment(n));if(r)return this.fetchPacketInFragment(l,e,i);-1!==e&&(s=l,c=e)}a=n+u.totalSize}if(d&&(!s||s.moofOffset<d.moofOffset)){let e=this.internalTrack.fragmentLookupTable[u-1];et(!e||e.timestamp<d.timestamp);let n=e?.timestamp??-1/0;return this.performFragmentedLookup(null,t,n,r,i)}return s?this.fetchPacketInFragment(s,c,i):null}}class n5 extends n6{constructor(e){super(e),this.decoderConfigPromise=null,this.internalTrack=e}getCodec(){return this.internalTrack.info.codec}getCodedWidth(){return this.internalTrack.info.width}getCodedHeight(){return this.internalTrack.info.height}getSquarePixelWidth(){return this.internalTrack.info.squarePixelWidth}getSquarePixelHeight(){return this.internalTrack.info.squarePixelHeight}getRotation(){return this.internalTrack.rotation}async getColorSpace(){return{primaries:this.internalTrack.info.colorSpace?.primaries,transfer:this.internalTrack.info.colorSpace?.transfer,matrix:this.internalTrack.info.colorSpace?.matrix,fullRange:this.internalTrack.info.colorSpace?.fullRange}}
69async canBeTransparent(){return!1}async getDecoderConfig(){return this.internalTrack.info.codec?this.decoderConfigPromise??=(async()=>{if("vp9"!==this.internalTrack.info.codec||this.internalTrack.info.vp9CodecInfo){if("av1"===this.internalTrack.info.codec&&!this.internalTrack.info.av1CodecInfo){let e=await this.getFirstPacket({});this.internalTrack.info.av1CodecInfo=e&&tN(e.data)}}else{let e=await this.getFirstPacket({});this.internalTrack.info.vp9CodecInfo=e&&tD(e.data)}let e={codec:ti(this.internalTrack.info),codedWidth:this.internalTrack.info.width,codedHeight:this.internalTrack.info.height,description:this.internalTrack.info.codecDescription??void 0,colorSpace:this.internalTrack.info.colorSpace??void 0};return(this.internalTrack.info.width!==this.internalTrack.info.squarePixelWidth||this.internalTrack.info.height!==this.internalTrack.info.squarePixelHeight)&&(e.displayAspectWidth=this.internalTrack.info.squarePixelWidth,e.displayAspectHeight=this.internalTrack.info.squarePixelHeight),e})():null}}class n9 extends n6{constructor(e){super(e),this.decoderConfig=null,this.internalTrack=e}getCodec(){return this.internalTrack.info.codec}getNumberOfChannels(){return this.internalTrack.info.numberOfChannels}getSampleRate(){return this.internalTrack.info.sampleRate}async getDecoderConfig(){return this.internalTrack.info.codec?this.decoderConfig??={codec:ta(this.internalTrack.info),numberOfChannels:this.internalTrack.info.numberOfChannels,sampleRate:this.internalTrack.info.sampleRate,description:this.internalTrack.info.codecDescription??void 0}:null}}let n7=(e,t)=>{if(e.presentationTimestamps){let n=ex(e.presentationTimestamps,t,e=>e.presentationTimestamp);return -1===n?-1:e.presentationTimestamps[n].sampleIndex}{let n=ex(e.sampleTimingEntries,t,e=>e.startDecodeTimestamp);if(-1===n)return -1;let r=e.sampleTimingEntries[n];return r.startIndex+Math.min(Math.floor((t-r.startDecodeTimestamp)/r.delta),r.count-1)}},re=(e,t)=>{if(!e.keySampleIndices)return n7(e,t);if(e.presentationTimestamps){let n=ex(e.presentationTimestamps,t,e=>e.presentationTimestamp);if(-1===n)return -1;for(let t=n;t>=0;t--){let n=e.presentationTimestamps[t].sampleIndex;
69if(-1!==ew(e.keySampleIndices,n,e=>e))return n}return -1}{let n=n7(e,t),r=ex(e.keySampleIndices,n,e=>e);return e.keySampleIndices[r]??-1}},rt=(e,t)=>{let n=ex(e.sampleTimingEntries,t,e=>e.startIndex),r=e.sampleTimingEntries[n];if(!r||r.startIndex+r.count<=t)return null;let i=r.startDecodeTimestamp+(t-r.startIndex)*r.delta,a=ex(e.sampleCompositionTimeOffsets,t,e=>e.startIndex),o=e.sampleCompositionTimeOffsets[a];o&&t-o.startIndex<o.count&&(i+=o.offset);let l=e.sampleSizes[Math.min(t,e.sampleSizes.length-1)],s=ex(e.sampleToChunk,t,e=>e.startSampleIndex),c=e.sampleToChunk[s];et(c);let u=c.startChunkIndex+Math.floor((t-c.startSampleIndex)/c.samplesPerChunk),d=e.chunkOffsets[u],h=c.startSampleIndex+(u-c.startChunkIndex)*c.samplesPerChunk,f=0,p=d;if(1===e.sampleSizes.length)p+=l*(t-h),f+=l*c.samplesPerChunk;else for(let n=h;n<h+c.samplesPerChunk;n++){let r=e.sampleSizes[n];n<t&&(p+=r),f+=r}let m=r.delta;if(e.presentationTimestamps){let n=e.presentationTimestampIndexMap[t];et(void 0!==n),n<e.presentationTimestamps.length-1&&(m=e.presentationTimestamps[n+1].presentationTimestamp-i)}return{presentationTimestamp:i,duration:m,sampleOffset:p,sampleSize:l,chunkOffset:d,chunkSize:f,isKeyFrame:!e.keySampleIndices||-1!==ew(e.keySampleIndices,t,e=>e)}},rn=(e,t)=>{if(!e.keySampleIndices)return t+1;let n=ex(e.keySampleIndices,t,e=>e);return e.keySampleIndices[n+1]??-1},rr=(e,t)=>{for(let n of(e.startTimestamp+=t,e.endTimestamp+=t,e.samples))n.presentationTimestamp+=t;for(let n of e.presentationTimestamps)n.presentationTimestamp+=t},ri=e=>{let[t,n]=e,r=Math.atan2(n,t);return Number.isFinite(r)?180/Math.PI*r:0},ra=e=>0===e.sampleSizes.length;(o=g||(g={}))[o.EBML=440786851]="EBML",o[o.EBMLVersion=17030]="EBMLVersion",o[o.EBMLReadVersion=17143]="EBMLReadVersion",o[o.EBMLMaxIDLength=17138]="EBMLMaxIDLength",o[o.EBMLMaxSizeLength=17139]="EBMLMaxSizeLength",o[o.DocType=17026]="DocType",o[o.DocTypeVersion=17031]="DocTypeVersion",o[o.DocTypeReadVersion=17029]="DocTypeReadVersion",o[o.Void=236]="Void",o[o.Segment=408125543]="Segment",o[o.SeekHead=290298740]="SeekHead",o[o.Seek=19899]="Seek",o[o.SeekID=21419]="SeekID",o[o.SeekPosition=21420]="SeekPosition",o[o.Duration=17545]="Duration",o[o.Info=357149030]="Info",o[o.TimestampScale=2807729]="TimestampScale",o[o.MuxingApp=19840]="MuxingApp",o[o.WritingApp=22337]="WritingApp",o[o.Tracks=374648427]="Tracks",o[o.TrackEntry=174]="TrackEntry",o[o.TrackNumber=215]="TrackNumber",o[o.TrackUID=29637]="TrackUID",o[o.TrackType=131]="TrackType",o[o.FlagEnabled=185]="FlagEnabled",o[o.FlagDefault=136]="FlagDefault",o[o.FlagForced=21930]="FlagForced",o[o.FlagOriginal=21934]="FlagOriginal",o[o.FlagHearingImpaired=21931]="FlagHearingImpaired",o[o.FlagVisualImpaired=21932]="FlagVisualImpaired",o[o.FlagCommentary=21935]="FlagCommentary",o[o.FlagLacing=156]="FlagLacing",o[o.Name=21358]="Name",o[o.Language=2274716]="Language",o[o.LanguageBCP47=2274717]="LanguageBCP47",o[o.CodecID=134]="CodecID",o[o.CodecPrivate=25506]="CodecPrivate",o[o.CodecDelay=22186]="CodecDelay",o[o.SeekPreRoll=22203]="SeekPreRoll",o[o.DefaultDuration=2352003]="DefaultDuration",o[o.Video=224]="Video",o[o.PixelWidth=176]="PixelWidth",o[o.PixelHeight=186]="PixelHeight",o[o.DisplayWidth=21680]="DisplayWidth",o[o.DisplayHeight=21690]="DisplayHeight",o[o.DisplayUnit=21682]="DisplayUnit",o[o.AlphaMode=21440]="AlphaMode",o[o.Audio=225]="Audio",o[o.SamplingFrequency=181]="SamplingFrequency",o[o.Channels=159]="Channels",o[o.BitDepth=25188]="BitDepth",o[o.SimpleBlock=163]="SimpleBlock",o[o.BlockGroup=160]="BlockGroup",o[o.Block=161]="Block",o[o.BlockAdditions=30113]="BlockAdditions",o[o.BlockMore=166]="BlockMore",o[o.BlockAdditional=165]="BlockAdditional",o[o.BlockAddID=238]="BlockAddID",o[o.BlockDuration=155]="BlockDuration",o[o.ReferenceBlock=251]="ReferenceBlock",o[o.Cluster=524531317]="Cluster",o[o.Timestamp=231]="Timestamp",o[o.Cues=475249515]="Cues",o[o.CuePoint=187]="CuePoint",o[o.CueTime=179]="CueTime",o[o.CueTrackPositions=183]="CueTrackPositions",o[o.CueTrack=247]="CueTrack",o[o.CueClusterPosition=241]="CueClusterPosition",o[o.Colour=21936]="Colour",o[o.MatrixCoefficients=21937]="MatrixCoefficients",o[o.TransferCharacteristics=21946]="TransferCharacteristics",o[o.Primaries=21947]="Primaries",o[o.Range=21945]="Range",o[o.Projection=30320]="Projection",o[o.ProjectionType=30321]="ProjectionType",o[o.ProjectionPoseRoll=30325]="ProjectionPoseRoll",o[o.Attachments=423732329]="Attachments",o[o.AttachedFile=24999]="AttachedFile",o[o.FileDescription=18046]="FileDescription",o[o.FileName=18030]="FileName",o[o.FileMediaType=18016]="FileMediaType",o[o.FileData=18012]="FileData",o[o.FileUID=18094]="FileUID",o[o.Chapters=272869232]="Chapters",o[o.Tags=307544935]="Tags",o[o.Tag=29555]="Tag",o[o.Targets=25536]="Targets",o[o.TargetTypeValue=26826]="TargetTypeValue",o[o.TargetType=25546]="TargetType",o[o.TagTrackUID=25541]="TagTrackUID",o[o.TagEditionUID=25545]="TagEditionUID",o[o.TagChapterUID=25540]="TagChapterUID",o[o.TagAttachmentUID=25542]="TagAttachmentUID",o[o.SimpleTag=26568]="SimpleTag",o[o.TagName=17827]="TagName",o[o.TagLanguage=17530]="TagLanguage",o[o.TagString=17543]="TagString",o[o.TagBinary=17541]="TagBinary",o[o.ContentEncodings=28032]="ContentEncodings",o[o.ContentEncoding=25152]="ContentEncoding",o[o.ContentEncodingOrder=20529]="ContentEncodingOrder",o[o.ContentEncodingScope=20530]="ContentEncodingScope",o[o.ContentCompression=20532]="ContentCompression",o[o.ContentCompAlgo=16980]="ContentCompAlgo",o[o.ContentCompSettings=16981]="ContentCompSettings",o[o.ContentEncryption=20533]="ContentEncryption";let ro=[g.EBML,g.Segment],rl=[g.SeekHead,g.Info,g.Cluster,g.Tracks,g.Cues,g.Attachments,g.Chapters,g.Tags],rs=[...ro,...rl],rc=e=>{if(e.remainingLength<1)return null;let t=nz(e);if(e.skip(-1),0===t)return null;let n=1,r=128;for(;(t&r)==0;)n++,r>>=1;return e.remainingLength<n?null:n},ru=e=>{if(e.remainingLength<1)return null;let t=nz(e);if(0===t)return null;let n=1,r=128;for(;(t&r)==0;)n++,r>>=1;if(e.remainingLength<n-1)return null;let i=t&r-1;for(let t=1;t<n;t++)i*=256,i+=nz(e);return i},rd=(e,t)=>{if(t<1||t>8)throw Error("Bad unsigned int size "+t);let n=0;for(let r=0;r<t;r++)n*=256,n+=nz(e);return n},rh=(e,t)=>{if(t<1)throw Error("Bad unsigned int size "+t);let n=0n;for(let r=0;r<t;r++)n<<=8n,n+=BigInt(nz(e));return n},rf=e=>{let t=rc(e);return null===t||e.remainingLength<t?null:rd(e,t)},rp=e=>{if(e.remainingLength<1)return null;if(255===nz(e))return;e.skip(-1);let t=ru(e);return null===t?null:72057594037927940!==t?t:void 0},rm=e=>{et(e.remainingLength>=2);let t=rf(e);if(null===t)return null;let n=rp(e);return null===n?null:{id:t,size:n}},rg=(e,t)=>{let n=nD(e,t),r=0;for(;r<t&&0!==n[r];)r+=1;return String.fromCharCode(...n.subarray(0,r))},rv=(e,t)=>
69{let n=nD(e,t),r=0;for(;r<t&&0!==n[r];)r+=1;return es.decode(n.subarray(0,r))},rb=(e,t)=>{if(0===t)return 0;if(4!==t&&8!==t)throw Error("Bad float size "+t);return 4===t?nY(e):nK(e)},ry=async(e,t,n,r)=>{let i=new Set(n),a=t;for(;null===r||a<r;){let t=e.requestSliceRange(a,2,16);if(t instanceof Promise&&(t=await t),!t)break;let n=rm(t);if(!n)break;if(i.has(n.id))return{pos:a,found:!0};rC(n.size),a=t.filePos+n.size}return{pos:null!==r&&r>a?r:a,found:!1}},rw=async(e,t,n,r)=>{let i=new Set(n),a=t;for(;a<r;){let t=e.requestSliceRange(a,0,Math.min(65536,r-a));if(t instanceof Promise&&(t=await t),!t||t.length<8)break;for(let e=0;e<t.length-8;e++){t.filePos=a;let e=rf(t);if(null!==e&&i.has(e))return a;a++}}return null},rx={avc:"V_MPEG4/ISO/AVC",hevc:"V_MPEGH/ISO/HEVC",vp8:"V_VP8",vp9:"V_VP9",av1:"V_AV1",aac:"A_AAC",mp3:"A_MPEG/L3",opus:"A_OPUS",vorbis:"A_VORBIS",flac:"A_FLAC",ac3:"A_AC3",eac3:"A_EAC3"};function rC(e){if(void 0===e)throw Error("Undefined element size is used in a place where it is not supported.")}let rE=e=>{let t=(e.hasVideo?"video/":e.hasAudio?"audio/":"application/")+(e.isWebM?"webm":"x-matroska");if(e.codecStrings.length>0){let n=[...new Set(e.codecStrings.filter(Boolean))];t+=`; codecs="${n.join(", ")}"`}return t};(l=v||(v={}))[l.None=0]="None",l[l.Xiph=1]="Xiph",l[l.FixedSize=2]="FixedSize",l[l.Ebml=3]="Ebml",(s=b||(b={}))[s.Block=1]="Block",s[s.Private=2]="Private",s[s.Next=4]="Next",(c=y||(y={}))[c.Zlib=0]="Zlib",c[c.Bzlib=1]="Bzlib",c[c.lzo1x=2]="lzo1x",c[c.HeaderStripping=3]="HeaderStripping";let rk=[{id:g.SeekHead,flag:"seekHeadSeen"},{id:g.Info,flag:"infoSeen"},{id:g.Tracks,flag:"tracksSeen"},{id:g.Cues,flag:"cuesSeen"}];class rS extends tJ{constructor(e){super(e),this.readMetadataPromise=null,this.segments=[],this.currentSegment=null,this.currentTrack=null,this.currentCluster=null,this.currentBlock=null,this.currentBlockAdditional=null,this.currentCueTime=null,this.currentDecodingInstruction=null,this.currentTagTargetIsMovie=!0,this.currentSimpleTagName=null,this.currentAttachedFile=null,this.isWebM=!1,this.reader=e._reader}async computeDuration(){let e=await this.getTracks();return Math.max(0,...await Promise.all(e.map(e=>e.computeDuration())))}async getTracks(){return await this.readMetadata(),this.segments.flatMap(e=>e.tracks.map(e=>e.inputTrack))}async getMimeType(){await this.readMetadata();let e=await this.getTracks(),t=await Promise.all(e.map(e=>e.getCodecParameterString()));return rE({isWebM:this.isWebM,hasVideo:this.segments.some(e=>e.tracks.some(e=>e.info?.type==="video")),hasAudio:this.segments.some(e=>e.tracks.some(e=>e.info?.type==="audio")),codecStrings:t.filter(Boolean)})}async getMetadataTags(){for(let e of(await this.readMetadata(),this.segments))e.metadataTagsCollected||(null!==this.reader.fileSize&&await this.loadSegmentMetadata(e),e.metadataTagsCollected=!0);let e={};for(let t of this.segments)e={...e,...t.metadataTags};return e}readMetadata(){return this.readMetadataPromise??=(async()=>{let e=0;for(;;){let t=this.reader.requestSliceRange(e,2,16);if(t instanceof Promise&&(t=await t),!t)break;let n=rm(t);if(!n)break;let r=n.id,i=n.size,a=t.filePos;if(r===g.EBML){rC(i);let e=this.reader.requestSlice(a,i);if(e instanceof Promise&&(e=await e),!e)break;this.readContiguousElements(e)}else if(r===g.Segment){if(await this.readSegment(a,i),void 0===i||null===this.reader.fileSize)break}else if(r===g.Cluster){if(null===this.reader.fileSize)break;void 0===i&&(i=(await ry(this.reader,a,rs,this.reader.fileSize)).pos-a);let e=er(this.segments);e&&(e.elementEndPos=a+i)}rC(i),e=a+i}})()}async readSegment(e,t){this.currentSegment={seekHeadSeen:!1,infoSeen:!1,tracksSeen:!1,cuesSeen:!1,tagsSeen:!1,attachmentsSeen:!1,timestampScale:-1,timestampFactor:-1,duration:-1,seekEntries:[],tracks:[],cuePoints:[],dataStartPos:e,elementEndPos:void 0===t?null:e+t,clusterSeekStartPos:e,lastReadCluster:null,metadataTags:{},metadataTagsCollected:!1},this.segments.push(this.currentSegment);let n=e;for(;null===this.currentSegment.elementEndPos||n<this.currentSegment.elementEndPos;){let e=this.reader.requestSliceRange(n,2,16);if(e instanceof Promise&&(e=await e),!e)break;let t=n,r=rm(e);if(!r||!rl.includes(r.id)&&r.id!==g.Void){let e=await rw(this.reader,t,rl,Math.min(this.currentSegment.elementEndPos??1/0,t+10485760));if(e){n=e;continue}break}let{id:i,size:a}=r,o=e.filePos,l=rk.findIndex(e=>e.id===i);if(-1!==l){let e=rk[l].flag;this.currentSegment[e]=!0,rC(a);let t=this.reader.requestSlice(o,a);t instanceof Promise&&(t=await t),t&&this.readContiguousElements(t)}else if(i===g.Tags||i===g.Attachments){i===g.Tags?this.currentSegment.tagsSeen=!0:this.currentSegment.attachmentsSeen=!0,rC(a);let e=this.reader.requestSlice(o,a);e instanceof Promise&&(e=await e),e&&this.readContiguousElements(e)}else if(i===g.Cluster){this.currentSegment.clusterSeekStartPos=t;break}if(void 0===a)break;n=o+a}if(this.currentSegment.seekEntries.sort((e,t)=>
69e.segmentPosition-t.segmentPosition),null!==this.reader.fileSize)for(let t of this.currentSegment.seekEntries){let n=rk.find(e=>e.id===t.id);if(!n||this.currentSegment[n.flag])continue;let r=this.reader.requestSliceRange(e+t.segmentPosition,2,16);if(r instanceof Promise&&(r=await r),!r)continue;let i=rm(r);if(!i)continue;let{id:a,size:o}=i;if(a!==n.id)continue;rC(o),this.currentSegment[n.flag]=!0;let l=this.reader.requestSlice(r.filePos,o);l instanceof Promise&&(l=await l),l&&this.readContiguousElements(l)}for(let e of(-1===this.currentSegment.timestampScale&&(this.currentSegment.timestampScale=1e6,this.currentSegment.timestampFactor=1e3),this.currentSegment.tracks))null!==e.defaultDurationNs&&(e.defaultDuration=this.currentSegment.timestampFactor*e.defaultDurationNs/1e9);this.currentSegment.tracks.sort((e,t)=>Number(t.disposition.default)-Number(e.disposition.default));let r=new Map(this.currentSegment.tracks.map(e=>[e.id,e]));for(let e of this.currentSegment.cuePoints){let t=r.get(e.trackId);t&&t.cuePoints.push(e)}for(let e of this.currentSegment.tracks){e.cuePoints.sort((e,t)=>e.time-t.time);for(let t=0;t<e.cuePoints.length-1;t++){let n=e.cuePoints[t],r=e.cuePoints[t+1];n.time===r.time&&(e.cuePoints.splice(t+1,1),t--)}}let i=null,a=-1/0;for(let e of this.currentSegment.tracks)e.cuePoints.length>a&&(a=e.cuePoints.length,i=e);for(let e of this.currentSegment.tracks)0===e.cuePoints.length&&(e.cuePoints=i.cuePoints);this.currentSegment=null}async readCluster(e,t){if(t.lastReadCluster?.elementStartPos===e)return t.lastReadCluster;let n=this.reader.requestSliceRange(e,2,16);n instanceof Promise&&(n=await n),et(n);let r=rm(n);et(r),et(r.id===g.Cluster);let i=r.size,a=n.filePos;void 0===i&&(i=(await ry(this.reader,a,rs,t.elementEndPos)).pos-a);let o=this.reader.requestSlice(a,i);o instanceof Promise&&(o=await o);let l={segment:t,elementStartPos:e,elementEndPos:a+i,dataStartPos:a,timestamp:-1,trackData:new Map};if(this.currentCluster=l,o){let e=this.readContiguousElements(o,rs);l.elementEndPos=e}for(let[,t]of l.trackData){let n=t.track;et(t.blocks.length>0);let r=!1;for(let e=0;e<t.blocks.length;e++){let n=t.blocks[e];n.timestamp+=l.timestamp,r||=n.lacing!==v.None}t.presentationTimestamps=t.blocks.map((e,t)=>({timestamp:e.timestamp,blockIndex:t})).sort((e,t)=>e.timestamp-t.timestamp);for(let e=0;e<t.presentationTimestamps.length;e++){let r=t.presentationTimestamps[e],i=t.blocks[r.blockIndex];if(null===t.firstKeyFrameTimestamp&&i.isKeyFrame&&(t.firstKeyFrameTimestamp=i.timestamp),e<t.presentationTimestamps.length-1){let n=t.presentationTimestamps[e+1];i.duration=n.timestamp-i.timestamp}else 0===i.duration&&null!=n.defaultDuration&&i.lacing===v.None&&(i.duration=n.defaultDuration)}r&&(this.expandLacedBlocks(t.blocks,n),t.presentationTimestamps=t.blocks.map((e,t)=>({timestamp:e.timestamp,blockIndex:t})).sort((e,t)=>e.timestamp-t.timestamp));let i=t.blocks[t.presentationTimestamps[0].blockIndex],a=t.blocks[er(t.presentationTimestamps).blockIndex];t.startTimestamp=i.timestamp,t.endTimestamp=a.timestamp+a.duration;let o=ex(n.clusterPositionCache,t.startTimestamp,e=>e.startTimestamp);(-1===o||n.clusterPositionCache[o].elementStartPos!==e)&&n.clusterPositionCache.splice(o+1,0,{elementStartPos:l.elementStartPos,startTimestamp:t.startTimestamp})}return t.lastReadCluster=l,l}getTrackDataInCluster(e,t){let n=e.trackData.get(t);if(!n){let r=e.segment.tracks.find(e=>e.id===t);if(!r)return null;n={track:r,startTimestamp:0,endTimestamp:0,firstKeyFrameTimestamp:null,blocks:[],presentationTimestamps:[]},e.trackData.set(t,n)}return n}expandLacedBlocks(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(r.lacing===v.None)continue;r.decoded||(r.data=this.decodeBlockData(t,r.data),r.decoded=!0);let i=nI.tempFromBytes(r.data),a=[],o=nz(i)+1;switch(r.lacing){case v.Xiph:{let e=0;for(let t=0;t<o-1;t++){let t=0;for(;i.bufferPos<i.length;){let n=nz(i);if(t+=n,n<255){a.push(t),e+=t;break}}}a.push(i.length-(i.bufferPos+e))}break;case v.FixedSize:{let e=Math.floor((i.length-1)/o);for(let t=0;t<o;t++)a.push(e)}break;case v.Ebml:{let e=ru(i);et(null!==e);let t=e;a.push(t);let n=t;for(let e=1;e<o-1;e++){let e=i.bufferPos,r=ru(i);et(null!==r),t+=r-((1<<7*(i.bufferPos-e)-1)-1),a.push(t),n+=t}a.push(i.length-(i.bufferPos+n))}break;default:et(!1)}et(a.length===o),e.splice(n,1);let l=r.duration||o*(t.defaultDuration??0);for(let t=0;t<o;t++){let s=nD(i,a[t]),c=r.timestamp+l*t/o,u=l/o;e.splice(n+t,0,{timestamp:c,duration:u,isKeyFrame:r.isKeyFrame,data:s,lacing:v.None,decoded:!0,mainAdditional:r.mainAdditional})}n+=o,n--}}async loadSegmentMetadata(e){for(let t of e.seekEntries){if((t.id!==g.Tags||e.tagsSeen)&&(t.id!==g.Attachments||e.attachmentsSeen))continue;let n=this.reader.requestSliceRange(e.dataStartPos+t.segmentPosition,2,16);if(n instanceof Promise&&(n=await n),!n)continue;let r=rm(n);if(!r||r.id!==t.id)continue;let{size:i}=r;rC(i),et(!this.currentSegment),this.currentSegment=e;let a=this.reader.requestSlice(n.filePos,i);a instanceof Promise&&(a=await a),a&&this.readContiguousElements(a),this.currentSegment=null,t.id===g.Tags?e.tagsSeen=!0:t.id===g.Attachments&&(e.attachmentsSeen=!0)}}readContiguousElements(e,t){for(;e.remainingLength>=2;){let n=e.filePos;if(!this.traverseElement(e,t))return n}return e.filePos}traverseElement(e,t){let n=rm(e);
69if(!n||t&&t.includes(n.id))return!1;let{id:r,size:i}=n,a=e.filePos;switch(rC(i),r){case g.DocType:this.isWebM="webm"===rg(e,i);break;case g.Seek:{if(!this.currentSegment)break;let t={id:-1,segmentPosition:-1};this.currentSegment.seekEntries.push(t),this.readContiguousElements(e.slice(a,i)),(-1===t.id||-1===t.segmentPosition)&&this.currentSegment.seekEntries.pop()}break;case g.SeekID:{let t=this.currentSegment?.seekEntries[this.currentSegment.seekEntries.length-1];if(!t)break;t.id=rd(e,i)}break;case g.SeekPosition:{let t=this.currentSegment?.seekEntries[this.currentSegment.seekEntries.length-1];if(!t)break;t.segmentPosition=rd(e,i)}break;case g.TimestampScale:if(!this.currentSegment)break;this.currentSegment.timestampScale=rd(e,i),this.currentSegment.timestampFactor=1e9/this.currentSegment.timestampScale;break;case g.Duration:if(!this.currentSegment)break;this.currentSegment.duration=rb(e,i);break;case g.TrackEntry:if(!this.currentSegment||(this.currentTrack={id:-1,segment:this.currentSegment,demuxer:this,clusterPositionCache:[],cuePoints:[],disposition:{...nL},inputTrack:null,codecId:null,codecPrivate:null,defaultDuration:null,defaultDurationNs:null,name:null,languageCode:"eng",hasLanguageBcp47:!1,decodingInstructions:[],info:null},this.readContiguousElements(e.slice(a,i)),!this.currentTrack))break;if(this.currentTrack.decodingInstructions.some(e=>e.data?.type!=="decompress"||e.scope!==b.Block||e.data.algorithm!==y.HeaderStripping)&&(console.warn(`Track #${this.currentTrack.id} has an unsupported content encoding; dropping.`),this.currentTrack=null),this.currentTrack&&-1!==this.currentTrack.id&&this.currentTrack.codecId&&this.currentTrack.info){let e=this.currentTrack.codecId.indexOf("/"),t=-1===e?this.currentTrack.codecId:this.currentTrack.codecId.slice(0,e);if("video"===this.currentTrack.info.type&&-1!==this.currentTrack.info.width&&-1!==this.currentTrack.info.height){if(this.currentTrack.info.squarePixelWidth=this.currentTrack.info.width,this.currentTrack.info.squarePixelHeight=this.currentTrack.info.height,null!==this.currentTrack.info.displayWidth&&null!==this.currentTrack.info.displayHeight){let e=this.currentTrack.info.displayWidth*this.currentTrack.info.height,t=this.currentTrack.info.displayHeight*this.currentTrack.info.width;e>t?this.currentTrack.info.squarePixelWidth=Math.round(this.currentTrack.info.width*e/t):this.currentTrack.info.squarePixelHeight=Math.round(this.currentTrack.info.height*t/e)}this.currentTrack.codecId===rx.avc?(this.currentTrack.info.codec="avc",this.currentTrack.info.codecDescription=this.currentTrack.codecPrivate):this.currentTrack.codecId===rx.hevc?(this.currentTrack.info.codec="hevc",this.currentTrack.info.codecDescription=this.currentTrack.codecPrivate):t===rx.vp8?this.currentTrack.info.codec="vp8":t===rx.vp9?this.currentTrack.info.codec="vp9":t===rx.av1&&(this.currentTrack.info.codec="av1");let e=this.currentTrack,n=new nT(this.input,new rP(e));this.currentTrack.inputTrack=n,this.currentSegment.tracks.push(this.currentTrack)}else if("audio"===this.currentTrack.info.type){t===rx.aac?(this.currentTrack.info.codec="aac",this.currentTrack.info.aacCodecInfo={isMpeg2:this.currentTrack.codecId.includes("MPEG2"),objectType:null},this.currentTrack.info.codecDescription=this.currentTrack.codecPrivate):this.currentTrack.codecId===rx.mp3?this.currentTrack.info.codec="mp3":t===rx.opus?(this.currentTrack.info.codec="opus",this.currentTrack.info.codecDescription=this.currentTrack.codecPrivate,this.currentTrack.info.sampleRate=48e3):t===rx.vorbis?(this.currentTrack.info.codec="vorbis",this.currentTrack.info.codecDescription=this.currentTrack.codecPrivate):t===rx.flac?(this.currentTrack.info.codec="flac",this.currentTrack.info.codecDescription=this.currentTrack.codecPrivate):t===rx.ac3?(this.currentTrack.info.codec="ac3",this.currentTrack.info.codecDescription=this.currentTrack.codecPrivate):t===rx.eac3?(this.currentTrack.info.codec="eac3",this.currentTrack.info.codecDescription=this.currentTrack.codecPrivate):"A_PCM/INT/LIT"===this.currentTrack.codecId?8===this.currentTrack.info.bitDepth?this.currentTrack.info.codec="pcm-u8":16===this.currentTrack.info.bitDepth?this.currentTrack.info.codec="pcm-s16":24===this.currentTrack.info.bitDepth?this.currentTrack.info.codec="pcm-s24":32===this.currentTrack.info.bitDepth&&(this.currentTrack.info.codec="pcm-s32"):"A_PCM/INT/BIG"===this.currentTrack.codecId?8===this.currentTrack.info.bitDepth?this.currentTrack.info.codec="pcm-u8":16===this.currentTrack.info.bitDepth?this.currentTrack.info.codec="pcm-s16be":24===this.currentTrack.info.bitDepth?this.currentTrack.info.codec="pcm-s24be":32===this.currentTrack.info.bitDepth&&(this.currentTrack.info.codec="pcm-s32be"):"A_PCM/FLOAT/IEEE"===this.currentTrack.codecId&&(32===this.currentTrack.info.bitDepth?this.currentTrack.info.codec="pcm-f32":64===this.currentTrack.info.bitDepth&&(this.currentTrack.info.codec="pcm-f64"));let e=this.currentTrack,n=new nP(this.input,new rM(e));this.currentTrack.inputTrack=n,this.currentSegment.tracks.push(this.currentTrack)}}this.currentTrack=null;break;case g.TrackNumber:if(!this.currentTrack)break;this.currentTrack.id=rd(e,i);break;
69case g.TrackType:{if(!this.currentTrack)break;let t=rd(e,i);1===t?this.currentTrack.info={type:"video",width:-1,height:-1,displayWidth:null,displayHeight:null,displayUnit:null,squarePixelWidth:-1,squarePixelHeight:-1,rotation:0,codec:null,codecDescription:null,colorSpace:null,alphaMode:!1}:2===t&&(this.currentTrack.info={type:"audio",numberOfChannels:1,sampleRate:8e3,bitDepth:-1,codec:null,codecDescription:null,aacCodecInfo:null})}break;case g.FlagEnabled:if(!this.currentTrack)break;rd(e,i)||(this.currentTrack=null);break;case g.FlagDefault:if(!this.currentTrack)break;this.currentTrack.disposition.default=!!rd(e,i);break;case g.FlagForced:if(!this.currentTrack)break;this.currentTrack.disposition.forced=!!rd(e,i);break;case g.FlagOriginal:if(!this.currentTrack)break;this.currentTrack.disposition.original=!!rd(e,i);break;case g.FlagHearingImpaired:if(!this.currentTrack)break;this.currentTrack.disposition.hearingImpaired=!!rd(e,i);break;case g.FlagVisualImpaired:if(!this.currentTrack)break;this.currentTrack.disposition.visuallyImpaired=!!rd(e,i);break;case g.FlagCommentary:if(!this.currentTrack)break;this.currentTrack.disposition.commentary=!!rd(e,i);break;case g.CodecID:if(!this.currentTrack)break;this.currentTrack.codecId=rg(e,i);break;case g.CodecPrivate:if(!this.currentTrack)break;this.currentTrack.codecPrivate=nD(e,i);break;case g.DefaultDuration:if(!this.currentTrack)break;this.currentTrack.defaultDurationNs=rd(e,i);break;case g.Name:if(!this.currentTrack)break;this.currentTrack.name=rv(e,i);break;case g.Language:if(!this.currentTrack||this.currentTrack.hasLanguageBcp47)break;this.currentTrack.languageCode=rg(e,i),eF(this.currentTrack.languageCode)||(this.currentTrack.languageCode="und");break;case g.LanguageBCP47:{if(!this.currentTrack)break;let t=rg(e,i).split("-")[0];t?this.currentTrack.languageCode=t:this.currentTrack.languageCode="und",this.currentTrack.hasLanguageBcp47=!0}break;case g.Video:if(this.currentTrack?.info?.type!=="video")break;this.readContiguousElements(e.slice(a,i));break;case g.PixelWidth:if(this.currentTrack?.info?.type!=="video")break;this.currentTrack.info.width=rd(e,i);break;case g.PixelHeight:if(this.currentTrack?.info?.type!=="video")break;this.currentTrack.info.height=rd(e,i);break;case g.DisplayWidth:if(this.currentTrack?.info?.type!=="video")break;this.currentTrack.info.displayWidth=rd(e,i);break;case g.DisplayHeight:if(this.currentTrack?.info?.type!=="video")break;this.currentTrack.info.displayHeight=rd(e,i);break;case g.DisplayUnit:if(this.currentTrack?.info?.type!=="video")break;this.currentTrack.info.displayUnit=rd(e,i);break;case g.AlphaMode:if(this.currentTrack?.info?.type!=="video")break;this.currentTrack.info.alphaMode=1===rd(e,i);break;case g.Colour:if(this.currentTrack?.info?.type!=="video")break;this.currentTrack.info.colorSpace={},this.readContiguousElements(e.slice(a,i));break;case g.MatrixCoefficients:{if(this.currentTrack?.info?.type!=="video"||!this.currentTrack.info.colorSpace)break;let t=em[rd(e,i)]??null;this.currentTrack.info.colorSpace.matrix=t}break;case g.Range:if(this.currentTrack?.info?.type!=="video"||!this.currentTrack.info.colorSpace)break;this.currentTrack.info.colorSpace.fullRange=2===rd(e,i);break;case g.TransferCharacteristics:{if(this.currentTrack?.info?.type!=="video"||!this.currentTrack.info.colorSpace)break;let t=ef[rd(e,i)]??null;this.currentTrack.info.colorSpace.transfer=t}break;case g.Primaries:{if(this.currentTrack?.info?.type!=="video"||!this.currentTrack.info.colorSpace)break;let t=ed[rd(e,i)]??null;this.currentTrack.info.colorSpace.primaries=t}break;case g.Projection:if(this.currentTrack?.info?.type!=="video")break;this.readContiguousElements(e.slice(a,i));break;case g.ProjectionPoseRoll:{if(this.currentTrack?.info?.type!=="video")break;let t=rb(e,i);try{this.currentTrack.info.rotation=en(-t)}catch{}}break;case g.Audio:if(this.currentTrack?.info?.type!=="audio")break;this.readContiguousElements(e.slice(a,i));break;case g.SamplingFrequency:if(this.currentTrack?.info?.type!=="audio")break;this.currentTrack.info.sampleRate=rb(e,i);break;case g.Channels:if(this.currentTrack?.info?.type!=="audio")break;this.currentTrack.info.numberOfChannels=rd(e,i);break;case g.BitDepth:if(this.currentTrack?.info?.type!=="audio")break;this.currentTrack.info.bitDepth=rd(e,i);break;case g.CuePoint:if(!this.currentSegment)break;this.readContiguousElements(e.slice(a,i)),this.currentCueTime=null;break;case g.CueTime:this.currentCueTime=rd(e,i);break;case g.CueTrackPositions:{if(null===this.currentCueTime)break;et(this.currentSegment);let t={time:this.currentCueTime,trackId:-1,clusterPosition:-1};this.currentSegment.cuePoints.push(t),this.readContiguousElements(e.slice(a,i)),(-1===t.trackId||-1===t.clusterPosition)&&this.currentSegment.cuePoints.pop()}break;case g.CueTrack:{let t=this.currentSegment?.cuePoints[this.currentSegment.cuePoints.length-1];if(!t)break;t.trackId=rd(e,i)}break;case g.CueClusterPosition:{let t=this.currentSegment?.cuePoints[this.currentSegment.cuePoints.length-1];if(!t)break;et(this.currentSegment),t.clusterPosition=this.currentSegment.dataStartPos+rd(e,i)}break;case g.Timestamp:if(!this.currentCluster)break;this.currentCluster.timestamp=rd(e,i);break;case g.SimpleBlock:{if(!this.currentCluster)break;let t=ru(e);if(null===t)break;let n=this.getTrackDataInCluster(this.currentCluster,t);if(!n)break;let r=nH(e),o=nz(e),l=!!(128&o);n.track.info?.type==="audio"&&n.track.info.codec&&(l=!0);
69let s=nD(e,i-(e.filePos-a)),c=n.track.decodingInstructions.length>0;n.blocks.push({timestamp:r,duration:0,isKeyFrame:l,data:s,lacing:o>>1&3,decoded:!c,mainAdditional:null})}break;case g.BlockGroup:if(!this.currentCluster)break;this.readContiguousElements(e.slice(a,i)),this.currentBlock=null;break;case g.Block:{if(!this.currentCluster)break;let t=ru(e);if(null===t)break;let n=this.getTrackDataInCluster(this.currentCluster,t);if(!n)break;let r=nH(e),o=nz(e),l=nD(e,i-(e.filePos-a)),s=n.track.decodingInstructions.length>0;this.currentBlock={timestamp:r,duration:0,isKeyFrame:!0,data:l,lacing:o>>1&3,decoded:!s,mainAdditional:null},n.blocks.push(this.currentBlock)}break;case g.BlockAdditions:this.readContiguousElements(e.slice(a,i));break;case g.BlockMore:if(!this.currentBlock)break;this.currentBlockAdditional={addId:1,data:null},this.readContiguousElements(e.slice(a,i)),this.currentBlockAdditional.data&&1===this.currentBlockAdditional.addId&&(this.currentBlock.mainAdditional=this.currentBlockAdditional.data),this.currentBlockAdditional=null;break;case g.BlockAdditional:if(!this.currentBlockAdditional)break;this.currentBlockAdditional.data=nD(e,i);break;case g.BlockAddID:if(!this.currentBlockAdditional)break;this.currentBlockAdditional.addId=rd(e,i);break;case g.BlockDuration:if(!this.currentBlock)break;this.currentBlock.duration=rd(e,i);break;case g.ReferenceBlock:if(!this.currentBlock)break;this.currentBlock.isKeyFrame=!1;break;case g.Tag:this.currentTagTargetIsMovie=!0,this.readContiguousElements(e.slice(a,i));break;case g.Targets:this.readContiguousElements(e.slice(a,i));break;case g.TargetTypeValue:50!==rd(e,i)&&(this.currentTagTargetIsMovie=!1);break;case g.TagTrackUID:case g.TagEditionUID:case g.TagChapterUID:case g.TagAttachmentUID:this.currentTagTargetIsMovie=!1;break;case g.SimpleTag:if(!this.currentTagTargetIsMovie)break;this.currentSimpleTagName=null,this.readContiguousElements(e.slice(a,i));break;case g.TagName:this.currentSimpleTagName=rv(e,i);break;case g.TagString:{if(!this.currentSimpleTagName)break;let t=rv(e,i);this.processTagValue(this.currentSimpleTagName,t)}break;case g.TagBinary:{if(!this.currentSimpleTagName)break;let t=nD(e,i);this.processTagValue(this.currentSimpleTagName,t)}break;case g.AttachedFile:{if(!this.currentSegment)break;this.currentAttachedFile={fileUid:null,fileName:null,fileMediaType:null,fileData:null,fileDescription:null},this.readContiguousElements(e.slice(a,i));let t=this.currentSegment.metadataTags;if(this.currentAttachedFile.fileUid&&this.currentAttachedFile.fileData&&(t.raw??={},t.raw[this.currentAttachedFile.fileUid.toString()]=new nA(this.currentAttachedFile.fileData,this.currentAttachedFile.fileMediaType??void 0,this.currentAttachedFile.fileName??void 0,this.currentAttachedFile.fileDescription??void 0)),this.currentAttachedFile.fileMediaType?.startsWith("image/")&&this.currentAttachedFile.fileData){let e=this.currentAttachedFile.fileName,n="unknown";if(e){let t=e.toLowerCase();t.startsWith("cover.")?n="coverFront":t.startsWith("back.")&&(n="coverBack")}t.images??=[],t.images.push({data:this.currentAttachedFile.fileData,mimeType:this.currentAttachedFile.fileMediaType,kind:n,name:this.currentAttachedFile.fileName??void 0,description:this.currentAttachedFile.fileDescription??void 0})}this.currentAttachedFile=null}break;case g.FileUID:if(!this.currentAttachedFile)break;this.currentAttachedFile.fileUid=rh(e,i);break;case g.FileName:if(!this.currentAttachedFile)break;this.currentAttachedFile.fileName=rv(e,i);break;case g.FileMediaType:if(!this.currentAttachedFile)break;this.currentAttachedFile.fileMediaType=rg(e,i);break;case g.FileData:if(!this.currentAttachedFile)break;this.currentAttachedFile.fileData=nD(e,i);break;case g.FileDescription:if(!this.currentAttachedFile)break;this.currentAttachedFile.fileDescription=rv(e,i);break;case g.ContentEncodings:if(!this.currentTrack)break;this.readContiguousElements(e.slice(a,i)),this.currentTrack.decodingInstructions.sort((e,t)=>t.order-e.order);break;case g.ContentEncoding:this.currentDecodingInstruction={order:0,scope:b.Block,data:null},this.readContiguousElements(e.slice(a,i)),this.currentDecodingInstruction.data&&this.currentTrack.decodingInstructions.push(this.currentDecodingInstruction),this.currentDecodingInstruction=null;break;case g.ContentEncodingOrder:if(!this.currentDecodingInstruction)break;this.currentDecodingInstruction.order=rd(e,i);break;case g.ContentEncodingScope:if(!this.currentDecodingInstruction)break;this.currentDecodingInstruction.scope=rd(e,i);break;case g.ContentCompression:if(!this.currentDecodingInstruction)break;this.currentDecodingInstruction.data={type:"decompress",algorithm:y.Zlib,settings:null},this.readContiguousElements(e.slice(a,i));break;case g.ContentCompAlgo:if(this.currentDecodingInstruction?.data?.type!=="decompress")break;this.currentDecodingInstruction.data.algorithm=rd(e,i);break;case g.ContentCompSettings:if(this.currentDecodingInstruction?.data?.type!=="decompress")break;this.currentDecodingInstruction.data.settings=nD(e,i);break;case g.ContentEncryption:if(!this.currentDecodingInstruction)break;this.currentDecodingInstruction.data={type:"decrypt"}}return e.filePos=a+i,!0}decodeBlockData(e,t){et(e.decodingInstructions.length>0);let n=t;for(let t of e.decodingInstructions)if(et(t.data),"decompress"===t.data.type&&t.data.algorithm===y.HeaderStripping&&t.data.settings&&t.data.settings.length>
690){let e=t.data.settings,r=new Uint8Array(e.length+n.length);r.set(e,0),r.set(n,e.length),n=r}return n}processTagValue(e,t){if(!this.currentSegment?.metadataTags)return;let n=this.currentSegment.metadataTags;if(n.raw??={},n.raw[e]??=t,"string"==typeof t)switch(e.toLowerCase()){case"title":n.title??=t;break;case"description":n.description??=t;break;case"artist":n.artist??=t;break;case"album":n.album??=t;break;case"album_artist":n.albumArtist??=t;break;case"genre":n.genre??=t;break;case"comment":n.comment??=t;break;case"lyrics":n.lyrics??=t;break;case"date":{let e=new Date(t);Number.isNaN(e.getTime())||(n.date??=e)}break;case"track_number":case"part_number":{let e=t.split("/"),r=Number.parseInt(e[0],10),i=e[1]&&Number.parseInt(e[1],10);Number.isInteger(r)&&r>0&&(n.trackNumber??=r),i&&Number.isInteger(i)&&i>0&&(n.tracksTotal??=i)}break;case"disc_number":case"disc":{let e=t.split("/"),r=Number.parseInt(e[0],10),i=e[1]&&Number.parseInt(e[1],10);Number.isInteger(r)&&r>0&&(n.discNumber??=r),i&&Number.isInteger(i)&&i>0&&(n.discsTotal??=i)}}}}class rT{constructor(e){this.internalTrack=e,this.packetToClusterLocation=new WeakMap}getId(){return this.internalTrack.id}getNumber(){let e=this.internalTrack.demuxer,t=this.internalTrack.inputTrack.type,n=0;for(let r of e.segments)for(let e of r.tracks)if(e.inputTrack.type===t&&n++,e===this.internalTrack)break;return n}getCodec(){throw Error("Not implemented on base class.")}getInternalCodecId(){return this.internalTrack.codecId}async computeDuration(){let e=await this.getPacket(1/0,{metadataOnly:!0});return(e?.timestamp??0)+(e?.duration??0)}getName(){return this.internalTrack.name}getLanguageCode(){return this.internalTrack.languageCode}async getFirstTimestamp(){let e=await this.getFirstPacket({metadataOnly:!0});return e?.timestamp??0}getTimeResolution(){return this.internalTrack.segment.timestampFactor}getDisposition(){return this.internalTrack.disposition}async getFirstPacket(e){return this.performClusterLookup(null,e=>e.trackData.get(this.internalTrack.id)?{blockIndex:0,correctBlockFound:!0}:{blockIndex:-1,correctBlockFound:!1},-1/0,1/0,e)}intoTimescale(e){return eI(e*this.internalTrack.segment.timestampFactor)}async getPacket(e,t){let n=this.intoTimescale(e);return this.performClusterLookup(null,e=>{let t=e.trackData.get(this.internalTrack.id);if(!t)return{blockIndex:-1,correctBlockFound:!1};let r=ex(t.presentationTimestamps,n,e=>e.timestamp);return{blockIndex:-1!==r?t.presentationTimestamps[r].blockIndex:-1,correctBlockFound:-1!==r&&n<t.endTimestamp}},n,n,t)}async getNextPacket(e,t){let n=this.packetToClusterLocation.get(e);if(void 0===n)throw Error("Packet was not created from this track.");return this.performClusterLookup(n.cluster,e=>{if(e===n.cluster){let t=e.trackData.get(this.internalTrack.id);if(n.blockIndex+1<t.blocks.length)return{blockIndex:n.blockIndex+1,correctBlockFound:!0}}else if(e.trackData.get(this.internalTrack.id))return{blockIndex:0,correctBlockFound:!0};return{blockIndex:-1,correctBlockFound:!1}},-1/0,1/0,t)}async getKeyPacket(e,t){let n=this.intoTimescale(e);return this.performClusterLookup(null,e=>{let t=e.trackData.get(this.internalTrack.id);if(!t)return{blockIndex:-1,correctBlockFound:!1};let r=eS(t.presentationTimestamps,e=>t.blocks[e.blockIndex].isKeyFrame&&e.timestamp<=n);return{blockIndex:-1!==r?t.presentationTimestamps[r].blockIndex:-1,correctBlockFound:-1!==r&&n<t.endTimestamp}},n,n,t)}async getNextKeyPacket(e,t){let n=this.packetToClusterLocation.get(e);if(void 0===n)throw Error("Packet was not created from this track.");return this.performClusterLookup(n.cluster,e=>{if(e===n.cluster){let t=e.trackData.get(this.internalTrack.id).blocks.findIndex((e,t)=>e.isKeyFrame&&t>n.blockIndex);if(-1!==t)return{blockIndex:t,correctBlockFound:!0}}else{let t=e.trackData.get(this.internalTrack.id);if(t&&null!==t.firstKeyFrameTimestamp){let e=t.blocks.findIndex(e=>e.isKeyFrame);return et(-1!==e),{blockIndex:e,correctBlockFound:!0}}}return{blockIndex:-1,correctBlockFound:!1}},-1/0,1/0,t)}async fetchPacketInCluster(e,t,n){if(-1===t)return null;let r=e.trackData.get(this.internalTrack.id).blocks[t];et(r),r.decoded||(r.data=this.internalTrack.demuxer.decodeBlockData(this.internalTrack,r.data),r.decoded=!0);let i=n.metadataOnly?t1:r.data,a=r.timestamp/this.internalTrack.segment.timestampFactor,o=r.duration/this.internalTrack.segment.timestampFactor,l={};r.mainAdditional&&this.internalTrack.info?.type==="video"&&this.internalTrack.info.alphaMode&&(l.alpha=n.metadataOnly?t1:r.mainAdditional,l.alphaByteLength=r.mainAdditional.byteLength);let s=new t2(i,r.isKeyFrame?"key":"delta",a,o,e.dataStartPos+t,r.data.byteLength,l);
69return this.packetToClusterLocation.set(s,{cluster:e,blockIndex:t}),s}async performClusterLookup(e,t,n,r,i){let a;let{demuxer:o,segment:l}=this.internalTrack,s=null,c=null,u=-1;if(e){let{blockIndex:n,correctBlockFound:r}=t(e);if(r)return this.fetchPacketInCluster(e,n,i);-1!==n&&(c=e,u=n)}let d=ex(this.internalTrack.cuePoints,n,e=>e.time),h=-1!==d?this.internalTrack.cuePoints[d]:null,f=ex(this.internalTrack.clusterPositionCache,n,e=>e.startTimestamp),p=-1!==f?this.internalTrack.clusterPositionCache[f]:null,m=Math.max(h?.clusterPosition??0,p?.elementStartPos??0)||null;for(e?null===m||e.elementStartPos>=m?(a=e.elementEndPos,s=e):a=m:a=m??l.clusterSeekStartPos;null===l.elementEndPos||a<=l.elementEndPos-2;){if(s){let e=s.trackData.get(this.internalTrack.id);if(e&&e.startTimestamp>r)break}let e=o.reader.requestSliceRange(a,2,16);if(e instanceof Promise&&(e=await e),!e)break;let n=a,d=rm(e);if(!d||!rl.includes(d.id)&&d.id!==g.Void){let e=await rw(o.reader,n,rl,Math.min(l.elementEndPos??1/0,n+10485760));if(e){a=e;continue}break}let h=d.id,f=d.size,p=e.filePos;if(h===g.Cluster){f=(s=await o.readCluster(n,l)).elementEndPos-p;let{blockIndex:e,correctBlockFound:r}=t(s);if(r)return this.fetchPacketInCluster(s,e,i);-1!==e&&(c=s,u=e)}void 0===f&&(et(h!==g.Cluster),f=(await ry(o.reader,p,rs,l.elementEndPos)).pos-p);let m=p+f;if(null===l.elementEndPos){let e=o.reader.requestSliceRange(m,2,16);if(e instanceof Promise&&(e=await e),!e)break;if(rf(e)===g.Segment){l.elementEndPos=m;break}}a=m}if(h&&(!c||c.elementStartPos<h.clusterPosition)){let e=this.internalTrack.cuePoints[d-1];et(!e||e.time<h.time);let n=e?.time??-1/0;return this.performClusterLookup(null,t,n,r,i)}return c?this.fetchPacketInCluster(c,u,i):null}}class rP extends rT{constructor(e){super(e),this.decoderConfigPromise=null,this.internalTrack=e}getCodec(){return this.internalTrack.info.codec}getCodedWidth(){return this.internalTrack.info.width}getCodedHeight(){return this.internalTrack.info.height}getSquarePixelWidth(){return this.internalTrack.info.squarePixelWidth}getSquarePixelHeight(){return this.internalTrack.info.squarePixelHeight}getRotation(){return this.internalTrack.info.rotation}async getColorSpace(){return{primaries:this.internalTrack.info.colorSpace?.primaries,transfer:this.internalTrack.info.colorSpace?.transfer,matrix:this.internalTrack.info.colorSpace?.matrix,fullRange:this.internalTrack.info.colorSpace?.fullRange}}
69async canBeTransparent(){return this.internalTrack.info.alphaMode}async getDecoderConfig(){return this.internalTrack.info.codec?this.decoderConfigPromise??=(async()=>{let e=null;"vp9"!==this.internalTrack.info.codec&&"av1"!==this.internalTrack.info.codec&&("avc"!==this.internalTrack.info.codec||this.internalTrack.info.codecDescription)&&("hevc"!==this.internalTrack.info.codec||this.internalTrack.info.codecDescription)||(e=await this.getFirstPacket({}));let t={codec:ti({width:this.internalTrack.info.width,height:this.internalTrack.info.height,codec:this.internalTrack.info.codec,codecDescription:this.internalTrack.info.codecDescription,colorSpace:this.internalTrack.info.colorSpace,avcType:1,avcCodecInfo:"avc"===this.internalTrack.info.codec&&e?ty(e.data):null,hevcCodecInfo:"hevc"===this.internalTrack.info.codec&&e?tP(e.data):null,vp9CodecInfo:"vp9"===this.internalTrack.info.codec&&e?tD(e.data):null,av1CodecInfo:"av1"===this.internalTrack.info.codec&&e?tN(e.data):null}),codedWidth:this.internalTrack.info.width,codedHeight:this.internalTrack.info.height,description:this.internalTrack.info.codecDescription??void 0,colorSpace:this.internalTrack.info.colorSpace??void 0};return(this.internalTrack.info.width!==this.internalTrack.info.squarePixelWidth||this.internalTrack.info.height!==this.internalTrack.info.squarePixelHeight)&&(t.displayAspectWidth=this.internalTrack.info.squarePixelWidth,t.displayAspectHeight=this.internalTrack.info.squarePixelHeight),t})():null}}class rM extends rT{constructor(e){super(e),this.decoderConfig=null,this.internalTrack=e}getCodec(){return this.internalTrack.info.codec}getNumberOfChannels(){return this.internalTrack.info.numberOfChannels}getSampleRate(){return this.internalTrack.info.sampleRate}async getDecoderConfig(){return this.internalTrack.info.codec?this.decoderConfig??={codec:ta({codec:this.internalTrack.info.codec,codecDescription:this.internalTrack.info.codecDescription,aacCodecInfo:this.internalTrack.info.aacCodecInfo}),numberOfChannels:this.internalTrack.info.numberOfChannels,sampleRate:this.internalTrack.info.sampleRate,description:this.internalTrack.info.codecDescription??void 0}:null}}let rR=[44100,48e3,32e3],rA=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1,-1,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1,-1,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,16,24,32,40,48,56,64,80,96,112,128,144,160,-1,-1,8,16,24,32,40,48,56,64,80,96,112,128,144,160,-1,-1,32,48,56,64,80,96,112,128,144,160,176,192,224,256,-1],rL=(e,t,n,r,i)=>0===t?0:1===t?Math.floor(144*n/(r<<e))+i:2===t?Math.floor(144*n/r)+i:(Math.floor(12*n/r)+i)*4,r_=(e,t)=>3===e?3===t?21:36:3===t?13:21,rI=(e,t)=>{let n;let r=e>>>24,i=e>>>16&255,a=e>>>8&255,o=255&e;if(255!==r&&255!==i&&255!==a&&255!==o)return{header:null,bytesAdvanced:4};if(255!==r||(224&i)!=224)return{header:null,bytesAdvanced:1};let l=0,s=0;16&i?l=8&i?0:1:(l=1,s=1);let c=i>>3&3,u=i>>1&3,d=(a>>2&3)%3,h=rA[64*l+16*u+(a>>4&15)];if(-1===h)return{header:null,bytesAdvanced:1};let f=1e3*h,p=rR[d]>>l+s,m=rL(l,u,f,p,a>>1&1);return null!==t&&t<m?{header:null,bytesAdvanced:1}:(n=3===c?3===u?384:1152:3===u?384:2===u?1152:576,{header:{totalSize:m,mpegVersionId:c,layer:u,bitrate:f,frequencyIndex:d,sampleRate:p,channel:o>>6&3,modeExtension:o>>4&3,copyright:o>>3&1,original:o>>2&1,emphasis:3&o,audioSamplesInFrame:n},bytesAdvanced:1})},rO=e=>{let t=2130706432,n=0;for(;0!==t;)n>>=1,n|=e&t,t>>=8;return n};(u=w||(w={}))[u.Unsynchronisation=128]="Unsynchronisation",u[u.ExtendedHeader=64]="ExtendedHeader",u[u.ExperimentalIndicator=32]="ExperimentalIndicator",u[u.Footer=16]="Footer",(d=x||(x={}))[d.ISO_8859_1=0]="ISO_8859_1",d[d.UTF_16_WITH_BOM=1]="UTF_16_WITH_BOM",d[d.UTF_16_BE_NO_BOM=2]="UTF_16_BE_NO_BOM",d[d.UTF_8=3]="UTF_8";let rD=["Blues","Classic rock","Country","Dance","Disco","Funk","Grunge","Hip-hop","Jazz","Metal","New age","Oldies","Other","Pop","Rhythm and blues","Rap","Reggae","Rock","Techno","Industrial","Alternative","Ska","Death metal","Pranks","Soundtrack","Euro-techno","Ambient","Trip-hop","Vocal","Jazz & funk","Fusion","Trance","Classical","Instrumental","Acid","House","Game","S
69ound clip","Gospel","Noise","Alternative rock","Bass","Soul","Punk","Space","Meditative","Instrumental pop","Instrumental rock","Ethnic","Gothic","Darkwave","Techno-industrial","Electronic","Pop-folk","Eurodance","Dream","Southern rock","Comedy","Cult","Gangsta","Top 40","Christian rap","Pop/funk","Jungle music","Native US","Cabaret","New wave","Psychedelic","Rave","Showtunes","Trailer","Lo-fi","Tribal","Acid punk","Acid jazz","Polka","Retro","Musical","Rock 'n' roll","Hard rock","Folk","Folk rock","National folk","Swing","Fast fusion","Bebop","Latin","Revival","Celtic","Bluegrass","Avantgarde","Gothic rock","Progressive rock","Psychedelic rock","Symphonic rock","Slow rock","Big band","Chorus","Easy listening","Acoustic","Humour","Speech","Chanson","Opera","Chamber music","Sonata","Symphony","Booty bass","Primus","Porn groove","Satire","Slow jam","Club","Tango","Samba","Folklore","Ballad","Power ballad","Rhythmic Soul","Freestyle","Duet","Punk rock","Drum solo","A cappella","Euro-house","Dance hall","Goa music","Drum & bass","Club-house","Hardcore techno","Terror","Indie","Britpop","Negerpunk","Polsk punk","Beat","Christian gangsta rap","Heavy metal","Black metal","Crossover","Contemporary Christian","Christian rock","Merengue","Salsa","Thrash metal","Anime","Jpop","Synthpop","Christmas","Art rock","Baroque","Bhangra","Big beat","Breakbeat","Chillout","Downtempo","Dub","EBM","Eclectic","Electro","Electroclash","Emo","Experimental","Garage","Global","IDM","Illbient","Industro-Goth","Jam Band","Krautrock","Leftfield","Lounge","Math rock","New romantic","Nu-breakz","Post-punk","Post-rock","Psytrance","Shoegaze","Space rock","Trop rock","World music","Neoclassical","Audiobook","Audio theatre","Neue Deutsche Welle","Podcast","Indie rock","G-Funk","Dubstep","Garage rock","Psybient"],rz=(e,t)=>{let n;let r=e.filePos;t.raw??={},t.raw.TAG??=nD(e,125),e.filePos=r;let i=rN(e,30);i&&(t.title??=i);let a=rN(e,30);a&&(t.artist??=a);let o=rN(e,30);o&&(t.album??=o);let l=Number.parseInt(rN(e,4),10);Number.isInteger(l)&&l>0&&(t.date??=new Date(l,0,1));let s=nD(e,30);if(0===s[28]&&0!==s[29]){let r=s[29];r>0&&(t.trackNumber??=r),e.skip(-30),n=rN(e,28),e.skip(2)}else e.skip(-30),n=rN(e,30);n&&(t.comment??=n);let c=nz(e);c<rD.length&&(t.genre??=rD[c])},rN=(e,t)=>{let n=nD(e,t),r=eJ(n.indexOf(0),n.length),i=n.subarray(0,r),a="";for(let e=0;e<i.length;e++)a+=String.fromCharCode(i[e]);return a.trimEnd()},rF=e=>{let t=e.filePos,n=nJ(e,3),r=nz(e),i=nz(e),a=nz(e),o=nj(e);return"ID3"!==n||255===r||255===i||(2155905152&o)!=0?(e.filePos=t,null):{majorVersion:r,revision:i,flags:a,size:rO(o)}},rB=(e,t,n)=>{if(![2,3,4].includes(t.majorVersion)){console.warn(`Unsupported ID3v2 major version: ${t.majorVersion}`);return}let r=nD(e,t.size),i=new rH(t,r);if(t.flags&w.Footer&&i.removeFooter(),t.flags&w.Unsynchronisation&&3===t.majorVersion&&i.ununsynchronizeAll(),t.flags&w.ExtendedHeader){let e=i.readU32();3===t.majorVersion?i.pos+=e:i.pos+=e-4}for(;i.pos<=i.bytes.length-i.frameHeaderSize();){let e=i.readId3V2Frame();if(!e)break;let r=i.pos,a=i.pos+e.size,o=!1,l=!1,s=!1;if(3===t.majorVersion?(o=!!(64&e.flags),l=!!(128&e.flags)):4===t.majorVersion&&(o=!!(4&e.flags),l=!!(8&e.flags),s=!!(2&e.flags)||!!(t.flags&w.Unsynchronisation)),o){console.warn(`Skipping encrypted ID3v2 frame ${e.id}`),i.pos=a;continue}if(l){console.warn(`Skipping compressed ID3v2 frame ${e.id}`),i.pos=a;continue}switch(s&&i.ununsynchronizeRegion(i.pos,a),n.raw??={},"T"===e.id[0]?n.raw[e.id]??=i.readId3V2EncodingAndText(a):n.raw[e.id]??=i.readBytes(e.size),i.pos=r,e.id){case"TIT2":case"TT2":n.title??=i.readId3V2EncodingAndText(a);break;case"TIT3":case"TT3":n.description??=i.readId3V2EncodingAndText(a);break;case"TPE1":case"TP1":n.artist??=i.readId3V2EncodingAndText(a);break;case"TALB":case"TAL":n.album??=i.readId3V2EncodingAndText(a);break;case"TPE2":case"TP2":n.albumArtist??=i.readId3V2EncodingAndText(a);break;case"TRCK":case"TRK":{let e=i.readId3V2EncodingAndText(a).split("/"),t=Number.parseInt(e[0],10),r=e[1]&&Number.parseInt(e[1],10);Number.isInteger(t)&&t>0&&(n.trackNumber??=t),r&&Number.isInteger(r)&&r>0&&(n.tracksTotal??=r)}break;case"TPOS":case"TPA":{let e=i.readId3V2EncodingAndText(a).split("/"),t=Number.parseInt(e[0],10),r=e[1]&&Number.parseInt(e[1],10);Number.isInteger(t)&&t>0&&(n.discNumber??=t),r&&Number.isInteger(r)&&r>0&&(n.discsTotal??=r)}break;case"TCON":case"TCO":{let e=i.readId3V2EncodingAndText(a),t=/^\((\d+)\)/.exec(e);if(t){let e=Number.parseInt(t[1]);if(void 0!==rD[e]){n.genre??=rD[e];break}}if(t=/^\d+$/.exec(e)){let e=Number.parseInt(t[0]);if(void 0!==rD[e]){n.genre??=rD[e];break}}n.genre??=e}break;case"TDRC":case"TDAT":{let e=new Date(i.readId3V2EncodingAndText(a));Number.isNaN(e.getTime())||(n.date??=e)}break;case"TYER":case"TYE":{let e=Number.parseInt(i.readId3V2EncodingAndText(a),10);
69Number.isInteger(e)&&(n.date??=new Date(e,0,1))}break;case"USLT":case"ULT":{let e=i.readU8();i.pos+=3,i.readId3V2Text(e,a),n.lyrics??=i.readId3V2Text(e,a)}break;case"COMM":case"COM":{let e=i.readU8();i.pos+=3,i.readId3V2Text(e,a),n.comment??=i.readId3V2Text(e,a)}break;case"APIC":case"PIC":{let e;let r=i.readId3V2TextEncoding();if(2===t.majorVersion){let t=i.readAscii(3);e="PNG"===t?"image/png":"JPG"===t?"image/jpeg":"image/*"}else e=i.readId3V2Text(r,a);let o=i.readU8(),l=i.readId3V2Text(r,a).trimEnd(),s=a-i.pos;if(s>=0){let t=i.readBytes(s);n.images||(n.images=[]),n.images.push({data:t,mimeType:e,kind:3===o?"coverFront":4===o?"coverBack":"unknown",description:l})}}break;default:i.pos+=e.size}i.pos=a}};class rH{constructor(e,t){this.header=e,this.bytes=t,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}frameHeaderSize(){return 2===this.header.majorVersion?6:10}ununsynchronizeAll(){let e=[];for(let t=0;t<this.bytes.length;t++){let n=this.bytes[t];e.push(n),255===n&&t!==this.bytes.length-1&&0===this.bytes[t]&&t++}this.bytes=new Uint8Array(e),this.view=new DataView(this.bytes.buffer)}ununsynchronizeRegion(e,t){let n=[];for(let r=e;r<t;r++){let e=this.bytes[r];n.push(e),255===e&&r!==t-1&&0===this.bytes[r+1]&&r++}let r=this.bytes.subarray(0,e),i=this.bytes.subarray(t);this.bytes=new Uint8Array(r.length+n.length+i.length),this.bytes.set(r,0),this.bytes.set(n,r.length),this.bytes.set(i,r.length+n.length),this.view=new DataView(this.bytes.buffer)}removeFooter(){this.bytes=this.bytes.subarray(0,this.bytes.length-10),this.view=new DataView(this.bytes.buffer)}readBytes(e){let t=this.bytes.subarray(this.pos,this.pos+e);return this.pos+=e,t}readU8(){let e=this.view.getUint8(this.pos);return this.pos+=1,e}readU16(){let e=this.view.getUint16(this.pos,!1);return this.pos+=2,e}readU24(){let e=this.view.getUint16(this.pos,!1),t=this.view.getUint8(this.pos+1);return this.pos+=3,256*e+t}readU32(){let e=this.view.getUint32(this.pos,!1);return this.pos+=4,e}readAscii(e){let t="";for(let n=0;n<e;n++)t+=String.fromCharCode(this.view.getUint8(this.pos+n));return this.pos+=e,t}readId3V2Frame(){if(2===this.header.majorVersion){let e=this.readAscii(3);return"\0\0\0"===e?null:{id:e,size:this.readU24(),flags:0}}{let e=this.readAscii(4);if("\0\0\0\0"===e)return null;let t=this.readU32(),n=4===this.header.majorVersion?rO(t):t,r=this.readU16(),i=this.pos,a=e=>{let t=this.pos+e;if(t>this.bytes.length)return!1;if(t<=this.bytes.length-this.frameHeaderSize()){this.pos+=e;let t=this.readAscii(4);if("\0\0\0\0"!==t&&!/[0-9A-Z]{4}/.test(t))return!1}return!0};if(!a(n)){let e=4===this.header.majorVersion?t:rO(t);a(e)&&(n=e)}return this.pos=i,{id:e,size:n,flags:r}}}readId3V2TextEncoding(){let e=this.readU8();if(e>3)throw Error(`Unsupported text encoding: ${e}`);return e}readId3V2Text(e,t){let n=this.pos,r=this.readBytes(t-this.pos);switch(e){case x.ISO_8859_1:{let e="";for(let t=0;t<r.length;t++){let i=r[t];if(0===i){this.pos=n+t+1;break}e+=String.fromCharCode(i)}return e}case x.UTF_16_WITH_BOM:if(255===r[0]&&254===r[1]){let e=new TextDecoder("utf-16le"),t=eJ(r.findIndex((e,t)=>0===e&&0===r[t+1]&&t%2==0),r.length);return this.pos=n+Math.min(t+2,r.length),e.decode(r.subarray(2,t))}if(254===r[0]&&255===r[1]){let e=new TextDecoder("utf-16be"),t=eJ(r.findIndex((e,t)=>0===e&&0===r[t+1]&&t%2==0),r.length);return this.pos=n+Math.min(t+2,r.length),e.decode(r.subarray(2,t))}{let e=eJ(r.findIndex(e=>0===e),r.length);return this.pos=n+Math.min(e+1,r.length),es.decode(r.subarray(0,e))}case x.UTF_16_BE_NO_BOM:{let e=new TextDecoder("utf-16be"),t=eJ(r.findIndex((e,t)=>0===e&&0===r[t+1]&&t%2==0),r.length);return this.pos=n+Math.min(t+2,r.length),e.decode(r.subarray(0,t))}case x.UTF_8:{let e=eJ(r.findIndex(e=>0===e),r.length);return this.pos=n+Math.min(e+1,r.length),es.decode(r.subarray(0,e))}}}readId3V2EncodingAndText(e){if(this.pos>=e)return"";let t=this.readId3V2TextEncoding();return this.readId3V2Text(t,e)}}let rV=async(e,t,n)=>{let r=t;for(;null===n||r<n;){let t=e.requestSlice(r,4);if(t instanceof Promise&&(t=await t),!t)break;let n=rI(nj(t),null!==e.fileSize?e.fileSize-r:null);if(n.header)return{header:n.header,startPos:r};r+=n.bytesAdvanced}return null};class rj extends tJ{constructor(e){super(e),this.metadataPromise=null,this.firstFrameHeader=null,this.loadedSamples=[],this.metadataTags=null,this.tracks=[],this.readingMutex=new ev,this.lastSampleLoaded=!1,this.lastLoadedPos=0,this.nextTimestampInSamples=0,this.reader=e._reader}async readMetadata(){return this.metadataPromise??=(async()=>{for(;!this.firstFrameHeader&&!this.lastSampleLoaded;)await this.advanceReader();if(!this.firstFrameHeader)throw Error("No valid MP3 frame found.");this.tracks=[new nP(this.input,new r$(this))]})()}
69async advanceReader(){if(0===this.lastLoadedPos)for(;;){let e=this.reader.requestSlice(this.lastLoadedPos,10);if(e instanceof Promise&&(e=await e),!e){this.lastSampleLoaded=!0;return}let t=rF(e);if(!t)break;this.lastLoadedPos=e.filePos+t.size}let e=await rV(this.reader,this.lastLoadedPos,this.reader.fileSize);if(!e){this.lastSampleLoaded=!0;return}let t=e.header;this.lastLoadedPos=e.startPos+t.totalSize-1;let n=r_(t.mpegVersionId,t.channel),r=this.reader.requestSlice(e.startPos+n,4);if(r instanceof Promise&&(r=await r),r){let e=nj(r);if(1483304551===e||1231971951===e)return}this.firstFrameHeader||(this.firstFrameHeader=t),t.sampleRate!==this.firstFrameHeader.sampleRate&&console.warn(`MP3 changed sample rate mid-file: ${this.firstFrameHeader.sampleRate} Hz to ${t.sampleRate} Hz. Might be a bug, so please report this file.`);let i=t.audioSamplesInFrame/this.firstFrameHeader.sampleRate,a={timestamp:this.nextTimestampInSamples/this.firstFrameHeader.sampleRate,duration:i,dataStart:e.startPos,dataSize:t.totalSize};this.loadedSamples.push(a),this.nextTimestampInSamples+=t.audioSamplesInFrame}async getMimeType(){return"audio/mpeg"}async getTracks(){return await this.readMetadata(),this.tracks}async computeDuration(){await this.readMetadata();let e=this.tracks[0];return et(e),e.computeDuration()}async getMetadataTags(){let e=await this.readingMutex.acquire();try{if(await this.readMetadata(),this.metadataTags)return this.metadataTags;this.metadataTags={};let e=0,t=!1;for(;;){let n=this.reader.requestSlice(e,10);if(n instanceof Promise&&(n=await n),!n)break;let r=rF(n);if(!r)break;t=!0;let i=this.reader.requestSlice(n.filePos,r.size);if(i instanceof Promise&&(i=await i),!i)break;rB(i,r,this.metadataTags),e=n.filePos+r.size}if(!t&&null!==this.reader.fileSize&&this.reader.fileSize>=128){let e=this.reader.requestSlice(this.reader.fileSize-128,128);e instanceof Promise&&(e=await e),et(e);let t=nJ(e,3);"TAG"===t&&rz(e,this.metadataTags)}return this.metadataTags}finally{e()}}}class r${constructor(e){this.demuxer=e}getId(){return 1}getNumber(){return 1}async getFirstTimestamp(){return 0}getTimeResolution(){return et(this.demuxer.firstFrameHeader),this.demuxer.firstFrameHeader.sampleRate/this.demuxer.firstFrameHeader.audioSamplesInFrame}async computeDuration(){let e=await this.getPacket(1/0,{metadataOnly:!0});return(e?.timestamp??0)+(e?.duration??0)}getName(){return null}getLanguageCode(){return"und"}getCodec(){return"mp3"}getInternalCodecId(){return null}getNumberOfChannels(){return et(this.demuxer.firstFrameHeader),3===this.demuxer.firstFrameHeader.channel?1:2}getSampleRate(){return et(this.demuxer.firstFrameHeader),this.demuxer.firstFrameHeader.sampleRate}getDisposition(){return{...nL}}async getDecoderConfig(){return et(this.demuxer.firstFrameHeader),{codec:"mp3",numberOfChannels:3===this.demuxer.firstFrameHeader.channel?1:2,sampleRate:this.demuxer.firstFrameHeader.sampleRate}}async getPacketAtIndex(e,t){let n;if(-1===e)return null;let r=this.demuxer.loadedSamples[e];if(!r)return null;if(t.metadataOnly)n=t1;else{let e=this.demuxer.reader.requestSlice(r.dataStart,r.dataSize);if(e instanceof Promise&&(e=await e),!e)return null;n=nD(e,r.dataSize)}return new t2(n,"key",r.timestamp,r.duration,e,r.dataSize)}getFirstPacket(e){return this.getPacketAtIndex(0,e)}async getNextPacket(e,t){let n=await this.demuxer.readingMutex.acquire();try{let n=ew(this.demuxer.loadedSamples,e.timestamp,e=>e.timestamp);if(-1===n)throw Error("Packet was not created from this track.");let r=n+1;for(;r>=this.demuxer.loadedSamples.length&&!this.demuxer.lastSampleLoaded;)await this.demuxer.advanceReader();return this.getPacketAtIndex(r,t)}finally{n()}}async getPacket(e,t){let n=await this.demuxer.readingMutex.acquire();try{for(;;){let n=ex(this.demuxer.loadedSamples,e,e=>e.timestamp);if(-1===n&&this.demuxer.loadedSamples.length>0)return null;if(this.demuxer.lastSampleLoaded||n>=0&&n+1<this.demuxer.loadedSamples.length)return this.getPacketAtIndex(n,t);await this.demuxer.advanceReader()}}finally{n()}}getKeyPacket(e,t){return this.getPacket(e,t)}getNextKeyPacket(e,t){return this.getNextPacket(e,t)}}let rU=new Uint32Array(256);for(let e=0;e<256;e++){let t=e<<24;for(let e=0;e<8;e++)t=2147483648&t?t<<1^79764919:t<<1;rU[e]=t>>>0&4294967295}let rW=e=>{let t=el(e),n=t.getUint32(22,!0);t.setUint32(22,0,!0);let r=0;for(let t=0;t<e.length;t++)r=(r<<8^rU[r>>>24^e[t]])>>>0;return t.setUint32(22,n,!0),r},rG=(e,t,n)=>{let r=0,i=null;if(e.length>0){if("vorbis"===t.codec){et(t.vorbisInfo);let a=(1<<ez(t.vorbisInfo.modeBlockflags.length-1))-1<<1,o=(e[0]&a)>>1;if(o>=t.vorbisInfo.modeBlockflags.length)throw Error("Invalid mode number.");let l=n,s=t.vorbisInfo.modeBlockflags[o];if(i=t.vorbisInfo.blocksizes[s],1===s){let n=e[0]&(1|a)+1?1:0;l=t.vorbisInfo.blocksizes[n]}r=null!==l?l+i>>2:0}else"opus"===t.codec&&(r=tH(e).durationInSamples)}return{durationInSamples:r,vorbisBlockSize:i}},rq=e=>{let t="audio/ogg";if(e.codecStrings){let n=[...new Set(e.codecStrings)];t+=`; codecs="${n.join(", ")}"`}return t},rZ=e=>{let t=e.filePos;if(1399285583!==n$(e))return null;e.skip(1);let n=nz(e),r=nX(e),i=n$(e),a=n$(e),o=n$(e),l=nz(e),s=new Uint8Array(l);for(let t=0;t<l;t++)s[t]=nz(e);let c=27+l,u=s.reduce((e,t)=>
69e+t,0);return{headerStartPos:t,totalSize:c+u,dataStartPos:t+c,dataSize:u,headerType:n,granulePosition:r,serialNumber:i,sequenceNumber:a,checksum:o,lacingValues:s}},rX=(e,t)=>{for(;e.filePos<t-3;){let t=n$(e),n=255&t,r=t>>>8&255,i=t>>>16&255,a=t>>>24&255;if(79===n||79===r||79===i||79===a){if(e.skip(-4),1399285583===t)return!0;e.skip(1)}}return!1};class rY extends tJ{constructor(e){super(e),this.metadataPromise=null,this.bitstreams=[],this.tracks=[],this.metadataTags={},this.reader=e._reader}async readMetadata(){return this.metadataPromise??=(async()=>{let e=0;for(;;){let t=this.reader.requestSliceRange(e,27,282);if(t instanceof Promise&&(t=await t),!t)break;let n=rZ(t);if(!n||!(2&n.headerType))break;this.bitstreams.push({serialNumber:n.serialNumber,bosPage:n,description:null,numberOfChannels:-1,sampleRate:-1,codecInfo:{codec:null,vorbisInfo:null,opusInfo:null},lastMetadataPacket:null}),e=n.headerStartPos+n.totalSize}for(let e of this.bitstreams){let t=await this.readPacket(e.bosPage,0);t&&(t.data.byteLength>=7&&1===t.data[0]&&118===t.data[1]&&111===t.data[2]&&114===t.data[3]&&98===t.data[4]&&105===t.data[5]&&115===t.data[6]?await this.readVorbisMetadata(t,e):t.data.byteLength>=8&&79===t.data[0]&&112===t.data[1]&&117===t.data[2]&&115===t.data[3]&&72===t.data[4]&&101===t.data[5]&&97===t.data[6]&&100===t.data[7]&&await this.readOpusMetadata(t,e),null!==e.codecInfo.codec&&this.tracks.push(new nP(this.input,new rK(e,this))))}})()}async readVorbisMetadata(e,t){let n=await this.findNextPacketStart(e);if(!n)return;let r=await this.readPacket(n.startPage,n.startSegmentIndex);if(!r||!(n=await this.findNextPacketStart(r)))return;let i=await this.readPacket(n.startPage,n.startSegmentIndex);if(!i||3!==r.data[0]||5!==i.data[0])return;let a=[],o=e=>{for(;a.push(Math.min(255,e)),!(e<255);)e-=255};o(e.data.length),o(r.data.length);let l=new Uint8Array(1+a.length+e.data.length+r.data.length+i.data.length);l[0]=2,l.set(a,1),l.set(e.data,1+a.length),l.set(r.data,1+a.length+e.data.length),l.set(i.data,1+a.length+e.data.length+r.data.length),t.codecInfo.codec="vorbis",t.description=l,t.lastMetadataPacket=i;let s=el(e.data);t.numberOfChannels=s.getUint8(11),t.sampleRate=s.getUint32(12,!0);let c=s.getUint8(28);t.codecInfo.vorbisInfo={blocksizes:[1<<(15&c),1<<(c>>4)],modeBlockflags:tV(i.data).modeBlockflags},t$(r.data.subarray(7),this.metadataTags)}async readOpusMetadata(e,t){let n=await this.findNextPacketStart(e);if(!n)return;let r=await this.readPacket(n.startPage,n.startSegmentIndex);if(!r)return;t.codecInfo.codec="opus",t.description=e.data,t.lastMetadataPacket=r;let i=tF(e.data);t.numberOfChannels=i.outputChannelCount,t.sampleRate=48e3,t.codecInfo.opusInfo={preSkip:i.preSkip},t$(r.data.subarray(8),this.metadataTags)}async readPacket(e,t){et(t<e.lacingValues.length);let n=0;for(let r=0;r<t;r++)n+=e.lacingValues[r];let r=e,i=n,a=t,o=[];n:for(;;){let t=this.reader.requestSlice(r.dataStartPos,r.dataSize);t instanceof Promise&&(t=await t),et(t);let l=nD(t,r.dataSize);for(;;){if(a===r.lacingValues.length){o.push(l.subarray(n,i));break}let e=r.lacingValues[a];if(i+=e,e<255){o.push(l.subarray(n,i));break n}a++}let s=r.headerStartPos+r.totalSize;for(;;){let t=this.reader.requestSliceRange(s,27,282);if(t instanceof Promise&&(t=await t),!t)return null;let n=rZ(t);if(!n)return null;if((r=n).serialNumber===e.serialNumber)break;s=r.headerStartPos+r.totalSize}n=0,i=0,a=0}let l=o.reduce((e,t)=>e+t.length,0);if(0===l)return null;let s=new Uint8Array(l),c=0;for(let e=0;e<o.length;e++){let t=o[e];s.set(t,c),c+=t.length}return{data:s,endPage:r,endSegmentIndex:a}}async findNextPacketStart(e){if(e.endSegmentIndex<e.endPage.lacingValues.length-1)return{startPage:e.endPage,startSegmentIndex:e.endSegmentIndex+1};if(4&e.endPage.headerType)return null;let t=e.endPage.headerStartPos+e.endPage.totalSize;for(;;){let n=this.reader.requestSliceRange(t,27,282);if(n instanceof Promise&&(n=await n),!n)return null;let r=rZ(n);if(!r)return null;if(r.serialNumber===e.endPage.serialNumber)return{startPage:r,startSegmentIndex:0};t=r.headerStartPos+r.totalSize}}async getMimeType(){return await this.readMetadata(),rq({codecStrings:(await Promise.all(this.tracks.map(e=>
69e.getCodecParameterString()))).filter(Boolean)})}async getTracks(){return await this.readMetadata(),this.tracks}async computeDuration(){let e=await this.getTracks();return Math.max(0,...await Promise.all(e.map(e=>e.computeDuration())))}async getMetadataTags(){return await this.readMetadata(),this.metadataTags}}class rK{constructor(e,t){this.bitstream=e,this.demuxer=t,this.encodedPacketToMetadata=new WeakMap,this.sequentialScanCache=[],this.sequentialScanMutex=new ev,this.internalSampleRate="opus"===e.codecInfo.codec?48e3:e.sampleRate}getId(){return this.bitstream.serialNumber}getNumber(){let e=this.demuxer.tracks.findIndex(e=>e._backing.bitstream===this.bitstream);return et(-1!==e),e+1}getNumberOfChannels(){return this.bitstream.numberOfChannels}getSampleRate(){return this.bitstream.sampleRate}getTimeResolution(){return this.bitstream.sampleRate}getCodec(){return this.bitstream.codecInfo.codec}getInternalCodecId(){return null}async getDecoderConfig(){return et(this.bitstream.codecInfo.codec),{codec:this.bitstream.codecInfo.codec,numberOfChannels:this.bitstream.numberOfChannels,sampleRate:this.bitstream.sampleRate,description:this.bitstream.description??void 0}}getName(){return null}getLanguageCode(){return"und"}getDisposition(){return{...nL}}async getFirstTimestamp(){return 0}async computeDuration(){let e=await this.getPacket(1/0,{metadataOnly:!0});return(e?.timestamp??0)+(e?.duration??0)}granulePositionToTimestampInSamples(e){return"opus"===this.bitstream.codecInfo.codec?(et(this.bitstream.codecInfo.opusInfo),e-this.bitstream.codecInfo.opusInfo.preSkip):e}createEncodedPacketFromOggPacket(e,t,n){if(!e)return null;let{durationInSamples:r,vorbisBlockSize:i}=rG(e.data,this.bitstream.codecInfo,t.vorbisLastBlocksize),a=new t2(n.metadataOnly?t1:e.data,"key",Math.max(0,t.timestampInSamples)/this.internalSampleRate,r/this.internalSampleRate,e.endPage.headerStartPos+e.endSegmentIndex,e.data.byteLength);return this.encodedPacketToMetadata.set(a,{packet:e,timestampInSamples:t.timestampInSamples,durationInSamples:r,vorbisLastBlockSize:t.vorbisLastBlocksize,vorbisBlockSize:i}),a}async getFirstPacket(e){et(this.bitstream.lastMetadataPacket);let t=await this.demuxer.findNextPacketStart(this.bitstream.lastMetadataPacket);if(!t)return null;let n=0;"opus"===this.bitstream.codecInfo.codec&&(et(this.bitstream.codecInfo.opusInfo),n-=this.bitstream.codecInfo.opusInfo.preSkip);let r=await this.demuxer.readPacket(t.startPage,t.startSegmentIndex);return this.createEncodedPacketFromOggPacket(r,{timestampInSamples:n,vorbisLastBlocksize:null},e)}async getNextPacket(e,t){let n=this.encodedPacketToMetadata.get(e);if(!n)throw Error("Packet was not created from this track.");let r=await this.demuxer.findNextPacketStart(n.packet);if(!r)return null;let i=n.timestampInSamples+n.durationInSamples,a=await this.demuxer.readPacket(r.startPage,r.startSegmentIndex);return this.createEncodedPacketFromOggPacket(a,{timestampInSamples:i,vorbisLastBlocksize:n.vorbisBlockSize},t)}async getPacket(e,t){let n,r;if(null===this.demuxer.reader.fileSize)return this.getPacketSequential(e,t);let i=eI(e*this.internalSampleRate);if(0===i)return this.getFirstPacket(t);if(i<0)return null;et(this.bitstream.lastMetadataPacket);let a=await this.demuxer.findNextPacketStart(this.bitstream.lastMetadataPacket);if(!a)return null;let o=a.startPage,l=this.demuxer.reader.fileSize,s=[o];n:for(;o.headerStartPos+o.totalSize<l;){let e=Math.floor((o.headerStartPos+l)/2),t=e;for(;;){let n=Math.min(t+65307,l-27),r=this.demuxer.reader.requestSlice(t,n-t);if(r instanceof Promise&&(r=await r),et(r),!rX(r,n)){l=e+27;continue n}let a=this.demuxer.reader.requestSliceRange(r.filePos,27,282);a instanceof Promise&&(a=await a),et(a);let c=rZ(a);et(c);let u=!1;if(c.serialNumber===this.bitstream.serialNumber)u=!0;else{let e=this.demuxer.reader.requestSlice(c.headerStartPos,c.totalSize);e instanceof Promise&&(e=await e),et(e),u=rW(nD(e,c.totalSize))===c.checksum}if(!u){t=c.headerStartPos+4;continue}if(u&&c.serialNumber!==this.bitstream.serialNumber||-1===c.granulePosition){t=c.headerStartPos+c.totalSize;continue}this.granulePositionToTimestampInSamples(c.granulePosition)>i?l=c.headerStartPos:(o=c,s.push(c));continue n}}let c=a.startPage;for(let e of s){if(e.granulePosition===o.granulePosition)break;(!c||e.headerStartPos>c.headerStartPos)&&(c=e)}let u=c,d=[u];for(;u.serialNumber!==this.bitstream.serialNumber||u.granulePosition!==o.granulePosition;){let e=u.headerStartPos+u.totalSize,t=this.demuxer.reader.requestSliceRange(e,27,282);t instanceof Promise&&(t=await t),et(t);let n=rZ(t);et(n),(u=n).serialNumber===this.bitstream.serialNumber&&d.push(u)}et(-1!==u.granulePosition);let h=null,f=u,p=0;if(u.headerStartPos===a.startPage.headerStartPos)n=this.granulePositionToTimestampInSamples(0),r=!0,h=0;else{n=0,r=!1;for(let e=u.lacingValues.length-1;e>=0;e--)if(u.lacingValues[e]<255){h=e+1;break}if(null===h)throw Error("Invalid page with granule position: no packets end on this page.");let e={data:t1,endPage:f,endSegmentIndex:p=h-1};if(await this.demuxer.findNextPacketStart(e)){let e=rQ(d,u,h);et(e);let t=rJ(d,e.page,e.segmentIndex);t&&(u=t.page,h=t.segmentIndex)}else for(;;){let e=rQ(d,u,h);if(!e)break;let t=rJ(d,e.page,e.segmentIndex);if(!t)break;
69if(u=t.page,h=t.segmentIndex,e.page.headerStartPos!==f.headerStartPos){f=e.page,p=e.segmentIndex;break}}}let m=null,g=null;for(;null!==u;){et(null!==h);let e=await this.demuxer.readPacket(u,h);if(!e)break;if(!(u.headerStartPos===a.startPage.headerStartPos&&h<a.startSegmentIndex)){let a=this.createEncodedPacketFromOggPacket(e,{timestampInSamples:n,vorbisLastBlocksize:g?.vorbisBlockSize??null},t);et(a);let o=this.encodedPacketToMetadata.get(a);if(et(o),r||e.endPage.headerStartPos!==f.headerStartPos||e.endSegmentIndex!==p?n+=o.durationInSamples:(n=this.granulePositionToTimestampInSamples(u.granulePosition),r=!0,et(a=this.createEncodedPacketFromOggPacket(e,{timestampInSamples:n-o.durationInSamples,vorbisLastBlocksize:g?.vorbisBlockSize??null},t)),et(o=this.encodedPacketToMetadata.get(a))),m=a,g=o,r&&(Math.max(n,0)>i||Math.max(o.timestampInSamples,0)===i))break}let o=await this.demuxer.findNextPacketStart(e);if(!o)break;u=o.startPage,h=o.startSegmentIndex}return m}async getPacketSequential(e,t){let n=await this.sequentialScanMutex.acquire();try{let n;let r=eI(e*this.internalSampleRate);e=r/this.internalSampleRate;let i=ex(this.sequentialScanCache,r,e=>e.timestampInSamples);if(-1!==i){let e=this.sequentialScanCache[i];n=this.createEncodedPacketFromOggPacket(e.packet,{timestampInSamples:e.timestampInSamples,vorbisLastBlocksize:e.vorbisLastBlockSize},t)}else n=await this.getFirstPacket(t);let a=0;for(;n&&n.timestamp<e;){let r=await this.getNextPacket(n,t);if(!r||r.timestamp>e)break;if(n=r,a++,100===a){a=0;let e=this.encodedPacketToMetadata.get(n);et(e),this.sequentialScanCache.length>0&&et(er(this.sequentialScanCache).timestampInSamples<=e.timestampInSamples),this.sequentialScanCache.push(e)}}return n}finally{n()}}getKeyPacket(e,t){return this.getPacket(e,t)}getNextKeyPacket(e,t){return this.getNextPacket(e,t)}}let rJ=(e,t,n)=>{let r=t,i=n;n:for(;;){for(i--;i>=0;i--)if(r.lacingValues[i]<255){i++;break n}if(et(-1===i),!(1&r.headerType)){i=0;break}let t=ek(e,e=>e.headerStartPos<r.headerStartPos);if(!t)return null;i=(r=t).lacingValues.length}if(et(-1!==i),i===r.lacingValues.length){let t=e[e.indexOf(r)+1];et(t),r=t,i=0}return{page:r,segmentIndex:i}},rQ=(e,t,n)=>{if(n>0)return{page:t,segmentIndex:n-1};let r=ek(e,e=>e.headerStartPos<t.headerStartPos);return r?{page:r,segmentIndex:r.lacingValues.length-1}:null};(h=C||(C={}))[h.PCM=1]="PCM",h[h.IEEE_FLOAT=3]="IEEE_FLOAT",h[h.ALAW=6]="ALAW",h[h.MULAW=7]="MULAW",h[h.EXTENSIBLE=65534]="EXTENSIBLE";class r0 extends tJ{constructor(e){super(e),this.metadataPromise=null,this.dataStart=-1,this.dataSize=-1,this.audioInfo=null,this.tracks=[],this.lastKnownPacketIndex=0,this.metadataTags={},this.reader=e._reader}async readMetadata(){return this.metadataPromise??=(async()=>{let e=this.reader.requestSlice(0,12);e instanceof Promise&&(e=await e),et(e);let t=nJ(e,4),n="RIFX"!==t,r="RF64"===t,i=nV(e,n),a=r?this.reader.fileSize:Math.min(i+8,this.reader.fileSize??1/0);if("WAVE"!==nJ(e,4))throw Error("Invalid WAVE file - wrong format");let o=0,l=null,s=e.filePos;for(;null===a||s<a;){let e=this.reader.requestSlice(s,8);if(e instanceof Promise&&(e=await e),!e)break;let t=nJ(e,4),i=nV(e,n),c=e.filePos;if(r&&0===o&&"ds64"!==t)throw Error('Invalid RF64 file: First chunk must be "ds64".');if("fmt "===t)await this.parseFmtChunk(c,i,n);else if("data"===t){if(l??=i,this.dataStart=e.filePos,this.dataSize=Math.min(l,(a??1/0)-this.dataStart),null===this.reader.fileSize)break}else if("ds64"===t){let e=this.reader.requestSlice(c,i);if(e instanceof Promise&&(e=await e),!e)break;let t=nG(e,n);l=nG(e,n),a=Math.min(t+8,this.reader.fileSize??1/0)}else"LIST"===t?await this.parseListChunk(c,i,n):("ID3 "===t||"id3 "===t)&&await this.parseId3Chunk(c,i);s=c+i+(1&i),o++}if(!this.audioInfo)throw Error('Invalid WAVE file - missing "fmt " chunk');if(-1===this.dataStart)throw Error('Invalid WAVE file - missing "data" chunk');let c=this.audioInfo.blockSizeInBytes;this.dataSize=Math.floor(this.dataSize/c)*c,this.tracks.push(new nP(this.input,new r1(this)))})()}async parseFmtChunk(e,t,n){let r,i=this.reader.requestSlice(e,t);if(i instanceof Promise&&(i=await i),!i)return;let a=nN(i,n),o=nN(i,n),l=nV(i,n);i.skip(4);let s=nN(i,n);if(r=14===t?8:nN(i,n),t>=18&&357!==a&&Math.min(t-18,nN(i,n))>=22&&a===C.EXTENSIBLE){i.skip(6);let e=nD(i,16);a=e[0]|e[1]<<8}(a===C.MULAW||a===C.ALAW)&&(r=8),this.audioInfo={format:a,numberOfChannels:o,sampleRate:l,sampleSizeInBytes:Math.ceil(r/8),blockSizeInBytes:s}}async parseListChunk(e,t,n){let r=this.reader.requestSlice(e,t);if(r instanceof Promise&&(r=await r),!r)return;let i=nJ(r,4);if("INFO"!==i&&"INF0"!==i)return;let a=r.filePos;for(;a<=e+t-8;){r.filePos=a;let e=nJ(r,4),t=nV(r,n),i=nD(r,t),o=0;for(let e=0;e<i.length&&0!==i[e];e++)o++;let l=String.fromCharCode(...i.subarray(0,o));switch(this.metadataTags.raw??={},this.metadataTags.raw[e]=l,e){case"INAM":case"TITL":this.metadataTags.title??=l;break;case"TIT3":this.metadataTags.description??=l;break;case"IART":this.metadataTags.artist??=l;break;case"IPRD":this.metadataTags.album??=l;break;case"IPRT":case"ITRK":case"TRCK":{let e=l.split("/"),t=Number.parseInt(e[0],10),n=e[1]&&Number.parseInt(e[1],10);Number.isInteger(t)&&t>0&&(this.metadataTags.trackNumber??=t),n&&Number.isInteger(n)&&n>0&&(this.metadataTags.tracksTotal??=n)}break;case"ICRD":case"IDIT":{let e=new Date(l);Number.isNaN(e.getTime())||(this.metadataTags.date??=e)}break;case"YEAR":{let e=Number.parseInt(l,10);Number.isInteger(e)&&e>
690&&(this.metadataTags.date??=new Date(e,0,1))}break;case"IGNR":case"GENR":this.metadataTags.genre??=l;break;case"ICMT":case"CMNT":case"COMM":this.metadataTags.comment??=l}a+=8+t+(1&t)}}async parseId3Chunk(e,t){let n=this.reader.requestSlice(e,t);if(n instanceof Promise&&(n=await n),!n)return;let r=rF(n);if(r){let i=t-10;r.size=Math.min(r.size,i),r.size>0&&rB(n.slice(e+10,r.size),r,this.metadataTags)}}getCodec(){if(et(this.audioInfo),this.audioInfo.format===C.MULAW)return"ulaw";if(this.audioInfo.format===C.ALAW)return"alaw";if(this.audioInfo.format===C.PCM){if(1===this.audioInfo.sampleSizeInBytes)return"pcm-u8";if(2===this.audioInfo.sampleSizeInBytes)return"pcm-s16";if(3===this.audioInfo.sampleSizeInBytes)return"pcm-s24";if(4===this.audioInfo.sampleSizeInBytes)return"pcm-s32"}return this.audioInfo.format===C.IEEE_FLOAT&&4===this.audioInfo.sampleSizeInBytes?"pcm-f32":null}async getMimeType(){return"audio/wav"}async computeDuration(){await this.readMetadata();let e=this.tracks[0];return et(e),e.computeDuration()}async getTracks(){return await this.readMetadata(),this.tracks}async getMetadataTags(){return await this.readMetadata(),this.metadataTags}}class r1{constructor(e){this.demuxer=e}getId(){return 1}getNumber(){return 1}getCodec(){return this.demuxer.getCodec()}getInternalCodecId(){return et(this.demuxer.audioInfo),this.demuxer.audioInfo.format}async getDecoderConfig(){let e=this.demuxer.getCodec();return e?(et(this.demuxer.audioInfo),{codec:e,numberOfChannels:this.demuxer.audioInfo.numberOfChannels,sampleRate:this.demuxer.audioInfo.sampleRate}):null}async computeDuration(){let e=await this.getPacket(1/0,{metadataOnly:!0});return(e?.timestamp??0)+(e?.duration??0)}getNumberOfChannels(){return et(this.demuxer.audioInfo),this.demuxer.audioInfo.numberOfChannels}getSampleRate(){return et(this.demuxer.audioInfo),this.demuxer.audioInfo.sampleRate}getTimeResolution(){return et(this.demuxer.audioInfo),this.demuxer.audioInfo.sampleRate}getName(){return null}getLanguageCode(){return"und"}getDisposition(){return{...nL}}async getFirstTimestamp(){return 0}async getPacketAtIndex(e,t){let n;et(e>=0),et(this.demuxer.audioInfo);let r=2048*e*this.demuxer.audioInfo.blockSizeInBytes;if(r>=this.demuxer.dataSize)return null;let i=Math.min(2048*this.demuxer.audioInfo.blockSizeInBytes,this.demuxer.dataSize-r);if(null===this.demuxer.reader.fileSize){let e=this.demuxer.reader.requestSlice(this.demuxer.dataStart+r,i);if(e instanceof Promise&&(e=await e),!e)return null}if(t.metadataOnly)n=t1;else{let e=this.demuxer.reader.requestSlice(this.demuxer.dataStart+r,i);e instanceof Promise&&(e=await e),et(e),n=nD(e,i)}let a=2048*e/this.demuxer.audioInfo.sampleRate,o=i/this.demuxer.audioInfo.blockSizeInBytes/this.demuxer.audioInfo.sampleRate;return this.demuxer.lastKnownPacketIndex=Math.max(e,this.demuxer.lastKnownPacketIndex),new t2(n,"key",a,o,e,i)}getFirstPacket(e){return this.getPacketAtIndex(0,e)}async getPacket(e,t){et(this.demuxer.audioInfo);let n=Math.floor(Math.min(e*this.demuxer.audioInfo.sampleRate/2048,(this.demuxer.dataSize-1)/(2048*this.demuxer.audioInfo.blockSizeInBytes)));if(n<0)return null;let r=await this.getPacketAtIndex(n,t);if(r)return r;if(0===n)return null;et(null===this.demuxer.reader.fileSize);let i=await this.getPacketAtIndex(this.demuxer.lastKnownPacketIndex,t);for(;i;){let e=await this.getNextPacket(i,t);if(!e)break;i=e}return i}getNextPacket(e,t){et(this.demuxer.audioInfo);let n=Math.round(e.timestamp*this.demuxer.audioInfo.sampleRate/2048);return this.getPacketAtIndex(n+1,t)}getKeyPacket(e,t){return this.getPacket(e,t)}getNextKeyPacket(e,t){return this.getNextPacket(e,t)}}let r2=e=>{let t=e.filePos,n=new e8(nD(e,9));if(4095!==n.readBits(12)||(n.skipBits(1),0!==n.readBits(2)))return null;let r=n.readBits(1),i=n.readBits(2)+1,a=n.readBits(4);if(15===a)return null;n.skipBits(1);let o=n.readBits(3);if(0===o)throw Error("ADTS frames with channel configuration 0 are not supported.");n.skipBits(1),n.skipBits(1),n.skipBits(1),n.skipBits(1);let l=n.readBits(13);n.skipBits(11);let s=n.readBits(2)+1;if(1!==s)throw Error("ADTS frames with more than one AAC frame are not supported.");let c=null;return 1===r?e.filePos-=2:c=n.readBits(16),{objectType:i,samplingFrequencyIndex:a,channelConfiguration:o,frameLength:l,numberOfAacFrames:s,crcCheck:c,startPos:t}};class r4 extends tJ{constructor(e){super(e),this.metadataPromise=null,this.firstFrameHeader=null,this.loadedSamples=[],this.metadataTags=null,this.tracks=[],this.readingMutex=new ev,this.lastSampleLoaded=!1,this.lastLoadedPos=0,this.nextTimestampInSamples=0,this.reader=e._reader}async readMetadata(){return this.metadataPromise??=(async()=>{for(;!this.firstFrameHeader&&!this.lastSampleLoaded;)await this.advanceReader();et(this.firstFrameHeader),this.tracks=[new nP(this.input,new r3(this))]})()}
69async advanceReader(){if(0===this.lastLoadedPos)for(;;){let e=this.reader.requestSlice(this.lastLoadedPos,10);if(e instanceof Promise&&(e=await e),!e){this.lastSampleLoaded=!0;return}let t=rF(e);if(!t)break;this.lastLoadedPos=e.filePos+t.size}let e=this.reader.requestSliceRange(this.lastLoadedPos,7,9);if(e instanceof Promise&&(e=await e),!e){this.lastSampleLoaded=!0;return}let t=r2(e);if(!t||null!==this.reader.fileSize&&t.startPos+t.frameLength>this.reader.fileSize){this.lastSampleLoaded=!0;return}this.firstFrameHeader||(this.firstFrameHeader=t);let n=e6[t.samplingFrequencyIndex];et(void 0!==n);let r={timestamp:this.nextTimestampInSamples/n,duration:1024/n,dataStart:t.startPos,dataSize:t.frameLength};this.loadedSamples.push(r),this.nextTimestampInSamples+=1024,this.lastLoadedPos=t.startPos+t.frameLength}async getMimeType(){return"audio/aac"}async getTracks(){return await this.readMetadata(),this.tracks}async computeDuration(){await this.readMetadata();let e=this.tracks[0];return et(e),e.computeDuration()}async getMetadataTags(){let e=await this.readingMutex.acquire();try{if(await this.readMetadata(),this.metadataTags)return this.metadataTags;this.metadataTags={};let e=0;for(;;){let t=this.reader.requestSlice(e,10);if(t instanceof Promise&&(t=await t),!t)break;let n=rF(t);if(!n)break;let r=this.reader.requestSlice(t.filePos,n.size);if(r instanceof Promise&&(r=await r),!r)break;rB(r,n,this.metadataTags),e=t.filePos+n.size}return this.metadataTags}finally{e()}}}class r3{constructor(e){this.demuxer=e}getId(){return 1}getNumber(){return 1}async getFirstTimestamp(){return 0}getTimeResolution(){return this.getSampleRate()/1024}async computeDuration(){let e=await this.getPacket(1/0,{metadataOnly:!0});return(e?.timestamp??0)+(e?.duration??0)}getName(){return null}getLanguageCode(){return"und"}getCodec(){return"aac"}getInternalCodecId(){return et(this.demuxer.firstFrameHeader),this.demuxer.firstFrameHeader.objectType}getNumberOfChannels(){et(this.demuxer.firstFrameHeader);let e=e5[this.demuxer.firstFrameHeader.channelConfiguration];return et(void 0!==e),e}getSampleRate(){et(this.demuxer.firstFrameHeader);let e=e6[this.demuxer.firstFrameHeader.samplingFrequencyIndex];return et(void 0!==e),e}getDisposition(){return{...nL}}async getDecoderConfig(){return et(this.demuxer.firstFrameHeader),{codec:`mp4a.40.${this.demuxer.firstFrameHeader.objectType}`,numberOfChannels:this.getNumberOfChannels(),sampleRate:this.getSampleRate()}}async getPacketAtIndex(e,t){let n;if(-1===e)return null;let r=this.demuxer.loadedSamples[e];if(!r)return null;if(t.metadataOnly)n=t1;else{let e=this.demuxer.reader.requestSlice(r.dataStart,r.dataSize);if(e instanceof Promise&&(e=await e),!e)return null;n=nD(e,r.dataSize)}return new t2(n,"key",r.timestamp,r.duration,e,r.dataSize)}getFirstPacket(e){return this.getPacketAtIndex(0,e)}async getNextPacket(e,t){let n=await this.demuxer.readingMutex.acquire();try{let n=ew(this.demuxer.loadedSamples,e.timestamp,e=>e.timestamp);if(-1===n)throw Error("Packet was not created from this track.");let r=n+1;for(;r>=this.demuxer.loadedSamples.length&&!this.demuxer.lastSampleLoaded;)await this.demuxer.advanceReader();return this.getPacketAtIndex(r,t)}finally{n()}}async getPacket(e,t){let n=await this.demuxer.readingMutex.acquire();try{for(;;){let n=ex(this.demuxer.loadedSamples,e,e=>e.timestamp);if(-1===n&&this.demuxer.loadedSamples.length>0)return null;if(this.demuxer.lastSampleLoaded||n>=0&&n+1<this.demuxer.loadedSamples.length)return this.getPacketAtIndex(n,t);await this.demuxer.advanceReader()}}finally{n()}}getKeyPacket(e,t){return this.getPacket(e,t)}getNextKeyPacket(e,t){return this.getNextPacket(e,t)}}let r8=e=>0===e?null:1===e?192:e>=2&&e<=5?144*2**e:6===e?"uncommon-u8":7===e?"uncommon-u16":e>=8&&e<=15?2**e:null,r6=(e,t)=>{switch(e){case 0:return t;case 1:return 88200;case 2:return 176400;case 3:return 192e3;case 4:return 8e3;case 5:return 16e3;case 6:return 22050;case 7:return 24e3;case 8:return 32e3;case 9:return 44100;case 10:return 48e3;case 11:return 96e3;case 12:return"uncommon-u8";case 13:return"uncommon-u16";case 14:return"uncommon-u16-10";default:return null}},r5=e=>{let t=0,n=new e8(nD(e,1));for(;1===n.readBits(1);)t++;if(0===t)return n.readBits(7);let r=[],i=t-1,a=new e8(nD(e,i)),o=8-t-1;for(let e=0;e<o;e++)r.unshift(n.readBits(1));for(let e=0;e<i;e++)for(let e=0;e<8;e++){let t=a.readBits(1);e<2||r.unshift(t)}
69return r.reduce((e,t,n)=>e|t<<n,0)},r9=(e,t)=>"uncommon-u16"===t?nF(e)+1:"uncommon-u8"===t?nz(e)+1:"number"==typeof t?t:void(eM(t),et(!1)),r7=(e,t)=>"uncommon-u16"===t?nF(e):"uncommon-u16-10"===t?10*nF(e):"uncommon-u8"===t?nz(e):"number"==typeof t?t:null,ie=e=>{let t=0;for(let n of e){t^=n;for(let e=0;e<8;e++)(128&t)!=0?t=t<<1^7:t<<=1,t&=255}return t};class it extends tJ{constructor(e){super(e),this.loadedSamples=[],this.metadataPromise=null,this.track=null,this.metadataTags={},this.audioInfo=null,this.lastLoadedPos=null,this.blockingBit=null,this.readingMutex=new ev,this.lastSampleLoaded=!1,this.reader=e._reader}async computeDuration(){return await this.readMetadata(),et(this.track),this.track.computeDuration()}async getMetadataTags(){return await this.readMetadata(),this.metadataTags}async getTracks(){return await this.readMetadata(),et(this.track),[this.track]}async getMimeType(){return"audio/flac"}async readMetadata(){let e=4;return this.metadataPromise??=(async()=>{for(;null===this.reader.fileSize||e<this.reader.fileSize;){let t=this.reader.requestSlice(e,4);if(t instanceof Promise&&(t=await t),e+=4,null===t)throw Error(`Metadata block at position ${e} is too small! Corrupted file.`);et(t);let n=nz(t),r=nB(t),i=(128&n)!=0;switch(127&n){case m.STREAMINFO:{let t=this.reader.requestSlice(e,r);if(t instanceof Promise&&(t=await t),et(t),null===t)throw Error(`StreamInfo block at position ${e} is too small! Corrupted file.`);let n=nD(t,34),i=new e8(n),a=i.readBits(16),o=i.readBits(16),l=i.readBits(24),s=i.readBits(24),c=i.readBits(20),u=i.readBits(3)+1;i.readBits(5);let d=i.readBits(36);i.skipBits(128);let h=new Uint8Array(42);h.set(new Uint8Array([102,76,97,67]),0),h.set(new Uint8Array([128,0,0,34]),4),h.set(n,8),this.audioInfo={numberOfChannels:u,sampleRate:c,totalSamples:d,minimumBlockSize:a,maximumBlockSize:o,minimumFrameSize:l,maximumFrameSize:s,description:h},this.track=new nP(this.input,new ir(this));break}case m.VORBIS_COMMENT:{let t=this.reader.requestSlice(e,r);t instanceof Promise&&(t=await t),et(t),t$(nD(t,r),this.metadataTags);break}case m.PICTURE:{let t=this.reader.requestSlice(e,r);t instanceof Promise&&(t=await t),et(t);let n=nj(t),i=nj(t),a=es.decode(nD(t,i)),o=nj(t),l=es.decode(nD(t,o));t.skip(16);let s=nj(t),c=nD(t,s);this.metadataTags.images??=[],this.metadataTags.images.push({data:c,mimeType:a,kind:3===n?"coverFront":4===n?"coverBack":"unknown",description:l})}}if(e+=r,i){this.lastLoadedPos=e;break}}})()}async readNextFlacFrame({startPos:e,isFirstPacket:t}){et(this.audioInfo);let n=this.audioInfo.maximumBlockSize*this.audioInfo.numberOfChannels*4+16+2,r=this.audioInfo.minimumFrameSize||10,i=this.audioInfo.maximumFrameSize||n,a=await this.reader.requestSliceRange(e,16,i+16);if(!a)return null;let o=this.readFlacFrameHeader({slice:a,isFirstPacket:t});if(!o)return null;for(a.filePos=e+r;;){if(a.filePos>a.end-6)return{num:o.num,blockSize:o.blockSize,sampleRate:o.sampleRate,size:a.end-e,isLastFrame:!0};if(255===nz(a)){let t=a.filePos;if(nz(a)!==(1===this.blockingBit?249:248)){a.filePos=t;continue}a.skip(-2);let n=a.filePos-e,r=this.readFlacFrameHeader({slice:a,isFirstPacket:!1});if(!r){a.filePos=t;continue}if(0===this.blockingBit){if(r.num-o.num!=1){a.filePos=t;continue}}else if(r.num-o.num!==o.blockSize){a.filePos=t;continue}return{num:o.num,blockSize:o.blockSize,sampleRate:o.sampleRate,size:n,isLastFrame:!1}}}}readFlacFrameHeader({slice:e,isFirstPacket:t}){let n=e.filePos,r=new e8(nD(e,4));if(32764!==r.readBits(15))return null;if(null===this.blockingBit){et(t);let e=r.readBits(1);this.blockingBit=e}else if(1===this.blockingBit){if(et(!t),1!==r.readBits(1))return null}else if(0===this.blockingBit){if(et(!t),0!==r.readBits(1))return null}else throw Error("Invalid blocking bit");let i=r8(r.readBits(4));if(!i)return null;et(this.audioInfo);let a=r6(r.readBits(4),this.audioInfo.sampleRate);if(!a||(r.readBits(4),r.readBits(3),0!==r.readBits(1)))return null;let o=r5(e),l=r9(e,i),s=r7(e,a);if(null===s||s!==this.audioInfo.sampleRate)return null;let c=e.filePos-n,u=nz(e);return(e.skip(-c),e.skip(-1),u!==ie(nD(e,c)))?null:{num:o,blockSize:l,sampleRate:s}}async advanceReader(){await this.readMetadata(),et(null!==this.lastLoadedPos),et(this.audioInfo);let e=this.lastLoadedPos,t=await this.readNextFlacFrame({startPos:e,isFirstPacket:0===this.loadedSamples.length});if(!t){this.lastSampleLoaded=!0;return}let n=this.loadedSamples[this.loadedSamples.length-1],r={blockOffset:n?n.blockOffset+n.blockSize:0,blockSize:t.blockSize,byteOffset:e,byteSize:t.size};if(this.lastLoadedPos=this.lastLoadedPos+t.size,this.loadedSamples.push(r),t.isLastFrame){this.lastSampleLoaded=!0;return}}}class ir{constructor(e){this.demuxer=e}getId(){return 1}getNumber(){return 1}getCodec(){return"flac"}getInternalCodecId(){return null}
69getNumberOfChannels(){return et(this.demuxer.audioInfo),this.demuxer.audioInfo.numberOfChannels}async computeDuration(){let e=await this.getPacket(1/0,{metadataOnly:!0});return(e?.timestamp??0)+(e?.duration??0)}getSampleRate(){return et(this.demuxer.audioInfo),this.demuxer.audioInfo.sampleRate}getName(){return null}getLanguageCode(){return"und"}getTimeResolution(){return et(this.demuxer.audioInfo),this.demuxer.audioInfo.sampleRate}getDisposition(){return{...nL}}async getFirstTimestamp(){return 0}async getDecoderConfig(){return et(this.demuxer.audioInfo),{codec:"flac",numberOfChannels:this.demuxer.audioInfo.numberOfChannels,sampleRate:this.demuxer.audioInfo.sampleRate,description:this.demuxer.audioInfo.description}}async getPacket(e,t){if(et(this.demuxer.audioInfo),e<0)throw Error("Timestamp cannot be negative");let n=await this.demuxer.readingMutex.acquire();try{for(;;){let n=ex(this.demuxer.loadedSamples,e,e=>e.blockOffset/this.demuxer.audioInfo.sampleRate);if(-1===n){await this.demuxer.advanceReader();continue}let r=this.demuxer.loadedSamples[n],i=r.blockOffset/this.demuxer.audioInfo.sampleRate,a=r.blockSize/this.demuxer.audioInfo.sampleRate;if(i+a<=e){if(this.demuxer.lastSampleLoaded)return this.getPacketAtIndex(this.demuxer.loadedSamples.length-1,t);await this.demuxer.advanceReader();continue}return this.getPacketAtIndex(n,t)}}finally{n()}}async getNextPacket(e,t){let n=await this.demuxer.readingMutex.acquire();try{let n=e.sequenceNumber+1;if(this.demuxer.lastSampleLoaded&&n>=this.demuxer.loadedSamples.length)return null;for(;n>=this.demuxer.loadedSamples.length&&!this.demuxer.lastSampleLoaded;)await this.demuxer.advanceReader();return this.getPacketAtIndex(n,t)}finally{n()}}getKeyPacket(e,t){return this.getPacket(e,t)}getNextKeyPacket(e,t){return this.getNextPacket(e,t)}async getPacketAtIndex(e,t){let n;let r=this.demuxer.loadedSamples[e];if(!r)return null;if(t.metadataOnly)n=t1;else{let e=this.demuxer.reader.requestSlice(r.byteOffset,r.byteSize);if(e instanceof Promise&&(e=await e),!e)return null;n=nD(e,r.byteSize)}return et(this.demuxer.audioInfo),new t2(n,"key",r.blockOffset/this.demuxer.audioInfo.sampleRate,r.blockSize/this.demuxer.audioInfo.sampleRate,e,r.byteSize)}async getFirstPacket(e){for(;0===this.demuxer.loadedSamples.length&&!this.demuxer.lastSampleLoaded;)await this.demuxer.advanceReader();return this.getPacketAtIndex(0,e)}}let ii=e=>{let t="video/MP2T",n=[...new Set(e.filter(Boolean))];return n.length>0&&(t+=`; codecs="${n.join(", ")}"`),t};class ia extends tJ{constructor(e){super(e),this.metadataPromise=null,this.elementaryStreams=[],this.tracks=[],this.packetOffset=0,this.packetStride=-1,this.sectionEndPositions=[],this.seekChunkSize=5242880,this.minReferencePointByteDistance=-1,this.reader=e._reader}async readMetadata(){return this.metadataPromise??=(async()=>{let e=this.reader.requestSlice(0,205);e instanceof Promise&&(e=await e),et(e);let t=nD(e,205);if(71===t[0]&&71===t[188])this.packetOffset=0,this.packetStride=188;else if(71===t[0]&&71===t[204])this.packetOffset=0,this.packetStride=204;else if(71===t[4]&&71===t[196])this.packetOffset=4,this.packetStride=192;else throw Error("Unreachable.");this.minReferencePointByteDistance=256*this.packetStride;let n=this.packetOffset,r=null,i=!1,a=!1;for(;;){let e=await this.readPacketHeader(n);if(!e)break;if(0===e.payloadUnitStartIndicator){n+=this.packetStride;continue}let t=await this.readSection(n,!0,!a);if(!t)break;let o=!1;if(!a&&0!==t.pid&&!(0===t.payload[0]&&0===t.payload[1]&&1===t.payload[2])){let e=new e8(t.payload),n=e.readAlignedByte();e.skipBits(8*n),o=2===e.readBits(8)}if(0!==t.pid||i){if((t.pid===r||o)&&!a){let e=new e8(t.payload),n=e.readAlignedByte();e.skipBits(8*n),e.skipBits(12);let r=e.readBits(12);e.skipBits(43),e.readBits(13),e.skipBits(6);let i=e.readBits(10);for(e.skipBits(8*i);8*(r+3)-e.pos>32;){let t=e.readBits(8);e.skipBits(3);let n=e.readBits(13);e.skipBits(6);let r=e.readBits(10),i=e.pos+8*r,a=!1,o=!1;for(;e.pos<i;){let t=e.readBits(8),n=e.readBits(8);106===t?a=!0:(122===t||204===t)&&(o=!0),e.skipBits(8*n)}let l=null;switch(t){case 3:case 4:case 15:l={type:"audio",codec:15===t?"aac":"mp3",aacCodecInfo:null,numberOfChannels:-1,sampleRate:-1};break;case 27:case 36:l={type:"video",codec:27===t?"avc":"hevc",avcCodecInfo:null,hevcCodecInfo:null,colorSpace:{primaries:null,transfer:null,matrix:null,fullRange:null},width:-1,height:-1,squarePixelWidth:-1,squarePixelHeight:-1,reorderSize:-1};break;case 129:l={type:"audio",codec:"ac3",aacCodecInfo:null,numberOfChannels:-1,sampleRate:-1};break;case 135:l={type:"audio",codec:"eac3",aacCodecInfo:null,numberOfChannels:-1,sampleRate:-1};break;case 6:o?l={type:"audio",codec:"eac3",aacCodecInfo:null,numberOfChannels:-1,sampleRate:-1}:a&&(l={type:"audio",codec:"ac3",aacCodecInfo:null,numberOfChannels:-1,sampleRate:-1});break;default:console.warn(`Unsupported stream_type 0x${t.toString(16)}; ignoring stream.`)}l&&this.elementaryStreams.push({demuxer:this,pid:n,streamType:t,initialized:!1,firstSection:null,info:l,referencePesPackets:[]})}a=!0}else{let e=this.elementaryStreams.find(e=>e.pid===t.pid);if(e&&!e.initialized){let n=il(t);if(!n)throw Error(`Couldn't read first PES packet for Elementary Stream with PID ${e.pid}`);if(e.firstSection=t,"video"===e.info.type){if("avc"===e.info.codec){if
69(e.info.avcCodecInfo=ty(n.data),!e.info.avcCodecInfo)throw Error("Invalid AVC video stream; could not extract AVCDecoderConfigurationRecord from first packet.");let t=e.info.avcCodecInfo.sequenceParameterSets[0];et(t);let r=tC(t);e.info.width=r.displayWidth,e.info.height=r.displayHeight,r.pixelAspectRatio.num>r.pixelAspectRatio.den?(e.info.squarePixelWidth=Math.round(e.info.width*r.pixelAspectRatio.num/r.pixelAspectRatio.den),e.info.squarePixelHeight=e.info.height):(e.info.squarePixelWidth=e.info.width,e.info.squarePixelHeight=Math.round(e.info.height*r.pixelAspectRatio.den/r.pixelAspectRatio.num)),e.info.colorSpace={primaries:ed[r.colourPrimaries],transfer:ef[r.transferCharacteristics],matrix:em[r.matrixCoefficients],fullRange:!!r.fullRangeFlag},e.info.reorderSize=r.maxDecFrameBuffering,e.initialized=!0}else if("hevc"===e.info.codec){if(e.info.hevcCodecInfo=tP(n.data),!e.info.hevcCodecInfo)throw Error("Invalid HEVC video stream; could not extract HVCDecoderConfigurationRecord from first packet.");let t=e.info.hevcCodecInfo.arrays.find(e=>e.nalUnitType===p.SPS_NUT).nalUnits[0];et(t);let r=tT(t);e.info.width=r.displayWidth,e.info.height=r.displayHeight,r.pixelAspectRatio.num>r.pixelAspectRatio.den?(e.info.squarePixelWidth=Math.round(e.info.width*r.pixelAspectRatio.num/r.pixelAspectRatio.den),e.info.squarePixelHeight=e.info.height):(e.info.squarePixelWidth=e.info.width,e.info.squarePixelHeight=Math.round(e.info.height*r.pixelAspectRatio.den/r.pixelAspectRatio.num)),e.info.colorSpace={primaries:ed[r.colourPrimaries],transfer:ef[r.transferCharacteristics],matrix:em[r.matrixCoefficients],fullRange:!!r.fullRangeFlag},e.info.reorderSize=r.maxDecFrameBuffering,e.initialized=!0}else throw Error("Unhandled.")}else if("aac"===e.info.codec){let t=r2(nI.tempFromBytes(n.data));if(!t)throw Error("Invalid AAC audio stream; could not read ADTS frame header from first packet.");e.info.aacCodecInfo={isMpeg2:!1,objectType:t.objectType},e.info.numberOfChannels=e5[t.channelConfiguration],e.info.sampleRate=e6[t.samplingFrequencyIndex],e.initialized=!0}else if("mp3"===e.info.codec){let t=rI(nj(nI.tempFromBytes(n.data)),n.data.byteLength);if(!t.header)throw Error("Invalid MP3 audio stream; could not read frame header from first packet.");e.info.numberOfChannels=3===t.header.channel?1:2,e.info.sampleRate=t.header.sampleRate,e.initialized=!0}else if("ac3"===e.info.codec){let t=tW(n.data);if(!t)throw Error("Invalid AC-3 audio stream; could not read sync frame from first packet.");if(3===t.fscod)throw Error("Invalid AC-3 audio stream; reserved sample rate code found in first packet.");e.info.numberOfChannels=tU[t.acmod]+t.lfeon,e.info.sampleRate=ts[t.fscod],e.initialized=!0}else if("eac3"===e.info.codec){let t=tZ(n.data);if(!t)throw Error("Invalid E-AC-3 audio stream; could not read sync frame from first packet.");let r=tY(t);if(null===r)throw Error("Invalid E-AC-3 audio stream; reserved sample rate code found in first packet.");e.info.numberOfChannels=tK(t),e.info.sampleRate=r,e.initialized=!0}else throw Error("Unhandled.")}}}else{let e=new e8(t.payload),n=e.readAlignedByte();e.skipBits(8*n),e.skipBits(14);let a=e.readBits(10);for(e.skipBits(40);8*(a+3)-e.pos>32;){let t=e.readBits(16);e.skipBits(3);let n=e.readBits(13);if(0!==t){if(null!==r)throw Error("Only files with a single program are supported.");r=n}}if(null===r)throw Error("Program Association Table must link to a Program Map Table.");i=!0}if(a&&this.elementaryStreams.every(e=>e.initialized))break;n+=this.packetStride}if(!a){if(!i)throw Error("No Program Association Table found in the file.");throw Error("No Program Map Table found in the file.")}for(let e of this.elementaryStreams)"video"===e.info.type?this.tracks.push(new nT(this.input,new ic(e))):this.tracks.push(new nP(this.input,new iu(e)))})()}async getTracks(){return await this.readMetadata(),this.tracks}async getMetadataTags(){return{}}async computeDuration(){let e=await this.getTracks();return Math.max(0,...await Promise.all(e.map(e=>e.computeDuration())))}async getMimeType(){await this.readMetadata();let e=await this.getTracks();return ii(await Promise.all(e.map(e=>e.getCodecParameterString())))}async readSection(e,t,n=!1){let r,i=e,a=e,o=[],l=0,s=null,c=!0,u=0;for(;;){let e=await this.readPacket(a);if(a+=this.packetStride,!e)break;if(s){if(e.pid!==s.pid){if(!n)continue;break}if(1===e.payloadUnitStartIndicator)break}else{if(0===e.payloadUnitStartIndicator)break;s=e}let r=!!(2&e.adaptationFieldControl),d=!!(1&e.adaptationFieldControl),h=0;if(r&&(h=1+e.body[0],e===s&&h>1&&(u=e.body[1]>>
696&1)),d&&(0===h?(o.push(e.body),l+=e.body.byteLength):(o.push(e.body.subarray(h)),l+=e.body.byteLength-h)),i=a,!t&&l>=64||-1!==ew(this.sectionEndPositions,i,e=>e)){c=!1;break}}if(c){let e=ex(this.sectionEndPositions,i,e=>e);this.sectionEndPositions.splice(e+1,0,i)}if(!s)return null;if(1===o.length)r=o[0];else{r=new Uint8Array(o.reduce((e,t)=>e+t.length,0));let e=0;for(let t of o)r.set(t,e),e+=t.length}return{startPos:e,endPos:t?i:null,pid:s.pid,payload:r,randomAccessIndicator:u}}async readPacketHeader(e){let t=this.reader.requestSlice(e,4);if(t instanceof Promise&&(t=await t),!t)return null;if(71!==nz(t))throw Error("Invalid TS packet sync byte. Likely an internal bug, please report this file.");let n=nF(t);return{payloadUnitStartIndicator:n>>14&1,pid:8191&n,adaptationFieldControl:nz(t)>>4&3}}async readPacket(e){let t=this.reader.requestSlice(e,188);if(t instanceof Promise&&(t=await t),!t)return null;let n=nD(t,188);if(71!==n[0])throw Error("Invalid TS packet sync byte. Likely an internal bug, please report this file.");let r=(n[1]<<8)+n[2];return{payloadUnitStartIndicator:r>>14&1,pid:8191&r,adaptationFieldControl:n[3]>>4&3,body:n.subarray(4)}}}let io=e=>{if(e.payload.byteLength<3)return null;let t=new e8(e.payload);if(1!==t.readBits(24))return null;let n=t.readBits(8);if(t.skipBits(16),188===n||190===n||191===n||240===n||241===n||255===n||242===n||248===n)return null;t.skipBits(8);let r=t.readBits(2);t.skipBits(14);let i=0;if(2===r||3===r)t.skipBits(4),i+=1073741824*t.readBits(3),t.skipBits(1),i+=32768*t.readBits(15),t.skipBits(1),i+=t.readBits(15);else throw Error("PES packets without PTS are not currently supported. If you think this file should be supported, please report it.");return{sectionStartPos:e.startPos,sectionEndPos:e.endPos,pts:i,randomAccessIndicator:e.randomAccessIndicator}},il=e=>{et(null!==e.endPos);let t=io(e);if(!t)return null;let n=new e8(e.payload);n.skipBits(32);let r=n.readBits(16);n.skipBits(16);let i=n.readBits(8),a=n.pos+8*i;n.pos=a;let o=a/8;et(Number.isInteger(o));let l=e.payload.subarray(o,r>0?6+r:e.payload.byteLength);return{...t,data:l}};class is{constructor(e){this.elementaryStream=e,this.packetBuffers=new WeakMap,this.packetSectionStarts=new WeakMap}getId(){return this.elementaryStream.pid}getNumber(){let e=this.elementaryStream.demuxer,t=this.elementaryStream.info.type,n=0;for(let r of e.tracks)if(r.type===t&&n++,et(r._backing instanceof is),r._backing.elementaryStream===this.elementaryStream)break;return n}getCodec(){throw Error("Not implemented on base class.")}getInternalCodecId(){return this.elementaryStream.streamType}getName(){return null}getLanguageCode(){return"und"}getDisposition(){return nL}getTimeResolution(){return 9e4}async computeDuration(){let e=await this.getPacket(1/0,{metadataOnly:!0});return(e?.timestamp??0)+(e?.duration??0)}async getFirstTimestamp(){let e=await this.getFirstPacket({metadataOnly:!0});return e?.timestamp??0}createEncodedPacket(e,t,n){let r;return r=this.allPacketsAreKeyPackets()?"key":1===e.randomAccessIndicator?"key":"delta",new t2(n.metadataOnly?t1:e.data,r,e.pts/9e4,Math.max(t/9e4,0),e.sequenceNumber,e.data.byteLength)}async getFirstPacket(e){let t=this.elementaryStream.firstSection;et(t);let n=il(t);et(n);let r=new im(this,new ip(this.elementaryStream,n)),i=await r.readNext();if(!i)return null;let a=this.createEncodedPacket(i.packet,i.duration,e);return this.packetBuffers.set(a,r),this.packetSectionStarts.set(a,i.packet.sectionStartPos),a}async getNextPacket(e,t){let n=this.packetBuffers.get(e);if(n){let r=await n.readNext();if(!r)return null;this.packetBuffers.delete(e);let i=this.createEncodedPacket(r.packet,r.duration,t);return this.packetBuffers.set(i,n),this.packetSectionStarts.set(i,r.packet.sectionStartPos),i}let r=this.packetSectionStarts.get(e);if(void 0===r)throw Error("Packet was not created from this track.");let i=this.elementaryStream.demuxer,a=await i.readSection(r,!0);et(a);let o=il(a);et(o),n=new im(this,new ip(this.elementaryStream,o));let l=e.sequenceNumber;for(;;){let e=await n.readNext();if(!e)return null;if(e.packet.sequenceNumber>l){let r=this.createEncodedPacket(e.packet,e.duration,t);return this.packetBuffers.set(r,n),this.packetSectionStarts.set(r,e.packet.sectionStartPos),r}}}async getNextKeyPacket(e,t){let n=e;for(;;){if(!(n=await this.getNextPacket(n,t)))return null;if("key"===n.type)return n}}getPacket(e,t){return this.doPacketLookup(e,!1,t)}getKeyPacket(e,t){return this.doPacketLookup(e,!0,t)}async doPacketLookup(e,t,n){let r;let i=eI(9e4*e),a=this.elementaryStream.demuxer,{reader:o,seekChunkSize:l}=a,s=this.elementaryStream.pid,c=async(e,t)=>{let n=e;for(;n<t;){let e=await a.readPacketHeader(n);if(!e)break;if(e.pid===s&&1===e.payloadUnitStartIndicator){let e=await a.readSection(n,!1);if(!e)return null;let t=io(e);if(t)return t}n+=a.packetStride}return null},u=this.elementaryStream.firstSection;et(u);let d=io(u);if(et(d),i<d.pts)return null;let h=this.elementaryStream.referencePesPackets,f=ex(h,i,e=>e.pts),p=-1!==f?h[f]:null;if(p&&i-p.pts<45e3)r=p.sectionStartPos;else{let e=0;if(null!==o.fileSize){let t=Math.ceil(o.fileSize/l);if(t>1){let n=0,r=t-1;for(e=0;
69n<=r;){let t=Math.floor((n+r)/2),o=eD(t*l,a.packetStride)+d.sectionStartPos,s=o+l,u=await c(o,s);if(!u){r=t-1;continue}u.pts<=i?(e=t,n=t+1):r=t-1}}}r=eD(e*l,a.packetStride)+d.sectionStartPos}let m=await c(r,o.fileSize??1/0);m||(m=d);let g=this.getReorderSize(),v=async(e,t)=>{let r=await a.readSection(e,!0);et(r);let o=il(r);et(o);let l=new im(this,new ip(this.elementaryStream,o));for(;!((er(l.presentationOrderPackets)?.pts??-1/0)>=i)&&await l.readNextPacket(););let s=eS(l.presentationOrderPackets,t);if(-1===s)return null;let c=l.presentationOrderPackets[s],u=0===s?0:c.pts-l.presentationOrderPackets[s-1].pts;for(;l.decodeOrderPackets[0]!==c;)l.decodeOrderPackets.shift();l.lastDuration=u;let d=await l.readNext();et(d);let h=this.createEncodedPacket(d.packet,d.duration,n);return this.packetBuffers.set(h,l),this.packetSectionStarts.set(h,d.packet.sectionStartPos),h};if(!t||this.allPacketsAreKeyPackets()){n:for(;;){let e=m.sectionStartPos+a.packetStride;for(;;){let t=await a.readPacketHeader(e);if(!t)break n;if(t.pid===s&&1===t.payloadUnitStartIndicator){let t=await a.readSection(e,!1);if(t){let e=io(t);if(e){if(e.pts>i)break n;m=e,id(this.elementaryStream,e);break}}}e+=a.packetStride}}n:for(let e=0;e<g;e++){let e=m.sectionStartPos-a.packetStride;for(;e>=a.packetOffset;){let t=await a.readPacketHeader(e);if(!t)break n;if(t.pid===s&&1===t.payloadUnitStartIndicator){let t=await a.readSection(e,!1);if(t){let e=io(t);if(e){m=e;break}}}e-=a.packetStride}}return v(m.sectionStartPos,e=>e.pts<=i)}{let e=r,t=null;for(;;){let n,r=null,u=e<=d.sectionStartPos;u?(n=d,r=d):n=await c(e,o.fileSize??1/0);let h=!1,f=0;n:for(;n&&(null===t||!(n.sectionStartPos>=t))&&(1===n.randomAccessIndicator&&n.pts<=i&&(r=n),n.pts>i&&(h=!0),!(h&&++f>=g));){let e=n.sectionStartPos+a.packetStride;for(;;){let t=await a.readPacketHeader(e);if(!t)break n;if(t.pid===s&&1===t.payloadUnitStartIndicator){let t=await a.readSection(e,!1);if(t&&(n=io(t))){id(this.elementaryStream,n);break}}e+=a.packetStride}}if(r){let e=r;if(0===f)n:for(let t=0;t<g-1;t++){let t=e.sectionStartPos-a.packetStride;for(;t>=a.packetOffset;){let n=await a.readPacketHeader(t);if(!n)break n;if(n.pid===s&&1===n.payloadUnitStartIndicator){let n=await a.readSection(t,!1);if(n){let t=io(n);if(t){e=t;break}}}t-=a.packetStride}}let t=await v(e.sectionStartPos,e=>e.pts<=i&&1===e.randomAccessIndicator);return et(t),t}et(!u),t=e,e=Math.max(eD(e-d.sectionStartPos-l,a.packetStride)+d.sectionStartPos,d.sectionStartPos)}}}}class ic extends is{constructor(e){super(e),this.elementaryStream=e,this.decoderConfig={codec:ti({width:this.elementaryStream.info.width,height:this.elementaryStream.info.height,codec:this.elementaryStream.info.codec,codecDescription:null,colorSpace:this.elementaryStream.info.colorSpace,avcType:1,avcCodecInfo:this.elementaryStream.info.avcCodecInfo,hevcCodecInfo:this.elementaryStream.info.hevcCodecInfo,vp9CodecInfo:null,av1CodecInfo:null}),codedWidth:this.elementaryStream.info.width,codedHeight:this.elementaryStream.info.height,colorSpace:this.elementaryStream.info.colorSpace},(this.elementaryStream.info.width!==this.elementaryStream.info.squarePixelWidth||this.elementaryStream.info.height!==this.elementaryStream.info.squarePixelHeight)&&(this.decoderConfig.displayAspectWidth=this.elementaryStream.info.squarePixelWidth,this.decoderConfig.displayAspectHeight=this.elementaryStream.info.squarePixelHeight)}getCodec(){return this.elementaryStream.info.codec}getCodedWidth(){return this.elementaryStream.info.width}getCodedHeight(){return this.elementaryStream.info.height}getSquarePixelWidth(){return this.elementaryStream.info.squarePixelWidth}getSquarePixelHeight(){return this.elementaryStream.info.squarePixelHeight}getRotation(){return 0}async getColorSpace(){return this.elementaryStream.info.colorSpace}
69async canBeTransparent(){return!1}async getDecoderConfig(){return this.decoderConfig}allPacketsAreKeyPackets(){return!1}getReorderSize(){return this.elementaryStream.info.reorderSize}}class iu extends is{constructor(e){super(e),this.elementaryStream=e}getCodec(){return this.elementaryStream.info.codec}getNumberOfChannels(){return this.elementaryStream.info.numberOfChannels}getSampleRate(){return this.elementaryStream.info.sampleRate}async getDecoderConfig(){return{codec:ta({codec:this.elementaryStream.info.codec,codecDescription:null,aacCodecInfo:this.elementaryStream.info.aacCodecInfo}),numberOfChannels:this.elementaryStream.info.numberOfChannels,sampleRate:this.elementaryStream.info.sampleRate}}allPacketsAreKeyPackets(){return!0}getReorderSize(){return 1}}let id=(e,t)=>{let n=e.referencePesPackets,r=ex(n,t.sectionStartPos,e=>e.sectionStartPos);if(r>=0){let i=n[r];if(t.pts<=i.pts)return!1;let a=e.demuxer.minReferencePointByteDistance;if(t.sectionStartPos-i.sectionStartPos<a)return!1;if(r<n.length-1){let e=n[r+1];if(e.pts<t.pts||e.sectionStartPos-t.sectionStartPos<a)return!1}}return n.splice(r+1,0,t),!0},ih=async e=>{et(!e.suppliedPacket);let t=e.elementaryStream;if("video"===t.info.type){let n=t.info.codec;if("avc"!==n&&"hevc"!==n)throw Error("Unhandled.");let r=null;for(;;){let t=e.ensureBuffered(1024);if(t instanceof Promise&&(t=await t),0===t)break;let i=e.currentPos,a=e.readBytes(t),o=a.byteLength,l=0;for(;l<o;){let t=a.indexOf(0,l);if(-1===t||t>=o)break;let s=i+(l=t);if(l+4>=o){e.seekTo(s);break}let c=a[l+1],u=a[l+2],d=a[l+3],h=0,m=null;if(0===c&&0===u&&1===d?(h=4,m=a[l+4]):0===c&&1===u&&(h=3,m=d),0===h){l++;continue}if(null===r){r=s,l+=h;continue}if(null!==m){let t="avc"===n?tf(m):tS(m);if("avc"===n?t===f.AUD:t===p.AUD_NUT){let t=s-r;return e.seekTo(r),e.supplyPacket(t,0)}}l+=h}if(t<1024)break}if(null!==r){let t=e.endPos-r;return e.seekTo(r),e.supplyPacket(t,0)}}else{let n=t.info.codec;for(;;){let r=e.ensureBuffered(128);r instanceof Promise&&(r=await r);let i=e.currentPos;for(;e.currentPos-i<r;){let r=e.readU8();if("aac"===n){if(255!==r)continue;e.skip(-1);let n=e.currentPos,i=e.ensureBuffered(9);if(i instanceof Promise&&(i=await i),i<9)return;let a=e.readBytes(9),o=r2(nI.tempFromBytes(a));if(o){e.seekTo(n);let r=e.ensureBuffered(o.frameLength);return r instanceof Promise&&(r=await r),e.supplyPacket(r,Math.round(9216e4/t.info.sampleRate))}e.seekTo(n+1)}else if("mp3"===n){if(255!==r)continue;e.skip(-1);let n=e.currentPos,i=e.ensureBuffered(4);if(i instanceof Promise&&(i=await i),i<4)return;let a=rI(el(e.readBytes(4)).getUint32(0),null);if(a.header){e.seekTo(n);let r=e.ensureBuffered(a.header.totalSize);r instanceof Promise&&(r=await r);let i=9e4*a.header.audioSamplesInFrame/t.info.sampleRate;return e.supplyPacket(r,Math.round(i))}e.seekTo(n+1)}else if("ac3"===n){if(11!==r)continue;e.skip(-1);let n=e.currentPos,i=e.ensureBuffered(5);if(i instanceof Promise&&(i=await i),i<5)return;let a=e.readBytes(5);if(11!==a[0]||119!==a[1]){e.seekTo(n+1);continue}let o=a[4]>>6,l=63&a[4];if(3===o||l>37){e.seekTo(n+1);continue}let s=tG[3*l+o];et(void 0!==s),e.seekTo(n),(i=e.ensureBuffered(s))instanceof Promise&&(i=await i);let c=Math.round(13824e4/t.info.sampleRate);return e.supplyPacket(i,c)}else if("eac3"===n){if(11!==r)continue;e.skip(-1);let n=e.currentPos,i=e.ensureBuffered(5);if(i instanceof Promise&&(i=await i),i<5)return;let a=e.readBytes(5);if(11!==a[0]||119!==a[1]){e.seekTo(n+1);continue}let o=(((7&a[2])<<8|a[3])+1)*2,l=tq[3==a[4]>>6?3:a[4]>>4&3];e.seekTo(n),(i=e.ensureBuffered(o))instanceof Promise&&(i=await i);let s=Math.round(256*l*9e4/t.info.sampleRate);return e.supplyPacket(i,s)}else throw Error("Unhandled.")}if(r<128)break}}};class ip{constructor(e,t){this.currentPos=0,this.pesPackets=[],this.currentPesPacketIndex=0,this.currentPesPacketPos=0,this.endPos=0,this.nextPts=0,this.suppliedPacket=null,this.elementaryStream=e,this.pid=e.pid,this.demuxer=e.demuxer,this.startingPesPacket=t}clone(){let e=new ip(this.elementaryStream,this.startingPesPacket);return e.currentPos=this.currentPos,e.pesPackets=[...this.pesPackets],e.currentPesPacketIndex=this.currentPesPacketIndex,e.currentPesPacketPos=this.currentPesPacketPos,e.endPos=this.endPos,e.nextPts=this.nextPts,e}ensureBuffered(e){let t=this.endPos-this.currentPos;return t>=e?e:this.bufferData(e-t).then(()=>Math.min(this.endPos-this.currentPos,e))}getCurrentPesPacket(){let e=this.pesPackets[this.currentPesPacketIndex];return et(e),e}async bufferData(e){let t=this.endPos+e;for(;this.endPos<t;){let e;if(0===this.pesPackets.length)e=this.startingPesPacket;else{let t=er(this.pesPackets).sectionEndPos;for(et(null!==t);;){let n=await this.demuxer.readPacketHeader(t);if(!n)return;if(n.pid===this.pid){let n=await this.demuxer.readSection(t,!0);if(!n)return;let r=il(n);if(r){e=r;break}}t+=this.demuxer.packetStride}}this.pesPackets.push(e),this.endPos+=e.data.byteLength,1===this.pesPackets.length&&(this.nextPts=e.pts)}}readBytes(e){let t=this.getCurrentPesPacket(),n=this.currentPos-this.currentPesPacketPos,r=n+e;if(this.currentPos+=e,r<=t.data.byteLength)return t.data.subarray(n,r);let i=new Uint8Array(e);i.set(t.data.subarray(n));let a=t.data.byteLength-n;for(;;){this.advanceCurrentPacket();let t=this.getCurrentPesPacket(),n=e-a;if(n<=t.data.byteLength){i.set(t.data.subarray(0,n),a);break}i.set(t.data,a),a+=t.data.byteLength}return i}readU8(){let e=this.getCurrentPesPacket(),t=this.currentPos-this.currentPesPacketPos;return(this.currentPos++,t<e.data.byteLength)?e.data[t]:(this.advanceCurrentPacket(),(e=this.getCurrentPesPacket()).data[0])}seekTo(e){if(e!==this.currentPos){if(e<this.currentPos)for(;e<this.currentPesPacketPos;){this.currentPesPacketIndex--;let e=this.getCurrentPesPacket();this.currentPesPacketPos-=e.data.byteLength,this.nextPts=e.pts}else for(;;){let t=this.getCurrentPesPacket();if(e<this.currentPesPacketPos+t.data.byteLength)break;this.currentPesPacketPos+=t.data.byteLength,this.currentPesPacketIndex++,this.nextPts=this.getCurrentPesPacket().pts}this.currentPos=e}}skip(e){this.seekTo(this.currentPos+e)}advanceCurrentPacket(){this.currentPesPacketPos+=this.getCurrentPesPacket().data.byteLength,this.currentPesPacketIndex++,this.nextPts=this.getCurrentPesPacket().pts}supplyPacket(e,t){let n=this.getCurrentPesPacket();id(this.elementaryStream,n);let r=this.nextPts;this.nextPts+=t;let i=n.sectionStartPos,a=i+(this.currentPos-this.currentPesPacketPos),o=this.readBytes(e),l=n.randomAccessIndicator;et(this.elementaryStream.firstSection),n.sectionStartPos===this.elementaryStream.firstSection.startPos&&(l=1),this.suppliedPacket={pts:r,data:o,sequenceNumber:a,sectionStartPos:i,randomAccessIndicator:l},this.pesPackets.splice(0,this.currentPesPacketIndex),this.currentPesPacketIndex=0}}class im{constructor(e,t){this.decodeOrderPackets=[],this.reorderBuffer=[],this.presentationOrderPackets=[],this.reachedEnd=!1,this.lastDuration=0,this.backing=e,this.context=t,this.reorderSize=e.getReorderSize(),et(this.reorderSize>=0)}
69async readNext(){let e;if(0===this.decodeOrderPackets.length&&!await this.readNextPacket())return null;await this.ensureCurrentPacketHasNext();let t=this.decodeOrderPackets[0],n=this.presentationOrderPackets.indexOf(t);for(et(-1!==n),n===this.presentationOrderPackets.length-1?e=this.lastDuration:(e=this.presentationOrderPackets[n+1].pts-t.pts,this.lastDuration=e),this.decodeOrderPackets.shift();this.presentationOrderPackets.length>0;){let e=this.presentationOrderPackets[0];if(this.decodeOrderPackets.includes(e))break;this.presentationOrderPackets.shift()}return{packet:t,duration:e}}async readNextPacket(){let e;return!this.reachedEnd&&((this.context.suppliedPacket||await ih(this.context),e=this.context.suppliedPacket,this.context.suppliedPacket=null,e)?(this.decodeOrderPackets.push(e),this.processPacketThroughReorderBuffer(e),!0):(this.reachedEnd=!0,this.flushReorderBuffer(),!1))}async ensureCurrentPacketHasNext(){let e=this.decodeOrderPackets[0];for(et(e);;){let t=this.presentationOrderPackets.indexOf(e);if(-1!==t&&t<=this.presentationOrderPackets.length-2||!await this.readNextPacket())break}}processPacketThroughReorderBuffer(e){if(this.reorderBuffer.push(e),this.reorderBuffer.length>=this.reorderSize){let e=0;for(let t=1;t<this.reorderBuffer.length;t++)this.reorderBuffer[t].pts<this.reorderBuffer[e].pts&&(e=t);let t=this.reorderBuffer.splice(e,1)[0];this.presentationOrderPackets.push(t)}}flushReorderBuffer(){this.reorderBuffer.sort((e,t)=>e.pts-t.pts),this.presentationOrderPackets.push(...this.reorderBuffer),this.reorderBuffer.length=0}}class ig{}class iv extends ig{async _getMajorBrand(e){let t=e._reader.requestSlice(0,12);return(t instanceof Promise&&(t=await t),t)?(t.skip(4),"ftyp"!==nJ(t,4))?null:nJ(t,4):null}_createDemuxer(e){return new n8(e)}}class ib extends iv{async _canReadInput(e){let t=await this._getMajorBrand(e);return!!t&&"qt "!==t}get name(){return"MP4"}get mimeType(){return"video/mp4"}}class iy extends iv{async _canReadInput(e){return"qt "===await this._getMajorBrand(e)}get name(){return"QuickTime File Format"}get mimeType(){return"video/quicktime"}}class iw extends ig{async isSupportedEBMLOfDocType(e,t){let n=e._reader.requestSlice(0,16);if(n instanceof Promise&&(n=await n),!n)return!1;let r=rc(n);if(null===r||r<1||r>8||rd(n,r)!==g.EBML)return!1;let i=rp(n);if("number"!=typeof i)return!1;let a=e._reader.requestSlice(n.filePos,i);if(a instanceof Promise&&(a=await a),!a)return!1;let o=n.filePos;for(;a.filePos<=o+i-2;){let e=rm(a);if(!e)break;let{id:n,size:r}=e,i=a.filePos;if(void 0===r)return!1;switch(n){case g.EBMLVersion:case g.EBMLReadVersion:if(1!==rd(a,r))return!1;break;case g.DocType:if(rg(a,r)!==t)return!1;break;case g.DocTypeVersion:if(rd(a,r)>4)return!1}a.filePos=i+r}return!0}_canReadInput(e){return this.isSupportedEBMLOfDocType(e,"matroska")}_createDemuxer(e){return new rS(e)}get name(){return"Matroska"}get mimeType(){return"video/x-matroska"}}class ix extends iw{_canReadInput(e){return this.isSupportedEBMLOfDocType(e,"webm")}get name(){return"WebM"}get mimeType(){return"video/webm"}}class iC extends ig{async _canReadInput(e){let t=0;for(;;){let n=e._reader.requestSlice(t,10);if(n instanceof Promise&&(n=await n),!n)break;let r=rF(n);if(!r)break;t=n.filePos+r.size}let n=await rV(e._reader,t,t+4096);if(!n)return!1;let r=n.header,i=r_(r.mpegVersionId,r.channel),a=e._reader.requestSlice(n.startPos+i,4);if(a instanceof Promise&&(a=await a),!a)return!1;let o=nj(a);if(1483304551===o||1231971951===o)return!0;t=n.startPos+n.header.totalSize;let l=await rV(e._reader,t,t+4);if(!l)return!1;let s=l.header;return r.channel===s.channel&&r.sampleRate===s.sampleRate}_createDemuxer(e){return new rj(e)}get name(){return"MP3"}get mimeType(){return"audio/mpeg"}}class iE extends ig{async _canReadInput(e){let t=e._reader.requestSlice(0,12);if(t instanceof Promise&&(t=await t),!t)return!1;let n=nJ(t,4);return("RIFF"===n||"RIFX"===n||"RF64"===n)&&(t.skip(4),"WAVE"===nJ(t,4))}_createDemuxer(e){return new r0(e)}get name(){return"WAVE"}get mimeType(){return"audio/wav"}}class ik extends ig{async _canReadInput(e){let t=e._reader.requestSlice(0,4);return t instanceof Promise&&(t=await t),!!t&&"OggS"===nJ(t,4)}_createDemuxer(e){return new rY(e)}get name(){return"Ogg"}get mimeType(){return"application/ogg"}}
69class iS extends ig{async _canReadInput(e){let t=e._reader.requestSlice(0,4);return t instanceof Promise&&(t=await t),!!t&&"fLaC"===nJ(t,4)}get name(){return"FLAC"}get mimeType(){return"audio/flac"}_createDemuxer(e){return new it(e)}}class iT extends ig{async _canReadInput(e){let t=0;for(;;){let n=e._reader.requestSlice(t,10);if(n instanceof Promise&&(n=await n),!n)break;let r=rF(n);if(!r)break;t=n.filePos+r.size}let n=e._reader.requestSliceRange(t,7,9);if(n instanceof Promise&&(n=await n),!n)return!1;let r=r2(n);if(!r||(t+=r.frameLength,(n=e._reader.requestSliceRange(t,7,9))instanceof Promise&&(n=await n),!n))return!1;let i=r2(n);return!!i&&r.objectType===i.objectType&&r.samplingFrequencyIndex===i.samplingFrequencyIndex&&r.channelConfiguration===i.channelConfiguration}_createDemuxer(e){return new r4(e)}get name(){return"ADTS"}get mimeType(){return"audio/aac"}}class iP extends ig{async _canReadInput(e){let t=e._reader.requestSlice(0,205);if(t instanceof Promise&&(t=await t),!t)return!1;let n=nD(t,205);return 71===n[0]&&71===n[188]||71===n[0]&&71===n[204]||71===n[4]&&71===n[196]}_createDemuxer(e){return new ia(e)}get name(){return"MPEG Transport Stream"}get mimeType(){return"video/MP2T"}}let iM=new ib,iR=new iy,iA=new iw,iL=new ix,i_=new iC,iI=new iE,iO=new ik,iD=new iT,iz=[iM,iR,iA,iL,iI,iO,new iS,i_,iD,new iP];e1();class iN{get disposed(){return this._disposed}constructor(e){if(this._demuxerPromise=null,this._format=null,this._disposed=!1,!e||"object"!=typeof e)throw TypeError("options must be an object.");if(!Array.isArray(e.formats)||e.formats.some(e=>!(e instanceof ig)))throw TypeError("options.formats must be an array of InputFormat.");if(!(e.source instanceof iB))throw TypeError("options.source must be a Source.");if(e.source._disposed)throw Error("options.source must not be disposed.");this._formats=e.formats,this._source=e.source,this._reader=new n_(e.source)}_getDemuxer(){return this._demuxerPromise??=(async()=>{for(let e of(this._reader.fileSize=await this._source.getSizeOrNull(),this._formats))if(await e._canReadInput(this))return this._format=e,e._createDemuxer(this);throw Error("Input has an unsupported or unrecognizable format.")})()}get source(){return this._source}async getFormat(){return await this._getDemuxer(),et(this._format),this._format}async computeDuration(){return(await this._getDemuxer()).computeDuration()}async getFirstTimestamp(){let e=await this.getTracks();return 0===e.length?0:Math.min(...await Promise.all(e.map(e=>e.getFirstTimestamp())))}async getTracks(){return(await this._getDemuxer()).getTracks()}async getVideoTracks(){return(await this.getTracks()).filter(e=>e.isVideoTrack())}async getAudioTracks(){return(await this.getTracks()).filter(e=>e.isAudioTrack())}async getPrimaryVideoTrack(){return(await this.getTracks()).find(e=>e.isVideoTrack())??null}async getPrimaryAudioTrack(){return(await this.getTracks()).find(e=>e.isAudioTrack())??null}async getMimeType(){return(await this._getDemuxer()).getMimeType()}async getMetadataTags(){return(await this._getDemuxer()).getMetadataTags()}dispose(){this._disposed||(this._disposed=!0,this._source._disposed=!0,this._source._dispose())}[Symbol.dispose](){this.dispose()}}class iF extends Error{constructor(e="Input has been disposed."){super(e),this.name="InputDisposedError"}}class iB{constructor(){this._disposed=!1,this._sizePromise=null,this.onread=null}async getSizeOrNull(){if(this._disposed)throw new iF;return this._sizePromise??=Promise.resolve(this._retrieveSize())}async getSize(){if(this._disposed)throw new iF;
69let e=await this.getSizeOrNull();if(null===e)throw Error("Cannot determine the size of an unsized source.");return e}}class iH extends iB{constructor(e){if(!(e instanceof ArrayBuffer)&&!("undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)&&!ArrayBuffer.isView(e))throw TypeError("buffer must be an ArrayBuffer, SharedArrayBuffer, or ArrayBufferView.");super(),this._onreadCalled=!1,this._bytes=eo(e),this._view=el(e)}_retrieveSize(){return this._bytes.byteLength}_read(){return this._onreadCalled||(this.onread?.(0,this._bytes.byteLength),this._onreadCalled=!0),{bytes:this._bytes,view:this._view,offset:0}}_dispose(){}}let iV=(e,t,n)=>{if(t instanceof Error&&(t.message.includes("Failed to fetch")||t.message.includes("Load failed")||t.message.includes("NetworkError when attempting to fetch resource"))){let e=null;try{"undefined"!=typeof window&&void 0!==window.location&&(e=new URL(n instanceof Request?n.url:n,window.location.href).origin)}catch{}if(("undefined"==typeof navigator||"boolean"!=typeof navigator.onLine||navigator.onLine)&&null!==e&&e!==window.location.origin)return console.warn("Request will not be retried because a CORS error was suspected due to different origins. You can modify this behavior by providing your own function for the 'getRetryDelay' option."),null}return Math.min(2**(e-2),16)};class ij extends iB{constructor(e,t={}){if("string"!=typeof e&&!(e instanceof URL)&&!("undefined"!=typeof Request&&e instanceof Request))throw TypeError("url must be a string, URL or Request.");if(!t||"object"!=typeof t)throw TypeError("options must be an object.");if(void 0!==t.requestInit&&(!t.requestInit||"object"!=typeof t.requestInit))throw TypeError("options.requestInit, when provided, must be an object.");if(void 0!==t.getRetryDelay&&"function"!=typeof t.getRetryDelay)throw TypeError("options.getRetryDelay, when provided, must be a function.");if(void 0!==t.maxCacheSize&&(!e2(t.maxCacheSize)||t.maxCacheSize<0))throw TypeError("options.maxCacheSize, when provided, must be a non-negative number.");if(void 0!==t.parallelism&&(!Number.isInteger(t.parallelism)||t.parallelism<1))throw TypeError("options.parallelism, when provided, must be a positive number.");if(void 0!==t.fetchFn&&"function"!=typeof t.fetchFn)throw TypeError("options.fetchFn, when provided, must be a function.");super(),this._existingResponses=new WeakMap,this._url=e,this._options=t,this._getRetryDelay=t.getRetryDelay??iV,this._orchestrator=new iU({maxCacheSize:t.maxCacheSize??67108864,maxWorkerCount:t.parallelism??2,runWorker:this._runWorker.bind(this),prefetchProfile:i$.network})}async _retrieveSize(){let e,t;let n=new AbortController,r=await ej(this._options.fetchFn??fetch,this._url,eH(this._options.requestInit??{},{headers:{Range:"bytes=0-"},signal:n.signal}),this._getRetryDelay,()=>this._disposed);if(!r.ok)throw Error(`Error fetching ${String(this._url)}: ${r.status} ${r.statusText}`);if(206===r.status)t=this._getTotalLengthFromRangeResponse(r),e=this._orchestrator.createWorker(0,Math.min(t,524288));else{let n=r.headers.get("Content-Length");if(n)t=Number(n),e=this._orchestrator.createWorker(0,t),this._orchestrator.options.maxCacheSize=1/0,console.warn("HTTP server did not respond with 206 Partial Content, meaning the entire remote resource now has to be downloaded. For efficient media file streaming across a network, please make sure your server supports range requests.");else throw Error(`HTTP response (status ${r.status}) must surface Content-Length header.`)}return this._orchestrator.fileSize=t,this._existingResponses.set(e,{response:r,abortController:n}),this._orchestrator.runWorker(e),t}_read(e,t){return this._orchestrator.read(e,t)}async _runWorker(e){for(;;){let t=this._existingResponses.get(e);this._existingResponses.delete(e);let n=t?.abortController,r=t?.response;if(n||(n=new AbortController,r=await ej(this._options.fetchFn??fetch,this._url,eH(this._options.requestInit??{},{headers:{Range:`bytes=${e.currentPos}-`},signal:n.signal}),this._getRetryDelay,()=>this._disposed)),et(r),!r.ok)throw Error(`Error fetching ${String(this._url)}: ${r.status} ${r.statusText}`);if(e.currentPos>0&&206!==r.status)throw Error("HTTP server did not respond with 206 Partial Content to a range request. To enable efficient media file streaming across a network, please make sure your server supports range requests.");if(!r.body)throw Error("Missing HTTP response body stream. The used fetch function must provide the response body as a ReadableStream.");let i=r.body.getReader();for(;;){let t;if(e.currentPos>=e.targetPos||e.aborted){n.abort(),e.running=!1;return}try{t=await i.read()}catch(t){if(this._disposed)throw t;let e=this._getRetryDelay(1,t,this._url);if(null!==e){console.error("Error while reading response stream. Attempting to resume.",t),await new Promise(t=>setTimeout(t,1e3*e));break}throw t}if(e.aborted)continue;let{done:r,value:a}=t;if(r){if(e.currentPos>
69=e.targetPos){this._orchestrator.forgetWorker(e),e.running=!1;return}break}this.onread?.(e.currentPos,e.currentPos+a.length),this._orchestrator.supplyWorkerData(e,a)}}}_getTotalLengthFromRangeResponse(e){let t=e.headers.get("Content-Range");if(t){let e=/\/(\d+)/.exec(t);if(e)return Number(e[1])}let n=e.headers.get("Content-Length");if(n)return Number(n);throw Error("Partial HTTP response (status 206) must surface either Content-Range or Content-Length header.")}_dispose(){this._orchestrator.dispose()}}let i$={network:(e,t,n)=>{for(let r of(e=Math.max(0,65536*Math.floor((e-65536)/65536)),n))if(eQ(e,t,Math.max((r.startPos+r.targetPos)/2,r.targetPos-8388608),r.targetPos)){let e=r.targetPos-r.startPos,n=8388608*Math.ceil((e+1)/8388608),i=Math.min(2**Math.ceil(Math.log2(e+1)),n);t=Math.max(t,r.startPos+i)}return t=Math.max(t,e+524288),{start:e,end:t}}};class iU{constructor(e){this.options=e,this.fileSize=null,this.nextAge=0,this.workers=[],this.cache=[],this.currentCacheSize=0,this.disposed=!1}read(e,t){et(null!==this.fileSize);let n=this.options.prefetchProfile(e,t,this.workers),r=Math.max(n.start,0),i=Math.min(n.end,this.fileSize);et(r<=e&&t<=i);let a=null,o=ex(this.cache,e,e=>e.start),l=-1!==o?this.cache[o]:null;l&&l.start<=e&&t<=l.end&&(l.age=this.nextAge++,a={bytes:l.bytes,view:l.view,offset:l.start});let s=ex(this.cache,r,e=>e.start),c=a?null:new Uint8Array(t-e),u=0,d=r,h=[];if(-1!==s){for(let n=s;n<this.cache.length;n++){let a=this.cache[n];if(a.start>=i)break;if(a.end<=r)continue;let o=Math.max(r,a.start),l=Math.min(i,a.end);if(et(o<=l),d<o&&h.push({start:d,end:o}),d=l,c){let n=Math.max(e,a.start),r=Math.min(t,a.end);if(n<r){let t=n-e;c.set(a.bytes.subarray(n-a.start,r-a.start),t),t===u&&(u=r-e)}}a.age=this.nextAge++}d<i&&h.push({start:d,end:i})}else h.push({start:r,end:i});if(c&&u>=c.length&&(a={bytes:c,view:el(c),offset:e}),0===h.length)return et(a),a;let{promise:f,resolve:p,reject:m}=eE(),g=[];for(let n of h){let r=Math.max(e,n.start),i=Math.min(t,n.end);r===n.start&&i===n.end?g.push(n):r<i&&g.push({start:r,end:i})}for(let t of h){let n=c&&{start:e,bytes:c,holes:g,resolve:p,reject:m},r=!1;for(let e of this.workers)if(eQ(t.start-131072,t.start,e.currentPos,e.targetPos)){e.targetPos=Math.max(e.targetPos,t.end),r=!0,n&&!e.pendingSlices.includes(n)&&e.pendingSlices.push(n),e.running||this.runWorker(e);break}if(!r){let e=this.createWorker(t.start,t.end);n&&(e.pendingSlices=[n]),this.runWorker(e)}}return a||(et(c),a=f.then(t=>({bytes:t,view:el(t),offset:e}))),a}createWorker(e,t){let n={startPos:e,currentPos:e,targetPos:t,running:!1,aborted:this.disposed,pendingSlices:[],age:this.nextAge++};for(this.workers.push(n);this.workers.length>this.options.maxWorkerCount;){let e=0,t=this.workers[0];for(let n=1;n<this.workers.length;n++){let r=this.workers[n];r.age<t.age&&(e=n,t=r)}if(t.running&&t.pendingSlices.length>0)break;t.aborted=!0,this.workers.splice(e,1)}return n}runWorker(e){et(!e.running),et(e.currentPos<e.targetPos),e.running=!0,e.age=this.nextAge++,this.options.runWorker(e).catch(t=>{if(e.running=!1,e.pendingSlices.length>0)e.pendingSlices.forEach(e=>e.reject(t)),e.pendingSlices.length=0;else throw t})}supplyWorkerData(e,t){et(!e.aborted);let n=e.currentPos,r=n+t.length;this.insertIntoCache({start:n,end:r,bytes:t,view:el(t),age:this.nextAge++}),e.currentPos+=t.length,e.targetPos=Math.max(e.targetPos,e.currentPos);for(let i=0;i<e.pendingSlices.length;i++){let a=e.pendingSlices[i],o=Math.max(n,a.start),l=Math.min(r,a.start+a.bytes.length);o<l&&a.bytes.set(t.subarray(o-n,l-n),o-a.start);for(let e=0;e<a.holes.length;e++){let t=a.holes[e];n<=t.start&&r>t.start&&(t.start=r),t.end<=t.start&&(a.holes.splice(e,1),e--)}0===a.holes.length&&(a.resolve(a.bytes),e.pendingSlices.splice(i,1),i--)}for(let t=0;t<this.workers.length;t++){let i=this.workers[t];e!==i&&!i.running&&eQ(n,r,i.currentPos,i.targetPos)&&(this.workers.splice(t,1),t--)}}forgetWorker(e){let t=this.workers.indexOf(e);et(-1!==t),this.workers.splice(t,1)}insertIntoCache(e){if(0===this.options.maxCacheSize)return;let t=ex(this.cache,e.start,e=>e.start)+1;if(t>0){let n=this.cache[t-1];if(n.end>=e.end)return;if(n.end>e.start){let r=new Uint8Array(e.end-n.start);
69r.set(n.bytes,0),r.set(e.bytes,e.start-n.start),this.currentCacheSize+=e.end-n.end,n.bytes=r,n.view=el(r),n.end=e.end,t--,e=n}else this.cache.splice(t,0,e),this.currentCacheSize+=e.bytes.length}else this.cache.splice(t,0,e),this.currentCacheSize+=e.bytes.length;for(let n=t+1;n<this.cache.length;n++){let t=this.cache[n];if(e.end<=t.start)break;if(e.end>=t.end){this.cache.splice(n,1),this.currentCacheSize-=t.bytes.length,n--;continue}let r=new Uint8Array(t.end-e.start);r.set(e.bytes,0),r.set(t.bytes,t.start-e.start),this.currentCacheSize-=e.end-t.start,e.bytes=r,e.view=el(r),e.end=t.end,this.cache.splice(n,1);break}for(;this.currentCacheSize>this.options.maxCacheSize;){let e=0,t=this.cache[0];for(let n=1;n<this.cache.length;n++){let r=this.cache[n];r.age<t.age&&(e=n,t=r)}if(this.currentCacheSize-t.bytes.length<=this.options.maxCacheSize)break;this.cache.splice(e,1),this.currentCacheSize-=t.bytes.length}}dispose(){for(let e of this.workers)e.aborted=!0;this.workers.length=0,this.cache.length=0,this.disposed=!0}}let iW=(e,t,n)=>{let[r,i]=E.useState({input:null,videoSink:null,duration:0,isReady:!1,error:null});E.useRef(r).current=r;let a=E.useRef(0),o=E.useRef(null),l=E.useRef(null),s=E.useRef(null),c=E.useRef(null),u=E.useRef(null),d=E.useRef(null),h=E.useRef(!1),f=E.useRef(null),p=E.useRef([]),m=E.useRef(null),g=E.useRef(!1),[,v]=E.useReducer(e=>e+1,0);return E.useEffect(()=>{if(!n)return;let t=!0,r=++a.current,o=null;return(async()=>{try{if(!t||r!==a.current)return;o=(0,L.aM)(`mediabunny init ${e.id}`);let n=await async function(e){if(e.startsWith("data:")){let t=function(e){let t=e.indexOf(",");if(-1===t)throw Error("Invalid data URL format");let n=e.slice(t+1),r=atob(n),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);return i.buffer}(e);return new iH(t)}if(e.startsWith("file://"))try{let t=await fetch(e),n=await t.arrayBuffer();return new iH(n)}catch(t){throw Error(`Failed to load file URL: ${e}. File URLs may not be supported in this environment. Error: ${t}`)}return new ij(e)}(e.src);if(!t||r!==a.current)return void(o&&(o(),o=null));let l=new iN({source:n,formats:iz}),s=await l.computeDuration(),c=await l.getPrimaryVideoTrack();if(!c)throw Error("No video track found");if(null===c.codec)throw Error("Unsupported video codec");if(!await c.canDecode())throw Error("Unable to decode the video track");
69let u=await c.canBeTransparent(),d=new nk(c,{poolSize:5,fit:"contain",alpha:u});if(!t||r!==a.current)return l.dispose(),void(o&&(o(),o=null));o&&(o(),o=null),i(e=>Object.assign(Object.assign({},e),{input:l,videoSink:d,duration:s,isReady:!0,error:null}))}catch(n){if(console.error("Failed to initialize mediabunny:",n),o&&(o(),o=null),t&&r===a.current){let t=`Failed to initialize mediabunny for video ${e.id}: ${n}`;(0,L.TG)(t),i(e=>Object.assign(Object.assign({},e),{error:String(n),isReady:!1}))}}})(),()=>{t=!1,o&&(o(),o=null)}},[e.src,n]),E.useEffect(()=>()=>{l.current&&(l.current.return(),l.current=null),o.current&&(o.current(),o.current=null),s.current=null,c.current=null,u.current=null,h.current=!1,f.current=null,p.current=[],m.current=null,g.current=!1,i({input:null,videoSink:null,duration:0,isReady:!1,error:null})},[n]),E.useEffect(()=>{if(!n||!r.isReady||!r.videoSink)return;let i=++a.current,b="string"==typeof e.src?e.src.slice(0,120):String(e.src),y=(t,n={},i="debug")=>{let a="";try{a=JSON.stringify(Object.assign(Object.assign({},n),{timeCalc:d.current}))}catch(e){a=`[unserializable extras: ${String(e)}]`}let o=`mediabunny event=${t} elementId=${e.id} targetTime=${u.current} duration=${r.duration} lastFrameTimestamp=${c.current} hasIterator=${!!l.current} prefetchSize=${p.current.length} srcHint=${b} extras=${a}`;"error"===i?console.error(o):"warn"===i?console.warn(o):console.debug(o)},w=e=>{let t=r.duration||0;return t&&Number.isFinite(t)?Math.max(0,Math.min(e,t>.05?t-.05:t)):e},x=e=>{let t=r.duration||0;return!(!t||!Number.isFinite(t))&&t-e<=.050001000000000004},C=e=>{let t=s.current;t&&t.width===e.canvas.width&&t.height===e.canvas.height||(t||(t=document.createElement("canvas"),s.current=t),t.width=e.canvas.width,t.height=e.canvas.height);let n=t.getContext("2d");n&&(n.clearRect(0,0,t.width,t.height),n.drawImage(e.canvas,0,0)),c.current=e.timestamp},E=e=>{let t=l.current;t&&(g.current||(g.current=!0,m.current=(async()=>{try{for(;p.current.length<4&&e===a.current;){let n=await t.next();if(e!==a.current)return;if(n.done||!n.value)break;p.current.push({timestamp:n.value.timestamp,frame:n.value})}}catch(e){}finally{g.current=!1,m.current=null}})()))},k=e=>{let t=p.current;for(let n=0;n<t.length;n++)if(.05>Math.abs(t[n].timestamp-e)){let e=t[n];return p.current=t.slice(n+1),e}return null},T=()=>{p.current=[]},P=async(e,t,n=0)=>{let i=w(e),o=(e=>{let t=c.current;return null===t||e<t-.05||e>t+.5})(i)?"seek":"iterate";try{let n=r.videoSink,s=c.current;if(null!==s&&.05>Math.abs(s-i))return void(u.current=e);let d=k(i);if(d)return C(d.frame),u.current=e,E(t),void v();if(m.current){await m.current;let n=k(i);if(n)return C(n.frame),u.current=e,E(t),void v()}if(T(),"seek"===o){l.current&&(await l.current.return(),l.current=null);let r=n.canvases(i);l.current=r;let s=await r.next();if(t!==a.current)return void(l.current&&(await l.current.return(),l.current=null));if(s.done||!s.value){if(x(i)||y("iterator_exhausted",{mode:o,requestedTargetTime:e,clampedTargetTime:i},"warn"),t===a.current&&!x(i))try{l.current&&(await l.current.return(),l.current=null),T();let r=n.canvases(i);l.current=r;let a=await r.next();!a.done&&a.value&&(C(a.value),E(t),u.current=e,v())}catch(e){}return}C(s.value),E(t)}else{let r=l.current;if(!r)return;let s=!1;for(;t===a.current;){let c=await r.next();if(t!==a.current)break;if(c.done||!c.value){if(x(i)||y("iterator_exhausted",{mode:o,requestedTargetTime:e,clampedTargetTime:i},"warn"),!s&&!x(i)){s=!0;try{l.current&&(await l.current.return(),l.current=null),T();let e=n.canvases(i);l.current=e;let r=await e.next();if(t!==a.current||r.done||!r.value)break;C(r.value),E(t)}catch(e){}}break}let u=c.value;if(C(u),.05>Math.abs(u.timestamp-i)||u.timestamp>i){E(t);break}}}u.current=e,v()}catch(u){let r=u instanceof Error?{name:u.name,message:u.message,stack:u.stack}:{message:String(u)},a=u instanceof Error?`${u.name}: ${u.message}`:String(u),s=a.includes("Unsupported configuration")||a.includes("isConfigSupported")||a.includes("OperationError");if(y("frame_process_failed",{mode:o,requestedTargetTime:e,clampedTargetTime:i,unsupportedConfigAttempt:n,isUnsupportedConfig:s,error:r},"error"),s&&n<1)try{l.current&&(await l.current.return(),l.current=null),T(),m.current=null,g.current=!1,c.current=null,await P(e,t,n+1)}catch(e){}}},M=(0,S.EH)(()=>{let n=r.videoSink,l=r.duration;if(!n||!l)return;let s=e.startTime*l*1e3,c=l*(e.endTime-e.startTime)*1e3,u=((t.currentTime||e.page.startTime)-e.page.startTime)%c+s,p=u/1e3,m=w(p);d.current={pageStartTime:e.page.startTime,storeCurrentTime:t.currentTime,offsetMs:s,durationMs:c,restMs:u,targetTime:p,clampedTargetTime:m,startTime:e.startTime,endTime:e.endTime,videoDuration:l},h.current?f.current=m:(h.current=!0,o.current||(o.current=(0,L.aM)(`mediabunny video frame ${e.id}`)),(async()=>{let e=m;for(;null!==e&&i===a.current;)await P(e,i),e=f.current,f.current=null;o.current&&(o.current(),o.current=null),h.current=!1})())});return()=>{M(),a.current++,o.current&&(o.current(),o.current=null)}},[n,r.isReady,r.videoSink,r.duration,t,e]),n&&r.isReady?s.current:null};function iG(){return document.createElement("canvas")}let iq=new window.Image;iq.src=_.XP('\n <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path opacity="0.6" d="M4 5.49683V18.5032C4 20.05 5.68077 21.0113 7.01404 20.227L18.0694 13.7239C19.384 12.9506 19.384 11.0494 18.0694 10.2761L7.01404 3.77296C5.68077 2.98869 4 3.95 4 5.49683Z" fill="white"/>\n <path d="M4 5.49683V18.5032C4 20.05 5.68077 21.0113 7.01404 20.227L18.0694 13.7239C19.384 12.9506 19.384 11.0494 18.0694 10.2761L7.01404 3.77296C5.68077 2.98869 4 3.95 4 5.49683Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n');let iZ=new window.Image;iZ.src=_.XP('\n <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path opacity="0.6" d="M14 19L14 5C14 3.89543 14.8954 3 16 3L17 3C18.1046 3 19 3.89543 19 5L19 19C19 20.1046 18.1046 21 17 21L16 21C14.8954 21 14 20.1046 14 19Z" fill="white"/>\n <path opacity="0.6" d="M10 19L10 5C10 3.89543 9.10457 3 8 3L7 3C5.89543 3 5 3.89543 5 5L5 19C5 20.1046 5.89543 21 7 21L8 21C9.10457 21 10 20.1046 10 19Z" fill="white"/>\n <path d="M14 19L14 5C14 3.89543 14.8954 3 16 3L17 3C18.1046 3 19 3.89543 19 5L19 19C19 20.1046 18.1046 21 17 21L16 21C14.8954 21 14 20.1046 14 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M10 19L10 5C10 3.89543 9.10457 3 8 3L7 3C5.89543 3 5 3.89543 5 5L5 19C5 20.1046 5.89543 21 7 21L8 21C9.10457 21 10 20.1046 10 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n');let iX=(e,t,n,r,i=0,a=!1)=>{let o=Math.floor(Math.max(e.width*r,1)),l=Math.floor(Math.max(e.height*r,1)),s=Math.min(i*r,o/2,l/2),c=Math.max(e.width/n.width,e.height/n.height)*r,u=e.page._exportingOrRendering&&I.flags.imageDownScalingEnabled&&c<1&&!a,d=t instanceof HTMLVideoElement?t.videoWidth:null==t?void 0:t.width,h=t instanceof HTMLVideoElement?t.videoHeight:null==t?void 0:t.height,f=0===n.x&&0===n.y&&n.width===d&&n.height===h,p=E.useMemo(()=>
69{if(t&&d&&h)return f&&0===s&&!u?void 0:iG()},[t,s,u,f,d,h]),m=()=>{if(!p||!t)return;p.width=o,p.height=l;let e=p.getContext("2d");if(!e)return;s&&(e.beginPath(),e.moveTo(s,0),e.lineTo(o-s,0),e.arc(o-s,s,s,3*Math.PI/2,0,!1),e.lineTo(o,l-s),e.arc(o-s,l-s,s,0,Math.PI/2,!1),e.lineTo(s,l),e.arc(s,l-s,s,Math.PI/2,Math.PI,!1),e.lineTo(0,s),e.arc(s,s,s,Math.PI,3*Math.PI/2,!1),e.clip());let r=u?function(e,t){var n,r;let i=iG(),a=e instanceof HTMLVideoElement?e.videoWidth:e.width,o=e instanceof HTMLVideoElement?e.videoHeight:e.height;i.width=a,i.height=o,null===(n=i.getContext("2d"))||void 0===n||n.drawImage(e,0,0,i.width,i.height);let l=function(e,t,n,r,i,a,o){for(var l=new ImageData(t,n),s=new Int32Array(e.data.buffer),c=e.width,u=new Int32Array(l.data.buffer),d=l.width,h=t/a,f=n/o,p=Math.round(1/h),m=Math.round(1/f),g=p*m,v=0;v<l.height;v++)for(var b=0;b<d;b++){for(var y=0+Math.round(b/h)+(0+Math.round(v/f))*c,w=0,x=0,C=0,E=0,k=0;k<m;k++)for(var S=0;S<p;S++){var T=s[y+S+k*c];w+=T<<24>>>24,x+=T<<16>>>24,C+=T<<8>>>24,E+=T>>>24}w=Math.round(w/g),x=Math.round(x/g),C=Math.round(C/g),E=Math.round(E/g),u[b+v*d]=E<<24|C<<16|x<<8|w}return l}(i.getContext("2d").getImageData(0,0,i.width,i.height),Math.floor(i.width*t),Math.floor(i.height*t),0,0,i.width,i.height);return i.width=Math.floor(i.width*t),i.height=Math.floor(i.height*t),null===(r=i.getContext("2d"))||void 0===r||r.putImageData(l,0,0),i}(t,c):t,i=u?{x:Math.floor(n.x*c),y:Math.floor(n.y*c),width:Math.floor(n.width*c),height:Math.floor(n.height*c)}:n;e.drawImage(r,i.x,i.y,i.width,i.height,0,0,p.width,p.height)};return E.useLayoutEffect(()=>{m()},[p,e.width,e.height,n.x,n.y,n.width,n.height,i,r,a,e.page._exportingOrRendering,u]),E.useEffect(()=>()=>{p&&"CANVAS"===p.nodeName&&M.Z.Util.releaseCanvas(p)},[p]),[p||t,m]},iY=iG(),iK=(0,k.Pi)(({element:e})=>{let t=Math.min(30,e.width/4,e.height/4),n=E.useRef(null);return E.useEffect(()=>{let e=n.current;if(!e)return;let t=new M.Z.Animation(t=>{e.rotate(((null==t?void 0:t.timeDiff)||0)/2)},e.getLayer());return t.start(),()=>{t.stop()}}),E.createElement(T.ZA,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},E.createElement(T.UL,{width:e.width,height:e.height,fill:"rgba(124, 173, 212, 0.8)"}),E.createElement(T.wN,{ref:n,x:e.width/2,y:e.height/2,fill:"white",outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270}))}),iJ=(0,k.Pi)(({element:e})=>{let t=Math.max(10,Math.min(30,e.width/25));return E.createElement(T.ZA,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},E.createElement(T.UL,{width:e.width,height:e.height,fill:"rgba(223, 102, 102, 0.8)"}),E.createElement(T.xv,{text:"Can not load the video...",fontSize:t,width:e.width,height:e.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))}),iQ=function(e,t,n){let r=E.useRef("loading"),i=E.useRef(void 0),[a,o]=E.useState(0),l=E.useRef(),s=E.useRef(),c=E.useRef();return l.current===e&&s.current===t&&c.current===n||(r.current="loading",i.current=void 0,l.current=e,s.current=t,c.current=n),E.useLayoutEffect(function(){if(e){var a=document.createElement("video");return a.addEventListener("canplay",l),a.addEventListener("error",s),t&&(a.crossOrigin=t),n&&(a.referrerPolicy=n),a.src=e,a.load(),function(){a.removeEventListener("canplay",l),a.removeEventListener("error",s)}}function l(){r.current="loaded",i.current=a,i.current.currentTime=0,o(Math.random()),i.current.removeEventListener("canplay",l)}function s(e){var t;let n=4===a.readyState,l=a.buffered&&a.buffered.length>0&&a.buffered.end(a.buffered.length-1)/a.duration*100>=100;n&&l||(console.error(Error("Video failed to load: "+(e.message||(null===(t=a.error)||void 0===t?void 0:t.message)||"Unknown error"))),r.current="failed",i.current=void 0,o(Math.random()))}},[e,t,n]),[i.current,r.current]};function i0(e){return e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA}let i1=(e,t,n)=>{let r=E.useRef(),i=()=>{var e;null===(e=r.current)||void 0===e||e.call(r),r.current=void 0};E.useEffect(()=>i,[]),E.useLayoutEffect(()=>{let a=t.slice(0,200),o=`video with id ${n} url: ${a}`;"loading"!==e||r.current||(r.current=(0,L.aM)(o)),"loading"!==e&&i(),"failed"===e&&(0,L.TG)(o)},[e])},i2=(0,k.Pi)(({element:e,store:t})=>{var n;let r,i;let[a,o]=E.useState(!1),l=E.useRef(null),s=E.useRef(null),c=t.selectedShapes.indexOf(e)>=0&&e.selectable,[u,d]=E.useState(!1),[h,f]=iQ(e.src,"anonymous"),[p,m]=E.useState(!1),g=t.activePage===e.page,v=e.page._exportingOrRendering&&"loaded"===f,b=iW(e,t,v);
69i1(f,e.src,e.id),h&&(h.playsInline=!0);let y=((e,t,n)=>{let r=E.useMemo(()=>{var r,i;let{flipX:a,flipY:o}=e,l="svg"===e.type||e.src.indexOf("data:image/svg+xml")>=0||e.src.indexOf(".svg")>=0,s=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;if(!(a||o||s&&l))return t;if(!t)return null;let c=t instanceof HTMLVideoElement?t.videoWidth:null==t?void 0:t.width,u=t instanceof HTMLVideoElement?t.videoHeight:null==t?void 0:t.height;if(!c||!u)return null;let d=iG(),h=1;"svg"===e.type&&(h=Math.max(e.width/c*n,e.height/u*n)),d.width=Math.max(c*h,1),d.height=Math.max(u*h,1);let f=a?-d.width:0,p=o?-d.height:0;return null===(r=d.getContext("2d"))||void 0===r||r.scale(a?-1:1,o?-1:1),null===(i=d.getContext("2d"))||void 0===i||i.drawImage(t,f,p,d.width,d.height),d},[e.flipX,e.flipY,t,e.width,e.height,n]);return E.useEffect(()=>()=>{r&&"CANVAS"===r.nodeName&&M.Z.Util.releaseCanvas(r)},[r]),r})(e,h,t._elementsPixelRatio),w=v&&b||y||iY;E.useEffect(()=>{h&&t.history.ignore(()=>{e.set({duration:1e3*h.duration})})},[h]),E.useEffect(()=>{var n;if(!h)return;let r=t.animatedElementsIds,i=(!r.length||r.includes(e.id))&&t.isPlaying,a=g&&(i||u);if(!a)return void h.pause();a&&(h.currentTime=e.startTime*h.duration,h.play());let o=new M.Z.Animation(()=>{K.current()},null===(n=l.current)||void 0===n?void 0:n.getLayer());o.start();let s=()=>{d(!1),h.currentTime=e.startTime*h.duration},c=()=>{h.currentTime>=e.endTime*h.duration&&(h.pause(),h.currentTime=e.startTime*h.duration,d(!1))};return h.addEventListener("ended",s),h.addEventListener("timeupdate",c),()=>{h.pause(),o.stop(),h.removeEventListener("ended",s),h.removeEventListener("timeupdate",c)}},[h,u,t.isPlaying,g]),E.useEffect(()=>{h&&(h.volume=e.volume)},[h,e.volume]);let x=E.useRef(null);E.useEffect(()=>{let n=(0,S.EH)(()=>{var n,r;if(h){if(v&&b)return Y(),void t.currentTime;let i=t.animatedElementsIds;if(i.length&&!i.includes(e.id))return;let a=t.currentTime>=e.page.startTime&&t.currentTime<e.page.startTime+e.page.duration,o=e.startTime*h.duration*1e3,s=h.duration*(e.endTime-e.startTime)*1e3,c=((t.currentTime||e.page.startTime)-e.page.startTime)%s+o;if(a||(c=0),Math.abs(1e3*h.currentTime-c)>500||!t.isPlaying){let n=c/1e3;n!==h.currentTime&&(h.currentTime=n),i0(h)||t.isPlaying||x.current||(x.current=(0,L.aM)(`video ${e.id}`))}K.current(),null===(r=null===(n=l.current)||void 0===n?void 0:n.getLayer())||void 0===r||r.batchDraw()}});return()=>{n(),x.current&&(x.current(),x.current=null)}},[t,h,v,b]),E.useEffect(()=>{var t;let n;if(!h)return;if(v)return null===(t=x.current)||void 0===t||t.call(x),void(x.current=null);let r=()=>{var t,n;!i0(h)&&e.page._exportingOrRendering||x.current&&(K.current(),null===(n=null===(t=l.current)||void 0===t?void 0:t.getLayer())||void 0===n||n.batchDraw(),x.current(),x.current=null)};return e.page._exportingOrRendering&&(n=setInterval(r,20)),h.addEventListener("timeupdate",r),h.addEventListener("canplay",r),()=>{clearInterval(n),h.removeEventListener("timeupdate",r),h.removeEventListener("canplay",r)}},[e.page._exportingOrRendering,h,e.id,L.aM,v]);let{cropX:C,cropY:k,cropWidth:R,cropHeight:I}=e;"loaded"!==f&&(C=k=0,R=I=1);let O=w instanceof HTMLVideoElement?w.videoWidth:(null==w?void 0:w.width)||0,F=w instanceof HTMLVideoElement?w.videoHeight:(null==w?void 0:w.height)||0,B=O*R,H=F*I,V=e.width/e.height,j=B/H,$="svg"===e.type;$?(r=B,i=H):V>=j?(r=B,i=B/V):(r=H*V,i=H);let U={x:O*C,y:F*k,width:r,height:i},W=null!==(n=e.cornerRadius)&&void 0!==n?n:0,[G,q]=iX(e,w,U,t._elementsPixelRatio,W,!0),[Z,X]=((e,t,n,r)=>{let[i,a]=P((e=>{let[t,n]=E.useState(e);return E.useEffect(()=>{(async()=>{let r=await async function(e){if(!(e.indexOf("data:image/svg+xml")>=0||e.indexOf(".svg")>=0))return e;let t=await _.uh(e),n=_.tS(t);return _.XP(n)}(e);r!==t&&n(r)})()},[e]),t})(e.clipSrc||""),"anonymous");i1(e.clipSrc?a:"loaded",e.clipSrc,e.id);let o=E.useMemo(()=>{if(t&&i)return iG()},[t,i]);function l(){var r;if(!i)return;let a=t instanceof HTMLVideoElement?t.videoWidth:null==t?void 0:t.width,l=t instanceof HTMLVideoElement?t.videoHeight:null==t?void 0:t.height;if(!t||!a||!l||!i||!i.width||!i.height||!o)return;let s=iG(),c=Math.max(e.width/i.width*n,e.height/i.height*n);s.width=i.width*c,s.height=i.height*c,null===(r=s.getContext("2d"))||void 0===r||r.drawImage(i,0,0,s.width,s.height),o.width=Math.max(a,1),o.height=Math.max(l,1);let u=o.getContext("2d");
69u&&(u.save(),u.drawImage(s,0,0,a,l),M.Z.Util.releaseCanvas(s),u.globalCompositeOperation="source-in",u.drawImage(t,0,0,o.width,o.height),u.restore())}return E.useLayoutEffect(()=>{l()},[o,t,i,e.width,e.height,n,...r]),[e.clipSrc&&i?o:t,l]})(e,G,t._elementsPixelRatio,[U,W,t._elementsPixelRatio]);function Y(){var e,t;q(),X(),null===(t=null===(e=l.current)||void 0===e?void 0:e.getLayer())||void 0===t||t.batchDraw()}E.useEffect(()=>{Y()});let K=E.useRef(Y);K.current=Y;let J=Math.max(e.width/r,e.height/i);E.useEffect(()=>{var t;if(!e._cropModeEnabled)return;let n=null===(t=l.current)||void 0===t?void 0:t.getStage();function r(t){e._cropModeEnabled&&t.target!==s.current&&e.toggleCropMode(!1)}function i(t){e._cropModeEnabled&&t.target.parentNode!==(null==n?void 0:n.content)&&e.toggleCropMode(!1)}return document.body.addEventListener("click",i),null==n||n.on("click",r),null==n||n.on("tap",r),()=>{document.body.removeEventListener("click",i),document.body.removeEventListener("touchstart",i),null==n||n.off("click",r),null==n||n.off("click",r)}},[e._cropModeEnabled]),E.useLayoutEffect(()=>{if(!a&&!e._cropModeEnabled)return(0,D.R)(l.current,e),(0,S.EH)(()=>{(0,D.R)(l.current,e)},{delay:100})},[w,a,R,I,e._cropModeEnabled]),E.useLayoutEffect(()=>{var t;a||e._cropModeEnabled?null===(t=l.current)||void 0===t||t.clearCache():(0,D.R)(l.current,e)},[a,e.width,e.height,e._cropModeEnabled]),E.useEffect(()=>{(0,D.R)(l.current,e)},[e.shadowEnabled,e.shadowBlur,e.cornerRadius,e.shadowColor,e.shadowOffsetX,e.shadowOffsetY,e.shadowOpacity]);let Q=E.useRef(null),ee=E.useRef(null),et=E.useRef(null);E.useLayoutEffect(()=>{e._cropModeEnabled&&(ee.current.nodes([Q.current]),et.current.nodes([s.current]))},[e._cropModeEnabled]);let en=t=>{Math.round(t.target.x())>0&&(t.target.x(0),t.target.scaleX(1)),Math.round(t.target.y())>0&&(t.target.y(0),t.target.scaleY(1));let n=t.target.width()*t.target.scaleX(),a=t.target.height()*t.target.scaleY(),o=Math.min(1,r/n),l=Math.min(1,i/a),s=Math.min(1-o,Math.max(0,Math.round(-t.target.x())/n)),c=Math.min(1-l,Math.max(0,Math.round(-t.target.y())/a));t.target.setAttrs({x:-s*O,y:-c*F,scaleX:1,scaleY:1}),e.set({cropX:s,cropY:c,cropWidth:o,cropHeight:l})},er=()=>{"svg"!==e.type&&e.contentEditable&&setTimeout(()=>{e.toggleCropMode(!0)})},ei="loading"===f,ea="failed"===f,eo=!ei&&!ea,el=E.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),es=eo?e.a.opacity:0;(0,z.QU)(l,es);let ec=e.selectable||"admin"===t.role,eu=(0,N.b1)();return E.createElement(E.Fragment,null,E.createElement(T.ZA,{onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1)},ei&&E.createElement(iK,{element:e}),ea&&E.createElement(iJ,{element:e}),E.createElement(T.Ee,{ref:l,name:"element",id:e.id,image:Z,x:e.a.x,y:e.a.y,width:e.a.width||1,height:e.a.height||1,rotation:e.a.rotation,opacity:es,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:U,listening:ec,draggable:eu?e.draggable&&c:e.draggable,preventDefault:!eu||c,hideInExport:!e.showInExport,onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDblClick:er,onDblTap:er,onTransformStart:()=>{o(!0),el.current={cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight}},onTransform:t=>{var n;let a=t.currentTarget,o=1e-7>Math.abs(a.scaleX()-1)?1:a.scaleX(),l=1e-7>Math.abs(a.scaleY()-1)?1:a.scaleY();a.scaleX(1),a.scaleY(1);let s=null===(n=t.target.getStage())||void 0===n?void 0:n.findOne("Transformer"),c=Math.min(1-r/O,Math.max(0,e.cropX)),u=Math.min(1-i/F,Math.max(0,e.cropY)),d=s.getActiveAnchor(),h=!(d.indexOf("middle")>=0||d.indexOf("center")>=0),f=!h&&o<1&&el.current.cropHeight>i/F,p=h?e.cropWidth:e.cropWidth*o;f&&(p=e.cropWidth);let m=!h&&l<1&&el.current.cropWidth>r/O,g=h?e.cropHeight:e.cropHeight*l;m&&(g=e.cropHeight),$&&(p=e.cropWidth,g=e.cropHeight),e.set({cropX:c,cropY:u,x:a.x(),y:a.y(),width:a.width()*o,height:a.height()*l,rotation:t.target.rotation(),cropWidth:Math.min(p,1-c),cropHeight:Math.min(g,1-u)})},onTransformEnd:t=>{let n=t.currentTarget;e.set({width:n.width(),height:n.height(),x:n.x(),y:n.y(),rotation:t.target.rotation(),cropWidth:r/O,cropHeight:i/F}),o(!1)}}),E.createElement(T.UL,{x:e.a.x,y:e.a.y,width:Math.max(e.a.width-e.borderSize,0),height:Math.max(e.a.height-e.borderSize,0),opacity:es,offsetX:-e.borderSize/2,offsetY:-e.borderSize/2,stroke:e.borderColor,strokeWidth:e.borderSize,listening:!1,visible:!!e.borderSize,rotation:e.rotation,cornerRadius:Math.max(0,W-e.borderSize),hideInExport:!e.showInExport}),!t.isPlaying&&E.createElement(T.Ee,{image:u?p||eu?iZ:void 0:iq,x:e.a.x,y:e.a.y,offsetX:-e.a.width/2+15/t.scale,offsetY:-e.a.height/2+15/t.scale,rotation:e.a.rotation,width:30/t.scale,height:30/t.scale,hideInExport:!0,onClick:()=>d(!u),onTap:()=>d(!u)}),e._cropModeEnabled&&E.createElement(A.h_,{selector:".page-abs-container",enabled:!0},E.createElement(T.UL,{x:-window.innerWidth/t.scale,y:-window.innerWidth/t.scale,width:window.innerWidth/t.scale*3,height:window.innerWidth/t.scale*3,fill:"rgba(0,0,0,0.3)"}),E.createElement(T.Ee,{listening:!1,image:Z,x:e.a.x,y:e.a.y,width:e.a.width,height:e.a.height,rotation:e.a.rotation,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur}),E.createElement(T.ZA,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,scaleX:J,scaleY:J},E.createElement(T.Ee,{image:w,ref:s,width:O,height:F,opacity:.4,draggable:!0,x:-e.cropX*O,y:-e.cropY*F,onDragMove:en,onTransform:en}),E.createElement(T.$T,{ref:et,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(e,t)=>
69t.width<5||t.height<5?e:t,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),E.createElement(T.UL,{width:r,height:i,ref:Q,listening:!1,onTransform:t=>{t.target.x()<-e.cropX*O-1e-9&&(t.target.x(-e.cropX*O),t.target.scaleX(1)),t.target.y()<-e.cropY*F-1e-9&&(t.target.y(-e.cropY*F),t.target.scaleY(1));let n=Math.min(1,Math.max(0,e.cropX+t.target.x()/O)),r=Math.min(1,Math.max(0,t.target.y()/F+e.cropY)),i=t.target.width()*t.target.scaleX(),a=t.target.height()*t.target.scaleY(),o=t.target.getAbsolutePosition(t.target.getParent().getParent());t.target.scale({x:1,y:1}),t.target.position({x:0,y:0}),e.set({x:o.x,y:o.y,cropX:n,cropY:r,cropWidth:Math.min(1-n,i/O),cropHeight:Math.min(1-r,a/F),width:Math.min(i*J,O*(1-n)*J),height:Math.min(a*J,F*(1-r)*J)})}}),E.createElement(T.$T,{ref:ee,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(e,t)=>t.width<5||t.height<5?e:t,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2,visible:e.resizable})))))});var i4=n(11903);let i3={},i8=(0,k.Pi)(({element:e,store:t})=>{var n,r;let i=E.useRef(null),a=e.selectable||"admin"===t.role,o=(0,N.b1)(),l=t.selectedShapes.indexOf(e)>=0&&e.selectable,s=Math.min(e.strokeWidth,e.width/2,e.height/2),c=Math.max(0,Math.min(e.width/2,e.height/2,e.cornerRadius)),u=(0,B.r)(e,e.a.fill,"fill"),d=Object.assign(Object.assign({width:e.a.width,height:e.a.height},u),{cornerRadius:c,opacity:e.animated("opacity"),shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,preventDefault:!o||l,hideInExport:!e.showInExport}),h=(0,B.r)(e,e.stroke,"stroke"),f=Object.assign(Object.assign({visible:s>0,x:s/2,y:s/2,width:e.a.width-s,height:e.a.height-s},h),{strokeWidth:s,cornerRadius:Math.max(0,c-s),dash:e.dash.map(e=>e*s),opacity:e.animated("opacity"),hideInExport:!e.showInExport,listening:!1}),p=(i3[n=e.subType]||(i3[n]=(r=(0,i4.GL)(n),(0,k.Pi)(({element:e,fillProps:t,strokeProps:n})=>{let i=r({width:e.a.width,height:e.a.height,cornerRadius:e.cornerRadius}),a=1,o=1;"string"!=typeof i&&(a=i.scaleX,o=i.scaleY,i=i.path);let l=E.useRef(null);return E.createElement(E.Fragment,null,E.createElement(T.UL,{width:e.width,height:e.height,fill:"transparent"}),E.createElement(T.y$,Object.assign({},t,{ref:l,data:i,scaleX:a,scaleY:o})),E.createElement(T.ZA,{clipFunc:e=>{let t=l.current;if(t){var n=t.dataArray;e.beginPath();for(var r=0;r<n.length;r++){var i=n[r].command,a=n[r].points;switch(i){case"L":e.lineTo(a[0],a[1]);break;case"M":e.moveTo(a[0],a[1]);break;case"C":e.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"Q":e.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case"A":var o=a[0],s=a[1],c=a[2],u=a[3],d=a[4],h=a[5],f=a[6],p=a[7],m=c>u?c:u,g=c>u?1:c/u,v=c>u?u/c:1;e.translate(o,s),e.rotate(f),e.scale(g,v),e.arc(0,0,m,d,d+h,!p),e.scale(1/g,1/v),e.rotate(-f),e.translate(-o,-s);break;case"z":e.closePath()}}}},scaleX:a,scaleY:o},E.createElement(T.y$,Object.assign({},n,{x:0,y:0,data:i,strokeWidth:2*n.strokeWidth,dash:n.dash.map(e=>e)}))))}))),i3[n]||T.ZA);return E.createElement(E.Fragment,null,E.createElement(T.ZA,{ref:i,id:e.id,x:e.a.x,y:e.a.y,rotation:e.a.rotation,opacity:e.a.opacity,listening:a,draggable:o?e.draggable&&l:e.draggable,name:"element",onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},onTransform:t=>{let n=t.target.scale();t.target.scaleX(1),t.target.scaleY(1),e.set({width:e.width*n.x,height:e.height*n.y,x:t.target.x(),y:t.target.y(),rotation:t.target.rotation()})}},E.createElement(p,{element:e,fillProps:d,strokeProps:f})))});var i6=n(73014);function i5(e,t,n){let r=t.getContext("2d"),i=n.getContext("2d");if(!r||!i)return;2===e.disposalType&&r.clearRect(0,0,t.width,t.height),n.width=e.width,n.height=e.height;let a=i.createImageData(e.width,e.height);a.data.set(e.patch),i.putImageData(a,0,0),r.drawImage(n,e.left,e.top)}let i9=(0,k.Pi)(({element:e})=>{let t=Math.min(30,e.width/4,e.height/4),n=E.useRef(null);return E.useEffect(()=>{let e=n.current;if(!e)return;let t=new M.Z.Animation(t=>
69{e.rotate(((null==t?void 0:t.timeDiff)||0)/2)},e.getLayer());return t.start(),()=>{t.stop()}},[]),E.createElement(T.ZA,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},E.createElement(T.UL,{width:e.width,height:e.height,fill:"rgba(124, 173, 212, 0.8)"}),E.createElement(T.wN,{ref:n,x:e.width/2,y:e.height/2,fill:"white",outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270}))}),i7=(0,k.Pi)(({element:e})=>{let t=Math.max(10,Math.min(30,e.width/22));return E.createElement(T.ZA,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},E.createElement(T.UL,{width:e.width,height:e.height,fill:"rgba(223, 102, 102, 0.8)"}),E.createElement(T.xv,{text:"Cannot load the GIF...",fontSize:t,width:e.width,height:e.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))}),ae=(0,k.Pi)(({element:e,store:t})=>{var n;let[r,i]=E.useState(!1),a=t.selectedShapes.indexOf(e)>=0&&e.selectable,o=E.useRef(null),l=E.useRef(),[s,c,u,d]=function(e){let[t,n]=E.useState([]),[r,i]=E.useState(0),[a,o]=E.useState("loading"),[l,s]=E.useState({width:0,height:0});return E.useEffect(()=>{(async()=>{try{let t=await fetch(e),r=await t.arrayBuffer(),a=(0,i6.vq)(r),l=(0,i6.zw)(a,!0),c=a.lsd.width,u=a.lsd.height;s({width:c,height:u});let d=l.map(e=>({patch:new Uint8ClampedArray(e.patch),delay:e.delay,width:e.dims.width,height:e.dims.height,left:e.dims.left,top:e.dims.top,disposalType:e.disposalType})),h=d.reduce((e,t)=>e+t.delay,0);n(d),i(h),o("loaded")}catch(e){console.error("Failed to load GIF:",e),o("failed")}})()},[e]),[t,r,l,a]}(e.src);K(d,e.src,e.id),E.useEffect(()=>(l.current=document.createElement("canvas"),()=>{l.current&&M.Z.Util.releaseCanvas(l.current)}),[]),E.useEffect(()=>{if("loaded"===d&&l.current&&(l.current.width=u.width,l.current.height=u.height,s.length>0)){let e=l.current.getContext("2d");if(e){e.clearRect(0,0,u.width,u.height);let t=document.createElement("canvas");i5(s[0],l.current,t)}}},[u,d,s]),E.useEffect(()=>{if(!s.length||!l.current)return;let n=l.current;n.width=u.width,n.height=u.height;let r=document.createElement("canvas"),i=n.getContext("2d");i&&i.clearRect(0,0,n.width,n.height);let a=-1;i5(s[0],n,r),y(),a=0;let d=e=>{let t=(e=>{let t=e%c,n=0;for(let e=0;e<s.length;e++)if((n+=s[e].delay)>t)return e;return 0})(e);t!==a&&(i5(s[t],n,r),y(),o.current.getLayer().draw(),a=t)};if(t.isPlaying||e.page._exportingOrRendering)return(0,S.EH)(()=>{d(t.currentTime-e.page.startTime)});{let e=window.setInterval(()=>{d(t.currentTime||performance.now())},16);return()=>{clearInterval(e)}}},[t.isPlaying,s,c,e.page._exportingOrRendering]),E.useEffect(()=>{c&&t.history.ignore(()=>{e.set({duration:c})})},[c]);let{cropX:h,cropY:f,cropWidth:p,cropHeight:m}=e;"loaded"!==d&&(h=f=0,p=m=1);let g={x:u.width*h,y:u.height*f,width:u.width*p,height:u.height*m},v=null!==(n=e.cornerRadius)&&void 0!==n?n:0,[b,y]=iX(e,l.current,g,t._elementsPixelRatio,v,r||e._cropModeEnabled);E.useLayoutEffect(()=>{if(!r&&!e._cropModeEnabled&&o.current)return(0,D.R)(o.current,e),(0,S.EH)(()=>{(0,D.R)(o.current,e)},{delay:100})},[l.current,r,p,m,e._cropModeEnabled,u.width,u.height]);let w="loading"===d,x="failed"===d,C=w||x?0:e.a.opacity;(0,z.QU)(o,C);let k=e.selectable||"admin"===t.role,P=(0,N.b1)();return E.createElement(E.Fragment,null,w&&E.createElement(i9,{element:e}),x&&E.createElement(i7,{element:e}),E.createElement(T.Ee,{ref:o,name:"element",id:e.id,image:b,x:e.a.x,y:e.a.y,width:e.a.width||1,height:e.a.height||1,rotation:e.a.rotation,opacity:C,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:g,listening:k,draggable:P?e.draggable&&a:e.draggable,preventDefault:!P||a,hideInExport:!e.showInExport,onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},onTransformStart:()=>i(!0),onTransform:t=>{let n=t.currentTarget,r=1e-7>Math.abs(n.scaleX()-1)?1:n.scaleX(),i=1e-7>Math.abs(n.scaleY()-1)?1:n.scaleY();n.scaleX(1),n.scaleY(1),e.set({x:n.x(),y:n.y(),width:n.width()*r,height:n.height()*i,rotation:n.rotation()})},onTransformEnd:()=>i(!1)}),E.createElement(T.UL,{x:e.a.x,y:e.a.y,width:Math.max(e.a.width-e.borderSize,0),height:Math.max(e.a.height-e.borderSize,0),opacity:C,offsetX:-e.borderSize/2,offsetY:-e.borderSize/2,stroke:e.borderColor,strokeWidth:e.borderSize,listening:!1,visible:!!e.borderSize,rotation:e.rotation,cornerRadius:Math.max(0,v-e.borderSize),hideInExport:!e.showInExport}))}),at=(0,k.Pi)(({element:e,store:t})=>{let n=E.useRef(null),r=E.useRef(null),i=e.selectable||"admin"===t.role,a=(0,N.b1)(),o=t.selectedShapes.indexOf(e)>=0&&e.selectable,l=e._focusedCellIds.length>0,s=e.editingCell;E.useEffect(()=>{o||e.clearCellFocus()},[o]);let c=null==s?void 0:s._editModeEnabled;E.useEffect(()=>{e._editingCellId&&s&&!s._editModeEnabled&&e.exitCellEdit()},[c]),E.useEffect(()=>{l&&!e._editingCellId&&setTimeout(()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.focus()},0)},[l,e._editingCellId]),E.useEffect(()=>(0,S.EH)(()=>{e._fitRowsToContent&&t.history.ignore(()=>{e._applyFitRowsToContent()})}),[e,t]);let u=t=>{let r=t.target.getStage();if(!r)return;let i=r.getPointerPosition();if(!i)return;let a=n.current;if(!a)return;let o=a.getAbsoluteTransform().copy().invert().point(i);for(let t of e.visibleCells){let n=e.getCellRect(t.row,t.col,t.rowSpan,t.colSpan);if(o.x>=n.x&&o.x<=n.x+n.width&&o.y>=n.y&&o.y<=n.y+n.height)return t}},d=(e,t)=>"dashed"===e?[4*t,2*t]:"dotted"===e?[t,t]:void 0,h=[];for(let t of e.visibleCells){let n=e.getCellRect(t.row,t.col,t.rowSpan,t.colSpan);if(0===t.row){let e=t.getEffectiveBorder("top");"none"!==e.style&&e.width>0&&h.push(E.createElement(T.x1,{key:`bt-${t.id}`,points:[n.x,n.y+e.width/2,n.x+n.width,n.y+e.width/2],stroke:e.color,strokeWidth:e.width,dash:d(e.style,e.width),listening:!1}))}if(0===t.col){let e=t.getEffectiveBorder("left");"none"!==e.style&&e.width>0&&h.push(E.createElement(T.x1,{key:`bl-${t.id}`,points:[n.x+e.width/2,n.y,n.x+e.width/2,n.y+n.height],stroke:e.color,strokeWidth:e.width,dash:d(e.style,e.width),listening:!1}))}{let e=t.getEffectiveBorder("bottom");"none"!==e.style&&e.width>0&&h.push(E.createElement(T.x1,{key:`bb-${t.id}`,points:[n.x,n.y+n.height-e.width/2,n.x+n.width,n.y+n.height-e.width/2],stroke:e.color,strokeWidth:e.width,dash:d(e.style,e.width),listening:!1}))}{let e=t.getEffectiveBorder("right");"none"!==e.style&&e.width>0&&h.push(E.createElement(T.x1,{key:`br-${t.id}`,points:[n.x+n.width-e.width/2,n.y,n.x+n.width-e.width/2,n.y+n.height],stroke:e.color,strokeWidth:e.width,dash:d(e.style,e.width),listening:!1}))}}return E.createElement(E.Fragment,null,E.createElement(T.UL,{id:e.id,name:"element",x:e.a.x,y:e.a.y,rotation:e.a.rotation,width:e.a.width,height:e.a.height,fill:"transparent",opacity:e.a.opacity,hideInExport:!e.showInExport,listening:i,draggable:a?e.draggable&&o:e.draggable,onClick:t=>{if(!o||e.locked||!e.contentEditable)return;let n=u(t);n&&(t.evt.shiftKey&&l?(t.cancelBubble=!0,e.focusCellRange(n.row,n.col)):e.focusCell(n.id))},onDblClick:t=>{if(!o||e.locked||!e.contentEditable)return;let n=u(t);n&&e.enterCellEdit(n.id)},onDragMove:t=>{var r;let i=t.target;e.set({x:i.x(),y:i.y()}),null===(r=n.current)||void 0===r||r.position({x:i.x(),y:i.y()})},onDragEnd:t=>{let n=t.target;e.set({x:n.x(),y:n.y()})},onTransformStart:()=>{e._setIsTransforming(!0)},onTransformEnd:()=>{e._setIsTransforming(!1),e._resetBaseRowHeights()},onTransform:t=>{var r,i;let a=t.target,o=a.scaleX(),l=a.scaleY();a.scaleX(1),a.scaleY(1);let s=e.width*o,c=e.height*l;a.width(s),a.height(c);let u=a.x(),d=a.y(),h=a.rotation();null===(r=n.current)||void 0===r||r.position({x:u,y:d}),null===(i=n.current)||void 0===i||i.rotation(h),e.set({width:s,height:c,x:u,y:d,rotation:h})}}),E.createElement(T.ZA,{ref:n,x:e.a.x,y:e.a.y,rotation:e.a.rotation,opacity:e.a.opacity,hideInExport:!e.showInExport,scaleX:e.a.width/e.width,scaleY:e.a.height/e.he
69ight},e.visibleCells.map(t=>{let n=e.getCellRect(t.row,t.col,t.rowSpan,t.colSpan);return"transparent"===t.cellBackground?null:E.createElement(T.UL,{key:`bg-${t.id}`,x:n.x,y:n.y,width:n.width,height:n.height,fill:t.cellBackground,listening:!1})}),h,e.visibleCells.map(e=>E.createElement(R.Gy,{key:`text-${e.id}`,element:e,store:t})),e._focusedCellIds.map(t=>{let n=e.cells.find(e=>e.id===t);if(!n)return null;let r=e.getCellRect(n.row,n.col,n.rowSpan,n.colSpan);return E.createElement(T.UL,{key:`focus-${t}`,x:r.x,y:r.y,width:r.width,height:r.height,fill:"rgba(13, 131, 221, 0.1)",stroke:"#0d83dd",strokeWidth:2,listening:!1})}),l&&!s&&E.createElement(A.Vt,null,E.createElement("input",{ref:r,style:{position:"absolute",opacity:0,width:"1px",height:"1px",pointerEvents:"none"},readOnly:!0})),o&&!s&&!t.isPlaying&&(()=>{let n=[],r=0;for(let i=0;i<e.cols-1;i++){let a=r+=e.colWidths[i]*e.a.width,o=i;n.push(E.createElement(T.x1,{key:`col-resize-${i}`,x:a,points:[0,0,0,e.a.height],stroke:"transparent",strokeWidth:1,hitStrokeWidth:16,draggable:!0,onMouseEnter:e=>{var t;let n=null===(t=e.target.getStage())||void 0===t?void 0:t.container();n&&(n.style.cursor="col-resize")},onMouseLeave:e=>{var t;let n=null===(t=e.target.getStage())||void 0===t?void 0:t.container();n&&(n.style.cursor="")},onDragStart:e=>{e.cancelBubble=!0,t.history.startTransaction()},onDragMove:t=>{t.cancelBubble=!0;let n=t.target,r=(n.x()-a)/e.width;n.x(a),e.resizeColumn(o,r)},onDragEnd:e=>{e.cancelBubble=!0,e.target.x(a),t.history.endTransaction()}}))}return n})(),o&&!s&&!t.isPlaying&&(()=>{let n=[],r=0;for(let i=0;i<e.rows-1;i++){let a=r+=e.rowHeights[i]*e.a.height,o=i;n.push(E.createElement(T.x1,{key:`row-resize-${i}`,y:a,points:[0,0,e.a.width,0],stroke:"transparent",strokeWidth:1,hitStrokeWidth:16,draggable:!0,onMouseEnter:e=>{var t;let n=null===(t=e.target.getStage())||void 0===t?void 0:t.container();n&&(n.style.cursor="row-resize")},onMouseLeave:e=>{var t;let n=null===(t=e.target.getStage())||void 0===t?void 0:t.container();n&&(n.style.cursor="")},onDragStart:n=>{n.cancelBubble=!0,e._setIsResizingRows(!0),t.history.startTransaction()},onDragMove:t=>{t.cancelBubble=!0;let n=t.target,r=(n.y()-a)/e.height;n.y(a),e.resizeRow(o,r)},onDragEnd:n=>{n.cancelBubble=!0,n.target.y(a),e._setIsResizingRows(!1),e._resetBaseRowHeights(),t.history.endTransaction()}}))}return n})()))}),an={stroke:"rgb(0, 161, 255)",strokeWidth:2},ar=(0,k.Pi)(({element:e})=>E.createElement(T.UL,Object.assign({name:"highlighter",x:e.a.x,y:e.a.y,rotation:e.a.rotation,width:e.a.width,height:e.a.height,listening:!1,strokeScaleEnabled:!1},an)));var ai=n(28117);let aa={text:R.Gy,image:J,svg:J,line:ee.jn,video:i2,figure:i8,group:(0,k.Pi)(e=>{let{element:t,store:n}=e,{children:r}=t,i=t.selectable||"admin"===n.role;return E.createElement(T.ZA,{opacity:t.opacity,listening:i,hideInExport:!t.showInExport,id:t.id},r.map(t=>E.createElement(al,Object.assign({},e,{key:t.id,store:n,element:t}))))}),gif:ae,table:at},ao=(e,t)=>{let n=[];(0,ai.lc)(e,e=>{"group"!==e.type&&n.push(e.a)});let r=[];n.forEach(e=>{let t=[{x:0,y:0},{x:0+e.width,y:0},{x:0+e.width,y:0+e.height},{x:0,y:0+e.height}],n=new M.Z.Transform;n.translate(e.x,e.y),n.rotate(M.Z.Util.degToRad(e.rotation)),t.forEach(e=>{let t=n.point(e);r.push(t)})});let i=new M.Z.Transform;i.rotate(-M.Z.Util.degToRad(t));let a=1/0,o=1/0,l=-1/0,s=-1/0;r.forEach(e=>{let t=i.point(e);a=Math.min(a,t.x),o=Math.min(o,t.y),l=Math.max(l,t.x),s=Math.max(s,t.y)}),i.invert();let c=i.point({x:a,y:o});return{x:c.x,y:c.y,width:l-a,height:s-o,rotation:t}},al=(0,k.Pi)(e=>{var t;let{element:n,store:r}=e,[i,a]=E.useState(!1),o=r.selectedElements.indexOf(n)>=0&&n.selectable,l="group"===(null===(t=n.parent)||void 0===t?void 0:t.type),s=(e=>{let[t,n]=E.useState();return E.useEffect(()=>{let t=setTimeout(()=>{let t=e.page.id,r=M.Z.stages.find(e=>e.getAttr("pageId")===t);r||console.error("No stage is found for element",e.id),n(r)});return()=>clearTimeout(t)},[e.id]),t})(n),c=null==s?void 0:s.findOne("Transformer");E.useEffect(()=>{if(s){let e=e=>{let t=e.target.findAncestor(".element",!0),i=r.getElementById(null==t?void 0:t.id()),o=null==i?void 0:i.top;a((null==o?void 0:o.id)===n.id)};s.on("mouseover",e);let t=()=>{a(!1)};return s.on("mouseleave",t),()=>{s.off("mouseover",e),s.off("mouseleave",t)}}},[s]);let u=aa[e.element.type];return"text"===e.element.type&&I.flags.htmlRenderEnabled&&(u=Q.mv),e.element.visible?u?E.createElement(T.ZA,{name:"element-container"},E.createElement(u,Object.assign({},e)),i&&!o&&!l&&E.createElement(ar,{element:"group"===n.type?{a:ao(n,(null==c?void 0:c.rotation())||0)}:n})):(console.error("Can not find component for "+e.element.type),null):null}),as=(0,k.Pi)(({store:e,page:t,width:n,height:r,scale:i,xPadding:a,yPadding:o,bleed:l})=>{let[s,c]=E.useState(!1),[u,d]=E.useState([]),h=E.useRef(null),f="draw"===e.tool,{strokeWidth:p,stroke:m,opacity:g,brushType:v}=e.toolOptions,b=E.useCallback(e=>{if(!f||(c(!0),e.cancelBubble=!0,!e.target.getStage()))return;let t=h.current.getRelativePointerPosition();t&&d([{x:t.x,y:t.y}])},[f,i,a,o,l]),y=E.useCallback(e=>{if(!f||!s||(e.cancelBubble=!0,!e.target.getStage()))return;let t=h.current.getRelativePointerPosition();t&&d(e=>[...e,{x:t.x,y:t.y}])},[f,s,i,a,o,l]),w=E.useCallback(()=>
69{if(f&&s){if(c(!1),u.length>=1)try{let n=function(e,t){if(0===e.length)throw Error("Cannot create SVG from empty path");let n=t.smooth?function(e,t=.5){if(e.length<3)return e;let n=[];n.push(e[0]);for(let t=0;t<e.length-1;t++){let r=e[Math.max(0,t-1)],i=e[t],a=e[t+1],o=e[Math.min(e.length-1,t+2)];for(let e=0;e<10;e++){let t=e/10,l=t*t,s=l*t,c=.5*(2*i.x+(-r.x+a.x)*t+(2*r.x-5*i.x+4*a.x-o.x)*l+(-r.x+3*i.x-3*a.x+o.x)*s),u=.5*(2*i.y+(-r.y+a.y)*t+(2*r.y-5*i.y+4*a.y-o.y)*l+(-r.y+3*i.y-3*a.y+o.y)*s);n.push({x:c,y:u})}}return n.push(e[e.length-1]),n}(e):e,r=function(e){if(0===e.length)return{x:0,y:0,width:0,height:0};let t=e[0].x,n=e[0].y,r=e[0].x,i=e[0].y;for(let a of e)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x),i=Math.max(i,a.y);return{x:t,y:n,width:r-t,height:i-n}}(n),i=t.strokeWidth,a=r.x-i,o=r.y-i,l=r.width+2*i,s=r.height+2*i,c=` 70 <svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${s}" viewBox="0 0 ${l} ${s}"> 71 <path 72 d="${(function(e){if(0===e.length)return"";if(1===e.length){let t=e[0];return`M ${t.x},${t.y} L ${t.x+.1},${t.y}`}let t=`M ${e[0].x},${e[0].y}`;for(let n=1;n<e.length-1;n++){let r=e[n],i=e[n+1],a=(r.x+i.x)/2,o=(r.y+i.y)/2;t+=` Q ${r.x},${r.y} ${a},${o}`}if(e.length>1){let n=e[e.length-1];t+=` L ${n.x},${n.y}`}return t})(n.map(e=>({x:e.x-a,y:e.y-o})))}" 73 stroke="${t.stroke}" 74 stroke-width="${t.strokeWidth}" 75 stroke-linecap="round" 76 stroke-linejoin="round" 77 fill="none" 78 /> 79 </svg> 80 `.trim();return{src:(0,_.XP)(c),x:a,y:o,width:l,height:s}}(u,{stroke:m,strokeWidth:p,smooth:!0}),r=e.selectedElementsIds.slice();e.history.transaction(()=>{t.addElement({type:"svg",x:n.x,y:n.y,width:n.width,height:n.height,src:n.src,opacity:g},{skipSelect:!0})}),e.selectElements(r)}catch(e){console.error("Error creating path SVG:",e)}d([])}},[f,s,u,m,p,g,t,e.history,e]),x=E.useMemo(()=>u.flatMap(e=>[e.x,e.y]),[u]);return E.useEffect(()=>{if(f&&h.current){let e=h.current.getStage();if(!e)return;let t=p*i;if(t>100||t<4)e.container().style.cursor="crosshair";else{let n=t/2,r=t/2,i=`data:image/svg+xml;base64,${btoa(`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${t}" viewBox="0 0 ${t} ${t}"> 81 <circle cx="${r}" cy="${r}" r="${n-1}" fill="${m}" opacity="${g}" stroke="white" stroke-width="1"/> 82 <circle cx="${r}" cy="${r}" r="${n-1}" fill="none" stroke="black" stroke-width="1" opacity="0.3"/> 83 </svg>`)}`;e.container().style.cursor=`url("${i}") ${r} ${r}, crosshair`}return()=>{e.container()&&(e.container().style.cursor="")}}},[f,m,p,g,i]),f?E.createElement(T.ZA,{ref:h,listening:f,x:a+l*i,y:o+l*i,scaleX:i,scaleY:i},E.createElement(T.UL,{x:-(a+l*i)/i,y:-(o+l*i)/i,width:n/i,height:r/i,fill:"transparent",onMouseDown:b,onMouseMove:y,onMouseUp:w,onTouchStart:b,onTouchMove:y,onTouchEnd:w}),u.length>0&&E.createElement(T.x1,{points:x,stroke:m,strokeWidth:p,lineCap:"round",lineJoin:"round",opacity:g,tension:.5,listening:!1})):null});var ac=n(77922),au=n(69295),ad=n(57042),ah=n(27588),af=n(26436),ap=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let am=e=>T.u4.batchedUpdates(e,null);(0,k.z0)(e=>{T.u4.isAlreadyRendering()?queueMicrotask(()=>am(e)):am(e)});let ag=M.Z.DD._drag;window.removeEventListener("mousemove",ag),M.Z.DD._drag=function(e){(0,S.z)(()=>{ag.call(this,e)})},window.addEventListener("mousemove",M.Z.DD._drag);let av=new M.Z.Group;av.add(new M.Z.Rect({width:20,height:20,fill:"white"})),av.add(new M.Z.Path({scaleX:20/24,scaleY:20/24,data:"M4.98313549,11.0001422 C5.49589839,10.9914935 5.92501998,11.3703506 5.99116425,11.8666444 L5.99985778,11.9831355 L6.00348884,12.2068855 C6.11245031,15.4321748 8.76323537,17.9999971 11.9999971,17.9999971 C12.1869612,17.9999971 12.3726725,17.9914753 12.5567465,17.9745765 L12.2928932,17.7071068 C11.9023689,17.3165825 11.9023689,16.6834175 12.2928932,16.2928932 C12.6834175,15.9023689 13.3165825,15.9023689 13.7071068,16.2928932 L15.7071068,18.2928932 C16.0976311,18.6834175 16.0976311,19.3165825 15.7071068,19.7071068 L13.7071068,21.7071068 C13.3165825,22.0976311 12.6834175,22.0976311 12.2928932,21.7071068 C11.9023689,21.3165825 11.9023689,20.6834175 12.2928932,20.2928932 L12.6111505,19.9769552 C12.4086045,19.9922816 12.2047796,19.9999971 11.9999971,19.9999971 C7.7687005,19.9999971 4.28886152,16.7094374 4.01666425,12.5105203 L4.00420123,12.2575143 L4.00014222,12.0168645 C3.9908282,11.4646583 4.43092928,11.0094562 4.98313549,11.0001422 Z M11.7071068,2.29289322 C12.0675907,2.65337718 12.0953203,3.22060824 11.7902954,3.61289944 L11.7071068,3.70710678 L11.3891629,4.0230186 C11.5916051,4.0077076
837 11.7953244,4 12,4 C16.418278,4 20,7.581722 20,12 C20,12.5522847 19.5522847,13 19,13 C18.4477153,13 18,12.5522847 18,12 C18,8.6862915 15.3137085,6 12,6 C11.8129339,6 11.6271216,6.00853145 11.4429483,6.02544919 L11.7071068,6.29289322 C12.0976311,6.68341751 12.0976311,7.31658249 11.7071068,7.70710678 C11.3466228,8.06759074 10.7793918,8.09532028 10.3871006,7.79029539 L10.2928932,7.70710678 L8.29289322,5.70710678 C7.93240926,5.34662282 7.90467972,4.77939176 8.20970461,4.38710056 L8.29289322,4.29289322 L10.2928932,2.29289322 C10.6834175,1.90236893 11.3165825,1.90236893 11.7071068,2.29289322 Z",fill:"black"}));let ab=av.toCanvas({pixelRatio:2,width:20,height:20}),ay={enabledAnchors:["top-left","top-center","top-right","middle-left","bottom-left","bottom-right","bottom-center","middle-right"],borderEnabled:!0,rotateEnabled:!0,rotationSnaps:[0,45,90,135,180,225,270,315],ignoreStroke:!0,flipEnabled:!1,anchorStrokeWidth:2,borderStrokeWidth:2,rotateAnchorOffset:30,keepRatio:!0,anchorStyleFunc:e=>{e.hasName("rotater")&&e.setAttrs({width:20,height:20,cornerRadius:10,offsetX:10,offsetY:10,fillPatternImage:ab,fillPatternScaleX:.5,fillPatternScaleY:.5,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},aw={text:{enabledAnchors:["top-left","top-right","middle-left","bottom-left","bottom-right","middle-right"]},svg:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},gif:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},line:{enabledAnchors:[],borderEnabled:!1,rotateEnabled:!1},image:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},many:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},group:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},table:{keepRatio:!1,enabledAnchors:["top-left","top-right","middle-left","middle-right","bottom-left","bottom-right"]}},ax=e=>E.createElement(T.UL,Object.assign({},e,{preventDefault:!1})),aC=e=>{var{url:t}=e,n=ap(e,["url"]);let[r,i]=P(t,"anonymous"),a=r?function(e,t,n="scale"){let r,i;let a=t.width/t.height;a>=e.width/e.height?(r=e.width,i=e.width/a):(r=e.height*a,i=e.height);let o=0,l=0;return"left-top"===n?(o=0,l=0):"left-middle"===n?(o=0,l=(e.height-i)/2):"left-bottom"===n?(o=0,l=e.height-i):"center-top"===n?(o=(e.width-r)/2,l=0):"center-middle"===n?(o=(e.width-r)/2,l=(e.height-i)/2):"center-bottom"===n?(o=(e.width-r)/2,l=e.height-i):"right-top"===n?(o=e.width-r,l=0):"right-middle"===n?(o=e.width-r,l=(e.height-i)/2):"right-bottom"===n?(o=e.width-r,l=e.height-i):"scale"===n?(o=0,l=0,r=e.width,i=e.height):console.error(Error("Unknown clip position property - "+n)),{cropX:o,cropY:l,cropWidth:r,cropHeight:i}}(r,{width:n.width,height:n.height},"center-middle"):{};return K(i,t,"page background"),E.createElement(T.Ee,Object.assign({image:r},n,a))},aE=e=>{let t=(0,B.r)({a:{width:e.width,height:e.height},width:e.width,height:e.height},e.fill);return E.createElement(T.UL,Object.assign({},e,t))},ak=e=>{let{background:t,scale:n,borderColor:r,transparencyBackgroundColor:i}=e,a=ap(e,["background","scale","borderColor","transparencyBackgroundColor"]),o=E.useMemo(()=>!!M.Z.Util.colorToRGBA(t)||(0,af.H)(t),[t]),l=E.useMemo(()=>{if((0,af.H)(t))return!0;let e=M.Z.Util.colorToRGBA(t);return!e||e.a<1},[t]),s=E.useMemo(()=>{if(!l||i)return null;let e=document.createElement("canvas");e.width=60,e.height=60;let t=e.getContext("2d");return t&&(t.fillStyle="black",t.fillRect(30,0,30,30),t.fillRect(0,30,30,30)),e},[l,i]);return E.createElement(E.Fragment,null,l&&(i?E.createElement(T.UL,Object.assign({fill:i},a,{hideInExport:!0})):E.createElement(T.UL,Object.assign({fillPatternImage:s},a,{opacity:.1,hideInExport:!0}))),o?E.createElement(aE,Object.assign({fill:t},a)):E.createElement(aC,Object.assign({url:t},a)))},aS=(0,k.Pi)(({selection:e,fill:t="rgba(0, 161, 255, 0.3)",stroke:n="rgb(0, 161, 255)",strokeWidth:r=1})=>e.visible?E.createElement(T.UL,{name:"selection",x:Math.min(e.x1,e.x2),y:Math.min(e.y1,e.y2),width:Math.abs(e.x1-e.x2),height:Math.abs(e.y1-e.y2),fill:t,stroke:n,strokeWidth:r}
83):null),aT=(0,k.Pi)(({x:e,y:t,width:n,height:r,rotation:i,anchor:a,store:o,tagFill:l,textFill:s})=>{let c;if(void 0===e||void 0===t||void 0===n||void 0===r||void 0===i||void 0===a)return null;let u=(0,ad.VK)({x:e,y:t,width:n,height:r,rotation:M.Z.Util.radToDeg(i)}),d=(r/2+70)*Math.cos(i-Math.PI/2),h=(r/2+70)*Math.sin(i-Math.PI/2),f=(0,ah.Cf)({unit:o.unit,dpi:o.dpi,px:n/o.scale,precious:"px"===o.unit?0:1})+" x "+(0,ah.Cf)({unit:o.unit,dpi:o.dpi,px:r/o.scale,precious:"px"===o.unit?0:1})+("px"===o.unit?"":" "+o.unit);return E.createElement(E.Fragment,null,E.createElement(T.__,{x:(u.minX+u.maxX)/2+d,y:(u.minY+u.maxY)/2+h,offsetX:14,offsetY:14,visible:"rotater"===a},E.createElement(T.Vp,{cornerRadius:5,fill:l||"rgb(0, 161, 255)"}),E.createElement(T.xv,{align:"center",verticalAlign:"middle",fill:s||"white",padding:8,text:((c=180*i/Math.PI%360)>180?c-=360:c<-180&&(c+=360),Math.round(c)).toString()+"\xb0"})),E.createElement(T.__,{x:(u.minX+u.maxX)/2,y:u.maxY+20,visible:"rotater"!==a},E.createElement(T.Vp,{cornerRadius:5,fill:l||"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),E.createElement(T.xv,{align:"center",verticalAlign:"middle",fill:s||"white",padding:8,text:f})))}),aP=(0,k.Pi)(({elements:e,store:t})=>{let n=e.filter(e=>e.alwaysOnTop),r=e.filter(e=>!e.alwaysOnTop).concat(n);return E.createElement(E.Fragment,null,r.map(e=>E.createElement(al,{key:e.id,store:t,element:e,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))}),aM=({store:e})=>{let[t,n]=E.useState(!1),[r,i]=E.useState({x:0,y:0});return{open:E.useCallback(e=>{n(!0),i(e)},[]),close:E.useCallback(()=>{n(!1)},[]),props:{isOpen:t,offset:r,setIsOpen:n}}},aR=null,aA=e=>{aR=e},aL=atob("UG9sb3RubyBmcmVlIGxpY2Vuc2UgbGltaXRhdGlvbiBleGNlZWRlZCAtIFBsZWFzZSB1cGdyYWRlIHlvdXIgYWNjb3VudC4="),a_=atob("I2MwMzkyYg=="),aI=atob("djAuOS4y"),aO=e=>E.createElement(E.Fragment,null,E.createElement(T.__,{fill:a_,height:200},E.createElement(T.Vp,{fill:a_}),E.createElement(T.xv,Object.assign({},e,{fill:"white",text:aL,height:void 0,padding:10,fontSize:20})))),aD=atob("RlJFRSAgVFJJQUwgIExJQ0VOU0U="),az=(atob("UG93ZXJlZCBieSBQb2xvdG5v"),atob("TElDRU5TRSAgS0VZICBJUyAgTUlTU0lORw==")),aN=atob("UGxlYXNlIGFjdGl2YXRlIHlvdXIgbGljZW5zZS4KTGljZW5zZSByZWxhdGVkIHF1ZXN0aW9uczoKcG9sb3Ruby5jb20vY29udGFjdA=="),aF=e=>{let t=1===(0,au.Rb)(),n=t?230:195;return E.createElement(T.ZA,Object.assign({},e,{listening:!1}),E.createElement(T.UL,{fill:a_,width:n,height:24,cornerRadius:2}),E.createElement(T.xv,{text:t?az:aD,fill:"white",fontSize:13,fontFamily:"monospace",width:n,align:"center",y:5,listening:!1}),t&&E.createElement(T.xv,{text:aN,fill:"rgba(0,0,0,0.6)",fontSize:14,y:30,listening:!1}))};var aB=(0,k.Pi)(({store:e,page:t,width:n,height:r,pageControlsEnabled:i,backColor:a,transparencyBackgroundColor:o,pageBorderColor:l,activePageBorderColor:s,components:c,bleedColor:u,altCloneEnabled:d,viewportSize:h,selectionRectFill:f,selectionRectStroke:p,selectionRectStrokeWidth:m,snapGuideStroke:g,snapGuideStrokeWidth:v,snapGuideDash:b,transformLabelFill:y,transformLabelTextFill:w,distanceGuideStroke:x,distanceLabelFill:C,distanceLabelTextFill:P,layout:R="vertical",tooltipSafeArea:L,transformerSafeArea:_})=>{let O=e.bleedVisible?t.bleed:0,D=t.computedWidth+2*O,z=t.computedHeight+2*O,F=(n-D*e.scale)/2,B=(r-z*e.scale)/2,H=E.useRef(null),V=E.useRef(null),j=E.useRef(null),$=E.useRef(!1),[U,W]=E.useState(null),[G,q]=E.useState({}),[Z,X]=E.useState(0),Y=aM({store:e}),K=e.selectedElements.find(e=>e._cropModeEnabled),J=e.selectedElements.find(e=>e.curveEnabled),Q=e.selectedShapes.filter(e=>!e.resizable).length>0,ee=e.selectedShapes.filter(e=>!e.draggable).length>0,et=e.selectedElements.filter(e=>!e.visible).length>0;E.useLayoutEffect(()=>{var t,n,r;if(!H.current)return;let i=H.current.getStage(),a=e.selectedShapes.map(e=>e._cropModeEnabled?null:i.findOne("#"+e.id)).filter(e=>!!e),o=1===e.selectedElements.length,l=o&&(null===(t=e.selectedElements[0])||void 0===t?void 0:t.type)||"many";aw[l]?(H.current.setAttrs(Object.assign(Object.assign({}
83,ay),aw[l])),"svg"!==l&&"image"!==l&&"gif"!==l||e.selectedElements[0].keepRatio||H.current.setAttrs({enabledAnchors:ay.enabledAnchors}),"text"===l&&I.flags.textVerticalResizeEnabled&&H.current.setAttrs({enabledAnchors:null===(n=aw.text.enabledAnchors)||void 0===n?void 0:n.concat(["bottom-center"])}),"text"===l&&o&&e.selectedElements[0].curveEnabled&&H.current.setAttrs({enabledAnchors:aw.many.enabledAnchors})):H.current.setAttrs(ay),Q&&H.current.enabledAnchors([]),ee&&H.current.rotateEnabled(!1),a.find(e=>null==e?void 0:e.isDragging())&&a.forEach(e=>{e.isDragging()||null==e||e.startDrag()}),H.current.nodes(a),(0,ac.o_)(),null===(r=H.current.getLayer())||void 0===r||r.batchDraw()},[e.selectedShapes,K,Q,et,ee,J]);let en=()=>{var e,t;let n=H.current;if(!n)return;if(!n.isTransforming())return void q({});if(!n.nodes().length||!n.isTransforming())return;let r=n.__getNodeRect(),i=null==n?void 0:n.getActiveAnchor(),a=n.getStage();q({anchor:i,x:r.x-(null!==(e=null==a?void 0:a.x())&&void 0!==e?e:0),y:r.y-(null!==(t=null==a?void 0:a.y())&&void 0!==t?t:0),rotation:r.rotation,width:r.width,height:r.height})},er=E.useCallback(()=>{var e;if(null===(e=H.current)||void 0===e?void 0:e.isTransforming())return;let t=H.current;if(!t||!t.nodes().length)return void X(0);let i=t.getClientRect();t.getStage()&&X(function(e,t,n,r=0){let i=e.x+e.width/2,a=e.y+e.height/2,o=e.width/2,l=e.height/2,s=r*Math.PI/180,c=e=>{let t;let r=e*Math.PI/180,c=(e%360+360)%360,u=Math.sin(r)*((t=0===c||180===c?l:o)+n),d=-Math.cos(r)*(t+n);return{x:i+(u*Math.cos(s)-d*Math.sin(s)),y:a+(u*Math.sin(s)+d*Math.cos(s))}},u=e=>e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom;if(u(c(0)))return 0;for(let e of[180,270,90])if(u(c(e)))return e;return 0}(i,{top:(null==_?void 0:_.top)||0,bottom:r-((null==_?void 0:_.bottom)||0),left:(null==_?void 0:_.left)||0,right:n-((null==_?void 0:_.right)||0)},ay.rotateAnchorOffset||30,t.rotation()))},[_,n,r]);E.useEffect(()=>{var e;null===(e=H.current)||void 0===e||e.update(),en(),er()},[e.scale,er]),E.useEffect(()=>{er()},[e.selectedShapes,er]);let ei=(0,k.fv)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),ea=E.useRef(!1),eo=(0,N.b1)(),el=(0,S.aD)(e=>{var t,n,r,i,a,o,l;if(eo)return;ea.current=!1;let s=e.target.findAncestor(".elements-container"),c=e.target.findAncestor("Transformer"),u=e.target.findAncestor(".page-abs-container");if(s||c||u)return;let d=null===(t=e.target.getStage())||void 0===t?void 0:t.getPointerPosition();d&&(d.x-=null!==(r=null===(n=e.target.getStage())||void 0===n?void 0:n.x())&&void 0!==r?r:0,d.y-=null!==(a=null===(i=e.target.getStage())||void 0===i?void 0:i.y())&&void 0!==a?a:0,ei.visible=!0,ei.x1=d.x,ei.y1=d.y,ei.x2=d.x,ei.y2=d.y,(null!==(l=null===(o=e.target.getStage())||void 0===o?void 0:o.getPointersPositions().length)&&void 0!==l?l:0)>=2&&(ei.visible=!1))});(({stageRef:e,containerRef:t,viewportSize:n})=>{E.useEffect(()=>{var n;let r=null===(n=t.current)||void 0===n?void 0:n.closest(".polotno-workspace-inner");function i(){var n;if(!e.current)return;let i=null===(n=t.current)||void 0===n?void 0:n.getBoundingClientRect(),a=null==r?void 0:r.getBoundingClientRect();if(!i||!a)return;let o=Math.max(0,a.left-i.left-100),l=Math.max(0,a.top-i.top-100);e.current.position({x:-o,y:-l}),e.current.container().style.transform=`translate(${o}px, ${l}px)`}return i(),null==r||r.addEventListener("scroll",i),()=>{null==r||r.removeEventListener("scroll",i)}},[n.width,n.height])})({stageRef:V,containerRef:j,viewportSize:h}),E.useEffect(()=>{let t=(0,S.aD)(e=>{var t,n,r,i,a,o;if(!ei.visible)return;null===(t=V.current)||void 0===t||t.setPointersPositions(e);let l=null===(n=V.current)||void 0===n?void 0:n.getPointerPosition();l?(l.x-=null!==(i=null===(r=V.current)||void 0===r?void 0:r.x())&&void 0!==i?i:0,l.y-=null!==(o=null===(a=V.current)||void 0===a?void 0:a.y())&&void 0!==o?o:0):l={x:ei.x2,y:ei.y2},ei.x2=l.x,ei.y2=l.y}),n=(0,S.aD)(()=>{if(!ei.visible||!V.current)return;let t=V.current.findOne(".selection"),n=t?t.getClientRect({skipStroke:!0}):{width:0,height:0,x:0,y:0};if(n.width&&n.height){let t=[];V.current.find(".element").forEach(r=>{let i=r.getClientRect(),a=e.getElementById(r.id()),o=null==a?void 0:a.draggable,l=null==a?void 0:a.selectable;M.Z.Util.haveIntersection(n,i)&&o&&l&&t.push(a.top.id)});let r=[...new Set(t)];ea.current=!0,e.selectElements(r)}ei.visible=!1});return window.addEventListener("mousemove",t),window.addEventListener("touchmove",t),window.addEventListener("mouseup",n,{capture:!0}),window.addEventListener("touchend",n,{capture:!0}),()=>{window.removeEventListener("mousemove",t),window.removeEventListener("touchmove",t),window.removeEventListener("mouseup",n),window.removeEventListener("touchend",n)}},[]);let es=E.useCallback(n=>{if(!e.selectedElements[0]||n&&e.selectedElementsIds.includes(n))return;let r=(0,ad.Ne)(e.selectedShapes),i=n?e.getElementById(n):{x:0,y:0,width:t.computedWidth,height:t.computedHeight,rotation:0},a=(0,ad.VK)(i),o=[];r.minX>a.maxX&&o.push({distance:r.minX-a.maxX,box1:r,box2:a,points:[{x:r.minX,y:r.minY+r.height/2},{x:a.maxX,y:r.minY+r.height/2},{x:a.maxX,y:a.minY+a.height/2}]}),r.maxX<a.minX&&o.push({distance:a.minX-r.maxX,box1:r,box2:a,points:[{x:r.maxX,y:r.minY+r.height/2},{x:a.minX,y:r.minY+r.height/2},{x:a.minX,y:a.minY+a.height/2}]}),r.minY>a.maxY&&o.push({box1:r,box2:a,distance:r.minY-a.maxY,points:[{x:r.minX+r.width/2,y:r.minY},{x:r.minX+r.width/2,y:a.maxY},{x:a.minX+a.width/2,y:a.maxY}]}),r.maxY<a.minY&&o.push({box1:r,box2:a,distance:a.minY-r.maxY,points:[{x:r.minX+r.width/2,y:r.maxY},{x:r.minX+r.width/2,y:a.minY},{x:a.minX+a.width/2,y:a.minY}]});let l=r.minX>=a.minX&&r.maxX<=a.maxX&&r.minY>=a.minY&&r.maxY<=a.maxY;if(l&&(o.push({distance:r.minX-a.minX,box1:r,box2:a,points:[{x:r.minX,y:r.minY+r.height/2},{x:a.minX,y:r.minY+r.height/2},{x:a.minX,y:a.minY+a.height/2}]}),o.push({distance:a.maxX-r.maxX,box1:r,box2:a,points:[{x:r.maxX,y:r.minY+r.height/2},{x:a.maxX,y:r.minY+r.height/2},{x:a.maxX,y:a.minY+a.height/2}]}),o.push({box1:r,box2:a,distance:r.minY-a.minY,points:[{x:r.minX+r.width/2,y:r.minY},{x:r.minX+r.width/2,y:a.minY},{x:a.minX+a.width/2,y:a.minY}]}),o.push({box1:r,box2:a,distance:a.maxY-r.maxY,points:[{x:r.minX+r.width/2,y:r.maxY},{x:r.minX+r.width/2,y:a.maxY},{x:a.minX+a.width/2,y:a.maxY}]})),0===o.length&&!l){let e=r.minX<a.maxX&&r.maxX>a.minX,t=r.minY<a.maxY&&r.maxY>a.minY;if(e&&t){let e=(Math.max(r.minY,a.minY)+Math.min(r.maxY,a.maxY))/2,t=(Math.max(r.minX,a.minX)+Math.min(r.maxX,a.maxX))/2;r.minX<a.minX?o.push({distance:a.minX-r.minX,box1:r,box2:a,points:[{x:r.minX,y:e},{x:a.minX,y:e},{x:a.minX,y:e}]}):o.push({distance:r.minX-a.minX,box1:r,box2:a,points:[{x:r.minX,y:e},{x:a.minX,y:e},{x:a.minX,y:e}]}),r.maxX>a.maxX?o.push({distance:r.maxX-a.maxX,box1:r,box2:a,points:[{x:a.maxX,y:e},{x:r.maxX,y:e},{x:a.maxX,y:e}]}):o.push({distance:a.maxX-r.maxX,box1:r,box2:a,points:[{x:r.maxX,y:e},{x:a.maxX,y:e},{x:a.maxX,y:e}]}),r.minY<a.minY?o.push({box1:r,box2:a,distance:a.minY-r.minY,points:[{x:t,y:r.minY},{x:t,y:a.minY},{x:t,y:a.minY}]}):o.push({box1:r,box2:a,distance:r.minY-a.minY,points:[{x:t,y:r.minY},{x:t,y:a.minY},{x:t,y:a.minY}]}),r.maxY>a.maxY?o.push({box1:r,box2:a,distance:r.maxY-a.maxY,points:[{x:t,y:a.maxY},{x:t,y:r.maxY},{x:t,y:a.maxY}]}):o.push({box1:r,box2:a,distance:a.maxY-r.maxY,points:[{x:t,y:r.maxY},{x:t,y:a.maxY},{x:t,y:a.maxY}]})}}JSON.stringify(U)!==JSON.stringify(o)&&W(o)},[e,t]);E.useEffect(()=>{e.distanceGuidesVisible?es():U&&W(null)},[e.distanceGuidesVisible,es,e.selectedShapes.map(e=>`${e.x},${e.y},${e.width},${e.height},${e.rotation}`).join("|")]);let ec=E.useRef(!1);E.useEffect(()=>{var e;let t;let n=null===(e=j.current)||void 0===e?void 0:e.closest(".polotno-workspace-inner"),r=()=>
83{ec.current=!0,clearTimeout(t),t=setTimeout(()=>{ec.current=!1},300)};return null==n||n.addEventListener("scroll",r),()=>{clearTimeout(t),null==n||n.removeEventListener("scroll",r)}},[]),E.useEffect(()=>{let e=V.current;if(!e)return;let t=e.container(),n=e=>{var t,n;e.touches.length>=2&&((null===(t=H.current)||void 0===t?void 0:t.isDragging())&&H.current.stopDrag(),null===(n=H.current)||void 0===n||n.nodes().forEach(e=>{e.isDragging()&&e.stopDrag()}))};return t.addEventListener("touchstart",n,{passive:!0}),t.addEventListener("touchmove",n,{passive:!0}),()=>{t.removeEventListener("touchstart",n),t.removeEventListener("touchmove",n)}},[]);let eu=n=>{if(e.activePage!==t&&t.select(),ec.current||ea.current)return;let r=n.evt.ctrlKey||n.evt.metaKey||n.evt.shiftKey,i=n.target.findAncestor(".elements-container"),a=n.target.findAncestor(".page-abs-container"),o=n.target.findAncestor("Transformer");if(!(r||i||o||a||ei.visible))return void e.selectElements([]);let l=n.target.findAncestor(".element-container",!0),s=(null==l?void 0:l.findOne(".element"))||n.target.findAncestor(".element",!0),c=e.getElementById(null==s?void 0:s.id()),u=null==c?void 0:c.top,d=null==u?void 0:u.id,h=e.selectedElementsIds.indexOf(d)>=0,f=n.target.findAncestor(".page-container",!0);d&&r&&!h?e.selectElements(e.selectedElementsIds.concat([d])):d&&r&&h?e.selectElements(e.selectedElementsIds.filter(e=>e!==d)):!d||r||h?f?e.selectPages([t.id]):e.selectPages([]):e.selectElements([d])};(0,ac.D_)(H,e,{stroke:g,strokeWidth:v,dash:b});let ed=e.activePage===t,eh=e._selectedPagesIds.includes(t.id),ef=null==c?void 0:c.PageControls,ep=null==c?void 0:c.Tooltip,em=null==c?void 0:c.ContextMenu,eg=1/e.scale,ev=0/e.scale;return E.createElement("div",{ref:j,onDragOver:e=>e.preventDefault(),onDrop:n=>{if(n.preventDefault(),!V.current)return;V.current.setPointersPositions(n);let r=V.current.findOne(".elements-container"),i=null==r?void 0:r.getRelativePointerPosition(),a=V.current.getPointerPosition(),o=[...new Set(V.current.getAllIntersections(a).map(e=>e.findAncestor(".element",!0)).filter(Boolean).reverse())].map(t=>e.getElementById(t.id())).filter(e=>!!e),l=o[0];aR&&i&&(aR(i,l,{elements:o,page:t}),aR=null)},style:{position:"relative",width:n+"px",height:r+"px",overflow:"hidden",flexShrink:0},className:"polotno-page-container"+(ed?" active-page":"")},E.createElement(T.Hf,{ref:V,width:Math.min(n,h.width+200),height:Math.min(h.height+200,r),onClick:eu,onTap:eu,onContextMenu:t=>{t.evt.preventDefault();let n=t.target.findAncestor(".element",!0),r=e.getElementById(null==n?void 0:n.id()),i=null==r?void 0:r.top,a=null==i?void 0:i.id;a?e.selectedElementsIds.indexOf(a)>=0||e.selectElements([a]):e.selectElements([]),Y.open({x:t.evt.clientX,y:t.evt.clientY})},onMouseDown:el,onMouseMove:t=>{if(!e.distanceGuidesVisible&&!t.evt.altKey)return void(U&&W(null));let n=t.target.findAncestor(".element",!0);es(null==n?void 0:n.id())},onDragStart:t=>{var n;let r=t.target.getStage();if(r&&r.getPointersPositions().length>=2)return void t.target.stopDrag();let i=t.target.findAncestor(".element",!0);if(i){let r=e.getElementById(null==i?void 0:i.id()),a=null==r?void 0:r.top,o=null==a?void 0:a.id;!(e.selectedElementsIds.indexOf(o)>=0)&&o&&(e.selectElements([o]),t.target.stopDrag(),t.target.startDrag(t),null===(n=H.current)||void 0===n||n.startDrag(t))}U&&W(null)},pageId:t.id,style:{position:"absolute",overflow:"hidden",top:0,left:0}},E.createElement(T.mh,null,E.createElement(ax,{width:n,height:r,fill:a}),E.createElement(T.ZA,{x:F,y:B,scaleX:e.scale,scaleY:e.scale,name:"page-container"},E.createElement(T.ZA,{name:"page-container-2"},E.createElement(T.ZA,{name:"page-background-group",x:O,y:O},E.createElement(ak,{x:-t.bleed,y:-t.bleed,width:t.computedWidth+2*t.bleed,height:t.computedHeight+2*t.bleed,background:t.background,transparencyBackgroundColor:o,name:"page-background",preventDefault:!1,scale:e.scale})),E.createElement(T.ZA,{x:O,y:O,name:"elements-container",listening:!e.isPlaying},E.createElement(T.UL,{name:"elements-area",width:t.computedWidth,height:t.computedHeight,listening:!1}),E.createElement(aP,{elements:t.children,store:e})),E.createElement(T.UL,{stroke:u,name:"bleed",strokeWidth:t.bleed,x:t.bleed/2,y:t.bleed/2,width:t.computedWidth+t.bleed,height:t.computedHeight+t.bleed,listening:!1,visible:t.bleed>0&&e.bleedVisible,hideInExport:!0}),(0,au.SJ)()===aI&&E.createElement(aO,{name:"hit-detection",x:-eg/2-ev,y:-eg/2-ev,width:D+eg+2*ev,height:z+eg+2*ev}))),E.createElement(T.x1,{name:"workspace-background",points:[0,0,n,0,n,r,0,r,0,0,F,B,F,r-B,n-F,r-B,n-F,B,F,B],listening:!1,closed:!0,fill:a}),E.createElement(T.ZA,{x:F,y:B,scaleX:e.scale,scaleY:e.scale},E.createElement(T.UL,{name:"page-highlight",hideInExport:!0,x:-eg/2-ev,y:-eg/2-ev,width:D+eg+2*ev,height:z+eg+2*ev,stroke:eh?s:l,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),E.createElement(T.ZA,{x:F+O*e.scale,y:B+O*e.scale,scaleX:e.scale,scaleY:e.scale,name:"page-abs-container"},E.createElement(T.$T,{ref:H,rotateAnchorAngle:Z,onDragStart:n=>{var r;let i=n.target.getStage();i&&i.getPointersPositions().length>
83=2?n.target.stopDrag():((null===(r=n.evt)||void 0===r?void 0:r.altKey)&&d&&e.selectedElements.forEach(e=>{let n=e.clone({},{skipSelect:!0}),r=t.children.indexOf(e);t.setElementZIndex(n.id,r)}),$.current=!0,e.history.startTransaction())},onDragEnd:()=>{$.current&&(e.history.endTransaction(),$.current=!1),er()},onTransformStart:()=>{e.history.startTransaction(),W(null)},boundBoxFunc:(t,n)=>{var r;let i=1>Math.abs(n.width)||1>Math.abs(n.height),a=1>Math.abs(t.width)||1>Math.abs(t.height);if(i&&!a)return t;let o=e.selectedElements;if(1===o.length&&"table"===(null===(r=o[0])||void 0===r?void 0:r.type)){let e=o[0],r=Math.abs(t.width),i=Math.abs(t.height);if(r>0&&i>0){let a=Math.abs(n.width)/r,o=Math.abs(n.height)/i,l=e.width*a,s=e.height*o;if(l<e.minWidth||s<e.minHeight)return t}}return n},onTransform:e=>{let t=H.current.nodes(),n=t[t.length-1];e.target===n&&setTimeout(()=>{en()},0)},onTransformEnd:t=>{q({}),e.history.endTransaction(),er()},visible:!e.isPlaying}),U&&U.map(({points:t,distance:n,box1:r,box2:i},a)=>E.createElement(T.ZA,{name:"distances-container",hideInExport:!0,key:a,listening:!1},E.createElement(T.UL,Object.assign({},r,{stroke:x,strokeWidth:1,strokeScaleEnabled:!1})),E.createElement(T.UL,Object.assign({},i,{stroke:x,strokeWidth:1,strokeScaleEnabled:!1})),E.createElement(T.x1,{points:[t[0].x,t[0].y,t[1].x,t[1].y],stroke:x,strokeWidth:1,strokeScaleEnabled:!1}),E.createElement(T.x1,{points:[t[1].x,t[1].y,t[2].x,t[2].y],stroke:x,strokeWidth:1,strokeScaleEnabled:!1}),E.createElement(T.__,{x:(t[0].x+t[1].x)/2,y:(t[0].y+t[1].y)/2,offsetY:-10,scaleX:1/e.scale,scaleY:1/e.scale},E.createElement(T.Vp,{cornerRadius:5,fill:C,pointerDirection:"down"}),E.createElement(T.xv,{align:"center",verticalAlign:"middle",fill:P,padding:5,text:(0,ah.Qj)({unit:e.unit,dpi:e.dpi,px:n})})))),t._rendering&&E.createElement(T.ZA,null,E.createElement(T.UL,{width:D,height:z,fill:"rgba(255,255,255,0.9)"}),E.createElement(T.xv,{text:"Rendering...",fontSize:60,width:D,height:z,align:"center",verticalAlign:"middle"})),ep&&E.createElement(ep,{components:c,store:e,page:t,stageRef:V,tooltipSafeArea:L}),em&&E.createElement(A.Vt,null,E.createElement(em,Object.assign({components:c,store:e},Y.props)))),E.createElement(as,{store:e,page:t,width:n,height:r,scale:e.scale,xPadding:F,yPadding:B,bleed:O}),E.createElement(aT,Object.assign({},G,{store:e,tagFill:y,textFill:w})),E.createElement(aS,{selection:ei,fill:f,stroke:p,strokeWidth:m}),(0,au.Rb)()>0&&E.createElement(T.ZA,{hideInExport:!0},E.createElement(aF,{name:"cache-bounds",x:n-(1===(0,au.Rb)()?250:210),y:r-(1===(0,au.Rb)()?95:45)}),E.createElement(aF,{name:"cache-bounds-t",x:10,y:10})),(0,au.S1)()&&E.createElement(T.xv,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:n-170,y:r-18,onMouseEnter:e=>{e.target.getStage().container().style.cursor="pointer"},onMouseLeave:e=>{e.target.getStage().container().style.cursor=""},onTouchStart:e=>{e.cancelBubble=!0},onMouseDown:e=>{e.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),E.createElement(T.ZA,{name:"line-guides"}))),(null==i||i)&&ef&&E.createElement(ef,{store:e,page:t,xPadding:F,yPadding:B,layout:R}))})},218:function(e,t,n){"use strict";let r;n.d(t,{Gy:function(){return z},A5:function(){return C.A5},Dp:function(){return I},Av:function(){return _},D9:function(){return O}});var i=n(7653),a=n(2027),o=n(46666),l=n(463),s=n(59533),c=n(8585);function u(e,t,n){let r=n[t-1]||{values:{x:0,y:0}};if(e.marker===e.marker.toLowerCase())switch(e.marker=e.marker.toUpperCase(),e.marker){case"M":case"L":case"A":case"T":e.values.x+=r.values.x,e.values.y+=r.values.y;break;case"H":e.marker="L",e.values.x+=r.values.x,e.values.y=r.values.y;break;case"V":e.marker="L",e.values.x=r.values.x,e.values.y+=r.values.y;break;case"C":e.values.x+=r.values.x,e.values.y+=r.values.y,e.values.x1+=r.values.x,e.values.y1+=r.values.y,e.values.x2+=r.values.x,e.values.y2+=r.values.y;break;case"S":e.values.x+=r.values.x,e.values.y+=r.values.y,e.values.x2+=r.values.x,e.values.y2+=r.values.y;break;case"Q":e.values.x+=r.values.x,e.values.y+=r.values.y,e.values.x1+=r.values.x,e.values.y1+=r.values.y}else if(e.marker===e.marker.toUpperCase())switch(e.marker){case"H":e.marker="L",e.values.y=r.values.y;break;case"V":e.marker="L",e.values.x=r.values.x}if("Z"===e.marker){let r=function e(t,n){return"M"===t[n].marker?t[n]:e(t,n-1)}(n,t);e.values.x=r.values.x,e.values.y=r.values.y}return e}function d(e,t,n){if(0!==t&&"L"===e.marker){let r=n[t-1];["x","y"].every(t=>0===Math.round(Math.abs(r.values[t]-e.values[t])))&&(e.overlap=!0)}return e}function h(e,t){return Math.atan2(t.x-e.x,t.y-e.y)}function f(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function p(e,t){let n=t/Math.tan(e);return n===1/0||n===-1/0||isNaN(n)?t:n}function m(e){let t=/-?[0-9]*\.?\d+/g;return[...e.matchAll(/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g)].map(e=>({marker:e[0],index:e.index})).reduceRight((t,n)=>{let r=e.substring(n.index,t.length?t[t.length-1].index:e.length);return t.concat([{marker:n.marker,index:n.index,chunk:r.length>0?r.substr(1,r.length-1):r}])},[]).reverse().flatMap(e=>{let n=e.chunk.match(t),r=n?n.map(parseFloat):[];return function(e,t){let n=[];switch(e.toUpperCase()){case"M":for(let r=0;r<t.length;r+=2){let i;i=e===e.toUpperCase()?0===r?"M":"L":0===r?"m":"l",n.push({marker:i,values:{x:t[r],y:t[r+1]}})}break;case"L":for(let r=0;r<t.length;r+=2)n.push({marker:e,values:{x:t[r],y:t[r+1]}});break;case"H":for(let r=0;r<t.length;r++)n.push({marker:e,values:{x:t[r],y:0}});break;case"V":for(let r=0;r<t.length;r++)n.push({marker:e,values:{x:0,y:t[r]}});break;case"C":for(let r=0;r<t.length;r+=6)n.push({marker:e,values:{x1:t[r],y1:t[r+1],x2:t[r+2],y2:t[r+3],x:t[r+4],y:t[r+5]}});break;case"S":for(let r=0;r<t.length;r+=4)n.push({marker:e,values:{x2:t[r],y2:t[r+1],x:t[r+2],y:t[r+3]}});break;case"Q":for(let r=0;r<t.length;r+=4)n.push({marker:e,values:{x1:t[r],y1:t[r+1],x:t[r+2],y:t[r+3]}});break;case"T":for(let r=0;r<t.length;r+=2)n.push({marker:e,values:{x:t[r],y:t[r+1]}});break;case"A":for(let r=0;r<t.length;
83r+=7)n.push({marker:e,values:{radiusX:t[r],radiusY:t[r+1],rotation:t[r+2],largeArc:t[r+3],sweep:t[r+4],x:t[r+5],y:t[r+6]}});break;case"Z":n.push({marker:e,values:{x:0,y:0}})}return n}(e.marker,r)}).map(u)}function g(e,t,n){let r=[],i=[];return n&&e.forEach(e=>(Object.keys(e.values).forEach(t=>e.values[t]=e.values[t]&&parseFloat(e.values[t].toFixed(n))),e)),e.forEach(e=>{"M"===e.marker&&r.push([]),r[r.length-1].push(e)}),r.forEach(e=>{e.map(d),function e(t,n){let r=["x","y"].every(e=>0===Math.round(Math.abs(t[n].values[e]-t[0].values[e])));"L"===t[n].marker&&r&&(t[n].overlap=!0,e(t,n-1)),"Z"===t[n].marker&&e(t,n-1)}(e,e.length-1);let n="Z"==e[e.length-1].marker;e.filter(e=>!e.overlap).map((e,r,a)=>{let o,l,s;let c=function e(t,n,r){var i;let a=n-1,o=r[(a%(i=r.length)+i)%i];return"Z"!==o.marker?o:e(t,a,r)}(e,r,a),u=function e(t,n,r){var i;let a=n+1,o=r[(a%(i=r.length)+i)%i];return"Z"===o.marker?e(t,a,r):o}(e,r,a),d=h(e.values,c.values),m=h(e.values,u.values),g=m-d,v=Math.min(t,Math.abs(function(e,t,n){let r=f(e.values,n.values);return Math.min(f(t.values,e.values),r)}(e,c,u)/2*Math.tan(g/2))),b=(l=0,(s=180/Math.PI*g)<0&&s>=-180||s>180&&s<360?o=p(g/2,-v):(o=p(g/2,v),l=1,o===1/0&&(o=v)),{offset:o,sweepFlag:l}),y=b.offset,w=b.sweepFlag,x=(0==r||r==a.length-1)&&!n;switch(e.marker){case"M":case"L":let C=[e.values.x+Math.sin(d)*y,e.values.y+Math.cos(d)*y],E=[e.values.x+Math.sin(m)*y,e.values.y+Math.cos(m)*y];x?i.push({marker:e.marker,values:e.values}):i.push({marker:e.marker,values:{x:parseFloat(C[0].toFixed(3)),y:parseFloat(C[1].toFixed(3))}}),x||"L"!==u.marker&&"M"!==u.marker||i.push({marker:"A",radius:v,values:{radiusX:parseFloat(v.toFixed(3)),radiusY:parseFloat(v.toFixed(3)),rotation:180/Math.PI*g,largeArc:0,sweep:w,x:parseFloat(E[0].toFixed(3)),y:parseFloat(E[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":i.push({marker:e.marker,values:e.values})}})}),{path:function(e){let t=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map(e=>{let n="";if("Z"!==e.marker){let r=Object.keys(e.values);n=t.filter(e=>-1!==r.indexOf(e)).map(t=>e.values[t]).join()}return`${e.marker}${n}`}).join("").trim()}(i),commands:i}}var v=n(8803),b=n(69389),y=n(1032),w=n(84360),x=n(94877),C=n(95710),E=n(20873),k=n(36677),S=n(96283),T=n(53317),P=n(21653),M=n(90337);c.Z._fixTextRendering=!0;let R={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal",textTransform:"none"},A=(0,a.Pi)(({textNodeRef:e,element:t,onBlur:n,selectAll:a,cursorPosition:o})=>{let[l,s]=i.useState(R),c=e.current;i.useLayoutEffect(()=>{if(!c)return;let e={};e.width=c.width()-2*c.padding()+"px",e.height=c.height()-2*c.padding()+c.fontSize()*c.lineHeight()+"px",e.fontSize=c.fontSize()+"px",e.lineHeight=c.lineHeight()+.01,e.fontFamily=c.fontFamily(),e.textAlign=c.align(),e.color=c.fill(),e.fontWeight=t.fontWeight,e.fontStyle=t.fontStyle,e.letterSpacing=t.letterSpacing+"em",e.opacity=Math.max(t.a.opacity,.2),e.textTransform=t.textTransform,e.caretColor=(0,M.e)(t);let n=` 84 .polotno-input::placeholder { 85 color: ${l.color}; 86 opacity: 0.6; 87 } 88 `,i=r||((r=document.getElementById("polotno-text-style"))||((r=document.createElement("style")).id="polotno-text-style",document.head.appendChild(r)),r);i.innerHTML="",i.appendChild(document.createTextNode(n)),JSON.stringify(e)!==JSON.stringify(l)&&s(e)});let u=i.useRef(null);if(i.useLayoutEffect(()=>{var e;let t=u.current;if(!t)return;null===(e=u.current)||void 0===e||e.focus();let n=o||t.value.length;t.selectionStart=t.selectionEnd=n,a&&(null==t||t.select(),document.execCommand("selectAll",!1,void 0))},[]),i.useEffect(()=>{window.addEventListener("blur",n);let e=e=>{var t;(null===(t=u.current)||void 0===t?void 0:t.contains(e.target))||n()};return window.addEventListener("touchstart",e),()=>{window.removeEventListener("blur",n),window.removeEventListener("touchstart",e)}},[]),!c)return null;let d=0,h=c.textArr.length*c.lineHeight()*c.fontSize();"middle"===t.verticalAlign&&(d=(t.a.height-h)/2),"bottom"===t.verticalAlign&&(d=t.a.height-h);let f=(0,x.av)(t.text);return i.createElement("textarea",{className:"polotno-input",ref:u,dir:(0,C.XP)(f),style:Object.assign(Object.assign(Object.assign({},R),l),{paddingTop:d+"px"}),value:f,onChange:e=>{let n=(0,P.W)({oldText:t.text,newText:e.target.value,element:t});t.set({text:e.target.value,fontSize:n})},placeholder:t.placeholder,onBlur:n})}),L=e=>i.createElement(l.Vt,null,i.createElement(A,Object.assign({},e))),_=(e,t,n,r,a)=>{let[o,l]=i.useReducer(e=>e+1,0),s=i.useRef((0,y.Qo)(t,n,r)),c=i.useRef(null);return i.useLayoutEffect(()=>{if(s.current=(0,y.Qo)(t,n,r),s.current)return;let i=!0;return(async()=>{s.current=!1,l();let o=(0,b.aM)(`text ${t}`);await e.loadFont(t,n,r,a),i?(c.current=o,s.current=!0,l()):o()})(),()=>{c.current&&(c.current(),c.current=null),i=!1}},[t,n,r]),i.useEffect(()=>{s.current&&setTimeout(()=>{c.current&&(c.current(),c.current=null)})},[s.current]),[s.current]},I=({fontLoaded:e,fontFamily:t,fontSize:n,lineHeight:r})=>i.useMemo(()=>(0,C.Lt)({fontFamily:t,fontSize:n,lineHeight:r}),[e,t,n,r]);function O(e){let t=i.useRef(e),n=i.useRef(e);return i.useMemo(()=>{n.current=t.current,t.current=e},[e]),n.current}function D(e,t,n=!1){let r=e.fontSize(),i=e.height(),a=(0,x.av)(t.text),o=t.a.fontSize;e.height(void 0);let l=Math.round(2*t.a.fontSize)-1;for(let r=1;r<l;r++){let r=t.a.height&&e.height()>t.a.height,i=a.split("\n").join(" ").split(/[\s-]+/).reduce((e,t)=>
88(t=t.toLowerCase(),/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(t)?e.concat(t.split("")):e.concat(t)),[]),l=e.textArr.map(e=>e.text.toLowerCase()).join(";"),s=i.find(e=>!l.includes(e)||(l=l.replace(e,""),!1));if(!(r||s&&!n))break;o-=.5,e.fontSize(o)}return e.fontSize(r),e.height(i),o}let z=(0,a.Pi)(({element:e,store:t})=>{let n=i.useRef(null),r=i.useRef(null),a=i.useRef(null),l=i.useRef([]),[,c]=i.useReducer(e=>e+1,0),{editorEnabled:u,selectAll:d}=(e=>{let[t,n]=i.useState(!1),r=i.useRef(!1);return i.useEffect(()=>{var t=!0;return setTimeout(()=>{t&&(e._editModeEnabled&&(r.current=!0),n(!0),setTimeout(()=>{r.current=!1},50))},50),()=>{t=!1}},[]),{editorEnabled:t&&e._editModeEnabled,selectAll:r.current}})(e),[h,f]=i.useState(!1),p=i.useRef(e.a.height),y=t.selectedShapes.indexOf(e)>=0&&e.selectable,P=O(y),{textVerticalResizeEnabled:M}=w.flags,R=w.flags.autoDeleteEmptyText,A=O(e.fontFamily),[z,N]=i.useState([]);i.useEffect(()=>{var e,t;let r=null!==(t=null===(e=n.current)||void 0===e?void 0:e.textArr)&&void 0!==t?t:[];JSON.stringify(r)!==JSON.stringify(z)&&N(r)}),i.useEffect(()=>{if(e.a.width||"tablecell"===e.type)return;let t=n.current;t.width(600),e.set({width:1.4*t.getTextWidth()})},[]),i.useEffect(()=>{P&&!y&&R&&""===e.text&&e.removable&&!e.placeholder&&t.deleteElements([e.id])},[R,e.placeholder,e.removable,e.text,y,P]),i.useLayoutEffect(()=>(0,s.EH)(()=>{let t=n.current;(0,E.R)(t,e)})),i.useEffect(()=>{let e=l.current;e.length>0&&(l.current=[],e.forEach(e=>e()))});let F=(0,x.av)(e.text);"uppercase"===e.textTransform&&(F=F.toUpperCase());let[B]=_(t,e.fontFamily,e.fontStyle,e.fontWeight,e.text||e.placeholder),H=()=>{if(e.curveEnabled){let e=r.current;return e.getSelfRect().height||e.fontSize()}let t=n.current.clone({height:void 0}),i=Math.ceil(t.fontSize()*t.lineHeight()*t.textArr.length+1);return t.destroy(),i};i.useLayoutEffect(()=>{if(!B)return;if("tablecell"===e.type){let{textOverflow:r}=w.flags;if("resize"===r){let t=H(),n=(0,T.fh)(e)?(0,T.G_)(e,2):null;(null==n?void 0:n.setCellContentHeight)&&n.setCellContentHeight(e.id,t)}else if("change-font-size"===r){let r=n.current;if(r){let n=D(r,e,w.flags.textSplitAllowed);n!==e.fontSize&&t.history.ignore(()=>{e.set({fontSize:n})})}}return}let{textOverflow:r,textSplitAllowed:i}=w.flags,a=(n,r,i,a)=>{let o=(0,b.aM)(`text ${e.id}`),s=()=>{t.history.ignore(n,r,i).then(()=>{l.current.push(o),c()})};a?queueMicrotask(s):s()};if(!e.height){let t=H();return void a(()=>{e.height||e.set({height:t})},void 0,void 0,!0)}if(!t.isPlaying){if("change-font-size"!==r||h){if("resize"===r){let t=H();M&&e.height<t&&!h&&a(()=>{var r;(0,T.fh)(e)&&e.set({height:t}),null===(r=n.current)||void 0===r||r.height(t)},!1,!0),M||e.height===t||h||a(()=>{var r;(0,T.fh)(e)&&e.set({height:t}),null===(r=n.current)||void 0===r||r.height(t)},!1,!0)}}else{let t=D(n.current,e,i);if(t!==e.fontSize)return void a(()=>{e.set({fontSize:t})},!1,!0);let r=H();e.height===r||M||a(()=>{e.set({height:r})},!1,!0)}}}),i.useLayoutEffect(()=>{var t;if(B&&e.curveEnabled){let n=null===(t=r.current)||void 0===t?void 0:t.getSelfRect().width;if(n){let t=n-e.a.width,r=e.a.rotation*Math.PI/180;e.set({width:n,x:e.a.x+-t/2*Math.cos(r),y:e.a.y+-t/2*Math.sin(r)})}}},[B,e.curveEnabled,e.curvePower,e.text,e.fontSize,e.fontFamily,e.fontWeight,e.fontStyle,e.letterSpacing]),i.useLayoutEffect(()=>{let t=n.current;t&&(t.width(t.width()+1e-8),t.width(t.width()-1e-8),t._setTextData(),(0,E.R)(t,e))},[B]);let V=i.useRef(null),j=i.useRef(0),$=n=>{n.evt.preventDefault(),t.selectedShapes.find(t=>t===e)&&e.contentEditable&&(j.current=function(e){var t,n,r;let i=e.target,a=((n=i.getAbsoluteTransform().copy()).invert(),r=i.getStage().getPointerPosition(),n.point(r)),o=i.textArr,l=Math.floor(a.y/(i.fontSize()*i.lineHeight())),s=o.slice(0,l).reduce((e,t)=>e+t.text.length,l),c=null!==(t=o[l])&&void 0!==t?t:o[0],u=0;return"right"===i.align()?u=i.width()-c.width:"center"===i.align()&&(u=i.width()/2-c.width/2),s+Math.round((a.x-u)/c.width*c.text.length)}(n),e.toggleEditMode())},U=!F&&e.placeholder?.6:e.a.opacity;(0,k.QU)(n,U);let W=I({fontLoaded:B,fontFamily:e.fontFamily,fontSize:e.a.fontSize,lineHeight:e.lineHeight}),G=e.selectable||"admin"===t.role,q=(0,v.r)(e),Z=(0,v.r)(e,e.stroke,"stroke"),X=i.useMemo(()=>e.backgroundEnabled?e.curveEnabled?function({width:e,height:t,padding:n=0,cornerRadius:r=0}){let i=-n,a=-n,o=e+n,l=t+n;return g(m(`M ${i} ${a} L ${o} ${a} L ${o} ${l} L ${i} ${l} Z`),r).path}({width:e.a.width,height:e.a.height,cornerRadius:e.backgroundCornerRadius*(e.a.fontSize*W*.5),padding:e.backgroundPadding*(e.a.fontSize*W*.5)}):function({lines:e,lineHeight:t,width:n,align:r="left",padding:i=0,cornerRadius:a=0}){var o;e.forEach((e,t)=>
88{e.cx=n/2,"right"===r?e.cx=n-e.width/2:"left"===r&&(e.cx=e.width/2),"justify"!==r||e.lastInParagraph||(e.width=n),"justify"===r&&(e.cx=e.width/2)});let l=`M ${null===(o=e[0])||void 0===o?void 0:o.cx} ${-i}`;e.forEach((n,r)=>{let{cx:a}=n,o=e[r-1];o&&o.width>n.width?l+=` L ${a+n.width/2+i} ${r*t+i}`:l+=` L ${a+n.width/2+i} ${r*t-i}`;let s=e[r+1];s&&s.width>n.width?l+=` L ${a+n.width/2+i} ${(r+1)*t-i}`:l+=` L ${a+n.width/2+i} ${(r+1)*t+i}`});for(var s=e.length-1;s>=0;s--){let n=e[s],{cx:r}=n,a=e[s+1];a&&a.width>n.width?l+=` L ${r-n.width/2-i} ${(s+1)*t-i}`:l+=` L ${r-n.width/2-i} ${(s+1)*t+i}`;let o=e[s-1];o&&o.width>n.width?l+=` L ${r-n.width/2-i} ${s*t+i}`:l+=` L ${r-n.width/2-i} ${s*t-i}`}return g(m(l+=" Z"),a).path}({lines:JSON.parse(JSON.stringify(z)),cornerRadius:e.backgroundCornerRadius*(e.a.fontSize*W*.5),lineHeight:W*e.a.fontSize,padding:e.backgroundPadding*(e.a.fontSize*W*.5),width:e.a.width,align:e.align}):"",[e.backgroundEnabled,e.curveEnabled,e.backgroundCornerRadius,e.a.fontSize,e.a.height,W,e.backgroundPadding,e.a.width,e.align,z]),Y=(0,S.b1)(),K=0;e.curveEnabled||("middle"===e.verticalAlign?K=(e.a.height-z.length*W*e.a.fontSize)/2:"bottom"===e.verticalAlign&&(K=e.a.height-z.length*W*e.a.fontSize));let J=e.curveEnabled?(0,C.A5)(e.a.width,e.a.height,e.curvePower,e.a.fontSize):"",Q=B?'"'+e.fontFamily+'"':A===e.fontFamily?"Arial":'"'+A+'"';return i.createElement(i.Fragment,null,i.createElement(o.y$,{ref:a,x:e.a.x,y:e.a.y,rotation:e.a.rotation,hideInExport:!e.showInExport,listening:!1,visible:e.backgroundEnabled,opacity:e.backgroundOpacity*U,data:X,fill:e.backgroundColor,offsetY:-K}),i.createElement(o.y$,{data:J,stroke:"red",strokeWidth:1,x:e.a.x,y:e.a.y,rotation:e.a.rotation,visible:!1}),i.createElement(o.XF,Object.assign({ref:r,visible:e.curveEnabled,data:J,text:F||e.placeholder,listening:!1,align:"center",textBaseline:"middle"},q,Z,{strokeWidth:e.strokeWidth,lineJoin:"round",fillAfterStrokeEnabled:!0,fontSize:e.a.fontSize,fontFamily:`"${e.fontFamily}", "${A}"`,fontStyle:e.fontStyle+" "+e.fontWeight,textDecoration:e.textDecoration.trim(),letterSpacing:e.letterSpacing*e.a.fontSize,x:e.a.x,y:e.a.y,rotation:e.a.rotation,opacity:e._editModeEnabled?.3:U,hideInExport:!e.showInExport,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity})),i.createElement(o.xv,Object.assign({ref:n,id:e.selectable?e.id:void 0,name:e.selectable?"element":"",hideInExport:!e.showInExport,editModeEnabled:e._editModeEnabled,x:e.a.x,y:e.a.y,rotation:e.a.rotation,width:e.a.width,height:e.a.height,text:F||e.placeholder,direction:(0,C.XP)(F)},q,Z,{lineJoin:"round",strokeWidth:e.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:e.a.fontSize,fontFamily:Q,fontStyle:e.fontStyle+" "+e.fontWeight,textDecoration:e.textDecoration,align:e.align,verticalAlign:e.verticalAlign,draggable:Y?e.draggable&&y:e.draggable,preventDefault:!Y||y,opacity:e.curveEnabled?0:U,visible:!e._editModeEnabled,ellipsis:"ellipsis"===w.flags.textOverflow,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,lineHeight:W,letterSpacing:e.letterSpacing*e.a.fontSize,listening:!!e.selectable&&G,onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},onClick:$,onTap:$,onTransformStart:()=>{f(!0),p.current=n.current.height()},onTransform:t=>{var n,r,i;let o=t.target;null===(n=a.current)||void 0===n||n.setAttrs({x:o.x(),y:o.y(),rotation:o.rotation(),scale:o.scale()});let l=(null===(r=o.getStage())||void 0===r?void 0:r.findOne("Transformer")).getActiveAnchor();if("middle-left"===l||"middle-right"===l){let t=o.scaleX(),n=o.width()*t,r=e.a.fontSize,i=n;n<r&&(i=r,V.current&&o.position(V.current)),o.width(i),o.scaleX(1),o.scaleY(1);let a=H();if("ellipsis"===w.flags.textOverflow)a=p.current;else{let t=Math.max(a,p.current);o.height(t),e.set({height:o.height()})}let l=w.flags.textVerticalResizeEnabled?Math.max(a,p.current):H();e.set({x:o.x(),width:o.width(),rotation:o.rotation(),height:l}),(0,E.R)(o,e)}if("top-center"===l||"bottom-center"===l){let n="resize"===w.flags.textOverflow?H():W*e.a.fontSize;t.target.height(Math.max(n,t.target.height()*t.target.scaleY())),t.target.scaleY(1)}V.current=t.target.position();let s=t.target.scaleX();null===(i=a.current)||void 0===i||i.setAttrs({scaleX:1,scaleY:1}
88),t.target.scaleX(1),t.target.scaleY(1),e.set({fontSize:e.a.fontSize*s,width:t.target.width()*s,x:t.target.x(),y:t.target.y(),rotation:t.target.rotation(),height:t.target.height()*s,shadowBlur:e.shadowBlur*s,shadowOffsetX:e.shadowOffsetX*s,shadowOffsetY:e.shadowOffsetY*s,strokeWidth:e.strokeWidth*s})},onTransformEnd:t=>{var n;let r=t.target.scaleX();t.target.scaleX(1),t.target.scaleY(1),e.set({fontSize:Math.round(e.a.fontSize*r),width:Math.ceil(t.target.width()*r),x:t.target.x(),y:t.target.y(),rotation:t.target.rotation(),height:t.target.height()*r,shadowBlur:e.shadowBlur*r,shadowOffsetX:e.shadowOffsetX*r,shadowOffsetY:e.shadowOffsetY*r,strokeWidth:e.strokeWidth*r}),null===(n=a.current)||void 0===n||n.setAttrs({scaleX:1,scaleY:1}),f(!1)}})),u&&e.contentEditable&&i.createElement(o.ZA,{x:e.a.x,y:e.a.y,rotation:e.a.rotation},i.createElement(L,{textNodeRef:n,element:e,selectAll:d,cursorPosition:j.current,onBlur:()=>{e.toggleEditMode(!1)}})))})},90337:function(e,t,n){"use strict";n.d(t,{e:function(){return o}});var r=n(8585),i=n(26436);function a(e){if((0,i.H)(e))return function(e){try{let{stops:t}=(0,i.l)(e);if(0===t.length)return 127.5;let n=0,a=0;for(let e of t)try{let t=r.Z.Util.colorToRGBA(e.color);if(!t||t.a<.5)continue;n+=(299*t.r+587*t.g+114*t.b)/1e3,a++}catch(e){continue}return 0===a?127.5:n/a}catch(e){return console.warn("Error calculating gradient brightness:",e),127.5}}(e);let t=r.Z.Util.colorToRGBA(e);if(!t)return 127.5;let{r:n,g:a,b:o}=t;return(299*n+587*a+114*o)/1e3}function o(e){let{outlineSize:t,outlineColor:n}=function(e){let t=e.strokeWidth||0;return t>0?{outlineSize:t,outlineColor:e.stroke}:{outlineSize:e.shadowEnabled&&e.shadowBlur>0&&e.shadowOpacity>.1?e.shadowBlur*e.shadowOpacity:0,outlineColor:e.shadowColor}}(e);return t<.001?e.fill:Math.abs(a(e.fill)-a(n))>=50?n:e.fill}},21653:function(e,t,n){"use strict";function r({oldText:e,newText:t,element:n}){if(!(t.length/Math.max(20,e.length)>=4))return n.fontSize;let r=n.width*n.page.computedHeight/t.length;return Math.min(n.fontSize,Math.max(5,Math.round(1.5*Math.sqrt(r))))}n.d(t,{W:function(){return r}})},8803:function(e,t,n){"use strict";n.d(t,{r:function(){return o}});var r=n(7653),i=n(26436),a=n(8585);let o=(e,t,n)=>{var o;return void 0===t&&(t=null!==(o=e.fill)&&void 0!==o?o:""),void 0===n&&(n="fill"),r.useMemo(()=>{if(!i.H(t))return{[n]:t};let{stops:r,rotation:o}=i.l(t),l=e.a.width/2,s=e.a.height/2,c=(o%180+180)%180,u=c>45&&c<135?e.a.width:e.a.height,d=a.Z.Util.degToRad(o)-Math.PI/2,h=[];return r.forEach(({offset:e,color:t})=>{h.push(e,t)}),"fill"===n?{fillLinearGradientStartPointX:l-u/2*Math.cos(d),fillLinearGradientStartPointY:s-u/2*Math.sin(d),fillLinearGradientColorStops:h,fillLinearGradientEndPointX:l+u/2*Math.cos(d),fillLinearGradientEndPointY:s+u/2*Math.sin(d),fill:r[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:l-u/2*Math.cos(d),strokeLinearGradientStartPointY:s-u/2*Math.sin(d),strokeLinearGradientColorStops:h,strokeLinearGradientEndPointX:l+u/2*Math.cos(d),strokeLinearGradientEndPointY:s+u/2*Math.sin(d)}},[t,e.width,e.height])}},83063:function(e,t,n){"use strict";n.d(t,{$:function(){return i}});var r=n(7653);let i=(e,t=100,n=!1,i)=>{let a=r.useRef(null!=i?i:e),[,o]=r.useReducer(e=>e+1,0),l=r.useCallback(e=>{a.current!==e&&(a.current=e,o())},[a]),s=r.useRef(null);return e===n&&(s.current&&(clearTimeout(s.current),s.current=null),a.current=n),r.useEffect(()=>(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{l(e),s.current=null},t),()=>{s.current&&clearTimeout(s.current)}),[e,t,n]),[a.current,l]}},36677:function(e,t,n){"use strict";n.d(t,{QU:function(){return a},w_:function(){return i}});var r=n(7653);n(8585);let i=()=>!1;function a(e,t){let n=r.useRef();r.useLayoutEffect(()=>{n.current&&n.current.destroy()},[t]),r.useLayoutEffect(()=>{},[])}},77922:function(e,t,n){"use strict";n.d(t,{D_:function(){return d},de:function(){return h},o_:function(){return u}});var r=n(7653),i=n(8585),a=n(57042);let o={stroke:"rgb(0, 161, 255)",strokeWidth:1,dash:[4,6]},l=({stroke:e,strokeWidth:t,dash:n})=>{void 0!==e&&(o.stroke=e),void 0!==t&&(o.strokeWidth=t),void 0!==n&&(o.dash=n)},s=({targetKonvaNodes:e,guideKonvaNode:t,distance:n,snapDirection:r})=>n<5;function c(e,t){var n=[],r=[];
88e.vertical.forEach(e=>{t.vertical.forEach(t=>{var r=Math.abs(e.offset-t.guide);s({targetKonvaNodes:t.nodes,guideKonvaNode:e.node,distance:r,snapDirection:e.snap})&&n.push({lineGuide:e.offset,diff:r,snap:t.snap,offset:t.offset})})}),e.horizontal.forEach(e=>{t.horizontal.forEach(t=>{var n=Math.abs(e.offset-t.guide);s({targetKonvaNodes:t.nodes,guideKonvaNode:e.node,distance:n,snapDirection:e.snap})&&r.push({lineGuide:e.offset,diff:n,snap:t.snap,offset:t.offset})})});var i=[];let a=n.sort((e,t)=>e.diff-t.diff),o=r.sort((e,t)=>e.diff-t.diff);var l=a[0],c=o[0];return l&&a.filter(e=>.1>Math.abs(e.diff-l.diff)).forEach(e=>{i.push(Object.assign({orientation:"V"},e))}),c&&o.filter(e=>.1>Math.abs(e.diff-c.diff)).forEach(e=>{i.push(Object.assign({orientation:"H"},e))}),i}let u=()=>{if(0===i.Z.DD._dragElements.size)return;let e=[...i.Z.DD._dragElements.entries()],t=e.find(([e,t])=>t.node instanceof i.Z.Transformer);t&&(e.splice(e.indexOf(t),1),e.unshift(t),i.Z.DD._dragElements.clear(),e.forEach(([e,t])=>{i.Z.DD._dragElements.set(e,t)}))};function d(e,t,n){let s=r.useRef(null);n&&l(n);let d=e=>e.hasName("element")||e.hasName("page-background")||!s.current&&e.hasName("elements-area");function h(t){var n;let r=null===(n=e.current)||void 0===n?void 0:n.getStage(),i=[],a=[];return r.find(d).forEach(e=>{if(!(t.indexOf(e)>=0)){var n=e.getClientRect({skipShadow:!0,skipStroke:!0});i.push({offset:n.x,node:e,snap:"start"},{offset:n.x+n.width,node:e,snap:"end"},{offset:n.x+n.width/2,node:e,snap:"center"}),a.push({offset:n.y,node:e,snap:"start"},{offset:n.y+n.height,node:e,snap:"end"},{offset:n.y+n.height/2,node:e,snap:"center"})}}),{vertical:i,horizontal:a}}function m(t){var n;let r=null===(n=e.current)||void 0===n?void 0:n.getLayer(),a=null==r?void 0:r.children.find(e=>"line-guides"===e.name());t.forEach(e=>{if("H"===e.orientation){var t=new i.Z.Line({x:-r.getStage().x(),y:-r.getStage().y(),points:[-6e3,e.lineGuide,6e3,e.lineGuide],stroke:o.stroke,strokeWidth:o.strokeWidth,name:"guid-line",dash:o.dash});null==a||a.add(t),r.batchDraw()}else"V"===e.orientation&&(t=new i.Z.Line({x:-r.getStage().x(),y:-r.getStage().y(),points:[e.lineGuide,-6e3,e.lineGuide,6e3],stroke:o.stroke,strokeWidth:o.strokeWidth,name:"guid-line",dash:o.dash}),null==a||a.add(t))})}let g=e=>{let t=e.target.getLayer().children.find(e=>"line-guides"===e.name());null==t||t.destroyChildren();var n=c(h(e.target.nodes()),function(e){let t=e.__getNodeRect(),n=(0,a.VK)(Object.assign(Object.assign({},t),{rotation:i.Z.Util.radToDeg(t.rotation)})),r=e.getAbsolutePosition();return{vertical:[{guide:n.x,offset:r.x-n.x,snap:"start",nodes:e.nodes()},{guide:n.x+n.width/2,offset:r.x-n.x-n.width/2,snap:"center",nodes:e.nodes()},{guide:n.x+n.width,offset:r.x-n.x-n.width,snap:"end",nodes:e.nodes()}],horizontal:[{guide:n.y,offset:r.y-n.y,snap:"start",nodes:e.nodes()},{guide:n.y+n.height/2,offset:r.y-n.y-n.height/2,snap:"center",nodes:e.nodes()},{guide:n.y+n.height,offset:r.y-n.y-n.height,snap:"end",nodes:e.nodes()}]}}(e.target));if(!n.length)return;m(n);let r=e.target.getAbsolutePosition(),o=(e.target.nodes().map(e=>e.getAbsolutePosition()),Object.assign({},r));n.forEach(e=>{switch(e.snap){case"start":case"center":case"end":switch(e.orientation){case"V":o.x=e.lineGuide+e.offset;break;case"H":o.y=e.lineGuide+e.offset}}});let l=o.x-r.x,s=o.y-r.y;e.evt.ctrlKey||e.evt.metaKey||e.target.nodes().forEach(e=>{let t=e.getAbsolutePosition();e.setAbsolutePosition({x:t.x+l,y:t.y+s})})},v=(t,n,r)=>{let i=e.current,a=i.getLayer().children.find(e=>"line-guides"===e.name());if(null==a||a.destroyChildren(),"rotater"===i.getActiveAnchor())return n;let o=p[i.getActiveAnchor()],l=null===(g=i.findOne(`.${o}`))||void 0===g?void 0:g.getAbsolutePosition();if(!l)return n;let s={x:t.x-l.x,y:t.y-l.y},u=function(e,t){let n=f(e,t)/f(t,t);return{x:n*t.x,y:n*t.y}}({x:n.x-t.x,y:n.y-t.y},s);if(Math.sqrt(Math.pow(u.x,2)+Math.pow(u.y,2))>5)return n;let d={x:t.x+u.x,y:t.y+u.y};var g,v=c(h(i.nodes()),{vertical:[{guide:d.x,offset:0,snap:"start",nodes:i.nodes()}],horizontal:[{guide:d.y,offset:0,snap:"start",nodes:i.nodes()}]});if(!v.length||(m(v),r.ctrlKey||r.metaKey))return n;let b=[];
88if(v.forEach(e=>{let t=function(e,t,n){if("V"===n.orientation){let r=n.lineGuide;if(1e-4>Math.abs(t.x-e.x))return null;let i=(t.y-e.y)/(t.x-e.x);return{x:r,y:i*r+(e.y-i*e.x)}}{let r=n.lineGuide;if(1e-4>Math.abs(t.y-e.y))return null;let i=(t.y-e.y)/(t.x-e.x);return{x:(r-e.y)/i+e.x,y:r}}}(d,l,{orientation:e.orientation,lineGuide:e.lineGuide});t&&b.push(t)}),b.length>0){let e=b[0],t=Math.sqrt(Math.pow(d.x-e.x,2)+Math.pow(d.y-e.y,2));if(b.forEach(n=>{let r=Math.sqrt(Math.pow(d.x-n.x,2)+Math.pow(d.y-n.y,2));r<t&&(t=r,e=n)}),t<10)return e}return d},b=e=>{if(!e.target)return;let t=e.target.getLayer(),n=t.children.find(e=>"line-guides"===e.name());null==n||n.destroyChildren(),t.batchDraw()};r.useEffect(()=>{e.current&&(e.current.anchorDragBoundFunc(v),e.current.on("dragstart",e=>{setTimeout(()=>{u()})}),e.current.on("dragmove",g),e.current.on("dragend",b),e.current.on("transformend",b),e.current.on("transform",t=>{var n,r;t.evt.ctrlKey||t.evt.metaKey?null===(n=e.current)||void 0===n||n.rotationSnapTolerance(0):null===(r=e.current)||void 0===r||r.rotationSnapTolerance(5)}))},[])}function h(e,t,n){let a=e=>e.hasName("element")||e.hasName("line-anchor")||e.hasName("page-background")||e.hasName("elements-area"),l=n=>{let r=n.target.getLayer().children.find(e=>"line-guides"===e.name());null==r||r.destroyChildren();var l,s=c(function(t){let n=null===(r=e.current)||void 0===r?void 0:r.getStage();var r,i=[],o=[];return n.find(a).forEach(e=>{if(!(t.indexOf(e)>=0)){var n=e.getClientRect({skipShadow:!0,skipStroke:!0});e.hasName("line-anchor")&&(n={x:e.absolutePosition().x,y:e.absolutePosition().y,width:0,height:0}),i.push({offset:n.x,node:e,snap:"start"},{offset:n.x+n.width,node:e,snap:"end"},{offset:n.x+n.width/2,node:e,snap:"center"}),o.push({offset:n.y,node:e,snap:"start"},{offset:n.y+n.height,node:e,snap:"end"},{offset:n.y+n.height/2,node:e,snap:"center"})}}),{vertical:i,horizontal:o}}([n.target,...t.map(e=>e.current)]),{vertical:[{guide:(l=n.target).absolutePosition().x,offset:0,snap:"center",nodes:[l]}],horizontal:[{guide:l.absolutePosition().y,offset:0,snap:"center",nodes:[l]}]});if(!s.length)return;!function(t){var n;let r=null===(n=e.current)||void 0===n?void 0:n.getLayer(),a=null==r?void 0:r.children.find(e=>"line-guides"===e.name());t.forEach(e=>{if("H"===e.orientation){var t=new i.Z.Line({x:-r.getStage().x(),y:-r.getStage().y(),points:[-6e3,e.lineGuide,6e3,e.lineGuide],stroke:o.stroke,strokeWidth:o.strokeWidth,name:"guid-line",dash:o.dash});null==a||a.add(t),r.batchDraw()}else"V"===e.orientation&&(t=new i.Z.Line({x:-r.getStage().x(),y:-r.getStage().y(),points:[e.lineGuide,-6e3,e.lineGuide,6e3],stroke:o.stroke,strokeWidth:o.strokeWidth,name:"guid-line",dash:o.dash}),null==a||a.add(t))})}(s);let u=n.target.getAbsolutePosition(),d=Object.assign({},u);s.forEach(e=>{switch(e.snap){case"start":case"center":case"end":switch(e.orientation){case"V":d.x=e.lineGuide+e.offset;break;case"H":d.y=e.lineGuide+e.offset}}});let h=d.x-u.x,f=d.y-u.y;if(!n.evt.ctrlKey&&!n.evt.metaKey){let e=n.target.getAbsolutePosition();n.target.absolutePosition({x:e.x+h,y:e.y+f})}},s=e=>{if(!e.target)return;let t=e.target.getLayer(),n=t.children.find(e=>"line-guides"===e.name());null==n||n.destroyChildren(),t.batchDraw()};r.useEffect(()=>{e.current&&(e.current.on("dragmove",l),e.current.on("dragend",s))},n)}function f(e,t){return e.x*t.x+e.y*t.y}let p={"top-left":"bottom-right","top-center":"bottom-center","top-right":"bottom-left","middle-right":"middle-left","bottom-right":"top-left","bottom-center":"top-center","bottom-left":"top-right","middle-left":"middle-right"}},3942:function(e,t,n){"use strict";n.d(t,{Z:function(){return eI}});var r=n(7653),i=n(2027),a=n(35219),o=n(57042),l=n(27588),s=n(16812);let c=(0,s.zo)("div",r.forwardRef)` 89 position: absolute; 90 top: 0; 91 left: 0; 92 pointer-events: none; 93`,u=(0,s.zo)("div",r.forwardRef)` 94 height: 14px; 95 position: sticky; 96 font-size: 8px; 97 line-height: 14px; 98 top: 0; 99 left: 0; 100 color: grey; 101 border-bottom: 1px solid grey; 102 background-color: #e8e8e8; 103 overflow: hidden; 104`,d=(0,s.zo)("div",r.forwardRef)` 105 left: 0; 106 width: 14px; 107 position: sticky; 108 font-size: 8px; 109 line-height: 14px; 110 color: grey; 111 border-right: 1px solid grey; 112 background-color: #e8e8e8; 113 overflow: hidden; 114`,h=(0,s.zo)("div",r.forwardRef)` 115 position: absolute; 116 border-left: 1px solid grey; 117 padding-left: 2px; 118`,f=(0,s.zo)("div",r.forwardRef)` 119 position: absolute; 120 left: 14px; 121 border-left: 1px solid grey; 122 padding-left: 2px; 123 transform: rotate(90deg); 124 transform-origin: left top; 125 overflow: hidden; 126`,p=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4],m=(0,i.Pi)(({store:e,width:t,height:n,pageSizes:i,layout:a="vertical",renderOnlyActivePage:s,rulerBackgroun
126dColor:m,rulerTextColor:g,rulerBorderColor:v,rulerBorderSize:b,rulerTickColor:y,rulerTickSize:w})=>{var x;let C=r.useRef(null);if(!e.activePage)return null;let E=e.activePage,k=(e.bleedVisible&&E.bleed,E.computedWidth*e.scale),S=E.computedHeight*e.scale,T=(t-k)/2,P=(n-S)/2,M=(x=t=>(0,l.LU)({unitVal:t,dpi:e.dpi,unit:e.unit})*e.scale,p.find(e=>x(e)>30)||1e4),R=(0,l.LU)({unitVal:M,dpi:e.dpi,unit:e.unit})*e.scale,A=Math.round(k/R)+1,L=Math.round(S/R)+1,_=(0,o.Ne)(e.selectedShapes),I=m||"#e8e8e8",O=g||"grey",D=v||"grey",z=null!=b?b:1,N=y||"grey",F=null!=w?w:1;return r.createElement(c,{ref:C,className:"polotno-rulers",style:{display:"flex",flexDirection:"column"}},"horizontal"===a?r.createElement(r.Fragment,null,r.createElement("div",{style:{display:"flex",flexDirection:"row",position:"sticky",top:0,zIndex:1}},r.createElement("div",{className:"polotno-ruler-corner",style:{width:"14px",height:"14px",flexShrink:0,backgroundColor:I,borderRight:`${z}px solid ${D}`,borderBottom:`${z}px solid ${D}`,position:"sticky",left:0,zIndex:2}}),(s?[e.activePage]:e.pages).map((n,a)=>{var o;if(!n)return null;let l=i?i[a]:t,s=(l-n.computedWidth*e.scale)/2;return r.createElement(u,{key:n.id,style:{width:l+"px",flexShrink:0,position:"relative",backgroundColor:I,color:O,borderBottom:`${z}px solid ${D}`},className:"polotno-x-ruler"},[...Array(A)].map((t,n)=>r.createElement(h,{key:n,className:"polotno-ruler-tick",style:{left:s+n*R+"px",width:R+"px",borderLeft:`${F}px solid ${N}`}},"px"===e.unit||M>=1?Math.round(M*n):(M*n).toFixed(1))),(null===(o=e.selectedShapes[0])||void 0===o?void 0:o.page)===n&&r.createElement("div",{className:"polotno-ruler-selection",style:{position:"absolute",left:s+_.x*e.scale+"px",height:"14px",width:_.width*e.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))})),r.createElement(d,{style:{height:n+"px",position:"sticky",left:0,marginTop:"-14px",backgroundColor:I,color:O,borderRight:`${z}px solid ${D}`},className:"polotno-y-ruler"},[...Array(L)].map((t,n)=>r.createElement(f,{key:n,className:"polotno-ruler-tick",style:{to
126p:P+n*R+"px",width:R+"px",borderLeft:`${F}px solid ${N}`}},"px"===e.unit||M>=1?Math.round(M*n):(M*n).toFixed(1))),!!e.selectedShapes.length&&r.createElement("div",{className:"polotno-ruler-selection",style:{position:"absolute",top:P+_.y*e.scale+"px",width:"14px",height:_.height*e.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))):r.createElement(r.Fragment,null,r.createElement(u,{style:{width:t+"px",backgroundColor:I,color:O,borderBottom:`${z}px solid ${D}`},className:"polotno-x-ruler"},[...Array(A)].map((t,n)=>r.createElement(h,{key:n,className:"polotno-ruler-tick",style:{left:T+n*R+"px",width:R+"px",borderLeft:`${F}px solid ${N}`}},"px"===e.unit||M>=1?Math.round(M*n):(M*n).toFixed(1))),!!e.selectedShapes.length&&r.createElement("div",{className:"polotno-ruler-selection",style:{position:"absolute",left:T+_.x*e.scale+"px",height:"14px",width:_.width*e.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),(s?[e.activePage]:e.pages).map((t,a)=>{var o;if(!t)return null;let l=i?i[a]:n,s=(l-t.computedHeight*e.scale)/2,c=0===a?14:0;return r.createElement(d,{key:t.id,style:{height:l-c+"px",backgroundColor:I,color:O,borderRight:`${z}px solid ${D}`},className:"polotno-y-ruler"},[...Array(L)].map((t,n)=>r.createElement(f,{key:n,className:"polotno-ruler-tick",style:{to
126p:s+n*R-c+"px",width:R+"px",borderLeft:`${F}px solid ${N}`}},"px"===e.unit||M>=1?Math.round(M*n):(M*n).toFixed(1))),(null===(o=e.selectedShapes[0])||void 0===o?void 0:o.page)===t&&r.createElement("div",{className:"polotno-ruler-selection",style:{position:"absolute",top:s+_.y*e.scale-c+"px",width:"14px",height:_.height*e.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))})))});var g=n(59533);let v=(0,i.Pi)(({audio:e,store:t})=>{let[n,i]=function(e){let[t,n]=r.useState(null),[i,a]=r.useState("loading");return r.useEffect(()=>{let t=new Audio(e),r=()=>{a("loaded"),n(t)},i=()=>{a("failed"),n(null)};return t.addEventListener("canplay",r),t.addEventListener("error",i),()=>{t.removeEventListener("canplay",r),t.removeEventListener("error",i)}},[e]),[t,i]}(e.src);return r.useEffect(()=>{n&&t.history.ignore(()=>{e.set({duration:1e3*n.duration})})},[n,e,t.history]),r.useEffect(()=>{if(!n)return;let r=()=>{n.currentTime=e.startTime*e.duration/1e3},i=()=>{let t=e.endTime*e.duration/1e3;n.currentTime>=t&&(n.pause(),n.currentTime=e.startTime*e.duration/1e3)};n.addEventListener("ended",r),n.addEventListener("timeupdate",i);let a=(0,g.EH)(()=>{let r=t.animatedElementsIds;if(r.length&&!r.includes(e.id))return;let i=t.currentTime-e.delay,a=e.duration*(e.endTime-e.startTime);if(!t.isPlaying||0!==t.animatedElementsIds.length||!(i>=0&&i<a))return void n.pause();n.volume=e.volume,n.paused&&n.play();let o=i%a/1e3+e.startTime*e.duration/1e3,l=n.currentTime;Math.abs(l-o)>.5&&o!==l&&(n.currentTime=o)});return()=>{n.pause(),n.removeEventListener("ended",r),n.removeEventListener("timeupdate",i),a()}},[t.isPlaying,e.startTime,e.endTime,e.volume,n]),null});var b=n(28117);let y={data:[],pageId:""},w="polotno_clipboard",x=(e,t)=>{y={data:JSON.parse(JSON.stringify(e)),pageId:t||""};try{localStorage.setItem(w,JSON.stringify(e)),localStorage.setItem(w+"_page",t||"")}catch(e){}},C=()=>{try{let e=localStorage.getItem(w),t=localStorage.getItem(w+"_page");if(e)return{data:JSON.parse(e),pageId:t}}catch(e){}return y},E=e=>{var t;0!==e.selectedElements.length&&x(e.selectedElements.map(e=>e.toJSON()),null===(t=e.activePage)||void 0===t?void 0:t.id)},k=e=>{var t;x(e.selectedElements.map(e=>e.toJSON()),null===(t=e.activePage)||void 0===t?void 0:t.id);let n=e.selectedElements.filter(e=>e.removable).map(e=>e.id);e.deleteElements(n)},S=e=>{e.history.transaction(()=>{var t,n;let r=0,i=0,{data:a,pageId:l}=C();if(l===(null===(t=e.activePage)||void 0===t?void 0:t.id))r=e.width/20,i=e.height/20;else{let t=[];(0,b.lc)({children:a},e=>{"group"!==e.type&&t.push(e)});let n=(0,o.Ne)(t);n.maxX>e.width&&(r=-n.minX),n.maxY>e.height&&(i=-n.minY)}let s=[];(0,b.lc)({children:a},e=>{delete e.id,"group"!==e.type&&(e.x+=r,e.y+=i)}),a.forEach(t=>{var n;let r=null===(n=e.activePage)||void 0===n?void 0:n.addElement(t);r&&s.push(r.id)}),x(a,null===(n=e.activePage)||void 0===n?void 0:n.id),e.selectElements(s)})};var T=n(76229),P=n(45256),M=n(94877);let R="rgba(191, 191, 191, 100)";function A(e,t,n){let r=e.getCell(t,n);r&&e.focusCell(r.id)}function L(e,t,n){let r=e.getCell(t,n);r&&e.enterCellEdit(r.id)}var _=n(54043);let I=(e,t,n)=>Math.max(t,Math.min(n,e)),O=(e,t)=>Math.sqrt(Math.pow(t.clientX-e.clientX,2)+Math.pow(t.clientY-e.clientY,2)),D=({store:e})=>r.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},r.createElement("p",null,(0,_.t)("workspace.noPages")),r.createElement("button",{onClick:()=>{e.addPage()}},(0,_.t)("workspace.addPage"))),z=({width:e,height:t,xPadding:n,yPadding:i,backgroundColor:a})=>r.createElement("div",{style:{width:e+"px",height:t+"px",backgroundColor:a,paddingLeft:n+"px",paddingRight:n+"px",paddingTop:i+"px",paddingBottom:i+"px",flexShrink:0}},r.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}})),N=[4,6],F=(0,i.Pi)(({store:e,layout:t="vertical",pageControlsEnabled:n,backgroundColor:i,transparencyBackgroundColor:o,pageBorderColor:l,activePageBorderColor:s,bleedColor:c,snapGuideStroke:u,snapGuideStrokeWidth:d,snapGuideDash:h,selectionRectFill:f,selectionRectStroke:p,selectionRectStrokeWidth:g,transformLabelFill:b,transformLabelTextFill:y,distanceGuideStroke:w,distanceLabelFill:x,distanceLabelTextFill:C,rulerBackgroun
126dColor:_,rulerTextColor:F,rulerBorderColor:B,rulerBorderSize:H,rulerTickColor:V,rulerTickSize:j,components:$,onKeyDown:U,paddingX:W,paddingY:G,pageGap:q,altCloneEnabled:Z=!0,visiblePagesOffset:X,renderOnlyActivePage:Y,tooltipSafeArea:K})=>{var J;let Q,ee;let et="horizontal"===t,en=null!=W?W:20,er=null!=G?G:55,[ei,ea]=r.useState({width:100,height:100}),eo=r.useRef(ei),el=r.useRef(null),es=r.useRef(null),ec=r.useRef(0),eu=e.bleedVisible?Math.max(0,...e.pages.map(e=>e.bleed)):0,ed=Math.max(...e.pages.map(e=>e.computedWidth)),eh=Math.max(...e.pages.map(e=>e.computedHeight)),ef=(null===(J=e.activePage)||void 0===J?void 0:J.computedHeight)||0,ep=ed+2*eu,em=(Y?ef:eh)+2*eu,eg=async({skipTimeout:t}={skipTimeout:!1})=>{if(t||await new Promise(e=>setTimeout(e,50)),null===el.current)return;let n=el.current.getBoundingClientRect();0!==n.width&&0!==n.height||(console.warn("Polotno warning: <Workspace /> component can not automatically detect its size.\nWidth or height of parent elements is equal 0.\nPlease make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.\nFor simpler debugging here is the log of the parent element:"),console.log(el.current));let r=es.current.clientWidth||n.width,i={width:r,height:n.height};(eo.current.width!==i.width||eo.current.height!==i.height)&&(ea(i),eo.current=i);let a=(r-2*en)/ep,o=e.pages.length>1?3.1:2,l=(n.height-er*o)/em,s=(r-en*(e.pages.length>1?3.1:2))/ep,c=(n.height-2*er)/em,u=e.pages.length?Math.max(Math.min(et?s:a,et?c:l),.01):1;e.scaleToFit!==u&&(e.setScale(u),e._setScaleToFit(u))};r.useLayoutEffect(()=>{eg({skipTimeout:!0})},[]),r.useEffect(()=>{eg()},[ep,em,G,W]),r.useLayoutEffect(()=>{eg({skipTimeout:!0})},[e.openedSidePanel]),r.useEffect(()=>{e.__()},[]),r.useEffect(()=>{let e=el.current;if(window.ResizeObserver){let t=new ResizeObserver(()=>{eg({skipTimeout:!0})});return t.observe(e),()=>t.unobserve(e)}{let e=setInterval(()=>{eg({skipTimeout:!0})},100);return()=>clearInterval(e)}},[ep,em]);let ev=Y?1:e.pages.length;if(et){let t=ep*e.scale*ev;Q=Math.max(en,(ei.width-t)/ev/2),ee=Math.max(er,(ei.height-em*e.scale)/2)}else{Q=Math.max(en,(ei.width-ep*e.scale)/2);let t=em*e.scale*ev;ee=Math.max(er,(ei.height-t)/ev/2)}Number.isNaN(Q)&&(Q=en),Number.isNaN(ee)&&(ee=er),r.useEffect(()=>{let t=t=>{(U||function(e,t){var n,r,i,a,o,l,s,c,u,d,h,f,p,m,g,v,b,y;let w=function(e){if(1!==e.selectedElements.length)return null;let t=e.selectedElements[0];return"table"!==t.type?null:t}(t);if(w&&function(e,t){let n=t._focusedCellIds.length>0,r=!!t._editingCellId;if(!n&&!r)return!1;if(r){if("Escape"===e.key)return e.preventDefault(),t.exitCellEdit(),!0;if("Tab"===e.key){e.preventDefault();let n=t.editingCell;if(t.exitCellEdit(),n){if(e.shiftKey){let e=n.col-1,r=n.row;e<0&&(r-=1,e=t.cols-1),r<0&&(r=t.rows-1,e=t.cols-1),L(t,r,e)}else{let e=n.col+1,r=n.row;e>=t.cols&&(r+=1,e=0),r>=t.rows&&(r=0,e=0),L(t,r,e)}}return!0}if(e.metaKey||e.ctrlKey){let n=t.editingCell;if(n){if("b"===e.key)return e.preventDefault(),n.set({fontWeight:"bold"===n.fontWeight?"normal":"bold"}),!0;if("i"===e.key)return e.preventDefault(),n.set({fontStyle:"italic"===n.fontStyle?"normal":"italic"}),!0;if("u"===e.key){e.preventDefault();let t=n.textDecoration.split(" ").filter(Boolean),r=t.includes("underline");return n.set({textDecoration:r?t.filter(e=>"underline"!==e).join(" "):[...t,"underline"].join(" ")}),!0}}}return!0}if("Escape"===e.key)return e.preventDefault(),t.clearCellFocus(),!0;let i=t.focusedCells[0];if(!i)return!1;let a=i.row,o=i.col;if("Enter"===e.key)return e.preventDefault(),t.enterCellEdit(i.id),!0;if("Tab"===e.key){if(e.preventDefault(),e.shiftKey){let e=o-1,n=a;e<0&&(n-=1,e=t.cols-1),n<0&&(n=t.rows-1,e=t.cols-1),A(t,n,e)}else{let e=o+1,n=a;e>=t.cols&&(n+=1,e=0),n>=t.rows&&(n=0,e=0),A(t,n,e)}return!0}if("ArrowRight"===e.key||"ArrowLeft"===e.key||"ArrowDown"===e.key||"ArrowUp"===e.key){if(e.preventDefault(),e.shiftKey){let n=function(e){let t=e.cells.find(t=>t.id===e._anchorCellId);if(!t)return null;let n=e.focusedCells;if(n.length<=1)return{row:t.row,col:t.col};let r=1/0,i=-1,a=1/0,o=-1;for(let e of n)e.row<r&&(r=e.row),e.row>i&&(i=e.row),e.col<a&&(a=e.col),e.col>o&&(o=e.col);return{row:t.row===r?i:r,col:t.col===a?o:a}}(t)||{row:a,col:o},r=n.row,i=n.col;"ArrowRight"===e.key&&(i=Math.min(n.col+1,t.cols-1)),"ArrowLeft"===e.key&&(i=Math.max(n.col-1,0)),"ArrowDown"===e.key&&(r=Math.min(n.row+1,t.rows-1)),"ArrowUp"===e.key&&(r=Math.max(n.row-1,0)),t.focusCellRange(r,i)}else"ArrowRight"===e.key&&A(t,a,Math.min(o+1,t.cols-1)),"ArrowLeft"===e.key&&A(t,a,Math.max(o-1,0)),"ArrowDown"===e.key&&A(t,Math.min(a+1,t.rows-1),o),"ArrowUp"===e.key&&A(t,Math.max(a-1,0),o);return!0}if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),t.focusedCells.forEac
126h(e=>{e.set({text:""})}),!0;let l=e.ctrlKey||e.metaKey;if(l&&"KeyC"===e.code){e.preventDefault();let n=t.focusedCells.map(e=>(0,M.av)(e.text));return navigator.clipboard.writeText(n.join("\n")),!0}return l&&"KeyV"===e.code?(e.preventDefault(),navigator.clipboard.readText().then(e=>{let n=t.focusedCells[0];n&&n.set({text:e})}),!0):!(!l||"KeyA"!==e.code||(e.preventDefault(),t.cells.forEach(e=>{t.focusCell(e.id,!0)}),0))}(e,w)||"INPUT"===(null===(n=document.activeElement)||void 0===n?void 0:n.tagName)||"TEXTAREA"===(null===(r=document.activeElement)||void 0===r?void 0:r.tagName)||"true"===(null===(i=document.activeElement)||void 0===i?void 0:i.contentEditable))return;let x=document.querySelector(".polotno-workspace-container");if(document.activeElement!==x&&!(null==x?void 0:x.contains(document.activeElement))){let e=window.getSelection();if(e&&e.toString().length>0)return}let C=t.selectedElements.filter(e=>e.removable).map(e=>e.id);46!==e.keyCode&&8!==e.keyCode||t.deleteElements(C);let _=e.ctrlKey||e.metaKey,I=e.shiftKey,O=e.altKey;if("Escape"===e.key)return e.preventDefault(),void("draw"===t.tool?t.setTool("selection"):t.selectElements([]));if(!_||I||"z"!==e.key.toLowerCase()&&"y"!==e.key.toLowerCase()||(e.preventDefault(),t.history.undo()),_&&I&&("z"===e.key.toLowerCase()||"y"===e.key.toLowerCase())&&(e.preventDefault(),t.history.redo()),_&&"KeyA"===e.code){e.preventDefault();let n=null===(a=t.activePage)||void 0===a?void 0:a.children.filter(e=>e.selectable),r=(null==n?void 0:n.map(e=>e.id))||[];t.selectElements(r)}if(_&&"KeyC"===e.code&&(e.preventDefault(),E(t)),_&&"KeyX"===e.code&&(e.preventDefault(),k(t)),_&&"KeyV"===e.code&&(e.preventDefault(),S(t)),"ArrowDown"===e.code){e.preventDefault();let n=e.shiftKey?10:1;t.selectedShapes.forEach(e=>{e.draggable&&e.set({y:e.y+n})})}if("ArrowUp"===e.code){e.preventDefault();let n=e.shiftKey?10:1;t.selectedShapes.forEach(e=>{e.draggable&&e.set({y:e.y-n})})}if("ArrowLeft"===e.code){e.preventDefault();let n=e.shiftKey?10:1;t.selectedShapes.forEach(e=>{e.draggable&&e.set({x:e.x-n})})}if("ArrowRight"===e.code){e.preventDefault();let n=e.shiftKey?10:1;t.selectedShapes.forEach(e=>{e.draggable&&e.set({x:e.x+n})})}if(_&&"KeyG"===e.code){e.preventDefault();let n=t.selectedElements[0];n&&"group"===n.type?t.ungroupElements([n.id]):t.groupElements(t.selectedElements.map(e=>e.id))}if(_&&"KeyD"===e.code&&(e.preventDefault(),(0,T._)(t.selectedElements,t)),"KeyT"===e.code&&!_){e.preventDefault();let n=t.width/2,r=t.width/2-n/2,i=t.height/2-15,a=(t.width+t.height)/2160;null===(o=t.activePage)||void 0===o||o.addElement({type:"text",x:r,y:i,width:n,fontSize:30*a,text:"Sample Text",fontFamily:"Roboto"})}if("KeyR"===e.code&&!_){e.preventDefault();let n={type:"figure",x:t.width/4,y:t.height/4,width:300,height:300,fill:R,stroke:"#0c0c0c",strokeWidth:0,subType:"rect"};null===(l=t.activePage)||void 0===l||l.addElement(n)}if("KeyL"===e.code&&!_){e.preventDefault();let n=(null!==(c=null===(s=t.activePage)||void 0===s?void 0:s.computedWidth)&&void 0!==c?c:0)/3,r={type:"line",x:(null!==(d=null===(u=t.activePage)||void 0===u?void 0:u.computedWidth)&&void 0!==d?d:0)/2-n/2,y:(null!==(f=null===(h=t.activePage)||void 0===h?void 0:h.computedHeight)&&void 0!==f?f:0)/2,width:n,color:R};null===(p=t.activePage)||void 0===p||p.addElement(r)}if("KeyO"===e.code&&!_){e.preventDefault(),e.preventDefault();let n={type:"figure",x:t.width/4,y:t.height/4,width:300,height:300,fill:R,stroke:"#0c0c0c",strokeWidth:0,subType:"circle"};null===(m=t.activePage)||void 0===m||m.addElement(n)}_&&"Equal"===e.code&&(e.preventDefault(),t.setScale(t.scale+.1)),_&&"Minus"===e.code&&(e.preventDefault(),t.setScale(t.scale-.1)),O&&("KeyA"===e.code&&(e.preventDefault(),(0,P.H_)(t)),"KeyD"===e.code&&(e.preventDefault(),(0,P.cP)(t)),"KeyS"===e.code&&(e.preventDefault(),(0,P.Ew)(t)),"KeyW"===e.code&&(e.preventDefault(),(0,P.Lb)(t)),"KeyV"===e.code&&(e.preventDefault(),(0,P.vA)(t)),"KeyH"===e.code&&(e.preventDefault(),(0,P.A8)(t))),"BracketRight"===e.code&&(e.preventDefault(),_?null===(g=t.activePage)||void 0===g||g.moveElementsUp(t.selectedElementsIds):null===(v=t.activePage)||void 0===v||v.moveElementsTop(t.selectedElementsIds)),"BracketLeft"===e.code&&(e.preventDefault(),_?null===(b=t.activePage)||void 0===b||b.moveElementsDown(t.selectedElementsIds):null===(y=t.activePage)||void 0===y||y.moveElementsBottom(t.selectedElementsIds))})(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[]),r.useEffect(()=>{let t=t=>{if(t.ctrlKey||t.metaKey){t.preventDefault();let n=Math.max(5,e.scaleToFit),r=Math.min(.1,e.scaleToFit);et&&ep>0&&Number.isFinite(ep)&&(r=Math.max(r,300/ep)),r=Math.max(r,.01);let i=I(t.deltaY<0?1.03*e.scale:e.scale/1.03,r,n);return void e.setScale(i)}},n=es.current;return null==n||n.addEventListener("wheel",t),()=>null==n?void 0:n.removeEventListener("wheel",t)},[et,ep,e]),r.useEffect(()=>{let t=es.current;if(!t)return;let n=e=>{2===e.touches.length&&(ec.current=O(e.touches[0],e.touches[1]))},r=n=>{if(2===n.touches.length&&ec.current>0){n.preventDefault();let r=O(n.touches[0],n.touches[1]),i=r/ec.current,a=Math.max(5,e.scaleToFit),o=Math.min(.1,e.scaleToFit);et&&ep>0&&Number.isFinite(ep)&&(o=Math.max(o,300/ep)),o=Math.max(o,.01);let l=e.scale,s=I(l*i,o,a),c=s/l,u=t.getBoundingClientRect(),d=(n.touches[0].clientX+n.touches[1].clientX)/2-u.left,h=(n.touches[0].clientY+n.touches[1].clientY)/2-u.top,f=t.scrollLeft+d,p=t.scrollTop+h;ek.current=!0,e.setScale(s),t.scrollLeft=f*c-d,t.scrollTop=p*c-h,ec.current=r}},i=()=>{ec.current=0};return t.addEventListener("touchstart",n,{passive:!0}),t.addEventListener("touchmove",r,{passive:!1}),t.addEventListener("touchend",i,{passive:!0}),()=>{t.removeEventListener("touchstart",n),t.removeEventListener("touchmove",r),t.removeEventListener("touchend",i)}},[et,ep,e]);let eb=void 0!==q,ey=e.pages.map(t=>{if(et){let n=(t.computedWidth+2*eu)*e.scale;return eb?n+q:n+2*Q}{let n=(t.computedHeight+2*eu)*e.scale;return eb?n+q:n+2*ee}}),ew=[],ex=eb?et?Q:ee:0;for(let e=0;e<ey.length;e++)ew.push(ex),ex+=ey[e];
126let eC=ey.reduce((e,t)=>e+t,0),eE=eb?eC+(et?2*Q:2*ee):eC,ek=r.useRef(!1),[,eS]=r.useReducer(e=>e+1,0);((e,t,n,i,a)=>{let o=r.useRef(0),l=r.useRef(0),s=r.useRef(null),c=r.useRef(null),u=r.useRef(!1),d=r.useRef(i.pages.length);u.current=d.current!==i.pages.length,d.current=i.pages.length,r.useEffect(()=>{let t=e.current,n=()=>{o.current=t.scrollLeft,l.current=t.scrollTop,s.current=t.scrollWidth,c.current=t.scrollHeight};return t.addEventListener("scroll",n),n(),()=>{t.removeEventListener("scroll",n)}},[]),r.useLayoutEffect(()=>{if(!e.current||u.current)return;let t=e.current,n=s.current,r=c.current;if(null===n||null===r)return s.current=t.scrollWidth,c.current=t.scrollHeight,o.current=t.scrollLeft,void(l.current=t.scrollTop);a.current=!0;let i=t.offsetWidth,d=t.offsetHeight,h=(o.current+i/2)/n,f=(l.current+d/2)/r,p=Math.max(0,t.scrollWidth-i),m=Math.max(0,t.scrollHeight-d);t.scrollLeft=I(h*t.scrollWidth-i/2,0,p),t.scrollTop=I(f*t.scrollHeight-d/2,0,m),s.current=t.scrollWidth,c.current=t.scrollHeight,o.current=t.scrollLeft,l.current=t.scrollTop},[n,t])})(es,eE,e.scale,e,ek);let{handleScroll:eT}=((e,t,n,i,a,o,l,s,c)=>{let u=r.useRef(!1),d=r.useRef(null),h=r.useRef(!1),f="horizontal"===s;r.useEffect(()=>{let t=e.current,n=()=>{o.current};return t.addEventListener("scroll",n),()=>{t.removeEventListener("scroll",n)}},[]);let p=i.pages.indexOf(i.activePage);return r.useLayoutEffect(()=>{if(l||!i.activePage||!e.current||u.current)return;let r=e.current,a=i.pages.indexOf(i.activePage),o=t[a]||0,s=f?r.scrollLeft:r.scrollTop,d=Math.min(o,Math.max(0,f?r.scrollWidth-r.clientWidth:r.scrollHeight-r.clientHeight)),p=n[a]||n[0]||0,m=()=>{};return(Math.abs(d-s)>.5*p||h.current)&&(h.current=!0,m=(({element:e,scrollTop:t,scrollLeft:n,duration:r=300,onFinish:i=()=>{}})=>{let a=void 0!==t,o=a?e.scrollTop:e.scrollLeft,l=a?t:n,s=l-o,c=0,u=!1;if(0===r)return a?e.scrollTop=l:e.scrollLeft=l,()=>{};let d=()=>{if(u)return;let t=h(c+=20,o,s,r);a?e.scrollTop=t:e.scrollLeft=t,c<r?setTimeout(d,20):i()},h=(e,t,n,r)=>(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t;return d(),()=>{u=!0}})(Object.assign(Object.assign({element:r},f?{scrollLeft:d}:{scrollTop:d}),{onFinish:()=>{h.current=!1,null==c||c()},duration:i.isPlaying?0:300}))),m},[i.activePage,p,i.isPlaying,l,s,t,n]),{handleScroll:e=>{if(l||h.current)return;u.current=!0,clearTimeout(d.current),d.current=setTimeout(()=>{u.current=!1},300);let n=(f?e.currentTarget.scrollLeft:e.currentTarget.scrollTop)+(f?a.width:a.height)/3,r=0;for(let e=t.length-1;e>=0;e--)if(n>=t[e]){r=e;break}let o=i.pages[r];o&&i.activePage!==o&&o.select()}}})(es,ew,ey,e,ei,ek,Y,t,eS),eP=ei.width>=ep*e.scale+2*Q,eM=ei.height>=em*e.scale+2*ee,eR=i||"rgba(232, 232, 232, 0.9)",eA=(null==$?void 0:$.NoPages)||D,eL=et?ei.width:ei.height,e_=es.current?et?es.current.scrollLeft:es.current.scrollTop:0,eI=e=>{for(let t=ew.length-1;t>=0;t--)if(e>=ew[t])return t;return 0},eO=Math.max(0,eI(e_)),eD=Math.min(e.pages.length-1,eI(e_+eL)),ez=null!=X?X:1,eN=Math.max(0,eO-ez),eF=Math.min(e.pages.length-1,eD+ez);return r.createElement("div",{ref:el,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:eR,overflow:"hidden"},tabIndex:0,className:"polotno-workspace-container"},r.createElement("div",{ref:es,onScroll:eT,style:Object.assign({position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",flexDirection:et?"row":"column",overflow:"auto",overflowX:et?"auto":eP?"hidden":"auto",overflowY:et&&eM?"hidden":"auto"},eb&&{paddingTop:et?0:ee,paddingBottom:et?0:ee,paddingLeft:et?Q:0,paddingRight:et?Q:0,boxSizing:"border-box"}),className:"polotno-workspace-inner"},e.pages.map((i,m)=>{let v=i===e.activePage;if(Y&&!v&&!i._exportingOrRendering&&!i._forceMount)return null;let E=v||m>=eN&&m<=eF||i._exportingOrRendering||i._forceMount,k=et?ey[m]:ep*e.scale+2*Q,S=et?em*e.scale+2*ee:ey[m];if(!E)return r.createElement("div",{key:i.id,style:{flexShrink:0}},r.createElement(z,{width:k,height:S,backgroundColor:eR,xPadding:Q,yPadding:ee}));let T=r.createElement(a.ZP,{key:i.id,page:i,xPadding:Q,yPadding:ee,width:k,height:S,store:e,pageControlsEnabled:n,backColor:eR,transparencyBackgroun
126dColor:o,pageBorderColor:l||"lightgrey",activePageBorderColor:s||"rgb(0, 161, 255)",altCloneEnabled:Z,bleedColor:c||"rgba(255, 0, 0, 0.1)",selectionRectFill:f,selectionRectStroke:p,selectionRectStrokeWidth:g,snapGuideStroke:u||"rgb(0, 161, 255)",snapGuideStrokeWidth:d||1,snapGuideDash:h||N,transformLabelFill:b,transformLabelTextFill:y,distanceGuideStroke:w||"rgb(0, 161, 255)",distanceLabelFill:x||"rgb(0, 161, 255)",distanceLabelTextFill:C||"white",components:$,viewportSize:ei,layout:t,tooltipSafeArea:K});return(i._exportingOrRendering||i._forceMount)&&!v&&Y?r.createElement("div",{style:{display:"none",flexShrink:0},key:i.id},T):T}),e.rulesVisible&&r.createElement(m,{store:e,xPadding:Q,yPadding:ee,width:ep*e.scale+2*Q,height:em*e.scale+2*ee,pageSizes:ey,layout:t,renderOnlyActivePage:Y,rulerBackgroundColor:_,rulerTextColor:F,rulerBorderColor:B,rulerBorderSize:H,rulerTickColor:V,rulerTickSize:j}),0===e.pages.length&&r.createElement(eA,{store:e}),e.audios.map(t=>r.createElement(v,{key:t.id,audio:t,store:e}))))});var B=n(59799),H=n(38726),V=n(96834),j=n(2374),$=n(95975),U=r.forwardRef(function(e,t){var n=e.size>=j.J.LARGE,i=n?j.J.LARGE:j.J.STANDARD,a="".concat(-1*i/.05/2);return r.createElement($.l,(0,V.pi)({iconName:"chevron-left",ref:t},e),r.createElement("path",{d:n?"M168.2 200L274 305.8C277.8 309.4 280 314.4 280 320C280 331 271 340 260 340C254.4 340 249.4 337.8 245.8 334.2L125.8 214.2C122.2 210.6 120 205.6 120 200C120 194.4 122.2 189.4 125.8 185.8L245.8 65.8C249.4 62.2 254.4 60 260 60C271 60 280 69 280 80C280 85.6 277.8 90.6 274.2000000000001 94.2000000000001L168.2 200z":"M148.2 160L214 225.8C217.8 229.4 220 234.4 220 240C220 251 211 260 200 260C194.4 260 189.4 257.8 185.8 254.2L105.8 174.2C102.2 170.6 100 165.6 100 160C100 154.4 102.2 149.4 105.8 145.8L185.8 65.8C189.4 62.2 194.4 60 200 60C211 60 220 69 220 80C220 85.6 217.8 90.6 214.2 94.2L148.2 160z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(a,", ").concat(a,")"),style:{transformOrigin:"center"}}))});U.defaultProps={size:j.J.STANDARD},U.displayName="Blueprint5.Icon.ChevronLeft";var W=n(12724),G=r.forwardRef(function(e,t){var n=e.size>=j.J.LARGE,i=n?j.J.LARGE:j.J.STANDARD,a="".concat(-1*i/.05/2);return r.createElement($.l,(0,V.pi)({iconName:"chevron-right",ref:t},e),r.createElement("path",{d:n?"M274.2000000000001 214.2L154.2 334.2000000000001C150.6 337.8 145.6 340 140 340C129 340 120 331 120 320C120 314.4 122.2 309.4 125.8 305.8L231.8 200L126 94.2000000000001C122.2 90.6 120 85.6 120 80C120 69 129 60 140 60C145.6 60 150.6 62.2 154.2 65.8L274.2000000000001 185.8C277.8 189.4 280 194.4 280 200C280 205.6 277.8 210.6 274.2000000000001 214.2z":"M214.2 174.2L134.2 254.2C130.6 257.8 125.6 260 120 260C109 260 100 251 100 240C100 234.4 102.2 229.4 105.8 225.8L171.8 160L106 94.2C102.2 90.6 100 85.6 100 80C100 69 109 60 120 60C125.6 60 130.6 62.2 134.2 65.8L214.2 145.8C217.8 149.4 220 154.4 220 160C220 165.6 217.8 170.6 214.2 174.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(a,", ").concat(a,")"),style:{transformOrigin:"center"}}))});G.defaultProps={size:j.J.STANDARD},G.displayName="Blueprint5.Icon.ChevronRight";var q=n(53159),Z=n(64518),X=n(94487),Y=r.forwardRef(function(e,t){var n=e.size>=j.J.LARGE,i=n?j.J.LARGE:j.J.STANDARD,a="".concat(-1*i/.05/2);return r.createElement($.l,(0,V.pi)({iconName:"insert",ref:t},e),r.createElement("path",{d:n?"M380 400H20C8 400 0 392 0 380V20C0 10 8 0 20 0H380C390 0 400 10 400 20V380C400 392 390 400 380 400L380 400zM360 40H40V360H360V40L360 40zM100 180H180V100C180 88 188 80 200 80S220 88 220 100V180H300C312 180 320 188 320 200S312 220 300 220H220V300C220 312 212 320 200 320S180 312 180 300V220H100C88 220 80 212 80 200S88 180 100 180L100 180z":"M100 140H140V100C140 88 148 80 160 80S180 88 180 100V140H220C232 140 240 148 240 160S232 180 220 180H180V220C180 232 172 240 160 240S140 232 140 220V180H100C88 180 80 172 80 160S88 140 100 140L100 140zM300 320H20C8 320 0 312 0 300V20C0 8 8 0 20 0H300C312 0 320 8 320 20V300C320 312 312 320 300 320L300 320zM280 40H40V280H280V40L280 40z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(a,", ").concat(a,")"),style:{transformOrigin:"center"}}))});Y.defaultProps={size:j.J.STANDARD},Y.displayName="Blueprint5.Icon.Insert";let K=(0,i.Pi)(({store:e,page:t,xPadding:n,yPadding:i,layout:a="vertical"})=>{let o=e.pages.length>1,l=e.pages.indexOf(t),s="horizontal"===a,c=s?U:W.K,u=s?G:q._,d=(0,_.t)(s?"workspace.moveLeft":"workspace.moveUp"),h=(0,_.t)(s?"workspace.moveRight":"workspace.moveDown");return"selection"!==e.tool?null:r.createElement("div",{style:{position:"absolute",top:i-40+"px",right:n+"px"}},o&&r.createElement(B.u,{content:d,disabled:0===l},r.createElement(H.z,{icon:r.createElement(c,null),minimal:!0,disabled:0===l,onClick:()=>{t.setZIndex(l-1)},"aria-label":d})),o&&r.createElement(B.u,{content:h,disabled:l===e.pages.length-1},r.createElement(H.z,{icon:r.createElement(u,null),"aria-label":h,minimal:!0,disabled:l===e.pages.length-1,onClick:()=>{let n=e.pages.indexOf(t);t.setZIndex(n+1)}})),r.createElement(B.u,{content:(0,_.t)("workspace.duplicatePage")},r.createElement(H.z,{icon:r.createElement(Z.F,null),minimal:!0,"aria-label":(0,_.t)("workspace.duplicatePage"),onClick:()=>{t.clone()}})),o&&r.createElement(B.u,{content:(0,_.t)("workspace.removePage")},r.createElement(H.z,{icon:r.createElement(X.r,null),"aria-label":(0,_.t)("workspace.removePage"),minimal:!0,onClick:()=>{e.deletePages([t.id])}})),r.createElement(B.u,{content:(0,_.t)("workspace.addPage")},r.createElement(H.z,{icon:r.createElement(Y,null),minimal:!0,"aria-label":(0,_.t)("workspace.addPage"),onClick:()=>{var n,r,i;let a=e.addPage({bleed:(null===(n=e.activePage)||void 0===n?void 0:n.bleed)||0,width:(null===(r=e.activePage)||void 0===r?void 0:r.width)||"auto",height:(null===(i=e.activePage)||void 0===i?void 0:i.height)||"auto"}),o=e.pages.indexOf(t);a.setZIndex(o+1)}})))});var J=n(463),Q=n(55918),ee=n(43030),et=n(87577),en=n(27148),er=n(84360),ei=n(9865),ea=n(34013),eo=n(91332),el=n(69305);function es(e,t){return e.classList.contains(t)?e:e.parentElement?es(e.parentElement,t):null}let ec=()=>null,eu=(0,i.Pi)(({store:e,page:t,components:n,stageRef:i,tooltipSafeArea:a})=>{var l,s,c;let u=e.selectedShapes.every(e=>e.page===t),d=r.useRef(null),[h,f]=r.useState(!1),p=e._hasCroppedImages;e.selectedElements.length,r.useEffect(()=>{var e,t,n;let r=()=>{f(!0)},a=()=>{f(!1)};null===(e=null==i?void 0:i.current)||void 0===e||e.on("dragstart",r),null===(t=null==i?void 0:i.current)||void 0===t||t.on("dragend",a);let o=null===(n=null==i?void 0:i.current)||void 0===n?void 0:n.findOne("Transformer");return null==o||o.on("transformstart",r),null==o||o.on("transformend",a),()=>{var e,t;null===(e=null==i?void 0:i.current)||void 0===e||e.off("dragstart",r),null===(t=null==i?void 0:i.current)||void 0===t||t.off("dragend",a),null==o||o.off("transformstart",r),null==o||o.off("transformend",a)}},[]);let[m,g]=r.useState({fit:!0,needCalculate:!1,token:Math.random()});function v(){if(!d.current||!m.needCalculate)return;let e=es(d.current,"polotno-workspace-container");if(!e)return;let t=e.getBoundingClientRect(),n=d.current.getBoundingClientRect(),r=(n.right,t.left,n.top-t.top),i=(n.left,t.left,n.bottom-t.top),o=(null==a?void 0:a.top)||0,l=(null==a?void 0:a.bottom)||0,s=i-t.height<=-20-l;g(r>=20+o?{fit:!0,needCalculate:!1,token:m.token}:s?{fit:!1,needCalculate:!1,token:m.token}:{fit:m.fit,needCalculate:!1,token:m.token})}if(r.useEffect(()=>{0!==e.selectedElements.length&&g({fit:!0,needCalculate:!0,token:Math.random()})},[e.selectedElements,h]),r.useLayoutEffect(()=>{let e=setTimeout(()=>{v()},100);return()=>{clearTimeout(e)}},[m.needCalculate,d.current,m.token]),r.useEffect(()=>{if(!i.current)return;let t=es(i.current.content,"polotno-workspace-inner");if(!t)return;let n=()=>{e.selectedElements.length&&g({fit:!0,needCalculate:!0,token:Math.random()})};return null==t||t.addEventListener("scroll",n),()=>{null==t||t.removeEventListener("scroll",n)}},[]),0===e.selectedShapes.length||h||!u||e.activePage!==t||p)return null;let b=(0,o.Ne)(e.selectedShapes),y=(null==n?void 0:n.Position)||eo.p,w=(null==n?void 0:n.Duplicate)||ei.c,x=(null==n?void 0:n.Remove)||ea.x,C=(null==n?void 0:n.Group)||el.B,E=(null==n?void 0:n.Lock)||ec,k=null===(l=e.selectedElements[0])||void 0===l?void 0:l.type,S=Object.assign(Object.assign({},er.flags.aiTextEnabled?{TextAiWrite:en.i}:{}),n||{}),T=(0,et.m)({components:S,type:k,usedItems:[]}),P=(null===(c=null===(s=null==i?void 0:i.current)||void 0===s?void 0:s.findOne("Transformer"))||void 0===c?void 0:c.rotation())||0,M=80;return 30>Math.abs(P)&&m.fit&&(M=80),Math.abs(P)>140&&!m.fit&&(M=80),r.createElement(J.Vt,{parentNodeFunc:({stage:e})=>{var t,n;return(null===(t=null==e?void 0:e.container())||void 0===t?void 0:t.closest(".polotno-workspace-container"))||(null===(n=null==e?void 0:e.container())||void 0===n?void 0:n.parentNode)},transformFunc:e=>{var t;let n=b.x+b.width/2,r=m.fit?b.y*e.scaleY-M:b.y*e.scaleY+b.height*e.scaleY+M,o=null===(t=null==i?void 0:i.current)||void 0===t?void 0:t.container(),l=(null==o?void 0:o.getBoundingClientRect())||{left:0,top:0,width:0,height:0,right:0,bottom:0,x:0,y:0,toJSON:()=>({})},s=null==o?void 0:o.closest(".polotno-workspace-container"),c=(null==s?void 0:s.getBoundingClientRect())||{left:0,top:0,width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY,right:0,bottom:0,x:0,y:0,toJSON:()=>({})},u=l.left-c.left,h=l.top-c.top,f=u+e.x+n*e.scaleX,p=f-b.width*e.scaleX/2,g=f+b.width*e.scaleX/2,v=Math.min(50,b.width/2*e.scaleX),y=g>=v&&p<=c.width-v,w=d.current?d.current.getBoundingClientRect().width:0,x=(null==a?void 0:a.left)||0,C=(null==a?void 0:a.right)||0;if(Number.isFinite(c.width)&&w>0&&y){let e=8+w/2+x,t=c.width-8-w/2-C;t>=e&&(f=Math.max(e,Math.min(f,t)))}g<v&&(f-=w+8),p>c.width-v&&(f+=w+8);let E=h+e.y+r,k=d.current?d.current.getBoundingClientRect().height:34,S=((null==a?void 0:a.top)||0)+8,T=((null==a?void 0:a.bottom)||0)+8;return Number.isFinite(c.height)&&(E=Math.max(S+k/2,E),E=Math.min(c.height-T-k/2,E)),Object.assign(Object.assign({},e),{x:f,y:E,scaleX:1,scaleY:1}
126)},divProps:{style:{pointerEvents:"none",position:"absolute",visibility:m.needCalculate?"hidden":"visible",zIndex:9}}},r.createElement("div",{ref:e=>{d.current=e,!d.current&&e&&v()},style:{pointerEvents:"none"}},r.createElement(Q.w,{style:{padding:"2px",borderRadius:"5px",height:"34px",transform:"translate(-50%, -50%)",pointerEvents:"auto"}},r.createElement(ee.f,{style:{height:"30px"}},T.map(t=>{let n=S[t];return r.createElement(n,{elements:e.selectedElements,element:e.selectedElements[0],store:e,key:t})}),r.createElement(C,{store:e}),r.createElement(E,{store:e}),r.createElement(w,{store:e}),r.createElement(x,{store:e}),r.createElement(y,{store:e})))))});var ed=n(17785),eh=n(45254),ef=n.n(eh),ep=n(12131),em=n(84614),eg=n(45470),ev=n(63140),eb=r.memo(function(e){var t,n=e.content,i=e.popoverClassName,a=e.onClose,o=e.isDarkTheme,l=e.rootBoundary,s=e.targetOffset,c=e.transitionDuration,u=(0,ed._T)(e,["content","popoverClassName","onClose","isDarkTheme","rootBoundary","targetOffset","transitionDuration"]),d=r.useCallback(function(e){return e.preventDefault()},[]),h=r.useCallback(function(e){var t=e.ref;return r.createElement(ev.h,null,r.createElement("div",{className:ep.N63,style:s,ref:t}))},[s]),f=r.useCallback(function(e){e||null==a||a()},[a]);return r.createElement(eg.J,(0,ed.pi)({placement:"right-start",rootBoundary:void 0===l?"viewport":l,transitionDuration:void 0===c?100:c},u,{content:r.createElement("div",{onContextMenu:d},n),enforceFocus:!1,key:void 0===s?"default":"".concat(s.left,"x").concat(s.top),hasBackdrop:!0,backdropProps:{className:ep.lvD},minimal:!0,onInteraction:f,popoverClassName:ef()(ep._Gh,i,((t={})[ep.Pyr]=void 0!==o&&o,t)),positioningStrategy:"fixed",renderTarget:h}))});eb.displayName="".concat(em.g,".ContextMenuPopover");var ey=n(54064),ew=n(50058),ex=n(59162),eC=n(72037),eE=n(50708),ek=n(28419),eS=n(84271),eT=n(47716),eP=n(70356),eM=n(61311),eR=n(81970),eA=n(72853);let eL=(0,i.Pi)(({store:e,isOpen:t,offset:n,setIsOpen:i})=>{var a,o,l,s,c;let{disabled:u,duplicate:d}=(0,eC.w)({store:e}),{disabled:h,remove:f}=(0,eM._)({store:e}),{setElementToCopy:p}=(0,eR.K)(e),{disabled:m,lock:g,locked:v}=(0,eA.Z)({store:e}),b=v?r.createElement(eE.H,null):r.createElement(ek.S,null),y=e.selectedElementsIds;return 0===e.selectedElements.length?null:r.createElement(eb,{isOpen:t,onClose:()=>{i(!1)},content:r.createElement(ey.v,null,r.createElement(ew.s,{shouldDismissPopover:!1,icon:b,text:(0,_.t)(v?"contextMenu.unlock":"contextMenu.lock"),onClick:g,disabled:m}),r.createElement(ew.s,{icon:r.createElement(Z.F,null),text:(0,_.t)("contextMenu.duplicate"),onClick:d,disabled:u}),r.createElement(ew.s,{icon:r.createElement(X.r,null),text:(0,_.t)("contextMenu.remove"),onClick:f,disabled:h}),r.createElement(ex.R,null),r.createElement(ew.s,{icon:r.createElement(eS.S,null),text:(0,_.t)("toolbar.layering")},r.createElement(ew.s,{shouldDismissPopover:!1,icon:r.createElement(eT.C,null),text:(0,_.t)("toolbar.toForward"),disabled:!(null===(a=e.activePage)||void 0===a?void 0:a.canMoveElementsTop(y)),onClick:()=>{var t;null===(t=e.activePage)||void 0===t||t.moveElementsTop(y)}}),r.createElement(ew.s,{shouldDismissPopover:!1,icon:r.createElement(W.K,null),text:(0,_.t)("toolbar.up"),disabled:!(null===(o=e.activePage)||void 0===o?void 0:o.canMoveElementsUp(y)),onClick:()=>{var t;null===(t=e.activePage)||void 0===t||t.moveElementsUp(y)}}),r.createElement(ew.s,{shouldDismissPopover:!1,icon:r.createElement(q._,null),text:(0,_.t)("toolbar.down"),disabled:!(null===(l=e.activePage)||void 0===l?void 0:l.canMoveElementsDown(y)),onClick:()=>{var t;null===(t=e.activePage)||void 0===t||t.moveElementsDown(y)}}),r.createElement(ew.s,{shouldDismissPopover:!1,icon:r.createElement(eP.S,null),text:(0,_.t)("toolbar.toBottom"),disabled:!(null===(s=e.activePage)||void 0===s?void 0:s.canMoveElementsBottom(y)),onClick:()=>{var t;null===(t=e.activePage)||void 0===t||t.moveElementsBottom(y)}})),"table"===(null===(c=e.selectedElements[0])||void 0===c?void 0:c.type)&&(()=>{let t=e.selectedElements[0],n=t.focusedCells[0],i=null==n?void 0:n.row,a=null==n?void 0:n.col;return r.createElement(r.Fragment,null,null!=n&&r.createElement(r.Fragment,null,r.createElement(ex.R,null),r.createElement(ew.s,{text:(0,_.t)("toolbar.insertRowAbove"),onClick:()=>{e.history.transaction(()=>{t.addRow(i)})}}),r.createElement(ew.s,{text:(0,_.t)("toolbar.insertRowBelow"),onClick:()=>{e.history.transaction(()=>{t.addRow(i+1)})}}),r.createElement(ew.s,{text:(0,_.t)("toolbar.deleteRow"),disabled:t.rows<=1,onClick:()=>{e.history.transaction(()=>{t.removeRow(i)})}}),r.createElement(ex.R,null),r.createElement(ew.s,{text:(0,_.t)("toolbar.insertColumnLeft"),onClick:()=>{e.history.transaction(()=>{t.addColumn(a)})}}),r.createElement(ew.s,{text:(0,_.t)("toolbar.insertColumnRight"),onClick:()=>{e.history.transaction(()=>{t.addColumn(a+1)})}}),r.createElement(ew.s,{text:(0,_.t)("toolbar.deleteColumn"),disabled:t.cols<=1,onClick:()=>{e.history.transaction(()=>{t.removeColumn(a)})}})),r.createElement(ex.R,null),r.createElement(ew.s,{text:(0,_.t)("toolbar.distributeRowsEvenly"),onClick:()=>{e.history.transaction(()=>{t.distributeRowsEvenly()})}}),r.createElement(ew.s,{text:(0,_.t)("toolbar.distributeColumnsEvenly"),onClick:()=>{e.history.transaction(()=>{t.distributeColumnsEvenly()})}}))})()),targetOffset:{top:n.y,left:n.x}})});var e_=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},eI=e=>{var t,n,i,{components:a}=e,o=e_(e,["components"]);return(a=a||{}).PageControls=null!==(t=a.PageControls)&&void 0!==t?t:K,a.Tooltip=null!==(n=a.Tooltip)&&void 0!==n?n:eu,a.ContextMenu=null!==(i=a.ContextMenu)&&void 0!==i?i:eL,r.createElement(F,Object.assign({},o,{components:a}))}},28117:function(e,t,n){"use strict";n.d(t,{iN:function(){return D},Jz:function(){return z},ED:function(){return F},lc:function(){return _},nW:function(){return I}});var r=n(53317),i=n(95433),a=n(23455),o=n(1979);let l=o.bn.named("Text").props({type:"text",text:"",placeholder:"",fontSize:14,fontFamily:"Roboto",fontStyle:"normal",fontWeight:"normal",textDecoration:"",textTransform:"none",fill:"black",align:"center",width:100,height:0,verticalAlign:"top",strokeWidth:0,stroke:"black",lineHeight:r.V5.optional(r.V5.union(r.V5.number,r.V5.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5,curveEnabled:!1,curvePower:.5}).preProcessSnapshot(e=>Object.assign({},e)).actions(e=>({afterCreate(){if(!e.height){let t=e.lineHeight,n="number"==typeof t?t:parseFloat(t)||1.2;e.height=Math.round(e.fontSize*n)}},toggleEditMode(t){let n=null!=t?t:!e._editModeEnabled;n!==e._editModeEnabled&&(e._editModeEnabled=n,e._editModeEnabled?e.store.history.startTransaction():e.store.history.endTransaction())}}));var s=n(59533);let c=o.bn.named("Image").props({type:"image",width:100,height:100,src:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,cornerRadius:0,flipX:!1,flipY:!1,clipSrc:"",borderColor:"black",borderSize:0,keepRatio:!1,stretchEnabled:!1}).extend(e=>{let t=s.LO.box(!1),n=!1;return{views:{get _cropModeEnabled(){return t.get()}},actions:{toggleCropMode(r){let i=null!=r?r:!t.get();t.set(i),i&&!n?(e.store.history.startTransaction(),n=!0):!i&&n&&(e.store.history.endTransaction(),n=!1)},beforeDestroy(){n&&(e.store.history.endTransaction(),n=!1)}}}}),u=c.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1}),d=o.bn.named("Line").props({type:"line",width:400,height:10,color:"black",dash:r.V5.array(r.V5.number),startHead:"",endHead:""}).actions(e=>({})),h=o.bn.named("SVG").props({type:"svg",src:"",maskSrc:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,keepRatio:!0,stretchEnabled:!0,flipX:!1,flipY:!1,width:100,height:100,borderColor:"black",borderSize:0,cornerRadius:0,colorsReplace:r.V5.map(r.V5.string)}).preProcessSnapshot(e=>Object.assign(Object.assign({},e),{src:e.src||e.svgSource,colorsReplace:Array.isArray(e.colorsReplace)?{}:e.colorsReplace})).actions(e=>({replaceColor(t,n){e.colorsReplace.set(t,n)}})),f=o.bn.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:r.V5.array(r.V5.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0}),p=c.named("Gif").props({type:"gif",duration:0,keepRatio:!0}),m=r.V5.enumeration(["solid","dashed","dotted","none"]);function g(e){return(0,r.G_)(e,2)}function v(e,t,n){let i=e[`_${t}`];return null!=i?i:(0,r.fh)(e)?g(e)[t]:n}let b=r.V5.model("BorderSide",{color:r.V5.maybe(r.V5.string),width:r.V5.maybe(r.V5.number),style:r.V5.maybe(m)}).postProcessSnapshot(e=>{let t={};for(let[n,r]of Object.entries(e))null!=r&&(t[n]=r);return t}),y=r.V5.model("CellBorders",{top:r.V5.maybe(b),right:r.V5.maybe(b),bottom:r.V5.maybe(b),left:r.V5.maybe(b)}).postProcessSnapshot(e=>{let t={};for(let[n,r]of Object.entries(e))null!=r&&"object"==typeof r&&Object.keys(r).length>0&&(t[n]=r);return t}),w=["fontSize","fontFamily","fontWeight","fontStyle","textDecoration","textTransform","fill","align","verticalAlign","lineHeight","letterSpacing","strokeWidth","stroke","cellBackgroun
126d","cellPadding"],x=new Set(w),C=["blurEnabled","blurRadius","brightnessEnabled","brightness","sepiaEnabled","grayscaleEnabled","filters","shadowEnabled","shadowBlur","shadowOffsetX","shadowOffsetY","shadowColor","shadowOpacity"],E=["id","type","text","opacity","rowSpan","colSpan","mergedInto","name","custom","borders"],k=new Set(["row","col","x","y","width","height","rotation","draggable","resizable","selectable","removable","contentEditable","visible","showInExport","alwaysOnTop","backgroundEnabled","backgroundOpacity","backgroundColor","backgroundCornerRadius","backgroundPadding","curveEnabled","curvePower","shadowEnabled","shadowBlur","shadowOffsetX","shadowOffsetY","shadowColor","shadowOpacity","blurEnabled","blurRadius","brightnessEnabled","brightness","sepiaEnabled","grayscaleEnabled","placeholder","animations","filters"]),S={opacity:1,rowSpan:1,colSpan:1,name:""},T=[],P=r.V5.model("TableCell",{id:r.V5.identifier,type:r.V5.optional(r.V5.literal("tablecell"),"tablecell"),text:"",_fontSize:r.V5.maybe(r.V5.number),_fontFamily:r.V5.maybe(r.V5.string),_fontWeight:r.V5.maybe(r.V5.string),_fontStyle:r.V5.maybe(r.V5.string),_textDecoration:r.V5.maybe(r.V5.string),_textTransform:r.V5.maybe(r.V5.string),_fill:r.V5.maybe(r.V5.string),_align:r.V5.maybe(r.V5.string),_verticalAlign:r.V5.maybe(r.V5.string),_lineHeight:r.V5.maybe(r.V5.union(r.V5.number,r.V5.string)),_letterSpacing:r.V5.maybe(r.V5.number),_strokeWidth:r.V5.maybe(r.V5.number),_stroke:r.V5.maybe(r.V5.string),_cellBackgroun
126d:r.V5.maybe(r.V5.string),_cellPadding:r.V5.maybe(r.V5.number),opacity:1,rowSpan:1,colSpan:1,mergedInto:r.V5.maybe(r.V5.string),borders:r.V5.maybe(y),name:"",custom:r.V5.frozen()}).volatile(()=>({_editModeEnabled:!1,filters:s.LO.map()})).preProcessSnapshot(e=>{if(!e)return e;for(let t in e)null===e[t]&&(e[t]=void 0);let t={};for(let n of E)n in e&&(t[n]=e[n]);for(let n of w)void 0!==e[n]&&(t[`_${n}`]=e[n]);return t}).postProcessSnapshot(e=>{let t={};for(let[n,r]of Object.entries(e))if(n.startsWith("_"))null!=r&&(t[n.slice(1)]=r);else if("borders"===n)null!=r&&"object"==typeof r&&Object.keys(r).length>0&&(t.borders=r);else{if(n in S&&r===S[n])continue;t[n]=r}return t}).views(e=>{let t={get row(){if(!(0,r.fh)(e))return 0;let t=g(e),n=(0,r.G_)(e,1).indexOf(e);return -1===n?0:Math.floor(n/t.cols)},get col(){if(!(0,r.fh)(e))return 0;let t=g(e),n=(0,r.G_)(e,1).indexOf(e);return -1===n?0:n%t.cols},get store(){return(0,r.fh)(e)?(0,r.yj)(e):null},get page(){if(!(0,r.fh)(e))return null;try{return g(e).page}catch(e){return null}},get fontSize(){return v(e,"fontSize",30)},get fontFamily(){return v(e,"fontFamily","Roboto")},get fontWeight(){return v(e,"fontWeight","normal")},get fontStyle(){return v(e,"fontStyle","normal")},get textDecoration(){return v(e,"textDecoration","")},get textTransform(){return v(e,"textTransform","none")},get fill(){return v(e,"fill","black")},get align(){return v(e,"align","left")},get verticalAlign(){return v(e,"verticalAlign","top")},get lineHeight(){return v(e,"lineHeight",1.2)},get letterSpacing(){return v(e,"letterSpacing",0)},get strokeWidth(){return v(e,"strokeWidth",0)},get stroke(){return v(e,"stroke","black")}
126,get cellBackground(){return v(e,"cellBackground","transparent")},get cellPadding(){return v(e,"cellPadding",4)},get width(){if(!(0,r.fh)(e))return 100;try{return g(e).getCellRect(t.row,t.col,e.rowSpan,e.colSpan).width}catch(e){return 100}},get height(){if(!(0,r.fh)(e))return 100;try{return g(e).getCellRect(t.row,t.col,e.rowSpan,e.colSpan).height}catch(e){return 100}},get a(){var n;if(!(0,r.fh)(e))return{x:0,y:0,width:100,height:100,rotation:0,opacity:1,fontSize:16};let i=g(e).getCellRect(t.row,t.col,e.rowSpan,e.colSpan),a=t.cellPadding;return{x:i.x+a,y:i.y+a,width:i.width-2*a,height:i.height-2*a,rotation:0,opacity:null!==(n=e.opacity)&&void 0!==n?n:1,fontSize:t.fontSize}},getEffectiveBorder(t){var n,i,a,o,l,s,c;let u=(0,r.fh)(e)?g(e):null,d=null===(n=e.borders)||void 0===n?void 0:n[t];return{color:null!==(a=null!==(i=null==d?void 0:d.color)&&void 0!==i?i:null==u?void 0:u.borderColor)&&void 0!==a?a:"#000000",width:null!==(l=null!==(o=null==d?void 0:d.width)&&void 0!==o?o:null==u?void 0:u.borderWidth)&&void 0!==l?l:1,style:null!==(c=null!==(s=null==d?void 0:d.style)&&void 0!==s?s:null==u?void 0:u.borderStyle)&&void 0!==c?c:"solid"}},get x(){return 0},get y(){return 0},get rotation(){return 0},get draggable(){return!1},get resizable(){return!1},get selectable(){return!1},get removable(){return!1},get contentEditable(){return!0},get visible(){return!0},get showInExport(){return!0},get alwaysOnTop(){return!1},get placeholder(){return""},get backgroundEnabled(){return!1},get backgroundOpacity(){return 1},get backgroundColor(){return"transparent"},get backgroundCornerRadius(){return 0},get backgroundPadding(){return 0},get curveEnabled(){return!1},get curvePower(){return 0},get shadowEnabled(){return!1},get shadowBlur(){return 0},get shadowOffsetX(){return 0},get shadowOffsetY(){return 0},get shadowColor(){return"black"},get shadowOpacity(){return 1},get blurEnabled(){return!1},get blurRadius(){return 0},get brightnessEnabled(){return!1},get brightness(){return 0},get sepiaEnabled(){return!1},get grayscaleEnabled(){return!1},get animations(){return T}};return t}).actions(e=>({toJSON:()=>Object.assign({},(0,r.vM)(e)),set(t){let n={};for(let[e,r]of Object.entries(t))x.has(e)?n[`_${e}`]=r:"borders"===e?n.borders=r?JSON.parse(JSON.stringify(r)):r:k.has(e)||(n[e]=r);Object.assign(e,n)},setBorder(t,n){let i=e.borders?Object.assign({},(0,r.vM)(e.borders)):{},a=Object.assign({},i[t]||{});void 0!==n.color&&(a.color=n.color),void 0!==n.width&&(a.width=n.width),void 0!==n.style&&(a.style=n.style),i[t]=a,e.borders=(0,r.pj)(i)},toggleEditMode(t){let n=null!=t?t:!e._editModeEnabled;n!==e._editModeEnabled&&(e._editModeEnabled=n,e._editModeEnabled?e.store.history.startTransaction():e.store.history.endTransaction())}}));function M(e){return Array.from({length:e},()=>1/e)}function R(e){let t=e.reduce((e,t)=>e+t,0);return 0===t?M(e.length):e.map(e=>e/t)}let A=o.bn.named("Table").props({type:"table",width:300,height:200,rows:3,cols:3,colWidths:r.V5.array(r.V5.number),rowHeights:r.V5.array(r.V5.number),cells:r.V5.array(P),borderColor:"#000000",borderWidth:1,borderStyle:r.V5.optional(r.V5.enumeration(["solid","dashed","dotted","none"]),"solid"),fontSize:30,fontFamily:"Roboto",fontWeight:"normal",fontStyle:"normal",textDecoration:"",textTransform:"none",fill:"black",align:"left",verticalAlign:"top",lineHeight:r.V5.optional(r.V5.union(r.V5.number,r.V5.string),1.2),letterSpacing:0,strokeWidth:0,stroke:"black",cellBackgroun
126d:"transparent",cellPadding:4}).postProcessSnapshot(e=>{for(let t of(e.cells&&((e=Object.assign({},e)).cells=e.cells.map(t=>{let n={};for(let[r,i]of Object.entries(t))x.has(r)&&i===e[r]||(n[r]=i);return n})),C))delete e[t];return e}).volatile(()=>({_focusedCellIds:[],_editingCellId:void 0,_anchorCellId:void 0,_cellContentHeights:s.LO.map(),_baseRowHeights:null,_baseHeight:null,_isResizingRows:!1,_isTransforming:!1})).actions(e=>({afterCreate(){let t=e.rows*e.cols;if(0===e.cells.length)e.cells.replace((0,r.pj)(function(e,t){let n=[];for(let r=0;r<e*t;r++)n.push({id:(0,i.x0)(10),text:""});return n}(e.rows,e.cols)));else if(e.cells.length<t)for(;e.cells.length<t;)e.cells.push((0,r.pj)({id:(0,i.x0)(10),text:""}));else e.cells.length>t&&e.cells.splice(t);0===e.colWidths.length&&e.colWidths.replace(M(e.cols)),0===e.rowHeights.length&&e.rowHeights.replace(M(e.rows))}})).views(e=>({get _cellMap(){let t=new Map,n=e.cols;return e.cells.forEach((e,r)=>{t.set(`${Math.floor(r/n)}:${r%n}`,e)}),t},getActualRowHeight:t=>e.rowHeights[t]*e.height})).views(e=>{let t={getCell:(t,n)=>e._cellMap.get(`${t}:${n}`),get minWidth(){return 20*e.cols},get minHeight(){return 20*e.rows},get actualHeight(){let t=0;for(let n=0;n<e.rows;n++)t+=e.getActualRowHeight(n);return t},getCellRect(t,n,r=1,i=1){let a=0;for(let t=0;t<n;t++)a+=e.colWidths[t]*e.width;let o=0;for(let n=0;n<t;n++)o+=e.getActualRowHeight(n);let l=0;for(let t=n;t<n+i;t++)l+=(e.colWidths[t]||0)*e.width;let s=0;for(let n=t;n<t+r;n++)s+=e.getActualRowHeight(n);return{x:a,y:o,width:l,height:s}},get visibleCells(){return e.cells.filter(e=>!e.mergedInto)},get focusedCells(){return e.cells.filter(t=>e._focusedCellIds.includes(t.id))},get editingCell(){if(e._editingCellId)return e.cells.find(t=>t.id===e._editingCellId)},get _fitRowsToContent(){var n,r;if(e._isResizingRows||e._isTransforming||0===e._cellContentHeights.size)return null;let i=null!==(n=e._baseHeight)&&void 0!==n?n:e.height,a=null!==(r=e._baseRowHeights)&&void 0!==r?r:[...e.rowHeights],o=!1,l=[];for(let n=0;n<e.rows;n++){let r=e.rowHeights[n]*e.height,s=a[n]*i,c=0;for(let r=0;r<e.cols;r++){let i=t.getCell(n,r);if(!i)continue;let a=e._cellContentHeights.get(i.id);void 0!==a&&(c=Math.max(c,a+2*i.cellPadding))}let u=Math.max(c,s);Math.abs(u-r)>1?(l.push(u),o=!0):l.push(r)}if(!o)return null;let s=l.reduce((e,t)=>e+t,0);return{rowHeights:l.map(e=>e/s),height:s}}};return t}).actions(e=>{let t={setCellContentHeight(t,n){e._cellContentHeights.set(t,n)},_applyFitRowsToContent(){null===e._baseRowHeights&&(e._baseRowHeights=[...e.rowHeights],e._baseHeight=e.height);let t=e._fitRowsToContent;t&&(e.height=t.height,e.rowHeights.replace(t.rowHeights))},focusCell(t,n=!1){n?e._focusedCellIds.includes(t)||(e._focusedCellIds=[...e._focusedCellIds,t]):(e._focusedCellIds=[t],e._anchorCellId=t)},focusCellRange(t,n){let r=e.cells.find(t=>t.id===e._anchorCellId);if(!r)return;let i=Math.min(r.row,t),a=Math.max(r.row,t),o=Math.min(r.col,n),l=Math.max(r.col,n),s=[];for(let t of e.cells)t.row>=i&&t.row<=a&&t.col>=o&&t.col<=l&&s.push(t.id);e._focusedCellIds=s},clearCellFocus(){if((0,r.fh)(e)){if(e._editingCellId){let t=e.cells.find(t=>t.id===e._editingCellId);t&&t.toggleEditMode(!1)}e._focusedCellIds=[],e._editingCellId=void 0,e._anchorCellId=void 0}},enterCellEdit(t){e._editingCellId=t,e._focusedCellIds.includes(t)||(e._focusedCellIds=[t]);let n=e.cells.find(e=>e.id===t);n&&n.toggleEditMode(!0)},exitCellEdit(){if(e._editingCellId){let t=e.cells.find(t=>t.id===e._editingCellId);t&&t.toggleEditMode(!1)}e._editingCellId=void 0},_resetBaseRowHeights(){e._baseRowHeights=null,e._baseHeight=null},_setIsResizingRows(t){e._isResizingRows=t},_setIsTransforming(t){e._isTransforming=t},addRow(n){t._resetBaseRowHeights();let a=n>0?n-1:0,o=(e.rowHeights[a]||1/(e.rows+1))*e.height,l=e.height+o,s=[];for(let t=0;t<e.rows;t++)s.push(e.rowHeights[t]*e.height/l);s.splice(n,0,o/l);let c=n*e.cols,u=Array.from({length:e.cols},()=>({id:(0,i.x0)(10),text:""}));e.cells.splice(c,0,...(0,r.pj)(u)),e.rows+=1,e.height=l,e.rowHeights.replace(R(s))},removeRow(n){if(e.rows<=1)return;t._resetBaseRowHeights();let r=n*e.cols,i=[];for(let t=r;t<r+e.cols;t++)i.push(e.cells[t].id);if(e._editingCellId&&i.includes(e._editingCellId)){let t=e.cells.find(t=>
126t.id===e._editingCellId);t&&t.toggleEditMode(!1),e._editingCellId=void 0}e._focusedCellIds=e._focusedCellIds.filter(e=>!i.includes(e)),i.forEach(t=>e._cellContentHeights.delete(t)),e.cells.splice(r,e.cols);let a=[...e.rowHeights];a.splice(n,1),e.rows-=1,e.rowHeights.replace(R(a))},addColumn(t){let n=t>0?t-1:0,a=(e.colWidths[n]||1/(e.cols+1))*e.width,o=e.width+a,l=[];for(let t=0;t<e.cols;t++)l.push(e.colWidths[t]*e.width/o);l.splice(t,0,a/o);let s=e.cols;for(let n=e.rows-1;n>=0;n--)e.cells.splice(n*s+t,0,(0,r.pj)({id:(0,i.x0)(10),text:""}));e.cols+=1,e.width=o,e.colWidths.replace(R(l))},removeColumn(t){if(e.cols<=1)return;let n=e.cols,r=[];for(let i=0;i<e.rows;i++)r.push(e.cells[i*n+t].id);if(e._editingCellId&&r.includes(e._editingCellId)){let t=e.cells.find(t=>t.id===e._editingCellId);t&&t.toggleEditMode(!1),e._editingCellId=void 0}e._focusedCellIds=e._focusedCellIds.filter(e=>!r.includes(e)),r.forEach(t=>e._cellContentHeights.delete(t));for(let r=e.rows-1;r>=0;r--)e.cells.splice(r*n+t,1);let i=[...e.colWidths];i.splice(t,1),e.cols-=1,e.colWidths.replace(R(i))},distributeRowsEvenly(){t._resetBaseRowHeights(),e.rowHeights.replace(M(e.rows))},distributeColumnsEvenly(){e.colWidths.replace(M(e.cols))},resizeColumn(t,n){if(t>=e.cols-1)return;let r=[...e.colWidths],i=r[t]+r[t+1],a=r[t]+n,o=r[t+1]-n;a<.05?(r[t]=.05,r[t+1]=i-.05):o<.05?(r[t+1]=.05,r[t]=i-.05):(r[t]=a,r[t+1]=o),e.colWidths.replace(r)},resizeRow(t,n){if(t>=e.rows-1)return;let r=[...e.rowHeights],i=r[t]+r[t+1],a=r[t]+n,o=r[t+1]-n;a<.05?(r[t]=.05,r[t+1]=i-.05):o<.05?(r[t+1]=.05,r[t]=i-.05):(r[t]=a,r[t+1]=o),e.rowHeights.replace(r)},setCellBorders(t,n,r){let i={top:{side:"bottom",dr:-1,dc:0},bottom:{side:"top",dr:1,dc:0},left:{side:"right",dr:0,dc:-1},right:{side:"left",dr:0,dc:1}};for(let a of t){let t=e.cells.find(e=>e.id===a);if(t)for(let a of n){t.setBorder(a,r);let n=i[a],o=t.row+n.dr,l=t.col+n.dc,s=e.getCell(o,l);s&&s.setBorder(n.side,r)}}}};return t}).actions(e=>({clone(t={},{skipSelect:n=!1}={}){let r=JSON.parse(JSON.stringify(e.toJSON()));if(t.id=t.id||(0,i.x0)(10),r.cells){let e=new Map;r.cells.forEach(t=>{let n=t.id,r=(0,i.x0)(10);e.set(n,r),t.id=r}),r.cells.forEach(t=>{t.mergedInto&&e.has(t.mergedInto)&&(t.mergedInto=e.get(t.mergedInto))})}return Object.assign(r,t),e.page.addElement(r,{skipSelect:n})}}));var L=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let _=(e,t)=>{if(e.children)for(let n of e.children){if(!0===t(n))break;_(n,t)}},I=(e,t)=>{if(e.children)for(let n of e.children){if(!0===t(n))break;I(n,t)}if(e.cells){for(let n of e.cells)if(!0===t(n))break}},O=[...Array(20)].map((e,t)=>r.V5.late(()=>N[t])),D=r.V5.union({dispatcher:e=>{let t=F[e.type];if(!t)throw Error(`Unknown element type: "${e.type}"`);return t}},h,l,c,d,u,f,p,A,r.V5.late(()=>z),...O),z=a.N.named("Group").props({type:"group",children:r.V5.array(D)}).views(e=>({get draggable(){let t=!0;return _(e,e=>{e.draggable||(t=!1)}),t},get resizable(){let t=!0;return _(e,e=>{e.resizable||(t=!1)}),t},get contentEditable(){let t=!0;return _(e,e=>{e.contentEditable||(t=!1)}),t},get styleEditable(){let t=!0;return _(e,e=>{e.styleEditable||(t=!1)}),t},get locked(){let t=!0;return _(e,e=>{e.locked||(t=!1)}),t}})).actions(e=>({set(t){var{draggable:n,contentEditable:r,styleEditable:i,resizable:a}=t,o=L(t,["draggable","contentEditable","styleEditable","resizable"]);void 0!==n&&_(e,e=>{e.set({draggable:n})}),void 0!==r&&_(e,e=>{e.set({contentEditable:r})}),void 0!==i&&_(e,e=>{e.set({styleEditable:i})}),void 0!==a&&_(e,e=>{e.set({resizable:a})}),Object.assign(e,o)},addElement(t,{skipSelect:n=!1}={}){let r=F[t.type];if(!r)return void console.error("Can not find model with type "+t.type);t.children&&t.children.forEach(e=>{e.id=e.id||(0,i.x0)(10)});let a=r.create(Object.assign({id:(0,i.x0)(10)},t));return e.children.push(a),a.selectable&&!n&&e.store.selectElements([a.id]),a},setElementZIndex(t,n){let i=e.children.find(e=>e.id===t);i&&((0,r.og)(i),e.children.remove(i),e.children.splice(n,0,i))}
126,setAnimation(t,n){_(e,e=>{e.setAnimation(t,n)})}})),N=[],F={svg:h,text:l,image:c,group:z,line:d,video:u,figure:f,gif:p,table:A}},23455:function(e,t,n){"use strict";n.d(t,{N:function(){return s}});var r=n(53317),i=n(95433),a=n(60810),o=n(55651),l=n(28117);let s=r.V5.model("Node",{id:r.V5.identifier,type:"none",name:"",opacity:1,custom:r.V5.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(e=>{for(var t in e)null===e[t]&&(e[t]=void 0);return e}).postProcessSnapshot(e=>{let t=Object.assign({},e),n={};for(var r in t)"_"!==r[0]&&(n[r]=e[r]);return n}).views(e=>({get page(){return(0,r.nc)(e,o.T)},get store(){return(0,r.nc)(e,a.yh)},get top(){let t=e;for(;;){if(!(0,r.Kr)(t,l.Jz))return t;t=(0,r.nc)(t,l.Jz)}},get parent(){if((0,r.Kr)(e,l.Jz)){let t=(0,r.nc)(e,l.Jz);return t&&t.children&&t.children.length,t}if((0,r.Kr)(e,o.T)){let t=(0,r.nc)(e,o.T);return t&&t.children&&t.children.length,t}if((0,r.Kr)(e,a.yh)){let t=(0,r.nc)(e,a.yh);return t&&t.pages&&t.pages.length,t}return null},get zIndex(){return e.parent.children.indexOf(e)}})).actions(e=>({toJSON:()=>Object.assign({},(0,r.vM)(e))})).actions(e=>({clone(t={},{skipSelect:n=!1}={}){let r=JSON.parse(JSON.stringify(e.toJSON()));t.id=t.id||(0,i.x0)(10);let a=new Map;return(0,l.nW)(r,e=>{let t=e.id,n=(0,i.x0)(10);a.set(t,n),e.id=n}),(0,l.nW)(r,e=>{e.mergedInto&&a.has(e.mergedInto)&&(e.mergedInto=a.get(e.mergedInto))}),Object.assign(r,t),e.page.addElement(r,{skipSelect:n})},set(t){Object.assign(e,t)},moveUp(){e.page.moveElementsUp([e.id])},moveTop(){e.page.moveElementsTop([e.id])},moveDown(){e.page.moveElementsDown([e.id])},moveBottom(){e.page.moveElementsBottom([e.id])},setZIndex(t){e.parent.setElementZIndex(e.id,t)},beforeDestroy(){}}))},55651:function(e,t,n){"use strict";n.d(t,{T:function(){return s}});var r=n(53317),i=n(95433),a=n(28117),o=n(60810),l=n(57042);let s=r.V5.model("Page",{id:r.V5.identifier,children:r.V5.array(r.V5.late(()=>a.iN)),width:r.V5.optional(r.V5.union(r.V5.number,r.V5.literal("auto")),"auto"),height:r.V5.optional(r.V5.union(r.V5.number,r.V5.literal("auto")),"auto"),background:"white",bleed:0,custom:r.V5.frozen(),duration:5e3,_exporting:!1,_rendering:!1,_forceMount:!1}).postProcessSnapshot(e=>{let t=Object.assign({},e),n={};for(var r in t)"_"!==r[0]&&(n[r]=e[r]);return n}).views(e=>({get store(){return(0,r.nc)(e,o.yh)}})).views(e=>({get startTime(){let t=0;for(let n of e.store.pages){if(n.id===e.id)break;t+=n.duration}return t},get _exportingOrRendering(){return e._exporting||e._rendering}})).views(e=>({get computedWidth(){return"auto"===e.width?e.store.width:e.width},get computedHeight(){return"auto"===e.height?e.store.height:e.height}})).actions(e=>({toJSON:()=>JSON.parse(JSON.stringify((0,r.vM)(e))),_forEachElementUp(t,n){let r=t.map(t=>({id:t,index:e.children.findIndex(e=>e.id===t)}));for(let{index:i}of(r.sort((e,t)=>t.index-e.index),r)){if(-1==i)continue;let r=i<e.children.length-1&&e.children[i+1],a=t.indexOf(null==r?void 0:r.id)>=0;i===e.children.length-1||a||n(i)}},_forEachElementDown(t,n){let r=t.map(t=>({id:t,index:e.children.findIndex(e=>e.id===t)}));for(let{index:i}of(r.sort((e,t)=>e.index-t.index),r)){if(-1==i)continue;let r=i>0&&e.children[i-1],a=t.indexOf(null==r?void 0:r.id)>=0;0===i||a||n(i)}return!1}})).actions(e=>{let t={clone(t={}){let n=e.toJSON(),r=new Map;n.children.forEach(e=>{let t=e.id,n=(0,i.x0)(10);r.set(t,n),e.id=n,(0,a.nW)(e,e=>{let t=e.id,n=(0,i.x0)(10);r.set(t,n),e.id=n})}),n.children.forEach(e=>{e.cells&&e.cells.forEach(e=>{e.mergedInto&&r.has(e.mergedInto)&&(e.mergedInto=r.get(e.mergedInto))})});let o=Object.assign(Object.assign(Object.assign({},n),{id:(0,i.x0)(10)}),t),l=e.store.addPage(o),s=e.store.pages.indexOf(e);return l.setZIndex(s+1),l.select(),l},setZIndex(t){e.store.setPageZIndex(e.id,t)},set(t){Object.assign(e,t)},select(){e.store.selectPage(e.id)},addElement(t,{skipSelect:n=!1}={}){let r=a.ED[t.type];if(!r)return void console.error("Can not find model with type "+t.type);"children"in t&&Array.isArray(t.children)&&(0,a.nW)(t,e=>{e.id=e.id||(0,i.x0)(10)});let o=e.children.reduce((e,n)=>{if("group"===n.type)return Math.max(e,n.children.reduce((e,n)=>{var r;let i=null===(r=n.name)||void 0===r?void 0:r.match(RegExp(`${t.type}-(\\d+)`));if(i)return Math.max(e,parseInt(i[1],10)||0)},0)||0);{let r=n.name.match(RegExp(`${t.type}-(\\d+)`));if(r)return Math.max(e,parseInt(r[1],10)||0)}return e},0),l=r.create(Object.assign({id:(0,i.x0)(10),name:`${t.type}-${o+1}`},t));return e.children.push(l),l.selectable&&!n&&e.store.selectElements([l.id]),l},canMoveElementsUp(t){let n=!1;return e._forEachElementUp(t,()=>{n=n||!0}),n},moveElementsUp(t){e._forEachElementUp(t,t=>{let n=e.children[t];(0,r.og)(n),e.children.splice(t+1,0,n)})},canMoveElementsTop:e=>t.canMoveElementsUp(e),moveElementsTop(t){let n=[],r=[];
126e.children.forEach(e=>{t.indexOf(e.id)>=0?n.push(e):r.push(e)}),e.children.replace(r.concat(n))},canMoveElementsDown(t){let n=!1;return e._forEachElementDown(t,()=>{n=n||!0}),n},moveElementsDown(t){e._forEachElementDown(t,t=>{let n=e.children[t];(0,r.og)(n),e.children.splice(t-1,0,n)})},canMoveElementsBottom:e=>t.canMoveElementsDown(e),moveElementsBottom(t){let n=[],r=[];e.children.forEach(e=>{t.indexOf(e.id)>=0?n.push(e):r.push(e)}),e.children.replace(n.concat(r))},setElementZIndex(t,n){let i=e.children.find(e=>e.id===t);i&&((0,r.og)(i),e.children.remove(i),e.children.splice(n,0,i))},setSize({width:t,height:n,useMagic:r,softChange:i}){if(r){let r=[],i=t=>"image"===t.type&&t.x<1&&t.y<1&&t.width>=e.computedWidth-2&&t.height>=e.computedHeight-2;(0,a.lc)(e,e=>{"group"!==e.type&&(i(e)||r.push(e))});let o=r.length?(0,l.Ne)(r):{x:0,y:0,width:e.computedWidth,height:e.computedHeight},s=1/4,c=Math.max(0,Math.max(0,Math.min(o.x,e.computedWidth-o.x-o.width))-e.computedWidth*s),u=Math.max(0,Math.max(0,Math.min(o.y,e.computedHeight-o.y-o.height))-e.computedHeight*s),d=e.computedWidth-2*c,h=e.computedHeight-2*u,f=t/d,p=n/h,m=Math.min(f,p),g=(t-d*m)/2-c*m,v=(n-h*m)/2-u*m;(0,a.lc)(e,e=>{var t;if("group"!==e.type){if(i(e))e.set({x:e.x*m,y:e.y*m,width:e.width*f,height:e.height*p,cropX:0,cropY:0,cropWidth:1,cropHeight:1});else if(e.set({x:g+e.x*m,y:v+e.y*m,width:e.width*m,height:e.height*m}),"text"===e.type)e.set({fontSize:e.fontSize*m});else if("figure"===e.type)e.set({strokeWidth:e.strokeWidth*m});else if("table"===e.type)for(let n of(e.set({borderWidth:e.borderWidth*m}),e.cells)){let e={fontSize:n.fontSize*m,cellPadding:n.cellPadding*m};if(n.borders){let r=JSON.parse(JSON.stringify(n.borders));for(let e of["top","right","bottom","left"])null!=(null===(t=r[e])||void 0===t?void 0:t.width)&&(r[e]=Object.assign(Object.assign({},r[e]),{width:r[e].width*m}));e.borders=r}n.set(e)}}})}i||(e.width=t),i||(e.height=n)}};return t}).actions(e=>({moveElementUp(t){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),e.moveElementsUp([t])},moveElementDown(t){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),e.moveElementsDown([t])},moveElementTop(t){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),e.moveElementsTop([t])},moveElementBottom(t){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),e.moveElementsBottom([t])},play(){e.store.play({startTime:e.startTime,endTime:e.startTime+e.duration})}}))},1979:function(e,t,n){"use strict";n.d(t,{lo:function(){return p},bn:function(){return m}});var r=n(53317),i=n(57042);let a={right:{from:{x:-200},to:{x:0}},left:{from:{x:200},to:{x:0}},up:{from:{y:200},to:{y:0}},down:{from:{y:-200},to:{y:0}},"bottom-right":{from:{x:-200,y:-200},to:{x:0,y:0}},"bottom-left":{from:{x:200,y:-200},to:{x:0,y:0}},"top-right":{from:{x:-200,y:200},to:{x:0,y:0}},"top-left":{from:{x:200,y:200},to:{x:0,y:0}}},o={right:{cropX:-1},left:{cropX:1},up:{cropY:1},down:{cropY:-1}},l={none:()=>({}),fade:({dTime:e,element:t,animation:n})=>{let r=e/n.duration;return"enter"===n.type?{opacity:r*t.opacity}:{opacity:(1-r)*t.opacity}},rotate:({dTime:e,element:t,animation:n})=>{let r=e/n.duration*360;return(0,i.Pl)({x:t.x,y:t.y,width:t.width,height:t.height,rotation:t.rotation},r)},blink:({dTime:e,element:t,animation:n})=>{let r=n.duration,i=e%r/(r/2);return{opacity:t.opacity*(i<=1?i:2-i)}},bounce:({dTime:e,element:t,animation:n})=>{var r;let i=n.duration,a=null!==(r=n.data.strength)&&void 0!==r?r:1,o={},l={x:t.x+t.width/3*a,y:t.y+t.height/3*a,width:t.width/3*a,height:t.height/3*a,fontSize:t.fontSize/3*a},s={x:t.x,y:t.y,width:t.width,height:t.height,fontSize:t.fontSize},c=e%i/(i/2),u=c<=1?c:2-c;for(let e in l){let t=l[e],n=s[e]-t;o[e]=t+u*n}return o},move:({dTime:e,element:t,animation:n})=>{var r;let i=a[n.data.direction]||a.right,o=null!==(r=n.data.strength)&&void 0!==r?r:1,l={};for(var s in i.from){let r=i.from[s],a=i.to[s];"exit"===n.type&&(r=i.to[s],a=-i.from[s]),r*=o,a*=o;let c=t[s]+r,u=t[s]+a-c;l[s]=c+e/n.duration*u}return l},zoom:({dTime:e,element:t,animation:n})=>{var r;let i={},a=1+(("in"===(n.data.direction||"in")?3/4:5/4)-1)*(null!==(r=n.data.strength)&&void 0!==r?r:1),o=t.rotation*Math.PI/180,l=Math.cos(o),s=Math.sin(o),c=t.width*(1-a),u=t.height*(1-a),d={x:t.x+(c*l-u*s)/2,y:t.y+(c*s+u*l)/2,width:t.width*a,height:t.height*a,fontSize:t.fontSize*a},h={x:t.x,y:t.y,width:t.width,height:t.height,fontSize:t.fontSize};for(var f in d){let t=d[f],r=h[f];if("exit"===n.type){let e=t;t=r,r=e}let a=r-t;i[f]=t+e/n.duration*a}return i},cameraZoom:({dTime:e,element:t,animation:n})=>{var r,i,a;let l={},s=o[n.data.direction||"right"]||o.right,c=null!==(r=n.data.movementStrength)&&void 0!==r?r:.1,u=null!==(i=n.data.shakeStrength)&&void 0!==i?i:.015,d=null!==(a=n.data.zoomStrength)&&void 0!==a?a:.6,h=e/n.duration,f=u*(1-h),p=Math.sin(12*h
126)*f*.7+Math.sin(8*h)*f*.3;"exit"===n.type&&(d=Math.min(d,1-Math.max(t.cropWidth||1,t.cropHeight||1))),n.type;let m=1-Math.pow(1-h,2),g=t.cropX||0,v=t.cropY||0,b=t.cropWidth||1,y=t.cropHeight||1,w,x,C=0,E=0;return s.cropX&&(C=Math.min(s.cropX>0?1-(g+b):g,Math.abs(c))*s.cropX),s.cropY&&(E=Math.min(s.cropY>0?1-(v+y):v,Math.abs(c))*s.cropY),"enter"===n.type?(w=s.cropX?g+C*(1-m):g,x=s.cropY?v+E*(1-m):v):(w=s.cropX?g+C*m:g,x=s.cropY?v+E*m:v),l.cropX=Math.max(0,Math.min(1-b,w+p*b)),l.cropY=Math.max(0,Math.min(1-y,x+p*y)),l.cropWidth=b,l.cropHeight=y,l}},s=({element:e,dTime:t,animation:n})=>{let r=l[n.name];return r?r({element:e,dTime:t,animation:n}):(console.error("Can not find animation type: "+n.name),{})};var c=n(59533),u=n(23455);let d=r.V5.model("Animation",{delay:0,duration:500,enabled:!0,type:r.V5.enumeration("Type",["enter","exit","loop"]),name:"none",data:r.V5.frozen({})}),h=(e,t)=>{let n={};for(let r in t)if("number"==typeof e[r]&&"number"==typeof t[r]){let i=t[r]-e[r];0!==i&&(n[r]=i)}return n},f=r.V5.model("ShapeFilter",{intensity:1}),p=["temperature","contrast","highlights","shadows","white","black","saturation","vibrance"],m=u.N.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:r.V5.array(d),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,filters:r.V5.map(f),shadowEnabled:!1,shadowBlur:5,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black",shadowOpacity:1,visible:!0,draggable:!0,resizable:!0,selectable:!0,contentEditable:!0,styleEditable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(e=>{let t=Object.assign(Object.assign({},e),{x:"x"in e&&e.x||0,y:"y"in e&&e.y||0,filters:"filters"in e?Array.isArray(e.filters)?{}:e.filters:void 0});return"width"in e&&(t.width=t.width||1),"height"in e&&(t.height=t.height||1),"locked"in e&&e.locked&&(t.draggable=!1,t.contentEditable=!1,t.styleEditable=!1,t.resizable=!1,t.removable=!1),t}).views(e=>{var t,n,r,i,a,o;let l={x:null!==(t=e.x)&&void 0!==t?t:0,y:null!==(n=e.y)&&void 0!==n?n:0,width:null!==(r=e.width)&&void 0!==r?r:0,height:null!==(i=e.height)&&void 0!==i?i:0,rotation:null!==(a=e.rotation)&&void 0!==a?a:0,opacity:null!==(o=e.opacity)&&void 0!==o?o:1};for(let t of["x","y","width","height","rotation","opacity","color","fontSize","cropX","cropY","cropWidth","cropHeight"])t in e&&(l[t]=e[t]);let u=(0,c.LO)(l),d=(0,c.aD)(e=>{for(let t in e)u[t]=e[t]}),f=(0,c.aD)(e=>{Object.assign(u,e)}),p=(0,c.aD)(e=>{for(let t in e)"number"==typeof u[t]&&(u[t]=u[t]+e[t])});return{get locked(){return!(e.draggable||e.contentEditable||e.styleEditable||e.resizable)},get a(){let{currentTime:t}=e.store,n={};for(let t in u)n[t]=e[t];if(d(n),0===t)return u;let r=t-e.page.startTime;if(r>e.page.duration||r<0)return u;let i=e.store.animatedElementsIds;if(i.length&&!i.includes(e.id))return u;let a=e.animations.find(e=>"enter"===e.type),o=(null==a?void 0:a.enabled)&&r<a.delay;o&&f({opacity:0});let l=(null==a?void 0:a.enabled)&&r>=a.delay&&r<=a.delay+a.duration;if(l){let t=r-a.delay,n=s({element:e,animation:a,dTime:t});p(h(e,n))}let c=e.animations.find(e=>"exit"===e.type);if(!o&&!l&&(null==c?void 0:c.enabled)&&r>=e.page.duration-c.duration-c.delay&&r<=e.page.duration-c.delay){let t=r-(e.page.duration-c.duration-c.delay),n=s({element:e,animation:c,dTime:t});p(h(e,n))}(null==c?void 0:c.enabled)&&r>=e.page.duration-c.delay&&f({opacity:0});let m=e.animations.find(e=>"loop"===e.type);if(null==m?void 0:m.enabled){let t=s({element:e,animation:m,dTime:r});p(h(e,t))}return u},animated(e){return this.a[e]}}}).actions(e=>({setAnimation(t,n){let r=e.animations.find(e=>e.type===t);r?Object.assign(r,n):e.animations.push(Object.assign({type:t},n))},setFilter(t,n){p.includes(t)||e.filters.forEach((t,n)=>{p.includes(n.toString())||e.filters.delete(n.toString())}),null==n?e.filters.delete(t):e.filters.set(t,{intensity:n})}}))},60810:function(e,t,n){"use strict";n.d(t,{yh:function(){return es},MT:function(){return ec}});var r=n(53317);let i=function(e,t){if(e===t)return!0;if("object"==typeof e&&null!=e&&"object"==typeof t&&null!=t){if(Object.keys(e).length!=Object.keys(t).length)return!1;for(var n in e)if(!t.hasOwnProperty(n)||!i(e[n],t[n]))return!1;return!0}return!1};Object.assign(r.V5);let a=r.V5.model("UndoManager",{history:r.V5.array(r.V5.frozen()),undoIdx:-1,targetPath:""}).views(e=>({get canUndo(){return e.undoIdx>0},get canRedo(){return e.undoIdx<e.history.length-1}})).actions(e=>{let t,n,a=!1,o=null,l=0,s=0,c=()=>s>0;function u(){let e=(0,r.vM)(t);return{pages:e.pages,width:e.width,height:e.height,custom:e.custom,audios:e.audios}}function d(e){let n=!i(t.pages.map(e=>e.id),e.pages.map(e=>e.id)),a=!i(t.custom,e.custom);
126n?(0,r.Xx)(t.pages,e.pages):t.pages.forEach((t,n)=>{(0,r.Xx)(t,e.pages[n])}),a&&t.set({custom:e.custom}),t.setSize(e.width,e.height)}let h={startTransaction(){s++},endTransaction(e){s--,e||h.requestAddState(u())},async ignore(e,t=!1,n=!1){n&&await new Promise(e=>setTimeout(e,10));let r=!!l;l&&h.addUndoState();let i=c();h.startTransaction();let a=s;try{await e()}catch(e){setTimeout(()=>{throw e})}let o=a!==s;h.endTransaction(!o),t||i&&!r||h.replaceState(),o||(clearTimeout(l),l=0)},async transaction(e){await h.ignore(e,!0),h.addUndoState()},requestAddState(e){o=e,l||c()||(a?a=!1:l=setTimeout(()=>{clearTimeout(l=0),c()||h.addUndoState()},100))},addUndoState(){if(a)return void(a=!1);let t=e.history[e.undoIdx];i(o,t)||(clearTimeout(l),l=0,e.history.splice(e.undoIdx+1),e.history.push(o),e.undoIdx=e.history.length-1)},afterCreate(){if(!(t=(0,r.i3)(e,"..")))throw Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");n=(0,r.cf)(t,()=>{h.requestAddState(u())}),0===e.history.length&&h.requestAddState(u())},clear(){clearTimeout(l),l=0,e.history.splice(0,e.history.length),e.undoIdx=-1,h.addUndoState()},beforeDestroy(){n()},undo(){l&&h.addUndoState(),c()?d(e.history[e.undoIdx]):e.canUndo?(e.undoIdx--,a=!0,d(e.history[e.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){l&&h.addUndoState(),e.canRedo?(e.undoIdx++,a=!0,d(e.history[e.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){e.history[e.undoIdx]=u()}};return h});var o=n(95433),l=n(8585),s=n(59533),c=n(34350);let u=null;async function d({width:e,height:t}){return new(await (window.GIF?Promise.resolve(window.GIF):new Promise(e=>{var t=document.createElement("script");t.onload=function(){e(window.GIF)},t.src="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js",document.head.appendChild(t)})))({workers:4,width:e,height:t,workerScript:URL.createObjectURL(new Blob(['// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js\n (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module \'"+o+"\
vendor: 16,352 bytes, line 126
126'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var NeuQuant=require("./TypedNeuQuant.js");var LZWEncoder=require("./LZWEncoder.js");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv="";for(var p=0;p<this.pages.length;p++){for(var i=0;i<ByteArray.pageSize;i++){rv+=ByteArray.charMap[this.pages[p][i]]}}return rv};ByteArray.prototype.writeByte=function(val){if(this.cursor>=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i<l;i++)this.writeByte(string.charCodeAt(i))};ByteArray.prototype.writeBytes=function(array,offset,length){for(var l=length||array.length,i=offset||0;i<l;i++)this.writeByte(array[i])};function GIFEncoder(width,height){this.width=~~width;this.height=~~height;this.transparent=null;this.transIndex=0;this.repeat=-1;this.delay=0;this.image=null;this.pixels=null;this.indexedPixels=null;this.colorDepth=null;this.colorTab=null;this.neuQuant=null;this.usedEntry=new Array;this.palSize=7;this.dispose=-1;this.firstFrame=true;this.sample=10;this.dither=false;this.globalPalette=false;this.out=new ByteArray}GIFEncoder.prototype.setDelay=function(milliseconds){this.delay=Math.round(milliseconds/10)};GIFEncoder.prototype.setFrameRate=function(fps){this.delay=Math.round(100/fps)};GIFEncoder.prototype.setDispose=function(disposalCode){if(disposalCode>=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j<nPix;j++){var index=this.findClosestRGB(this.pixels[k++]&255,this.pixels[k++]&255,this.pixels[k++]&255);this.usedEntry[index]=true;this.indexedPixels[j]=index}};GIFEncoder.prototype.ditherPixels=function(kernel,serpentine){var kernels={FalseFloydSteinberg:[[3/8,1,0],[3/8,0,1],[2/8,1,1]],FloydSteinberg:[[7/16,1,0],[3/16,-1,1],[5/16,0,1],[1/16,1,1]],Stucki:[[8/42,1,0],[4/42,2,0],[2/42,-2,1],[4/42,-1,1],[8/42,0,1],[4/42,1,1],[2/42,2,1],[1/42,-2,2],[2/42,-1,2],[4/42,0,2],[2/42,1,2],[1/42,2,2]],Atkinson:[[1/8,1,0],[1/8,2,0],[1/8,-1,1],[1/8,0,1],[1/8,1,1],[1/8,0,2]]};if(!kernel||!kernels[kernel]){throw"Unknown dithering kernel: "+kernel}var ds=kernels[kernel];var index=0,height=this.height,width=this.width,data=this.pixels;var direction=serpentine?-1:1;this.indexedPixels=new Uint8Array(this.pixels.length/3);for(var y=0;y<height;y++){if(serpentine)direction=direction*-1;for(var x=direction==1?0:width-1,xend=direction==1?width:0;x!==xend;x+=direction){index=y*width+x;var idx=index*3;var r1=data[idx];var g1=data[idx+1];var b1=data[idx+2];idx=this.findClosestRGB(r1,g1,b1);this.usedEntry[idx]=true;this.indexedPixels[index]=idx;idx*=3;var r2=this.colorTab[idx];var g2=this.colorTab[idx+1];var b2=this.colorTab[idx+2];var er=r1-r2;var eg=g1-g2;var eb=b1-b2;for(var i=direction==1?0:ds.length-1,end=direction==1?ds.length:0;i!==end;i+=direction){var x1=ds[i][1];var y1=ds[i][2];if(x1+x>=0&&x1+x<width&&y1+y>=0&&y1+y<height){var d=ds[i][0];idx=index+x1+y1*width;idx*=3;data[idx]=Math.max(0,Math.min(255,data[idx]+er*d));data[idx+1]=Math.max(0,Math.min(255,data[idx+1]+eg*d));data[idx+2]=Math.max(0,Math.min(255,data[idx+2]+eb*d))}}}}};GIFEncoder.prototype.findClosest=function(c,used){return this.findClosestRGB((c&16711680)>>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i<len;index++){var dr=r-(this.colorTab[i++]&255);var dg=g-(this.colorTab[i++]&255);var db=b-(this.colorTab[i++]&255);var d=dr*dr+dg*dg+db*db;if((!used||this.usedEntry[index])&&d<dmin){dmin=d;minpos=index}}return minpos};GIFEncoder.prototype.getImagePixels=function(){var w=this.width;var h=this.height;this.pixels=new Uint8Array(w*h*3);var data=this.image;var srcPos=0;var count=0;for(var i=0;i<h;i++){for(var j=0;j<w;j++){this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];srcPos++}}};GIFEncoder.prototype.writeGraphicCtrlExt=function(){this.out.writeByte(33);this.out.writeByte(249);this.out.writeByte(4);var transp,disp;if(this.transparent===null){transp=0;disp=0}else{transp=1;disp=2}if(this.dispose>=0){disp=dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i<n;i++)this.out.writeByte(0)};GIFEncoder.prototype.writeShort=function(pValue){this.out.writeByte(pValue&255);this.out.writeByte(pValue>>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":2,"./TypedNeuQuant.js":3}],2:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i<hsize;++i)htab[i]=-1}function compress(init_bits,outs){var fcode,c,i,ent,disp,hsize_reg,hshift;g_init_bits=init_bits;clear_flg=false;n_bits=g_init_bits;maxcode=MAXCODE(n_bits);ClearCode=1<<init_bits-1;EOFCode=ClearCode+1;free_ent=ClearCode+2;a_count=0;ent=nextPixel();hshift=0;for(fcode=HSIZE;fcode<65536;fcode*=2)++hshift;hshift=8-hshift;hsize_reg=HSIZE;cl_hash(hsize_reg);output(ClearCode,outs);outer_loop:while((c=nextPixel())!=EOF){fcode=(c<<BITS)+ent;i=c<<hshift^ent;if(htab[i]===fcode){ent=codetab[i];continue}else if(htab[i]>=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<<BITS){codetab[i]=free_ent++;htab[i]=fcode}else{cl_block(outs)}}output(ent,outs);output(EOFCode,outs)}function encode(outs){outs.writeByte(initCodeSize);remaining=width*height;curPixel=0;compress(initCodeSize+1,outs);outs.writeByte(0)}function flush_char(outs){if(a_count>0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<<n_bits)-1}function nextPixel(){if(remaining===0)return EOF;--remaining;var pix=pixels[curPixel++];return pix&255}function output(code,outs){cur_accum&=masks[cur_bits];if(cur_bits>0)cur_accum|=code<<cur_bits;else cur_accum=code;cur_bits+=n_bits;while(cur_bits>=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<<BITS;else maxcode=MAXCODE(n_bits)}}if(code==EOFCode){while(cur_bits>0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],3:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<<intbiasshift;var gammashift=10;var gamma=1<<gammashift;var betashift=10;var beta=intbias>>betashift;var betagamma=intbias<<gammashift-betashift;var initrad=netsize>>3;var radiusbiasshift=6;var radiusbias=1<<radiusbiasshift;var initradius=initrad*radiusbias;var radiusdec=30;var alphabiasshift=10;var initalpha=1<<alphabiasshift;var alphadec;var radbiasshift=8;var radbias=1<<radbiasshift;var alpharadbshift=alphabiasshift+radbiasshift;var alpharadbias=1<<alpharadbshift;var prime1=499;var prime2=491;var prime3=487;var prime4=503;var minpicturebytes=3*prime4;function NeuQuant(pixels,samplefac){var network;var netindex;var bias;var freq;var radpower;function init(){network=[];netindex=new Int32Array(256);bias=new Int32Array(netsize);freq=new Int32Array(netsize);radpower=new Int32Array(netsize>>3);var i,v;for(i=0;i<netsize;i++){v=(i<<netbiasshift+8)/netsize;network[i]=new Float64Array([v,v,v,0]);freq[i]=intbias/netsize;bias[i]=0}}function unbiasnet(){for(var i=0;i<netsize;i++){network[i][0]>>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(j<hi||k>lo){a=radpower[m++];if(j<hi){p=network[j++];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}if(k>lo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i<netsize;i++){n=network[i];dist=Math.abs(n[0]-b)+Math.abs(n[1]-g)+Math.abs(n[2]-r);if(dist<bestd){bestd=dist;bestpos=i}biasdist=dist-(bias[i]>>intbiasshift-netbiasshift);if(biasdist<bestbiasd){bestbiasd=biasdist;bestbiaspos=i}betafreq=freq[i]>>betashift;freq[i]-=betafreq;bias[i]+=betafreq<<gammashift}freq[bestpos]+=beta;bias[bestpos]-=betagamma;return bestbiaspos}function inxbuild(){var i,j,p,q,smallpos,smallval,previouscol=0,startpos=0;for(i=0;i<netsize;i++){p=network[i];smallpos=i;smallval=p[1];for(j=i+1;j<netsize;j++){q=network[j];if(q[1]<smallval){smallpos=j;smallval=q[1]}}q=network[smallpos];if(i!=smallpos){j=q[0];q[0]=p[0];p[0]=j;j=q[1];q[1]=p[1];p[1]=j;j=q[2];q[2]=p[2];p[2]=j;j=q[3];q[3]=p[3];p[3]=j}if(smallval!=previouscol){netindex[previouscol]=startpos+i>>1;for(j=previouscol+1;j<smallval;j++)netindex[j]=i;previouscol=smallval;startpos=i}}netindex[previouscol]=startpos+maxnetpos>>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i<netsize||j>=0){if(i<netsize){p=network[i];dist=p[1]-g;if(dist>=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}if(j>=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}}return best}function learn(){var i;var lengthcount=pixels.length;var alphadec=30+(samplefac-1)/3;var samplepixels=lengthcount/(3*samplefac);var delta=~~(samplepixels/ncycles);var alpha=initalpha;var radius=initradius;var rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i<rad;i++)radpower[i]=alpha*((rad*rad-i*i)*radbias/(rad*rad));var step;if(lengthcount<minpicturebytes){samplefac=1;step=3}else if(lengthcount%prime1!==0){step=3*prime1}else if(lengthcount%prime2!==0){step=3*prime2}else if(lengthcount%prime3!==0){step=3*prime3}else{step=3*prime4}var b,g,r,j;var pix=0;i=0;while(i<samplepixels){b=(pixels[pix]&255)<<netbiasshift;g=(pixels[pix+1]&255)<<netbiasshift;r=(pixels[pix+2]&255)<<netbiasshift;j=contest(b,g,r);altersingle(alpha,j,b,g,r);if(rad!==0)alterneigh(rad,j,b,g,r);pix+=step;if(pix>=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;j<rad;j++)radpower[j]=alpha*((rad*rad-j*j)*radbias/(rad*rad))}}}function buildColormap(){init();learn();unbiasnet();inxbuild()}this.buildColormap=buildColormap;function getColormap(){var map=[];var index=[];for(var i=0;i<netsize;i++)index[network[i][3]]=i;var k=0;for(var l=0;l<netsize;l++){var j=index[l];map[k++]=network[j][0];map[k++]=network[j][1];map[k++]=network[j][2]}return map}this.getColormap=getColormap;this.lookupRGB=inxsearch}module.exports=NeuQuant},{}],4:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require("./GIFEncoder.js");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i<len;i++){page=ref[i];results.push(page.buffer)}return results}();return self.postMessage(frame,transfer)}else{return self.postMessage(frame)}};self.onmessage=function(event){return renderFrame(event.data)}},{"./GIFEncoder.js":1}]},{},[4]);
126\n'],{type:"application/javascript"}))})}var h=n(69295),f=n(1032),p=n(84360);let m=[112,72,89,115],g=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=1&n?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return e})(),v=()=>"undefined"!=typeof globalThis?globalThis.Buffer:void 0,b=(e,t,n)=>{e[t]=n>>>24&255,e[t+1]=n>>>16&255,e[t+2]=n>>>8&255,e[t+3]=255&n},y=(e,t,n)=>{let r=e.indexOf(","),i=(e=>{if("function"==typeof atob){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}let t=v();if(t)return new Uint8Array(t.from(e,"base64"));throw Error("No base64 decoder available")})(r>=0?e.slice(r+1):e),a="image/png"===t?((e,t)=>{let n=(e=>{let t=new Uint8Array(9),n=new DataView(t.buffer);n.setUint32(0,e,!1),n.setUint32(4,e,!1),t[8]=1;let r=new Uint8Array(8+t.length+4);b(r,0,t.length),r.set(m,4),r.set(t,8);let i=new Uint8Array(4+t.length);return i.set(m,0),i.set(t,4),b(r,8+t.length,(e=>{let t=4294967295;for(let n=0;n<e.length;n++)t=g[255&(t^e[n])]^t>>>8;return(4294967295^t)>>>0})(i)),r})(Math.round(t/.0254)),r=((e,t)=>{let n=8;for(;n+8<=e.length;){let r=e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3],i=n+4,a=e.subarray(i,i+4),o=8+r+4;if(t.every((e,t)=>a[t]===e))return{offset:n,totalLength:o};n+=o}return null})(e,m);if(r){let t=new Uint8Array(e.length-r.totalLength+n.length);return t.set(e.slice(0,r.offset),0),t.set(n,r.offset),t.set(e.slice(r.offset+r.totalLength),r.offset+n.length),t}let i=16+(e[8]<<24|e[9]<<16|e[10]<<8|e[11])+4;if(i>e.length)return e;let a=new Uint8Array(e.length+n.length);return a.set(e.slice(0,i),0),a.set(n,i),a.set(e.slice(i),i+n.length),a})(i,n):((e,t)=>{let n=(e=>{let t=2;for(;t+4<e.length&&255===e[t];){let n=e[t+1];if(216===n||217===n){t+=2;continue}let r=e[t+2]<<8|e[t+3];if(r<2)break;if(224===n&&74===e[t+4]&&70===e[t+5]&&73===e[t+6]&&70===e[t+7]&&0===e[t+8])return t;let i=t+2+r;if(i<=t||i>e.length)break;t=i}return -1})(e);if(n>=0){let r=new Uint8Array(e),i=n+11;return r[i]=1,r[i+1]=t>>8&255,r[i+2]=255&t,r[i+3]=t>>8&255,r[i+4]=255&t,r}let r=(e=>{let t=new Uint8Array(18);return t[0]=255,t[1]=224,t[2]=0,t[3]=16,t[4]=74,t[5]=70,t[6]=73,t[7]=70,t[8]=0,t[9]=1,t[10]=1,t[11]=1,t[12]=e>>8&255,t[13]=255&e,t[14]=e>>8&255,t[15]=255&e,t})(t),i=new Uint8Array(e.length+r.length);return i.set(e.subarray(0,2),0),i.set(r,2),i.set(e.subarray(2),2+r.length),i})(i,n);return`data:${t};base64,${(e=>{if("function"==typeof btoa){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}let t=v();if(t)return t.from(e).toString("base64");throw Error("No base64 encoder available")})(a)}`};var w=n(43389),x=n(69389),C=n(27588);async function E(e){for(let t=0;t<30;t++){let t=await e();if(t)return t;await new Promise(e=>setTimeout(e,50))}}var k=n(9051),S=n(72365),T=n(11903),P=n(77555),M=n(42614),R=n(41364),A=n(28117),L=n(218),_=n(94877),I=n(26436),O=n(95710),D=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let z=(e,t,...n)=>({type:e,props:t,children:n||[]}),N=async({element:e,page:t,store:n})=>{var r,i,a;let o,l,{src:s}=e;if("svg"===e.type){let t=await S.uh(s);r=t,(i=(new DOMParser).parseFromString(r,"image/svg+xml")).documentElement.setAttribute("preserveAspectRatio","none"),t=(new XMLSerializer).serializeToString(i),s=Object.keys(e.colorsReplace).length?S.Y_(t,new Map(Object.entries(e.colorsReplace))):S.XP(t)}let c="";e.flipX&&(c+="scaleX(-1)"),e.flipY&&(c+="scaleY(-1)"),c||(c="none");let u={};if("svg"===e.type&&e.maskSrc){let t=await S.d4(s);u["mask-image"]=`url(${t})`,u["mask-size"]="100% 100%",u["mask-position"]="0 0",u["mask-repeat"]="no-repeat",u["-webkit-mask-image"]=`url(${t})`,u["-webkit-mask-size"]="100% 100%",u["-webkit-mask-position"]="0 0",u["-webkit-mask-repeat"]="no-repeat",s=e.maskSrc}else if(e.clipSrc){let t=e.clipSrc,n=await S.d4(t);u["mask-image"]=`url(${n}
126)`,u["mask-size"]="100% 100%",u["mask-position"]="0 0",u["mask-repeat"]="no-repeat",u["-webkit-mask-image"]=`url(${n})`,u["-webkit-mask-size"]="100% 100%",u["-webkit-mask-position"]="0 0",u["-webkit-mask-repeat"]="no-repeat"}let d=await (0,k.po)(s),h=d.width*e.cropWidth,f=d.height*e.cropHeight,p=e.width/e.height,m="svg"===e.type||e.stretchEnabled;m?(o=h,l=f):p>=h/f?(o=h,l=h/p):(o=f*p,l=f);let g=o/d.width,v=l/d.height,b=o/l>e.width/e.height?e.height/l:e.width/o,y=m?e.width/o:b,w=m?e.height/l:b,x=o*y/g,C=l*w/v,E=e.cropX*y*d.width,T=e.cropY*w*d.height;e.flipX&&(E=(1-e.cropX-e.cropWidth)*y*d.width),e.flipY&&(T=(1-e.cropY-e.cropHeight)*w*d.height);let P=e.borderSize&&I.H(e.borderColor),M=P?Math.max(0,e.cornerRadius-e.borderSize):e.cornerRadius,R=z("div",{style:Object.assign(Object.assign({},u),{width:"100%",height:"100%",borderRadius:M+"px",border:e.borderSize&&!P?`${e.borderSize}px solid ${e.borderColor}`:"none",backgroundRepeat:"no-repeat",backgroundImage:`url(${s})`,transform:c,backgroundSize:`${Math.round(x)}px ${Math.round(C)}px`,backgroundPositionX:-Math.round(E)+"px",backgroundPositionY:-Math.round(T)+"px"})});return P?z("div",{style:{width:"100%",height:"100%",borderRadius:e.cornerRadius+"px",background:(a=e.borderColor,I.H(a),a),padding:e.borderSize+"px",boxSizing:"border-box"}},R):R},F=({element:e,type:t})=>{let n={"stroke-width":e.height,stroke:e.color,"stroke-linecap":"round","stroke-linejoin":"round",opacity:e.opacity},r=Object.assign(Object.assign({},n),{fill:e.color}),i=Object.assign(Object.assign({},n),{fill:"none"});return"arrow"===t?z("polyline",Object.assign({points:`${3*e.height},${-(2*e.height)} 0,0 ${3*e.height},${2*e.height}`},i)):"triangle"===t?z("polygon",Object.assign({points:`${3*e.height},${-(2*e.height)} 0,0 ${3*e.height},${2*e.height}`},r)):"bar"===t?z("polyline",Object.assign({points:`0,${-(2*e.height)} 0,${2*e.height}`},i)):"circle"===t?z("circle",Object.assign({cx:2*e.height,cy:0,r:2*e.height},r)):"square"===t?z("polygon",Object.assign({points:`0,${-(2*e.height)} ${4*e.height},${-(2*e.height)} ${4*e.height},${2*e.height} 0,${2*e.height}`},r)):null},B={image:N,svg:N,text:async({element:e,page:t,store:n})=>{let r=I.H(e.fill),i=I.H(e.stroke);if(e.curveEnabled){let t=(0,L.A5)(e.width,e.height,e.curvePower,e.fontSize),n=(0,_.yh)(e.text),a={fontWeight:e.fontWeight||"normal",fontStyle:e.fontStyle||"normal",fill:e.fill||"black"},o=(0,O.$I)(n,a),l=` 127 <svg xmlns="http://www.w3.org/2000/svg" width="${e.width}" height="${e.height}" style="display: block;"> 128 <defs> 129 <path id="curve-${e.id}" d="${t}" fill="none" />`;if(r){let t=`curve-fill-grad-${e.id}`;l+=(0,O.lF)(e.fill,t)}if(i&&e.strokeWidth){let t=`curve-stroke-grad-${e.id}`;l+=(0,O.lF)(e.stroke,t)}l+=`</defs> 130 <text 131 font-family="'${e.fontFamily}'" 132 font-size="${e.fontSize}" 133 font-weight="${e.fontWeight}" 134 font-style="${e.fontStyle}" 135 fill="${r?`url(#curve-fill-grad-${e.id})`:e.fill}" 136 text-anchor="middle" 137 dominant-baseline="central" 138 letter-spacing="${e.letterSpacing*e.fontSize}px"${e.textDecoration?` text-decoration="${e.textDecoration}"`:""}${e.strokeWidth?` stroke="${i?`url(#curve-stroke-grad-${e.id})`:e.stroke}" stroke-width="${e.strokeWidth}" paint-order="stroke fill"`:""}> 139 <textPath href="#curve-${e.id}" startOffset="50%">${o}</textPath> 140 </text> 141 </svg>`;let s=e.backgroundPadding*(e.fontSize*e.lineHeight),c=e.backgroundEnabled&&z("div",{style:{position:"absolute",top:-s/2+"px",left:-s/2+"px",width:e.width+s+"px",height:e.height+s+"px",backgroundColor:e.backgroundColor,opacity:e.backgroundOpacity,borderRadius:e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5)+"px"}}),u=z("div",{style:{width:"100%",height:"100%",position:"absolute",top:0,left:0},innerHTML:l});return z("div",{style:{position:"relative",width:"100%",height:"100%"}},c,u)}let a=e=>({backgroundImage:e,backgroundSize:"100% 100%",backgroundRepeat:"repeat",WebkitBackgroundClip:"text",MozBackgroundClip:"text",backgroundClip:"text",WebkitTextFillColor:"transparent",MozTextFillColor:"transparent",color:"transparent"}),o={top:0,left:0};r&&(o=Object.assign(Object.assign({}
141,o),a(e.fill)));let l=e.backgroundPadding*(e.fontSize*e.lineHeight),s=z("div",{style:{position:"absolute",top:-l/2+"px",left:-l/2+"px",display:e.backgroundEnabled?"block":"none",width:e.width+l+"px",height:e.height+l+"px",backgroundColor:e.backgroundColor,opacity:e.backgroundOpacity,borderRadius:e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5)+"px"}});"middle"===e.verticalAlign?(o.top="50%",o.transform="translateY(-50%)"):"bottom"===e.verticalAlign&&(o.bottom=0);let c=/<[a-z][\s\S]*>/i.test(e.text),u=c?e.text:e.text.split("\n").join("<br />");if(e.strokeWidth&&(i||r&&!i)){let t=Object.assign({position:"absolute",width:e.width+"px",whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:e.fontSize+"px",textAlign:e.align,fontFamily:`'${e.fontFamily}'`,textDecoration:e.textDecoration||"none",textDecorationColor:e.textDecoration?e.fill:void 0,textTransform:e.textTransform||"none",lineHeight:e.lineHeight,letterSpacing:e.letterSpacing*e.fontSize+"px",fontStyle:e.fontStyle,fontWeight:e.fontWeight},o),n=i?Object.assign(Object.assign(Object.assign({},t),a(e.stroke)),{WebkitTextStroke:`${e.strokeWidth}px transparent`}):Object.assign(Object.assign({},t),{color:"transparent",WebkitTextStroke:`${e.strokeWidth}px ${e.stroke}`}),l=r?Object.assign(Object.assign({},t),a(e.fill)):Object.assign(Object.assign({},t),{color:e.fill}),d="el-"+e.id,h=c?`<style>#${d} {${P.p}}</style>`:"",f=z("div",{style:Object.assign(Object.assign({},n),{position:"absolute",top:0,left:0,pointerEvents:"none"}),"aria-hidden":"true",innerHTML:c?`${h}${u}`:u}),p=z("div",Object.assign(Object.assign({style:Object.assign(Object.assign({},l),{position:"relative"})},c?{id:d}:{}),{innerHTML:c?`${h}${u}`:u}));return z("div",{style:{position:"relative",width:"100%",height:"100%"}},s,z("div",{style:{position:"relative",width:e.width+"px"}},f,p))}let d=Object.assign(Object.assign({},o),{position:"absolute",width:e.width+"px",color:e.fill,whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:e.fontSize+"px",textAlign:e.align,fontFamily:`'${e.fontFamily}'`,textDecoration:e.textDecoration||"none",textDecorationColor:e.textDecoration?e.fill:void 0,textTransform:e.textTransform||"none",lineHeight:e.lineHeight,letterSpacing:e.letterSpacing*e.fontSize+"px",fontStyle:e.fontStyle,fontWeight:e.fontWeight,WebkitTextStroke:e.strokeWidth?`${e.strokeWidth}px ${e.stroke}`:void 0,paintOrder:e.strokeWidth?"stroke fill":void 0}),h="el-"+e.id,f=`<style>#${h} {${P.p}}</style>`,p=z("div",Object.assign(Object.assign({style:d},c?{id:h}:{}),{innerHTML:c?`${f}${u}`:u}));return z("div",{style:{position:"relative",width:"100%",height:"100%"}},s,p)},line:async({element:e,page:t,store:n})=>z("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},z("line",{x1:0,y1:e.height/2,x2:e.width,y2:e.height/2,stroke:e.color,"stroke-width":e.height,"stroke-dasharray":e.dash&&e.dash.length?e.dash.map(t=>t*e.height).join(" "):void 0}),z("g",{transform:`translate(0 ${e.height/2})`},F({element:e,type:e.startHead})),z("g",{transform:`translate(${e.width} ${e.height/2}) rotate(180)`},F({element:e,type:e.endHead}))),figure:async({element:e,page:t,store:n,elementHook:r})=>{let i=(0,T.vn)(e);if(e.strokeWidth&&I.H(e.stroke)){let t=`figure-stroke-grad-${e.id}`,n=(0,O.lF)(e.stroke,t);i=(i=i.replace(RegExp(`stroke="${e.stroke.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}"`,"g"),`stroke="url(#${t})"`)).replace("</defs>",`${n}</defs>`)}if(I.H(e.fill)){let t=`figure-fill-grad-${e.id}`,n=(0,O.lF)(e.fill,t);i=(i=i.replace(RegExp(`fill="${e.fill.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}"`,"g"),`fill="url(#${t})"`)).replace("</defs>",`${n}</defs>`)}let a=z("div",{innerHTML:i});return r&&r({dom:a,element:e})||a},group:async({element:e,page:t,store:n,elementHook:r})=>{let i=await Promise.all(e.children.map(e=>H({element:e,page:t,store:n,elementHook:r}))),a=z("div",{style:{transformOrigin:"top left",opacity:e.opacity}},...i);return r&&r({dom:a,element:e})||a},video:async({element:e,page:t,store:n,elementHook:r})=>{let i,a;let{cropX:o,cropY:l,cropWidth:s,cropHeight:c}=e,u=await (0,R.C5)(e.src),d=u.width*s,h=u.height*c,f=e.width/e.height;f>=d/h?(i=d,a=d/f):(i=h*f,a=h);let p=i/s,m=a/c,g=o*u.width,v=l*u.height,b=Math.max(e.width/u.width,e.height/u.height),y={position:"absolute",width:`${Math.round(p*b)}px`,height:`${Math.round(m*b)}px`,left:-Math.round(g*b)+"px",top:-Math.round(v*b)+"px",objectFit:"fill"},w=`video-${e.id}`,x=e.borderSize&&I.H(e.borderColor),C=z("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",borderRadius:(x?Math.max(0,e.cornerRadius-e.borderSize):e.cornerRadius)+"px",border:e.borderSize&&!x?`${e.borderSize}px solid ${e.borderColor}`:"none"}}
141,z("video",{id:w,src:e.src,style:y,controls:!0,playsInline:!0,muted:!0,volume:e.volume}));if(x){var E;let t=z("div",{style:{width:"100%",height:"100%",borderRadius:e.cornerRadius+"px",background:(E=e.borderColor,I.H(E),E),padding:e.borderSize+"px",boxSizing:"border-box"}},C);return r&&r({dom:t,element:e})||t}return r&&r({dom:C,element:e})||C},gif:N,table:async({element:e})=>{let t=e.rows,n=e.cols,r=e.colWidths,i=e.rowHeights,a=["fontSize","fontFamily","fontWeight","fontStyle","textDecoration","textTransform","fill","align","verticalAlign","lineHeight","letterSpacing","strokeWidth","stroke","cellBackground","cellPadding"],o=(e.cells||[]).map(t=>{if(!t)return t;let n=Object.assign({},t);for(let t of a)void 0===n[t]&&(n[t]=e[t]);return n}),l=[];for(let r=0;r<t;r++){let t=[];for(let a=0;a<n;a++){let l=o[r*n+a];if(!l||l.mergedInto)continue;let s=l.cellPadding||4,c=l.colSpan||1,u=l.rowSpan||1,d=t=>{var n,r,i,a,o;let s=null===(n=l.borders)||void 0===n?void 0:n[t];return`${null!==(r=null==s?void 0:s.width)&&void 0!==r?r:e.borderWidth}px ${null!==(a=null!==(i=null==s?void 0:s.style)&&void 0!==i?i:e.borderStyle)&&void 0!==a?a:"solid"} ${null!==(o=null==s?void 0:s.color)&&void 0!==o?o:e.borderColor}`}
141,h={style:{padding:s+"px",background:l.cellBackground||"transparent",fontSize:(l.fontSize||12)+"px",fontFamily:`'${l.fontFamily||"Roboto"}'`,fontWeight:l.fontWeight||"normal",fontStyle:l.fontStyle||"normal",color:l.fill||"black",textAlign:l.align||"left",verticalAlign:l.verticalAlign||"top",lineHeight:String(l.lineHeight||1.2),letterSpacing:l.letterSpacing?l.letterSpacing*(l.fontSize||12)+"px":void 0,textDecoration:l.textDecoration||"none",textTransform:l.textTransform||"none",borderTop:d("top"),borderRight:d("right"),borderBottom:d("bottom"),borderLeft:d("left"),overflow:"hidden",wordBreak:"break-word",whiteSpace:"pre-wrap",height:i[r]*e.height+"px"}};c>1&&(h.colspan=String(c)),u>1&&(h.rowspan=String(u)),t.push(z("td",h,(0,_.av)(l.text||"")))}l.push(z("tr",{},...t))}let s=r.map(e=>z("col",{style:{width:100*e+"%"}}));return z("table",{style:{width:"100%",height:"100%",borderCollapse:"collapse",tableLayout:"fixed"}},z("colgroup",{},...s),z("tbody",{},...l))}};async function H({element:e,page:t,store:n,elementHook:r}){var i;let a=await B[e.type];if(a||(a=()=>z("div",{}),console.error(`HTML export does not support ${e.type} type...`)),!e.visible)return null;let o=await a({element:e,page:t,store:n}),s=[],c=[];if(e.blurEnabled&&s.push(`blur(${e.blurRadius/2}px)`),e.brightnessEnabled&&s.push(`brightness(${100*e.brightness+100}%)`),e.sepiaEnabled&&s.push("sepia()"),e.grayscaleEnabled&&s.push("grayscale()"),e.filters)for(let[t,n]of Object.entries(e.filters)){let e=(0,M.E)(M.z[t],n.intensity);e&&(s.push(e.filter),e.html&&c.push(e.html))}if(e.shadowEnabled){let t=function(e,t){if(1===t)return e;let n=l.Z.Util.colorToRGBA(e);return n?`rgba(${n.r}, ${n.g}, ${n.b}, ${n.a*t})`:e}(e.shadowColor,null!==(i=e.shadowOpacity)&&void 0!==i?i:1);s.push(`drop-shadow(${e.shadowOffsetX}px ${e.shadowOffsetY}px ${e.shadowBlur/2}px ${t})`)}let u=z("div",{id:e.id,style:{position:"absolute",left:e.x+"px",top:e.y+"px",width:e.width+"px",height:e.height+"px",transform:`rotate(${e.rotation}deg)`,transformOrigin:"top left",opacity:e.opacity,display:e.visible&&e.showInExport?"block":"none",filter:s.join(" ")||"none"}},o,...c);return r&&r({dom:u,element:e})||u}async function V({json:e,elementHook:t}){let n=await Promise.all(e.pages.map(n=>(async function({page:e,store:t,elementHook:n}){let r=await Promise.all(e.children.map(r=>H({element:r,page:e,store:t,elementHook:n}))),i="auto"===e.width?t.width:e.width,a="auto"===e.height?t.height:e.height,o={};if(e.background.indexOf("url")>=0||e.background.indexOf("http")>=0||e.background.indexOf(".jpg")>=0||e.background.indexOf(".png")>=0||e.background.indexOf(".jpeg")>=0){let{width:n,height:o}=await (0,k.po)(e.background),l=await N({element:Object.assign({x:0,y:0,width:i,height:a,src:e.background,cornerRadius:0},(0,k.EH)({width:i,height:a},{width:n,height:o})),page:e,store:t});r.unshift(l)}else o=Object.assign(Object.assign({},o),{backgroundColor:e.background});return z("div",{className:"page",id:e.id,style:Object.assign(Object.assign({},o),{width:i+"px",height:a+"px",overflow:"hidden",position:"relative"})},...r)})({page:n,store:e,elementHook:t}))),r=[];(0,A.nW)({children:e.pages},e=>{("text"===e.type||"tablecell"===e.type||"table"===e.type)&&e.fontFamily&&-1===r.indexOf(e.fontFamily)&&r.push(e.fontFamily)});let i=r.map(t=>{let n=e.fonts.find(e=>e.fontFamily===t);return n?z("style",{},(n.styles||(n.url?[{src:`url("${n.url}")`}]:[])).map(e=>` 142 @font-face { 143 font-family: '${n.fontFamily}'; 144 src: ${e.src}; 145 font-style: ${e.fontStyle||"normal"}; 146 font-weight: ${e.fontWeight||"normal"}; 147 font-display: swap; 148 }`).join("\n")):z("link",{href:(0,f.$W)(t),rel:"stylesheet"})});return z("div",{className:"design"},...i,...n)}let j=({dom:e})=>{if("string"==typeof e)return e;if(!e)return"";let t=e.props,{innerHTML:n}=t,r=D(t,["innerHTML"]),i=Object.keys(r).map(e=>{let t;return"style"===e&&"object"==typeof r[e]?`style="${Object.keys(r[e]).filter(t=>null!=r[e][t]).map(t=>`${t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}: ${r[e][t]}`).join("; ")}"`:null==(t=r[e])||""===t?"":"object"==typeof t?`${e}="${Object.keys(t).map(e=>`${e.replace(/-([a-z])/g,e=>e[1].toUpperCase())}:${t[e]};`).join(" ")}"`:`${e}="${t}"`}).filter(e=>e&&e.trim().length>0).join(" ");return`<${e.type} ${i}>${n||e.children.map(e=>j({dom:e})).join("")}</${e.type}>`};async function $({json:e,elementHook:t}){return j({dom:await V({json:e,elementHook:t})})}var U=n(87376).lW,W=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let G=(e,t)=>{if(e.children)for(let n of e.children){if(!0===t(n))break;G(n,t)}if(e.cells){for(let n of e.cells)if(!0===t(n))break}},q=(e,t,...n)=>({type:e,props:t,children:n||[]});function Z(e,t){if(!I.H(e))return null;let{stops:n,rotation:r}=I.l(e),i=r*Math.PI/180,a=n.map(({offset:e,color:t})=>q("stop",{offset:100*e+"%","stop-color":t}));return q("linearGradient",{id:t,x1:100*(.5-.5*Math.sin(i))+"%",y1:100*(.5+.5*Math.cos(i))+"%",x2:100*(.5+.5*Math.sin(i))+"%",y2:100*(.5-.5*Math.cos(i))+"%"},...a)}let X=async e=>{try{let t=await fetch(e);if(void 0!==U){let e=await t.arrayBuffer(),n=U.from(e).toString("base64");return`data:${t.headers.get("content-type")||"image/png"};base64,${n}`}{let e=await t.blob();return new Promise((t,n)=>{let r=new FileReader;r.onloadend=()=>
148t(r.result),r.onerror=n,r.readAsDataURL(e)})}}catch(t){return console.error("Error converting URL to data URL:",t),e}},Y=async({element:e,page:t,store:n})=>{let r,i,{src:a}=e;if("svg"===e.type){let t=await S.uh(a);a=S.Y_(t,new Map(Object.entries(e.colorsReplace)))}else a=await X(a);let o,l,s,c,u="";if(e.flipX||e.flipY){let t=e.flipX?-1:1,n=e.flipY?-1:1,r=e.width/2,i=e.height/2;u=`translate(${r}, ${i}) scale(${t}, ${n}) translate(${-r}, ${-i})`}e.clipSrc&&(o=`clip-img-mask-${e.id}`,l=await X(e.clipSrc)),e.maskSrc&&(s=`mask-img-${e.id}`,c=await X(e.maskSrc));let d=await (0,k.po)(a),h=d.width*e.cropWidth,f=d.height*e.cropHeight,p=e.width/e.height,m="boolean"==typeof e.stretchEnabled&&e.stretchEnabled||"svg"===e.type;m?(r=h,i=f):p>=h/f?(r=h,i=h/p):(r=f*p,i=f);let g=r/d.width,v=i/d.height,b=r/i>e.width/e.height?e.height/i:e.width/r,y=m?e.width/r:b,w=m?e.height/i:b,x=r*y/g,C=i*w/v,E=e.cropX*d.width*y,T=e.cropY*d.height*w;e.flipX&&(E=(1-e.cropX-e.cropWidth)*d.width*y),e.flipY&&(T=(1-e.cropY-e.cropHeight)*d.height*w);let P=`clip-${e.id}`,M=e.cornerRadius||0,R=a.replace(/&/g,"&"),A={x:-E,y:-T,width:x,height:C,preserveAspectRatio:"none","clip-path":`url(#${P})`},L=[q("clipPath",{id:P},q("rect",{x:0,y:0,width:e.width,height:e.height,rx:M||void 0,ry:M||void 0}))];o&&l&&L.push(q("mask",{id:o,maskUnits:"userSpaceOnUse","mask-type":"alpha"},q("image",{href:l.replace(/&/g,"&"),x:0,y:0,width:e.width,height:e.height,preserveAspectRatio:"none"}))),s&&L.push(q("mask",{id:s,maskUnits:"userSpaceOnUse","mask-type":"alpha"},q("image",Object.assign({href:R},A))));let _=R,O={};s&&c&&(_=c.replace(/&/g,"&"),O.mask=`url(#${s})`);let D={};o&&(D.mask=`url(#${o})`);let z=e.borderSize||0,N=z>0&&I.H(e.borderColor),F=N?`border-grad-${e.id}`:null;if(N){let t=Z(e.borderColor,F);t&&L.push(t)}let B=z>0?q("rect",{x:z/2,y:z/2,width:Math.max(0,e.width-z),height:Math.max(0,e.height-z),fill:"none",stroke:N?`url(#${F})`:e.borderColor,"stroke-width":z,rx:Math.max(0,M-z)||void 0,ry:Math.max(0,M-z)||void 0}):null,H=q("g",{},q("defs",{},...L),q("image",Object.assign(Object.assign({href:_},A),O)),B);return q("g",D,u?q("g",{transform:u},H):H)},K=({element:e,type:t})=>{let n={"stroke-width":e.height,stroke:e.color,"stroke-linecap":"round","stroke-linejoin":"round"},r=Object.assign(Object.assign({},n),{fill:e.color}),i=Object.assign(Object.assign({},n),{fill:"none"});return"arrow"===t?q("polyline",Object.assign({points:`${3*e.height},${-(2*e.height)} 0,0 ${3*e.height},${2*e.height}`},i)):"triangle"===t?q("polygon",Object.assign({points:`${3*e.height},${-(2*e.height)} 0,0 ${3*e.height},${2*e.height}`},r)):"bar"===t?q("polyline",Object.assign({points:`0,${-(2*e.height)} 0,${2*e.height}`},i)):"circle"===t?q("circle",Object.assign({cx:2*e.height,cy:0,r:2*e.height},r)):"square"===t?q("polygon",Object.assign({points:`0,${-(2*e.height)} ${4*e.height},${-(2*e.height)} ${4*e.height},${2*e.height} 0,${2*e.height}`},r)):null},J={image:Y,svg:Y,text:async({element:e,page:t,store:n})=>{let r=I.H(e.fill),i=I.H(e.stroke);if(e.curveEnabled){let t=(0,L.A5)(e.width,e.height,e.curvePower,e.fontSize),n=`curve-path-${e.id}`,a=((0,_.av)(e.text).replace(/\n/g," "),(0,_.yh)(e.text)),o={fontWeight:e.fontWeight||"normal",fontStyle:e.fontStyle||"normal",fill:e.fill||"black"},l=(0,O.$I)(a,o),s=(0,O.$I)(a,o,{omitColors:!0}),c=e.backgroundPadding*(e.fontSize*e.lineHeight*.5),u=e.backgroundEnabled?q("rect",{x:-c,y:-c,width:e.width+2*c,height:e.height+2*c,fill:e.backgroundColor,opacity:e.backgroundOpacity,rx:e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5),ry:e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5)}):null,d=[q("path",{id:n,d:t,fill:"none"})],h=e.strokeWidth&&(i||r&&!i);if(r){let t=`curve-fill-grad-${e.id}`,n=Z(e.fill,t);n&&d.push(n)}if(i&&e.strokeWidth){let t=`curve-stroke-grad-${e.id}`,n=Z(e.stroke,t);n&&d.push(n)}if(h){let t={"font-size":e.fontSize+"px","text-anchor":"middle","dominant-baseline":"central","font-family":e.fontFamily,"font-style":e.fontStyle,"font-weight":e.fontWeight,"text-decoration":e.textDecoration||void 0,"letter-spacing":e.letterSpacing*e.fontSize+"px"},a=i?`url(#curve-stroke-grad-${e.id})`:e.stroke,o=q("text",Object.assign(Object.assign({},t),{fill:a,"stroke-width":e.strokeWidth,stroke:a}),q("textPath",{href:`#${n}`,startOffset:"50%",innerHTML:s})),c=r?`url(#curve-fill-grad-${e.id})`:e.fill,h=q("text",Object.assign(Object.assign({},t),{fill:c}),q("textPath",{href:`#${n}`,startOffset:"50%",innerHTML:l}));return q("g",{},u,q("defs",{},...d),o,h)}return q("g",{},u,q("defs",{},...d),q("text",{fill:r?`url(#curve-fill-grad-${e.id})`:e.fill,"font-size":e.fontSize+"px","text-anchor":"middle","dominant-baseline":"central","font-family":e.fontFamily,"font-style":e.fontStyle,"font-weight":e.fontWeight,"text-decoration":e.textDecoration||void 0,"letter-spacing":e.letterSpacing*e.fontSize+"px","stroke-width":e.strokeWidth||void 0,stroke:e.strokeWidth?i?`url(#curve-stroke-grad-${e.id})`:e.stroke:void 0,"paint-order":e.strokeWidth?"stroke fill":void 0},q("textPath",{href:`#${n}`,startOffset:"50%",innerHTML:l})))}let a=(e,t,n,r,i,a=0)=>{let o=document.createElement("canvas").getContext("2d");return o.font=`${i} ${r} ${t}px ${n}`,o.measureText(e).width+Math.max(0,(e?e.length:0)-1)*a*t},o=(e,t,n,r,i,o,l=0)=>{let s=[];
148return e.split("\n").forEach(e=>{let c=e.split(" "),u="";for(let e=0;e<c.length;e++){let d=u+c[e]+" ";a(d,n,r,i,o,l)>t+.5&&e>0?(s.push(u.trim()),u=c[e]+" "):u=d}s.push(u.trim())}),s},l=(0,_.av)(e.text);"uppercase"==e.textTransform&&(l=l.toUpperCase());let s=e.fontSize,c=[];for(;;){let t=Math.max(...(c=o(l,e.width,s,e.fontFamily,e.fontWeight,e.fontStyle,e.letterSpacing)).map(t=>a(t,s,e.fontFamily,e.fontWeight,e.fontStyle,e.letterSpacing))),n=c.length*s*e.lineHeight;if(t<=e.width&&n<=e.height||(s-=1)<4)break}let u=s*e.lineHeight,d=c.length*u,h=s;"middle"===e.verticalAlign?h=(e.height-d)/2+s:"bottom"===e.verticalAlign&&(h=e.height-d+s);let f="center"===e.align?"middle":"right"===e.align?"end":"start",p=c.map((t,n)=>q("tspan",{x:"center"===e.align?e.width/2:"right"===e.align?e.width:0,dy:0===n?0:u,innerHTML:t})),m=e.backgroundPadding*(s*e.lineHeight*.5),g=e.backgroundEnabled?q("rect",{x:-m,y:-m,width:e.width+2*m,height:e.height+2*m,fill:e.backgroundColor,opacity:e.backgroundOpacity,rx:e.backgroundCornerRadius*(s*e.lineHeight*.5),ry:e.backgroundCornerRadius*(s*e.lineHeight*.5)}):null,v=[],b=e.strokeWidth&&(i||r&&!i);if(r){let t=`text-fill-grad-${e.id}`,n=Z(e.fill,t);n&&v.push(n)}if(i&&e.strokeWidth){let t=`text-stroke-grad-${e.id}`,n=Z(e.stroke,t);n&&v.push(n)}if(b){let t={y:h,"font-size":s+"px","text-anchor":f,"font-family":e.fontFamily,"font-style":e.fontStyle,"font-weight":e.fontWeight,"text-decoration":e.textDecoration,"line-height":e.lineHeight,"letter-spacing":e.letterSpacing*s+"px"},n=i?`url(#text-stroke-grad-${e.id})`:e.stroke,a=q("text",Object.assign(Object.assign({},t),{fill:n,"stroke-width":e.strokeWidth,stroke:n}),...p.map(e=>q("tspan",e.props,e.props.innerHTML))),o=r?`url(#text-fill-grad-${e.id})`:e.fill,l=q("text",Object.assign(Object.assign({},t),{fill:o}),...p.map(e=>q("tspan",e.props,e.props.innerHTML)));return q("g",{},g,v.length>0?q("defs",{},...v):null,a,l)}return q("g",{},g,v.length>0?q("defs",{},...v):null,q("text",{fill:r?`url(#text-fill-grad-${e.id})`:e.fill,y:h,"font-size":s+"px","text-anchor":f,"font-family":e.fontFamily,"font-style":e.fontStyle,"font-weight":e.fontWeight,"text-decoration":e.textDecoration,"line-height":e.lineHeight,"letter-spacing":e.letterSpacing*s+"px","stroke-width":e.strokeWidth||void 0,stroke:e.strokeWidth?e.stroke:void 0,"paint-order":e.strokeWidth?"stroke fill":void 0},...p))},line:async({element:e,page:t,store:n})=>q("g",{},q("line",{x1:0,y1:e.height/2,x2:e.width,y2:e.height/2,stroke:e.color,"stroke-width":e.height,"stroke-dasharray":e.dash&&e.dash.length?e.dash.map(t=>t*e.height).join(" "):void 0}),q("g",{transform:`translate(0 ${e.height/2})`},K({element:e,type:e.startHead})),q("g",{transform:`translate(${e.width} ${e.height/2}) rotate(180)`},K({element:e,type:e.endHead}))),figure:async({element:e,page:t,store:n,elementHook:r})=>{let i=(0,T.vn)(e).replace(/<svg[^>]*>/,"").replace(/<\/svg>/,""),a=[];if(e.strokeWidth&&I.H(e.stroke)){let t=`figure-stroke-grad-${e.id}`,n=Z(e.stroke,t);if(n){a.push(n);let r=e.stroke.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");i=i.replace(RegExp(`stroke="${r}"`,"g"),`stroke="url(#${t})"`)}}if(I.H(e.fill)){let t=`figure-fill-grad-${e.id}`,n=Z(e.fill,t);if(n){a.push(n);let r=e.fill.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");i=i.replace(RegExp(`fill="${r}"`,"g"),`fill="url(#${t})"`)}}if(a.length>0){let t=q("g",{},q("defs",{},...a),q("g",{innerHTML:i}));return r&&r({dom:t,element:e})||t}let o=q("g",{innerHTML:i});return r&&r({dom:o,element:e})||o},group:async({element:e,page:t,store:n,elementHook:r})=>{let i=q("g",{style:{"transform-origin":"top left"}},...await Promise.all(e.children.map(e=>Q({element:e,page:t,store:n,elementHook:r}))));return r&&r({dom:i,element:e})||i},gif:Y,table:async({element:e})=>{e.rows;let t=e.cols,n=e.colWidths,r=e.rowHeights,i=["fontSize","fontFamily","fontWeight","fontStyle","textDecoration","textTransform","fill","align","verticalAlign","lineHeight","letterSpacing","strokeWidth","stroke","cellBackgroun
148d","cellPadding"],a=(e.cells||[]).map((n,r)=>{let a=Object.assign(Object.assign({},n),{row:Math.floor(r/t),col:r%t});for(let t of i)void 0===a[t]&&(a[t]=e[t]);return a}),o=[],l=(t,i,a,o)=>{let l=0;for(let t=0;t<i;t++)l+=n[t]*e.width;let s=0;for(let n=0;n<t;n++)s+=r[n]*e.height;let c=0;for(let t=i;t<i+o;t++)c+=(n[t]||0)*e.width;let u=0;for(let n=t;n<t+a;n++)u+=(r[n]||0)*e.height;return{x:l,y:s,width:c,height:u}};for(let e of a)if(!e.mergedInto&&e.cellBackground&&"transparent"!==e.cellBackground){l(e.row,e.col,e.colSpan||1,e.colSpan||1);let{x:t,y:n,width:r,height:i}=l(e.row,e.col,e.rowSpan||1,e.colSpan||1);o.push(q("rect",{x:t,y:n,width:r,height:i,fill:e.cellBackground}))}let s=(e,t)=>"dashed"===e?`${4*t},${2*t}`:"dotted"===e?`${t},${t}`:void 0,c=(t,n)=>{var r,i,a,o,l;let s=null===(r=t.borders)||void 0===r?void 0:r[n];return{width:null!==(i=null==s?void 0:s.width)&&void 0!==i?i:e.borderWidth,style:null!==(o=null!==(a=null==s?void 0:s.style)&&void 0!==a?a:e.borderStyle)&&void 0!==o?o:"solid",color:null!==(l=null==s?void 0:s.color)&&void 0!==l?l:e.borderColor}};for(let e of a){if(e.mergedInto)continue;let t=l(e.row,e.col,e.rowSpan||1,e.colSpan||1);if(0===e.row){let n=c(e,"top");"none"!==n.style&&n.width>0&&o.push(q("line",{x1:t.x,y1:t.y+n.width/2,x2:t.x+t.width,y2:t.y+n.width/2,stroke:n.color,"stroke-width":n.width,"stroke-dasharray":s(n.style,n.width)}))}if(0===e.col){let n=c(e,"left");"none"!==n.style&&n.width>0&&o.push(q("line",{x1:t.x+n.width/2,y1:t.y,x2:t.x+n.width/2,y2:t.y+t.height,stroke:n.color,"stroke-width":n.width,"stroke-dasharray":s(n.style,n.width)}))}{let n=c(e,"bottom");"none"!==n.style&&n.width>0&&o.push(q("line",{x1:t.x,y1:t.y+t.height-n.width/2,x2:t.x+t.width,y2:t.y+t.height-n.width/2,stroke:n.color,"stroke-width":n.width,"stroke-dasharray":s(n.style,n.width)}))}{let n=c(e,"right");"none"!==n.style&&n.width>0&&o.push(q("line",{x1:t.x+t.width-n.width/2,y1:t.y,x2:t.x+t.width-n.width/2,y2:t.y+t.height,stroke:n.color,"stroke-width":n.width,"stroke-dasharray":s(n.style,n.width)}))}}for(let t of a){if(t.mergedInto)continue;let i=(0,_.av)(t.text||"");if(!i)continue;"uppercase"===t.textTransform&&(i=i.toUpperCase());let a=t.cellPadding||4,l=0;for(let r=0;r<t.col;r++)l+=n[r]*e.width;let s=0;for(let n=0;n<t.row;n++)s+=r[n]*e.height;let c=n[t.col]*e.width,u=r[t.row]*e.height,d=t.fontSize||12,h=t.align||"left",f=l+a,p="start";"center"===h?(f=l+c/2,p="middle"):"right"===h&&(f=l+c-a,p="end");let m=s+a+d,g=t.verticalAlign||"top";"middle"===g?m=s+u/2+d/3:"bottom"===g&&(m=s+u-a),o.push(q("text",{x:f,y:m,"font-size":d,"font-family":t.fontFamily||"Roboto","font-weight":t.fontWeight||"normal","font-style":t.fontStyle||"normal",fill:t.fill||"black","text-anchor":p,"text-decoration":t.textDecoration||"none","letter-spacing":t.letterSpacing?t.letterSpacing*d+"px":void 0},i))}return q("g",{},...o)}};async function Q({element:e,page:t,store:n,elementHook:r}){var i;let a=await J[e.type];a||(a=()=>q("g",{}),console.error(`SVG export does not support ${e.type} type...`));let o=await a({element:e,page:t,store:n}),l=[],s=[];if(e.blurEnabled&&l.push(`blur(${e.blurRadius/2}px)`),e.brightnessEnabled&&l.push(`brightness(${100*e.brightness+100}%)`),e.sepiaEnabled&&l.push("sepia()"),e.grayscaleEnabled&&l.push("grayscale()"),e.shadowEnabled&&l.push(`drop-shadow(${e.shadowOffsetX}px ${e.shadowOffsetY}px ${e.shadowBlur}px ${e.shadowColor})`),e.filters)for(let[t,n]of Object.entries(e.filters)){let e=(0,M.E)(M.z[t],n.intensity);if(e&&(l.push(e.filter),e.html)){let t=e.html.replace(/<svg([^>]*)>/,"<g$1>").replace(/<\/svg>/,"</g>");s.push(t)}}let c=q("g",{className:"element",id:e.id,transform:"group"!==e.type?`translate(${e.x}, ${e.y}) rotate(${e.rotation})`:void 0,display:null===(i=e.visible)||void 0===i||i?void 0:"none",opacity:e.opacity,style:{"transform-origin":"top left",filter:l.join(" ")}},o,...s);return r&&r({dom:c,element:e})||c}async function ee(e){try{let t=await fetch(e),n=t.headers.get("content-type")||"font/ttf",r=await t.arrayBuffer();return`data:${n};base64,${void 0!==U?U.from(r).toString("base64"):function(e){let t=new Uint8Array(e),n="";for(let e=0;e<t.length;e+=32768){let r=t.subarray(e,e+32768);n+=String.fromCharCode(...r)}if("undefined"!=typeof btoa)return btoa(n);if(void 0!==U)return U.from(t).toString("base64");throw Error("No base64 encoder available in this environment")}(r)}`}catch(t){return console.error("Error embedding font:",t),e}}async function et({json:e,elementHook:t,fontEmbedding:n="inline"}){let r=[];G({children:e.pages},e=>{("text"===e.type||"tablecell"===e.type||"table"===e.type)&&e.fontFamily&&-1===r.indexOf(e.fontFamily)&&r.push(e.fontFamily)});let i="inline"===n?await async function(e,t){return await Promise.all(e.map(async e=>{var n,r;if("Arial"===e)return null;let i=t.find(t=>t.fontFamily===e);if(i){let t=await ee(i.url);return q("style",{},`@font-face { font-family: ${e}; src: url(${t}); }`)}{let t=`https://fonts.googleapis.com/css?family=${e}:bi,normal,i,b`;try{let i=await fetch(t),a=await i.text(),o=null===(r=null===(n=a.match(/url\((.*?)\)/g))||void 0===n?void 0:n.map(e=>e.replace(/url\((.*?)\)/,"$1")))||void 0===r?void 0:r.filter(e=>e.startsWith("https"));
148if(!(null==o?void 0:o.length))throw Error("No font URLs found");let l=await Promise.all(o.map(async t=>{let n=await ee(t),r=a.match(/font-style:\s*(.*?);/),i=a.match(/font-weight:\s*(.*?);/),o=r?r[1]:"normal",l=i?i[1]:"normal";return`@font-face { 149 font-family: ${e}; 150 font-style: ${o}; 151 font-weight: ${l}; 152 src: url(${n}); 153 }`}));return q("style",{},l.join("\n"))}catch(e){return console.error("Error embedding Google Font:",e),q("defs",{},q("style",{type:"text/css",innerHTML:`@import url('${t}');`.replace(/&/g,"&")}))}}}))}(r,e.fonts):[],a=await Promise.all(e.pages.map(n=>(async function({page:e,store:t,elementHook:n}){let r;let i=await Promise.all(e.children.map(r=>Q({element:r,page:e,store:t,elementHook:n}))),a=e.background.indexOf("url")>=0||e.background.indexOf("http")>=0||e.background.indexOf(".jpg")>=0||e.background.indexOf(".png")>=0||e.background.indexOf(".jpeg")>=0;if(a){let n=await (0,k.po)(e.background);r=await (0,k.xJ)(e.background,Object.assign({width:t.width,height:t.height,x:0,y:0},(0,k.EH)({width:t.width,height:t.height},{width:n.width,height:n.height})))}return q("g",{className:"page",style:{}},a?q("image",{"xlink:href":r,x:0,y:0,width:t.width,height:t.height,preserveAspectRatio:"none"}):q("rect",{x:0,y:0,width:t.width,height:t.height,fill:a?void 0:e.background}),...i)})({page:n,store:e,elementHook:t})));return q("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${e.width} ${e.height}`,width:e.width,height:e.height},...i,...a)}let en=({dom:e,nestLevel:t=0})=>{if("string"==typeof e)return e;if(!e)return"";let n=e.props,{innerHTML:r}=n,i=W(n,["innerHTML"]),a=Object.keys(i).map(e=>{let t;return"object"==typeof(t=i[e])?`${e}="${Object.keys(t).map(e=>`${e}:${t[e]};`).join(" ")}"`:null==t||""===t?"":`${e}="${t}"`}).filter(e=>e&&e.trim().length>0).join(" "),o=" ".repeat(t);return`${o}<${e.type}${a?" "+a:""}>${r||"\n"+e.children.map(e=>en({dom:e,nestLevel:t+1})).join("")}${o}</${e.type}> 154`};async function er({json:e,elementHook:t,fontEmbedding:n="inline"}){return en({dom:await et({json:e,elementHook:t,fontEmbedding:n})})}var ei=n(55651);let ea=r.V5.model("Audio",{id:r.V5.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0,custom:r.V5.frozen()}).actions(e=>({toJSON:()=>Object.assign({},(0,r.vM)(e))})).actions(e=>({set(t){Object.assign(e,t)}}));var eo=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};(0,r.UF)("ignore");let el=r.V5.model("Font",{fontFamily:r.V5.string,url:r.V5.optional(r.V5.string,""),styles:r.V5.frozen()}).preProcessSnapshot(e=>Object.assign(Object.assign({},e),{fontFamily:e.fontFamily||e.name})),es=r.V5.model("Store",{role:"",pages:r.V5.array(ei.T),fonts:r.V5.array(el),audios:r.V5.array(ea),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:r.V5.optional(r.V5.enumeration("UnitType",["pt","mm","cm","in","px"]),"px"),dpi:72,schemaVersion:2,bleedVisible:!1,rulesVisible:!1,distanceGuidesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:r.V5.frozen(),tool:r.V5.optional(r.V5.enumeration("Tool",["selection","draw","pan","text","eraser"]),"selection"),toolOptions:r.V5.optional(r.V5.model({brushType:r.V5.optional(r.V5.enumeration("BrushType",["brush","highlighter"]),"brush"),strokeWidth:r.V5.optional(r.V5.number,5),stroke:r.V5.optional(r.V5.string,"#000000"),opacity:r.V5.optional(r.V5.number,1)}),{}),selectedElementsIds:r.V5.array(r.V5.string),animatedElementsIds:r.V5.array(r.V5.string),history:r.V5.optional(a,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,"undefined"!=typeof window&&window.devicePixelRatio||1),_activePageId:"",_selectedPagesIds:r.V5.array(r.V5.string),_forceShowCredit:!1,_key:"",_validated:!1}).views(e=>{let t=(0,s.Fl)(()=>{let t={};return(0,A.nW)({children:e.pages},e=>(t[e.id]=e,!1)),t},{keepAlive:!0});return{get _idsMap(){return t.get()}}}).views(e=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),e.bleedVisible},get selectedElements(){return e.selectedElementsIds.map(t=>{for(let n of e.pages)for(let e of n.children)if(e.id===t)return e}).filter(e=>!!e)},get children(){return e.pages},get selectedShapes(){let e=[];return(0,A.lc)({children:this.selectedElements},t=>{"group"!==t.type&&e.push(t)}),e},get activePage(){return e.pages.slice().find(t=>
154t.id===e._activePageId)||(e.pages.length?e.pages[0]:null)},get selectedPages(){return e._selectedPagesIds.map(t=>e.pages.find(e=>e.id===t))},get duration(){let t=0;return e.pages.forEach(e=>{t+=e.duration}),t},get _hasCroppedImages(){return this.find(e=>"image"===e.type&&e._cropModeEnabled)},find(t){let n;return(0,A.nW)({children:e.pages},e=>{if(!n&&t(e))return n=e,!0}),n},getElementById:t=>e._idsMap[t]})).actions(e=>{let t=0,n=null,a=!1,s={afterCreate(){e.history.canUndo},setCurrentTime(t){e.currentTime=t},_togglePlaying(t=!e.isPlaying){e.isPlaying=t},play({animatedElementsIds:i=[],startTime:o=0,currentTime:l=0,endTime:c=e.duration,repeat:u=!1}={}){l&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),o=l),e.animatedElementsIds=(0,r.pj)(i),e.currentTime=o,e.isPlaying=!0,t=Date.now(),n=c,a=u,requestAnimationFrame(()=>s.seek())},checkActivePage(){for(let t of e.pages){if(e.currentTime>=t.startTime&&e.currentTime<t.startTime+t.duration){s.selectPage(t.id);break}t.duration}},seek(){if(!e.isPlaying)return;let r=Date.now(),i=r-t;t=r,e.currentTime+=i,s.checkActivePage();let o=n||e.duration;e.isPlaying&&e.currentTime<o?requestAnimationFrame(()=>s.seek()):e.isPlaying&&a?(e.currentTime=0,requestAnimationFrame(()=>s.seek())):s.stop()},stop(){e.isPlaying=!1,e.currentTime=0,e.animatedElementsIds=(0,r.pj)([]),s.checkActivePage()},__(){e._validated||((0,h.qn)(e._key,e._forceShowCredit),e._validated=!0)},set(t){Object.assign(e,t)},setUnit({unit:t,dpi:n}){e.unit=t||e.unit,e.dpi=n||e.dpi},setRole(t){e.role=t},setTool(t){e.tool=t},setToolOptions(t){Object.assign(e.toolOptions,t)},addPage(t){let n=ei.T.create(Object.assign({id:(0,o.x0)(10)},t));return e.pages.push(n),e._activePageId=n.id,n},selectPage(t){e._activePageId=t,1===e._selectedPagesIds.length&&(e._selectedPagesIds=(0,r.pj)([t]))},selectPages(t){e._selectedPagesIds=(0,r.pj)(t),1===e._selectedPagesIds.length&&(e._activePageId=e._selectedPagesIds[0])},selectElements(t){let n=t.map(t=>e.getElementById(t)).sort((e,t)=>e.page.children.indexOf(e)-e.page.children.indexOf(t)).filter(e=>!!e).map(e=>e.id);e.selectedElementsIds=(0,r.pj)(n)},toggleBleed(t){e.bleedVisible=null!=t?t:!e.bleedVisible},toggleRulers(t){e.rulesVisible=null!=t?t:!e.rulesVisible},toggleDistanceGuides(t){e.distanceGuidesVisible=null!=t?t:!e.distanceGuidesVisible},openSidePanel(t){e.openedSidePanel!==t&&(e.previousOpenedSidePanel=e.openedSidePanel,e.openedSidePanel=t)},setScale(t){e.scale=t},_setScaleToFit(t){e.scaleToFit=t},setElementsPixelRatio(t){e._elementsPixelRatio=t},setSize(t,n,r){e.pages.forEach(e=>{e.setSize({width:t,height:n,useMagic:r,softChange:!0})}),e.width=t,e.height=n},setPageZIndex(t,n){let i=e.pages.find(e=>e.id===t);i&&((0,r.og)(i),e.pages.remove(i),e.pages.splice(n,0,i))},deletePages(t){let n=e.pages.indexOf(e.activePage);t.forEach(t=>{let n=e.pages.find(e=>e.id===t);(0,r.ob)(n)});let i=Math.min(e.pages.length-1,n),a=e.pages[i];a&&(e._activePageId=a.id),e.selectedElementsIds=(0,r.pj)(e.selectedElementsIds.filter(t=>e.getElementById(t)))},groupElements(t,n={}){let i=t.map(t=>e.getElementById(t)),a=i[0].page;if(i.forEach(e=>{e&&(0,r.og)(e)}),!i.length)return;let l=a.children.reduce((e,t)=>{if("group"===t.type){let n=t.name.match(/group-(\d+)/);if(n)return Math.max(e,parseInt(n[1],10))}return e},0),s=Object.assign({id:(0,o.x0)(10),name:`group-${l+1}`,children:i,type:"group"},n);return a.children.push(s),e.selectedElementsIds=(0,r.pj)([s.id]),a.children.find(e=>e.id===s.id)},ungroupElements(t){let n=t.map(t=>e.getElementById(t)),i=[];n.forEach(e=>{if(e&&"group"===e.type){let t=e.page,n=t.children.indexOf(e);e.children.forEach(e=>{i.push(e.id)}),e.children.forEach(e=>{(0,r.og)(e),t.children.push(e)}),t.children.splice(n,1)}}),e.selectedElementsIds=(0,r.pj)(i)},deleteElements(t){let n=[];e.find(e=>(t.includes(e.id)&&n.push(e),!1)),n.forEach(e=>{(0,r.ob)(e)}),e.selectedElementsIds=(0,r.pj)(e.selectedElementsIds.filter(t=>e.getElementById(t)))},on(t,n){if("change"===t){let t=s.toJSON();return(0,r.cf)(e,e=>{let r=s.toJSON();i(t,r)||(t=r,n(r))})}}
154,async _toCanvas({pixelRatio:t,ignoreBackground:n,pageId:r,mimeType:i,includeBleed:a,_skipTimeout:o,quickMode:c=!1,_exportCanvases:u}={}){var d;let h=t||1;r=r||(null===(d=e.pages[0])||void 0===d?void 0:d.id);let f=e.pages.find(e=>e.id===r);if(!f)throw Error(`No page for export with id ${r}`);let p=e._elementsPixelRatio;h>e._elementsPixelRatio&&s.setElementsPixelRatio(h),c?null==f||f.set({_forceMount:!0}):null==f||f.set({_exporting:!0});let m=await E(()=>{let e=l.Z.stages.filter(e=>e.getAttr("pageId")===r);return 0===e.length?null:e});if(!m)throw null==f||f.set({_forceMount:!1,_exporting:!1}),s.setElementsPixelRatio(p),Error(`Export is failed. Can not find stage for page ${r}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);m.length>1&&console.error(`Polotno error: Detected several canvas elements for page "${r}" in the document. This is not supported and will lead to incorrect export. Make sure to use unique ids for all pages and make sure you unmount <Workspace /> when it is not needed.`);let g=m[0];await s.waitLoading({_skipTimeout:o});let v=g.findOne(".page-container");if(!v)throw s.setElementsPixelRatio(p),null==f||f.set({_forceMount:!1,_exporting:!1}),Error("Export is failed. Canvas was unmounted.");let b=g.position();g.position({x:0,y:0}),g.find("Transformer").forEach(e=>{e.setAttr("oldVisible",e.visible()),e.visible(!1)}),v.find(".page-background").forEach(e=>e.shadowEnabled(!1)),v.find(".page-background").forEach(e=>e.strokeEnabled(!1)),v.find(".highlighter").forEach(e=>e.visible(!1));let y=v.findOne(".page-background-group"),x=y.clip();y.clip({x:null,y:null,width:null,height:null});let C=v.findOne(".elements-container"),k=C.clip();C.clip({x:null,y:null,width:null,height:null});let S=v.find(e=>!e.visible()&&e.getAttr("editModeEnabled")&&!e.getAttr("hideInExport"));S.forEach(e=>{e.setAttr("oldVisible",e.visible()),e.show()});let T=v.find(e=>e.getAttr("hideInExport"));T.forEach(e=>{e.setAttr("oldVisible",e.visible()),e.hide()}),n&&v.find(".page-background").forEach(e=>e.hide());let P=a?f.bleed:0,M=P;!e.bleedVisible&&a||(e.bleedVisible||a?e.bleedVisible&&a?M=0:e.bleedVisible&&!a&&(M=-f.bleed):M=0);let R=f.computedWidth+2*P,A=f.computedHeight+2*P,L=v.scale();v.scale({x:1,y:1});let _=(0,w.NN)(v,{x:v.x()-M,y:v.y()-M,width:R,height:A,pixelRatio:h,sceneCanvas:null==u?void 0:u.sceneCanvas,bufferCanvas:null==u?void 0:u.bufferCanvas});v.scale(L);let I=_._canvas;if("image/jpeg"===i){let e=I.getContext("2d");e.save(),e.globalCompositeOperation="destination-over",e.fillStyle="white",e.fillRect(0,0,I.width,I.height),e.restore()}return n&&v.find(".page-background").forEach(e=>e.show()),T.forEach(e=>{e.visible(e.getAttr("oldVisible"))}),S.forEach(e=>{e.visible(e.getAttr("oldVisible"))}),v.find(".page-background").forEach(e=>e.shadowEnabled(!0)),v.find(".page-background").forEach(e=>e.strokeEnabled(!0)),g.find("Transformer").forEach(e=>{e.visible(e.getAttr("oldVisible"))}),v.find(".highlighter").forEach(e=>e.visible(!0)),y.clip(x),C.clip(k),g.position(b),null==f||f.set({_exporting:!1,_forceMount:!1}),await Promise.resolve(),s.setElementsPixelRatio(p),I},async toDataURL(t={}){var{mimeType:n,quality:r,dpi:i,dpiMetadata:a="auto"}=t,o=eo(t,["mimeType","quality","dpi","dpiMetadata"]);let c=await s._toCanvas(Object.assign({mimeType:n},o)),u=n||"image/png",d=c.toDataURL(u,r);l.Z.Util.releaseCanvas(c);let h=null!=i?i:e.dpi;return"image/png"!==u&&"image/jpeg"!==u||"never"===a||"auto"===a&&72===h?d:y(d,u,h)},async toBlob(e={}){var{mimeType:t,quality:n}=e,r=eo(e,["mimeType","quality"]);let i=await s._toCanvas(Object.assign({mimeType:t},r)),a=await new Promise(e=>{i.toBlob(e,t,n)});return l.Z.Util.releaseCanvas(i),a},async saveAsImage(e={}){var{fileName:t}=e,n=eo(e,["fileName"]);let r=(n.mimeType||"image/png").split("/")[1];(0,c.S)(await s.toDataURL(n),t||"polotno."+r)},async _toPDF(t){let n=t.dpi||e.dpi,r=t.parallel||1,i=t.unit||("px"===e.unit?"mm":e.unit),a=t.pixelRatio||1,o=t.pageIds||e.pages.map(e=>e.id),l=e.pages.filter(e=>o.includes(e.id)),c=await ((null===(b=window.jspdf)||void 0===b?void 0:b.jsPDF)?Promise.resolve(window.jspdf.jsPDF):u||(u="function"==typeof window.__polotnoLoadJspdf?window.__polotnoLoadJspdf().then(e=>(null==e?void 0:e.jsPDF)||e):new Promise(e=>{var t=document.createElement("script");t.onload=function(){e(window.jspdf.jsPDF)},t.src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/3.0.1/jspdf.umd.min.js",document.head.appendChild(t)}))),d=e=>(0,C.Qh)({px:e,unit:i,dpi:n}),h=t.cropMarkSize||0,f=d(h),p=l[0]||{},m=t.includeBleed?p.bleed:0,g=d(p.computedWidth+2*m+2*f),v=d(p.computedHeight+2*m+2*f);var b,y=new c({unit:i,orientation:g>
154v?"landscape":"portrait",format:[g,v],compress:!0,putOnlyUsedFonts:!0});y.deletePage(1);let w=((e,t)=>{let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n})(l,r),x=0;for(let e of w){let n=e.map(async e=>{let n=t.includeBleed?e.bleed:0,r=e.computedWidth+2*n+2*h,i=e.computedHeight+2*n+2*h,l=d(r),c=d(i),u=0,f=a;for(;u<10;){u+=1;let n=await s.toDataURL(Object.assign(Object.assign({},t),{pageId:e.id,pixelRatio:f,dpiMetadata:"never"}));if(n.length>20)return f!==a&&console.error(`Polotno can not export PDF with current settings. Quality is automatically reduced. pixelRatio was reduced to ${parseFloat(f.toFixed(3))}.`),t.onProgress&&t.onProgress(++x/o.length*.9),{url:n,width:l,height:c,widthPx:r,heightPx:i};f*=.8}});(await Promise.all(n)).filter(e=>void 0!==e).forEach(({url:e,width:t,height:n,widthPx:r,heightPx:a})=>{var o;y.addPage([t,n],t>n?"landscape":"portrait");let l=y.getCurrentPageInfo();switch(i){case"pt":o=1;break;case"mm":o=72/25.4;break;case"cm":o=72/2.54;break;case"in":o=72;break;case"px":o=.75;break;default:throw"Invalid unit: "+i}if(l.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:t*o,topRightY:n*o},l.pageContext.artBox={bottomLeftX:d(h+m)*o,bottomLeftY:d(h+m)*o,topRightX:d(r-h-m)*o,topRightY:d(a-h-m)*o},l.pageContext.bleedBox={bottomLeftX:d(h+m)*o,bottomLeftY:d(h+m)*o,topRightX:d(r-h-m)*o,topRightY:d(a-h-m)*o},f){y.setLineWidth(d(1));let e=f+d(m);y.line(e,0,e,f),y.line(0,e,f,e),y.line(t-e,0,t-e,f),y.line(t,e,t-f,e),y.line(0,n-e,f,n-e),y.line(e,n,e,n-f),y.line(t,n-e,t-f,n-e),y.line(t-e,n,t-e,n-f)}y.addImage(e,f,f,t-2*f,n-2*f,void 0,"FAST")})}return y},toPDFDataURL:async e=>(await s._toPDF(Object.assign({mimeType:"image/jpeg"},e))).output("datauristring"),async toGIFDataURL(t={}){let n=t.pixelRatio||1,r=await d({width:e.width*n,height:e.height*n}),i=1e3/(t.fps||10),a=e.duration/i;for(let t=0;t<a-1;t++){let a=t*i||1;s.setCurrentTime(a);let o=0,l="";for(let t of e.pages)if(o+=t.duration,t.set({_rendering:o>a}),o>a){l=t.id;break}let c=await s._toCanvas({pixelRatio:n,pageId:l,_skipTimeout:!0});r.addFrame(c.getContext("2d"),{delay:i,copy:!0})}for(let t of e.pages)t.set({_rendering:!1});return s.stop(),r.render(),new Promise(e=>{r.on("finished",function(t){var n;(n=new FileReader).onload=function(t){e(t.target.result)},n.readAsDataURL(t)})})},async saveAsGIF(e={}){var{fileName:t}=e,n=eo(e,["fileName"]);let r=await s.toGIFDataURL(n);(0,c.S)(r,t||"polotno.gif")},toHTML:async({elementHook:e}={})=>$({json:s.toJSON(),elementHook:e}),async saveAsHTML({fileName:e,elementHook:t}={}){let n=await s.toHTML({elementHook:t}),r="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(n)));(0,c.S)(r,e||"polotno.html")},async toSVG({elementHook:e,pageId:t,fontEmbedding:n="inline"}={fontEmbedding:"inline"}){var r;let i=s.toJSON();t=t||(null===(r=i.pages[0])||void 0===r?void 0:r.id);let a=i.pages.find(e=>e.id===t);return er({json:Object.assign(Object.assign({},i),{pages:a?[a]:[]}),elementHook:e,fontEmbedding:n})},async saveAsSVG({fileName:e,elementHook:t,pageId:n,fontEmbedding:r="inline"}={}){let i=await s.toSVG({elementHook:t,pageId:n,fontEmbedding:r}),a="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(i)));(0,c.S)(a,e||"polotno.svg")},async saveAsPDF(e={}){var{fileName:t}=e,n=eo(e,["fileName"]);(await s._toPDF(Object.assign({mimeType:"image/jpeg"},n))).save(t||"polotno.pdf")},async waitLoading({_skipTimeout:e=!1}={}){e||await new Promise(e=>setTimeout(e,50)),await (0,x.qY)()},toJSON:()=>({width:e.width,height:e.height,fonts:(0,r.vM)(e.fonts),pages:(0,r.vM)(e.pages),audios:(0,r.vM)(e.audios),unit:e.unit,dpi:e.dpi,custom:e.custom,schemaVersion:e.schemaVersion}),loadJSON(t,n=!1){var i;let a=JSON.parse(JSON.stringify(t)),o=a.schemaVersion||0;o<1&&p.flags.htmlRenderEnabled&&(0,A.nW)({children:a.pages},e=>{if("text"===e.type){let t=16*e.letterSpacing;e.letterSpacing=t/e.fontSize}}),o<2&&(0,A.nW)({children:a.pages},e=>{e.filters&&Object.keys(e.filters).forEach(t=>{if(["warm","cold","natural"].includes(t))return;let n=e.filters[t];n&&"number"==typeof n.intensity&&(n.intensity=n.intensity/100)})}),delete a.schemaVersion;let l=e.activePage?e.pages.indexOf(e.activePage):0,s=null===(i=a.pages[l]||a.pages[0])||void 0===i?void 0:i.id;a._activePageId=s;let c=Object.assign({},(0,r.vM)(e));Object.assign(c,a),c.history=n?(0,r.vM)(e.history):{history:[],undoIdx:-1,targetPath:""},(0,r.Xx)(e,c)},clear({keepHistory:t=!1}={}){let n=e.pages.map(e=>e.id);s.deletePages(n),e.custom=null,t||e.history.clear()},addFont(t){s.removeFont(t.fontFamily),e.fonts.push(t)},removeFont(t){e.fonts.filter(e=>
154e.fontFamily===t).forEach(e=>(0,r.ob)(e))},addAudio(t){let n=ea.create(Object.assign({id:(0,o.x0)(10)},t));e.audios.push(n)},removeAudio(t){let n=e.audios.find(e=>e.id===t);n&&e.audios.remove(n)},async loadFont(t,n,r,i){let a=e.fonts.find(e=>e.fontFamily===t)||f.ER.find(e=>e.fontFamily===t),o=[{fontStyle:"normal",fontWeight:"normal"},{fontStyle:"normal",fontWeight:"bold"}];return a?(a.styles&&(o=a.styles.map(e=>({fontStyle:e.fontStyle||"normal",fontWeight:e.fontWeight||"normal"}))),f.Xo(a)):f.xi(t),n&&r&&!o.some(e=>e.fontStyle===n&&e.fontWeight===r)&&o.push({fontStyle:n,fontWeight:r}),Promise.all(o.map(e=>f.mx(t,e.fontStyle,e.fontWeight,i)))},validate:e=>es.validate(e,[{path:"",type:es}]).map(e=>({path:"store"+e.context.map(e=>e.path).join("."),message:e.message}))};return s});function ec({key:e,showCredit:t}={key:"",showCredit:!1}){return es.create({_forceShowCredit:t,_key:e})}},95433:function(e,t,n){"use strict";n.d(t,{x0:function(){return r}});let r=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>((t&=63)<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"")},17418:function(e,t,n){"use strict";n.d(t,{GR:function(){return u},N6:function(){return c},xb:function(){return d}});var r=n(7653);n(42291),n(3942),n(51413),n(91798),n(44403),n(28164);var i=n(43808),a=n(96283);n(60810);let o=(0,i.Z)("div")` 155 display: flex; 156 height: 100%; 157 width: 100%; 158 max-height: 100vh; 159 160 ${(0,a.wz)("\n flex-direction: column-reverse;\n ")} 161`,l=(0,i.Z)("div")` 162 height: 100%; 163 width: auto; 164 max-height: 100vh; 165 166 ${(0,a.wz)("\n height: auto;\n width: 100vw;\n ")} 167`,s=(0,i.Z)("div")` 168 display: flex; 169 height: 100%; 170 width: 100%; 171 flex: 1; 172 flex-direction: column; 173 position: relative; 174`,c=r.forwardRef((e,t)=>r.createElement(o,Object.assign({},e,{ref:t,className:`bp5-scope ${e.className||""}`.trim()}))),u=r.forwardRef((e,t)=>r.createElement(l,Object.assign({},e,{ref:t}))),d=r.forwardRef((e,t)=>r.createElement(s,Object.assign({},e,{ref:t})))},66967:function(e,t,n){"use strict";n.d(t,{t:function(){return v}});var r=n(7653),i=n(43808),a=n(39174),o=n(54043),l=n(35219),s=n(96283);let c=(0,i.Z)("div",r.forwardRef)` 175 height: 100%; 176 overflow: auto; 177`,u=(0,i.Z)("div")` 178 width: 33%; 179 float: left; 180`,d=(0,i.Z)("div")` 181 padding: 5px; 182 width: 100%; 183 &:hover .credit { 184 opacity: 1; 185 } 186 ${(0,s.wz)("\n .credit {\n opacity: 1;\n }\n ")} 187`,h=(0,i.Z)("div")` 188 border-radius: 5px; 189 position: relative; 190 overflow: hidden; 191 box-shadow: ${e=>e["data-shadowenabled"]?"0 0 5px rgba(16, 22, 26, 0.3), 0 0 0 1px rgba(16, 22, 26, 0.12)":"none"}; 192 193 .bp5-dark & { 194 box-shadow: ${e=>e["data-shadowenabled"]?"0 0 0 1px rgba(255, 255, 255, 0.16)":"none"}; 195 } 196`,f=(0,i.Z)("img")` 197 width: 100%; 198 cursor: pointer; 199 display: block; 200 max-height: 300px; 201 min-height: 50px; 202 object-fit: contain; 203`,p=(0,i.Z)("div")` 204 position: absolute; 205 bottom: 0px; 206 left: 0px; 207 font-size: 10px; 208 padding: 3px; 209 padding-top: 10px; 210 text-align: center; 211 background: linear-gradient( 212 to bottom, 213 rgba(0, 0, 0, 0), 214 rgba(0, 0, 0, 0.4), 215 rgba(0, 0, 0, 0.6) 216 ); 217 width: 100%; 218 opacity: 0; 219 color: white; 220`,m=(0,i.Z)("p")` 221 text-align: center; 222 padding: 30px; 223`,g=({url:e,credit:t,onSelect:n,crossOrigin:i,shadowEnabled:a,itemHeight:o,className:s,onLoad:c,alt:u})=>r.createElement(d,{role:"button",onClick:()=>{n()},className:"polotno-close-panel"},r.createElement(h,{"data-shadowenabled":null==a||a},r.createElement(f,{className:s,style:{height:null!=o?o:"auto"},src:e,draggable:!0,loading:"lazy",crossOrigin:i,alt:u,onDragStart:()=>{(0,l.Gs)(({x:e,y:t},r,i)=>{n({x:e,y:t},r,i)})},onDragEnd:()=>{(0,l.Gs)(null)},onLoad:c}),t&&r.createElement(p,{className:"credit"},t))),v=({images:e,onSelect:t,isLoading:n,getPreview:i,loadMore:l,getCredit:s,getAlt:d,getImageClassName:h,rowsNumber:f,crossOrigin:p="anonymous",shadowEnabled:v,itemHeight:b,error:y,hideNoResults:w=!1})=>{let x=f||2,C=r.useRef(null),E=[];for(var k=0;k<x;k++)E.push((e||[]).filter((e,t)=>t%x===k));let S=r.useRef(null),T=()=>{var t;let r=C.current,i=!!r&&r.scrollHeight>r.offsetHeight+5,a=e&&e.length,o=Array.from(null!==(t=null==r?void 0:r.querySelectorAll("img"))&&void 0!==t?t:[]).every(e=>e.complete);!i&&l&&!n&&a&&o&&(S.current||(S.current=window.setTimeout(()=>{S.current=null,l&&l()},100)))},P=()=>{T()};return r.useEffect(()=>(T(),()=>{null!==S.current&&window.clearTimeout(S.current),S.current=null}),[e&&e.length,n]),r.createElement(c,{onScroll:e=>{let t=e.target.scrollHeight-e.target.scrollTop-e.target.offsetHeight;l&&!n&&t<200&&l()},ref:C},E.map((e,o)=>r.createElement(u,{key:o,style:{width:100/x+"%"}},e.map((e,n)=>r.createElement(g,{url:i(e),onSelect:(n,r,i)=>t(e,n,r,i),key:n,credit:s&&s(e),crossOrigin:p,shadowEnabled:v,itemHeight:b,className:h&&h(e),onLoad:P,alt:d&&d(e)||""})),n&&r.createElement("div",{style:{padding:"30px"}},r.createElement(a.$,null)))),!n&&(!e||!e.length)&&!y&&!w&&r.createElement(m,null,(0,o.t)("sidePanel.noResults")),y&&r.createElement(m,null,(0,o.t)("sidePanel.error")))}},91798:function(e,t,n){"use strict";n.d(t,{Fh:function(){return nK},ts:function(){return M},hs:function(){return n5}});var r,i,a=n(7653),o=n(2027),l=n(33280),s=n(96834),c=n(2374),u=n(95975),d=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);
223return a.createElement(u.l,(0,s.pi)({iconName:"control",ref:t},e),a.createElement("path",{d:n?"M340 200H200V60H340V200zM340 340H200V220H340V340zM180 340H60V60H180V340zM380 400H20C9 400 0 391 0 380V20C0 9 9 0 20 0H380C391 0 400 9 400 20V380C400 391 391 400 380 400zM360 40H40V360H360V40z":"M260 160H160V60H260V160zM260 260H160V180H260V260zM300 320H20C9 320 0 311 0 300V20C0 9 9 0 20 0H300C311 0 320 9 320 20V300C320 311 311 320 300 320zM280 40H40V280H280V40zM140 260H60V60H140V260z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});d.defaultProps={size:c.J.STANDARD},d.displayName="Blueprint5.Icon.Control";var h=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"new-text-box",ref:t},e),a.createElement("path",{d:n?"M380 340H340V380C340 391 331 400 320 400S300 391 300 380V340H260C249 340 240 331 240 320S249 300 260 300H300V260C300 249 309 240 320 240S340 249 340 260V300H380C391 300 400 309 400 320S391 340 380 340zM100 250V230C100 224.4 104.4 220 110 220S120 224.4 120 230V240H160V100H150C144.4 100 140 95.6 140 90C140 84.4 144.4 80 150 80H190C195.6 80 200 84.4 200 90C200 95.6 195.6 100 190 100H180V240H220V230C220 224.4 224.4 220 230 220S240 224.4 240 230V250C240 255.6 235.6 260 230 260H110C104.4 260 100 255.6 100 250zM320 220C309 220 300 211 300 200V40H40V300H200C211 300 220 309 220 320C220 331 211 340 200 340H20C9 340 0 331 0 320V20C0 9 9 0 20 0H320C331 0 340 9 340 20V200C340 211 331 220 320 220z":"M100 190C100 184.4 104.4 180 110 180H140V110C140 104.4 144.4 100 150 100S160 104.4 160 110V180H190C195.6 180 200 184.4 200 190C200 195.6 195.6 200 190 200H110C104.4 200 100 195.6 100 190zM300 280H280V300C280 311 271 320 260 320S240 311 240 300V280H220C209 280 200 271 200 260C200 249 209 240 220 240H240V220C240 209 249 200 260 200S280 209 280 220V240H300C311 240 320 249 320 260C320 271 311 280 300 280zM260 180C249 180 240 171 240 160V60H60V240H160C171 240 180 249 180 260C180 271 171 280 160 280H40C29 280 20 271 20 260V40C20 29 29 20 40 20H260C271 20 280 29 280 40V160C280 171 271 180 260 180z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});h.defaultProps={size:c.J.STANDARD},h.displayName="Blueprint5.Icon.NewTextBox";var f=n(74210),p=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"cloud-upload",ref:t},e),a.createElement("path",{d:n?"M214.2 194.2C210.6 197.8 205.6 200 200 200S189.4 197.8 185.8 194.2L125.8 134.2000000000001C122.2 130.6 120 125.6 120 120C120 109 129 100 140 100C145.6 100 150.6 102.2 154.2 105.8L180 131.8V20C180 9 189 0 200 0S220 9 220 20V131.8L245.8 106C249.4 102.2 254.4 100 260 100C271 100 280 109 280 120C280 125.6 277.8 130.6 274.2000000000001 134.2000000000001L214.2 194.2zM300 320C297.6 320 295.2 319.4 292.8 319.2C276.6 366.2 232.4 400 180 400C113.8 400 60 346.2 60 280C60 279 60.2 278.2 60.2 277.2C25.6 268.4 0 237.4 0 200C0 155.8 35.8 120 80 120C80 136.6 86.8 151.6 97.6 162.4L157.6 222.4C168.4 233.2 183.4 240 200 240S231.6 233.2 242.4000000000001 222.4L302.4000000000001 162.4L302.2000000000001 162.2C312.6 151.8 319.2000000000001 137.6 319.6 121.8C365.6 131.2 400 171.6 400 220C400 275.2 355.2000000000001 320 300 320z":"M174.2 174.2C170.6 177.8 165.6 180 160 180S149.4 177.8 145.8 174.2L85.8 114.2C82.2 110.6 80 105.6 80 100C80 89 89 80 100 80C105.6 80 110.6 82.2 114.2 85.8L140 111.8V20C140 9 149 0 160 0S180 9 180 20V111.8L205.8 86C209.4 82.2 214.4 80 220 80C231 80 240 89 240 100C240 105.6 237.8 110.6 234.2 114.2L174.2 174.2zM240 240C239.4 240 238.6 240 238 239.8C228.8 285.6 188.4 320 140 320C84.8 320 40 275.2 40 220C40 217.8 40.2 215.6 40.4 213.4C16.6 202.2 0 178 0 150C0 121.4 17.2 96.8 41.8 86C40.8 90.6 40 95.2 40 100C40 116.6 46.8 131.6 57.6 142.4L117.6 202.4C128.4 213.2 143.4 220 160 220S191.6 213.2 202.4 202.4L262.4000000000001 142.4C273.2 131.6 280 116.6 280 100C280 96.8 279.6 93.6 279 90.6C303.4 104.4 320 130 320 160C320 204.2 284.2000000000001 240 240 240z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});p.defaultProps={size:c.J.STANDARD},p.displayName="Blueprint5.Icon.CloudUpload";var m=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"layout-grid",ref:t},e),a.createElement("path",{d:n?"M0 360A40 40 0 0 1 80 360A40 40 0 0 1 0 360M160 360A40 40 0 0 1 240 360A40 40 0 0 1 160 360M320 360A40 40 0 0 1 400 360A40 40 0 0 1 320 360M320 200A40 40 0 0 1 400 200A40 40 0 0 1 320 200M320 40A40 40 0 0 1 400 40A40 40 0 0 1 320 40M160 40A40 40 0 0 1 240 40A40 40 0 0 1 160 40M0 40A40 40 0 0 1 80 40A40 40 0 0 1 0 40M0 200A40 40 0 0 1 80 200A40 40 0 0 1 0 200M160 200A40 40 0 0 1 240 200A40 40 0 0 1 160 200":"M40 80C18 80 0 62 0 40C0 18 18 0 40 0S80 18 80 40C80 62 62 80 40 80zM40 200C18 200 0 182 0 160C0 138 18 120 40 120S80 138 80 160C80 182 62 200 40 200zM40 320C18 320 0 302 0 280S18 240 40 240S80 258 80 280S62 320 40 320zM280 240C302 240 320 258 320 280S302 320 28
2230 320S240 302 240 280S258 240 280 240zM280 200C258 200 240 182 240 160C240 138 258 120 280 120S320 138 320 160C320 182 302 200 280 200zM160 320C138 320 120 302 120 280S138 240 160 240S200 258 200 280S182 320 160 320zM280 80C258 80 240 62 240 40C240 18 258 0 280 0S320 18 320 40C320 62 302 80 280 80zM160 200C138 200 120 182 120 160C120 138 138 120 160 120S200 138 200 160C200 182 182 200 160 200zM160 80C138 80 120 62 120 40C120 18 138 0 160 0S200 18 200 40C200 62 182 80 160 80z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});m.defaultProps={size:c.J.STANDARD},m.displayName="Blueprint5.Icon.LayoutGrid";var g=n(84271),v=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"fullscreen",ref:t},e),a.createElement("path",{d:n?"M68.2 360H120C131 360 140 369 140 380S131 400 120 400H20C9 400 0 391 0 380V280C0 269 9 260 20 260S40 269 40 280V331.8L145.8 226C149.4 222.2 154.4 220 160 220C171 220 180 229 180 240C180 245.6 177.8 250.6 174.2 254.2L68.2 360zM160 180C154.4 180 149.4 177.8 145.8 174.2L40 68.2V120C40 131 31 140 20 140S0 131 0 120V20C0 9 9 0 20 0H120C131 0 140 9 140 20S131 40 120 40H68.2L174 145.8C177.8 149.4 180 154.4 180 160C180 171 171 180 160 180zM380 400H280C269 400 260 391 260 380S269 360 280 360H331.8L226 254.2C222.2 250.6 220 245.6 220 240C220 229 229 220 240 220C245.6 220 250.6 222.2 254.2 225.8L360 331.8V280C360 269 369 260 380 260S400 269 400 280V380C400 391 391 400 380 400zM380 140C369 140 360 131 360 120V68.2L254.2 174C250.6 177.8 245.6 180 240 180C229 180 220 171 220 160C220 154.4 222.2 149.4 225.8 145.8L331.8 40H280C269 40 260 31 260 20S269 0 280 0H380C391 0 400 9 400 20V120C400 131 391 140 380 140z":"M68.2 280H100C111 280 120 289 120 300C120 311 111 320 100 320H20C9 320 0 311 0 300V220C0 209 9 200 20 200S40 209 40 220V251.8L105.8 186C109.4 182.2 114.4 180 120 180C131 180 140 189 140 200C140 205.6 137.8 210.6 134.2 214.2L68.2 280zM120 140C114.4 140 109.4 137.8 105.8 134.2L40 68.2V100C40 111 31 120 20 120S0 111 0 100V20C0 9 9 0 20 0H100C111 0 120 9 120 20C120 31 111 40 100 40H68.2L134 105.8C137.8 109.4 140 114.4 140 120C140 131 131 140 120 140zM300 120C289 120 280 111 280 100V68.2L214.2 134C210.6 137.8 205.6 140 200 140C189 140 180 131 180 120C180 114.4 182.2 109.4 185.8 105.8L251.8 40H220C209 40 200 31 200 20C200 9 209 0 220 0H300C311 0 320 9 320 20V100C320 111 311 120 300 120zM300 320H220C209 320 200 311 200 300C200 289 209 280 220 280H251.8L185.8 214.2C182.2 210.6 180 205.6 180 200C180 189 189 180 200 180C205.6 180 210.6 182.2 214.2 185.8L280 251.8V220C280 209 289 200 300 200S320 209 320 220V300C320 311 311 320 300 320z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});v.defaultProps={size:c.J.STANDARD},v.displayName="Blueprint5.Icon.Fullscreen";var b=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"edit",ref:t},e),a.createElement("path",{d:n?"M91.8 148.2L148.4 91.6L301.4 244.6L244.8 301.2000000000001L91.8 148.2zM40 40L128.2 71.8L72 127.6L40 40zM320 360C309 360 299 355.6 291.8 348.2L258.8 315.2L315.4 258.6L348.4 291.6C355.6 299 360 309 360 320C360 342 342 360 320 360z":"M65 114.8L114.4 65.4L248.2 199.2L199 248.8L65 114.8zM19.8 20.2L97 48L47.8 96.8L19.8 20.2zM264.8 300.2C255.2 300.2 246.4 296.2 240 290L211.2 261.2L260.6 211.8L289.4000000000001 240.6C295.8 247 299.6 255.6 299.6 265.4C299.8 284.4 284.2000000000001 300.2 264.8 300.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});b.defaultProps={size:c.J.STANDARD},b.displayName="Blueprint5.Icon.Edit";var y=n(87105),w=n(51453),x=n(43808),C=n(96283),E=n(84360),k=n(74723),S=n(34008),T=n(54043);let P=(0,x.Z)("div")` 224 width: 100%; 225 height: 72px; 226 padding-top: 15px; 227 padding-left: 5px; 228 padding-right: 5px; 229 text-align: center; 230 font-size: 12px; 231 cursor: pointer; 232 white-space: pre; 233 234 .bp5-dark &:hover, 235 .bp5-dark &.active { 236 color: #48aff0 !important; 237 } 238 239 &:hover, 240 &.active { 241 background-color: rgba(19, 124, 189, 0.2); 242 } 243 244 ${(0,C.wz)("\n height: 54px;\n padding-top: 9px;\n min-width: 72px;\n width: min-content;\n ")} 245`,M=({children:e,name:t,onClick:n,active:r,iconSize:i})=>a.createElement(P,{role:"button",onClick:n,className:"polotno-side-panel-tab"+(r?" active":"")},a.createElement("div",{style:{fontSize:(i||14)+"px"}},e),a.createElement("div",{style:{paddingTop:"5px"}},t));var R=n(66967),A=n(38726),L=n(74038),_=n(38872),I=n(82054),O=n(94487),D=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"upload",ref:t},e),a.createElement("path",{d:n?"M200 400C89.6 400 0 310.4 0 200C0 89.6 89.6 0 200 0S400 89.6 400 200C400 310.4 310.4 400 200 400zM280 200C274.4000000000001 200 269.4000000000001 202.2 265.8 205.8L220 251.8V100C220 89 211 80 200 80S180 89 180 100V251.8L134.2 205.8C130.6 202.2 125.6 200 120 200C109 200 100 209 100 220C100 225.6 102.2 230.6 105.8 234.2L185.8 314.2000000000001C189.4 317.8 194.4 320 200 320S210.6 317.8 214.2 314.2L294.2000000000001 234.2C297.8 230.6 300 225.
2456 300 220C300 209 291 200 280 200z":"M160 320C71.6 320 0 248.4 0 160S71.6 0 160 0S320 71.6 320 160S248.4 320 160 320zM220 160C214.4 160 209.4 162.2 205.8 165.8L180 191.8V80C180 69 171 60 160 60S140 69 140 80V191.8L114.2 165.8C110.6 162.2 105.6 160 100 160C89 160 80 169 80 180C80 185.6 82.2 190.6 85.8 194.2L145.8 254.2C149.4 257.8 154.4 260 160 260S170.6 257.8 174.2 254.2L234.2 194.2C237.8 190.6 240 185.6 240 180C240 169 231 160 220 160z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});D.defaultProps={size:c.J.STANDARD},D.displayName="Blueprint5.Icon.Upload";var z=n(87556),N=n(77306);let F=e=>fetch(e).then(e=>e.json()),B=({defaultQuery:e="",timeout:t=1e3,getAPI:n,getSize:r=e=>e.total_pages,fetchFunc:i=F})=>{var o;let l=(0,a.useRef)(e),s=(0,a.useRef)(),{data:c,error:u,size:d,setSize:h,mutate:f}=(0,N.ZP)(e=>n({query:l.current,page:e+1}),i,{revalidateAll:!1,revalidateOnFocus:!1}),p=!c&&!u||!!(d>0&&c&&void 0===c[d-1]),m=0===(null===(o=null==c?void 0:c[0])||void 0===o?void 0:o.length),g=null==c?void 0:c[c.length-1],v=m||g&&r(g)===d;return{setQuery:(0,a.useCallback)(e=>{l.current=e,clearTimeout(s.current),s.current=setTimeout(()=>{f([])},t)},[t,f]),isLoading:p,loadMore:()=>{v||h(d+1)},isReachingEnd:v,data:null==c?void 0:c.filter(Boolean),items:(null==c?void 0:c.flat())||[],hasMore:!v,reset:f,error:u}};async function H(e){return new Promise((t,n)=>{let r=new FileReader;
245r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=e=>n(e)})}var V=n(35219),j=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let $=(0,x.Z)("div")` 246 height: calc(100% - 40px); 247 display: flex; 248 flex-direction: column; 249 250 .bp5-dark & .polotno-text-preview-plain { 251 filter: invert(1); 252 } 253`,U=(0,x.Z)("div")` 254 height: 100px; 255 cursor: pointer; 256 box-shadow: 0 0 5px rgba(16, 22, 26, 0.3); 257 border-radius: 5px; 258 background-color: rgba(0, 0, 0, 0.4); 259 position: relative; 260 font-size: 25px; 261 display: flex; 262 justify-content: center; 263 align-content: center; 264 flex-direction: column; 265 text-align: center; 266 color: white; 267 margin-bottom: 10px; 268`,W=async e=>H(e),G=(0,o.Pi)(({onSelect:e,onRemove:t,font:n})=>a.createElement(U,{style:{fontFamily:n.fontFamily},className:"polotno-font-item",onClick:e},n.fontFamily," text",a.createElement(A.z,{style:{position:"absolute",right:0,bottom:0},minimal:!0,icon:a.createElement(O.r,null),onClick:e=>{e.stopPropagation(),t()}}))),q=e=>{var{onSelect:t}=e,n=j(e,["onSelect"]);return a.createElement(A.z,Object.assign({},n,{draggable:!0,className:"polotno-close-panel",onClick:()=>t(),onDragStart:()=>{(0,V.Gs)(({x:e,y:n})=>{t({x:e,y:n})})},onDragEnd:e=>{(0,V.Gs)(null)}}))},Z=(0,o.Pi)(({store:e})=>{a.useEffect(()=>{e.loadFont("Roboto")},[]);let t=t=>{var n;let r=t.width||e.width/2,i=((null==t?void 0:t.x)||e.width/2)-r/2,a=((null==t?void 0:t.y)||e.height/2)-t.fontSize/2,o=(e.width+e.height)/2160,l=null===(n=e.activePage)||void 0===n?void 0:n.addElement(Object.assign(Object.assign({type:"text",fontFamily:"Roboto"},t),{x:i,y:a,width:r,fontSize:t.fontSize*o}));(0,C.tq)()||null==l||l.toggleEditMode(!0)};a.useEffect(()=>{e.fonts.forEach(t=>e.loadFont(t.fontFamily))},[e.fonts]);let{data:n,error:r}=(0,I.ZP)((0,z.TB)(),F),[i,o]=a.useState("text");return a.createElement("div",{style:{height:"100%",display:"flex",flexDirection:"column"}},a.createElement(L.mQ,{id:"text-panel-tabs",large:!0,onChange:e=>o(String(e))},a.createElement(_.O,{id:"text"},(0,T.t)("sidePanel.text")),a.createElement(_.O,{id:"font"},(0,T.t)("sidePanel.myFonts"))),"text"===i&&a.createElement($,null,a.createElement(q,{style:{marginBottom:"5px",width:"100%",fontSize:"25px",fontFamily:"Roboto"},minimal:!0,onSelect:e=>{t(Object.assign(Object.assign({},e),{fontSize:76,text:(0,T.t)("sidePanel.headerText"),fontFamily:"Roboto"}))}},(0,T.t)("sidePanel.createHeader")),a.createElement(q,{style:{marginBottom:"5px",width:"100%",fontSize:"18px",fontFamily:"Roboto"},minimal:!0,onSelect:e=>{t(Object.assign(Object.assign({},e),{fontSize:44,text:(0,T.t)("sidePanel.subHeaderText"),fontFamily:"Roboto"}))}},(0,T.t)("sidePanel.createSubHeader")),a.createElement(q,{style:{marginBottom:"5px",width:"100%",fontSize:"14px",fontFamily:"Roboto"},minimal:!0,onSelect:e=>{t(Object.assign(Object.assign({},e),{fontSize:30,text:(0,T.t)("sidePanel.bodyText"),fontFamily:"Roboto"}))}},(0,T.t)("sidePanel.createBody")),a.createElement(R.t,{shadowEnabled:!1,images:null==n?void 0:n.items,getPreview:e=>e.preview,getImageClassName:e=>e.json.indexOf("plain")>=0?"polotno-text-preview-plain":"",isLoading:!n,error:r,onSelect:async(t,n)=>{let r=await fetch(t.json),i=await r.json();if(!e.activePage)return;let a=(e.width+e.height)/2160,o=n?n.x-i.width/2*a:e.width/2-i.width/2*a,l=n?n.y-i.height/2*a:e.height/2-i.height/2*a;e.history.transaction(()=>{let t=i.pages[0].children,n=[];t.forEach(t=>{delete t.id;let{id:r}=e.activePage.addElement(Object.assign(Object.assign({},t),{fontSize:t.fontSize*a,x:t.x*a+o,y:t.y*a+l,width:t.width*a,height:t.height*a}));n.push(r)}),e.selectElements(n)})}})),"font"===i&&a.createElement("div",{style:{display:"flex",flexDirection:"column",height:"calc(100% - 50px)"}},a.createElement("label",{htmlFor:"polotno-font-upload"},a.createElement(A.z,{icon:a.createElement(D,null),style:{width:"100%"},onClick:()=>{var e;null===(e=document.querySelector("#polotno-font-upload"))||void 0===e||e.click()}},(0,T.t)("sidePanel.uploadFont")),a.createElement("input",{type:"file",accept:".ttf, .otf, .woff, .woff2, .eot",id:"polotno-font-upload",style:{display:"none"},onChange:async t=>{let{target:n}=t;
268for(let t of n.files){let n=await W(t),r=t.name.split(".")[0].replace(/,/g,"");e.addFont({fontFamily:r,url:n})}n.value=null}})),a.createElement("div",{style:{paddingTop:"20px",overflow:"auto",height:"100%"}},e.fonts.map((n,r)=>a.createElement(G,{font:n,key:r,onSelect:()=>{t({fontSize:80,text:"Cool text",fontFamily:n.fontFamily})},onRemove:()=>{e.find(e=>("text"===e.type&&e.fontFamily===n.fontFamily&&e.set({fontFamily:"Roboto"}),!1)),e.removeFont(n.fontFamily)}})))))});var X=n(20952),Y=n(53466),K=n(52956),J=n(59799),Q=n(88876),ee=n(17785),et=n(45254),en=n.n(et),er=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"double-caret-vertical",ref:t},e),a.createElement("path",{d:n?"M100 220H300C311 220 320 229 320 240C320 244.8 318 249.2 315.2 252.6L315.4 252.8L215.4 372.8L215.2 372.6C211.4 377 206.2 380 200 380S188.6 377 184.8 372.6L184.6 372.8L84.6 252.8L84.8 252.6C82 249.2 80 244.8 80 240C80 229 89 220 100 220zM300 180H100C89 180 80 171 80 160C80 155.2 82 150.8 84.8 147.4L84.6 147.2L184.6 27.2L184.8 27.4C188.6 23 193.8 20 200 20S211.4 23 215.2 27.4L215.4 27.2L315.4 147.2L315.2 147.4C318 150.8 320 155.2 320 160C320 171 311 180 300 180z":"M100 180H220C231 180 240 189 240 200C240 205.6 237.8 210.6 234.2 214.2L174.2 274.2C170.6 277.8 165.6 280 160 280S149.4 277.8 145.8 274.2L85.8 214.2C82.2 210.6 80 205.6 80 200C80 189 89 180 100 180zM220 140H100C89 140 80 131 80 120C80 114.4 82.2 109.4 85.8 105.8L145.8 45.8C149.4 42.2 154.4 40 160 40S170.6 42.2 174.2 45.8L234.2 105.8C237.8 109.4 240 114.4 240 120C240 131 231 140 220 140z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});er.defaultProps={size:c.J.STANDARD},er.displayName="Blueprint5.Icon.DoubleCaretVertical";var ei=n(58051),ea=n(12131),eo=n(84614),el=a.forwardRef(function(e,t){var n,r=e.className,i=e.children,o=e.disabled,l=e.fill,s=e.iconName,c=e.iconProps,u=e.large,d=e.minimal,h=e.options,f=e.value,p=(0,ee._T)(e,["className","children","disabled","fill","iconName","iconProps","large","minimal","options","value"]),m=en()(ea.rtP,((n={})[ea.rr$]=o,n[ea.ur0]=l,n[ea.lnC]=u,n[ea.IRm]=d,n),r),g="Open dropdown",v="double-caret-vertical"===(void 0===s?"double-caret-vertical":s)?a.createElement(er,(0,ee.pi)({title:g},c)):a.createElement(ei.p,(0,ee.pi)({title:g},c)),b=(void 0===h?[]:h).map(function(e){var t="object"==typeof e?e:{value:e};return a.createElement("option",(0,ee.pi)({},t,{key:t.value,children:t.label||t.value}))});return a.createElement("div",{className:m},a.createElement("select",(0,ee.pi)({disabled:o,ref:t,value:f},p,{multiple:!1}),b,i),v)});el.displayName="".concat(eo.g,".HTMLSelect");var es=n(17081),ec=n(76962),eu=n(48648),ed=n(65534),eh=n(81530),ef=n(43070),ep=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"help",ref:t},e),a.createElement("path",{d:n?"M200 400C89.6 400 0 310.4 0 200C0 89.6 89.6 0 200 0S400 89.6 400 200C400 310.4 310.4 400 200 400zM148.2 307.6C161.2 318.4 178.4 324 199.4 324C210.2000000000001 324 220 322.4 229.0000000000001 319C237.8 315.6 245.6 311.2000000000001 251.8000000000001 305.4C258.2000000000001 299.6 263.0000000000001 292.8 266.6 285C270.0000000000001 277.2 271.8 268.6 271.8 259.6S270.2000000000001 242.2 267 235C263.8 227.6 259 220.4 252.8 212.8L228.6 181.2C225.8 177.8 223 174.6 222.2 171.6C221.2 168.6 220 164.6 220 159.6V151C220 148.6 220 140.2000000000001 220 140.2000000000001H180V180.2000000000001C180 180.2000000000001 181.2 191.8000000000001 184.8 196.4L209 229.2000000000001C214 235.2000000000001 217.2 240.4000000000001 219.2 244.6000000000001S222 253.4000000000001 222 258.0000000000001C222 265 219.8 270.6 215.6 275S205.6 281.6 198 281.6C190.6 281.6 184.6 279.4000000000001 180.2 275C175.8 270.4 172.8 264.2 171 256.2C170.4 253.8 168.8 252.8 166.4 253L127.4 258.8C125 259 124.2 260.4 124.6 263.2C127.2 281.8 135 296.6 148.2 307.6zM180 120H220.4L220 80H180V120z":"M160 320C71.6 320 0 248.4 0 160S71.6 0 160 0S320 71.6 320 160S248.4 320 160 320zM180 60H140V100H180V60zM218.6 190.4C215.8 184 211.6 177.6 206.2 171L185 143.4C182.6 140.4 180.2 137.6 179.4 135C178.6 132.4 177.6 129 177.6 124.6V120H142.4V142.4C142.4 142.4 143.4 152.6 146.6 156.6L168 185.4C172.4 190.6 175 195.2 176.8 199C178.6 202.8 179.2 206.6 179.2 210.6C179.2 216.6 177.2 221.6 173.6 225.6C170 229.4 164.8 231.2 158.4 231.2C151.8 231.2 146.6 229.2 142.8 225.4C139 221.6 136.2 216.2 134.8 209.2C134.2 207 132.8 206.2 130.8 206.4L96.8 211.4C94.4 211.6 93.6 213 94 215.2C96.4 231.6 103.2 244.6 114.6 254C126 263.6 141 268.4 159.6 268.4C169 268.4
268177.6 267 185.4 264C193.2 261 199.8 257.2 205.4 252.2C211 247.2 215.2 241.2 218.4 234.4C221.4 227.4 222.8 220 222.8 212S221.4 197 218.6 190.4z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});ep.defaultProps={size:c.J.STANDARD},ep.displayName="Blueprint5.Icon.Help";var em=n(27588),eg=n(17917),ev=n(36836),eb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let ey=[{name:"Instagram",icon:a.createElement(ec,null),sizes:[["Post",1080,1080,"px",a.createElement(ec,null)],["Story",1080,1920,"px",a.createElement(ec,null)],["Ad",1080,1080,"px",a.createElement(ec,null)]]},{name:"Facebook",icon:a.createElement(es,null),sizes:[["Post (Landscape)",1200,630,"px",a.createElement(es,null)],["Post (Square)",1080,1080,"px",a.createElement(es,null)],["Cover",851,315,"px",a.createElement(es,null)]]},{name:"Youtube",icon:a.createElement(eu,null),sizes:[["Thumbnail",1280,720,"px",a.createElement(eu,null)],["Channel",2560,1440,"px",a.createElement(eu,null)],["Short",1080,1920,"px",a.createElement(eu,null)]]},{name:"LinkedIn",icon:a.createElement(eg,null),sizes:[["Post",1200,627,"px",a.createElement(eg,null)],["Banner",1584,396,"px",a.createElement(eg,null)],["Square",1080,1080,"px",a.createElement(eg,null)]]},{name:"Twitter",icon:a.createElement(ev,null),sizes:[["Post",1600,900,"px",a.createElement(ev,null)],["Header",1500,500,"px",a.createElement(ev,null)],["Square",1080,1080,"px",a.createElement(ev,null)]]},{name:"Video",icon:a.createElement(ed,null),sizes:[["Full HD",1920,1080,"px",a.createElement(ed,null)],["4K UHD",3840,2160,"px",a.createElement(ed,null)],["Vertical HD",1080,1920,"px",a.createElement(ed,null)],["Square HD",1080,1080,"px",a.createElement(ed,null)]]},{name:"Print",icon:a.createElement(eh,null),sizes:[["Invitation",14,14,"cm",a.createElement(eh,null)],["A4 Portrait",21,29.7,"cm",a.createElement(eh,null)],["A4 Landscape",29.7,21,"cm",a.createElement(eh,null)],["A3",29.7,42,"cm",a.createElement(eh,null)],["Letter Portrait",8.5,11,"in",a.createElement(eh,null)],["Letter Landscape",11,8.5,"in",a.createElement(eh,null)],["Business card",3.5,2,"in",a.createElement(ef,null)],["Poster",18,24,"in",a.createElement(eh,null)]]}],ew=e=>{var{value:t,onChange:n}=e,r=eb(e,["value","onChange"]);let[i,o]=a.useState(t.toString()),l=a.useRef(t);l.current=i;let s=()=>{n(Math.max(r.min||0,parseFloat(l.current)))};return a.useEffect(()=>{o(t)},[t]),a.createElement(X.A,Object.assign({},r,{value:i.toString(),onValueChange:(e,t)=>
268{Number.isNaN(t)||o(t)},onBlur:s,allowNumericCharactersOnly:!1,onKeyDown:e=>{"Enter"===e.key&&s()}}))},ex=(0,o.Pi)(({store:e})=>{var t,n;let[r,i]=a.useState(!0),[o,s]=a.useState(e.width),[c,u]=a.useState(e.height),d=(0,em.Qh)({px:10,unit:e.unit,dpi:e.dpi}),h=(null===(t=e.activePage)||void 0===t?void 0:t.computedWidth)||e.width;a.useEffect(()=>{s((0,em.Cf)({px:h,unit:e.unit,dpi:e.dpi}))},[h,e.unit,e.dpi]);let f=(null===(n=e.activePage)||void 0===n?void 0:n.computedHeight)||e.height;return a.useEffect(()=>{u((0,em.Cf)({px:f,unit:e.unit,dpi:e.dpi}))},[f,e.unit,e.dpi]),a.createElement("div",{style:{height:"100%",overflow:"auto",paddingRight:"3px"}},a.createElement("div",{style:{paddingBottom:"15px"}},a.createElement(Y.rs,{checked:r,onChange:e=>{i(e.target.checked)},alignIndicator:K.v.RIGHT,style:{marginTop:"8px",marginBottom:"25px"}},(0,T.t)("sidePanel.useMagicResize")," ",a.createElement(J.u,{content:(0,T.t)("sidePanel.magicResizeDescription"),position:Q.Ly.BOTTOM},a.createElement(l.I,{icon:a.createElement(ep,null)}))),a.createElement("div",{style:{width:"50%",display:"inline-block"}},(0,T.t)("sidePanel.width")," (",e.unit,")"),a.createElement("div",{style:{width:"50%",display:"inline-block"}},a.createElement(ew,{fill:!0,value:o,onChange:e=>{e||(e=d),s(e)},min:d,max:1e4,selectAllOnFocus:!0,stepSize:"px"===e.unit?1:.1}))),a.createElement("div",{style:{paddingBottom:"15px"}},a.createElement("div",{style:{width:"50%",display:"inline-block"}},(0,T.t)("sidePanel.height")," (",e.unit,")"),a.createElement("div",{style:{width:"50%",display:"inline-block"}},a.createElement(ew,{fill:!0,value:c,onChange:e=>{e||(e=d),u(e)},min:d,max:1e4,selectAllOnFocus:!0,stepSize:"px"===e.unit?1:.1}))),a.createElement("div",{style:{paddingBottom:"15px"}},a.createElement("div",{style:{width:"50%",display:"inline-block"}},(0,T.t)("sidePanel.units")),a.createElement("div",{style:{width:"50%",display:"inline-block"}},a.createElement(el,{value:e.unit,onChange:t=>{let n=t.currentTarget.value;e.setUnit({unit:n,dpi:e.dpi})},options:[{label:"px",value:"px"},{label:"cm",value:"cm"},{label:"in",value:"in"}],fill:!0}))),a.createElement("div",{style:{paddingBottom:"15px"}},a.createElement(A.z,{fill:!0,intent:"primary",onClick:()=>{var t,n,i,a;let l=(0,em.LU)({unitVal:o,dpi:e.dpi,unit:e.unit}),s=(0,em.LU)({unitVal:c,dpi:e.dpi,unit:e.unit});e.setSize(l,s,r),"auto"!==(null===(t=e.activePage)||void 0===t?void 0:t.width)&&(null===(n=e.activePage)||void 0===n||n.set({width:l})),"auto"!==(null===(i=e.activePage)||void 0===i?void 0:i.height)&&(null===(a=e.activePage)||void 0===a||a.set({height:s}))}},(0,T.t)("sidePanel.resize"))),ey.map(({name:t,icon:n,sizes:i})=>a.createElement(a.Fragment,{key:t},a.createElement("div",{style:{paddingBottom:"15px",paddingTop:"15px",fontWeight:600,display:"flex",alignItems:"center",gap:6}},n,t),a.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"8px",marginBottom:"10px"}},i.map(([t,n,i,o,l])=>a.createElement(A.z,{key:t,style:{height:"80px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:"13px"},minimal:!0,onClick:()=>{var t,a,l,s;let c=(0,em.LU)({unitVal:n,dpi:e.dpi,unit:o}),u=(0,em.LU)({unitVal:i,dpi:e.dpi,unit:o});e.setUnit({unit:o,dpi:e.dpi}),e.setSize(c,u,r),"auto"!==(null===(t=e.activePage)||void 0===t?void 0:t.width)&&(null===(a=e.activePage)||void 0===a||a.set({width:c})),"auto"!==(null===(l=e.activePage)||void 0===l?void 0:l.height)&&(null===(s=e.activePage)||void 0===s||s.set({height:u}))}},a.createElement("div",{style:{fontSize:"22px",marginBottom:"4px"}},l),a.createElement("div",null,t),a.createElement("div",{style:{fontSize:"0.7rem",opacity:.7}},n,"\xd7",i," ",o)))))))});var eC=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"plus",ref:t},e),a.createElement("path",{d:n?"M320 220H220V320C220 331 211 340 200 340S180 331 180 320V220H80C69 220 60 211 60 200C60 189 69 180 80 180H180V80C180 69 189 60 200 60S220 69 220 80V180H320C331 180 340 189 340 200C340 211 331 220 320 220z":"M260 180H180V260C180 271 171 280 160 280S140 271 140 260V180H60C49 180 40 171 40 160C40 149 49 140 60 140H140V60C140 49 149 40 160 40S180 49 180 60V140H260C271 140 280 149 280 160C280 171 271 180 260 180z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});eC.defaultProps={size:c.J.STANDARD},eC.displayName="Blueprint5.Icon.Plus";var eE=n(41364),ek=n(9051);let eS=async({src:e,droppedPos:t,targetElement:n,store:r})=>{var i;if(n&&"svg"===n.type&&n.contentEditable){let t=n.parent,i=n.zIndex,a=Object.assign({},n.toJSON());return delete a.id,r.deleteElements([n.id]),void t.addElement(Object.assign(Object.assign({},a),{type:"image",src:e,clipSrc:a.src})).setZIndex(i)}n&&"figure"===n.type&&n.contentEditable;let{width:a,height:o}=await (0,ek.Ad)(e);if(n&&"image"===n.type&&n.contentEditable){let t=(0,ek.EH)(n,{width:a,height:o});return void n.set(Object.assign({src:e},t))}let l=Math.min(r.width/a,r.height/o,1);a*=l,o*=l;let s=((null==t?void 0:t.x)||r.width/2)-a/2,c=((null==t?void 0:t.y)||r.height/2)-o/2;null===(i=r.activePage)||void 0===i||i.addElement({type:"image",src:e,width:a,height:o,x:s,y:c})},eT=async({src:e,droppedPos:t,targetElement:n,store:r,attrs:i={}})=>{var a;let o=i.width||300,l=i.height||200;
268if(n&&"video"===n.type&&n.contentEditable){let t=(0,ek.EH)(n,{width:o,height:l});return void n.set(Object.assign({src:e},t))}let s=.8*Math.min(r.width/o,r.height/l,1);o*=s,l*=s;let c=((null==t?void 0:t.x)||r.width/2)-o/2,u=((null==t?void 0:t.y)||r.height/2)-l/2,d=null===(a=r.activePage)||void 0===a?void 0:a.addElement({type:"video",src:e,width:o,height:l,x:c,y:u});if(d&&r.activePage)try{let t=1e3*await (0,eE.Mf)(e);t>r.activePage.duration&&r.activePage.set({duration:t})}catch(e){console.warn("Failed to get video duration:",e)}return d},eP=async({src:e,droppedPos:t,targetElement:n,store:r})=>{var i;if(n&&"image"===n.type&&n.contentEditable||n&&"video"===n.type&&n.contentEditable)return void n.set({clipSrc:e});let{width:a,height:o}=await (0,ek.Ad)(e),l=((null==t?void 0:t.x)||r.width/2)-a/2,s=((null==t?void 0:t.y)||r.height/2)-o/2;null===(i=r.activePage)||void 0===i||i.addElement({type:"svg",width:a,height:o,x:l,y:s,src:e})},eM=async({src:e,droppedPos:t,targetElement:n,store:r})=>{var i;let{width:a,height:o}=await (0,ek.Ad)(e),l=((null==t?void 0:t.x)||r.width/2)-a/2,s=((null==t?void 0:t.y)||r.height/2)-o/2;null===(i=r.activePage)||void 0===i||i.addElement({type:"gif",width:a,height:o,x:l,y:s,src:e})},eR=async e=>H(e),eA=[],eL=({store:e})=>{let[t,n]=a.useState(eA),[r,i]=a.useState(!1),o=a.useRef(null);return a.useEffect(()=>{eA=t},[t]),a.createElement("div",{style:{height:"100%",display:"flex",flexDirection:"column"}},a.createElement("div",{style:{height:"45px",paddingTop:"5px"}},(0,T.t)("sidePanel.uploadTip")),a.createElement("div",{style:{marginBottom:"20px"}},a.createElement("label",{htmlFor:"input-file"},a.createElement(A.z,{icon:a.createElement(eC,null),style:{width:"100%"},onClick:()=>{var e;null===(e=o.current)||void 0===e||e.click()}},(0,T.t)("sidePanel.uploadImage")),a.createElement("input",{type:"file",ref:o,style:{display:"none"},onChange:async e=>{var t;let{target:r}=e;i(!0);try{for(let e of Array.from(null!==(t=r.files)&&void 0!==t?t:[])){let t=await eR(e),r=function(e){let{type:t}=e;return t.indexOf("svg")>=0?"svg":t.indexOf("gif")>=0?"gif":t.indexOf("image")>=0?"image":t.indexOf("video")>=0?"video":t.indexOf("audio")>=0?"audio":"image"}(e),i=t;"video"===r?i=await (0,eE.Q8)(t):"audio"===r&&(i=function(){let e=new Blob(['\n <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">\n <circle cx="50" cy="50" r="45" fill="#f0f0f0" stroke="#ccc" stroke-width="2"/>\n <path d="M40,35 L40,65 L55,50 L70,50 M70,35 Q80,50 70,65" fill="none" stroke="#666" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n '],{type:"image/svg+xml"});return URL.createObjectURL(e)}()),n(e=>e.concat([{url:t,type:r,preview:i}]))}}catch(e){console.error(e)}i(!1),r.value=""},multiple:!0}))),a.createElement(R.t,{images:t,isLoading:r,getPreview:e=>e.preview,hideNoResults:!0,onSelect:async(t,n,r)=>{let i=t.url,a=t.type;"image"===a?eS({src:i,store:e,droppedPos:n,targetElement:r}):"video"===a?eT({src:i,store:e,droppedPos:n,targetElement:r}):"gif"===a?eM({src:i,store:e,droppedPos:n,targetElement:r}):"svg"===a?eP({src:i,store:e,droppedPos:n,targetElement:r}):"audio"===a&&e.addAudio({src:i})}}))};var e_=n(9065),eI=n(94177);let eO=({store:e})=>{let{setQuery:t,loadMore:n,isReachingEnd:r,data:i,isLoading:o,error:l}=B({defaultQuery:"",getAPI:({page:e,query:t})=>(0,z.q8)({page:e,query:t})});return a.createElement("div",{style:{height:"100%",display:"flex",flexDirection:"column"}},a.createElement(e_.B,{leftIcon:a.createElement(eI.o,null),placeholder:(0,T.t)("sidePanel.searchPlaceholder"),onChange:e=>{t(e.target.value)},type:"search",style:{marginBottom:"20px"}}),a.createElement("p",{style:{textAlign:"center"}},"Photos by"," ",a.createElement("a",{href:"https://unsplash.com/",target:"_blank"},"Unsplash")),a.createElement(R.t,{images:null==i?void 0:i.map(e=>e.results).flat().filter(Boolean),getPreview:e=>e.urls.small,getAlt:e=>e.alt_description||"",onSelect:async(t,n,r)=>{fetch((0,z.cW)(t.id)),eS({src:t.urls.regular,store:e,droppedPos:n,targetElement:r})},isLoading:o,error:l,loadMore:!r&&n,getCredit:e=>a.createElement("span",null,"Photo by"," ",a.createElement("a",{href:`https://unsplash.com/@${e.user.username}?utm_source=polotno&utm_medium=referral`,target:"_blank"},e.user.name)," ","on"," ",a.createElement("a",{href:"https://unsplash.com/?utm_source=polotno&utm_medium=referral",target:"_blank"},"Unsplash"))}))};var eD=n(59533),ez=n(61389),eN=n(95515),eF=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let eB="gradient",eH=(0,eD.LO)(["white","rgb(82, 113, 255)","rgb(255, 145, 77)","rgb(126, 217, 87)","rgb(255, 222, 89)","rgb(203, 108, 23
2680)","rgb(0, 0, 0, 0)"]),eV=(0,x.Z)("div")` 269 display: inline-block; 270 width: 30px; 271 height: 30px; 272 border-radius: 2px; 273 box-shadow: 0 0 2px rgba(16, 22, 26, 0.3); 274 cursor: pointer; 275`,ej=e=>{var{children:t,color:n}=e,r=eF(e,["children","color"]);return a.createElement(eV,Object.assign({},r,{style:Object.assign(Object.assign({},r.style),{background:"url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 8 8'%3E%3Cg fill='rgba(112, 112, 116, 1)' fill-opacity='1'%3E%3Cpath fill-rule='evenodd' d='M0 0h4v4H0V0zm4 4h4v4H4V4z'/%3E%3C/g%3E%3C/svg%3E\")"})}),a.createElement("div",{style:{width:"100%",height:"100%",background:n}},t))},e$=(0,o.Pi)(({store:e})=>{var t,n;let{setQuery:r,loadMore:i,isReachingEnd:o,data:l,isLoading:s,error:c}=B({defaultQuery:eB,getAPI:({page:e,query:t})=>(0,z.q8)({page:e,query:t})});return a.createElement("div",{style:{height:"100%",display:"flex",flexDirection:"column"}},a.createElement("div",{style:{display:"flex",justifyContent:"space-around",paddingBottom:"10px"}},a.createElement(eN.zH,{value:(null===(t=e.activePage)||void 0===t?void 0:t.background)||"white",onChange:t=>{var n;null===(n=e.activePage)||void 0===n||n.set({background:t})},store:e,position:"bottom-left",gradientEnabled:!0},a.createElement(ej,{color:null===(n=e.activePage)||void 0===n?void 0:n.background,style:{fontSize:"30px"}},a.createElement(ez,{style:{mixBlendMode:"difference"}}))),eH.map(t=>a.createElement(ej,{key:t,color:t,onClick:()=>{var n;null===(n=e.activePage)||void 0===n||n.set({background:t})}}))),a.createElement(e_.B,{leftIcon:a.createElement(eI.o,null),placeholder:(0,T.t)("sidePanel.searchPlaceholder"),onChange:e=>{r(e.target.value||eB)},type:"search",style:{marginBottom:"20px"}}),a.createElement("p",{style:{textAlign:"center"}},"Photos by"," ",a.createElement("a",{href:"https://unsplash.com/",target:"_blank"},"Unsplash")),a.createElement(R.t,{images:null==l?void 0:l.map(e=>e.results).flat().filter(Boolean),isLoading:s,getPreview:e=>e.urls.small,getAlt:e=>e.alt_description||"",loadMore:!o&&i,onSelect:async t=>{var n;fetch((0,z.cW)(t.id)),null===(n=e.activePage)||void 0===n||n.set({background:t.urls.regular})},error:c,getCredit:e=>a.createElement("span",null,"Photo by"," ",a.createElement("a",{href:`https://unsplash.com/@${e.user.username}?utm_source=polotno&utm_medium=referral`,target:"_blank"},e.user.name)," ","on"," ",a.createElement("a",{href:"https://unsplash.com/?utm_source=polotno&utm_medium=referral",target:"_blank"},"Unsplash"))}))});var eU=n(53317),eW=n(72365),eG=n(11903);let eq=async e=>{let t=await fetch(z.ns.nounProjectDownload(e)),n=await t.text();return await (0,eW.XP)(n)},eZ=(0,x.Z)("div")` 276 height: 100%; 277 overflow: hidden; 278 279 .bp5-dark & img { 280 filter: invert(1); 281 } 282`,eX=({store:e,query:t})=>{let{data:n,isLoading:r,loadMore:i,setQuery:o,hasMore:l}=B({defaultQuery:t,getAPI:({page:e,query:t})=>z.ns.nounProjectList({query:t,page:e}),getSize:e=>e.pagesNumber});return a.useEffect(()=>{o(t)},[t]),a.createElement(eZ,null,a.createElement(R.t,{shadowEnabled:!1,images:null==n?void 0:n.map(e=>e.icons).flat(),getPreview:e=>e.preview_url_84,isLoading:r,onSelect:async(t,n,r)=>{if(r&&"image"===r.type&&r.contentEditable){let e=await eq(t.id);return void r.set({clipSrc:e})}if(r&&"video"===r.type&&r.contentEditable){let e=await eq(t.id);return void r.set({clipSrc:e})}e.history.transaction(async()=>{var r;let i=((null==n?void 0:n.x)||e.width/2)-100,a=((null==n?void 0:n.y)||e.height/2)-100,o=null===(r=e.activePage)||void 0===r?void 0:r.addElement({type:"svg",width:200,height:200,x:i,y:a}),l=await eq(t.id);(0,eU.fh)(o)&&await o.set({src:l})})},rowsNumber:4,loadMore:l&&i}))},eY=[{preview:(0,eW.XP)` 283<svg xmlns="http://www.w3.org/2000/svg" width="32" height="16"> 284 <path stroke="#C0BFBF" strokeWidth="4" d="M 1 8 L 30 8"></path> 285</svg> 286`,data:{}},{preview:(0,eW.XP)` 287<svg xmlns="http://www.w3.org/2000/svg" width="32" height="16"> 288 <path stroke="#C0BFBF" strokeWidth="4" stroke-dasharray="4 2" d="M 1 8 L 30 8"></path> 289</svg> 290`,data:{dash:[4,2]}},{preview:(0,eW.XP)` 291<svg xmlns="http://www.w3.org/2000/svg" width="32" height="16"> 292 <path stroke="#C0BFBF" strokeWidth="4" stroke-dasharray="1 1" d="M 1 8 L 30 8"></path> 293</svg> 294`,data:{dash:[1,1]}},{preview:(0,eW.XP)` 295 <svg xmlns="http://www.w3.org/2000/svg" width="32" height="16"> 296 <path 297 stroke="#C0BFBF" 298 strokeWidth="2" 299 d="M 25 6 L 29 8 L 25 10" 300 fill="none" 301 strokeLinejoin="round" 302 strokeLinecap="round" 303 ></path> 304 <path 305 stroke="#C0BFBF" 306 strokeWidth="4" d="M 1 8 L 29 8" 307 strokeLinejoin="round" 308 strokeLinecap="round" 309 ></path> 310 </svg> 311`,data:{endHead:"arrow"}},{preview:(0,eW.XP)` 312 <svg xmlns="http://www.w3.org/2000/svg" width="32" height="16"> 313 <path 314 stroke="#C0BFBF" 315 strokeWidth="2" 316 d="M 25 6 L 29 8 L 25 10 Z" 317 fill="#C0BFBF" 318 strokeLinejoin="round" 319 strokeLinecap="round" 320 ></path> 321 <path 322 stroke="#C0BFBF" 323 strokeWidth="4" d="M 1 8 L 29 8" 324 strokeLinejoin="round" 325 strokeLinecap="round" 326 ></path> 327 <circle cx="3" cy="8" r="2" fill="#C0BFBF"></circle> 328 </svg> 329`,data:{startHead:"circle",endHead:"triangle"}},{preview:(0,eW.XP)` 330 <svg xmlns="http://www.w3.org/2000/svg" width="32" height="16"> 331 <path 332 stroke="#C0BFBF" 333 strokeWidth="2" 334 d="M 1 6 L 5 6 L 5 10 L 1 10 Z" 335 fill="#C0BFBF" 336 strokeLinejoin="round" 337 strokeLinecap="round" 338 ></path> 339 <path 340 stroke="#C0BFBF" 341 strokeWidth="4" d="M 1 8 L 29 8" 342 strokeLinejoin="round" 343 strokeLinecap="round" 344 stroke-dasharray="2 1" 345 ></path> 346 <path 347 stroke="#C0BFBF" 348 strokeWidth="4" d="M 29 6 L 29 10" 349 strokeLinejoin="round" 350 strokeLinecap="round" 351 ></path> 352 </svg> 353`,data:{startHead:"square",endHead:"bar",dash:[2,1]}}];function eK(e,t){let n="#C0BFBF",r="";for(let e=1;e<t;e++){let i=Math.round(e/t*80);r+=`<line x1="${i}" y1="0" x2="${i}" y2="60" stroke="${n}" stroke-width="1.5"/>`}for(let t=1;t<e;t++){let i=Math.round(t/e*60);r+=`<line x1="0" y1="${i}" x2="80" y2="${i}" stroke="${n}" stroke-width="1.5"/>`}return`<svg xmlns="http://www.w3.org/2000/svg" width="80" height="60"><rect x="0.5" y="0.5" width="79" height="59" fill="none" stroke="${n}" stroke-width="1.5" rx="2"/>${r}</svg>`}let eJ=[{rows:2,cols:2,preview:(0,eW.XP)(eK(2,2))},{rows:3,cols:3,preview:(0,eW.XP)(eK(3,3))},{rows:4,cols:3,preview:(0,eW.XP)(eK(4,3))},{rows:3,cols:4,preview:(0,eW.XP)(eK(3,4))},{rows:4,cols:4,preview:(0,eW.XP)(eK(4,4))},{rows:5,cols:3,preview:(0,eW.XP)(eK(5,3))}],eQ="rgba(191, 191, 191, 100)",e0=({store:e})=>a.createElement(R.t,{shadowEnabled:!1,rowsNumber:3,images:eY,getPreview:e=>e.preview,itemHeight:50,isLoading:!1,onSelect:async(t,n,r)=>{let i=e.activePage.computedWidth/3;e.activePage.addElement(Object.assign({type:"line",x:n?n.x:e.activePage.computedWidth/2-i/2,y:n?n.y:e.activePage.computedHeight/2,color:eQ,width:i},t.data))}}),e1=Object.keys(eG.vK),e2=[{width:300,height:300,fill:"rgba(191, 191, 191, 100)",stroke:"#0c0c0c",strokeWidth:0,url:""}],e4=[];
353e1.forEach(e=>{e2.forEach(t=>{e4.push(Object.assign({subType:e},t))})}),e4.forEach(e=>{e.url=(0,eW.XP)((0,eG.vn)(e))});let e3=(0,x.Z)("div")` 354 height: 220px; 355`,e8=({store:e})=>{let t=Math.ceil(e4.length/4)||1;return a.createElement(e3,{style:{height:110*t+"px"}},a.createElement(R.t,{shadowEnabled:!1,rowsNumber:4,images:e4,getPreview:e=>e.url,isLoading:!1,itemHeight:100,onSelect:async(t,n,r)=>{if(r&&"image"===r.type&&r.contentEditable||r&&"video"===r.type&&r.contentEditable)return void r.set({clipSrc:t.url});let i=e.activePage;if(!i)return;let a=(i.computedWidth+i.computedHeight)/2160,o=t.width*a,l=t.height*a,s=((null==n?void 0:n.x)||i.computedWidth/2)-o/2,c=((null==n?void 0:n.y)||i.computedHeight/2)-l/2;i.addElement(Object.assign(Object.assign({type:"figure"},t),{x:s,y:c,width:o,height:l,fill:eQ}))}}))},e6=({store:e})=>a.createElement(R.t,{shadowEnabled:!1,rowsNumber:3,images:eJ,getPreview:e=>e.preview,itemHeight:70,isLoading:!1,onSelect:async(t,n)=>{let r=e.activePage;if(!r)return;let i=(r.computedWidth+r.computedHeight)/2160,a=400*i,o=300*i,l=((null==n?void 0:n.x)||r.computedWidth/2)-a/2,s=((null==n?void 0:n.y)||r.computedHeight/2)-o/2;r.addElement({type:"table",x:l,y:s,width:a,height:o,rows:t.rows,cols:t.cols,fontSize:Math.round(30*i)})}}),e5=(0,x.Z)("div")` 356 height: 220px; 357`,e9=(0,x.Z)("div")` 358 height: 170px; 359`,e7=({store:e})=>a.createElement("div",{style:{display:"flex",flexDirection:"column",height:"100%",overflow:"auto"}},a.createElement("p",null,(0,T.t)("sidePanel.tables")),a.createElement(e9,null,a.createElement(e6,{store:e})),a.createElement("p",null,(0,T.t)("sidePanel.lines")),a.createElement(e5,null,a.createElement(e0,{store:e})),a.createElement("p",null,(0,T.t)("sidePanel.shapes")),a.createElement(e8,{store:e})),te=({store:e})=>{let t=a.useRef(),[n,r]=a.useState(""),[i,o]=a.useState(n);a.useEffect(()=>(t.current=setTimeout(()=>{o(n)},500),()=>{clearTimeout(t.current)}),[n]);let l=!!i;return a.createElement("div",{style:{height:"100%",display:"flex",flexDirection:"column"}},a.createElement(e_.B,{leftIcon:a.createElement(eI.o,null),placeholder:(0,T.t)("sidePanel.searchPlaceholder"),onChange:e=>{r(e.target.value)},style:{marginBottom:"20px"},type:"search"}),l&&a.createElement(eX,{query:i,store:e}),!l&&a.createElement(e7,{store:e}))},tt=(0,o.Pi)(({store:e})=>{let[t,n]=a.useState({}),r=()=>{let t={};e.pages.forEach(n=>{let r=e.toDataURL({pageId:n.id,pixelRatio:.2});t[n.id]=r}),n(t)};return a.useEffect(()=>{let e=setInterval(r,1e3);return()=>clearInterval(e)},[]),a.createElement("div",{style:{height:"100%"}},a.createElement(R.t,{images:e.pages.slice(),getPreview:n=>t[n.id]||e.pages.indexOf(n),onSelect:async t=>{e.selectPage(t.id)},isLoading:!1,rowsNumber:2}))});var tn=n(95433),tr=n(28117);let ti=(e,t)=>{let n=a.useRef(!0);a.useEffect(()=>{n.current?n.current=!1:e()},t)},ta=(0,o.Pi)(({sizeQuery:e,query:t,store:n})=>{let{setQuery:r,loadMore:i,hasMore:o,data:l,isLoading:s,reset:c,error:u}=B({getAPI:({page:t,query:n})=>(0,z.Qz)({page:t,query:n,sizeQuery:e}),getSize:e=>e.totalPages});return ti(()=>{c()},[e]),ti(()=>{r(t)},[t]),a.createElement(R.t,{images:null==l?void 0:l.map(e=>e.items).flat(),getPreview:e=>e.preview,isLoading:s,onSelect:async e=>{let t=await fetch(e.json),r=await t.json();if(n.pages.length<=1)n.loadJSON(r,!0);else{let e=JSON.parse(JSON.stringify(n.toJSON()));e.width===r.width&&e.height===r.height||r.pages.forEach(e=>{e.width=e.width||r.width,e.height=e.height||r.height}),(0,tr.lc)({children:r.pages},e=>{e.id=(0,tn.x0)(10)});let t=n.pages.indexOf(n.activePage);e.pages.splice(t,1,...r.pages),n.loadJSON(e,!0)}},loadMore:o&&i,error:u})}),to=(0,o.Pi)(({store:e})=>{let[t,n]=a.useState(!0),[r,i]=a.useState(""),o=t?`${e.width}x${e.height}`:"all";return a.createElement("div",{style:{height:"100%",display:"flex",flexDirection:"column"}},a.createElement(e_.B,{leftIcon:a.createElement(eI.o,null),placeholder:(0,T.t)("sidePanel.searchPlaceholder"),type:"search",onChange:e=>{i(e.target.value)},style:{marginBottom:"20px"}}),a.createElement(Y.rs,{checked:t,onChange:e=>{n(e.target.checked)},alignIndicator:K.v.RIGHT,style:{marginTop:"8px",marginBottom:"25px"}},(0,T.t)("sidePanel.searchTemplatesWithSameSize")," "),a.createElement(ta,{store:e,sizeQuery:"size="+o,query:r}))});var tl=n(37564),ts=a.forwardRef(function(e,t){var n,r=e.className,i=e.elevation,o=void 0===i?tl.u.ZERO:i,l=e.interactive,s=e.selected,c=e.compact,u=(0,ee._T)(e,["className","elevation","interactive","selected","compact"]),d=en()(r,ea.TUJ,ea._Kv(o),((n={})[ea.znr]=void 0!==l&&l,n[ea.yXI]=c,n[ea.hdN]=s,n));return a.createElement("div",(0,ee.pi)({className:d,ref:t},u))});ts.displayName="".concat(eo.g,".Card");var tc=n(67824),tu=n(39199),td=function(e){function t(t){var n=e.call(this,t)||this;n.inputElement=null,n.valueElement=null,n.refHandlers={content:function(e){n.valueElement=e},input:function(e){if(null!=e&&(n.inputElement=e,n.props.alwaysRenderInput||n.inputElement.focus(),null!=n.state&&n.state.isEditing)){var t=function(e){switch(e.type){case"textarea":case"text":case"search":case"tel":case"url":case"password":return!0;default:return!1}}(e);if(t){var r=e.value.length;e.setSelectionRange(n.props.selectAllOnFocus?0:r,r)}t&&n.props.selectAllOnFocus||(e.scrollLeft=e.scrollWidth)}}},n.cancelEditing=function(){var e,t,r,i,a=n.state,o=a.lastValue,l=a.value;n.setState({isEditing:!1,value:o}),l!==o&&(null===(t=(e=n.props).onChange)||void 0===t||t.call(e,o)),null===(i=(r=n.props).onCancel)||void 0===i||i.call(r,o)},n.toggleEditing=function(){var e,t;if(n.state.isEditing){var r=n.state.value;n.setState({isEditing:!1,lastValue:r}),null===(t=(e=n.props).onConfirm)||void 0===t||t.call(e,r)}else n.props.disabled||n.setState({isEditing:!0})},n.handleFocus=function(){var e=n.props,t=e.alwaysRenderInput,r=e.disabled,i=e.selectAllOnFocus;if(r||n.setState({isEditing:!0}),t&&i&&null!=n.inputElement){var a=n.inputElement.value.length;n.inputElement.setSelectionRange(0,a)}},n.handleTextChange=function(e){var t,r,i=e.target.value;null==n.props.value&&n.setState({value:i}),null===(r=(t=n.props).onChange)||void 0===r||r.call(t,i)},n.handleKeyEvent=function(e){if(!e.nativeEvent.isComposing){var t=e.altKey,r=e.ctrlKey,i=e.metaKey,a=e.shiftKey;if("Escape"===e.key){n.cancelEditing();return}var o=t||r||i||a;"Enter"===e.key&&((t||a)&&e.preventDefault(),n.props.confirmOnEnterKey&&n.props.multiline?null!=e.target&&o?(function(e,t){var n=e.selectionEnd,r=e.selectionStart,i=e.value;if(r>=0){var a=i.substring(0,r),o=i.substring(n,i.length);e.value="".concat(a).concat("\n").concat(o),e.selectionStart=r+1,e.selectionEnd=r+1}}(e.target,"\n"),n.handleTextChange(e)):n.toggleEditing():(!n.props.multiline||o)&&n.toggleEditing())}};var r=null==t.value?t.defaultValue:t.value;
359return n.state={inputHeight:0,inputWidth:0,isEditing:!0===t.isEditing&&!1===t.disabled,lastValue:r,value:r},n}return(0,ee.ZT)(t,e),t.prototype.render=function(){var e,t,n,r=this.props,i=r.alwaysRenderInput,o=r.disabled,l=r.elementRef,s=r.multiline,c=r.contentId,u=null!==(t=this.props.value)&&void 0!==t?t:this.state.value,d=null!=u&&""!==u,h=en()(ea.ZA5,ea.NL3(this.props.intent),((e={})[ea.rr$]=o,e[ea.dYo]=this.state.isEditing,e[ea.pIs]=!d,e[ea.qd]=s,e),this.props.className);n=s?{height:this.state.isEditing?void 0:this.state.inputHeight}:{height:this.state.inputHeight,lineHeight:null!=this.state.inputHeight?"".concat(this.state.inputHeight,"px"):void 0,minWidth:this.props.minWidth};var f=i||this.state.isEditing||o?void 0:0,p=i&&!this.state.isEditing;return a.createElement("div",{className:h,onFocus:this.handleFocus,tabIndex:f,ref:l},i||this.state.isEditing?this.renderInput(u):void 0,p?void 0:a.createElement("span",(0,ee.pi)({},null!=c?{id:c}:{},{className:ea.qNT,ref:this.refHandlers.content,style:n}),d?u:this.props.placeholder))},t.prototype.componentDidMount=function(){this.updateInputDimensions()},t.prototype.componentDidUpdate=function(e,t){var n,r,i={};this.props.value!==e.value&&(null!=e.value||null!=this.props.value)&&(i.value=this.props.value),null!=this.props.isEditing&&this.props.isEditing!==e.isEditing&&(i.isEditing=this.props.isEditing),(this.props.disabled||null==this.props.disabled&&e.disabled)&&(i.isEditing=!1),this.setState(i),this.state.isEditing&&!t.isEditing&&(null===(r=(n=this.props).onEdit)||void 0===r||r.call(n,this.state.value)),(this.state.value!==t.value||this.props.alwaysRenderInput!==e.alwaysRenderInput||this.props.maxLines!==e.maxLines||this.props.minLines!==e.minLines||this.props.minWidth!==e.minWidth||this.props.multiline!==e.multiline||this.props.placeholder!==e.placeholder)&&this.updateInputDimensions()},t.prototype.renderInput=function(e){var t=this.props,n=t.disabled,r=t.maxLength,i=t.multiline,o=t.type,l=t.placeholder,s=t.customInputAttributes,c={className:ea.Wi$,disabled:n,maxLength:r,onBlur:this.toggleEditing,onChange:this.handleTextChange,onKeyDown:this.handleKeyEvent,placeholder:l,value:e},u=this.state,d=u.inputHeight,h=u.inputWidth;return 0!==d&&0!==h&&(c.style={height:d,lineHeight:i||null==d?void 0:"".concat(d,"px"),width:i?"100%":h}),i?a.createElement("textarea",(0,ee.pi)({ref:this.refHandlers.input},c,s)):a.createElement("input",(0,ee.pi)({ref:this.refHandlers.input,type:o},c,s))},t.prototype.updateInputDimensions=function(){if(null!=this.valueElement){var e,t=this.props,n=t.maxLines,r=t.minLines,i=t.minWidth,a=t.multiline,o=this.valueElement,l=o.parentElement,s=o.textContent,c=this.valueElement,u=c.scrollHeight,d=c.scrollWidth,h=th(this.valueElement);a&&this.state.isEditing&&/\n$/.test(null!=s?s:"")&&(u+=h),h>0&&(u=(0,tu.uZ)(u,r*h,n*h)),u=Math.max(u,(""===(e=getComputedStyle(this.valueElement).fontSize)?0:parseInt(e.slice(0,-2),10))+1,th(l)),d+=5,this.setState({inputHeight:u,inputWidth:Math.max(d,i)}),a&&this.state.isEditing&&this.setTimeout(function(){return l.style.height="".concat(u,"px")})}},t.displayName="".concat(eo.g,".EditableText"),t.defaultProps={alwaysRenderInput:!1,confirmOnEnterKey:!1,defaultValue:"",disabled:!1,maxLines:1/0,minLines:1,minWidth:80,multiline:!1,placeholder:"Click to Edit",type:"text"},t}(tc.l);function th(e){var t=parseInt(getComputedStyle(e).lineHeight.slice(0,-2),10);if(isNaN(t)){var n=document.createElement("span");n.innerHTML="<br>",e.appendChild(n);var r=e.offsetHeight;n.innerHTML="<br><br>";var i=e.offsetHeight;e.removeChild(n),t=i-r}return t}var tf=n(12988),tp=n(94877),tm=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"drag-handle-vertical",ref:t},e),a.createElement("path",{d:n?"M150 280C133.4 280 120 266.6 120 250S133.4 220 150 220S180 233.4 180 250S166.6 280 150 280zM150 180C133.4 180 120 166.6 120 150S133.4 120 150 120S180 133.4 180 150S166.6 180 150 180zM150 80C133.4 80 120 66.6 120 50S133.4 20 150 20S180 33.4 180 50S166.6 80 150 80zM250 320C266.6 320 280 333.4 280 350S266.6 380 250 380S220 366.6 220 350S233.4 320 250 320zM150 380C133.4 380 120 366.6 120 350S133.4 320 150 320S180 333.4 180 350S166.6 380 150 380zM250 180C233.4 180 220 166.6 220 150S233.4 120 250 120S280 133.4 280 150S266.6 180 250 180zM250 80C233.4 80 220 66.6 220 50S233.4 20 250 20S280 33.4 280 50S266.6 80 250 80zM250 280C233.4 280 220 266.6 220 250S233.4 220 250 220S280 233.4 280 250S266.6 280 250 280z":"M120 140C109 140 100 131 100 120C100 109 109 100 120 100S140 109 140 120C140 131 131 140 120 140zM200 260C211 260 220 269 220 280C220 291 211 300 200 300S180 291 180 280C180 269 189 260 200 260zM120 60C109 60 100 51 100 40C100 29 109 20 120 20S140 29 140 40C140 51 131 60 120 60zM120 220C109 220 100 211 100 200C100 189 109 180 120 180S140 189 140 200C140 211 131 220 120 220zM120 300C109 300 100 291 100 280C100 269 109 260 120 260S140 269 140 280C140 291 131 300 120 300zM200 140C189 140 180 131 180 120C180 109
359189 100 200 100S220 109 220 120C220 131 211 140 200 140zM200 220C189 220 180 211 180 200C180 189 189 180 200 180S220 189 220 200C220 211 211 220 200 220zM200 60C189 60 180 51 180 40C180 29 189 20 200 20S220 29 220 40C220 51 211 60 200 60z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});tm.defaultProps={size:c.J.STANDARD},tm.displayName="Blueprint5.Icon.DragHandleVertical";var tg=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"eye-open",ref:t},e),a.createElement("path",{d:n?"M200.1998 240.3130406C178.2217782 240.3130406 160.2397602 222.2624252 160.2397602 200.200562C160.2397602 178.1386996 178.2217782 160.0880842 200.1998 160.0880842C222.177822 160.0880842 240.15984 178.1386996 240.15984 200.200562C240.15984 222.2624252 222.177822 240.3130406 200.1998 240.3130406zM400 200.8022492C400 201.0028116 400 201.203374 400 201.4039364C400 201.4039364 400 201.6044988 400 201.6044988C400 201.8050612 400 201.8050612 400 202.0056236C400 202.206186 400 202.206186 400 202.4067484C400 202.4067484 400 202.4067484 400 202.4067484C399.6004 205.6157466 398.001998 208.8247448 395.804196 211.2314936C383.016984 227.276485 367.832168 241.516415 352.447552 254.5529704C319.28072 282.6317054 281.118882 306.29806786 239.16084 315.72450034C214.985014 321.139684948 190.4095904 321.340247342 166.033966 316.7273123C143.8561438 312.71606444 122.4775224 303.89131916 102.4975024 293.06095C71.1288712 276.0131466000001 42.5574426 252.747909 17.58241758 226.4742354C12.98701298 221.4601756 8.3916084 216.6466782 4.1958042 211.2314936C-1.398601398 204.2118098 -1.398601398 195.788
3591902 4.1958042 188.7685064C16.98301698 172.723515 32.1678322 158.483585 47.5524476 145.4470296C80.7192808 117.368294 118.8811188 93.902494 160.8391608 84.2755C185.014985 78.860316 209.59041 78.659752 233.966034 83.272688C256.143856 87.484498 277.522478 96.309244 297.502498 107.139612C328.871128 124.1874158 357.442558 147.4526534 382.417582 173.726327C387.0129880000001 178.5398244 391.608392 183.5538842 395.804196 188.7685064C398.001998 191.1752552 399.4006000000001 194.183691 400 197.5932516C400 197.5932516 400 197.5932516 400 197.5932516C400 197.793814 400 197.793814 400 197.9943764C400 198.1949388 400 198.1949388 400 198.3955012C400 198.3955012 400 198.5960636 400 198.5960636C400 198.796626 400 198.9971884 400 199.1977508C400 199.3983132 400 199.7994372 400 199.9999996C400 200.4011244 400 200.6016868 400 200.8022492zM200.1998 119.975606C156.043956 119.975606 120.2797202 155.876274 120.2797202 200.200562C120.2797202 244.5248508 156.043956 280.4255192 200.1998 280.4255192C244.355644 280.4255192 280.11988 244.5248508 280.11988 200.200562C280.11988 155.876274 244.355644 119.975606 200.1998 119.975606z":"M160.049922 179.9463792C149.0670826 179.9463792 140.0811232 170.9230228 140.0811232 159.894476C140.0811232 148.8659294 149.0670826 139.842573 160.049922 139.842573C171.0327614 139.842573 180.0187208 148.8659294 180.0187208 159.894476C180.0187208 170.9230228 171.0327614 179.9463792 160.049922 179.9463792zM319.800312 160.4960332C319.800312 160.6965522 319.800312 160.6965522 319.800312 160.8970712C319.800312 160.8970712 319.800312 161.0975902 319.800312 161.0975902C319.800312 161.2981092 319.800312 161.2981092 319.800312 161.4986284C319.800312 161.6991474 319.800312 161.6991474 319.800312 161.8996664C319.800312 161.8996664 319.800312 161.8996664 319.800312 161.8996664C319.400936 164.7069328 318.202808 167.1131612 316.405616 169.1183514C306.221528 182.5531266 294.040562 194.3837494 281.659906 205.2117772C255.101404 228.6725038 224.74883 248.32336886 191.201248 256.1436110800001C171.6318252 260.956067826 152.2620904 261.156586858 132.6926678 257.34672526C114.9204368 253.7373827 97.9469578 246.51869758 81.7722308 237.4953412C56.8112324 223.25849 33.8471138 203.808144 13.87831514 181.9515694C10.28393136 177.7406698 6.68954758 173.7302892 3.2948518 169.3188706C-1.098283932 163.5038186 -1.098283932 156.4856526 3.2948518 150.6706006C13.47893916 137.2358256 25.6599064 125.4052026 38.0405616 114.5771758C64.599064 91.1164492 94.951638 71.465584 128.49922 63.6453418C147.8689548 59.033404 167.4383776 58.832886 187.0078004 62.8432658C204.780032 66.4526082 221.75351 73.6712934 237.928238 82.6946498C262.889236 96.931501 285.853354 116.381847 305.822152 138.2384206C309.416536 142.2488012 313.2106080000001 146.459701 316.605304 150.8711196C318.402496 152.87631 319.6006240000001 155.4830574 320 158.0898048C320 158.0898048 320 158.0898048 320 158.0898048C320 158.2903238 320 158.2903238 320 158.4908428C320 158.6913618 320 158.6913618 320 158.8918808C320 158.8918808 320 159.0924 320 159.0924C320 159.2929190000001 320 159.2929190000001 320 159.493438C320 159.693957 320 159.894476 320 160.094995C320 160.2955142 319.800312 160.2955142 319.800312 160.4960332zM160.049922 99.7387674C126.901716 99.7387674 100.1435258 126.6083168 100.1435258 159.894476C100.1435258 193.1806352 126.901716 220.0501854 160.049922 220.0501854C193.198128 220.0501854 219.956318 193.1806352 219.956318 159.894476C219.956318 126.6083168 193.198128 99.7387674 160.049922 99.7387674z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});tg.defaultProps={size:c.J.STANDARD},tg.displayName="Blueprint5.Icon.EyeOpen";var tv=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"eye-off",ref:t},e),a.createElement("path",{d:n?"M400 200.8C400 201 400 201.2 400 201.4C400 201.4 400 201.6 400 201.6C400 201.8 400 201.8 400 202C400 202.2 400 202.2 400 202.4C400 202.4 400 202.4 400 202.4C399.6 205.6 398 208.6 395.8 211C384.8 224.7999999999999 372 237 358.8 248.4L280.2 196C278 154 243.6 120.6 201 120.6C191.5999999999999 120.6 182.8 122.6 174.4 125.4L129.5999999999999 95.6C140 91.3999999999999 150.5999999999999 87.8 161.5999999999999 85.4C185.7999999999999 79.9999999999999 210.1999999999999 79.8 234.4 84.3999999999999C256.5999999999999 88.6 277.8 97.1999999999999 297.8 107.9999999999999C328.9999999999999 124.8 357.5999999999999 148 382.4 173.9999999999999C387 178.7999999999999 391.6 183.7999999999999 395.8 188.9999999999999C398 191.3999999999999 399.4 194.3999999999999 400 197.5999999999999C400 197.5999999999999 400 197.5999999999999 400 197.5999999999999C400 197.7999999999999 400 197.7999999999999 400 197.9999999999999C400 198.1999999999999 400 198.1999999999999 400 198.3999999999999C400 198.3999999999999 400 198.5999999999999 400 198.5999999999999C400 198.7999999999999 400 198.9999999999999 400 199.1999999999999C400 199.3999999999999 400 199.7999999999999 400 199.9999999999999C400 200.2 400 200.6 400 200.8zM390.8 303.6C396.2 307.2 400 313 400 320C400 331 391 340 380 340C375.8 340 372.2 338.4 369.2000000000001 336.4L369 336.8L300 290.8C281 301.4 261 310 239.8 314.8C215.4 320 191 320.2 166.8 315.6C144.6 311.4 123.4 302.8 103.4 292C72.2 275.2 43.6 252 18.8 226C14.2 221.2 9.6 216.4 5.4 211C0 204.2 0 195.8 5.4 189C18.2 173.2 33.2 159 48.6 146C53.8 141.8 59 137.8 64.4 133.8L8.8 96.8L9 96.4C3.8 92.8 0 87 0 80C0 69 9 60 20 60C24.2 60 27.8 61.6 30.8 63.6L31 63.2L391 303.2L390.8 303.6zM217.4 235.6C212.4 238 206.8 239.6 200.8 239.6C178.8 239.6 161 221.8 161 199.8C161 199.2 161.4 198.6 161.4 198L125.8 174.2C123 182.2 121.4 190.8 121.4 199.8C121.4 243.6 157 279.2 201 279.2C221.2 279.2 239.2 271.6 253.2 259.2L217.4 235.6z":"M320 160.6C320 160.8 320 160.8 320 161C320 161 320 161.2 320 161.2C320 161.4 320 161.4 320 161.6C320 161.8 320 161.8 320 162C320 162 320 162 320 162C319.6 164.8 318.4 167.2 316.6 169.2C306.8 181.8 295.2 193.2 283.6 203.6L220.4 158.4C219.6 126.2 193.2 100.4 160.8 100.4C154.6 100.4 148.8 101.6 143.2 103.4L101.8 74C110.6 70.2 119.8 66.8 129.2 64.6C148.6 60 168 59.8 187.6 63.6C205.2000000000001 67 222.4 74.4 238.2 83.2C263.2 97.2 286 116.6 305.8 138.2C309.4 142.2 313.2 146.4 316.4 150.6C318.2 152.6 319.4 155 319.8 157.8C319.8 157.8 319.8 157.8 319.8 157.8C319.8 158 319.8 158 319.8 158.2C319.8 158.4 319.8 158.4 319.8 158.6C319.8 158.6 319.8 158.8 319.8 158.8C319.8 159 319.8 159 319.8 159.1999999999999C319.8 159.4 319.8 159.5999999999999 319.8 159.7999999999999C320 160.2 320 160.4 320 160.
3596zM311.4 244C316.4 247.6 320 253.2 320 260C320 271 311 280 300 280C295.6 280 291.8 278.4 288.6 276L288.4 276.2L235 238C221.2 245.6 206.8 251.8 191.6 255.4C172.4 260 152.8 260.2 133.4 256.4C115.8 252.8 98.6 245.6 82.8 236.6C57.8 222.6 35 203.2 15.2 181.6C11.6 177.6 7.8 173.4 4.6 169.2C0 163.4 0 156.6 4.4 150.8C14.6 137.6 26.6 125.8 39 115C42.6 111.8 46.6 109.2 50.2 106.2L8.4 76.2L8.6 76C3.6 72.4 0 66.8 0 60C0 49 9 40 20 40C24.4 40 28.2 41.6 31.4 44L31.6 43.8L311.6 243.8L311.4 244zM103.2 144C101.8 149.2 101 154.4 101 160C101 192.8 127.8 219.6 160.8 219.6C173.2 219.6 184.6 215.4 194 209L103.2 144z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});tv.defaultProps={size:c.J.STANDARD},tv.displayName="Blueprint5.Icon.EyeOff";var tb=n(50708),ty=n(28419);let tw=(0,o.Pi)(({element:e,store:t})=>{let n=t.selectedElements.indexOf(e)>=0,[r,i]=a.useState(!1),o=()=>i(!1),l=r?e.name:e.name||(0,tp.av)(e.text)||`#${e.id}`;return a.createElement(ts,{onMouseDown:n=>{let r=n.ctrlKey||n.metaKey||n.shiftKey?[...t.selectedElementsIds]:[];0>r.indexOf(e.id)&&r.push(e.id),t.selectElements(r)},className:n?"selected":"",style:{padding:"5px",margin:"0px 1px 5px 1px",backgroundColor:n?"rgb(0, 161, 255, 0.2)":"",display:e.selectable||"admin"===t.role?"auto":"none"}},a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},a.createElement("div",{style:{lineHeight:"30px",display:"flex"}},a.createElement("div",{className:"drag-handle",style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"move",height:"30px"}},a.createElement(tm,null)),a.createElement("div",{style:{padding:"0 7px",opacity:.5,width:"60px"}},(0,T.t)("sidePanel.layerTypes."+e.type)),a.createElement("div",{style:{maxWidth:"142px"}},a.createElement(td,{minWidth:130,placeholder:(0,T.t)("sidePanel.namePlaceholder"),value:l,maxLines:1,onEdit:()=>i(!0),onCancel:o,onConfirm:o,onChange:t=>{e.set({name:t})}}))),a.createElement("div",null,a.createElement(A.z,{minimal:!0,icon:(null==e?void 0:e.visible)?a.createElement(tg,null):a.createElement(tv,null),onClick:()=>{e.set({visible:!e.visible})}}),a.createElement(A.z,{minimal:!0,icon:(null==e?void 0:e.locked)?a.createElement(tb.H,null):a.createElement(ty.S,null),onClick:()=>{e.set({draggable:e.locked,contentEditable:e.locked,styleEditable:e.locked,resizable:e.locked,removable:e.locked})}}),a.createElement(A.z,{icon:a.createElement(O.r,null),minimal:!0,disabled:!e.removable,onClick:()=>{t.deleteElements([e.id])},style:{marginLeft:"auto"}}))))}),tx=(0,o.Pi)(({store:e})=>{var t;let n=(null===(t=e.activePage)||void 0===t?void 0:t.children.map(e=>({id:e.id})))||[];n.reverse();let r=(0,C.tq)();return a.createElement("div",{style:{height:"100%",overflow:"auto"}},a.createElement("div",{style:{height:"40px",paddingTop:"5px"}},(0,T.t)("sidePanel.layersTip")),a.createElement("div",null,0===n.length?a.createElement("div",null,(0,T.t)("sidePanel.noLayers")):null,a.createElement(tf.ReactSortable,{list:n,setList:t=>{t.forEach(({id:n},r)=>{var i,a;let o=t.length-r-1,l=e.getElementById(n),s=null===(i=e.activePage)||void 0===i?void 0:i.children.indexOf(l);l&&s!==o&&(null===(a=e.activePage)||void 0===a||a.setElementZIndex(l.id,o))})},direction:"horizontal",handle:r?".drag-handle":void 0},n.map(({id:t})=>{let n=e.getElementById(t);return a.createElement(tw,{element:n,store:e,key:t})}))))});var tC=n(69295),tE=n(39174);let tk=(0,x.Z)("div")` 360 height: 100%; 361 overflow: auto; 362`,tS=(0,x.Z)("div")` 363 width: 50%; 364 float: left; 365`,tT=(0,x.Z)("div")` 366 padding: 5px; 367 width: 100%; 368 &:hover .video-grid__item-credit { 369 opacity: 1; 370 } 371`,tP=(0,x.Z)("div")` 372 position: relative; 373`,tM=(0,x.Z)("video",a.forwardRef)` 374 width: 100%; 375 cursor: pointer; 376 display: block; 377 max-height: 300px; 378 min-height: 50px; 379 object-fit: cover; 380 border-radius: 5px; 381 box-shadow: 0 0 5px rgba(16, 22, 26, 0.3); 382`,tR=(0,x.Z)("div")` 383 position: absolute; 384 top: 0.5rem; 385 right: 0.5rem; 386 background-color: rgba(0, 0, 0, 0.5); 387 color: white; 388 padding: 2px 7px; 389 text-align: center; 390 display: flex; 391 justify-content: center; 392 align-items: center; 393 border-radius: 4rem; 394`,tA=(0,x.Z)("span")` 395 font-size: 12px; 396`,tL=(0,x.Z)("div",a.forwardRef)` 397 padding: 3rem; 398`,t_=(0,x.Z)("div")` 399 position: absolute; 400 opacity: 0; 401 bottom: 0; 402 left: 0; 403 right: 0; 404 padding: 3px; 405 background: linear-gradient( 406 to bottom, 407 rgba(0, 0, 0, 0), 408 rgba(0, 0, 0, 0.4), 409 rgba(0, 0, 0, 0.6) 410 ); 411 color: white; 412 font-size: 10px; 413 text-align: center; 414`,tI=({items:e,onSelect:t,loadMore:n,isLoading:r,error:i,getCredit:o})=>{let l=(0,a.useRef)(null),s=(0,a.useCallback)(e=>
414{r||(l.current&&l.current.disconnect(),l.current=new IntersectionObserver(e=>{e[0].isIntersecting&&n()}),e&&l.current.observe(e))},[r]);if(i)return a.createElement("div",null,i.message);if(!e||0===e.length)return null;let c=e.filter((e,t)=>t%2==1),u=e.filter((e,t)=>t%2==0);return a.createElement(tk,null,[c,u].map((e,n)=>a.createElement(tS,{key:n},e.map(e=>a.createElement(tO,{key:e.id,item:e,onClick:()=>t(e),onDragStart:n=>{(0,V.Gs)((n,r)=>{t(e,n,r)})},onDragEnd:()=>(0,V.Gs)(null),getCredit:o})),a.createElement(tL,{ref:s},r&&a.createElement(tE.$,null)))))},tO=({item:e,onClick:t,onDragEnd:n,onDragStart:r,getCredit:i})=>{var o;let l;let s=(0,a.useRef)(null),c=(null===(o=e.video_files.find(e=>"sd"===e.quality))||void 0===o?void 0:o.link)||"";if(!c)return null;let u=new Date(1e3*e.duration).toISOString();return l=e.duration>3600?u.substring(11,19):u.substring(14,19),a.createElement(tT,null,a.createElement(tP,{draggable:!0,onClick:t,onDragEnd:n,onDragStart:r,onMouseEnter:()=>{var e,t;null===(t=null===(e=s.current)||void 0===e?void 0:e.play())||void 0===t||t.catch(()=>{})},onMouseLeave:()=>{var e;null===(e=s.current)||void 0===e||e.pause(),s.current&&(s.current.currentTime=0)}},a.createElement(tM,{poster:e.video_pictures[0].picture,controls:!1,ref:s,muted:!0,preload:"none",playsInline:!0},a.createElement("source",{src:c})),a.createElement(tR,null,a.createElement(tA,null,l)),i&&a.createElement(t_,{className:"video-grid__item-credit"},i(e))))},tD=(0,o.Pi)(({store:e})=>{let{setQuery:t,loadMore:n,isReachingEnd:r,data:i,isLoading:o,error:l}=B({defaultQuery:"",getAPI:({page:e,query:t})=>(({query:e,page:t})=>`https://api.polotno.com/api/pexels/videos/${e?"search":"popular"}?query=${e}&per_page=20&page=${t}&KEY=${(0,tC.km)()}`)({page:e,query:t}),getSize:e=>e.total_results/e.per_page});return a.createElement("div",{style:{height:"100%",display:"flex",flexDirection:"column"}},a.createElement(e_.B,{leftIcon:a.createElement(eI.o,null),placeholder:(0,T.t)("sidePanel.searchPlaceholder"),onChange:e=>{t(e.target.value)},type:"search",style:{marginBottom:"20px"}}),a.createElement("p",{style:{textAlign:"center"}},"Videos by"," ",a.createElement("a",{href:"https://www.pexels.com/",target:"_blank"},"Pexels")),a.createElement(tI,{items:null==i?void 0:i.map(e=>e.videos).flat().filter(Boolean),onSelect:async(t,n,r)=>{var i;eT({src:(null===(i=t.video_files.find(e=>"hd"===e.quality))||void 0===i?void 0:i.link)||t.video_files[0].link,store:e,droppedPos:n,targetElement:r,attrs:{width:t.width,height:t.height}})},isLoading:o,error:l,loadMore:!r&&n,getCredit:e=>a.createElement("span",null,"Video by"," ",a.createElement("a",{href:e.user.url,target:"_blank",rel:"noreferrer"},e.user.name)," ","on"," ",a.createElement("a",{href:"https://pexels.com/?utm_source=polotno&utm_medium=referral",target:"_blank",rel:"noreferrer noopener"},"Pexels"))}))});var tz=n(28969),tN=n(86652),tF=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"select",ref:t},e),a.createElement("path",{d:n?"M394.2000000000001 34.2L309.2000000000001 119.2000000000001L400 141.8L198.6 213.4C199.4 215.4 200 217.6 200 220V340C200 351 191 360 180 360H80V380C80 391 71 400 60 400S40 391 40 380V360H20C9 360 0 351 0 340C0 329 9 320 20 320H40V220C40 209 49 200 60 200H180C182.4 200 184.6 200.6 186.8 201.4L258.2 0L281 90.8L366 5.8C369.4 2.2 374.4 0 380 0C391 0 400 9 400 20C400 25.6 397.8 30.6 394.2000000000001 34.2zM160 240H80V320H160V240z":"M320 20C320 25.6 317.6 30.4 313.8 33.8L314.2 34.2L251.8 96.6L320 113.4L159 170.6C159.6 172.4 160 174 160 176V280C160 291 151 300 140 300H60C60 311 51 320 40 320S20 311 20 300C9 300 0 291 0 280C0 269 9 260 20 260V180C20 169 29 160 40 160H144C146 160 147.6 160.4 149.4 161L206.6 0L223.6 68.2L286 5.8L286.4 6.2C289.6 2.4 294.4000000000001 0 300 0C300.8 0 301.4 0.4 302 0.4C302.6 0.4 303.2 0 304 0C312.8 0 320 7.2 320 16C320 16.8 319.6 17.4 319.6 18C319.6 18.6 320 19.2 320 20zM120 200H60V260H120V200z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});tF.defaultProps={size:c.J.STANDARD},tF.displayName="Blueprint5.Icon.Select";var tB=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"highlight",ref:t},e),a.createElement("path",{d:n?"M224.4 118.2L285 178.8L299.2000000000001 164.6L400 265.4L285.8 379.6L185 278.8L199.2 264.6L138.8 203.8L224.4
414118.2zM360.4 40H40.4C29.4 40 20.4 31 20.4 20C20.4 9 29.4 0 40.4 0H360.4C371.4 0 380.4 9 380.4 20C380.4 31 371.4 40 360.4 40zM60.4 60H141.2C146.8 60 151.8 62.2 155.4 66L195.8 106.4L127 175.4L46.2 94.6C42.6 91 40.2 85.8 40.2 80.4C40.4 69 49.4 60 60.4 60z":"M182.4 98.6L222.4 139L236.6 124.8L316.6 205.6L203.4 320L123.4 239.2L137.6 225L97.6 184.6L182.4 98.6zM40 60.6H120C125.6 60.6 130.6 62.8 134.2 66.6L154.2 86.8L85.8 155.8L25.8 95.2C22.2 91.6 20 86.4 20 80.8C20 69.8 29 60.6 40 60.6zM300 40.4H20C9 40.4 0 31.4 0 20.2S9 0 20 0H300C311 0 320 9 320 20.2S311 40.4 300 40.4z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});tB.defaultProps={size:c.J.STANDARD},tB.displayName="Blueprint5.Icon.Highlight";let tH=(0,x.Z)("div")` 415 height: 100%; 416 display: flex; 417 flex-direction: column; 418 overflow: auto; 419`,tV=(0,x.Z)("div")` 420 margin-bottom: 30px; 421`,tj=(0,x.Z)("h3")` 422 margin-bottom: 15px; 423 font-size: 14px; 424 font-weight: 600; 425 text-transform: uppercase; 426 color: var(--bp5-text-color-muted); 427`,t$=(0,x.Z)("div")` 428 display: flex; 429 align-items: center; 430 justify-content: space-between; 431 padding: 5px 0; 432`,tU=(e,t,n)=>Math.max(t,Math.min(n,e)),tW=(e,t)=>Array.from(e.keys()).find(e=>eW.mf(e,t)),tG=(e,t)=>{let n=tW(e,t);return e.get(n||"")||t},tq=(0,o.Pi)(({store:e})=>{let{brushType:t,strokeWidth:n,stroke:r,opacity:i}=e.toolOptions,o="selection"===e.tool,l=e.selectedElements,s=1===l.length&&"svg"===l[0].type,c=s?l[0]:null,u=eW.rr((null==c?void 0:c.src)||""),d=u.length>0?u[0]:null,h=t=>{"selection"===t?e.setTool("selection"):(e.selectElements([]),e.setTool("draw"),e.setToolOptions({brushType:t,opacity:"highlighter"===t?.5:1,strokeWidth:"highlighter"===t?30:n||5}))},f=t=>{e.setToolOptions({strokeWidth:t})},p=t=>{e.setToolOptions({opacity:t})},m=e=>{c&&c.set({opacity:e})};return a.useEffect(()=>()=>{e.setTool("selection")},[]),a.createElement(tH,null,a.createElement(tV,null,a.createElement(tj,null,"Tool"),a.createElement(tz.h,{fill:!0,style:{padding:"0 5px"}},a.createElement(A.z,{active:o,onClick:()=>h("selection"),icon:a.createElement(tF,null)},"Selection"),a.createElement(A.z,{active:!o&&"brush"===t,onClick:()=>h("brush"),icon:a.createElement(b,null)},"Brush"),a.createElement(A.z,{active:!o&&"highlighter"===t,onClick:()=>h("highlighter"),icon:a.createElement(tB,null)},"Highlighter"))),!s&&a.createElement(a.Fragment,null,a.createElement(tV,{style:{opacity:o?.5:1}},a.createElement(t$,null,a.createElement("div",null,"Stroke Width"),a.createElement(X.A,{value:n,onValueChange:e=>{Number.isNaN(e)||f(tU(e,1,50))},style:{width:"60px"},min:1,max:50,buttonPosition:"none",disabled:o})),a.createElement("div",{style:{padding:"0 13px"}},a.createElement(tN.i,{min:1,max:50,stepSize:1,value:n,onChange:f,labelRenderer:!1,showTrackFill:!1,disabled:o}))),a.createElement(tV,{style:{opacity:o?.5:1,pointerEvents:o?"none":"auto"}},a.createElement(t$,null,a.createElement("div",{style:{lineHeight:"30px"}},"Color"),a.createElement(eN.ZP,{value:r,size:30,onChange:t=>{e.setToolOptions({stroke:t})},store:e}))),a.createElement(tV,{style:{opacity:o?.5:1}},a.createElement(t$,null,a.createElement("div",null,"Opacity"),a.createElement(X.A,{value:Math.round(100*i),onValueChange:e=>{Number.isNaN(e)||p(tU(e,0,100)/100)},style:{width:"60px"},min:0,max:100,buttonPosition:"none",disabled:o})),a.createElement("div",{style:{padding:"0 13px"}},a.createElement(tN.i,{min:0,max:100,stepSize:1,value:Math.round(100*i),onChange:e=>p(e/100),labelRenderer:!1,showTrackFill:!1,disabled:o})))),s&&d&&a.createElement(a.Fragment,null,a.createElement(tV,null,a.createElement(t$,null,a.createElement("div",{style:{lineHeight:"30px"}},"Color"),a.createElement(eN.ZP,{value:tG(c.colorsReplace,d),size:30,onChange:e=>{if(c&&d){let t=tW(c.colorsReplace,d)||d;c.replaceColor(t,e)}},store:e,gradientEnabled:!0}))),a.createElement(tV,null,a.createElement(t$,null,a.createElement("div",null,"Opacity"),a.createElement(X.A,{value:Math.round(100*c.opacity),onValueChange:e=>{Number.isNaN(e)||m(tU(e,0,100)/100)},style:{width:"60px"},min:0,max:100,buttonPosition:"none"})),a.createElement("div",{style:{padding:"0 13px"}},a.createElement(tN.i,{min:0,max:100,stepSize:1,value:Math.round(100*c.opacity),onChange:e=>m(e/100),labelRenderer:!1,showTrackFill:!1})))))});var tZ=n(31821);let tX=Object.keys(eG.vK),tY=[{width:300,height:300,fill:"lightgray",stroke:"#0c0c0c",strokeWidth:0,url:""}],tK=[];
432tX.forEach(e=>{tY.forEach(t=>{tK.push(Object.assign({subType:e},t))})}),tK.forEach(e=>{e.url=(0,eW.XP)((0,eG.vn)(e))});let tJ=(0,x.Z)("div")` 433 height: 220px; 434`,tQ=(0,o.Pi)(({store:e})=>{let t=Math.ceil(tK.length/4)||1,n=e.selectedElements.map(e=>e.id).join(","),r="image-clip"===e.openedSidePanel,i=()=>{let t=e.previousOpenedSidePanel;e.openSidePanel(t||"photos")};return a.useEffect(()=>{r&&(n||i())},[r,n]),a.createElement("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"auto"}},a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},a.createElement("h3",{style:{margin:0,lineHeight:"30px"}},(0,T.t)("sidePanel.clipImage")),a.createElement(A.z,{minimal:!0,icon:a.createElement(tZ.X,null),onClick:()=>i()})),a.createElement(tJ,{style:{height:110*t+"px"}},a.createElement(R.t,{shadowEnabled:!1,rowsNumber:4,images:tK,getPreview:e=>e.url,isLoading:!1,itemHeight:100,onSelect:async(t,n,r)=>{(r?[r]:e.selectedElements).forEach(e=>{("image"===e.type||"video"===e.type)&&e.contentEditable&&e.set({clipSrc:t.url})})}})))});var t0=n(50058),t1=n(88283),t2=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"arrow-right",ref:t},e),a.createElement("path",{d:n?"M374.2000000000001 214.2L254.2 334.2000000000001C250.6 337.8 245.6 340 240 340C229 340 220 331 220 320C220 314.4 222.2 309.4 225.8 305.8L311.8 220H40C29 220 20 211 20 200C20 189 29 180 40 180H311.8L226 94.2000000000001C222.2 90.6 220 85.6 220 80C220 69 229 60 240 60C245.6 60 250.6 62.2 254.2 65.8L374.2000000000001 185.8C377.8 189.4 380 194.4 380 200C380 205.6 377.8 210.6 374.2000000000001 214.2z":"M294 174.2L194 274.2C190.4 278 185.4 280.2 179.8 280.2C168.8 280.2 159.8 271.2 159.8 260.2C159.8 254.6 162 249.6 165.6 246L231.4 180.2H39.8C28.8 180.2 19.8 171.2 19.8 160.2S28.8 140.2 39.8 140.2H231.6L165.8 74.4C162.2 70.8 160 65.8 160 60.1999999999999C160 49.1999999999999 169 40.1999999999999 180 40.1999999999999C185.6 40.1999999999999 190.6 42.4 194.2 45.9999999999999L294.2000000000001 146C297.8 149.5999999999999 300 154.5999999999999 300 160.1999999999999S297.6 170.6 294 174.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});t2.defaultProps={size:c.J.STANDARD},t2.displayName="Blueprint5.Icon.ArrowRight";var t4=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"arrow-left",ref:t},e),a.createElement("path",{d:n?"M360 220H88.2L174 305.8C177.8 309.4 180 314.4 180 320C180 331 171 340 160 340C154.4 340 149.4 337.8 145.8 334.2L25.8 214.2C22.2 210.6 20 205.6 20 200C20 194.4 22.2 189.4 25.8 185.8L145.8 65.8C149.4 62.2 154.4 60 160 60C171 60 180 69 180 80C180 85.6 177.8 90.6 174.2 94.2000000000001L88.2 180H360C371 180 380 189 380 200C380 211 371 220 360 220z":"M279.8 180.2H88.2L154 246C157.6 249.6 159.8 254.6 159.8 260.2C159.8 271.2 150.8 280.2 139.8 280.2C134.2 280.2 129.2 278 125.6 274.4L25.6 174.4C22 170.6 19.8 165.6 19.8 160.2S22 149.6 25.6 146L125.6 46C129.2 42.4 134.2 40.2 139.8 40.2C150.8 40.2 159.8 49.2 159.8 60.2000000000001C159.8 65.8 157.6 70.8 154 74.4L88.2 140.2H280C291 140.2 300 149.2 300 160.2S290.8 180.2 279.8 180.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});t4.defaultProps={size:c.J.STANDARD},t4.displayName="Blueprint5.Icon.ArrowLeft";var t3=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"arrow-up",ref:t},e),a.createElement("path",{d:n?"M334 254L214 374C210 378 206 380 200 380S190 378 186 374L66 254C62 250 60 246 60 240C60 228 70 220 80 220C86 220 90 222 94 226L180 312V40C180 30 188 20 200 20S220 30 220 40V312L306 226C310 222 314 220 320 220C330 220 340 228 340 240C340 246 338 250 334 254L334 254z":"M274 194L174 294C170 298 166 300 160 300S150 298 146 294L46 194C42 190 40 186 40 180C40 168 50 160 60 160C66 160 70 162 74 166L140 232V40C140 28 148 20 160 20S180 28 180 40V232L246 166C250 162 254 160 260 160C272 160 280 168 280 180C280 186 278 190 274 194L274 194z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});t3.defaultProps={size:c.J.STANDARD},t3.displayName="Blueprint5.Icon.ArrowUp";var t8=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"arrow-down",ref:t},e),a.createElement("path",{d:n?"M320 180C314 180 310 178 306 174L220 88V360C220 370 212 380 200 380S180 370 180 360V88L94 174C90 178 86 180 80 180C70 180 60 172 60 160C60 154 62 150 66 146L186 26C190 22 194 20 200 20S210 22 214 26L334 146C338 150 340 154 340 160C340 172 330 180 320 180L320 180z":"M260 160C254 160 250 158 246 154L180 88V280C180 290 172 300 160 300S140 290 140 280V88L74 154C70 158 66 160 60 160C50 160 40 150 40 140C40 134 42 130 46 126L146 26C150 22 154 20 160 20S170 22 174 26L274 126C278 130 280 134 280 140C280 152 272 160 260 160L260 160z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});t8.defaultProps={size:c.J.STANDARD},t8.displayName="Blueprint5.Icon.ArrowDown";var t6=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"arrow-bottom-right",ref:t},e),a.createElement("path",{d:n?"M340 280C329 280 320 271 320 260V108.2L74.2 354.2C70.6 357.8 65.6 360 60 360C49 360 40 351 40 340C40 334.4 42.2 329.4 45.8 325.8L291.8 80H140C129 80 120 71 120 60C120 49 129 40 140 40H340C351 40 360 49 360 60V260C360 271 351 280 340 280z":"M260 220C249 220 240 211 240 200V108.2L74.2 274.2C70.6 277.8 65.6 280 60 280C49 280 40 271 40 260C40 254.4 42.2 249.4 45.8 245.8L211.8 80H120C109 80 100 71 100 60C100 49 109 40 120 40H260C271 40 280 49 280 60V200C280 211 271 220 260 220z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});t6.defaultProps={size:c.J.STANDARD},t6.displayName="Blueprint5.Icon.ArrowBottomRight";var t5=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"arrow-bottom-left",ref:t},e),a.createElement("path",{d:n?"M360 340C360 351 351 360 340 360C334.4 360 329.4 357.8 325.8 354.2L80 108.2V260C80 271 71 280 60 280S40 271 40 260V60C40 49 49 40 60 40H2
43460C271 40 280 49 280 60C280 71 271 80 260 80H108.2L354.2000000000001 325.8C357.8 329.4 360 334.4 360 340z":"M280 260C280 271 271 280 260 280C254.4 280 249.4 277.8 245.8 274.2L80 108.2V200C80 211 71 220 60 220S40 211 40 200V60C40 49 49 40 60 40H200C211 40 220 49 220 60C220 71 211 80 200 80H108.2L274 245.8C277.8 249.4 280 254.4 280 260z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});t5.defaultProps={size:c.J.STANDARD},t5.displayName="Blueprint5.Icon.ArrowBottomLeft";var t9=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"arrow-top-right",ref:t},e),a.createElement("path",{d:n?"M340 360H140C129 360 120 351 120 340C120 329 129 320 140 320H291.8L45.8 74.2000000000001C42.2 70.6 40 65.6 40 60C40 49 49 40 60 40C65.6 40 70.6 42.2 74.2 45.8L320 291.8V140C320 129 329 120 340 120S360 129 360 140V340C360 351 351 360 340 360z":"M260 280H120C109 280 100 271 100 260C100 249 109 240 120 240H211.8L46 74.2C42.2 70.6 40 65.6 40 60C40 49 49 40 60 40C65.6 40 70.6 42.2 74.2 45.8L240 211.8V120C240 109 249 100 260 100S280 109 280 120V260C280 271 271 280 260 280z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});t9.defaultProps={size:c.J.STANDARD},t9.displayName="Blueprint5.Icon.ArrowTopRight";var t7=a.forwardRef(function(e,t){var n=e.size>=c.J.LARGE,r=n?c.J.LARGE:c.J.STANDARD,i="".concat(-1*r/.05/2);return a.createElement(u.l,(0,s.pi)({iconName:"arrow-top-left",ref:t},e),a.createElement("path",{d:n?"M354.2000000000001 74.2000000000001L108.2 320H260C271 320 280 329 280 340C280 351 271 360 260 360H60C49 360 40 351 40 340V140C40 129 49 120 60 120S80 129 80 140V291.8L325.8 46C329.4 42.2 334.4 40 340 40C351 40 360 49 360 60C360 65.6 357.8 70.6 354.2000000000001 74.2000000000001z":"M274.2000000000001 74.2L108.2 240H200C211 240 220 249 220 260C220 271 211 280 200 280H60C49 280 40 271 40 260V120C40 109 49 100 60 100S80 109 80 120V211.8L245.8 46C249.4 42.2 254.4 40 260 40C271 40 280 49 280 60C280 65.6 277.8 70.6 274.2000000000001 74.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});t7.defaultProps={size:c.J.STANDARD},t7.displayName="Blueprint5.Icon.ArrowTopLeft";var ne=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let nt=(0,x.Z)("div")` 435 padding: 10px; 436 background-color: rgba(0, 0, 0, 0.05); 437 438 .bp5-dark & { 439 background-color: rgba(255, 255, 255, 0.05); 440 } 441`,nn=e=>{var{value:t,onValueChange:n}=e,r=ne(e,["value","onValueChange"]);let[i,o]=a.useState(t.toString());return a.useEffect(()=>{o(t.toString())},[t]),a.createElement(X.A,Object.assign({value:i,onValueChange:(e,t)=>
441{o(t),Number.isNaN(e)||n(e)}},r))},nr=()=>a.createElement("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{margin:0}},a.createElement("path",{d:"M9.88114 6.74408C9.79978 6.66282 9.73524 6.56631 9.69121 6.46009C9.64718 6.35387 9.62451 6.24001 9.62451 6.12502C9.62451 6.01003 9.64718 5.89617 9.69121 5.78994C9.73524 5.68372 9.79978 5.58722 9.88114 5.50595L13.3811 2.00595C13.4624 1.9246 13.5589 1.86006 13.6651 1.81603C13.7714 1.77199 13.8852 1.74933 14.0002 1.74933C14.1152 1.74933 14.229 1.77199 14.3353 1.81603C14.4415 1.86006 14.538 1.9246 14.6193 2.00595L18.1193 5.50595C18.2834 5.67014 18.3757 5.89282 18.3757 6.12502C18.3757 6.35721 18.2834 6.57989 18.1193 6.74408C17.9551 6.90827 17.7324 7.0005 17.5002 7.0005C17.268 7.0005 17.0453 6.90827 16.8811 6.74408L14.8752 4.73705V10.5C14.8752 10.7321 14.783 10.9546 14.6189 11.1187C14.4548 11.2828 14.2323 11.375 14.0002 11.375C13.7681 11.375 13.5456 11.2828 13.3815 11.1187C13.2174 10.9546 13.1252 10.7321 13.1252 10.5V4.73705L11.1193 6.74408C11.038 6.82543 10.9415 6.88997 10.8353 6.93401C10.729 6.97804 10.6152 7.00071 10.5002 7.00071C10.3852 7.00071 10.2714 6.97804 10.1651 6.93401C10.0589 6.88997 9.9624 6.82543 9.88114 6.74408ZM16.8811 21.256L14.8752 23.263V17.5C14.8752 17.268 14.783 17.0454 14.6189 16.8813C14.4548 16.7172 14.2323 16.625 14.0002 16.625C13.7681 16.625 13.5456 16.7172 13.3815 16.8813C13.2174 17.0454 13.1252 17.268 13.1252 17.5V23.263L11.1193 21.256C10.9551 21.0918 10.7324 20.9995 10.5002 20.9995C10.268 20.9995 10.0453 21.0918 9.88114 21.256C9.71695 21.4201 9.62471 21.6428 9.62471 21.875C9.62471 22.1072 9.71695 22.3299 9.88114 22.4941L13.3811 25.9941C13.4624 26.0754 13.5589 26.14 13.6651 26.184C13.7714 26.228 13.8852 26.2507 14.0002 26.2507C14.1152 26.2507 14.229 26.228 14.3353 26.184C14.4415 26.14 14.538 26.0754 14.6193 25.9941L18.1193 22.4941C18.2834 22.3299 18.3757 22.1072 18.3757 21.875C18.3757 21.6428 18.2834 21.4201 18.1193 21.256C17.9551 21.0918 17.7324 20.9995 17.5002 20.9995C17.268 20.9995 17.0453 21.0918 16.8811 21.256ZM25.9943 13.381L22.4943 9.88095C22.3301 9.71677 22.1074 9.62453 21.8752 9.62453C21.643 9.62453 21.4203 9.71677 21.2561 9.88095C21.092 10.0451 20.9997 10.2678 20.9997 10.5C20.9997 10.7322 21.092 10.9549 21.2561 11.1191L23.2632 13.125H17.5002C17.2681 13.125 17.0456 13.2172 16.8815 13.3813C16.7174 13.5454 16.6252 13.768 16.6252 14C16.6252 14.2321 16.7174 14.4546 16.8815 14.6187C17.0456 14.7828 17.2681 14.875 17.5002 14.875H23.2632L21.2561 16.881C21.092 17.0451 20.9997 17.2678 20.9997 17.5C20.9997 17.7322 21.092 17.9549 21.2561 18.1191C21.4203 18.2833 21.643 18.3755 21.8752 18.3755C22.1074 18.3755 22.3301 18.2833 22.4943 18.1191L25.9943 14.6191C26.0756 14.5378 26.1402 14.4413 26.1842 14.3351C26.2282 14.2289 26.2509 14.115 26.2509 14C26.2509 13.885 26.2282 13.7712 26.1842 13.6649C26.1402 13.5587 26.0756 13.4622 25.9943 13.381ZM4.73723 14.875H10.5002C10.7323 14.875 10.9548 14.7828 11.1189 14.6187C11.283 14.4546 11.3752 14.2321 11.3752 14C11.3752 13.768 11.283 13.5454 11.1189 13.3813C10.9548 13.2172 10.7323 13.125 10.5002 13.125H4.73723L6.74426 11.1191C6.90845 10.9549 7.00069 10.7322 7.00069 10.5C7.00069 10.2678 6.90845 10.0451 6.74426 9.88095C6.58008 9.71677 6.35739 9.62453 6.1252 9.62453C5.89301 9.62453 5.67032 9.71677 5.50614 9.88095L2.00614 13.381C1.92478 13.4622 1.86024 13.5587 1.81621 13.6649C1.77218 13.7712 1.74951 13.885 1.74951 14C1.74951 14.115 1.77218 14.2289 1.81621 14.3351C1.86024 14.4413 1.92478 14.5378 2.00614 14.6191L5.50614 18.1191C5.67032 18.2833 5.89301 18.3755 6.1252 18.3755C6.35739 18.3755 6.58008 18.2833 6.74426 18.1191C6.90845 17.9549 7.00069 17.7322 7.00069 17.5C7.00069 17.2678 6.90845 17.0451 6.74426 16.881L4.73723 14.875Z",fill:"currentColor"})),ni=()=>a.createElement("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{margin:0}},a.createElement("circle",{cx:"7",cy:"14",r:"5",fill:"currentColor",fillOpacity:"0.2",stroke:"currentColor",strokeWidth:"2",strokeOpacity:"0.3"}),a.createElement("circle",{cx:"14",cy:"14",r:"5",fill:"currentColor",fillOpacity:"0.5",stroke:"currentColor",strokeWidth:"2",strokeOpacity:"0.6"}),a.createElement("circle",{cx:"21",cy:"14",r:"5",fill:"currentColor",fillOpacity:"0.9",stroke:"currentColor",strokeWidth:"2",strokeOpacity:"1"})),na=()=>a.createElement("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{margin:0}},a.createElement("path",{d:"M15.75 11.375V7C15.75 6.76793 15.8422 6.54537 16.0063 6.38128C16.1704 6.21719 16.3929 6.125 16.625 6.125C16.8571 6.125 17.0796 6.21719 17.2437 6.38128C17.4078 6.54537 17.5 6.76793 17.5 7V9.26297L22.1309 4.63094C22.2951 4.46675 22.5178 4.37451 22.75 4.37451C22.9822 4.37451 23.2049 4.46675 23.3691 4.63094C23.5332 4.79512 23.6255 5.0178 23.6255 5.25C23.6255 5.48219 23.5332 5.70488 23.3691 5.86906L18.737 10.5H21C21.2321 10.5 21.4546 10.5922 21.6187 10.7563C21.7828 10.9204 21.875 11.1429 21.875 11.375C21.875 11.6071 21.7828 11.8296 21.6187 11.9937C21.4546 12.1578 21.2321 12.25 21 12.25H16.625C16.3929 12.25 16.1704 12.1578 16.0063 11.9937C15.8422 11.8296 15.75 11.6071 15.75 11.375ZM11.375 15.75H7C6.76793 15.75 6.54537 15.8422 6.38128 16.0063C6.21719 16.1704 6.125 16.3929 6.125 16.625C6.125 16.8571 6.21719 17.0796 6.38128 17.2437C6.54537 17.4078 6.76793 17.5 7 17.5H9.26297L4.63094 22.1309C4.46675 22.2951 4.37451 22.5178 4.37451 22.75C4.37451 22.9822 4.46675 23.2049 4.63094 23.3691C4.79512 23.5332 5.0178 23.6255 5.25 23.6255C5.48219 23.6255 5.70488 23.5332 5.86906 23.3691L10.5 18.737V21C10.5 21.2321 10.5922 21.4546 10.7563 21.6187C10.9204 21.7828 11.1429 21.875 11.375 21.875C11.6071 21.875 11.8296 21.7828 11.9937 21.6187C12.1578 21.4546 12.25 21.2321 12.25 21V16.625C12.25 16.3929 12.1578 16.1704 11.9937 16.0063C11.8296 15.8422 11.6071 15.75 11.375 15.75ZM18.737 17.5H21C21.2321 17.5 21.4546 17.4078 21.6187 17.2437C21.7828 17.0796 21.875 16.8571 21.875 16.625C21.875 16.3929 21.7828 16.1704 21.6187 16.0063C21.4546 15.8422 21.2321 15.75 21 15.75H16.625C16.3929 15.75 16.1704 15.8422 16.0063 16.0063C15.8422 16.1704 15.75 16.3929 15.75 16.625V21C15.75 21.2321 15.8422 21.4546 16.0063 21.6187C16.1704 21.7828 16.3929 21.875 16.625 21.875C16.8571 21.875 17.0796 21.7828 17.2437 21.6187C17.4078 21.4546 17.5 21.2321 17.5 21V18.737L22.1309 23.3691C22.2122 23.4504 22.3087 23.5148 22.415 23.5588C22.5212 23.6028 22.635 23.6255 22.75 23.6255C22.865 23.6255 22.9788 23.6028 23.085 23.5588C23.1913 23.5148 23.2878 23.4504 23.3691 23.3691C23.4504 23.2878 23.5148 23.1913 23.5588 23.085C23.6028 22.9788 23.6255 22.865 23.6255 22.75C23.6255 22.635 23.6028 22.5212 23.5588 22.415C23.5148 22.3087 23.4504 22.2122 23.3691 22.1309L18.737 17.5ZM11.375 6.125C11.1429 6.125 10.9204 6.21719 10.7563 6.38128C10.5922
4416.54537 10.5 6.76793 10.5 7V9.26297L5.86906 4.63094C5.70488 4.46675 5.48219 4.37451 5.25 4.37451C5.0178 4.37451 4.79512 4.46675 4.63094 4.63094C4.46675 4.79512 4.37451 5.0178 4.37451 5.25C4.37451 5.48219 4.46675 5.70488 4.63094 5.86906L9.26297 10.5H7C6.76793 10.5 6.54537 10.5922 6.38128 10.7563C6.21719 10.9204 6.125 11.1429 6.125 11.375C6.125 11.6071 6.21719 11.8296 6.38128 11.9937C6.54537 12.1578 6.76793 12.25 7 12.25H11.375C11.6071 12.25 11.8296 12.1578 11.9937 11.9937C12.1578 11.8296 12.25 11.6071 12.25 11.375V7C12.25 6.76793 12.1578 6.54537 11.9937 6.38128C11.8296 6.21719 11.6071 6.125 11.375 6.125Z",fill:"currentColor"})),no=()=>a.createElement("svg",{width:"28",height:"28",viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg",style:{margin:0}},a.createElement("path",{d:"M9.625 11.375H4.375C4.14294 11.375 3.92038 11.2828 3.75628 11.1187C3.59219 10.9546 3.5 10.7321 3.5 10.5V5.25001C3.5 5.01794 3.59219 4.79538 3.75628 4.63129C3.92038 4.46719 4.14294 4.37501 4.375 4.37501C4.60706 4.37501 4.82962 4.46719 4.99372 4.63129C5.15781 4.79538 5.25 5.01794 5.25 5.25001V8.38797L6.85016 6.78782C8.80164 4.82651 11.452 3.72026 14.2188 3.71219H14.2767C17.0199 3.70513 19.6555 4.77908 21.6125 6.70141C21.7723 6.86488 21.8618 7.0844 21.8618 7.313C21.8618 7.5416 21.7723 7.76112 21.6126 7.92461C21.4528 8.0881 21.2354 8.18257 21.0068 8.18781C20.7783 8.19306 20.5568 8.10865 20.3897 7.95266C18.7584 6.3515 16.5625 5.45684 14.2767 5.46219H14.2275C11.9221 5.46929 9.71368 6.39096 8.08719 8.02485L6.48703 9.62501H9.625C9.85706 9.62501 10.0796 9.71719 10.2437 9.88129C10.4078 10.0454 10.5 10.2679 10.5 10.5C10.5 10.7321 10.4078 10.9546 10.2437 11.1187C10.0796 11.2828 9.85706 11.375 9.625 11.375ZM23.625 16.625H18.375C18.1429 16.625 17.9204 16.7172 17.7563 16.8813C17.5922 17.0454 17.5 17.2679 17.5 17.5C17.5 17.7321 17.5922 17.9546 17.7563 18.1187C17.9204 18.2828 18.1429 18.375 18.375 18.375H21.513L19.9128 19.9752C18.2866 21.6088 16.0786 22.5304 13.7736 22.5378H13.7244C11.4386 22.5432 9.24264 21.6485 7.61141 20.0473C7.52991 19.964 7.43257 19.8977 7.32511 19.8525C7.21764 19.8073 7.10223 19.784 6.98564 19.784C6.86904 19.784 6.75363 19.8073 6.64617 19.8525C6.53872 19.8978 6.44138 19.964 6.35989 20.0474C6.2784 20.1308 6.2144 20.2296 6.17164 20.3381C6.12889 20.4466 6.10824 20.5625 6.11091 20.679C6.11359 20.7956 6.13953 20.9105 6.18721 21.0169C6.2349 21.1232 6.30337 21.219 6.38859 21.2986C8.3456 23.2209 10.9812 24.2949 13.7244 24.2878H13.7812C16.5476 24.2795 19.1975 23.1732 21.1488 21.2122L22.75 19.612V22.75C22.75 22.9821 22.8422 23.2046 23.0063 23.3687C23.1704 23.5328 23.3929 23.625 23.625 23.625C23.8571 23.625 24.0796 23.5328 24.2437 23.3687C24.4078 23.2046 24.5 22.9821 24.5 22.75V17.5C24.5 17.2679 24.4078 17.0454 24.2437 16.8813C24.0796 16.7172 23.8571 16.625 23.625 16.625Z",fill:"currentColor"})),nl=()=>a.createElement("svg",{width:"28",height:"28",viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg",style:{margin:0}},a.createElement("path",{d:"M24.9374 19.1406C24.8375 19.1976 24.7273 19.2343 24.6132 19.2487C24.499 19.263 24.3831 19.2547 24.2722 19.2243C24.1613 19.1938 24.0574 19.1417 23.9666 19.0711C23.8758 19.0004 23.7999 18.9126 23.7431 18.8125L21.6649 15.1813C20.4568 15.9982 19.124 16.6136 17.7187 17.0034L18.3607 20.8556C18.3797 20.969 18.3761 21.0851 18.3502 21.1971C18.3242 21.3091 18.2765 21.4149 18.2096 21.5085C18.1428 21.602 18.0582 21.6815 17.9606 21.7423C17.8631 21.8031 17.7545 21.8441 17.641 21.863C17.5944 21.8706 17.5472 21.8746 17.4999 21.875C17.2929 21.8747 17.0928 21.801 16.935 21.667C16.7772 21.5331 16.672 21.3475 16.6381 21.1433L16.007 17.3611C14.6761 17.5463 13.326 17.5463 11.9951 17.3611L11.364 21.1433C11.33 21.3479 11.2245 21.5337 11.0663 21.6677C10.908 21.8018 10.7073 21.8752 10.4999 21.875C10.4516 21.8748 10.4033 21.8708 10.3556 21.863C10.2421 21.8441 10.1335 21.8031 10.036 21.7423C9.93842 21.6815 9.8538 21.602 9.78696 21.5085C9.72012 21.4149 9.67238 21.3091 9.64645 21.1971C9.62053 21.0851 9.61694 20.969 9.63588 20.8556L10.2812 17.0034C8.87641 16.6123 7.54441 15.9958 6.33713 15.178L4.26557 18.8125C4.14954 19.0147 3.95794 19.1625 3.73292 19.2234C3.50791 19.2843 3.26791 19.2534 3.06573 19.1374C2.86354 19.0213 2.71573 18.8297 2.65481 18.6047C2.59389 18.3797 2.62485 18.1397 2.74088 17.9375L4.92838 14.1094C4.16002 13.4456 3.45348 12.7134 2.81744 11.9219C2.73812 11.8333 2.67768 11.7295 2.63981 11.6168C2.60194 11.5041 2.58744 11.3849 2.59718 11.2664C2.60693 11.1479 2.64071 11.0327 2.69649 10.9277C2.75226 10.8227 2.82884 10.7301 2.92156 10.6557C3.01428 10.5813 3.1212 10.5266 3.23578 10.4948C3.35036 10.4631 3.4702 10.4551 3.58799 10.4712C3.70578 10.4873 3.81905 10.5273 3.92088 10.5887C4.02271 10.65 4.11096 10.7315 4.18026 10.8281C5.99588 13.0747 9.17213 15.75 13.9999 15.75C18.8278 15.75 22.004 13.0714 23.8196 10.8281C23.8881 10.7295 23.9762 10.6461 24.0783 10.583C24.1805 10.5199 24.2945 10.4785 24.4133 10.4614C24.5321 10.4442 24.6532 10.4517 24.769 10.4834C24.8848 10.5151 24.9928 10.5702 25.0864 10.6454C25.18 10.7207 25.2571 10.8143 25.3129 10.9206C25.3687 11.0269 25.402 11.1435 25.4108 11.2633C25.4196 11.383 25.4037 11.5032 25.364 11.6166C25.3244 11.7299 25.2618 11.8338 25.1803 11.9219C24.5442 12.7134 23.8377 13.4456 23.0693 14.1094L25.2568 17.9375C25.3155 18.0373 25.3539 18.1477 25.3696 18.2625C25.3853 18.3772 25.3781 18.4939 25.3484 18.6058C25.3187 18.7177 25.2671 18.8226 25.1965 18.9144C25.126 19.0062 25.0379 19.0831 24.9374 19.1406Z",fill:"currentColor"})),ns=()=>a.createElement("svg",{width:"28",height:"28",viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg",style:{margin:0}},a.createElement("path",{d:"M14 3.5C18.6944 3.5 22.5 7.30558 22.5 12C22.5 16.6944 18.6944 20.5 14 20.5C9.30558 20.5 5.5 16.6944 5.5 12C5.5 7.30558 9.30558 3.5 14 3.5ZM14 5.25C10.2721 5.25 7.25 8.27208 7.25 12C7.25 15.7279 10.2721 18.75 14 18.75C17.7279 18.75 20.75 15.7279 20.75 12C20.75 8.27208 17.7279 5.25 14 5.25ZM14 7C16.7614 7 19 9.23858 19 12C19 14.7614 16.7614 17 14 17C11.2386 17 9 14.7614 9 12C9 9.23858 11.2386 7 14 7ZM14 8.75C12.2051 8.75 10.75 10.2051 10.75 12C10.75 13.7949 12.2051 15.25 14 15.25C15.7949 15.25 17.25 13.7949 17.25 12C17.25 10.2051 15.7949 8.75 14 8.75ZM14 10.5C14.8284 10.5 15.5 11.1716 15.5 12C15.5 12.8284 14.8284 13.5 14 13.5C13.1716 13.5 12.5 12.8284 12.5 12C12.5 11.1716 13.1716 10.5 14 10.5Z",fill:"currentColor"})),nc=(0,o.Pi)(({element:e,store:t,enabled:n})=>{let r=e.animations.find(e=>"enter"===e.type),i=e.animations.find(e=>"exit"===e.type);return n?a.createElement("div",null,a.createElement("div",{style:{padding:"10px 0px"}},"Animate"),a.createElement("div",{style:{display:"flex",gap:10}},a.createElement(A.z,{fill:!0,active:(null==r?void 0:r.enabled)&&!(null==i?void 0:i.enabled),onClick:()=>{t.history.transaction(()=>{e.setAnimation("enter",{enabled:!0}),e.setAnimation("exit",{enabled:!1})})}},"Enter"),a.createElement(A.z,{fill:!0,active:(null==r?void 0:r.enabled)&&(null==i?void 0:i.enabled),onClick:()=>{t.history.transaction(()=>{e.setAnimation("enter",{enabled:!0}),e.setAnimation("exit",{enabled:!0})})}},"Both"),a.createElement(A.z,{fill:!0,active:(null==i?void 0:i.enabled)&&!(null==r?void 0:r.enabled),onClick:()=>{t.history.transaction(()=>{e.setAnimation("enter",{enabled:!1}),e.setAnimation("exit",{enabled:!0})})}},"Exit"))):null}),nu=(e,{handleClick:t,handleFocus:n,modifiers:r})=>r.matchesPredicate?a.createElement(t0.s,{active:r.active,disabled:r.disabled,key:e,onClick:t,icon:nh[e],onFocus:n,roleStructure:"listoption",text:e,shouldDismissPopover:!1}):null,nd=["right","left","up","down","bottom-right","bottom-left","top-right","top-left"],nh={right:a.createElement(t2,null),left:a.createElement(t4,null),up:a.createElement(t3,null),down:a.createElement(t8,null),"bottom-right":a.createElement(t6,null),"bottom-left":a.createElement(t5,null),"top-right":a.createElement(t9,null),"top-left":a.createElement(t7,null)}
441,nf=(0,o.Pi)(({value:e,onChange:t})=>a.createElement("div",{style:{paddingTop:"10px"}},a.createElement("div",{style:{paddingBottom:"10px"}},"Direction"),a.createElement(t1.P,{items:nd,itemRenderer:nu,filterable:!1,activeItem:e,onItemSelect:e=>{t(e)}},a.createElement(A.z,{text:e,icon:nh[e],fill:!0})))),np=(0,o.Pi)(({value:e,onChange:t})=>a.createElement("div",{style:{paddingTop:"10px"}},a.createElement("div",{style:{paddingBottom:"10px"}},"Direction"),a.createElement(t1.P,{items:["in","out"],itemRenderer:(e,{handleClick:t,handleFocus:n,modifiers:r,query:i})=>r.matchesPredicate?a.createElement(t0.s,{active:r.active,disabled:r.disabled,key:e,onClick:t,onFocus:n,roleStructure:"listoption",text:"out"===e?"Zoom Out":"Zoom In",shouldDismissPopover:!1}):null,filterable:!1,activeItem:e,onItemSelect:e=>{t(e)}},a.createElement(A.z,{text:"out"===e?"Zoom Out":"Zoom In",fill:!0})))),nm=(0,o.Pi)(({element:e,store:t})=>{let n=e.animations.find(e=>"enter"===e.type);if(!n)return null;let r=e.page.duration;return a.createElement("div",{style:{padding:"10px"}},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},a.createElement("div",null,"Delay"),a.createElement("div",null,a.createElement(nn,{value:parseFloat((n.delay/1e3).toFixed(2)),onValueChange:t=>{e.setAnimation("enter",{delay:1e3*t})},style:{width:"50px"},minorStepSize:.01,stepSize:.01,min:0,max:r/1e3,buttonPosition:"none"}))),a.createElement(tN.i,{min:0,max:r,value:n.delay,showTrackFill:!1,labelRenderer:!1,onChange:t=>{e.setAnimation("enter",{delay:t})}}))}),ng=(0,o.Pi)(({element:e,store:t})=>{let n=e.animations.find(e=>"loop"===e.type&&e.enabled);if(!n)return null;let r=500/n.duration;return a.createElement("div",{style:{padding:"10px"}},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},a.createElement("div",null,"Speed"),a.createElement("div",null,a.createElement(nn,{value:r,onValueChange:t=>{e.setAnimation("loop",{duration:500/Math.min(Math.max(.1,t),3)})},style:{width:"50px"},minorStepSize:.01,stepSize:.01,min:.1,max:3,buttonPosition:"none"}))),a.createElement(tN.i,{min:.1,max:3,stepSize:.01,value:r,showTrackFill:!1,labelRenderer:!1,onChange:t=>{e.setAnimation("loop",{duration:500/t})},onRelease:()=>{let n=t.activePage;t.play({animatedElementsIds:[e.id],currentTime:e.page.startTime}),setTimeout(()=>{t.stop(),n&&t.selectPage(n.id)},1e3)}}))}),nv=(0,o.Pi)(({element:e,store:t})=>{let n=e.animations.find(e=>"enter"===e.type);if(!n)return null;let r=e.page.duration;return a.createElement("div",{style:{padding:"10px"}},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},a.createElement("div",null,"Duration"),a.createElement("div",null,a.createElement(nn,{value:parseFloat((n.duration/1e3).toFixed(2)),onValueChange:t=>{e.setAnimation("enter",{duration:1e3*t}),e.setAnimation("exit",{duration:1e3*t})},style:{width:"50px"},minorStepSize:.01,stepSize:.01,min:0,max:r/1e3,buttonPosition:"none"}))),a.createElement(tN.i,{min:0,max:r,value:n.duration,showTrackFill:!1,labelRenderer:!1,onChange:t=>{e.setAnimation("enter",{duration:t}),e.setAnimation("exit",{duration:t})}}))}),nb=(0,o.Pi)(({element:e,store:t,animationName:n})=>{var r,i;let o=e.animations.find(e=>e.name===n&&e.enabled);if(!o)return null;let l=null!==(i=null===(r=o.data)||void 0===r?void 0:r.strength)&&void 0!==i?i:1,s=r=>{let i;t.history.transaction(()=>{e.animations.forEach(t=>{if(t.name===n){let n=t.data||{};e.setAnimation(t.type,{data:Object.assign(Object.assign({},n),{strength:r})})}})});let a=t.activePage;((...n)=>{i&&clearTimeout(i),i=setTimeout(()=>{(()=>{t.isPlaying||(t.play({animatedElementsIds:[e.id],currentTime:e.page.startTime}),setTimeout(()=>{t.stop(),a&&t.selectPage(a.id)},1e3))})(...n)},300)})()},c=Math.max(3,l);return a.createElement("div",{style:{padding:"10px"}},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},a.createElement("div",null,(0,T.t)("toolbar.strength")),a.createElement("div",null,a.createElement(nn,{value:parseFloat(l.toFixed(2)),onValueChange:e=>{s(Math.max(.1,e))},style:{width:"50px"}
441,minorStepSize:.05,stepSize:.1,min:.1,buttonPosition:"none"}))),a.createElement(tN.i,{min:.1,max:c,stepSize:.05,value:l,showTrackFill:!1,labelRenderer:!1,onChange:e=>{s(e)}}))}),ny=(0,o.Pi)(({element:e,store:t})=>{let n=e.animations.find(e=>"exit"===e.type);if(!n)return null;let r=e.page.duration;return a.createElement("div",{style:{padding:"10px"}},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},a.createElement("div",null,"End Delay"),a.createElement("div",null,a.createElement(nn,{value:parseFloat((n.delay/1e3).toFixed(2)),onValueChange:t=>{e.setAnimation("exit",{delay:1e3*t})},style:{width:"50px"},minorStepSize:.01,stepSize:.01,min:0,max:r/1e3,buttonPosition:"none"}))),a.createElement(tN.i,{min:0,max:r,value:n.delay,showTrackFill:!1,labelRenderer:!1,onChange:t=>{e.setAnimation("exit",{delay:t})}}))}),nw=(0,o.Pi)(({store:e})=>{var t,n,r,i;let o=e.selectedElements,l=o[0],s=o.map(e=>e.id).join(","),c="animation"===e.openedSidePanel,u=()=>{let t=e.previousOpenedSidePanel;e.openSidePanel(t||"photos")};if(a.useEffect(()=>{c&&(l&&l.animations||u())},[c,s]),!l||!l.animations)return null;let d=(t,n)=>{if(e.history.transaction(()=>{o.forEach(e=>{e.setAnimation("enter",Object.assign({name:t},n)),e.setAnimation("exit",Object.assign(Object.assign({name:t},n),{from:n.to,to:n.from}))})}),n.enabled){let t=e.activePage;e.play({animatedElementsIds:o.map(e=>e.id),currentTime:l.page.startTime}),setTimeout(()=>{e.stop(),t&&e.selectPage(t.id)},1e3)}},h=(t,n)=>{if(e.history.transaction(()=>{o.forEach(e=>{e.setAnimation("loop",Object.assign({name:t},n))})}),n.enabled){let t=e.activePage;e.play({animatedElementsIds:o.map(e=>e.id),currentTime:l.page.startTime}),setTimeout(()=>{e.stop(),t&&e.selectPage(t.id)},1e3)}},f=e=>{var t;return!!((e?null===(t=l.animations)||void 0===t?void 0:t.filter(t=>t.name===e||t.type===e):l.animations)||[]).find(e=>e.enabled)},p=f("move")||f("fade")||f("zoom"),m=f("rotate")||f("blink")||f("bounce");return a.createElement("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"auto",padding:"0 10px"}},a.createElement("div",{style:{display:"flex",justifyContent:"space-between",paddingBottom:"10px"}},a.createElement("h3",{style:{margin:0,lineHeight:"30px"}},(0,T.t)("sidePanel.animate")),a.createElement(A.z,{minimal:!0,icon:a.createElement(tZ.X,null),onClick:()=>u()})),a.createElement("div",{style:{paddingTop:"10px",lineHeight:"35px"}},"Animations"," ",a.createElement(A.z,{outlined:!0,style:{marginLeft:"10px",display:p?"inline-flex":"none"},onClick:()=>{l.set({animations:[]})}},"Remove All")),a.createElement("div",{style:{paddingTop:"25px"}},a.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(100px, 1fr))",gap:"5px",paddingBottom:"10px"}},a.createElement("div",null,a.createElement(A.z,{outlined:!0,large:!0,style:{padding:"20px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},icon:a.createElement(nr,null),active:f("move"),fill:!0,onClick:()=>{d("move",{enabled:!f("move")})}},(0,T.t)("toolbar.move"))),a.createElement("div",null,a.createElement(A.z,{outlined:!0,large:!0,style:{padding:"20px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},icon:a.createElement(ni,null),fill:!0,active:f("fade"),onClick:()=>{d("fade",{enabled:!f("fade")})}},(0,T.t)("toolbar.fade"))),a.createElement("div",null,a.createElement(A.z,{outlined:!0,large:!0,style:{padding:"20px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},icon:a.createElement(na,null),fill:!0,active:f("zoom"),onClick:()=>{d("zoom",{enabled:!f("zoom")})}},(0,T.t)("toolbar.zoom")))),a.createElement(nt,{style:{display:p?"block":"none"}},a.createElement(nc,{element:l,store:e,enabled:f("enter")||f("exit")}),f("move")&&a.createElement(nf,{value:(null===(n=null===(t=l.animations.find(e=>"move"===e.name))||void 0===t?void 0:t.data)||void 0===n?void 0:n.direction)||"right",onChange:e=>{d("move",{data:{direction:e},enabled:!0})}}),f("move")&&a.createElement(nb,{store:e,element:l,animationName:"move"}),f("zoom")&&a.createElement(np,{value:(null===(i=null===(r=l.animations.find(e=>"zoom"===e.name))||void 0===r?void 0:r.data)||void 0===i?void 0:i.direction)||"in",onChange:e=>{d("zoom",{data:{direction:e},enabled:!0})}}),f("zoom")&&a.createElement(nb,{store:e,element:l,animationName:"zoom"}),f("enter")&&a.createElement(nm,{store:e,element:l}),f("enter")&&a.createElement(nv,{store:e,element:l}),f("exit")&&a.createElement(ny,{store:e,element:l})),a.createElement("div",{style:{paddingTop:"10px",lineHeight:"35px"}},"Effects"," ",a.createElement(A.z,{outlined:!0,style:{marginLeft:"10px",display:m?"inline-flex":"none"},onClick:()=>{l.set({animations:[]})}},"Remove All")),a.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(100px, 1fr))",gap:"5px",paddingTop:"10px"}},a.createElement("div",null,a.createElement(A.z,{minimal:!0,outlined:!0,large:!0,fill:!0,style:{padding:"20px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},icon:a.createElement(no,null),active:f("rotate"),onClick:()=>{h("rotate",{enabled:!f("rotate")})}},(0,T.t)("toolbar.rotate"))),a.createElement("div",null,a.createElement(A.z,{outlined:!0,large:!0,style:{padding:"20px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},fill:!0,icon:a.createElement(nl,null),active:f("blink"),onClick:()=>{h("blink",{enabled:!f("blink")})}},(0,T.t)("toolbar.blink"))),a.createElement("div",null,a.createElement(A.z,{minimal:!0,outlined:!0,large:!0,style:{padding:"20px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},icon:a.createElement(ns,null),fill:!0,active:f("bounce"),onClick:()=>{h("bounce",{enabled:!f("bounce")})}},(0,T.t)("toolbar.bounce")))),m&&a.createElement(ng,{store:e,element:l}),f("bounce")&&a.createElement(nb,{store:e,element:l,animationName:"bounce"})))});var nx=n(1979),nC=n(42614);let nE=(0,x.Z)("div")` 442 display: flex; 443 flex-direction: column; 444 flex-grow: 0; 445 width: calc(33% - 16px); 446 gap: 8px; 447 cursor: pointer; 448`,nk=(0,x.Z)("span")` 449 text-align: center; 450`,nS=(0,x.Z)("div")` 451 position: relative; 452 border-radius: 10px; 453 box-sizing: border-box; 454 height: 90px; 455`,nT=(0,x.Z)("img")` 456 height: 100%; 457 width: 100%; 458 object-fit: cover; 459 border-radius: 10px; 460`,nP=(0,x.Z)("div")` 461 left: -4px; 462 top: -4px; 463 bottom: -4px; 464 right: -4px; 465 display: flex; 466 position: absolute; 467 border-radius: 15px; 468 padding: 2px; 469 transition: 0.2s border; 470 border: 2px solid transparent; 471 &[data-active='true'] { 472 border-color: white; 473 } 474`,nM=({title:e,imageSrc:t,effect:n,onClick:r,active:i})=>{let o=nO(n);return a.createElement(nE,{onClick:r},a.createElement(nS,null,a.createElement(nP,{"data-active":i}),a.createElement(o,{src:t})),a.createElement(nk,null,e))},nR=(0,x.Z)(nT)` 475 filter: sepia(1); 476`,nA=(0,x.Z)(nT)` 477 filter: grayscale(1); 478`,nL=(0,x.Z)(nT)` 479 filter: ${null===(r=(0,nC.E)(nC.z.warm))||void 0===r?void 0:r.filter}; 480`,n_=e=>{let{html:t,filter:n}=(0,nC.E)(nC.z.cold);return a.createElement(a.Fragment,null,a.createElement("div",{style:{display:"none"},dangerouslySetInnerHTML:{__html:t||""}}),a.createElement(nT,Object.assign({style:{filter:n}},e)))},nI=(0,x.Z)(nT)` 481 filter: ${null===(i=(0,nC.E)(nC.z.natural))||void 0===i?void 0:i.filter}; 482`,nO=e=>{switch(e){case nC.z.sepia:return nR;case nC.z.grayscale:return nA;case nC.z.warm:return nL;case nC.z.cold:return n_;
482case nC.z.natural:return nI;default:return nT}};var nD=n(64681),nz=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let nN=(e,t,n)=>Math.max(t,Math.min(n,e)),nF=e=>{var{value:t,onValueChange:n}=e,r=nz(e,["value","onValueChange"]);let[i,o]=a.useState(t.toString());return a.useEffect(()=>{o(t.toString())},[t]),a.createElement(X.A,Object.assign({value:i,onValueChange:(e,t)=>{o(t),Number.isNaN(e)||n(e)}},r))},nB=({label:e,enabled:t,visible:n=!0,onEnabledChange:r,numberValue:i,onNumberValueChange:o,min:l,max:s})=>n?a.createElement(a.Fragment,null,a.createElement(Y.rs,{checked:t,label:e,onChange:e=>{r(e.target.checked)},alignIndicator:K.v.RIGHT,style:{marginTop:"20px"}}),t&&a.createElement("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"}},a.createElement("div",{style:{paddingTop:"7px",paddingLeft:"10px",width:"calc(100% - 80px)"}},a.createElement(tN.i,{value:i,onChange:e=>{o(e)},min:l,max:s,labelStepSize:50,showTrackFill:!1,labelRenderer:!1})),a.createElement(X.A,{value:i,onValueChange:e=>{o(nN(e,l,s))},buttonPosition:"none",style:{width:"50px",padding:"0 5px",marginLeft:"10px"},min:l,max:s}))):null,nH=(0,o.Pi)(({store:e})=>{var t,n,r,i,o,l,s,c,u,d,h,f,p,m;let g=e.selectedElements,v=g[0],b=g.map(e=>e.id).join(","),y="effects"===e.openedSidePanel,w=()=>{let t=e.previousOpenedSidePanel;e.openSidePanel(t||"photos")};if(a.useEffect(()=>{y&&(v&&v.filters||w())},[y,b]),!v||!v.filters)return null;let x="text"===v.type,C=(v.type,"image"===v.type),E="svg"===v.type,k=C||E,S=t=>{e.history.transaction(()=>{g.forEach(e=>{e.set(t)})})},P=(t,n)=>{e.history.transaction(()=>{g.forEach(e=>{let r=Number(n);return 0==n||n||(r=e.filters.has(t)?null:1),nx.lo.includes(t)||e.set({grayscaleEnabled:"grayscale"===t&&!!n,sepiaEnabled:"sepia"===t&&!!n}),e.setFilter(t,r)})})};return a.createElement("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"auto",padding:"0 10px"}},a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},a.createElement("h3",{style:{margin:0,lineHeight:"30px"}},(0,T.t)("sidePanel.effects")),a.createElement(A.z,{minimal:!0,icon:a.createElement(tZ.X,null),onClick:()=>w()})),k&&a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px",marginTop:"16px"}},a.createElement("div",{style:{display:"flex",gap:"16px",flexWrap:"wrap"}},a.createElement(nM,{active:v.grayscaleEnabled,onClick:()=>{P("grayscale",!v.grayscaleEnabled)},title:(0,T.t)("toolbar.grayscale"),imageSrc:v.src,effect:nC.z.grayscale}),a.createElement(nM,{active:v.sepiaEnabled,onClick:()=>{P("sepia",!v.sepiaEnabled)},title:(0,T.t)("toolbar.sepia"),imageSrc:v.src,effect:nC.z.sepia}),a.createElement(nM,{active:v.filters.has("cold"),onClick:()=>{P("cold",v.filters.has("cold")?null:1)},title:(0,T.t)("toolbar.cold"),imageSrc:v.src,effect:nC.z.cold}),a.createElement(nM,{active:v.filters.has("natural"),onClick:()=>{P("natural",v.filters.has("natural")?null:1)},title:(0,T.t)("toolbar.natural"),imageSrc:v.src,effect:nC.z.natural}),a.createElement(nM,{active:v.filters.has("warm"),onClick:()=>{P("warm",v.filters.has("warm")?null:1)},title:(0,T.t)("toolbar.warm"),imageSrc:v.src,effect:nC.z.warm}))),a.createElement(nB,{label:(0,T.t)("toolbar.blur"),enabled:v.blurEnabled,visible:k||x,onEnabledChange:e=>{S({blurEnabled:e})},numberValue:v.blurRadius,onNumberValueChange:e=>{S({blurRadius:e})},min:0,max:100}),a.createElement(nB,{label:(0,T.t)("toolbar.brightness"),visible:k,enabled:v.brightnessEnabled,onEnabledChange:e=>{S({brightnessEnabled:e})},numberValue:Math.round(100*v.brightness),onNumberValueChange:e=>{S({brightness:e/100})},min:-100,max:100}),a.createElement(nB,{label:(0,T.t)("toolbar.temperature"),visible:k,enabled:v.filters.has("temperature"),onEnabledChange:e=>{P("temperature",e?0:null)},numberValue:Math.round(100*(null!==(n=null===(t=v.filters.get("temperature"))||void 0===t?void 0:t.intensity)&&void 0!==n?n:0)),onNumberValueChange:e=>{P("temperature",e/100)},min:-100,max:100}),a.createElement(nB,{label:(0,T.t)("toolbar.contrast"),visible:k,enabled:v.filters.has("contrast"),onEnabledChange:e=>{P("contrast",e?0:null)},numberValue:Math.round(100*(null!==(i=null===(r=v.filters.get("contrast"))||void 0===r?void 0:r.intensity)&&void 0!==i?i:0)),onNumberValueChange:e=>{P("contrast",e/100)},min:-100,max:100}),a.createElement(nB,{label:(0,T.t)("toolbar.shadows"),visible:k,enabled:v.filters.has("shadows"),onEnabledChange:e=>{P("shadows",e?0:null)},numberValue:Math.round(100*(null!==(l=null===(o=v.filters.get("shadows"))||void 0===o?void 0:o.intensity)&&void 0!==l?l:0)),onNumberValueChange:e=>{P("shadows",e/100)},min:-100,max:100}),a.createElement(nB,{label:(0,T.t)("toolbar.white"),visible:k,enabled:v.filters.has("white"),onEnabledChange:e=>{P("white",e?0:null)},numberValue:Math.round(100*(null!==(c=null===(s=v.filters.get("white"))||void 0===s?void 0:s.intensity)&&void 0!==c?c:0)),onNumberValueChange:e=>{P("white",e/100)},min:-100,max:100}),a.createElement(nB,{label:(0,T.t)("toolbar.black"),visible:k,enabled:v.filters.has("black"),onEnabledChange:e=>{P("black",e?0:null)},numberValue:Math.round(100*(null!==(d=null===(u=v.filters.get("black"))||void 0===u?void 0:u.intensity)&&void 0!==d?d:0)),onNumberValueChange:e=>{P("black",e/100)},min:-100,max:100}),a.createElement(nB,{label:(0,T.t)("toolbar.vibrance"),visible:k,enabled:v.filters.has("vibrance"),onEnabledChange:e=>{P("vibrance",e?0:null)},numberValue:Math.round(100*(null!==(f=null===(h=v.filters.get("vibrance"))||void 0===h?void 0:h.intensity)&&void 0!==f?f:0)),onNumberValueChange:e=>{P("vibrance",e/100)},min:-100,max:100}),a.createElement(nB,{label:(0,T.t)("toolbar.saturation"),visible:k,enabled:v.filters.has("saturation"),onEnabledChange:e=>{P("saturation",e?0:null)},numberValue:Math.round(100*(null!==(m=null===(p=v.filters.get("saturation"))||void 0===p?void 0:p.intensity)&&void 0!==m?m:0)),onNumberValueChange:e=>{P("saturation",e/100)},min:-100,max:100}
482),x&&a.createElement(Y.rs,{checked:!!v.curveEnabled,label:(0,T.t)("toolbar.curvedText")||"Curved text",onChange:e=>{S({curveEnabled:e.target.checked})},alignIndicator:K.v.RIGHT,style:{marginTop:"20px"}}),x&&v.curveEnabled&&a.createElement(a.Fragment,null,a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},a.createElement("div",null,(0,T.t)("toolbar.curvePower")||"Curve"),a.createElement("div",null,a.createElement(nF,{value:Math.round(100*v.curvePower),onValueChange:e=>{S({curvePower:nN(e,-100,100)/100})},style:{width:"50px"},min:-100,max:100,buttonPosition:"none"}))),a.createElement("div",null,a.createElement(nD.Mo,{textEl:v,eachSet:S}))),x&&a.createElement(Y.rs,{checked:!!v.strokeWidth,label:(0,T.t)("toolbar.textStroke"),onChange:e=>{S({strokeWidth:e.target.checked?2:0})},alignIndicator:K.v.RIGHT,style:{marginTop:"20px"}}),x&&!!v.strokeWidth&&a.createElement(a.Fragment,null,a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},a.createElement(eN.ZP,{value:v.stroke,size:30,gradientEnabled:!0,onChange:e=>{S({stroke:e})},store:e}),a.createElement(X.A,{defaultValue:v.strokeWidth,onValueChange:e=>{S({strokeWidth:nN(e,1,30)})},style:{width:"80px"},min:1,max:Math.round(v.fontSize/2)}))),x&&a.createElement(Y.rs,{checked:!!v.backgroundEnabled,label:(0,T.t)("toolbar.textBackground"),onChange:e=>{S({backgroundEnabled:e.target.checked})},alignIndicator:K.v.RIGHT,style:{marginTop:"20px"}}),x&&!!v.backgroundEnabled&&a.createElement(a.Fragment,null,a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},a.createElement("div",null,(0,T.t)("toolbar.backgroundCornerRadius")),a.createElement("div",null,a.createElement(nF,{value:100*v.backgroundCornerRadius,onValueChange:e=>{S({backgroundCornerRadius:nN(e,0,100)/100})},style:{width:"50px"},min:0,max:100,buttonPosition:"none"}))),a.createElement("div",null,a.createElement(tN.i,{value:100*v.backgroundCornerRadius,onChange:e=>{S({backgroundCornerRadius:nN(e,0,100)/100})},min:0,max:100,labelRenderer:!1})),a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},a.createElement("div",null,(0,T.t)("toolbar.backgroundPadding")),a.createElement("div",null,a.createElement(nF,{value:Math.round(100*v.backgroundPadding),onValueChange:e=>{S({backgroundPadding:nN(e,0,100)/100})},style:{width:"50px"},min:0,max:100,buttonPosition:"none"}))),a.createElement("div",null,a.createElement(tN.i,{value:Math.round(100*v.backgroundPadding),onChange:e=>{S({backgroundPadding:nN(e,0,100)/100})},min:0,max:100,labelRenderer:!1})),a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},a.createElement("div",null,(0,T.t)("toolbar.opacity")),a.createElement("div",null,a.createElement(nF,{value:Math.round(100*v.backgroundOpacity),onValueChange:e=>{S({backgroundOpacity:e/100})},style:{width:"50px"},min:0,max:100,buttonPosition:"none"}))),a.createElement("div",null,a.createElement(tN.i,{value:100*v.backgroundOpacity,onChange:e=>{S({backgroundOpacity:e/100})},min:0,max:100,labelRenderer:!1})),a.createElement("div",{style:{display:"flex",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},a.createElement("div",{style:{lineHeight:"30px"}},(0,T.t)("toolbar.color")),a.createElement(eN.ZP,{value:v.backgroundColor,size:30,onChange:e=>{S({backgroundColor:e})},store:e}))),k&&a.createElement(Y.rs,{checked:!!v.borderSize,label:(0,T.t)("toolbar.border"),onChange:e=>{S({borderSize:e.target.checked?2:0})},alignIndicator:K.v.RIGHT,style:{marginTop:"20px"}}),k&&!!v.borderSize&&a.createElement(a.Fragment,null,a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},a.createElement(eN.ZP,{value:v.borderColor,size:30,gradientEnabled:!0,onChange:e=>{S({borderColor:e})},store:e}),a.createElement(X.A,{defaultValue:v.borderSize,onValueChange:e=>{S({borderSize:nN(e,1,Math.min(v.width,v.height)/2)})},style:{width:"80px"},min:1,max:Math.max(1,Math.min(v.width,v.height)/2)}))),k&&a.createElement(nB,{label:(0,T.t)("toolbar.cornerRadius"),visible:k,enabled:0!==v.cornerRadius,onEnabledChange:e=>{S({cornerRadius:e?Math.min(v.width/4,v.height/4):0})},numberValue:Math.min(v.cornerRadius,Math.round(Math.min(v.width/2,v.height/2))),onNumberValueChange:e=>{S({cornerRadius:e})},min:1,max:Math.round(Math.min(v.width/2,v.height/2))}
482),a.createElement(Y.rs,{checked:v.shadowEnabled,label:(0,T.t)("toolbar.shadow"),onChange:e=>{S({shadowEnabled:e.target.checked})},alignIndicator:K.v.RIGHT,style:{marginTop:"20px"}}),v.shadowEnabled&&a.createElement(a.Fragment,null,a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},a.createElement("div",null,(0,T.t)("toolbar.blur")),a.createElement("div",null,a.createElement(nF,{value:v.shadowBlur,onValueChange:e=>{S({shadowBlur:nN(e,-50,50)})},style:{width:"50px"},min:0,max:50,buttonPosition:"none"}))),a.createElement("div",null,a.createElement(tN.i,{value:v.shadowBlur,onChange:e=>{S({shadowBlur:e})},min:0,max:50,showTrackFill:!1,labelRenderer:!1})),a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},a.createElement("div",null,(0,T.t)("toolbar.offsetX")),a.createElement("div",null,a.createElement(nF,{value:v.shadowOffsetX,onValueChange:e=>{S({shadowOffsetX:nN(e,-50,50)})},style:{width:"50px"},min:-50,max:50,buttonPosition:"none"}))),a.createElement("div",null,a.createElement(tN.i,{value:v.shadowOffsetX,onChange:e=>{S({shadowOffsetX:e})},min:-50,max:50,showTrackFill:!1,labelRenderer:!1})),a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},a.createElement("div",null,(0,T.t)("toolbar.offsetY")),a.createElement("div",null,a.createElement(nF,{value:v.shadowOffsetY,onValueChange:e=>{S({shadowOffsetY:nN(e,-50,50)})},style:{width:"50px"},min:-50,max:50,buttonPosition:"none"}))),a.createElement("div",null,a.createElement(tN.i,{value:v.shadowOffsetY,onChange:e=>{S({shadowOffsetY:e})},min:-50,max:50,showTrackFill:!1,labelRenderer:!1})),a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},a.createElement("div",null,(0,T.t)("toolbar.opacity")),a.createElement("div",null,a.createElement(nF,{value:Math.round(100*v.shadowOpacity),onValueChange:e=>{S({shadowOpacity:e/100})},style:{width:"50px"},min:0,max:100,buttonPosition:"none"}))),a.createElement("div",null,a.createElement(tN.i,{value:100*v.shadowOpacity,onChange:e=>{S({shadowOpacity:e/100})},min:0,max:100,labelRenderer:!1})),a.createElement("div",{style:{display:"flex",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},a.createElement("div",{style:{lineHeight:"30px"}},(0,T.t)("toolbar.color")),a.createElement(eN.ZP,{value:v.shadowColor,size:30,onChange:e=>{S({shadowColor:e})},store:e}))))}),nV={name:"templates",Tab:(0,o.Pi)(e=>a.createElement(M,Object.assign({name:(0,T.t)("sidePanel.templates")},e),a.createElement(l.I,{icon:a.createElement(d,null)}))),Panel:({store:e})=>a.createElement(to,{store:e})},nj={name:"text",Tab:(0,o.Pi)(e=>a.createElement(M,Object.assign({name:(0,T.t)("sidePanel.text")},e),a.createElement(l.I,{icon:a.createElement(h,null)}))),Panel:({store:e})=>a.createElement(Z,{store:e})},n$={name:"photos",Tab:(0,o.Pi)(e=>a.createElement(M,Object.assign({name:(0,T.t)("sidePanel.photos")},e),a.createElement(l.I,{icon:a.createElement(f.p,null)}))),Panel:({store:e})=>a.createElement(eO,{store:e})},nU={name:"elements",Tab:(0,o.Pi)(e=>a.createElement(M,Object.assign({name:(0,T.t)("sidePanel.elements"),iconSize:16},e),a.createElement("span",{className:"bp5-icon"},a.createElement(k,null)))),Panel:({store:e})=>a.createElement(te,{store:e})},nW={name:"upload",Tab:(0,o.Pi)(e=>a.createElement(M,Object.assign({name:(0,T.t)("sidePanel.upload")},e),a.createElement(l.I,{icon:a.createElement(p,null)}))),Panel:({store:e})=>a.createElement(eL,{store:e})},nG={name:"background",Tab:(0,o.Pi)(e=>a.createElement(M,Object.assign({name:(0,T.t)("sidePanel.background")},e),a.createElement(l.I,{icon:a.createElement(m,null)}))),Panel:({store:e})=>a.createElement(e$,{store:e})};(0,o.Pi)(e=>a.createElement(M,Object.assign({name:(0,T.t)("sidePanel.pages")},e),a.createElement(S,null))),({store:e})=>a.createElement(tt,{store:e});let nq={name:"layers",Tab:(0,o.Pi)(e=>a.createElement(M,Object.assign({name:(0,T.t)("sidePanel.layers")},e),a.createElement(l.I,{icon:a.createElement(g.S,null)}))),Panel:({store:e})=>a.createElement(tx,{store:e})},nZ={name:"size",Tab:(0,o.Pi)(e=>a.createElement(M,Object.assign({name:(0,T.t)("sidePanel.resize")},e),a.createElement(l.I,{icon:a.createElement(v,null)}))),Panel:({store:e})=>a.createElement(ex,{store:e})},nX={name:"draw",Tab:(0,o.Pi)(e=>a.createElement(M,Object.assign({name:(0,T.t)("sidePanel.draw")},e),a.createElement(l.I,{icon:a.createElement(b,null)}))),Panel:({store:e})=>a.createElement(tq,{store:e})},nY={name:"videos",Tab:e=>a.createElement(M,Object.assign({name:(0,T.t)("sidePanel.videos")},e),a.createElement(y.n,null)),Panel:tD};(0,o.Pi)(e=>a.createElement(M,Object.assign({name:(0,T.t)("sidePanel.more")},e),a.createElement(l.I,{icon:a.createElement(w.T,null)})));let nK=[nV,nj,n$,nU,nX,nW,nG,nq,nZ],nJ={name:"animation",Tab:()=>null,Panel:nw},nQ=[{name:"image-clip",Tab:()=>null,Panel:tQ},{name:"effects",Tab:()=>null,Panel:nH}],n0=(0,x.Z)("div")` 483 display: flex; 484 height: 100% !important; 485 padding: 0px !important; 486 position: relative; 487 488 &.bp5-navbar { 489 box-shadow: none; 490 } 491 492 ${(0,C.wz)("\n height: auto !important;\n width: 100%;\n position: relative;\n ")} 493`,n1=(0,x.Z)("div",a.forwardRef)` 494 @media screen and (min-width: 501px) { 495 overflow-y: auto; 496 overflow-x: hidden; 497 min-width: 72px; 498 } 499 ${(0,C.wz)("\n width: 100%;\n overflow: auto;\n ")} 500`,n2=(0,x.Z)("div",a.forwardRef)` 501 display: flex; 502 flex-direction: column; 503 504 ${(0,C.wz)("\n flex-direction: row;\n min-width: min-content;\n ")} 505`,n4=(0,x.Z)("div")` 506 padding: 10px 10px 0px 10px !important; 507 height: 100% !important; 508 509 &.bp5-navbar { 510 width: 350px; 511 } 512 513 &.bp5-navbar.collapsed { 514 width: 0px; 515 } 516 517 &.hidden { 518 display: none; 519 } 520 521 ${(0,C.wz)("\n &.bp5-navbar {\n position: absolute;\n bottom: 54px;\n z-index: 100;\n height: 50vh !important;\n width: 100%;\n }\n ")} 522`,n3=(0,x.Z)("div")` 523 display: none; 524 525 ${(0,C.wz)("\n position: absolute;\n bottom: 72px;\n display: block;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.05);\n ")} 526`,n8=(0,x.Z)("div")` 527 position: absolute; 528 right: -14px; 529 top: 50%; 530 height: 96px; 531 width: 15px; 532 fill: white; 533 cursor: pointer; 534 z-index: 10; 535 536 .bp5-dark & { 537 right: -13px; 538 } 539 540 & .stroke { 541 stroke: rgba(0, 0, 0, 0.3); 542 fill: none; 543 } 544 545 & .fill { 546 fill: white; 547 } 548 549 .bp5-dark & .fill { 550 fill: #2f343c; 551 } 552 553 & .pointer { 554 position: absolute; 555 top: 50%; 556 left: 50%; 557 transform: translate(-50%, -50%) scaleY(2); 558 font-size: 0.5rem; 559 color: rgba(171, 179, 191, 0.6); 560 } 561 562 .bp5-dark & .pointer { 563 color: rgba(171, 179, 191, 0.6); 564 } 565 566 &:hover .pointer { 567 color: black; 568 } 569 570 .bp5-dark &:hover .pointer { 571 color: white; 572 } 573 574 ${(0,C.wz)("\n display: none;\n ")} 575`,n6=({onClick:e})=>a.createElement(n8,{onClick:e},a.createElement("svg",{width:"15",height:"96",viewBox:"0 0 16 96",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{className:"fill stroke",d:"M 1 7 C 2 9 4 10 7.2 13.28 C 7.45 13.4625 7.6 13.6 7.7 13.8048 L 7.8 13.8 C 9.8 15.8 11.6 17.6 12.9 19.7 C 14 21.6 14.7 23.9 14.9 27 H 15 V 68 C 15 71.7 14.3 74.3 13 76.6 C 11.7 78.8 9.9 80.5 7.8 82.6344 L 7.79 82.6 C 7.6 82.8 7.4507 83 7.2729 83.2127 C 3.9102 86.5228 2 87 1 90"})),a.createElement("div",{className:"pointer"},"<")),n5=(0,o.Pi)(({store:e,sections:t,defaultSection:n="photos"})=>{(()=>{let t=a.useRef(!0);t.current&&(t.current=!1,e.openSidePanel(n))})();let r=(0,C.XA)();a.useLayoutEffect(()=>{r?e.openSidePanel(""):e.openSidePanel(n)},[r]);let i=[...t||nK];
575if(nQ.forEach(e=>{i.find(t=>t.name===e.name)||i.push(e)}),E.flags.animationsEnabled){if(!i.find(e=>"videos"===e.name)){let e=Math.floor(i.length/2);i.splice(e,0,nY)}if(!i.find(e=>"animations"===e.name)){let e=Math.floor(i.length/2);i.splice(e,0,nJ)}}let o=i.filter(e=>{var t;return null===(t=e.visibleInList)||void 0===t||t}),l=t=>{let n=t.target.closest(".polotno-close-panel"),i=t.target.closest(".polotno-mobile");n&&(r||i)&&e.openSidePanel("")},s=a.useRef(null),c=a.useRef(new Set);return e.openedSidePanel&&c.current.add(e.openedSidePanel),a.createElement(n0,{className:"bp5-navbar polotno-side-panel"+(e.openedSidePanel?"":" collapsed")},a.createElement(n1,{ref:s,className:"polotno-side-tabs-container"},a.createElement(n2,{className:"polotno-side-tabs-inner"},o.map(({name:t,Tab:n})=>a.createElement(n,{key:t,active:t===e.openedSidePanel,onClick:()=>{t===e.openedSidePanel&&r?e.openSidePanel(""):e.openSidePanel(t)}})))),i.map(({name:t,Panel:n})=>c.current.has(t)&&a.createElement(n4,{key:t,className:"bp5-navbar polotno-panel-container"+(t===e.openedSidePanel?"":" hidden"),onClick:l},a.createElement(n,{store:e}))),e.openedSidePanel&&a.createElement(n3,{onClick:()=>e.openSidePanel("")}),e.openedSidePanel&&a.createElement(n6,{onClick:()=>e.openSidePanel("")}))})},95515:function(e,t,n){"use strict";n.d(t,{zH:function(){return O},ZP:function(){return D}});var r=n(7653),i=n(20952),a=n(74038),o=n(38872),l=n(45470),s=n(86652),c=n(2027),u=n(54043),d=n(98746),h=n(79491),f=n(38726),p=n(31137),m=n(8585),g=n(41233),v=n(14852),b=n(83103);let y=e=>{let t=r.useRef(e);return t.current=e,r.useCallback((...e)=>t.current(...e),[])};var w=(0,g.ColorWrap)(({width:e=200,rgb:t,hex:n,hsv:i,hsl:a,onChange:o,onSwatchHover:l,disableAlpha:s=!1,presetColors:c=["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],renderers:u,styles:w={},className:x=""})=>{let C=(0,d.ReactCSS)(h({default:Object.assign({picker:{width:e,padding:"10px 10px 0",boxSizing:"initial",background:"#fff",borderRadius:"4px",boxShadow:"0 0 0 1px rgba(0,0,0,.15), 0 8px 16px rgba(0,0,0,.15)"},saturation:{width:"100%",paddingBottom:"75%",position:"relative",overflow:"hidden"},Saturation:{radius:"3px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},controls:{display:"flex"},sliders:{padding:"4px 0",flex:"1"},color:{width:"24px",height:"24px",position:"relative",marginTop:"4px",marginLeft:"4px",borderRadius:"3px"},activeColor:{absolute:"0px 0px 0px 0px",borderRadius:"2px",background:`rgba(${t.r},${t.g},${t.b},${t.a})`,boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},hue:{position:"relative",height:"10px",overflow:"hidden"},Hue:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},alpha:{position:"relative",height:"10px",marginTop:"4px",overflow:"hidden"},Alpha:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"}},w),disableAlpha:{color:{height:"10px"},hue:{height:"10px"},alpha:{display:"none"}}},w),{disableAlpha:s}),[E,k]=r.useState(!1),S=r.useRef(null),T=y(e=>{var t;if(E){let n=null===(t=S.current)||void 0===t?void 0:t.fill();n&&o(m.Z.Util.colorToRGBA(n)),M(),function(e){let t=e.target;for(;t;){if(t.classList.contains("color-picker-button"))return!0;t=t.parentElement}return!1}(e)||k(!1),e.stopPropagation(),e.stopImmediatePropagation()}}),P=y(e=>{if(!E)return;let t=m.Z.stages.find(t=>{var n;let r=null===(n=t.getContent().parentElement)||void 0===n?void 0:n.parentElement;if(!r)return!1;let i=r.getBoundingClientRect();return i.left<e.clientX&&i.left+i.width>e.clientX&&i.top<e.clientY&&i.top+i.height>e.clientY});if(!t)return void M();let n=t.getContent().getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top,a=t.children[0],o=a.getNativeCanvasElement(),l=a.getCanvas().getPixelRatio(),{data:s}=o.getContext("2d").getImageData(r*l,i*l,1,1),c=t.findOne(".line-guides");c.findOne(".picker")||(S.current&&S.current.destroy(),S.current=new m.Z.Circle({name:"picker",radius:14,stroke:"black",strokeWidth:1}),c.add(S.current)),S.current.setAbsolutePosition({x:r-15,y:i-15}),S.current.fill("rgb("+s[0]+","+s[1]+","+s[2]+")")});r.useEffect(()=>(window.addEventListener("mousemove",P),window.addEventListener("mousedown",T,!0),window.addEventListener("touchstart",T,!0),()=>{window.removeEventListener("mousemove",P),window.removeEventListener("mousedown",T,!0),window.removeEventListener("touchstart",T,!0),M()}),[]),r.useEffect(()=>{E||M()},[E]),r.useEffect(()=>(E&&(document.body.style.cursor="crosshair"),()=>{document.body.style.cursor="default"}),[E]);let M=y(()=>{S.current&&(S.current.destroy(),S.current=null)});return r.createElement("div",{style:C.picker,className:`sketch-picker ${x}`},r.createElement("div",{style:C.saturation},r.createElement(g.Saturation,{style:C.Saturation,hsl:a,hsv:i,onChange:o})),r.createElement("div",{style:C.controls,className:"flexbox-fix"},r.createElement("div",{style:C.sliders},r.createElement("div",{style:C.hue},r.createElement(g.Hue,{style:C.Hue,hsl:a,onChange:o})),r.createElement("div",{style:C.alpha},r.createElement(g.Alpha,{style:C.Alpha,rgb:t,hsl:a,renderers:u,onChange:o}))),r.createElement("div",{style:C.color},r.createElement(g.Checkboard,{size:8,white:"transparent",grey:"rgba(0,0,0,.08)"}),r.createElement("div",{style:C.activeColor})),r.createElement("div",{style:C.color},r.createElement(f.z,{icon:r.createElement(p,null),className:"color-picker-button",minimal:!0,style:{width:"24px",height:"24px",minWidth:"24px",minHeight:"24px",padding:0,margin:0},active:E,onClickCapture:e=>{k(e=>!e),e.stopPropagation()}}))),r.createElement(v.mG,{rgb:t,hsl:a,hex:n,onChange:o,disableAlpha:s}),r.createElement(b.Yd,{colors:c,onClick:o,onSwatchHover:l}))}),x=n(43808),C=n(26436),E=n(72365),k=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let S=["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"].reverse(),T=e=>{let t=[];
575e.pages.forEach(e=>{e.children.forEach(e=>{e.shadowEnabled&&t.push(e.shadowColor),"text"===e.type&&(t.push(e.fill),e.backgroundEnabled&&t.push(e.backgroundColor),e.strokeWidth&&t.push(e.stroke)),"svg"===e.type&&t.push(...e.colorsReplace.values()),"figure"===e.type&&(t.push(e.fill),e.strokeWidth&&t.push(e.stroke)),"line"===e.type&&t.push(e.color)})});let n=[];return t.forEach(e=>{if((0,C.H)(e)){let{stops:t}=(0,C.l)(e);n.push(...t.map(e=>e.color))}else n.push(e)}),[...new Set(n)]},P=(0,x.Z)("div")` 576 & .sketch-picker { 577 padding: 0px !important; 578 box-shadow: none !important; 579 background: none !important; 580 } 581 582 & .flexbox-fix { 583 border-top: none !important; 584 } 585 586 .bp5-dark & .sketch-picker { 587 background-color: #394b59; 588 } 589 590 .bp5-dark & .sketch-picker label { 591 color: #f5f8fa !important; 592 } 593`,M=e=>{var{style:t,color:n,onChange:i}=e,a=k(e,["style","color","onChange"]);let[o,l]=r.useState(n);r.useEffect(()=>{l(n)},[n]);let s=r.useRef(),c=r.useRef();return r.createElement(P,{style:t,onMouseDown:e=>{"INPUT"!==e.target.tagName&&e.preventDefault()}},r.createElement(w,Object.assign({color:o},a,{onChange:e=>{let{r:t,g:n,b:r,a:a}=e.rgb,o=`rgba(${t},${n},${r},${a})`;l(o),c.current=o,s.current||(s.current=window.setTimeout(()=>{s.current=0,i(o)},50))}})))},R=e=>e.map(e=>`${e.color} ${100*e.offset}%`).join(","),A=({value:e,onChange:t,store:n,preset:a})=>{let{rotation:o,stops:l}=(0,C.l)(e),c=r.useRef(l);c.current=l;let d=r.useRef(o);d.current=o;let[h,f]=r.useState(0),[p,m]=r.useState(-1),g=r.useRef(null),v=r.useRef(!1),b=e=>{v.current=!0};return r.useEffect(()=>{p>-1&&(c.current.splice(p,1),t(`linear-gradient(${d.current}deg, ${R(c.current)})`),m(-1))},[p]),r.useEffect(()=>{var e;null===(e=g.current)||void 0===e||e.focus()},[]),r.useEffect(()=>{let e=e=>{if(v.current){let n=g.current.getBoundingClientRect(),r=e.clientX-n.left,i=r/n.width;if(l.length>2&&(i<-.5||i>1.5))return f(0),v.current=!1,void m(h);let a=Math.min(1,Math.max(0,r/n.width)),o=[...c.current];o[h].offset=a,t(`linear-gradient(${d.current}deg, ${R(o)})`)}},n=()=>{v.current=!1};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",n),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",n)}},[h,c]),r.createElement("div",null,r.createElement("div",{style:{width:"calc(100% - 35px)",height:"60px",position:"relative"}},r.createElement("div",{ref:g,tabIndex:0,style:{position:"absolute",top:0,left:0,width:"100%",marginLeft:"15px",height:"100%",zIndex:0,outline:"none"},onKeyDownCapture:e=>{"Backspace"!==e.key||(e.preventDefault(),e.stopPropagation(),c.current.length<=2||(c.current.splice(h,1),h>=c.current.length&&f(c.current.length-1),t(`linear-gradient(${d.current}deg, ${R(c.current)})`)))},onMouseDown:e=>{let n=e.currentTarget.getBoundingClientRect(),r=Math.min(1,Math.max(0,(e.clientX-n.left)/n.width)),i=l[0].color;l.push({color:i,offset:r}),l.sort((e,t)=>e.offset-t.offset),f(l.findIndex(e=>e.offset===r)),b(),t(`linear-gradient(${o}deg, ${R(l)})`)}}),l.map(({offset:e,color:t},n)=>r.createElement("div",{key:n,style:{position:"absolute",top:"10px",left:100*e+"%",border:n===h?"2px solid rgb(0, 161, 255)":"2px solid rgb(0, 0, 0, 0)",padding:"2px"},onMouseDown:e=>{e.stopPropagation(),f(n),b()}},r.createElement(_,{background:t,style:{margin:0}})))),r.createElement("div",{style:{width:"calc(100% - 30px)",height:"10px",marginLeft:"15px",background:`linear-gradient(90deg,${R(l)})`}}),r.createElement("div",{style:{padding:"10px"}},r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},r.createElement("div",null,(0,u.t)("toolbar.colorPicker.angle")),r.createElement("div",null,r.createElement(i.A,{value:o,onValueChange:e=>{t(`linear-gradient(${Math.min(360,Math.max(0,e))}deg,${R(l)})`)},buttonPosition:"none",style:{width:"50px"},min:0,max:360}))),r.createElement(s.i,{min:0,max:360,value:o,showTrackFill:!1,labelRenderer:!1,onChange:e=>{t(`linear-gradient(${e}deg,${R(l)})`)}})),r.createElement(M,{color:l[h].color,presetColors:a,onChange:e=>{let n=[...l];n[h].color=e,t(`linear-gradient(${o}deg, ${R(n)})`)}}))}
593,L=(0,c.Pi)(({value:e,onChange:t,preset:n,store:i})=>{let[l,s]=r.useState((0,C.H)(e)?"gradient":"solid");return r.createElement("div",{style:{padding:"5px"}},r.createElement(a.mQ,{id:"TabsExample",selectedTabId:l,onChange:e=>s(e),renderActiveTabPanelOnly:!0},r.createElement(o.O,{id:"solid",title:(0,u.t)("toolbar.colorPicker.solid"),panel:r.createElement(M,{color:e,onChange:t,presetColors:n,style:{padding:"0"}})}),r.createElement(o.O,{id:"gradient",title:(0,u.t)("toolbar.colorPicker.linear"),panel:r.createElement(A,{value:e,onChange:t,store:i,preset:n}),panelClassName:"ember-panel"})))}),_=e=>{var{size:t=30,background:n,style:i={},children:a=null}=e,o=k(e,["size","background","style","children"]);return r.createElement("div",Object.assign({role:"button",tabIndex:0,"aria-label":"Pick color",onMouseDown:e=>e.preventDefault(),style:Object.assign({width:t+"px",height:t+"px",background:"url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 8 8'%3E%3Cg fill='rgba(112, 112, 116, 1)' fill-opacity='1'%3E%3Cpath fill-rule='evenodd' d='M0 0h4v4H0V0zm4 4h4v4H4V4z'/%3E%3C/g%3E%3C/svg%3E\")",borderRadius:"2px",boxShadow:"0 0 2px grey",marginBottom:"-4px"},i)},o),r.createElement("div",{style:{width:t+"px",height:t+"px",background:n}},a))},I=e=>{let t=T(e).slice(0,8).filter(e=>!S.find(t=>(0,E.mf)(t,e)));return t.concat(S.slice(0,16-t.length).reverse())},O=({value:e,onChange:t,size:n,store:i,gradientEnabled:a,children:o,style:s,position:c="auto",onOpen:u,onClose:d})=>{let h=I(i);return r.createElement(l.J,{autoFocus:!1,enforceFocus:!0,interactionKind:"click",hasBackdrop:!0,position:c,onOpening:u,onClosed:d,content:a?r.createElement(L,{preset:h,value:e,onChange:t,store:i}):r.createElement("div",{style:{padding:"5px"}},r.createElement(M,{color:e,onChange:t,presetColors:h}))},r.createElement(_,{size:n,background:e,style:s},o))};var D=O},28164:function(e,t,n){"use strict";n.d(t,{o:function(){return E}});var r=n(7653),i=n(45470),a=n(54064),o=n(50058),l=n(88876),s=n(38726),c=n(74210),u=n(96834),d=n(2374),h=n(95975),f=r.forwardRef(function(e,t){var n=e.size>=d.J.LARGE,i=n?d.J.LARGE:d.J.STANDARD,a="".concat(-1*i/.05/2);return r.createElement(h.l,(0,u.pi)({iconName:"document",ref:t},e),r.createElement("path",{d:n?"M239.6 400H79.6C68.6 400 59.6 391 59.6 380V20C59.6 9 68.6 0 79.6 0H339.6C350.6 0 359.6 9 359.6 20V280L239.6 400zM319.6 40H99.6V360H219.6V260H319.6V40z":"M180 320H60C49 320 40 311 40 300V20C40 9 49 0 60 0H260C271 0 280 9 280 20V220L180 320zM240 40H80V280H160V200H240V40z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(a,", ").concat(a,")"),style:{transformOrigin:"center"}}))});f.defaultProps={size:d.J.STANDARD},f.displayName="Blueprint5.Icon.Document";var p=n(87105),m=r.forwardRef(function(e,t){var n=e.size>=d.J.LARGE,i=n?d.J.LARGE:d.J.STANDARD,a="".concat(-1*i/.05/2);return r.createElement(h.l,(0,u.pi)({iconName:"import",ref:t},e),r.createElement("path",{d:n?"M185.8 85.8C189.4 82.2 194.4 80 200 80S210.6 82.2 214.2 85.8L314.2000000000001 185.8C317.8 189.4 320 194.4 320 200C320 211 311 220 300 220C294.4000000000001 220 289.4000000000001 217.8 285.8 214.2L220 148.2V380C220 391 211 400 200 400S180 391 180 380V148.2L114.2 214.2C110.6 217.8 105.6 220 100 220C89 220 80 211 80 200C80 194.4 82.2 189.4 85.8 185.8L185.8 85.8zM380 120C369 120 360 111 360 100V40H40V100C40 111 31 120 20 120S0 111 0 100V20C0 9 9 0 20 0H380C391 0 400 9 400 20V100C400 111 391 120 380 120z":"M145.8 85.8C149.4 82.2 154.4 80 160 80S170.6 82.2 174.2 85.8L254.2 165.8C257.8 169.4 260 174.4 260 180C260 191 251 200 240 200C234.4 200 229.4 197.8 225.8 194.2L180 148.2V300C180 311 171 320 160 320S140 311 140 300V148.2L94.2 194.2C90.6 197.8 85.6 200 80 200C69 200 60 191 60 180C60 174.4 62.2 169.4 65.8 165.8L145.8 85.8zM300 100C289 100 280 91 280 80V40H40V80C40 91 31 100 20 100S0 91 0 80V20C0 9 9 0 20 0H300C311 0 320 9 320 20V80C320 91 311 100 300 100z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(a,", ").concat(a,")"),style:{transformOrigin:"center"}}))});m.defaultProps={size:d.J.STANDARD},m.displayName="Blueprint5.Icon.Import";var g=n(2027),v=n(54043),b=n(34350),y=n(87556),w=n(69295),x=n(84360);let C=e=>{let t=[];
593return e.pages.forEach(e=>{e.children.forEach(e=>{"text"===e.type&&t.push(e.text)})}),t.join(" ").split(" ").slice(0,6).join(" ").replace(/\s/g,"-").toLowerCase()||"polotno"},E=(0,g.Pi)(({store:e})=>{let[t,n]=r.useState(!1);return r.createElement(i.J,{content:r.createElement(a.v,null,r.createElement(o.s,{icon:r.createElement(c.p,null),text:(0,v.t)("toolbar.saveAsImage"),onClick:async()=>{e.pages.forEach((t,n)=>{let r=e.pages.length>1?"-"+(n+1):"";e.saveAsImage({pageId:t.id,fileName:C(e)+r+".png"})})}}),r.createElement(o.s,{icon:r.createElement(f,null),text:(0,v.t)("toolbar.saveAsPDF"),onClick:async()=>{n(!0),await e.saveAsPDF({fileName:C(e)+".pdf"}),n(!1)}}),x.flags.animationsEnabled&&r.createElement(o.s,{icon:r.createElement(p.n,null),text:"Save as Video",onClick:async()=>{n(!0);try{await (async({store:e,onProgress:t})=>{let n=e.toJSON(),r=await fetch(`${(0,y.Kf)()}/renders?KEY=${(0,w.km)()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({design:n,pixelRatio:1,format:"mp4"})}),i=await r.json();for(;;){let n=await fetch(`${(0,y.Kf)()}/renders/${i.id}?KEY=${(0,w.km)()}`),r=await n.json();if("done"===r.status){(0,b.S)(r.output,C(e)+".mp4");break}if("error"===r.status)throw Error("Failed to render video");null==t||t(r.progress||0,r.status||"processing"),await new Promise(e=>setTimeout(e,5e3))}})({store:e})}catch(e){console.error("Video export failed:",e),alert("Failed to export video. Please try again.")}n(!1)}})),position:l.Ly.BOTTOM},r.createElement(s.z,{icon:r.createElement(m,null),className:"polotno-download-button",text:(0,v.t)("toolbar.download"),minimal:!0,loading:t}))})},9865:function(e,t,n){"use strict";n.d(t,{c:function(){return u}});var r=n(7653),i=n(2027),a=n(59799),o=n(38726),l=n(64518),s=n(54043),c=n(72037);let u=(0,i.Pi)(({store:e})=>{let{disabled:t,duplicate:n}=(0,c.w)({store:e});return r.createElement(a.u,{content:(0,s.t)("toolbar.duplicateElements"),disabled:t,position:"bottom"},r.createElement(o.z,{icon:r.createElement(l.F,null),minimal:!0,onClick:()=>n(),disabled:t,"aria-label":(0,s.t)("toolbar.duplicateElements")}))})},87577:function(e,t,n){"use strict";n.d(t,{F:function(){return k},m:function(){return E}});var r=n(7653),i=n(17785),a=n(45254),o=n.n(a),l=n(12131),s={START:"start",END:"end"},c=n(84614),u=n(55927),d=n(13067),h=n(3485),f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={chopSize:t.defaultChopSize(),lastChopSize:null,lastOverflowCount:0,overflow:[],repartitioning:!1,visible:t.props.items},t.spacer=null,t.resize=function(){t.repartition()},t}return(0,i.ZT)(t,e),t.ofType=function(){return t},t.prototype.componentDidMount=function(){this.repartition()},t.prototype.shouldComponentUpdate=function(e,t){return this.props!==e||!(this.state!==t&&(0,d.ms)(this.state,t))},t.prototype.componentDidUpdate=function(e,t){e.observeParents!==this.props.observeParents&&console.warn(u.wT),(e.collapseFrom!==this.props.collapseFrom||e.items!==this.props.items||e.minVisibleItems!==this.props.minVisibleItems||e.overflowRenderer!==this.props.overflowRenderer||e.alwaysRenderOverflow!==this.props.alwaysRenderOverflow||e.visibleItemRenderer!==this.props.visibleItemRenderer)&&this.setState({chopSize:this.defaultChopSize(),lastChopSize:null,lastOverflowCount:0,overflow:[],repartitioning:!0,visible:this.props.items});var n,r,i=this.state,a=i.repartitioning,o=i.overflow,l=i.lastOverflowCount;!1===a&&!0===t.repartitioning?o.length!==l&&(null===(r=(n=this.props).onOverflow)||void 0===r||r.call(n,o.slice())):(0,d.ms)(t,this.state)||this.repartition()},t.prototype.render=function(){var e=this,t=this.props,n=t.className,i=t.collapseFrom,a=t.observeParents,c=t.style,u=t.tagName,d=t.visibleItemRenderer,f=this.maybeRenderOverflow(),p=r.createElement(void 0===u?"div":u,{className:o()(l.t$L,n),style:c},i===s.START?f:null,this.state.visible.map(d),i===s.END?f:null,r.createElement("div",{className:l.JuP,ref:function(t){return e.spacer=t}}));return r.createElement(h.z,{onResize:this.resize,observeParents:a},p)},t.prototype.maybeRenderOverflow=function(){var e=this.state.overflow;return 0!==e.length||this.props.alwaysRenderOverflow?this.props.overflowRenderer(e.slice()):null},t.prototype.repartition=function(){var e,t=this;if(null!=this.spacer){var n=1===this.state.lastChopSize,r=null!==(e=this.props.minVisibleItems)&&void 0!==e?e:0,i=this.spacer.offsetWidth<.9&&this.state.visible.length>r,a=(this.spacer.offsetWidth>=1||this.state.visible.length<r)&&this.state.overflow.length>0&&!n;i||a?this.setState(function(e){if(t.props.collapseFrom===s.END){var n,r,a=m(e.visible,e.overflow,t.state.chopSize*(i?1:-1));n=a[0],r=a[1]}else{var a=m(e.overflow,e.visible,t.state.chopSize*(i?-1:1));r=a[0],n=a[1]}return{chopSize:p(e.chopSize),lastChopSize:e.chopSize,lastOverflowCount:t.isFirstPartitionCycle(e.chopSize)?e.overflow.length:e.lastOverflowCount,overflow:r,repartitioning:!0,visible:n}}):this.setState({chopSize:this.defaultChopSize(),lastChopSize:null,repartitioning:!1})}},t.prototype.defaultChopSize=function(){return p(this.props.items.length)},t.prototype.isFirstPartitionCycle=function(e){return e===this.defaultChopSize()},t.displayName="".concat(c.g,".OverflowList"),t.defaultProps={alwaysRenderOverflow:!1,collapseFrom:s.START,minVisibleItems:0},t}(r.Component);function p(e){return Math.ceil(e/2)}function m(e,t,n){var r=e.concat(t),i=e.length-n;if(i<=0)return[[],r];if(i>=r.length)return[r,[]];var a=r.length-i;return[r.slice(0,-a),r.slice(-a)]}var g=n(88876),v=n(38726),b=n(45470),y=n(43808),w=n(96283),x=n(51453);let C=(0,y.Z)("div",r.forwardRef)` 594 ${(0,w.wz)("\n width: auto !important;\n ")} 595`,E=({type:e,usedItems:t,components:n}
595)=>{let r=[];return Object.keys(n).forEach(i=>{0===i.toLowerCase().indexOf(e)&&i.toLowerCase()!==e&&(n[i]?t.includes(i)||r.push(i):console.error(`Polotno error: Toolbar has invalid React component "${i}"`))}),t.filter(e=>!!e).concat(r)},k=({items:e,itemRender:t})=>{let[n,i]=r.useState(0),a=r.useRef(null),o=()=>{if(null===a.current)return;let e=a.current.parentElement,t=0;e&&(Array.from(e.children).forEach(e=>{e!==a.current&&(t+=e.offsetWidth)}),i(Math.max(20,e.offsetWidth-t-10)))};return r.useLayoutEffect(()=>{o()}),r.useLayoutEffect(()=>{let e=a.current.parentElement,t=null==e?void 0:e.parentElement;if(window.ResizeObserver){let n=new ResizeObserver(o);e&&n.observe(e),t&&n.observe(t);let r=new MutationObserver(o);return e&&r.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]}),()=>{n.disconnect(),r.disconnect()}}{let e=setInterval(o,100);return()=>clearInterval(e)}},[]),r.createElement(C,{style:{width:n+"px"},ref:a,className:"bp5-navbar-group bp5-align-left"},r.createElement(f,{items:e,style:{width:"100%"},visibleItemRenderer:t,collapseFrom:s.END,overflowRenderer:e=>r.createElement(b.J,{content:r.createElement("div",{style:{padding:"10px",display:"flex"}},e.map(t)),position:g.Ly.BOTTOM},r.createElement(v.z,{icon:r.createElement(x.T,null),"aria-label":"More",minimal:!0,style:{marginLeft:"10px"},onMouseDownCapture:e=>{e.preventDefault()}}))}))}},64681:function(e,t,n){"use strict";n.d(t,{Mo:function(){return C},bO:function(){return E},Y2:function(){return w},ZP:function(){return k}});var r=n(7653),i=n(20952),a=n(53466),o=n(52956),l=n(86652),s=n(88876),c=n(38726),u=n(45470),d=n(2027),h=n(96834),f=n(2374),p=n(95975),m=r.forwardRef(function(e,t){var n=e.size>=f.J.LARGE,i=n?f.J.LARGE:f.J.STANDARD,a="".concat(-1*i/.05/2);return r.createElement(p.l,(0,h.pi)({iconName:"left-join",ref:t},e),r.createElement("path",{d:n?"M174 306C148 280 130 242 130 200S146 120 174 94C158 84 140 80 120 80C54 80 0 134 0 200S54 320 120 320C140 320 158 316 174 306zM280 320C346 320 400 266 400 200S346 80 280 80C260 80 242 84 226 94C252.0000000000001 120 270 158 270 200S254 278 226 306C242 316 260 320 280 320zM292 279C303 255 309.2 228.2 309.2 200S303 145 292 121C330 127.2000000000001 359.2000000000001 160.2000000000001 359.2000000000001 200S330 272.8 292 279zM200 290C176 266 160 236 160 200S176 134 200 112C224 134 240 166 240 202S224 268 200 290z":"M132 254C122 258 112 260 100 260C44 260 0 216 0 160S44 60 100 60C112 60 122 62 132 66C106 88 90 122 90 160S106 232 132 254zM160 240C136 222 120 192 120 160S136 98 160 80C184 98 200 126 200 160S184 222 160 240zM220 260C276 260 320 216 320 160S276 60 220 60C208 60 198 62 188 66C214 88 230 124 230 160S214 230 188 254.0000000000001C198 258 208 260 220 260zM227 239.6C241.6 216.6 249.8 189.2 249.8 160S241.4 103.4 227 80.4C267.8 84 299.8 118.4 299.8 160S267.8 236 227 239.6z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(a,", ").concat(a,")"),style:{transformOrigin:"center"}}))});m.defaultProps={size:f.J.STANDARD},m.displayName="Blueprint5.Icon.LeftJoin";var g=n(95515),v=n(54043),b=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let y=(e,t,n)=>Math.max(t,Math.min(n,e)),w=e=>{var{value:t,onValueChange:n}=e,a=b(e,["value","onValueChange"]);let[o,l]=r.useState(t.toString());return r.useEffect(()=>{l(t.toString())},[t]),r.createElement(i.A,Object.assign({value:o,onValueChange:(e,t)=>
595{l(t),Number.isNaN(e)||n(e)}},a))},x=({label:e,enabled:t,visible:n=!0,onEnabledChange:s,numberValue:c,onNumberValueChange:u,min:d,max:h})=>n?r.createElement(r.Fragment,null,r.createElement(a.rs,{checked:t,label:e,onChange:e=>{s(e.target.checked)},alignIndicator:o.v.RIGHT,style:{marginTop:"20px"}}),t&&r.createElement("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"}},r.createElement("div",{style:{paddingTop:"7px"}},r.createElement(l.i,{value:c,onChange:e=>{u(e)},min:d,max:h,labelStepSize:50,showTrackFill:!1,labelRenderer:!1})),r.createElement(i.A,{value:c,onValueChange:e=>{u(y(e,d,h))},buttonPosition:"none",style:{width:"45px",padding:"0 5px",marginLeft:"10px"},min:d,max:h}))):null,C=(0,d.Pi)(({textEl:e,eachSet:t})=>{let[n,i]=r.useState(null),a=r.useRef(0),o=r.useRef(null),s=null!=n?n:100*e.curvePower,c=e=>{t({curvePower:e/100}),a.current=Date.now()};return r.createElement(l.i,{value:s,onChange:e=>{let t=y(e,-100,100);i(t),o.current&&clearTimeout(o.current);let n=Date.now()-a.current;n>=300?c(t):o.current=setTimeout(()=>{c(t)},300-n)},onRelease:e=>{o.current&&clearTimeout(o.current),i(null),c(y(e,-100,100))},min:-100,max:100,labelStepSize:50,labelRenderer:e=>0===e?"0":e.toString()})});(0,d.Pi)(({element:e,store:t,elements:n})=>{let d=n||[e],h=d[0],f="text"===h.type,p="image"===h.type,b="svg"===h.type,E=p||b,k=e=>{t.history.transaction(()=>{d.forEach(t=>{t.set(e)})})};return r.createElement(u.J,{content:r.createElement("div",{style:{padding:"15px",paddingTop:"15px",width:"230px",maxHeight:"calc(100vh - 150px)",overflow:"auto"}},r.createElement(x,{label:(0,v.t)("toolbar.blur"),enabled:h.blurEnabled,visible:E||f,onEnabledChange:e=>{k({blurEnabled:e})},numberValue:h.blurRadius,onNumberValueChange:e=>{k({blurRadius:e})},min:0,max:100}),r.createElement(x,{label:(0,v.t)("toolbar.brightness"),visible:E,enabled:h.brightnessEnabled,onEnabledChange:e=>{k({brightnessEnabled:e})},numberValue:100*h.brightness+100,onNumberValueChange:e=>{k({brightness:(e-100)/100})},min:0,max:200}),E&&r.createElement(a.rs,{checked:h.sepiaEnabled,label:(0,v.t)("toolbar.sepia"),onChange:e=>{k({sepiaEnabled:e.target.checked})},alignIndicator:o.v.RIGHT,style:{marginTop:"20px"}}),E&&r.createElement(a.rs,{checked:h.grayscaleEnabled,label:(0,v.t)("toolbar.grayscale"),onChange:e=>{k({grayscaleEnabled:e.target.checked})},alignIndicator:o.v.RIGHT,style:{marginTop:"20px"}}),f&&r.createElement(a.rs,{checked:!!h.curveEnabled,label:(0,v.t)("toolbar.curvedText")||"Curved text",onChange:e=>{k({curveEnabled:e.target.checked})},alignIndicator:o.v.RIGHT,style:{marginTop:"20px"}}),f&&h.curveEnabled&&r.createElement(r.Fragment,null,r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},r.createElement("div",null,(0,v.t)("toolbar.curvePower")||"Curve"),r.createElement("div",null,r.createElement(w,{value:Math.round(100*h.curvePower),onValueChange:e=>{k({curvePower:y(e,-100,100)/100})},style:{width:"50px"},min:-100,max:100,buttonPosition:"none"}))),r.createElement(C,{textEl:h,eachSet:k})),f&&r.createElement(a.rs,{checked:!!h.strokeWidth,label:(0,v.t)("toolbar.textStroke"),onChange:e=>{k({strokeWidth:e.target.checked?2:0})},alignIndicator:o.v.RIGHT,style:{marginTop:"20px"}}),f&&!!h.strokeWidth&&r.createElement(r.Fragment,null,r.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},r.createElement(g.ZP,{value:h.stroke,size:30,onChange:e=>{k({stroke:e})},store:t}),r.createElement(i.A,{defaultValue:h.strokeWidth,onValueChange:e=>{k({strokeWidth:y(e,1,30)})},style:{width:"80px"},min:1,max:Math.round(h.fontSize/2)}))),f&&r.createElement(a.rs,{checked:!!h.backgroundEnabled,label:(0,v.t)("toolbar.textBackground"),onChange:e=>{k({backgroundEnabled:e.target.checked})},alignIndicator:o.v.RIGHT,style:{marginTop:"20px"}}),!!h.backgroundEnabled&&r.createElement(r.Fragment,null,r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},r.createElement("div",null,(0,v.t)("toolbar.backgroundCornerRadius")),r.createElement("div",null,r.createElement(w,{value:100*h.backgroundCornerRadius,onValueChange:e=>{k({backgroundCornerRadius:y(e,0,100)/100})},style:{width:"50px"},min:0,max:100,buttonPosition:"none"}))),r.createElement(l.i,{value:100*h.backgroundCornerRadius,onChange:e=>{k({backgroundCornerRadius:y(e,0,100)/100})},min:0,max:100,labelRenderer:!1}),r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},r.createElement("div",null,(0,v.t)("toolbar.backgroundPadding")),r.createElement("div",null,r.createElement(w,{value:Math.round(100*h.backgroundPadding),onValueChange:e=>{k({backgroundPadding:y(e,0,100)/100})},style:{width:"50px"},min:0,max:100,buttonPosition:"none"}))),r.createElement(l.i,{value:Math.round(100*h.backgroundPadding),onChange:e=>{k({backgroundPadding:y(e,0,100)/100})},min:0,max:100,labelRenderer:!1}),r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},r.createElement("div",null,(0,v.t)("toolbar.opacity")),r.createElement("div",null,r.createElement(w,{value:Math.round(100*h.backgroundOpacity),onValueChange:e=>{k({backgroundOpacity:e/100})},style:{width:"50px"},min:0,max:100,buttonPosition:"none"}))),r.createElement(l.i,{value:100*h.backgroundOpacity,onChange:e=>{k({backgroundOpacity:e/100})},min:0,max:100,labelRenderer:!1}),r.createElement("div",{style:{display:"flex",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},r.createElement("div",{style:{lineHeight:"30px"}},(0,v.t)("toolbar.color")),r.createElement(g.ZP,{value:h.backgroundColor,size:30,onChange:e=>{k({backgroundColor:e})},store:t}))),E&&r.createElement(a.rs,{checked:!!h.borderSize,label:(0,v.t)("toolbar.border"),onChange:e=>{k({borderSize:e.target.checked?2:0})},alignIndicator:o.v.RIGHT,style:{marginTop:"20px"}}),!!h.borderSize&&r.createElement(r.Fragment,null,r.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},r.createElement(g.ZP,{value:h.borderColor,size:30,onChange:e=>{k({borderColor:e})},store:t}),r.createElement(i.A,{defaultValue:h.borderSize,onValueChange:e=>{k({borderSize:y(e,1,Math.min(h.width,h.height)/2)})},style:{width:"80px"},min:1,max:Math.max(1,Math.min(h.width,h.height)/2)}))),E&&r.createElement(a.rs,{checked:!!h.cornerRadius,label:(0,v.t)("toolbar.cornerRadius"),onChange:e=>{k({cornerRadius:e.target.checked?Math.min(h.width/4,h.height/4):0})},alignIndicator:o.v.RIGHT,style:{marginTop:"20px"}}
595),E&&!!h.cornerRadius&&r.createElement("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"}},r.createElement("div",{style:{width:"150px",paddingTop:"7px"}},r.createElement(l.i,{value:Math.min(h.cornerRadius,Math.round(Math.min(h.width/2,h.height/2))),onChange:e=>{k({cornerRadius:e})},min:1,max:Math.round(Math.min(h.width/2,h.height/2)),labelStepSize:50,showTrackFill:!1,labelRenderer:!1})),r.createElement(i.A,{value:h.cornerRadius,onValueChange:e=>{k({cornerRadius:y(e,1,Math.min(h.width,h.height)/2)})},buttonPosition:"none",style:{width:"45px",padding:"0 5px"},min:1,max:Math.round(Math.min(h.width/2,h.height/2))})),r.createElement(a.rs,{checked:h.shadowEnabled,label:(0,v.t)("toolbar.shadow"),onChange:e=>{k({shadowEnabled:e.target.checked})},alignIndicator:o.v.RIGHT,style:{marginTop:"20px"}}),h.shadowEnabled&&r.createElement(r.Fragment,null,r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},r.createElement("div",null,(0,v.t)("toolbar.blur")),r.createElement("div",null,r.createElement(w,{value:h.shadowBlur,onValueChange:e=>{k({shadowBlur:y(e,-50,50)})},style:{width:"50px"},min:0,max:50,buttonPosition:"none"}))),r.createElement(l.i,{value:h.shadowBlur,onChange:e=>{k({shadowBlur:e})},min:0,max:50,showTrackFill:!1,labelRenderer:!1}),r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},r.createElement("div",null,(0,v.t)("toolbar.offsetX")),r.createElement("div",null,r.createElement(w,{value:h.shadowOffsetX,onValueChange:e=>{k({shadowOffsetX:y(e,-50,50)})},style:{width:"50px"},min:-50,max:50,buttonPosition:"none"}))),r.createElement(l.i,{value:h.shadowOffsetX,onChange:e=>{k({shadowOffsetX:e})},min:-50,max:50,showTrackFill:!1,labelRenderer:!1}),r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},r.createElement("div",null,(0,v.t)("toolbar.offsetY")),r.createElement("div",null,r.createElement(w,{value:h.shadowOffsetY,onValueChange:e=>{k({shadowOffsetY:y(e,-50,50)})},style:{width:"50px"},min:-50,max:50,buttonPosition:"none"}))),r.createElement(l.i,{value:h.shadowOffsetY,onChange:e=>{k({shadowOffsetY:e})},min:-50,max:50,showTrackFill:!1,labelRenderer:!1}),r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},r.createElement("div",null,(0,v.t)("toolbar.opacity")),r.createElement("div",null,r.createElement(w,{value:Math.round(100*h.shadowOpacity),onValueChange:e=>{k({shadowOpacity:e/100})},style:{width:"50px"},min:0,max:100,buttonPosition:"none"}))),r.createElement(l.i,{value:100*h.shadowOpacity,onChange:e=>{k({shadowOpacity:e/100})},min:0,max:100,labelRenderer:!1}),r.createElement("div",{style:{display:"flex",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},r.createElement("div",{style:{lineHeight:"30px"}},(0,v.t)("toolbar.color")),r.createElement(g.ZP,{value:h.shadowColor,size:30,onChange:e=>{k({shadowColor:e})},store:t})))),position:s.Ly.BOTTOM},r.createElement(c.z,{icon:r.createElement(m,null),text:(0,v.t)("toolbar.effects"),minimal:!0}))});let E=(0,d.Pi)(({element:e,store:t})=>e.contentEditable?r.createElement(c.z,{minimal:!0,icon:r.createElement(m,null),text:(0,v.t)("toolbar.effects"),onClickCapture:e=>{e.stopPropagation(),t.openSidePanel("effects")}}):null);var k=E},69305:function(e,t,n){"use strict";n.d(t,{B:function(){return l}});var r=n(7653),i=n(2027),a=n(38726),o=n(54043);let l=(0,i.Pi)(({store:e})=>{let t=e.selectedElements.length>1,n=1===e.selectedElements.length&&"group"===e.selectedElements[0].type;return r.createElement(r.Fragment,null,t&&r.createElement(a.z,{minimal:!0,onClick:()=>{e.groupElements(e.selectedElements.map(e=>e.id))},style:{marginLeft:"auto"}},(0,o.t)("toolbar.groupElements")),n&&r.createElement(a.z,{minimal:!0,onClick:()=>{e.ungroupElements([e.selectedElements[0].id])},style:{marginLeft:"auto"}},(0,o.t)("toolbar.ungroupElements")))})},91332:function(e,t,n){"use strict";n.d(t,{p:function(){return _}});var r=n(7653),i=n(2027),a=n(45470),o=n(54064),l=n(59162),s=n(50058),c=n(88876),u=n(38726),d=n(12724),h=n(47716),f=n(53159),p=n(70356),m=n(96834),g=n(2374),v=n(95975),b=r.forwardRef(function(e,t){var n=e.size>=g.J.LARGE,i=n?g.J.LARGE:g.J.STANDARD,a="".concat(-1*i/.05/2);return r.createElement(v.l,(0,m.pi)({iconName:"alignment-left",ref:t},e),r.createElement("path",{d:n?"M20 400C9 400 0 391 0 380V20C0 9 9 0 20 0S40 9 40 20V380C40 391 31 400 20 400zM240 180H100C89 180 80 171 80 160V80C80 69 89 60 100 60H240C251 60 260 69 260 80V160C260 171 251 180 240 180zM380 340H100C89 340 80 331 80 320V240C80 229 89 220 100 220H380C391 220 400 229 400 240V320C400 331 391 340 380 340z":"M180 140H100C89 140 80 131 80 120V60C80 49 89 40 100 40H180C191 40 200 49 200 60V120C200 131 191 140 180 140zM20 320C9 320 0 311 0 300V20C0 9 9 0 20 0S40 9 40 20V300C40 3
59511 31 320 20 320zM280 280H100C89 280 80 271 80 260V200C80 189 89 180 100 180H280C291 180 300 189 300 200V260C300 271 291 280 280 280z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(a,", ").concat(a,")"),style:{transformOrigin:"center"}}))});b.defaultProps={size:g.J.STANDARD},b.displayName="Blueprint5.Icon.AlignmentLeft";var y=r.forwardRef(function(e,t){var n=e.size>=g.J.LARGE,i=n?g.J.LARGE:g.J.STANDARD,a="".concat(-1*i/.05/2);return r.createElement(v.l,(0,m.pi)({iconName:"alignment-vertical-center",ref:t},e),r.createElement("path",{d:n?"M340 340H220V380C220 391 211 400 200 400S180 391 180 380V340H60C49 340 40 331 40 320V240C40 229 49 220 60 220H180V180H140C129 180 120 171 120 160V80C120 69 129 60 140 60H180V20C180 9 189 0 200 0S220 9 220 20V60H260C271 60 280 69 280 80V160C280 171 271 180 260 180H220V220H340C351 220 360 229 360 240V320C360 331 351 340 340 340z":"M260 280H180V300C180 311 171 320 160 320S140 311 140 300V280H60C49 280 40 271 40 260V200C40 189 49 180 60 180H140V140H120C109 140 100 131 100 120V60C100 49 109 40 120 40H140V20C140 9 149 0 160 0S180 9 180 20V40H200C211 40 220 49 220 60V120C220 131 211 140 200 140H180V180H260C271 180 280 189 280 200V260C280 271 271 280 260 280z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(a,", ").concat(a,")"),style:{transformOrigin:"center"}}))});y.defaultProps={size:g.J.STANDARD},y.displayName="Blueprint5.Icon.AlignmentVerticalCenter";var w=r.forwardRef(function(e,t){var n=e.size>=g.J.LARGE,i=n?g.J.LARGE:g.J.STANDARD,a="".concat(-1*i/.05/2);return r.createElement(v.l,(0,m.pi)({iconName:"alignment-right",ref:t},e),r.createElement("path",{d:n?"M380 400C369 400 360 391 360 380V20C360 9 369 0 380 0S400 9 400 20V380C400 391 391 400 380 400zM300 180H160C149 180 140 171 140 160V80C140 69 149 60 160 60H300C311 60 320 69 320 80V160C320 171 311 180 300 180zM300 340H20C9 340 0 331 0 320V240C0 229 9 220 20 220H300C311 220 320 229 320 240V320C320 331 311 340 300 340z":"M220 140H140C129 140 120 131 120 120V60C120 49 129 40 140 40H220C231 40 240 49 240 60V120C240 131 231 140 220 140zM300 320C289 320 280 311 280 300V20C280 9 289 0 300 0S320 9 320 20V300C320 311 311 320 300 320zM220 280H40C29 280 20 271 20 260V200C20 189 29 180 40 180H220C231 180 240 189 240 200V260C240 271 231 280 220 280z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(a,", ").concat(a,")"),style:{transformOrigin:"center"}}))});w.defaultProps={size:g.J.STANDARD},w.displayName="Blueprint5.Icon.AlignmentRight";var x=r.forwardRef(function(e,t){var n=e.size>=g.J.LARGE,i=n?g.J.LARGE:g.J.STANDARD,a="".concat(-1*i/.05/2);return r.createElement(v.l,(0,m.pi)({iconName:"alignment-top",ref:t},e),r.createElement("path",{d:n?"M160 320H80C69 320 60 311 60 300V20C60 9 69 0 80 0H160C171 0 180 9 180 20V300C180 311 171 320 160 320zM380 400H20C9 400 0 391 0 380S9 360 20 360H380C391 360 400 369 400 380S391 400 380 400zM320 320H240C229 320 220 311 220 300V160C220 149 229 140 240 140H320C331 140 340 149 340 160V300C340 311 331 320 320 320z":"M300 320H20C9 320 0 311 0 300S9 280 20 280H300C311 280 320 289 320 300S311 320 300 320zM120 240H60C49 240 40 231 40 220V40C40 29 49 20 60 20H120C131 20 140 29 140 40V220C140 231 131 240 120 240zM260 240H200C189 240 180 231 180 220V140C180 129 189 120 200 120H260C271 120 280 129 280 140V220C280 231 271 240 260 240z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(a,", ").concat(a,")"),style:{transformOrigin:"center"}}))});x.defaultProps={size:g.J.STANDARD},x.displayName="Blueprint5.Icon.AlignmentTop";var C=r.forwardRef(function(e,t){var n=e.size>=g.J.LARGE,i=n?g.J.LARGE:g.J.STANDARD,a="".concat(-1*i/.05/2);return r.createElement(v.l,(0,m.pi)({iconName:"alignment-horizontal-center",ref:t},e),r.createElement("path",{d:n?"M380 220H340V260C340 271 331 280 320 280H240C229 280 220 271 220 260V220H180V340C180 351 171 360 160 360H80C69 360 60 351 60 340V220H20C9 220 0 211 0 200C0 189 9 180 20 180H60V60C60 49 69 40 80 40H160C171 40 180 49 180 60V180H220V140C220 129 229 120 240 120H320C331 120 340 129 340 140V180H380C391 180 400 189 400 200C400 211 391 220 380 220z":"M300 180H280V200C280 211 271 220 260 220H200C189 220 180 211 180 200V180H140V260C140 271 131 280 120 280H60C49 280 40 271 40 260V180H20C9 180 0 171 0 160C0 149 9 140 20 140H40V60C40 49 49 40 60 40H120C131 40 140 49 140 60V140H180V120C180 109
595189 100 200 100H260C271 100 280 109 280 120V140H300C311 140 320 149 320 160C320 171 311 180 300 180z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(a,", ").concat(a,")"),style:{transformOrigin:"center"}}))});C.defaultProps={size:g.J.STANDARD},C.displayName="Blueprint5.Icon.AlignmentHorizontalCenter";var E=r.forwardRef(function(e,t){var n=e.size>=g.J.LARGE,i=n?g.J.LARGE:g.J.STANDARD,a="".concat(-1*i/.05/2);return r.createElement(v.l,(0,m.pi)({iconName:"alignment-bottom",ref:t},e),r.createElement("path",{d:n?"M240 80H320C331 80 340 89 340 100V240C340 251 331 260 320 260H240C229 260 220 251 220 240V100C220 89 229 80 240 80zM380 40H20C9 40 0 31 0 20S9 0 20 0H380C391 0 400 9 400 20S391 40 380 40zM80 80H160C171 80 180 89 180 100V380C180 391 171 400 160 400H80C69 400 60 391 60 380V100C60 89 69 80 80 80z":"M200 80H260C271 80 280 89 280 100V180C280 191 271 200 260 200H200C189 200 180 191 180 180V100C180 89 189 80 200 80zM300 40H20C9 40 0 31 0 20S9 0 20 0H300C311 0 320 9 320 20S311 40 300 40zM60 80H120C131 80 140 89 140 100V280C140 291 131 300 120 300H60C49 300 40 291 40 28
5950V100C40 89 49 80 60 80z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(a,", ").concat(a,")"),style:{transformOrigin:"center"}}))});E.defaultProps={size:g.J.STANDARD},E.displayName="Blueprint5.Icon.AlignmentBottom";var k=r.forwardRef(function(e,t){var n=e.size>=g.J.LARGE,i=n?g.J.LARGE:g.J.STANDARD,a="".concat(-1*i/.05/2);return r.createElement(v.l,(0,m.pi)({iconName:"vertical-distribution",ref:t},e),r.createElement("path",{d:n?"M20 360H380C391 360 400 369 400 380S391 400 380 400H20C9 400 0 391 0 380S9 360 20 360zM60 260C49 260 40 251 40 240V160C40 149 49 140 60 140H340C351 140 360 149 360 160V240C360 251 351 260 340 260H60zM380 40H20C9 40 0 31 0 20S9 0 20 0H380C391 0 400 9 400 20S391 40 380 40z":"M20 280H300C311 280 320 289 320 300S311 320 300 320H20C9 320 0 311 0 300S9 280 20 280zM300 60H20C9 60 0 51 0 40S9 20 20 20H300C311 20 320 29 320 40S311 60 300 60zM60 220C49 220 40 211 40 200V140C40 129 49 120 60 120H240C251 120 260 129 260 140V200C260 211 251 220 240 220H60z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(a,", ").concat(a,")"),style:{transformOrigin:"center"}}))});k.defaultProps={size:g.J.STANDARD},k.displayName="Blueprint5.Icon.VerticalDistribution";var S=r.forwardRef(function(e,t){var n=e.size>=g.J.LARGE,i=n?g.J.LARGE:g.J.STANDARD,a="".concat(-1*i/.05/2);return r.createElement(v.l,(0,m.pi)({iconName:"horizontal-distribution",ref:t},e),r.createElement("path",{d:n?"M240 360H160C149 360 140 351 140 340V60C140 49 149 40 160 40H240C251 40 260 49 260 60V340C260 351 251 360 240 360zM20 400C9 400 0 391 0 380V20C0 9 9 0 20 0S40 9 40 20V380C40 391 31 400 20 400zM380 400C369 400 360 391 360 380V20C360 9 369 0 380 0S400 9 400 20V380C400 391 391 400 380 400z":"M40 320C29 320 20 311 20 300V20C20 9 29 0 40 0S60 9 60 20V300C60 311 51 320 40 320zM300 320C289 320 280 311 280 300V20C280 9 289 0 300 0S320 9 320 20V300C320 311 311 320 300 320zM200 280H140C129 280 120 271 120 260V80C120 69 129 60 140 60H200C211 60 220 69 220 80V260C220 271 211 280 200 280z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(a,", ").concat(a,")"),style:{transformOrigin:"center"}}))});S.defaultProps={size:g.J.STANDARD},S.displayName="Blueprint5.Icon.HorizontalDistribution";var T=n(84271),P=n(57042),M=n(54043),R=n(45256);let A=e=>{if("group"!==e.type)return(0,P.VK)(e);let t=1/0,n=1/0,r=-1/0,i=-1/0;return e.children.forEach(e=>{let a=A(e);t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x+a.width),i=Math.max(i,a.y+a.height)}),{x:t,y:n,width:r-t,height:i-n}},L=(e,t,n)=>{if("group"!==e.type){let r=(0,P.VK)(e),i=t-r.x,a=n-r.y;e.set({x:e.x+i,y:e.y+a})}else{let r=t-A(e).x,i=n-A(e).y;e.children.forEach(e=>{let t=A(e);L(e,t.x+r,t.y+i)})}},_=(0,i.Pi)(({store:e})=>{var t,n,i,m;let g=e.selectedElements.length>0,v=e.selectedElementsIds,P=e.selectedElements.every(e=>e.draggable),_=P&&e.selectedElements.length>1;return r.createElement(a.J,{disabled:!g,content:r.createElement(o.v,{style:{width:"280px"}},r.createElement(l.R,{title:(0,M.t)("toolbar.layering")}),r.createElement("div",{style:{display:"flex"}},r.createElement("div",{style:{width:"50%"}},r.createElement(s.s,{shouldDismissPopover:!1,icon:r.createElement(d.K,null),text:(0,M.t)("toolbar.up"),disabled:!(null===(t=e.activePage)||void 0===t?void 0:t.canMoveElementsUp(v)),onClick:()=>{var t;null===(t=e.activePage)||void 0===t||t.moveElementsUp(v)}}),r.createElement(s.s,{shouldDismissPopover:!1,icon:r.createElement(h.C,null),text:(0,M.t)("toolbar.toForward"),disabled:!(null===(n=e.activePage)||void 0===n?void 0:n.canMoveElementsTop(v)),onClick:()=>{var t;null===(t=e.activePage)||void 0===t||t.moveElementsTop(v)}})),r.createElement("div",{style:{width:"50%"}},r.createElement(s.s,{shouldDismissPopover:!1,icon:r.createElement(f._,null),text:(0,M.t)("toolbar.down"),disabled:!(null===(i=e.activePage)||void 0===i?void 0:i.canMoveElementsDown(v)),onClick:()=>{var t;null===(t=e.activePage)||void 0===t||t.moveElementsDown(v)}}),r.createElement(s.s,{shouldDismissPopover:!1,icon:r.createElement(p.S,null),text:(0,M.t)("toolbar.toBottom"),disabled:!(null===(m=e.activePage)||void 0===m?void 0:m.canMoveElementsBottom(v)),onClick:()=>{var t;null===(t=e.activePage)||void 0===t||t.moveElementsBottom(v)}}))),P&&r.createElement(r.Fragment,null,r.createElement(l.R,{title:(0,M.t)("toolbar.position")}),r.createElement("div",{style:{display:"flex"}},r.createElement("div",{style:{width:"50%"}},r.createElement(s.s,{shouldDismissPopover:!1,icon:r.createElement(b,null),text:(0,M.t)("toolbar.alignLeft"),onClick:()=>{(0,R.H_)(e)}}),r.createElement(s.s,{shouldDismissPopover:!1,icon:r.createElement(y,null),text:(0,M.t)("toolbar.alignCenter"),onClick:()=>{(0,R.A8)(e)}}),r.createElement(s.s,{shouldDismissPopover:!1,icon:r.createElement(w,null),text:(0,M.t)("toolbar.alignRight"),onClick:()=>{(0,R.cP)(e)}})),r.createElement("div",{style:{width:"50%"}},r.createElement(s.s,{shouldDismissPopover:!1,icon:r.createElement(x,null),text:(0,M.t)("toolbar.alignTop"),onClick:()=>{(0,R.Lb)(e)}}),r.createElement(s.s,{shouldDismissPopover:!1,icon:r.createElement(C,null),text:(0,M.t)("toolbar.alignMiddle"),onClick:()=>{(0,R.vA)(e)}}),r.createElement(s.s,{shouldDismissPopover:!1,icon:r.createElement(E,null),text:(0,M.t)("toolbar.alignBottom"),onClick:()=>{(0,R.Ew)(e)}})))),_&&r.createElement(r.Fragment,null,r.createElement(l.R,{title:(0,M.t)("toolbar.spaceEvenly")}),r.createElement("div",{style:{display:"flex"}},r.createElement("div",{style:{width:"50%"}},r.createElement(s.s,{shouldDismissPopover:!1,icon:r.createElement(k,null),text:(0,M.t)("toolbar.verticalDistribution"),onClick:()=>{var t;let n=null===(t=e.activePage)||void 0===t?void 0:t.computedHeight,r=0,i=0;
595e.selectedElements.forEach(e=>{let t=A(e);n=Math.min(n,t.y),r=Math.max(r,t.y+t.height),i+=t.height});let a=(r-n-i)/(e.selectedElements.length-1),o=e.selectedElements.slice().sort((e,t)=>{let n=A(e),r=A(t);return n.y-r.y}),l=0;o.forEach(e=>{let t=A(e);L(e,t.x,n+l),l+=t.height+a})}})),r.createElement("div",{style:{width:"50%"}},r.createElement(s.s,{shouldDismissPopover:!1,icon:r.createElement(S,null),text:(0,M.t)("toolbar.horizontalDistribution"),onClick:()=>{var t;let n=null===(t=e.activePage)||void 0===t?void 0:t.computedWidth,r=0,i=0;e.selectedElements.forEach(e=>{let t=A(e);n=Math.min(n,t.x),r=Math.max(r,t.x+t.width),i+=t.width});let a=(r-n-i)/(e.selectedElements.length-1),o=e.selectedElements.slice().sort((e,t)=>{let n=A(e),r=A(t);return n.x-r.x}),l=0;o.forEach(e=>{let t=A(e);L(e,n+l,t.y),l+=t.width+a})}}))))),position:c.Ly.BOTTOM},r.createElement(u.z,{icon:r.createElement(T.S,null),className:"polotno-position",minimal:!0,text:(0,M.t)("toolbar.position"),disabled:!g}))})},34013:function(e,t,n){"use strict";n.d(t,{x:function(){return u}});var r=n(7653),i=n(2027),a=n(59799),o=n(38726),l=n(94487),s=n(54043),c=n(61311);let u=(0,i.Pi)(({store:e})=>{let{disabled:t,remove:n}=(0,c._)({store:e});return r.createElement(a.u,{content:(0,s.t)("toolbar.removeElements"),disabled:t,position:"bottom"},r.createElement(o.z,{icon:r.createElement(l.r,null),minimal:!0,onClick:()=>n(),disabled:t,style:{marginLeft:"auto"},"aria-label":(0,s.t)("toolbar.removeElements")}))})},27148:function(e,t,n){"use strict";n.d(t,{i:function(){return T}});var r=n(7653),i=n(2027),a=n(38726),o=n(54064),l=n(50058),s=n(59162),c=n(88876),u=n(17785),d=n(45254),h=n.n(d),f=n(25157),p=n(12131),m=n(67824),g=n(84614),v=r.forwardRef(function(e,t){var n=e.value,i=e.onChange,a=e.onCompositionStart,o=e.onCompositionEnd,l=(0,u._T)(e,["value","onChange","onCompositionStart","onCompositionEnd"]),s=function(e){var t=e.onCompositionStart,n=e.onCompositionEnd,i=e.value,a=e.onChange,o=r.useState(i),l=o[0],s=o[1],c=r.useState(i),u=c[0],d=c[1],h=r.useState(!1),f=h[0],p=h[1],m=r.useState(!1),g=m[0],v=m[1],b=r.useRef(),y=r.useCallback(function(e){var n;null===(n=b.current)||void 0===n||n.call(b),p(!0),null==t||t(e)},[t]),w=r.useCallback(function(){var e=window.setTimeout(function(){return p(!1)},10);return function(){return window.clearTimeout(e)}},[]),x=r.useCallback(function(e){b.current=w(),null==n||n(e)},[w,n]),C=r.useCallback(function(e){d(e.target.value),null==a||a(e)},[a]);if(!(f||void 0===i)){var E=u!==l;E&&i===u?(s(i),v(!1)):E&&i===l?g||v(!0):E&&i!==l?(s(i),d(i),v(!1)):!E&&(l!==i||g)&&(s(i),d(i),v(!1))}return{onChange:C,onCompositionEnd:x,onCompositionStart:y,value:f||g?u:l}}({onChange:i,onCompositionEnd:o,onCompositionStart:a,value:n}),c=s.value,d=s.onChange,h=s.onCompositionStart,f=s.onCompositionEnd;return r.createElement("textarea",(0,u.pi)({},l,{value:c,onChange:d,onCompositionStart:h,onCompositionEnd:f,ref:t}))});v.displayName="".concat(g.g,".AsyncControllableTextArea");var b=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={},t.textareaElement=null,t.handleRef=(0,f.Km)(t,"textareaElement",t.props.inputRef),t.maybeSyncHeightToScrollHeight=function(){var e=t.props,n=e.autoResize,r=e.growVertically;if(null!=t.textareaElement){var i=t.textareaElement.scrollHeight;n?(t.textareaElement.style.height="0px",t.textareaElement.style.height=i.toString()+"px",t.setState({height:i})):r&&i>0&&t.setState({height:i})}if(t.props.autoResize&&null!=t.textareaElement){t.textareaElement.style.height="0px";var i=t.textareaElement.scrollHeight;t.textareaElement.style.height=i.toString()+"px",t.setState({height:i})}},t.handleChange=function(e){var n,r;t.maybeSyncHeightToScrollHeight(),null===(r=(n=t.props).onChange)||void 0===r||r.call(n,e)},t}return(0,u.ZT)(t,e),t.prototype.componentDidMount=function(){this.maybeSyncHeightToScrollHeight()},t.prototype.componentDidUpdate=function(e){e.inputRef!==this.props.inputRef&&((0,f.k$)(e.inputRef,null),this.handleRef=(0,f.Km)(this,"textareaElement",this.props.inputRef),(0,f.k$)(this.props.inputRef,this.textareaElement)),(e.value!==this.props.value||e.style!==this.props.style)&&this.maybeSyncHeightToScrollHeight()},t.prototype.render=function(){var e,t=this.props,n=t.asyncControl,i=t.autoResize,a=t.className,o=t.fill,l=t.growVertically,s=(t.inputRef,t.intent),c=t.large,d=t.size,f
595=t.small,m=(0,u._T)(t,["asyncControl","autoResize","className","fill","growVertically","inputRef","intent","large","size","small"]),g=h()(p.O4S,p.mM1,p.NL3(s),p.aa8(void 0===d?"medium":d,{large:c,small:f}),((e={})[p.ur0]=o,e[p.Lwu]=i,e),a),b=m.style,y=void 0===b?{}:b;(i||l)&&null!=this.state.height&&(y=(0,u.pi)((0,u.pi)({},y),{height:"".concat(this.state.height,"px")}));var w=n?v:"textarea";return r.createElement(w,(0,u.pi)({},m,{className:g,onChange:this.handleChange,style:y,ref:this.handleRef}))},t.defaultProps={autoResize:!1,fill:!1,large:!1,size:"medium",small:!1},t.displayName="".concat(g.g,".TextArea"),t}(m.l),y=n(74035),w=n(45470),x=n(30665),C=n(54043),E=n(87556);let k=async({text:e="",command:t,tone:n})=>{try{let r=await fetch(E.ns.aiText(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:e,command:t,tone:n})});if(!r.ok){let e=await r.text();throw console.error(e),Error("Failed to rewrite text")}return(await r.json()).response}catch(t){return console.error(t),e}},S=[{text:"friendly"},{text:"professional"},{text:"humorous"},{text:"formal"}],T=(0,i.Pi)(({store:e})=>{let t=e.selectedElements.length>0,[n,i]=r.useState(!1),[u,d]=r.useState(!1),[h,f]=r.useState(1),[p,m]=r.useState(""),[g,v]=r.useState(""),[E,T]=r.useState(!1),P=r.useRef(null),M=e.selectedElements.some(e=>!e.contentEditable);r.useEffect(()=>{u&&1===h&&setTimeout(()=>{var e;null===(e=P.current)||void 0===e||e.focus()},100)},[u,h]);let R=async(t,n)=>{i(!0);let r=e.selectedElements[0].id,a=e.selectedElements[0].text,o=await k({text:a,command:t,tone:n}),l=e.getElementById(r);l&&(l.set({text:o}),i(!1))},A=async()=>{T(!0),v(await k({command:"custom",text:e.selectedElements[0].text,tone:p})),T(!1),f(2)};return M?null:n?r.createElement(a.z,{icon:r.createElement(y.O,null),minimal:!0,text:"AI write",loading:!0}):r.createElement(r.Fragment,null,r.createElement(w.J,{disabled:!t,content:r.createElement(o.v,null,r.createElement(l.s,{text:(0,C.t)("toolbar.aiText.rewrite"),onClick:()=>{R("rewrite")}}),r.createElement(l.s,{text:(0,C.t)("toolbar.aiText.shorten"),onClick:()=>{R("shorten")}}),r.createElement(l.s,{text:(0,C.t)("toolbar.aiText.continue"),onClick:()=>{R("continue")}}),r.createElement(l.s,{text:(0,C.t)("toolbar.aiText.proofread"),onClick:()=>{R("proofread")}}),r.createElement("li",{className:"bp5-menu-header"},r.createElement("h6",{className:"bp5-heading"},(0,C.t)("toolbar.aiText.tones"))),S.map(e=>r.createElement(l.s,{key:e.text,text:(0,C.t)(`toolbar.aiText.${e.text}`),onClick:()=>{R("tone",e.text)}})),r.createElement(s.R,null),r.createElement(l.s,{text:(0,C.t)("toolbar.aiText.customPrompt"),onClick:e=>{e.preventDefault(),e.stopPropagation(),d(!0)}})),position:c.Ly.BOTTOM},r.createElement(a.z,{icon:r.createElement(y.O,null),minimal:!0,text:(0,C.t)("toolbar.aiText.aiWrite")})),r.createElement(x.V,{isOpen:u,onClose:()=>{E||(d(!1),f(1),m(""),v(""))},title:(0,C.t)(1===h?"toolbar.aiText.customPrompt":"toolbar.aiText.generatedResult")},1===h?r.createElement("div",{className:"bp5-dialog-body"},r.createElement(b,{inputRef:P,value:p,onChange:e=>m(e.target.value),placeholder:(0,C.t)("toolbar.aiText.promptPlaceholder"),fill:!0,disabled:E,style:{minHeight:100}}),r.createElement("div",{className:"bp5-dialog-footer"},r.createElement("div",{className:"bp5-dialog-footer-actions"},r.createElement(a.z,{onClick:()=>d(!1),text:(0,C.t)("toolbar.aiText.cancel"),disabled:E}),r.createElement(a.z,{intent:"primary",onClick:A,loading:E,disabled:!p,text:(0,C.t)("toolbar.aiText.generate")})))):r.createElement("div",{className:"bp5-dialog-body"},r.createElement(b,{value:g,onChange:e=>v(e.target.value),fill:!0,growVertically:!0,style:{minHeight:100}}),r.createElement("div",{className:"bp5-dialog-footer"},r.createElement("div",{className:"bp5-dialog-footer-actions"},r.createElement(a.z,{onClick:()=>f(1),text:(0,C.t)("toolbar.aiText.back"),disabled:E}),r.createElement(a.z,{onClick:A,text:(0,C.t)("toolbar.aiText.tryAgain"),loading:E}),r.createElement(a.z,{intent:"primary",onClick:()=>{let t=e.selectedElements[0].id,n=e.getElementById(t);n&&n.set({text:g}),d(!1),f(1),m(""),v("")},text:(0,C.t)("toolbar.aiText.insert"),disabled:E}))))))})},51413:function(e,t,n){"use strict";n.d(t,{ZP:function(){return nO}});var r,i,a,o,l,s,c,u,d,h,f,p=n(7653),m=n(2027),g=n(55918),v=n(52956),b=n(17785),y=n(45254),w=n.n(y),x=n(12131),C=n(84614),E=function(e){var t=e.className,n=e.tagName,r=(0,b._T)(e,["className","tagName"]),i=w()(x.dah,t);return p.createElement(void 0===n?"div":n,(0,b.pi)((0,b.pi)({},r),{className:i}))};E.displayName="".concat(C.g,".Divider");var k=n(43808),S=n(96283),T=n(38726),P=n(96834),M=n(2374),R=n(95975),A=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"undo",ref:t},e),p.createElement("path",{d:n?"M100 120C78 120 60 102 60 80C60 58 78 40 100 40S140 58 140 80C140 102 122 120 100 120zM280 300H68.2L114 345.8C117.8 349.4 120 354.4 120 360C120 371 111 380 100 380C94.4 380 89.4 377.8 85.8 374.2L5.8 294.2C2.2 290.6 0 285.6 0 280C0 274.4 2.2 269.4 5.8 265.8L85.8 185.8C89.4 182.2 94.4 180 100 180C111 180 120 189 120 200C120 205.6 117.8 210.6 114.2 214.2L68.2 260H280C324.2000000000001 260 360 224.2 360 180C360 135.8 324.2000000000001 100 280 100H180V60H280C346.2 60 400 113.8 400 180S346.2 300 280 300z":"M80 100C58 100 40 82 40 60S58 20 80 20S120 38 120 60S102 100 80 100zM220 240H68.2L94 265.8C97.8 269.4 100 274.4 100 280C100 291 91 300 80 300C74.4 300 69.4 297.8 65.8 294.2L5.8 234.2C2.2 230.6 0 225.6 0 220C0 214.4 2.2 209.4 5.8 205.8L65.8 145.8C69.4 142.2 74.4 140 80 140C91 140 100 149 100 160C100 165.6 97.8 170.6 94.2 174.2L68.2 200H220C253.2 200 280 173.2 280 140S253.2 80 220 80H14
5950V40H220C275.2 40 320 84.8 320 140S275.2 240 220 240z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});A.defaultProps={size:M.J.STANDARD},A.displayName="Blueprint5.Icon.Undo";var L=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"redo",ref:t},e),p.createElement("path",{d:n?"M394.2000000000001 294.2L314.2000000000001 374.2C310.6 377.8 305.6 380 300 380C289 380 280 371 280 360C280 354.4 282.2 349.4 285.8 345.8L331.8 300H120C53.8 300 0 246.2 0 180C0 113.8 53.8 60 120 60H220V100H120C75.8 100 40 135.8 40 180C40 224.2 75.8 260 120 260H331.8L286 214.2C282.2 210.6 280 205.6 280 200C280 189 289 180 300 180C305.6 180 310.6 182.2 314.2000000000001 185.8L394.2000000000001 265.8C397.8 269.4 400 274.4 400 280C400 285.6 397.8 290.6 394.2000000000001 294.2zM300 120C278 120 260 102 260 80S278 40 300 40S340 58 340 80S322 120 300 120z":"M240 100C218 100 200 82 200 60S218 20 240 20S280 38 280 60S262 100 240 100zM314.2000000000001 234.2L254.2 294.2C250.6 297.8 245.6 300 240 300C229 300 220 291 220 280C220 274.4 222.2 269.4 225.8 265.8L251.8 240H100C44.8 240 0 195.2 0 140S44.8 40 100 40H180V80H100C66.8 80 40 106.8 40 140S66.8 200 100 200H251.8L226 174.2C222.2 170.6 220 165.6 220 160C220 149 229 140 240 140C245.6 140 250.6 142.2 254.2 145.8L314.2000000000001 205.8C317.8 209.4 320 214.4 320 220C320 225.6 317.8 230.6 314.2000000000001 234.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});L.defaultProps={size:M.J.STANDARD},L.displayName="Blueprint5.Icon.Redo";let _=(0,m.Pi)(({store:e})=>p.createElement(g.w.Group,{align:v.v.LEFT,style:{paddingRight:"10px"}},p.createElement(T.z,{icon:p.createElement(A,null),minimal:!0,onClick:()=>{e.history.undo()},disabled:!e.history.canUndo,"aria-label":"Undo"}),p.createElement(T.z,{icon:p.createElement(L,null),minimal:!0,onClick:()=>{e.history.redo()},disabled:!e.history.canRedo,"aria-label":"Redo"})));var I=n(59162),O=n(50058),D=n(9065),z=n(45470),N=n(54064),F=n(59799),B=n(88876),H=n(20952),V=n(28969),j=n(86652),$=n(17610),U=n(31181),W=n(31907),G=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function q(e,t){if(e.length!==t.length)return!1;for(var n,r,i=0;i<e.length;i++)if(!((n=e[i])===(r=t[i])||G(n)&&G(r)))return!1;return!0}var Z=function(e,t){void 0===t&&(t=q);var n,r,i=[],a=!1;return function(){for(var o=[],l=0;l<arguments.length;l++)o[l]=arguments[l];return a&&n===this&&t(o,i)||(r=e.apply(this,o),a=!0,n=this,i=o),r}},X="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function Y(e){cancelAnimationFrame(e.id)}var K=-1;function J(e){if(void 0===e&&(e=!1),-1===K||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),K=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return K}var Q=null;function ee(e){if(void 0===e&&(e=!1),null===Q||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;i.width="100px",i.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?Q="positive-descending":(t.scrollLeft=1,Q=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t)}return Q}var et=function(e,t,n,r){var i,a,o;if("column"===e?(i=r.columnMetadataMap,a=t.columnWidth,o=r.lastMeasuredColumnIndex):(i=r.rowMetadataMap,a=t.rowHeight,o=r.lastMeasuredRowIndex),n>o){var l=0;if(o>=0){var s=i[o];l=s.offset+s.size}for(var c=o+1;c<=n;c++){var u=a(c);i[c]={offset:l,size:u},l+=u}"column"===e?r.lastMeasuredColumnIndex=n:r.lastMeasuredRowIndex=n}return i[n]},en=function(e,t){return e},er=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},ei=function(e,t,n){var r=e.itemSize,i=n.itemMetadataMap,a=n.lastMeasuredIndex;if(t>a){var o=0;if(a>=0){var l=i[a];o=l.offset+l.size}for(var s=a+1;s<=t;s++){var c=r(s);i[s]={offset:o,size:c},o+=c}n.lastMeasuredIndex=t}return i[t]},ea=(a=(r={getItemOffset:function(e,t){return t*e.itemSize},getItemSize:function(e,t){return e.itemSize},getEstimatedTotalSize:function(e){var t=e.itemCount;return e.itemSize*t},getOffsetForIndexAndAlignment:function(e,t,n,r,i,a){var o=e.direction,l=e.height,s=e.itemCount,c=e.itemSize,u=e.layout,d=e.width,h="horizontal"===o||"horizontal"===u?d:l,f=Math.max(0,s*c-h),p=Math.min(f,t*c),m=Math.max(0,t*c-h+c+a);switch("smart"===n&&(n=r>=m-h&&r<=p+h?"auto":"center"),n){case"start":return p;case"end":return m;case"center":var g=Math.round(m+(p-m)/2);if(g<Math.ceil(h/2))return 0;if(g>f+Math.floor(h/2))return f;return g;default:if(r>=m&&r<=p)return r;if(r<m)return m;return p}},getStartIndexForOffset:function(e,t){return Math.max(0,Math.min(e.itemCount-1,Math.floor(t/e.itemSize)))},getStopIndexForStartIndex:function(e,t,n){var r=e.direction,i=e.he
595ight,a=e.itemCount,o=e.itemSize,l=e.layout,s=e.width;return Math.max(0,Math.min(a-1,t+Math.ceil((("horizontal"===r||"horizontal"===l?s:i)+n-t*o)/o)-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}}).getItemOffset,o=r.getEstimatedTotalSize,l=r.getItemSize,s=r.getOffsetForIndexAndAlignment,c=r.getStartIndexForOffset,u=r.getStopIndexForStartIndex,d=r.initInstanceProps,h=r.shouldResetStyleCacheOnItemSizeChange,f=r.validateProps,(i=function(e){function t(t){var n;return(n=e.call(this,t)||this)._instanceProps=d(n.props,(0,U.Z)(n)),n._outerRef=void 0,n._resetIsScrollingTimeoutId=null,n.state={instance:(0,U.Z)(n),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof n.props.initialScrollOffset?n.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},n._callOnItemsRendered=void 0,n._callOnItemsRendered=Z(function(e,t,r,i){return n.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:r,visibleStopIndex:i})}),n._callOnScroll=void 0,n._callOnScroll=Z(function(e,t,r){return n.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:r})}),n._getItemStyle=void 0,n._getItemStyle=function(e){var t,r=n.props,i=r.direction,o=r.itemSize,s=r.layout,c=n._getItemStyleCache(h&&o,h&&s,h&&i);if(c.hasOwnProperty(e))t=c[e];else{var u=a(n.props,e,n._instanceProps),d=l(n.props,e,n._instanceProps),f="horizontal"===i||"horizontal"===s,p="rtl"===i,m=f?u:0;c[e]=t={position:"absolute",left:p?void 0:m,right:p?m:void 0,top:f?0:u,height:f?"100%":d,width:f?d:"100%"}}return t},n._getItemStyleCache=void 0,n._getItemStyleCache=Z(function(e,t,n){return{}}),n._onScrollHorizontal=function(e){var t=e.currentTarget,r=t.clientWidth,i=t.scrollLeft,a=t.scrollWidth;n.setState(function(e){if(e.scrollOffset===i)return null;var t=n.props.direction,o=i;if("rtl"===t)switch(ee()){case"negative":o=-i;break;case"positive-descending":o=a-r-i}return o=Math.max(0,Math.min(o,a-r)),{isScrolling:!0,scrollDirection:e.scrollOffset<o?"forward":"backward",scrollOffset:o,scrollUpdateWasRequested:!1}},n._resetIsScrollingDebounced)},n._onScrollVertical=function(e){var t=e.currentTarget,r=t.clientHeight,i=t.scrollHeight,a=t.scrollTop;n.setState(function(e){if(e.scrollOffset===a)return null;var t=Math.max(0,Math.min(a,i-r));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}},n._resetIsScrollingDebounced)},n._outerRefSetter=function(e){var t=n.props.outerRef;n._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},n._resetIsScrollingDebounced=function(){var e,t,r;null!==n._resetIsScrollingTimeoutId&&Y(n._resetIsScrollingTimeoutId),n._resetIsScrollingTimeoutId=(e=n._resetIsScrolling,t=X(),r={id:requestAnimationFrame(function n(){X()-t>=150?e.call(null):r.id=requestAnimationFrame(n)})})},n._resetIsScrolling=function(){n._resetIsScrollingTimeoutId=null,n.setState({isScrolling:!1},function(){n._getItemStyleCache(-1,null)})},n}(0,W.Z)(t,e),t.getDerivedStateFromProps=function(e,t){return er(e,t),f(e),null};var n=t.prototype;return n.scrollTo=function(e){e=Math.max(0,e),this.setState(function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},n.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,i=n.layout,a=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var o=0;if(this._outerRef){var l=this._outerRef;o="vertical"===i?l.scrollWidth>l.clientWidth?J():0:l.scrollHeight>l.clientHeight?J():0}this.scrollTo(s(this.props,e,t,a,this._instanceProps,o))},n.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var i=this._outerRef;"horizontal"===t||"horizontal"===r?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},n.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var a=this._outerRef;if("horizontal"===t||"horizontal"===n){if("rtl"===t)switch(ee()){case"negative":a.scrollLeft=-i;break;case"positive-ascending":a.scrollLeft=i;break;default:var o=a.clientWidth,l=a.scrollWidth;a.scrollLeft=l-o-i}else a.scrollLeft=i}else a.scrollTop=i}this._callPropsCallbacks()},n.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&Y(this._resetIsScrollingTimeoutId)},n.render=function(){var e=this.props,t=e.children,n=e.className,r=e.direction,i=e.he
595ight,a=e.innerRef,l=e.innerElementType,s=e.innerTagName,c=e.itemCount,u=e.itemData,d=e.itemKey,h=void 0===d?en:d,f=e.layout,m=e.outerElementType,g=e.outerTagName,v=e.style,b=e.useIsScrolling,y=e.width,w=this.state.isScrolling,x="horizontal"===r||"horizontal"===f,C=x?this._onScrollHorizontal:this._onScrollVertical,E=this._getRangeToRender(),k=E[0],S=E[1],T=[];if(c>0)for(var P=k;P<=S;P++)T.push((0,p.createElement)(t,{data:u,key:h(P,u),index:P,isScrolling:b?w:void 0,style:this._getItemStyle(P)}));var M=o(this.props,this._instanceProps);return(0,p.createElement)(m||g||"div",{className:n,onScroll:C,ref:this._outerRefSetter,style:(0,$.Z)({position:"relative",height:i,width:y,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:r},v)},(0,p.createElement)(l||s||"div",{children:T,ref:a,style:{height:x?"100%":M,pointerEvents:w?"none":void 0,width:x?M:"100%"}}))},n._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if("function"==typeof this.props.onScroll){var a=this.state,o=a.scrollDirection,l=a.scrollOffset,s=a.scrollUpdateWasRequested;this._callOnScroll(o,l,s)}},n._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,a=r.scrollDirection,o=r.scrollOffset;if(0===t)return[0,0,0,0];var l=c(this.props,o,this._instanceProps),s=u(this.props,l,o,this._instanceProps);return[Math.max(0,l-(i&&"backward"!==a?1:Math.max(1,n))),Math.max(0,Math.min(t-1,s+(i&&"forward"!==a?1:Math.max(1,n)))),l,s]},t}(p.PureComponent)).defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},i),eo=n(82054),el=n(94177),es=n(58051),ec=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"align-left",ref:t},e),p.createElement("path",{d:n?"M20 260H220C231 260 240 269 240 280C240 291 231 300 220 300H20C9 300 0 291 0 280C0 269 9 260 20 260zM20 340H380C391 340 400 349 400 360C400 371 391 380 380 380H20C9 380 0 371 0 360C0 349 9 340 20 340zM300 60H20C9 60 0 51 0 40C0 29 9 20 20 20H300C311 20 320 29 320 40C320 51 311 60 300 60zM380 220H20C9 220 0 211 0 200C0 189 9 180 20 180H380C391 180 400 189 400 200C400 211 391 220 380 220zM20 100H140C151 100 160 109 160 120C160 131 151 140 140 140H20C9 140 0 131 0 120C0 109 9 100 20 100z":"M260 60H20C9 60 0 51 0 40C0 29 9 20 20 20H260C271 20 280 29 280 40C280 51 271 60 260 60zM20 260H300C311 260 320 269 320 280C320 291 311 300 300 300H20C9 300 0 291 0 280C0 269 9 260 20 260zM20 200H180C191 200 200 209 200 220C200 231 191 240 180 240H20C9 240 0 231 0 220C0 209 9 200 20 200zM300 180H20C9 180 0 171 0 160C0 149 9 140 20 140H300C311 140 320 149 320 160C320 171 311 180 300 180zM20 80H100C111 80 120 89 120 100C120 111 111 120 100 120H20C9 120 0 111 0 100C0 89 9 80 20 80z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});ec.defaultProps={size:M.J.STANDARD},ec.displayName="Blueprint5.Icon.AlignLeft";var eu=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"align-center",ref:t},e),p.createElement("path",{d:n?"M100 300C89 300 80 291 80 280C80 269 89 260 100 260H300C311 260 320 269 320 280C320 291 311 300 300 300H100zM20 340H380C391 340 400 349 400 360C400 371 391 380 380 380H20C9 380 0 371 0 360C0 349 9 340 20 340zM260 100C271 100 280 109 280 120C280 131 271 140 260 140H140C129 140 120 131 120 120C120 109 129 100 140 100H260zM340 60H60C49 60 40 51 40 40C40 29 49 20 60 20H340C351 20 360 29 360 40C360 51 351 60 340 60zM380 220H20C9 220 0 211 0 200C0 189 9 180 20 180H380C391 180 400 189 400 200C400 211 391 220 380 220z":"M80 240C69 240 60 231 60 220C60 209 69 200 80 200H240C251 200 260 209 260 220C260 231 251 240 240 240H80zM20 260H300C311 260 320 269 320 280C320 291 311 300 300 300H20C9 300 0 291 0 280C0 269 9 260 20 260zM280 60H40C29 60 20 51 20 40C20 29 29 20 40 20H280C291 20 300 29 300 40C300 51 291 60 280 60zM300 180H20C9 180 0 171 0 160C0 149 9 140 20 140H300C311 140 320 149 320 160C320 171 311 180 300 180zM200 80C211 80 220 89 220 100C220 111 211 120 200 120H120C109 120 100 111 100 100C100 89 109 80 120 80H200z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});eu.defaultProps={size:M.J.STANDARD},eu.displayName="Blueprint5.Icon.AlignCenter";var ed=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"align-right",ref:t},e),p.createElement("path",{d:n?"M380 60H100C89 60 80 51 80 40C80 29 89 20 100 20H380C391 20 400 29 400 40C400 51 391 60 380 60zM20 340H380C391 340 400 349 400 360C400 371 391 380 380 380H20C9 380 0 371 0 360C0 349 9 340 20 340zM380 140H260C249 140 240 131 240 120C240 109 249 100 260 100H380C391 100 400 109 400 120C400 131 391 140 380 140zM380 220H20C9 220 0 211 0 200C0 189 9 180 20 180H380C391 180 400 189 400 200C400 211 391 220 380 220zM380 300H180C169 300 160 291 160 280C160 269 169 260 180 260H380C391 260 400 269 400 280C4
59500 291 391 300 380 300z":"M300 60.4H60C49 60.4 40 51.4 40 40.4C40 29.4 49 20.4 60 20.4H300C311 20.4 320 29.4 320 40.4C320 51.4 311 60.4 300 60.4zM20 260.4H300C311 260.4 320 269.4 320 280.4C320 291.4 311 300.4 300 300.4H20C9 300.4 0 291.4 0 280.4C0 269.2 9 260.4 20 260.4zM300 240.4H140C129 240.4 120 231.4 120 220.4C120 209.4 129 200.4 140 200.4H300C311 200.4 320 209.4 320 220.4C320 231.4 311 240.4 300 240.4zM300 120.4H220C209 120.4 200 111.4 200 100.4C200 89.4 209 80.4 220 80.4H300C311 80.4 320 89.4 320 100.4C320 111.4 311 120.4 300 120.4zM300 180.4H20C9 180.4 0 171.4 0 160.4C0 149.4 9 140.4 20 140.4H300C311 140.4 320 149.4 320 160.4C320 171.4 311 180.4 300 180.4z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});ed.defaultProps={size:M.J.STANDARD},ed.displayName="Blueprint5.Icon.AlignRight";var eh=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"align-justify",ref:t},e),p.createElement("path",{d:n?"M20 340H380C391 340 400 349 400 360C400 371 391 380 380 380H20C9 380 0 371 0 360C0 349 9 340 20 340zM380 60H20C9 60 0 51 0 40C0 29 9 20 20 20H380C391 20 400 29 400 40C400 51 391 60 380 60zM380 300H20C9 300 0 291 0 280C0 269 9 260 20 260H380C391 260 400 269 400 280C400 291 391 300 380 300zM380 220H20C9 220 0 211 0 200C0 189 9 180 20 180H380C391 180 400 189 400 200C400 211 391 220 380 220zM380 140H20C9 140 0 131 0 120C0 109 9 100 20 100H380C391 100 400 109 400 120C400 131 391 140 380 140z":"M300 60.4H20C9 60.4 0 51.4 0 40.4C0 29.4 9 20.4 20 20.4H300C311 20.4 320 29.4 320 40.4C320 51.4 311 60.4 300 60.4zM20 260.4H300C311 260.4 320 269.4 320 280.4C320 291.4 311 300.4 300 300.4H20C9 300.4 0 291.4 0 280.4C0 269.2 9 260.4 20 260.4zM300 180.4H20C9 180.4 0 171.4 0 160.4C0 149.4 9 140.4 20 140.4H300C311 140.4 320 149.4 320 160.4C320 171.4 311 180.4 300 180.4zM300 240.4H20C9 240.4 0 231.4 0 220.4C0 209.4 9 200.4 20 200.4H300C311 200.4 320 209.4 320 220.4C320 231.4 311 240.4 300 240.4zM300 120.4H20C9 120.4 0 111.4 0 100.4C0 89.4 9 80.4 20 80.4H300C311 80.4 320 89.4 320 100.4C320 111.4 311 120.4 300 120.4z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});eh.defaultProps={size:M.J.STANDARD},eh.displayName="Blueprint5.Icon.AlignJustify";var ef=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"bold",ref:t},e),p.createElement("path",{d:n?"M286 220C294 236 300 252 300 270C300 320 260 360 210 360H100C88 360 80 352 80 340V80C80 68 88 60 100 60H230C280 60 320 100 320 150C320 178 306 204 286 220zM140 300H210C226 300 240 286 240 270C240 254 226 240 210 240H140V300zM230 120H140V180H230C246 180 260 166 260 150C260 134 246 120 230 120z":"M234 180C238 188 240 200 240 210C240 212 240 216 240 218C240 220 240 220 240 220C240 222 240 224 238 226C238 226 238 228 238 228C228 258 202 280 170 280H80C70 280 60 272 60 260V60C60 50 68 40 80 40H180C224 40 260 76 260 120C260 144 250 166 234 180zM120 220H160C172 220 180 212 180 200S172 180 160 180H120V220zM180 100H120V140H180C192 140 200 132 200 120S192 100 180 100z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});ef.defaultProps={size:M.J.STANDARD},ef.displayName="Blueprint5.Icon.Bold";var ep=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"italic",ref:t},e),p.createElement("path",{d:n?"M234 320H280C292 320 300 328 300 340C300 352 292 360 280 360H140C128 360 120 352 120 340C120 328 128 320 140 320H184L146 100H100C88 100 80 92 80 80C80 68 88 60 100 60H240C252 60 260 68 260 80C260 92 252 100 240 100H196L234 320z":"M196 240H220C230 240 240 248 240 260C240 272 232 280 220 280H140C130 280 120 272 120 260C120 248 128 240 140 240H156L124 80H100C90 80 80 72 80 60C80 48 88 40 100 40H180C190 40 200 48 200 60C200 72 192 80 180 80H164L196 240z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});ep.defaultProps={size:M.J.STANDARD},ep.displayName="Blueprint5.Icon.Italic";var em=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"underline",ref:t},e),p.createElement("path",{d:n?"M200 60C266 60 320 114 320 180V330C320 346 306 360 290 360C274 360 260 346 260 330V180C260 146 234 120 200 120S140 146 140 180V330C140 346 126 360 110 360C94 360 80 346 80 330V180C80 114 134 60 200 60zM330 20H70C64 20 60 16 60 10C60 4 64 0 70 0H330C336 0 340 4 340 10C340 16 336 20 330 20z":"M160 40C216 40 260 84 260 140V260C260 272 252 280 240 280C228 280 220 272 220 260V140C220 106 194 80 160 80S100 106 100 140V260C100 272 92 280 80 280C68 280 60 272 60 260V140C60 84 104 40 160 40zM270 20H50C44 20 40 16 40 10C40 4 44 0 50 0H270C276 0 280 4 280 10C280 16 276 20 270 20z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});em.defaultProps={size:M.J.STANDARD},em.displayName="Blueprint5.Icon.Underline";var eg=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"strikethrough",ref:t},e),p.createElement("path",{d:n?"M360 220H270.8C268.2 221 265.6 222 262.8 222.8C259 223.8 252.6 225.6 243.6 227.8C234.6 230 225.6 232.4000000000001 216.2 234.8C206.8 237.2 198.4 239.4 190.8 241.4S178.8 244.6 177.8 244.8C167.2 247.8 158.8 252.2 152.4 258C146 263.6 142.6 271.6 142.6 281.8C142.6 289 144.4 295 147.8 299.8C151.2 304.6 155.6 308.4 160.8 311.2000000000001C166 314 171.8 316 178.2 317.2S190.8 319 196.8 319C214.6 319 229.4 315.2 241 307.6C250 301.6 256 292.4 258.8 280H311.4C310.2 290.4 307.4000000000001 299.6 303 308C297 319.4 288.8 329 278.4 336.6C268 344.4 256.2 350.2 242.6 354C228.6 358 214.2 360 198.8 360C185.6 360 172.6 358.4 159.6 355S135.2 346.4 125 339.6S106.6 323.8 100.4 313.2C94.2 302.8 91.2 290.2 91.2 275.8C91.2 268.4 92.2 261 94.2 253.8C96.2 246.6 99.8 239.8 104.8 233.4C108.4 228.6 113 224 118.6 220H40C29 220 20 211 20 200C20 189 29 180 40 180H242.8C243.2 179.8 243.8 179.6 244.2 179.6C250.2000000000001 177.4 255.8 173.8 261 168.6C266 163.4 268.6 155.2 268.6 144.4C268.6 139 267.4000000000001 133.8 265.2000000000001 128.6C263.0000000000001 123.4 259.4000000000001 118.8 254.4000000000001 114.8C249.4000000000001 110.8 243.0000000000001 107.6 235.0000000000001 105C227.0000000000001 102.4 217.4 101.2 206.2000000000001 101.2C195.8000000000001 101.2 186.0000000000001 102.4 177.2000000000001 104.6C168.2000000000001 106.8 160.4000000000001 110.4 153.4000000000001 115.4S141.2000000000001 126.6 137.4000000000001 134.4C136.4 136 135.6 138 135 140H82.2C84
595131.4 86.6 123.6 90.2 116.4C96.8 103.4 105.6 92.8 116.6 84.6C127.6 76.4 140.6 70.2000000000001 155.4 66.2C170.2000000000001 62.2 186 60.1999999999999 202.8 60.1999999999999C217.4 60.1999999999999 231.6 61.8 245.6 65.1999999999999C259.6 68.6 272.2000000000001 73.8 283.2 80.9999999999999C294.2000000000001 88.1999999999999 303 97.6 309.8 108.8C316.6 120 320 133.8 320 149.8C320 157.2 318.8 164.8 316.4 172.2C315.6 174.8 314.6 177.4 313.4 180H360C371 180 380 189 380 200C380 211 371 220 360 220z":"M280 180H173C165.4 181.8 158.4 183.6 152.2 185.2C146 186.8 142.4 187.8 141.4 188C132.8 190.2 125.6 193.8 120.4 198.4C115 203 112.4 209.4 112.4 217.4C112.4 223.2 113.8 228 116.6 231.8S123 238.6 127.4 241C131.8 243.2 136.6 244.8 141.8 245.8C147 246.8 152.2 247.2 157.2 247.2C172 247.2 184.4 244.2 194 238C200.4 234 205 228 207.6 220H252.0000000000001C250.8 226.6 248.6 232.8 245.6 238.4C240.6 247.4 233.8 255.2 225.2000000000001 261.4C216.6 267.6 206.6 272.2 195.4 275.4S171.8 280 159 280C148 280 137 278.6 126.4 276C115.6 273.4 106 269.2 97.4 263.6C89 258 82.2 251 77 242.6C71.8 234.2 69.2 224.2 69.2 212.6C69.2 206.6 70 200.8 71.8 195C73.4 189.8 76 184.8 79.6 180H40C29 180 20 171 20 160C20 149 29 140 40 140H182.6C187.6 138.6 192.4 137.2 196.8 135.6C201.8 133.8 206.4 131 210.8 126.8C215 122.6 217.2 116.2 217.2 107.4C217.2 103.2 216.2 98.8 214.4 94.8C212.6 90.6 209.6 86.9999999999999 205.4 83.8C201.2 80.6 195.8 78 189.2 75.9999999999999C182.6 73.9999999999999 174.6 72.9999999999999 165.2 72.9999999999999C156.4 72.9999999999999 148.4 73.9999999999999 141 75.8C133.6 77.5999999999999 127 80.6 121.2 84.4C115.4 88.3999999999999 111 93.3999999999999 107.8 99.5999999999999C107.6 99.6 107.6 99.8 107.4 100H62.8C64.2 94.6 66.2 89.6 68.6 85C74 74.6 81.4 66.2 90.6 59.4S110.6 47.8 123 44.6C135.2 41.6 148.4 40 162.4 40C174.6 40 186.4 41.4 198.2 44C209.8 46.6 220.4 50.8 229.4 56.6C238.6 62.4 246 69.8 251.6 78.8C257.2 87.8 260 98.8 260 111.6C260 117.6 259 123.6 257 129.6C256 133.4 254.4 136.8 252.6 140H280C291 140 300 149 300 160C300 171 291 180 280 180z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});eg.defaultProps={size:M.J.STANDARD},eg.displayName="Blueprint5.Icon.Strikethrough";var ev=n(1032),eb=n(87556),ey=n(95515),ew=n(64681),ex=n(53466),eC=n(88283),eE=n(54043),ek=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let eS=e=>{var{value:t,onValueChange:n}=e,r=ek(e,["value","onValueChange"]);let[i,a]=p.useState(t.toString());return p.useEffect(()=>{a(t.toString())},[t]),p.createElement(H.A,Object.assign({value:i,onValueChange:(e,t)=>
595{a(t),Number.isNaN(e)||n(e)}},r))},eT=(0,m.Pi)(({element:e,store:t,enabled:n})=>{let r=e.animations.find(e=>"enter"===e.type),i=e.animations.find(e=>"exit"===e.type);return n?p.createElement(V.h,{style:{width:"100%"}},p.createElement(T.z,{fill:!0,active:(null==r?void 0:r.enabled)&&!(null==i?void 0:i.enabled),onClick:()=>{t.history.transaction(()=>{e.setAnimation("enter",{enabled:!0}),e.setAnimation("exit",{enabled:!1})})}},"Enter"),p.createElement(T.z,{fill:!0,active:(null==r?void 0:r.enabled)&&(null==i?void 0:i.enabled),onClick:()=>{t.history.transaction(()=>{e.setAnimation("enter",{enabled:!0}),e.setAnimation("exit",{enabled:!0})})}},"Both"),p.createElement(T.z,{fill:!0,active:(null==i?void 0:i.enabled)&&!(null==r?void 0:r.enabled),onClick:()=>{t.history.transaction(()=>{e.setAnimation("enter",{enabled:!1}),e.setAnimation("exit",{enabled:!0})})}},"Exit")):null}),eP=(e,{handleClick:t,handleFocus:n,modifiers:r})=>r.matchesPredicate?p.createElement(O.s,{active:r.active,disabled:r.disabled,key:e,onClick:t,icon:"arrow-"+e,onFocus:n,roleStructure:"listoption",text:e,shouldDismissPopover:!1}):null,eM=["right","left","up","down","bottom-right","bottom-left","top-right","top-left"],eR=(0,m.Pi)(({value:e,onChange:t})=>p.createElement("div",{style:{paddingTop:"10px"}},p.createElement(eC.P,{items:eM,itemRenderer:eP,filterable:!1,activeItem:e,onItemSelect:e=>{t(e)}},p.createElement(T.z,{text:e,icon:"arrow-"+e,fill:!0})))),eA=(0,m.Pi)(({element:e,store:t})=>{let n=e.animations.find(e=>"enter"===e.type);return n?p.createElement("div",{style:{padding:"10px"}},p.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},p.createElement("div",null,"Delay"),p.createElement("div",null,p.createElement(eS,{value:parseFloat((n.delay/1e3).toFixed(2)),onValueChange:t=>{e.setAnimation("enter",{delay:1e3*t})},style:{width:"50px"},minorStepSize:.01,stepSize:.01,min:0,max:2.5,buttonPosition:"none"}))),p.createElement(j.i,{min:0,max:1e3,value:n.delay,showTrackFill:!1,labelRenderer:!1,onChange:t=>{e.setAnimation("enter",{delay:t})}})):null}),eL=(0,m.Pi)(({element:e,store:t})=>{let n=e.animations.find(e=>"enter"===e.type);return n?p.createElement("div",{style:{padding:"10px"}},p.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},p.createElement("div",null,"Duration"),p.createElement("div",null,p.createElement(eS,{value:parseFloat((n.duration/1e3).toFixed(2)),onValueChange:t=>{e.setAnimation("enter",{duration:1e3*t}),e.setAnimation("exit",{duration:1e3*t})},style:{width:"50px"},minorStepSize:.01,stepSize:.01,min:0,max:2.5,buttonPosition:"none"}))),p.createElement(j.i,{min:0,max:2500,value:n.duration,showTrackFill:!1,labelRenderer:!1,onChange:t=>{e.setAnimation("enter",{duration:t}),e.setAnimation("exit",{duration:t})}})):null});(0,m.Pi)(({element:e,store:t,elements:n})=>{var r,i;let a=n||[e],o=a[0],l=(o.type,o.type,o.type,(e,n)=>{t.history.transaction(()=>{a.forEach(t=>{t.setAnimation("enter",Object.assign({name:e},n)),t.setAnimation("exit",Object.assign(Object.assign({name:e},n),{from:n.to,to:n.from}))})}),n.enabled&&(t.play({animatedElementsIds:a.map(e=>e.id),currentTime:o.page.startTime}),setTimeout(()=>{t.stop()},1e3))}),s=(e,t)=>{var n;return!!((e?null===(n=o.animations)||void 0===n?void 0:n.filter(t=>t.name===e):o.animations)||[]).find(e=>e.enabled)};return p.createElement(z.J,{hasBackdrop:!1,autoFocus:!1,content:p.createElement("div",{style:{padding:"15px",paddingTop:"25px",width:"230px"}},p.createElement(ex.rs,{checked:s("fade"),label:(0,eE.t)("toolbar.fade"),onChange:e=>{l("fade",{enabled:e.target.checked})},alignIndicator:v.v.RIGHT}),p.createElement(ex.rs,{checked:s("move"),label:(0,eE.t)("toolbar.move"),onChange:e=>{l("move",{enabled:e.target.checked})},alignIndicator:v.v.RIGHT}),p.createElement(ex.rs,{checked:s("zoom"),label:(0,eE.t)("toolbar.zoom"),onChange:e=>{l("zoom",{enabled:e.target.checked})},alignIndicator:v.v.RIGHT}),p.createElement(eT,{element:o,store:t,enabled:s()}),s("move")&&p.createElement(eR,{value:(null===(i=null===(r=o.animations.find(e=>"move"===e.name))||void 0===r?void 0:r.data)||void 0===i?void 0:i.direction)||"right",onCh
595ange:e=>{l("move",{data:{direction:e},enabled:!0})}}),s()&&p.createElement(eA,{store:t,element:o}),s()&&p.createElement(eL,{store:t,element:o}),p.createElement(ex.rs,{checked:s("rotate"),label:(0,eE.t)("toolbar.rotate"),onChange:e=>{var n;n={enabled:e.target.checked},t.history.transaction(()=>{a.forEach(e=>{e.setAnimation("loop",Object.assign({name:"rotate"},n))})}),n.enabled&&(t.play({animatedElementsIds:a.map(e=>e.id),currentTime:o.page.startTime}),setTimeout(()=>{t.stop()},1e3))},alignIndicator:v.v.RIGHT})),position:B.Ly.BOTTOM},p.createElement(T.z,{text:(0,eE.t)("toolbar.animate"),minimal:!0}))});let e_=(0,m.Pi)(({element:e,store:t})=>e.contentEditable?p.createElement(T.z,{minimal:!0,text:(0,eE.t)("toolbar.animate"),onClickCapture:e=>{e.stopPropagation(),t.openSidePanel("animation")}}):null);var eI=n(87577),eO=n(27148),eD=n(73637),ez=n(8378),eN=n(23260),eF=n(36700),eB=n(93169),eH=n(84360),eV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let ej=(0,k.Z)("img")` 596 height: 20px; 597 598 .bp5-dark & { 599 filter: invert(1); 600 } 601`,e$=(0,ev.R7)(),eU=({fontFamily:e,handleClick:t,modifiers:n,store:r,isCustom:i})=>{let[a,o]=p.useState(!i);if(p.useEffect(()=>{a||r.loadFont(e)},[e,a]),"_divider"===e)return p.createElement("div",{style:{paddingTop:"10px"}},p.createElement(I.R,null));let l=a?p.createElement(ej,{src:(0,eb.$d)(e),alt:e,onError:()=>{o(!1)}}):e;return p.createElement(O.s,{text:l,active:n.active,disabled:n.disabled,onClick:t,style:{fontFamily:'"'+e+'"'}})},eW=({onChange:e,defaultValue:t})=>{let n=p.useRef(null);return p.useEffect(()=>{n.current&&n.current.focus()},[]),p.createElement(D.B,{leftIcon:p.createElement(el.o,null),inputRef:n,defaultValue:t,onChange:t=>e(t.target.value)})},eG=({store:e,fonts:t,activeFont:n,activeFontLabel:r,onFontSelect:i})=>{let[a,o]=p.useState(""),l=t.filter(e=>(null==e?void 0:e.toLowerCase().indexOf(a.toLowerCase()))>=0);return p.createElement(z.J,{content:p.createElement("div",null,p.createElement(eW,{onChange:e=>o(e),defaultValue:a}),p.createElement("div",{style:{paddingTop:"5px"}},p.createElement(ea,{innerElementType:p.forwardRef((e,t)=>p.createElement(N.v,Object.assign({ulRef:t},e))),height:Math.min(400,30*l.length)+10,width:210,itemCount:l.length,itemSize:30,children:({index:t,style:r})=>{let a=l[t];return p.createElement("div",{style:r},p.createElement(eU,{key:a,fontFamily:a,modifiers:{active:n===a},handleClick:()=>i(a),store:e,isCustom:e.fonts.find(e=>e.fontFamily===a)||ev.ER.find(e=>e.fontFamily===a)}))}})))},p.createElement(F.u,{content:(0,eE.t)("toolbar.fontFamily"),position:B.Ly.BOTTOM},p.createElement(T.z,{text:r,rightIcon:p.createElement(es.p,null),minimal:!0,style:{marginRight:"5px",fontFamily:'"'+n+'"',overflow:"hidden",whiteSpace:"nowrap",maxHeight:"30px"},"aria-label":(0,eE.t)("toolbar.fontFamily")})))},eq={},eZ=e=>eq[e]?Promise.resolve(eq[e]):fetch(e).then(e=>e.json()).then(t=>(eq[e]=t,t)),eX=(0,m.Pi)(({elements:e,store:t})=>{let{data:n,mutate:r}=(0,eo.ZP)((0,eb.aB)(),eZ,{isPaused:()=>(0,ev.Bp)(),fallbackData:[]});p.useEffect(()=>{r()},[(0,ev.Bp)()]);let i=t.fonts.concat(ev.ER).map(e=>e.fontFamily).concat((null==n?void 0:n.length)&&!(0,ev.Bp)()?n:e$),a=e[0].fontFamily;a.length>15&&(a=a.slice(0,15)+"...");let o=[];t.find(e=>("text"===e.type&&o.push(e.fontFamily),!1));let l=[...new Set(o.concat("_divider").concat(i))];return p.createElement(eG,{fonts:l,activeFont:e[0].fontFamily,activeFontLabel:a,store:t,onFontSelect:n=>{t.history.transaction(()=>{e.forEach(e=>{e.set({fontFamily:n})})})}})}),eY=(0,m.Pi)(({elements:e,store:t})=>{let[n,r]=p.useState(!1);return p.createElement(F.u,{content:(0,eE.t)("toolbar.fontSize"),position:B.Ly.BOTTOM,openOnTargetFocus:!1,disabled:n},p.createElement(H.A,{"aria-label":(0,eE.t)("toolbar.fontSize"),onFocus:()=>r(!0),onBlur:()=>r(!1),onValueChange:n=>{Number.isNaN(n)||t.history.transaction(()=>
601{e.forEach(e=>{e.set({fontSize:n,width:Math.max(n,e.width)})})})},value:Math.round(e[0].fontSize),style:{width:"50px"},min:5,max:4*t.height}))}),eK=["left","center","right","justify"],eJ=["top","middle","bottom"],eQ={top:p.createElement("span",{className:"bp5-icon"},p.createElement(eN,null)),middle:p.createElement("span",{className:"bp5-icon"},p.createElement(eF,null)),bottom:p.createElement("span",{className:"bp5-icon"},p.createElement(eB,null))},e0=(0,m.Pi)(({elements:e,store:t})=>{let n=e[0];return p.createElement(V.h,null,p.createElement(F.u,{content:(0,eE.t)("toolbar.textAlign"),position:B.Ly.BOTTOM},p.createElement(T.z,{minimal:!0,icon:"left"===n.align?p.createElement(ec,null):"center"===n.align?p.createElement(eu,null):"right"===n.align?p.createElement(ed,null):p.createElement(eh,null),onMouseDown:e=>{e.preventDefault()},onClick:()=>{let r=(eK.indexOf(n.align)+1+eK.length)%eK.length,i=eK[r];t.history.transaction(()=>{e.forEach(e=>{e.set({align:i})})})},"aria-label":(0,eE.t)("toolbar.textAlign")})),eH.flags.textVerticalResizeEnabled&&p.createElement(F.u,{content:(0,eE.t)("toolbar.verticalAlign"),position:B.Ly.BOTTOM},p.createElement(T.z,{minimal:!0,icon:eQ[n.verticalAlign],onMouseDown:e=>{e.preventDefault()},onClick:()=>{let r=(eJ.indexOf(n.verticalAlign)+1+eJ.length)%eJ.length,i=eJ[r];t.history.transaction(()=>{e.forEach(e=>{e.set({verticalAlign:i})})})},"aria-label":(0,eE.t)("toolbar.verticalAlign")})),p.createElement(F.u,{content:(0,eE.t)("toolbar.bold"),position:B.Ly.BOTTOM},p.createElement(T.z,{minimal:!0,icon:p.createElement(ef,null),active:"bold"===n.fontWeight||"700"===n.fontWeight,onMouseDown:e=>{e.preventDefault()},onClick:()=>{let r="bold"===n.fontWeight||"700"===n.fontWeight;t.history.transaction(()=>{e.forEach(e=>{r?e.set({fontWeight:"normal"}):e.set({fontWeight:"bold"})})})},"aria-label":(0,eE.t)("toolbar.bold")})),p.createElement(F.u,{content:(0,eE.t)("toolbar.italic"),position:B.Ly.BOTTOM},p.createElement(T.z,{minimal:!0,icon:p.createElement(ep,null),active:"italic"===n.fontStyle,onMouseDown:e=>{e.preventDefault()},onClick:()=>{let r="italic"===n.fontStyle;t.history.transaction(()=>{e.forEach(e=>{r?e.set({fontStyle:"normal"}):e.set({fontStyle:"italic"})})})},"aria-label":(0,eE.t)("toolbar.italic")})),p.createElement(F.u,{content:(0,eE.t)("toolbar.underline"),position:B.Ly.BOTTOM},p.createElement(T.z,{minimal:!0,icon:p.createElement(em,null),active:n.textDecoration.indexOf("underline")>=0,onMouseDown:e=>{e.preventDefault()},onClick:()=>{let r=n.textDecoration.split(" ");r.indexOf("underline")>=0?r=r.filter(e=>"underline"!==e):r.push("underline"),t.history.transaction(()=>{e.forEach(e=>{e.set({textDecoration:r.join(" ")})})})},"aria-label":(0,eE.t)("toolbar.underline")})),p.createElement(F.u,{content:(0,eE.t)("toolbar.strikethrough"),position:B.Ly.BOTTOM},p.createElement(T.z,{minimal:!0,icon:p.createElement(eg,null),active:n.textDecoration.indexOf("line-through")>=0,onMouseDown:e=>{e.preventDefault()},onClick:()=>{let r=n.textDecoration.split(" ");r.indexOf("line-through")>=0?r=r.filter(e=>"line-through"!==e):r.push("line-through"),t.history.transaction(()=>{e.forEach(e=>{e.set({textDecoration:r.join(" ")})})})},"aria-label":(0,eE.t)("toolbar.strikethrough")})))}),e1=(0,m.Pi)(({elements:e,store:t})=>p.createElement(V.h,null,p.createElement(F.u,{content:(0,eE.t)("toolbar.uppercase")},p.createElement(T.z,{variant:"minimal",active:"uppercase"==e[0].textTransform,icon:p.createElement(ez,{size:16,className:"bp5-icon"}),onMouseDown:e=>{e.preventDefault()},onClick:()=>{t.history.transaction(()=>{e.forEach(e=>{e.set({textTransform:"uppercase"===e.textTransform?"none":"uppercase"})})})}})))),e2=(0,m.Pi)(({elements:e,store:t})=>p.createElement(ey.ZP,{value:e[0].fill,style:{marginRight:"5px"},gradientEnabled:!0,onChange:n=>t.history.transaction(()=>{e.forEach(e=>{e.set({fill:n})})}),store:t})),e4=e=>{var{value:t,onValueChange:n}=e,r=eV(e,["value","onValueChange"]);let[i,a]=p.useState(t.toString());return p.useEffect(()=>{a(t.toString())},[t]),p.createElement(H.A,Object.assign({value:i,onValueChange:(e,t)=>
601{a(t),Number.isNaN(e)||n(e)}},r))},e3=(0,m.Pi)(({elements:e,store:t})=>{let n=e[0],r=n=>{t.history.transaction(()=>{e.forEach(e=>{e.set(n)})})},i="number"==typeof n.lineHeight?100*n.lineHeight:120;return p.createElement(z.J,{position:B.Ly.BOTTOM,content:p.createElement("div",{style:{padding:"15px",width:"230px"}},p.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},p.createElement("div",null,(0,eE.t)("toolbar.lineHeight")),p.createElement("div",null,p.createElement(e4,{value:Math.round(i),onValueChange:e=>{r({lineHeight:e/100})},style:{width:"50px"},min:50,max:250,buttonPosition:"none"}))),p.createElement(j.i,{value:Math.round(i),onChange:e=>{r({lineHeight:e/100})},min:50,max:250,stepSize:1,showTrackFill:!1,labelRenderer:!1}),p.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},p.createElement("div",null,(0,eE.t)("toolbar.letterSpacing")),p.createElement("div",null,p.createElement(e4,{value:Math.round(100*n.letterSpacing),onValueChange:e=>{r({letterSpacing:e/100})},style:{width:"50px"},min:-50,max:250,buttonPosition:"none"}))),p.createElement(j.i,{value:Math.round(100*n.letterSpacing),onChange:e=>{r({letterSpacing:e/100})},min:-50,max:250,stepSize:1,showTrackFill:!1,labelRenderer:!1}))},p.createElement(F.u,{content:(0,eE.t)("toolbar.spacing"),position:B.Ly.BOTTOM},p.createElement(T.z,{icon:p.createElement(eD,{className:"bp5-icon",style:{fontSize:"20px"}}),minimal:!0,"aria-label":(0,eE.t)("toolbar.spacing")})))}),e8={TextFontFamily:eX,TextFontSize:eY,TextFontVariant:e0,TextTransform:e1,TextFill:e2,TextSpacing:e3,TextAiWrite:eO.i,TextFilters:ew.ZP,TextAnimations:e_},e6=(0,m.Pi)(({store:e,components:t})=>{let n=e.selectedElements,r=["TextFill","TextFontFamily","TextFontSize","TextFontVariant","TextSpacing","TextTransform","TextFilters",eH.flags.animationsEnabled&&"TextAnimations",eH.flags.aiTextEnabled&&"TextAiWrite"],i=(0,eI.m)({type:"text",usedItems:r,components:t});return p.createElement(eI.F,{items:i,itemRender:r=>{let i=t[r]||e8[r];return p.createElement(i,{elements:n,element:n[0],store:e,key:r})}})});var e5=n(59533),e9=n(82642),e7=n(64852),te=n(34136),tt=n(92256),tn=n(79387);let tr=({html:e})=>{let t=document.createElement("div");document.body.appendChild(t),t.style.display="none",t.style.whiteSpace="pre-wrap";let n=(0,tn.l6)(t);return(0,tn.mq)(n,e),n},ti=e=>{e.root.parentElement.remove()},ta=["left","center","right","justify"],to=["top","middle","bottom"],tl={top:p.createElement("span",{className:"bp5-icon"}
601,p.createElement(eN,null)),middle:p.createElement("span",{className:"bp5-icon"},p.createElement(eF,null)),bottom:p.createElement("span",{className:"bp5-icon"},p.createElement(eB,null))},ts=(0,m.Pi)(({active:e,globalActive:t,format:n,element:r,disableGlobal:i,enableGlobal:a,icon:o,ariaLabel:l,tooltipContent:s})=>{let c=s||l||n;return p.createElement(F.u,{content:c,position:B.Ly.BOTTOM},p.createElement(T.z,{minimal:!0,icon:o,active:e,"aria-label":c,onMouseDown:e=>{e.preventDefault()},onClick:e=>{let o=window.__polotnoQuill,l=tn.jY.currentFormat;if(o){let e=o.getSelection();return e.length>0?o.formatText(e.index,e.length,n,!l[n],"user"):o.format(n,!l[n],"user"),(0,e5.z)(()=>{tn.jY.currentFormat=o.getFormat(o.getSelection())}),void(t&&i())}(o=tr({html:r.text})).setSelection(0,o.getLength(),"api"),o.format(n,!1);let s=o.root.innerHTML;ti(o),r.set({text:s}),t?i():a()}}))}),tc=(0,m.Pi)(({element:e,store:t})=>{let n=tn.jY.currentFormat;return p.createElement(ts,{format:"bold",active:n.bold||"bold"===e.fontWeight||"700"===e.fontWeight,globalActive:"bold"===e.fontWeight||"700"===e.fontWeight,element:e,disableGlobal:()=>e.set({fontWeight:"normal"}),enableGlobal:()=>e.set({fontWeight:"bold"}),icon:p.createElement(ef,null),tooltipContent:(0,eE.t)("toolbar.bold")})}),tu=(0,m.Pi)(({element:e,store:t,elements:n,components:r})=>{let i=(null==r?void 0:r.TextBold)||tc,a=tn.jY.currentFormat;return p.createElement(V.h,null,p.createElement(i,{element:e,store:t}),p.createElement(ts,{format:"italic",active:a.italic||"italic"===e.fontStyle,globalActive:"italic"===e.fontStyle,element:e,disableGlobal:()=>e.set({fontStyle:"normal"}),enableGlobal:()=>e.set({fontStyle:"italic"}),icon:p.createElement(ep,null),tooltipContent:(0,eE.t)("toolbar.italic")}),p.createElement(ts,{format:"underline",active:a.underline||e.textDecoration.indexOf("underline")>=0,globalActive:e.textDecoration.indexOf("underline")>=0,element:e,disableGlobal:()=>{let t=e.textDecoration.split(" ");t=t.filter(e=>"underline"!==e),e.set({textDecoration:t.join(" ")})},enableGlobal:()=>{let t=e.textDecoration.split(" ");t.push("underline"),e.set({textDecoration:t.join(" ")})},icon:p.createElement(em,null),tooltipContent:(0,eE.t)("toolbar.underline")}),p.createElement(ts,{format:"strike",active:a.strike||e.textDecoration.indexOf("line-through")>=0,globalActive:e.textDecoration.indexOf("line-through")>=0,element:e,disableGlobal:()=>{let t=e.textDecoration.split(" ");t=t.filter(e=>"line-through"!==e),e.set({textDecoration:t.join(" ")})},enableGlobal:()=>{let t=e.textDecoration.split(" ");t.push("line-through"),e.set({textDecoration:t.join(" ")})},icon:p.createElement(eg,null),tooltipContent:(0,eE.t)("toolbar.strikethrough")}),p.createElement(F.u,{content:(0,eE.t)("toolbar.textAlign"),position:B.Ly.BOTTOM},p.createElement(T.z,{minimal:!0,icon:"left"===e.align?p.createElement(ec,null):"center"===e.align?p.createElement(eu,null):"right"===e.align?p.createElement(ed,null):p.createElement(eh,null),onClick:()=>{let r=(ta.indexOf(e.align)+1+ta.length)%ta.length,i=ta[r];t.history.transaction(()=>{n.forEach(e=>{e.set({align:i})})})},"aria-label":(0,eE.t)("toolbar.textAlign")})),eH.flags.textVerticalResizeEnabled&&p.createElement(F.u,{content:(0,eE.t)("toolbar.verticalAlign"),position:B.Ly.BOTTOM},p.createElement(T.z,{minimal:!0,icon:tl[e.verticalAlign],onClick:()=>{let n=(to.indexOf(e.verticalAlign)+1+to.length)%to.length,r=to[n];t.history.transaction(()=>{e.set({verticalAlign:r})})},"aria-label":(0,eE.t)("toolbar.verticalAlign")})),p.createElement(F.u,{content:(0,eE.t)("toolbar.listFormat"),position:B.Ly.BOTTOM},p.createElement(T.z,{minimal:!0,icon:"bullet"===a.list?p.createElement("span",{className:"bp5-icon"}
601,p.createElement(tt,{style:{width:"20px",height:"20px"}})):p.createElement("span",{className:"bp5-icon"},p.createElement(te,{style:{width:"20px",height:"20px"}})),onMouseDown:e=>{e.preventDefault()},onClick:()=>{let t=window.__polotnoQuill,n=!t;t=t||tr({html:e.text}),n&&t.setSelection(0,t.getLength(),"api");let r=t.getFormat();r.list?"bullet"===r.list?t.format("list","ordered"):t.format("list",!1):t.format("list","bullet"),n&&(e.set({text:t.root.innerHTML}),ti(t))},"aria-label":(0,eE.t)("toolbar.listFormat")})))}),td=(0,m.Pi)(({element:e,store:t})=>{let[n,r]=p.useState(null),i=tn.jY.currentFormat;return p.createElement(ey.ZP,{value:i.color||e.fill,gradientEnabled:!0,onOpen:()=>{let e=window.__polotnoQuill;e&&r(e.getSelection())},onClose:()=>{let e=window.__polotnoQuill;e&&e.setSelection(n)},onChange:t=>{let r=window.__polotnoQuill,i=(null==r?void 0:r.getSelection())||n;if(!i){var a=e.text.replace(/style=".*?"/g,"");return void e.set({fill:t,text:a})}let o=(null==i?void 0:i.length)>=(null==r?void 0:r.getLength())-1;r&&!o&&(null==i?void 0:i.length)?r.formatText(i.index,i.length,"color",t,"user"):(a=e.text.replace(/style=".*?"/g,""),e.set({fill:t,text:a}))},store:t})}),th=(0,m.Pi)(({element:e})=>{let t="rtl"===e.dir?e9:e7,n=(0,eE.t)("toolbar.textDirection");return p.createElement(F.u,{content:n,position:B.Ly.BOTTOM},p.createElement(T.z,{icon:p.createElement(t,{className:"bp5-icon",style:{fontSize:"20px"}}),minimal:!0,onClick:()=>{e.set({dir:"rtl"===e.dir?"ltr":"rtl"})},"aria-label":n}))}),tf={TextFontFamily:eX,TextFontSize:eY,TextFontVariant:tu,TextTransform:e1,TextFilters:ew.ZP,TextFill:td,TextSpacing:e3,TextDirection:th,TextAnimations:e_,TextAiWrite:eO.i},tp=(0,m.Pi)(({store:e,components:t})=>{let n=e.selectedElements,r=e.selectedElements[0],i=["TextFill","TextFontFamily","TextFontSize","TextFontVariant","TextSpacing","TextTransform","TextFilters",eH.flags.animationsEnabled&&"TextAnimations","TextAiWrite"],a=(0,eI.m)({type:"text",usedItems:i,components:t});return p.createElement(eI.F,{items:a,itemRender:i=>{if("TextBold"===i)return null;let a=t[i]||tf[i];return p.createElement(a,{element:r,elements:n,store:e,key:i,components:t})}})});var tm=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"crop",ref:t},e),p.createElement("path",{d:n?"M280 20C280 8.954 288.954 0 300 0C311.046 0 320 8.954 320 20L320 80L380 80C391.046 80 400 88.954 400 100C400 111.046 391.046 120 380 120L120 120L120 380.00002C120 391.04574 111.0458 400.0000252612 100 400.0000262268C88.9544 400.0000271924 80 391.04576 80 380.00002L80 320L20 320C8.95434 320 0.0000271924 311.0458 0.0000262268 300C0.0000252612 288.9544 8.95434 280 20 280L80 280L80 100C80 88.954 88.9544 80 100 80L280 80L280 20zM300 320L160 320L160 280L280 280L280 160L320 160L320 300.0002C320 311.0458 311.046 320 300 320zM0 400H400V0H0V400z":"M220 20C220 8.954 228.954 0 240 0C251.046 0 260 8.954 260 20V60H300C311.046 60 320 68.954 320 80C320 91.046 311.046 100 300 100H100.0002V300C100.0002 311.0457 91.0458 319.999999034354 80.0002 320C68.9544 320.000000965646 60.0002 311.04568 60.0002 300L60.0002 260L20.0002 260C8.95444 260 0.0001154066 251.0456 0.000152588 240C0.0001516224 228.9542 8.95444 220 20.0002 220L60.0002 220L60.0002 80C60.0002 68.954 68.9544 60 80.0002 60H220V20zM240 260.0002L120.0002 260.0002V220.0002L220 220.0002L220 120H260L260 240.0002C260 251.0458 251.046 260.0002 240 260.0002z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});tm.defaultProps={size:M.J.STANDARD},tm.displayName="Blueprint5.Icon.Crop";var tg=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"tick",ref:t},e),p.createElement("path",{d:n?"M340 320C334.4 320 329.4 317.8 325.8 314.2L140 128.2L74.2 194C70.6 197.8 65.6 200 60 200C49 200 40 191 40 180C40 174.4 42.2 169.4 45.8 165.8L125.8 85.8C129.4 82.2 134.4 80 140 80S150.6 82.2 154.2 85.8L354.2000000000001 285.8C357.8 289.4 360 294.4 360 300C360 311 351 320 340 320z":"M280 260C274.4000000000001 260 269.4000000000001 257.8 265.8 254.2L120 108.2L54.2 174.2C50.6 177.8 45.
6016 180 40 180C29 180 20 171 20 160C20 154.4 22.2 149.4 25.8 145.8L105.8 65.8C109.4 62.2 114.4 60 120 60S130.6 62.2 134.2 65.8L294.2000000000001 225.8C297.8 229.4 300 234.4 300 240C300 251 291 260 280 260z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});tg.defaultProps={size:M.J.STANDARD},tg.displayName="Blueprint5.Icon.Tick";var tv=n(31821),tb=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"arrows-horizontal",ref:t},e),p.createElement("path",{d:n?"M394 214L294 314C290 318 286 320 280 320C268 320 260 312 260 300C260 294 262 290 266 286L332 220H68L134 286C138 290 140 294 140 300C140 312 132 320 120 320C114 320 110 318 106 314L6 214C2 210 0 206 0 200S2 190 6 186L106 86C110 82 114 80 120 80C132 80 140 88 140 100C140 106 138 110 134 114L68 180H332L266 114C262 110 260 106 260 100C260 88 268 80 280 80C286 80 290 82 294 86L394 186C398 190 400 194 400 200S398 210 394 214L394 214z":"M314 174L234 254C230 258 226 260 220 260C208 260 200 250 200 240C200 234 202 230 206 226L252.0000000000001 180H68L114 226C118 230 120 234 120 240C120 250 112 260 100 260C94 260 90 258 86 254L6 174C2 170 0 166 0 160S2 150 6 146L86 66C90 62 94 60 100 60C112 60 120 68 120 80C120 86 118 90 114 94L68 140H252L206 94C202 90 200 86 200 80C200 68 208 60 220 60C226 60 230 62 234 66L314 146C318 150 320 154 320 160S318 170 314 174L314 174z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});tb.defaultProps={size:M.J.STANDARD},tb.displayName="Blueprint5.Icon.ArrowsHorizontal";var ty=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"arrows-vertical",ref:t},e),p.createElement("path",{d:n?"M300 140C294 140 290 138 286 134L220 68V332L286 266C290 262 294 260 300 260C312 260 320 268 320 280C320 286 318 290 314 294L214 394C210 398 206 400 200 400S190 398 186 394L86 294C82 290 80 286 80 280C80 268 88 260 100 260C106 260 110 262 114 266L180 332V68.0000000000001L114 134.0000000000001C110 138 106 140 100 140C88 140 80 132 80 120C80 114 82 110 86 106L186 6C190 2 194 0 200 0S210 2 214 6L314 106C318 110 320 114 320 120C320 130 312 140 300 140L300 140z":"M240 120C234 120 230 118 226 114L180 68V252L226 206C230 202 234 200 240 200C252 200 260 208 260 220C260 226 258 230 254 234L174 314C170 318 166 320 160 320S150 318 146 314L66 234C62 230 60 226 60 220C60 208 70 200 80 200C86 200 90 202 94 206L140 252V68L94 114C90 118 86 120 80 120C70 120 60 112 60 100C60 94 62 90 66 86L146 6C150 2 154 0 160 0S170 2 174 6L254 86C258 90 260 94 260 100C260 112 252 120 240 120L240 120z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});ty.defaultProps={size:M.J.STANDARD},ty.displayName="Blueprint5.Icon.ArrowsVertical";var tw=({element:e,elements:t})=>p.createElement(z.J,{content:p.createElement(N.v,null,p.createElement(O.s,{shouldDismissPopover:!1,icon:p.createElement(tb,null),text:(0,eE.t)("toolbar.flipHorizontally"),onClick:()=>{t.forEach(e=>{e.set({flipX:!e.flipX})})}}),p.createElement(O.s,{shouldDismissPopover:!1,text:(0,eE.t)("toolbar.flipVertically"),icon:p.createElement(ty,null),onClick:()=>{t.forEach(e=>{e.set({flipY:!e.flipY})})}})),position:B.Ly.BOTTOM},p.createElement(T.z,{text:(0,eE.t)("toolbar.flip"),minimal:!0})),tx=n(30665);let tC=async e=>{let t=await fetch((0,eb.X1)(),{method:"POST",body:JSON.stringify({url:e})});return 200!==t.status?(alert((0,eE.t)("error.removeBackground")),e):(await t.json()).url},tE=(0,m.Pi)(({isOpen:e,onClose:t,element:n})=>{let[r,i]=p.useState(n.src);p.useEffect(()=>{i(n.src)},[n.src]);let[a,o]=p.useState(!1),l=r!==n.src;return p.createElement(tx.V,{onClose:t,title:(0,eE.t)("toolbar.removeBackgroundTitle"),isOpen:e,style:{width:"80%",maxWidth:"700px"}},p.createElement("div",{className:x.TmF},p.createElement("img",{src:r,style:{width:"100%",maxHeight:"400px",objectFit:"contain"}})),p.createElement("div",{className:x.Alt,style:{position:"relative"}}
601,p.createElement("div",{className:x.e$L},!l&&p.createElement(T.z,{onClick:async()=>{o(!0);try{i(await tC(n.src))}catch(e){console.error(e)}o(!1)},loading:a},(0,eE.t)("toolbar.removeBackground")),l&&p.createElement(p.Fragment,null,p.createElement(T.z,{onClick:()=>{i(n.src),t()},loading:a},(0,eE.t)("toolbar.cancelRemoveBackground")),p.createElement(T.z,{onClick:()=>{n.set({src:r}),t()},loading:a,intent:"primary"},(0,eE.t)("toolbar.confirmRemoveBackground"))))))});var tk=n(9051);let tS=(0,m.Pi)(({element:e,store:t,elements:n})=>e.contentEditable?e.clipSrc?p.createElement(T.z,{text:(0,eE.t)("toolbar.removeClip"),minimal:!0,onClickCapture:e=>{n.forEach(e=>{e.set({clipSrc:""})})}}):p.createElement(T.z,{minimal:!0,text:(0,eE.t)("toolbar.clip"),onClickCapture:e=>{e.stopPropagation(),t.openSidePanel("image-clip")}}):null),tT=(0,m.Pi)(({element:e,store:t})=>e.contentEditable?e.stretchEnabled?null:p.createElement(F.u,{content:(0,eE.t)("toolbar.crop"),position:"bottom"},p.createElement(T.z,{minimal:!0,icon:p.createElement(tm,null),onClickCapture:t=>{t.stopPropagation(),e.toggleCropMode(!0)},"aria-label":(0,eE.t)("toolbar.crop")})):null);(0,m.Pi)(({element:e,store:t})=>e.clipSrc?p.createElement(T.z,{text:(0,eE.t)("toolbar.removeClip"),minimal:!0,onClickCapture:t=>{e.set({clipSrc:""})}}):null);let tP={ImageFlip:tw,ImageFilters:ew.ZP,ImageFitToBackground:({element:e})=>p.createElement(T.z,{text:(0,eE.t)("toolbar.fitToBackground"),minimal:!0,onClick:async()=>{let{page:t}=e,n=t.computedWidth+2*t.bleed,r=t.computedHeight+2*t.bleed,i=await (0,tk.Ad)(e.src),a=e.stretchEnabled?{cropX:0,cropY:0,cropWidth:1,cropHeight:1}:(0,tk.EH)({width:n,height:r},i);e.set(Object.assign({x:-t.bleed,y:-t.bleed,width:n,height:r,rotation:0},a))}}),ImageCrop:tT,ImageClip:tS,ImageRemoveBackground:({element:e})=>{let[t,n]=p.useState(!1);return p.createElement(p.Fragment,null,p.createElement(T.z,{text:(0,eE.t)("toolbar.removeBackground"),minimal:!0,onClick:e=>{n(!0)}}),p.createElement(tE,{isOpen:t,onClose:()=>{n(!1)},element:e}))},ImageAnimations:e_},tM=(0,m.Pi)(({store:e,components:t})=>{let n=e.selectedElements[0],r=n._cropModeEnabled,i=p.useRef({});p.useEffect(()=>{r&&(i.current={x:n.x,y:n.y,width:n.width,height:n.height,cropX:n.cropX,cropY:n.cropY,cropWidth:n.cropWidth,cropHeight:n.cropHeight})},[r]);let a=["ImageFlip","ImageFilters","ImageFitToBackground","ImageClip","ImageCrop",eH.flags.animationsEnabled&&"ImageAnimations",eH.flags.removeBackgroundEnabled&&"ImageRemoveBackground"],o=(0,eI.m)({type:"image",usedItems:a,components:t});return p.createElement(p.Fragment,null,!r&&p.createElement(eI.F,{items:o,itemRender:r=>{let i=t[r]||tP[r];return p.createElement(i,{element:n,store:e,key:r,elements:e.selectedElements})}}),r&&p.createElement(g.w.Group,null,p.createElement(T.z,{text:(0,eE.t)("toolbar.cropDone"),minimal:!0,icon:p.createElement(tg,null),onClickCapture:e=>{n.toggleCropMode(!1)}}),p.createElement(T.z,{text:(0,eE.t)("toolbar.cropCancel"),minimal:!0,icon:p.createElement(tv.X,null),onClickCapture:e=>{n.set(Object.assign({},i.current)),n.toggleCropMode(!1)}})))});var tR=n(72365);let tA=(e,t)=>Array.from(e.keys()).find(e=>tR.mf(e,t)),tL=(e,t)=>{let n=tA(e,t);return e.get(n||"")||t},t_={SvgFlip:tw,SvgFilters:ew.ZP,SvgColors:(0,m.Pi)(({element:e,elements:t,store:n})=>{let r=tR.rr(e.src);return p.createElement(p.Fragment,null,!e.maskSrc&&r.slice(0,5).map(t=>p.createElement(ey.ZP,{key:t,value:tL(e.colorsReplace,t),style:{marginLeft:"5px"},onChange:n=>{let r=tA(e.colorsReplace,t)||t;e.replaceColor(r,n)},store:n,gradientEnabled:!0})))}),SvgAnimations:e_},tI=(0,m.Pi)(({store:e,hideSvgEffects:t,components:n})=>{let r=e.selectedElements,i=["SvgFlip",!t&&"SvgFilters","SvgColors",eH.flags.animationsEnabled&&"SvgAnimations"].filter(e=>!!e),a=(0,eI.m)({type:"svg",usedItems:i,components:n});return p.createElement(eI.F,{items:a,itemRender:t=>{let i=n[t]||t_[t];return p.createElement(i,{elements:r,element:r[0],store:e,key:t})}})});var tO=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"settings",ref:t},e),p.createElement("path",{d:n?"M80 380C80 391 71 400 60 400S40 391 40 380V280H80V380zM40 20C40 9 49 0 60 0S80 9 80 20V140H40V20zM220 380C220 391 211 400 200 400S180 391 180 380V220H220V380zM360 380C360 391 351 400 340 400S320 391 320 380V320H360V380zM180 20C180 9 189 0 200 0S220 9 220 20V80H180V20zM360 300H320C309 300 300 291 300 280V220C300 209 309 200 320 200H360C371 200 380 209 380 220V280C380 291 371 300 360 300zM320 20C320 9 329 0 340 0S360 9 360 20V180H320V20zM80 260H40C29 260 20 251 20 240V180C20 169 29 160 40 160H80C91 160 100 169
601100 180V240C100 251 91 260 80 260zM220 200H180C169 200 160 191 160 180V120C160 109 169 100 180 100H220C231 100 240 109 240 120V180C240 191 231 200 220 200z":"M60 300C60 311 51 320 40 320S20 311 20 300V240H60V300zM60 220H20C9 220 0 211 0 200V160C0 149 9 140 20 140H60C71 140 80 149 80 160V200C80 211 71 220 60 220zM300 300C300 311 291 320 280 320S260 311 260 300V260H300V300zM180 300C180 311 171 320 160 320S140 311 140 300V180H180V300zM20 20C20 9 29 0 40 0S60 9 60 20V120H20V20zM300 240H260C249 240 240 231 240 220V180C240 169 249 160 260 160H300C311 160 320 169 320 180V220C320 231 311 240 300 240zM260 20C260 9 269 0 280 0S300 9 300 20V140H260V20zM180 160H140C129 160 120 151 120 140V100C120 89 129 80 140 80H180C191 80 200 89 200 100V140C200 151 191 160 180 160zM140 20C140 9 149 0 160 0S180 9 180 20V60H140V20z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});tO.defaultProps={size:M.J.STANDARD},tO.displayName="Blueprint5.Icon.Settings";var tD=n(24110);let tz=(0,m.Pi)(({store:e,elements:t})=>{let n=n=>{e.history.transaction(()=>{t.forEach(e=>{e.set(n)})})},r=n=>{e.history.transaction(()=>{t.forEach(e=>{let{middleLeft:t,middleRight:r}=(0,tD.jb)(e),{x:i,y:a,rotation:o}=(0,tD.hs)(t,r,n);e.set({x:i,y:a,rotation:o,height:n})})})};return p.createElement(z.J,{position:B.Ly.BOTTOM,content:p.createElement("div",{style:{padding:"15px",paddingTop:"15px",width:"230px"}},p.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"5px"}},p.createElement("div",null,(0,eE.t)("toolbar.lineSize")),p.createElement("div",null,p.createElement(ew.Y2,{value:t[0].height,onValueChange:e=>{r(e)},style:{width:"50px"},min:1,max:100,buttonPosition:"none"}))),p.createElement(j.i,{value:t[0].height,onChange:e=>{r(e)},min:1,max:100,labelRenderer:!1}),p.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"5px",paddingTop:"15px"}},p.createElement(T.z,{onClick:()=>{n({dash:[]})},active:0===t[0].dash.length},p.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},p.createElement("line",{x2:"24",y1:"50%",y2:"50%",stroke:"currentColor",strokeWidth:"2"}))),p.createElement(T.z,{onClick:()=>{n({dash:[4,1]})},active:4===t[0].dash[0]},p.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},p.createElement("line",{x1:"-1",x2:"25",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"12 2",strokeWidth:"2"}))),p.createElement(T.z,{onClick:()=>{n({dash:[2,1]})},active:2===t[0].dash[0]},p.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},p.createElement("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"6 2",strokeWidth:"2"}))),p.createElement(T.z,{onClick:()=>{n({dash:[1,1]})},active:1===t[0].dash[0]},p.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},p.createElement("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"2 2",strokeWidth:"2"})))))},p.createElement(F.u,{content:(0,eE.t)("toolbar.lineStyle"),position:B.Ly.BOTTOM},p.createElement(T.z,{icon:p.createElement(tO,null),minimal:!0,"aria-label":(0,eE.t)("toolbar.lineStyle")})))}),tN=(0,m.Pi)(({elements:e,store:t})=>p.createElement(ey.ZP,{value:e[0].color,style:{marginRight:"5px"},gradientEnabled:!1,onChange:n=>t.history.transaction(()=>{e.forEach(e=>{e.set({color:n})})}),store:t})),tF={"":p.createElement("span",{"aria-hidden":"true",className:"bp5-icon"}
601,p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16"},p.createElement("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 16 8"}))),arrow:p.createElement("span",{"aria-hidden":"true",className:"bp5-icon"},p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16"},p.createElement("path",{stroke:"currentColor",strokeWidth:"2",d:"M 8 3 L 1 8 L 8 13",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),p.createElement("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"}))),triangle:p.createElement("span",{"aria-hidden":"true",className:"bp5-icon"},p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16"},p.createElement("path",{stroke:"currentColor",strokeWidth:"2",d:"M 8 3 L 1 8 L 8 13 Z",fill:"currentColor",strokeLinejoin:"round",strokeLinecap:"round"}),p.createElement("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"}))),bar:p.createElement("span",{"aria-hidden":"true",className:"bp5-icon"}
601,p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16"},p.createElement("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 3 L 1 13",strokeLinejoin:"round",strokeLinecap:"round"}),p.createElement("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"}))),square:p.createElement("span",{"aria-hidden":"true",className:"bp5-icon"},p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16"},p.createElement("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 4 L 9 4 L 9 12 L 1 12 Z",fill:"currentColor",strokeLinejoin:"round",strokeLinecap:"round"}),p.createElement("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"}))),circle:p.createElement("span",{"aria-hidden":"true",className:"bp5-icon"},p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16"},p.createElement("circle",{cx:"4",cy:"8",r:"4",fill:"currentColor"}),p.createElement("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"})))},tB=({type:e,active:t,onClick:n,flipped:r})=>{let i=tF[e];return p.createElement(T.z,{icon:r?p.createElement("span",{style:{transform:"scaleX(-1)"}},i):i,minimal:!0,onClick:n,active:t})},tH=(0,m.Pi)(({elements:e,store:t,property:n})=>{let r="endHead"===n,i=tF[e[0][n]],a=r?p.createElement("span",{style:{transform:"scaleX(-1)"}},i):i,o=r=>{t.history.transaction(()=>{e.forEach(e=>{e.set({[n]:r})})})},l=(0,eE.t)("startHead"===n?"toolbar.lineStartHead":"toolbar.lineEndHead");return p.createElement(z.J,{position:B.Ly.BOTTOM,content:p.createElement("div",{style:{width:"150px",padding:"10px"}},p.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},["","arrow","triangle"].map(t=>p.createElement(tB,{key:t,type:t,active:e[0][n]===t,onClick:()=>{o(t)},flipped:r}))),p.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},["bar","square","circle"].map(t=>p.createElement(tB,{key:t,type:t,active:e[0][n]===t,onClick:()=>{o(t)},flipped:r}))))},p.createElement(F.u,{content:l,position:B.Ly.BOTTOM},p.createElement(T.z,{icon:a,minimal:!0,"aria-label":l})))}),tV={LineSettings:tz,LineColor:tN,LineHeads:(0,m.Pi)(({elements:e,store:t})=>p.createElement(p.Fragment,null,p.createElement(tH,{elements:e,store:t,property:"startHead"}),p.createElement(tH,{elements:e,store:t,property:"endHead"}))),LineAnimations:e_},tj=(0,m.Pi)(({store:e,components:t})=>{let n=e.selectedElements[0],r=["LineColor","LineSettings","LineHeads",eH.flags.animationsEnabled&&"LineAnimations"].filter(e=>!!e),i=(0,eI.m)({type:"line",usedItems:r,components:t});return p.createElement(eI.F,{items:i,itemRender:r=>{let i=t[r]||tV[r];return p.createElement(i,{element:n,store:e,key:r,elements:e.selectedElements})}})});var t$=n(43030),tU=n(41364),tW=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"cut",ref:t},e),p.createElement("path",{d:n?"M320 360C320 360 334.4 385.6 320 400L214.2 275L239.8 244.2L320 360zM321.6 160C310.6 160 300.2 157.6 290.8 153.6L86.2 400C72.2 385.6 86.2 360 86.2 360L175.2 228.8L111.4 153.4C101.8 157.6 91.2 160 80 160C35.8 160 0 124.2000000000001 0 80C0 35.8 35.8 0 80 0S160 35.8 160 80C160 93 156.6 105.2 151 116L201.8 189.4L251.6 116C246.2 105.2000000000001 242.8 93 242.8 80C242.8 35.8 278 0 321.2000000000001 0C364.6000000000001 0 399.6000000000001 35.8 399.6000000000001 80C400 124.2000000000001 364.8 160 321.6 160zM80 40C58 40 40 58 40 80C40 102 58 120 80 120S120 102 120 80C120 58 102 40 80 40zM321.6 40C300 40 282.4 58 282.4 80C282.4 102 300 120 321.6 120C343.2 120 360.8 102 360.8 80C360.8 58 343.2 40 321.6 40z":"M260 280C260 280 274.2000000000001 305.8 260 320L173.2 218.6L194.2 192.2L260 280zM261.4 120C253 120 245 118.2 237.8 114.8L66.2 320C52.4 305.8 66.2 280 66.2 280L139.8 179.6L84.4 114.8C76.8 118.2 68.6 120 60 120C26.8 120 0 93.2 0 60S26.8 0 60 0S120 26.8 120 60C120 69.2 117.8 77.8 114.2 85.4L162 149.2L208.6 85.4C205 77.6 202.8 69 202.8 60.0000000000001C202.8 26.8 229.0000000000001 1e-13 261.4 1e-13C293.8 1e-13 320 26.8 320 60.0000000000001S293.8 120 261.4 120zM60 40C49 40 40 49 40 60C40 71 49 80 60 80S80 71 80 60C80 49 71 40 60 40zM261.4 40C250.6 40 241.8 49 241.8 60C241.8 71 250.6 80 261.4 80S281 71 281 60C281 49 272.2 40 261.4 40z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});tW.defaultProps={size:M.J.STANDARD},tW.displayName="Blueprint5.Icon.Cut";var tG=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"volume-up",ref:t},e),p.createElement("path",{d:n?"M180 331.4C174.4 331.4 169.4 329.2 165.8 325.6L111.8 271.4H20C9 271.4 0 262.4 0 251.4V131.4C0 120.4 9 111.4 20 111.4H111.8L166 57.2C169.6 53.6 174.6 51.4 180.2000000000001 51.4C191.2000000000001 51.4 200.2000000000001 60.4 200.2000000000001 71.4V311.4C200 322.4 191 331.4 180 331.4zM346.2 362.6L313.8 338.6C342.8 296.8 360 246.2 360 191.4C360 136.6 342.8 86 313.8 44L346.2 20C380 68.6 400 127.6 400 191.4C400 255 380 314 346.2 362.6zM278.4 312.8L246.4 289.2C267.4 262.2000000000001 280 228.2 280 191.4C280 154.6 267.4 120.6 246.4 93.6L278.4 70C304.2000000000001 103.6 320 145.6 320 191.4C320 237 304.4000000000001 279 278.4 312.8z":"M140 282.8C134.4 282.8 129.4 280.6 125.8 277L71.8 222.8H20C9 222.8 0 213.8 0 202.8V122.8C0 111.8 9 102.8 20 102.8H71.8L126 48.6C129.6 45 134.6 42.8 140.2 42.8C151.2 42.8 160.2 51.8 160.2 62.8V262.8C160 273.8 151 282.8 140 282.8zM274.8 302.6L243.2 278.2C266.2 245.6 280 205.8 280 162.8C280 119.6 266.2 79.8 243 47.2L274.6 22.8C303 62.2 319.8 110.4 319.8 162.8C320 215 303 263.2 274.8 302.6zM179.6 229.6C192.4 210.4 200 187.4 200 162.8S192.4 115 179.6 96L211.4 71.6C229.4 97.4 240 128.8 240 162.8C240 196.8 229.4 228.2 211.4 254L179.6 229.6z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});tG.defaultProps={size:M.J.STANDARD},tG.displayName="Blueprint5.Icon.VolumeUp";let tq={VideoTrim:(0,m.Pi)(({store:e,components:t,element:n})=>{let r=p.useRef(null),[i,a]=p.useState([]);p.useEffect(()=>{a([])},[n.src]);let o=(e,t)=>{e.preventDefault();let i=e=>{e.preventDefault();let{clientX:i}=e,{left:a,width:o}=r.current.getBoundingClientRect(),{src:l}=n,s=(i-a)/o;"start"===t?n.set({startTime:Math.min(n.endTime,Math.max(0,s))}):"end"===t&&n.set({endTime:Math.min(1,Math.max(n.startTime,s))})};window.addEventListener("mousemove",i),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",i)})};return p.createElement(z.J,{position:"bottom",onOpened:async()=>
601{if(!n.src||i.length)return;let{width:e,height:t}=await (0,tU.C5)(n.src),{src:o}=n,l=r.current.offsetHeight,s=Math.ceil(r.current.offsetWidth/(e/t*l)),c=await (0,tU.Mf)(o),u=document.createElement("video");u.crossOrigin="anonymous",u.src=o;let d=document.createElement("canvas");d.width=480;try{await new Promise((e,t)=>{u.addEventListener("loadeddata",()=>{let t=u.videoWidth/u.videoHeight;d.height=480/t,e()}),u.addEventListener("error",t)}),a([]);for(let e=0;e<s;e++){let t=e*c/s,n=await (0,tU.Cl)(u,d,t);a(e=>e.concat(n))}}catch(e){console.error("Error generating previews:",e)}},content:p.createElement(g.w,{style:{boxShadow:"none",backgroundColor:"transparent",width:"calc(100vw - 300px)"}},p.createElement(t$.f,null,p.createElement(H.A,{style:{width:"80px"},value:parseFloat((n.duration*(n.endTime-n.startTime)/1e3).toFixed(2)),minorStepSize:.01,stepSize:.1,buttonPosition:"none",readOnly:!0}),p.createElement("div",{style:{width:"calc(100vw - 420px)",height:"30px",display:"flex",position:"relative",overflow:"hidden",marginLeft:"10px"},ref:r},i.map((e,t)=>p.createElement("img",{key:t,src:e,style:{width:"auto",height:"100%",objectFit:"cover"}})),p.createElement("div",{style:{position:"absolute",top:"0",left:0,width:100*n.startTime+"%",height:"30px",backgroundColor:"rgb(0, 0, 0, 0.5)"}}),p.createElement("div",{style:{position:"absolute",top:"0",right:"0%",width:100-100*n.endTime+"%",height:"30px",backgroundColor:"rgb(0, 0, 0, 0.5)"}}),p.createElement("div",{style:{position:"absolute",top:"0",left:100*n.startTime+"%",width:"10px",height:"30px",borderRadius:"0px",backgroundColor:"rgb(0, 161, 255, 0.9)",cursor:"ew-resize"},onMouseDown:e=>{o(e,"start")}}),p.createElement("div",{style:{position:"absolute",top:"0",right:100-100*n.endTime+"%",width:"10px",height:"30px",borderRadius:"0px",backgroundColor:"rgb(0, 161, 255, 0.9)",cursor:"ew-resize"},onMouseDown:e=>{o(e,"end")}}))))},p.createElement(T.z,{icon:p.createElement(tW,null),minimal:!0},"Trim"))}),VideoAnimations:e_,VideoVolume:(0,m.Pi)(({element:e})=>{let t=Math.round(100*e.volume),n=t=>{e.set({volume:t/100})};return p.createElement(z.J,{position:B.Ly.BOTTOM,content:p.createElement("div",{style:{padding:"10px",width:"250px"}},p.createElement("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"}},p.createElement("div",{style:{paddingTop:"7px",paddingLeft:"10px",width:"calc(100% - 80px)"}},p.createElement(j.i,{value:t,onChange:e=>{n(e)},min:0,max:100,labelStepSize:50,showTrackFill:!1,labelRenderer:!1})),p.createElement(H.A,{value:t,onValueChange:e=>{n(Math.max(0,Math.min(100,e)))},buttonPosition:"none",style:{width:"50px",padding:"0 5px",marginLeft:"10px"},min:0,max:100})))},p.createElement(F.u,{content:(0,eE.t)("toolbar.volume"),position:B.Ly.BOTTOM},p.createElement(T.z,{icon:p.createElement(tG,null),minimal:!0,"aria-label":(0,eE.t)("toolbar.volume")})))}),VideoClip:(0,m.Pi)(({element:e,store:t})=>e.contentEditable?e.clipSrc?p.createElement(T.z,{text:(0,eE.t)("toolbar.removeClip"),minimal:!0,onClickCapture:t=>{e.set({clipSrc:""})}}):p.createElement(T.z,{minimal:!0,text:(0,eE.t)("toolbar.clip"),onClickCapture:e=>{e.stopPropagation(),t.openSidePanel("image-clip")}}):null)},tZ=(0,m.Pi)(({store:e,components:t})=>{let n=e.selectedElements,r=["VideoTrim","VideoVolume","VideoClip",eH.flags.animationsEnabled&&"VideoAnimations"].filter(e=>!!e),i=(0,eI.m)({type:"video",usedItems:r,components:t});return p.createElement(eI.F,{items:i,itemRender:r=>{let i=t[r]||tq[r];return p.createElement(i,{elements:n,element:n[0],store:e,key:r})}})});var tX=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"disable",ref:t},e),p.createElement("path",{d:n?"M200 400C89.6 400 0 310.4 0 200C0 89.6 89.6 0 200 0S400 89.6 400 200C400 310.4 310.4 400 200 400zM40 200C40 288.4 111.6 360 200 360C237 360 271 347.4 298 326.2L73.8 102C52.6 129 40 163 40 200zM200 40C163 40 129 52.6 102 73.8L326.2 298C347.4000000000001 271 360 237 360 200C360 111.6 288.4 40 200 40z":"M159.8 320.2C71.4 320.2 -0.2 248.6 -0.2 160.2S71.4 0.2 159.8 0.2S319.8 71.8 319.8 160.2S248.2 320.2 159.8 320.2zM39.8 160.2C39.8 226.4 93.6 280.2 159.8 280.2C185.8 280.2 209.6 271.8 229.2 257.8L62.2 90.8C48.2 110.4 39.8 134.2 39.8 160.2zM159.8 40.2C133.8 40.2 110 48.6 90.4 62.6L257.4 229.6C271.4 210 279.8 186.2 279.8 160.2C279.8 93.8 226.2 40.2 159.8 40.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});tX.defaultProps={size:M.J.STANDARD},tX.displayName="Blueprint5.Icon.Disable";var tY=n(83510);let tK=(0,m.Pi)(({elements:e,store:t})=>p.createElement(ey.ZP,{value:e[0].fill,style:{marginRight:"5px"},gradientEnabled:!0,onChange:n=>t.history.transaction(()=>
601{e.forEach(e=>{e.set({fill:n})})}),store:t})),tJ=(0,m.Pi)(({store:e,elements:t,element:n})=>{let r=n=>{e.history.transaction(()=>{t.forEach(e=>{e.set(n)})})};return p.createElement(z.J,{position:B.Ly.BOTTOM,content:p.createElement("div",{style:{padding:"15px",paddingTop:"15px",width:"270px"}},p.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"15px"}},p.createElement(T.z,{onClick:()=>{r({strokeWidth:0})},active:0===t[0].strokeWidth,style:{width:"44px",height:"34px"},icon:p.createElement(tX,{size:20})}),p.createElement(T.z,{onClick:()=>{r({dash:[],strokeWidth:t[0].strokeWidth||10})},active:!!t[0].strokeWidth&&0===t[0].dash.length},p.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},p.createElement("line",{x2:"24",y1:"50%",y2:"50%",stroke:"currentColor",strokeWidth:"2"}))),p.createElement(T.z,{onClick:()=>{r({dash:[4,1],strokeWidth:t[0].strokeWidth||10})},active:!!t[0].strokeWidth&&4===t[0].dash[0]},p.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},p.createElement("line",{x1:"-1",x2:"25",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"12 2",strokeWidth:"2"}))),p.createElement(T.z,{onClick:()=>{r({dash:[2,1],strokeWidth:t[0].strokeWidth||10})},active:!!t[0].strokeWidth&&2===t[0].dash[0]},p.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},p.createElement("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"6 2",strokeWidth:"2"}))),p.createElement(T.z,{onClick:()=>{r({dash:[1,1],strokeWidth:t[0].strokeWidth||10})},active:!!t[0].strokeWidth&&1===t[0].dash[0]},p.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},p.createElement("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"2 2",strokeWidth:"2"})))),p.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"5px"}},p.createElement("div",{className:"bp5-control bp5-align-right"},(0,eE.t)("toolbar.strokeWidth")),p.createElement("div",null,p.createElement(ew.Y2,{value:t[0].strokeWidth,onValueChange:e=>{r({strokeWidth:e})},style:{width:"50px"},min:0,max:Math.round(Math.min(t[0].width,t[0].height)/2),buttonPosition:"none"}))),p.createElement(j.i,{value:t[0].strokeWidth,onChange:e=>{r({strokeWidth:e})},min:0,max:Math.round(Math.min(t[0].width,t[0].height)/2),labelRenderer:!1}),"rect"===t[0].subType&&p.createElement(p.Fragment,null,p.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"15px",paddingBottom:"5px"}},p.createElement("div",{className:"bp5-control bp5-align-right"},(0,eE.t)("toolbar.cornerRadius")),p.createElement("div",null,p.createElement(ew.Y2,{value:t[0].cornerRadius,onValueChange:e=>{r({cornerRadius:e})},style:{width:"50px"},min:0,max:Math.round(Math.max(t[0].width,t[0].height)/2),buttonPosition:"none"}))),p.createElement(j.i,{value:t[0].cornerRadius,onChange:e=>{r({cornerRadius:e})},min:0,max:Math.round(Math.max(t[0].width,t[0].height)/2),labelRenderer:!1})))},p.createElement(F.u,{content:(0,eE.t)("toolbar.strokeSettings"),position:B.Ly.BOTTOM},p.createElement(T.z,{icon:p.createElement(tY,null),minimal:!0,"aria-label":(0,eE.t)("toolbar.strokeSettings")})))}),tQ={FigureFill:tK,FigureStroke:(0,m.Pi)(({elements:e,store:t})=>e.find(e=>e.strokeWidth)?p.createElement(ey.ZP,{value:e[0].stroke,style:{marginRight:"5px"},gradientEnabled:!0,onChange:n=>t.history.transaction(()=>{e.forEach(e=>{e.set({stroke:n})})}),store:t}):null),FigureSettings:tJ,FigureAnimations:e_,FigureFilters:ew.bO},t0=(0,m.Pi)(({store:e,components:t})=>{let n=e.selectedElements[0],r=["FigureFill","FigureStroke","FigureSettings","FigureFilters",eH.flags.animationsEnabled&&"FigureAnimations"].filter(e=>!!e),i=(0,eI.m)({type:"figure",usedItems:r,components:t});return p.createElement(eI.F,{items:i,itemRender:r=>{let i=t[r]||tQ[r];return p.createElement(i,{element:n,store:e,key:r,elements:e.selectedElements})}})}),t1={GifFilters:ew.ZP,GifAnimations:e_},t2=(0,m.Pi)(({store:e,components:t})=>{let n=e.selectedElements,r=["GifFilters",eH.flags.animationsEnabled&&"GifAnimations"].filter(e=>!!e),i=(0,eI.m)({type:"gif",usedItems:r,components:t});return p.createElement(eI.F,{items:i,itemRender:r=>{let i=t[r]||t1[r];return p.createElement(i,{elements:n,element:n[0],store:e,key:r})}})}),t4={ManyAnimations:e_},t3=(0,m.Pi)(({store:e,components:t})=>{let n=e.selectedElements,r=[eH.flags.animationsEnabled&&"ManyAnimations"],i=(0,eI.m)({type:"many",usedItems:r,components:t});return p.createElement(eI.F,{items:i,itemRender:r=>{let i=t[r]||t4[r];return p.createElement(i,{elements:n,element:n[0],store:e,key:r})}})}),t8=()=>p.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},p.createElement("rect",{x:"1.5",y:"1.5",width:"13",height:"13",stroke:"currentColor",strokeWidth:"2",fill:"none"})),t6=()=>p.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},p.createElement("rect",{x:"1.5",y:"1.5",width:"13",height:"13",stroke:"currentColor",strokeWidth:"1",strokeOpacity:"0.3",f
601ill:"none"}),p.createElement("line",{x1:"1",y1:"1.5",x2:"15",y2:"1.5",stroke:"currentColor",strokeWidth:"2"})),t5=()=>p.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},p.createElement("rect",{x:"1.5",y:"1.5",width:"13",height:"13",stroke:"currentColor",strokeWidth:"1",strokeOpacity:"0.3",fill:"none"}),p.createElement("line",{x1:"1",y1:"14.5",x2:"15",y2:"14.5",stroke:"currentColor",strokeWidth:"2"})),t9=()=>p.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},p.createElement("rect",{x:"1.5",y:"1.5",width:"13",height:"13",stroke:"currentColor",strokeWidth:"1",strokeOpacity:"0.3",fill:"none"}),p.createElement("line",{x1:"1.5",y1:"1",x2:"1.5",y2:"15",stroke:"currentColor",strokeWidth:"2"})),t7=()=>p.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},p.createElement("rect",{x:"1.5",y:"1.5",width:"13",height:"13",stroke:"currentColor",strokeWidth:"1",strokeOpacity:"0.3",fill:"none"}),p.createElement("line",{x1:"14.5",y1:"1",x2:"14.5",y2:"15",stroke:"currentColor",strokeWidth:"2"})),ne=()=>p.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},p.createElement("rect",{x:"1.5",y:"1.5",width:"13",height:"13",stroke:"currentColor",strokeWidth:"1",strokeOpacity:"0.3",fill:"none"}),p.createElement("line",{x1:"4",y1:"4",x2:"12",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),p.createElement("line",{x1:"12",y1:"4",x2:"4",y2:"12",stroke:"currentColor",strokeWidth:"1.5"})),nt=["top","right","bottom","left"],nn=(0,m.Pi)(({elements:e,store:t})=>{let n;let r=e[0],i="tablecell"===r.type,[a,o]=p.useState(new Set(nt)),l=i?t.selectedElements[0]:r,s=[...a][0]||"top",c=(null==(n=i?r:"bottom"===s?l.getCell(l.rows-1,0):"right"===s?l.getCell(0,l.cols-1):l.getCell(0,0))?void 0:n.getEffectiveBorder)?n.getEffectiveBorder(s):{color:l.borderColor,width:l.borderWidth,style:l.borderStyle},u=c.color,d=c.width,h=c.style,f=n=>{t.history.transaction(()=>{let t={};if("borderColor"in n&&(t.color=n.borderColor),"borderWidth"in n&&(t.width=n.borderWidth),"borderStyle"in n&&(t.style=n.borderStyle),i){let n=e.map(e=>e.id);l.setCellBorders(n,[...a],t)}else{for(let{cellIds:e,sides:n}of(()=>{let e=[...a];if(4===e.length)return[{cellIds:l.cells.map(e=>e.id),sides:e}];let t=[];for(let n of e){let e;e="top"===n?l.cells.filter(e=>0===e.row):"bottom"===n?l.cells.filter(e=>e.row===l.rows-1):"left"===n?l.cells.filter(e=>0===e.col):l.cells.filter(e=>e.col===l.cols-1),t.push({cellIds:e.map(e=>e.id),sides:[n]})}return t})())l.setCellBorders(e,n,t);4===a.size&&e.forEach(e=>e.set(n))}})};return p.createElement(z.J,{position:B.Ly.BOTTOM,content:p.createElement("div",{style:{padding:"15px",width:"270px"}},p.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"15px"}},p.createElement(F.u,{content:(0,eE.t)("toolbar.borderAllSides"),position:B.Ly.TOP},p.createElement(T.z,{small:!0,active:4===a.size,onClick:()=>o(new Set(nt)),icon:p.createElement(t8,null)})),p.createElement(F.u,{content:(0,eE.t)("toolbar.borderTop"),position:B.Ly.TOP},p.createElement(T.z,{small:!0,active:a.has("top")&&1===a.size,onClick:()=>o(new Set(["top"])),icon:p.createElement(t6,null)})),p.createElement(F.u,{content:(0,eE.t)("toolbar.borderBottom"),position:B.Ly.TOP},p.createElement(T.z,{small:!0,active:a.has("bottom")&&1===a.size,onClick:()=>o(new Set(["bottom"])),icon:p.createElement(t5,null)})),p.createElement(F.u,{content:(0,eE.t)("toolbar.borderLeft"),position:B.Ly.TOP},p.createElement(T.z,{small:!0,active:a.has("left")&&1===a.size,onClick:()=>o(new Set(["left"])),icon:p.createElement(t9,null)})),p.createElement(F.u,{content:(0,eE.t)("toolbar.borderRight"),position:B.Ly.TOP},p.createElement(T.z,{small:!0,active:a.has("right")&&1===a.size,onClick:()=>o(new Set(["right"])),icon:p.createElement(t7,null)})),p.createElement(F.u,{content:(0,eE.t)("toolbar.borderNone"),position:B.Ly.TOP},p.createElement(T.z,{small:!0,onClick:()=>{f({borderStyle:"none"}),o(new Set(nt))},icon:p.createElement(ne,null)}))),p.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"15px"}},p.createElement(T.z,{onClick:()=>f({borderStyle:"none"}),active:"none"===h,style:{width:"44px",height:"34px"},icon:p.createElement(tX,{size:20})}),p.createElement(T.z,{onClick:()=>f({borderStyle:"solid"}),active:"solid"===h},p.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24"},p.createElement("line",{x2:"24",y1:"50%",y2:"50%",stroke:"currentColor",strokeWidth:"2"}))),p.createElement(T.z,{onClick:()=>f({borderStyle:"dashed"}),active:"dashed"===h},p.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24"},p.createElement("line",{x1:"-1",x2:"25",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"12 2",strokeWidth:"2"}))),p.createElement(T.z,{onClick:()=>f({borderStyle:"dotted"}),active:"dotted"===h},p.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24"},p.createElement("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"2 2",strokeWidth:"2"})))),p.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"10px"}},p.createElement("div",{className:"bp5-control bp5-align-right"},(0,eE.t)("toolbar.tableBorderColor")),p.createElement(ey.ZP,{value:u,onChange:e=>f({borderColor:e}),store:t})),p.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"5px"}},p.createElement("div",{className:"bp5-control bp5-align-right"},(0,eE.t)("toolbar.tableBorderWidth")),p.createElement(ew.Y2,{value:d,onValueChange:e=>f({borderWidth:e}),style:{width:"50px"},min:0,max:20,buttonPosition:"none"})),p.createElement(j.i,{value:d,onChange:e=>f({borderWidth:e}),min:0,max:20,labelRenderer:!1}))},p.createElement(F.u,{content:(0,eE.t)("toolbar.tableBorderSettings"),position:B.Ly.BOTTOM},p.createElement(T.z,{minimal:!0,icon:p.createElement(tY,null),"aria-label":(0,eE.t)("toolbar.tableBorderSettings")})))}),nr=()=>p.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},p.createElement("rect",{x:"1",y:"1",width:"14",height:"14",rx:"1",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),p.createElement("line",{x1:"5.5",y1:"1",x2:"5.5",y2:"15",stroke:"currentColor",strokeWidth:"1"}),p.createElement("line",{x1:"10.5",y1:"1",x2:"10.5",y2:"15",stroke:"currentColor",strokeWidth:"1"}),p.createElement("line",{x1:"1",y1:"5.5",x2:"15",y2:"5.5",stroke:"currentColor",strokeWidth:"1"}),p.createElement("line",{x1:"1",y1:"10.5",x2:"15",y2:"10.5",stroke:"currentColor",strokeWidth:"1"})),ni=(0,m.Pi)(({element:e,store:t})=>{let n=e.focusedCells[0],r=null==n?void 0:n.row,i=null==n?void 0:n.col;return p.createElement(N.v,null,null!=n&&p.createElement(p.Fragment,null,p.createElement(I.R,{title:(0,eE.t)("toolbar.tableRows")}),p.createElement(O.s,{text:(0,eE.t)("toolbar.insertRowAbove"),onClick:()=>{t.history.transaction(()=>{e.addRow(r)})}}),p.createElement(O.s,{text:(0,eE.t)("toolbar.insertRowBelow"),onClick:()=>{t.history.transaction(()=>{e.addRow(r+1)})}}),p.createElement(O.s,{text:(0,eE.t)("toolbar.deleteRow"),disabled:e.rows<=1,onClick:()=>{t.history.transaction(()=>{e.removeRow(r)})}}),p.createElement(I.R,{title:(0,eE.t)("toolbar.tableColumns")}),p.createElement(O.s,{text:(0,eE.t)("toolbar.insertColumnLeft"),onClick:()=>{t.history.transaction(()=>{e.addColumn(i)})}}),p.createElement(O.s,{text:(0,eE.t)("toolbar.insertColumnRight"),onClick:()=>{t.history.transaction(()=>{e.addColumn(i+1)})}}),p.createElement(O.s,{text:(0,eE.t)("toolbar.deleteColumn"),disabled:e.cols<=1,onClick:()=>{t.history.transaction(()=>{e.removeColumn(i)})}}),p.createElement(I.R,null)),p.createElement(O.s,{text:(0,eE.t)("toolbar.distributeRowsEvenly"),onClick:()=>{t.history.transaction(()=>{e.distributeRowsEvenly()})}}),p.createElement(O.s,{text:(0,eE.t)("toolbar.distributeColumnsEvenly"),onClick:()=>{t.history.transaction(()=>{e.distributeColumnsEvenly()})}}))}),na=(0,m.Pi)(({elements:e,store:t})=>{let n=e[0];return p.createElement(z.J,{position:B.Ly.BOTTOM,content:p.createElement(ni,{element:n,store:t})},p.createElement(F.u,{content:(0,eE.t)("toolbar.tableStructure"),position:B.Ly.BOTTOM},p.createElement(T.z,{minimal:!0,icon:p.createElement(nr,null),"aria-label":(0,eE.t)("toolbar.tableStructure")})))});(0,m.Pi)(({elements:e,store:t})=>p.createElement(F.u,{content:(0,eE.t)("toolbar.cellPadding"),position:B.Ly.BOTTOM},p.createElement(ew.Y2,{value:e[0].cellPadding,onValueChange:n=>t.history.transaction(()=>
601{e.forEach(e=>e.set({cellPadding:n}))}),style:{width:"50px"},min:0,max:50,buttonPosition:"none"})));let no={TableBorderSettings:nn,TextFontFamily:eX,TextFontSize:eY,TextFill:e2,CellBackground:(0,m.Pi)(({elements:e,store:t})=>p.createElement(F.u,{content:(0,eE.t)("toolbar.cellBackground"),position:B.Ly.BOTTOM},p.createElement(ey.ZP,{value:e[0].cellBackground,style:{marginRight:"5px"},onChange:n=>t.history.transaction(()=>{e.forEach(e=>e.set({cellBackground:n}))}),store:t}))),TextFontVariant:e0,CellVerticalAlign:(0,m.Pi)(({elements:e,store:t})=>{let n=e[0];return p.createElement(F.u,{content:(0,eE.t)("toolbar.verticalAlign"),position:B.Ly.BOTTOM},p.createElement(T.z,{minimal:!0,icon:eQ[n.verticalAlign],onClick:()=>{let r=(eJ.indexOf(n.verticalAlign)+1+eJ.length)%eJ.length,i=eJ[r];t.history.transaction(()=>{e.forEach(e=>e.set({verticalAlign:i}))})},"aria-label":(0,eE.t)("toolbar.verticalAlign")}))}),TextSpacing:e3},nl=Object.assign(Object.assign({},{TableStructure:na,TableAnimations:e_}),no),ns=(0,m.Pi)(({store:e,components:t})=>{let n=e.selectedElements[0],r=n.focusedCells,i=r.length>
6010,a=["TableBorderSettings","CellBackground","TableStructure",...i?["TextFontFamily","TextFontSize","TextFill","TextFontVariant","CellVerticalAlign","TextSpacing"]:[],eH.flags.animationsEnabled&&"TableAnimations"],o=(0,eI.m)({type:"table",usedItems:a,components:t});return p.createElement(eI.F,{items:o,itemRender:a=>{let o;let l=t[a]||nl[a],s=!!no[a];return s&&!i&&"TableBorderSettings"!==a&&"CellBackground"!==a?null:(o=s?i?r:"TableBorderSettings"===a?e.selectedElements:n.cells.slice():e.selectedElements,p.createElement(l,{element:n,store:e,key:a,elements:o}))}})});var nc=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"time",ref:t},e),p.createElement("path",{d:n?"M220 208.2V320C220 331 211 340 200 340S180 331 180 320V200C180 194.4 182.2 189.4 185.8 185.8L245.8 125.8C249.4 122.2 254.4 120 260 120C271 120 280 129 280 140C280 145.6 277.8 150.6 274.2000000000001 154.2L220 208.2zM200 400C89.6 400 0 310.4 0 200C0 89.6 89.6 0 200 0S400 89.6 400 200C400 310.4 310.4 400 200 400zM200 40C111.6 40 40 111.6 40 200S111.6 360 200 360S360 288.4 360 200S288.4 40 200 40z":"M160 320C71.6 320 0 248.4 0 160S71.6 0 160 0S320 71.6 320 160S248.4 320 160 320zM160 40C93.8 40 40 93.8 40 160S93.8 280 160 280S280 226.2 280 160S226.2 40 160 40zM180 168.2V240C180 251 171 260 160 260S140 251 140 240V160C140 154.4 142.2 149.4 145.8 145.8L185.8 105.8C189.4 102.2 194.4 100 200 100C211 100 220 109 220 120C220 125.6 217.8 130.6 214.2 134.2L180 168.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});nc.defaultProps={size:M.J.STANDARD},nc.displayName="Blueprint5.Icon.Time";var nu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let nd=e=>{var{value:t,onValueChange:n}=e,r=nu(e,["value","onValueChange"]);let[i,a]=p.useState(t.toString());return p.useEffect(()=>{a(t.toString())},[t]),p.createElement(H.A,Object.assign({value:i,onValueChange:(e,t)=>
601{a(t),Number.isNaN(e)||n(e)}},r))},nh=(0,m.Pi)(({store:e})=>e.activePage?p.createElement(ey.zH,{value:e.activePage.background||"white",onChange:t=>{e.activePage.set({background:t})},store:e,gradientEnabled:!0}):null),nf={PageDuration:(0,m.Pi)(({store:e})=>{if(!e.activePage)return null;let{duration:t}=e.activePage;return p.createElement(z.J,{position:"bottom",content:p.createElement("div",{style:{padding:"15px",paddingTop:"15px",width:"230px"}},p.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"}},p.createElement("div",null,(0,eE.t)("toolbar.duration")),p.createElement("div",null,p.createElement(nd,{value:t/1e3,onValueChange:t=>{e.activePage.set({duration:1e3*t})},style:{width:"50px"},min:0,buttonPosition:"none"}))),p.createElement(j.i,{value:Math.min(t/1e3,50),onChange:t=>{e.activePage.set({duration:1e3*t})},min:0,max:50,showTrackFill:!1,labelRenderer:!1}))},p.createElement(T.z,{icon:p.createElement(nc,null),minimal:!0},(e.activePage.duration/1e3).toFixed(1),"s"))}),PageBackground:nh},np=(0,m.Pi)(({store:e,components:t})=>{let n=["PageBackground",eH.flags.animationsEnabled&&"PageDuration"],r=(0,eI.m)({type:"page",usedItems:n,components:t});return p.createElement(eI.F,{items:r,itemRender:n=>{let r=t[n]||nf[n];return p.createElement(r,{store:e,key:n})}})});var nm=n(28164),ng=n(9865),nv=n(34013),nb=n(50708),ny=n(28419),nw=n(72853);let nx=(0,m.Pi)(({store:e})=>{let{lock:t,locked:n,disabled:r}=(0,nw.Z)({store:e}),i=n?p.createElement(nb.H,null):p.createElement(ny.S,null),a=(0,eE.t)(n?"toolbar.lockedDescription":"toolbar.unlockedDescription");return p.createElement(F.u,{content:a,disabled:r,position:"bottom"},p.createElement(T.z,{minimal:!0,disabled:r,icon:i,onClick:()=>t(),"aria-label":a}))});var nC=n(91332),nE=n(75501);let nk=(0,m.Pi)(({store:e})=>{var t;let n=e.selectedShapes.length>0,r=t=>{t=Math.max(0,Math.min(t,100)),e.selectedShapes.forEach(e=>{e.set({opacity:t/100})})},i=Math.round(100*(null===(t=e.selectedShapes[0])||void 0===t?void 0:t.opacity));return p.createElement(z.J,{disabled:!n,minimal:!1,content:p.createElement("div",{style:{padding:"10px 20px"}},p.createElement("div",{style:{textAlign:"center"}},(0,eE.t)("toolbar.transparency")),p.createElement("div",{style:{display:"flex"}},p.createElement("div",{style:{paddingTop:"8px",paddingRight:"20px"}},p.createElement(j.i,{value:i,labelRenderer:!1,onChange:r,min:0,max:100})),p.createElement(H.A,{value:i,onValueChange:r,min:0,max:100,buttonPosition:"none",style:{width:"50px"},selectAllOnFocus:!0}))),position:B.Ly.BOTTOM},p.createElement(F.u,{content:(0,eE.t)("toolbar.transparency"),disabled:!n,position:B.Ly.BOTTOM},p.createElement(T.z,{minimal:!0,disabled:!n,"aria-label":(0,eE.t)("toolbar.transparency")},p.createElement(nE,{className:"bp5-icon",style:{fontSize:"20px"}}))))});var nS=p.forwardRef(function(e,t){var n=e.size>=M.J.LARGE,r=n?M.J.LARGE:M.J.STANDARD,i="".concat(-1*r/.05/2);return p.createElement(R.l,(0,P.pi)({iconName:"cog",ref:t},e),p.createElement("path",{d:n?"M380 240H333.8C331 249.2 327.2000000000001 257.8 322.6 266L356.6 300C364.4000000000001 307.8 364.4000000000001 320.4 356.6 328.2L328.4000000000001 356.4C320.6 364.2 308.0000000000001 364.2 300.2000000000001 356.4L266.2000000000001 322.4C258.0000000000001 326.8 249.4000000000001 330.6 240.2000000000001 333.4V380C240.2000000000001 391 231.2000000000001 400 220.2000000000001 400H180C169 400 160 391 160 380V333.4C150.4 330.6 141.2 326.6 132.6 321.8L100 354.4C92.6 361.8 80.4 361.8 72.8 354.4L45.6 327.2C38.2 319.6 38.2 307.4 45.6 300L78 267.6C73.2 258.8 69.2 249.8 66.2 240H20C9 240 0 231 0 220V180C0 169 9 160 20 160H66.2C69 150.8 72.8 142.2 77.4 134L43.4 100C35.6 92.2 35.6 79.6 43.4 71.8L71.6 43.6C79.4 35.8 92 35.8 99.8 43.6L133.8 77.6C142 73.2 150.6 69.4 159.8 66.6V20C159.8 9 168.8 0 179.8 0H219.8C230.8 0 239.8 9 239.8 20V66.6C249.4 69.4 258.6 73.6 267.2 78.4L300 45.6C307.4 38.2 319.6 38.2 327.2 45.6L354.4 72.8C361.8 80.2 361.8 92.4 354.4 100L322 132.4C326.8 141 331 150.2000000000001 334 160H380C391 160 400 169 400 180V220C400 231 391 240 380 240zM200 120C155.8 120 120 155.8 120 200C120 244.2 155.8 280 200 280S280 244.2 280 200C280 155.8 244.2 120 200 120z":"M303.8 192.2H266.8C264.6 199.6 261.4 206.4 257.8 213L285 240.2C291.2 246.4000000000001 291.2 256.6 285 262.8L262.4000000000001 285.4C256.2 291.6 246 291.6 239.8000000000001 285.4L212.6000000000001 258.2C206 261.6 199.2 264.8 191.8 267V304.2C191.8 313 184.6 320.2 175.8 320.2H143.8C135 320.2 127.8 313 127.8 304.2V267C120 264.6 112.8 261.4 105.8 257.6L79.8 283.6C73.8 289.6 64 289.6 58 283.6L36.4 261.8C30.4 255.8 30.4 246 36.4 240L62.4 214C58.4 207.2 55.2 200 52.8 192.2H15.8C7 192.2 -0.2 185 -0.2 176.2V144.2C-0.2 135.4 7 128.2 15.8 128.2H52.8C55 120.8 58.2 114 61.8 107.4L34.6 80.2000000000001C28.4 74 28.4 63.8 34.6 57.6L57.2 35.0000000000001C63.4 28.8000000000001 73.6 28.8000000000001 79.8 35.0000000000001L107 62.2000000000001C113.6 58.6000000000001 120.4 55.6000000000001 127.8 53.4000000000001V16.2000000000001C127.8 7.4000000000001 135 0.2 143.8 0.2H175.8C184.6 0.2 191.8000000000001 7.4 191.8000000000001 16.2000000000001V53.4000000000001C199.6000000000001 55.8000000000001 206.8000000000001 59.0000000000001 213.8 62.8
601000000000001L239.8000000000001 36.8000000000001C245.8000000000001 30.8000000000001 255.6 30.8000000000001 261.6 36.8000000000001L283.4000000000001 58.6000000000001C289.4000000000001 64.6000000000001 289.4000000000001 74.4 283.4000000000001 80.4000000000001L257.4000000000001 106.4000000000001C261.2 113.4000000000001 264.6 120.6000000000001 267 128.4000000000001H304C312.8 128.4000000000001 320 135.6000000000001 320 144.4000000000001V176.4000000000001C319.8 185 312.6 192.2 303.8 192.2zM159.8 100.2C126.6 100.2 99.8 127 99.8 160.2S126.6 220.2 159.8 220.2S219.8 193.4 219.8 160.2S193 100.2 159.8 100.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});nS.defaultProps={size:M.J.STANDARD},nS.displayName="Blueprint5.Icon.Cog";let nT=(0,m.Pi)(({store:e})=>{let t=e.selectedElements.length>0,n=e.selectedElements[0]||{},r=t=>{e.selectedElements.forEach(e=>{e.set(t)})};return p.createElement(z.J,{disabled:!t,minimal:!1,content:p.createElement("div",{style:{padding:"15px",paddingTop:"25px",width:"220px"}},p.createElement(ex.rs,{checked:n.selectable,label:(0,eE.t)("toolbar.selectable"),onChange:e=>{r({selectable:e.target.checked})},alignIndicator:v.v.RIGHT}),p.createElement(ex.rs,{checked:n.draggable,label:(0,eE.t)("toolbar.draggable"),onChange:e=>{r({draggable:e.target.checked})},alignIndicator:v.v.RIGHT}),p.createElement(ex.rs,{checked:n.removable,label:(0,eE.t)("toolbar.removable"),onChange:e=>{r({removable:e.target.checked})},alignIndicator:v.v.RIGHT}),p.createElement(ex.rs,{checked:n.resizable,label:(0,eE.t)("toolbar.resizable"),onChange:e=>{r({resizable:e.target.checked})},alignIndicator:v.v.RIGHT}),p.createElement(ex.rs,{checked:n.contentEditable,label:(0,eE.t)("toolbar.contentEditable"),onChange:e=>{r({contentEditable:e.target.checked})},alignIndicator:v.v.RIGHT}),p.createElement(ex.rs,{checked:n.styleEditable,label:(0,eE.t)("toolbar.styleEditable"),onChange:e=>{r({styleEditable:e.target.checked})},alignIndicator:v.v.RIGHT}),p.createElement(ex.rs,{checked:n.alwaysOnTop,label:(0,eE.t)("toolbar.alwaysOnTop"),onChange:e=>{r({alwaysOnTop:e.target.checked})},alignIndicator:v.v.RIGHT,style:{marginTop:"20px"}}),p.createElement(ex.rs,{checked:n.showInExport,label:(0,eE.t)("toolbar.showInExport"),onChange:e=>{r({showInExport:e.target.checked})},alignIndicator:v.v.RIGHT,style:{marginTop:"20px"}})),position:B.Ly.BOTTOM},p.createElement(T.z,{icon:p.createElement(nS,null),minimal:!0,disabled:!t,"aria-label":"Admin settings"}))});var nP=n(69305),nM=n(81970);let nR=(0,m.Pi)(({store:e})=>{let{disabled:t,elementToCopy:n,setElementToCopy:r}=(0,nM.K)(e);return p.createElement(F.u,{content:(0,eE.t)("toolbar.copyStyle"),disabled:t},p.createElement(T.z,{icon:nA,active:!!n,intent:n?"primary":"none",minimal:!0,disabled:t,onClick:()=>{r(e.selectedElements[0])},"aria-label":(0,eE.t)("toolbar.copyStyle")}))}),nA=p.createElement("span",{className:"bp5-icon"}
601,p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"},p.createElement("rect",{width:"16",height:"6",x:"2",y:"2",rx:"2"}),p.createElement("path",{d:"M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2"}),p.createElement("rect",{width:"4",height:"6",x:"8",y:"16",rx:"1"}))),nL={text:e6,image:tM,svg:tI,many:t3,line:tj,video:tZ,figure:t0,gif:t2,table:ns,page:np},n_=(0,k.Z)("div",p.forwardRef)` 602 white-space: nowrap; 603 604 /* Add special style for a button with text inside, to make sure it has good with */ 605 & .bp5-button:has(.bp5-button-text) { 606 min-width: max-content; 607 } 608 609 /* Condensed mode: hide labels and allow smaller buttons */ 610 /* to avoid creating several lines of buttons */ 611 &.condensed .polotno-position .bp5-button-text { 612 display: none; 613 } 614 615 &.condensed .polotno-download-button .bp5-button-text { 616 display: none; 617 } 618 619 ${(0,S.wz)("\n max-width: 100vw;\n overflow-x: auto;\n overflow-y: hidden;\n ")} 620`,nI=(0,k.Z)("div")` 621 width: 100%; 622 height: 100%; 623 ${(0,S.wz)("\n display: flex;\n ")} 624`;var nO=(0,m.Pi)(({store:e,downloadButtonEnabled:t,components:n={}})=>{let r=1===new Set(e.selectedElements.map(e=>e.type)).size,i=1===e.selectedElements.length,a=e.selectedElements[0],o=e.selectedElements.every(e=>e.styleEditable),l=o&&i&&nL[a.type];r?l=nL[a.type]:e.selectedElements.length>1&&(l=nL.many),0===e.selectedElements.length&&1===e._selectedPagesIds.length&&(l=nL.page),i&&"text"===a.type&&eH.flags.htmlRenderEnabled&&(l=tp);let s=i&&a._cropModeEnabled,c=p.useRef(n);(Object.keys(n).some(e=>n[e]!==c.current[e])||Object.keys(c.current).some(e=>!(e in n)))&&(c.current=Object.assign({},n));let u=c.current,{containerRef:d,condensed:h}=function(e=480){let t=p.useRef(null),[n,r]=p.useState(!1),i=p.useCallback(()=>{let n=t.current;n&&r(n.clientWidth<e)},[e]);return p.useEffect(()=>{let e=t.current;if(!e)return;let n=new ResizeObserver(()=>i());n.observe(e);let r=new MutationObserver(()=>i());return r.observe(e,{childList:!0,subtree:!0,attributes:!0}),window.addEventListener("resize",i),requestAnimationFrame(i),()=>{n.disconnect(),r.disconnect(),window.removeEventListener("resize",i)}},[i]),{containerRef:t,condensed:n}}(480),f=(null==u?void 0:u.ActionControls)||(t?nm.o:null),m=(null==u?void 0:u.Position)||nC.p,b=(null==u?void 0:u.Opacity)||nk,y=(null==u?void 0:u.Lock)||nx,w=(null==u?void 0:u.Duplicate)||ng.c,x=(null==u?void 0:u.Remove)||nv.x,C=(null==u?void 0:u.Group)||nP.B,k=(null==u?void 0:u.History)||_,S=(null==u?void 0:u.Admin)||nT,T=(null==u?void 0:u.CopyStyle)||nR;return p.createElement(n_,{ref:d,className:"bp5-navbar polotno-toolbar"+(h?" condensed":"")},p.createElement(nI,null,!s&&p.createElement(k,{store:e}),l&&o&&p.createElement(l,{store:e,components:u}),!s&&p.createElement(g.w.Group,{align:v.v.RIGHT},"admin"===e.role&&p.createElement(S,{store:e}),p.createElement(C,{store:e}),p.createElement(m,{store:e}),o&&p.createElement(b,{store:e}),p.createElement(y,{store:e}),p.createElement(w,{store:e}),p.createElement(x,{store:e}),p.createElement(T,{store:e}),f&&p.createElement(p.Fragment,null,p.createElement(E,{style:{height:"100%",margin:"0 15px"}}),p.createElement(f,{store:e})))))})},81970:function(e,t,n){"use strict";n.d(t,{K:function(){return a}});var r=n(7653);let i=(e,t)=>{let n=new Set(t);return[...new Set(e)].filter(e=>n.has(e))},a=e=>{let[t,n]=(0,r.useState)(null);return(0,r.useEffect)(()=>{let r=e.selectedElements;t&&(r.forEach(e=>{let n=i(h[e.type],h[t.type]).reduce((e,n)=>{let r=t[n];return Array.isArray(r)?r=[...r]:"object"==typeof r&&null!==r&&(r=Object.assign({},r)),Object.assign(Object.assign({},e),{[n]:r})},{});e.type!==t.type&&f.forEach(e=>{delete n[e]}),e.set(Object.assign({},n)),"table"===t.type&&"table"===e.type&&function(e,t){let n=Math.min(e.rows,t.rows),r=Math.min(e.cols,t.cols);for(let i=0;i<n;i++)for(let n=0;n<r;n++){let r=e.getCell(i,n),a=t.getCell(i,n);if(!r||!a)continue;let o={};for(let e of d)o[e]=r[e];a.set(o)}}(t,e)}),n(null))},[e.selectedElements[0]]),{elementToCopy:t,disabled:1!==e.selectedElements.length,setElementToCopy:n}},o=["opacity","visible","height","width","shadowEnabled","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","blurEnabled","blurRadius","brightnessEnabled","brightness","sepiaEnabled","grayscaleEnabled"],l=[...o,"fontSize","fontWeight","fontFamily","lineHeight","stroke","strokeWidth","textDecoration","fill","align","verticalAlign","letterSpacing","backgroundEnabled","backgroundColor","backgroundOpacity","backgroundCornerRadius","backgroundPadding"],s=[...o,"flipX","flipY","keepRatio","borderColor","borderSize","cornerRadius","cropX","cropY","cropWidth","cropHeight"],c=[...o,"flipX","flipY","keepRatio","borderColor","borderSize","cornerRadius","cropX","cropY","cropWidth","cropHeight"],u=[...o,"color","dash","endHead","startHead"],d=["fontSize","fontFamily","fontWeight","fontStyle","textDecoration","fill","align","verticalAlign","lineHeight","letterSpacing","cellBackgroun
624d","cellPadding","borders"],h={figure:[...o,"dash","cornerRadius","fill","stroke","strokeWidth"],image:s,line:u,svg:[...o,"cornerRadius","borderColor","borderSize","colorsReplace","cropHeight","cropWidth","cropX","cropY","flipX","flipY","keepRatio"],text:l,video:c,table:[...o,"borderColor","borderWidth","borderStyle"]},f=["width","height"]},72037:function(e,t,n){"use strict";n.d(t,{w:function(){return a}});var r=n(7653),i=n(76229);let a=({store:e})=>{let t=e.selectedElements.length>0,n=e.selectedElements.every(e=>!1===e.removable);return{duplicate:(0,r.useCallback)(()=>{(0,i._)(e.selectedElements,e)},[e]),disabled:!t||n}}},72853:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(7653);let i=({store:e})=>{let t=e.selectedShapes.length>0,n=e.selectedShapes[0],i=null==n?void 0:n.locked;return{disabled:!t,lock:(0,r.useCallback)(()=>{e.selectedShapes.forEach(e=>e.set({draggable:i,contentEditable:i,styleEditable:i,resizable:i,removable:i}))},[i,e]),locked:i}}},61311:function(e,t,n){"use strict";n.d(t,{_:function(){return i}});var r=n(7653);let i=({store:e})=>{let t=e.selectedElements.filter(e=>e.removable),n=(0,r.useCallback)(()=>{e.deleteElements(t.map(e=>e.id))},[e,t]);return{disabled:!t.length,remove:n}}},44403:function(e,t,n){"use strict";n.d(t,{ZP:function(){return k}});var r=n(7653),i=n(55918),a=n(38726),o=n(54064),l=n(50058),s=n(45470),c=n(43808),u=n(2027),d=n(54043),h=n(96283),f=n(96834),p=n(2374),m=n(95975),g=r.forwardRef(function(e,t){var n=e.size>=p.J.LARGE,i=n?p.J.LARGE:p.J.STANDARD,a="".concat(-1*i/.05/2);return r.createElement(m.l,(0,f.pi)({iconName:"zoom-out",ref:t},e),r.createElement("path",{d:n?"M220 260H100C89 260 80 251 80 240C80 229 89 220 100 220H220C231 220 240 229 240 240C240 251 231 260 220 260zM391.2 51.2L292.4 150C309.8 175.8 320 206.6 320 240C320 328.4 248.4 400 160 400S0 328.4 0 240S71.6 80 160 80C193.4 80 224.2 90.2 250 107.6L348.8 8.8C354.2000000000001 3.4 361.8 0 370 0C386.6 0 400 13.4 400 30C400 38.2 396.6 45.8 391.2 51.2zM160 120C93.8 120 40 173.8 40 240S93.8 360 160 360S280 306.2000000000001 280 240S226.2 120 160 120z":"M79.8 200.2C68.8 200.2 59.8 191.2 59.8 180.2S68.8 160.2 79.8 160.2H199.8C210.8 160.2 219.8 169.2 219.8 180.2S210.8 200.2 199.8 200.2H79.8zM311 51.4L257.6 105C271.6 126.8 279.8 152.6 279.8 180.2C279.8 257.6 217.2 320.2 139.8 320.2S-0.2 257.6 -0.2 180.2S62.4 40.2 139.8 40.2C167.6 40.2 193.4 48.6 215 62.4L268.6 9C274 3.6 281.6 0.2 289.8 0.2C306.4 0.2 319.8 13.6 319.8 30.2C319.8 38.4 316.4 46 311 51.4zM139.8 80.2C84.6 80.2 39.8 125 39.8 180.2S84.6 280.2 139.8 280.2S239.8 235.4 239.8 180.2S195 80.2 139.8 80.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(a,", ").concat(a,")"),style:{transformOrigin:"center"}}))});g.defaultProps={size:p.J.STANDARD},g.displayName="Blueprint5.Icon.ZoomOut";var v=r.forwardRef(function(e,t){var n=e.size>=p.J.LARGE,i=n?p.J.LARGE:p.J.STANDARD,a="".concat(-1*i/.05/2);return r.createElement(m.l,(0,f.pi)({iconName:"zoom-in",ref:t},e),r.createElement("path",{d:n?"M391.2 51.2L292.4 150C309.8 175.8 320 206.6 320 240C320 328.4 248.4 400 160 400S0 328.4 0 240S71.6 80 160 80C193.4 80 224.2 90.2 250 107.6L348.8 8.8C354.2000000000001 3.4 361.8 0 370 0C386.6 0 400 13.4 400 30C400 38.2 396.6 45.8 391.2 51.2zM160 120C93.8 120 40 173.8 40 240S93.8 360 160 360S280 306.2000000000001 280 240S226.2 120 160 120zM220 260H180V300C180 311 171 320 160 320S140 311 140 300V260H100C89 260 80 251 80 240C80 229 89 220 100 220H140V180C140 169 149 160 160 160S180 169 180 180V220H220C231 220 240 229 240 240C240 251 231 260 220 260z":"M159.8 200.2V240.2C159.8 251.2 150.8 260.2 139.8 260.2S119.8 251.2 119.8 240.2V200.2H79.8C68.8 200.2 59.8 191.2 59.8 180.2S68.8 160.2 79.8 160.2H119.8V120.2C119.8 109.2 128.8 100.2 139.8 100.2S159.8 109.2 159.8 120.2V160.2H199.8C210.8 160.2 219.8 169.2 219.8 180.2S210.8 200.2 199.8 200.2H159.8zM311 51.4L257.6 105C271.6 126.8 279.8 152.6 279.8 180.2C279.8 257.6 217.2 320.2 139.8 320.2S-0.2 257.6 -0.2 180.2S62.4 40.2 139.8 40.2C167.6 40.2 193.4 48.6 215 62.4L268.6 9C274 3.6 281.6 0.2 289.8 0.2C306.4 0.2 319.8 13.6 319.8 30.2C319.8 38.4 316.4 46 311 51.4zM139.8 80.2C84.6 80.2 39.8 125 39.8 180.2S84.6 280.2 139.8 280.2S239.8 235.4 239.8 180.2S195 80.2 139.8 80.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(a,", ").concat(a,")"),style:{transformOrigin:"center"}}))});v.defaultProps={size:p.J.STANDARD},v.displayName="Blueprint5.Icon.ZoomIn";let b=(0,c.Z)("div")` 625 position: relative; 626 height: 0px; 627`,y=(0,c.Z)("div")` 628 position: absolute; 629 bottom: 5px; 630 width: auto; 631 left: 50%; 632 transform: translateX(-50%); 633 border-radius: 5px; 634 overflow: hidden; 635 box-shadow: 0 0 4px lightgrey; 636 637 ${(0,h.wz)("\n display: none;\n ")} 638`,w=[.1,.25,.5,.75,1,1.5,2,3,5],x=w[w.length-1],C=w[0],E=(0,u.Pi)(({store:e})=>{let t=Math.max(x,e.scaleToFit),n=Math.min(C,e.scaleToFit),c=e.scale<t,u=e.scale>n;return r.createElement(i.w.Group,{style:{height:"35px"}},r.createElement(a.z,{icon:r.createElement(g,null),minimal:!0,onClick:()=>{e.setScale(e.scale/1.2)},disabled:!u,"aria-label":"Zoom out"}),r.createElement(s.J,{content:r.createElement(o.v,{style:{minWidth:"80px"}},w.map(t=>r.createElement(l.s,{key:t,text:Math.round(100*t)+"%",onClick:async()=>{e.setScale(t)}})),r.createElement(l.s,{text:(0,d.t)("scale.reset"),onClick:async()=>{e.setScale(e.scaleToFit)}}))},r.createElement(a.z,{minimal:!0,"aria-label":"Zoom level"},Math.round(100*e.scale)+"%")),r.createElement(a.z,{icon:r.createElement(v,null),minimal:!0,onClick:()=>{e.setScale(1.2*e.scale)},disabled:!c,"aria-label":"Zoom in"}))});var k=(0,u.Pi)(({store:e})=>r.createElement(b,null,r.createElement(y,null,r.createElement(i.w,{style:{height:"35px",padding:"0 5px"}},r.createElement(E,{store:e})))))},45256:function(e,t,n){"use strict";n.d(t,{A8:function(){return d},Ew:function(){return u},H_:function(){return o},Lb:function(){return s},cP:function(){return l},vA:function(){return c}});var r=n(57042);let i=e=>{if("group"!==e.type)return(0,r.VK)(e);let t=1/0,n=1/0,a=-1/0,o=-1/0;
638return e.children.forEach(e=>{let r=i(e);t=Math.min(t,r.x),n=Math.min(n,r.y),a=Math.max(a,r.x+r.width),o=Math.max(o,r.y+r.height)}),{x:t,y:n,width:a-t,height:o-n}},a=(e,t,n)=>{if("group"!==e.type){let i=(0,r.VK)(e),a=t-i.x,o=n-i.y;e.set({x:e.x+a,y:e.y+o})}else{let r=t-i(e).x,o=n-i(e).y;e.children.forEach(e=>{let t=i(e);a(e,t.x+r,t.y+o)})}};function o(e){var t;let n=null===(t=e.activePage)||void 0===t?void 0:t.computedWidth;e.selectedElements.forEach(e=>{n=Math.min(n,i(e).x)}),1===e.selectedElements.length&&(n=0),e.selectedElements.forEach(e=>{let t=i(e);a(e,t.x-t.x+n,t.y)})}function l(e){var t;let n=0;e.selectedElements.forEach(e=>{let t=i(e);n=Math.max(n,t.x+t.width)}),1===e.selectedElements.length&&(n=null===(t=e.activePage)||void 0===t?void 0:t.computedWidth),e.selectedElements.forEach(e=>{let t=i(e);a(e,n-t.width,t.y)})}function s(e){var t;let n=null===(t=e.activePage)||void 0===t?void 0:t.computedHeight;e.selectedElements.forEach(e=>{n=Math.min(n,i(e).y)}),1===e.selectedElements.length&&(n=0),e.selectedElements.forEach(e=>{let t=i(e);a(e,t.x,t.y-t.y+n)})}function c(e){var t,n;let r=null===(t=e.activePage)||void 0===t?void 0:t.computedHeight,o=0;e.selectedElements.forEach(e=>{let t=i(e);r=Math.min(r,t.y),o=Math.max(o,t.y+t.height)});let l=(o+r)/2;1===e.selectedElements.length&&(l=(null===(n=e.activePage)||void 0===n?void 0:n.computedHeight)/2),e.selectedElements.forEach(e=>{let t=i(e);a(e,t.x,l-t.height/2)})}function u(e){var t;let n=0;e.selectedElements.forEach(e=>{let t=i(e);n=Math.max(n,t.y+t.height)}),1===e.selectedElements.length&&(n=null===(t=e.activePage)||void 0===t?void 0:t.computedHeight),e.selectedElements.forEach(e=>{let t=i(e);a(e,t.x,n-t.height)})}function d(e){var t,n;let r=null===(t=e.activePage)||void 0===t?void 0:t.computedWidth,o=0;
638e.selectedElements.forEach(e=>{let t=i(e);r=Math.min(r,t.x),o=Math.max(o,t.x+t.width)});let l=(o+r)/2;1===e.selectedElements.length&&(l=(null===(n=e.activePage)||void 0===n?void 0:n.computedWidth)/2),e.selectedElements.forEach(e=>{let t=i(e);a(e,l-t.width/2,t.y)})}},87556:function(e,t,n){"use strict";n.d(t,{$d:function(){return d},Kf:function(){return a},Qz:function(){return f},TB:function(){return p},X1:function(){return h},aB:function(){return u},cW:function(){return g},ns:function(){return c},q8:function(){return m}});var r=n(69295);let i="https://api.polotno.com",a=()=>i+"/api",o={},l=(e,t)=>{o[e]||(o[e]=!0,console.error(t))},s="API for iconscout is provided as a demonstration.\nFor production usage you have to use your own API endpoint.\nhttps://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement\nhttps://polotno.com/docs/server-api",c={unsplashList:({query:e,page:t=1})=>`${a()}/get-unsplash?query=${e}&per_page=20&page=${t}&KEY=${(0,r.km)()}`,unsplashDownload:e=>`${a()}/download-unsplash?id=${e}&KEY=${(0,r.km)()}`,svgapiList:({query:e,page:t=0})=>`${a()}/get-svgapi?query=${e}&page=${t}&per_page=20&KEY=${(0,r.km)()}`,svgapiDownload:e=>`${a()}/download-svgapi?path=${e}&KEY=${(0,r.km)()}`,iconscoutList:({query:e,page:t=1})=>(l("iconscout",s),`${a()}/get-iconscout?query=${e}&page=${t}&KEY=${(0,r.km)()}`),iconscoutDownload:e=>(l("iconscout",s),`${a()}/download-iconscout?uuid=${e}&KEY=${(0,r.km)()}`),nounProjectList:({query:e,page:t=1})=>`${a()}/get-nounproject?query=${e}&page=${t}&KEY=${(0,r.km)()}`,nounProjectDownload:e=>`${a()}/download-nounproject?id=${e}&KEY=${(0,r.km)()}`,templateList:({query:e,page:t=1,sizeQuery:n})=>`${a()}/get-templates?${n}&query=${e}&per_page=30&page=${t}&KEY=${(0,r.km)()}`,googleFontsList:()=>`${a()}/get-google-fonts?KEY=${(0,r.km)()}`,googleFontImage:e=>`${i}/google-fonts-previews/black/${e.replace(RegExp(" ","g"),"-")}.png`,textTemplateList:()=>`${a()}/get-text-templates?KEY=${(0,r.km)()}`,removeBackground:()=>`${a()}/remove-image-background?KEY=${(0,r.km)()}`,aiText:()=>`${a()}/ai/text?KEY=${(0,r.km)()}`},u=()=>c.googleFontsList(),d=e=>c.googleFontImage(e),h=()=>c.removeBackground(),f=e=>c.templateList(e),p=()=>c.textTemplateList(),m=e=>c.unsplashList(e),g=e=>c.unsplashDownload(e)},43389:function(e,t,n){"use strict";n.d(t,{Hr:function(){return i},NN:function(){return a}});var r=n(21952);n(8585);let i=(e,t,n)=>{let r=t,i=n,a=1;for(;r>0&&i>0;){if(e.width=r,e.height=i,r+i<4e3)return;let o=e.getContext("2d");if(!o)return;if(o.fillStyle="rgba(0,0,0,0.1)",o.fillRect(0,0,1,1),0!==o.getImageData(0,0,1,1).data[3])return void o.clearRect(0,0,e.width,e.height);if(a*=.9,r=Math.floor(t*a),i=Math.floor(n*a),r=Math.max(r,1),i=Math.max(i,1),r<=1&&i<=1)return e.width=1,void(e.height=1)}};function a(e,t){var n,i;let a=null!==(n=t.x)&&void 0!==n?n:0,o=null!==(i=t.y)&&void 0!==i?i:0,l=t.pixelRatio||1,s=Math.round(t.width*l),c=Math.round(t.height*l),u=s/l,d=c/l,h=t.sceneCanvas;h?(h.width!==s||h.height!==c||h.pixelRatio!==l)&&(h.setSize(u,d),h.setPixelRatio(l)):h=new r.RF({width:u,height:d,pixelRatio:l});let f=h.getContext(),p=h.width/h.pixelRatio+Math.abs(a),m=h.height/h.pixelRatio+Math.abs(o),g=t.bufferCanvas;if(g){let e=Math.round(p*h.pixelRatio),t=Math.round(m*h.pixelRatio);(g.width!==e||g.height!==t||g.pixelRatio!==h.pixelRatio)&&(g.setSize(p,m),g.setPixelRatio(h.pixelRatio))}else g=new r.RF({width:p,height:m,pixelRatio:h.pixelRatio});return!1===t.imageSmoothingEnabled&&(f._context.imageSmoothingEnabled=!1),f.save(),(a||o)&&f.translate(-1*a,-1*o),e.drawScene(h,void 0,g),f.restore(),h}},34350:function(e,t,n){"use strict";async function r(e,t){let n=await (await fetch(e)).blob(),r=document.createElement("a"),i=URL.createObjectURL(n);r.href=i,r.download=t,document.body.appendChild(r),r.click(),setTimeout(function(){document.body.removeChild(r),window.URL.revokeObjectURL(i)},0)}n.d(t,{S:function(){return r}})},76229:function(e,t,n){"use strict";function r(e,t){let n=[];e.forEach(e=>{if(!1===e.removable)return;let t=e.clone();"group"===e.type?t.children.forEach(e=>{e.set({x:e.x+50,y:e.y+50})}):t.set({x:e.x+50,y:e.y+50}),n.push(t.id)}),t.selectElements(n)}n.d(t,{_:function(){return r}})},11903:function(e,t,n){"use strict";n.d(t,{GL:function(){return o},vK:function(){return a},vn:function(){return l}});let r=({width:e,height:t,cornerRadius:n})=>{if(n>0){let r=Math.min(n,e/2,t/2);return`M 0 ${r} A ${r} ${r} 0 0 1 ${r} 0 L ${e-r} 0 A ${r} ${r} 0 0 1 ${e} ${r} L ${e} ${t-r} A ${r} ${r} 0 0 1 ${e-r} ${t} L ${r} ${t} A ${r} ${r} 0 0 1 0 ${t-r} Z`}return`M 0 0 L ${e} 0 L ${e} ${t} L 0 ${t} Z`};function i({path:e,aspectRatio:t,width:n,height:r}){return{path:e,scaleX:n/t.width,scaleY:r/t.height}}let a={rect:r,circle:({width:e,height:t})=>`M ${e/2} ${t/2} m -${e/2}, 0 a ${e/2},${t/2} 0 1,0 ${e},0 a ${e/2},${t/2} 0 1,0 -${e},0`,star:function({width:e,height:t}){let n=e/2,r=t/2,i=e/2,a=t/2,o=i/2,l=a/2,s="",c=Math.PI/5;for(let e=0;e<10;e++){let t=e%2==0?a:l,u=n+(e%2==0?i:o)*Math.sin(e*c),d=r-t*Math.cos(e*c);0===e?s=`M ${u} ${d}`:s+=` L ${u} ${d}`}return s+" Z"},triangle:({width:e,height:t})=>`M ${e/2} 0 L ${e} ${t} L 0 ${t} Z`,rightTriangle:({width:e,height:t})=>`M 0 0 L ${e} 0 L 0 ${t} Z`,diamond:function({width:e,height:t}){let n=e/2,r=t/2;return`M ${n} 0 L ${e} ${r} L ${n} ${t} L 0 ${r} Z`},pentagon:function({width:e,height:t}){let n=e/2,r=t/2,i=e/2,a=t/2,o="",l=2*Math.PI/5;for(let e=0;e<5;e++){let t=n+i*Math.sin(e*l),s=r-a*Math.cos(e*l);0===e?o=`M ${t} ${s}
638`:o+=` L ${t} ${s}`}return o+" Z"},hexagon:function({width:e,height:t}){let n=e/2,r=t/2,i=e/2,a=t/2,o="",l=2*Math.PI/6;for(let e=0;e<6;e++){let t=n+i*Math.sin(e*l),s=r-a*Math.cos(e*l);0===e?o=`M ${t} ${s}`:o+=` L ${t} ${s}`}return o+" Z"},speechBubble:function({width:e,height:t}){let n=.1*Math.min(e,t),r=.2*e,i=.2*t,a=.5*e;return`M ${n},0`+(" H "+(e-n)+` A ${n},${n} 0 0 1 ${e},${n}`+" V "+(t-n-i)+` A ${n},${n} 0 0 1 ${e-n},${t-i}`+` H ${a+r/2}`+` L ${a},${t}`+` L ${a-r/2},${t-i}`+` H ${n}`+` A ${n},${n} 0 0 1 0,${t-n-i}`+` V ${n}`)+` A ${n},${n} 0 0 1 ${n},0`+" Z"},cross:function({width:e,height:t}){let n=.3*e,r=.3*t,i=e/2,a=t/2,o=i-n/2,l=i+n/2,s=a-r/2,c=a+r/2;return`M ${o},0 H ${l} V ${s} H ${e} V ${c} H ${l} V ${t} H ${o} V ${c} H 0 V ${s} H ${o} V 0 Z`},arc:({width:e,height:t})=>i({path:"M234 117C234 85.97 221.673 56.21 199.731 34.269C177.79 12.327 148.03 0 117 0C85.97 0 56.2103 12.327 34.2685 34.268C12.3268 56.21 0 85.97 0 117H117H234Z",aspectRatio:{width:234,height:117},width:e,height:t}),cloud:({width:e,height:t})=>i({path:"M216.41 57.006C216.961 54.084 217.249 51.069 217.249 47.986C217.249 21.4841 195.972 0 169.725 0C153.666 0 139.467 8.043 130.865 20.3575C122.606 13.3566 111.954 9.1402 100.327 9.1402C74.3322 9.1402 53.2123 30.2136 52.8094 56.364H52.8035C23.6407 56.364 0 80.235 0 109.682C0 139.129 23.6407 163 52.8035 163H208.197C237.359 163 261 139.129 261 109.682C261 83.056 241.672 60.99 216.41 57.006Z",aspectRatio:{width:261,height:163},width:e,height:t}),rightArrow:({width:e,height:t})=>{let n=.6*e;return`M 0 ${t/4} L ${n} ${t/4} L ${n} 0 L ${e} ${t/2} L ${n} ${t} L ${n} ${.75*t} L 0 ${.75*t} Z`},leftArrow:({width:e,height:t})=>{let n=.4*e;return`M ${e} ${t/4} L ${n} ${t/4} L ${n} 0 L 0 ${t/2} L ${n} ${t} L ${n} ${.75*t} L ${e} ${.75*t} Z`},downArrow:({width:e,height:t})=>{let n=.6*t;return`M ${e/4} 0 L ${e/4} ${n} L 0 ${n} L ${e/2} ${t} L ${e} ${n} L ${.75*e} ${n} L ${.75*e} 0 Z`},upArrow:({width:e,height:t})=>{let n=.4*t;return`M ${e/4} ${t} L ${e/4} ${n} L 0 ${n} L ${e/2} 0 L ${e} ${n} L ${.75*e} ${n} L ${.75*e} ${t} Z`},asterisk1:({width:e,height:t})=>i({path:"M45.5265 218.498C51.5466 222.87 58.5359 224.98 65.4742 224.98C75.916 224.98 86.221 220.2 92.853 211.217C92.872 211.198 92.89 211.178 92.907 211.157C92.923 211.136 92.939 211.115 92.954 211.094L92.97
6387 211.061C92.993 211.039 93.008 211.017 93.023 210.996L116.491 178.725L139.959 210.996C139.982 211.031 140.006 211.058 140.029 211.088C140.04 211.102 140.05 211.116 140.061 211.132C151.115 226.188 172.355 229.505 187.473 218.515C202.608 207.526 205.992 186.278 195.074 171.104L195.05 171.066C195.03 171.034 195.014 171.01 194.989 170.985L171.572 138.696L209.512 126.346C227.334 120.545 237.129 101.305 231.33 83.476C225.532 65.648 206.315 55.8493 188.476 61.6334L150.537 73.933L150.52 34.0064C150.502 15.2594 135.248 0 116.508 0C97.768 0 82.514 15.2594 82.497 34.0234L82.463 73.916L44.5233 61.6163C44.5083 61.6163 44.49 61.613 44.4716 61.6078C44.4477 61.6014 44.4232 61.5918 44.4041 61.5823C26.5992 55.8664 7.45076 65.665 1.66886 83.46C-4.11314 101.254 5.61427 120.426 23.3511 126.278C23.3675 126.283 23.3822 126.289 23.3963 126.295L23.4588 126.319L23.4873 126.329L61.4098 138.679L37.9929 170.968C37.9844 170.985 37.9718 171.002 37.9591 171.019C37.9462 171.036 37.9336 171.053 37.9251 171.07C26.9903 186.244 30.3915 207.509 45.5265 218.498Z",aspectRatio:{width:233,height:225},width:e,height:t}),asterisk2:({width:e,height:t})=>i({path:"M46.0556 112L0 85.388L33.9456 26.6121L80.028 53.1781L80.054 0H147.946L147.972 53.1781L194.054 26.6121L228 85.388L181.944 112L228 138.612L194.054 197.388L147.972 170.822L147.946 224H80.054L80.028 170.822L33.9456 197.388L0 138.612L46.0556 112Z",aspectRatio:{width:228,height:224},width:e,height:t}),bookmark:({width:e,height:t})=>i({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:e,height:t}),butterfly:({width:e,height:t})=>i({path:"M94.5 100.713C91.935 150.916 50.703 190.909 0 191.493V0C50.703 0.5845 91.935 40.5767 94.5 90.78C97.031 41.2385 137.217 1.6407 187 0.0438004V191.45C137.217 189.853 97.031 150.255 94.5 100.713Z",aspectRatio:{width:187,height:192},width:e,height:t}),cylinder:({width:e,height:t})=>i({path:"M169 36.8497V218.15C169 238.502 131.168 255 84.5 255C37.832 255 0 238.502 0 218.15V36.8497C0 16.4982 37.832 0 84.5 0C131.168 0 169 16.4982 169 36.8497Z",aspectRatio:{width:169,height:255},width:e,height:t}),diamond2:({width:e,height:t})=>i({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:e,height:t}),door:({width:e,height:t})=>i({path:"M140 69.697C140 31.2044 108.66 0 70 0C31.34 0 0 31.2044 0 69.697V207H140V69.697Z",aspectRatio:{width:140,height:207},width:e,height:t}),drop1:({width:e,height:t})=>i({path:"M167 150.687C167 196.328 129.407 234 83.139 234C37.593 234 0 196.328 0 150.687C0 100.7 51.329 36.9474 83.139 0C114.948 39.1207 167 98.526 167 150.687Z",aspectRatio:{width:167,height:234},width:e,height:t}),drop2:({width:e,height:t})=>i({path:"M73 239C53.64 239 35.071 231.315 21.3812 217.634C7.691 203.954 0 185.4 0 166.054C0 136.091 13.8696 113.633 30.768 86.27C43.912 64.9877 58.888 40.7377 70.597 7.6816C71.281 5.7496 72.989 0 72.989 0C72.989 0 72.993 0.0124998 73 0.0363998C73.007 0.0124998 73.011 0 73.011 0C73.011 0 74.719 5.7496 75.403 7.6816C87.112 40.7377 102.088 64.9877 115.232 86.27C132.13 113.633 146 136.091 146 166.054C146 185.4 138.309 203.954 124.619 217.634C111.025 231.218 92.225 239 73 239Z",aspectRatio:{width:146,height:239},width:e,height:t}),explosion:({width:e,height:t})=>i({path:"M165.802 184.465L118.997 260L125.343 182.079L34.9058 219.45L99.164 159.817L0 163.792L78.538 134.373L0 74.7401L86.471 89.052V0L118.997 89.052L165.802 10.3364L149.143 97.798L217.368 29.419L165.802 112.905L245.927 81.101L165.802 143.914H261L165.802 184.465Z",aspectRatio:{width:261,height:260},width:e,height:t}),flag:({width:e,height:t})=>i({path:"M0 142.161C0 142.161 51.9956 118.626 103 137.469C159.992 158.525 206 141.31 206 141.31V11.1373C206 11.1373 160 28.3218 103.016 7.28273C52 -11.553 0 12.0974 0 12.0974V142.161Z",aspectRatio:{width:206,height:148},width:e,height:t}),flower:({width:e,height:t})=>i({path:"M135.351 66.1893C196.683 -5.00591 256.536 100.304 164.908 117.361C256.536 135.16 195.944 239.728 135.351 168.532C166.386 257.526 45.9394 256.785 76.975 168.532C15.643 239.728 -44.2109 135.16 47.4173 117.361C-44.9498 100.304 15.643 -4.26431 76.975 66.1893C45.2005 -22.0631 166.386 -22.0631 135.351 66.
6381893ZM105.793 104.012C113.183 104.012 119.833 109.945 119.833 117.361C119.833 124.777 113.183 131.452 105.793 131.452C98.404 131.452 92.492 124.777 92.492 117.361C92.492 109.945 98.404 104.012 105.793 104.012Z",aspectRatio:{width:212,height:235},width:e,height:t}),frame:({width:e,height:t})=>i({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:e,height:t}),heart1:({width:e,height:t})=>i({path:"M215.886 56.157C215.886 24.729 191.112 0 160.584 0C135.933 0 115.08 16.983 107.937 39.93C100.788 16.986 79.935 0.591 55.284 0.591C24.75 0.591 0 24.615 0 56.055C0 71.919 6.321 83.127 16.494 95.121L107.988 189.447L199.377 95.121C209.559 83.127 215.886 72.009 215.886 56.157Z",aspectRatio:{width:216,height:190},width:e,height:t}),home:({width:e,height:t})=>i({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:e,height:t}),home2:({width:e,height:t})=>i({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:e,height:t}),hourglass:({width:e,height:t})=>i({path:"M0.392782 0H187.607C193.014 43.3688 140.804 53.797 140.804 97.5C140.804 141.203 193.014 151.631 187.607 195H0.392782C-5.01452 151.631 47.196 141.203 47.196 97.5C47.196 53.797 -5.01452 43.3688 0.392782 0Z",aspectRatio:{width:188,height:195},width:e,height:t}),house:({width:e,height:t})=>i({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:e,height:t}),keyhole:({width:e,height:t})=>i({path:"M115 57.0494C115 25.5387 89.416 0 57.863 0C26.311 0 0.726898 25.5414 0.726898 57.0494C0.726898 78.652 12.759 97.451 30.505 107.136L0 219H114.845L84.448 107.524C102.608 97.962 115 78.959 115 57.0494Z",aspectRatio:{width:115,height:219},width:e,height:t}),kiss:({width:e,height:t})=>i({path:"M124.5 17.1468C80.036 -36.5162 0 52.9218 0 52.9218C0 52.9218 44.4643 120 124.5 120C204.536 120 249 52.9218 249 52.9218C249 52.9218 168.964 -36.5162 124.5 17.1468Z",aspectRatio:{width:249,height:120},width:e,height:t}),leaf:({width:e,height:t})=>i({path:"M204.414 0.0151567C204.414 0.0151567 206.837 93.9509 150.394 150.394C93.9507 206.837 0.0151569 204.413 0.0151569 204.413C0.0151569 204.413 -2.40835 110.478 54.0347 54.0349C110.478 -2.40834 204.414 0.0151567 204.414 0.0151567Z",aspectRatio:{width:205,height:205},width:e,height:t}),lightning1:({width:e,height:t})=>i({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:e,height:t}),lightning2:({width:e,height:t})=>i({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:e,height:t}),magnet:({width:e,height:t})=>i({path:"M88.402 0H0V67.669H88.402C105.271 67.669 118.957 81.308 118.957 98C118.957 114.689 105.271 128.331 88.402 128.331H0V196H88.402C142.747 196 187 152.072 187 98C187 43.9279 142.747 0 88.402 0Z",aspectRatio:{width:187,height:196},width:e,height:t}),mithosis:({width:e,height:t})=>i({path:"M150.996 136.45C137.141 128.926 117.559 128.7 103.532 135.896C93.843 140.867 82.875 143.67 71.2577 143.67C31.9033 143.67 0 111.508 0 71.835C0 32.161 31.9033 0 71.2577 0C83.467 0 94.959 3.0955 105.004 8.5504C118.859 16.0745 138.441 16.3 152.467 9.1038C162.157 4.1328 173.125 1.3303 184.742 1.3303C224.097 1.3303 256 33.492 256 73.165C256 112.839 224.097 145 184.742 145C172.533 145 161.041 141.905 150.996 136.45Z",aspectRatio:{width:256,height:145},width:e,height:t}),orangeRicky:({width:e,height:t})=>i({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:e,height:t}),party:({width:e,height:t})=>i({path:"M134.622 0L144.682 68.2539L174.415 5.9977L163.91 74.1846L210.671 23.4578L180.535 85.519L240.169 50.8289L193.079 101.25L260.29 85.679L200.43 119.98L269.245 124.911L201.934 140.044L266.237 165.04L197.456 159.661L251.535 202.5L187.396 177.086L226.445 233.962L172.646 190.771L193.197 256.631L154.518 199.501L154.743 268.492L134.622 202.5L114.501 268.492L114.727 199.501L76.0482 256.631L96.5985 190.771L42.7992 233.962L81.8489 177.086L17.7091 202.5L71.7885 159.661L3.0072 165.04L67.3112 140.044L0 124.911L68.8149 119.98L8.9545 85.679L76.1658 101.25L29.0753 50.8289L88.7105 85.519L58.5743 23.4578L105.335 74.1846L94.8305 5.9977L124.562 68.2539L134.622 0Z",aspectRatio:{width:270,height:269},width:e,height:t}),pillow:({width:e,height:t})=>i({path:"M176 0.00169945C157.812 16.9062 125.203 28.174 88.001 28.174C50.798 28.174 18.1881 16.9054 0 0V258.421C18.1882 241.516 50.798 230.248 88 230.248C125.202 230.248 157.812 241.516 176 258.421V0.00169945Z",as
638pectRatio:{width:176,height:259},width:e,height:t}),polygon:({width:e,height:t})=>i({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:e,height:t}),rainbow:({width:e,height:t})=>i({path:"M186.907 141H282C282 63.128 218.872 0 141 0C63.1278 0 0 63.128 0 141H95.093C95.093 115.646 115.646 95.093 141 95.093C166.354 95.093 186.907 115.646 186.907 141Z",aspectRatio:{width:282,height:141},width:e,height:t}),rhodeIsland:({width:e,height:t})=>i({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:e,height:t}),shell:({width:e,height:t})=>i({path:"M109 0C169.199 0 218 48.743 218 108.87C185.392 108.87 158.958 135.273 158.958 167.842C158.958 179.736 158.958 191 158.958 191H59.042C59.042 191 59.042 179.736 59.042 167.842C59.042 135.273 32.6077 108.87 0 108.87C0 48.743 48.8007 0 109 0Z",aspectRatio:{width:218,height:191},width:e,height:t}),shield1:({width:e,height:t})=>i({path:"M203.184 30.7277C142.457 30.7277 102.853 0 102.853 0C102.853 0 63.249 30.7277 3.05098 30.7277C3.05098 30.7277 -3.81372 128.209 3.05098 162.115C9.38758 193.902 102.853 249 102.853 249C102.853 249 196.319 193.902 203.184 162.115C209.52 128.738 203.184 30.7277 203.184 30.7277Z",aspectRatio:{width:206,height:249},width:e,height:t}),shield2:({width:e,height:t})=>i({path:"M0 12.9585C64.624 -4.3195 136.376 -4.3195 201 12.9585C201 51.0564 201 89.154 201 127.252C201 184.396 100.498 240 100.498 240C100.498 240 0 184.406 0 127.252C0 89.154 0 51.0564 0 12.9585Z",aspectRatio:{width:201,height:240},width:e,height:t}),skewedRectangle:({width:e,height:t})=>i({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:e,height:t}),softFlower:({width:e,height:t})=>i({path:"M109 0C80.073 0 56.6234 23.4498 56.6234 52.3766C56.6234 54.722 54.722 56.6234 52.3766 56.6234C23.4498 56.6234 0 80.073 0 109C0 137.927 23.4498 161.377 52.3766 161.377C54.722 161.377 56.6234 163.278 56.6234 165.623C56.6234 194.55 80.073 218 109 218C137.927 218 161.377 194.55 161.377 165.623C161.377 163.278 163.278 161.377 165.623 161.377C194.55 161.377 218 137.927 218 109C218 80.073 194.55 56.6234 165.623 56.6234C163.278 56.6234 161.377 54.722 161.377 52.3766C161.377 23.4498 137.927 0 109 0Z",aspectRatio:{width:218,height:218},width:e,height:t}),softStar:({width:e,height:t})=>i({path:"M130.424 3.17662C130.927 -1.05888 137.073 -1.05888 137.576 3.17662L141.792 38.7086C147.236 84.59 183.41 120.764 229.291 126.208L264.823 130.424C269.059 130.927 269.059 137.073 264.823 137.576L229.291 141.792C183.41 147.236 147.236 183.41 141.792 229.291L137.576 264.823C137.073 269.059 130.927 269.059 130.424 264.823L126.208 229.291C120.764 183.41 84.59 147.236 38.7086 141.792L3.17662 137.576C-1.05888 137.073 -1.05888 130.927 3.17662 130.424L38.7086 126.208C84.59 120.764 120.764 84.59 126.208 38.7086L130.424 3.17662Z",aspectRatio:{width:268,height:268},width:e,height:t}),stairs1:({width:e,height:t})=>i({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:e,height:t}),stairs2:({width:e,height:t})=>i({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:e,height:t}),teewee:({width:e,height:t})=>i({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:e,height:t}),blob1:({width:e,height:t})=>i({path:"M172.979 19.611C191.285 33.0858 204.505 54.442 210.861 78.5949C217.471 103.002 217.471 130.46 205.776 151.816C194.335 173.427 171.454 189.444 147.047 196.054C122.639 202.919 96.7069 200.631 75.3506 190.715C54.2486 180.546 37.7229 163.003 23.4855 142.155C9.5022 121.307 -2.19289 97.4087 0.349524 74.7813C3.14617 52.1538 19.9261 30.7976 40.2654 17.8313C60.6046 4.61077 84.5033 -0.474048 108.148 0.0344341C131.538 0.542916 154.928 6.13621 172.979 19.611Z",aspectRatio:{width:216,height:200},width:e,height:t}),blob10:({width:e,height:t})=>i({path:"M188.684 8.95173C205.601 24.3309 200.988 63.0866 191.453 99.3816C182.225 135.677 168.076 169.511 146.238 175.355C124.399 181.507 94.871 159.668 66.5733 143.059C37.9679 126.449 10.5929 115.068 2.59569 95.0754C-5.4015 75.0824 5.97912 46.1694 24.4342 30.4826C42.8893 14.7958 68.4188 12.0276 100.715 6.79864C132.704 1.5697 171.767 -6.42749 188.684 8.95173Z",aspectRatio:{width:200,height:177},width:e,height:t}),blob11:({width:e,height:t})=>i({path:"M137.368 29.4923C148.97 46.7605 146.542 72.1231 148.161 99.1046C149.779 126.086 155.715 154.956 144.113 174.383C132.781 193.81 103.911 203.793 80.4369 198.666C56.963 193.27 38.6156 173.034 28.3626 153.607C17.8398 134.181 15.4115 115.833 9.47555 91.5498C3.53961 67.2664 -5.63411 37.3169 4.61887 20.0488C15.1417 2.51078 45.0911 -1.80626 72.8821 0.622074C100.673 2.78059 126.036 12.2241 137.368 29.4923Z",aspectRatio:{width:152,height:200},width:e,height:t}),blob12:({width:e,height:t})=>i({path:"M158.391 17.923C172.491 28.5703 180.261 48.1384 187.743 70.5842C194.937 93.3177 202.419 118.641 194.649 138.785C187.167 158.928 164.146 173.317 138.535 184.54C112.923 196.05 84.4347 204.108 58.8235 197.777C33.2123 191.446 10.191 170.439 2.99688 146.267C-4.48504 121.807 3.57241 94.181 10.4788 68.282C17.0974 42.0953 22.565 17.6352 37.8166 7.27563C53.0682 -3.37171 78.1038 0.081487 100.837 2.67138C123.859 5.26127 144.29 7.27563 158.391 17.923Z",aspectRatio:{width:198,height:200},width:e,height:t}),blob13:({width:e,height:t})=>i({path:"M149.668 1.37595C170.663 5.22017 193.728 17.3442 198.755 34.7911C204.078 52.2379 191.363 75.3032 178.943 93.9329C166.819 112.563 154.99 126.757 140.501 145.386C126.011 164.312 108.86 187.673 92.5957 186.194C76.3317 185.011 60.9549 159.285 45.8737 140.655C30.4968 122.321 15.7114 110.788 7.43151 95.1157C-0.848339 79.4432 -2.32688 59.0392 3.5873 41.5924C9.50148 23.8498 23.1041 8.76868 38.7767 3.44592C54.745 -1.87685 73.3746 2.55879 91.7086 2.26308C110.338 2.26308 128.968 -2.17256 149.668 1.37595Z",as
638pectRatio:{width:200,height:187},width:e,height:t}),blob14:({width:e,height:t})=>i({path:"M137.838 28.6426C150.711 40.5617 165.014 46.5213 178.363 58.2021C191.474 69.8828 203.87 87.0464 198.864 99.6807C193.858 112.315 171.689 120.42 157.862 135.676C144.275 151.171 139.269 173.579 126.873 182.161C114.477 190.505 94.9294 185.022 76.8123 178.109C58.4568 171.196 41.5316 163.091 28.1822 150.456C14.5943 137.822 4.58225 120.42 1.24488 101.826C-2.09248 83.2322 1.00651 62.9697 13.8792 52.4809C26.7519 41.992 49.1598 41.0385 65.6083 30.788C82.0567 20.5376 92.0688 0.990158 103.034 0.0366268C113.762 -0.916905 125.204 16.9618 137.838 28.6426Z",aspectRatio:{width:200,height:187},width:e,height:t}),blob15:({width:e,height:t})=>i({path:"M185.203 1.52939C197.679 7.62217 200 32.2835 200 51.7223C200 71.1612 197.389 85.3777 197.679 100.175C198.259 114.681 201.741 129.768 198.259 143.114C194.778 156.46 184.623 168.356 171.567 173.868C158.801 179.671 143.134 179.091 130.368 174.739C117.312 170.387 106.867 162.263 86.8482 160.812C66.539 159.362 36.9454 164.294 18.9572 155.3C0.968966 146.306 -5.41395 123.095 5.03083 105.977C15.4756 88.5692 42.4579 77.5442 55.5139 59.5559C68.2798 41.8578 67.1192 17.4867 76.9837 9.6531C86.5581 2.10965 107.158 11.3939 128.627 9.6531C150.097 8.20244 172.728 -4.27327 185.203 1.52939Z",aspectRatio:{width:200,height:179},width:e,height:t}),blob16:({width:e,height:t})=>i({path:"M158.441 55.3221C167.253 80.2399 160.264 105.462 147.501 134.938C134.738 164.717 116.81 199.055 97.0576 199.967C77.3057 201.182 55.7305 168.668 34.4592 133.722C13.1879 99.0802 -7.77953 62.3112 2.85612 36.4818C13.4918 10.6523 56.0344 -3.93369 90.0685 0.928322C123.799 6.09421 149.324 30.7081 158.441 55.3221Z",aspectRatio:{width:163,height:200},width:e,height:t}),blob17:({width:e,height:t})=>i({path:"M168.917 36.7587C178.871 53.2457 175.138 76.5764 172.961 106.129C170.472 135.37 169.85 170.832 150.563 187.63C131.276 204.739 93.3252 203.495 65.0173 187.63C36.7095 172.077 18.0449 142.213 7.77943 107.373C-2.79714 72.2213 -4.35252 32.7147 14.312 14.0502C32.9765 -4.3033 72.1721 -1.50361 103.591 4.7179C135.32 10.6283 158.962 20.2717 168.917 36.7587Z",aspectRatio:{width:176,height:200},width:e,height:t}),blob18:({width:e,height:t})=>i({path:"M178.188 21.1464C193.012 36.3069 196.381 62.9219 198.739 88.1893C200.76 113.12 201.771 136.366 190.316 149.168C178.862 162.307 155.279 164.665 135.065 167.697C115.188 170.73 99.0168 174.098 72.4018 177.131C46.1237 180.163 9.40176 182.521 1.65309 168.371C-6.09559 154.221 15.4659 123.564 23.5515 92.9059C31.6371 62.2481 26.2467 31.2534 38.3751 15.4192C50.1665 -0.0781831 79.8136 -1.08888 107.776 0.595609C136.076 1.9432 163.028 5.64909 178.188 21.1464Z",aspectRatio:{width:200,height:180},width:e,height:t}),blob19:({width:e,height:t})=>i({path:"M148.621 13.3857C171.945 24.3818 194.937 41.3756 192.938 60.702C190.605 80.3615 163.282 101.687 149.953 123.346C136.958 145.005 137.958 166.664 128.295 174.661C118.631 182.325 98.3054 175.994 73.6476 181.991C48.9899 187.989 20.0004 205.983 11.0036 197.986C1.67366 189.989 12.6697 156.001 12.3365 131.343C12.0033 106.685 0.340809 91.0243 0.00759636 75.0301C-0.325616 59.0359 10.3372 42.3753 25.3318 28.7135C39.9931 15.0518 58.9863 4.05578 80.3119 1.05687C101.638 -2.27526 124.962 2.38972 148.621 13.3857Z",aspectRatio:{width:194,height:200},width:e,height:t}),blob2:({width:e,height:t})=>i({path:"M140.464 18.6393C156.081 28.3718 169.887 39.9149 178.714 54.853C187.541 69.5649 191.389 87.6717 189.578 104.421C187.768 121.396 180.525 137.239 172.377 153.535C164.455 169.832 155.854 186.58 142.048 194.276C128.241 201.971 109.456 200.613 92.4804 197.671C75.2789 194.502 60.1144 189.749 45.1762 182.733C30.4644 175.716 16.2052 166.21 8.28346 153.083C0.361703 139.729 -1.44898 122.527 1.04072 106.91C3.30408 91.2931 9.64147 76.8076 15.9789 60.5114C22.0899 44.2153 28.201 26.1084 40.6495 14.7916C53.0979 3.24849 71.8838 -1.27823 89.7643 0.306124C107.871 1.66414 124.846 9.13322 140.464 18.6393Z",aspectRatio:{width:191,height:200},width:e,height:t}),blob20:({width:e,height:t})=>i({path:"M150.035 13.2464C157.376 24.9386 153.026 48.323 157.92 65.7254C163.087 83.1277 177.498 94.2761 182.392 108.415C187.287 122.555 182.392 139.957 173.147 156.272C163.63 172.587 149.763 187.814 132.089 195.155C114.414 202.225 93.2053 201.137 73.6276 194.611C54.3219 188.357 36.9196 176.937 25.7712 161.438C14.8947 145.667 10.5441 126.09 5.92163 105.696C1.57105 85.0311 -3.05145 63.5501 2.65869 45.0601C8.64075 26.5701 24.6835 11.0711 43.1735 4.54524C61.6635 -1.98064 82.6007 0.194657 102.722 1.01039C122.844 1.82613 142.421 1.55421 150.035 13.2464Z",aspectRatio:{width:185,height:200},width:e,height:t}),blob21:({width:e,height:t})=>i({path:"M152.611 0.184799C172.596 -0.723643 197.73 1.39606 199.85 13.8114C201.969 26.2268 181.075 48.9379 174.716 68.0151C168.357 87.0924 176.533 102.536 174.11 114.649C171.991 127.064 159.575 136.148 146.252 139.782C132.928 143.719 118.696 141.902 105.977 139.176C93.562 136.451 82.6606 132.212 63.2805 131.909C43.9004 131.606 16.0416 135.24 5.44306 125.853C-5.15543 116.465 1.50648 94.0572 10.2881 76.4939C18.7669 59.2335 29.6682 46.8182 38.7526 35.3112C48.1398 23.5015 56.3158 12.903 66.9143 8.36078C77.5128 4.12138 91.1394 6.24108 104.766 5.6354
6386C118.696 4.72701 132.928 1.09324 152.611 0.184799Z",aspectRatio:{width:200,height:143},width:e,height:t}),blob22:({width:e,height:t})=>i({path:"M195.507 15.5715C206.818 33.1668 193.622 69.3001 190.166 101.663C186.71 134.34 193.308 163.561 181.996 178.014C170.685 192.153 141.464 191.525 114.443 189.326C87.1072 187.44 62.2852 183.67 40.6052 169.531C19.2395 155.077 1.6441 130.255 0.0730908 103.862C-1.18372 77.4694 13.898 49.5054 35.2638 31.91C56.6296 14.0004 84.5936 6.45958 116.328 2.37494C148.063 -1.70969 184.196 -2.3381 195.507 15.5715Z",aspectRatio:{width:200,height:191},width:e,height:t}),blob23:({width:e,height:t})=>i({path:"M135.742 9.14189C157.815 19.2326 179.258 38.4681 176.105 56.7576C172.951 74.7317 145.202 92.0751 127.858 109.734C110.83 127.077 104.523 145.052 87.4953 164.918C70.4672 184.468 42.7177 206.227 27.5816 198.343C12.4455 190.46 9.60747 153.566 6.45411 126.762C2.98542 100.274 -0.798607 84.1917 0.147399 67.1636C0.77807 50.4508 6.76944 32.4767 19.0675 20.8093C31.0503 9.14189 49.6551 3.78119 70.4672 1.2585C90.964 -1.26418 113.668 -0.633508 135.742 9.14189Z",aspectRatio:{width:177,height:200},width:e,height:t}),blob24:({width:e,height:t})=>i({path:"M165.663 24.3715C171.555 44.4059 158.003 76.2254 151.816 96.2598C145.923 116.294 147.691 124.544 148.28 135.445C148.575 146.346 147.396 159.309 140.62 170.8C133.549 181.996 120.88 191.424 104.381 196.432C87.8821 201.441 67.553 202.03 54.8841 192.602C41.9207 183.469 36.6174 164.023 25.1271 143.105C13.3421 122.187 -4.33535 99.7953 0.967891 85.0641C6.27113 70.6275 34.2604 63.8511 56.0626 48.5307C77.5702 33.5048 92.8907 9.93489 113.22 2.56928C133.843 -4.79633 159.77 4.04241 165.663 24.3715Z",aspectRatio:{width:168,height:200},width:e,height:t}),blob25:({width:e,height:t})=>i({path:"M180.115 1.256C192.651 2.1962 189.83 34.163 190.771 58.2947C191.711 82.4265 196.098 98.4099 198.606 117.214C201.113 136.018 201.426 157.642 189.204 165.791C177.294 173.626 153.163 167.671 135.299 163.91C117.749 159.836 106.466 157.956 85.7818 162.97C65.0974 168.298 35.3244 180.521 18.7143 174.253C1.79068 167.985 -1.97012 142.913 0.850478 120.975C3.67107 99.0367 13.0731 79.6059 18.4009 54.8473C23.7287 30.0888 24.9823 -0.310996 40.0254 0.00240332C54.7552 0.00240332 82.9612 31.029 111.167 31.029C139.373 31.029 167.579 0.315802 180.115 1.256Z",aspectRatio:{width:200,height:176},width:e,height:t}),blob26:({width:e,height:t})=>i({path:"M142.571 0.586925C159.976 3.39414 176.258 15.1844 184.96 30.9048C193.662 46.6253 194.224 66.8372 189.171 83.6805C183.837 100.805 172.327 114.56 163.064 129.157C153.8 143.755 146.501 158.914 134.43 173.231C122.359 187.828 105.516 201.303 89.5146 199.899C73.2327 198.776 58.0738 182.775 42.9148 169.862C28.0366 157.23 13.7198 147.685 6.42103 134.491C-0.877729 12
6381.297 -1.15845 103.892 1.64876 88.4528C4.45598 72.7324 10.0704 58.6963 18.4921 47.4674C27.1944 36.2386 38.4233 27.8169 50.4943 22.2025C62.846 16.3073 75.7592 13.5001 91.1989 8.72785C106.919 4.23631 125.166 -1.93957 142.571 0.586925Z",aspectRatio:{width:193,height:200},width:e,height:t}),blob27:({width:e,height:t})=>i({path:"M112.602 54.9337C129.225 71.8646 155.391 78.9448 158.777 89.719C162.471 100.493 143.693 114.654 127.07 135.586C110.447 156.519 96.2866 184.224 71.0442 194.998C46.1096 205.465 10.4008 199.308 2.0893 178.375C-6.22223 157.443 12.5557 121.734 18.4045 92.1817C24.5612 62.6296 17.7889 38.9263 26.4082 21.9954C34.7197 5.06454 58.423 -5.40183 73.5069 2.9097C88.8986 10.9134 95.9788 38.0028 112.602 54.9337Z",aspectRatio:{width:160,height:200},width:e,height:t}),blob28:({width:e,height:t})=>i({path:"M125.281 68.5835C142.15 82.9923 165.344 90.021 181.862 108.998C198.028 127.624 207.516 158.902 192.405 166.634C177.293 174.716 137.581 159.605 112.629 156.442C87.326 152.928 77.1344 161.713 59.9142 165.579C43.0453 169.445 19.1478 168.391 11.7677 157.496C4.73907 146.25 14.2278 124.813 11.4163 94.2382C8.2534 63.6634 -6.85825 23.9514 3.68476 8.48836C14.2278 -7.32615 50.4254 1.10826 73.9715 16.2199C97.5175 31.683 108.412 54.1747 125.281 68.5835Z",aspectRatio:{width:200,height:169},width:e,height:t}),blob29:({width:e,height:t})=>i({path:"M162.987 10.2348C169.16 25.1809 154.864 58.6471 147.066 79.4417C139.268 100.236 138.293 108.359 134.719 114.532C131.47 120.706 125.297 124.93 119.448 143.45C113.6 161.97 107.426 194.461 98.004 199.335C88.5814 204.209 75.5849 181.14 55.7651 167.494C35.6203 153.522 8.65241 148.648 1.8292 135.327C-4.994 122.33 8.65241 100.561 20.0244 82.041C31.3964 63.5208 40.1691 48.2498 53.4906 35.5782C66.8122 22.9065 84.0326 13.159 106.452 6.33584C128.871 -0.812285 156.489 -4.71127 162.987 10.2348Z",aspectRatio:{width:165,height:200},width:e,height:t}),blob3:({width:e,height:t})=>i({path:"M158.095 64.2637C176.543 95.19 192.277 129.1 181.697 155.686C171.117 182.001 133.951 201.533 99.4982 199.905C64.7739 198.549 33.0338 176.032 15.4004 145.377C-2.23296 114.994 -5.75963 76.2002 10.2461 46.6303C26.2518 17.0605 61.5185 -3.557 89.732 0.512241C118.217 4.58149 139.377 33.0662 158.095 64.2637Z",aspectRatio:{width:186,height:200},width:e,height:t}),blob30:({width:e,height:t})=>i({path:"M146.076 34.4585C157.052 54.582 155.833 80.1936 164.675 100.622C173.212 121.355 191.201 136.905 189.372 149.711C187.542 162.212 165.285 171.969 146.99 175.018C129.001 178.372 114.671 174.713 103.39 175.018C92.1083 175.018 83.876 178.982 66.8015 186.299C49.7271 193.617 23.8105 204.288 14.3586 198.19C4.90665 191.787 11.6145 168.615 10.3949 147.882C8.87037 127.148 -0.581561 108.549 0.0282404 89.3407C0.638042 70.1319 11.6145 50.6182 28.384 32.934C44.8487 15.5546 67.4113 0.309578 89.974 0.00467694C112.537 -0.300224 135.099 14.335 146.076 34.4585Z",aspectRatio:{width:190,height:200},width:e,height:t}),blob31:({width:e,height:t})=>i({path:"M134.218 44.0392C153.568 36.4264 184.97 26.9105 195.755 33.2544C206.222 39.9156 195.755 62.1194 181.481 76.3933C166.89 90.35 148.175 96.0596 145.638 116.36C143.1 136.661 156.74 171.235 151.664 183.923C146.589 196.928 123.434 187.413 105.036 178.531C86.6388 169.967 73.3165 161.72 52.0643 158.548C30.812 155.058 1.62986 156.644 0.0438693 145.225C-1.22492 133.806 25.4197 109.382 29.2261 86.8609C32.7152 64.3398 13.6834 44.0392 11.7802 26.9105C9.877 9.46461 24.7853 -4.80928 42.5484 1.53467C59.9942 7.87863 79.9777 34.5232 93.6172 45.308C107.257 56.4099 114.869 51.3347 134.218 44.0392Z",aspectRatio:{width:200,height:191},width:e,height:t}),blob32:({width:e,height:t})=>i({path:"M200 100.339C200 149.831 145.763 197.966 95.5932 197.966C45.7627 197.966 0 149.831 0 100.339C0 50.8475 45.7627 0 95.5932 0C145.763 0 200 50.8475 200 100.339Z",aspectRatio:{width:200,height:198},width:e,height:t}),blob4:({width:e,height:t})=>i({path:"M183.427 38.712C198.21 63.2519 196.141 95.1833 189.341 126.523C182.836 157.863 171.305 188.908 150.609 197.482C130.208 205.76 100.642 192.16 69.8936 177.968C39.4405 164.072 7.80478 150.176 1.30024 128.593C-5.2043 107.01 13.718 77.7393 35.3012 51.7211C56.5888 25.9986 81.1287 3.23272 108.921 0.276112C137.009 -2.38484 168.349 14.4678 183.427 38.712Z",aspectRatio:{width:195,height:200},width:e,height:t}),blob5:({width:e,height:t})=>i({path:"M166.251 30.6913C183.816 48.5185 195.875 71.8512 199.021 98.8542C202.429 125.595 197.186 155.744 179.359 169.115C161.794 182.223 131.645 178.815 103.331 176.979C75.0171 175.144 48.8006 174.882 29.6625 161.512C10.7866 148.141 -0.748681 121.925 0.0378149 96.2326C0.824311 70.8025 14.1947 46.159 33.0706 28.3318C52.2087 10.5045 76.8522 -0.5064 100.971 0.0179307C125.091 0.804426 148.423 12.864 166.251 30.6913Z",aspectRatio:{width:200,height:179},width:e,height:t}),blob6:({width:e,height:t})=>i({path:"M149.146 50.5452C161.911 68.0278 171.901 81.9028 176.619 97.9979C181.336 114.37 180.781 133.241 173.011 149.891C165.519 166.541 151.366 180.693 133.051 189.851C114.736 199.008 92.2586 202.893 71.446 197.621C50.6334 192.348 30.9308 177.918 18.1658 158.216C5.12323 138.791 -0.981801 113.815 0.128204 87.7304C1.51571 61.6453 10.6733 34.1726 29.2658 17.5226C48.1359 1.14999 76.996 -4.40004 98.9186 3.6475C120.841 11.695 136.381 32.7851 149.146 50.5452Z",aspectRatio:{width:180,height:200},width:e,height:t}),blob7:({width:e,height:t})=>i({path:"M158.662 41.8295C178.593 57.8305 204.138 64.5677 213.402 79.7266C222.666 94.6047 215.367 118.466 203.015 135.028C190.383 151.871 172.698 161.977 156.416 168.434C140.134 174.89 124.975 177.697 104.483 185.277C83.9903 192.856 58.1642 205.208 44.9704 197.629C31.4959 190.33 31.2152 163.1 21.9514 138.116C12.9684 112.851 -4.71688 90.1132 1.17822 75.5158C7.35404 61.1991 36.8295 55.5847 58.7256 40.1452C80.9024 24.7056 95.4998 -0.278374 109.816 0.00234533C124.414 0.283064 138.45 25.8285 158.662 41.8295Z",aspectRatio:{width:218,he
638ight:200},width:e,height:t}),blob8:({width:e,height:t})=>i({path:"M153.53 11.0108C168.179 18.1858 181.931 29.5461 192.993 44.4939C203.755 59.4417 212.425 78.2759 210.631 96.5122C209.136 114.748 197.477 132.088 182.529 142.252C167.581 152.716 148.747 156.004 128.717 168.262C108.687 180.22 87.1622 201.147 69.8228 199.951C52.7823 198.456 39.6283 174.54 32.4533 153.015C25.2784 131.49 24.0826 112.357 16.6087 91.131C9.13477 70.2041 -4.31825 46.8855 1.36191 31.9377C7.04207 16.691 31.8554 9.51607 52.7823 5.33069C73.4103 0.846349 90.4507 -0.648433 106.594 0.248435C123.037 1.1453 138.882 4.13486 153.53 11.0108Z",aspectRatio:{width:211,height:200},width:e,height:t}),blob9:({width:e,height:t})=>i({path:"M140.289 20.2182C156.96 27.7956 176.661 32.0895 189.29 43.9608C201.667 55.5796 206.718 75.0283 202.424 91.6987C198.131 108.622 184.491 122.766 175.651 140.952C166.81 158.885 162.769 180.607 150.393 191.216C138.016 201.824 117.052 201.572 98.866 197.025C80.6802 192.479 65.2727 183.891 48.3497 175.808C31.4268 167.726 13.2409 160.148 5.1583 146.761C-2.67172 133.122 -0.398493 113.673 4.14797 96.7504C8.69444 80.08 15.5141 65.6828 23.3442 52.296C31.4268 38.6566 40.5197 25.775 52.6436 15.6717C65.0201 5.82101 80.6802 -1.50385 95.3299 0.264221C109.98 1.77971 123.619 12.6407 140.289 20.2182Z",aspectRatio:{width:204,height:200},width:e,height:t})};function o(e){return a[e]||r}function l(e){let{subType:t}=e,n=o(t);return n?function(e,t){let{width:n,height:r,fill:i,stroke:a,strokeWidth:o,dash:l}=e,s=(l||[]).map(e=>e*o),c=t(e),u=1,d=1;"string"!=typeof c&&(u=c.scaleX,d=c.scaleY,c=c.path);let h=`clip-${e.id||Math.random()}`;return` 639 <svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${r}"> 640 <defs> 641 <clipPath id="${h}"> 642 <path d="${c}" /> 643 </clipPath> 644 </defs> 645 646 <!-- Path for the fill -->\n <path d="${c}" fill="${i}" transform="scale(${u}, ${d})"/> 647 648 <!-- Path for the stroke, clipped by the star path -->\n <path d="${c}" fill="none" stroke="${a}" stroke-width="${2*o}" clip-path="url(#${h})" transform="scale(${u}, ${d})" stroke-dasharray="${s.join(" ")}"/> 649 </svg> 650 `}(e,n):(console.error(`Polotno error: Can not convert ${e.subType} figure to svg.`),r(e))}},42614:function(e,t,n){"use strict";var r,i;function a(e,t){let n={filter:"",html:void 0};switch(e){case r.warm:{let e=Math.max(0,Math.min(1,null!=t?t:.5));return n.filter="url(#warm-filter)",n.html=` 651 <svg xmlns="http://www.w3.org/2000/svg" style="display:none"> 652 <filter id="warm-filter" color-interpolation-filters="sRGB"> 653 <feColorMatrix type="matrix" values=" 654 ${1+.3*e} 0 0 0 0 655 0 ${1+.15*e} 0 0 0 656 0 0 1 0 0 657 0 0 0 1 0" /> 658 </filter> 659 </svg>`,n}case r.cold:{let e=Math.max(0,Math.min(1,null!=t?t:.5));return n.filter="url(#cold-filter)",n.html=` 660 <svg xmlns="http://www.w3.org/2000/svg" style="display:none"> 661 <filter id="cold-filter" color-interpolation-filters="sRGB"> 662 <feColorMatrix type="matrix" values=" 663 ${1-.15*e} 0 0 0 0 664 0 ${1-.1*e} 0 0 0 665 0 0 ${1+.15*e} 0 0 666 0 0 0 1 0" /> 667 </filter> 668 </svg>`,n}case"natural":{let e=Math.max(0,Math.min(1,null!=t?t:.5));return n.filter=`saturate(${1+.3*e}) brightness(${1+.1*e}) contrast(${1+.2*e})`,n}case r.temperature:{let e=Math.max(-1,Math.min(1,null!=t?t:0));return n.filter="url(#temperature-filter)",n.html=` 669 <svg xmlns="http://www.w3.org/2000/svg" style="display:none"> 670 <filter id="temperature-filter" color-interpolation-filters="sRGB"> 671 <feColorMatrix type="matrix" values=" 672 ${1+.15*e} 0 0 0 0 673 0 1 0 0 0 674 0 0 ${1-.15*e} 0 0 675 0 0 0 1 0" /> 676 </filter> 677 </svg> 678 `,n}case r.contrast:{let e=100*Math.max(-1,Math.min(1,null!=t?t:0)),r=259*(e+255)/(255*(259-e)),i=.5*(1-r);
678return n.filter="url(#contrast-filter)",n.html=` 679 <svg xmlns="http://www.w3.org/2000/svg" style="display:none"> 680 <filter id="contrast-filter" color-interpolation-filters="sRGB"> 681 <feComponentTransfer> 682 <feFuncR type="linear" slope="${r}" intercept="${i}" /> 683 <feFuncG type="linear" slope="${r}" intercept="${i}" /> 684 <feFuncB type="linear" slope="${r}" intercept="${i}" /> 685 </feComponentTransfer> 686 </filter> 687 </svg> 688 `,n}case r.shadows:{let e=Math.min(Math.max(1-.6*Math.max(-1,Math.min(1,null!=t?t:0)),.4),2.5);return n.filter="url(#shadows-filter)",n.html=` 689 <svg xmlns="http://www.w3.org/2000/svg" style="display:none"> 690 <filter id="shadows-filter" color-interpolation-filters="sRGB"> 691 <feComponentTransfer> 692 <feFuncR type="gamma" amplitude="1" exponent="${e}" offset="0" /> 693 <feFuncG type="gamma" amplitude="1" exponent="${e}" offset="0" /> 694 <feFuncB type="gamma" amplitude="1" exponent="${e}" offset="0" /> 695 </feComponentTransfer> 696 </filter> 697 </svg> 698 `,n}case r.white:case r.black:return null;case r.vibrance:{let e;let r=Math.max(-1,Math.min(1,null!=t?t:0)),i=1-(e=r>=0?1+1.5*r:1+r);return n.filter="url(#vibrance-filter)",n.html=` 699 <svg xmlns="http://www.w3.org/2000/svg" style="display:none"> 700 <filter id="vibrance-filter" color-interpolation-filters="sRGB"> 701 <feColorMatrix type="matrix" values=" 702 ${.299*i+e} ${.587*i} ${.114*i} 0 0 703 ${.299*i} ${.587*i+e} ${.114*i} 0 0 704 ${.299*i} ${.587*i} ${.114*i+e} 0 0 705 0 0 0 1 0" /> 706 </filter> 707 </svg> 708 `,n}case r.saturation:{let e=1+Math.max(-1,Math.min(1,null!=t?t:0)),r=1-e;return n.filter="url(#saturation-filter)",n.html=` 709 <svg xmlns="http://www.w3.org/2000/svg" style="display:none"> 710 <filter id="saturation-filter" color-interpolation-filters="sRGB"> 711 <feColorMatrix type="matrix" values=" 712 ${.2126*r+e} ${.7152*r} ${.0722*r} 0 0 713 ${.2126*r} ${.7152*r+e} ${.0722*r} 0 0 714 ${.2126*r} ${.7152*r} ${.0722*r+e} 0 0 715 0 0 0 1 0" /> 716 </filter> 717 </svg> 718 `,n}default:return null}}n.d(t,{E:function(){return a},z:function(){return r}}),(i=r||(r={})).sepia="sepia",i.grayscale="grayscale",i.natural="natural",i.warm="warm",i.cold="cold",i.temperature="temperature",i.contrast="contrast",i.shadows="shadows",i.white="white",i.black="black",i.vibrance="vibrance",i.saturation="saturation"},84360:function(e,t,n){"use strict";n.d(t,{flags:function(){return i},zs:function(){return o}});var r=n(59533);n(68571);let i=r.LO({imageDownScalingEnabled:!0,removeBackgroundEnabled:!1,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",textSplitAllowed:!1,animationsEnabled:!1,aiTextEnabled:!1,autoDeleteEmptyText:!0}),a="undefined"!=typeof window&&"localhost"===window.location.hostname;r.aD(e=>{i.textVerticalResizeEnabled=e});let o=r.aD(e=>{i.removeBackgroundEnabled=e});r.aD(e=>{a&&console.warn("useRemoveBackground is deprecated. Use setRemoveBackgroundEnabled instead."),o(e)}),r.aD(e=>{i.aiTextEnabled=e}),r.aD(e=>{a&&console.warn("useHtmlTextRender is deprecated. Use setRichTextEnabled instead."),i.htmlRenderEnabled=e}),r.aD(e=>{i.htmlRenderEnabled=e});let l=r.aD(e=>{i.imageDownScalingEnabled=e});r.aD(e=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),l(e)}),r.aD(e=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),i.textOverflow="change-font-size"}),r.aD(e=>{i.textOverflow=e}),r.aD(e=>{i.textSplitAllowed=e}),r.aD(e=>{i.animationsEnabled=e}),r.aD(e=>{i.autoDeleteEmptyText=e})},1032:function(e,t,n){"use strict";let r,i;n.d(t,{$W:function(){return k},Bp:function(){return u},ER:function(){return h},Jf:function(){return E},Qo:function(){return y},R7:function(){return d},Xo:function(){return P},mx:function(){return w},xi:function(){return S}});var a=n(59533),o=n(69389),l=n(94877);let s=a.LO(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]),c=a.LO({value:!1});function u(){return c.value}function d(){return s}let h=a.LO([]),f="BESbswy 0123456789 Il1Ww",p=["sans-serif","serif","monospace"];function m(e){return{width:e.width,actualBoundingBoxLeft:e.actualBoundingBoxLeft||0,actualBoundingBoxRight:e.actualBoundingBoxRight||0,actualBoundingBoxAscent:e.actualBoundingBoxAscent||0,actualBoundingBoxDescent:e.actualBoundingBoxDescent||0}}function g(e="sans-serif",t="normal",n="normal",i=f){r||(r=document.createElement("canvas"));let a=r.getContext("2d");return a.font=`${t} ${n} 40px ${e}`,m(a.measureText(i))}function v(e,t,n,i,a){return p.some(o=>(function(e,t,n=.01){return Math.abs(e.width-t.width)>n||Math.abs(e.actualBoundingBoxLeft-t.actualBoundingBoxLeft)>n||Math.abs(e.actualBoundingBoxRight-t.actualBoundingBoxRight)>n||Math.abs(e.actualBoundingBoxAscent-t.actualBoundingBoxAscent)>n||Math.abs(e.actualBoundingBoxDescent-t.actualBoundingBoxDescent)>n})(function(e,t="sans-serif",n="normal",i="normal",a=f){r||(r=document.createElement("canvas"));let o=r.getContext("2d");return o.font=`${n} ${i} 40px '${e}', ${t}`,m(o.measureText(a))}(e,o,t,n,i),a[o]))}let b={Arial:!0},y=(e,t,n)=>t&&n?!!b[`${e}_${t}_${n}`]:Object.keys(b).some(t=>t.startsWith(e+"_"))||!!b[e];async function w(e,t,n,r){var i;let a=`${e}_${t}_${n}`;if(b[a])return;let s=!!(null===(i=document.fonts)||void 0===i?void 0:i.load),c=function(e){let t=function(e=""){let t=(0,l.av)(e).replace(/\s+/g," ").trim();return t?Array.from(t).slice(0,10).join(""):""}(e);return t?`${f} ${t}`:f}(r),u={"sans-serif":g("sans-serif",t,n,c),serif:g("serif",t,n,c),monospace:g
718("monospace",t,n,c)};if(s)try{if(await document.fonts.load(`${t} ${n} 16px '${e}'`,c),v(e,t,n,c,u))return void(b[a]=!0)}catch(e){}let d=Math.min(6e3,(0,o.yJ)())/60;for(let r=0;r<d;r++){if(v(e,t,n,c,u))return void(b[a]=!0);await new Promise(e=>setTimeout(e,60))}console.warn(`Timeout for loading font "${e}". Looks like polotno can't load it. Is it a correct font family?`),(0,o.TG)(`Timeout for loading font "${e}"`)}let x={},C="400,400italic,700,700italic";function E(){return C}function k(e){return`https://fonts.googleapis.com/css?family=${e.replace(/ /g,"+")}:${C}`}function S(e){if(x[e])return;let t=k(e),n=document.createElement("link");n.type="text/css",n.href=t,n.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(n),x[e]=!0}let T={};function P(e){let t=e.fontFamily;if(T[t]||!e.url&&!e.styles)return;let n=e.styles||(e.url?[{src:`url("${e.url}")`}]:[]),r=(i||((i=document.getElementById("polotno-font-style"))||((i=document.createElement("style")).id="polotno-font-style",document.head.appendChild(i)),i)).sheet;n.forEach(e=>{r.insertRule(` 719 @font-face{ 720 font-family:'${t}'; 721 src:${e.src}; 722 font-style:${e.fontStyle||"normal"}; 723 font-weight:${e.fontWeight||"normal"}; 724 font-display:swap; /* optional but recommended */ 725 }`,r.cssRules.length)}),T[e.fontFamily]=!0}},16812:function(e,t,n){"use strict";let r,i,a;n.d(t,{cY:function(){return m},zo:function(){return g}});let o={data:""},l=e=>"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||o,s=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,c=/\/\*[^]*?\*\/|\s\s+|\n/g,u=(e,t)=>{let n="",r="",i="";for(let a in e){let o=e[a];"@"==a[0]?"i"==a[1]?n=a+" "+o+";":r+="f"==a[1]?u(o,a):a+"{"+u(o,"k"==a[1]?"":t)+"}":"object"==typeof o?r+=u(o,t?t.replace(/([^,])+/g,e=>a.replace(/(^:.*)|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):a):null!=o&&(a=a.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=u.p?u.p(a,o):a+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},d={},h=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+h(e[n]);return t}return e},f=(e,t,n,r,i)=>{var a;let o=h(e),l=d[o]||(d[o]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(o));if(!d[l]){let t=o!==e?e:(e=>{let t,n=[{}];for(;t=s.exec(e.replace(c,""));)t[4]?n.shift():t[3]?n.unshift(n[0][t[3]]=n[0][t[3]]||{}):n[0][t[1]]=t[2];return n[0]})(e);d[l]=u(i?{["@keyframes "+l]:t}:t,n?"":"."+l)}return a=d[l],-1==t.data.indexOf(a)&&(t.data=r?a+t.data:t.data+a),l};function p(e){let t,n,r=this||{},i=e.call?e(r.p):e;return f(i.unshift?i.raw?(t=[].slice.call(arguments,1),n=r.p,i.reduce((e,r,i)=>{let a=t[i];if(a&&a.call){let e=a(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;a=t?"."+t:e&&"object"==typeof e?e.props?"":u(e,""):!1===e?"":e}return e+r+(null==a?"":a)},"")):i.reduce((e,t)=>Object.assign(e,t&&t.call?t(r.p):t),{}):i,l(r.target),r.g,r.o,r.k)}function m(e,t,n,o){u.p=t,r=e,i=n,a=o}function g(e,t){let n=this||{};return function(){let o=arguments;function l(s,c){let u=Object.assign({},s),d=u.className||l.className;n.p=Object.assign({theme:i&&i()},u),n.o=/ *go\d+/.test(d),u.className=p.apply(n,o)+(d?" "+d:""),t&&(u.ref=c);let h=e;return e[0]&&(h=u.as||e,delete u.as),a&&h[0]&&a(u),r(h,u)}return t?t(l):l}}p.bind({g:1}),p.bind({k:1})},26436:function(e,t,n){"use strict";n.d(t,{H:function(){return i},l:function(){return o}});var r=n(6863);let i=e=>e.indexOf("linear-gradient")>=0,a=e=>"hex"===e.type?"#"+e.value:"literal"===e.type?e.value:`${e.type}(${e.value.join(",")})`,o=e=>{if(!i(e))return{rotation:0,stops:[{offset:0,color:e},{offset:1,color:e}]};let t=r.parse(e)[0];return{rotation:t.orientation&&"value"in t.orientation?parseFloat(t.orientation.value):0,stops:t.colorStops.map((e,n)=>({color:a(e),offset:e.length?parseFloat(e.length.value)/100:n/(t.colorStops.length-1)}))}}},9051:function(e,t,n){"use strict";n.d(t,{Ad:function(){return i},EH:function(){return l},po:function(){return a},xJ:function(){return o}});var r=n(72365);function i(e){return new Promise(t=>{let n=document.createElement("img");n.onload=async()=>{0===n.width||0===n.height?t(await (0,r.Bm)(e)):t({width:n.width,height:n.height})},n.crossOrigin="anonymous",n.src=e})}function a(e){return new Promise((t,n)=>{let r=document.createElement("img");r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.crossOrigin="anonymous",r.src=e})}async function o(e,t){let n,r;let i=await a(e),o=document.createElement("canvas");o.width=2*i.width,o.height=2*i.height,o.getContext("2d").drawImage(i,0,0,o.width,o.height);
725let l=document.createElement("canvas");l.width=t.width,l.height=t.height;let s=l.getContext("2d"),{cropX:c,cropY:u}=t,d=o.width*t.cropWidth,h=o.height*t.cropHeight,f=t.width/t.height,p=d/h;return"svg"===t.type?(n=d,r=h):f>=p?(n=d,r=d/f):(n=h*f,r=h),s.drawImage(o,c*o.width,u*o.height,n,r,0,0,l.width,l.height),l.toDataURL("image/png")}function l(e,t){let n,r;let{width:i,height:a}=e,o=i/a;o>=t.width/t.height?(n=t.width,r=t.width/o):(n=t.height*o,r=t.height);let l=(t.width-n)/2,s=(t.height-r)/2;return{cropX:l/t.width,cropY:s/t.height,cropWidth:n/t.width,cropHeight:r/t.height}}},54043:function(e,t,n){"use strict";n.d(t,{t:function(){return l}});var r=n(59533);let i=(0,r.LO)({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",curvedText:"Curved text",curvePower:"Power",temperature:"Temperature",saturation:"Saturation",contrast:"Contrast",shadows:"Shadows",white:"White",black:"Black",vibrance:"Vibrance",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",filters:"Filters",sepia:"Sepia",grayscale:"Grayscale",cold:"Cold",natural:"Natural",warm:"Warm",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",copyStyle:"Copy style",uppercase:"Uppercase",position:"Position",layering:"Layering",toForward:"To Front",up:"Forward",down:"Backward",toBottom:"To back",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",clip:"Apply mask",removeClip:"Remove mask",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked. Unlock it to allow changes from canvas.",unlockedDescription:"Object is unlocked. Lock it to prevent changes from canvas.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size",fade:"Fade",move:"Move",zoom:"Zoom",animate:"Animate",rotate:"Rotate",none:"None",bounce:"Bounce",blink:"Blink",strength:"Strength",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width",strokeSettings:"Stroke settings",spacing:"Spacing",volume:"Volume",lineStyle:"Line style",lineStartHead:"Line start",lineEndHead:"Line end",textDirection:"Text direction",fontSize:"Font size",fontFamily:"Font family",textAlign:"Text align",verticalAlign:"Vertical align",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",cellBackgroun
725d:"Cell background",tableBorderSettings:"Border settings",tableBorderColor:"Border color",tableBorderWidth:"Border width",tableBorderStyle:"Border style",borderAllSides:"All sides",borderTop:"Top",borderBottom:"Bottom",borderLeft:"Left",borderRight:"Right",borderNone:"No border",tableStructure:"Table structure",tableRows:"Rows",tableColumns:"Columns",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",deleteRow:"Delete row",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteColumn:"Delete column",distributeRowsEvenly:"Distribute rows evenly",distributeColumnsEvenly:"Distribute columns evenly",cellPadding:"Cell padding",listFormat:"List",colorPicker:{solid:"Solid",linear:"Linear",angle:"Angle"},aiText:{aiWrite:"AI write",rewrite:"Rewrite",shorten:"Shorten",continue:"Continue writing",proofread:"Proofread",tones:"Tones",friendly:"Friendly",professional:"Professional",humorous:"Humorous",formal:"Formal",customPrompt:"Custom prompt",generatedResult:"Generated result",cancel:"Cancel",generate:"Generate",back:"Back",tryAgain:"Try Again",insert:"Insert",promptPlaceholder:"Describe what you want to generate"}},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down",moveLeft:"Move left",moveRight:"Move right"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",videos:"Videos",animations:"Animations",effects:"Effects",elements:"Elements",shapes:"Shapes",tables:"Tables",lines:"Lines",draw:"Draw",upload:"Upload",uploadImage:"Add file",uploadTip:"Upload your assets",background:"Backgroun
725d",resize:"Resize",layers:"Layers",animate:"Animate",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",clipImage:"Mask image",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"},pagesTimeline:{pages:"Pages",removePage:"Remove page",addPage:"Add page",duplicatePage:"Duplicate page",removeAudio:"Remove audio",duplicateAudio:"Duplicate audio",muteAudio:"Mute",unmuteAudio:"Unmute",volume:"Volume"},contextMenu:{duplicate:"Duplicate",remove:"Remove",lock:"Lock",unlock:"Unlock",copy:"Copy",paste:"Paste",copyStyle:"Copy style",moveUp:"Move up",moveDown:"Move down",moveBack:"Move back",moveForward:"Move forward"}}),a=e=>e&&"object"==typeof e;(0,r.aD)((e,{validate:t=!1}={})=>{t&&function e(t,n,r=""){Object.keys(n).forEach(i=>{let o=n[i],l=r?`${r}.${i}`:i;a(o)?a(t[i])?e(t[i],o,l):console.warn(`Missing nested translation object at '${l}'`):void 0===t[i]&&console.warn(`Missing translation '${l}'`)})}(e,i),function e(t,n){Object.keys(n).forEach(r=>{let i=t[r],o=n[r];a(o)&&a(i)?e(i,o):t[r]=o})}(i,e)});let o={},l=e=>{let t=function(e,t){var n,r=t.split("."),i=e;for(n=0;n<r.length;++n){if(null==i[r[n]])return;i=i[r[n]]}return i}(i,e);if(void 0!==t)return t;o[e]||(o[e]=!0,console.warn(`Missing translation '${e}'`));let n=e.split("."),r=n[n.length-1]||" ";return r.charAt(0).toUpperCase()+r.slice(1)}},69389:function(e,t,n){"use strict";n.d(t,{TG:function(){return d},aM:function(){return l},qY:function(){return c},yJ:function(){return o}});var r=n(36677);let i=0,a=[],o=()=>6e3;function l(e){i+=1;let t=!1,n=!1,r=setTimeout(()=>{t||(d(`Timeout loading asset ${e}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",e),t=!0,s())},3e4);return()=>{n?console.error("Finish called twice! That is not expected. id: ",e):(n=!0,t||(clearTimeout(r),s()))}}function s(){0==(i-=1)&&(a.forEach(e=>e()),a=[])}function c(){return new Promise(e=>{var t;return t=()=>{(0,r.w_)()?setTimeout(e,300):e(!0)},void(0===i?t():a.push(t))})}let u=[];function d(e){u.forEach(t=>t(e))}},57042:function(e,t,n){"use strict";function r(e){return e/180*Math.PI}function i(e,t,n,r,i){let a=Math.sqrt(n*n+r*r);return{x:e+a*Math.cos(i+=Math.atan2(r,n)),y:t+a*Math.sin(i)}}function a(e){let{x:t,y:n,width:a,height:o}=e,l=r(e.rotation),s=i(t,n,0,0,l),c=i(t,n,a,0,l),u=i(t,n,a,o,l),d=i(t,n,0,o,l),h=Math.min(s.x,c.x,u.x,d.x),f=Math.min(s.y,c.y,u.y,d.y),p=Math.max(s.x,c.x,u.x,d.x),m=Math.max(s.y,c.y,u.y,d.y);return{x:h,y:f,width:p-h,height:m-f,minX:h,minY:f,maxX:p,maxY:m}}function o(e){let t=e.map(e=>a(e)),n=Math.min(...t.map(e=>e.minX)),r=Math.min(...t.map(e=>e.minY)),i=Math.max(...t.map(e=>e.maxX)),o=Math.max(...t.map(e=>e.maxY));return{x:n,y:r,width:i-n,height:o-r,minX:n,minY:r,maxX:i,maxY:o}}function l(e,t){return function(e,t,n){let i=r(t),a=n.x+(e.x-n.x)*Math.cos(i)-(e.y-n.y)*Math.sin(i),o=n.y+(e.x-n.x)*Math.sin(i)+(e.y-n.y)*Math.cos(i);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:a,y:o})}(e,t,function(e){let t=r(e.rotation||0);return{x:e.x+e.width/2*Math.cos(t)+e.height/2*Math.sin(-t),y:e.y+e.height/2*Math.cos(t)+e.width/2*Math.sin(t)}}(e))}n.d(t,{Ne:function(){return o},Pl:function(){return l},VK:function(){return a}})},77555:function(e,t,n){"use strict";n.d(t,{Y:function(){return i},p:function(){return r}});let r="\n p {\n margin: 0;\n padding: 0;\n word-wrap: break-word; /* Required for Firefox */\n /* a text may have several spaces, we need to preserve them */\n white-space: pre-wrap;\n }\n\n /* Reset default list styles and setup counters */\n ul, ol {\n list-style: none; /* Remove default markers */\n padding-inline-start: 0; /* Reset padding */\n margin: 0;\n display: block; /* Use block instead of inline-block for better text wrapping */\n width: 100%;\n text-decoration: inherit;\n counter-reset: ol-counter; /* Initialize counter for ol */\n }\n\n li {\n position: relative; /* Needed for absolute positioning of ::before */\n padding-inline-start: 2.1em; /* Space for the marker (start side) */\n margin: 0; /* Reset default li margins */\n word-wrap: break-word; /* Required for Firefox text wrapping */\n white-space: pre-wrap;
725 /* Preserve spaces and allow wrapping */\n }\n\n li::before {\n content: ''; /* Base content */\n position: absolute;\n /* Use logical properties for positioning */\n inset-inline-start: 0; /* Position marker at the start edge (left in LTR, right in RTL) */\n top: 0; /* Adjust vertical alignment */\n /* Prevent letter-spacing from affecting the marker */\n letter-spacing: normal;\n /* Define width to ensure consistent spacing and alignment */\n display: inline-block;\n width: 2em; /* Width for the marker container */\n /* Align multi-digit numbers to the end (right in LTR, left in RTL) */\n text-align: end; \n /* Space between marker and text (using logical property) */\n margin-inline-end: 0.8em; /* Pushes text away from marker (2.5em total = 1.7em width + 0.8em margin)*/\n /* Prevent marker style from inheriting list item styles */\n font-weight: normal;\n font-style: normal;\n }\n\n /* Style for bullet points */\n ul > li::before {\n content: 'â¢'; /* Literal bullet character */\n /* Center the bullet within its allocated width */\n text-align: center; /* Override text-align: end for bullets */\n font-size: 1.2em;\n top: 0em; /* Re-adjust vertical alignment for bullet */\n /* Bullets don't need number alignment, width can be tighter */\n width: 2em;\n /* Adjust margin to maintain overall padding */\n margin-inline-end: 1.5em; /* 2.5em total padding = 1em width + 1.5em margin */\n }\n\n /* Style for numbers using counter */\n ol > li {\n counter-increment: ol-counter; /* Increment counter for each li in ol */\n }\n\n ol > li::before {\n content: counter(ol-counter) \".\"; /* Display counter value + dot */\n }\n\n .ql-indent-1 {\n margin-inline-start: 0.5em;\n }\n .ql-indent-2 {\n margin-inline-start: 1em;\n }\n .ql-indent-3 {\n margin-inline-start: 1.5em;\n }\n",i=` 726<style> 727 html, body { 728 padding: 0; 729 margin: 0; 730 } 731 ${r} 732</style> 733`},96283:function(e,t,n){"use strict";n.d(t,{XA:function(){return l},b1:function(){return o},tq:function(){return i},wz:function(){return a}});var r=n(7653);let i=()=>window.innerWidth<=800,a=e=>` 734 @media (max-width: 800px) { 735 ${e} 736 } 737 738 .polotno-mobile & { 739 ${e} 740 } 741`,o=()=>"ontouchstart"in window||navigator.maxTouchPoints>0,l=()=>{let[e,t]=r.useState(i());return r.useEffect(()=>{let e=()=>{t(i())};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),e}},43808:function(e,t,n){"use strict";var r=n(7653),i=n(16812);(0,i.cY)(r.createElement,void 0,void 0,void 0),t.Z=i.zo},72365:function(e,t,n){"use strict";n.d(t,{Bm:function(){return p},XP:function(){return f},Y_:function(){return v},d4:function(){return d},mf:function(){return g},rr:function(){return b},tS:function(){return m},uh:function(){return h}});var r=n(8585),i=n(7653),a=n(26436),o=n(15904);function l(e){let t={};return e.querySelectorAll("style").forEach(e=>{for(let n of o.parse(e.textContent).stylesheet.rules)n.selectors&&n.selectors.forEach(e=>{let r=t[e]||{};n.declarations.forEach(e=>{r[e.name]=e.value}),t[e]=r})}),t}function s(e,t){var n;let r={fill:"",stroke:""},i=(null===(n=e.getAttribute("class"))||void 0===n?void 0:n.split(" "))||[],a=e.getAttribute("id"),o={};a&&t[`#${a}`]?o=t[`#${a}`]:i.forEach(e=>{t[`.${e}`]&&(o=Object.assign(Object.assign({},o),t[`.${e}`]))}),t[e.nodeName]&&(o=Object.assign(Object.assign({},o),t[e.nodeName]));let l=e.getAttribute("fill");l&&"none"!==l?r.fill=l:o.fill&&"none"!==o.fill&&(r.fill=o.fill);let c=e.getAttribute("stroke");if(c&&"none"!==c?r.stroke=c:o.stroke&&"none"!==o.stroke&&(r.stroke=o.stroke),!r.fill&&e.style.fill&&"none"!==e.style.fill&&(r.fill=e.style.fill),!r.stroke&&e.style.stroke&&"none"!==e.style.stroke&&(r.stroke=e.style.stroke),!r.stroke&&!r.fill){let n=e.ownerSVGElement,i=n&&n!==e?s(n,t):null;"currentColor"===(null==i?void 0:i.fill)||"currentColor"===(null==i?void 0:i.stroke)||(r.fill="black")}return r}let c=["path","rect","circle","line","polygon","polyline","ellipse","text"];function u(e){for(var t=[],n=e.getElementsByTagName("*"),r=0,i=n.length;r<i;r++){let e=n[r];(function(e){for(;e.parentNode;){if("defs"===e.nodeName)return!0;e=e.parentNode}return!1})(e)||(null!==e.getAttribute("fill")&&t.push(e),(null!==e.getAttribute("stroke")||e.style&&e.style.fill||c.indexOf(e.nodeName)>=0)&&t.push(e))}return t}async function d(e){let t=await fetch(e);return f(await t.text())}async function h(e){let t=await fetch(e,{mode:"cors"});return await t.text()}function f(e){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(e)))}async function p(e){let t=await h(e),n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement.getAttribute("viewBox"),[r,i,a,o]=(null==n?void 0:n.split(" "))||[];return{width:parseFloat(a),height:parseFloat(o)}}function m(e){var t=(new DOMParser).parseFromString(e,"image/svg+xml");let n=t.documentElement.getAttribute("viewBox"),[r,i,a,o]=(null==n?void 0:n.split(" "))||[],l=t.documentElement.getAttribute("width");l||t.documentElement.setAttribute("width",a+"px");let s=t.documentElement.getAttribute("height");if((!s||s.indexOf("%")>=0)&&t.documentElement.setAttribute("height",o+"px"),l&&l.indexOf("%")>=0&&s&&-1===s.indexOf("%")){let e=parseFloat(s)/parseFloat(o);t.documentElement.setAttribute("width",e*parseFloat(a)+"px")}if(s&&s.indexOf("%")>=0&&l&&-1===l.indexOf("%")){let e=parseFloat(l)/parseFloat(a);t.documentElement.setAttribute("height",e*parseFloat(o)+"px")}return"100%"===l&&"100%"===s&&(t.documentElement.setAttribute("width",a+"px"),t.documentElement.setAttribute("height",o+"px")),(new XMLSerializer).serializeToString(t)}let g=(e,t)=>{if(!e||!t)return!1;if("currentColor"===t&&"black"===e)return!0;let n=r.Z.Util.colorToRGBA(e),i=r.Z.Util.colorToRGBA(t);return n&&i?n.r===i.r&&n.g===i.g&&n.b===i.b&&n.a===i.a:void 0};function v(e,t){var n=(new DOMParser).parseFromString(e,"image/svg+xml");let i=u(n),o=Array.from(t.keys()),c=l(n);
741return i.forEach(e=>{let{fill:i,stroke:l}=s(e,c);[{prop:"fill",color:i},{prop:"stroke",color:l}].forEach(({prop:i,color:l})=>{let s=o.find(e=>g(e,l));if(s){let o=t.get(s);if((0,a.H)(o)){let{rotation:t,stops:l}=(0,a.l)(o),s=l.map(e=>({offset:100*e.offset+"%","stop-color":e.color})),c="color"+Math.round(1e8*Math.random());(function(e,t,n,i){var a=e.namespaceURI,o=document.createElementNS(a,"linearGradient");let l=r.Z.Util.degToRad(n+90);o.setAttribute("x1",(Math.cos(l)+1)/2*100+"%"),o.setAttribute("y1",(Math.sin(l)+1)/2*100+"%"),o.setAttribute("x2",(Math.cos(l+Math.PI)+1)/2*100+"%"),o.setAttribute("y2",(Math.sin(l+Math.PI)+1)/2*100+"%"),o.setAttribute("gradientUnits","userSpaceOnUse"),o.setAttribute("id",t);for(var s=0;s<i.length;s++){var c=i[s],u=document.createElementNS(a,"stop");for(var d in c)c.hasOwnProperty(d)&&u.setAttribute(d,c[d]);o.appendChild(u)}(e.querySelector("defs")||e.insertBefore(document.createElementNS(a,"defs"),e.firstChild)).appendChild(o)})(n.children[0],c,t,s),e.style[i]=null,e.setAttribute(i,`url('#${c}')`)}else e.style[i]=t.get(s)}})}),f((new XMLSerializer).serializeToString(n))}let b=e=>{let[t,n]=i.useState([]);return i.useEffect(()=>{let t=!1;return(async()=>{n([]);let i=function(e){var t=(new DOMParser).parseFromString(e,"image/svg+xml");let n=l(t),i=u(t),a=[];return i.forEach(e=>{let{fill:t,stroke:i}=s(e,n);[t,i].forEach(e=>{e&&("currentColor"===e&&(e="black"),r.Z.Util.colorToRGBA(e)&&-1===a.indexOf(e)&&a.push(e))})}),a}(await h(e));t||n(i)})(),()=>{t=!0}},[e]),t}},95710:function(e,t,n){"use strict";n.d(t,{lF:function(){return d},A5:function(){return u},XP:function(){return c},E_:function(){return p},Lt:function(){return m},$I:function(){return f}});var r=n(8585),i=n(26436),a=n(94877),o=n(84360);let l={fontSize:14,fontFamily:"Roboto",fontWeight:"normal",fontStyle:"normal",lineHeight:1.2,letterSpacing:0,textTransform:"none",textDecoration:"",align:"center",fill:"black",stroke:"black",strokeWidth:0,curveEnabled:!1,curvePower:.5};function s(e){return Object.assign(Object.assign({},l),e)}function c(e){return!function(e){e=e.replace(/\s/g,"");let t=0;for(var n=0;n<e.length;n++)(function(e){var t="Ö-ß¿ââ«â®ï¬-﷽ﹰ-ﻼ";return RegExp("^[^"+t+"]*?["+t+"]").test(e)})(e[n])&&(t+=1);return t>e.length/2}(e)?"ltr":"rtl"}function u(e,t,n,r){let i=Math.max(-.9999,Math.min(.9999,n));if(1e-4>Math.abs(i))return`M 0 ${t/2} L ${e} ${t/2}`;let a=5*r/(2*Math.abs(i))-r,o=e/2;if(i>0){let e=2*a+r/2;return`M ${o} ${e} A ${a} ${a} 0 1 1 ${o} ${e-2*a} A ${a} ${a} 0 1 1 ${o} ${e}`}{let e=-(2*a-Math.round(t))-r/2;return`M ${o} ${e} A ${a} ${a} 0 1 0 ${o} ${e+2*a} A ${a} ${a} 0 1 0 ${o} ${e}`}}function d(e,t,n,r){if(!i.H(e))return"";let{stops:a,rotation:o}=i.l(e),l=o*Math.PI/180;return`<linearGradient id="${t}" x1="${100*(.5-.5*Math.sin(l))}%" y1="${100*(.5+.5*Math.cos(l))}%" x2="${100*(.5+.5*Math.sin(l))}%" y2="${100*(.5-.5*Math.cos(l))}%">${a.map(({offset:e,color:t})=>`<stop offset="${100*e}%" stop-color="${t}" />`).join("")}</linearGradient>`}function h(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function f(e,t,n){return e.map(e=>{let r=[];e.bold&&"bold"!==t.fontWeight&&r.push('font-weight="bold"'),e.italic&&"italic"!==t.fontStyle&&r.push('font-style="italic"'),e.underline&&r.push('text-decoration="underline"'),e.strike&&r.push('text-decoration="line-through"'),(null==n?void 0:n.omitColors)||!e.color||e.color===t.fill||r.push(`fill="${h(e.color)}"`);let i=h(e.text);return 0===r.length?i:`<tspan ${r.join(" ")}>${i}</tspan>`}).join("")}function p(e,{fontFamily:t="",color:n="black",forEditor:l=!1}={}){let h=s(e),p=t||h.fontFamily,m=i.H(h.fill),g=i.H(h.stroke),v="ellipsis"===o.flags.textOverflow&&!l&&!h.curveEnabled&&!!h.height,b=(()=>{if(!v)return[];let e=Math.max(1,Math.round(h.height)),t=Math.max(1,Math.floor(e/Math.max(1,("number"==typeof h.lineHeight?h.lineHeight:1.2)*h.fontSize)));return[`max-height: ${e}px`,"overflow: hidden","display: -webkit-box","-webkit-box-orient: vertical",`-webkit-line-clamp: ${t}`,`line-clamp: ${t}`]})(),y=e=>` 742 background-image: ${e}; 743 background-size: 100% 100%; 744 background-repeat: repeat; 745 -webkit-background-clip: text; 746 -moz-background-clip: text; 747 background-clip: text; 748 -webkit-text-fill-color: transparent; 749 color: transparent 750 `.trim(),w=`color: ${n||h.fill}`,x="";g&&h.strokeWidth?(w=`color: ${n||h.fill}; ${y(h.stroke)}`,x=`-webkit-text-stroke: ${h.strokeWidth}px transparent`):m&&(w=y(h.fill));let C=["white-space: pre-wrap","word-break: break-word",`width: ${Math.round(h.width||100)}px`,...b,w,`font-size: ${h.fontSize}px`,`font-family: '${p}'`,`text-align: ${h.align}`,`text-transform: ${h.textTransform}`,h.textDecoration?`text-decoration: ${h.textDecoration}; text-decoration-color: ${n||h.fill}; text-decoration-layer: over`:"",h.lineHeight?`line-height: ${h.lineHeight}`:"",h.letterSpacing?`letter-spacing: ${h.letterSpacing*h.fontSize}px`:"",h.fontStyle?`font-style: ${h.fontStyle}`:"",h.fontWeight?`font-weight: ${h.fontWeight}`:"",x||(h.strokeWidth?`-webkit-text-stroke: ${h.strokeWidth}px ${h.stroke}
750`:""),h.strokeWidth&&!g?"paint-order: stroke fill":""].filter(Boolean).join("; ");if(h.curveEnabled&&!l){let t=function(e){var t,n,i,o;let l=e.a?e.a:e,c=s(e),d=null!==(t=l.fontSize)&&void 0!==t?t:c.fontSize,h=new r.Z.TextPath({data:u(null!==(n=l.width)&&void 0!==n?n:c.width,null!==(o=null!==(i=l.height)&&void 0!==i?i:c.height)&&void 0!==o?o:0,c.curvePower,d),align:"center",textBaseline:"middle",text:(0,a.av)(c.text),fontSize:d,fontFamily:c.fontFamily,fontWeight:c.fontWeight,fontStyle:c.fontStyle,letterSpacing:c.letterSpacing*d,fill:c.fill}),f=h.getSelfRect().height||d;return h.destroy(),f}(e),i=Math.round(h.width||100),o=u(i,t,h.curvePower,h.fontSize),l=(0,a.yh)(h.text),c={fontWeight:h.fontWeight||"normal",fontStyle:h.fontStyle||"normal",fill:n||h.fill||"black"},v=f(l,c),b=f(l,c,{omitColors:!0}),y=`curve-${h.id||"temp"}`,w=h.strokeWidth&&(g||m&&!g),x=`<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${t}"> 751 <defs> 752 <path id="${y}" d="${o}" fill="none" />`;if(m){let e=`curve-fill-grad-${h.id||"temp"}`;x+=d(h.fill,e,i,t)}if(g&&h.strokeWidth){let e=`curve-stroke-grad-${h.id||"temp"}`;x+=d(h.stroke,e,i,t)}if(x+="</defs>",w){let e=` 753 font-family="'${p}'" 754 font-size="${h.fontSize}" 755 font-weight="${h.fontWeight}" 756 font-style="${h.fontStyle}" 757 text-anchor="middle" 758 dominant-baseline="central" 759 letter-spacing="${h.letterSpacing*h.fontSize}px"${h.textDecoration?` text-decoration="${h.textDecoration}"`:""}`,t=g?`url(#curve-stroke-grad-${h.id||"temp"})`:h.stroke;x+=` 760 <text ${e} fill="${t}" stroke="${t}" stroke-width="${h.strokeWidth}"> 761 <textPath href="#${y}" startOffset="50%">${b}</textPath> 762 </text> 763 <text ${e} fill="${m?`url(#curve-fill-grad-${h.id||"temp"})`:n}"> 764 <textPath href="#${y}" startOffset="50%">${v}</textPath> 765 </text>`}else{let e=m?`url(#curve-fill-grad-${h.id||"temp"})`:n,t=g?`url(#curve-stroke-grad-${h.id||"temp"})`:h.stroke;x+=` 766 <text 767 font-family="'${p}'" 768 font-size="${h.fontSize}" 769 font-weight="${h.fontWeight}" 770 font-style="${h.fontStyle}" 771 fill="${e}" 772 text-anchor="middle" 773 dominant-baseline="central" 774 letter-spacing="${h.letterSpacing*h.fontSize}px"${h.textDecoration?` text-decoration="${h.textDecoration}"`:""}${h.strokeWidth?` stroke="${t}" stroke-width="${h.strokeWidth}" paint-order="stroke fill"`:""}> 775 <textPath href="#${y}" startOffset="50%">${v}</textPath> 776 </text>`}return x+"</svg>"}if(h.strokeWidth&&(g||m&&!g)&&!l){let e;let t=(0,a.Z6)(h.text).replace(/\n/g,"<br/>"),r=Math.round(h.width||100),i=["white-space: pre-wrap","word-break: break-word",`width: ${r}px`,...b,`font-size: ${h.fontSize}px`,`font-family: '${p}'`,`text-align: ${h.align}`,`text-transform: ${h.textTransform}`,h.textDecoration?`text-decoration: ${h.textDecoration}; text-decoration-color: ${n||h.fill}; text-decoration-layer: over`:"",h.lineHeight?`line-height: ${h.lineHeight}`:"",h.letterSpacing?`letter-spacing: ${h.letterSpacing*h.fontSize}px`:"",h.fontStyle?`font-style: ${h.fontStyle}`:"",h.fontWeight?`font-weight: ${h.fontWeight}`:""].filter(Boolean).join("; ");return e=g?`${i}; ${y(h.stroke)}; -webkit-text-stroke: ${h.strokeWidth}px transparent`:`${i}; color: transparent; -webkit-text-stroke: ${h.strokeWidth}px ${h.stroke}`,` 777 <div style="position: relative; width: ${r}px;"> 778 <div style="${e}; position: absolute; top: 0; left: 0; pointer-events: none;" aria-hidden="true">${t}</div> 779 <div style="${i}; ${m?y(h.fill):`color: ${n||h.fill}`}; position: relative;" contentEditable dir="${c((0,a.av)(h.text))}">${t}</div> 780 </div> 781 `}return`<div style="${C}" contentEditable dir="${c((0,a.av)(h.text))}">${(0,a.Z6)(h.text).replace(/\n/g,"</br>")}</div>`}function m({fontFamily:e,fontSize:t,lineHeight:n}){if("number"==typeof n)return n;let r=document.createElement("div");r.style.fontFamily=e,r.style.fontSize=t+"px",r.style.lineHeight=n,r.innerText="Test text",document.body.appendChild(r);let i=r.offsetHeight;return document.body.removeChild(r),i/t}},94877:function(e,t,n){"use strict";function r(e=""){return(e.match(/<\/p>/gi)||[]).length>1&&(e=e.replace(/<\/p>/gi,(e,t,n)=>(n.slice(t+e.length).match(/<\/p>/gi)||[]).length>0?"\n":e)),e.replace(/(<([^>]+)>)/gi,"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/ /g," ")}function i(e){if(!e)return[];let t=(new DOMParser).parseFromString(e,"text/html"),n=[],r=t.body.querySelectorAll("p");function i(e,t){if(e.nodeType===Node.TEXT_NODE){let r=e.textContent||"";return void(r&&n.push(function(e,t){let n={text:e};return t.bold&&(n.bold=!0),t.italic&&(n.italic=!0),t.underline&&(n.underline=!0),t.strike&&(n.strike=!0),t.color&&(n.color=t.color),n}(r,t)))}if(e.nodeType!==Node.ELEMENT_NODE)return;let r=e.tagName.toLowerCase(),a=Object.assign({},t);"strong"!==r&&"b"!==r||(a.bold=!0),"em"!==r&&"i"!==r||(a.italic=!0),"u"===r&&(a.underline=!0),"s"===r&&(a.str
781ike=!0);let o=e.style;o.color&&(a.color=o.color),("bold"===o.fontWeight||parseInt(o.fontWeight)>=700)&&(a.bold=!0),"italic"===o.fontStyle&&(a.italic=!0);let l=o.textDecoration||o.textDecorationLine||"";for(let t of(l.includes("underline")&&(a.underline=!0),l.includes("line-through")&&(a.strike=!0),Array.from(e.childNodes)))i(t,a)}r.length>0?r.forEach((e,t)=>{i(e,{}),t<r.length-1&&n.push({text:" "})}):i(t.body,{});let a=[];for(let e of n){if(!e.text)continue;let t=a[a.length-1];t&&!!t.bold==!!e.bold&&!!t.italic==!!e.italic&&!!t.underline==!!e.underline&&!!t.strike==!!e.strike&&(t.color||"")===(e.color||"")?t.text+=e.text:a.push(e)}return a}function a(e){return e?/<[a-z][a-z0-9]*(\s[^>]*)?>[^<]*<\/[a-z][a-z0-9]*>/i.test(e)?e=(e=e.replace(/<(?![a-z/!])/gi,"<")).replace(/([^a-z0-9"'\s/])>/gi,"$1>"):e.replace(/</g,"<").replace(/>/g,">"):""}n.d(t,{Z6:function(){return a},av:function(){return r},yh:function(){return i}})},27588:function(e,t,n){"use strict";n.d(t,{Cf:function(){return i},LU:function(){return a},Qh:function(){return r},Qj:function(){return o}});let r=({px:e,unit:t="px",dpi:n})=>{switch(t){case"pt":default:return e;case"mm":return e/(n/25.4);case"cm":return e/(n/2.54);case"in":return e/n}},i=({px:e,precious:t=2,dpi:n=72,unit:i="px"})=>parseFloat(r({px:e,dpi:n,unit:i}).toFixed(t)),a=({unitVal:e,dpi:t,unit:n})=>e/r({px:1,unit:n,dpi:t}),o=e=>{let t=parseFloat(r(e).toFixed(1));switch(e.unit){case"pt":return`${Math.round(t)}pt`;case"mm":return`${t}mm`;case"cm":return`${t}cm`;case"in":return`${t}in`;default:return`${Math.round(t)}px`}}},69295:function(e,t,n){"use strict";n.d(t,{Rb:function(){return u},S1:function(){return d},SJ:function(){return s},km:function(){return p},qn:function(){return x}});var r=n(59533),i=n(87556),a=n(84360);let o=r.LO({value:!1}),l=r.LO({value:"v1"}),s=()=>l.value,c=r.LO({value:0}),u=()=>c.value,d=()=>o.value,h=r.aD(()=>{o.value=!0}),f="",p=()=>f||"",m="undefined"!=typeof window?window.location.origin:"",g="undefined"!=typeof navigator&&navigator.userAgent.indexOf("Headless")>-1,v="undefined"!=typeof navigator&&navigator.userAgent.indexOf("Electron")>-1;"file://"===m&&g&&(m="headless"),"file://"===m&&v&&(m="electron");let b=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${m}" here: https://polotno.com/cabinet`,y=fetch;async function w(e){for(let t=0;t<5;t++)try{let t=await y((0,i.Kf)()+"/validate-key",{method:"POST",body:JSON.stringify({key:e,site:location.host,skdVersion:"2.38.2"})});if(r.z(()=>{l.value=t.headers.get("x-api-version")||""}),!e)return console.error("Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet"),r.z(()=>{c.value=1}),!1;if(200!==t.status){await new Promise(e=>setTimeout(e,3e3));continue}let n=await t.json();return n.is_valid||(console.error("Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet"),r.z(()=>{c.value=1})),n.is_paid||(console.log("%cPolotno Free Version. For development usage only. https://polotno.com/","background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),r.z(()=>{0===c.value&&(c.value=2)})),n.is_domain_valid||console.log(b,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,a.zs)(n.remove_background_enabled),n.is_paid||!1}catch(e){await new Promise(e=>setTimeout(e,3e3))}return console.error("Can not validate Polotno API key. Please report to [email protected] immediately."),!0}async function x(e,t){f=e,await w(e)&&!t||h()}},41364:function(e,t,n){"use strict";async function r(e){return new Promise((t,n)=>{let r=document.createElement("video");r.crossOrigin="anonymous",r.src=e,r.addEventListener("loadedmetadata",()=>{let{videoWidth:e,videoHeight:n}=r;t({width:e,height:n})}),r.addEventListener("error",t=>{let r=e.slice(0,100);n(Error(`Failed to load video: ${r}`))})})}async function i(e){return new Promise(t=>{let n=document.createElement("video");n.crossOrigin="anonymous",n.src=e,n.addEventListener("loadedmetadata",()=>{let{duration:e}=n;t(e)})})}async function a(e,t=5){return new Promise((n,r)=>{var i=document.createElement("video"),a=document.createElement("canvas");a.width=480,a.height=360;var o=a.getContext("2d");i.crossOrigin="anonymous",i.src=e,i.addEventListener("error",e=>{r(e)}),i.addEventListener("loadeddata",function(){let e=i.videoWidth/i.videoHeight;a.width=480,a.height=480/e,i.currentTime=t}),i.addEventListener("seeked",function(){o.drawImage(i,0,0,a.width,a.height);try{var e=a.toDataURL();n(e)}catch(e){r(e)}})})}async function o(e,t,n){return new Promise((r,i)=>{let a=t.getContext("2d"),o=()=>{try{a.drawImage(e,0,0,t.width,t.height);let n=t.toDataURL();r(n),e.removeEventListener("seeked",o)}catch(t){i(t),e.removeEventListener("seeked",o)}};e.addEventListener("seeked",o),e.currentTime=n})}n.d(t,{C5:function(){return r},Cl:function(){return o},Mf:function(){return i},Q8:function(){return a}})},77306:function(e,t,n){"use strict";n.d(t,{ZP:function(){return C}});var r=n(7653),i=n(82054),a=n(31491),o=n(95236),l=n(93509),s=n(96250);let c=()=>{},u=c(),d=Object,h=e=>e===u,f=e=>"function"==typeof e,p=new WeakMap,m=e=>d.prototype.toString.call(e),g=(e,t)=>e===`[object ${t}]`,v=0,b=e=>{let t,n;let r=typeof e,i=m(e),a=g(i,"Date"),o=g(i,"RegExp"),l=g(i,"Object");
781if(d(e)!==e||a||o)t=a?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(t=p.get(e))return t;if(t=++v+"~",p.set(e,t),Array.isArray(e)){for(n=0,t="@";n<e.length;n++)t+=b(e[n])+",";p.set(e,t)}if(l){t="#";let r=d.keys(e).sort();for(;!h(n=r.pop());)h(e[n])||(t+=n+":"+b(e[n])+",");p.set(e,t)}}return t},y=e=>{if(f(e))try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?b(e):"",t]},w=e=>y(e?e(0,null):null)[0],x=Promise.resolve(),C=(0,l.xD)(i.ZP,e=>(t,n,i)=>{let l;let c=(0,r.useRef)(!1),{cache:u,initialSize:d=1,revalidateAll:h=!1,persistSize:f=!1,revalidateFirstPage:p=!0,revalidateOnMount:m=!1,parallel:g=!1}=i,[,,,v]=a.b.get(a.c);try{(l=w(t))&&(l=o.U+l)}catch(e){}let[b,y,C]=(0,a.z)(u,l),E=(0,r.useCallback)(()=>(0,a.e)(b()._l)?d:b()._l,[u,l,d]);(0,s.useSyncExternalStore)((0,r.useCallback)(e=>l?C(l,()=>{e()}):()=>{},[u,l]),E,E);let k=(0,r.useCallback)(()=>{let e=b()._l;return(0,a.e)(e)?d:e},[l,d]),S=(0,r.useRef)(k());(0,a.u)(()=>{if(!c.current){c.current=!0;return}l&&y({_l:f?S.current:k()})},[l,u]);let T=m&&!c.current,P=e(l,async e=>{let r=b()._i,o=b()._r;y({_r:a.U});let l=[],s=k(),[c]=(0,a.z)(u,e),d=c().data,f=[],m=null;for(let e=0;e<s;++e){let[s,c]=(0,a.s)(t(e,g?null:m));if(!s)break;let[b,y]=(0,a.z)(u,s),w=b().data,x=h||r||(0,a.e)(w)||p&&!e&&!(0,a.e)(d)||T||d&&!(0,a.e)(d[e])&&!i.compare(d[e],w);if(n&&("function"==typeof o?o(w,c):x)){let t=async()=>{if(s in v){let e=v[s];delete v[s],w=await e}else w=await n(c);y({data:w,_k:c}),l[e]=w};g?f.push(t):await t()}else l[e]=w;g||(m=w)}return g&&await Promise.all(f.map(e=>e())),y({_i:a.U}),l},i),M=(0,r.useCallback)(function(e,t){let n="boolean"==typeof t?{revalidate:t}:t||{},r=!1!==n.revalidate;return l?(r&&((0,a.e)(e)?y({_i:!0,_r:n.revalidate}):y({_i:!1,_r:n.revalidate})),arguments.length?P.mutate(e,{...n,revalidate:r}):P.mutate()):x},[l,u]),R=(0,r.useCallback)(e=>{let n;if(!l)return x;let[,r]=(0,a.z)(u,l);if((0,a.a)(e)?n=e(k()):"number"==typeof e&&(n=e),"number"!=typeof n)return x;r({_l:n}),S.current=n;let i=[],[o]=(0,a.z)(u,l),s=null;for(let e=0;e<n;++e){let[n]=(0,a.s)(t(e,s)),[r]=(0,a.z)(u,n),l=n?r().data:a.U;if((0,a.e)(l))return M(o().data);i.push(l),s=l}return M(i)},[l,u,M,k]);return{size:k(),setSize:R,mutate:M,get data(){return P.data},get error(){return P.error},get isValidating(){return P.isValidating},get isLoading(){return P.isLoading}}})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.