From 8f83214d239aeeaacb15aa903150c3cdf87237ac Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Sat, 10 Aug 2024 18:54:58 +0200 Subject: [PATCH] Switch to Bun as bundler and script runner --- .github/workflows/build_test.yml | 50 +- .github/workflows/lint.yml | 24 +- alchemy_cms.gemspec | 2 +- bin/setup | 2 + bun.lockb | Bin 0 -> 242308 bytes package.json | 2 +- spec/dummy/Procfile.dev | 2 +- vendor/javascript/shoelace.min.js | 116 +- vendor/javascript/tinymce.min.js | 2 +- yarn.lock | 4388 ----------------------------- 10 files changed, 99 insertions(+), 4489 deletions(-) create mode 100755 bun.lockb delete mode 100644 yarn.lock diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 2dfbbabac1..63dc1ec3ce 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -14,51 +14,49 @@ on: pull_request: jobs: - check_yarn_lock: + check_bun_lock: runs-on: ubuntu-latest - name: Check yarn.lock + name: Check bun.lockdb steps: - uses: actions/checkout@v4 with: fetch-depth: 0 # Fetch all history - name: Get changed files - id: changed-yarn-lock + id: changed-bun-lock uses: tj-actions/changed-files@v41 with: - files: yarn.lock + files: bun.lockdb outputs: - yarn_lock_changed: ${{ steps.changed-yarn-lock.outputs.any_changed }} + bun_lock_changed: ${{ steps.changed-bun-lock.outputs.any_changed }} build_javascript: runs-on: ubuntu-latest name: Build JS packages - needs: check_yarn_lock - if: needs.check_yarn_lock.outputs.yarn_lock_changed == 'true' + needs: check_bun_lock + if: needs.check_bun_lock.outputs.bun_lock_changed == 'true' steps: - uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v4 - with: - cache: "yarn" + - name: Setup Bun + uses: oven-sh/setup-bun@v2 - name: Restore node_modules cache uses: actions/cache@v4 with: path: node_modules - key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }} + key: ${{ runner.os }}-node-modules-${{ hashFiles('bun.lockdb') }} restore-keys: | ${{ runner.os }}-node-modules - name: Install dependencies - run: yarn install - - name: YARN build - run: yarn build + run: bun install + - name: bun build + run: bun run --bun build - uses: actions/upload-artifact@v4 with: name: javascript-bundles path: vendor/javascript RSpec: - needs: [check_yarn_lock, build_javascript] - if: ${{ success('check_yarn_lock') && !failure('build_javascript') }} + needs: [check_bun_lock, build_javascript] + if: ${{ success('check_bun_lock') && !failure('build_javascript') }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -141,7 +139,7 @@ jobs: sudo apt install -qq --fix-missing libmysqlclient-dev -o dir::cache::archives="/home/runner/apt/cache" sudo chown -R runner /home/runner/apt/cache - uses: actions/download-artifact@v4 - if: needs.check_yarn_lock.outputs.yarn_lock_changed == 'true' + if: needs.check_bun_lock.outputs.bun_lock_changed == 'true' with: name: javascript-bundles path: vendor/javascript @@ -165,7 +163,7 @@ jobs: PushJavascript: runs-on: ubuntu-latest - needs: [check_yarn_lock, RSpec] + needs: [check_bun_lock, RSpec] if: github.event_name == 'pull_request' steps: - uses: actions/checkout@v4 @@ -174,7 +172,7 @@ jobs: persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of our personal access token. fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. - uses: actions/download-artifact@v4 - if: needs.check_yarn_lock.outputs.yarn_lock_changed == 'true' + if: needs.check_bun_lock.outputs.bun_lock_changed == 'true' with: name: javascript-bundles path: vendor/javascript @@ -201,14 +199,16 @@ jobs: NODE_ENV: test steps: - uses: actions/checkout@v4 + - name: Setup Bun + uses: oven-sh/setup-bun@v2 - name: Restore node modules cache uses: actions/cache@v4 with: path: node_modules - key: ${{ runner.os }}-yarn-${{ hashFiles('./package.json') }} + key: ${{ runner.os }}-bun-${{ hashFiles('bun.lockdb') }} restore-keys: | - ${{ runner.os }}-yarn- - - name: Install yarn - run: yarn install + ${{ runner.os }}-bun- + - name: Install dependencies + run: bun install - name: Run jest - run: yarn jest --verbose + run: bun run jest --verbose diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 596a14d6ad..24e56a2c70 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -25,38 +25,34 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: "18" + - name: Setup Bun + uses: oven-sh/setup-bun@v2 - name: Restore node_modules cache uses: actions/cache@v4 with: path: node_modules - key: ${{ runner.os }}-node-modules-${{ hashFiles('package.json') }} + key: ${{ runner.os }}-node-modules-${{ hashFiles('bun.lockdb') }} restore-keys: | ${{ runner.os }}-node-modules - name: Install dependencies - run: yarn install + run: bun install - name: Lint code - run: yarn eslint + run: bun run --bun eslint Prettier: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: "18" + - name: Setup Bun + uses: oven-sh/setup-bun@v2 - name: Restore node_modules cache uses: actions/cache@v4 with: path: node_modules - key: ${{ runner.os }}-node-modules-${{ hashFiles('package.json') }} + key: ${{ runner.os }}-node-modules-${{ hashFiles('bun.lockdb') }} restore-keys: | ${{ runner.os }}-node-modules - name: Install dependencies - run: yarn install + run: bun install - name: Lint code - run: yarn lint + run: bun run --bun lint diff --git a/alchemy_cms.gemspec b/alchemy_cms.gemspec index 49f3187650..17d889a874 100644 --- a/alchemy_cms.gemspec +++ b/alchemy_cms.gemspec @@ -16,7 +16,7 @@ Gem::Specification.new do |gem| gem.requirements << "ImageMagick (libmagick), v6.6 or greater." gem.required_ruby_version = ">= 3.0.0" gem.license = "BSD-3-Clause" - gem.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/|yarn|^\.}) } + gem.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/|bun\.lockdb|package\.json|^\.}) } gem.require_paths = ["lib"] %w[ diff --git a/bin/setup b/bin/setup index 2ad14eca6e..2e991b2d3b 100755 --- a/bin/setup +++ b/bin/setup @@ -14,6 +14,8 @@ end FileUtils.chdir GEM_ROOT do system! "gem install bundler --conservative" system("bundle check") || system!("bundle install") + system("bun -v &> /dev/null") || system!("curl -fsSL https://bun.sh/install | bash") + system!("bun install") end FileUtils.chdir APP_ROOT do diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000000000000000000000000000000000000..f6fbc3a14b5eae4d434e4ea6795702fe2f934456 GIT binary patch literal 242308 zcmeF4d0b7~8~+cAL=&k*X^@I0715-5l$4UGXjEyQOH#%Vk)a|PN@Y&Ulp)FxGS3Mm z8ikA@e$Uh1>+9V6yEprEet-P_xa(#2X|289&-1Kt59i#jysUa;c$m6}Uy!faIqW zQf!vVUDz&HX8rLQ#F}`7{fzZj3VF6ung@$(tO9oD2`__O8f+m1s`+VKQ zgQJ63EExzE^W#A=ZdLe!{S*oHPy=W!0V9JUKN>1yJ8~e8@yrhn@j_2xP>$^ni42PM z4EFM#9}w)}4xxmE1$%mjhqLa0bBx0)I8Zg(Jzzn&I}}2C1&u)eH$c&!r*H5AKQH$% zpK$Le@1ThAFmHD+FTb!5186j!KL?$G?eGg%MHj4ZP!1s`9-+&ZK~UH~d638Uc!arw ze-_IDg2#I4pvX6YqCIz*ChifQzG1-u0g)jrRssyR6mp=$LCxvB3g}SC3xZ06HpAeK z1icC>19|`y%U6NQgU$z)1GNGj0jf;v08p&g3Y~@Jw?NTP3Ft7;0#NLakTCCv2tV(z z_0UHUYT|SV3gfm0#q<85k=|jkELI$xhmaCafKhDs2rvpJ5*LC(7bIQ<#eNV3#q(JZ zERNe6P|O?4QuVSxFk674<&#W-O8sQLuB&%X|NwBH9h1LJZ8 zMLq%SW4@X$S5Tn*k@_&Mo)M~k;o(pZd1Bv}&M$}dV7a&=)jupyakK}D>*nJqYCbJj zqWWh&U0*_(D);oI;$|AJ8~DYz!voyIeOWA4JlN}Mzn`jKkWVlxoX+QiV!v$z#rf>3 zLirDI4-5Am$6~>p^@DK>_Ya4e4tA{7sQIA{3PYb*rb?|_KXuCAIZ(7C2j_8IglYW+ z_0UfntvX|=`d;21k@LZBU^x7M^bF49ILm8N^>5PlkAez7c?XnZyWBm4!-AlGK9r-s z3N1=YL9v}PwW<2Hpn{Mm>o_Dlpv%uTnp+Qw3imU!Yy9m>9Ycx;g80>21mk$85Gw~6_lfTSyS`TKioUq6Z{Va z9>@KgDYY*Z+fZBvDDF>>p&Yh^MA^yI_{O>i1o%N$4uL%O+Ymcy9|CLc0q$Pje2~X@ zKEiq2HyY`BUu>!U?-l4ED6as!xGsD_M}oH5Q|sFV^034c#X-k_zB6Ir7La%q6w9}Q zYJmEI!qP~z0>${0KxIJtfWnrO*a-cO{Ze*vV!S&*asFWLQ9u&vL0u=3E zfciKN-)B*LA>=WRTu|)Ky4h4cg*lYpRiHS(7J}k9bzS^eEY=iP%C0FWu1milU+*x# zh;Z1n0{rItMns3XhlIcc4Gw~vAxOs{Uffp%=2G>0(`pLsLc4Dvk8#w~4h1YZ}>4ZGCFCs7`0MCc`g~4hGXOa2t9TU=ZpOp&!&<|Nh8$GFb zykopQ!34|Pi`rKwfa18QfMUOdxJUS^F7S?(g*>)5+Skt$_iMj!AVIU?2aZ#y55d@$$U6eIBo^#Tex9m6K?x8C_D2(Js)Ip?LmvG(fTA67KWd(k@#29z)(doB z0Q;I>*avWq{7X);#s5BE}1qX&igtKZOkNy_~ct=7LS+TItp~j_=o$2~j(hMpDX9U1QD z6U*ALg7WLJl4{o>P;93oDB8bDbAR9emLya4$@Nu#6*VvX<_86b!CEEPvH#6$xc+-X zdERQOU)=q>!enW#q2^5~_(8vsVScLq(D4T$kMnC6DE9YeTJNP$Jb4aS1LZhwNwhYv zrQ(Kl*46JXAdly(XnhEZ^T5j+F7nUJh)a>}&zWc^DoD4>OQdA&=Kf-i_3_Org~X&f$2=Y@#?JP!Y&ifMS32 z0>yr4gZhI(w{NEUSs6H-55Zfg{_&)hTtEJPotXvav3(N2q5W|=lwDC!S;)78jsnfj zrTl)`O|8Etv|a=q0_T^2js`uQM_s=c7f`P8i}mO7~ZQL4S!#gx4mP_#D( zbU0`d)W^8yg35u8r|s~8V%+sRsQ6BSV!v$w#kk!-wLtYjk>dl^27Q%H#d!u)3G$n1 z4WrAAKrz07pjf|kJ9S@l1r+-s2Ne5lIjA(~3{X|jq0k=muMBx?*Mc$@YXWE=$YXmx zXHtGIX0cd?klz7{IK$D`?S_=TU0;u?{l?zKb6X30@oqe-An^11kA-JF`puQv@KM+4 z$fY~17s(0PmQyq?<<6Dfnq3vManR5G?w|O~W%aD`^(Wh>=5=-~EmJ(GHA>h`KyH-% z#gkUNHQ#=0-n!M>E$v)kwarN(KSBT4v~z1@4~5f_@-yxA71u!T5(0LvZ2Q+9YJ1Kz9QqH zj}t;il$b~g52`+WMX1;8V;fY>2X-DS@%<#C>FwBHvRY(=Z_JqcIbpXK6wT3^(s*#j zC>6u`Wvg9>O;SH~V*L{FFIwUy8w;|gqEORn^CdUkHt%8yBsX-UIpCPaNw(osA(LG$}9i`T{qe4k9sD!#g9 zCTM3}{k0~wGwZm#Nb`hu3+)AkSKdCVz~idXxO{Nmh&x^ZH$L=s*xJ@+wDb1Ql3%Uu z{E}A{N=3y6xu#|=F?8#F`rcc<=TF@<9E--BTpJi3r5QB#SuNk4BU$|n)!H)3&n(qF zcaB$$-=f#-kB9n2QO3~&bM9YJ`cQO7UBNw4Zfa=QcB|InoH@<; zMu{`dB&zSb{OtOI=lf5O-~7#{U&CHM)lPx>KAqoy;?5n z5jxVqXn@d!+cWmvvi`W^m2md*jaQTI2yBm8=rdzc{FD*fd%w^gRNO%7rw(y-KY41a zd`+(Nz&&2dS;YPXo2zY_+azP!L#2Pj7fJ5T$Q%9U%WI#OMT7J;j~x%V+qqq5vC1^{ zG3n#%UR;?VkhQNVF?_;v_3{nsv(}C(F__ptSpQP9!`4y~H`91q0xP!7XmGgpW_y28 zW$(2&;^GY_?EdD`$GFdcAO5X}1i$V%^CeEx%s!ykZQH#$O$oN5<@}H3lmgBg#GM>( zug0fvVgDW(*~owazF+;c_ubmPKdIr^h6nSx5A=q;YzK5ka$;~!!h9t zk5?WxJmux2FVi6)S2DzC=eu<8d!wq>9a7I7{cKI7wX#j9?zFAC(g)7udd*$5dvfqJ z@6P?YQWF<{TDO#?T`PI@Qf_g@{gQ{NR+{1mM#YVdUpY_rd*5x_BQjcZay7Qw{m6N! zp4hr_+N*lm)1nRbuP5z%{3X@v)Xw_%@pi32Tl#f8{qfMIx4F}ed2yXO9}{9^9=&P#iO?4w8T7dPtll! zVIz0G$hvXRTQf)X?CKM33RgD1=ku#?JtbKt(|Nmm{W#yrnsM!y&qUse&cz+h8y z=-sE6QzSAjI6s!IYX6opqiTV-%z!rS^|z;%l^Ci1bo-dtkGFn!Y4gaz+HFH`st=Ss z<6;^0=1K4J*D1N&5%;V0t4Gb; z!F<|PomI0dEWW-JeC;PFS>h0G89#WJhg)s_bcbtG+=YuTKa|(+w>);`ichXnQ#!-1 zj!tqJBc4~{>N8`?x)jy+w2Lc~`}&<&R+nnF#plEUbC%4(t4}2w%j^U;*(jd1s?HQD z?vQ@6J~8{m5bIad1=2>o)D81+GmzLHJx|hJCu{nEs+PvBTc@d)PZk^eda_co)p=vl z{eF^%r!Q2vm^V#vm_Lu?*T6S>ZRJ+0ojsvuqN#Mp#NOH7ZtcdiLZ%kgLI!UpwD>Pv z(O-A`j@b7lkE$n~PUsNvUhq@9Ds!H-=K#4?&QG=tIo>R}{Pcp_pH+vHv;{I+9Bm9+ z>K$7w>jKP2pFe(bW?b%>PeYy^3QpK){y2YhmD}TYYEyPfuF{TQo6#O$^z2>5qL8eI z*YCEc7e0`Tmu(NuxG9v7JUM;p+g`p24Ssn!P{NJeXh_yv$}*;t=5@ zrE#f28T`WIHPrc+K3z8H-Y}b6S1ePrWNLmSj$5A}GNk&m;G$mZ9eOD%Zvfiub-Bo5dxb-R%FHv4a?zAp8$adho$zx%?>p-EpPCSG`stCQ2d)RM`;ued zZc(7(@?_ee=7&Z@o@eNu<6Fev3y0zIqh1(`JE43rca#Zr}Q&b*mvF? zp_iLS$!WOM48AX?mV0E|*_MGaLkBET&=i|I@NMzgg;h~GRcgY1t)}{;SIn!lmt1r2 z{_X=QdPw**UK|TjEj%K5M%l(qtmo@P6T$iH0NhROR}Po13Su@@8{f^$6kX zo~p5Wt9L)ulo21IjVr7TZF4>*cS>!r3G&>z zG1}k~pVBnG%OwNT%$-D*J+hSB(f%z=*YLE1qMCfk*4abN9+YR+pOZM;?p>9kc2H@X zbl{NG?d4wwDjNVy&M z+kgN1;Im=|^KW^@uk;_;8PKaRM9%EVf#9*l0d1bytzNU7YxK*^Bovpq-`lA<)%kAg z$hctPnP%<1+FzZGC_CwtxbU!W!Pn`MR<}pIKU%3f*49Zf>G^^1)6V-3^%i>Ha42?z zOI_#}gDD}gQp+#s8zwvK?wA`8Uz=PVab(I>zM`QcY|jst??>*ZGy{%)xO&rf{$=I4 ziP5z_LVLf)1$w7r)r?xy;&u1l~?vt&bG@b%GVoV4gwdTL|*IC<1h!`aFGhhEvxzh-&ieno-AOLNAoULm^XNuBfci+h4PCVsW^ zcO14YbL3gOjrkwlFUVfB%ozHKJO?;Gt{pRIgl(Kmlucons7+bS$xk}Gy4L%(_!R7{ zC(m9zVT>`^WNC3d^iojl_6oN==bkT3Inu;|qVv zvDDSh$`-1(%G=0&!r$)?9%y}P6gaBnEwps=)3JQZhQD7j>sP*fFJrP^9tchh8Z^Y# zI#%Q4J9XJ0n~I;ot(DDg$#ZJ_0#;~gmE7AosoA*p#~j&ebvH#f*#^BcBX+IRnlfo$ z-%rD2#(wsl)*?23daU24^2hdLMFhicY8{i^T-bZh_wt8ktw{|FM_yPwr8f9^saqf2 zqet}pw>;Z&%r=Klr{YUx^XKR7DZB2G>&M@(GtMjA1^tg5UApl4gyQ9&+8%}$&b?pO zOJ;Uze@nac&mYI0YroJi@`-N$wUbU?x7vQ8scid*Ukhv(oA%z*p}j>YbM@(!4y} zCW>C4I$_SD+#8oQ4KG)ln3DUF0Q1BrMVdA|c^59V&WhgM8ucS!?5~5tn@>;db@`6> z;||MhYaQ*s*Q|V@GiJ5TanIFK&c}|I+EzxN-EcQ{uG7v9XJdVekM1*l^iZJRkk^?7 zU&pzpF86qlC9$VXwrShyJ#XKhx&AWH*F%BV^qNM}j;hoNmnm=$w&NW+7IhBL>j*2kR;{2*_Vanek%|BGqTZKbXc zrnsFOS{0NxM{DV-l8j%stoj$eNh;ej^3aEw8=o5H&#L|9oxS30+;01hiETNL&KaAvRsaZ(x#+s*#&!;dqC~?qxdH$K|i6*14)Aa$on$RM+jzPD?L+ad4GL zsOGDakEt^jIhXEfUFF~~=Yxpj<^su`CuQWuc=Qv<^iGdZ-_mQ5=Wt~?NXlTCW}*tzfAaWzRJ8VNHe8o;Qk-CVn$aC$|^3MZJc&~ea?6O(KF|WRH>dU zTN<+F;`0|76Z)+?xpACal5Bnd#@E`OSA4W*_nX+uEdQSPCWYa9_DSxacRX_KmHP?9 z#gsjsy|}*0cx?3cO}9ok9px2r+No~X$Dhx@FQ=K;-{sAQ6>e~t%p-EK7mK^po8Vw*JiLGE z2l+mvjDZqE>&lCTRG*9yI z&X-Xl_4VNwBk+%T>;tBW@bT~qz86In4^sXoJEUGA{9;1$SVqd3^6dcN`$rsmrYzbf zbw>k;?=vy>p3I+UfUJQ>d+_-U<3#)$z`*O%{u#qik?^s=ksIt{PC#2!(m{v&}W z{;>_5^2dS4{hRb3r|a(%@Z|mpW9F1shYf@9Oj-0p+Udu}V>zem?+Wl!*v608MO)n^ zQqKe?4PHM;|B>?USUgASZ3TWZ8~-PcoG1Ki;5FEI5(laGZ%TMEK^AK&%_Ga{{Ph7I z_YcBy>OUKJod4*Tsc&o(iT@exAIo4Wa=ibG!G+5h{G&biUIXJq{JQ{;?MD#XPRcRg zT_W{TfydA3k+p*ZE+>o<;oE^Xp?Olq!~m(Q4L7~G{;=OQ;|DZjL zozwV@fXDa=&uRRdfw!S~rm>?B(*Ebb~^r=7KK=-kl46bc{NA|%#Z6sv>xBxu4 zf55$q)BWok@b^Hr{eJ(3?d5d*<^hlQKV-#RKDD zk_evxyeaTKU4M|oKg1r|V3J7v6yWjxf%wICFiC{}1Uz1U2~YG-HVAK{MBP8ZYk;mK`zMe-PxuVr z@%lT2F6Y$$3*d48fyb~O&EJvA)cV1G$NMj)iNx;>JnrAv?>P5K`Je2Ndg;KM0gu-& zQuZen&y%{_rZwda%_~CVkNh0mP06ac_;JEi>{e1?WtRJSnF+Sp7O_loZ`bhhk&LhJ6sj*nT z5I^ZRqJQcG!runo5qPG4iCx0WtHWPq0-of_`9CSC9}YaOU##Dg>)$otjcETp8NUG< z)aOrR{$LzT5{ci1=9%sr#5Un`fVYA8d+PrU&6Byu>G&IurTU-TH;}kUod2ez-Xh@1 z^$X_^vGZ>nDJT44;9&`M&7Yo(Up4S}{U_}w_Wz{BzcvJq_s=B%Cytya^+SQj`QOv^ za~yaR;K}^qbo}~gQRBx4fnf|x;~?={0T2HYksk;Lr~VfLYy>>cUu2oiW8(i7%>&9J zW%&D_5~(W;n>Ts?hI4@bPau7s@IJtsK>SSGP0SO%0C+RtF;B`!o$i#>Z3P~$ADG9n zV;TqHN5Y2}u!VQU-;?XVBk)GRGaWb5CgML0c=qRSrgjK_3wT_A1BhXUN_YXd`GGC4 z$Lr4kc=V6+24m-R{lo#!&HI}w+CR1j$6g)|CW*A4U+4Gt-(V^+PJ}lG9``RY?{FVr zk_f*Uc%1))XTo9~!aoKc=RcM)ojX{U@cIB_|6`t$7zn=_c=r1brZx!w0eBd~L=rov zyfQreBTwvcI{)SZkMZN)$CPF7ziq%{{}GnNfpxk|q~3ktas81zr`La8aE{}TJc*$@ zzvLY8X8=6je_%QCoX+21;9(2u@{cz08ptFO|GBh(rtK!S3IBkt{iKZ4=}t*qLAdyl z_H%L%M0g|M;Sr?k`ah^UhkrXq`1QcUEm)7AU*%x(8Uc@EM{NGh)jwuQ-9X^U_2(Ze z{!1a@kJJ7+={qz@_%Fbd^-s$F#pPd$NnKUA_z<4y-ofra7IIK-XElZa~ywsei;e}i3@)1Hj#P>X4Lx^(srhEi14R@ zXCHq~`>zdnn8N?p{fmcpgu5CTUbS8Jed8xJgFZIJX`{L z+<(uw^gr5y`u;ACp9CD7UO$%rZ^RZqr~Q8cc$`0Y|IhT=3swI&&%XW5Kb~WfNdMbg zQuj|}{&E`s8sJUX+Rwx{)*=2ofyd8Zunc|U8e))AoV1zDIV*i4W=;=J{EWw!mjm)Wt^`6E5MWWkG_dr__fU{$qE&=~rf89cC zCka0RI&U5uPs-V<{^PHt-c8_V&^)d`oQF&j;T3IJtXW*}Nx*w?5&!7P)c%Eik7LK_ z_;~@3*MBnqIOVqjZwx#S_!fr)?J!BC|Hjy{SWdum5#L_btkG8zKne=G2Az~j8d`OE3`<16sE z{*mv={evNFp2%Z7OvfIo{%`!20q;-y7ld+7_bM3s|7*ZU zbHST9z~6-Cf`JPGkg_@UVsU z`1ws77OyGI3Td4Puwr`!^-^2D?(9AK>1FWt{fE8}K-P zN!&#L%`Yh@{_}vx=Rc<0-}!prCjd|EG2KH+{o!!)j6CtrbRH4j33&M2?|(cgCvpCp zl6uL&>*UX#?Rm0Z*>K zOnsv-!uOg-@z{R!-yaSpiSQQlsP7L;0n`)!8-O>1{>Ntr^p6LVMEu{M$6^@)Px4Gy ztV8M#ai_+Qt4yiW{c$|Nj?@9b?fhYSHnS+1wjpvE~O5oYo5B4LIMEJfQzrTNi z9Nxn-NrX2Bo~%FQ@H)yQ5k3_7@z8&y?VRo(`M_iQaqc0@>Hb>{Jbr%K)A=jx$=&_C zEAZHUj2q_<(?t3&8+b$Dk?RTn6nIVGaomt+YJ>Qn;YI!Z4U)$=m?Tm^4|o&sk9nrP z(LUiDfj0u42MZxFwLy3#@4vqP;*_5UJoZ1?`*0kYB;x-v@Yw$(PxMbVNWG4~@qgmT zdBTtJ`ThQhoMWPdPXOKo;%C}!Vw><~z~lahYZnuz{r>}ay#FNjIOWIBr`8`Y?VH%? z3Z|PMq+S5<=hm#F6vFzbEi!z+*X< zkvK5lT_Suw@K$vE7<<3&AhvUa{|>wn@FY)^t?EDiO6uvs%QuW4?;DxMjs^+87^{bS;E{OxF-a3n6u+Q0uK^;Q9o_fJ?8ZIE)zcb7=L zlfat--_!N`19;p&asBjU{Kmt}U%Y-HOZuR@xXC#Zzc28{T*SW@cq8C({$LEmF7fkk zO6s)(uLnHV8v+N@J|Mg*e0YHGzmOMzgJ~ZS-UoPY+Ft`au7C8)$rup-3h?2HDeyRd zIGF>44+Wn6{STO7lnB2ccmvu$)4dBF5dI_ZIDS2y|LP&!_5XU{ZRq~Tm^ht3Pk^@o zp0tPPpE{A$8x#8b`_p0o@%;&;&l5fqcpo}`hGz|WE_*1~cSKxX)e7$5%6T}IPJd=z)uIBDTi&u zMA~n?nA-oC?i&>Sn_me$KK~M))Be8zJgz@Z)((68KY+*g2V~qx93;+vQ_}v4iPYyG z$iZ_g<3#wAN$~$x2mhqqME_)n@MD%xe}9K?M49r5z&nC}oIiLlO~n5j;K}_P@=WIu z;q{iXSPtMH{SJUb5PxBi2wy<+B+se;4&bfn_M?BMiTE>F_WSQIk}@VXNZk#Hg&7hgxyJPVjsh0yhu0I|q!!?M? zBoY1@@P=&uIc@*&6~8|}#5QosI|4rm{3C}kak_ux0*}`(Aa159v(*Hrg8?m*Y35#_Ie+GC9HlEC*KiMICpJb~4NuJaAO@KE7|HxzeIqko7 zz~lWBa%2qP*FPo_Zw2u9{6X?eZIJpu==ibUnD!k8M|kU1RQs8>n>38@tAICw_(|ME zNxgql!e0X(_YWMmo~*xLz+?a6dmo8^bM_DA#J|q!-|w&S`H7VO1M-(5QZEd6jK4pe z?F$E|?LQ1W-oKFc6T5$L_753Sug@Cl|38Di2f~5MBoW>Mc)b1~!^s>b{1)JG{gSa` zItK~=6nN}E^xYHx!YRMse_Ltwx=WGI;y5FDw^<@5p0Z-b`GH-OSxkiQwVrA}(|)7q-@Fd+c>lssDp?{5W=;#6a5r5_o)nfpKB~GaUoMyKkVzALAbZ2h(;Cz65wX+CQ@R z9)n3DeD5^s`iptI{xY2hgf{>l_Yd@mEYm(D{BqzmfXDu4+II9s_!8i!0#E#sa;(!` zBK3qfQu7b<7z5Kp_?a}1v2$XB@ae$g`%fX7=d}NgHvL}zOk>A-#D5&{IDgS^PvXA| zyamlOjh)^9(9Kl;W8dTaBXMD!?h>iz0zCT1{_n~7RRV7UJh4Z#JKuPY)ElscdjBw# z25=u|k_ev$yb1V6MjDO*_zQzX_k#X7mx%ua;Bov&o@orEeg*BHa74TFjpqpe6L>T5kN1x_hD_%$;Z1X>=Xc~r!ND{U zJ{fp_di=5PNco@aka}ZtssDZz>-U5|2t4*b5ABfC`TGHQPda{nItJQQw?g8dzUMcO zF>pHnuLD1q_Rl{5PD1%$C|{U6X|nD{FL=xT*F^kV;}Z@>wh+;Bo)LIYi2t@{R>m{Kzq#`)Hf^xdJ@SKa&5GUvi$*PuxrW_vbzJ z-v&GkPLKUZ?W3+A7#BYOFzo{pe=+cy;2(J$1Ez`auYt$+kH|4yJ6Mk;ew9`o;`l1 zV@Ue15%>r${LeY``|n@$WdFGYJU8Pv{V>LN`zwI=<-))5 z5$gMIxLC+Nc()6OK1s%ZH}HnEe{v7V3I73jd*G1~goD%dZ&JkF{5u9bH{UQtJB?*l#^qzj16ljvuG&)-JUxfWf_C@%$+eGSJ z0-l@oqjC24{SW%*^!k$pJU90r-++(jV*W;*W3eJ>9_J1|LorFD|5|`gWcxRj^p| zxahwM;K}_@Pp)6O7k}SB^yL0)AMjyZw14=e-~Hc{`I8KM0vG=KUgoaLa%%6UhzsJ8P^Cy~(9|Rj`UpSZ~vVS%JPx`MX{++LK$3F*t7u|nD z*a9zy^5IY}z3p+-3n8;Swo_fdlK2y^u~=DL^#AbdzxU6cwEq}d zv3xWfSUv_0Ox-EgQ-K4=UJVXR?26?YU8R&_{jqeOU9p}P9H`^qz~(myG_UtSIej?Wr6u-z%Nt_8(}iuJZ&1`;aT&42^v2kbRn>7NwGX$O5C747e& z^Qf5LMeA-*OsL51fdkLy!GY2g%82d_uE^cY=^iuF&>c~tZdj{#i?729(j4(zXsbRI5~T?rNK!eyr` zq2k_APi4Cl&%c5L^);;xpqTziv0ft_7*{hKm~WxA6%-RH#`P96kk}Qu_i!NB4hJSw zjQ=xcAfaNtub6?#U9pItE@xMacOaDWf{K7*elRFj6~!O4;;%#C2c8$F%Te)H30jBJDv5=V zP^Cb1K#`kBm!pb8-VRg%bQY)(s2_d4JH_?}(Dm50AC!mF<)~OM3KWZ?;Rp8TLQsrj z5f=VUv3??5&aPO036x|1tfcu>w63Ac*Mq`8)&~4REBf0Ed9<5Bmvf@%cPntHSu~G| z`D|Ku(z=`0Tw3#JEueKDtp{j5L~9|fMYI;vdJGifKLv^j74v85JSzTrj?Sav_}!rM zsMue3X?+BWaX$ftf2?Z!@h^(p3;H~}Vn4p5`Fc>a_nNN9uDCz7(&hi8$hFbuQSsNe z@B_==)8*_s5Xw90dOtz2A9_P&tl9@5S~1TH4U6of=B#*%j?e(&ebgOMzm!G+mC0`4M#fpA^r_(C1OHog?WyD)#GWP`vLn1w}s= zpcuC;ou2}VcI-hhq2jL&bRHEsC%Sw(DAsqO&;OI6Usw7(yYfM~H_iLd=h;;Z&d1Z` zsOWbwokzv?Ed|A*sU&rP}<75B%Nbe>(YzZ;<(?KIKnQIUT`=h+qOwbA9M*l(Xf(av{J zJpY5%PEh#A`UO9*-M!%l+U<)OT5&xLf;{fGLqW0rF#0^Z;(0l`{GSw0DbVNH6^oSM z2kIF5JnAUOJJ5M{MgP<2a#Z|vI-T!MvE43o{aK)xpH1r=nrBz^<3^vKOP@!@a(BAi zgDz)RoL39z^8xgEROEu_JSzGRrt_$n525p@_-i;_9s!Eu5`%?*Q{-ala&|?33u!){ z)uKEtivG5MVnW4y2AxMm zyP33ZrOQ!qp6#OZs90||oo83{mq(YQB6pCke~8w@ptvrI>3j*T$3QWmI)UC#r_+NPH06$4DwhcNvkv{mdnz41yJP1fMP;Ld#ZGvUD2N!UCyppu1=SuVqOCj z{bK5_R!jQ44Jg{TrFAkWCRDUP1r+;l8l86r#r?*W z&d&u!ejX_NV|l?3^gACEc|W>5kS-6QH5?S}#?bkNv?hQemq_QA(z*f^>#qTYf2>rx zJPj1)d+oBn@MJjMQ=2cV5XVjEkyjLfQ zM|4B%x_)!dF3G=F#&3Q5!1Jgp1t*THEs$}Z=y5V(x9o%;&yx}qM2G6s4E++nFa1iy zm<17*tebrULN*_pD{$S;i!EOIGS+39NB7+%R`05JiC0IP)j!^`P4IMU=Saz%Rlc2l zs?RH$o(XSfSi+iF(kd{%g#puDSNizx3Xn)#~@Xk8d>3)E_*?j@LiVEWKXo&ae*?Ok+;< z>Eu-oDYcYQ>SaD?5}RFomLrL0z?)$K&AAITuM~Nwot-UiYo;CKr?#Z+W#|V!mP~@# zSjFO$TXL2Q9;Rw63}!7-_BASY^_f1Pv#;i%gA-FbFD_uSi|kzAjYeHbw^yd(kk^njwVUd*z68qw>!~I zd>(7)Inx~zrA4-6napeYp1YW5@{%8hRl3dEg`W?4 zlrrc`KppRm0aJ$w&2rDM^5-A;;AP3Mk55h% zJV@OX@hJqq%RttfATbKclh5;O1pnBARP!Y~E$-9zuOGBr=dOaCjqQQ4ZGjWF)Q+xK zj~%%;Xx`<%?=>ze1{PcLsEXNTK9agpZY4jl;eJ>=n_c{_1W7#Bmr|n^xf)-85#%a7 zL}#O}x8)F%H_xAmkLt62e9GqK+54ZgH)s^i<@pj@BNO|0(wAWgo8{-ecywvjTuTkX zSFMZL>+#qM!vVB%pwmtqLv{bf$&qSv(TQus9 z)cRKs{i;IKI^IVVUs_yY(N{Ap&o{NMoXxHXyIqNyoez|sI2fkARg5;rYH zZ+$L0JnO00)%wL7SG}rFt*{RBZr^pgbMMF5gI8@%H@?3@;niaq*%7W$gIw9{;&%&4 z;whJw?CUEn`QB&3{w&cv!}ku>)+<7fKJnFwSURqkd9%~E@x`K9F{%ALAKY9pyiRdh zNZ$-kt%L`!wl1^WxZh`kESufI#3(4w>B`_zr=W3-Lk3%@@M&-EOb~x))zR!YnjJ&+b)> zQyB49GR*l~xiDM2l%k~LxXnO zzwDjecY4M4lg?V>JaQ*)y)bY{M)8#DRau4SZyoD(UTbN?AdMpqi)Ki(X6=oCur2xP z`ymgV@3Yxu|E@NV*6j7`E8`FLK6g~(qspVe{ey(mGV&yYRVEA9MkK>rJj65SqQ{Q_$?t1c@tyb_rDTxy)SORm=*t0>3iur< zG9Sq2W?gpYR>bQXe!suW`<%ZLi}7C3zi;3E`k~!?(@htg>rT~|y6P0a ztmR+uN%W!Of}5hJ4yq3qJhXKzE2O{th3LxVo5I)jza@Nr`Rm=qha5-wHL}k${Ei<< zJhSDGyuUE@tCQN%rK9RzUhxtU%V&9A%`}v3Hx?DWA`lX6pzqkZJ zPua&~Lmm`VZZ&R7S~1YvoGo5yVic4|eAqmt>bG*M8hPxdjVT#-d)kP`QR+7i50c&P zGT%wRs`3|)`G-jpwm;W6Q!t}oUERc)ks-4NpO%=Fn0HX6c+$GPY<5Sm+nt(|Bljdn ztk1pky;3uUwX}!+h}F5W{Cp0t!(rt_v5RIxCKszD3|EU(_MIa8u5zbn{;e~sc@(m0 zCg-2CnW3cDpUtieyWO2CQch~Gr@Y!dN$J|ONf-1Cr>RXTT(Vt+zdWHVDr%7RGryZ5 z?Jb+{#5@f=k^Shr;q;r^o2m;l*KBwiBkWc+SC`GMEW6$Bi$}}fTX*={-1*B!jeO!g zcC!E4-wA1pj2^LcjCrZ*{tajgrArG|Vd{d8l0iRh!JaoJbi+PYpw}XdtYnuF6L+3+s4_iS`0LMuVk&$3O=}Up62dd2y(C|!$e?k{ z7TT>kd8_QCW?s$H%)$n>&O7JFcnaKa8r?3s{#)(YuX}k^zVz?tD^&lC&F)BcyRTo% z7H;_Aw0_#TQz}~od))||u}oJ){($5>mB|^3^QRo|eIR5~ysXWxvEh%>Ru49=8R*RW z_M7mj;cb~=Hf>vy*you7yWKm3oIc5)Z(>= z#wDwuOx>|RE{KdP-zj){df~OGT>j5B?oEwXZ*O{bkyqA_f9ua((~8B0uX6xTPd&g-q7WjZ9j$T1@`*UdoQuVI*#7f-0=~eTU&8`v&7VTPXpOv}3zvC#!uU`Y4j&~FX zY~Q@c_?@Nsp4@eH{dZ5@BY4Sv^o;}~d9|T2n@6n-JesxA>*q_BgTdbP(9kO9ejRLf zmD%lj|FnE`Ah25E?wO+CNj}q6OnO%c=6n+#rKPEGHS5I1vUv~MH}4o>Fk7{6pnC4& zbdCNF=2f?ruk^mdH_b^^E$b+oUHpCkNjwq}cgBt4>o3?ElF&N;<@f`$lr5Ijw%2S^ zRXD|aVoY(VJA(mN%`t**H=SRhBfHrhD1YEGYhR<TY6fy-qy8 zcRu5)$?HiEI$N}kTu)%LtHN%#A+OngvsNw&9#pEnliVoIQnc+l5NBOU^S22^m&Ka?5eWcO%*Fr$=!9pX5aPg z(x<$JO&5J+R8`vl<0t!sghZu2VoQEJN^5n?t$cgnZKHsMN+VBJ$-vX6TLsT2ADSy5 zw&`;cn_cqX+n{-#=tHx|J4!|mYYKih-mk=U%kF(H*~iz_&!6vnaO3`Qh0EekREt}l z8C#HYfB%rV_v@Plo8H-bjtn0w?bmuidAxfWn_YGGcn=I#m!Ig@=i0Zy^{aeV8-5Lu z*mt2NP4K#PyIfZJ#T9-^hXo&Y+)a1dq|(9j?aSEQ>(_S(h7Hv5-W@%6ZNQnk?DLoW z_ds3ouJaKX1kYzD0lYe-BB^>mBXOg#cg^= zM~d`a=ox?9^~WOVC8w_pYnH_Cx|8`ZmOb7JzpnL8sxh-WA3OGFL#UCzuf?YJ+AY`k zUv4{);XZ9y@(H)S=eKIEf4Kjw*@K&J7Stt)nO?LVcx(HMP{FWOm)78SqKREicDtds zvlo9^Fk_Zxgn@P8^|m3u#@)4koL;-}`>3pNpNi0i*v0oeH>UiYb=zt3urr2(cYmJr zGGU&5sdb9TIt|%dyzkiTYO&k>6j0JH_W0sM+w?m&y%slmp&g?ywJv_#q_1Abudo)% z@@oxV=ZmZ{fDv}!FFrrWD3;lY>quXXJPrkdUm-UZ( zZ=LS?!+h^bDWA<=RhKI$9!a`-0Y?mLl zV_u7E%5Hg*C_Otp`lj-F#e~o>XDN+$5u-oK>noQi7e7zyXJYGA>LjYkW><&Z?gPoJ zbbW~n+NPo>o{A4nsqZ^-ec+hfX-$WnZ1vBp4ZYrIdyLiIyY^be7T0A)eLlU5H*QK; z`?NgGV)e4)k2|ij-%n0pxBJHFQ%y(C?mK%WN1M#PV`enqfbe_6LF$U>hhMyyYLv06 zSmNax&DUqNH5z}6+k1QcSpG9l4G+!CmCV!Ukr8-sjJ)5$cSaN0?KVjES+sbE`tc{d zCO%o>ox0~p;Dr&l-r}n!+tX4K(kFPoO3ldJ{`KYT$*Gy&p4p9m=v}ol zOKXexbNuc%nZLU1c9+!`e|Vz!UOZ^;gW5BKGoKe~izv13H{7>fd_+RI==0QAvHF_5 z%4gr4u&%xnEYs3!ps}KVf~n!#z#3fx=b@9Yv-PhYyIlplH!%@a>)gjX$u7U~T3;mo zg1{V}0;#RWXRVQu}Ny)+9RH8eH-(Sk~0q7Ca^Lk=fCbNR6q|OB$DK zGqD(N81*Z|P|PFwf@MDq6*jvD>~=3UIWCaB{5)^o;A7KQ%qZOx_;uNXs`T=lb7`Bm znwZuJy9zCIf3H*j`LkrLXv1dLkln6z(Kgm&ffl>_ zYmzH`ej2F0verz{95!HBRhH5L8_hvu4i?rlD6E{VmvA&eWK~nIKDn>0#Ejl#AF{R_ zdN@6%br+l6N$hsL&WpIW=;rEgzgoLH>T;>>`S&G7dNW-%4N7@o`Bm>=%~(g}jPbJ{ zo7rD|bYFJJBrc=teM$o$Frdk>$C>4KNlLa z+hx_sShKS845*AW^%H9Y=m=xH{)rtEe-&hK3qxl-lu zP!BcL8571Usy+)G{`p{>hS1Pg(JShWq_jhCewr_2G%KWd&C@pnGY+o)KK0CQ1LfWA zqmLUd8&Z6g&8``{-Ik5t*BGWZ$d0*xefW}(V*`sc-dO7-ww{bw890A+`I)-r700b7 z)z$rok2@|`tZni0(Y&JVFH%Oy?mNJ`VD(u42%BAVcDpa9?oP1MU0Bh+d9-VZuAAz# z(Pw1LT(sX5FRU;#{Q9tY{`@k5b9UMs`E>s9`0TabK2Ck7UvfAa*qQcv@q4sP0FKjywm;jbH) z%>o|ZZ^|F)*y5EOA$~^p6Z<}C$!@p#*aIG=IooBA$~ixiy=&#ItE{|Y`}+;2{U><8 zt+X&J<$F@{L(Zb0gwNT(DrG@!YQ>hr51)>))w_MR@$l^>M`w4%%i_a#XIAWXmsK?^ z57J&gc!s0J?4Ren9yzZ5{y}kcf0s8FQni~k>oo&Dd>>f2qIt%_y{oo4OW4(iM%tx@ zM9Gy%nAJ_zP|6+8X4jhC?zM&jbq}4@8BR;9?LN+nOM7G9r&2J%J!Y4&*h)Q9#U<&A zsy*cmx zfW%k<<$~)Un`H|O7O6ZmyX*UHSf0_5)1Tt(ld2;dSDb9DH*LGQ@?A&K<#lS|8n^Ds ze4w5SS$ufCuw}P<@ziyJ$8P7gza1C-f2g|4xT>0{QQ&k4($Wng-5}lF-Q6W2rF6G+ zhm>@8Bi$`XOM`Tmgje6^`rf(g3*Y{~#X5V>p1o$~oEr4Xf~lspJU-)M_U;c~lT-;R z$-K(9h-*e}M#_>7lsK_o1sjTG}!U>mDzm%h(z+QE>Sos zg89k+%^K2%4!Ba}Bo)qR-ijA|@YGsD#1j@%=N~5qTTTaBdWD-JwG4(zHyR znbvvD^i?8`@d%Pngw+oF!6YuK3J3Ck{ZxqmasQs*{ueN%wl&x(yOB@vDniV+iN~B( zXOGbXg}h~h75rRVNyiFIA=hNEgU9d9&r&=NAom3zm>p$Uq1J=t8R^*a_*eP-isDnRID zg}98dT;giOi~7IrpQQi(me&6Uj6AKz_`Qg8umq%tcH%E1h&YaWgL;;&UJ*zAqs#5W z4JuwH^2^4^gM}h26Mw9-AQT$hLTcVcw z4yy}SF-tvk4`!{I?8-a`d}~XT&h;RTR;W2fIhs`dB+>sp+9$r3+~Q2}Co7wJ*PR8& z3`N(I`wrm#J^S%5U=Y@I&+u6G@(Nsb5xoX~brq#jwMpNclft5*#69w0c(ONstP?2P zDdaR^L?jC=f>>dxdttJhwt9V&7TR8r{P%1qId&86BRr_&txGIsXU z%1HeDyJ~{4Zrg&Tvrh;lAlA|iqTfnhd(gvN45%a_-M6arET3==+|@K)|Bw4$zgi1) zpC!=yj7D`?Cg58;du9_wlx-UZ)tp8QM|YlYC?LPQZx^cF7_>v+kBr~uWRRRoe+t)z ztfl_Sc%VMz3RM|73b@*!8)+-b{t{(7VvM)bGwIi=aBSuh+xScEV@>I=4^d=cZ@*i! zW-~9KA0uC}!-q`XPZt|d?L7xDaZYaCn-H(MVFIoW=$@g`e?CB2XC07#9(`F~cz(;W z{Tg28ne4tv%>lXMpbi((HUGo=>B0HOny~nRzyw2vnYm-0f>T~}S4Q9xN>G?rEFSU={{cb@@36Jqf#JY_4X9R-h z6~E$O`A$#>b-%lwH&|ai(DkpSwY)7)c7;XKHN|*vo*80!z#3VWgU$*>fVQ85RzN>R zsp)q?HRIg0XXby&ktX&sz+eS_MEcc)QaVH|UIb7FebCJasj3=_ypRrlJ7QN+BaUt4 zOZN03?1$BjmmnwN9@{>v9jmoO7i*Tjf6XsdlltkA0W24YIn?Se%2IU!GO}R5!~k>? z7GmuOpLi*<-8n+f9Cs_QuKdXf4L4*t?1x0EKGdsU1=39RJX2wtI1XdYuWQ|$i-_xXnEx;bvWZO_vaTH_#r3qiF~(UC2l_8HYSAQq&qG1K4iU_(7JaOPFr!QUjBsh zy%>IFXlWl^zO(_m26-zk*G()u$&ih)H?b5v((UW(RFyRjlQcjbY(STF zq0@KKnsS~QCsIRma-xF$7)J{)a_aEI&#g$>Jk}5n@`+Q5`f+?sPi|x)(>MRg5QfV7krA6U> ze$qxTL;rY>u0aqT>z|Z$(k<#ED*cP2^uh)kaP2@>gu}FZZm8)KA9I*r@$0)>k#c|e zpkm0nI@A4ldwk)Lt&CkUElKQ+H~kzucg?-pX%)nyq4&v9hp|NXhGNLzd+a;VtCCwgyf5rQSDhb^q6ANTcH=xMyw@e_UHI3wEgPRM7L26msoSU8DnZX5*n^lQ zeC6J+h{RJ!E4Y=$xl!9cFWTVX#yKC{|NSnCe|;kd&=o$zYFMj!HO24>9_oy=)@0St z*iNMwA!4yF@Q}ItY;~ou8xrcusc2;aA0_08Z1A-o=H=wlEGLUgJd;4#^Ls{M0lhXd#z6l=M++{zP56vdf3xZQuR6Fy&vQC&g4t&A~orQA56v z*?En%iXe71je`ofPN2)b==dCX{&qLT&6HnK9#M@+Lrn*Yfi=9HLpH#~rx<<>X3S1= z!u+wVt$O9dIQ`^Ez>UWyRkIv?(9S9bw75Coz6ag(Xwx0ve6qA~kz0S7?XT~Z7(Hm! zkBZ3+b;tbZbu!fCO=yGWQ5v%qk15jz8#&s|+|k}g8<|d+LVwJg`dS384>^PGoz~rt z#Hg+eE*kv7->Z+xzbhd`hWwQ*M7adZG~nhXO^46kDtOGEt>H}MNgkEba2lTm3>aODgBP9INn34$rzTW#Ym zPs+)qc09*}DAus>Lj5P6X^Tg%5*RxC=!+InF?jM{^uJqv%n>Hsh}Yb7E4ykv z)mbT9PJpZJGO(~NPE8lC!+c;<1NVt}f^MO_|Lk0PqT#z7O8WzZ?s4LdIxXNl@BHUq9)<()0m9`? z!j%gBku7XZE#>5rI%-L@faD9favU6Xx{KT#m^IO7Ug+1a=i@ntUeQG0?%GVI->V4o z6lInxKQ{w)@CNhM$rMH?h+*txk?CHa%yKPP5n?;SSRUgX6KxP;)7oPblpUcw6_xkp zmHb9XR$QJ=CmM=a=Y3Y)WpUK-enk{~5AXq9iii$jMLCgYYP6%fddT7Wm1}3D$N}%* zH5|gF*B`Z)A_bD(#CYSY9KHK)#A3|SnR^Ol*6;gJI=jJ0D#mxv0Oacny7u-#1XcSl z(pX;pzVc%eb()aClWIt!Iji}Obepvm zN3fU4%=GJbwOeM=Q+4Rdc7ap$*pufe`(IM^3ZC@*FA~`gwVG1_Hvn`?WBoety#MU$ zB)*NP^%>0SQSN+p`JRXGSU#0_`pkr^cY92`40Z9@8U{gG{NDLoplM<0cjRL{)& z?(hukPX>Z6CJmzE6$dT*_xDTIetx9h6!rB5_U2L>ek0c>G6}7wuYbayu83eH?eLZ) zvE@4U%RzoaW_-!x|JCxgS#E+-dK)LD*xE$U!pL#;e+)Na(M_)?ir zdnLpX)yac%MOQx&>a$DUYzxbs-_PK0JJ?x`%dkT9VFqT27#M&X47%dzPy#~_5vS)4 z=`V~&VTow1u@;YFp53_BrfE9a1k>Lb!iukPSfug1ble+2T8~3X8F^Ch+PEZL8<0fI zeGSgfLO|E$sB;A=d9|XNqfwH43$NfUX_RfG>VrSiLxxkFH@91F{@~jBDXYe3VPDB? z+0mff2<|d}r{nMZJTPzu5cEPozM-H?fBAc*lx~b3vi~-*B`saDa9~N&fQahH)Ki72 zldQM`lS%W!WUAB#oTH}nmMYPf$L8n5M#i|8vQjs~)I8DueYewp^VBfV4V>i&F3K47 ziI%2wbO=92Fb=UQ!&j%CIvngC2qJ7<{OHZ#(DKQP#0#V8L;sMjZ30Qeq_``=gwXn! zp9>rLB9L!5=uYMm&=e09=0>P~uHDX23uMr5(#j2nGScOEZRSV^{X1o`$P=;C1ZVxl ztauXBnbk4jQ|rNg8A^N@+GlTx9$dhU0A2Pd@x4@sO_x%UF-pjv(UCfjYlQ7onhIF# z-y?ocYHUuw6e520Gu{edLNobuKu4DoU)OG4g#N~MMAn_AsVWsyj{xO3J-hri?y0Pzy z@^-R;e4{|u8j6IFr)fpb?rqrQ>|BTep^@k#`M^ZIA6EqL&K%1ca<-@jzZKzHh|){W zo2bG>ZIrRL7vv3&^l#1Q^uEzR1MVl#b(gum7*I^@qnq1k+C6rAm9jzRZ2P%)_8G;o z10z8B_c51M0d+Ypi+^dTcQ*%dhV5}qtQQBmRA|oXZgvefxQ{d%bRXfpe!WN0tT%r+ z$)3fL=~Igeu%X2WAt1t6bS4@`e|S_UK=b_mA@%hSO2YHHmJFhpdG2I;12uUce0Bad z9`JlX4Co?pU2A_yDk!D+2Dib+x~nD7VdLSZ<`vie=X&=TK{b@Vy39AQQb zTz85GT{|jbv6p2UR3qkV<;xWJHNFrdqY=6TCz# z;Tugy-e}pr{dmbY6O5Lh7!Kr{0J^!hcZyNrdsY#Zdt2F5it%+W2;Nhl8)#jK!?Lxw zUmaV7SHY#~{|ay)AEvjmSP|XZvM_xqhM}$*hR44uSq?sr6G6A=lU3lGD3$iNpDbS! znN0<1vv0E}>0PX7VyT++&nE0z<*cVMjNtm+_!55YeO#*)x~zDgW#Orw3nP*8%{o^H z$TtaeH_pDCuFwY!I+(^3IIZ$5vfzJSzA zXLn&_2KrRCr++&Z@Yv^Ja_lINo}%e(&ZioG!H4iT)2^GL~tX9q>b{r8xbrt5GdT2 z!X=k02A+8xO($92o*V#mNCRE>b#W5TO(fzvyvHjNN*)Q6j^0I%8_!Lu5uKQ*Pc_~7 z<(?gz{fhTrEKW0n?5KUJ94;hJ4h{%vt{UFiZx6r&ZaV0?XhK9MPGP@5VqXSxGb_hh^Yk!rX)~i$S@iK;^gKygxj&|a8&gd=WVCr^l)CXpy)Tc*A=PtQPW@3UB&u3+BoUqSjB=vk9@gzcwS7cl@Cod5WrMCBT?E#%qU>j*%zpdT<@aa#OZBaZ`AmzZ%$E>Gv1bY5FGS`i zOnBR;dn9-E-z7(BLw)T)%BZT_HmM@r>Og!1^34I=&ugC+SB6^Wl>17iVK`V}By3w?0tT-!e0 zw3m?~kHKLTunOdx2fA#pR>imDf=t^qlnv(UC7uI#pDkrIr@Sc>uilO>@}PVAsVVR3 zkDWV6oMl?j7=|OIg%oF@br#KVwL$S$zEK6-e9&zekr;|`wx|Dgl{|M40<+aQcVM<- z@US_}54TDoWh9?o=rFKL;BRXfaXBa95xE@r^TLsKEkwTy6`hV}tCb3Hzkn`d1h=y6 zDC%scW%0&&Q_7q`Ij#uTj4KSS3@)oc&R3ApZuIsT-h#d~TJNq`UmpKnE=OG}M{;7;u% zKhMSLRC`MPEQoot@@=C?GJKDj8%t?AS^WLyrBK)tae0dey69V>7IV3f50*b29f#%v z-!gdx{={H@yL_)Sp%fp~_B;NEA~h_yzu~gdQ+b{LVZ1 z%DG5}0OJI>m7tqaq`CTyM6RG7oJ>$4>EnCUPK@xg)aQlf-xXv2+B?+G)Gx2i&0T(7@3!jjw4j=J$w#aQQscGkV za6}rv7jSDp*NjuZ?!IN5z5hN!q#Tw%vjWS{FO{Dkt$|LD*!)daKt0$}6 z>B97g8(_qvR5ivz(7|cP!QC=pDG0+WFVc9bV8H|iFFN0{rS{@_CBC)nG)3|J-Qu(a z;|93(pleAPcr^bsm)AW_D7&6pM(wDXQbSay)Rii!m#a~2@V@t$bmPkcLvsM96(Z?z z<&^9v)4r>;`PL8W(?!f5--7R(e{RqJ4H)j99b7&P5=6Kq@&f~}9js>Q`2j8ms-{FsWprmwuVqcv)AV{rKjVu*IZ~y-y$(taNE9L z(l1<>O(N_8ZWHLLaN!s3CnwdB#p1FlHc~n#<0uR8;7CQZ^@SKz5I95My9;hi-J9<3 z50~;?o3}QmB&C;xAF8)wbDOf_IDPoVcx^cRM zB_FxCXg$uUT->B!XtY{?59P1PzkoFxF7u9g`cACPUQPE&W0+4Tan(S=h}&`w>#^Yp zwMIk6+*=Bc1)Nv6f-du*ki?FdDAyo3Q3Mf6i-^b7{bw+(dPFdfHy)c+K3b?EsD>W+ur(=F9= zXT!kHAB~EgSJusb&8Ez5a5tRbQ&}Bp@l|ZGxJosj-biBL`3ft!15B7T;I@Nqj77H0 zKp5KcpxLVbnP~~m=hlwT8X5{#Ul5`cu5+wm9#JGFO8eH@rh;U1tw)gmR&XL#fEM1~{&Vu! zX9i|}RP84u!=3eAwzjCuw~Ck=nc?1tSs>p|&~=cNAZq&I->gWLX&r_+yVUh10)n=F zQepm`xo6=rj~1)u)_VfdLiGy|VFv>VzQ-2{hFYSjFo6ho*py622qu906?97+cb&Ag zHG`+?bDdomvI?#hHv=*7aq%B;UZS0!!~}(qt|6WZu4NN7=XaDqM<;uGulh z!3#2~Gu(An@nKrIqcvaRZQkDQG~s3f`F4Zu>$G0#D#&THz}^X1j;Sv4WSP5+@ZLjS zCc!uHJ-kwpiL2tnRKseG1mwSV{FMX$TnyO9_LE}uhDxPQ(F^@ZfZGGQVP&!Jt3J7S z6hMw)naT(fc6R8$n6-wNi#Drx(<7cHkrxh0myEyLN=+Gfmbfk-J{6TnBQpkt=)TW8 zepp8fK974r_grI5`+W3WJLB4x2Ui&iYplLvI1V3k_jQliVy#CyiM=z9dFJxq+-X^E z_>0sv`N5a9F#>brTOBz^H)B~`f&OCQALV8%j>*q=pIH%`)OUgNBwQv$&42i--AomOvYrR!q0 zGItzF$0=7Tz zUI+WM1E9;(sAFhK@T*qji|?-&iKR^|;u;A)4@4XW&TiqSMn9i@*Ki8x5plGYpbJ*6 zNgaPvYxWtE@o0*(&u+g}IxYkI)q|j062?#c)a)W)6IUg@)#PHW%{sM~v2itfIWvAk zx)(+4Xd_FG6l2@of@q!SITon@$x1w%1+A?sKXHG5}{qb%gaYvN6}V4 zhg3Y@^NYsYWV+sc{z(HZ{o)KYRFkZ6ZNU3yGPp(UgWf*EkP!0@WkpcaK?7>r1OMjpCGbPx|6$c5C)Ft zGJLqId9bVOnj@sN_)%)#WBj)-^S|fC2%=fcQ#dmBhS)w(=X>FZ+tu%<$fceAplT*Snh;?Am?RcmbV< zYWAeFgv>eO%v|#F^`$R6@hS?w(n)=08JGJHUi;5G zd?t$?L+*$#Zt;uTOuQ*q?y!v?=Gt9Rr}~19+^o403q^}wAfd#k3+^|X0A0!ONl3LW zRUvOwA76a=lh?l=^h2hcY00FD9H24Kr54Dr4Tw**)N`!6Igp>6EK>T8!{$X2kdC)l zmQQoad0c@yOoDE9<7a)7s7zZ?=or>>*6)-T7L3+uho1sGq92`tg9=F>aG2Lqr{*4w zk|ZJ~A#gP5lYMWIFa2X*6LW0!u?*A#?iA>@db6QEm-c1HPak^f;)JdEXiA@&%b_VB z*M%auZqpDKG}~KrG4D`tC`}vanb8$1KoU8vuqhyD#c^b}G)ehBZ zAWSKAWX7R5B6v&1y%~KDT30f%e)QuDUX{%0p|}f#QC_$ae;GCEh`@*gC-u6%%*(a{Fi@{Km?ArVH~N5s;q1pJd-i<)^eTO7%0dUv#2m zdaw*HrwP_2%`j9wlyMj{H=18f0Nih&%T_xz-L6w9rIqVf%AfP3v}3E<9xE)0QtUTOgEE4u5$ zw7p+HpFAI*3@+XzZyAk*JThoO#UPXBylJ)2Nu=;eA6SWW-V9`XO$I-yk}}3-Kgev6 ziUzoIpbJYp*Up?ocv`xQCZ;pYBAYXesS}sg**nNVmk0MS`?^^AE)yP`J`6JJuEZtX z<|}LZz%41Agj|^@*2MmYu`$5?4!Q=W$(~KMME=(sJ*#TJSOYhrNjw$|Pa}$WE)p{_ zbk`VG76nxMCsMjKsDCmyz16)?AMh<-=;C1e;Ee5yT|NT1^Pu|!)03l&(&Q4F0gihY z@%zfGK-wV;|aj}k|f(G0EHuxF$Umy0S4>gU&-YEIiGRU-T;r@^)CoxpTp~0NA(?}gG-EZOKke@fW9ll3t$dEH@ zuw!^oo-uwJw&>ffbBhD}MvI_p%)QXq*rq$*`s{~?_TkDdC71uzYkFT_?^f0ArtYZ) zB|}mqL_G95ufdxqUa~N=fb^98&yU!inNI1yQ~d2VfP9xg_i;CZPEM2V`%F|Ne&0 zzx`3mp!?-iCIm~bMJ^;Wsd`B2jacFgS=^@L;TWnk>IcE{d}+@NJY+>fqaUdYS7v)8 zl$i;4q7zkF4Gwo2h-2}z*5G=}3g{B;tq(mpoqndqrF)TPVEd7#LbDbp=AOn%Ueh=x z@XB7XJ+JuHRYo`?@@XAW^wDdxoFQtZY@aGye#Ow|@kMYvTLoRMb?ZlAI2CgG*R-D9 zqrXS&%y*~wiCqcG=kD-LOp{_@_DDz@v;My=msSsCmT zY=Cb2B9E0EtDUV*w{`8~<5{NBL=+8@Ht9`I*%q!5DHk#no?X1L`$9f}%T$1woMAgd zrza|O#tK}0{*+(Afr&9thfUB8cv=+C!%%hK;zM{@+w3oqn=I5>+N|fY5s0e$*n94b zR3m?rju!ClX5wd|I3w@E7b>qw(!PK)Qs1pJ{(N3=zOx0o?=Ud@$SDNh2{tsu^P9p% zenwNf(#FJNL|v3-+Ck_SspwV_x`b^|XuOUZSDiE|o^Wc}H`KKVOuGv%qh-ZBJ}%jtW?ms9x>JToB* zb^Z1W92fg5wG_@T(9A1SJd}C&A?Wtsdo-tp_rUdlUC`x@Y}1q5iluyulyI~Pg;xVV zURa7aoGf&^LUdh_^({f9p3z!sA0w!uFt#&PAI9U6zA>pzUqC~+a2sAvp~(-(cMo(~ zxsWVBrN4Mbjn8U&MyJB&*nRdb+IPq;rMgFcYq-wA{@3#b@0GCO;!KE2l%Mu={N&W; zl#pl5`RB+d4dH4g!2JojaC~u)%{2#tXJ5zH8v3PE2|O2(Bq=@z93?I0ysLraiY&B& zI$qL0x89BrW+CKIEM&SZritFS;6N{!NdEa5>?7`j?id>m)bj4G=&vC-aMNOk1F(X($+hVY+`QsZ+ z^IMd0+60w%@CZO14nbGdoSU&P-Lk%`$(_WOCidKTV}ki39b>Ex6_ABhY<8#nGLb84 zxs?1M5q!Q0xF?`%zXFAoWJ(c&jXb~9)@N+F?kajMn=67@`EEM#x%T^aIIY0+yYLee zN(p@-&HUl6?|FrUW0CN8Ng^n!ilM5kwmn=3#NyG|~E{rXa&SSn0XfAgAd_E*ZZn4iLyOcckL2~X|jm=+#=hh8y0%&T8)*(novQriXT&msL) z`~qeJ;6AZ)&~=|P&=bVYwpEX!MsbZ8OfdA# ze3bjDHS^$mCDse7Uo+Hddw;IJ<{2R03($>${a!tx%>SH!{cT~ql+F<=F))X`G!zw+ zf+lXrtkYA6WO~4BE6NgCj*5BV$%%edK%cFxmPFlHY?xMA(MA(+FG2U}&9lLiDdl`a z-;FH(4i5by%q%{1{1+QjGU;pP1({;~)*P;o6Kcunon{+sV~DRdg4o2oaO#E`JyI^e z=5r(f_X>3TzcSoRT{FKw`HbKT5rJ*AmZRq8e&}z}x_qQ( z#0B@o--2!^NoQ;P>5jauf9RQ~p0Kc#a+(4MyX?Noul);dI;l4fcr;^szp}(e-zR>K zAxH?0#SV?D@1o&eUAtjLr%Pr;@WzPd$Yr4Ws+5g zxTkm}-W-*2(jNWdA8IGbM|}~D=mGDmocOjLX^oylrN+#^T-SVu99<*XylZuw{ffc^ zjT7^?>nr`~sD@&7uGiXqN#MHl1Lzt=L`ATqIjl5|njgik#mvLPh3jEk##`jDI}THU&=D|deTf!M>E{@2&jQcmJc90(Ppa!ZA>BiCR?Nuh zjo&i9vlRlRi1))NMuoDg zhbPdrezUg4HbkM@C?s%kXGo1Qc71)sMQV%~IGd!qd(e}~;H7O44l(A=EGW72T8nQj z(@A6y&)^k5Ds#m2TEQp>;68({`xw3qo;4O%k!S)#yE%U!Gs;-*-RXvSo_pJoePm9ZP&1V5|0yd85-ucF*nfdw%!2J!nNzq?iY&3}PetOz&Z`gF% z#4*AWcc6`Fr)*o{;o4%EYN=IGah+kGYc4C^7?o?xC$gD@mn&r=8L3fuL_b}D@3DVg zVE#8?Op12z9nZgQ9frE9d=P`;SL7IC3fImmK|WWJ4bd;SF)j+E#2N@hQm3ssU_vX$ zP)QqN`dUS|UQpDy7Ah48u8aI#qy85#KKA5ptOd3b_`#w^STjBFGPTmn)B;qBKPX{- zw6M+?snrj-t&t92lj{c-Y08uCwW=nSlDQMVc*<%x)n~^u0_p$-x;-v?*vg%zSX4jG z&c7IQAKhKm)~juH_dOeJH|bO@21rZqKztl8v<;3_aYg-5d{J?KtO@`1ZIOsUlE7HU zcp>2a-JAF?V4B`gS>nNYC)Wh^=^Cicw=YkqX9u{jpu0b>7cTna z*+wpNv+7APPI|SfL$A{mb=V8d#mtQYJ;R&5W*1SefFs<_J|{p{$<#NudNwh`!UHW z>j(3FG|lqaT!%fzMSRzVy*SNKObebb{JW<9FJLCx3=BL{`>)7O48%#uZ!cJHuNT@$ zMh0{DkVxLk_jz}B9duXEr@#ANvU7~E{84n>Y3STu9Shrrz#qRXe%u+T!{0gJzks3d zAq|Vzh(L^~9Dhsc;iN)TOGe(*UZWWMf{6cs{f;2`6oL~wh#*#qqiqP%2x}v2w9Qio z=B4D2zHUNsy;=<5B7!c)+ZZ}sI#lPYi%s1tkRB@XOMlM!cJ}=}2tiBD(_I z21vS3rTxiI%9S*FDj9jSO2+TGy__AoRLaf)_XX(U>%N4w3KmjIiky8VOT4y?fc&A| z;My;sF5yJbw2@(<7XlSAbUx)oiG!-@+|}!?cE`rZy*S5>ly{#&1O0*{;39!8x2fp) z&nAs;A~(cyhcel|E=jpHhqpfh6cJcjnpuVYX#yQwLT6m;kAe`sNqgeKW@Mn)aD61u z_Yn8va2}A81zcp%%~R}_J9ow^kn1`z;Bv9;bW|sreSZ~kRPj#Y%RuZ^S5btjtUgpB zq%ZwkaPO+xDy4j1EXWi;9waK7^rbdzy>y9^@}*5ECIdK%Sjtvn4wlNKUa zDQwhN658-pmeaFHFX+cCiLp}9SZzqq9@6`~P-O$sOU!zhlP(F)NPv7%K-W|SEl<&F zSrh6eyk{_-!B2BKqjvW$rn(oi=F}JY$z;-UmTSo#fgq_KYwl62_QpRDFaNz+%X|0* zwi2z$(k{UL+cWqVFdA<|WmMP-e~%CGk55O2dOOD;ht)W~v{_8@zC=PU8F(#Vdz0-( zu%v-{?F^Ib7Oeh(8@drme)DACkgEk^D-Ce}j>Z21CQlUpXlMRSBi-9?U)HWtDm|OS zec$saHtu?)Y|_LpdDwSwLZ`<}p{LV!r{P-pZU5kKfZ3iPm4XS*n;3CaxdB{s(9KV@ z8ZDD22#S1E{el4PA<4CABcZaKC~Ks%!n!P7(xiX(sw@*Vn?S%b?1!R*LPm%+sL?5YT*h<1D+IIkTP96dg13??_#HZeqP9(b zFj*V~&9(>4LiMRA&G==mzFcKV1l-{b=NEvB3A%-RC$!&r)-6bM=*JwqiDVQH)D|HE9;2AWzdmH0=8ptnb^~3W699$R(mf){m#D{iwUDEWzJZ5!(@5g`lO8pBM-a+eX!?I~}-?Lt2n)}_#spOE& z{DIcS-kL8&oHJN}H^vhpeK36XPz~&KKziKexYg)_(zG z?xMBH=AZ$SB-%B)Qomv&;n(1WsV*mWsb!Zu7Px?9rSEX25pq5C5#^2g?=OgY6xGj* z5qPvH`uW{od%tM;0d@F$w&7pEI6@}#MMV=S)FoT-UGPyItGzdHetGiR<7~t4o!|E3 zkZ&K;{*-qgQ7a zf#bv9v#0+8CX6nIkj1Fn^?}5;kK);>h@W?ytoxhTe(Q_ev`F>T-qt-ssu$aGIlHh) z(~v1r9G7j``EPZIVI!RUbq{qy!1IuQ*Jl3(%oFYD#xnCTw6IT@M3JD?e#k8W|4fC@ z0gR8W!cPgw#@t4Y1zK09UW*>AKJ!mGyy#9#`q|9Y?p7|k%kdb6r9d4BLH9?{XQg9I z7K65+RiU(oBf6;c5{2VvvK5u? z$Pj~rxxsa5BGAoLa~W$@Tl7npB&0^j7~PlcAu$mjQkVJ)Gg=*bGm8|OI7$hvWh}oa zz^H*(zpvG_{LAfu4b@0OB1iTY<%??|Ut-XO)Hquear69sa2Ppb%_Ni|x#g+4bdfwz z!hV$IzC=zz^SM(rk;{8plA=^C`GPm9-?Co}y$OZ7OTRi{SV6k*7?(Lg&_Ad0Wt5%uciy>2 zI^7TV=TTt)mlSjp9tNy^1Wh!WboruQTupJi5tDizaFtmW`x@(jUiD|4{0w{ z1!dyKv#kus1i*e6(WJv}b`4Dn6L+N5ZVrWx_c^l`cJ7- zYLLP-uEmblICXu~OEXWDr*wT@WsaU}OZwiC!|$*{Me>YJqSORX0xmh|rUaEdvfFt? zJau&jb?A30Y`-~lmy5kyd>-*OkRp?ln7b-bl+{zK$vQc`K;w;KY3LT-Xr>Xm(vx(7 z>NuJN`+XFkoA^E4FQ!p630(+}&`~5*9y-R_U2VWk8$%7#{1fskAx0~i&$Ei3M(&6v zZ^DKaS}nh^@uoP;`o7tl96)Pz2lto!&HZ1%9F^;|ND8OD(fDkmgR3P_m|#k6$jIJ$ zan@eiY+FmXc;~9bYDNrZ)S(!8lTb`;c8K}c+(Cu-&F;gtK zr|5Y;z?ixIfjM*iAjfDm5|Q-y1kq2u)?+tR@2^d!M?|Dt$=Jw{!m)I5_#N&x+F-LA z!Kf#e;O|)TZyo3F82>L|sLaPK%Ng6bBg34iQdYi9gGPd5d=^=S_E-S#UXP? zX?(mmnUJgwgGX#E{q{0y=uWg$N>v4>kwHG@@4fraeFM5)zZsV@v&)EHe6J~*Be5Qm z7o_2SCa61)pUZPuS1nc@HTEX>)A?c6CZo$Zly#hI_2w@aMsm~ho<=fGvhM=>T-2bO zr+QnnYQrVj;_5PEr8`A%%&9)B>9kUzRgG8uqJe)8>*6353Xd+U#pH-HCwgu~_ssk_ zKv!j;o%xp0xo7b2oZ(--G@$z->L$JCHzwhrh+;%oaGc>7Obprd=ymVTsGzN6$=80FNuz?}FD>Y@Cc(TlEq0q@8@Px~>Bv+v zm==vAC+@D2>6e(H>Tpif)iSw3h=w|nQIze+go!Z!thX4poU~UifW753>iHgg&eMUe zb=&XaJx2cfx5}7nsN89)DkJGfd~t&Hnf|A=wK>@B4GZ)iVa zorH?vY(#r;{f4H3u2{rnwba7PF};5;gm3v$8ZH$23c59UMv<*jT> z^T~YPoxa98m-QV<$fE!LGF$=DQ5#}vBu!-RD%1jS*+4f}^NXP7i~5)VIo?5Se>KNZ zJGv+K9wQiE+6b?CAqfY@d1&=uYJ9_LKKEcoa&?5AQ?4*Ml#q!<{veBS#Xma~|6d*0 zL3c5Yeg@}StwxJNn;=w#JL+kK&?|sAjbzBtx#smWHli;as)cswnC=Ml-L0H}GV^HM zcnyhk>vz_J1Y#cIhHSw7+w=MtFkV7**z_c`_(~5U^D^lxFUNlm`p=AY;-}bJO~P6u z>)7={Z83zt4-07aOmaTVjin5ke>2{>mT){WLQ?oma~W_sL03L7J#+kw09v9Z!Ocl+ zf$zoH)@PQi5BH_!!E-g#kP`wmi zZ%^i5z*K0{cMgvu&iLk`XCC6B_ELCx-~fR10i1q?7Nn5Pp$CJIAbz>vy3}MVGwJX zgl#dazPThDLmo&Zln*cYRlhBG)-r~$9+xQj`uO`T*$9v?H|WB(I(SXNtj;r)wV1EH zvd`ce`IN|A|H%$rWl)e-&ZZjWe?>aF6zPAW~E==uP1$|Xr=hKvq*K4#*rj_LP0&=vENW6U{^1fnit=!aKT|)u)t~761uEpkG%> z#L|s)hjb%IcXy|BBi$hl(%miH4bmObAtBw}(kZ+TA2^Qt{rv%_m$S2T&s?+Y+RGWr z8K@h|?p78t&p)RX7cnA5KN&4Ab4ZxI^@`qIA)tGHo`r?4GwA)WwxM0#-6s)f+mBrd z!`x;HnVZH2o9RG!*if#!5H!kMjW55r{T;`-Ay-Q_r71yRgy7jz0)H0ZzMTo)18ST| zjyTO2HH%t9q+Z#SDsy8|}xpB(LO9L>x2Zc(Zt*SKZY1}>~ zE#k9por*K|HP{j0iUVED6`#hJ+IcRMk9Syl#*kn(A<(XIH%`-T$$?r>);^79461iY zayotVGXA(J5-a89fkHV_9iUNSKb;vt=wSnZD*<#9J>1=XOt6WMCT1*sT(-u(yn3+e znQ3br9!W54vMT?{TEM;(u7tjITWHvktxYC2kfxR%mmT+5G63r|q@l72a3z86&O$Ss z{5&CS(?WpTT@Oeg$O>jKX=WK)z(l@;A3wh5IE#DjTUJax{`}>V%-^;db5F5xuNdoD zG!Jt3SrXE>wefxaN&#I&_^(rWUp{Vr0#hd^02}8(1+5fq4uH9g#+N2_s(-EE9#=op zDp$@N>fb})#gqi`8(U|^a%#?5Do< zY~KS?U-)>^^?M=ia>%sdY{UXf(d$LqICN_!a?q?k2a2^ZwaH$aqP)cIO1$!64*$8C zoKOmV8;$oZ_nWOagYPL-`!N@l3`VkT|N-M zMuNzmK#OKcG~GC_zY&lpigWBde=!e+g^@DuqYq|<^i*QHi+Xo*evIZ>ldONam@{&> z1GsNJulInau~08a+>tt+I%3_euw@CXL6)#P<}Aj-V#6sk~zyY*9SvzwoK3hpKfYwK_)7IQAOTcW`nK;3@)LVvES1tFRlR9v-3T zh1inF+&=mog}O)#81is3jZobh)w)iU+&|2QmS)?j*-$FzFKG)z|LRk_RPP5P%RxC)!Y{ z5Y<3!_=<-NedTHp15KPO=Le`)8R$Ohm9wqs8#o!7W;V}Zo)~2aM-oOV-?!S|1Bx?EnOI)jB~jGakMqmb3mIvtX-hM z=Z*rnZ)?SSKqf?giHhQIbp&oP5}uF0D`5wpOfu0NH9Ti!`}s$>-Vef?(c*v%$2}?o zm~zziJX##Ymi4u{#z*U|BLZzt69BFz(8aTE#loV1i$3F&(o&+l$Tx*R^rh~W;=3#P zXxnP-XJz%Vo`b6S*DrlZrv~O;ezNvWE^sq-(ZNil-`|3B^WS>)@8hclbjt>{?|sST z3h_9eJ-XN%t2y{D2smXy0vjbg+j-1%NfP&AY99Of-!7<4@r?8?X(Kh^uY!nu@~;|< zI8@Pp0rwBuKzIAM!Kvwvii_zIQG|7ytjNVBOxe8T_b2J{9tOCIT2yh4X*S;F$yB%i zE%MYu^6Dy1$!EP+YXhbmeDj*WY-@me-}bEU0r?ef??4>Wm>|^pcSNiHP9wgc{ZdP) zpLPSz%oYmaHSXI6IR<|+r|#~N0b0F3_BS0vC;4?$*QYLSWBMUW(GuY50Np0(E9h#T z47WLlK%mkP+S^h&NhID7O1C?9#{_MV)-KknMH}KpULe#l*JCkI7W>0;PHk954g>8u~!j$}x)<42iE^ zbTf(RmMFqewD6Ag#9;fL88?^Y0nPHH&UU?gQ<9YNv2ze*p+^GZ4}4uB4Z>EFTD{}n z*3>=V{=op~GP}>*B{GJmpj5?=J@v}Uus9rU9`4|FZn}L(OtY`M5sEg73iV_9+7rI` z?6he1OI+)`^gzs(kcatK+YeVb;Q81P=n8ZjLkygoG9{6)!_I3;z=1QJ2Y)zj#E6KO z!k7y!>1f*PHjDD%FDI65eX!o6yJQp5X(HktfS6h>IQ!5>51bEgd)D`W(o^eKmn#`s zuon8nT7E(+ipj*W!elrHTm)k^OW0{Rhc2-U|iD*3+8e}qa&N}dS_%ty^w7SDk%TS}au?@&l z=b)D#t`a1K@m$WUL-U2IWA=`vNi=-!#|7q0bEm{`{ZQV15PC# z0NzAIJc6|=_-W%~6wItYY@E+@&`)w+10MOg5A9JFp(RaHMAT4(q{0|zS5oepFfHOg zdwPt)t^n>^Pv$)!eN(K16^LzenmG)U#?LncXKTp`o2z?OK zAn~O525ffYc2v*A2AB;Hw@gd6BgA>q0q)!1ti1=6Q<%+5|Fv-Kdt%!!4K>vnqUG3! zBG@I0LC!JXK%EJ{eW6~g3UD9$C#@f;tv`13QOvy~WSk00e;tOgACHBO0$dBAo41OU z<=o)|W8xP=#CH})u*j~7!k@mqbl9KoK{)rfvaNhd=ubocDxu}cx9drDNAOAd!!PH5 zSy{DS+Go2NW&rNnoO=(5p4Ev@350s>GaB>h&Ylfzl~uQk28spd4ZSZy&#HLLn@)Kqltl3%6W3T^^oenDV9^Ls z`t=F;nY6QWGC2VsCwL9g;>XScjDtznK%+uHy*5A>ai<0jFD1NTVgx(#Da6At zpkofNKkM zC7r`DT(hDSxpIk6_)BcSHFTh?(F`>_|NChJJx6?TGG-@3QvQZB8bMvjwq4YUPyvSk z-%0)CbSv_H0r^> z+BD5Z`rNTR5Y6_djYCr6#l`{YyqMql1~YJ2c`b*%0q)ypSl$DQ^W!B+K{uLBSis^V z--$%m(Fmkxs5^kn4eg5b|?hmh+C?EQY-9W`s2ATmG$+^_HKo0z-X;=g9 z*Wd28-UBMH{04Et0a@u9aFULNfRDLH!}emcScbvY4zAQBFfDi^5#b$yx;&&h=%#g$ z5K@|}WLaIm=V5pp{FJon8ny+f_wB6w9*}JN%ivSLp54O9%ikYLa2V4UMoEyHoQQd2 znumWeDWry3+DZvN6gv?lE858yeh#@76gk_J+-d3$Fh+LDhO7a&PC&QC_0W5VN1|X6 zI*;QYudqsZbK@dMo5-*`Q_#%kb?Kn|@}l9>Hh%$vDc%k;pB9{rPqrILgbBiwiI_MM z6Koy;*BR*IBEs#Osa2FtP#&a)f_p5As8YCpFej8FVo^pVq(vQ$H_7?vJOVq3(i>CZ z$)*R^q1yy59ax|<6}!G>K>1-1;J&T#?*ScNtvnEsg}}!gtS^!M`|$@7=29i;rwL46 zPV-Pzi6pyP?r0IjU~d^0c6LcBD{f>D(;lkh;i*P$^6F7asc1OBbp^UBa^|o@WQF}Z z@F7s$lg_%%cy@oL?~UoBmdyBD^pYyL_ z&2YGdnpknUNkVW@MM(8iuP;IhP_H}CwNXp&eZZp5Rb^(7tz(gPy-)9#v3GHyKUKMj5!_KlPr(*e}9MK1$3=Q!aMB_ zgGg(+#nB|md6!83I<5<#hfSk{#Sd7EoZYoXx|7ssxqBxmg0AKK;o-w~eRCJYDy*k; zGx5Xzw!ihZ-pAo>4SEmgoW?Qf7+2(KZh2u7mCH@({@^g_$&WUyI_?{9*^$%g`RViY zh?NU;CP-ztTj?8bIq!KH)^<>pq8V~z)5Q)n!1V#TgQWH&cn8mM)V{g7-z@4E=CSkm zDv|@OwY%nPL`CQx$#|)jKI3|D&L2Lq5rQWwiU`ALt_;$pWL-D!~m_v^ku_w={K z=danAqzsF(*6__G6{Y*DS*0=itG802hwxZ^F|UYSdG><(PGUSIv3Yf6Gc^Uwd{<*E)j2^?^N!TNx94q>qIsq65f1nH9_RH8yO9q?(fwh{pJ8!`Pri8n~ zNF-+a_HrLJha5ab1RWG|PSod4Ss~|m>a287yGX`g#}GCf@ldo-I078s0H9kIL{ph@ zwGV=#f`lwRCK7Y0UTcl)#G$cq(AS{IwIkNpuAd-5&U@Y0@VKBfDFgG{OK`~}VJD|$ z{?0xB(Qyn=Zy?YGrz3w{5=HJI!|Kqk{JP6g=$1CWE&9vmpiTOpwr_mXcSg?#K_4Gv z{JuR$B*Ubu?u>c&ubnfgiMrjN)LWB*&!HfoTdjWO)6&ow7EM0HF2mDn34UE9$+nc`6-|s*-!fbkRr%{-N99vWSioAj|RdCr<4=8%wYX zXK?T^DM*Kl{k7Xsvq) z&VL>i&d8srI*Nz#d)OR?Y^K6Bzf@FL8Gn>*L%^@cB8yQqk2 zYOpch!TcUjZy3(P#igY07u|Y<%swe{) z#i)?IlTbfLjYe>x!ft@KW$1xE#7tOFmN{?d>AtvfJ0s-Re#+3cscjk*LO8rYXqO zr##z6)B_g*ZY0pPt_@BiRP4uQ&GydP4GYu{gpO9X8#P7)vB?qCd8tMh9-oUT(ik)q9@674)E168w_pFD6AWmhnfE`7r<`@z^U1eW_Rc%0 z^3v>)j+~d!MIHm(w;tVlKwj3OOUj6k;wGS#ufK_ zT3g!v>qXu?jMhjL+Tw0wuD!0tCMpKs<`(t3AF*&cTZJXr=2&Rhljcl`D;B_w1G+!8 ztto8#Tsbl!NG+}XT)uhMk|KZ(mQb92tjR4cTl+PK2+!48nCDh*JlcdfDoVDpT-9T_ zt0oEFn=(4tjluxjc%a)|5i167OeF(bTp3hJsf#x>Mq!0loR0RHS|a!?_#{dGbzumm zkk#|@<>$BPvX+fYftCJ(Kf|WX9UqUwDV<&bZUWGqq$%1z?yR9h|3dPw_@4oVC_gv(f=KnqG=9z)b|YEYu6* z15unvMBU(rlOimI{&u~{bukQb_+B=i;q}MSnD8;b`QeV|FM^v6GS|pd#!*0R&a0pF z(5>L+lnsM`pQ}g$x=>V6Kj5Z-e?z4eOT-xqId#d|=8N}(~9c&QBugUC^}sRuCF z)4jvj!-INt=A6YlpXVl=`1f3j^rL(+b^D)mi5{XN#~9U}b;s?IO1we()r9p|3hKr-x5+tBk(+WGn*F>R1&%`o(4Bt*+gza=LuK`lMm>tu4stB2%s9!c$=Srd_~I&t zV;LJquE?wM-#4`;qN<|I6N?%;%;cwg4lHPWQqjBp(G7Gnfo^XKKZ9G|2z5pOgJ_)W z?9u3@jK(p^=~y7njrU3$za35>C!-Z%)QWl+%5Bcv*9`9TRr2H1V@QmY$)yFmytm%V z`#59)-BkgE*u$LdShXEx2s=GR!BJKvigJ-|R)3A&)3~PPPwB~?<>6Wl^S{&(kchq} zoelQbKzbkjy^fO}HTF2&mIk=lK=;mT!MO+h-?+%}N?K@6PmGxB)??Hd@lK9zEA?%< zAI$2?>%G5};RxAO-;6GlowZA0AkZ-+#_j=!YtM38fUkNmXMpiPj zpqc11T*I*%M(NwZ_TzB!5^Jrfy0d6kPm0!|f%bJJeb;GNs*CH6URL>V5XVgIbYyd}S zr@6NnhBE2j>Inq}Ny70X;}kVm&+CCps|rK6u1Y3lBsM9_58&nj-IK4@|6JUI_( z7U%+<3i`^8K9M>{YBWb&E`nLp%NIr;5z^k7Xiu&blS!>mNUFzOb2CVEB3X3Qe`5G8 z1PyTWfi7GKh`svz&jENw3&V0MhQeX%@&>5&5$UM76P$&3K|QODFBa77>DG$7YXnPZ zkW327gCFRa_f|+4A2kg-ncjLu@2^_{(4|O&V@U(UQBn{vqt#8Cv>uj)Mqn9JfMuMZ zVE+EP6oqgjXn%dauohi|jk0wUuv9nz_XR#9!h^6sa2264fdt^b_0rx0%Ey$5b@oL~ zxrLqE|AHa&r8MUxGXPEkdWuIB&*;{1j(YY=CEQy{~ip zRb*LcF~BVXx|=^epsrohi>GAMIyEvB_~u{CGIB#BW}3k~0*47Ioze=~UPTZw#S9#K zye%d=3(>b%t-b6m(#)=Hi^#2rr2y{RzwsWB{va)L-PX6d3UhQO<3>!S2 zC&$pwpTx6*rV-Jan-$?OaA!R!e8wmQyTBdy^TPCBh&+Fh?@ zKH*6Kd>_B9#qR;tVv4M(C6T)191yf#Bz)_{C)7ZQ=zO+iQi;!E7W@0;#-&AXE8nxsJ9I0sw@s({c7@_T#F@jNl};;P^PY<3yt}> zd4_7Is{&&LrQ>CFdbKtmaB!=*)#n~9gm2mQa>8oyQ|0jX6ajQO32@7SZf9jPbme76 zT)(hQ6gBPLu>IetiF5g$58qMustBt^f;`+f>kTY& zIv)N*<>jB1ds@it&+vF!!uAlC#AKUsCQwY+yLbhNXx(R>q@H{u*8sN)=!#1!@MqOm z<#Y?8+(s^#Pt2o0e0kh-GbGDiI*)dTOlKmmu}#2XI2m|qSpjSF+L+~_;gh4AbWxk5 zN-w+R1fGYgf$nm(*7^+kF_cu}2u6x7!m(IZJi40mMdKziktxevwu5JK#}BoFj1Q5`bt1=1zfiJRA5ZJP zfc$~{A=IzD(xIX!S6IPFSBndq6ZI3otp~b=U1LV3Ck=3{wP+5PsZr!##4%=JF_6w< z<$jg>GeT;J{r6+lug4o^L+wf3FmF%-j#r&z4O{!RnX#YGCz!c)|k zJh(^XH7eIPO;~5gOfwSSa#k?eYc+jAZR-3z2z61k5VCbtnDj6Li6=cv6U*|!@t`S< zpcdEg5m4{jYxo|}j!xy|C7s34Q8CQwdKl4i-;CGR@1ZiW}KL5x=WNA{nGP)LVUegFS2Cw zi(M5X6Xsw5xXnN}uPx0&i#)I45Zk)|iHz&DQ!N5K+YGiC$GY)zV0@r6pRE@~w!z+p z<9@s@+6Rx9Z030hxhKmgpTQrvuPnMf0JjC`R#jWyCm8w)Lj?1P=;NAFHFN$6Hrb`o zXv{(&M)cbq%&3l4k6VFmjN2R| z!c2Zv+gGpDp@d+$fG_yR`&rOTAEa8+EeYmWJAa_k6bVK!2V7fb6WXc?fA)_L#_ddC z;WU*kfDR-9&a*b4JJ8rmoFZ%}ukyDE6pWvH;^_6)#4 z6~WH2olw=Uj2B}vLIk5bNR+1uF44OtV4t8J==yrb-UhMW^7#c}cM;DC-{~Nv<_Nve%WhK^D`)RnutF3Dkp_)xZl^r59=yeydc!f<@aa}){Njs@u zK^H;!unOEqbplA6jiwP?m!@#xeJ*{JrxDTBjelIv(na>= zcte|#0o=E_{2mak`3RHiBmRy?`zz9)$2<8-6Q)N9EVx_t@BNMW&(9r)G-axg{_XZ^ z+Bv$@D&9@7{MaLjzTWpGM3xK@)ic0zOE1vXCxHDclB))bRa_Ftbh@sKs&KDNe_5yXw*7m(OgotmN6Nu2oY&7~dxnn}_NRK)roHm*X5Gyc-+Q zl9yL)a>M?U8nL;}LlTwO0zFioY&b1K#zXi}ad21p-d^<8+40H;;^t{auL!VHY)f_M zOayau;C`|n=pKYCo*5+$VB@mYA=?m=PPRDImMKdHBbj7k^O}F3Hkm6i`cCS8g9L+^ z%hxF5EN|bQ`qF;QXO?XKr%u}}>lRS&0MJFGI6Da0EFGpl{VZ+la8c~lT9&H0OQx0n zGZMKj6AdF;*MyK2laCB#(y0Bi@2T+iQ|JgG(#AN0HKSqf0v3}cF3C9dK%TOCp@$%mrIuXM;}ocmfF{Is~-f>{6kQ;1~p`x zEKz9y?%SUAJs>@e#N0{SZquVEYivu=MF{ILdv%YiAE=O4=Ywi=`{)D_m_q{R2$_l- z;%TbuG8ISjWv*X7Vm@_Rp245bl)T+Fy{~6OK(|u@lD|PKUlo_3OvY7qBc z8J0FSG|lVs?vZJ{c)7k*$K;45T)BI?N}2LN>Ckej-|3tL?E)eF{2ss^2D+ftMwpaz z=3YLdAuwjFiaOoExHC_zPoe$v$1?|dhTZD{I_V4{ZLh`j8H9JB z*vIG2O|r;l+TcEGmQ0jH(IJkeUtKnUdf)Ck-vct5Yzj14`qB)BxaGvZ&LNp0{NMiL zzXK?rvR&|B%lJ#sq?+qDh%e`apzJ+RDivL*1;MY_MAc*=fDu0Yt0@#F>cY;5pd-Fd2B zH3r12l$)!1sr)dOfFhYw0k~5@mm%NyCuSm4Oy?Mp`G+fehcd(w)tH2xP7^1gIo?(4 zUfCavStFi;cx&@7i@rkPO|l_DM_v*|$p;Iyb?LP&z&_V+pzBa=**AZXssYb`A)|*X ztyt}Bc9CaG8r^{|XUk=5+{V*d{a|ng&clJzkRCL!;(c4|X#qnefwt!$v@%(a`nKnN zABSn6tK$}i5NpsmiQsbx*<)sTPE{7}Q(WJ#l49Wf^>!_KtyirBC390rn z2+2Sti&ys22{QIH6hnRW?f?Gn&H!D5hxB^k>k2v5p}N;()jyD;d5A}$_8=UFUGmdj z&2fiaF=i?jYQBQIX4Pzk#PXSnYkC(Y+c2D(;cZhRL{i}W#VpWmMw?yfSefW$HFQk5 z8eFaT$}}(=kjoM%mK|^SO<4kcQH5n==k@X6n`i5H3ZipSvk;$fmrdHJBVj~rC4o!e zId%@{;w71+PBLLzO({#>GTxe@_(%rbRzG z41|G9nb76*t~e$zpqf+LnlB$V!lhj#mEo~86;7LuNm&5yTkY=w1s1#%Hy~enYCqk} z4K9&(DRC7l7HR(!R$<4cB3orOKh@7gn+{Dje&&mJpw4VH=g!VJ&?u&LB9<7U?J>6x z2e=DBSE}e||6fNr?neLl@1_Bx`8#4CeB=nzz-){3H0Rx*GY<=QjcVXakvV8CR(>39 zF`?%vxkcxDTGl~^eka{Exdgaxui<+@9bs;vyDuALiP|UP5py4dsakzTQc9V`KA35T zO)#)2-g20rS~^8ywuRFLQ6kzmd_41?OLw2mLMY^;mZ-*i>m|R>v$wPTdq7oL)A{lv z4vR%JwblOl4nkyBr?p8^T3j-}X=n9I3mYuX6;eHNE)tMM-1-zaHUkfv_l<0lnx6vn zzS9WJpqK~8jN$bixt~m6DjOU(s{Fa4rx8o^7#>nFXPTAaqSoqJ5(jg& z%Oax1;yiWdZ93+h=efnYZk(|iX>6A1z`oH6(B0Q5!gtB15D+66YeA`YNQDL`bS9;k zLU7H*9ME%qdyl=3?;6mZzzRU7B4pf++7%z)38ccxmkpXfxYM^Lo^V{gOMglxx#9T` zx93pM6~@r&=?D!a6M@Eb|^X1KruaMywEv7m4dn!L$JQe-z~p%n-BO;B7D zmvbP2L%?4{aeni>|IO1bHE1B)n&!v zyjm%G4kypMVe@25)Dj-$n*Bh&#}{ShNAF0T-dN2 z_!?dz=O>SA;Qs9G-*^v5?BV0{h%aL2usTOmn?6+kmwaK>afz?3LRaX_MBVKq4tFZz zF}F)=fTNQcN{fY8E0KX6G)$=mf?sN&2Y#peS*tdmEO=%AM=`+ps(j_uHw z{YqR)CNfA^yaYu8V1IoF=&FoI*1BwAgm1%EQ8zTa@-{1Kfrq$~66RJlnK0`4bwfo}DXB|2v;TA0`(6r0PxRhh$! z0WvxdXY@Y>hRg|UA_*ccgwF?z+jg~odqcdiV5`0n7fcx%`#-r{(OqOD9l-r(z0cpb zz0Z3c<7PMNmQ#KRd^jtpq`ow_3?&8P-Ul8(cxq&uUZg8-%M319crEm|=s= z;C8*7qQ*LH&SU?abVXc`0Pa4})w74~Kq2~c2ys}5Fj&DTOpjUTbrLb}_Jv?>MO$6g zfc;vp@sBK_Z8rf%;RcP+qV`y4T67-M7Z?T1APo9SM1cEtC;1-GmnFdvByuYyLc6#m zXMdOU&-Txt&?z|O?@qj{V$k0V=Bg7{!7jjNH+VDddB?wc59Sx2!B=_5eE&MNjNk+* z3~&#DuJA9cQwcxIZ=-y^HZEF5%yB%-{9^~b3u@dOrDu&tqVQNnBC7EBq(jasgr{8#?Hm;=X%S-ky>TMo{^9Me{ym^Y!j?*Cb%Dx# zd}zOVgg&d!le&*%D_)p6m?H;nwC-io6GjDnvVj{U1_ zr~IG+H%VLG?rz@a?-|gw^Le2m z%zKg4-0LmUoKu8wuk0+3wVqcWEtPT|xsLx@1)B>}hJ>dJ%E(pWAe!I*?>8c&I}urs z&y9aTsTrJ-0Nit+Thjx#TzBn{HXU@}fuGF?2DubUUgsb4P+6|gN}sV{%Z+8JTsWzR zLBF6uvL%2$Zim=?W`-ARG3Aur375!r191NWU7{uudw+CBJ8e>8&Sh$;UCi_!_e3^O za0d$g`$y|DOcqC>Pkn+`j{{Xqr67_2?sezSC6x7US$exM7a%psVnAQ4lei3f_x?>66HCBX#>w6n0BZNxAS}s|G(b_zXrPH zxa7iXWzi^mMuRxa4A?ZdcjAQ17!UgWge>vv!oDBR3%!-B6v`pYH5L*5a$9XAWzI%} zYznSzBMNsk&Y2?tlIT_k1ah!}`VtXelGP0^cC7Flf67)hpSz zF@1OMfbMX#LIIb)>UXXurXERpK?+n!8Fih-sb8y-N00r^DqF@%$A1=5E$laa>Vo7A z*wVpICdRg^MyYFq_=}*Wrh)s(w>y&efLx#$eyn1Bb&g6o+Y>CthJbeHkZ3a(Ez{Hd z)Fr#L(N3mJP!D4C8is62CbdvTXvZT{BeN%^*ktX&drw~M<-p|6)%+DEI zJ1cLWA$T8$w;uj`K!cA*ID<|x`+v;-MjL3;$-_F?F2x{a8wfy`uoa0Q&Vr=KvlD35MAse zPfPG5W9rm$+#^r?o^@0&)o`!_10vW#K&wg~QJ0lF8m8!b5V*C;rwIJ<_TGJWpMmZ~ z6OqKtChm6uw?~?4LwKIXI6{d$Pz-JK{9p;#OizlZ49DessrHd{;8ZV0eda?5k)K6T zCqKOE(FMyU+-e1!+yX|}|C+0M#d zsy`#2MKK~ADGFI!OKSWoQq&Va5qb>6N*f0OsP_fv2CMQNbZbdM&6c;=#Pis$C=0`p zv%K&(-hSf5yuE(d}T88j{o$7VfjadW}0uWgAjP^}U>1V;5#oUkch4z>340$%$Ak~MF2#QfJ4~8HZ5^mF^B${7Fnnc0l45m*K$ThIks2b!|%fn zO!T}$Fyu676%$sMz~3oY=cSHpDsIeaTSJCgUMnCmEnbLhPiC6=iN(Nb{r}#HGZXWS zRsa_Q=z{;95jH4{SL)?#x4{d1B9e&g%PyF|oe}1x_d$OwO1F5P_`r!#_Q=_zh`y)s zLhY`}iEE749_GH863}RwrT}mufo`nRG)W3ym+dEXOAr68oa>>BUExC?H}V;frP0cl z_KJiC`&48x(be3k83(HZX-+?h#?Cq^8FfC`#3gxDF5o!}1at@2N_d3XZWa(x(6zzl z(T4bmlGO(2o0Ef2Ap46n_K?ao|9z2t0G9zv?OIDha#5M9`Dbze+?Z~)6EqYuBn0e7 zK>=No^FRi^Q6V7;mR6^vawTw5R^jP&Q%QDZRr}vQ*!v}vpY%u=f`yCu}m>0dlQP^+d7Q)FvA3CHIQPIxqy0M zfo^i;dWX|$xWREUa)c%xZOqXtqF4^+a!vGhmEgxzf4l=7mRHglb_8Ku-yix+DKLzw z{lr(TdGTmat<@*O`@r=K4(NWrqFKO$n$9m++vn1-0i!pVUYs`;$~$(|yQnZd2McFD zD^3<2Pl7Z&gZ03mRj^L3oa>fFV5{uIzzg)cNNohv3lDTpXB{_qv3pl~DsC5jv}?2P zF6i|?x+G1;6BIRYe9zGiI?`~80yi+^(Iinsv#-TLZv6puOJKIDUZSIvPtqX)a1ns6 zOV}n6Ar)mHakjYifn`yU78RI@6%*G)TiVKX?+a?CcxSsOahqPt@sWB?6<^=T>%TSR z)@@Uc2n2REJY7;{W6`w0%)gCT*n&*Zr)73mv+6`l~^D-r^h zp|}1VcycT)rZQlBQGhOPAU6zlY>nv3t>sG7;SgEM<0=X3#B(agPw?k3mErYBXe4gS z3-My9P!H+gVGHynYi+mkBkPetb@hlf+v{3@iwbn?hnD#Sk<@sX>!iVY*O#iCDRct6bdwt{J~Hud8?3i0Bnf^KL_rC7qvFO7{`SOq3w3Xk%Thj@vp8pB0Z?a2{wVdQJ4z>o<~%bBk(cB4S`1 z-p0vXp#CKAcE)^vUZ4Zr@@n3(h$*!Qt+syE|F5W>G?^kAEk<>6uyKZ!8IJfbJho-3%k?HEz}t714nHL4+7hP9Eh^> zQNfc!vyL`WnBa0Ijv6UJ{_FAb_0zJnBkF|58pY=(H*b1}&b-OLo5Vd86o7g$fbNiK z@-E&>Eo3g8NaZC?ALWVas^f1#^W6@9ieS~$DHc1Ij+ySF)a9J8v2U8mYHS?>#`{A$ z>n*DoPqYfEtPcV?v-<*_wV1iTnGDLmc`Wa#Qr_9VT{t^C8Y%sp|H5*ksd`60oC#trg<*v=}g#YIm|^sF8! zuQ_9DwgGh~z{LT&oA84W9eBE6L0ImM<$g!hHFtl!1DSRloZ!YISxh8th}cms;L7*K zC3=;4SW65Vx$mPWZ{@KcVoPJ~&lm!L=Kx%w`>pJ!Jca7S#XlPSEyojGD0cD<7-=bj zPvoRxSr2Oyu|EXto`lVoFN{!UBv`Tjz&xc_>aWutmreq1 zxX@!f|F7La(fa#8%^h3HZ`=|#D6|UzE&cSYDJ~+W7rF^ z(-sO?P5x**KW-UAnZnjx%+CXiFF$o~wKSz%U$wBZasBM@Wc(fnrJ@iI1=*H(6C$86 z8_D8;>jM$cHMrD|g6z{Lh}A~9eqtMkvMt0>rZ6ao0YAOX5}M?!xp)YhH^ z{<@h>{;f(>^y;&+ZOa9}3(&$ES}n(*P5@88kyO)JqC<74DS~zLZt7k5M;pE7Bt>Oen9&99dxY;r@fN7`)$(jvZVc>D46d*l&0| zPP1o+FqKzoUT8iaR~2b+n;E-;0k~v9cZ0987*6p|h(;OH1mF4ubwiMLg&l z4;2by{{XX7+2(cecY5KMTKyrY(%&)cB^Drf#^53?l|mzVfo-M_lw?}39_-5l2vHuI%#-CEcR33t&}Y1;5Z}BgMExN+iz)tBL~pi zUC8@$lM3i|33oLAq37*5(Eag*JtIe2L%zgw(~AjeBH{jeu<0p$vR~kHA3N2?rXyf? zwQ2gGjt{ZCt*tKCQLri2rAD)>$s4zv2gxxfJ*~(#f!T-sQ9=-A-{f- zr1P;oi}0b@DDhm1HBcMdkk&t$Sex`vPdqqA=Kjla(CUzr^!?8M(Fh(Tgv8m{aVL=) z*!QFbx&tWzY8v)-f%J&DABVG>e_|&a)%_+?K{~gZJi#_w*+p(6)%t*AO(;gyV!5|` zGm!}4Bq6-cAM0^wy7)uvH4#uR9nh^EpI^@3GzD8;NtG8jD{yGraSuBm6!5zY(Y{+W zKFMwn!jCb#5=>Y@O=4D_%PjU(JVrK|-O6NdqT+H(mIdzn=z;DYjJUNn)&0{aWA2J8 z=cW&7r4e11uYG*(OwKGAi{8tzT;JP{sJSI~V%X2vNo-|u{te*Z-g1Z~gM* zhSy1sj`02Qd03??)(rO+*hgdpx)gti^-1EwQHi!oX2~?GnCwnw2${K>nR`iV`)=_4 zVy%`XQK2}k@_wDu`-};|D+!)KrU4$j!NBHeqY$zOmf$nOi0d-`(o8@o2Jq(z`(aGklz}cR3zE z2ei$l!X@5$5?6oA9EQ^xiwSU9fbMb%`q^vSOl{Qx&*$9eN_a8mnje}ZpEvy1eH_n? zCz&@wm)gD)KfB6aXk8{}ab_-;pO8Dy!#U}0k%Awd69M<@tUz~=y0wh^)%!cgOvsi5 z_!m#vol<431LRF^_B6M1K1>bpk{dUfxvG5L=Vfe5#u1&ky>y>%UnbzRzl47+<~aq9 z!zZ9iFfg)e*2ABy*m66D@8^Di;><5o6|`;#qI^)8Oak+)hA3ZQWNNf8V~iUyQwpOW zYgTrU+xYq!VB|Mf9xB`R~GqBJB@Qz64I1+L(%P9_NQoTk># z`yS`RIO60C0ghMr;bnUs?!-b3y$=LM7TN$8pQi;)48Uavy6r{lR#2K&WSLSsal65v zCMnKqSkzT4125!NFn3R_$wx7zvrnu80e z*x3~SqVLN5CGLcMxpQa0;0-wneK~te^?+lE5363zH@Ly05`8z-Fc$GVadO<984-sM z*1Wf2Op#Rzxj`x9K028(Wca!c86)$(c#?EDW>0LXerM)sn!TM>!SZ5NtrxQ=6z@8+US=N@7IGtJnTIDs zR)6zzp{*-2Y9^M=vEjgMu?Vq1(~mNT?rr)<`0HM0zy*5Js2;ZL?5-lW<*;pvhZ z-xY10e|^@?`||DDTc_RhF4ebhRMl1XL$#E0^IUIH|Ca^%Chi&%>#c3I&%e{E-_+v` zk7`Y*v+&)`lZ<+71fV_*jIghi6YrvzEzLTKDdjY+q`Mb^OscUTU#mj zvGKy!b@T2m>)!f(=&b!&kN01`VqRQ@fbYhf%J8hi)q^9N^&Z>vUDvBs-bGdY;qKf5 zKaYM@ruo@0v&wewZYn@-a7I|^I+^*R;H*`GHhkMm>9@UpG zXV}-gVxRMOw;X@<%d8NE+`3A+O@CW7;Oncg3v13;UL)quDjRZ5Y21I(Hy0BwUud~% zQKq3CchzX_HM`owua2IcdE~bC!~JSqeq5|N(D>EWSq9aeDR*d(Mb@{TQtsw#nOC=} zTc&d3cZJ*yE!7umd?@hitVwS_5ApApCGg~~qjA6fdTQJnztyXTGoHn?8Mti*XI9}KkDxe=X*xaY39H3 z#IPf4s*SyM6h=t4Lqnz9EXL1DM}6PxxWDP$v(fW%p>Xf}+lF+H zu3jR#QSH&y>U`(5r)S|sh5sx&ZFHG22cNlZ99Ap-@HatmC$mQVQmtjik&`w)w4BUR zr$p(&huh7EzOFx)1zZ+zS-_D6$mLix77N9pt7jCub;RPLrNaVbXS2y*h>cOH!V0QX zc~z>Ubck`WII#fPImWEBTJ<{f`VuOYyUWf_EaoD+Ea0+$%L4yh79c;a(VEOgT8KtvWDNiG6s#G~qCn@X$?lGiGDp1Qct|Qxg z${*R!qKl5xnN_O34OOb#+@?_$lQ96a^$5#>uuqZspNLD#Ej5~`RE7QvbY=C_qO)kB z)9z;feZG_QE7Ve@$^~0#4SF`^WMQpTs=|t}|3o>u(sWrswt&=*)QOsCgQ{0ol`7AF zLEDyfb6s5)aAX0hyQ%wCNAdrcXq2~AI%!<+1Fo($p8uuNbLsk@umH6gv(92N#OYKX zeWkg}e?kvenl1}CvH%-%*_mUv7$DWzPPpcGjl-A;$yPdxL2ty0M71Po?(E36|LZj7 z!}QT+O}I)GsyF_h->PJ7!Qz^K{IA#B{~z_Ix@*;$EwrxJdD8#J8s7hp<>bn9`Yk|p z{KHadTw+)u)p5yZ|M#xFra!kXPL~B-7I0a>Wr2U%0~{hS-@ohmjzrF za9O}*0ha|_7I0a>WdWB3To!Oyz-0lK1zZ+zS-@ohmjzrFa9O}*0ha|_7I0a>WdWB3 zTo!Oyz-0lK1zZ+zS-@ohmjzrFa9O}*0ha|_7I0a>WdWB3To!Oyz-0lK1zZ+zS-@oh zmjzrFa9O}*0ha|_7I0a>WdWB3To!Oyz-0lK1zZ+zS-@ohmjzrFa9O}*0ha|_7I0a> zWdWB3To!Oyz-0lK1zZ+zS-@ohmjzrFa9O}*0ha|_7I0a>WdWB3To!Oyz-0lK1zZ+z zS-@ohmjzrFa9O}*0ha|_7I0a>WdWB3Y!-M@hkk2SrE+f|U31j3n6;jIqs6K*7(5Lo zZJ%(xLFd`QtkZ>f_T@2J1<&ijOYGHnSXSKs!qZjr zuxtoB#lt)ihW}OB0V_|}o5!P!MDQ>l9+nefxp|l`56gwHygba0hvi0C1)hdK56gqF ziaacUhvh|BWgZsD!`u<}IS&isVfhfI=3&7+EI-1$cvy9W;eS;DARiB_$>SA7*a?9C zYVoi_xWB+cRI1uMtT3LZ17zC}gi)4?0I#{cdOTiHgq=Yc*|9zkD~9`XJd7$1u@nco za=SF-VV@z4Dj4bBh=-NH{bYdt8uPG{xGxAHl%FO%tQ78F1N7IFhn2?tY=Crc#=|^t zKZl1k=V4{=T$w5o{#x*`vbZmVG$=nUd007qkBh1m4=ay*ibp!N=3y0ZKOdm<+wic8 zxG#cuWpQoG!z%GGlF^Qb)#WW~G$o3^9JONod_&NH>^CJA2Vz~p_H~{H_tE`alDqA0)_xXfnh*Dpg#}^=z%Dp4`2YI0V7}nVt~GY z8L$9WAQp%N;(-Jp5ukpfBhU%(0ek`SLF99&J(EwNHtYeE0m=g8^T;QVPn!;XX8_;e zp8A`3+>Zw)07HRcz;Hkh^Z_0q&Qp}@ZQv$w4EPb)2P_Ag07ZaBu*(`?EwB#Q0IUMO z116#jzXm1&)A9T@FbS9pOaay*jrG7@q_+<^2pj?q1IK_5;8P*qD_ma#Zvg58j{_$F z>iej#ivxxM!-2lQSYQ+|8ZZI9A*K(mzasu1Tn7U~fliQD9QX_<0VEQY{20Xvv zdK)MOStS7j!g>L{fu2BTpbO9y_zWlklmtovr2!A13{Vi*4*uQ1kHA6T5YPoE3rq#3 z0rP;xz&Kz$&YAT#vI2vBGJ06G|9BMs0Es05S)$^*rK;=p~12RsCh1E+v9 zz&YR&a1F={tOq&(J0Y_Tt~7LT2l4^=fxLF1K~7A zq%mOvo}+;ckl7VjLb8EypeE=G!9!#CIslFNvH{N!HXE1&%mv&)qcPY8;7iD&aorMx zQ`q0Q&IjfJYUn~^FdC=P^*e+W#g(vyjE28Oy``(OaTocEd*HhTTn5N*4gsi7*biDy zfZ9I!0m^$5fa*JM(moL0};dKZA=b_O~D9f1x2wcqvt`Q)}h8=y7N3TO$m0I2>p1DXQefo{Mg zfc(H1AQ2c0j0dRg^a5x`o0_ggcyB-hgaSi=(ZDExWF!D_Kwm%ygaMI2I1mNs`EvxW zM!*2{0ippD5Cg;lR=^BcfOvq?A^ipd6y6``2MplXLAWLX!-1i|Fkl2Q5+J*i{Yb`F z{9ev4>8s2?~ppSP1+G>;ZNI6mKW69oP)41=awofbW5oz#`x~ zU@9;lm@umUa07RP&%;MKMxXx2NlRgUox~>40151F#z%pPd zKxwSzSE6qMHUR5@^}t488?Y7F0{j3_Ugrapk6plCfOMn3F>cbhgY0#HhabZAC*UA( z82A}D0vrX70lxs9z&8X}sy9>~WPhqZUm#qzJ(Y_E&jz3y5C+g(jplFEXPyGRGpsH0(8I)-~sSEa2L1^Tm!BE zq{jt-%KSWV4mb;31|on6`*?xr#N(fhhKlg^(OEua0|H2pXr|BQTq3R zdjO?Fx{%I9ll7wO3*b5M2zUsPZhrvJfTzHpz+>PE5D8E`Iqg@tCz=1Q>ky_JDP20`$ZE5P-^r(w6f< z>68B;TPf+OeFx=}WVHv{0o0b;05nIC{R5@b5+K{R0B8(;6Y|MlP&*?3N3_)CM81Q< zTLD86ho0L4B#K1IoNo z|3q>7AY8Tym1`KDLjm%0m2jo}QaSg=mDab$;l3B3%)18R#CsDUxg<}^S3c$W1hU1dFE5N-sb z0Xgq-zU4fbK%=tCiYwXFjH}XS)W?iQ80kL**HO3*z*X74iJy3*MSju9u5oxC`<;?Mj?#)GdVu> z10;jucLIjsc>=Da({X_G`U=k$-~jH)UStQ-QI0V>~%|LD3uf_Eka1HrXu?mf|UIEX6Mj6mo0kkbqAE*b^1u`P8 z8{m)oY5?ug(Hx!jhExdufQx8smj`iZd`IgwwC6;7QM86b`&qP}L;GK}SLO@&0N#KX z;0e$^9jyn@{$C}aB2WP+50nFFZK(|40nj>yypBa{k+ddBYm>zQS_`2y5n3B51QY}c z0J(u&KsF#NkOjyD(7H_qfYusRzz5{gyi} zqjIG1hqw|C-IM+4S>~s5Am2mvisoY~%x48cscmuowUI5R5m%v}ZYk=aA zJf)n}_i{R-Yi8u1Xe8$fm!*uG9dwdOVL5Q0Q}ImUq&KZwQ9V%dQJzU2tyxhVTEC)o ztkmhr>B@9j2FaA~#~|2a&_xD(-2HB8SUYxg1FD@0>2% zgPv(lAjiF@h@*^8_i`L+FY>*7rFKO3a@`^MGEJE;YJYOLe67mEWP4Fs)K+D>d{yQ{ z6h?iVtSil#QdXZ7Ay^UnwoRzt9^I@z?2=bj?w#n{Qx`*kBxS2u$9W^+|EWfvwHu z#E@g->r$7#PMW(Vn_JHyPhWq}>TDG*A1M8g25%hk;?a4T63o`lihz=_#)fsZqQ1EX zif@3Yw`Z`bE>iytl$twBe>cIebsbQA0z7>^{n*-6AyD!Tn|8$~+wc;gczgPL`b(=r zIY6mWb8(l7-Cs;0Y1KUgLDE?adZQISr9)ExHSWt^ffDQ)5aj8tiqcsSj*;nvMa|E) znd)WZ>4(t5kXH3(sU{`8=Pb2RqWZ?_%!%;MIU2ild%ij&D1M$no<7nVPyz5nTjG3; zKG$x7;^XP#hje1hI;&N$GhgZH-G2S&TgNjVKV(N`HW>`DF_m)>))zLV6@@w(TmtS|d%e3|kAPuO8B^&tFdi-F> z?~9sdpi=OmbZCvHC@63H?+VS@tK=k5d_8>vp&O0RD5q|jr);Q@`~BabfCB`!o{$|B z>mR`zwjc8TlJR(Z`uMQfI#F7;aQA)n)8q!A_`}pber%pklv2a|-~2uyaRZYU=;;j>+tqsbR~74@j6$WVvg(bA(ORAA-SnlSPq*rM1{BmC$`AE$xxo|J^OusfT4f1k zJia8&qBH2UD7%9#3k>m0>e614MilBjbAhLy_WrC)?WV_o;)_a!{DgrgLSxk(TUk%H zvDd@3p!mT$;MtQAEf_qj_dWe-bA`?Up!kCal;fbdgQ977dG@VKgX*w!0?4A*L81Jt zE3|D;KX?j) z=lx2}i)@X`)a24&otc@Xy3;dv*@|rrY^C}JdlHXW193WHX;E3FGA&-HLcSs8zBuac z<`d*GV1S2Du-0O+CdTMg)&H{Q%9%KY>NV;vmE2nJkl)!k?s?;aj}w2&;8qnio&FNC zNtESnN}ilO`P6o%H8lm*7*O(q=VI3JcRP<7zYG+}@(glBi7=Q#H3p2J*4Ha`aZumV z;PIE*Pplci_**?_>7+ILKC8y0`H-<=VvUJfQ<$zwNa&cLJehki4Nwl4^RYIMv0B2g z@aQ?uj)8)9MV`+CMNRcOci~rGJ{fmoAmj1&3`EI+LT#>2&!=&38qE8iQ=oM$r&MTF zX8!&QGBU}j0GhRD2)>9&)mMZQEoz}6 zq|KUfqm=arZEzz=vSu3kuc5tg|N_EjR4W0!~58iqu$4 z@kXrC)ES$7O!FHjK;bP|oX$d+hDxsJy#6!BFYDmTrJ+p4HV{h_TW1r}DS&jI{4o0K z8QE?JvvioRDhvZqD>++Y&y_DW?x%JN?@t!}XElg0#e`9BhIN^3hPV6(!@CxYkdlpjp}t?w{Dv!sT<{j*05)FY9(fq zR)UeF-;I;>jo$B*1xKd5@YyJDGE)}bVKpOdY)R5btQ0@Kv>_YR&KI^+@a68X=H0YQ# zR&C^~*w@25KA5~IgWDkPuS3lm=!Tx7;Ds#P_T5FR2Zi~aCGJwao;z}TgJtjXECB_5 zGqr_vppYgF^R8WL9e?60P>@s7KyOi#8&Sm%55MEtCKmnAAkqzGx|{P1$kJn0?Qx5Z zJRR_ub(*j+y*Z|A>2HgbEZcr8qcATPZqdc*j8@B*uZI>H@o4n5Oq7lvX;3?#WP^^q zAAWfAwdOBoYgT*TfP#jflw;1#OT)AN>L--~X)qkk3dE$aahp5ougrbKD9mnYwPqFt zPdhXbl2-fKo^?mu10umg;}B531%+&osf%xiV_8-l0ELEppxgt6%BQMV)3>j>6@1Eg zSUPEKz^Ncpns&sX9v)ndHGl-%xoxX49uo}B}XJ$2#wVzI)P_4>#YTfLt zA)Zu6QKzWJM_J%2Q0gm(+}%9sTm+5ms7TT1EXWMiw^xgIzU=4QunkeFV<7LX8o(+2 z280AJc+)wfjWPlh>a(8qE%kQ5`r^waN+5dYuQ_Fs*O%ifZmM0~Hrkj43i-Dd1^4B+ zShljkromEBsAU=4PPSOS@ZKO>I$Jnp)L%`1tXMCe`9w)Kt;QIqf!}!-uzb((s+p@4 zByWipgb^`#{vG+rgQ`nfCw1AGx(IiQfYgw{tuA&WMBxN%|k`%BShk>d+SiD@I@;Bh_v>k#jjg}Yw>5BJv= zgT@jG${%yG7p$Ti|BFppPY=oOJc!;utIOSXKXV>`tZ&0Q_De1jJVXg@e&mtwtl|lb z#}^Y5xT3`18S{my=7vd9-6J&W|pILf|=p$XidEgq+RCe%t`1U-eur`*5F~Q1b(Ut6{M0Y zJtxBr|NI;8f`Y0`^KCo%;p0(p9Toe7=M^P?@NGb=8;62(vw0)D4$=|pMn{oorDS0K zTE3fqFr2p8tq3UON2f2T`p3&V;SVT3Jg1=0EcD%+puyF?@cP{5k<#*1RY`v%Dodl= z759=X!PmX^*?5Xpk+jZks`bgT9h!){_}k=3O7wySo(t$}Sk zv)Sq!#;Rtn!hxc=Uesmo-zffmKVX?g7(01A1_e&!8_>t9@qRS)Wesbd()Dfx;W__pYY;B!Qgx|y#*As=se*(0-l zNMa^X$j77CoCOMvUAFf)HuvQ0?`R!~r?Zq(2DEx;{3h$`D~!TMTpK{i4W9E}Ne@ST zar-w=csosseOVbyef-?QUDSc~vF|$Ug?{|X2wRZQE`rt)XuZ@juR;4*8 zT(`2E@~!Sn#bXmzD=g{{3I@eVBOCAOKg!QQ{VCV287Lm0d~>sYyW>rZ-vWgUO0`Nj zN)y{a?92>MYC(Y;$)qh$5LFEY5Hfv`U@Pc(0Hi#F~*yXpMIrWxF5;)*J& zDu;il6nfYAJIky&*6E;dY3WJFZabx>t$Gcyq;;7c1@E@GQ)fPGO*jK#oo zIlZW>_Ic5V&>H1~p@W~j^*728EVCU3r_s~gKy90K`y;H3hpqSS2Zc)E?fK>z8g=+( zG$=@)bZY_A<^ko;Clz)t@C&3C%%yb&B{wJw)_utFcfWHjm^4 zKmP_sHRzpLPU9evr1hyib#&j;R}MlNZRNmjI!mloZ?LEms^0i)z@Gh(#{2=wRA-4X z>!UTQeN(os($vd@**j~&D4!%Q?YD>9itq7whZ*u9Y9^qFy}#JIh<#$(egWzDQD2e} zZNRY4Y>B(HYhc;U3o0|MS$?8%D1mYsX<7Z@P2QDy%+1K}K(}~M$T}wi3U=sv<$2bE zZXvbFjrp=2D7Dt0f2un+-E&ptStL!G>Fwpxy0o4!PW^N;t(0(zxZnO6JXA-k^jLJL zX7}Euz{C5Jr=U|P$BE+cn|OYDG(@U9CClC{w*142KRRKfJOqVGyGHm5%alqzqd=h=f_nXmQ)*Qm+52#t;$v+* znd(S9`pWMox<~dtWuv%r%88QCwW@{L6K#|dpimvX-gVuV*H&Fnw1q01vg*i{qQCEH zrI>FAa!T;u%NKP^G!C{&8w4AWw6t^d2H>IA*fwY9xGRf2#@Kk;fkHm<=%h^9&sS%A zEZjQ1IVFdCpto0!VKm<16ceX3{3d+M_ldH z{zw{e@%&hH(Q!I6#!1a?cgj7vJo%6yjH1zF&Z{f+r{$tw_ZnHRc~2XUxRs#PSRIwm z5-@2Ps|GrlXNhN1%b)?(-ogd$w5&Y3>0Ty{?Y(aVg=&a({=5Zq=g+~)0_BI5oQJ6H zi0i>#NTa$_$bH@ReiMxt31PIsdfF49xP$T_s{hFBH3H``4Y0$FT3A}DA!*mrZh(jC z!MWfDrs2)UBuTnqu&R2>DGOeo**f>~M&{q77M!V`wEy$6<;2H6zmO(3*A?Ipqi_SYS!I zU%CC>`H9aa*eFjx!IDVQ3ElJglkY!!Yoiotz~1Ld`t0=d&|1r;Ds-z43Q4;j@chZ^ zeB~e8cp^c;Qc}{+uV$1QaCV!*2B~YWJL$&ypZ(yWnS?5Q*Zx1gX8GZL)>xQ^JVlCC zL$=Omx9-p>8P!EdBfI$z7(e~#fc3NvixQ>t6mLMG((c-C(aslzuC2CFiZzrxUz1yg zMpgIzK)np(@m5s=h1x>i28}Q0t^EhBzj2B`C{(ZOx9QlX)%Yp9Y?KC^Qv6l)AIn>m zrLiT~z;2sky0r%n)$0ep&z$*%*S?nEL9b2ycG}qodKuQ&N9c?+idFS4-X>^vr<@pH zhjDGAEG8qC98@*Tp*?FCT^Y}$u@xCR9tjPb`mA-0q}p5Iz>+U2eHKNtU1;r(^*0Br zpx_~`>lIw7FTSQzf1B3nDLIj?{ZwLGi!Ex`ZY-zL$pnkabJrHn`o5K^52oEy7+WOG zQ9TgnR3r_fTZ_)3Mfp5v-#p~OZ|$jV({2SyLB!*&I@Uy5>zq~Shx^4x?C1j?8hN9b ze*=Yjz{Ec{UASCl#~@De4N$dgD)IDgrp;M)Ovg*0&^|3{l@=88Rj>2u`n>l)Mtv}O zWgmZ4STm_L-h6*-b!GqDlD}r78c{m_LTQdHDlXIM&84;5o)@2Zww_;{#v!aG2B|iJ zLRy;!O=)y-X;qq0a*DW)id&=DBiSzn+F!6QjVS5ix!po)KR=Zy@P5v{yhWw_kgs|P zN-5;@!AjlYxu@oBmU9}cD%4Wyw@uTJ=N&Y<<+q?<)JYY)3@9{5f3kmI%2Us|SYRP%|tIpGn{Sj4lB^o;$* z>7+;6v`*4k>`d(!t9&y&qt?i0A7W`@4aDmdF?usrP%Ns!j~*n}YF?OTAG9h3FD9OW z^~88I2YJ3U`{=1lPVyn?otueg;^O(~=FZYsId_HKwHluE(((LYE+ZaW9t01KyeH1~ zxcW9J;A`+;&5(KwL0=C~eg!%L*na`S^IMf6@viM_5FYjT} z*cf&#C^Swyai_=1SADmw2ZgUN{Rm1CP%_>NYPCppk5)Zs#SEoj*TXVt7r{fLfTb~o zF8`Hhpc{CQK55XntJDjO$~?L9<(ii-GihwhXLtRLY25}q?vR#La!S!Ak89HipLBz? zD2qB#6KzmUxHvZN>xJKE00pv0oOqoNC+yf}SBAWg&UX6o8uk~MZb8DeTcmRp8c?m8 z(rKw%)5UH(_!==vPS9_I$9{dIA->&FGG+&XcFOM`BDW2DZkw_5VeykDf~^)nH+eHpv?VQry7 z4`~#T`R=qpZ>WJ63)}XjUw*x=l-!!OK%f2>>ShskyCMG5kZ&S{`_)Db$aerg4 zfHHwUF(pGUNdvFE*+NTC+HfD~P#r~na&yYA_WFGp-k+uxOyf6Ll+Jn$w$%2Wt-L@qFo7hrP(PUbAmOvksL!EAfXm2QJnC~GPLWwLT5Kf`;An8hH0c$vVO_-j;6L*X_cDqXT1Z3 zM#gJ&U$W6k0bB=TzJW|Fdg$x&)mTimL{8 z?OL+;^C=~eAHI`fXNLnWnOePA>nWIQ)9Sw0(vUrOMucK6Bl~!hQD?>GovL$LXWx?J2edu{X?))-7!>pXNsGUk`!KUd?|Mu(W`jnc z6aXcruBbst^gDa-EnXWQ4JSsQr@5rs*c3;#-MTy+awpI&2k zHnJPHL42fMOJ@y_Mo)OTu+7uPoPw&Tx1j7mSyrv{r7!Z|KX2pd8!l;`<6h^Ib>@$w zlYU$S?4Rnj>Tu(l9u3Ro{B}0^H$J8idl&Jp$USWElMP}Il?|MGe}vS_u$-nn;U(uM zJtIhQeG_Xf_7vjwBi^4A^vWCe0)^`FNS(8p6TuFBlTH*i=MbMe%d7!G@xMsMgiisofV@4>gT?6n|-k4ZqS#xCM;n7Yq*kAH7h9~G4hJKw zct?5J-udS`cdGs+bVF`vKKIXha`CwUv9A*QkbBY6IAm}BnlE~_ocuG>+Lv6?KkNO) z=V8UxS&E{jvE`OY1FqMfA5XIn?p?%XD((RzQKmF{N_#p(e4b)0G$8L^xMi-#8+Y}m z9RWTo5byDeS69USf_RRx6B)r zH(bOuL_Bg3_cDmSm2 zK3;NS>xfTUh)Y}S55#MOW}U@kh|{Sm`z${G+3&G0S;?_i-o$M|Y&Y>)9C1yIiIGO$ z%S`9CpX{64gRCRfoxz~cIONRP1>cXWS-Fm+8+r27t)!q^Rd{0h3+*e7gce4{#U{S* zR+33$Zz;rpLOy=jTHW!g)!Wd{H`P(BAM^vIG$?QP1ik)Q*Dj1xP-v$zqY# zP`a(zzV(;w7ucSjWP_rd@{M~^J-;5Su{KDr2;gHEs;Z#Sx^lJ)*^8_wdxuuccz)8; z%ZPo5xGxdgK>Vi0b!bif&+reM=Kfu@5S_c_{#r1)MO#SE2xW^^YK@JuUwXH!>A6fu zhx^`twnrDA#B3HTdH;sz_RaWhchNP_fKD!=1&jR~+z#^;@^@rxW!lq2qNLpwX^(Ws zyF>=`TH;mhk7?lHXPoVh{nLGxtvk}8lKZ~pA6?oN`FWd7H}UCBaoZM`so0Z?$D`tr zLj<%g0Il1sIvM}R`CDlSv;sPk!EsmDlr z5>s5-;!+TMe{nk%+aNApYIC#Kj~(ZeD|0@)i@@inV^Kc&V4W0a4cTa2XEvM6YF)zB zdv``(@tiiD)i;_ps{VwulHjTN)q*R&WnR-6TG~ZGz0Q*$N$YpHwEI!5n)Wqmrz;R= zL9zEkzUnXIH$w~NSW*rYT1SF3v3104LEKKo?s8R?^p~xlM5+B#w#r{*JBT+0WlAYfih!r&q~=EL{3%$gktudHU}b8T!gRAs zVLbMCR;je3`b!$LtK?a3)68zgY!(%tBerWdv2N^Sw%s#xj3O?%w02{A5~zvdb!Bl) zOvDB^hDoZ44{ogpN_vFd%bq?#>;S2_1@EmXjRHR9jhz+)q*hWYy3oYG>-Q)kS(MIs zi{I1`zvbhg->xIIg|zP?h*v?=V>f)WCpyMzQEe^Y^V^rb){#FT--}i+wwu`ViCewc zI(-bfSWGiioof#r*JEo7+D)QSrytHAz}7j?eil6F_qnzEGg>F7{xkqzEcOY;8V0`n z`qb^|?Oj$n(LpPKpy1W4SUo63D-GA2neW>c6xzK+egxZfj%8HoOEL z8g)X0shm?%wYNrN?@kQe*yYP*B_KT7sw z6k-vrXo7NbkW{N4hJD%bYOOsD!Nd1luYf{61-V= zjW#--eptSr$-OJ2@w4uBzY4%wz1?(B4#IRm(L}{j@u*(3nVP5WmFBb$h&6Y5MH%a` ztmOQ%RcO_$Ww)Qv*!b!RN+>3H$x=lM&w=*M_a z=kZp9{oQ3~koMbJY@`Z`_~ghmq(i;)tQqBZwVJZ@Inu#dYAT=aIK}w7`m0t^?LPyB zM(d!g0woW43XZ*WtK-oFi$UQ&WIHI-PKzCyl>O?6wJRBg?VIhbD^b$E|8oR9?%>f4 zx)*Qm%HD6JU0>|WT;i17)n;9)*|BJINW+O>`uxp(PVqHtcy{D?B+l=!oT4Va0i^(> z-CdnHsq?MAv}Wgr`UYFu`A!L6rOrJ>YW3@jm2R=OK)I|u9oV`&D8(S{=IG1Tb*+zN z1BHFb6JNUkg-)NS3dK!M+*K~fh`N`Ye8(Q)PK40&l@LjDcX;y9&-Pm2!4 zhg_#~0pww!^;A$QfTvUOrYB4Pxq2j8l}PD+^SGGFfpEZpxuo~Mmwo=yT4)9+I7m&UfESm|8k_)F{;Hqh#e^2pId7JZc-7-HG@!9^ zbd^$}E2f6F$>2r`AUmo_Bc;+lmaEm7FE>4|BAtXm$D|6^Sgd_5^KY1L?Nmu!vvv>zqa#Ia#h*X_7;_&P~r#!-cWLak&})+%#b zEnL5p@%YeJkXD02HNIx)rak*jZr*}XSo;xsWkLDC)&dU;tsQtiq3<0!TGIO3=9PK1 z?HA97Zv5*+VxMTYhOl$^;&lo;rya>~D4<$nq!rDTWx6bQGvWjF=wxf;$IjVF-WtVw z6887NsPfqT$^rX6(vq(vPdBn zG(VO(&}4cse4hduFn=Kal7N^Z=rz$!kBygF{f5JXC)bboz5>!A-;4Z&>2xvptd#0v zxnmWEH+@)_<%jwB^We!2EA7d1cX^WyVbY2W-e|(_7I107->9dS*_WUE8`%K)5sy&r zgU21x61Khw%3Pxv^(9oRFk=zxmNuP1JRLEQcpPHqoqWFX^GWaI^RbKFRVn8A?3NGO z3BC_INvb>Duj&mW{roW7mHRnMG(L!lzy0q`4-en(IT{q+vaq+!&IkTE^ve%R%em2L z5Xjlbd7MDMLnyvi7bP!CeK1yJbQKxjYTgNI7{T%PL2 z{DoRH0|kDMs&CpI0h9v9gWjt2tgV0gyF3A^%u}Quylmf`lzVi(q4!PT(d=-_P4}Rrgsx;p5+gxVa+6;^7tS)5~HW06% z=LJtbNc-YJ;lNIbdTOWK_j-Urc3Y9<#b+Kqe?@}AOV0j&BQ?6TC07MfXr{6sSL%QE zU2Nl%FOT^+ONaS`wBPuY)0s0(^2$FBZhg~qeY-SgV)+q&5iG3+Dc%6`!0J zzg;MPN80XN7wj!y@f(Ttr?cPfOnS6-QoEL!@*O}aU?xF>zJ8!!sFV~^eRS^@_k!sJ z1fzJXHh|I!ls^w|(l+$mf5=9mpLPrZ<<{2z+g^k&DJW6s{e=)vYJ<|Jru*C-(Lt4L zJaa)oeMs6`by~^CTc+aulKu!OhY<1G`gY&RXK#od2X7_t=BV1Wd%k1ptt=h(KHy(m z>VU~J+m}6jPCDPq-qtTRll^9D(!f85e|B+1{<*KAJVG-Y|8Lji(AIRC0G;zpY<9yf&Sg zVkq! zI_YKG9&_$@7)Eblaf%rf@(Uv`2OX)L?`#blWf~|{rtL0j_5>XbNX}2NYA2@*2~yYX z>AN;i*1%hJn@d~s-dea*K0Tdt;OS(WC+QYeVvu3k`pyk(lv<#aMLK(bEj532i~eVA zl%AlVyGsgdRJ_}POC=&~lu4je0cHHpdA4lGd{t3Lw}C?Sdeyb9nN+=0w{1MXfkGC2 zt5UCc{jdp*$z|Q%d9?)>4{*R+zwc`osEPX9Dmm9VSOT^l9i zcT)KT|J0;?(-l8!Y?O+iP`%FF;Aih4^NvllQCfmh4V1?_kNz4R8A>x2o=yTNr9cVL zOdJt&CDMmYdVAy7ug?x>KVY1ZfrZr>xM7(y=LS`ya`i(mT>_0FaS51VUx zt6p--o;jsI^l34eY9hwAAgT&3l)jWQF?*9%-~RR7hf&z7ZU88GAg%A(UT62Xd2|B> za{{<*(Hn{Ad~>U$k+=MHBHO$2so&OzG|Zi8lJOMjP?_$2`s3a5muh6^8lcjol~#0- zlvDd-7hm)X_Qx(X4Yj-O!uAU0LMn}-$Jg0$wCS85$&b=%1XddDj>*w8`8v=|oFDrZ z#Q@iVH2dQ>%BeUVJ7>`O_g%ymwQD!F8nLXdH1bZdgUfzZN<4Q?o6hG;q}55g>9BX$ zcOVA!fTMTTj=7?rL2ncBcA8ciC``9rOQp8Gqq^I{Q@V?NaOn$r$M1Mx8%p49)20W;2}}av{0r`K%rV? zXq0qmy>IhOprB6C9ODBhw4(XTLEn&rm+MQdu{!CNW0}+%OLia9{+254NAS=HA3UFf zQVBdwLJl9uaCkk<>-n74ce!M@>IILs4ema0k&UMZDAdn=HUD7a$zh@LOb^o1etTvR z&Cx*-=hSXJU?ulYmZ{*Y8tJSdj--idm6#{kPCJ!qh?pnn-^NpZjnvaFepKe(tgjY7 zMm=!Se$?LLGHuXMs=X<{UqvHgacO_LMIBkE+B&J9yV~pas~bOUD1!W;VbOPS(xbst zNTc4Y@cXijcCR@tfBVcItCOJ6%1^EpCr;GJG@DjrkPaGfLl1uYt-+0PGAKD8}SPScYgQ7H(% zcELQKxQ2+N{j(k^SS9}2-=~+4Bi+Q`8%$45?blKAV(F1)f7D6R#4{uD8cKRJu=@o^ zHjYn^H1V2HdZeX?Cp}|6v4^$)ZAZtYZQmbI+ZLr0Ec}L~w}Y=Fe!6vn9en9dl+*N$ zP(;$w*GfJ;r$H*aUo%Z-y-uGE#A~YJ{D}NPu!FiIs&78&@<{)z?-j3Ki)~=Hm9RDM zPvl|!T%SGCF2dK^&7o6%s6eNV{>@`p@#_93=7-JnK9L7D2v*tmiR6()(j1K(L_CiA zVEY<4_M>*|0n3kA1G^`gSv?R*bL5fiosq%v4(ujsbB=tx{gH#?(XH4Yh;1OwsdxwK z6GwyC&l2R+$*e%E+b3#(6%28GOP{|^k444blpSzTnwOj@GPOd9#Vd+`jNcL0D)&Ru zTGz_nKg5ndbas#=&2ilkI3HsDoHG5B7TthxxH*u>M=SMVqr&9)E z4d&mXl>fa=*2D&@wd3&`h zQh9pgQ#jvAzXPW_T0dml-%Yyh`H9mHeYO7WzP9a_oa6F;wGP$0hc&x=1JATFwYX2W zvEfbXm1xUz@Niv5mZKcCVuPV-vZg-CnliFVgCFD3MJM*sghlI(b@2mmI)fK}>`ljS zah%_xv#NE*xVq9w8Lt>aY=qvZ)|#TDO~xoos$hDvRLyrpQjw%nXDkJEl+I!$kYK&p zWQ@jpnm9IzpPFU=sPVm3D{QQeHfj4H2@QVb$SW3!St3n31AaJK&3+5cOMa{yYmCsu zcxhuTR{XHF&Y&ZC7QA{A6Kc|!!{`)pj9%Nvj6=uKIQ5I;Zzi)<6Kc>!St7007)uQ= zFS9NJpSLzAdKzP(gQv+H;ROv6qqRCOwS1?h7nr;~tr7hkaM?tI(e|LmFoRxraLk;n zAb6AS!Ac*%am<;VM{p+JtJzU>KPRlob^>eiy_%gG@*&m;lPL_p76iK)b!IY(ntzJH zffba|AXfPZ$#j~{ads>yM6DH^(hXV9sR>f(3Dy+Pkbtv?PErj+suB3uFPP<9HJ!$Mi zz@ZFazia3yXK5lM0mg)?WshAD03*J3*)~5Pe5WBBMjZ)$rl|_#M9bN@B z8g&K-nNmiB2<0P;O204(J<+Wg)S>u+L!Cv4y1TXKJNL53DJkDQ8YIrqE4FTGo^mgtLl9+$@Wnm)(C9XL6x}Gx;8z&PP1S z^#Yv9_bg4;79lK5hc|w8q*x4wpougZNj8i@XN<5$I;bvoVk03tp-7UC5qWxH8mlHb zQEnNg02H!l&H5OOft*x;WOgNs&9-Tzv1~i5Bxx-o**uk*m@H?5tq4<07`W-e;yd#w z_DlnQd%=+B+~vqGvO$J?3qBeJIcdM_MQ_ra-N5zIc|7o79*fbEHkRgq4r&GJl2&IS zf5-164=MFd4)~Pf!K{2l1E&|wohVNIAboQm%V_^hEiWd^mg=ox)c(z93qXN-vvcjGmWKI5# zKg7$oC@wyza=?diSQtL<8v{Q1)}|H~6-<~!X&rf=M=~4eTicpoa6Q z6n}ja%=`{zLGSIM<{&_qU?s~s$i6L-B!Y8LO?TQt!K)}KiC+=GWU$7<10fqfR7f*Y z2MVQ$3%O~+n0cMGLq(l}48@b0hE>j7aHtu}P~<(N8&(+1tl@eLa?BcIgw8=OY>^X$jGRUHBR!+M3B=h>byIrPoDCeLnBOx*$FnXoWJ0LES#QzC1^QDmb`yv(#p}#5+CYDUP8i4HSKT|o4waid zA&t=`#Skvmi-;nf7$Y+6pq|*xi_C{Q$Sa0qW;t9@o6;j1>e`cx;B*O2X(XHEl;P*u5^i%E zHkV*a!5;NrOa@h3ay<4@NhYQ%k<|XtmO^Suy2K|NgM1KNiA{WJ%D*h$j$2?I5xKW? z374vhB!m3AP50E4bct8kH_+cEJ4JB11S@-Cn_Ok+M~anJIHjH*f}|VFKKME+4J5EF zX|?KgW>2ld`HUP5Qsi5VN}Lb+?QB9qgq=`mg{3Aoz6#a#gF@)+E!cg*QmHyx7pB*+ zPn$XDZBj-=A}IqtYGRloWr#@eY#U`e&?1VdNm*n!uo10EV$|h`2j!A>`<7(bC8(wE zdXrEVfp&J;4XxVNr8_TH?tGj_`^fy3nO%yZ*e#X1%;jYoa=wX7SeK(+5~_4mWF}nVni5>>ih`vt zY@tvzSUr$VhFC1IF)=vfVZk{S?26N;Mp5lCcch(hHnEOzkSTl7k(#|=TesvuUP@&k zDP;iW=rl`r-12Dk8Rt48z%AdhrtgeTVH2<_p1@6uI7n66y3(4Aaadb-kc|}aAS}f* z41w=e+Qb>rex1sqNXdfef%;QPiUZyhP6O;Io)ykVa{CrK-=uNqTv_kK<3S$3BT4j1 zG%Q5!S8LGd&CFqjni3pnmnJSGl4}ANdUIdCZ0kUPqKv?*ctSmKz5vVijq&j{u*$b; z9ChS_6bH#FTqW7S=A)V8Wczmxxb3wKh_M&Uz=$_0v<~LFY8}y-YC1@ZR7&tJ4BR1qCITfY2kFsxS!CXzH zOdiC%0^7Pw%|nSwkv=g85|c75n<$nXYb4HvGJ``5yQ=ZQIdsTU`%)ALE%W2+bRQ{= z$4(Y1F{|-W=#S{^rBrFC34V5R(U_DWpyVwTlPic&Jbk1PsWq|L8mT~sdDU$7o)s#0Mpjd7L?o&J_WC}; zk1AtBrt*;$8#`C!z>>@x1b|bzLDO*Fyl7~Rr3LChchjqk8>j?Y~WcTNS*TBD`R(1OwL$Q6wac2)P%#X-Vkm# z{G(cVD(gd5su0^?2NOnP9F9?29o2hVB+7F#2L_IOBpOoNgGTMx*!N)DzZMNluMUl+ z5^!K)Wi&`uK0-t1jUsIwfRwa>tWi1}+NG^wWVSTb4vp3Mwqu&=OQKR&>5tNi8Bf_V zASq3lZ8w#*CUvOB;;1xjks!?WfPn!WQgl3mWnZEK8@nP0bQHodM>M&tXpD0|qC6>Q zb~39BVtHj{S=VYZ(R(mPIvG!2ICW6b(!_;M#A0g)4wzFpFR-Qx`KUIT!aYJpif2}< zScfD9(?J{u8rdQx3nC76@^M^RjAoIX2}$M;rX#n`#yLuN4^HJH>H29+H4m>>3fgZ|e5UPBnnW@u3V{&@LET;{}i{lckp0KrJX^jPnn00+)^;mg9ui$W1 zAw@h$PVvm#x-*B8GF^yB8Gx$iJa6*RGjPkd;B!7}j$wOC_!pWwAEPOIbflzw{3s`- z7#x6I@q~uK&#O8pf8Ll-bYQkUs4<&%?rE)N|3I+O<)d1mZEQmsO&;i|QB}y9Id)~q zBP8%9-`gyNrEj!5ysklqK{U}c*l{{hvqgeT+XM5Ke$K{`EPhz1%o!F+wcdH9N~I^* zQ-!eV&DPxUx{)R^IY$l(F=a%EOd0S|4Mt;0G-~^>mu%!)H~^aep;&Y{l#Tbi;Ooh^ z*`6>;l>+!E7S9gUOdjk)!{mErY@UeKtRbI;-%pm0COVL2iv)4D2R1BXuGEtqFXHb` zLNlF(4_0+DCHdKj+A;X~5e-wC-LXpN%v9mK}>Gflbxel?|+%DTYxi)?CaqSdwp9QqK5NXUO@CFrLzgw_vb< z1z09t8mChgiM58SgXJw9*3xMH?zl}+3`k@XecNuTGMbCTRmn$)gU}Cs7J3=fu|`U6Xr_E*Jrc__e;Zh> zjSq8B&lIsBN%3UsZREgkY$<+(B#NdGMUS>Itpom;J`rl1_ysG!gAZ`->-jH|fs5aP zi~3b~R4NcFUS7a)Wdcs!Vjb9#^HjtlEo?ltF3^GgisZnpc>1{9v--ncfyK{}NSY_- z#6hb3w@XN0Omd^~>LUArQzsog-eEH*G9Fw%su|jsg6VU( zK7!qvWAXkH4&`EhP}-8PNWtiS3~@R+3LPY1_wlr2tuxDM84*h&Sd5w&ymlzPyDoPr zj0Kx=C}W(kmzbm_b98XhBb>X@LL(WTES>CC9DG2-#>%`U)*uOnf5P$MFtkU5E`_4l zxR24{^(mtk3sepYgQvnWmx2d26Vg6znJ-laYy#yhkr=*M;Y>r>nz9i2S)mC_E({Ay zd@r0WGO|E=UyGhFD~&bNk`vxm#tQ;G9v{Qtg=mWGrAwe!%A_*~jGLWFz{&~ht~n3? zvH=E1R!st4lt{1}&NN`}{z#uP!0scxN~Dc7)7uH`r?v6I6^U?=eP^t&h_fhcq{l`k zcGYA9J9V-dmK| zyRrEDgD6R>n$DzX!t6(5OR-ef$Um?*0-=DDsF51IQ54H+g0s}c>0p3(jo#7TJ5NOU zt}6SGDjOfw)kMdjr0DHQ^qlZPF}4Kx2@h%=dVB_h-ek1m*VuGc*}gnNv?(kWXTXyk zRZ6n_#FiUm8(MYIF%T&?Ie7rf_jlB`ak})YLh4Xd6Hi~7MDP!)I2?*ganKN?8;tGv zY#e)!&POIx^Jw9pU0KKCY&edlLenDf@H=TL#kF?QkEP8sb*_~64q**#PR9W3%D%FiL>%$^+@j8Qn=rkN*u0RnC14?fK62U?BP>M>y zL&i|bU~@ZEP7HLFJn~>2zlW#{mYf2;h)Bx_+K*Hq6&F-U6@s?vd_JbsL!lm|DV{Lh zaK0U)l%%k;R4TI7nPJk{g~kdRvsvS4p;jqAIX-1t=0$e-8ZvoP_Mv_UmSl9Wvn$%O z^Uo0R>LxW@n#J-vMOAZdJH6|M(TiMog$}&pc*~MUrh6tf% zQ#`hW@$ zfIk~{_<4JK`vm$2YVjqPSc{Hrz_M>k;j3dfW{Xc-U|m2T8_iZl%%EUP4+m_AewWedb0n*-V>cnkeZ{ zF3k)$O=@XkAThR0mkygcn4jB8S2&kXe|8CdKOZDonFG6|T8M^>R3RAQ@I7`1Qc~>~KniBt(%ykW zjd(N85wiUOH5N5-n3*p_NZ;m_Uo&8fLEPWa*KYYztm9KcVkYP!CSo+hhqMkdXID#z zwHr?7=kXspA^I9HcFnYgSiBS}XAbXVN-yfj0T|kc;@~t^pV+6Llo9bw)G#%^(T7C` z+7fc0p#v`HnM#gr7_Y^Q`0Pmyp1`J+2aBEX?4Lc{e&AN z7L3wQ4n53$}fTcXwMW*IBVgw##2lcQY)Mx?;y2%$EGwJ*m;p1Za%* z;v5v1-5Ueu$1u;GBS&fXrXxOTcQw9BtN{qx56(pRd`*@?#?`~sUSXaOq`yDeF&uZG zaxmKFzz}prHN@rDKt3Ju%x+@E@yZ@8^CdGk(VPQ*+JkOjYd=V!RXAaKQeg0}D)`ZW zam`9`_ok&I{c(*~m16Qo4JMu4)Gx<8{o${Jx>q2|*B68)wkaiKUFoI=9dzmhdmw#= zCgL3sE-=zs8D3F@!Fi83<|!qAv_KSQd)!Ibspukm(m@)jl<7wCFDt@Nl64OuGxKW< z(V!(%lAG8Z5X?V1xgH>!$4kk^lS<#q;ReSvi=U^_{NbQr!@a2@57@YMo=e^mjDOi-P+xvhh;`B6=$sGMtAin=#U3kx4U-)*mn z1(V<=n)_DA{qx=K<}PhM*Y|;>DLe%9?`6ygG%;|(fGDNUdy3^p zsKpB>a~ISALJ;UO0QWNCgiaT6bXs<8HsAh+G=+%_I?!P5d|hS1B`&eoC6H3_=#%4a zAPA{&38fW{I}$GxV|}Te{k(k0BTx;=2MMi8m-`$ioo#F zPpi~RQ@Hv!rfBOgD&W!5vB4T9c!-2v3s4iC^bp7 z(51{In}@1nJLAu3<`e=vIxm|}1Z&nHvDf^oDuHM?w*r_d^B+w9zS$%pLe4X{_PUN)?TRGSBK`gq zIkBrSWEW!dnTcXh>jDFo@+^ZePRe9gf{787AEmD>W^+JOYmZfFlcs-lwNCZvVBmT6^2j3TD4IGl9k6g6X#nrQEcw|K>bO73@dr7IG3v4z zY^LJN(`oUPF<}BclP^`tiv!<&95kCjR7AqY`xM`bDXHgFQUsW;5Y%N~oELh6;Ka3N z9Oz}~^fe`V8&C^M!bJd~S~pTll~WMb7cCp*%W3OO`SydDwsE{>8S_#hU12i*SD6(_ z_VmmTW!;+-ME%M=A=eyoN|{KB{rYODF*$xv&ZTawF|~kCizBPAK`(XTGdoi}jQ$Ly`NG~|W+}Zj3~i60oM@0aJ%XZJfyVceN~yqjh%7C=9ny-W@q#DtB6N zB}6@(#JYFD?F14UlP{|l%7rlH%QFUDyu>cN=h{gv={`2`+_8JL zzh%n0Cn$Er)eIJbvu{*6PE0XmNm^Zwku9-I@5fe}){cE0kmW}>Gs_rp(ujP{l?@u! zL4n1+iG7S1jrZwOhl?mtxV|_sGLgWN!1XGCw)>*rKYbDtV!+)TIMYc*Ww)}uhtlxo zgDourVoo$WL;JNHIa$p}DN(s8pJ3@jd;&;=r&5c3`jpwK*z%WDzi6wVtxm4G!&XoE z$aP|Cy3~$;Ha+XUNe9~sz&bdE=%`Y;JK(z*wB2>TvS$;ix;<_Jl@|6Z`bunf6V` zz6a$i5Y+1n`oRXwpzPQC?UOi&^e?kzob_Xt169HZgw^D~eBRwY-lhDgs_^8bCdV&u z-JUeu%d#VhuMKDJ;WRo%G=qiF**Bd$qkf+-0iMYhu*8k!s|5=GDhXTTy<6W#An>n< zuPytw4~H-2%0fw#asFQ0lnISA?#BcBtb_hsC;_pBU$oDom6T%%Ozw>x>-an<%y_4!HJzXfQGDIx zz}H|zQD7S)MX&BN%2fDt^P8;COCTaU-zbhGjK?jXWNz7$;{Bx7P;#^|Mt18u?P zaM<>w_6{!WCS-H-Oi;?<3EKc`XdJ@1syyAZ3QqN4q#z~@F{uxvCSTSewHB+*?whcR zm$oPhzycvYijkZW-e?L*NqzILf9gmZ43&;FR0>{381Zoevq^h+!2qj&6(=d0PmPU9 zDa%Tb;sFP&kBUL9L8FQ~+8dh7uE{&t?1|>qv~gn-X<_Yt;D_YsCHC3W9Q}_lsI#VE?&ik8(nGW z!Gt$gstyhf3fgG$^2e+5D0Arq5{#2CiZs*&le$=ysnsfrZ#pGYJn7lfjkcFIx*b>g z%*uDP{+b+NIX-N^{*=FYRzDwOUj=#w+)7x?GC6H7G(Z)m7Z$o zfS`F-=?$y%J9h_bNRK{X(#3<-_K={Lcav}_b9^Z>9m~ccCCjroNyJYwo-at?NZxbG zr3bdj#X(1zl!uq|PJ>o1FqALPT2m$4GYd3J-stG{)fZ8({9inU@8JeslGUWQ%1F8# z^^*+P>Vbo^_nAhDPkcqYkgC;{h;$kq)@yy4+j4V z58PNDN{B2!Ho7vPyjgAfDlVW@etTwd{DkXs&@BZ zB8S5DMV*Mz$f`>v%GMXk{+ecfMvt74+Hftv;dHx^C7+H!g!SgDiit)g;MLs{?N1Ky z^WT3Eiw-x*>E#`Pk6+I34yWIfL^)8%O-rj5jr?t(uuzEoD%q~gO5;etf^x29qsFOq zr)+)EX)aQarL`zpp0#8YvaHKby=}>!;MLM|585}+i#h_C*y;j#P^he(VX{2KWUP_d zJ`+D4^Z#z_deHys~QY2u;}k}i{?`B5DZQMv6I`$ls~+7m4k z@0R3yq|K9xvoHndH}5KbYO3&Kx+Y`u9+fXe=^MF9_kB<8!pwB-CFb>bXcG%gB3aFl08K2v$5==(Kjc@Zp; z3OPUMi7WX-kFE$B=yZ`#?R>8KS~eufDgH7J&v8&-bZ=_Qs({MH8tZQ3FeqWImO%pI zt)z*}iiMt|XTWBX>%VS@wJ_&sTQ<3(M9-eHQOcBl{j|G(-0jV*k@H`0qD%#S zAl{`YY?Ws^F;*cnE)s^8GgO#0R{MRlXE}ic?c@tcV++8xk<5+4p z`YpM#Byp086FVu`!<^%i^E;$70=slTSK|yiqCo?#=3OW9$ZBbMR!6AbiktZ^Up8cd zvuk8UVH{-nPH&P_ddphrhUAna{4@^^_4x2QiSnhXhkr$({iLq6@e0H90tWwzWX6L} z%stAf)hEZzqG_odrWJPcL0pEpOip7?C+B70&Cs4k0h>pRiWX^JdY_kPL zyb>5NtL#OLZHr~dfN5j%`ssJ_hqG5jmviG~N)m!Lf%uUFvEose#Iks-y5&%YS1e5u z5I5Z3-)?9%xl?NQU$(&1&>t1t-4el-or~fnlp_mx_z56@iO)~_8%=?V^PZ~6=PokB zw^JHei8>(qSLSCaUo!@Ev$|T{r8FKABUz9h^8PpcARK|%7<4NP)x?s02T=NCj z$=T5bNl}}6pBE>>NF*tNWnD<~n9$cSNIU1GeKtQCXBp}d`}7*|=tI4-x@^(tW*?#| zt7U=-%cYXvh7njt59-* z9lD40Fb)sY!tbZU(=m{a(RipdWJv6B1MX6C<$gBm7Mx2OgrB7mRDneu9CGUOye28q zo5e+uEj4EHGwF`WqPWVXbfi#U{(W_p?#lYZ_Td_ZRu!#gUK~+LW+t&%50mWM4yoo6 zm3V3~Exs%=oKc-$i2uN;vD7#j?rE9iTLgzAu$E+diSQsz+Hw)Lz{PgzXELvi6eTmC zK@#80hWx@1s#BiNeiuV`C&)^=&Z|qPveIYvy*u14c3}pKrb0(LPnwa~%haJaAx*Q! zS6pHb5xI}64S(ArkK7o+6=)Jw8EeR7cPur^8LQ&!%UCt$u(oi($-?jOSxy~XAMTeZ z=E>BK7e!#D8;0|4M!E{9PUGTQ`@jtgXcZKe95zonu{3-#Pi<5;(R0Vc{R?}$a!tf( z`{n$8^y5$cADuYpc@F$`V$^aLe%X=Q0;&y8{BtQOt4#?^2v!1D*W3_b>c3RPu_J4P z2!{2MdDpEAEk&x?qy;S<_>I__)5l-Lv8dMuY3Rh}$3Oo=9|pBuhZ$}I+Lc$^AK((q z1Gdq~pFe?w$mEOev_+|3`^}hS=BLGGw%=i!v|Hi2uG>=y#ruH7dq`;D1p?C<265Ne z+QLQ%)Y=bHgZ>B;5k(~MKOhKltJG_SVrIQ$9Z-k2u#*;%Rl&}oWaVi|xm$U&z){sH zB%|2My)bh9q@s+Q#${VKp09o~d3o+nWdTbT0sK(DsSIx&k(+ z$Vv>Tq2pF(w5+wJ`UiZb&!)dPEj#EdYr93QEu6cw zwR5$u0N;mJk^hir3;BJh*VFfljbR{{(Q9mWx^G6U0Z6nWqi3lXXA6lgy?kUQucj`m zpI_kg$obzdq=e~nB>{}HCN$UYlAUq>O0FvvWptUue>oqAL|m|#9&JIj7Qq^1@MxoS z4fKVr(pjo@+o%I~8Rd2<-J{t;TuRN<_Cb#C%tWB5+;qK?*_-}r(Pabm*oB8&_q*8M zvQNwWmZzkY6k|Z31r*Gwh_sE(e4dv5IzZTgp75I~z-=5cwxn5#2F^;O*9SA8%X)m- zQPd~Cw8P@KXos?`9Bj|$waX6^LE9Hu!)yo&r}^HGL6@(u1ntzWe!5k4ve%*}J(KKo zNje2IWc!yzl;;NtJfp!e*Qjm@-E|uScVabt9=qP9g$hj`=29<879^7 zty(ElWK(uTjGr%T%f;>DF4;xs%eWZb2i4uc}k!k=^ts+048HTeFk|HL$L^PJ-vYK?mpL)c)fN!B~Mt&DxB|L(H>TB=E zt2U0%?F6?}$|0z$bZg8@;H`wb;S|2&NPg!A_>CRAj)mLI>-8w9z^lu+n#3H<1hWk$ z>NQ{s@fK<(1}&mWs{8Xr;;}Bis&Y`JWnD>WgtyO@m4?KKjkyqrw=}t{k&9aE(sI9F zNXZAdc1d}FMC+~dzeG4_*sghFh$rk(?0{WXM|CYM(2@XR_Rubpjd}26w^|yj>;q@t zQY#yGBa(|C&|B}rnJJw_GUz(3V}*H34eKaqB2;@#+5lYEhZPk8SlNc?if144vYMu= zBYli-uex(6N41?0^MC-%&tPYf2lkSzvyx-V($G zwae7XVSz~G-LLyh%RW^HOHcs_)JE?!da>dcv^A9YsS)wGKnKS LUi_#3)BpYltlSoa literal 0 HcmV?d00001 diff --git a/package.json b/package.json index ac8fa2eae5..f4760174d3 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "eslint": "eslint app/javascript/**/*.js", "build:js": "rollup -c", "build:css": "sass --style=compressed --source-map --load-path app/assets/stylesheets --load-path vendor/assets/stylesheets app/assets/stylesheets/alchemy/admin.scss:app/assets/builds/alchemy/admin.css app/assets/stylesheets/alchemy/admin/print.scss:app/assets/builds/alchemy/admin/print.css app/assets/stylesheets/alchemy/welcome.scss:app/assets/builds/alchemy/welcome.css app/assets/stylesheets/tinymce/skins/content/alchemy/content.scss:app/assets/builds/tinymce/skins/content/alchemy/content.min.css app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.scss:app/assets/builds/tinymce/skins/ui/alchemy/skin.min.css", - "build": "yarn build:js && yarn build:css" + "build": "bun run --bun build:js && bun run --bun build:css" }, "keywords": [], "author": "Thomas von Deyen", diff --git a/spec/dummy/Procfile.dev b/spec/dummy/Procfile.dev index 8e29c9a15d..b2d6782ac8 100644 --- a/spec/dummy/Procfile.dev +++ b/spec/dummy/Procfile.dev @@ -1,3 +1,3 @@ web: env RUBY_DEBUG_OPEN=true bin/rails server css: bin/rails dartsass:watch -sass: cd ../../ && yarn build:css --watch +sass: cd ../../ && bun run --bun build:css --watch diff --git a/vendor/javascript/shoelace.min.js b/vendor/javascript/shoelace.min.js index 5bf2d5ea68..c022a78239 100644 --- a/vendor/javascript/shoelace.min.js +++ b/vendor/javascript/shoelace.min.js @@ -8,19 +8,19 @@ var t=Object.defineProperty,e=Object.defineProperties,o=Object.getOwnPropertyDes * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */,{is:C,defineProperty:E,getOwnPropertyDescriptor:S,getOwnPropertyNames:z,getOwnPropertySymbols:T,getPrototypeOf:P}=Object,L=globalThis,O=L.trustedTypes,F=O?O.emptyScript:"",R=L.reactiveElementPolyfillSupport,D=(t,e)=>t,M={toAttribute(t,e){switch(e){case Boolean:t=t?F:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let o=t;switch(e){case Boolean:o=null!==t;break;case Number:o=null===t?null:Number(t);break;case Object:case Array:try{o=JSON.parse(t)}catch(t){o=null}}return o}},B=(t,e)=>!C(t,e),N={attribute:!0,type:String,converter:M,reflect:!1,hasChanged:B};Symbol.metadata??=Symbol("metadata"),L.litPropertyMetadata??=new WeakMap;class U extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=N){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const o=Symbol(),i=this.getPropertyDescriptor(t,o,e);void 0!==i&&E(this.prototype,t,i)}}static getPropertyDescriptor(t,e,o){const{get:i,set:s}=S(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return i?.call(this)},set(e){const r=i?.call(this);s.call(this,e),this.requestUpdate(t,r,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??N}static _$Ei(){if(this.hasOwnProperty(D("elementProperties")))return;const t=P(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(D("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(D("properties"))){const t=this.properties,e=[...z(t),...T(t)];for(const o of e)this.createProperty(o,t[o])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,o]of e)this.elementProperties.set(t,o)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const o=this._$Eu(t,e);void 0!==o&&this._$Eh.set(o,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const o=new Set(t.flat(1/0).reverse());for(const t of o)e.unshift(A(t))}else void 0!==t&&e.push(A(t));return e}static _$Eu(t,e){const o=e.attribute;return!1===o?void 0:"string"==typeof o?o:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const o of e.keys())this.hasOwnProperty(o)&&(t.set(o,this[o]),delete this[o]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(w)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const o of e){const e=document.createElement("style"),i=y.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=o.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,o){this._$AK(t,o)}_$EC(t,e){const o=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,o);if(void 0!==i&&!0===o.reflect){const s=(void 0!==o.converter?.toAttribute?o.converter:M).toAttribute(e,o.type);this._$Em=t,null==s?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(t,e){const o=this.constructor,i=o._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=o.getPropertyOptions(i),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:M;this._$Em=i,this[i]=s.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,o){if(void 0!==t){if(o??=this.constructor.getPropertyOptions(t),!(o.hasChanged??B)(this[t],e))return;this.P(t,e,o)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,o){this._$AL.has(t)||this._$AL.set(t,e),!0===o.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,o]of t)!0!==o.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}U.elementStyles=[],U.shadowRootOptions={mode:"open"},U[D("elementProperties")]=new Map,U[D("finalized")]=new Map,R?.({ReactiveElement:U}),(L.reactiveElementVersions??=[]).push("2.0.4"); + */,{is:C,defineProperty:E,getOwnPropertyDescriptor:S,getOwnPropertyNames:z,getOwnPropertySymbols:T,getPrototypeOf:P}=Object,L=globalThis,O=L.trustedTypes,F=O?O.emptyScript:"",R=L.reactiveElementPolyfillSupport,M=(t,e)=>t,D={toAttribute(t,e){switch(e){case Boolean:t=t?F:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let o=t;switch(e){case Boolean:o=null!==t;break;case Number:o=null===t?null:Number(t);break;case Object:case Array:try{o=JSON.parse(t)}catch(t){o=null}}return o}},B=(t,e)=>!C(t,e),N={attribute:!0,type:String,converter:D,reflect:!1,hasChanged:B};Symbol.metadata??=Symbol("metadata"),L.litPropertyMetadata??=new WeakMap;class U extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=N){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const o=Symbol(),i=this.getPropertyDescriptor(t,o,e);void 0!==i&&E(this.prototype,t,i)}}static getPropertyDescriptor(t,e,o){const{get:i,set:s}=S(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return i?.call(this)},set(e){const r=i?.call(this);s.call(this,e),this.requestUpdate(t,r,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??N}static _$Ei(){if(this.hasOwnProperty(M("elementProperties")))return;const t=P(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(M("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(M("properties"))){const t=this.properties,e=[...z(t),...T(t)];for(const o of e)this.createProperty(o,t[o])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,o]of e)this.elementProperties.set(t,o)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const o=this._$Eu(t,e);void 0!==o&&this._$Eh.set(o,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const o=new Set(t.flat(1/0).reverse());for(const t of o)e.unshift(A(t))}else void 0!==t&&e.push(A(t));return e}static _$Eu(t,e){const o=e.attribute;return!1===o?void 0:"string"==typeof o?o:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const o of e.keys())this.hasOwnProperty(o)&&(t.set(o,this[o]),delete this[o]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(w)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const o of e){const e=document.createElement("style"),i=y.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=o.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,o){this._$AK(t,o)}_$EC(t,e){const o=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,o);if(void 0!==i&&!0===o.reflect){const s=(void 0!==o.converter?.toAttribute?o.converter:D).toAttribute(e,o.type);this._$Em=t,null==s?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(t,e){const o=this.constructor,i=o._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=o.getPropertyOptions(i),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:D;this._$Em=i,this[i]=s.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,o){if(void 0!==t){if(o??=this.constructor.getPropertyOptions(t),!(o.hasChanged??B)(this[t],e))return;this.P(t,e,o)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,o){this._$AL.has(t)||this._$AL.set(t,e),!0===o.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,o]of t)!0!==o.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}U.elementStyles=[],U.shadowRootOptions={mode:"open"},U[M("elementProperties")]=new Map,U[M("finalized")]=new Map,R?.({ReactiveElement:U}),(L.reactiveElementVersions??=[]).push("2.0.4"); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const H=globalThis,I=H.trustedTypes,V=I?I.createPolicy("lit-html",{createHTML:t=>t}):void 0,W="$lit$",j=`lit$${(Math.random()+"").slice(9)}$`,q="?"+j,K=`<${q}>`,Z=document,G=()=>Z.createComment(""),X=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Y=Array.isArray,J="[ \t\n\f\r]",Q=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,tt=/-->/g,et=/>/g,ot=RegExp(`>|${J}(?:([^\\s"'>=/]+)(${J}*=${J}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),it=/'/g,st=/"/g,rt=/^(?:script|style|textarea|title)$/i,nt=(t=>(e,...o)=>({_$litType$:t,strings:e,values:o}))(1),at=Symbol.for("lit-noChange"),lt=Symbol.for("lit-nothing"),ct=new WeakMap,ht=Z.createTreeWalker(Z,129);function dt(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==V?V.createHTML(e):e}const pt=(t,e)=>{const o=t.length-1,i=[];let s,r=2===e?"":"",n=Q;for(let e=0;e"===l[0]?(n=s??Q,c=-1):void 0===l[1]?c=-2:(c=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?ot:'"'===l[3]?st:it):n===st||n===it?n=ot:n===tt||n===et?n=Q:(n=ot,s=void 0);const d=n===ot&&t[e+1].startsWith("/>")?" ":"";r+=n===Q?o+K:c>=0?(i.push(a),o.slice(0,c)+W+o.slice(c)+j+d):o+j+(-2===c?e:d)}return[dt(t,r+(t[o]||"")+(2===e?"":"")),i]};class ut{constructor({strings:t,_$litType$:e},o){let i;this.parts=[];let s=0,r=0;const n=t.length-1,a=this.parts,[l,c]=pt(t,e);if(this.el=ut.createElement(l,o),ht.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=ht.nextNode())&&a.length0){i.textContent=I?I.emptyScript:"";for(let o=0;oY(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==lt&&X(this._$AH)?this._$AA.nextSibling.data=t:this.T(Z.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:o}=t,i="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=ut.createElement(dt(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new mt(i,this),o=t.u(this.options);t.p(e),this.T(o),this._$AH=t}}_$AC(t){let e=ct.get(t.strings);return void 0===e&&ct.set(t.strings,e=new ut(t)),e}k(t){Y(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let o,i=0;for(const s of t)i===e.length?e.push(o=new bt(this.S(G()),this.S(G()),this,this.options)):o=e[i],o._$AI(s),i++;i2||""!==o[0]||""!==o[1]?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=lt}_$AI(t,e=this,o,i){const s=this.strings;let r=!1;if(void 0===s)t=ft(this,t,e,0),r=!X(t)||t!==this._$AH&&t!==at,r&&(this._$AH=t);else{const i=t;let n,a;for(t=s[0],n=0;nt}):void 0,W="$lit$",j=`lit$${Math.random().toFixed(9).slice(2)}$`,q="?"+j,K=`<${q}>`,Z=document,G=()=>Z.createComment(""),X=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Y=Array.isArray,J="[ \t\n\f\r]",Q=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,tt=/-->/g,et=/>/g,ot=RegExp(`>|${J}(?:([^\\s"'>=/]+)(${J}*=${J}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),it=/'/g,st=/"/g,rt=/^(?:script|style|textarea|title)$/i,nt=(t=>(e,...o)=>({_$litType$:t,strings:e,values:o}))(1),at=Symbol.for("lit-noChange"),lt=Symbol.for("lit-nothing"),ct=new WeakMap,ht=Z.createTreeWalker(Z,129);function dt(t,e){if(!Y(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==V?V.createHTML(e):e}class pt{constructor({strings:t,_$litType$:e},o){let i;this.parts=[];let s=0,r=0;const n=t.length-1,a=this.parts,[l,c]=((t,e)=>{const o=t.length-1,i=[];let s,r=2===e?"":3===e?"":"",n=Q;for(let e=0;e"===l[0]?(n=s??Q,c=-1):void 0===l[1]?c=-2:(c=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?ot:'"'===l[3]?st:it):n===st||n===it?n=ot:n===tt||n===et?n=Q:(n=ot,s=void 0);const d=n===ot&&t[e+1].startsWith("/>")?" ":"";r+=n===Q?o+K:c>=0?(i.push(a),o.slice(0,c)+W+o.slice(c)+j+d):o+j+(-2===c?e:d)}return[dt(t,r+(t[o]||"")+(2===e?"":3===e?"":"")),i]})(t,e);if(this.el=pt.createElement(l,o),ht.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=ht.nextNode())&&a.length0){i.textContent=I?I.emptyScript:"";for(let o=0;oY(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==lt&&X(this._$AH)?this._$AA.nextSibling.data=t:this.T(Z.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:o}=t,i="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=pt.createElement(dt(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new ft(i,this),o=t.u(this.options);t.p(e),this.T(o),this._$AH=t}}_$AC(t){let e=ct.get(t.strings);return void 0===e&&ct.set(t.strings,e=new pt(t)),e}k(t){Y(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let o,i=0;for(const s of t)i===e.length?e.push(o=new mt(this.O(G()),this.O(G()),this,this.options)):o=e[i],o._$AI(s),i++;i2||""!==o[0]||""!==o[1]?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=lt}_$AI(t,e=this,o,i){const s=this.strings;let r=!1;if(void 0===s)t=ut(this,t,e,0),r=!X(t)||t!==this._$AH&&t!==at,r&&(this._$AH=t);else{const i=t;let n,a;for(t=s[0],n=0;n{const i=o?.renderBefore??e;let s=i._$litPart$;if(void 0===s){const t=o?.renderBefore??null;i._$litPart$=s=new bt(e.insertBefore(G(),t),t,void 0,o??{})}return s._$AI(t),s})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return at}};$t._$litElement$=!0,$t.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:$t});const kt=globalThis.litElementPolyfillSupport;kt?.({LitElement:$t}),(globalThis.litElementVersions??=[]).push("4.0.4");var At=k` +class xt extends U{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=((t,e,o)=>{const i=o?.renderBefore??e;let s=i._$litPart$;if(void 0===s){const t=o?.renderBefore??null;i._$litPart$=s=new mt(e.insertBefore(G(),t),t,void 0,o??{})}return s._$AI(t),s})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return at}}xt._$litElement$=!0,xt.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:xt});const $t=globalThis.litElementPolyfillSupport;$t?.({LitElement:xt}),(globalThis.litElementVersions??=[]).push("4.1.0");var kt=k` :host { display: inline-block; } @@ -185,7 +185,7 @@ let $t=class extends U{constructor(){super(...arguments),this.renderOptions={hos background-color: ButtonText; } } -`,Ct=k` +`,At=k` .form-control .form-control__label { display: none; } @@ -241,7 +241,7 @@ let $t=class extends U{constructor(){super(...arguments),this.renderOptions={hos .form-control--has-help-text.form-control--radio-group .form-control__help-text { margin-top: var(--sl-spacing-2x-small); } -`,Et=new WeakMap,St=new WeakMap,zt=new WeakMap,Tt=new WeakSet,Pt=new WeakMap,Lt=class{constructor(t,e){this.handleFormData=t=>{const e=this.options.disabled(this.host),o=this.options.name(this.host),i=this.options.value(this.host),s="sl-button"===this.host.tagName.toLowerCase();this.host.isConnected&&!e&&!s&&"string"==typeof o&&o.length>0&&void 0!==i&&(Array.isArray(i)?i.forEach((e=>{t.formData.append(o,e.toString())})):t.formData.append(o,i.toString()))},this.handleFormSubmit=t=>{var e;const o=this.options.disabled(this.host),i=this.options.reportValidity;this.form&&!this.form.noValidate&&(null==(e=Et.get(this.form))||e.forEach((t=>{this.setUserInteracted(t,!0)}))),!this.form||this.form.noValidate||o||i(this.host)||(t.preventDefault(),t.stopImmediatePropagation())},this.handleFormReset=()=>{this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),Pt.set(this.host,[])},this.handleInteraction=t=>{const e=Pt.get(this.host);e.includes(t.type)||e.push(t.type),e.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0)},this.checkFormValidity=()=>{if(this.form&&!this.form.noValidate){const t=this.form.querySelectorAll("*");for(const e of t)if("function"==typeof e.checkValidity&&!e.checkValidity())return!1}return!0},this.reportFormValidity=()=>{if(this.form&&!this.form.noValidate){const t=this.form.querySelectorAll("*");for(const e of t)if("function"==typeof e.reportValidity&&!e.reportValidity())return!1}return!0},(this.host=t).addController(this),this.options=c({form:t=>{const e=t.form;if(e){const o=t.getRootNode().querySelector(`#${e}`);if(o)return o}return t.closest("form")},name:t=>t.name,value:t=>t.value,defaultValue:t=>t.defaultValue,disabled:t=>{var e;return null!=(e=t.disabled)&&e},reportValidity:t=>"function"!=typeof t.reportValidity||t.reportValidity(),checkValidity:t=>"function"!=typeof t.checkValidity||t.checkValidity(),setValue:(t,e)=>t.value=e,assumeInteractionOn:["sl-input"]},e)}hostConnected(){const t=this.options.form(this.host);t&&this.attachForm(t),Pt.set(this.host,[]),this.options.assumeInteractionOn.forEach((t=>{this.host.addEventListener(t,this.handleInteraction)}))}hostDisconnected(){this.detachForm(),Pt.delete(this.host),this.options.assumeInteractionOn.forEach((t=>{this.host.removeEventListener(t,this.handleInteraction)}))}hostUpdated(){const t=this.options.form(this.host);t||this.detachForm(),t&&this.form!==t&&(this.detachForm(),this.attachForm(t)),this.host.hasUpdated&&this.setValidity(this.host.validity.valid)}attachForm(t){t?(this.form=t,Et.has(this.form)?Et.get(this.form).add(this.host):Et.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),St.has(this.form)||(St.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity()),zt.has(this.form)||(zt.set(this.form,this.form.checkValidity),this.form.checkValidity=()=>this.checkFormValidity())):this.form=void 0}detachForm(){if(!this.form)return;const t=Et.get(this.form);t&&(t.delete(this.host),t.size<=0&&(this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),St.has(this.form)&&(this.form.reportValidity=St.get(this.form),St.delete(this.form)),zt.has(this.form)&&(this.form.checkValidity=zt.get(this.form),zt.delete(this.form)),this.form=void 0))}setUserInteracted(t,e){e?Tt.add(t):Tt.delete(t),t.requestUpdate()}doAction(t,e){if(this.form){const o=document.createElement("button");o.type=t,o.style.position="absolute",o.style.width="0",o.style.height="0",o.style.clipPath="inset(50%)",o.style.overflow="hidden",o.style.whiteSpace="nowrap",e&&(o.name=e.name,o.value=e.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach((t=>{e.hasAttribute(t)&&o.setAttribute(t,e.getAttribute(t))}))),this.form.append(o),o.click(),o.remove()}}getForm(){var t;return null!=(t=this.form)?t:null}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}setValidity(t){const e=this.host,o=Boolean(Tt.has(e)),i=Boolean(e.required);e.toggleAttribute("data-required",i),e.toggleAttribute("data-optional",!i),e.toggleAttribute("data-invalid",!t),e.toggleAttribute("data-valid",t),e.toggleAttribute("data-user-invalid",!t&&o),e.toggleAttribute("data-user-valid",t&&o)}updateValidity(){const t=this.host;this.setValidity(t.validity.valid)}emitInvalidEvent(t){const e=new CustomEvent("sl-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});t||e.preventDefault(),this.host.dispatchEvent(e)||null==t||t.preventDefault()}},Ot=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1});Object.freeze(h(c({},Ot),{valid:!1,valueMissing:!0})),Object.freeze(h(c({},Ot),{valid:!1,customError:!0}));var Ft=class{constructor(t,...e){this.slotNames=[],this.handleSlotChange=t=>{const e=t.target;(this.slotNames.includes("[default]")&&!e.name||e.name&&this.slotNames.includes(e.name))&&this.host.requestUpdate()},(this.host=t).addController(this),this.slotNames=e}hasDefaultSlot(){return[...this.host.childNodes].some((t=>{if(t.nodeType===t.TEXT_NODE&&""!==t.textContent.trim())return!0;if(t.nodeType===t.ELEMENT_NODE){const e=t;if("sl-visually-hidden"===e.tagName.toLowerCase())return!1;if(!e.hasAttribute("slot"))return!0}return!1}))}hasNamedSlot(t){return null!==this.host.querySelector(`:scope > [slot="${t}"]`)}test(t){return"[default]"===t?this.hasDefaultSlot():this.hasNamedSlot(t)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}};function Rt(t,e){const o=c({waitUntilFirstUpdate:!1},e);return(e,i)=>{const{update:s}=e,r=Array.isArray(t)?t:[t];e.update=function(t){r.forEach((e=>{const s=e;if(t.has(s)){const e=t.get(s),r=this[s];e!==r&&(o.waitUntilFirstUpdate&&!this.hasUpdated||this[i](e,r))}})),s.call(this,t)}}}var Dt=k` +`,Ct=new WeakMap,Et=new WeakMap,St=new WeakMap,zt=new WeakSet,Tt=new WeakMap,Pt=class{constructor(t,e){this.handleFormData=t=>{const e=this.options.disabled(this.host),o=this.options.name(this.host),i=this.options.value(this.host),s="sl-button"===this.host.tagName.toLowerCase();this.host.isConnected&&!e&&!s&&"string"==typeof o&&o.length>0&&void 0!==i&&(Array.isArray(i)?i.forEach((e=>{t.formData.append(o,e.toString())})):t.formData.append(o,i.toString()))},this.handleFormSubmit=t=>{var e;const o=this.options.disabled(this.host),i=this.options.reportValidity;this.form&&!this.form.noValidate&&(null==(e=Ct.get(this.form))||e.forEach((t=>{this.setUserInteracted(t,!0)}))),!this.form||this.form.noValidate||o||i(this.host)||(t.preventDefault(),t.stopImmediatePropagation())},this.handleFormReset=()=>{this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),Tt.set(this.host,[])},this.handleInteraction=t=>{const e=Tt.get(this.host);e.includes(t.type)||e.push(t.type),e.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0)},this.checkFormValidity=()=>{if(this.form&&!this.form.noValidate){const t=this.form.querySelectorAll("*");for(const e of t)if("function"==typeof e.checkValidity&&!e.checkValidity())return!1}return!0},this.reportFormValidity=()=>{if(this.form&&!this.form.noValidate){const t=this.form.querySelectorAll("*");for(const e of t)if("function"==typeof e.reportValidity&&!e.reportValidity())return!1}return!0},(this.host=t).addController(this),this.options=c({form:t=>{const e=t.form;if(e){const o=t.getRootNode().querySelector(`#${e}`);if(o)return o}return t.closest("form")},name:t=>t.name,value:t=>t.value,defaultValue:t=>t.defaultValue,disabled:t=>{var e;return null!=(e=t.disabled)&&e},reportValidity:t=>"function"!=typeof t.reportValidity||t.reportValidity(),checkValidity:t=>"function"!=typeof t.checkValidity||t.checkValidity(),setValue:(t,e)=>t.value=e,assumeInteractionOn:["sl-input"]},e)}hostConnected(){const t=this.options.form(this.host);t&&this.attachForm(t),Tt.set(this.host,[]),this.options.assumeInteractionOn.forEach((t=>{this.host.addEventListener(t,this.handleInteraction)}))}hostDisconnected(){this.detachForm(),Tt.delete(this.host),this.options.assumeInteractionOn.forEach((t=>{this.host.removeEventListener(t,this.handleInteraction)}))}hostUpdated(){const t=this.options.form(this.host);t||this.detachForm(),t&&this.form!==t&&(this.detachForm(),this.attachForm(t)),this.host.hasUpdated&&this.setValidity(this.host.validity.valid)}attachForm(t){t?(this.form=t,Ct.has(this.form)?Ct.get(this.form).add(this.host):Ct.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),Et.has(this.form)||(Et.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity()),St.has(this.form)||(St.set(this.form,this.form.checkValidity),this.form.checkValidity=()=>this.checkFormValidity())):this.form=void 0}detachForm(){if(!this.form)return;const t=Ct.get(this.form);t&&(t.delete(this.host),t.size<=0&&(this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),Et.has(this.form)&&(this.form.reportValidity=Et.get(this.form),Et.delete(this.form)),St.has(this.form)&&(this.form.checkValidity=St.get(this.form),St.delete(this.form)),this.form=void 0))}setUserInteracted(t,e){e?zt.add(t):zt.delete(t),t.requestUpdate()}doAction(t,e){if(this.form){const o=document.createElement("button");o.type=t,o.style.position="absolute",o.style.width="0",o.style.height="0",o.style.clipPath="inset(50%)",o.style.overflow="hidden",o.style.whiteSpace="nowrap",e&&(o.name=e.name,o.value=e.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach((t=>{e.hasAttribute(t)&&o.setAttribute(t,e.getAttribute(t))}))),this.form.append(o),o.click(),o.remove()}}getForm(){var t;return null!=(t=this.form)?t:null}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}setValidity(t){const e=this.host,o=Boolean(zt.has(e)),i=Boolean(e.required);e.toggleAttribute("data-required",i),e.toggleAttribute("data-optional",!i),e.toggleAttribute("data-invalid",!t),e.toggleAttribute("data-valid",t),e.toggleAttribute("data-user-invalid",!t&&o),e.toggleAttribute("data-user-valid",t&&o)}updateValidity(){const t=this.host;this.setValidity(t.validity.valid)}emitInvalidEvent(t){const e=new CustomEvent("sl-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});t||e.preventDefault(),this.host.dispatchEvent(e)||null==t||t.preventDefault()}},Lt=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1});Object.freeze(h(c({},Lt),{valid:!1,valueMissing:!0})),Object.freeze(h(c({},Lt),{valid:!1,customError:!0}));var Ot=class{constructor(t,...e){this.slotNames=[],this.handleSlotChange=t=>{const e=t.target;(this.slotNames.includes("[default]")&&!e.name||e.name&&this.slotNames.includes(e.name))&&this.host.requestUpdate()},(this.host=t).addController(this),this.slotNames=e}hasDefaultSlot(){return[...this.host.childNodes].some((t=>{if(t.nodeType===t.TEXT_NODE&&""!==t.textContent.trim())return!0;if(t.nodeType===t.ELEMENT_NODE){const e=t;if("sl-visually-hidden"===e.tagName.toLowerCase())return!1;if(!e.hasAttribute("slot"))return!0}return!1}))}hasNamedSlot(t){return null!==this.host.querySelector(`:scope > [slot="${t}"]`)}test(t){return"[default]"===t?this.hasDefaultSlot():this.hasNamedSlot(t)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}};function Ft(t,e){const o=c({waitUntilFirstUpdate:!1},e);return(e,i)=>{const{update:s}=e,r=Array.isArray(t)?t:[t];e.update=function(t){r.forEach((e=>{const s=e;if(t.has(s)){const e=t.get(s),r=this[s];e!==r&&(o.waitUntilFirstUpdate&&!this.hasUpdated||this[i](e,r))}})),s.call(this,t)}}}var Rt=k` :host { box-sizing: border-box; } @@ -260,12 +260,12 @@ let $t=class extends U{constructor(){super(...arguments),this.renderOptions={hos * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */;const Mt={attribute:!0,type:String,converter:M,reflect:!1,hasChanged:B},Bt=(t=Mt,e,o)=>{const{kind:i,metadata:s}=o;let r=globalThis.litPropertyMetadata.get(s);if(void 0===r&&globalThis.litPropertyMetadata.set(s,r=new Map),r.set(o.name,t),"accessor"===i){const{name:i}=o;return{set(o){const s=e.get.call(this);e.set.call(this,o),this.requestUpdate(i,s,t)},init(e){return void 0!==e&&this.P(i,void 0,t),e}}}if("setter"===i){const{name:i}=o;return function(o){const s=this[i];e.call(this,o),this.requestUpdate(i,s,t)}}throw Error("Unsupported decorator location: "+i)};function Nt(t){return(e,o)=>"object"==typeof o?Bt(t,e,o):((t,e,o)=>{const i=e.hasOwnProperty(o);return e.constructor.createProperty(o,i?{...t,wrapped:!0}:t),i?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o) + */;const Mt={attribute:!0,type:String,converter:D,reflect:!1,hasChanged:B},Dt=(t=Mt,e,o)=>{const{kind:i,metadata:s}=o;let r=globalThis.litPropertyMetadata.get(s);if(void 0===r&&globalThis.litPropertyMetadata.set(s,r=new Map),r.set(o.name,t),"accessor"===i){const{name:i}=o;return{set(o){const s=e.get.call(this);e.set.call(this,o),this.requestUpdate(i,s,t)},init(e){return void 0!==e&&this.P(i,void 0,t),e}}}if("setter"===i){const{name:i}=o;return function(o){const s=this[i];e.call(this,o),this.requestUpdate(i,s,t)}}throw Error("Unsupported decorator location: "+i)};function Bt(t){return(e,o)=>"object"==typeof o?Dt(t,e,o):((t,e,o)=>{const i=e.hasOwnProperty(o);return e.constructor.createProperty(o,i?{...t,wrapped:!0}:t),i?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o) /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */}function Ut(t){return Nt({...t,state:!0,attribute:!1})} + */}function Nt(t){return Bt({...t,state:!0,attribute:!1})} /** * @license * Copyright 2017 Google LLC @@ -276,23 +276,23 @@ let $t=class extends U{constructor(){super(...arguments),this.renderOptions={hos * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -function Ht(t,e){return(e,o,i)=>((t,e,o)=>(o.configurable=!0,o.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,o),o))(e,o,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}var It=class extends $t{constructor(){super(),Object.entries(this.constructor.dependencies).forEach((([t,e])=>{this.constructor.define(t,e)}))}emit(t,e){const o=new CustomEvent(t,c({bubbles:!0,cancelable:!1,composed:!0,detail:{}},e));return this.dispatchEvent(o),o}static define(t,e=this,o={}){const i=customElements.get(t);if(!i){try{customElements.define(t,e,o)}catch(i){customElements.define(t,class extends e{},o)}return}let s=" (unknown version)",r=s;"version"in e&&e.version&&(s=" v"+e.version),"version"in i&&i.version&&(r=" v"+i.version),s&&r&&s===r||console.warn(`Attempted to register <${t}>${s}, but <${t}>${r} has already been registered.`)}};It.version="2.16.0",It.dependencies={},d([Nt()],It.prototype,"dir",2),d([Nt()],It.prototype,"lang",2); +function Ut(t,e){return(e,o,i)=>((t,e,o)=>(o.configurable=!0,o.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,o),o))(e,o,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}var Ht=class extends xt{constructor(){super(),Object.entries(this.constructor.dependencies).forEach((([t,e])=>{this.constructor.define(t,e)}))}emit(t,e){const o=new CustomEvent(t,c({bubbles:!0,cancelable:!1,composed:!0,detail:{}},e));return this.dispatchEvent(o),o}static define(t,e=this,o={}){const i=customElements.get(t);if(!i){try{customElements.define(t,e,o)}catch(i){customElements.define(t,class extends e{},o)}return}let s=" (unknown version)",r=s;"version"in e&&e.version&&(s=" v"+e.version),"version"in i&&i.version&&(r=" v"+i.version),s&&r&&s===r||console.warn(`Attempted to register <${t}>${s}, but <${t}>${r} has already been registered.`)}};Ht.version="2.16.0",Ht.dependencies={},d([Bt()],Ht.prototype,"dir",2),d([Bt()],Ht.prototype,"lang",2); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const Vt=1,Wt=3,jt=4,qt=t=>(...e)=>({_$litDirective$:t,values:e});let Kt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,o){this._$Ct=t,this._$AM=e,this._$Ci=o}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}; +const It=1,Vt=3,Wt=4,jt=t=>(...e)=>({_$litDirective$:t,values:e});class qt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,o){this.t=t,this._$AM=e,this.i=o}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}} /** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const Zt=qt(class extends Kt{constructor(t){if(super(t),t.type!==Vt||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const o=t.element.classList;for(const t of this.st)t in e||(o.remove(t),this.st.delete(t));for(const t in e){const i=!!e[t];i===this.st.has(t)||this.nt?.has(t)||(i?(o.add(t),this.st.add(t)):(o.remove(t),this.st.delete(t)))}return at}}),Gt=t=>t??lt + */const Kt=jt(class extends qt{constructor(t){if(super(t),t.type!==It||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const o=t.element.classList;for(const t of this.st)t in e||(o.remove(t),this.st.delete(t));for(const t in e){const i=!!e[t];i===this.st.has(t)||this.nt?.has(t)||(i?(o.add(t),this.st.add(t)):(o.remove(t),this.st.delete(t)))}return at}}),Zt=t=>t??lt /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */,Xt={},Yt=qt(class extends Kt{constructor(t){if(super(t),t.type!==Wt&&t.type!==Vt&&t.type!==jt)throw Error("The `live` directive is not allowed on child or event bindings");if(!(t=>void 0===t.strings)(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===at||e===lt)return e;const o=t.element,i=t.name;if(t.type===Wt){if(e===o[i])return at}else if(t.type===jt){if(!!e===o.hasAttribute(i))return at}else if(t.type===Vt&&o.getAttribute(i)===e+"")return at;return((t,e=Xt)=>{t._$AH=e; + */,Gt={},Xt=jt(class extends qt{constructor(t){if(super(t),t.type!==Vt&&t.type!==It&&t.type!==Wt)throw Error("The `live` directive is not allowed on child or event bindings");if(!(t=>void 0===t.strings)(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===at||e===lt)return e;const o=t.element,i=t.name;if(t.type===Vt){if(e===o[i])return at}else if(t.type===Wt){if(!!e===o.hasAttribute(i))return at}else if(t.type===It&&o.getAttribute(i)===e+"")return at;return((t,e=Gt)=>{t._$AH=e; /** * @license * Copyright 2020 Google LLC @@ -302,21 +302,21 @@ const Vt=1,Wt=3,jt=4,qt=t=>(...e)=>({_$litDirective$:t,values:e});let Kt=class{c * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */var Jt=class extends It{constructor(){super(...arguments),this.formControlController=new Lt(this,{value:t=>t.checked?t.value||"on":void 0,defaultValue:t=>t.defaultChecked,setValue:(t,e)=>t.checked=e}),this.hasSlotController=new Ft(this,"help-text"),this.hasFocus=!1,this.title="",this.name="",this.size="medium",this.disabled=!1,this.checked=!1,this.defaultChecked=!1,this.form="",this.required=!1,this.helpText=""}get validity(){return this.input.validity}get validationMessage(){return this.input.validationMessage}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleInput(){this.emit("sl-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t)}handleClick(){this.checked=!this.checked,this.emit("sl-change")}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleKeyDown(t){"ArrowLeft"===t.key&&(t.preventDefault(),this.checked=!1,this.emit("sl-change"),this.emit("sl-input")),"ArrowRight"===t.key&&(t.preventDefault(),this.checked=!0,this.emit("sl-change"),this.emit("sl-input"))}handleCheckedChange(){this.input.checked=this.checked,this.formControlController.updateValidity()}handleDisabledChange(){this.formControlController.setValidity(!0)}click(){this.input.click()}focus(t){this.input.focus(t)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(t){this.input.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("help-text"),e=!!this.helpText||!!t;return nt` + */var Yt=class extends Ht{constructor(){super(...arguments),this.formControlController=new Pt(this,{value:t=>t.checked?t.value||"on":void 0,defaultValue:t=>t.defaultChecked,setValue:(t,e)=>t.checked=e}),this.hasSlotController=new Ot(this,"help-text"),this.hasFocus=!1,this.title="",this.name="",this.size="medium",this.disabled=!1,this.checked=!1,this.defaultChecked=!1,this.form="",this.required=!1,this.helpText=""}get validity(){return this.input.validity}get validationMessage(){return this.input.validationMessage}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleInput(){this.emit("sl-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t)}handleClick(){this.checked=!this.checked,this.emit("sl-change")}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleKeyDown(t){"ArrowLeft"===t.key&&(t.preventDefault(),this.checked=!1,this.emit("sl-change"),this.emit("sl-input")),"ArrowRight"===t.key&&(t.preventDefault(),this.checked=!0,this.emit("sl-change"),this.emit("sl-input"))}handleCheckedChange(){this.input.checked=this.checked,this.formControlController.updateValidity()}handleDisabledChange(){this.formControlController.setValidity(!0)}click(){this.input.click()}focus(t){this.input.focus(t)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(t){this.input.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("help-text"),e=!!this.helpText||!!t;return nt`
- `}};Jt.styles=[Dt,Ct,At],d([Ht('input[type="checkbox"]')],Jt.prototype,"input",2),d([Ut()],Jt.prototype,"hasFocus",2),d([Nt()],Jt.prototype,"title",2),d([Nt()],Jt.prototype,"name",2),d([Nt()],Jt.prototype,"value",2),d([Nt({reflect:!0})],Jt.prototype,"size",2),d([Nt({type:Boolean,reflect:!0})],Jt.prototype,"disabled",2),d([Nt({type:Boolean,reflect:!0})],Jt.prototype,"checked",2),d([((t="value")=>(e,o)=>{const i=e.constructor,s=i.prototype.attributeChangedCallback;i.prototype.attributeChangedCallback=function(e,r,n){var a;const l=i.getPropertyOptions(t);if(e===("string"==typeof l.attribute?l.attribute:t)){const e=l.converter||M,i=("function"==typeof e?e:null!=(a=null==e?void 0:e.fromAttribute)?a:M.fromAttribute)(n,l.type);this[t]!==i&&(this[o]=i)}s.call(this,e,r,n)}})("checked")],Jt.prototype,"defaultChecked",2),d([Nt({reflect:!0})],Jt.prototype,"form",2),d([Nt({type:Boolean,reflect:!0})],Jt.prototype,"required",2),d([Nt({attribute:"help-text"})],Jt.prototype,"helpText",2),d([Rt("checked",{waitUntilFirstUpdate:!0})],Jt.prototype,"handleCheckedChange",1),d([Rt("disabled",{waitUntilFirstUpdate:!0})],Jt.prototype,"handleDisabledChange",1),Jt.define("sl-switch");var Qt=k` + `}};Yt.styles=[Rt,At,kt],d([Ut('input[type="checkbox"]')],Yt.prototype,"input",2),d([Nt()],Yt.prototype,"hasFocus",2),d([Bt()],Yt.prototype,"title",2),d([Bt()],Yt.prototype,"name",2),d([Bt()],Yt.prototype,"value",2),d([Bt({reflect:!0})],Yt.prototype,"size",2),d([Bt({type:Boolean,reflect:!0})],Yt.prototype,"disabled",2),d([Bt({type:Boolean,reflect:!0})],Yt.prototype,"checked",2),d([((t="value")=>(e,o)=>{const i=e.constructor,s=i.prototype.attributeChangedCallback;i.prototype.attributeChangedCallback=function(e,r,n){var a;const l=i.getPropertyOptions(t);if(e===("string"==typeof l.attribute?l.attribute:t)){const e=l.converter||D,i=("function"==typeof e?e:null!=(a=null==e?void 0:e.fromAttribute)?a:D.fromAttribute)(n,l.type);this[t]!==i&&(this[o]=i)}s.call(this,e,r,n)}})("checked")],Yt.prototype,"defaultChecked",2),d([Bt({reflect:!0})],Yt.prototype,"form",2),d([Bt({type:Boolean,reflect:!0})],Yt.prototype,"required",2),d([Bt({attribute:"help-text"})],Yt.prototype,"helpText",2),d([Ft("checked",{waitUntilFirstUpdate:!0})],Yt.prototype,"handleCheckedChange",1),d([Ft("disabled",{waitUntilFirstUpdate:!0})],Yt.prototype,"handleDisabledChange",1),Yt.define("sl-switch");var Jt=k` :host { display: inline-block; } @@ -416,7 +416,7 @@ const Vt=1,Wt=3,jt=4,qt=t=>(...e)=>({_$litDirective$:t,values:e});let Kt=class{c outline-offset: -3px; } } -`,te=k` +`,Qt=k` :host { display: inline-block; color: var(--sl-color-neutral-600); @@ -463,7 +463,7 @@ const Vt=1,Wt=3,jt=4,qt=t=>(...e)=>({_$litDirective$:t,values:e});let Kt=class{c .icon-button__icon { pointer-events: none; } -`,ee="";function oe(t){ee=t}var ie={name:"default",resolver:t=>function(t=""){if(!ee){const t=[...document.getElementsByTagName("script")],e=t.find((t=>t.hasAttribute("data-shoelace")));if(e)oe(e.getAttribute("data-shoelace"));else{const e=t.find((t=>/shoelace(\.min)?\.js($|\?)/.test(t.src)||/shoelace-autoloader(\.min)?\.js($|\?)/.test(t.src)));let o="";e&&(o=e.getAttribute("src")),oe(o.split("/").slice(0,-1).join("/"))}}return ee.replace(/\/$/,"")+(t?`/${t.replace(/^\//,"")}`:"")}(`assets/icons/${t}.svg`)},se={caret:'\n \n \n \n ',check:'\n \n \n \n \n \n \n \n \n \n \n ',"chevron-down":'\n \n \n \n ',"chevron-left":'\n \n \n \n ',"chevron-right":'\n \n \n \n ',copy:'\n \n \n \n ',eye:'\n \n \n \n \n ',"eye-slash":'\n \n \n \n \n \n ',eyedropper:'\n \n \n \n ',"grip-vertical":'\n \n \n \n ',indeterminate:'\n \n \n \n \n \n \n \n \n \n ',"person-fill":'\n \n \n \n ',"play-fill":'\n \n \n \n ',"pause-fill":'\n \n \n \n ',radio:'\n \n \n \n \n \n \n \n ',"star-fill":'\n \n \n \n ',"x-lg":'\n \n \n \n ',"x-circle-fill":'\n \n \n \n '},re=[ie,{name:"system",resolver:t=>t in se?`data:image/svg+xml,${encodeURIComponent(se[t])}`:""}],ne=[];function ae(t){return re.find((e=>e.name===t))}function le(t,e){!function(t){re=re.filter((e=>e.name!==t))}(t),re.push({name:t,resolver:e.resolver,mutator:e.mutator,spriteSheet:e.spriteSheet}),ne.forEach((e=>{e.library===t&&e.setIcon()}))}var ce,he=k` +`,te="";function ee(t){te=t}var oe={name:"default",resolver:t=>function(t=""){if(!te){const t=[...document.getElementsByTagName("script")],e=t.find((t=>t.hasAttribute("data-shoelace")));if(e)ee(e.getAttribute("data-shoelace"));else{const e=t.find((t=>/shoelace(\.min)?\.js($|\?)/.test(t.src)||/shoelace-autoloader(\.min)?\.js($|\?)/.test(t.src)));let o="";e&&(o=e.getAttribute("src")),ee(o.split("/").slice(0,-1).join("/"))}}return te.replace(/\/$/,"")+(t?`/${t.replace(/^\//,"")}`:"")}(`assets/icons/${t}.svg`)},ie={caret:'\n \n \n \n ',check:'\n \n \n \n \n \n \n \n \n \n \n ',"chevron-down":'\n \n \n \n ',"chevron-left":'\n \n \n \n ',"chevron-right":'\n \n \n \n ',copy:'\n \n \n \n ',eye:'\n \n \n \n \n ',"eye-slash":'\n \n \n \n \n \n ',eyedropper:'\n \n \n \n ',"grip-vertical":'\n \n \n \n ',indeterminate:'\n \n \n \n \n \n \n \n \n \n ',"person-fill":'\n \n \n \n ',"play-fill":'\n \n \n \n ',"pause-fill":'\n \n \n \n ',radio:'\n \n \n \n \n \n \n \n ',"star-fill":'\n \n \n \n ',"x-lg":'\n \n \n \n ',"x-circle-fill":'\n \n \n \n '},se=[oe,{name:"system",resolver:t=>t in ie?`data:image/svg+xml,${encodeURIComponent(ie[t])}`:""}],re=[];function ne(t){return se.find((e=>e.name===t))}function ae(t,e){!function(t){se=se.filter((e=>e.name!==t))}(t),se.push({name:t,resolver:e.resolver,mutator:e.mutator,spriteSheet:e.spriteSheet}),re.forEach((e=>{e.library===t&&e.setIcon()}))}var le,ce=k` :host { display: inline-block; width: 1em; @@ -476,25 +476,25 @@ const Vt=1,Wt=3,jt=4,qt=t=>(...e)=>({_$litDirective$:t,values:e});let Kt=class{c height: 100%; width: 100%; } -`,de=Symbol(),pe=Symbol(),ue=new Map,fe=class extends It{constructor(){super(...arguments),this.initialRender=!1,this.svg=null,this.label="",this.library="default"}async resolveIcon(t,e){var o;let i;if(null==e?void 0:e.spriteSheet){this.svg=nt` +`,he=Symbol(),de=Symbol(),pe=new Map,ue=class extends Ht{constructor(){super(...arguments),this.initialRender=!1,this.svg=null,this.label="",this.library="default"}async resolveIcon(t,e){var o;let i;if(null==e?void 0:e.spriteSheet){this.svg=nt` - `,await this.updateComplete;const o=this.shadowRoot.querySelector("[part='svg']");return"function"==typeof e.mutator&&e.mutator(o),this.svg}try{if(i=await fetch(t,{mode:"cors"}),!i.ok)return 410===i.status?de:pe}catch(t){return pe}try{const t=document.createElement("div");t.innerHTML=await i.text();const e=t.firstElementChild;if("svg"!==(null==(o=null==e?void 0:e.tagName)?void 0:o.toLowerCase()))return de;ce||(ce=new DOMParser);const s=ce.parseFromString(e.outerHTML,"text/html").body.querySelector("svg");return s?(s.part.add("svg"),document.adoptNode(s)):de}catch(t){return de}}connectedCallback(){var t;super.connectedCallback(),t=this,ne.push(t)}firstUpdated(){this.initialRender=!0,this.setIcon()}disconnectedCallback(){var t;super.disconnectedCallback(),t=this,ne=ne.filter((e=>e!==t))}getIconSource(){const t=ae(this.library);return this.name&&t?{url:t.resolver(this.name),fromLibrary:!0}:{url:this.src,fromLibrary:!1}}handleLabelChange(){"string"==typeof this.label&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var t;const{url:e,fromLibrary:o}=this.getIconSource(),i=o?ae(this.library):void 0;if(!e)return void(this.svg=null);let s=ue.get(e);if(s||(s=this.resolveIcon(e,i),ue.set(e,s)),!this.initialRender)return;const r=await s;if(r===pe&&ue.delete(e),e===this.getIconSource().url)if(((t,e)=>void 0!==t?._$litType$)(r))this.svg=r;else switch(r){case pe:case de:this.svg=null,this.emit("sl-error");break;default:this.svg=r.cloneNode(!0),null==(t=null==i?void 0:i.mutator)||t.call(i,this.svg),this.emit("sl-load")}}render(){return this.svg}};fe.styles=[Dt,he],d([Ut()],fe.prototype,"svg",2),d([Nt({reflect:!0})],fe.prototype,"name",2),d([Nt()],fe.prototype,"src",2),d([Nt()],fe.prototype,"label",2),d([Nt({reflect:!0})],fe.prototype,"library",2),d([Rt("label")],fe.prototype,"handleLabelChange",1),d([Rt(["name","src","library"])],fe.prototype,"setIcon",1); + `,await this.updateComplete;const o=this.shadowRoot.querySelector("[part='svg']");return"function"==typeof e.mutator&&e.mutator(o),this.svg}try{if(i=await fetch(t,{mode:"cors"}),!i.ok)return 410===i.status?he:de}catch(t){return de}try{const t=document.createElement("div");t.innerHTML=await i.text();const e=t.firstElementChild;if("svg"!==(null==(o=null==e?void 0:e.tagName)?void 0:o.toLowerCase()))return he;le||(le=new DOMParser);const s=le.parseFromString(e.outerHTML,"text/html").body.querySelector("svg");return s?(s.part.add("svg"),document.adoptNode(s)):he}catch(t){return he}}connectedCallback(){var t;super.connectedCallback(),t=this,re.push(t)}firstUpdated(){this.initialRender=!0,this.setIcon()}disconnectedCallback(){var t;super.disconnectedCallback(),t=this,re=re.filter((e=>e!==t))}getIconSource(){const t=ne(this.library);return this.name&&t?{url:t.resolver(this.name),fromLibrary:!0}:{url:this.src,fromLibrary:!1}}handleLabelChange(){"string"==typeof this.label&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var t;const{url:e,fromLibrary:o}=this.getIconSource(),i=o?ne(this.library):void 0;if(!e)return void(this.svg=null);let s=pe.get(e);if(s||(s=this.resolveIcon(e,i),pe.set(e,s)),!this.initialRender)return;const r=await s;if(r===de&&pe.delete(e),e===this.getIconSource().url)if((t=>void 0!==t?._$litType$)(r))this.svg=r;else switch(r){case de:case he:this.svg=null,this.emit("sl-error");break;default:this.svg=r.cloneNode(!0),null==(t=null==i?void 0:i.mutator)||t.call(i,this.svg),this.emit("sl-load")}}render(){return this.svg}};ue.styles=[Rt,ce],d([Nt()],ue.prototype,"svg",2),d([Bt({reflect:!0})],ue.prototype,"name",2),d([Bt()],ue.prototype,"src",2),d([Bt()],ue.prototype,"label",2),d([Bt({reflect:!0})],ue.prototype,"library",2),d([Ft("label")],ue.prototype,"handleLabelChange",1),d([Ft(["name","src","library"])],ue.prototype,"setIcon",1); /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -const me=Symbol.for(""),be=t=>{if(t?.r===me)return t?._$litStatic$},ge=(t,...e)=>({_$litStatic$:e.reduce(((e,o,i)=>e+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(o)+t[i+1]),t[0]),r:me}),ve=new Map,ye=(t=>(e,...o)=>{const i=o.length;let s,r;const n=[],a=[];let l,c=0,h=!1;for(;c{if(t?.r===fe)return t?._$litStatic$},be=(t,...e)=>({_$litStatic$:e.reduce(((e,o,i)=>e+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(o)+t[i+1]),t[0]),r:fe}),ge=new Map,ve=(t=>(e,...o)=>{const i=o.length;let s,r;const n=[],a=[];let l,c=0,h=!1;for(;c{if(t?.r===me)return t?._$litStatic$},ge=(t,...e)= > - `}};we.styles=[Dt,te],we.dependencies={"sl-icon":fe},d([Ht(".icon-button")],we.prototype,"button",2),d([Ut()],we.prototype,"hasFocus",2),d([Nt()],we.prototype,"name",2),d([Nt()],we.prototype,"library",2),d([Nt()],we.prototype,"src",2),d([Nt()],we.prototype,"href",2),d([Nt()],we.prototype,"target",2),d([Nt()],we.prototype,"download",2),d([Nt()],we.prototype,"label",2),d([Nt({type:Boolean,reflect:!0})],we.prototype,"disabled",2);const _e=new Set,xe=new MutationObserver(Se),$e=new Map;let ke,Ae=document.documentElement.dir||"ltr",Ce=document.documentElement.lang||navigator.language;function Ee(...t){t.map((t=>{const e=t.$code.toLowerCase();$e.has(e)?$e.set(e,Object.assign(Object.assign({},$e.get(e)),t)):$e.set(e,t),ke||(ke=t)})),Se()}function Se(){Ae=document.documentElement.dir||"ltr",Ce=document.documentElement.lang||navigator.language,[..._e.keys()].map((t=>{"function"==typeof t.requestUpdate&&t.requestUpdate()}))}xe.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]});let ze=class{constructor(t){this.host=t,this.host.addController(this)}hostConnected(){_e.add(this.host)}hostDisconnected(){_e.delete(this.host)}dir(){return`${this.host.dir||Ae}`.toLowerCase()}lang(){return`${this.host.lang||Ce}`.toLowerCase()}getTranslationData(t){var e,o;const i=new Intl.Locale(t.replace(/_/g,"-")),s=null==i?void 0:i.language.toLowerCase(),r=null!==(o=null===(e=null==i?void 0:i.region)||void 0===e?void 0:e.toLowerCase())&&void 0!==o?o:"";return{locale:i,language:s,region:r,primary:$e.get(`${s}-${r}`),secondary:$e.get(s)}}exists(t,e){var o;const{primary:i,secondary:s}=this.getTranslationData(null!==(o=e.lang)&&void 0!==o?o:this.lang());return e=Object.assign({includeFallback:!1},e),!!(i&&i[t]||s&&s[t]||e.includeFallback&&ke&&ke[t])}term(t,...e){const{primary:o,secondary:i}=this.getTranslationData(this.lang());let s;if(o&&o[t])s=o[t];else if(i&&i[t])s=i[t];else{if(!ke||!ke[t])return console.error(`No translation found for: ${String(t)}`),String(t);s=ke[t]}return"function"==typeof s?s(...e):s}date(t,e){return t=new Date(t),new Intl.DateTimeFormat(this.lang(),e).format(t)}number(t,e){return t=Number(t),isNaN(t)?"":new Intl.NumberFormat(this.lang(),e).format(t)}relativeTime(t,e,o){return new Intl.RelativeTimeFormat(this.lang(),o).format(t,e)}};var Te={$code:"en",$name:"English",$dir:"ltr",carousel:"Carousel",clearEntry:"Clear entry",close:"Close",copied:"Copied",copy:"Copy",currentValue:"Current value",error:"Error",goToSlide:(t,e)=>`Go to slide ${t} of ${e}`,hidePassword:"Hide password",loading:"Loading",nextSlide:"Next slide",numOptionsSelected:t=>0===t?"No options selected":1===t?"1 option selected":`${t} options selected`,previousSlide:"Previous slide",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",slideNum:t=>`Slide ${t}`,toggleColorFormat:"Toggle color format"};Ee(Te);var Pe=Te,Le=class extends ze{};Ee(Pe);var Oe=0,Fe=class extends It{constructor(){super(...arguments),this.localize=new Le(this),this.attrId=++Oe,this.componentId=`sl-tab-${this.attrId}`,this.panel="",this.active=!1,this.closable=!1,this.disabled=!1,this.tabIndex=0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","tab")}handleCloseClick(t){t.stopPropagation(),this.emit("sl-close")}handleActiveChange(){this.setAttribute("aria-selected",this.active?"true":"false")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.disabled&&!this.active?this.tabIndex=-1:this.tabIndex=0}render(){return this.id=this.id.length>0?this.id:this.componentId,nt` + `}};ye.styles=[Rt,Qt],ye.dependencies={"sl-icon":ue},d([Ut(".icon-button")],ye.prototype,"button",2),d([Nt()],ye.prototype,"hasFocus",2),d([Bt()],ye.prototype,"name",2),d([Bt()],ye.prototype,"library",2),d([Bt()],ye.prototype,"src",2),d([Bt()],ye.prototype,"href",2),d([Bt()],ye.prototype,"target",2),d([Bt()],ye.prototype,"download",2),d([Bt()],ye.prototype,"label",2),d([Bt({type:Boolean,reflect:!0})],ye.prototype,"disabled",2);const we=new Set,_e=new Map;let xe,$e="ltr",ke="en";const Ae="undefined"!=typeof MutationObserver&&"undefined"!=typeof document&&void 0!==document.documentElement;if(Ae){const t=new MutationObserver(Ee);$e=document.documentElement.dir||"ltr",ke=document.documentElement.lang||navigator.language,t.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function Ce(...t){t.map((t=>{const e=t.$code.toLowerCase();_e.has(e)?_e.set(e,Object.assign(Object.assign({},_e.get(e)),t)):_e.set(e,t),xe||(xe=t)})),Ee()}function Ee(){Ae&&($e=document.documentElement.dir||"ltr",ke=document.documentElement.lang||navigator.language),[...we.keys()].map((t=>{"function"==typeof t.requestUpdate&&t.requestUpdate()}))}let Se=class{constructor(t){this.host=t,this.host.addController(this)}hostConnected(){we.add(this.host)}hostDisconnected(){we.delete(this.host)}dir(){return`${this.host.dir||$e}`.toLowerCase()}lang(){return`${this.host.lang||ke}`.toLowerCase()}getTranslationData(t){var e,o;const i=new Intl.Locale(t.replace(/_/g,"-")),s=null==i?void 0:i.language.toLowerCase(),r=null!==(o=null===(e=null==i?void 0:i.region)||void 0===e?void 0:e.toLowerCase())&&void 0!==o?o:"";return{locale:i,language:s,region:r,primary:_e.get(`${s}-${r}`),secondary:_e.get(s)}}exists(t,e){var o;const{primary:i,secondary:s}=this.getTranslationData(null!==(o=e.lang)&&void 0!==o?o:this.lang());return e=Object.assign({includeFallback:!1},e),!!(i&&i[t]||s&&s[t]||e.includeFallback&&xe&&xe[t])}term(t,...e){const{primary:o,secondary:i}=this.getTranslationData(this.lang());let s;if(o&&o[t])s=o[t];else if(i&&i[t])s=i[t];else{if(!xe||!xe[t])return console.error(`No translation found for: ${String(t)}`),String(t);s=xe[t]}return"function"==typeof s?s(...e):s}date(t,e){return t=new Date(t),new Intl.DateTimeFormat(this.lang(),e).format(t)}number(t,e){return t=Number(t),isNaN(t)?"":new Intl.NumberFormat(this.lang(),e).format(t)}relativeTime(t,e,o){return new Intl.RelativeTimeFormat(this.lang(),o).format(t,e)}};var ze={$code:"en",$name:"English",$dir:"ltr",carousel:"Carousel",clearEntry:"Clear entry",close:"Close",copied:"Copied",copy:"Copy",currentValue:"Current value",error:"Error",goToSlide:(t,e)=>`Go to slide ${t} of ${e}`,hidePassword:"Hide password",loading:"Loading",nextSlide:"Next slide",numOptionsSelected:t=>0===t?"No options selected":1===t?"1 option selected":`${t} options selected`,previousSlide:"Previous slide",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",slideNum:t=>`Slide ${t}`,toggleColorFormat:"Toggle color format"};Ce(ze);var Te=ze,Pe=class extends Se{};Ce(Te);var Le=0,Oe=class extends Ht{constructor(){super(...arguments),this.localize=new Pe(this),this.attrId=++Le,this.componentId=`sl-tab-${this.attrId}`,this.panel="",this.active=!1,this.closable=!1,this.disabled=!1,this.tabIndex=0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","tab")}handleCloseClick(t){t.stopPropagation(),this.emit("sl-close")}handleActiveChange(){this.setAttribute("aria-selected",this.active?"true":"false")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.disabled&&!this.active?this.tabIndex=-1:this.tabIndex=0}render(){return this.id=this.id.length>0?this.id:this.componentId,nt`
${this.closable?nt` @@ -529,7 +529,7 @@ const me=Symbol.for(""),be=t=>{if(t?.r===me)return t?._$litStatic$},ge=(t,...e)= > `:""}
- `}};Fe.styles=[Dt,Qt],Fe.dependencies={"sl-icon-button":we},d([Ht(".tab")],Fe.prototype,"tab",2),d([Nt({reflect:!0})],Fe.prototype,"panel",2),d([Nt({type:Boolean,reflect:!0})],Fe.prototype,"active",2),d([Nt({type:Boolean,reflect:!0})],Fe.prototype,"closable",2),d([Nt({type:Boolean,reflect:!0})],Fe.prototype,"disabled",2),d([Nt({type:Number,reflect:!0})],Fe.prototype,"tabIndex",2),d([Rt("active")],Fe.prototype,"handleActiveChange",1),d([Rt("disabled")],Fe.prototype,"handleDisabledChange",1),Fe.define("sl-tab");var Re=k` + `}};Oe.styles=[Rt,Jt],Oe.dependencies={"sl-icon-button":ye},d([Ut(".tab")],Oe.prototype,"tab",2),d([Bt({reflect:!0})],Oe.prototype,"panel",2),d([Bt({type:Boolean,reflect:!0})],Oe.prototype,"active",2),d([Bt({type:Boolean,reflect:!0})],Oe.prototype,"closable",2),d([Bt({type:Boolean,reflect:!0})],Oe.prototype,"disabled",2),d([Bt({type:Number,reflect:!0})],Oe.prototype,"tabIndex",2),d([Ft("active")],Oe.prototype,"handleActiveChange",1),d([Ft("disabled")],Oe.prototype,"handleDisabledChange",1),Oe.define("sl-tab");var Fe=k` :host { --indicator-color: var(--sl-color-primary-600); --track-color: var(--sl-color-neutral-200); @@ -758,10 +758,10 @@ const me=Symbol.for(""),be=t=>{if(t?.r===me)return t?._$litStatic$},ge=(t,...e)= .tab-group--end ::slotted(sl-tab-panel) { --padding: 0 var(--sl-spacing-medium); } -`;var De=new Set;function Me(t){if(De.add(t),!document.documentElement.classList.contains("sl-scroll-lock")){const t=function(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}()+function(){const t=Number(getComputedStyle(document.body).paddingRight.replace(/px/,""));return isNaN(t)||!t?0:t}();let e=getComputedStyle(document.documentElement).scrollbarGutter;e&&"auto"!==e||(e="stable"),t<2&&(e=""),document.documentElement.style.setProperty("--sl-scroll-lock-gutter",e),document.documentElement.classList.add("sl-scroll-lock"),document.documentElement.style.setProperty("--sl-scroll-lock-size",`${t}px`)}}function Be(t){De.delete(t),0===De.size&&(document.documentElement.classList.remove("sl-scroll-lock"),document.documentElement.style.removeProperty("--sl-scroll-lock-size"))}function Ne(t,e,o="vertical",i="smooth"){const s=function(t,e){return{top:Math.round(t.getBoundingClientRect().top-e.getBoundingClientRect().top),left:Math.round(t.getBoundingClientRect().left-e.getBoundingClientRect().left)}}(t,e),r=s.top+e.scrollTop,n=s.left+e.scrollLeft,a=e.scrollLeft,l=e.scrollLeft+e.offsetWidth,c=e.scrollTop,h=e.scrollTop+e.offsetHeight;"horizontal"!==o&&"both"!==o||(nl&&e.scrollTo({left:n-e.offsetWidth+t.clientWidth,behavior:i})),"vertical"!==o&&"both"!==o||(rh&&e.scrollTo({top:r-e.offsetHeight+t.clientHeight,behavior:i}))}var Ue=class extends It{constructor(){super(...arguments),this.localize=new Le(this),this.tabs=[],this.focusableTabs=[],this.panels=[],this.hasScrollControls=!1,this.placement="top",this.activation="auto",this.noScrollControls=!1}connectedCallback(){const t=Promise.all([customElements.whenDefined("sl-tab"),customElements.whenDefined("sl-tab-panel")]);super.connectedCallback(),this.resizeObserver=new ResizeObserver((()=>{this.repositionIndicator(),this.updateScrollControls()})),this.mutationObserver=new MutationObserver((t=>{t.some((t=>!["aria-labelledby","aria-controls"].includes(t.attributeName)))&&setTimeout((()=>this.setAriaLabels())),t.some((t=>"disabled"===t.attributeName))&&this.syncTabsAndPanels()})),this.updateComplete.then((()=>{this.syncTabsAndPanels(),this.mutationObserver.observe(this,{attributes:!0,childList:!0,subtree:!0}),this.resizeObserver.observe(this.nav),t.then((()=>{new IntersectionObserver(((t,e)=>{var o;t[0].intersectionRatio>0&&(this.setAriaLabels(),this.setActiveTab(null!=(o=this.getActiveTab())?o:this.tabs[0],{emitEvents:!1}),e.unobserve(t[0].target))})).observe(this.tabGroup)}))}))}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver.disconnect(),this.resizeObserver.unobserve(this.nav)}getAllTabs(){return this.shadowRoot.querySelector('slot[name="nav"]').assignedElements()}getAllPanels(){return[...this.body.assignedElements()].filter((t=>"sl-tab-panel"===t.tagName.toLowerCase()))}getActiveTab(){return this.tabs.find((t=>t.active))}handleClick(t){const e=t.target.closest("sl-tab");(null==e?void 0:e.closest("sl-tab-group"))===this&&null!==e&&this.setActiveTab(e,{scrollBehavior:"smooth"})}handleKeyDown(t){const e=t.target.closest("sl-tab");if((null==e?void 0:e.closest("sl-tab-group"))===this&&(["Enter"," "].includes(t.key)&&null!==e&&(this.setActiveTab(e,{scrollBehavior:"smooth"}),t.preventDefault()),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key))){const e=this.tabs.find((t=>t.matches(":focus"))),o=this.matches(":dir(rtl)");let i=null;if("sl-tab"===(null==e?void 0:e.tagName.toLowerCase())){if("Home"===t.key)i=this.focusableTabs[0];else if("End"===t.key)i=this.focusableTabs[this.focusableTabs.length-1];else if(["top","bottom"].includes(this.placement)&&t.key===(o?"ArrowRight":"ArrowLeft")||["start","end"].includes(this.placement)&&"ArrowUp"===t.key){const t=this.tabs.findIndex((t=>t===e));i=this.findNextFocusableTab(t,"backward")}else if(["top","bottom"].includes(this.placement)&&t.key===(o?"ArrowLeft":"ArrowRight")||["start","end"].includes(this.placement)&&"ArrowDown"===t.key){const t=this.tabs.findIndex((t=>t===e));i=this.findNextFocusableTab(t,"forward")}if(!i)return;i.tabIndex=0,i.focus({preventScroll:!0}),"auto"===this.activation?this.setActiveTab(i,{scrollBehavior:"smooth"}):this.tabs.forEach((t=>{t.tabIndex=t===i?0:-1})),["top","bottom"].includes(this.placement)&&Ne(i,this.nav,"horizontal"),t.preventDefault()}}}handleScrollToStart(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft+this.nav.clientWidth:this.nav.scrollLeft-this.nav.clientWidth,behavior:"smooth"})}handleScrollToEnd(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft-this.nav.clientWidth:this.nav.scrollLeft+this.nav.clientWidth,behavior:"smooth"})}setActiveTab(t,e){if(e=c({emitEvents:!0,scrollBehavior:"auto"},e),t!==this.activeTab&&!t.disabled){const o=this.activeTab;this.activeTab=t,this.tabs.forEach((t=>{t.active=t===this.activeTab,t.tabIndex=t===this.activeTab?0:-1})),this.panels.forEach((t=>{var e;return t.active=t.name===(null==(e=this.activeTab)?void 0:e.panel)})),this.syncIndicator(),["top","bottom"].includes(this.placement)&&Ne(this.activeTab,this.nav,"horizontal",e.scrollBehavior),e.emitEvents&&(o&&this.emit("sl-tab-hide",{detail:{name:o.panel}}),this.emit("sl-tab-show",{detail:{name:this.activeTab.panel}}))}}setAriaLabels(){this.tabs.forEach((t=>{const e=this.panels.find((e=>e.name===t.panel));e&&(t.setAttribute("aria-controls",e.getAttribute("id")),e.setAttribute("aria-labelledby",t.getAttribute("id")))}))}repositionIndicator(){const t=this.getActiveTab();if(!t)return;const e=t.clientWidth,o=t.clientHeight,i=this.matches(":dir(rtl)"),s=this.getAllTabs(),r=s.slice(0,s.indexOf(t)).reduce(((t,e)=>({left:t.left+e.clientWidth,top:t.top+e.clientHeight})),{left:0,top:0});switch(this.placement){case"top":case"bottom":this.indicator.style.width=`${e}px`,this.indicator.style.height="auto",this.indicator.style.translate=i?-1*r.left+"px":`${r.left}px`;break;case"start":case"end":this.indicator.style.width="auto",this.indicator.style.height=`${o}px`,this.indicator.style.translate=`0 ${r.top}px`}}syncTabsAndPanels(){this.tabs=this.getAllTabs(),this.focusableTabs=this.tabs.filter((t=>!t.disabled)),this.panels=this.getAllPanels(),this.syncIndicator(),this.updateComplete.then((()=>this.updateScrollControls()))}findNextFocusableTab(t,e){let o=null;const i="forward"===e?1:-1;let s=t+i;for(;tthis.nav.clientWidth+1}syncIndicator(){this.getActiveTab()?(this.indicator.style.display="block",this.repositionIndicator()):this.indicator.style.display="none"}show(t){const e=this.tabs.find((e=>e.panel===t));e&&this.setActiveTab(e,{scrollBehavior:"smooth"})}render(){const t=this.matches(":dir(rtl)");return nt` +`;var Re=new Set;function Me(t){if(Re.add(t),!document.documentElement.classList.contains("sl-scroll-lock")){const t=function(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}()+function(){const t=Number(getComputedStyle(document.body).paddingRight.replace(/px/,""));return isNaN(t)||!t?0:t}();let e=getComputedStyle(document.documentElement).scrollbarGutter;e&&"auto"!==e||(e="stable"),t<2&&(e=""),document.documentElement.style.setProperty("--sl-scroll-lock-gutter",e),document.documentElement.classList.add("sl-scroll-lock"),document.documentElement.style.setProperty("--sl-scroll-lock-size",`${t}px`)}}function De(t){Re.delete(t),0===Re.size&&(document.documentElement.classList.remove("sl-scroll-lock"),document.documentElement.style.removeProperty("--sl-scroll-lock-size"))}function Be(t,e,o="vertical",i="smooth"){const s=function(t,e){return{top:Math.round(t.getBoundingClientRect().top-e.getBoundingClientRect().top),left:Math.round(t.getBoundingClientRect().left-e.getBoundingClientRect().left)}}(t,e),r=s.top+e.scrollTop,n=s.left+e.scrollLeft,a=e.scrollLeft,l=e.scrollLeft+e.offsetWidth,c=e.scrollTop,h=e.scrollTop+e.offsetHeight;"horizontal"!==o&&"both"!==o||(nl&&e.scrollTo({left:n-e.offsetWidth+t.clientWidth,behavior:i})),"vertical"!==o&&"both"!==o||(rh&&e.scrollTo({top:r-e.offsetHeight+t.clientHeight,behavior:i}))}var Ne=class extends Ht{constructor(){super(...arguments),this.localize=new Pe(this),this.tabs=[],this.focusableTabs=[],this.panels=[],this.hasScrollControls=!1,this.placement="top",this.activation="auto",this.noScrollControls=!1}connectedCallback(){const t=Promise.all([customElements.whenDefined("sl-tab"),customElements.whenDefined("sl-tab-panel")]);super.connectedCallback(),this.resizeObserver=new ResizeObserver((()=>{this.repositionIndicator(),this.updateScrollControls()})),this.mutationObserver=new MutationObserver((t=>{t.some((t=>!["aria-labelledby","aria-controls"].includes(t.attributeName)))&&setTimeout((()=>this.setAriaLabels())),t.some((t=>"disabled"===t.attributeName))&&this.syncTabsAndPanels()})),this.updateComplete.then((()=>{this.syncTabsAndPanels(),this.mutationObserver.observe(this,{attributes:!0,childList:!0,subtree:!0}),this.resizeObserver.observe(this.nav),t.then((()=>{new IntersectionObserver(((t,e)=>{var o;t[0].intersectionRatio>0&&(this.setAriaLabels(),this.setActiveTab(null!=(o=this.getActiveTab())?o:this.tabs[0],{emitEvents:!1}),e.unobserve(t[0].target))})).observe(this.tabGroup)}))}))}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver.disconnect(),this.resizeObserver.unobserve(this.nav)}getAllTabs(){return this.shadowRoot.querySelector('slot[name="nav"]').assignedElements()}getAllPanels(){return[...this.body.assignedElements()].filter((t=>"sl-tab-panel"===t.tagName.toLowerCase()))}getActiveTab(){return this.tabs.find((t=>t.active))}handleClick(t){const e=t.target.closest("sl-tab");(null==e?void 0:e.closest("sl-tab-group"))===this&&null!==e&&this.setActiveTab(e,{scrollBehavior:"smooth"})}handleKeyDown(t){const e=t.target.closest("sl-tab");if((null==e?void 0:e.closest("sl-tab-group"))===this&&(["Enter"," "].includes(t.key)&&null!==e&&(this.setActiveTab(e,{scrollBehavior:"smooth"}),t.preventDefault()),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key))){const e=this.tabs.find((t=>t.matches(":focus"))),o=this.matches(":dir(rtl)");let i=null;if("sl-tab"===(null==e?void 0:e.tagName.toLowerCase())){if("Home"===t.key)i=this.focusableTabs[0];else if("End"===t.key)i=this.focusableTabs[this.focusableTabs.length-1];else if(["top","bottom"].includes(this.placement)&&t.key===(o?"ArrowRight":"ArrowLeft")||["start","end"].includes(this.placement)&&"ArrowUp"===t.key){const t=this.tabs.findIndex((t=>t===e));i=this.findNextFocusableTab(t,"backward")}else if(["top","bottom"].includes(this.placement)&&t.key===(o?"ArrowLeft":"ArrowRight")||["start","end"].includes(this.placement)&&"ArrowDown"===t.key){const t=this.tabs.findIndex((t=>t===e));i=this.findNextFocusableTab(t,"forward")}if(!i)return;i.tabIndex=0,i.focus({preventScroll:!0}),"auto"===this.activation?this.setActiveTab(i,{scrollBehavior:"smooth"}):this.tabs.forEach((t=>{t.tabIndex=t===i?0:-1})),["top","bottom"].includes(this.placement)&&Be(i,this.nav,"horizontal"),t.preventDefault()}}}handleScrollToStart(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft+this.nav.clientWidth:this.nav.scrollLeft-this.nav.clientWidth,behavior:"smooth"})}handleScrollToEnd(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft-this.nav.clientWidth:this.nav.scrollLeft+this.nav.clientWidth,behavior:"smooth"})}setActiveTab(t,e){if(e=c({emitEvents:!0,scrollBehavior:"auto"},e),t!==this.activeTab&&!t.disabled){const o=this.activeTab;this.activeTab=t,this.tabs.forEach((t=>{t.active=t===this.activeTab,t.tabIndex=t===this.activeTab?0:-1})),this.panels.forEach((t=>{var e;return t.active=t.name===(null==(e=this.activeTab)?void 0:e.panel)})),this.syncIndicator(),["top","bottom"].includes(this.placement)&&Be(this.activeTab,this.nav,"horizontal",e.scrollBehavior),e.emitEvents&&(o&&this.emit("sl-tab-hide",{detail:{name:o.panel}}),this.emit("sl-tab-show",{detail:{name:this.activeTab.panel}}))}}setAriaLabels(){this.tabs.forEach((t=>{const e=this.panels.find((e=>e.name===t.panel));e&&(t.setAttribute("aria-controls",e.getAttribute("id")),e.setAttribute("aria-labelledby",t.getAttribute("id")))}))}repositionIndicator(){const t=this.getActiveTab();if(!t)return;const e=t.clientWidth,o=t.clientHeight,i=this.matches(":dir(rtl)"),s=this.getAllTabs(),r=s.slice(0,s.indexOf(t)).reduce(((t,e)=>({left:t.left+e.clientWidth,top:t.top+e.clientHeight})),{left:0,top:0});switch(this.placement){case"top":case"bottom":this.indicator.style.width=`${e}px`,this.indicator.style.height="auto",this.indicator.style.translate=i?-1*r.left+"px":`${r.left}px`;break;case"start":case"end":this.indicator.style.width="auto",this.indicator.style.height=`${o}px`,this.indicator.style.translate=`0 ${r.top}px`}}syncTabsAndPanels(){this.tabs=this.getAllTabs(),this.focusableTabs=this.tabs.filter((t=>!t.disabled)),this.panels=this.getAllPanels(),this.syncIndicator(),this.updateComplete.then((()=>this.updateScrollControls()))}findNextFocusableTab(t,e){let o=null;const i="forward"===e?1:-1;let s=t+i;for(;tthis.nav.clientWidth+1}syncIndicator(){this.getActiveTab()?(this.indicator.style.display="block",this.repositionIndicator()):this.indicator.style.display="none"}show(t){const e=this.tabs.find((e=>e.panel===t));e&&this.setActiveTab(e,{scrollBehavior:"smooth"})}render(){const t=this.matches(":dir(rtl)");return nt`
@@ -800,7 +800,7 @@ const me=Symbol.for(""),be=t=>{if(t?.r===me)return t?._$litStatic$},ge=(t,...e)=
- `}};Ue.styles=[Dt,Re],Ue.dependencies={"sl-icon-button":we},d([Ht(".tab-group")],Ue.prototype,"tabGroup",2),d([Ht(".tab-group__body")],Ue.prototype,"body",2),d([Ht(".tab-group__nav")],Ue.prototype,"nav",2),d([Ht(".tab-group__indicator")],Ue.prototype,"indicator",2),d([Ut()],Ue.prototype,"hasScrollControls",2),d([Nt()],Ue.prototype,"placement",2),d([Nt()],Ue.prototype,"activation",2),d([Nt({attribute:"no-scroll-controls",type:Boolean})],Ue.prototype,"noScrollControls",2),d([Rt("noScrollControls",{waitUntilFirstUpdate:!0})],Ue.prototype,"updateScrollControls",1),d([Rt("placement",{waitUntilFirstUpdate:!0})],Ue.prototype,"syncIndicator",1),Ue.define("sl-tab-group");var He=k` + `}};Ne.styles=[Rt,Fe],Ne.dependencies={"sl-icon-button":ye},d([Ut(".tab-group")],Ne.prototype,"tabGroup",2),d([Ut(".tab-group__body")],Ne.prototype,"body",2),d([Ut(".tab-group__nav")],Ne.prototype,"nav",2),d([Ut(".tab-group__indicator")],Ne.prototype,"indicator",2),d([Nt()],Ne.prototype,"hasScrollControls",2),d([Bt()],Ne.prototype,"placement",2),d([Bt()],Ne.prototype,"activation",2),d([Bt({attribute:"no-scroll-controls",type:Boolean})],Ne.prototype,"noScrollControls",2),d([Ft("noScrollControls",{waitUntilFirstUpdate:!0})],Ne.prototype,"updateScrollControls",1),d([Ft("placement",{waitUntilFirstUpdate:!0})],Ne.prototype,"syncIndicator",1),Ne.define("sl-tab-group");var Ue=k` :host { --padding: 0; @@ -815,12 +815,12 @@ const me=Symbol.for(""),be=t=>{if(t?.r===me)return t?._$litStatic$},ge=(t,...e)= display: block; padding: var(--padding); } -`,Ie=0,Ve=class extends It{constructor(){super(...arguments),this.attrId=++Ie,this.componentId=`sl-tab-panel-${this.attrId}`,this.name="",this.active=!1}connectedCallback(){super.connectedCallback(),this.id=this.id.length>0?this.id:this.componentId,this.setAttribute("role","tabpanel")}handleActiveChange(){this.setAttribute("aria-hidden",this.active?"false":"true")}render(){return nt` +`,He=0,Ie=class extends Ht{constructor(){super(...arguments),this.attrId=++He,this.componentId=`sl-tab-panel-${this.attrId}`,this.name="",this.active=!1}connectedCallback(){super.connectedCallback(),this.id=this.id.length>0?this.id:this.componentId,this.setAttribute("role","tabpanel")}handleActiveChange(){this.setAttribute("aria-hidden",this.active?"false":"true")}render(){return nt` - `}};Ve.styles=[Dt,He],d([Nt({reflect:!0})],Ve.prototype,"name",2),d([Nt({type:Boolean,reflect:!0})],Ve.prototype,"active",2),d([Rt("active")],Ve.prototype,"handleActiveChange",1),Ve.define("sl-tab-panel");var We=k` + `}};Ie.styles=[Rt,Ue],d([Bt({reflect:!0})],Ie.prototype,"name",2),d([Bt({type:Boolean,reflect:!0})],Ie.prototype,"active",2),d([Ft("active")],Ie.prototype,"handleActiveChange",1),Ie.define("sl-tab-panel");var Ve=k` :host { --max-width: 20rem; --hide-delay: 0ms; @@ -872,7 +872,7 @@ const me=Symbol.for(""),be=t=>{if(t?.r===me)return t?._$litStatic$},ge=(t,...e)= user-select: none; -webkit-user-select: none; } -`,je=k` +`,We=k` :host { --arrow-color: var(--sl-color-neutral-1000); --arrow-size: 6px; @@ -930,29 +930,29 @@ const me=Symbol.for(""),be=t=>{if(t?.r===me)return t?._$litStatic$},ge=(t,...e)= var(--hover-bridge-bottom-left-x, 0) var(--hover-bridge-bottom-left-y, 0) ); } -`;const qe=Math.min,Ke=Math.max,Ze=Math.round,Ge=Math.floor,Xe=t=>({x:t,y:t}),Ye={left:"right",right:"left",bottom:"top",top:"bottom"},Je={start:"end",end:"start"};function Qe(t,e,o){return Ke(t,qe(e,o))}function to(t,e){return"function"==typeof t?t(e):t}function eo(t){return t.split("-")[0]}function oo(t){return t.split("-")[1]}function io(t){return"x"===t?"y":"x"}function so(t){return"y"===t?"height":"width"}function ro(t){return["top","bottom"].includes(eo(t))?"y":"x"}function no(t){return io(ro(t))}function ao(t){return t.replace(/start|end/g,(t=>Je[t]))}function lo(t){return t.replace(/left|right|bottom|top/g,(t=>Ye[t]))}function co(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function ho(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function po(t,e,o){let{reference:i,floating:s}=t;const r=ro(e),n=no(e),a=so(n),l=eo(e),c="y"===r,h=i.x+i.width/2-s.width/2,d=i.y+i.height/2-s.height/2,p=i[a]/2-s[a]/2;let u;switch(l){case"top":u={x:h,y:i.y-s.height};break;case"bottom":u={x:h,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:d};break;case"left":u={x:i.x-s.width,y:d};break;default:u={x:i.x,y:i.y}}switch(oo(e)){case"start":u[n]-=p*(o&&c?-1:1);break;case"end":u[n]+=p*(o&&c?-1:1)}return u}async function uo(t,e){var o;void 0===e&&(e={});const{x:i,y:s,platform:r,rects:n,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:p=!1,padding:u=0}=to(e,t),f=co(u),m=a[p?"floating"===d?"reference":"floating":d],b=ho(await r.getClippingRect({element:null==(o=await(null==r.isElement?void 0:r.isElement(m)))||o?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),g="floating"===d?{...n.floating,x:i,y:s}:n.reference,v=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),y=await(null==r.isElement?void 0:r.isElement(v))&&await(null==r.getScale?void 0:r.getScale(v))||{x:1,y:1},w=ho(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:v,strategy:l}):g);return{top:(b.top-w.top+f.top)/y.y,bottom:(w.bottom-b.bottom+f.bottom)/y.y,left:(b.left-w.left+f.left)/y.x,right:(w.right-b.right+f.right)/y.x}}const fo=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var o,i;const{x:s,y:r,placement:n,middlewareData:a}=e,l=await async function(t,e){const{placement:o,platform:i,elements:s}=t,r=await(null==i.isRTL?void 0:i.isRTL(s.floating)),n=eo(o),a=oo(o),l="y"===ro(o),c=["left","top"].includes(n)?-1:1,h=r&&l?-1:1,d=to(e,t);let{mainAxis:p,crossAxis:u,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof f&&(u="end"===a?-1*f:f),l?{x:u*h,y:p*c}:{x:p*c,y:u*h}}(e,t);return n===(null==(o=a.offset)?void 0:o.placement)&&null!=(i=a.arrow)&&i.alignmentOffset?{}:{x:s+l.x,y:r+l.y,data:{...l,placement:n}}}}};function mo(t){return vo(t)?(t.nodeName||"").toLowerCase():"#document"}function bo(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function go(t){var e;return null==(e=(vo(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function vo(t){return t instanceof Node||t instanceof bo(t).Node}function yo(t){return t instanceof Element||t instanceof bo(t).Element}function wo(t){return t instanceof HTMLElement||t instanceof bo(t).HTMLElement}function _o(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof bo(t).ShadowRoot)}function xo(t){const{overflow:e,overflowX:o,overflowY:i,display:s}=Eo(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+o)&&!["inline","contents"].includes(s)}function $o(t){return["table","td","th"].includes(mo(t))}function ko(t){const e=Ao(),o=Eo(t);return"none"!==o.transform||"none"!==o.perspective||!!o.containerType&&"normal"!==o.containerType||!e&&!!o.backdropFilter&&"none"!==o.backdropFilter||!e&&!!o.filter&&"none"!==o.filter||["transform","perspective","filter"].some((t=>(o.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(o.contain||"").includes(t)))}function Ao(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Co(t){return["html","body","#document"].includes(mo(t))}function Eo(t){return bo(t).getComputedStyle(t)}function So(t){return yo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function zo(t){if("html"===mo(t))return t;const e=t.assignedSlot||t.parentNode||_o(t)&&t.host||go(t);return _o(e)?e.host:e}function To(t){const e=zo(t);return Co(e)?t.ownerDocument?t.ownerDocument.body:t.body:wo(e)&&xo(e)?e:To(e)}function Po(t,e,o){var i;void 0===e&&(e=[]),void 0===o&&(o=!0);const s=To(t),r=s===(null==(i=t.ownerDocument)?void 0:i.body),n=bo(s);return r?e.concat(n,n.visualViewport||[],xo(s)?s:[],n.frameElement&&o?Po(n.frameElement):[]):e.concat(s,Po(s,[],o))}function Lo(t){const e=Eo(t);let o=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const s=wo(t),r=s?t.offsetWidth:o,n=s?t.offsetHeight:i,a=Ze(o)!==r||Ze(i)!==n;return a&&(o=r,i=n),{width:o,height:i,$:a}}function Oo(t){return yo(t)?t:t.contextElement}function Fo(t){const e=Oo(t);if(!wo(e))return Xe(1);const o=e.getBoundingClientRect(),{width:i,height:s,$:r}=Lo(e);let n=(r?Ze(o.width):o.width)/i,a=(r?Ze(o.height):o.height)/s;return n&&Number.isFinite(n)||(n=1),a&&Number.isFinite(a)||(a=1),{x:n,y:a}}const Ro=Xe(0);function Do(t){const e=bo(t);return Ao()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Ro}function Mo(t,e,o,i){void 0===e&&(e=!1),void 0===o&&(o=!1);const s=t.getBoundingClientRect(),r=Oo(t);let n=Xe(1);e&&(i?yo(i)&&(n=Fo(i)):n=Fo(t));const a=function(t,e,o){return void 0===e&&(e=!1),!(!o||e&&o!==bo(t))&&e}(r,o,i)?Do(r):Xe(0);let l=(s.left+a.x)/n.x,c=(s.top+a.y)/n.y,h=s.width/n.x,d=s.height/n.y;if(r){const t=bo(r),e=i&&yo(i)?bo(i):i;let o=t,s=o.frameElement;for(;s&&i&&e!==o;){const t=Fo(s),e=s.getBoundingClientRect(),i=Eo(s),r=e.left+(s.clientLeft+parseFloat(i.paddingLeft))*t.x,n=e.top+(s.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,h*=t.x,d*=t.y,l+=r,c+=n,o=bo(s),s=o.frameElement}}return ho({width:h,height:d,x:l,y:c})}const Bo=[":popover-open",":modal"];function No(t){return Bo.some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function Uo(t){return Mo(go(t)).left+So(t).scrollLeft}function Ho(t,e,o){let i;if("viewport"===e)i=function(t,e){const o=bo(t),i=go(t),s=o.visualViewport;let r=i.clientWidth,n=i.clientHeight,a=0,l=0;if(s){r=s.width,n=s.height;const t=Ao();(!t||t&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:r,height:n,x:a,y:l}}(t,o);else if("document"===e)i=function(t){const e=go(t),o=So(t),i=t.ownerDocument.body,s=Ke(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),r=Ke(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let n=-o.scrollLeft+Uo(t);const a=-o.scrollTop;return"rtl"===Eo(i).direction&&(n+=Ke(e.clientWidth,i.clientWidth)-s),{width:s,height:r,x:n,y:a}}(go(t));else if(yo(e))i=function(t,e){const o=Mo(t,!0,"fixed"===e),i=o.top+t.clientTop,s=o.left+t.clientLeft,r=wo(t)?Fo(t):Xe(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:s*r.x,y:i*r.y}}(e,o);else{const o=Do(t);i={...e,x:e.x-o.x,y:e.y-o.y}}return ho(i)}function Io(t,e){const o=zo(t);return!(o===e||!yo(o)||Co(o))&&("fixed"===Eo(o).position||Io(o,e))}function Vo(t,e,o){const i=wo(e),s=go(e),r="fixed"===o,n=Mo(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=Xe(0);if(i||!i&&!r)if(("body"!==mo(e)||xo(s))&&(a=So(e)),i){const t=Mo(e,!0,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else s&&(l.x=Uo(s));return{x:n.left+a.scrollLeft-l.x,y:n.top+a.scrollTop-l.y,width:n.width,height:n.height}}function Wo(t,e){return wo(t)&&"fixed"!==Eo(t).position?e?e(t):t.offsetParent:null}function jo(t,e){const o=bo(t);if(!wo(t)||No(t))return o;let i=Wo(t,e);for(;i&&$o(i)&&"static"===Eo(i).position;)i=Wo(i,e);return i&&("html"===mo(i)||"body"===mo(i)&&"static"===Eo(i).position&&!ko(i))?o:i||function(t){let e=zo(t);for(;wo(e)&&!Co(e);){if(ko(e))return e;e=zo(e)}return null}(t)||o}const qo={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:o,offsetParent:i,strategy:s}=t;const r="fixed"===s,n=go(i),a=!!e&&No(e.floating);if(i===n||a&&r)return o;let l={scrollLeft:0,scrollTop:0},c=Xe(1);const h=Xe(0),d=wo(i);if((d||!d&&!r)&&(("body"!==mo(i)||xo(n))&&(l=So(i)),wo(i))){const t=Mo(i);c=Fo(i),h.x=t.x+i.clientLeft,h.y=t.y+i.clientTop}return{width:o.width*c.x,height:o.height*c.y,x:o.x*c.x-l.scrollLeft*c.x+h.x,y:o.y*c.y-l.scrollTop*c.y+h.y}},getDocumentElement:go,getClippingRect:function(t){let{element:e,boundary:o,rootBoundary:i,strategy:s}=t;const r=[..."clippingAncestors"===o?function(t,e){const o=e.get(t);if(o)return o;let i=Po(t,[],!1).filter((t=>yo(t)&&"body"!==mo(t))),s=null;const r="fixed"===Eo(t).position;let n=r?zo(t):t;for(;yo(n)&&!Co(n);){const e=Eo(n),o=ko(n);o||"fixed"!==e.position||(s=null),(r?!o&&!s:!o&&"static"===e.position&&s&&["absolute","fixed"].includes(s.position)||xo(n)&&!o&&Io(t,n))?i=i.filter((t=>t!==n)):s=e,n=zo(n)}return e.set(t,i),i}(e,this._c):[].concat(o),i],n=r[0],a=r.reduce(((t,o)=>{const i=Ho(e,o,s);return t.top=Ke(i.top,t.top),t.right=qe(i.right,t.right),t.bottom=qe(i.bottom,t.bottom),t.left=Ke(i.left,t.left),t}),Ho(e,n,s));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:jo,getElementRects:async function(t){const e=this.getOffsetParent||jo,o=this.getDimensions;return{reference:Vo(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,...await o(t.floating)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:o}=Lo(t);return{width:e,height:o}},getScale:Fo,isElement:yo,isRTL:function(t){return"rtl"===Eo(t).direction}};function Ko(t,e,o,i){void 0===i&&(i={});const{ancestorScroll:s=!0,ancestorResize:r=!0,elementResize:n="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=i,c=Oo(t),h=s||r?[...c?Po(c):[],...Po(e)]:[];h.forEach((t=>{s&&t.addEventListener("scroll",o,{passive:!0}),r&&t.addEventListener("resize",o)}));const d=c&&a?function(t,e){let o,i=null;const s=go(t);function r(){var t;clearTimeout(o),null==(t=i)||t.disconnect(),i=null}return function n(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),r();const{left:c,top:h,width:d,height:p}=t.getBoundingClientRect();if(a||e(),!d||!p)return;const u={rootMargin:-Ge(h)+"px "+-Ge(s.clientWidth-(c+d))+"px "+-Ge(s.clientHeight-(h+p))+"px "+-Ge(c)+"px",threshold:Ke(0,qe(1,l))||1};let f=!0;function m(t){const e=t[0].intersectionRatio;if(e!==l){if(!f)return n();e?n(!1,e):o=setTimeout((()=>{n(!1,1e-7)}),100)}f=!1}try{i=new IntersectionObserver(m,{...u,root:s.ownerDocument})}catch(t){i=new IntersectionObserver(m,u)}i.observe(t)}(!0),r}(c,o):null;let p,u=-1,f=null;n&&(f=new ResizeObserver((t=>{let[i]=t;i&&i.target===c&&f&&(f.unobserve(e),cancelAnimationFrame(u),u=requestAnimationFrame((()=>{var t;null==(t=f)||t.observe(e)}))),o()})),c&&!l&&f.observe(c),f.observe(e));let m=l?Mo(t):null;return l&&function e(){const i=Mo(t);!m||i.x===m.x&&i.y===m.y&&i.width===m.width&&i.height===m.height||o();m=i,p=requestAnimationFrame(e)}(),o(),()=>{var t;h.forEach((t=>{s&&t.removeEventListener("scroll",o),r&&t.removeEventListener("resize",o)})),null==d||d(),null==(t=f)||t.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const Zo=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:o,y:i,placement:s}=e,{mainAxis:r=!0,crossAxis:n=!1,limiter:a={fn:t=>{let{x:e,y:o}=t;return{x:e,y:o}}},...l}=to(t,e),c={x:o,y:i},h=await uo(e,l),d=ro(eo(s)),p=io(d);let u=c[p],f=c[d];if(r){const t="y"===p?"bottom":"right";u=Qe(u+h["y"===p?"top":"left"],u,u-h[t])}if(n){const t="y"===d?"bottom":"right";f=Qe(f+h["y"===d?"top":"left"],f,f-h[t])}const m=a.fn({...e,[p]:u,[d]:f});return{...m,data:{x:m.x-o,y:m.y-i}}}}},Go=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var o,i;const{placement:s,middlewareData:r,rects:n,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...b}=to(t,e);if(null!=(o=r.arrow)&&o.alignmentOffset)return{};const g=eo(s),v=eo(a)===a,y=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(v||!m?[lo(a)]:function(t){const e=lo(t);return[ao(t),e,ao(e)]}(a));p||"none"===f||w.push(...function(t,e,o,i){const s=oo(t);let r=function(t,e,o){const i=["left","right"],s=["right","left"],r=["top","bottom"],n=["bottom","top"];switch(t){case"top":case"bottom":return o?e?s:i:e?i:s;case"left":case"right":return e?r:n;default:return[]}}(eo(t),"start"===o,i);return s&&(r=r.map((t=>t+"-"+s)),e&&(r=r.concat(r.map(ao)))),r}(a,m,f,y));const _=[a,...w],x=await uo(e,b),$=[];let k=(null==(i=r.flip)?void 0:i.overflows)||[];if(h&&$.push(x[g]),d){const t=function(t,e,o){void 0===o&&(o=!1);const i=oo(t),s=no(t),r=so(s);let n="x"===s?i===(o?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[r]>e.floating[r]&&(n=lo(n)),[n,lo(n)]}(s,n,y);$.push(x[t[0]],x[t[1]])}if(k=[...k,{placement:s,overflows:$}],!$.every((t=>t<=0))){var A,C;const t=((null==(A=r.flip)?void 0:A.index)||0)+1,e=_[t];if(e)return{data:{index:t,overflows:k},reset:{placement:e}};let o=null==(C=k.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:C.placement;if(!o)switch(u){case"bestFit":{var E;const t=null==(E=k.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:E[0];t&&(o=t);break}case"initialPlacement":o=a}if(s!==o)return{reset:{placement:o}}}return{}}}},Xo=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:o,rects:i,platform:s,elements:r}=e,{apply:n=(()=>{}),...a}=to(t,e),l=await uo(e,a),c=eo(o),h=oo(o),d="y"===ro(o),{width:p,height:u}=i.floating;let f,m;"top"===c||"bottom"===c?(f=c,m=h===(await(null==s.isRTL?void 0:s.isRTL(r.floating))?"start":"end")?"left":"right"):(m=c,f="end"===h?"top":"bottom");const b=u-l[f],g=p-l[m],v=!e.middlewareData.shift;let y=b,w=g;if(d){const t=p-l.left-l.right;w=h||v?qe(g,t):t}else{const t=u-l.top-l.bottom;y=h||v?qe(b,t):t}if(v&&!h){const t=Ke(l.left,0),e=Ke(l.right,0),o=Ke(l.top,0),i=Ke(l.bottom,0);d?w=p-2*(0!==t||0!==e?t+e:Ke(l.left,l.right)):y=u-2*(0!==o||0!==i?o+i:Ke(l.top,l.bottom))}await n({...e,availableWidth:w,availableHeight:y});const _=await s.getDimensions(r.floating);return p!==_.width||u!==_.height?{reset:{rects:!0}}:{}}}},Yo=t=>({name:"arrow",options:t,async fn(e){const{x:o,y:i,placement:s,rects:r,platform:n,elements:a,middlewareData:l}=e,{element:c,padding:h=0}=to(t,e)||{};if(null==c)return{};const d=co(h),p={x:o,y:i},u=no(s),f=so(u),m=await n.getDimensions(c),b="y"===u,g=b?"top":"left",v=b?"bottom":"right",y=b?"clientHeight":"clientWidth",w=r.reference[f]+r.reference[u]-p[u]-r.floating[f],_=p[u]-r.reference[u],x=await(null==n.getOffsetParent?void 0:n.getOffsetParent(c));let $=x?x[y]:0;$&&await(null==n.isElement?void 0:n.isElement(x))||($=a.floating[y]||r.floating[f]);const k=w/2-_/2,A=$/2-m[f]/2-1,C=qe(d[g],A),E=qe(d[v],A),S=C,z=$-m[f]-E,T=$/2-m[f]/2+k,P=Qe(S,T,z),L=!l.arrow&&null!=oo(s)&&T!==P&&r.reference[f]/2-(T{const i=new Map,s={platform:qo,...o},r={...s.platform,_c:i};return(async(t,e,o)=>{const{placement:i="bottom",strategy:s="absolute",middleware:r=[],platform:n}=o,a=r.filter(Boolean),l=await(null==n.isRTL?void 0:n.isRTL(e));let c=await n.getElementRects({reference:t,floating:e,strategy:s}),{x:h,y:d}=po(c,i,l),p=i,u={},f=0;for(let o=0;o{if(this.hoverBridge&&this.anchorEl){const t=this.anchorEl.getBoundingClientRect(),e=this.popup.getBoundingClientRect();let o=0,i=0,s=0,r=0,n=0,a=0,l=0,c=0;this.placement.includes("top")||this.placement.includes("bottom")?t.top{this.reposition()})))}async stop(){return new Promise((t=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame((()=>t()))):t()}))}reposition(){if(!this.active||!this.anchorEl)return;const t=[fo({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?t.push(Xo({apply:({rects:t})=>{const e="width"===this.sync||"both"===this.sync,o="height"===this.sync||"both"===this.sync;this.popup.style.width=e?`${t.reference.width}px`:"",this.popup.style.height=o?`${t.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&t.push(Go({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:"best-fit"===this.flipFallbackStrategy?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&t.push(Zo({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?t.push(Xo({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:t,availableHeight:e})=>{"vertical"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-height",`${e}px`):this.style.removeProperty("--auto-size-available-height"),"horizontal"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-width",`${t}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&t.push(Yo({element:this.arrowEl,padding:this.arrowPadding}));const e="absolute"===this.strategy?t=>qo.getOffsetParent(t,Qo):qo.getOffsetParent;Jo(this.anchorEl,this.popup,{placement:this.placement,middleware:t,strategy:this.strategy,platform:h(c({},qo),{getOffsetParent:e})}).then((({x:t,y:e,middlewareData:o,placement:i})=>{const s=this.matches(":dir(rtl)"),r={top:"bottom",right:"left",bottom:"top",left:"right"}[i.split("-")[0]];if(this.setAttribute("data-current-placement",i),Object.assign(this.popup.style,{left:`${t}px`,top:`${e}px`}),this.arrow){const t=o.arrow.x,e=o.arrow.y;let i="",n="",a="",l="";if("start"===this.arrowPlacement){const o="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";i="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",n=s?o:"",l=s?"":o}else if("end"===this.arrowPlacement){const o="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";n=s?"":o,l=s?o:"",a="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else"center"===this.arrowPlacement?(l="number"==typeof t?"calc(50% - var(--arrow-size-diagonal))":"",i="number"==typeof e?"calc(50% - var(--arrow-size-diagonal))":""):(l="number"==typeof t?`${t}px`:"",i="number"==typeof e?`${e}px`:"");Object.assign(this.arrowEl.style,{top:i,right:n,bottom:a,left:l,[r]:"calc(var(--arrow-size-diagonal) * -1)"})}})),requestAnimationFrame((()=>this.updateHoverBridge())),this.emit("sl-reposition")}render(){return nt` +`;const je=Math.min,qe=Math.max,Ke=Math.round,Ze=Math.floor,Ge=t=>({x:t,y:t}),Xe={left:"right",right:"left",bottom:"top",top:"bottom"},Ye={start:"end",end:"start"};function Je(t,e,o){return qe(t,je(e,o))}function Qe(t,e){return"function"==typeof t?t(e):t}function to(t){return t.split("-")[0]}function eo(t){return t.split("-")[1]}function oo(t){return"x"===t?"y":"x"}function io(t){return"y"===t?"height":"width"}function so(t){return["top","bottom"].includes(to(t))?"y":"x"}function ro(t){return oo(so(t))}function no(t){return t.replace(/start|end/g,(t=>Ye[t]))}function ao(t){return t.replace(/left|right|bottom|top/g,(t=>Xe[t]))}function lo(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function co(t){const{x:e,y:o,width:i,height:s}=t;return{width:i,height:s,top:o,left:e,right:e+i,bottom:o+s,x:e,y:o}}function ho(t,e,o){let{reference:i,floating:s}=t;const r=so(e),n=ro(e),a=io(n),l=to(e),c="y"===r,h=i.x+i.width/2-s.width/2,d=i.y+i.height/2-s.height/2,p=i[a]/2-s[a]/2;let u;switch(l){case"top":u={x:h,y:i.y-s.height};break;case"bottom":u={x:h,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:d};break;case"left":u={x:i.x-s.width,y:d};break;default:u={x:i.x,y:i.y}}switch(eo(e)){case"start":u[n]-=p*(o&&c?-1:1);break;case"end":u[n]+=p*(o&&c?-1:1)}return u}async function po(t,e){var o;void 0===e&&(e={});const{x:i,y:s,platform:r,rects:n,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:p=!1,padding:u=0}=Qe(e,t),f=lo(u),m=a[p?"floating"===d?"reference":"floating":d],b=co(await r.getClippingRect({element:null==(o=await(null==r.isElement?void 0:r.isElement(m)))||o?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),g="floating"===d?{x:i,y:s,width:n.floating.width,height:n.floating.height}:n.reference,v=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),y=await(null==r.isElement?void 0:r.isElement(v))&&await(null==r.getScale?void 0:r.getScale(v))||{x:1,y:1},w=co(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:v,strategy:l}):g);return{top:(b.top-w.top+f.top)/y.y,bottom:(w.bottom-b.bottom+f.bottom)/y.y,left:(b.left-w.left+f.left)/y.x,right:(w.right-b.right+f.right)/y.x}}function uo(t){return bo(t)?(t.nodeName||"").toLowerCase():"#document"}function fo(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function mo(t){var e;return null==(e=(bo(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function bo(t){return t instanceof Node||t instanceof fo(t).Node}function go(t){return t instanceof Element||t instanceof fo(t).Element}function vo(t){return t instanceof HTMLElement||t instanceof fo(t).HTMLElement}function yo(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof fo(t).ShadowRoot)}function wo(t){const{overflow:e,overflowX:o,overflowY:i,display:s}=Co(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+o)&&!["inline","contents"].includes(s)}function _o(t){return["table","td","th"].includes(uo(t))}function xo(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function $o(t){const e=ko(),o=go(t)?Co(t):t;return"none"!==o.transform||"none"!==o.perspective||!!o.containerType&&"normal"!==o.containerType||!e&&!!o.backdropFilter&&"none"!==o.backdropFilter||!e&&!!o.filter&&"none"!==o.filter||["transform","perspective","filter"].some((t=>(o.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(o.contain||"").includes(t)))}function ko(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Ao(t){return["html","body","#document"].includes(uo(t))}function Co(t){return fo(t).getComputedStyle(t)}function Eo(t){return go(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function So(t){if("html"===uo(t))return t;const e=t.assignedSlot||t.parentNode||yo(t)&&t.host||mo(t);return yo(e)?e.host:e}function zo(t){const e=So(t);return Ao(e)?t.ownerDocument?t.ownerDocument.body:t.body:vo(e)&&wo(e)?e:zo(e)}function To(t,e,o){var i;void 0===e&&(e=[]),void 0===o&&(o=!0);const s=zo(t),r=s===(null==(i=t.ownerDocument)?void 0:i.body),n=fo(s);if(r){const t=Po(n);return e.concat(n,n.visualViewport||[],wo(s)?s:[],t&&o?To(t):[])}return e.concat(s,To(s,[],o))}function Po(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Lo(t){const e=Co(t);let o=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const s=vo(t),r=s?t.offsetWidth:o,n=s?t.offsetHeight:i,a=Ke(o)!==r||Ke(i)!==n;return a&&(o=r,i=n),{width:o,height:i,$:a}}function Oo(t){return go(t)?t:t.contextElement}function Fo(t){const e=Oo(t);if(!vo(e))return Ge(1);const o=e.getBoundingClientRect(),{width:i,height:s,$:r}=Lo(e);let n=(r?Ke(o.width):o.width)/i,a=(r?Ke(o.height):o.height)/s;return n&&Number.isFinite(n)||(n=1),a&&Number.isFinite(a)||(a=1),{x:n,y:a}}const Ro=Ge(0);function Mo(t){const e=fo(t);return ko()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Ro}function Do(t,e,o,i){void 0===e&&(e=!1),void 0===o&&(o=!1);const s=t.getBoundingClientRect(),r=Oo(t);let n=Ge(1);e&&(i?go(i)&&(n=Fo(i)):n=Fo(t));const a=function(t,e,o){return void 0===e&&(e=!1),!(!o||e&&o!==fo(t))&&e}(r,o,i)?Mo(r):Ge(0);let l=(s.left+a.x)/n.x,c=(s.top+a.y)/n.y,h=s.width/n.x,d=s.height/n.y;if(r){const t=fo(r),e=i&&go(i)?fo(i):i;let o=t,s=Po(o);for(;s&&i&&e!==o;){const t=Fo(s),e=s.getBoundingClientRect(),i=Co(s),r=e.left+(s.clientLeft+parseFloat(i.paddingLeft))*t.x,n=e.top+(s.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,h*=t.x,d*=t.y,l+=r,c+=n,o=fo(s),s=Po(o)}}return co({width:h,height:d,x:l,y:c})}function Bo(t){return Do(mo(t)).left+Eo(t).scrollLeft}function No(t,e,o){let i;if("viewport"===e)i=function(t,e){const o=fo(t),i=mo(t),s=o.visualViewport;let r=i.clientWidth,n=i.clientHeight,a=0,l=0;if(s){r=s.width,n=s.height;const t=ko();(!t||t&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:r,height:n,x:a,y:l}}(t,o);else if("document"===e)i=function(t){const e=mo(t),o=Eo(t),i=t.ownerDocument.body,s=qe(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),r=qe(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let n=-o.scrollLeft+Bo(t);const a=-o.scrollTop;return"rtl"===Co(i).direction&&(n+=qe(e.clientWidth,i.clientWidth)-s),{width:s,height:r,x:n,y:a}}(mo(t));else if(go(e))i=function(t,e){const o=Do(t,!0,"fixed"===e),i=o.top+t.clientTop,s=o.left+t.clientLeft,r=vo(t)?Fo(t):Ge(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:s*r.x,y:i*r.y}}(e,o);else{const o=Mo(t);i={...e,x:e.x-o.x,y:e.y-o.y}}return co(i)}function Uo(t,e){const o=So(t);return!(o===e||!go(o)||Ao(o))&&("fixed"===Co(o).position||Uo(o,e))}function Ho(t,e,o){const i=vo(e),s=mo(e),r="fixed"===o,n=Do(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=Ge(0);if(i||!i&&!r)if(("body"!==uo(e)||wo(s))&&(a=Eo(e)),i){const t=Do(e,!0,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else s&&(l.x=Bo(s));return{x:n.left+a.scrollLeft-l.x,y:n.top+a.scrollTop-l.y,width:n.width,height:n.height}}function Io(t){return"static"===Co(t).position}function Vo(t,e){return vo(t)&&"fixed"!==Co(t).position?e?e(t):t.offsetParent:null}function Wo(t,e){const o=fo(t);if(xo(t))return o;if(!vo(t)){let e=So(t);for(;e&&!Ao(e);){if(go(e)&&!Io(e))return e;e=So(e)}return o}let i=Vo(t,e);for(;i&&_o(i)&&Io(i);)i=Vo(i,e);return i&&Ao(i)&&Io(i)&&!$o(i)?o:i||function(t){let e=So(t);for(;vo(e)&&!Ao(e);){if($o(e))return e;if(xo(e))return null;e=So(e)}return null}(t)||o}const jo={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:o,offsetParent:i,strategy:s}=t;const r="fixed"===s,n=mo(i),a=!!e&&xo(e.floating);if(i===n||a&&r)return o;let l={scrollLeft:0,scrollTop:0},c=Ge(1);const h=Ge(0),d=vo(i);if((d||!d&&!r)&&(("body"!==uo(i)||wo(n))&&(l=Eo(i)),vo(i))){const t=Do(i);c=Fo(i),h.x=t.x+i.clientLeft,h.y=t.y+i.clientTop}return{width:o.width*c.x,height:o.height*c.y,x:o.x*c.x-l.scrollLeft*c.x+h.x,y:o.y*c.y-l.scrollTop*c.y+h.y}},getDocumentElement:mo,getClippingRect:function(t){let{element:e,boundary:o,rootBoundary:i,strategy:s}=t;const r=[..."clippingAncestors"===o?xo(e)?[]:function(t,e){const o=e.get(t);if(o)return o;let i=To(t,[],!1).filter((t=>go(t)&&"body"!==uo(t))),s=null;const r="fixed"===Co(t).position;let n=r?So(t):t;for(;go(n)&&!Ao(n);){const e=Co(n),o=$o(n);o||"fixed"!==e.position||(s=null),(r?!o&&!s:!o&&"static"===e.position&&s&&["absolute","fixed"].includes(s.position)||wo(n)&&!o&&Uo(t,n))?i=i.filter((t=>t!==n)):s=e,n=So(n)}return e.set(t,i),i}(e,this._c):[].concat(o),i],n=r[0],a=r.reduce(((t,o)=>{const i=No(e,o,s);return t.top=qe(i.top,t.top),t.right=je(i.right,t.right),t.bottom=je(i.bottom,t.bottom),t.left=qe(i.left,t.left),t}),No(e,n,s));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Wo,getElementRects:async function(t){const e=this.getOffsetParent||Wo,o=this.getDimensions,i=await o(t.floating);return{reference:Ho(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:o}=Lo(t);return{width:e,height:o}},getScale:Fo,isElement:go,isRTL:function(t){return"rtl"===Co(t).direction}};function qo(t,e,o,i){void 0===i&&(i={});const{ancestorScroll:s=!0,ancestorResize:r=!0,elementResize:n="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=i,c=Oo(t),h=s||r?[...c?To(c):[],...To(e)]:[];h.forEach((t=>{s&&t.addEventListener("scroll",o,{passive:!0}),r&&t.addEventListener("resize",o)}));const d=c&&a?function(t,e){let o,i=null;const s=mo(t);function r(){var t;clearTimeout(o),null==(t=i)||t.disconnect(),i=null}return function n(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),r();const{left:c,top:h,width:d,height:p}=t.getBoundingClientRect();if(a||e(),!d||!p)return;const u={rootMargin:-Ze(h)+"px "+-Ze(s.clientWidth-(c+d))+"px "+-Ze(s.clientHeight-(h+p))+"px "+-Ze(c)+"px",threshold:qe(0,je(1,l))||1};let f=!0;function m(t){const e=t[0].intersectionRatio;if(e!==l){if(!f)return n();e?n(!1,e):o=setTimeout((()=>{n(!1,1e-7)}),1e3)}f=!1}try{i=new IntersectionObserver(m,{...u,root:s.ownerDocument})}catch(t){i=new IntersectionObserver(m,u)}i.observe(t)}(!0),r}(c,o):null;let p,u=-1,f=null;n&&(f=new ResizeObserver((t=>{let[i]=t;i&&i.target===c&&f&&(f.unobserve(e),cancelAnimationFrame(u),u=requestAnimationFrame((()=>{var t;null==(t=f)||t.observe(e)}))),o()})),c&&!l&&f.observe(c),f.observe(e));let m=l?Do(t):null;return l&&function e(){const i=Do(t);!m||i.x===m.x&&i.y===m.y&&i.width===m.width&&i.height===m.height||o();m=i,p=requestAnimationFrame(e)}(),o(),()=>{var t;h.forEach((t=>{s&&t.removeEventListener("scroll",o),r&&t.removeEventListener("resize",o)})),null==d||d(),null==(t=f)||t.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const Ko=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var o,i;const{x:s,y:r,placement:n,middlewareData:a}=e,l=await async function(t,e){const{placement:o,platform:i,elements:s}=t,r=await(null==i.isRTL?void 0:i.isRTL(s.floating)),n=to(o),a=eo(o),l="y"===so(o),c=["left","top"].includes(n)?-1:1,h=r&&l?-1:1,d=Qe(e,t);let{mainAxis:p,crossAxis:u,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof f&&(u="end"===a?-1*f:f),l?{x:u*h,y:p*c}:{x:p*c,y:u*h}}(e,t);return n===(null==(o=a.offset)?void 0:o.placement)&&null!=(i=a.arrow)&&i.alignmentOffset?{}:{x:s+l.x,y:r+l.y,data:{...l,placement:n}}}}},Zo=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:o,y:i,placement:s}=e,{mainAxis:r=!0,crossAxis:n=!1,limiter:a={fn:t=>{let{x:e,y:o}=t;return{x:e,y:o}}},...l}=Qe(t,e),c={x:o,y:i},h=await po(e,l),d=so(to(s)),p=oo(d);let u=c[p],f=c[d];if(r){const t="y"===p?"bottom":"right";u=Je(u+h["y"===p?"top":"left"],u,u-h[t])}if(n){const t="y"===d?"bottom":"right";f=Je(f+h["y"===d?"top":"left"],f,f-h[t])}const m=a.fn({...e,[p]:u,[d]:f});return{...m,data:{x:m.x-o,y:m.y-i}}}}},Go=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var o,i;const{placement:s,middlewareData:r,rects:n,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...b}=Qe(t,e);if(null!=(o=r.arrow)&&o.alignmentOffset)return{};const g=to(s),v=so(a),y=to(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),_=p||(y||!m?[ao(a)]:function(t){const e=ao(t);return[no(t),e,no(e)]}(a)),x="none"!==f;!p&&x&&_.push(...function(t,e,o,i){const s=eo(t);let r=function(t,e,o){const i=["left","right"],s=["right","left"],r=["top","bottom"],n=["bottom","top"];switch(t){case"top":case"bottom":return o?e?s:i:e?i:s;case"left":case"right":return e?r:n;default:return[]}}(to(t),"start"===o,i);return s&&(r=r.map((t=>t+"-"+s)),e&&(r=r.concat(r.map(no)))),r}(a,m,f,w));const $=[a,..._],k=await po(e,b),A=[];let C=(null==(i=r.flip)?void 0:i.overflows)||[];if(h&&A.push(k[g]),d){const t=function(t,e,o){void 0===o&&(o=!1);const i=eo(t),s=ro(t),r=io(s);let n="x"===s?i===(o?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[r]>e.floating[r]&&(n=ao(n)),[n,ao(n)]}(s,n,w);A.push(k[t[0]],k[t[1]])}if(C=[...C,{placement:s,overflows:A}],!A.every((t=>t<=0))){var E,S;const t=((null==(E=r.flip)?void 0:E.index)||0)+1,e=$[t];if(e)return{data:{index:t,overflows:C},reset:{placement:e}};let o=null==(S=C.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:S.placement;if(!o)switch(u){case"bestFit":{var z;const t=null==(z=C.filter((t=>{if(x){const e=so(t.placement);return e===v||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:z[0];t&&(o=t);break}case"initialPlacement":o=a}if(s!==o)return{reset:{placement:o}}}return{}}}},Xo=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:o,rects:i,platform:s,elements:r}=e,{apply:n=()=>{},...a}=Qe(t,e),l=await po(e,a),c=to(o),h=eo(o),d="y"===so(o),{width:p,height:u}=i.floating;let f,m;"top"===c||"bottom"===c?(f=c,m=h===(await(null==s.isRTL?void 0:s.isRTL(r.floating))?"start":"end")?"left":"right"):(m=c,f="end"===h?"top":"bottom");const b=u-l.top-l.bottom,g=p-l.left-l.right,v=je(u-l[f],b),y=je(p-l[m],g),w=!e.middlewareData.shift;let _=v,x=y;if(d?x=h||w?je(y,g):g:_=h||w?je(v,b):b,w&&!h){const t=qe(l.left,0),e=qe(l.right,0),o=qe(l.top,0),i=qe(l.bottom,0);d?x=p-2*(0!==t||0!==e?t+e:qe(l.left,l.right)):_=u-2*(0!==o||0!==i?o+i:qe(l.top,l.bottom))}await n({...e,availableWidth:x,availableHeight:_});const $=await s.getDimensions(r.floating);return p!==$.width||u!==$.height?{reset:{rects:!0}}:{}}}},Yo=t=>({name:"arrow",options:t,async fn(e){const{x:o,y:i,placement:s,rects:r,platform:n,elements:a,middlewareData:l}=e,{element:c,padding:h=0}=Qe(t,e)||{};if(null==c)return{};const d=lo(h),p={x:o,y:i},u=ro(s),f=io(u),m=await n.getDimensions(c),b="y"===u,g=b?"top":"left",v=b?"bottom":"right",y=b?"clientHeight":"clientWidth",w=r.reference[f]+r.reference[u]-p[u]-r.floating[f],_=p[u]-r.reference[u],x=await(null==n.getOffsetParent?void 0:n.getOffsetParent(c));let $=x?x[y]:0;$&&await(null==n.isElement?void 0:n.isElement(x))||($=a.floating[y]||r.floating[f]);const k=w/2-_/2,A=$/2-m[f]/2-1,C=je(d[g],A),E=je(d[v],A),S=C,z=$-m[f]-E,T=$/2-m[f]/2+k,P=Je(S,T,z),L=!l.arrow&&null!=eo(s)&&T!==P&&r.reference[f]/2-(T{const i=new Map,s={platform:jo,...o},r={...s.platform,_c:i};return(async(t,e,o)=>{const{placement:i="bottom",strategy:s="absolute",middleware:r=[],platform:n}=o,a=r.filter(Boolean),l=await(null==n.isRTL?void 0:n.isRTL(e));let c=await n.getElementRects({reference:t,floating:e,strategy:s}),{x:h,y:d}=ho(c,i,l),p=i,u={},f=0;for(let o=0;o{if(this.hoverBridge&&this.anchorEl){const t=this.anchorEl.getBoundingClientRect(),e=this.popup.getBoundingClientRect();let o=0,i=0,s=0,r=0,n=0,a=0,l=0,c=0;this.placement.includes("top")||this.placement.includes("bottom")?t.top{this.reposition()})))}async stop(){return new Promise((t=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame((()=>t()))):t()}))}reposition(){if(!this.active||!this.anchorEl)return;const t=[Ko({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?t.push(Xo({apply:({rects:t})=>{const e="width"===this.sync||"both"===this.sync,o="height"===this.sync||"both"===this.sync;this.popup.style.width=e?`${t.reference.width}px`:"",this.popup.style.height=o?`${t.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&t.push(Go({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:"best-fit"===this.flipFallbackStrategy?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&t.push(Zo({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?t.push(Xo({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:t,availableHeight:e})=>{"vertical"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-height",`${e}px`):this.style.removeProperty("--auto-size-available-height"),"horizontal"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-width",`${t}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&t.push(Yo({element:this.arrowEl,padding:this.arrowPadding}));const e="absolute"===this.strategy?t=>jo.getOffsetParent(t,Qo):jo.getOffsetParent;Jo(this.anchorEl,this.popup,{placement:this.placement,middleware:t,strategy:this.strategy,platform:h(c({},jo),{getOffsetParent:e})}).then((({x:t,y:e,middlewareData:o,placement:i})=>{const s=this.matches(":dir(rtl)"),r={top:"bottom",right:"left",bottom:"top",left:"right"}[i.split("-")[0]];if(this.setAttribute("data-current-placement",i),Object.assign(this.popup.style,{left:`${t}px`,top:`${e}px`}),this.arrow){const t=o.arrow.x,e=o.arrow.y;let i="",n="",a="",l="";if("start"===this.arrowPlacement){const o="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";i="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",n=s?o:"",l=s?"":o}else if("end"===this.arrowPlacement){const o="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";n=s?"":o,l=s?o:"",a="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else"center"===this.arrowPlacement?(l="number"==typeof t?"calc(50% - var(--arrow-size-diagonal))":"",i="number"==typeof e?"calc(50% - var(--arrow-size-diagonal))":""):(l="number"==typeof t?`${t}px`:"",i="number"==typeof e?`${e}px`:"");Object.assign(this.arrowEl.style,{top:i,right:n,bottom:a,left:l,[r]:"calc(var(--arrow-size-diagonal) * -1)"})}})),requestAnimationFrame((()=>this.updateHoverBridge())),this.emit("sl-reposition")}render(){return nt`
${this.arrow?nt``:""}
- `}};function oi(t,e){return new Promise((o=>{t.addEventListener(e,(function i(s){s.target===t&&(t.removeEventListener(e,i),o())}))}))}function ii(t,e,o){return new Promise((i=>{if((null==o?void 0:o.duration)===1/0)throw new Error("Promise-based animations must be finite.");const s=t.animate(e,h(c({},o),{duration:ri()?0:o.duration}));s.addEventListener("cancel",i,{once:!0}),s.addEventListener("finish",i,{once:!0})}))}function si(t){return(t=t.toString().toLowerCase()).indexOf("ms")>-1?parseFloat(t):t.indexOf("s")>-1?1e3*parseFloat(t):parseFloat(t)}function ri(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function ni(t){return Promise.all(t.getAnimations().map((t=>new Promise((e=>{t.cancel(),requestAnimationFrame(e)})))))}ei.styles=[Dt,je],d([Ht(".popup")],ei.prototype,"popup",2),d([Ht(".popup__arrow")],ei.prototype,"arrowEl",2),d([Nt()],ei.prototype,"anchor",2),d([Nt({type:Boolean,reflect:!0})],ei.prototype,"active",2),d([Nt({reflect:!0})],ei.prototype,"placement",2),d([Nt({reflect:!0})],ei.prototype,"strategy",2),d([Nt({type:Number})],ei.prototype,"distance",2),d([Nt({type:Number})],ei.prototype,"skidding",2),d([Nt({type:Boolean})],ei.prototype,"arrow",2),d([Nt({attribute:"arrow-placement"})],ei.prototype,"arrowPlacement",2),d([Nt({attribute:"arrow-padding",type:Number})],ei.prototype,"arrowPadding",2),d([Nt({type:Boolean})],ei.prototype,"flip",2),d([Nt({attribute:"flip-fallback-placements",converter:{fromAttribute:t=>t.split(" ").map((t=>t.trim())).filter((t=>""!==t)),toAttribute:t=>t.join(" ")}})],ei.prototype,"flipFallbackPlacements",2),d([Nt({attribute:"flip-fallback-strategy"})],ei.prototype,"flipFallbackStrategy",2),d([Nt({type:Object})],ei.prototype,"flipBoundary",2),d([Nt({attribute:"flip-padding",type:Number})],ei.prototype,"flipPadding",2),d([Nt({type:Boolean})],ei.prototype,"shift",2),d([Nt({type:Object})],ei.prototype,"shiftBoundary",2),d([Nt({attribute:"shift-padding",type:Number})],ei.prototype,"shiftPadding",2),d([Nt({attribute:"auto-size"})],ei.prototype,"autoSize",2),d([Nt()],ei.prototype,"sync",2),d([Nt({type:Object})],ei.prototype,"autoSizeBoundary",2),d([Nt({attribute:"auto-size-padding",type:Number})],ei.prototype,"autoSizePadding",2),d([Nt({attribute:"hover-bridge",type:Boolean})],ei.prototype,"hoverBridge",2);var ai=class extends It{constructor(){super(),this.localize=new Le(this),this.content="",this.placement="top",this.disabled=!1,this.distance=8,this.open=!1,this.skidding=0,this.trigger="hover focus",this.hoist=!1,this.handleBlur=()=>{this.hasTrigger("focus")&&this.hide()},this.handleClick=()=>{this.hasTrigger("click")&&(this.open?this.hide():this.show())},this.handleFocus=()=>{this.hasTrigger("focus")&&this.show()},this.handleDocumentKeyDown=t=>{"Escape"===t.key&&(t.stopPropagation(),this.hide())},this.handleMouseOver=()=>{if(this.hasTrigger("hover")){const t=si(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.show()),t)}},this.handleMouseOut=()=>{if(this.hasTrigger("hover")){const t=si(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),t)}},this.addEventListener("blur",this.handleBlur,!0),this.addEventListener("focus",this.handleFocus,!0),this.addEventListener("click",this.handleClick),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut)}disconnectedCallback(){var t;null==(t=this.closeWatcher)||t.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown)}firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition())}hasTrigger(t){return this.trigger.split(" ").includes(t)}async handleOpenChange(){var t,e;if(this.open){if(this.disabled)return;this.emit("sl-show"),"CloseWatcher"in window?(null==(t=this.closeWatcher)||t.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>{this.hide()}):document.addEventListener("keydown",this.handleDocumentKeyDown),await ni(this.body),this.body.hidden=!1,this.popup.active=!0;const{keyframes:e,options:o}=v(this,"tooltip.show",{dir:this.localize.dir()});await ii(this.popup.popup,e,o),this.popup.reposition(),this.emit("sl-after-show")}else{this.emit("sl-hide"),null==(e=this.closeWatcher)||e.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown),await ni(this.body);const{keyframes:t,options:o}=v(this,"tooltip.hide",{dir:this.localize.dir()});await ii(this.popup.popup,t,o),this.popup.active=!1,this.body.hidden=!0,this.emit("sl-after-hide")}}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,oi(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,oi(this,"sl-after-hide")}render(){return nt` + `}};function oi(t,e){return new Promise((o=>{t.addEventListener(e,(function i(s){s.target===t&&(t.removeEventListener(e,i),o())}))}))}function ii(t,e,o){return new Promise((i=>{if((null==o?void 0:o.duration)===1/0)throw new Error("Promise-based animations must be finite.");const s=t.animate(e,h(c({},o),{duration:ri()?0:o.duration}));s.addEventListener("cancel",i,{once:!0}),s.addEventListener("finish",i,{once:!0})}))}function si(t){return(t=t.toString().toLowerCase()).indexOf("ms")>-1?parseFloat(t):t.indexOf("s")>-1?1e3*parseFloat(t):parseFloat(t)}function ri(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function ni(t){return Promise.all(t.getAnimations().map((t=>new Promise((e=>{t.cancel(),requestAnimationFrame(e)})))))}ei.styles=[Rt,We],d([Ut(".popup")],ei.prototype,"popup",2),d([Ut(".popup__arrow")],ei.prototype,"arrowEl",2),d([Bt()],ei.prototype,"anchor",2),d([Bt({type:Boolean,reflect:!0})],ei.prototype,"active",2),d([Bt({reflect:!0})],ei.prototype,"placement",2),d([Bt({reflect:!0})],ei.prototype,"strategy",2),d([Bt({type:Number})],ei.prototype,"distance",2),d([Bt({type:Number})],ei.prototype,"skidding",2),d([Bt({type:Boolean})],ei.prototype,"arrow",2),d([Bt({attribute:"arrow-placement"})],ei.prototype,"arrowPlacement",2),d([Bt({attribute:"arrow-padding",type:Number})],ei.prototype,"arrowPadding",2),d([Bt({type:Boolean})],ei.prototype,"flip",2),d([Bt({attribute:"flip-fallback-placements",converter:{fromAttribute:t=>t.split(" ").map((t=>t.trim())).filter((t=>""!==t)),toAttribute:t=>t.join(" ")}})],ei.prototype,"flipFallbackPlacements",2),d([Bt({attribute:"flip-fallback-strategy"})],ei.prototype,"flipFallbackStrategy",2),d([Bt({type:Object})],ei.prototype,"flipBoundary",2),d([Bt({attribute:"flip-padding",type:Number})],ei.prototype,"flipPadding",2),d([Bt({type:Boolean})],ei.prototype,"shift",2),d([Bt({type:Object})],ei.prototype,"shiftBoundary",2),d([Bt({attribute:"shift-padding",type:Number})],ei.prototype,"shiftPadding",2),d([Bt({attribute:"auto-size"})],ei.prototype,"autoSize",2),d([Bt()],ei.prototype,"sync",2),d([Bt({type:Object})],ei.prototype,"autoSizeBoundary",2),d([Bt({attribute:"auto-size-padding",type:Number})],ei.prototype,"autoSizePadding",2),d([Bt({attribute:"hover-bridge",type:Boolean})],ei.prototype,"hoverBridge",2);var ai=class extends Ht{constructor(){super(),this.localize=new Pe(this),this.content="",this.placement="top",this.disabled=!1,this.distance=8,this.open=!1,this.skidding=0,this.trigger="hover focus",this.hoist=!1,this.handleBlur=()=>{this.hasTrigger("focus")&&this.hide()},this.handleClick=()=>{this.hasTrigger("click")&&(this.open?this.hide():this.show())},this.handleFocus=()=>{this.hasTrigger("focus")&&this.show()},this.handleDocumentKeyDown=t=>{"Escape"===t.key&&(t.stopPropagation(),this.hide())},this.handleMouseOver=()=>{if(this.hasTrigger("hover")){const t=si(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.show()),t)}},this.handleMouseOut=()=>{if(this.hasTrigger("hover")){const t=si(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),t)}},this.addEventListener("blur",this.handleBlur,!0),this.addEventListener("focus",this.handleFocus,!0),this.addEventListener("click",this.handleClick),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut)}disconnectedCallback(){var t;null==(t=this.closeWatcher)||t.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown)}firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition())}hasTrigger(t){return this.trigger.split(" ").includes(t)}async handleOpenChange(){var t,e;if(this.open){if(this.disabled)return;this.emit("sl-show"),"CloseWatcher"in window?(null==(t=this.closeWatcher)||t.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>{this.hide()}):document.addEventListener("keydown",this.handleDocumentKeyDown),await ni(this.body),this.body.hidden=!1,this.popup.active=!0;const{keyframes:e,options:o}=v(this,"tooltip.show",{dir:this.localize.dir()});await ii(this.popup.popup,e,o),this.popup.reposition(),this.emit("sl-after-show")}else{this.emit("sl-hide"),null==(e=this.closeWatcher)||e.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown),await ni(this.body);const{keyframes:t,options:o}=v(this,"tooltip.hide",{dir:this.localize.dir()});await ii(this.popup.popup,t,o),this.popup.active=!1,this.body.hidden=!0,this.emit("sl-after-hide")}}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,oi(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,oi(this,"sl-after-hide")}render(){return nt` {if(t?.r===me)return t?._$litStatic$},ge=(t,...e)= ${this.content} - `}};ai.styles=[Dt,We],ai.dependencies={"sl-popup":ei},d([Ht("slot:not([name])")],ai.prototype,"defaultSlot",2),d([Ht(".tooltip__body")],ai.prototype,"body",2),d([Ht("sl-popup")],ai.prototype,"popup",2),d([Nt()],ai.prototype,"content",2),d([Nt()],ai.prototype,"placement",2),d([Nt({type:Boolean,reflect:!0})],ai.prototype,"disabled",2),d([Nt({type:Number})],ai.prototype,"distance",2),d([Nt({type:Boolean,reflect:!0})],ai.prototype,"open",2),d([Nt({type:Number})],ai.prototype,"skidding",2),d([Nt()],ai.prototype,"trigger",2),d([Nt({type:Boolean})],ai.prototype,"hoist",2),d([Rt("open",{waitUntilFirstUpdate:!0})],ai.prototype,"handleOpenChange",1),d([Rt(["content","distance","hoist","placement","skidding"])],ai.prototype,"handleOptionsChange",1),d([Rt("disabled")],ai.prototype,"handleDisabledChange",1),g("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}}),g("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}}),ai.define("sl-tooltip");var li=k` + `}};ai.styles=[Rt,Ve],ai.dependencies={"sl-popup":ei},d([Ut("slot:not([name])")],ai.prototype,"defaultSlot",2),d([Ut(".tooltip__body")],ai.prototype,"body",2),d([Ut("sl-popup")],ai.prototype,"popup",2),d([Bt()],ai.prototype,"content",2),d([Bt()],ai.prototype,"placement",2),d([Bt({type:Boolean,reflect:!0})],ai.prototype,"disabled",2),d([Bt({type:Number})],ai.prototype,"distance",2),d([Bt({type:Boolean,reflect:!0})],ai.prototype,"open",2),d([Bt({type:Number})],ai.prototype,"skidding",2),d([Bt()],ai.prototype,"trigger",2),d([Bt({type:Boolean})],ai.prototype,"hoist",2),d([Ft("open",{waitUntilFirstUpdate:!0})],ai.prototype,"handleOpenChange",1),d([Ft(["content","distance","hoist","placement","skidding"])],ai.prototype,"handleOptionsChange",1),d([Ft("disabled")],ai.prototype,"handleDisabledChange",1),g("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}}),g("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}}),ai.define("sl-tooltip");var li=k` :host { --height: 1rem; --track-color: var(--sl-color-neutral-200); @@ -1057,12 +1057,12 @@ const me=Symbol.for(""),be=t=>{if(t?.r===me)return t?._$litStatic$},ge=(t,...e)= * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */;const ci="important",hi=" !"+ci,di=qt(class extends Kt{constructor(t){if(super(t),t.type!==Vt||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,o)=>{const i=t[o];return null==i?e:e+`${o=o.includes("-")?o:o.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(t,[e]){const{style:o}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?o.removeProperty(t):o[t]=null);for(const t in e){const i=e[t];if(null!=i){this.ft.add(t);const e="string"==typeof i&&i.endsWith(hi);t.includes("-")||e?o.setProperty(t,e?i.slice(0,-11):i,e?ci:""):o[t]=i}}return at}});var pi=class extends It{constructor(){super(...arguments),this.localize=new Le(this),this.value=0,this.indeterminate=!1,this.label=""}render(){return nt` + */;const ci="important",hi=" !"+ci,di=jt(class extends qt{constructor(t){if(super(t),t.type!==It||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,o)=>{const i=t[o];return null==i?e:e+`${o=o.includes("-")?o:o.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(t,[e]){const{style:o}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?o.removeProperty(t):o[t]=null);for(const t in e){const i=e[t];if(null!=i){this.ft.add(t);const e="string"==typeof i&&i.endsWith(hi);t.includes("-")||e?o.setProperty(t,e?i.slice(0,-11):i,e?ci:""):o[t]=i}}return at}});var pi=class extends Ht{constructor(){super(...arguments),this.localize=new Pe(this),this.value=0,this.indeterminate=!1,this.label=""}render(){return nt`
0?this.label:this.localize.term("progress")} aria-valuemin="0" aria-valuemax="100" @@ -1072,7 +1072,7 @@ const me=Symbol.for(""),be=t=>{if(t?.r===me)return t?._$litStatic$},ge=(t,...e)= ${this.indeterminate?"":nt` `}
- `}};pi.styles=[Dt,li],d([Nt({type:Number,reflect:!0})],pi.prototype,"value",2),d([Nt({type:Boolean,reflect:!0})],pi.prototype,"indeterminate",2),d([Nt()],pi.prototype,"label",2),pi.define("sl-progress-bar");var ui=new WeakMap;function fi(t){let e=ui.get(t);return e||(e=window.getComputedStyle(t,null),ui.set(t,e)),e}function mi(t){const e=t.tagName.toLowerCase(),o=Number(t.getAttribute("tabindex"));if(t.hasAttribute("tabindex")&&(isNaN(o)||o<=-1))return!1;if(t.hasAttribute("disabled"))return!1;if(t.closest("[inert]"))return!1;if("input"===e&&"radio"===t.getAttribute("type")&&!t.hasAttribute("checked"))return!1;if(!function(t){if("function"==typeof t.checkVisibility)return t.checkVisibility({checkOpacity:!1,checkVisibilityCSS:!0});const e=fi(t);return"hidden"!==e.visibility&&"none"!==e.display}(t))return!1;if(("audio"===e||"video"===e)&&t.hasAttribute("controls"))return!0;if(t.hasAttribute("tabindex"))return!0;if(t.hasAttribute("contenteditable")&&"false"!==t.getAttribute("contenteditable"))return!0;return!!["button","input","select","textarea","a","audio","video","summary","iframe"].includes(e)||function(t){const e=fi(t),{overflowY:o,overflowX:i}=e;return"scroll"===o||"scroll"===i||"auto"===o&&"auto"===i&&(t.scrollHeight>t.clientHeight&&"auto"===o||!(!(t.scrollWidth>t.clientWidth)||"auto"!==i))}(t)}function bi(t){const e=new WeakMap,o=[];return function i(s){if(s instanceof Element){if(s.hasAttribute("inert")||s.closest("[inert]"))return;if(e.has(s))return;e.set(s,!0),!o.includes(s)&&mi(s)&&o.push(s),s instanceof HTMLSlotElement&&function(t,e){var o;return(null==(o=t.getRootNode({composed:!0}))?void 0:o.host)!==e}(s,t)&&s.assignedElements({flatten:!0}).forEach((t=>{i(t)})),null!==s.shadowRoot&&"open"===s.shadowRoot.mode&&i(s.shadowRoot)}for(const t of s.children)i(t)}(t),o.sort(((t,e)=>{const o=Number(t.getAttribute("tabindex"))||0;return(Number(e.getAttribute("tabindex"))||0)-o}))}function*gi(t=document.activeElement){null!=t&&(yield t,"shadowRoot"in t&&t.shadowRoot&&"closed"!==t.shadowRoot.mode&&(yield*u(gi(t.shadowRoot.activeElement))))}var vi=[],yi=class{constructor(t){this.tabDirection="forward",this.handleFocusIn=()=>{this.isActive()&&this.checkFocus()},this.handleKeyDown=t=>{var e;if("Tab"!==t.key||this.isExternalActivated)return;if(!this.isActive())return;const o=[...gi()].pop();if(this.previousFocus=o,this.previousFocus&&this.possiblyHasTabbableChildren(this.previousFocus))return;t.shiftKey?this.tabDirection="backward":this.tabDirection="forward";const i=bi(this.element);let s=i.findIndex((t=>t===o));this.previousFocus=this.currentFocus;const r="forward"===this.tabDirection?1:-1;for(;;){s+r>=i.length?s=0:s+r<0?s=i.length-1:s+=r,this.previousFocus=this.currentFocus;const o=i[s];if("backward"===this.tabDirection&&this.previousFocus&&this.possiblyHasTabbableChildren(this.previousFocus))return;if(o&&this.possiblyHasTabbableChildren(o))return;t.preventDefault(),this.currentFocus=o,null==(e=this.currentFocus)||e.focus({preventScroll:!1});const n=[...gi()];if(n.includes(this.currentFocus)||!n.includes(this.previousFocus))break}setTimeout((()=>this.checkFocus()))},this.handleKeyUp=()=>{this.tabDirection="forward"},this.element=t,this.elementsWithTabbableControls=["iframe"]}activate(){vi.push(this.element),document.addEventListener("focusin",this.handleFocusIn),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}deactivate(){vi=vi.filter((t=>t!==this.element)),this.currentFocus=null,document.removeEventListener("focusin",this.handleFocusIn),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return vi[vi.length-1]===this.element}activateExternal(){this.isExternalActivated=!0}deactivateExternal(){this.isExternalActivated=!1}checkFocus(){if(this.isActive()&&!this.isExternalActivated){const t=bi(this.element);if(!this.element.matches(":focus-within")){const e=t[0],o=t[t.length-1],i="forward"===this.tabDirection?e:o;"function"==typeof(null==i?void 0:i.focus)&&(this.currentFocus=i,i.focus({preventScroll:!1}))}}}possiblyHasTabbableChildren(t){return this.elementsWithTabbableControls.includes(t.tagName.toLowerCase())||t.hasAttribute("controls")}},wi=k` + `}};pi.styles=[Rt,li],d([Bt({type:Number,reflect:!0})],pi.prototype,"value",2),d([Bt({type:Boolean,reflect:!0})],pi.prototype,"indeterminate",2),d([Bt()],pi.prototype,"label",2),pi.define("sl-progress-bar");var ui=new WeakMap;function fi(t){let e=ui.get(t);return e||(e=window.getComputedStyle(t,null),ui.set(t,e)),e}function mi(t){const e=t.tagName.toLowerCase(),o=Number(t.getAttribute("tabindex"));if(t.hasAttribute("tabindex")&&(isNaN(o)||o<=-1))return!1;if(t.hasAttribute("disabled"))return!1;if(t.closest("[inert]"))return!1;if("input"===e&&"radio"===t.getAttribute("type")&&!t.hasAttribute("checked"))return!1;if(!function(t){if("function"==typeof t.checkVisibility)return t.checkVisibility({checkOpacity:!1,checkVisibilityCSS:!0});const e=fi(t);return"hidden"!==e.visibility&&"none"!==e.display}(t))return!1;if(("audio"===e||"video"===e)&&t.hasAttribute("controls"))return!0;if(t.hasAttribute("tabindex"))return!0;if(t.hasAttribute("contenteditable")&&"false"!==t.getAttribute("contenteditable"))return!0;return!!["button","input","select","textarea","a","audio","video","summary","iframe"].includes(e)||function(t){const e=fi(t),{overflowY:o,overflowX:i}=e;return"scroll"===o||"scroll"===i||"auto"===o&&"auto"===i&&(t.scrollHeight>t.clientHeight&&"auto"===o||!(!(t.scrollWidth>t.clientWidth)||"auto"!==i))}(t)}function bi(t){const e=new WeakMap,o=[];return function i(s){if(s instanceof Element){if(s.hasAttribute("inert")||s.closest("[inert]"))return;if(e.has(s))return;e.set(s,!0),!o.includes(s)&&mi(s)&&o.push(s),s instanceof HTMLSlotElement&&function(t,e){var o;return(null==(o=t.getRootNode({composed:!0}))?void 0:o.host)!==e}(s,t)&&s.assignedElements({flatten:!0}).forEach((t=>{i(t)})),null!==s.shadowRoot&&"open"===s.shadowRoot.mode&&i(s.shadowRoot)}for(const t of s.children)i(t)}(t),o.sort(((t,e)=>{const o=Number(t.getAttribute("tabindex"))||0;return(Number(e.getAttribute("tabindex"))||0)-o}))}function*gi(t=document.activeElement){null!=t&&(yield t,"shadowRoot"in t&&t.shadowRoot&&"closed"!==t.shadowRoot.mode&&(yield*u(gi(t.shadowRoot.activeElement))))}var vi=[],yi=class{constructor(t){this.tabDirection="forward",this.handleFocusIn=()=>{this.isActive()&&this.checkFocus()},this.handleKeyDown=t=>{var e;if("Tab"!==t.key||this.isExternalActivated)return;if(!this.isActive())return;const o=[...gi()].pop();if(this.previousFocus=o,this.previousFocus&&this.possiblyHasTabbableChildren(this.previousFocus))return;t.shiftKey?this.tabDirection="backward":this.tabDirection="forward";const i=bi(this.element);let s=i.findIndex((t=>t===o));this.previousFocus=this.currentFocus;const r="forward"===this.tabDirection?1:-1;for(;;){s+r>=i.length?s=0:s+r<0?s=i.length-1:s+=r,this.previousFocus=this.currentFocus;const o=i[s];if("backward"===this.tabDirection&&this.previousFocus&&this.possiblyHasTabbableChildren(this.previousFocus))return;if(o&&this.possiblyHasTabbableChildren(o))return;t.preventDefault(),this.currentFocus=o,null==(e=this.currentFocus)||e.focus({preventScroll:!1});const n=[...gi()];if(n.includes(this.currentFocus)||!n.includes(this.previousFocus))break}setTimeout((()=>this.checkFocus()))},this.handleKeyUp=()=>{this.tabDirection="forward"},this.element=t,this.elementsWithTabbableControls=["iframe"]}activate(){vi.push(this.element),document.addEventListener("focusin",this.handleFocusIn),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}deactivate(){vi=vi.filter((t=>t!==this.element)),this.currentFocus=null,document.removeEventListener("focusin",this.handleFocusIn),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return vi[vi.length-1]===this.element}activateExternal(){this.isExternalActivated=!0}deactivateExternal(){this.isExternalActivated=!1}checkFocus(){if(this.isActive()&&!this.isExternalActivated){const t=bi(this.element);if(!this.element.matches(":focus-within")){const e=t[0],o=t[t.length-1],i="forward"===this.tabDirection?e:o;"function"==typeof(null==i?void 0:i.focus)&&(this.currentFocus=i,i.focus({preventScroll:!1}))}}}possiblyHasTabbableChildren(t){return this.elementsWithTabbableControls.includes(t.tagName.toLowerCase())||t.hasAttribute("controls")}},wi=k` :host { --width: 31rem; --header-spacing: var(--sl-spacing-large); @@ -1189,10 +1189,10 @@ const me=Symbol.for(""),be=t=>{if(t?.r===me)return t?._$litStatic$},ge=(t,...e)= border: solid 1px var(--sl-color-neutral-0); } } -`,_i=class extends It{constructor(){super(...arguments),this.hasSlotController=new Ft(this,"footer"),this.localize=new Le(this),this.modal=new yi(this),this.open=!1,this.label="",this.noHeader=!1,this.handleDocumentKeyDown=t=>{"Escape"===t.key&&this.modal.isActive()&&this.open&&(t.stopPropagation(),this.requestClose("keyboard"))}}firstUpdated(){this.dialog.hidden=!this.open,this.open&&(this.addOpenListeners(),this.modal.activate(),Me(this))}disconnectedCallback(){var t;super.disconnectedCallback(),this.modal.deactivate(),Be(this),null==(t=this.closeWatcher)||t.destroy()}requestClose(t){if(this.emit("sl-request-close",{cancelable:!0,detail:{source:t}}).defaultPrevented){const t=v(this,"dialog.denyClose",{dir:this.localize.dir()});ii(this.panel,t.keyframes,t.options)}else this.hide()}addOpenListeners(){var t;"CloseWatcher"in window?(null==(t=this.closeWatcher)||t.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>this.requestClose("keyboard")):document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){var t;null==(t=this.closeWatcher)||t.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown)}async handleOpenChange(){if(this.open){this.emit("sl-show"),this.addOpenListeners(),this.originalTrigger=document.activeElement,this.modal.activate(),Me(this);const t=this.querySelector("[autofocus]");t&&t.removeAttribute("autofocus"),await Promise.all([ni(this.dialog),ni(this.overlay)]),this.dialog.hidden=!1,requestAnimationFrame((()=>{this.emit("sl-initial-focus",{cancelable:!0}).defaultPrevented||(t?t.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),t&&t.setAttribute("autofocus","")}));const e=v(this,"dialog.show",{dir:this.localize.dir()}),o=v(this,"dialog.overlay.show",{dir:this.localize.dir()});await Promise.all([ii(this.panel,e.keyframes,e.options),ii(this.overlay,o.keyframes,o.options)]),this.emit("sl-after-show")}else{this.emit("sl-hide"),this.removeOpenListeners(),this.modal.deactivate(),await Promise.all([ni(this.dialog),ni(this.overlay)]);const t=v(this,"dialog.hide",{dir:this.localize.dir()}),e=v(this,"dialog.overlay.hide",{dir:this.localize.dir()});await Promise.all([ii(this.overlay,e.keyframes,e.options).then((()=>{this.overlay.hidden=!0})),ii(this.panel,t.keyframes,t.options).then((()=>{this.panel.hidden=!0}))]),this.dialog.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1,Be(this);const o=this.originalTrigger;"function"==typeof(null==o?void 0:o.focus)&&setTimeout((()=>o.focus())),this.emit("sl-after-hide")}}async show(){if(!this.open)return this.open=!0,oi(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,oi(this,"sl-after-hide")}render(){return nt` +`,_i=class extends Ht{constructor(){super(...arguments),this.hasSlotController=new Ot(this,"footer"),this.localize=new Pe(this),this.modal=new yi(this),this.open=!1,this.label="",this.noHeader=!1,this.handleDocumentKeyDown=t=>{"Escape"===t.key&&this.modal.isActive()&&this.open&&(t.stopPropagation(),this.requestClose("keyboard"))}}firstUpdated(){this.dialog.hidden=!this.open,this.open&&(this.addOpenListeners(),this.modal.activate(),Me(this))}disconnectedCallback(){var t;super.disconnectedCallback(),this.modal.deactivate(),De(this),null==(t=this.closeWatcher)||t.destroy()}requestClose(t){if(this.emit("sl-request-close",{cancelable:!0,detail:{source:t}}).defaultPrevented){const t=v(this,"dialog.denyClose",{dir:this.localize.dir()});ii(this.panel,t.keyframes,t.options)}else this.hide()}addOpenListeners(){var t;"CloseWatcher"in window?(null==(t=this.closeWatcher)||t.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>this.requestClose("keyboard")):document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){var t;null==(t=this.closeWatcher)||t.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown)}async handleOpenChange(){if(this.open){this.emit("sl-show"),this.addOpenListeners(),this.originalTrigger=document.activeElement,this.modal.activate(),Me(this);const t=this.querySelector("[autofocus]");t&&t.removeAttribute("autofocus"),await Promise.all([ni(this.dialog),ni(this.overlay)]),this.dialog.hidden=!1,requestAnimationFrame((()=>{this.emit("sl-initial-focus",{cancelable:!0}).defaultPrevented||(t?t.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),t&&t.setAttribute("autofocus","")}));const e=v(this,"dialog.show",{dir:this.localize.dir()}),o=v(this,"dialog.overlay.show",{dir:this.localize.dir()});await Promise.all([ii(this.panel,e.keyframes,e.options),ii(this.overlay,o.keyframes,o.options)]),this.emit("sl-after-show")}else{this.emit("sl-hide"),this.removeOpenListeners(),this.modal.deactivate(),await Promise.all([ni(this.dialog),ni(this.overlay)]);const t=v(this,"dialog.hide",{dir:this.localize.dir()}),e=v(this,"dialog.overlay.hide",{dir:this.localize.dir()});await Promise.all([ii(this.overlay,e.keyframes,e.options).then((()=>{this.overlay.hidden=!0})),ii(this.panel,t.keyframes,t.options).then((()=>{this.panel.hidden=!0}))]),this.dialog.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1,De(this);const o=this.originalTrigger;"function"==typeof(null==o?void 0:o.focus)&&setTimeout((()=>o.focus())),this.emit("sl-after-hide")}}async show(){if(!this.open)return this.open=!0,oi(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,oi(this,"sl-after-hide")}render(){return nt`
this.requestClose("overlay")} tabindex="-1">
@@ -1202,8 +1202,8 @@ const me=Symbol.for(""),be=t=>{if(t?.r===me)return t?._$litStatic$},ge=(t,...e)= role="dialog" aria-modal="true" aria-hidden=${this.open?"false":"true"} - aria-label=${Gt(this.noHeader?this.label:void 0)} - aria-labelledby=${Gt(this.noHeader?void 0:"title")} + aria-label=${Zt(this.noHeader?this.label:void 0)} + aria-labelledby=${Zt(this.noHeader?void 0:"title")} tabindex="-1" > ${this.noHeader?"":nt` @@ -1233,4 +1233,4 @@ const me=Symbol.for(""),be=t=>{if(t?.r===me)return t?._$litStatic$},ge=(t,...e)=
- `}};_i.styles=[Dt,wi],_i.dependencies={"sl-icon-button":we},d([Ht(".dialog")],_i.prototype,"dialog",2),d([Ht(".dialog__panel")],_i.prototype,"panel",2),d([Ht(".dialog__overlay")],_i.prototype,"overlay",2),d([Nt({type:Boolean,reflect:!0})],_i.prototype,"open",2),d([Nt({reflect:!0})],_i.prototype,"label",2),d([Nt({attribute:"no-header",type:Boolean,reflect:!0})],_i.prototype,"noHeader",2),d([Rt("open",{waitUntilFirstUpdate:!0})],_i.prototype,"handleOpenChange",1),g("dialog.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}}),g("dialog.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}}),g("dialog.denyClose",{keyframes:[{scale:1},{scale:1.02},{scale:1}],options:{duration:250}}),g("dialog.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:250}}),g("dialog.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:250}}),_i.define("sl-dialog");export{le as registerIconLibrary,g as setDefaultAnimation}; + `}};_i.styles=[Rt,wi],_i.dependencies={"sl-icon-button":ye},d([Ut(".dialog")],_i.prototype,"dialog",2),d([Ut(".dialog__panel")],_i.prototype,"panel",2),d([Ut(".dialog__overlay")],_i.prototype,"overlay",2),d([Bt({type:Boolean,reflect:!0})],_i.prototype,"open",2),d([Bt({reflect:!0})],_i.prototype,"label",2),d([Bt({attribute:"no-header",type:Boolean,reflect:!0})],_i.prototype,"noHeader",2),d([Ft("open",{waitUntilFirstUpdate:!0})],_i.prototype,"handleOpenChange",1),g("dialog.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}}),g("dialog.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}}),g("dialog.denyClose",{keyframes:[{scale:1},{scale:1.02},{scale:1}],options:{duration:250}}),g("dialog.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:250}}),g("dialog.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:250}}),_i.define("sl-dialog");export{ae as registerIconLibrary,g as setDefaultAnimation}; diff --git a/vendor/javascript/tinymce.min.js b/vendor/javascript/tinymce.min.js index 2e0beec639..cdd854029d 100644 --- a/vendor/javascript/tinymce.min.js +++ b/vendor/javascript/tinymce.min.js @@ -1 +1 @@ -function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t,o={exports:{}};t=o,function(){var e=function(e){if(null===e)return"null";if(void 0===e)return"undefined";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t},o=function(e){return{eq:e}},n=o((function(e,t){return e===t})),r=function(e){return o((function(t,o){if(t.length!==o.length)return!1;for(var n=t.length,r=0;r{var n;return!!o(e,t.prototype)||(null===(n=e.constructor)||void 0===n?void 0:n.name)===t.name},d=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&c(e,String,((e,t)=>t.isPrototypeOf(e)))?"string":t})(t)===e,m=e=>t=>typeof t===e,u=e=>t=>e===t,g=(e,t)=>p(e)&&c(e,t,((e,t)=>l(e)===t)),h=d("string"),p=d("object"),f=e=>g(e,Object),v=d("array"),b=u(null),y=m("boolean"),w=u(void 0),x=e=>null==e,C=e=>!x(e),S=m("function"),k=m("number"),_=(e,t)=>{if(v(e)){for(let o=0,n=e.length;o{},T=(e,t)=>(...o)=>e(t.apply(null,o)),O=(e,t)=>o=>e(t(o)),A=e=>()=>e,D=e=>e,M=(e,t)=>e===t;function N(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const R=e=>t=>!e(t),B=e=>()=>{throw new Error(e)},L=e=>e(),H=e=>{e()},I=A(!1),P=A(!0);class F{constructor(e,t){this.tag=e,this.value=t}static some(e){return new F(!0,e)}static none(){return F.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?F.some(e(this.value)):F.none()}bind(e){return this.tag?e(this.value):F.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:F.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return C(e)?F.some(e):F.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}F.singletonNone=new F(!1);const z=Array.prototype.slice,V=Array.prototype.indexOf,Z=Array.prototype.push,U=(e,t)=>V.call(e,t),j=(e,t)=>U(e,t)>-1,W=(e,t)=>{for(let o=0,n=e.length;o{const o=e.length,n=new Array(o);for(let r=0;r{for(let o=0,n=e.length;o{for(let o=e.length-1;o>=0;o--)t(e[o],o)},K=(e,t)=>{const o=[],n=[];for(let r=0,s=e.length;r{const o=[];for(let n=0,r=e.length;n(G(e,((e,n)=>{o=t(o,e,n)})),o),J=(e,t,o)=>(q(e,((e,n)=>{o=t(o,e,n)})),o),Q=(e,t,o)=>{for(let n=0,r=e.length;nQ(e,t,I),te=(e,t)=>{for(let o=0,n=e.length;o{const t=[];for(let o=0,n=e.length;ooe($(e,t)),re=(e,t)=>{for(let o=0,n=e.length;o{const t=z.call(e,0);return t.reverse(),t},ae=(e,t)=>Y(e,(e=>!j(t,e))),ie=(e,t)=>{const o={};for(let n=0,r=e.length;n{const o=z.call(e,0);return o.sort(t),o},ce=(e,t)=>t>=0&&tce(e,0),me=e=>ce(e,e.length-1),ue=S(Array.from)?Array.from:e=>z.call(e),ge=(e,t)=>{for(let o=0;o{const o=[],n=S(t)?e=>W(o,(o=>t(o,e))):e=>j(o,e);for(let t=0,r=e.length;t{const o=pe(e);for(let n=0,r=o.length;nye(e,((e,o)=>({k:o,v:t(e,o)}))),ye=(e,t)=>{const o={};return ve(e,((e,n)=>{const r=t(e,n);o[r.k]=r.v})),o},we=e=>(t,o)=>{e[o]=t},xe=(e,t,o,n)=>{ve(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))},Ce=(e,t)=>{const o={};return xe(e,t,we(o),E),o},Se=(e,t)=>{const o=[];return ve(e,((e,n)=>{o.push(t(e,n))})),o},ke=e=>Se(e,D),_e=(e,t)=>Ee(e,t)?F.from(e[t]):F.none(),Ee=(e,t)=>fe.call(e,t),Te=(e,t)=>Ee(e,t)&&void 0!==e[t]&&null!==e[t],Oe=e=>{const t={};return q(e,(e=>{t[e]={}})),pe(t)},Ae=e=>void 0!==e.length,De=Array.isArray,Me=(e,t,o)=>{if(!e)return!1;if(o=o||e,Ae(e)){for(let n=0,r=e.length;n{const o=[];return Me(e,((n,r)=>{o.push(t(n,r,e))})),o},Re=(e,t)=>{const o=[];return Me(e,((n,r)=>{t&&!t(n,r,e)||o.push(n)})),o},Be=(e,t,o,n)=>{let r=w(o)?e[0]:o;for(let o=0;o{for(let n=0,r=e.length;ne[e.length-1],Ie=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},Pe=()=>Fe(0,0),Fe=(e,t)=>({major:e,minor:t}),ze={nu:Fe,detect:(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?Pe():((e,t)=>{const o=((e,t)=>{for(let o=0;oNumber(t.replace(o,"$"+e));return Fe(n(1),n(2))})(e,o)},unknown:Pe},Ve=(e,t)=>{const o=String(t).toLowerCase();return ee(e,(e=>e.search(o)))},Ze=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,Ue=(e,t)=>We(e,t)?((e,t)=>e.substring(t))(e,t.length):e,je=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!w(n)||r+t.length<=n)},We=(e,t)=>Ze(e,t,0),$e=(e,t)=>Ze(e,t,e.length-t.length),qe=e=>t=>t.replace(e,""),Ge=qe(/^\s+|\s+$/g),Ke=qe(/^\s+/g),Ye=qe(/\s+$/g),Xe=e=>e.length>0,Je=e=>!Xe(e),Qe=(e,t=10)=>{const o=parseInt(e,t);return isNaN(o)?F.none():F.some(o)},et=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,tt=e=>t=>je(t,e),ot=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>je(e,"edge/")&&je(e,"chrome")&&je(e,"safari")&&je(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,et],search:e=>je(e,"chrome")&&!je(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>je(e,"msie")||je(e,"trident")},{name:"Opera",versionRegexes:[et,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:tt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:tt("firefox")},{name:"Safari",versionRegexes:[et,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(je(e,"safari")||je(e,"mobile/"))&&je(e,"applewebkit")}],nt=[{name:"Windows",search:tt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>je(e,"iphone")||je(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:tt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:tt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:tt("linux"),versionRegexes:[]},{name:"Solaris",search:tt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:tt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:tt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],rt={browsers:A(ot),oses:A(nt)},st="Edge",at="Chromium",it="Opera",lt="Firefox",ct="Safari",dt=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(st),isChromium:n(at),isIE:n("IE"),isOpera:n(it),isFirefox:n(lt),isSafari:n(ct)}},mt={unknown:()=>dt({current:void 0,version:ze.unknown()}),nu:dt,edge:A(st),chromium:A(at),ie:A("IE"),opera:A(it),firefox:A(lt),safari:A(ct)},ut="Windows",gt="Android",ht="Linux",pt="macOS",ft="Solaris",vt="FreeBSD",bt="ChromeOS",yt=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(ut),isiOS:n("iOS"),isAndroid:n(gt),isMacOS:n(pt),isLinux:n(ht),isSolaris:n(ft),isFreeBSD:n(vt),isChromeOS:n(bt)}},wt={unknown:()=>yt({current:void 0,version:ze.unknown()}),nu:yt,windows:A(ut),ios:A("iOS"),android:A(gt),linux:A(ht),macos:A(pt),solaris:A(ft),freebsd:A(vt),chromeos:A(bt)},xt=(e,t,o)=>{const n=rt.browsers(),r=rt.oses(),s=t.bind((e=>((e,t)=>ge(t.brands,(t=>{const o=t.brand.toLowerCase();return ee(e,(e=>{var t;return o===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:ze.nu(parseInt(t.version,10),0)})))})))(n,e))).orThunk((()=>((e,t)=>Ve(e,t).map((e=>{const o=ze.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(n,e))).fold(mt.unknown,mt.nu),a=((e,t)=>Ve(e,t).map((e=>{const o=ze.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(r,e).fold(wt.unknown,wt.nu),i=((e,t,o,n)=>{const r=e.isiOS()&&!0===/ipad/i.test(o),s=e.isiOS()&&!r,a=e.isiOS()||e.isAndroid(),i=a||n("(pointer:coarse)"),l=r||!s&&a&&n("(min-device-width:768px)"),c=s||a&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),m=!c&&!l&&!d;return{isiPad:A(r),isiPhone:A(s),isTablet:A(l),isPhone:A(c),isTouch:A(i),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:A(d),isDesktop:A(m)}})(a,s,e,o);return{browser:s,os:a,deviceType:i}},Ct=e=>window.matchMedia(e).matches;let St=Ie((()=>xt(navigator.userAgent,F.from(navigator.userAgentData),Ct)));const kt=()=>St(),_t=navigator.userAgent,Et=kt(),Tt=Et.browser,Ot=Et.os,At=Et.deviceType,Dt=-1!==_t.indexOf("Windows Phone"),Mt={transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",documentMode:Tt.isIE()?document.documentMode||7:10,cacheSuffix:null,container:null,canHaveCSP:!Tt.isIE(),windowsPhone:Dt,browser:{current:Tt.current,version:Tt.version,isChromium:Tt.isChromium,isEdge:Tt.isEdge,isFirefox:Tt.isFirefox,isIE:Tt.isIE,isOpera:Tt.isOpera,isSafari:Tt.isSafari},os:{current:Ot.current,version:Ot.version,isAndroid:Ot.isAndroid,isChromeOS:Ot.isChromeOS,isFreeBSD:Ot.isFreeBSD,isiOS:Ot.isiOS,isLinux:Ot.isLinux,isMacOS:Ot.isMacOS,isSolaris:Ot.isSolaris,isWindows:Ot.isWindows},deviceType:{isDesktop:At.isDesktop,isiPad:At.isiPad,isiPhone:At.isiPhone,isPhone:At.isPhone,isTablet:At.isTablet,isTouch:At.isTouch,isWebView:At.isWebView}},Nt=/^\s*|\s*$/g,Rt=e=>x(e)?"":(""+e).replace(Nt,""),Bt=function(e,t,o,n){n=n||this,e&&(o&&(e=e[o]),Me(e,((e,r)=>!1!==t.call(n,e,r,o)&&(Bt(e,t,o,n),!0))))},Lt={trim:Rt,isArray:De,is:(e,t)=>t?!("array"!==t||!De(e))||typeof e===t:void 0!==e,toArray:e=>{if(De(e))return e;{const t=[];for(let o=0,n=e.length;o{const n=h(e)?e.split(t||","):e||[];let r=n.length;for(;r--;)o[n[r]]={};return o},each:Me,map:Ne,grep:Re,inArray:(e,t)=>{if(e)for(let o=0,n=e.length;o{for(let o=0;o{const o=e.split(".");for(let e=0,n=o.length;ev(e)?e:""===e?[]:Ne(e.split(t||","),Rt),_addCacheSuffix:e=>{const t=Mt.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},Ht=(e,t,o=M)=>e.exists((e=>o(e,t))),It=(e,t,o=M)=>Pt(e,t,o).getOr(e.isNone()&&t.isNone()),Pt=(e,t,o)=>e.isSome()&&t.isSome()?F.some(o(e.getOrDie(),t.getOrDie())):F.none(),Ft=(e,t)=>e?F.some(t):F.none(),zt="undefined"!=typeof window?window:Function("return this;")(),Vt=(e,t)=>((e,t)=>{let o=null!=t?t:zt;for(let t=0;t{const o=((e,t)=>Vt(e,t))(e,t);if(null==o)throw new Error(e+" not available on this browser");return o},Ut=Object.getPrototypeOf,jt=e=>{const t=Vt("ownerDocument.defaultView",e);return p(e)&&((e=>Zt("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(Ut(e).constructor.name))},Wt=e=>e.dom.nodeName.toLowerCase(),$t=e=>e.dom.nodeType,qt=e=>t=>$t(t)===e,Gt=e=>Kt(e)&&jt(e.dom),Kt=qt(1),Yt=qt(3),Xt=qt(9),Jt=qt(11),Qt=e=>t=>Kt(t)&&Wt(t)===e,eo=(e,t,o)=>{if(!(h(o)||y(o)||k(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")},to=(e,t,o)=>{eo(e.dom,t,o)},oo=(e,t)=>{const o=e.dom;ve(t,((e,t)=>{eo(o,t,e)}))},no=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},ro=(e,t)=>F.from(no(e,t)),so=(e,t)=>{const o=e.dom;return!(!o||!o.hasAttribute)&&o.hasAttribute(t)},ao=(e,t)=>{e.dom.removeAttribute(t)},io=e=>J(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}),lo=(e,t)=>{const o=no(e,t);return void 0===o||""===o?[]:o.split(" ")},co=e=>void 0!==e.dom.classList,mo=e=>lo(e,"class"),uo=(e,t)=>((e,t,o)=>{const n=lo(e,t).concat([o]);return to(e,t,n.join(" ")),!0})(e,"class",t),go=(e,t)=>((e,t,o)=>{const n=Y(lo(e,t),(e=>e!==o));return n.length>0?to(e,t,n.join(" ")):ao(e,t),!1})(e,"class",t),ho=(e,t)=>{co(e)?e.dom.classList.add(t):uo(e,t)},po=e=>{0===(co(e)?e.dom.classList:mo(e)).length&&ao(e,"class")},fo=(e,t)=>{co(e)?e.dom.classList.remove(t):go(e,t),po(e)},vo=(e,t)=>{const o=co(e)?e.dom.classList.toggle(t):((e,t)=>j(mo(e),t)?go(e,t):uo(e,t))(e,t);return po(e),o},bo=(e,t)=>co(e)&&e.dom.classList.contains(t),yo=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},wo={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return yo(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return yo(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return yo(o)},fromDom:yo,fromPoint:(e,t,o)=>F.from(e.dom.elementFromPoint(t,o)).map(yo)},xo=(e,t)=>{const o=[],n=e=>(o.push(e),t(e));let r=t(e);do{r=r.bind(n)}while(r.isSome());return o},Co=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},So=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,ko=(e,t)=>e.dom===t.dom,_o=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},Eo=e=>wo.fromDom(e.dom.ownerDocument),To=e=>Xt(e)?e:Eo(e),Oo=e=>wo.fromDom(To(e).dom.defaultView),Ao=e=>F.from(e.dom.parentNode).map(wo.fromDom),Do=e=>F.from(e.dom.parentElement).map(wo.fromDom),Mo=(e,t)=>{const o=S(t)?t:I;let n=e.dom;const r=[];for(;null!==n.parentNode&&void 0!==n.parentNode;){const e=n.parentNode,t=wo.fromDom(e);if(r.push(t),!0===o(t))break;n=e}return r},No=e=>F.from(e.dom.previousSibling).map(wo.fromDom),Ro=e=>F.from(e.dom.nextSibling).map(wo.fromDom),Bo=e=>se(xo(e,No)),Lo=e=>xo(e,Ro),Ho=e=>$(e.dom.childNodes,wo.fromDom),Io=(e,t)=>{const o=e.dom.childNodes;return F.from(o[t]).map(wo.fromDom)},Po=e=>Io(e,0),Fo=e=>Io(e,e.dom.childNodes.length-1),zo=e=>e.dom.childNodes.length,Vo=e=>Jt(e)&&C(e.dom.host),Zo=S(Element.prototype.attachShadow)&&S(Node.prototype.getRootNode),Uo=A(Zo),jo=Zo?e=>wo.fromDom(e.dom.getRootNode()):To,Wo=e=>Vo(e)?e:(e=>{const t=e.dom.head;if(null==t)throw new Error("Head is not available yet");return wo.fromDom(t)})(To(e)),$o=e=>wo.fromDom(e.dom.host),qo=e=>{if(Uo()&&C(e.target)){const t=wo.fromDom(e.target);if(Kt(t)&&Go(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return de(t)}}return F.from(e.target)},Go=e=>C(e.dom.shadowRoot),Ko=e=>{const t=Yt(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return(e=>{const t=jo(e);return Vo(t)?F.some(t):F.none()})(wo.fromDom(t)).fold((()=>o.body.contains(t)),O(Ko,$o))};var Yo=(e,t,o,n,r)=>e(o,n)?F.some(o):S(r)&&r(o)?F.none():t(o,n,r);const Xo=(e,t,o)=>{let n=e.dom;const r=S(o)?o:I;for(;n.parentNode;){n=n.parentNode;const e=wo.fromDom(n);if(t(e))return F.some(e);if(r(e))break}return F.none()},Jo=(e,t,o)=>Yo(((e,t)=>t(e)),Xo,e,t,o),Qo=(e,t)=>ee(e.dom.childNodes,(e=>t(wo.fromDom(e)))).map(wo.fromDom),en=(e,t)=>{const o=e=>{for(let n=0;nXo(e,(e=>Co(e,t)),o),on=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return So(o)?F.none():F.from(o.querySelector(e)).map(wo.fromDom)})(t,e),nn=(e,t,o)=>Yo(((e,t)=>Co(e,t)),tn,e,t,o),rn=(e,t=!1)=>{return Ko(e)?e.dom.isContentEditable:(o=e,nn(o,"[contenteditable]")).fold(A(t),(e=>"true"===sn(e)));var o},sn=e=>e.dom.contentEditable,an=e=>void 0!==e.style&&S(e.style.getPropertyValue),ln=(e,t,o)=>{if(!h(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);an(e)&&e.style.setProperty(t,o)},cn=(e,t,o)=>{const n=e.dom;ln(n,t,o)},dn=(e,t)=>{const o=e.dom;ve(t,((e,t)=>{ln(o,t,e)}))},mn=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||Ko(e)?n:un(o,t)},un=(e,t)=>an(e)?e.style.getPropertyValue(t):"",gn=(e,t)=>{const o=e.dom,n=un(o,t);return F.from(n).filter((e=>e.length>0))},hn=e=>{const t={},o=e.dom;if(an(o))for(let e=0;e{((e,t)=>{an(e)&&e.style.removeProperty(t)})(e.dom,t),Ht(ro(e,"style").map(Ge),"")&&ao(e,"style")},fn=(e,t)=>{Ao(e).each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},vn=(e,t)=>{Ro(e).fold((()=>{Ao(e).each((e=>{yn(e,t)}))}),(e=>{fn(e,t)}))},bn=(e,t)=>{Po(e).fold((()=>{yn(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},yn=(e,t)=>{e.dom.appendChild(t.dom)},wn=(e,t)=>{fn(e,t),yn(t,e)},xn=(e,t)=>{q(t,(t=>{yn(e,t)}))},Cn=e=>{e.dom.textContent="",q(Ho(e),(e=>{Sn(e)}))},Sn=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},kn=e=>{const t=Ho(e);var o,n;t.length>0&&(o=e,q(n=t,((e,t)=>{const r=0===t?o:n[t-1];vn(r,e)}))),Sn(e)},_n=e=>$(e,wo.fromDom),En=e=>e.dom.innerHTML,Tn=(e,t)=>{const o=Eo(e).dom,n=wo.fromDom(o.createDocumentFragment()),r=((e,t)=>{const o=(t||document).createElement("div");return o.innerHTML=e,Ho(wo.fromDom(o))})(t,o);xn(n,r),Cn(e),yn(e,n)},On=(e,t)=>o=>{e(o)&&t((e=>{const t=wo.fromDom(qo(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),r=T(n,o);return((e,t,o,n,r,s,a)=>({target:e,x:t,y:o,stop:n,prevent:r,kill:s,raw:a}))(t,e.clientX,e.clientY,o,n,r,e)})(o))},An=(e,t,o,n)=>((e,t,o,n,r)=>{const s=On(o,n);return e.dom.addEventListener(t,s,r),{unbind:N(Dn,e,t,s,r)}})(e,t,o,n,!1),Dn=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},Mn=(e,t)=>({left:e,top:t,translate:(o,n)=>Mn(e+o,t+n)}),Nn=Mn,Rn=(e,t)=>void 0!==e?e:void 0!==t?t:0,Bn=e=>{const t=e.dom,o=t.ownerDocument.body;return o===t?Nn(o.offsetLeft,o.offsetTop):Ko(e)?(e=>{const t=e.getBoundingClientRect();return Nn(t.left,t.top)})(t):Nn(0,0)},Ln=e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return Nn(o,n)},Hn=(e,t,o)=>{const n=(void 0!==o?o.dom:document).defaultView;n&&n.scrollTo(e,t)},In=(e,t)=>{kt().browser.isSafari()&&S(e.dom.scrollIntoViewIfNeeded)?e.dom.scrollIntoViewIfNeeded(!1):e.dom.scrollIntoView(t)},Pn=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),Fn=e=>{const t=void 0===e?window:e,o=t.document,n=Ln(wo.fromDom(o));return(e=>{const t=void 0===e?window:e;return kt().browser.isFirefox()?F.none():F.from(t.visualViewport)})(t).fold((()=>{const e=t.document.documentElement,o=e.clientWidth,r=e.clientHeight;return Pn(n.left,n.top,o,r)}),(e=>Pn(Math.max(e.pageLeft,n.left),Math.max(e.pageTop,n.top),e.width,e.height)))},zn=(e,t)=>{let o=[];return q(Ho(e),(e=>{t(e)&&(o=o.concat([e])),o=o.concat(zn(e,t))})),o},Vn=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return So(o)?[]:$(o.querySelectorAll(e),wo.fromDom)})(t,e),Zn=(e,t,o)=>Xo(e,t,o).isSome(),Un=(e,t)=>((e,t)=>{const o=e.dom;return o.parentNode?Qo(wo.fromDom(o.parentNode),(o=>!ko(e,o)&&t(o))):F.none()})(e,t).isSome(),jn=(e,t)=>en(e,t).isSome();class Wn{constructor(e,t){this.node=e,this.rootNode=t,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}current(){return this.node}next(e){return this.node=this.findSibling(this.node,"firstChild","nextSibling",e),this.node}prev(e){return this.node=this.findSibling(this.node,"lastChild","previousSibling",e),this.node}prev2(e){return this.node=this.findPreviousNode(this.node,e),this.node}findSibling(e,t,o,n){if(e){if(!n&&e[t])return e[t];if(e!==this.rootNode){let t=e[o];if(t)return t;for(let n=e.parentNode;n&&n!==this.rootNode;n=n.parentNode)if(t=n[o],t)return t}}}findPreviousNode(e,t){if(e){const o=e.previousSibling;if(this.rootNode&&o===this.rootNode)return;if(o){if(!t)for(let e=o.lastChild;e;e=e.lastChild)if(!e.lastChild)return e;return o}const n=e.parentNode;if(n&&n!==this.rootNode)return n}}}const $n="\ufeff",qn=" ",Gn=e=>e===$n,Kn=/^[ \t\r\n]*$/,Yn=e=>Kn.test(e),Xn=e=>"\n"===e||"\r"===e,Jn=(e,t=4,o=!0,n=!0)=>{const r=((e,t)=>t<=0?"":new Array(t+1).join(e))(" ",t),s=e.replace(/\t/g,r),a=J(s,((e,t)=>(e=>-1!==" \f\t\v".indexOf(e))(t)||t===qn?e.pcIsSpace||""===e.str&&o||e.str.length===s.length-1&&n||((e,t)=>t=0&&Xn(e[t]))(s,e.str.length+1)?{pcIsSpace:!1,str:e.str+qn}:{pcIsSpace:!0,str:e.str+" "}:{pcIsSpace:Xn(t),str:e.str+t}),{pcIsSpace:!1,str:""});return a.str},Qn=e=>t=>!!t&&t.nodeType===e,er=e=>!!e&&!Object.getPrototypeOf(e),tr=Qn(1),or=e=>tr(e)&&Gt(wo.fromDom(e)),nr=e=>{const t=e.toLowerCase();return e=>C(e)&&e.nodeName.toLowerCase()===t},rr=e=>{const t=e.map((e=>e.toLowerCase()));return e=>{if(e&&e.nodeName){const o=e.nodeName.toLowerCase();return j(t,o)}return!1}},sr=(e,t)=>{const o=t.toLowerCase().split(" ");return t=>{if(tr(t)){const n=t.ownerDocument.defaultView;if(n)for(let r=0;rtr(e)&&e.hasAttribute("data-mce-bogus"),ir=e=>tr(e)&&"TABLE"===e.tagName,lr=e=>t=>{if(or(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1},cr=rr(["textarea","input"]),dr=Qn(3),mr=Qn(4),ur=Qn(7),gr=Qn(8),hr=Qn(9),pr=Qn(11),fr=nr("br"),vr=nr("img"),br=lr("true"),yr=lr("false"),wr=rr(["td","th"]),xr=rr(["td","th","caption"]),Cr=rr(["video","audio","object","embed"]),Sr=nr("li"),kr=nr("details"),_r=nr("summary"),Er={skipBogus:!0,includeZwsp:!1,checkRootAsContent:!1},Tr=(Or="data-mce-bookmark",e=>tr(e)&&e.hasAttribute(Or));var Or;const Ar=(e,t,o)=>Yn(e.data)&&!((e,t,o)=>{const n=wo.fromDom(t),r=wo.fromDom(e),s=o.getWhitespaceElements();return Zn(r,(e=>Ee(s,Wt(e))),N(ko,n))})(e,t,o),Dr=(e,t,o,n)=>dr(e)&&!Ar(e,t,o)&&(!n.includeZwsp||!(e=>{for(const t of e)if(!Gn(t))return!1;return!0})(e.data)),Mr=(e,t,o,n)=>S(n.isContent)&&n.isContent(t)||((e,t)=>tr(e)&&Ee(t.getNonEmptyElements(),e.nodeName))(t,e)||Tr(t)||(e=>tr(e)&&"A"===e.nodeName&&!e.hasAttribute("href")&&(e.hasAttribute("name")||e.hasAttribute("id")))(t)||Dr(t,o,e,n)||yr(t)||br(t)&&(e=>Do(wo.fromDom(e)).exists((e=>!rn(e))))(t),Nr=(e,t,o)=>{const n={...Er,...o};if(n.checkRootAsContent&&Mr(e,t,t,n))return!1;let r=t.firstChild,s=0;if(!r)return!0;const a=new Wn(r,t);do{if(n.skipBogus&&tr(r)){const e=r.getAttribute("data-mce-bogus");if(e){r=a.next("all"===e);continue}}if(gr(r))r=a.next(!0);else if(fr(r))s++,r=a.next();else{if(Mr(e,r,t,n))return!1;r=a.next()}}while(r);return s<=1},Rr=(e,t,o)=>Nr(e,t.dom,{checkRootAsContent:!0,...o}),Br=(e,t,o)=>Mr(e,t,t,{includeZwsp:Er.includeZwsp,...o}),Lr=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},Hr=e=>{const t=Lr(F.none()),o=()=>t.get().each((e=>clearInterval(e)));return{clear:()=>{o(),t.set(F.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:n=>{o(),t.set(F.some(setInterval(n,e)))}}},Ir=()=>{const e=(e=>{const t=Lr(F.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(F.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(F.some(e))}}})(E);return{...e,on:t=>e.get().each(t)}},Pr=e=>{const t=e.toLowerCase();return"svg"===t?"svg":"math"===t?"math":"html"},Fr=e=>"html"!==Pr(e),zr=e=>Fr(e.nodeName),Vr=e=>Pr(e.nodeName),Zr=["svg","math"],Ur="data-mce-block",jr=e=>$((e=>Y(pe(e),(e=>!/[A-Z]/.test(e))))(e),(e=>{const t=CSS.escape(e);return`${t}:`+$(Zr,(e=>`not(${e} ${t})`)).join(":")})).join(","),Wr=(e,t)=>C(t.querySelector(e))?(t.setAttribute(Ur,"true"),"inline-boundary"===t.getAttribute("data-mce-selected")&&t.removeAttribute("data-mce-selected"),!0):(t.removeAttribute(Ur),!1),$r=(e,t)=>{const o=jr(e.getTransparentElements()),n=jr(e.getBlockElements());return Y(t.querySelectorAll(o),(e=>Wr(n,e)))},qr=(e,t,o)=>{var n;const r=o?"lastChild":"firstChild";for(let o=t[r];o;o=o[r])if(Nr(e,o,{checkRootAsContent:!0}))return void(null===(n=o.parentNode)||void 0===n||n.removeChild(o))},Gr=(e,t,o)=>{const n=e.getBlockElements(),r=wo.fromDom(t),s=e=>Wt(e)in n,a=e=>ko(e,r);q(_n(o),(t=>{Xo(t,s,a).each((o=>{const n=((e,t)=>Y(Ho(e),t))(t,(t=>s(t)&&!e.isValidChild(Wt(o),Wt(t))));if(n.length>0){const t=Do(o);q(n,(t=>{Xo(t,s,a).each((o=>{((e,t,o)=>{const n=document.createRange(),r=t.parentNode;if(r){n.setStartBefore(t),n.setEndBefore(o);const s=n.extractContents();qr(e,s,!0),n.setStartAfter(o),n.setEndAfter(t);const a=n.extractContents();qr(e,a,!1),Nr(e,s,{checkRootAsContent:!0})||r.insertBefore(s,t),Nr(e,o,{checkRootAsContent:!0})||r.insertBefore(o,t),Nr(e,a,{checkRootAsContent:!0})||r.insertBefore(a,t),r.removeChild(t)}})(e,o.dom,t.dom)}))})),t.each((t=>$r(e,t.dom)))}}))}))},Kr=(e,t)=>{const o=$r(e,t);Gr(e,t,o),((e,t,o)=>{q([...o,...es(e,t)?[t]:[]],(t=>q(Vn(wo.fromDom(t),t.nodeName.toLowerCase()),(t=>{ts(e,t.dom)&&kn(t)}))))})(e,t,o)},Yr=(e,t)=>{if(Qr(e,t)){const o=jr(e.getBlockElements());Wr(o,t)}},Xr=e=>e.hasAttribute(Ur),Jr=(e,t)=>Ee(e.getTransparentElements(),t),Qr=(e,t)=>tr(t)&&Jr(e,t.nodeName),es=(e,t)=>Qr(e,t)&&Xr(t),ts=(e,t)=>Qr(e,t)&&!Xr(t),os=(e,t)=>1===t.type&&Jr(e,t.name)&&h(t.attr(Ur)),ns=kt().browser,rs=e=>ee(e,Kt),ss=(e,t)=>e.children&&j(e.children,t),as=(e,t,o)=>{let n=0,r=0;const s=e.ownerDocument;if(o=o||e,t){if(o===e&&t.getBoundingClientRect&&"static"===mn(wo.fromDom(e),"position")){const o=t.getBoundingClientRect();return n=o.left+(s.documentElement.scrollLeft||e.scrollLeft)-s.documentElement.clientLeft,r=o.top+(s.documentElement.scrollTop||e.scrollTop)-s.documentElement.clientTop,{x:n,y:r}}let a=t;for(;a&&a!==o&&a.nodeType&&!ss(a,o);){const e=a;n+=e.offsetLeft||0,r+=e.offsetTop||0,a=e.offsetParent}for(a=t.parentNode;a&&a!==o&&a.nodeType&&!ss(a,o);)n-=a.scrollLeft||0,r-=a.scrollTop||0,a=a.parentNode;r+=(e=>ns.isFirefox()&&"table"===Wt(e)?rs(Ho(e)).filter((e=>"caption"===Wt(e))).bind((e=>rs(Lo(e)).map((t=>{const o=t.dom.offsetTop,n=e.dom.offsetTop,r=e.dom.offsetHeight;return o<=n?-r:0})))).getOr(0):0)(wo.fromDom(t))}return{x:n,y:r}},is=(e,t={})=>{let o=0;const n={},r=wo.fromDom(e),s=To(r),a=e=>{yn(Wo(r),e)},i=e=>{const t=Wo(r);on(t,"#"+e).each(Sn)},l=e=>_e(n,e).getOrThunk((()=>({id:"mce-u"+o++,passed:[],failed:[],count:0}))),c=e=>new Promise(((o,r)=>{let i;const c=Lt._addCacheSuffix(e),d=l(c);n[c]=d,d.count++;const m=(e,t)=>{q(e,H),d.status=t,d.passed=[],d.failed=[],i&&(i.onload=null,i.onerror=null,i=null)},u=()=>m(d.passed,2),g=()=>m(d.failed,3);if(o&&d.passed.push(o),r&&d.failed.push(r),1===d.status)return;if(2===d.status)return void u();if(3===d.status)return void g();d.status=1;const h=wo.fromTag("link",s.dom);oo(h,{rel:"stylesheet",type:"text/css",id:d.id}),t.contentCssCors&&to(h,"crossOrigin","anonymous"),t.referrerPolicy&&to(h,"referrerpolicy",t.referrerPolicy),i=h.dom,i.onload=u,i.onerror=g,a(h),to(h,"href",c)})),d=e=>{const t=Lt._addCacheSuffix(e);_e(n,t).each((e=>{0==--e.count&&(delete n[t],i(e.id))}))};return{load:c,loadRawCss:(e,t)=>{const o=l(e);n[e]=o,o.count++;const r=wo.fromTag("style",s.dom);oo(r,{rel:"stylesheet",type:"text/css",id:o.id}),r.dom.innerHTML=t,a(r)},loadAll:e=>Promise.allSettled($(e,(e=>c(e).then(A(e))))).then((e=>{const t=K(e,(e=>"fulfilled"===e.status));return t.fail.length>0?Promise.reject($(t.fail,(e=>e.reason))):$(t.pass,(e=>e.value))})),unload:d,unloadRawCss:e=>{_e(n,e).each((t=>{0==--t.count&&(delete n[e],i(t.id))}))},unloadAll:e=>{q(e,(e=>{d(e)}))},_setReferrerPolicy:e=>{t.referrerPolicy=e},_setContentCssCors:e=>{t.contentCssCors=e}}},ls=(()=>{const e=new WeakMap;return{forElement:(t,o)=>{const n=jo(t).dom;return F.from(e.get(n)).getOrThunk((()=>{const t=is(n,o);return e.set(n,t),t}))}}})(),cs=(e,t)=>C(e)&&(Br(t,e)||t.isInline(e.nodeName.toLowerCase())),ds=e=>(e=>"span"===e.nodeName.toLowerCase())(e)&&"bookmark"===e.getAttribute("data-mce-type"),ms=(e,t,o)=>dr(e)&&e.data.length>0&&((e,t,o)=>{const n=new Wn(e,t).prev(!1),r=new Wn(e,t).next(!1),s=w(n)||cs(n,o),a=w(r)||cs(r,o);return s&&a})(e,t,o),us=(e,t,o,n)=>{var r;const s=n||t;if(tr(t)&&ds(t))return t;const a=t.childNodes;for(let t=a.length-1;t>=0;t--)us(e,a[t],o,s);if(tr(t)){const e=t.childNodes;1===e.length&&ds(e[0])&&(null===(r=t.parentNode)||void 0===r||r.insertBefore(e[0],t))}return(e=>pr(e)||hr(e))(t)||Br(o,t)||(e=>!!tr(e)&&e.childNodes.length>0)(t)||ms(t,s,o)||e.remove(t),t},gs=Lt.makeMap,hs=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ps=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,fs=/[<>&\"\']/g,vs=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,bs={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},ys={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},ws={"<":"<",">":">","&":"&",""":'"',"'":"'"},xs=(e,t)=>{const o={};if(e){const n=e.split(",");t=t||10;for(let e=0;ee.replace(t?hs:ps,(e=>ys[e]||e)),ks=(e,t)=>e.replace(t?hs:ps,(e=>e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":ys[e]||"&#"+e.charCodeAt(0)+";")),_s=(e,t,o)=>{const n=o||Cs;return e.replace(t?hs:ps,(e=>ys[e]||n[e]||e))},Es={encodeRaw:Ss,encodeAllRaw:e=>(""+e).replace(fs,(e=>ys[e]||e)),encodeNumeric:ks,encodeNamed:_s,getEncodeFunc:(e,t)=>{const o=xs(t)||Cs,n=(e,t)=>e.replace(t?hs:ps,(e=>void 0!==ys[e]?ys[e]:void 0!==o[e]?o[e]:e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";")),r=(e,t)=>_s(e,t,o),s=gs(e.replace(/\+/g,","));return s.named&&s.numeric?n:s.named?t?r:_s:s.numeric?ks:Ss},decode:e=>e.replace(vs,((e,t)=>t?(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))>65535?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):bs[t]||String.fromCharCode(t):ws[e]||Cs[e]||(e=>{const t=wo.fromTag("div").dom;return t.innerHTML=e,t.textContent||t.innerText||e})(e)))},Ts=(e,t)=>(e=Lt.trim(e))?e.split(t||" "):[],Os=e=>new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$"),As=e=>{const t=e=>v(e)?$(e,t):(e=>p(e)&&e.source&&"[object RegExp]"===Object.prototype.toString.call(e))(e)?new RegExp(e.source,e.flags):p(e)?be(e,t):e;return t(e)},Ds=e=>Object.freeze(["id","accesskey","class","dir","lang","style","tabindex","title","role",..."html4"!==e?["contenteditable","contextmenu","draggable","dropzone","hidden","spellcheck","translate","itemprop","itemscope","itemtype"]:[],..."html5-strict"!==e?["xml:lang"]:[]]),Ms=e=>{let t,o;t="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",o="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==e&&(t+=" article aside details dialog figure main header footer hgroup section nav a ins del canvas map",o+=" audio canvas command data datalist mark meter output picture progress time wbr video ruby bdi keygen svg"),"html5-strict"!==e&&(o=[o,"acronym applet basefont big font strike tt"].join(" "),t=[t,"center dir isindex noframes"].join(" "));const n=[t,o].join(" ");return{blockContent:t,phrasingContent:o,flowContent:n}},Ns=e=>{const{blockContent:t,phrasingContent:o,flowContent:n}=Ms(e),r=e=>Object.freeze(e.split(" "));return Object.freeze({blockContent:r(t),phrasingContent:r(o),flowContent:r(n)})},Rs={html4:Ie((()=>Ns("html4"))),html5:Ie((()=>Ns("html5"))),"html5-strict":Ie((()=>Ns("html5-strict")))},Bs=(e,t)=>{const{blockContent:o,phrasingContent:n,flowContent:r}=Rs[e]();return"blocks"===t?F.some(o):"phrasing"===t?F.some(n):"flow"===t?F.some(r):F.none()},Ls=e=>F.from(/^(@?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)$/.exec(e)).map((e=>({preset:"@"===e[1],name:e[2]}))),Hs=(e,t)=>{const o=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/;return ne(Ts(t,","),(t=>{const n=o.exec(t);if(n){const t=n[1],o=n[2],r=n[3],s=n[4],a=n[5],i={attributes:{},attributesOrder:[]};if(e.each((e=>((e,t)=>{ve(e.attributes,((e,o)=>{t.attributes[o]=e})),t.attributesOrder.push(...e.attributesOrder)})(e,i))),"#"===t?i.paddEmpty=!0:"-"===t&&(i.removeEmpty=!0),"!"===s&&(i.removeEmptyAttrs=!0),a&&((e,t)=>{const o=/^([!\-])?(\w+[\\:]:\w+|[^=~<]+)?(?:([=~<])(.*))?$/,n=/[*?+]/,{attributes:r,attributesOrder:s}=t;q(Ts(e,"|"),(e=>{const a=o.exec(e);if(a){const e={},o=a[1],i=a[2].replace(/[\\:]:/g,":"),l=a[3],c=a[4];if("!"===o&&(t.attributesRequired=t.attributesRequired||[],t.attributesRequired.push(i),e.required=!0),"-"===o)return delete r[i],void s.splice(Lt.inArray(s,i),1);if(l&&("="===l?(t.attributesDefault=t.attributesDefault||[],t.attributesDefault.push({name:i,value:c}),e.defaultValue=c):"~"===l?(t.attributesForced=t.attributesForced||[],t.attributesForced.push({name:i,value:c}),e.forcedValue=c):"<"===l&&(e.validValues=Lt.makeMap(c,"?"))),n.test(i)){const o=e;t.attributePatterns=t.attributePatterns||[],o.pattern=Os(i),t.attributePatterns.push(o)}else r[i]||s.push(i),r[i]=e}}))})(a,i),r&&(i.outputName=o),"@"===o){if(!e.isNone())return[];e=F.some(i)}return[r?{name:o,element:i,aliasName:r}:{name:o,element:i}]}return[]}))},Is={},Ps=Lt.makeMap,Fs=Lt.each,zs=Lt.extend,Vs=Lt.explode,Zs=(e,t={})=>{const o=Ps(e," ",Ps(e.toUpperCase()," "));return zs(o,t)},Us=e=>Zs("td th li dt dd figcaption caption details summary",e.getTextBlockElements()),js=(e,t)=>{if(e){const o={};return h(e)&&(e={"*":e}),Fs(e,((e,n)=>{o[n]=o[n.toUpperCase()]="map"===t?Ps(e,/[, ]/):Vs(e,/[, ]/)})),o}},Ws=(e={})=>{var t;const o={},n={};let r=[];const s={},a={},i=(t,o,n)=>{const r=e[t];if(r)return Ps(r,/[, ]/,Ps(r.toUpperCase(),/[, ]/));{let e=Is[t];return e||(e=Zs(o,n),Is[t]=e),e}},l=null!==(t=e.schema)&&void 0!==t?t:"html5",c=(e=>{const t=Ds(e),{phrasingContent:o,flowContent:n}=Ms(e),r={},s=(e,t,o)=>{r[e]={attributes:ie(t,A({})),attributesOrder:t,children:ie(o,A({}))}},a=(e,o="",n="")=>{const r=Ts(n),a=Ts(e);let i=a.length;const l=[...t,...Ts(o)];for(;i--;)s(a[i],l.slice(),r)},i=(e,t)=>{const o=Ts(e),n=Ts(t);let s=o.length;for(;s--;){const e=r[o[s]];for(let t=0,o=n.length;t{a(e,"",o)})),q(Ts("center dir isindex noframes"),(e=>{a(e,"",n)}))),a("html","manifest","head body"),a("head","","base command link meta noscript script style title"),a("title hr noscript br"),a("base","href target"),a("link","href rel media hreflang type sizes hreflang"),a("meta","name http-equiv content charset"),a("style","media type scoped"),a("script","src async defer type charset"),a("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",n),a("dd div","",n),a("address dt caption","","html4"===e?o:n),a("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",o),a("blockquote","cite",n),a("ol","reversed start type","li"),a("ul","","li"),a("li","value",n),a("dl","","dt dd"),a("a","href target rel media hreflang type","html4"===e?o:n),a("q","cite",o),a("ins del","cite datetime",n),a("img","src sizes srcset alt usemap ismap width height"),a("iframe","src name width height",n),a("embed","src type width height"),a("object","data type typemustmatch name usemap form width height",[n,"param"].join(" ")),a("param","name value"),a("map","name",[n,"area"].join(" ")),a("area","alt coords shape href target rel media hreflang type"),a("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),a("colgroup","span","col"),a("col","span"),a("tbody thead tfoot","","tr"),a("tr","","td th"),a("td","colspan rowspan headers",n),a("th","colspan rowspan headers scope abbr",n),a("form","accept-charset action autocomplete enctype method name novalidate target",n),a("fieldset","disabled form name",[n,"legend"].join(" ")),a("label","form for",o),a("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),a("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?n:o),a("select","disabled form multiple name required size","option optgroup"),a("optgroup","disabled label","option"),a("option","disabled label selected value"),a("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),a("menu","type label",[n,"li"].join(" ")),a("noscript","",n),"html4"!==e&&(a("wbr"),a("ruby","",[o,"rt rp"].join(" ")),a("figcaption","",n),a("mark rt rp bdi","",o),a("summary","",[o,"h1 h2 h3 h4 h5 h6"].join(" ")),a("canvas","width height",n),a("data","value",o),a("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[n,"track source"].join(" ")),a("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[n,"track source"].join(" ")),a("picture","","img source"),a("source","src srcset type media sizes"),a("track","kind src srclang label default"),a("datalist","",[o,"option"].join(" ")),a("article section nav aside main header footer","",n),a("hgroup","","h1 h2 h3 h4 h5 h6"),a("figure","",[n,"figcaption"].join(" ")),a("time","datetime",o),a("dialog","open",n),a("command","type label icon disabled checked radiogroup command"),a("output","for form name",o),a("progress","value max",o),a("meter","value min max low high optimum",o),a("details","open",[n,"summary"].join(" ")),a("keygen","autofocus challenge disabled form keytype name"),s("svg","id tabindex lang xml:space class style x y width height viewBox preserveAspectRatio zoomAndPan transform".split(" "),[])),"html5-strict"!==e&&(i("script","language xml:space"),i("style","xml:space"),i("object","declare classid code codebase codetype archive standby align border hspace vspace"),i("embed","align name hspace vspace"),i("param","valuetype type"),i("a","charset name rev shape coords"),i("br","clear"),i("applet","codebase archive code object alt name width height align hspace vspace"),i("img","name longdesc align border hspace vspace"),i("iframe","longdesc frameborder marginwidth marginheight scrolling align"),i("font basefont","size color face"),i("input","usemap align"),i("select"),i("textarea"),i("h1 h2 h3 h4 h5 h6 div p legend caption","align"),i("ul","type compact"),i("li","type"),i("ol dl menu dir","compact"),i("pre","width xml:space"),i("hr","align noshade size width"),i("isindex","prompt"),i("table","summary width frame rules cellspacing cellpadding align bgcolor"),i("col","width align char charoff valign"),i("colgroup","width align char charoff valign"),i("thead","align char charoff valign"),i("tr","align char charoff valign bgcolor"),i("th","axis align char charoff valign nowrap bgcolor width height"),i("form","accept"),i("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),i("tfoot","align char charoff valign"),i("tbody","align char charoff valign"),i("area","nohref"),i("body","background bgcolor text link vlink alink")),"html4"!==e&&(i("input button select textarea","autofocus"),i("input textarea","placeholder"),i("a","download"),i("link script img","crossorigin"),i("img","loading"),i("iframe","sandbox seamless allow allowfullscreen loading referrerpolicy")),"html4"!==e&&q([r.video,r.audio],(e=>{delete e.children.audio,delete e.children.video})),q(Ts("a form meter progress dfn"),(e=>{r[e]&&delete r[e].children[e]})),delete r.caption.children.table,delete r.script,r})(l);!1===e.verify_html&&(e.valid_elements="*[*]");const d=js(e.valid_styles),m=js(e.invalid_styles,"map"),u=js(e.valid_classes,"map"),g=i("whitespace_elements","pre script noscript style textarea video audio iframe object code"),f=i("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),b=i("void_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),w=i("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls allowfullscreen"),x="td th iframe video audio object script code",C=i("non_empty_elements",x+" pre svg textarea summary",b),S=i("move_caret_before_on_enter_elements",x+" table",b),k="h1 h2 h3 h4 h5 h6",_=i("text_block_elements",k+" p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),E=i("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary html body multicol listing",_),T=i("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp"),O=i("transparent_elements","a ins del canvas map"),D=i("wrap_block_elements","pre "+k);Fs("script noscript iframe noframes noembed title style textarea xmp plaintext".split(" "),(e=>{a[e]=new RegExp("]*>","gi")}));const M=e=>{const t=F.from(o["@"]),n=/[*?+]/;q(Hs(t,null!=e?e:""),(({name:e,element:t,aliasName:s})=>{if(s&&(o[s]=t),n.test(e)){const o=t;o.pattern=Os(e),r.push(o)}else o[e]=t}))},N=e=>{r=[],q(pe(o),(e=>{delete o[e]})),M(e)},R=(e,t)=>{var r,a;delete Is.text_block_elements,delete Is.block_elements;const i=!!t.extends&&!oe(t.extends),c=t.extends;if(n[e]=c?n[c]:{},s[e]=null!=c?c:e,C[e.toUpperCase()]={},C[e]={},i||(E[e.toUpperCase()]={},E[e]={}),c&&!o[e]&&o[c]){const t=As(o[c]);delete t.removeEmptyAttrs,delete t.removeEmpty,o[e]=t}else o[e]={attributesOrder:[],attributes:{}};if(v(t.attributes)){const n=e=>{s.attributesOrder.push(e),s.attributes[e]={}},s=null!==(r=o[e])&&void 0!==r?r:{};delete s.attributesDefault,delete s.attributesForced,delete s.attributePatterns,delete s.attributesRequired,s.attributesOrder=[],s.attributes={},q(t.attributes,(e=>{const t=Ds(l);Ls(e).each((({preset:e,name:o})=>{e?"global"===o&&q(t,n):n(o)}))})),o[e]=s}if(y(t.padEmpty)){const n=null!==(a=o[e])&&void 0!==a?a:{};n.paddEmpty=t.padEmpty,o[e]=n}if(v(t.children)){const o={},r=e=>{o[e]={}},s=e=>{Bs(l,e).each((e=>{q(e,r)}))};q(t.children,(e=>{Ls(e).each((({preset:e,name:t})=>{e?s(t):r(t)}))})),n[e]=o}c&&ve(n,((t,o)=>{t[c]&&(n[o]=t=zs({},n[o]),t[e]=t[c])}))},B=e=>{q((e=>{const t=/^(~)?(.+)$/;return ne(Ts(e,","),(e=>{const o=t.exec(e);return o?[{cloneName:"~"===o[1]?"span":"div",name:o[2]}]:[]}))})(null!=e?e:""),(({name:e,cloneName:t})=>{R(e,{extends:t})}))},L=e=>{p(e)?ve(e,((e,t)=>R(t,e))):h(e)&&B(e)},H=e=>{q((e=>{const t=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;return ne(Ts(e,","),(e=>{const o=t.exec(e);if(o){const e=o[1],t=e?(e=>"-"===e?"remove":"add")(e):"replace";return[{operation:t,name:o[2],validChildren:ne(Ts(o[3],"|"),(e=>Ls(e).toArray()))}]}return[]}))})(null!=e?e:""),(({operation:e,name:t,validChildren:o})=>{const r="replace"===e?{"#comment":{}}:n[t],s=t=>{"remove"===e?delete r[t]:r[t]={}};q(o,(({preset:e,name:t})=>{e?(e=>{Bs(l,e).each((e=>{q(e,s)}))})(t):s(t)})),n[t]=r}))},I=e=>{const t=o[e];if(t)return t;let n=r.length;for(;n--;){const t=r[n];if(t.pattern.test(e))return t}},P=A(d),z=A(m),V=A(u),Z=A(w),U=A(E),j=A(_),W=A(T),$=A(Object.seal(b)),G=A(f),K=A(C),Y=A(S),X=A(g),J=A(O),Q=A(D),ee=A(Object.seal(a)),te=(e,t)=>{const o=I(e);if(o){if(!t)return!0;{if(o.attributes[t])return!0;const e=o.attributePatterns;if(e){let o=e.length;for(;o--;)if(e[o].pattern.test(t))return!0}}}return!1},oe=e=>Ee(U(),e),re=e=>!We(e,"#")&&te(e)&&!oe(e),se=A(s);return e.valid_elements?(N(e.valid_elements),Fs(c,((e,t)=>{n[t]=e.children}))):(Fs(c,((e,t)=>{o[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},n[t]=e.children})),Fs(Ts("strong/b em/i"),(e=>{const t=Ts(e,"/");o[t[1]].outputName=t[0]})),Fs(T,((t,n)=>{o[n]&&(e.padd_empty_block_inline_children&&(o[n].paddInEmptyBlock=!0),o[n].removeEmpty=!0)})),Fs(Ts("ol ul blockquote a table tbody"),(e=>{o[e]&&(o[e].removeEmpty=!0)})),Fs(Ts("p h1 h2 h3 h4 h5 h6 th td pre div address caption li summary"),(e=>{o[e]&&(o[e].paddEmpty=!0)})),Fs(Ts("span"),(e=>{o[e].removeEmptyAttrs=!0}))),delete o.svg,L(e.custom_elements),H(e.valid_children),M(e.extended_valid_elements),H("+ol[ul|ol],+ul[ul|ol]"),Fs({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},((e,t)=>{o[t]&&(o[t].parentsRequired=Ts(e))})),e.invalid_elements&&Fs(Vs(e.invalid_elements),(e=>{o[e]&&delete o[e]})),I("span")||M("span[!data-mce-type|*]"),{type:l,children:n,elements:o,getValidStyles:P,getValidClasses:V,getBlockElements:U,getInvalidStyles:z,getVoidElements:$,getTextBlockElements:j,getTextInlineElements:W,getBoolAttrs:Z,getElementRule:I,getSelfClosingElements:G,getNonEmptyElements:K,getMoveCaretBeforeOnEnterElements:Y,getWhitespaceElements:X,getTransparentElements:J,getSpecialElements:ee,isValidChild:(e,t)=>{const o=n[e.toLowerCase()];return!(!o||!o[t.toLowerCase()])},isValid:te,isBlock:oe,isInline:re,isWrapper:e=>Ee(Q(),e)||re(e),getCustomElements:se,addValidElements:M,setValidElements:N,addCustomElements:L,addValidChildren:H}},$s=e=>Ue(e,"#").toUpperCase(),qs=e=>{const t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},Gs=e=>(e=>({value:$s(e)}))(qs(e.red)+qs(e.green)+qs(e.blue)),Ks=/^\s*rgb\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*\)\s*$/i,Ys=/^\s*rgba\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*((?:\d?\.\d+|\d+)%?)\s*\)\s*$/i,Xs=(e,t,o,n)=>((e,t,o,n)=>({red:e,green:t,blue:o,alpha:n}))(parseInt(e,10),parseInt(t,10),parseInt(o,10),parseFloat(n)),Js=e=>{const t=Ks.exec(e);if(null!==t)return F.some(Xs(t[1],t[2],t[3],"1"));const o=Ys.exec(e);return null!==o?F.some(Xs(o[1],o[2],o[3],o[4])):F.none()},Qs=e=>`rgba(${e.red},${e.green},${e.blue},${e.alpha})`,ea=e=>Js(e).map(Gs).map((e=>"#"+e.value)).getOr(e),ta=(e={},t)=>{const o=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,n=/\s*([^:]+):\s*([^;]+);?/g,r=/\s+$/,s={};let a,i;const l=$n;t&&(a=t.getValidStyles(),i=t.getInvalidStyles());const c="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(let e=0;e{const a={};let i=!1;const c=e.url_converter,m=e.url_converter_scope||d,u=(e,t,o)=>{const n=a[e+"-top"+t];if(!n)return;const r=a[e+"-right"+t];if(!r)return;const s=a[e+"-bottom"+t];if(!s)return;const i=a[e+"-left"+t];if(!i)return;const l=[n,r,s,i];let c=l.length-1;for(;c--&&l[c]===l[c+1];);c>-1&&o||(a[e+t]=-1===c?l[0]:l.join(" "),delete a[e+"-top"+t],delete a[e+"-right"+t],delete a[e+"-bottom"+t],delete a[e+"-left"+t])},g=e=>{const t=a[e];if(!t)return;const o=t.indexOf(",")>-1?[t]:t.split(" ");let n=o.length;for(;n--;)if(o[n]!==o[0])return!1;return a[e]=o[0],!0},h=e=>(i=!0,s[e]),p=(e,t)=>(i&&(e=e.replace(/\uFEFF[0-9]/g,(e=>s[e]))),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e),f=e=>String.fromCharCode(parseInt(e.slice(1),16)),v=e=>e.replace(/\\[0-9a-f]+/gi,f),b=(t,o,n,r,s,a)=>{if(s=s||a)return"'"+(s=p(s)).replace(/\'/g,"\\'")+"'";if(o=p(o||n||r||""),!e.allow_script_urls){const t=o.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(t))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(t))return""}return c&&(o=c.call(m,o,"style")),"url('"+o.replace(/\'/g,"\\'")+"')"};if(t){let s;for(t=(t=t.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,h).replace(/\"[^\"]+\"|\'[^\']+\'/g,(e=>e.replace(/[;:]/g,h)));s=n.exec(t);){n.lastIndex=s.index+s[0].length;let t=s[1].replace(r,"").toLowerCase(),c=s[2].replace(r,"");if(t&&c){if(t=v(t),c=v(c),-1!==t.indexOf(l)||-1!==t.indexOf('"'))continue;if(!e.allow_script_urls&&("behavior"===t||/expression\s*\(|\/\*|\*\//.test(c)))continue;"font-weight"===t&&"700"===c?c="bold":"color"!==t&&"background-color"!==t||(c=c.toLowerCase()),"rgb"==(S=c,Ks.test(S)?"rgb":Ys.test(S)?"rgba":"other")&&Js(c).each((e=>{c=ea(Qs(e)).toLowerCase()})),c=c.replace(o,b),a[t]=i?p(c,!0):c}}u("border","",!0),u("border","-width"),u("border","-color"),u("border","-style"),u("padding",""),u("margin",""),y="border",x="border-style",C="border-color",g(w="border-width")&&g(x)&&g(C)&&(a[y]=a[w]+" "+a[x]+" "+a[C],delete a[w],delete a[x],delete a[C]),"medium none"===a.border&&delete a.border,"none"===a["border-image"]&&delete a["border-image"]}var y,w,x,C,S;return a},serialize:(e,t)=>{let o="";const n=(t,n)=>{const r=n[t];if(r)for(let t=0,n=r.length;t0?" ":"")+n+": "+s+";")}};return t&&a?(n("*",a),n(t,a)):ve(e,((e,n)=>{e&&((e,t)=>{if(!i||!t)return!0;let o=i["*"];return!(o&&o[e]||(o=i[t],o&&o[e]))})(n,t)&&(o+=(o.length>0?" ":"")+n+": "+e+";")})),o}};return d},oa={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},na=e=>x(e.preventDefault)||(e=>e instanceof Event||S(e.initEvent))(e),ra=(e,t)=>{const o=null!=t?t:{};for(const t in e)Ee(oa,t)||(o[t]=e[t]);return C(e.composedPath)&&(o.composedPath=()=>e.composedPath()),C(e.getModifierState)&&(o.getModifierState=t=>e.getModifierState(t)),C(e.getTargetRanges)&&(o.getTargetRanges=()=>e.getTargetRanges()),o},sa=(e,t,o,n)=>{var r;const s=ra(t,n);return s.type=e,x(s.target)&&(s.target=null!==(r=s.srcElement)&&void 0!==r?r:o),na(t)&&(s.preventDefault=()=>{s.defaultPrevented=!0,s.isDefaultPrevented=P,S(t.preventDefault)&&t.preventDefault()},s.stopPropagation=()=>{s.cancelBubble=!0,s.isPropagationStopped=P,S(t.stopPropagation)&&t.stopPropagation()},s.stopImmediatePropagation=()=>{s.isImmediatePropagationStopped=P,s.stopPropagation()},(e=>e.isDefaultPrevented===P||e.isDefaultPrevented===I)(s)||(s.isDefaultPrevented=!0===s.defaultPrevented?P:I,s.isPropagationStopped=!0===s.cancelBubble?P:I,s.isImmediatePropagationStopped=I)),s},aa=/^(?:mouse|contextmenu)|click/,ia=(e,t,o,n)=>{e.addEventListener(t,o,n||!1)},la=(e,t,o,n)=>{e.removeEventListener(t,o,n||!1)},ca=(e,t)=>{const o=sa(e.type,e,document,t);if((e=>C(e)&&aa.test(e.type))(e)&&w(e.pageX)&&!w(e.clientX)){const t=o.target.ownerDocument||document,n=t.documentElement,r=t.body,s=o;s.pageX=e.clientX+(n&&n.scrollLeft||r&&r.scrollLeft||0)-(n&&n.clientLeft||r&&r.clientLeft||0),s.pageY=e.clientY+(n&&n.scrollTop||r&&r.scrollTop||0)-(n&&n.clientTop||r&&r.clientTop||0)}return o},da=(e,t,o)=>{const n=e.document,r={type:"ready"};if(o.domLoaded)return void t(r);const s=()=>{la(e,"DOMContentLoaded",s),la(e,"load",s),o.domLoaded||(o.domLoaded=!0,t(r)),e=null};"complete"===n.readyState||"interactive"===n.readyState&&n.body?s():ia(e,"DOMContentLoaded",s),o.domLoaded||ia(e,"load",s)};class ma{constructor(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}bind(e,t,o,n){const r=this;let s;const a=window,i=e=>{r.executeHandlers(ca(e||a.event),l)};if(!e||dr(e)||gr(e))return o;let l;e[r.expando]?l=e[r.expando]:(l=r.count++,e[r.expando]=l,r.events[l]={}),n=n||e;const c=t.split(" ");let d=c.length;for(;d--;){let t=c[d],m=i,u=!1,g=!1;"DOMContentLoaded"===t&&(t="ready"),r.domLoaded&&"ready"===t&&"complete"===e.readyState?o.call(n,ca({type:t})):(r.hasFocusIn||"focusin"!==t&&"focusout"!==t||(u=!0,g="focusin"===t?"focus":"blur",m=e=>{const t=ca(e||a.event);t.type="focus"===t.type?"focusin":"focusout",r.executeHandlers(t,l)}),s=r.events[l][t],s?"ready"===t&&r.domLoaded?o(ca({type:t})):s.push({func:o,scope:n}):(r.events[l][t]=s=[{func:o,scope:n}],s.fakeName=g,s.capture=u,s.nativeHandler=m,"ready"===t?da(e,m,r):ia(e,g||t,m,u)))}return e=s=null,o}unbind(e,t,o){if(!e||dr(e)||gr(e))return this;const n=e[this.expando];if(n){let r=this.events[n];if(t){const n=t.split(" ");let s=n.length;for(;s--;){const t=n[s],a=r[t];if(a){if(o){let e=a.length;for(;e--;)if(a[e].func===o){const o=a.nativeHandler,n=a.fakeName,s=a.capture,i=a.slice(0,e).concat(a.slice(e+1));i.nativeHandler=o,i.fakeName=n,i.capture=s,r[t]=i}}o&&0!==a.length||(delete r[t],la(e,a.fakeName||t,a.nativeHandler,a.capture))}}}else ve(r,((t,o)=>{la(e,t.fakeName||o,t.nativeHandler,t.capture)})),r={};for(const e in r)if(Ee(r,e))return this;delete this.events[n];try{delete e[this.expando]}catch(t){e[this.expando]=null}}return this}fire(e,t,o){return this.dispatch(e,t,o)}dispatch(e,t,o){if(!e||dr(e)||gr(e))return this;const n=ca({type:t,target:e},o);do{const t=e[this.expando];t&&this.executeHandlers(n,t),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow}while(e&&!n.isPropagationStopped());return this}clean(e){if(!e||dr(e)||gr(e))return this;if(e[this.expando]&&this.unbind(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName){this.unbind(e);const t=e.getElementsByTagName("*");let o=t.length;for(;o--;)(e=t[o])[this.expando]&&this.unbind(e)}return this}destroy(){this.events={}}cancel(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}executeHandlers(e,t){const o=this.events[t],n=o&&o[e.type];if(n)for(let t=0,o=n.length;t{x(o)||""===o?ao(e,t):to(e,t,o)},va=e=>e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),ba=(e,t)=>{let o=0;if(e)for(let n=e.nodeType,r=e.previousSibling;r;r=r.previousSibling){const e=r.nodeType;(!t||!dr(r)||e!==n&&r.data.length)&&(o++,n=e)}return o},ya=(e,t)=>{const o=no(t,"style"),n=e.serialize(e.parse(o),Wt(t));fa(t,ha,n)},wa=(e,t,o)=>{const n=va(t);x(o)||""===o?pn(e,n):cn(e,n,((e,t)=>k(e)?Ee(pa,t)?e+"":e+"px":e)(o,n))},xa=(e,t={})=>{const o={},n=window,r={};let s=0;const a=ls.forElement(wo.fromDom(e),{contentCssCors:t.contentCssCors,referrerPolicy:t.referrerPolicy}),i=[],l=t.schema?t.schema:Ws({}),c=ta({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),d=t.ownEvents?new ma:ma.Event,m=l.getBlockElements(),u=t=>t&&e&&h(t)?e.getElementById(t):t,g=e=>{const t=u(e);return C(t)?wo.fromDom(t):null},p=(e,t,o="")=>{let n;const r=g(e);if(C(r)&&Kt(r)){const e=G[t];n=e&&e.get?e.get(r.dom,t):no(r,t)}return C(n)?n:o},b=e=>{const t=u(e);return x(t)?[]:t.attributes},y=(e,o,n)=>{N(e,(e=>{if(tr(e)){const r=wo.fromDom(e),s=""===n?null:n,a=no(r,o),i=G[o];i&&i.set?i.set(r.dom,s,o):fa(r,o,s),a!==s&&t.onSetAttrib&&t.onSetAttrib({attrElm:r.dom,attrName:o,attrValue:s})}}))},w=()=>t.root_element||e.body,k=(t,o)=>as(e.body,u(t),o),_=(e,t,o)=>{const n=u(e);var r;if(!x(n)&&(or(n)||tr(r=n)&&"http://www.w3.org/2000/svg"===r.namespaceURI))return o?mn(wo.fromDom(n),va(t)):("float"===(t=t.replace(/-(\D)/g,((e,t)=>t.toUpperCase())))&&(t="cssFloat"),n.style?n.style[t]:void 0)},T=e=>{const t=u(e);if(!t)return{w:0,h:0};let o=_(t,"width"),n=_(t,"height");return o&&-1!==o.indexOf("px")||(o="0"),n&&-1!==n.indexOf("px")||(n="0"),{w:parseInt(o,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},O=(e,t)=>{if(!e)return!1;const o=v(e)?e:[e];return W(o,(e=>Co(wo.fromDom(e),t)))},D=(e,t,o,n)=>{const r=[];let s=u(e);n=void 0===n;const a=o||("BODY"!==w().nodeName?w().parentNode:null);if(h(t))if("*"===t)t=tr;else{const e=t;t=t=>O(t,e)}for(;s&&!(s===a||x(s.nodeType)||hr(s)||pr(s));){if(!t||t(s)){if(!n)return[s];r.push(s)}s=s.parentNode}return n?r:null},M=(e,t,o)=>{let n=t;if(e){h(t)&&(n=e=>O(e,t));for(let t=e[o];t;t=t[o])if(S(n)&&n(t))return t}return null},N=function(e,t,o){const n=null!=o?o:this;if(v(e)){const o=[];return ua(e,((e,r)=>{const s=u(e);s&&o.push(t.call(n,s,r))})),o}{const o=u(e);return!!o&&t.call(n,o)}},R=(e,t)=>{N(e,(e=>{ve(t,((t,o)=>{y(e,o,t)}))}))},B=(e,t)=>{N(e,(e=>{const o=wo.fromDom(e);Tn(o,t)}))},L=(t,o,n,r,s)=>N(t,(t=>{const a=h(o)?e.createElement(o):o;return C(n)&&R(a,n),r&&(!h(r)&&r.nodeType?a.appendChild(r):h(r)&&B(a,r)),s?a:t.appendChild(a)})),H=(t,o,n)=>L(e.createElement(t),t,o,n,!0),I=Es.encodeAllRaw,P=(e,t)=>N(e,(e=>{const o=wo.fromDom(e);return t&&q(Ho(o),(e=>{Yt(e)&&0===e.dom.length?Sn(e):fn(o,e)})),Sn(o),o.dom})),F=(e,t,o)=>{N(e,(e=>{if(tr(e)){const n=wo.fromDom(e),r=t.split(" ");q(r,(e=>{C(o)?(o?ho:fo)(n,e):vo(n,e)}))}}))},z=(e,t,o)=>N(t,(n=>{var r;const s=v(t)?e.cloneNode(!0):e;return o&&ua(ga(n.childNodes),(e=>{s.appendChild(e)})),null===(r=n.parentNode)||void 0===r||r.replaceChild(s,n),n})),V=()=>e.createRange(),Z=(o,r,s,a)=>{if(v(o)){let e=o.length;const t=[];for(;e--;)t[e]=Z(o[e],r,s,a);return t}return!t.collect||o!==e&&o!==n||i.push([o,r,s,a]),d.bind(o,r,s,a||$)},U=(t,o,r)=>{if(v(t)){let e=t.length;const n=[];for(;e--;)n[e]=U(t[e],o,r);return n}if(i.length>0&&(t===e||t===n)){let e=i.length;for(;e--;){const[n,s,a]=i[e];t!==n||o&&o!==s||r&&r!==a||d.unbind(n,s,a)}}return d.unbind(t,o,r)},j=e=>{if(e&&or(e)){const t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},$={doc:e,settings:t,win:n,files:r,stdMode:!0,boxModel:!0,styleSheetLoader:a,boundEvents:i,styles:c,schema:l,events:d,isBlock:e=>h(e)?Ee(m,e):tr(e)&&(Ee(m,e.nodeName)||es(l,e)),root:null,clone:(e,t)=>e.cloneNode(t),getRoot:w,getViewPort:e=>{const t=Fn(e);return{x:t.x,y:t.y,w:t.width,h:t.height}},getRect:e=>{const t=u(e),o=k(t),n=T(t);return{x:o.x,y:o.y,w:n.w,h:n.h}},getSize:T,getParent:(e,t,o)=>{const n=D(e,t,o,!1);return n&&n.length>0?n[0]:null},getParents:D,get:u,getNext:(e,t)=>M(e,t,"nextSibling"),getPrev:(e,t)=>M(e,t,"previousSibling"),select:(o,n)=>{var r,s;const a=null!==(s=null!==(r=u(n))&&void 0!==r?r:t.root_element)&&void 0!==s?s:e;return S(a.querySelectorAll)?ue(a.querySelectorAll(o)):[]},is:O,add:L,create:H,createHTML:(e,t,o="")=>{let n="<"+e;for(const e in t)Te(t,e)&&(n+=" "+e+'="'+I(t[e])+'"');return Je(o)&&Ee(l.getVoidElements(),e)?n+" />":n+">"+o+""},createFragment:t=>{const o=e.createElement("div"),n=e.createDocumentFragment();let r;for(n.appendChild(o),t&&(o.innerHTML=t);r=o.firstChild;)n.appendChild(r);return n.removeChild(o),n},remove:P,setStyle:(e,o,n)=>{N(e,(e=>{const r=wo.fromDom(e);wa(r,o,n),t.update_styles&&ya(c,r)}))},getStyle:_,setStyles:(e,o)=>{N(e,(e=>{const n=wo.fromDom(e);ve(o,((e,t)=>{wa(n,t,e)})),t.update_styles&&ya(c,n)}))},removeAllAttribs:e=>N(e,(e=>{const t=e.attributes;for(let o=t.length-1;o>=0;o--)e.removeAttributeNode(t.item(o))})),setAttrib:y,setAttribs:R,getAttrib:p,getPos:k,parseStyle:e=>c.parse(e),serializeStyle:(e,t)=>c.serialize(e,t),addStyle:t=>{if($!==xa.DOM&&e===document){if(o[t])return;o[t]=!0}let n=e.getElementById("mceDefaultStyles");if(!n){n=e.createElement("style"),n.id="mceDefaultStyles",n.type="text/css";const t=e.head;t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)}n.styleSheet?n.styleSheet.cssText+=t:n.appendChild(e.createTextNode(t))},loadCSS:e=>{e||(e=""),q(e.split(","),(e=>{r[e]=!0,a.load(e).catch(E)}))},addClass:(e,t)=>{F(e,t,!0)},removeClass:(e,t)=>{F(e,t,!1)},hasClass:(e,t)=>{const o=g(e),n=t.split(" ");return C(o)&&re(n,(e=>bo(o,e)))},toggleClass:F,show:e=>{N(e,(e=>pn(wo.fromDom(e),"display")))},hide:e=>{N(e,(e=>cn(wo.fromDom(e),"display","none")))},isHidden:e=>{const t=g(e);return C(t)&&Ht(gn(t,"display"),"none")},uniqueId:e=>(e||"mce_")+s++,setHTML:B,getOuterHTML:e=>{const t=g(e);return C(t)?tr(t.dom)?t.dom.outerHTML:(e=>{const t=wo.fromTag("div"),o=wo.fromDom(e.dom.cloneNode(!0));return yn(t,o),En(t)})(t):""},setOuterHTML:(e,t)=>{N(e,(e=>{tr(e)&&(e.outerHTML=t)}))},decode:Es.decode,encode:I,insertAfter:(e,t)=>{const o=u(t);return N(e,(e=>{const t=null==o?void 0:o.parentNode,n=null==o?void 0:o.nextSibling;return t&&(n?t.insertBefore(e,n):t.appendChild(e)),e}))},replace:z,rename:(e,t)=>{if(e.nodeName!==t.toUpperCase()){const o=H(t);return ua(b(e),(t=>{y(o,t.nodeName,p(e,t.nodeName))})),z(o,e,!0),o}return e},findCommonAncestor:(e,t)=>{let o=e;for(;o;){let e=t;for(;e&&o!==e;)e=e.parentNode;if(o===e)break;o=o.parentNode}return!o&&e.ownerDocument?e.ownerDocument.documentElement:o},run:N,getAttribs:b,isEmpty:(e,t,o)=>{if(f(t)){const n=e=>{const o=e.nodeName.toLowerCase();return Boolean(t[o])};return Nr(l,e,{...o,isContent:n})}return Nr(l,e,o)},createRng:V,nodeIndex:ba,split:(e,t,o)=>{let n,r,s=V();if(e&&t&&e.parentNode&&t.parentNode){const a=e.parentNode;return s.setStart(a,ba(e)),s.setEnd(t.parentNode,ba(t)),n=s.extractContents(),s=V(),s.setStart(t.parentNode,ba(t)+1),s.setEnd(a,ba(e)+1),r=s.extractContents(),a.insertBefore(us($,n,l),e),o?a.insertBefore(o,e):a.insertBefore(t,e),a.insertBefore(us($,r,l),e),P(e),o||t}},bind:Z,unbind:U,fire:(e,t,o)=>d.dispatch(e,t,o),dispatch:(e,t,o)=>d.dispatch(e,t,o),getContentEditable:j,getContentEditableParent:e=>{const t=w();let o=null;for(let n=e;n&&n!==t&&(o=j(n),null===o);n=n.parentNode);return o},isEditable:e=>{if(C(e)){const t=tr(e)?e:e.parentElement;return C(t)&&or(t)&&rn(wo.fromDom(t))}return!1},destroy:()=>{if(i.length>0){let e=i.length;for(;e--;){const[t,o,n]=i[e];d.unbind(t,o,n)}}ve(r,((e,t)=>{a.unload(t),delete r[t]}))},isChildOf:(e,t)=>e===t||t.contains(e),dumpRng:e=>"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},G=((e,t,o)=>{const n=t.keep_values,r={set:(e,n,r)=>{const s=wo.fromDom(e);S(t.url_converter)&&C(n)&&(n=t.url_converter.call(t.url_converter_scope||o(),String(n),r,e)),fa(s,"data-mce-"+r,n),fa(s,r,n)},get:(e,t)=>{const o=wo.fromDom(e);return no(o,"data-mce-"+t)||no(o,t)}},s={style:{set:(t,o)=>{const r=wo.fromDom(t);n&&fa(r,ha,o),ao(r,"style"),h(o)&&dn(r,e.parse(o))},get:t=>{const o=wo.fromDom(t),n=no(o,ha)||no(o,"style");return e.serialize(e.parse(n),Wt(o))}}};return n&&(s.href=s.src=r),s})(c,t,A($));return $};xa.DOM=xa(document),xa.nodeIndex=ba;const Ca=xa.DOM;class Sa{constructor(e={}){this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=!1,this.settings=e}_setReferrerPolicy(e){this.settings.referrerPolicy=e}loadScript(e){return new Promise(((t,o)=>{const n=Ca;let r;const s=()=>{n.remove(a),r&&(r.onerror=r.onload=r=null)},a=n.uniqueId();r=document.createElement("script"),r.id=a,r.type="text/javascript",r.src=Lt._addCacheSuffix(e),this.settings.referrerPolicy&&n.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=()=>{s(),t()},r.onerror=()=>{s(),o("Failed to load script: "+e)},(document.getElementsByTagName("head")[0]||document.body).appendChild(r)}))}isDone(e){return 2===this.states[e]}markDone(e){this.states[e]=2}add(e){const t=this;return t.queue.push(e),void 0===t.states[e]&&(t.states[e]=0),new Promise(((o,n)=>{t.scriptLoadedCallbacks[e]||(t.scriptLoadedCallbacks[e]=[]),t.scriptLoadedCallbacks[e].push({resolve:o,reject:n})}))}load(e){return this.add(e)}remove(e){delete this.states[e],delete this.scriptLoadedCallbacks[e]}loadQueue(){const e=this.queue;return this.queue=[],this.loadScripts(e)}loadScripts(e){const t=this,o=(e,o)=>{_e(t.scriptLoadedCallbacks,o).each((t=>{q(t,(t=>t[e](o)))})),delete t.scriptLoadedCallbacks[o]},n=e=>{const t=Y(e,(e=>"rejected"===e.status));return t.length>0?Promise.reject(ne(t,(({reason:e})=>v(e)?e:[e]))):Promise.resolve()},r=e=>Promise.allSettled($(e,(e=>2===t.states[e]?(o("resolve",e),Promise.resolve()):3===t.states[e]?(o("reject",e),Promise.reject(e)):(t.states[e]=1,t.loadScript(e).then((()=>{t.states[e]=2,o("resolve",e);const s=t.queue;return s.length>0?(t.queue=[],r(s).then(n)):Promise.resolve()}),(()=>(t.states[e]=3,o("reject",e),Promise.reject(e)))))))),s=e=>(t.loading=!0,r(e).then((e=>{t.loading=!1;const o=t.queueLoadedCallbacks.shift();return F.from(o).each(H),n(e)}))),a=Oe(e);return t.loading?new Promise(((e,o)=>{t.queueLoadedCallbacks.push((()=>{s(a).then(e,o)}))})):s(a)}}Sa.ScriptLoader=new Sa;const ka={},_a=Lr("en"),Ea=()=>_e(ka,_a.get()),Ta={getData:()=>be(ka,(e=>({...e}))),setCode:e=>{e&&_a.set(e)},getCode:()=>_a.get(),add:(e,t)=>{let o=ka[e];o||(ka[e]=o={});const n=$(pe(t),(e=>e.toLowerCase()));ve(t,((e,r)=>{const s=r.toLowerCase();s!==r&&((e,t)=>{const o=e.indexOf(t);return-1!==o&&e.indexOf(t,o+1)>o})(n,s)?(Ee(t,s)||(o[s]=e),o[r]=e):o[s]=e}))},translate:e=>{const t=Ea().getOr({}),o=e=>S(e)?Object.prototype.toString.call(e):n(e)?"":""+e,n=e=>""===e||null==e,r=e=>{const n=o(e);return Ee(t,n)?o(t[n]):_e(t,n.toLowerCase()).map(o).getOr(n)},s=e=>e.replace(/{context:\w+}$/,"");if(n(e))return"";if(p(a=e)&&Ee(a,"raw"))return o(e.raw);var a;if((e=>v(e)&&e.length>1)(e)){const t=e.slice(1);return s(r(e[0]).replace(/\{([0-9]+)\}/g,((e,n)=>Ee(t,n)?o(t[n]):e)))}return s(r(e))},isRtl:()=>Ea().bind((e=>_e(e,"_dir"))).exists((e=>"rtl"===e)),hasCode:e=>Ee(ka,e)},Oa=()=>{const e=[],t={},o={},n=[],r=(e,t)=>{const o=Y(n,(o=>o.name===e&&o.state===t));q(o,(e=>e.resolve()))},s=e=>Ee(t,e),a=(e,o)=>{const n=Ta.getCode();!n||o&&-1===(","+(o||"")+",").indexOf(","+n+",")||Sa.ScriptLoader.add(t[e]+"/langs/"+n+".js")},i=(e,t="added")=>"added"===t&&(e=>Ee(o,e))(e)||"loaded"===t&&s(e)?Promise.resolve():new Promise((o=>{n.push({name:e,state:t,resolve:o})}));return{items:e,urls:t,lookup:o,get:e=>{if(o[e])return o[e].instance},requireLangPack:(e,t)=>{!1!==Oa.languageLoad&&(s(e)?a(e,t):i(e,"loaded").then((()=>a(e,t))))},add:(t,n)=>(e.push(n),o[t]={instance:n},r(t,"added"),n),remove:e=>{delete t[e],delete o[e]},createUrl:(e,t)=>h(t)?h(e)?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}:t,load:(e,n)=>{if(t[e])return Promise.resolve();let s=h(n)?n:n.prefix+n.resource+n.suffix;0!==s.indexOf("/")&&-1===s.indexOf("://")&&(s=Oa.baseURL+"/"+s),t[e]=s.substring(0,s.lastIndexOf("/"));const a=()=>(r(e,"loaded"),Promise.resolve());return o[e]?a():Sa.ScriptLoader.add(s).then(a)},waitFor:i}};Oa.languageLoad=!0,Oa.baseURL="",Oa.PluginManager=Oa(),Oa.ThemeManager=Oa(),Oa.ModelManager=Oa();const Aa=(e,t)=>{let o=null;return{cancel:()=>{b(o)||(clearTimeout(o),o=null)},throttle:(...n)=>{b(o)&&(o=setTimeout((()=>{o=null,e.apply(null,n)}),t))}}},Da=(e,t)=>{let o=null;const n=()=>{b(o)||(clearTimeout(o),o=null)};return{cancel:n,throttle:(...r)=>{n(),o=setTimeout((()=>{o=null,e.apply(null,r)}),t)}}},Ma=A("mce-annotation"),Na=A("data-mce-annotation"),Ra=A("data-mce-annotation-uid"),Ba=A("data-mce-annotation-active"),La=A("data-mce-annotation-classes"),Ha=A("data-mce-annotation-attrs"),Ia=e=>t=>ko(t,e),Pa=(e,t)=>{const o=e.selection.getRng(),n=wo.fromDom(o.startContainer),r=wo.fromDom(e.getBody()),s=t.fold((()=>"."+Ma()),(e=>`[${Na()}="${e}"]`)),a=Io(n,o.startOffset).getOr(n);return nn(a,s,Ia(r)).bind((t=>ro(t,`${Ra()}`).bind((o=>ro(t,`${Na()}`).map((t=>{const n=za(e,o);return{uid:o,name:t,elements:n}}))))))},Fa=(e,t)=>so(e,"data-mce-bogus")||((e,t,o)=>tn(e,t,o).isSome())(e,'[data-mce-bogus="all"]',Ia(t)),za=(e,t)=>{const o=wo.fromDom(e.getBody()),n=Vn(o,`[${Ra()}="${t}"]`);return Y(n,(e=>!Fa(e,o)))},Va=(e,t)=>{const o=wo.fromDom(e.getBody()),n=Vn(o,`[${Na()}="${t}"]`),r={};return q(n,(e=>{if(!Fa(e,o)){const t=no(e,Ra()),o=_e(r,t).getOr([]);r[t]=o.concat([e])}})),r},Za=(e,t)=>{const o=Lr({}),n=()=>({listeners:[],previous:Ir()}),r=(e,t)=>{s(e,(e=>(t(e),e)))},s=(e,t)=>{const r=o.get(),s=t(_e(r,e).getOrThunk(n));r[e]=s,o.set(r)},a=(t,o)=>{q(za(e,t),(e=>{o?to(e,Ba(),"true"):ao(e,Ba())}))},i=Da((()=>{const o=le(t.getNames());q(o,(t=>{s(t,(o=>{const n=o.previous.get();return Pa(e,F.some(t)).fold((()=>{n.each((e=>{(e=>{r(e,(t=>{q(t.listeners,(t=>t(!1,e)))}))})(t),o.previous.clear(),a(e,!1)}))}),(({uid:e,name:t,elements:s})=>{Ht(n,e)||(n.each((e=>a(e,!1))),((e,t,o)=>{r(e,(n=>{q(n.listeners,(n=>n(!0,e,{uid:t,nodes:$(o,(e=>e.dom))})))}))})(t,e,s),o.previous.set(e),a(e,!0))})),{previous:o.previous,listeners:o.listeners}}))}))}),30);return e.on("remove",(()=>{i.cancel()})),e.on("NodeChange",(()=>{i.throttle()})),{addListener:(e,t)=>{s(e,(e=>({previous:e.previous,listeners:e.listeners.concat([t])})))}}};let Ua=0;const ja=e=>{const t=(new Date).getTime(),o=Math.floor(1e9*Math.random());return Ua++,e+"_"+o+Ua+String(t)},Wa=(e,t)=>wo.fromDom(e.dom.cloneNode(t)),$a=e=>Wa(e,!1),qa=e=>Wa(e,!0),Ga=(e,t)=>{const o=((e,t)=>{const o=wo.fromTag(t),n=io(e);return oo(o,n),o})(e,t);vn(e,o);const n=Ho(e);return xn(o,n),Sn(e),o},Ka=(e,t,o=I)=>{const n=new Wn(e,t),r=e=>{let t;do{t=n[e]()}while(t&&!dr(t)&&!o(t));return F.from(t).filter(dr)};return{current:()=>F.from(n.current()).filter(dr),next:()=>r("next"),prev:()=>r("prev"),prev2:()=>r("prev2")}},Ya=(e,t)=>{const o=t||(t=>e.isBlock(t)||fr(t)||yr(t)),n=(e,t,o,r)=>{if(dr(e)){const o=r(e,t,e.data);if(-1!==o)return F.some({container:e,offset:o})}return o().bind((e=>n(e.container,e.offset,o,r)))};return{backwards:(t,r,s,a)=>{const i=Ka(t,null!=a?a:e.getRoot(),o);return n(t,r,(()=>i.prev().map((e=>({container:e,offset:e.length})))),s).getOrNull()},forwards:(t,r,s,a)=>{const i=Ka(t,null!=a?a:e.getRoot(),o);return n(t,r,(()=>i.next().map((e=>({container:e,offset:0})))),s).getOrNull()}}},Xa=((e,t)=>{const o=t=>e(t)?F.from(t.dom.nodeValue):F.none();return{get:n=>{if(!e(n))throw new Error("Can only get "+t+" value of a "+t+" node");return o(n).getOr("")},getOption:o,set:(o,n)=>{if(!e(o))throw new Error("Can only set raw "+t+" value of a "+t+" node");o.dom.nodeValue=n}}})(Yt,"text"),Ja=e=>Xa.get(e),Qa=e=>{let t;return o=>(t=t||ie(e,P),Ee(t,Wt(o)))},ei=e=>Kt(e)&&"br"===Wt(e),ti=Qa(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),oi=Qa(["ul","ol","dl"]),ni=Qa(["li","dd","dt"]),ri=Qa(["thead","tbody","tfoot"]),si=Qa(["td","th"]),ai=Qa(["pre","script","textarea","style"]),ii=e=>{const t=Vn(e,"br"),o=Y((e=>{const t=[];let o=e.dom;for(;o;)t.push(wo.fromDom(o)),o=o.lastChild;return t})(e).slice(-1),ei);t.length===o.length&&q(o,Sn)},li=()=>{const e=wo.fromTag("br");return to(e,"data-mce-bogus","1"),e},ci=e=>{Cn(e),yn(e,li())},di=$n,mi=Gn,ui=e=>e.replace(/\uFEFF/g,""),gi=tr,hi=dr,pi=e=>(hi(e)&&(e=e.parentNode),gi(e)&&e.hasAttribute("data-mce-caret")),fi=e=>hi(e)&&mi(e.data),vi=e=>pi(e)||fi(e),bi=e=>e.firstChild!==e.lastChild||!fr(e.firstChild),yi=e=>{const t=e.container();return!!dr(t)&&(t.data.charAt(e.offset())===di||e.isAtStart()&&fi(t.previousSibling))},wi=e=>{const t=e.container();return!!dr(t)&&(t.data.charAt(e.offset()-1)===di||e.isAtEnd()&&fi(t.nextSibling))},xi=e=>hi(e)&&e.data[0]===di,Ci=e=>hi(e)&&e.data[e.data.length-1]===di,Si=e=>e&&e.hasAttribute("data-mce-caret")?((e=>{var t;const o=e.getElementsByTagName("br"),n=o[o.length-1];ar(n)&&(null===(t=n.parentNode)||void 0===t||t.removeChild(n))})(e),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("data-mce-style"),e.removeAttribute("_moz_abspos"),e):null,ki=e=>pi(e.startContainer),_i=Math.round,Ei=e=>e?{left:_i(e.left),top:_i(e.top),bottom:_i(e.bottom),right:_i(e.right),width:_i(e.width),height:_i(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0},Ti=(e,t)=>(e=Ei(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e),Oi=(e,t,o)=>e>=0&&e<=Math.min(t.height,o.height)/2,Ai=(e,t)=>{const o=Math.min(t.height/2,e.height/2);return e.bottom-ot.bottom)&&Oi(t.top-e.bottom,e,t)},Di=(e,t)=>e.top>t.bottom||!(e.bottom{const n=Math.max(Math.min(t,e.left+e.width),e.left),r=Math.max(Math.min(o,e.top+e.height),e.top);return Math.sqrt((t-n)*(t-n)+(o-r)*(o-r))},Ni=e=>{const t=e.startContainer,o=e.startOffset;return t===e.endContainer&&t.hasChildNodes()&&e.endOffset===o+1?t.childNodes[o]:null},Ri=(e,t)=>{if(tr(e)&&e.hasChildNodes()){const o=e.childNodes,n=((e,t,o)=>Math.min(Math.max(e,t),o))(t,0,o.length-1);return o[n]}return e},Bi=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),Li=e=>h(e)&&e.charCodeAt(0)>=768&&Bi.test(e),Hi=br,Ii=yr,Pi=fr,Fi=dr,zi=rr(["script","style","textarea"]),Vi=rr(["img","input","textarea","hr","iframe","video","audio","object","embed"]),Zi=rr(["table"]),Ui=vi,ji=e=>!Ui(e)&&(Fi(e)?!zi(e.parentNode):Vi(e)||Pi(e)||Zi(e)||Wi(e)),Wi=e=>!(e=>tr(e)&&"true"===e.getAttribute("unselectable"))(e)&&Ii(e),$i=(e,t)=>ji(e)&&((e,t)=>{for(let o=e.parentNode;o&&o!==t;o=o.parentNode){if(Wi(o))return!1;if(Hi(o))return!0}return!0})(e,t),qi=tr,Gi=ji,Ki=sr("display","block table"),Yi=sr("float","left right"),Xi=((...e)=>t=>{for(let o=0;ot<0&&tr(e)&&e.hasChildNodes()?void 0:Ri(e,t),nl=e=>e?e.createRange():xa.DOM.createRng(),rl=e=>h(e)&&/[\r\n\t ]/.test(e),sl=e=>!!e.setStart&&!!e.setEnd,al=e=>{const t=e.startContainer,o=e.startOffset;if(rl(e.toString())&&Ji(t.parentNode)&&dr(t)){const e=t.data;if(rl(e[o-1])||rl(e[o+1]))return!0}return!1},il=e=>0===e.left&&0===e.right&&0===e.top&&0===e.bottom,ll=e=>{var t;let o;const n=e.getClientRects();return o=n.length>0?Ei(n[0]):Ei(e.getBoundingClientRect()),!sl(e)&&el(e)&&il(o)?(e=>{const t=e.ownerDocument,o=nl(t),n=t.createTextNode(qn),r=e.parentNode;r.insertBefore(n,e),o.setStart(n,0),o.setEnd(n,1);const s=Ei(o.getBoundingClientRect());return r.removeChild(n),s})(e):il(o)&&sl(e)&&null!==(t=(e=>{const t=e.startContainer,o=e.endContainer,n=e.startOffset,r=e.endOffset;if(t===o&&dr(o)&&0===n&&1===r){const t=e.cloneRange();return t.setEndAfter(o),ll(t)}return null})(e))&&void 0!==t?t:o},cl=(e,t)=>{const o=Ti(e,t);return o.width=1,o.right=o.left+1,o},dl=e=>{const t=[],o=e=>{var o,n;0!==e.height&&(t.length>0&&(o=e,n=t[t.length-1],o.left===n.left&&o.top===n.top&&o.bottom===n.bottom&&o.right===n.right)||t.push(e))},n=(e,t)=>{const n=nl(e.ownerDocument);if(t0&&(n.setStart(e,t-1),n.setEnd(e,t),al(n)||o(cl(ll(n),!1))),t{const n=()=>(o||(o=dl(ml(e,t))),o);return{container:A(e),offset:A(t),toRange:()=>{const o=nl(e.ownerDocument);return o.setStart(e,t),o.setEnd(e,t),o},getClientRects:n,isVisible:()=>n().length>0,isAtStart:()=>(Qi(e),0===t),isAtEnd:()=>Qi(e)?t>=e.data.length:t>=e.childNodes.length,isEqual:o=>o&&e===o.container()&&t===o.offset(),getNode:o=>ol(e,o?t-1:t)}};ml.fromRangeStart=e=>ml(e.startContainer,e.startOffset),ml.fromRangeEnd=e=>ml(e.endContainer,e.endOffset),ml.after=e=>ml(e.parentNode,tl(e)+1),ml.before=e=>ml(e.parentNode,tl(e)),ml.isAbove=(e,t)=>Pt(de(t.getClientRects()),me(e.getClientRects()),Ai).getOr(!1),ml.isBelow=(e,t)=>Pt(me(t.getClientRects()),de(e.getClientRects()),Di).getOr(!1),ml.isAtStart=e=>!!e&&e.isAtStart(),ml.isAtEnd=e=>!!e&&e.isAtEnd(),ml.isTextPosition=e=>!!e&&dr(e.container()),ml.isElementPosition=e=>!ml.isTextPosition(e);const ul=(e,t)=>{dr(t)&&0===t.data.length&&e.remove(t)},gl=(e,t,o)=>{pr(o)?((e,t,o)=>{const n=F.from(o.firstChild),r=F.from(o.lastChild);t.insertNode(o),n.each((t=>ul(e,t.previousSibling))),r.each((t=>ul(e,t.nextSibling)))})(e,t,o):((e,t,o)=>{t.insertNode(o),ul(e,o.previousSibling),ul(e,o.nextSibling)})(e,t,o)},hl=dr,pl=ar,fl=xa.nodeIndex,vl=e=>{const t=e.parentNode;return pl(t)?vl(t):t},bl=e=>e?Be(e.childNodes,((e,t)=>(pl(t)&&"BR"!==t.nodeName?e=e.concat(bl(t)):e.push(t),e)),[]):[],yl=e=>t=>e===t,wl=e=>(hl(e)?"text()":e.nodeName.toLowerCase())+"["+(e=>{let t,o;t=bl(vl(e)),o=Le(t,yl(e),e),t=t.slice(0,o+1);const n=Be(t,((e,o,n)=>(hl(o)&&hl(t[n-1])&&e++,e)),0);return t=Re(t,rr([e.nodeName])),o=Le(t,yl(e),e),o-n})(e)+"]",xl=(e,t)=>{let o,n=[],r=t.container(),s=t.offset();if(hl(r))o=((e,t)=>{let o=e;for(;(o=o.previousSibling)&&hl(o);)t+=o.data.length;return t})(r,s);else{const e=r.childNodes;s>=e.length?(o="after",s=e.length-1):o="before",r=e[s]}n.push(wl(r));let a=((e,t,o)=>{const n=[];for(let o=t.parentNode;o&&o!==e;o=o.parentNode)n.push(o);return n})(e,r);return a=Re(a,R(ar)),n=n.concat(Ne(a,(e=>wl(e)))),n.reverse().join("/")+","+o},Cl=(e,t)=>{if(!t)return null;const o=t.split(","),n=o[0].split("/"),r=o.length>1?o[1]:"before",s=Be(n,((e,t)=>{const o=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t);return o?("text()"===o[1]&&(o[1]="#text"),((e,t,o)=>{let n=bl(e);return n=Re(n,((e,t)=>!hl(e)||!hl(n[t-1]))),n=Re(n,rr([t])),n[o]})(e,o[1],parseInt(o[2],10))):null}),e);if(!s)return null;if(!hl(s)&&s.parentNode){let e;return e="after"===r?fl(s)+1:fl(s),ml(s.parentNode,e)}return((e,t)=>{let o=e,n=0;for(;hl(o);){const r=o.data.length;if(t>=n&&t<=n+r){e=o,t-=n;break}if(!hl(o.nextSibling)){e=o,t=r;break}n+=r,o=o.nextSibling}return hl(e)&&t>e.data.length&&(t=e.data.length),ml(e,t)})(s,parseInt(r,10))},Sl=yr,kl=(e,t,o,n,r)=>{const s=r?n.startContainer:n.endContainer;let a=r?n.startOffset:n.endOffset;const i=[],l=e.getRoot();if(dr(s))i.push(o?((e,t,o)=>{let n=e(t.data.slice(0,o)).length;for(let o=t.previousSibling;o&&dr(o);o=o.previousSibling)n+=e(o.data).length;return n})(t,s,a):a);else{let t=0;const n=s.childNodes;a>=n.length&&n.length&&(t=1,a=Math.max(0,n.length-1)),i.push(e.nodeIndex(n[a],o)+t)}for(let t=s;t&&t!==l;t=t.parentNode)i.push(e.nodeIndex(t,o));return i},_l=(e,t,o)=>{let n=0;return Lt.each(e.select(t),(e=>"all"===e.getAttribute("data-mce-bogus")?void 0:e!==o&&void n++)),n},El=(e,t)=>{let o=t?e.startContainer:e.endContainer,n=t?e.startOffset:e.endOffset;if(tr(o)&&"TR"===o.nodeName){const r=o.childNodes;o=r[Math.min(t?n:n-1,r.length-1)],o&&(n=t?0:o.childNodes.length,t?e.setStart(o,n):e.setEnd(o,n))}},Tl=e=>(El(e,!0),El(e,!1),e),Ol=(e,t)=>{if(tr(e)&&(e=Ri(e,t),Sl(e)))return e;if(vi(e)){dr(e)&&pi(e)&&(e=e.parentNode);let t=e.previousSibling;if(Sl(t))return t;if(t=e.nextSibling,Sl(t))return t}},Al=(e,t,o)=>{const n=o.getNode(),r=o.getRng();if("IMG"===n.nodeName||Sl(n)){const e=n.nodeName;return{name:e,index:_l(o.dom,e,n)}}const s=(e=>Ol(e.startContainer,e.startOffset)||Ol(e.endContainer,e.endOffset))(r);if(s){const e=s.tagName;return{name:e,index:_l(o.dom,e,s)}}return((e,t,o,n)=>{const r=t.dom,s=kl(r,e,o,n,!0),a=t.isForward(),i=ki(n)?{isFakeCaret:!0}:{};return t.isCollapsed()?{start:s,forward:a,...i}:{start:s,end:kl(r,e,o,n,!1),forward:a,...i}})(e,o,t,r)},Dl=(e,t,o)=>{const n={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return o?e.create("span",n,""):e.create("span",n)},Ml=(e,t)=>{const o=e.dom;let n=e.getRng();const r=o.uniqueId(),s=e.isCollapsed(),a=e.getNode(),i=a.nodeName,l=e.isForward();if("IMG"===i)return{name:i,index:_l(o,i,a)};const c=Tl(n.cloneRange());if(!s){c.collapse(!1);const e=Dl(o,r+"_end",t);gl(o,c,e)}n=Tl(n),n.collapse(!0);const d=Dl(o,r+"_start",t);return gl(o,n,d),e.moveToBookmark({id:r,keep:!0,forward:l}),{id:r,forward:l}},Nl=(e,t,o=!1)=>2===t?Al(ui,o,e):3===t?(e=>{const t=e.getRng();return{start:xl(e.dom.getRoot(),ml.fromRangeStart(t)),end:xl(e.dom.getRoot(),ml.fromRangeEnd(t)),forward:e.isForward()}})(e):t?(e=>({rng:e.getRng(),forward:e.isForward()}))(e):Ml(e,!1),Rl=N(Al,D,!0),Bl=e=>{const t=t=>t(e),o=A(e),n=()=>r,r={tag:!0,inner:e,fold:(t,o)=>o(e),isValue:P,isError:I,map:t=>Hl.value(t(e)),mapError:n,bind:t,exists:t,forall:t,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:t=>{t(e)},toOptional:()=>F.some(e)};return r},Ll=e=>{const t=()=>o,o={tag:!1,inner:e,fold:(t,o)=>t(e),isValue:I,isError:P,map:t,mapError:t=>Hl.error(t(e)),bind:t,exists:I,forall:P,getOr:D,or:D,getOrThunk:L,orThunk:L,getOrDie:B(String(e)),each:E,toOptional:F.none};return o},Hl={value:Bl,error:Ll,fromOption:(e,t)=>e.fold((()=>Ll(t)),Bl)},Il=e=>{if(!v(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],o={};return q(e,((n,r)=>{const s=pe(n);if(1!==s.length)throw new Error("one and only one name per case");const a=s[0],i=n[a];if(void 0!==o[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!v(i))throw new Error("case arguments must be an array");t.push(a),o[a]=(...o)=>{const n=o.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+i.length+" ("+i+"), got "+n);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[r].apply(null,o)},match:e=>{const n=pe(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));if(!re(t,(e=>j(n,e))))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,o)},log:e=>{console.log(e,{constructors:t,constructor:a,params:o})}}}})),o};Il([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const Pl=e=>"inline-command"===e.type||"inline-format"===e.type,Fl=e=>"block-command"===e.type||"block-format"===e.type,zl=e=>{var t;const o=t=>Hl.error({message:t,pattern:e}),n=(t,n,r)=>{if(void 0!==e.format){let r;if(v(e.format)){if(!re(e.format,h))return o(t+" pattern has non-string items in the `format` array");r=e.format}else{if(!h(e.format))return o(t+" pattern has non-string `format` parameter");r=[e.format]}return Hl.value(n(r))}return void 0!==e.cmd?h(e.cmd)?Hl.value(r(e.cmd,e.value)):o(t+" pattern has non-string `cmd` parameter"):o(t+" pattern is missing both `format` and `cmd` parameters")};if(!p(e))return o("Raw pattern is not an object");if(!h(e.start))return o("Raw pattern is missing `start` parameter");if(void 0!==e.end){if(!h(e.end))return o("Inline pattern has non-string `end` parameter");if(0===e.start.length&&0===e.end.length)return o("Inline pattern has empty `start` and `end` parameters");let t=e.start,r=e.end;return 0===r.length&&(r=t,t=""),n("Inline",(e=>({type:"inline-format",start:t,end:r,format:e})),((e,o)=>({type:"inline-command",start:t,end:r,cmd:e,value:o})))}if(void 0!==e.replacement)return h(e.replacement)?0===e.start.length?o("Replacement pattern has empty `start` parameter"):Hl.value({type:"inline-command",start:"",end:e.start,cmd:"mceInsertContent",value:e.replacement}):o("Replacement pattern has non-string `replacement` parameter");{const r=null!==(t=e.trigger)&&void 0!==t?t:"space";return 0===e.start.length?o("Block pattern has empty `start` parameter"):n("Block",(t=>({type:"block-format",start:e.start,format:t[0],trigger:r})),((t,o)=>({type:"block-command",start:e.start,cmd:t,value:o,trigger:r})))}},Vl=e=>Y(e,Fl),Zl=e=>Y(e,Pl),Ul=(e,t)=>({...e,blockPatterns:Y(e.blockPatterns,(e=>((e,t)=>("block-command"===e.type||"block-format"===e.type)&&e.trigger===t)(e,t)))}),jl=e=>{const t=(e=>{const t=[],o=[];return q(e,(e=>{e.fold((e=>{t.push(e)}),(e=>{o.push(e)}))})),{errors:t,values:o}})($(e,zl));return q(t.errors,(e=>console.error(e.message,e.pattern))),t.values},Wl=kt().deviceType,$l=Wl.isTouch(),ql=xa.DOM,Gl=e=>g(e,RegExp),Kl=e=>t=>t.options.get(e),Yl=e=>h(e)||p(e),Xl=(e,t="")=>o=>{const n=h(o);if(n){if(-1!==o.indexOf("=")){const r=(e=>{const t=e.indexOf("=")>0?e.split(/[;,](?![^=;,]*(?:[;,]|$))/):e.split(",");return J(t,((e,t)=>{const o=t.split("="),n=o[0],r=o.length>1?o[1]:n;return e[Ge(n)]=Ge(r),e}),{})})(o);return{value:_e(r,e.id).getOr(t),valid:n}}return{value:o,valid:n}}return{valid:!1,message:"Must be a string."}},Jl=Kl("iframe_attrs"),Ql=Kl("doctype"),ec=Kl("document_base_url"),tc=Kl("body_id"),oc=Kl("body_class"),nc=Kl("content_security_policy"),rc=Kl("br_in_pre"),sc=Kl("forced_root_block"),ac=Kl("forced_root_block_attrs"),ic=Kl("newline_behavior"),lc=Kl("br_newline_selector"),cc=Kl("no_newline_selector"),dc=Kl("keep_styles"),mc=Kl("end_container_on_empty_block"),uc=Kl("automatic_uploads"),gc=Kl("images_reuse_filename"),hc=Kl("images_replace_blob_uris"),pc=Kl("icons"),fc=Kl("icons_url"),vc=Kl("images_upload_url"),bc=Kl("images_upload_base_path"),yc=Kl("images_upload_credentials"),wc=Kl("images_upload_handler"),xc=Kl("content_css_cors"),Cc=Kl("referrer_policy"),Sc=Kl("language"),kc=Kl("language_url"),_c=Kl("indent_use_margin"),Ec=Kl("indentation"),Tc=Kl("content_css"),Oc=Kl("content_style"),Ac=Kl("font_css"),Dc=Kl("directionality"),Mc=Kl("inline_boundaries_selector"),Nc=Kl("object_resizing"),Rc=Kl("resize_img_proportional"),Bc=Kl("placeholder"),Lc=Kl("event_root"),Hc=Kl("service_message"),Ic=Kl("theme"),Pc=Kl("theme_url"),Fc=Kl("model"),zc=Kl("model_url"),Vc=Kl("inline_boundaries"),Zc=Kl("formats"),Uc=Kl("preview_styles"),jc=Kl("format_empty_lines"),Wc=Kl("format_noneditable_selector"),$c=Kl("custom_ui_selector"),qc=Kl("inline"),Gc=Kl("hidden_input"),Kc=Kl("submit_patch"),Yc=Kl("add_form_submit_trigger"),Xc=Kl("add_unload_trigger"),Jc=Kl("custom_undo_redo_levels"),Qc=Kl("disable_nodechange"),ed=Kl("readonly"),td=Kl("editable_root"),od=Kl("content_css_cors"),nd=Kl("plugins"),rd=Kl("external_plugins"),sd=Kl("block_unsupported_drop"),ad=Kl("visual"),id=Kl("visual_table_class"),ld=Kl("visual_anchor_class"),cd=Kl("iframe_aria_text"),dd=Kl("setup"),md=Kl("init_instance_callback"),ud=Kl("urlconverter_callback"),gd=Kl("auto_focus"),hd=Kl("browser_spellcheck"),pd=Kl("protect"),fd=Kl("paste_block_drop"),vd=Kl("paste_data_images"),bd=Kl("paste_preprocess"),yd=Kl("paste_postprocess"),wd=Kl("newdocument_content"),xd=Kl("paste_webkit_styles"),Cd=Kl("paste_remove_styles_if_webkit"),Sd=Kl("paste_merge_formats"),kd=Kl("smart_paste"),_d=Kl("paste_as_text"),Ed=Kl("paste_tab_spaces"),Td=Kl("allow_html_data_urls"),Od=Kl("text_patterns"),Ad=Kl("text_patterns_lookup"),Dd=Kl("noneditable_class"),Md=Kl("editable_class"),Nd=Kl("noneditable_regexp"),Rd=Kl("preserve_cdata"),Bd=Kl("highlight_on_focus"),Ld=Kl("xss_sanitization"),Hd=Kl("init_content_sync"),Id=e=>Lt.explode(e.options.get("images_file_types")),Pd=Kl("table_tab_navigation"),Fd=Kl("details_initial_state"),zd=Kl("details_serialized_state"),Vd=Kl("sandbox_iframes"),Zd=e=>e.options.get("sandbox_iframes_exclusions"),Ud=Kl("convert_unsafe_embeds"),jd=Kl("license_key"),Wd=Kl("api_key"),$d=tr,qd=dr,Gd=e=>{const t=e.parentNode;t&&t.removeChild(e)},Kd=e=>{const t=ui(e);return{count:e.length-t.length,text:t}},Yd=e=>{let t;for(;-1!==(t=e.data.lastIndexOf(di));)e.deleteData(t,1)},Xd=(e,t)=>(tm(e),t),Jd=(e,t)=>{const o=t.container(),n=((e,t)=>{const o=U(e,t);return-1===o?F.none():F.some(o)})(ue(o.childNodes),e).map((e=>eqd(e)&&t.container()===e?((e,t)=>{const o=Kd(e.data.substr(0,t.offset())),n=Kd(e.data.substr(t.offset()));return(o.text+n.text).length>0?(Yd(e),ml(e,t.offset()-o.count)):t})(e,t):Xd(e,t),em=(e,t)=>ml.isTextPosition(t)?Qd(e,t):((e,t)=>t.container()===e.parentNode?Jd(e,t):Xd(e,t))(e,t),tm=e=>{$d(e)&&vi(e)&&(bi(e)?e.removeAttribute("data-mce-caret"):Gd(e)),qd(e)&&(Yd(e),0===e.data.length&&Gd(e))},om=yr,nm=Cr,rm=wr,sm=(e,t,o)=>{const n=Ti(t.getBoundingClientRect(),o);let r,s;if("BODY"===e.tagName){const t=e.ownerDocument.documentElement;r=e.scrollLeft||t.scrollLeft,s=e.scrollTop||t.scrollTop}else{const t=e.getBoundingClientRect();r=e.scrollLeft-t.left,s=e.scrollTop-t.top}n.left+=r,n.right+=r,n.top+=s,n.bottom+=s,n.width=1;let a=t.offsetWidth-t.clientWidth;return a>0&&(o&&(a*=-1),n.left+=a,n.right+=a),n},am=(e,t,o,n)=>{const r=Ir();let s,a;const i=sc(e),l=e.dom,c=()=>{(e=>{var t,o;const n=Vn(wo.fromDom(e),"*[contentEditable=false],video,audio,embed,object");for(let e=0;e{l.remove(e.caret),r.clear()})),s&&(clearInterval(s),s=void 0)},d=()=>{s=setInterval((()=>{r.on((e=>{n()?l.toggleClass(e.caret,"mce-visual-caret-hidden"):l.addClass(e.caret,"mce-visual-caret-hidden")}))}),500)};return{show:(e,n)=>{let s;if(c(),rm(n))return null;if(!o(n))return a=((e,t)=>{var o;const n=(null!==(o=e.ownerDocument)&&void 0!==o?o:document).createTextNode(di),r=e.parentNode;if(t){const t=e.previousSibling;if(hi(t)){if(vi(t))return t;if(Ci(t))return t.splitText(t.data.length-1)}null==r||r.insertBefore(n,e)}else{const t=e.nextSibling;if(hi(t)){if(vi(t))return t;if(xi(t))return t.splitText(1),t}e.nextSibling?null==r||r.insertBefore(n,e.nextSibling):null==r||r.appendChild(n)}return n})(n,e),s=n.ownerDocument.createRange(),lm(a.nextSibling)?(s.setStart(a,0),s.setEnd(a,0)):(s.setStart(a,1),s.setEnd(a,1)),s;{const o=((e,t,o)=>{var n;const r=(null!==(n=t.ownerDocument)&&void 0!==n?n:document).createElement(e);r.setAttribute("data-mce-caret",o?"before":"after"),r.setAttribute("data-mce-bogus","all"),r.appendChild(li().dom);const s=t.parentNode;return o?null==s||s.insertBefore(r,t):t.nextSibling?null==s||s.insertBefore(r,t.nextSibling):null==s||s.appendChild(r),r})(i,n,e),c=sm(t,n,e);l.setStyle(o,"top",c.top),l.setStyle(o,"caret-color","transparent"),a=o;const m=l.create("div",{class:"mce-visual-caret","data-mce-bogus":"all"});l.setStyles(m,{...c}),l.add(t,m),r.set({caret:m,element:n,before:e}),e&&l.addClass(m,"mce-visual-caret-before"),d(),s=n.ownerDocument.createRange(),s.setStart(o,0),s.setEnd(o,0)}return s},hide:c,getCss:()=>".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}",reposition:()=>{r.on((e=>{const o=sm(t,e.element,e.before);l.setStyles(e.caret,{...o})}))},destroy:()=>clearInterval(s)}},im=()=>Mt.browser.isFirefox(),lm=e=>om(e)||nm(e),cm=e=>(lm(e)||ir(e)&&im())&&Do(wo.fromDom(e)).exists(rn),dm=br,mm=yr,um=Cr,gm=sr("display","block table table-cell table-caption list-item"),hm=vi,pm=pi,fm=tr,vm=dr,bm=ji,ym=e=>e>0,wm=e=>e<0,xm=(e,t)=>{let o;for(;o=e(t);)if(!pm(o))return o;return null},Cm=(e,t,o,n,r)=>{const s=new Wn(e,n),a=mm(e)||pm(e);let i;if(wm(t)){if(a&&(i=xm(s.prev.bind(s),!0),o(i)))return i;for(;i=xm(s.prev.bind(s),r);)if(o(i))return i}if(ym(t)){if(a&&(i=xm(s.next.bind(s),!0),o(i)))return i;for(;i=xm(s.next.bind(s),r);)if(o(i))return i}return null},Sm=(e,t)=>{for(;e&&e!==t;){if(gm(e))return e;e=e.parentNode}return null},km=(e,t,o)=>Sm(e.container(),o)===Sm(t.container(),o),_m=(e,t)=>{if(!t)return F.none();const o=t.container(),n=t.offset();return fm(o)?F.from(o.childNodes[n+e]):F.none()},Em=(e,t)=>{var o;const n=(null!==(o=t.ownerDocument)&&void 0!==o?o:document).createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},Tm=(e,t,o)=>Sm(t,e)===Sm(o,e),Om=(e,t,o)=>{const n=e?"previousSibling":"nextSibling";let r=o;for(;r&&r!==t;){let e=r[n];if(e&&hm(e)&&(e=e[n]),mm(e)||um(e)){if(Tm(t,e,r))return e;break}if(bm(e))break;r=r.parentNode}return null},Am=N(Em,!0),Dm=N(Em,!1),Mm=(e,t,o)=>{let n;const r=N(Om,!0,t),s=N(Om,!1,t),a=o.startContainer,i=o.startOffset;if(pi(a)){const e=vm(a)?a.parentNode:a,t=e.getAttribute("data-mce-caret");if("before"===t&&(n=e.nextSibling,cm(n)))return Am(n);if("after"===t&&(n=e.previousSibling,cm(n)))return Dm(n)}if(!o.collapsed)return o;if(dr(a)){if(hm(a)){if(1===e){if(n=s(a),n)return Am(n);if(n=r(a),n)return Dm(n)}if(-1===e){if(n=r(a),n)return Dm(n);if(n=s(a),n)return Am(n)}return o}if(Ci(a)&&i>=a.data.length-1)return 1===e&&(n=s(a),n)?Am(n):o;if(xi(a)&&i<=1)return-1===e&&(n=r(a),n)?Dm(n):o;if(i===a.data.length)return n=s(a),n?Am(n):o;if(0===i)return n=r(a),n?Dm(n):o}return o},Nm=(e,t)=>_m(e?0:-1,t).filter(mm),Rm=(e,t,o)=>{const n=Mm(e,t,o);return-1===e?ml.fromRangeStart(n):ml.fromRangeEnd(n)},Bm=e=>F.from(e.getNode()).map(wo.fromDom),Lm=(e,t)=>{let o=t;for(;o=e(o);)if(o.isVisible())return o;return o},Hm=(e,t)=>{const o=km(e,t);return!(o||!fr(e.getNode()))||o};var Im;!function(e){e[e.Backwards=-1]="Backwards",e[e.Forwards=1]="Forwards"}(Im||(Im={}));const Pm=yr,Fm=dr,zm=tr,Vm=fr,Zm=ji,Um=e=>Vi(e)||(e=>!!Wi(e)&&!J(ue(e.getElementsByTagName("*")),((e,t)=>e||Hi(t)),!1))(e),jm=$i,Wm=(e,t)=>e.hasChildNodes()&&t{if(ym(e)){if(Zm(t.previousSibling)&&!Fm(t.previousSibling))return ml.before(t);if(Fm(t))return ml(t,0)}if(wm(e)){if(Zm(t.nextSibling)&&!Fm(t.nextSibling))return ml.after(t);if(Fm(t))return ml(t,t.data.length)}return wm(e)?Vm(t)?ml.before(t):ml.after(t):ml.before(t)},qm=(e,t,o)=>{let n,r,s,a;if(!zm(o)||!t)return null;if(t.isEqual(ml.after(o))&&o.lastChild){if(a=ml.after(o.lastChild),wm(e)&&Zm(o.lastChild)&&zm(o.lastChild))return Vm(o.lastChild)?ml.before(o.lastChild):a}else a=t;const i=a.container();let l=a.offset();if(Fm(i)){if(wm(e)&&l>0)return ml(i,--l);if(ym(e)&&l0&&(r=Wm(i,l-1),Zm(r)))return!Um(r)&&(s=Cm(r,e,jm,r),s)?Fm(s)?ml(s,s.data.length):ml.after(s):Fm(r)?ml(r,r.data.length):ml.before(r);if(ym(e)&&l{const o=t.nextSibling;return o&&Zm(o)?Fm(o)?ml(o,0):ml.before(o):qm(Im.Forwards,ml.after(t),e)})(o,r):!Um(r)&&(s=Cm(r,e,jm,r),s)?Fm(s)?ml(s,0):ml.before(s):Fm(r)?ml(r,0):ml.after(r);n=r||a.getNode()}if(n&&(ym(e)&&a.isAtEnd()||wm(e)&&a.isAtStart())&&(n=Cm(n,e,P,o,!0),jm(n,o)))return $m(e,n);r=n?Cm(n,e,jm,o):n;const c=He(Y(((e,t)=>{const o=[];let n=e;for(;n&&n!==t;)o.push(n),n=n.parentNode;return o})(i,o),Pm));return!c||r&&c.contains(r)?r?$m(e,r):null:(a=ym(e)?ml.after(c):ml.before(c),a)},Gm=e=>({next:t=>qm(Im.Forwards,t,e),prev:t=>qm(Im.Backwards,t,e)}),Km=e=>ml.isTextPosition(e)?0===e.offset():ji(e.getNode()),Ym=e=>{if(ml.isTextPosition(e)){const t=e.container();return e.offset()===t.data.length}return ji(e.getNode(!0))},Xm=(e,t)=>!ml.isTextPosition(e)&&!ml.isTextPosition(t)&&e.getNode()===t.getNode(!0),Jm=(e,t,o)=>{return e?!Xm(t,o)&&(n=t,!(!ml.isTextPosition(n)&&fr(n.getNode())))&&Ym(t)&&Km(o):!Xm(o,t)&&Km(t)&&Ym(o);var n},Qm=(e,t,o)=>{const n=Gm(t);return F.from(e?n.next(o):n.prev(o))},eu=(e,t,o)=>Qm(e,t,o).bind((n=>km(o,n,t)&&Jm(e,o,n)?Qm(e,t,n):F.some(n))),tu=(e,t,o,n)=>eu(e,t,o).bind((o=>n(o)?tu(e,t,o,n):F.some(o))),ou=(e,t)=>{const o=e?t.firstChild:t.lastChild;return dr(o)?F.some(ml(o,e?0:o.data.length)):o?ji(o)?F.some(e?ml.before(o):fr(n=o)?ml.before(n):ml.after(n)):((e,t,o)=>{const n=e?ml.before(o):ml.after(o);return Qm(e,t,n)})(e,t,o):F.none();var n},nu=N(Qm,!0),ru=N(Qm,!1),su=N(ou,!0),au=N(ou,!1),iu="_mce_caret",lu=e=>tr(e)&&e.id===iu,cu=(e,t)=>{let o=t;for(;o&&o!==e;){if(lu(o))return o;o=o.parentNode}return null},du=e=>Ee(e,"name"),mu=e=>Lt.isArray(e.start),uu=e=>!(!du(e)&&y(e.forward))||e.forward,gu=(e,t)=>(tr(t)&&e.isBlock(t)&&!t.innerHTML&&(t.innerHTML='
'),t),hu=(e,t)=>au(e).fold(I,(e=>(t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0))),pu=(e,t,o)=>!(!(e=>!e.hasChildNodes())(t)||!cu(e,t)||(((e,t)=>{var o;const n=(null!==(o=e.ownerDocument)&&void 0!==o?o:document).createTextNode(di);e.appendChild(n),t.setStart(n,0),t.setEnd(n,0)})(t,o),0)),fu=(e,t,o,n)=>{const r=o[t?"start":"end"],s=e.getRoot();if(r){let e=s,o=r[0];for(let t=r.length-1;e&&t>=1;t--){const o=e.childNodes;if(pu(s,e,n))return!0;if(r[t]>o.length-1)return!!pu(s,e,n)||hu(e,n);e=o[r[t]]}dr(e)&&(o=Math.min(r[0],e.data.length)),tr(e)&&(o=Math.min(r[0],e.childNodes.length)),t?n.setStart(e,o):n.setEnd(e,o)}return!0},vu=e=>dr(e)&&e.data.length>0,bu=(e,t,o)=>{const n=e.get(o.id+"_"+t),r=null==n?void 0:n.parentNode,s=o.keep;if(n&&r){let a,i;if("start"===t?s?n.hasChildNodes()?(a=n.firstChild,i=1):vu(n.nextSibling)?(a=n.nextSibling,i=0):vu(n.previousSibling)?(a=n.previousSibling,i=n.previousSibling.data.length):(a=r,i=e.nodeIndex(n)+1):(a=r,i=e.nodeIndex(n)):s?n.hasChildNodes()?(a=n.firstChild,i=1):vu(n.previousSibling)?(a=n.previousSibling,i=n.previousSibling.data.length):(a=r,i=e.nodeIndex(n)):(a=r,i=e.nodeIndex(n)),!s){const r=n.previousSibling,s=n.nextSibling;let l;for(Lt.each(Lt.grep(n.childNodes),(e=>{dr(e)&&(e.data=e.data.replace(/\uFEFF/g,""))}));l=e.get(o.id+"_"+t);)e.remove(l,!0);if(dr(s)&&dr(r)&&!Mt.browser.isOpera()){const t=r.data.length;r.appendData(s.data),e.remove(s),a=r,i=t}}return F.some(ml(a,i))}return F.none()},yu=(e,t)=>{const o=e.dom;if(t){if(mu(t))return((e,t)=>{const o=e.createRng();return fu(e,!0,t,o)&&fu(e,!1,t,o)?F.some({range:o,forward:uu(t)}):F.none()})(o,t);if((e=>h(e.start))(t))return((e,t)=>{const o=F.from(Cl(e.getRoot(),t.start)),n=F.from(Cl(e.getRoot(),t.end));return Pt(o,n,((o,n)=>{const r=e.createRng();return r.setStart(o.container(),o.offset()),r.setEnd(n.container(),n.offset()),{range:r,forward:uu(t)}}))})(o,t);if((e=>Ee(e,"id"))(t))return((e,t)=>{const o=bu(e,"start",t),n=bu(e,"end",t);return Pt(o,n.or(o),((o,n)=>{const r=e.createRng();return r.setStart(gu(e,o.container()),o.offset()),r.setEnd(gu(e,n.container()),n.offset()),{range:r,forward:uu(t)}}))})(o,t);if(du(t))return((e,t)=>F.from(e.select(t.name)[t.index]).map((t=>{const o=e.createRng();return o.selectNode(t),{range:o,forward:!0}})))(o,t);if((e=>Ee(e,"rng"))(t))return F.some({range:t.rng,forward:uu(t)})}return F.none()},wu=(e,t,o)=>Nl(e,t,o),xu=(e,t)=>{yu(e,t).each((({range:t,forward:o})=>{e.setRng(t,o)}))},Cu=e=>tr(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type"),Su=(ku=qn,e=>ku===e);var ku;const _u=e=>""!==e&&-1!==" \f\n\r\t\v".indexOf(e),Eu=e=>!_u(e)&&!Su(e)&&!Gn(e),Tu=e=>{const t=[];if(e)for(let o=0;oY((e=>ne(e,(e=>{const t=Ni(e);return t?[wo.fromDom(t)]:[]})))(e),si),Au=(e,t)=>{const o=Vn(t,"td[data-mce-selected],th[data-mce-selected]");return o.length>0?o:Ou(e)},Du=e=>Au(Tu(e.selection.getSel()),wo.fromDom(e.getBody())),Mu=(e,t)=>tn(e,"table",t),Nu=e=>Po(e).fold(A([e]),(t=>[e].concat(Nu(t)))),Ru=e=>Fo(e).fold(A([e]),(t=>"br"===Wt(t)?No(t).map((t=>[e].concat(Ru(t)))).getOr([]):[e].concat(Ru(t)))),Bu=(e,t)=>Pt((e=>{const t=e.startContainer,o=e.startOffset;return dr(t)?0===o?F.some(wo.fromDom(t)):F.none():F.from(t.childNodes[o]).map(wo.fromDom)})(t),(e=>{const t=e.endContainer,o=e.endOffset;return dr(t)?o===t.data.length?F.some(wo.fromDom(t)):F.none():F.from(t.childNodes[o-1]).map(wo.fromDom)})(t),((t,o)=>{const n=ee(Nu(e),N(ko,t)),r=ee(Ru(e),N(ko,o));return n.isSome()&&r.isSome()})).getOr(!1),Lu=(e,t,o,n)=>{const r=o,s=new Wn(o,r),a=Ce(e.schema.getMoveCaretBeforeOnEnterElements(),((e,t)=>!j(["td","th","table"],t.toLowerCase())));let i=o;do{if(dr(i)&&0!==Lt.trim(i.data).length)return void(n?t.setStart(i,0):t.setEnd(i,i.data.length));if(a[i.nodeName])return void(n?t.setStartBefore(i):"BR"===i.nodeName?t.setEndBefore(i):t.setEndAfter(i))}while(i=n?s.next():s.prev());"BODY"===r.nodeName&&(n?t.setStart(r,0):t.setEnd(r,r.childNodes.length))},Hu=e=>{const t=e.selection.getSel();return C(t)&&t.rangeCount>0},Iu=(e,t)=>{const o=Du(e);o.length>0?q(o,(o=>{const n=o.dom,r=e.dom.createRng();r.setStartBefore(n),r.setEndAfter(n),t(r,!0)})):t(e.selection.getRng(),!1)},Pu=(e,t,o)=>{const n=Ml(e,t);o(n),e.moveToBookmark(n)},Fu=e=>k(null==e?void 0:e.nodeType),zu=e=>tr(e)&&!Cu(e)&&!lu(e)&&!ar(e),Vu=(e,t,o)=>{const{selection:n,dom:r}=e,s=n.getNode(),a=yr(s);Pu(n,!0,(()=>{t()})),a&&yr(s)&&r.isChildOf(s,e.getBody())?e.selection.select(s):o(n.getStart())&&Zu(r,n)},Zu=(e,t)=>{var o,n;const r=t.getRng(),{startContainer:s,startOffset:a}=r;if(!((e,t)=>{if(zu(t)&&!/^(TD|TH)$/.test(t.nodeName)){const o=e.getAttrib(t,"data-mce-selected"),n=parseInt(o,10);return!isNaN(n)&&n>0}return!1})(e,t.getNode())&&tr(s)){const i=s.childNodes,l=e.getRoot();let c;if(a{if(e){const o=t?"nextSibling":"previousSibling";for(e=e[o];e;e=e[o])if(tr(e)||!$u(e))return e}},ju=(e,t)=>!!e.getTextBlockElements()[t.nodeName.toLowerCase()]||es(e,t),Wu=(e,t,o)=>e.schema.isValidChild(t,o),$u=(e,t=!1)=>{if(C(e)&&dr(e)){const o=t?e.data.replace(/ /g," "):e.data;return Yn(o)}return!1},qu=(e,t)=>{const o=e.dom;return zu(t)&&"false"===o.getContentEditable(t)&&((e,t)=>{const o="[data-mce-cef-wrappable]",n=Wc(e),r=Je(n)?o:`${o},${n}`;return Co(wo.fromDom(t),r)})(e,t)&&0===o.select('[contenteditable="true"]',t).length},Gu=(e,t)=>S(e)?e(t):(C(t)&&(e=e.replace(/%(\w+)/g,((e,o)=>t[o]||e))),e),Ku=(e,t)=>(t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()),Yu=(e,t)=>{if(x(e))return null;{let o=String(e);return"color"!==t&&"backgroundColor"!==t||(o=ea(o)),"fontWeight"===t&&700===e&&(o="bold"),"fontFamily"===t&&(o=o.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),o}},Xu=(e,t,o)=>{const n=e.getStyle(t,o);return Yu(n,o)},Ju=(e,t)=>{let o;return e.getParent(t,(t=>!!tr(t)&&(o=e.getStyle(t,"text-decoration"),!!o&&"none"!==o))),o},Qu=(e,t,o)=>e.getParents(t,o,e.getRoot()),eg=(e,t,o)=>{const n=e.formatter.get(t);return C(n)&&W(n,o)},tg=(e,t,o)=>{const n=["inline","block","selector","attributes","styles","classes"],r=e=>Ce(e,((e,t)=>W(n,(e=>e===t))));return eg(e,t,(t=>{const n=r(t);return eg(e,o,(e=>{const t=r(e);return((e,t,o=i)=>a(o).eq(e,t))(n,t)}))}))},og=e=>Te(e,"block"),ng=e=>Te(e,"selector"),rg=e=>Te(e,"inline"),sg=e=>ng(e)&&!1!==e.expand&&!rg(e),ag=e=>(e=>{const t=[];let o=e;for(;o;){if(dr(o)&&o.data!==di||o.childNodes.length>1)return[];tr(o)&&t.push(o),o=o.firstChild}return t})(e).length>0,ig=e=>lu(e.dom)&&ag(e.dom),lg=Cu,cg=Qu,dg=$u,mg=ju,ug=(e,t)=>{let o=t;for(;o;){if(tr(o)&&e.getContentEditable(o))return"false"===e.getContentEditable(o)?o:t;o=o.parentNode}return t},gg=(e,t,o,n)=>{const r=t.data;if(e){for(let e=o;e>0;e--)if(n(r.charAt(e-1)))return e}else for(let e=o;egg(e,t,o,(e=>Su(e)||_u(e))),pg=(e,t,o)=>gg(e,t,o,Eu),fg=(e,t,o,n,r,s)=>{let a;const i=e.getParent(o,e.isBlock)||t,l=(t,o,n)=>{const s=Ya(e),l=r?s.backwards:s.forwards;return F.from(l(t,o,((e,t)=>lg(e.parentNode)?-1:(a=e,n(r,e,t))),i))};return l(o,n,hg).bind((e=>s?l(e.container,e.offset+(r?-1:0),pg):F.some(e))).orThunk((()=>a?F.some({container:a,offset:r?0:a.length}):F.none()))},vg=(e,t,o,n,r)=>{const s=n[r];dr(n)&&Je(n.data)&&s&&(n=s);const a=cg(e,n);for(let n=0;n{var r;let s=o;const a=e.getRoot(),i=t[0];if(og(i)&&(s=i.wrapper?null:e.getParent(o,i.block,a)),!s){const t=null!==(r=e.getParent(o,"LI,TD,TH,SUMMARY"))&&void 0!==r?r:a;s=e.getParent(dr(o)?o.parentNode:o,(t=>t!==a&&mg(e.schema,t)),t)}if(s&&og(i)&&i.wrapper&&(s=cg(e,s,"ul,ol").reverse()[0]||s),!s)for(s=o;s&&s[n]&&!e.isBlock(s[n])&&(s=s[n],!Ku(s,"br")););return s||o},yg=(e,t,o,n)=>{const r=o.parentNode;return!C(o[n])&&(!(r!==t&&!x(r)&&!e.isBlock(r))||yg(e,t,r,n))},wg=(e,t,o,n,r)=>{let s=o;const a=r?"previousSibling":"nextSibling",i=e.getRoot();if(dr(o)&&!dg(o)&&(r?n>0:nlg(e.parentNode)||lg(e),Cg=(e,t,o,n=!1)=>{let{startContainer:r,startOffset:s,endContainer:a,endOffset:i}=t;const l=o[0];return tr(r)&&r.hasChildNodes()&&(r=Ri(r,s),dr(r)&&(s=0)),tr(a)&&a.hasChildNodes()&&(a=Ri(a,t.collapsed?i:i-1),dr(a)&&(i=a.data.length)),r=ug(e,r),a=ug(e,a),xg(r)&&(r=lg(r)?r:r.parentNode,r=t.collapsed?r.previousSibling||r:r.nextSibling||r,dr(r)&&(s=t.collapsed?r.length:0)),xg(a)&&(a=lg(a)?a:a.parentNode,a=t.collapsed?a.nextSibling||a:a.previousSibling||a,dr(a)&&(i=t.collapsed?0:a.length)),t.collapsed&&(fg(e,e.getRoot(),r,s,!0,n).each((({container:e,offset:t})=>{r=e,s=t})),fg(e,e.getRoot(),a,i,!1,n).each((({container:e,offset:t})=>{a=e,i=t}))),(rg(l)||l.block_expand)&&(rg(l)&&dr(r)&&0!==s||(r=wg(e,o,r,s,!0)),rg(l)&&dr(a)&&i!==a.data.length||(a=wg(e,o,a,i,!1))),sg(l)&&(r=vg(e,o,t,r,"previousSibling"),a=vg(e,o,t,a,"nextSibling")),(og(l)||ng(l))&&(r=bg(e,o,r,"previousSibling"),a=bg(e,o,a,"nextSibling"),og(l)&&(e.isBlock(r)||(r=wg(e,o,r,s,!0),dr(r)&&(s=0)),e.isBlock(a)||(a=wg(e,o,a,i,!1),dr(a)&&(i=a.data.length)))),tr(r)&&r.parentNode&&(s=e.nodeIndex(r),r=r.parentNode),tr(a)&&a.parentNode&&(i=e.nodeIndex(a)+1,a=a.parentNode),{startContainer:r,startOffset:s,endContainer:a,endOffset:i}},Sg=(e,t,o)=>{var n;const r=t.startOffset,s=Ri(t.startContainer,r),a=t.endOffset,i=Ri(t.endContainer,a-1),l=e=>{const t=e[0];dr(t)&&t===s&&r>=t.data.length&&e.splice(0,1);const o=e[e.length-1];return 0===a&&e.length>0&&o===i&&dr(o)&&e.splice(e.length-1,1),e},c=(e,t,o)=>{const n=[];for(;e&&e!==o;e=e[t])n.push(e);return n},d=(t,o)=>e.getParent(t,(e=>e.parentNode===o),o),m=(e,t,n)=>{const r=n?"nextSibling":"previousSibling";for(let s=e,a=s.parentNode;s&&s!==t;s=a){a=s.parentNode;const t=c(s===e?s:s[r],r);t.length&&(n||t.reverse(),o(l(t)))}};if(s===i)return o(l([s]));const u=null!==(n=e.findCommonAncestor(s,i))&&void 0!==n?n:e.getRoot();if(e.isChildOf(s,i))return m(s,u,!0);if(e.isChildOf(i,s))return m(i,u);const g=d(s,u)||s,h=d(i,u)||i;m(s,g,!0);const p=c(g===s?g:g.nextSibling,"nextSibling",h===i?h.nextSibling:h);p.length&&o(l(p)),m(i,h)},kg=['pre[class*=language-][contenteditable="false"]',"figure.image","div[data-ephox-embed-iri]","div.tiny-pageembed","div.mce-toc","div[data-mce-toc]"],_g=(e,t,o,n)=>Ao(t).fold((()=>"skipping"),(r=>"br"===n||(e=>Yt(e)&&Ja(e)===di)(t)?"valid":(e=>Kt(e)&&bo(e,Ma()))(t)?"existing":lu(t.dom)?"caret":W(kg,(e=>Co(t,e)))?"valid-block":Wu(e,o,n)&&Wu(e,Wt(r),o)?"valid":"invalid-child")),Eg=(e,t,o,n,r,s)=>{const{uid:a=t,...i}=o;ho(e,Ma()),to(e,`${Ra()}`,a),to(e,`${Na()}`,n);const{attributes:l={},classes:c=[]}=r(a,i);if(oo(e,l),((e,t)=>{q(t,(t=>{ho(e,t)}))})(e,c),s){c.length>0&&to(e,`${La()}`,c.join(","));const t=pe(l);t.length>0&&to(e,`${Ha()}`,t.join(","))}},Tg=e=>{fo(e,Ma()),ao(e,`${Ra()}`),ao(e,`${Na()}`),ao(e,`${Ba()}`);const t=ro(e,`${Ha()}`).map((e=>e.split(","))).getOr([]),o=ro(e,`${La()}`).map((e=>e.split(","))).getOr([]);var n;q(t,(t=>ao(e,t))),n=e,q(o,(e=>{fo(n,e)})),ao(e,`${La()}`),ao(e,`${Ha()}`)},Og=(e,t,o,n,r)=>{const s=wo.fromTag("span",e);return Eg(s,t,o,n,r,!1),s},Ag=(e,t,o,n,r,s)=>{const a=[],i=Og(e.getDoc(),o,s,n,r),l=Ir(),c=()=>{l.clear()},d=e=>{q(e,m)},m=t=>{switch(_g(e,t,"span",Wt(t))){case"invalid-child":{c();const e=Ho(t);d(e),c();break}case"valid-block":c(),Eg(t,o,s,n,r,!0);break;case"valid":{const e=l.get().getOrThunk((()=>{const e=$a(i);return a.push(e),l.set(e),e}));wn(t,e);break}}};return Sg(e.dom,t,(e=>{c(),(e=>{const t=$(e,wo.fromDom);d(t)})(e)})),a},Dg=(e,t,o,n)=>{e.undoManager.transact((()=>{const r=e.selection,s=r.getRng(),a=Du(e).length>0,i=ja("mce-annotation");if(s.collapsed&&!a&&((e,t)=>{const o=Cg(e.dom,t,[{inline:"span"}]);t.setStart(o.startContainer,o.startOffset),t.setEnd(o.endContainer,o.endOffset),e.selection.setRng(t)})(e,s),r.getRng().collapsed&&!a){const s=Og(e.getDoc(),i,n,t,o.decorate);Tn(s,qn),r.getRng().insertNode(s.dom),r.select(s.dom)}else Pu(r,!1,(()=>{Iu(e,(r=>{Ag(e,r,i,t,o.decorate,n)}))}))}))},Mg=e=>{const t=(()=>{const e={};return{register:(t,o)=>{e[t]={name:t,settings:o}},lookup:t=>_e(e,t).map((e=>e.settings)),getNames:()=>pe(e)}})();((e,t)=>{const o=Na(),n=e=>F.from(e.attr(o)).bind(t.lookup),r=e=>{var t,o;e.attr(Ra(),null),e.attr(Na(),null),e.attr(Ba(),null);const n=F.from(e.attr(Ha())).map((e=>e.split(","))).getOr([]),r=F.from(e.attr(La())).map((e=>e.split(","))).getOr([]);q(n,(t=>e.attr(t,null)));const s=null!==(o=null===(t=e.attr("class"))||void 0===t?void 0:t.split(" "))&&void 0!==o?o:[],a=ae(s,[Ma()].concat(r));e.attr("class",a.length>0?a.join(" "):null),e.attr(La(),null),e.attr(Ha(),null)};e.serializer.addTempAttr(Ba()),e.serializer.addAttributeFilter(o,(e=>{for(const t of e)n(t).each((e=>{!1===e.persistent&&("span"===t.name?t.unwrap():r(t))}))}))})(e,t);const o=Za(e,t),n=Qt("span"),r=e=>{q(e,(e=>{n(e)?kn(e):Tg(e)}))};return{register:(e,o)=>{t.register(e,o)},annotate:(o,n)=>{t.lookup(o).each((t=>{Dg(e,o,t,n)}))},annotationChanged:(e,t)=>{o.addListener(e,t)},remove:t=>{Pa(e,F.some(t)).each((({elements:t})=>{const o=e.selection.getBookmark();r(t),e.selection.moveToBookmark(o)}))},removeAll:t=>{const o=e.selection.getBookmark();ve(Va(e,t),((e,t)=>{r(e)})),e.selection.moveToBookmark(o)},getAll:t=>{const o=Va(e,t);return be(o,(e=>$(e,(e=>e.dom))))}}},Ng=e=>({getBookmark:N(wu,e),moveToBookmark:N(xu,e)});Ng.isBookmarkNode=Cu;const Rg=(e,t,o)=>!o.collapsed&&W(o.getClientRects(),(o=>((e,t,o)=>t>=e.left&&t<=e.right&&o>=e.top&&o<=e.bottom)(o,e,t))),Bg=(e,t,o)=>{e.dispatch(t,o)},Lg=(e,t,o,n)=>{e.dispatch("FormatApply",{format:t,node:o,vars:n})},Hg=(e,t,o,n)=>{e.dispatch("FormatRemove",{format:t,node:o,vars:n})},Ig=(e,t)=>e.dispatch("SetContent",t),Pg=(e,t)=>e.dispatch("GetContent",t),Fg=(e,t)=>{e.dispatch("AutocompleterUpdateActiveRange",t)},zg=(e,t)=>e.dispatch("PastePlainTextToggle",{state:t}),Vg={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:e=>e.shiftKey||e.ctrlKey||e.altKey||Vg.metaKeyPressed(e),metaKeyPressed:e=>Mt.os.isMacOS()||Mt.os.isiOS()?e.metaKey:e.ctrlKey&&!e.altKey},Zg="data-mce-selected",Ug=Math.abs,jg=Math.round,Wg={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},$g=(e,t)=>{const o=t.dom,n=t.getDoc(),r=document,s=t.getBody();let a,i,l,c,d,m,u,g,h,p,f,v,b,y,w;const x=e=>C(e)&&(vr(e)||o.is(e,"figure.image")),S=e=>Cr(e)||o.hasClass(e,"mce-preview-object"),k=e=>{const o=e.target;((e,t)=>{if((e=>"longpress"===e.type||0===e.type.indexOf("touch"))(e)){const o=e.touches[0];return x(e.target)&&!Rg(o.clientX,o.clientY,t)}return x(e.target)&&!Rg(e.clientX,e.clientY,t)})(e,t.selection.getRng())&&!e.isDefaultPrevented()&&t.selection.select(o)},_=e=>o.hasClass(e,"mce-preview-object")&&C(e.firstElementChild)?[e,e.firstElementChild]:o.is(e,"figure.image")?[e.querySelector("img")]:[e],E=e=>{const n=Nc(t);return!!n&&"false"!==e.getAttribute("data-mce-resize")&&e!==t.getBody()&&(o.hasClass(e,"mce-preview-object")&&C(e.firstElementChild)?Co(wo.fromDom(e.firstElementChild),n):Co(wo.fromDom(e),n))},T=(e,n,r)=>{if(C(r)){const s=_(e);q(s,(e=>{e.style[n]||!t.schema.isValid(e.nodeName.toLowerCase(),n)?o.setStyle(e,n,r):o.setAttrib(e,n,""+r)}))}},O=(e,t,o)=>{T(e,"width",t),T(e,"height",o)},A=e=>{let n,r,d,C,k;n=e.screenX-m,r=e.screenY-u,v=n*c[2]+g,b=r*c[3]+h,v=v<5?5:v,b=b<5?5:b,d=(x(a)||S(a))&&!1!==Rc(t)?!Vg.modifierPressed(e):Vg.modifierPressed(e),d&&(Ug(n)>Ug(r)?(b=jg(v*p),v=jg(b/p)):(v=jg(b/p),b=jg(v*p))),O(i,v,b),C=c.startPos.x+n,k=c.startPos.y+r,C=C>0?C:0,k=k>0?k:0,o.setStyles(l,{left:C,top:k,display:"block"}),l.innerHTML=v+" × "+b,c[2]<0&&i.clientWidth<=v&&o.setStyle(i,"left",void 0+(g-v)),c[3]<0&&i.clientHeight<=b&&o.setStyle(i,"top",void 0+(h-b)),n=s.scrollWidth-y,r=s.scrollHeight-w,n+r!==0&&o.setStyles(l,{left:C-n,top:k-r}),f||(((e,t,o,n,r)=>{e.dispatch("ObjectResizeStart",{target:t,width:o,height:n,origin:r})})(t,a,g,h,"corner-"+c.name),f=!0)},D=()=>{const e=f;f=!1,e&&(T(a,"width",v),T(a,"height",b)),o.unbind(n,"mousemove",A),o.unbind(n,"mouseup",D),r!==n&&(o.unbind(r,"mousemove",A),o.unbind(r,"mouseup",D)),o.remove(i),o.remove(l),o.remove(d),M(a),e&&(((e,t,o,n,r)=>{e.dispatch("ObjectResized",{target:t,width:o,height:n,origin:r})})(t,a,v,b,"corner-"+c.name),o.setAttrib(a,"style",o.getAttrib(a,"style"))),t.nodeChanged()},M=e=>{H();const f=o.getPos(e,s),x=f.x,C=f.y,k=e.getBoundingClientRect(),T=k.width||k.right-k.left,M=k.height||k.bottom-k.top;a!==e&&(R(),a=e,v=b=0);const N=t.dispatch("ObjectSelected",{target:e});E(e)&&!N.isDefaultPrevented()?ve(Wg,((e,t)=>{const f=f=>{const v=_(a)[0];m=f.screenX,u=f.screenY,g=v.clientWidth,h=v.clientHeight,p=h/g,c=e,c.name=t,c.startPos={x:T*e[0]+x,y:M*e[1]+C},y=s.scrollWidth,w=s.scrollHeight,d=o.add(s,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),o.setStyles(d,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),i=((e,t)=>{if(S(t))return e.create("img",{src:Mt.transparentSrc});if(ir(t)){const o=We(c.name,"n")?de:me,n=t.cloneNode(!0);return o(e.select("tr",n)).each((t=>{const o=e.select("td,th",t);e.setStyle(t,"height",null),q(o,(t=>e.setStyle(t,"height",null)))})),n}return t.cloneNode(!0)})(o,a),o.addClass(i,"mce-clonedresizable"),o.setAttrib(i,"data-mce-bogus","all"),i.contentEditable="false",o.setStyles(i,{left:x,top:C,margin:0}),O(i,T,M),i.removeAttribute(Zg),s.appendChild(i),o.bind(n,"mousemove",A),o.bind(n,"mouseup",D),r!==n&&(o.bind(r,"mousemove",A),o.bind(r,"mouseup",D)),l=o.add(s,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},g+" × "+h)};let v=o.get("mceResizeHandle"+t);v&&o.remove(v),v=o.add(s,"div",{id:"mceResizeHandle"+t,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+t+"-resize; margin:0; padding:0"}),o.bind(v,"mousedown",(e=>{e.stopImmediatePropagation(),e.preventDefault(),f(e)})),e.elm=v,o.setStyles(v,{left:T*e[0]+x-v.offsetWidth/2,top:M*e[1]+C-v.offsetHeight/2})})):R(!1)},N=Aa(M,0),R=(e=!0)=>{N.cancel(),H(),a&&e&&a.removeAttribute(Zg),ve(Wg,((e,t)=>{const n=o.get("mceResizeHandle"+t);n&&(o.unbind(n),o.remove(n))}))},B=(e,t)=>o.isChildOf(e,t),L=n=>{if(f||t.removed||t.composing)return;const r="mousedown"===n.type?n.target:e.getNode(),a=nn(wo.fromDom(r),"table,img,figure.image,hr,video,span.mce-preview-object,details").map((e=>e.dom)).filter((e=>o.isEditable(e.parentElement)||"IMG"===e.nodeName&&o.isEditable(e))).getOrUndefined(),i=C(a)?o.getAttrib(a,Zg,"1"):"1";if(q(o.select(`img[${Zg}],hr[${Zg}]`),(e=>{e.removeAttribute(Zg)})),C(a)&&B(a,s)&&t.hasFocus()){I();const t=e.getStart(!0);if(B(t,a)&&B(e.getEnd(!0),a))return o.setAttrib(a,Zg,i),void N.throttle(a)}R()},H=()=>{ve(Wg,(e=>{e.elm&&(o.unbind(e.elm),delete e.elm)}))},I=()=>{try{t.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(e){}};return t.on("init",(()=>{I(),t.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",L),t.on("keyup compositionend",(e=>{a&&"TABLE"===a.nodeName&&L(e)})),t.on("hide blur",R),t.on("contextmenu longpress",k,!0)})),t.on("remove",H),{isResizable:E,showResizeRect:M,hideResizeRect:R,updateResizeRect:L,destroy:()=>{N.cancel(),a=i=d=null}}},qg=(e,t,o)=>{const n=e.document.createRange();var r;return r=n,t.fold((e=>{r.setStartBefore(e.dom)}),((e,t)=>{r.setStart(e.dom,t)}),(e=>{r.setStartAfter(e.dom)})),((e,t)=>{t.fold((t=>{e.setEndBefore(t.dom)}),((t,o)=>{e.setEnd(t.dom,o)}),(t=>{e.setEndAfter(t.dom)}))})(n,o),n},Gg=(e,t,o,n,r)=>{const s=e.document.createRange();return s.setStart(t.dom,o),s.setEnd(n.dom,r),s},Kg=Il([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Yg=(e,t,o)=>t(wo.fromDom(o.startContainer),o.startOffset,wo.fromDom(o.endContainer),o.endOffset),Xg=(e,t)=>{const o=((e,t)=>t.match({domRange:e=>({ltr:A(e),rtl:F.none}),relative:(t,o)=>({ltr:Ie((()=>qg(e,t,o))),rtl:Ie((()=>F.some(qg(e,o,t))))}),exact:(t,o,n,r)=>({ltr:Ie((()=>Gg(e,t,o,n,r))),rtl:Ie((()=>F.some(Gg(e,n,r,t,o))))})}))(e,t);return((e,t)=>{const o=t.ltr();return o.collapsed?t.rtl().filter((e=>!1===e.collapsed)).map((e=>Kg.rtl(wo.fromDom(e.endContainer),e.endOffset,wo.fromDom(e.startContainer),e.startOffset))).getOrThunk((()=>Yg(0,Kg.ltr,o))):Yg(0,Kg.ltr,o)})(0,o)};Kg.ltr,Kg.rtl;const Jg=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n}),Qg=(e,t,o)=>{var n,r;return F.from(null===(r=(n=e.dom).caretPositionFromPoint)||void 0===r?void 0:r.call(n,t,o)).bind((t=>{if(null===t.offsetNode)return F.none();const o=e.dom.createRange();return o.setStart(t.offsetNode,t.offset),o.collapse(),F.some(o)}))},eh=(e,t,o)=>{var n,r;return F.from(null===(r=(n=e.dom).caretRangeFromPoint)||void 0===r?void 0:r.call(n,t,o))},th=document.caretPositionFromPoint?Qg:document.caretRangeFromPoint?eh:F.none,oh=Il([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),nh={before:oh.before,on:oh.on,after:oh.after,cata:(e,t,o,n)=>e.fold(t,o,n),getStart:e=>e.fold(D,D,D)},rh=Il([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),sh={domRange:rh.domRange,relative:rh.relative,exact:rh.exact,exactFromRange:e=>rh.exact(e.start,e.soffset,e.finish,e.foffset),getWin:e=>{const t=(e=>e.match({domRange:e=>wo.fromDom(e.startContainer),relative:(e,t)=>nh.getStart(e),exact:(e,t,o,n)=>e}))(e);return Oo(t)},range:Jg},ah=(e,t)=>{const o=Wt(e);return"input"===o?nh.after(e):j(["br","img"],o)?0===t?nh.before(e):nh.after(e):nh.on(e,t)},ih=(e,t)=>{const o=e.fold(nh.before,ah,nh.after),n=t.fold(nh.before,ah,nh.after);return sh.relative(o,n)},lh=(e,t,o,n)=>{const r=ah(e,t),s=ah(o,n);return sh.relative(r,s)},ch=(e,t)=>{const o=document.createDocumentFragment();return q(e,(e=>{o.appendChild(e.dom)})),wo.fromDom(o)},dh=e=>{const t=sh.getWin(e).dom,o=(e,o,n,r)=>Gg(t,e,o,n,r),n=(e=>e.match({domRange:e=>{const t=wo.fromDom(e.startContainer),o=wo.fromDom(e.endContainer);return lh(t,e.startOffset,o,e.endOffset)},relative:ih,exact:lh}))(e);return Xg(t,n).match({ltr:o,rtl:o})},mh=(e,t,o)=>((e,t,o)=>{const n=wo.fromDom(e.document);return th(n,t,o).map((e=>Jg(wo.fromDom(e.startContainer),e.startOffset,wo.fromDom(e.endContainer),e.endOffset)))})(e,t,o),uh=(e,t,o)=>{const n=Oo(wo.fromDom(o));return mh(n.dom,e,t).map((e=>{const t=o.createRange();return t.setStart(e.start.dom,e.soffset),t.setEnd(e.finish.dom,e.foffset),t})).getOrUndefined()},gh=(e,t)=>C(e)&&C(t)&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset,hh=(e,t,o)=>null!==((e,t,o)=>{let n=e;for(;n&&n!==t;){if(o(n))return n;n=n.parentNode}return null})(e,t,o),ph=(e,t,o)=>hh(e,t,(e=>e.nodeName===o)),fh=(e,t)=>vi(e)&&!hh(e,t,lu),vh=(e,t,o)=>{const n=t.parentNode;if(n){const r=new Wn(t,e.getParent(n,e.isBlock)||e.getRoot());let s;for(;s=r[o?"prev":"next"]();)if(fr(s))return!0}return!1},bh=(e,t,o,n,r)=>{const s=e.getRoot(),a=e.schema.getNonEmptyElements(),i=r.parentNode;let l,c;if(!i)return F.none();const d=e.getParent(i,e.isBlock)||s;if(n&&fr(r)&&t&&e.isEmpty(d))return F.some(ml(i,e.nodeIndex(r)));const m=new Wn(r,d);for(;c=m[n?"prev":"next"]();){if("false"===e.getContentEditableParent(c)||fh(c,s))return F.none();if(dr(c)&&c.data.length>0)return ph(c,s,"A")?F.none():F.some(ml(c,n?c.data.length:0));if(e.isBlock(c)||a[c.nodeName.toLowerCase()])return F.none();l=c}return gr(l)?F.none():o&&l?F.some(ml(l,0)):F.none()},yh=(e,t,o,n)=>{const r=e.getRoot();let s,a=!1,i=o?n.startContainer:n.endContainer,l=o?n.startOffset:n.endOffset;const c=tr(i)&&l===i.childNodes.length,d=e.schema.getNonEmptyElements();let m=o;if(vi(i))return F.none();if(tr(i)&&l>i.childNodes.length-1&&(m=!1),hr(i)&&(i=r,l=0),i===r){if(m&&(s=i.childNodes[l>0?l-1:0],s)){if(vi(s))return F.none();if(d[s.nodeName]||ir(s))return F.none()}if(i.hasChildNodes()){if(l=Math.min(!m&&l>0?l-1:l,i.childNodes.length-1),i=i.childNodes[l],l=dr(i)&&c?i.data.length:0,!t&&i===r.lastChild&&ir(i))return F.none();if(((e,t)=>{let o=t;for(;o&&o!==e;){if(yr(o))return!0;o=o.parentNode}return!1})(r,i)||vi(i))return F.none();if(kr(i))return F.none();if(i.hasChildNodes()&&!ir(i)){s=i;const t=new Wn(i,r);do{if(yr(s)||vi(s)){a=!1;break}if(dr(s)&&s.data.length>0){l=m?0:s.data.length,i=s,a=!0;break}if(d[s.nodeName.toLowerCase()]&&!xr(s)){l=e.nodeIndex(s),i=s.parentNode,m||l++,a=!0;break}}while(s=m?t.next():t.prev())}}}return t&&(dr(i)&&0===l&&bh(e,c,t,!0,i).each((e=>{i=e.container(),l=e.offset(),a=!0})),tr(i)&&(s=i.childNodes[l],s||(s=i.childNodes[l-1]),!s||!fr(s)||((e,t)=>{var o;return(null===(o=e.previousSibling)||void 0===o?void 0:o.nodeName)===t})(s,"A")||vh(e,s,!1)||vh(e,s,!0)||bh(e,c,t,!0,s).each((e=>{i=e.container(),l=e.offset(),a=!0})))),m&&!t&&dr(i)&&l===i.data.length&&bh(e,c,t,!1,i).each((e=>{i=e.container(),l=e.offset(),a=!0})),a&&i?F.some(ml(i,l)):F.none()},wh=(e,t)=>{const o=t.collapsed,n=t.cloneRange(),r=ml.fromRangeStart(t);return yh(e,o,!0,n).each((e=>{o&&ml.isAbove(r,e)||n.setStart(e.container(),e.offset())})),o||yh(e,o,!1,n).each((e=>{n.setEnd(e.container(),e.offset())})),o&&n.collapse(!0),gh(t,n)?F.none():F.some(n)},xh=(e,t)=>e.splitText(t),Ch=e=>{let t=e.startContainer,o=e.startOffset,n=e.endContainer,r=e.endOffset;if(t===n&&dr(t)){if(o>0&&oo){r-=o;const e=xh(n,r).previousSibling;t=n=e,r=e.data.length,o=0}else r=0}else if(dr(t)&&o>0&&o0&&r({walk:(t,o)=>Sg(e,t,o),split:Ch,expand:(t,o={type:"word"})=>{if("word"===o.type){const o=Cg(e,t,[{inline:"span"}]),n=e.createRng();return n.setStart(o.startContainer,o.startOffset),n.setEnd(o.endContainer,o.endOffset),n}return t},normalize:t=>wh(e,t).fold(I,(e=>(t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0)))});Sh.compareRanges=gh,Sh.getCaretRangeFromPoint=uh,Sh.getSelectedNode=Ni,Sh.getNode=Ri;const kh=((e,t)=>{const o=o=>{const n=t(o);if(n<=0||null===n){const t=mn(o,e);return parseFloat(t)||0}return n},n=(e,t)=>J(t,((t,o)=>{const n=mn(e,o),r=void 0===n?0:parseInt(n,10);return isNaN(r)?t:t+r}),0);return{set:(t,o)=>{if(!k(o)&&!o.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+o);const n=t.dom;an(n)&&(n.style[e]=o+"px")},get:o,getOuter:o,aggregate:n,max:(e,t,o)=>{const r=n(e,o);return t>r?t-r:0}}})("height",(e=>{const t=e.dom;return Ko(e)?t.getBoundingClientRect().height:t.offsetHeight})),_h=()=>wo.fromDom(document),Eh=(e,t)=>e.view(t).fold(A([]),(t=>{const o=e.owner(t),n=Eh(e,o);return[t].concat(n)}));var Th=Object.freeze({__proto__:null,view:e=>{var t;return(e.dom===document?F.none():F.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(wo.fromDom)},owner:e=>To(e)});const Oh=e=>{const t=_h(),o=Ln(t),n=((e,t)=>{const o=t.owner(e);return Eh(t,o)})(e,Th),r=Bn(e),s=X(n,((e,t)=>{const o=Bn(t);return{left:e.left+o.left,top:e.top+o.top}}),{left:0,top:0});return Nn(s.left+r.left+o.left,s.top+r.top+o.top)},Ah=e=>"textarea"===Wt(e),Dh=(e,t)=>{const o=(e=>{const t=e.dom.ownerDocument,o=t.body,n=t.defaultView,r=t.documentElement;if(o===e.dom)return Nn(o.offsetLeft,o.offsetTop);const s=Rn(null==n?void 0:n.pageYOffset,r.scrollTop),a=Rn(null==n?void 0:n.pageXOffset,r.scrollLeft),i=Rn(r.clientTop,o.clientTop),l=Rn(r.clientLeft,o.clientLeft);return Bn(e).translate(a-l,s-i)})(e),n=(e=>kh.get(e))(e);return{element:e,bottom:o.top+n,height:n,pos:o,cleanup:t}},Mh=(e,t)=>{const o=((e,t)=>{const o=Ho(e);if(0===o.length||Ah(e))return{element:e,offset:t};if(t\ufeff');return fn(o.element,n),Dh(n,(()=>Sn(n)))},Nh=(e,t,o,n)=>{Hh(e,((r,s)=>Bh(e,t,o,n)),o)},Rh=(e,t,o,n,r)=>{const s={elm:n.element.dom,alignToTop:r};((e,t)=>e.dispatch("ScrollIntoView",t).isDefaultPrevented())(e,s)||(o(e,t,Ln(t).top,n,r),((e,t)=>{e.dispatch("AfterScrollIntoView",t)})(e,s))},Bh=(e,t,o,n)=>{const r=wo.fromDom(e.getBody()),s=wo.fromDom(e.getDoc());r.dom.offsetWidth;const a=Mh(wo.fromDom(o.startContainer),o.startOffset);Rh(e,s,t,a,n),a.cleanup()},Lh=(e,t,o,n)=>{const r=wo.fromDom(e.getDoc());Rh(e,r,o,(e=>Dh(wo.fromDom(e),E))(t),n)},Hh=(e,t,o)=>{const n=o.startContainer,r=o.startOffset,s=o.endContainer,a=o.endOffset;t(wo.fromDom(n),wo.fromDom(s));const i=e.dom.createRng();i.setStart(n,r),i.setEnd(s,a),e.selection.setRng(o)},Ih=(e,t,o,n,r)=>{const s=t.pos;if(n)Hn(s.left,s.top,r);else{const n=s.top-o+t.height;Hn(-e.getBody().getBoundingClientRect().left,n,r)}},Ph=(e,t,o,n,r,s)=>{const a=n+o,i=r.pos.top,l=r.bottom,c=l-i>=n;ia?Ih(e,r,n,c?!1!==s:!0===s,t):l>a&&!c&&Ih(e,r,n,!0===s,t)},Fh=(e,t,o,n,r)=>{const s=Oo(t).dom.innerHeight;Ph(e,t,o,s,n,r)},zh=(e,t,o,n,r)=>{const s=Oo(t).dom.innerHeight;Ph(e,t,o,s,n,r);const a=Oh(n.element),i=Fn(window);a.topi.bottom&&In(n.element,!0===r)},Vh=(e,t,o)=>Nh(e,Fh,t,o),Zh=(e,t,o)=>Lh(e,t,Fh,o),Uh=(e,t,o)=>Nh(e,zh,t,o),jh=(e,t,o)=>Lh(e,t,zh,o),Wh=(e,t,o)=>{(e.inline?Vh:Uh)(e,t,o)},$h=(e,t=!1)=>e.dom.focus({preventScroll:t}),qh=e=>{const t=jo(e).dom;return e.dom===t.activeElement},Gh=(e=_h())=>F.from(e.dom.activeElement).map(wo.fromDom),Kh=(e,t)=>{const o=Yt(t)?Ja(t).length:Ho(t).length+1;return e>o?o:e<0?0:e},Yh=e=>sh.range(e.start,Kh(e.soffset,e.start),e.finish,Kh(e.foffset,e.finish)),Xh=(e,t)=>!er(t.dom)&&(_o(e,t)||ko(e,t)),Jh=e=>t=>Xh(e,t.start)&&Xh(e,t.finish),Qh=e=>sh.range(wo.fromDom(e.startContainer),e.startOffset,wo.fromDom(e.endContainer),e.endOffset),ep=e=>(e=>{const t=e.getSelection();return(t&&0!==t.rangeCount?F.from(t.getRangeAt(0)):F.none()).map(Qh)})(Oo(e).dom).filter(Jh(e)),tp=e=>{const t=document.createRange();try{return t.setStart(e.start.dom,e.soffset),t.setEnd(e.finish.dom,e.foffset),F.some(t)}catch(e){return F.none()}},op=e=>{const t=(e=>e.inline||Mt.browser.isFirefox())(e)?ep(wo.fromDom(e.getBody())):F.none();e.bookmark=t.isSome()?t:e.bookmark},np=e=>(e.bookmark?e.bookmark:F.none()).bind((t=>((e,t)=>F.from(t).filter(Jh(e)).map(Yh))(wo.fromDom(e.getBody()),t))).bind(tp),rp={isEditorUIElement:e=>{const t=e.className.toString();return-1!==t.indexOf("tox-")||-1!==t.indexOf("mce-")}},sp={setEditorTimeout:(e,t,o)=>((e,t)=>(k(t)||(t=0),setTimeout(e,t)))((()=>{e.removed||t()}),o),setEditorInterval:(e,t,o)=>{const n=((e,t)=>(k(t)||(t=0),setInterval(e,t)))((()=>{e.removed?clearInterval(n):t()}),o);return n}},ap=e=>{const t=Aa((()=>{op(e)}),0);e.on("init",(()=>{e.inline&&((e,t)=>{const o=()=>{t.throttle()};xa.DOM.bind(document,"mouseup",o),e.on("remove",(()=>{xa.DOM.unbind(document,"mouseup",o)}))})(e,t),((e,t)=>{((e,t)=>{e.on("mouseup touchend",(e=>{t.throttle()}))})(e,t),e.on("keyup NodeChange AfterSetSelectionRange",(t=>{(e=>"nodechange"===e.type&&e.selectionChange)(t)||op(e)}))})(e,t)})),e.on("remove",(()=>{t.cancel()}))};let ip;const lp=xa.DOM,cp=e=>{const t=e.classList;return void 0!==t&&(t.contains("tox-edit-area")||t.contains("tox-edit-area__iframe")||t.contains("mce-content-body"))},dp=(e,t)=>{const o=$c(e),n=lp.getParent(t,(t=>(e=>tr(e)&&rp.isEditorUIElement(e))(t)||!!o&&e.dom.is(t,o)));return null!==n},mp=e=>{try{const t=jo(wo.fromDom(e.getElement()));return Gh(t).fold((()=>document.body),(e=>e.dom))}catch(e){return document.body}},up=(e,t)=>{const o=t.editor;ap(o);const n=(e,t)=>{Bd(e)&&!0!==e.inline&&t(wo.fromDom(e.getContainer()),"tox-edit-focus")};o.on("focusin",(()=>{const t=e.focusedEditor;cp(mp(o))&&n(o,ho),t!==o&&(t&&t.dispatch("blur",{focusedEditor:o}),e.setActive(o),e.focusedEditor=o,o.dispatch("focus",{blurredEditor:t}),o.focus(!0))})),o.on("focusout",(()=>{sp.setEditorTimeout(o,(()=>{const t=e.focusedEditor;cp(mp(o))&&t===o||n(o,fo),dp(o,mp(o))||t!==o||(o.dispatch("blur",{focusedEditor:null}),e.focusedEditor=null)}))})),ip||(ip=t=>{const o=e.activeEditor;o&&qo(t).each((t=>{const n=t;n.ownerDocument===document&&(n===document.body||dp(o,n)||e.focusedEditor!==o||(o.dispatch("blur",{focusedEditor:null}),e.focusedEditor=null))}))},lp.bind(document,"focusin",ip))},gp=(e,t)=>{e.focusedEditor===t.editor&&(e.focusedEditor=null),!e.activeEditor&&ip&&(lp.unbind(document,"focusin",ip),ip=null)},hp=(e,t)=>(e=>e.collapsed?F.from(Ri(e.startContainer,e.startOffset)).map(wo.fromDom):F.none())(t).bind((t=>ri(t)?F.some(t):_o(e,t)?F.none():F.some(e))),pp=(e,t)=>{hp(wo.fromDom(e.getBody()),t).bind((e=>su(e.dom))).fold((()=>{e.selection.normalize()}),(t=>e.selection.setRng(t.toRange())))},fp=e=>{if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},vp=e=>{return qh(e)||(t=e,Gh(jo(t)).filter((e=>t.dom.contains(e.dom)))).isSome();var t},bp=e=>e.inline?(e=>{const t=e.getBody();return t&&vp(wo.fromDom(t))})(e):(e=>C(e.iframeElement)&&qh(wo.fromDom(e.iframeElement)))(e),yp=e=>bp(e)||(e=>{const t=jo(wo.fromDom(e.getElement()));return Gh(t).filter((t=>!cp(t.dom)&&dp(e,t.dom))).isSome()})(e),wp=e=>e.editorManager.setActive(e),xp=(e,t)=>{e.removed||(t?wp(e):(e=>{const t=e.selection,o=e.getBody();let n=t.getRng();e.quirks.refreshContentEditable();const r=e=>{np(e).each((t=>{e.selection.setRng(t),n=t}))};!bp(e)&&e.hasEditableRoot()&&r(e);const s=((e,t)=>e.dom.getParent(t,(t=>"true"===e.dom.getContentEditable(t))))(e,t.getNode());if(s&&e.dom.isChildOf(s,o))return fp(s),e.hasEditableRoot()||r(e),pp(e,n),void wp(e);e.inline||(Mt.browser.isOpera()||fp(o),e.getWin().focus()),(Mt.browser.isFirefox()||e.inline)&&(fp(o),pp(e,n)),wp(e)})(e))},Cp=(e,t)=>t.collapsed?e.isEditable(t.startContainer):e.isEditable(t.startContainer)&&e.isEditable(t.endContainer),Sp=(e,t,o,n,r)=>{const s=o?t.startContainer:t.endContainer,a=o?t.startOffset:t.endOffset;return F.from(s).map(wo.fromDom).map((e=>n&&t.collapsed?e:Io(e,r(e,a)).getOr(e))).bind((e=>Kt(e)?F.some(e):Ao(e).filter(Kt))).map((e=>e.dom)).getOr(e)},kp=(e,t,o=!1)=>Sp(e,t,!0,o,((e,t)=>Math.min(zo(e),t))),_p=(e,t,o=!1)=>Sp(e,t,!1,o,((e,t)=>t>0?t-1:t)),Ep=(e,t)=>{const o=e;for(;e&&dr(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||o},Tp=(e,t)=>$(t,(t=>{const o=e.dispatch("GetSelectionRange",{range:t});return o.range!==t?o.range:t})),Op={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Ap=(e,t,o)=>{const n=o?"lastChild":"firstChild",r=o?"prev":"next";if(e[n])return e[n];if(e!==t){let o=e[r];if(o)return o;for(let n=e.parent;n&&n!==t;n=n.parent)if(o=n[r],o)return o}},Dp=e=>{var t;const o=null!==(t=e.value)&&void 0!==t?t:"";if(!Yn(o))return!1;const n=e.parent;return!n||"span"===n.name&&!n.attr("style")||!/^[ ]+$/.test(o)},Mp=e=>{const t="a"===e.name&&!e.attr("href")&&e.attr("id");return e.attr("name")||e.attr("id")&&!e.firstChild||e.attr("data-mce-bookmark")||t};class Np{static create(e,t){const o=new Np(e,Op[e]||1);return t&&ve(t,((e,t)=>{o.attr(t,e)})),o}constructor(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}replace(e){const t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t}attr(e,t){const o=this;if(!h(e))return C(e)&&ve(e,((e,t)=>{o.attr(t,e)})),o;const n=o.attributes;if(n){if(void 0!==t){if(null===t){if(e in n.map){delete n.map[e];let t=n.length;for(;t--;)if(n[t].name===e)return n.splice(t,1),o}return o}if(e in n.map){let o=n.length;for(;o--;)if(n[o].name===e){n[o].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,o}return n.map[e]}}clone(){const e=this,t=new Np(e.name,e.type),o=e.attributes;if(o){const e=[];e.map={};for(let t=0,n=o.length;th(e.nodeValue)&&e.nodeValue.includes(di),Lp=e=>(0===e.length?"":`${$(e,(e=>`[${e}]`)).join(",")},`)+'[data-mce-bogus="all"]',Hp=e=>document.createTreeWalker(e,NodeFilter.SHOW_COMMENT,(e=>Bp(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP)),Ip=e=>document.createTreeWalker(e,NodeFilter.SHOW_TEXT,(e=>{if(Bp(e)){const t=e.parentNode;return t&&Ee(Rp,t.nodeName)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}return NodeFilter.FILTER_SKIP})),Pp=e=>null!==Hp(e).nextNode(),Fp=e=>null!==Ip(e).nextNode(),zp=(e,t)=>null!==t.querySelector(Lp(e)),Vp=(e,t)=>{q(((e,t)=>t.querySelectorAll(Lp(e)))(e,t),(t=>{const o=wo.fromDom(t);"all"===no(o,"data-mce-bogus")?Sn(o):q(e,(e=>{so(o,e)&&ao(o,e)}))}))},Zp=e=>{let t=e.nextNode();for(;null!==t;)t.nodeValue=null,t=e.nextNode()},Up=T(Zp,Hp),jp=T(Zp,Ip),Wp=(e,t)=>{const o=[{condition:N(zp,t),action:N(Vp,t)},{condition:Pp,action:Up},{condition:Fp,action:jp}];let n=e,r=!1;return q(o,(({condition:t,action:o})=>{t(n)&&(r||(n=e.cloneNode(!0),r=!0),o(n))})),n},$p=e=>{const t=Vn(e,"[data-mce-bogus]");q(t,(e=>{"all"===no(e,"data-mce-bogus")?Sn(e):ei(e)?(fn(e,wo.fromText($n)),Sn(e)):kn(e)}))},qp=e=>{const t=Vn(e,"input");q(t,(e=>{ao(e,"name")}))},Gp=(e,t)=>{const o=e.getDoc(),n=jo(wo.fromDom(e.getBody())),r=wo.fromTag("div",o);to(r,"data-mce-bogus","all"),dn(r,{position:"fixed",left:"-9999999px",top:"0"}),Tn(r,t.innerHTML),$p(r),qp(r);const s=(e=>Vo(e)?e:wo.fromDom(To(e).dom.body))(n);yn(s,r);const a=ui(r.dom.innerText);return Sn(r),a},Kp=(e,t,o)=>{let n;return n="raw"===t.format?Lt.trim(ui(Wp(o,e.serializer.getTempAttrs()).innerHTML)):"text"===t.format?Gp(e,o):"tree"===t.format?e.serializer.serialize(o,t):((e,t)=>{const o=sc(e),n=new RegExp(`^(<${o}[^>]*>( | |\\s| |
|)<\\/${o}>[\r\n]*|
[\r\n]*)$`);return t.replace(n,"")})(e,e.serializer.serialize(o,t)),"text"!==t.format&&!ai(wo.fromDom(o))&&h(n)?Lt.trim(n):n},Yp=Lt.makeMap,Xp=e=>{const t=[],o=(e=e||{}).indent,n=Yp(e.indent_before||""),r=Yp(e.indent_after||""),s=Es.getEncodeFunc(e.entity_encoding||"raw",e.entities),a="xhtml"!==e.element_format;return{start:(e,i,l)=>{if(o&&n[e]&&t.length>0){const e=t[t.length-1];e.length>0&&"\n"!==e&&t.push("\n")}if(t.push("<",e),i)for(let e=0,o=i.length;e":" />",l&&o&&r[e]&&t.length>0){const e=t[t.length-1];e.length>0&&"\n"!==e&&t.push("\n")}},end:e=>{let n;t.push(""),o&&r[e]&&t.length>0&&(n=t[t.length-1],n.length>0&&"\n"!==n&&t.push("\n"))},text:(e,o)=>{e.length>0&&(t[t.length]=o?e:s(e))},cdata:e=>{t.push("")},comment:e=>{t.push("\x3c!--",e,"--\x3e")},pi:(e,n)=>{n?t.push(""):t.push(""),o&&t.push("\n")},doctype:e=>{t.push("",o?"\n":"")},reset:()=>{t.length=0},getContent:()=>t.join("").replace(/\n$/,"")}},Jp=(e={},t=Ws())=>{const o=Xp(e);return e.validate=!("validate"in e)||e.validate,{serialize:n=>{const r=e.validate,s={3:e=>{var t;o.text(null!==(t=e.value)&&void 0!==t?t:"",e.raw)},8:e=>{var t;o.comment(null!==(t=e.value)&&void 0!==t?t:"")},7:e=>{o.pi(e.name,e.value)},10:e=>{var t;o.doctype(null!==(t=e.value)&&void 0!==t?t:"")},4:e=>{var t;o.cdata(null!==(t=e.value)&&void 0!==t?t:"")},11:e=>{let t=e;if(t=t.firstChild)do{a(t)}while(t=t.next)}};o.reset();const a=e=>{var n;const i=s[e.type];if(i)i(e);else{const s=e.name,i=s in t.getVoidElements();let l=e.attributes;if(r&&l&&l.length>1){const o=[];o.map={};const n=t.getElementRule(e.name);if(n){for(let e=0,t=n.attributesOrder.length;e{Qp.add(e)}));const ef=new Set;q(["background-color"],(e=>{ef.add(e)}));const tf=["font","text-decoration","text-emphasis"],of=(e,t)=>pe(((e,t)=>e.parseStyle(e.getAttrib(t,"style")))(e,t)),nf=(e,t)=>W(of(e,t),(e=>(e=>Qp.has(e))(e))),rf=(e,t)=>nf(e,t)&&W(of(e,t),(e=>(e=>ef.has(e))(e))),sf=(e,t,o)=>{const n=of(e,t),r=of(e,o),s=n=>{var r,s;const a=null!==(r=e.getStyle(t,n))&&void 0!==r?r:"",i=null!==(s=e.getStyle(o,n))&&void 0!==s?s:"";return Xe(a)&&Xe(i)&&a!==i};return W(n,(e=>{const t=t=>W(t,(t=>t===e));if(!t(r)&&t(tf)){const e=Y(r,(e=>W(tf,(t=>We(e,t)))));return W(e,s)}return s(e)}))},af=(e,t,o)=>F.from(o.container()).filter(dr).exists((n=>{const r=e?0:-1;return t(n.data.charAt(o.offset()+r))})),lf=N(af,!0,_u),cf=N(af,!1,_u),df=e=>{const t=e.container();return dr(t)&&(0===t.data.length||mi(t.data)&&Ng.isBookmarkNode(t.parentNode))},mf=(e,t)=>o=>_m(e?0:-1,o).filter(t).isSome(),uf=e=>vr(e)&&"block"===mn(wo.fromDom(e),"display"),gf=e=>yr(e)&&!(e=>tr(e)&&"all"===e.getAttribute("data-mce-bogus"))(e),hf=mf(!0,uf),pf=mf(!1,uf),ff=mf(!0,Cr),vf=mf(!1,Cr),bf=mf(!0,ir),yf=mf(!1,ir),wf=mf(!0,gf),xf=mf(!1,gf),Cf=(e,t)=>((e,t,o)=>_o(t,e)?Mo(e,(e=>o(e)||ko(e,t))).slice(0,-1):[])(e,t,I),Sf=(e,t)=>[e].concat(Cf(e,t)),kf=(e,t,o)=>tu(e,t,o,df),_f=(e,t,o)=>ee(Sf(wo.fromDom(t.container()),e),(e=>t=>e.isBlock(Wt(t)))(o)),Ef=(e,t,o,n)=>kf(e,t.dom,o).forall((e=>_f(t,o,n).fold((()=>!km(e,o,t.dom)),(n=>!km(e,o,t.dom)&&_o(n,wo.fromDom(e.container())))))),Tf=(e,t,o,n)=>_f(t,o,n).fold((()=>kf(e,t.dom,o).forall((e=>!km(e,o,t.dom)))),(t=>kf(e,t.dom,o).isNone())),Of=N(Tf,!1),Af=N(Tf,!0),Df=N(Ef,!1),Mf=N(Ef,!0),Nf=e=>Bm(e).exists(ei),Rf=(e,t,o,n)=>{const r=Y(Sf(wo.fromDom(o.container()),t),(e=>n.isBlock(Wt(e)))),s=de(r).getOr(t);return Qm(e,s.dom,o).filter(Nf)},Bf=(e,t,o)=>Bm(t).exists(ei)||Rf(!0,e,t,o).isSome(),Lf=(e,t,o)=>(e=>F.from(e.getNode(!0)).map(wo.fromDom))(t).exists(ei)||Rf(!1,e,t,o).isSome(),Hf=N(Rf,!1),If=N(Rf,!0),Pf=e=>ml.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd(),Ff=(e,t,o)=>{const n=Y(Sf(wo.fromDom(t.container()),e),(e=>o.isBlock(Wt(e))));return de(n).getOr(e)},zf=(e,t,o)=>Pf(t)?cf(t):cf(t)||ru(Ff(e,t,o).dom,t).exists(cf),Vf=(e,t,o)=>Pf(t)?lf(t):lf(t)||nu(Ff(e,t,o).dom,t).exists(lf),Zf=e=>Bm(e).bind((e=>Jo(e,Kt))).exists((e=>(e=>j(["pre","pre-wrap"],e))(mn(e,"white-space")))),Uf=(e,t,o)=>((e,t)=>ru(e.dom,t).isNone())(e,t)||((e,t)=>nu(e.dom,t).isNone())(e,t)||Of(e,t,o)||Af(e,t,o)||Lf(e,t,o)||Bf(e,t,o),jf=(e,t)=>o=>{return n=new Wn(o,e)[t](),C(n)&&yr(n)&&gm(n);var n},Wf=(e,t,o)=>!Zf(t)&&(Uf(e,t,o)||zf(e,t,o)||Vf(e,t,o)),$f=(e,t,o)=>!Zf(t)&&(Of(e,t,o)||Df(e,t,o)||Lf(e,t,o)||zf(e,t,o)||((e,t)=>{const o=ru(e.dom,t).getOr(t),n=jf(e.dom,"prev");return t.isAtStart()&&(n(t.container())||n(o.container()))})(e,t)),qf=(e,t,o)=>!Zf(t)&&(Af(e,t,o)||Mf(e,t,o)||Bf(e,t,o)||Vf(e,t,o)||((e,t)=>{const o=nu(e.dom,t).getOr(t),n=jf(e.dom,"next");return t.isAtEnd()&&(n(t.container())||n(o.container()))})(e,t)),Gf=(e,t,o)=>$f(e,t,o)||qf(e,(e=>{const t=e.container(),o=e.offset();return dr(t)&&oSu(e.charAt(t)),Yf=(e,t)=>_u(e.charAt(t)),Xf=(e,t,o,n)=>{const r=t.data,s=ml(t,0);return o||!Kf(r,0)||Gf(e,s,n)?!!(o&&Yf(r,0)&&$f(e,s,n))&&(t.data=qn+r.slice(1),!0):(t.data=" "+r.slice(1),!0)},Jf=e=>{const t=e.data,o=(e=>{const t=e.split("");return $(t,((e,o)=>Su(e)&&o>0&&o{const r=t.data,s=ml(t,r.length-1);return o||!Kf(r,r.length-1)||Gf(e,s,n)?!!(o&&Yf(r,r.length-1)&&qf(e,s,n))&&(t.data=r.slice(0,-1)+qn,!0):(t.data=r.slice(0,-1)+" ",!0)},ev=(e,t,o)=>{const n=t.container();if(!dr(n))return F.none();if((e=>{const t=e.container();return dr(t)&&je(t.data,qn)})(t)){const r=Xf(e,n,!1,o)||Jf(n)||Qf(e,n,!1,o);return Ft(r,t)}if(Gf(e,t,o)){const r=Xf(e,n,!0,o)||Qf(e,n,!0,o);return Ft(r,t)}return F.none()},tv=(e,t,o,n)=>{if(0===o)return;const r=wo.fromDom(e),s=Xo(r,(e=>n.isBlock(Wt(e)))).getOr(r),a=e.data.slice(t,t+o),i=t+o>=e.data.length&&qf(s,ml(e,e.data.length),n),l=0===t&&$f(s,ml(e,0),n);e.replaceData(t,o,Jn(a,4,l,i))},ov=(e,t,o)=>{const n=e.data.slice(t),r=n.length-Ke(n).length;tv(e,t,r,o)},nv=(e,t,o)=>{const n=e.data.slice(0,t),r=n.length-Ye(n).length;tv(e,t-r,r,o)},rv=(e,t,o,n,r=!0)=>{const s=Ye(e.data).length,a=r?e:t,i=r?t:e;return r?a.appendData(i.data):a.insertData(0,i.data),Sn(wo.fromDom(i)),n&&ov(a,s,o),a},sv=(e,t)=>((e,t)=>{const o=e.container(),n=e.offset();return!ml.isTextPosition(e)&&o===t.parentNode&&n>ml.before(t).offset()})(t,e)?ml(t.container(),t.offset()-1):t,av=e=>{return ji(e.previousSibling)?F.some((t=e.previousSibling,dr(t)?ml(t,t.data.length):ml.after(t))):e.previousSibling?au(e.previousSibling):F.none();var t},iv=e=>{return ji(e.nextSibling)?F.some((t=e.nextSibling,dr(t)?ml(t,0):ml.before(t))):e.nextSibling?su(e.nextSibling):F.none();var t},lv=(e,t)=>av(t).orThunk((()=>iv(t))).orThunk((()=>((e,t)=>F.from(t.previousSibling?t.previousSibling:t.parentNode).bind((t=>ru(e,ml.before(t)))).orThunk((()=>nu(e,ml.after(t)))))(e,t))),cv=(e,t)=>iv(t).orThunk((()=>av(t))).orThunk((()=>((e,t)=>nu(e,ml.after(t)).orThunk((()=>ru(e,ml.before(t)))))(e,t))),dv=(e,t,o)=>((e,t,o)=>e?cv(t,o):lv(t,o))(e,t,o).map(N(sv,o)),mv=(e,t,o)=>{o.fold((()=>{e.focus()}),(o=>{e.selection.setRng(o.toRange(),t)}))},uv=(e,t)=>t&&Ee(e.schema.getBlockElements(),Wt(t)),gv=(e,t,o,n)=>{const r=No(e).filter(Yt),s=Ro(e).filter(Yt);return Sn(e),(a=r,i=s,l=t,c=(e,t,r)=>{const s=e.dom,a=t.dom,i=s.data.length;return rv(s,a,o,n),r.container()===a?ml(s,i):r},a.isSome()&&i.isSome()&&l.isSome()?F.some(c(a.getOrDie(),i.getOrDie(),l.getOrDie())):F.none()).orThunk((()=>(n&&(r.each((e=>nv(e.dom,e.dom.length,o))),s.each((e=>ov(e.dom,0,o)))),t)));var a,i,l,c},hv=(e,t,o,n=!0,r=!1)=>{const s=dv(t,e.getBody(),o.dom),a=Xo(o,N(uv,e),(i=e.getBody(),e=>e.dom===i));var i;const l=gv(o,s,e.schema,((e,t)=>Ee(e.schema.getTextInlineElements(),Wt(t)))(e,o));e.dom.isEmpty(e.getBody())?(e.setContent(""),e.selection.setCursorLocation()):a.bind((t=>((e,t,o)=>{if(Rr(e,t)){const e=wo.fromHtml('
');return o?q(Ho(t),(e=>{ig(e)||Sn(e)})):Cn(t),yn(t,e),F.some(ml.before(e.dom))}return F.none()})(e.schema,t,r))).fold((()=>{n&&mv(e,t,l)}),(o=>{n&&mv(e,t,F.some(o))}))},pv=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,fv=(e,t)=>Co(wo.fromDom(t),Mc(e))&&!es(e.schema,t)&&e.dom.isEditable(t),vv=e=>{var t;return"rtl"===xa.DOM.getStyle(e,"direction",!0)||(e=>pv.test(e))(null!==(t=e.textContent)&&void 0!==t?t:"")},bv=(e,t,o)=>{const n=((e,t,o)=>Y(xa.DOM.getParents(o.container(),"*",t),e))(e,t,o);return F.from(n[n.length-1])},yv=(e,t)=>{const o=t.container(),n=t.offset();return e?fi(o)?dr(o.nextSibling)?ml(o.nextSibling,0):ml.after(o):yi(t)?ml(o,n+1):t:fi(o)?dr(o.previousSibling)?ml(o.previousSibling,o.previousSibling.data.length):ml.before(o):wi(t)?ml(o,n-1):t},wv=N(yv,!0),xv=N(yv,!1),Cv=(e,t)=>{const o=e=>e.stopImmediatePropagation();e.on("beforeinput input",o,!0),e.getDoc().execCommand(t),e.off("beforeinput input",o)},Sv=e=>Cv(e,"Delete"),kv=e=>Cv(e,"ForwardDelete"),_v=e=>ti(e)||ni(e),Ev=(e,t)=>_o(e,t)?Jo(t,_v,(e=>t=>Ht(Ao(t),e,ko))(e)):F.none(),Tv=(e,t=!0)=>{e.dom.isEmpty(e.getBody())&&e.setContent("",{no_selection:!t})},Ov=(e,t,o)=>Pt(su(o),au(o),((n,r)=>{const s=yv(!0,n),a=yv(!1,r),i=yv(!1,t);return e?nu(o,i).exists((e=>e.isEqual(a)&&t.isEqual(s))):ru(o,i).exists((e=>e.isEqual(s)&&t.isEqual(a)))})).getOr(!0),Av=e=>{var t;return(8===$t(t=e)||"#comment"===Wt(t)?No(e):Fo(e)).bind(Av).orThunk((()=>F.some(e)))},Dv=(e,t,o,n=!0)=>{var r;t.deleteContents();const s=Av(o).getOr(o),a=wo.fromDom(null!==(r=e.dom.getParent(s.dom,e.dom.isBlock))&&void 0!==r?r:o.dom);if(a.dom===e.getBody()?Tv(e,n):Rr(e.schema,a,{checkRootAsContent:!1})&&(ci(a),n&&e.selection.setCursorLocation(a.dom,0)),!ko(o,a)){const t=Ht(Ao(a),o)?[]:Ao(i=a).map(Ho).map((e=>Y(e,(e=>!ko(i,e))))).getOr([]);q(t.concat(Ho(o)),(t=>{ko(t,a)||_o(t,a)||!Rr(e.schema,t)||Sn(t)}))}var i},Mv=e=>Vn(e,"td,th"),Nv=(e,t)=>Mu(wo.fromDom(e),t),Rv=e=>(e=>Pt(e.startTable,e.endTable,((t,o)=>{const n=jn(t,(e=>ko(e,o))),r=jn(o,(e=>ko(e,t)));return n||r?{...e,startTable:n?F.none():e.startTable,endTable:r?F.none():e.endTable,isSameTable:!1,isMultiTable:!1}:e})).getOr(e))(e),Bv=(e,t)=>({start:e,end:t}),Lv=Il([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),Hv=(e,t)=>nn(wo.fromDom(e),"td,th",t),Iv=e=>!ko(e.start,e.end),Pv=(e,t)=>Mu(e.start,t).bind((o=>Mu(e.end,t).bind((e=>Ft(ko(o,e),o))))),Fv=e=>t=>Pv(t,e).map((e=>((e,t,o)=>({rng:e,table:t,cells:o}))(t,e,Mv(e)))),zv=(e,t,o,n)=>{if(o.collapsed||!e.forall(Iv))return F.none();if(t.isSameTable){const t=e.bind(Fv(n));return F.some({start:t,end:t})}{const e=Hv(o.startContainer,n),t=Hv(o.endContainer,n),r=e.bind((e=>t=>Mu(t,e).bind((e=>me(Mv(e)).map((e=>Bv(t,e))))))(n)).bind(Fv(n)),s=t.bind((e=>t=>Mu(t,e).bind((e=>de(Mv(e)).map((e=>Bv(e,t))))))(n)).bind(Fv(n));return F.some({start:r,end:s})}},Vv=(e,t)=>te(e,(e=>ko(e,t))),Zv=e=>Pt(Vv(e.cells,e.rng.start),Vv(e.cells,e.rng.end),((t,o)=>e.cells.slice(t,o+1))),Uv=(e,t,o)=>e.exists((e=>((e,t)=>!Iv(e)&&Pv(e,t).exists((e=>{const t=e.dom.rows;return 1===t.length&&1===t[0].cells.length})))(e,o)&&Bu(e.start,t))),jv=(e,t)=>{const{startTable:o,endTable:n}=t,r=e.cloneRange();return o.each((e=>r.setStartAfter(e.dom))),n.each((e=>r.setEndBefore(e.dom))),r},Wv=(e,t)=>{const o=(e=>t=>ko(e,t))(e),n=((e,t)=>{const o=Hv(e.startContainer,t),n=Hv(e.endContainer,t);return Pt(o,n,Bv)})(t,o),r=((e,t)=>{const o=Nv(e.startContainer,t),n=Nv(e.endContainer,t),r=o.isSome(),s=n.isSome(),a=Pt(o,n,ko).getOr(!1);return Rv({startTable:o,endTable:n,isStartInTable:r,isEndInTable:s,isSameTable:a,isMultiTable:!a&&r&&s})})(t,o);return Uv(n,t,o)?n.map((e=>Lv.singleCellTable(t,e.start))):r.isMultiTable?((e,t,o,n)=>zv(e,t,o,n).bind((({start:e,end:n})=>{const r=e.bind(Zv).getOr([]),s=n.bind(Zv).getOr([]);if(r.length>0&&s.length>0){const e=jv(o,t);return F.some(Lv.multiTable(r,s,e))}return F.none()})))(n,r,t,o):((e,t,o,n)=>zv(e,t,o,n).bind((({start:e,end:t})=>e.or(t))).bind((e=>{const{isSameTable:n}=t,r=Zv(e).getOr([]);if(n&&e.cells.length===r.length)return F.some(Lv.fullTable(e.table));if(r.length>0){if(n)return F.some(Lv.partialTable(r,F.none()));{const e=jv(o,t);return F.some(Lv.partialTable(r,F.some({...t,rng:e})))}}return F.none()})))(n,r,t,o)},$v=e=>q(e,(e=>{ao(e,"contenteditable"),ci(e)})),qv=(e,t,o,n)=>{const r=o.cloneRange();n?(r.setStart(o.startContainer,o.startOffset),r.setEndAfter(t.dom.lastChild)):(r.setStartBefore(t.dom.firstChild),r.setEnd(o.endContainer,o.endOffset)),Xv(e,r,t,!1).each((e=>e()))},Gv=e=>{const t=Du(e),o=wo.fromDom(e.selection.getNode());wr(o.dom)&&Rr(e.schema,o)?e.selection.setCursorLocation(o.dom,0):e.selection.collapse(!0),t.length>1&&W(t,(e=>ko(e,o)))&&to(o,"data-mce-selected","1")},Kv=(e,t,o)=>F.some((()=>{const n=e.selection.getRng(),r=o.bind((({rng:o,isStartInTable:r})=>{const s=((e,t)=>F.from(e.dom.getParent(t,e.dom.isBlock)).map(wo.fromDom))(e,r?o.endContainer:o.startContainer);o.deleteContents(),((e,t,o)=>{o.each((o=>{t?Sn(o):(ci(o),e.selection.setCursorLocation(o.dom,0))}))})(e,r,s.filter(N(Rr,e.schema)));const a=r?t[0]:t[t.length-1];return qv(e,a,n,r),Rr(e.schema,a)?F.none():F.some(r?t.slice(1):t.slice(0,-1))})).getOr(t);$v(r),Gv(e)})),Yv=(e,t,o,n)=>F.some((()=>{const r=e.selection.getRng(),s=t[0],a=o[o.length-1];qv(e,s,r,!0),qv(e,a,r,!1);const i=Rr(e.schema,s)?t:t.slice(1),l=Rr(e.schema,a)?o:o.slice(0,-1);$v(i.concat(l)),n.deleteContents(),Gv(e)})),Xv=(e,t,o,n=!0)=>F.some((()=>{Dv(e,t,o,n)})),Jv=(e,t)=>F.some((()=>hv(e,!1,t))),Qv=(e,t,o,n)=>tb(t,n).fold((()=>((e,t,o)=>Wv(t,o).bind((t=>t.fold(N(Xv,e),N(Jv,e),N(Kv,e),N(Yv,e)))))(e,t,o)),(t=>((e,t)=>ob(e,t))(e,t))),eb=(e,t)=>ee(Sf(t,e),si),tb=(e,t)=>ee(Sf(t,e),Qt("caption")),ob=(e,t)=>F.some((()=>{ci(t),e.selection.setCursorLocation(t.dom,0)})),nb=(e,t,o,n,r)=>eu(o,e.getBody(),r).fold((()=>F.some(E)),(s=>((e,t,o,n)=>su(e.dom).bind((r=>au(e.dom).map((e=>t?o.isEqual(r)&&n.isEqual(e):o.isEqual(e)&&n.isEqual(r))))).getOr(!0))(n,o,r,s)?((e,t)=>ob(e,t))(e,n):((e,t,o)=>tb(e,wo.fromDom(o.getNode())).fold((()=>F.some(E)),(e=>Ft(!ko(e,t),E))))(t,n,s))),rb=(e,t,o,n)=>{const r=ml.fromRangeStart(e.selection.getRng());return eb(o,n).bind((n=>Rr(e.schema,n,{checkRootAsContent:!1})?ob(e,n):((e,t,o,n,r)=>eu(o,e.getBody(),r).bind((e=>eb(t,wo.fromDom(e.getNode())).bind((e=>ko(e,n)?F.none():F.some(E))))))(e,o,t,n,r)))},sb=(e,t)=>e?bf(t):yf(t),ab=(e,t,o)=>{const n=wo.fromDom(e.getBody());return tb(n,o).fold((()=>rb(e,t,n,o).orThunk((()=>Ft(((e,t)=>{const o=ml.fromRangeStart(e.selection.getRng());return sb(t,o)||Qm(t,e.getBody(),o).exists((e=>sb(t,e)))})(e,t),E)))),(o=>((e,t,o,n)=>{const r=ml.fromRangeStart(e.selection.getRng());return Rr(e.schema,n)?ob(e,n):nb(e,o,t,n,r)})(e,t,n,o)))},ib=(e,t)=>{const o=wo.fromDom(e.selection.getStart(!0)),n=Du(e);return e.selection.isCollapsed()&&0===n.length?ab(e,t,o):((e,t,o)=>{const n=wo.fromDom(e.getBody()),r=e.selection.getRng();return 0!==o.length?Kv(e,o,F.none()):Qv(e,n,r,t)})(e,o,n)},lb=(e,t)=>{let o=t;for(;o&&o!==e;){if(br(o)||yr(o))return o;o=o.parentNode}return null},cb=["data-ephox-","data-mce-","data-alloy-","data-snooker-","_"],db=Lt.each,mb=e=>{const t=e.dom,o=new Set(e.serializer.getTempAttrs()),n=e=>W(cb,(t=>We(e,t)))||o.has(e);return{compare:(e,o)=>{if(e.nodeName!==o.nodeName||e.nodeType!==o.nodeType)return!1;const r=e=>{const o={};return db(t.getAttribs(e),(r=>{const s=r.nodeName.toLowerCase();"style"===s||n(s)||(o[s]=t.getAttrib(e,s))})),o},s=(e,t)=>{for(const o in e)if(Ee(e,o)){const n=t[o];if(w(n))return!1;if(e[o]!==n)return!1;delete t[o]}for(const e in t)if(Ee(t,e))return!1;return!0};if(tr(e)&&tr(o)){if(!s(r(e),r(o)))return!1;if(!s(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(o,"style"))))return!1}return!Cu(e)&&!Cu(o)},isAttributeInternal:n}},ub=e=>["h1","h2","h3","h4","h5","h6"].includes(e.name),gb=(e,t,o,n)=>{const r=o.name;for(let t=0,s=e.length;t{const o=(e,o)=>{ve(e,(e=>{const n=ue(e.nodes);q(e.filter.callbacks,(r=>{for(let t=n.length-1;t>=0;t--){const r=n[t];(o?void 0!==r.attr(e.filter.name):r.name===e.filter.name)&&!x(r.parent)||n.splice(t,1)}n.length>0&&r(n,e.filter.name,t)}))}))};o(e.nodes,!1),o(e.attributes,!0)},pb=(e,t,o,n={})=>{const r=((e,t,o)=>{const n={nodes:{},attributes:{}};return o.firstChild&&((e,t)=>{let o=e;for(;o=o.walk();)t(o)})(o,(o=>{gb(e,t,o,n)})),n})(e,t,o);hb(r,n)},fb=(e,t,o,n)=>{if((e.pad_empty_with_br||t.insert)&&o(n)){const e=new Np("br",1);t.insert&&e.attr("data-mce-bogus","1"),n.empty().append(e)}else n.empty().append(new Np("#text",3)).value=qn},vb=(e,t)=>{const o=null==e?void 0:e.firstChild;return C(o)&&o===e.lastChild&&o.name===t},bb=(e,t,o,n)=>n.isEmpty(t,o,(t=>((e,t)=>{const o=e.getElementRule(t.name);return!0===(null==o?void 0:o.paddEmpty)})(e,t))),yb=e=>{let t;for(let o=e;o;o=o.parent){const e=o.attr("contenteditable");if("false"===e)break;"true"===e&&(t=o)}return F.from(t)},wb=(e,t,o=e.parent)=>{if(t.getSpecialElements()[e.name])e.empty().remove();else{const n=e.children();for(const e of n)o&&!t.isValidChild(o.name,e.name)&&wb(e,t,o);e.unwrap()}},xb=(e,t,o,n=E)=>{const r=t.getTextBlockElements(),s=t.getNonEmptyElements(),a=t.getWhitespaceElements(),i=Lt.makeMap("tr,td,th,tbody,thead,tfoot,table,summary"),l=new Set,c=e=>e!==o&&!i[e.name];for(let o=0;o1)if(Cb(t,i,d))wb(i,t);else{g.reverse(),m=g[0].clone(),n(m);let e=m;for(let o=0;o0?(u=g[o].clone(),n(u),e.append(u)):u=e;for(let e=g[o].firstChild;e&&e!==g[o+1];){const t=e.next;u.append(e),e=t}e=u}bb(t,s,a,m)?d.insert(i,g[0],!0):(d.insert(m,g[0],!0),d.insert(i,m)),d=g[0],(bb(t,s,a,d)||vb(d,"br"))&&d.empty().remove()}else if(i.parent){if("li"===i.name){let e=i.prev;if(e&&("ul"===e.name||"ol"===e.name)){e.append(i);continue}if(e=i.next,e&&("ul"===e.name||"ol"===e.name)&&e.firstChild){e.insert(i,e.firstChild,!0);continue}const t=new Np("ul",1);n(t),i.wrap(t);continue}if(t.isValidChild(i.parent.name,"div")&&t.isValidChild("div",i.name)){const e=new Np("div",1);n(e),i.wrap(e)}else wb(i,t)}}},Cb=(e,t,o=t.parent)=>!(!o||(!e.children[t.name]||e.isValidChild(o.name,t.name))&&("a"!==t.name||!((e,t)=>{let o=e;for(;o;){if(o.name===t)return!0;o=o.parent}return!1})(o,"a"))&&(!(e=>"summary"===e.name)(o)||!ub(t)||(null==o?void 0:o.firstChild)===t&&(null==o?void 0:o.lastChild)===t)),Sb=e=>{const t=ml.fromRangeStart(e),o=ml.fromRangeEnd(e),n=e.commonAncestorContainer;return Qm(!1,n,o).map((r=>!km(t,o,n)&&km(t,r,n)?((e,t,o,n)=>{const r=document.createRange();return r.setStart(e,t),r.setEnd(o,n),r})(t.container(),t.offset(),r.container(),r.offset()):e)).getOr(e)},kb=e=>e.collapsed?e:Sb(e),_b=(e,t)=>e.getBlockElements()[t.name]&&(e=>C(e.firstChild)&&e.firstChild===e.lastChild)(t)&&(e=>"br"===e.name||e.value===qn)(t.firstChild),Eb=(e,t)=>{let o=t.firstChild,n=t.lastChild;return o&&"meta"===o.name&&(o=o.next),n&&"mce_marker"===n.attr("id")&&(n=n.prev),((e,t)=>{const o=e.getNonEmptyElements();return C(t)&&(t.isEmpty(o)||_b(e,t))})(e,n)&&(n=null==n?void 0:n.prev),!(!o||o!==n||"ul"!==o.name&&"ol"!==o.name)},Tb=e=>C(null==e?void 0:e.firstChild)&&e.firstChild===e.lastChild&&(e=>e.data===qn||fr(e))(e.firstChild),Ob=e=>{return e.length>0&&(!(t=e[e.length-1]).firstChild||Tb(t))?e.slice(0,-1):e;var t},Ab=(e,t)=>{const o=e.getParent(t,e.isBlock);return o&&"LI"===o.nodeName?o:null},Db=(e,t)=>{const o=ml.after(e),n=Gm(t).prev(o);return n?n.toRange():null},Mb=(e,t,o)=>{const n=e.parentNode;return n&&Lt.each(t,(t=>{n.insertBefore(t,e)})),((e,t)=>{const o=ml.before(e),n=Gm(t).next(o);return n?n.toRange():null})(e,o)},Nb=(e,t,o,n)=>{const r=((e,t,o)=>{const n=t.serialize(o);return(e=>{var t,o;const n=e.firstChild,r=e.lastChild;return n&&"META"===n.nodeName&&(null===(t=n.parentNode)||void 0===t||t.removeChild(n)),r&&"mce_marker"===r.id&&(null===(o=r.parentNode)||void 0===o||o.removeChild(r)),e})(e.createFragment(n))})(t,e,n),s=Ab(t,o.startContainer),a=Ob((i=r.firstChild,Y(null!==(l=null==i?void 0:i.childNodes)&&void 0!==l?l:[],(e=>"LI"===e.nodeName))));var i,l;const c=t.getRoot(),d=e=>{const n=ml.fromRangeStart(o),r=Gm(t.getRoot()),a=1===e?r.prev(n):r.next(n),i=null==a?void 0:a.getNode();return!i||Ab(t,i)!==s};return s?d(1)?Mb(s,a,c):d(2)?((e,t,o,n)=>(n.insertAfter(t.reverse(),e),Db(t[0],o)))(s,a,c,t):((e,t,o,n)=>{const r=((e,t)=>{const o=t.cloneRange(),n=t.cloneRange();return o.setStartBefore(e),n.setEndAfter(e),[o.cloneContents(),n.cloneContents()]})(e,n),s=e.parentNode;return s&&(s.insertBefore(r[0],e),Lt.each(t,(t=>{s.insertBefore(t,e)})),s.insertBefore(r[1],e),s.removeChild(e)),Db(t[t.length-1],o)})(s,a,c,o):null},Rb=["pre"],Bb=wr,Lb=(e,t,o)=>{F.from(e.getParent(t,"td,th")).map(wo.fromDom).each((e=>((e,t)=>{Fo(e).each((o=>{No(o).each((n=>{t.isBlock(Wt(e))&&ei(o)&&t.isBlock(Wt(n))&&Sn(o)}))}))})(e,o)))},Hb=(e,t)=>{var o,n,r;let s;const a=e.dom,i=e.selection;if(!t)return;i.scrollIntoView(t);const l=lb(e.getBody(),t);if(l&&"false"===a.getContentEditable(l))return a.remove(t),void i.select(l);let c=a.createRng();const d=t.previousSibling;if(dr(d)){c.setStart(d,null!==(n=null===(o=d.nodeValue)||void 0===o?void 0:o.length)&&void 0!==n?n:0);const e=t.nextSibling;dr(e)&&(d.appendData(e.data),null===(r=e.parentNode)||void 0===r||r.removeChild(e))}else c.setStartBefore(t),c.setEndBefore(t);const m=a.getParent(t,a.isBlock);if(a.remove(t),m&&a.isEmpty(m)){const t=Bb(m);Cn(wo.fromDom(m)),c.setStart(m,0),c.setEnd(m,0),t||(e=>!!e.getAttribute("data-mce-fragment"))(m)||!(s=(t=>{let o=ml.fromRangeStart(t);return o=Gm(e.getBody()).next(o),null==o?void 0:o.toRange()})(c))?a.add(m,a.create("br",t?{}:{"data-mce-bogus":"1"})):(c=s,a.remove(m))}i.setRng(c)},Ib=e=>{const t=e.dom,o=kb(e.selection.getRng());e.selection.setRng(o);const n=t.getParent(o.startContainer,Bb);((e,t,o)=>!!C(o)&&(o===e.getParent(t.endContainer,Bb)&&Bu(wo.fromDom(o),t)))(t,o,n)?Xv(e,o,wo.fromDom(n)):o.startContainer===o.endContainer&&o.endOffset-o.startOffset==1&&dr(o.startContainer.childNodes[o.startOffset])?o.deleteContents():e.getDoc().execCommand("Delete",!1)},Pb=(e,t,o)=>{var n,r;const s=e.selection,a=e.dom,i=e.parser,l=o.merge,c=Jp({validate:!0},e.schema),d='';o.preserve_zwsp||(t=ui(t)),-1===t.indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);let m=s.getRng();const u=m.startContainer,g=e.getBody();u===g&&s.isCollapsed()&&a.isBlock(g.firstChild)&&((e,t)=>C(t)&&!e.schema.getVoidElements()[t.nodeName])(e,g.firstChild)&&a.isEmpty(g.firstChild)&&(m=a.createRng(),m.setStart(g.firstChild,0),m.setEnd(g.firstChild,0),s.setRng(m)),s.isCollapsed()||Ib(e);const h=s.getNode(),p={context:h.nodeName.toLowerCase(),data:o.data,insert:!0},f=i.parse(t,p);if(!0===o.paste&&Eb(e.schema,f)&&((e,t)=>!!Ab(e,t))(a,h))return m=Nb(c,a,s.getRng(),f),m&&s.setRng(m),t;!0===o.paste&&((e,t,o,n)=>{var r;const s=t.firstChild,a=t.lastChild,i=s===("bookmark"===a.attr("data-mce-type")?a.prev:a),l=j(Rb,s.name);if(i&&l){const t="false"!==s.attr("contenteditable"),a=(null===(r=e.getParent(o,e.isBlock))||void 0===r?void 0:r.nodeName.toLowerCase())===s.name,i=F.from(lb(n,o)).forall(br);return t&&a&&i}return!1})(a,f,h,e.getBody())&&(null===(n=f.firstChild)||void 0===n||n.unwrap()),(e=>{let t=e;for(;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")})(f);let v=f.lastChild;if(v&&"mce_marker"===v.attr("id")){const t=v;for(v=v.prev;v;v=v.walk(!0))if(3===v.type||!a.isBlock(v.name)){v.parent&&e.schema.isValidChild(v.parent.name,"span")&&v.parent.insert(t,v,"br"===v.name);break}}if(e._selectionOverrides.showBlockCaretContainer(h),p.invalid||((e,t,o)=>{var n;return W(o.children(),ub)&&"SUMMARY"===(null===(n=e.getParent(t,e.isBlock))||void 0===n?void 0:n.nodeName)})(a,h,f)){e.selection.setContent(d);let o,n=s.getNode();const l=e.getBody();for(hr(n)?n=o=l:o=n;o&&o!==l;)n=o,o=o.parentNode;t=n===l?l.innerHTML:a.getOuterHTML(n);const m=i.parse(t),u=(e=>{for(let t=e;t;t=t.walk())if("mce_marker"===t.attr("id"))return F.some(t);return F.none()})(m),g=u.bind(yb).getOr(m);u.each((e=>e.replace(f)));const h=f.children(),p=null!==(r=f.parent)&&void 0!==r?r:m;f.unwrap();const v=Y(h,(t=>Cb(e.schema,t,p)));xb(v,e.schema,g),pb(i.getNodeFilters(),i.getAttributeFilters(),m),t=c.serialize(m),n===l?a.setHTML(l,t):a.setOuterHTML(n,t)}else t=c.serialize(f),((e,t,o)=>{var n;if("all"===o.getAttribute("data-mce-bogus"))null===(n=o.parentNode)||void 0===n||n.insertBefore(e.dom.createFragment(t),o);else{const n=o.firstChild,r=o.lastChild;!n||n===r&&"BR"===n.nodeName?e.dom.setHTML(o,t):e.selection.setContent(t,{no_events:!0})}})(e,t,h);var b;return((e,t)=>{const o=e.schema.getTextInlineElements(),n=e.dom;if(t){const t=e.getBody(),r=mb(e),s="*[data-mce-fragment]",a=n.select(s);Lt.each(a,(e=>{const a=e=>C(o[e.nodeName.toLowerCase()]),i=e=>1===e.childNodes.length;if(!nf(n,l=e)&&!rf(n,l)&&a(e)&&i(e)){const o=of(n,e),l=(e,t)=>re(e,(e=>j(t,e))),c=t=>i(e)&&n.is(t,s)&&a(t)&&(t.nodeName===e.nodeName&&l(o,of(n,t))||c(t.children[0])),d=o=>C(o)&&o!==t&&(r.compare(e,o)||d(o.parentElement)),m=o=>C(o)&&o!==t&&n.is(o,s)&&(sf(n,e,o)||m(o.parentElement));(c(e.children[0])||d(e.parentElement)&&!m(e.parentElement))&&n.remove(e,!0)}var l}))}})(e,l),Hb(e,a.get("mce_marker")),b=e.getBody(),Lt.each(b.getElementsByTagName("*"),(e=>{e.removeAttribute("data-mce-fragment")})),Lb(a,s.getStart(),e.schema),((e,t,o)=>{const n=Mo(wo.fromDom(o),(e=>ko(e,wo.fromDom(t))));ce(n,n.length-2).filter(Kt).fold((()=>Kr(e,t)),(t=>Kr(e,t.dom)))})(e.schema,e.getBody(),s.getStart()),t},Fb=e=>e instanceof Np,zb=(e,t,o)=>{e.dom.setHTML(e.getBody(),t),!0!==o&&(e=>{bp(e)&&su(e.getBody()).each((t=>{const o=t.getNode(),n=ir(o)?su(o).getOr(t):t;e.selection.setRng(n.toRange())}))})(e)},Vb=(e,t,o)=>F.from(e.getBody()).map((n=>Fb(t)?((e,t,o,n)=>{pb(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),o);const r=Jp({validate:!1},e.schema).serialize(o),s=ui(ai(wo.fromDom(t))?r:Lt.trim(r));return zb(e,s,n.no_selection),{content:o,html:s}})(e,n,t,o):((e,t,o,n)=>{if(0===(o=ui(o)).length||/^\s+$/.test(o)){const r='
';"TABLE"===t.nodeName?o=""+r+"":/^(UL|OL)$/.test(t.nodeName)&&(o="
  • "+r+"
  • ");const s=sc(e);return e.schema.isValidChild(t.nodeName.toLowerCase(),s.toLowerCase())?(o=r,o=e.dom.createHTML(s,ac(e),o)):o||(o=r),zb(e,o,n.no_selection),{content:o,html:o}}{"raw"!==n.format&&(o=Jp({validate:!1},e.schema).serialize(e.parser.parse(o,{isRootContent:!0,insert:!0})));const r=ai(wo.fromDom(t))?o:Lt.trim(o);return zb(e,r,n.no_selection),{content:r,html:r}}})(e,n,t,o))).getOr({content:t,html:Fb(o.content)?"":o.content}),Zb=e=>S(e)?e:I,Ub=(e,t,o)=>{const n=t(e),r=Zb(o);return n.orThunk((()=>r(e)?F.none():((e,t,o)=>{let n=e.dom;const r=Zb(o);for(;n.parentNode;){n=n.parentNode;const e=wo.fromDom(n),o=t(e);if(o.isSome())return o;if(r(e))break}return F.none()})(e,t,r)))},jb=Ku,Wb=(e,t,o)=>{const n=e.formatter.get(o);if(n)for(let o=0;o{const s=e.dom.getRoot();if(t===s)return!1;const a=e.dom.getParent(t,(t=>!!Wb(e,t,o)||t.parentNode===s||!!Kb(e,t,o,n,!0)));return!!Kb(e,a,o,n,r)},qb=(e,t,o)=>!(!rg(o)||!jb(t,o.inline))||!(!og(o)||!jb(t,o.block))||!!ng(o)&&tr(t)&&e.is(t,o.selector),Gb=(e,t,o,n,r,s)=>{const a=o[n],i="attributes"===n;if(S(o.onmatch))return o.onmatch(t,o,n);if(a)if(Ae(a)){for(let o=0;o{const s=e.formatter.get(o),a=e.dom;if(s&&tr(t))for(let o=0;o{if(n)return $b(e,n,t,o,r);if(n=e.selection.getNode(),$b(e,n,t,o,r))return!0;const s=e.selection.getStart();return!(s===n||!$b(e,s,t,o,r))},Xb=(e,t)=>{const o=t=>ko(t,wo.fromDom(e.getBody()));return F.from(e.selection.getStart(!0)).bind((n=>Ub(wo.fromDom(n),(o=>ge(t,(t=>((t,o)=>Kb(e,t.dom,o)?F.some(o):F.none())(o,t)))),o))).getOrNull()},Jb=(e,t,o)=>J(o,((o,n)=>{const r=((e,t)=>eg(e,t,(e=>{const t=e=>S(e)||e.length>1&&"%"===e.charAt(0);return W(["styles","attributes"],(o=>_e(e,o).exists((e=>{const o=v(e)?e:ke(e);return W(o,t)}))))})))(e,n);return e.formatter.matchNode(t,n,{},r)?o.concat([n]):o}),[]),Qb=di,ey=e=>{if(e){const t=new Wn(e,e);for(let e=t.current();e;e=t.next())if(dr(e))return e}return null},ty=e=>{const t=wo.fromTag("span");return oo(t,{id:iu,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&yn(t,wo.fromText(Qb)),t},oy=(e,t,o)=>{const n=e.dom,r=e.selection;if(ag(t))hv(e,!1,wo.fromDom(t),o,!0);else{const e=r.getRng(),o=n.getParent(t,n.isBlock),s=e.startContainer,a=e.startOffset,i=e.endContainer,l=e.endOffset,c=(e=>{const t=ey(e);return t&&t.data.charAt(0)===Qb&&t.deleteData(0,1),t})(t);n.remove(t,!0),s===c&&a>0&&e.setStart(c,a-1),i===c&&l>0&&e.setEnd(c,l-1),o&&n.isEmpty(o)&&ci(wo.fromDom(o)),r.setRng(e)}},ny=(e,t,o)=>{const n=e.dom,r=e.selection;if(t)oy(e,t,o);else if(!(t=cu(e.getBody(),r.getStart())))for(;t=n.get(iu);)oy(e,t,o)},ry=(e,t)=>(e.appendChild(t),t),sy=(e,t)=>{var o;const n=X(e,((e,t)=>ry(e,t.cloneNode(!1))),t),r=null!==(o=n.ownerDocument)&&void 0!==o?o:document;return ry(n,r.createTextNode(Qb))},ay=(e,t,o,n)=>{const r=e.dom,s=e.selection;let a=!1;const i=e.formatter.get(t);if(!i)return;const l=s.getRng(),c=l.startContainer,d=l.startOffset;let m=c;dr(c)&&(d!==c.data.length&&(a=!0),m=m.parentNode);const u=[];let g;for(;m;){if(Kb(e,m,t,o,n)){g=m;break}m.nextSibling&&(a=!0),u.push(m),m=m.parentNode}if(g)if(a){const a=s.getBookmark();l.collapse(!0);let c=Cg(r,l,i,!0);c=Ch(c),e.formatter.remove(t,o,c,n),s.moveToBookmark(a)}else{const a=cu(e.getBody(),g),i=C(a)?r.getParents(g.parentNode,P,a):[],l=ty(!1).dom;((e,t,o)=>{var n,r;const s=e.dom,a=s.getParent(o,N(ju,e.schema));a&&s.isEmpty(a)?null===(n=o.parentNode)||void 0===n||n.replaceChild(t,o):(ii(wo.fromDom(o)),s.isEmpty(o)?null===(r=o.parentNode)||void 0===r||r.replaceChild(t,o):s.insertAfter(t,o))})(e,l,null!=a?a:g);const c=((e,t,o,n,r,s)=>{const a=e.formatter,i=e.dom,l=Y(pe(a.get()),(e=>e!==n&&!je(e,"removeformat"))),c=Jb(e,o,l);if(Y(c,(t=>!tg(e,t,n))).length>0){const e=o.cloneNode(!1);return i.add(t,e),a.remove(n,r,e,s),i.remove(e),F.some(e)}return F.none()})(e,l,g,t,o,n),d=sy([...u,...c.toArray(),...i],l);a&&oy(e,a,C(a)),s.setCursorLocation(d,1),r.isEmpty(g)&&r.remove(g)}},iy=e=>{e.on("mouseup keydown",(t=>{var o;((e,t,o)=>{const n=e.selection,r=e.getBody();ny(e,null,o),8!==t&&46!==t||!n.isCollapsed()||n.getStart().innerHTML!==Qb||ny(e,cu(r,n.getStart()),!0),37!==t&&39!==t||ny(e,cu(r,n.getStart()),!0)})(e,t.keyCode,(o=e.selection.getRng().endContainer,dr(o)&&$e(o.data,qn)))}))},ly=e=>{const t=ty(!1),o=sy(e,t.dom);return{caretContainer:t,caretPosition:ml(o,0)}},cy=(e,t)=>{const{caretContainer:o,caretPosition:n}=ly(t);return fn(wo.fromDom(e),o),Sn(wo.fromDom(e)),n},dy=(e,t)=>{if(lu(t.dom))return!1;const o=e.schema.getTextInlineElements();return Ee(o,Wt(t))&&!lu(t.dom)&&!ar(t.dom)},my={},uy=rr(["pre"]);((e,t)=>{my[e]||(my[e]=[]),my[e].push(t)})("pre",(e=>{const t=e.selection.getRng();if(!t.collapsed){const t=e.selection.getSelectedBlocks(),o=Y(Y(t,uy),(e=>t=>{const o=t.previousSibling;return uy(o)&&j(e,o)})(t));q(o,(e=>{((e,t)=>{const o=wo.fromDom(t),n=To(o).dom;Sn(o),xn(wo.fromDom(e),[wo.fromTag("br",n),wo.fromTag("br",n),...Ho(o)])})(e.previousSibling,e)}))}}));const gy=["fontWeight","fontStyle","color","fontSize","fontFamily"],hy=e=>ee(e,(e=>rg(e)&&"span"===e.inline&&(e=>p(e.styles)&&W(pe(e.styles),(e=>j(gy,e))))(e))),py=(e,t)=>{const o=e.get(t);return v(o)?hy(o):F.none()},fy=(e,t)=>ru(t,ml.fromRangeStart(e)).isNone(),vy=(e,t)=>!1===nu(t,ml.fromRangeEnd(e)).exists((e=>!fr(e.getNode())||nu(t,e).isSome())),by=e=>t=>Sr(t)&&e.isEditable(t),yy=e=>Y((e=>{const t=e.getSelectedBlocks(),o=e.getRng();if(e.isCollapsed())return[];if(1===t.length)return fy(o,t[0])&&vy(o,t[0])?t:[];{const e=de(t).filter((e=>fy(o,e))).toArray(),n=me(t).filter((e=>vy(o,e))).toArray(),r=t.slice(1,-1);return e.concat(r).concat(n)}})(e),by(e.dom)),wy=e=>Y(e.getSelectedBlocks(),by(e.dom)),xy=Lt.each,Cy=e=>tr(e)&&!Cu(e)&&!lu(e)&&!ar(e),Sy=(e,t)=>{for(let o=e;o;o=o[t]){if(dr(o)&&Xe(o.data))return e;if(tr(o)&&!Cu(o))return o}return e},ky=(e,t,o)=>{const n=mb(e),r=or(t)&&e.dom.isEditable(t),s=or(o)&&e.dom.isEditable(o);if(r&&s){const r=Sy(t,"previousSibling"),s=Sy(o,"nextSibling");if(n.compare(r,s)){for(let e=r.nextSibling;e&&e!==s;){const t=e;e=e.nextSibling,r.appendChild(t)}return e.dom.remove(s),Lt.each(Lt.grep(s.childNodes),(e=>{r.appendChild(e)})),r}}return o},_y=(e,t,o,n)=>{var r;if(n&&!1!==t.merge_siblings){const t=null!==(r=ky(e,Uu(n),n))&&void 0!==r?r:n;ky(e,t,Uu(t,!0))}},Ey=(e,t,o)=>{xy(e.childNodes,(e=>{Cy(e)&&(t(e)&&o(e),e.hasChildNodes()&&Ey(e,t,o))}))},Ty=(e,t)=>o=>!(!o||!Xu(e,o,t)),Oy=(e,t,o)=>n=>{e.setStyle(n,t,o),""===n.getAttribute("style")&&n.removeAttribute("style"),((e,t)=>{"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)})(e,n)},Ay=Il([{keep:[]},{rename:["name"]},{removed:[]}]),Dy=/^(src|href|style)$/,My=Lt.each,Ny=Ku,Ry=(e,t,o)=>e.isChildOf(t,o)&&t!==o&&!e.isBlock(o),By=(e,t,o)=>{let n=t[o?"startContainer":"endContainer"],r=t[o?"startOffset":"endOffset"];if(tr(n)){const e=n.childNodes.length-1;!o&&r&&r--,n=n.childNodes[r>e?e:r]}return dr(n)&&o&&r>=n.data.length&&(n=new Wn(n,e.getBody()).next()||n),dr(n)&&!o&&0===r&&(n=new Wn(n,e.getBody()).prev()||n),n},Ly=(e,t)=>{const o=t?"firstChild":"lastChild",n=e[o];return(e=>/^(TR|TH|TD)$/.test(e.nodeName))(e)&&n?"TR"===e.nodeName&&n[o]||n:e},Hy=(e,t,o,n)=>{var r;const s=e.create(o,n);return null===(r=t.parentNode)||void 0===r||r.insertBefore(s,t),s.appendChild(t),s},Iy=(e,t,o,n,r)=>{const s=wo.fromDom(t),a=wo.fromDom(e.create(n,r)),i=o?Lo(s):Bo(s);return xn(a,i),o?(fn(s,a),bn(a,s)):(vn(s,a),yn(a,s)),a.dom},Py=(e,t,o)=>{const n=t.parentNode;let r;const s=e.dom,a=sc(e);og(o)&&n===s.getRoot()&&(o.list_block&&Ny(t,o.list_block)||q(ue(t.childNodes),(t=>{Wu(e,a,t.nodeName.toLowerCase())?r?r.appendChild(t):(r=Hy(s,t,a),s.setAttribs(r,ac(e))):r=null}))),(e=>ng(e)&&rg(e)&&Ht(_e(e,"mixed"),!0))(o)&&!Ny(o.inline,t)||s.remove(t,!0)},Fy=(e,t,o)=>k(e)?{name:t,value:null}:{name:e,value:Gu(t,o)},zy=(e,t)=>{""===e.getAttrib(t,"style")&&(t.removeAttribute("style"),t.removeAttribute("data-mce-style"))},Vy=(e,t,o,n,r)=>{let s=!1;My(o.styles,((a,i)=>{const{name:l,value:c}=Fy(i,a,n),d=Yu(c,l);(o.remove_similar||b(c)||!tr(r)||Ny(Xu(e,r,l),d))&&e.setStyle(t,l,""),s=!0})),s&&zy(e,t)},Zy=(e,t,o,n,r)=>{const s=e.dom,a=mb(e),i=e.schema;if(rg(t)&&Jr(i,t.inline)&&es(i,n)&&n.parentElement===e.getBody())return Py(e,n,t),Ay.removed();if(!t.ceFalseOverride&&n&&"false"===s.getContentEditableParent(n))return Ay.keep();if(n&&!qb(s,n,t)&&!((e,t)=>t.links&&"A"===e.nodeName)(n,t))return Ay.keep();const l=n,c=t.preserve_attributes;if(rg(t)&&"all"===t.remove&&v(c)){const e=Y(s.getAttribs(l),(e=>j(c,e.name.toLowerCase())));if(s.removeAllAttribs(l),q(e,(e=>s.setAttrib(l,e.name,e.value))),e.length>0)return Ay.rename("span")}if("all"!==t.remove){Vy(s,l,t,o,r),My(t.attributes,((e,n)=>{const{name:a,value:i}=Fy(n,e,o);if(t.remove_similar||b(i)||!tr(r)||Ny(s.getAttrib(r,a),i)){if("class"===a){const e=s.getAttrib(l,a);if(e){let t="";if(q(e.split(/\s+/),(e=>{/mce\-\w+/.test(e)&&(t+=(t?" ":"")+e)})),t)return void s.setAttrib(l,a,t)}}if(Dy.test(a)&&l.removeAttribute("data-mce-"+a),"style"===a&&rr(["li"])(l)&&"none"===s.getStyle(l,"list-style-type"))return l.removeAttribute(a),void s.setStyle(l,"list-style-type","none");"class"===a&&l.removeAttribute("className"),l.removeAttribute(a)}})),My(t.classes,(e=>{e=Gu(e,o),tr(r)&&!s.hasClass(r,e)||s.removeClass(l,e)}));const e=s.getAttribs(l);for(let t=0;tZy(e,t,o,n,n).fold(A(n),(t=>(e.dom.createFragment().appendChild(n),e.dom.rename(n,t))),A(null)),jy=(e,t,o,n,r)=>{const s=e.formatter.get(t),a=s[0],i=e.dom,l=e.selection,c=n=>{const i=((e,t,o,n,r)=>{let s;return t.parentNode&&q(Qu(e.dom,t.parentNode).reverse(),(t=>{if(!s&&tr(t)&&"_start"!==t.id&&"_end"!==t.id){const a=Kb(e,t,o,n,r);a&&!1!==a.split&&(s=t)}})),s})(e,n,t,o,r);return((e,t,o,n,r,s,a,i)=>{var l,c;let d,m;const u=e.dom;if(o){const s=o.parentNode;for(let o=n.parentNode;o&&o!==s;o=o.parentNode){let n=u.clone(o,!1);for(let o=0;oW(s,(n=>$y(e,n,o,t,t))),m=t=>{const o=ue(t.childNodes),n=d(t)||W(s,(e=>qb(i,t,e))),r=t.parentNode;if(!n&&C(r)&&sg(a)&&d(r),a.deep&&o.length)for(let e=0;e{tr(t)&&e.dom.getStyle(t,"text-decoration")===o&&t.parentNode&&Ju(i,t.parentNode)===o&&$y(e,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:o}},void 0,t)}))},u=e=>{const t=i.get(e?"_start":"_end");if(t){let o=t[e?"firstChild":"lastChild"];return(e=>Cu(e)&&tr(e)&&("_start"===e.id||"_end"===e.id))(o)&&(o=o[e?"firstChild":"lastChild"]),dr(o)&&0===o.data.length&&(o=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),i.remove(t,!0),o}return null},g=t=>{let o,n,r=Cg(i,t,s,t.collapsed);if(a.split){if(r=Ch(r),o=By(e,r,!0),n=By(e,r),o!==n){if(o=Ly(o,!0),n=Ly(n,!1),Ry(i,o,n)){const e=F.from(o.firstChild).getOr(o);return c(Iy(i,e,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void u(!0)}if(Ry(i,n,o)){const e=F.from(n.lastChild).getOr(n);return c(Iy(i,e,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void u(!1)}o=Hy(i,o,"span",{id:"_start","data-mce-type":"bookmark"}),n=Hy(i,n,"span",{id:"_end","data-mce-type":"bookmark"});const e=i.createRng();e.setStartAfter(o),e.setEndBefore(n),Sg(i,e,(e=>{q(e,(e=>{Cu(e)||Cu(e.parentNode)||c(e)}))})),c(o),c(n),o=u(!0),n=u()}else o=n=c(o);r.startContainer=o.parentNode?o.parentNode:o,r.startOffset=i.nodeIndex(o),r.endContainer=n.parentNode?n.parentNode:n,r.endOffset=i.nodeIndex(n)+1}Sg(i,r,(e=>{q(e,m)}))};if(n){if(Fu(n)){const e=i.createRng();e.setStartBefore(n),e.setEndAfter(n),g(e)}else g(n);Hg(e,t,n,o)}else l.isCollapsed()&&rg(a)&&!Du(e).length?ay(e,t,o,r):(Vu(e,(()=>Iu(e,g)),(n=>rg(a)&&Yb(e,t,o,n))),e.nodeChanged()),((e,t,o)=>{"removeformat"===t?q(wy(e.selection),(t=>{q(gy,(o=>e.dom.setStyle(t,o,""))),zy(e.dom,t)})):py(e.formatter,t).each((t=>{q(wy(e.selection),(n=>Vy(e.dom,n,t,o,null)))}))})(e,t,o),Hg(e,t,n,o)},Wy=(e,t,o,n,r)=>{(n||e.selection.isEditable())&&jy(e,t,o,n,r)},$y=(e,t,o,n,r)=>Zy(e,t,o,n,r).fold(I,(t=>(e.dom.rename(n,t),!0)),P),qy=Lt.each,Gy=(e,t,o,n)=>{qy(t,(t=>{rg(t)&&qy(e.dom.select(t.inline,n),(n=>{Cy(n)&&$y(e,t,o,n,t.exact?n:null)})),((e,t,o)=>{if(t.clear_child_styles){const n=t.links?"*:not(a)":"*";xy(e.select(n,o),(o=>{Cy(o)&&e.isEditable(o)&&xy(t.styles,((t,n)=>{e.setStyle(o,n,"")}))}))}})(e.dom,t,n)}))},Ky=Lt.each,Yy=(e,t,o,n)=>{if(Ky(o.styles,((o,r)=>{e.setStyle(t,r,Gu(o,n))})),o.styles){const o=e.getAttrib(t,"style");o&&e.setAttrib(t,"data-mce-style",o)}},Xy=(e,t,o,n)=>{const r=e.formatter.get(t),s=r[0],a=!n&&e.selection.isCollapsed(),i=e.dom,l=e.selection,c=(e,t=s)=>{S(t.onformat)&&t.onformat(e,t,o,n),Yy(i,e,t,o),Ky(t.attributes,((t,n)=>{i.setAttrib(e,n,Gu(t,o))})),Ky(t.classes,(t=>{const n=Gu(t,o);i.hasClass(e,n)||i.addClass(e,n)}))},d=(e,t)=>{let o=!1;return Ky(e,(e=>!(!ng(e)||("false"!==i.getContentEditable(t)||e.ceFalseOverride)&&(!C(e.collapsed)||e.collapsed===a)&&i.is(t,e.selector)&&!lu(t)&&(c(t,e),o=!0,1)))),o},m=e=>{if(h(e)){const t=i.create(e);return c(t),t}return null},u=(n,a,i)=>{const l=[];let u=!0;const g=s.inline||s.block,h=m(g),p=n=>(e=>og(e)&&!0===e.wrapper)(s)&&Kb(e,n,t,o),f=(t,o,n)=>{const r=(e=>og(e)&&!0!==e.wrapper)(s)&&ju(e.schema,t)&&Wu(e,o,g);return n&&r};Sg(n,a,(t=>{let o;const a=t=>{let m=!1,v=u,b=!1;const y=t.parentNode,w=y.nodeName.toLowerCase(),x=n.getContentEditable(t);C(x)&&(v=u,u="true"===x,m=!0,b=qu(e,t));const S=u&&!m;if(fr(t)&&!((e,t,o,n)=>{if(jc(e)&&rg(t)&&o.parentNode){const t=Us(e.schema),r=Un(wo.fromDom(o),(e=>lu(e.dom)));return Te(t,n)&&Nr(e.schema,o.parentNode,{skipBogus:!1,includeZwsp:!0})&&!r}return!1})(e,s,t,w))return o=null,void(og(s)&&n.remove(t));if(p(t))o=null;else{if(f(t,w,S)){const e=n.rename(t,g);return c(e),l.push(e),void(o=null)}if(ng(s)){let e=d(r,t);if(!e&&C(y)&&sg(s)&&(e=d(r,y)),!rg(s)||e)return void(o=null)}C(h)&&((t,o,r,a)=>{const l=t.nodeName.toLowerCase(),c=Wu(e,g,l)&&Wu(e,o,g),d=!i&&dr(t)&&mi(t.data),m=lu(t),u=!rg(s)||!n.isBlock(t);return(r||a)&&c&&!d&&!m&&u})(t,w,S,b)?(o||(o=n.clone(h,!1),y.insertBefore(o,t),l.push(o)),b&&m&&(u=v),o.appendChild(t)):(o=null,q(ue(t.childNodes),a),m&&(u=v),o=null)}};q(t,a)})),!0===s.links&&q(l,(e=>{const t=e=>{"A"===e.nodeName&&c(e,s),q(ue(e.childNodes),t)};t(e)})),q(l,(a=>{const i=(e=>{let t=0;return q(e.childNodes,(e=>{(e=>C(e)&&dr(e)&&0===e.length)(e)||Cu(e)||t++})),t})(a);!(l.length>1)&&n.isBlock(a)||0!==i?(rg(s)||og(s)&&s.wrapper)&&(s.exact||1!==i||(a=(e=>{const t=ee(e.childNodes,zu).filter((e=>"false"!==n.getContentEditable(e)&&qb(n,e,s)));return t.map((t=>{const o=n.clone(t,!1);return c(o),n.replace(o,e,!0),n.remove(t,!0),o})).getOr(e)})(a)),Gy(e,r,o,a),((e,t,o,n,r)=>{const s=r.parentNode;Kb(e,s,o,n)&&$y(e,t,n,r)||t.merge_with_parents&&s&&e.dom.getParent(s,(s=>!!Kb(e,s,o,n)&&($y(e,t,n,r),!0)))})(e,s,t,o,a),((e,t,o,n)=>{if(t.styles&&t.styles.backgroundColor){const r=Ty(e,"fontSize");Ey(n,(t=>r(t)&&e.isEditable(t)),Oy(e,"backgroundColor",Gu(t.styles.backgroundColor,o)))}})(n,s,o,a),((e,t,o,n)=>{const r=t=>{if(or(t)&&tr(t.parentNode)&&e.isEditable(t)){const o=Ju(e,t.parentNode);e.getStyle(t,"color")&&o?e.setStyle(t,"text-decoration",o):e.getStyle(t,"text-decoration")===o&&e.setStyle(t,"text-decoration",null)}};t.styles&&(t.styles.color||t.styles.textDecoration)&&(Lt.walk(n,r,"childNodes"),r(n))})(n,s,0,a),((e,t,o,n)=>{if(rg(t)&&("sub"===t.inline||"sup"===t.inline)){const o=Ty(e,"fontSize");Ey(n,(t=>o(t)&&e.isEditable(t)),Oy(e,"fontSize",""));const r=Y(e.select("sup"===t.inline?"sub":"sup",n),e.isEditable);e.remove(r,!0)}})(n,s,0,a),_y(e,s,0,a)):n.remove(a,!0)}))},g=Fu(n)?n:l.getNode();if("false"===i.getContentEditable(g)&&!qu(e,g))return d(r,n=g),void Lg(e,t,n,o);if(s){if(n)if(Fu(n)){if(!d(r,n)){const e=i.createRng();e.setStartBefore(n),e.setEndAfter(n),u(i,Cg(i,e,r),!0)}}else u(i,n,!0);else a&&rg(s)&&!Du(e).length?((e,t,o)=>{let n;const r=e.selection,s=e.formatter.get(t);if(!s)return;const a=r.getRng();let i=a.startOffset;const l=a.startContainer.nodeValue;n=cu(e.getBody(),r.getStart());const c=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(l&&i>0&&i{Iu(e,((e,t)=>{const o=t?e:Cg(i,e,r);u(i,o,!1)}))}),P),e.nodeChanged()),py(e.formatter,t).each((t=>{q(yy(e.selection),(e=>Yy(i,e,t,o)))}));((e,t)=>{Ee(my,e)&&q(my[e],(e=>{e(t)}))})(t,e)}Lg(e,t,n,o)},Jy=(e,t,o,n)=>{(n||e.selection.isEditable())&&Xy(e,t,o,n)},Qy=e=>Ee(e,"vars"),ew=e=>e.selection.getStart(),tw=(e,t,o,n,r)=>Q(t,(t=>{const s=e.formatter.matchNode(t,o,null!=r?r:{},n);return!w(s)}),(t=>!!Wb(e,t,o)||!n&&C(e.formatter.matchNode(t,o,r,!0)))),ow=(e,t)=>{const o=null!=t?t:ew(e);return Y(Qu(e.dom,o),(e=>tr(e)&&!ar(e)))},nw=(e,t,o)=>{const n=ow(e,t);ve(o,((o,r)=>{const s=o=>{const s=tw(e,n,r,o.similar,Qy(o)?o.vars:void 0),a=s.isSome();if(o.state.get()!==a){o.state.set(a);const e=s.getOr(t);Qy(o)?o.callback(a,{node:e,format:r,parents:n}):q(o.callbacks,(t=>t(a,{node:e,format:r,parents:n})))}};q([o.withSimilar,o.withoutSimilar],s),q(o.withVars,s)}))},rw=(e,t,o,n,r,s)=>(((e,t,o,n,r,s)=>{const a=t.get();q(o.split(","),(t=>{const o=_e(a,t).getOrThunk((()=>{const e={withSimilar:{state:Lr(!1),similar:!0,callbacks:[]},withoutSimilar:{state:Lr(!1),similar:!1,callbacks:[]},withVars:[]};return a[t]=e,e})),i=()=>{const o=ow(e);return tw(e,o,t,r,s).isSome()};if(w(s)){const e=r?o.withSimilar:o.withoutSimilar;e.callbacks.push(n),1===e.callbacks.length&&e.state.set(i())}else o.withVars.push({state:Lr(i()),similar:r,vars:s,callback:n})})),t.set(a)})(e,t,o,n,r,s),{unbind:()=>((e,t,o)=>{const n=e.get();q(t.split(","),(e=>_e(n,e).each((t=>{n[e]={withSimilar:{...t.withSimilar,callbacks:Y(t.withSimilar.callbacks,(e=>e!==o))},withoutSimilar:{...t.withoutSimilar,callbacks:Y(t.withoutSimilar.callbacks,(e=>e!==o))},withVars:Y(t.withVars,(e=>e.callback!==o))}})))),e.set(n)})(t,o,n)}),sw=Lt.explode,aw=()=>{const e={};return{addFilter:(t,o)=>{q(sw(t),(t=>{Ee(e,t)||(e[t]={name:t,callbacks:[]}),e[t].callbacks.push(o)}))},getFilters:()=>ke(e),removeFilter:(t,o)=>{q(sw(t),(t=>{if(Ee(e,t))if(C(o)){const n=e[t],r=Y(n.callbacks,(e=>e!==o));r.length>0?n.callbacks=r:delete e[t]}else delete e[t]}))}}},iw=(e,t,o)=>{e.addNodeFilter("font",(e=>{q(e,(e=>{const n=t.parse(e.attr("style")),r=e.attr("color"),s=e.attr("face"),a=e.attr("size");r&&(n.color=r),s&&(n["font-family"]=s),a&&Qe(a).each((e=>{n["font-size"]=o[e-1]})),e.name="span",e.attr("style",t.serialize(n)),((e,t)=>{q(t,(t=>{e.attr(t,null)}))})(e,["color","face","size"])}))}))},lw=(e,t,o)=>{var n;const r=ta();t.convert_fonts_to_spans&&iw(e,r,Lt.explode(null!==(n=t.font_size_legacy_values)&&void 0!==n?n:"")),((e,t,o)=>{e.addNodeFilter("strike",(e=>{const n="html4"!==t.type;q(e,(e=>{if(n)e.name="s";else{const t=o.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",o.serialize(t))}}))}))})(e,o,r)},cw=e=>{const[t,...o]=e.split(","),n=o.join(","),r=/data:([^/]+\/[^;]+)(;.+)?/.exec(t);if(r){const e=";base64"===r[2],t=e?(e=>{const t=/([a-z0-9+\/=\s]+)/i.exec(e);return t?t[1]:""})(n):decodeURIComponent(n);return F.some({type:r[1],data:t,base64Encoded:e})}return F.none()},dw=(e,t,o=!0)=>{let n=t;if(o)try{n=atob(t)}catch(e){return F.none()}const r=new Uint8Array(n.length);for(let e=0;e{return We(e,"blob:")?(e=>fetch(e).then((e=>e.ok?e.blob():Promise.reject())).catch((()=>Promise.reject({message:`Cannot convert ${e} to Blob. Resource might not exist or is inaccessible.`,uriType:"blob"}))))(e):We(e,"data:")?(t=e,new Promise(((e,o)=>{cw(t).bind((({type:e,data:t,base64Encoded:o})=>dw(e,t,o))).fold((()=>o("Invalid data URI")),e)}))):Promise.reject("Unknown URI format");var t},uw=e=>new Promise(((t,o)=>{const n=new FileReader;n.onloadend=()=>{t(n.result)},n.onerror=()=>{var e;o(null===(e=n.error)||void 0===e?void 0:e.message)},n.readAsDataURL(e)}));let gw=0;const hw=(e,t,o)=>cw(e).bind((({data:e,type:n,base64Encoded:r})=>{if(t&&!r)return F.none();{const t=r?e:btoa(e);return o(t,n)}})),pw=(e,t,o)=>{const n=e.create("blobid"+gw++,t,o);return e.add(n),n},fw=(e,t,o=!1)=>hw(t,o,((t,o)=>F.from(e.getByData(t,o)).orThunk((()=>dw(o,t).map((o=>pw(e,o,t))))))),vw=/^(?:(?:(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)([A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*))(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+)?)?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+)?)?)$/,bw=e=>F.from(e.match(vw)).bind((e=>ce(e,1))).map((e=>We(e,"www.")?e.substring(4):e)),yw=(e,t)=>{F.from(e.attr("src")).bind(bw).forall((e=>!j(t,e)))&&e.attr("sandbox","")},ww=(e,t)=>We(e,`${t}/`),xw=({type:e,src:t,width:o,height:n}={},r,s)=>{const a=(e=>w(e)?"iframe":ww(e,"image")?"img":ww(e,"video")?"video":ww(e,"audio")?"audio":"iframe")(e),i=new Np(a,1);return i.attr("audio"===a?{src:t}:{src:t,width:o,height:n}),"audio"!==a&&"video"!==a||i.attr("controls",""),"iframe"===a&&r&&yw(i,s),i},Cw=(e,t)=>{const{blob_cache:o}=t;if(o){const t=e=>{const t=e.attr("src");(e=>e.attr("src")===Mt.transparentSrc||C(e.attr("data-mce-placeholder")))(e)||(e=>C(e.attr("data-mce-bogus")))(e)||x(t)||fw(o,t,!0).each((t=>{e.attr("src",t.blobUri())}))};e.addAttributeFilter("src",(e=>q(e,t)))}},{entries:Sw,setPrototypeOf:kw,isFrozen:_w,getPrototypeOf:Ew,getOwnPropertyDescriptor:Tw}=Object;let{freeze:Ow,seal:Aw,create:Dw}=Object,{apply:Mw,construct:Nw}="undefined"!=typeof Reflect&&Reflect;Mw||(Mw=function(e,t,o){return e.apply(t,o)}),Ow||(Ow=function(e){return e}),Aw||(Aw=function(e){return e}),Nw||(Nw=function(e,t){return new e(...t)});const Rw=Ww(Array.prototype.forEach),Bw=Ww(Array.prototype.pop),Lw=Ww(Array.prototype.push),Hw=Ww(String.prototype.toLowerCase),Iw=Ww(String.prototype.toString),Pw=Ww(String.prototype.match),Fw=Ww(String.prototype.replace),zw=Ww(String.prototype.indexOf),Vw=Ww(String.prototype.trim),Zw=Ww(RegExp.prototype.test),Uw=(jw=TypeError,function(){for(var e=arguments.length,t=new Array(e),o=0;o1?o-1:0),r=1;r/gm),lx=Aw(/\${[\w\W]*}/gm),cx=Aw(/^data-[\-\w.\u00B7-\uFFFF]/),dx=Aw(/^aria-[\-\w]+$/),mx=Aw(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ux=Aw(/^(?:\w+script|data):/i),gx=Aw(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),hx=Aw(/^html$/i);var px=Object.freeze({__proto__:null,MUSTACHE_EXPR:ax,ERB_EXPR:ix,TMPLIT_EXPR:lx,DATA_ATTR:cx,ARIA_ATTR:dx,IS_ALLOWED_URI:mx,IS_SCRIPT_OR_DATA:ux,ATTR_WHITESPACE:gx,DOCTYPE_NAME:hx});const fx=()=>"undefined"==typeof window?null:window;var vx=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fx();const o=t=>e(t);if(o.version="3.0.5",o.removed=[],!t||!t.document||9!==t.document.nodeType)return o.isSupported=!1,o;const n=t.document,r=n.currentScript;let{document:s}=t;const{DocumentFragment:a,HTMLTemplateElement:i,Node:l,Element:c,NodeFilter:d,NamedNodeMap:m=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:u,DOMParser:g,trustedTypes:h}=t,p=c.prototype,f=Gw(p,"cloneNode"),v=Gw(p,"nextSibling"),b=Gw(p,"childNodes"),y=Gw(p,"parentNode");if("function"==typeof i){const e=s.createElement("template");e.content&&e.content.ownerDocument&&(s=e.content.ownerDocument)}let w,x="";const{implementation:C,createNodeIterator:S,createDocumentFragment:k,getElementsByTagName:_}=s,{importNode:E}=n;let T={};o.isSupported="function"==typeof Sw&&"function"==typeof y&&C&&void 0!==C.createHTMLDocument;const{MUSTACHE_EXPR:O,ERB_EXPR:A,TMPLIT_EXPR:D,DATA_ATTR:M,ARIA_ATTR:N,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:B}=px;let{IS_ALLOWED_URI:L}=px,H=null;const I=$w({},[...Kw,...Yw,...Xw,...Qw,...tx]);let P=null;const F=$w({},[...ox,...nx,...rx,...sx]);let z=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),V=null,Z=null,U=!0,j=!0,W=!1,$=!0,q=!1,G=!1,K=!1,Y=!1,X=!1,J=!1,Q=!1,ee=!0,te=!1,oe=!0,ne=!1,re={},se=null;const ae=$w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ie=null;const le=$w({},["audio","video","img","source","image","track"]);let ce=null;const de=$w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),me="http://www.w3.org/1998/Math/MathML",ue="http://www.w3.org/2000/svg",ge="http://www.w3.org/1999/xhtml";let he=ge,pe=!1,fe=null;const ve=$w({},[me,ue,ge],Iw);let be;const ye=["application/xhtml+xml","text/html"];let we,xe=null;const Ce=s.createElement("form"),Se=function(e){return e instanceof RegExp||e instanceof Function},ke=function(e){if(!xe||xe!==e){if(e&&"object"==typeof e||(e={}),e=qw(e),be=be=-1===ye.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,we="application/xhtml+xml"===be?Iw:Hw,H="ALLOWED_TAGS"in e?$w({},e.ALLOWED_TAGS,we):I,P="ALLOWED_ATTR"in e?$w({},e.ALLOWED_ATTR,we):F,fe="ALLOWED_NAMESPACES"in e?$w({},e.ALLOWED_NAMESPACES,Iw):ve,ce="ADD_URI_SAFE_ATTR"in e?$w(qw(de),e.ADD_URI_SAFE_ATTR,we):de,ie="ADD_DATA_URI_TAGS"in e?$w(qw(le),e.ADD_DATA_URI_TAGS,we):le,se="FORBID_CONTENTS"in e?$w({},e.FORBID_CONTENTS,we):ae,V="FORBID_TAGS"in e?$w({},e.FORBID_TAGS,we):{},Z="FORBID_ATTR"in e?$w({},e.FORBID_ATTR,we):{},re="USE_PROFILES"in e&&e.USE_PROFILES,U=!1!==e.ALLOW_ARIA_ATTR,j=!1!==e.ALLOW_DATA_ATTR,W=e.ALLOW_UNKNOWN_PROTOCOLS||!1,$=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,q=e.SAFE_FOR_TEMPLATES||!1,G=e.WHOLE_DOCUMENT||!1,X=e.RETURN_DOM||!1,J=e.RETURN_DOM_FRAGMENT||!1,Q=e.RETURN_TRUSTED_TYPE||!1,Y=e.FORCE_BODY||!1,ee=!1!==e.SANITIZE_DOM,te=e.SANITIZE_NAMED_PROPS||!1,oe=!1!==e.KEEP_CONTENT,ne=e.IN_PLACE||!1,L=e.ALLOWED_URI_REGEXP||mx,he=e.NAMESPACE||ge,z=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(z.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(z.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(z.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(j=!1),J&&(X=!0),re&&(H=$w({},[...tx]),P=[],!0===re.html&&($w(H,Kw),$w(P,ox)),!0===re.svg&&($w(H,Yw),$w(P,nx),$w(P,sx)),!0===re.svgFilters&&($w(H,Xw),$w(P,nx),$w(P,sx)),!0===re.mathMl&&($w(H,Qw),$w(P,rx),$w(P,sx))),e.ADD_TAGS&&(H===I&&(H=qw(H)),$w(H,e.ADD_TAGS,we)),e.ADD_ATTR&&(P===F&&(P=qw(P)),$w(P,e.ADD_ATTR,we)),e.ADD_URI_SAFE_ATTR&&$w(ce,e.ADD_URI_SAFE_ATTR,we),e.FORBID_CONTENTS&&(se===ae&&(se=qw(se)),$w(se,e.FORBID_CONTENTS,we)),oe&&(H["#text"]=!0),G&&$w(H,["html","head","body"]),H.table&&($w(H,["tbody"]),delete V.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Uw('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Uw('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,x=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let o=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(o=t.getAttribute(n));const r="dompurify"+(o?"#"+o:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(h,r)),null!==w&&"string"==typeof x&&(x=w.createHTML(""));Ow&&Ow(e),xe=e}},_e=$w({},["mi","mo","mn","ms","mtext"]),Ee=$w({},["foreignobject","desc","title","annotation-xml"]),Te=$w({},["title","style","font","a","script"]),Oe=$w({},Yw);$w(Oe,Xw),$w(Oe,Jw);const Ae=$w({},Qw);$w(Ae,ex);const De=function(e){Lw(o.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},Me=function(e,t){try{Lw(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Lw(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!P[e])if(X||J)try{De(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Ne=function(e){let t,o;if(Y)e=""+e;else{const t=Pw(e,/^[\r\n\t ]+/);o=t&&t[0]}"application/xhtml+xml"===be&&he===ge&&(e=''+e+"");const n=w?w.createHTML(e):e;if(he===ge)try{t=(new g).parseFromString(n,be)}catch(e){}if(!t||!t.documentElement){t=C.createDocument(he,"template",null);try{t.documentElement.innerHTML=pe?x:n}catch(e){}}const r=t.body||t.documentElement;return e&&o&&r.insertBefore(s.createTextNode(o),r.childNodes[0]||null),he===ge?_.call(t,G?"html":"body")[0]:G?t.documentElement:r},Re=function(e){return S.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT,null,!1)},Be=function(e){return"object"==typeof l?e instanceof l:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Le=function(e,t,n){T[e]&&Rw(T[e],(e=>{e.call(o,t,n,xe)}))},He=function(e){let t;if(Le("beforeSanitizeElements",e,null),(n=e)instanceof u&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof m)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return De(e),!0;var n;const r=we(e.nodeName);if(Le("uponSanitizeElement",e,{tagName:r,allowedTags:H}),e.hasChildNodes()&&!Be(e.firstElementChild)&&(!Be(e.content)||!Be(e.content.firstElementChild))&&Zw(/<[/\w]/g,e.innerHTML)&&Zw(/<[/\w]/g,e.textContent))return De(e),!0;if(!H[r]||V[r]){if(!V[r]&&Pe(r)){if(z.tagNameCheck instanceof RegExp&&Zw(z.tagNameCheck,r))return!1;if(z.tagNameCheck instanceof Function&&z.tagNameCheck(r))return!1}if(oe&&!se[r]){const t=y(e)||e.parentNode,o=b(e)||e.childNodes;if(o&&t)for(let n=o.length-1;n>=0;--n)t.insertBefore(f(o[n],!0),v(e))}return De(e),!0}return e instanceof c&&!function(e){let t=y(e);t&&t.tagName||(t={namespaceURI:he,tagName:"template"});const o=Hw(e.tagName),n=Hw(t.tagName);return!!fe[e.namespaceURI]&&(e.namespaceURI===ue?t.namespaceURI===ge?"svg"===o:t.namespaceURI===me?"svg"===o&&("annotation-xml"===n||_e[n]):Boolean(Oe[o]):e.namespaceURI===me?t.namespaceURI===ge?"math"===o:t.namespaceURI===ue?"math"===o&&Ee[n]:Boolean(Ae[o]):e.namespaceURI===ge?!(t.namespaceURI===ue&&!Ee[n])&&!(t.namespaceURI===me&&!_e[n])&&!Ae[o]&&(Te[o]||!Oe[o]):!("application/xhtml+xml"!==be||!fe[e.namespaceURI]))}(e)?(De(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!Zw(/<\/no(script|embed|frames)/i,e.innerHTML)?(q&&3===e.nodeType&&(t=e.textContent,t=Fw(t,O," "),t=Fw(t,A," "),t=Fw(t,D," "),e.textContent!==t&&(Lw(o.removed,{element:e.cloneNode()}),e.textContent=t)),Le("afterSanitizeElements",e,null),!1):(De(e),!0)},Ie=function(e,t,o){if(ee&&("id"===t||"name"===t)&&(o in s||o in Ce))return!1;if(j&&!Z[t]&&Zw(M,t));else if(U&&Zw(N,t));else if(!P[t]||Z[t]){if(!(Pe(e)&&(z.tagNameCheck instanceof RegExp&&Zw(z.tagNameCheck,e)||z.tagNameCheck instanceof Function&&z.tagNameCheck(e))&&(z.attributeNameCheck instanceof RegExp&&Zw(z.attributeNameCheck,t)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(t))||"is"===t&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&Zw(z.tagNameCheck,o)||z.tagNameCheck instanceof Function&&z.tagNameCheck(o))))return!1}else if(ce[t]);else if(Zw(L,Fw(o,B,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==zw(o,"data:")||!ie[e])if(W&&!Zw(R,Fw(o,B,"")));else if(o)return!1;return!0},Pe=function(e){return e.indexOf("-")>0},Fe=function(e){let t,o,n,r;Le("beforeSanitizeAttributes",e,null);const{attributes:s}=e;if(!s)return;const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:P};for(r=s.length;r--;){t=s[r];const{name:i,namespaceURI:l}=t;o="value"===i?t.value:Vw(t.value);const c=o;if(n=we(i),a.attrName=n,a.attrValue=o,a.keepAttr=!0,a.forceKeepAttr=void 0,Le("uponSanitizeAttribute",e,a),o=a.attrValue,a.forceKeepAttr)continue;if(!a.keepAttr){Me(i,e);continue}if(!$&&Zw(/\/>/i,o)){Me(i,e);continue}q&&(o=Fw(o,O," "),o=Fw(o,A," "),o=Fw(o,D," "));const d=we(e.nodeName);if(Ie(d,n,o)){if(!te||"id"!==n&&"name"!==n||(Me(i,e),o="user-content-"+o),w&&"object"==typeof h&&"function"==typeof h.getAttributeType)if(l);else switch(h.getAttributeType(d,n)){case"TrustedHTML":o=w.createHTML(o);break;case"TrustedScriptURL":o=w.createScriptURL(o)}if(o!==c)try{l?e.setAttributeNS(l,i,o):e.setAttribute(i,o)}catch(t){Me(i,e)}}else Me(i,e)}Le("afterSanitizeAttributes",e,null)},ze=function e(t){let o;const n=Re(t);for(Le("beforeSanitizeShadowDOM",t,null);o=n.nextNode();)Le("uponSanitizeShadowNode",o,null),He(o)||(o.content instanceof a&&e(o.content),Fe(o));Le("afterSanitizeShadowDOM",t,null)};return o.sanitize=function(e){let t,r,s,i,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(pe=!e,pe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Be(e)){if("function"!=typeof e.toString)throw Uw("toString is not a function");if("string"!=typeof(e=e.toString()))throw Uw("dirty is not a string, aborting")}if(!o.isSupported)return e;if(K||ke(c),o.removed=[],"string"==typeof e&&(ne=!1),ne){if(e.nodeName){const t=we(e.nodeName);if(!H[t]||V[t])throw Uw("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)t=Ne("\x3c!----\x3e"),r=t.ownerDocument.importNode(e,!0),1===r.nodeType&&"BODY"===r.nodeName||"HTML"===r.nodeName?t=r:t.appendChild(r);else{if(!X&&!q&&!G&&-1===e.indexOf("<"))return w&&Q?w.createHTML(e):e;if(t=Ne(e),!t)return X?null:Q?x:""}t&&Y&&De(t.firstChild);const d=Re(ne?e:t);for(;s=d.nextNode();)He(s)||(s.content instanceof a&&ze(s.content),Fe(s));if(ne)return e;if(X){if(J)for(i=k.call(t.ownerDocument);t.firstChild;)i.appendChild(t.firstChild);else i=t;return(P.shadowroot||P.shadowrootmode)&&(i=E.call(n,i,!0)),i}let m=G?t.outerHTML:t.innerHTML;return G&&H["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&Zw(hx,t.ownerDocument.doctype.name)&&(m="\n"+m),q&&(m=Fw(m,O," "),m=Fw(m,A," "),m=Fw(m,D," ")),w&&Q?w.createHTML(m):m},o.setConfig=function(e){ke(e),K=!0},o.clearConfig=function(){xe=null,K=!1},o.isValidAttribute=function(e,t,o){xe||ke({});const n=we(e),r=we(t);return Ie(n,r,o)},o.addHook=function(e,t){"function"==typeof t&&(T[e]=T[e]||[],Lw(T[e],t))},o.removeHook=function(e){if(T[e])return Bw(T[e])},o.removeHooks=function(e){T[e]&&(T[e]=[])},o.removeAllHooks=function(){T={}},o}();const bx=Lt.each,yx=Lt.trim,wx=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],xx={ftp:21,http:80,https:443,mailto:25},Cx=["img","video"],Sx=(e,t,o)=>{const n=(e=>{try{return decodeURIComponent(e)}catch(t){return unescape(e)}})(t).replace(/\s/g,"");return!e.allow_script_urls&&(!!/((java|vb)script|mhtml):/i.test(n)||!e.allow_html_data_urls&&(/^data:image\//i.test(n)?((e,t)=>C(e)?!e:!C(t)||!j(Cx,t))(e.allow_svg_data_urls,o)&&/^data:image\/svg\+xml/i.test(n):/^data:/i.test(n)))};class kx{static parseDataUri(e){let t;const o=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(o[0]);return n&&(t=n[1]),{type:t,data:o[1]}}static isDomSafe(e,t,o={}){if(o.allow_script_urls)return!0;{const n=Es.decode(e).replace(/[\s\u0000-\u001F]+/g,"");return!Sx(o,n,t)}}static getDocumentBaseUrl(e){var t;let o;return o=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?null!==(t=e.href)&&void 0!==t?t:"":e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(o)&&(o=o.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(o)||(o+="/")),o}constructor(e,t={}){this.path="",this.directory="",e=yx(e),this.settings=t;const o=t.base_uri,n=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(n.source=e);const r=0===e.indexOf("//");if(0!==e.indexOf("/")||r||(e=(o&&o.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){const t=o?o.path:new kx(document.location.href).directory;if(""===(null==o?void 0:o.protocol))e="//mce_host"+n.toAbsPath(t,e);else{const r=/([^#?]*)([#?]?.*)/.exec(e);r&&(e=(o&&o.protocol||"http")+"://mce_host"+n.toAbsPath(t,r[1])+r[2])}}e=e.replace(/@@/g,"(mce_at)");const s=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);s&&bx(wx,((e,t)=>{let o=s[t];o&&(o=o.replace(/\(mce_at\)/g,"@@")),n[e]=o})),o&&(n.protocol||(n.protocol=o.protocol),n.userInfo||(n.userInfo=o.userInfo),n.port||"mce_host"!==n.host||(n.port=o.port),n.host&&"mce_host"!==n.host||(n.host=o.host),n.source=""),r&&(n.protocol="")}setPath(e){const t=/^(.*?)\/?(\w+)?$/.exec(e);t&&(this.path=t[0],this.directory=t[1],this.file=t[2]),this.source="",this.getURI()}toRelative(e){if("./"===e)return e;const t=new kx(e,{base_uri:this});if("mce_host"!==t.host&&this.host!==t.host&&t.host||this.port!==t.port||this.protocol!==t.protocol&&""!==t.protocol)return t.getURI();const o=this.getURI(),n=t.getURI();if(o===n||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===n)return o;let r=this.toRelPath(this.path,t.path);return t.query&&(r+="?"+t.query),t.anchor&&(r+="#"+t.anchor),r}toAbsolute(e,t){const o=new kx(e,{base_uri:this});return o.getURI(t&&this.isSameOrigin(o))}isSameOrigin(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;const t=this.protocol?xx[this.protocol]:null;if(t&&(this.port||t)==(e.port||t))return!0}return!1}toRelPath(e,t){let o,n,r=0,s="";const a=e.substring(0,e.lastIndexOf("/")).split("/"),i=t.split("/");if(a.length>=i.length)for(o=0,n=a.length;o=i.length||a[o]!==i[o]){r=o+1;break}if(a.length=a.length||a[o]!==i[o]){r=o+1;break}if(1===r)return t;for(o=0,n=a.length-(r-1);o{e&&a.push(e)}));const i=[];for(let e=s.length-1;e>=0;e--)0!==s[e].length&&"."!==s[e]&&(".."!==s[e]?o>0?o--:i.push(s[e]):o++);const l=a.length-o;let c;return c=l<=0?se(i).join("/"):a.slice(0,l).join("/")+"/"+se(i).join("/"),0!==c.indexOf("/")&&(c="/"+c),n&&c.lastIndexOf("/")!==c.length-1&&(c+=n),c}getURI(e=!1){let t;return this.source&&!e||(t="",e||(this.protocol?t+=this.protocol+"://":t+="//",this.userInfo&&(t+=this.userInfo+"@"),this.host&&(t+=this.host),this.port&&(t+=":"+this.port)),this.path&&(t+=this.path),this.query&&(t+="?"+this.query),this.anchor&&(t+="#"+this.anchor),this.source=t),this.source}}const _x=Lt.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),Ex="data-mce-type";let Tx=0;const Ox=(e,t,o,n,r)=>{var s,a,i,l;const c=t.validate,d=o.getSpecialElements();8===e.nodeType&&!t.allow_conditional_comments&&/^\[if/i.test(null!==(s=e.nodeValue)&&void 0!==s?s:"")&&(e.nodeValue=" "+e.nodeValue);const m=null!==(a=null==r?void 0:r.tagName)&&void 0!==a?a:e.nodeName.toLowerCase();if("html"!==n&&o.isValid(n))return void(C(r)&&(r.allowedTags[m]=!0));if(1!==e.nodeType||"body"===m)return;const u=wo.fromDom(e),g=so(u,Ex),p=no(u,"data-mce-bogus");if(!g&&h(p))return void("all"===p?Sn(u):kn(u));const f=o.getElementRule(m);if(!c||f){if(C(r)&&(r.allowedTags[m]=!0),c&&f&&!g){if(q(null!==(i=f.attributesForced)&&void 0!==i?i:[],(e=>{to(u,e.name,"{$uid}"===e.value?"mce_"+Tx++:e.value)})),q(null!==(l=f.attributesDefault)&&void 0!==l?l:[],(e=>{so(u,e.name)||to(u,e.name,"{$uid}"===e.value?"mce_"+Tx++:e.value)})),f.attributesRequired&&!W(f.attributesRequired,(e=>so(u,e))))return void kn(u);if(f.removeEmptyAttrs&&(e=>{const t=e.dom.attributes;return null==t||0===t.length})(u))return void kn(u);f.outputName&&f.outputName!==m&&Ga(u,f.outputName)}}else Ee(d,m)?Sn(u):kn(u)},Ax=(e,t,o,n,r,s)=>"html"!==o&&!Fr(n)||!(r in _x&&Sx(e,s,n))&&(!e.validate||t.isValid(n,r)||We(r,"data-")||We(r,"aria-")),Dx=(e,t)=>e.hasAttribute(Ex)&&("id"===t||"class"===t||"style"===t),Mx=(e,t)=>e in t.getBoolAttrs(),Nx=(e,t,o,n)=>{const{attributes:r}=e;for(let s=r.length-1;s>=0;s--){const a=r[s],i=a.name,l=a.value;Ax(t,o,n,e.tagName.toLowerCase(),i,l)||Dx(e,i)?Mx(i,o)&&e.setAttribute(i,i):e.removeAttribute(i)}},Rx=(e,t,o)=>{const n=vx();return n.addHook("uponSanitizeElement",((n,r)=>{Ox(n,e,t,o.track(n),r)})),n.addHook("uponSanitizeAttribute",((n,r)=>{((e,t,o,n,r)=>{const s=e.tagName.toLowerCase(),{attrName:a,attrValue:i}=r;r.keepAttr=Ax(t,o,n,s,a,i),r.keepAttr?(r.allowedAttributes[a]=!0,Mx(a,o)&&(r.attrValue=a),t.allow_svg_data_urls&&We(i,"data:image/svg+xml")&&(r.forceKeepAttr=!0)):Dx(e,a)&&(r.forceKeepAttr=!0)})(n,e,t,o.current(),r)})),n},Bx=e=>{const t=Vr(e);if("svg"===t){const t=["type","href","role","arcrole","title","show","actuate","label","from","to"].map((e=>`xlink:${e}`)),o={IN_PLACE:!0,USE_PROFILES:{html:!0,svg:!0,svgFilters:!0},ALLOWED_ATTR:t};vx().sanitize(e,o)}else{if("math"!==t)throw new Error("Not a namespace element");{const t={IN_PLACE:!0,USE_PROFILES:{mathMl:!0}};vx().sanitize(e,t)}}},Lx=(e,t)=>{const o=(()=>{const e=Ir(),t=()=>e.get().map(Vr).getOr("html");return{track:o=>(zr(o)?e.set(o):e.get().exists((e=>!e.contains(o)))&&e.clear(),t()),current:t,reset:()=>{e.clear()}}})();if(e.sanitize){const n=Rx(e,t,o),r=(t,r)=>{n.sanitize(t,((e,t)=>{const o={IN_PLACE:!0,ALLOW_UNKNOWN_PROTOCOLS:!0,ALLOWED_TAGS:["#comment","#cdata-section","body"],ALLOWED_ATTR:[]};return o.PARSER_MEDIA_TYPE=t,e.allow_script_urls?o.ALLOWED_URI_REGEXP=/.*/:e.allow_html_data_urls&&(o.ALLOWED_URI_REGEXP=/^(?!(\w+script|mhtml):)/i),o})(e,r)),n.removed=[],o.reset()};return{sanitizeHtmlElement:r,sanitizeNamespaceElement:Bx}}return{sanitizeHtmlElement:(n,r)=>{const s=document.createNodeIterator(n,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_TEXT);let a;for(;a=s.nextNode();){const n=o.track(a);Ox(a,e,t,n),tr(a)&&Nx(a,e,t,n)}o.reset()},sanitizeNamespaceElement:E}},Hx=Lt.makeMap,Ix=Lt.extend,Px=(e,t,o,n)=>{const r=e.name,s=r in o&&"title"!==r&&"textarea"!==r&&"noscript"!==r,a=t.childNodes;for(let t=0,r=a.length;t{const r=o.validate,s=t.getNonEmptyElements(),a=t.getWhitespaceElements(),i=Ix(Hx("script,style,head,html,body,title,meta,param"),t.getBlockElements()),l=Us(t),c=/[ \t\r\n]+/g,d=/^[ \t\r\n]+/,m=/[ \t\r\n]+$/,u=e=>{let t=e.parent;for(;C(t);){if(t.name in a)return!0;t=t.parent}return!1},g=o=>o.name in i||os(t,o)||Fr(o.name)&&o.parent===e,h=(t,o)=>{const r=o?t.prev:t.next;return!C(r)&&!x(t.parent)&&g(t.parent)&&(t.parent!==e||!0===n.isRootContent)};return[e=>{var t;if(3===e.type&&!u(e)){let o=null!==(t=e.value)&&void 0!==t?t:"";o=o.replace(c," "),(((e,t)=>C(e)&&(t(e)||"br"===e.name))(e.prev,g)||h(e,!0))&&(o=o.replace(d,"")),0===o.length?e.remove():e.value=o}},e=>{var i;if(1===e.type){const i=t.getElementRule(e.name);if(r&&i){const r=bb(t,s,a,e);i.paddInEmptyBlock&&r&&(e=>{let o=e;for(;C(o);){if(o.name in l)return bb(t,s,a,o);o=o.parent}return!1})(e)?fb(o,n,g,e):i.removeEmpty&&r?g(e)?e.remove():e.unwrap():i.paddEmpty&&(r||(e=>{var t;return vb(e,"#text")&&(null===(t=null==e?void 0:e.firstChild)||void 0===t?void 0:t.value)===qn})(e))&&fb(o,n,g,e)}}else if(3===e.type&&!u(e)){let t=null!==(i=e.value)&&void 0!==i?i:"";(e.next&&g(e.next)||h(e,!1))&&(t=t.replace(m,"")),0===t.length?e.remove():e.value=t}}]},zx=(e={},t=Ws())=>{const o=aw(),n=aw(),r={validate:!0,root_name:"body",sanitize:!0,...e},s=new DOMParser,a=Lx(r,t),i=o.addFilter,l=o.getFilters,c=o.removeFilter,d=n.addFilter,m=n.getFilters,u=n.removeFilter,g=(e,o)=>{const n=h(o.attr(Ex)),r=1===o.type&&!Ee(e,o.name)&&!os(t,o)&&!Fr(o.name);return 3===o.type||r&&!n},p={schema:t,addAttributeFilter:d,getAttributeFilters:m,removeAttributeFilter:u,addNodeFilter:i,getNodeFilters:l,removeNodeFilter:c,parse:(e,o={})=>{var n;const i=r.validate,c=null!==(n=o.context)&&void 0!==n?n:r.root_name,d=((e,o,n="html")=>{const r="xhtml"===n?"application/xhtml+xml":"text/html",i=Ee(t.getSpecialElements(),o.toLowerCase()),l=i?`<${o}>${e}`:e,c="xhtml"===n?`${l}`:`${l}`,d=s.parseFromString(c,r).body;return a.sanitizeHtmlElement(d,r),i?d.firstChild:d})(e,c,o.format);Kr(t,d);const u=new Np(c,11);Px(u,d,t.getSpecialElements(),a.sanitizeNamespaceElement),d.innerHTML="";const[h,p]=Fx(u,t,r,o),f=[],v=i?e=>((e,o)=>{Cb(t,e)&&o.push(e)})(e,f):E,b={nodes:{},attributes:{}},y=e=>gb(l(),m(),e,b);if(((e,t,o)=>{const n=[];for(let o=e,r=o;o;r=o,o=o.walk()){const s=o;q(t,(e=>e(s))),x(s.parent)&&s!==e?o=r:n.push(s)}for(let e=n.length-1;e>=0;e--){const t=n[e];q(o,(e=>e(t)))}})(u,[h,y],[p,v]),f.reverse(),i&&f.length>0)if(o.context){const{pass:e,fail:n}=K(f,(e=>e.parent===u));xb(n,t,u,y),o.invalid=e.length>0}else xb(f,t,u,y);const w=((e,t)=>{var o;const n=null!==(o=t.forced_root_block)&&void 0!==o?o:e.forced_root_block;return!1===n?"":!0===n?"p":n})(r,o);return w&&("body"===u.name||o.isRootContent)&&((e,o)=>{const n=Ix(Hx("script,style,head,html,body,title,meta,param"),t.getBlockElements()),s=/^[ \t\r\n]+/,a=/[ \t\r\n]+$/;let i=e.firstChild,l=null;const c=e=>{var t,o;e&&(i=e.firstChild,i&&3===i.type&&(i.value=null===(t=i.value)||void 0===t?void 0:t.replace(s,"")),i=e.lastChild,i&&3===i.type&&(i.value=null===(o=i.value)||void 0===o?void 0:o.replace(a,"")))};if(t.isValidChild(e.name,o.toLowerCase())){for(;i;){const t=i.next;g(n,i)?(l||(l=new Np(o,1),l.attr(r.forced_root_block_attrs),e.insert(l,i)),l.append(i)):(c(l),l=null),i=t}c(l)}})(u,w),o.invalid||hb(b,o),u}};return((e,t)=>{var o,n;const r=e.schema;e.addAttributeFilter("href",(e=>{let o=e.length;const n=e=>{const t=e?Lt.trim(e):"";return/\b(noopener)\b/g.test(t)?t:(e=>e.split(" ").filter((e=>e.length>0)).concat(["noopener"]).sort().join(" "))(t)};if(!t.allow_unsafe_link_target)for(;o--;){const t=e[o];"a"===t.name&&"_blank"===t.attr("target")&&t.attr("rel",n(t.attr("rel")))}})),t.allow_html_in_named_anchor||e.addAttributeFilter("id,name",(e=>{let t,o,n,r,s=e.length;for(;s--;)if(r=e[s],"a"===r.name&&r.firstChild&&!r.attr("href"))for(n=r.parent,t=r.lastChild;t&&n;)o=t.prev,n.insert(t,r),t=o})),t.fix_list_elements&&e.addNodeFilter("ul,ol",(e=>{let t,o,n=e.length;for(;n--;)if(t=e[n],o=t.parent,o&&("ul"===o.name||"ol"===o.name))if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{const e=new Np("li",1);e.attr("style","list-style-type: none"),t.wrap(e)}}));const s=r.getValidClasses();t.validate&&s&&e.addAttributeFilter("class",(e=>{var t;let o=e.length;for(;o--;){const n=e[o],r=null!==(t=n.attr("class"))&&void 0!==t?t:"",a=Lt.explode(r," ");let i="";for(let e=0;eq(e,(e=>{e.replace(xw({type:e.attr("type"),src:"object"===e.name?e.attr("data"):e.attr("src"),width:e.attr("width"),height:e.attr("height")},a,i))})))),a&&e.addNodeFilter("iframe",(e=>q(e,(e=>yw(e,i)))))})(p,r),((e,t,o)=>{t.inline_styles&&lw(e,t,o)})(p,r,t),p},Vx=(e,t,o)=>{const n=(e=>Fb(e)?Jp({validate:!1}).serialize(e):e)(e),r=t(n);if(r.isDefaultPrevented())return r;if(Fb(e)){if(r.content!==n){const t=zx({validate:!1,forced_root_block:!1,...o}).parse(r.content,{context:e.name});return{...r,content:t}}return{...r,content:e}}return r},Zx=e=>({sanitize:Ld(e),sandbox_iframes:Vd(e),sandbox_iframes_exclusions:Zd(e)}),Ux=(e,t)=>{if(t.no_events)return Hl.value(t);{const o=((e,t)=>e.dispatch("BeforeGetContent",t))(e,t);return o.isDefaultPrevented()?Hl.error(Pg(e,{content:"",...o}).content):Hl.value(o)}},jx=(e,t,o)=>{if(o.no_events)return t;{const n=Vx(t,(t=>Pg(e,{...o,content:t})),Zx(e));return n.content}},Wx=(e,t)=>{if(t.no_events)return Hl.value(t);{const o=Vx(t.content,(o=>((e,t)=>e.dispatch("BeforeSetContent",t))(e,{...t,content:o})),Zx(e));return o.isDefaultPrevented()?(Ig(e,o),Hl.error(void 0)):Hl.value(o)}},$x=(e,t,o)=>{o.no_events||Ig(e,{...o,content:t})},qx=(e,t,o)=>({element:e,width:t,rows:o}),Gx=(e,t)=>({element:e,cells:t}),Kx=(e,t)=>({x:e,y:t}),Yx=(e,t)=>ro(e,t).bind(Qe).getOr(1),Xx=(e,t,o)=>{const n=e.rows;return!!(n[o]?n[o].cells:[])[t]},Jx=e=>J(e,((e,t)=>t.cells.length>e?t.cells.length:e),0),Qx=(e,t)=>{const o=e.rows;for(let e=0;e{const s=[],a=e.rows;for(let e=o;e<=r;e++){const o=a[e].cells,r=t{const t=qx($a(e),0,[]);return q(Vn(e,"tr"),((e,o)=>{q(Vn(e,"td,th"),((n,r)=>{((e,t,o,n,r)=>{const s=Yx(r,"rowspan"),a=Yx(r,"colspan"),i=e.rows;for(let e=o;e{for(;Xx(e,t,o);)t++;return t})(t,r,o),o,e,n)}))})),qx(t.element,Jx(t.rows),t.rows)},oC=e=>((e,t)=>{const o=$a(e.element),n=wo.fromTag("tbody");return xn(n,t),yn(o,n),o})(e,(e=>$(e.rows,(e=>{const t=$(e.cells,(e=>{const t=qa(e);return ao(t,"colspan"),ao(t,"rowspan"),t})),o=$a(e.element);return xn(o,t),o})))(e)),nC=(e,t,o)=>Qx(e,t).bind((t=>Qx(e,o).map((o=>((e,t,o)=>{const n=t.x,r=t.y,s=o.x,a=o.y,i=ree(e,(e=>"li"===Wt(e)&&Bu(e,t))).fold(A([]),(t=>(e=>ee(e,(e=>"ul"===Wt(e)||"ol"===Wt(e))))(e).map((e=>{const t=wo.fromTag(Wt(e)),o=Ce(hn(e),((e,t)=>We(t,"list-style")));return dn(t,o),[wo.fromTag("li"),t]})).getOr([]))),sC=(e,t,o)=>{const n=wo.fromDom(t.commonAncestorContainer),r=Sf(n,e),s=Y(r,(e=>o.isWrapper(Wt(e)))),a=rC(r,t),i=s.concat(a.length?a:(e=>ni(e)?Ao(e).filter(oi).fold(A([]),(t=>[e,t])):oi(e)?[e]:[])(n));return $(i,$a)},aC=()=>ch([]),iC=(e,t,o)=>((e,t)=>{const o=J(t,((e,t)=>(yn(t,e),t)),e);return t.length>0?ch([o]):o})(wo.fromDom(t.cloneContents()),sC(e,t,o)),lC=(e,t)=>((e,t)=>tn(t,"table",N(ko,e)))(e,t[0]).bind((e=>{const o=t[0],n=t[t.length-1],r=tC(e);return nC(r,o,n).map((e=>ch([oC(e)])))})).getOrThunk(aC),cC=(e,t,o)=>{const n=Au(t,e);return n.length>0?lC(e,n):((e,t,o)=>t.length>0&&t[0].collapsed?aC():iC(e,t[0],o))(e,t,o)},dC=(e,t)=>t>=0&&tui(e.innerText),uC=(e,t)=>{if("text"===t.format)return(e=>F.from(e.selection.getRng()).map((t=>{var o;const n=F.from(e.dom.getParent(t.commonAncestorContainer,e.dom.isBlock)),r=e.getBody(),s=(e=>e.map((e=>e.nodeName)).getOr("div").toLowerCase())(n),a=wo.fromDom(t.cloneContents());$p(a),qp(a);const i=e.dom.add(r,s,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},a.dom),l=mC(i),c=ui(null!==(o=i.textContent)&&void 0!==o?o:"");if(e.dom.remove(i),dC(c,0)||dC(c,c.length-1)){const e=n.getOr(r),t=mC(e),o=t.indexOf(l);return-1===o?l:(dC(t,o-1)?" ":"")+l+(dC(t,o+l.length)?" ":"")}return l})).getOr(""))(e);{const o=((e,t)=>{const o=e.selection.getRng(),n=e.dom.create("body"),r=e.selection.getSel(),s=Tp(e,Tu(r)),a=t.contextual?cC(wo.fromDom(e.getBody()),s,e.schema).dom:o.cloneContents();return a&&n.appendChild(a),e.selection.serializer.serialize(n,t)})(e,t);return"tree"===t.format?o:e.selection.isCollapsed()?"":o}},gC=e=>tr(e)?e.outerHTML:dr(e)?Es.encodeRaw(e.data,!1):gr(e)?"\x3c!--"+e.data+"--\x3e":"",hC=(e,t,o)=>{const n=(e=>{let t;const o=document.createElement("div"),n=document.createDocumentFragment();for(e&&(o.innerHTML=e);t=o.firstChild;)n.appendChild(t);return n})(t);if(e.hasChildNodes()&&o(((e,t)=>{let o=0;q(e,(e=>{0===e[0]?o++:1===e[0]?(hC(t,e[1],o),o++):2===e[0]&&((e,t)=>{if(e.hasChildNodes()&&t{const o=e.length+t.length+2,n=new Array(o),r=new Array(o),s=(o,n,r,a,l)=>{const c=i(o,n,r,a);if(null===c||c.start===n&&c.diag===n-a||c.end===o&&c.diag===o-r){let s=o,i=r;for(;sa-r?(l.push([2,e[s]]),++s):(l.push([1,t[i]]),++i)}else{s(o,c.start,r,c.start-c.diag,l);for(let t=c.start;t{let a=o;for(;a-n({start:e,end:t,diag:o}))(o,a,n)},i=(o,s,i,l)=>{const c=s-o,d=l-i;if(0===c||0===d)return null;const m=c-d,u=d+c,g=(u%2==0?u:u+1)/2;let h,p,f,v,b;for(n[1+g]=o,r[1+g]=s+1,h=0;h<=g;++h){for(p=-h;p<=h;p+=2){for(f=p+g,p===-h||p!==h&&n[f-1]=o&&b>=i&&e[v]===t[b];)r[f]=v--,b--;if(m%2==0&&-h<=p&&p<=h&&r[f]<=n[f+m])return a(r[f],p+o-i,s,l)}}return null},l=[];return s(0,e.length,0,t.length,l),l})($(ue(t.childNodes),gC),e),t),t),fC=Ie((()=>document.implementation.createHTMLDocument("undo"))),vC=e=>{const t=e.serializer.getTempAttrs(),o=Wp(e.getBody(),t);return(e=>null!==e.querySelector("iframe"))(o)?{type:"fragmented",fragments:Y($(ue(o.childNodes),T(ui,gC)),(e=>e.length>0)),content:"",bookmark:null,beforeBookmark:null}:{type:"complete",fragments:null,content:ui(o.innerHTML),bookmark:null,beforeBookmark:null}},bC=(e,t,o)=>{const n=o?t.beforeBookmark:t.bookmark;"fragmented"===t.type?pC(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw",no_selection:!C(n)||!mu(n)||!n.isFakeCaret}),n&&(e.selection.moveToBookmark(n),e.selection.scrollIntoView())},yC=e=>"fragmented"===e.type?e.fragments.join(""):e.content,wC=e=>{const t=wo.fromTag("body",fC());return Tn(t,yC(e)),q(Vn(t,"*[data-mce-bogus]"),kn),En(t)},xC=(e,t)=>!(!e||!t)&&(!!((e,t)=>yC(e)===yC(t))(e,t)||((e,t)=>wC(e)===wC(t))(e,t)),CC=e=>0===e.get(),SC=(e,t,o)=>{CC(o)&&(e.typing=t)},kC=(e,t)=>{e.typing&&(SC(e,!1,t),e.add())},_C=e=>({init:{bindEvents:E},undoManager:{beforeChange:(t,o)=>((e,t,o)=>{CC(t)&&o.set(Rl(e.selection))})(e,t,o),add:(t,o,n,r,s,a)=>((e,t,o,n,r,s,a)=>{const i=vC(e),l=Lt.extend(s||{},i);if(!CC(n)||e.removed)return null;const c=t.data[o.get()];if(e.dispatch("BeforeAddUndo",{level:l,lastLevel:c,originalEvent:a}).isDefaultPrevented())return null;if(c&&xC(c,l))return null;t.data[o.get()]&&r.get().each((e=>{t.data[o.get()].beforeBookmark=e}));const d=Jc(e);if(d&&t.data.length>d){for(let e=0;e0?(e.setDirty(!0),e.dispatch("AddUndo",m),e.dispatch("change",m)):e.dispatch("AddUndo",m),l})(e,t,o,n,r,s,a),undo:(t,o,n)=>((e,t,o,n)=>{let r;return t.typing&&(t.add(),t.typing=!1,SC(t,!1,o)),n.get()>0&&(n.set(n.get()-1),r=t.data[n.get()],bC(e,r,!0),e.setDirty(!0),e.dispatch("Undo",{level:r})),r})(e,t,o,n),redo:(t,o)=>((e,t,o)=>{let n;return t.get()((e,t,o)=>{t.data=[],o.set(0),t.typing=!1,e.dispatch("ClearUndos")})(e,t,o),reset:e=>(e=>{e.clear(),e.add()})(e),hasUndo:(t,o)=>((e,t,o)=>o.get()>0||t.typing&&t.data[0]&&!xC(vC(e),t.data[0]))(e,t,o),hasRedo:(e,t)=>((e,t)=>t.get()((e,t,o)=>(kC(e,t),e.beforeChange(),e.ignore(o),e.add()))(e,t,o),ignore:(e,t)=>((e,t)=>{try{e.set(e.get()+1),t()}finally{e.set(e.get()-1)}})(e,t),extra:(t,o,n,r)=>((e,t,o,n,r)=>{if(t.transact(n)){const n=t.data[o.get()].bookmark,s=t.data[o.get()-1];bC(e,s,!0),t.transact(r)&&(t.data[o.get()-1].beforeBookmark=n)}})(e,t,o,n,r)},formatter:{match:(t,o,n,r)=>Yb(e,t,o,n,r),matchAll:(t,o)=>((e,t,o)=>{const n=[],r={},s=e.selection.getStart();return e.dom.getParent(s,(s=>{for(let a=0;aKb(e,t,o,n,r),canApply:t=>((e,t)=>{const o=e.formatter.get(t),n=e.dom;if(o&&e.selection.isEditable()){const t=e.selection.getStart(),r=Qu(n,t);for(let e=o.length-1;e>=0;e--){const t=o[e];if(!ng(t))return!0;for(let e=r.length-1;e>=0;e--)if(n.is(r[e],t.selector))return!0}}return!1})(e,t),closest:t=>Xb(e,t),apply:(t,o,n)=>Jy(e,t,o,n),remove:(t,o,n,r)=>Wy(e,t,o,n,r),toggle:(t,o,n)=>((e,t,o,n)=>{const r=e.formatter.get(t);r&&(!Yb(e,t,o,n)||"toggle"in r[0]&&!r[0].toggle?Jy(e,t,o,n):Wy(e,t,o,n))})(e,t,o,n),formatChanged:(t,o,n,r,s)=>rw(e,t,o,n,r,s)},editor:{getContent:t=>((e,t)=>F.from(e.getBody()).fold(A("tree"===t.format?new Np("body",11):""),(o=>Kp(e,t,o))))(e,t),setContent:(t,o)=>Vb(e,t,o),insertContent:(t,o)=>Pb(e,t,o),addVisual:t=>((e,t)=>{const o=e.dom,n=C(t)?t:e.getBody();q(o.select("table,a",n),(t=>{switch(t.nodeName){case"TABLE":const n=id(e),r=o.getAttrib(t,"border");r&&"0"!==r||!e.hasVisual?o.removeClass(t,n):o.addClass(t,n);break;case"A":if(!o.getAttrib(t,"href")){const n=o.getAttrib(t,"name")||t.id,r=ld(e);n&&e.hasVisual?o.addClass(t,r):o.removeClass(t,r)}}})),e.dispatch("VisualAid",{element:t,hasVisual:e.hasVisual})})(e,t)},selection:{getContent:(t,o)=>((e,t,o={})=>{const n=((e,t)=>({...e,format:t,get:!0,selection:!0,getInner:!0}))(o,t);return Ux(e,n).fold(D,(t=>{const o=uC(e,t);return jx(e,o,t)}))})(e,t,o)},autocompleter:{addDecoration:E,removeDecoration:E},raw:{getModel:()=>F.none()}}),EC=e=>Ee(e.plugins,"rtc"),TC=e=>{const t=e;return(e=>_e(e.plugins,"rtc").bind((e=>F.from(e.setup))))(e).fold((()=>(t.rtcInstance=_C(e),F.none())),(e=>(t.rtcInstance=(()=>{const e=A(null),t=A("");return{init:{bindEvents:E},undoManager:{beforeChange:E,add:e,undo:e,redo:e,clear:E,reset:E,hasUndo:I,hasRedo:I,transact:e,ignore:E,extra:E},formatter:{match:I,matchAll:A([]),matchNode:A(void 0),canApply:I,closest:t,apply:E,remove:E,toggle:E,formatChanged:A({unbind:E})},editor:{getContent:t,setContent:A({content:"",html:""}),insertContent:A(""),addVisual:E},selection:{getContent:t},autocompleter:{addDecoration:E,removeDecoration:E},raw:{getModel:A(F.none())}}})(),F.some((()=>e().then((e=>(t.rtcInstance=(e=>{const t=e=>p(e)?e:{},{init:o,undoManager:n,formatter:r,editor:s,selection:a,autocompleter:i,raw:l}=e;return{init:{bindEvents:o.bindEvents},undoManager:{beforeChange:n.beforeChange,add:n.add,undo:n.undo,redo:n.redo,clear:n.clear,reset:n.reset,hasUndo:n.hasUndo,hasRedo:n.hasRedo,transact:(e,t,o)=>n.transact(o),ignore:(e,t)=>n.ignore(t),extra:(e,t,o,r)=>n.extra(o,r)},formatter:{match:(e,o,n,s)=>r.match(e,t(o),s),matchAll:r.matchAll,matchNode:r.matchNode,canApply:e=>r.canApply(e),closest:e=>r.closest(e),apply:(e,o,n)=>r.apply(e,t(o)),remove:(e,o,n,s)=>r.remove(e,t(o)),toggle:(e,o,n)=>r.toggle(e,t(o)),formatChanged:(e,t,o,n,s)=>r.formatChanged(t,o,n,s)},editor:{getContent:e=>s.getContent(e),setContent:(e,t)=>({content:s.setContent(e,t),html:""}),insertContent:(e,t)=>(s.insertContent(e),""),addVisual:s.addVisual},selection:{getContent:(e,t)=>a.getContent(t)},autocompleter:{addDecoration:i.addDecoration,removeDecoration:i.removeDecoration},raw:{getModel:()=>F.some(l.getRawModel())}}})(e),e.rtc.isRemote))))))))},OC=e=>e.rtcInstance?e.rtcInstance:_C(e),AC=e=>{const t=e.rtcInstance;if(t)return t;throw new Error("Failed to get RTC instance not yet initialized.")},DC=e=>AC(e).init.bindEvents(),MC=(e,t={})=>((e,t,o)=>AC(e).selection.getContent(t,o))(e,t.format?t.format:"html",t),NC=e=>0===e.dom.length?(Sn(e),F.none()):F.some(e),RC=(e,t,o,n,r)=>{e.bind((e=>((n?nv:ov)(e.dom,n?e.dom.length:0,r),t.filter(Yt).map((t=>((e,t,o,n,r)=>{const s=e.dom,a=t.dom,i=n?s.length:a.length;n?(rv(s,a,r,!1,!n),o.setStart(a,i)):(rv(a,s,r,!1,!n),o.setEnd(a,i))})(e,t,o,n,r)))))).orThunk((()=>{const e=((e,t)=>e.filter((e=>Ng.isBookmarkNode(e.dom))).bind(t?Ro:No))(t,n).or(t).filter(Yt);return e.map((e=>((e,t,o)=>{Ao(e).each((n=>{const r=e.dom;t&&$f(n,ml(r,0),o)?ov(r,0,o):!t&&qf(n,ml(r,r.length),o)&&nv(r,r.length,o)}))})(e,n,r)))}))},BC=(e,t,o={})=>{const n=((e,t)=>({format:"html",...e,set:!0,selection:!0,content:t}))(o,t);Wx(e,n).each((t=>{const o=((e,t)=>{if("raw"!==t.format){const o=e.selection.getRng(),n=e.dom.getParent(o.commonAncestorContainer,e.dom.isBlock),r=n?{context:n.nodeName.toLowerCase()}:{},s=e.parser.parse(t.content,{forced_root_block:!1,...r,...t});return Jp({validate:!1},e.schema).serialize(s)}return t.content})(e,t),n=e.selection.getRng();((e,t,o)=>{const n=F.from(t.firstChild).map(wo.fromDom),r=F.from(t.lastChild).map(wo.fromDom);e.deleteContents(),e.insertNode(t);const s=n.bind(No).filter(Yt).bind(NC),a=r.bind(Ro).filter(Yt).bind(NC);RC(s,n,e,!0,o),RC(a,r,e,!1,o),e.collapse(!1)})(n,n.createContextualFragment(o),e.schema),e.selection.setRng(n),Wh(e,n),$x(e,o,t)}))},LC=(e,t,o)=>{if(Ee(e,t)){const n=Y(e[t],(e=>e!==o));0===n.length?delete e[t]:e[t]=n}};var HC=(e,t)=>{let o,n;const r=(t,o)=>ee(o,(o=>e.is(o,t))),s=t=>e.getParents(t,void 0,e.getRoot());return{selectorChangedWithUnbind:(e,a)=>(o||(o={},n={},t.on("NodeChange",(e=>{const t=e.element,a=s(t),i={};ve(o,((e,t)=>{r(t,a).each((o=>{n[t]||(q(e,(e=>{e(!0,{node:o,selector:t,parents:a})})),n[t]=e),i[t]=e}))})),ve(n,((e,o)=>{i[o]||(delete n[o],q(e,(e=>{e(!1,{node:t,selector:o,parents:a})})))}))}))),o[e]||(o[e]=[]),o[e].push(a),r(e,s(t.selection.getStart())).each((()=>{n[e]=o[e]})),{unbind:()=>{LC(o,e,a),LC(n,e,a)}})}};const IC=e=>!(!e||!e.ownerDocument)&&_o(wo.fromDom(e.ownerDocument),wo.fromDom(e)),PC=(e,t,o,n)=>{let r,s;const{selectorChangedWithUnbind:a}=HC(e,n),i=(e,t)=>BC(n,e,t),l=e=>{const t=d();t.collapse(!!e),m(t)},c=()=>t.getSelection?t.getSelection():t.document.selection,d=()=>{let o;const a=(e,t,o)=>{try{return t.compareBoundaryPoints(e,o)}catch(e){return-1}},i=t.document;if(C(n.bookmark)&&!bp(n)){const e=np(n);if(e.isSome())return e.map((e=>Tp(n,[e])[0])).getOr(i.createRange())}try{const e=c();e&&!er(e.anchorNode)&&(o=e.rangeCount>0?e.getRangeAt(0):i.createRange(),o=Tp(n,[o])[0])}catch(e){}if(o||(o=i.createRange()),hr(o.startContainer)&&o.collapsed){const t=e.getRoot();o.setStart(t,0),o.setEnd(t,0)}return r&&s&&(0===a(o.START_TO_START,o,r)&&0===a(o.END_TO_END,o,r)?o=s:(r=null,s=null)),o},m=(e,t)=>{if(!(e=>!!e&&IC(e.startContainer)&&IC(e.endContainer))(e))return;const o=c();if(e=n.dispatch("SetSelectionRange",{range:e,forward:t}).range,o){s=e;try{o.removeAllRanges(),o.addRange(e)}catch(e){}!1===t&&o.extend&&(o.collapse(e.endContainer,e.endOffset),o.extend(e.startContainer,e.startOffset)),r=o.rangeCount>0?o.getRangeAt(0):null}if(!e.collapsed&&e.startContainer===e.endContainer&&(null==o?void 0:o.setBaseAndExtent)&&e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()){const t=e.startContainer.childNodes[e.startOffset];t&&"IMG"===t.nodeName&&(o.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),o.anchorNode===e.startContainer&&o.focusNode===e.endContainer||o.setBaseAndExtent(t,0,t,1))}n.dispatch("AfterSetSelectionRange",{range:e,forward:t})},u=()=>{const t=c(),o=null==t?void 0:t.anchorNode,n=null==t?void 0:t.focusNode;if(!t||!o||!n||er(o)||er(n))return!0;const r=e.createRng(),s=e.createRng();try{r.setStart(o,t.anchorOffset),r.collapse(!0),s.setStart(n,t.focusOffset),s.collapse(!0)}catch(e){return!0}return r.compareBoundaryPoints(r.START_TO_START,s)<=0},g={dom:e,win:t,serializer:o,editor:n,expand:(t={type:"word"})=>m(Sh(e).expand(d(),t)),collapse:l,setCursorLocation:(t,o)=>{const r=e.createRng();C(t)&&C(o)?(r.setStart(t,o),r.setEnd(t,o),m(r),l(!1)):(Lu(e,r,n.getBody(),!0),m(r))},getContent:e=>MC(n,e),setContent:i,getBookmark:(e,t)=>h.getBookmark(e,t),moveToBookmark:e=>h.moveToBookmark(e),select:(t,o)=>(((e,t,o)=>F.from(t).bind((t=>F.from(t.parentNode).map((n=>{const r=e.nodeIndex(t),s=e.createRng();return s.setStart(n,r),s.setEnd(n,r+1),o&&(Lu(e,s,t,!0),Lu(e,s,t,!1)),s})))))(e,t,o).each(m),t),isCollapsed:()=>{const e=d(),t=c();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isEditable:()=>{const t=d(),o=n.getBody().querySelectorAll('[data-mce-selected="1"]');return o.length>0?re(o,(t=>e.isEditable(t.parentElement))):Cp(e,t)},isForward:u,setNode:t=>(i(e.getOuterHTML(t)),t),getNode:()=>((e,t)=>{if(!t)return e;let o=t.startContainer,n=t.endContainer;const r=t.startOffset,s=t.endOffset;let a=t.commonAncestorContainer;t.collapsed||(o===n&&s-r<2&&o.hasChildNodes()&&(a=o.childNodes[r]),dr(o)&&dr(n)&&(o=o.length===r?Ep(o.nextSibling,!0):o.parentNode,n=0===s?Ep(n.previousSibling,!1):n.parentNode,o&&o===n&&(a=o)));const i=dr(a)?a.parentNode:a;return or(i)?i:e})(n.getBody(),d()),getSel:c,setRng:m,getRng:d,getStart:e=>kp(n.getBody(),d(),e),getEnd:e=>_p(n.getBody(),d(),e),getSelectedBlocks:(t,o)=>((e,t,o,n)=>{const r=[],s=e.getRoot(),a=e.getParent(o||kp(s,t,t.collapsed),e.isBlock),i=e.getParent(n||_p(s,t,t.collapsed),e.isBlock);if(a&&a!==s&&r.push(a),a&&i&&a!==i){let t;const o=new Wn(a,s);for(;(t=o.next())&&t!==i;)e.isBlock(t)&&r.push(t)}return i&&a!==i&&i!==s&&r.push(i),r})(e,d(),t,o),normalize:()=>{const t=d(),o=c();if(!(Tu(o).length>1)&&Hu(n)){const o=wh(e,t);return o.each((e=>{m(e,u())})),o.getOr(t)}return t},selectorChanged:(e,t)=>(a(e,t),g),selectorChangedWithUnbind:a,getScrollContainer:()=>{let t,o=e.getRoot();for(;o&&"BODY"!==o.nodeName;){if(o.scrollHeight>o.clientHeight){t=o;break}o=o.parentNode}return t},scrollIntoView:(e,t)=>{C(e)?((e,t,o)=>{(e.inline?Zh:jh)(e,t,o)})(n,e,t):Wh(n,d(),t)},placeCaretAt:(e,t)=>m(uh(e,t,n.getDoc())),getBoundingClientRect:()=>{const e=d();return e.collapsed?ml.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:()=>{t=r=s=null,p.destroy()}},h=Ng(g),p=$g(g,n);return g.bookmarkManager=h,g.controlSelection=p,g},FC=(e,t,o)=>{e.addAttributeFilter("data-mce-tabindex",((e,t)=>{let o=e.length;for(;o--;){const n=e[o];n.attr("tabindex",n.attr("data-mce-tabindex")),n.attr(t,null)}})),e.addAttributeFilter("src,href,style",((e,n)=>{const r="data-mce-"+n,s=t.url_converter,a=t.url_converter_scope;let i=e.length;for(;i--;){const t=e[i];let l=t.attr(r);void 0!==l?(t.attr(n,l.length>0?l:null),t.attr(r,null)):(l=t.attr(n),"style"===n?l=o.serializeStyle(o.parseStyle(l),t.name):s&&(l=s.call(a,l,n,t.name)),t.attr(n,l.length>0?l:null))}})),e.addAttributeFilter("class",(e=>{let t=e.length;for(;t--;){const o=e[t];let n=o.attr("class");n&&(n=n.replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),o.attr("class",n.length>0?n:null))}})),e.addAttributeFilter("data-mce-type",((e,t,o)=>{let n=e.length;for(;n--;){const t=e[n];if("bookmark"===t.attr("data-mce-type")&&!o.cleanup){const e=F.from(t.firstChild).exists((e=>{var t;return!mi(null!==(t=e.value)&&void 0!==t?t:"")}));e?t.unwrap():t.remove()}}})),e.addNodeFilter("script,style",((e,o)=>{var n;const r=e=>e.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"");let s=e.length;for(;s--;){const a=e[s],i=a.firstChild,l=null!==(n=null==i?void 0:i.value)&&void 0!==n?n:"";if("script"===o){const e=a.attr("type");e&&a.attr("type","mce-no/type"===e?null:e.replace(/^mce\-/,"")),"xhtml"===t.element_format&&i&&l.length>0&&(i.value="// ")}else"xhtml"===t.element_format&&i&&l.length>0&&(i.value="\x3c!--\n"+r(l)+"\n--\x3e")}})),e.addNodeFilter("#comment",(e=>{let n=e.length;for(;n--;){const r=e[n],s=r.value;t.preserve_cdata&&0===(null==s?void 0:s.indexOf("[CDATA["))?(r.name="#cdata",r.type=4,r.value=o.decode(s.replace(/^\[CDATA\[|\]\]$/g,""))):0===(null==s?void 0:s.indexOf("mce:protected "))&&(r.name="#text",r.type=3,r.raw=!0,r.value=unescape(s).substr(14))}})),e.addNodeFilter("xml:namespace,input",((e,t)=>{let o=e.length;for(;o--;){const n=e[o];7===n.type?n.remove():1===n.type&&("input"!==t||n.attr("type")||n.attr("type","text"))}})),e.addAttributeFilter("data-mce-type",(t=>{q(t,(t=>{"format-caret"===t.attr("data-mce-type")&&(t.isEmpty(e.schema.getNonEmptyElements())?t.remove():t.unwrap())}))})),e.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-block,data-mce-type,data-mce-resize,data-mce-placeholder",((e,t)=>{let o=e.length;for(;o--;)e[o].attr(t,null)})),t.remove_trailing_brs&&((e,t,o)=>{t.addNodeFilter("br",((t,n,r)=>{const s=Lt.extend({},o.getBlockElements()),a=o.getNonEmptyElements(),i=o.getWhitespaceElements();s.body=1;const l=e=>e.name in s||os(o,e);for(let n=0,c=t.length;n((e,t)=>C(e)&&e.hasEventListeners("PreProcess")&&!t.no_events)(e,o)?((e,t,o)=>{let n;const r=e.dom;let s=t.cloneNode(!0);const a=document.implementation;if(a.createHTMLDocument){const e=a.createHTMLDocument("");Lt.each("BODY"===s.nodeName?s.childNodes:[s],(t=>{e.body.appendChild(e.importNode(t,!0))})),s="BODY"!==s.nodeName?e.body.firstChild:e.body,n=r.doc,r.doc=e}return((e,t)=>{e.dispatch("PreProcess",t)})(e,{...o,node:s}),n&&(r.doc=n),s})(e,t,o):t,VC=(e,t,o)=>{-1===Lt.inArray(t,o)&&(e.addAttributeFilter(o,((e,t)=>{let o=e.length;for(;o--;)e[o].attr(t,null)})),t.push(o))},ZC=(e,t,o,n,r)=>{const s=((e,t,o)=>Jp(e,t).serialize(o))(t,o,n);return((e,t,o)=>{if(!t.no_events&&e){const n=((e,t)=>e.dispatch("PostProcess",t))(e,{...t,content:o});return n.content}return o})(e,r,s)},UC=(e,t)=>{const o=["data-mce-selected"],n={entity_encoding:"named",remove_trailing_brs:!0,pad_empty_with_br:!1,...e},r=t&&t.dom?t.dom:xa.DOM,s=t&&t.schema?t.schema:Ws(n),a=zx(n,s);return FC(a,n,r),{schema:s,addNodeFilter:a.addNodeFilter,addAttributeFilter:a.addAttributeFilter,serialize:(e,o={})=>{const i={format:"html",...o},l=zC(t,e,i),c=((e,t,o)=>{const n=ui(o.getInner?t.innerHTML:e.getOuterHTML(t));return o.selection||ai(wo.fromDom(t))?n:Lt.trim(n)})(r,l,i),d=((e,t,o)=>{const n=o.selection?{forced_root_block:!1,...o}:o,r=e.parse(t,n);return(e=>{const t=e=>"br"===(null==e?void 0:e.name),o=e.lastChild;if(t(o)){const e=o.prev;t(e)&&(o.remove(),e.remove())}})(r),r})(a,c,i);return"tree"===i.format?d:ZC(t,n,s,d,i)},addRules:s.addValidElements,setRules:s.setValidElements,addTempAttr:N(VC,a,o),getTempAttrs:A(o),getNodeFilters:a.getNodeFilters,getAttributeFilters:a.getAttributeFilters,removeNodeFilter:a.removeNodeFilter,removeAttributeFilter:a.removeAttributeFilter}},jC=(e,t)=>{const o=UC(e,t);return{schema:o.schema,addNodeFilter:o.addNodeFilter,addAttributeFilter:o.addAttributeFilter,serialize:o.serialize,addRules:o.addRules,setRules:o.setRules,addTempAttr:o.addTempAttr,getTempAttrs:o.getTempAttrs,getNodeFilters:o.getNodeFilters,getAttributeFilters:o.getAttributeFilters,removeNodeFilter:o.removeNodeFilter,removeAttributeFilter:o.removeAttributeFilter}},WC=(e,t={})=>{const o=((e,t)=>({...e,format:t,get:!0,getInner:!0}))(t,t.format?t.format:"html");return Ux(e,o).fold(D,(t=>{const o=((e,t)=>OC(e).editor.getContent(t))(e,t);return jx(e,o,t)}))},$C=(e,t,o={})=>{const n=((e,t)=>({format:"html",...e,set:!0,content:t}))(o,t);return Wx(e,n).map((t=>{const o=((e,t,o)=>OC(e).editor.setContent(t,o))(e,t.content,t);return $x(e,o.html,t),o.content})).getOr(t)},qC="autoresize_on_init,content_editable_state,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,tabfocus_elements,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_enable_default_filters,paste_filter_drop,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists,template_cdate_classes,template_mdate_classes,template_selected_content_classes,template_preview_replace_values,template_replace_values,templates,template_cdate_format,template_mdate_format".split(","),GC=[],KC="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,template,textcolor,rtc".split(","),YC=[],XC=(e,t)=>{const o=Y(t,(t=>Ee(e,t)));return le(o)},JC=e=>{const t=XC(e,qC),o=e.forced_root_block;return!1!==o&&""!==o||t.push("forced_root_block (false only)"),le(t)},QC=e=>XC(e,GC),eS=(e,t)=>{const o=Lt.makeMap(e.plugins," "),n=Y(t,(e=>Ee(o,e)));return le(n)},tS=e=>eS(e,KC),oS=e=>eS(e,YC.map((e=>e.name))),nS=e=>ee(YC,(t=>t.name===e)).fold((()=>e),(t=>t.replacedWith?`${e}, replaced by ${t.replacedWith}`:e)),rS=(e,t)=>{((e,t)=>{const o=JC(e),n=tS(t),r=n.length>0,s=o.length>0,a="mobile"===t.theme;if(r||s||a){const e="\n- ",t=a?`\n\nThemes:${e}mobile`:"",i=r?`\n\nPlugins:${e}${n.join(e)}`:"",l=s?`\n\nOptions:${e}${o.join(e)}`:"";console.warn("The following deprecated features are currently enabled and have been removed in TinyMCE 7.0. These features will no longer work and should be removed from the TinyMCE configuration. See https://www.tiny.cloud/docs/tinymce/7/migration-from-6x/ for more information."+t+i+l)}})(e,t),((e,t)=>{const o=QC(e),n=oS(t),r=n.length>0,s=o.length>0;if(r||s){const e="\n- ",t=r?`\n\nPlugins:${e}${n.map(nS).join(e)}`:"",a=s?`\n\nOptions:${e}${o.join(e)}`:"";console.warn("The following deprecated features are currently enabled but will be removed soon."+t+a)}})(e,t)},sS=xa.DOM,aS=e=>F.from(e).each((e=>e.destroy())),iS=e=>{if(!e.removed){const{_selectionOverrides:t,editorUpload:o}=e,n=e.getBody(),r=e.getElement();n&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&C(null==r?void 0:r.nextSibling)&&sS.remove(r.nextSibling),(e=>{e.dispatch("remove")})(e),e.editorManager.remove(e),!e.inline&&n&&(e=>{sS.setStyle(e.id,"display",e.orgDisplay)})(e),(e=>{e.dispatch("detach")})(e),sS.remove(e.getContainer()),aS(t),aS(o),e.destroy()}},lS=(e,t)=>{const{selection:o,dom:n}=e;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),aS(o),aS(n)),(e=>{const t=e.formElement;t&&(t._mceOldSubmit&&(t.submit=t._mceOldSubmit,delete t._mceOldSubmit),sS.unbind(t,"submit reset",e.formEventDelegate))})(e),(e=>{const t=e;t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null;const o=e.selection;if(o){const e=o.dom;t.selection=o.win=o.dom=e.doc=null}})(e),e.destroyed=!0):e.remove())},cS=(()=>{const e={};return{add:(t,o)=>{e[t]=o},get:t=>e[t]?e[t]:{icons:{}},has:t=>Ee(e,t)}})(),dS=Oa.ModelManager,mS=(e,t)=>t.dom[e],uS=(e,t)=>parseInt(mn(t,e),10),gS=N(mS,"clientWidth"),hS=N(mS,"clientHeight"),pS=N(uS,"margin-top"),fS=N(uS,"margin-left"),vS=(e,t,o)=>{const n=wo.fromDom(e.getBody()),r=e.inline?n:(s=n,wo.fromDom(To(s).dom.documentElement));var s;const a=((e,t,o,n)=>{const r=(e=>e.dom.getBoundingClientRect())(t);return{x:o-(e?r.left+t.dom.clientLeft+fS(t):0),y:n-(e?r.top+t.dom.clientTop+pS(t):0)}})(e.inline,r,t,o);return((e,t,o)=>{const n=gS(e),r=hS(e);return t>=0&&o>=0&&t<=n&&o<=r})(r,a.x,a.y)},bS=e=>{const t=e.inline?e.getBody():e.getContentAreaContainer();return(o=t,F.from(o).map(wo.fromDom)).map(Ko).getOr(!1);var o},yS=e=>{const t=[],o=()=>{const t=e.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():(()=>{const e=()=>{throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:e,close:e,getArgs:e}})()},n=()=>F.from(t[0]),r=()=>{n().each((e=>{e.reposition()}))},s=e=>{te(t,(t=>t===e)).each((e=>{t.splice(e,1)}))},a=(n,a=!0)=>e.removed||!bS(e)?{}:(a&&e.dispatch("BeforeOpenNotification",{notification:n}),ee(t,(e=>{return t=o().getArgs(e),r=n,!(t.type!==r.type||t.text!==r.text||t.progressBar||t.timeout||r.progressBar||r.timeout);var t,r})).getOrThunk((()=>{e.editorManager.setActive(e);const a=o().open(n,(()=>{s(a)}),(()=>yp(e)));return(e=>{t.push(e)})(a),r(),e.dispatch("OpenNotification",{notification:{...a}}),a}))),i=A(t);return(e=>{e.on("SkinLoaded",(()=>{const t=Hc(e);t&&a({text:t,type:"warning",timeout:0},!1),r()})),e.on("show ResizeEditor NodeChange",(()=>{requestAnimationFrame(r)})),e.on("remove",(()=>{q(t.slice(),(e=>{o().close(e)}))})),e.addShortcut("alt+F12","Focus to notification",(()=>n().map((e=>wo.fromDom(e.getEl()))).each((e=>$h(e)))))})(e),{open:a,close:()=>{n().each((e=>{o().close(e),s(e),r()}))},getNotifications:i}},wS=Oa.PluginManager,xS=Oa.ThemeManager,CS=e=>{let t=[];const o=()=>{const t=e.theme;return t&&t.getWindowManagerImpl?t.getWindowManagerImpl():(()=>{const e=()=>{throw new Error("Theme did not provide a WindowManager implementation.")};return{open:e,openUrl:e,alert:e,confirm:e,close:e}})()},n=(e,t)=>(...o)=>t?t.apply(e,o):void 0,r=o=>{t.push(o),(t=>{e.dispatch("OpenWindow",{dialog:t})})(o)},s=o=>{(t=>{e.dispatch("CloseWindow",{dialog:t})})(o),t=Y(t,(e=>e!==o)),0===t.length&&e.focus()},a=t=>{e.editorManager.setActive(e),op(e),e.ui.show();const o=t();return r(o),o};return e.on("remove",(()=>{q(t,(e=>{o().close(e)}))})),{open:(e,t)=>a((()=>o().open(e,t,s))),openUrl:e=>a((()=>o().openUrl(e,s))),alert:(e,t,r)=>{const s=o();s.alert(e,n(r||s,t))},confirm:(e,t,r)=>{const s=o();s.confirm(e,n(r||s,t))},close:()=>{F.from(t[t.length-1]).each((e=>{o().close(e),s(e)}))}}},SS=(e,t)=>{e.notificationManager.open({type:"error",text:t})},kS=(e,t)=>{e._skinLoaded?SS(e,t):e.on("SkinLoaded",(()=>{SS(e,t)}))},_S=(e,t,o)=>{Bg(e,t,{message:o}),console.error(o)},ES=(e,t,o)=>o?`Failed to load ${e}: ${o} from url ${t}`:`Failed to load ${e} url: ${t}`,TS=(e,...t)=>{const o=window.console;o&&(o.error?o.error(e,...t):o.log(e,...t))},OS=e=>"content/"+e+"/content.css",AS=(e,t)=>{const o=e.editorManager.baseURL+"/skins/content",n=`content${e.editorManager.suffix}.css`;return $(t,(t=>(e=>tinymce.Resource.has(OS(e)))(t)?t:(e=>/^[a-z0-9\-]+$/i.test(e))(t)&&!e.inline?`${o}/${t}/${n}`:e.documentBaseURI.toAbsolute(t)))},DS=e=>{e.contentCSS=e.contentCSS.concat((e=>AS(e,Tc(e)))(e),(e=>AS(e,Ac(e)))(e))},MS=(e,t)=>{const o={};return{findAll:(n,r=P)=>{const s=Y((e=>e?ue(e.getElementsByTagName("img")):[])(n),(t=>{const o=t.src;return!t.hasAttribute("data-mce-bogus")&&!t.hasAttribute("data-mce-placeholder")&&!(!o||o===Mt.transparentSrc)&&(We(o,"blob:")?!e.isUploaded(o)&&r(t):!!We(o,"data:")&&r(t))})),a=$(s,(e=>{const n=e.src;if(Ee(o,n))return o[n].then((t=>h(t)?t:{image:e,blobInfo:t.blobInfo}));{const r=((e,t)=>{const o=()=>Promise.reject("Invalid data URI");if(We(t,"blob:")){const n=e.getByUri(t);return C(n)?Promise.resolve(n):mw(t).then((t=>uw(t).then((n=>hw(n,!1,(o=>F.some(pw(e,t,o)))).getOrThunk(o)))))}return We(t,"data:")?fw(e,t).fold(o,(e=>Promise.resolve(e))):Promise.reject("Unknown image data format")})(t,n).then((t=>(delete o[n],{image:e,blobInfo:t}))).catch((e=>(delete o[n],e)));return o[n]=r,r}}));return Promise.all(a)}}},NS=()=>{let e={};const t=(e,t)=>({status:e,resultUri:t}),o=t=>t in e;return{hasBlobUri:o,getResultUri:t=>{const o=e[t];return o?o.resultUri:null},isPending:t=>!!o(t)&&1===e[t].status,isUploaded:t=>!!o(t)&&2===e[t].status,markPending:o=>{e[o]=t(1,null)},markUploaded:(o,n)=>{e[o]=t(2,n)},removeFailed:t=>{delete e[t]},destroy:()=>{e={}}}};let RS=0;const BS=e=>e+RS+++(()=>{const e=()=>Math.round(4294967295*Math.random()).toString(36);return"s"+(new Date).getTime().toString(36)+e()+e()+e()})(),LS=(e,t)=>{const o={},n=(e,o)=>new Promise(((n,r)=>{const s=new XMLHttpRequest;s.open("POST",t.url),s.withCredentials=t.credentials,s.upload.onprogress=e=>{o(e.loaded/e.total*100)},s.onerror=()=>{r("Image upload failed due to a XHR Transport error. Code: "+s.status)},s.onload=()=>{if(s.status<200||s.status>=300)return void r("HTTP Error: "+s.status);const e=JSON.parse(s.responseText);var o,a;e&&h(e.location)?n((o=t.basePath,a=e.location,o?o.replace(/\/$/,"")+"/"+a.replace(/^\//,""):a)):r("Invalid JSON: "+s.responseText)};const a=new FormData;a.append("file",e.blob(),e.filename()),s.send(a)})),r=S(t.handler)?t.handler:n,s=(e,t)=>({url:t,blobInfo:e,status:!0}),a=(e,t)=>({url:"",blobInfo:e,status:!1,error:t}),i=(e,t)=>{Lt.each(o[e],(e=>{e(t)})),delete o[e]},l=(t,n)=>(t=Lt.grep(t,(t=>!e.isUploaded(t.blobUri()))),Promise.all(Lt.map(t,(t=>e.isPending(t.blobUri())?(e=>{const t=e.blobUri();return new Promise((e=>{o[t]=o[t]||[],o[t].push(e)}))})(t):((t,o,n)=>(e.markPending(t.blobUri()),new Promise((r=>{let l,c;try{const d=()=>{l&&(l.close(),c=E)},m=o=>{d(),e.markUploaded(t.blobUri(),o),i(t.blobUri(),s(t,o)),r(s(t,o))},u=o=>{d(),e.removeFailed(t.blobUri()),i(t.blobUri(),a(t,o)),r(a(t,o))};c=e=>{e<0||e>100||F.from(l).orThunk((()=>F.from(n).map(L))).each((t=>{l=t,t.progressBar.value(e)}))},o(t,c).then(m,(e=>{u(h(e)?{message:e}:e)}))}catch(e){r(a(t,e))}}))))(t,r,n)))));return{upload:(e,o)=>t.url||r!==n?l(e,o):new Promise((e=>{e([])}))}},HS=e=>()=>e.notificationManager.open({text:e.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0}),IS=(e,t)=>LS(t,{url:vc(e),basePath:bc(e),credentials:yc(e),handler:wc(e)}),PS=e=>t=>{((e,t)=>e.dom.isEmpty(t.dom)&&C(e.schema.getTextBlockElements()[Wt(t)]))(e,t)&&yn(t,wo.fromHtml('
    '))},FS=e=>{const t=(()=>{let e=[];const t=e=>{if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");const t=e.id||BS("blobid"),o=e.name||t,n=e.blob;return{id:A(t),name:A(o),filename:A(e.filename||o+"."+(r=n.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[r.toLowerCase()]||"dat")),blob:A(n),base64:A(e.base64),blobUri:A(e.blobUri||URL.createObjectURL(n)),uri:A(e.uri)};var r},o=t=>ee(e,t).getOrUndefined(),n=e=>o((t=>t.id()===e));return{create:(e,o,n,r,s)=>{if(h(e))return t({id:e,name:r,filename:s,blob:o,base64:n});if(p(e))return t(e);throw new Error("Unknown input type")},add:t=>{n(t.id())||e.push(t)},get:n,getByUri:e=>o((t=>t.blobUri()===e)),getByData:(e,t)=>o((o=>o.base64()===e&&o.blob().type===t)),findFirst:o,removeByUri:t=>{e=Y(e,(e=>e.blobUri()!==t||(URL.revokeObjectURL(e.blobUri()),!1)))},destroy:()=>{q(e,(e=>{URL.revokeObjectURL(e.blobUri())})),e=[]}}})();let o,n;const r=NS(),s=[],a=t=>o=>e.selection?t(o):[],i=(e,t,o)=>{let n=0;do{n=e.indexOf(t,n),-1!==n&&(e=e.substring(0,n)+o+e.substr(n+t.length),n+=o.length-t.length+1)}while(-1!==n);return e},l=(e,t,o)=>{const n=`src="${o}"${o===Mt.transparentSrc?' data-mce-placeholder="1"':""}`;return e=i(e,`src="${t}"`,n),e=i(e,'data-mce-src="'+t+'"','data-mce-src="'+o+'"')},c=(t,o)=>{q(e.undoManager.data,(e=>{"fragmented"===e.type?e.fragments=$(e.fragments,(e=>l(e,t,o))):e.content=l(e.content,t,o)}))},d=()=>(o||(o=IS(e,r)),g().then(a((n=>{const r=$(n,(e=>e.blobInfo));return o.upload(r,HS(e)).then(a((o=>{const r=[];let s=!1;const a=$(o,((o,a)=>{const{blobInfo:i,image:l}=n[a];let d=!1;return o.status&&hc(e)?(o.url&&!je(l.src,o.url)&&(s=!0),t.removeByUri(l.src),EC(e)||((t,o)=>{const n=e.convertURL(o,"src");var r;c(t.src,o),oo(wo.fromDom(t),{src:gc(e)?(r=o,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):o,"data-mce-src":n})})(l,o.url)):o.error&&(o.error.remove&&(c(l.src,Mt.transparentSrc),r.push(l),d=!0),((e,t)=>{kS(e,Ta.translate(["Failed to upload image: {0}",t]))})(e,o.error.message)),{element:l,status:o.status,uploadUri:o.url,blobInfo:i,removed:d}}));return r.length>0&&!EC(e)?e.undoManager.transact((()=>{q(_n(r),(o=>{const n=Ao(o);Sn(o),n.each(PS(e)),t.removeByUri(o.dom.src)}))})):s&&e.undoManager.dispatchChange(),a})))})))),m=()=>uc(e)?d():Promise.resolve([]),u=e=>re(s,(t=>t(e))),g=()=>(n||(n=MS(r,t)),n.findAll(e.getBody(),u).then(a((t=>{const o=Y(t,(t=>h(t)?(kS(e,t),!1):"blob"!==t.uriType));return EC(e)||q(o,(e=>{c(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")})),o})))),f=o=>o.replace(/src="(blob:[^"]+)"/g,((o,n)=>{const s=r.getResultUri(n);if(s)return'src="'+s+'"';let a=t.getByUri(n);return a||(a=J(e.editorManager.get(),((e,t)=>e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)),void 0)),a?'src="data:'+a.blob().type+";base64,"+a.base64()+'"':o}));return e.on("SetContent",(()=>{uc(e)?m():g()})),e.on("RawSaveContent",(e=>{e.content=f(e.content)})),e.on("GetContent",(e=>{e.source_view||"raw"===e.format||"tree"===e.format||(e.content=f(e.content))})),e.on("PostRender",(()=>{e.parser.addNodeFilter("img",(e=>{q(e,(e=>{const o=e.attr("src");if(!o||t.getByUri(o))return;const n=r.getResultUri(o);n&&e.attr("src",n)}))}))})),{blobCache:t,addFilter:e=>{s.push(e)},uploadImages:d,uploadImagesAuto:m,scanForImages:g,destroy:()=>{t.destroy(),r.destroy(),n=o=null}}},zS={remove_similar:!0,inherit:!1},VS={selector:"td,th",...zS},ZS={tablecellbackgroundcolor:{styles:{backgroundColor:"%value"},...VS},tablecellverticalalign:{styles:{"vertical-align":"%value"},...VS},tablecellbordercolor:{styles:{borderColor:"%value"},...VS},tablecellclass:{classes:["%value"],...VS},tableclass:{selector:"table",classes:["%value"],...zS},tablecellborderstyle:{styles:{borderStyle:"%value"},...VS},tablecellborderwidth:{styles:{borderWidth:"%value"},...VS}},US=A(ZS),jS=e=>{const t={},o=(e,n)=>{e&&(h(e)?(v(n)||(n=[n]),q(n,(e=>{w(e.deep)&&(e.deep=!ng(e)),w(e.split)&&(e.split=!ng(e)||rg(e)),w(e.remove)&&ng(e)&&!rg(e)&&(e.remove="none"),ng(e)&&rg(e)&&(e.mixed=!0,e.block_expand=!0),h(e.classes)&&(e.classes=e.classes.split(/\s+/))})),t[e]=n):ve(e,((e,t)=>{o(t,e)})))};return o((e=>{const t=e.dom,o=e.schema.type,n={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"left"},inherit:!1,preview:!1},{selector:"img,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"},{selector:"table",collapsed:!1,styles:{marginLeft:"0px",marginRight:"auto"},onformat:e=>{t.setStyle(e,"float",null)},preview:"font-family font-size"},{selector:".mce-preview-object,[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{float:"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"},{selector:".mce-preview-object",ceFalseOverride:!0,styles:{display:"table",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{marginLeft:"auto",marginRight:"auto"},preview:!1}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"},{selector:"table",collapsed:!1,styles:{marginRight:"0px",marginLeft:"auto"},onformat:e=>{t.setStyle(e,"float",null)},preview:"font-family font-size"},{selector:".mce-preview-object,[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{float:"right"},preview:!1}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"justify"},inherit:!1,preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:(()=>{const e={inline:"span",styles:{textDecoration:"line-through"},exact:!0},t={inline:"strike",remove:"all",preserve_attributes:["class","style"]},n={inline:"s",remove:"all",preserve_attributes:["class","style"]};return"html4"!==o?[n,e,t]:[e,n,t]})(),forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:(e,t,o)=>tr(e)&&e.hasAttribute("href"),onformat:(e,o,n)=>{Lt.each(n,((o,n)=>{t.setAttrib(e,n,o)}))}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":e=>{var t;return null!==(t=null==e?void 0:e.customValue)&&void 0!==t?t:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return Lt.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),(e=>{n[e]={block:e,remove:"all"}})),n})(e)),o(US()),o(Zc(e)),{get:e=>C(e)?t[e]:t,has:e=>Ee(t,e),register:o,unregister:e=>(e&&t[e]&&delete t[e],t)}},WS=Lt.each,$S=xa.DOM,qS=e=>C(e)&&p(e),GS=(e,t)=>{const o=t&&t.schema||Ws({}),n=e=>{const t=h(e)?{name:e,classes:[],attrs:{}}:e,o=$S.create(t.name);return((e,t)=>{t.classes.length>0&&$S.addClass(e,t.classes.join(" ")),$S.setAttribs(e,t.attrs)})(o,t),o},r=(e,t,s)=>{let a;const i=t[0],l=qS(i)?i.name:void 0,c=((e,t)=>{const n=o.getElementRule(e.nodeName.toLowerCase()),r=null==n?void 0:n.parentsRequired;return!(!r||!r.length)&&(t&&j(r,t)?t:r[0])})(e,l);if(c)l===c?(a=i,t=t.slice(1)):a=c;else if(i)a=i,t=t.slice(1);else if(!s)return e;const d=a?n(a):$S.create("div");d.appendChild(e),s&&Lt.each(s,(t=>{const o=n(t);d.insertBefore(o,e)}));const m=qS(a)?a.siblings:void 0;return r(d,t,m)},s=$S.create("div");if(e.length>0){const t=e[0],o=n(t),a=qS(t)?t.siblings:void 0;s.appendChild(r(o,e.slice(1),a))}return s},KS=e=>{let t="div";const o={name:t,classes:[],attrs:{},selector:e=Lt.trim(e)};return"*"!==e&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,((e,t,n,r,s)=>{switch(t){case"#":o.attrs.id=n;break;case".":o.classes.push(n);break;case":":-1!==Lt.inArray("checked disabled enabled read-only required".split(" "),n)&&(o.attrs[n]=n)}if("["===r){const e=s.match(/([\w\-]+)(?:\=\"([^\"]+))?/);e&&(o.attrs[e[1]]=e[2])}return""}))),o.name=t||"div",o},YS=(e,t)=>{let o="",n=Uc(e);if(""===n)return"";const r=e=>h(e)?e.replace(/%(\w+)/g,""):"",s=(t,o)=>$S.getStyle(null!=o?o:e.getBody(),t,!0);if(h(t)){const o=e.formatter.get(t);if(!o)return"";t=o[0]}if("preview"in t){const e=t.preview;if(!1===e)return"";n=e||n}let a,i=t.block||t.inline||"span";const l=(c=t.selector,h(c)?(c=(c=c.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),Lt.map(c.split(/(?:>|\s+(?![^\[\]]+\]))/),(e=>{const t=Lt.map(e.split(/(?:~\+|~|\+)/),KS),o=t.pop();return t.length&&(o.siblings=t),o})).reverse()):[]);var c;l.length>0?(l[0].name||(l[0].name=i),i=t.selector,a=GS(l,e)):a=GS([i],e);const d=$S.select(i,a)[0]||a.firstChild;WS(t.styles,((e,t)=>{const o=r(e);o&&$S.setStyle(d,t,o)})),WS(t.attributes,((e,t)=>{const o=r(e);o&&$S.setAttrib(d,t,o)})),WS(t.classes,(e=>{const t=r(e);$S.hasClass(d,t)||$S.addClass(d,t)})),e.dispatch("PreviewFormats"),$S.setStyles(a,{position:"absolute",left:-65535}),e.getBody().appendChild(a);const m=s("fontSize"),u=/px$/.test(m)?parseInt(m,10):0;return WS(n.split(" "),(e=>{let t=s(e,d);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=s(e),"#ffffff"===ea(t).toLowerCase())||"color"===e&&"#000000"===ea(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===u)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*u+"px"}"border"===e&&t&&(o+="padding:0 2px;"),o+=e+":"+t+";"}})),e.dispatch("AfterPreviewFormats"),$S.remove(a),o},XS=e=>{const t=jS(e),o=Lr({});return(e=>{e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(let t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])})(e),iy(e),EC(e)||((e,t)=>{e.set({}),t.on("NodeChange",(o=>{nw(t,o.element,e.get())})),t.on("FormatApply FormatRemove",(o=>{const n=F.from(o.node).map((e=>Fu(e)?e:e.startContainer)).bind((e=>tr(e)?F.some(e):F.from(e.parentElement))).getOrThunk((()=>ew(t)));nw(t,n,e.get())}))})(o,e),{get:t.get,has:t.has,register:t.register,unregister:t.unregister,apply:(t,o,n)=>{((e,t,o,n)=>{AC(e).formatter.apply(t,o,n)})(e,t,o,n)},remove:(t,o,n,r)=>{((e,t,o,n,r)=>{AC(e).formatter.remove(t,o,n,r)})(e,t,o,n,r)},toggle:(t,o,n)=>{((e,t,o,n)=>{AC(e).formatter.toggle(t,o,n)})(e,t,o,n)},match:(t,o,n,r)=>((e,t,o,n,r)=>AC(e).formatter.match(t,o,n,r))(e,t,o,n,r),closest:t=>((e,t)=>AC(e).formatter.closest(t))(e,t),matchAll:(t,o)=>((e,t,o)=>AC(e).formatter.matchAll(t,o))(e,t,o),matchNode:(t,o,n,r)=>((e,t,o,n,r)=>AC(e).formatter.matchNode(t,o,n,r))(e,t,o,n,r),canApply:t=>((e,t)=>AC(e).formatter.canApply(t))(e,t),formatChanged:(t,n,r,s)=>((e,t,o,n,r,s)=>AC(e).formatter.formatChanged(t,o,n,r,s))(e,o,t,n,r,s),getCssText:N(YS,e)}},JS=e=>{switch(e.toLowerCase()){case"undo":case"redo":case"mcefocus":return!0;default:return!1}},QS=e=>{const t=Ir(),o=Lr(0),n=Lr(0),r={data:[],typing:!1,beforeChange:()=>{((e,t,o)=>{AC(e).undoManager.beforeChange(t,o)})(e,o,t)},add:(s,a)=>((e,t,o,n,r,s,a)=>AC(e).undoManager.add(t,o,n,r,s,a))(e,r,n,o,t,s,a),dispatchChange:()=>{e.setDirty(!0);const t=vC(e);t.bookmark=Rl(e.selection),e.dispatch("change",{level:t,lastLevel:ce(r.data,n.get()).getOrUndefined()})},undo:()=>((e,t,o,n)=>AC(e).undoManager.undo(t,o,n))(e,r,o,n),redo:()=>((e,t,o)=>AC(e).undoManager.redo(t,o))(e,n,r.data),clear:()=>{((e,t,o)=>{AC(e).undoManager.clear(t,o)})(e,r,n)},reset:()=>{((e,t)=>{AC(e).undoManager.reset(t)})(e,r)},hasUndo:()=>((e,t,o)=>AC(e).undoManager.hasUndo(t,o))(e,r,n),hasRedo:()=>((e,t,o)=>AC(e).undoManager.hasRedo(t,o))(e,r,n),transact:t=>((e,t,o,n)=>AC(e).undoManager.transact(t,o,n))(e,r,o,t),ignore:t=>{((e,t,o)=>{AC(e).undoManager.ignore(t,o)})(e,o,t)},extra:(t,o)=>{((e,t,o,n,r)=>{AC(e).undoManager.extra(t,o,n,r)})(e,r,n,t,o)}};return EC(e)||((e,t,o)=>{const n=Lr(!1),r=e=>{SC(t,!1,o),t.add({},e)};e.on("init",(()=>{t.add()})),e.on("BeforeExecCommand",(e=>{const n=e.command;JS(n)||(kC(t,o),t.beforeChange())})),e.on("ExecCommand",(e=>{const t=e.command;JS(t)||r(e)})),e.on("ObjectResizeStart cut",(()=>{t.beforeChange()})),e.on("SaveContent ObjectResized blur",r),e.on("dragend",r),e.on("keyup",(o=>{const s=o.keyCode;if(o.isDefaultPrevented())return;const a=Mt.os.isMacOS()&&"Meta"===o.key;(s>=33&&s<=36||s>=37&&s<=40||45===s||o.ctrlKey||a)&&(r(),e.nodeChanged()),46!==s&&8!==s||e.nodeChanged(),n.get()&&t.typing&&!xC(vC(e),t.data[0])&&(e.isDirty()||e.setDirty(!0),e.dispatch("TypingUndo"),n.set(!1),e.nodeChanged())})),e.on("keydown",(e=>{const s=e.keyCode;if(e.isDefaultPrevented())return;if(s>=33&&s<=36||s>=37&&s<=40||45===s)return void(t.typing&&r(e));const a=e.ctrlKey&&!e.altKey||e.metaKey;if((s<16||s>20)&&224!==s&&91!==s&&!t.typing&&!a)return t.beforeChange(),SC(t,!0,o),t.add({},e),void n.set(!0);(Mt.os.isMacOS()?e.metaKey:e.ctrlKey&&!e.altKey)&&t.beforeChange()})),e.on("mousedown",(e=>{t.typing&&r(e)})),e.on("input",(e=>{var t;e.inputType&&("insertReplacementText"===e.inputType||"insertText"===(t=e).inputType&&null===t.data||(e=>"insertFromPaste"===e.inputType||"insertFromDrop"===e.inputType)(e))&&r(e)})),e.on("AddUndo Undo Redo ClearUndos",(t=>{t.isDefaultPrevented()||e.nodeChanged()}))})(e,r,o),(e=>{e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo")})(e),r},ek=[9,27,Vg.HOME,Vg.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,Vg.DOWN,Vg.UP,Vg.LEFT,Vg.RIGHT].concat(Mt.browser.isFirefox()?[224]:[]),tk="data-mce-placeholder",ok=e=>"keydown"===e.type||"keyup"===e.type,nk=e=>{const t=e.keyCode;return t===Vg.BACKSPACE||t===Vg.DELETE},rk=e=>{var t;const o=e.dom,n=sc(e),r=null!==(t=Bc(e))&&void 0!==t?t:"",s=(t,a)=>{if((e=>{if(ok(e)){const t=e.keyCode;return!nk(e)&&(Vg.metaKeyPressed(e)||e.altKey||t>=112&&t<=123||j(ek,t))}return!1})(t))return;const i=e.getBody(),l=!(e=>ok(e)&&!(nk(e)||"keyup"===e.type&&229===e.keyCode))(t)&&((e,t,o)=>{if(e.isEmpty(t,void 0,{skipBogus:!1,includeZwsp:!0})){const n=t.firstElementChild;return!n||!e.getStyle(t.firstElementChild,"padding-left")&&!e.getStyle(t.firstElementChild,"padding-right")&&o===n.nodeName.toLowerCase()}return!1})(o,i,n);(""!==o.getAttrib(i,tk)!==l||a)&&(o.setAttrib(i,tk,l?r:null),((e,t)=>{e.dispatch("PlaceholderToggle",{state:t})})(e,l),e.on(l?"keydown":"keyup",s),e.off(l?"keyup":"keydown",s))};Xe(r)&&e.on("init",(t=>{s(t,!0),e.on("change SetContent ExecCommand",s),e.on("paste",(t=>sp.setEditorTimeout(e,(()=>s(t)))))}))},sk=(e,t)=>({from:e,to:t}),ak=(e,t)=>{const o=wo.fromDom(e),n=wo.fromDom(t.container());return Ev(o,n).map((e=>((e,t)=>({block:e,position:t}))(e,t)))},ik=(e,t)=>Jo(t,(e=>si(e)||br(e.dom)),(t=>ko(t,e))).filter(Kt).getOr(e),lk=(e,t,o,n)=>{const r=ak(t,ml.fromRangeStart(n)),s=r.bind((n=>Qm(o,t,n.position).bind((n=>ak(t,n).map((n=>((e,t,o,n)=>fr(n.position.getNode())&&!Rr(e,n.block)?ou(!1,n.block.dom).bind((e=>e.isEqual(n.position)?Qm(o,t,e).bind((e=>ak(t,e))):F.some(n))).getOr(n):n)(e,t,o,n)))))));return Pt(r,s,sk).filter((e=>(e=>!ko(e.from.block,e.to.block))(e)&&((e,t)=>{const o=wo.fromDom(e);return ko(ik(o,t.from.block),ik(o,t.to.block))})(t,e)&&(e=>!1===yr(e.from.block.dom)&&!1===yr(e.to.block.dom))(e)&&(e=>{const t=e=>ti(e)||Xr(e.dom)||ni(e);return t(e.from.block)&&t(e.to.block)})(e)&&(e=>!(_o(e.to.block,e.from.block)||_o(e.from.block,e.to.block)))(e)))},ck=(e,t,o)=>{const n=o?Bo(e).reverse():Lo(e),r=te(n,(e=>t.isBlock(Wt(e)))).fold(A(n),(e=>n.slice(0,e)));return o?r.reverse():r},dk=(e,t,o,n,r)=>{const s=((e,t,o,n,r)=>{if(r&&_o(e,t))return ck(t,o,n);if(r&&_o(t,e))return ck(e,o,n);{const e=Ho(t);return te(e,(e=>o.isBlock(Wt(e)))).fold(A(e),(t=>e.slice(0,t)))}})(e,t,o,n,r);return q(s,Sn),s},mk=(e,t,o)=>{const n=Sf(o,t);return ee(n.reverse(),(t=>Rr(e,t))).each(Sn)},uk=(e,t,o,n,r,s)=>{if(Rr(n,o))return ci(o),su(o.dom);((e,t)=>0===Y(Bo(t),(t=>!Rr(e,t))).length)(n,s)&&Rr(n,t)&&fn(s,wo.fromTag("br"));const a=ru(o.dom,ml.before(s.dom));return q(dk(o,t,n,r,!1),(e=>{fn(s,e)})),mk(n,e,t),a},gk=(e,t,o,n,r)=>{if(Rr(n,o)){if(Rr(n,t)){const e=e=>{const t=(e,o)=>Po(e).fold((()=>o),(e=>((e,t)=>e.isInline(Wt(t)))(n,e)?t(e,o.concat($a(e))):o));return t(e,[])},r=X(e(o),((e,t)=>(wn(e,t),t)),li());Cn(t),yn(t,r)}return Sn(o),su(t.dom)}const s=au(o.dom);return q(dk(o,t,n,r,!0),(e=>{r&&_o(t,o)?bn(o,e):yn(o,e)})),mk(n,e,t),s},hk=(e,t)=>_o(t,e)?((e,t)=>{const o=Sf(t,e);return F.from(o[o.length-1])})(t,e):F.none(),pk=(e,t)=>{ou(e,t.dom).bind((e=>F.from(e.getNode()))).map(wo.fromDom).filter(ei).each(Sn)},fk=(e,t,o,n,r)=>(pk(!0,t),pk(!1,o),hk(t,o).fold(N(gk,e,t,o,n,r),N(uk,e,t,o,n,r))),vk=(e,t,o,n,r,s=!1)=>{if(s){if(_o(n,o))return fk(e,n,o,r,!t);if(_o(o,n))return fk(e,o,n,r,t)}return t?fk(e,n,o,r,t):fk(e,o,n,r,!t)},bk=(e,t)=>{const o=wo.fromDom(e.getBody()),n=((e,t,o,n)=>n.collapsed?lk(e,t,o,n):F.none())(e.schema,o.dom,t,e.selection.getRng()).map((n=>()=>{vk(o,t,n.from.block,n.to.block,e.schema,!0).each((t=>{e.selection.setRng(t.toRange())}))}));return n},yk=(e,t)=>{const o=wo.fromDom(t),n=N(ko,e);return Xo(o,si,n).isSome()},wk=(e,t)=>{const o=ru(e.dom,ml.fromRangeStart(t)).isNone(),n=nu(e.dom,ml.fromRangeEnd(t)).isNone();return!((e,t)=>yk(e,t.startContainer)||yk(e,t.endContainer))(e,t)&&o&&n},xk=e=>{const t=wo.fromDom(e.getBody()),o=e.selection.getRng();return wk(t,o)?(e=>F.some((()=>{e.setContent(""),e.selection.setCursorLocation()})))(e):((e,t,o)=>{const n=t.getRng();return Pt(Ev(e,wo.fromDom(n.startContainer)),Ev(e,wo.fromDom(n.endContainer)),((r,s)=>ko(r,s)?F.none():F.some((()=>{n.deleteContents(),vk(e,!0,r,s,o).each((e=>{t.setRng(e.toRange())}))})))).getOr(F.none())})(t,e.selection,e.schema)},Ck=(e,t)=>e.selection.isCollapsed()?F.none():xk(e),Sk=(e,t,o,n,r)=>F.from(t._selectionOverrides.showCaret(e,o,n,r)),kk=(e,t)=>e.dispatch("BeforeObjectSelected",{target:t}).isDefaultPrevented()?F.none():F.some((e=>{const t=e.ownerDocument.createRange();return t.selectNode(e),t})(t)),_k=(e,t,o)=>t.collapsed?((e,t,o)=>{const n=Mm(1,e.getBody(),t),r=ml.fromRangeStart(n),s=r.getNode();if(lm(s))return Sk(1,e,s,!r.isAtEnd(),!1);const a=r.getNode(!0);if(lm(a))return Sk(1,e,a,!1,!1);const i=lb(e.dom.getRoot(),r.getNode());return lm(i)?Sk(1,e,i,!1,o):F.none()})(e,t,o).getOr(t):t,Ek=e=>wf(e)||ff(e),Tk=e=>xf(e)||vf(e),Ok=(e,t,o,n,r,s)=>{Sk(n,e,s.getNode(!r),r,!0).each((o=>{if(t.collapsed){const e=t.cloneRange();r?e.setEnd(o.startContainer,o.startOffset):e.setStart(o.endContainer,o.endOffset),e.deleteContents()}else t.deleteContents();e.selection.setRng(o)})),((e,t)=>{dr(t)&&0===t.data.length&&e.remove(t)})(e.dom,o)},Ak=(e,t)=>((e,t)=>{const o=e.selection.getRng();if(!dr(o.commonAncestorContainer))return F.none();const n=t?Im.Forwards:Im.Backwards,r=Gm(e.getBody()),s=N(Lm,t?r.next:r.prev),a=t?Ek:Tk,i=Rm(n,e.getBody(),o),l=s(i),c=l?yv(t,l):l;if(!c||!Hm(i,c))return F.none();if(a(c))return F.some((()=>Ok(e,o,i.getNode(),n,t,c)));const d=s(c);return d&&a(d)&&Hm(c,d)?F.some((()=>Ok(e,o,i.getNode(),n,t,d))):F.none()})(e,t),Dk=(e,t)=>{const o=e.getBody();return t?su(o).filter(wf):au(o).filter(xf)},Mk=e=>{const t=e.selection.getRng();return!t.collapsed&&(Dk(e,!0).exists((e=>e.isEqual(ml.fromRangeStart(t))))||Dk(e,!1).exists((e=>e.isEqual(ml.fromRangeEnd(t)))))},Nk=Il([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),Rk=(e,t,o,n,r)=>{const s=r.getNode(!o);return Ev(wo.fromDom(t),wo.fromDom(n.getNode())).map((t=>Rr(e,t)?Nk.remove(t.dom):Nk.moveToElement(s))).orThunk((()=>F.some(Nk.moveToElement(s))))},Bk=(e,t,o,n)=>Qm(t,e,o).bind((r=>{return s=r.getNode(),C(s)&&(si(wo.fromDom(s))||ni(wo.fromDom(s)))||((e,t,o,n,r)=>{const s=t=>r.isInline(t.nodeName.toLowerCase())&&!km(o,n,e);return Nm(!t,o).fold((()=>Nm(t,n).fold(I,s)),s)})(e,t,o,r,n)?F.none():t&&yr(r.getNode())||!t&&yr(r.getNode(!0))?Rk(n,e,t,o,r):t&&xf(o)||!t&&wf(o)?F.some(Nk.moveToPosition(r)):F.none();var s})),Lk=(e,t,o,n)=>((e,t)=>{const o=t.getNode(!e),n=e?"after":"before";return tr(o)&&o.getAttribute("data-mce-caret")===n})(t,o)?((e,t)=>x(t)?F.none():e&&yr(t.nextSibling)?F.some(Nk.moveToElement(t.nextSibling)):!e&&yr(t.previousSibling)?F.some(Nk.moveToElement(t.previousSibling)):F.none())(t,o.getNode(!t)).orThunk((()=>Bk(e,t,o,n))):Bk(e,t,o,n).bind((t=>((e,t,o)=>o.fold((e=>F.some(Nk.remove(e))),(e=>F.some(Nk.moveToElement(e))),(o=>km(t,o,e)?F.none():F.some(Nk.moveToPosition(o)))))(e,o,t))),Hk=(e,t)=>F.from(lb(e.getBody(),t)),Ik=(e,t)=>{const o=e.selection.getNode();return Hk(e,o).filter(yr).fold((()=>((e,t,o,n)=>{const r=Mm(t?1:-1,e,o),s=ml.fromRangeStart(r),a=wo.fromDom(e);return!t&&xf(s)?F.some(Nk.remove(s.getNode(!0))):t&&wf(s)?F.some(Nk.remove(s.getNode())):!t&&wf(s)&&Lf(a,s,n)?Hf(a,s,n).map((e=>Nk.remove(e.getNode()))):t&&xf(s)&&Bf(a,s,n)?If(a,s,n).map((e=>Nk.remove(e.getNode()))):Lk(e,t,s,n)})(e.getBody(),t,e.selection.getRng(),e.schema).map((o=>()=>o.fold(((e,t)=>o=>(e._selectionOverrides.hideFakeCaret(),hv(e,t,wo.fromDom(o)),!0))(e,t),((e,t)=>o=>{const n=t?ml.before(o):ml.after(o);return e.selection.setRng(n.toRange()),!0})(e,t),(e=>t=>(e.selection.setRng(t.toRange()),!0))(e))))),(()=>F.some(E)))},Pk=(e,t)=>{const o=e.selection.getNode();return yr(o)&&!wr(o)?Hk(e,o.parentNode).filter(yr).fold((()=>F.some((()=>{var o;o=wo.fromDom(e.getBody()),q(Vn(o,".mce-offscreen-selection"),Sn),hv(e,t,wo.fromDom(e.selection.getNode())),Tv(e)}))),(()=>F.some(E))):Mk(e)?F.some((()=>{Dv(e,e.selection.getRng(),wo.fromDom(e.getBody()))})):F.none()},Fk=e=>{const t=e.dom,o=e.selection,n=lb(e.getBody(),o.getNode());if(br(n)&&t.isBlock(n)&&t.isEmpty(n)){const e=t.create("br",{"data-mce-bogus":"1"});t.setHTML(n,""),n.appendChild(e),o.setRng(ml.before(e).toRange())}return!0},zk=(e,t)=>e.selection.isCollapsed()?Ik(e,t):Pk(e,t),Vk=e=>e.hasOwnProperty("text"),Zk=e=>e.hasOwnProperty("marker"),Uk=(e,t)=>{const o=(e,o)=>{if(dr(e))return{text:e,offset:o};{const n=t(),r=e.childNodes;return o{var t,o;const{start:n,end:r}=e,s=new window.Range;return Vk(n)?s.setStart(n.text,n.offset):Zk(n)&&(n.before?s.setStartBefore(n.marker):s.setStartAfter(n.marker),null===(t=n.marker.parentNode)||void 0===t||t.removeChild(n.marker)),Vk(r)?s.setEnd(r.text,r.offset):Zk(r)&&(r.before?s.setEndBefore(r.marker):s.setEndAfter(r.marker),null===(o=r.marker.parentNode)||void 0===o||o.removeChild(r.marker)),s},Wk=(e,t)=>{var o;const n=e.dom,r=n.getParent(e.selection.getStart(),n.isBlock),s=n.getParent(e.selection.getEnd(),n.isBlock),a=e.getBody();if("div"===(null===(o=null==r?void 0:r.nodeName)||void 0===o?void 0:o.toLowerCase())&&r&&s&&r===a.firstChild&&s===a.lastChild&&!n.isEmpty(a)){const o=r.cloneNode(!1),n=()=>{if(t?kv(e):Sv(e),a.firstChild!==r){const t=Uk(e.selection.getRng(),(()=>document.createElement("span")));Array.from(a.childNodes).forEach((e=>o.appendChild(e))),a.appendChild(o),e.selection.setRng(jk(t))}};return F.some(n)}return F.none()},$k=(e,t)=>e.selection.isCollapsed()?((e,t)=>{const o=ml.fromRangeStart(e.selection.getRng());return Qm(t,e.getBody(),o).filter((e=>t?hf(e):pf(e))).bind((e=>_m(t?0:-1,e))).map((t=>()=>e.selection.select(t)))})(e,t):F.none(),qk=dr,Gk=e=>qk(e)&&e.data[0]===di,Kk=e=>qk(e)&&e.data[e.data.length-1]===di,Yk=e=>{var t;return(null!==(t=e.ownerDocument)&&void 0!==t?t:document).createTextNode(di)},Xk=(e,t)=>e?(e=>{var t;if(qk(e.previousSibling))return Kk(e.previousSibling)||e.previousSibling.appendData(di),e.previousSibling;if(qk(e))return Gk(e)||e.insertData(0,di),e;{const o=Yk(e);return null===(t=e.parentNode)||void 0===t||t.insertBefore(o,e),o}})(t):(e=>{var t,o;if(qk(e.nextSibling))return Gk(e.nextSibling)||e.nextSibling.insertData(0,di),e.nextSibling;if(qk(e))return Kk(e)||e.appendData(di),e;{const n=Yk(e);return e.nextSibling?null===(t=e.parentNode)||void 0===t||t.insertBefore(n,e.nextSibling):null===(o=e.parentNode)||void 0===o||o.appendChild(n),n}})(t),Jk=N(Xk,!0),Qk=N(Xk,!1),e_=(e,t)=>dr(e.container())?Xk(t,e.container()):Xk(t,e.getNode()),t_=(e,t)=>{const o=t.get();return o&&e.container()===o&&fi(o)},o_=(e,t)=>t.fold((t=>{tm(e.get());const o=Jk(t);return e.set(o),F.some(ml(o,o.length-1))}),(t=>su(t).map((t=>{if(t_(t,e)){const t=e.get();return ml(t,1)}{tm(e.get());const o=e_(t,!0);return e.set(o),ml(o,1)}}))),(t=>au(t).map((t=>{if(t_(t,e)){const t=e.get();return ml(t,t.length-1)}{tm(e.get());const o=e_(t,!1);return e.set(o),ml(o,o.length-1)}}))),(t=>{tm(e.get());const o=Qk(t);return e.set(o),F.some(ml(o,1))})),n_=(e,t)=>{for(let o=0;o{const o=Sm(t,e);return o||e},a_=(e,t,o)=>{const n=wv(o),r=s_(t,n.container());return bv(e,r,n).fold((()=>nu(r,n).bind(N(bv,e,r)).map((e=>r_.before(e)))),F.none)},i_=(e,t)=>null===cu(e,t),l_=(e,t,o)=>bv(e,t,o).filter(N(i_,t)),c_=(e,t,o)=>{const n=xv(o);return l_(e,t,n).bind((e=>ru(e,n).isNone()?F.some(r_.start(e)):F.none()))},d_=(e,t,o)=>{const n=wv(o);return l_(e,t,n).bind((e=>nu(e,n).isNone()?F.some(r_.end(e)):F.none()))},m_=(e,t,o)=>{const n=xv(o),r=s_(t,n.container());return bv(e,r,n).fold((()=>ru(r,n).bind(N(bv,e,r)).map((e=>r_.after(e)))),F.none)},u_=e=>!vv(h_(e)),g_=(e,t,o)=>n_([a_,c_,d_,m_],[e,t,o]).filter(u_),h_=e=>e.fold(D,D,D,D),p_=e=>e.fold(A("before"),A("start"),A("end"),A("after")),f_=e=>e.fold(r_.before,r_.before,r_.after,r_.after),v_=e=>e.fold(r_.start,r_.start,r_.end,r_.end),b_=(e,t,o,n,r,s)=>Pt(bv(t,o,n),bv(t,o,r),((t,n)=>t!==n&&((e,t,o)=>{const n=Sm(t,e),r=Sm(o,e);return C(n)&&n===r})(o,t,n)?r_.after(e?t:n):s)).getOr(s),y_=(e,t)=>e.fold(P,(e=>{return n=t,!(p_(o=e)===p_(n)&&h_(o)===h_(n));var o,n})),w_=(e,t)=>e?t.fold(T(F.some,r_.start),F.none,T(F.some,r_.after),F.none):t.fold(F.none,T(F.some,r_.before),F.none,T(F.some,r_.end)),x_=(e,t,o,n)=>{const r=yv(e,n),s=g_(t,o,r);return g_(t,o,r).bind(N(w_,e)).orThunk((()=>((e,t,o,n,r)=>{const s=yv(e,r);return Qm(e,o,s).map(N(yv,e)).fold((()=>n.map(f_)),(r=>g_(t,o,r).map(N(b_,e,t,o,s,r)).filter(N(y_,n)))).filter(u_)})(e,t,o,s,n)))},C_=(e,t,o)=>{const n=e?1:-1;return t.setRng(ml(o.container(),o.offset()+n).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},S_=(e,t)=>{const o=t.selection.getRng(),n=e?ml.fromRangeEnd(o):ml.fromRangeStart(o);return!!(e=>S(e.selection.getSel().modify))(t)&&(e&&yi(n)?C_(!0,t.selection,n):!(e||!wi(n))&&C_(!1,t.selection,n))};var k_;!function(e){e[e.Br=0]="Br",e[e.Block=1]="Block",e[e.Wrap=2]="Wrap",e[e.Eol=3]="Eol"}(k_||(k_={}));const __=(e,t)=>e===Im.Backwards?se(t):t,E_=(e,t,o)=>e===Im.Forwards?t.next(o):t.prev(o),T_=(e,t,o,n)=>fr(n.getNode(t===Im.Forwards))?k_.Br:!1===km(o,n)?k_.Block:k_.Wrap,O_=(e,t,o,n)=>{const r=Gm(o);let s=n;const a=[];for(;s;){const o=E_(t,r,s);if(!o)break;if(fr(o.getNode(!1)))return t===Im.Forwards?{positions:__(t,a).concat([o]),breakType:k_.Br,breakAt:F.some(o)}:{positions:__(t,a),breakType:k_.Br,breakAt:F.some(o)};if(o.isVisible()){if(e(s,o)){const e=T_(0,t,s,o);return{positions:__(t,a),breakType:e,breakAt:F.some(o)}}a.push(o),s=o}else s=o}return{positions:__(t,a),breakType:k_.Eol,breakAt:F.none()}},A_=(e,t,o,n)=>t(o,n).breakAt.map((n=>{const r=t(o,n).positions;return e===Im.Backwards?r.concat(n):[n].concat(r)})).getOr([]),D_=(e,t)=>J(e,((e,o)=>e.fold((()=>F.some(o)),(n=>Pt(de(n.getClientRects()),de(o.getClientRects()),((e,r)=>{const s=Math.abs(t-e.left);return Math.abs(t-r.left)<=s?o:n})).or(e)))),F.none()),M_=(e,t)=>de(t.getClientRects()).bind((t=>D_(e,t.left))),N_=N(O_,ml.isAbove,-1),R_=N(O_,ml.isBelow,1),B_=N(A_,-1,N_),L_=N(A_,1,R_),H_=(e,t)=>N_(e,t).breakAt.isNone(),I_=(e,t)=>R_(e,t).breakAt.isNone(),P_=(e,t)=>M_(B_(e,t),t),F_=(e,t)=>M_(L_(e,t),t),z_=yr,V_=(e,t)=>Math.abs(e.left-t),Z_=(e,t)=>Math.abs(e.right-t),U_=(e,t)=>Be(e,((e,o)=>{const n=Math.min(V_(e,t),Z_(e,t)),r=Math.min(V_(o,t),Z_(o,t));return r===n&&Te(o,"node")&&z_(o.node)||r{const t=t=>$(t,(t=>{const o=Ei(t);return o.node=e,o}));if(tr(e))return t(e.getClientRects());if(dr(e)){const o=e.ownerDocument.createRange();return o.setStart(e,0),o.setEnd(e,e.data.length),t(o.getClientRects())}return[]},W_=e=>ne(e,j_);var $_;!function(e){e[e.Up=-1]="Up",e[e.Down=1]="Down"}($_||($_={}));const q_=(e,t,o,n,r,s)=>{let a=0;const i=[],l=n=>{let s=W_([n]);-1===e&&(s=s.reverse());for(let e=0;e0&&t(n,He(i))&&a++,n.line=a,r(n))return!0;i.push(n)}}return!1},c=He(s.getClientRects());if(!c)return i;const d=s.getNode();return d&&(l(d),((e,t,o,n)=>{let r=n;for(;r=Cm(r,e,$i,t);)if(o(r))return})(e,n,l,d)),i},G_=N(q_,$_.Up,Ai,Di),K_=N(q_,$_.Down,Di,Ai),Y_=e=>He(e.getClientRects()),X_=e=>t=>((e,t)=>t.line>e)(e,t),J_=e=>t=>((e,t)=>t.line===e)(e,t),Q_=(e,t)=>{e.selection.setRng(t),Wh(e,e.selection.getRng())},eE=(e,t,o)=>F.some(_k(e,t,o)),tE=(e,t,o,n,r,s)=>{const a=t===Im.Forwards,i=Gm(e.getBody()),l=N(Lm,a?i.next:i.prev),c=a?n:r;if(!o.collapsed){const n=Ni(o);if(s(n))return Sk(t,e,n,t===Im.Backwards,!1);if(Mk(e)){const e=o.cloneRange();return e.collapse(t===Im.Backwards),F.from(e)}}const d=Rm(t,e.getBody(),o);if(c(d))return kk(e,d.getNode(!a));let m=l(d);const u=ki(o);if(!m)return u?F.some(o):F.none();if(m=yv(a,m),c(m))return Sk(t,e,m.getNode(!a),a,!1);const g=l(m);return g&&c(g)&&Hm(m,g)?Sk(t,e,g.getNode(!a),a,!1):u?eE(e,m.toRange(),!1):F.none()},oE=(e,t,o,n,r,s)=>{const a=Rm(t,e.getBody(),o),i=He(a.getClientRects()),l=t===$_.Down,c=e.getBody();if(!i)return F.none();if(Mk(e)){const e=l?ml.fromRangeEnd(o):ml.fromRangeStart(o);return(l?F_:P_)(c,e).orThunk((()=>F.from(e))).map((e=>e.toRange()))}const d=(l?K_:G_)(c,X_(1),a),m=Y(d,J_(1)),u=i.left,g=U_(m,u);if(g&&s(g.node)){const o=Math.abs(u-g.left),n=Math.abs(u-g.right);return Sk(t,e,g.node,o{const r=Gm(t);let s,a,i,l;const c=[];let d=0;1===e?(s=r.next,a=Di,i=Ai,l=ml.after(n)):(s=r.prev,a=Ai,i=Di,l=ml.before(n));const m=Y_(l);do{if(!l.isVisible())continue;const e=Y_(l);if(i(e,m))continue;c.length>0&&a(e,He(c))&&d++;const t=Ei(e);if(t.position=l,t.line=d,o(t))return c;c.push(t)}while(l=s(l));return c})(t,c,X_(1),h);let n=U_(Y(o,J_(1)),u);if(n)return eE(e,n.position.toRange(),!1);if(n=He(Y(o,J_(0))),n)return eE(e,n.position.toRange(),!1)}return 0===m.length?nE(e,l).filter(l?r:n).map((t=>_k(e,t.toRange(),!1))):F.none()},nE=(e,t)=>{const o=e.selection.getRng(),n=t?ml.fromRangeEnd(o):ml.fromRangeStart(o),r=(s=n.container(),a=e.getBody(),Xo(wo.fromDom(s),(e=>dm(e.dom)),(e=>e.dom===a)).map((e=>e.dom)).getOr(a));var s,a;if(t){const e=R_(r,n);return me(e.positions)}{const e=N_(r,n);return de(e.positions)}},rE=(e,t,o)=>nE(e,t).filter(o).exists((t=>(e.selection.setRng(t.toRange()),!0))),sE=(e,t)=>{const o=e.dom.createRng();o.setStart(t.container(),t.offset()),o.setEnd(t.container(),t.offset()),e.selection.setRng(o)},aE=(e,t)=>{e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},iE=(e,t,o)=>o_(t,o).map((t=>(sE(e,t),o))),lE=(e,t,o)=>{const n=e.getBody(),r=((e,t,o)=>{const n=ml.fromRangeStart(e);if(e.collapsed)return n;{const r=ml.fromRangeEnd(e);return o?ru(t,r).getOr(r):nu(t,n).getOr(n)}})(e.selection.getRng(),n,o),s=N(fv,e);return x_(o,s,n,r).bind((o=>iE(e,t,o)))},cE=(e,t)=>{const o=t.get();if(e.selection.isCollapsed()&&!e.composing&&o){const n=ml.fromRangeStart(e.selection.getRng());ml.isTextPosition(n)&&!(e=>yi(e)||wi(e))(n)&&(sE(e,em(o,n)),t.set(null))}},dE=(e,t,o)=>!!Vc(e)&&lE(e,t,o).isSome(),mE=(e,t,o)=>!!Vc(t)&&S_(e,t),uE=e=>{const t=Lr(null),o=N(fv,e);return e.on("NodeChange",(n=>{Vc(e)&&(((e,t,o)=>{const n=$(Vn(wo.fromDom(t.getRoot()),'*[data-mce-selected="inline-boundary"]'),(e=>e.dom)),r=Y(n,e),s=Y(o,e);q(ae(r,s),N(aE,!1)),q(ae(s,r),N(aE,!0))})(o,e.dom,n.parents),cE(e,t),((e,t,o,n)=>{if(t.selection.isCollapsed()){const r=Y(n,e);q(r,(n=>{const r=ml.fromRangeStart(t.selection.getRng());g_(e,t.getBody(),r).bind((e=>iE(t,o,e)))}))}})(o,e,t,n.parents))})),t},gE=N(mE,!0),hE=N(mE,!1),pE=(e,t,o)=>{if(Vc(e)){const n=nE(e,t).getOrThunk((()=>{const o=e.selection.getRng();return t?ml.fromRangeEnd(o):ml.fromRangeStart(o)}));return g_(N(fv,e),e.getBody(),n).exists((t=>{const n=f_(t);return o_(o,n).exists((t=>(sE(e,t),!0)))}))}return!1},fE=(e,t)=>o=>o_(t,o).map((t=>()=>sE(e,t))),vE=(e,t,o,n)=>{const r=e.getBody(),s=N(fv,e);e.undoManager.ignore((()=>{e.selection.setRng(((e,t)=>{const o=document.createRange();return o.setStart(e.container(),e.offset()),o.setEnd(t.container(),t.offset()),o})(o,n)),Sv(e),g_(s,r,ml.fromRangeStart(e.selection.getRng())).map(v_).bind(fE(e,t)).each(H)})),e.nodeChanged()},bE=(e,t,o,n)=>{const r=((e,t)=>{const o=Sm(t,e);return o||e})(e.getBody(),n.container()),s=N(fv,e),a=g_(s,r,n);return a.bind((e=>o?e.fold(A(F.some(v_(e))),F.none,A(F.some(f_(e))),F.none):e.fold(F.none,A(F.some(f_(e))),F.none,A(F.some(v_(e)))))).map(fE(e,t)).getOrThunk((()=>{const i=eu(o,r,n),l=i.bind((e=>g_(s,r,e)));return Pt(a,l,(()=>bv(s,r,n).bind((t=>(e=>Pt(su(e),au(e),((t,o)=>{const n=yv(!0,t),r=yv(!1,o);return nu(e,n).forall((e=>e.isEqual(r)))})).getOr(!0))(t)?F.some((()=>{hv(e,o,wo.fromDom(t))})):F.none())))).getOrThunk((()=>l.bind((()=>i.map((r=>()=>{o?vE(e,t,n,r):vE(e,t,r,n)}))))))}))},yE=(e,t,o)=>{if(e.selection.isCollapsed()&&Vc(e)){const n=ml.fromRangeStart(e.selection.getRng());return bE(e,t,o,n)}return F.none()},wE=(e,t)=>{const o=wo.fromDom(e.getBody()),n=wo.fromDom(e.selection.getStart()),r=Sf(n,o);return te(r,t).fold(A(r),(e=>r.slice(0,e)))},xE=e=>1===zo(e),CE=e=>wE(e,(t=>e.schema.isBlock(Wt(t))||(e=>zo(e)>1)(t))),SE=(e,t)=>{const o=N(dy,e);return ne(t,(e=>o(e)?[e.dom]:[]))},kE=e=>{const t=(e=>wE(e,(t=>e.schema.isBlock(Wt(t)))))(e);return SE(e,t)},_E=(e,t)=>{const o=Y(CE(e),xE);return me(o).bind((n=>{const r=ml.fromRangeStart(e.selection.getRng());return Ov(t,r,n.dom)&&!ig(n)?F.some((()=>((e,t,o,n)=>{const r=SE(t,n);if(0===r.length)hv(t,e,o);else{const e=cy(o.dom,r);t.selection.setRng(e.toRange())}})(t,e,n,o))):F.none()}))},EE=(e,t)=>{const o=e.selection.getStart(),n=((e,t)=>{const o=t.parentElement;return fr(t)&&!b(o)&&e.dom.isEmpty(o)})(e,o)||(r=o,ig(wo.fromDom(r)))?cy(o,t):((e,t)=>{const{caretContainer:o,caretPosition:n}=ly(t);return e.insertNode(o.dom),n})(e.selection.getRng(),t);var r;e.selection.setRng(n.toRange())},TE=e=>dr(e.startContainer),OE=e=>(e=>{const t=e.startContainer.parentNode,o=e.endContainer.parentNode;return!b(t)&&!b(o)&&t.isEqualNode(o)})(e)&&(e=>{const t=e.endContainer;return e.endOffset===(dr(t)?t.length:t.childNodes.length)})(e),AE=e=>{const t=e.selection.getRng();return(e=>0===e.startOffset&&TE(e))(t)&&((e,t)=>{const o=t.startContainer.parentElement;return!b(o)&&dy(e,wo.fromDom(o))})(e,t)&&(e=>OE(e)||(e=>!e.endContainer.isEqualNode(e.commonAncestorContainer))(e))(t)},DE=e=>{if(AE(e)){const t=kE(e);return F.some((()=>{Sv(e),((e,t)=>{const o=ae(t,kE(e));o.length>0&&EE(e,o)})(e,t)}))}return F.none()},ME=(e,t)=>e.selection.isCollapsed()?_E(e,t):DE(e),NE=e=>{return t=wo.fromDom(e.selection.getStart()),o=e.schema,Zn(t,(e=>lu(e.dom)),(e=>o.isBlock(Wt(e))));var t,o},RE=e=>((e=>{const t=e.selection.getRng();return t.collapsed&&(TE(t)||e.dom.isEmpty(t.startContainer))&&!NE(e)})(e)&&EE(e,[]),!0),BE=(e,t,o)=>C(o)?F.some((()=>{e._selectionOverrides.hideFakeCaret(),hv(e,t,wo.fromDom(o))})):F.none(),LE=(e,t)=>e.selection.isCollapsed()?((e,t)=>{const o=t?ff:vf,n=t?Im.Forwards:Im.Backwards,r=Rm(n,e.getBody(),e.selection.getRng());return o(r)?BE(e,t,r.getNode(!t)):F.from(yv(t,r)).filter((e=>o(e)&&Hm(r,e))).bind((o=>BE(e,t,o.getNode(!t))))})(e,t):((e,t)=>{const o=e.selection.getNode();return Cr(o)?BE(e,t,o):F.none()})(e,t),HE=e=>Qe(null!=e?e:"").getOr(0),IE=(e,t)=>(e||"table"===Wt(t)?"margin":"padding")+("rtl"===mn(t,"direction")?"-right":"-left"),PE=e=>{const t=zE(e);return!e.mode.isReadOnly()&&(t.length>1||((e,t)=>re(t,(t=>{const o=IE(_c(e),t),n=gn(t,o).map(HE).getOr(0);return"false"!==e.dom.getContentEditable(t.dom)&&n>0})))(e,t))},FE=e=>oi(e)||ni(e),zE=e=>Y(_n(e.selection.getSelectedBlocks()),(e=>!FE(e)&&!(e=>Ao(e).exists(FE))(e)&&Jo(e,(e=>br(e.dom)||yr(e.dom))).exists((e=>br(e.dom))))),VE=(e,t)=>{var o,n;const{dom:r}=e,s=Ec(e),a=null!==(n=null===(o=/[a-z%]+$/i.exec(s))||void 0===o?void 0:o[0])&&void 0!==n?n:"px",i=HE(s),l=_c(e);q(zE(e),(e=>{((e,t,o,n,r,s)=>{const a=IE(o,wo.fromDom(s)),i=HE(e.getStyle(s,a));if("outdent"===t){const t=Math.max(0,i-n);e.setStyle(s,a,t?t+r:"")}else{const t=i+n+r;e.setStyle(s,a,t)}})(r,t,l,i,a,e.dom)}))},ZE=e=>VE(e,"outdent"),UE=e=>{if(e.selection.isCollapsed()&&PE(e)){const t=e.dom,o=e.selection.getRng(),n=ml.fromRangeStart(o),r=t.getParent(o.startContainer,t.isBlock);if(null!==r&&Of(wo.fromDom(r),n,e.schema))return F.some((()=>ZE(e)))}return F.none()},jE=(e,t,o)=>ge([UE,zk,Ak,(e,o)=>yE(e,t,o),bk,ib,$k,LE,Ck,ME,Wk],(t=>t(e,o))).filter((t=>e.selection.isEditable())),WE=(e,t)=>{e.addCommand("delete",(()=>{((e,t)=>{jE(e,t,!1).fold((()=>{e.selection.isEditable()&&(Sv(e),Tv(e))}),H)})(e,t)})),e.addCommand("forwardDelete",(()=>{((e,t)=>{jE(e,t,!0).fold((()=>{e.selection.isEditable()&&kv(e)}),H)})(e,t)}))},$E=e=>void 0===e.touches||1!==e.touches.length?F.none():F.some(e.touches[0]),qE=e=>{const t=Ir(),o=Lr(!1),n=Da((t=>{e.dispatch("longpress",{...t,type:"longpress"}),o.set(!0)}),400);e.on("touchstart",(e=>{$E(e).each((r=>{n.cancel();const s={x:r.clientX,y:r.clientY,target:e.target};n.throttle(e),o.set(!1),t.set(s)}))}),!0),e.on("touchmove",(r=>{n.cancel(),$E(r).each((n=>{t.on((r=>{((e,t)=>{const o=Math.abs(e.clientX-t.x),n=Math.abs(e.clientY-t.y);return o>5||n>5})(n,r)&&(t.clear(),o.set(!1),e.dispatch("longpresscancel"))}))}))}),!0),e.on("touchend touchcancel",(r=>{n.cancel(),"touchcancel"!==r.type&&t.get().filter((e=>e.target.isEqualNode(r.target))).each((()=>{o.get()?r.preventDefault():e.dispatch("tap",{...r,type:"tap"})}))}),!0)},GE=(e,t)=>Ee(e,t.nodeName),KE=(e,t)=>!!dr(t)||!!tr(t)&&!(GE(e.getBlockElements(),t)||Cu(t)||es(e,t)||zr(t)),YE=(e,t)=>{if(dr(t)){if(0===t.data.length)return!0;if(/^\s+$/.test(t.data))return!t.nextSibling||GE(e,t.nextSibling)||zr(t.nextSibling)}return!1},XE=e=>e.dom.create(sc(e),ac(e)),JE=e=>{const t=e.dom,o=e.selection,n=e.schema,r=n.getBlockElements(),s=o.getStart(),a=e.getBody();let i,l,c=null;const d=sc(e);if(!s||!tr(s))return;const m=a.nodeName.toLowerCase();if(!n.isValidChild(m,d.toLowerCase())||((e,t,o)=>W(Cf(wo.fromDom(o),wo.fromDom(t)),(t=>GE(e,t.dom))))(r,a,s))return;if(a.firstChild===a.lastChild&&fr(a.firstChild))return i=XE(e),i.appendChild(li().dom),a.replaceChild(i,a.firstChild),e.selection.setCursorLocation(i,0),void e.nodeChanged();let u=a.firstChild;for(;u;)if(tr(u)&&Yr(n,u),KE(n,u)){if(YE(r,u)){l=u,u=u.nextSibling,t.remove(l);continue}if(!i){if(!c&&e.hasFocus()&&(c=Uk(e.selection.getRng(),(()=>document.createElement("span")))),!u.parentNode){u=null;break}i=XE(e),a.insertBefore(i,u)}l=u,u=u.nextSibling,i.appendChild(l)}else i=null,u=u.nextSibling;c&&(e.selection.setRng(jk(c)),e.nodeChanged())},QE=(e,t,o)=>{const n=wo.fromDom(XE(e)),r=li();yn(n,r),o(t,n);const s=document.createRange();return s.setStartBefore(r.dom),s.setEndBefore(r.dom),s},eT=e=>t=>-1!==(" "+t.attr("class")+" ").indexOf(e),tT=(e,t,o)=>function(n){const r=arguments,s=r[r.length-2],a=s>0?t.charAt(s-1):"";if('"'===a)return n;if(">"===a){const e=t.lastIndexOf("<",s);if(-1!==e&&-1!==t.substring(e,s).indexOf('contenteditable="false"'))return n}return''+e.dom.encode("string"==typeof r[1]?r[1]:r[0])+""},oT=(e,t)=>re(e,(e=>{const o=t.match(e);return null!==o&&o[0].length===t.length})),nT=e=>{const t="contenteditable",o=" "+Lt.trim(Md(e))+" ",n=" "+Lt.trim(Dd(e))+" ",r=eT(o),s=eT(n),a=Nd(e);a.length>0&&e.on("BeforeSetContent",(t=>{((e,t,o)=>{let n=t.length,r=o.content;if("raw"!==o.format){for(;n--;)r=r.replace(t[n],tT(e,r,Dd(e)));o.content=r}})(e,a,t)})),e.parser.addAttributeFilter("class",(e=>{let o=e.length;for(;o--;){const n=e[o];r(n)?n.attr(t,"true"):s(n)&&n.attr(t,"false")}})),e.serializer.addAttributeFilter(t,(e=>{let o=e.length;for(;o--;){const n=e[o];if(!r(n)&&!s(n))continue;const i=n.attr("data-mce-content");a.length>0&&i?oT(a,i)?(n.name="#text",n.type=3,n.raw=!0,n.value=i):n.remove():n.attr(t,null)}}))},rT=(e,t)=>{t.hasAttribute("data-mce-caret")&&(Si(t),e.selection.setRng(e.selection.getRng()),e.selection.scrollIntoView(t))},sT=(e,t)=>{const o=(e=>on(wo.fromDom(e.getBody()),"*[data-mce-caret]").map((e=>e.dom)).getOrNull())(e);if(o)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void rT(e,o)):void(bi(o)&&(rT(e,o),e.undoManager.add()))},aT=yr,iT=(e,t,o)=>{const n=Gm(e.getBody()),r=N(Lm,1===t?n.next:n.prev);if(o.collapsed){const n=e.dom.getParent(o.startContainer,"PRE");if(!n)return;if(!r(ml.fromRangeStart(o))){const o=wo.fromDom((e=>{const t=e.dom.create(sc(e));return t.innerHTML='
    ',t})(e));1===t?vn(wo.fromDom(n),o):fn(wo.fromDom(n),o),e.selection.select(o.dom,!0),e.selection.collapse()}}},lT=(e,t)=>{const o=t?Im.Forwards:Im.Backwards,n=e.selection.getRng();return((e,t,o)=>tE(t,e,o,wf,xf,aT))(o,e,n).orThunk((()=>(iT(e,o,n),F.none())))},cT=(e,t)=>{const o=t?1:-1,n=e.selection.getRng();return((e,t,o)=>oE(t,e,o,(e=>wf(e)||bf(e)),(e=>xf(e)||yf(e)),aT))(o,e,n).orThunk((()=>(iT(e,o,n),F.none())))},dT=(e,t)=>lT(e,((e,t)=>{const o=t?e.getEnd(!0):e.getStart(!0);return vv(o)?!t:t})(e.selection,t)).exists((t=>(Q_(e,t),!0))),mT=(e,t)=>cT(e,t).exists((t=>(Q_(e,t),!0))),uT=(e,t)=>rE(e,t,t?xf:wf),gT=(e,t)=>Dk(e,!t).map((o=>{const n=o.toRange(),r=e.selection.getRng();return t?n.setStart(r.startContainer,r.startOffset):n.setEnd(r.endContainer,r.endOffset),n})).exists((t=>(Q_(e,t),!0))),hT=e=>j(["figcaption"],Wt(e)),pT=(e,t)=>{const o=wo.fromDom(e.getBody()),n=ml.fromRangeStart(e.selection.getRng());return((e,t,o)=>{const n=N(ko,t);return Jo(wo.fromDom(e.container()),(e=>o.isBlock(Wt(e))),n).filter(hT)})(n,o,e.schema).exists((()=>{if(((e,t,o)=>t?I_(e.dom,o):H_(e.dom,o))(o,t,n)){const n=QE(e,o,t?yn:bn);return e.selection.setRng(n),!0}return!1}))},fT=(e,t)=>!!e.selection.isCollapsed()&&pT(e,t),vT=(e,t)=>t?F.from(e.dom.getParent(e.selection.getNode(),"details")).map((t=>((e,t)=>{const o=e.selection.getRng(),n=ml.fromRangeStart(o);return!(e.getBody().lastChild!==t||!I_(t,n)||(e.execCommand("InsertNewBlockAfter"),0))})(e,t))).getOr(!1):F.from(e.dom.getParent(e.selection.getNode(),"summary")).bind((t=>F.from(e.dom.getParent(t,"details")).map((o=>((e,t,o)=>{const n=e.selection.getRng(),r=ml.fromRangeStart(n);return!(e.getBody().firstChild!==t||!H_(o,r)||(e.execCommand("InsertNewBlockBefore"),0))})(e,o,t))))).getOr(!1),bT=(e,t)=>vT(e,t),yT={shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0},wT=(e,t)=>t.keyCode===e.keyCode&&t.shiftKey===e.shiftKey&&t.altKey===e.altKey&&t.ctrlKey===e.ctrlKey&&t.metaKey===e.metaKey,xT=(e,t)=>ne((e=>$(e,(e=>({...yT,...e}))))(e),(e=>wT(e,t)?[e]:[])),CT=(e,t)=>ne((e=>$(e,(e=>({...yT,...e}))))(e),(e=>wT(e,t)?[e]:[])),ST=(e,...t)=>()=>e.apply(null,t),kT=(e,t)=>ee(xT(e,t),(e=>e.action())),_T=(e,t)=>ge(CT(e,t),(e=>e.action())),ET=(e,t)=>{const o=t?Im.Forwards:Im.Backwards,n=e.selection.getRng();return tE(e,o,n,ff,vf,Cr).exists((t=>(Q_(e,t),!0)))},TT=(e,t)=>{const o=t?1:-1,n=e.selection.getRng();return oE(e,o,n,ff,vf,Cr).exists((t=>(Q_(e,t),!0)))},OT=(e,t)=>rE(e,t,t?vf:ff),AT=Il([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),DT={...AT,none:e=>AT.none(e)},MT=(e,t,o)=>ne(Ho(e),(e=>Co(e,t)?o(e)?[e]:[]:MT(e,t,o))),NT=(e,t)=>((e,t,o=I)=>o(t)?F.none():j(e,Wt(t))?F.some(t):tn(t,e.join(","),(e=>Co(e,"table")||o(e))))(["td","th"],e,t),RT=e=>MT(e,"th,td",P),BT=(e,t)=>nn(e,"table",t),LT=(e,t,o,n,r=P)=>{const s=1===n;if(!s&&o<=0)return DT.first(e[0]);if(s&&o>=e.length-1)return DT.last(e[e.length-1]);{const s=o+n,a=e[s];return r(a)?DT.middle(t,a):LT(e,t,s,n,r)}},HT=(e,t)=>BT(e,t).bind((t=>{const o=RT(t);return te(o,(t=>ko(e,t))).map((e=>({index:e,all:o})))})),IT=e=>{return(t=e,Xa.getOption(t)).filter((e=>0!==e.trim().length||e.indexOf(qn)>-1)).isSome();var t},PT=["img","br"],FT=e=>IT(e)||j(PT,Wt(e))||(e=>Gt(e)&&"false"===no(e,"contenteditable"))(e),zT=(e,t,o,n,r)=>{const s=Vn(wo.fromDom(o),"td,th,caption").map((e=>e.dom)),a=Y(((e,t)=>ne(t,(t=>{const o=((e,t)=>({left:e.left-t,top:e.top-t,right:e.right+2*t,bottom:e.bottom+2*t,width:e.width+t,height:e.height+t}))(Ei(t.getBoundingClientRect()),-1);return[{x:o.left,y:e(o),cell:t},{x:o.right,y:e(o),cell:t}]})))(e,s),(e=>t(e,r)));return((e,t,o)=>J(e,((e,n)=>e.fold((()=>F.some(n)),(e=>{const r=Math.sqrt(Math.abs(e.x-t)+Math.abs(e.y-o)),s=Math.sqrt(Math.abs(n.x-t)+Math.abs(n.y-o));return F.some(se.cell))},VT=N(zT,(e=>e.bottom),((e,t)=>e.ye.top),((e,t)=>e.y>t)),UT=(e,t)=>de(t.getClientRects()).bind((t=>VT(e,t.left,t.top))).bind((e=>{return M_(au(o=e).map((e=>N_(o,e).positions.concat(e))).getOr([]),t);var o})),jT=(e,t)=>me(t.getClientRects()).bind((t=>ZT(e,t.left,t.top))).bind((e=>{return M_(su(o=e).map((e=>[e].concat(R_(o,e).positions))).getOr([]),t);var o})),WT=(e,t,o)=>{const n=e(t,o);return(e=>e.breakType===k_.Wrap&&0===e.positions.length)(n)||!fr(o.getNode())&&(e=>e.breakType===k_.Br&&1===e.positions.length)(n)?!((e,t,o)=>o.breakAt.exists((o=>e(t,o).breakAt.isSome())))(e,t,n):n.breakAt.isNone()},$T=N(WT,N_),qT=N(WT,R_),GT=(e,t,o,n)=>{const r=e.selection.getRng(),s=t?1:-1;return!(!im()||!((e,t,o)=>{const n=ml.fromRangeStart(t);return ou(!e,o).exists((e=>e.isEqual(n)))})(t,r,o)||(Sk(s,e,o,!t,!1).each((t=>{Q_(e,t)})),0))},KT=(e,t)=>{const o=t.getNode(e);return ir(o)?F.some(o):F.none()},YT=(e,t,o)=>{const n=KT(!!t,o),r=!1===t;n.fold((()=>Q_(e,o.toRange())),(n=>ou(r,e.getBody()).filter((e=>e.isEqual(o))).fold((()=>Q_(e,o.toRange())),(o=>((e,t,o)=>{t.undoManager.transact((()=>{const n=e?vn:fn,r=QE(t,wo.fromDom(o),n);Q_(t,r)}))})(t,e,n)))))},XT=(e,t,o,n)=>{const r=e.selection.getRng(),s=ml.fromRangeStart(r),a=e.getBody();if(!t&&$T(n,s)){const n=((e,t,o)=>UT(t,o).orThunk((()=>de(o.getClientRects()).bind((o=>D_(B_(e,ml.before(t)),o.left))))).getOr(ml.before(t)))(a,o,s);return YT(e,t,n),!0}if(t&&qT(n,s)){const n=((e,t,o)=>jT(t,o).orThunk((()=>de(o.getClientRects()).bind((o=>D_(L_(e,ml.after(t)),o.left))))).getOr(ml.after(t)))(a,o,s);return YT(e,t,n),!0}return!1},JT=(e,t,o)=>F.from(e.dom.getParent(e.selection.getNode(),"td,th")).bind((n=>F.from(e.dom.getParent(n,"table")).map((r=>o(e,t,r,n))))).getOr(!1),QT=(e,t)=>JT(e,t,GT),eO=(e,t)=>JT(e,t,XT),tO=(e,t,o)=>o.fold(F.none,F.none,((e,t)=>{return(o=t,en(o,FT)).map((e=>(e=>{const t=sh.exact(e,0,e,0);return dh(t)})(e)));var o}),(o=>(e.execCommand("mceTableInsertRowAfter"),oO(e,t,o)))),oO=(e,t,o)=>tO(e,t,((e,t,o)=>HT(e,o).fold((()=>DT.none(e)),(o=>LT(o.all,e,o.index,1,t))))(o,rn)),nO=(e,t,o)=>tO(e,t,((e,t,o)=>HT(e,o).fold((()=>DT.none()),(o=>LT(o.all,e,o.index,-1,t))))(o,rn)),rO=(e,t)=>{const o=["table","li","dl"],n=wo.fromDom(e.getBody()),r=e=>{const t=Wt(e);return ko(e,n)||j(o,t)},s=e.selection.getRng(),a=wo.fromDom(t?s.endContainer:s.startContainer);return NT(a,r).map((o=>(BT(o,r).each((t=>{e.model.table.clearSelectedCells(t.dom)})),e.selection.collapse(!t),(t?oO:nO)(e,r,o).each((t=>{e.selection.setRng(t)})),!0))).getOr(!1)},sO=(e,t)=>{e.on("keydown",(o=>{o.isDefaultPrevented()||((e,t,o)=>{const n=Mt.os.isMacOS()||Mt.os.isiOS();kT([{keyCode:Vg.RIGHT,action:ST(dT,e,!0)},{keyCode:Vg.LEFT,action:ST(dT,e,!1)},{keyCode:Vg.UP,action:ST(mT,e,!1)},{keyCode:Vg.DOWN,action:ST(mT,e,!0)},...n?[{keyCode:Vg.UP,action:ST(gT,e,!1),metaKey:!0,shiftKey:!0},{keyCode:Vg.DOWN,action:ST(gT,e,!0),metaKey:!0,shiftKey:!0}]:[],{keyCode:Vg.RIGHT,action:ST(QT,e,!0)},{keyCode:Vg.LEFT,action:ST(QT,e,!1)},{keyCode:Vg.UP,action:ST(eO,e,!1)},{keyCode:Vg.DOWN,action:ST(eO,e,!0)},{keyCode:Vg.UP,action:ST(eO,e,!1)},{keyCode:Vg.UP,action:ST(bT,e,!1)},{keyCode:Vg.DOWN,action:ST(bT,e,!0)},{keyCode:Vg.RIGHT,action:ST(ET,e,!0)},{keyCode:Vg.LEFT,action:ST(ET,e,!1)},{keyCode:Vg.UP,action:ST(TT,e,!1)},{keyCode:Vg.DOWN,action:ST(TT,e,!0)},{keyCode:Vg.RIGHT,action:ST(dE,e,t,!0)},{keyCode:Vg.LEFT,action:ST(dE,e,t,!1)},{keyCode:Vg.RIGHT,ctrlKey:!n,altKey:n,action:ST(gE,e,t)},{keyCode:Vg.LEFT,ctrlKey:!n,altKey:n,action:ST(hE,e,t)},{keyCode:Vg.UP,action:ST(fT,e,!1)},{keyCode:Vg.DOWN,action:ST(fT,e,!0)}],o).each((e=>{o.preventDefault()}))})(e,t,o)}))},aO=(e,t)=>({container:e,offset:t}),iO=xa.DOM,lO=e=>t=>e===t?-1:0,cO=(e,t,o)=>{if(dr(e)&&t>=0)return F.some(aO(e,t));{const n=Ya(iO);return F.from(n.backwards(e,t,lO(e),o)).map((e=>aO(e.container,e.container.data.length)))}},dO=(e,t,o)=>{if(!dr(e))return F.none();const n=e.data;if(t>=0&&t<=n.length)return F.some(aO(e,t));{const n=Ya(iO);return F.from(n.backwards(e,t,lO(e),o)).bind((e=>{const n=e.container.data;return dO(e.container,t+n.length,o)}))}},mO=(e,t,o)=>{if(!dr(e))return F.none();const n=e.data;if(t<=n.length)return F.some(aO(e,t));{const r=Ya(iO);return F.from(r.forwards(e,t,lO(e),o)).bind((e=>mO(e.container,t-n.length,o)))}},uO=(e,t,o,n,r)=>{const s=Ya(e,(e=>t=>e.isBlock(t)||j(["BR","IMG","HR","INPUT"],t.nodeName)||"false"===e.getContentEditable(t))(e));return F.from(s.backwards(t,o,n,r))},gO=e=>""!==e&&-1!=="  \f\n\r\t\v".indexOf(e),hO=(e,t)=>e.substring(t.length),pO=(e,t,o,n=!1)=>{if(!(r=t).collapsed||!dr(r.startContainer))return F.none();var r;const s={text:"",offset:0},a=e.getParent(t.startContainer,e.isBlock)||e.getRoot();return uO(e,t.startContainer,t.startOffset,((e,t,r)=>(s.text=r+s.text,s.offset+=t,((e,t,o,n=!1)=>{let r;const s=o.charAt(0);for(r=t-1;r>=0;r--){const a=e.charAt(r);if(!n&&gO(a))return F.none();if(s===a&&je(e,o,r,t))break}return F.some(r)})(s.text,s.offset,o,n).getOr(t))),a).bind((e=>{const n=t.cloneRange();if(n.setStart(e.container,e.offset),n.setEnd(t.endContainer,t.endOffset),n.collapsed)return F.none();const r=(e=>ui(e.toString().replace(/\u00A0/g," ")))(n);return 0!==r.lastIndexOf(o)?F.none():F.some({text:hO(r,o),range:n,trigger:o})}))},fO=e=>{if((e=>3===e.nodeType)(e))return aO(e,e.data.length);{const t=e.childNodes;return t.length>0?fO(t[t.length-1]):aO(e,t.length)}},vO=(e,t)=>{const o=e.childNodes;return o.length>0&&t0&&(e=>1===e.nodeType)(e)&&o.length===t?fO(o[o.length-1]):aO(e,t)},bO=e=>t=>{const o=vO(t.startContainer,t.startOffset);return!((e,t)=>{var o;const n=null!==(o=e.getParent(t.container,e.isBlock))&&void 0!==o?o:e.getRoot();return uO(e,t.container,t.offset,((e,t)=>0===t?-1:t),n).filter((e=>{const t=e.container.data.charAt(e.offset-1);return!gO(t)})).isSome()})(e,o)},yO=(e,t)=>{const o=t(),n=e.selection.getRng();return((e,t,o)=>ge(o.triggers,(o=>pO(e,t,o))))(e.dom,n,o).bind((o=>wO(e,t,o)))},wO=(e,t,o,n={})=>{var r;const s=t(),a=null!==(r=e.selection.getRng().startContainer.nodeValue)&&void 0!==r?r:"",i=Y(s.lookupByTrigger(o.trigger),(t=>o.text.length>=t.minChars&&t.matches.getOrThunk((()=>bO(e.dom)))(o.range,a,o.text)));if(0===i.length)return F.none();const l=Promise.all($(i,(e=>e.fetch(o.text,e.maxResults,n).then((t=>({matchText:o.text,items:t,columns:e.columns,onAction:e.onAction,highlightOn:e.highlightOn}))))));return F.some({lookupData:l,context:o})};var xO;!function(e){e[e.Error=0]="Error",e[e.Value=1]="Value"}(xO||(xO={}));const CO=(e,t,o)=>e.stype===xO.Error?t(e.serror):o(e.svalue),SO=e=>({stype:xO.Value,svalue:e}),kO=e=>({stype:xO.Error,serror:e}),_O=e=>CO(e,Hl.error,Hl.value),EO=SO,TO=e=>{const t=[],o=[];return q(e,(e=>{CO(e,(e=>o.push(e)),(e=>t.push(e)))})),{values:t,errors:o}},OO=kO,AO=(e,t)=>e.stype===xO.Error?t(e.serror):e,DO=(e,t)=>e.stype===xO.Value?{stype:xO.Value,svalue:t(e.svalue)}:e,MO=(e,t)=>e.stype===xO.Error?{stype:xO.Error,serror:t(e.serror)}:e,NO=CO,RO=e=>p(e)&&pe(e).length>100?" removed due to size":JSON.stringify(e,null,2),BO=(e,t)=>OO([{path:e,getErrorInfo:t}]),LO=(e,t,o,n)=>_e(o,n).fold((()=>((e,t,o)=>BO(e,(()=>'The chosen schema: "'+o+'" did not exist in branches: '+RO(t))))(e,o,n)),(o=>o.extract(e.concat(["branch: "+n]),t))),HO=(e,t)=>({extract:(o,n)=>_e(n,e).fold((()=>((e,t)=>BO(e,(()=>'Choice schema did not contain choice key: "'+t+'"')))(o,e)),(e=>LO(o,n,t,e))),toString:()=>"chooseOn("+e+"). Possible values: "+pe(t)}),IO=e=>(...t)=>{if(0===t.length)throw new Error("Can't merge zero objects");const o={};for(let n=0;nf(e)&&f(t)?PO(e,t):t)),FO=IO(((e,t)=>t)),zO=e=>({tag:"defaultedThunk",process:A(e)}),VO=e=>T(OO,oe)(e),ZO=e=>{const t=TO(e);return t.errors.length>0?VO(t.errors):EO(t.values)},UO=(e,t,o)=>{switch(e.tag){case"field":return t(e.key,e.newKey,e.presence,e.prop);case"custom":return o(e.newKey,e.instantiator)}},jO=e=>({extract:(t,o)=>AO(e(o),(e=>((e,t)=>BO(e,A(t)))(t,e))),toString:A("val")}),WO=jO(EO),$O=(e,t,o,n)=>_e(t,o).fold((()=>((e,t,o)=>BO(e,(()=>'Could not find valid *required* value for "'+t+'" in '+RO(o))))(e,o,t)),n),qO=(e,t,o,n)=>n(_e(e,t).getOrThunk((()=>o(e)))),GO=(e,t,o,n,r)=>{const s=e=>r.extract(t.concat([n]),e),a=e=>e.fold((()=>EO(F.none())),(e=>{const o=r.extract(t.concat([n]),e);return DO(o,F.some)}));switch(e.tag){case"required":return $O(t,o,n,s);case"defaultedThunk":return qO(o,n,e.process,s);case"option":return((e,t,o)=>o(_e(e,t)))(o,n,a);case"defaultedOptionThunk":return((e,t,o,n)=>n(_e(e,t).map((t=>!0===t?o(e):t))))(o,n,e.process,a);case"mergeWithThunk":return qO(o,n,A({}),(t=>{const n=PO(e.process(o),t);return s(n)}))}},KO=e=>({extract:(t,o)=>((e,t,o)=>{const n={},r=[];for(const s of o)UO(s,((o,s,a,i)=>{const l=GO(a,e,t,o,i);NO(l,(e=>{r.push(...e)}),(e=>{n[s]=e}))}),((e,o)=>{n[e]=o(t)}));return r.length>0?OO(r):EO(n)})(t,o,e),toString:()=>{const t=$(e,(e=>UO(e,((e,t,o,n)=>e+" -> "+n.toString()),((e,t)=>"state("+e+")"))));return"obj{\n"+t.join("\n")+"}"}}),YO=e=>({extract:(t,o)=>{const n=$(o,((o,n)=>e.extract(t.concat(["["+n+"]"]),o)));return ZO(n)},toString:()=>"array("+e.toString()+")"}),XO=(e,t,o)=>_O(((e,t,o)=>{const n=t.extract([e],o);return MO(n,(e=>({input:o,errors:e})))})(e,t,o)),JO=e=>"Errors: \n"+(e=>{const t=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:A("... (only showing first ten failures)")}]):e;return $(t,(e=>"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()))})(e.errors).join("\n")+"\n\nInput object: "+RO(e.input),QO=(e,t)=>HO(e,be(t,KO)),eA=A(WO),tA=(e,t)=>jO((o=>{const n=typeof o;return e(o)?EO(o):OO(`Expected type: ${t} but got: ${n}`)})),oA=tA(k,"number"),nA=tA(h,"string"),rA=tA(y,"boolean"),sA=tA(S,"function"),aA=(e,t,o,n)=>({tag:"field",key:e,newKey:t,presence:o,prop:n}),iA=(e,t)=>({tag:"custom",newKey:e,instantiator:t}),lA=e=>{return t=t=>j(e,t)?Hl.value(t):Hl.error(`Unsupported value: "${t}", choose one of "${e.join(", ")}".`),jO((e=>t(e).fold(OO,EO)));var t},cA=(e,t)=>aA(e,e,{tag:"required",process:{}},t),dA=e=>cA(e,nA),mA=e=>cA(e,sA),uA=(e,t)=>aA(e,e,{tag:"option",process:{}},t),gA=e=>uA(e,nA),hA=(e,t,o)=>aA(e,e,zO(t),o),pA=(e,t)=>hA(e,t,oA),fA=(e,t,o)=>hA(e,t,lA(o)),vA=(e,t)=>hA(e,t,rA),bA=(e,t)=>hA(e,t,sA),yA=dA("type"),wA=mA("fetch"),xA=mA("onAction"),CA=bA("onSetup",(()=>E)),SA=gA("text"),kA=gA("icon"),_A=gA("tooltip"),EA=gA("label"),TA=vA("active",!1),OA=vA("enabled",!0),AA=vA("primary",!1),DA=e=>((e,t)=>hA(e,t,nA))("type",e),MA=KO([yA,dA("trigger"),pA("minChars",1),(RA=1,((e,t)=>aA(e,e,zO(t),eA()))("columns",RA)),pA("maxResults",10),(NA="matches",uA(NA,sA)),wA,xA,((e,t,o)=>hA(e,t,YO(o)))("highlightOn",[],nA)]);var NA,RA;const BA=[OA,_A,kA,SA,CA],LA=[TA].concat(BA),HA=[bA("predicate",I),fA("scope","node",["node","editor"]),fA("position","selection",["node","selection","line"])],IA=BA.concat([DA("contextformbutton"),AA,xA,iA("original",D)]),PA=LA.concat([DA("contextformbutton"),AA,xA,iA("original",D)]),FA=BA.concat([DA("contextformbutton")]),zA=LA.concat([DA("contextformtogglebutton")]),VA=QO("type",{contextformbutton:IA,contextformtogglebutton:PA});KO([DA("contextform"),bA("initValue",A("")),EA,((e,t)=>aA(e,e,{tag:"required",process:{}},YO(t)))("commands",VA),uA("launch",QO("type",{contextformbutton:FA,contextformtogglebutton:zA}))].concat(HA));const ZA=e=>{const t=e.ui.registry.getAll().popups,o=be(t,(e=>{return(t=e,XO("Autocompleter",MA,t)).fold((e=>{throw new Error(JO(e))}),D);var t})),n=Oe(Se(o,(e=>e.trigger))),r=ke(o);return{dataset:o,triggers:n,lookupByTrigger:e=>Y(r,(t=>t.trigger===e))}},UA=e=>{const t=Ir(),o=Lr(!1),n=t.isSet,r=()=>{n()&&((e=>{e.dispatch("AutocompleterEnd")})(e),o.set(!1),t.clear())},s=Ie((()=>ZA(e))),a=a=>{(o=>t.get().map((t=>pO(e.dom,e.selection.getRng(),t.trigger,!0).bind((t=>wO(e,s,t,o))))).getOrThunk((()=>yO(e,s))))(a).fold(r,(r=>{(e=>{n()||t.set({trigger:e.trigger,matchLength:e.text.length})})(r.context),r.lookupData.then((n=>{t.get().map((s=>{const a=r.context;s.trigger===a.trigger&&(t.set({...s,matchLength:a.text.length}),o.get()?(Fg(e,{range:a.range}),((e,t)=>{e.dispatch("AutocompleterUpdate",t)})(e,{lookupData:n})):(o.set(!0),Fg(e,{range:a.range}),((e,t)=>{e.dispatch("AutocompleterStart",t)})(e,{lookupData:n})))}))}))}))},i=()=>t.get().bind((({trigger:t})=>{const n=e.selection.getRng();return pO(e.dom,n,t,o.get()).filter((({range:e})=>((e,t)=>{const o=e.compareBoundaryPoints(window.Range.START_TO_START,t),n=e.compareBoundaryPoints(window.Range.END_TO_END,t);return o>=0&&n<=0})(n,e))).map((({range:e})=>e))}));e.addCommand("mceAutocompleterReload",((e,t)=>{const o=p(t)?t.fetchOptions:{};a(o)})),e.addCommand("mceAutocompleterClose",r),e.addCommand("mceAutocompleterRefreshActiveRange",(()=>{i().each((t=>{Fg(e,{range:t})}))})),e.editorCommands.addQueryStateHandler("mceAutoCompleterInRange",(()=>i().isSome())),((e,t)=>{const o=Da(t.load,50);e.on("input",(t=>{("insertCompositionText"!==t.inputType||e.composing)&&o.throttle()})),e.on("keydown",(e=>{const n=e.which;8===n?o.throttle():27===n?(o.cancel(),t.cancelIfNecessary()):38!==n&&40!==n||o.cancel()}),!0),e.on("remove",o.cancel)})(e,{cancelIfNecessary:r,load:a})},jA=kt().browser.isSafari(),WA=e=>ci(wo.fromDom(e)),$A=(e,t)=>{var o;return 0===e.startOffset&&e.endOffset===(null===(o=t.textContent)||void 0===o?void 0:o.length)},qA=(e,t)=>F.from(e.getParent(t.container(),"details")),GA=(e,t)=>qA(e,t).isSome(),KA=(e,t)=>t.startSummary.exists((t=>((e,t)=>su(t).exists((t=>t.isEqual(e))))(e,t))),YA=(e,t)=>t.startSummary.exists((t=>((e,t)=>au(t).exists((o=>fr(o.getNode())&&ru(t,o).exists((t=>t.isEqual(e)))||o.isEqual(e))))(e,t))),XA=(e,t)=>{const o=t.getNode();w(o)||e.selection.setCursorLocation(o,t.offset())},JA=(e,t,o)=>{const n=e.dom.getParent(t.container(),"details");if(n&&!n.open){const t=e.dom.select("summary",n)[0];t&&(o?su(t):au(t)).each((t=>XA(e,t)))}else XA(e,t)},QA=(e,t,o)=>{const{dom:n,selection:r}=e,s=e.getBody();if("character"===o){const o=ml.fromRangeStart(r.getRng()),a=n.getParent(o.container(),n.isBlock),i=qA(n,o),l=a&&n.isEmpty(a),c=b(null==a?void 0:a.previousSibling),d=b(null==a?void 0:a.nextSibling);return!!(l&&(t?d:c)&&eu(!t,s,o).exists((e=>GA(n,e)&&!It(i,qA(n,e)))))||eu(t,s,o).fold(I,(o=>{const r=qA(n,o);if(GA(n,o)&&!It(i,r)){if(t||JA(e,o,!1),a&&l){if(t&&c)return!0;if(!t&&d)return!0;JA(e,o,t),e.dom.remove(a)}return!0}return!1}))}return!1},eD=(e,t,o,n)=>{const r=e.selection.getRng(),s=ml.fromRangeStart(r),a=e.getBody();return"selection"===n?((e,t)=>{const o=t.startSummary.exists((t=>t.contains(e.startContainer))),n=t.startSummary.exists((t=>t.contains(e.endContainer))),r=t.startDetails.forall((e=>t.endDetails.forall((t=>e!==t))));return(o||n)&&!(o&&n)||r})(r,t):o?YA(s,t)||((e,t,o)=>o.startDetails.exists((o=>nu(e,t).forall((e=>!o.contains(e.container()))))))(a,s,t):KA(s,t)||((e,t)=>t.startDetails.exists((o=>ru(o,e).forall((o=>t.startSummary.exists((t=>!t.contains(e.container())&&t.contains(o.container()))))))))(s,t)},tD=(e,t,o)=>((e,t)=>{const o=F.from(e.getParent(t.startContainer,"details")),n=F.from(e.getParent(t.endContainer,"details"));if(o.isSome()||n.isSome()){const t=o.bind((t=>F.from(e.select("summary",t)[0])));return F.some({startSummary:t,startDetails:o,endDetails:n})}return F.none()})(e.dom,e.selection.getRng()).fold((()=>QA(e,t,o)),(n=>eD(e,n,t,o)||QA(e,t,o))),oD=(e,t,o)=>{const n=e.selection,r=n.getNode(),s=n.getRng(),a=ml.fromRangeStart(s);return!!_r(r)&&("selection"===o&&$A(s,r)||Ov(t,a,r)?WA(r):e.undoManager.transact((()=>{const s=n.getSel();let{anchorNode:a,anchorOffset:i,focusNode:l,focusOffset:c}=null!=s?s:{};const d=()=>{C(a)&&C(i)&&C(l)&&C(c)&&(null==s||s.setBaseAndExtent(a,i,l,c))},m=(e,t)=>{q(e.childNodes,(e=>{Fu(e)&&t.appendChild(e)}))},u=e.dom.create("span",{"data-mce-bogus":"1"});m(r,u),r.appendChild(u),d(),"word"!==o&&"line"!==o||null==s||s.modify("extend",t?"right":"left",o),!n.isCollapsed()&&$A(n.getRng(),u)?WA(r):(e.execCommand(t?"ForwardDelete":"Delete"),a=null==s?void 0:s.anchorNode,i=null==s?void 0:s.anchorOffset,l=null==s?void 0:s.focusNode,c=null==s?void 0:s.focusOffset,m(u,r),d()),e.dom.remove(u)})),!0)},nD=(e,t,o)=>tD(e,t,o)||jA&&oD(e,t,o)?F.some(E):F.none(),rD=e=>(t,o,n={})=>{const r=t.getBody(),s={bubbles:!0,composed:!0,data:null,isComposing:!1,detail:0,view:null,target:r,currentTarget:r,eventPhase:Event.AT_TARGET,originalTarget:r,explicitOriginalTarget:r,isTrusted:!1,srcElement:r,cancelable:!1,preventDefault:E,inputType:o},a=ra(new InputEvent(e));return t.dispatch(e,{...a,...s,...n})},sD=rD("input"),aD=rD("beforeinput"),iD=kt(),lD=iD.os,cD=lD.isMacOS()||lD.isiOS(),dD=iD.browser.isFirefox(),mD=(e,t)=>{let o=!1;e.on("keydown",(n=>{o=n.keyCode===Vg.BACKSPACE,n.isDefaultPrevented()||((e,t,o)=>{const n=o.keyCode===Vg.BACKSPACE?"deleteContentBackward":"deleteContentForward",r=e.selection.isCollapsed(),s=r?"character":"selection",a=e=>r?e?"word":"line":"selection";_T([{keyCode:Vg.BACKSPACE,action:ST(UE,e)},{keyCode:Vg.BACKSPACE,action:ST(zk,e,!1)},{keyCode:Vg.DELETE,action:ST(zk,e,!0)},{keyCode:Vg.BACKSPACE,action:ST(Ak,e,!1)},{keyCode:Vg.DELETE,action:ST(Ak,e,!0)},{keyCode:Vg.BACKSPACE,action:ST(yE,e,t,!1)},{keyCode:Vg.DELETE,action:ST(yE,e,t,!0)},{keyCode:Vg.BACKSPACE,action:ST(ib,e,!1)},{keyCode:Vg.DELETE,action:ST(ib,e,!0)},{keyCode:Vg.BACKSPACE,action:ST(nD,e,!1,s)},{keyCode:Vg.DELETE,action:ST(nD,e,!0,s)},...cD?[{keyCode:Vg.BACKSPACE,altKey:!0,action:ST(nD,e,!1,a(!0))},{keyCode:Vg.DELETE,altKey:!0,action:ST(nD,e,!0,a(!0))},{keyCode:Vg.BACKSPACE,metaKey:!0,action:ST(nD,e,!1,a(!1))}]:[{keyCode:Vg.BACKSPACE,ctrlKey:!0,action:ST(nD,e,!1,a(!0))},{keyCode:Vg.DELETE,ctrlKey:!0,action:ST(nD,e,!0,a(!0))}],{keyCode:Vg.BACKSPACE,action:ST($k,e,!1)},{keyCode:Vg.DELETE,action:ST($k,e,!0)},{keyCode:Vg.BACKSPACE,action:ST(LE,e,!1)},{keyCode:Vg.DELETE,action:ST(LE,e,!0)},{keyCode:Vg.BACKSPACE,action:ST(Ck,e,!1)},{keyCode:Vg.DELETE,action:ST(Ck,e,!0)},{keyCode:Vg.BACKSPACE,action:ST(bk,e,!1)},{keyCode:Vg.DELETE,action:ST(bk,e,!0)},{keyCode:Vg.BACKSPACE,action:ST(ME,e,!1)},{keyCode:Vg.DELETE,action:ST(ME,e,!0)},{keyCode:Vg.BACKSPACE,action:ST(Wk,e,!1)},{keyCode:Vg.DELETE,action:ST(Wk,e,!0)}],o).filter((t=>e.selection.isEditable())).each((t=>{o.preventDefault(),aD(e,n).isDefaultPrevented()||(t(),sD(e,n))}))})(e,t,n)})),e.on("keyup",(t=>{t.isDefaultPrevented()||((e,t,o)=>{kT([{keyCode:Vg.BACKSPACE,action:ST(Fk,e)},{keyCode:Vg.DELETE,action:ST(Fk,e)},...cD?[{keyCode:Vg.BACKSPACE,altKey:!0,action:ST(RE,e)},{keyCode:Vg.DELETE,altKey:!0,action:ST(RE,e)},...o?[{keyCode:dD?224:91,action:ST(RE,e)}]:[]]:[{keyCode:Vg.BACKSPACE,ctrlKey:!0,action:ST(RE,e)},{keyCode:Vg.DELETE,ctrlKey:!0,action:ST(RE,e)}]],t)})(e,t,o),o=!1}))},uD=(e,t)=>{const o=e.dom,n=e.schema.getMoveCaretBeforeOnEnterElements();if(!t)return;if(/^(LI|DT|DD)$/.test(t.nodeName)){const e=(e=>{for(;e;){if(tr(e)||dr(e)&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}return null})(t.firstChild);e&&/^(UL|OL|DL)$/.test(e.nodeName)&&t.insertBefore(o.doc.createTextNode(qn),t.firstChild)}const r=o.createRng();if(t.normalize(),t.hasChildNodes()){const e=new Wn(t,t);let o,s=t;for(;o=e.current();){if(dr(o)){r.setStart(o,0),r.setEnd(o,0);break}if(n[o.nodeName.toLowerCase()]){r.setStartBefore(o),r.setEndBefore(o);break}s=o,o=e.next()}o||(r.setStart(s,0),r.setEnd(s,0))}else fr(t)?t.nextSibling&&o.isBlock(t.nextSibling)?(r.setStartBefore(t),r.setEndBefore(t)):(r.setStartAfter(t),r.setEndAfter(t)):(r.setStart(t,0),r.setEnd(t,0));e.selection.setRng(r),Wh(e,r)},gD=(e,t)=>{const o=e.getRoot();let n,r=t;for(;r!==o&&r&&"false"!==e.getContentEditable(r);){if("true"===e.getContentEditable(r)){n=r;break}r=r.parentNode}return r!==o?n:o},hD=e=>F.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock)),pD=e=>{e.innerHTML='
    '},fD=(e,t)=>{sc(e).toLowerCase()===t.tagName.toLowerCase()&&((e,t,o)=>{const n=e.dom;F.from(o.style).map(n.parseStyle).each((e=>{const o={...hn(wo.fromDom(t)),...e};n.setStyles(t,o)}));const r=F.from(o.class).map((e=>e.split(/\s+/))),s=F.from(t.className).map((e=>Y(e.split(/\s+/),(e=>""!==e))));Pt(r,s,((e,o)=>{const r=Y(o,(t=>!j(e,t))),s=[...e,...r];n.setAttrib(t,"class",s.join(" "))}));const a=["style","class"],i=Ce(o,((e,t)=>!j(a,t)));n.setAttribs(t,i)})(e,t,ac(e))},vD=(e,t,o,n,r=!0,s,a)=>{const i=e.dom,l=e.schema,c=sc(e),d=o?o.nodeName.toUpperCase():"";let m=t;const u=l.getTextInlineElements();let g;g=s||"TABLE"===d||"HR"===d?i.create(s||c,a||{}):o.cloneNode(!1);let h=g;if(r){do{if(u[m.nodeName]){if(lu(m)||Cu(m))continue;const e=m.cloneNode(!1);i.setAttrib(e,"id",""),g.hasChildNodes()?(e.appendChild(g.firstChild),g.appendChild(e)):(h=e,g.appendChild(e))}}while((m=m.parentNode)&&m!==n)}else i.setAttrib(g,"style",null),i.setAttrib(g,"class",null);return fD(e,g),pD(h),g},bD=(e,t,o)=>!t&&o.nodeName.toLowerCase()===sc(e)&&e.dom.isEmpty(o)&&((e,t,o)=>{let n=t;for(;n&&n!==e&&b(n.nextSibling);){const e=n.parentElement;if(!e||!o(e))return kr(e);n=e}return!1})(e.getBody(),o,(t=>Ee(e.schema.getTextBlockElements(),t.nodeName.toLowerCase()))),yD=(e,t,o)=>{var n,r,s;const a=t(sc(e)),i=((e,t)=>e.dom.getParent(t,kr))(e,o);i&&(e.dom.insertAfter(a,i),uD(e,a),(null!==(s=null===(r=null===(n=o.parentElement)||void 0===n?void 0:n.childNodes)||void 0===r?void 0:r.length)&&void 0!==s?s:0)>1&&e.dom.remove(o))},wD=(e,t)=>{const o=null==e?void 0:e.parentNode;return C(o)&&o.nodeName===t},xD=e=>C(e)&&/^(OL|UL|LI)$/.test(e.nodeName),CD=e=>C(e)&&/^(LI|DT|DD)$/.test(e.nodeName),SD=e=>{const t=e.parentNode;return CD(t)?t:e},kD=(e,t,o)=>{let n=e[o?"firstChild":"lastChild"];for(;n&&!tr(n);)n=n[o?"nextSibling":"previousSibling"];return n===t},_D=e=>J(Se(hn(wo.fromDom(e)),((e,t)=>`${t}: ${e};`)),((e,t)=>e+t),""),ED=(e,t,o,n,r)=>{const s=e.dom,a=e.selection.getRng(),i=o.parentNode;if(o===e.getBody()||!i)return;var l;xD(l=o)&&xD(l.parentNode)&&(r="LI");const c=CD(n)?_D(n):void 0;let d=CD(n)&&c?t(r,{style:_D(n)}):t(r);if(kD(o,n,!0)&&kD(o,n,!1))if(wD(o,"LI")){const e=SD(o);s.insertAfter(d,e),(e=>{var t;return(null===(t=e.parentNode)||void 0===t?void 0:t.firstChild)===e})(o)?s.remove(e):s.remove(o)}else s.replace(d,o);else if(kD(o,n,!0))wD(o,"LI")?(s.insertAfter(d,SD(o)),d.appendChild(s.doc.createTextNode(" ")),d.appendChild(o)):i.insertBefore(d,o),s.remove(n);else if(kD(o,n,!1))s.insertAfter(d,SD(o)),s.remove(n);else{o=SD(o);const e=a.cloneRange();e.setStartAfter(n),e.setEndAfter(o);const t=e.extractContents();if("LI"===r&&((e,t)=>e.firstChild&&e.firstChild.nodeName===t)(t,"LI")){const e=Y($(d.children,wo.fromDom),R(Qt("br")));d=t.firstChild,s.insertAfter(t,o),q(e,(e=>bn(wo.fromDom(d),e))),c&&d.setAttribute("style",c)}else s.insertAfter(t,o),s.insertAfter(d,o);s.remove(n)}uD(e,d)},TD=(e,t)=>t&&"A"===t.nodeName&&e.isEmpty(t),OD=(e,t)=>e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t,AD=(e,t)=>C(t)&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&e.isEditable(t.parentNode)&&"false"!==e.getContentEditable(t),DD=(e,t,o)=>dr(t)?e?1===o&&t.data.charAt(o-1)===di?0:o:o===t.data.length-1&&t.data.charAt(o)===di?t.data.length:o:o,MD={insert:(e,t)=>{let o,n,r,s,a=!1;const i=e.dom,l=e.schema.getNonEmptyElements(),c=e.selection.getRng(),d=sc(e),m=wo.fromDom(c.startContainer),u=Io(m,c.startOffset),g=u.exists((e=>Gt(e)&&!rn(e))),p=c.collapsed&&g,f=(t,n)=>vD(e,o,k,S,dc(e),t,n),v=e=>{const t=DD(e,o,n);if(dr(o)&&(e?t>0:t{let t;return t=/^(H[1-6]|PRE|FIGURE)$/.test(r)&&"HGROUP"!==_?f(d):f(),((e,t)=>{const o=mc(e);return!x(t)&&(h(o)?j(Lt.explode(o),t.nodeName.toLowerCase()):o)})(e,s)&&AD(i,s)&&i.isEmpty(k,void 0,{includeZwsp:!0})?t=i.split(s,k):i.insertAfter(t,k),uD(e,t),t};wh(i,c).each((e=>{c.setStart(e.startContainer,e.startOffset),c.setEnd(e.endContainer,e.endOffset)})),o=c.startContainer,n=c.startOffset;const y=!(!t||!t.shiftKey),w=!(!t||!t.ctrlKey);tr(o)&&o.hasChildNodes()&&!p&&(a=n>o.childNodes.length-1,o=o.childNodes[Math.min(n,o.childNodes.length-1)]||o,n=a&&dr(o)?o.data.length:0);const S=gD(i,o);if(!S||((e,t)=>{const o=e.dom.getParent(t,"ol,ul,dl");return null!==o&&"false"===e.dom.getContentEditableParent(o)})(e,o))return;y||(o=((e,t,o,n,r)=>{var s,a;const i=e.dom,l=null!==(s=gD(i,n))&&void 0!==s?s:i.getRoot();let c=i.getParent(n,i.isBlock);if(!c||!AD(i,c)){if(c=c||l,!c.hasChildNodes()){const n=i.create(t);return fD(e,n),c.appendChild(n),o.setStart(n,0),o.setEnd(n,0),n}let s,d=n;for(;d&&d.parentNode!==c;)d=d.parentNode;for(;d&&!i.isBlock(d);)s=d,d=d.previousSibling;const m=null===(a=null==s?void 0:s.parentElement)||void 0===a?void 0:a.nodeName;if(s&&m&&e.schema.isValidChild(m,t.toLowerCase())){const a=s.parentNode,l=i.create(t);for(fD(e,l),a.insertBefore(l,s),d=s;d&&!i.isBlock(d);){const e=d.nextSibling;l.appendChild(d),d=e}o.setStart(n,r),o.setEnd(n,r)}}return n})(e,d,c,o,n));let k=i.getParent(o,i.isBlock)||i.getRoot();s=C(null==k?void 0:k.parentNode)?i.getParent(k.parentNode,i.isBlock):null,r=k?k.nodeName.toUpperCase():"";const _=s?s.nodeName.toUpperCase():"";if("LI"!==_||w||(k=s,s=s.parentNode,r=_),tr(s)&&bD(e,y,k))return yD(e,f,k);if(/^(LI|DT|DD)$/.test(r)&&tr(s)&&i.isEmpty(k))return void ED(e,f,s,k,d);if(!(p||k!==e.getBody()&&AD(i,k)))return;const E=k.parentNode;let T;if(p)T=f(d),u.fold((()=>{yn(m,wo.fromDom(T))}),(e=>{fn(e,wo.fromDom(T))})),e.selection.setCursorLocation(T,0);else if(pi(k))T=Si(k),i.isEmpty(k)&&pD(k),fD(e,T),uD(e,T);else if(v(!1))T=b();else if(v(!0)&&E){const t=ml.fromRangeStart(c),o=yf(t),n=wo.fromDom(k),r=Lf(n,t,e.schema)?Hf(n,t,e.schema).bind((e=>F.from(e.getNode()))):F.none();T=E.insertBefore(f(),k);const s=OD(k,"HR")||o?T:r.getOr(k);uD(e,s)}else{const t=(e=>{const t=e.cloneRange();return t.setStart(e.startContainer,DD(!0,e.startContainer,e.startOffset)),t.setEnd(e.endContainer,DD(!1,e.endContainer,e.endOffset)),t})(c).cloneRange();t.setEndAfter(k);const o=t.extractContents();(e=>{q(zn(wo.fromDom(e),Yt),(e=>{const t=e.dom;t.nodeValue=ui(t.data)}))})(o),(e=>{let t=e;do{dr(t)&&(t.data=t.data.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)})(o),T=o.firstChild,i.insertAfter(o,k),((e,t,o)=>{var n;const r=[];if(!o)return;let s=o;for(;s=s.firstChild;){if(e.isBlock(s))return;tr(s)&&!t[s.nodeName.toLowerCase()]&&r.push(s)}let a=r.length;for(;a--;)s=r[a],(!s.hasChildNodes()||s.firstChild===s.lastChild&&""===(null===(n=s.firstChild)||void 0===n?void 0:n.nodeValue)||TD(e,s))&&e.remove(s)})(i,l,T),((e,t)=>{t.normalize();const o=t.lastChild;(!o||tr(o)&&/^(left|right)$/gi.test(e.getStyle(o,"float",!0)))&&e.add(t,"br")})(i,k),i.isEmpty(k)&&pD(k),T.normalize(),i.isEmpty(T)?(i.remove(T),b()):(fD(e,T),uD(e,T))}i.setAttrib(T,"id",""),e.dispatch("NewBlock",{newBlock:T})},fakeEventName:"insertParagraph"},ND=(e,t,o)=>{const n=e.dom.createRng();o?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),e.selection.setRng(n),Wh(e,n)},RD=(e,t)=>{const o=e.selection,n=e.dom,r=o.getRng();let s,a=!1;wh(n,r).each((e=>{r.setStart(e.startContainer,e.startOffset),r.setEnd(e.endContainer,e.endOffset)}));let i=r.startOffset,l=r.startContainer;if(tr(l)&&l.hasChildNodes()){const e=i>l.childNodes.length-1;l=l.childNodes[Math.min(i,l.childNodes.length-1)]||l,i=e&&dr(l)?l.data.length:0}let c=n.getParent(l,n.isBlock);const d=c&&c.parentNode?n.getParent(c.parentNode,n.isBlock):null,m=d?d.nodeName.toUpperCase():"",u=!(!t||!t.ctrlKey);"LI"!==m||u||(c=d),dr(l)&&i>=l.data.length&&(((e,t,o)=>{const n=new Wn(t,o);let r;const s=e.getNonEmptyElements();for(;r=n.next();)if(s[r.nodeName.toLowerCase()]||dr(r)&&r.length>0)return!0;return!1})(e.schema,l,c||n.getRoot())||(s=n.create("br"),r.insertNode(s),r.setStartAfter(s),r.setEndAfter(s),a=!0)),s=n.create("br"),gl(n,r,s),ND(e,s,a),e.undoManager.add()},BD=(e,t)=>{const o=wo.fromTag("br");fn(wo.fromDom(t),o),e.undoManager.add()},LD=(e,t)=>{HD(e.getBody(),t)||vn(wo.fromDom(t),wo.fromTag("br"));const o=wo.fromTag("br");vn(wo.fromDom(t),o),ND(e,o.dom,!1),e.undoManager.add()},HD=(e,t)=>{return o=ml.after(t),!!fr(o.getNode())||nu(e,ml.after(t)).map((e=>fr(e.getNode()))).getOr(!1);var o},ID=e=>e&&"A"===e.nodeName&&"href"in e,PD=e=>e.fold(I,ID,ID,I),FD=(e,t)=>{t.fold(E,N(BD,e),N(LD,e),E)},zD={insert:(e,t)=>{const o=(e=>{const t=N(fv,e),o=ml.fromRangeStart(e.selection.getRng());return g_(t,e.getBody(),o).filter(PD)})(e);o.isSome()?o.each(N(FD,e)):RD(e,t)},fakeEventName:"insertLineBreak"},VD=(e,t)=>hD(e).filter((e=>t.length>0&&Co(wo.fromDom(e),t))).isSome(),ZD=Il([{br:[]},{block:[]},{none:[]}]),UD=(e,t)=>(e=>VD(e,cc(e)))(e),jD=e=>(t,o)=>(e=>hD(e).filter((e=>ni(wo.fromDom(e)))).isSome())(t)===e,WD=(e,t)=>(o,n)=>{const r=(e=>hD(e).fold(A(""),(e=>e.nodeName.toUpperCase())))(o)===e.toUpperCase();return r===t},$D=e=>{const t=gD(e.dom,e.selection.getStart());return x(t)},qD=e=>WD("pre",e),GD=e=>(t,o)=>rc(t)===e,KD=(e,t)=>(e=>VD(e,lc(e)))(e),YD=(e,t)=>t,XD=e=>{const t=sc(e),o=gD(e.dom,e.selection.getStart());return C(o)&&e.schema.isValidChild(o.nodeName,t)},JD=e=>{const t=e.selection.getRng(),o=wo.fromDom(t.startContainer),n=Io(o,t.startOffset).map((e=>Gt(e)&&!rn(e)));return t.collapsed&&n.getOr(!0)},QD=(e,t)=>(o,n)=>J(e,((e,t)=>e&&t(o,n)),!0)?F.some(t):F.none(),eM=(e,t,o)=>{t.selection.isCollapsed()||(e=>{e.execCommand("delete")})(t),C(o)&&aD(t,e.fakeEventName).isDefaultPrevented()||(e.insert(t,o),C(o)&&sD(t,e.fakeEventName))},tM=(e,t)=>{const o=()=>eM(zD,e,t),n=()=>eM(MD,e,t),r=((e,t)=>n_([QD([UD],ZD.none()),QD([qD(!0),$D],ZD.none()),QD([WD("summary",!0)],ZD.br()),QD([qD(!0),GD(!1),YD],ZD.br()),QD([qD(!0),GD(!1)],ZD.block()),QD([qD(!0),GD(!0),YD],ZD.block()),QD([qD(!0),GD(!0)],ZD.br()),QD([jD(!0),YD],ZD.br()),QD([jD(!0)],ZD.block()),QD([KD],ZD.br()),QD([YD],ZD.br()),QD([XD],ZD.block()),QD([JD],ZD.block())],[e,!(!t||!t.shiftKey)]).getOr(ZD.none()))(e,t);switch(ic(e)){case"linebreak":r.fold(o,o,E);break;case"block":r.fold(n,n,E);break;case"invert":r.fold(n,o,E);break;default:r.fold(o,n,E)}},oM=kt(),nM=oM.os.isiOS()&&oM.browser.isSafari(),rM=(e,t)=>{var o;t.isDefaultPrevented()||(t.preventDefault(),(o=e.undoManager).typing&&(o.typing=!1,o.add()),e.undoManager.transact((()=>{tM(e,t)})))},sM=e=>{let t=F.none();e.on("keydown",(o=>{o.keyCode===Vg.ENTER&&(nM&&(e=>{if(!e.collapsed)return!1;const t=e.startContainer;if(dr(t)){const o=/^[\uAC00-\uD7AF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uD7B0-\uD7FF]$/,n=t.data.charAt(e.startOffset-1);return o.test(n)}return!1})(e.selection.getRng())?(e=>{t=F.some(e.selection.getBookmark()),e.undoManager.add()})(e):rM(e,o))})),e.on("keyup",(o=>{o.keyCode===Vg.ENTER&&t.each((()=>((e,o)=>{e.undoManager.undo(),t.fold(E,(t=>e.selection.moveToBookmark(t))),rM(e,o),t=F.none()})(e,o)))}))},aM=(e,t)=>{e.on("keydown",(o=>{o.isDefaultPrevented()||((e,t,o)=>{const n=Mt.os.isMacOS()||Mt.os.isiOS();kT([{keyCode:Vg.END,action:ST(uT,e,!0)},{keyCode:Vg.HOME,action:ST(uT,e,!1)},...n?[]:[{keyCode:Vg.HOME,action:ST(gT,e,!1),ctrlKey:!0,shiftKey:!0},{keyCode:Vg.END,action:ST(gT,e,!0),ctrlKey:!0,shiftKey:!0}],{keyCode:Vg.END,action:ST(OT,e,!0)},{keyCode:Vg.HOME,action:ST(OT,e,!1)},{keyCode:Vg.END,action:ST(pE,e,!0,t)},{keyCode:Vg.HOME,action:ST(pE,e,!1,t)}],o).each((e=>{o.preventDefault()}))})(e,t,o)}))},iM=e=>{e.on("input",(t=>{t.isComposing||(e=>{const t=wo.fromDom(e.getBody());e.selection.isCollapsed()&&ev(t,ml.fromRangeStart(e.selection.getRng()),e.schema).each((t=>{e.selection.setRng(t.toRange())}))})(e)}))},lM=kt(),cM=e=>e.stopImmediatePropagation(),dM=e=>e.keyCode===Vg.PAGE_UP||e.keyCode===Vg.PAGE_DOWN,mM=(e,t,o)=>{o&&!e.get()?t.on("NodeChange",cM,!0):!o&&e.get()&&t.off("NodeChange",cM),e.set(o)},uM=(e,t)=>{if(lM.os.isMacOS())return;const o=Lr(!1);e.on("keydown",(t=>{dM(t)&&mM(o,e,!0)})),e.on("keyup",(n=>{n.isDefaultPrevented()||((e,t,o)=>{kT([{keyCode:Vg.PAGE_UP,action:ST(pE,e,!1,t)},{keyCode:Vg.PAGE_DOWN,action:ST(pE,e,!0,t)}],o)})(e,t,n),dM(n)&&o.get()&&(mM(o,e,!1),e.nodeChanged())}))},gM=(e,t)=>{const o=t.container(),n=t.offset();return dr(o)?(o.insertData(n,e),F.some(ml(o,n+e.length))):Bm(t).map((o=>{const n=wo.fromText(e);return t.isAtEnd()?vn(o,n):fn(o,n),ml(n.dom,e.length)}))},hM=N(gM,qn),pM=N(gM," "),fM=e=>t=>{e.selection.setRng(t.toRange()),e.nodeChanged()},vM=e=>{const t=ml.fromRangeStart(e.selection.getRng()),o=wo.fromDom(e.getBody());if(e.selection.isCollapsed()){const n=N(fv,e),r=ml.fromRangeStart(e.selection.getRng());return g_(n,e.getBody(),r).bind((e=>t=>t.fold((t=>ru(e.dom,ml.before(t))),(e=>su(e)),(e=>au(e)),(t=>nu(e.dom,ml.after(t)))))(o)).map((n=>()=>((e,t,o)=>n=>Wf(e,n,o)?hM(t):pM(t))(o,t,e.schema)(n).each(fM(e))))}return F.none()},bM=e=>{return Ft(Mt.browser.isFirefox()&&e.selection.isEditable()&&(t=e.dom,o=e.selection.getRng().startContainer,t.isEditable(t.getParent(o,"summary"))),(()=>{const t=wo.fromDom(e.getBody());e.selection.isCollapsed()||e.getDoc().execCommand("Delete"),((e,t,o)=>Wf(e,t,o)?hM(t):pM(t))(t,ml.fromRangeStart(e.selection.getRng()),e.schema).each(fM(e))}));var t,o},yM=e=>{e.on("keydown",(t=>{t.isDefaultPrevented()||((e,t)=>{_T([{keyCode:Vg.SPACEBAR,action:ST(vM,e)},{keyCode:Vg.SPACEBAR,action:ST(bM,e)}],t).each((o=>{t.preventDefault(),aD(e,"insertText",{data:" "}).isDefaultPrevented()||(o(),sD(e,"insertText",{data:" "}))}))})(e,t)}))},wM=e=>Pd(e)?[{keyCode:Vg.TAB,action:ST(rO,e,!0)},{keyCode:Vg.TAB,shiftKey:!0,action:ST(rO,e,!1)}]:[],xM=e=>{e.on("keydown",(t=>{t.isDefaultPrevented()||((e,t)=>{kT([...wM(e)],t).each((e=>{t.preventDefault()}))})(e,t)}))},CM=e=>{if(e.addShortcut("Meta+P","","mcePrint"),UA(e),EC(e))return Lr(null);{const t=uE(e);return(e=>{e.on("beforeinput",(t=>{e.selection.isEditable()&&!W(t.getTargetRanges(),(t=>!Cp(e.dom,t)))||t.preventDefault()}))})(e),(e=>{e.on("keyup compositionstart",N(sT,e))})(e),sO(e,t),mD(e,t),sM(e),yM(e),iM(e),xM(e),aM(e,t),uM(e,t),t}};class SM{constructor(e){let t;this.lastPath=[],this.editor=e;const o=this;"onselectionchange"in e.getDoc()||e.on("NodeChange click mouseup keyup focus",(o=>{const n=e.selection.getRng(),r={startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset};"nodechange"!==o.type&&gh(r,t)||e.dispatch("SelectionChange"),t=r})),e.on("contextmenu",(()=>{op(e),e.dispatch("SelectionChange")})),e.on("SelectionChange",(()=>{const t=e.selection.getStart(!0);t&&Hu(e)&&!o.isSameElementPath(t)&&e.dom.isChildOf(t,e.getBody())&&e.nodeChanged({selectionChange:!0})})),e.on("mouseup",(t=>{!t.isDefaultPrevented()&&Hu(e)&&("IMG"===e.selection.getNode().nodeName?sp.setEditorTimeout(e,(()=>{e.nodeChanged()})):e.nodeChanged())}))}nodeChanged(e={}){const t=this.editor.selection;let o;if(this.editor.initialized&&t&&!Qc(this.editor)&&!this.editor.mode.isReadOnly()){const n=this.editor.getBody();o=t.getStart(!0)||n,o.ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(o,n)||(o=n);const r=[];this.editor.dom.getParent(o,(e=>e===n||(r.push(e),!1))),this.editor.dispatch("NodeChange",{...e,element:o,parents:r})}}isSameElementPath(e){let t;const o=this.editor,n=se(o.dom.getParents(e,P,o.getBody()));if(n.length===this.lastPath.length){for(t=n.length;t>=0&&n[t]===this.lastPath[t];t--);if(-1===t)return this.lastPath=n,!0}return this.lastPath=n,!1}}const kM=ja("image"),_M=ja("event"),EM=e=>t=>{t[_M]=e},TM=EM(0),OM=EM(2),AM=EM(1),DM=(MM=0,e=>{const t=e;return F.from(t[_M]).exists((e=>e===MM))});var MM;const NM=ja("mode"),RM=e=>t=>{t[NM]=e},BM=(e,t)=>RM(t)(e),LM=RM(0),HM=RM(2),IM=RM(1),PM=e=>t=>{const o=t;return F.from(o[NM]).exists((t=>t===e))},FM=PM(0),zM=PM(1),VM=["none","copy","link","move"],ZM=["none","copy","copyLink","copyMove","link","linkMove","move","all","uninitialized"],UM=()=>{const e=new window.DataTransfer;let t="move",o="all";const n={get dropEffect(){return t},set dropEffect(e){j(VM,e)&&(t=e)},get effectAllowed(){return o},set effectAllowed(e){DM(n)&&j(ZM,e)&&(o=e)},get items(){return((e,t)=>({...t,get length(){return t.length},add:(o,n)=>{if(FM(e)){if(!h(o))return t.add(o);if(!w(n))return t.add(o,n)}return null},remove:o=>{FM(e)&&t.remove(o)},clear:()=>{FM(e)&&t.clear()}}))(n,e.items)},get files(){return zM(n)?Object.freeze({length:0,item:e=>null}):e.files},get types(){return e.types},setDragImage:(t,o,r)=>{var s;FM(n)&&(s={image:t,x:o,y:r},n[kM]=s,e.setDragImage(t,o,r))},getData:t=>zM(n)?"":e.getData(t),setData:(t,o)=>{FM(n)&&e.setData(t,o)},clearData:t=>{FM(n)&&e.clearData(t)}};return LM(n),n},jM=e=>{const t=UM(),o=(e=>{const t=e;return F.from(t[NM])})(e);return HM(e),TM(t),t.dropEffect=e.dropEffect,t.effectAllowed=e.effectAllowed,(e=>{const t=e;return F.from(t[kM])})(e).each((e=>t.setDragImage(e.image,e.x,e.y))),q(e.types,(o=>{"Files"!==o&&t.setData(o,e.getData(o))})),q(e.files,(e=>t.items.add(e))),(e=>{const t=e;return F.from(t[_M])})(e).each((e=>{((e,t)=>{EM(t)(e)})(t,e)})),o.each((o=>{BM(e,o),BM(t,o)})),t},WM=(e,t)=>e.setData("text/html",t),$M="x-tinymce/html",qM=A($M),GM="\x3c!-- "+$M+" --\x3e",KM=e=>GM+e,YM=e=>-1!==e.indexOf(GM),XM=(e,t,o)=>{const n=e.split(/\n\n/),r=((e,t)=>{let o="<"+e;const n=Se(t,((e,t)=>t+'="'+Es.encodeAllRaw(e)+'"'));return n.length&&(o+=" "+n.join(" ")),o+">"})(t,o),s="",a=$(n,(e=>e.split(/\n/).join("
    ")));return 1===a.length?a[0]:$(a,(e=>r+e+s)).join("")},JM="%MCEPASTEBIN%",QM=e=>e.dom.get("mcepastebin"),eN=e=>C(e)&&"mcepastebin"===e.id,tN=e=>e===JM,oN=e=>{const t=Lr(null);return{create:()=>((e,t)=>{const{dom:o,selection:n}=e,r=e.getBody();t.set(n.getRng());const s=o.add(e.getBody(),"div",{id:"mcepastebin",class:"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},JM);Mt.browser.isFirefox()&&o.setStyle(s,"left","rtl"===o.getStyle(r,"direction",!0)?65535:-65535),o.bind(s,"beforedeactivate focusin focusout",(e=>{e.stopPropagation()})),s.focus(),n.select(s,!0)})(e,t),remove:()=>((e,t)=>{const o=e.dom;if(QM(e)){let n;const r=t.get();for(;n=QM(e);)o.remove(n),o.unbind(n);r&&e.selection.setRng(r)}t.set(null)})(e,t),getEl:()=>QM(e),getHtml:()=>(e=>{const t=e.dom,o=(e,o)=>{e.appendChild(o),t.remove(o,!0)},[n,...r]=Y(e.getBody().childNodes,eN);q(r,(e=>{o(n,e)}));const s=t.select("div[id=mcepastebin]",n);for(let e=s.length-1;e>=0;e--){const r=t.create("div");n.insertBefore(r,s[e]),o(r,s[e])}return n?n.innerHTML:""})(e),getLastRng:t.get}},nN=(e,t)=>(Lt.each(t,(t=>{e=g(t,RegExp)?e.replace(t,""):e.replace(t[0],t[1])})),e),rN=e=>e=nN(e,[/^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/|/g,[/( ?)\u00a0<\/span>( ?)/g,(e,t,o)=>t||o?qn:" "],/
    /g,/
    $/i]),sN=(e,t)=>({content:e,cancelled:t}),aN=(e,t,o)=>{const n=((e,t,o)=>e.dispatch("PastePreProcess",{content:t,internal:o}))(e,t,o),r=((e,t)=>{const o=zx({sanitize:Ld(e),sandbox_iframes:Vd(e),sandbox_iframes_exclusions:Zd(e),convert_unsafe_embeds:Ud(e)},e.schema);o.addNodeFilter("meta",(e=>{Lt.each(e,(e=>{e.remove()}))}));const n=o.parse(t,{forced_root_block:!1,isRootContent:!0});return Jp({validate:!0},e.schema).serialize(n)})(e,n.content);return e.hasEventListeners("PastePostProcess")&&!n.isDefaultPrevented()?((e,t,o)=>{const n=e.dom.create("div",{style:"display:none"},t),r=((e,t,o)=>e.dispatch("PastePostProcess",{node:t,internal:o}))(e,n,o);return sN(r.node.innerHTML,r.isDefaultPrevented())})(e,r,o):sN(r,n.isDefaultPrevented())},iN=(e,t)=>(e.insertContent(t,{merge:Sd(e),paste:!0}),!0),lN=e=>/^https?:\/\/[\w\-\/+=.,!;:&%@^~(){}?#]+$/i.test(e),cN=(e,t,o)=>!(e.selection.isCollapsed()||!lN(t))&&((e,t,o)=>(e.undoManager.extra((()=>{o(e,t)}),(()=>{e.execCommand("mceInsertLink",!1,t)})),!0))(e,t,o),dN=(e,t,o)=>!!((e,t)=>lN(t)&&W(Id(e),(e=>$e(t.toLowerCase(),`.${e.toLowerCase()}`))))(e,t)&&((e,t,o)=>(e.undoManager.extra((()=>{o(e,t)}),(()=>{e.insertContent('')})),!0))(e,t,o),mN=(e,t,o)=>{o||!kd(e)?iN(e,t):((e,t)=>{Lt.each([cN,dN,iN],(o=>!o(e,t,iN)))})(e,t)},uN=(e=>{let t=0;return()=>e+t++})("mceclip"),gN=e=>{const t=UM();return WM(t,e),HM(t),t},hN=(e,t,o,n,r)=>{const s=((e,t,o)=>aN(e,t,o))(e,t,o);if(!s.cancelled){const t=s.content,o=()=>mN(e,t,n);r?aD(e,"insertFromPaste",{dataTransfer:gN(t)}).isDefaultPrevented()||(o(),sD(e,"insertFromPaste")):o()}},pN=(e,t,o,n)=>{const r=o||YM(t);hN(e,(e=>e.replace(GM,""))(t),r,!1,n)},fN=(e,t,o)=>{const n=e.dom.encode(t).replace(/\r\n/g,"\n"),r=Jn(n,Ed(e)),s=XM(r,sc(e),ac(e));hN(e,s,!1,!0,o)},vN=e=>{const t={};if(e&&e.types)for(let o=0;ot in e&&e[t].length>0,yN=e=>bN(e,"text/html")||bN(e,"text/plain"),wN=(e,t,o,n)=>{const r=uN(),s=gc(e)&&C(o.name),a=s?((e,t)=>{const o=t.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return C(o)?e.dom.encode(o[1]):void 0})(e,o.name):r,i=s?o.name:void 0,l=t.create(r,o,n,a,i);return t.add(l),l},xN=e=>{const t=Id(e);return e=>We(e.type,"image/")&&W(t,(t=>(e=>{const t=e.toLowerCase(),o={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"};return Lt.hasOwn(o,t)?"image/"+o[t]:"image/"+t})(t)===e.type))},CN=(e,t,o)=>{const n="paste"===t.type?t.clipboardData:t.dataTransfer;var r;if(vd(e)&&n){const s=((e,t)=>{const o=t.items?ne(ue(t.items),(e=>"file"===e.kind?[e.getAsFile()]:[])):[],n=t.files?ue(t.files):[];return Y(o.length>0?o:n,xN(e))})(e,n);if(s.length>0)return t.preventDefault(),(r=s,Promise.all($(r,(e=>uw(e).then((t=>({file:e,uri:t}))))))).then((t=>{o&&e.selection.setRng(o),q(t,(t=>{((e,t)=>{cw(t.uri).each((({data:o,type:n,base64Encoded:r})=>{const s=r?o:btoa(o),a=t.file,i=e.editorUpload.blobCache,l=i.getByData(s,n),c=null!=l?l:wN(e,i,a,s);pN(e,``,!1,!0)}))})(e,t)}))})),!0}return!1},SN=(e,t,o,n,r)=>{let s=rN(o);const a=bN(t,qM())||YM(o),i=!a&&(e=>!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(e))(s),l=lN(s);(tN(s)||!s.length||i&&!l)&&(n=!0),(n||l)&&(s=bN(t,"text/plain")&&i?t["text/plain"]:(e=>{const t=Ws(),o=zx({},t);let n="";const r=t.getVoidElements(),s=Lt.makeMap("script noscript style textarea video audio iframe object"," "),a=t.getBlockElements(),i=e=>{const o=e.name,l=e;if("br"!==o){if("wbr"!==o)if(r[o]&&(n+=" "),s[o])n+=" ";else{if(3===e.type&&(n+=e.value),!(e.name in t.getVoidElements())){let t=e.firstChild;if(t)do{i(t)}while(t=t.next)}a[o]&&l.next&&(n+="\n","p"===o&&(n+="\n"))}}else n+="\n"};return e=nN(e,[//g]),i(o.parse(e)),n})(s)),tN(s)||(n?fN(e,s,r):pN(e,s,a,r))},kN=(e,t,o)=>{let n;e.on("keydown",(e=>{(e=>Vg.metaKeyPressed(e)&&86===e.keyCode||e.shiftKey&&45===e.keyCode)(e)&&!e.isDefaultPrevented()&&(n=e.shiftKey&&86===e.keyCode)})),e.on("paste",(r=>{if(r.isDefaultPrevented()||(e=>{var t,o;return Mt.os.isAndroid()&&0===(null===(o=null===(t=e.clipboardData)||void 0===t?void 0:t.items)||void 0===o?void 0:o.length)})(r))return;const s="text"===o.get()||n;n=!1;const a=vN(r.clipboardData);!yN(a)&&CN(e,r,t.getLastRng()||e.selection.getRng())||(bN(a,"text/html")?(r.preventDefault(),SN(e,a,a["text/html"],s,!0)):bN(a,"text/plain")&&bN(a,"text/uri-list")?(r.preventDefault(),SN(e,a,a["text/plain"],s,!0)):(t.create(),sp.setEditorTimeout(e,(()=>{const o=t.getHtml();t.remove(),SN(e,a,o,s,!1)}),0)))}))},_N=(e,t,o)=>{kN(e,t,o),(e=>{const t=e=>We(e,"webkit-fake-url"),o=e=>We(e,"data:");e.parser.addNodeFilter("img",((n,r,s)=>{if(!vd(e)&&(e=>{var t;return!0===(null===(t=e.data)||void 0===t?void 0:t.paste)})(s))for(const r of n){const n=r.attr("src");h(n)&&!r.attr("data-mce-object")&&n!==Mt.transparentSrc&&(t(n)||!Td(e)&&o(n))&&r.remove()}}))})(e)},EN=(e,t)=>{e.addCommand("mceTogglePlainTextPaste",(()=>{((e,t)=>{"text"===t.get()?(t.set("html"),zg(e,!1)):(t.set("text"),zg(e,!0)),e.focus()})(e,t)})),e.addCommand("mceInsertClipboardContent",((t,o)=>{o.html&&pN(e,o.html,o.internal,!1),o.text&&fN(e,o.text,!1)}))},TN=(e,t,o,n)=>{((e,t,o)=>{if(!e)return!1;try{return e.clearData(),e.setData("text/html",t),e.setData("text/plain",o),e.setData(qM(),t),!0}catch(e){return!1}})(e.clipboardData,t.html,t.text)?(e.preventDefault(),n()):o(t.html,n)},ON=e=>(t,o)=>{const{dom:n,selection:r}=e,s=n.create("div",{contenteditable:"false","data-mce-bogus":"all"}),a=n.create("div",{contenteditable:"true"},t);n.setStyles(s,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),s.appendChild(a),n.add(e.getBody(),s);const i=r.getRng();a.focus();const l=n.createRng();l.selectNodeContents(a),r.setRng(l),sp.setEditorTimeout(e,(()=>{r.setRng(i),n.remove(s),o()}),0)},AN=e=>({html:KM(e.selection.getContent({contextual:!0})),text:e.selection.getContent({format:"text"})}),DN=e=>!e.selection.isCollapsed()||(e=>!!e.dom.getParent(e.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",e.getBody()))(e),MN=e=>{e.on("cut",(e=>t=>{!t.isDefaultPrevented()&&DN(e)&&e.selection.isEditable()&&TN(t,AN(e),ON(e),(()=>{if(Mt.browser.isChromium()||Mt.browser.isFirefox()){const t=e.selection.getRng();sp.setEditorTimeout(e,(()=>{e.selection.setRng(t),e.execCommand("Delete")}),0)}else e.execCommand("Delete")}))})(e)),e.on("copy",(e=>t=>{!t.isDefaultPrevented()&&DN(e)&&TN(t,AN(e),ON(e),E)})(e))},NN=(e,t)=>{var o,n;return Sh.getCaretRangeFromPoint(null!==(o=t.clientX)&&void 0!==o?o:0,null!==(n=t.clientY)&&void 0!==n?n:0,e.getDoc())},RN=(e,t)=>{e.focus(),t&&e.selection.setRng(t)},BN=(e,t)=>{fd(e)&&e.on("dragend dragover draggesture dragdrop drop drag",(e=>{e.preventDefault(),e.stopPropagation()})),vd(e)||e.on("drop",(e=>{const t=e.dataTransfer;t&&(e=>W(e.files,(e=>/^image\//.test(e.type))))(t)&&e.preventDefault()})),e.on("drop",(o=>{if(o.isDefaultPrevented())return;const n=NN(e,o);if(x(n))return;const r=vN(o.dataTransfer),s=bN(r,qM());if((!yN(r)||(e=>{const t=e["text/plain"];return!!t&&0===t.indexOf("file://")})(r))&&CN(e,o,n))return;const a=r[qM()],i=a||r["text/html"]||r["text/plain"],l=((e,t,o,n)=>{const r=e.getParent(o,(e=>es(t,e)));if(!b(e.getParent(o,"summary")))return!0;if(r&&Ee(n,"text/html")){const e=(new DOMParser).parseFromString(n["text/html"],"text/html").body;return!b(e.querySelector(r.nodeName.toLowerCase()))}return!1})(e.dom,e.schema,n.startContainer,r),c=t.get();c&&!l||i&&(o.preventDefault(),sp.setEditorTimeout(e,(()=>{e.undoManager.transact((()=>{(a||c&&l)&&e.execCommand("Delete"),RN(e,n);const t=rN(i);r["text/html"]?pN(e,t,s,!0):fN(e,t,!0)}))})))})),e.on("dragstart",(e=>{t.set(!0)})),e.on("dragover dragend",(o=>{vd(e)&&!t.get()&&(o.preventDefault(),RN(e,NN(e,o))),"dragend"===o.type&&t.set(!1)})),(e=>{e.on("input",(t=>{const o=e=>b(e.querySelector("summary"));if("deleteByDrag"===t.inputType){const t=Y(e.dom.select("details"),o);q(t,(t=>{fr(t.firstChild)&&t.firstChild.remove();const o=e.dom.create("summary");o.appendChild(li().dom),t.prepend(o)}))}}))})(e)},LN=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,HN=e=>Lt.trim(e).replace(LN,ea).toLowerCase(),IN=(e,t,o)=>{const n=xd(e);if(o||"all"===n||!Cd(e))return t;const r=n?n.split(/[, ]/):[];if(r&&"none"!==n){const o=e.dom,n=e.selection.getNode();t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,((e,t,s,a)=>{const i=o.parseStyle(o.decode(s)),l={};for(let e=0;e]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return t=t.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,((e,t,o,n)=>t+' style="'+o+'"'+n)),t},PN=e=>{const t=Lr(!1),o=Lr(_d(e)?"text":"html"),n=oN(e);(e=>{(Mt.browser.isChromium()||Mt.browser.isSafari())&&((e,t)=>{e.on("PastePreProcess",(o=>{o.content=t(e,o.content,o.internal)}))})(e,IN)})(e),EN(e,o),(e=>{const t=t=>o=>{t(e,o)},o=bd(e);S(o)&&e.on("PastePreProcess",t(o));const n=yd(e);S(n)&&e.on("PastePostProcess",t(n))})(e),e.addQueryStateHandler("mceTogglePlainTextPaste",(()=>"text"===o.get())),e.on("PreInit",(()=>{MN(e),BN(e,t),_N(e,n,o)}))},FN=e=>{(e=>{e.on("click",(t=>{e.dom.getParent(t.target,"details")&&t.preventDefault()}))})(e),(e=>{e.parser.addNodeFilter("details",(t=>{const o=Fd(e);q(t,(e=>{"expanded"===o?e.attr("open","open"):"collapsed"===o&&e.attr("open",null)}))})),e.serializer.addNodeFilter("details",(t=>{const o=zd(e);q(t,(e=>{"expanded"===o?e.attr("open","open"):"collapsed"===o&&e.attr("open",null)}))}))})(e)},zN=fr,VN=dr,ZN=e=>yr(e.dom),UN=e=>t=>ko(wo.fromDom(e),t),jN=(e,t,o)=>Jo(wo.fromDom(e),(e=>(e=>br(e.dom))(e)||o.isBlock(Wt(e))),UN(t)).getOr(wo.fromDom(t)).dom,WN=(e,t)=>Jo(wo.fromDom(e),ZN,UN(t)),$N=(e,t,o)=>{const n=new Wn(e,t),r=o?n.next.bind(n):n.prev.bind(n);let s=e;for(let t=o?e:r();t&&!zN(t);t=r())ji(t)&&(s=t);return s},qN=e=>{const t=((e,t,o)=>{const n=ml.fromRangeStart(e).getNode(),r=jN(n,t,o),s=$N(n,r,!1),a=$N(n,r,!0),i=document.createRange();return WN(s,r).fold((()=>{VN(s)?i.setStart(s,0):i.setStartBefore(s)}),(e=>i.setStartBefore(e.dom))),WN(a,r).fold((()=>{VN(a)?i.setEnd(a,a.data.length):i.setEndAfter(a)}),(e=>i.setEndAfter(e.dom))),i})(e.selection.getRng(),e.getBody(),e.schema);e.selection.setRng(kb(t))};var GN;!function(e){e.Before="before",e.After="after"}(GN||(GN={}));const KN=(e,t)=>Math.abs(e.left-t),YN=(e,t)=>Math.abs(e.right-t),XN=(e,t)=>{const o=((e,t)=>Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top)))(e,t)/Math.min(e.height,t.height);return((e,t)=>e.topt.top)(e,t)&&o>.5},JN=(e,t)=>(e=>J(e,((e,t)=>e.fold((()=>F.some(t)),(e=>{const o=Math.min(t.left,e.left),n=Math.min(t.top,e.top),r=Math.max(t.right,e.right),s=Math.max(t.bottom,e.bottom);return F.some({top:n,right:r,bottom:s,left:o,width:r-o,height:s-n})}))),F.none()))(Y(e,(e=>{return(o=t)>=(n=e).top&&o<=n.bottom;var o,n}))).fold((()=>[[],e]),(t=>{const{pass:o,fail:n}=K(e,(e=>XN(e,t)));return[o,n]})),QN=(e,t,o)=>t>e.left&&t{const r=e=>ji(e.node)?F.some(e):tr(e.node)?eR(ue(e.node.childNodes),t,o,!1):F.none(),s=(e,s)=>{const a=le(e,((e,n)=>s(e,t,o)-s(n,t,o)));return ge(a,r).map((e=>n&&!dr(e.node)&&a.length>1?((e,n,s)=>r(n).filter((n=>Math.abs(s(e,t,o)-s(n,t,o))<2&&dr(n.node))))(e,a[1],s).getOr(e):e))},[a,i]=JN(W_(e),o),{pass:l,fail:c}=K(i,(e=>e.tops(c,Mi))).orThunk((()=>s(l,Mi)))},tR=(e,t,o)=>{const n=wo.fromDom(e),r=To(n),s=wo.fromPoint(r,t,o).filter((e=>_o(n,e))).getOr(n);return((e,t,o,n)=>{const r=(t,s)=>{const a=Y(t.dom.childNodes,R((e=>tr(e)&&e.classList.contains("mce-drag-container"))));return s.fold((()=>eR(a,o,n,!0)),(e=>{const t=Y(a,(t=>t!==e.dom));return eR(t,o,n,!0)})).orThunk((()=>(ko(t,e)?F.none():Do(t)).bind((e=>r(e,F.some(t))))))};return r(t,F.none())})(n,s,t,o)},oR=(e,t,o)=>tR(e,t,o).filter((e=>cm(e.node))).map((e=>((e,t)=>({node:e.node,position:KN(e,t){var t,o;const n=e.getBoundingClientRect(),r=e.ownerDocument,s=r.documentElement,a=r.defaultView;return{top:n.top+(null!==(t=null==a?void 0:a.scrollY)&&void 0!==t?t:0)-s.clientTop,left:n.left+(null!==(o=null==a?void 0:a.scrollX)&&void 0!==o?o:0)-s.clientLeft}},rR=(e,t)=>{return o=(e=>e.inline?nR(e.getBody()):{left:0,top:0})(e),n=(e=>{const t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}})(e),r=((e,t)=>{if(t.target.ownerDocument!==e.getDoc()){const o=nR(e.getContentAreaContainer()),n=(e=>{const t=e.getBody(),o=e.getDoc().documentElement,n={left:t.scrollLeft,top:t.scrollTop},r={left:t.scrollLeft||o.scrollLeft,top:t.scrollTop||o.scrollTop};return e.inline?n:r})(e);return{left:t.pageX-o.left+n.left,top:t.pageY-o.top+n.top}}return{left:t.pageX,top:t.pageY}})(e,t),{pageX:r.left-o.left+n.left,pageY:r.top-o.top+n.top};var o,n,r},sR=e=>({target:e,srcElement:e}),aR=(e,t,o,n)=>{const r=((e,t)=>{const o=jM(e);return"dragstart"===t?(TM(o),LM(o)):"drop"===t?(OM(o),HM(o)):(AM(o),IM(o)),o})(o,e);return w(n)?((e,t,o)=>{const n=B("Function not supported on simulated event.");return{bubbles:!0,cancelBubble:!1,cancelable:!0,composed:!1,currentTarget:null,defaultPrevented:!1,eventPhase:0,isTrusted:!0,returnValue:!1,timeStamp:0,type:e,composedPath:n,initEvent:n,preventDefault:E,stopImmediatePropagation:E,stopPropagation:E,AT_TARGET:window.Event.AT_TARGET,BUBBLING_PHASE:window.Event.BUBBLING_PHASE,CAPTURING_PHASE:window.Event.CAPTURING_PHASE,NONE:window.Event.NONE,altKey:!1,button:0,buttons:0,clientX:0,clientY:0,ctrlKey:!1,metaKey:!1,movementX:0,movementY:0,offsetX:0,offsetY:0,pageX:0,pageY:0,relatedTarget:null,screenX:0,screenY:0,shiftKey:!1,x:0,y:0,detail:0,view:null,which:0,initUIEvent:n,initMouseEvent:n,getModifierState:n,dataTransfer:o,...sR(t)}})(e,t,r):((e,t,o,n)=>({...t,dataTransfer:n,type:e,...sR(o)}))(e,n,t,r)},iR=yr,lR=((...e)=>t=>{for(let o=0;o{const r=e.dom,s=t.cloneNode(!0);r.setStyles(s,{width:o,height:n}),r.setAttrib(s,"data-mce-selected",null);const a=r.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return r.setStyles(a,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:o,height:n}),r.setStyles(s,{margin:0,boxSizing:"border-box"}),a.appendChild(s),a},dR=(e,t)=>o=>()=>{const n="left"===e?o.scrollX:o.scrollY;o.scroll({[e]:n+t,behavior:"smooth"})},mR=dR("left",-32),uR=dR("left",32),gR=dR("top",-32),hR=dR("top",32),pR=e=>{e&&e.parentNode&&e.parentNode.removeChild(e)},fR=(e,t)=>o=>{if((e=>0===e.button)(o)){const n=ee(t.dom.getParents(o.target),lR).getOr(null);if(C(n)&&((e,t,o)=>iR(o)&&o!==t&&e.isEditable(o.parentElement))(t.dom,t.getBody(),n)){const r=t.dom.getPos(n),s=t.getBody(),a=t.getDoc().documentElement;e.set({element:n,dataTransfer:UM(),dragging:!1,screenX:o.screenX,screenY:o.screenY,maxX:(t.inline?s.scrollWidth:a.offsetWidth)-2,maxY:(t.inline?s.scrollHeight:a.offsetHeight)-2,relX:o.pageX-r.x,relY:o.pageY-r.y,width:n.offsetWidth,height:n.offsetHeight,ghost:cR(t,n,n.offsetWidth,n.offsetHeight),intervalId:Hr(100)})}}},vR=(e,t,o,n,r)=>{"dragstart"===t&&WM(n,e.dom.getOuterHTML(o));const s=aR(t,o,n,r);return e.dispatch(t,s)},bR=(e,t)=>{const o=Aa(((e,o)=>((e,t,o)=>{e._selectionOverrides.hideFakeCaret(),oR(e.getBody(),t,o).fold((()=>e.selection.placeCaretAt(t,o)),(n=>{const r=e._selectionOverrides.showCaret(1,n.node,n.position===GN.Before,!1);r?e.selection.setRng(r):e.selection.placeCaretAt(t,o)}))})(t,e,o)),0);t.on("remove",o.cancel);const n=e;return r=>e.on((e=>{const s=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(!e.dragging&&s>10){const o=vR(t,"dragstart",e.element,e.dataTransfer,r);if(C(o.dataTransfer)&&(e.dataTransfer=o.dataTransfer),o.isDefaultPrevented())return;e.dragging=!0,t.focus()}if(e.dragging){const s=r.currentTarget===t.getDoc().documentElement,l=((e,t)=>({pageX:t.pageX-e.relX,pageY:t.pageY+5}))(e,rR(t,r));a=e.ghost,i=t.getBody(),a.parentNode!==i&&i.appendChild(a),((e,t,o,n,r,s,a,i,l,c,d,m)=>{let u=0,g=0;e.style.left=t.pageX+"px",e.style.top=t.pageY+"px",t.pageX+o>r&&(u=t.pageX+o-r),t.pageY+n>s&&(g=t.pageY+n-s),e.style.width=o-u+"px",e.style.height=n-g+"px";const h=l.clientHeight,p=l.clientWidth,f=a+l.getBoundingClientRect().top,v=i+l.getBoundingClientRect().left;d.on((e=>{e.intervalId.clear(),e.dragging&&m&&(a+8>=h?e.intervalId.set(hR(c)):a-8<=0?e.intervalId.set(gR(c)):i+8>=p?e.intervalId.set(uR(c)):i-8<=0?e.intervalId.set(mR(c)):f+16>=window.innerHeight?e.intervalId.set(hR(window)):f-16<=0?e.intervalId.set(gR(window)):v+16>=window.innerWidth?e.intervalId.set(uR(window)):v-16<=0&&e.intervalId.set(mR(window)))}))})(e.ghost,l,e.width,e.height,e.maxX,e.maxY,r.clientY,r.clientX,t.getContentAreaContainer(),t.getWin(),n,s),o.throttle(r.clientX,r.clientY)}var a,i}))},yR=(e,t)=>o=>{e.on((e=>{var n;if(e.intervalId.clear(),e.dragging){if(((e,t,o)=>!x(t)&&t!==o&&!e.dom.isChildOf(t,o)&&e.dom.isEditable(t))(t,(e=>{const t=e.getSel();if(C(t)){const e=t.getRangeAt(0).startContainer;return dr(e)?e.parentNode:e}return null})(t.selection),e.element)){const r=null!==(n=t.getDoc().elementFromPoint(o.clientX,o.clientY))&&void 0!==n?n:t.getBody();vR(t,"drop",r,e.dataTransfer,o).isDefaultPrevented()||t.undoManager.transact((()=>{((e,t)=>{const o=e.getParent(t.parentNode,e.isBlock);pR(t),o&&o!==e.getRoot()&&e.isEmpty(o)&&ci(wo.fromDom(o))})(t.dom,e.element),(e=>{const t=e.getData("text/html");return""===t?F.none():F.some(t)})(e.dataTransfer).each((e=>t.insertContent(e))),t._selectionOverrides.hideFakeCaret()}))}vR(t,"dragend",t.getBody(),e.dataTransfer,o)}})),xR(e)},wR=(e,t,o)=>{e.on((e=>{e.intervalId.clear(),e.dragging&&o.fold((()=>vR(t,"dragend",e.element,e.dataTransfer)),(o=>vR(t,"dragend",e.element,e.dataTransfer,o)))})),xR(e)},xR=e=>{e.on((e=>{e.intervalId.clear(),pR(e.ghost)})),e.clear()},CR=e=>{const t=Ir(),o=xa.DOM,n=document,r=fR(t,e),s=bR(t,e),a=yR(t,e),i=((e,t)=>o=>wR(e,t,F.some(o)))(t,e);e.on("mousedown",r),e.on("mousemove",s),e.on("mouseup",a),o.bind(n,"mousemove",s),o.bind(n,"mouseup",i),e.on("remove",(()=>{o.unbind(n,"mousemove",s),o.unbind(n,"mouseup",i)})),e.on("keydown",(o=>{o.keyCode===Vg.ESC&&wR(t,e,F.none())}))},SR=e=>{CR(e),sd(e)&&(e=>{const t=t=>{if(!t.isDefaultPrevented()){const o=t.dataTransfer;o&&(j(o.types,"Files")||o.files.length>0)&&(t.preventDefault(),"drop"===t.type&&kS(e,"Dropped file type is not supported"))}},o=o=>{dp(e,o.target)&&t(o)},n=()=>{const n=xa.DOM,r=e.dom,s=document,a=e.inline?e.getBody():e.getDoc(),i=["drop","dragover"];q(i,(e=>{n.bind(s,e,o),r.bind(a,e,t)})),e.on("remove",(()=>{q(i,(e=>{n.unbind(s,e,o),r.unbind(a,e,t)}))}))};e.on("init",(()=>{sp.setEditorTimeout(e,n,0)}))})(e)},kR=yr,_R=(e,t)=>lb(e.getBody(),t),ER=e=>{const t=e.selection,o=e.dom,n=e.getBody(),r=am(e,n,o.isBlock,(()=>bp(e))),s="sel-"+o.uniqueId(),a="data-mce-selected";let i;const l=e=>e!==n&&(kR(e)||Cr(e))&&o.isChildOf(e,n)&&o.isEditable(e.parentNode),c=(o,n,s,a=!0)=>e.dispatch("ShowCaret",{target:n,direction:o,before:s}).isDefaultPrevented()?null:(a&&t.scrollIntoView(n,-1===o),r.show(s,n)),d=()=>{e.on("click",(t=>{o.isEditable(t.target)||(t.preventDefault(),e.focus())})),e.on("blur NewBlock",f),e.on("ResizeWindow FullscreenStateChanged",r.reposition),e.on("tap",(t=>{const o=t.target,n=_R(e,o);kR(n)?(t.preventDefault(),kk(e,n).each(p)):l(o)&&kk(e,o).each(p)}),!0),e.on("mousedown",(r=>{const s=r.target;if(s!==n&&"HTML"!==s.nodeName&&!o.isChildOf(s,n))return;if(!vS(e,r.clientX,r.clientY))return;f(),v();const a=_R(e,s);kR(a)?(r.preventDefault(),kk(e,a).each(p)):oR(n,r.clientX,r.clientY).each((o=>{r.preventDefault(),(e=>{e&&t.setRng(e)})(c(1,o.node,o.position===GN.Before,!1)),or(a)?a.focus():e.getBody().focus()}))})),e.on("keypress",(e=>{Vg.modifierPressed(e)||kR(t.getNode())&&e.preventDefault()})),e.on("GetSelectionRange",(e=>{let t=e.range;if(i){if(!i.parentNode)return void(i=null);t=t.cloneRange(),t.selectNode(i),e.range=t}})),e.on("SetSelectionRange",(e=>{e.range=g(e.range);const t=p(e.range,e.forward);t&&(e.range=t)})),e.on("AfterSetSelectionRange",(e=>{const t=e.range,n=t.startContainer.parentElement;var r;u(t)||tr(r=n)&&"mcepastebin"===r.id||v(),(e=>C(e)&&o.hasClass(e,"mce-offscreen-selection"))(n)||f()})),SR(e),(e=>{const t=Aa((()=>{if(!e.removed&&e.getBody().contains(document.activeElement)){const t=e.selection.getRng();if(t.collapsed){const o=_k(e,t,!1);e.selection.setRng(o)}}}),0);e.on("focus",(()=>{t.throttle()})),e.on("blur",(()=>{t.cancel()}))})(e),(e=>{e.on("init",(()=>{e.on("focusin",(t=>{const o=t.target;if(Cr(o)){const t=lb(e.getBody(),o),n=yr(t)?t:o;e.selection.getNode()!==n&&kk(e,n).each((t=>e.selection.setRng(t)))}}))}))})(e)},m=e=>vi(e)||xi(e)||Ci(e),u=e=>m(e.startContainer)||m(e.endContainer),g=t=>{const n=e.schema.getVoidElements(),r=o.createRng(),s=t.startContainer,a=t.startOffset,i=t.endContainer,l=t.endOffset;return Ee(n,s.nodeName.toLowerCase())?0===a?r.setStartBefore(s):r.setStartAfter(s):r.setStart(s,a),Ee(n,i.nodeName.toLowerCase())?0===l?r.setEndBefore(i):r.setEndAfter(i):r.setEnd(i,l),r},h=n=>{const r=n.cloneNode(!0),l=e.dispatch("ObjectSelected",{target:n,targetClone:r});if(l.isDefaultPrevented())return null;const c=((n,r)=>{const a=wo.fromDom(e.getBody()),i=e.getDoc(),l=on(a,"#"+s).getOrThunk((()=>{const e=wo.fromHtml('
    ',i);return to(e,"id",s),yn(a,e),e})),c=o.createRng();Cn(l),xn(l,[wo.fromText(qn,i),wo.fromDom(r),wo.fromText(qn,i)]),c.setStart(l.dom.firstChild,1),c.setEnd(l.dom.lastChild,0),dn(l,{top:o.getPos(n,e.getBody()).y+"px"}),$h(l);const d=t.getSel();return d&&(d.removeAllRanges(),d.addRange(c)),c})(n,l.targetClone),d=wo.fromDom(n);return q(Vn(wo.fromDom(e.getBody()),`*[${a}]`),(e=>{ko(d,e)||ao(e,a)})),o.getAttrib(n,a)||n.setAttribute(a,"1"),i=n,v(),c},p=(e,t)=>{if(!e)return null;if(e.collapsed){if(!u(e)){const r=t?1:-1,s=Rm(r,n,e),a=s.getNode(!t);if(C(a)){if(cm(a))return c(r,a,!!t&&!s.isAtEnd(),!1);if(fi(a)&&yr(a.nextSibling)){const e=o.createRng();return e.setStart(a,0),e.setEnd(a,0),e}}const i=s.getNode(t);if(C(i)){if(cm(i))return c(r,i,!t&&!s.isAtEnd(),!1);if(fi(i)&&yr(i.previousSibling)){const e=o.createRng();return e.setStart(i,1),e.setEnd(i,1),e}}}return null}let r=e.startContainer,s=e.startOffset;const a=e.endOffset;if(dr(r)&&0===s&&kR(r.parentNode)&&(r=r.parentNode,s=o.nodeIndex(r),r=r.parentNode),!tr(r))return null;if(a===s+1&&r===e.endContainer){const e=r.childNodes[s];if(l(e))return h(e)}return null},f=()=>{i&&i.removeAttribute(a),on(wo.fromDom(e.getBody()),"#"+s).each(Sn),i=null},v=()=>{r.hide()};return EC(e)||d(),{showCaret:c,showBlockCaretContainer:e=>{e.hasAttribute("data-mce-caret")&&(Si(e),t.scrollIntoView(e))},hideFakeCaret:v,destroy:()=>{r.destroy(),i=null}}},TR=(e,t)=>{let o=t;for(let t=e.previousSibling;dr(t);t=t.previousSibling)o+=t.data.length;return o},OR=(e,t,o,n,r)=>{if(dr(o)&&(n<0||n>o.data.length))return[];const s=r&&dr(o)?[TR(o,n)]:[n];let a=o;for(;a!==t&&a.parentNode;)s.push(e.nodeIndex(a,r)),a=a.parentNode;return a===t?s.reverse():[]},AR=(e,t,o,n,r,s,a=!1)=>({start:OR(e,t,o,n,a),end:OR(e,t,r,s,a)}),DR=(e,t)=>{const o=t.slice(),n=o.pop();return k(n)?J(o,((e,t)=>e.bind((e=>F.from(e.childNodes[t])))),F.some(e)).bind((e=>dr(e)&&(n<0||n>e.data.length)?F.none():F.some({node:e,offset:n}))):F.none()},MR=(e,t)=>DR(e,t.start).bind((({node:o,offset:n})=>DR(e,t.end).map((({node:e,offset:t})=>{const r=document.createRange();return r.setStart(o,n),r.setEnd(e,t),r})))),NR=(e,t,o)=>{if(t&&e.isEmpty(t)&&!o(t)){const n=t.parentNode;e.remove(t,dr(t.firstChild)&&Yn(t.firstChild.data)),NR(e,n,o)}},RR=(e,t,o,n=!0)=>{const r=t.startContainer.parentNode,s=t.endContainer.parentNode;t.deleteContents(),n&&!o(t.startContainer)&&(dr(t.startContainer)&&0===t.startContainer.data.length&&e.remove(t.startContainer),dr(t.endContainer)&&0===t.endContainer.data.length&&e.remove(t.endContainer),NR(e,r,o),r!==s&&NR(e,s,o))},BR=(e,t)=>F.from(e.dom.getParent(t.startContainer,e.dom.isBlock)),LR=(e,t,o)=>{const n=e.dynamicPatternsLookup({text:o,block:t});return{...e,blockPatterns:Vl(n).concat(e.blockPatterns),inlinePatterns:Zl(n).concat(e.inlinePatterns)}},HR=(e,t,o,n)=>{const r=e.createRng();return r.setStart(t,0),r.setEnd(o,n),r.toString()},IR=(e,t)=>e.create("span",{"data-mce-type":"bookmark",id:t}),PR=(e,t)=>{const o=e.createRng();return o.setStartAfter(t.start),o.setEndBefore(t.end),o},FR=(e,t,o)=>{const n=MR(e.getRoot(),o).getOrDie("Unable to resolve path range"),r=n.startContainer,s=n.endContainer,a=0===n.endOffset?s:s.splitText(n.endOffset),i=0===n.startOffset?r:r.splitText(n.startOffset),l=i.parentNode;return{prefix:t,end:a.parentNode.insertBefore(IR(e,t+"-end"),a),start:l.insertBefore(IR(e,t+"-start"),i)}},zR=(e,t,o)=>{NR(e,e.get(t.prefix+"-end"),o),NR(e,e.get(t.prefix+"-start"),o)},VR=e=>0===e.start.length,ZR=(e,t,o,n)=>{const r=t.start;var s;return uO(e,n.container,n.offset,(s=r,(e,t)=>{const o=e.data.substring(0,t),n=o.lastIndexOf(s.charAt(s.length-1)),r=o.lastIndexOf(s);return-1!==r?r+s.length:-1!==n?n+1:-1}),o).bind((n=>{var s,a;const i=null!==(a=null===(s=o.textContent)||void 0===s?void 0:s.indexOf(r))&&void 0!==a?a:-1;if(-1!==i&&n.offset>=i+r.length){const t=e.createRng();return t.setStart(n.container,n.offset-r.length),t.setEnd(n.container,n.offset),F.some(t)}{const s=n.offset-r.length;return dO(n.container,s,o).map((t=>{const o=e.createRng();return o.setStart(t.container,t.offset),o.setEnd(n.container,n.offset),o})).filter((e=>e.toString()===r)).orThunk((()=>ZR(e,t,o,aO(n.container,0))))}}))},UR=(e,t,o,n)=>{const r=e.dom,s=r.getRoot(),a=o.pattern,i=o.position.container,l=o.position.offset;return dO(i,l-o.pattern.end.length,t).bind((c=>{const d=AR(r,s,c.container,c.offset,i,l,n);if(VR(a))return F.some({matches:[{pattern:a,startRng:d,endRng:d}],position:c});{const i=jR(e,o.remainingPatterns,c.container,c.offset,t,n),l=i.getOr({matches:[],position:c}),m=l.position,u=((e,t,o,n,r,s=!1)=>{if(0===t.start.length&&!s){const t=e.createRng();return t.setStart(o,n),t.setEnd(o,n),F.some(t)}return cO(o,n,r).bind((o=>ZR(e,t,r,o).bind((e=>{var t;if(s){if(e.endContainer===o.container&&e.endOffset===o.offset)return F.none();if(0===o.offset&&(null===(t=e.endContainer.textContent)||void 0===t?void 0:t.length)===e.endOffset)return F.none()}return F.some(e)}))))})(r,a,m.container,m.offset,t,i.isNone());return u.map((e=>{const t=((e,t,o,n=!1)=>AR(e,t,o.startContainer,o.startOffset,o.endContainer,o.endOffset,n))(r,s,e,n);return{matches:l.matches.concat([{pattern:a,startRng:t,endRng:d}]),position:aO(e.startContainer,e.startOffset)}}))}}))},jR=(e,t,o,n,r,s)=>{const a=e.dom;return cO(o,n,a.getRoot()).bind((i=>{const l=HR(a,r,o,n);for(let a=0;a0)return jR(e,t,o,n-1,r,s);if(m.isSome())return m}return F.none()}))},WR=(e,t,o)=>{e.selection.setRng(o),"inline-format"===t.type?q(t.format,(t=>{e.formatter.apply(t)})):e.execCommand(t.cmd,!1,t.value)},$R=(e,t,o,n,r,s)=>{var a;return((e,t)=>{const o=re(e,(e=>W(t,(t=>e.pattern.start===t.pattern.start&&e.pattern.end===t.pattern.end))));return e.length===t.length?o?e:t:e.length>t.length?e:t})(jR(e,r.inlinePatterns,o,n,t,s).fold((()=>[]),(e=>e.matches)),jR(e,(a=r.inlinePatterns,le(a,((e,t)=>t.end.length-e.end.length))),o,n,t,s).fold((()=>[]),(e=>e.matches)))},qR=(e,t)=>{if(0===t.length)return;const o=e.dom,n=e.selection.getBookmark(),r=((e,t)=>{const o=ja("mce_textpattern"),n=X(t,((t,n)=>{const r=FR(e,o+`_end${t.length}`,n.endRng);return t.concat([{...n,endMarker:r}])}),[]);return X(n,((t,r)=>{const s=n.length-t.length-1,a=VR(r.pattern)?r.endMarker:FR(e,o+`_start${s}`,r.startRng);return t.concat([{...r,startMarker:a}])}),[])})(o,t);q(r,(t=>{const n=o.getParent(t.startMarker.start,o.isBlock),r=e=>e===n;VR(t.pattern)?((e,t,o,n)=>{const r=PR(e.dom,o);RR(e.dom,r,n),WR(e,t,r)})(e,t.pattern,t.endMarker,r):((e,t,o,n,r)=>{const s=e.dom,a=PR(s,n),i=PR(s,o);RR(s,i,r),RR(s,a,r);const l={prefix:o.prefix,start:o.end,end:n.start},c=PR(s,l);WR(e,t,c)})(e,t.pattern,t.startMarker,t.endMarker,r),zR(o,t.endMarker,r),zR(o,t.startMarker,r)})),e.selection.moveToBookmark(n)},GR=(e,t,o)=>((e,t,o)=>{if(dr(e)&&t>=e.length)return F.some(aO(e,t));{const n=Ya(iO);return F.from(n.forwards(e,t,lO(e),o)).map((e=>aO(e.container,0)))}})(t,0,t).map((n=>{const r=n.container;return mO(r,o.start.length,t).each((o=>{const n=e.createRng();n.setStart(r,0),n.setEnd(o.container,o.offset),RR(e,n,(e=>e===t))})),r})),KR=e=>(t,o)=>{const n=t.dom,r=o.pattern,s=MR(n.getRoot(),o.range).getOrDie("Unable to resolve path range");return BR(t,s).each((o=>{"block-format"===r.type?((e,t)=>{const o=t.get(e);return v(o)&&de(o).exists((e=>Ee(e,"block")))})(r.format,t.formatter)&&t.undoManager.transact((()=>{e(t.dom,o,r),t.formatter.apply(r.format)})):"block-command"===r.type&&t.undoManager.transact((()=>{e(t.dom,o,r),t.execCommand(r.cmd,!1,r.value)}))})),!0},YR=e=>(t,o)=>{const n=(e=>le(e,((e,t)=>t.start.length-e.start.length)))(t),r=o.replace(qn," ");return ee(n,(t=>e(t,o,r)))},XR=(e,t)=>(o,n,r,s,a)=>{var i;void 0===a&&(a=null!==(i=n.textContent)&&void 0!==i?i:"");const l=o.dom,c=sc(o);return l.is(n,c)?e(r.blockPatterns,a).map((e=>t&&Lt.trim(a).length===e.start.length?[]:[{pattern:e,range:AR(l,l.getRoot(),n,0,n,0,s)}])).getOr([]):[]},JR=KR(((e,t,o)=>{GR(e,t,o).each((e=>{const t=wo.fromDom(e),o=Ja(t);/^\s[^\s]/.test(o)&&((e,t)=>{Xa.set(e,t)})(t,o.slice(1))}))})),QR=YR(((e,t,o)=>0===t.indexOf(e.start)||0===o.indexOf(e.start))),eB=XR(QR,!0),tB=KR(GR),oB=YR(((e,t,o)=>t===e.start||o===e.start)),nB=XR(oB,!1),rB=(e,t)=>((e,t)=>{const o=e.selection.getRng();return BR(e,o).map((n=>{var r;const s=Math.max(0,o.startOffset),a=LR(t,n,null!==(r=n.textContent)&&void 0!==r?r:"");return{inlineMatches:$R(e,n,o.startContainer,s,a,!0),blockMatches:eB(e,n,a,!0)}})).filter((({inlineMatches:e,blockMatches:t})=>t.length>0||e.length>0))})(e,t).fold(I,(({inlineMatches:t,blockMatches:o})=>(e.undoManager.add(),e.undoManager.extra((()=>{e.execCommand("mceInsertNewLine")}),(()=>{(e=>{e.insertContent(di,{preserve_zwsp:!0})})(e),qR(e,t),((e,t)=>{if(0===t.length)return;const o=e.selection.getBookmark();q(t,(t=>JR(e,t))),e.selection.moveToBookmark(o)})(e,o);const n=e.selection.getRng(),r=cO(n.startContainer,n.startOffset,e.dom.getRoot());e.execCommand("mceInsertNewLine"),r.each((t=>{const o=t.container;o.data.charAt(t.offset-1)===$n&&(o.deleteData(t.offset-1,1),NR(e.dom,o.parentNode,(t=>t===e.dom.getRoot())))}))})),!0))),sB=(e,t)=>((e,t)=>{const o=e.selection.getRng();return BR(e,o).map((n=>{const r=Math.max(0,o.startOffset),s=HR(e.dom,n,o.startContainer,r),a=LR(t,n,s);return nB(e,n,a,!1,s)})).filter((e=>e.length>0))})(e,t).fold(I,(t=>(e.undoManager.transact((()=>{((e,t)=>{q(t,(t=>tB(e,t)))})(e,t)})),!0))),aB=(e,t,o)=>{for(let n=0;n{const t=[",",".",";",":","!","?"],o=[32],n=()=>{return t=Od(e),o=Ad(e),{inlinePatterns:Zl(t),blockPatterns:Vl(t),dynamicPatternsLookup:o};var t,o},r=()=>(e=>e.options.isSet("text_patterns_lookup"))(e);e.on("keydown",(t=>{if(13===t.keyCode&&!Vg.modifierPressed(t)&&e.selection.isCollapsed()){const o=Ul(n(),"enter");(o.inlinePatterns.length>0||o.blockPatterns.length>0||r())&&rB(e,o)&&t.preventDefault()}}),!0),e.on("keydown",(t=>{if(32===t.keyCode&&e.selection.isCollapsed()){const o=Ul(n(),"space");(o.blockPatterns.length>0||r())&&sB(e,o)&&t.preventDefault()}}),!0);const s=()=>{if(e.selection.isCollapsed()){const t=Ul(n(),"space");(t.inlinePatterns.length>0||r())&&((e,t)=>{const o=e.selection.getRng();BR(e,o).map((n=>{const r=Math.max(0,o.startOffset-1),s=HR(e.dom,n,o.startContainer,r),a=LR(t,n,s),i=$R(e,n,o.startContainer,r,a,!1);i.length>0&&e.undoManager.transact((()=>{qR(e,i)}))}))})(e,t)}};e.on("keyup",(e=>{aB(o,e,((e,t)=>e===t.keyCode&&!Vg.modifierPressed(t)))&&s()})),e.on("keypress",(o=>{aB(t,o,((e,t)=>e.charCodeAt(0)===t.charCode))&&sp.setEditorTimeout(e,s)}))},lB=e=>{const t=Lt.each,o=Vg.BACKSPACE,n=Vg.DELETE,r=e.dom,s=e.selection,a=e.parser,i=Mt.browser,l=i.isFirefox(),c=i.isChromium()||i.isSafari(),d=Mt.deviceType.isiPhone()||Mt.deviceType.isiPad(),m=Mt.os.isMacOS()||Mt.os.isiOS(),u=(t,o)=>{try{e.getDoc().execCommand(t,!1,String(o))}catch(e){}},g=e=>e.isDefaultPrevented(),h=()=>{const t=e=>{const t=r.create("body"),o=e.cloneContents();return t.appendChild(o),s.serializer.serialize(t,{format:"html"})};e.on("keydown",(s=>{const a=s.keyCode;if(!g(s)&&(a===n||a===o)&&e.selection.isEditable()){const o=e.selection.isCollapsed(),n=e.getBody();if(o&&!Nr(e.schema,n))return;if(!o&&!(o=>{const n=t(o),s=r.createRng();return s.selectNode(e.getBody()),n===t(s)})(e.selection.getRng()))return;s.preventDefault(),e.setContent(""),n.firstChild&&r.isBlock(n.firstChild)?e.selection.setCursorLocation(n.firstChild,0):e.selection.setCursorLocation(n,0),e.nodeChanged()}}))},p=()=>{e.shortcuts.add("meta+a",null,"SelectAll")},f=()=>{e.inline||r.bind(e.getDoc(),"mousedown mouseup",(t=>{let o;if(t.target===e.getDoc().documentElement)if(o=s.getRng(),e.getBody().focus(),"mousedown"===t.type){if(vi(o.startContainer))return;s.placeCaretAt(t.clientX,t.clientY)}else s.setRng(o)}))},v=()=>{Range.prototype.getClientRects||e.on("mousedown",(t=>{if(!g(t)&&"HTML"===t.target.nodeName){const t=e.getBody();t.blur(),sp.setEditorTimeout(e,(()=>{t.focus()}))}}))},b=()=>{const t=ld(e);e.on("click",(o=>{const n=o.target;/^(IMG|HR)$/.test(n.nodeName)&&r.isEditable(n)&&(o.preventDefault(),e.selection.select(n),e.nodeChanged()),"A"===n.nodeName&&r.hasClass(n,t)&&0===n.childNodes.length&&r.isEditable(n.parentNode)&&(o.preventDefault(),s.select(n))}))},y=()=>{e.on("keydown",(e=>{if(!g(e)&&e.keyCode===o&&s.isCollapsed()&&0===s.getRng().startOffset){const t=s.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}return!0}))},w=()=>{const t=()=>{u("StyleWithCSS",!1),u("enableInlineTableEditing",!1),Nc(e)||u("enableObjectResizing",!1)};ed(e)||e.on("BeforeExecCommand mousedown",t)},x=()=>{e.on("SetContent ExecCommand",(e=>{"setcontent"!==e.type&&"mceInsertLink"!==e.command||t(r.select("a:not([data-mce-block])"),(e=>{var t;let o=e.parentNode;const n=r.getRoot();if((null==o?void 0:o.lastChild)===e){for(;o&&!r.isBlock(o);){if((null===(t=o.parentNode)||void 0===t?void 0:t.lastChild)!==o||o===n)return;o=o.parentNode}r.add(o,"br",{"data-mce-bogus":1})}}))}))},C=()=>{e.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},S=()=>{e.inline||e.on("keydown",(()=>{document.activeElement===document.body&&e.getWin().focus()}))},k=()=>{e.inline||(e.contentStyles.push("body {min-height: 150px}"),e.on("click",(t=>{let o;"HTML"===t.target.nodeName&&(o=e.selection.getRng(),e.getBody().focus(),e.selection.setRng(o),e.selection.normalize(),e.nodeChanged())})))},_=()=>{m&&e.on("keydown",(t=>{!Vg.metaKeyPressed(t)||t.shiftKey||37!==t.keyCode&&39!==t.keyCode||(t.preventDefault(),e.selection.getSel().modify("move",37===t.keyCode?"backward":"forward","lineboundary"))}))},T=()=>{e.on("click",(e=>{let t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)})),e.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},O=()=>{e.on("init",(()=>{e.dom.bind(e.getBody(),"submit",(e=>{e.preventDefault()}))}))},A=E,D=()=>{e.on("keydown",(t=>{if(g(t)||t.keyCode!==Vg.BACKSPACE)return;let o=s.getRng();const n=o.startContainer,a=o.startOffset,i=r.getRoot();let l=n;if(o.collapsed&&0===a){for(;l.parentNode&&l.parentNode.firstChild===l&&l.parentNode!==i;)l=l.parentNode;"BLOCKQUOTE"===l.nodeName&&(e.formatter.toggle("blockquote",void 0,l),o=r.createRng(),o.setStart(n,0),o.setEnd(n,0),s.setRng(o))}})),h(),Mt.windowsPhone||e.on("keyup focusin mouseup",(t=>{Vg.modifierPressed(t)||(e=>{const t=e.getBody(),o=e.selection.getRng();return o.startContainer===o.endContainer&&o.startContainer===t&&0===o.startOffset&&o.endOffset===t.childNodes.length})(e)||s.normalize()}),!0),c&&(f(),b(),e.on("init",(()=>{u("DefaultParagraphSeparator",sc(e))})),O(),y(),a.addNodeFilter("br",(e=>{let t=e.length;for(;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()})),d?(S(),k(),T()):p()),l&&(e.on("keydown",(t=>{if(!g(t)&&t.keyCode===o){if(!e.getBody().getElementsByTagName("hr").length)return;if(s.isCollapsed()&&0===s.getRng().startOffset){const e=s.getNode(),o=e.previousSibling;if("HR"===e.nodeName)return r.remove(e),void t.preventDefault();o&&o.nodeName&&"hr"===o.nodeName.toLowerCase()&&(r.remove(o),t.preventDefault())}}})),v(),(()=>{const o=()=>{const o=r.getAttribs(s.getStart().cloneNode(!1));return()=>{const n=s.getStart();n!==e.getBody()&&(r.setAttrib(n,"style",null),t(o,(e=>{n.setAttributeNode(e.cloneNode(!0))})))}},n=()=>!s.isCollapsed()&&r.getParent(s.getStart(),r.isBlock)!==r.getParent(s.getEnd(),r.isBlock);e.on("keypress",(t=>{let r;return!(!(g(t)||8!==t.keyCode&&46!==t.keyCode)&&n()&&(r=o(),e.getDoc().execCommand("delete",!1),r(),t.preventDefault(),1))})),r.bind(e.getDoc(),"cut",(t=>{if(!g(t)&&n()){const t=o();sp.setEditorTimeout(e,(()=>{t()}))}}))})(),w(),x(),C(),_(),y())};return EC(e)?(c&&(f(),b(),O(),p(),d&&(S(),k(),T())),l&&(v(),w(),C(),_())):D(),{refreshContentEditable:A,isHidden:()=>{if(!l||e.removed)return!1;const t=e.selection.getSel();return!t||!t.rangeCount||0===t.rangeCount}}},cB=xa.DOM,dB=e=>e.inline?e.getElement().nodeName.toLowerCase():void 0,mB=e=>Ce(e,(e=>!1===w(e))),uB=e=>{const t=e.options.get,o=e.editorUpload.blobCache;return mB({allow_conditional_comments:t("allow_conditional_comments"),allow_html_data_urls:t("allow_html_data_urls"),allow_svg_data_urls:t("allow_svg_data_urls"),allow_html_in_named_anchor:t("allow_html_in_named_anchor"),allow_script_urls:t("allow_script_urls"),allow_unsafe_link_target:t("allow_unsafe_link_target"),convert_unsafe_embeds:t("convert_unsafe_embeds"),convert_fonts_to_spans:t("convert_fonts_to_spans"),fix_list_elements:t("fix_list_elements"),font_size_legacy_values:t("font_size_legacy_values"),forced_root_block:t("forced_root_block"),forced_root_block_attrs:t("forced_root_block_attrs"),preserve_cdata:t("preserve_cdata"),inline_styles:t("inline_styles"),root_name:dB(e),sandbox_iframes:t("sandbox_iframes"),sandbox_iframes_exclusions:Zd(e),sanitize:t("xss_sanitization"),validate:!0,blob_cache:o,document:e.getDoc()})},gB=e=>{const t=e.options.get;return mB({custom_elements:t("custom_elements"),extended_valid_elements:t("extended_valid_elements"),invalid_elements:t("invalid_elements"),invalid_styles:t("invalid_styles"),schema:t("schema"),valid_children:t("valid_children"),valid_classes:t("valid_classes"),valid_elements:t("valid_elements"),valid_styles:t("valid_styles"),verify_html:t("verify_html"),padd_empty_block_inline_children:t("format_empty_lines")})},hB=e=>{e.bindPendingEventDelegates(),e.initialized=!0,(e=>{e.dispatch("Init")})(e),e.focus(!0),(e=>{const t=e.dom.getRoot();e.inline||Hu(e)&&e.selection.getStart(!0)!==t||su(t).each((t=>{const o=t.getNode(),n=ir(o)?su(o).getOr(t):t;e.selection.setRng(n.toRange())}))})(e),e.nodeChanged({initial:!0});const t=md(e);S(t)&&t.call(e,e),(e=>{const t=gd(e);t&&sp.setEditorTimeout(e,(()=>{let o;o=!0===t?e:e.editorManager.get(t),o&&!o.destroyed&&(o.focus(),o.selection.scrollIntoView())}),100)})(e)},pB=e=>e.inline?e.ui.styleSheetLoader:e.dom.styleSheetLoader,fB=e=>{const t=pB(e),o=Ac(e),n=e.contentCSS,r=()=>{t.unloadAll(n),e.inline||e.ui.styleSheetLoader.unloadAll(o)},s=()=>{e.removed?r():e.on("remove",r)};if(e.contentStyles.length>0){let t="";Lt.each(e.contentStyles,(e=>{t+=e+"\r\n"})),e.dom.addStyle(t)}const a=Promise.all(((e,t,o)=>{const{pass:n,fail:r}=K(t,(e=>tinymce.Resource.has(OS(e)))),s=n.map((t=>{const o=tinymce.Resource.get(OS(t));return h(o)?Promise.resolve(pB(e).loadRawCss(t,o)):Promise.resolve()})),a=[...s,pB(e).loadAll(r)];return e.inline?a:a.concat([e.ui.styleSheetLoader.loadAll(o)])})(e,n,o)).then(s).catch(s),i=Oc(e);return i&&((e,t)=>{const o=wo.fromDom(e.getBody()),n=Wo(jo(o)),r=wo.fromTag("style");to(r,"type","text/css"),yn(r,wo.fromText(t)),yn(n,r),e.on("remove",(()=>{Sn(r)}))})(e,i),a},vB=e=>{!0!==e.removed&&((e=>{EC(e)||e.load({initial:!0,format:"html"}),e.startContent=e.getContent({format:"raw"})})(e),hB(e))},bB=e=>{const t=e.getElement();let o=e.getDoc();e.inline&&(cB.addClass(t,"mce-content-body"),e.contentDocument=o=document,e.contentWindow=window,e.bodyElement=t,e.contentAreaContainer=t);const n=e.getBody();n.disabled=!0,e.readonly=ed(e),e._editableRoot=td(e),!e.readonly&&e.hasEditableRoot()&&(e.inline&&"static"===cB.getStyle(n,"position",!0)&&(n.style.position="relative"),n.contentEditable="true"),n.disabled=!1,e.editorUpload=FS(e),e.schema=Ws(gB(e)),e.dom=xa(o,{keep_values:!0,url_converter:e.convertURL,url_converter_scope:e,update_styles:!0,root_element:e.inline?e.getBody():null,collect:e.inline,schema:e.schema,contentCssCors:xc(e),referrerPolicy:Cc(e),onSetAttrib:t=>{e.dispatch("SetAttrib",t)}}),e.parser=(e=>{const t=zx(uB(e),e.schema);return t.addAttributeFilter("src,href,style,tabindex",((t,o)=>{const n=e.dom,r="data-mce-"+o;let s=t.length;for(;s--;){const a=t[s];let i=a.attr(o);if(i&&!a.attr(r)){if(0===i.indexOf("data:")||0===i.indexOf("blob:"))continue;"style"===o?(i=n.serializeStyle(n.parseStyle(i),a.name),i.length||(i=null),a.attr(r,i),a.attr(o,i)):"tabindex"===o?(a.attr(r,i),a.attr(o,null)):a.attr(r,e.convertURL(i,o,a.name))}}})),t.addNodeFilter("script",(e=>{let t=e.length;for(;t--;){const o=e[t],n=o.attr("type")||"no/type";0!==n.indexOf("mce-")&&o.attr("type","mce-"+n)}})),Rd(e)&&t.addNodeFilter("#cdata",(t=>{var o;let n=t.length;for(;n--;){const r=t[n];r.type=8,r.name="#comment",r.value="[CDATA["+e.dom.encode(null!==(o=r.value)&&void 0!==o?o:"")+"]]"}})),t.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(t=>{let o=t.length;const n=e.schema.getNonEmptyElements();for(;o--;){const e=t[o];e.isEmpty(n)&&0===e.getAll("br").length&&e.append(new Np("br",1))}})),t})(e),e.serializer=jC((e=>{const t=e.options.get;return{...uB(e),...gB(e),...mB({remove_trailing_brs:t("remove_trailing_brs"),pad_empty_with_br:t("pad_empty_with_br"),url_converter:t("url_converter"),url_converter_scope:t("url_converter_scope"),element_format:t("element_format"),entities:t("entities"),entity_encoding:t("entity_encoding"),indent:t("indent"),indent_after:t("indent_after"),indent_before:t("indent_before")})}})(e),e),e.selection=PC(e.dom,e.getWin(),e.serializer,e),e.annotator=Mg(e),e.formatter=XS(e),e.undoManager=QS(e),e._nodeChangeDispatcher=new SM(e),e._selectionOverrides=ER(e),qE(e),FN(e),nT(e),EC(e)||((e=>{e.on("mousedown",(t=>{t.detail>=3&&(t.preventDefault(),qN(e))}))})(e),(e=>{iB(e)})(e));const r=CM(e);WE(e,r),(e=>{e.on("NodeChange",(()=>JE(e)))})(e),rk(e),PN(e);const s=TC(e);(e=>{const t=e.getDoc(),o=e.getBody();(e=>{e.dispatch("PreInit")})(e),hd(e)||(t.body.spellcheck=!1,cB.setAttrib(o,"spellcheck","false")),e.quirks=lB(e),(e=>{e.dispatch("PostRender")})(e);const n=Dc(e);void 0!==n&&(o.dir=n);const r=pd(e);r&&e.on("BeforeSetContent",(e=>{Lt.each(r,(t=>{e.content=e.content.replace(t,(e=>"\x3c!--mce:protected "+escape(e)+"--\x3e"))}))})),e.on("SetContent",(()=>{e.addVisual(e.getBody())})),e.on("compositionstart compositionend",(t=>{e.composing="compositionstart"===t.type}))})(e),(e=>{const t=jd(e);h(Wd(e))||!w(t)&&"INVALID"!==(e=>(e=>"gpl"===e.toLowerCase())(e)||(e=>e.length>=64&&e.length<=255)(e)?"VALID":"INVALID")(t)||console.warn("TinyMCE is running in evaluation mode. Provide a valid license key or add license_key: 'gpl' to the init config to agree to the open source license terms. Read more at https://www.tiny.cloud/license-key/")})(e),s.fold((()=>{const t=(e=>{let t=!1;const o=setTimeout((()=>{t||e.setProgressState(!0)}),500);return()=>{clearTimeout(o),t=!0,e.setProgressState(!1)}})(e);fB(e).then((()=>{vB(e),t()}))}),(t=>{e.setProgressState(!0),fB(e).then((()=>{t().then((t=>{e.setProgressState(!1),vB(e),DC(e)}),(t=>{e.notificationManager.open({type:"error",text:String(t)}),vB(e),DC(e)}))}))}))},yB=P,wB=xa.DOM,xB=(e,t)=>{const o=Mt.browser.isFirefox()?cd(e):"Rich Text Area",n=e.translate(o),r=ro(wo.fromDom(e.getElement()),"tabindex").bind(Qe),s=((e,t,o,n)=>{const r=wo.fromTag("iframe");return n.each((e=>to(r,"tabindex",e))),oo(r,o),oo(r,{id:e+"_ifr",frameBorder:"0",allowTransparency:"true",title:t}),ho(r,"tox-edit-area__iframe"),r})(e.id,n,Jl(e),r).dom;s.onload=()=>{s.onload=null,e.dispatch("load")},e.contentAreaContainer=t.iframeContainer,e.iframeElement=s,e.iframeHTML=(e=>{let t=Ql(e)+"";ec(e)!==e.documentBaseUrl&&(t+=''),t+='';const o=tc(e),n=oc(e),r=e.translate(cd(e));return nc(e)&&(t+=''),t+=`
    `,t})(e),wB.add(t.iframeContainer,s)},CB=e=>{const t=e.iframeElement,o=()=>{e.contentDocument=t.contentDocument,bB(e)};if(Hd(e)||Mt.browser.isFirefox()){const t=e.getDoc();t.open(),t.write(e.iframeHTML),t.close(),o()}else{const r=(n=wo.fromDom(t),An(n,"load",yB,(()=>{r.unbind(),o()})));t.srcdoc=e.iframeHTML}var n},SB=xa.DOM,kB=(e,t,o)=>{const n=wS.get(o),r=wS.urls[o]||e.documentBaseUrl.replace(/\/$/,"");if(o=Lt.trim(o),n&&-1===Lt.inArray(t,o)){if(e.plugins[o])return;try{const s=n(e,r)||{};e.plugins[o]=s,S(s.init)&&(s.init(e,r),t.push(o))}catch(t){((e,t,o)=>{const n=Ta.translate(["Failed to initialize plugin: {0}",t]);Bg(e,"PluginLoadError",{message:n}),TS(n,o),kS(e,n)})(e,o,t)}}},_B=(e,t)=>({editorContainer:e,iframeContainer:t,api:{}}),EB=e=>{const t=e.getElement();return e.inline?_B(null):(e=>{const t=SB.create("div");return SB.insertAfter(t,e),_B(t,t)})(t)},TB=e=>{const t=e.getElement();return e.orgDisplay=t.style.display,h(Ic(e))?(e=>{const t=e.theme.renderUI;return t?t():EB(e)})(e):S(Ic(e))?(e=>{const t=e.getElement(),o=Ic(e)(e,t);return o.editorContainer.nodeType&&(o.editorContainer.id=o.editorContainer.id||e.id+"_parent"),o.iframeContainer&&o.iframeContainer.nodeType&&(o.iframeContainer.id=o.iframeContainer.id||e.id+"_iframecontainer"),o.height=o.iframeHeight?o.iframeHeight:t.offsetHeight,o})(e):EB(e)},OB=async e=>{e.dispatch("ScriptsLoaded"),(e=>{const t=Lt.trim(pc(e)),o=e.ui.registry.getAll().icons,n={...cS.get("default").icons,...cS.get(t).icons};ve(n,((t,n)=>{Ee(o,n)||e.ui.registry.addIcon(n,t)}))})(e),(e=>{const t=Ic(e);if(h(t)){const o=xS.get(t);e.theme=o(e,xS.urls[t])||{},S(e.theme.init)&&e.theme.init(e,xS.urls[t]||e.documentBaseUrl.replace(/\/$/,""))}else e.theme={}})(e),(e=>{const t=Fc(e),o=dS.get(t);e.model=o(e,dS.urls[t])})(e),(e=>{const t=[];q(nd(e),(o=>{kB(e,t,(e=>e.replace(/^\-/,""))(o))}))})(e);const t=await TB(e);((e,t)=>{const o={show:F.from(t.show).getOr(E),hide:F.from(t.hide).getOr(E),isEnabled:F.from(t.isEnabled).getOr(P),setEnabled:o=>{e.mode.isReadOnly()||F.from(t.setEnabled).each((e=>e(o)))}};e.ui={...e.ui,...o}})(e,F.from(t.api).getOr({})),e.editorContainer=t.editorContainer,DS(e),e.inline?bB(e):((e,t)=>{xB(e,t),t.editorContainer&&(t.editorContainer.style.display=e.orgDisplay,e.hidden=wB.isHidden(t.editorContainer)),e.getElement().style.display="none",wB.setAttrib(e.id,"aria-hidden","true"),e.getElement().style.visibility=e.orgVisibility,CB(e)})(e,{editorContainer:t.editorContainer,iframeContainer:t.iframeContainer})},AB=xa.DOM,DB=e=>"-"===e.charAt(0),MB=(e,t)=>{const o=Sc(t),n=kc(t);if(!Ta.hasCode(o)&&"en"!==o){const r=Xe(n)?n:`${t.editorManager.baseURL}/langs/${o}.js`;e.add(r).catch((()=>{((e,t,o)=>{_S(e,"LanguageLoadError",ES("language",t,o))})(t,r,o)}))}},NB=(e,t)=>{const o=Ic(e);if(h(o)&&!DB(o)&&!Ee(xS.urls,o)){const n=Pc(e),r=n?e.documentBaseURI.toAbsolute(n):`themes/${o}/theme${t}.js`;xS.load(o,r).catch((()=>{((e,t,o)=>{_S(e,"ThemeLoadError",ES("theme",t,o))})(e,r,o)}))}},RB=(e,t)=>{const o=Fc(e);if("plugin"!==o&&!Ee(dS.urls,o)){const n=zc(e),r=h(n)?e.documentBaseURI.toAbsolute(n):`models/${o}/model${t}.js`;dS.load(o,r).catch((()=>{((e,t,o)=>{_S(e,"ModelLoadError",ES("model",t,o))})(e,r,o)}))}},BB=(e,t,o)=>F.from(t).filter((e=>Xe(e)&&!cS.has(e))).map((t=>({url:`${e.editorManager.baseURL}/icons/${t}/icons${o}.js`,name:F.some(t)}))),LB=(e,t,o)=>{const n=BB(t,"default",o),r=(e=>F.from(fc(e)).filter(Xe).map((e=>({url:e,name:F.none()}))))(t).orThunk((()=>BB(t,pc(t),"")));q((e=>{const t=[],o=e=>{t.push(e)};for(let t=0;t{e.add(o.url).catch((()=>{((e,t,o)=>{_S(e,"IconsLoadError",ES("icons",t,o))})(t,o.url,o.name.getOrUndefined())}))}))},HB=(e,t)=>{const o=(t,o)=>{wS.load(t,o).catch((()=>{((e,t,o)=>{_S(e,"PluginLoadError",ES("plugin",t,o))})(e,o,t)}))};ve(rd(e),((t,n)=>{o(n,t),e.options.set("plugins",nd(e).concat(n))})),q(nd(e),(e=>{!(e=Lt.trim(e))||wS.urls[e]||DB(e)||o(e,`plugins/${e}/plugin${t}.js`)}))},IB=(e,t)=>{const o=Sa.ScriptLoader,n=()=>{!e.removed&&(e=>{const t=Ic(e);return!h(t)||C(xS.get(t))})(e)&&(e=>{const t=Fc(e);return C(dS.get(t))})(e)&&OB(e)};NB(e,t),RB(e,t),MB(o,e),LB(o,e,t),HB(e,t),o.loadQueue().then(n,n)},PB=e=>{const t=e.id;Ta.setCode(Sc(e));const o=()=>{AB.unbind(window,"ready",o),e.render()};if(!ma.Event.domLoaded)return void AB.bind(window,"ready",o);if(!e.getElement())return;const n=wo.fromDom(e.getElement()),r=io(n);e.on("remove",(()=>{G(n.dom.attributes,(e=>ao(n,e.name))),oo(n,r)})),e.ui.styleSheetLoader=((e,t)=>ls.forElement(e,{contentCssCors:od(t),referrerPolicy:Cc(t)}))(n,e),qc(e)?e.inline=!0:(e.orgVisibility=e.getElement().style.visibility,e.getElement().style.visibility="hidden");const s=e.getElement().form||AB.getParent(t,"form");s&&(e.formElement=s,Gc(e)&&!cr(e.getElement())&&(AB.insertAfter(AB.create("input",{type:"hidden",name:t}),t),e.hasHiddenInput=!0),e.formEventDelegate=t=>{e.dispatch(t.type,t)},AB.bind(s,"submit reset",e.formEventDelegate),e.on("reset",(()=>{e.resetContent()})),!Kc(e)||s.submit.nodeType||s.submit.length||s._mceOldSubmit||(s._mceOldSubmit=s.submit,s.submit=()=>(e.editorManager.triggerSave(),e.setDirty(!1),s._mceOldSubmit(s)))),e.windowManager=CS(e),e.notificationManager=yS(e),(e=>"xml"===e.options.get("encoding"))(e)&&e.on("GetContent",(e=>{e.save&&(e.content=AB.encode(e.content))})),Yc(e)&&e.on("submit",(()=>{e.initialized&&e.save()})),Xc(e)&&(e._beforeUnload=()=>{!e.initialized||e.destroyed||e.isHidden()||e.save({format:"raw",no_events:!0,set_dirty:!1})},e.editorManager.on("BeforeUnload",e._beforeUnload)),e.editorManager.add(e),IB(e,e.suffix)},FB=kt().deviceType,zB=FB.isPhone(),VB=FB.isTablet(),ZB=e=>{if(x(e))return[];{const t=v(e)?e:e.split(/[ ,]/),o=$(t,Ge);return Y(o,Xe)}},UB=(e,t)=>{const o=((e,t)=>{const o={},n={};return xe(e,t,we(o),we(n)),{t:o,f:n}})(t,((t,o)=>j(e,o)));return n=o.t,r=o.f,{sections:A(n),options:A(r)};var n,r},jB=(e,t)=>Ee(e.sections(),t),WB=(e,t)=>({table_grid:!1,object_resizing:!1,resize:!1,toolbar_mode:_e(e,"toolbar_mode").getOr("scrolling"),toolbar_sticky:!1,...t?{menubar:!1}:{}}),$B=(e,t)=>{var o;const n=null!==(o=t.external_plugins)&&void 0!==o?o:{};return e&&e.external_plugins?Lt.extend({},e.external_plugins,n):n},qB=(e,t,o,n)=>{const r=ZB(o.forced_plugins),s=ZB(n.plugins),a=((e,t)=>jB(e,t)?e.sections()[t]:{})(t,"mobile"),i=((e,t,o,n)=>e&&jB(t,"mobile")?n:o)(e,t,s,a.plugins?ZB(a.plugins):s),l=((e,t)=>[...ZB(e),...ZB(t)])(r,i);return Lt.extend(n,{forced_plugins:r,plugins:l})},GB=(e,t,o,n,r)=>{var s;const a=e?{mobile:WB(null!==(s=r.mobile)&&void 0!==s?s:{},t)}:{},i=UB(["mobile"],PO(a,r)),l=Lt.extend(o,n,i.options(),((e,t)=>e&&jB(t,"mobile"))(e,i)?((e,t,o={})=>{const n=e.sections(),r=_e(n,t).getOr({});return Lt.extend({},o,r)})(i,"mobile"):{},{external_plugins:$B(n,i.options())});return qB(e,i,n,l)},KB=(e,t)=>((e,t)=>AC(e).editor.addVisual(t))(e,t),YB=e=>{const t=t=>()=>{q("left,center,right,justify".split(","),(o=>{t!==o&&e.formatter.remove("align"+o)})),"none"!==t&&((t,o)=>{e.formatter.toggle(t,o),e.nodeChanged()})("align"+t)};e.editorCommands.addCommands({JustifyLeft:t("left"),JustifyCenter:t("center"),JustifyRight:t("right"),JustifyFull:t("justify"),JustifyNone:t("none")})},XB=e=>{YB(e),(e=>{const t=t=>()=>{const o=e.selection,n=o.isCollapsed()?[e.dom.getParent(o.getNode(),e.dom.isBlock)]:o.getSelectedBlocks();return W(n,(o=>C(e.formatter.matchNode(o,t))))};e.editorCommands.addCommands({JustifyLeft:t("alignleft"),JustifyCenter:t("aligncenter"),JustifyRight:t("alignright"),JustifyFull:t("alignjustify")},"state")})(e)},JB=(e,t)=>{const o=e.selection,n=e.dom;return/^ | $/.test(t)?((e,t,o,n)=>{const r=wo.fromDom(e.getRoot());return o=$f(r,ml.fromRangeStart(t),n)?o.replace(/^ /," "):o.replace(/^ /," "),qf(r,ml.fromRangeEnd(t),n)?o.replace(/( | )()?$/," "):o.replace(/ ()?$/," ")})(n,o.getRng(),t,e.schema):t},QB=(e,t)=>{if(e.selection.isEditable()){const{content:o,details:n}=(e=>{if("string"!=typeof e){const t=Lt.extend({paste:e.paste,data:{paste:e.paste}},e);return{content:e.content,details:t}}return{content:e,details:{}}})(t);Wx(e,{...n,content:JB(e,o),format:"html",set:!1,selection:!0}).each((t=>{const o=((e,t,o)=>OC(e).editor.insertContent(t,o))(e,t.content,n);$x(e,o,t),e.addVisual()}))}},eL={"font-size":"size","font-family":"face"},tL=Qt("font"),oL=(e,t,o)=>Ub(wo.fromDom(o),(t=>(t=>gn(t,e).orThunk((()=>tL(t)?_e(eL,e).bind((e=>ro(t,e))):F.none())))(t)),(e=>ko(wo.fromDom(t),e))),nL=e=>(t,o)=>F.from(o).map(wo.fromDom).filter(Kt).bind((o=>oL(e,t,o.dom).or(((e,t)=>F.from(xa.DOM.getStyle(t,e,!0)))(e,o.dom)))).getOr(""),rL=nL("font-size"),sL=T((e=>e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")),nL("font-family")),aL=e=>su(e.getBody()).bind((e=>{const t=e.container();return F.from(dr(t)?t.parentNode:t)})),iL=(e,t)=>(e=>F.from(e.selection.getRng()).bind((t=>{const o=e.getBody();return t.startContainer===o&&0===t.startOffset?F.none():F.from(e.selection.getStart(!0))})))(e).orThunk(N(aL,e)).map(wo.fromDom).filter(Kt).bind(t),lL=(e,t)=>iL(e,O(F.some,t)),cL=(e,t)=>{if(/^[0-9.]+$/.test(t)){const o=parseInt(t,10);if(o>=1&&o<=7){const n=(e=>Lt.explode(e.options.get("font_size_style_values")))(e),r=(e=>Lt.explode(e.options.get("font_size_classes")))(e);return r.length>0?r[o-1]||t:n[o-1]||t}return t}return t},dL=e=>{const t=e.split(/\s*,\s*/);return $(t,(e=>-1===e.indexOf(" ")||We(e,'"')||We(e,"'")?e:`'${e}'`)).join(",")},mL=e=>{const t=(t,o)=>{e.formatter.toggle(t,o),e.nodeChanged()};e.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":e=>{t(e)},"ForeColor,HiliteColor":(e,o,n)=>{t(e,{value:n})},BackColor:(e,o,n)=>{t("hilitecolor",{value:n})},FontName:(t,o,n)=>{((e,t)=>{const o=cL(e,t);e.formatter.toggle("fontname",{value:dL(o)}),e.nodeChanged()})(e,n)},FontSize:(t,o,n)=>{((e,t)=>{e.formatter.toggle("fontsize",{value:cL(e,t)}),e.nodeChanged()})(e,n)},LineHeight:(t,o,n)=>{((e,t)=>{e.formatter.toggle("lineheight",{value:String(t)}),e.nodeChanged()})(e,n)},Lang:(e,o,n)=>{var r;t(e,{value:n.code,customValue:null!==(r=n.customCode)&&void 0!==r?r:null})},RemoveFormat:t=>{e.formatter.remove(t)},mceBlockQuote:()=>{t("blockquote")},FormatBlock:(e,o,n)=>{t(h(n)?n:"p")},mceToggleFormat:(e,o,n)=>{t(n)}})},uL=e=>{const t=t=>e.formatter.match(t);e.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":e=>t(e),mceBlockQuote:()=>t("blockquote")},"state"),e.editorCommands.addQueryValueHandler("FontName",(()=>(e=>lL(e,(t=>sL(e.getBody(),t.dom))).getOr(""))(e))),e.editorCommands.addQueryValueHandler("FontSize",(()=>(e=>lL(e,(t=>rL(e.getBody(),t.dom))).getOr(""))(e))),e.editorCommands.addQueryValueHandler("LineHeight",(()=>(e=>lL(e,(t=>{const o=wo.fromDom(e.getBody()),n=Ub(t,(e=>gn(e,"line-height")),N(ko,o));return n.getOrThunk((()=>{const e=parseFloat(mn(t,"line-height")),o=parseFloat(mn(t,"font-size"));return String(e/o)}))})).getOr(""))(e)))},gL=e=>{e.editorCommands.addCommands({Indent:()=>{(e=>{VE(e,"indent")})(e)},Outdent:()=>{ZE(e)}}),e.editorCommands.addCommands({Outdent:()=>PE(e)},"state")},hL=(e,t)=>{const o=e.dom,n=e.selection.getRng(),r=t?e.selection.getStart():e.selection.getEnd(),s=t?n.startContainer:n.endContainer,a=gD(o,s);if(!a||!a.isContentEditable)return;const i=t?fn:vn,l=sc(e);((e,t,o,n)=>{const r=e.dom,s=e=>r.isBlock(e)&&e.parentElement===o,a=s(t)?t:r.getParent(n,s,o);return F.from(a).map(wo.fromDom)})(e,r,a,s).each((t=>{const o=vD(e,s,t.dom,a,!1,l);i(t,wo.fromDom(o)),e.selection.setCursorLocation(o,0),e.dispatch("NewBlock",{newBlock:o}),sD(e,"insertParagraph")}))},pL=e=>{e.editorCommands.addCommands({InsertNewBlockBefore:()=>{(e=>{hL(e,!0)})(e)},InsertNewBlockAfter:()=>{(e=>{hL(e,!1)})(e)}})},fL=e=>{XB(e),(e=>{e.editorCommands.addCommands({"Cut,Copy,Paste":t=>{const o=e.getDoc();let n;try{o.execCommand(t)}catch(e){n=!0}if("paste"!==t||o.queryCommandEnabled(t)||(n=!0),n||!o.queryCommandSupported(t)){let t=e.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");(Mt.os.isMacOS()||Mt.os.isiOS())&&(t=t.replace(/Ctrl\+/g,"⌘+")),e.notificationManager.open({text:t,type:"error"})}}})})(e),(e=>{e.editorCommands.addCommands({mceAddUndoLevel:()=>{e.undoManager.add()},mceEndUndoLevel:()=>{e.undoManager.add()},Undo:()=>{e.undoManager.undo()},Redo:()=>{e.undoManager.redo()}})})(e),(e=>{e.editorCommands.addCommands({mceSelectNodeDepth:(t,o,n)=>{let r=0;e.dom.getParent(e.selection.getNode(),(t=>!tr(t)||r++!==n||(e.selection.select(t),!1)),e.getBody())},mceSelectNode:(t,o,n)=>{e.selection.select(n)},selectAll:()=>{const t=e.dom.getParent(e.selection.getStart(),br);if(t){const o=e.dom.createRng();o.selectNodeContents(t),e.selection.setRng(o)}}})})(e),(e=>{e.editorCommands.addCommands({mceCleanup:()=>{const t=e.selection.getBookmark();e.setContent(e.getContent()),e.selection.moveToBookmark(t)},insertImage:(t,o,n)=>{QB(e,e.dom.createHTML("img",{src:n}))},insertHorizontalRule:()=>{e.execCommand("mceInsertContent",!1,"
    ")},insertText:(t,o,n)=>{QB(e,e.dom.encode(n))},insertHTML:(t,o,n)=>{QB(e,n)},mceInsertContent:(t,o,n)=>{QB(e,n)},mceSetContent:(t,o,n)=>{e.setContent(n)},mceReplaceContent:(t,o,n)=>{e.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,e.selection.getContent({format:"text"})))},mceNewDocument:()=>{e.setContent(wd(e))}})})(e),(e=>{const t=(t,o,n)=>{const r=h(n)?{href:n}:n,s=e.dom.getParent(e.selection.getNode(),"a");p(r)&&h(r.href)&&(r.href=r.href.replace(/ /g,"%20"),s&&r.href||e.formatter.remove("link"),r.href&&e.formatter.apply("link",r,s))};e.editorCommands.addCommands({unlink:()=>{if(e.selection.isEditable()){if(e.selection.isCollapsed()){const t=e.dom.getParent(e.selection.getStart(),"a");return void(t&&e.dom.remove(t,!0))}e.formatter.remove("link")}},mceInsertLink:t,createLink:t})})(e),gL(e),pL(e),(e=>{e.editorCommands.addCommands({insertParagraph:()=>{eM(MD,e)},mceInsertNewLine:(t,o,n)=>{tM(e,n)},InsertLineBreak:(t,o,n)=>{eM(zD,e)}})})(e),(e=>{mL(e),uL(e)})(e),(e=>{e.editorCommands.addCommands({mceRemoveNode:(t,o,n)=>{const r=null!=n?n:e.selection.getNode();if(r!==e.getBody()){const t=e.selection.getBookmark();e.dom.remove(r,!0),e.selection.moveToBookmark(t)}},mcePrint:()=>{e.getWin().print()},mceFocus:(t,o,n)=>{xp(e,!0===n)},mceToggleVisualAid:()=>{e.hasVisual=!e.hasVisual,e.addVisual()}})})(e)},vL=["toggleview"],bL=e=>j(vL,e.toLowerCase());class yL{constructor(e){this.commands={state:{},exec:{},value:{}},this.editor=e}execCommand(e,t=!1,o,n){const r=this.editor,s=e.toLowerCase(),a=null==n?void 0:n.skip_focus;if(r.removed)return!1;if("mcefocus"!==s&&(/^(mceAddUndoLevel|mceEndUndoLevel)$/i.test(s)||a?(e=>{np(e).each((t=>e.selection.setRng(t)))})(r):r.focus()),r.dispatch("BeforeExecCommand",{command:e,ui:t,value:o}).isDefaultPrevented())return!1;const i=this.commands.exec[s];return!!S(i)&&(i(s,t,o),r.dispatch("ExecCommand",{command:e,ui:t,value:o}),!0)}queryCommandState(e){if(!bL(e)&&this.editor.quirks.isHidden()||this.editor.removed)return!1;const t=e.toLowerCase(),o=this.commands.state[t];return!!S(o)&&o(t)}queryCommandValue(e){if(!bL(e)&&this.editor.quirks.isHidden()||this.editor.removed)return"";const t=e.toLowerCase(),o=this.commands.value[t];return S(o)?o(t):""}addCommands(e,t="exec"){const o=this.commands;ve(e,((e,n)=>{q(n.toLowerCase().split(","),(n=>{o[t][n]=e}))}))}addCommand(e,t,o){const n=e.toLowerCase();this.commands.exec[n]=(e,n,r)=>t.call(null!=o?o:this.editor,n,r)}queryCommandSupported(e){const t=e.toLowerCase();return!!this.commands.exec[t]}addQueryStateHandler(e,t,o){this.commands.state[e.toLowerCase()]=()=>t.call(null!=o?o:this.editor)}addQueryValueHandler(e,t,o){this.commands.value[e.toLowerCase()]=()=>t.call(null!=o?o:this.editor)}}const wL="data-mce-contenteditable",xL=(e,t,o)=>{try{e.getDoc().execCommand(t,!1,String(o))}catch(e){}},CL=(e,t)=>{e.dom.contentEditable=t?"true":"false"},SL=(e,t)=>{const o=wo.fromDom(e.getBody());((e,t,o)=>{bo(e,t)&&!o?fo(e,t):o&&ho(e,t)})(o,"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e._selectionOverrides.hideFakeCaret(),(e=>{F.from(e.selection.getNode()).each((e=>{e.removeAttribute("data-mce-selected")}))})(e),e.readonly=!0,CL(o,!1),q(Vn(o,'*[contenteditable="true"]'),(e=>{to(e,wL,"true"),CL(e,!1)}))):(e.readonly=!1,e.hasEditableRoot()&&CL(o,!0),(e=>{q(Vn(e,`*[${wL}="true"]`),(e=>{ao(e,wL),CL(e,!0)}))})(o),xL(e,"StyleWithCSS",!1),xL(e,"enableInlineTableEditing",!1),xL(e,"enableObjectResizing",!1),yp(e)&&e.focus(),(e=>{e.selection.setRng(e.selection.getRng())})(e),e.nodeChanged())},kL=e=>e.readonly,_L=e=>{e.parser.addAttributeFilter("contenteditable",(t=>{kL(e)&&q(t,(e=>{e.attr(wL,e.attr("contenteditable")),e.attr("contenteditable","false")}))})),e.serializer.addAttributeFilter(wL,(t=>{kL(e)&&q(t,(e=>{e.attr("contenteditable",e.attr(wL))}))})),e.serializer.addTempAttr(wL)},EL=["copy"],TL=(e,t)=>{if((e=>"click"===e.type)(t)&&!Vg.metaKeyPressed(t)){const o=wo.fromDom(t.target);((e,t)=>nn(t,"a",(t=>ko(t,wo.fromDom(e.getBody())))).bind((e=>ro(e,"href"))))(e,o).each((o=>{if(t.preventDefault(),/^#/.test(o)){const t=e.dom.select(`${o},[name="${Ue(o,"#")}"]`);t.length&&e.selection.scrollIntoView(t[0],!0)}else window.open(o,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes")}))}else(e=>j(EL,e.type))(t)&&e.dispatch(t.type,t)},OL=Lt.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," ");class AL{static isNative(e){return!!OL[e.toLowerCase()]}constructor(e){this.bindings={},this.settings=e||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||I}fire(e,t){return this.dispatch(e,t)}dispatch(e,t){const o=e.toLowerCase(),n=sa(o,null!=t?t:{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(n);const r=this.bindings[o];if(r)for(let e=0,t=r.length;e{this.toggleEvent(t,!1),delete this.bindings[t]})),this;if(s){if(t){const e=K(s,(e=>e.func===t));s=e.fail,this.bindings[r]=s,q(e.pass,(e=>{e.removed=!0}))}else s.length=0;s.length||(this.toggleEvent(e,!1),delete this.bindings[r])}}}else ve(this.bindings,((e,t)=>{this.toggleEvent(t,!1)})),this.bindings={};return this}once(e,t,o){return this.on(e,t,o,{once:!0})}has(e){e=e.toLowerCase();const t=this.bindings[e];return!(!t||0===t.length)}}const DL=e=>(e._eventDispatcher||(e._eventDispatcher=new AL({scope:e,toggleEvent:(t,o)=>{AL.isNative(t)&&e.toggleNativeEvent&&e.toggleNativeEvent(t,o)}})),e._eventDispatcher),ML={fire(e,t,o){return this.dispatch(e,t,o)},dispatch(e,t,o){const n=this;if(n.removed&&"remove"!==e&&"detach"!==e)return sa(e.toLowerCase(),null!=t?t:{},n);const r=DL(n).dispatch(e,t);if(!1!==o&&n.parent){let t=n.parent();for(;t&&!r.isPropagationStopped();)t.dispatch(e,r,!1),t=t.parent?t.parent():void 0}return r},on(e,t,o){return DL(this).on(e,t,o)},off(e,t){return DL(this).off(e,t)},once(e,t){return DL(this).once(e,t)},hasEventListeners(e){return DL(this).has(e)}},NL=xa.DOM;let RL;const BL=(e,t)=>{if("selectionchange"===t)return e.getDoc();if(!e.inline&&/^(?:mouse|touch|click|contextmenu|drop|dragover|dragend)/.test(t))return e.getDoc().documentElement;const o=Lc(e);return o?(e.eventRoot||(e.eventRoot=NL.select(o)[0]),e.eventRoot):e.getBody()},LL=(e,t,o)=>{(e=>!e.hidden&&!kL(e))(e)?e.dispatch(t,o):kL(e)&&TL(e,o)},HL=(e,t)=>{if(e.delegates||(e.delegates={}),e.delegates[t]||e.removed)return;const o=BL(e,t);if(Lc(e)){if(RL||(RL={},e.editorManager.on("removeEditor",(()=>{e.editorManager.activeEditor||RL&&(ve(RL,((t,o)=>{e.dom.unbind(BL(e,o))})),RL=null)}))),RL[t])return;const n=o=>{const n=o.target,r=e.editorManager.get();let s=r.length;for(;s--;){const e=r[s].getBody();(e===n||NL.isChildOf(n,e))&&LL(r[s],t,o)}};RL[t]=n,NL.bind(o,t,n)}else{const n=o=>{LL(e,t,o)};NL.bind(o,t,n),e.delegates[t]=n}},IL={...ML,bindPendingEventDelegates(){const e=this;Lt.each(e._pendingNativeEvents,(t=>{HL(e,t)}))},toggleNativeEvent(e,t){const o=this;"focus"!==e&&"blur"!==e&&(o.removed||(t?o.initialized?HL(o,e):o._pendingNativeEvents?o._pendingNativeEvents.push(e):o._pendingNativeEvents=[e]:o.initialized&&o.delegates&&(o.dom.unbind(BL(o,e),e,o.delegates[e]),delete o.delegates[e])))},unbindAllNativeEvents(){const e=this,t=e.getBody(),o=e.dom;e.delegates&&(ve(e.delegates,((t,o)=>{e.dom.unbind(BL(e,o),o,t)})),delete e.delegates),!e.inline&&t&&o&&(t.onload=null,o.unbind(e.getWin()),o.unbind(e.getDoc())),o&&(o.unbind(t),o.unbind(e.getContainer()))}},PL=e=>h(e)?{value:e.split(/[ ,]/),valid:!0}:_(e,h)?{value:e,valid:!0}:{valid:!1,message:"The value must be a string[] or a comma/space separated string."},FL=(e,t)=>e+(Je(t.message)?"":`. ${t.message}`),zL=e=>e.valid,VL=(e,t,o="")=>{const n=t(e);return y(n)?n?{value:e,valid:!0}:{valid:!1,message:o}:n},ZL=(e,t,o=t)=>{const n={},r={},s=(e,t,o)=>{const n=VL(t,o);return zL(n)?(r[e]=n.value,!0):(console.warn(FL(`Invalid value passed for the ${e} option`,n)),!1)},a=e=>Ee(n,e);return{register:(e,o)=>{const a=(e=>h(e.processor))(o)?(e=>{const t=(()=>{switch(e){case"array":return v;case"boolean":return y;case"function":return S;case"number":return k;case"object":return p;case"string":return h;case"string[]":return PL;case"object[]":return e=>_(e,p);case"regexp":return e=>g(e,RegExp);default:return P}})();return o=>VL(o,t,`The value must be a ${e}.`)})(o.processor):o.processor,i=((e,t,o)=>{if(!w(t)){const n=VL(t,o);if(zL(n))return n.value;console.error(FL(`Invalid default value passed for the "${e}" option`,n))}})(e,o.default,a);n[e]={...o,default:i,processor:a},_e(r,e).orThunk((()=>_e(t,e))).each((t=>s(e,t,a)))},isRegistered:a,get:e=>_e(r,e).orThunk((()=>_e(n,e).map((e=>e.default)))).getOrUndefined(),set:(e,t)=>{if(a(e)){const o=n[e];return o.immutable?(console.error(`"${e}" is an immutable option and cannot be updated`),!1):s(e,t,o.processor)}return console.warn(`"${e}" is not a registered option. Ensure the option has been registered before setting a value.`),!1},unset:e=>{const t=a(e);return t&&delete r[e],t},isSet:e=>Ee(r,e),debug:()=>{try{console.log(JSON.parse(JSON.stringify(o,((e,t)=>y(t)||k(t)||h(t)||b(t)||v(t)||f(t)?t:Object.prototype.toString.call(t)))))}catch(e){console.error(e)}}}},UL=["design","readonly"],jL=(e,t,o,n)=>{const r=o[t.get()],s=o[n];try{s.activate()}catch(e){return void console.error(`problem while activating editor mode ${n}:`,e)}r.deactivate(),r.editorReadOnly!==s.editorReadOnly&&SL(e,s.editorReadOnly),t.set(n),((e,t)=>{e.dispatch("SwitchMode",{mode:t})})(e,n)},WL=e=>{const t=Lr("design"),o=Lr({design:{activate:E,deactivate:E,editorReadOnly:!1},readonly:{activate:E,deactivate:E,editorReadOnly:!0}});return(e=>{e.serializer?_L(e):e.on("PreInit",(()=>{_L(e)}))})(e),(e=>{e.on("ShowCaret",(t=>{kL(e)&&t.preventDefault()})),e.on("ObjectSelected",(t=>{kL(e)&&t.preventDefault()}))})(e),{isReadOnly:()=>kL(e),set:n=>((e,t,o,n)=>{if(n!==o.get()){if(!Ee(t,n))throw new Error(`Editor mode '${n}' is invalid`);e.initialized?jL(e,o,t,n):e.on("init",(()=>jL(e,o,t,n)))}})(e,o.get(),t,n),get:()=>t.get(),register:(e,t)=>{o.set(((e,t,o)=>{if(j(UL,t))throw new Error(`Cannot override default mode ${t}`);return{...e,[t]:{...o,deactivate:()=>{try{o.deactivate()}catch(e){console.error(`problem while deactivating editor mode ${t}:`,e)}}}}})(o.get(),e,t))}}},$L=Lt.each,qL=Lt.explode,GL={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},KL=Lt.makeMap("alt,ctrl,shift,meta,access"),YL=e=>{const t={},o=Mt.os.isMacOS()||Mt.os.isiOS();$L(qL(e.toLowerCase(),"+"),(e=>{(e=>e in KL)(e)?t[e]=!0:/^[0-9]{2,}$/.test(e)?t.keyCode=parseInt(e,10):(t.charCode=e.charCodeAt(0),t.keyCode=GL[e]||e.toUpperCase().charCodeAt(0))}));const n=[t.keyCode];let r;for(r in KL)t[r]?n.push(r):t[r]=!1;return t.id=n.join(","),t.access&&(t.alt=!0,o?t.ctrl=!0:t.shift=!0),t.meta&&(o?t.meta=!0:(t.ctrl=!0,t.meta=!1)),t};class XL{constructor(e){this.shortcuts={},this.pendingPatterns=[],this.editor=e;const t=this;e.on("keyup keypress keydown",(e=>{!t.hasModifier(e)&&!t.isFunctionKey(e)||e.isDefaultPrevented()||($L(t.shortcuts,(o=>{t.matchShortcut(e,o)&&(t.pendingPatterns=o.subpatterns.slice(0),"keydown"===e.type&&t.executeShortcutAction(o))})),t.matchShortcut(e,t.pendingPatterns[0])&&(1===t.pendingPatterns.length&&"keydown"===e.type&&t.executeShortcutAction(t.pendingPatterns[0]),t.pendingPatterns.shift()))}))}add(e,t,o,n){const r=this,s=r.normalizeCommandFunc(o);return $L(qL(Lt.trim(e)),(e=>{const o=r.createShortcut(e,t,s,n);r.shortcuts[o.id]=o})),!0}remove(e){const t=this.createShortcut(e);return!!this.shortcuts[t.id]&&(delete this.shortcuts[t.id],!0)}normalizeCommandFunc(e){const t=this,o=e;return"string"==typeof o?()=>{t.editor.execCommand(o,!1,null)}:Lt.isArray(o)?()=>{t.editor.execCommand(o[0],o[1],o[2])}:o}createShortcut(e,t,o,n){const r=Lt.map(qL(e,">"),YL);return r[r.length-1]=Lt.extend(r[r.length-1],{func:o,scope:n||this.editor}),Lt.extend(r[0],{desc:this.editor.translate(t),subpatterns:r.slice(1)})}hasModifier(e){return e.altKey||e.ctrlKey||e.metaKey}isFunctionKey(e){return"keydown"===e.type&&e.keyCode>=112&&e.keyCode<=123}matchShortcut(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)}executeShortcutAction(e){return e.func?e.func.call(e.scope):null}}const JL=()=>{const e=(()=>{const e={},t={},o={},n={},r={},s={},a={},i={},l=(e,t)=>(o,n)=>{e[o.toLowerCase()]={...n,type:t}};return{addButton:l(e,"button"),addGroupToolbarButton:l(e,"grouptoolbarbutton"),addToggleButton:l(e,"togglebutton"),addMenuButton:l(e,"menubutton"),addSplitButton:l(e,"splitbutton"),addMenuItem:l(t,"menuitem"),addNestedMenuItem:l(t,"nestedmenuitem"),addToggleMenuItem:l(t,"togglemenuitem"),addAutocompleter:l(o,"autocompleter"),addContextMenu:l(r,"contextmenu"),addContextToolbar:l(s,"contexttoolbar"),addContextForm:l(s,"contextform"),addSidebar:l(a,"sidebar"),addView:l(i,"views"),addIcon:(e,t)=>n[e.toLowerCase()]=t,getAll:()=>({buttons:e,menuItems:t,icons:n,popups:o,contextMenus:r,contextToolbars:s,sidebars:a,views:i})}})();return{addAutocompleter:e.addAutocompleter,addButton:e.addButton,addContextForm:e.addContextForm,addContextMenu:e.addContextMenu,addContextToolbar:e.addContextToolbar,addIcon:e.addIcon,addMenuButton:e.addMenuButton,addMenuItem:e.addMenuItem,addNestedMenuItem:e.addNestedMenuItem,addSidebar:e.addSidebar,addSplitButton:e.addSplitButton,addToggleButton:e.addToggleButton,addGroupToolbarButton:e.addGroupToolbarButton,addToggleMenuItem:e.addToggleMenuItem,addView:e.addView,getAll:e.getAll}},QL=xa.DOM,eH=Lt.extend,tH=Lt.each;class oH{constructor(e,t,o){this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.composing=!1,this.destroyed=!1,this.hasHiddenInput=!1,this.iframeElement=null,this.initialized=!1,this.readonly=!1,this.removed=!1,this.startContent="",this._pendingNativeEvents=[],this._skinLoaded=!1,this._editableRoot=!0,this.editorManager=o,this.documentBaseUrl=o.documentBaseURL,eH(this,IL);const n=this;this.id=e,this.hidden=!1;const r=((e,t)=>{const o=FO(t);return GB(zB||VB,zB,o,e,o)})(o.defaultOptions,t);this.options=ZL(0,r,t),(e=>{const t=e.options.register;t("id",{processor:"string",default:e.id}),t("selector",{processor:"string"}),t("target",{processor:"object"}),t("suffix",{processor:"string"}),t("cache_suffix",{processor:"string"}),t("base_url",{processor:"string"}),t("referrer_policy",{processor:"string",default:""}),t("language_load",{processor:"boolean",default:!0}),t("inline",{processor:"boolean",default:!1}),t("iframe_attrs",{processor:"object",default:{}}),t("doctype",{processor:"string",default:""}),t("document_base_url",{processor:"string",default:e.documentBaseUrl}),t("body_id",{processor:Xl(e,"tinymce"),default:"tinymce"}),t("body_class",{processor:Xl(e),default:""}),t("content_security_policy",{processor:"string",default:""}),t("br_in_pre",{processor:"boolean",default:!0}),t("forced_root_block",{processor:e=>{const t=h(e)&&Xe(e);return t?{value:e,valid:t}:{valid:!1,message:"Must be a non-empty string."}},default:"p"}),t("forced_root_block_attrs",{processor:"object",default:{}}),t("newline_behavior",{processor:e=>{const t=j(["block","linebreak","invert","default"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be one of: block, linebreak, invert or default."}},default:"default"}),t("br_newline_selector",{processor:"string",default:".mce-toc h2,figcaption,caption"}),t("no_newline_selector",{processor:"string",default:""}),t("keep_styles",{processor:"boolean",default:!0}),t("end_container_on_empty_block",{processor:e=>y(e)||h(e)?{valid:!0,value:e}:{valid:!1,message:"Must be boolean or a string"},default:"blockquote"}),t("font_size_style_values",{processor:"string",default:"xx-small,x-small,small,medium,large,x-large,xx-large"}),t("font_size_legacy_values",{processor:"string",default:"xx-small,small,medium,large,x-large,xx-large,300%"}),t("font_size_classes",{processor:"string",default:""}),t("automatic_uploads",{processor:"boolean",default:!0}),t("images_reuse_filename",{processor:"boolean",default:!1}),t("images_replace_blob_uris",{processor:"boolean",default:!0}),t("icons",{processor:"string",default:""}),t("icons_url",{processor:"string",default:""}),t("images_upload_url",{processor:"string",default:""}),t("images_upload_base_path",{processor:"string",default:""}),t("images_upload_credentials",{processor:"boolean",default:!1}),t("images_upload_handler",{processor:"function"}),t("language",{processor:"string",default:"en"}),t("language_url",{processor:"string",default:""}),t("entity_encoding",{processor:"string",default:"named"}),t("indent",{processor:"boolean",default:!0}),t("indent_before",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),t("indent_after",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),t("indent_use_margin",{processor:"boolean",default:!1}),t("indentation",{processor:"string",default:"40px"}),t("content_css",{processor:e=>{const t=!1===e||h(e)||_(e,h);return t?h(e)?{value:$(e.split(","),Ge),valid:t}:v(e)?{value:e,valid:t}:!1===e?{value:[],valid:t}:{value:e,valid:t}:{valid:!1,message:"Must be false, a string or an array of strings."}},default:qc(e)?[]:["default"]}),t("content_style",{processor:"string"}),t("content_css_cors",{processor:"boolean",default:!1}),t("font_css",{processor:e=>{const t=h(e)||_(e,h);return t?{value:v(e)?e:$(e.split(","),Ge),valid:t}:{valid:!1,message:"Must be a string or an array of strings."}},default:[]}),t("inline_boundaries",{processor:"boolean",default:!0}),t("inline_boundaries_selector",{processor:"string",default:"a[href],code,span.mce-annotation"}),t("object_resizing",{processor:e=>{const t=y(e)||h(e);return t?!1===e||Wl.isiPhone()||Wl.isiPad()?{value:"",valid:t}:{value:!0===e?"table,img,figure.image,div,video,iframe":e,valid:t}:{valid:!1,message:"Must be boolean or a string"}},default:!$l}),t("resize_img_proportional",{processor:"boolean",default:!0}),t("event_root",{processor:"string"}),t("service_message",{processor:"string"}),t("theme",{processor:e=>!1===e||h(e)||S(e),default:"silver"}),t("theme_url",{processor:"string"}),t("formats",{processor:"object"}),t("format_empty_lines",{processor:"boolean",default:!1}),t("format_noneditable_selector",{processor:"string",default:""}),t("preview_styles",{processor:e=>{const t=!1===e||h(e);return t?{value:!1===e?"":e,valid:t}:{valid:!1,message:"Must be false or a string"}},default:"font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"}),t("custom_ui_selector",{processor:"string",default:""}),t("hidden_input",{processor:"boolean",default:!0}),t("submit_patch",{processor:"boolean",default:!0}),t("encoding",{processor:"string"}),t("add_form_submit_trigger",{processor:"boolean",default:!0}),t("add_unload_trigger",{processor:"boolean",default:!0}),t("custom_undo_redo_levels",{processor:"number",default:0}),t("disable_nodechange",{processor:"boolean",default:!1}),t("readonly",{processor:"boolean",default:!1}),t("editable_root",{processor:"boolean",default:!0}),t("plugins",{processor:"string[]",default:[]}),t("external_plugins",{processor:"object"}),t("forced_plugins",{processor:"string[]"}),t("model",{processor:"string",default:e.hasPlugin("rtc")?"plugin":"dom"}),t("model_url",{processor:"string"}),t("block_unsupported_drop",{processor:"boolean",default:!0}),t("visual",{processor:"boolean",default:!0}),t("visual_table_class",{processor:"string",default:"mce-item-table"}),t("visual_anchor_class",{processor:"string",default:"mce-item-anchor"}),t("iframe_aria_text",{processor:"string",default:"Rich Text Area. Press ALT-0 for help."}),t("setup",{processor:"function"}),t("init_instance_callback",{processor:"function"}),t("url_converter",{processor:"function",default:e.convertURL}),t("url_converter_scope",{processor:"object",default:e}),t("urlconverter_callback",{processor:"function"}),t("allow_conditional_comments",{processor:"boolean",default:!1}),t("allow_html_data_urls",{processor:"boolean",default:!1}),t("allow_svg_data_urls",{processor:"boolean"}),t("allow_html_in_named_anchor",{processor:"boolean",default:!1}),t("allow_script_urls",{processor:"boolean",default:!1}),t("allow_unsafe_link_target",{processor:"boolean",default:!1}),t("convert_fonts_to_spans",{processor:"boolean",default:!0,deprecated:!0}),t("fix_list_elements",{processor:"boolean",default:!1}),t("preserve_cdata",{processor:"boolean",default:!1}),t("remove_trailing_brs",{processor:"boolean",default:!0}),t("pad_empty_with_br",{processor:"boolean",default:!1}),t("inline_styles",{processor:"boolean",default:!0,deprecated:!0}),t("element_format",{processor:"string",default:"html"}),t("entities",{processor:"string"}),t("schema",{processor:"string",default:"html5"}),t("convert_urls",{processor:"boolean",default:!0}),t("relative_urls",{processor:"boolean",default:!0}),t("remove_script_host",{processor:"boolean",default:!0}),t("custom_elements",{processor:Yl}),t("extended_valid_elements",{processor:"string"}),t("invalid_elements",{processor:"string"}),t("invalid_styles",{processor:Yl}),t("valid_children",{processor:"string"}),t("valid_classes",{processor:Yl}),t("valid_elements",{processor:"string"}),t("valid_styles",{processor:Yl}),t("verify_html",{processor:"boolean",default:!0}),t("auto_focus",{processor:e=>h(e)||!0===e}),t("browser_spellcheck",{processor:"boolean",default:!1}),t("protect",{processor:"array"}),t("images_file_types",{processor:"string",default:"jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp"}),t("deprecation_warnings",{processor:"boolean",default:!0}),t("a11y_advanced_options",{processor:"boolean",default:!1}),t("api_key",{processor:"string"}),t("license_key",{processor:"string"}),t("paste_block_drop",{processor:"boolean",default:!1}),t("paste_data_images",{processor:"boolean",default:!0}),t("paste_preprocess",{processor:"function"}),t("paste_postprocess",{processor:"function"}),t("paste_webkit_styles",{processor:"string",default:"none"}),t("paste_remove_styles_if_webkit",{processor:"boolean",default:!0}),t("paste_merge_formats",{processor:"boolean",default:!0}),t("smart_paste",{processor:"boolean",default:!0}),t("paste_as_text",{processor:"boolean",default:!1}),t("paste_tab_spaces",{processor:"number",default:4}),t("text_patterns",{processor:e=>_(e,p)||!1===e?{value:jl(!1===e?[]:e),valid:!0}:{valid:!1,message:"Must be an array of objects or false."},default:[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1",trigger:"space"},{start:"##",format:"h2",trigger:"space"},{start:"###",format:"h3",trigger:"space"},{start:"####",format:"h4",trigger:"space"},{start:"#####",format:"h5",trigger:"space"},{start:"######",format:"h6",trigger:"space"},{start:"1.",cmd:"InsertOrderedList",trigger:"space"},{start:"*",cmd:"InsertUnorderedList",trigger:"space"},{start:"-",cmd:"InsertUnorderedList",trigger:"space"},{start:">",cmd:"mceBlockQuote",trigger:"space"},{start:"---",cmd:"InsertHorizontalRule",trigger:"space"}]}),t("text_patterns_lookup",{processor:e=>{return S(e)?{value:(t=e,e=>{const o=t(e);return jl(o)}),valid:!0}:{valid:!1,message:"Must be a single function"};var t},default:e=>[]}),t("noneditable_class",{processor:"string",default:"mceNonEditable"}),t("editable_class",{processor:"string",default:"mceEditable"}),t("noneditable_regexp",{processor:e=>_(e,Gl)?{value:e,valid:!0}:Gl(e)?{value:[e],valid:!0}:{valid:!1,message:"Must be a RegExp or an array of RegExp."},default:[]}),t("table_tab_navigation",{processor:"boolean",default:!0}),t("highlight_on_focus",{processor:"boolean",default:!0}),t("xss_sanitization",{processor:"boolean",default:!0}),t("details_initial_state",{processor:e=>{const t=j(["inherited","collapsed","expanded"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),t("details_serialized_state",{processor:e=>{const t=j(["inherited","collapsed","expanded"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),t("init_content_sync",{processor:"boolean",default:!1}),t("newdocument_content",{processor:"string",default:""}),t("sandbox_iframes",{processor:"boolean",default:!0}),t("sandbox_iframes_exclusions",{processor:"string[]",default:["youtube.com","youtu.be","vimeo.com","player.vimeo.com","dailymotion.com","embed.music.apple.com","open.spotify.com","giphy.com","dai.ly","codepen.io"]}),t("convert_unsafe_embeds",{processor:"boolean",default:!0}),e.on("ScriptsLoaded",(()=>{t("directionality",{processor:"string",default:Ta.isRtl()?"rtl":void 0}),t("placeholder",{processor:"string",default:ql.getAttrib(e.getElement(),"placeholder")})}))})(n);const s=this.options.get;s("deprecation_warnings")&&rS(t,r);const a=s("suffix");a&&(o.suffix=a),this.suffix=o.suffix;const i=s("base_url");i&&o._setBaseUrl(i),this.baseUri=o.baseURI;const l=Cc(n);l&&(Sa.ScriptLoader._setReferrerPolicy(l),xa.DOM.styleSheetLoader._setReferrerPolicy(l));const c=od(n);C(c)&&xa.DOM.styleSheetLoader._setContentCssCors(c),Oa.languageLoad=s("language_load"),Oa.baseURL=o.baseURL,this.setDirty(!1),this.documentBaseURI=new kx(ec(n),{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=qc(n),this.hasVisual=ad(n),this.shortcuts=new XL(this),this.editorCommands=new yL(this),fL(this);const d=s("cache_suffix");d&&(Mt.cacheSuffix=d.replace(/^[\?\&]+/,"")),this.ui={registry:JL(),styleSheetLoader:void 0,show:E,hide:E,setEnabled:E,isEnabled:P},this.mode=WL(n),o.dispatch("SetupEditor",{editor:this});const m=dd(n);S(m)&&m.call(n,n)}render(){PB(this)}focus(e){this.execCommand("mceFocus",!1,e)}hasFocus(){return bp(this)}translate(e){return Ta.translate(e)}getParam(e,t,o){const n=this.options;return n.isRegistered(e)||(C(o)?n.register(e,{processor:o,default:t}):n.register(e,{processor:P,default:t})),n.isSet(e)||w(t)?n.get(e):t}hasPlugin(e,t){return!(!j(nd(this),e)||t&&void 0===wS.get(e))}nodeChanged(e){this._nodeChangeDispatcher.nodeChanged(e)}addCommand(e,t,o){this.editorCommands.addCommand(e,t,o)}addQueryStateHandler(e,t,o){this.editorCommands.addQueryStateHandler(e,t,o)}addQueryValueHandler(e,t,o){this.editorCommands.addQueryValueHandler(e,t,o)}addShortcut(e,t,o,n){this.shortcuts.add(e,t,o,n)}execCommand(e,t,o,n){return this.editorCommands.execCommand(e,t,o,n)}queryCommandState(e){return this.editorCommands.queryCommandState(e)}queryCommandValue(e){return this.editorCommands.queryCommandValue(e)}queryCommandSupported(e){return this.editorCommands.queryCommandSupported(e)}show(){const e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable="true":(QL.show(e.getContainer()),QL.hide(e.id)),e.load(),e.dispatch("show"))}hide(){const e=this;e.hidden||(e.save(),e.inline?(e.getBody().contentEditable="false",e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(QL.hide(e.getContainer()),QL.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.dispatch("hide"))}isHidden(){return this.hidden}setProgressState(e,t){this.dispatch("ProgressState",{state:e,time:t})}load(e={}){const t=this,o=t.getElement();if(t.removed)return"";if(o){const n={...e,load:!0},r=cr(o)?o.value:o.innerHTML,s=t.setContent(r,n);return n.no_events||t.dispatch("LoadContent",{...n,element:o}),s}return""}save(e={}){const t=this;let o=t.getElement();if(!o||!t.initialized||t.removed)return"";const n={...e,save:!0,element:o};let r=t.getContent(n);const s={...n,content:r};if(s.no_events||t.dispatch("SaveContent",s),"raw"===s.format&&t.dispatch("RawSaveContent",s),r=s.content,cr(o))o.value=r;else{!e.is_removing&&t.inline||(o.innerHTML=r);const n=QL.getParent(t.id,"form");n&&tH(n.elements,(e=>e.name!==t.id||(e.value=r,!1)))}return s.element=n.element=o=null,!1!==s.set_dirty&&t.setDirty(!1),r}setContent(e,t){return $C(this,e,t)}getContent(e){return WC(this,e)}insertContent(e,t){t&&(e=eH({content:e},t)),this.execCommand("mceInsertContent",!1,e)}resetContent(e){void 0===e?$C(this,this.startContent,{format:"raw"}):$C(this,e),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()}isDirty(){return!this.isNotDirty}setDirty(e){const t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.dispatch("dirty")}getContainer(){const e=this;return e.container||(e.container=e.editorContainer||QL.get(e.id+"_parent")),e.container}getContentAreaContainer(){return this.contentAreaContainer}getElement(){return this.targetElm||(this.targetElm=QL.get(this.id)),this.targetElm}getWin(){const e=this;if(!e.contentWindow){const t=e.iframeElement;t&&(e.contentWindow=t.contentWindow)}return e.contentWindow}getDoc(){const e=this;if(!e.contentDocument){const t=e.getWin();t&&(e.contentDocument=t.document)}return e.contentDocument}getBody(){var e,t;const o=this.getDoc();return null!==(t=null!==(e=this.bodyElement)&&void 0!==e?e:null==o?void 0:o.body)&&void 0!==t?t:null}convertURL(e,t,o){const n=this,r=n.options.get,s=ud(n);if(S(s))return s.call(n,e,o,!0,t);if(!r("convert_urls")||"link"===o||p(o)&&"LINK"===o.nodeName||0===e.indexOf("file:")||0===e.length)return e;const a=new kx(e);return"http"!==a.protocol&&"https"!==a.protocol&&""!==a.protocol?e:r("relative_urls")?n.documentBaseURI.toRelative(e):e=n.documentBaseURI.toAbsolute(e,r("remove_script_host"))}addVisual(e){KB(this,e)}setEditableRoot(e){((e,t)=>{e._editableRoot!==t&&(e._editableRoot=t,e.readonly||(e.getBody().contentEditable=String(e.hasEditableRoot()),e.nodeChanged()),((e,t)=>{e.dispatch("EditableRootStateChange",{state:t})})(e,t))})(this,e)}hasEditableRoot(){return this._editableRoot}remove(){iS(this)}destroy(e){lS(this,e)}uploadImages(){return this.editorUpload.uploadImages()}_scanForImages(){return this.editorUpload.scanForImages()}}const nH=xa.DOM,rH=Lt.each;let sH,aH=!1,iH=[];const lH=e=>{const t=e.type;rH(uH.get(),(o=>{switch(t){case"scroll":o.dispatch("ScrollWindow",e);break;case"resize":o.dispatch("ResizeWindow",e)}}))},cH=e=>{if(e!==aH){const t=xa.DOM;e?(t.bind(window,"resize",lH),t.bind(window,"scroll",lH)):(t.unbind(window,"resize",lH),t.unbind(window,"scroll",lH)),aH=e}},dH=e=>{const t=iH;return iH=Y(iH,(t=>e!==t)),uH.activeEditor===e&&(uH.activeEditor=iH.length>0?iH[0]:null),uH.focusedEditor===e&&(uH.focusedEditor=null),t.length!==iH.length},mH="CSS1Compat"!==document.compatMode,uH={...ML,baseURI:null,baseURL:null,defaultOptions:{},documentBaseURL:null,suffix:null,majorVersion:"7",minorVersion:"2.1",releaseDate:"2024-07-03",i18n:Ta,activeEditor:null,focusedEditor:null,setup(){const e=this;let t="",o="",n=kx.getDocumentBaseUrl(document.location);/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"));const r=window.tinymce||window.tinyMCEPreInit;if(r)t=r.base||r.baseURL,o=r.suffix;else{const e=document.getElementsByTagName("script");for(let n=0;n{Oa.PluginManager.urls[t]=e}))},init(e){const t=this;let o;const n=Lt.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," ");let r=e=>{o=e};const s=()=>{let o=0;const a=[];let i;nH.unbind(window,"ready",s),(o=>{const n=e[o];n&&n.apply(t,[])})("onpageload"),i=he((e=>Mt.browser.isIE()||Mt.browser.isEdge()?(TS("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tiny.cloud/docs/tinymce/7/support/#supportedwebbrowsers"),[]):mH?(TS("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[]):h(e.selector)?nH.select(e.selector):C(e.target)?[e.target]:[])(e)),Lt.each(i,(e=>{var o;(o=t.get(e.id))&&o.initialized&&!(o.getContainer()||o.getBody()).parentNode&&(dH(o),o.unbindAllNativeEvents(),o.destroy(!0),o.removed=!0)})),i=Lt.grep(i,(e=>!t.get(e.id))),0===i.length?r([]):rH(i,(s=>{((e,t)=>e.inline&&t.tagName.toLowerCase()in n)(e,s)?TS("Could not initialize inline editor on invalid inline target element",s):((e,n,s)=>{const l=new oH(e,n,t);a.push(l),l.on("init",(()=>{++o===i.length&&r(a)})),l.targetElm=l.targetElm||s,l.render()})((e=>{let t=e.id;return t||(t=_e(e,"name").filter((e=>!nH.get(e))).getOrThunk(nH.uniqueId),e.setAttribute("id",t)),t})(s),e,s)}))};return nH.bind(window,"ready",s),new Promise((e=>{o?e(o):r=t=>{e(t)}}))},get(e){return 0===arguments.length?iH.slice(0):h(e)?ee(iH,(t=>t.id===e)).getOr(null):k(e)&&iH[e]?iH[e]:null},add(e){const t=this,o=t.get(e.id);return o===e||(null===o&&iH.push(e),cH(!0),t.activeEditor=e,t.dispatch("AddEditor",{editor:e}),sH||(sH=e=>{const o=t.dispatch("BeforeUnload");if(o.returnValue)return e.preventDefault(),e.returnValue=o.returnValue,o.returnValue},window.addEventListener("beforeunload",sH))),e},createEditor(e,t){return this.add(new oH(e,t,this))},remove(e){const t=this;let o;if(e){if(!h(e))return o=e,b(t.get(o.id))?null:(dH(o)&&t.dispatch("RemoveEditor",{editor:o}),0===iH.length&&window.removeEventListener("beforeunload",sH),o.remove(),cH(iH.length>0),o);rH(nH.select(e),(e=>{o=t.get(e.id),o&&t.remove(o)}))}else for(let e=iH.length-1;e>=0;e--)t.remove(iH[e])},execCommand(e,t,o){var n;const r=this,s=p(o)?null!==(n=o.id)&&void 0!==n?n:o.index:o;switch(e){case"mceAddEditor":if(!r.get(s)){const e=o.options;new oH(s,e,r).render()}return!0;case"mceRemoveEditor":{const e=r.get(s);return e&&e.remove(),!0}case"mceToggleEditor":{const e=r.get(s);return e?(e.isHidden()?e.show():e.hide(),!0):(r.execCommand("mceAddEditor",!1,o),!0)}}return!!r.activeEditor&&r.activeEditor.execCommand(e,t,o)},triggerSave:()=>{rH(iH,(e=>{e.save()}))},addI18n:(e,t)=>{Ta.add(e,t)},translate:e=>Ta.translate(e),setActive(e){const t=this.activeEditor;this.activeEditor!==e&&(t&&t.dispatch("deactivate",{relatedTarget:e}),e.dispatch("activate",{relatedTarget:t})),this.activeEditor=e},_setBaseUrl(e){this.baseURL=new kx(this.documentBaseURL).toAbsolute(e.replace(/\/+$/,"")),this.baseURI=new kx(this.baseURL)}};uH.setup();const gH=(()=>{const e=Ir();return{FakeClipboardItem:e=>({items:e,types:pe(e),getType:t=>_e(e,t).getOrUndefined()}),write:t=>{e.set(t)},read:()=>e.get().getOrUndefined(),clear:e.clear}})(),hH=Math.min,pH=Math.max,fH=Math.round,vH=(e,t,o)=>{let n=t.x,r=t.y;const s=e.w,a=e.h,i=t.w,l=t.h,c=(o||"").split("");return"b"===c[0]&&(r+=l),"r"===c[1]&&(n+=i),"c"===c[0]&&(r+=fH(l/2)),"c"===c[1]&&(n+=fH(i/2)),"b"===c[3]&&(r-=a),"r"===c[4]&&(n-=s),"c"===c[3]&&(r-=fH(a/2)),"c"===c[4]&&(n-=fH(s/2)),bH(n,r,s,a)},bH=(e,t,o,n)=>({x:e,y:t,w:o,h:n}),yH={inflate:(e,t,o)=>bH(e.x-t,e.y-o,e.w+2*t,e.h+2*o),relativePosition:vH,findBestRelativePosition:(e,t,o,n)=>{for(let r=0;r=o.x&&s.x+s.w<=o.w+o.x&&s.y>=o.y&&s.y+s.h<=o.h+o.y)return n[r]}return null},intersect:(e,t)=>{const o=pH(e.x,t.x),n=pH(e.y,t.y),r=hH(e.x+e.w,t.x+t.w),s=hH(e.y+e.h,t.y+t.h);return r-o<0||s-n<0?null:bH(o,n,r-o,s-n)},clamp:(e,t,o)=>{let n=e.x,r=e.y,s=e.x+e.w,a=e.y+e.h;const i=t.x+t.w,l=t.y+t.h,c=pH(0,t.x-n),d=pH(0,t.y-r),m=pH(0,s-i),u=pH(0,a-l);return n+=c,r+=d,o&&(s+=c,a+=d,n-=m,r-=u),s-=m,a-=u,bH(n,r,s-n,a-r)},create:bH,fromClientRect:e=>bH(e.left,e.top,e.width,e.height)},wH=(()=>{const e={},t={},o={};return{load:(o,n)=>{const r=`Script at URL "${n}" failed to load`,s=`Script at URL "${n}" did not call \`tinymce.Resource.add('${o}', data)\` within 1 second`;if(void 0!==e[o])return e[o];{const a=new Promise(((e,a)=>{const i=((e,t,o=1e3)=>{let n=!1,r=null;const s=e=>(...t)=>{n||(n=!0,null!==r&&(clearTimeout(r),r=null),e.apply(null,t))},a=s(e),i=s(t);return{start:(...e)=>{n||null!==r||(r=setTimeout((()=>i.apply(null,e)),o))},resolve:a,reject:i}})(e,a);t[o]=i.resolve,Sa.ScriptLoader.loadScript(n).then((()=>i.start(s)),(()=>i.reject(r)))}));return e[o]=a,a}},add:(n,r)=>{void 0!==t[n]&&(t[n](r),delete t[n]),e[n]=Promise.resolve(r),o[n]=r},has:e=>e in o,get:e=>o[e],unload:t=>{delete e[t],delete o[t]}}})();let xH;try{const e="__storage_test__";xH=window.localStorage,xH.setItem(e,e),xH.removeItem(e)}catch(e){xH=(()=>{let e={},t=[];const o={getItem:t=>e[t]||null,setItem:(o,n)=>{t.push(o),e[o]=String(n)},key:e=>t[e],removeItem:o=>{t=t.filter((e=>e===o)),delete e[o]},clear:()=>{t=[],e={}},length:0};return Object.defineProperty(o,"length",{get:()=>t.length,configurable:!1,enumerable:!1}),o})()}const CH={geom:{Rect:yH},util:{Delay:sp,Tools:Lt,VK:Vg,URI:kx,EventDispatcher:AL,Observable:ML,I18n:Ta,LocalStorage:xH,ImageUploader:e=>{const t=NS(),o=IS(e,t);return{upload:(t,n=!0)=>o.upload(t,n?HS(e):void 0)}}},dom:{EventUtils:ma,TreeWalker:Wn,TextSeeker:Ya,DOMUtils:xa,ScriptLoader:Sa,RangeUtils:Sh,Serializer:jC,StyleSheetLoader:is,ControlSelection:$g,BookmarkManager:Ng,Selection:PC,Event:ma.Event},html:{Styles:ta,Entities:Es,Node:Np,Schema:Ws,DomParser:zx,Writer:Xp,Serializer:Jp},Env:Mt,AddOnManager:Oa,Annotator:Mg,Formatter:XS,UndoManager:QS,EditorCommands:yL,WindowManager:CS,NotificationManager:yS,EditorObservable:IL,Shortcuts:XL,Editor:oH,FocusManager:rp,EditorManager:uH,DOM:xa.DOM,ScriptLoader:Sa.ScriptLoader,PluginManager:wS,ThemeManager:xS,ModelManager:dS,IconManager:cS,Resource:wH,FakeClipboard:gH,trim:Lt.trim,isArray:Lt.isArray,is:Lt.is,toArray:Lt.toArray,makeMap:Lt.makeMap,each:Lt.each,map:Lt.map,grep:Lt.grep,inArray:Lt.inArray,extend:Lt.extend,walk:Lt.walk,resolve:Lt.resolve,explode:Lt.explode,_addCacheSuffix:Lt._addCacheSuffix},SH=Lt.extend(uH,CH);(e=>{window.tinymce=e,window.tinyMCE=e})(SH),(e=>{try{t.exports=e}catch(e){}})(SH)}();var n=e(o.exports);tinymce.IconManager.add("default",{icons:{"accessibility-check":'',"accordion-toggle":'',accordion:'',"action-next":'',"action-prev":'',addtag:'',"ai-prompt":'',ai:'',"align-center":'',"align-justify":'',"align-left":'',"align-none":'',"align-right":'',"arrow-left":'',"arrow-right":'',bold:'',bookmark:'',"border-style":'',"border-width":'',brightness:'',browse:'',cancel:'',"cell-background-color":'',"cell-border-color":'',"change-case":'',"character-count":'',"checklist-rtl":'',checklist:'',checkmark:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',close:'',"code-sample":'',"color-levels":'',"color-picker":'',"color-swatch-remove-color":'',"color-swatch":'',"comment-add":'',comment:'',contrast:'',copy:'',crop:'',"cut-column":'',"cut-row":'',cut:'',"document-properties":'',drag:'',"duplicate-column":'',"duplicate-row":'',duplicate:'',"edit-block":'',"edit-image":'',"embed-page":'',embed:'',emoji:'',export:'',fill:'',"flip-horizontally":'',"flip-vertically":'',footnote:'',"format-painter":'',format:'',fullscreen:'',gallery:'',gamma:'',help:'',"highlight-bg-color":'',home:'',"horizontal-rule":'',"image-options":'',image:'',indent:'',info:'',"insert-character":'',"insert-time":'',invert:'',italic:'',language:'',"line-height":'',line:'',link:'',"list-bull-circle":'',"list-bull-default":'',"list-bull-square":'',"list-num-default-rtl":'',"list-num-default":'',"list-num-lower-alpha-rtl":'',"list-num-lower-alpha":'',"list-num-lower-greek-rtl":'',"list-num-lower-greek":'',"list-num-lower-roman-rtl":'',"list-num-lower-roman":'',"list-num-upper-alpha-rtl":'',"list-num-upper-alpha":'',"list-num-upper-roman-rtl":'',"list-num-upper-roman":'',lock:'',ltr:'',"math-equation":'',minus:'',"more-drawer":'',"new-document":'',"new-tab":'',"non-breaking":'',notice:'',"ordered-list-rtl":'',"ordered-list":'',orientation:'',outdent:'',"page-break":'',paragraph:'',"paste-column-after":'',"paste-column-before":'',"paste-row-after":'',"paste-row-before":'',"paste-text":'',paste:'',"permanent-pen":'',plus:'',preferences:'',preview:'',print:'',quote:'',redo:'',reload:'',"remove-formatting":'',remove:'',"resize-handle":'',resize:'',"restore-draft":'',"revision-history":'',"rotate-left":'',"rotate-right":'',rtl:'',save:'',search:'',"select-all":'',selected:'',send:'',settings:'',sharpen:'',sourcecode:'',"spell-check":'',"strike-through":'',subscript:'',superscript:'',"table-caption":'',"table-cell-classes":'',"table-cell-properties":'',"table-cell-select-all":'',"table-cell-select-inner":'',"table-classes":'',"table-delete-column":'',"table-delete-row":'',"table-delete-table":'',"table-insert-column-after":'',"table-insert-column-before":'',"table-insert-row-above":'',"table-insert-row-after":'',"table-left-header":'',"table-merge-cells":'',"table-row-numbering-rtl":'',"table-row-numbering":'',"table-row-properties":'',"table-split-cells":'',"table-top-header":'',table:'',"template-add":'',template:'',"temporary-placeholder":'',"text-color":'',"text-size-decrease":'',"text-size-increase":'',toc:'',translate:'',typography:'',underline:'',undo:'',unlink:'',unlock:'',"unordered-list":'',unselected:'',upload:'',user:'',"vertical-align":'',visualblocks:'',visualchars:'',warning:'',"zoom-in":'',"zoom-out":'',"export-pdf":'',"export-word":'',"import-word":''}}),function(){const e=Object.getPrototypeOf,t=(e,t,o)=>{var n;return!!o(e,t.prototype)||(null===(n=e.constructor)||void 0===n?void 0:n.name)===t.name},o=e=>o=>(e=>{const o=typeof e;return null===e?"null":"object"===o&&Array.isArray(e)?"array":"object"===o&&t(e,String,((e,t)=>t.isPrototypeOf(e)))?"string":o})(o)===e,n=e=>t=>typeof t===e,r=e=>t=>e===t,s=o("string"),a=o("object"),i=o=>((o,n)=>a(o)&&t(o,n,((t,o)=>e(t)===o)))(o,Object),l=o("array"),c=r(null),d=n("boolean"),m=r(void 0),u=e=>null==e,g=e=>!u(e),h=n("function"),p=n("number"),f=(e,t)=>{if(l(e)){for(let o=0,n=e.length;o{},b=e=>()=>e(),y=(e,t)=>(...o)=>e(t.apply(null,o)),w=e=>()=>e,x=e=>e,C=(e,t)=>e===t;function S(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const k=e=>t=>!e(t),_=e=>()=>{throw new Error(e)},E=e=>e(),T=w(!1),O=w(!0);class A{constructor(e,t){this.tag=e,this.value=t}static some(e){return new A(!0,e)}static none(){return A.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?A.some(e(this.value)):A.none()}bind(e){return this.tag?e(this.value):A.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:A.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return g(e)?A.some(e):A.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}A.singletonNone=new A(!1);const D=Array.prototype.slice,M=Array.prototype.indexOf,N=Array.prototype.push,R=(e,t)=>M.call(e,t),B=(e,t)=>R(e,t)>-1,L=(e,t)=>{for(let o=0,n=e.length;o{const o=[];for(let n=0;n{const o=[];for(let n=0;n{const o=e.length,n=new Array(o);for(let r=0;r{for(let o=0,n=e.length;o{const o=[],n=[];for(let r=0,s=e.length;r{const o=[];for(let n=0,r=e.length;n(((e,t)=>{for(let o=e.length-1;o>=0;o--)t(e[o],o)})(e,((e,n)=>{o=t(o,e,n)})),o),U=(e,t,o)=>(F(e,((e,n)=>{o=t(o,e,n)})),o),j=(e,t)=>((e,t,o)=>{for(let n=0,r=e.length;n{for(let o=0,n=e.length;o{const t=[];for(let o=0,n=e.length;o$(P(e,t)),G=(e,t)=>{for(let o=0,n=e.length;o{const t=D.call(e,0);return t.reverse(),t},Y=(e,t)=>V(e,(e=>!B(t,e))),X=(e,t)=>{const o={};for(let n=0,r=e.length;n[e],Q=(e,t)=>{const o=D.call(e,0);return o.sort(t),o},ee=(e,t)=>t>=0&&tee(e,0),oe=e=>ee(e,e.length-1),ne=h(Array.from)?Array.from:e=>D.call(e),re=(e,t)=>{for(let o=0;o{const o=se(e);for(let n=0,r=o.length;nce(e,((e,o)=>({k:o,v:t(e,o)}))),ce=(e,t)=>{const o={};return ie(e,((e,n)=>{const r=t(e,n);o[r.k]=r.v})),o},de=e=>(t,o)=>{e[o]=t},me=(e,t,o,n)=>{ie(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))},ue=(e,t)=>{const o={};return me(e,t,de(o),v),o},ge=(e,t)=>{const o=[];return ie(e,((e,n)=>{o.push(t(e,n))})),o},he=(e,t)=>{const o=se(e);for(let n=0,r=o.length;nge(e,x),fe=(e,t)=>ve(e,t)?A.from(e[t]):A.none(),ve=(e,t)=>ae.call(e,t),be=(e,t)=>ve(e,t)&&void 0!==e[t]&&null!==e[t],ye=(e,t,o=C)=>e.exists((e=>o(e,t))),we=e=>{const t=[],o=e=>{t.push(e)};for(let t=0;te.isSome()&&t.isSome()?A.some(o(e.getOrDie(),t.getOrDie())):A.none(),Ce=(e,t)=>null!=e?A.some(t(e)):A.none(),Se=(e,t)=>e?A.some(t):A.none(),ke=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,_e=(e,t)=>Te(e,t)?((e,t)=>e.substring(t))(e,t.length):e,Ee=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!m(n)||r+t.length<=n)},Te=(e,t)=>ke(e,t,0),Oe=(e,t)=>ke(e,t,e.length-t.length),Ae=(e=>t=>t.replace(e,""))(/^\s+|\s+$/g),De=e=>e.length>0,Me=e=>!De(e),Ne=e=>void 0!==e.style&&h(e.style.getPropertyValue),Re=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},Be={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return Re(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return Re(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return Re(o)},fromDom:Re,fromPoint:(e,t,o)=>A.from(e.dom.elementFromPoint(t,o)).map(Re)},Le="undefined"!=typeof window?window:Function("return this;")(),He=(e,t)=>((e,t)=>{let o=null!=t?t:Le;for(let t=0;t{const o=((e,t)=>He(e,t))(e,t);if(null==o)throw new Error(e+" not available on this browser");return o},Pe=Object.getPrototypeOf,Fe=e=>{const t=He("ownerDocument.defaultView",e);return a(e)&&((e=>Ie("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(Pe(e).constructor.name))},ze=e=>e.dom.nodeName.toLowerCase(),Ve=e=>t=>(e=>e.dom.nodeType)(t)===e,Ze=e=>Ue(e)&&Fe(e.dom),Ue=Ve(1),je=Ve(3),We=Ve(9),$e=Ve(11),qe=e=>t=>Ue(t)&&ze(t)===e,Ge=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},Ke=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,Ye=(e,t)=>{const o=void 0===t?document:t.dom;return Ke(o)?A.none():A.from(o.querySelector(e)).map(Be.fromDom)},Xe=(e,t)=>e.dom===t.dom,Je=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},Qe=e=>Be.fromDom(e.dom.ownerDocument),et=e=>We(e)?e:Qe(e),tt=e=>Be.fromDom(et(e).dom.documentElement),ot=e=>Be.fromDom(et(e).dom.defaultView),nt=e=>A.from(e.dom.parentNode).map(Be.fromDom),rt=e=>A.from(e.dom.parentElement).map(Be.fromDom),st=e=>A.from(e.dom.offsetParent).map(Be.fromDom),at=e=>P(e.dom.childNodes,Be.fromDom),it=(e,t)=>{const o=e.dom.childNodes;return A.from(o[t]).map(Be.fromDom)},lt=e=>it(e,0),ct=(e,t)=>({element:e,offset:t}),dt=(e,t)=>{const o=at(e);return o.length>0&&t$e(e)&&g(e.dom.host),ut=h(Element.prototype.attachShadow)&&h(Node.prototype.getRootNode),gt=w(ut),ht=ut?e=>Be.fromDom(e.dom.getRootNode()):et,pt=e=>mt(e)?e:Be.fromDom(et(e).dom.body),ft=e=>{const t=ht(e);return mt(t)?A.some(t):A.none()},vt=e=>Be.fromDom(e.dom.host),bt=e=>g(e.dom.shadowRoot),yt=e=>{const t=je(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return ft(Be.fromDom(t)).fold((()=>o.body.contains(t)),(n=yt,r=vt,e=>n(r(e))));var n,r},wt=()=>xt(Be.fromDom(document)),xt=e=>{const t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return Be.fromDom(t)},Ct=(e,t,o)=>{if(!(s(o)||d(o)||p(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")},St=(e,t,o)=>{Ct(e.dom,t,o)},kt=(e,t)=>{const o=e.dom;ie(t,((e,t)=>{Ct(o,t,e)}))},_t=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},Et=(e,t)=>A.from(_t(e,t)),Tt=(e,t)=>{const o=e.dom;return!(!o||!o.hasAttribute)&&o.hasAttribute(t)},Ot=(e,t)=>{e.dom.removeAttribute(t)},At=(e,t,o)=>{if(!s(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);Ne(e)&&e.style.setProperty(t,o)},Dt=(e,t)=>{Ne(e)&&e.style.removeProperty(t)},Mt=(e,t,o)=>{const n=e.dom;At(n,t,o)},Nt=(e,t)=>{const o=e.dom;ie(t,((e,t)=>{At(o,t,e)}))},Rt=(e,t)=>{const o=e.dom;ie(t,((e,t)=>{e.fold((()=>{Dt(o,t)}),(e=>{At(o,t,e)}))}))},Bt=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||yt(e)?n:Lt(o,t)},Lt=(e,t)=>Ne(e)?e.style.getPropertyValue(t):"",Ht=(e,t)=>{const o=e.dom,n=Lt(o,t);return A.from(n).filter((e=>e.length>0))},It=e=>{const t={},o=e.dom;if(Ne(o))for(let e=0;e{const n=Be.fromTag(e);Mt(n,t,o);return Ht(n,t).isSome()},Ft=(e,t)=>{const o=e.dom;Dt(o,t),ye(Et(e,"style").map(Ae),"")&&Ot(e,"style")},zt=e=>e.dom.offsetWidth,Vt=(e,t)=>{const o=o=>{const n=t(o);if(n<=0||null===n){const t=Bt(o,e);return parseFloat(t)||0}return n},n=(e,t)=>U(t,((t,o)=>{const n=Bt(e,o),r=void 0===n?0:parseInt(n,10);return isNaN(r)?t:t+r}),0);return{set:(t,o)=>{if(!p(o)&&!o.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+o);const n=t.dom;Ne(n)&&(n.style[e]=o+"px")},get:o,getOuter:o,aggregate:n,max:(e,t,o)=>{const r=n(e,o);return t>r?t-r:0}}},Zt=Vt("height",(e=>{const t=e.dom;return yt(e)?t.getBoundingClientRect().height:t.offsetHeight})),Ut=e=>Zt.get(e),jt=e=>Zt.getOuter(e),Wt=(e,t)=>({left:e,top:t,translate:(o,n)=>Wt(e+o,t+n)}),$t=Wt,qt=(e,t)=>void 0!==e?e:void 0!==t?t:0,Gt=e=>{const t=e.dom.ownerDocument,o=t.body,n=t.defaultView,r=t.documentElement;if(o===e.dom)return $t(o.offsetLeft,o.offsetTop);const s=qt(null==n?void 0:n.pageYOffset,r.scrollTop),a=qt(null==n?void 0:n.pageXOffset,r.scrollLeft),i=qt(r.clientTop,o.clientTop),l=qt(r.clientLeft,o.clientLeft);return Kt(e).translate(a-l,s-i)},Kt=e=>{const t=e.dom,o=t.ownerDocument.body;return o===t?$t(o.offsetLeft,o.offsetTop):yt(e)?(e=>{const t=e.getBoundingClientRect();return $t(t.left,t.top)})(t):$t(0,0)},Yt=Vt("width",(e=>e.dom.offsetWidth)),Xt=e=>Yt.get(e),Jt=e=>Yt.getOuter(e),Qt=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},eo=()=>to(0,0),to=(e,t)=>({major:e,minor:t}),oo={nu:to,detect:(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?eo():((e,t)=>{const o=((e,t)=>{for(let o=0;oNumber(t.replace(o,"$"+e));return to(n(1),n(2))})(e,o)},unknown:eo},no=(e,t)=>{const o=String(t).toLowerCase();return j(e,(e=>e.search(o)))},ro=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,so=e=>t=>Ee(t,e),ao=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>Ee(e,"edge/")&&Ee(e,"chrome")&&Ee(e,"safari")&&Ee(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ro],search:e=>Ee(e,"chrome")&&!Ee(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>Ee(e,"msie")||Ee(e,"trident")},{name:"Opera",versionRegexes:[ro,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:so("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:so("firefox")},{name:"Safari",versionRegexes:[ro,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(Ee(e,"safari")||Ee(e,"mobile/"))&&Ee(e,"applewebkit")}],io=[{name:"Windows",search:so("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>Ee(e,"iphone")||Ee(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:so("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:so("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:so("linux"),versionRegexes:[]},{name:"Solaris",search:so("sunos"),versionRegexes:[]},{name:"FreeBSD",search:so("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:so("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],lo={browsers:w(ao),oses:w(io)},co="Edge",mo="Chromium",uo="Opera",go="Firefox",ho="Safari",po=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(co),isChromium:n(mo),isIE:n("IE"),isOpera:n(uo),isFirefox:n(go),isSafari:n(ho)}},fo={unknown:()=>po({current:void 0,version:oo.unknown()}),nu:po,edge:w(co),chromium:w(mo),ie:w("IE"),opera:w(uo),firefox:w(go),safari:w(ho)},vo="Windows",bo="Android",yo="Linux",wo="macOS",xo="Solaris",Co="FreeBSD",So="ChromeOS",ko=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(vo),isiOS:n("iOS"),isAndroid:n(bo),isMacOS:n(wo),isLinux:n(yo),isSolaris:n(xo),isFreeBSD:n(Co),isChromeOS:n(So)}},_o={unknown:()=>ko({current:void 0,version:oo.unknown()}),nu:ko,windows:w(vo),ios:w("iOS"),android:w(bo),linux:w(yo),macos:w(wo),solaris:w(xo),freebsd:w(Co),chromeos:w(So)},Eo=(e,t,o)=>{const n=lo.browsers(),r=lo.oses(),s=t.bind((e=>((e,t)=>re(t.brands,(t=>{const o=t.brand.toLowerCase();return j(e,(e=>{var t;return o===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:oo.nu(parseInt(t.version,10),0)})))})))(n,e))).orThunk((()=>((e,t)=>no(e,t).map((e=>{const o=oo.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(n,e))).fold(fo.unknown,fo.nu),a=((e,t)=>no(e,t).map((e=>{const o=oo.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(r,e).fold(_o.unknown,_o.nu),i=((e,t,o,n)=>{const r=e.isiOS()&&!0===/ipad/i.test(o),s=e.isiOS()&&!r,a=e.isiOS()||e.isAndroid(),i=a||n("(pointer:coarse)"),l=r||!s&&a&&n("(min-device-width:768px)"),c=s||a&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),m=!c&&!l&&!d;return{isiPad:w(r),isiPhone:w(s),isTablet:w(l),isPhone:w(c),isTouch:w(i),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:w(d),isDesktop:w(m)}})(a,s,e,o);return{browser:s,os:a,deviceType:i}},To=e=>window.matchMedia(e).matches;let Oo=Qt((()=>Eo(navigator.userAgent,A.from(navigator.userAgentData),To)));const Ao=()=>Oo(),Do=e=>{const t=Be.fromDom((e=>{if(gt()&&g(e.target)){const t=Be.fromDom(e.target);if(Ue(t)&&bt(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return te(t)}}return A.from(e.target)})(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),r=y(n,o);return((e,t,o,n,r,s,a)=>({target:e,x:t,y:o,stop:n,prevent:r,kill:s,raw:a}))(t,e.clientX,e.clientY,o,n,r,e)},Mo=(e,t,o,n,r)=>{const s=((e,t)=>o=>{e(o)&&t(Do(o))})(o,n);return e.dom.addEventListener(t,s,r),{unbind:S(No,e,t,s,r)}},No=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},Ro=(e,t)=>{nt(e).each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},Bo=(e,t)=>{const o=(e=>A.from(e.dom.nextSibling).map(Be.fromDom))(e);o.fold((()=>{nt(e).each((e=>{Ho(e,t)}))}),(e=>{Ro(e,t)}))},Lo=(e,t)=>{lt(e).fold((()=>{Ho(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},Ho=(e,t)=>{e.dom.appendChild(t.dom)},Io=(e,t)=>{F(t,(t=>{Ho(e,t)}))},Po=e=>{e.dom.textContent="",F(at(e),(e=>{Fo(e)}))},Fo=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},zo=e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return $t(o,n)},Vo=(e,t,o)=>{const n=(void 0!==o?o.dom:document).defaultView;n&&n.scrollTo(e,t)},Zo=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),Uo=e=>{const t=void 0===e?window:e,o=t.document,n=zo(Be.fromDom(o));return(e=>{const t=void 0===e?window:e;return Ao().browser.isFirefox()?A.none():A.from(t.visualViewport)})(t).fold((()=>{const e=t.document.documentElement,o=e.clientWidth,r=e.clientHeight;return Zo(n.left,n.top,o,r)}),(e=>Zo(Math.max(e.pageLeft,n.left),Math.max(e.pageTop,n.top),e.width,e.height)))},jo=()=>Be.fromDom(document),Wo=(e,t)=>e.view(t).fold(w([]),(t=>{const o=e.owner(t),n=Wo(e,o);return[t].concat(n)}));var $o=Object.freeze({__proto__:null,view:e=>{var t;return(e.dom===document?A.none():A.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(Be.fromDom)},owner:e=>Qe(e)});const qo=e=>{const t=jo(),o=zo(t),n=((e,t)=>{const o=t.owner(e),n=Wo(t,o);return A.some(n)})(e,$o);return n.fold(S(Gt,e),(t=>{const n=Kt(e),r=Z(t,((e,t)=>{const o=Kt(t);return{left:e.left+o.left,top:e.top+o.top}}),{left:0,top:0});return $t(r.left+n.left+o.left,r.top+n.top+o.top)}))},Go=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),Ko=e=>{const t=Gt(e),o=Jt(e),n=jt(e);return Go(t.left,t.top,o,n)},Yo=e=>{const t=qo(e),o=Jt(e),n=jt(e);return Go(t.left,t.top,o,n)},Xo=(e,t)=>{const o=Math.max(e.x,t.x),n=Math.max(e.y,t.y),r=Math.min(e.right,t.right),s=Math.min(e.bottom,t.bottom);return Go(o,n,r-o,s-n)},Jo=()=>Uo(window),Qo=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},en=e=>{const t=Qo(A.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(A.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(A.some(e))}}},tn=()=>en((e=>e.unbind())),on=()=>{const e=en(v);return{...e,on:t=>e.get().each(t)}};var nn=tinymce.util.Tools.resolve("tinymce.ThemeManager");const rn=e=>{const t=t=>t(e),o=w(e),n=()=>r,r={tag:!0,inner:e,fold:(t,o)=>o(e),isValue:O,isError:T,map:t=>an.value(t(e)),mapError:n,bind:t,exists:t,forall:t,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:t=>{t(e)},toOptional:()=>A.some(e)};return r},sn=e=>{const t=()=>o,o={tag:!1,inner:e,fold:(t,o)=>t(e),isValue:T,isError:O,map:t,mapError:t=>an.error(t(e)),bind:t,exists:T,forall:O,getOr:x,or:x,getOrThunk:E,orThunk:E,getOrDie:_(String(e)),each:v,toOptional:A.none};return o},an={value:rn,error:sn,fromOption:(e,t)=>e.fold((()=>sn(t)),rn)};var ln;!function(e){e[e.Error=0]="Error",e[e.Value=1]="Value"}(ln||(ln={}));const cn=(e,t,o)=>e.stype===ln.Error?t(e.serror):o(e.svalue),dn=e=>({stype:ln.Value,svalue:e}),mn=e=>({stype:ln.Error,serror:e}),un=e=>e.fold(mn,dn),gn=e=>cn(e,an.error,an.value),hn=dn,pn=e=>{const t=[],o=[];return F(e,(e=>{cn(e,(e=>o.push(e)),(e=>t.push(e)))})),{values:t,errors:o}},fn=mn,vn=(e,t)=>e.stype===ln.Value?t(e.svalue):e,bn=(e,t)=>e.stype===ln.Error?t(e.serror):e,yn=(e,t)=>e.stype===ln.Value?{stype:ln.Value,svalue:t(e.svalue)}:e,wn=(e,t)=>e.stype===ln.Error?{stype:ln.Error,serror:t(e.serror)}:e,xn=cn,Cn=(e,t,o,n)=>({tag:"field",key:e,newKey:t,presence:o,prop:n}),Sn=(e,t,o)=>{switch(e.tag){case"field":return t(e.key,e.newKey,e.presence,e.prop);case"custom":return o(e.newKey,e.instantiator)}},kn=e=>(...t)=>{if(0===t.length)throw new Error("Can't merge zero objects");const o={};for(let n=0;ni(e)&&i(t)?_n(e,t):t)),En=kn(((e,t)=>t)),Tn=e=>({tag:"defaultedThunk",process:e}),On=e=>Tn(w(e)),An=e=>({tag:"mergeWithThunk",process:e}),Dn=e=>y(fn,$)(e),Mn=e=>{const t=pn(e);return t.errors.length>0?Dn(t.errors):hn(t.values)},Nn=e=>a(e)&&se(e).length>100?" removed due to size":JSON.stringify(e,null,2),Rn=(e,t)=>fn([{path:e,getErrorInfo:t}]),Bn=e=>({extract:(t,o)=>bn(e(o),(e=>((e,t)=>Rn(e,w(t)))(t,e))),toString:w("val")}),Ln=Bn(hn),Hn=(e,t,o,n)=>fe(t,o).fold((()=>((e,t,o)=>Rn(e,(()=>'Could not find valid *required* value for "'+t+'" in '+Nn(o))))(e,o,t)),n),In=(e,t,o,n)=>n(fe(e,t).getOrThunk((()=>o(e)))),Pn=(e,t,o,n,r)=>{const s=e=>r.extract(t.concat([n]),e),a=e=>e.fold((()=>hn(A.none())),(e=>{const o=r.extract(t.concat([n]),e);return yn(o,A.some)}));switch(e.tag){case"required":return Hn(t,o,n,s);case"defaultedThunk":return In(o,n,e.process,s);case"option":return((e,t,o)=>o(fe(e,t)))(o,n,a);case"defaultedOptionThunk":return((e,t,o,n)=>n(fe(e,t).map((t=>!0===t?o(e):t))))(o,n,e.process,a);case"mergeWithThunk":return In(o,n,w({}),(t=>{const n=_n(e.process(o),t);return s(n)}))}},Fn=e=>({extract:(t,o)=>e().extract(t,o),toString:()=>e().toString()}),zn=e=>se(ue(e,g)),Vn=e=>{const t=Zn(e),o=Z(e,((e,t)=>Sn(t,(t=>_n(e,{[t]:!0})),w(e))),{});return{extract:(e,n)=>{const r=d(n)?[]:zn(n),s=V(r,(e=>!be(o,e)));return 0===s.length?t.extract(e,n):((e,t)=>Rn(e,(()=>"There are unsupported fields: ["+t.join(", ")+"] specified")))(e,s)},toString:t.toString}},Zn=e=>({extract:(t,o)=>((e,t,o)=>{const n={},r=[];for(const s of o)Sn(s,((o,s,a,i)=>{const l=Pn(a,e,t,o,i);xn(l,(e=>{r.push(...e)}),(e=>{n[s]=e}))}),((e,o)=>{n[e]=o(t)}));return r.length>0?fn(r):hn(n)})(t,o,e),toString:()=>{const t=P(e,(e=>Sn(e,((e,t,o,n)=>e+" -> "+n.toString()),((e,t)=>"state("+e+")"))));return"obj{\n"+t.join("\n")+"}"}}),Un=e=>({extract:(t,o)=>{const n=P(o,((o,n)=>e.extract(t.concat(["["+n+"]"]),o)));return Mn(n)},toString:()=>"array("+e.toString()+")"}),jn=(e,t)=>{const o=void 0!==t?t:x;return{extract:(t,n)=>{const r=[];for(const s of e){const e=s.extract(t,n);if(e.stype===ln.Value)return{stype:ln.Value,svalue:o(e.svalue)};r.push(e)}return Mn(r)},toString:()=>"oneOf("+P(e,(e=>e.toString())).join(", ")+")"}},Wn=(e,t)=>({extract:(o,n)=>{const r=se(n),s=((t,o)=>Un(Bn(e)).extract(t,o))(o,r);return vn(s,(e=>{const r=P(e,(e=>Cn(e,e,{tag:"required",process:{}},t)));return Zn(r).extract(o,n)}))},toString:()=>"setOf("+t.toString()+")"}),$n=y(Un,Zn),qn=w(Ln),Gn=(e,t)=>Bn((o=>{const n=typeof o;return e(o)?hn(o):fn(`Expected type: ${t} but got: ${n}`)})),Kn=Gn(p,"number"),Yn=Gn(s,"string"),Xn=Gn(d,"boolean"),Jn=Gn(h,"function"),Qn=e=>{if(Object(e)!==e)return!0;switch({}.toString.call(e).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(e).every((t=>Qn(e[t])));default:return!1}},er=Bn((e=>Qn(e)?hn(e):fn("Expected value to be acceptable for sending via postMessage"))),tr=(e,t,o,n)=>fe(o,n).fold((()=>((e,t,o)=>Rn(e,(()=>'The chosen schema: "'+o+'" did not exist in branches: '+Nn(t))))(e,o,n)),(o=>o.extract(e.concat(["branch: "+n]),t))),or=(e,t)=>({extract:(o,n)=>fe(n,e).fold((()=>((e,t)=>Rn(e,(()=>'Choice schema did not contain choice key: "'+t+'"')))(o,e)),(e=>tr(o,n,t,e))),toString:()=>"chooseOn("+e+"). Possible values: "+se(t)}),nr=e=>Bn((t=>e(t).fold(fn,hn))),rr=(e,t)=>Wn((t=>un(e(t))),t),sr=(e,t,o)=>gn(((e,t,o)=>{const n=t.extract([e],o);return wn(n,(e=>({input:o,errors:e})))})(e,t,o)),ar=e=>e.fold((e=>{throw new Error(lr(e))}),x),ir=(e,t,o)=>ar(sr(e,t,o)),lr=e=>"Errors: \n"+(e=>{const t=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:w("... (only showing first ten failures)")}]):e;return P(t,(e=>"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()))})(e.errors).join("\n")+"\n\nInput object: "+Nn(e.input),cr=(e,t)=>or(e,le(t,Zn)),dr=(e,t)=>((e,t)=>{const o=Qt(t);return{extract:(e,t)=>o().extract(e,t),toString:()=>o().toString()}})(0,t),mr=Cn,ur=(e,t)=>({tag:"custom",newKey:e,instantiator:t}),gr=e=>nr((t=>B(e,t)?an.value(t):an.error(`Unsupported value: "${t}", choose one of "${e.join(", ")}".`))),hr=e=>mr(e,e,{tag:"required",process:{}},qn()),pr=(e,t)=>mr(e,e,{tag:"required",process:{}},t),fr=e=>pr(e,Kn),vr=e=>pr(e,Yn),br=(e,t)=>mr(e,e,{tag:"required",process:{}},gr(t)),yr=e=>pr(e,Jn),wr=(e,t)=>mr(e,e,{tag:"required",process:{}},Zn(t)),xr=(e,t)=>mr(e,e,{tag:"required",process:{}},$n(t)),Cr=(e,t)=>mr(e,e,{tag:"required",process:{}},Un(t)),Sr=e=>mr(e,e,{tag:"option",process:{}},qn()),kr=(e,t)=>mr(e,e,{tag:"option",process:{}},t),_r=e=>kr(e,Kn),Er=e=>kr(e,Yn),Tr=(e,t)=>kr(e,gr(t)),Or=e=>kr(e,Jn),Ar=(e,t)=>kr(e,Un(t)),Dr=(e,t)=>kr(e,Zn(t)),Mr=(e,t)=>mr(e,e,On(t),qn()),Nr=(e,t,o)=>mr(e,e,On(t),o),Rr=(e,t)=>Nr(e,t,Kn),Br=(e,t)=>Nr(e,t,Yn),Lr=(e,t,o)=>Nr(e,t,gr(o)),Hr=(e,t)=>Nr(e,t,Xn),Ir=(e,t)=>Nr(e,t,Jn),Pr=(e,t,o)=>Nr(e,t,Un(o)),Fr=(e,t,o)=>Nr(e,t,Zn(o)),zr=e=>{if(!l(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],o={};return F(e,((n,r)=>{const s=se(n);if(1!==s.length)throw new Error("one and only one name per case");const a=s[0],i=n[a];if(void 0!==o[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!l(i))throw new Error("case arguments must be an array");t.push(a),o[a]=(...o)=>{const n=o.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+i.length+" ("+i+"), got "+n);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[r].apply(null,o)},match:e=>{const n=se(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));if(!G(t,(e=>B(n,e))))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,o)},log:e=>{console.log(e,{constructors:t,constructor:a,params:o})}}}})),o};zr([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const Vr=(e,t)=>((e,t)=>{const o={};return ie(e,((e,n)=>{B(t,n)||(o[n]=e)})),o})(e,t),Zr=(e,t)=>((e,t)=>({[e]:t}))(e,t),Ur=e=>(e=>{const t={};return F(e,(e=>{t[e.key]=e.value})),t})(e),jr=(e,t)=>{const o=(e=>{const t=[],o=[];return F(e,(e=>{e.fold((e=>{t.push(e)}),(e=>{o.push(e)}))})),{errors:t,values:o}})(e);return o.errors.length>0?(n=o.errors,an.error($(n))):((e,t)=>0===e.length?an.value(t):an.value(_n(t,En.apply(void 0,e))))(o.values,t);var n},Wr=e=>h(e)?e:T,$r=(e,t,o)=>{let n=e.dom;const r=Wr(o);for(;n.parentNode;){n=n.parentNode;const e=Be.fromDom(n),o=t(e);if(o.isSome())return o;if(r(e))break}return A.none()},qr=(e,t,o)=>{const n=t(e),r=Wr(o);return n.orThunk((()=>r(e)?A.none():$r(e,t,r)))},Gr=(e,t)=>Xe(e.element,t.event.target),Kr={can:O,abort:T,run:v},Yr=e=>{if(!be(e,"can")&&!be(e,"abort")&&!be(e,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(e,null,2)+" does not have can, abort, or run!");return{...Kr,...e}},Xr=e=>{const t=((e,t)=>(...o)=>U(e,((e,n)=>e&&t(n).apply(void 0,o)),!0))(e,(e=>e.can)),o=((e,t)=>(...o)=>U(e,((e,n)=>e||t(n).apply(void 0,o)),!1))(e,(e=>e.abort));return{can:t,abort:o,run:(...t)=>{F(e,(e=>{e.run.apply(void 0,t)}))}}},Jr=w,Qr=Jr("touchstart"),es=Jr("touchmove"),ts=Jr("touchend"),os=Jr("touchcancel"),ns=Jr("mousedown"),rs=Jr("mousemove"),ss=Jr("mouseout"),as=Jr("mouseup"),is=Jr("mouseover"),ls=Jr("focusin"),cs=Jr("focusout"),ds=Jr("keydown"),ms=Jr("keyup"),us=Jr("input"),gs=Jr("change"),hs=Jr("click"),ps=Jr("transitioncancel"),fs=Jr("transitionend"),vs=Jr("transitionstart"),bs=Jr("selectstart"),ys=e=>w("alloy."+e),ws={tap:ys("tap")},xs=ys("focus"),Cs=ys("blur.post"),Ss=ys("paste.post"),ks=ys("receive"),_s=ys("execute"),Es=ys("focus.item"),Ts=ws.tap,Os=ys("longpress"),As=ys("sandbox.close"),Ds=ys("typeahead.cancel"),Ms=ys("system.init"),Ns=ys("system.touchmove"),Rs=ys("system.touchend"),Bs=ys("system.scroll"),Ls=ys("system.resize"),Hs=ys("system.attached"),Is=ys("system.detached"),Ps=ys("system.dismissRequested"),Fs=ys("system.repositionRequested"),zs=ys("focusmanager.shifted"),Vs=ys("slotcontainer.visibility"),Zs=ys("system.external.element.scroll"),Us=ys("change.tab"),js=ys("dismiss.tab"),Ws=ys("highlight"),$s=ys("dehighlight"),qs=(e,t)=>{Xs(e,e.element,t,{})},Gs=(e,t,o)=>{Xs(e,e.element,t,o)},Ks=e=>{qs(e,_s())},Ys=(e,t,o)=>{Xs(e,t,o,{})},Xs=(e,t,o,n)=>{const r={target:t,...n};e.getSystem().triggerEvent(o,t,r)},Js=(e,t,o,n)=>{e.getSystem().triggerEvent(o,t,n.event)},Qs=e=>Ur(e),ea=(e,t)=>({key:e,value:Yr({abort:t})}),ta=e=>({key:e,value:Yr({run:(e,t)=>{t.event.prevent()}})}),oa=(e,t)=>({key:e,value:Yr({run:t})}),na=(e,t,o)=>({key:e,value:Yr({run:(e,n)=>{t.apply(void 0,[e,n].concat(o))}})}),ra=e=>t=>({key:e,value:Yr({run:(e,o)=>{Gr(e,o)&&t(e,o)}})}),sa=(e,t,o)=>((e,t)=>oa(e,((o,n)=>{o.getSystem().getByUid(t).each((t=>{Js(t,t.element,e,n)}))})))(e,t.partUids[o]),aa=(e,t)=>oa(e,((e,o)=>{const n=o.event,r=e.getSystem().getByDom(n.target).getOrThunk((()=>qr(n.target,(t=>e.getSystem().getByDom(t).toOptional()),T).getOr(e)));t(e,r,o)})),ia=e=>oa(e,((e,t)=>{t.cut()})),la=e=>oa(e,((e,t)=>{t.stop()})),ca=(e,t)=>ra(e)(t),da=ra(Hs()),ma=ra(Is()),ua=ra(Ms()),ga=(e=>t=>oa(e,t))(_s()),ha=e=>P(e,(e=>Oe(e,"/*")?e.substring(0,e.length-2):e)),pa=(e,t)=>{const o=e.toString(),n=o.indexOf(")")+1,r=o.indexOf("("),s=o.substring(r+1,n-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:t,parameters:ha(s)}),e},fa=e=>({classes:m(e.classes)?[]:e.classes,attributes:m(e.attributes)?{}:e.attributes,styles:m(e.styles)?{}:e.styles}),va=(e,t,o)=>ua(((n,r)=>{o(n,e,t)})),ba=(e,t,o)=>((e,t,o)=>{const n=o.toString(),r=n.indexOf(")")+1,s=n.indexOf("("),a=n.substring(s+1,r-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:t,parameters:ha(a.slice(0,1).concat(a.slice(3)))}),e})(((n,...r)=>{const s=[n].concat(r);return n.config({name:w(e)}).fold((()=>{throw new Error("We could not find any behaviour configuration for: "+e+". Using API: "+o)}),(e=>{const o=Array.prototype.slice.call(s,1);return t.apply(void 0,[n,e.config,e.state].concat(o))}))}),o,t),ya=e=>({key:e,value:void 0}),wa=(e,t,o,n,r,s,a)=>{const i=e=>be(e,o)?e[o]():A.none(),l=le(r,((e,t)=>ba(o,e,t))),c={...le(s,((e,t)=>pa(e,t))),...l,revoke:S(ya,o),config:t=>{const n=ir(o+"-config",e,t);return{key:o,value:{config:n,me:c,configAsRaw:Qt((()=>ir(o+"-config",e,t))),initialConfig:t,state:a}}},schema:w(t),exhibit:(e,t)=>xe(i(e),fe(n,"exhibit"),((e,o)=>o(t,e.config,e.state))).getOrThunk((()=>fa({}))),name:w(o),handlers:e=>i(e).map((e=>fe(n,"events").getOr((()=>({})))(e.config,e.state))).getOr({})};return c},xa={init:()=>Ca({readState:w("No State required")})},Ca=e=>e,Sa=e=>Ur(e),ka=Vn([hr("fields"),hr("name"),Mr("active",{}),Mr("apis",{}),Mr("state",xa),Mr("extra",{})]),_a=e=>{const t=ir("Creating behaviour: "+e.name,ka,e);return((e,t,o,n,r,s)=>{const a=Vn(e),i=Dr(t,[(l="config",c=e,kr(l,Vn(c)))]);var l,c;return wa(a,i,t,o,n,r,s)})(t.fields,t.name,t.active,t.apis,t.extra,t.state)},Ea=Vn([hr("branchKey"),hr("branches"),hr("name"),Mr("active",{}),Mr("apis",{}),Mr("state",xa),Mr("extra",{})]),Ta=e=>{const t=ir("Creating behaviour: "+e.name,Ea,e);return((e,t,o,n,r,s)=>{const a=e,i=Dr(t,[kr("config",e)]);return wa(a,i,t,o,n,r,s)})(cr(t.branchKey,t.branches),t.name,t.active,t.apis,t.extra,t.state)},Oa=w(void 0),Aa=(e,t)=>{const o=_t(e,t);return void 0===o||""===o?[]:o.split(" ")},Da=e=>void 0!==e.dom.classList,Ma=e=>Aa(e,"class"),Na=(e,t)=>((e,t,o)=>{const n=Aa(e,t).concat([o]);return St(e,t,n.join(" ")),!0})(e,"class",t),Ra=(e,t)=>((e,t,o)=>{const n=V(Aa(e,t),(e=>e!==o));return n.length>0?St(e,t,n.join(" ")):Ot(e,t),!1})(e,"class",t),Ba=(e,t)=>{Da(e)?e.dom.classList.add(t):Na(e,t)},La=e=>{0===(Da(e)?e.dom.classList:Ma(e)).length&&Ot(e,"class")},Ha=(e,t)=>{if(Da(e)){e.dom.classList.remove(t)}else Ra(e,t);La(e)},Ia=(e,t)=>{const o=Da(e)?e.dom.classList.toggle(t):((e,t)=>B(Ma(e),t)?Ra(e,t):Na(e,t))(e,t);return La(e),o},Pa=(e,t)=>Da(e)&&e.dom.classList.contains(t),Fa=(e,t)=>{F(t,(t=>{Ba(e,t)}))},za=(e,t)=>{F(t,(t=>{Ha(e,t)}))},Va=e=>Da(e)?(e=>{const t=e.dom.classList,o=new Array(t.length);for(let e=0;e{const s=e=>e+"px";return{position:e,left:t.map(s),top:o.map(s),right:n.map(s),bottom:r.map(s)}},Ua=(e,t)=>{Rt(e,(e=>({...e,position:A.some(e.position)}))(t))},ja=e=>(ye(Ht(e,"position"),"fixed")?A.none():st(e)).orThunk((()=>{const t=Be.fromTag("span");return nt(e).bind((e=>{Ho(e,t);const o=st(t);return Fo(t),o}))})),Wa=e=>ja(e).map(Gt).getOrThunk((()=>$t(0,0))),$a=(e,t)=>{const o=e.element;Ba(o,t.transitionClass),Ha(o,t.fadeOutClass),Ba(o,t.fadeInClass),t.onShow(e)},qa=(e,t)=>{const o=e.element;Ba(o,t.transitionClass),Ha(o,t.fadeInClass),Ba(o,t.fadeOutClass),t.onHide(e)},Ga=(e,t)=>e.y>=t.y,Ka=(e,t)=>e.bottom<=t.bottom,Ya=(e,t,o)=>({location:"top",leftX:t,topY:o.bounds.y-e.y}),Xa=(e,t,o)=>({location:"bottom",leftX:t,bottomY:e.bottom-o.bounds.bottom}),Ja=e=>e.box.x-e.win.x,Qa=(e,t,o)=>o.getInitialPos().map((o=>{const n=((e,t)=>{const o=t.optScrollEnv.fold(w(e.bounds.y),(t=>t.scrollElmTop+(e.bounds.y-t.currentScrollTop)));return $t(e.bounds.x,o)})(o,t);return{box:Go(n.left,n.top,Xt(e),Ut(e)),location:o.location}})),ei=(e,t,o,n,r)=>{const s=((e,t)=>{const o=t.optScrollEnv.fold(w(e.y),(t=>e.y+t.currentScrollTop-t.scrollElmTop));return $t(e.x,o)})(t,o),a=Go(s.left,s.top,t.width,t.height);n.setInitialPos({style:It(e),position:Bt(e,"position")||"static",bounds:a,location:r.location})},ti=(e,t,o)=>o.getInitialPos().bind((n=>{var r;switch(o.clearInitialPos(),n.position){case"static":return A.some({morph:"static"});case"absolute":const o=ja(e).getOr(wt()),s=Ko(o),a=null!==(r=o.dom.scrollTop)&&void 0!==r?r:0;return A.some({morph:"absolute",positionCss:Za("absolute",fe(n.style,"left").map((e=>t.x-s.x)),fe(n.style,"top").map((e=>t.y-s.y+a)),fe(n.style,"right").map((e=>s.right-t.right)),fe(n.style,"bottom").map((e=>s.bottom-t.bottom)))});default:return A.none()}})),oi=(e,t,o)=>Qa(e,t,o).filter((({box:e})=>((e,t,o)=>G(e,(e=>{switch(e){case"bottom":return Ka(t,o.bounds);case"top":return Ga(t,o.bounds)}})))(o.getModes(),e,t))).bind((({box:t})=>ti(e,t,o))),ni=e=>{switch(e.location){case"top":return A.some({morph:"fixed",positionCss:Za("fixed",A.some(e.leftX),A.some(e.topY),A.none(),A.none())});case"bottom":return A.some({morph:"fixed",positionCss:Za("fixed",A.some(e.leftX),A.none(),A.none(),A.some(e.bottomY))});default:return A.none()}},ri=(e,t,o)=>{const n=Ko(e),r=Jo(),s=((e,t,o)=>{const n=t.win,r=t.box,s=Ja(t);return re(e,(e=>{switch(e){case"bottom":return Ka(r,o.bounds)?A.none():A.some(Xa(n,s,o));case"top":return Ga(r,o.bounds)?A.none():A.some(Ya(n,s,o));default:return A.none()}})).getOr({location:"no-dock"})})(o.getModes(),{win:r,box:n},t);return"top"===s.location||"bottom"===s.location?(ei(e,n,t,o,s),ni(s)):A.none()},si=(e,t,o)=>{const n=e.element;return ye(Ht(n,"position"),"fixed")?((e,t,o)=>oi(e,t,o).orThunk((()=>t.optScrollEnv.bind((n=>Qa(e,t,o))).bind((({box:e,location:o})=>{const n=Jo(),r=Ja({win:n,box:e}),s="top"===o?Ya(n,r,t):Xa(n,r,t);return ni(s)})))))(n,t,o):ri(n,t,o)},ai=(e,t,o,n)=>{const r=Ko(e),s=Jo(),a=n(s,Ja({win:s,box:r}),t);return"bottom"===a.location||"top"===a.location?(((e,t,o,n,r)=>{n.getInitialPos().fold((()=>ei(e,t,o,n,r)),(()=>v))})(e,r,t,o,a),ni(a)):A.none()},ii=(e,t,o)=>{o.setDocked(!1),F(["left","right","top","bottom","position"],(t=>Ft(e.element,t))),t.onUndocked(e)},li=(e,t,o,n)=>{const r="fixed"===n.position;o.setDocked(r),Ua(e.element,n);(r?t.onDocked:t.onUndocked)(e)},ci=(e,t,o,n,r=!1)=>{t.contextual.each((t=>{t.lazyContext(e).each((s=>{const a=((e,t)=>e.yt.y)(s,n.bounds);if(a!==o.isVisible())if(o.setVisible(a),r&&!a)Fa(e.element,[t.fadeOutClass]),t.onHide(e);else{(a?$a:qa)(e,t)}}))}))},di=(e,t,o,n,r)=>{ci(e,t,o,n,!0),li(e,t,o,r.positionCss)},mi=(e,t,o)=>{const n=t.lazyViewport(e);ci(e,t,o,n),si(e,n,o).each((r=>{((e,t,o,n,r)=>{switch(r.morph){case"static":return ii(e,t,o);case"absolute":return li(e,t,o,r.positionCss);case"fixed":di(e,t,o,n,r)}})(e,t,o,n,r)}))},ui=(e,t,o)=>{const n=e.element;o.setDocked(!1);const r=t.lazyViewport(e);((e,t,o)=>{const n=e.element;return Qa(n,t,o).bind((({box:e})=>ti(n,e,o)))})(e,r,o).each((n=>{switch(n.morph){case"static":ii(e,t,o);break;case"absolute":li(e,t,o,n.positionCss)}})),o.setVisible(!0),t.contextual.each((t=>{za(n,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(e)})),gi(e,t,o)},gi=(e,t,o)=>{e.getSystem().isConnected()&&mi(e,t,o)},hi=(e,t,o)=>{o.isDocked()&&ui(e,t,o)},pi=e=>(t,o,n)=>{const r=o.lazyViewport(t);ai(t.element,r,n,e).each((e=>{di(t,o,n,r,e)}))},fi=pi(Ya),vi=pi(Xa);var bi=Object.freeze({__proto__:null,refresh:gi,reset:hi,isDocked:(e,t,o)=>o.isDocked(),getModes:(e,t,o)=>o.getModes(),setModes:(e,t,o,n)=>o.setModes(n),forceDockToTop:fi,forceDockToBottom:vi});var yi=Object.freeze({__proto__:null,events:(e,t)=>Qs([ca(fs(),((o,n)=>{e.contextual.each((e=>{if(Pa(o.element,e.transitionClass)){za(o.element,[e.transitionClass,e.fadeInClass]);(t.isVisible()?e.onShown:e.onHidden)(o)}n.stop()}))})),oa(Bs(),((o,n)=>{gi(o,e,t)})),oa(Zs(),((o,n)=>{gi(o,e,t)})),oa(Ls(),((o,n)=>{hi(o,e,t)}))])});const wi=e=>e.dom.innerHTML,xi=(e,t)=>{const o=Qe(e).dom,n=Be.fromDom(o.createDocumentFragment()),r=((e,t)=>{const o=(t||document).createElement("div");return o.innerHTML=e,at(Be.fromDom(o))})(t,o);Io(n,r),Po(e),Ho(e,n)},Ci=(e,t)=>Be.fromDom(e.dom.cloneNode(t)),Si=e=>{if(mt(e))return"#shadow-root";{const t=(e=>Ci(e,!1))(e);return(e=>{const t=Be.fromTag("div"),o=Be.fromDom(e.dom.cloneNode(!0));return Ho(t,o),wi(t)})(t)}},ki=e=>Si(e),_i="unknown";var Ei;!function(e){e[e.STOP=0]="STOP",e[e.NORMAL=1]="NORMAL",e[e.LOGGING=2]="LOGGING"}(Ei||(Ei={}));const Ti=Qo({}),Oi=(e,t,o)=>{switch(fe(Ti.get(),e).orThunk((()=>{const t=se(Ti.get());return re(t,(t=>e.indexOf(t)>-1?A.some(Ti.get()[t]):A.none()))})).getOr(Ei.NORMAL)){case Ei.NORMAL:return o(Mi());case Ei.LOGGING:{const n=((e,t)=>{const o=[],n=(new Date).getTime();return{logEventCut:(e,t,n)=>{o.push({outcome:"cut",target:t,purpose:n})},logEventStopped:(e,t,n)=>{o.push({outcome:"stopped",target:t,purpose:n})},logNoParent:(e,t,n)=>{o.push({outcome:"no-parent",target:t,purpose:n})},logEventNoHandlers:(e,t)=>{o.push({outcome:"no-handlers-left",target:t})},logEventResponse:(e,t,n)=>{o.push({outcome:"response",purpose:n,target:t})},write:()=>{const r=(new Date).getTime();B(["mousemove","mouseover","mouseout",Ms()],e)||console.log(e,{event:e,time:r-n,target:t.dom,sequence:P(o,(e=>B(["cut","stopped","response"],e.outcome)?"{"+e.purpose+"} "+e.outcome+" at ("+ki(e.target)+")":e.outcome))})}}})(e,t),r=o(n);return n.write(),r}case Ei.STOP:return!0}},Ai=["alloy/data/Fields","alloy/debugging/Debugging"],Di=(e,t,o)=>Oi(e,t,o),Mi=w({logEventCut:v,logEventStopped:v,logNoParent:v,logEventNoHandlers:v,logEventResponse:v,write:v}),Ni=w([hr("menu"),hr("selectedMenu")]),Ri=w([hr("item"),hr("selectedItem")]);w(Zn(Ri().concat(Ni())));const Bi=w(Zn(Ri())),Li=wr("initSize",[hr("numColumns"),hr("numRows")]),Hi=()=>wr("markers",[hr("backgroundMenu")].concat(Ni()).concat(Ri())),Ii=e=>wr("markers",P(e,hr)),Pi=(e,t,o)=>((()=>{const e=new Error;if(void 0!==e.stack){const t=e.stack.split("\n");return j(t,(e=>e.indexOf("alloy")>0&&!L(Ai,(t=>e.indexOf(t)>-1)))).getOr(_i)}})(),mr(t,t,o,nr((e=>an.value(((...t)=>e.apply(void 0,t))))))),Fi=e=>Pi(0,e,On(v)),zi=e=>Pi(0,e,On(A.none)),Vi=e=>Pi(0,e,{tag:"required",process:{}}),Zi=e=>Pi(0,e,{tag:"required",process:{}}),Ui=(e,t)=>ur(e,w(t)),ji=e=>ur(e,x),Wi=w(Li);var $i=[Dr("contextual",[vr("fadeInClass"),vr("fadeOutClass"),vr("transitionClass"),yr("lazyContext"),Fi("onShow"),Fi("onShown"),Fi("onHide"),Fi("onHidden")]),Ir("lazyViewport",(()=>({bounds:Jo(),optScrollEnv:A.none()}))),Pr("modes",["top","bottom"],Yn),Fi("onDocked"),Fi("onUndocked")];const qi=_a({fields:$i,name:"docking",active:yi,apis:bi,state:Object.freeze({__proto__:null,init:e=>{const t=Qo(!1),o=Qo(!0),n=on(),r=Qo(e.modes);return Ca({isDocked:t.get,setDocked:t.set,getInitialPos:n.get,setInitialPos:n.set,clearInitialPos:n.clear,isVisible:o.get,setVisible:o.set,getModes:r.get,setModes:r.set,readState:()=>`docked: ${t.get()}, visible: ${o.get()}, modes: ${r.get().join(",")}`})}})}),Gi=Qs([((e,t)=>({key:e,value:Yr({can:t})}))(xs(),((e,t)=>{const o=t.event,n=o.originator,r=o.target;return!((e,t,o)=>Xe(t,e.element)&&!Xe(t,o))(e,n,r)||(console.warn(xs()+" did not get interpreted by the desired target. \nOriginator: "+ki(n)+"\nTarget: "+ki(r)+"\nCheck the "+xs()+" event handlers"),!1)}))]);var Ki=Object.freeze({__proto__:null,events:Gi});let Yi=0;const Xi=e=>{const t=(new Date).getTime(),o=Math.floor(1e9*Math.random());return Yi++,e+"_"+o+Yi+String(t)},Ji=w("alloy-id-"),Qi=w("data-alloy-id"),el=Ji(),tl=Qi(),ol=(e,t)=>{Object.defineProperty(e.dom,tl,{value:t,writable:!0})},nl=e=>{const t=Ue(e)?e.dom[tl]:null;return A.from(t)},rl=e=>Xi(e),sl=x,al=e=>{const t=t=>`The component must be in a context to execute: ${t}`+(e?"\n"+ki(e().element)+" is not in context.":""),o=e=>()=>{throw new Error(t(e))},n=e=>()=>{console.warn(t(e))};return{debugInfo:w("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),broadcastEvent:n("broadcastEvent"),build:o("build"),buildOrPatch:o("buildOrPatch"),addToWorld:o("addToWorld"),removeFromWorld:o("removeFromWorld"),addToGui:o("addToGui"),removeFromGui:o("removeFromGui"),getByUid:o("getByUid"),getByDom:o("getByDom"),isConnected:T}},il=al(),ll=Xi("alloy-premade"),cl=e=>(Object.defineProperty(e.element.dom,ll,{value:e.uid,writable:!0}),Zr(ll,e)),dl=e=>fe(e,ll),ml=e=>((e,t)=>{const o=t.toString(),n=o.indexOf(")")+1,r=o.indexOf("("),s=o.substring(r+1,n-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:"OVERRIDE",parameters:ha(s.slice(1))}),e})(((t,...o)=>e(t.getApis(),t,...o)),e),ul=(e,t)=>{const o={};return ie(e,((e,n)=>{ie(e,((e,r)=>{const s=fe(o,r).getOr([]);o[r]=s.concat([t(n,e)])}))})),o},gl=e=>e.cHandler,hl=(e,t)=>({name:e,handler:t}),pl=(e,t)=>{const o={};return F(e,(e=>{o[e.name()]=e.handlers(t)})),o},fl=(e,t,o,n)=>{const r=((e,t,o)=>{const n={...o,...pl(t,e)};return ul(n,hl)})(e,o,n);return yl(r,t)},vl=e=>{const t=(e=>h(e)?{can:O,abort:T,run:e}:e)(e);return(e,o,...n)=>{const r=[e,o].concat(n);t.abort.apply(void 0,r)?o.stop():t.can.apply(void 0,r)&&t.run.apply(void 0,r)}},bl=(e,t,o)=>{const n=t[o];return n?((e,t,o,n)=>{try{const r=Q(o,((o,r)=>{const s=o[t],a=r[t],i=n.indexOf(s),l=n.indexOf(a);if(-1===i)throw new Error("The ordering for "+e+" does not have an entry for "+s+".\nOrder specified: "+JSON.stringify(n,null,2));if(-1===l)throw new Error("The ordering for "+e+" does not have an entry for "+a+".\nOrder specified: "+JSON.stringify(n,null,2));return i{const t=P(e,(e=>e.handler));return Xr(t)})):((e,t)=>an.error(["The event ("+e+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(P(t,(e=>e.name)),null,2)]))(o,e)},yl=(e,t)=>{const o=ge(e,((e,o)=>(1===e.length?an.value(e[0].handler):bl(e,t,o)).map((n=>{const r=vl(n),s=e.length>1?V(t[o],(t=>L(e,(e=>e.name===t)))).join(" > "):e[0].name;return Zr(o,((e,t)=>({handler:e,purpose:t}))(r,s))}))));return jr(o,{})},wl="alloy.base.behaviour",xl=Zn([mr("dom","dom",{tag:"required",process:{}},Zn([hr("tag"),Mr("styles",{}),Mr("classes",[]),Mr("attributes",{}),Sr("value"),Sr("innerHtml")])),hr("components"),hr("uid"),Mr("events",{}),Mr("apis",{}),mr("eventOrder","eventOrder",(e=>An(w(e)))({[_s()]:["disabling",wl,"toggling","typeaheadevents"],[xs()]:[wl,"focusing","keying"],[Ms()]:[wl,"disabling","toggling","representing"],[us()]:[wl,"representing","streaming","invalidating"],[Is()]:[wl,"representing","item-events","toolbar-button-events","tooltipping"],[ns()]:["focusing",wl,"item-type-events"],[Qr()]:["focusing",wl,"item-type-events"],[is()]:["item-type-events","tooltipping"],[ks()]:["receiving","reflecting","tooltipping"]}),qn()),Sr("domModification")]),Cl=e=>e.events,Sl=e=>e.dom.value,kl=(e,t)=>{if(void 0===t)throw new Error("Value.set was undefined");e.dom.value=t},_l=(e,t,o)=>{o.fold((()=>Ho(e,t)),(e=>{Xe(e,t)||(Ro(e,t),Fo(e))}))},El=(e,t,o)=>{const n=P(t,o),r=at(e);return F(r.slice(n.length),Fo),n},Tl=(e,t,o,n)=>{const r=it(e,t),s=n(o,r),a=((e,t,o)=>it(e,t).map((e=>{if(o.exists((t=>!Xe(t,e)))){const t=o.map(ze).getOr("span"),n=Be.fromTag(t);return Ro(e,n),n}return e})))(e,t,r);return _l(e,s.element,a),s},Ol=(e,t)=>{const o=se(e),n=se(t),r=Y(n,o),s=((e,t)=>{const o={},n={};return me(e,t,de(o),de(n)),{t:o,f:n}})(e,((e,o)=>!ve(t,o)||e!==t[o])).t;return{toRemove:r,toSet:s}},Al=(e,t)=>{const{class:o,style:n,...r}=(e=>U(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}))(t),{toSet:s,toRemove:a}=Ol(e.attributes,r),i=It(t),{toSet:l,toRemove:c}=Ol(e.styles,i),d=Va(t),m=Y(d,e.classes),u=Y(e.classes,d);return F(a,(e=>Ot(t,e))),kt(t,s),Fa(t,u),za(t,m),F(c,(e=>Ft(t,e))),Nt(t,l),e.innerHtml.fold((()=>{const o=e.domChildren;((e,t)=>{El(e,t,((t,o)=>{const n=it(e,o);return _l(e,t,n),t}))})(t,o)}),(e=>{xi(t,e)})),(()=>{const o=t,n=e.value.getOrUndefined();n!==Sl(o)&&kl(o,null!=n?n:"")})(),t},Dl=(e,t)=>{const o=t.filter((t=>ze(t)===e.tag&&!(e=>e.innerHtml.isSome()&&e.domChildren.length>0)(e)&&!(e=>ve(e.dom,ll))(t))).bind((t=>((e,t)=>{try{const o=Al(e,t);return A.some(o)}catch(e){return A.none()}})(e,t))).getOrThunk((()=>(e=>{const t=Be.fromTag(e.tag);kt(t,e.attributes),Fa(t,e.classes),Nt(t,e.styles),e.innerHtml.each((e=>xi(t,e)));const o=e.domChildren;return Io(t,o),e.value.each((e=>{kl(t,e)})),t})(e)));return ol(o,e.uid),o},Ml=(e,t)=>((e,t)=>{const o=P(t,(e=>Dr(e.name(),[hr("config"),Mr("state",xa)]))),n=sr("component.behaviours",Zn(o),e.behaviours).fold((t=>{throw new Error(lr(t)+"\nComplete spec:\n"+JSON.stringify(e,null,2))}),x);return{list:t,data:le(n,(e=>{const t=e.map((e=>({config:e.config,state:e.state.init(e.config)})));return w(t)}))}})(e,t),Nl=e=>{const t=(e=>{const t=fe(e,"behaviours").getOr({});return q(se(t),(e=>{const o=t[e];return g(o)?[o.me]:[]}))})(e);return Ml(e,t)},Rl=(e,t,o)=>{const n={...(r=e).dom,uid:r.uid,domChildren:P(r.components,(e=>e.element))};var r;const s=(e=>e.domModification.fold((()=>fa({})),fa))(e),a={"alloy.base.modification":s},i=t.length>0?((e,t,o,n)=>{const r={...t};F(o,(t=>{r[t.name()]=t.exhibit(e,n)}));const s=ul(r,((e,t)=>({name:e,modification:t}))),a=e=>Z(e,((e,t)=>({...t.modification,...e})),{}),i=Z(s.classes,((e,t)=>t.modification.concat(e)),[]),l=a(s.attributes),c=a(s.styles);return fa({classes:i,attributes:l,styles:c})})(o,a,t,n):s;return l=n,c=i,{...l,attributes:{...l.attributes,...c.attributes},styles:{...l.styles,...c.styles},classes:l.classes.concat(c.classes)};var l,c},Bl=(e,t)=>{const o=()=>u,n=Qo(il),r=ar((e=>sr("custom.definition",xl,e))(e)),s=Nl(e),a=(e=>e.list)(s),i=(e=>e.data)(s),l=Rl(r,a,i),c=Dl(l,t),d=((e,t,o)=>{const n={"alloy.base.behaviour":Cl(e)};return fl(o,e.eventOrder,t,n).getOrDie()})(r,a,i),m=Qo(r.components),u={uid:e.uid,getSystem:n.get,config:t=>{const o=i;return(h(o[t.name()])?o[t.name()]:()=>{throw new Error("Could not find "+t.name()+" in "+JSON.stringify(e,null,2))})()},hasConfigured:e=>h(i[e.name()]),spec:e,readState:e=>i[e]().map((e=>e.state.readState())).getOr("not enabled"),getApis:()=>r.apis,connect:e=>{n.set(e)},disconnect:()=>{n.set(al(o))},element:c,syncComponents:()=>{const e=at(c),t=q(e,(e=>n.get().getByDom(e).fold((()=>[]),J)));m.set(t)},components:m.get,events:d};return u},Ll=(e,t)=>{const{events:o,...n}=sl(e),r=((e,t)=>{const o=fe(e,"components").getOr([]);return t.fold((()=>P(o,zl)),(e=>P(o,((t,o)=>Fl(t,it(e,o))))))})(n,t),s={...n,events:{...Ki,...o},components:r};return an.value(Bl(s,t))},Hl=e=>{const t=Be.fromText(e);return Il({element:t})},Il=e=>{const t=ir("external.component",Vn([hr("element"),Sr("uid")]),e),o=Qo(al()),n=t.uid.getOrThunk((()=>rl("external")));ol(t.element,n);const r={uid:n,getSystem:o.get,config:A.none,hasConfigured:T,connect:e=>{o.set(e)},disconnect:()=>{o.set(al((()=>r)))},getApis:()=>({}),element:t.element,spec:e,readState:w("No state"),syncComponents:v,components:w([]),events:{}};return cl(r)},Pl=rl,Fl=(e,t)=>dl(e).getOrThunk((()=>{const o=(e=>ve(e,"uid"))(e)?e:{uid:Pl(""),...e};return Ll(o,t).getOrDie()})),zl=e=>Fl(e,A.none()),Vl=cl;var Zl=(e,t,o,n,r)=>e(o,n)?A.some(o):h(r)&&r(o)?A.none():t(o,n,r);const Ul=(e,t,o)=>{let n=e.dom;const r=h(o)?o:T;for(;n.parentNode;){n=n.parentNode;const e=Be.fromDom(n);if(t(e))return A.some(e);if(r(e))break}return A.none()},jl=(e,t,o)=>Zl(((e,t)=>t(e)),Ul,e,t,o),Wl=(e,t)=>j(e.dom.childNodes,(e=>t(Be.fromDom(e)))).map(Be.fromDom),$l=(e,t,o)=>jl(e,t,o).isSome(),ql=(e,t,o)=>Ul(e,(e=>Ge(e,t)),o),Gl=(e,t)=>((e,t)=>{const o=e.dom;return o.parentNode?Wl(Be.fromDom(o.parentNode),(o=>!Xe(e,o)&&t(o))):A.none()})(e,(e=>Ge(e,t))),Kl=(e,t)=>Wl(e,(e=>Ge(e,t))),Yl=(e,t)=>Ye(t,e),Xl=(e,t,o)=>Zl(((e,t)=>Ge(e,t)),ql,e,t,o),Jl="aria-controls",Ql=()=>{const e=Xi(Jl);return{id:e,link:t=>{St(t,Jl,e)},unlink:e=>{Ot(e,Jl)}}},ec=(e,t)=>(e=>jl(e,(e=>{if(!Ue(e))return!1;const t=_t(e,"id");return void 0!==t&&t.indexOf(Jl)>-1})).bind((e=>{const t=_t(e,"id"),o=ht(e);return Yl(o,`[${Jl}="${t}"]`)})))(t).exists((t=>tc(e,t))),tc=(e,t)=>$l(t,(t=>Xe(t,e.element)),T)||ec(e,t),oc=(e,t,o,n,r,s,a,i=!1)=>({x:e,y:t,bubble:o,direction:n,placement:r,restriction:s,label:`${a}-${r}`,alwaysFit:i}),nc=zr([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),rc=nc.southeast,sc=nc.southwest,ac=nc.northeast,ic=nc.northwest,lc=nc.south,cc=nc.north,dc=nc.east,mc=nc.west,uc=(e,t,o,n)=>{const r=e+t;return r>n?o:rMath.min(Math.max(e,t),o),hc=(e,t)=>X(["left","right","top","bottom"],(o=>fe(t,o).map((t=>((e,t)=>{switch(t){case 1:return e.x;case 0:return e.x+e.width;case 2:return e.y;case 3:return e.y+e.height}})(e,t))))),pc="layout",fc=e=>e.x,vc=(e,t)=>e.x+e.width/2-t.width/2,bc=(e,t)=>e.x+e.width-t.width,yc=(e,t)=>e.y-t.height,wc=e=>e.y+e.height,xc=(e,t)=>e.y+e.height/2-t.height/2,Cc=(e,t,o)=>oc(fc(e),wc(e),o.southeast(),rc(),"southeast",hc(e,{left:1,top:3}),pc),Sc=(e,t,o)=>oc(bc(e,t),wc(e),o.southwest(),sc(),"southwest",hc(e,{right:0,top:3}),pc),kc=(e,t,o)=>oc(fc(e),yc(e,t),o.northeast(),ac(),"northeast",hc(e,{left:1,bottom:2}),pc),_c=(e,t,o)=>oc(bc(e,t),yc(e,t),o.northwest(),ic(),"northwest",hc(e,{right:0,bottom:2}),pc),Ec=(e,t,o)=>oc(vc(e,t),yc(e,t),o.north(),cc(),"north",hc(e,{bottom:2}),pc),Tc=(e,t,o)=>oc(vc(e,t),wc(e),o.south(),lc(),"south",hc(e,{top:3}),pc),Oc=(e,t,o)=>oc((e=>e.x+e.width)(e),xc(e,t),o.east(),dc(),"east",hc(e,{left:0}),pc),Ac=(e,t,o)=>oc(((e,t)=>e.x-t.width)(e,t),xc(e,t),o.west(),mc(),"west",hc(e,{right:1}),pc),Dc=()=>[Cc,Sc,kc,_c,Tc,Ec,Oc,Ac],Mc=()=>[Sc,Cc,_c,kc,Tc,Ec,Oc,Ac],Nc=()=>[kc,_c,Cc,Sc,Ec,Tc],Rc=()=>[_c,kc,Sc,Cc,Ec,Tc],Bc=()=>[Cc,Sc,kc,_c,Tc,Ec],Lc=()=>[Sc,Cc,_c,kc,Tc,Ec];var Hc=Object.freeze({__proto__:null,events:e=>Qs([oa(ks(),((t,o)=>{const n=e.channels,r=se(n),s=o,a=((e,t)=>t.universal?e:V(e,(e=>B(t.channels,e))))(r,s);F(a,(e=>{const o=n[e],r=o.schema,a=ir("channel["+e+"] data\nReceiver: "+ki(t.element),r,s.data);o.onReceive(t,a)}))}))])}),Ic=[pr("channels",rr(an.value,Vn([Vi("onReceive"),Mr("schema",qn())])))];const Pc=_a({fields:Ic,name:"receiving",active:Hc});var Fc=Object.freeze({__proto__:null,exhibit:(e,t)=>fa({classes:[],styles:t.useFixed()?{}:{position:"relative"}})});const zc=(e,t=!1)=>e.dom.focus({preventScroll:t}),Vc=e=>e.dom.blur(),Zc=e=>{const t=ht(e).dom;return e.dom===t.activeElement},Uc=(e=jo())=>A.from(e.dom.activeElement).map(Be.fromDom),jc=e=>Uc(ht(e)).filter((t=>e.dom.contains(t.dom))),Wc=(e,t)=>{const o=ht(t),n=Uc(o).bind((e=>{const o=t=>Xe(e,t);return o(t)?A.some(t):((e,t)=>{const o=e=>{for(let n=0;n{Uc(o).filter((t=>Xe(t,e))).fold((()=>{zc(e)}),v)})),r},$c=zr([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),qc=(e,t,o,n,r,s)=>{const a=t.rect,i=a.x-o,l=a.y-n,c=r-(i+a.width),d=s-(l+a.height),m=A.some(i),u=A.some(l),g=A.some(c),h=A.some(d),p=A.none();return((e,t,o,n,r,s,a,i,l)=>e.fold(t,o,n,r,s,a,i,l))(t.direction,(()=>Za(e,m,u,p,p)),(()=>Za(e,p,u,g,p)),(()=>Za(e,m,p,p,h)),(()=>Za(e,p,p,g,h)),(()=>Za(e,m,u,p,p)),(()=>Za(e,m,p,p,h)),(()=>Za(e,m,u,p,p)),(()=>Za(e,p,u,g,p)))},Gc=(e,t)=>e.fold((()=>{const e=t.rect;return Za("absolute",A.some(e.x),A.some(e.y),A.none(),A.none())}),((e,o,n,r)=>qc("absolute",t,e,o,n,r)),((e,o,n,r)=>qc("fixed",t,e,o,n,r))),Kc=(e,t)=>{const o=S(qo,t),n=e.fold(o,o,(()=>{const e=zo();return qo(t).translate(-e.left,-e.top)})),r=Jt(t),s=jt(t);return Go(n.left,n.top,r,s)},Yc=(e,t)=>t.fold((()=>e.fold(Jo,Jo,Go)),(t=>e.fold(w(t),w(t),(()=>{const o=Xc(e,t.x,t.y);return Go(o.left,o.top,t.width,t.height)})))),Xc=(e,t,o)=>{const n=$t(t,o);return e.fold(w(n),w(n),(()=>{const e=zo();return n.translate(-e.left,-e.top)}))};$c.none;const Jc=$c.relative,Qc=$c.fixed,ed=(e,t)=>((e,t)=>({anchorBox:e,origin:t}))(e,t),td="data-alloy-placement",od=e=>Et(e,td),nd=zr([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),rd=(e,t,o,n)=>{const r=e.bubble,s=r.offset,a=((e,t,o)=>{const n=(n,r)=>t[n].map((t=>{const s="top"===n||"bottom"===n,a=s?o.top:o.left,i=("left"===n||"top"===n?Math.max:Math.min)(t,r)+a;return s?gc(i,e.y,e.bottom):gc(i,e.x,e.right)})).getOr(r),r=n("left",e.x),s=n("top",e.y),a=n("right",e.right),i=n("bottom",e.bottom);return Go(r,s,a-r,i-s)})(n,e.restriction,s),i=e.x+s.left,l=e.y+s.top,c=Go(i,l,t,o),{originInBounds:d,sizeInBounds:m,visibleW:u,visibleH:g}=((e,t)=>{const{x:o,y:n,right:r,bottom:s}=t,{x:a,y:i,right:l,bottom:c,width:d,height:m}=e;return{originInBounds:a>=o&&a<=r&&i>=n&&i<=s,sizeInBounds:l<=r&&l>=o&&c<=s&&c>=n,visibleW:Math.min(d,a>=o?r-a:l-o),visibleH:Math.min(m,i>=n?s-i:c-n)}})(c,a),h=d&&m,p=h?c:((e,t)=>{const{x:o,y:n,right:r,bottom:s}=t,{x:a,y:i,width:l,height:c}=e,d=Math.max(o,r-l),m=Math.max(n,s-c),u=gc(a,o,d),g=gc(i,n,m),h=Math.min(u+l,r)-u,p=Math.min(g+c,s)-g;return Go(u,g,h,p)})(c,a),f=p.width>0&&p.height>0,{maxWidth:v,maxHeight:b}=((e,t,o)=>{const n=w(t.bottom-o.y),r=w(o.bottom-t.y),s=((e,t,o,n)=>e.fold(t,t,n,n,t,n,o,o))(e,r,r,n),a=w(t.right-o.x),i=w(o.right-t.x),l=((e,t,o,n)=>e.fold(t,n,t,n,o,o,t,n))(e,i,i,a);return{maxWidth:l,maxHeight:s}})(e.direction,p,n),y={rect:p,maxHeight:b,maxWidth:v,direction:e.direction,placement:e.placement,classes:{on:r.classesOn,off:r.classesOff},layout:e.label,testY:l};return h||e.alwaysFit?nd.fit(y):nd.nofit(y,u,g,f)},sd=O,ad=(e,t,o)=>((e,t,o,n)=>Mo(e,t,o,n,!1))(e,t,sd,o),id=(e,t,o)=>((e,t,o,n)=>Mo(e,t,o,n,!0))(e,t,sd,o),ld=Do,cd=["top","bottom","right","left"],dd="data-alloy-transition-timer",md=(e,t)=>((e,t)=>G(t,(t=>Pa(e,t))))(e,t.classes),ud=(e,t)=>{const o=e=>parseFloat(e).toFixed(3);return he(t,((t,n)=>!((e,t,o=C)=>xe(e,t,o).getOr(e.isNone()&&t.isNone()))(e[n].map(o),t.map(o)))).isSome()},gd=(e,t)=>{const o=tn(),n=tn();let r;const a=t=>{var o;const n=null!==(o=t.raw.pseudoElement)&&void 0!==o?o:"";return Xe(t.target,e)&&Me(n)&&B(cd,t.raw.propertyName)},i=s=>{if(u(s)||a(s)){o.clear(),n.clear();const a=null==s?void 0:s.raw.type;(u(a)||a===fs())&&(clearTimeout(r),Ot(e,dd),za(e,t.classes))}},l=ad(e,vs(),(t=>{a(t)&&(l.unbind(),o.set(ad(e,fs(),i)),n.set(ad(e,ps(),i)))})),c=(e=>{const t=t=>{const o=Bt(e,t).split(/\s*,\s*/);return V(o,De)},o=e=>{if(s(e)&&/^[\d.]+/.test(e)){const t=parseFloat(e);return Oe(e,"ms")?t:1e3*t}return 0},n=t("transition-delay"),r=t("transition-duration");return U(r,((e,t,r)=>{const s=o(n[r])+o(t);return Math.max(e,s)}),0)})(e);requestAnimationFrame((()=>{r=setTimeout(i,c+17),St(e,dd,r)}))},hd=(e,t,o,n,r,s)=>{const a=((e,t,o)=>o.exists((o=>{const n=e.mode;return"all"===n||o[n]!==t[n]})))(n,r,s);if(a||md(e,n)){Mt(e,"position",o.position);const s=Kc(t,e),i=Gc(t,{...r,rect:s}),l=X(cd,(e=>i[e]));ud(o,l)&&(Rt(e,l),a&&((e,t)=>{Fa(e,t.classes),Et(e,dd).each((t=>{clearTimeout(parseInt(t,10)),Ot(e,dd)})),gd(e,t)})(e,n),zt(e))}else za(e,n.classes)},pd=(e,t,o,n)=>{Ft(t,"max-height"),Ft(t,"max-width");const r={width:Jt(s=t),height:jt(s)};var s;return((e,t,o,n,r,s)=>{const a=n.width,i=n.height,l=(t,l,c,d,m)=>{const u=t(o,n,r,e,s),g=rd(u,a,i,s);return g.fold(w(g),((e,t,o,n)=>(m===n?o>d||t>c:!m&&n)?g:nd.nofit(l,c,d,m)))},c=U(t,((e,t)=>{const o=S(l,t);return e.fold(w(e),o)}),nd.nofit({rect:o,maxHeight:n.height,maxWidth:n.width,direction:rc(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:o.y},-1,-1,!1));return c.fold(x,x)})(t,n.preference,e,r,o,n.bounds)},fd=(e,t)=>{((e,t)=>{St(e,td,t)})(e,t.placement)},vd=(e,t)=>{((e,t)=>{const o=Zt.max(e,t,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Mt(e,"max-height",o+"px")})(e,Math.floor(t))},bd=w(((e,t)=>{vd(e,t),Nt(e,{"overflow-x":"hidden","overflow-y":"auto"})})),yd=w(((e,t)=>{vd(e,t)})),wd=(e,t,o)=>void 0===e[t]?o:e[t],xd=(e,t,o,n)=>{const r=pd(e,t,o,n);return((e,t,o)=>{const n=Gc(o.origin,t);o.transition.each((r=>{hd(e,o.origin,n,r,t,o.lastPlacement)})),Ua(e,n)})(t,r,n),fd(t,r),((e,t)=>{const o=t.classes;za(e,o.off),Fa(e,o.on)})(t,r),((e,t,o)=>{(0,o.maxHeightFunction)(e,t.maxHeight)})(t,r,n),((e,t,o)=>{(0,o.maxWidthFunction)(e,t.maxWidth)})(t,r,n),{layout:r.layout,placement:r.placement}},Cd=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],Sd=(e,t,o,n=1)=>{const r=e*n,s=t*n,a=e=>fe(o,e).getOr([]),i=(e,t,o)=>{const n=Y(Cd,o);return{offset:$t(e,t),classesOn:q(o,a),classesOff:q(n,a)}};return{southeast:()=>i(-e,t,["top","alignLeft"]),southwest:()=>i(e,t,["top","alignRight"]),south:()=>i(-e/2,t,["top","alignCentre"]),northeast:()=>i(-e,-t,["bottom","alignLeft"]),northwest:()=>i(e,-t,["bottom","alignRight"]),north:()=>i(-e/2,-t,["bottom","alignCentre"]),east:()=>i(e,-t/2,["valignCentre","left"]),west:()=>i(-e,-t/2,["valignCentre","right"]),insetNortheast:()=>i(r,s,["top","alignLeft","inset"]),insetNorthwest:()=>i(-r,s,["top","alignRight","inset"]),insetNorth:()=>i(-r/2,s,["top","alignCentre","inset"]),insetSoutheast:()=>i(r,-s,["bottom","alignLeft","inset"]),insetSouthwest:()=>i(-r,-s,["bottom","alignRight","inset"]),insetSouth:()=>i(-r/2,-s,["bottom","alignCentre","inset"]),insetEast:()=>i(-r,-s/2,["valignCentre","right","inset"]),insetWest:()=>i(r,-s/2,["valignCentre","left","inset"])}},kd=()=>Sd(0,0,{}),_d=x,Ed=(e,t)=>o=>"rtl"===Td(o)?t:e,Td=e=>"rtl"===Bt(e,"direction")?"rtl":"ltr";var Od;!function(e){e.TopToBottom="toptobottom",e.BottomToTop="bottomtotop"}(Od||(Od={}));const Ad="data-alloy-vertical-dir",Dd=e=>$l(e,(e=>Ue(e)&&_t(e,"data-alloy-vertical-dir")===Od.BottomToTop)),Md=()=>Dr("layouts",[hr("onLtr"),hr("onRtl"),Sr("onBottomLtr"),Sr("onBottomRtl")]),Nd=(e,t,o,n,r,s,a)=>{const i=a.map(Dd).getOr(!1),l=t.layouts.map((t=>t.onLtr(e))),c=t.layouts.map((t=>t.onRtl(e))),d=i?t.layouts.bind((t=>t.onBottomLtr.map((t=>t(e))))).or(l).getOr(r):l.getOr(o),m=i?t.layouts.bind((t=>t.onBottomRtl.map((t=>t(e))))).or(c).getOr(s):c.getOr(n);return Ed(d,m)(e)};var Rd=[hr("hotspot"),Sr("bubble"),Mr("overrides",{}),Md(),Ui("placement",((e,t,o)=>{const n=t.hotspot,r=Kc(o,n.element),s=Nd(e.element,t,Bc(),Lc(),Nc(),Rc(),A.some(t.hotspot.element));return A.some(_d({anchorBox:r,bubble:t.bubble.getOr(kd()),overrides:t.overrides,layouts:s}))}))];var Bd=[hr("x"),hr("y"),Mr("height",0),Mr("width",0),Mr("bubble",kd()),Mr("overrides",{}),Md(),Ui("placement",((e,t,o)=>{const n=Xc(o,t.x,t.y),r=Go(n.left,n.top,t.width,t.height),s=Nd(e.element,t,Dc(),Mc(),Dc(),Mc(),A.none());return A.some(_d({anchorBox:r,bubble:t.bubble,overrides:t.overrides,layouts:s}))}))];const Ld=zr([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Hd=e=>e.fold(x,((e,t,o)=>e.translate(-t,-o))),Id=e=>e.fold(x,x),Pd=e=>U(e,((e,t)=>e.translate(t.left,t.top)),$t(0,0)),Fd=e=>{const t=P(e,Id);return Pd(t)},zd=Ld.screen,Vd=Ld.absolute,Zd=(e,t,o)=>{const n=Qe(e.element),r=zo(n),s=((e,t,o)=>{const n=ot(o.root).dom;return A.from(n.frameElement).map(Be.fromDom).filter((t=>{const o=Qe(t),n=Qe(e.element);return Xe(o,n)})).map(Gt)})(e,0,o).getOr(r);return Vd(s,r.left,r.top)},Ud=(e,t,o,n)=>{const r=zd($t(e,t));return A.some(((e,t,o)=>({point:e,width:t,height:o}))(r,o,n))},jd=(e,t,o,n,r)=>e.map((e=>{const s=[t,e.point],a=(i=()=>Fd(s),l=()=>Fd(s),c=()=>(e=>{const t=P(e,Hd);return Pd(t)})(s),n.fold(i,l,c));var i,l,c;const d=((e,t,o,n)=>({x:e,y:t,width:o,height:n}))(a.left,a.top,e.width,e.height),m=o.showAbove?Nc():Bc(),u=o.showAbove?Rc():Lc(),g=Nd(r,o,m,u,m,u,A.none());return _d({anchorBox:d,bubble:o.bubble.getOr(kd()),overrides:o.overrides,layouts:g})}));var Wd=[hr("node"),hr("root"),Sr("bubble"),Md(),Mr("overrides",{}),Mr("showAbove",!1),Ui("placement",((e,t,o)=>{const n=Zd(e,0,t);return t.node.filter(yt).bind((r=>{const s=r.dom.getBoundingClientRect(),a=Ud(s.left,s.top,s.width,s.height),i=t.node.getOr(e.element);return jd(a,n,t,o,i)}))}))];const $d=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n}),qd=zr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Gd=(qd.before,qd.on,qd.after,e=>e.fold(x,x,x)),Kd=zr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Yd={domRange:Kd.domRange,relative:Kd.relative,exact:Kd.exact,exactFromRange:e=>Kd.exact(e.start,e.soffset,e.finish,e.foffset),getWin:e=>{const t=(e=>e.match({domRange:e=>Be.fromDom(e.startContainer),relative:(e,t)=>Gd(e),exact:(e,t,o,n)=>e}))(e);return ot(t)},range:$d},Xd=(e,t,o)=>{const n=e.document.createRange();var r;return r=n,t.fold((e=>{r.setStartBefore(e.dom)}),((e,t)=>{r.setStart(e.dom,t)}),(e=>{r.setStartAfter(e.dom)})),((e,t)=>{t.fold((t=>{e.setEndBefore(t.dom)}),((t,o)=>{e.setEnd(t.dom,o)}),(t=>{e.setEndAfter(t.dom)}))})(n,o),n},Jd=(e,t,o,n,r)=>{const s=e.document.createRange();return s.setStart(t.dom,o),s.setEnd(n.dom,r),s},Qd=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}),em=zr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),tm=(e,t,o)=>t(Be.fromDom(o.startContainer),o.startOffset,Be.fromDom(o.endContainer),o.endOffset),om=(e,t)=>{const o=((e,t)=>t.match({domRange:e=>({ltr:w(e),rtl:A.none}),relative:(t,o)=>({ltr:Qt((()=>Xd(e,t,o))),rtl:Qt((()=>A.some(Xd(e,o,t))))}),exact:(t,o,n,r)=>({ltr:Qt((()=>Jd(e,t,o,n,r))),rtl:Qt((()=>A.some(Jd(e,n,r,t,o))))})}))(e,t);return((e,t)=>{const o=t.ltr();if(o.collapsed)return t.rtl().filter((e=>!1===e.collapsed)).map((e=>em.rtl(Be.fromDom(e.endContainer),e.endOffset,Be.fromDom(e.startContainer),e.startOffset))).getOrThunk((()=>tm(0,em.ltr,o)));return tm(0,em.ltr,o)})(0,o)},nm=(e,t)=>om(e,t).match({ltr:(t,o,n,r)=>{const s=e.document.createRange();return s.setStart(t.dom,o),s.setEnd(n.dom,r),s},rtl:(t,o,n,r)=>{const s=e.document.createRange();return s.setStart(n.dom,r),s.setEnd(t.dom,o),s}});em.ltr,em.rtl;const rm=(e,t,o)=>V(((e,t)=>{const o=h(t)?t:T;let n=e.dom;const r=[];for(;null!==n.parentNode&&void 0!==n.parentNode;){const e=n.parentNode,t=Be.fromDom(e);if(r.push(t),!0===o(t))break;n=e}return r})(e,o),t),sm=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return Ke(o)?[]:P(o.querySelectorAll(e),Be.fromDom)})(t,e),am=(e,t,o,n)=>{const r=((e,t,o,n)=>{const r=Qe(e).dom.createRange();return r.setStart(e.dom,t),r.setEnd(o.dom,n),r})(e,t,o,n),s=Xe(e,o)&&t===n;return r.collapsed&&!s},im=e=>{if(e.rangeCount>0){const t=e.getRangeAt(0),o=e.getRangeAt(e.rangeCount-1);return A.some($d(Be.fromDom(t.startContainer),t.startOffset,Be.fromDom(o.endContainer),o.endOffset))}return A.none()},lm=e=>{if(null===e.anchorNode||null===e.focusNode)return im(e);{const t=Be.fromDom(e.anchorNode),o=Be.fromDom(e.focusNode);return am(t,e.anchorOffset,o,e.focusOffset)?A.some($d(t,e.anchorOffset,o,e.focusOffset)):im(e)}},cm=e=>(e=>A.from(e.getSelection()))(e).filter((e=>e.rangeCount>0)).bind(lm),dm=(e,t)=>(e=>{const t=e.getClientRects(),o=t.length>0?t[0]:e.getBoundingClientRect();return o.width>0||o.height>0?A.some(o).map(Qd):A.none()})(nm(e,t)),mm=(e,t)=>(e=>{const t=e.getBoundingClientRect();return t.width>0||t.height>0?A.some(t).map(Qd):A.none()})(nm(e,t)),um=((e,t)=>{const o=t=>e(t)?A.from(t.dom.nodeValue):A.none();return{get:n=>{if(!e(n))throw new Error("Can only get "+t+" value of a "+t+" node");return o(n).getOr("")},getOption:o,set:(o,n)=>{if(!e(o))throw new Error("Can only set raw "+t+" value of a "+t+" node");o.dom.nodeValue=n}}})(je,"text"),gm=(e,t)=>({element:e,offset:t}),hm=(e,t)=>{const o=at(e);if(0===o.length)return gm(e,t);if(tum.get(e))(e).length:at(e).length;return gm(e,t)}},pm=(e,t)=>je(e)?gm(e,t):hm(e,t),fm=e=>void 0!==e.foffset,vm=(e,t)=>t.getSelection.getOrThunk((()=>()=>cm(e)))().map((e=>{if(fm(e)){const t=pm(e.start,e.soffset),o=pm(e.finish,e.foffset);return Yd.range(t.element,t.offset,o.element,o.offset)}return e}));var bm=[Sr("getSelection"),hr("root"),Sr("bubble"),Md(),Mr("overrides",{}),Mr("showAbove",!1),Ui("placement",((e,t,o)=>{const n=ot(t.root).dom,r=Zd(e,0,t),s=vm(n,t).bind((e=>{if(fm(e)){const t=mm(n,Yd.exactFromRange(e)).orThunk((()=>{const t=Be.fromText("\ufeff");Ro(e.start,t);const o=dm(n,Yd.exact(t,0,t,1));return Fo(t),o}));return t.bind((e=>Ud(e.left,e.top,e.width,e.height)))}{const t=le(e,(e=>e.dom.getBoundingClientRect())),o={left:Math.min(t.firstCell.left,t.lastCell.left),right:Math.max(t.firstCell.right,t.lastCell.right),top:Math.min(t.firstCell.top,t.lastCell.top),bottom:Math.max(t.firstCell.bottom,t.lastCell.bottom)};return Ud(o.left,o.top,o.right-o.left,o.bottom-o.top)}})),a=vm(n,t).bind((e=>fm(e)?Ue(e.start)?A.some(e.start):rt(e.start):A.some(e.firstCell))).getOr(e.element);return jd(s,r,t,o,a)}))];const ym="link-layout",wm=e=>e.x+e.width,xm=(e,t)=>e.x-t.width,Cm=(e,t)=>e.y-t.height+e.height,Sm=e=>e.y,km=(e,t,o)=>oc(wm(e),Sm(e),o.southeast(),rc(),"southeast",hc(e,{left:0,top:2}),ym),_m=(e,t,o)=>oc(xm(e,t),Sm(e),o.southwest(),sc(),"southwest",hc(e,{right:1,top:2}),ym),Em=(e,t,o)=>oc(wm(e),Cm(e,t),o.northeast(),ac(),"northeast",hc(e,{left:0,bottom:3}),ym),Tm=(e,t,o)=>oc(xm(e,t),Cm(e,t),o.northwest(),ic(),"northwest",hc(e,{right:1,bottom:3}),ym),Om=()=>[km,_m,Em,Tm],Am=()=>[_m,km,Tm,Em];var Dm=[hr("item"),Md(),Mr("overrides",{}),Ui("placement",((e,t,o)=>{const n=Kc(o,t.item.element),r=Nd(e.element,t,Om(),Am(),Om(),Am(),A.none());return A.some(_d({anchorBox:n,bubble:kd(),overrides:t.overrides,layouts:r}))}))],Mm=cr("type",{selection:bm,node:Wd,hotspot:Rd,submenu:Dm,makeshift:Bd});const Nm=[Cr("classes",Yn),Lr("mode","all",["all","layout","placement"])],Rm=[Mr("useFixed",T),Sr("getBounds")],Bm=[pr("anchor",Mm),Dr("transition",Nm)],Lm=(e,t,o,n,r,s)=>((e,t,o,n,r,s,a,i)=>{const l=wd(a,"maxHeightFunction",bd()),c=wd(a,"maxWidthFunction",v),d=e.anchorBox,m=e.origin,u={bounds:Yc(m,s),origin:m,preference:n,maxHeightFunction:l,maxWidthFunction:c,lastPlacement:r,transition:i};return xd(d,t,o,u)})(ed(t.anchorBox,e),n.element,t.bubble,t.layouts,r,o,t.overrides,s),Hm=(e,t,o,n,r,s)=>{const a=ir("placement.info",Zn(Bm),r),i=a.anchor,l=n.element,c=o.get(n.uid);Wc((()=>{Mt(l,"position","fixed");const r=Ht(l,"visibility");Mt(l,"visibility","hidden");const d=t.useFixed()?(()=>{const e=document.documentElement;return Qc(0,0,e.clientWidth,e.clientHeight)})():(e=>{const t=Gt(e.element),o=e.element.dom.getBoundingClientRect();return Jc(t.left,t.top,o.width,o.height)})(e);i.placement(e,i,d).each((e=>{const r=s.orThunk((()=>t.getBounds.map(E))),i=Lm(d,e,r,n,c,a.transition);o.set(n.uid,i)})),r.fold((()=>{Ft(l,"visibility")}),(e=>{Mt(l,"visibility",e)})),Ht(l,"left").isNone()&&Ht(l,"top").isNone()&&Ht(l,"right").isNone()&&Ht(l,"bottom").isNone()&&ye(Ht(l,"position"),"fixed")&&Ft(l,"position")}),l)};var Im=Object.freeze({__proto__:null,position:(e,t,o,n,r)=>{const s=A.none();Hm(e,t,o,n,r,s)},positionWithinBounds:Hm,getMode:(e,t,o)=>t.useFixed()?"fixed":"absolute",reset:(e,t,o,n)=>{const r=n.element;F(["position","left","right","top","bottom"],(e=>Ft(r,e))),(e=>{Ot(e,td)})(r),o.clear(n.uid)}});const Pm=_a({fields:Rm,name:"positioning",active:Fc,apis:Im,state:Object.freeze({__proto__:null,init:()=>{let e={};return Ca({readState:()=>e,clear:t=>{g(t)?delete e[t]:e={}},set:(t,o)=>{e[t]=o},get:t=>fe(e,t)})}})}),Fm=e=>e.getSystem().isConnected(),zm=e=>{qs(e,Is());const t=e.components();F(t,zm)},Vm=e=>{const t=e.components();F(t,Vm),qs(e,Hs())},Zm=(e,t)=>{e.getSystem().addToWorld(t),yt(e.element)&&Vm(t)},Um=e=>{zm(e),e.getSystem().removeFromWorld(e)},jm=(e,t)=>{Ho(e.element,t.element)},Wm=(e,t,o)=>{const n=e.components();(e=>{F(e.components(),(e=>Fo(e.element))),Po(e.element),e.syncComponents()})(e);const r=o(t),s=Y(n,r);F(s,(t=>{zm(t),e.getSystem().removeFromWorld(t)})),F(r,(t=>{Fm(t)?jm(e,t):(e.getSystem().addToWorld(t),jm(e,t),yt(e.element)&&Vm(t))})),e.syncComponents()},$m=(e,t)=>{qm(e,t,Ho)},qm=(e,t,o)=>{e.getSystem().addToWorld(t),o(e.element,t.element),yt(e.element)&&Vm(t),e.syncComponents()},Gm=e=>{zm(e),Fo(e.element),e.getSystem().removeFromWorld(e)},Km=e=>{const t=nt(e.element).bind((t=>e.getSystem().getByDom(t).toOptional()));Gm(e),t.each((e=>{e.syncComponents()}))},Ym=e=>{const t=e.components();F(t,Gm),Po(e.element),e.syncComponents()},Xm=(e,t)=>{Qm(e,t,Ho)},Jm=(e,t)=>{Qm(e,t,Bo)},Qm=(e,t,o)=>{o(e,t.element);const n=at(t.element);F(n,(e=>{t.getByDom(e).each(Vm)}))},eu=e=>{const t=at(e.element);F(t,(t=>{e.getByDom(t).each(zm)})),Fo(e.element)},tu=(e,t,o,n)=>{o.get().each((t=>{Ym(e)}));const r=t.getAttachPoint(e);$m(r,e);const s=e.getSystem().build(n);return $m(e,s),o.set(s),s},ou=(e,t,o,n)=>{const r=tu(e,t,o,n);return t.onOpen(e,r),r},nu=(e,t,o)=>{o.get().each((n=>{Ym(e),Km(e),t.onClose(e,n),o.clear()}))},ru=(e,t,o)=>o.isOpen(),su=(e,t,o)=>{const n=t.getAttachPoint(e);Mt(e.element,"position",Pm.getMode(n)),((e,t,o,n)=>{Ht(e.element,t).fold((()=>{Ot(e.element,o)}),(t=>{St(e.element,o,t)})),Mt(e.element,t,n)})(e,"visibility",t.cloakVisibilityAttr,"hidden")},au=(e,t,o)=>{(e=>L(["top","left","right","bottom"],(t=>Ht(e,t).isSome())))(e.element)||Ft(e.element,"position"),((e,t,o)=>{Et(e.element,o).fold((()=>Ft(e.element,t)),(o=>Mt(e.element,t,o)))})(e,"visibility",t.cloakVisibilityAttr)};var iu=Object.freeze({__proto__:null,cloak:su,decloak:au,open:ou,openWhileCloaked:(e,t,o,n,r)=>{su(e,t),ou(e,t,o,n),r(),au(e,t)},close:nu,isOpen:ru,isPartOf:(e,t,o,n)=>ru(0,0,o)&&o.get().exists((o=>t.isPartOf(e,o,n))),getState:(e,t,o)=>o.get(),setContent:(e,t,o,n)=>o.get().map((()=>tu(e,t,o,n)))});var lu=Object.freeze({__proto__:null,events:(e,t)=>Qs([oa(As(),((o,n)=>{nu(o,e,t)}))])}),cu=[Fi("onOpen"),Fi("onClose"),hr("isPartOf"),hr("getAttachPoint"),Mr("cloakVisibilityAttr","data-precloak-visibility")];var du=Object.freeze({__proto__:null,init:()=>{const e=on(),t=w("not-implemented");return Ca({readState:t,isOpen:e.isSet,clear:e.clear,set:e.set,get:e.get})}});const mu=_a({fields:cu,name:"sandboxing",active:lu,apis:iu,state:du}),uu=w("dismiss.popups"),gu=w("reposition.popups"),hu=w("mouse.released"),pu=Vn([Mr("isExtraPart",T),Dr("fireEventInstead",[Mr("event",Ps())])]),fu=e=>{const t=ir("Dismissal",pu,e);return{[uu()]:{schema:Vn([hr("target")]),onReceive:(e,o)=>{if(mu.isOpen(e)){mu.isPartOf(e,o.target)||t.isExtraPart(e,o.target)||t.fireEventInstead.fold((()=>mu.close(e)),(t=>qs(e,t.event)))}}}}},vu=Vn([Dr("fireEventInstead",[Mr("event",Fs())]),yr("doReposition")]),bu=e=>{const t=ir("Reposition",vu,e);return{[gu()]:{onReceive:e=>{mu.isOpen(e)&&t.fireEventInstead.fold((()=>t.doReposition(e)),(t=>qs(e,t.event)))}}}},yu=(e,t,o)=>{t.store.manager.onLoad(e,t,o)},wu=(e,t,o)=>{t.store.manager.onUnload(e,t,o)};var xu=Object.freeze({__proto__:null,onLoad:yu,onUnload:wu,setValue:(e,t,o,n)=>{t.store.manager.setValue(e,t,o,n)},getValue:(e,t,o)=>t.store.manager.getValue(e,t,o),getState:(e,t,o)=>o});var Cu=Object.freeze({__proto__:null,events:(e,t)=>{const o=e.resetOnDom?[da(((o,n)=>{yu(o,e,t)})),ma(((o,n)=>{wu(o,e,t)}))]:[va(e,t,yu)];return Qs(o)}});const Su=()=>{const e=Qo(null);return Ca({set:e.set,get:e.get,isNotSet:()=>null===e.get(),clear:()=>{e.set(null)},readState:()=>({mode:"memory",value:e.get()})})},ku=()=>{const e=Qo({}),t=Qo({});return Ca({readState:()=>({mode:"dataset",dataByValue:e.get(),dataByText:t.get()}),lookup:o=>fe(e.get(),o).orThunk((()=>fe(t.get(),o))),update:o=>{const n=e.get(),r=t.get(),s={},a={};F(o,(e=>{s[e.value]=e,fe(e,"meta").each((t=>{fe(t,"text").each((t=>{a[t]=e}))}))})),e.set({...n,...s}),t.set({...r,...a})},clear:()=>{e.set({}),t.set({})}})};var _u=Object.freeze({__proto__:null,memory:Su,dataset:ku,manual:()=>Ca({readState:v}),init:e=>e.store.manager.state(e)});const Eu=(e,t,o,n)=>{const r=t.store;o.update([n]),r.setValue(e,n),t.onSetValue(e,n)};var Tu=[Sr("initialValue"),hr("getFallbackEntry"),hr("getDataKey"),hr("setValue"),Ui("manager",{setValue:Eu,getValue:(e,t,o)=>{const n=t.store,r=n.getDataKey(e);return o.lookup(r).getOrThunk((()=>n.getFallbackEntry(r)))},onLoad:(e,t,o)=>{t.store.initialValue.each((n=>{Eu(e,t,o,n)}))},onUnload:(e,t,o)=>{o.clear()},state:ku})];var Ou=[hr("getValue"),Mr("setValue",v),Sr("initialValue"),Ui("manager",{setValue:(e,t,o,n)=>{t.store.setValue(e,n),t.onSetValue(e,n)},getValue:(e,t,o)=>t.store.getValue(e),onLoad:(e,t,o)=>{t.store.initialValue.each((o=>{t.store.setValue(e,o)}))},onUnload:v,state:xa.init})];var Au=[Sr("initialValue"),Ui("manager",{setValue:(e,t,o,n)=>{o.set(n),t.onSetValue(e,n)},getValue:(e,t,o)=>o.get(),onLoad:(e,t,o)=>{t.store.initialValue.each((e=>{o.isNotSet()&&o.set(e)}))},onUnload:(e,t,o)=>{o.clear()},state:Su})],Du=[Nr("store",{mode:"memory"},cr("mode",{memory:Au,manual:Ou,dataset:Tu})),Fi("onSetValue"),Mr("resetOnDom",!1)];const Mu=_a({fields:Du,name:"representing",active:Cu,apis:xu,extra:{setValueFrom:(e,t)=>{const o=Mu.getValue(t);Mu.setValue(e,o)}},state:_u}),Nu=(e,t)=>Fr(e,{},P(t,(t=>{return o=t.name(),n="Cannot configure "+t.name()+" for "+e,mr(o,o,{tag:"option",process:{}},Bn((e=>fn("The field: "+o+" is forbidden. "+n))));var o,n})).concat([ur("dump",x)])),Ru=e=>e.dump,Bu=(e,t)=>({...Sa(t),...e.dump}),Lu=Nu,Hu=Bu,Iu="placeholder",Pu=zr([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Fu=e=>ve(e,"uiType"),zu=(e,t,o,n)=>Fu(o)&&o.uiType===Iu?((e,t,o,n)=>e.exists((e=>e!==o.owner))?Pu.single(!0,w(o)):fe(n,o.name).fold((()=>{throw new Error("Unknown placeholder component: "+o.name+"\nKnown: ["+se(n)+"]\nNamespace: "+e.getOr("none")+"\nSpec: "+JSON.stringify(o,null,2))}),(e=>e.replace())))(e,0,o,n):Pu.single(!1,w(o)),Vu=(e,t,o,n)=>zu(e,0,o,n).fold(((r,s)=>{const a=Fu(o)?s(t,o.config,o.validated):s(t),i=fe(a,"components").getOr([]),l=q(i,(o=>Vu(e,t,o,n)));return[{...a,components:l}]}),((e,n)=>{if(Fu(o)){const e=n(t,o.config,o.validated);return o.validated.preprocess.getOr(x)(e)}return n(t)})),Zu=(e,t,o,n)=>{const r=le(n,((e,t)=>((e,t)=>{let o=!1;return{name:w(e),required:()=>t.fold(((e,t)=>e),((e,t)=>e)),used:()=>o,replace:()=>{if(o)throw new Error("Trying to use the same placeholder more than once: "+e);return o=!0,t}}})(t,e))),s=((e,t,o,n)=>q(o,(o=>Vu(e,t,o,n))))(e,t,o,r);return ie(r,(o=>{if(!1===o.used()&&o.required())throw new Error("Placeholder: "+o.name()+" was not found in components list\nNamespace: "+e.getOr("none")+"\nComponents: "+JSON.stringify(t.components,null,2))})),s},Uu=Pu.single,ju=Pu.multiple,Wu=w(Iu),$u=zr([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),qu=Mr("factory",{sketch:x}),Gu=Mr("schema",[]),Ku=hr("name"),Yu=mr("pname","pname",Tn((e=>"")),qn()),Xu=ur("schema",(()=>[Sr("preprocess")])),Ju=Mr("defaults",w({})),Qu=Mr("overrides",w({})),eg=Zn([qu,Gu,Ku,Yu,Ju,Qu]),tg=Zn([qu,Gu,Ku,Ju,Qu]),og=Zn([qu,Gu,Ku,Yu,Ju,Qu]),ng=Zn([qu,Xu,Ku,hr("unit"),Yu,Ju,Qu]),rg=e=>e.fold(A.some,A.none,A.some,A.some),sg=e=>{const t=e=>e.name;return e.fold(t,t,t,t)},ag=(e,t)=>o=>{const n=ir("Converting part type",t,o);return e(n)},ig=ag($u.required,eg),lg=ag($u.external,tg),cg=ag($u.optional,og),dg=ag($u.group,ng),mg=w("entirety");var ug=Object.freeze({__proto__:null,required:ig,external:lg,optional:cg,group:dg,asNamedPart:rg,name:sg,asCommon:e=>e.fold(x,x,x,x),original:mg});const gg=(e,t,o,n)=>_n(t.defaults(e,o,n),o,{uid:e.partUids[t.name]},t.overrides(e,o,n)),hg=(e,t)=>{const o={};return F(t,(t=>{rg(t).each((t=>{const n=pg(e,t.pname);o[t.name]=o=>{const r=ir("Part: "+t.name+" in "+e,Zn(t.schema),o);return{...n,config:o,validated:r}}}))})),o},pg=(e,t)=>({uiType:Wu(),owner:e,name:t}),fg=(e,t,o)=>({uiType:Wu(),owner:e,name:t,config:o,validated:{}}),vg=e=>q(e,(e=>e.fold(A.none,A.some,A.none,A.none).map((e=>wr(e.name,e.schema.concat([ji(mg())])))).toArray())),bg=e=>P(e,sg),yg=(e,t,o)=>((e,t,o)=>{const n={},r={};return F(o,(e=>{e.fold((e=>{n[e.pname]=Uu(!0,((t,o,n)=>e.factory.sketch(gg(t,e,o,n))))}),(e=>{const o=t.parts[e.name];r[e.name]=w(e.factory.sketch(gg(t,e,o[mg()]),o))}),(e=>{n[e.pname]=Uu(!1,((t,o,n)=>e.factory.sketch(gg(t,e,o,n))))}),(e=>{n[e.pname]=ju(!0,((t,o,n)=>{const r=t[e.name];return P(r,(o=>e.factory.sketch(_n(e.defaults(t,o,n),o,e.overrides(t,o)))))}))}))})),{internals:w(n),externals:w(r)}})(0,t,o),wg=(e,t,o)=>Zu(A.some(e),t,t.components,o),xg=(e,t,o)=>{const n=t.partUids[o];return e.getSystem().getByUid(n).toOptional()},Cg=(e,t,o)=>xg(e,t,o).getOrDie("Could not find part: "+o),Sg=(e,t,o)=>{const n={},r=t.partUids,s=e.getSystem();return F(o,(e=>{n[e]=w(s.getByUid(r[e]))})),n},kg=(e,t)=>{const o=e.getSystem();return le(t.partUids,((e,t)=>w(o.getByUid(e))))},_g=e=>se(e.partUids),Eg=(e,t,o)=>{const n={},r=t.partUids,s=e.getSystem();return F(o,(e=>{n[e]=w(s.getByUid(r[e]).getOrDie())})),n},Tg=(e,t)=>{const o=bg(t);return Ur(P(o,(t=>({key:t,value:e+"-"+t}))))},Og=e=>mr("partUids","partUids",An((t=>Tg(t.uid,e))),qn());var Ag=Object.freeze({__proto__:null,generate:hg,generateOne:fg,schemas:vg,names:bg,substitutes:yg,components:wg,defaultUids:Tg,defaultUidsSchema:Og,getAllParts:kg,getAllPartNames:_g,getPart:xg,getPartOrDie:Cg,getParts:Sg,getPartsOrDie:Eg});const Dg=(e,t,o,n,r)=>{const s=((e,t)=>(e.length>0?[wr("parts",e)]:[]).concat([hr("uid"),Mr("dom",{}),Mr("components",[]),ji("originalSpec"),Mr("debug.sketcher",{})]).concat(t))(n,r);return ir(e+" [SpecSchema]",Vn(s.concat(t)),o)},Mg=(e,t,o,n,r)=>{const s=Ng(r),a=vg(o),i=Og(o),l=Dg(e,t,s,a,[i]),c=yg(0,l,o);return n(l,wg(e,l,c.internals()),s,c.externals())},Ng=e=>(e=>ve(e,"uid"))(e)?e:{...e,uid:rl("uid")},Rg=Vn([hr("name"),hr("factory"),hr("configFields"),Mr("apis",{}),Mr("extraApis",{})]),Bg=Vn([hr("name"),hr("factory"),hr("configFields"),hr("partFields"),Mr("apis",{}),Mr("extraApis",{})]),Lg=e=>{const t=ir("Sketcher for "+e.name,Rg,e),o=le(t.apis,ml),n=le(t.extraApis,((e,t)=>pa(e,t)));return{name:t.name,configFields:t.configFields,sketch:e=>((e,t,o,n)=>{const r=Ng(n);return o(Dg(e,t,r,[],[]),r)})(t.name,t.configFields,t.factory,e),...o,...n}},Hg=e=>{const t=ir("Sketcher for "+e.name,Bg,e),o=hg(t.name,t.partFields),n=le(t.apis,ml),r=le(t.extraApis,((e,t)=>pa(e,t)));return{name:t.name,partFields:t.partFields,configFields:t.configFields,sketch:e=>Mg(t.name,t.configFields,t.partFields,t.factory,e),parts:o,...n,...r}},Ig=e=>qe("input")(e)&&"radio"!==_t(e,"type")||qe("textarea")(e);var Pg=Object.freeze({__proto__:null,getCurrent:(e,t,o)=>t.find(e)});const Fg=[hr("find")],zg=_a({fields:Fg,name:"composing",apis:Pg}),Vg=["input","button","textarea","select"],Zg=(e,t,o)=>{(t.disabled()?Gg:Kg)(e,t)},Ug=(e,t)=>!0===t.useNative&&B(Vg,ze(e.element)),jg=e=>{St(e.element,"disabled","disabled")},Wg=e=>{Ot(e.element,"disabled")},$g=e=>{St(e.element,"aria-disabled","true")},qg=e=>{St(e.element,"aria-disabled","false")},Gg=(e,t,o)=>{t.disableClass.each((t=>{Ba(e.element,t)}));(Ug(e,t)?jg:$g)(e),t.onDisabled(e)},Kg=(e,t,o)=>{t.disableClass.each((t=>{Ha(e.element,t)}));(Ug(e,t)?Wg:qg)(e),t.onEnabled(e)},Yg=(e,t)=>Ug(e,t)?(e=>Tt(e.element,"disabled"))(e):(e=>"true"===_t(e.element,"aria-disabled"))(e);var Xg=Object.freeze({__proto__:null,enable:Kg,disable:Gg,isDisabled:Yg,onLoad:Zg,set:(e,t,o,n)=>{(n?Gg:Kg)(e,t)}});var Jg=Object.freeze({__proto__:null,exhibit:(e,t)=>fa({classes:t.disabled()?t.disableClass.toArray():[]}),events:(e,t)=>Qs([ea(_s(),((t,o)=>Yg(t,e))),va(e,t,Zg)])}),Qg=[Ir("disabled",T),Mr("useNative",!0),Sr("disableClass"),Fi("onDisabled"),Fi("onEnabled")];const eh=_a({fields:Qg,name:"disabling",active:Jg,apis:Xg}),th=(e,t,o,n)=>{const r=sm(e.element,"."+t.highlightClass);F(r,(o=>{L(n,(e=>Xe(e.element,o)))||(Ha(o,t.highlightClass),e.getSystem().getByDom(o).each((o=>{t.onDehighlight(e,o),qs(o,$s())})))}))},oh=(e,t,o,n)=>{th(e,t,0,[n]),nh(e,t,o,n)||(Ba(n.element,t.highlightClass),t.onHighlight(e,n),qs(n,Ws()))},nh=(e,t,o,n)=>Pa(n.element,t.highlightClass),rh=(e,t,o,n)=>{const r=sm(e.element,"."+t.itemClass);return A.from(r[n]).fold((()=>an.error(new Error("No element found with index "+n))),e.getSystem().getByDom)},sh=(e,t,o)=>Yl(e.element,"."+t.itemClass).bind((t=>e.getSystem().getByDom(t).toOptional())),ah=(e,t,o)=>{const n=sm(e.element,"."+t.itemClass);return(n.length>0?A.some(n[n.length-1]):A.none()).bind((t=>e.getSystem().getByDom(t).toOptional()))},ih=(e,t,o,n)=>{const r=sm(e.element,"."+t.itemClass),s=W(r,(e=>Pa(e,t.highlightClass)));return s.bind((t=>{const o=uc(t,n,0,r.length-1);return e.getSystem().getByDom(r[o]).toOptional()}))},lh=(e,t,o)=>{const n=sm(e.element,"."+t.itemClass);return we(P(n,(t=>e.getSystem().getByDom(t).toOptional())))};var ch=Object.freeze({__proto__:null,dehighlightAll:(e,t,o)=>th(e,t,0,[]),dehighlight:(e,t,o,n)=>{nh(e,t,o,n)&&(Ha(n.element,t.highlightClass),t.onDehighlight(e,n),qs(n,$s()))},highlight:oh,highlightFirst:(e,t,o)=>{sh(e,t).each((n=>{oh(e,t,o,n)}))},highlightLast:(e,t,o)=>{ah(e,t).each((n=>{oh(e,t,o,n)}))},highlightAt:(e,t,o,n)=>{rh(e,t,o,n).fold((e=>{throw e}),(n=>{oh(e,t,o,n)}))},highlightBy:(e,t,o,n)=>{const r=lh(e,t);j(r,n).each((n=>{oh(e,t,o,n)}))},isHighlighted:nh,getHighlighted:(e,t,o)=>Yl(e.element,"."+t.highlightClass).bind((t=>e.getSystem().getByDom(t).toOptional())),getFirst:sh,getLast:ah,getPrevious:(e,t,o)=>ih(e,t,0,-1),getNext:(e,t,o)=>ih(e,t,0,1),getCandidates:lh}),dh=[hr("highlightClass"),hr("itemClass"),Fi("onHighlight"),Fi("onDehighlight")];const mh=_a({fields:dh,name:"highlighting",apis:ch}),uh=[8],gh=[9],hh=[13],ph=[27],fh=[32],vh=[37],bh=[38],yh=[39],wh=[40],xh=(e,t,o)=>{const n=K(e.slice(0,t)),r=K(e.slice(t+1));return j(n.concat(r),o)},Ch=(e,t,o)=>{const n=K(e.slice(0,t));return j(n,o)},Sh=(e,t,o)=>{const n=e.slice(0,t),r=e.slice(t+1);return j(r.concat(n),o)},kh=(e,t,o)=>{const n=e.slice(t+1);return j(n,o)},_h=e=>t=>{const o=t.raw;return B(e,o.which)},Eh=e=>t=>G(e,(e=>e(t))),Th=e=>!0===e.raw.shiftKey,Oh=e=>!0===e.raw.ctrlKey,Ah=k(Th),Dh=(e,t)=>({matches:e,classification:t}),Mh=(e,t,o)=>{t.exists((e=>o.exists((t=>Xe(t,e)))))||Gs(e,zs(),{prevFocus:t,newFocus:o})},Nh=()=>{const e=e=>jc(e.element);return{get:e,set:(t,o)=>{const n=e(t);t.getSystem().triggerFocus(o,t.element);const r=e(t);Mh(t,n,r)}}},Rh=()=>{const e=e=>mh.getHighlighted(e).map((e=>e.element));return{get:e,set:(t,o)=>{const n=e(t);t.getSystem().getByDom(o).fold(v,(e=>{mh.highlight(t,e)}));const r=e(t);Mh(t,n,r)}}};var Bh;!function(e){e.OnFocusMode="onFocus",e.OnEnterOrSpaceMode="onEnterOrSpace",e.OnApiMode="onApi"}(Bh||(Bh={}));const Lh=(e,t,o,n,r)=>{const s=(e,t,o,n,r)=>((e,t)=>{const o=j(e,(e=>e.matches(t)));return o.map((e=>e.classification))})(o(e,t,n,r),t.event).bind((o=>o(e,t,n,r))),a={schema:()=>e.concat([Mr("focusManager",Nh()),Nr("focusInside","onFocus",nr((e=>B(["onFocus","onEnterOrSpace","onApi"],e)?an.value(e):an.error("Invalid value for focusInside")))),Ui("handler",a),Ui("state",t),Ui("sendFocusIn",r)]),processKey:s,toEvents:(e,t)=>{const a=e.focusInside!==Bh.OnFocusMode?A.none():r(e).map((o=>oa(xs(),((n,r)=>{o(n,e,t),r.stop()})))),i=[oa(ds(),((n,a)=>{s(n,a,o,e,t).fold((()=>{((o,n)=>{const s=_h(fh.concat(hh))(n.event);e.focusInside===Bh.OnEnterOrSpaceMode&&s&&Gr(o,n)&&r(e).each((r=>{r(o,e,t),n.stop()}))})(n,a)}),(e=>{a.stop()}))})),oa(ms(),((o,r)=>{s(o,r,n,e,t).each((e=>{r.stop()}))}))];return Qs(a.toArray().concat(i))}};return a},Hh=e=>{const t=[Sr("onEscape"),Sr("onEnter"),Mr("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Mr("firstTabstop",0),Mr("useTabstopAt",O),Sr("visibilitySelector")].concat([e]),o=(e,t)=>{const o=e.visibilitySelector.bind((e=>Xl(t,e))).getOr(t);return Ut(o)>0},n=(e,t)=>t.focusManager.get(e).bind((e=>Xl(e,t.selector))),r=(e,t,n)=>{((e,t)=>{const n=sm(e.element,t.selector),r=V(n,(e=>o(t,e)));return A.from(r[t.firstTabstop])})(e,t).each((o=>{t.focusManager.set(e,o)}))},s=(e,t,n,r,s)=>s(t,n,(e=>((e,t)=>o(e,t)&&e.useTabstopAt(t))(r,e))).fold((()=>r.cyclic?A.some(!0):A.none()),(t=>(r.focusManager.set(e,t),A.some(!0)))),a=(e,t,o,r)=>{const a=sm(e.element,o.selector);return n(e,o).bind((t=>W(a,S(Xe,t)).bind((t=>s(e,a,t,o,r)))))},i=(e,t,o)=>{const n=o.cyclic?xh:Ch;return a(e,0,o,n)},l=(e,t,o)=>{const n=o.cyclic?Sh:kh;return a(e,0,o,n)},c=e=>(e=>nt(e))(e).bind(lt).exists((t=>Xe(t,e))),d=w([Dh(Eh([Th,_h(gh)]),i),Dh(_h(gh),l),Dh(Eh([Ah,_h(hh)]),((e,t,o)=>o.onEnter.bind((o=>o(e,t)))))]),m=w([Dh(_h(ph),((e,t,o)=>o.onEscape.bind((o=>o(e,t))))),Dh(_h(gh),((e,t,o)=>n(e,o).filter((e=>!o.useTabstopAt(e))).bind((n=>(c(n)?i:l)(e,t,o)))))]);return Lh(t,xa.init,d,m,(()=>A.some(r)))};var Ih=Hh(ur("cyclic",T)),Ph=Hh(ur("cyclic",O));const Fh=(e,t,o)=>Ig(o)&&_h(fh)(t.event)?A.none():((e,t,o)=>(Ys(e,o,_s()),A.some(!0)))(e,0,o),zh=(e,t)=>A.some(!0),Vh=[Mr("execute",Fh),Mr("useSpace",!1),Mr("useEnter",!0),Mr("useControlEnter",!1),Mr("useDown",!1)],Zh=(e,t,o)=>o.execute(e,t,e.element);var Uh=Lh(Vh,xa.init,((e,t,o,n)=>{const r=o.useSpace&&!Ig(e.element)?fh:[],s=o.useEnter?hh:[],a=o.useDown?wh:[],i=r.concat(s).concat(a);return[Dh(_h(i),Zh)].concat(o.useControlEnter?[Dh(Eh([Oh,_h(hh)]),Zh)]:[])}),((e,t,o,n)=>o.useSpace&&!Ig(e.element)?[Dh(_h(fh),zh)]:[]),(()=>A.none()));const jh=()=>{const e=on();return Ca({readState:()=>e.get().map((e=>({numRows:String(e.numRows),numColumns:String(e.numColumns)}))).getOr({numRows:"?",numColumns:"?"}),setGridSize:(t,o)=>{e.set({numRows:t,numColumns:o})},getNumRows:()=>e.get().map((e=>e.numRows)),getNumColumns:()=>e.get().map((e=>e.numColumns))})};var Wh=Object.freeze({__proto__:null,flatgrid:jh,init:e=>e.state(e)});const $h=e=>(t,o,n,r)=>{const s=e(t.element);return Yh(s,t,o,n,r)},qh=(e,t)=>{const o=Ed(e,t);return $h(o)},Gh=(e,t)=>{const o=Ed(t,e);return $h(o)},Kh=e=>(t,o,n,r)=>Yh(e,t,o,n,r),Yh=(e,t,o,n,r)=>n.focusManager.get(t).bind((o=>e(t.element,o,n,r))).map((e=>(n.focusManager.set(t,e),!0))),Xh=Kh,Jh=Kh,Qh=Kh,ep=e=>!(e=>e.offsetWidth<=0&&e.offsetHeight<=0)(e.dom),tp=(e,t,o)=>{const n=sm(e,o);return((e,t)=>W(e,t).map((t=>({index:t,candidates:e}))))(V(n,ep),(e=>Xe(e,t)))},op=(e,t)=>W(e,(e=>Xe(t,e))),np=(e,t,o,n)=>n(Math.floor(t/o),t%o).bind((t=>{const n=t.row*o+t.column;return n>=0&&nnp(e,t,n,((t,s)=>{const a=t===o-1?e.length-t*n:n,i=uc(s,r,0,a-1);return A.some({row:t,column:i})})),sp=(e,t,o,n,r)=>np(e,t,n,((t,s)=>{const a=uc(t,r,0,o-1),i=a===o-1?e.length-a*n:n,l=gc(s,0,i-1);return A.some({row:a,column:l})})),ap=[hr("selector"),Mr("execute",Fh),zi("onEscape"),Mr("captureTab",!1),Wi()],ip=(e,t,o)=>{Yl(e.element,t.selector).each((o=>{t.focusManager.set(e,o)}))},lp=e=>(t,o,n,r)=>tp(t,o,n.selector).bind((t=>e(t.candidates,t.index,r.getNumRows().getOr(n.initSize.numRows),r.getNumColumns().getOr(n.initSize.numColumns)))),cp=(e,t,o)=>o.captureTab?A.some(!0):A.none(),dp=lp(((e,t,o,n)=>rp(e,t,o,n,-1))),mp=lp(((e,t,o,n)=>rp(e,t,o,n,1))),up=lp(((e,t,o,n)=>sp(e,t,o,n,-1))),gp=lp(((e,t,o,n)=>sp(e,t,o,n,1))),hp=w([Dh(_h(vh),qh(dp,mp)),Dh(_h(yh),Gh(dp,mp)),Dh(_h(bh),Xh(up)),Dh(_h(wh),Jh(gp)),Dh(Eh([Th,_h(gh)]),cp),Dh(Eh([Ah,_h(gh)]),cp),Dh(_h(fh.concat(hh)),((e,t,o,n)=>((e,t)=>t.focusManager.get(e).bind((e=>Xl(e,t.selector))))(e,o).bind((n=>o.execute(e,t,n)))))]),pp=w([Dh(_h(ph),((e,t,o)=>o.onEscape(e,t))),Dh(_h(fh),zh)]);var fp=Lh(ap,jh,hp,pp,(()=>A.some(ip)));const vp=(e,t,o,n,r)=>{const s=(e,t,o)=>r(e,t,n,0,o.length-1,o[t],(t=>{return n=o[t],"button"===ze(n)&&"disabled"===_t(n,"disabled")?s(e,t,o):A.from(o[t]);var n}));return tp(e,o,t).bind((e=>{const t=e.index,o=e.candidates;return s(t,t,o)}))},bp=(e,t,o,n)=>vp(e,t,o,n,((e,t,o,n,r,s,a)=>{const i=gc(t+o,n,r);return i===e?A.from(s):a(i)})),yp=(e,t,o,n)=>vp(e,t,o,n,((e,t,o,n,r,s,a)=>{const i=uc(t,o,n,r);return i===e?A.none():a(i)})),wp=[hr("selector"),Mr("getInitial",A.none),Mr("execute",Fh),zi("onEscape"),Mr("executeOnMove",!1),Mr("allowVertical",!0),Mr("allowHorizontal",!0),Mr("cycles",!0)],xp=(e,t,o)=>((e,t)=>t.focusManager.get(e).bind((e=>Xl(e,t.selector))))(e,o).bind((n=>o.execute(e,t,n))),Cp=(e,t,o)=>{t.getInitial(e).orThunk((()=>Yl(e.element,t.selector))).each((o=>{t.focusManager.set(e,o)}))},Sp=(e,t,o)=>(o.cycles?yp:bp)(e,o.selector,t,-1),kp=(e,t,o)=>(o.cycles?yp:bp)(e,o.selector,t,1),_p=e=>(t,o,n,r)=>e(t,o,n,r).bind((()=>n.executeOnMove?xp(t,o,n):A.some(!0))),Ep=w([Dh(_h(fh),zh),Dh(_h(ph),((e,t,o)=>o.onEscape(e,t)))]);var Tp=Lh(wp,xa.init,((e,t,o,n)=>{const r=[...o.allowHorizontal?vh:[]].concat(o.allowVertical?bh:[]),s=[...o.allowHorizontal?yh:[]].concat(o.allowVertical?wh:[]);return[Dh(_h(r),_p(qh(Sp,kp))),Dh(_h(s),_p(Gh(Sp,kp))),Dh(_h(hh),xp),Dh(_h(fh),xp)]}),Ep,(()=>A.some(Cp)));const Op=(e,t,o)=>A.from(e[t]).bind((e=>A.from(e[o]).map((e=>({rowIndex:t,columnIndex:o,cell:e}))))),Ap=(e,t,o,n)=>{const r=e[t].length,s=uc(o,n,0,r-1);return Op(e,t,s)},Dp=(e,t,o,n)=>{const r=uc(o,n,0,e.length-1),s=e[r].length,a=gc(t,0,s-1);return Op(e,r,a)},Mp=(e,t,o,n)=>{const r=e[t].length,s=gc(o+n,0,r-1);return Op(e,t,s)},Np=(e,t,o,n)=>{const r=gc(o+n,0,e.length-1),s=e[r].length,a=gc(t,0,s-1);return Op(e,r,a)},Rp=[wr("selectors",[hr("row"),hr("cell")]),Mr("cycles",!0),Mr("previousSelector",A.none),Mr("execute",Fh)],Bp=(e,t,o)=>{t.previousSelector(e).orThunk((()=>{const o=t.selectors;return Yl(e.element,o.cell)})).each((o=>{t.focusManager.set(e,o)}))},Lp=(e,t)=>(o,n,r)=>{const s=r.cycles?e:t;return Xl(n,r.selectors.row).bind((e=>{const t=sm(e,r.selectors.cell);return op(t,n).bind((t=>{const n=sm(o,r.selectors.row);return op(n,e).bind((e=>{const o=((e,t)=>P(e,(e=>sm(e,t.selectors.cell))))(n,r);return s(o,e,t).map((e=>e.cell))}))}))}))},Hp=Lp(((e,t,o)=>Ap(e,t,o,-1)),((e,t,o)=>Mp(e,t,o,-1))),Ip=Lp(((e,t,o)=>Ap(e,t,o,1)),((e,t,o)=>Mp(e,t,o,1))),Pp=Lp(((e,t,o)=>Dp(e,o,t,-1)),((e,t,o)=>Np(e,o,t,-1))),Fp=Lp(((e,t,o)=>Dp(e,o,t,1)),((e,t,o)=>Np(e,o,t,1))),zp=w([Dh(_h(vh),qh(Hp,Ip)),Dh(_h(yh),Gh(Hp,Ip)),Dh(_h(bh),Xh(Pp)),Dh(_h(wh),Jh(Fp)),Dh(_h(fh.concat(hh)),((e,t,o)=>jc(e.element).bind((n=>o.execute(e,t,n)))))]),Vp=w([Dh(_h(fh),zh)]);var Zp=Lh(Rp,xa.init,zp,Vp,(()=>A.some(Bp)));const Up=[hr("selector"),Mr("execute",Fh),Mr("moveOnTab",!1)],jp=(e,t,o)=>o.focusManager.get(e).bind((n=>o.execute(e,t,n))),Wp=(e,t,o)=>{Yl(e.element,t.selector).each((o=>{t.focusManager.set(e,o)}))},$p=(e,t,o)=>yp(e,o.selector,t,-1),qp=(e,t,o)=>yp(e,o.selector,t,1),Gp=w([Dh(_h(bh),Qh($p)),Dh(_h(wh),Qh(qp)),Dh(Eh([Th,_h(gh)]),((e,t,o,n)=>o.moveOnTab?Qh($p)(e,t,o,n):A.none())),Dh(Eh([Ah,_h(gh)]),((e,t,o,n)=>o.moveOnTab?Qh(qp)(e,t,o,n):A.none())),Dh(_h(hh),jp),Dh(_h(fh),jp)]),Kp=w([Dh(_h(fh),zh)]);var Yp=Lh(Up,xa.init,Gp,Kp,(()=>A.some(Wp)));const Xp=[zi("onSpace"),zi("onEnter"),zi("onShiftEnter"),zi("onLeft"),zi("onRight"),zi("onTab"),zi("onShiftTab"),zi("onUp"),zi("onDown"),zi("onEscape"),Mr("stopSpaceKeyup",!1),Sr("focusIn")];var Jp=Lh(Xp,xa.init,((e,t,o)=>[Dh(_h(fh),o.onSpace),Dh(Eh([Ah,_h(hh)]),o.onEnter),Dh(Eh([Th,_h(hh)]),o.onShiftEnter),Dh(Eh([Th,_h(gh)]),o.onShiftTab),Dh(Eh([Ah,_h(gh)]),o.onTab),Dh(_h(bh),o.onUp),Dh(_h(wh),o.onDown),Dh(_h(vh),o.onLeft),Dh(_h(yh),o.onRight),Dh(_h(fh),o.onSpace)]),((e,t,o)=>[...o.stopSpaceKeyup?[Dh(_h(fh),zh)]:[],Dh(_h(ph),o.onEscape)]),(e=>e.focusIn));const Qp=Ih.schema(),ef=Ph.schema(),tf=Tp.schema(),of=fp.schema(),nf=Zp.schema(),rf=Uh.schema(),sf=Yp.schema(),af=Jp.schema();const lf=Ta({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:Qp,cyclic:ef,flow:tf,flatgrid:of,matrix:nf,execution:rf,menu:sf,special:af}),name:"keying",active:{events:(e,t)=>e.handler.toEvents(e,t)},apis:{focusIn:(e,t,o)=>{t.sendFocusIn(t).fold((()=>{e.getSystem().triggerFocus(e.element,e.element)}),(n=>{n(e,t,o)}))},setGridSize:(e,t,o,n,r)=>{(e=>be(e,"setGridSize"))(o)?o.setGridSize(n,r):console.error("Layout does not support setGridSize")}},state:Wh}),cf=(e,t)=>{Wc((()=>{Wm(e,t,(()=>P(t,e.getSystem().build)))}),e.element)},df=(e,t)=>{Wc((()=>{((e,t,o)=>{const n=e.components(),r=q(t,(e=>dl(e).toArray()));F(n,(e=>{B(r,e)||Um(e)}));const s=o(t),a=Y(n,s);F(a,(e=>{Fm(e)&&Um(e)})),F(s,(t=>{Fm(t)||Zm(e,t)})),e.syncComponents()})(e,t,(()=>((e,t,o)=>El(e,t,((t,n)=>Tl(e,n,t,o))))(e.element,t,e.getSystem().buildOrPatch)))}),e.element)},mf=(e,t,o,n)=>{Um(t);const r=Tl(e.element,o,n,e.getSystem().buildOrPatch);Zm(e,r),e.syncComponents()},uf=(e,t,o)=>{const n=e.getSystem().build(o);qm(e,n,t)},gf=(e,t,o,n)=>{Km(t),uf(e,((e,t)=>((e,t,o)=>{it(e,o).fold((()=>{Ho(e,t)}),(e=>{Ro(e,t)}))})(e,t,o)),n)},hf=(e,t)=>e.components(),pf=(e,t,o,n,r)=>{const s=hf(e);return A.from(s[n]).map((o=>(r.fold((()=>Km(o)),(r=>{(t.reuseDom?mf:gf)(e,o,n,r)})),o)))};var ff=Object.freeze({__proto__:null,append:(e,t,o,n)=>{uf(e,Ho,n)},prepend:(e,t,o,n)=>{uf(e,Lo,n)},remove:(e,t,o,n)=>{const r=hf(e),s=j(r,(e=>Xe(n.element,e.element)));s.each(Km)},replaceAt:pf,replaceBy:(e,t,o,n,r)=>{const s=hf(e);return W(s,n).bind((o=>pf(e,t,0,o,r)))},set:(e,t,o,n)=>(t.reuseDom?df:cf)(e,n),contents:hf});const vf=_a({fields:[Hr("reuseDom",!0)],name:"replacing",apis:ff}),bf=(e,t)=>{const o=((e,t)=>{const o=Qs(t);return _a({fields:[hr("enabled")],name:e,active:{events:w(o)}})})(e,t);return{key:e,value:{config:{},me:o,configAsRaw:w({}),initialConfig:{},state:xa}}},yf=(e,t)=>{t.ignore||(zc(e.element),t.onFocus(e))};var wf=Object.freeze({__proto__:null,focus:yf,blur:(e,t)=>{t.ignore||Vc(e.element)},isFocused:e=>Zc(e.element)});var xf=Object.freeze({__proto__:null,exhibit:(e,t)=>{const o=t.ignore?{}:{attributes:{tabindex:"-1"}};return fa(o)},events:e=>Qs([oa(xs(),((t,o)=>{yf(t,e),o.stop()}))].concat(e.stopMousedown?[oa(ns(),((e,t)=>{t.event.prevent()}))]:[]))}),Cf=[Fi("onFocus"),Mr("stopMousedown",!1),Mr("ignore",!1)];const Sf=_a({fields:Cf,name:"focusing",active:xf,apis:wf}),kf=(e,t,o,n)=>{const r=o.get();o.set(n),((e,t,o)=>{t.toggleClass.each((t=>{o.get()?Ba(e.element,t):Ha(e.element,t)}))})(e,t,o),((e,t,o)=>{const n=t.aria;n.update(e,n,o.get())})(e,t,o),r!==n&&t.onToggled(e,n)},_f=(e,t,o)=>{kf(e,t,o,!o.get())},Ef=(e,t,o)=>{kf(e,t,o,t.selected)};var Tf=Object.freeze({__proto__:null,onLoad:Ef,toggle:_f,isOn:(e,t,o)=>o.get(),on:(e,t,o)=>{kf(e,t,o,!0)},off:(e,t,o)=>{kf(e,t,o,!1)},set:kf});var Of=Object.freeze({__proto__:null,exhibit:()=>fa({}),events:(e,t)=>{const o=(n=e,r=t,s=_f,ga((e=>{s(e,n,r)})));var n,r,s;const a=va(e,t,Ef);return Qs($([e.toggleOnExecute?[o]:[],[a]]))}});const Af=(e,t,o)=>{St(e.element,"aria-expanded",o)};var Df=[Mr("selected",!1),Sr("toggleClass"),Mr("toggleOnExecute",!0),Fi("onToggled"),Nr("aria",{mode:"none"},cr("mode",{pressed:[Mr("syncWithExpanded",!1),Ui("update",((e,t,o)=>{St(e.element,"aria-pressed",o),t.syncWithExpanded&&Af(e,t,o)}))],checked:[Ui("update",((e,t,o)=>{St(e.element,"aria-checked",o)}))],expanded:[Ui("update",Af)],selected:[Ui("update",((e,t,o)=>{St(e.element,"aria-selected",o)}))],none:[Ui("update",v)]}))];const Mf=_a({fields:Df,name:"toggling",active:Of,apis:Tf,state:(Nf=!1,{init:()=>{const e=Qo(Nf);return{get:()=>e.get(),set:t=>e.set(t),clear:()=>e.set(Nf),readState:()=>e.get()}}})});var Nf;const Rf=()=>{const e=(e,t)=>{t.stop(),Ks(e)};return[oa(hs(),e),oa(Ts(),e),ia(Qr()),ia(ns())]},Bf=e=>Qs($([e.map((e=>ga(((t,o)=>{e(t),o.stop()})))).toArray(),Rf()])),Lf="alloy.item-hover",Hf="alloy.item-focus",If="alloy.item-toggled",Pf=e=>{(jc(e.element).isNone()||Sf.isFocused(e))&&(Sf.isFocused(e)||Sf.focus(e),Gs(e,Lf,{item:e}))},Ff=e=>{Gs(e,Hf,{item:e})},zf=w(Lf),Vf=w(Hf),Zf=w(If),Uf=e=>e.role.fold((()=>e.toggling.map((e=>e.exclusive?"menuitemradio":"menuitemcheckbox")).getOr("menuitem")),x),jf=(e,t)=>({aria:{mode:t?"selected":"checked"},...ue(e,((e,t)=>"exclusive"!==t)),onToggled:(t,o)=>{h(e.onToggled)&&e.onToggled(t,o),((e,t)=>{Gs(e,If,{item:e,state:t})})(t,o)}}),Wf=[hr("data"),hr("components"),hr("dom"),Mr("hasSubmenu",!1),Sr("toggling"),Sr("role"),Lu("itemBehaviours",[Mf,Sf,lf,Mu]),Mr("ignoreFocus",!1),Mr("domModification",{}),Ui("builder",(e=>({dom:e.dom,domModification:{...e.domModification,attributes:{role:Uf(e),...e.domModification.attributes,"aria-haspopup":e.hasSubmenu,...e.hasSubmenu?{"aria-expanded":!1}:{}}},behaviours:Hu(e.itemBehaviours,[e.toggling.fold(Mf.revoke,(t=>Mf.config(jf(t,e.role.exists((e=>"option"===e)))))),Sf.config({ignore:e.ignoreFocus,stopMousedown:e.ignoreFocus,onFocus:e=>{Ff(e)}}),lf.config({mode:"execution"}),Mu.config({store:{mode:"memory",initialValue:e.data}}),bf("item-type-events",[...Rf(),oa(is(),Pf),oa(Es(),Sf.focus)])]),components:e.components,eventOrder:e.eventOrder}))),Mr("eventOrder",{})],$f=[hr("dom"),hr("components"),Ui("builder",(e=>({dom:e.dom,components:e.components,events:Qs([la(Es())])})))],qf=w("item-widget"),Gf=w([ig({name:"widget",overrides:e=>({behaviours:Sa([Mu.config({store:{mode:"manual",getValue:t=>e.data,setValue:v}})])})})]),Kf=[hr("uid"),hr("data"),hr("components"),hr("dom"),Mr("autofocus",!1),Mr("ignoreFocus",!1),Lu("widgetBehaviours",[Mu,Sf,lf]),Mr("domModification",{}),Og(Gf()),Ui("builder",(e=>{const t=yg(qf(),e,Gf()),o=wg(qf(),e,t.internals()),n=t=>xg(t,e,"widget").map((e=>(lf.focusIn(e),e))),r=(t,o)=>Ig(o.event.target)?A.none():e.autofocus?(o.setSource(t.element),A.none()):A.none();return{dom:e.dom,components:o,domModification:e.domModification,events:Qs([ga(((e,t)=>{n(e).each((e=>{t.stop()}))})),oa(is(),Pf),oa(Es(),((t,o)=>{e.autofocus?n(t):Sf.focus(t)}))]),behaviours:Hu(e.widgetBehaviours,[Mu.config({store:{mode:"memory",initialValue:e.data}}),Sf.config({ignore:e.ignoreFocus,onFocus:e=>{Ff(e)}}),lf.config({mode:"special",focusIn:e.autofocus?e=>{n(e)}:Oa(),onLeft:r,onRight:r,onEscape:(t,o)=>Sf.isFocused(t)||e.autofocus?e.autofocus?(o.setSource(t.element),A.none()):A.none():(Sf.focus(t),A.some(!0))})])}}))],Yf=cr("type",{widget:Kf,item:Wf,separator:$f}),Xf=w([dg({factory:{sketch:e=>{const t=ir("menu.spec item",Yf,e);return t.builder(t)}},name:"items",unit:"item",defaults:(e,t)=>ve(t,"uid")?t:{...t,uid:rl("item")},overrides:(e,t)=>({type:t.type,ignoreFocus:e.fakeFocus,domModification:{classes:[e.markers.item]}})})]),Jf=w([Er("role"),hr("value"),hr("items"),hr("dom"),hr("components"),Mr("eventOrder",{}),Nu("menuBehaviours",[mh,Mu,zg,lf]),Nr("movement",{mode:"menu",moveOnTab:!0},cr("mode",{grid:[Wi(),Ui("config",((e,t)=>({mode:"flatgrid",selector:"."+e.markers.item,initSize:{numColumns:t.initSize.numColumns,numRows:t.initSize.numRows},focusManager:e.focusManager})))],matrix:[Ui("config",((e,t)=>({mode:"matrix",selectors:{row:t.rowSelector,cell:"."+e.markers.item},previousSelector:t.previousSelector,focusManager:e.focusManager}))),hr("rowSelector"),Mr("previousSelector",A.none)],menu:[Mr("moveOnTab",!0),Ui("config",((e,t)=>({mode:"menu",selector:"."+e.markers.item,moveOnTab:t.moveOnTab,focusManager:e.focusManager})))]})),pr("markers",Bi()),Mr("fakeFocus",!1),Mr("focusManager",Nh()),Fi("onHighlight"),Fi("onDehighlight"),Mr("showMenuRole",!0)]),Qf=w("alloy.menu-focus"),ev=Hg({name:"Menu",configFields:Jf(),partFields:Xf(),factory:(e,t,o,n)=>({uid:e.uid,dom:e.dom,markers:e.markers,behaviours:Bu(e.menuBehaviours,[mh.config({highlightClass:e.markers.selectedItem,itemClass:e.markers.item,onHighlight:e.onHighlight,onDehighlight:e.onDehighlight}),Mu.config({store:{mode:"memory",initialValue:e.value}}),zg.config({find:A.some}),lf.config(e.movement.config(e,e.movement))]),events:Qs([oa(Vf(),((e,t)=>{const o=t.event;e.getSystem().getByDom(o.target).each((o=>{mh.highlight(e,o),t.stop(),Gs(e,Qf(),{menu:e,item:o})}))})),oa(zf(),((e,t)=>{const o=t.event.item;mh.highlight(e,o)})),oa(Zf(),((e,t)=>{const{item:o,state:n}=t.event;n&&"menuitemradio"===_t(o.element,"role")&&((e,t)=>{const o=sm(e.element,'[role="menuitemradio"][aria-checked="true"]');F(o,(o=>{Xe(o,t.element)||e.getSystem().getByDom(o).each((e=>{Mf.off(e)}))}))})(e,o)}))]),components:t,eventOrder:e.eventOrder,...e.showMenuRole?{domModification:{attributes:{role:e.role.getOr("menu")}}}:{}})}),tv=(e,t,o,n)=>fe(o,n).bind((n=>fe(e,n).bind((n=>{const r=tv(e,t,o,n);return A.some([n].concat(r))})))).getOr([]),ov=(e,t)=>{const o={};ie(e,((e,t)=>{F(e,(e=>{o[e]=t}))}));const n=t,r=ce(t,((e,t)=>({k:e,v:t})));const s=le(r,((e,t)=>[t].concat(tv(o,n,r,t))));return le(o,(e=>fe(s,e).getOr([e])))},nv=e=>"prepared"===e.type?A.some(e.menu):A.none(),rv={init:()=>{const e=Qo({}),t=Qo({}),o=Qo({}),n=on(),r=Qo({}),s=(t,o,n)=>a(t).bind((r=>(t=>he(e.get(),((e,o)=>e===t)))(t).bind((e=>o(e).map((e=>({triggeredMenu:r,triggeringItem:e,triggeringPath:n}))))))),a=e=>i(e).bind(nv),i=e=>fe(t.get(),e),l=t=>fe(e.get(),t);return{setMenuBuilt:(e,o)=>{t.set({...t.get(),[e]:{type:"prepared",menu:o}})},setContents:(s,a,i,l)=>{n.set(s),e.set(i),t.set(a),r.set(l);const c=ov(l,i);o.set(c)},expand:t=>fe(e.get(),t).map((e=>{const n=fe(o.get(),t).getOr([]);return[e].concat(n)})),refresh:e=>fe(o.get(),e),collapse:e=>fe(o.get(),e).bind((e=>e.length>1?A.some(e.slice(1)):A.none())),lookupMenu:i,lookupItem:l,otherMenus:e=>{const t=r.get();return Y(se(t),e)},getPrimary:()=>n.get().bind(a),getMenus:()=>t.get(),clear:()=>{e.set({}),t.set({}),o.set({}),n.clear()},isClear:()=>n.get().isNone(),getTriggeringPath:(e,t)=>{const r=V(l(e).toArray(),(e=>a(e).isSome()));return fe(o.get(),e).bind((e=>{const o=K(r.concat(e));return(e=>{const t=[];for(let o=0;os(e,t,o.slice(0,r+1)).fold((()=>ye(n.get(),e)?[]:[A.none()]),(e=>[A.some(e)])))))}))}}},extractPreparedMenu:nv},sv=Xi("tiered-menu-item-highlight"),av=Xi("tiered-menu-item-dehighlight");var iv;!function(e){e[e.HighlightMenuAndItem=0]="HighlightMenuAndItem",e[e.HighlightJustMenu=1]="HighlightJustMenu",e[e.HighlightNone=2]="HighlightNone"}(iv||(iv={}));const lv=w("collapse-item"),cv=Lg({name:"TieredMenu",configFields:[Zi("onExecute"),Zi("onEscape"),Vi("onOpenMenu"),Vi("onOpenSubmenu"),Fi("onRepositionMenu"),Fi("onCollapseMenu"),Mr("highlightOnOpen",iv.HighlightMenuAndItem),wr("data",[hr("primary"),hr("menus"),hr("expansions")]),Mr("fakeFocus",!1),Fi("onHighlightItem"),Fi("onDehighlightItem"),Fi("onHover"),Hi(),hr("dom"),Mr("navigateOnHover",!0),Mr("stayInDom",!1),Nu("tmenuBehaviours",[lf,mh,zg,vf]),Mr("eventOrder",{})],apis:{collapseMenu:(e,t)=>{e.collapseMenu(t)},highlightPrimary:(e,t)=>{e.highlightPrimary(t)},repositionMenus:(e,t)=>{e.repositionMenus(t)}},factory:(e,t)=>{const o=on(),n=rv.init(),r=t=>{const o=((t,o,n)=>le(n,((n,r)=>{const s=()=>ev.sketch({...n,value:r,markers:e.markers,fakeFocus:e.fakeFocus,onHighlight:(e,t)=>{Gs(e,sv,{menuComp:e,itemComp:t})},onDehighlight:(e,t)=>{Gs(e,av,{menuComp:e,itemComp:t})},focusManager:e.fakeFocus?Rh():Nh()});return r===o?{type:"prepared",menu:t.getSystem().build(s())}:{type:"notbuilt",nbMenu:s}})))(t,e.data.primary,e.data.menus),r=a();return n.setContents(e.data.primary,o,e.data.expansions,r),n.getPrimary()},s=e=>Mu.getValue(e).value,a=t=>le(e.data.menus,((e,t)=>q(e.items,(e=>"separator"===e.type?[]:[e.data.value])))),i=mh.highlight,l=(t,o)=>{i(t,o),mh.getHighlighted(o).orThunk((()=>mh.getFirst(o))).each((n=>{e.fakeFocus?mh.highlight(o,n):Ys(t,n.element,Es())}))},c=(e,t)=>we(P(t,(t=>e.lookupMenu(t).bind((e=>"prepared"===e.type?A.some(e.menu):A.none()))))),d=(t,o,n)=>{const r=c(o,o.otherMenus(n));F(r,(o=>{za(o.element,[e.markers.backgroundMenu]),e.stayInDom||vf.remove(t,o)}))},m=(t,n)=>{const r=(t=>o.get().getOrThunk((()=>{const n={},r=sm(t.element,`.${e.markers.item}`),a=V(r,(e=>"true"===_t(e,"aria-haspopup")));return F(a,(e=>{t.getSystem().getByDom(e).each((e=>{const t=s(e);n[t]=e}))})),o.set(n),n})))(t);ie(r,((e,t)=>{const o=B(n,t);St(e.element,"aria-expanded",o)}))},u=(t,o,n)=>A.from(n[0]).bind((r=>o.lookupMenu(r).bind((r=>{if("notbuilt"===r.type)return A.none();{const s=r.menu,a=c(o,n.slice(1));return F(a,(t=>{Ba(t.element,e.markers.backgroundMenu)})),yt(s.element)||vf.append(t,Vl(s)),za(s.element,[e.markers.backgroundMenu]),l(t,s),d(t,o,n),A.some(s)}}))));let g;!function(e){e[e.HighlightSubmenu=0]="HighlightSubmenu",e[e.HighlightParent=1]="HighlightParent"}(g||(g={}));const h=(t,o,r=g.HighlightSubmenu)=>{if(o.hasConfigured(eh)&&eh.isDisabled(o))return A.some(o);{const a=s(o);return n.expand(a).bind((s=>(m(t,s),A.from(s[0]).bind((a=>n.lookupMenu(a).bind((i=>{const l=((e,t,o)=>{if("notbuilt"===o.type){const r=e.getSystem().build(o.nbMenu());return n.setMenuBuilt(t,r),r}return o.menu})(t,a,i);return yt(l.element)||vf.append(t,Vl(l)),e.onOpenSubmenu(t,o,l,K(s)),r===g.HighlightSubmenu?(mh.highlightFirst(l),u(t,n,s)):(mh.dehighlightAll(l),A.some(o))})))))))}},p=(t,o)=>{const r=s(o);return n.collapse(r).bind((r=>(m(t,r),u(t,n,r).map((n=>(e.onCollapseMenu(t,o,n),n))))))},f=t=>(o,n)=>Xl(n.getSource(),`.${e.markers.item}`).bind((e=>o.getSystem().getByDom(e).toOptional().bind((e=>t(o,e).map(O))))),b=Qs([oa(Qf(),((e,t)=>{const o=t.event.item;n.lookupItem(s(o)).each((()=>{const o=t.event.menu;mh.highlight(e,o);const r=s(t.event.item);n.refresh(r).each((t=>d(e,n,t)))}))})),ga(((t,o)=>{const n=o.event.target;t.getSystem().getByDom(n).each((o=>{0===s(o).indexOf("collapse-item")&&p(t,o),h(t,o,g.HighlightSubmenu).fold((()=>{e.onExecute(t,o)}),v)}))})),da(((t,o)=>{r(t).each((o=>{vf.append(t,Vl(o)),e.onOpenMenu(t,o),e.highlightOnOpen===iv.HighlightMenuAndItem?l(t,o):e.highlightOnOpen===iv.HighlightJustMenu&&i(t,o)}))})),oa(sv,((t,o)=>{e.onHighlightItem(t,o.event.menuComp,o.event.itemComp)})),oa(av,((t,o)=>{e.onDehighlightItem(t,o.event.menuComp,o.event.itemComp)})),...e.navigateOnHover?[oa(zf(),((t,o)=>{const r=o.event.item;((e,t)=>{const o=s(t);n.refresh(o).bind((t=>(m(e,t),u(e,n,t))))})(t,r),h(t,r,g.HighlightParent),e.onHover(t,r)}))]:[]]),y=e=>mh.getHighlighted(e).bind(mh.getHighlighted),w={collapseMenu:e=>{y(e).each((t=>{p(e,t)}))},highlightPrimary:e=>{n.getPrimary().each((t=>{l(e,t)}))},repositionMenus:t=>{const o=n.getPrimary().bind((e=>y(t).bind((e=>{const t=s(e),o=pe(n.getMenus()),r=we(P(o,rv.extractPreparedMenu));return n.getTriggeringPath(t,(e=>((e,t,o)=>re(t,(e=>{if(!e.getSystem().isConnected())return A.none();const t=mh.getCandidates(e);return j(t,(e=>s(e)===o))})))(0,r,e)))})).map((t=>({primary:e,triggeringPath:t})))));o.fold((()=>{(e=>A.from(e.components()[0]).filter((e=>"menu"===_t(e.element,"role"))))(t).each((o=>{e.onRepositionMenu(t,o,[])}))}),(({primary:o,triggeringPath:n})=>{e.onRepositionMenu(t,o,n)}))}};return{uid:e.uid,dom:e.dom,markers:e.markers,behaviours:Bu(e.tmenuBehaviours,[lf.config({mode:"special",onRight:f(((e,t)=>Ig(t.element)?A.none():h(e,t,g.HighlightSubmenu))),onLeft:f(((e,t)=>Ig(t.element)?A.none():p(e,t))),onEscape:f(((t,o)=>p(t,o).orThunk((()=>e.onEscape(t,o).map((()=>t)))))),focusIn:(e,t)=>{n.getPrimary().each((t=>{Ys(e,t.element,Es())}))}}),mh.config({highlightClass:e.markers.selectedMenu,itemClass:e.markers.menu}),zg.config({find:e=>mh.getHighlighted(e)}),vf.config({})]),eventOrder:e.eventOrder,apis:w,events:b}},extraApis:{tieredData:(e,t,o)=>({primary:e,menus:t,expansions:o}),singleData:(e,t)=>({primary:e,menus:Zr(e,t),expansions:{}}),collapseItem:e=>({value:Xi(lv()),meta:{text:e}})}}),dv=Lg({name:"InlineView",configFields:[hr("lazySink"),Fi("onShow"),Fi("onHide"),Or("onEscape"),Nu("inlineBehaviours",[mu,Mu,Pc]),Dr("fireDismissalEventInstead",[Mr("event",Ps())]),Dr("fireRepositionEventInstead",[Mr("event",Fs())]),Mr("getRelated",A.none),Mr("isExtraPart",T),Mr("eventOrder",A.none)],factory:(e,t)=>{const o=(t,o,n,r)=>{const s=e.lazySink(t).getOrDie();mu.openWhileCloaked(t,o,(()=>Pm.positionWithinBounds(s,t,n,r()))),Mu.setValue(t,A.some({mode:"position",config:n,getBounds:r}))},n=(t,o,n,r)=>{const s=((e,t,o,n,r)=>{const s=()=>e.lazySink(t),a="horizontal"===n.type?{layouts:{onLtr:()=>Bc(),onRtl:()=>Lc()}}:{},i=e=>(e=>2===e.length)(e)?a:{};return cv.sketch({dom:{tag:"div"},data:n.data,markers:n.menu.markers,highlightOnOpen:n.menu.highlightOnOpen,fakeFocus:n.menu.fakeFocus,onEscape:()=>(mu.close(t),e.onEscape.map((e=>e(t))),A.some(!0)),onExecute:()=>A.some(!0),onOpenMenu:(e,t)=>{Pm.positionWithinBounds(s().getOrDie(),t,o,r())},onOpenSubmenu:(e,t,o,n)=>{const r=s().getOrDie();Pm.position(r,o,{anchor:{type:"submenu",item:t,...i(n)}})},onRepositionMenu:(e,t,n)=>{const a=s().getOrDie();Pm.positionWithinBounds(a,t,o,r()),F(n,(e=>{const t=i(e.triggeringPath);Pm.position(a,e.triggeredMenu,{anchor:{type:"submenu",item:e.triggeringItem,...t}})}))}})})(e,t,o,n,r);mu.open(t,s),Mu.setValue(t,A.some({mode:"menu",menu:s}))},r=t=>{mu.isOpen(t)&&Mu.getValue(t).each((o=>{switch(o.mode){case"menu":mu.getState(t).each(cv.repositionMenus);break;case"position":const n=e.lazySink(t).getOrDie();Pm.positionWithinBounds(n,t,o.config,o.getBounds())}}))},s={setContent:(e,t)=>{mu.setContent(e,t)},showAt:(e,t,n)=>{const r=A.none;o(e,t,n,r)},showWithinBounds:o,showMenuAt:(e,t,o)=>{n(e,t,o,A.none)},showMenuWithinBounds:n,hide:e=>{mu.isOpen(e)&&(Mu.setValue(e,A.none()),mu.close(e))},getContent:e=>mu.getState(e),reposition:r,isOpen:mu.isOpen};return{uid:e.uid,dom:e.dom,behaviours:Bu(e.inlineBehaviours,[mu.config({isPartOf:(t,o,n)=>tc(o,n)||((t,o)=>e.getRelated(t).exists((e=>tc(e,o))))(t,n),getAttachPoint:t=>e.lazySink(t).getOrDie(),onOpen:t=>{e.onShow(t)},onClose:t=>{e.onHide(t)}}),Mu.config({store:{mode:"memory",initialValue:A.none()}}),Pc.config({channels:{...fu({isExtraPart:t.isExtraPart,...e.fireDismissalEventInstead.map((e=>({fireEventInstead:{event:e.event}}))).getOr({})}),...bu({...e.fireRepositionEventInstead.map((e=>({fireEventInstead:{event:e.event}}))).getOr({}),doReposition:r})}})]),eventOrder:e.eventOrder,apis:s}},apis:{showAt:(e,t,o,n)=>{e.showAt(t,o,n)},showWithinBounds:(e,t,o,n,r)=>{e.showWithinBounds(t,o,n,r)},showMenuAt:(e,t,o,n)=>{e.showMenuAt(t,o,n)},showMenuWithinBounds:(e,t,o,n,r)=>{e.showMenuWithinBounds(t,o,n,r)},hide:(e,t)=>{e.hide(t)},isOpen:(e,t)=>e.isOpen(t),getContent:(e,t)=>e.getContent(t),setContent:(e,t,o)=>{e.setContent(t,o)},reposition:(e,t)=>{e.reposition(t)}}});var mv,uv,gv=tinymce.util.Tools.resolve("tinymce.util.Delay"),hv=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),pv=tinymce.util.Tools.resolve("tinymce.EditorManager"),fv=tinymce.util.Tools.resolve("tinymce.Env");!function(e){e.default="wrap",e.floating="floating",e.sliding="sliding",e.scrolling="scrolling"}(mv||(mv={})),function(e){e.auto="auto",e.top="top",e.bottom="bottom"}(uv||(uv={}));const vv=e=>t=>t.options.get(e),bv=e=>t=>A.from(e(t)),yv=e=>{const t=fv.deviceType.isPhone(),o=fv.deviceType.isTablet()||t,n=e.options.register,r=e=>s(e)||!1===e,a=e=>s(e)||p(e);n("skin",{processor:e=>s(e)||!1===e,default:"oxide"}),n("skin_url",{processor:"string"}),n("height",{processor:a,default:Math.max(e.getElement().offsetHeight,400)}),n("width",{processor:a,default:hv.DOM.getStyle(e.getElement(),"width")}),n("min_height",{processor:"number",default:100}),n("min_width",{processor:"number"}),n("max_height",{processor:"number"}),n("max_width",{processor:"number"}),n("style_formats",{processor:"object[]"}),n("style_formats_merge",{processor:"boolean",default:!1}),n("style_formats_autohide",{processor:"boolean",default:!1}),n("line_height_formats",{processor:"string",default:"1 1.1 1.2 1.3 1.4 1.5 2"}),n("font_family_formats",{processor:"string",default:"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"}),n("font_size_formats",{processor:"string",default:"8pt 10pt 12pt 14pt 18pt 24pt 36pt"}),n("font_size_input_default_unit",{processor:"string",default:"pt"}),n("block_formats",{processor:"string",default:"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre"}),n("content_langs",{processor:"object[]"}),n("removed_menuitems",{processor:"string",default:""}),n("menubar",{processor:e=>s(e)||d(e),default:!t}),n("menu",{processor:"object",default:{}}),n("toolbar",{processor:e=>d(e)||s(e)||l(e)?{value:e,valid:!0}:{valid:!1,message:"Must be a boolean, string or array."},default:!0}),H(9,(e=>{n("toolbar"+(e+1),{processor:"string"})})),n("toolbar_mode",{processor:"string",default:o?"scrolling":"floating"}),n("toolbar_groups",{processor:"object",default:{}}),n("toolbar_location",{processor:"string",default:uv.auto}),n("toolbar_persist",{processor:"boolean",default:!1}),n("toolbar_sticky",{processor:"boolean",default:e.inline}),n("toolbar_sticky_offset",{processor:"number",default:0}),n("fixed_toolbar_container",{processor:"string",default:""}),n("fixed_toolbar_container_target",{processor:"object"}),n("ui_mode",{processor:"string",default:"combined"}),n("file_picker_callback",{processor:"function"}),n("file_picker_validator_handler",{processor:"function"}),n("file_picker_types",{processor:"string"}),n("typeahead_urls",{processor:"boolean",default:!0}),n("anchor_top",{processor:r,default:"#top"}),n("anchor_bottom",{processor:r,default:"#bottom"}),n("draggable_modal",{processor:"boolean",default:!1}),n("statusbar",{processor:"boolean",default:!0}),n("elementpath",{processor:"boolean",default:!0}),n("branding",{processor:"boolean",default:!0}),n("promotion",{processor:"boolean",default:!0}),n("resize",{processor:e=>"both"===e||d(e),default:!fv.deviceType.isTouch()}),n("sidebar_show",{processor:"string"}),n("help_accessibility",{processor:"boolean",default:e.hasPlugin("help")}),n("default_font_stack",{processor:"string[]",default:[]})},wv=vv("readonly"),xv=vv("height"),Cv=vv("width"),Sv=bv(vv("min_width")),kv=bv(vv("min_height")),_v=bv(vv("max_width")),Ev=bv(vv("max_height")),Tv=bv(vv("style_formats")),Ov=vv("style_formats_merge"),Av=vv("style_formats_autohide"),Dv=vv("content_langs"),Mv=vv("removed_menuitems"),Nv=vv("toolbar_mode"),Rv=vv("toolbar_groups"),Bv=vv("toolbar_location"),Lv=vv("fixed_toolbar_container"),Hv=vv("fixed_toolbar_container_target"),Iv=vv("toolbar_persist"),Pv=vv("toolbar_sticky_offset"),Fv=vv("menubar"),zv=vv("toolbar"),Vv=vv("file_picker_callback"),Zv=vv("file_picker_validator_handler"),Uv=vv("font_size_input_default_unit"),jv=vv("file_picker_types"),Wv=vv("typeahead_urls"),$v=vv("anchor_top"),qv=vv("anchor_bottom"),Gv=vv("draggable_modal"),Kv=vv("statusbar"),Yv=vv("elementpath"),Xv=vv("branding"),Jv=vv("resize"),Qv=vv("paste_as_text"),eb=vv("sidebar_show"),tb=vv("promotion"),ob=vv("help_accessibility"),nb=vv("default_font_stack"),rb=e=>!1===e.options.get("skin"),sb=e=>!1!==e.options.get("menubar"),ab=e=>{const t=e.options.get("skin_url");if(rb(e))return t;if(t)return e.documentBaseURI.toAbsolute(t);{const t=e.options.get("skin");return pv.baseURL+"/skins/ui/"+t}},ib=e=>A.from(e.options.get("skin_url")),lb=e=>e.options.get("line_height_formats").split(" "),cb=e=>{const t=zv(e),o=s(t),n=l(t)&&t.length>0;return!mb(e)&&(n||o||!0===t)},db=e=>{const t=H(9,(t=>e.options.get("toolbar"+(t+1)))),o=V(t,s);return Se(o.length>0,o)},mb=e=>db(e).fold((()=>{const t=zv(e);return f(t,s)&&t.length>0}),O),ub=e=>Bv(e)===uv.bottom,gb=e=>{var t;if(!e.inline)return A.none();const o=null!==(t=Lv(e))&&void 0!==t?t:"";if(o.length>0)return Yl(wt(),o);const n=Hv(e);return g(n)?A.some(Be.fromDom(n)):A.none()},hb=e=>e.inline&&gb(e).isSome(),pb=e=>gb(e).getOrThunk((()=>pt(ht(Be.fromDom(e.getElement()))))),fb=e=>e.inline&&!sb(e)&&!cb(e)&&!mb(e),vb=e=>(e.options.get("toolbar_sticky")||e.inline)&&!hb(e)&&!fb(e),bb=e=>!hb(e)&&"split"===e.options.get("ui_mode"),yb=e=>{const t=e.options.get("menu");return le(t,(e=>({...e,items:e.items})))};var wb=Object.freeze({__proto__:null,get ToolbarMode(){return mv},get ToolbarLocation(){return uv},register:yv,getSkinUrl:ab,getSkinUrlOption:ib,isReadOnly:wv,isSkinDisabled:rb,getHeightOption:xv,getWidthOption:Cv,getMinWidthOption:Sv,getMinHeightOption:kv,getMaxWidthOption:_v,getMaxHeightOption:Ev,getUserStyleFormats:Tv,shouldMergeStyleFormats:Ov,shouldAutoHideStyleFormats:Av,getLineHeightFormats:lb,getContentLanguages:Dv,getRemovedMenuItems:Mv,isMenubarEnabled:sb,isMultipleToolbars:mb,isToolbarEnabled:cb,isToolbarPersist:Iv,getMultipleToolbarsOption:db,getUiContainer:pb,useFixedContainer:hb,isSplitUiMode:bb,getToolbarMode:Nv,isDraggableModal:Gv,isDistractionFree:fb,isStickyToolbar:vb,getStickyToolbarOffset:Pv,getToolbarLocation:Bv,isToolbarLocationBottom:ub,getToolbarGroups:Rv,getMenus:yb,getMenubar:Fv,getToolbar:zv,getFilePickerCallback:Vv,getFilePickerTypes:jv,useTypeaheadUrls:Wv,getAnchorTop:$v,getAnchorBottom:qv,getFilePickerValidatorHandler:Zv,getFontSizeInputDefaultUnit:Uv,useStatusBar:Kv,useElementPath:Yv,promotionEnabled:tb,useBranding:Xv,getResize:Jv,getPasteAsText:Qv,getSidebarShow:eb,useHelpAccessibility:ob,getDefaultFontStack:nb});const xb=["visible","hidden","clip"],Cb=e=>Ae(e).length>0&&!B(xb,e),Sb=e=>{if(Ze(e)){const t=Bt(e,"overflow-x"),o=Bt(e,"overflow-y");return Cb(t)||Cb(o)}return!1},kb=(e,t)=>bb(e)?(e=>{const t=rm(e,Sb),o=0===t.length?ft(e).map(vt).map((e=>rm(e,Sb))).getOr([]):t;return te(o).map((e=>({element:e,others:o.slice(1)})))})(t):A.none(),_b=e=>{const t=[...P(e.others,Ko),Jo()];return((e,t)=>U(t,((e,t)=>Xo(e,t)),e))(Ko(e.element),t)},Eb=Lg({name:"Button",factory:e=>{const t=Bf(e.action),o=e.dom.tag,n=t=>fe(e.dom,"attributes").bind((e=>fe(e,t)));return{uid:e.uid,dom:e.dom,components:e.components,events:t,behaviours:Hu(e.buttonBehaviours,[Sf.config({}),lf.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:(()=>{if("button"===o){return{type:n("type").getOr("button"),...n("role").map((e=>({role:e}))).getOr({})}}return{role:e.role.getOr(n("role").getOr("button"))}})()},eventOrder:e.eventOrder}},configFields:[Mr("uid",void 0),hr("dom"),Mr("components",[]),Lu("buttonBehaviours",[Sf,lf]),Sr("action"),Sr("role"),Mr("eventOrder",{})]}),Tb=e=>{const t=Be.fromHtml(e),o=at(t),n=(e=>{const t=void 0!==e.dom.attributes?e.dom.attributes:[];return U(t,((e,t)=>"class"===t.name?e:{...e,[t.name]:t.value}),{})})(t),r=(e=>Array.prototype.slice.call(e.dom.classList,0))(t),s=0===o.length?{}:{innerHtml:wi(t)};return{tag:ze(t),classes:r,attributes:n,...s}},Ob=e=>{const t=(e=>void 0!==e.uid)(e)&&be(e,"uid")?e.uid:rl("memento");return{get:e=>e.getSystem().getByUid(t).getOrDie(),getOpt:e=>e.getSystem().getByUid(t).toOptional(),asSpec:()=>({...e,uid:t})}};var Ab=Object.freeze({__proto__:null,exhibit:(e,t)=>fa({attributes:Ur([{key:t.tabAttr,value:"true"}])})}),Db=[Mr("tabAttr","data-alloy-tabstop")];const Mb=_a({fields:Db,name:"tabstopping",active:Ab}),Nb=Xi("tooltip.exclusive"),Rb=Xi("tooltip.show"),Bb=Xi("tooltip.hide"),Lb=Xi("tooltip.immediateHide"),Hb=Xi("tooltip.immediateShow"),Ib=(e,t,o)=>{e.getSystem().broadcastOn([Nb],{})};var Pb=Object.freeze({__proto__:null,hideAllExclusive:Ib,setComponents:(e,t,o,n)=>{o.getTooltip().each((e=>{e.getSystem().isConnected()&&vf.set(e,n)}))}});var Fb=Object.freeze({__proto__:null,events:(e,t)=>{const o=o=>{t.getTooltip().each((n=>{n.getSystem().isConnected()&&(Km(n),e.onHide(o,n),t.clearTooltip())})),t.clearTimer()},n=o=>{if(!t.isShowing()){Ib(o);const n=e.lazySink(o).getOrDie(),r=o.getSystem().build({dom:e.tooltipDom,components:e.tooltipComponents,events:Qs("normal"===e.mode?[oa(is(),(e=>{qs(o,Rb)})),oa(ss(),(e=>{qs(o,Bb)}))]:[]),behaviours:Sa([vf.config({})])});t.setTooltip(r),$m(n,r),e.onShow(o,r),Pm.position(n,r,{anchor:e.anchor(o)})}},r=o=>{t.getTooltip().each((t=>{const n=e.lazySink(o).getOrDie();Pm.position(n,t,{anchor:e.anchor(o)})}))};return Qs($([[oa(Rb,(o=>{t.resetTimer((()=>{n(o)}),e.delayForShow())})),oa(Bb,(n=>{t.resetTimer((()=>{o(n)}),e.delayForHide())})),oa(Hb,(e=>{t.resetTimer((()=>{n(e)}),0)})),oa(Lb,(e=>{t.resetTimer((()=>{o(e)}),0)})),oa(ks(),((e,t)=>{const n=t;n.universal||B(n.channels,Nb)&&o(e)})),ma((e=>{o(e)}))],(()=>{switch(e.mode){case"normal":return[oa(ls(),(e=>{qs(e,Hb)})),oa(Cs(),(e=>{qs(e,Lb)})),oa(is(),(e=>{qs(e,Rb)})),oa(ss(),(e=>{qs(e,Bb)}))];case"follow-highlight":return[oa(Ws(),((e,t)=>{qs(e,Rb)})),oa($s(),(e=>{qs(e,Bb)}))];case"children-normal":return[oa(ls(),((o,n)=>{jc(o.element).each((s=>{Ge(n.event.target,"[data-mce-tooltip]")&&t.getTooltip().fold((()=>{qs(o,Hb)}),(n=>{t.isShowing()&&(e.onShow(o,n),r(o))}))}))})),oa(Cs(),(e=>{jc(e.element).fold((()=>{qs(e,Lb)}),v)})),oa(is(),(o=>{Yl(o.element,"[data-mce-tooltip]:hover").each((n=>{t.getTooltip().fold((()=>{qs(o,Rb)}),(n=>{t.isShowing()&&(e.onShow(o,n),r(o))}))}))})),oa(ss(),(e=>{Yl(e.element,"[data-mce-tooltip]:hover").fold((()=>{qs(e,Bb)}),v)}))];default:return[oa(ls(),((o,n)=>{jc(o.element).each((s=>{Ge(n.event.target,"[data-mce-tooltip]")&&t.getTooltip().fold((()=>{qs(o,Hb)}),(n=>{t.isShowing()&&(e.onShow(o,n),r(o))}))}))})),oa(Cs(),(e=>{jc(e.element).fold((()=>{qs(e,Lb)}),v)}))]}})()]))}}),zb=[hr("lazySink"),hr("tooltipDom"),Mr("exclusive",!0),Mr("tooltipComponents",[]),Ir("delayForShow",w(300)),Ir("delayForHide",w(300)),Lr("mode","normal",["normal","follow-highlight","children-keyboard-focus","children-normal"]),Mr("anchor",(e=>({type:"hotspot",hotspot:e,layouts:{onLtr:w([Tc,Ec,Cc,kc,Sc,_c]),onRtl:w([Tc,Ec,Cc,kc,Sc,_c])},bubble:Sd(0,-2,{})}))),Fi("onHide"),Fi("onShow")];var Vb=Object.freeze({__proto__:null,init:()=>{const e=on(),t=on(),o=()=>{e.on(clearTimeout)},n=w("not-implemented");return Ca({getTooltip:t.get,isShowing:t.isSet,setTooltip:t.set,clearTooltip:t.clear,clearTimer:o,resetTimer:(t,n)=>{o(),e.set(setTimeout(t,n))},readState:n})}});const Zb=_a({fields:zb,name:"tooltipping",active:Fb,state:Vb,apis:Pb}),{entries:Ub,setPrototypeOf:jb,isFrozen:Wb,getPrototypeOf:$b,getOwnPropertyDescriptor:qb}=Object;let{freeze:Gb,seal:Kb,create:Yb}=Object,{apply:Xb,construct:Jb}="undefined"!=typeof Reflect&&Reflect;Xb||(Xb=function(e,t,o){return e.apply(t,o)}),Gb||(Gb=function(e){return e}),Kb||(Kb=function(e){return e}),Jb||(Jb=function(e,t){return new e(...t)});const Qb=my(Array.prototype.forEach),ey=my(Array.prototype.pop),ty=my(Array.prototype.push),oy=my(String.prototype.toLowerCase),ny=my(String.prototype.toString),ry=my(String.prototype.match),sy=my(String.prototype.replace),ay=my(String.prototype.indexOf),iy=my(String.prototype.trim),ly=my(RegExp.prototype.test),cy=(dy=TypeError,function(){for(var e=arguments.length,t=new Array(e),o=0;o1?o-1:0),r=1;r/gm),Oy=Kb(/\${[\w\W]*}/gm),Ay=Kb(/^data-[\-\w.\u00B7-\uFFFF]/),Dy=Kb(/^aria-[\-\w]+$/),My=Kb(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ny=Kb(/^(?:\w+script|data):/i),Ry=Kb(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),By=Kb(/^html$/i);var Ly=Object.freeze({__proto__:null,MUSTACHE_EXPR:Ey,ERB_EXPR:Ty,TMPLIT_EXPR:Oy,DATA_ATTR:Ay,ARIA_ATTR:Dy,IS_ALLOWED_URI:My,IS_SCRIPT_OR_DATA:Ny,ATTR_WHITESPACE:Ry,DOCTYPE_NAME:By});const Hy=()=>"undefined"==typeof window?null:window;var Iy=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Hy();const o=t=>e(t);if(o.version="3.0.5",o.removed=[],!t||!t.document||9!==t.document.nodeType)return o.isSupported=!1,o;const n=t.document,r=n.currentScript;let{document:s}=t;const{DocumentFragment:a,HTMLTemplateElement:i,Node:l,Element:c,NodeFilter:d,NamedNodeMap:m=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:u,DOMParser:g,trustedTypes:h}=t,p=c.prototype,f=hy(p,"cloneNode"),v=hy(p,"nextSibling"),b=hy(p,"childNodes"),y=hy(p,"parentNode");if("function"==typeof i){const e=s.createElement("template");e.content&&e.content.ownerDocument&&(s=e.content.ownerDocument)}let w,x="";const{implementation:C,createNodeIterator:S,createDocumentFragment:k,getElementsByTagName:_}=s,{importNode:E}=n;let T={};o.isSupported="function"==typeof Ub&&"function"==typeof y&&C&&void 0!==C.createHTMLDocument;const{MUSTACHE_EXPR:O,ERB_EXPR:A,TMPLIT_EXPR:D,DATA_ATTR:M,ARIA_ATTR:N,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:B}=Ly;let{IS_ALLOWED_URI:L}=Ly,H=null;const I=uy({},[...py,...fy,...vy,...yy,...xy]);let P=null;const F=uy({},[...Cy,...Sy,...ky,..._y]);let z=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),V=null,Z=null,U=!0,j=!0,W=!1,$=!0,q=!1,G=!1,K=!1,Y=!1,X=!1,J=!1,Q=!1,ee=!0,te=!1,oe=!0,ne=!1,re={},se=null;const ae=uy({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ie=null;const le=uy({},["audio","video","img","source","image","track"]);let ce=null;const de=uy({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),me="http://www.w3.org/1998/Math/MathML",ue="http://www.w3.org/2000/svg",ge="http://www.w3.org/1999/xhtml";let he=ge,pe=!1,fe=null;const ve=uy({},[me,ue,ge],ny);let be;const ye=["application/xhtml+xml","text/html"];let we,xe=null;const Ce=s.createElement("form"),Se=function(e){return e instanceof RegExp||e instanceof Function},ke=function(e){if(!xe||xe!==e){if(e&&"object"==typeof e||(e={}),e=gy(e),be=be=-1===ye.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,we="application/xhtml+xml"===be?ny:oy,H="ALLOWED_TAGS"in e?uy({},e.ALLOWED_TAGS,we):I,P="ALLOWED_ATTR"in e?uy({},e.ALLOWED_ATTR,we):F,fe="ALLOWED_NAMESPACES"in e?uy({},e.ALLOWED_NAMESPACES,ny):ve,ce="ADD_URI_SAFE_ATTR"in e?uy(gy(de),e.ADD_URI_SAFE_ATTR,we):de,ie="ADD_DATA_URI_TAGS"in e?uy(gy(le),e.ADD_DATA_URI_TAGS,we):le,se="FORBID_CONTENTS"in e?uy({},e.FORBID_CONTENTS,we):ae,V="FORBID_TAGS"in e?uy({},e.FORBID_TAGS,we):{},Z="FORBID_ATTR"in e?uy({},e.FORBID_ATTR,we):{},re="USE_PROFILES"in e&&e.USE_PROFILES,U=!1!==e.ALLOW_ARIA_ATTR,j=!1!==e.ALLOW_DATA_ATTR,W=e.ALLOW_UNKNOWN_PROTOCOLS||!1,$=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,q=e.SAFE_FOR_TEMPLATES||!1,G=e.WHOLE_DOCUMENT||!1,X=e.RETURN_DOM||!1,J=e.RETURN_DOM_FRAGMENT||!1,Q=e.RETURN_TRUSTED_TYPE||!1,Y=e.FORCE_BODY||!1,ee=!1!==e.SANITIZE_DOM,te=e.SANITIZE_NAMED_PROPS||!1,oe=!1!==e.KEEP_CONTENT,ne=e.IN_PLACE||!1,L=e.ALLOWED_URI_REGEXP||My,he=e.NAMESPACE||ge,z=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(z.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(z.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(z.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(j=!1),J&&(X=!0),re&&(H=uy({},[...xy]),P=[],!0===re.html&&(uy(H,py),uy(P,Cy)),!0===re.svg&&(uy(H,fy),uy(P,Sy),uy(P,_y)),!0===re.svgFilters&&(uy(H,vy),uy(P,Sy),uy(P,_y)),!0===re.mathMl&&(uy(H,yy),uy(P,ky),uy(P,_y))),e.ADD_TAGS&&(H===I&&(H=gy(H)),uy(H,e.ADD_TAGS,we)),e.ADD_ATTR&&(P===F&&(P=gy(P)),uy(P,e.ADD_ATTR,we)),e.ADD_URI_SAFE_ATTR&&uy(ce,e.ADD_URI_SAFE_ATTR,we),e.FORBID_CONTENTS&&(se===ae&&(se=gy(se)),uy(se,e.FORBID_CONTENTS,we)),oe&&(H["#text"]=!0),G&&uy(H,["html","head","body"]),H.table&&(uy(H,["tbody"]),delete V.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw cy('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw cy('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,x=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let o=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(o=t.getAttribute(n));const r="dompurify"+(o?"#"+o:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(h,r)),null!==w&&"string"==typeof x&&(x=w.createHTML(""));Gb&&Gb(e),xe=e}},_e=uy({},["mi","mo","mn","ms","mtext"]),Ee=uy({},["foreignobject","desc","title","annotation-xml"]),Te=uy({},["title","style","font","a","script"]),Oe=uy({},fy);uy(Oe,vy),uy(Oe,by);const Ae=uy({},yy);uy(Ae,wy);const De=function(e){ty(o.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},Me=function(e,t){try{ty(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){ty(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!P[e])if(X||J)try{De(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Ne=function(e){let t,o;if(Y)e=""+e;else{const t=ry(e,/^[\r\n\t ]+/);o=t&&t[0]}"application/xhtml+xml"===be&&he===ge&&(e=''+e+"");const n=w?w.createHTML(e):e;if(he===ge)try{t=(new g).parseFromString(n,be)}catch(e){}if(!t||!t.documentElement){t=C.createDocument(he,"template",null);try{t.documentElement.innerHTML=pe?x:n}catch(e){}}const r=t.body||t.documentElement;return e&&o&&r.insertBefore(s.createTextNode(o),r.childNodes[0]||null),he===ge?_.call(t,G?"html":"body")[0]:G?t.documentElement:r},Re=function(e){return S.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT,null,!1)},Be=function(e){return"object"==typeof l?e instanceof l:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Le=function(e,t,n){T[e]&&Qb(T[e],(e=>{e.call(o,t,n,xe)}))},He=function(e){let t;if(Le("beforeSanitizeElements",e,null),(n=e)instanceof u&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof m)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return De(e),!0;var n;const r=we(e.nodeName);if(Le("uponSanitizeElement",e,{tagName:r,allowedTags:H}),e.hasChildNodes()&&!Be(e.firstElementChild)&&(!Be(e.content)||!Be(e.content.firstElementChild))&&ly(/<[/\w]/g,e.innerHTML)&&ly(/<[/\w]/g,e.textContent))return De(e),!0;if(!H[r]||V[r]){if(!V[r]&&Pe(r)){if(z.tagNameCheck instanceof RegExp&&ly(z.tagNameCheck,r))return!1;if(z.tagNameCheck instanceof Function&&z.tagNameCheck(r))return!1}if(oe&&!se[r]){const t=y(e)||e.parentNode,o=b(e)||e.childNodes;if(o&&t){for(let n=o.length-1;n>=0;--n)t.insertBefore(f(o[n],!0),v(e))}}return De(e),!0}return e instanceof c&&!function(e){let t=y(e);t&&t.tagName||(t={namespaceURI:he,tagName:"template"});const o=oy(e.tagName),n=oy(t.tagName);return!!fe[e.namespaceURI]&&(e.namespaceURI===ue?t.namespaceURI===ge?"svg"===o:t.namespaceURI===me?"svg"===o&&("annotation-xml"===n||_e[n]):Boolean(Oe[o]):e.namespaceURI===me?t.namespaceURI===ge?"math"===o:t.namespaceURI===ue?"math"===o&&Ee[n]:Boolean(Ae[o]):e.namespaceURI===ge?!(t.namespaceURI===ue&&!Ee[n])&&!(t.namespaceURI===me&&!_e[n])&&!Ae[o]&&(Te[o]||!Oe[o]):!("application/xhtml+xml"!==be||!fe[e.namespaceURI]))}(e)?(De(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!ly(/<\/no(script|embed|frames)/i,e.innerHTML)?(q&&3===e.nodeType&&(t=e.textContent,t=sy(t,O," "),t=sy(t,A," "),t=sy(t,D," "),e.textContent!==t&&(ty(o.removed,{element:e.cloneNode()}),e.textContent=t)),Le("afterSanitizeElements",e,null),!1):(De(e),!0)},Ie=function(e,t,o){if(ee&&("id"===t||"name"===t)&&(o in s||o in Ce))return!1;if(j&&!Z[t]&&ly(M,t));else if(U&&ly(N,t));else if(!P[t]||Z[t]){if(!(Pe(e)&&(z.tagNameCheck instanceof RegExp&&ly(z.tagNameCheck,e)||z.tagNameCheck instanceof Function&&z.tagNameCheck(e))&&(z.attributeNameCheck instanceof RegExp&&ly(z.attributeNameCheck,t)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(t))||"is"===t&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&ly(z.tagNameCheck,o)||z.tagNameCheck instanceof Function&&z.tagNameCheck(o))))return!1}else if(ce[t]);else if(ly(L,sy(o,B,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==ay(o,"data:")||!ie[e]){if(W&&!ly(R,sy(o,B,"")));else if(o)return!1}else;return!0},Pe=function(e){return e.indexOf("-")>0},Fe=function(e){let t,o,n,r;Le("beforeSanitizeAttributes",e,null);const{attributes:s}=e;if(!s)return;const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:P};for(r=s.length;r--;){t=s[r];const{name:i,namespaceURI:l}=t;o="value"===i?t.value:iy(t.value);const c=o;if(n=we(i),a.attrName=n,a.attrValue=o,a.keepAttr=!0,a.forceKeepAttr=void 0,Le("uponSanitizeAttribute",e,a),o=a.attrValue,a.forceKeepAttr)continue;if(!a.keepAttr){Me(i,e);continue}if(!$&&ly(/\/>/i,o)){Me(i,e);continue}q&&(o=sy(o,O," "),o=sy(o,A," "),o=sy(o,D," "));const d=we(e.nodeName);if(Ie(d,n,o)){if(!te||"id"!==n&&"name"!==n||(Me(i,e),o="user-content-"+o),w&&"object"==typeof h&&"function"==typeof h.getAttributeType)if(l);else switch(h.getAttributeType(d,n)){case"TrustedHTML":o=w.createHTML(o);break;case"TrustedScriptURL":o=w.createScriptURL(o)}if(o!==c)try{l?e.setAttributeNS(l,i,o):e.setAttribute(i,o)}catch(t){Me(i,e)}}else Me(i,e)}Le("afterSanitizeAttributes",e,null)},ze=function e(t){let o;const n=Re(t);for(Le("beforeSanitizeShadowDOM",t,null);o=n.nextNode();)Le("uponSanitizeShadowNode",o,null),He(o)||(o.content instanceof a&&e(o.content),Fe(o));Le("afterSanitizeShadowDOM",t,null)};return o.sanitize=function(e){let t,r,s,i,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(pe=!e,pe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Be(e)){if("function"!=typeof e.toString)throw cy("toString is not a function");if("string"!=typeof(e=e.toString()))throw cy("dirty is not a string, aborting")}if(!o.isSupported)return e;if(K||ke(c),o.removed=[],"string"==typeof e&&(ne=!1),ne){if(e.nodeName){const t=we(e.nodeName);if(!H[t]||V[t])throw cy("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)t=Ne("\x3c!----\x3e"),r=t.ownerDocument.importNode(e,!0),1===r.nodeType&&"BODY"===r.nodeName||"HTML"===r.nodeName?t=r:t.appendChild(r);else{if(!X&&!q&&!G&&-1===e.indexOf("<"))return w&&Q?w.createHTML(e):e;if(t=Ne(e),!t)return X?null:Q?x:""}t&&Y&&De(t.firstChild);const d=Re(ne?e:t);for(;s=d.nextNode();)He(s)||(s.content instanceof a&&ze(s.content),Fe(s));if(ne)return e;if(X){if(J)for(i=k.call(t.ownerDocument);t.firstChild;)i.appendChild(t.firstChild);else i=t;return(P.shadowroot||P.shadowrootmode)&&(i=E.call(n,i,!0)),i}let m=G?t.outerHTML:t.innerHTML;return G&&H["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&ly(By,t.ownerDocument.doctype.name)&&(m="\n"+m),q&&(m=sy(m,O," "),m=sy(m,A," "),m=sy(m,D," ")),w&&Q?w.createHTML(m):m},o.setConfig=function(e){ke(e),K=!0},o.clearConfig=function(){xe=null,K=!1},o.isValidAttribute=function(e,t,o){xe||ke({});const n=we(e),r=we(t);return Ie(n,r,o)},o.addHook=function(e,t){"function"==typeof t&&(T[e]=T[e]||[],ty(T[e],t))},o.removeHook=function(e){if(T[e])return ey(T[e])},o.removeHooks=function(e){T[e]&&(T[e]=[])},o.removeAllHooks=function(){T={}},o}();const Py=e=>Iy().sanitize(e);var Fy=tinymce.util.Tools.resolve("tinymce.util.I18n");const zy={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},Vy="temporary-placeholder",Zy=e=>()=>fe(e,Vy).getOr("!not found!"),Uy=(e,t)=>{const o=e.toLowerCase();if(Fy.isRtl()){const e=((e,t)=>Oe(e,t)?e:((e,t)=>e+t)(e,t))(o,"-rtl");return ve(t,e)?e:o}return o},jy=(e,t)=>fe(t,Uy(e,t)),Wy=(e,t)=>{const o=t();return jy(e,o).getOrThunk(Zy(o))},$y=()=>bf("add-focusable",[da((e=>{Kl(e.element,"svg").each((e=>St(e,"focusable","false")))}))]),qy=(e,t,o,n)=>{var r,s;const a=(e=>!!Fy.isRtl()&&ve(zy,e))(t)?["tox-icon--flip"]:[],i=fe(o,Uy(t,o)).or(n).getOrThunk(Zy(o));return{dom:{tag:e.tag,attributes:null!==(r=e.attributes)&&void 0!==r?r:{},classes:e.classes.concat(a),innerHtml:i},behaviours:Sa([...null!==(s=e.behaviours)&&void 0!==s?s:[],$y()])}},Gy=(e,t,o,n=A.none())=>qy(t,e,o(),n),Ky={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Yy=Lg({name:"Notification",factory:e=>{const t=Xi("notification-text"),o=Ob({dom:Tb(`

    ${Py(e.backstageProvider.translate(e.text))}

    `),behaviours:Sa([vf.config({})])}),n=e=>({dom:{tag:"div",classes:["tox-bar"],styles:{width:`${e}%`}}}),r=e=>({dom:{tag:"div",classes:["tox-text"],innerHtml:`${e}%`}}),s=Ob({dom:{tag:"div",classes:e.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(0)]},r(0)],behaviours:Sa([vf.config({})])}),a={updateProgress:(e,t)=>{e.getSystem().isConnected()&&s.getOpt(e).each((e=>{vf.set(e,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(t)]},r(t)])}))},updateText:(e,t)=>{if(e.getSystem().isConnected()){const n=o.get(e);vf.set(n,[Hl(t)])}}},i=$([e.icon.toArray(),e.level.toArray(),e.level.bind((e=>A.from(Ky[e]))).toArray()]),l=Ob(Eb.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"],attributes:{"aria-label":e.backstageProvider.translate("Close")}},components:[Gy("close",{tag:"span",classes:["tox-icon"]},e.iconProvider)],buttonBehaviours:Sa([Mb.config({}),Zb.config({...e.backstageProvider.tooltips.getConfig({tooltipText:e.backstageProvider.translate("Close")})})]),action:t=>{e.onAction(t)}})),c=((e,t,o)=>{const n=o(),r=j(e,(e=>ve(n,Uy(e,n))));return qy(t,r.getOr(Vy),n,A.none())})(i,{tag:"div",classes:["tox-notification__icon"]},e.iconProvider),d=[c,{dom:{tag:"div",classes:["tox-notification__body"]},components:[o.asSpec()],behaviours:Sa([vf.config({})])}];return{uid:e.uid,dom:{tag:"div",attributes:{role:"alert","aria-labelledby":t},classes:e.level.map((e=>["tox-notification","tox-notification--in",`tox-notification--${e}`])).getOr(["tox-notification","tox-notification--in"])},behaviours:Sa([Mb.config({}),Sf.config({}),lf.config({mode:"special",onEscape:t=>(e.onAction(t),A.some(!0))})]),components:d.concat(e.progress?[s.asSpec()]:[]).concat([l.asSpec()]),apis:a}},configFields:[Sr("level"),hr("progress"),Sr("icon"),hr("onAction"),hr("text"),hr("iconProvider"),hr("backstageProvider")],apis:{updateProgress:(e,t,o)=>{e.updateProgress(t,o)},updateText:(e,t,o)=>{e.updateText(t,o)}}});var Xy=(e,t,o,n)=>{const r=t.backstage.shared,s=()=>{const t=Ko(Be.fromDom(e.getContentAreaContainer()));return A.some(t)},a=e=>{s().each((t=>{F(e,(e=>{Xt(e.element)>t.width&&Mt(e.element,"width",t.width+"px")}))}))};return{open:(t,i,l)=>{const c=()=>{const t=(t,o)=>{dv.hide(t),n.clear(),o&&e.focus()},o=(e,t)=>{t&&lf.focusIn(e)};n.on((e=>{i();const n=l();(e=>{vf.remove(e,d),m()})(e),((e,n)=>{0===at(e.element).length?t(e,n):o(e,n)})(e,n)}))},d=zl(Yy.sketch({text:t.text,level:B(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:t.icon,onAction:c,iconProvider:r.providers.icons,backstageProvider:r.providers}));if(n.isSet()){const e=Vl(d);n.on((t=>{vf.append(t,e),dv.reposition(t),qi.refresh(t),a(t.components())}))}else{const t=zl(dv.sketch({dom:{tag:"div",classes:["tox-notifications-container"],attributes:{"aria-label":"Notifications",role:"region"}},lazySink:r.getSink,fireDismissalEventInstead:{},...r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}},inlineBehaviours:Sa([lf.config({mode:"cyclic",selector:".tox-notification, .tox-notification a, .tox-notification button"}),vf.config({}),...vb(e)&&!r.header.isPositionedAtTop()?[]:[qi.config({contextual:{lazyContext:()=>A.some(Ko(Be.fromDom(e.getContentAreaContainer()))),fadeInClass:"tox-notification-container-dock-fadein",fadeOutClass:"tox-notification-container-dock-fadeout",transitionClass:"tox-notification-container-dock-transition"},modes:["top"],lazyViewport:t=>kb(e,t.element).map((e=>({bounds:_b(e),optScrollEnv:A.some({currentScrollTop:e.element.dom.scrollTop,scrollElmTop:Gt(e.element).top})}))).getOrThunk((()=>({bounds:Jo(),optScrollEnv:A.none()})))})]])})),a=Vl(d),i={maxHeightFunction:yd()},l={...r.anchors.banner(),overrides:i};n.set(t),o.add(t),dv.showWithinBounds(t,a,{anchor:l},s)}p(t.timeout)&&t.timeout>0&&gv.setEditorTimeout(e,(()=>{c()}),t.timeout);const m=()=>{n.on((e=>{dv.reposition(e),qi.refresh(e),a(e.components())}))};return{close:c,reposition:m,text:e=>{Yy.updateText(d,e)},settings:t,getEl:()=>d.element.dom,progressBar:{value:e=>{Yy.updateProgress(d,e)}}}},close:e=>{e.close()},getArgs:e=>e.settings}};const Jy=(e,t)=>{const o=(e,t)=>{Gs(e,ds(),{raw:t})},n=()=>e.getMenu().bind(mh.getHighlighted);t.on("keydown",(t=>{const r=t.which;e.isActive()&&(e.isMenuOpen()?13===r?(n().each(Ks),t.preventDefault()):40===r?(n().fold((()=>{e.getMenu().each(mh.highlightFirst)}),(e=>{o(e,t)})),t.preventDefault(),t.stopImmediatePropagation()):37!==r&&38!==r&&39!==r||n().each((e=>{o(e,t),t.preventDefault(),t.stopImmediatePropagation()})):13!==r&&38!==r&&40!==r||e.cancelIfNecessary())})),t.on("NodeChange",(()=>{!e.isActive()||e.isProcessingAction()||t.queryCommandState("mceAutoCompleterInRange")||e.cancelIfNecessary()}))};var Qy;!function(e){e[e.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",e[e.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(Qy||(Qy={}));var ew=Qy;const tw="tox-menu-nav__js",ow="tox-collection__item",nw="tox-swatch",rw={normal:tw,color:nw},sw="tox-collection__item--enabled",aw="tox-collection__item-icon",iw="tox-collection__item-label",lw="tox-collection__item-caret",cw="tox-collection__item--active",dw="tox-collection__item-container",mw="tox-collection__item-container--row",uw=e=>fe(rw,e).getOr(tw),gw=e=>"color"===e?"tox-swatches":"tox-menu",hw=e=>({backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:gw(e),tieredMenu:"tox-tiered-menu"}),pw=e=>{const t=hw(e);return{backgroundMenu:t.backgroundMenu,selectedMenu:t.selectedMenu,menu:t.menu,selectedItem:t.selectedItem,item:uw(e)}},fw=(e,t,o)=>{const n=hw(o);return{tag:"div",classes:$([[n.menu,`tox-menu-${t}-column`],e?[n.hasIcons]:[]])}},vw=[ev.parts.items({})],bw=(e,t,o)=>{const n=hw(o);return{dom:{tag:"div",classes:$([[n.tieredMenu]])},markers:pw(o)}},yw=w([Sr("data"),Mr("inputAttributes",{}),Mr("inputStyles",{}),Mr("tag","input"),Mr("inputClasses",[]),Fi("onSetValue"),Mr("styles",{}),Mr("eventOrder",{}),Nu("inputBehaviours",[Mu,Sf]),Mr("selectOnFocus",!0)]),ww=e=>Sa([Sf.config({onFocus:e.selectOnFocus?e=>{const t=e.element,o=Sl(t);t.dom.setSelectionRange(0,o.length)}:v})]),xw=e=>({...ww(e),...Bu(e.inputBehaviours,[Mu.config({store:{mode:"manual",...e.data.map((e=>({initialValue:e}))).getOr({}),getValue:e=>Sl(e.element),setValue:(e,t)=>{Sl(e.element)!==t&&kl(e.element,t)}},onSetValue:e.onSetValue})])}),Cw=e=>({tag:e.tag,attributes:{type:"text",...e.inputAttributes},styles:e.inputStyles,classes:e.inputClasses}),Sw=Lg({name:"Input",configFields:yw(),factory:(e,t)=>({uid:e.uid,dom:Cw(e),components:[],behaviours:xw(e),eventOrder:e.eventOrder})}),kw=Xi("refetch-trigger-event"),_w=Xi("redirect-menu-item-interaction"),Ew="tox-menu__searcher",Tw=e=>Yl(e.element,`.${Ew}`).bind((t=>e.getSystem().getByDom(t).toOptional())),Ow=Tw,Aw=e=>({fetchPattern:Mu.getValue(e),selectionStart:e.element.dom.selectionStart,selectionEnd:e.element.dom.selectionEnd}),Dw=e=>{const t=(e,t)=>(t.cut(),A.none()),o=(e,t)=>{const o={interactionEvent:t.event,eventType:t.event.raw.type};return Gs(e,_w,o),A.some(!0)},n="searcher-events";return{dom:{tag:"div",classes:[ow]},components:[Sw.sketch({inputClasses:[Ew,"tox-textfield"],inputAttributes:{...e.placeholder.map((t=>({placeholder:e.i18n(t)}))).getOr({}),type:"search","aria-autocomplete":"list"},inputBehaviours:Sa([bf(n,[oa(us(),(e=>{qs(e,kw)})),oa(ds(),((e,t)=>{"Escape"===t.event.raw.key&&t.stop()}))]),lf.config({mode:"special",onLeft:t,onRight:t,onSpace:t,onEnter:o,onEscape:o,onUp:o,onDown:o})]),eventOrder:{keydown:[n,lf.name()]}})]}},Mw="tox-collection--results__js",Nw=e=>{var t;return e.dom?{...e,dom:{...e.dom,attributes:{...null!==(t=e.dom.attributes)&&void 0!==t?t:{},id:Xi("aria-item-search-result-id"),"aria-selected":"false"}}}:e},Rw=(e,t)=>o=>{const n=I(o,t);return P(n,(t=>({dom:e,components:t})))},Bw=(e,t)=>{const o=[];let n=[];return F(e,((e,r)=>{t(e,r)?(n.length>0&&o.push(n),n=[],(ve(e.dom,"innerHtml")||e.components&&e.components.length>0)&&n.push(e)):n.push(e)})),n.length>0&&o.push(n),P(o,(e=>({dom:{tag:"div",classes:["tox-collection__group"]},components:e})))},Lw=(e,t,o)=>ev.parts.items({preprocess:n=>{const r=P(n,o);return"auto"!==e&&e>1?Rw({tag:"div",classes:["tox-collection__group"]},e)(r):Bw(r,((e,o)=>"separator"===t[o].type))}}),Hw=(e,t,o=!0)=>({dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===e?["tox-collection--list"]:["tox-collection--grid"])},components:[Lw(e,t,x)]}),Iw=e=>L(e,(e=>"icon"in e&&void 0!==e.icon)),Pw=e=>(console.error(lr(e)),console.log(e),A.none()),Fw=(e,t,o,n,r)=>{const s=(a=o,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[ev.parts.items({preprocess:e=>Bw(e,((e,t)=>"separator"===a[t].type))})]});var a;return{value:e,dom:s.dom,components:s.components,items:o}},zw=(e,t,o,n,r)=>{const s=()=>"searchable"!==r.menuType?Hw(n,o):"search-with-field"===r.searchMode.searchMode?((e,t,o)=>{const n=Xi("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===e?["tox-collection--list"]:["tox-collection--grid"])},components:[Dw({i18n:Fy.translate,placeholder:o.placeholder}),{dom:{tag:"div",classes:[...1===e?["tox-collection--list"]:["tox-collection--grid"],Mw],attributes:{id:n}},components:[Lw(e,t,Nw)]}]}})(n,o,r.searchMode):((e,t,o=!0)=>{const n=Xi("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection",Mw].concat(1===e?["tox-collection--list"]:["tox-collection--grid"]),attributes:{id:n}},components:[Lw(e,t,Nw)]}})(n,o);if("color"===r.menuType){const t=(e=>({dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[ev.parts.items({preprocess:"auto"!==e?Rw({tag:"div",classes:["tox-swatches__row"]},e):x})]}]}))(n);return{value:e,dom:t.dom,components:t.components,items:o}}if("normal"===r.menuType&&"auto"===n){const t=Hw(n,o);return{value:e,dom:t.dom,components:t.components,items:o}}if("normal"===r.menuType||"searchable"===r.menuType){const t=s();return{value:e,dom:t.dom,components:t.components,items:o}}if("listpreview"===r.menuType&&"auto"!==n){const t=(e=>({dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[ev.parts.items({preprocess:Rw({tag:"div",classes:["tox-collection__group"]},e)})]}))(n);return{value:e,dom:t.dom,components:t.components,items:o}}return{value:e,dom:fw(t,n,r.menuType),components:vw,items:o}},Vw=vr("type"),Zw=vr("name"),Uw=vr("label"),jw=vr("text"),Ww=vr("title"),$w=vr("icon"),qw=vr("value"),Gw=yr("fetch"),Kw=yr("getSubmenuItems"),Yw=yr("onAction"),Xw=yr("onItemAction"),Jw=Ir("onSetup",(()=>v)),Qw=Er("name"),ex=Er("text"),tx=Er("role"),ox=Er("icon"),nx=Er("tooltip"),rx=Er("label"),sx=Er("shortcut"),ax=Or("select"),ix=Hr("active",!1),lx=Hr("borderless",!1),cx=Hr("enabled",!0),dx=Hr("primary",!1),mx=e=>Mr("columns",e),ux=Mr("meta",{}),gx=Ir("onAction",v),hx=e=>Br("type",e),px=e=>mr("name","name",Tn((()=>Xi(`${e}-name`))),Yn),fx=Zn([Vw,ex]),vx=Zn([hx("autocompleteitem"),ix,cx,ux,qw,ex,ox]),bx=[cx,nx,ox,ex,Jw],yx=Zn([Vw,Yw,sx].concat(bx)),wx=e=>sr("toolbarbutton",yx,e),xx=[ix].concat(bx),Cx=Zn(xx.concat([Vw,Yw,sx])),Sx=e=>sr("ToggleButton",Cx,e),kx=[Ir("predicate",T),Lr("scope","node",["node","editor"]),Lr("position","selection",["node","selection","line"])],_x=bx.concat([hx("contextformbutton"),dx,Yw,ur("original",x)]),Ex=xx.concat([hx("contextformbutton"),dx,Yw,ur("original",x)]),Tx=bx.concat([hx("contextformbutton")]),Ox=xx.concat([hx("contextformtogglebutton")]),Ax=cr("type",{contextformbutton:_x,contextformtogglebutton:Ex}),Dx=Zn([hx("contextform"),Ir("initValue",w("")),rx,Cr("commands",Ax),kr("launch",cr("type",{contextformbutton:Tx,contextformtogglebutton:Ox}))].concat(kx)),Mx=Zn([hx("contexttoolbar"),vr("items")].concat(kx)),Nx=[Vw,vr("src"),Er("alt"),Pr("classes",[],Yn)],Rx=Zn(Nx),Bx=[Vw,jw,Qw,Pr("classes",["tox-collection__item-label"],Yn)],Lx=Zn(Bx),Hx=Fn((()=>or("type",{cardimage:Rx,cardtext:Lx,cardcontainer:Ix}))),Ix=Zn([Vw,Br("direction","horizontal"),Br("align","left"),Br("valign","middle"),Cr("items",Hx)]),Px=[cx,ex,tx,sx,(Fx="menuitem",mr("value","value",Tn((()=>Xi(`${Fx}-value`))),qn())),ux];var Fx;const zx=Zn([Vw,rx,Cr("items",Hx),Jw,gx].concat(Px)),Vx=Zn([Vw,ix,ox].concat(Px)),Zx=[Vw,vr("fancytype"),gx],Ux=[Mr("initData",{})].concat(Zx),jx=[Or("select"),Fr("initData",{},[Hr("allowCustomColors",!0),Br("storageKey","default"),Ar("colors",qn())])].concat(Zx),Wx=cr("fancytype",{inserttable:Ux,colorswatch:jx}),$x=Zn([Vw,Jw,gx,ox].concat(Px)),qx=Zn([Vw,Kw,Jw,ox].concat(Px)),Gx=Zn([Vw,ox,ix,Jw,Yw].concat(Px)),Kx=(e,t,o)=>{const n=sm(e.element,"."+o);if(n.length>0){const e=W(n,(e=>{const o=e.dom.getBoundingClientRect().top,r=n[0].dom.getBoundingClientRect().top;return Math.abs(o-r)>t})).getOr(n.length);return A.some({numColumns:e,numRows:Math.ceil(n.length/e)})}return A.none()},Yx=(e,t)=>Sa([bf(e,t)]),Xx=e=>Yx(Xi("unnamed-events"),e),Jx="silver.readonly",Qx=Zn([(eC="readonly",pr(eC,Xn))]);var eC;const tC=(e,t)=>{const o=e.mainUi.outerContainer.element,n=[e.mainUi.mothership,...e.uiMotherships];t&&F(n,(e=>{e.broadcastOn([uu()],{target:o})})),F(n,(e=>{e.broadcastOn([Jx],{readonly:t})}))},oC=(e,t)=>{e.on("init",(()=>{e.mode.isReadOnly()&&tC(t,!0)})),e.on("SwitchMode",(()=>tC(t,e.mode.isReadOnly()))),wv(e)&&e.mode.set("readonly")},nC=()=>Pc.config({channels:{[Jx]:{schema:Qx,onReceive:(e,t)=>{eh.set(e,t.readonly)}}}}),rC=e=>eh.config({disabled:e,disableClass:"tox-collection__item--state-disabled"}),sC=e=>eh.config({disabled:e}),aC=e=>eh.config({disabled:e,disableClass:"tox-tbtn--disabled"}),iC=e=>eh.config({disabled:e,disableClass:"tox-tbtn--disabled",useNative:!1}),lC=(e,t)=>{const o=e.getApi(t);return e=>{e(o)}},cC=(e,t)=>da((o=>{lC(e,o)((o=>{const n=e.onSetup(o);h(n)&&t.set(n)}))})),dC=(e,t)=>ma((o=>lC(e,o)(t.get()))),mC=(e,t)=>ga(((o,n)=>{lC(e,o)(e.onAction),e.triggersSubmenu||t!==ew.CLOSE_ON_EXECUTE||(o.getSystem().isConnected()&&qs(o,As()),n.stop())})),uC={[_s()]:["disabling","alloy.base.behaviour","toggling","item-events"]},gC=we,hC=(e,t,o,n)=>{const r=Qo(v);return{type:"item",dom:t.dom,components:gC(t.optComponents),data:e.data,eventOrder:uC,hasSubmenu:e.triggersSubmenu,itemBehaviours:Sa([bf("item-events",[mC(e,o),cC(e,r),dC(e,r)]),rC((()=>!e.enabled||n.isDisabled())),nC(),vf.config({})].concat(e.itemBehaviours))}},pC=e=>({value:e.value,meta:{text:e.text.getOr(""),...e.meta}}),fC=e=>{const t=fv.os.isMacOS()||fv.os.isiOS(),o=t?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},n=e.split("+"),r=P(n,(e=>{const t=e.toLowerCase().trim();return ve(o,t)?o[t]:e}));return t?r.join(""):r.join("+")},vC=(e,t,o=[aw])=>Gy(e,{tag:"div",classes:o},t),bC=e=>({dom:{tag:"div",classes:[iw]},components:[Hl(Fy.translate(e))]}),yC=(e,t)=>({dom:{tag:"div",classes:t,innerHtml:e}}),wC=(e,t)=>({dom:{tag:"div",classes:[iw]},components:[{dom:{tag:e.tag,styles:e.styles},components:[Hl(Fy.translate(t))]}]}),xC=e=>({dom:{tag:"div",classes:["tox-collection__item-accessory"]},components:[Hl(fC(e))]}),CC=e=>vC("checkmark",e,["tox-collection__item-checkmark"]),SC=(e,t,o)=>{const n=e.value,r=e.iconContent.map((e=>((e,t,o)=>{const n=t();return jy(e,n).or(o).getOrThunk(Zy(n))})(e,t.icons,o))),s=e.ariaLabel.map((e=>({"aria-label":t.translate(e),"data-mce-name":e}))).getOr({});return{dom:(()=>{const e=nw,t=r.getOr(""),o={tag:"div",attributes:s,classes:[e]};return"custom"===n?{...o,tag:"button",classes:[...o.classes,"tox-swatches__picker-btn"],innerHtml:t}:"remove"===n?{...o,classes:[...o.classes,"tox-swatch--remove"],innerHtml:t}:g(n)?{...o,attributes:{...o.attributes,"data-mce-color":n},styles:{"background-color":n},innerHtml:t}:o})(),optComponents:[]}},kC=e=>{const t=e.map((e=>({attributes:{id:Xi("menu-item"),"aria-label":Fy.translate(e)}}))).getOr({});return{tag:"div",classes:[tw,ow],...t}},_C=(e,t,o,n=A.none())=>"color"===e.presets?SC(e,t,n):((e,t,o,n)=>{const r={tag:"div",classes:[aw]},s=o?e.iconContent.map((e=>Gy(e,r,t.icons,n))).orThunk((()=>A.some({dom:r}))):A.none(),a=e.checkMark,i=A.from(e.meta).fold((()=>bC),(e=>ve(e,"style")?S(wC,e.style):bC)),l=e.htmlContent.fold((()=>e.textContent.map(i)),(e=>A.some(yC(e,[iw]))));return{dom:kC(e.ariaLabel),optComponents:[s,l,e.shortcutContent.map(xC),a,e.caret]}})(e,t,o,n),EC=(e,t,o)=>fe(e,"tooltipWorker").map((e=>[Zb.config({lazySink:t.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:e=>({type:"submenu",item:e,overrides:{maxHeightFunction:yd}}),mode:"follow-highlight",onShow:(t,o)=>{e((e=>{Zb.setComponents(t,[Il({element:Be.fromDom(e)})])}))}})])).getOrThunk((()=>o.map((e=>[Zb.config({...t.providers.tooltips.getConfig({tooltipText:e}),mode:"follow-highlight"})])).getOr([]))),TC=(e,t)=>{const o=(e=>hv.DOM.encode(e))(Fy.translate(e));if(t.length>0){const e=new RegExp((e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t),"gi");return o.replace(e,(e=>`${e}`))}return o},OC=(e,t)=>P(e,(e=>{switch(e.type){case"cardcontainer":return((e,t)=>{const o="vertical"===e.direction?"tox-collection__item-container--column":mw,n="left"===e.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right";return{dom:{tag:"div",classes:[dw,o,n,(()=>{switch(e.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}})()]},components:t}})(e,OC(e.items,t));case"cardimage":return((e,t,o)=>({dom:{tag:"img",classes:t,attributes:{src:e,alt:o.getOr("")}}}))(e.src,e.classes,e.alt);case"cardtext":const o=e.name.exists((e=>B(t.cardText.highlightOn,e))),n=o?A.from(t.cardText.matchText).getOr(""):"";return yC(TC(e.text,n),e.classes)}})),AC=hg(qf(),Gf()),DC=e=>({value:BC(e)}),MC=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,NC=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,RC=e=>MC.test(e)||NC.test(e),BC=e=>_e(e,"#").toUpperCase(),LC=e=>{const t=(e=>{const t=e.value.replace(MC,((e,t,o,n)=>t+t+o+o+n+n));return{value:t}})(e),o=NC.exec(t.value);return null===o?["FFFFFF","FF","FF","FF"]:o},HC=e=>{const t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},IC=e=>{const t=HC(e.red)+HC(e.green)+HC(e.blue);return DC(t)},PC=Math.min,FC=Math.max,zC=Math.round,VC=/^\s*rgb\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*\)\s*$/i,ZC=/^\s*rgba\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*((?:\d?\.\d+|\d+)%?)\s*\)\s*$/i,UC=(e,t,o,n)=>({red:e,green:t,blue:o,alpha:n}),jC=e=>{const t=parseInt(e,10);return t.toString()===e&&t>=0&&t<=255},WC=e=>{let t,o,n;const r=(e.hue||0)%360;let s=e.saturation/100,a=e.value/100;if(s=FC(0,PC(s,1)),a=FC(0,PC(a,1)),0===s)return t=o=n=zC(255*a),UC(t,o,n,1);const i=r/60,l=a*s,c=l*(1-Math.abs(i%2-1)),d=a-l;switch(Math.floor(i)){case 0:t=l,o=c,n=0;break;case 1:t=c,o=l,n=0;break;case 2:t=0,o=l,n=c;break;case 3:t=0,o=c,n=l;break;case 4:t=c,o=0,n=l;break;case 5:t=l,o=0,n=c;break;default:t=o=n=0}return t=zC(255*(t+d)),o=zC(255*(o+d)),n=zC(255*(n+d)),UC(t,o,n,1)},$C=e=>{const t=LC(e),o=parseInt(t[1],16),n=parseInt(t[2],16),r=parseInt(t[3],16);return UC(o,n,r,1)},qC=(e,t,o,n)=>{const r=parseInt(e,10),s=parseInt(t,10),a=parseInt(o,10),i=parseFloat(n);return UC(r,s,a,i)},GC=e=>{const t=VC.exec(e);if(null!==t)return A.some(qC(t[1],t[2],t[3],"1"));const o=ZC.exec(e);return null!==o?A.some(qC(o[1],o[2],o[3],o[4])):A.none()},KC=e=>`rgba(${e.red},${e.green},${e.blue},${e.alpha})`,YC=UC(255,0,0,1),XC=(e,t)=>{e.dispatch("ResizeContent",t)},JC=(e,t)=>{e.dispatch("TextColorChange",t)},QC=(e,t)=>e.dispatch("ResolveName",{name:t.nodeName.toLowerCase(),target:t}),eS=(e,t)=>()=>{e(),t()},tS=e=>nS(e,"NodeChange",(t=>{t.setEnabled(e.selection.isEditable())})),oS=(e,t)=>o=>{const n=tS(e)(o),r=((e,t)=>o=>{const n=tn(),r=()=>{o.setActive(e.formatter.match(t));const r=e.formatter.formatChanged(t,o.setActive);n.set(r)};return e.initialized?r():e.once("init",r),()=>{e.off("init",r),n.clear()}})(e,t)(o);return()=>{n(),r()}},nS=(e,t,o)=>n=>{const r=()=>o(n),s=()=>{o(n),e.on(t,r)};return e.initialized?s():e.once("init",s),()=>{e.off("init",s),e.off(t,r)}},rS=e=>t=>()=>{e.undoManager.transact((()=>{e.focus(),e.execCommand("mceToggleFormat",!1,t.format)}))},sS=(e,t)=>()=>e.execCommand(t);var aS=tinymce.util.Tools.resolve("tinymce.util.LocalStorage");const iS={},lS=(e,t=10)=>{const o=aS.getItem(e),n=s(o)?JSON.parse(o):[],r=t-(a=n).length<0?a.slice(0,t):a;var a;const i=e=>{r.splice(e,1)};return{add:o=>{((e,t)=>{const o=R(e,t);return-1===o?A.none():A.some(o)})(r,o).each(i),r.unshift(o),r.length>t&&r.pop(),aS.setItem(e,JSON.stringify(r))},state:()=>r.slice(0)}},cS=e=>fe(iS,e).getOrThunk((()=>{const t=`tinymce-custom-colors-${e}`,o=aS.getItem(t);if(u(o)){const e=aS.getItem("tinymce-custom-colors");aS.setItem(t,g(e)?e:"[]")}const n=lS(t,10);return iS[e]=n,n})),dS=(e,t)=>{cS(e).add(t)},mS=(e,t,o)=>({hue:e,saturation:t,value:o}),uS=e=>{let t=0,o=0,n=0;const r=e.red/255,s=e.green/255,a=e.blue/255,i=Math.min(r,Math.min(s,a)),l=Math.max(r,Math.max(s,a));if(i===l)return n=i,mS(0,0,100*n);return t=r===i?3:a===i?1:5,t=60*(t-(r===i?s-a:a===i?r-s:a-r)/(l-i)),o=(l-i)/l,n=l,mS(Math.round(t),Math.round(100*o),Math.round(100*n))},gS=e=>IC(WC(e)),hS=e=>{return(t=e,RC(t)?A.some({value:BC(t)}):A.none()).orThunk((()=>GC(e).map(IC))).getOrThunk((()=>{const t=document.createElement("canvas");t.height=1,t.width=1;const o=t.getContext("2d");o.clearRect(0,0,t.width,t.height),o.fillStyle="#FFFFFF",o.fillStyle=e,o.fillRect(0,0,1,1);const n=o.getImageData(0,0,1,1).data,r=n[0],s=n[1],a=n[2],i=n[3];return IC(UC(r,s,a,i))}));var t},pS="forecolor",fS="hilitecolor",vS=e=>{const t=[];for(let o=0;ot=>t.options.get(e),yS="#000000",wS=(e,t)=>t===pS&&e.options.isSet("color_map_foreground")?bS("color_map_foreground")(e):t===fS&&e.options.isSet("color_map_background")?bS("color_map_background")(e):bS("color_map")(e),xS=(e,t="default")=>Math.max(5,Math.ceil(Math.sqrt(wS(e,t).length))),CS=(e,t)=>{const o=bS("color_cols")(e),n=xS(e,t);return o===xS(e)?n:o},SS=(e,t="default")=>Math.round(t===pS?bS("color_cols_foreground")(e):t===fS?bS("color_cols_background")(e):bS("color_cols")(e)),kS=bS("custom_colors"),_S=bS("color_default_foreground"),ES=bS("color_default_background"),TS=e=>qr(e,(e=>{if(Ue(e)){const t=Bt(e,"background-color");return Se((e=>GC(e).exists((e=>0!==e.alpha)))(t),t)}return A.none()})).getOr("rgba(0, 0, 0, 0)"),OS=(e,t)=>{const o=Be.fromDom(e.selection.getStart()),n="hilitecolor"===t?TS(o):Bt(o,"color");return GC(n).map((e=>"#"+IC(e).value))},AS=e=>{const t="choiceitem",o={type:t,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return e?[o,{type:t,text:"Custom color",icon:"color-picker",value:"custom"}]:[o]},DS=(e,t,o,n)=>{if("custom"===o){FS(e)((o=>{o.each((o=>{dS(t,o),e.execCommand("mceApplyTextcolor",t,o),n(o)}))}),OS(e,t).getOr(yS))}else"remove"===o?(n(""),e.execCommand("mceRemoveTextcolor",t)):(n(o),e.execCommand("mceApplyTextcolor",t,o))},MS=(e,t,o)=>e.concat((e=>P(cS(e).state(),(e=>({type:"choiceitem",text:e,icon:"checkmark",value:e}))))(t).concat(AS(o))),NS=(e,t,o)=>n=>{n(MS(e,t,o))},RS=(e,t,o)=>{const n="forecolor"===t?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";e.setIconFill(n,o)},BS=(e,t)=>{e.setTooltip(t)},LS=(e,t)=>o=>{const n=OS(e,t);return ye(n,o.toUpperCase())},HS=(e,t,o)=>{if(Me(o))return"forecolor"===t?"Text color":"Background color";const n="forecolor"===t?"Text color {0}":"Background color {0}",r=MS(wS(e,t),t,!1),s=j(r,(e=>e.value===o)).getOr({text:""}).text;return e.translate([n,e.translate(s)])},IS=(e,t,o,n)=>{e.ui.registry.addSplitButton(t,{tooltip:HS(e,o,n.get()),presets:"color",icon:"forecolor"===t?"text-color":"highlight-bg-color",select:LS(e,o),columns:SS(e,o),fetch:NS(wS(e,o),o,kS(e)),onAction:t=>{DS(e,o,n.get(),v)},onItemAction:(r,s)=>{DS(e,o,s,(o=>{n.set(o),JC(e,{name:t,color:o})}))},onSetup:r=>{RS(r,t,n.get());const s=n=>{n.name===t&&(RS(r,n.name,n.color),BS(r,HS(e,o,n.color)))};return e.on("TextColorChange",s),eS(tS(e)(r),(()=>{e.off("TextColorChange",s)}))}})},PS=(e,t,o,n,r)=>{e.ui.registry.addNestedMenuItem(t,{text:n,icon:"forecolor"===t?"text-color":"highlight-bg-color",onSetup:n=>(BS(n,HS(e,o,r.get())),RS(n,t,r.get()),tS(e)(n)),getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"colorswatch",select:LS(e,o),initData:{storageKey:o},onAction:n=>{DS(e,o,n.value,(o=>{r.set(o),JC(e,{name:t,color:o})}))}}]})},FS=e=>(t,o)=>{let n=!1;const r={colorpicker:o};e.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onAction:(e,t)=>{"hex-valid"===t.name&&(n=t.value)},onSubmit:o=>{const r=o.getData().colorpicker;n?(t(A.from(r)),o.close()):e.windowManager.alert(e.translate(["Invalid hex color code: {0}",r]))},onClose:v,onCancel:()=>{t(A.none())}})},zS=(e,t,o,n,r,s,a,i)=>{const l=Iw(t),c=VS(t,o,n,"color"!==r?"normal":"color",s,a,i);return zw(e,l,c,n,{menuType:r})},VS=(e,t,o,n,r,s,a)=>we(P(e,(i=>{return"choiceitem"===i.type?(l=i,sr("choicemenuitem",Vx,l)).fold(Pw,(i=>A.some(((e,t,o,n,r,s,a,i=!0)=>{const l=_C({presets:o,textContent:t?e.text:A.none(),htmlContent:A.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:t?e.shortcut:A.none(),checkMark:t?A.some(CC(a.icons)):A.none(),caret:A.none(),value:e.value},a,i),c=e.text.filter(w(!t)).map((e=>Zb.config(a.tooltips.getConfig({tooltipText:a.translate(e)}))));return _n(hC({data:pC(e),enabled:e.enabled,getApi:e=>({setActive:t=>{Mf.set(e,t)},isActive:()=>Mf.isOn(e),isEnabled:()=>!eh.isDisabled(e),setEnabled:t=>eh.set(e,!t)}),onAction:t=>n(e.value),onSetup:e=>(e.setActive(r),v),triggersSubmenu:!1,itemBehaviours:[...c.toArray()]},l,s,a),{toggling:{toggleClass:sw,toggleOnExecute:!1,selected:e.active,exclusive:!0}})})(i,1===o,n,t,s(i.value),r,a,Iw(e))))):A.none();var l}))),ZS=(e,t)=>{const o=pw(t);if(1===e)return{mode:"menu",moveOnTab:!0};if("auto"===e)return{mode:"grid",selector:"."+o.item,initSize:{numColumns:1,numRows:1}};return{mode:"matrix",rowSelector:"."+("color"===t?"tox-swatches__row":"tox-collection__group"),previousSelector:e=>"color"===t?Yl(e.element,"[aria-checked=true]"):A.none()}},US=(e,t)=>{const o=e.initData.allowCustomColors&&t.colorinput.hasCustomColors();return e.initData.colors.fold((()=>MS(t.colorinput.getColors(e.initData.storageKey),e.initData.storageKey,o)),(e=>e.concat(AS(o))))},jS=Xi("cell-over"),WS=Xi("cell-execute"),$S=(e,t,o)=>{const n=o=>Gs(o,WS,{row:e,col:t}),r=(e,t)=>{t.stop(),n(e)};return zl({dom:{tag:"div",attributes:{role:"button","aria-label":o}},behaviours:Sa([bf("insert-table-picker-cell",[oa(is(),Sf.focus),oa(_s(),n),oa(hs(),r),oa(Ts(),r)]),Mf.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Sf.config({onFocus:o=>Gs(o,jS,{row:e,col:t})})])})},qS=e=>q(e,(e=>P(e,Vl))),GS=(e,t)=>Hl(`${t}x${e}`),KS={inserttable:(e,t)=>{const o=(e=>(t,o)=>e.shared.providers.translate(["{0} columns, {1} rows",o,t]))(t),n=((e,t,o)=>{const n=[];for(let r=0;r{vf.set(s.get(e),[r])})),aa(jS,((e,t,o)=>{const{row:r,col:a}=o.event;((e,t,o,n,r)=>{for(let s=0;s{const{row:r,col:s}=n.event;e.onAction({numRows:r+1,numColumns:s+1}),qs(t,As())}))]),lf.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:(e,t)=>{const o=US(e,t),n=t.colorinput.getColorCols(e.initData.storageKey),r="color",s=zS(Xi("menu-value"),o,(t=>{e.onAction({value:t})}),n,r,ew.CLOSE_ON_EXECUTE,e.select.getOr(T),t.shared.providers),a={...s,markers:pw(r),movement:ZS(n,r),showMenuRole:!1};return{type:"widget",data:{value:Xi("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[AC.widget(ev.sketch(a))]}}},YS=(e,t,o,n,r,s,a,i=!0)=>{const l=_C({presets:n,textContent:A.none(),htmlContent:o?e.text.map((e=>TC(e,t))):A.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:A.none(),checkMark:A.none(),caret:A.none(),value:e.value},a.providers,i,e.icon),c=e.text.filter((e=>!o&&""!==e));return hC({data:pC(e),enabled:e.enabled,getApi:w({}),onAction:t=>r(e.value,e.meta),onSetup:w(v),triggersSubmenu:!1,itemBehaviours:EC(e,a,c)},l,s,a.providers)},XS=e=>({type:"separator",dom:{tag:"div",classes:[ow,"tox-collection__group-heading"]},components:e.text.map(Hl).toArray()}),JS=(e,t,o,n=!0)=>{const r=_C({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:A.none(),ariaLabel:e.text,caret:A.none(),checkMark:A.none(),shortcutContent:e.shortcut},o,n);return hC({data:pC(e),getApi:e=>({isEnabled:()=>!eh.isDisabled(e),setEnabled:t=>eh.set(e,!t)}),enabled:e.enabled,onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,t,o)},QS=(e,t,o,n=!0,r=!1)=>{const s=r?(a=o.icons,vC("chevron-down",a,[lw])):(e=>vC("chevron-right",e,[lw]))(o.icons);var a;const i=_C({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:A.none(),ariaLabel:e.text,caret:A.some(s),checkMark:A.none(),shortcutContent:e.shortcut},o,n);return hC({data:pC(e),getApi:e=>({isEnabled:()=>!eh.isDisabled(e),setEnabled:t=>eh.set(e,!t),setIconFill:(t,o)=>{Yl(e.element,`svg path[class="${t}"], rect[class="${t}"]`).each((e=>{St(e,"fill",o)}))},setTooltip:t=>{const n=o.translate(t);St(e.element,"aria-label",n)}}),enabled:e.enabled,onAction:v,onSetup:e.onSetup,triggersSubmenu:!0,itemBehaviours:[]},i,t,o)},ek=(e,t,o,n=!0)=>{const r=_C({iconContent:e.icon,textContent:e.text,htmlContent:A.none(),ariaLabel:e.text,checkMark:A.some(CC(o.icons)),caret:A.none(),shortcutContent:e.shortcut,presets:"normal",meta:e.meta},o,n);return _n(hC({data:pC(e),enabled:e.enabled,getApi:e=>({setActive:t=>{Mf.set(e,t)},isActive:()=>Mf.isOn(e),isEnabled:()=>!eh.isDisabled(e),setEnabled:t=>eh.set(e,!t)}),onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,t,o),{toggling:{toggleClass:sw,toggleOnExecute:!1,selected:e.active},role:e.role.getOrUndefined()})},tk=(e,t)=>fe(KS,e.fancytype).map((o=>o(e,t))),ok=(e,t,o,n)=>{const r={dom:kC(e.label),optComponents:[A.some({dom:{tag:"div",classes:[dw,mw]},components:OC(e.items,n)})]};return hC({data:pC({text:A.none(),...e}),enabled:e.enabled,getApi:e=>({isEnabled:()=>!eh.isDisabled(e),setEnabled:t=>{eh.set(e,!t),F(sm(e.element,"*"),(o=>{e.getSystem().getByDom(o).each((e=>{e.hasConfigured(eh)&&eh.set(e,!t)}))}))}}),onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:A.from(n.itemBehaviours).getOr([])},r,t,o.providers)};var nk=Object.freeze({__proto__:null,getCoupled:(e,t,o,n)=>o.getOrCreate(e,t,n),getExistingCoupled:(e,t,o,n)=>o.getExisting(e,t,n)}),rk=[pr("others",rr(an.value,qn()))];var sk=Object.freeze({__proto__:null,init:()=>{const e={},t=(t,o)=>{if(0===se(t.others).length)throw new Error("Cannot find any known coupled components");return fe(e,o)},o=w({});return Ca({readState:o,getExisting:(e,o,n)=>t(o,n).orThunk((()=>(fe(o.others,n).getOrDie("No information found for coupled component: "+n),A.none()))),getOrCreate:(o,n,r)=>t(n,r).getOrThunk((()=>{const t=fe(n.others,r).getOrDie("No information found for coupled component: "+r)(o),s=o.getSystem().build(t);return e[r]=s,s}))})}});const ak=_a({fields:rk,name:"coupling",apis:nk,state:sk}),ik=e=>{let t=A.none(),o=[];const n=e=>{r()?a(e):o.push(e)},r=()=>t.isSome(),s=e=>{F(e,a)},a=e=>{t.each((t=>{setTimeout((()=>{e(t)}),0)}))};return e((e=>{r()||(t=A.some(e),s(o),o=[])})),{get:n,map:e=>ik((t=>{n((o=>{t(e(o))}))})),isReady:r}},lk={nu:ik,pure:e=>ik((t=>{t(e)}))},ck=e=>{setTimeout((()=>{throw e}),0)},dk=e=>{const t=t=>{e().then(t,ck)};return{map:t=>dk((()=>e().then(t))),bind:t=>dk((()=>e().then((e=>t(e).toPromise())))),anonBind:t=>dk((()=>e().then((()=>t.toPromise())))),toLazy:()=>lk.nu(t),toCached:()=>{let t=null;return dk((()=>(null===t&&(t=e()),t)))},toPromise:e,get:t}},mk=e=>dk((()=>new Promise(e))),uk=e=>dk((()=>Promise.resolve(e))),gk=w("sink"),hk=w(cg({name:gk(),overrides:w({dom:{tag:"div"},behaviours:Sa([Pm.config({useFixed:O})]),events:Qs([ia(ds()),ia(ns()),ia(hs())])})})),pk=(e,t)=>{const o=e.getHotspot(t).getOr(t),n="hotspot",r=e.getAnchorOverrides();return e.layouts.fold((()=>({type:n,hotspot:o,overrides:r})),(e=>({type:n,hotspot:o,overrides:r,layouts:e})))},fk=(e,t,o,n,r,s,a)=>{const i=((e,t,o,n,r,s,a)=>{const i=((e,t,o)=>(0,e.fetch)(o).map(t))(e,t,n),l=wk(n,e);return i.map((t=>t.bind((t=>{const i=t.menus[t.primary];return A.from(i).each((t=>{e.listRole.each((e=>{t.role=e}))})),A.from(cv.sketch({...s.menu(),uid:rl(""),data:t,highlightOnOpen:a,onOpenMenu:(e,t)=>{const n=l().getOrDie();Pm.position(n,t,{anchor:o}),mu.decloak(r)},onOpenSubmenu:(e,t,o)=>{const n=l().getOrDie();Pm.position(n,o,{anchor:{type:"submenu",item:t}}),mu.decloak(r)},onRepositionMenu:(e,t,n)=>{const r=l().getOrDie();Pm.position(r,t,{anchor:o}),F(n,(e=>{Pm.position(r,e.triggeredMenu,{anchor:{type:"submenu",item:e.triggeringItem}})}))},onEscape:()=>(Sf.focus(n),mu.close(r),A.some(!0))}))}))))})(e,t,pk(e,o),o,n,r,a);return i.map((e=>(e.fold((()=>{mu.isOpen(n)&&mu.close(n)}),(e=>{mu.cloak(n),mu.open(n,e),s(n)})),n)))},vk=(e,t,o,n,r,s,a)=>(mu.close(n),uk(n)),bk=(e,t,o,n,r,s)=>{const a=ak.getCoupled(o,"sandbox");return(mu.isOpen(a)?vk:fk)(e,t,o,a,n,r,s)},yk=(e,t,o)=>{const n=zg.getCurrent(t).getOr(t),r=Xt(e.element);o?Mt(n.element,"min-width",r+"px"):((e,t)=>{Yt.set(e,t)})(n.element,r)},wk=(e,t)=>e.getSystem().getByUid(t.uid+"-"+gk()).map((e=>()=>an.value(e))).getOrThunk((()=>t.lazySink.fold((()=>()=>an.error(new Error("No internal sink is specified, nor could an external sink be found"))),(t=>()=>t(e))))),xk=e=>{mu.getState(e).each((e=>{cv.repositionMenus(e)}))},Ck=(e,t,o)=>{const n=Ql(),r=wk(t,e);return{dom:{tag:"div",classes:e.sandboxClasses,attributes:{id:n.id}},behaviours:Hu(e.sandboxBehaviours,[Mu.config({store:{mode:"memory",initialValue:t}}),mu.config({onOpen:(r,s)=>{const a=pk(e,t);n.link(t.element),e.matchWidth&&yk(a.hotspot,s,e.useMinWidth),e.onOpen(a,r,s),void 0!==o&&void 0!==o.onOpen&&o.onOpen(r,s)},onClose:(e,s)=>{n.unlink(t.element),r().getOr(s).element.dom.dispatchEvent(new window.FocusEvent("focusout")),void 0!==o&&void 0!==o.onClose&&o.onClose(e,s)},isPartOf:(e,o,n)=>tc(o,n)||tc(t,n),getAttachPoint:()=>r().getOrDie()}),zg.config({find:e=>mu.getState(e).bind((e=>zg.getCurrent(e)))}),Pc.config({channels:{...fu({isExtraPart:T}),...bu({doReposition:xk})}})])}},Sk=e=>{const t=ak.getCoupled(e,"sandbox");xk(t)},kk=()=>[Mr("sandboxClasses",[]),Lu("sandboxBehaviours",[zg,Pc,mu,Mu])],_k=w([hr("dom"),hr("fetch"),Fi("onOpen"),zi("onExecute"),Mr("getHotspot",A.some),Mr("getAnchorOverrides",w({})),Md(),Nu("dropdownBehaviours",[Mf,ak,lf,Sf]),hr("toggleClass"),Mr("eventOrder",{}),Sr("lazySink"),Mr("matchWidth",!1),Mr("useMinWidth",!1),Sr("role"),Sr("listRole")].concat(kk())),Ek=w([lg({schema:[Hi(),Mr("fakeFocus",!1)],name:"menu",defaults:e=>({onExecute:e.onExecute})}),hk()]),Tk=Hg({name:"Dropdown",configFields:_k(),partFields:Ek(),factory:(e,t,o,n)=>{const r=e=>{mu.getState(e).each((e=>{cv.highlightPrimary(e)}))},s=(t,o,r)=>bk(e,x,t,n,o,r),a={expand:e=>{Mf.isOn(e)||s(e,v,iv.HighlightNone).get(v)},open:e=>{Mf.isOn(e)||s(e,v,iv.HighlightMenuAndItem).get(v)},refetch:t=>ak.getExistingCoupled(t,"sandbox").fold((()=>s(t,v,iv.HighlightMenuAndItem).map(v)),(o=>fk(e,x,t,o,n,v,iv.HighlightMenuAndItem).map(v))),isOpen:Mf.isOn,close:e=>{Mf.isOn(e)&&s(e,v,iv.HighlightMenuAndItem).get(v)},repositionMenus:e=>{Mf.isOn(e)&&Sk(e)}},i=(e,t)=>(Ks(e),A.some(!0));return{uid:e.uid,dom:e.dom,components:t,behaviours:Bu(e.dropdownBehaviours,[Mf.config({toggleClass:e.toggleClass,aria:{mode:"expanded"}}),ak.config({others:{sandbox:t=>Ck(e,t,{onOpen:()=>Mf.on(t),onClose:()=>Mf.off(t)})}}),lf.config({mode:"special",onSpace:i,onEnter:i,onDown:(e,t)=>{if(Tk.isOpen(e)){const t=ak.getCoupled(e,"sandbox");r(t)}else Tk.open(e);return A.some(!0)},onEscape:(e,t)=>Tk.isOpen(e)?(Tk.close(e),A.some(!0)):A.none()}),Sf.config({})]),events:Bf(A.some((e=>{s(e,r,iv.HighlightMenuAndItem).get(v)}))),eventOrder:{...e.eventOrder,[_s()]:["disabling","toggling","alloy.base.behaviour"]},apis:a,domModification:{attributes:{"aria-haspopup":e.listRole.getOr("true"),...e.role.fold((()=>({})),(e=>({role:e}))),..."button"===e.dom.tag?{type:(l="type",fe(e.dom,"attributes").bind((e=>fe(e,l)))).getOr("button")}:{}}}};var l},apis:{open:(e,t)=>e.open(t),refetch:(e,t)=>e.refetch(t),expand:(e,t)=>e.expand(t),close:(e,t)=>e.close(t),isOpen:(e,t)=>e.isOpen(t),repositionMenus:(e,t)=>e.repositionMenus(t)}}),Ok=e=>{const t=Mu.getValue(e),o=Tw(e).map(Aw);Tk.refetch(t).get((()=>{const e=ak.getCoupled(t,"sandbox");o.each((t=>Tw(e).each((e=>((e,t)=>{Mu.setValue(e,t.fetchPattern),e.element.dom.selectionStart=t.selectionStart,e.element.dom.selectionEnd=t.selectionEnd})(e,t)))))}))},Ak=e=>mu.getState(e).bind(mh.getHighlighted).bind(mh.getHighlighted),Dk=(e,t,o)=>{Ow(e).each((e=>{((e,t)=>{Et(t.element,"id").each((t=>St(e.element,"aria-activedescendant",t)))})(e,o);var n;(Pa((n=t).element,Mw)?A.some(n.element):Yl(n.element,"."+Mw)).each((t=>{Et(t,"id").each((t=>St(e.element,"aria-controls",t)))}))})),St(o.element,"aria-selected","true")},Mk=(e,t,o)=>{St(o.element,"aria-selected","false")},Nk=e=>ak.getExistingCoupled(e,"sandbox").bind(Tw).map(Aw).map((e=>e.fetchPattern)).getOr("");var Rk;!function(e){e[e.ContentFocus=0]="ContentFocus",e[e.UiFocus=1]="UiFocus"}(Rk||(Rk={}));const Bk=(e,t,o,n,r)=>{const s=o.shared.providers,a=e=>r?{...e,shortcut:A.none(),icon:e.text.isSome()?A.none():e.icon}:e;switch(e.type){case"menuitem":return(i=e,sr("menuitem",$x,i)).fold(Pw,(e=>A.some(JS(a(e),t,s,n))));case"nestedmenuitem":return(e=>sr("nestedmenuitem",qx,e))(e).fold(Pw,(e=>A.some(QS(a(e),t,s,n,r))));case"togglemenuitem":return(e=>sr("togglemenuitem",Gx,e))(e).fold(Pw,(e=>A.some(ek(a(e),t,s,n))));case"separator":return(e=>sr("separatormenuitem",fx,e))(e).fold(Pw,(e=>A.some(XS(e))));case"fancymenuitem":return(e=>sr("fancymenuitem",Wx,e))(e).fold(Pw,(e=>tk(e,o)));default:return console.error("Unknown item in general menu",e),A.none()}var i},Lk=(e,t,o,n,r,s,a)=>{const i=1===n,l=!i||Iw(e);return we(P(e,(e=>{switch(e.type){case"separator":return(n=e,sr("Autocompleter.Separator",fx,n)).fold(Pw,(e=>A.some(XS(e))));case"cardmenuitem":return(e=>sr("cardmenuitem",zx,e))(e).fold(Pw,(e=>A.some(ok({...e,onAction:t=>{e.onAction(t),o(e.value,e.meta)}},r,s,{itemBehaviours:EC(e.meta,s,A.none()),cardText:{matchText:t,highlightOn:a}}))));default:return(e=>sr("Autocompleter.Item",vx,e))(e).fold(Pw,(e=>A.some(YS(e,t,i,"normal",o,r,s,l))))}var n})))},Hk=(e,t,o,n,r,s)=>{const a=Iw(t),i=we(P(t,(e=>{const t=e=>Bk(e,o,n,(e=>r?!ve(e,"text"):a)(e),r);return"nestedmenuitem"===e.type&&e.getSubmenuItems().length<=0?t({...e,enabled:!1}):t(e)}))),l=(e=>"no-search"===e.searchMode?{menuType:"normal"}:{menuType:"searchable",searchMode:e})(s);return(r?Fw:zw)(e,a,i,1,l)},Ik=e=>cv.singleData(e.value,e),Pk=e=>$d(Be.fromDom(e.startContainer),e.startOffset,Be.fromDom(e.endContainer),e.endOffset),Fk=(e,t)=>{const o=Xi("autocompleter"),n=Qo(!1),r=Qo(!1),s=on(),a=zl(dv.sketch({dom:{tag:"div",classes:["tox-autocompleter"],attributes:{id:o}},components:[],fireDismissalEventInstead:{},inlineBehaviours:Sa([bf("dismissAutocompleter",[oa(Ps(),(()=>m())),oa(Ws(),((t,o)=>{Et(o.event.target,"id").each((t=>St(Be.fromDom(e.getBody()),"aria-activedescendant",t)))}))])]),lazySink:t.getSink})),i=()=>dv.isOpen(a),l=r.get,c=()=>{if(i()){dv.hide(a),e.dom.remove(o,!1);const t=Be.fromDom(e.getBody());Et(t,"aria-owns").filter((e=>e===o)).each((()=>{Ot(t,"aria-owns"),Ot(t,"aria-activedescendant")}))}},d=()=>dv.getContent(a).bind((e=>ee(e.components(),0))),m=()=>e.execCommand("mceAutocompleterClose"),u=(t,o)=>{const n=re(t,(e=>A.from(e.columns))).getOr(1);dv.showMenuAt(a,{anchor:{type:"selection",getSelection:()=>s.get().map(Pk),root:Be.fromDom(e.getBody())}},((e,t,o,n)=>{const r=ZS(t,n),s=pw(n);return{data:Ik({...e,movement:r,menuBehaviours:Xx("auto"!==t?[]:[da(((e,t)=>{Kx(e,4,s.item).each((({numColumns:t,numRows:o})=>{lf.setGridSize(e,o,t)}))}))])}),menu:{markers:pw(n),fakeFocus:o===Rk.ContentFocus}}})(zw("autocompleter-value",!0,o,n,{menuType:"normal"}),n,Rk.ContentFocus,"normal")),d().each(mh.highlightFirst)},g=r=>{const a=(o=>{const r=re(o,(e=>A.from(e.columns))).getOr(1);return q(o,(o=>{const a=o.items;return Lk(a,o.matchText,((t,r)=>{const a={hide:()=>m(),reload:t=>{c(),e.execCommand("mceAutocompleterReload",!1,{fetchOptions:t})}};e.execCommand("mceAutocompleterRefreshActiveRange"),s.get().each((e=>{n.set(!0),o.onAction(a,e,t,r),n.set(!1)}))}),r,ew.BUBBLE_TO_SANDBOX,t,o.highlightOn)}))})(r);a.length>0?(u(r,a),St(Be.fromDom(e.getBody()),"aria-owns",o),e.inline||h()):c()},h=()=>{e.dom.get(o)&&e.dom.remove(o,!1);const t=e.getDoc().documentElement,n=e.selection.getNode(),r=(e=>Ci(e,!0))(a.element);Nt(r,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",top:`${n.offsetTop}px`,left:`${n.offsetLeft}px`}),e.dom.add(t,r.dom),Yl(r,'[role="menu"]').each((e=>{Ft(e,"position"),Ft(e,"max-height")}))};e.on("AutocompleterStart",(({lookupData:e})=>{r.set(!0),n.set(!1),g(e)})),e.on("AutocompleterUpdate",(({lookupData:e})=>g(e))),e.on("AutocompleterUpdateActiveRange",(({range:e})=>s.set(e))),e.on("AutocompleterEnd",(()=>{c(),r.set(!1),n.set(!1),s.clear()}));const p={cancelIfNecessary:m,isMenuOpen:i,isActive:l,isProcessingAction:n.get,getMenu:d};Jy(p,e)},zk=(e,t,o)=>Xl(e,t,o).isSome(),Vk=(e,t)=>{let o=null;return{cancel:()=>{null!==o&&(clearTimeout(o),o=null)},schedule:(...n)=>{o=setTimeout((()=>{e.apply(null,n),o=null}),t)}}},Zk=e=>{const t=e.raw;return void 0===t.touches||1!==t.touches.length?A.none():A.some(t.touches[0])},Uk=e=>{const t=on(),o=Qo(!1),n=Vk((t=>{e.triggerEvent(Os(),t),o.set(!0)}),400),r=Ur([{key:Qr(),value:e=>(Zk(e).each((r=>{n.cancel();const s={x:r.clientX,y:r.clientY,target:e.target};n.schedule(e),o.set(!1),t.set(s)})),A.none())},{key:es(),value:e=>(n.cancel(),Zk(e).each((e=>{t.on((o=>{((e,t)=>{const o=Math.abs(e.clientX-t.x),n=Math.abs(e.clientY-t.y);return o>5||n>5})(e,o)&&t.clear()}))})),A.none())},{key:ts(),value:r=>{n.cancel();return t.get().filter((e=>Xe(e.target,r.target))).map((t=>o.get()?(r.prevent(),!1):e.triggerEvent(Ts(),r)))}}]);return{fireIfReady:(e,t)=>fe(r,t).bind((t=>t(e)))}},jk=(e,t)=>{const o={stopBackspace:!0,...t},n=Uk(o),r=P(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(t=>ad(e,t,(e=>{n.fireIfReady(e,t).each((t=>{t&&e.kill()}));o.triggerEvent(t,e)&&e.kill()})))),s=on(),a=ad(e,"paste",(e=>{n.fireIfReady(e,"paste").each((t=>{t&&e.kill()}));o.triggerEvent("paste",e)&&e.kill(),s.set(setTimeout((()=>{o.triggerEvent(Ss(),e)}),0))})),i=ad(e,"keydown",(e=>{o.triggerEvent("keydown",e)?e.kill():o.stopBackspace&&(e=>e.raw.which===uh[0]&&!B(["input","textarea"],ze(e.target))&&!zk(e.target,'[contenteditable="true"]'))(e)&&e.prevent()})),l=ad(e,"focusin",(e=>{o.triggerEvent("focusin",e)&&e.kill()})),c=on(),d=ad(e,"focusout",(e=>{o.triggerEvent("focusout",e)&&e.kill(),c.set(setTimeout((()=>{o.triggerEvent(Cs(),e)}),0))}));return{unbind:()=>{F(r,(e=>{e.unbind()})),i.unbind(),l.unbind(),d.unbind(),a.unbind(),s.on(clearTimeout),c.on(clearTimeout)}}},Wk=(e,t)=>{const o=fe(e,"target").getOr(t);return Qo(o)},$k=zr([{stopped:[]},{resume:["element"]},{complete:[]}]),qk=(e,t,o,n,r,s)=>{const a=e(t,n),i=((e,t)=>{const o=Qo(!1),n=Qo(!1);return{stop:()=>{o.set(!0)},cut:()=>{n.set(!0)},isStopped:o.get,isCut:n.get,event:e,setSource:t.set,getSource:t.get}})(o,r);return a.fold((()=>(s.logEventNoHandlers(t,n),$k.complete())),(e=>{const o=e.descHandler;return gl(o)(i),i.isStopped()?(s.logEventStopped(t,e.element,o.purpose),$k.stopped()):i.isCut()?(s.logEventCut(t,e.element,o.purpose),$k.complete()):nt(e.element).fold((()=>(s.logNoParent(t,e.element,o.purpose),$k.complete())),(n=>(s.logEventResponse(t,e.element,o.purpose),$k.resume(n))))}))},Gk=(e,t,o,n,r,s)=>qk(e,t,o,n,r,s).fold(O,(n=>Gk(e,t,o,n,r,s)),T),Kk=(e,t,o)=>{const n=(e=>{const t=Qo(!1);return{stop:()=>{t.set(!0)},cut:v,isStopped:t.get,isCut:T,event:e,setSource:_("Cannot set source of a broadcasted event"),getSource:_("Cannot get source of a broadcasted event")}})(t);return F(e,(e=>{const t=e.descHandler;gl(t)(n)})),n.isStopped()},Yk=(e,t,o,n,r)=>{const s=Wk(o,n);return Gk(e,t,o,n,s,r)},Xk=()=>{const e={};return{registerId:(t,o,n)=>{ie(n,((n,r)=>{const s=void 0!==e[r]?e[r]:{};s[o]=((e,t)=>{return o=S.apply(void 0,[e.handler].concat(t)),n=e.purpose,{cHandler:o,purpose:n};var o,n})(n,t),e[r]=s}))},unregisterId:t=>{ie(e,((e,o)=>{ve(e,t)&&delete e[t]}))},filterByType:t=>fe(e,t).map((e=>ge(e,((e,t)=>((e,t)=>({id:e,descHandler:t}))(t,e))))).getOr([]),find:(t,o,n)=>fe(e,o).bind((e=>qr(n,(t=>((e,t)=>nl(t).bind((t=>fe(e,t))).map((e=>((e,t)=>({element:e,descHandler:t}))(t,e))))(e,t)),t)))}},Jk=()=>{const e=Xk(),t={},o=e=>{const t=e.element;return nl(t).getOrThunk((()=>((e,t)=>{const o=Xi(el+e);return ol(t,o),o})("uid-",e.element)))},n=o=>{nl(o.element).each((o=>{delete t[o],e.unregisterId(o)}))};return{find:(t,o,n)=>e.find(t,o,n),filter:t=>e.filterByType(t),register:r=>{const s=o(r);be(t,s)&&((e,o)=>{const r=t[o];if(r!==e)throw new Error('The tagId "'+o+'" is already used by: '+ki(r.element)+"\nCannot use it for: "+ki(e.element)+"\nThe conflicting element is"+(yt(r.element)?" ":" not ")+"already in the DOM");n(e)})(r,s);const a=[r];e.registerId(a,s,r.events),t[s]=r},unregister:n,getById:e=>fe(t,e)}},Qk=Lg({name:"Container",factory:e=>{const{attributes:t,...o}=e.dom;return{uid:e.uid,dom:{tag:"div",attributes:{role:"presentation",...t},...o},components:e.components,behaviours:Ru(e.containerBehaviours),events:e.events,domModification:e.domModification,eventOrder:e.eventOrder}},configFields:[Mr("components",[]),Nu("containerBehaviours",[]),Mr("events",{}),Mr("domModification",{}),Mr("eventOrder",{})]}),e_=e=>{const t=t=>nt(e.element).fold(O,(e=>Xe(t,e))),o=Jk(),n=(e,n)=>o.find(t,e,n),r=jk(e.element,{triggerEvent:(e,t)=>Di(e,t.target,(o=>((e,t,o,n)=>Yk(e,t,o,o.target,n))(n,e,t,o)))}),s={debugInfo:w("real"),triggerEvent:(e,t,o)=>{Di(e,t,(r=>Yk(n,e,o,t,r)))},triggerFocus:(e,t)=>{nl(e).fold((()=>{zc(e)}),(o=>{Di(xs(),e,(o=>(((e,t,o,n,r)=>{const s=Wk(o,n);qk(e,t,o,n,s,r)})(n,xs(),{originator:t,kill:v,prevent:v,target:e},e,o),!1)))}))},triggerEscape:(e,t)=>{s.triggerEvent("keydown",e.element,t.event)},getByUid:e=>h(e),getByDom:e=>p(e),build:zl,buildOrPatch:Fl,addToGui:e=>{l(e)},removeFromGui:e=>{c(e)},addToWorld:e=>{a(e)},removeFromWorld:e=>{i(e)},broadcast:e=>{m(e)},broadcastOn:(e,t)=>{u(e,t)},broadcastEvent:(e,t)=>{g(e,t)},isConnected:O},a=e=>{e.connect(s),je(e.element)||(o.register(e),F(e.components(),a),s.triggerEvent(Ms(),e.element,{target:e.element}))},i=e=>{je(e.element)||(F(e.components(),i),o.unregister(e)),e.disconnect()},l=t=>{$m(e,t)},c=e=>{Km(e)},d=e=>{const t=o.filter(ks());F(t,(t=>{const o=t.descHandler;gl(o)(e)}))},m=e=>{d({universal:!0,data:e})},u=(e,t)=>{d({universal:!1,channels:e,data:t})},g=(e,t)=>{const n=o.filter(e);return Kk(n,t)},h=e=>o.getById(e).fold((()=>an.error(new Error('Could not find component with uid: "'+e+'" in system.'))),an.value),p=e=>{const t=nl(e).getOr("not found");return h(t)};return a(e),{root:e,element:e.element,destroy:()=>{r.unbind(),Fo(e.element)},add:l,remove:c,getByUid:h,getByDom:p,addToWorld:a,removeFromWorld:i,broadcast:m,broadcastOn:u,broadcastEvent:g}},t_=w([Mr("prefix","form-field"),Nu("fieldBehaviours",[zg,Mu])]),o_=w([cg({schema:[hr("dom")],name:"label"}),cg({factory:{sketch:e=>({uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}})},schema:[hr("text")],name:"aria-descriptor"}),ig({factory:{sketch:e=>{const t=Vr(e,["factory"]);return e.factory.sketch(t)}},schema:[hr("factory")],name:"field"})]),n_=Hg({name:"FormField",configFields:t_(),partFields:o_(),factory:(e,t,o,n)=>{const r=Bu(e.fieldBehaviours,[zg.config({find:t=>xg(t,e,"field")}),Mu.config({store:{mode:"manual",getValue:e=>zg.getCurrent(e).bind(Mu.getValue),setValue:(e,t)=>{zg.getCurrent(e).each((e=>{Mu.setValue(e,t)}))}}})]),s=Qs([da(((t,o)=>{const n=Sg(t,e,["label","field","aria-descriptor"]);n.field().each((t=>{const o=Xi(e.prefix);n.label().each((e=>{St(e.element,"for",o),St(t.element,"id",o)})),n["aria-descriptor"]().each((o=>{const n=Xi(e.prefix);St(o.element,"id",n),St(t.element,"aria-describedby",n)}))}))}))]),a={getField:t=>xg(t,e,"field"),getLabel:t=>xg(t,e,"label")};return{uid:e.uid,dom:e.dom,components:t,behaviours:r,events:s,apis:a}},apis:{getField:(e,t)=>e.getField(t),getLabel:(e,t)=>e.getLabel(t)}});var r_=tinymce.util.Tools.resolve("tinymce.html.Entities");const s_=(e,t,o,n)=>{const r=a_(e,t,o,n);return n_.sketch(r)},a_=(e,t,o,n)=>({dom:i_(o),components:e.toArray().concat([t]),fieldBehaviours:Sa(n)}),i_=e=>({tag:"div",classes:["tox-form__group"].concat(e)}),l_=(e,t)=>n_.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Hl(t.translate(e))]}),c_=Xi("form-component-change"),d_=Xi("form-close"),m_=Xi("form-cancel"),u_=Xi("form-action"),g_=Xi("form-submit"),h_=Xi("form-block"),p_=Xi("form-unblock"),f_=Xi("form-tabchange"),v_=Xi("form-resize"),b_=(e,t,o)=>{const n=e.label.map((e=>l_(e,t))),r=t.icons(),s=e=>(t,o)=>{Xl(o.event.target,"[data-collection-item-value]").each((n=>{e(t,o,n,_t(n,"data-collection-item-value"))}))},a=(o,n)=>{const s=P(n,(o=>{const n=Fy.translate(o.text),s=1===e.columns?`
    ${n}
    `:"",a=`
    ${(e=>{var t;return null!==(t=r[e])&&void 0!==t?t:e})(o.icon)}
    `,i={_:" "," - ":" ","-":" "},l=n.replace(/\_| \- |\-/g,(e=>i[e]));return`
    ${a}${s}
    `})),a="auto"!==e.columns&&e.columns>1?I(s,e.columns):[s],i=P(a,(e=>`
    ${e.join("")}
    `));xi(o.element,i.join(""))},i=s(((o,n,r,s)=>{n.stop(),t.isDisabled()||Gs(o,u_,{name:e.name,value:s})})),l=[oa(is(),s(((e,t,o)=>{zc(o)}))),oa(hs(),i),oa(Ts(),i),oa(ls(),s(((e,t,o)=>{Yl(e.element,"."+cw).each((e=>{Ha(e,cw)})),Ba(o,cw)}))),oa(cs(),s((e=>{Yl(e.element,"."+cw).each((e=>{Ha(e,cw),Vc(e)}))}))),ga(s(((t,o,n,r)=>{Gs(t,u_,{name:e.name,value:r})})))],c=(e,t)=>P(sm(e.element,".tox-collection__item"),t),d=n_.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==e.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:x},behaviours:Sa([eh.config({disabled:t.isDisabled,onDisabled:e=>{c(e,(e=>{Ba(e,"tox-collection__item--state-disabled"),St(e,"aria-disabled",!0)}))},onEnabled:e=>{c(e,(e=>{Ha(e,"tox-collection__item--state-disabled"),Ot(e,"aria-disabled")}))}}),nC(),vf.config({}),Zb.config({...t.tooltips.getConfig({tooltipText:"",onShow:e=>{Yl(e.element,"."+cw+"[data-mce-tooltip]").each((o=>{Et(o,"data-mce-tooltip").each((o=>{Zb.setComponents(e,t.tooltips.getComponents({tooltipText:o}))}))}))}}),mode:"children-keyboard-focus",anchor:e=>({type:"node",node:Yl(e.element,"."+cw).orThunk((()=>Ye(".tox-collection__item"))),root:e.element,layouts:{onLtr:w([Tc,Ec,Cc,kc,Sc,_c]),onRtl:w([Tc,Ec,Cc,kc,Sc,_c])},bubble:Sd(0,-2,{})})}),Mu.config({store:{mode:"memory",initialValue:o.getOr([])},onSetValue:(t,o)=>{a(t,o),"auto"===e.columns&&Kx(t,5,"tox-collection__item").each((({numRows:e,numColumns:o})=>{lf.setGridSize(t,e,o)})),qs(t,v_)}}),Mb.config({}),lf.config((m=e.columns,u="normal",1===m?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===m?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===u?".tox-swatches__row":".tox-collection__group",cell:"color"===u?`.${nw}`:`.${ow}`}})),bf("collection-events",l)]),eventOrder:{[_s()]:["disabling","alloy.base.behaviour","collection-events"],[ls()]:["collection-events","tooltipping"]}});var m,u;return s_(n,d,["tox-form__group--collection"],[])},y_=["input","textarea"],w_=e=>{const t=ze(e);return B(y_,t)},x_=(e,t)=>{const o=t.getRoot(e).getOr(e.element);Ha(o,t.invalidClass),t.notify.each((t=>{w_(e.element)&&St(e.element,"aria-invalid",!1),t.getContainer(e).each((e=>{xi(e,t.validHtml)})),t.onValid(e)}))},C_=(e,t,o,n)=>{const r=t.getRoot(e).getOr(e.element);Ba(r,t.invalidClass),t.notify.each((t=>{w_(e.element)&&St(e.element,"aria-invalid",!0),t.getContainer(e).each((e=>{xi(e,n)})),t.onInvalid(e,n)}))},S_=(e,t,o)=>t.validator.fold((()=>uk(an.value(!0))),(t=>t.validate(e))),k_=(e,t,o)=>(t.notify.each((t=>{t.onValidate(e)})),S_(e,t).map((o=>e.getSystem().isConnected()?o.fold((o=>(C_(e,t,0,o),an.error(o))),(o=>(x_(e,t),an.value(o)))):an.error("No longer in system"))));var __=Object.freeze({__proto__:null,markValid:x_,markInvalid:C_,query:S_,run:k_,isInvalid:(e,t)=>{const o=t.getRoot(e).getOr(e.element);return Pa(o,t.invalidClass)}});var E_=Object.freeze({__proto__:null,events:(e,t)=>e.validator.map((t=>Qs([oa(t.onEvent,(t=>{k_(t,e).get(x)}))].concat(t.validateOnLoad?[da((t=>{k_(t,e).get(v)}))]:[])))).getOr({})}),T_=[hr("invalidClass"),Mr("getRoot",A.none),Dr("notify",[Mr("aria","alert"),Mr("getContainer",A.none),Mr("validHtml",""),Fi("onValid"),Fi("onInvalid"),Fi("onValidate")]),Dr("validator",[hr("validate"),Mr("onEvent","input"),Mr("validateOnLoad",!0)])];const O_=_a({fields:T_,name:"invalidating",active:E_,apis:__,extra:{validation:e=>t=>{const o=Mu.getValue(t);return uk(e(o))}}});const A_=_a({fields:[],name:"unselecting",active:Object.freeze({__proto__:null,events:()=>Qs([ea(bs(),O)]),exhibit:()=>fa({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})})}),D_=Xi("color-input-change"),M_=Xi("color-swatch-change"),N_=Xi("color-picker-cancel"),R_=(e,t,o,n)=>{const r=n_.parts.field({factory:Sw,inputClasses:["tox-textfield"],data:n,onSetValue:e=>O_.run(e).get(v),inputBehaviours:Sa([eh.config({disabled:t.providers.isDisabled}),nC(),Mb.config({}),O_.config({invalidClass:"tox-textbox-field-invalid",getRoot:e=>rt(e.element),notify:{onValid:e=>{const t=Mu.getValue(e);Gs(e,D_,{color:t})}},validator:{validateOnLoad:!1,validate:e=>{const t=Mu.getValue(e);if(0===t.length)return uk(an.value(!0));{const e=Be.fromTag("span");Mt(e,"background-color",t);const o=Ht(e,"background-color").fold((()=>an.error("blah")),(e=>an.value(t)));return uk(o)}}}})]),selectOnFocus:!1}),s=e.label.map((e=>l_(e,t.providers))),a=(e,t)=>{Gs(e,M_,{value:t})},i=Ob(((e,t)=>Tk.sketch({dom:e.dom,components:e.components,toggleClass:"mce-active",dropdownBehaviours:Sa([sC(t.providers.isDisabled),nC(),A_.config({}),Mb.config({})]),layouts:e.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:t.getSink,fetch:o=>mk((t=>e.fetch(t))).map((n=>A.from(Ik(_n(zS(Xi("menu-value"),n,(t=>{e.onItemAction(o,t)}),e.columns,e.presets,ew.CLOSE_ON_EXECUTE,T,t.providers),{movement:ZS(e.columns,e.presets)}))))),parts:{menu:bw(0,0,e.presets)}}))({dom:{tag:"span",attributes:{"aria-label":t.providers.translate("Color swatch")}},layouts:{onRtl:()=>[Sc,Cc,Tc],onLtr:()=>[Cc,Sc,Tc]},components:[],fetch:NS(o.getColors(e.storageKey),e.storageKey,o.hasCustomColors()),columns:o.getColorCols(e.storageKey),presets:"color",onItemAction:(t,n)=>{i.getOpt(t).each((t=>{"custom"===n?o.colorPicker((o=>{o.fold((()=>qs(t,N_)),(o=>{a(t,o),dS(e.storageKey,o)}))}),"#ffffff"):a(t,"remove"===n?"":n)}))}},t));return n_.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:s.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,i.asSpec()]}]),fieldBehaviours:Sa([bf("form-field-events",[oa(D_,((t,o)=>{i.getOpt(t).each((e=>{Mt(e.element,"background-color",o.event.color)})),Gs(t,c_,{name:e.name})})),oa(M_,((e,t)=>{n_.getField(e).each((o=>{Mu.setValue(o,t.event.value),zg.getCurrent(e).each(Sf.focus)}))})),oa(N_,((e,t)=>{n_.getField(e).each((t=>{zg.getCurrent(e).each(Sf.focus)}))}))])])})},B_=cg({schema:[hr("dom")],name:"label"}),L_=e=>cg({name:e+"-edge",overrides:t=>t.model.manager.edgeActions[e].fold((()=>({})),(e=>({events:Qs([na(Qr(),((t,o,n)=>e(t,n)),[t]),na(ns(),((t,o,n)=>e(t,n)),[t]),na(rs(),((t,o,n)=>{n.mouseIsDown.get()&&e(t,n)}),[t])])})))}),H_=L_("top-left"),I_=L_("top"),P_=L_("top-right"),F_=L_("right"),z_=L_("bottom-right"),V_=L_("bottom"),Z_=L_("bottom-left"),U_=L_("left"),j_=ig({name:"thumb",defaults:w({dom:{styles:{position:"absolute"}}}),overrides:e=>({events:Qs([sa(Qr(),e,"spectrum"),sa(es(),e,"spectrum"),sa(ts(),e,"spectrum"),sa(ns(),e,"spectrum"),sa(rs(),e,"spectrum"),sa(as(),e,"spectrum")])})}),W_=e=>Th(e.event),$_=ig({schema:[ur("mouseIsDown",(()=>Qo(!1)))],name:"spectrum",overrides:e=>{const t=e.model.manager,o=(o,n)=>t.getValueFromEvent(n).map((n=>t.setValueFrom(o,e,n)));return{behaviours:Sa([lf.config({mode:"special",onLeft:(o,n)=>t.onLeft(o,e,W_(n)),onRight:(o,n)=>t.onRight(o,e,W_(n)),onUp:(o,n)=>t.onUp(o,e,W_(n)),onDown:(o,n)=>t.onDown(o,e,W_(n))}),Mb.config({}),Sf.config({})]),events:Qs([oa(Qr(),o),oa(es(),o),oa(ns(),o),oa(rs(),((t,n)=>{e.mouseIsDown.get()&&o(t,n)}))])}}});var q_=[B_,U_,F_,I_,V_,H_,P_,Z_,z_,j_,$_];const G_=w("slider.change.value"),K_=e=>{const t=e.event.raw;if((e=>-1!==e.type.indexOf("touch"))(t)){const e=t;return void 0!==e.touches&&1===e.touches.length?A.some(e.touches[0]).map((e=>$t(e.clientX,e.clientY))):A.none()}{const e=t;return void 0!==e.clientX?A.some(e).map((e=>$t(e.clientX,e.clientY))):A.none()}},Y_=e=>e.model.minX,X_=e=>e.model.minY,J_=e=>e.model.minX-1,Q_=e=>e.model.minY-1,eE=e=>e.model.maxX,tE=e=>e.model.maxY,oE=e=>e.model.maxX+1,nE=e=>e.model.maxY+1,rE=(e,t,o)=>t(e)-o(e),sE=e=>rE(e,eE,Y_),aE=e=>rE(e,tE,X_),iE=e=>sE(e)/2,lE=e=>aE(e)/2,cE=(e,t)=>t?e.stepSize*e.speedMultiplier:e.stepSize,dE=e=>e.snapToGrid,mE=e=>e.snapStart,uE=e=>e.rounded,gE=(e,t)=>void 0!==e[t+"-edge"],hE=e=>gE(e,"left"),pE=e=>gE(e,"right"),fE=e=>gE(e,"top"),vE=e=>gE(e,"bottom"),bE=e=>e.model.value.get(),yE=(e,t)=>({x:e,y:t}),wE=(e,t)=>{Gs(e,G_(),{value:t})},xE=(e,t,o,n)=>eo?o:e===t?t-1:Math.max(t,e-n),CE=(e,t,o,n)=>e>o?e:eMath.max(t,Math.min(o,e)),kE=e=>{const{min:t,max:o,range:n,value:r,step:s,snap:a,snapStart:i,rounded:l,hasMinEdge:c,hasMaxEdge:d,minBound:m,maxBound:u,screenRange:g}=e,h=c?t-1:t,p=d?o+1:o;if(ru)return p;{const e=((e,t,o)=>Math.min(o,Math.max(e,t))-t)(r,m,u),c=SE(e/g*n+t,h,p);return a&&c>=t&&c<=o?((e,t,o,n,r)=>r.fold((()=>{const r=e-t,s=Math.round(r/n)*n;return SE(t+s,t-1,o+1)}),(t=>{const r=(e-t)%n,s=Math.round(r/n),a=Math.floor((e-t)/n),i=Math.floor((o-t)/n),l=t+Math.min(i,a+s)*n;return Math.max(t,l)})))(c,t,o,s,i):l?Math.round(c):c}},_E=e=>{const{min:t,max:o,range:n,value:r,hasMinEdge:s,hasMaxEdge:a,maxBound:i,maxOffset:l,centerMinEdge:c,centerMaxEdge:d}=e;return ro?a?i:d:(r-t)/n*l},EE="top",TE="right",OE="bottom",AE="left",DE=e=>e.element.dom.getBoundingClientRect(),ME=(e,t)=>e[t],NE=e=>{const t=DE(e);return ME(t,AE)},RE=e=>{const t=DE(e);return ME(t,TE)},BE=e=>{const t=DE(e);return ME(t,EE)},LE=e=>{const t=DE(e);return ME(t,OE)},HE=e=>{const t=DE(e);return ME(t,"width")},IE=e=>{const t=DE(e);return ME(t,"height")},PE=(e,t,o)=>(e+t)/2-o,FE=(e,t)=>{const o=DE(e),n=DE(t),r=ME(o,AE),s=ME(o,TE),a=ME(n,AE);return PE(r,s,a)},zE=(e,t)=>{const o=DE(e),n=DE(t),r=ME(o,EE),s=ME(o,OE),a=ME(n,EE);return PE(r,s,a)},VE=(e,t)=>{Gs(e,G_(),{value:t})},ZE=(e,t,o)=>{const n={min:Y_(t),max:eE(t),range:sE(t),value:o,step:cE(t),snap:dE(t),snapStart:mE(t),rounded:uE(t),hasMinEdge:hE(t),hasMaxEdge:pE(t),minBound:NE(e),maxBound:RE(e),screenRange:HE(e)};return kE(n)},UE=e=>(t,o,n)=>((e,t,o,n)=>{const r=(e>0?CE:xE)(bE(o),Y_(o),eE(o),cE(o,n));return VE(t,r),A.some(r)})(e,t,o,n).map(O),jE=(e,t,o,n,r,s)=>{const a=((e,t,o,n,r)=>{const s=HE(e),a=n.bind((t=>A.some(FE(t,e)))).getOr(0),i=r.bind((t=>A.some(FE(t,e)))).getOr(s),l={min:Y_(t),max:eE(t),range:sE(t),value:o,hasMinEdge:hE(t),hasMaxEdge:pE(t),minBound:NE(e),minOffset:0,maxBound:RE(e),maxOffset:s,centerMinEdge:a,centerMaxEdge:i};return _E(l)})(t,s,o,n,r);return NE(t)-NE(e)+a},WE=UE(-1),$E=UE(1),qE=A.none,GE=A.none,KE={"top-left":A.none(),top:A.none(),"top-right":A.none(),right:A.some(((e,t)=>{wE(e,oE(t))})),"bottom-right":A.none(),bottom:A.none(),"bottom-left":A.none(),left:A.some(((e,t)=>{wE(e,J_(t))}))};var YE=Object.freeze({__proto__:null,setValueFrom:(e,t,o)=>{const n=ZE(e,t,o);return VE(e,n),n},setToMin:(e,t)=>{const o=Y_(t);VE(e,o)},setToMax:(e,t)=>{const o=eE(t);VE(e,o)},findValueOfOffset:ZE,getValueFromEvent:e=>K_(e).map((e=>e.left)),findPositionOfValue:jE,setPositionFromValue:(e,t,o,n)=>{const r=bE(o),s=jE(e,n.getSpectrum(e),r,n.getLeftEdge(e),n.getRightEdge(e),o),a=Xt(t.element)/2;Mt(t.element,"left",s-a+"px")},onLeft:WE,onRight:$E,onUp:qE,onDown:GE,edgeActions:KE});const XE=(e,t)=>{Gs(e,G_(),{value:t})},JE=(e,t,o)=>{const n={min:X_(t),max:tE(t),range:aE(t),value:o,step:cE(t),snap:dE(t),snapStart:mE(t),rounded:uE(t),hasMinEdge:fE(t),hasMaxEdge:vE(t),minBound:BE(e),maxBound:LE(e),screenRange:IE(e)};return kE(n)},QE=e=>(t,o,n)=>((e,t,o,n)=>{const r=(e>0?CE:xE)(bE(o),X_(o),tE(o),cE(o,n));return XE(t,r),A.some(r)})(e,t,o,n).map(O),eT=(e,t,o,n,r,s)=>{const a=((e,t,o,n,r)=>{const s=IE(e),a=n.bind((t=>A.some(zE(t,e)))).getOr(0),i=r.bind((t=>A.some(zE(t,e)))).getOr(s),l={min:X_(t),max:tE(t),range:aE(t),value:o,hasMinEdge:fE(t),hasMaxEdge:vE(t),minBound:BE(e),minOffset:0,maxBound:LE(e),maxOffset:s,centerMinEdge:a,centerMaxEdge:i};return _E(l)})(t,s,o,n,r);return BE(t)-BE(e)+a},tT=A.none,oT=A.none,nT=QE(-1),rT=QE(1),sT={"top-left":A.none(),top:A.some(((e,t)=>{wE(e,Q_(t))})),"top-right":A.none(),right:A.none(),"bottom-right":A.none(),bottom:A.some(((e,t)=>{wE(e,nE(t))})),"bottom-left":A.none(),left:A.none()};var aT=Object.freeze({__proto__:null,setValueFrom:(e,t,o)=>{const n=JE(e,t,o);return XE(e,n),n},setToMin:(e,t)=>{const o=X_(t);XE(e,o)},setToMax:(e,t)=>{const o=tE(t);XE(e,o)},findValueOfOffset:JE,getValueFromEvent:e=>K_(e).map((e=>e.top)),findPositionOfValue:eT,setPositionFromValue:(e,t,o,n)=>{const r=bE(o),s=eT(e,n.getSpectrum(e),r,n.getTopEdge(e),n.getBottomEdge(e),o),a=Ut(t.element)/2;Mt(t.element,"top",s-a+"px")},onLeft:tT,onRight:oT,onUp:nT,onDown:rT,edgeActions:sT});const iT=(e,t)=>{Gs(e,G_(),{value:t})},lT=(e,t)=>({x:e,y:t}),cT=(e,t)=>(o,n,r)=>((e,t,o,n,r)=>{const s=e>0?CE:xE,a=t?bE(n).x:s(bE(n).x,Y_(n),eE(n),cE(n,r)),i=t?s(bE(n).y,X_(n),tE(n),cE(n,r)):bE(n).y;return iT(o,lT(a,i)),A.some(a)})(e,t,o,n,r).map(O),dT=cT(-1,!1),mT=cT(1,!1),uT=cT(-1,!0),gT=cT(1,!0),hT={"top-left":A.some(((e,t)=>{wE(e,yE(J_(t),Q_(t)))})),top:A.some(((e,t)=>{wE(e,yE(iE(t),Q_(t)))})),"top-right":A.some(((e,t)=>{wE(e,yE(oE(t),Q_(t)))})),right:A.some(((e,t)=>{wE(e,yE(oE(t),lE(t)))})),"bottom-right":A.some(((e,t)=>{wE(e,yE(oE(t),nE(t)))})),bottom:A.some(((e,t)=>{wE(e,yE(iE(t),nE(t)))})),"bottom-left":A.some(((e,t)=>{wE(e,yE(J_(t),nE(t)))})),left:A.some(((e,t)=>{wE(e,yE(J_(t),lE(t)))}))};var pT=Object.freeze({__proto__:null,setValueFrom:(e,t,o)=>{const n=ZE(e,t,o.left),r=JE(e,t,o.top),s=lT(n,r);return iT(e,s),s},setToMin:(e,t)=>{const o=Y_(t),n=X_(t);iT(e,lT(o,n))},setToMax:(e,t)=>{const o=eE(t),n=tE(t);iT(e,lT(o,n))},getValueFromEvent:e=>K_(e),setPositionFromValue:(e,t,o,n)=>{const r=bE(o),s=jE(e,n.getSpectrum(e),r.x,n.getLeftEdge(e),n.getRightEdge(e),o),a=eT(e,n.getSpectrum(e),r.y,n.getTopEdge(e),n.getBottomEdge(e),o),i=Xt(t.element)/2,l=Ut(t.element)/2;Mt(t.element,"left",s-i+"px"),Mt(t.element,"top",a-l+"px")},onLeft:dT,onRight:mT,onUp:uT,onDown:gT,edgeActions:hT});const fT=Hg({name:"Slider",configFields:[Mr("stepSize",1),Mr("speedMultiplier",10),Mr("onChange",v),Mr("onChoose",v),Mr("onInit",v),Mr("onDragStart",v),Mr("onDragEnd",v),Mr("snapToGrid",!1),Mr("rounded",!0),Sr("snapStart"),pr("model",cr("mode",{x:[Mr("minX",0),Mr("maxX",100),ur("value",(e=>Qo(e.mode.minX))),hr("getInitialValue"),Ui("manager",YE)],y:[Mr("minY",0),Mr("maxY",100),ur("value",(e=>Qo(e.mode.minY))),hr("getInitialValue"),Ui("manager",aT)],xy:[Mr("minX",0),Mr("maxX",100),Mr("minY",0),Mr("maxY",100),ur("value",(e=>Qo({x:e.mode.minX,y:e.mode.minY}))),hr("getInitialValue"),Ui("manager",pT)]})),Nu("sliderBehaviours",[lf,Mu]),ur("mouseIsDown",(()=>Qo(!1)))],partFields:q_,factory:(e,t,o,n)=>{const r=t=>Cg(t,e,"thumb"),s=t=>Cg(t,e,"spectrum"),a=t=>xg(t,e,"left-edge"),i=t=>xg(t,e,"right-edge"),l=t=>xg(t,e,"top-edge"),c=t=>xg(t,e,"bottom-edge"),d=e.model,m=d.manager,u=(t,o)=>{m.setPositionFromValue(t,o,e,{getLeftEdge:a,getRightEdge:i,getTopEdge:l,getBottomEdge:c,getSpectrum:s})},g=(e,t)=>{d.value.set(t);const o=r(e);u(e,o)},h=t=>{const o=e.mouseIsDown.get();e.mouseIsDown.set(!1),o&&xg(t,e,"thumb").each((o=>{const n=d.value.get();e.onChoose(t,o,n)}))},p=(t,o)=>{o.stop(),e.mouseIsDown.set(!0),e.onDragStart(t,r(t))},f=(t,o)=>{o.stop(),e.onDragEnd(t,r(t)),h(t)},v=t=>{xg(t,e,"spectrum").map(lf.focusIn)};return{uid:e.uid,dom:e.dom,components:t,behaviours:Bu(e.sliderBehaviours,[lf.config({mode:"special",focusIn:v}),Mu.config({store:{mode:"manual",getValue:e=>d.value.get(),setValue:g}}),Pc.config({channels:{[hu()]:{onReceive:h}}})]),events:Qs([oa(G_(),((t,o)=>{((t,o)=>{g(t,o);const n=r(t);e.onChange(t,n,o),A.some(!0)})(t,o.event.value)})),da(((t,o)=>{const n=d.getInitialValue();d.value.set(n);const a=r(t);u(t,a);const i=s(t);e.onInit(t,a,i,d.value.get())})),oa(Qr(),p),oa(ts(),f),oa(ns(),((e,t)=>{v(e),p(e,t)})),oa(as(),f)]),apis:{resetToMin:t=>{m.setToMin(t,e)},resetToMax:t=>{m.setToMax(t,e)},setValue:g,refresh:u},domModification:{styles:{position:"relative"}}}},apis:{setValue:(e,t,o)=>{e.setValue(t,o)},resetToMin:(e,t)=>{e.resetToMin(t)},resetToMax:(e,t)=>{e.resetToMax(t)},refresh:(e,t)=>{e.refresh(t)}}}),vT=Xi("rgb-hex-update"),bT=Xi("slider-update"),yT=Xi("palette-update"),wT="form",xT=[Nu("formBehaviours",[Mu])],CT=e=>"",ST=(e,t)=>({uid:e.uid,dom:e.dom,components:t,behaviours:Bu(e.formBehaviours,[Mu.config({store:{mode:"manual",getValue:t=>{const o=kg(t,e);return le(o,((e,t)=>e().bind((e=>{const o=zg.getCurrent(e);return n=o,r=new Error(`Cannot find a current component to extract the value from for form part '${t}': `+ki(e.element)),n.fold((()=>an.error(r)),an.value);var n,r})).map(Mu.getValue)))},setValue:(t,o)=>{ie(o,((o,n)=>{xg(t,e,n).each((e=>{zg.getCurrent(e).each((e=>{Mu.setValue(e,o)}))}))}))}}})]),apis:{getField:(t,o)=>xg(t,e,o).bind(zg.getCurrent)}}),kT={getField:ml(((e,t,o)=>e.getField(t,o))),sketch:e=>{const t=(()=>{const e=[];return{field:(t,o)=>(e.push(t),fg(wT,CT(t),o)),record:w(e)}})(),o=e(t),n=t.record(),r=P(n,(e=>ig({name:e,pname:CT(e)})));return Mg(wT,xT,r,ST,o)}},_T=Xi("valid-input"),ET=Xi("invalid-input"),TT=Xi("validating-input"),OT="colorcustom.rgb.",AT=(e,t,o,n)=>{const r=(o,n)=>O_.config({invalidClass:t("invalid"),notify:{onValidate:e=>{Gs(e,TT,{type:o})},onValid:e=>{Gs(e,_T,{type:o,value:Mu.getValue(e)})},onInvalid:e=>{Gs(e,ET,{type:o,value:Mu.getValue(e)})}},validator:{validate:t=>{const o=Mu.getValue(t),r=n(o)?an.value(!0):an.error(e("aria.input.invalid"));return uk(r)},validateOnLoad:!1}}),s=(o,n,s,a,i)=>{const l=e(OT+"range"),c=n_.parts.label({dom:{tag:"label",attributes:{"aria-label":a}},components:[Hl(s)]}),d=n_.parts.field({data:i,factory:Sw,inputAttributes:{type:"text",..."hex"===n?{"aria-live":"polite"}:{}},inputClasses:[t("textfield")],inputBehaviours:Sa([r(n,o),Mb.config({})]),onSetValue:e=>{if(O_.isInvalid(e)){O_.run(e).get(v)}}}),m=[c,d],u="hex"!==n?[n_.parts["aria-descriptor"]({text:l})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:m.concat(u)}},a=(e,t)=>{const o=t.red,n=t.green,r=t.blue;Mu.setValue(e,{red:o,green:n,blue:r})},i=Ob({dom:{tag:"div",classes:[t("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),l=(e,t)=>{i.getOpt(e).each((e=>{Mt(e.element,"background-color","#"+t.value)}))},c=Lg({factory:()=>{const r={red:Qo(A.some(255)),green:Qo(A.some(255)),blue:Qo(A.some(255)),hex:Qo(A.some("ffffff"))},c=e=>r[e].get(),d=(e,t)=>{r[e].set(t)},m=e=>{const t=e.red,o=e.green,n=e.blue;d("red",A.some(t)),d("green",A.some(o)),d("blue",A.some(n))},u=(e,t)=>{const o=t.event;"hex"!==o.type?d(o.type,A.none()):n(e)},g=(e,t,o)=>{const n=parseInt(o,10);d(t,A.some(n)),c("red").bind((e=>c("green").bind((t=>c("blue").map((o=>UC(e,t,o,1))))))).each((t=>{const o=((e,t)=>{const o=IC(t);return kT.getField(e,"hex").each((t=>{Sf.isFocused(t)||Mu.setValue(e,{hex:o.value})})),o})(e,t);Gs(e,vT,{hex:o}),l(e,o)}))},h=(e,t)=>{const n=t.event;(e=>"hex"===e.type)(n)?((e,t)=>{o(e);const n=DC(t);d("hex",A.some(n.value));const r=$C(n);a(e,r),m(r),Gs(e,vT,{hex:n}),l(e,n)})(e,n.value):g(e,n.type,n.value)},p=t=>({label:e(OT+t+".label"),description:e(OT+t+".description")}),f=p("red"),v=p("green"),b=p("blue"),y=p("hex");return _n(kT.sketch((o=>({dom:{tag:"form",classes:[t("rgb-form")],attributes:{"aria-label":e("aria.color.picker")}},components:[o.field("red",n_.sketch(s(jC,"red",f.label,f.description,255))),o.field("green",n_.sketch(s(jC,"green",v.label,v.description,255))),o.field("blue",n_.sketch(s(jC,"blue",b.label,b.description,255))),o.field("hex",n_.sketch(s(RC,"hex",y.label,y.description,"ffffff"))),i.asSpec()],formBehaviours:Sa([O_.config({invalidClass:t("form-invalid")}),bf("rgb-form-events",[oa(_T,h),oa(ET,u),oa(TT,u)])])}))),{apis:{updateHex:(e,t)=>{Mu.setValue(e,{hex:t.value}),((e,t)=>{const o=$C(t);a(e,o),m(o)})(e,t),l(e,t)}}})},name:"RgbForm",configFields:[],apis:{updateHex:(e,t,o)=>{e.updateHex(t,o)}},extraApis:{}});return c},DT=(e,t)=>{const o=fT.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[t("sv-palette-spectrum")]}}),n=fT.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[t("sv-palette-thumb")],innerHtml:``}}),r=(e,t)=>{const{width:o,height:n}=e,r=e.getContext("2d");if(null===r)return;r.fillStyle=t,r.fillRect(0,0,o,n);const s=r.createLinearGradient(0,0,o,0);s.addColorStop(0,"rgba(255,255,255,1)"),s.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=s,r.fillRect(0,0,o,n);const a=r.createLinearGradient(0,0,0,n);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=a,r.fillRect(0,0,o,n)},s=Lg({factory:s=>{const a=w({x:0,y:0}),i=Sa([zg.config({find:A.some}),Sf.config({})]);return fT.sketch({dom:{tag:"div",attributes:{role:"slider","aria-valuetext":e(["Saturation {0}%, Brightness {1}%",0,0])},classes:[t("sv-palette")]},model:{mode:"xy",getInitialValue:a},rounded:!1,components:[o,n],onChange:(t,o,n)=>{p(n)||St(t.element,"aria-valuetext",e(["Saturation {0}%, Brightness {1}%",Math.floor(n.x),Math.floor(100-n.y)])),Gs(t,yT,{value:n})},onInit:(e,t,o,n)=>{r(o.element.dom,KC(YC))},sliderBehaviours:i})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:(e,t,o)=>{((e,t)=>{const o=e.components()[0].element.dom,n=mS(t,100,100),s=WC(n);r(o,KC(s))})(t,o)},setThumb:(t,o,n)=>{((t,o)=>{const n=uS($C(o));fT.setValue(t,{x:n.saturation,y:100-n.value}),St(t.element,"aria-valuetext",e(["Saturation {0}%, Brightness {1}%",n.saturation,n.value]))})(o,n)}},extraApis:{}});return s},MT=(e,t)=>{const o=Lg({name:"ColourPicker",configFields:[hr("dom"),Mr("onValidHex",v),Mr("onInvalidHex",v)],factory:o=>{const n=AT(e,t,o.onValidHex,o.onInvalidHex),r=DT(e,t),s={paletteRgba:Qo(YC),paletteHue:Qo(0)},a=Ob(((e,t)=>{const o=fT.parts.spectrum({dom:{tag:"div",classes:[t("hue-slider-spectrum")],attributes:{role:"presentation"}}}),n=fT.parts.thumb({dom:{tag:"div",classes:[t("hue-slider-thumb")],attributes:{role:"presentation"}}});return fT.sketch({dom:{tag:"div",classes:[t("hue-slider")],attributes:{role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":120}},rounded:!1,model:{mode:"y",getInitialValue:w(0)},components:[o,n],sliderBehaviours:Sa([Sf.config({})]),onChange:(e,t,o)=>{St(e.element,"aria-valuenow",Math.floor(360-3.6*o)),Gs(e,bT,{value:o})}})})(0,t)),i=Ob(r.sketch({})),l=Ob(n.sketch({})),c=(e,t,o)=>{i.getOpt(e).each((e=>{r.setHue(e,o)}))},d=(e,t)=>{l.getOpt(e).each((e=>{n.updateHex(e,t)}))},m=(e,t,o)=>{a.getOpt(e).each((e=>{fT.setValue(e,(e=>100-e/360*100)(o))}))},u=(e,t)=>{i.getOpt(e).each((e=>{r.setThumb(e,t)}))},g=(e,t,o,n)=>{((e,t)=>{const o=$C(e);s.paletteRgba.set(o),s.paletteHue.set(t)})(t,o),F(n,(n=>{n(e,t,o)}))};return{uid:o.uid,dom:o.dom,components:[i.asSpec(),a.asSpec(),l.asSpec()],behaviours:Sa([bf("colour-picker-events",[oa(vT,(()=>{const e=[c,m,u];return(t,o)=>{const n=o.event.hex,r=(e=>uS($C(e)))(n);g(t,n,r.hue,e)}})()),oa(yT,(()=>{const e=[d];return(t,o)=>{const n=o.event.value,r=s.paletteHue.get(),a=mS(r,n.x,100-n.y),i=gS(a);g(t,i,r,e)}})()),oa(bT,(()=>{const e=[c,d];return(t,o)=>{const n=(e=>(100-e)/100*360)(o.event.value),r=s.paletteRgba.get(),a=uS(r),i=mS(n,a.saturation,a.value),l=gS(i);g(t,l,n,e)}})())]),zg.config({find:e=>l.getOpt(e)}),lf.config({mode:"acyclic"})])}}});return o},NT=()=>zg.config({find:A.some}),RT=e=>zg.config({find:e.getOpt}),BT=e=>zg.config({find:t=>it(t.element,e).bind((e=>t.getSystem().getByDom(e).toOptional()))}),LT=Zn([Mr("preprocess",x),Mr("postprocess",x)]),HT=(e,t)=>{const o=ir("RepresentingConfigs.memento processors",LT,t);return Mu.config({store:{mode:"manual",getValue:t=>{const n=e.get(t),r=Mu.getValue(n);return o.postprocess(r)},setValue:(t,n)=>{const r=o.preprocess(n),s=e.get(t);Mu.setValue(s,r)}}})},IT=(e,t,o)=>Mu.config({store:{mode:"manual",...e.map((e=>({initialValue:e}))).getOr({}),getValue:t,setValue:o}}),PT=(e,t,o)=>IT(e,(e=>t(e.element)),((e,t)=>o(e.element,t))),FT=e=>Mu.config({store:{mode:"memory",initialValue:e}}),zT={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},VT=(e,t,o)=>{const n=e=>"tox-"+e,r=MT((e=>t=>s(t)?e.translate(zT[t]):e.translate(t))(t),n),a=Ob(r.sketch({dom:{tag:"div",classes:[n("color-picker-container")],attributes:{role:"presentation"}},onValidHex:e=>{Gs(e,u_,{name:"hex-valid",value:!0})},onInvalidHex:e=>{Gs(e,u_,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[a.asSpec()],behaviours:Sa([IT(o,(e=>{const t=a.get(e);return zg.getCurrent(t).bind((e=>Mu.getValue(e).hex)).map((e=>"#"+_e(e,"#"))).getOr("")}),((e,t)=>{const o=A.from(/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(t)).bind((e=>ee(e,1))),n=a.get(e);zg.getCurrent(n).fold((()=>{console.log("Can not find form")}),(e=>{Mu.setValue(e,{hex:o.getOr("")}),kT.getField(e,"hex").each((e=>{qs(e,us())}))}))})),NT()])}};var ZT=tinymce.util.Tools.resolve("tinymce.Resource");const UT=e=>ve(e,"init");var jT=tinymce.util.Tools.resolve("tinymce.util.Tools");const WT=(e,t,o)=>{const n=(e,t)=>{t.stop()},r=e=>(t,o)=>{F(e,(e=>{e(t,o)}))},s=(e,t)=>{var o;if(!eh.isDisabled(e)){const n=t.event.raw;i(e,null===(o=n.dataTransfer)||void 0===o?void 0:o.files)}},a=(e,t)=>{const o=t.event.raw.target;i(e,o.files)},i=(o,n)=>{n&&(Mu.setValue(o,((e,t)=>{const o=jT.explode(t.getOption("images_file_types"));return V(ne(e),(e=>L(o,(t=>Oe(e.name.toLowerCase(),`.${t.toLowerCase()}`)))))})(n,t)),Gs(o,c_,{name:e.name}))},l=Ob({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Sa([bf("input-file-events",[ia(hs()),ia(Ts())])])}),c=e.label.map((e=>l_(e,t))),d=n_.parts.field({factory:{sketch:e=>({uid:e.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Sa([FT(o.getOr([])),NT(),eh.config({}),Mf.config({toggleClass:"dragenter",toggleOnExecute:!1}),bf("dropzone-events",[oa("dragenter",r([n,Mf.toggle])),oa("dragleave",r([n,Mf.toggle])),oa("dragover",n),oa("drop",r([n,s])),oa(gs(),a)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p"},components:[Hl(t.translate("Drop an image here"))]},Eb.sketch({dom:{tag:"button",styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[Hl(t.translate("Browse for an image")),l.asSpec()],action:e=>{l.get(e).element.dom.click()},buttonBehaviours:Sa([Mb.config({}),sC(t.isDisabled),nC()])})]}]})}});return s_(c,d,["tox-form__group--stretched"],[])},$T=(e,t)=>{let o=null;const n=()=>{c(o)||(clearTimeout(o),o=null)};return{cancel:n,throttle:(...r)=>{n(),o=setTimeout((()=>{o=null,e.apply(null,r)}),t)}}},qT=Xi("alloy-fake-before-tabstop"),GT=Xi("alloy-fake-after-tabstop"),KT=e=>({dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:e},behaviours:Sa([Sf.config({ignore:!0}),Mb.config({})])}),YT=(e,t)=>({dom:{tag:"div",classes:["tox-navobj",...e.getOr([])]},components:[KT([qT]),t,KT([GT])],behaviours:Sa([BT(1)])}),XT=(e,t)=>{Gs(e,ds(),{raw:{which:9,shiftKey:t}})},JT=(e,t)=>{const o=t.element;Pa(o,qT)?XT(e,!0):Pa(o,GT)&&XT(e,!1)},QT=e=>zk(e,["."+qT,"."+GT].join(","),T),eO=Xi("update-dialog"),tO=Xi("update-title"),oO=Xi("update-body"),nO=Xi("update-footer"),rO=Xi("body-send-message"),sO=Xi("dialog-focus-shifted"),aO=Ao().browser,iO=aO.isSafari(),lO=aO.isFirefox(),cO=iO||lO,dO=aO.isChromium(),mO=({scrollTop:e,scrollHeight:t,clientHeight:o})=>Math.ceil(e)+o>=t,uO=(e,t)=>e.scrollTo(0,"bottom"===t?99999999:t),gO=(e,t,o)=>{const n=e.dom;A.from(n.contentDocument).fold(o,(e=>{let o=0;const r=((e,t)=>{const o=e.body;return A.from(!/^1))?o:e.documentElement)})(e,t).map((e=>(o=e.scrollTop,e))).forall(mO),s=()=>{const e=n.contentWindow;g(e)&&(r?uO(e,"bottom"):!r&&cO&&0!==o&&uO(e,o))};iO&&n.addEventListener("load",s,{once:!0}),e.open(),e.write(t),e.close(),iO||s()}))},hO=Se(cO,iO?500:200).map((e=>((e,t)=>{let o=null,n=null;return{cancel:()=>{c(o)||(clearTimeout(o),o=null,n=null)},throttle:(...r)=>{n=r,c(o)&&(o=setTimeout((()=>{const t=n;o=null,n=null,e.apply(null,t)}),t))}}})(gO,e))),pO=(e,t,o)=>{const n="tox-dialog__iframe",r=e.transparent?[]:[`${n}--opaque`],s=e.border?["tox-navobj-bordered"]:[],a={...e.label.map((e=>({title:e}))).getOr({}),...o.map((e=>({srcdoc:e}))).getOr({}),...e.sandboxed?{sandbox:"allow-scripts allow-same-origin"}:{}},i=((e,t)=>{const o=Qo(e.getOr(""));return{getValue:e=>o.get(),setValue:(e,n)=>{if(o.get()!==n){const o=e.element,r=()=>St(o,"srcdoc",n);t?hO.fold(w(gO),(e=>e.throttle))(o,n,r):r()}o.set(n)}}})(o,e.streamContent),l=e.label.map((e=>l_(e,t))),c=n_.parts.field({factory:{sketch:e=>YT(A.from(s),{uid:e.uid,dom:{tag:"iframe",attributes:a,classes:[n,...r]},behaviours:Sa([Mb.config({}),Sf.config({}),IT(o,i.getValue,i.setValue),Pc.config({channels:{[sO]:{onReceive:(e,t)=>{t.newFocus.each((t=>{rt(e.element).each((o=>{(Xe(e.element,t)?Ba:Ha)(o,"tox-navobj-bordered-focus")}))}))}}}})])})}});return s_(l,c,["tox-form__group--stretched"],[])},fO=(e,t)=>{const o=Qo(t.getOr({url:""})),n=Ob({dom:{tag:"img",classes:["tox-imagepreview__image"],attributes:t.map((e=>({src:e.url}))).getOr({})}}),r=Ob({dom:{tag:"div",classes:["tox-imagepreview__container"],attributes:{role:"presentation"}},components:[n.asSpec()]}),s={};e.height.each((e=>s.height=e));const a=t.map((e=>({url:e.url,zoom:A.from(e.zoom),cachedWidth:A.from(e.cachedWidth),cachedHeight:A.from(e.cachedHeight)})));return{dom:{tag:"div",classes:["tox-imagepreview"],styles:s,attributes:{role:"presentation"}},components:[r.asSpec()],behaviours:Sa([NT(),IT(a,(()=>o.get()),((e,t)=>{const s={url:t.url};t.zoom.each((e=>s.zoom=e)),t.cachedWidth.each((e=>s.cachedWidth=e)),t.cachedHeight.each((e=>s.cachedHeight=e)),o.set(s);const a=()=>{const{cachedWidth:t,cachedHeight:o,zoom:n}=s;if(!m(t)&&!m(o)){if(m(n)){const n=((e,t,o)=>{const n=Xt(e),r=Ut(e);return Math.min(n/t,r/o,1)})(e.element,t,o);s.zoom=n}const a=((e,t,o,n,r)=>{const s=o*r,a=n*r,i=Math.max(0,e/2-s/2),l=Math.max(0,t/2-a/2);return{left:i.toString()+"px",top:l.toString()+"px",width:s.toString()+"px",height:a.toString()+"px"}})(Xt(e.element),Ut(e.element),t,o,s.zoom);r.getOpt(e).each((e=>{Nt(e.element,a)}))}};n.getOpt(e).each((o=>{const n=o.element;t.url!==_t(n,"src")&&(St(n,"src",t.url),Ha(e.element,"tox-imagepreview__loaded")),a(),(e=>new Promise(((t,o)=>{const n=()=>{s(),t(e)},r=[ad(e,"load",n),ad(e,"error",(()=>{s(),o("Unable to load data from image: "+e.dom.src)}))],s=()=>F(r,(e=>e.unbind()));e.dom.complete&&n()})))(n).then((t=>{e.getSystem().isConnected()&&(Ba(e.element,"tox-imagepreview__loaded"),s.cachedWidth=t.dom.naturalWidth,s.cachedHeight=t.dom.naturalHeight,a())}))}))}))])}},vO=Xi("toolbar.button.execute"),bO=Xi("common-button-display-events"),yO={[_s()]:["disabling","alloy.base.behaviour","toggling","toolbar-button-events","tooltipping"],[Hs()]:["toolbar-button-events",bO],[Is()]:["toolbar-button-events","dropdown-events","tooltipping"],[ns()]:["focusing","alloy.base.behaviour",bO]},wO=e=>Mt(e.element,"width",Bt(e.element,"width")),xO=(e,t,o)=>Gy(e,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:o},t),CO=(e,t)=>xO(e,t,[]),SO=(e,t)=>xO(e,t,[vf.config({})]),kO=(e,t,o)=>({dom:{tag:"span",classes:[`${t}__select-label`]},components:[Hl(o.translate(e))],behaviours:Sa([vf.config({})])}),_O=Xi("update-menu-text"),EO=Xi("update-menu-icon"),TO=(e,t,o,n)=>{const r=Qo(v),s=e.text.map((e=>Ob(kO(e,t,o.providers)))),a=e.icon.map((e=>Ob(SO(e,o.providers.icons)))),i=(e,t)=>{const o=Mu.getValue(e);return Sf.focus(o),Gs(o,"keydown",{raw:t.event.raw}),Tk.close(o),A.some(!0)},l=e.role.fold((()=>({})),(e=>({role:e}))),c=A.from(e.listRole).map((e=>({listRole:e}))).getOr({}),d=e.ariaLabel.fold((()=>({})),(e=>({"aria-label":o.providers.translate(e)}))),m=Gy("chevron-down",{tag:"div",classes:[`${t}__select-chevron`]},o.providers.icons),u=Xi("common-button-display-events"),h="dropdown-events",p=Ob(Tk.sketch({...e.uid?{uid:e.uid}:{},...l,...c,dom:{tag:"button",classes:[t,`${t}--select`].concat(P(e.classes,(e=>`${t}--${e}`))),attributes:{...d,...g(n)?{"data-mce-name":n}:{}}},components:gC([a.map((e=>e.asSpec())),s.map((e=>e.asSpec())),A.some(m)]),matchWidth:!0,useMinWidth:!0,onOpen:(t,o,n)=>{e.searchable&&(e=>{Ow(e).each((e=>Sf.focus(e)))})(n)},dropdownBehaviours:Sa([...e.dropdownBehaviours,sC((()=>e.disabled||o.providers.isDisabled())),nC(),A_.config({}),vf.config({}),...e.tooltip.map((e=>Zb.config(o.providers.tooltips.getConfig({tooltipText:o.providers.translate(e)})))).toArray(),bf(h,[cC(e,r),dC(e,r)]),bf(u,[da(((e,t)=>wO(e)))]),bf("menubutton-update-display-text",[oa(_O,((e,t)=>{s.bind((t=>t.getOpt(e))).each((e=>{vf.set(e,[Hl(o.providers.translate(t.event.text))])}))})),oa(EO,((e,t)=>{a.bind((t=>t.getOpt(e))).each((e=>{vf.set(e,[SO(t.event.icon,o.providers.icons)])}))}))])]),eventOrder:_n(yO,{[ns()]:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"],[Hs()]:["toolbar-button-events",Zb.name(),h,u]}),sandboxBehaviours:Sa([lf.config({mode:"special",onLeft:i,onRight:i}),bf("dropdown-sandbox-events",[oa(kw,((e,t)=>{Ok(e),t.stop()})),oa(_w,((e,t)=>{((e,t)=>{Ak(e).each((o=>{((e,t,o,n)=>{const r={...n,target:t};e.getSystem().triggerEvent(o,t,r)})(e,o.element,t.event.eventType,t.event.interactionEvent)}))})(e,t),t.stop()}))])]),lazySink:o.getSink,toggleClass:`${t}--active`,parts:{menu:{...bw(0,e.columns,e.presets),fakeFocus:e.searchable,..."listbox"===e.listRole?{}:{onHighlightItem:Dk,onCollapseMenu:(e,t,o)=>{mh.getHighlighted(o).each((t=>{Dk(e,o,t)}))},onDehighlightItem:Mk}}},getAnchorOverrides:()=>({maxHeightFunction:(e,t)=>{bd()(e,t-10)}}),fetch:t=>mk(S(e.fetch,t))}));return p.asSpec()},OO=e=>"separator"===e.type,AO={type:"separator"},DO=(e,t)=>{const o=U(e,((e,o)=>(e=>s(e))(o)?""===o?e:"|"===o?e.length>0&&!OO(e[e.length-1])?e.concat([AO]):e:ve(t,o.toLowerCase())?e.concat([t[o.toLowerCase()]]):e:e.concat([o])),[]);return o.length>0&&OO(o[o.length-1])&&o.pop(),o},MO=(e,t)=>{const o=DO(s(e)?e.split(" "):e,t);return Z(o,((e,o)=>{if((e=>ve(e,"getSubmenuItems"))(o)){const n=(e=>{const t=fe(e,"value").getOrThunk((()=>Xi("generated-menu-item")));return _n({value:t},e)})(o),r=((e,t)=>{const o=e.getSubmenuItems(),n=MO(o,t);return{item:e,menus:_n(n.menus,{[e.value]:n.items}),expansions:_n(n.expansions,{[e.value]:e.value})}})(n,t);return{menus:_n(e.menus,r.menus),items:[r.item,...e.items],expansions:_n(e.expansions,r.expansions)}}return{...e,items:[o,...e.items]}}),{menus:{},expansions:{},items:[]})},NO=(e,t,o,n)=>{const r=Xi("primary-menu"),s=MO(e,o.shared.providers.menuItems());if(0===s.items.length)return A.none();const a=(e=>e.search.fold((()=>({searchMode:"no-search"})),(e=>({searchMode:"search-with-field",placeholder:e.placeholder}))))(n),i=Hk(r,s.items,t,o,n.isHorizontalMenu,a),l=(e=>e.search.fold((()=>({searchMode:"no-search"})),(e=>({searchMode:"search-with-results"}))))(n),c=le(s.menus,((e,n)=>Hk(n,e,t,o,!1,l))),d=_n(c,Zr(r,i));return A.from(cv.tieredData(r,d,s.expansions))},RO=e=>!ve(e,"items"),BO="data-value",LO=(e,t,o,n,r)=>P(o,(o=>RO(o)?{type:"togglemenuitem",...r?{}:{role:"option"},text:o.text,value:o.value,active:o.value===n,onAction:()=>{Mu.setValue(e,o.value),Gs(e,c_,{name:t}),Sf.focus(e)}}:{type:"nestedmenuitem",text:o.text,getSubmenuItems:()=>LO(e,t,o.items,n,r)})),HO=(e,t)=>re(e,(e=>RO(e)?Se(e.value===t,e):HO(e.items,t))),IO=Lg({name:"HtmlSelect",configFields:[hr("options"),Nu("selectBehaviours",[Sf,Mu]),Mr("selectClasses",[]),Mr("selectAttributes",{}),Sr("data")],factory:(e,t)=>{const o=P(e.options,(e=>({dom:{tag:"option",value:e.value,innerHtml:e.text}}))),n=e.data.map((e=>Zr("initialValue",e))).getOr({});return{uid:e.uid,dom:{tag:"select",classes:e.selectClasses,attributes:e.selectAttributes},components:o,behaviours:Bu(e.selectBehaviours,[Sf.config({}),Mu.config({store:{mode:"manual",getValue:e=>Sl(e.element),setValue:(t,o)=>{const n=te(e.options);j(e.options,(e=>e.value===o)).isSome()?kl(t.element,o):-1===t.element.dom.selectedIndex&&""===o&&n.each((e=>kl(t.element,e.value)))},...n}})])}}}),PO=w([Mr("field1Name","field1"),Mr("field2Name","field2"),Vi("onLockedChange"),Ii(["lockClass"]),Mr("locked",!1),Lu("coupledFieldBehaviours",[zg,Mu])]),FO=(e,t)=>ig({factory:n_,name:e,overrides:e=>({fieldBehaviours:Sa([bf("coupled-input-behaviour",[oa(us(),(o=>{((e,t,o)=>xg(e,t,o).bind(zg.getCurrent))(o,e,t).each((t=>{xg(o,e,"lock").each((n=>{Mf.isOn(n)&&e.onLockedChange(o,t,n)}))}))}))])])})}),zO=w([FO("field1","field2"),FO("field2","field1"),ig({factory:Eb,schema:[hr("dom")],name:"lock",overrides:e=>({buttonBehaviours:Sa([Mf.config({selected:e.locked,toggleClass:e.markers.lockClass,aria:{mode:"pressed"}})])})})]),VO=Hg({name:"FormCoupledInputs",configFields:PO(),partFields:zO(),factory:(e,t,o,n)=>({uid:e.uid,dom:e.dom,components:t,behaviours:Hu(e.coupledFieldBehaviours,[zg.config({find:A.some}),Mu.config({store:{mode:"manual",getValue:t=>{const o=Eg(t,e,["field1","field2"]);return{[e.field1Name]:Mu.getValue(o.field1()),[e.field2Name]:Mu.getValue(o.field2())}},setValue:(t,o)=>{const n=Eg(t,e,["field1","field2"]);be(o,e.field1Name)&&Mu.setValue(n.field1(),o[e.field1Name]),be(o,e.field2Name)&&Mu.setValue(n.field2(),o[e.field2Name])}}})]),apis:{getField1:t=>xg(t,e,"field1"),getField2:t=>xg(t,e,"field2"),getLock:t=>xg(t,e,"lock")}}),apis:{getField1:(e,t)=>e.getField1(t),getField2:(e,t)=>e.getField2(t),getLock:(e,t)=>e.getLock(t)}}),ZO=e=>{const t=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(e);if(null!==t){const e=parseFloat(t[1]),o=t[2];return an.value({value:e,unit:o})}return an.error(e)},UO=(e,t)=>{const o={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},n=e=>ve(o,e);return e.unit===t?A.some(e.value):n(e.unit)&&n(t)?o[e.unit]===o[t]?A.some(e.value):A.some(e.value/o[e.unit]*o[t]):A.none()},jO=e=>A.none(),WO=(e,t)=>{const o=ZO(e).toOptional(),n=ZO(t).toOptional();return xe(o,n,((e,t)=>UO(e,t.unit).map((e=>t.value/e)).map((e=>{return o=e,n=t.unit,e=>UO(e,n).map((e=>({value:e*o,unit:n})));var o,n})).getOr(jO))).getOr(jO)},$O=(e,t)=>{const o=e.label.map((e=>l_(e,t))),n=[eh.config({disabled:()=>e.disabled||t.isDisabled()}),nC(),lf.config({mode:"execution",useEnter:!0!==e.multiline,useControlEnter:!0===e.multiline,execute:e=>(qs(e,g_),A.some(!0))}),bf("textfield-change",[oa(us(),((t,o)=>{Gs(t,c_,{name:e.name})})),oa(Ss(),((t,o)=>{Gs(t,c_,{name:e.name})}))]),Mb.config({})],r=e.validation.map((e=>O_.config({getRoot:e=>rt(e.element),invalidClass:"tox-invalid",validator:{validate:t=>{const o=Mu.getValue(t),n=e.validator(o);return uk(!0===n?an.value(o):an.error(n))},validateOnLoad:e.validateOnLoad}}))).toArray(),s={...e.placeholder.fold(w({}),(e=>({placeholder:t.translate(e)}))),...e.inputMode.fold(w({}),(e=>({inputmode:e})))},a=n_.parts.field({tag:!0===e.multiline?"textarea":"input",...e.data.map((e=>({data:e}))).getOr({}),inputAttributes:s,inputClasses:[e.classname],inputBehaviours:Sa($([n,r])),selectOnFocus:!1,factory:Sw}),i=e.multiline?{dom:{tag:"div",classes:["tox-textarea-wrap"]},components:[a]}:a,l=(e.flex?["tox-form__group--stretched"]:[]).concat(e.maximized?["tox-form-group--maximize"]:[]),c=[eh.config({disabled:()=>e.disabled||t.isDisabled(),onDisabled:e=>{n_.getField(e).each(eh.disable)},onEnabled:e=>{n_.getField(e).each(eh.enable)}}),nC()];return s_(o,i,l,c)},qO=(e,t)=>t.getAnimationRoot.fold((()=>e.element),(t=>t(e))),GO=e=>e.dimension.property,KO=(e,t)=>e.dimension.getDimension(t),YO=(e,t)=>{const o=qO(e,t);za(o,[t.shrinkingClass,t.growingClass])},XO=(e,t)=>{Ha(e.element,t.openClass),Ba(e.element,t.closedClass),Mt(e.element,GO(t),"0px"),zt(e.element)},JO=(e,t)=>{Ha(e.element,t.closedClass),Ba(e.element,t.openClass),Ft(e.element,GO(t))},QO=(e,t,o,n)=>{o.setCollapsed(),Mt(e.element,GO(t),KO(t,e.element)),YO(e,t),XO(e,t),t.onStartShrink(e),t.onShrunk(e)},eA=(e,t,o,n)=>{const r=n.getOrThunk((()=>KO(t,e.element)));o.setCollapsed(),Mt(e.element,GO(t),r),zt(e.element);const s=qO(e,t);Ha(s,t.growingClass),Ba(s,t.shrinkingClass),XO(e,t),t.onStartShrink(e)},tA=(e,t,o)=>{const n=KO(t,e.element);("0px"===n?QO:eA)(e,t,o,A.some(n))},oA=(e,t,o)=>{const n=qO(e,t),r=Pa(n,t.shrinkingClass),s=KO(t,e.element);JO(e,t);const a=KO(t,e.element);(r?()=>{Mt(e.element,GO(t),s),zt(e.element)}:()=>{XO(e,t)})(),Ha(n,t.shrinkingClass),Ba(n,t.growingClass),JO(e,t),Mt(e.element,GO(t),a),o.setExpanded(),t.onStartGrow(e)},nA=(e,t,o)=>{const n=qO(e,t);return!0===Pa(n,t.growingClass)},rA=(e,t,o)=>{const n=qO(e,t);return!0===Pa(n,t.shrinkingClass)};var sA=Object.freeze({__proto__:null,refresh:(e,t,o)=>{if(o.isExpanded()){Ft(e.element,GO(t));const o=KO(t,e.element);Mt(e.element,GO(t),o)}},grow:(e,t,o)=>{o.isExpanded()||oA(e,t,o)},shrink:(e,t,o)=>{o.isExpanded()&&tA(e,t,o)},immediateShrink:(e,t,o)=>{o.isExpanded()&&QO(e,t,o)},hasGrown:(e,t,o)=>o.isExpanded(),hasShrunk:(e,t,o)=>o.isCollapsed(),isGrowing:nA,isShrinking:rA,isTransitioning:(e,t,o)=>nA(e,t)||rA(e,t),toggleGrow:(e,t,o)=>{(o.isExpanded()?tA:oA)(e,t,o)},disableTransitions:YO,immediateGrow:(e,t,o)=>{o.isExpanded()||(JO(e,t),Mt(e.element,GO(t),KO(t,e.element)),YO(e,t),o.setExpanded(),t.onStartGrow(e),t.onGrown(e))}});var aA=Object.freeze({__proto__:null,exhibit:(e,t,o)=>{const n=t.expanded;return fa(n?{classes:[t.openClass],styles:{}}:{classes:[t.closedClass],styles:Zr(t.dimension.property,"0px")})},events:(e,t)=>Qs([ca(fs(),((o,n)=>{if(n.event.raw.propertyName===e.dimension.property){YO(o,e),t.isExpanded()&&Ft(o.element,e.dimension.property);(t.isExpanded()?e.onGrown:e.onShrunk)(o)}}))])}),iA=[hr("closedClass"),hr("openClass"),hr("shrinkingClass"),hr("growingClass"),Sr("getAnimationRoot"),Fi("onShrunk"),Fi("onStartShrink"),Fi("onGrown"),Fi("onStartGrow"),Mr("expanded",!1),pr("dimension",cr("property",{width:[Ui("property","width"),Ui("getDimension",(e=>Xt(e)+"px"))],height:[Ui("property","height"),Ui("getDimension",(e=>Ut(e)+"px"))]}))];const lA=_a({fields:iA,name:"sliding",active:aA,apis:sA,state:Object.freeze({__proto__:null,init:e=>{const t=Qo(e.expanded);return Ca({isExpanded:()=>!0===t.get(),isCollapsed:()=>!1===t.get(),setCollapsed:S(t.set,!1),setExpanded:S(t.set,!0),readState:()=>"expanded: "+t.get()})}})}),cA=e=>({isEnabled:()=>!eh.isDisabled(e),setEnabled:t=>eh.set(e,!t),setActive:t=>{const o=e.element;t?(Ba(o,"tox-tbtn--enabled"),St(o,"aria-pressed",!0)):(Ha(o,"tox-tbtn--enabled"),Ot(o,"aria-pressed"))},isActive:()=>Pa(e.element,"tox-tbtn--enabled"),setText:t=>{Gs(e,_O,{text:t})},setIcon:t=>Gs(e,EO,{icon:t})}),dA=(e,t,o,n,r=!0,s)=>TO({text:e.text,icon:e.icon,tooltip:e.tooltip,ariaLabel:e.tooltip,searchable:e.search.isSome(),role:n,fetch:(t,n)=>{const r={pattern:e.search.isSome()?Nk(t):""};e.fetch((t=>{n(NO(t,ew.CLOSE_ON_EXECUTE,o,{isHorizontalMenu:!1,search:e.search}))}),r,cA(t))},onSetup:e.onSetup,getApi:cA,columns:1,presets:"normal",classes:[],dropdownBehaviours:[...r?[Mb.config({})]:[]]},t,o.shared,s),mA=(e,t,o)=>{const n=e=>n=>{const r=!n.isActive();n.setActive(r),e.storage.set(r),o.shared.getSink().each((o=>{t().getOpt(o).each((t=>{zc(t.element),Gs(t,u_,{name:e.name,value:e.storage.get()})}))}))},r=e=>t=>{t.setActive(e.storage.get())};return t=>{t(P(e,(e=>{const t=e.text.fold((()=>({})),(e=>({text:e})));return{type:e.type,active:!1,...t,onAction:n(e),onSetup:r(e)}})))}},uA=e=>({dom:{tag:"span",classes:["tox-tree__label"],attributes:{"aria-label":e}},components:[Hl(e)]}),gA=Xi("leaf-label-event-id"),hA=({leaf:e,onLeafAction:t,visible:o,treeId:n,selectedId:r,backstage:s})=>{const a=e.menu.map((e=>dA(e,"tox-mbtn",s,A.none(),o))),i=[uA(e.title)];return a.each((e=>i.push(e))),Eb.sketch({dom:{tag:"div",classes:["tox-tree--leaf__label","tox-trbtn"].concat(o?["tox-tree--leaf__label--visible"]:[])},components:i,role:"treeitem",action:o=>{t(e.id),o.getSystem().broadcastOn([`update-active-item-${n}`],{value:e.id})},eventOrder:{[ds()]:[gA,"keying"]},buttonBehaviours:Sa([...o?[Mb.config({})]:[],Mf.config({toggleClass:"tox-trbtn--enabled",toggleOnExecute:!1,aria:{mode:"selected"}}),Pc.config({channels:{[`update-active-item-${n}`]:{onReceive:(t,o)=>{(o.value===e.id?Mf.on:Mf.off)(t)}}}}),bf(gA,[da(((t,o)=>{r.each((o=>{(o===e.id?Mf.on:Mf.off)(t)}))})),oa(ds(),((e,t)=>{const o="ArrowLeft"===t.event.raw.code,n="ArrowRight"===t.event.raw.code;o?(ql(e.element,".tox-tree--directory").each((t=>{e.getSystem().getByDom(t).each((e=>{Kl(t,".tox-tree--directory__label").each((t=>{e.getSystem().getByDom(t).each(Sf.focus)}))}))})),t.stop()):n&&t.stop()}))])])})},pA=(e,t)=>((e,t,o)=>Gy(e,{tag:"span",classes:["tox-tree__icon-wrap","tox-icon"],behaviours:o},t))(e,t,[]),fA=Xi("directory-label-event-id"),vA=({directory:e,visible:t,noChildren:o,backstage:n})=>{const r=e.menu.map((e=>dA(e,"tox-mbtn",n,A.none()))),s=[{dom:{tag:"div",classes:["tox-chevron"]},components:[pA("chevron-right",n.shared.providers.icons)]},uA(e.title)];r.each((e=>{s.push(e)}));const a=t=>{ql(t.element,".tox-tree--directory").each((o=>{t.getSystem().getByDom(o).each((o=>{const n=!Mf.isOn(o);Mf.toggle(o),Gs(t,"expand-tree-node",{expanded:n,node:e.id})}))}))};return Eb.sketch({dom:{tag:"div",classes:["tox-tree--directory__label","tox-trbtn"].concat(t?["tox-tree--directory__label--visible"]:[])},components:s,action:a,eventOrder:{[ds()]:[fA,"keying"]},buttonBehaviours:Sa([...t?[Mb.config({})]:[],bf(fA,[oa(ds(),((e,t)=>{const n="ArrowRight"===t.event.raw.code,r="ArrowLeft"===t.event.raw.code;n&&o&&t.stop(),(n||r)&&ql(e.element,".tox-tree--directory").each((o=>{e.getSystem().getByDom(o).each((o=>{!Mf.isOn(o)&&n||Mf.isOn(o)&&r?(a(e),t.stop()):r&&!Mf.isOn(o)&&(ql(o.element,".tox-tree--directory").each((e=>{Kl(e,".tox-tree--directory__label").each((e=>{o.getSystem().getByDom(e).each(Sf.focus)}))})),t.stop())}))}))}))])])})},bA=({children:e,onLeafAction:t,visible:o,treeId:n,expandedIds:r,selectedId:s,backstage:a})=>({dom:{tag:"div",classes:["tox-tree--directory__children"]},components:e.map((e=>"leaf"===e.type?hA({leaf:e,selectedId:s,onLeafAction:t,visible:o,treeId:n,backstage:a}):wA({directory:e,expandedIds:r,selectedId:s,onLeafAction:t,labelTabstopping:o,treeId:n,backstage:a}))),behaviours:Sa([lA.config({dimension:{property:"height"},closedClass:"tox-tree--directory__children--closed",openClass:"tox-tree--directory__children--open",growingClass:"tox-tree--directory__children--growing",shrinkingClass:"tox-tree--directory__children--shrinking",expanded:o}),vf.config({})])}),yA=Xi("directory-event-id"),wA=({directory:e,onLeafAction:t,labelTabstopping:o,treeId:n,backstage:r,expandedIds:s,selectedId:a})=>{const{children:i}=e,l=Qo(s),c=s.includes(e.id);return{dom:{tag:"div",classes:["tox-tree--directory"],attributes:{role:"treeitem"}},components:[vA({directory:e,visible:o,noChildren:0===e.children.length,backstage:r}),bA({children:i,expandedIds:s,selectedId:a,onLeafAction:t,visible:c,treeId:n,backstage:r})],behaviours:Sa([bf(yA,[da(((e,t)=>{Mf.set(e,c)})),oa("expand-tree-node",((e,t)=>{const{expanded:o,node:n}=t.event;l.set(o?[...l.get(),n]:l.get().filter((e=>e!==n)))}))]),Mf.config({...e.children.length>0?{aria:{mode:"expanded"}}:{},toggleClass:"tox-tree--directory--expanded",onToggled:(e,o)=>{const s=e.components()[1],c=(d=o,i.map((e=>"leaf"===e.type?hA({leaf:e,selectedId:a,onLeafAction:t,visible:d,treeId:n,backstage:r}):wA({directory:e,expandedIds:l.get(),selectedId:a,onLeafAction:t,labelTabstopping:d,treeId:n,backstage:r}))));var d;o?lA.grow(s):lA.shrink(s),vf.set(s,c)}})])}},xA=Xi("tree-event-id");var CA=Object.freeze({__proto__:null,events:(e,t)=>{const o=e.stream.streams.setup(e,t);return Qs([oa(e.event,o),ma((()=>t.cancel()))].concat(e.cancelEvent.map((e=>[oa(e,(()=>t.cancel()))])).getOr([])))}});const SA=e=>{const t=Qo(null);return Ca({readState:()=>({timer:null!==t.get()?"set":"unset"}),setTimer:e=>{t.set(e)},cancel:()=>{const e=t.get();null!==e&&e.cancel()}})};var kA=Object.freeze({__proto__:null,throttle:SA,init:e=>e.stream.streams.state(e)});var _A=[pr("stream",cr("mode",{throttle:[hr("delay"),Mr("stopEvent",!0),Ui("streams",{setup:(e,t)=>{const o=e.stream,n=$T(e.onStream,o.delay);return t.setTimer(n),(e,t)=>{n.throttle(e,t),o.stopEvent&&t.stop()}},state:SA})]})),Mr("event","input"),Sr("cancelEvent"),Vi("onStream")];const EA=_a({fields:_A,name:"streaming",active:CA,state:kA}),TA=(e,t,o)=>{const n=Mu.getValue(o);Mu.setValue(t,n),AA(t)},OA=(e,t)=>{const o=e.element,n=Sl(o),r=o.dom;"number"!==_t(o,"type")&&t(r,n)},AA=e=>{OA(e,((e,t)=>e.setSelectionRange(t.length,t.length)))},DA=(e,t,o)=>{if(e.selectsOver){const n=Mu.getValue(t),r=e.getDisplayText(n),s=Mu.getValue(o);return 0===e.getDisplayText(s).indexOf(r)?A.some((()=>{TA(0,t,o),((e,t)=>{OA(e,((e,o)=>e.setSelectionRange(t,o.length)))})(t,r.length)})):A.none()}return A.none()},MA=w("alloy.typeahead.itemexecute"),NA=w([Sr("lazySink"),hr("fetch"),Mr("minChars",5),Mr("responseTime",1e3),Fi("onOpen"),Mr("getHotspot",A.some),Mr("getAnchorOverrides",w({})),Mr("layouts",A.none()),Mr("eventOrder",{}),Fr("model",{},[Mr("getDisplayText",(e=>void 0!==e.meta&&void 0!==e.meta.text?e.meta.text:e.value)),Mr("selectsOver",!0),Mr("populateFromBrowse",!0)]),Fi("onSetValue"),zi("onExecute"),Fi("onItemExecute"),Mr("inputClasses",[]),Mr("inputAttributes",{}),Mr("inputStyles",{}),Mr("matchWidth",!0),Mr("useMinWidth",!1),Mr("dismissOnBlur",!0),Ii(["openClass"]),Sr("initialData"),Sr("listRole"),Nu("typeaheadBehaviours",[Sf,Mu,EA,lf,Mf,ak]),ur("lazyTypeaheadComp",(()=>Qo(A.none))),ur("previewing",(()=>Qo(!0)))].concat(yw()).concat(kk())),RA=w([lg({schema:[Hi()],name:"menu",overrides:e=>({fakeFocus:!0,onHighlightItem:(t,o,n)=>{e.previewing.get()?e.lazyTypeaheadComp.get().each((t=>{DA(e.model,t,n).fold((()=>{e.model.selectsOver?(mh.dehighlight(o,n),e.previewing.set(!0)):e.previewing.set(!1)}),(t=>{t(),e.previewing.set(!1)}))})):e.lazyTypeaheadComp.get().each((t=>{e.model.populateFromBrowse&&TA(e.model,t,n),Et(n.element,"id").each((e=>St(t.element,"aria-activedescendant",e)))}))},onExecute:(t,o)=>e.lazyTypeaheadComp.get().map((e=>(Gs(e,MA(),{item:o}),!0))),onHover:(t,o)=>{e.previewing.set(!1),e.lazyTypeaheadComp.get().each((t=>{e.model.populateFromBrowse&&TA(e.model,t,o)}))}})})]),BA=Hg({name:"Typeahead",configFields:NA(),partFields:RA(),factory:(e,t,o,n)=>{const r=(t,o,r)=>{e.previewing.set(!1);const s=ak.getCoupled(t,"sandbox");if(mu.isOpen(s))zg.getCurrent(s).each((e=>{mh.getHighlighted(e).fold((()=>{r(e)}),(()=>{Js(s,e.element,"keydown",o)}))}));else{const o=e=>{zg.getCurrent(e).each(r)};fk(e,a(t),t,s,n,o,iv.HighlightMenuAndItem).get(v)}},s=ww(e),a=e=>t=>t.map((t=>{const o=pe(t.menus),n=q(o,(e=>V(e.items,(e=>"item"===e.type))));return Mu.getState(e).update(P(n,(e=>e.data))),t})),i=e=>zg.getCurrent(e),l="typeaheadevents",c=[Sf.config({}),Mu.config({onSetValue:e.onSetValue,store:{mode:"dataset",getDataKey:e=>Sl(e.element),getFallbackEntry:e=>({value:e,meta:{}}),setValue:(t,o)=>{kl(t.element,e.model.getDisplayText(o))},...e.initialData.map((e=>Zr("initialValue",e))).getOr({})}}),EA.config({stream:{mode:"throttle",delay:e.responseTime,stopEvent:!1},onStream:(t,o)=>{const r=ak.getCoupled(t,"sandbox");if(Sf.isFocused(t)&&Sl(t.element).length>=e.minChars){const o=i(r).bind((e=>mh.getHighlighted(e).map(Mu.getValue)));e.previewing.set(!0);const s=t=>{i(r).each((t=>{o.fold((()=>{e.model.selectsOver&&mh.highlightFirst(t)}),(e=>{mh.highlightBy(t,(t=>Mu.getValue(t).value===e.value)),mh.getHighlighted(t).orThunk((()=>(mh.highlightFirst(t),A.none())))}))}))};fk(e,a(t),t,r,n,s,iv.HighlightJustMenu).get(v)}},cancelEvent:Ds()}),lf.config({mode:"special",onDown:(e,t)=>(r(e,t,mh.highlightFirst),A.some(!0)),onEscape:e=>{const t=ak.getCoupled(e,"sandbox");return mu.isOpen(t)?(mu.close(t),A.some(!0)):A.none()},onUp:(e,t)=>(r(e,t,mh.highlightLast),A.some(!0)),onEnter:t=>{const o=ak.getCoupled(t,"sandbox"),n=mu.isOpen(o);if(n&&!e.previewing.get())return i(o).bind((e=>mh.getHighlighted(e))).map((e=>(Gs(t,MA(),{item:e}),!0)));{const r=Mu.getValue(t);return qs(t,Ds()),e.onExecute(o,t,r),n&&mu.close(o),A.some(!0)}}}),Mf.config({toggleClass:e.markers.openClass,aria:{mode:"expanded"}}),ak.config({others:{sandbox:t=>Ck(e,t,{onOpen:()=>Mf.on(t),onClose:()=>{e.lazyTypeaheadComp.get().each((e=>Ot(e.element,"aria-activedescendant"))),Mf.off(t)}})}}),bf(l,[da((t=>{e.lazyTypeaheadComp.set(A.some(t))})),ma((t=>{e.lazyTypeaheadComp.set(A.none())})),ga((t=>{const o=v;bk(e,a(t),t,n,o,iv.HighlightMenuAndItem).get(v)})),oa(MA(),((t,o)=>{const n=ak.getCoupled(t,"sandbox");TA(e.model,t,o.event.item),qs(t,Ds()),e.onItemExecute(t,n,o.event.item,Mu.getValue(t)),mu.close(n),AA(t)}))].concat(e.dismissOnBlur?[oa(Cs(),(e=>{const t=ak.getCoupled(e,"sandbox");jc(t.element).isNone()&&mu.close(t)}))]:[]))],d={[Is()]:[Mu.name(),EA.name(),l],...e.eventOrder};return{uid:e.uid,dom:Cw(_n(e,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:{...s,...Bu(e.typeaheadBehaviours,c)},eventOrder:d}}}),LA=e=>({...e,toCached:()=>LA(e.toCached()),bindFuture:t=>LA(e.bind((e=>e.fold((e=>uk(an.error(e))),(e=>t(e)))))),bindResult:t=>LA(e.map((e=>e.bind(t)))),mapResult:t=>LA(e.map((e=>e.map(t)))),mapError:t=>LA(e.map((e=>e.mapError(t)))),foldResult:(t,o)=>e.map((e=>e.fold(t,o))),withTimeout:(t,o)=>LA(mk((n=>{let r=!1;const s=setTimeout((()=>{r=!0,n(an.error(o()))}),t);e.get((e=>{r||(clearTimeout(s),n(e))}))})))}),HA=e=>LA(mk(e)),IA=HA,PA=(e,t,o=[],n,r,s,a)=>{const i=t.fold((()=>({})),(e=>({action:e}))),l={buttonBehaviours:Sa([sC((()=>!e.enabled||a.isDisabled())),nC(),Mb.config({}),...s.map((e=>Zb.config(a.tooltips.getConfig({tooltipText:a.translate(e)})))).toArray(),bf("button press",[ta("click"),ta("mousedown")])].concat(o)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]},...i},c=_n(l,{dom:n});return _n(c,{components:r})},FA=(e,t,o,n=[],r)=>{const s={tag:"button",classes:["tox-tbtn"],attributes:{...e.tooltip.map((e=>({"aria-label":o.translate(e)}))).getOr({}),"data-mce-name":r}},a=e.icon.map((e=>CO(e,o.icons))),i=gC([a]);return PA(e,t,n,s,i,e.tooltip,o)},zA=e=>{switch(e){case"primary":return["tox-button"];case"toolbar":return["tox-tbtn"];default:return["tox-button","tox-button--secondary"]}},VA=(e,t,o,n=[],r=[])=>{const s=o.translate(e.text),a=e.icon.map((e=>CO(e,o.icons))),i=[a.getOrThunk((()=>Hl(s)))],l=e.buttonType.getOr(e.primary||e.borderless?"primary":"secondary"),c={tag:"button",classes:[...zA(l),...a.isSome()?["tox-button--icon"]:[],...e.borderless?["tox-button--naked"]:[],...r],attributes:{"aria-label":s,"data-mce-name":e.text}},d=e.icon.map(w(s));return PA(e,t,n,c,i,d,o)},ZA=(e,t,o,n=[],r=[])=>{const s=VA(e,A.some(t),o,n,r);return Eb.sketch(s)},UA=(e,t)=>o=>{"custom"===t?Gs(o,u_,{name:e,value:{}}):"submit"===t?qs(o,g_):"cancel"===t?qs(o,m_):console.error("Unknown button type: ",t)},jA=(e,t,o)=>{if(((e,t)=>"menu"===t)(0,t)){const t=()=>s,n=e,r={...e,type:"menubutton",search:A.none(),onSetup:t=>(t.setEnabled(e.enabled),v),fetch:mA(n.items,t,o)},s=Ob(dA(r,"tox-tbtn",o,A.none(),!0,e.text.or(e.tooltip).getOrUndefined()));return s.asSpec()}if(((e,t)=>"custom"===t||"cancel"===t||"submit"===t)(0,t)){const n=UA(e.name,t),r={...e,borderless:!1};return ZA(r,n,o.shared.providers,[])}if(((e,t)=>"togglebutton"===t)(0,t))return((e,t,o)=>{var n,r;const s=e.icon.map((e=>SO(e,t.icons))).map(Ob),a=e.buttonType.getOr(e.primary?"primary":"secondary"),i={...e,name:null!==(n=e.name)&&void 0!==n?n:"",primary:"primary"===a,tooltip:e.tooltip,enabled:null!==(r=e.enabled)&&void 0!==r&&r,borderless:!1},l=i.tooltip.or(e.text).map((e=>({"aria-label":t.translate(e)}))).getOr({}),c=zA(null!=a?a:"secondary"),d=e.icon.isSome()&&e.text.isSome(),m={tag:"button",classes:[...c.concat(e.icon.isSome()?["tox-button--icon"]:[]),...e.active?["tox-button--enabled"]:[],...d?["tox-button--icon-and-text"]:[]],attributes:{...l,...g(o)?{"data-mce-name":o}:{}}},u=t.translate(e.text.getOr("")),h=Hl(u),p=[...gC([s.map((e=>e.asSpec()))]),...e.text.isSome()?[h]:[]],f=PA(i,A.some((o=>{Gs(o,u_,{name:e.name,value:{setIcon:e=>{s.map((n=>n.getOpt(o).each((o=>{vf.set(o,[SO(e,t.icons)])}))))}}})})),[],m,p,e.tooltip,t);return Eb.sketch(f)})(e,o.shared.providers,e.text.or(e.tooltip).getOrUndefined());throw console.error("Unknown footer button type: ",t),new Error("Unknown footer button type")},WA=(e,t)=>{const o=UA(e.name,"custom");return n=A.none(),r=n_.parts.field({factory:Eb,...VA(e,A.some(o),t,[FT(""),NT()])}),s_(n,r,[],[]);var n,r},$A={type:"separator"},qA=e=>({type:"menuitem",value:e.url,text:e.title,meta:{attach:e.attach},onAction:v}),GA=(e,t)=>({type:"menuitem",value:t,text:e,meta:{attach:void 0},onAction:v}),KA=(e,t)=>(e=>P(e,qA))(((e,t)=>V(t,(t=>t.type===e)))(e,t)),YA=e=>KA("header",e.targets),XA=e=>KA("anchor",e.targets),JA=e=>A.from(e.anchorTop).map((e=>GA("",e))).toArray(),QA=e=>A.from(e.anchorBottom).map((e=>GA("",e))).toArray(),eD=(e,t)=>{const o=e.toLowerCase();return V(t,(e=>{var t;const n=void 0!==e.meta&&void 0!==e.meta.text?e.meta.text:e.text,r=null!==(t=e.value)&&void 0!==t?t:"";return Ee(n.toLowerCase(),o)||Ee(r.toLowerCase(),o)}))},tD=(e,t,o)=>{var n,r;const s=Mu.getValue(t),a=null!==(r=null===(n=null==s?void 0:s.meta)||void 0===n?void 0:n.text)&&void 0!==r?r:s.value;return o.getLinkInformation().fold((()=>[]),(t=>{const n=eD(a,(e=>P(e,(e=>GA(e,e))))(o.getHistory(e)));return"file"===e?(r=[n,eD(a,YA(t)),eD(a,$([JA(t),XA(t),QA(t)]))],U(r,((e,t)=>0===e.length||0===t.length?e.concat(t):e.concat($A,t)),[])):n;var r}))},oD=Xi("aria-invalid"),nD=(e,t)=>{e.dom.checked=t},rD=e=>e.dom.checked,sD=e=>(t,o,n,r,s)=>fe(o,"name").fold((()=>e(o,r,A.none(),s)),(a=>t.field(a,e(o,r,fe(n,a),s)))),aD={bar:sD(((e,t)=>((e,t)=>({dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:P(e.items,t.interpreter)}))(e,t.shared))),collection:sD(((e,t,o)=>b_(e,t.shared.providers,o))),alertbanner:sD(((e,t)=>((e,t)=>{const o=Wy(e.icon,t.icons);return Qk.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in",`tox-notification--${e.level}`]},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:e.url?void 0:o},components:e.url?[Eb.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:o,attributes:{title:t.translate(e.iconTooltip)}},action:t=>Gs(t,u_,{name:"alert-banner",value:e.url}),buttonBehaviours:Sa([$y()])})]:void 0},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:t.translate(e.text)}}]})})(e,t.shared.providers))),input:sD(((e,t,o)=>((e,t,o)=>$O({name:e.name,multiline:!1,label:e.label,inputMode:e.inputMode,placeholder:e.placeholder,flex:!1,disabled:!e.enabled,classname:"tox-textfield",validation:A.none(),maximized:e.maximized,data:o},t))(e,t.shared.providers,o))),textarea:sD(((e,t,o)=>((e,t,o)=>$O({name:e.name,multiline:!0,label:e.label,inputMode:A.none(),placeholder:e.placeholder,flex:!0,disabled:!e.enabled,classname:"tox-textarea",validation:A.none(),maximized:e.maximized,data:o},t))(e,t.shared.providers,o))),label:sD(((e,t,o,n)=>((e,t,o)=>{const n="tox-label",r="center"===e.align?[`${n}--center`]:[],s="end"===e.align?[`${n}--end`]:[],a=Ob({dom:{tag:"label",classes:[n,...r,...s]},components:[Hl(t.providers.translate(e.label))]}),i=P(e.items,t.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[a.asSpec(),...i],behaviours:Sa([NT(),vf.config({}),(l=A.none(),PT(l,wi,xi)),lf.config({mode:"acyclic"}),bf("label",[da((t=>{e.for.each((e=>{o(e).each((e=>{a.getOpt(t).each((t=>{var o;const n=null!==(o=_t(e.element,"id"))&&void 0!==o?o:Xi("form-field");St(e.element,"id",n),St(t.element,"for",n)}))}))}))}))])])};var l})(e,t.shared,n))),iframe:(e=>(t,o,n,r,s)=>{const a=_n(o,{source:"dynamic"});return sD(e)(t,a,n,r,s)})(((e,t,o)=>pO(e,t.shared.providers,o))),button:sD(((e,t)=>WA(e,t.shared.providers))),checkbox:sD(((e,t,o)=>((e,t,o)=>{const n=e=>(e.element.dom.click(),A.some(!0)),r=n_.parts.field({factory:{sketch:x},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:Sa([NT(),eh.config({disabled:()=>!e.enabled||t.isDisabled(),onDisabled:e=>{rt(e.element).each((e=>Ba(e,"tox-checkbox--disabled")))},onEnabled:e=>{rt(e.element).each((e=>Ha(e,"tox-checkbox--disabled")))}}),Mb.config({}),Sf.config({}),PT(o,rD,nD),lf.config({mode:"special",onEnter:n,onSpace:n,stopSpaceKeyup:!0}),bf("checkbox-events",[oa(gs(),((t,o)=>{Gs(t,c_,{name:e.name})}))])])}),s=n_.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"]},components:[Hl(t.translate(e.label))],behaviours:Sa([A_.config({})])}),a=e=>Gy("checked"===e?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+e]},t.icons),i=Ob({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[a("checked"),a("unchecked")]});return n_.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[r,i.asSpec(),s],fieldBehaviours:Sa([eh.config({disabled:()=>!e.enabled||t.isDisabled()}),nC()])})})(e,t.shared.providers,o))),colorinput:sD(((e,t,o)=>R_(e,t.shared,t.colorinput,o))),colorpicker:sD(((e,t,o)=>VT(0,t.shared.providers,o))),dropzone:sD(((e,t,o)=>WT(e,t.shared.providers,o))),grid:sD(((e,t)=>((e,t)=>({dom:{tag:"div",classes:["tox-form__grid",`tox-form__grid--${e.columns}col`]},components:P(e.items,t.interpreter)}))(e,t.shared))),listbox:sD(((e,t,o)=>((e,t,o)=>{const n=L(e.items,(e=>!RO(e))),r=t.shared.providers,s=o.bind((t=>HO(e.items,t))).orThunk((()=>te(e.items).filter(RO))),a=e.label.map((e=>l_(e,r))),i=n_.parts.field({dom:{},factory:{sketch:o=>TO({uid:o.uid,text:s.map((e=>e.text)),icon:A.none(),tooltip:A.none(),role:Se(!n,"combobox"),...n?{}:{listRole:"listbox"},ariaLabel:e.label,fetch:(o,r)=>{const s=LO(o,e.name,e.items,Mu.getValue(o),n);r(NO(s,ew.CLOSE_ON_EXECUTE,t,{isHorizontalMenu:!1,search:A.none()}))},onSetup:w(v),getApi:w({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Mb.config({}),IT(s.map((e=>e.value)),(e=>_t(e.element,BO)),((t,o)=>{HO(e.items,o).each((e=>{St(t.element,BO,e.value),Gs(t,_O,{text:e.text})}))}))]},"tox-listbox",t.shared)}}),l={dom:{tag:"div",classes:["tox-listboxfield"]},components:[i]};return n_.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:$([a.toArray(),[l]]),fieldBehaviours:Sa([eh.config({disabled:w(!e.enabled),onDisabled:e=>{n_.getField(e).each(eh.disable)},onEnabled:e=>{n_.getField(e).each(eh.enable)}})])})})(e,t,o))),selectbox:sD(((e,t,o)=>((e,t,o)=>{const n=P(e.items,(e=>({text:t.translate(e.text),value:e.value}))),r=e.label.map((e=>l_(e,t))),s=n_.parts.field({dom:{},...o.map((e=>({data:e}))).getOr({}),selectAttributes:{size:e.size},options:n,factory:IO,selectBehaviours:Sa([eh.config({disabled:()=>!e.enabled||t.isDisabled()}),Mb.config({}),bf("selectbox-change",[oa(gs(),((t,o)=>{Gs(t,c_,{name:e.name})}))])])}),a=e.size>1?A.none():A.some(Gy("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},t.icons)),i={dom:{tag:"div",classes:["tox-selectfield"]},components:$([[s],a.toArray()])};return n_.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:$([r.toArray(),[i]]),fieldBehaviours:Sa([eh.config({disabled:()=>!e.enabled||t.isDisabled(),onDisabled:e=>{n_.getField(e).each(eh.disable)},onEnabled:e=>{n_.getField(e).each(eh.enable)}}),nC()])})})(e,t.shared.providers,o))),sizeinput:sD(((e,t)=>((e,t)=>{let o=jO;const n=Xi("ratio-event"),r=e=>Gy(e,{tag:"span",classes:["tox-icon","tox-lock-icon__"+e]},t.icons),s=e.label.getOr("Constrain proportions"),a=t.translate(s),i=VO.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{"aria-label":a,"data-mce-name":s}},components:[r("lock"),r("unlock")],buttonBehaviours:Sa([eh.config({disabled:()=>!e.enabled||t.isDisabled()}),nC(),Mb.config({}),Zb.config(t.tooltips.getConfig({tooltipText:a}))])}),l=e=>({dom:{tag:"div",classes:["tox-form__group"]},components:e}),c=o=>n_.parts.field({factory:Sw,inputClasses:["tox-textfield"],inputBehaviours:Sa([eh.config({disabled:()=>!e.enabled||t.isDisabled()}),nC(),Mb.config({}),bf("size-input-events",[oa(ls(),((e,t)=>{Gs(e,n,{isField1:o})})),oa(gs(),((t,o)=>{Gs(t,c_,{name:e.name})}))])]),selectOnFocus:!1}),d=e=>({dom:{tag:"label",classes:["tox-label"]},components:[Hl(t.translate(e))]}),m=VO.parts.field1(l([n_.parts.label(d("Width")),c(!0)])),u=VO.parts.field2(l([n_.parts.label(d("Height")),c(!1)]));return VO.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[m,u,l([d(" "),i])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:(e,t,n)=>{ZO(Mu.getValue(e)).each((e=>{o(e).each((e=>{Mu.setValue(t,(e=>{const t={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4};let o=e.value.toFixed((n=e.unit)in t?t[n]:1);var n;return-1!==o.indexOf(".")&&(o=o.replace(/\.?0*$/,"")),o+e.unit})(e))}))}))},coupledFieldBehaviours:Sa([eh.config({disabled:()=>!e.enabled||t.isDisabled(),onDisabled:e=>{VO.getField1(e).bind(n_.getField).each(eh.disable),VO.getField2(e).bind(n_.getField).each(eh.disable),VO.getLock(e).each(eh.disable)},onEnabled:e=>{VO.getField1(e).bind(n_.getField).each(eh.enable),VO.getField2(e).bind(n_.getField).each(eh.enable),VO.getLock(e).each(eh.enable)}}),nC(),bf("size-input-events2",[oa(n,((e,t)=>{const n=t.event.isField1,r=n?VO.getField1(e):VO.getField2(e),s=n?VO.getField2(e):VO.getField1(e),a=r.map(Mu.getValue).getOr(""),i=s.map(Mu.getValue).getOr("");o=WO(a,i)}))])])})})(e,t.shared.providers))),slider:sD(((e,t,o)=>((e,t,o)=>{const n=fT.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Hl(t.translate(e.label))]}),r=fT.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),s=fT.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return fT.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:e.min,maxX:e.max,getInitialValue:w(o.getOrThunk((()=>(Math.abs(e.max)-Math.abs(e.min))/2)))},components:[n,r,s],sliderBehaviours:Sa([NT(),Sf.config({})]),onChoose:(t,o,n)=>{Gs(t,c_,{name:e.name,value:n})},onChange:(t,o,n)=>{Gs(t,c_,{name:e.name,value:n})}})})(e,t.shared.providers,o))),urlinput:sD(((e,t,o)=>((e,t,o,n)=>{const r=t.shared.providers,s=t=>{const n=Mu.getValue(t);o.addToHistory(n.value,e.filetype)},a={...n.map((e=>({initialData:e}))).getOr({}),dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":oD,type:"url"},minChars:0,responseTime:0,fetch:n=>{const r=tD(e.filetype,n,o),s=NO(r,ew.BUBBLE_TO_SANDBOX,t,{isHorizontalMenu:!1,search:A.none()});return uk(s)},getHotspot:e=>g.getOpt(e),onSetValue:(e,t)=>{e.hasConfigured(O_)&&O_.run(e).get(v)},typeaheadBehaviours:Sa([...o.getValidationHandler().map((t=>O_.config({getRoot:e=>rt(e.element),invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:(e,t)=>{c.getOpt(e).each((e=>{St(e.element,"title",r.translate(t))}))}},validator:{validate:o=>{const n=Mu.getValue(o);return IA((o=>{t({type:e.filetype,url:n.value},(e=>{if("invalid"===e.status){const t=an.error(e.message);o(t)}else{const t=an.value(e.message);o(t)}}))}))},validateOnLoad:!1}}))).toArray(),eh.config({disabled:()=>!e.enabled||r.isDisabled()}),Mb.config({}),bf("urlinput-events",[oa(us(),(t=>{const o=Sl(t.element),n=o.trim();n!==o&&kl(t.element,n),"file"===e.filetype&&Gs(t,c_,{name:e.name})})),oa(gs(),(t=>{Gs(t,c_,{name:e.name}),s(t)})),oa(Ss(),(t=>{Gs(t,c_,{name:e.name}),s(t)}))])]),eventOrder:{[us()]:["streaming","urlinput-events","invalidating"]},model:{getDisplayText:e=>e.value,selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:t.shared.getSink,parts:{menu:bw(0,0,"normal")},onExecute:(e,t,o)=>{Gs(t,g_,{})},onItemExecute:(t,o,n,r)=>{s(t),Gs(t,c_,{name:e.name})}},i=n_.parts.field({...a,factory:BA}),l=e.label.map((e=>l_(e,r))),c=Ob(((e,t,o=e,n=e)=>Gy(o,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+e],attributes:{title:r.translate(n),"aria-live":"polite",...t.fold((()=>({})),(e=>({id:e})))}},r.icons))("invalid",A.some(oD),"warning")),d=Ob({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[c.asSpec()]}),m=o.getUrlPicker(e.filetype),u=Xi("browser.url.event"),g=Ob({dom:{tag:"div",classes:["tox-control-wrap"]},components:[i,d.asSpec()],behaviours:Sa([eh.config({disabled:()=>!e.enabled||r.isDisabled()})])}),h=Ob(ZA({name:e.name,icon:A.some("browse"),text:e.picker_text.or(e.label).getOr(""),enabled:e.enabled,primary:!1,buttonType:A.none(),borderless:!0},(e=>qs(e,u)),r,[],["tox-browse-url"]));return n_.sketch({dom:i_([]),components:l.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:$([[g.asSpec()],m.map((()=>h.asSpec())).toArray()])}]),fieldBehaviours:Sa([eh.config({disabled:()=>!e.enabled||r.isDisabled(),onDisabled:e=>{n_.getField(e).each(eh.disable),h.getOpt(e).each(eh.disable)},onEnabled:e=>{n_.getField(e).each(eh.enable),h.getOpt(e).each(eh.enable)}}),nC(),bf("url-input-events",[oa(u,(t=>{zg.getCurrent(t).each((o=>{const n=Mu.getValue(o),r={fieldname:e.name,...n};m.each((n=>{n(r).get((n=>{Mu.setValue(o,n),Gs(t,c_,{name:e.name})}))}))}))}))])])})})(e,t,t.urlinput,o))),customeditor:sD((e=>{const t=on(),o=Ob({dom:{tag:e.tag}}),n=on(),r=!UT(e)&&e.onFocus.isSome()?[Sf.config({onFocus:t=>{e.onFocus.each((e=>{e(t.element.dom)}))}}),Mb.config({})]:[];return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:Sa([bf("custom-editor-events",[da((r=>{o.getOpt(r).each((o=>{(UT(e)?e.init(o.element.dom):ZT.load(e.scriptId,e.scriptUrl).then((t=>t(o.element.dom,e.settings)))).then((e=>{n.on((t=>{e.setValue(t)})),n.clear(),t.set(e)}))}))}))]),IT(A.none(),(()=>t.get().fold((()=>n.get().getOr("")),(e=>e.getValue()))),((e,o)=>{t.get().fold((()=>n.set(o)),(e=>e.setValue(o)))})),NT()].concat(r)),components:[o.asSpec()]}})),htmlpanel:sD(((e,t)=>((e,t)=>{const o=["tox-form__group",...e.stretched?["tox-form__group--stretched"]:[]],n=bf("htmlpanel",[da((t=>{e.onInit(t.element.dom)}))]);return"presentation"===e.presets?Qk.sketch({dom:{tag:"div",classes:o,innerHtml:e.html},containerBehaviours:Sa([Zb.config({...t.tooltips.getConfig({tooltipText:"",onShow:e=>{Yl(e.element,"[data-mce-tooltip]:hover").orThunk((()=>jc(e.element))).each((o=>{Et(o,"data-mce-tooltip").each((o=>{Zb.setComponents(e,t.tooltips.getComponents({tooltipText:o}))}))}))}}),mode:"children-normal",anchor:e=>({type:"node",node:Yl(e.element,"[data-mce-tooltip]:hover").orThunk((()=>jc(e.element).filter((e=>Et(e,"data-mce-tooltip").isSome())))),root:e.element,layouts:{onLtr:w([Tc,Ec,Cc,kc,Sc,_c]),onRtl:w([Tc,Ec,Cc,kc,Sc,_c])},bubble:Sd(0,-2,{})})}),n])}):Qk.sketch({dom:{tag:"div",classes:o,innerHtml:e.html,attributes:{role:"document"}},containerBehaviours:Sa([Mb.config({}),Sf.config({}),n])})})(e,t.shared.providers))),imagepreview:sD(((e,t,o)=>fO(e,o))),table:sD(((e,t)=>((e,t)=>{const o=e=>({dom:{tag:"th",innerHtml:t.translate(e)}}),n=e=>({dom:{tag:"td",innerHtml:t.translate(e)}}),r=e=>({dom:{tag:"tr"},components:P(e,n)});return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(a=e.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:P(a,o)}]}),(s=e.cells,{dom:{tag:"tbody"},components:P(s,r)})],behaviours:Sa([Mb.config({}),Sf.config({})])};var s,a})(e,t.shared.providers))),tree:sD(((e,t)=>((e,t)=>{const o=e.onLeafAction.getOr(v),n=e.onToggleExpand.getOr(v),r=e.defaultExpandedIds,s=Qo(r),a=Qo(e.defaultSelectedId),i=Xi("tree-id"),l=(n,r)=>e.items.map((e=>"leaf"===e.type?hA({leaf:e,selectedId:n,onLeafAction:o,visible:!0,treeId:i,backstage:t}):wA({directory:e,selectedId:n,onLeafAction:o,expandedIds:r,labelTabstopping:!0,treeId:i,backstage:t})));return{dom:{tag:"div",classes:["tox-tree"],attributes:{role:"tree"}},components:l(a.get(),s.get()),behaviours:Sa([lf.config({mode:"flow",selector:".tox-tree--leaf__label--visible, .tox-tree--directory__label--visible",cycles:!1}),bf(xA,[oa("expand-tree-node",((e,t)=>{const{expanded:o,node:r}=t.event;s.set(o?[...s.get(),r]:s.get().filter((e=>e!==r))),n(s.get(),{expanded:o,node:r})}))]),Pc.config({channels:{[`update-active-item-${i}`]:{onReceive:(e,t)=>{a.set(A.some(t.value)),vf.set(e,l(A.some(t.value),s.get()))}}}}),vf.config({})])}})(e,t))),panel:sD(((e,t)=>((e,t)=>({dom:{tag:"div",classes:e.classes},components:P(e.items,t.shared.interpreter)}))(e,t)))},iD={field:(e,t)=>t,record:w([])},lD=(e,t,o,n,r)=>{const s=_n(n,{shared:{interpreter:t=>cD(e,t,o,s,r)}});return cD(e,t,o,s,r)},cD=(e,t,o,n,r)=>fe(aD,t.type).fold((()=>(console.error(`Unknown factory type "${t.type}", defaulting to container: `,t),t)),(s=>s(e,t,o,n,r))),dD=(e,t,o,n)=>cD(iD,e,t,o,n),mD="layout-inset",uD=e=>e.x,gD=(e,t)=>e.x+e.width/2-t.width/2,hD=(e,t)=>e.x+e.width-t.width,pD=e=>e.y,fD=(e,t)=>e.y+e.height-t.height,vD=(e,t)=>e.y+e.height/2-t.height/2,bD=(e,t,o)=>oc(hD(e,t),fD(e,t),o.insetSouthwest(),ic(),"southwest",hc(e,{right:0,bottom:3}),mD),yD=(e,t,o)=>oc(uD(e),fD(e,t),o.insetSoutheast(),ac(),"southeast",hc(e,{left:1,bottom:3}),mD),wD=(e,t,o)=>oc(hD(e,t),pD(e),o.insetNorthwest(),sc(),"northwest",hc(e,{right:0,top:2}),mD),xD=(e,t,o)=>oc(uD(e),pD(e),o.insetNortheast(),rc(),"northeast",hc(e,{left:1,top:2}),mD),CD=(e,t,o)=>oc(gD(e,t),pD(e),o.insetNorth(),lc(),"north",hc(e,{top:2}),mD),SD=(e,t,o)=>oc(gD(e,t),fD(e,t),o.insetSouth(),cc(),"south",hc(e,{bottom:3}),mD),kD=(e,t,o)=>oc(hD(e,t),vD(e,t),o.insetEast(),mc(),"east",hc(e,{right:0}),mD),_D=(e,t,o)=>oc(uD(e),vD(e,t),o.insetWest(),dc(),"west",hc(e,{left:1}),mD),ED=e=>{switch(e){case"north":return CD;case"northeast":return xD;case"northwest":return wD;case"south":return SD;case"southeast":return yD;case"southwest":return bD;case"east":return kD;case"west":return _D}},TD=(e,t,o,n,r)=>od(n).map(ED).getOr(CD)(e,t,o,n,r),OD=e=>{switch(e){case"north":return SD;case"northeast":return yD;case"northwest":return bD;case"south":return CD;case"southeast":return xD;case"southwest":return wD;case"east":return _D;case"west":return kD}},AD=(e,t,o,n,r)=>od(n).map(OD).getOr(CD)(e,t,o,n,r),DD={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},MD=(e,t,o)=>{const n={maxHeightFunction:yd()};return()=>o()?{type:"node",root:pt(ht(e())),node:A.from(e()),bubble:Sd(12,12,DD),layouts:{onRtl:()=>[xD],onLtr:()=>[wD]},overrides:n}:{type:"hotspot",hotspot:t(),bubble:Sd(-12,12,DD),layouts:{onRtl:()=>[Cc,Sc,Tc],onLtr:()=>[Sc,Cc,Tc]},overrides:n}},ND=(e,t,o,n)=>{const r={maxHeightFunction:yd()};return()=>n()?{type:"node",root:pt(ht(t())),node:A.from(t()),bubble:Sd(12,12,DD),layouts:{onRtl:()=>[CD],onLtr:()=>[CD]},overrides:r}:e?{type:"node",root:pt(ht(t())),node:A.from(t()),bubble:Sd(0,-jt(t()),DD),layouts:{onRtl:()=>[Ec],onLtr:()=>[Ec]},overrides:r}:{type:"hotspot",hotspot:o(),bubble:Sd(0,0,DD),layouts:{onRtl:()=>[Ec],onLtr:()=>[Ec]},overrides:r}},RD=(e,t,o)=>()=>o()?{type:"node",root:pt(ht(e())),node:A.from(e()),layouts:{onRtl:()=>[CD],onLtr:()=>[CD]}}:{type:"hotspot",hotspot:t(),layouts:{onRtl:()=>[Tc],onLtr:()=>[Tc]}},BD=(e,t)=>()=>({type:"selection",root:t(),getSelection:()=>{const t=e.selection.getRng(),o=e.model.table.getSelectedCells();if(o.length>1){const e=o[0],t=o[o.length-1],n={firstCell:Be.fromDom(e),lastCell:Be.fromDom(t)};return A.some(n)}return A.some(Yd.range(Be.fromDom(t.startContainer),t.startOffset,Be.fromDom(t.endContainer),t.endOffset))}}),LD=e=>t=>({type:"node",root:e(),node:t}),HD=(e,t,o,n)=>{const r=hb(e),s=()=>Be.fromDom(e.getBody()),a=()=>Be.fromDom(e.getContentAreaContainer()),i=()=>r||!n();return{inlineDialog:MD(a,t,i),inlineBottomDialog:ND(e.inline,a,o,i),banner:RD(a,t,i),cursor:BD(e,s),node:LD(s)}},ID=e=>(t,o)=>{FS(e)(t,o)},PD=e=>()=>kS(e),FD=e=>t=>wS(e,t),zD=e=>t=>SS(e,t),VD=e=>()=>Gv(e),ZD=e=>be(e,"items"),UD=e=>be(e,"format"),jD=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],WD=e=>U(e,((e,t)=>{if(ve(t,"items")){const o=WD(t.items);return{customFormats:e.customFormats.concat(o.customFormats),formats:e.formats.concat([{title:t.title,items:o.formats}])}}if((e=>ve(e,"inline"))(t)||(e=>ve(e,"block"))(t)||(e=>ve(e,"selector"))(t)){const o=`custom-${s(t.name)?t.name:t.title.toLowerCase()}`;return{customFormats:e.customFormats.concat([{name:o,format:t}]),formats:e.formats.concat([{title:t.title,format:o,icon:t.icon}])}}return{...e,formats:e.formats.concat(t)}}),{customFormats:[],formats:[]}),$D=e=>Tv(e).map((t=>{const o=((e,t)=>{const o=WD(t),n=t=>{F(t,(t=>{e.formatter.has(t.name)||e.formatter.register(t.name,t.format)}))};return e.formatter?n(o.customFormats):e.on("init",(()=>{n(o.customFormats)})),o.formats})(e,t);return Ov(e)?jD.concat(o):o})).getOr(jD),qD=(e,t,o)=>({...e,type:"formatter",isSelected:t(e.format),getStylePreview:o(e.format)}),GD=(e,t,o,n)=>{const r=t=>P(t,(t=>ZD(t)?(e=>{const t=r(e.items);return{...e,type:"submenu",getStyleItems:w(t)}})(t):UD(t)?(e=>qD(e,o,n))(t):(e=>{const t=se(e);return 1===t.length&&B(t,"title")})(t)?{...t,type:"separator"}:(t=>{const r=s(t.name)?t.name:Xi(t.title),a=`custom-${r}`,i={...t,type:"formatter",format:a,isSelected:o(a),getStylePreview:n(a)};return e.formatter.register(r,i),i})(t)));return r(t)},KD=e=>{let t=0;const o=e=>[{dom:{tag:"div",classes:["tox-tooltip__body"]},components:[Hl(e.tooltipText)]}];return{getConfig:n=>({delayForShow:()=>t>0?60:300,delayForHide:w(300),exclusive:!0,lazySink:e,tooltipDom:{tag:"div",classes:["tox-tooltip","tox-tooltip--up"]},tooltipComponents:o(n),onShow:(e,o)=>{t++,n.onShow&&n.onShow(e,o)},onHide:(e,o)=>{t--,n.onHide&&n.onHide(e,o)}}),getComponents:o}},YD=jT.trim,XD=e=>t=>{if((e=>g(e)&&1===e.nodeType)(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1},JD=XD("true"),QD=XD("false"),eM=(e,t,o,n,r)=>({type:e,title:t,url:o,level:n,attach:r}),tM=e=>e.innerText||e.textContent,oM=e=>(e=>e&&"A"===e.nodeName&&void 0!==(e.id||e.name))(e)&&rM(e),nM=e=>e&&/^(H[1-6])$/.test(e.nodeName),rM=e=>(e=>{let t=e;for(;t=t.parentNode;){const e=t.contentEditable;if(e&&"inherit"!==e)return JD(t)}return!1})(e)&&!QD(e),sM=e=>nM(e)&&rM(e),aM=e=>{var t;const o=(e=>e.id?e.id:Xi("h"))(e);return eM("header",null!==(t=tM(e))&&void 0!==t?t:"","#"+o,(e=>nM(e)?parseInt(e.nodeName.substr(1),10):0)(e),(()=>{e.id=o}))},iM=e=>{const t=e.id||e.name,o=tM(e);return eM("anchor",o||"#"+t,"#"+t,0,v)},lM=e=>{const t=(o="h1,h2,h3,h4,h5,h6,a:not([href])",n=e,P(sm(Be.fromDom(n),o),(e=>e.dom)));var o,n;return t},cM=e=>YD(e.title).length>0,dM=e=>{const t=lM(e);return V((e=>P(V(e,sM),aM))(t).concat((e=>P(V(e,oM),iM))(t)),cM)},mM="tinymce-url-history",uM=e=>s(e)&&/^https?/.test(e),gM=e=>a(e)&&he(e,(e=>{return!(l(t=e)&&t.length<=5&&G(t,uM));var t})).isNone(),hM=()=>{const e=aS.getItem(mM);if(null===e)return{};let t;try{t=JSON.parse(e)}catch(e){if(e instanceof SyntaxError)return console.log("Local storage "+mM+" was not valid JSON",e),{};throw e}return gM(t)?t:(console.log("Local storage "+mM+" was not valid format",t),{})},pM=e=>{const t=hM();return fe(t,e).getOr([])},fM=(e,t)=>{if(!uM(e))return;const o=hM(),n=fe(o,t).getOr([]),r=V(n,(t=>t!==e));o[t]=[e].concat(r).slice(0,5),(e=>{if(!gM(e))throw new Error("Bad format for history:\n"+JSON.stringify(e));aS.setItem(mM,JSON.stringify(e))})(o)},vM=e=>!!e,bM=e=>le(jT.makeMap(e,/[, ]/),vM),yM=e=>A.from(Vv(e)),wM=(e,t)=>{const o=(e=>{const t=A.from(jv(e)).filter(vM).map(bM);return yM(e).fold(T,(e=>t.fold(O,(e=>se(e).length>0&&e))))})(e);return d(o)?o?yM(e):A.none():o[t]?yM(e):A.none()},xM=e=>A.from(e).filter(s).getOrUndefined(),CM=e=>({getHistory:pM,addToHistory:fM,getLinkInformation:()=>(e=>Wv(e)?A.some({targets:dM(e.getBody()),anchorTop:xM($v(e)),anchorBottom:xM(qv(e))}):A.none())(e),getValidationHandler:()=>(e=>A.from(Zv(e)))(e),getUrlPicker:t=>((e,t)=>wM(e,t).map((o=>n=>mk((r=>{const i={filetype:t,fieldname:n.fieldname,...A.from(n.meta).getOr({})};o.call(e,((e,t)=>{if(!s(e))throw new Error("Expected value to be string");if(void 0!==t&&!a(t))throw new Error("Expected meta to be a object");r({value:e,meta:t})}),n.value,i)})))))(e,t)}),SM=(e,t,o,n)=>{const r=Qo(!1),s=(e=>{const t=Qo(ub(e)?"bottom":"top");return{isPositionedAtTop:()=>"top"===t.get(),getDockingMode:t.get,setDockingMode:t.set}})(t),a={icons:()=>t.ui.registry.getAll().icons,menuItems:()=>t.ui.registry.getAll().menuItems,translate:Fy.translate,isDisabled:()=>t.mode.isReadOnly()||!t.ui.isEnabled(),getOption:t.options.get,tooltips:KD(e.dialog)},i=CM(t),l=(e=>{const t=t=>()=>e.formatter.match(t),o=t=>()=>{const o=e.formatter.get(t);return void 0!==o?A.some({tag:o.length>0&&(o[0].inline||o[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):A.none()},n=Qo([]),r=Qo([]),s=Qo(!1);return e.on("PreInit",(r=>{const s=$D(e),a=GD(e,s,t,o);n.set(a)})),e.on("addStyleModifications",(n=>{const a=GD(e,n.items,t,o);r.set(a),s.set(n.replace)})),{getData:()=>{const e=s.get()?[]:n.get(),t=r.get();return e.concat(t)}}})(t),c=(e=>({colorPicker:ID(e),hasCustomColors:PD(e),getColors:FD(e),getColorCols:zD(e)}))(t),d=(e=>({isDraggableModal:VD(e)}))(t),m={shared:{providers:a,anchors:HD(t,o,n,s.isPositionedAtTop),header:s},urlinput:i,styles:l,colorinput:c,dialog:d,isContextMenuOpen:()=>r.get(),setContextMenuState:e=>r.set(e)},u=e=>A.none(),g={...m,shared:{...m.shared,interpreter:e=>dD(e,{},g,u),getSink:e.popup}},h={...m,shared:{...m.shared,interpreter:e=>dD(e,{},h,u),getSink:e.dialog}};return{popup:g,dialog:h}},kM=Ag,_M=ug,EM=w([Mr("shell",!1),hr("makeItem"),Mr("setupItem",v),Lu("listBehaviours",[vf])]),TM=cg({name:"items",overrides:()=>({behaviours:Sa([vf.config({})])})}),OM=w([TM]),AM=Hg({name:w("CustomList")(),configFields:EM(),partFields:OM(),factory:(e,t,o,n)=>{const r=e.shell?{behaviours:[vf.config({})],components:[]}:{behaviours:[],components:t},s=t=>e.shell?A.some(t):xg(t,e,"items");return{uid:e.uid,dom:e.dom,components:r.components,behaviours:Bu(e.listBehaviours,r.behaviours),apis:{setItems:(t,o)=>{s(t).fold((()=>{throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")}),(n=>{const r=vf.contents(n),s=o.length,a=s-r.length,i=a>0?H(a,(()=>e.makeItem())):[],l=r.slice(s);F(l,(e=>vf.remove(n,e))),F(i,(e=>vf.append(n,e)));const c=vf.contents(n);F(c,((n,r)=>{e.setupItem(t,n,o[r],r)}))}))}}}},apis:{setItems:(e,t,o)=>{e.setItems(t,o)}}}),DM=w([hr("dom"),Mr("shell",!0),Nu("toolbarBehaviours",[vf])]),MM=w([cg({name:"groups",overrides:()=>({behaviours:Sa([vf.config({})])})})]),NM=Hg({name:"Toolbar",configFields:DM(),partFields:MM(),factory:(e,t,o,n)=>{const r=t=>e.shell?A.some(t):xg(t,e,"groups"),s=e.shell?{behaviours:[vf.config({})],components:[]}:{behaviours:[],components:t};return{uid:e.uid,dom:e.dom,components:s.components,behaviours:Bu(e.toolbarBehaviours,s.behaviours),apis:{setGroups:(e,t)=>{r(e).fold((()=>{throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")}),(e=>{vf.set(e,t)}))},refresh:v},domModification:{attributes:{role:"group"}}}},apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)}}}),RM=v,BM=T,LM=w([]);var HM=Object.freeze({__proto__:null,setup:RM,isDocked:BM,getBehaviours:LM});const IM=w(Xi("toolbar-height-change")),PM={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},FM="tox-tinymce--toolbar-sticky-on",zM="tox-tinymce--toolbar-sticky-off",VM=(e,t)=>B(qi.getModes(e),t),ZM=e=>{const t=e.element;rt(t).each((o=>{const n="padding-"+qi.getModes(e)[0];if(qi.isDocked(e)){const e=Xt(o);Mt(t,"width",e+"px"),Mt(o,n,(e=>jt(e)+(parseInt(Bt(e,"margin-top"),10)||0)+(parseInt(Bt(e,"margin-bottom"),10)||0))(t)+"px")}else Ft(t,"width"),Ft(o,n)}))},UM=(e,t)=>{t?(Ha(e,PM.fadeOutClass),Fa(e,[PM.transitionClass,PM.fadeInClass])):(Ha(e,PM.fadeInClass),Fa(e,[PM.fadeOutClass,PM.transitionClass]))},jM=(e,t)=>{const o=Be.fromDom(e.getContainer());t?(Ba(o,FM),Ha(o,zM)):(Ba(o,zM),Ha(o,FM))},WM=(e,t)=>{const o=on(),n=t.getSink,r=e=>{n().each((t=>e(t.element)))},s=t=>{e.inline||ZM(t),jM(e,qi.isDocked(t)),t.getSystem().broadcastOn([gu()],{}),n().each((e=>e.getSystem().broadcastOn([gu()],{})))},a=e.inline?[]:[Pc.config({channels:{[IM()]:{onReceive:ZM}}})];return[Sf.config({}),qi.config({contextual:{lazyContext:t=>{const o=jt(t.element),n=e.inline?e.getContentAreaContainer():e.getContainer();return A.from(n).map((n=>{const r=Ko(Be.fromDom(n));return kb(e,t.element).fold((()=>{const e=r.height-o,n=r.y+(VM(t,"top")?0:o);return Go(r.x,n,r.width,e)}),(e=>{const n=Xo(r,_b(e)),s=VM(t,"top")?n.y:n.y+o;return Go(n.x,s,n.width,n.height-o)}))}))},onShow:()=>{r((e=>UM(e,!0)))},onShown:e=>{r((e=>za(e,[PM.transitionClass,PM.fadeInClass]))),o.get().each((t=>{((e,t)=>{const o=Qe(t);Uc(o).filter((e=>!Xe(t,e))).filter((t=>Xe(t,Be.fromDom(o.dom.body))||Je(e,t))).each((()=>zc(t)))})(e.element,t),o.clear()}))},onHide:e=>{((e,t)=>jc(e).orThunk((()=>t().toOptional().bind((e=>jc(e.element))))))(e.element,n).fold(o.clear,o.set),r((e=>UM(e,!1)))},onHidden:()=>{r((e=>za(e,[PM.transitionClass])))},...PM},lazyViewport:t=>kb(e,t.element).fold((()=>{const o=Jo(),n=Pv(e),r=o.y+(VM(t,"top")?n:0),s=o.height-(VM(t,"bottom")?n:0);return{bounds:Go(o.x,r,o.width,s),optScrollEnv:A.none()}}),(e=>({bounds:_b(e),optScrollEnv:A.some({currentScrollTop:e.element.dom.scrollTop,scrollElmTop:Gt(e.element).top})}))),modes:[t.header.getDockingMode()],onDocked:s,onUndocked:s}),...a]};var $M=Object.freeze({__proto__:null,setup:(e,t,o)=>{e.inline||(t.header.isPositionedAtTop()||e.on("ResizeEditor",(()=>{o().each(qi.reset)})),e.on("ResizeWindow ResizeEditor",(()=>{o().each(ZM)})),e.on("SkinLoaded",(()=>{o().each((e=>{qi.isDocked(e)?qi.reset(e):qi.refresh(e)}))})),e.on("FullscreenStateChanged",(()=>{o().each(qi.reset)}))),e.on("AfterScrollIntoView",(e=>{o().each((t=>{qi.refresh(t);const o=t.element;ep(o)&&((e,t)=>{const o=Qe(t),n=ot(t).dom.innerHeight,r=zo(o),s=Be.fromDom(e.elm),a=Yo(s),i=Ut(s),l=a.y,c=l+i,d=Gt(t),m=Ut(t),u=d.top,g=u+m,h=Math.abs(u-r.top)<2,p=Math.abs(g-(r.top+n))<2;if(h&&lu){const e=l-n+i+m;Vo(r.left,e,o)}})(e,o)}))})),e.on("PostRender",(()=>{jM(e,!1)}))},isDocked:e=>e().map(qi.isDocked).getOr(!1),getBehaviours:WM});const qM=Zn([Vw,pr("items",jn([$n([Zw,Cr("items",Yn)]),Yn]))].concat(bx)),GM=[Er("text"),Er("tooltip"),Er("icon"),Nr("search",!1,jn([Xn,Zn([Er("placeholder")])],(e=>d(e)?e?A.some({placeholder:A.none()}):A.none():A.some(e)))),yr("fetch"),Ir("onSetup",(()=>v))],KM=Zn([Vw,...GM]),YM=e=>sr("menubutton",KM,e),XM=Zn([Vw,nx,ox,ex,ax,Gw,Jw,Lr("presets","normal",["normal","color","listpreview"]),mx(1),Yw,Xw]);var JM=Lg({factory:(e,t)=>{const o={focus:lf.focusIn,setMenus:(e,o)=>{const n=P(o,(e=>{const o={type:"menubutton",text:e.text,fetch:t=>{t(e.getItems())}},n=YM(o).mapError((e=>lr(e))).getOrDie();return dA(n,"tox-mbtn",t.backstage,A.some("menuitem"))}));vf.set(e,n)}};return{uid:e.uid,dom:e.dom,components:[],behaviours:Sa([vf.config({}),bf("menubar-events",[da((t=>{e.onSetup(t)})),oa(is(),((e,t)=>{Yl(e.element,".tox-mbtn--active").each((o=>{Xl(t.event.target,".tox-mbtn").each((t=>{Xe(o,t)||e.getSystem().getByDom(o).each((o=>{e.getSystem().getByDom(t).each((e=>{Tk.expand(e),Tk.close(o),Sf.focus(e)}))}))}))}))})),oa(zs(),((e,t)=>{t.event.prevFocus.bind((t=>e.getSystem().getByDom(t).toOptional())).each((o=>{t.event.newFocus.bind((t=>e.getSystem().getByDom(t).toOptional())).each((e=>{Tk.isOpen(o)&&(Tk.expand(e),Tk.close(o))}))}))}))]),lf.config({mode:"flow",selector:".tox-mbtn",onEscape:t=>(e.onEscape(t),A.some(!0))}),Mb.config({})]),apis:o,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[hr("dom"),hr("uid"),hr("onEscape"),hr("backstage"),Mr("onSetup",v)],apis:{focus:(e,t)=>{e.focus(t)},setMenus:(e,t,o)=>{e.setMenus(t,o)}}});const QM="container",eN=[Nu("slotBehaviours",[])],tN=e=>"",oN=(e,t)=>{const o=t=>_g(e),n=(t,o)=>(n,r)=>xg(n,e,r).map((e=>t(e,r))).getOr(o),r=(e,t)=>"true"!==_t(e.element,"aria-hidden"),s=n(r,!1),a=n(((e,t)=>{if(r(e)){const o=e.element;Mt(o,"display","none"),St(o,"aria-hidden","true"),Gs(e,Vs(),{name:t,visible:!1})}})),i=(e=>(t,o)=>{F(o,(o=>e(t,o)))})(a),l=n(((e,t)=>{if(!r(e)){const o=e.element;Ft(o,"display"),Ot(o,"aria-hidden"),Gs(e,Vs(),{name:t,visible:!0})}})),c={getSlotNames:o,getSlot:(t,o)=>xg(t,e,o),isShowing:s,hideSlot:a,hideAllSlots:e=>i(e,o()),showSlot:l};return{uid:e.uid,dom:e.dom,components:t,behaviours:Ru(e.slotBehaviours),apis:c}},nN=le({getSlotNames:(e,t)=>e.getSlotNames(t),getSlot:(e,t,o)=>e.getSlot(t,o),isShowing:(e,t,o)=>e.isShowing(t,o),hideSlot:(e,t,o)=>e.hideSlot(t,o),hideAllSlots:(e,t)=>e.hideAllSlots(t),showSlot:(e,t,o)=>e.showSlot(t,o)},(e=>ml(e))),rN={...nN,sketch:e=>{const t=(()=>{const e=[];return{slot:(t,o)=>(e.push(t),fg(QM,tN(t),o)),record:w(e)}})(),o=e(t),n=t.record(),r=P(n,(e=>ig({name:e,pname:tN(e)})));return Mg(QM,eN,r,oN,o)}},sN=Zn([ox,nx,Ir("onShow",v),Ir("onHide",v),Jw]),aN=e=>({element:()=>e.element.dom}),iN=(e,t)=>{const o=P(se(t),(e=>{const o=t[e],n=ar((e=>sr("sidebar",sN,e))(o));return{name:e,getApi:aN,onSetup:n.onSetup,onShow:n.onShow,onHide:n.onHide}}));return P(o,(t=>{const n=Qo(v);return e.slot(t.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Xx([cC(t,n),dC(t,n),oa(Vs(),((e,t)=>{const n=t.event,r=j(o,(e=>e.name===n.name));r.each((t=>{(n.visible?t.onShow:t.onHide)(t.getApi(e))}))}))])})}))},lN=e=>rN.sketch((t=>({dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:iN(t,e),slotBehaviours:Xx([da((e=>rN.hideAllSlots(e)))])}))),cN=(e,t)=>{St(e,"role",t)},dN=e=>zg.getCurrent(e).bind((e=>{if(lA.isGrowing(e)||lA.hasGrown(e)){return zg.getCurrent(e).bind((e=>j(rN.getSlotNames(e),(t=>rN.isShowing(e,t)))))}return A.none()})),mN=Xi("FixSizeEvent"),uN=Xi("AutoSizeEvent");var gN=Object.freeze({__proto__:null,block:(e,t,o,n)=>{St(e.element,"aria-busy",!0);const r=t.getRoot(e).getOr(e),s=Sa([lf.config({mode:"special",onTab:()=>A.some(!0),onShiftTab:()=>A.some(!0)}),Sf.config({})]),a=n(r,s),i=r.getSystem().build(a);vf.append(r,Vl(i)),i.hasConfigured(lf)&&t.focus&&lf.focusIn(i),o.isBlocked()||t.onBlock(e),o.blockWith((()=>vf.remove(r,i)))},unblock:(e,t,o)=>{Ot(e.element,"aria-busy"),o.isBlocked()&&t.onUnblock(e),o.clear()},isBlocked:(e,t,o)=>o.isBlocked()}),hN=[Ir("getRoot",A.none),Hr("focus",!0),Fi("onBlock"),Fi("onUnblock")];const pN=_a({fields:hN,name:"blocking",apis:gN,state:Object.freeze({__proto__:null,init:()=>{const e=en((e=>e.destroy()));return Ca({readState:e.isSet,blockWith:t=>{e.set({destroy:t})},clear:e.clear,isBlocked:e.isSet})}})}),fN=e=>zg.getCurrent(e).each((e=>zc(e.element,!0))),vN=(e,t,o,n)=>{const r=t.element;if(((e,t)=>{const o="tabindex",n=`data-mce-${o}`;A.from(e.iframeElement).map(Be.fromDom).each((e=>{t?(Et(e,o).each((t=>St(e,n,t))),St(e,o,-1)):(Ot(e,o),Et(e,n).each((t=>{St(e,o,t),Ot(e,n)})))}))})(e,o),o)pN.block(t,(e=>(t,o)=>({dom:{tag:"div",attributes:{"aria-label":e.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:Tb('
    ')}]}))(n)),Ft(r,"display"),Ot(r,"aria-hidden"),e.hasFocus()&&fN(t);else{const o=zg.getCurrent(t).exists((e=>Zc(e.element)));pN.unblock(t),Mt(r,"display","none"),St(r,"aria-hidden","true"),o&&e.focus()}},bN=(e,t,o)=>{const n=Qo(!1),r=on(),s=o=>{n.get()&&!(e=>{if((e=>"focusin"===e.type)(e))return(e.composed?te(e.composedPath()):A.from(e.target)).map(Be.fromDom).filter(Ue).exists((e=>Pa(e,"mce-pastebin")));return!1})(o)&&(o.preventDefault(),fN(t()),e.editorManager.setActive(e))};e.inline||e.on("PreInit",(()=>{e.dom.bind(e.getWin(),"focusin",s),e.on("BeforeExecCommand",(e=>{"mcefocus"===e.command.toLowerCase()&&!0!==e.value&&s(e)}))}));const a=r=>{r!==n.get()&&(n.set(r),vN(e,t(),r,o.providers),((e,t)=>{e.dispatch("AfterProgressState",{state:t})})(e,r))};e.on("ProgressState",(t=>{if(r.on(clearTimeout),p(t.time)){const o=gv.setEditorTimeout(e,(()=>a(t.state)),t.time);r.set(o)}else a(t.state),r.clear()}))},yN=(e,t,o)=>({within:e,extra:t,withinWidth:o}),wN=(e,t,o)=>{const n=((e,t)=>{const o=U(e,((e,o)=>t(o,e.len).fold(w(e),(t=>({len:t.finish,list:e.list.concat([t])})))),{len:0,list:[]});return o.list})(e,((e,t)=>{const n=o(e);return A.some({element:e,start:t,finish:t+n,width:n})})),r=V(n,(e=>e.finish<=t)),s=Z(r,((e,t)=>e+t.width),0);return{within:r,extra:n.slice(r.length),withinWidth:s}},xN=e=>P(e,(e=>e.element)),CN=(e,t,o,n)=>{const r=((e,t,o)=>{const n=wN(t,e,o);return 0===n.extra.length?A.some(n):A.none()})(e,t,o).getOrThunk((()=>wN(t,e-o(n),o))),s=r.within,a=r.extra,i=r.withinWidth;return 1===a.length&&a[0].width<=o(n)?((e,t,o)=>{const n=xN(e.concat(t));return yN(n,[],o)})(s,a,i):a.length>=1?((e,t,o,n)=>{const r=xN(e).concat([o]);return yN(r,xN(t),n)})(s,a,n,i):((e,t,o)=>yN(xN(e),[],o))(s,0,i)},SN=(e,t)=>{const o=P(t,(e=>Vl(e)));NM.setGroups(e,o)},kN=(e,t,o)=>{const n=t.builtGroups.get();if(0===n.length)return;const r=Cg(e,t,"primary"),s=ak.getCoupled(e,"overflowGroup");Mt(r.element,"visibility","hidden");const a=n.concat([s]),i=re(a,(e=>jc(e.element).bind((t=>e.getSystem().getByDom(t).toOptional()))));o([]),SN(r,a);const l=Xt(r.element),c=CN(l,t.builtGroups.get(),(e=>Math.ceil(e.element.dom.getBoundingClientRect().width)),s);0===c.extra.length?(vf.remove(r,s),o([])):(SN(r,c.within),o(c.extra)),Ft(r.element,"visibility"),zt(r.element),i.each(Sf.focus)},_N=w([Nu("splitToolbarBehaviours",[ak]),ur("builtGroups",(()=>Qo([])))]),EN=w([Ii(["overflowToggledClass"]),Or("getOverflowBounds"),hr("lazySink"),ur("overflowGroups",(()=>Qo([]))),Fi("onOpened"),Fi("onClosed")].concat(_N())),TN=w([ig({factory:NM,schema:DM(),name:"primary"}),lg({schema:DM(),name:"overflow"}),lg({name:"overflow-button"}),lg({name:"overflow-group"})]),ON=w(((e,t)=>{((e,t)=>{const o=Yt.max(e,t,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Mt(e,"max-width",o+"px")})(e,Math.floor(t))})),AN=w([Ii(["toggledClass"]),hr("lazySink"),yr("fetch"),Or("getBounds"),Dr("fireDismissalEventInstead",[Mr("event",Ps())]),Md(),Fi("onToggled")]),DN=w([lg({name:"button",overrides:e=>({dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:Sa([Mf.config({toggleClass:e.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1,onToggled:e.onToggled})])})}),lg({factory:NM,schema:DM(),name:"toolbar",overrides:e=>({toolbarBehaviours:Sa([lf.config({mode:"cyclic",onEscape:t=>(xg(t,e,"button").each(Sf.focus),A.none())})])})})]),MN=on(),NN=(e,t)=>{const o=ak.getCoupled(e,"toolbarSandbox");mu.isOpen(o)?mu.close(o):mu.open(o,t.toolbar())},RN=(e,t,o,n)=>{const r=o.getBounds.map((e=>e())),s=o.lazySink(e).getOrDie();Pm.positionWithinBounds(s,t,{anchor:{type:"hotspot",hotspot:e,layouts:n,overrides:{maxWidthFunction:ON()}}},r)},BN=(e,t,o,n,r)=>{NM.setGroups(t,r),RN(e,t,o,n),Mf.on(e)},LN=Hg({name:"FloatingToolbarButton",factory:(e,t,o,n)=>({...Eb.sketch({...n.button(),action:e=>{NN(e,n)},buttonBehaviours:Hu({dump:n.button().buttonBehaviours},[ak.config({others:{toolbarSandbox:t=>((e,t,o)=>{const n=Ql();return{dom:{tag:"div",attributes:{id:n.id}},behaviours:Sa([lf.config({mode:"special",onEscape:e=>(mu.close(e),A.some(!0))}),mu.config({onOpen:(r,s)=>{const a=MN.get().getOr(!1);o.fetch().get((r=>{BN(e,s,o,t.layouts,r),n.link(e.element),a||lf.focusIn(s)}))},onClose:()=>{Mf.off(e),MN.get().getOr(!1)||Sf.focus(e),n.unlink(e.element)},isPartOf:(t,o,n)=>tc(o,n)||tc(e,n),getAttachPoint:()=>o.lazySink(e).getOrDie()}),Pc.config({channels:{...fu({isExtraPart:T,...o.fireDismissalEventInstead.map((e=>({fireEventInstead:{event:e.event}}))).getOr({})}),...bu({doReposition:()=>{mu.getState(ak.getCoupled(e,"toolbarSandbox")).each((n=>{RN(e,n,o,t.layouts)}))}})}})])}})(t,o,e)}})])}),apis:{setGroups:(t,n)=>{mu.getState(ak.getCoupled(t,"toolbarSandbox")).each((r=>{BN(t,r,e,o.layouts,n)}))},reposition:t=>{mu.getState(ak.getCoupled(t,"toolbarSandbox")).each((n=>{RN(t,n,e,o.layouts)}))},toggle:e=>{NN(e,n)},toggleWithoutFocusing:e=>{((e,t)=>{MN.set(!0),NN(e,t),MN.clear()})(e,n)},getToolbar:e=>mu.getState(ak.getCoupled(e,"toolbarSandbox")),isOpen:e=>mu.isOpen(ak.getCoupled(e,"toolbarSandbox"))}}),configFields:AN(),partFields:DN(),apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)},reposition:(e,t)=>{e.reposition(t)},toggle:(e,t)=>{e.toggle(t)},toggleWithoutFocusing:(e,t)=>{e.toggleWithoutFocusing(t)},getToolbar:(e,t)=>e.getToolbar(t),isOpen:(e,t)=>e.isOpen(t)}}),HN=w([hr("items"),Ii(["itemSelector"]),Nu("tgroupBehaviours",[lf])]),IN=w([dg({name:"items",unit:"item"})]),PN=Hg({name:"ToolbarGroup",configFields:HN(),partFields:IN(),factory:(e,t,o,n)=>({uid:e.uid,dom:e.dom,components:t,behaviours:Bu(e.tgroupBehaviours,[lf.config({mode:"flow",selector:e.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}})}),FN=e=>P(e,(e=>Vl(e))),zN=(e,t,o)=>{kN(e,o,(n=>{o.overflowGroups.set(n),t.getOpt(e).each((e=>{LN.setGroups(e,FN(n))}))}))},VN=Hg({name:"SplitFloatingToolbar",configFields:EN(),partFields:TN(),factory:(e,t,o,n)=>{const r=Ob(LN.sketch({fetch:()=>mk((t=>{t(FN(e.overflowGroups.get()))})),layouts:{onLtr:()=>[Sc,Cc],onRtl:()=>[Cc,Sc],onBottomLtr:()=>[_c,kc],onBottomRtl:()=>[kc,_c]},getBounds:o.getOverflowBounds,lazySink:e.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:e.markers.overflowToggledClass},parts:{button:n["overflow-button"](),toolbar:n.overflow()},onToggled:(t,o)=>e[o?"onOpened":"onClosed"](t)}));return{uid:e.uid,dom:e.dom,components:t,behaviours:Bu(e.splitToolbarBehaviours,[ak.config({others:{overflowGroup:()=>PN.sketch({...n["overflow-group"](),items:[r.asSpec()]})}})]),apis:{setGroups:(t,o)=>{e.builtGroups.set(P(o,t.getSystem().build)),zN(t,r,e)},refresh:t=>zN(t,r,e),toggle:e=>{r.getOpt(e).each((e=>{LN.toggle(e)}))},toggleWithoutFocusing:e=>{r.getOpt(e).each(LN.toggleWithoutFocusing)},isOpen:e=>r.getOpt(e).map(LN.isOpen).getOr(!1),reposition:e=>{r.getOpt(e).each((e=>{LN.reposition(e)}))},getOverflow:e=>r.getOpt(e).bind(LN.getToolbar)},domModification:{attributes:{role:"group"}}}},apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)},refresh:(e,t)=>{e.refresh(t)},reposition:(e,t)=>{e.reposition(t)},toggle:(e,t)=>{e.toggle(t)},toggleWithoutFocusing:(e,t)=>{e.toggle(t)},isOpen:(e,t)=>e.isOpen(t),getOverflow:(e,t)=>e.getOverflow(t)}}),ZN=w([Ii(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Fi("onOpened"),Fi("onClosed")].concat(_N())),UN=w([ig({factory:NM,schema:DM(),name:"primary"}),ig({factory:NM,schema:DM(),name:"overflow",overrides:e=>({toolbarBehaviours:Sa([lA.config({dimension:{property:"height"},closedClass:e.markers.closedClass,openClass:e.markers.openClass,shrinkingClass:e.markers.shrinkingClass,growingClass:e.markers.growingClass,onShrunk:t=>{xg(t,e,"overflow-button").each((e=>{Mf.off(e)})),e.onClosed(t)},onGrown:t=>{e.onOpened(t)},onStartGrow:t=>{xg(t,e,"overflow-button").each(Mf.on)}}),lf.config({mode:"acyclic",onEscape:t=>(xg(t,e,"overflow-button").each(Sf.focus),A.some(!0))})])})}),lg({name:"overflow-button",overrides:e=>({buttonBehaviours:Sa([Mf.config({toggleClass:e.markers.overflowToggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])})}),lg({name:"overflow-group"})]),jN=(e,t,o)=>{xg(e,t,"overflow-button").each((n=>{xg(e,t,"overflow").each((r=>{if(WN(e,t),lA.hasShrunk(r)){const e=t.onOpened;t.onOpened=n=>{o||lf.focusIn(r),e(n),t.onOpened=e}}else{const e=t.onClosed;t.onClosed=r=>{o||Sf.focus(n),e(r),t.onClosed=e}}lA.toggleGrow(r)}))}))},WN=(e,t)=>{xg(e,t,"overflow").each((o=>{kN(e,t,(e=>{const t=P(e,(e=>Vl(e)));NM.setGroups(o,t)})),xg(e,t,"overflow-button").each((e=>{lA.hasGrown(o)&&Mf.on(e)})),lA.refresh(o)}))},$N=Hg({name:"SplitSlidingToolbar",configFields:ZN(),partFields:UN(),factory:(e,t,o,n)=>{const r="alloy.toolbar.toggle";return{uid:e.uid,dom:e.dom,components:t,behaviours:Bu(e.splitToolbarBehaviours,[ak.config({others:{overflowGroup:e=>PN.sketch({...n["overflow-group"](),items:[Eb.sketch({...n["overflow-button"](),action:t=>{qs(e,r)}})]})}}),bf("toolbar-toggle-events",[oa(r,(t=>{jN(t,e,!1)}))])]),apis:{setGroups:(t,o)=>{((t,o)=>{const n=P(o,t.getSystem().build);e.builtGroups.set(n)})(t,o),WN(t,e)},refresh:t=>WN(t,e),toggle:t=>{jN(t,e,!1)},toggleWithoutFocusing:t=>{jN(t,e,!0)},isOpen:t=>((e,t)=>xg(e,t,"overflow").map(lA.hasGrown).getOr(!1))(t,e)},domModification:{attributes:{role:"group"}}}},apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)},refresh:(e,t)=>{e.refresh(t)},toggle:(e,t)=>{e.toggle(t)},isOpen:(e,t)=>e.isOpen(t)}}),qN=e=>{const t=e.title.fold((()=>({})),(e=>({attributes:{title:e}})));return{dom:{tag:"div",classes:["tox-toolbar__group"],...t},components:[PN.parts.items({})],items:e.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled]), .tox-number-input:not([disabled])"},tgroupBehaviours:Sa([Mb.config({}),Sf.config({})])}},GN=e=>PN.sketch(qN(e)),KN=(e,t)=>{const o=da((t=>{const o=P(e.initGroups,GN);NM.setGroups(t,o)}));return Sa([iC(e.providers.isDisabled),nC(),lf.config({mode:t,onEscape:e.onEscape,selector:".tox-toolbar__group"}),bf("toolbar-events",[o])])},YN=e=>{const t=e.cyclicKeying?"cyclic":"acyclic";return{uid:e.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":qN({title:A.none(),items:[]}),"overflow-button":FA({name:"more",icon:A.some("more-drawer"),enabled:!0,tooltip:A.some("Reveal or hide additional toolbar items"),primary:!1,buttonType:A.none(),borderless:!1},A.none(),e.providers,[],"overflow-button")},splitToolbarBehaviours:KN(e,t)}},XN=e=>{const t=YN(e),o=VN.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return VN.sketch({...t,lazySink:e.getSink,getOverflowBounds:()=>{const t=e.moreDrawerData.lazyHeader().element,o=Yo(t),n=tt(t),r=Yo(n),s=Math.max(n.dom.scrollHeight,r.height);return Go(o.x+4,r.y,o.width-8,s)},parts:{...t.parts,overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:e.attributes}}},components:[o],markers:{overflowToggledClass:"tox-tbtn--enabled"},onOpened:t=>e.onToggled(t,!0),onClosed:t=>e.onToggled(t,!1)})},JN=e=>{const t=$N.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),o=$N.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),n=YN(e);return $N.sketch({...n,components:[t,o],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:t=>{t.getSystem().broadcastOn([IM()],{type:"opened"}),e.onToggled(t,!0)},onClosed:t=>{t.getSystem().broadcastOn([IM()],{type:"closed"}),e.onToggled(t,!1)}})},QN=e=>{const t=e.cyclicKeying?"cyclic":"acyclic";return NM.sketch({uid:e.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(e.type===mv.scrolling?["tox-toolbar--scrolling"]:[])},components:[NM.parts.groups({})],toolbarBehaviours:KN(e,t)})},eR=[ex,ox,Er("tooltip"),Lr("buttonType","secondary",["primary","secondary"]),Hr("borderless",!1),yr("onAction")],tR={button:[...eR,jw,br("type",["button"])],togglebutton:[...eR,Hr("active",!1),br("type",["togglebutton"])]},oR=[br("type",["group"]),Pr("buttons",[],cr("type",tR))],nR=cr("type",{...tR,group:oR}),rR=Zn([Pr("buttons",[],nR),yr("onShow"),yr("onHide")]),sR=(e,t)=>((e,t)=>{var o,n;const r="togglebutton"===e.type,s=e.icon.map((e=>SO(e,t.icons))).map(Ob),a=o=>{const n=e=>{s.map((n=>n.getOpt(o).each((o=>{vf.set(o,[SO(e,t.icons)])}))))},a=e=>{const t=o.element;e?(Ba(t,"tox-button--enabled"),St(t,"aria-pressed",!0)):(Ha(t,"tox-button--enabled"),Ot(t,"aria-pressed"))},i=()=>Pa(o.element,"tox-button--enabled");return r?e.onAction({setIcon:n,setActive:a,isActive:i}):"button"===e.type?e.onAction({setIcon:n}):void 0},i={...e,name:r?e.text.getOr(e.icon.getOr("")):null!==(o=e.text)&&void 0!==o?o:e.icon.getOr(""),primary:"primary"===e.buttonType,buttonType:A.from(e.buttonType),tooltip:e.tooltip,icon:e.icon,enabled:!0,borderless:e.borderless},l=zA(null!==(n=e.buttonType)&&void 0!==n?n:"secondary"),c=r?e.text.map(t.translate):A.some(t.translate(e.text)),d=c.map(Hl),m=i.tooltip.or(c).map((e=>({"aria-label":t.translate(e)}))).getOr({}),u=s.map((e=>e.asSpec())),g=gC([u,d]),h=e.icon.isSome()&&d.isSome(),p={tag:"button",classes:l.concat(...e.icon.isSome()&&!h?["tox-button--icon"]:[]).concat(...h?["tox-button--icon-and-text"]:[]).concat(...e.borderless?["tox-button--naked"]:[]).concat(..."togglebutton"===e.type&&e.active?["tox-button--enabled"]:[]),attributes:m},f=PA(i,A.some(a),[],p,g,e.tooltip,t);return Eb.sketch(f)})(e,t),aR=Ao().deviceType,iR=aR.isPhone(),lR=aR.isTablet();var cR=Hg({name:"silver.View",configFields:[hr("viewConfig")],partFields:[cg({factory:{sketch:e=>{let t=!1;const o=P(e.buttons,(o=>"group"===o.type?(t=!0,((e,t)=>({dom:{tag:"div",classes:["tox-view__toolbar__group"]},components:P(e.buttons,(e=>sR(e,t)))}))(o,e.providers)):sR(o,e.providers)));return{uid:e.uid,dom:{tag:"div",classes:[t?"tox-view__toolbar":"tox-view__header",...iR||lR?["tox-view--mobile","tox-view--scrolling"]:[]]},behaviours:Sa([Sf.config({}),lf.config({mode:"flow",selector:"button, .tox-button",focusInside:Bh.OnEnterOrSpaceMode})]),components:t?o:[Qk.sketch({dom:{tag:"div",classes:["tox-view__header-start"]},components:[]}),Qk.sketch({dom:{tag:"div",classes:["tox-view__header-end"]},components:o})]}}},schema:[hr("buttons"),hr("providers")],name:"header"}),cg({factory:{sketch:e=>({uid:e.uid,behaviours:Sa([Sf.config({}),Mb.config({})]),dom:{tag:"div",classes:["tox-view__pane"]}})},schema:[],name:"pane"})],factory:(e,t,o,n)=>{const r={getPane:t=>kM.getPart(t,e,"pane"),getOnShow:t=>e.viewConfig.onShow,getOnHide:t=>e.viewConfig.onHide};return{uid:e.uid,dom:e.dom,components:t,behaviours:Sa([Sf.config({}),lf.config({mode:"cyclic",focusInside:Bh.OnEnterOrSpaceMode})]),apis:r}},apis:{getPane:(e,t)=>e.getPane(t),getOnShow:(e,t)=>e.getOnShow(t),getOnHide:(e,t)=>e.getOnHide(t)}});const dR=(e,t,o)=>ge(t,((t,n)=>{const r=ar(sr("view",rR,t));return e.slot(n,cR.sketch({dom:{tag:"div",classes:["tox-view"]},viewConfig:r,components:[...r.buttons.length>0?[cR.parts.header({buttons:r.buttons,providers:o})]:[],cR.parts.pane({})]}))})),mR=(e,t)=>rN.sketch((o=>({dom:{tag:"div",classes:["tox-view-wrap__slot-container"]},components:dR(o,e,t),slotBehaviours:Xx([da((e=>rN.hideAllSlots(e)))])}))),uR=e=>j(rN.getSlotNames(e),(t=>rN.isShowing(e,t))),gR=(e,t,o)=>{rN.getSlot(e,t).each((e=>{cR.getPane(e).each((t=>{var n;o(e)((n=t.element.dom,{getContainer:w(n)}))}))}))};var hR=Lg({factory:(e,t)=>{const o={setViews:(e,o)=>{vf.set(e,[mR(o,t.backstage.shared.providers)])},whichView:e=>zg.getCurrent(e).bind(uR),toggleView:(e,t,o,n)=>zg.getCurrent(e).exists((r=>{const s=uR(r),a=s.exists((e=>n===e)),i=rN.getSlot(r,n).isSome();return i&&(rN.hideAllSlots(r),a?((e=>{const t=e.element;Mt(t,"display","none"),St(t,"aria-hidden","true")})(e),t()):(o(),(e=>{const t=e.element;Ft(t,"display"),Ot(t,"aria-hidden")})(e),rN.showSlot(r,n),((e,t)=>{gR(e,t,cR.getOnShow)})(r,n)),s.each((e=>((e,t)=>gR(e,t,cR.getOnHide))(r,e)))),i}))};return{uid:e.uid,dom:{tag:"div",classes:["tox-view-wrap"],attributes:{"aria-hidden":"true"},styles:{display:"none"}},components:[],behaviours:Sa([vf.config({}),zg.config({find:e=>{const t=vf.contents(e);return te(t)}})]),apis:o}},name:"silver.ViewWrapper",configFields:[hr("backstage")],apis:{setViews:(e,t,o)=>e.setViews(t,o),toggleView:(e,t,o,n,r)=>e.toggleView(t,o,n,r),whichView:(e,t)=>e.whichView(t)}});const pR=_M.optional({factory:JM,name:"menubar",schema:[hr("backstage")]}),fR=_M.optional({factory:{sketch:e=>AM.sketch({uid:e.uid,dom:e.dom,listBehaviours:Sa([lf.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:()=>QN({type:e.type,uid:Xi("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:e.providers,onEscape:()=>(e.onEscape(),A.some(!0))}),setupItem:(e,t,o,n)=>{NM.setGroups(t,o)},shell:!0})},name:"multiple-toolbar",schema:[hr("dom"),hr("onEscape")]}),vR=_M.optional({factory:{sketch:e=>{const t=(e=>e.type===mv.sliding?JN:e.type===mv.floating?XN:QN)(e);return t({type:e.type,uid:e.uid,onEscape:()=>(e.onEscape(),A.some(!0)),onToggled:(t,o)=>e.onToolbarToggled(o),cyclicKeying:!1,initGroups:[],getSink:e.getSink,providers:e.providers,moreDrawerData:{lazyToolbar:e.lazyToolbar,lazyMoreButton:e.lazyMoreButton,lazyHeader:e.lazyHeader},attributes:e.attributes})}},name:"toolbar",schema:[hr("dom"),hr("onEscape"),hr("getSink")]}),bR=_M.optional({factory:{sketch:e=>{const t=e.editor,o=e.sticky?WM:LM;return{uid:e.uid,dom:e.dom,components:e.components,behaviours:Sa(o(t,e.sharedBackstage))}}},name:"header",schema:[hr("dom")]}),yR=_M.optional({factory:{sketch:e=>({uid:e.uid,dom:e.dom,components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/tinymce-self-hosted-premium-features/?utm_campaign=self_hosted_upgrade_promo&utm_source=tiny&utm_medium=referral",rel:"noopener",target:"_blank","aria-hidden":"true"},classes:["tox-promotion-link"],innerHtml:"⚡️Upgrade"}}]})},name:"promotion",schema:[hr("dom")]}),wR=_M.optional({name:"socket",schema:[hr("dom")]}),xR=_M.optional({factory:{sketch:e=>({uid:e.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"presentation"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:Sa([Mb.config({}),Sf.config({}),lA.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:e=>{zg.getCurrent(e).each(rN.hideAllSlots),qs(e,uN)},onGrown:e=>{qs(e,uN)},onStartGrow:e=>{Gs(e,mN,{width:Ht(e.element,"width").getOr("")})},onStartShrink:e=>{Gs(e,mN,{width:Xt(e.element)+"px"})}}),vf.config({}),zg.config({find:e=>{const t=vf.contents(e);return te(t)}})])}],behaviours:Sa([BT(0),bf("sidebar-sliding-events",[oa(mN,((e,t)=>{Mt(e.element,"width",t.event.width)})),oa(uN,((e,t)=>{Ft(e.element,"width")}))])])})},name:"sidebar",schema:[hr("dom")]}),CR=_M.optional({factory:{sketch:e=>({uid:e.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:Sa([vf.config({}),pN.config({focus:!1}),zg.config({find:e=>te(e.components())})]),components:[]})},name:"throbber",schema:[hr("dom")]}),SR=_M.optional({factory:hR,name:"viewWrapper",schema:[hr("backstage")]}),kR=_M.optional({factory:{sketch:e=>({uid:e.uid,dom:{tag:"div",classes:["tox-editor-container"]},components:e.components})},name:"editorContainer",schema:[]});var _R=Hg({name:"OuterContainer",factory:(e,t,o)=>{let n=!1;const r=e=>{Gl(e,".tox-statusbar").each((e=>{"none"===Bt(e,"display")&&"true"===_t(e,"aria-hidden")?(Ft(e,"display"),Ot(e,"aria-hidden")):(Mt(e,"display","none"),St(e,"aria-hidden","true"))}))},a={getSocket:t=>kM.getPart(t,e,"socket"),setSidebar:(t,o,n)=>{kM.getPart(t,e,"sidebar").each((e=>((e,t,o)=>{zg.getCurrent(e).each((n=>{vf.set(n,[lN(t)]);const r=null==o?void 0:o.toLowerCase();s(r)&&ve(t,r)&&zg.getCurrent(n).each((t=>{rN.showSlot(t,r),lA.immediateGrow(n),Ft(n.element,"width"),cN(e.element,"region")}))}))})(e,o,n)))},toggleSidebar:(t,o)=>{kM.getPart(t,e,"sidebar").each((e=>((e,t)=>{zg.getCurrent(e).each((o=>{zg.getCurrent(o).each((n=>{lA.hasGrown(o)?rN.isShowing(n,t)?(lA.shrink(o),cN(e.element,"presentation")):(rN.hideAllSlots(n),rN.showSlot(n,t),cN(e.element,"region")):(rN.hideAllSlots(n),rN.showSlot(n,t),lA.grow(o),cN(e.element,"region"))}))}))})(e,o)))},whichSidebar:t=>kM.getPart(t,e,"sidebar").bind(dN).getOrNull(),getHeader:t=>kM.getPart(t,e,"header"),getToolbar:t=>kM.getPart(t,e,"toolbar"),setToolbar:(t,o)=>{kM.getPart(t,e,"toolbar").each((e=>{const t=P(o,GN);e.getApis().setGroups(e,t)}))},setToolbars:(t,o)=>{kM.getPart(t,e,"multiple-toolbar").each((e=>{const t=P(o,(e=>P(e,GN)));AM.setItems(e,t)}))},refreshToolbar:t=>{kM.getPart(t,e,"toolbar").each((e=>e.getApis().refresh(e)))},toggleToolbarDrawer:t=>{kM.getPart(t,e,"toolbar").each((e=>{Ce(e.getApis().toggle,(t=>t(e)))}))},toggleToolbarDrawerWithoutFocusing:t=>{kM.getPart(t,e,"toolbar").each((e=>{Ce(e.getApis().toggleWithoutFocusing,(t=>t(e)))}))},isToolbarDrawerToggled:t=>kM.getPart(t,e,"toolbar").bind((e=>A.from(e.getApis().isOpen).map((t=>t(e))))).getOr(!1),getThrobber:t=>kM.getPart(t,e,"throbber"),focusToolbar:t=>{kM.getPart(t,e,"toolbar").orThunk((()=>kM.getPart(t,e,"multiple-toolbar"))).each((e=>{lf.focusIn(e)}))},setMenubar:(t,o)=>{kM.getPart(t,e,"menubar").each((e=>{JM.setMenus(e,o)}))},focusMenubar:t=>{kM.getPart(t,e,"menubar").each((e=>{JM.focus(e)}))},setViews:(t,o)=>{kM.getPart(t,e,"viewWrapper").each((e=>{hR.setViews(e,o)}))},toggleView:(t,o)=>kM.getPart(t,e,"viewWrapper").exists((e=>hR.toggleView(e,(()=>a.showMainView(t)),(()=>a.hideMainView(t)),o))),whichView:t=>kM.getPart(t,e,"viewWrapper").bind(hR.whichView).getOrNull(),hideMainView:t=>{n=a.isToolbarDrawerToggled(t),n&&a.toggleToolbarDrawer(t),kM.getPart(t,e,"editorContainer").each((e=>{const t=e.element;r(t),Mt(t,"display","none"),St(t,"aria-hidden","true")}))},showMainView:t=>{n&&a.toggleToolbarDrawer(t),kM.getPart(t,e,"editorContainer").each((e=>{const t=e.element;r(t),Ft(t,"display"),Ot(t,"aria-hidden")}))}};return{uid:e.uid,dom:e.dom,components:t,apis:a,behaviours:e.behaviours}},configFields:[hr("dom"),hr("behaviours")],partFields:[bR,pR,vR,fR,wR,xR,yR,CR,SR,kR],apis:{getSocket:(e,t)=>e.getSocket(t),setSidebar:(e,t,o,n)=>{e.setSidebar(t,o,n)},toggleSidebar:(e,t,o)=>{e.toggleSidebar(t,o)},whichSidebar:(e,t)=>e.whichSidebar(t),getHeader:(e,t)=>e.getHeader(t),getToolbar:(e,t)=>e.getToolbar(t),setToolbar:(e,t,o)=>{e.setToolbar(t,o)},setToolbars:(e,t,o)=>{e.setToolbars(t,o)},refreshToolbar:(e,t)=>e.refreshToolbar(t),toggleToolbarDrawer:(e,t)=>{e.toggleToolbarDrawer(t)},toggleToolbarDrawerWithoutFocusing:(e,t)=>{e.toggleToolbarDrawerWithoutFocusing(t)},isToolbarDrawerToggled:(e,t)=>e.isToolbarDrawerToggled(t),getThrobber:(e,t)=>e.getThrobber(t),setMenubar:(e,t,o)=>{e.setMenubar(t,o)},focusMenubar:(e,t)=>{e.focusMenubar(t)},focusToolbar:(e,t)=>{e.focusToolbar(t)},setViews:(e,t,o)=>{e.setViews(t,o)},toggleView:(e,t,o)=>e.toggleView(t,o),whichView:(e,t)=>e.whichView(t)}});const ER={file:{title:"File",items:"newdocument restoredraft | preview | importword exportpdf exportword | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code revisionhistory | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed inserttemplate codesample inserttable accordion math | charmap emoticons hr | pagebreak nonbreaking anchor tableofcontents footnotes | mergetags | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | styles blocks fontfamily fontsize align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"aidialog aishortcuts | spellchecker spellcheckerlanguage | autocorrect capitalization | a11ycheck code typography wordcount addtemplate"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},TR=e=>e.split(" "),OR=(e,t)=>{const o={...ER,...t.menus},n=se(t.menus).length>0,r=void 0===t.menubar||!0===t.menubar?TR("file edit view insert format tools table help"):TR(!1===t.menubar?"":t.menubar),a=V(r,(e=>{const o=ve(ER,e);return n?o||fe(t.menus,e).exists((e=>ve(e,"items"))):o})),i=P(a,(n=>{const r=o[n];return((e,t,o)=>{const n=Mv(o).split(/[ ,]/);return{text:e.title,getItems:()=>q(e.items,(e=>{const o=e.toLowerCase();return 0===o.trim().length||L(n,(e=>e===o))?[]:"separator"===o||"|"===o?[{type:"separator"}]:t.menuItems[o]?[t.menuItems[o]]:[]}))}})({title:r.title,items:TR(r.items)},t,e)}));return V(i,(e=>e.getItems().length>0&&L(e.getItems(),(e=>s(e)||"separator"!==e.type))))},AR=(e,t,o)=>(e.on("remove",(()=>o.unload(t))),o.load(t)),DR=(e,t,o,n)=>(e.on("remove",(()=>n.unloadRawCss(t))),n.loadRawCss(t,o)),MR=async(e,t)=>{const o="ui/"+ib(e).getOr("default")+"/skin.css",n=tinymce.Resource.get(o);if(!s(n)){const o=e.editorManager.suffix;return AR(e,t+`/skin${o}.css`,e.ui.styleSheetLoader)}DR(e,o,n,e.ui.styleSheetLoader)},NR=async(e,t)=>{var o;if(o=Be.fromDom(e.getElement()),ft(o).isSome()){const o="ui/"+ib(e).getOr("default")+"/skin.shadowdom.css",n=tinymce.Resource.get(o);if(!s(n)){const o=e.editorManager.suffix;return AR(e,t+`/skin.shadowdom${o}.css`,hv.DOM.styleSheetLoader)}DR(e,o,n,hv.DOM.styleSheetLoader)}},RR=(e,t)=>(async(e,t)=>{const o=()=>{const o=ab(t),n=t.editorManager.suffix;o&&t.contentCSS.push(o+(e?"/content.inline":"/content")+`${n}.css`)};ib(t).fold(o,(n=>{const r="ui/"+n+(e?"/content.inline":"/content")+".css",a=tinymce.Resource.get(r);s(a)?DR(t,r,a,t.ui.styleSheetLoader):o()}));const n=ab(t);if(!rb(t)&&s(n))return Promise.all([MR(t,n),NR(t,n)]).then()})(e,t).then((e=>{const t=()=>{e._skinLoaded=!0,(e=>{e.dispatch("SkinLoaded")})(e)};return()=>{e.initialized?t():e.on("init",t)}})(t),((e,t)=>()=>((e,t)=>{e.dispatch("SkinLoadError",t)})(e,{message:t}))(t,"Skin could not be loaded")),BR=S(RR,!1),LR=S(RR,!0),HR=(e,t,o)=>Me(o)?e.translate(t):e.translate([t,e.translate(o)]),IR=(e,t)=>{const o=(o,r,s,a)=>{const i=e.shared.providers.translate(o.title);if("separator"===o.type)return A.some({type:"separator",text:i});if("submenu"===o.type){const e=q(o.getStyleItems(),(e=>n(e,r,a)));return 0===r&&e.length<=0?A.none():A.some({type:"nestedmenuitem",text:i,enabled:e.length>0,getSubmenuItems:()=>q(o.getStyleItems(),(e=>n(e,r,a)))})}return A.some({type:"togglemenuitem",text:i,icon:o.icon,active:o.isSelected(a),enabled:!s,onAction:t.onAction(o),...o.getStylePreview().fold((()=>({})),(e=>({meta:{style:e}})))})},n=(e,n,r)=>{const s="formatter"===e.type&&t.isInvalid(e);return 0===n?s?[]:o(e,n,!1,r).toArray():o(e,n,s,r).toArray()},r=e=>{const o=t.getCurrentValue(),r=t.shouldHide?0:1;return q(e,(e=>n(e,r,o)))};return{validateItems:r,getFetch:(e,t)=>(o,n)=>{const s=t(),a=r(s);n(NO(a,ew.CLOSE_ON_EXECUTE,e,{isHorizontalMenu:!1,search:A.none()}))}}},PR=(e,t)=>{const o=t.dataset,n="basic"===o.type?()=>P(o.data,(e=>qD(e,t.isSelectedFor,t.getPreviewFor))):o.getData;return{items:IR(e,t),getStyleItems:n}},FR=(e,t,o,n,r,s)=>{const{items:a,getStyleItems:i}=PR(t,o),l=Qo(o.tooltip);return TO({text:o.icon.isSome()?A.none():o.text,icon:o.icon,ariaLabel:A.some(o.tooltip),tooltip:A.none(),role:A.none(),fetch:a.getFetch(t,i),onSetup:t=>{const s=o=>t.setTooltip(HR(e,n(o.value),o.value));return e.on(r,s),eS(nS(e,"NodeChange",(t=>{const n=t.getComponent();o.updateText(n),eh.set(t.getComponent(),!e.selection.isEditable())}))(t),(()=>e.off(r,s)))},getApi:e=>({getComponent:w(e),setTooltip:o=>{const n=t.shared.providers.translate(o);St(e.element,"aria-label",n),l.set(o)}}),columns:1,presets:"normal",classes:o.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[Zb.config({...t.shared.providers.tooltips.getConfig({tooltipText:t.shared.providers.translate(o.tooltip),onShow:e=>{if(o.tooltip!==l.get()){const o=t.shared.providers.translate(l.get());Zb.setComponents(e,t.shared.providers.tooltips.getComponents({tooltipText:o}))}}})})]},"tox-tbtn",t.shared,s)};var zR;!function(e){e[e.SemiColon=0]="SemiColon",e[e.Space=1]="Space"}(zR||(zR={}));const VR=(e,t,o)=>{const n=(e=>P(e,(e=>{let t=e,o=e;const n=e.split("=");return n.length>1&&(t=n[0],o=n[1]),{title:t,format:o}})))(((e,t)=>t===zR.SemiColon?e.replace(/;$/,"").split(";"):e.split(" "))(e.options.get(t),o));return{type:"basic",data:n}},ZR=w("Alignment {0}"),UR="left",jR=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],WR=e=>{const t={type:"basic",data:jR};return{tooltip:HR(e,ZR(),UR),text:A.none(),icon:A.some("align-left"),isSelectedFor:t=>()=>e.formatter.match(t),getCurrentValue:A.none,getPreviewFor:e=>A.none,onAction:t=>()=>j(jR,(e=>e.format===t.format)).each((t=>e.execCommand(t.command))),updateText:t=>{const o=j(jR,(t=>e.formatter.match(t.format))),n=o.fold(w(UR),(e=>e.title.toLowerCase()));Gs(t,EO,{icon:`align-${n}`}),((e,t)=>{e.dispatch("AlignTextUpdate",t)})(e,{value:n})},dataset:t,shouldHide:!1,isInvalid:t=>!e.formatter.canApply(t.format)}},$R=(e,t)=>{const o=t(),n=P(o,(e=>e.format));return A.from(e.formatter.closest(n)).bind((e=>j(o,(t=>t.format===e))))},qR=w("Block {0}"),GR="Paragraph",KR=e=>{const t=VR(e,"block_formats",zR.SemiColon);return{tooltip:HR(e,qR(),GR),text:A.some(GR),icon:A.none(),isSelectedFor:t=>()=>e.formatter.match(t),getCurrentValue:A.none,getPreviewFor:t=>()=>{const o=e.formatter.get(t);return o?A.some({tag:o.length>0&&(o[0].inline||o[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):A.none()},onAction:rS(e),updateText:o=>{const n=$R(e,(()=>t.data)).fold(w(GR),(e=>e.title));Gs(o,_O,{text:n}),((e,t)=>{e.dispatch("BlocksTextUpdate",t)})(e,{value:n})},dataset:t,shouldHide:!1,isInvalid:t=>!e.formatter.canApply(t.format)}},YR=w("Font {0}"),XR="System Font",JR=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],QR=e=>{const t=e.split(/\s*,\s*/);return P(t,(e=>e.replace(/^['"]+|['"]+$/g,"")))},eB=(e,t)=>t.length>0&&G(t,(t=>e.indexOf(t.toLowerCase())>-1)),tB=e=>{const t=()=>{const t=e=>e?QR(e)[0]:"",n=e.queryCommandValue("FontName"),r=o.data,s=n?n.toLowerCase():"",a=nb(e),i=j(r,(e=>{const o=e.format;return o.toLowerCase()===s||t(o).toLowerCase()===t(s).toLowerCase()})).orThunk((()=>Se(((e,t)=>{if(0===e.indexOf("-apple-system")||t.length>0){const o=QR(e.toLowerCase());return eB(o,JR)||eB(o,t)}return!1})(s,a),{title:XR,format:s})));return{matchOpt:i,font:n}},o=VR(e,"font_family_formats",zR.SemiColon);return{tooltip:HR(e,YR(),XR),text:A.some(XR),icon:A.none(),isSelectedFor:e=>t=>t.exists((t=>t.format===e)),getCurrentValue:()=>{const{matchOpt:e}=t();return e},getPreviewFor:e=>()=>A.some({tag:"div",styles:-1===e.indexOf("dings")?{"font-family":e}:{}}),onAction:t=>()=>{e.undoManager.transact((()=>{e.focus(),e.execCommand("FontName",!1,t.format)}))},updateText:o=>{const{matchOpt:n,font:r}=t(),s=n.fold(w(r),(e=>e.title));Gs(o,_O,{text:s}),((e,t)=>{e.dispatch("FontFamilyTextUpdate",t)})(e,{value:s})},dataset:o,shouldHide:!1,isInvalid:T}},oB={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},nB=(()=>{const e="[0-9]+",t="[eE]"+("[+-]?"+e),o=e=>`(?:${e})?`,n=["Infinity",e+"\\."+o(e)+o(t),"\\."+e+o(t),e+o(t)].join("|");return new RegExp(`^(${`[+-]?(?:${n})`})(.*)$`)})(),rB=(e,t)=>A.from(nB.exec(e)).bind((e=>{const o=Number(e[1]),n=e[2];return((e,t)=>L(t,(t=>L(oB[t],(t=>e===t)))))(n,t)?A.some({value:o,unit:n}):A.none()})),sB={tab:w(9),escape:w(27),enter:w(13),backspace:w(8),delete:w(46),left:w(37),up:w(38),right:w(39),down:w(40),space:w(32),home:w(36),end:w(35),pageUp:w(33),pageDown:w(34)},aB=(e,t,o,n)=>{let r=A.none();const s=nS(e,"NodeChange SwitchMode",(t=>{const n=t.getComponent();r=A.some(n),o.updateInputValue(n),eh.set(n,!e.selection.isEditable())})),a=e=>({getComponent:w(e)}),i=Qo(v),l=Xi("custom-number-input-events"),c=(e,t,n)=>{const s=r.map((e=>Mu.getValue(e))).getOr("");const a=o.getNewValue(s,e),i=s.length-`${a}`.length,l=r.map((e=>e.element.dom.selectionStart-i)),c=r.map((e=>e.element.dom.selectionEnd-i));o.onAction(a,n),r.each((e=>{Mu.setValue(e,a),t&&(l.each((t=>e.element.dom.selectionStart=t)),c.each((t=>e.element.dom.selectionEnd=t)))}))},d=(e,t)=>c(((e,t)=>e-t),e,t),m=(e,t)=>c(((e,t)=>e+t),e,t),u=e=>rt(e.element).fold(A.none,(e=>(zc(e),A.some(!0)))),h=e=>Zc(e.element)?(lt(e.element).each((e=>zc(e))),A.some(!0)):A.none(),p=(o,n,r,s)=>{const i=Qo(v),l=t.shared.providers.translate(r),c=Xi("altExecuting"),d=nS(e,"NodeChange SwitchMode",(t=>{eh.set(t.getComponent(),!e.selection.isEditable())})),m=e=>{eh.isDisabled(e)||o(!0)};return Eb.sketch({dom:{tag:"button",attributes:{"aria-label":l,"data-mce-name":n},classes:s.concat(n)},components:[CO(n,t.shared.providers.icons)],buttonBehaviours:Sa([eh.config({}),Zb.config(t.shared.providers.tooltips.getConfig({tooltipText:l})),bf(c,[cC({onSetup:d,getApi:a},i),dC({getApi:a},i),oa(ds(),((e,t)=>{t.event.raw.keyCode!==sB.space()&&t.event.raw.keyCode!==sB.enter()||eh.isDisabled(e)||o(!1)})),oa(hs(),m),oa(ts(),m)])]),eventOrder:{[ds()]:[c,"keying"],[hs()]:[c,"alloy.base.behaviour"],[ts()]:[c,"alloy.base.behaviour"],[Hs()]:["alloy.base.behaviour",c,"tooltipping"],[Is()]:[c,"tooltipping"]}})},f=Ob(p((e=>d(!1,e)),"minus","Decrease font size",[])),b=Ob(p((e=>m(!1,e)),"plus","Increase font size",[])),y=Ob({dom:{tag:"div",classes:["tox-input-wrapper"]},components:[Sw.sketch({inputBehaviours:Sa([eh.config({}),bf(l,[cC({onSetup:s,getApi:a},i),dC({getApi:a},i)]),bf("input-update-display-text",[oa(_O,((e,t)=>{Mu.setValue(e,t.event.text)})),oa(cs(),(e=>{o.onAction(Mu.getValue(e))})),oa(gs(),(e=>{o.onAction(Mu.getValue(e))}))]),lf.config({mode:"special",onEnter:e=>(c(x,!0,!0),A.some(!0)),onEscape:u,onUp:e=>(m(!0,!1),A.some(!0)),onDown:e=>(d(!0,!1),A.some(!0)),onLeft:(e,t)=>(t.cut(),A.none()),onRight:(e,t)=>(t.cut(),A.none())})])})],behaviours:Sa([Sf.config({}),lf.config({mode:"special",onEnter:h,onSpace:h,onEscape:u}),bf("input-wrapper-events",[oa(is(),(e=>{F([f,b],(t=>{const o=Be.fromDom(t.get(e).element.dom);Zc(o)&&Vc(o)}))}))])])});return{dom:{tag:"div",classes:["tox-number-input"],attributes:{...g(n)?{"data-mce-name":n}:{}}},components:[f.asSpec(),y.asSpec(),b.asSpec()],behaviours:Sa([Sf.config({}),lf.config({mode:"flow",focusInside:Bh.OnEnterOrSpaceMode,cycles:!1,selector:"button, .tox-input-wrapper",onEscape:e=>Zc(e.element)?A.none():(zc(e.element),A.some(!0))})])}},iB=w("Font size {0}"),lB="12pt",cB={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},dB={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},mB=(e,t)=>/[0-9.]+px$/.test(e)?((e,t)=>{const o=Math.pow(10,t);return Math.round(e*o)/o})(72*parseInt(e,10)/96,t||0)+"pt":fe(dB,e).getOr(e),uB=e=>fe(cB,e).getOr(""),gB=e=>{const t=()=>{let t=A.none();const o=n.data,r=e.queryCommandValue("FontSize");if(r)for(let e=3;t.isNone()&&e>=0;e--){const n=mB(r,e),s=uB(n);t=j(o,(e=>e.format===r||e.format===n||e.format===s))}return{matchOpt:t,size:r}},o=w(A.none),n=VR(e,"font_size_formats",zR.Space);return{tooltip:HR(e,iB(),lB),text:A.some(lB),icon:A.none(),isSelectedFor:e=>t=>t.exists((t=>t.format===e)),getPreviewFor:o,getCurrentValue:()=>{const{matchOpt:e}=t();return e},onAction:t=>()=>{e.undoManager.transact((()=>{e.focus(),e.execCommand("FontSize",!1,t.format)}))},updateText:o=>{const{matchOpt:n,size:r}=t(),s=n.fold(w(r),(e=>e.title));Gs(o,_O,{text:s}),((e,t)=>{e.dispatch("FontSizeTextUpdate",t)})(e,{value:s})},dataset:n,shouldHide:!1,isInvalid:T}},hB=e=>Me(e)?"Formats":"Format {0}",pB=(e,t)=>{const o="Formats";return{tooltip:HR(e,hB(""),""),text:A.some(o),icon:A.none(),isSelectedFor:t=>()=>e.formatter.match(t),getCurrentValue:A.none,getPreviewFor:t=>()=>{const o=e.formatter.get(t);return void 0!==o?A.some({tag:o.length>0&&(o[0].inline||o[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):A.none()},onAction:rS(e),updateText:t=>{const n=e=>ZD(e)?q(e.items,n):UD(e)?[{title:e.title,format:e.format}]:[],r=q($D(e),n),s=$R(e,w(r)).fold(w({title:o,tooltipLabel:""}),(e=>({title:e.title,tooltipLabel:e.title})));Gs(t,_O,{text:s.title}),((e,t)=>{e.dispatch("StylesTextUpdate",t)})(e,{value:s.tooltipLabel})},shouldHide:Av(e),isInvalid:t=>!e.formatter.canApply(t.format),dataset:t}},fB=w([hr("toggleClass"),hr("fetch"),Vi("onExecute"),Mr("getHotspot",A.some),Mr("getAnchorOverrides",w({})),Md(),Vi("onItemExecute"),Sr("lazySink"),hr("dom"),Fi("onOpen"),Nu("splitDropdownBehaviours",[ak,lf,Sf]),Mr("matchWidth",!1),Mr("useMinWidth",!1),Mr("eventOrder",{}),Sr("role"),Sr("listRole")].concat(kk())),vB=ig({factory:Eb,schema:[hr("dom")],name:"arrow",defaults:()=>({buttonBehaviours:Sa([Sf.revoke()])}),overrides:e=>({dom:{tag:"span",attributes:{role:"presentation"}},action:t=>{t.getSystem().getByUid(e.uid).each(Ks)},buttonBehaviours:Sa([Mf.config({toggleOnExecute:!1,toggleClass:e.toggleClass})])})}),bB=ig({factory:Eb,schema:[hr("dom")],name:"button",defaults:()=>({buttonBehaviours:Sa([Sf.revoke()])}),overrides:e=>({dom:{tag:"span",attributes:{role:"presentation"}},action:t=>{t.getSystem().getByUid(e.uid).each((o=>{e.onExecute(o,t)}))}})}),yB=w([vB,bB,cg({factory:{sketch:e=>({uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}})},schema:[hr("text")],name:"aria-descriptor"}),lg({schema:[Hi()],name:"menu",defaults:e=>({onExecute:(t,o)=>{t.getSystem().getByUid(e.uid).each((n=>{e.onItemExecute(n,t,o)}))}})}),hk()]),wB=Hg({name:"SplitDropdown",configFields:fB(),partFields:yB(),factory:(e,t,o,n)=>{const r=e=>{zg.getCurrent(e).each((e=>{mh.highlightFirst(e),lf.focusIn(e)}))},s=t=>{bk(e,x,t,n,r,iv.HighlightMenuAndItem).get(v)},a=t=>{const o=Cg(t,e,"button");return Ks(o),A.some(!0)},i={...Qs([da(((t,o)=>{xg(t,e,"aria-descriptor").each((e=>{const o=Xi("aria");St(e.element,"id",o),St(t.element,"aria-describedby",o)}))}))]),...Bf(A.some(s))},l={repositionMenus:e=>{Mf.isOn(e)&&Sk(e)}};return{uid:e.uid,dom:e.dom,components:t,apis:l,eventOrder:{...e.eventOrder,[_s()]:["disabling","toggling","alloy.base.behaviour"]},events:i,behaviours:Bu(e.splitDropdownBehaviours,[ak.config({others:{sandbox:t=>{const o=Cg(t,e,"arrow");return Ck(e,t,{onOpen:()=>{Mf.on(o),Mf.on(t)},onClose:()=>{Mf.off(o),Mf.off(t)}})}}}),lf.config({mode:"special",onSpace:a,onEnter:a,onDown:e=>(s(e),A.some(!0))}),Sf.config({}),Mf.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:e.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:(e,t)=>e.repositionMenus(t)}}),xB=e=>({isEnabled:()=>!eh.isDisabled(e),setEnabled:t=>eh.set(e,!t),setText:t=>Gs(e,_O,{text:t}),setIcon:t=>Gs(e,EO,{icon:t})}),CB=e=>({setActive:t=>{Mf.set(e,t)},isActive:()=>Mf.isOn(e),isEnabled:()=>!eh.isDisabled(e),setEnabled:t=>eh.set(e,!t),setText:t=>Gs(e,_O,{text:t}),setIcon:t=>Gs(e,EO,{icon:t})}),SB=(e,t)=>e.map((e=>({"aria-label":t.translate(e)}))).getOr({}),kB=Xi("focus-button"),_B=(e,t,o,n,r,s)=>{const a=t.map((e=>Ob(kO(e,"tox-tbtn",r)))),i=e.map((e=>Ob(SO(e,r.icons))));return{dom:{tag:"button",classes:["tox-tbtn"].concat(t.isSome()?["tox-tbtn--select"]:[]),attributes:{...SB(o,r),...g(s)?{"data-mce-name":s}:{}}},components:gC([i.map((e=>e.asSpec())),a.map((e=>e.asSpec()))]),eventOrder:{[ns()]:["focusing","alloy.base.behaviour",bO],[Hs()]:[bO,"toolbar-group-button-events"]},buttonBehaviours:Sa([iC(r.isDisabled),nC(),bf(bO,[da(((e,t)=>wO(e))),oa(_O,((e,t)=>{a.bind((t=>t.getOpt(e))).each((e=>{vf.set(e,[Hl(r.translate(t.event.text))])}))})),oa(EO,((e,t)=>{i.bind((t=>t.getOpt(e))).each((e=>{vf.set(e,[SO(t.event.icon,r.icons)])}))})),oa(ns(),((e,t)=>{t.event.prevent(),qs(e,kB)}))])].concat(n.getOr([])))}},EB=(e,t,o,n)=>{var r;const s=Qo(v),a=_B(e.icon,e.text,e.tooltip,A.none(),o,n);return Eb.sketch({dom:a.dom,components:a.components,eventOrder:yO,buttonBehaviours:{...Sa([bf("toolbar-button-events",[(i={onAction:e.onAction,getApi:t.getApi},ga(((e,t)=>{lC(i,e)((t=>{Gs(e,vO,{buttonApi:t}),i.onAction(t)}))}))),cC(t,s),dC(t,s)]),...e.tooltip.map((t=>Zb.config(o.tooltips.getConfig({tooltipText:o.translate(t)+e.shortcut.map((e=>` (${fC(e)})`)).getOr("")})))).toArray(),iC((()=>!e.enabled||o.isDisabled())),nC()].concat(t.toolbarButtonBehaviours)),[bO]:null===(r=a.buttonBehaviours)||void 0===r?void 0:r[bO]}});var i},TB=(e,t,o,n)=>EB(e,{toolbarButtonBehaviours:o.length>0?[bf("toolbarButtonWith",o)]:[],getApi:xB,onSetup:e.onSetup},t,n),OB=(e,t,o,n)=>EB(e,{toolbarButtonBehaviours:[vf.config({}),Mf.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(o.length>0?[bf("toolbarToggleButtonWith",o)]:[]),getApi:CB,onSetup:e.onSetup},t,n),AB=(e,t,o)=>n=>mk((e=>t.fetch(e))).map((r=>A.from(Ik(_n(zS(Xi("menu-value"),r,(o=>{t.onItemAction(e(n),o)}),t.columns,t.presets,ew.CLOSE_ON_EXECUTE,t.select.getOr(T),o),{movement:ZS(t.columns,t.presets),menuBehaviours:Xx("auto"!==t.columns?[]:[da(((e,o)=>{Kx(e,4,uw(t.presets)).each((({numRows:t,numColumns:o})=>{lf.setGridSize(e,t,o)}))}))])}))))),DB=[{name:"history",items:["undo","redo"]},{name:"ai",items:["aidialog","aishortcuts"]},{name:"styles",items:["styles"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],MB=(e,t)=>(o,n,r,s)=>{const a=e(o).mapError((e=>lr(e))).getOrDie();return t(a,n,r,s)},NB={button:MB(wx,((e,t,o,n)=>((e,t,o)=>TB(e,t,[],o))(e,t.shared.providers,n))),togglebutton:MB(Sx,((e,t,o,n)=>((e,t,o)=>OB(e,t,[],o))(e,t.shared.providers,n))),menubutton:MB(YM,((e,t,o,n)=>dA(e,"tox-tbtn",t,A.none(),!1,n))),splitbutton:MB((e=>sr("SplitButton",XM,e)),((e,t,o,n)=>((e,t,o)=>{const n=Qo(e.tooltip.getOr("")),r=e=>({isEnabled:()=>!eh.isDisabled(e),setEnabled:t=>eh.set(e,!t),setIconFill:(t,o)=>{Yl(e.element,`svg path[class="${t}"], rect[class="${t}"]`).each((e=>{St(e,"fill",o)}))},setActive:t=>{St(e.element,"aria-pressed",t),Yl(e.element,"span").each((o=>{e.getSystem().getByDom(o).each((e=>Mf.set(e,t)))}))},isActive:()=>Yl(e.element,"span").exists((t=>e.getSystem().getByDom(t).exists(Mf.isOn))),setText:t=>Yl(e.element,"span").each((o=>e.getSystem().getByDom(o).each((e=>Gs(e,_O,{text:t}))))),setIcon:t=>Yl(e.element,"span").each((o=>e.getSystem().getByDom(o).each((e=>Gs(e,EO,{icon:t}))))),setTooltip:o=>{const r=t.providers.translate(o);St(e.element,"aria-label",r),n.set(o)}}),s=Qo(v),a={getApi:r,onSetup:e.onSetup};return wB.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:{"aria-pressed":!1,...SB(e.tooltip,t.providers),...g(o)?{"data-mce-name":o}:{}}},onExecute:t=>{const o=r(t);o.isEnabled()&&e.onAction(o)},onItemExecute:(e,t,o)=>{},splitDropdownBehaviours:Sa([aC(t.providers.isDisabled),nC(),bf("split-dropdown-events",[da(((e,t)=>wO(e))),oa(kB,Sf.focus),cC(a,s),dC(a,s)]),A_.config({}),...e.tooltip.map((e=>Zb.config({...t.providers.tooltips.getConfig({tooltipText:t.providers.translate(e),onShow:o=>{if(n.get()!==e){const e=t.providers.translate(n.get());Zb.setComponents(o,t.providers.tooltips.getComponents({tooltipText:e}))}}})}))).toArray()]),eventOrder:{[Hs()]:["alloy.base.behaviour","split-dropdown-events","tooltipping"],[Is()]:["split-dropdown-events","tooltipping"]},toggleClass:"tox-tbtn--enabled",lazySink:t.getSink,fetch:AB(r,e,t.providers),parts:{menu:bw(0,e.columns,e.presets)},components:[wB.parts.button(_B(e.icon,e.text,A.none(),A.some([Mf.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),t.providers)),wB.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:Wy("chevron-down",t.providers.icons)},buttonBehaviours:Sa([aC(t.providers.isDisabled),nC(),$y()])}),wB.parts["aria-descriptor"]({text:t.providers.translate("To open the popup, press Shift+Enter")})]})})(e,t.shared,n))),grouptoolbarbutton:MB((e=>sr("GroupToolbarButton",qM,e)),((e,t,o,n)=>{const r=o.ui.registry.getAll().buttons,s=e=>HB(o,{buttons:r,toolbar:e,allowToolbarGroups:!1},t,A.none()),a={[Ad]:t.shared.header.isPositionedAtTop()?Od.TopToBottom:Od.BottomToTop};if(Nv(o)===mv.floating)return((e,t,o,n,r)=>{const s=t.shared,a=Qo(v),i={toolbarButtonBehaviours:[],getApi:xB,onSetup:e.onSetup},l=[bf("toolbar-group-button-events",[cC(i,a),dC(i,a)])];return LN.sketch({lazySink:s.getSink,fetch:()=>mk((t=>{t(P(o(e.items),GN))})),markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:_B(e.icon,e.text,e.tooltip,A.some(l),s.providers,r),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:n}}}})})(e,t,s,a,n);throw new Error("Toolbar groups are only supported when using floating toolbar mode")}))},RB={styles:(e,t)=>{const o={type:"advanced",...t.styles};return FR(e,t,pB(e,o),hB,"StylesTextUpdate","styles")},fontsize:(e,t)=>FR(e,t,gB(e),iB,"FontSizeTextUpdate","fontsize"),fontsizeinput:(e,t)=>aB(e,t,(e=>{const t=()=>e.queryCommandValue("FontSize");return{updateInputValue:e=>Gs(e,_O,{text:t()}),onAction:(t,o)=>e.execCommand("FontSize",!1,t,{skip_focus:!o}),getNewValue:(o,n)=>{rB(o,["unsupportedLength","empty"]);const r=t(),s=rB(o,["unsupportedLength","empty"]).or(rB(r,["unsupportedLength","empty"])),a=s.map((e=>e.value)).getOr(16),i=Uv(e),l=s.map((e=>e.unit)).filter((e=>""!==e)).getOr(i),c=n(a,(e=>{var t;return null!==(t={em:{step:.1},cm:{step:.1},in:{step:.1},pc:{step:.1},ch:{step:.1},rem:{step:.1}}[e])&&void 0!==t?t:{step:1}})(l).step),d=`${(e=>e>=0)(c)?c:a}${l}`;return d!==r&&((e,t)=>{e.dispatch("FontSizeInputTextUpdate",t)})(e,{value:d}),d}}})(e),"fontsizeinput"),fontfamily:(e,t)=>FR(e,t,tB(e),YR,"FontFamilyTextUpdate","fontfamily"),blocks:(e,t)=>FR(e,t,KR(e),qR,"BlocksTextUpdate","blocks"),align:(e,t)=>FR(e,t,WR(e),ZR,"AlignTextUpdate","align")},BB=e=>{const t=e.toolbar,o=e.buttons;return!1===t?[]:void 0===t||!0===t?(e=>{const t=P(DB,(t=>{const o=V(t.items,(t=>ve(e,t)||ve(RB,t)));return{name:t.name,items:o}}));return V(t,(e=>e.items.length>0))})(o):s(t)?(e=>{const t=e.split("|");return P(t,(e=>({items:e.trim().split(" ")})))})(t):(e=>f(e,(e=>ve(e,"name")&&ve(e,"items"))))(t)?t:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},LB=(e,t,o,n,r,s)=>fe(t,o.toLowerCase()).orThunk((()=>s.bind((e=>re(e,(e=>fe(t,e+o.toLowerCase()))))))).fold((()=>fe(RB,o.toLowerCase()).map((t=>t(e,r)))),(t=>"grouptoolbarbutton"!==t.type||n?((e,t,o,n)=>fe(NB,e.type).fold((()=>(console.error("skipping button defined by",e),A.none())),(r=>A.some(r(e,t,o,n)))))(t,r,e,o.toLowerCase()):(console.warn(`Ignoring the '${o}' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested.`),A.none()))),HB=(e,t,o,n)=>{const r=BB(t),s=P(r,(r=>{const s=q(r.items,(r=>0===r.trim().length?[]:LB(e,t.buttons,r,t.allowToolbarGroups,o,n).toArray()));return{title:A.from(e.translate(r.name)),items:s}}));return V(s,(e=>e.items.length>0))},IB=(e,t,o,n)=>{const r=t.mainUi.outerContainer,a=o.toolbar,i=o.buttons;if(f(a,s)){const t=a.map((t=>{const r={toolbar:t,buttons:i,allowToolbarGroups:o.allowToolbarGroups};return HB(e,r,n,A.none())}));_R.setToolbars(r,t)}else _R.setToolbar(r,HB(e,o,n,A.none()))},PB=Ao(),FB=PB.os.isiOS()&&PB.os.version.major<=12;var zB=Object.freeze({__proto__:null,render:(e,t,o,n,r)=>{const{mainUi:s,uiMotherships:a}=t,i=Qo(0),l=s.outerContainer;BR(e);const d=Be.fromDom(r.targetNode),m=pt(ht(d));Jm(d,s.mothership),((e,t,o)=>{bb(e)&&Jm(o.mainUi.mothership.element,o.popupUi.mothership),Xm(t,o.dialogUi.mothership)})(e,m,t),e.on("SkinLoaded",(()=>{_R.setSidebar(l,o.sidebar,eb(e)),IB(e,t,o,n),i.set(e.getWin().innerWidth),_R.setMenubar(l,OR(e,o)),_R.setViews(l,o.views),((e,t)=>{const{uiMotherships:o}=t,n=e.dom;let r=e.getWin();const s=e.getDoc().documentElement,a=Qo($t(r.innerWidth,r.innerHeight)),i=Qo($t(s.offsetWidth,s.offsetHeight)),l=()=>{const t=a.get();t.left===r.innerWidth&&t.top===r.innerHeight||(a.set($t(r.innerWidth,r.innerHeight)),XC(e))},c=()=>{const t=e.getDoc().documentElement,o=i.get();o.left===t.offsetWidth&&o.top===t.offsetHeight||(i.set($t(t.offsetWidth,t.offsetHeight)),XC(e))},d=t=>{((e,t)=>{e.dispatch("ScrollContent",t)})(e,t)};n.bind(r,"resize",l),n.bind(r,"scroll",d);const m=id(Be.fromDom(e.getBody()),"load",c);e.on("hide",(()=>{F(o,(e=>{Mt(e.element,"display","none")}))})),e.on("show",(()=>{F(o,(e=>{Ft(e.element,"display")}))})),e.on("NodeChange",c),e.on("remove",(()=>{m.unbind(),n.unbind(r,"resize",l),n.unbind(r,"scroll",d),r=null}))})(e,t)}));const u=_R.getSocket(l).getOrDie("Could not find expected socket element");if(FB){Nt(u.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});const t=((e,t)=>{let o=null;return{cancel:()=>{c(o)||(clearTimeout(o),o=null)},throttle:(...n)=>{c(o)&&(o=setTimeout((()=>{o=null,e.apply(null,n)}),t))}}})((()=>{e.dispatch("ScrollContent")}),20),o=ad(u.element,"scroll",t.throttle);e.on("remove",o.unbind)}oC(e,t),e.addCommand("ToggleSidebar",((t,o)=>{_R.toggleSidebar(l,o),e.dispatch("ToggleSidebar")})),e.addQueryValueHandler("ToggleSidebar",(()=>{var e;return null!==(e=_R.whichSidebar(l))&&void 0!==e?e:""})),e.addCommand("ToggleView",((t,o)=>{if(_R.toggleView(l,o)){const t=l.element;s.mothership.broadcastOn([uu()],{target:t}),F(a,(e=>{e.broadcastOn([uu()],{target:t})})),c(_R.whichView(l))&&(e.focus(),e.nodeChanged(),_R.refreshToolbar(l))}})),e.addQueryValueHandler("ToggleView",(()=>{var e;return null!==(e=_R.whichView(l))&&void 0!==e?e:""}));const g=Nv(e);g!==mv.sliding&&g!==mv.floating||e.on("ResizeWindow ResizeEditor ResizeContent",(()=>{const o=e.getWin().innerWidth;o!==i.get()&&(_R.refreshToolbar(t.mainUi.outerContainer),i.set(o))}));const h={setEnabled:e=>{tC(t,!e)},isEnabled:()=>!eh.isDisabled(l)};return{iframeContainer:u.element.dom,editorContainer:l.element.dom,api:h}}});const VB=e=>/^[0-9\.]+(|px)$/i.test(""+e)?A.some(parseInt(""+e,10)):A.none(),ZB=e=>p(e)?e+"px":e,UB=(e,t,o)=>{const n=t.filter((t=>ee>t));return n.or(r).getOr(e)},jB=e=>{const t=(e=>{const t=xv(e),o=kv(e),n=Ev(e);return VB(t).map((e=>UB(e,o,n)))})(e);return t.getOr(xv(e))},WB=e=>{const t=Cv(e),o=Sv(e),n=_v(e);return VB(t).map((e=>UB(e,o,n)))},{ToolbarLocation:$B,ToolbarMode:qB}=wb,GB=(e,t,o,n,r)=>{const{mainUi:s,uiMotherships:a}=o,i=hv.DOM,l=hb(e),c=vb(e),d=_v(e).or(WB(e)),m=n.shared.header,u=m.isPositionedAtTop,g=Nv(e),h=g===qB.sliding||g===qB.floating,p=Qo(!1),f=()=>p.get()&&!e.removed,v=e=>h?e.fold(w(0),(e=>e.components().length>1?Ut(e.components()[1].element):0)):0,b=(e,t)=>bb(e)?ja(t):A.none(),y=()=>{F(a,(e=>{e.broadcastOn([gu()],{})}))},x=o=>{if(!f())return;l||r.on((e=>{const o=d.getOrThunk((()=>Uo().width-Kt(t).left-10));Mt(e.element,"max-width",o+"px")}));const n=zo(),a=!l&&(()=>{if(!l&&(Gt(s.outerContainer.element).left+Jt(s.outerContainer.element)>=window.innerWidth-40||Ht(s.outerContainer.element,"width").isSome()))return Mt(s.outerContainer.element,"position","absolute"),Mt(s.outerContainer.element,"left","0px"),Ft(s.outerContainer.element,"width"),!0;return!1})();if(h&&_R.refreshToolbar(s.outerContainer),!l){const o=zo(),i=Se(n.left!==o.left,n);((o,n)=>{r.on((r=>{const a=_R.getToolbar(s.outerContainer),i=v(a),l=Ko(t),c=b(e,s.outerContainer.element),d=c.fold((()=>l.x),(e=>{const t=Ko(e);return Xe(e,wt())?l.x:l.x-t.x})),m=Se(o,Math.ceil(s.outerContainer.element.dom.getBoundingClientRect().width)).filter((e=>e>150)).map((e=>{const t=n.getOr(zo()),o=window.innerWidth-(d-t.left),r=Math.max(Math.min(e,o),150);return ou()?Math.max(l.y-Ut(r.element)+i,0):l.bottom),(e=>{var t;const o=Ko(e),n=null!==(t=e.dom.scrollTop)&&void 0!==t?t:0,s=Xe(e,wt())?Math.max(l.y-Ut(r.element)+i,0):l.y-o.y+n-Ut(r.element)+i;return u()?s:l.bottom}))+"px"};Nt(s.outerContainer.element,{...g,...m})}))})(a,i),i.each((e=>{Vo(e.left,o.top)}))}c&&r.on(o),y()},C=()=>!(l||!c||!f())&&r.get().exists((o=>{const n=m.getDockingMode(),a=(o=>{switch(Bv(e)){case $B.auto:const e=_R.getToolbar(s.outerContainer),n=v(e),r=Ut(o.element)-n,a=Ko(t);if(a.y>r)return"top";{const e=tt(t),o=Math.max(e.dom.scrollHeight,Ut(e));return a.bottom{qi.setModes(e,[i]),m.setDockingMode(i);const t=u()?Od.TopToBottom:Od.BottomToTop;St(e.element,Ad,t)})),!0);var i}));return{isVisible:f,isPositionedAtTop:u,show:()=>{p.set(!0),Mt(s.outerContainer.element,"display","flex"),i.addClass(e.getBody(),"mce-edit-focus"),F(a,(e=>{Ft(e.element,"display")})),C(),bb(e)?x((e=>qi.isDocked(e)?qi.reset(e):qi.refresh(e))):x(qi.refresh)},hide:()=>{p.set(!1),Mt(s.outerContainer.element,"display","none"),i.removeClass(e.getBody(),"mce-edit-focus"),F(a,(e=>{Mt(e.element,"display","none")}))},update:x,updateMode:()=>{C()&&x(qi.reset)},repositionPopups:y}},KB=(e,t)=>{const o=Ko(e);return{pos:t?o.y:o.bottom,bounds:o}};var YB=Object.freeze({__proto__:null,render:(e,t,o,n,r)=>{const{mainUi:s}=t,a=on(),i=Be.fromDom(r.targetNode),l=GB(e,i,t,n,a),c=Iv(e);LR(e);const d=()=>{if(a.isSet())return void l.show();a.set(_R.getHeader(s.outerContainer).getOrDie());const r=pb(e);bb(e)?(Jm(i,s.mothership),Jm(i,t.popupUi.mothership)):Xm(r,s.mothership),Xm(r,t.dialogUi.mothership);const d=()=>{IB(e,t,o,n),_R.setMenubar(s.outerContainer,OR(e,o)),l.show(),((e,t,o,n)=>{const r=Qo(KB(t,o.isPositionedAtTop())),s=n=>{const{pos:s,bounds:a}=KB(t,o.isPositionedAtTop()),{pos:i,bounds:l}=r.get(),c=a.height!==l.height||a.width!==l.width;r.set({pos:s,bounds:a}),c&&XC(e,n),o.isVisible()&&(i!==s?o.update(qi.reset):c&&(o.updateMode(),o.repositionPopups()))};n||(e.on("activate",o.show),e.on("deactivate",o.hide)),e.on("SkinLoaded ResizeWindow",(()=>o.update(qi.reset))),e.on("NodeChange keydown",(e=>{requestAnimationFrame((()=>s(e)))}));let a=0;const i=$T((()=>o.update(qi.refresh)),33);e.on("ScrollWindow",(()=>{const e=zo().left;e!==a&&(a=e,i.throttle()),o.updateMode()})),bb(e)&&e.on("ElementScroll",(e=>{o.update(qi.refresh)}));const l=tn();l.set(id(Be.fromDom(e.getBody()),"load",(e=>s(e.raw)))),e.on("remove",(()=>{l.clear()}))})(e,i,l,c),e.nodeChanged()};c?e.once("SkinLoaded",d):d()};e.on("show",d),e.on("hide",l.hide),c||(e.on("focus",d),e.on("blur",l.hide)),e.on("init",(()=>{(e.hasFocus()||c)&&d()})),oC(e,t);const m={show:d,hide:l.hide,setEnabled:e=>{tC(t,!e)},isEnabled:()=>!eh.isDisabled(s.outerContainer)};return{editorContainer:s.outerContainer.element.dom,api:m}}});const XB="contexttoolbar-hide",JB=(e,t)=>oa(vO,((o,n)=>{const r=(e=>({hide:()=>qs(e,As()),getValue:()=>Mu.getValue(e)}))(e.get(o));t.onAction(r,n.event.buttonApi)})),QB=(e,t,o)=>(e=>"contextformtogglebutton"===e.type)(t)?((e,t,o)=>{const{primary:n,...r}=t.original,s=ar(Sx({...r,type:"togglebutton",onAction:v}));return OB(s,o,[JB(e,t)])})(e,t,o):((e,t,o)=>{const{primary:n,...r}=t.original,s=ar(wx({...r,type:"button",onAction:v}));return TB(s,o,[JB(e,t)])})(e,t,o),eL=(e,t)=>{const o=e.label.fold((()=>({})),(e=>({"aria-label":e}))),n=Ob(Sw.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:e.initValue(),inputAttributes:o,selectOnFocus:!0,inputBehaviours:Sa([lf.config({mode:"special",onEnter:e=>r.findPrimary(e).map((e=>(Ks(e),!0))),onLeft:(e,t)=>(t.cut(),A.none()),onRight:(e,t)=>(t.cut(),A.none())})])})),r=((e,t,o)=>{const n=P(t,(t=>Ob(QB(e,t,o))));return{asSpecs:()=>P(n,(e=>e.asSpec())),findPrimary:e=>re(t,((t,o)=>t.primary?A.from(n[o]).bind((t=>t.getOpt(e))).filter(k(eh.isDisabled)):A.none()))}})(n,e.commands,t);return[{title:A.none(),items:[n.asSpec()]},{title:A.none(),items:r.asSpecs()}]},tL=eL,oL=(e,t,o)=>t.bottom-e.y>=o&&e.bottom-t.y>=o,nL=e=>{const t=(e=>{const t=e.getBoundingClientRect();if(t.height<=0&&t.width<=0){const o=dt(Be.fromDom(e.startContainer),e.startOffset).element;return(je(o)?nt(o):A.some(o)).filter(Ue).map((e=>e.dom.getBoundingClientRect())).getOr(t)}return t})(e.selection.getRng());if(e.inline){const e=zo();return Go(e.left+t.left,e.top+t.top,t.width,t.height)}{const o=Yo(Be.fromDom(e.getBody()));return Go(o.x+t.left,o.y+t.top,t.width,t.height)}},rL=(e,t,o,n=0)=>{const r=Uo(window),s=Ko(Be.fromDom(e.getContentAreaContainer())),a=sb(e)||cb(e)||mb(e),{x:i,width:l}=((e,t,o)=>{const n=Math.max(e.x+o,t.x);return{x:n,width:Math.min(e.right-o,t.right)-n}})(s,r,n);if(e.inline&&!a)return Go(i,r.y,l,r.height);{const a=t.header.isPositionedAtTop(),{y:c,bottom:d}=((e,t,o,n,r,s)=>{const a=Be.fromDom(e.getContainer()),i=Yl(a,".tox-editor-header").getOr(a),l=Ko(i),c=l.y>=t.bottom,d=n&&!c;if(e.inline&&d)return{y:Math.max(l.bottom+s,o.y),bottom:o.bottom};if(e.inline&&!d)return{y:o.y,bottom:Math.min(l.y-s,o.bottom)};const m="line"===r?Ko(a):t;return d?{y:Math.max(l.bottom+s,o.y),bottom:Math.min(m.bottom-s,o.bottom)}:{y:Math.max(m.y+s,o.y),bottom:Math.min(l.y-s,o.bottom)}})(e,s,r,a,o,n);return Go(i,c,l,d-c)}},sL={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"],inset:["tox-pop--inset"]},aL={maxHeightFunction:yd(),maxWidthFunction:ON()},iL=e=>"node"===e,lL=(e,t,o,n,r)=>{const s=nL(e),a=n.lastElement().exists((e=>Xe(o,e)));if(((e,t)=>{const o=e.selection.getRng(),n=dt(Be.fromDom(o.startContainer),o.startOffset);return o.startContainer===o.endContainer&&o.startOffset===o.endOffset-1&&Xe(n.element,t)})(e,o))return a?TD:CD;if(a)return((e,t,o)=>{const n=Ht(e,"position");Mt(e,"position",t);const r=o(e);return n.each((t=>Mt(e,"position",t))),r})(t,n.getMode(),(()=>oL(s,Ko(t),-20)&&!n.isReposition()?AD:TD));return("fixed"===n.getMode()?r.y+zo().top:r.y)+(Ut(t)+12)<=s.y?CD:SD},cL=(e,t,o,n)=>{const r=t=>(n,r,s,a,i)=>({...lL(e,a,t,o,i)({...n,y:i.y,height:i.height},r,s,a,i),alwaysFit:!0}),s=e=>iL(n)?[r(e)]:[];return t?{onLtr:e=>[Tc,Cc,Sc,kc,_c,Ec].concat(s(e)),onRtl:e=>[Tc,Sc,Cc,_c,kc,Ec].concat(s(e))}:{onLtr:e=>[Ec,Tc,kc,Cc,_c,Sc].concat(s(e)),onRtl:e=>[Ec,Tc,_c,Sc,kc,Cc].concat(s(e))}},dL=(e,t)=>{const o=V(t,(t=>t.predicate(e.dom))),{pass:n,fail:r}=z(o,(e=>"contexttoolbar"===e.type));return{contextToolbars:n,contextForms:r}},mL=(e,t,o)=>{const n=dL(e,t);if(n.contextForms.length>0)return A.some({elem:e,toolbars:[n.contextForms[0]]});{const t=dL(e,o);if(t.contextForms.length>0)return A.some({elem:e,toolbars:[t.contextForms[0]]});if(n.contextToolbars.length>0||t.contextToolbars.length>0){const o=(e=>{if(e.length<=1)return e;{const t=t=>L(e,(e=>e.position===t)),o=t=>V(e,(e=>e.position===t)),n=t("selection"),r=t("node");if(n||r){if(r&&n){const e=o("node"),t=P(o("selection"),(e=>({...e,position:"node"})));return e.concat(t)}return o(n?"selection":"node")}return o("line")}})(n.contextToolbars.concat(t.contextToolbars));return A.some({elem:e,toolbars:o})}return A.none()}},uL=(e,t,o)=>e(t)?A.none():$r(t,(e=>{if(Ue(e)){const{contextToolbars:t,contextForms:n}=dL(e,o.inNodeScope),r=n.length>0?n:(e=>{if(e.length<=1)return e;{const t=t=>j(e,(e=>e.position===t)),o=t("selection").orThunk((()=>t("node"))).orThunk((()=>t("line"))).map((e=>e.position));return o.fold((()=>[]),(t=>V(e,(e=>e.position===t))))}})(t);return r.length>0?A.some({elem:e,toolbars:r}):A.none()}return A.none()}),e),gL=(e,t)=>{const o={},n=[],r=[],s={},a={},i=(e,i)=>{const l=ar(sr("ContextForm",Dx,i));o[e]=l,l.launch.map((o=>{s["form:"+e]={...i.launch,type:"contextformtogglebutton"===o.type?"togglebutton":"button",onAction:()=>{t(l)}}})),"editor"===l.scope?r.push(l):n.push(l),a[e]=l},l=(e,t)=>{var o;(o=t,sr("ContextToolbar",Mx,o)).each((o=>{"editor"===t.scope?r.push(o):n.push(o),a[e]=o}))},c=se(e);return F(c,(t=>{const o=e[t];"contextform"===o.type?i(t,o):"contexttoolbar"===o.type&&l(t,o)})),{forms:o,inNodeScope:n,inEditorScope:r,lookupTable:a,formNavigators:s}},hL=Xi("forward-slide"),pL=Xi("backward-slide"),fL=Xi("change-slide-event"),vL="tox-pop--resizing",bL="tox-pop--transition",yL=(e,t,o,n)=>{const r=n.backstage,s=r.shared,a=Ao().deviceType.isTouch,i=on(),l=on(),c=on(),d=zl((e=>{const t=Qo([]);return dv.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:e=>{t.set([]),dv.getContent(e).each((e=>{Ft(e.element,"visibility")})),Ha(e.element,vL),Ft(e.element,"width")},inlineBehaviours:Sa([bf("context-toolbar-events",[ca(fs(),((e,t)=>{"width"===t.event.raw.propertyName&&(Ha(e.element,vL),Ft(e.element,"width"))})),oa(fL,((e,t)=>{const o=e.element;Ft(o,"width");const n=Xt(o);dv.setContent(e,t.event.contents),Ba(o,vL);const r=Xt(o);Mt(o,"width",n+"px"),dv.getContent(e).each((e=>{t.event.focus.bind((e=>(zc(e),jc(o)))).orThunk((()=>(lf.focusIn(e),Uc(ht(o)))))})),setTimeout((()=>{Mt(e.element,"width",r+"px")}),0)})),oa(hL,((e,o)=>{dv.getContent(e).each((o=>{t.set(t.get().concat([{bar:o,focus:Uc(ht(e.element))}]))})),Gs(e,fL,{contents:o.event.forwardContents,focus:A.none()})})),oa(pL,((e,o)=>{oe(t.get()).each((o=>{t.set(t.get().slice(0,t.get().length-1)),Gs(e,fL,{contents:Vl(o.bar),focus:o.focus})}))}))]),lf.config({mode:"special",onEscape:o=>oe(t.get()).fold((()=>e.onEscape()),(e=>(qs(o,pL),A.some(!0))))})]),lazySink:()=>an.value(e.sink)})})({sink:o,onEscape:()=>(e.focus(),A.some(!0))})),m=()=>{const t=c.get().getOr("node"),o=iL(t)?1:0;return rL(e,s,t,o)},u=()=>!(e.removed||a()&&r.isContextMenuOpen()),g=()=>{if(u()){const t=m(),o=ye(c.get(),"node")?((e,t)=>t.filter((e=>yt(e)&&Ze(e))).map(Yo).getOrThunk((()=>nL(e))))(e,i.get()):nL(e);return t.height<=0||!oL(o,t,.01)}return!0},h=()=>{i.clear(),l.clear(),c.clear(),dv.hide(d)},p=()=>{if(dv.isOpen(d)){const e=d.element;Ft(e,"display"),g()?Mt(e,"display","none"):(l.set(0),dv.reposition(d))}},f=t=>({dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:Sa([lf.config({mode:"acyclic"}),bf("pop-dialog-wrap-events",[da((t=>{e.shortcuts.add("ctrl+F9","focus statusbar",(()=>lf.focusIn(t)))})),ma((t=>{e.shortcuts.remove("ctrl+F9")}))])])}),b=Qt((()=>gL(t,(e=>{const t=y([e]);Gs(d,hL,{forwardContents:f(t)})})))),y=t=>{const{buttons:o}=e.ui.registry.getAll(),r={...o,...b().formNavigators},a=Nv(e)===mv.scrolling?mv.scrolling:mv.default,i=$(P(t,(t=>"contexttoolbar"===t.type?((t,o)=>HB(e,{buttons:t,toolbar:o.items,allowToolbarGroups:!1},n.backstage,A.some(["form:"])))(r,t):((e,t)=>tL(e,t))(t,s.providers))));return QN({type:a,uid:Xi("context-toolbar"),initGroups:i,onEscape:A.none,cyclicKeying:!0,providers:s.providers})},w=(t,n)=>{const r="node"===t?s.anchors.node(n):s.anchors.cursor(),c=((e,t,o,n)=>"line"===t?{bubble:Sd(12,0,sL),layouts:{onLtr:()=>[Oc],onRtl:()=>[Ac]},overrides:aL}:{bubble:Sd(0,12,sL,1/12),layouts:cL(e,o,n,t),overrides:aL})(e,t,a(),{lastElement:i.get,isReposition:()=>ye(l.get(),0),getMode:()=>Pm.getMode(o)});return _n(r,c)},x=(e,t)=>{if(S.cancel(),!u())return;const n=y(e),r=e[0].position,s=w(r,t);c.set(r),l.set(1);const a=d.element;Ft(a,"display"),(e=>ye(xe(e,i.get(),Xe),!0))(t)||(Ha(a,bL),Pm.reset(o,d)),dv.showWithinBounds(d,f(n),{anchor:s,transition:{classes:[bL],mode:"placement"}},(()=>A.some(m()))),t.fold(i.clear,i.set),g()&&Mt(a,"display","none")};let C=!1;const S=$T((()=>{if(e.hasFocus()&&!e.removed&&!C)if(Pa(d.element,bL))S.throttle();else{((e,t)=>{const o=Be.fromDom(t.getBody()),n=e=>Xe(e,o),r=Be.fromDom(t.selection.getNode());return(e=>!n(e)&&!Je(o,e))(r)?A.none():mL(r,e.inNodeScope,e.inEditorScope).orThunk((()=>uL(n,r,e)))})(b(),e).fold(h,(e=>{x(e.toolbars,A.some(e.elem))}))}}),17);e.on("init",(()=>{e.on("remove",h),e.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",p),e.on("click keyup focus SetContent",S.throttle),e.on(XB,h),e.on("contexttoolbar-show",(t=>{const o=b();fe(o.lookupTable,t.toolbarKey).each((o=>{x([o],Se(t.target!==e,t.target)),dv.getContent(d).each(lf.focusIn)}))})),e.on("focusout",(t=>{gv.setEditorTimeout(e,(()=>{jc(o.element).isNone()&&jc(d.element).isNone()&&h()}),0)})),e.on("SwitchMode",(()=>{e.mode.isReadOnly()&&h()})),e.on("ExecCommand",(({command:e})=>{"toggleview"===e.toLowerCase()&&h()})),e.on("AfterProgressState",(t=>{t.state?h():e.hasFocus()&&S.throttle()})),e.on("dragstart",(()=>{C=!0})),e.on("dragend drop",(()=>{C=!1})),e.on("NodeChange",(e=>{jc(d.element).fold(S.throttle,v)}))}))},wL=(e,t)=>{const o=()=>{const o=t.getOptions(e),n=t.getCurrent(e).map(t.hash),r=on();return P(o,(o=>({type:"togglemenuitem",text:t.display(o),onSetup:s=>{const a=e=>{e&&(r.on((e=>e.setActive(!1))),r.set(s)),s.setActive(e)};a(ye(n,t.hash(o)));const i=t.watcher(e,o,a);return()=>{r.clear(),i()}},onAction:()=>t.setCurrent(e,o)})))};e.ui.registry.addMenuButton(t.name,{tooltip:t.text,icon:t.icon,fetch:e=>e(o()),onSetup:t.onToolbarSetup}),e.ui.registry.addNestedMenuItem(t.name,{type:"nestedmenuitem",text:t.text,getSubmenuItems:o,onSetup:t.onMenuSetup})},xL=e=>({name:"lineheight",text:"Line height",icon:"line-height",getOptions:lb,hash:e=>((e,t)=>rB(e,t).map((({value:e,unit:t})=>e+t)))(e,["fixed","relative","empty"]).getOr(e),display:x,watcher:(e,t,o)=>e.formatter.formatChanged("lineheight",o,!1,{value:t}).unbind,getCurrent:e=>A.from(e.queryCommandValue("LineHeight")),setCurrent:(e,t)=>e.execCommand("LineHeight",!1,t),onToolbarSetup:tS(e),onMenuSetup:tS(e)}),CL=e=>{wL(e,xL(e)),(e=>A.from(Dv(e)).map((t=>({name:"language",text:"Language",icon:"language",getOptions:w(t),hash:e=>m(e.customCode)?e.code:`${e.code}/${e.customCode}`,display:e=>e.title,watcher:(e,t,o)=>{var n;return e.formatter.formatChanged("lang",o,!1,{value:t.code,customValue:null!==(n=t.customCode)&&void 0!==n?n:null}).unbind},getCurrent:e=>{const t=Be.fromDom(e.selection.getNode());return qr(t,(e=>A.some(e).filter(Ue).bind((e=>Et(e,"lang").map((t=>({code:t,customCode:Et(e,"data-mce-lang").getOrUndefined(),title:""})))))))},setCurrent:(e,t)=>e.execCommand("Lang",!1,t),onToolbarSetup:t=>{const o=tn();return t.setActive(e.formatter.match("lang",{},void 0,!0)),o.set(e.formatter.formatChanged("lang",t.setActive,!0)),eS(o.clear,tS(e)(t))},onMenuSetup:tS(e)}))))(e).each((t=>wL(e,t)))},SL=(e,t)=>{((e,t)=>{const o=PR(t,WR(e));e.ui.registry.addNestedMenuItem("align",{text:t.shared.providers.translate("Align"),onSetup:tS(e),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})})(e,t),((e,t)=>{const o=PR(t,tB(e));e.ui.registry.addNestedMenuItem("fontfamily",{text:t.shared.providers.translate("Fonts"),onSetup:tS(e),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})})(e,t),((e,t)=>{const o={type:"advanced",...t.styles},n=PR(t,pB(e,o));e.ui.registry.addNestedMenuItem("styles",{text:"Formats",onSetup:tS(e),getSubmenuItems:()=>n.items.validateItems(n.getStyleItems())})})(e,t),((e,t)=>{const o=PR(t,KR(e));e.ui.registry.addNestedMenuItem("blocks",{text:"Blocks",onSetup:tS(e),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})})(e,t),((e,t)=>{const o=PR(t,gB(e));e.ui.registry.addNestedMenuItem("fontsize",{text:"Font sizes",onSetup:tS(e),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})})(e,t)},kL=e=>nS(e,"NodeChange",(t=>{t.setEnabled(e.queryCommandState("outdent")&&e.selection.isEditable())})),_L=e=>{(e=>{e.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:kL(e),onAction:sS(e,"outdent")}),e.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onSetup:tS(e),onAction:sS(e,"indent")})})(e)},EL=(e,t)=>o=>{o.setActive(t.get());const n=e=>{t.set(e.state),o.setActive(e.state)};return e.on("PastePlainTextToggle",n),eS((()=>e.off("PastePlainTextToggle",n)),tS(e)(o))},TL=(e,t)=>()=>{e.execCommand("mceToggleFormat",!1,t)},OL=e=>{(e=>{jT.each([{name:"bold",text:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],((t,o)=>{e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:oS(e,t.name),onAction:TL(e,t.name),shortcut:t.shortcut})}));for(let t=1;t<=6;t++){const o="h"+t,n=`Access+${t}`;e.ui.registry.addToggleButton(o,{text:o.toUpperCase(),tooltip:"Heading "+t,onSetup:oS(e,o),onAction:TL(e,o),shortcut:n})}})(e),(e=>{jT.each([{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"help",text:"Help",action:"mceHelp",icon:"help",shortcut:"Alt+0"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"print",text:"Print",action:"mcePrint",icon:"print",shortcut:"Meta+P"}],(t=>{e.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:sS(e,t.action),shortcut:t.shortcut})})),jT.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],(t=>{e.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:tS(e),onAction:sS(e,t.action)})}))})(e),(e=>{jT.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(t=>{e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:sS(e,t.action),onSetup:oS(e,t.name)})}))})(e)},AL=e=>{OL(e),(e=>{jT.each([{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"},{name:"print",text:"Print...",action:"mcePrint",icon:"print",shortcut:"Meta+P"}],(t=>{e.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onAction:sS(e,t.action)})})),jT.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],(t=>{e.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onSetup:tS(e),onAction:sS(e,t.action)})})),e.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onSetup:tS(e),onAction:TL(e,"code")})})(e)},DL=(e,t)=>nS(e,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(o=>{o.setEnabled(!e.mode.isReadOnly()&&e.undoManager[t]())})),ML=e=>{(e=>{e.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:DL(e,"hasUndo"),onAction:sS(e,"undo")}),e.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:DL(e,"hasRedo"),onAction:sS(e,"redo")})})(e),(e=>{e.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",enabled:!1,onSetup:DL(e,"hasUndo"),onAction:sS(e,"undo"),shortcut:"Meta+Z"}),e.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",enabled:!1,onSetup:DL(e,"hasRedo"),onAction:sS(e,"redo"),shortcut:"Meta+Y"})})(e)},NL=e=>nS(e,"VisualAid",(t=>{t.setActive(e.hasVisual)})),RL=e=>{(e=>{e.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:sS(e,"mceToggleVisualAid")})})(e),(e=>{e.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:NL(e),onAction:sS(e,"mceToggleVisualAid")})})(e)},BL=(e,t)=>{(e=>{F([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],(t=>{e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:sS(e,t.cmd),onSetup:oS(e,t.name)})})),e.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onSetup:tS(e),onAction:sS(e,"JustifyNone")})})(e),AL(e),SL(e,t),ML(e),(e=>{(e=>{e.addCommand("mceApplyTextcolor",((t,o)=>{((e,t,o)=>{e.undoManager.transact((()=>{e.focus(),e.formatter.apply(t,{value:o}),e.nodeChanged()}))})(e,t,o)})),e.addCommand("mceRemoveTextcolor",(t=>{((e,t)=>{e.undoManager.transact((()=>{e.focus(),e.formatter.remove(t,{value:null},void 0,!0),e.nodeChanged()}))})(e,t)}))})(e);const t=_S(e),o=ES(e),n=Qo(t),r=Qo(o);IS(e,"forecolor","forecolor",n),IS(e,"backcolor","hilitecolor",r),PS(e,"forecolor","forecolor","Text color",n),PS(e,"backcolor","hilitecolor","Background color",r)})(e),RL(e),_L(e),CL(e),(e=>{const t=Qo(Qv(e)),o=()=>e.execCommand("mceTogglePlainTextPaste");e.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:o,onSetup:EL(e,t)}),e.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:o,onSetup:EL(e,t)})})(e)},LL=e=>s(e)?e.split(/[ ,]/):e,HL=e=>t=>t.options.get(e),IL=HL("contextmenu_never_use_native"),PL=HL("contextmenu_avoid_overlap"),FL=e=>{const t=e.ui.registry.getAll().contextMenus,o=e.options.get("contextmenu");return e.options.isSet("contextmenu")?o:V(o,(e=>ve(t,e)))},zL=(e,t)=>({type:"makeshift",x:e,y:t}),VL=e=>"longpress"===e.type||0===e.type.indexOf("touch"),ZL=(e,t)=>{const o=hv.DOM.getPos(e);return((e,t,o)=>zL(e.x+t,e.y+o))(t,o.x,o.y)},UL=(e,t)=>"contextmenu"===t.type||"longpress"===t.type?e.inline?(e=>{if(VL(e)){const t=e.touches[0];return zL(t.pageX,t.pageY)}return zL(e.pageX,e.pageY)})(t):ZL(e.getContentAreaContainer(),(e=>{if(VL(e)){const t=e.touches[0];return zL(t.clientX,t.clientY)}return zL(e.clientX,e.clientY)})(t)):jL(e),jL=e=>({type:"selection",root:Be.fromDom(e.selection.getNode())}),WL=(e,t,o)=>{switch(o){case"node":return(e=>({type:"node",node:A.some(Be.fromDom(e.selection.getNode())),root:Be.fromDom(e.getBody())}))(e);case"point":return UL(e,t);case"selection":return jL(e)}},$L=(e,t,o,n,r,s)=>{const a=o(),i=WL(e,t,s);NO(a,ew.CLOSE_ON_EXECUTE,n,{isHorizontalMenu:!1,search:A.none()}).map((e=>{t.preventDefault(),dv.showMenuAt(r,{anchor:i},{menu:{markers:pw("normal")},data:e})}))},qL={onLtr:()=>[Tc,Cc,Sc,kc,_c,Ec,CD,SD,xD,yD,wD,bD],onRtl:()=>[Tc,Sc,Cc,_c,kc,Ec,CD,SD,wD,bD,xD,yD]},GL={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},KL=(e,t,o,n,r,s,a)=>{const i=((e,t,o)=>{const n=WL(e,t,o);return{bubble:Sd(0,"point"===o?12:0,GL),layouts:qL,overrides:{maxWidthFunction:ON(),maxHeightFunction:yd()},...n}})(e,t,s);NO(o,ew.CLOSE_ON_EXECUTE,n,{isHorizontalMenu:!0,search:A.none()}).map((o=>{t.preventDefault();const l=a?iv.HighlightMenuAndItem:iv.HighlightNone;dv.showMenuWithinBounds(r,{anchor:i},{menu:{markers:pw("normal"),highlightOnOpen:l},data:o,type:"horizontal"},(()=>A.some(rL(e,n.shared,"node"===s?"node":"selection")))),e.dispatch(XB)}))},YL=(e,t,o,n,r,s)=>{const a=Ao(),i=a.os.isiOS(),l=a.os.isMacOS(),c=a.os.isAndroid(),d=a.deviceType.isTouch(),m=()=>{const a=o();KL(e,t,a,n,r,s,!(c||i||l&&d))};if((l||i)&&"node"!==s){const o=()=>{(e=>{const t=e.selection.getRng(),o=()=>{gv.setEditorTimeout(e,(()=>{e.selection.setRng(t)}),10),s()};e.once("touchend",o);const n=e=>{e.preventDefault(),e.stopImmediatePropagation()};e.on("mousedown",n,!0);const r=()=>s();e.once("longpresscancel",r);const s=()=>{e.off("touchend",o),e.off("longpresscancel",r),e.off("mousedown",n)}})(e),m()};((e,t)=>{const o=e.selection;if(o.isCollapsed()||t.touches.length<1)return!1;{const n=t.touches[0],r=o.getRng();return dm(e.getWin(),Yd.domRange(r)).exists((e=>e.left<=n.clientX&&e.right>=n.clientX&&e.top<=n.clientY&&e.bottom>=n.clientY))}})(e,t)?o():(e.once("selectionchange",o),e.once("touchend",(()=>e.off("selectionchange",o))))}else m()},XL=e=>s(e)?"|"===e:"separator"===e.type,JL={type:"separator"},QL=e=>{const t=e=>({text:e.text,icon:e.icon,enabled:e.enabled,shortcut:e.shortcut});if(s(e))return e;switch(e.type){case"separator":return JL;case"submenu":return{type:"nestedmenuitem",...t(e),getSubmenuItems:()=>{const t=e.getSubmenuItems();return s(t)?t:P(t,QL)}};default:const o=e;return{type:"menuitem",...t(o),onAction:b(o.onAction)}}},eH=(e,t)=>{if(0===t.length)return e;const o=oe(e).filter((e=>!XL(e))),n=o.fold((()=>[]),(e=>[JL]));return e.concat(n).concat(t).concat([JL])},tH=(e,t)=>!(e=>"longpress"===e.type||ve(e,"touches"))(t)&&(2!==t.button||t.target===e.getBody()&&""===t.pointerType),oH=(e,t)=>tH(e,t)?e.selection.getStart(!0):t.target,nH=(e,t,o)=>{const n=Ao().deviceType.isTouch,r=zl(dv.sketch({dom:{tag:"div"},lazySink:t,onEscape:()=>e.focus(),onShow:()=>o.setContextMenuState(!0),onHide:()=>o.setContextMenuState(!1),fireDismissalEventInstead:{},inlineBehaviours:Sa([bf("dismissContextMenu",[oa(Ps(),((t,o)=>{mu.close(t),e.focus()}))])])})),a=()=>dv.hide(r),i=t=>{if(IL(e)&&t.preventDefault(),((e,t)=>t.ctrlKey&&!IL(e))(e,t)||(e=>0===FL(e).length)(e))return;const a=((e,t)=>{const o=PL(e),n=tH(e,t)?"selection":"point";if(De(o)){const r=oH(e,t);return zk(Be.fromDom(r),o)?"node":n}return n})(e,t);(n()?YL:$L)(e,t,(()=>{const o=oH(e,t),n=e.ui.registry.getAll(),r=FL(e);return((e,t,o)=>{const n=U(t,((t,n)=>fe(e,n.toLowerCase()).map((e=>{const n=e.update(o);if(s(n)&&De(Ae(n)))return eH(t,n.split(" "));if(l(n)&&n.length>0){const e=P(n,QL);return eH(t,e)}return t})).getOrThunk((()=>t.concat([n])))),[]);return n.length>0&&XL(n[n.length-1])&&n.pop(),n})(n.contextMenus,r,o)}),o,r,a)};e.on("init",(()=>{const t="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(n()?"":" ResizeWindow");e.on(t,a),e.on("longpress contextmenu",i)}))},rH=zr([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),sH=e=>t=>t.translate(-e.left,-e.top),aH=e=>t=>t.translate(e.left,e.top),iH=e=>(t,o)=>U(e,((e,t)=>t(e)),$t(t,o)),lH=(e,t,o)=>e.fold(iH([aH(o),sH(t)]),iH([sH(t)]),iH([])),cH=(e,t,o)=>e.fold(iH([aH(o)]),iH([]),iH([aH(t)])),dH=(e,t,o)=>e.fold(iH([]),iH([sH(o)]),iH([aH(t),sH(o)])),mH=(e,t,o)=>{const n=e.fold(((e,t)=>({position:A.some("absolute"),left:A.some(e+"px"),top:A.some(t+"px")})),((e,t)=>({position:A.some("absolute"),left:A.some(e-o.left+"px"),top:A.some(t-o.top+"px")})),((e,t)=>({position:A.some("fixed"),left:A.some(e+"px"),top:A.some(t+"px")})));return{right:A.none(),bottom:A.none(),...n}},uH=(e,t,o,n)=>{const r=(e,r)=>(s,a)=>{const i=e(t,o,n);return r(s.getOr(i.left),a.getOr(i.top))};return e.fold(r(dH,gH),r(cH,hH),r(lH,pH))},gH=rH.offset,hH=rH.absolute,pH=rH.fixed,fH=(e,t)=>{const o=_t(e,t);return m(o)?NaN:parseInt(o,10)},vH=(e,t,o,n)=>((e,t)=>{const o=e.element,n=fH(o,t.leftAttr),r=fH(o,t.topAttr);return isNaN(n)||isNaN(r)?A.none():A.some($t(n,r))})(e,t).fold((()=>o),(e=>pH(e.left+n.left,e.top+n.top))),bH=(e,t,o,n,r,s)=>{const a=vH(e,t,o,n),i=t.mustSnap?xH(e,t,a,r,s):CH(e,t,a,r,s),l=lH(a,r,s);return((e,t,o)=>{const n=e.element;St(n,t.leftAttr,o.left+"px"),St(n,t.topAttr,o.top+"px")})(e,t,l),i.fold((()=>({coord:pH(l.left,l.top),extra:A.none()})),(e=>({coord:e.output,extra:e.extra})))},yH=(e,t)=>{((e,t)=>{const o=e.element;Ot(o,t.leftAttr),Ot(o,t.topAttr)})(e,t)},wH=(e,t,o,n)=>re(e,(e=>{const r=e.sensor,s=((e,t,o,n,r,s)=>{const a=cH(e,r,s),i=cH(t,r,s);return Math.abs(a.left-i.left)<=o&&Math.abs(a.top-i.top)<=n})(t,r,e.range.left,e.range.top,o,n);return s?A.some({output:uH(e.output,t,o,n),extra:e.extra}):A.none()})),xH=(e,t,o,n,r)=>{const s=t.getSnapPoints(e);return wH(s,o,n,r).orThunk((()=>{const e=U(s,((e,t)=>{const s=t.sensor,a=((e,t,o,n,r,s)=>{const a=cH(e,r,s),i=cH(t,r,s),l=Math.abs(a.left-i.left),c=Math.abs(a.top-i.top);return $t(l,c)})(o,s,t.range.left,t.range.top,n,r);return e.deltas.fold((()=>({deltas:A.some(a),snap:A.some(t)})),(o=>(a.left+a.top)/2<=(o.left+o.top)/2?{deltas:A.some(a),snap:A.some(t)}:e))}),{deltas:A.none(),snap:A.none()});return e.snap.map((e=>({output:uH(e.output,o,n,r),extra:e.extra})))}))},CH=(e,t,o,n,r)=>{const s=t.getSnapPoints(e);return wH(s,o,n,r)};var SH=Object.freeze({__proto__:null,snapTo:(e,t,o,n)=>{const r=t.getTarget(e.element);if(t.repositionTarget){const t=Qe(e.element),o=zo(t),s=Wa(r),a=((e,t,o)=>({coord:uH(e.output,e.output,t,o),extra:e.extra}))(n,o,s),i=mH(a.coord,0,s);Rt(r,i)}}});const kH="data-initial-z-index",_H=(e,t)=>{e.getSystem().addToGui(t),(e=>{nt(e.element).filter(Ue).each((t=>{Ht(t,"z-index").each((e=>{St(t,kH,e)})),Mt(t,"z-index",Bt(e.element,"z-index"))}))})(t)},EH=e=>{(e=>{nt(e.element).filter(Ue).each((e=>{Et(e,kH).fold((()=>Ft(e,"z-index")),(t=>Mt(e,"z-index",t))),Ot(e,kH)}))})(e),e.getSystem().removeFromGui(e)},TH=(e,t,o)=>e.getSystem().build(Qk.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[t]},events:o}));var OH=Dr("snaps",[hr("getSnapPoints"),Fi("onSensor"),hr("leftAttr"),hr("topAttr"),Mr("lazyViewport",Jo),Mr("mustSnap",!1)]);const AH=[Mr("useFixed",T),hr("blockerClass"),Mr("getTarget",x),Mr("onDrag",v),Mr("repositionTarget",!0),Mr("onDrop",v),Ir("getBounds",Jo),OH],DH=e=>((e,t,o,n)=>e.isSome()&&t.isSome()&&o.isSome()?A.some(n(e.getOrDie(),t.getOrDie(),o.getOrDie())):A.none())(Ht(e,"left"),Ht(e,"top"),Ht(e,"position"),((e,t,o)=>("fixed"===o?pH:gH)(parseInt(e,10),parseInt(t,10)))).getOrThunk((()=>{const t=Gt(e);return hH(t.left,t.top)})),MH=(e,t,o,n,r,s,a)=>((e,t,o,n,r)=>{const s=r.bounds,a=cH(t,o,n),i=gc(a.left,s.x,s.x+s.width-r.width),l=gc(a.top,s.y,s.y+s.height-r.height),c=hH(i,l);return t.fold((()=>{const e=dH(c,o,n);return gH(e.left,e.top)}),w(c),(()=>{const e=lH(c,o,n);return pH(e.left,e.top)}))})(0,t.fold((()=>{const e=(t=o,a=s.left,i=s.top,t.fold(((e,t)=>gH(e+a,t+i)),((e,t)=>hH(e+a,t+i)),((e,t)=>pH(e+a,t+i))));var t,a,i;const l=lH(e,n,r);return pH(l.left,l.top)}),(t=>{const a=bH(e,t,o,s,n,r);return a.extra.each((o=>{t.onSensor(e,o)})),a.coord})),n,r,a),NH=(e,t)=>({bounds:e.getBounds(),height:jt(t.element),width:Jt(t.element)}),RH=(e,t,o,n,r)=>{const s=o.update(n,r),a=o.getStartData().getOrThunk((()=>NH(t,e)));s.each((o=>{((e,t,o,n)=>{const r=t.getTarget(e.element);if(t.repositionTarget){const s=Qe(e.element),a=zo(s),i=Wa(r),l=DH(r),c=MH(e,t.snaps,l,a,i,n,o),d=mH(c,0,i);Rt(r,d)}t.onDrag(e,r,n)})(e,t,a,o)}))},BH=(e,t,o,n)=>{t.each(EH),o.snaps.each((t=>{yH(e,t)}));const r=o.getTarget(e.element);n.reset(),o.onDrop(e,r)},LH=e=>(t,o)=>{const n=e=>{o.setStartData(NH(t,e))};return Qs([oa(Bs(),(e=>{o.getStartData().each((()=>n(e)))})),...e(t,o,n)])};var HH=Object.freeze({__proto__:null,getData:e=>A.from($t(e.x,e.y)),getDelta:(e,t)=>$t(t.left-e.left,t.top-e.top)});const IH=(e,t,o)=>[oa(ns(),((n,r)=>{if(0!==r.event.raw.button)return;r.stop();const s=()=>BH(n,A.some(l),e,t),a=Vk(s,200),i={drop:s,delayDrop:a.schedule,forceDrop:s,move:o=>{a.cancel(),RH(n,e,t,HH,o)}},l=TH(n,e.blockerClass,(e=>Qs([oa(ns(),e.forceDrop),oa(as(),e.drop),oa(rs(),((t,o)=>{e.move(o.event)})),oa(ss(),e.delayDrop)]))(i));o(n),_H(n,l)}))],PH=[...AH,Ui("dragger",{handlers:LH(IH)})];var FH=Object.freeze({__proto__:null,getData:e=>{const t=e.raw.touches;return 1===t.length?(e=>{const t=e[0];return A.some($t(t.clientX,t.clientY))})(t):A.none()},getDelta:(e,t)=>$t(t.left-e.left,t.top-e.top)});const zH=(e,t,o)=>{const n=on(),r=o=>{BH(o,n.get(),e,t),n.clear()};return[oa(Qr(),((s,a)=>{a.stop();const i=()=>r(s),l={drop:i,delayDrop:v,forceDrop:i,move:o=>{RH(s,e,t,FH,o)}},c=TH(s,e.blockerClass,(e=>Qs([oa(Qr(),e.forceDrop),oa(ts(),e.drop),oa(os(),e.drop),oa(es(),((t,o)=>{e.move(o.event)}))]))(l));n.set(c);o(s),_H(s,c)})),oa(es(),((o,n)=>{n.stop(),RH(o,e,t,FH,n.event)})),oa(ts(),((e,t)=>{t.stop(),r(e)})),oa(os(),r)]},VH=PH,ZH=[...AH,Ui("dragger",{handlers:LH(zH)})],UH=[...AH,Ui("dragger",{handlers:LH(((e,t,o)=>[...IH(e,t,o),...zH(e,t,o)]))})];var jH=Object.freeze({__proto__:null,mouse:VH,touch:ZH,mouseOrTouch:UH});var WH=Object.freeze({__proto__:null,init:()=>{let e=A.none(),t=A.none();const o=w({});return Ca({readState:o,reset:()=>{e=A.none(),t=A.none()},update:(t,o)=>t.getData(o).bind((o=>((t,o)=>{const n=e.map((e=>t.getDelta(e,o)));return e=A.some(o),n})(t,o))),getStartData:()=>t,setStartData:e=>{t=A.some(e)}})}});const $H=Ta({branchKey:"mode",branches:jH,name:"dragging",active:{events:(e,t)=>e.dragger.handlers(e,t)},extra:{snap:e=>({sensor:e.sensor,range:e.range,output:e.output,extra:A.from(e.extra)})},state:WH,apis:SH}),qH=(e,t,o,n,r,s)=>e.fold((()=>$H.snap({sensor:hH(o-20,n-20),range:$t(r,s),output:hH(A.some(o),A.some(n)),extra:{td:t}})),(e=>{const r=o-20,s=n-20,a=e.element.dom.getBoundingClientRect();return $H.snap({sensor:hH(r,s),range:$t(40,40),output:hH(A.some(o-a.width/2),A.some(n-a.height/2)),extra:{td:t}})})),GH=(e,t,o)=>({getSnapPoints:e,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:(e,n)=>{const r=n.td;((e,t)=>e.exists((e=>Xe(e,t))))(t.get(),r)||(t.set(r),o(r))},mustSnap:!0}),KH=e=>Ob(Eb.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:Sa([$H.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:e}),A_.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}})),YH=(e,t)=>{const o=Qo([]),n=Qo([]),r=Qo(!1),s=on(),a=on(),i=e=>{const o=Yo(e);return qH(m.getOpt(t),e,o.x,o.y,o.width,o.height)},l=e=>{const o=Yo(e);return qH(u.getOpt(t),e,o.right,o.bottom,o.width,o.height)},c=GH((()=>P(o.get(),(e=>i(e)))),s,(t=>{a.get().each((o=>{e.dispatch("TableSelectorChange",{start:t,finish:o})}))})),d=GH((()=>P(n.get(),(e=>l(e)))),a,(t=>{s.get().each((o=>{e.dispatch("TableSelectorChange",{start:o,finish:t})}))})),m=KH(c),u=KH(d),g=zl(m.asSpec()),h=zl(u.asSpec()),p=(t,o,n,r)=>{const s=n(o);$H.snapTo(t,s);((t,o,n,r)=>{const s=o.dom.getBoundingClientRect();Ft(t.element,"display");const a=ot(Be.fromDom(e.getBody())).dom.innerHeight,i=n(s),l=r(s,a);(i||l)&&Mt(t.element,"display","none")})(t,o,(e=>e[r]<0),((e,t)=>e[r]>t))},f=e=>p(g,e,i,"top"),v=e=>p(h,e,l,"bottom");if(Ao().deviceType.isTouch()){const i=e=>P(e,Be.fromDom);e.on("TableSelectionChange",(e=>{r.get()||($m(t,g),$m(t,h),r.set(!0));const l=Be.fromDom(e.start),c=Be.fromDom(e.finish);s.set(l),a.set(c),A.from(e.otherCells).each((e=>{o.set(i(e.upOrLeftCells)),n.set(i(e.downOrRightCells)),f(l),v(c)}))})),e.on("ResizeEditor ResizeWindow ScrollContent",(()=>{s.get().each(f),a.get().each(v)})),e.on("TableSelectionClear",(()=>{r.get()&&(Km(g),Km(h),r.set(!1)),s.clear(),a.clear()}))}};const XH=(e,t,o)=>{var n;const r=null!==(n=t.delimiter)&&void 0!==n?n:"›",s=(t,n,r)=>Eb.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{"data-index":r}},components:[Hl(t)],action:t=>{e.focus(),e.selection.select(n),e.nodeChanged()},buttonBehaviours:Sa([Zb.config({...o.tooltips.getConfig({tooltipText:o.translate(["Select the {0} element",n.nodeName.toLowerCase()]),onShow:(e,t)=>{((e,t)=>{const o=A.from(_t(e,"id")).getOrThunk((()=>{const e=Xi("aria");return St(t,"id",e),e}));St(e,"aria-describedby",o)})(e.element,t.element)},onHide:e=>{var t;t=e.element,Ot(t,"aria-describedby")}})}),sC(o.isDisabled),nC()])});return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:Sa([lf.config({mode:"flow",selector:"div[role=button]"}),eh.config({disabled:o.isDisabled}),nC(),Mb.config({}),vf.config({}),bf("elementPathEvents",[da(((t,o)=>{e.shortcuts.add("alt+F11","focus statusbar elementpath",(()=>lf.focusIn(t))),e.on("NodeChange",(o=>{const n=(t=>{const o=[];let n=t.length;for(;n-- >0;){const s=t[n];if(1===s.nodeType&&"BR"!==(r=s).nodeName&&!r.getAttribute("data-mce-bogus")&&"bookmark"!==r.getAttribute("data-mce-type")){const t=QC(e,s);if(t.isDefaultPrevented()||o.push({name:t.name,element:s}),t.isPropagationStopped())break}}var r;return o})(o.parents),a=n.length>0?U(n,((e,t,o)=>{const n=s(t.name,t.element,o);return 0===o?e.concat([n]):e.concat([{dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0}},components:[Hl(` ${r} `)]},n])}),[]):[];vf.set(t,a)}))}))])]),components:[]}};var JH;!function(e){e[e.None=0]="None",e[e.Both=1]="Both",e[e.Vertical=2]="Vertical"}(JH||(JH={}));const QH=(e,t,o)=>{const n=Be.fromDom(e.getContainer()),r=((e,t,o,n,r)=>{const s={height:UB(n+t.top,kv(e),Ev(e))};return o===JH.Both&&(s.width=UB(r+t.left,Sv(e),_v(e))),s})(e,t,o,Ut(n),Xt(n));ie(r,((e,t)=>{p(e)&&Mt(n,t,ZB(e))})),(e=>{e.dispatch("ResizeEditor")})(e)},eI=(e,t,o,n)=>{const r=$t(20*o,20*n);return QH(e,r,t),A.some(!0)},tI=(e,t)=>{const o=(e=>{const t=Jv(e);return!1===t?JH.None:"both"===t?JH.Both:JH.Vertical})(e);if(o===JH.None)return A.none();const n=o===JH.Both?"Press the arrow keys to resize the editor.":"Press the Up and Down arrow keys to resize the editor.";return A.some(Gy("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{"aria-label":t.translate(n),"data-mce-name":"resize-handle"},behaviours:[$H.config({mode:"mouse",repositionTarget:!1,onDrag:(t,n,r)=>QH(e,r,o),blockerClass:"tox-blocker"}),lf.config({mode:"special",onLeft:()=>eI(e,o,-1,0),onRight:()=>eI(e,o,1,0),onUp:()=>eI(e,o,0,-1),onDown:()=>eI(e,o,0,1)}),Mb.config({}),Sf.config({}),Zb.config(t.tooltips.getConfig({tooltipText:t.translate("Resize")}))]},t.icons))},oI=(e,t)=>{const o=()=>{const o=[];return e.hasPlugin("wordcount")&&o.push(((e,t)=>{const o=(e,o,n)=>vf.set(e,[Hl(t.translate(["{0} "+n,o[n]]))]);return Eb.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:Sa([sC(t.isDisabled),nC(),Mb.config({}),vf.config({}),Mu.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),bf("wordcount-events",[ga((e=>{const t=Mu.getValue(e),n="words"===t.mode?"characters":"words";Mu.setValue(e,{mode:n,count:t.count}),o(e,t.count,n)})),da((t=>{e.on("wordCountUpdate",(e=>{const{mode:n}=Mu.getValue(t);Mu.setValue(t,{mode:n,count:e.wordCount}),o(t,e.wordCount,n)}))}))])]),eventOrder:{[_s()]:["disabling","alloy.base.behaviour","wordcount-events"]}})})(e,t)),Xv(e)&&o.push({dom:{tag:"span",classes:["tox-statusbar__branding"]},components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/powered-by-tiny?utm_campaign=poweredby&utm_source=tiny&utm_medium=referral&utm_content=v7",rel:"noopener",target:"_blank","aria-label":e.translate(["Build with {0}","TinyMCE"])},innerHtml:e.translate(["Build with {0}",'\n'.trim()])},behaviours:Sa([Sf.config({})])}]}),{dom:{tag:"div",classes:["tox-statusbar__right-container"]},components:o}},n=()=>{const n=[],r=ob(e),s=Yv(e),a=Xv(e)||e.hasPlugin("wordcount"),i=()=>{const e="tox-statusbar__text-container--flex-start",t="tox-statusbar__text-container--flex-end";if(r){const o="tox-statusbar__text-container-3-cols";return a||s?a&&!s?[o,t]:[o,e]:[o,"tox-statusbar__text-container--space-around"]}return[a&&!s?t:e]};return s&&n.push(XH(e,{},t)),r&&n.push((()=>{const e=fC("Alt+0");return{dom:{tag:"div",classes:["tox-statusbar__help-text"]},components:[Hl(Fy.translate(["Press {0} for help",e]))]}})()),a&&n.push(o()),n.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container",...i()]},components:n}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(()=>{const o=n(),r=tI(e,t);return o.concat(r.toArray())})()}},nI=(e,t)=>t.get().getOrDie(`UI for ${e} has not been rendered`),rI=(e,t)=>{const o=e.inline,n=o?YB:zB,r=vb(e)?$M:HM,s=(()=>{const e=on(),t=on(),o=on();return{dialogUi:e,popupUi:t,mainUi:o,getUiMotherships:()=>{const o=e.get().map((e=>e.mothership)),n=t.get().map((e=>e.mothership));return o.fold((()=>n.toArray()),(e=>n.fold((()=>[e]),(t=>Xe(e.element,t.element)?[e]:[e,t]))))},lazyGetInOuterOrDie:(e,t)=>()=>o.get().bind((e=>t(e.outerContainer))).getOrDie(`Could not find ${e} element in OuterContainer`)}})(),a=on(),i=on(),l=on(),c=Ao().deviceType.isTouch()?["tox-platform-touch"]:[],d=ub(e),m=Nv(e),u=Ob({dom:{tag:"div",classes:["tox-anchorbar"]}}),g=Ob({dom:{tag:"div",classes:["tox-bottom-anchorbar"]}}),h=()=>s.mainUi.get().map((e=>e.outerContainer)).bind(_R.getHeader),p=s.lazyGetInOuterOrDie("anchor bar",u.getOpt),f=s.lazyGetInOuterOrDie("bottom anchor bar",g.getOpt),v=s.lazyGetInOuterOrDie("toolbar",_R.getToolbar),b=s.lazyGetInOuterOrDie("throbber",_R.getThrobber),y=SM({popup:()=>an.fromOption(s.popupUi.get().map((e=>e.sink)),"(popup) UI has not been rendered"),dialog:()=>an.fromOption(s.dialogUi.get().map((e=>e.sink)),"UI has not been rendered")},e,p,f),w=()=>_R.parts.promotion({dom:{tag:"div",classes:["tox-promotion"]}}),x=()=>{const t=(()=>{const t={attributes:{[Ad]:d?Od.BottomToTop:Od.TopToBottom}},o=_R.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:y.popup,onEscape:()=>{e.focus()}}),n=_R.parts.toolbar({dom:{tag:"div",classes:["tox-toolbar"]},getSink:y.popup.shared.getSink,providers:y.popup.shared.providers,onEscape:()=>{e.focus()},onToolbarToggled:t=>{((e,t)=>{e.dispatch("ToggleToolbarDrawer",{state:t})})(e,t)},type:m,lazyToolbar:v,lazyHeader:()=>h().getOrDie("Could not find header element"),...t}),r=_R.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:y.popup.shared.providers,onEscape:()=>{e.focus()},type:m}),s=mb(e),a=cb(e),i=sb(e),l=tb(e),c=w(),g=s||a||i,p=l?[c,o]:[o];return _R.parts.header({dom:{tag:"div",classes:["tox-editor-header"].concat(g?[]:["tox-editor-header--empty"]),...t},components:$([i?p:[],s?[r]:a?[n]:[],hb(e)?[]:[u.asSpec()]]),sticky:vb(e),editor:e,sharedBackstage:y.popup.shared})})(),n={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[_R.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),_R.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}})]},r=_R.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:y.popup}),s=_R.parts.viewWrapper({backstage:y.popup}),i=Kv(e)&&!o?A.some(oI(e,y.popup.shared.providers)):A.none(),l=$([d?[]:[t],o?[]:[n],d?[t]:[]]),p=_R.parts.editorContainer({components:$([l,o?[]:[g.asSpec()]])}),f=fb(e),b={role:"application",...Fy.isRtl()?{dir:"rtl"}:{},...f?{"aria-hidden":"true"}:{}},x=zl(_R.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(o?["tox-tinymce-inline"]:[]).concat(d?["tox-tinymce--toolbar-bottom"]:[]).concat(c),styles:{visibility:"hidden",...f?{opacity:"0",border:"0"}:{}},attributes:b},components:[p,...o?[]:[s,...i.toArray()],r],behaviours:Sa([nC(),eh.config({disableClass:"tox-tinymce--disabled"}),lf.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])})),C=e_(x);return a.set(C),{mothership:C,outerContainer:x}},C=t=>{const o=ZB(jB(e)),n=ZB((e=>WB(e).getOr(Cv(e)))(e));return e.inline||(Pt("div","width",n)&&Mt(t.element,"width",n),Pt("div","height",o)?Mt(t.element,"height",o):Mt(t.element,"height","400px")),o},S=t=>{const{mainUi:o,popupUi:s,uiMotherships:a}=t;le(Rv(e),((t,o)=>{e.ui.registry.addGroupToolbarButton(o,t)}));const{buttons:i,menuItems:l,contextToolbars:c,sidebars:d,views:u}=e.ui.registry.getAll(),g=db(e),p={menuItems:l,menus:yb(e),menubar:Fv(e),toolbar:g.getOrThunk((()=>zv(e))),allowToolbarGroups:m===mv.floating,buttons:i,sidebar:d,views:u};var f;f=o.outerContainer,e.addShortcut("alt+F9","focus menubar",(()=>{_R.focusMenubar(f)})),e.addShortcut("alt+F10","focus toolbar",(()=>{_R.focusToolbar(f)})),e.addCommand("ToggleToolbarDrawer",((e,t)=>{(null==t?void 0:t.skipFocus)?_R.toggleToolbarDrawerWithoutFocusing(f):_R.toggleToolbarDrawer(f)})),e.addQueryStateHandler("ToggleToolbarDrawer",(()=>_R.isToolbarDrawerToggled(f))),((e,t,o)=>{const n=(e,n)=>{F([t,...o],(t=>{t.broadcastEvent(e,n)}))},r=(e,n)=>{F([t,...o],(t=>{t.broadcastOn([e],n)}))},s=e=>r(uu(),{target:e.target}),a=jo(),i=ad(a,"touchstart",s),l=ad(a,"touchmove",(e=>n(Ns(),e))),c=ad(a,"touchend",(e=>n(Rs(),e))),d=ad(a,"mousedown",s),m=ad(a,"mouseup",(e=>{0===e.raw.button&&r(hu(),{target:e.target})})),u=e=>r(uu(),{target:Be.fromDom(e.target)}),g=e=>{0===e.button&&r(hu(),{target:Be.fromDom(e.target)})},h=()=>{F(e.editorManager.get(),(t=>{e!==t&&t.dispatch("DismissPopups",{relatedTarget:e})}))},p=e=>n(Bs(),ld(e)),f=e=>{r(gu(),{}),n(Ls(),ld(e))},v=ht(Be.fromDom(e.getElement())),b=id(v,"scroll",(o=>{requestAnimationFrame((()=>{if(null!=e.getContainer()){const r=kb(e,t.element).map((e=>[e.element,...e.others])).getOr([]);L(r,(e=>Xe(e,o.target)))&&(e.dispatch("ElementScroll",{target:o.target.dom}),n(Zs(),o))}}))})),y=()=>r(gu(),{}),w=t=>{t.state&&r(uu(),{target:Be.fromDom(e.getContainer())})},x=e=>{r(uu(),{target:Be.fromDom(e.relatedTarget.getContainer())})},C=t=>e.dispatch("focusin",t),S=t=>e.dispatch("focusout",t);e.on("PostRender",(()=>{e.on("click",u),e.on("tap",u),e.on("mouseup",g),e.on("mousedown",h),e.on("ScrollWindow",p),e.on("ResizeWindow",f),e.on("ResizeEditor",y),e.on("AfterProgressState",w),e.on("DismissPopups",x),F([t,...o],(e=>{e.element.dom.addEventListener("focusin",C),e.element.dom.addEventListener("focusout",S)}))})),e.on("remove",(()=>{e.off("click",u),e.off("tap",u),e.off("mouseup",g),e.off("mousedown",h),e.off("ScrollWindow",p),e.off("ResizeWindow",f),e.off("ResizeEditor",y),e.off("AfterProgressState",w),e.off("DismissPopups",x),F([t,...o],(e=>{e.element.dom.removeEventListener("focusin",C),e.element.dom.removeEventListener("focusout",S)})),d.unbind(),i.unbind(),l.unbind(),c.unbind(),m.unbind(),b.unbind()})),e.on("detach",(()=>{F([t,...o],eu),F([t,...o],(e=>e.destroy()))}))})(e,o.mothership,a),r.setup(e,y.popup.shared,h),BL(e,y.popup),nH(e,y.popup.shared.getSink,y.popup),(e=>{const{sidebars:t}=e.ui.registry.getAll();F(se(t),(o=>{const n=t[o],r=()=>ye(A.from(e.queryCommandValue("ToggleSidebar")),o);e.ui.registry.addToggleButton(o,{icon:n.icon,tooltip:n.tooltip,onAction:t=>{e.execCommand("ToggleSidebar",!1,o),t.setActive(r())},onSetup:t=>{t.setActive(r());const o=()=>t.setActive(r());return e.on("ToggleSidebar",o),()=>{e.off("ToggleSidebar",o)}}})}))})(e),bN(e,b,y.popup.shared),yL(e,c,s.sink,{backstage:y.popup}),YH(e,s.sink);const v={targetNode:e.getElement(),height:C(o.outerContainer)};return n.render(e,t,p,y.popup,v)};return{popups:{backstage:y.popup,getMothership:()=>nI("popups",l)},dialogs:{backstage:y.dialog,getMothership:()=>nI("dialogs",i)},renderUI:()=>{const o=x(),n=(()=>{const t=pb(e),o=Xe(wt(),t)&&"grid"===Bt(t,"display"),n={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(c),attributes:{...Fy.isRtl()?{dir:"rtl"}:{}}},behaviours:Sa([Pm.config({useFixed:()=>r.isDocked(h)})])},s={dom:{styles:{width:document.body.clientWidth+"px"}},events:Qs([oa(Ls(),(e=>{Mt(e.element,"width",document.body.clientWidth+"px")}))])},a=zl(_n(n,o?s:{})),l=e_(a);return i.set(l),{sink:a,mothership:l}})(),a=bb(e)?(()=>{const e={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-silver-popup-sink","tox-tinymce-aux"].concat(c),attributes:{...Fy.isRtl()?{dir:"rtl"}:{}}},behaviours:Sa([Pm.config({useFixed:()=>r.isDocked(h),getBounds:()=>t.getPopupSinkBounds()})])},o=zl(e),n=e_(o);return l.set(n),{sink:o,mothership:n}})():(e=>(l.set(e.mothership),e))(n);s.dialogUi.set(n),s.popupUi.set(a),s.mainUi.set(o);const d={popupUi:a,dialogUi:n,mainUi:o,uiMotherships:s.getUiMotherships()};return S(d)}}},sI=w([hr("lazySink"),Sr("dragBlockClass"),Ir("getBounds",Jo),Mr("useTabstopAt",O),Mr("firstTabstop",0),Mr("eventOrder",{}),Nu("modalBehaviours",[lf]),zi("onExecute"),Zi("onEscape")]),aI={sketch:x},iI=w([cg({name:"draghandle",overrides:(e,t)=>({behaviours:Sa([$H.config({mode:"mouse",getTarget:e=>ql(e,'[role="dialog"]').getOr(e),blockerClass:e.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(t,null,2)).message),getBounds:e.getDragBounds})])})}),ig({schema:[hr("dom")],name:"title"}),ig({factory:aI,schema:[hr("dom")],name:"close"}),ig({factory:aI,schema:[hr("dom")],name:"body"}),cg({factory:aI,schema:[hr("dom")],name:"footer"}),lg({factory:{sketch:(e,t)=>({...e,dom:t.dom,components:t.components})},schema:[Mr("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Mr("components",[])],name:"blocker"})]),lI=Hg({name:"ModalDialog",configFields:sI(),partFields:iI(),factory:(e,t,o,n)=>{const r=on(),s=Xi("modal-events"),a={...e.eventOrder,[Hs()]:[s].concat(e.eventOrder["alloy.system.attached"]||[])},i=Ao();return{uid:e.uid,dom:e.dom,components:t,apis:{show:t=>{r.set(t);const o=e.lazySink(t).getOrDie(),s=n.blocker(),a=o.getSystem().build({...s,components:s.components.concat([Vl(t)]),behaviours:Sa([Sf.config({}),bf("dialog-blocker-events",[ca(ls(),(()=>{pN.isBlocked(t)||lf.focusIn(t)}))])])});$m(o,a),lf.focusIn(t)},hide:e=>{r.clear(),nt(e.element).each((t=>{e.getSystem().getByDom(t).each((e=>{Km(e)}))}))},getBody:t=>Cg(t,e,"body"),getFooter:t=>xg(t,e,"footer"),setIdle:e=>{pN.unblock(e)},setBusy:(e,t)=>{pN.block(e,t)}},eventOrder:a,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Bu(e.modalBehaviours,[vf.config({}),lf.config({mode:"cyclic",onEnter:e.onExecute,onEscape:e.onEscape,useTabstopAt:e.useTabstopAt,firstTabstop:e.firstTabstop}),pN.config({getRoot:r.get}),bf(s,[da((t=>{const o=Cg(t,e,"title").element,n=(e=>e.dom.textContent)(o);i.os.isMacOS()&&g(n)?St(t.element,"aria-label",n):((e,t)=>{const o=Et(e,"id").fold((()=>{const e=Xi("dialog-label");return St(t,"id",e),e}),x);St(e,"aria-labelledby",o)})(t.element,o)}))])])}},apis:{show:(e,t)=>{e.show(t)},hide:(e,t)=>{e.hide(t)},getBody:(e,t)=>e.getBody(t),getFooter:(e,t)=>e.getFooter(t),setBusy:(e,t,o)=>{e.setBusy(t,o)},setIdle:(e,t)=>{e.setIdle(t)}}}),cI=Zn([Vw,Zw].concat(Px)),dI=Xn,mI=[px("button"),ox,Lr("align","end",["start","end"]),dx,cx,Tr("buttonType",["primary","secondary"])],uI=[...mI,jw],gI=[br("type",["submit","cancel","custom"]),...uI],hI=[br("type",["menu"]),ex,nx,ox,Cr("items",cI),...mI],pI=[...mI,br("type",["togglebutton"]),nx,ox,ex,Hr("active",!1)],fI=cr("type",{submit:gI,cancel:gI,custom:gI,menu:hI,togglebutton:pI}),vI=[Vw,jw,br("level",["info","warn","error","success"]),$w,Mr("url","")],bI=Zn(vI),yI=[Vw,jw,cx,px("button"),ox,lx,Tr("buttonType",["primary","secondary","toolbar"]),dx],wI=Zn(yI),xI=[Vw,Zw],CI=xI.concat([rx]),SI=xI.concat([Uw,cx]),kI=Zn(SI),_I=Xn,EI=CI.concat([mx("auto")]),TI=Zn(EI),OI=$n([qw,jw,$w]),AI=CI.concat([Br("storageKey","default")]),DI=Zn(AI),MI=Yn,NI=Zn(CI),RI=Yn,BI=xI.concat([Br("tag","textarea"),vr("scriptId"),vr("scriptUrl"),Or("onFocus"),((e,t)=>Nr(e,t,er))("settings",void 0)]),LI=xI.concat([Br("tag","textarea"),yr("init")]),HI=nr((e=>sr("customeditor.old",Vn(LI),e).orThunk((()=>sr("customeditor.new",Vn(BI),e))))),II=Yn,PI=Zn(CI),FI=Un(Ln),zI=e=>[Vw,fr("columns"),e],VI=[Vw,vr("html"),Lr("presets","presentation",["presentation","document"]),Ir("onInit",v),Hr("stretched",!1)],ZI=Zn(VI),UI=CI.concat([Hr("border",!1),Hr("sandboxed",!0),Hr("streamContent",!1),Hr("transparent",!0)]),jI=Zn(UI),WI=Yn,$I=Zn(xI.concat([Er("height")])),qI=Zn([vr("url"),_r("zoom"),_r("cachedWidth"),_r("cachedHeight")]),GI=CI.concat([Er("inputMode"),Er("placeholder"),Hr("maximized",!1),cx]),KI=Zn(GI),YI=Yn,XI=e=>[Vw,Uw,e,Lr("align","start",["start","center","end"]),Er("for")],JI=[jw,qw],QI=[jw,Cr("items",dr(0,(()=>eP)))],eP=jn([Zn(JI),Zn(QI)]),tP=CI.concat([Cr("items",eP),cx]),oP=Zn(tP),nP=Yn,rP=CI.concat([xr("items",[jw,qw]),Rr("size",1),cx]),sP=Zn(rP),aP=Yn,iP=CI.concat([Hr("constrain",!0),cx]),lP=Zn(iP),cP=Zn([vr("width"),vr("height")]),dP=xI.concat([Uw,Rr("min",0),Rr("max",0)]),mP=Zn(dP),uP=Kn,gP=[Vw,Cr("header",Yn),Cr("cells",Un(Yn))],hP=Zn(gP),pP=CI.concat([Er("placeholder"),Hr("maximized",!1),cx]),fP=Zn(pP),vP=Yn,bP=[br("type",["directory","leaf"]),Ww,vr("id"),kr("menu",KM)],yP=Zn(bP),wP=bP.concat([Cr("children",dr(0,(()=>or("type",{directory:xP,leaf:yP}))))]),xP=Zn(wP),CP=or("type",{directory:xP,leaf:yP}),SP=[Vw,Cr("items",CP),Or("onLeafAction"),Or("onToggleExpand"),Pr("defaultExpandedIds",[],Yn),Er("defaultSelectedId")],kP=Zn(SP),_P=CI.concat([Lr("filetype","file",["image","media","file"]),cx,Er("picker_text")]),EP=Zn(_P),TP=Zn([qw,ux]),OP=e=>mr("items","items",{tag:"required",process:{}},Un(nr((t=>sr(`Checking item of ${e}`,AP,t).fold((e=>an.error(lr(e))),(e=>an.value(e))))))),AP=Fn((()=>{return or("type",{alertbanner:bI,bar:Zn((e=OP("bar"),[Vw,e])),button:wI,checkbox:kI,colorinput:DI,colorpicker:NI,dropzone:PI,grid:Zn(zI(OP("grid"))),iframe:jI,input:KI,listbox:oP,selectbox:sP,sizeinput:lP,slider:mP,textarea:fP,urlinput:EP,customeditor:HI,htmlpanel:ZI,imagepreview:$I,collection:TI,label:Zn(XI(OP("label"))),table:hP,tree:kP,panel:MP});var e})),DP=[Vw,Mr("classes",[]),Cr("items",AP)],MP=Zn(DP),NP=[px("tab"),Ww,Cr("items",AP)],RP=[Vw,xr("tabs",NP)],BP=Zn(RP),LP=uI,HP=fI,IP=Zn([vr("title"),pr("body",or("type",{panel:MP,tabpanel:BP})),Br("size","normal"),Pr("buttons",[],HP),Mr("initialData",{}),Ir("onAction",v),Ir("onChange",v),Ir("onSubmit",v),Ir("onClose",v),Ir("onCancel",v),Ir("onTabChange",v)]),PP=Zn([br("type",["cancel","custom"]),...LP]),FP=Zn([vr("title"),vr("url"),_r("height"),_r("width"),Ar("buttons",PP),Ir("onAction",v),Ir("onCancel",v),Ir("onClose",v),Ir("onMessage",v)]),zP=e=>a(e)?[e].concat(q(pe(e),zP)):l(e)?q(e,zP):[],VP=e=>s(e.type)&&s(e.name),ZP={checkbox:_I,colorinput:MI,colorpicker:RI,dropzone:FI,input:YI,iframe:WI,imagepreview:qI,selectbox:aP,sizeinput:cP,slider:uP,listbox:nP,size:cP,textarea:vP,urlinput:TP,customeditor:II,collection:OI,togglemenuitem:dI},UP=e=>{const t=(e=>V(zP(e),VP))(e),o=q(t,(e=>(e=>A.from(ZP[e.type]))(e).fold((()=>[]),(t=>[pr(e.name,t)]))));return Zn(o)},jP=e=>{var t;return{internalDialog:ar(sr("dialog",IP,e)),dataValidator:UP(e),initialData:null!==(t=e.initialData)&&void 0!==t?t:{}}},WP={open:(e,t)=>{const o=jP(t);return e(o.internalDialog,o.initialData,o.dataValidator)},openUrl:(e,t)=>e(ar(sr("dialog",FP,t))),redial:e=>jP(e)};var $P=Object.freeze({__proto__:null,events:(e,t)=>{const o=(o,n)=>{e.updateState.each((e=>{const r=e(o,n);t.set(r)})),e.renderComponents.each((r=>{const s=r(n,t.get());(e.reuseDom?df:cf)(o,s)}))};return Qs([oa(ks(),((t,n)=>{const r=n;if(!r.universal){const n=e.channel;B(r.channels,n)&&o(t,r.data)}})),da(((t,n)=>{e.initialData.each((e=>{o(t,e)}))}))])}});var qP=Object.freeze({__proto__:null,getState:(e,t,o)=>o}),GP=[hr("channel"),Sr("renderComponents"),Sr("updateState"),Sr("initialData"),Hr("reuseDom",!0)];const KP=_a({fields:GP,name:"reflecting",active:$P,apis:qP,state:Object.freeze({__proto__:null,init:()=>{const e=Qo(A.none());return{readState:()=>e.get().getOr("none"),get:e.get,set:e.set,clear:()=>e.set(A.none())}}})}),YP=e=>{const t=[],o={};return ie(e,((e,n)=>{e.fold((()=>{t.push(n)}),(e=>{o[n]=e}))})),t.length>0?an.error(t):an.value(o)},XP=(e,t,o,n)=>{const r=Ob(kT.sketch((r=>({dom:{tag:"div",classes:["tox-form"].concat(e.classes)},components:P(e.items,(e=>lD(r,e,t,o,n)))}))));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[r.asSpec()]}],behaviours:Sa([lf.config({mode:"acyclic",useTabstopAt:k(QT)}),RT(r),HT(r,{postprocess:e=>YP(e).fold((e=>(console.error(e),{})),x)}),bf("dialog-body-panel",[oa(ls(),((e,t)=>{e.getSystem().broadcastOn([sO],{newFocus:A.some(t.event.target)})}))])])}},JP=Lg({name:"TabButton",configFields:[Mr("uid",void 0),hr("value"),mr("dom","dom",An((()=>({attributes:{role:"tab",id:Xi("aria"),"aria-selected":"false"}}))),qn()),Sr("action"),Mr("domModification",{}),Nu("tabButtonBehaviours",[Sf,lf,Mu]),hr("view")],factory:(e,t)=>({uid:e.uid,dom:e.dom,components:e.components,events:Bf(e.action),behaviours:Bu(e.tabButtonBehaviours,[Sf.config({}),lf.config({mode:"execution",useSpace:!0,useEnter:!0}),Mu.config({store:{mode:"memory",initialValue:e.value}})]),domModification:e.domModification})}),QP=w([hr("tabs"),hr("dom"),Mr("clickToDismiss",!1),Nu("tabbarBehaviours",[mh,lf]),Ii(["tabClass","selectedClass"])]),eF=dg({factory:JP,name:"tabs",unit:"tab",overrides:e=>{const t=(e,t)=>{mh.dehighlight(e,t),Gs(e,js(),{tabbar:e,button:t})},o=(e,t)=>{mh.highlight(e,t),Gs(e,Us(),{tabbar:e,button:t})};return{action:n=>{const r=n.getSystem().getByUid(e.uid).getOrDie(),s=mh.isHighlighted(r,n);(s&&e.clickToDismiss?t:s?v:o)(r,n)},domModification:{classes:[e.markers.tabClass]}}}}),tF=w([eF]),oF=Hg({name:"Tabbar",configFields:QP(),partFields:tF(),factory:(e,t,o,n)=>({uid:e.uid,dom:e.dom,components:t,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Bu(e.tabbarBehaviours,[mh.config({highlightClass:e.markers.selectedClass,itemClass:e.markers.tabClass,onHighlight:(e,t)=>{St(t.element,"aria-selected","true")},onDehighlight:(e,t)=>{St(t.element,"aria-selected","false")}}),lf.config({mode:"flow",getInitial:e=>mh.getHighlighted(e).map((e=>e.element)),selector:"."+e.markers.tabClass,executeOnMove:!0})])})}),nF=Lg({name:"Tabview",configFields:[Nu("tabviewBehaviours",[vf])],factory:(e,t)=>({uid:e.uid,dom:e.dom,behaviours:Bu(e.tabviewBehaviours,[vf.config({})]),domModification:{attributes:{role:"tabpanel"}}})}),rF=w([Mr("selectFirst",!0),Fi("onChangeTab"),Fi("onDismissTab"),Mr("tabs",[]),Nu("tabSectionBehaviours",[])]),sF=ig({factory:oF,schema:[hr("dom"),wr("markers",[hr("tabClass"),hr("selectedClass")])],name:"tabbar",defaults:e=>({tabs:e.tabs})}),aF=ig({factory:nF,name:"tabview"}),iF=w([sF,aF]),lF=Hg({name:"TabSection",configFields:rF(),partFields:iF(),factory:(e,t,o,n)=>{const r=(t,o)=>{xg(t,e,"tabbar").each((e=>{o(e).each(Ks)}))};return{uid:e.uid,dom:e.dom,components:t,behaviours:Ru(e.tabSectionBehaviours),events:Qs($([e.selectFirst?[da(((e,t)=>{r(e,mh.getFirst)}))]:[],[oa(Us(),((t,o)=>{(t=>{const o=Mu.getValue(t);xg(t,e,"tabview").each((n=>{const r=j(e.tabs,(e=>e.value===o));r.each((o=>{const r=o.view();Et(t.element,"id").each((e=>{St(n.element,"aria-labelledby",e)})),vf.set(n,r),e.onChangeTab(n,t,r)}))}))})(o.event.button)})),oa(js(),((t,o)=>{const n=o.event.button;e.onDismissTab(t,n)}))]])),apis:{getViewItems:t=>xg(t,e,"tabview").map((e=>vf.contents(e))).getOr([]),showTab:(e,t)=>{r(e,(e=>{const o=mh.getCandidates(e);return j(o,(e=>Mu.getValue(e)===t)).filter((t=>!mh.isHighlighted(e,t)))}))}}}},apis:{getViewItems:(e,t)=>e.getViewItems(t),showTab:(e,t,o)=>{e.showTab(t,o)}}}),cF=(e,t)=>{Mt(e,"height",t+"px"),Mt(e,"flex-basis",t+"px")},dF=(e,t,o)=>{ql(e,'[role="dialog"]').each((e=>{Yl(e,'[role="tablist"]').each((n=>{o.get().map((o=>(Mt(t,"height","0"),Mt(t,"flex-basis","0"),Math.min(o,((e,t,o)=>{const n=tt(e).dom,r=ql(e,".tox-dialog-wrap").getOr(e);let s;s="fixed"===Bt(r,"position")?Math.max(n.clientHeight,window.innerHeight):Math.max(n.offsetHeight,n.scrollHeight);const a=Ut(t),i=t.dom.offsetLeft>=o.dom.offsetLeft+Xt(o)?Math.max(Ut(o),a):a,l=parseInt(Bt(e,"margin-top"),10)||0,c=parseInt(Bt(e,"margin-bottom"),10)||0;return s-(Ut(e)+l+c-i)})(e,t,n))))).each((e=>{cF(t,e)}))}))}))},mF=e=>Yl(e,'[role="tabpanel"]'),uF=e=>{const t=on(),o=[da((o=>{const n=o.element;mF(n).each((r=>{Mt(r,"visibility","hidden"),o.getSystem().getByDom(r).toOptional().each((o=>{const n=((e,t,o)=>P(e,((n,r)=>{vf.set(o,e[r].view());const s=t.dom.getBoundingClientRect();return vf.set(o,[]),s.height})))(e,r,o),s=(e=>te(Q(e,((e,t)=>e>t?-1:e{te(e).each((e=>lF.showTab(t,e.value)))})(e,o),requestAnimationFrame((()=>{dF(n,r,t)}))}))})),oa(Ls(),(e=>{const o=e.element;mF(o).each((e=>{dF(o,e,t)}))})),oa(v_,((e,o)=>{const n=e.element;mF(n).each((e=>{const o=Uc(ht(e));Mt(e,"visibility","hidden");const r=Ht(e,"height").map((e=>parseInt(e,10)));Ft(e,"height"),Ft(e,"flex-basis");const s=e.dom.getBoundingClientRect().height;r.forall((e=>s>e))?(t.set(s),dF(n,e,t)):r.each((t=>{cF(e,t)})),Ft(e,"visibility"),o.each(zc)}))}))];return{extraEvents:o,selectFirst:!1}},gF="send-data-to-section",hF="send-data-to-view",pF=(e,t,o,n)=>{const r=Qo({}),s=e=>{const t=Mu.getValue(e),o=YP(t).getOr({}),n=r.get(),s=_n(n,o);r.set(s)},a=e=>{const t=r.get();Mu.setValue(e,t)},i=Qo(null),l=P(e.tabs,(e=>({value:e.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"]},components:[Hl(o.shared.providers.translate(e.title))],view:()=>[kT.sketch((r=>({dom:{tag:"div",classes:["tox-form"]},components:P(e.items,(e=>lD(r,e,t,o,n))),formBehaviours:Sa([lf.config({mode:"acyclic",useTabstopAt:k(QT)}),bf("TabView.form.events",[da(a),ma(s)]),Pc.config({channels:Ur([{key:gF,value:{onReceive:s}},{key:hF,value:{onReceive:a}}])})])})))]}))),c=uF(l);return lF.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:(e,t,o)=>{const n=Mu.getValue(t);Gs(e,f_,{name:n,oldName:i.get()}),i.set(n)},tabs:l,components:[lF.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[oF.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:Sa([Mb.config({})])}),lF.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:c.selectFirst,tabSectionBehaviours:Sa([bf("tabpanel",c.extraEvents),lf.config({mode:"acyclic"}),zg.config({find:e=>te(lF.getViewItems(e))}),IT(A.none(),(e=>(e.getSystem().broadcastOn([gF],{}),r.get())),((e,t)=>{r.set(t),e.getSystem().broadcastOn([hF],{})}))])})},fF=(e,t,o,n,r,s)=>({dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:{...o.map((e=>({id:e}))).getOr({}),...r?{"aria-live":"polite"}:{}}},components:[],behaviours:Sa([BT(0),KP.config({channel:`${oO}-${t}`,updateState:(e,t)=>A.some({isTabPanel:()=>"tabpanel"===t.body.type}),renderComponents:e=>{const t=e.body;return"tabpanel"===t.type?[pF(t,e.initialData,n,s)]:[XP(t,e.initialData,n,s)]},initialData:e})])}),vF=fv.deviceType.isTouch(),bF=(e,t)=>({dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[e,t]}),yF=(e,t)=>lI.parts.close(Eb.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close")}},action:e,buttonBehaviours:Sa([Mb.config({})])})),wF=()=>lI.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}}),xF=(e,t)=>lI.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:Tb(`

    ${Py(t.translate(e))}

    `)}]}]}),CF=e=>lI.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:e}),SF=(e,t)=>[Qk.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:e}),Qk.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:t})],kF=e=>{const t="tox-dialog",o=t+"-wrap",n=o+"__backdrop",r=t+"__disable-scroll";return lI.sketch({lazySink:e.lazySink,onEscape:t=>(e.onEscape(t),A.some(!0)),useTabstopAt:e=>!QT(e),firstTabstop:e.firstTabstop,dom:{tag:"div",classes:[t].concat(e.extraClasses),styles:{position:"relative",...e.extraStyles}},components:[e.header,e.body,...e.footer.toArray()],parts:{blocker:{dom:Tb(`
    `),components:[{dom:{tag:"div",classes:vF?[n,n+"--opaque"]:[n]}}]}},dragBlockClass:o,modalBehaviours:Sa([Sf.config({}),bf("dialog-events",e.dialogEvents.concat([ca(ls(),((e,t)=>{pN.isBlocked(e)||lf.focusIn(e)})),oa(zs(),((e,t)=>{e.getSystem().broadcastOn([sO],{newFocus:t.event.newFocus})}))])),bf("scroll-lock",[da((()=>{Ba(wt(),r)})),ma((()=>{Ha(wt(),r)}))]),...e.extraBehaviours]),eventOrder:{[_s()]:["dialog-events"],[Hs()]:["scroll-lock","dialog-events","alloy.base.behaviour"],[Is()]:["alloy.base.behaviour","dialog-events","scroll-lock"],...e.eventOrder}})},_F=e=>Eb.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close"),"data-mce-name":"close"}},buttonBehaviours:Sa([Mb.config({}),Zb.config(e.tooltips.getConfig({tooltipText:e.translate("Close")}))]),components:[Gy("close",{tag:"span",classes:["tox-icon"]},e.icons)],action:e=>{qs(e,m_)}}),EF=(e,t,o,n)=>({dom:{tag:"h1",classes:["tox-dialog__title"],attributes:{...o.map((e=>({id:e}))).getOr({})}},components:[],behaviours:Sa([KP.config({channel:`${tO}-${t}`,initialData:e,renderComponents:e=>[Hl(n.translate(e.title))]})])}),TF=()=>({dom:Tb('
    ')}),OF=(e,t,o)=>((e,t,o)=>{const n=lI.parts.title(EF(e,t,A.none(),o)),r=lI.parts.draghandle(TF()),s=lI.parts.close(_F(o)),a=[n].concat(e.draggable?[r]:[]).concat([s]);return Qk.sketch({dom:Tb('
    '),components:a})})({title:o.shared.providers.translate(e),draggable:o.dialog.isDraggableModal()},t,o.shared.providers),AF=(e,t,o,n)=>({dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":o.translate(e)},styles:{left:"0px",right:"0px",bottom:"0px",top:`${n.getOr(0)}px`,position:"absolute"}},behaviours:t,components:[{dom:Tb('
    ')}]}),DF=(e,t,o)=>({onClose:()=>o.closeWindow(),onBlock:o=>{const n=Yl(e().element,".tox-dialog__header").map((e=>Ut(e)));lI.setBusy(e(),((e,r)=>AF(o.message,r,t,n)))},onUnblock:()=>{lI.setIdle(e())}}),MF="tox-dialog--fullscreen",NF="tox-dialog--width-lg",RF="tox-dialog--width-md",BF=e=>{switch(e){case"large":return A.some(NF);case"medium":return A.some(RF);default:return A.none()}},LF=(e,t)=>{const o=Be.fromDom(t.element.dom);Pa(o,MF)||(za(o,[NF,RF]),BF(e).each((e=>Ba(o,e))))},HF=(e,t)=>{const o=Be.fromDom(e.element.dom),n=Va(o),r=j(n,(e=>e===NF||e===RF)).or(BF(t));((e,t)=>{F(t,(t=>{Ia(e,t)}))})(o,[MF,...r.toArray()])},IF=(e,t,o)=>zl(kF({...e,firstTabstop:1,lazySink:o.shared.getSink,extraBehaviours:[FT({}),...e.extraBehaviours],onEscape:e=>{qs(e,m_)},dialogEvents:t,eventOrder:{[ks()]:[KP.name(),Pc.name()],[Hs()]:["scroll-lock",KP.name(),"messages","dialog-events","alloy.base.behaviour"],[Is()]:["alloy.base.behaviour","dialog-events","messages",KP.name(),"scroll-lock"]}})),PF=(e,t={})=>P(e,(e=>"menu"===e.type?(e=>{const o=P(e.items,(e=>{const o=fe(t,e.name).getOr(Qo(!1));return{...e,storage:o}}));return{...e,items:o}})(e):e)),FF=e=>U(e,((e,t)=>{if("menu"===t.type){return U(t.items,((e,t)=>(e[t.name]=t.storage,e)),e)}return e}),{}),zF=(e,t)=>[aa(ls(),JT),e(d_,((e,o,n,r)=>{Uc(ht(r.element)).fold(v,Vc),t.onClose(),o.onClose()})),e(m_,((e,t,o,n)=>{t.onCancel(e),qs(n,d_)})),oa(p_,((e,o)=>t.onUnblock())),oa(h_,((e,o)=>t.onBlock(o.event)))],VF=(e,t,o)=>{const n=(t,o)=>oa(t,((t,n)=>{r(t,((r,s)=>{o(e(),r,n.event,t)}))})),r=(e,t)=>{KP.getState(e).get().each((o=>{t(o.internalDialog,e)}))};return[...zF(n,t),n(g_,((e,t)=>t.onSubmit(e))),n(c_,((e,t,o)=>{t.onChange(e,{name:o.name})})),n(u_,((e,t,n,r)=>{const s=()=>r.getSystem().isConnected()?lf.focusIn(r):void 0,a=e=>Tt(e,"disabled")||Et(e,"aria-disabled").exists((e=>"true"===e)),i=ht(r.element),l=Uc(i);t.onAction(e,{name:n.name,value:n.value}),Uc(i).fold(s,(e=>{a(e)||l.exists((t=>Je(e,t)&&a(t)))?s():o().toOptional().filter((t=>!Je(t.element,e))).each(s)}))})),n(f_,((e,t,o)=>{t.onTabChange(e,{newTabName:o.name,oldTabName:o.oldName})})),ma((t=>{const o=e();Mu.setValue(t,o.getData())}))]},ZF=(e,t)=>{const o=t.map((e=>e.footerButtons)).getOr([]),n=z(o,(e=>"start"===e.align)),r=(e,t)=>Qk.sketch({dom:{tag:"div",classes:[`tox-dialog__footer-${e}`]},components:P(t,(e=>e.memento.asSpec()))});return[r("start",n.pass),r("end",n.fail)]},UF=(e,t,o)=>({dom:Tb(''),components:[],behaviours:Sa([KP.config({channel:`${nO}-${t}`,initialData:e,updateState:(e,t)=>{const n=P(t.buttons,(e=>{const t=Ob(((e,t)=>jA(e,e.type,t))(e,o));return{name:e.name,align:e.align,memento:t}}));return A.some({lookupByName:t=>((e,t,o)=>j(t,(e=>e.name===o)).bind((t=>t.memento.getOpt(e))))(e,n,t),footerButtons:n})},renderComponents:ZF})])}),jF=(e,t,o)=>lI.parts.footer(UF(e,t,o)),WF=(e,t)=>{if(e.getRoot().getSystem().isConnected()){const o=zg.getCurrent(e.getFormWrapper()).getOr(e.getFormWrapper());return kT.getField(o,t).orThunk((()=>{const o=e.getFooter().bind((e=>KP.getState(e).get()));return o.bind((e=>e.lookupByName(t)))}))}return A.none()},$F=(e,t,o)=>{const n=t=>{const o=e.getRoot();o.getSystem().isConnected()&&t(o)},r={getData:()=>{const t=e.getRoot(),n=t.getSystem().isConnected()?e.getFormWrapper():t;return{...Mu.getValue(n),...le(o,(e=>e.get()))}},setData:t=>{n((n=>{const s=r.getData(),a=_n(s,t),i=((e,t)=>{const o=e.getRoot();return KP.getState(o).get().map((e=>ar(sr("data",e.dataValidator,t)))).getOr(t)})(e,a),l=e.getFormWrapper();Mu.setValue(l,i),ie(o,((e,t)=>{ve(a,t)&&e.set(a[t])}))}))},setEnabled:(t,o)=>{WF(e,t).each(o?eh.enable:eh.disable)},focus:t=>{WF(e,t).each(Sf.focus)},block:e=>{if(!s(e))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");n((t=>{Gs(t,h_,{message:e})}))},unblock:()=>{n((e=>{qs(e,p_)}))},showTab:t=>{n((o=>{const n=e.getBody();KP.getState(n).get().exists((e=>e.isTabPanel()))&&zg.getCurrent(n).each((e=>{lF.showTab(e,t)}))}))},redial:s=>{n((n=>{const a=e.getId(),i=t(s),l=PF(i.internalDialog.buttons,o);n.getSystem().broadcastOn([`${eO}-${a}`],i),n.getSystem().broadcastOn([`${tO}-${a}`],i.internalDialog),n.getSystem().broadcastOn([`${oO}-${a}`],i.internalDialog),n.getSystem().broadcastOn([`${nO}-${a}`],{...i.internalDialog,buttons:l}),r.setData(i.initialData)}))},close:()=>{n((e=>{qs(e,d_)}))},toggleFullscreen:e.toggleFullscreen};return r},qF=(e,t,o)=>{const n=Xi("dialog"),r=e.internalDialog,s=OF(r.title,n,o),a=Qo(r.size),i=BF(a.get()).toArray(),l=((e,t,o,n)=>{const r=fF(e,t,A.none(),o,!1,n);return lI.parts.body(r)})({body:r.body,initialData:r.initialData},n,o,(e=>WF(p,e))),c=PF(r.buttons),d=FF(c),m=Se(0!==c.length,jF({buttons:c},n,o)),u=VF((()=>f),DF((()=>h),o.shared.providers,t),o.shared.getSink),g={id:n,header:s,body:l,footer:m,extraClasses:i,extraBehaviours:[KP.config({channel:`${eO}-${n}`,updateState:(e,t)=>(a.set(t.internalDialog.size),LF(t.internalDialog.size,e),A.some(t)),initialData:e})],extraStyles:{}},h=IF(g,u,o),p={getId:w(n),getRoot:w(h),getBody:()=>lI.getBody(h),getFooter:()=>lI.getFooter(h),getFormWrapper:()=>{const e=lI.getBody(h);return zg.getCurrent(e).getOr(e)},toggleFullscreen:()=>{HF(h,a.get())}},f=$F(p,t.redial,d);return{dialog:h,instanceApi:f}},GF=(e,t,o,n=!1,r)=>{const s=Xi("dialog"),a=Xi("dialog-label"),i=Xi("dialog-content"),l=e.internalDialog,c=Qo(l.size),d=BF(c.get()).toArray(),m=Ob(((e,t,o,n)=>Qk.sketch({dom:Tb('
    '),components:[EF(e,t,A.some(o),n),TF(),_F(n)],containerBehaviours:Sa([$H.config({mode:"mouse",blockerClass:"blocker",getTarget:e=>Xl(e,'[role="dialog"]').getOrDie(),snaps:{getSnapPoints:()=>[],leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))({title:l.title,draggable:!0},s,a,o.shared.providers)),u=Ob(((e,t,o,n,r,s)=>fF(e,t,A.some(o),n,r,s))({body:l.body,initialData:l.initialData},s,i,o,n,(e=>WF(y,e)))),g=PF(l.buttons),h=FF(g),p=Se(0!==g.length,Ob(((e,t,o)=>UF(e,t,o))({buttons:g},s,o))),f=VF((()=>x),{onBlock:e=>{pN.block(b,((t,n)=>{const r=m.getOpt(b).map((e=>Ut(e.element)));return AF(e.message,n,o.shared.providers,r)}))},onUnblock:()=>{pN.unblock(b)},onClose:()=>t.closeWindow()},o.shared.getSink),v=Ao().os,b=zl({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline",...d],attributes:{role:"dialog",...v.isMacOS()?{"aria-label":l.title}:{"aria-labelledby":a}}},eventOrder:{[ks()]:[KP.name(),Pc.name()],[_s()]:["execute-on-form"],[Hs()]:["reflecting","execute-on-form"]},behaviours:Sa([lf.config({mode:"cyclic",onEscape:e=>(qs(e,d_),A.some(!0)),useTabstopAt:e=>!QT(e)&&("button"!==ze(e)||"disabled"!==_t(e,"disabled")),firstTabstop:1}),KP.config({channel:`${eO}-${s}`,updateState:(e,t)=>(c.set(t.internalDialog.size),LF(t.internalDialog.size,e),r(),A.some(t)),initialData:e}),Sf.config({}),bf("execute-on-form",f.concat([ca(ls(),((e,t)=>{lf.focusIn(e)})),oa(zs(),((e,t)=>{e.getSystem().broadcastOn([sO],{newFocus:t.event.newFocus})}))])),pN.config({getRoot:()=>A.some(b)}),vf.config({}),FT({})]),components:[m.asSpec(),u.asSpec(),...p.map((e=>e.asSpec())).toArray()]}),y={getId:w(s),getRoot:w(b),getFooter:()=>p.map((e=>e.get(b))),getBody:()=>u.get(b),getFormWrapper:()=>{const e=u.get(b);return zg.getCurrent(e).getOr(e)},toggleFullscreen:()=>{HF(b,c.get())}},x=$F(y,t.redial,h);return{dialog:b,instanceApi:x}};var KF=tinymce.util.Tools.resolve("tinymce.util.URI");const YF=["insertContent","setContent","execCommand","close","block","unblock"],XF=e=>a(e)&&-1!==YF.indexOf(e.mceAction),JF=(e,t,o,n)=>{const r=Xi("dialog"),i=OF(e.title,r,n),l=(e=>{const t={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[YT(A.none(),{dom:{tag:"iframe",attributes:{src:e.url}},behaviours:Sa([Mb.config({}),Sf.config({})])})]}],behaviours:Sa([lf.config({mode:"acyclic",useTabstopAt:k(QT)})])};return lI.parts.body(t)})(e),c=e.buttons.bind((e=>0===e.length?A.none():A.some(jF({buttons:e},r,n)))),m=((e,t)=>{const o=(t,o)=>oa(t,((t,r)=>{n(t,((n,s)=>{o(e(),n,r.event,t)}))})),n=(e,t)=>{KP.getState(e).get().each((o=>{t(o,e)}))};return[...zF(o,t),o(u_,((e,t,o)=>{t.onAction(e,{name:o.name})}))]})((()=>w),DF((()=>y),n.shared.providers,t)),u={...e.height.fold((()=>({})),(e=>({height:e+"px","max-height":e+"px"}))),...e.width.fold((()=>({})),(e=>({width:e+"px","max-width":e+"px"})))},h=e.width.isNone()&&e.height.isNone()?["tox-dialog--width-lg"]:[],p=new KF(e.url,{base_uri:new KF(window.location.href)}),f=`${p.protocol}://${p.host}${p.port?":"+p.port:""}`,v=tn(),b=[KP.config({channel:`${eO}-${r}`,updateState:(e,t)=>A.some(t),initialData:e}),bf("messages",[da((()=>{const t=ad(Be.fromDom(window),"message",(t=>{if(p.isSameOrigin(new KF(t.raw.origin))){const n=t.raw.data;XF(n)?((e,t,o)=>{switch(o.mceAction){case"insertContent":e.insertContent(o.content);break;case"setContent":e.setContent(o.content);break;case"execCommand":const n=!!d(o.ui)&&o.ui;e.execCommand(o.cmd,n,o.value);break;case"close":t.close();break;case"block":t.block(o.message);break;case"unblock":t.unblock()}})(o,w,n):(e=>!XF(e)&&a(e)&&ve(e,"mceAction"))(n)&&e.onMessage(w,n)}}));v.set(t)})),ma(v.clear)]),Pc.config({channels:{[rO]:{onReceive:(e,t)=>{Yl(e.element,"iframe").each((e=>{const o=e.dom.contentWindow;g(o)&&o.postMessage(t,f)}))}}}})],y=IF({id:r,header:i,body:l,footer:c,extraClasses:h,extraBehaviours:b,extraStyles:u},m,n),w=(e=>{const t=t=>{e.getSystem().isConnected()&&t(e)};return{block:e=>{if(!s(e))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t((t=>{Gs(t,h_,{message:e})}))},unblock:()=>{t((e=>{qs(e,p_)}))},close:()=>{t((e=>{qs(e,d_)}))},sendMessage:e=>{t((t=>{t.getSystem().broadcastOn([rO],e)}))}}})(y);return{dialog:y,instanceApi:w}},QF=(e,t)=>ar(sr("data",t,e)),ez=e=>zk(e,".tox-alert-dialog")||zk(e,".tox-confirm-dialog"),tz=(e,t,o)=>t&&o?[]:[qi.config({contextual:{lazyContext:()=>A.some(Ko(Be.fromDom(e.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"],lazyViewport:t=>kb(e,t.element).map((e=>({bounds:_b(e),optScrollEnv:A.some({currentScrollTop:e.element.dom.scrollTop,scrollElmTop:Gt(e.element).top})}))).getOrThunk((()=>({bounds:Jo(),optScrollEnv:A.none()})))})],oz=e=>{const t=e.editor,o=vb(t),n=(e=>{const t=e.shared;return{open:(o,n)=>{const r=()=>{lI.hide(l),n()},s=Ob(jA({name:"close-alert",text:"OK",primary:!0,buttonType:A.some("primary"),align:"end",enabled:!0,icon:A.none()},"cancel",e)),a=wF(),i=yF(r,t.providers),l=zl(kF({lazySink:()=>t.getSink(),header:bF(a,i),body:xF(o,t.providers),footer:A.some(CF(SF([],[s.asSpec()]))),onEscape:r,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[oa(m_,r)],eventOrder:{}}));lI.show(l);const c=s.get(l);Sf.focus(c)}}})(e.backstages.dialog),r=(e=>{const t=e.shared;return{open:(o,n)=>{const r=e=>{lI.hide(c),n(e)},s=Ob(jA({name:"yes",text:"Yes",primary:!0,buttonType:A.some("primary"),align:"end",enabled:!0,icon:A.none()},"submit",e)),a=jA({name:"no",text:"No",primary:!1,buttonType:A.some("secondary"),align:"end",enabled:!0,icon:A.none()},"cancel",e),i=wF(),l=yF((()=>r(!1)),t.providers),c=zl(kF({lazySink:()=>t.getSink(),header:bF(i,l),body:xF(o,t.providers),footer:A.some(CF(SF([],[a,s.asSpec()]))),onEscape:()=>r(!1),extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[oa(m_,(()=>r(!1))),oa(g_,(()=>r(!0)))],eventOrder:{}}));lI.show(c);const d=s.get(c);Sf.focus(d)}}})(e.backstages.dialog),s=(o,n)=>WP.openUrl((o=>{const r=JF(o,{closeWindow:()=>{lI.hide(r.dialog),n(r.instanceApi)}},t,e.backstages.dialog);return lI.show(r.dialog),r.instanceApi}),o),a=(t,o)=>WP.open(((t,n,r)=>{const s=n,a=qF({dataValidator:r,initialData:s,internalDialog:t},{redial:WP.redial,closeWindow:()=>{lI.hide(a.dialog),o(a.instanceApi)}},e.backstages.dialog);return lI.show(a.dialog),a.instanceApi.setData(s),a.instanceApi}),t),i=(n,r,s,a)=>WP.open(((n,i,l)=>{const c=QF(i,l),d=on(),m=e.backstages.popup.shared.header.isPositionedAtTop(),u=()=>d.on((e=>{dv.reposition(e),o&&m||qi.refresh(e)})),g=GF({dataValidator:l,initialData:c,internalDialog:n},{redial:WP.redial,closeWindow:()=>{d.on(dv.hide),t.off("ResizeEditor",u),d.clear(),s(g.instanceApi)}},e.backstages.popup,a.ariaAttrs,u),h=zl(dv.sketch({lazySink:e.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:a.persistent?{event:"doNotDismissYet"}:{},...m?{}:{fireRepositionEventInstead:{}},inlineBehaviours:Sa([bf("window-manager-inline-events",[oa(Ps(),((e,t)=>{qs(g.dialog,m_)}))]),...tz(t,o,m)]),isExtraPart:(e,t)=>ez(t)}));d.set(h);return dv.showWithinBounds(h,Vl(g.dialog),{anchor:r},(()=>{const e=t.inline?wt():Be.fromDom(t.getContainer()),o=Ko(e);return A.some(o)})),o&&m||(qi.refresh(h),t.on("ResizeEditor",u)),g.instanceApi.setData(c),lf.focusIn(g.dialog),g.instanceApi}),n),l=(o,n,r,s)=>WP.open(((o,a,i)=>{const l=QF(a,i),c=on(),d=e.backstages.popup.shared.header.isPositionedAtTop(),m=()=>c.on((e=>{dv.reposition(e),qi.refresh(e)})),u=GF({dataValidator:i,initialData:l,internalDialog:o},{redial:WP.redial,closeWindow:()=>{c.on(dv.hide),t.off("ResizeEditor ScrollWindow ElementScroll",m),c.clear(),r(u.instanceApi)}},e.backstages.popup,s.ariaAttrs,m),g=zl(dv.sketch({lazySink:e.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:s.persistent?{event:"doNotDismissYet"}:{},...d?{}:{fireRepositionEventInstead:{}},inlineBehaviours:Sa([bf("window-manager-inline-events",[oa(Ps(),((e,t)=>{qs(u.dialog,m_)}))]),qi.config({contextual:{lazyContext:()=>A.some(Ko(Be.fromDom(t.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top","bottom"],lazyViewport:e=>kb(t,e.element).map((e=>({bounds:_b(e),optScrollEnv:A.some({currentScrollTop:e.element.dom.scrollTop,scrollElmTop:Gt(e.element).top})}))).getOrThunk((()=>({bounds:Jo(),optScrollEnv:A.none()})))})]),isExtraPart:(e,t)=>ez(t)}));c.set(g);return dv.showWithinBounds(g,Vl(u.dialog),{anchor:n},(()=>e.backstages.popup.shared.getSink().toOptional().bind((e=>{const o=kb(t,e.element).map((e=>_b(e))).getOr(Jo()),n=Ko(Be.fromDom(t.getContentAreaContainer())),r=Xo(n,o);return A.some(Go(r.x,r.y,r.width,r.height-15))})))),qi.refresh(g),t.on("ResizeEditor ScrollWindow ElementScroll ResizeWindow",m),u.instanceApi.setData(l),lf.focusIn(u.dialog),u.instanceApi}),o);return{open:(t,o,n)=>{if(!m(o)){if("toolbar"===o.inline)return i(t,e.backstages.popup.shared.anchors.inlineDialog(),n,o);if("bottom"===o.inline)return l(t,e.backstages.popup.shared.anchors.inlineBottomDialog(),n,o);if("cursor"===o.inline)return i(t,e.backstages.popup.shared.anchors.cursor(),n,o)}return a(t,n)},openUrl:(e,t)=>s(e,t),alert:(e,t)=>{n.open(e,t)},close:e=>{e.close()},confirm:(e,t)=>{r.open(e,t)}}},nz=e=>{yv(e),(e=>{const t=e.options.register,o=e=>f(e,s)?{value:vS(e),valid:!0}:{valid:!1,message:"Must be an array of strings."},n=e=>p(e)&&e>0?{value:e,valid:!0}:{valid:!1,message:"Must be a positive number."};t("color_map",{processor:o,default:["#BFEDD2","Light Green","#FBEEB8","Light Yellow","#F8CAC6","Light Red","#ECCAFA","Light Purple","#C2E0F4","Light Blue","#2DC26B","Green","#F1C40F","Yellow","#E03E2D","Red","#B96AD9","Purple","#3598DB","Blue","#169179","Dark Turquoise","#E67E23","Orange","#BA372A","Dark Red","#843FA1","Dark Purple","#236FA1","Dark Blue","#ECF0F1","Light Gray","#CED4D9","Medium Gray","#95A5A6","Gray","#7E8C8D","Dark Gray","#34495E","Navy Blue","#000000","Black","#ffffff","White"]}),t("color_map_background",{processor:o}),t("color_map_foreground",{processor:o}),t("color_cols",{processor:n,default:xS(e)}),t("color_cols_foreground",{processor:n,default:CS(e,pS)}),t("color_cols_background",{processor:n,default:CS(e,fS)}),t("custom_colors",{processor:"boolean",default:!0}),t("color_default_foreground",{processor:"string",default:yS}),t("color_default_background",{processor:"string",default:yS})})(e),(e=>{const t=e.options.register;t("contextmenu_avoid_overlap",{processor:"string",default:""}),t("contextmenu_never_use_native",{processor:"boolean",default:!1}),t("contextmenu",{processor:e=>!1===e?{value:[],valid:!0}:s(e)||f(e,s)?{value:LL(e),valid:!0}:{valid:!1,message:"Must be false or a string."},default:"link linkchecker image editimage table spellchecker configurepermanentpen"})})(e)};nn.add("silver",(e=>{nz(e);let t=()=>Jo();const{dialogs:o,popups:n,renderUI:r}=rI(e,{getPopupSinkBounds:()=>t()});Fk(e,n.backstage.shared);const s=oz({editor:e,backstages:{popup:n.backstage,dialog:o.backstage}}),a=on();return{renderUI:()=>{const o=r();return kb(e,n.getMothership().element).each((e=>{t=()=>_b(e)})),o},getWindowManagerImpl:w(s),getNotificationManagerImpl:()=>Xy(e,{backstage:n.backstage},n.getMothership(),a)}}))}(),function(){var e=tinymce.util.Tools.resolve("tinymce.ModelManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=r=e,n=(s=String).prototype,n.isPrototypeOf(o)||(null===(a=r.constructor)||void 0===a?void 0:a.name)===s.name)?"string":t;var o,n;var r,s,a})(t)===e,o=e=>t=>typeof t===e,n=e=>t=>e===t,r=t("string"),s=t("object"),a=t("array"),i=n(null),l=o("boolean"),c=n(void 0),d=e=>!(e=>null==e)(e),m=o("function"),u=o("number"),g=()=>{},h=e=>()=>e,p=e=>e,f=(e,t)=>e===t;function v(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const b=e=>t=>!e(t),y=e=>e(),w=h(!1),x=h(!0);class C{constructor(e,t){this.tag=e,this.value=t}static some(e){return new C(!0,e)}static none(){return C.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?C.some(e(this.value)):C.none()}bind(e){return this.tag?e(this.value):C.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:C.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return d(e)?C.some(e):C.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}C.singletonNone=new C(!1);const S=Array.prototype.slice,k=Array.prototype.indexOf,_=Array.prototype.push,E=(e,t)=>{return o=e,n=t,k.call(o,n)>-1;var o,n},T=(e,t)=>{for(let o=0,n=e.length;o{const o=[];for(let n=0;n{const o=e.length,n=new Array(o);for(let r=0;r{for(let o=0,n=e.length;o{const o=[],n=[];for(let r=0,s=e.length;r{const o=[];for(let n=0,r=e.length;n(((e,t)=>{for(let o=e.length-1;o>=0;o--)t(e[o],o)})(e,((e,n)=>{o=t(o,e,n)})),o),B=(e,t,o)=>(D(e,((e,n)=>{o=t(o,e,n)})),o),L=(e,t)=>((e,t,o)=>{for(let n=0,r=e.length;n{for(let o=0,n=e.length;o{const t=[];for(let o=0,n=e.length;oI(A(e,t)),F=(e,t)=>{for(let o=0,n=e.length;o{const o={};for(let n=0,r=e.length;nt>=0&&tV(e,0),U=e=>V(e,e.length-1),j=(e,t)=>{for(let o=0;o{const o=W(e);for(let n=0,r=o.length;nK(e,((e,o)=>({k:o,v:t(e,o)}))),K=(e,t)=>{const o={};return q(e,((e,n)=>{const r=t(e,n);o[r.k]=r.v})),o},Y=(e,t)=>{const o={};return((e,t,o,n)=>{q(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))})(e,t,(e=>(t,o)=>{e[o]=t})(o),g),o},X=(e,t)=>{const o=[];return q(e,((e,n)=>{o.push(t(e,n))})),o},J=e=>X(e,p),Q=(e,t)=>$.call(e,t),ee="undefined"!=typeof window?window:Function("return this;")(),te=(e,t)=>((e,t)=>{let o=null!=t?t:ee;for(let t=0;t{const o=((e,t)=>te(e,t))(e,t);if(null==o)throw new Error(e+" not available on this browser");return o},ne=Object.getPrototypeOf,re=e=>{const t=te("ownerDocument.defaultView",e);return s(e)&&((e=>oe("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(ne(e).constructor.name))},se=e=>e.dom.nodeName.toLowerCase(),ae=e=>e.dom.nodeType,ie=e=>t=>ae(t)===e,le=e=>8===ae(e)||"#comment"===se(e),ce=e=>de(e)&&re(e.dom),de=ie(1),me=ie(3),ue=ie(9),ge=ie(11),he=e=>t=>de(t)&&se(t)===e,pe=(e,t,o)=>{if(!(r(o)||l(o)||u(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")},fe=(e,t,o)=>{pe(e.dom,t,o)},ve=(e,t)=>{const o=e.dom;q(t,((e,t)=>{pe(o,t,e)}))},be=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},ye=(e,t)=>C.from(be(e,t)),we=(e,t)=>{e.dom.removeAttribute(t)},xe=e=>B(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}),Ce=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},Se={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return Ce(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return Ce(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return Ce(o)},fromDom:Ce,fromPoint:(e,t,o)=>C.from(e.dom.elementFromPoint(t,o)).map(Ce)},ke=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},_e=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,Ee=(e,t)=>{const o=void 0===t?document:t.dom;return _e(o)?C.none():C.from(o.querySelector(e)).map(Se.fromDom)},Te=(e,t)=>e.dom===t.dom,Oe=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},Ae=ke,De=e=>Se.fromDom(e.dom.ownerDocument),Me=e=>ue(e)?e:De(e),Ne=e=>C.from(e.dom.parentNode).map(Se.fromDom),Re=e=>C.from(e.dom.parentElement).map(Se.fromDom),Be=(e,t)=>{const o=m(t)?t:w;let n=e.dom;const r=[];for(;null!==n.parentNode&&void 0!==n.parentNode;){const e=n.parentNode,t=Se.fromDom(e);if(r.push(t),!0===o(t))break;n=e}return r},Le=e=>C.from(e.dom.previousSibling).map(Se.fromDom),He=e=>C.from(e.dom.nextSibling).map(Se.fromDom),Ie=e=>A(e.dom.childNodes,Se.fromDom),Pe=(e,t)=>{const o=e.dom.childNodes;return C.from(o[t]).map(Se.fromDom)},Fe=(e,t)=>{Ne(e).each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},ze=(e,t)=>{He(e).fold((()=>{Ne(e).each((e=>{Ze(e,t)}))}),(e=>{Fe(e,t)}))},Ve=(e,t)=>{const o=(e=>Pe(e,0))(e);o.fold((()=>{Ze(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},Ze=(e,t)=>{e.dom.appendChild(t.dom)},Ue=(e,t)=>{Fe(e,t),Ze(t,e)},je=(e,t)=>{D(t,((o,n)=>{const r=0===n?e:t[n-1];ze(r,o)}))},We=(e,t)=>{D(t,(t=>{Ze(e,t)}))},$e=e=>{e.dom.textContent="",D(Ie(e),(e=>{qe(e)}))},qe=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},Ge=e=>{const t=Ie(e);t.length>0&&je(e,t),qe(e)},Ke=(e,t)=>Se.fromDom(e.dom.cloneNode(t)),Ye=e=>Ke(e,!1),Xe=e=>Ke(e,!0),Je=(e,t)=>{const o=Se.fromTag(t),n=xe(e);return ve(o,n),o},Qe=["tfoot","thead","tbody","colgroup"],et=(e,t,o)=>({element:e,rowspan:t,colspan:o}),tt=(e,t,o)=>({element:e,cells:t,section:o}),ot=(e,t,o)=>({element:e,isNew:t,isLocked:o}),nt=(e,t,o,n)=>({element:e,cells:t,section:o,isNew:n}),rt=m(Element.prototype.attachShadow)&&m(Node.prototype.getRootNode),st=h(rt),at=rt?e=>Se.fromDom(e.dom.getRootNode()):Me,it=e=>{const t=at(e);return ge(o=t)&&d(o.dom.host)?C.some(t):C.none();var o},lt=e=>Se.fromDom(e.dom.host),ct=e=>d(e.dom.shadowRoot),dt=e=>{const t=me(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return it(Se.fromDom(t)).fold((()=>o.body.contains(t)),(n=dt,r=lt,e=>n(r(e))));var n,r},mt=e=>{const t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return Se.fromDom(t)},ut=(e,t)=>{let o=[];return D(Ie(e),(e=>{t(e)&&(o=o.concat([e])),o=o.concat(ut(e,t))})),o},gt=(e,t,o)=>((e,t,o)=>N(Be(e,o),t))(e,(e=>ke(e,t)),o),ht=(e,t)=>((e,t)=>N(Ie(e),t))(e,(e=>ke(e,t))),pt=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return _e(o)?[]:A(o.querySelectorAll(e),Se.fromDom)})(t,e);var ft=(e,t,o,n,r)=>e(o,n)?C.some(o):m(r)&&r(o)?C.none():t(o,n,r);const vt=(e,t,o)=>{let n=e.dom;const r=m(o)?o:w;for(;n.parentNode;){n=n.parentNode;const e=Se.fromDom(n);if(t(e))return C.some(e);if(r(e))break}return C.none()},bt=(e,t,o)=>ft(((e,t)=>t(e)),vt,e,t,o),yt=(e,t,o)=>vt(e,(e=>ke(e,t)),o),wt=(e,t)=>((e,t)=>L(e.dom.childNodes,(e=>t(Se.fromDom(e)))).map(Se.fromDom))(e,(e=>ke(e,t))),xt=(e,t)=>Ee(t,e),Ct=(e,t,o)=>ft(((e,t)=>ke(e,t)),yt,e,t,o),St=(e,t,o=f)=>e.exists((e=>o(e,t))),kt=e=>{const t=[],o=e=>{t.push(e)};for(let t=0;te?C.some(t):C.none(),Et=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,Tt=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!c(n)||r+t.length<=n)},Ot=(e,t)=>Et(e,t,0),At=(e,t)=>Et(e,t,e.length-t.length),Dt=(e=>t=>t.replace(e,""))(/^\s+|\s+$/g),Mt=e=>e.length>0,Nt=e=>void 0!==e.style&&m(e.style.getPropertyValue),Rt=(e,t,o)=>{if(!r(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);Nt(e)&&e.style.setProperty(t,o)},Bt=(e,t,o)=>{const n=e.dom;Rt(n,t,o)},Lt=(e,t)=>{const o=e.dom;q(t,((e,t)=>{Rt(o,t,e)}))},Ht=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||dt(e)?n:It(o,t)},It=(e,t)=>Nt(e)?e.style.getPropertyValue(t):"",Pt=(e,t)=>{const o=e.dom,n=It(o,t);return C.from(n).filter((e=>e.length>0))},Ft=(e,t)=>{((e,t)=>{Nt(e)&&e.style.removeProperty(t)})(e.dom,t),St(ye(e,"style").map(Dt),"")&&we(e,"style")},zt=(e,t,o=0)=>ye(e,t).map((e=>parseInt(e,10))).getOr(o),Vt=(e,t)=>zt(e,t,1),Zt=e=>he("col")(e)?zt(e,"span",1)>1:Vt(e,"colspan")>1,Ut=(e,t)=>parseInt(Ht(e,t),10),jt=h(10),Wt=h(10),$t=(e,t)=>qt(e,t,x),qt=(e,t,o)=>P(Ie(e),(e=>ke(e,t)?o(e)?[e]:[]:qt(e,t,o))),Gt=(e,t)=>((e,t,o=w)=>o(t)?C.none():E(e,se(t))?C.some(t):yt(t,e.join(","),(e=>ke(e,"table")||o(e))))(["td","th"],e,t),Kt=e=>$t(e,"th,td"),Yt=e=>ke(e,"colgroup")?ht(e,"col"):P(Qt(e),(e=>ht(e,"col"))),Xt=(e,t)=>Ct(e,"table",t),Jt=e=>$t(e,"tr"),Qt=e=>Xt(e).fold(h([]),(e=>ht(e,"colgroup"))),eo=(e,t)=>A(e,(e=>{if("colgroup"===se(e)){const t=A(Yt(e),(e=>{const t=zt(e,"span",1);return et(e,1,t)}));return tt(e,t,"colgroup")}{const o=A(Kt(e),(e=>{const t=zt(e,"rowspan",1),o=zt(e,"colspan",1);return et(e,t,o)}));return tt(e,o,t(e))}})),to=e=>Ne(e).map((e=>{const t=se(e);return(e=>E(Qe,e))(t)?t:"tbody"})).getOr("tbody"),oo=e=>{const t=Jt(e),o=[...Qt(e),...t];return eo(o,to)},no=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},ro=()=>so(0,0),so=(e,t)=>({major:e,minor:t}),ao={nu:so,detect:(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?ro():((e,t)=>{const o=((e,t)=>{for(let o=0;oNumber(t.replace(o,"$"+e));return so(n(1),n(2))})(e,o)},unknown:ro},io=(e,t)=>{const o=String(t).toLowerCase();return L(e,(e=>e.search(o)))},lo=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,co=e=>t=>Tt(t,e),mo=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>Tt(e,"edge/")&&Tt(e,"chrome")&&Tt(e,"safari")&&Tt(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,lo],search:e=>Tt(e,"chrome")&&!Tt(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>Tt(e,"msie")||Tt(e,"trident")},{name:"Opera",versionRegexes:[lo,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:co("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:co("firefox")},{name:"Safari",versionRegexes:[lo,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(Tt(e,"safari")||Tt(e,"mobile/"))&&Tt(e,"applewebkit")}],uo=[{name:"Windows",search:co("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>Tt(e,"iphone")||Tt(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:co("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:co("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:co("linux"),versionRegexes:[]},{name:"Solaris",search:co("sunos"),versionRegexes:[]},{name:"FreeBSD",search:co("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:co("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],go={browsers:h(mo),oses:h(uo)},ho="Edge",po="Chromium",fo="Opera",vo="Firefox",bo="Safari",yo=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(ho),isChromium:n(po),isIE:n("IE"),isOpera:n(fo),isFirefox:n(vo),isSafari:n(bo)}},wo={unknown:()=>yo({current:void 0,version:ao.unknown()}),nu:yo,edge:h(ho),chromium:h(po),ie:h("IE"),opera:h(fo),firefox:h(vo),safari:h(bo)},xo="Windows",Co="Android",So="Linux",ko="macOS",_o="Solaris",Eo="FreeBSD",To="ChromeOS",Oo=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(xo),isiOS:n("iOS"),isAndroid:n(Co),isMacOS:n(ko),isLinux:n(So),isSolaris:n(_o),isFreeBSD:n(Eo),isChromeOS:n(To)}},Ao={unknown:()=>Oo({current:void 0,version:ao.unknown()}),nu:Oo,windows:h(xo),ios:h("iOS"),android:h(Co),linux:h(So),macos:h(ko),solaris:h(_o),freebsd:h(Eo),chromeos:h(To)},Do=(e,t,o)=>{const n=go.browsers(),r=go.oses(),s=t.bind((e=>((e,t)=>j(t.brands,(t=>{const o=t.brand.toLowerCase();return L(e,(e=>{var t;return o===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:ao.nu(parseInt(t.version,10),0)})))})))(n,e))).orThunk((()=>((e,t)=>io(e,t).map((e=>{const o=ao.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(n,e))).fold(wo.unknown,wo.nu),a=((e,t)=>io(e,t).map((e=>{const o=ao.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(r,e).fold(Ao.unknown,Ao.nu),i=((e,t,o,n)=>{const r=e.isiOS()&&!0===/ipad/i.test(o),s=e.isiOS()&&!r,a=e.isiOS()||e.isAndroid(),i=a||n("(pointer:coarse)"),l=r||!s&&a&&n("(min-device-width:768px)"),c=s||a&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),m=!c&&!l&&!d;return{isiPad:h(r),isiPhone:h(s),isTablet:h(l),isPhone:h(c),isTouch:h(i),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:h(d),isDesktop:h(m)}})(a,s,e,o);return{browser:s,os:a,deviceType:i}},Mo=e=>window.matchMedia(e).matches;let No=no((()=>Do(navigator.userAgent,C.from(navigator.userAgentData),Mo)));const Ro=()=>No(),Bo=(e,t)=>{const o=o=>{const n=t(o);if(n<=0||null===n){const t=Ht(o,e);return parseFloat(t)||0}return n},n=(e,t)=>B(t,((t,o)=>{const n=Ht(e,o),r=void 0===n?0:parseInt(n,10);return isNaN(r)?t:t+r}),0);return{set:(t,o)=>{if(!u(o)&&!o.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+o);const n=t.dom;Nt(n)&&(n.style[e]=o+"px")},get:o,getOuter:o,aggregate:n,max:(e,t,o)=>{const r=n(e,o);return t>r?t-r:0}}},Lo=(e,t)=>(e=>{const t=parseFloat(e);return isNaN(t)?C.none():C.some(t)})(e).getOr(t),Ho=(e,t,o)=>Lo(Ht(e,t),o),Io=(e,t)=>{const o=e.dom,n=o.getBoundingClientRect().width||o.offsetWidth;return"border-box"===t?n:((e,t,o,n)=>t-Ho(e,`padding-${o}`,0)-Ho(e,`padding-${n}`,0)-Ho(e,`border-${o}-width`,0)-Ho(e,`border-${n}-width`,0))(e,n,"left","right")},Po=Bo("width",(e=>e.dom.offsetWidth)),Fo=e=>Po.get(e),zo=e=>Po.getOuter(e),Vo=e=>Io(e,"content-box"),Zo=e=>Ho(e,"width",e.dom.offsetWidth),Uo=(e,t,o)=>{const n=e.cells,r=n.slice(0,t),s=n.slice(t),a=r.concat(o).concat(s);return $o(e,a)},jo=(e,t,o)=>Uo(e,t,[o]),Wo=(e,t,o)=>{e.cells[t]=o},$o=(e,t)=>nt(e.element,t,e.section,e.isNew),qo=(e,t)=>e.cells[t],Go=(e,t)=>qo(e,t).element,Ko=e=>e.cells.length,Yo=e=>{const t=M(e,(e=>"colgroup"===e.section));return{rows:t.fail,cols:t.pass}},Xo=(e,t,o)=>{const n=A(e.cells,o);return nt(t(e.element),n,e.section,!0)},Jo="data-snooker-locked-cols",Qo=e=>ye(e,Jo).bind((e=>C.from(e.match(/\d+/g)))).map((e=>z(e,x))),en=e=>{const t=B(Yo(e).rows,((e,t)=>(D(t.cells,((t,o)=>{t.isLocked&&(e[o]=!0)})),e)),{}),o=X(t,((e,t)=>parseInt(t,10)));return((e,t)=>{const o=S.call(e,0);return o.sort(t),o})(o)},tn=(e,t)=>e+","+t,on=(e,t)=>{const o=P(e.all,(e=>e.cells));return N(o,t)},nn=e=>{const t={},o=[],n=Z(e).map((e=>e.element)).bind(Xt).bind(Qo).getOr({});let r=0,s=0,a=0;const{pass:i,fail:l}=M(e,(e=>"colgroup"===e.section));D(l,(e=>{const i=[];D(e.cells,(e=>{let o=0;for(;void 0!==t[tn(a,o)];)o++;const r=((e,t)=>Q(e,t)&&void 0!==e[t]&&null!==e[t])(n,o.toString()),l=((e,t,o,n,r,s)=>({element:e,rowspan:t,colspan:o,row:n,column:r,isLocked:s}))(e.element,e.rowspan,e.colspan,a,o,r);for(let n=0;n{const t=(e=>{const t={};let o=0;return D(e.cells,(e=>{const n=e.colspan;O(n,(r=>{const s=o+r;t[s]=((e,t,o)=>({element:e,colspan:t,column:o}))(e.element,n,s)})),o+=n})),t})(e),o=((e,t)=>({element:e,columns:t}))(e.element,J(t));return{colgroups:[o],columns:t}})).getOrThunk((()=>({colgroups:[],columns:{}}))),m=((e,t)=>({rows:e,columns:t}))(r,s);return{grid:m,access:t,all:o,columns:c,colgroups:d}},rn={fromTable:e=>{const t=oo(e);return nn(t)},generate:nn,getAt:(e,t,o)=>C.from(e.access[tn(t,o)]),findItem:(e,t,o)=>{const n=on(e,(e=>o(t,e.element)));return n.length>0?C.some(n[0]):C.none()},filterItems:on,justCells:e=>P(e.all,(e=>e.cells)),justColumns:e=>J(e.columns),hasColumns:e=>W(e.columns).length>0,getColumnAt:(e,t)=>C.from(e.columns[t])},sn=(e,t=x)=>{const o=e.grid,n=O(o.columns,p),r=O(o.rows,p);return A(n,(o=>an((()=>P(r,(t=>rn.getAt(e,t,o).filter((e=>e.column===o)).toArray()))),(e=>1===e.colspan&&t(e.element)),(()=>rn.getAt(e,0,o)))))},an=(e,t,o)=>{const n=e();return L(n,t).orThunk((()=>C.from(n[0]).orThunk(o))).map((e=>e.element))},ln=e=>{const t=e.grid,o=O(t.rows,p),n=O(t.columns,p);return A(o,(t=>an((()=>P(n,(o=>rn.getAt(e,t,o).filter((e=>e.row===t)).fold(h([]),(e=>[e]))))),(e=>1===e.rowspan),(()=>rn.getAt(e,t,0)))))},cn=(e,t)=>{if(t<0||t>=e.length-1)return C.none();const o=e[t].fold((()=>{const o=(e=>{const t=S.call(e,0);return t.reverse(),t})(e.slice(0,t));return j(o,((e,t)=>e.map((e=>({value:e,delta:t+1})))))}),(e=>C.some({value:e,delta:0}))),n=e[t+1].fold((()=>{const o=e.slice(t+1);return j(o,((e,t)=>e.map((e=>({value:e,delta:t+1})))))}),(e=>C.some({value:e,delta:1})));return o.bind((e=>n.map((t=>{const o=t.delta+e.delta;return Math.abs(t.value-e.value)/o}))))},dn=(e,t)=>o=>"rtl"===mn(o)?t:e,mn=e=>"rtl"===Ht(e,"direction")?"rtl":"ltr",un=Bo("height",(e=>{const t=e.dom;return dt(e)?t.getBoundingClientRect().height:t.offsetHeight})),gn=e=>un.get(e),hn=e=>un.getOuter(e),pn=e=>Ho(e,"height",e.dom.offsetHeight),fn=(e,t)=>({left:e,top:t,translate:(o,n)=>fn(e+o,t+n)}),vn=fn,bn=(e,t)=>void 0!==e?e:void 0!==t?t:0,yn=e=>{const t=e.dom.ownerDocument,o=t.body,n=t.defaultView,r=t.documentElement;if(o===e.dom)return vn(o.offsetLeft,o.offsetTop);const s=bn(null==n?void 0:n.pageYOffset,r.scrollTop),a=bn(null==n?void 0:n.pageXOffset,r.scrollLeft),i=bn(r.clientTop,o.clientTop),l=bn(r.clientLeft,o.clientLeft);return wn(e).translate(a-l,s-i)},wn=e=>{const t=e.dom,o=t.ownerDocument.body;return o===t?vn(o.offsetLeft,o.offsetTop):dt(e)?(e=>{const t=e.getBoundingClientRect();return vn(t.left,t.top)})(t):vn(0,0)},xn=(e,t)=>({row:e,y:t}),Cn=(e,t)=>({col:e,x:t}),Sn=e=>yn(e).left+zo(e),kn=e=>yn(e).left,_n=(e,t)=>Cn(e,kn(t)),En=(e,t)=>Cn(e,Sn(t)),Tn=e=>yn(e).top,On=(e,t)=>xn(e,Tn(t)),An=(e,t)=>xn(e,Tn(t)+hn(t)),Dn=(e,t,o)=>{if(0===o.length)return[];const n=A(o.slice(1),((t,o)=>t.map((t=>e(o,t))))),r=o[o.length-1].map((e=>t(o.length-1,e)));return n.concat([r])},Mn={delta:p,positions:e=>Dn(On,An,e),edge:Tn},Nn=dn({delta:p,edge:kn,positions:e=>Dn(_n,En,e)},{delta:e=>-e,edge:Sn,positions:e=>Dn(En,_n,e)}),Rn={delta:(e,t)=>Nn(t).delta(e,t),positions:(e,t)=>Nn(t).positions(e,t),edge:e=>Nn(e).edge(e)},Bn={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},Ln=(()=>{const e="[0-9]+",t="[eE]"+("[+-]?"+e),o=e=>`(?:${e})?`,n=["Infinity",e+"\\."+o(e)+o(t),"\\."+e+o(t),e+o(t)].join("|");return new RegExp(`^(${`[+-]?(?:${n})`})(.*)$`)})(),Hn=(e,t)=>C.from(Ln.exec(e)).bind((e=>{const o=Number(e[1]),n=e[2];return((e,t)=>T(t,(t=>T(Bn[t],(t=>e===t)))))(n,t)?C.some({value:o,unit:n}):C.none()})),In=/(\d+(\.\d+)?)%/,Pn=/(\d+(\.\d+)?)px|em/,Fn=he("col"),zn=he("tr"),Vn=(e,t,o)=>{const n=Re(e).getOrThunk((()=>mt(De(e))));return t(e)/o(n)*100},Zn=(e,t)=>{Bt(e,"width",t+"px")},Un=(e,t)=>{Bt(e,"width",t+"%")},jn=(e,t)=>{Bt(e,"height",t+"px")},Wn=(e,t,o,n)=>{const r=parseFloat(e);return At(e,"%")&&"table"!==se(t)?((e,t,o,n)=>{const r=Xt(e).map((e=>{const n=o(e);return Math.floor(t/100*n)})).getOr(t);return n(e,r),r})(t,r,o,n):r},$n=e=>{const t=(e=>pn(e)+"px")(e);return t?Wn(t,e,gn,jn):gn(e)},qn=(e,t)=>Pt(e,t).orThunk((()=>ye(e,t).map((e=>e+"px")))),Gn=e=>qn(e,"width"),Kn=e=>Vn(e,Fo,Vo),Yn=e=>Fn(e)?Fo(e):Zo(e),Xn=e=>zn(e)?gn(e):((e,t,o)=>o(e)/Vt(e,t))(e,"rowspan",$n),Jn=(e,t,o)=>{Bt(e,"width",t+o)},Qn=e=>Vn(e,Fo,Vo)+"%",er=h(In),tr=he("col"),or=e=>Gn(e).getOrThunk((()=>Yn(e)+"px")),nr=e=>{return(t=e,qn(t,"height")).getOrThunk((()=>Xn(e)+"px"));var t},rr=(e,t,o,n,r,s)=>e.filter(n).fold((()=>s(cn(o,t))),(e=>r(e))),sr=(e,t,o,n)=>{const r=sn(e),s=rn.hasColumns(e)?(e=>A(rn.justColumns(e),(e=>C.from(e.element))))(e):r,a=[C.some(Rn.edge(t))].concat(A(Rn.positions(r,t),(e=>e.map((e=>e.x))))),i=b(Zt);return A(s,((e,t)=>rr(e,t,a,i,(e=>{if((e=>{const t=Ro().browser,o=t.isChromium()||t.isFirefox();return!tr(e)||o})(e))return o(e);{const e=(s=r[t],l=p,null!=s?l(s):C.none());return rr(e,t,a,i,(e=>n(C.some(Fo(e)))),n)}var s,l}),n)))},ar=e=>e.map((e=>e+"px")).getOr(""),ir=(e,t,o)=>sr(e,t,Yn,(e=>e.getOrThunk(o.minCellWidth))),lr=(e,t,o,n)=>{const r=ln(e),s=A(e.all,(e=>C.some(e.element))),a=[C.some(Mn.edge(t))].concat(A(Mn.positions(r,t),(e=>e.map((e=>e.y)))));return A(s,((e,t)=>rr(e,t,a,x,o,n)))},cr=(e,t)=>()=>dt(e)?t(e):parseFloat(Pt(e,"width").getOr("0")),dr=e=>{const t=cr(e,Fo),o=h(0);return{width:t,pixelWidth:t,getWidths:(t,o)=>ir(t,e,o),getCellDelta:o,singleColumnWidth:h([0]),minCellWidth:o,setElementWidth:g,adjustTableWidth:g,isRelative:!0,label:"none"}},mr=e=>{const t=cr(e,(e=>parseFloat(Qn(e)))),o=cr(e,Fo);return{width:t,pixelWidth:o,getWidths:(t,o)=>((e,t,o)=>sr(e,t,Kn,(e=>e.fold((()=>o.minCellWidth()),(e=>e/o.pixelWidth()*100)))))(t,e,o),getCellDelta:e=>e/o()*100,singleColumnWidth:(e,t)=>[100-e],minCellWidth:()=>jt()/o()*100,setElementWidth:Un,adjustTableWidth:o=>{const n=t();Un(e,n+o/100*n)},isRelative:!0,label:"percent"}},ur=e=>{const t=cr(e,Fo);return{width:t,pixelWidth:t,getWidths:(t,o)=>ir(t,e,o),getCellDelta:p,singleColumnWidth:(e,t)=>[Math.max(jt(),e+t)-e],minCellWidth:jt,setElementWidth:Zn,adjustTableWidth:o=>{const n=t()+o;Zn(e,n)},isRelative:!1,label:"pixel"}},gr=e=>Gn(e).fold((()=>dr(e)),(t=>((e,t)=>null!==er().exec(t)?mr(e):ur(e))(e,t))),hr=ur,pr=mr,fr=(e,t,o)=>{const n=e[o].element,r=Se.fromTag("td");Ze(r,Se.fromTag("br"));(t?Ze:Ve)(n,r)},vr=(e,t)=>{const o=e=>ke(e.element,t),n=Xe(e),r=oo(n),s=gr(e),a=rn.generate(r),i=((e,t)=>{const o=e.grid.columns;let n=e.grid.rows,r=o,s=0,a=0;const i=[],l=[];return q(e.access,(e=>{if(i.push(e),t(e)){l.push(e);const t=e.row,o=t+e.rowspan-1,i=e.column,c=i+e.colspan-1;ts&&(s=o),ia&&(a=c)}})),((e,t,o,n,r,s)=>({minRow:e,minCol:t,maxRow:o,maxCol:n,allCells:r,selectedCells:s}))(n,r,s,a,i,l)})(a,o),l="th:not("+t+"),td:not("+t+")",c=qt(n,"th,td",(e=>ke(e,l)));D(c,qe),((e,t,o,n)=>{const r=N(e,(e=>"colgroup"!==e.section)),s=t.grid.columns,a=t.grid.rows;for(let e=0;eo.maxRow||io.maxCol||(rn.getAt(t,e,i).filter(n).isNone()?fr(r,a,e):a=!0)}})(r,a,i,o);const d=((e,t,o,n)=>{if(0===n.minCol&&t.grid.columns===n.maxCol+1)return 0;const r=ir(t,e,o),s=B(r,((e,t)=>e+t),0),a=B(r.slice(n.minCol,n.maxCol+1),((e,t)=>e+t),0),i=a/s*o.pixelWidth()-o.pixelWidth();return o.getCellDelta(i)})(e,rn.fromTable(e),s,i);return((e,t,o,n)=>{q(o.columns,(e=>{(e.columnt.maxCol)&&qe(e.element)}));const r=N($t(e,"tr"),(e=>0===e.dom.childElementCount));D(r,qe),t.minCol!==t.maxCol&&t.minRow!==t.maxRow||D($t(e,"th,td"),(e=>{we(e,"rowspan"),we(e,"colspan")})),we(e,Jo),we(e,"data-snooker-col-series"),gr(e).adjustTableWidth(n)})(n,i,a,d),n},br=((e,t)=>{const o=t=>e(t)?C.from(t.dom.nodeValue):C.none();return{get:n=>{if(!e(n))throw new Error("Can only get "+t+" value of a "+t+" node");return o(n).getOr("")},getOption:o,set:(o,n)=>{if(!e(o))throw new Error("Can only set raw "+t+" value of a "+t+" node");o.dom.nodeValue=n}}})(me,"text"),yr=e=>br.get(e),wr=e=>br.getOption(e),xr=(e,t)=>br.set(e,t),Cr=e=>"img"===se(e)?1:wr(e).fold((()=>Ie(e).length),(e=>e.length)),Sr=["img","br"],kr=e=>wr(e).filter((e=>0!==e.trim().length||e.indexOf(" ")>-1)).isSome()||E(Sr,se(e))||(e=>ce(e)&&"false"===be(e,"contenteditable"))(e),_r=e=>((e,t)=>{const o=e=>{for(let n=0;nTr(e,kr),Tr=(e,t)=>{const o=e=>{const n=Ie(e);for(let e=n.length-1;e>=0;e--){const r=n[e];if(t(r))return C.some(r);const s=o(r);if(s.isSome())return s}return C.none()};return o(e)},Or={scope:["row","col"]},Ar=e=>()=>{const t=Se.fromTag("td",e.dom);return Ze(t,Se.fromTag("br",e.dom)),t},Dr=e=>()=>Se.fromTag("col",e.dom),Mr=e=>()=>Se.fromTag("colgroup",e.dom),Nr=e=>()=>Se.fromTag("tr",e.dom),Rr=(e,t,o)=>{const n=((e,t)=>{const o=Je(e,t),n=Ie(Xe(e));return We(o,n),o})(e,t);return q(o,((e,t)=>{null===e?we(n,t):fe(n,t,e)})),n},Br=e=>e,Lr=(e,t,o)=>{const n=(e,t)=>{((e,t)=>{const o=e.dom,n=t.dom;Nt(o)&&Nt(n)&&(n.style.cssText=o.style.cssText)})(e.element,t),Ft(t,"height"),1!==e.colspan&&Ft(t,"width")};return{col:o=>{const r=Se.fromTag(se(o.element),t.dom);return n(o,r),e(o.element,r),r},colgroup:Mr(t),row:Nr(t),cell:r=>{const s=Se.fromTag(se(r.element),t.dom),a=o.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),i=a.length>0?((e,t,o)=>_r(e).map((n=>{const r=o.join(","),s=gt(n,r,(t=>Te(t,e)));return R(s,((e,t)=>{const o=Ye(t);return Ze(e,o),o}),t)})).getOr(t))(r.element,s,a):s;return Ze(i,Se.fromTag("br")),n(r,s),((e,t)=>{q(Or,((o,n)=>ye(e,n).filter((e=>E(o,e))).each((e=>fe(t,n,e)))))})(r.element,s),e(r.element,s),s},replace:Rr,colGap:Dr(t),gap:Ar(t)}},Hr=e=>({col:Dr(e),colgroup:Mr(e),row:Nr(e),cell:Ar(e),replace:Br,colGap:Dr(e),gap:Ar(e)}),Ir=e=>t=>t.options.get(e),Pr="100%",Fr=e=>{var t;const o=e.dom,n=null!==(t=o.getParent(e.selection.getStart(),o.isBlock))&&void 0!==t?t:e.getBody();return Vo(Se.fromDom(n))+"px"},zr=e=>C.from(e.options.get("table_clone_elements")),Vr=Ir("table_header_type"),Zr=Ir("table_column_resizing"),Ur=e=>"preservetable"===Zr(e),jr=e=>"resizetable"===Zr(e),Wr=Ir("table_sizing_mode"),$r=e=>"relative"===Wr(e),qr=e=>"fixed"===Wr(e),Gr=e=>"responsive"===Wr(e),Kr=Ir("table_resize_bars"),Yr=Ir("table_style_by_css"),Xr=Ir("table_merge_content_on_paste"),Jr=e=>{const t=e.options,o=t.get("table_default_attributes");return t.isSet("table_default_attributes")?o:((e,t)=>Gr(e)||Yr(e)?t:qr(e)?{...t,width:Fr(e)}:{...t,width:Pr})(e,o)},Qr=e=>{const t=e.options,o=t.get("table_default_styles");return t.isSet("table_default_styles")?o:((e,t)=>Gr(e)||!Yr(e)?t:qr(e)?{...t,width:Fr(e)}:{...t,width:Pr})(e,o)},es=Ir("table_use_colgroups"),ts=e=>Ct(e,"[contenteditable]"),os=(e,t=!1)=>dt(e)?e.dom.isContentEditable:ts(e).fold(h(t),(e=>"true"===ns(e))),ns=e=>e.dom.contentEditable,rs=e=>Se.fromDom(e.getBody()),ss=e=>t=>Te(t,rs(e)),as=e=>{we(e,"data-mce-style");const t=e=>we(e,"data-mce-style");D(Kt(e),t),D(Yt(e),t),D(Jt(e),t)},is=e=>Se.fromDom(e.selection.getStart()),ls=e=>e.getBoundingClientRect().width,cs=e=>e.getBoundingClientRect().height,ds=e=>(t,o)=>{const n=t.dom.getStyle(o,e)||t.dom.getAttrib(o,e);return C.from(n).filter(Mt)},ms=ds("width"),us=ds("height"),gs=e=>bt(e,he("table")).exists(os),hs=(e,t)=>{const o=t.column,n=t.column+t.colspan-1,r=t.row,s=t.row+t.rowspan-1;return o<=e.finishCol&&n>=e.startCol&&r<=e.finishRow&&s>=e.startRow},ps=(e,t)=>t.column>=e.startCol&&t.column+t.colspan-1<=e.finishCol&&t.row>=e.startRow&&t.row+t.rowspan-1<=e.finishRow,fs=(e,t,o)=>{const n=rn.findItem(e,t,Te),r=rn.findItem(e,o,Te);return n.bind((e=>r.map((t=>{return o=e,n=t,r=Math.min(o.row,n.row),s=Math.min(o.column,n.column),a=Math.max(o.row+o.rowspan-1,n.row+n.rowspan-1),i=Math.max(o.column+o.colspan-1,n.column+n.colspan-1),{startRow:r,startCol:s,finishRow:a,finishCol:i};var o,n,r,s,a,i}))))},vs=(e,t,o)=>fs(e,t,o).bind((t=>((e,t)=>{let o=!0;const n=v(ps,t);for(let r=t.startRow;r<=t.finishRow;r++)for(let s=t.startCol;s<=t.finishCol;s++)o=o&&rn.getAt(e,r,s).exists(n);return o?C.some(t):C.none()})(e,t))),bs=(e,t,o)=>fs(e,t,o).map((t=>{const o=rn.filterItems(e,v(hs,t));return A(o,(e=>e.element))})),ys=(e,t)=>rn.findItem(e,t,((e,t)=>Oe(t,e))).map((e=>e.element)),ws=(e,t,o)=>Xt(e).bind((n=>((e,t,o,n)=>rn.findItem(e,t,Te).bind((t=>{const r=o>0?t.row+t.rowspan-1:t.row,s=n>0?t.column+t.colspan-1:t.column;return rn.getAt(e,r+o,s+n).map((e=>e.element))})))(Ss(n),e,t,o))),xs=(e,t,o)=>{const n=Ss(e);return bs(n,t,o)},Cs=(e,t,o,n,r)=>{const s=Ss(e),a=Te(e,o)?C.some(t):ys(s,t),i=Te(e,r)?C.some(n):ys(s,n);return a.bind((e=>i.bind((t=>bs(s,e,t)))))},Ss=rn.fromTable;var ks=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],_s=()=>({up:h({selector:yt,closest:Ct,predicate:vt,all:Be}),down:h({selector:pt,predicate:ut}),styles:h({get:Ht,getRaw:Pt,set:Bt,remove:Ft}),attrs:h({get:be,set:fe,remove:we,copyTo:(e,t)=>{const o=xe(e);ve(t,o)}}),insert:h({before:Fe,after:ze,afterAll:je,append:Ze,appendAll:We,prepend:Ve,wrap:Ue}),remove:h({unwrap:Ge,remove:qe}),create:h({nu:Se.fromTag,clone:e=>Se.fromDom(e.dom.cloneNode(!1)),text:Se.fromText}),query:h({comparePosition:(e,t)=>e.dom.compareDocumentPosition(t.dom),prevSibling:Le,nextSibling:He}),property:h({children:Ie,name:se,parent:Ne,document:e=>Me(e).dom,isText:me,isComment:le,isElement:de,isSpecial:e=>{const t=se(e);return E(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)},getLanguage:e=>de(e)?ye(e,"lang"):C.none(),getText:yr,setText:xr,isBoundary:e=>!!de(e)&&("body"===se(e)||E(ks,se(e))),isEmptyTag:e=>!!de(e)&&E(["br","img","hr","input"],se(e)),isNonEditable:e=>de(e)&&"false"===be(e,"contenteditable")}),eq:Te,is:Ae});const Es=(e,t,o,n)=>{const r=t(e,o);return R(n,((o,n)=>{const r=t(e,n);return Ts(e,o,r)}),r)},Ts=(e,t,o)=>t.bind((t=>o.filter(v(e.eq,t)))),Os=(e,t,o)=>o.length>0?((e,t,o,n)=>n(e,t,o[0],o.slice(1)))(e,t,o,Es):C.none(),As=(e,t,o,n=w)=>{const r=[t].concat(e.up().all(t)),s=[o].concat(e.up().all(o)),a=e=>H(e,n).fold((()=>e),(t=>e.slice(0,t+1))),i=a(r),l=a(s),c=L(i,(t=>T(l,((e,t)=>v(e.eq,t))(e,t))));return{firstpath:i,secondpath:l,shared:c}},Ds=_s(),Ms=(e,t)=>Os(Ds,((t,o)=>e(o)),t),Ns=e=>yt(e,"table"),Rs=(e,t,o)=>{const n=e=>t=>void 0!==o&&o(t)||Te(t,e);return Te(e,t)?C.some({boxes:C.some([e]),start:e,finish:t}):Ns(e).bind((r=>Ns(t).bind((s=>{if(Te(r,s))return C.some({boxes:xs(r,e,t),start:e,finish:t});if(Oe(r,s)){const o=gt(t,"td,th",n(r)),a=o.length>0?o[o.length-1]:t;return C.some({boxes:Cs(r,e,r,t,s),start:e,finish:a})}if(Oe(s,r)){const o=gt(e,"td,th",n(s)),a=o.length>0?o[o.length-1]:e;return C.some({boxes:Cs(s,e,r,t,s),start:e,finish:a})}return((e,t,o)=>As(Ds,e,t,o))(e,t).shared.bind((a=>Ct(a,"table",o).bind((o=>{const a=gt(t,"td,th",n(o)),i=a.length>0?a[a.length-1]:t,l=gt(e,"td,th",n(o)),c=l.length>0?l[l.length-1]:e;return C.some({boxes:Cs(o,e,r,t,s),start:c,finish:i})}))))}))))},Bs=(e,t)=>{const o=pt(e,t);return o.length>0?C.some(o):C.none()},Ls=(e,t,o)=>xt(e,t).bind((t=>xt(e,o).bind((e=>Ms(Ns,[t,e]).map((o=>({first:t,last:e,table:o}))))))),Hs=(e,t,o,n,r)=>((e,t)=>L(e,(e=>ke(e,t))))(e,r).bind((e=>ws(e,t,o).bind((e=>((e,t)=>yt(e,"table").bind((o=>xt(o,t).bind((t=>Rs(t,e).bind((e=>e.boxes.map((t=>({boxes:t,start:e.start,finish:e.finish}))))))))))(e,n))))),Is=(e,t)=>Bs(e,t),Ps=(e,t,o)=>Ls(e,t,o).bind((t=>{const o=t=>Te(e,t),n="thead,tfoot,tbody,table",r=yt(t.first,n,o),s=yt(t.last,n,o);return r.bind((e=>s.bind((o=>Te(e,o)?((e,t,o)=>{const n=Ss(e);return vs(n,t,o)})(t.table,t.first,t.last):C.none()))))})),Fs=p,zs=e=>{const t=(e,t)=>ye(e,t).exists((e=>parseInt(e,10)>1));return e.length>0&&F(e,(e=>t(e,"rowspan")||t(e,"colspan")))?C.some(e):C.none()},Vs=(e,t,o)=>t.length<=1?C.none():Ps(e,o.firstSelectedSelector,o.lastSelectedSelector).map((e=>({bounds:e,cells:t}))),Zs="data-mce-selected",Us="td["+Zs+"],th["+Zs+"]",js="["+Zs+"]",Ws="data-mce-first-selected",$s="td["+Ws+"],th["+Ws+"]",qs="data-mce-last-selected",Gs="td["+qs+"],th["+qs+"]",Ks=js,Ys={selected:Zs,selectedSelector:Us,firstSelected:Ws,firstSelectedSelector:$s,lastSelected:qs,lastSelectedSelector:Gs},Xs=(e,t,o)=>({element:o,mergable:Vs(t,e,Ys),unmergable:zs(e),selection:Fs(e)}),Js=e=>(t,o)=>{const n=se(t),r="col"===n||"colgroup"===n?Xt(s=t).bind((e=>Is(e,Ys.firstSelectedSelector))).fold(h(s),(e=>e[0])):t;var s;return Ct(r,e,o)},Qs=Js("th,td,caption"),ea=Js("th,td"),ta=e=>{return t=e.model.table.getSelectedCells(),A(t,Se.fromDom);var t},oa=(e,t)=>{e.on("BeforeGetContent",(t=>{const o=o=>{t.preventDefault(),(e=>Xt(e[0]).map((e=>{const t=vr(e,Ks);return as(t),[t]})))(o).each((o=>{t.content="text"===t.format?(e=>A(e,(e=>e.dom.innerText)).join(""))(o):((e,t)=>A(t,(t=>e.selection.serializer.serialize(t.dom,{}))).join(""))(e,o)}))};if(!0===t.selection){const t=(e=>N(ta(e),(e=>ke(e,Ys.selectedSelector))))(e);t.length>=1&&o(t)}})),e.on("BeforeSetContent",(o=>{if(!0===o.selection&&!0===o.paste){const n=ta(e);Z(n).each((n=>{Xt(n).each((r=>{const s=N(((e,t)=>{const o=document.createElement("div");return o.innerHTML=e,Ie(Se.fromDom(o))})(o.content),(e=>"meta"!==se(e))),a=he("table");if(Xr(e)&&1===s.length&&a(s[0])){o.preventDefault();const a=Se.fromDom(e.getDoc()),i=Hr(a),l=((e,t,o)=>({element:e,clipboard:t,generators:o}))(n,s[0],i);t.pasteCells(r,l).each((()=>{e.focus()}))}}))}))}}))},na=(e,t)=>({element:e,offset:t}),ra=(e,t,o)=>e.property().isText(t)&&0===e.property().getText(t).trim().length||e.property().isComment(t)?o(t).bind((t=>ra(e,t,o).orThunk((()=>C.some(t))))):C.none(),sa=(e,t)=>{if(e.property().isText(t))return e.property().getText(t).length;return e.property().children(t).length},aa=(e,t)=>{const o=ra(e,t,e.query().prevSibling).getOr(t);if(e.property().isText(o))return na(o,sa(e,o));const n=e.property().children(o);return n.length>0?aa(e,n[n.length-1]):na(o,sa(e,o))},ia=aa,la=_s(),ca=(e,t)=>{if(!Zt(e)){const o=(e=>Gn(e).bind((e=>Hn(e,["fixed","relative","empty"]))))(e);o.each((o=>{const n=o.value/2;Jn(e,n,o.unit),Jn(t,n,o.unit)}))}},da=e=>A(e,h(0)),ma=(e,t,o,n,r)=>r(e.slice(0,t)).concat(n).concat(r(e.slice(o))),ua=e=>(t,o,n,r)=>{if(e(n)){const e=Math.max(r,t[o]-Math.abs(n)),s=Math.abs(e-t[o]);return n>=0?s:-s}return n},ga=ua((e=>e<0)),ha=ua(x),pa=()=>{const e=(e,t,o,n)=>{const r=(100+o)/100,s=Math.max(n,(e[t]+o)/r);return A(e,((e,o)=>(o===t?s:e/r)-e))},t=(t,o,n,r,s,a)=>a?e(t,o,r,s):((e,t,o,n,r)=>{const s=ga(e,t,n,r);return ma(e,t,o+1,[s,0],da)})(t,o,n,r,s);return{resizeTable:(e,t)=>e(t),clampTableDelta:ga,calcLeftEdgeDeltas:t,calcMiddleDeltas:(e,o,n,r,s,a,i)=>t(e,n,r,s,a,i),calcRightEdgeDeltas:(t,o,n,r,s,a)=>{if(a)return e(t,n,r,s);{const e=ga(t,n,r,s);return da(t.slice(0,n)).concat([e])}},calcRedestributedWidths:(e,t,o,n)=>{if(n){const n=(t+o)/t,r=A(e,(e=>e/n));return{delta:100*n-100,newSizes:r}}return{delta:o,newSizes:e}}}},fa=()=>{const e=(e,t,o,n,r)=>{const s=ha(e,n>=0?o:t,n,r);return ma(e,t,o+1,[s,-s],da)};return{resizeTable:(e,t,o)=>{o&&e(t)},clampTableDelta:(e,t,o,n,r)=>{if(r){if(o>=0)return o;{const t=B(e,((e,t)=>e+t-n),0);return Math.max(-t,o)}}return ga(e,t,o,n)},calcLeftEdgeDeltas:e,calcMiddleDeltas:(t,o,n,r,s,a)=>e(t,n,r,s,a),calcRightEdgeDeltas:(e,t,o,n,r,s)=>{if(s)return da(e);{const t=n/e.length;return A(e,h(t))}},calcRedestributedWidths:(e,t,o,n)=>({delta:0,newSizes:e})}},va=e=>rn.fromTable(e).grid,ba=he("th"),ya=e=>F(e,(e=>ba(e.element))),wa=(e,t)=>e&&t?"sectionCells":e?"section":"cells",xa=e=>{const t="thead"===e.section,o=St(Ca(e.cells),"th");return"tfoot"===e.section?{type:"footer"}:t||o?{type:"header",subType:wa(t,o)}:{type:"body"}},Ca=e=>{const t=N(e,(e=>ba(e.element)));return 0===t.length?C.some("td"):t.length===e.length?C.some("th"):C.none()},Sa=(e,t,o)=>ot(o(e.element,t),!0,e.isLocked),ka=(e,t)=>e.section!==t?nt(e.element,e.cells,t,e.isNew):e,_a=()=>({transformRow:ka,transformCell:(e,t,o)=>{const n=o(e.element,t),r="td"!==se(n)?((e,t)=>{const o=Je(e,t);ze(e,o);const n=Ie(e);return We(o,n),qe(e),o})(n,"td"):n;return ot(r,e.isNew,e.isLocked)}}),Ea=()=>({transformRow:ka,transformCell:Sa}),Ta=()=>({transformRow:(e,t)=>ka(e,"thead"===t?"tbody":t),transformCell:Sa}),Oa=(e,t)=>{const o=(e=>j(e.all,(e=>{const t=xa(e);return"header"===t.type?C.from(t.subType):C.none()})))(rn.fromTable(e)).getOr(t);switch(o){case"section":return _a();case"sectionCells":return Ea();case"cells":return Ta()}},Aa=_a,Da=Ea,Ma=Ta,Na=()=>({transformRow:p,transformCell:Sa}),Ra=(e,t,o,n)=>{o===n?we(e,t):fe(e,t,o)},Ba=(e,t,o)=>{U(ht(e,t)).fold((()=>Ve(e,o)),(e=>ze(e,o)))},La=(e,t)=>{const o=[],n=[],r=e=>A(e,(e=>{e.isNew&&o.push(e.element);const t=e.element;return $e(t),D(e.cells,(e=>{e.isNew&&n.push(e.element),Ra(e.element,"colspan",e.colspan,1),Ra(e.element,"rowspan",e.rowspan,1),Ze(t,e.element)})),t})),s=e=>P(e,(e=>A(e.cells,(e=>(Ra(e.element,"span",e.colspan,1),e.element))))),a=(t,o)=>{const n=((e,t)=>{const o=wt(e,t).getOrThunk((()=>{const o=Se.fromTag(t,De(e).dom);return"thead"===t?Ba(e,"caption,colgroup",o):"colgroup"===t?Ba(e,"caption",o):Ze(e,o),o}));return $e(o),o})(e,o),a=("colgroup"===o?s:r)(t);We(n,a)},i=(t,o)=>{t.length>0?a(t,o):(t=>{wt(e,t).each(qe)})(o)},l=[],c=[],d=[],m=[];return D(t,(e=>{switch(e.section){case"thead":l.push(e);break;case"tbody":c.push(e);break;case"tfoot":d.push(e);break;case"colgroup":m.push(e)}})),i(m,"colgroup"),i(l,"thead"),i(c,"tbody"),i(d,"tfoot"),{newRows:o,newCells:n}},Ha=(e,t)=>{if(0===e.length)return 0;const o=e[0];return H(e,(e=>!t(o.element,e.element))).getOr(e.length)},Ia=(e,t,o,n)=>{const r=((e,t)=>e[t])(e,t),s="colgroup"===r.section,a=Ha(r.cells.slice(o),n),i=s?1:Ha(((e,t)=>A(e,(e=>qo(e,t))))(e.slice(t),o),n);return{colspan:a,rowspan:i}},Pa=(e,t)=>{const o=A(e,(e=>A(e.cells,w)));return A(e,((n,r)=>{const s=P(n.cells,((n,s)=>{if(!1===o[r][s]){const d=Ia(e,r,s,t);return((e,t,n,r)=>{for(let s=e;s({element:e,cells:t,section:o,isNew:n}))(n.element,s,n.section,n.isNew)}))},Fa=(e,t,o)=>{const n=[];D(e.colgroups,(r=>{const s=[];for(let n=0;not(e.element,o,!1))).getOrThunk((()=>ot(t.colGap(),!0,!1)));s.push(r)}n.push(nt(r.element,s,"colgroup",o))}));for(let r=0;rot(e.element,o,e.isLocked))).getOrThunk((()=>ot(t.gap(),!0,!1)));s.push(a)}const a=e.all[r],i=nt(a.element,s,a.section,o);n.push(i)}return n},za=e=>Pa(e,Te),Va=(e,t)=>j(e.all,(e=>L(e.cells,(e=>Te(t,e.element))))),Za=(e,t,o)=>{const n=A(t.selection,(t=>Gt(t).bind((t=>Va(e,t))).filter(o))),r=kt(n);return _t(r.length>0,r)},Ua=(e,t,o,n,r)=>(s,a,i,l)=>{const c=rn.fromTable(s),d=C.from(null==l?void 0:l.section).getOrThunk(Na);return t(c,a).map((t=>{const o=((e,t)=>Fa(e,t,!1))(c,i),n=e(o,t,Te,r(i),d),s=en(n.grid);return{info:t,grid:za(n.grid),cursor:n.cursor,lockedColumns:s}})).bind((e=>{const t=La(s,e.grid),r=C.from(null==l?void 0:l.sizing).getOrThunk((()=>gr(s))),a=C.from(null==l?void 0:l.resize).getOrThunk(fa);return o(s,e.grid,e.info,{sizing:r,resize:a,section:d}),n(s),we(s,Jo),e.lockedColumns.length>0&&fe(s,Jo,e.lockedColumns.join(",")),C.some({cursor:e.cursor,newRows:t.newRows,newCells:t.newCells})}))},ja=(e,t)=>Za(e,t,x).map((e=>({cells:e,generators:t.generators,clipboard:t.clipboard}))),Wa=(e,t)=>Za(e,t,x),$a=(e,t)=>Za(e,t,(e=>!e.isLocked)),qa=(e,t)=>F(t,(t=>((e,t)=>Va(e,t).exists((e=>!e.isLocked)))(e,t))),Ga=(e,t,o,n)=>{const r=Yo(e).rows;let s=!0;for(let e=0;e{const r=Yo(e).rows;if(t>0&&tB(e,((e,o)=>T(e,(e=>t(e.element,o.element)))?e:e.concat([o])),[]))(r[t-1].cells,o);D(e,(e=>{let s=C.none();for(let a=t;a{Wo(i,t,ot(e,!0,l.isLocked))})))}}))}return e},Ya=e=>{const t=t=>t(e),o=h(e),n=()=>r,r={tag:!0,inner:e,fold:(t,o)=>o(e),isValue:x,isError:w,map:t=>Ja.value(t(e)),mapError:n,bind:t,exists:t,forall:t,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:t=>{t(e)},toOptional:()=>C.some(e)};return r},Xa=e=>{const t=()=>o,o={tag:!1,inner:e,fold:(t,o)=>t(e),isValue:w,isError:x,map:t,mapError:t=>Ja.error(t(e)),bind:t,exists:w,forall:x,getOr:p,or:p,getOrThunk:y,orThunk:y,getOrDie:(n=String(e),()=>{throw new Error(n)}),each:g,toOptional:C.none};var n;return o},Ja={value:Ya,error:Xa,fromOption:(e,t)=>e.fold((()=>Xa(t)),Ya)},Qa=(e,t)=>({rowDelta:0,colDelta:Ko(e[0])-Ko(t[0])}),ei=(e,t)=>({rowDelta:e.length-t.length,colDelta:0}),ti=(e,t,o,n)=>{const r="colgroup"===t.section?o.col:o.cell;return O(e,(e=>ot(r(),!0,n(e))))},oi=(e,t,o,n)=>{const r=e[e.length-1];return e.concat(O(t,(()=>{const e="colgroup"===r.section?o.colgroup:o.row,t=Xo(r,e,p),s=ti(t.cells.length,t,o,(e=>Q(n,e.toString())));return $o(t,s)})))},ni=(e,t,o,n)=>A(e,(e=>{const r=ti(t,e,o,w);return Uo(e,n,r)})),ri=(e,t,o)=>{const n=t.colDelta<0?ni:p,r=t.rowDelta<0?oi:p,s=en(e),a=Ko(e[0]),i=T(s,(e=>e===a-1)),l=n(e,Math.abs(t.colDelta),o,i?a-1:a),c=en(l);return r(l,Math.abs(t.rowDelta),o,z(c,x))},si=(e,t,o,n)=>{const r=v(n,qo(e[t],o).element),s=e[t];return e.length>1&&Ko(s)>1&&(o>0&&r(Go(s,o-1))||o0&&r(Go(e[t-1],o))||tN(o,(o=>o>=e.column&&o<=Ko(t[0])+e.column)),ii=(e,t,o,n,r)=>{const s=en(t),a=((e,t,o)=>{const n=Ko(t[0]),r=Yo(t).cols.length+e.row,s=O(n-e.column,(t=>t+e.column)),a=L(s,(e=>F(o,(t=>t!==e)))).getOr(n-1);return{row:r,column:a}})(e,t,s),i=Yo(o).rows,l=ai(a,i,s),c=((e,t,o)=>{if(e.row>=t.length||e.column>Ko(t[0]))return Ja.error("invalid start address out of table bounds, row: "+e.row+", column: "+e.column);const n=t.slice(e.row),r=n[0].cells.slice(e.column),s=Ko(o[0]),a=o.length;return Ja.value({rowDelta:n.length-a,colDelta:r.length-s})})(a,t,i);return c.map((e=>{const o={...e,colDelta:e.colDelta-l.length},s=ri(t,o,n),c=en(s),d=ai(a,i,c);return((e,t,o,n,r,s)=>{const a=e.row,i=e.column,l=a+o.length,c=i+Ko(o[0])+s.length,d=z(s,x);for(let e=a;e{((e,t,o,n)=>{t>0&&t{const r=e.cells[t-1];let s=0;const a=n();for(;e.cells.length>t+s&&o(r.element,e.cells[t+s].element);)Wo(e,t+s,ot(a,!0,e.cells[t+s].isLocked)),s++}))})(t,e,r,n.cell);const s=ei(o,t),a=ri(o,s,n),i=ei(t,a),l=ri(t,i,n);return A(l,((t,o)=>Uo(t,e,a[o].cells)))},ci=(e,t,o,n,r)=>{Ka(t,e,r,n.cell);const s=en(t),a=Qa(t,o),i={...a,colDelta:a.colDelta-s.length},l=ri(t,i,n),{cols:c,rows:d}=Yo(l),m=en(l),u=Qa(o,t),g={...u,colDelta:u.colDelta+m.length},h=((e,t,o)=>A(e,(e=>B(o,((o,n)=>{const r=ti(1,e,t,x)[0];return jo(o,n,r)}),e))))(o,n,m),p=ri(h,g,n);return[...c,...d.slice(0,e),...p,...d.slice(e,d.length)]},di=(e,t,o,n,r)=>{const{rows:s,cols:a}=Yo(e),i=s.slice(0,t),l=s.slice(t),c=((e,t,o,n)=>Xo(e,(e=>n(e,o)),t))(s[o],((e,o)=>t>0&&tA(e,(e=>{const s=t>0&&t{if("colgroup"!==o&&n)return qo(e,t);{const t=qo(e,r);return ot(a(t.element,s),!0,!1)}})(e,t,e.section,s,o,n,r);return jo(e,t,a)})),ui=(e,t,o,n)=>((e,t,o,n)=>void 0!==Go(e[t],o)&&t>0&&n(Go(e[t-1],o),Go(e[t],o)))(e,t,o,n)||((e,t,o)=>t>0&&o(Go(e,t-1),Go(e,t)))(e[t],o,n),gi=(e,t,o,n)=>{const r=e=>"row"===e?(e=>Vt(e,"rowspan")>1)(t):Zt(t),s=e=>r(e)?`${e}group`:e;if(e)return ba(t)?s(o):null;if(n&&ba(t)){return s("row"===o?"col":"row")}return null},hi=(e,t,o)=>ot(o(e.element,t),!0,e.isLocked),pi=(e,t,o,n,r,s,a)=>A(e,((e,i)=>((e,t)=>{const o=e.cells,n=A(o,t);return nt(e.element,n,e.section,e.isNew)})(e,((e,l)=>{if((e=>T(t,(t=>o(e.element,t.element))))(e)){const t=a(e,i,l)?r(e,o,n):e;return s(t,i,l).each((e=>{var o,n;o=t.element,n={scope:C.from(e)},q(n,((e,t)=>{e.fold((()=>{we(o,t)}),(e=>{pe(o.dom,t,e)}))}))})),t}return e})))),fi=(e,t,o)=>P(e,((n,r)=>ui(e,r,t,o)?[]:[qo(n,t)])),vi=(e,t,o,n,r)=>{const s=Yo(e).rows,a=P(t,(e=>fi(s,e,n))),i=A(s,(e=>ya(e.cells))),l=((e,t)=>F(t,p)&&ya(e)?x:(e,o,n)=>!("th"===se(e.element)&&t[o]))(a,i),c=((e,t)=>(o,n)=>C.some(gi(e,o.element,"row",t[n])))(o,i);return pi(e,a,n,r,hi,c,l)},bi=(e,t,o,n,r,s,a)=>{const{cols:i,rows:l}=Yo(e),c=l[t[0]],d=P(t,(e=>((e,t,o)=>{const n=e[t];return P(n.cells,((n,r)=>ui(e,t,r,o)?[]:[n]))})(l,e,r))),m=A(c.cells,((e,t)=>ya(fi(l,t,r)))),u=[...l];D(t,(e=>{u[e]=a.transformRow(l[e],o)}));const g=[...i,...u],h=((e,t)=>F(t,p)&&ya(e.cells)?x:(e,o,n)=>!("th"===se(e.element)&&t[n]))(c,m),f=((e,t)=>(o,n,r)=>C.some(gi(e,o.element,"col",t[r])))(n,m);return pi(g,d,r,s,a.transformCell,f,h)},yi=(e,t,o,n)=>{const r=Yo(e).rows,s=A(t,(e=>qo(r[e.row],e.column)));return pi(e,s,o,n,hi,C.none,x)},wi=e=>{if(!a(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],o={};return D(e,((n,r)=>{const s=W(n);if(1!==s.length)throw new Error("one and only one name per case");const i=s[0],l=n[i];if(void 0!==o[i])throw new Error("duplicate key detected:"+i);if("cata"===i)throw new Error("cannot have a case named cata (sorry)");if(!a(l))throw new Error("case arguments must be an array");t.push(i),o[i]=(...o)=>{const n=o.length;if(n!==l.length)throw new Error("Wrong number of arguments to case "+i+". Expected "+l.length+" ("+l+"), got "+n);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[r].apply(null,o)},match:e=>{const n=W(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));if(!F(t,(e=>E(n,e))))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[i].apply(null,o)},log:e=>{console.log(e,{constructors:t,constructor:i,params:o})}}}})),o},xi={...wi([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])},Ci=(e,t,o,n,r)=>{const s=e.slice(0),a=((e,t)=>0===e.length?xi.none():1===e.length?xi.only(0):0===t?xi.left(0,1):t===e.length-1?xi.right(t-1,t):t>0&&tn.singleColumnWidth(s[e],o)),((e,t)=>r.calcLeftEdgeDeltas(s,e,t,o,n.minCellWidth(),n.isRelative)),((e,t,a)=>r.calcMiddleDeltas(s,e,t,a,o,n.minCellWidth(),n.isRelative)),((e,t)=>r.calcRightEdgeDeltas(s,e,t,o,n.minCellWidth(),n.isRelative)))},Si=(e,t)=>rn.hasColumns(e)?((e,t)=>{const o=rn.justColumns(e);return A(o,((e,o)=>({element:e.element,width:t[o],colspan:e.colspan})))})(e,t):((e,t)=>{const o=rn.justCells(e);return A(o,(e=>{const o=((e,t,o)=>{let n=0;for(let r=e;r{const n=Si(e,t);D(n,(e=>{o.setElementWidth(e.element,e.width)}))},_i=(e,t,o,n,r)=>{const s=rn.fromTable(e),a=r.getCellDelta(t),i=r.getWidths(s,r),l=o===s.grid.columns-1,c=n.clampTableDelta(i,o,a,r.minCellWidth(),l),d=Ci(i,o,c,r,n),m=A(d,((e,t)=>e+i[t]));ki(s,m,r),n.resizeTable(r.adjustTableWidth,c,l)},Ei=(e,t,o)=>{const n=rn.fromTable(e),r=((e,t)=>lr(e,t,Xn,(e=>e.getOrThunk(Wt))))(n,e),s=A(r,((e,n)=>o===n?Math.max(t+e,Wt()):e)),a=((e,t)=>A(e.all,((e,o)=>({element:e.element,height:t[o]}))))(n,s);D(a,(e=>{jn(e.element,e.height)})),D(rn.justCells(n),(e=>{(e=>{Ft(e,"height")})(e.element)}));const i=R(s,((e,t)=>e+t),0);jn(e,i)},Ti=e=>B(e,((e,t)=>T(e,(e=>e.column===t.column))?e:e.concat([t])),[]).sort(((e,t)=>e.column-t.column)),Oi=he("col"),Ai=he("colgroup"),Di=e=>"tr"===se(e)||Ai(e),Mi=e=>({element:e,colspan:zt(e,"colspan",1),rowspan:zt(e,"rowspan",1)}),Ni=e=>ye(e,"scope").map((e=>e.substr(0,3))),Ri=(e,t=Mi)=>{const o=o=>{if(Di(o))return Ai((r={element:o}).element)?e.colgroup(r):e.row(r);{const r=o,s=(t=>Oi(t.element)?e.col(t):e.cell(t))(t(r));return n=C.some({item:r,replacement:s}),s}var r};let n=C.none();return{getOrInit:(e,t)=>n.fold((()=>o(e)),(n=>t(e,n.item)?n.replacement:o(e)))}},Bi=e=>t=>{const o=[],n=n=>{const r="td"===e?{scope:null}:{},s=t.replace(n,e,r);return o.push({item:n,sub:s}),s};return{replaceOrInit:(e,t)=>{if(Di(e)||Oi(e))return e;{const r=e;return((e,t)=>L(o,(o=>t(o.item,e))))(r,t).fold((()=>n(r)),(o=>t(e,o.item)?o.sub:n(r)))}}}},Li=e=>({unmerge:t=>{const o=Ni(t);return o.each((e=>fe(t,"scope",e))),()=>{const n=e.cell({element:t,colspan:1,rowspan:1});return Ft(n,"width"),Ft(t,"width"),o.each((e=>fe(n,"scope",e))),n}},merge:e=>(Ft(e[0],"width"),(()=>{const t=kt(A(e,Ni));if(0===t.length)return C.none();{const e=t[0],o=["row","col"];return T(t,(t=>t!==e&&E(o,t)))?C.none():C.from(e)}})().fold((()=>we(e[0],"scope")),(t=>fe(e[0],"scope",t+"group"))),h(e[0]))}),Hi=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Ii=_s(),Pi=e=>((e,t)=>{const o=e.property().name(t);return E(Hi,o)})(Ii,e),Fi=e=>((e,t)=>{const o=e.property().name(t);return E(["ol","ul"],o)})(Ii,e),zi=e=>((e,t)=>E(["br","img","hr","input"],e.property().name(t)))(Ii,e),Vi=e=>{const t=he("br"),o=e=>Er(e).bind((o=>{const n=He(o).map((e=>!!Pi(e)||!!zi(e)&&"img"!==se(e))).getOr(!1);return Ne(o).map((r=>!0===n||(e=>"li"===se(e)||vt(e,Fi).isSome())(r)||t(o)||Pi(r)&&!Te(e,r)?[]:[Se.fromTag("br")]))})).getOr([]),n=(()=>{const n=P(e,(e=>{const n=Ie(e);return(e=>F(e,(e=>t(e)||me(e)&&0===yr(e).trim().length)))(n)?[]:n.concat(o(e))}));return 0===n.length?[Se.fromTag("br")]:n})();$e(e[0]),We(e[0],n)},Zi=e=>os(e,!0),Ui=e=>{0===Kt(e).length&&qe(e)},ji=(e,t)=>({grid:e,cursor:t}),Wi=(e,t,o)=>{var n,r;const s=Yo(e).rows;return C.from(null===(r=null===(n=s[t])||void 0===n?void 0:n.cells[o])||void 0===r?void 0:r.element).filter(Zi).orThunk((()=>(e=>j(e,(e=>j(e.cells,(e=>{const t=e.element;return _t(Zi(t),t)})))))(s)))},$i=(e,t,o)=>{const n=Wi(e,t,o);return ji(e,n)},qi=e=>B(e,((e,t)=>T(e,(e=>e.row===t.row))?e:e.concat([t])),[]).sort(((e,t)=>e.row-t.row)),Gi=(e,t)=>(o,n,r,s,a)=>{const i=qi(n),l=A(i,(e=>e.row)),c=bi(o,l,e,t,r,s.replaceOrInit,a);return $i(c,n[0].row,n[0].column)},Ki=Gi("thead",!0),Yi=Gi("tbody",!1),Xi=Gi("tfoot",!1),Ji=(e,t,o)=>{const n=((e,t)=>eo(e,(()=>t)))(e,o.section),r=rn.generate(n);return Fa(r,t,!0)},Qi=(e,t,o,n)=>((e,t,o,n)=>{const r=rn.generate(t),s=n.getWidths(r,n);ki(r,s,n)})(0,t,0,n.sizing),el=(e,t,o,n)=>((e,t,o,n,r)=>{const s=rn.generate(t),a=n.getWidths(s,n),i=n.pixelWidth(),{newSizes:l,delta:c}=r.calcRedestributedWidths(a,i,o.pixelDelta,n.isRelative);ki(s,l,n),n.adjustTableWidth(c)})(0,t,o,n.sizing,n.resize),tl=(e,t)=>T(t,(e=>0===e.column&&e.isLocked)),ol=(e,t)=>T(t,(t=>t.column+t.colspan>=e.grid.columns&&t.isLocked)),nl=(e,t)=>{const o=sn(e),n=Ti(t);return B(n,((e,t)=>e+o[t.column].map(zo).getOr(0)),0)},rl=e=>(t,o)=>Wa(t,o).filter((o=>!(e?tl:ol)(t,o))).map((e=>({details:e,pixelDelta:nl(t,e)}))),sl=e=>(t,o)=>ja(t,o).filter((o=>!(e?tl:ol)(t,o.cells))),al=Bi("th"),il=Bi("td"),ll=Ua(((e,t,o,n)=>{const r=t[0].row,s=qi(t),a=R(s,((e,t)=>({grid:di(e.grid,r,t.row+e.delta,o,n.getOrInit),delta:e.delta+1})),{grid:e,delta:0}).grid;return $i(a,r,t[0].column)}),Wa,g,g,Ri),cl=Ua(((e,t,o,n)=>{const r=qi(t),s=r[r.length-1],a=s.row+s.rowspan,i=R(r,((e,t)=>di(e,a,t.row,o,n.getOrInit)),e);return $i(i,a,t[0].column)}),Wa,g,g,Ri),dl=Ua(((e,t,o,n)=>{const r=t.details,s=Ti(r),a=s[0].column,i=R(s,((e,t)=>({grid:mi(e.grid,a,t.column+e.delta,o,n.getOrInit),delta:e.delta+1})),{grid:e,delta:0}).grid;return $i(i,r[0].row,a)}),rl(!0),el,g,Ri),ml=Ua(((e,t,o,n)=>{const r=t.details,s=r[r.length-1],a=s.column+s.colspan,i=Ti(r),l=R(i,((e,t)=>mi(e,a,t.column,o,n.getOrInit)),e);return $i(l,r[0].row,a)}),rl(!1),el,g,Ri),ul=Ua(((e,t,o,n)=>{const r=Ti(t.details),s=((e,t)=>P(e,(e=>{const o=e.cells,n=R(t,((e,t)=>t>=0&&t0?[nt(e.element,n,e.section,e.isNew)]:[]})))(e,A(r,(e=>e.column))),a=s.length>0?s[0].cells.length-1:0;return $i(s,r[0].row,Math.min(r[0].column,a))}),((e,t)=>$a(e,t).map((t=>({details:t,pixelDelta:-nl(e,t)})))),el,Ui,Ri),gl=Ua(((e,t,o,n)=>{const r=qi(t),s=((e,t,o)=>{const{rows:n,cols:r}=Yo(e);return[...r,...n.slice(0,t),...n.slice(o+1)]})(e,r[0].row,r[r.length-1].row),a=Math.max(Yo(s).rows.length-1,0);return $i(s,Math.min(t[0].row,a),t[0].column)}),Wa,g,Ui,Ri),hl=Ua(((e,t,o,n)=>{const r=Ti(t),s=A(r,(e=>e.column)),a=vi(e,s,!0,o,n.replaceOrInit);return $i(a,t[0].row,t[0].column)}),$a,g,g,al),pl=Ua(((e,t,o,n)=>{const r=Ti(t),s=A(r,(e=>e.column)),a=vi(e,s,!1,o,n.replaceOrInit);return $i(a,t[0].row,t[0].column)}),$a,g,g,il),fl=Ua(Ki,$a,g,g,al),vl=Ua(Yi,$a,g,g,il),bl=Ua(Xi,$a,g,g,il),yl=Ua(((e,t,o,n)=>{const r=yi(e,t,o,n.replaceOrInit);return $i(r,t[0].row,t[0].column)}),$a,g,g,al),wl=Ua(((e,t,o,n)=>{const r=yi(e,t,o,n.replaceOrInit);return $i(r,t[0].row,t[0].column)}),$a,g,g,il),xl=Ua(((e,t,o,n)=>{const r=t.cells;Vi(r);const s=((e,t,o,n)=>{const r=Yo(e).rows;if(0===r.length)return e;for(let e=t.startRow;e<=t.finishRow;e++)for(let o=t.startCol;o<=t.finishCol;o++){const t=r[e],s=qo(t,o).isLocked;Wo(t,o,ot(n(),!1,s))}return e})(e,t.bounds,0,n.merge(r));return ji(s,C.from(r[0]))}),((e,t)=>((e,t)=>t.mergable)(0,t).filter((t=>qa(e,t.cells)))),Qi,g,Li),Cl=Ua(((e,t,o,n)=>{const r=R(t,((e,t)=>Ga(e,t,o,n.unmerge(t))),e);return ji(r,C.from(t[0]))}),((e,t)=>((e,t)=>t.unmergable)(0,t).filter((t=>qa(e,t)))),Qi,g,Li),Sl=Ua(((e,t,o,n)=>{const r=((e,t)=>{const o=rn.fromTable(e);return Fa(o,t,!0)})(t.clipboard,t.generators),s=((e,t)=>({row:e,column:t}))(t.row,t.column);return ii(s,e,r,t.generators,o).fold((()=>ji(e,C.some(t.element))),(e=>$i(e,t.row,t.column)))}),((e,t)=>Gt(t.element).bind((o=>Va(e,o).map((e=>({...e,generators:t.generators,clipboard:t.clipboard})))))),Qi,g,Ri),kl=Ua(((e,t,o,n)=>{const r=Yo(e).rows,s=t.cells[0].column,a=r[t.cells[0].row],i=Ji(t.clipboard,t.generators,a),l=li(s,e,i,t.generators,o);return $i(l,t.cells[0].row,t.cells[0].column)}),sl(!0),g,g,Ri),_l=Ua(((e,t,o,n)=>{const r=Yo(e).rows,s=t.cells[t.cells.length-1].column+t.cells[t.cells.length-1].colspan,a=r[t.cells[0].row],i=Ji(t.clipboard,t.generators,a),l=li(s,e,i,t.generators,o);return $i(l,t.cells[0].row,s)}),sl(!1),g,g,Ri),El=Ua(((e,t,o,n)=>{const r=Yo(e).rows,s=t.cells[0].row,a=r[s],i=Ji(t.clipboard,t.generators,a),l=ci(s,e,i,t.generators,o);return $i(l,t.cells[0].row,t.cells[0].column)}),ja,g,g,Ri),Tl=Ua(((e,t,o,n)=>{const r=Yo(e).rows,s=t.cells[t.cells.length-1].row+t.cells[t.cells.length-1].rowspan,a=r[t.cells[0].row],i=Ji(t.clipboard,t.generators,a),l=ci(s,e,i,t.generators,o);return $i(l,s,t.cells[0].column)}),ja,g,g,Ri),Ol=(e,t)=>{const o=rn.fromTable(e);return Wa(o,t).bind((e=>{const t=e[e.length-1],n=e[0].column,r=t.column+t.colspan,s=I(A(o.all,(e=>N(e.cells,(e=>e.column>=n&&e.column{const o=rn.fromTable(e);return Wa(o,t).bind(Ca).getOr("")},Dl=(e,t)=>{const o=rn.fromTable(e);return Wa(o,t).bind((e=>{const t=e[e.length-1],n=e[0].row,r=t.row+t.rowspan;return(e=>{const t=A(e,(e=>xa(e).type)),o=E(t,"header"),n=E(t,"footer");if(o||n){const e=E(t,"body");return!o||e||n?o||e||!n?C.none():C.some("footer"):C.some("header")}return C.some("body")})(o.all.slice(n,r))})).getOr("")},Ml=(e,t)=>e.dispatch("NewRow",{node:t}),Nl=(e,t)=>e.dispatch("NewCell",{node:t}),Rl=(e,t,o)=>{e.dispatch("TableModified",{...o,table:t})},Bl={structure:!1,style:!0},Ll={structure:!0,style:!1},Hl={structure:!0,style:!0},Il=(e,t)=>$r(e)?pr(t):qr(e)?hr(t):gr(t),Pl=(e,t,o)=>{const n=e=>"table"===se(rs(e)),r=zr(e),s=jr(e)?g:ca,a=t=>{switch(Vr(e)){case"section":return Aa();case"sectionCells":return Da();case"cells":return Ma();default:return Oa(t,"section")}},i=(t,n)=>n.cursor.fold((()=>{const n=Kt(t);return Z(n).filter(dt).map((n=>{o.clearSelectedCells(t.dom);const r=e.dom.createRng();return r.selectNode(n.dom),e.selection.setRng(r),fe(n,"data-mce-selected","1"),r}))}),(n=>{const r=ia(la,n);const s=e.dom.createRng();return s.setStart(r.element.dom,r.offset),s.setEnd(r.element.dom,r.offset),e.selection.setRng(s),o.clearSelectedCells(t.dom),C.some(s)})),l=(o,n,s,l)=>(c,d,m=!1)=>{as(c);const u=Se.fromDom(e.getDoc()),g=Lr(s,u,r),h={sizing:Il(e,c),resize:jr(e)?pa():fa(),section:a(c)};return n(c)?o(c,d,g,h).bind((o=>{t.refresh(c.dom),D(o.newRows,(t=>{Ml(e,t.dom)})),D(o.newCells,(t=>{Nl(e,t.dom)}));const n=i(c,o);return dt(c)&&(as(c),m||Rl(e,c.dom,l)),n.map((e=>({rng:e,effect:l})))})):C.none()},c=l(gl,(t=>!n(e)||va(t).rows>1),g,Ll),d=l(ul,(t=>!n(e)||va(t).columns>1),g,Ll);return{deleteRow:c,deleteColumn:d,insertRowsBefore:l(ll,x,g,Ll),insertRowsAfter:l(cl,x,g,Ll),insertColumnsBefore:l(dl,x,s,Ll),insertColumnsAfter:l(ml,x,s,Ll),mergeCells:l(xl,x,g,Ll),unmergeCells:l(Cl,x,g,Ll),pasteColsBefore:l(kl,x,g,Ll),pasteColsAfter:l(_l,x,g,Ll),pasteRowsBefore:l(El,x,g,Ll),pasteRowsAfter:l(Tl,x,g,Ll),pasteCells:l(Sl,x,g,Hl),makeCellsHeader:l(yl,x,g,Ll),unmakeCellsHeader:l(wl,x,g,Ll),makeColumnsHeader:l(hl,x,g,Ll),unmakeColumnsHeader:l(pl,x,g,Ll),makeRowsHeader:l(fl,x,g,Ll),makeRowsBody:l(vl,x,g,Ll),makeRowsFooter:l(bl,x,g,Ll),getTableRowType:Dl,getTableCellType:Al,getTableColType:Ol}},Fl=(e,t,o)=>{const n=zt(e,t,1);1===o||n<=1?we(e,t):fe(e,t,Math.min(o,n))},zl=(e,t)=>o=>{const n=o.column+o.colspan-1,r=o.column;return n>=e&&r{const o=rn.fromTable(e);return $a(o,t).map((e=>{const t=e[e.length-1],n=e[0].column,r=t.column+t.colspan,s=((e,t,o)=>{if(rn.hasColumns(e)){const n=N(rn.justColumns(e),zl(t,o)),r=A(n,(e=>{const n=Xe(e.element);return Fl(n,"span",o-t),n})),s=Se.fromTag("colgroup");return We(s,r),[s]}return[]})(o,n,r),a=((e,t,o)=>A(e.all,(e=>{const n=N(e.cells,zl(t,o)),r=A(n,(e=>{const n=Xe(e.element);return Fl(n,"colspan",o-t),n})),s=Se.fromTag("tr");return We(s,r),s})))(o,n,r);return[...s,...a]}))},Zl=(e,t,o)=>{const n=rn.fromTable(e);return Wa(n,t).bind((e=>{const t=Fa(n,o,!1),r=Yo(t).rows.slice(e[0].row,e[e.length-1].row+e[e.length-1].rowspan),s=P(r,(e=>{const t=N(e.cells,(e=>!e.isLocked));return t.length>0?[{...e,cells:t}]:[]})),a=za(s);return _t(a.length>0,a)})).map((e=>(e=>A(e,(e=>{const t=Ye(e.element);return D(e.cells,(e=>{const o=Xe(e.element);Ra(o,"colspan",e.colspan,1),Ra(o,"rowspan",e.rowspan,1),Ze(t,o)})),t})))(e)))},Ul=wi([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),jl=(e,t,o)=>{const n=o.substring(0,o.length-e.length),r=parseFloat(n);return n===r.toString()?t(r):Ul.invalid(o)},Wl={...Ul,from:e=>At(e,"%")?jl("%",Ul.percent,e):At(e,"px")?jl("px",Ul.pixels,e):Ul.invalid(e)},$l=(e,t,o)=>e.fold((()=>t),(e=>((e,t,o)=>{const n=o/t;return A(e,(e=>Wl.from(e).fold((()=>e),(e=>e*n+"px"),(e=>e/100*o+"px"))))})(t,o,e)),(e=>((e,t)=>A(e,(e=>Wl.from(e).fold((()=>e),(e=>e/t*100+"%"),(e=>e+"%")))))(t,o))),ql=(e,t,o)=>{const n=Wl.from(o),r=F(e,(e=>"0px"===e))?((e,t)=>{const o=e.fold((()=>h("")),(e=>h(e/t+"px")),(()=>h(100/t+"%")));return O(t,o)})(n,e.length):$l(n,e,t);return Yl(r)},Gl=(e,t)=>0===e.length?t:R(e,((e,t)=>Wl.from(t).fold(h(0),p,p)+e),0),Kl=(e,t)=>Wl.from(e).fold(h(e),(e=>e+t+"px"),(e=>e+t+"%")),Yl=e=>{if(0===e.length)return e;const t=R(e,((e,t)=>{const o=Wl.from(t).fold((()=>({value:t,remainder:0})),(e=>((e,t)=>{const o=Math.floor(e);return{value:o+t,remainder:e-o}})(e,"px")),(e=>({value:e+"%",remainder:0})));return{output:[o.value].concat(e.output),remainder:e.remainder+o.remainder}}),{output:[],remainder:0}),o=t.output;return o.slice(0,o.length-1).concat([Kl(o[o.length-1],Math.round(t.remainder))])},Xl=Wl.from,Jl=(e,t,o)=>{const n=rn.fromTable(e),r=n.all,s=rn.justCells(n),a=rn.justColumns(n);t.each((t=>{const o=Xl(t).fold(h("px"),h("px"),h("%"));const r=Fo(e),i=((e,t)=>sr(e,t,or,ar))(n,e),l=ql(i,r,t);rn.hasColumns(n)?((e,t,o)=>{D(t,((t,n)=>{const r=Gl([e[n]],jt());Bt(t.element,"width",r+o)}))})(l,a,o):((e,t,o)=>{D(t,(t=>{const n=e.slice(t.column,t.colspan+t.column),r=Gl(n,jt());Bt(t.element,"width",r+o)}))})(l,s,o),Bt(e,"width",t)})),o.each((t=>{const o=gn(e),a=((e,t)=>lr(e,t,nr,ar))(n,e);((e,t,o)=>{D(o,(e=>{Ft(e.element,"height")})),D(t,((t,o)=>{Bt(t.element,"height",e[o])}))})(ql(a,o,t),r,s),Bt(e,"height",t)}))},Ql=e=>Gn(e).exists((e=>In.test(e))),ec=e=>Gn(e).exists((e=>Pn.test(e))),tc=e=>Gn(e).isNone(),oc=e=>{we(e,"width"),we(e,"height")},nc=e=>{const t=Qn(e);Jl(e,C.some(t),C.none()),oc(e)},rc=e=>{const t=(e=>Fo(e)+"px")(e);Jl(e,C.some(t),C.none()),oc(e)},sc=e=>{const t=(e=>gn(e)+"px")(e);Jl(e,C.none(),C.some(t)),oc(e)},ac=e=>{Ft(e,"width");const t=Yt(e),o=t.length>0?t:Kt(e);D(o,(e=>{Ft(e,"width"),oc(e)})),oc(e)},ic={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},lc=e=>{const t=Se.fromTag("colgroup");return O(e,(()=>Ze(t,Se.fromTag("col")))),t},cc=(e,t,o,n)=>O(e,(e=>((e,t,o,n)=>{const r=Se.fromTag("tr");for(let s=0;s{e.selection.select(t.dom,!0),e.selection.collapse(!0)},mc=(e,t,o,n,s)=>{const a=Qr(e),i={styles:a,attributes:Jr(e),colGroups:es(e)};return e.undoManager.ignore((()=>{const r=((e,t,o,n,r,s=ic)=>{const a=Se.fromTag("table"),i="cells"!==r;Lt(a,s.styles),ve(a,s.attributes),s.colGroups&&Ze(a,lc(t));const l=Math.min(e,o);if(i&&o>0){const e=Se.fromTag("thead");Ze(a,e);const s=cc(o,t,"sectionCells"===r?l:0,n);We(e,s)}const c=Se.fromTag("tbody");Ze(a,c);const d=cc(i?e-l:e,t,i?0:o,n);return We(c,d),a})(o,t,s,n,Vr(e),i);fe(r,"data-mce-id","__mce");const a=(e=>{const t=Se.fromTag("div"),o=Se.fromDom(e.dom.cloneNode(!0));return Ze(t,o),(e=>e.dom.innerHTML)(t)})(r);e.insertContent(a),e.addVisual()})),xt(rs(e),'table[data-mce-id="__mce"]').map((t=>(qr(e)?rc(t):Gr(e)?ac(t):($r(e)||(e=>r(e)&&-1!==e.indexOf("%"))(a.width))&&nc(t),as(t),we(t,"data-mce-id"),((e,t)=>{D(pt(t,"tr"),(t=>{Ml(e,t.dom),D(pt(t,"th,td"),(t=>{Nl(e,t.dom)}))}))})(e,t),((e,t)=>{xt(t,"td,th").each(v(dc,e))})(e,t),t.dom))).getOrNull()};var uc=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const gc="x-tinymce/dom-table-",hc=gc+"rows",pc=gc+"columns",fc=e=>{const t=uc.FakeClipboardItem(e);uc.write([t])},vc=e=>{var t;const o=null!==(t=uc.read())&&void 0!==t?t:[];return j(o,(t=>C.from(t.getType(e))))},bc=e=>{vc(e).isSome()&&uc.clear()},yc=e=>{e.fold(xc,(e=>fc({[hc]:e})))},wc=()=>vc(hc),xc=()=>bc(hc),Cc=e=>{e.fold(kc,(e=>fc({[pc]:e})))},Sc=()=>vc(pc),kc=()=>bc(pc),_c=e=>Qs(is(e),ss(e)).filter(gs),Ec=(e,t)=>{const o=ss(e),n=e=>Xt(e,o),a=t=>(e=>ea(is(e),ss(e)).filter(gs))(e).bind((e=>n(e).map((o=>t(o,e))))),i=t=>{e.focus()},l=(t,o=!1)=>a(((n,r)=>{const s=Xs(ta(e),n,r);t(n,s,o).each(i)})),c=()=>a(((t,o)=>{const n=Xs(ta(e),t,o),r=Lr(g,Se.fromDom(e.getDoc()),C.none());return Zl(t,n,r)})),d=()=>a(((t,o)=>{const n=Xs(ta(e),t,o);return Vl(t,n)})),m=(t,o)=>o().each((o=>{const n=A(o,(e=>Xe(e)));a(((o,r)=>{const s=Hr(Se.fromDom(e.getDoc())),a=((e,t,o,n)=>({selection:Fs(e),clipboard:o,generators:n}))(ta(e),0,n,s);t(o,a).each(i)}))})),h=e=>(t,o)=>((e,t)=>Q(e,t)?C.from(e[t]):C.none())(o,"type").each((t=>{l(e(t),o.no_events)}));q({mceTableSplitCells:()=>l(t.unmergeCells),mceTableMergeCells:()=>l(t.mergeCells),mceTableInsertRowBefore:()=>l(t.insertRowsBefore),mceTableInsertRowAfter:()=>l(t.insertRowsAfter),mceTableInsertColBefore:()=>l(t.insertColumnsBefore),mceTableInsertColAfter:()=>l(t.insertColumnsAfter),mceTableDeleteCol:()=>l(t.deleteColumn),mceTableDeleteRow:()=>l(t.deleteRow),mceTableCutCol:()=>d().each((e=>{Cc(e),l(t.deleteColumn)})),mceTableCutRow:()=>c().each((e=>{yc(e),l(t.deleteRow)})),mceTableCopyCol:()=>d().each((e=>Cc(e))),mceTableCopyRow:()=>c().each((e=>yc(e))),mceTablePasteColBefore:()=>m(t.pasteColsBefore,Sc),mceTablePasteColAfter:()=>m(t.pasteColsAfter,Sc),mceTablePasteRowBefore:()=>m(t.pasteRowsBefore,wc),mceTablePasteRowAfter:()=>m(t.pasteRowsAfter,wc),mceTableDelete:()=>_c(e).each((t=>{Xt(t,o).filter(b(o)).each((t=>{const o=Se.fromText("");if(ze(t,o),qe(t),e.dom.isEmpty(e.getBody()))e.setContent(""),e.selection.setCursorLocation();else{const t=e.dom.createRng();t.setStart(o.dom,0),t.setEnd(o.dom,0),e.selection.setRng(t),e.nodeChanged()}}))})),mceTableCellToggleClass:(t,o)=>{a((t=>{const n=ta(e),r=F(n,(t=>e.formatter.match("tablecellclass",{value:o},t.dom))),s=r?e.formatter.remove:e.formatter.apply;D(n,(e=>s("tablecellclass",{value:o},e.dom))),Rl(e,t.dom,Bl)}))},mceTableToggleClass:(t,o)=>{a((t=>{e.formatter.toggle("tableclass",{value:o},t.dom),Rl(e,t.dom,Bl)}))},mceTableToggleCaption:()=>{_c(e).each((t=>{Xt(t,o).each((o=>{wt(o,"caption").fold((()=>{const t=Se.fromTag("caption");Ze(t,Se.fromText("Caption")),((e,t,o)=>{Pe(e,o).fold((()=>{Ze(e,t)}),(e=>{Fe(e,t)}))})(o,t,0),e.selection.setCursorLocation(t.dom,0)}),(n=>{he("caption")(t)&&Ee("td",o).each((t=>e.selection.setCursorLocation(t.dom,0))),qe(n)})),Rl(e,o.dom,Ll)}))}))},mceTableSizingMode:(t,n)=>(t=>_c(e).each((n=>{Gr(e)||qr(e)||$r(e)||Xt(n,o).each((o=>{"relative"!==t||Ql(o)?"fixed"!==t||ec(o)?"responsive"!==t||tc(o)||ac(o):rc(o):nc(o),as(o),Rl(e,o.dom,Ll)}))})))(n),mceTableCellType:h((e=>"th"===e?t.makeCellsHeader:t.unmakeCellsHeader)),mceTableColType:h((e=>"th"===e?t.makeColumnsHeader:t.unmakeColumnsHeader)),mceTableRowType:h((e=>{switch(e){case"header":return t.makeRowsHeader;case"footer":return t.makeRowsFooter;default:return t.makeRowsBody}}))},((t,o)=>e.addCommand(o,t))),e.addCommand("mceInsertTable",((t,o)=>{((e,t,o,n={})=>{const r=e=>u(e)&&e>0;if(r(t)&&r(o)){const r=n.headerRows||0,s=n.headerColumns||0;return mc(e,o,t,s,r)}console.error("Invalid values for mceInsertTable - rows and columns values are required to insert a table.")})(e,o.rows,o.columns,o.options)})),e.addCommand("mceTableApplyCellStyle",((t,o)=>{const a=e=>"tablecell"+e.toLowerCase().replace("-","");if(!s(o))return;const i=N(ta(e),gs);if(0===i.length)return;const l=Y(o,((t,o)=>e.formatter.has(a(o))&&r(t)));(e=>{for(const t in e)if($.call(e,t))return!1;return!0})(l)||(q(l,((t,o)=>{const n=a(o);D(i,(o=>{""===t?e.formatter.remove(n,{value:null},o.dom,!0):e.formatter.apply(n,{value:t},o.dom)}))})),n(i[0]).each((t=>Rl(e,t.dom,Bl))))}))},Tc=wi([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Oc={before:Tc.before,on:Tc.on,after:Tc.after,cata:(e,t,o,n)=>e.fold(t,o,n),getStart:e=>e.fold(p,p,p)},Ac=(e,t)=>({selection:e,kill:t}),Dc=(e,t)=>{const o=e.document.createRange();return o.selectNode(t.dom),o},Mc=(e,t)=>{const o=e.document.createRange();return Nc(o,t),o},Nc=(e,t)=>e.selectNodeContents(t.dom),Rc=(e,t,o)=>{const n=e.document.createRange();var r;return r=n,t.fold((e=>{r.setStartBefore(e.dom)}),((e,t)=>{r.setStart(e.dom,t)}),(e=>{r.setStartAfter(e.dom)})),((e,t)=>{t.fold((t=>{e.setEndBefore(t.dom)}),((t,o)=>{e.setEnd(t.dom,o)}),(t=>{e.setEndAfter(t.dom)}))})(n,o),n},Bc=(e,t,o,n,r)=>{const s=e.document.createRange();return s.setStart(t.dom,o),s.setEnd(n.dom,r),s},Lc=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}),Hc=wi([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Ic=(e,t,o)=>t(Se.fromDom(o.startContainer),o.startOffset,Se.fromDom(o.endContainer),o.endOffset),Pc=(e,t)=>{const o=((e,t)=>t.match({domRange:e=>({ltr:h(e),rtl:C.none}),relative:(t,o)=>({ltr:no((()=>Rc(e,t,o))),rtl:no((()=>C.some(Rc(e,o,t))))}),exact:(t,o,n,r)=>({ltr:no((()=>Bc(e,t,o,n,r))),rtl:no((()=>C.some(Bc(e,n,r,t,o))))})}))(e,t);return((e,t)=>{const o=t.ltr();if(o.collapsed)return t.rtl().filter((e=>!1===e.collapsed)).map((e=>Hc.rtl(Se.fromDom(e.endContainer),e.endOffset,Se.fromDom(e.startContainer),e.startOffset))).getOrThunk((()=>Ic(0,Hc.ltr,o)));return Ic(0,Hc.ltr,o)})(0,o)},Fc=(e,t)=>Pc(e,t).match({ltr:(t,o,n,r)=>{const s=e.document.createRange();return s.setStart(t.dom,o),s.setEnd(n.dom,r),s},rtl:(t,o,n,r)=>{const s=e.document.createRange();return s.setStart(n.dom,r),s.setEnd(t.dom,o),s}});Hc.ltr,Hc.rtl;const zc=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n}),Vc=(e,t,o,n)=>({start:Oc.on(e,t),finish:Oc.on(o,n)}),Zc=(e,t)=>{const o=Fc(e,t);return zc(Se.fromDom(o.startContainer),o.startOffset,Se.fromDom(o.endContainer),o.endOffset)},Uc=Vc,jc=(e,t,o,n,r)=>Te(o,n)?C.none():Rs(o,n,t).bind((t=>{const n=t.boxes.getOr([]);return n.length>1?(r(e,n,t.start,t.finish),C.some(Ac(C.some(Uc(o,0,o,Cr(o))),!0))):C.none()})),Wc=(e,t)=>({item:e,mode:t}),$c=(e,t,o,n=qc)=>e.property().parent(t).map((e=>Wc(e,n))),qc=(e,t,o,n=Gc)=>o.sibling(e,t).map((e=>Wc(e,n))),Gc=(e,t,o,n=Gc)=>{const r=e.property().children(t);return o.first(r).map((e=>Wc(e,n)))},Kc=[{current:$c,next:qc,fallback:C.none()},{current:qc,next:Gc,fallback:C.some($c)},{current:Gc,next:Gc,fallback:C.some(qc)}],Yc=(e,t,o,n,r=Kc)=>L(r,(e=>e.current===o)).bind((o=>o.current(e,t,n,o.next).orThunk((()=>o.fallback.bind((o=>Yc(e,t,o,n))))))),Xc=()=>({sibling:(e,t)=>e.query().prevSibling(t),first:e=>e.length>0?C.some(e[e.length-1]):C.none()}),Jc=()=>({sibling:(e,t)=>e.query().nextSibling(t),first:e=>e.length>0?C.some(e[0]):C.none()}),Qc=(e,t,o,n,r,s)=>Yc(e,t,n,r).bind((t=>s(t.item)?C.none():o(t.item)?C.some(t.item):Qc(e,t.item,o,t.mode,r,s))),ed=e=>t=>0===e.property().children(t).length,td=(e,t,o,n)=>Qc(e,t,o,qc,Xc(),n),od=(e,t,o,n)=>Qc(e,t,o,qc,Jc(),n),nd=_s(),rd=(e,t)=>((e,t,o)=>td(e,t,ed(e),o))(nd,e,t),sd=(e,t)=>((e,t,o)=>od(e,t,ed(e),o))(nd,e,t),ad=wi([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),id=e=>Ct(e,"tr"),ld={...ad,verify:(e,t,o,n,r,s,a)=>Ct(n,"td,th",a).bind((o=>Ct(t,"td,th",a).map((t=>Te(o,t)?Te(n,o)&&Cr(o)===r?s(t):ad.none("in same cell"):Ms(id,[o,t]).fold((()=>((e,t,o)=>{const n=e.getRect(t),r=e.getRect(o);return r.right>n.left&&r.lefts(t))))))).getOr(ad.none("default")),cata:(e,t,o,n,r)=>e.fold(t,o,n,r)},cd=(e,t)=>H(e,v(Te,t)),dd=he("br"),md=(e,t,o)=>t(e,o).bind((e=>me(e)&&0===yr(e).trim().length?md(e,t,o):C.some(e))),ud=(e,t,o,n)=>((e,t)=>Pe(e,t).filter(dd).orThunk((()=>Pe(e,t-1).filter(dd))))(t,o).bind((t=>n.traverse(t).fold((()=>md(t,n.gather,e).map(n.relative)),(e=>(e=>Ne(e).bind((t=>{const o=Ie(t);return cd(o,e).map((n=>((e,t,o,n)=>({parent:e,children:t,element:o,index:n}))(t,o,e,n)))})))(e).map((e=>Oc.on(e.parent,e.index))))))),gd=(e,t,o,n)=>{const r=dd(t)?((e,t,o)=>o.traverse(t).orThunk((()=>md(t,o.gather,e))).map(o.relative))(e,t,n):ud(e,t,o,n);return r.map((e=>({start:e,finish:e})))},hd=(e,t)=>({left:e.left,top:e.top+t,right:e.right,bottom:e.bottom+t}),pd=(e,t)=>({left:e.left,top:e.top-t,right:e.right,bottom:e.bottom-t}),fd=(e,t,o)=>({left:e.left+t,top:e.top+o,right:e.right+t,bottom:e.bottom+o}),vd=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom}),bd=(e,t)=>C.some(e.getRect(t)),yd=(e,t,o)=>de(t)?bd(e,t).map(vd):me(t)?((e,t,o)=>o>=0&&o0?e.getRangedRect(t,o-1,t,o):C.none())(e,t,o).map(vd):C.none(),wd=(e,t)=>de(t)?bd(e,t).map(vd):me(t)?e.getRangedRect(t,0,t,Cr(t)).map(vd):C.none(),xd=wi([{none:[]},{retry:["caret"]}]),Cd=(e,t,o)=>bt(t,Pi).fold(w,(t=>wd(e,t).exists((e=>((e,t)=>e.leftt.right)(o,e))))),Sd={point:e=>e.bottom,adjuster:(e,t,o,n,r)=>{const s=hd(r,5);return Math.abs(o.bottom-n.bottom)<1||o.top>r.bottom?xd.retry(s):o.top===r.bottom?xd.retry(hd(r,1)):Cd(e,t,r)?xd.retry(fd(s,5,0)):xd.none()},move:hd,gather:sd},kd=(e,t,o,n,r)=>0===r?C.some(n):((e,t,o)=>e.elementFromPoint(t,o).filter((e=>"table"===se(e))).isSome())(e,n.left,t.point(n))?((e,t,o,n,r)=>kd(e,t,o,t.move(n,5),r))(e,t,o,n,r-1):e.situsFromPoint(n.left,t.point(n)).bind((s=>s.start.fold(C.none,(s=>wd(e,s).bind((a=>t.adjuster(e,s,a,o,n).fold(C.none,(n=>kd(e,t,o,n,r-1))))).orThunk((()=>C.some(n)))),C.none))),_d=(e,t,o)=>{const n=e.move(o,5),r=kd(t,e,o,n,100).getOr(n);return((e,t,o)=>e.point(t)>o.getInnerHeight()?C.some(e.point(t)-o.getInnerHeight()):e.point(t)<0?C.some(-e.point(t)):C.none())(e,r,t).fold((()=>t.situsFromPoint(r.left,e.point(r))),(o=>(t.scrollBy(0,o),t.situsFromPoint(r.left,e.point(r)-o))))},Ed={tryUp:v(_d,{point:e=>e.top,adjuster:(e,t,o,n,r)=>{const s=pd(r,5);return Math.abs(o.top-n.top)<1||o.bottome.getSelection().bind((n=>gd(t,n.finish,n.foffset,o).fold((()=>C.some(na(n.finish,n.foffset))),(r=>{const s=e.fromSitus(r);return(e=>ld.cata(e,(e=>C.none()),(()=>C.none()),(e=>C.some(na(e,0))),(e=>C.some(na(e,Cr(e))))))(ld.verify(e,n.finish,n.foffset,s.finish,s.foffset,o.failure,t))})))),Od=(e,t,o,n,r,s)=>0===s?C.none():Md(e,t,o,n,r).bind((a=>{const i=e.fromSitus(a),l=ld.verify(e,o,n,i.finish,i.foffset,r.failure,t);return ld.cata(l,(()=>C.none()),(()=>C.some(a)),(a=>Te(o,a)&&0===n?Ad(e,o,n,pd,r):Od(e,t,a,0,r,s-1)),(a=>Te(o,a)&&n===Cr(a)?Ad(e,o,n,hd,r):Od(e,t,a,Cr(a),r,s-1)))})),Ad=(e,t,o,n,r)=>yd(e,t,o).bind((t=>Dd(e,r,n(t,Ed.getJumpSize())))),Dd=(e,t,o)=>{const n=Ro().browser;return n.isChromium()||n.isSafari()||n.isFirefox()?t.retry(e,o):C.none()},Md=(e,t,o,n,r)=>yd(e,o,n).bind((t=>Dd(e,r,t))),Nd=(e,t)=>{return vt(e,(e=>Ne(e).exists((e=>Te(e,t)))),o).isSome();var o},Rd=(e,t,o,n,r)=>Ct(n,"td,th",t).bind((n=>Ct(n,"table",t).bind((s=>Nd(r,s)?((e,t,o)=>Td(e,t,o).bind((n=>Od(e,t,n.element,n.offset,o,20).map(e.fromSitus))))(e,t,o).bind((e=>Ct(e.finish,"td,th",t).map((t=>({start:n,finish:t,range:e}))))):C.none())))),Bd=(e,t,o,n,r,s)=>s(n,t).orThunk((()=>Rd(e,t,o,n,r).map((e=>{const t=e.range;return Ac(C.some(Uc(t.start,t.soffset,t.finish,t.foffset)),!0)})))),Ld=(e,t)=>Ct(e,"tr",t).bind((e=>Ct(e,"table",t).bind((o=>{const n=pt(o,"tr");return Te(e,n[0])?((e,t,o)=>td(nd,e,t,o))(o,(e=>Er(e).isSome()),t).map((e=>{const t=Cr(e);return Ac(C.some(Uc(e,t,e,t)),!0)})):C.none()})))),Hd=(e,t)=>Ct(e,"tr",t).bind((e=>Ct(e,"table",t).bind((o=>{const n=pt(o,"tr");return Te(e,n[n.length-1])?((e,t,o)=>od(nd,e,t,o))(o,(e=>_r(e).isSome()),t).map((e=>Ac(C.some(Uc(e,0,e,0)),!0))):C.none()})))),Id=(e,t,o,n,r,s,a)=>Rd(e,o,n,r,s).bind((e=>jc(t,o,e.start,e.finish,a))),Pd=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},Fd=()=>{const e=(e=>{const t=Pd(C.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(C.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(C.some(e))}}})(g);return{...e,on:t=>e.get().each(t)}},zd=(e,t)=>Ct(e,"td,th",t),Vd=e=>Re(e).exists(os),Zd={traverse:He,gather:sd,relative:Oc.before,retry:Ed.tryDown,failure:ld.failedDown},Ud={traverse:Le,gather:rd,relative:Oc.before,retry:Ed.tryUp,failure:ld.failedUp},jd=e=>t=>t===e,Wd=jd(38),$d=jd(40),qd=e=>e>=37&&e<=40,Gd={isBackward:jd(37),isForward:jd(39)},Kd={isBackward:jd(39),isForward:jd(37)},Yd=wi([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Xd={domRange:Yd.domRange,relative:Yd.relative,exact:Yd.exact,exactFromRange:e=>Yd.exact(e.start,e.soffset,e.finish,e.foffset),getWin:e=>{const t=(e=>e.match({domRange:e=>Se.fromDom(e.startContainer),relative:(e,t)=>Oc.getStart(e),exact:(e,t,o,n)=>e}))(e);return o=t,Se.fromDom(Me(o).dom.defaultView);var o},range:zc},Jd=(e,t,o)=>{var n,r;return C.from(null===(r=(n=e.dom).caretPositionFromPoint)||void 0===r?void 0:r.call(n,t,o)).bind((t=>{if(null===t.offsetNode)return C.none();const o=e.dom.createRange();return o.setStart(t.offsetNode,t.offset),o.collapse(),C.some(o)}))},Qd=(e,t,o)=>{var n,r;return C.from(null===(r=(n=e.dom).caretRangeFromPoint)||void 0===r?void 0:r.call(n,t,o))},em=document.caretPositionFromPoint?Jd:document.caretRangeFromPoint?Qd:C.none,tm=(e,t)=>{const o=se(e);return"input"===o?Oc.after(e):E(["br","img"],o)?0===t?Oc.before(e):Oc.after(e):Oc.on(e,t)},om=(e,t,o,n)=>{const r=((e,t,o,n)=>{const r=De(e).dom.createRange();return r.setStart(e.dom,t),r.setEnd(o.dom,n),r})(e,t,o,n),s=Te(e,o)&&t===n;return r.collapsed&&!s},nm=e=>C.from(e.getSelection()),rm=(e,t)=>{nm(e).each((e=>{e.removeAllRanges(),e.addRange(t)}))},sm=(e,t,o,n,r)=>{const s=Bc(e,t,o,n,r);rm(e,s)},am=(e,t)=>Pc(e,t).match({ltr:(t,o,n,r)=>{sm(e,t,o,n,r)},rtl:(t,o,n,r)=>{nm(e).each((s=>{if(s.setBaseAndExtent)s.setBaseAndExtent(t.dom,o,n.dom,r);else if(s.extend)try{((e,t,o,n,r,s)=>{t.collapse(o.dom,n),t.extend(r.dom,s)})(0,s,t,o,n,r)}catch(s){sm(e,n,r,t,o)}else sm(e,n,r,t,o)}))}}),im=(e,t,o,n,r)=>{const s=((e,t,o,n)=>{const r=tm(e,t),s=tm(o,n);return Xd.relative(r,s)})(t,o,n,r);am(e,s)},lm=(e,t,o)=>{const n=((e,t)=>{const o=e.fold(Oc.before,tm,Oc.after),n=t.fold(Oc.before,tm,Oc.after);return Xd.relative(o,n)})(t,o);am(e,n)},cm=e=>{if(e.rangeCount>0){const t=e.getRangeAt(0),o=e.getRangeAt(e.rangeCount-1);return C.some(zc(Se.fromDom(t.startContainer),t.startOffset,Se.fromDom(o.endContainer),o.endOffset))}return C.none()},dm=e=>{if(null===e.anchorNode||null===e.focusNode)return cm(e);{const t=Se.fromDom(e.anchorNode),o=Se.fromDom(e.focusNode);return om(t,e.anchorOffset,o,e.focusOffset)?C.some(zc(t,e.anchorOffset,o,e.focusOffset)):cm(e)}},mm=(e,t,o=!0)=>{const n=(o?Mc:Dc)(e,t);rm(e,n)},um=e=>(e=>nm(e).filter((e=>e.rangeCount>0)).bind(dm))(e).map((e=>Xd.exact(e.start,e.soffset,e.finish,e.foffset))),gm=(e,t)=>(e=>{const t=e.getClientRects(),o=t.length>0?t[0]:e.getBoundingClientRect();return o.width>0||o.height>0?C.some(o).map(Lc):C.none()})(Fc(e,t)),hm=(e,t,o)=>((e,t,o)=>{const n=Se.fromDom(e.document);return em(n,t,o).map((e=>zc(Se.fromDom(e.startContainer),e.startOffset,Se.fromDom(e.endContainer),e.endOffset)))})(e,t,o),pm=e=>({elementFromPoint:(t,o)=>Se.fromPoint(Se.fromDom(e.document),t,o),getRect:e=>e.dom.getBoundingClientRect(),getRangedRect:(t,o,n,r)=>{const s=Xd.exact(t,o,n,r);return gm(e,s)},getSelection:()=>um(e).map((t=>Zc(e,t))),fromSitus:t=>{const o=Xd.relative(t.start,t.finish);return Zc(e,o)},situsFromPoint:(t,o)=>hm(e,t,o).map((e=>Vc(e.start,e.soffset,e.finish,e.foffset))),clearSelection:()=>{(e=>{nm(e).each((e=>e.removeAllRanges()))})(e)},collapseSelection:(t=!1)=>{um(e).each((o=>o.fold((e=>e.collapse(t)),((o,n)=>{const r=t?o:n;lm(e,r,r)}),((o,n,r,s)=>{const a=t?o:r,i=t?n:s;im(e,a,i,a,i)}))))},setSelection:t=>{im(e,t.start,t.soffset,t.finish,t.foffset)},setRelativeSelection:(t,o)=>{lm(e,t,o)},selectNode:t=>{mm(e,t,!1)},selectContents:t=>{mm(e,t)},getInnerHeight:()=>e.innerHeight,getScrollY:()=>(e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return vn(o,n)})(Se.fromDom(e.document)).top,scrollBy:(t,o)=>{((e,t,o)=>{const n=(void 0!==o?o.dom:document).defaultView;n&&n.scrollBy(e,t)})(t,o,Se.fromDom(e.document))}}),fm=(e,t)=>({rows:e,cols:t}),vm=(e,t,o,n)=>{const r=((e,t,o,n)=>{const r=Fd(),s=r.clear,a=s=>{r.on((r=>{n.clearBeforeUpdate(t),zd(s.target,o).each((a=>{Rs(r,a,o).each((o=>{const r=o.boxes.getOr([]);if(1===r.length){const e=r[0],o="false"===ns(e),a=St(ts(s.target),e,Te);o&&a&&n.selectRange(t,r,e,e)}else r.length>1&&(n.selectRange(t,r,o.start,o.finish),e.selectContents(a))}))}))}))};return{clearstate:s,mousedown:e=>{n.clear(t),zd(e.target,o).filter(Vd).each(r.set)},mouseover:e=>{a(e)},mouseup:e=>{a(e),s()}}})(pm(e),t,o,n);return{clearstate:r.clearstate,mousedown:r.mousedown,mouseover:r.mouseover,mouseup:r.mouseup}},bm=e=>bt(e,ce).exists(os),ym=(e,t)=>bm(e)||bm(t),wm=(e,t,o,n)=>{const r=pm(e),s=()=>(n.clear(t),C.none());return{keydown:(e,a,i,l,c,d)=>{const m=e.raw,u=m.which,g=!0===m.shiftKey,h=Bs(t,n.selectedSelector).fold((()=>(qd(u)&&!g&&n.clearBeforeUpdate(t),qd(u)&&g&&!ym(a,l)?C.none:$d(u)&&g?v(Id,r,t,o,Zd,l,a,n.selectRange):Wd(u)&&g?v(Id,r,t,o,Ud,l,a,n.selectRange):$d(u)?v(Bd,r,o,Zd,l,a,Hd):Wd(u)?v(Bd,r,o,Ud,l,a,Ld):C.none)),(e=>{const o=o=>()=>{const s=j(o,(o=>((e,t,o,n,r)=>Hs(n,e,t,r.firstSelectedSelector,r.lastSelectedSelector).map((e=>(r.clearBeforeUpdate(o),r.selectRange(o,e.boxes,e.start,e.finish),e.boxes))))(o.rows,o.cols,t,e,n)));return s.fold((()=>Ls(t,n.firstSelectedSelector,n.lastSelectedSelector).map((e=>{const o=$d(u)||d.isForward(u)?Oc.after:Oc.before;return r.setRelativeSelection(Oc.on(e.first,0),o(e.table)),n.clear(t),Ac(C.none(),!0)}))),(e=>C.some(Ac(C.none(),!0))))};return qd(u)&&g&&!ym(a,l)?C.none:$d(u)&&g?o([fm(1,0)]):Wd(u)&&g?o([fm(-1,0)]):d.isBackward(u)&&g?o([fm(0,-1),fm(-1,0)]):d.isForward(u)&&g?o([fm(0,1),fm(1,0)]):qd(u)&&!g?s:C.none}));return h()},keyup:(e,r,s,a,i)=>Bs(t,n.selectedSelector).fold((()=>{const l=e.raw,c=l.which;return!0===l.shiftKey&&qd(c)&&ym(r,a)?((e,t,o,n,r,s,a)=>Te(o,r)&&n===s?C.none():Ct(o,"td,th",t).bind((o=>Ct(r,"td,th",t).bind((n=>jc(e,t,o,n,a))))))(t,o,r,s,a,i,n.selectRange):C.none()}),C.none)}},xm=(e,t)=>{const o=be(e,t);return void 0===o||""===o?[]:o.split(" ")},Cm=e=>void 0!==e.dom.classList,Sm=(e,t)=>((e,t,o)=>{const n=xm(e,t).concat([o]);return fe(e,t,n.join(" ")),!0})(e,"class",t),km=(e,t)=>{Cm(e)?e.dom.classList.add(t):Sm(e,t)},_m=(e,t)=>Cm(e)&&e.dom.classList.contains(t),Em=(e,t,o)=>{const n=t=>{we(t,e.selected),we(t,e.firstSelected),we(t,e.lastSelected)},r=t=>{fe(t,e.selected,"1")},s=e=>{a(e),o()},a=t=>{const o=pt(t,`${e.selectedSelector},${e.firstSelectedSelector},${e.lastSelectedSelector}`);D(o,n)};return{clearBeforeUpdate:a,clear:s,selectRange:(o,n,a,i)=>{s(o),D(n,r),fe(a,e.firstSelected,"1"),fe(i,e.lastSelected,"1"),t(n,a,i)},selectedSelector:e.selectedSelector,firstSelectedSelector:e.firstSelectedSelector,lastSelectedSelector:e.lastSelectedSelector}},Tm=()=>({tag:"none"}),Om=e=>({tag:"multiple",elements:e}),Am=e=>({tag:"single",element:e}),Dm=(e,t,o)=>{const n=rn.fromTable(e);return Wa(n,t).map((e=>{const t=Fa(n,o,!1),{rows:r}=Yo(t),s=((e,t)=>{const o=e.slice(0,t[t.length-1].row+1),n=za(o);return P(n,(e=>{const o=e.cells.slice(0,t[t.length-1].column+1);return A(o,(e=>e.element))}))})(r,e),a=((e,t)=>{const o=e.slice(t[0].row+t[0].rowspan-1,e.length),n=za(o);return P(n,(e=>{const o=e.cells.slice(t[0].column+t[0].colspan-1,e.cells.length);return A(o,(e=>e.element))}))})(r,e);return{upOrLeftCells:s,downOrRightCells:a}}))},Mm=e=>{const t=Se.fromDom((e=>{if(st()&&d(e.target)){const t=Se.fromDom(e.target);if(de(t)&&ct(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return Z(t)}}return C.from(e.target)})(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),r=(s=n,a=o,(...e)=>s(a.apply(null,e)));var s,a;return((e,t,o,n,r,s,a)=>({target:e,x:t,y:o,stop:n,prevent:r,kill:s,raw:a}))(t,e.clientX,e.clientY,o,n,r,e)},Nm=(e,t,o,n,r)=>{const s=((e,t)=>o=>{e(o)&&t(Mm(o))})(o,n);return e.dom.addEventListener(t,s,r),{unbind:v(Rm,e,t,s,r)}},Rm=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},Bm=x,Lm=(e,t,o)=>((e,t,o,n)=>Nm(e,t,o,n,!1))(e,t,Bm,o),Hm=Mm,Im=e=>!_m(Se.fromDom(e.target),"ephox-snooker-resizer-bar"),Pm=(e,t)=>{const o=((e,t,o)=>({get:()=>Is(e(),o).fold((()=>t().fold(Tm,Am)),Om)}))((()=>Se.fromDom(e.getBody())),(()=>ea(is(e),ss(e))),Ys.selectedSelector),n=Em(Ys,((t,o,n)=>{Xt(o).each((r=>{const s=A(t,(e=>e.dom)),a=zr(e),i=Lr(g,Se.fromDom(e.getDoc()),a),l=ta(e),c=Dm(r,{selection:l},i).map((e=>G(e,(e=>A(e,(e=>e.dom)))))).getOrUndefined();((e,t,o,n,r)=>{e.dispatch("TableSelectionChange",{cells:t,start:o,finish:n,otherCells:r})})(e,s,o.dom,n.dom,c)}))}),(()=>(e=>{e.dispatch("TableSelectionClear")})(e)));e.on("init",(o=>{const r=e.getWin(),s=rs(e),a=ss(e),i=vm(r,s,a,n),l=wm(r,s,a,n),c=((e,t,o,n)=>{const r=pm(e);return(e,s)=>{n.clearBeforeUpdate(t),Rs(e,s,o).each((e=>{const o=e.boxes.getOr([]);n.selectRange(t,o,e.start,e.finish),r.selectContents(s),r.collapseSelection()}))}})(r,s,a,n);e.on("TableSelectorChange",(e=>c(e.start,e.finish)));const d=(t,o)=>{(e=>!0===e.raw.shiftKey)(t)&&(o.kill&&t.kill(),o.selection.each((t=>{const o=Xd.relative(t.start,t.finish),n=Fc(r,o);e.selection.setRng(n)})))},m=e=>0===e.button,u=(()=>{const e=Pd(Se.fromDom(s)),t=Pd(0);return{touchEnd:o=>{const n=Se.fromDom(o.target);if(he("td")(n)||he("th")(n)){const r=e.get(),s=t.get();Te(r,n)&&o.timeStamp-s<300&&(o.preventDefault(),c(n,n))}e.set(n),t.set(o.timeStamp)}}})();e.on("dragstart",(e=>{i.clearstate()})),e.on("mousedown",(e=>{m(e)&&Im(e)&&i.mousedown(Hm(e))})),e.on("mouseover",(e=>{var t;void 0!==(t=e).buttons&&0==(1&t.buttons)||!Im(e)||i.mouseover(Hm(e))})),e.on("mouseup",(e=>{m(e)&&Im(e)&&i.mouseup(Hm(e))})),e.on("touchend",u.touchEnd),e.on("keyup",(t=>{const o=Hm(t);if(o.raw.shiftKey&&qd(o.raw.which)){const t=e.selection.getRng(),n=Se.fromDom(t.startContainer),r=Se.fromDom(t.endContainer);l.keyup(o,n,t.startOffset,r,t.endOffset).each((e=>{d(o,e)}))}})),e.on("keydown",(o=>{const n=Hm(o);t.hide();const r=e.selection.getRng(),s=Se.fromDom(r.startContainer),a=Se.fromDom(r.endContainer),i=dn(Gd,Kd)(Se.fromDom(e.selection.getStart()));l.keydown(n,s,r.startOffset,a,r.endOffset,i).each((e=>{d(n,e)})),t.show()})),e.on("NodeChange",(()=>{const t=e.selection,o=Se.fromDom(t.getStart()),r=Se.fromDom(t.getEnd());Ms(Xt,[o,r]).fold((()=>n.clear(s)),g)}))})),e.on("PreInit",(()=>{e.serializer.addTempAttr(Ys.firstSelected),e.serializer.addTempAttr(Ys.lastSelected)}));return{getSelectedCells:()=>((e,t,o,n)=>{switch(e.tag){case"none":return t();case"single":return n(e.element);case"multiple":return o(e.elements)}})(o.get(),h([]),(e=>A(e,(e=>e.dom))),(e=>[e.dom])),clearSelectedCells:e=>n.clear(Se.fromDom(e))}},Fm=e=>{let t=[];return{bind:e=>{if(void 0===e)throw new Error("Event bind error: undefined handler");t.push(e)},unbind:e=>{t=N(t,(t=>t!==e))},trigger:(...o)=>{const n={};D(e,((e,t)=>{n[e]=o[t]})),D(t,(e=>{e(n)}))}}},zm=e=>({registry:G(e,(e=>({bind:e.bind,unbind:e.unbind}))),trigger:G(e,(e=>e.trigger))}),Vm=e=>e.slice(0).sort(),Zm=(e,t,o)=>{if(0===t.length)throw new Error("You must specify at least one required field.");return((e,t)=>{if(!a(t))throw new Error("The "+e+" fields must be an array. Was: "+t+".");D(t,(t=>{if(!r(t))throw new Error("The value "+t+" in the "+e+" fields was not a string.")}))})("required",t),(e=>{const t=Vm(e);L(t,((e,o)=>o{throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+t.join(", ")+"].")}))})(t),n=>{const r=W(n);F(t,(e=>E(r,e)))||((e,t)=>{throw new Error("All required keys ("+Vm(e).join(", ")+") were not specified. Specified keys were: "+Vm(t).join(", ")+".")})(t,r),e(t,r);const s=N(t,(e=>!o.validate(n[e],e)));return s.length>0&&((e,t)=>{throw new Error("All values need to be of type: "+t+". Keys ("+Vm(e).join(", ")+") were not.")})(s,o.label),n}},Um=(e,t)=>{const o=N(t,(t=>!E(e,t)));o.length>0&&(e=>{throw new Error("Unsupported keys for object: "+Vm(e).join(", "))})(o)},jm=e=>((e,t)=>Zm(e,t,{validate:m,label:"function"}))(Um,e),Wm=jm(["compare","extract","mutate","sink"]),$m=jm(["element","start","stop","destroy"]),qm=jm(["forceDrop","drop","move","delayDrop"]),Gm=()=>{let e=C.none();const t=zm({move:Fm(["info"])});return{onEvent:(o,n)=>{n.extract(o).each((o=>{const r=((t,o)=>{const n=e.map((e=>t.compare(e,o)));return e=C.some(o),n})(n,o);r.each((e=>{t.trigger.move(e)}))}))},reset:()=>{e=C.none()},events:t.registry}},Km=()=>{const e=(()=>{const e=zm({move:Fm(["info"])});return{onEvent:g,reset:g,events:e.registry}})(),t=Gm();let o=e;return{on:()=>{o.reset(),o=t},off:()=>{o.reset(),o=e},isOn:()=>o===t,onEvent:(e,t)=>{o.onEvent(e,t)},events:t.events}},Ym=(e,t,o)=>{let n=!1;const r=zm({start:Fm([]),stop:Fm([])}),s=Km(),a=()=>{d.stop(),s.isOn()&&(s.off(),r.trigger.stop())},l=((e,t)=>{let o=null;const n=()=>{i(o)||(clearTimeout(o),o=null)};return{cancel:n,throttle:(...r)=>{n(),o=setTimeout((()=>{o=null,e.apply(null,r)}),t)}}})(a,200);s.events.move.bind((o=>{t.mutate(e,o.info)}));const c=e=>(...t)=>{n&&e.apply(null,t)},d=t.sink(qm({forceDrop:a,drop:c(a),move:c((e=>{l.cancel(),s.onEvent(e,t)})),delayDrop:c(l.throttle)}),o);return{element:d.element,go:e=>{d.start(e),s.on(),r.trigger.start()},on:()=>{n=!0},off:()=>{n=!1},isActive:()=>n,destroy:()=>{d.destroy()},events:r.registry}},Xm=e=>{const t=e.replace(/\./g,"-");return{resolve:e=>t+"-"+e}},Jm=Xm("ephox-dragster").resolve;var Qm=Wm({compare:(e,t)=>vn(t.left-e.left,t.top-e.top),extract:e=>C.some(vn(e.x,e.y)),sink:(e,t)=>{const o=(e=>{const t={layerClass:Jm("blocker"),...e},o=Se.fromTag("div");return fe(o,"role","presentation"),Lt(o,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),km(o,Jm("blocker")),km(o,t.layerClass),{element:h(o),destroy:()=>{qe(o)}}})(t),n=Lm(o.element(),"mousedown",e.forceDrop),r=Lm(o.element(),"mouseup",e.drop),s=Lm(o.element(),"mousemove",e.move),a=Lm(o.element(),"mouseout",e.delayDrop);return $m({element:o.element,start:e=>{Ze(e,o.element())},stop:()=>{qe(o.element())},destroy:()=>{o.destroy(),r.unbind(),s.unbind(),a.unbind(),n.unbind()}})},mutate:(e,t)=>{e.mutate(t.left,t.top)}});const eu=Xm("ephox-snooker").resolve,tu=()=>{const e=zm({drag:Fm(["xDelta","yDelta","target"])});let t=C.none();const o=(()=>{const e=zm({drag:Fm(["xDelta","yDelta"])});return{mutate:(t,o)=>{e.trigger.drag(t,o)},events:e.registry}})();o.events.drag.bind((o=>{t.each((t=>{e.trigger.drag(o.xDelta,o.yDelta,t)}))}));return{assign:e=>{t=C.some(e)},get:()=>t,mutate:o.mutate,events:e.registry}},ou=eu("resizer-bar"),nu=eu("resizer-rows"),ru=eu("resizer-cols"),su=e=>{const t=pt(e.parent(),"."+ou);D(t,qe)},au=(e,t,o)=>{const n=e.origin();D(t,(t=>{t.each((t=>{const r=o(n,t);km(r,ou),Ze(e.parent(),r)}))}))},iu=(e,t,o,n)=>{au(e,t,((e,t)=>{const r=((e,t,o,n,r)=>{const s=Se.fromTag("div");return Lt(s,{position:"absolute",left:t-n/2+"px",top:o+"px",height:r+"px",width:n+"px"}),ve(s,{"data-column":e,role:"presentation"}),s})(t.col,t.x-e.left,o.top-e.top,7,n);return km(r,ru),r}))},lu=(e,t,o,n)=>{au(e,t,((e,t)=>{const r=((e,t,o,n,r)=>{const s=Se.fromTag("div");return Lt(s,{position:"absolute",left:t+"px",top:o-r/2+"px",height:r+"px",width:n+"px"}),ve(s,{"data-row":e,role:"presentation"}),s})(t.row,o.left-e.left,t.y-e.top,n,7);return km(r,nu),r}))},cu=(e,t,o,n,r)=>{const s=yn(o),a=t.isResizable,i=n.length>0?Mn.positions(n,o):[],l=i.length>0?((e,t)=>P(e.all,((e,o)=>t(e.element)?[o]:[])))(e,a):[],c=N(i,((e,t)=>T(l,(e=>t===e))));lu(t,c,s,zo(o));const d=r.length>0?Rn.positions(r,o):[],m=d.length>0?((e,t)=>{const o=[];return O(e.grid.columns,(n=>{const r=rn.getColumnAt(e,n).map((e=>e.element));r.forall(t)&&o.push(n)})),N(o,(o=>{const n=rn.filterItems(e,(e=>e.column===o));return F(n,(e=>t(e.element)))}))})(e,a):[],u=N(d,((e,t)=>T(m,(e=>t===e))));iu(t,u,s,hn(o))},du=(e,t)=>{if(su(e),e.isResizable(t)){const o=rn.fromTable(t),n=ln(o),r=sn(o);cu(o,e,t,n,r)}},mu=(e,t)=>{const o=pt(e.parent(),"."+ou);D(o,t)},uu=e=>{mu(e,(e=>{Bt(e,"display","none")}))},gu=e=>{mu(e,(e=>{Bt(e,"display","block")}))},hu=eu("resizer-bar-dragging"),pu=e=>{const t=tu(),o=((e,t={})=>{var o;const n=null!==(o=t.mode)&&void 0!==o?o:Qm;return Ym(e,n,t)})(t,{});let n=C.none();const r=(e,t)=>C.from(be(e,t));t.events.drag.bind((e=>{r(e.target,"data-row").each((t=>{const o=Ut(e.target,"top");Bt(e.target,"top",o+e.yDelta+"px")})),r(e.target,"data-column").each((t=>{const o=Ut(e.target,"left");Bt(e.target,"left",o+e.xDelta+"px")}))}));const s=(e,t)=>Ut(e,t)-zt(e,"data-initial-"+t,0);o.events.stop.bind((()=>{t.get().each((t=>{n.each((o=>{r(t,"data-row").each((e=>{const n=s(t,"top");we(t,"data-initial-top"),d.trigger.adjustHeight(o,n,parseInt(e,10))})),r(t,"data-column").each((e=>{const n=s(t,"left");we(t,"data-initial-left"),d.trigger.adjustWidth(o,n,parseInt(e,10))})),du(e,o)}))}))}));const a=(n,r)=>{d.trigger.startAdjust(),t.assign(n),fe(n,"data-initial-"+r,Ut(n,r)),km(n,hu),Bt(n,"opacity","0.2"),o.go(e.parent())},i=Lm(e.parent(),"mousedown",(e=>{var t;t=e.target,_m(t,nu)&&a(e.target,"top"),(e=>_m(e,ru))(e.target)&&a(e.target,"left")})),l=t=>Te(t,e.view()),c=Lm(e.view(),"mouseover",(t=>{var r;(r=t.target,Ct(r,"table",l).filter(os)).fold((()=>{dt(t.target)&&su(e)}),(t=>{o.isActive()&&(n=C.some(t),du(e,t))}))})),d=zm({adjustHeight:Fm(["table","delta","row"]),adjustWidth:Fm(["table","delta","column"]),startAdjust:Fm([])});return{destroy:()=>{i.unbind(),c.unbind(),o.destroy(),su(e)},refresh:t=>{du(e,t)},on:o.on,off:o.off,hideBars:v(uu,e),showBars:v(gu,e),events:d.registry}},fu=(e,t,o)=>{const n=Mn,r=Rn,s=pu(e),a=zm({beforeResize:Fm(["table","type"]),afterResize:Fm(["table","type"]),startDrag:Fm([])});return s.events.adjustHeight.bind((e=>{const t=e.table;a.trigger.beforeResize(t,"row");const o=n.delta(e.delta,t);Ei(t,o,e.row),a.trigger.afterResize(t,"row")})),s.events.startAdjust.bind((e=>{a.trigger.startDrag()})),s.events.adjustWidth.bind((e=>{const n=e.table;a.trigger.beforeResize(n,"col");const s=r.delta(e.delta,n),i=o(n);_i(n,s,e.column,t,i),a.trigger.afterResize(n,"col")})),{on:s.on,off:s.off,refreshBars:s.refresh,hideBars:s.hideBars,showBars:s.showBars,destroy:s.destroy,events:a.registry}},vu=(e,t)=>{const o=ue(e)?(e=>Se.fromDom(Me(e).dom.documentElement))(e):e;return{parent:h(o),view:h(e),origin:h(vn(0,0)),isResizable:t}},bu=(e,t,o)=>({parent:h(t),view:h(e),origin:h(vn(0,0)),isResizable:o}),yu=()=>{const e=Se.fromTag("div");return Lt(e,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Ze(mt(Se.fromDom(document)),e),e},wu=e=>d(e)&&"TABLE"===e.nodeName,xu="bar-",Cu=e=>"false"!==be(e,"data-mce-resize"),Su=e=>{return Ot(t=e,o="corner-")?((e,t)=>e.substring(t))(t,o.length):t;var t,o},ku=e=>{const t=Fd(),o=Fd(),n=Fd();let r,s,a,i;const l=t=>Il(e,t),c=()=>Ur(e)?fa():pa(),d=(t,o,n,d)=>{const m=Su(o),u=At(m,"e"),g=Ot(m,"n");if(""===s&&nc(t),""===i&&sc(t),n!==r&&""!==s){Bt(t,"width",s);const o=c(),a=l(t),i=Ur(e)||u?(e=>va(e).columns)(t)-1:0;_i(t,n-r,i,o,a)}else if((e=>/^(\d+(\.\d+)?)%$/.test(e))(s)){const e=parseFloat(s.replace("%",""));Bt(t,"width",n*e/r+"%")}if((e=>/^(\d+(\.\d+)?)px$/.test(e))(s)&&(e=>{const t=rn.fromTable(e);rn.hasColumns(t)||D(Kt(e),(e=>{const t=Ht(e,"width");Bt(e,"width",t),we(e,"width")}))})(t),d!==a&&""!==i){Bt(t,"height",i);const e=g?0:(e=>va(e).rows)(t)-1;Ei(t,d-a,e)}},m=()=>{o.on((e=>{e.destroy()})),n.on((t=>{((e,t)=>{e.inline&&qe(t.parent())})(e,t)}))};e.on("init",(()=>{const r=((e,t)=>e.inline?bu(Se.fromDom(e.getBody()),yu(),t):vu(Se.fromDom(e.getDoc()),t))(e,Cu);if(n.set(r),(e=>{const t=e.options.get("object_resizing");return E(t.split(","),"table")})(e)&&Kr(e)){const n=c(),s=fu(r,n,l);s.on(),s.events.startDrag.bind((o=>{t.set(e.selection.getRng())})),s.events.beforeResize.bind((t=>{const o=t.table.dom;((e,t,o,n,r)=>{e.dispatch("ObjectResizeStart",{target:t,width:o,height:n,origin:r})})(e,o,ls(o),cs(o),xu+t.type)})),s.events.afterResize.bind((o=>{const n=o.table,r=n.dom;as(n),t.on((t=>{e.selection.setRng(t),e.focus()})),((e,t,o,n,r)=>{e.dispatch("ObjectResized",{target:t,width:o,height:n,origin:r})})(e,r,ls(r),cs(r),xu+o.type),e.undoManager.add()})),o.set(s)}})),e.on("ObjectResizeStart",(t=>{const o=t.target;if(wu(o)){const n=Se.fromDom(o);D(e.dom.select(".mce-clonedresizable"),(t=>{e.dom.addClass(t,"mce-"+Zr(e)+"-columns")})),!ec(n)&&qr(e)?rc(n):!Ql(n)&&$r(e)&&nc(n),tc(n)&&Ot(t.origin,xu)&&nc(n),r=t.width,s=Gr(e)?"":ms(e,o).getOr(""),a=t.height,i=us(e,o).getOr("")}})),e.on("ObjectResized",(t=>{const o=t.target;if(wu(o)){const n=Se.fromDom(o),r=t.origin;(e=>Ot(e,"corner-"))(r)&&d(n,r,t.width,t.height),as(n),Rl(e,n.dom,Bl)}})),e.on("SwitchMode",(()=>{o.on((t=>{e.mode.isReadOnly()?t.hideBars():t.showBars()}))})),e.on("dragstart dragend",(e=>{o.on((t=>{"dragstart"===e.type?(t.hideBars(),t.off()):(t.on(),t.showBars())}))})),e.on("remove",(()=>{m()}));return{refresh:e=>{o.on((t=>t.refreshBars(Se.fromDom(e))))},hide:()=>{o.on((e=>e.hideBars()))},show:()=>{o.on((e=>e.showBars()))}}},_u=e=>{(e=>{const t=e.options.register;t("table_clone_elements",{processor:"string[]"}),t("table_use_colgroups",{processor:"boolean",default:!0}),t("table_header_type",{processor:e=>{const t=E(["section","cells","sectionCells","auto"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be one of: section, cells, sectionCells or auto."}},default:"section"}),t("table_sizing_mode",{processor:"string",default:"auto"}),t("table_default_attributes",{processor:"object",default:{border:"1"}}),t("table_default_styles",{processor:"object",default:{"border-collapse":"collapse"}}),t("table_column_resizing",{processor:e=>{const t=E(["preservetable","resizetable"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be preservetable, or resizetable."}},default:"preservetable"}),t("table_resize_bars",{processor:"boolean",default:!0}),t("table_style_by_css",{processor:"boolean",default:!0}),t("table_merge_content_on_paste",{processor:"boolean",default:!0})})(e);const t=ku(e),o=Pm(e,t),n=Pl(e,t,o);return Ec(e,n),((e,t)=>{const o=ss(e),n=t=>ea(is(e)).bind((n=>Xt(n,o).map((o=>{const r=Xs(ta(e),o,n);return t(o,r)})))).getOr("");q({mceTableRowType:()=>n(t.getTableRowType),mceTableCellType:()=>n(t.getTableCellType),mceTableColType:()=>n(t.getTableColType)},((t,o)=>e.addQueryValueHandler(o,t)))})(e,n),oa(e,n),{getSelectedCells:o.getSelectedCells,clearSelectedCells:o.clearSelectedCells}},Eu=e=>({table:_u(e)});e.add("dom",Eu)}(),function(){var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=(r="allow_html_in_named_anchor",e=>e.options.get(r));var r;const s="a:not([href])",a=e=>!e,i=e=>e.getAttribute("id")||e.getAttribute("name")||"",l=e=>(e=>"a"===e.nodeName.toLowerCase())(e)&&!e.getAttribute("href")&&""!==i(e),c=e=>{const n=e.dom;t(n).walk(e.selection.getRng(),(e=>{o.each(e,(e=>{var t;l(t=e)&&!t.firstChild&&n.remove(e,!1)}))}))},d=e=>e.dom.getParent(e.selection.getStart(),s),m=(e,t)=>{const o=d(e);o?((e,t,o)=>{o.removeAttribute("name"),o.id=t,e.addVisual(),e.undoManager.add()})(e,t,o):((e,t)=>{e.undoManager.transact((()=>{n(e)||e.selection.collapse(!0),e.selection.isCollapsed()?e.insertContent(e.dom.createHTML("a",{id:t})):(c(e),e.formatter.remove("namedAnchor",void 0,void 0,!0),e.formatter.apply("namedAnchor",{value:t}),e.addVisual())}))})(e,t),e.focus()},u=e=>{const t=(e=>{const t=d(e);return t?i(t):""})(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:t=>{((e,t)=>/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)?(m(e,t),!0):(e.windowManager.alert("ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!1))(e,t.getData().id)&&t.close()}})},g=e=>(e=>a(e.attr("href"))&&!a(e.attr("id")||e.attr("name")))(e)&&!e.firstChild,h=e=>t=>{for(let o=0;ot=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",o),o(),()=>{e.off("NodeChange",o)}};e.add("anchor",(e=>{(e=>{(0,e.options.register)("allow_html_in_named_anchor",{processor:"boolean",default:!1})})(e),(e=>{e.on("PreInit",(()=>{e.parser.addNodeFilter("a",h("false")),e.serializer.addNodeFilter("a",h(null))}))})(e),(e=>{e.addCommand("mceAnchor",(()=>{u(e)}))})(e),(e=>{const t=()=>e.execCommand("mceAnchor");e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:t,onSetup:t=>{const o=e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind,n=p(e)(t);return()=>{o(),n()}}}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:t,onSetup:p(e)})})(e),e.on("PreInit",(()=>{(e=>{e.formatter.register("namedAnchor",{inline:"a",selector:s,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:(e,t,o)=>l(e)})})(e)}))}))}(),function(){var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=(e,t)=>{const o=((e,t)=>e.dispatch("insertCustomChar",{chr:t}))(e,t).chr;e.execCommand("mceInsertContent",!1,o)},o=e=>t=>e===t,n=(r="array",e=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=n=e,(r=String).prototype.isPrototypeOf(o)||(null===(s=n.constructor)||void 0===s?void 0:s.name)===r.name)?"string":t;var o,n,r,s})(e)===r);var r;const s=o(null),a=o(void 0),i=(e=>t=>typeof t===e)("function"),l=(c=!1,()=>c);var c;class d{constructor(e,t){this.tag=e,this.value=t}static some(e){return new d(!0,e)}static none(){return d.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?d.some(e(this.value)):d.none()}bind(e){return this.tag?e(this.value):d.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:d.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return(e=>null==e)(e)?d.none():d.some(e)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}d.singletonNone=new d(!1);const m=Array.prototype.push,u=(e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r((e,t,o)=>{for(let n=0,r=e.length;n(e=>{const t=[];for(let o=0,r=e.length;ot=>t.options.get(e),v=f("charmap"),b=f("charmap_append"),y=p.isArray,w="User Defined",x=e=>{return y(e)?(t=e,p.grep(t,(e=>y(e)&&2===e.length))):"function"==typeof e?e():[];var t},C=e=>{const t=((e,t)=>{const o=v(e);o&&(t=[{name:w,characters:x(o)}]);const n=b(e);if(n){const e=p.grep(t,(e=>e.name===w));return e.length?(e[0].characters=[...e[0].characters,...x(n)],t):t.concat({name:w,characters:x(n)})}return t})(e,[{name:"Currency",characters:[[36,"dollar sign"],[162,"cent sign"],[8364,"euro sign"],[163,"pound sign"],[165,"yen sign"],[164,"currency sign"],[8352,"euro-currency sign"],[8353,"colon sign"],[8354,"cruzeiro sign"],[8355,"french franc sign"],[8356,"lira sign"],[8357,"mill sign"],[8358,"naira sign"],[8359,"peseta sign"],[8360,"rupee sign"],[8361,"won sign"],[8362,"new sheqel sign"],[8363,"dong sign"],[8365,"kip sign"],[8366,"tugrik sign"],[8367,"drachma sign"],[8368,"german penny symbol"],[8369,"peso sign"],[8370,"guarani sign"],[8371,"austral sign"],[8372,"hryvnia sign"],[8373,"cedi sign"],[8374,"livre tournois sign"],[8375,"spesmilo sign"],[8376,"tenge sign"],[8377,"indian rupee sign"],[8378,"turkish lira sign"],[8379,"nordic mark sign"],[8380,"manat sign"],[8381,"ruble sign"],[20870,"yen character"],[20803,"yuan character"],[22291,"yuan character, in hong kong and taiwan"],[22278,"yen/yuan character variant one"]]},{name:"Text",characters:[[169,"copyright sign"],[174,"registered sign"],[8482,"trade mark sign"],[8240,"per mille sign"],[181,"micro sign"],[183,"middle dot"],[8226,"bullet"],[8230,"three dot leader"],[8242,"minutes / feet"],[8243,"seconds / inches"],[167,"section sign"],[182,"paragraph sign"],[223,"sharp s / ess-zed"]]},{name:"Quotations",characters:[[8249,"single left-pointing angle quotation mark"],[8250,"single right-pointing angle quotation mark"],[171,"left pointing guillemet"],[187,"right pointing guillemet"],[8216,"left single quotation mark"],[8217,"right single quotation mark"],[8220,"left double quotation mark"],[8221,"right double quotation mark"],[8218,"single low-9 quotation mark"],[8222,"double low-9 quotation mark"],[60,"less-than sign"],[62,"greater-than sign"],[8804,"less-than or equal to"],[8805,"greater-than or equal to"],[8211,"en dash"],[8212,"em dash"],[175,"macron"],[8254,"overline"],[164,"currency sign"],[166,"broken bar"],[168,"diaeresis"],[161,"inverted exclamation mark"],[191,"turned question mark"],[710,"circumflex accent"],[732,"small tilde"],[176,"degree sign"],[8722,"minus sign"],[177,"plus-minus sign"],[247,"division sign"],[8260,"fraction slash"],[215,"multiplication sign"],[185,"superscript one"],[178,"superscript two"],[179,"superscript three"],[188,"fraction one quarter"],[189,"fraction one half"],[190,"fraction three quarters"]]},{name:"Mathematical",characters:[[402,"function / florin"],[8747,"integral"],[8721,"n-ary sumation"],[8734,"infinity"],[8730,"square root"],[8764,"similar to"],[8773,"approximately equal to"],[8776,"almost equal to"],[8800,"not equal to"],[8801,"identical to"],[8712,"element of"],[8713,"not an element of"],[8715,"contains as member"],[8719,"n-ary product"],[8743,"logical and"],[8744,"logical or"],[172,"not sign"],[8745,"intersection"],[8746,"union"],[8706,"partial differential"],[8704,"for all"],[8707,"there exists"],[8709,"diameter"],[8711,"backward difference"],[8727,"asterisk operator"],[8733,"proportional to"],[8736,"angle"]]},{name:"Extended Latin",characters:[[192,"A - grave"],[193,"A - acute"],[194,"A - circumflex"],[195,"A - tilde"],[196,"A - diaeresis"],[197,"A - ring above"],[256,"A - macron"],[198,"ligature AE"],[199,"C - cedilla"],[200,"E - grave"],[201,"E - acute"],[202,"E - circumflex"],[203,"E - diaeresis"],[274,"E - macron"],[204,"I - grave"],[205,"I - acute"],[206,"I - circumflex"],[207,"I - diaeresis"],[298,"I - macron"],[208,"ETH"],[209,"N - tilde"],[210,"O - grave"],[211,"O - acute"],[212,"O - circumflex"],[213,"O - tilde"],[214,"O - diaeresis"],[216,"O - slash"],[332,"O - macron"],[338,"ligature OE"],[352,"S - caron"],[217,"U - grave"],[218,"U - acute"],[219,"U - circumflex"],[220,"U - diaeresis"],[362,"U - macron"],[221,"Y - acute"],[376,"Y - diaeresis"],[562,"Y - macron"],[222,"THORN"],[224,"a - grave"],[225,"a - acute"],[226,"a - circumflex"],[227,"a - tilde"],[228,"a - diaeresis"],[229,"a - ring above"],[257,"a - macron"],[230,"ligature ae"],[231,"c - cedilla"],[232,"e - grave"],[233,"e - acute"],[234,"e - circumflex"],[235,"e - diaeresis"],[275,"e - macron"],[236,"i - grave"],[237,"i - acute"],[238,"i - circumflex"],[239,"i - diaeresis"],[299,"i - macron"],[240,"eth"],[241,"n - tilde"],[242,"o - grave"],[243,"o - acute"],[244,"o - circumflex"],[245,"o - tilde"],[246,"o - diaeresis"],[248,"o slash"],[333,"o macron"],[339,"ligature oe"],[353,"s - caron"],[249,"u - grave"],[250,"u - acute"],[251,"u - circumflex"],[252,"u - diaeresis"],[363,"u - macron"],[253,"y - acute"],[254,"thorn"],[255,"y - diaeresis"],[563,"y - macron"],[913,"Alpha"],[914,"Beta"],[915,"Gamma"],[916,"Delta"],[917,"Epsilon"],[918,"Zeta"],[919,"Eta"],[920,"Theta"],[921,"Iota"],[922,"Kappa"],[923,"Lambda"],[924,"Mu"],[925,"Nu"],[926,"Xi"],[927,"Omicron"],[928,"Pi"],[929,"Rho"],[931,"Sigma"],[932,"Tau"],[933,"Upsilon"],[934,"Phi"],[935,"Chi"],[936,"Psi"],[937,"Omega"],[945,"alpha"],[946,"beta"],[947,"gamma"],[948,"delta"],[949,"epsilon"],[950,"zeta"],[951,"eta"],[952,"theta"],[953,"iota"],[954,"kappa"],[955,"lambda"],[956,"mu"],[957,"nu"],[958,"xi"],[959,"omicron"],[960,"pi"],[961,"rho"],[962,"final sigma"],[963,"sigma"],[964,"tau"],[965,"upsilon"],[966,"phi"],[967,"chi"],[968,"psi"],[969,"omega"]]},{name:"Symbols",characters:[[8501,"alef symbol"],[982,"pi symbol"],[8476,"real part symbol"],[978,"upsilon - hook symbol"],[8472,"Weierstrass p"],[8465,"imaginary part"]]},{name:"Arrows",characters:[[8592,"leftwards arrow"],[8593,"upwards arrow"],[8594,"rightwards arrow"],[8595,"downwards arrow"],[8596,"left right arrow"],[8629,"carriage return"],[8656,"leftwards double arrow"],[8657,"upwards double arrow"],[8658,"rightwards double arrow"],[8659,"downwards double arrow"],[8660,"left right double arrow"],[8756,"therefore"],[8834,"subset of"],[8835,"superset of"],[8836,"not a subset of"],[8838,"subset of or equal to"],[8839,"superset of or equal to"],[8853,"circled plus"],[8855,"circled times"],[8869,"perpendicular"],[8901,"dot operator"],[8968,"left ceiling"],[8969,"right ceiling"],[8970,"left floor"],[8971,"right floor"],[9001,"left-pointing angle bracket"],[9002,"right-pointing angle bracket"],[9674,"lozenge"],[9824,"black spade suit"],[9827,"black club suit"],[9829,"black heart suit"],[9830,"black diamond suit"],[8194,"en space"],[8195,"em space"],[8201,"thin space"],[8204,"zero width non-joiner"],[8205,"zero width joiner"],[8206,"left-to-right mark"],[8207,"right-to-left mark"]]}]);return t.length>1?[{name:"All",characters:h(t,(e=>e.characters))}].concat(t):t},S=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},k=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!a(n)||r+t.length<=n)},_=String.fromCodePoint,E=(e,t)=>{const o=[],n=t.toLowerCase();return((e,t)=>{for(let o=0,n=e.length;o{((e,t,o)=>!!k(_(e).toLowerCase(),o)||k(t.toLowerCase(),o)||k(t.toLowerCase().replace(/\s+/g,""),o))(e[0],e[1],n)&&o.push(e)})),u(o,(e=>({text:e[1],value:_(e[0]),icon:_(e[0])})))},T="pattern",O=(e,o)=>{const n=()=>[{label:"Search",type:"input",name:T},{type:"collection",name:"results"}],r=1===o.length?S(w):S("All"),a=((e,t)=>{let o=null;const n=()=>{s(o)||(clearTimeout(o),o=null)};return{cancel:n,throttle:(...r)=>{n(),o=setTimeout((()=>{o=null,e.apply(null,r)}),t)}}})((e=>{const t=e.getData().pattern;((e,t)=>{g(o,(e=>e.name===r.get())).each((o=>{const n=E(o,t);e.setData({results:n})}))})(e,t)}),40),i={title:"Special Character",size:"normal",body:1===o.length?{type:"panel",items:n()}:{type:"tabpanel",tabs:u(o,(e=>({title:e.name,name:e.name,items:n()})))},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{pattern:"",results:E(o[0],"")},onAction:(o,n)=>{"results"===n.name&&(t(e,n.value),o.close())},onTabChange:(e,t)=>{r.set(t.newTabName),a.throttle(e)},onChange:(e,t)=>{t.name===T&&a.throttle(e)}};e.windowManager.open(i).focus(T)},A=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",o),o(),()=>{e.off("NodeChange",o)}};e.add("charmap",(e=>{(e=>{const t=e.options.register,o=e=>i(e)||n(e);t("charmap",{processor:o}),t("charmap_append",{processor:o})})(e);const o=C(e);return((e,t)=>{e.addCommand("mceShowCharmap",(()=>{O(e,t)}))})(e,o),(e=>{const t=()=>e.execCommand("mceShowCharmap");e.ui.registry.addButton("charmap",{icon:"insert-character",tooltip:"Special character",onAction:t,onSetup:A(e)}),e.ui.registry.addMenuItem("charmap",{icon:"insert-character",text:"Special character...",onAction:t,onSetup:A(e)})})(e),((e,t)=>{e.ui.registry.addAutocompleter("charmap",{trigger:":",columns:"auto",minChars:2,fetch:(e,o)=>new Promise(((o,n)=>{o(E(t,e))})),onAction:(t,o,n)=>{e.selection.setRng(o),e.insertContent(n),t.hide()}})})(e,o[0]),(e=>({getCharMap:()=>C(e),insertChar:o=>{t(e,o)}}))(e)}))}(),tinymce.util.Tools.resolve("tinymce.PluginManager").add("code",(e=>((e=>{e.addCommand("mceCodeEditor",(()=>{(e=>{const t=(e=>e.getContent({source_view:!0}))(e);e.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:t},onSubmit:t=>{((e,t)=>{e.focus(),e.undoManager.transact((()=>{e.setContent(t)})),e.selection.setCursorLocation(),e.nodeChanged()})(e,t.getData().code),t.close()}})})(e)}))})(e),(e=>{const t=()=>e.execCommand("mceCodeEditor");e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:t}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:t})})(e),{}))),function(){var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>typeof t===e,o=(e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=r=e,n=(s=String).prototype,n.isPrototypeOf(o)||(null===(a=r.constructor)||void 0===a?void 0:a.name)===s.name)?"string":t;var o,n;var r,s,a})(t)===e)("string"),n=t("boolean"),r=e=>!(e=>null==e)(e),s=t("function"),a=t("number"),i=(l=!1,()=>l);var l;class c{constructor(e,t){this.tag=e,this.value=t}static some(e){return new c(!0,e)}static none(){return c.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?c.some(e(this.value)):c.none()}bind(e){return this.tag?e(this.value):c.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:c.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return r(e)?c.some(e):c.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}c.singletonNone=new c(!1);const d=(e,t)=>{for(let o=0,n=e.length;o{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},u={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return m(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return m(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return m(o)},fromDom:m,fromPoint:(e,t,o)=>c.from(e.dom.elementFromPoint(t,o)).map(m)},g=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}};"undefined"!=typeof window?window:Function("return this;")();const h=e=>t=>(e=>e.dom.nodeType)(t)===e,p=h(1),f=h(3),v=h(9),b=h(11),y=e=>((e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r{((e,t,r)=>{if(!(o(r)||n(r)||a(r)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",r,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,r+"")})(e.dom,t,r)},x=(e,t)=>{e.dom.removeAttribute(t)},C=s(Element.prototype.attachShadow)&&s(Node.prototype.getRootNode)?e=>u.fromDom(e.dom.getRootNode()):e=>{return v(e)?e:(t=e,u.fromDom(t.dom.ownerDocument));var t},S=e=>{const t=C(e);return b(o=t)&&r(o.dom.host)?c.some(t):c.none();var o},k=e=>u.fromDom(e.dom.host),_=e=>{const t=f(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return S(u.fromDom(t)).fold((()=>o.body.contains(t)),(n=_,r=k,e=>n(r(e))));var n,r},E=(e,t,o)=>((e,t,o)=>{let n=e.dom;const r=s(o)?o:i;for(;n.parentNode;){n=n.parentNode;const e=u.fromDom(n);if(t(e))return c.some(e);if(r(e))break}return c.none()})(e,(e=>g(e,t)),o),T=(e,t)=>(e=>void 0!==e.style&&s(e.style.getPropertyValue))(e)?e.style.getPropertyValue(t):"",O=e=>"rtl"===((e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||_(e)?n:T(o,t)})(e,"direction")?"rtl":"ltr",A=(e,t)=>((e,t)=>((e,t)=>{const o=[];for(let n=0,r=e.length;ng(e,t))),D=e=>(e=>c.from(e.dom.parentNode).map(u.fromDom))(e).filter(p),M=(N="li",e=>p(e)&&e.dom.nodeName.toLowerCase()===N);var N;const R=(e,t,o)=>{d(t,(t=>{const n=u.fromDom(t),r=M(n),s=((e,t)=>(t?E(e,"ol,ul"):c.some(e)).getOr(e))(n,r);D(s).each((t=>{e.setStyle(s.dom,"direction",null);if(O(t)===o?x(s,"dir"):w(s,"dir",o),O(s)!==o&&e.setStyle(s.dom,"direction",o),r){const t=A(s,"li[dir],li[style]");d(t,(t=>{x(t,"dir"),e.setStyle(t.dom,"direction",null)}))}}))}))},B=(e,t)=>{e.selection.isEditable()&&(R(e.dom,e.selection.getSelectedBlocks(),t),e.nodeChanged())},L=(e,t)=>o=>{const n=n=>{const r=u.fromDom(n.element);o.setActive(O(r)===t),o.setEnabled(e.selection.isEditable())};return e.on("NodeChange",n),o.setEnabled(e.selection.isEditable()),()=>e.off("NodeChange",n)};e.add("directionality",(e=>{(e=>{e.addCommand("mceDirectionLTR",(()=>{B(e,"ltr")})),e.addCommand("mceDirectionRTL",(()=>{B(e,"rtl")}))})(e),(e=>{e.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:()=>e.execCommand("mceDirectionLTR"),onSetup:L(e,"ltr")}),e.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:()=>e.execCommand("mceDirectionRTL"),onSetup:L(e,"rtl")})})(e)}))}(),function(){const e=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}};var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const o=e=>({isFullscreen:()=>null!==e.get()}),n=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=r=e,n=(s=String).prototype,n.isPrototypeOf(o)||(null===(a=r.constructor)||void 0===a?void 0:a.name)===s.name)?"string":t;var o,n;var r,s,a})(t)===e,r=e=>t=>typeof t===e,s=e=>t=>e===t,a=n("string"),i=n("object"),l=n("array"),c=s(null),d=r("boolean"),m=s(void 0),u=e=>!(e=>null==e)(e),g=r("function"),h=r("number"),p=()=>{},f=e=>()=>e;function v(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const b=f(!1),y=f(!0);class w{constructor(e,t){this.tag=e,this.value=t}static some(e){return new w(!0,e)}static none(){return w.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?w.some(e(this.value)):w.none()}bind(e){return this.tag?e(this.value):w.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:w.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return u(e)?w.some(e):w.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}w.singletonNone=new w(!1);const x=Array.prototype.push,C=(e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r{for(let o=0,n=e.length;o{const o=[];for(let n=0,r=e.length;n((e,t,o)=>{for(let n=0,r=e.length;n(e=>{const t=[];for(let o=0,n=e.length;o((e,t)=>t>=0&&t{const o=e(w.none()),n=()=>o.get().each(t);return{clear:()=>{n(),o.set(w.none())},isSet:()=>o.get().isSome(),get:()=>o.get(),set:e=>{n(),o.set(w.some(e))}}},A=()=>O((e=>e.unbind())),D=Object.keys,M="undefined"!=typeof window?window:Function("return this;")(),N=(e,t)=>((e,t)=>{let o=null!=t?t:M;for(let t=0;t{const o=((e,t)=>N(e,t))(e,t);if(null==o)throw new Error(e+" not available on this browser");return o},B=Object.getPrototypeOf,L=e=>{const t=N("ownerDocument.defaultView",e);return i(e)&&((e=>R("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(B(e).constructor.name))},H=e=>t=>(e=>e.dom.nodeType)(t)===e,I=H(1),P=H(3),F=H(9),z=H(11),V=(e,t,o)=>{((e,t,o)=>{if(!(a(o)||d(o)||h(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")})(e.dom,t,o)},Z=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},U=(e,t)=>{e.dom.removeAttribute(t)},j=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!m(n)||r+t.length<=n)},W=e=>void 0!==e.style&&g(e.style.getPropertyValue),$=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},q={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return $(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return $(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return $(o)},fromDom:$,fromPoint:(e,t,o)=>w.from(e.dom.elementFromPoint(t,o)).map($)},G=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},K=e=>q.fromDom(e.dom.ownerDocument),Y=e=>(e=>w.from(e.dom.parentNode).map(q.fromDom))(e).map(X).map((t=>k(t,(t=>{return o=t,!(e.dom===o.dom);var o})))).getOr([]),X=e=>C(e.dom.childNodes,q.fromDom),J=g(Element.prototype.attachShadow)&&g(Node.prototype.getRootNode),Q=f(J),ee=J?e=>q.fromDom(e.dom.getRootNode()):e=>F(e)?e:K(e),te=e=>{const t=ee(e);return z(o=t)&&u(o.dom.host)?w.some(t):w.none();var o},oe=e=>q.fromDom(e.dom.host),ne=e=>u(e.dom.shadowRoot),re=e=>{const t=P(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return te(q.fromDom(t)).fold((()=>o.body.contains(t)),(n=re,r=oe,e=>n(r(e))));var n,r},se=(e,t,o)=>{if(!a(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);W(e)&&e.style.setProperty(t,o)},ae=(e,t,o)=>{const n=e.dom;se(n,t,o)},ie=(e,t)=>{const o=e.dom;((e,t)=>{const o=D(e);for(let n=0,r=o.length;n{se(o,t,e)}))},le=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||re(e)?n:ce(o,t)},ce=(e,t)=>W(e)?e.style.getPropertyValue(t):"",de=e=>{const t=q.fromDom((e=>{if(Q()&&u(e.target)){const t=q.fromDom(e.target);if(I(t)&&ne(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return T(t)}}return w.from(e.target)})(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),r=(s=n,a=o,(...e)=>s(a.apply(null,e)));var s,a;return((e,t,o,n,r,s,a)=>({target:e,x:t,y:o,stop:n,prevent:r,kill:s,raw:a}))(t,e.clientX,e.clientY,o,n,r,e)},me=(e,t,o,n,r)=>{const s=((e,t)=>o=>{e(o)&&t(de(o))})(o,n);return e.dom.addEventListener(t,s,r),{unbind:v(ue,e,t,s,r)}},ue=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},ge=y,he=(e,t,o)=>((e,t,o,n)=>me(e,t,o,n,!1))(e,t,ge,o),pe=()=>fe(0,0),fe=(e,t)=>({major:e,minor:t}),ve={nu:fe,detect:(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?pe():((e,t)=>{const o=((e,t)=>{for(let o=0;oNumber(t.replace(o,"$"+e));return fe(n(1),n(2))})(e,o)},unknown:pe},be=(e,t)=>((e,t)=>{for(let o=0;o{const o=t.brand.toLowerCase();return _(e,(e=>{var t;return o===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:ve.nu(parseInt(t.version,10),0)})))})),ye=(e,t)=>{const o=String(t).toLowerCase();return _(e,(e=>e.search(o)))},we=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,xe=e=>t=>j(t,e),Ce=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>j(e,"edge/")&&j(e,"chrome")&&j(e,"safari")&&j(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,we],search:e=>j(e,"chrome")&&!j(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>j(e,"msie")||j(e,"trident")},{name:"Opera",versionRegexes:[we,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:xe("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:xe("firefox")},{name:"Safari",versionRegexes:[we,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(j(e,"safari")||j(e,"mobile/"))&&j(e,"applewebkit")}],Se=[{name:"Windows",search:xe("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>j(e,"iphone")||j(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:xe("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:xe("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:xe("linux"),versionRegexes:[]},{name:"Solaris",search:xe("sunos"),versionRegexes:[]},{name:"FreeBSD",search:xe("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:xe("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],ke={browsers:f(Ce),oses:f(Se)},_e="Edge",Ee="Chromium",Te="Opera",Oe="Firefox",Ae="Safari",De=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(_e),isChromium:n(Ee),isIE:n("IE"),isOpera:n(Te),isFirefox:n(Oe),isSafari:n(Ae)}},Me={unknown:()=>De({current:void 0,version:ve.unknown()}),nu:De,edge:f(_e),chromium:f(Ee),ie:f("IE"),opera:f(Te),firefox:f(Oe),safari:f(Ae)},Ne="Windows",Re="Android",Be="Linux",Le="macOS",He="Solaris",Ie="FreeBSD",Pe="ChromeOS",Fe=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(Ne),isiOS:n("iOS"),isAndroid:n(Re),isMacOS:n(Le),isLinux:n(Be),isSolaris:n(He),isFreeBSD:n(Ie),isChromeOS:n(Pe)}},ze={unknown:()=>Fe({current:void 0,version:ve.unknown()}),nu:Fe,windows:f(Ne),ios:f("iOS"),android:f(Re),linux:f(Be),macos:f(Le),solaris:f(He),freebsd:f(Ie),chromeos:f(Pe)},Ve=(e,t,o)=>{const n=ke.browsers(),r=ke.oses(),s=t.bind((e=>be(n,e))).orThunk((()=>((e,t)=>ye(e,t).map((e=>{const o=ve.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(n,e))).fold(Me.unknown,Me.nu),a=((e,t)=>ye(e,t).map((e=>{const o=ve.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(r,e).fold(ze.unknown,ze.nu),i=((e,t,o,n)=>{const r=e.isiOS()&&!0===/ipad/i.test(o),s=e.isiOS()&&!r,a=e.isiOS()||e.isAndroid(),i=a||n("(pointer:coarse)"),l=r||!s&&a&&n("(min-device-width:768px)"),c=s||a&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),m=!c&&!l&&!d;return{isiPad:f(r),isiPhone:f(s),isTablet:f(l),isPhone:f(c),isTouch:f(i),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:f(d),isDesktop:f(m)}})(a,s,e,o);return{browser:s,os:a,deviceType:i}},Ze=e=>window.matchMedia(e).matches;let Ue=(e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)})((()=>Ve(navigator.userAgent,w.from(navigator.userAgentData),Ze)));const je=(e,t)=>({left:e,top:t,translate:(o,n)=>je(e+o,t+n)}),We=je,$e=e=>{const t=void 0===e?window:e;return Ue().browser.isFirefox()?w.none():w.from(t.visualViewport)},qe=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),Ge=e=>{const t=void 0===e?window:e,o=t.document,n=(e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return We(o,n)})(q.fromDom(o));return $e(t).fold((()=>{const e=t.document.documentElement,o=e.clientWidth,r=e.clientHeight;return qe(n.left,n.top,o,r)}),(e=>qe(Math.max(e.pageLeft,n.left),Math.max(e.pageTop,n.top),e.width,e.height)))},Ke=(e,t,o)=>$e(o).map((o=>{const n=e=>t(de(e));return o.addEventListener(e,n),{unbind:()=>o.removeEventListener(e,n)}})).getOrThunk((()=>({unbind:p})));var Ye=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Xe=tinymce.util.Tools.resolve("tinymce.Env");const Je=(e,t)=>{e.dispatch("FullscreenStateChanged",{state:t}),e.dispatch("ResizeEditor")},Qe=(et="fullscreen_native",e=>e.options.get(et));var et;const tt=e=>{const t=q.fromDom(e.getElement());return te(t).map(oe).getOrThunk((()=>(e=>{const t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return q.fromDom(t)})(K(t))))},ot=e=>{return e.dom===(void 0!==(t=K(e).dom).fullscreenElement?t.fullscreenElement:void 0!==t.msFullscreenElement?t.msFullscreenElement:void 0!==t.webkitFullscreenElement?t.webkitFullscreenElement:null);var t},nt=(e,t,o)=>k(((e,t)=>{const o=g(t)?t:b;let n=e.dom;const r=[];for(;null!==n.parentNode&&void 0!==n.parentNode;){const e=n.parentNode,t=q.fromDom(e);if(r.push(t),!0===o(t))break;n=e}return r})(e,o),t),rt=e=>((e,t)=>{const o=document;return 1!==(n=o).nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount?[]:C(o.querySelectorAll(e),q.fromDom);var n})(e),st=(e,t,o)=>nt(e,(e=>G(e,t)),o),at=(e,t)=>((e,t)=>k(Y(e),t))(e,(e=>G(e,t))),it="data-ephox-mobile-fullscreen-style",lt="position:absolute!important;",ct="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",dt=Xe.os.isAndroid(),mt=(e,t,o)=>{const n=t=>o=>{const n=Z(o,"style"),r=void 0===n?"no-styles":n.trim();r!==t&&(V(o,it,r),ie(o,e.parseStyle(t)))},r=st(t,"*"),s=E(r,(e=>at(e,"*:not(.tox-silver-sink)"))),a=(e=>{const t=le(e,"background-color");return void 0!==t&&""!==t?"background-color:"+t+"!important":"background-color:rgb(255,255,255)!important;"})(o);S(s,n("display:none!important;")),S(r,n(lt+ct+a));n((!0===dt?"":lt)+ct+a)(t)},ut=Ye.DOM,gt=$e().fold((()=>({bind:p,unbind:p})),(e=>{const t=(()=>{const e=O(p);return{...e,on:t=>e.get().each(t)}})(),o=A(),n=A(),r=((e,t)=>{let o=null;return{cancel:()=>{c(o)||(clearTimeout(o),o=null)},throttle:(...n)=>{c(o)&&(o=setTimeout((()=>{o=null,e.apply(null,n)}),t))}}})((()=>{document.body.scrollTop=0,document.documentElement.scrollTop=0,window.requestAnimationFrame((()=>{t.on((t=>ie(t,{top:e.offsetTop+"px",left:e.offsetLeft+"px",height:e.height+"px",width:e.width+"px"})))}))}),50);return{bind:e=>{t.set(e),r.throttle(),o.set(Ke("resize",r.throttle)),n.set(Ke("scroll",r.throttle))},unbind:()=>{t.on((()=>{o.clear(),n.clear()})),t.clear()}}})),ht=(e,t)=>{const o=document.body,n=document.documentElement,r=e.getContainer(),s=q.fromDom(r),a=(i=s,w.from(i.dom.nextSibling).map(q.fromDom)).filter((e=>(e=>I(e)&&L(e.dom))(e)&&((e,t)=>(e=>void 0!==e.dom.classList)(e)&&e.dom.classList.contains(t))(e,"tox-silver-sink")));var i;const l=tt(e),c=t.get(),d=q.fromDom(e.getBody()),m=Xe.deviceType.isTouch(),u=r.style,g=e.iframeElement,h=null==g?void 0:g.style,p=e=>{e(o,"tox-fullscreen"),e(n,"tox-fullscreen"),e(r,"tox-fullscreen"),te(s).map((e=>oe(e).dom)).each((t=>{e(t,"tox-fullscreen"),e(t,"tox-shadowhost")}))},f=()=>{m&&(e=>{const t=rt("["+it+"]");S(t,(t=>{const o=Z(t,it);o&&"no-styles"!==o?ie(t,e.parseStyle(o)):U(t,"style"),U(t,it)}))})(e.dom),p(ut.removeClass),gt.unbind(),w.from(t.get()).each((e=>e.fullscreenChangeHandler.unbind()))};if(c)c.fullscreenChangeHandler.unbind(),Qe(e)&&ot(l)&&(e=>{const t=e.dom;t.exitFullscreen?t.exitFullscreen():t.msExitFullscreen?t.msExitFullscreen():t.webkitCancelFullScreen&&t.webkitCancelFullScreen()})(K(l)),h.width=c.iframeWidth,h.height=c.iframeHeight,u.width=c.containerWidth,u.height=c.containerHeight,u.top=c.containerTop,u.left=c.containerLeft,b=a,y=c.sinkCssPosition,x=(e,t)=>{ae(e,"position",t)},b.isSome()&&y.isSome()?w.some(x(b.getOrDie(),y.getOrDie())):w.none(),f(),v=c.scrollPos,window.scrollTo(v.x,v.y),t.set(null),Je(e,!1),e.off("remove",f);else{const o=he(K(l),void 0!==document.fullscreenElement?"fullscreenchange":void 0!==document.msFullscreenElement?"MSFullscreenChange":void 0!==document.webkitFullscreenElement?"webkitfullscreenchange":"fullscreenchange",(o=>{Qe(e)&&(ot(l)||null===t.get()||ht(e,t))})),n={scrollPos:Ge(window),containerWidth:u.width,containerHeight:u.height,containerTop:u.top,containerLeft:u.left,iframeWidth:h.width,iframeHeight:h.height,fullscreenChangeHandler:o,sinkCssPosition:a.map((e=>le(e,"position")))};m&&mt(e.dom,s,d),h.width=h.height="100%",u.width=u.height="",p(ut.addClass),a.each((e=>{ae(e,"position","fixed")})),gt.bind(s),e.on("remove",f),t.set(n),Qe(e)&&(e=>{const t=e.dom;t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.webkitRequestFullScreen&&t.webkitRequestFullScreen()})(l),Je(e,!0)}var v,b,y,x};var pt=tinymce.util.Tools.resolve("tinymce.util.VK");const ft=(e,t)=>o=>{o.setActive(null!==t.get());const n=e=>o.setActive(e.state);return e.on("FullscreenStateChanged",n),()=>e.off("FullscreenStateChanged",n)};t.add("fullscreen",(t=>{const n=e(null);return t.inline||((e=>{(0,e.options.register)("fullscreen_native",{processor:"boolean",default:!1})})(t),((e,t)=>{e.addCommand("mceFullScreen",(()=>{ht(e,t)}))})(t,n),((e,t)=>{const o=()=>e.execCommand("mceFullScreen");e.ui.registry.addToggleMenuItem("fullscreen",{text:"Fullscreen",icon:"fullscreen",shortcut:"Meta+Shift+F",onAction:o,onSetup:ft(e,t)}),e.ui.registry.addToggleButton("fullscreen",{tooltip:"Fullscreen",icon:"fullscreen",onAction:o,onSetup:ft(e,t),shortcut:"Meta+Shift+F"})})(t,n),((e,t)=>{e.on("init",(()=>{e.on("keydown",(e=>{e.keyCode!==pt.TAB||e.metaKey||e.ctrlKey||!t.get()||e.preventDefault()}))}))})(t,n),t.addShortcut("Meta+Shift+F","","mceFullScreen")),o(n)}))}(),function(){var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=r=e,n=(s=String).prototype,n.isPrototypeOf(o)||(null===(a=r.constructor)||void 0===a?void 0:a.name)===s.name)?"string":t;var o,n;var r,s,a})(t)===e,o=e=>t=>typeof t===e,n=t("string"),r=t("object"),s=t("array"),a=(i=null,e=>i===e);var i;const l=o("boolean"),c=e=>!(e=>null==e)(e),d=o("function"),m=(e,t)=>{if(s(e)){for(let o=0,n=e.length;o{},g=(e,t)=>e===t;class h{constructor(e,t){this.tag=e,this.value=t}static some(e){return new h(!0,e)}static none(){return h.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?h.some(e(this.value)):h.none()}bind(e){return this.tag?e(this.value):h.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:h.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return c(e)?h.some(e):h.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}h.singletonNone=new h(!1);const p=Array.prototype.indexOf,f=Array.prototype.push,v=(e,t)=>((e,t)=>p.call(e,t))(e,t)>-1,b=e=>{const t=[];for(let o=0,n=e.length;ob(((e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r{for(let o=0;oe.exists((e=>o(e,t))),C=e=>{const t=[],o=e=>{t.push(e)};for(let t=0;te?h.some(t):h.none(),k=e=>t=>t.options.get(e),_=k("link_assume_external_targets"),E=k("link_context_toolbar"),T=k("link_list"),O=k("link_default_target"),A=k("link_default_protocol"),D=k("link_target_list"),M=k("link_rel_list"),N=k("link_class_list"),R=k("link_title"),B=k("allow_unsafe_link_target"),L=k("link_quicklink"),H=Object.keys,I=Object.hasOwnProperty,P=(e,t,o,n)=>{((e,t)=>{const o=H(e);for(let n=0,r=o.length;n{(t(e,r)?o:n)(e,r)}))},F=(e,t)=>I.call(e,t);var z=tinymce.util.Tools.resolve("tinymce.util.URI"),V=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Z=tinymce.util.Tools.resolve("tinymce.util.Tools");const U=e=>c(e)&&"a"===e.nodeName.toLowerCase(),j=e=>U(e)&&!!q(e),W=(e,t)=>{if(e.collapsed)return[];{const o=e.cloneContents(),n=o.firstChild,r=new V(n,o),s=[];let a=n;do{t(a)&&s.push(a)}while(a=r.next());return s}},$=e=>/^\w+:/i.test(e),q=e=>{var t,o;return null!==(o=null!==(t=e.getAttribute("data-mce-href"))&&void 0!==t?t:e.getAttribute("href"))&&void 0!==o?o:""},G=(e,t)=>{const o=["noopener"],n=e?e.split(/\s+/):[],r=e=>e.filter((e=>-1===Z.inArray(o,e))),s=t?(e=>(e=r(e)).length>0?e.concat(o):o)(n):r(n);return s.length>0?(e=>Z.trim(e.sort().join(" ")))(s):""},K=(e,t)=>(t=t||J(e.selection.getRng())[0]||e.selection.getNode(),oe(t)?h.from(e.dom.select("a[href]",t)[0]):h.from(e.dom.getParent(t,"a[href]"))),Y=(e,t)=>K(e,t).isSome(),X=(e,t)=>(e=>e.replace(/\uFEFF/g,""))(t.fold((()=>e.getContent({format:"text"})),(e=>e.innerText||e.textContent||""))),J=e=>W(e,j),Q=e=>Z.grep(e,j),ee=e=>Q(e).length>0,te=e=>{const t=e.schema.getTextInlineElements(),o=e=>1===e.nodeType&&!U(e)&&!F(t,e.nodeName.toLowerCase());if(K(e).exists((e=>e.hasAttribute("data-mce-block"))))return!1;const n=e.selection.getRng();if(n.collapsed)return!0;return 0===W(n,o).length},oe=e=>c(e)&&"FIGURE"===e.nodeName&&/\bimage\b/i.test(e.className),ne=(e,t)=>{const o={...t};if(0===M(e).length&&!B(e)){const e=G(o.rel,"_blank"===o.target);o.rel=e||null}return h.from(o.target).isNone()&&!1===D(e)&&(o.target=O(e)),o.href=((e,t)=>"http"!==t&&"https"!==t||$(e)?e:t+"://"+e)(o.href,_(e)),o},re=(e,t,o)=>{const n=e.selection.getNode(),r=K(e,n),s=ne(e,(e=>{return t=["title","rel","class","target"],o=(t,o)=>(e[o].each((e=>{t[o]=e.length>0?e:null})),t),n={href:e.href},((e,t)=>{for(let o=0,n=e.length;o{n=o(n,e,t)})),n;var t,o,n})(o));e.undoManager.transact((()=>{o.href===t.href&&t.attach(),r.fold((()=>{((e,t,o,n)=>{const r=e.dom;oe(t)?ce(r,t,n):o.fold((()=>{e.execCommand("mceInsertLink",!1,n)}),(t=>{e.insertContent(r.createHTML("a",n,r.encode(t)))}))})(e,n,o.text,s)}),(t=>{e.focus(),((e,t,o,n)=>{o.each((e=>{F(t,"innerText")?t.innerText=e:t.textContent=e})),e.dom.setAttribs(t,n),e.selection.select(t)})(e,t,o.text,s)}))}))},se=e=>{const{class:t,href:o,rel:n,target:r,text:s,title:i}=e;return((e,t)=>{const o={};var n;return P(e,t,(n=o,(e,t)=>{n[t]=e}),u),o})({class:t.getOrNull(),href:o,rel:n.getOrNull(),target:r.getOrNull(),text:s.getOrNull(),title:i.getOrNull()},((e,t)=>!1===a(e)))},ae=(e,t,o)=>{const n=((e,t)=>{const o=e.options.get,n={allow_html_data_urls:o("allow_html_data_urls"),allow_script_urls:o("allow_script_urls"),allow_svg_data_urls:o("allow_svg_data_urls")},r=t.href;return{...t,href:z.isDomSafe(r,"a",n)?r:""}})(e,o);e.hasPlugin("rtc",!0)?e.execCommand("createlink",!1,se(n)):re(e,t,n)},ie=e=>{e.hasPlugin("rtc",!0)?e.execCommand("unlink"):(e=>{e.undoManager.transact((()=>{const t=e.selection.getNode();oe(t)?le(e,t):(e=>{const t=e.dom,o=e.selection,n=o.getBookmark(),r=o.getRng().cloneRange(),s=t.getParent(r.startContainer,"a[href]",e.getBody()),a=t.getParent(r.endContainer,"a[href]",e.getBody());s&&r.setStartBefore(s),a&&r.setEndAfter(a),o.setRng(r),e.execCommand("unlink"),o.moveToBookmark(n)})(e),e.focus()}))})(e)},le=(e,t)=>{var o;const n=e.dom.select("img",t)[0];if(n){const r=e.dom.getParents(n,"a[href]",t)[0];r&&(null===(o=r.parentNode)||void 0===o||o.insertBefore(n,r),e.dom.remove(r))}},ce=(e,t,o)=>{var n;const r=e.select("img",t)[0];if(r){const t=e.create("a",o);null===(n=r.parentNode)||void 0===n||n.insertBefore(t,r),t.appendChild(r)}},de=e=>n(e.value)?e.value:"",me=(e,t)=>{const o=[];return Z.each(e,(e=>{const r=(e=>n(e.text)?e.text:n(e.title)?e.title:"")(e);if(void 0!==e.menu){const n=me(e.menu,t);o.push({text:r,items:n})}else{const n=t(e);o.push({text:r,value:n})}})),o},ue=(e=de)=>t=>h.from(t).map((t=>me(t,e))),ge={sanitize:e=>ue(de)(e),sanitizeWith:ue,createUi:(e,t)=>o=>({name:e,type:"listbox",label:t,items:o}),getValue:de},he=e=>{return F(t=e,o="items")&&void 0!==t[o]&&null!==t[o];var t,o},pe=(e,t)=>w(t,(t=>he(t)?pe(e,t.items):S(t.value===e,t))),fe=(e,t,o,n)=>{const r=n[t],s=e.length>0;return void 0!==r?pe(r,o).map((t=>({url:{value:t.value,meta:{text:s?e:t.text,attach:u}},text:s?e:t.text}))):h.none()},ve=(e,t)=>{const o={text:e.text,title:e.title},n=e=>{const t=(n=e.url,S(o.text.length<=0,h.from(null===(r=n.meta)||void 0===r?void 0:r.text).getOr(n.value)));var n,r;const s=(e=>{var t;return S(o.title.length<=0,h.from(null===(t=e.meta)||void 0===t?void 0:t.title).getOr(""))})(e.url);return t.isSome()||s.isSome()?h.some({...t.map((e=>({text:e}))).getOr({}),...s.map((e=>({title:e}))).getOr({})}):h.none()},r=(e,n)=>{const r=(s=t,a=n,"link"===a?s.link:"anchor"===a?s.anchor:h.none()).getOr([]);var s,a;return fe(o.text,n,r,e)};return{onChange:(e,t)=>{const s=t.name;return"url"===s?n(e()):v(["anchor","link"],s)?r(e(),s):"text"===s||"title"===s?(o[s]=e()[s],h.none()):h.none()}}};var be=tinymce.util.Tools.resolve("tinymce.util.Delay");const ye=e=>{const t=e.href;return t.indexOf("@")>0&&-1===t.indexOf("/")&&-1===t.indexOf("mailto:")?h.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:e=>({...e,href:"mailto:"+t})}):h.none()},we=(e,t)=>o=>{const n=o.href;return 1===e&&!$(n)||0===e&&/^\s*www(\.|\d\.)/i.test(n)?h.some({message:`The URL you entered seems to be an external link. Do you want to add the required ${t}:// prefix?`,preprocess:e=>({...e,href:t+"://"+n})}):h.none()},xe=(e,t)=>w([ye,we(_(e),A(e))],(e=>e(t))).fold((()=>Promise.resolve(t)),(o=>new Promise((n=>{((e,t,o)=>{const n=e.selection.getRng();be.setEditorTimeout(e,(()=>{e.windowManager.confirm(t,(t=>{e.selection.setRng(n),o(t)}))}))})(e,o.message,(e=>{n(e?o.preprocess(t):t)}))})))),Ce=e=>{const t=e.dom.select("a:not([href])"),o=y(t,(e=>{const t=e.name||e.id;return t?[{text:t,value:"#"+t}]:[]}));return o.length>0?h.some([{text:"None",value:""}].concat(o)):h.none()},Se=e=>{const t=N(e);return t.length>0?ge.sanitize(t):h.none()},ke=e=>{try{return h.some(JSON.parse(e))}catch(e){return h.none()}},_e=e=>{const t=t=>e.convertURL(t.value||t.url||"","href"),o=T(e);return new Promise((e=>{n(o)?fetch(o).then((e=>e.ok?e.text().then(ke):Promise.reject())).then(e,(()=>e(h.none()))):d(o)?o((t=>e(h.some(t)))):e(h.from(o))})).then((e=>e.bind(ge.sanitizeWith(t)).map((e=>{if(e.length>0){return[{text:"None",value:""}].concat(e)}return e}))))},Ee=(e,t)=>{const o=M(e);if(o.length>0){const n=x(t,"_blank"),r=e=>G(ge.getValue(e),n);return(!1===B(e)?ge.sanitizeWith(r):ge.sanitize)(o)}return h.none()},Te=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Oe=e=>{const t=D(e);return s(t)?ge.sanitize(t).orThunk((()=>h.some(Te))):!1===t?h.none():h.some(Te)},Ae=(e,t,o)=>{const n=e.getAttrib(t,o);return null!==n&&n.length>0?h.some(n):h.none()},De=(e,t)=>_e(e).then((o=>{const n=((e,t)=>{const o=e.dom,n=te(e)?h.some(X(e.selection,t)):h.none(),r=t.bind((e=>h.from(o.getAttrib(e,"href")))),s=t.bind((e=>h.from(o.getAttrib(e,"target")))),a=t.bind((e=>Ae(o,e,"rel"))),i=t.bind((e=>Ae(o,e,"class")));return{url:r,text:n,title:t.bind((e=>Ae(o,e,"title"))),target:s,rel:a,linkClass:i}})(e,t);return{anchor:n,catalogs:{targets:Oe(e),rels:Ee(e,n.target),classes:Se(e),anchor:Ce(e),link:o},optNode:t,flags:{titleEnabled:R(e)}}})),Me=e=>{const t=(e=>{const t=K(e);return De(e,t)})(e);t.then((t=>{const o=((e,t)=>o=>{const n=o.getData();if(!n.url.value)return ie(e),void o.close();const r=e=>h.from(n[e]).filter((o=>!x(t.anchor[e],o))),s={href:n.url.value,text:r("text"),target:r("target"),rel:r("rel"),class:r("linkClass"),title:r("title")},a={href:n.url.value,attach:void 0!==n.url.meta&&n.url.meta.attach?n.url.meta.attach:u};xe(e,s).then((t=>{ae(e,a,t)})),o.close()})(e,t);return((e,t,o)=>{const n=e.anchor.text.map((()=>({name:"text",type:"input",label:"Text to display"}))).toArray(),r=e.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],s=((e,t)=>{const o=e.anchor,n=o.url.getOr("");return{url:{value:n,meta:{original:{value:n}}},text:o.text.getOr(""),title:o.title.getOr(""),anchor:n,link:n,rel:o.rel.getOr(""),target:o.target.or(t).getOr(""),linkClass:o.linkClass.getOr("")}})(e,h.from(O(o))),a=e.catalogs,i=ve(s,a);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:b([[{name:"url",type:"urlinput",filetype:"file",label:"URL",picker_text:"Browse links"}],n,r,C([a.anchor.map(ge.createUi("anchor","Anchors")),a.rels.map(ge.createUi("rel","Rel")),a.targets.map(ge.createUi("target","Open link in...")),a.link.map(ge.createUi("link","Link list")),a.classes.map(ge.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:s,onChange:(e,{name:t})=>{i.onChange(e.getData,{name:t}).each((t=>{e.setData(t)}))},onSubmit:t}})(t,o,e)})).then((t=>{e.windowManager.open(t)}))},Ne=()=>{const e=(e=>{const t=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})(h.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(h.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(h.some(e))}}})(u);return{...e,on:t=>e.get().each(t)}};var Re=tinymce.util.Tools.resolve("tinymce.util.VK");const Be=e=>{const t=document.createElement("a");t.target="_blank",t.href=e,t.rel="noreferrer noopener";const o=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});document.dispatchEvent(o),((e,t)=>{document.body.appendChild(e),e.dispatchEvent(t),document.body.removeChild(e)})(t,o)},Le=(e,t)=>{if(t){const o=q(t);if(/^#/.test(o)){const t=e.dom.select(o);t.length&&e.selection.scrollIntoView(t[0],!0)}else Be(t.href)}},He=(e,t)=>{const o=Q(e.dom.getParents(t));return S(1===o.length,o[0])},Ie=e=>e.selection.isCollapsed()||(e=>{const t=e.selection.getRng(),o=t.startContainer;return j(o)&&t.startContainer===t.endContainer&&1===e.dom.select("img",o).length})(e)?He(e,e.selection.getStart()):(e=>{const t=J(e.selection.getRng());return S(t.length>0,t[0]).or(He(e,e.selection.getNode()))})(e),Pe=e=>()=>{e.execCommand("mceLink",!1,{dialog:!0})},Fe=(e,t)=>(e.on("NodeChange",t),()=>e.off("NodeChange",t)),ze=e=>t=>{const o=()=>{t.setActive(!e.mode.isReadOnly()&&Y(e,e.selection.getNode())),t.setEnabled(e.selection.isEditable())};return o(),Fe(e,o)},Ve=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return o(),Fe(e,o)},Ze=e=>t=>{const o=t=>{return ee(t)||(o=e.selection.getRng(),J(o).length>0);var o},n=e.dom.getParents(e.selection.getStart()),r=n=>{t.setEnabled(o(n)&&e.selection.isEditable())};return r(n),Fe(e,(e=>r(e.parents)))},Ue=(e,t)=>{const o=t=>{const o=e.selection.getNode();return t.setEnabled(Y(e,o)),u};e.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:ze(e)},label:"Link",predicate:t=>E(e)&&Y(e,t),initValue:()=>K(e).fold((e=>()=>e)(""),q),commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:t=>{const o=e.selection.getNode();return t.setActive(Y(e,o)),ze(e)(t)},onAction:t=>{const o=t.getValue(),n=(t=>{const o=K(e),n=te(e);if(o.isNone()&&n){const n=X(e.selection,o);return S(0===n.length,t)}return h.none()})(o);ae(e,{href:o,attach:u},{href:o,text:n,title:h.none(),rel:h.none(),target:h.from(O(e)),class:h.none()}),(e=>{e.selection.collapse(!1)})(e),t.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:o,onAction:t=>{ie(e),t.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:o,onAction:e=>{t.gotoSelectedLink(),e.hide()}}]})},je=e=>{const t=(e=>{const t=Ne(),o=()=>t.get().or(Ie(e));return e.on("contextmenu",(o=>{He(e,o.target).each(t.set)})),e.on("SelectionChange",(()=>{t.isSet()||Ie(e).each(t.set)})),e.on("click",(o=>{t.clear();const n=Q(e.dom.getParents(o.target));1===n.length&&Re.metaKeyPressed(o)&&(o.preventDefault(),Le(e,n[0]))})),e.on("keydown",(n=>{t.clear(),!n.isDefaultPrevented()&&13===n.keyCode&&(e=>!0===e.altKey&&!1===e.shiftKey&&!1===e.ctrlKey&&!1===e.metaKey)(n)&&o().each((t=>{n.preventDefault(),Le(e,t)}))})),{gotoSelectedLink:()=>o().each((t=>Le(e,t)))}})(e);((e,t)=>{e.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Meta+K",onAction:Pe(e),onSetup:ze(e)}),e.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:t.gotoSelectedLink,onSetup:Ze(e)}),e.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:()=>ie(e),onSetup:Ze(e)})})(e,t),((e,t)=>{e.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:t.gotoSelectedLink,onSetup:Ze(e)}),e.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:Pe(e),onSetup:Ve(e)}),e.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:()=>ie(e),onSetup:Ze(e)})})(e,t),(e=>{e.ui.registry.addContextMenu("link",{update:t=>e.dom.isEditable(t)?ee(e.dom.getParents(t,"a"))?"link unlink openlink":"link":""})})(e),Ue(e,t)};e.add("link",(e=>{(e=>{const t=e.options.register;t("link_assume_external_targets",{processor:e=>{const t=n(e)||l(e);return t?!0===e?{value:1,valid:t}:"http"===e||"https"===e?{value:e,valid:t}:{value:0,valid:t}:{valid:!1,message:"Must be a string or a boolean."}},default:!1}),t("link_context_toolbar",{processor:"boolean",default:!1}),t("link_list",{processor:e=>n(e)||d(e)||m(e,r)}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"}),t("link_target_list",{processor:e=>l(e)||m(e,r),default:!0}),t("link_rel_list",{processor:"object[]",default:[]}),t("link_class_list",{processor:"object[]",default:[]}),t("link_title",{processor:"boolean",default:!0}),t("allow_unsafe_link_target",{processor:"boolean",default:!1}),t("link_quicklink",{processor:"boolean",default:!1})})(e),(e=>{e.addCommand("mceLink",((t,o)=>{!0!==(null==o?void 0:o.dialog)&&L(e)?e.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"}):Me(e)}))})(e),je(e),(e=>{e.addShortcut("Meta+K","",(()=>{e.execCommand("mceLink")}))})(e)}))}(),function(){var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=r=e,n=(s=String).prototype,n.isPrototypeOf(o)||(null===(a=r.constructor)||void 0===a?void 0:a.name)===s.name)?"string":t;var o,n;var r,s,a})(t)===e,o=e=>t=>typeof t===e,n=t("string"),r=t("object"),s=t("array"),a=o("boolean"),i=e=>!(e=>null==e)(e),l=o("function"),c=o("number"),d=()=>{},m=e=>()=>e,u=(e,t)=>e===t;const g=e=>t=>!e(t),h=m(!1);class p{constructor(e,t){this.tag=e,this.value=t}static some(e){return new p(!0,e)}static none(){return p.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?p.some(e(this.value)):p.none()}bind(e){return this.tag?e(this.value):p.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:p.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return i(e)?p.some(e):p.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}p.singletonNone=new p(!1);const f=Array.prototype.slice,v=Array.prototype.indexOf,b=Array.prototype.push,y=(e,t)=>{return o=e,n=t,v.call(o,n)>-1;var o,n},w=(e,t)=>{for(let o=0,n=e.length;o{const o=e.length,n=new Array(o);for(let r=0;r{for(let o=0,n=e.length;o{const o=[];for(let n=0,r=e.length;n(C(e,((e,n)=>{o=t(o,e,n)})),o),_=(e,t,o)=>{for(let n=0,r=e.length;n_(e,t,h),T=(e,t)=>(e=>{const t=[];for(let o=0,n=e.length;o{const t=f.call(e,0);return t.reverse(),t},A=(e,t)=>t>=0&&tA(e,0),M=e=>A(e,e.length-1),N=(e,t)=>{const o=[],n=l(t)?e=>w(o,(o=>t(o,e))):e=>y(o,e);for(let t=0,r=e.length;te.exists((e=>o(e,t))),B=(e,t,o)=>e.isSome()&&t.isSome()?p.some(o(e.getOrDie(),t.getOrDie())):p.none(),L=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},H={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return L(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return L(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return L(o)},fromDom:L,fromPoint:(e,t,o)=>p.from(e.dom.elementFromPoint(t,o)).map(L)},I=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},P=(e,t)=>e.dom===t.dom,F=I,z="undefined"!=typeof window?window:Function("return this;")(),V=(e,t)=>((e,t)=>{let o=null!=t?t:z;for(let t=0;t{const o=((e,t)=>V(e,t))(e,t);if(null==o)throw new Error(e+" not available on this browser");return o},U=Object.getPrototypeOf,j=e=>{const t=V("ownerDocument.defaultView",e);return r(e)&&((e=>Z("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(U(e).constructor.name))},W=e=>e.dom.nodeName.toLowerCase(),$=e=>e.dom.nodeType,q=e=>t=>$(t)===e,G=e=>K(e)&&j(e.dom),K=q(1),Y=q(3),X=q(9),J=q(11),Q=e=>t=>K(t)&&W(t)===e,ee=e=>p.from(e.dom.parentNode).map(H.fromDom),te=e=>x(e.dom.childNodes,H.fromDom),oe=(e,t)=>{const o=e.dom.childNodes;return p.from(o[t]).map(H.fromDom)},ne=e=>oe(e,0),re=e=>oe(e,e.dom.childNodes.length-1),se=l(Element.prototype.attachShadow)&&l(Node.prototype.getRootNode)?e=>H.fromDom(e.dom.getRootNode()):e=>{return X(e)?e:(t=e,H.fromDom(t.dom.ownerDocument));var t},ae=e=>{const t=se(e);return J(o=t)&&i(o.dom.host)?p.some(t):p.none();var o},ie=e=>H.fromDom(e.dom.host),le=e=>{const t=Y(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return ae(H.fromDom(t)).fold((()=>o.body.contains(t)),(n=le,r=ie,e=>n(r(e))));var n,r};var ce=(e,t,o,n,r)=>e(o,n)?p.some(o):l(r)&&r(o)?p.none():t(o,n,r);const de=(e,t,o)=>{let n=e.dom;const r=l(o)?o:h;for(;n.parentNode;){n=n.parentNode;const e=H.fromDom(n);if(t(e))return p.some(e);if(r(e))break}return p.none()},me=(e,t,o)=>ce(((e,t)=>t(e)),de,e,t,o),ue=(e,t,o)=>de(e,(e=>I(e,t)),o),ge=e=>{return ce(((e,t)=>I(e,t)),ue,e,"[contenteditable]",t);var t},he=e=>e.dom.contentEditable,pe=(e,t)=>{ee(e).each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},fe=(e,t)=>{const o=(e=>p.from(e.dom.nextSibling).map(H.fromDom))(e);o.fold((()=>{ee(e).each((e=>{ve(e,t)}))}),(e=>{pe(e,t)}))},ve=(e,t)=>{e.dom.appendChild(t.dom)},be=(e,t)=>{C(t,(t=>{ve(e,t)}))},ye=e=>{e.dom.textContent="",C(te(e),(e=>{we(e)}))},we=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)};var xe=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Ce=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Se=tinymce.util.Tools.resolve("tinymce.util.VK");const ke=e=>x(e,H.fromDom),_e=Object.keys,Ee=(e,t)=>{const o=_e(e);for(let n=0,r=o.length;n{const o={};var n;return((e,t,o,n)=>{Ee(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))})(e,t,(n=o,(e,t)=>{n[t]=e}),d),o},Oe=(e,t)=>{const o=e.dom;Ee(t,((e,t)=>{((e,t,o)=>{if(!(n(o)||a(o)||c(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")})(o,t,e)}))},Ae=e=>k(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}),De=e=>((e,t)=>H.fromDom(e.dom.cloneNode(t)))(e,!0),Me=(e,t)=>{const o=((e,t)=>{const o=H.fromTag(t),n=Ae(e);return Oe(o,n),o})(e,t);fe(e,o);const n=te(e);return be(o,n),we(e),o};var Ne=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Re=tinymce.util.Tools.resolve("tinymce.util.Tools");const Be=e=>t=>i(t)&&t.nodeName.toLowerCase()===e,Le=e=>t=>i(t)&&e.test(t.nodeName),He=e=>i(e)&&3===e.nodeType,Ie=e=>i(e)&&1===e.nodeType,Pe=Le(/^(OL|UL|DL)$/),Fe=Le(/^(OL|UL)$/),ze=Be("ol"),Ve=Le(/^(LI|DT|DD)$/),Ze=Le(/^(DT|DD)$/),Ue=Le(/^(TH|TD)$/),je=Be("br"),We=(e,t)=>i(t)&&t.nodeName in e.schema.getTextBlockElements(),$e=(e,t)=>i(e)&&e.nodeName in t,qe=(e,t)=>i(t)&&t.nodeName in e.schema.getVoidElements(),Ge=(e,t,o)=>{const n=e.isEmpty(t);return!(o&&e.select("span[data-mce-type=bookmark]",t).length>0)&&n},Ke=(e,t)=>e.isChildOf(t,e.getRoot()),Ye=e=>t=>t.options.get(e),Xe=Ye("lists_indent_on_tab"),Je=Ye("forced_root_block"),Qe=Ye("forced_root_block_attrs"),et=(e,t,o={})=>{const n=e.dom,r=e.schema.getBlockElements(),s=n.createFragment(),a=Je(e),i=Qe(e);let l,c,d=!1;for(c=n.create(a,{...i,...o.style?{style:o.style}:{}}),$e(t.firstChild,r)||s.appendChild(c);l=t.firstChild;){const e=l.nodeName;d||"SPAN"===e&&"bookmark"===l.getAttribute("data-mce-type")||(d=!0),$e(l,r)?(s.appendChild(l),c=null):(c||(c=n.create(a,i),s.appendChild(c)),c.appendChild(l))}return!d&&c&&c.appendChild(n.create("br",{"data-mce-bogus":"1"})),s},tt=Ne.DOM,ot=(e,t,o)=>{const n=tt.select('span[data-mce-type="bookmark"]',t),r=et(e,o),s=tt.createRng();s.setStartAfter(o),s.setEndAfter(t);const a=s.extractContents();for(let t=a.firstChild;t;t=t.firstChild)if("LI"===t.nodeName&&e.dom.isEmpty(t)){tt.remove(t);break}e.dom.isEmpty(a)||tt.insertAfter(a,t),tt.insertAfter(r,t);const i=o.parentElement;i&&Ge(e.dom,i)&&(e=>{const t=e.parentNode;t&&Re.each(n,(e=>{t.insertBefore(e,o.parentNode)})),tt.remove(e)})(i),tt.remove(o),Ge(e.dom,t)&&tt.remove(t)},nt=Q("dd"),rt=Q("dt"),st=(e,t)=>{var o;nt(t)?Me(t,"dt"):rt(t)&&(o=t,p.from(o.dom.parentElement).map(H.fromDom)).each((o=>ot(e,o.dom,t.dom)))},at=e=>{rt(e)&&Me(e,"dd")},it=(e,t)=>{if(He(e))return{container:e,offset:t};const o=xe.getNode(e,t);return He(o)?{container:o,offset:t>=e.childNodes.length?o.data.length:0}:o.previousSibling&&He(o.previousSibling)?{container:o.previousSibling,offset:o.previousSibling.data.length}:o.nextSibling&&He(o.nextSibling)?{container:o.nextSibling,offset:0}:{container:e,offset:t}},lt=e=>{const t=e.cloneRange(),o=it(e.startContainer,e.startOffset);t.setStart(o.container,o.offset);const n=it(e.endContainer,e.endOffset);return t.setEnd(n.container,n.offset),t},ct=["OL","UL","DL"],dt=ct.join(","),mt=(e,t)=>{const o=t||e.selection.getStart(!0);return e.dom.getParent(o,dt,pt(e,o))},ut=e=>{const t=mt(e),o=e.selection.getSelectedBlocks();return((e,t)=>i(e)&&1===t.length&&t[0]===e)(t,o)?(e=>S(e.querySelectorAll(dt),Pe))(t):S(o,(e=>Pe(e)&&t!==e))},gt=e=>{const t=e.selection.getSelectedBlocks();return S(((e,t)=>{const o=Re.map(t,(t=>e.dom.getParent(t,"li,dd,dt",pt(e,t))||t));return N(o)})(e,t),Ve)},ht=(e,t)=>{const o=e.dom.getParents(t,"TD,TH");return o.length>0?o[0]:e.getBody()},pt=(e,t)=>{const o=e.dom.getParents(t,e.dom.isBlock),n=E(o,(t=>{return(t=>t.nodeName.toLowerCase()!==Je(e))(t)&&(o=e.schema,!Pe(n=t)&&!Ve(n)&&w(ct,(e=>o.isValidChild(n.nodeName,e))));var o,n}));return n.getOr(e.getBody())},ft=(e,t)=>{const o=e.dom.getParents(t,"ol,ul",pt(e,t));return M(o)},vt=e=>{const t=(e=>{const t=ft(e,e.selection.getStart()),o=S(e.selection.getSelectedBlocks(),Fe);return t.toArray().concat(o)})(e),o=(e=>{const t=e.selection.getStart();return e.dom.getParents(t,"ol,ul",pt(e,t))})(e);return E(o,(e=>{return t=H.fromDom(e),ee(t).exists((e=>Ve(e.dom)&&ne(e).exists((e=>!Pe(e.dom)))&&re(e).exists((e=>!Pe(e.dom)))));var t})).fold((()=>bt(e,t)),(e=>[e]))},bt=(e,t)=>{const o=x(t,(t=>ft(e,t).getOr(t)));return N(o)},yt=e=>/\btox\-/.test(e.className),wt=(e,t)=>_(e,Pe,Ue).exists((e=>e.nodeName===t&&!yt(e))),xt=(e,t)=>null!==t&&!e.dom.isEditable(t),Ct=(e,t)=>{const o=e.dom.getParent(t,"ol,ul,dl");return xt(e,o)},St=(e,t)=>{const o=e.selection.getNode();return t({parents:e.dom.getParents(o),element:o}),e.on("NodeChange",t),()=>e.off("NodeChange",t)},kt=(e,t)=>{const o=document.createDocumentFragment();return C(e,(e=>{o.appendChild(e.dom)})),H.fromDom(o)},_t=(e,t,o)=>e.dispatch("ListMutation",{action:t,element:o}),Et=(Tt=/^\s+|\s+$/g,e=>e.replace(Tt,""));var Tt;const Ot=(e,t,o)=>{if(!n(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);(e=>void 0!==e.style&&l(e.style.getPropertyValue))(e)&&e.style.setProperty(t,o)},At=(e,t,o)=>{const n=e.dom;Ot(n,t,o)},Dt=e=>F(e,"OL,UL"),Mt=e=>ne(e).exists(Dt),Nt=e=>"listAttributes"in e,Rt=e=>"isComment"in e,Bt=e=>e.depth>0,Lt=e=>e.isSelected,Ht=e=>{const t=te(e),o=re(e).exists(Dt)?t.slice(0,-1):t;return x(o,De)},It=(e,t)=>{ve(e.item,t.list)},Pt=(e,t)=>{const o={list:H.fromTag(t,e),item:H.fromTag("li",e)};return ve(o.list,o.item),o},Ft=(e,t,o)=>{const n=t.slice(0,o.depth);return M(n).each((t=>{if(Nt(o)){const n=((e,t,o)=>{const n=H.fromTag("li",e);return Oe(n,t),be(n,o),n})(e,o.itemAttributes,o.content);((e,t)=>{ve(e.list,t),e.item=t})(t,n),((e,t)=>{W(e.list)!==t.listType&&(e.list=Me(e.list,t.listType)),Oe(e.list,t.listAttributes)})(t,o)}else if((e=>"isFragment"in e)(o))be(t.item,o.content);else{const e=H.fromHtml(`\x3c!--${o.content}--\x3e`);ve(t.list,e)}})),n},zt=(e,t,o)=>{const n=((e,t,o)=>{const n=[];for(let r=0;r{for(let t=1;t{for(let t=0;t{Nt(t)&&(Oe(e.list,t.listAttributes),Oe(e.item,t.itemAttributes)),be(e.item,t.content)}))})(n,o),r=n,B(M(t),D(r),It),t.concat(n)},Vt=(e,t)=>{let o=p.none();const n=k(t,((t,n,r)=>Rt(n)?0===r?(o=p.some(n),t):Ft(e,t,n):n.depth>t.length?zt(e,t,n):Ft(e,t,n)),[]);return o.each((e=>{const t=H.fromHtml(`\x3c!--${e.content}--\x3e`);D(n).each((e=>{((e,t)=>{ne(e).fold((()=>{ve(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))})(e.list,t)}))})),D(n).map((e=>e.list))},Zt=e=>(C(e,((t,o)=>{((e,t)=>{const o=e[t].depth,n=e=>e.depth===o&&!e.dirty,r=e=>e.depth_(e.slice(t+1),n,r)))})(e,o).fold((()=>{t.dirty&&Nt(t)&&(e=>{e.listAttributes=Te(e.listAttributes,((e,t)=>"start"!==t))})(t)}),(e=>{return n=e,void(Nt(o=t)&&Nt(n)&&(o.listType=n.listType,o.listAttributes={...n.listAttributes}));var o,n}))})),e),Ut=(e,t,o,n)=>{var r,s;if(8===$(s=n)||"#comment"===W(s))return[{depth:e+1,content:null!==(r=n.dom.nodeValue)&&void 0!==r?r:"",dirty:!1,isSelected:!1,isComment:!0}];t.each((e=>{P(e.start,n)&&o.set(!0)}));const a=((e,t,o)=>ee(e).filter(K).map((n=>({depth:t,dirty:!1,isSelected:o,content:Ht(e),itemAttributes:Ae(e),listAttributes:Ae(n),listType:W(n),isInPreviousLi:!1}))))(n,e,o.get());t.each((e=>{P(e.end,n)&&o.set(!1)}));const i=re(n).filter(Dt).map((n=>Wt(e,t,o,n))).getOr([]);return a.toArray().concat(i)},jt=(e,t,o,n)=>ne(n).filter(Dt).fold((()=>Ut(e,t,o,n)),(r=>{const s=k(te(n),((n,s,a)=>{if(0===a)return n;if(F(s,"LI"))return n.concat(Ut(e,t,o,s));{const t={isFragment:!0,depth:e,content:[s],isSelected:!1,dirty:!1,parentListType:W(r)};return n.concat(t)}}),[]);return Wt(e,t,o,r).concat(s)})),Wt=(e,t,o,n)=>T(te(n),(n=>(Dt(n)?Wt:jt)(e+1,t,o,n))),$t=(e,t)=>T(((e,t)=>{if(0===e.length)return[];{let o=t(e[0]);const n=[];let r=[];for(let s=0,a=e.length;sD(t).exists(Bt)?((e,t)=>{const o=Zt(t);return Vt(e.contentDocument,o).toArray()})(e,t):((e,t)=>{const o=Zt(t);return x(o,(t=>{const o=Rt(t)?kt([H.fromHtml(`\x3c!--${t.content}--\x3e`)]):kt(t.content),n=Nt(t)?t.itemAttributes:{};return H.fromDom(et(e,o.dom,n))}))})(e,t))),qt=(e,t,o)=>{const n=((e,t)=>{const o=(e=>{let t=!1;return{get:()=>t,set:e=>{t=e}}})();return x(e,(e=>({sourceList:e,entries:Wt(0,t,o,e)})))})(t,(e=>{const t=x(gt(e),H.fromDom);return B(E(t,g(Mt)),E(O(t),g(Mt)),((e,t)=>({start:e,end:t})))})(e));C(n,(t=>{((e,t)=>{C(S(e,Lt),(e=>((e,t)=>{switch(e){case"Indent":t.depth++;break;case"Outdent":t.depth--;break;case"Flatten":t.depth=0}t.dirty=!0})(t,e)))})(t.entries,o);const n=$t(e,t.entries);var r;C(n,(t=>{_t(e,"Indent"===o?"IndentList":"OutdentList",t.dom)})),r=t.sourceList,C(n,(e=>{pe(r,e)})),we(t.sourceList)}))},Gt=(e,t)=>{const o=ke(vt(e)),n=ke((e=>S(gt(e),Ze))(e));let r=!1;if(o.length||n.length){const s=e.selection.getBookmark();qt(e,o,t),((e,t,o)=>{C(o,"Indent"===t?at:t=>st(e,t))})(e,t,n),e.selection.moveToBookmark(s),e.selection.setRng(lt(e.selection.getRng())),e.nodeChanged(),r=!0}return r},Kt=(e,t)=>!(e=>{const t=mt(e);return xt(e,t)})(e)&&Gt(e,t),Yt=e=>Kt(e,"Indent"),Xt=e=>Kt(e,"Outdent"),Jt=e=>Kt(e,"Flatten"),Qt=e=>"\ufeff"===e,eo=(e,t)=>{return o=e,n=function(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}(P,t),de(o,n,r).isSome();var o,n,r};var to=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager");const oo=Ne.DOM,no=e=>{const t={},o=o=>{let n=e[o?"startContainer":"endContainer"],r=e[o?"startOffset":"endOffset"];if(Ie(n)){const e=oo.create("span",{"data-mce-type":"bookmark"});n.hasChildNodes()?(r=Math.min(r,n.childNodes.length-1),o?n.insertBefore(e,n.childNodes[r]):oo.insertAfter(e,n.childNodes[r])):n.appendChild(e),n=e,r=0}t[o?"startContainer":"endContainer"]=n,t[o?"startOffset":"endOffset"]=r};return o(!0),e.collapsed||o(),t},ro=e=>{const t=t=>{let o=e[t?"startContainer":"endContainer"],n=e[t?"startOffset":"endOffset"];if(o){if(Ie(o)&&o.parentNode){const e=o;n=(e=>{var t;let o=null===(t=e.parentNode)||void 0===t?void 0:t.firstChild,n=0;for(;o;){if(o===e)return n;Ie(o)&&"bookmark"===o.getAttribute("data-mce-type")||n++,o=o.nextSibling}return-1})(o),o=o.parentNode,oo.remove(e),!o.hasChildNodes()&&oo.isBlock(o)&&o.appendChild(oo.create("br"))}e[t?"startContainer":"endContainer"]=o,e[t?"startOffset":"endOffset"]=n}};t(!0),t();const o=oo.createRng();return o.setStart(e.startContainer,e.startOffset),e.endContainer&&o.setEnd(e.endContainer,e.endOffset),lt(o)},so=e=>{switch(e){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},ao=(e,t)=>{Re.each(t,((t,o)=>{e.setAttribute(o,t)}))},io=(e,t,o)=>{((e,t,o)=>{const n=o["list-style-type"]?o["list-style-type"]:null;e.setStyle(t,"list-style-type",n)})(e,t,o),((e,t,o)=>{ao(t,o["list-attributes"]),Re.each(e.select("li",t),(e=>{ao(e,o["list-item-attributes"])}))})(e,t,o)},lo=(e,t)=>i(t)&&!$e(t,e.schema.getBlockElements()),co=(e,t,o,n)=>{let r=t[o?"startContainer":"endContainer"];const s=t[o?"startOffset":"endOffset"];Ie(r)&&(r=r.childNodes[Math.min(s,r.childNodes.length-1)]||r),!o&&je(r.nextSibling)&&(r=r.nextSibling);const a=(t,o)=>{var r;const s=new Ce(t,(t=>{for(;!e.dom.isBlock(t)&&t.parentNode&&n!==t;)t=t.parentNode;return t})(t)),a=o?"next":"prev";let i;for(;i=s[a]();)if(!qe(e,i)&&!Qt(i.textContent)&&0!==(null===(r=i.textContent)||void 0===r?void 0:r.length))return p.some(i);return p.none()};if(o&&He(r))if(Qt(r.textContent))r=a(r,!1).getOr(r);else for(null!==r.parentNode&&lo(e,r.parentNode)&&(r=r.parentNode);null!==r.previousSibling&&(lo(e,r.previousSibling)||He(r.previousSibling));)r=r.previousSibling;if(!o&&He(r))if(Qt(r.textContent))r=a(r,!0).getOr(r);else for(null!==r.parentNode&&lo(e,r.parentNode)&&(r=r.parentNode);null!==r.nextSibling&&(lo(e,r.nextSibling)||He(r.nextSibling));)r=r.nextSibling;for(;r.parentNode!==n;){const t=r.parentNode;if(We(e,r))return r;if(/^(TD|TH)$/.test(t.nodeName))return r;r=t}return r},mo=(e,t,o)=>{const n=e.selection.getRng();let r="LI";const s=pt(e,((e,t)=>{const o=e.selection.getStart(!0),n=co(e,t,!0,e.getBody());return eo(H.fromDom(n),H.fromDom(t.commonAncestorContainer))?t.commonAncestorContainer:o})(e,n)),a=e.dom;if("false"===a.getContentEditable(e.selection.getNode()))return;"DL"===(t=t.toUpperCase())&&(r="DT");const i=no(n),l=S(((e,t,o)=>{const n=[],r=e.dom,s=co(e,t,!0,o),a=co(e,t,!1,o);let i;const l=[];for(let e=s;e&&(l.push(e),e!==a);e=e.nextSibling);return Re.each(l,(t=>{var s;if(We(e,t))return n.push(t),void(i=null);if(r.isBlock(t)||je(t))return je(t)&&r.remove(t),void(i=null);const a=t.nextSibling;to.isBookmarkNode(t)&&(Pe(a)||We(e,a)||!a&&t.parentNode===o)?i=null:(i||(i=r.create("p"),null===(s=t.parentNode)||void 0===s||s.insertBefore(i,t),n.push(i)),i.appendChild(t))})),n})(e,n,s),e.dom.isEditable);Re.each(l,(n=>{let s;const i=n.previousSibling,l=n.parentNode;Ve(l)||(i&&Pe(i)&&i.nodeName===t&&((e,t,o)=>{const n=e.getStyle(t,"list-style-type");let r=o?o["list-style-type"]:"";return r=null===r?"":r,n===r})(a,i,o)?(s=i,n=a.rename(n,r),i.appendChild(n)):(s=a.create(t),l.insertBefore(s,n),s.appendChild(n),n=a.rename(n,r)),((e,t,o)=>{Re.each(o,(o=>e.setStyle(t,o,"")))})(a,n,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),io(a,s,o),go(e.dom,s))})),e.selection.setRng(ro(i))},uo=(e,t,o)=>{return((e,t)=>Pe(e)&&e.nodeName===(null==t?void 0:t.nodeName))(t,o)&&((e,t,o)=>e.getStyle(t,"list-style-type",!0)===e.getStyle(o,"list-style-type",!0))(e,t,o)&&(n=o,t.className===n.className);var n},go=(e,t)=>{let o,n=t.nextSibling;if(uo(e,t,n)){const r=n;for(;o=r.firstChild;)t.appendChild(o);e.remove(r)}if(n=t.previousSibling,uo(e,t,n)){const r=n;for(;o=r.lastChild;)t.insertBefore(o,t.firstChild);e.remove(r)}},ho=(e,t,o,n)=>{if(t.nodeName!==o){const r=e.dom.rename(t,o);io(e.dom,r,n),_t(e,so(o),r)}else io(e.dom,t,n),_t(e,so(o),t)},po=(e,t,o,n)=>{if(t.classList.forEach(((e,o,n)=>{e.startsWith("tox-")&&(n.remove(e),0===n.length&&t.removeAttribute("class"))})),t.nodeName!==o){const r=e.dom.rename(t,o);io(e.dom,r,n),_t(e,so(o),r)}else io(e.dom,t,n),_t(e,so(o),t)},fo=e=>"list-style-type"in e,vo=(e,t,o)=>{const n=mt(e);if(Ct(e,n))return;const s=ut(e),a=r(o)?o:{};s.length>0?((e,t,o,n,r)=>{const s=Pe(t);if(!s||t.nodeName!==n||fo(r)||yt(t)){mo(e,n,r);const a=no(e.selection.getRng()),i=s?[t,...o]:o,l=s&&yt(t)?po:ho;Re.each(i,(t=>{l(e,t,n,r)})),e.selection.setRng(ro(a))}else Jt(e)})(e,n,s,t,a):((e,t,o,n)=>{if(t!==e.getBody())if(t)if(t.nodeName!==o||fo(n)||yt(t)){const r=no(e.selection.getRng());yt(t)&&t.classList.forEach(((e,o,n)=>{e.startsWith("tox-")&&(n.remove(e),0===n.length&&t.removeAttribute("class"))})),io(e.dom,t,n);const s=e.dom.rename(t,o);go(e.dom,s),e.selection.setRng(ro(r)),mo(e,o,n),_t(e,so(o),s)}else Jt(e);else mo(e,o,n),_t(e,so(o),t)})(e,n,t,a)},bo=Ne.DOM,yo=(e,t)=>{const o=Re.grep(e.select("ol,ul",t));Re.each(o,(t=>{((e,t)=>{const o=t.parentElement;if(o&&"LI"===o.nodeName&&o.firstChild===t){const n=o.previousSibling;n&&"LI"===n.nodeName?(n.appendChild(t),Ge(e,o)&&bo.remove(o)):bo.setStyle(o,"listStyleType","none")}if(Pe(o)){const e=o.previousSibling;e&&"LI"===e.nodeName&&e.appendChild(t)}})(e,t)}))},wo=(e,t,o,n)=>{let r=t.startContainer;const s=t.startOffset;if(He(r)&&(o?s0))return r;const a=e.schema.getNonEmptyElements();Ie(r)&&(r=xe.getNode(r,s));const i=new Ce(r,n);o&&((e,t)=>!!je(t)&&e.isBlock(t.nextSibling)&&!je(t.previousSibling))(e.dom,r)&&i.next();const l=o?i.next.bind(i):i.prev2.bind(i);for(;r=l();){if("LI"===r.nodeName&&!r.hasChildNodes())return r;if(a[r.nodeName])return r;if(He(r)&&r.data.length>0)return r}return null},xo=(e,t)=>{const o=t.childNodes;return 1===o.length&&!Pe(o[0])&&e.isBlock(o[0])},Co=e=>p.from(e).map(H.fromDom).filter(G).exists((e=>((e,t=!1)=>le(e)?e.dom.isContentEditable:ge(e).fold(m(t),(e=>"true"===he(e))))(e)&&!y(["details"],W(e)))),So=(e,t,o)=>{let n;const r=xo(e,o)?o.firstChild:o;if(((e,t)=>{xo(e,t)&&Co(t.firstChild)&&e.remove(t.firstChild,!0)})(e,t),!Ge(e,t,!0))for(;n=t.firstChild;)r.appendChild(n)},ko=(e,t,o)=>{let n;const r=t.parentNode;if(!Ke(e,t)||!Ke(e,o))return;Pe(o.lastChild)&&(n=o.lastChild),r===o.lastChild&&je(r.previousSibling)&&e.remove(r.previousSibling);const s=o.lastChild;s&&je(s)&&t.hasChildNodes()&&e.remove(s),Ge(e,o,!0)&&ye(H.fromDom(o)),So(e,t,o),n&&o.appendChild(n);const a=((e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)})(H.fromDom(o),H.fromDom(t))?e.getParents(t,Pe,o):[];e.remove(t),C(a,(t=>{Ge(e,t)&&t!==e.getRoot()&&e.remove(t)}))},_o=(e,t,o,n)=>{const r=e.dom;if(r.isEmpty(n))((e,t,o)=>{ye(H.fromDom(o)),ko(e.dom,t,o),e.selection.setCursorLocation(o,0)})(e,o,n);else{const s=no(t);ko(r,o,n),e.selection.setRng(ro(s))}},Eo=(e,t)=>{const o=e.dom,n=e.selection,r=n.getStart(),s=ht(e,r),a=o.getParent(n.getStart(),"LI",s);if(a){const r=a.parentElement;if(r===e.getBody()&&Ge(o,r))return!0;const i=lt(n.getRng()),l=o.getParent(wo(e,i,t,s),"LI",s),c=l&&(t?o.isChildOf(a,l):o.isChildOf(l,a));if(l&&l!==a&&!c)return e.undoManager.transact((()=>{var o,n;t?_o(e,i,l,a):(null===(n=(o=a).parentNode)||void 0===n?void 0:n.firstChild)===o?Xt(e):((e,t,o,n)=>{const r=no(t);ko(e.dom,o,n);const s=ro(r);e.selection.setRng(s)})(e,i,a,l)})),!0;if(c&&!t&&l!==a)return e.undoManager.transact((()=>{if(i.commonAncestorContainer.parentElement){const t=no(i),n=i.commonAncestorContainer.parentElement;So(o,i.commonAncestorContainer.parentElement,l),n.remove();const r=ro(t);e.selection.setRng(r)}})),!0;if(!l&&!t&&0===i.startOffset&&0===i.endOffset)return e.undoManager.transact((()=>{Jt(e)})),!0}return!1},To=(e,t)=>{const o=e.dom,n=e.selection.getStart(),r=ht(e,n),s=o.getParent(n,o.isBlock,r);if(s&&o.isEmpty(s,void 0,{checkRootAsContent:!0})){const n=lt(e.selection.getRng()),a=o.getParent(wo(e,n,t,r),"LI",r);if(a){const i=e=>y(["td","th","caption"],W(e)),l=e=>e.dom===r;return!!((e,t,o=u)=>B(e,t,o).getOr(e.isNone()&&t.isNone()))(me(H.fromDom(a),i,l),me(H.fromDom(n.startContainer),i,l),P)&&(e.undoManager.transact((()=>{const n=a.parentNode;((e,t,o)=>{const n=e.getParent(t.parentNode,e.isBlock,o);e.remove(t),n&&e.isEmpty(n)&&e.remove(n)})(o,s,r),go(o,n),e.selection.select(a,!0),e.selection.collapse(t)})),!0)}}return!1},Oo=e=>{const t=e.selection.getStart(),o=ht(e,t);return e.dom.getParent(t,"LI,DT,DD",o)||gt(e).length>0},Ao=(e,t)=>{const o=e.selection;return!Ct(e,o.getNode())&&(o.isCollapsed()?((e,t)=>Eo(e,t)||To(e,t))(e,t):(e=>!!Oo(e)&&(e.undoManager.transact((()=>{e.execCommand("Delete"),yo(e.dom,e.getBody())})),!0))(e))},Do=e=>{const t=O(Et(e).split("")),o=x(t,((e,t)=>{const o=e.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,t)*o}));return k(o,((e,t)=>e+t),0)},Mo=e=>{if(--e<0)return"";{const t=e%26,o=Math.floor(e/26);return Mo(o)+String.fromCharCode("A".charCodeAt(0)+t)}},No=e=>{const t=parseInt(e.start,10);return R(e.listStyleType,"upper-alpha")?Mo(t):R(e.listStyleType,"lower-alpha")?Mo(t).toLowerCase():e.start},Ro=e=>{const t=mt(e);ze(t)&&!Ct(e,t)&&e.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:No({start:e.dom.getAttrib(t,"start","1"),listStyleType:p.from(e.dom.getStyle(t,"list-style-type"))})},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:t=>{(e=>{switch((e=>/^[0-9]+$/.test(e)?2:/^[A-Z]+$/.test(e)?0:(e=>/^[a-z]+$/.test(e))(e)?1:e.length>0?4:3)(e)){case 2:return p.some({listStyleType:p.none(),start:e});case 0:return p.some({listStyleType:p.some("upper-alpha"),start:Do(e).toString()});case 1:return p.some({listStyleType:p.some("lower-alpha"),start:Do(e).toString()});case 3:return p.some({listStyleType:p.none(),start:""});case 4:return p.none()}})(t.getData().start).each((t=>{e.execCommand("mceListUpdate",!1,{attrs:{start:"1"===t.start?"":t.start},styles:{"list-style-type":t.listStyleType.getOr("")}})})),t.close()}})},Bo=(e,t)=>()=>{const o=mt(e);return i(o)&&o.nodeName===t},Lo=e=>{e.addCommand("mceListProps",(()=>{Ro(e)}))},Ho=e=>{e.on("BeforeExecCommand",(t=>{const o=t.command.toLowerCase();"indent"===o?Yt(e):"outdent"===o&&Xt(e)})),e.addCommand("InsertUnorderedList",((t,o)=>{vo(e,"UL",o)})),e.addCommand("InsertOrderedList",((t,o)=>{vo(e,"OL",o)})),e.addCommand("InsertDefinitionList",((t,o)=>{vo(e,"DL",o)})),e.addCommand("RemoveList",(()=>{Jt(e)})),Lo(e),e.addCommand("mceListUpdate",((t,o)=>{r(o)&&((e,t)=>{const o=mt(e);null===o||Ct(e,o)||e.undoManager.transact((()=>{r(t.styles)&&e.dom.setStyles(o,t.styles),r(t.attrs)&&Ee(t.attrs,((t,n)=>e.dom.setAttrib(o,n,t)))}))})(e,o)})),e.addQueryStateHandler("InsertUnorderedList",Bo(e,"UL")),e.addQueryStateHandler("InsertOrderedList",Bo(e,"OL")),e.addQueryStateHandler("InsertDefinitionList",Bo(e,"DL"))};var Io=tinymce.util.Tools.resolve("tinymce.html.Node");const Po=e=>3===e.type,Fo=e=>0===e.length,zo=e=>{const t=(t,o)=>{const n=Io.create("li");C(t,(e=>n.append(e))),o?e.insert(n,o,!0):e.append(n)},o=k(e.children(),((e,o)=>Po(o)?[...e,o]:Fo(e)||Po(o)?e:(t(e,o),[])),[]);Fo(o)||t(o)},Vo=e=>{Xe(e)&&(e=>{e.on("keydown",(t=>{t.keyCode!==Se.TAB||Se.metaKeyPressed(t)||e.undoManager.transact((()=>{(t.shiftKey?Xt(e):Yt(e))&&t.preventDefault()}))}))})(e),(e=>{e.on("ExecCommand",(t=>{const o=t.command.toLowerCase();"delete"!==o&&"forwarddelete"!==o||!Oo(e)||yo(e.dom,e.getBody())})),e.on("keydown",(t=>{t.keyCode===Se.BACKSPACE?Ao(e,!1)&&t.preventDefault():t.keyCode===Se.DELETE&&Ao(e,!0)&&t.preventDefault()}))})(e)},Zo=(e,t)=>o=>(o.setEnabled(e.selection.isEditable()),St(e,(n=>{o.setActive(wt(n.parents,t)),o.setEnabled(!Ct(e,n.element)&&e.selection.isEditable())}))),Uo=(e,t)=>o=>St(e,(n=>o.setEnabled(wt(n.parents,t)&&!Ct(e,n.element))));e.add("lists",(e=>((e=>{(0,e.options.register)("lists_indent_on_tab",{processor:"boolean",default:!0})})(e),(e=>{e.on("PreInit",(()=>{const{parser:t}=e;t.addNodeFilter("ul,ol",(e=>C(e,zo)))}))})(e),e.hasPlugin("rtc",!0)?Lo(e):(Vo(e),Ho(e)),(e=>{const t=t=>()=>e.execCommand(t);e.hasPlugin("advlist")||(e.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:t("InsertOrderedList"),onSetup:Zo(e,"OL")}),e.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:t("InsertUnorderedList"),onSetup:Zo(e,"UL")}))})(e),(e=>{const t={text:"List properties...",icon:"ordered-list",onAction:()=>e.execCommand("mceListProps"),onSetup:Uo(e,"OL")};e.ui.registry.addMenuItem("listprops",t),e.ui.registry.addContextMenu("lists",{update:t=>{const o=mt(e,t);return ze(o)?["listprops"]:[]}})})(e),(e=>({backspaceDelete:t=>{Ao(e,t)}}))(e))))}();export{n as default}; +function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t,o={exports:{}};t=o,function(){var e=function(e){if(null===e)return"null";if(void 0===e)return"undefined";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t},o=function(e){return{eq:e}},n=o((function(e,t){return e===t})),r=function(e){return o((function(t,o){if(t.length!==o.length)return!1;for(var n=t.length,r=0;r{var n;return!!o(e,t.prototype)||(null===(n=e.constructor)||void 0===n?void 0:n.name)===t.name},d=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&c(e,String,((e,t)=>t.isPrototypeOf(e)))?"string":t})(t)===e,m=e=>t=>typeof t===e,u=e=>t=>e===t,g=(e,t)=>p(e)&&c(e,t,((e,t)=>l(e)===t)),h=d("string"),p=d("object"),f=e=>g(e,Object),v=d("array"),b=u(null),y=m("boolean"),w=u(void 0),x=e=>null==e,C=e=>!x(e),S=m("function"),k=m("number"),_=(e,t)=>{if(v(e)){for(let o=0,n=e.length;o{},T=(e,t)=>(...o)=>e(t.apply(null,o)),O=(e,t)=>o=>e(t(o)),A=e=>()=>e,D=e=>e,M=(e,t)=>e===t;function N(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const R=e=>t=>!e(t),B=e=>()=>{throw new Error(e)},L=e=>e(),H=e=>{e()},I=A(!1),P=A(!0);class F{constructor(e,t){this.tag=e,this.value=t}static some(e){return new F(!0,e)}static none(){return F.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?F.some(e(this.value)):F.none()}bind(e){return this.tag?e(this.value):F.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:F.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return C(e)?F.some(e):F.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}F.singletonNone=new F(!1);const z=Array.prototype.slice,V=Array.prototype.indexOf,Z=Array.prototype.push,U=(e,t)=>V.call(e,t),j=(e,t)=>U(e,t)>-1,W=(e,t)=>{for(let o=0,n=e.length;o{const o=e.length,n=new Array(o);for(let r=0;r{for(let o=0,n=e.length;o{for(let o=e.length-1;o>=0;o--)t(e[o],o)},K=(e,t)=>{const o=[],n=[];for(let r=0,s=e.length;r{const o=[];for(let n=0,r=e.length;n(G(e,((e,n)=>{o=t(o,e,n)})),o),J=(e,t,o)=>(q(e,((e,n)=>{o=t(o,e,n)})),o),Q=(e,t,o)=>{for(let n=0,r=e.length;nQ(e,t,I),te=(e,t)=>{for(let o=0,n=e.length;o{const t=[];for(let o=0,n=e.length;ooe($(e,t)),re=(e,t)=>{for(let o=0,n=e.length;o{const t=z.call(e,0);return t.reverse(),t},ae=(e,t)=>Y(e,(e=>!j(t,e))),ie=(e,t)=>{const o={};for(let n=0,r=e.length;n{const o=z.call(e,0);return o.sort(t),o},ce=(e,t)=>t>=0&&tce(e,0),me=e=>ce(e,e.length-1),ue=S(Array.from)?Array.from:e=>z.call(e),ge=(e,t)=>{for(let o=0;o{const o=[],n=S(t)?e=>W(o,(o=>t(o,e))):e=>j(o,e);for(let t=0,r=e.length;t{const o=pe(e);for(let n=0,r=o.length;nye(e,((e,o)=>({k:o,v:t(e,o)}))),ye=(e,t)=>{const o={};return ve(e,((e,n)=>{const r=t(e,n);o[r.k]=r.v})),o},we=e=>(t,o)=>{e[o]=t},xe=(e,t,o,n)=>{ve(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))},Ce=(e,t)=>{const o={};return xe(e,t,we(o),E),o},Se=(e,t)=>{const o=[];return ve(e,((e,n)=>{o.push(t(e,n))})),o},ke=e=>Se(e,D),_e=(e,t)=>Ee(e,t)?F.from(e[t]):F.none(),Ee=(e,t)=>fe.call(e,t),Te=(e,t)=>Ee(e,t)&&void 0!==e[t]&&null!==e[t],Oe=e=>{const t={};return q(e,(e=>{t[e]={}})),pe(t)},Ae=e=>void 0!==e.length,De=Array.isArray,Me=(e,t,o)=>{if(!e)return!1;if(o=o||e,Ae(e)){for(let n=0,r=e.length;n{const o=[];return Me(e,((n,r)=>{o.push(t(n,r,e))})),o},Re=(e,t)=>{const o=[];return Me(e,((n,r)=>{t&&!t(n,r,e)||o.push(n)})),o},Be=(e,t,o,n)=>{let r=w(o)?e[0]:o;for(let o=0;o{for(let n=0,r=e.length;ne[e.length-1],Ie=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},Pe=()=>Fe(0,0),Fe=(e,t)=>({major:e,minor:t}),ze={nu:Fe,detect:(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?Pe():((e,t)=>{const o=((e,t)=>{for(let o=0;oNumber(t.replace(o,"$"+e));return Fe(n(1),n(2))})(e,o)},unknown:Pe},Ve=(e,t)=>{const o=String(t).toLowerCase();return ee(e,(e=>e.search(o)))},Ze=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,Ue=(e,t)=>We(e,t)?((e,t)=>e.substring(t))(e,t.length):e,je=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!w(n)||r+t.length<=n)},We=(e,t)=>Ze(e,t,0),$e=(e,t)=>Ze(e,t,e.length-t.length),qe=e=>t=>t.replace(e,""),Ge=qe(/^\s+|\s+$/g),Ke=qe(/^\s+/g),Ye=qe(/\s+$/g),Xe=e=>e.length>0,Je=e=>!Xe(e),Qe=(e,t=10)=>{const o=parseInt(e,t);return isNaN(o)?F.none():F.some(o)},et=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,tt=e=>t=>je(t,e),ot=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>je(e,"edge/")&&je(e,"chrome")&&je(e,"safari")&&je(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,et],search:e=>je(e,"chrome")&&!je(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>je(e,"msie")||je(e,"trident")},{name:"Opera",versionRegexes:[et,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:tt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:tt("firefox")},{name:"Safari",versionRegexes:[et,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(je(e,"safari")||je(e,"mobile/"))&&je(e,"applewebkit")}],nt=[{name:"Windows",search:tt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>je(e,"iphone")||je(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:tt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:tt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:tt("linux"),versionRegexes:[]},{name:"Solaris",search:tt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:tt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:tt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],rt={browsers:A(ot),oses:A(nt)},st="Edge",at="Chromium",it="Opera",lt="Firefox",ct="Safari",dt=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(st),isChromium:n(at),isIE:n("IE"),isOpera:n(it),isFirefox:n(lt),isSafari:n(ct)}},mt={unknown:()=>dt({current:void 0,version:ze.unknown()}),nu:dt,edge:A(st),chromium:A(at),ie:A("IE"),opera:A(it),firefox:A(lt),safari:A(ct)},ut="Windows",gt="Android",ht="Linux",pt="macOS",ft="Solaris",vt="FreeBSD",bt="ChromeOS",yt=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(ut),isiOS:n("iOS"),isAndroid:n(gt),isMacOS:n(pt),isLinux:n(ht),isSolaris:n(ft),isFreeBSD:n(vt),isChromeOS:n(bt)}},wt={unknown:()=>yt({current:void 0,version:ze.unknown()}),nu:yt,windows:A(ut),ios:A("iOS"),android:A(gt),linux:A(ht),macos:A(pt),solaris:A(ft),freebsd:A(vt),chromeos:A(bt)},xt=(e,t,o)=>{const n=rt.browsers(),r=rt.oses(),s=t.bind((e=>((e,t)=>ge(t.brands,(t=>{const o=t.brand.toLowerCase();return ee(e,(e=>{var t;return o===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:ze.nu(parseInt(t.version,10),0)})))})))(n,e))).orThunk((()=>((e,t)=>Ve(e,t).map((e=>{const o=ze.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(n,e))).fold(mt.unknown,mt.nu),a=((e,t)=>Ve(e,t).map((e=>{const o=ze.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(r,e).fold(wt.unknown,wt.nu),i=((e,t,o,n)=>{const r=e.isiOS()&&!0===/ipad/i.test(o),s=e.isiOS()&&!r,a=e.isiOS()||e.isAndroid(),i=a||n("(pointer:coarse)"),l=r||!s&&a&&n("(min-device-width:768px)"),c=s||a&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),m=!c&&!l&&!d;return{isiPad:A(r),isiPhone:A(s),isTablet:A(l),isPhone:A(c),isTouch:A(i),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:A(d),isDesktop:A(m)}})(a,s,e,o);return{browser:s,os:a,deviceType:i}},Ct=e=>window.matchMedia(e).matches;let St=Ie((()=>xt(window.navigator.userAgent,F.from(window.navigator.userAgentData),Ct)));const kt=()=>St(),_t=window.navigator.userAgent,Et=kt(),Tt=Et.browser,Ot=Et.os,At=Et.deviceType,Dt=-1!==_t.indexOf("Windows Phone"),Mt={transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",documentMode:Tt.isIE()?document.documentMode||7:10,cacheSuffix:null,container:null,canHaveCSP:!Tt.isIE(),windowsPhone:Dt,browser:{current:Tt.current,version:Tt.version,isChromium:Tt.isChromium,isEdge:Tt.isEdge,isFirefox:Tt.isFirefox,isIE:Tt.isIE,isOpera:Tt.isOpera,isSafari:Tt.isSafari},os:{current:Ot.current,version:Ot.version,isAndroid:Ot.isAndroid,isChromeOS:Ot.isChromeOS,isFreeBSD:Ot.isFreeBSD,isiOS:Ot.isiOS,isLinux:Ot.isLinux,isMacOS:Ot.isMacOS,isSolaris:Ot.isSolaris,isWindows:Ot.isWindows},deviceType:{isDesktop:At.isDesktop,isiPad:At.isiPad,isiPhone:At.isiPhone,isPhone:At.isPhone,isTablet:At.isTablet,isTouch:At.isTouch,isWebView:At.isWebView}},Nt=/^\s*|\s*$/g,Rt=e=>x(e)?"":(""+e).replace(Nt,""),Bt=function(e,t,o,n){n=n||this,e&&(o&&(e=e[o]),Me(e,((e,r)=>!1!==t.call(n,e,r,o)&&(Bt(e,t,o,n),!0))))},Lt={trim:Rt,isArray:De,is:(e,t)=>t?!("array"!==t||!De(e))||typeof e===t:void 0!==e,toArray:e=>{if(De(e))return e;{const t=[];for(let o=0,n=e.length;o{const n=h(e)?e.split(t||","):e||[];let r=n.length;for(;r--;)o[n[r]]={};return o},each:Me,map:Ne,grep:Re,inArray:(e,t)=>{if(e)for(let o=0,n=e.length;o{for(let o=0;o{const o=e.split(".");for(let e=0,n=o.length;ev(e)?e:""===e?[]:Ne(e.split(t||","),Rt),_addCacheSuffix:e=>{const t=Mt.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},Ht=(e,t,o=M)=>e.exists((e=>o(e,t))),It=(e,t,o=M)=>Pt(e,t,o).getOr(e.isNone()&&t.isNone()),Pt=(e,t,o)=>e.isSome()&&t.isSome()?F.some(o(e.getOrDie(),t.getOrDie())):F.none(),Ft=(e,t)=>e?F.some(t):F.none(),zt="undefined"!=typeof window?window:Function("return this;")(),Vt=(e,t)=>((e,t)=>{let o=null!=t?t:zt;for(let t=0;t{const o=((e,t)=>Vt(e,t))(e,t);if(null==o)throw new Error(e+" not available on this browser");return o},Ut=Object.getPrototypeOf,jt=e=>{const t=Vt("ownerDocument.defaultView",e);return p(e)&&((e=>Zt("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(Ut(e).constructor.name))},Wt=e=>e.dom.nodeName.toLowerCase(),$t=e=>e.dom.nodeType,qt=e=>t=>$t(t)===e,Gt=e=>Kt(e)&&jt(e.dom),Kt=qt(1),Yt=qt(3),Xt=qt(9),Jt=qt(11),Qt=e=>t=>Kt(t)&&Wt(t)===e,eo=(e,t,o)=>{if(!(h(o)||y(o)||k(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")},to=(e,t,o)=>{eo(e.dom,t,o)},oo=(e,t)=>{const o=e.dom;ve(t,((e,t)=>{eo(o,t,e)}))},no=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},ro=(e,t)=>F.from(no(e,t)),so=(e,t)=>{const o=e.dom;return!(!o||!o.hasAttribute)&&o.hasAttribute(t)},ao=(e,t)=>{e.dom.removeAttribute(t)},io=e=>J(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}),lo=(e,t)=>{const o=no(e,t);return void 0===o||""===o?[]:o.split(" ")},co=e=>void 0!==e.dom.classList,mo=e=>lo(e,"class"),uo=(e,t)=>((e,t,o)=>{const n=lo(e,t).concat([o]);return to(e,t,n.join(" ")),!0})(e,"class",t),go=(e,t)=>((e,t,o)=>{const n=Y(lo(e,t),(e=>e!==o));return n.length>0?to(e,t,n.join(" ")):ao(e,t),!1})(e,"class",t),ho=(e,t)=>{co(e)?e.dom.classList.add(t):uo(e,t)},po=e=>{0===(co(e)?e.dom.classList:mo(e)).length&&ao(e,"class")},fo=(e,t)=>{co(e)?e.dom.classList.remove(t):go(e,t),po(e)},vo=(e,t)=>{const o=co(e)?e.dom.classList.toggle(t):((e,t)=>j(mo(e),t)?go(e,t):uo(e,t))(e,t);return po(e),o},bo=(e,t)=>co(e)&&e.dom.classList.contains(t),yo=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},wo={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return yo(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return yo(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return yo(o)},fromDom:yo,fromPoint:(e,t,o)=>F.from(e.dom.elementFromPoint(t,o)).map(yo)},xo=(e,t)=>{const o=[],n=e=>(o.push(e),t(e));let r=t(e);do{r=r.bind(n)}while(r.isSome());return o},Co=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},So=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,ko=(e,t)=>e.dom===t.dom,_o=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},Eo=e=>wo.fromDom(e.dom.ownerDocument),To=e=>Xt(e)?e:Eo(e),Oo=e=>wo.fromDom(To(e).dom.defaultView),Ao=e=>F.from(e.dom.parentNode).map(wo.fromDom),Do=e=>F.from(e.dom.parentElement).map(wo.fromDom),Mo=(e,t)=>{const o=S(t)?t:I;let n=e.dom;const r=[];for(;null!==n.parentNode&&void 0!==n.parentNode;){const e=n.parentNode,t=wo.fromDom(e);if(r.push(t),!0===o(t))break;n=e}return r},No=e=>F.from(e.dom.previousSibling).map(wo.fromDom),Ro=e=>F.from(e.dom.nextSibling).map(wo.fromDom),Bo=e=>se(xo(e,No)),Lo=e=>xo(e,Ro),Ho=e=>$(e.dom.childNodes,wo.fromDom),Io=(e,t)=>{const o=e.dom.childNodes;return F.from(o[t]).map(wo.fromDom)},Po=e=>Io(e,0),Fo=e=>Io(e,e.dom.childNodes.length-1),zo=e=>e.dom.childNodes.length,Vo=e=>Jt(e)&&C(e.dom.host),Zo=e=>wo.fromDom(e.dom.getRootNode()),Uo=e=>Vo(e)?e:(e=>{const t=e.dom.head;if(null==t)throw new Error("Head is not available yet");return wo.fromDom(t)})(To(e)),jo=e=>wo.fromDom(e.dom.host),Wo=e=>{if(C(e.target)){const t=wo.fromDom(e.target);if(Kt(t)&&$o(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return de(t)}}return F.from(e.target)},$o=e=>C(e.dom.shadowRoot),qo=e=>{const t=Yt(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return(e=>{const t=Zo(e);return Vo(t)?F.some(t):F.none()})(wo.fromDom(t)).fold((()=>o.body.contains(t)),O(qo,jo))};var Go=(e,t,o,n,r)=>e(o,n)?F.some(o):S(r)&&r(o)?F.none():t(o,n,r);const Ko=(e,t,o)=>{let n=e.dom;const r=S(o)?o:I;for(;n.parentNode;){n=n.parentNode;const e=wo.fromDom(n);if(t(e))return F.some(e);if(r(e))break}return F.none()},Yo=(e,t,o)=>Go(((e,t)=>t(e)),Ko,e,t,o),Xo=(e,t)=>ee(e.dom.childNodes,(e=>t(wo.fromDom(e)))).map(wo.fromDom),Jo=(e,t)=>{const o=e=>{for(let n=0;nKo(e,(e=>Co(e,t)),o),en=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return So(o)?F.none():F.from(o.querySelector(e)).map(wo.fromDom)})(t,e),tn=(e,t,o)=>Go(((e,t)=>Co(e,t)),Qo,e,t,o),on=(e,t=!1)=>{return qo(e)?e.dom.isContentEditable:(o=e,tn(o,"[contenteditable]")).fold(A(t),(e=>"true"===nn(e)));var o},nn=e=>e.dom.contentEditable,rn=e=>void 0!==e.style&&S(e.style.getPropertyValue),sn=(e,t,o)=>{if(!h(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);rn(e)&&e.style.setProperty(t,o)},an=(e,t,o)=>{const n=e.dom;sn(n,t,o)},ln=(e,t)=>{const o=e.dom;ve(t,((e,t)=>{sn(o,t,e)}))},cn=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||qo(e)?n:dn(o,t)},dn=(e,t)=>rn(e)?e.style.getPropertyValue(t):"",mn=(e,t)=>{const o=e.dom,n=dn(o,t);return F.from(n).filter((e=>e.length>0))},un=e=>{const t={},o=e.dom;if(rn(o))for(let e=0;e{((e,t)=>{rn(e)&&e.style.removeProperty(t)})(e.dom,t),Ht(ro(e,"style").map(Ge),"")&&ao(e,"style")},hn=(e,t)=>{Ao(e).each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},pn=(e,t)=>{Ro(e).fold((()=>{Ao(e).each((e=>{vn(e,t)}))}),(e=>{hn(e,t)}))},fn=(e,t)=>{Po(e).fold((()=>{vn(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},vn=(e,t)=>{e.dom.appendChild(t.dom)},bn=(e,t)=>{hn(e,t),vn(t,e)},yn=(e,t)=>{q(t,(t=>{vn(e,t)}))},wn=e=>{e.dom.textContent="",q(Ho(e),(e=>{xn(e)}))},xn=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},Cn=e=>{const t=Ho(e);var o,n;t.length>0&&(o=e,q(n=t,((e,t)=>{const r=0===t?o:n[t-1];pn(r,e)}))),xn(e)},Sn=e=>$(e,wo.fromDom),kn=e=>e.dom.innerHTML,_n=(e,t)=>{const o=Eo(e).dom,n=wo.fromDom(o.createDocumentFragment()),r=((e,t)=>{const o=(t||document).createElement("div");return o.innerHTML=e,Ho(wo.fromDom(o))})(t,o);yn(n,r),wn(e),vn(e,n)},En=(e,t)=>o=>{e(o)&&t((e=>{const t=wo.fromDom(Wo(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),r=T(n,o);return((e,t,o,n,r,s,a)=>({target:e,x:t,y:o,stop:n,prevent:r,kill:s,raw:a}))(t,e.clientX,e.clientY,o,n,r,e)})(o))},Tn=(e,t,o,n)=>((e,t,o,n,r)=>{const s=En(o,n);return e.dom.addEventListener(t,s,r),{unbind:N(On,e,t,s,r)}})(e,t,o,n,!1),On=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},An=(e,t)=>({left:e,top:t,translate:(o,n)=>An(e+o,t+n)}),Dn=An,Mn=(e,t)=>void 0!==e?e:void 0!==t?t:0,Nn=e=>{const t=e.dom,o=t.ownerDocument.body;return o===t?Dn(o.offsetLeft,o.offsetTop):qo(e)?(e=>{const t=e.getBoundingClientRect();return Dn(t.left,t.top)})(t):Dn(0,0)},Rn=e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return Dn(o,n)},Bn=(e,t,o)=>{const n=(void 0!==o?o.dom:document).defaultView;n&&n.scrollTo(e,t)},Ln=(e,t)=>{kt().browser.isSafari()&&S(e.dom.scrollIntoViewIfNeeded)?e.dom.scrollIntoViewIfNeeded(!1):e.dom.scrollIntoView(t)},Hn=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),In=e=>{const t=void 0===e?window:e,o=t.document,n=Rn(wo.fromDom(o));return(e=>{const t=void 0===e?window:e;return kt().browser.isFirefox()?F.none():F.from(t.visualViewport)})(t).fold((()=>{const e=t.document.documentElement,o=e.clientWidth,r=e.clientHeight;return Hn(n.left,n.top,o,r)}),(e=>Hn(Math.max(e.pageLeft,n.left),Math.max(e.pageTop,n.top),e.width,e.height)))},Pn=(e,t)=>{let o=[];return q(Ho(e),(e=>{t(e)&&(o=o.concat([e])),o=o.concat(Pn(e,t))})),o},Fn=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return So(o)?[]:$(o.querySelectorAll(e),wo.fromDom)})(t,e),zn=(e,t,o)=>Ko(e,t,o).isSome(),Vn=(e,t)=>((e,t)=>{const o=e.dom;return o.parentNode?Xo(wo.fromDom(o.parentNode),(o=>!ko(e,o)&&t(o))):F.none()})(e,t).isSome(),Zn=(e,t)=>Jo(e,t).isSome();class Un{constructor(e,t){this.node=e,this.rootNode=t,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}current(){return this.node}next(e){return this.node=this.findSibling(this.node,"firstChild","nextSibling",e),this.node}prev(e){return this.node=this.findSibling(this.node,"lastChild","previousSibling",e),this.node}prev2(e){return this.node=this.findPreviousNode(this.node,e),this.node}findSibling(e,t,o,n){if(e){if(!n&&e[t])return e[t];if(e!==this.rootNode){let t=e[o];if(t)return t;for(let n=e.parentNode;n&&n!==this.rootNode;n=n.parentNode)if(t=n[o],t)return t}}}findPreviousNode(e,t){if(e){const o=e.previousSibling;if(this.rootNode&&o===this.rootNode)return;if(o){if(!t)for(let e=o.lastChild;e;e=e.lastChild)if(!e.lastChild)return e;return o}const n=e.parentNode;if(n&&n!==this.rootNode)return n}}}const jn="\ufeff",Wn=" ",$n=e=>e===jn,qn=/^[ \t\r\n]*$/,Gn=e=>qn.test(e),Kn=e=>"\n"===e||"\r"===e,Yn=(e,t=4,o=!0,n=!0)=>{const r=((e,t)=>t<=0?"":new Array(t+1).join(e))(" ",t),s=e.replace(/\t/g,r),a=J(s,((e,t)=>(e=>-1!==" \f\t\v".indexOf(e))(t)||t===Wn?e.pcIsSpace||""===e.str&&o||e.str.length===s.length-1&&n||((e,t)=>t=0&&Kn(e[t]))(s,e.str.length+1)?{pcIsSpace:!1,str:e.str+Wn}:{pcIsSpace:!0,str:e.str+" "}:{pcIsSpace:Kn(t),str:e.str+t}),{pcIsSpace:!1,str:""});return a.str},Xn=e=>t=>!!t&&t.nodeType===e,Jn=e=>!!e&&!Object.getPrototypeOf(e),Qn=Xn(1),er=e=>Qn(e)&&Gt(wo.fromDom(e)),tr=e=>{const t=e.toLowerCase();return e=>C(e)&&e.nodeName.toLowerCase()===t},or=e=>{const t=e.map((e=>e.toLowerCase()));return e=>{if(e&&e.nodeName){const o=e.nodeName.toLowerCase();return j(t,o)}return!1}},nr=(e,t)=>{const o=t.toLowerCase().split(" ");return t=>{if(Qn(t)){const n=t.ownerDocument.defaultView;if(n)for(let r=0;rQn(e)&&e.hasAttribute("data-mce-bogus"),sr=e=>Qn(e)&&"TABLE"===e.tagName,ar=e=>t=>{if(er(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1},ir=or(["textarea","input"]),lr=Xn(3),cr=Xn(4),dr=Xn(7),mr=Xn(8),ur=Xn(9),gr=Xn(11),hr=tr("br"),pr=tr("img"),fr=ar("true"),vr=ar("false"),br=or(["td","th"]),yr=or(["td","th","caption"]),wr=or(["video","audio","object","embed"]),xr=tr("li"),Cr=tr("details"),Sr=tr("summary"),kr={skipBogus:!0,includeZwsp:!1,checkRootAsContent:!1},_r=(Er="data-mce-bookmark",e=>Qn(e)&&e.hasAttribute(Er));var Er;const Tr=(e,t,o)=>Gn(e.data)&&!((e,t,o)=>{const n=wo.fromDom(t),r=wo.fromDom(e),s=o.getWhitespaceElements();return zn(r,(e=>Ee(s,Wt(e))),N(ko,n))})(e,t,o),Or=(e,t,o,n)=>lr(e)&&!Tr(e,t,o)&&(!n.includeZwsp||!(e=>{for(const t of e)if(!$n(t))return!1;return!0})(e.data)),Ar=(e,t,o,n)=>S(n.isContent)&&n.isContent(t)||((e,t)=>Qn(e)&&Ee(t.getNonEmptyElements(),e.nodeName))(t,e)||_r(t)||(e=>Qn(e)&&"A"===e.nodeName&&!e.hasAttribute("href")&&(e.hasAttribute("name")||e.hasAttribute("id")))(t)||Or(t,o,e,n)||vr(t)||fr(t)&&(e=>Do(wo.fromDom(e)).exists((e=>!on(e))))(t),Dr=(e,t,o)=>{const n={...kr,...o};if(n.checkRootAsContent&&Ar(e,t,t,n))return!1;let r=t.firstChild,s=0;if(!r)return!0;const a=new Un(r,t);do{if(n.skipBogus&&Qn(r)){const e=r.getAttribute("data-mce-bogus");if(e){r=a.next("all"===e);continue}}if(mr(r))r=a.next(!0);else if(hr(r))s++,r=a.next();else{if(Ar(e,r,t,n))return!1;r=a.next()}}while(r);return s<=1},Mr=(e,t,o)=>Dr(e,t.dom,{checkRootAsContent:!0,...o}),Nr=(e,t,o)=>Ar(e,t,t,{includeZwsp:kr.includeZwsp,...o}),Rr=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},Br=e=>{const t=Rr(F.none()),o=()=>t.get().each((e=>clearInterval(e)));return{clear:()=>{o(),t.set(F.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:n=>{o(),t.set(F.some(setInterval(n,e)))}}},Lr=()=>{const e=(e=>{const t=Rr(F.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(F.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(F.some(e))}}})(E);return{...e,on:t=>e.get().each(t)}},Hr=e=>{const t=e.toLowerCase();return"svg"===t?"svg":"math"===t?"math":"html"},Ir=e=>"html"!==Hr(e),Pr=e=>Ir(e.nodeName),Fr=e=>Hr(e.nodeName),zr=["svg","math"],Vr="data-mce-block",Zr=e=>$((e=>Y(pe(e),(e=>!/[A-Z]/.test(e))))(e),(e=>{const t=CSS.escape(e);return`${t}:`+$(zr,(e=>`not(${e} ${t})`)).join(":")})).join(","),Ur=(e,t)=>C(t.querySelector(e))?(t.setAttribute(Vr,"true"),"inline-boundary"===t.getAttribute("data-mce-selected")&&t.removeAttribute("data-mce-selected"),!0):(t.removeAttribute(Vr),!1),jr=(e,t)=>{const o=Zr(e.getTransparentElements()),n=Zr(e.getBlockElements());return Y(t.querySelectorAll(o),(e=>Ur(n,e)))},Wr=(e,t,o)=>{var n;const r=o?"lastChild":"firstChild";for(let o=t[r];o;o=o[r])if(Dr(e,o,{checkRootAsContent:!0}))return void(null===(n=o.parentNode)||void 0===n||n.removeChild(o))},$r=(e,t,o)=>{const n=e.getBlockElements(),r=wo.fromDom(t),s=e=>Wt(e)in n,a=e=>ko(e,r);q(Sn(o),(t=>{Ko(t,s,a).each((o=>{const n=((e,t)=>Y(Ho(e),t))(t,(t=>s(t)&&!e.isValidChild(Wt(o),Wt(t))));if(n.length>0){const t=Do(o);q(n,(t=>{Ko(t,s,a).each((o=>{((e,t,o)=>{const n=document.createRange(),r=t.parentNode;if(r){n.setStartBefore(t),n.setEndBefore(o);const s=n.extractContents();Wr(e,s,!0),n.setStartAfter(o),n.setEndAfter(t);const a=n.extractContents();Wr(e,a,!1),Dr(e,s,{checkRootAsContent:!0})||r.insertBefore(s,t),Dr(e,o,{checkRootAsContent:!0})||r.insertBefore(o,t),Dr(e,a,{checkRootAsContent:!0})||r.insertBefore(a,t),r.removeChild(t)}})(e,o.dom,t.dom)}))})),t.each((t=>jr(e,t.dom)))}}))}))},qr=(e,t)=>{const o=jr(e,t);$r(e,t,o),((e,t,o)=>{q([...o,...Jr(e,t)?[t]:[]],(t=>q(Fn(wo.fromDom(t),t.nodeName.toLowerCase()),(t=>{Qr(e,t.dom)&&Cn(t)}))))})(e,t,o)},Gr=(e,t)=>{if(Xr(e,t)){const o=Zr(e.getBlockElements());Ur(o,t)}},Kr=e=>e.hasAttribute(Vr),Yr=(e,t)=>Ee(e.getTransparentElements(),t),Xr=(e,t)=>Qn(t)&&Yr(e,t.nodeName),Jr=(e,t)=>Xr(e,t)&&Kr(t),Qr=(e,t)=>Xr(e,t)&&!Kr(t),es=(e,t)=>1===t.type&&Yr(e,t.name)&&h(t.attr(Vr)),ts=kt().browser,os=e=>ee(e,Kt),ns=(e,t)=>e.children&&j(e.children,t),rs=(e,t,o)=>{let n=0,r=0;const s=e.ownerDocument;if(o=o||e,t){if(o===e&&t.getBoundingClientRect&&"static"===cn(wo.fromDom(e),"position")){const o=t.getBoundingClientRect();return n=o.left+(s.documentElement.scrollLeft||e.scrollLeft)-s.documentElement.clientLeft,r=o.top+(s.documentElement.scrollTop||e.scrollTop)-s.documentElement.clientTop,{x:n,y:r}}let a=t;for(;a&&a!==o&&a.nodeType&&!ns(a,o);){const e=a;n+=e.offsetLeft||0,r+=e.offsetTop||0,a=e.offsetParent}for(a=t.parentNode;a&&a!==o&&a.nodeType&&!ns(a,o);)n-=a.scrollLeft||0,r-=a.scrollTop||0,a=a.parentNode;r+=(e=>ts.isFirefox()&&"table"===Wt(e)?os(Ho(e)).filter((e=>"caption"===Wt(e))).bind((e=>os(Lo(e)).map((t=>{const o=t.dom.offsetTop,n=e.dom.offsetTop,r=e.dom.offsetHeight;return o<=n?-r:0})))).getOr(0):0)(wo.fromDom(t))}return{x:n,y:r}},ss=(e,t={})=>{let o=0;const n={},r=wo.fromDom(e),s=To(r),a=e=>{vn(Uo(r),e)},i=e=>{const t=Uo(r);en(t,"#"+e).each(xn)},l=e=>_e(n,e).getOrThunk((()=>({id:"mce-u"+o++,passed:[],failed:[],count:0}))),c=e=>new Promise(((o,r)=>{let i;const c=Lt._addCacheSuffix(e),d=l(c);n[c]=d,d.count++;const m=(e,t)=>{q(e,H),d.status=t,d.passed=[],d.failed=[],i&&(i.onload=null,i.onerror=null,i=null)},u=()=>m(d.passed,2),g=()=>m(d.failed,3);if(o&&d.passed.push(o),r&&d.failed.push(r),1===d.status)return;if(2===d.status)return void u();if(3===d.status)return void g();d.status=1;const h=wo.fromTag("link",s.dom);oo(h,{rel:"stylesheet",type:"text/css",id:d.id}),t.contentCssCors&&to(h,"crossOrigin","anonymous"),t.referrerPolicy&&to(h,"referrerpolicy",t.referrerPolicy),i=h.dom,i.onload=u,i.onerror=g,a(h),to(h,"href",c)})),d=e=>{const t=Lt._addCacheSuffix(e);_e(n,t).each((e=>{0==--e.count&&(delete n[t],i(e.id))}))};return{load:c,loadRawCss:(e,t)=>{const o=l(e);n[e]=o,o.count++;const r=wo.fromTag("style",s.dom);oo(r,{rel:"stylesheet",type:"text/css",id:o.id}),r.dom.innerHTML=t,a(r)},loadAll:e=>Promise.allSettled($(e,(e=>c(e).then(A(e))))).then((e=>{const t=K(e,(e=>"fulfilled"===e.status));return t.fail.length>0?Promise.reject($(t.fail,(e=>e.reason))):$(t.pass,(e=>e.value))})),unload:d,unloadRawCss:e=>{_e(n,e).each((t=>{0==--t.count&&(delete n[e],i(t.id))}))},unloadAll:e=>{q(e,(e=>{d(e)}))},_setReferrerPolicy:e=>{t.referrerPolicy=e},_setContentCssCors:e=>{t.contentCssCors=e}}},as=(()=>{const e=new WeakMap;return{forElement:(t,o)=>{const n=Zo(t).dom;return F.from(e.get(n)).getOrThunk((()=>{const t=ss(n,o);return e.set(n,t),t}))}}})(),is=(e,t)=>C(e)&&(Nr(t,e)||t.isInline(e.nodeName.toLowerCase())),ls=e=>(e=>"span"===e.nodeName.toLowerCase())(e)&&"bookmark"===e.getAttribute("data-mce-type"),cs=(e,t,o)=>lr(e)&&e.data.length>0&&((e,t,o)=>{const n=new Un(e,t).prev(!1),r=new Un(e,t).next(!1),s=w(n)||is(n,o),a=w(r)||is(r,o);return s&&a})(e,t,o),ds=(e,t,o,n)=>{var r;const s=n||t;if(Qn(t)&&ls(t))return t;const a=t.childNodes;for(let t=a.length-1;t>=0;t--)ds(e,a[t],o,s);if(Qn(t)){const e=t.childNodes;1===e.length&&ls(e[0])&&(null===(r=t.parentNode)||void 0===r||r.insertBefore(e[0],t))}return(e=>gr(e)||ur(e))(t)||Nr(o,t)||(e=>!!Qn(e)&&e.childNodes.length>0)(t)||cs(t,s,o)||e.remove(t),t},ms=Lt.makeMap,us=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,gs=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,hs=/[<>&\"\']/g,ps=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,fs={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},vs={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},bs={"<":"<",">":">","&":"&",""":'"',"'":"'"},ys=(e,t)=>{const o={};if(e){const n=e.split(",");t=t||10;for(let e=0;ee.replace(t?us:gs,(e=>vs[e]||e)),Cs=(e,t)=>e.replace(t?us:gs,(e=>e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":vs[e]||"&#"+e.charCodeAt(0)+";")),Ss=(e,t,o)=>{const n=o||ws;return e.replace(t?us:gs,(e=>vs[e]||n[e]||e))},ks={encodeRaw:xs,encodeAllRaw:e=>(""+e).replace(hs,(e=>vs[e]||e)),encodeNumeric:Cs,encodeNamed:Ss,getEncodeFunc:(e,t)=>{const o=ys(t)||ws,n=(e,t)=>e.replace(t?us:gs,(e=>void 0!==vs[e]?vs[e]:void 0!==o[e]?o[e]:e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";")),r=(e,t)=>Ss(e,t,o),s=ms(e.replace(/\+/g,","));return s.named&&s.numeric?n:s.named?t?r:Ss:s.numeric?Cs:xs},decode:e=>e.replace(ps,((e,t)=>t?(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))>65535?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):fs[t]||String.fromCharCode(t):bs[e]||ws[e]||(e=>{const t=wo.fromTag("div").dom;return t.innerHTML=e,t.textContent||t.innerText||e})(e)))},_s=(e,t)=>(e=Lt.trim(e))?e.split(t||" "):[],Es=e=>new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$"),Ts=e=>{const t=e=>v(e)?$(e,t):(e=>p(e)&&e.source&&"[object RegExp]"===Object.prototype.toString.call(e))(e)?new RegExp(e.source,e.flags):p(e)?be(e,t):e;return t(e)},Os=e=>Object.freeze(["id","accesskey","class","dir","lang","style","tabindex","title","role",..."html4"!==e?["contenteditable","contextmenu","draggable","dropzone","hidden","spellcheck","translate","itemprop","itemscope","itemtype"]:[],..."html5-strict"!==e?["xml:lang"]:[]]),As=e=>{let t,o;t="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",o="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==e&&(t+=" article aside details dialog figure main header footer hgroup section nav a ins del canvas map",o+=" audio canvas command data datalist mark meter output picture progress time wbr video ruby bdi keygen svg"),"html5-strict"!==e&&(o=[o,"acronym applet basefont big font strike tt"].join(" "),t=[t,"center dir isindex noframes"].join(" "));const n=[t,o].join(" ");return{blockContent:t,phrasingContent:o,flowContent:n}},Ds=e=>{const{blockContent:t,phrasingContent:o,flowContent:n}=As(e),r=e=>Object.freeze(e.split(" "));return Object.freeze({blockContent:r(t),phrasingContent:r(o),flowContent:r(n)})},Ms={html4:Ie((()=>Ds("html4"))),html5:Ie((()=>Ds("html5"))),"html5-strict":Ie((()=>Ds("html5-strict")))},Ns=(e,t)=>{const{blockContent:o,phrasingContent:n,flowContent:r}=Ms[e]();return"blocks"===t?F.some(o):"phrasing"===t?F.some(n):"flow"===t?F.some(r):F.none()},Rs=e=>F.from(/^(@?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)$/.exec(e)).map((e=>({preset:"@"===e[1],name:e[2]}))),Bs=(e,t)=>{const o=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/;return ne(_s(t,","),(t=>{const n=o.exec(t);if(n){const t=n[1],o=n[2],r=n[3],s=n[4],a=n[5],i={attributes:{},attributesOrder:[]};if(e.each((e=>((e,t)=>{ve(e.attributes,((e,o)=>{t.attributes[o]=e})),t.attributesOrder.push(...e.attributesOrder)})(e,i))),"#"===t?i.paddEmpty=!0:"-"===t&&(i.removeEmpty=!0),"!"===s&&(i.removeEmptyAttrs=!0),a&&((e,t)=>{const o=/^([!\-])?(\w+[\\:]:\w+|[^=~<]+)?(?:([=~<])(.*))?$/,n=/[*?+]/,{attributes:r,attributesOrder:s}=t;q(_s(e,"|"),(e=>{const a=o.exec(e);if(a){const e={},o=a[1],i=a[2].replace(/[\\:]:/g,":"),l=a[3],c=a[4];if("!"===o&&(t.attributesRequired=t.attributesRequired||[],t.attributesRequired.push(i),e.required=!0),"-"===o)return delete r[i],void s.splice(Lt.inArray(s,i),1);if(l&&("="===l?(t.attributesDefault=t.attributesDefault||[],t.attributesDefault.push({name:i,value:c}),e.defaultValue=c):"~"===l?(t.attributesForced=t.attributesForced||[],t.attributesForced.push({name:i,value:c}),e.forcedValue=c):"<"===l&&(e.validValues=Lt.makeMap(c,"?"))),n.test(i)){const o=e;t.attributePatterns=t.attributePatterns||[],o.pattern=Es(i),t.attributePatterns.push(o)}else r[i]||s.push(i),r[i]=e}}))})(a,i),r&&(i.outputName=o),"@"===o){if(!e.isNone())return[];e=F.some(i)}return[r?{name:o,element:i,aliasName:r}:{name:o,element:i}]}return[]}))},Ls={},Hs=Lt.makeMap,Is=Lt.each,Ps=Lt.extend,Fs=Lt.explode,zs=(e,t={})=>{const o=Hs(e," ",Hs(e.toUpperCase()," "));return Ps(o,t)},Vs=e=>zs("td th li dt dd figcaption caption details summary",e.getTextBlockElements()),Zs=(e,t)=>{if(e){const o={};return h(e)&&(e={"*":e}),Is(e,((e,n)=>{o[n]=o[n.toUpperCase()]="map"===t?Hs(e,/[, ]/):Fs(e,/[, ]/)})),o}},Us=(e={})=>{var t;const o={},n={};let r=[];const s={},a={},i=(t,o,n)=>{const r=e[t];if(r)return Hs(r,/[, ]/,Hs(r.toUpperCase(),/[, ]/));{let e=Ls[t];return e||(e=zs(o,n),Ls[t]=e),e}},l=null!==(t=e.schema)&&void 0!==t?t:"html5",c=(e=>{const t=Os(e),{phrasingContent:o,flowContent:n}=As(e),r={},s=(e,t,o)=>{r[e]={attributes:ie(t,A({})),attributesOrder:t,children:ie(o,A({}))}},a=(e,o="",n="")=>{const r=_s(n),a=_s(e);let i=a.length;const l=[...t,..._s(o)];for(;i--;)s(a[i],l.slice(),r)},i=(e,t)=>{const o=_s(e),n=_s(t);let s=o.length;for(;s--;){const e=r[o[s]];for(let t=0,o=n.length;t{a(e,"",o)})),q(_s("center dir isindex noframes"),(e=>{a(e,"",n)}))),a("html","manifest","head body"),a("head","","base command link meta noscript script style title"),a("title hr noscript br"),a("base","href target"),a("link","href rel media hreflang type sizes hreflang"),a("meta","name http-equiv content charset"),a("style","media type scoped"),a("script","src async defer type charset"),a("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",n),a("dd div","",n),a("address dt caption","","html4"===e?o:n),a("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",o),a("blockquote","cite",n),a("ol","reversed start type","li"),a("ul","","li"),a("li","value",n),a("dl","","dt dd"),a("a","href target rel media hreflang type","html4"===e?o:n),a("q","cite",o),a("ins del","cite datetime",n),a("img","src sizes srcset alt usemap ismap width height"),a("iframe","src name width height",n),a("embed","src type width height"),a("object","data type typemustmatch name usemap form width height",[n,"param"].join(" ")),a("param","name value"),a("map","name",[n,"area"].join(" ")),a("area","alt coords shape href target rel media hreflang type"),a("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),a("colgroup","span","col"),a("col","span"),a("tbody thead tfoot","","tr"),a("tr","","td th"),a("td","colspan rowspan headers",n),a("th","colspan rowspan headers scope abbr",n),a("form","accept-charset action autocomplete enctype method name novalidate target",n),a("fieldset","disabled form name",[n,"legend"].join(" ")),a("label","form for",o),a("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),a("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?n:o),a("select","disabled form multiple name required size","option optgroup"),a("optgroup","disabled label","option"),a("option","disabled label selected value"),a("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),a("menu","type label",[n,"li"].join(" ")),a("noscript","",n),"html4"!==e&&(a("wbr"),a("ruby","",[o,"rt rp"].join(" ")),a("figcaption","",n),a("mark rt rp bdi","",o),a("summary","",[o,"h1 h2 h3 h4 h5 h6"].join(" ")),a("canvas","width height",n),a("data","value",o),a("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[n,"track source"].join(" ")),a("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[n,"track source"].join(" ")),a("picture","","img source"),a("source","src srcset type media sizes"),a("track","kind src srclang label default"),a("datalist","",[o,"option"].join(" ")),a("article section nav aside main header footer","",n),a("hgroup","","h1 h2 h3 h4 h5 h6"),a("figure","",[n,"figcaption"].join(" ")),a("time","datetime",o),a("dialog","open",n),a("command","type label icon disabled checked radiogroup command"),a("output","for form name",o),a("progress","value max",o),a("meter","value min max low high optimum",o),a("details","open",[n,"summary"].join(" ")),a("keygen","autofocus challenge disabled form keytype name"),s("svg","id tabindex lang xml:space class style x y width height viewBox preserveAspectRatio zoomAndPan transform".split(" "),[])),"html5-strict"!==e&&(i("script","language xml:space"),i("style","xml:space"),i("object","declare classid code codebase codetype archive standby align border hspace vspace"),i("embed","align name hspace vspace"),i("param","valuetype type"),i("a","charset name rev shape coords"),i("br","clear"),i("applet","codebase archive code object alt name width height align hspace vspace"),i("img","name longdesc align border hspace vspace"),i("iframe","longdesc frameborder marginwidth marginheight scrolling align"),i("font basefont","size color face"),i("input","usemap align"),i("select"),i("textarea"),i("h1 h2 h3 h4 h5 h6 div p legend caption","align"),i("ul","type compact"),i("li","type"),i("ol dl menu dir","compact"),i("pre","width xml:space"),i("hr","align noshade size width"),i("isindex","prompt"),i("table","summary width frame rules cellspacing cellpadding align bgcolor"),i("col","width align char charoff valign"),i("colgroup","width align char charoff valign"),i("thead","align char charoff valign"),i("tr","align char charoff valign bgcolor"),i("th","axis align char charoff valign nowrap bgcolor width height"),i("form","accept"),i("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),i("tfoot","align char charoff valign"),i("tbody","align char charoff valign"),i("area","nohref"),i("body","background bgcolor text link vlink alink")),"html4"!==e&&(i("input button select textarea","autofocus"),i("input textarea","placeholder"),i("a","download"),i("link script img","crossorigin"),i("img","loading"),i("iframe","sandbox seamless allow allowfullscreen loading referrerpolicy")),"html4"!==e&&q([r.video,r.audio],(e=>{delete e.children.audio,delete e.children.video})),q(_s("a form meter progress dfn"),(e=>{r[e]&&delete r[e].children[e]})),delete r.caption.children.table,delete r.script,r})(l);!1===e.verify_html&&(e.valid_elements="*[*]");const d=Zs(e.valid_styles),m=Zs(e.invalid_styles,"map"),u=Zs(e.valid_classes,"map"),g=i("whitespace_elements","pre script noscript style textarea video audio iframe object code"),f=i("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),b=i("void_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),w=i("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls allowfullscreen"),x="td th iframe video audio object script code",C=i("non_empty_elements",x+" pre svg textarea summary",b),S=i("move_caret_before_on_enter_elements",x+" table",b),k="h1 h2 h3 h4 h5 h6",_=i("text_block_elements",k+" p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),E=i("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary html body multicol listing",_),T=i("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp"),O=i("transparent_elements","a ins del canvas map"),D=i("wrap_block_elements","pre "+k);Is("script noscript iframe noframes noembed title style textarea xmp plaintext".split(" "),(e=>{a[e]=new RegExp("]*>","gi")}));const M=e=>{const t=F.from(o["@"]),n=/[*?+]/;q(Bs(t,null!=e?e:""),(({name:e,element:t,aliasName:s})=>{if(s&&(o[s]=t),n.test(e)){const o=t;o.pattern=Es(e),r.push(o)}else o[e]=t}))},N=e=>{r=[],q(pe(o),(e=>{delete o[e]})),M(e)},R=(e,t)=>{var r,a;delete Ls.text_block_elements,delete Ls.block_elements;const i=!!t.extends&&!oe(t.extends),c=t.extends;if(n[e]=c?n[c]:{},s[e]=null!=c?c:e,C[e.toUpperCase()]={},C[e]={},i||(E[e.toUpperCase()]={},E[e]={}),c&&!o[e]&&o[c]){const t=Ts(o[c]);delete t.removeEmptyAttrs,delete t.removeEmpty,o[e]=t}else o[e]={attributesOrder:[],attributes:{}};if(v(t.attributes)){const n=e=>{s.attributesOrder.push(e),s.attributes[e]={}},s=null!==(r=o[e])&&void 0!==r?r:{};delete s.attributesDefault,delete s.attributesForced,delete s.attributePatterns,delete s.attributesRequired,s.attributesOrder=[],s.attributes={},q(t.attributes,(e=>{const t=Os(l);Rs(e).each((({preset:e,name:o})=>{e?"global"===o&&q(t,n):n(o)}))})),o[e]=s}if(y(t.padEmpty)){const n=null!==(a=o[e])&&void 0!==a?a:{};n.paddEmpty=t.padEmpty,o[e]=n}if(v(t.children)){const o={},r=e=>{o[e]={}},s=e=>{Ns(l,e).each((e=>{q(e,r)}))};q(t.children,(e=>{Rs(e).each((({preset:e,name:t})=>{e?s(t):r(t)}))})),n[e]=o}c&&ve(n,((t,o)=>{t[c]&&(n[o]=t=Ps({},n[o]),t[e]=t[c])}))},B=e=>{q((e=>{const t=/^(~)?(.+)$/;return ne(_s(e,","),(e=>{const o=t.exec(e);return o?[{cloneName:"~"===o[1]?"span":"div",name:o[2]}]:[]}))})(null!=e?e:""),(({name:e,cloneName:t})=>{R(e,{extends:t})}))},L=e=>{p(e)?ve(e,((e,t)=>R(t,e))):h(e)&&B(e)},H=e=>{q((e=>{const t=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;return ne(_s(e,","),(e=>{const o=t.exec(e);if(o){const e=o[1],t=e?(e=>"-"===e?"remove":"add")(e):"replace";return[{operation:t,name:o[2],validChildren:ne(_s(o[3],"|"),(e=>Rs(e).toArray()))}]}return[]}))})(null!=e?e:""),(({operation:e,name:t,validChildren:o})=>{const r="replace"===e?{"#comment":{}}:n[t],s=t=>{"remove"===e?delete r[t]:r[t]={}};q(o,(({preset:e,name:t})=>{e?(e=>{Ns(l,e).each((e=>{q(e,s)}))})(t):s(t)})),n[t]=r}))},I=e=>{const t=o[e];if(t)return t;let n=r.length;for(;n--;){const t=r[n];if(t.pattern.test(e))return t}},P=A(d),z=A(m),V=A(u),Z=A(w),U=A(E),j=A(_),W=A(T),$=A(Object.seal(b)),G=A(f),K=A(C),Y=A(S),X=A(g),J=A(O),Q=A(D),ee=A(Object.seal(a)),te=(e,t)=>{const o=I(e);if(o){if(!t)return!0;{if(o.attributes[t])return!0;const e=o.attributePatterns;if(e){let o=e.length;for(;o--;)if(e[o].pattern.test(t))return!0}}}return!1},oe=e=>Ee(U(),e),re=e=>!We(e,"#")&&te(e)&&!oe(e),se=A(s);return e.valid_elements?(N(e.valid_elements),Is(c,((e,t)=>{n[t]=e.children}))):(Is(c,((e,t)=>{o[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},n[t]=e.children})),Is(_s("strong/b em/i"),(e=>{const t=_s(e,"/");o[t[1]].outputName=t[0]})),Is(T,((t,n)=>{o[n]&&(e.padd_empty_block_inline_children&&(o[n].paddInEmptyBlock=!0),o[n].removeEmpty=!0)})),Is(_s("ol ul blockquote a table tbody"),(e=>{o[e]&&(o[e].removeEmpty=!0)})),Is(_s("p h1 h2 h3 h4 h5 h6 th td pre div address caption li summary"),(e=>{o[e]&&(o[e].paddEmpty=!0)})),Is(_s("span"),(e=>{o[e].removeEmptyAttrs=!0}))),delete o.svg,L(e.custom_elements),H(e.valid_children),M(e.extended_valid_elements),H("+ol[ul|ol],+ul[ul|ol]"),Is({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},((e,t)=>{o[t]&&(o[t].parentsRequired=_s(e))})),e.invalid_elements&&Is(Fs(e.invalid_elements),(e=>{o[e]&&delete o[e]})),I("span")||M("span[!data-mce-type|*]"),{type:l,children:n,elements:o,getValidStyles:P,getValidClasses:V,getBlockElements:U,getInvalidStyles:z,getVoidElements:$,getTextBlockElements:j,getTextInlineElements:W,getBoolAttrs:Z,getElementRule:I,getSelfClosingElements:G,getNonEmptyElements:K,getMoveCaretBeforeOnEnterElements:Y,getWhitespaceElements:X,getTransparentElements:J,getSpecialElements:ee,isValidChild:(e,t)=>{const o=n[e.toLowerCase()];return!(!o||!o[t.toLowerCase()])},isValid:te,isBlock:oe,isInline:re,isWrapper:e=>Ee(Q(),e)||re(e),getCustomElements:se,addValidElements:M,setValidElements:N,addCustomElements:L,addValidChildren:H}},js=e=>Ue(e,"#").toUpperCase(),Ws=e=>{const t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},$s=e=>(e=>({value:js(e)}))(Ws(e.red)+Ws(e.green)+Ws(e.blue)),qs=/^\s*rgb\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*\)\s*$/i,Gs=/^\s*rgba\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*((?:\d?\.\d+|\d+)%?)\s*\)\s*$/i,Ks=(e,t,o,n)=>((e,t,o,n)=>({red:e,green:t,blue:o,alpha:n}))(parseInt(e,10),parseInt(t,10),parseInt(o,10),parseFloat(n)),Ys=e=>{const t=qs.exec(e);if(null!==t)return F.some(Ks(t[1],t[2],t[3],"1"));const o=Gs.exec(e);return null!==o?F.some(Ks(o[1],o[2],o[3],o[4])):F.none()},Xs=e=>`rgba(${e.red},${e.green},${e.blue},${e.alpha})`,Js=e=>Ys(e).map($s).map((e=>"#"+e.value)).getOr(e),Qs=(e={},t)=>{const o=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,n=/\s*([^:]+):\s*([^;]+);?/g,r=/\s+$/,s={};let a,i;const l=jn;t&&(a=t.getValidStyles(),i=t.getInvalidStyles());const c="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(let e=0;e{const a={};let i=!1;const c=e.url_converter,m=e.url_converter_scope||d,u=(e,t,o)=>{const n=a[e+"-top"+t];if(!n)return;const r=a[e+"-right"+t];if(!r)return;const s=a[e+"-bottom"+t];if(!s)return;const i=a[e+"-left"+t];if(!i)return;const l=[n,r,s,i];let c=l.length-1;for(;c--&&l[c]===l[c+1];);c>-1&&o||(a[e+t]=-1===c?l[0]:l.join(" "),delete a[e+"-top"+t],delete a[e+"-right"+t],delete a[e+"-bottom"+t],delete a[e+"-left"+t])},g=e=>{const t=a[e];if(!t)return;const o=t.indexOf(",")>-1?[t]:t.split(" ");let n=o.length;for(;n--;)if(o[n]!==o[0])return!1;return a[e]=o[0],!0},h=e=>(i=!0,s[e]),p=(e,t)=>(i&&(e=e.replace(/\uFEFF[0-9]/g,(e=>s[e]))),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e),f=e=>String.fromCharCode(parseInt(e.slice(1),16)),v=e=>e.replace(/\\[0-9a-f]+/gi,f),b=(t,o,n,r,s,a)=>{if(s=s||a)return"'"+(s=p(s)).replace(/\'/g,"\\'")+"'";if(o=p(o||n||r||""),!e.allow_script_urls){const t=o.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(t))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(t))return""}return c&&(o=c.call(m,o,"style")),"url('"+o.replace(/\'/g,"\\'")+"')"};if(t){let s;for(t=(t=t.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,h).replace(/\"[^\"]+\"|\'[^\']+\'/g,(e=>e.replace(/[;:]/g,h)));s=n.exec(t);){n.lastIndex=s.index+s[0].length;let t=s[1].replace(r,"").toLowerCase(),c=s[2].replace(r,"");if(t&&c){if(t=v(t),c=v(c),-1!==t.indexOf(l)||-1!==t.indexOf('"'))continue;if(!e.allow_script_urls&&("behavior"===t||/expression\s*\(|\/\*|\*\//.test(c)))continue;"font-weight"===t&&"700"===c?c="bold":"color"!==t&&"background-color"!==t||(c=c.toLowerCase()),"rgb"==(S=c,qs.test(S)?"rgb":Gs.test(S)?"rgba":"other")&&Ys(c).each((e=>{c=Js(Xs(e)).toLowerCase()})),c=c.replace(o,b),a[t]=i?p(c,!0):c}}u("border","",!0),u("border","-width"),u("border","-color"),u("border","-style"),u("padding",""),u("margin",""),y="border",x="border-style",C="border-color",g(w="border-width")&&g(x)&&g(C)&&(a[y]=a[w]+" "+a[x]+" "+a[C],delete a[w],delete a[x],delete a[C]),"medium none"===a.border&&delete a.border,"none"===a["border-image"]&&delete a["border-image"]}var y,w,x,C,S;return a},serialize:(e,t)=>{let o="";const n=(t,n)=>{const r=n[t];if(r)for(let t=0,n=r.length;t0?" ":"")+n+": "+s+";")}};return t&&a?(n("*",a),n(t,a)):ve(e,((e,n)=>{e&&((e,t)=>{if(!i||!t)return!0;let o=i["*"];return!(o&&o[e]||(o=i[t],o&&o[e]))})(n,t)&&(o+=(o.length>0?" ":"")+n+": "+e+";")})),o}};return d},ea={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},ta=e=>x(e.preventDefault)||(e=>e instanceof Event||S(e.initEvent))(e),oa=(e,t)=>{const o=null!=t?t:{};for(const t in e)Ee(ea,t)||(o[t]=e[t]);return C(e.composedPath)&&(o.composedPath=()=>e.composedPath()),C(e.getModifierState)&&(o.getModifierState=t=>e.getModifierState(t)),C(e.getTargetRanges)&&(o.getTargetRanges=()=>e.getTargetRanges()),o},na=(e,t,o,n)=>{var r;const s=oa(t,n);return s.type=e,x(s.target)&&(s.target=null!==(r=s.srcElement)&&void 0!==r?r:o),ta(t)&&(s.preventDefault=()=>{s.defaultPrevented=!0,s.isDefaultPrevented=P,S(t.preventDefault)&&t.preventDefault()},s.stopPropagation=()=>{s.cancelBubble=!0,s.isPropagationStopped=P,S(t.stopPropagation)&&t.stopPropagation()},s.stopImmediatePropagation=()=>{s.isImmediatePropagationStopped=P,s.stopPropagation()},(e=>e.isDefaultPrevented===P||e.isDefaultPrevented===I)(s)||(s.isDefaultPrevented=!0===s.defaultPrevented?P:I,s.isPropagationStopped=!0===s.cancelBubble?P:I,s.isImmediatePropagationStopped=I)),s},ra=/^(?:mouse|contextmenu)|click/,sa=(e,t,o,n)=>{e.addEventListener(t,o,n||!1)},aa=(e,t,o,n)=>{e.removeEventListener(t,o,n||!1)},ia=(e,t)=>{const o=na(e.type,e,document,t);if((e=>C(e)&&ra.test(e.type))(e)&&w(e.pageX)&&!w(e.clientX)){const t=o.target.ownerDocument||document,n=t.documentElement,r=t.body,s=o;s.pageX=e.clientX+(n&&n.scrollLeft||r&&r.scrollLeft||0)-(n&&n.clientLeft||r&&r.clientLeft||0),s.pageY=e.clientY+(n&&n.scrollTop||r&&r.scrollTop||0)-(n&&n.clientTop||r&&r.clientTop||0)}return o},la=(e,t,o)=>{const n=e.document,r={type:"ready"};if(o.domLoaded)return void t(r);const s=()=>{aa(e,"DOMContentLoaded",s),aa(e,"load",s),o.domLoaded||(o.domLoaded=!0,t(r)),e=null};"complete"===n.readyState||"interactive"===n.readyState&&n.body?s():sa(e,"DOMContentLoaded",s),o.domLoaded||sa(e,"load",s)};class ca{constructor(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}bind(e,t,o,n){const r=this;let s;const a=window,i=e=>{r.executeHandlers(ia(e||a.event),l)};if(!e||lr(e)||mr(e))return o;let l;e[r.expando]?l=e[r.expando]:(l=r.count++,e[r.expando]=l,r.events[l]={}),n=n||e;const c=t.split(" ");let d=c.length;for(;d--;){let t=c[d],m=i,u=!1,g=!1;"DOMContentLoaded"===t&&(t="ready"),r.domLoaded&&"ready"===t&&"complete"===e.readyState?o.call(n,ia({type:t})):(r.hasFocusIn||"focusin"!==t&&"focusout"!==t||(u=!0,g="focusin"===t?"focus":"blur",m=e=>{const t=ia(e||a.event);t.type="focus"===t.type?"focusin":"focusout",r.executeHandlers(t,l)}),s=r.events[l][t],s?"ready"===t&&r.domLoaded?o(ia({type:t})):s.push({func:o,scope:n}):(r.events[l][t]=s=[{func:o,scope:n}],s.fakeName=g,s.capture=u,s.nativeHandler=m,"ready"===t?la(e,m,r):sa(e,g||t,m,u)))}return e=s=null,o}unbind(e,t,o){if(!e||lr(e)||mr(e))return this;const n=e[this.expando];if(n){let r=this.events[n];if(t){const n=t.split(" ");let s=n.length;for(;s--;){const t=n[s],a=r[t];if(a){if(o){let e=a.length;for(;e--;)if(a[e].func===o){const o=a.nativeHandler,n=a.fakeName,s=a.capture,i=a.slice(0,e).concat(a.slice(e+1));i.nativeHandler=o,i.fakeName=n,i.capture=s,r[t]=i}}o&&0!==a.length||(delete r[t],aa(e,a.fakeName||t,a.nativeHandler,a.capture))}}}else ve(r,((t,o)=>{aa(e,t.fakeName||o,t.nativeHandler,t.capture)})),r={};for(const e in r)if(Ee(r,e))return this;delete this.events[n];try{delete e[this.expando]}catch(t){e[this.expando]=null}}return this}fire(e,t,o){return this.dispatch(e,t,o)}dispatch(e,t,o){if(!e||lr(e)||mr(e))return this;const n=ia({type:t,target:e},o);do{const t=e[this.expando];t&&this.executeHandlers(n,t),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow}while(e&&!n.isPropagationStopped());return this}clean(e){if(!e||lr(e)||mr(e))return this;if(e[this.expando]&&this.unbind(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName){this.unbind(e);const t=e.getElementsByTagName("*");let o=t.length;for(;o--;)(e=t[o])[this.expando]&&this.unbind(e)}return this}destroy(){this.events={}}cancel(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}executeHandlers(e,t){const o=this.events[t],n=o&&o[e.type];if(n)for(let t=0,o=n.length;t{x(o)||""===o?ao(e,t):to(e,t,o)},pa=e=>e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),fa=(e,t)=>{let o=0;if(e)for(let n=e.nodeType,r=e.previousSibling;r;r=r.previousSibling){const e=r.nodeType;(!t||!lr(r)||e!==n&&r.data.length)&&(o++,n=e)}return o},va=(e,t)=>{const o=no(t,"style"),n=e.serialize(e.parse(o),Wt(t));ha(t,ua,n)},ba=(e,t,o)=>{const n=pa(t);x(o)||""===o?gn(e,n):an(e,n,((e,t)=>k(e)?Ee(ga,t)?e+"":e+"px":e)(o,n))},ya=(e,t={})=>{const o={},n=window,r={};let s=0;const a=as.forElement(wo.fromDom(e),{contentCssCors:t.contentCssCors,referrerPolicy:t.referrerPolicy}),i=[],l=t.schema?t.schema:Us({}),c=Qs({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),d=t.ownEvents?new ca:ca.Event,m=l.getBlockElements(),u=t=>t&&e&&h(t)?e.getElementById(t):t,g=e=>{const t=u(e);return C(t)?wo.fromDom(t):null},p=(e,t,o="")=>{let n;const r=g(e);if(C(r)&&Kt(r)){const e=G[t];n=e&&e.get?e.get(r.dom,t):no(r,t)}return C(n)?n:o},b=e=>{const t=u(e);return x(t)?[]:t.attributes},y=(e,o,n)=>{N(e,(e=>{if(Qn(e)){const r=wo.fromDom(e),s=""===n?null:n,a=no(r,o),i=G[o];i&&i.set?i.set(r.dom,s,o):ha(r,o,s),a!==s&&t.onSetAttrib&&t.onSetAttrib({attrElm:r.dom,attrName:o,attrValue:s})}}))},w=()=>t.root_element||e.body,k=(t,o)=>rs(e.body,u(t),o),_=(e,t,o)=>{const n=u(e);var r;if(!x(n)&&(er(n)||Qn(r=n)&&"http://www.w3.org/2000/svg"===r.namespaceURI))return o?cn(wo.fromDom(n),pa(t)):("float"===(t=t.replace(/-(\D)/g,((e,t)=>t.toUpperCase())))&&(t="cssFloat"),n.style?n.style[t]:void 0)},T=e=>{const t=u(e);if(!t)return{w:0,h:0};let o=_(t,"width"),n=_(t,"height");return o&&-1!==o.indexOf("px")||(o="0"),n&&-1!==n.indexOf("px")||(n="0"),{w:parseInt(o,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},O=(e,t)=>{if(!e)return!1;const o=v(e)?e:[e];return W(o,(e=>Co(wo.fromDom(e),t)))},D=(e,t,o,n)=>{const r=[];let s=u(e);n=void 0===n;const a=o||("BODY"!==w().nodeName?w().parentNode:null);if(h(t))if("*"===t)t=Qn;else{const e=t;t=t=>O(t,e)}for(;s&&!(s===a||x(s.nodeType)||ur(s)||gr(s));){if(!t||t(s)){if(!n)return[s];r.push(s)}s=s.parentNode}return n?r:null},M=(e,t,o)=>{let n=t;if(e){h(t)&&(n=e=>O(e,t));for(let t=e[o];t;t=t[o])if(S(n)&&n(t))return t}return null},N=function(e,t,o){const n=null!=o?o:this;if(v(e)){const o=[];return da(e,((e,r)=>{const s=u(e);s&&o.push(t.call(n,s,r))})),o}{const o=u(e);return!!o&&t.call(n,o)}},R=(e,t)=>{N(e,(e=>{ve(t,((t,o)=>{y(e,o,t)}))}))},B=(e,t)=>{N(e,(e=>{const o=wo.fromDom(e);_n(o,t)}))},L=(t,o,n,r,s)=>N(t,(t=>{const a=h(o)?e.createElement(o):o;return C(n)&&R(a,n),r&&(!h(r)&&r.nodeType?a.appendChild(r):h(r)&&B(a,r)),s?a:t.appendChild(a)})),H=(t,o,n)=>L(e.createElement(t),t,o,n,!0),I=ks.encodeAllRaw,P=(e,t)=>N(e,(e=>{const o=wo.fromDom(e);return t&&q(Ho(o),(e=>{Yt(e)&&0===e.dom.length?xn(e):hn(o,e)})),xn(o),o.dom})),F=(e,t,o)=>{N(e,(e=>{if(Qn(e)){const n=wo.fromDom(e),r=t.split(" ");q(r,(e=>{C(o)?(o?ho:fo)(n,e):vo(n,e)}))}}))},z=(e,t,o)=>N(t,(n=>{var r;const s=v(t)?e.cloneNode(!0):e;return o&&da(ma(n.childNodes),(e=>{s.appendChild(e)})),null===(r=n.parentNode)||void 0===r||r.replaceChild(s,n),n})),V=()=>e.createRange(),Z=(o,r,s,a)=>{if(v(o)){let e=o.length;const t=[];for(;e--;)t[e]=Z(o[e],r,s,a);return t}return!t.collect||o!==e&&o!==n||i.push([o,r,s,a]),d.bind(o,r,s,a||$)},U=(t,o,r)=>{if(v(t)){let e=t.length;const n=[];for(;e--;)n[e]=U(t[e],o,r);return n}if(i.length>0&&(t===e||t===n)){let e=i.length;for(;e--;){const[n,s,a]=i[e];t!==n||o&&o!==s||r&&r!==a||d.unbind(n,s,a)}}return d.unbind(t,o,r)},j=e=>{if(e&&er(e)){const t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},$={doc:e,settings:t,win:n,files:r,stdMode:!0,boxModel:!0,styleSheetLoader:a,boundEvents:i,styles:c,schema:l,events:d,isBlock:e=>h(e)?Ee(m,e):Qn(e)&&(Ee(m,e.nodeName)||Jr(l,e)),root:null,clone:(e,t)=>e.cloneNode(t),getRoot:w,getViewPort:e=>{const t=In(e);return{x:t.x,y:t.y,w:t.width,h:t.height}},getRect:e=>{const t=u(e),o=k(t),n=T(t);return{x:o.x,y:o.y,w:n.w,h:n.h}},getSize:T,getParent:(e,t,o)=>{const n=D(e,t,o,!1);return n&&n.length>0?n[0]:null},getParents:D,get:u,getNext:(e,t)=>M(e,t,"nextSibling"),getPrev:(e,t)=>M(e,t,"previousSibling"),select:(o,n)=>{var r,s;const a=null!==(s=null!==(r=u(n))&&void 0!==r?r:t.root_element)&&void 0!==s?s:e;return S(a.querySelectorAll)?ue(a.querySelectorAll(o)):[]},is:O,add:L,create:H,createHTML:(e,t,o="")=>{let n="<"+e;for(const e in t)Te(t,e)&&(n+=" "+e+'="'+I(t[e])+'"');return Je(o)&&Ee(l.getVoidElements(),e)?n+" />":n+">"+o+""},createFragment:t=>{const o=e.createElement("div"),n=e.createDocumentFragment();let r;for(n.appendChild(o),t&&(o.innerHTML=t);r=o.firstChild;)n.appendChild(r);return n.removeChild(o),n},remove:P,setStyle:(e,o,n)=>{N(e,(e=>{const r=wo.fromDom(e);ba(r,o,n),t.update_styles&&va(c,r)}))},getStyle:_,setStyles:(e,o)=>{N(e,(e=>{const n=wo.fromDom(e);ve(o,((e,t)=>{ba(n,t,e)})),t.update_styles&&va(c,n)}))},removeAllAttribs:e=>N(e,(e=>{const t=e.attributes;for(let o=t.length-1;o>=0;o--)e.removeAttributeNode(t.item(o))})),setAttrib:y,setAttribs:R,getAttrib:p,getPos:k,parseStyle:e=>c.parse(e),serializeStyle:(e,t)=>c.serialize(e,t),addStyle:t=>{if($!==ya.DOM&&e===document){if(o[t])return;o[t]=!0}let n=e.getElementById("mceDefaultStyles");if(!n){n=e.createElement("style"),n.id="mceDefaultStyles",n.type="text/css";const t=e.head;t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)}n.styleSheet?n.styleSheet.cssText+=t:n.appendChild(e.createTextNode(t))},loadCSS:e=>{e||(e=""),q(e.split(","),(e=>{r[e]=!0,a.load(e).catch(E)}))},addClass:(e,t)=>{F(e,t,!0)},removeClass:(e,t)=>{F(e,t,!1)},hasClass:(e,t)=>{const o=g(e),n=t.split(" ");return C(o)&&re(n,(e=>bo(o,e)))},toggleClass:F,show:e=>{N(e,(e=>gn(wo.fromDom(e),"display")))},hide:e=>{N(e,(e=>an(wo.fromDom(e),"display","none")))},isHidden:e=>{const t=g(e);return C(t)&&Ht(mn(t,"display"),"none")},uniqueId:e=>(e||"mce_")+s++,setHTML:B,getOuterHTML:e=>{const t=g(e);return C(t)?Qn(t.dom)?t.dom.outerHTML:(e=>{const t=wo.fromTag("div"),o=wo.fromDom(e.dom.cloneNode(!0));return vn(t,o),kn(t)})(t):""},setOuterHTML:(e,t)=>{N(e,(e=>{Qn(e)&&(e.outerHTML=t)}))},decode:ks.decode,encode:I,insertAfter:(e,t)=>{const o=u(t);return N(e,(e=>{const t=null==o?void 0:o.parentNode,n=null==o?void 0:o.nextSibling;return t&&(n?t.insertBefore(e,n):t.appendChild(e)),e}))},replace:z,rename:(e,t)=>{if(e.nodeName!==t.toUpperCase()){const o=H(t);return da(b(e),(t=>{y(o,t.nodeName,p(e,t.nodeName))})),z(o,e,!0),o}return e},findCommonAncestor:(e,t)=>{let o=e;for(;o;){let e=t;for(;e&&o!==e;)e=e.parentNode;if(o===e)break;o=o.parentNode}return!o&&e.ownerDocument?e.ownerDocument.documentElement:o},run:N,getAttribs:b,isEmpty:(e,t,o)=>{if(f(t)){const n=e=>{const o=e.nodeName.toLowerCase();return Boolean(t[o])};return Dr(l,e,{...o,isContent:n})}return Dr(l,e,o)},createRng:V,nodeIndex:fa,split:(e,t,o)=>{let n,r,s=V();if(e&&t&&e.parentNode&&t.parentNode){const a=e.parentNode;return s.setStart(a,fa(e)),s.setEnd(t.parentNode,fa(t)),n=s.extractContents(),s=V(),s.setStart(t.parentNode,fa(t)+1),s.setEnd(a,fa(e)+1),r=s.extractContents(),a.insertBefore(ds($,n,l),e),o?a.insertBefore(o,e):a.insertBefore(t,e),a.insertBefore(ds($,r,l),e),P(e),o||t}},bind:Z,unbind:U,fire:(e,t,o)=>d.dispatch(e,t,o),dispatch:(e,t,o)=>d.dispatch(e,t,o),getContentEditable:j,getContentEditableParent:e=>{const t=w();let o=null;for(let n=e;n&&n!==t&&(o=j(n),null===o);n=n.parentNode);return o},isEditable:e=>{if(C(e)){const t=Qn(e)?e:e.parentElement;return C(t)&&er(t)&&on(wo.fromDom(t))}return!1},destroy:()=>{if(i.length>0){let e=i.length;for(;e--;){const[t,o,n]=i[e];d.unbind(t,o,n)}}ve(r,((e,t)=>{a.unload(t),delete r[t]}))},isChildOf:(e,t)=>e===t||t.contains(e),dumpRng:e=>"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},G=((e,t,o)=>{const n=t.keep_values,r={set:(e,n,r)=>{const s=wo.fromDom(e);S(t.url_converter)&&C(n)&&(n=t.url_converter.call(t.url_converter_scope||o(),String(n),r,e)),ha(s,"data-mce-"+r,n),ha(s,r,n)},get:(e,t)=>{const o=wo.fromDom(e);return no(o,"data-mce-"+t)||no(o,t)}},s={style:{set:(t,o)=>{const r=wo.fromDom(t);n&&ha(r,ua,o),ao(r,"style"),h(o)&&ln(r,e.parse(o))},get:t=>{const o=wo.fromDom(t),n=no(o,ua)||no(o,"style");return e.serialize(e.parse(n),Wt(o))}}};return n&&(s.href=s.src=r),s})(c,t,A($));return $};ya.DOM=ya(document),ya.nodeIndex=fa;const wa=ya.DOM;class xa{constructor(e={}){this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=!1,this.settings=e}_setReferrerPolicy(e){this.settings.referrerPolicy=e}loadScript(e){return new Promise(((t,o)=>{const n=wa;let r;const s=()=>{n.remove(a),r&&(r.onerror=r.onload=r=null)},a=n.uniqueId();r=document.createElement("script"),r.id=a,r.type="text/javascript",r.src=Lt._addCacheSuffix(e),this.settings.referrerPolicy&&n.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=()=>{s(),t()},r.onerror=()=>{s(),o("Failed to load script: "+e)},(document.getElementsByTagName("head")[0]||document.body).appendChild(r)}))}isDone(e){return 2===this.states[e]}markDone(e){this.states[e]=2}add(e){const t=this;return t.queue.push(e),void 0===t.states[e]&&(t.states[e]=0),new Promise(((o,n)=>{t.scriptLoadedCallbacks[e]||(t.scriptLoadedCallbacks[e]=[]),t.scriptLoadedCallbacks[e].push({resolve:o,reject:n})}))}load(e){return this.add(e)}remove(e){delete this.states[e],delete this.scriptLoadedCallbacks[e]}loadQueue(){const e=this.queue;return this.queue=[],this.loadScripts(e)}loadScripts(e){const t=this,o=(e,o)=>{_e(t.scriptLoadedCallbacks,o).each((t=>{q(t,(t=>t[e](o)))})),delete t.scriptLoadedCallbacks[o]},n=e=>{const t=Y(e,(e=>"rejected"===e.status));return t.length>0?Promise.reject(ne(t,(({reason:e})=>v(e)?e:[e]))):Promise.resolve()},r=e=>Promise.allSettled($(e,(e=>2===t.states[e]?(o("resolve",e),Promise.resolve()):3===t.states[e]?(o("reject",e),Promise.reject(e)):(t.states[e]=1,t.loadScript(e).then((()=>{t.states[e]=2,o("resolve",e);const s=t.queue;return s.length>0?(t.queue=[],r(s).then(n)):Promise.resolve()}),(()=>(t.states[e]=3,o("reject",e),Promise.reject(e)))))))),s=e=>(t.loading=!0,r(e).then((e=>{t.loading=!1;const o=t.queueLoadedCallbacks.shift();return F.from(o).each(H),n(e)}))),a=Oe(e);return t.loading?new Promise(((e,o)=>{t.queueLoadedCallbacks.push((()=>{s(a).then(e,o)}))})):s(a)}}xa.ScriptLoader=new xa;const Ca={},Sa=Rr("en"),ka=()=>_e(Ca,Sa.get()),_a={getData:()=>be(Ca,(e=>({...e}))),setCode:e=>{e&&Sa.set(e)},getCode:()=>Sa.get(),add:(e,t)=>{let o=Ca[e];o||(Ca[e]=o={});const n=$(pe(t),(e=>e.toLowerCase()));ve(t,((e,r)=>{const s=r.toLowerCase();s!==r&&((e,t)=>{const o=e.indexOf(t);return-1!==o&&e.indexOf(t,o+1)>o})(n,s)?(Ee(t,s)||(o[s]=e),o[r]=e):o[s]=e}))},translate:e=>{const t=ka().getOr({}),o=e=>S(e)?Object.prototype.toString.call(e):n(e)?"":""+e,n=e=>""===e||null==e,r=e=>{const n=o(e);return Ee(t,n)?o(t[n]):_e(t,n.toLowerCase()).map(o).getOr(n)},s=e=>e.replace(/{context:\w+}$/,"");if(n(e))return"";if(p(a=e)&&Ee(a,"raw"))return o(e.raw);var a;if((e=>v(e)&&e.length>1)(e)){const t=e.slice(1);return s(r(e[0]).replace(/\{([0-9]+)\}/g,((e,n)=>Ee(t,n)?o(t[n]):e)))}return s(r(e))},isRtl:()=>ka().bind((e=>_e(e,"_dir"))).exists((e=>"rtl"===e)),hasCode:e=>Ee(Ca,e)},Ea=()=>{const e=[],t={},o={},n=[],r=(e,t)=>{const o=Y(n,(o=>o.name===e&&o.state===t));q(o,(e=>e.resolve()))},s=e=>Ee(t,e),a=(e,o)=>{const n=_a.getCode();!n||o&&-1===(","+(o||"")+",").indexOf(","+n+",")||xa.ScriptLoader.add(t[e]+"/langs/"+n+".js")},i=(e,t="added")=>"added"===t&&(e=>Ee(o,e))(e)||"loaded"===t&&s(e)?Promise.resolve():new Promise((o=>{n.push({name:e,state:t,resolve:o})}));return{items:e,urls:t,lookup:o,get:e=>{if(o[e])return o[e].instance},requireLangPack:(e,t)=>{!1!==Ea.languageLoad&&(s(e)?a(e,t):i(e,"loaded").then((()=>a(e,t))))},add:(t,n)=>(e.push(n),o[t]={instance:n},r(t,"added"),n),remove:e=>{delete t[e],delete o[e]},createUrl:(e,t)=>h(t)?h(e)?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}:t,load:(e,n)=>{if(t[e])return Promise.resolve();let s=h(n)?n:n.prefix+n.resource+n.suffix;0!==s.indexOf("/")&&-1===s.indexOf("://")&&(s=Ea.baseURL+"/"+s),t[e]=s.substring(0,s.lastIndexOf("/"));const a=()=>(r(e,"loaded"),Promise.resolve());return o[e]?a():xa.ScriptLoader.add(s).then(a)},waitFor:i}};Ea.languageLoad=!0,Ea.baseURL="",Ea.PluginManager=Ea(),Ea.ThemeManager=Ea(),Ea.ModelManager=Ea();const Ta=(e,t)=>{let o=null;return{cancel:()=>{b(o)||(clearTimeout(o),o=null)},throttle:(...n)=>{b(o)&&(o=setTimeout((()=>{o=null,e.apply(null,n)}),t))}}},Oa=(e,t)=>{let o=null;const n=()=>{b(o)||(clearTimeout(o),o=null)};return{cancel:n,throttle:(...r)=>{n(),o=setTimeout((()=>{o=null,e.apply(null,r)}),t)}}},Aa=A("mce-annotation"),Da=A("data-mce-annotation"),Ma=A("data-mce-annotation-uid"),Na=A("data-mce-annotation-active"),Ra=A("data-mce-annotation-classes"),Ba=A("data-mce-annotation-attrs"),La=e=>t=>ko(t,e),Ha=(e,t)=>{const o=e.selection.getRng(),n=wo.fromDom(o.startContainer),r=wo.fromDom(e.getBody()),s=t.fold((()=>"."+Aa()),(e=>`[${Da()}="${e}"]`)),a=Io(n,o.startOffset).getOr(n);return tn(a,s,La(r)).bind((t=>ro(t,`${Ma()}`).bind((o=>ro(t,`${Da()}`).map((t=>{const n=Pa(e,o);return{uid:o,name:t,elements:n}}))))))},Ia=(e,t)=>so(e,"data-mce-bogus")||((e,t,o)=>Qo(e,t,o).isSome())(e,'[data-mce-bogus="all"]',La(t)),Pa=(e,t)=>{const o=wo.fromDom(e.getBody()),n=Fn(o,`[${Ma()}="${t}"]`);return Y(n,(e=>!Ia(e,o)))},Fa=(e,t)=>{const o=wo.fromDom(e.getBody()),n=Fn(o,`[${Da()}="${t}"]`),r={};return q(n,(e=>{if(!Ia(e,o)){const t=no(e,Ma()),o=_e(r,t).getOr([]);r[t]=o.concat([e])}})),r},za=(e,t)=>{const o=Rr({}),n=()=>({listeners:[],previous:Lr()}),r=(e,t)=>{s(e,(e=>(t(e),e)))},s=(e,t)=>{const r=o.get(),s=t(_e(r,e).getOrThunk(n));r[e]=s,o.set(r)},a=(t,o)=>{q(Pa(e,t),(e=>{o?to(e,Na(),"true"):ao(e,Na())}))},i=Oa((()=>{const o=le(t.getNames());q(o,(t=>{s(t,(o=>{const n=o.previous.get();return Ha(e,F.some(t)).fold((()=>{n.each((e=>{(e=>{r(e,(t=>{q(t.listeners,(t=>t(!1,e)))}))})(t),o.previous.clear(),a(e,!1)}))}),(({uid:e,name:t,elements:s})=>{Ht(n,e)||(n.each((e=>a(e,!1))),((e,t,o)=>{r(e,(n=>{q(n.listeners,(n=>n(!0,e,{uid:t,nodes:$(o,(e=>e.dom))})))}))})(t,e,s),o.previous.set(e),a(e,!0))})),{previous:o.previous,listeners:o.listeners}}))}))}),30);return e.on("remove",(()=>{i.cancel()})),e.on("NodeChange",(()=>{i.throttle()})),{addListener:(e,t)=>{s(e,(e=>({previous:e.previous,listeners:e.listeners.concat([t])})))}}},Va=()=>window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295;let Za=0;const Ua=e=>{const t=(new Date).getTime(),o=Math.floor(1e9*Va());return Za++,e+"_"+o+Za+String(t)},ja=(e,t)=>wo.fromDom(e.dom.cloneNode(t)),Wa=e=>ja(e,!1),$a=e=>ja(e,!0),qa=(e,t)=>{const o=((e,t)=>{const o=wo.fromTag(t),n=io(e);return oo(o,n),o})(e,t);pn(e,o);const n=Ho(e);return yn(o,n),xn(e),o},Ga=(e,t,o=I)=>{const n=new Un(e,t),r=e=>{let t;do{t=n[e]()}while(t&&!lr(t)&&!o(t));return F.from(t).filter(lr)};return{current:()=>F.from(n.current()).filter(lr),next:()=>r("next"),prev:()=>r("prev"),prev2:()=>r("prev2")}},Ka=(e,t)=>{const o=t||(t=>e.isBlock(t)||hr(t)||vr(t)),n=(e,t,o,r)=>{if(lr(e)){const o=r(e,t,e.data);if(-1!==o)return F.some({container:e,offset:o})}return o().bind((e=>n(e.container,e.offset,o,r)))};return{backwards:(t,r,s,a)=>{const i=Ga(t,null!=a?a:e.getRoot(),o);return n(t,r,(()=>i.prev().map((e=>({container:e,offset:e.length})))),s).getOrNull()},forwards:(t,r,s,a)=>{const i=Ga(t,null!=a?a:e.getRoot(),o);return n(t,r,(()=>i.next().map((e=>({container:e,offset:0})))),s).getOrNull()}}},Ya=((e,t)=>{const o=t=>e(t)?F.from(t.dom.nodeValue):F.none();return{get:n=>{if(!e(n))throw new Error("Can only get "+t+" value of a "+t+" node");return o(n).getOr("")},getOption:o,set:(o,n)=>{if(!e(o))throw new Error("Can only set raw "+t+" value of a "+t+" node");o.dom.nodeValue=n}}})(Yt,"text"),Xa=e=>Ya.get(e),Ja=(e,t)=>Ya.set(e,t),Qa=e=>{let t;return o=>(t=t||ie(e,P),Ee(t,Wt(o)))},ei=e=>Kt(e)&&"br"===Wt(e),ti=Qa(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),oi=Qa(["ul","ol","dl"]),ni=Qa(["li","dd","dt"]),ri=Qa(["thead","tbody","tfoot"]),si=Qa(["td","th"]),ai=Qa(["pre","script","textarea","style"]),ii=e=>{const t=Fn(e,"br"),o=Y((e=>{const t=[];let o=e.dom;for(;o;)t.push(wo.fromDom(o)),o=o.lastChild;return t})(e).slice(-1),ei);t.length===o.length&&q(o,xn)},li=()=>{const e=wo.fromTag("br");return to(e,"data-mce-bogus","1"),e},ci=e=>{wn(e),vn(e,li())},di=jn,mi=$n,ui=e=>e.replace(/\uFEFF/g,""),gi=Qn,hi=lr,pi=e=>(hi(e)&&(e=e.parentNode),gi(e)&&e.hasAttribute("data-mce-caret")),fi=e=>hi(e)&&mi(e.data),vi=e=>pi(e)||fi(e),bi=e=>e.firstChild!==e.lastChild||!hr(e.firstChild),yi=e=>{const t=e.container();return!!lr(t)&&(t.data.charAt(e.offset())===di||e.isAtStart()&&fi(t.previousSibling))},wi=e=>{const t=e.container();return!!lr(t)&&(t.data.charAt(e.offset()-1)===di||e.isAtEnd()&&fi(t.nextSibling))},xi=e=>hi(e)&&e.data[0]===di,Ci=e=>hi(e)&&e.data[e.data.length-1]===di,Si=e=>e&&e.hasAttribute("data-mce-caret")?((e=>{var t;const o=e.getElementsByTagName("br"),n=o[o.length-1];rr(n)&&(null===(t=n.parentNode)||void 0===t||t.removeChild(n))})(e),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("data-mce-style"),e.removeAttribute("_moz_abspos"),e):null,ki=e=>pi(e.startContainer),_i=Math.round,Ei=e=>e?{left:_i(e.left),top:_i(e.top),bottom:_i(e.bottom),right:_i(e.right),width:_i(e.width),height:_i(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0},Ti=(e,t)=>(e=Ei(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e),Oi=(e,t,o)=>e>=0&&e<=Math.min(t.height,o.height)/2,Ai=(e,t)=>{const o=Math.min(t.height/2,e.height/2);return e.bottom-ot.bottom)&&Oi(t.top-e.bottom,e,t)},Di=(e,t)=>e.top>t.bottom||!(e.bottom{const n=Math.max(Math.min(t,e.left+e.width),e.left),r=Math.max(Math.min(o,e.top+e.height),e.top);return Math.sqrt((t-n)*(t-n)+(o-r)*(o-r))},Ni=e=>{const t=e.startContainer,o=e.startOffset;return t===e.endContainer&&t.hasChildNodes()&&e.endOffset===o+1?t.childNodes[o]:null},Ri=(e,t)=>{if(Qn(e)&&e.hasChildNodes()){const o=e.childNodes,n=((e,t,o)=>Math.min(Math.max(e,t),o))(t,0,o.length-1);return o[n]}return e},Bi=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),Li=e=>h(e)&&e.charCodeAt(0)>=768&&Bi.test(e),Hi=fr,Ii=vr,Pi=hr,Fi=lr,zi=or(["script","style","textarea"]),Vi=or(["img","input","textarea","hr","iframe","video","audio","object","embed"]),Zi=or(["table"]),Ui=vi,ji=e=>!Ui(e)&&(Fi(e)?!zi(e.parentNode):Vi(e)||Pi(e)||Zi(e)||Wi(e)),Wi=e=>!(e=>Qn(e)&&"true"===e.getAttribute("unselectable"))(e)&&Ii(e),$i=(e,t)=>ji(e)&&((e,t)=>{for(let o=e.parentNode;o&&o!==t;o=o.parentNode){if(Wi(o))return!1;if(Hi(o))return!0}return!0})(e,t),qi=Qn,Gi=ji,Ki=nr("display","block table"),Yi=nr("float","left right"),Xi=((...e)=>t=>{for(let o=0;ot<0&&Qn(e)&&e.hasChildNodes()?void 0:Ri(e,t),nl=e=>e?e.createRange():ya.DOM.createRng(),rl=e=>h(e)&&/[\r\n\t ]/.test(e),sl=e=>!!e.setStart&&!!e.setEnd,al=e=>{const t=e.startContainer,o=e.startOffset;if(rl(e.toString())&&Ji(t.parentNode)&&lr(t)){const e=t.data;if(rl(e[o-1])||rl(e[o+1]))return!0}return!1},il=e=>0===e.left&&0===e.right&&0===e.top&&0===e.bottom,ll=e=>{var t;let o;const n=e.getClientRects();return o=n.length>0?Ei(n[0]):Ei(e.getBoundingClientRect()),!sl(e)&&el(e)&&il(o)?(e=>{const t=e.ownerDocument,o=nl(t),n=t.createTextNode(Wn),r=e.parentNode;r.insertBefore(n,e),o.setStart(n,0),o.setEnd(n,1);const s=Ei(o.getBoundingClientRect());return r.removeChild(n),s})(e):il(o)&&sl(e)&&null!==(t=(e=>{const t=e.startContainer,o=e.endContainer,n=e.startOffset,r=e.endOffset;if(t===o&&lr(o)&&0===n&&1===r){const t=e.cloneRange();return t.setEndAfter(o),ll(t)}return null})(e))&&void 0!==t?t:o},cl=(e,t)=>{const o=Ti(e,t);return o.width=1,o.right=o.left+1,o},dl=e=>{const t=[],o=e=>{var o,n;0!==e.height&&(t.length>0&&(o=e,n=t[t.length-1],o.left===n.left&&o.top===n.top&&o.bottom===n.bottom&&o.right===n.right)||t.push(e))},n=(e,t)=>{const n=nl(e.ownerDocument);if(t0&&(n.setStart(e,t-1),n.setEnd(e,t),al(n)||o(cl(ll(n),!1))),t{const n=()=>(o||(o=dl(ml(e,t))),o);return{container:A(e),offset:A(t),toRange:()=>{const o=nl(e.ownerDocument);return o.setStart(e,t),o.setEnd(e,t),o},getClientRects:n,isVisible:()=>n().length>0,isAtStart:()=>(Qi(e),0===t),isAtEnd:()=>Qi(e)?t>=e.data.length:t>=e.childNodes.length,isEqual:o=>o&&e===o.container()&&t===o.offset(),getNode:o=>ol(e,o?t-1:t)}};ml.fromRangeStart=e=>ml(e.startContainer,e.startOffset),ml.fromRangeEnd=e=>ml(e.endContainer,e.endOffset),ml.after=e=>ml(e.parentNode,tl(e)+1),ml.before=e=>ml(e.parentNode,tl(e)),ml.isAbove=(e,t)=>Pt(de(t.getClientRects()),me(e.getClientRects()),Ai).getOr(!1),ml.isBelow=(e,t)=>Pt(me(t.getClientRects()),de(e.getClientRects()),Di).getOr(!1),ml.isAtStart=e=>!!e&&e.isAtStart(),ml.isAtEnd=e=>!!e&&e.isAtEnd(),ml.isTextPosition=e=>!!e&&lr(e.container()),ml.isElementPosition=e=>!ml.isTextPosition(e);const ul=(e,t)=>{lr(t)&&0===t.data.length&&e.remove(t)},gl=(e,t,o)=>{gr(o)?((e,t,o)=>{const n=F.from(o.firstChild),r=F.from(o.lastChild);t.insertNode(o),n.each((t=>ul(e,t.previousSibling))),r.each((t=>ul(e,t.nextSibling)))})(e,t,o):((e,t,o)=>{t.insertNode(o),ul(e,o.previousSibling),ul(e,o.nextSibling)})(e,t,o)},hl=lr,pl=rr,fl=ya.nodeIndex,vl=e=>{const t=e.parentNode;return pl(t)?vl(t):t},bl=e=>e?Be(e.childNodes,((e,t)=>(pl(t)&&"BR"!==t.nodeName?e=e.concat(bl(t)):e.push(t),e)),[]):[],yl=e=>t=>e===t,wl=e=>(hl(e)?"text()":e.nodeName.toLowerCase())+"["+(e=>{let t,o;t=bl(vl(e)),o=Le(t,yl(e),e),t=t.slice(0,o+1);const n=Be(t,((e,o,n)=>(hl(o)&&hl(t[n-1])&&e++,e)),0);return t=Re(t,or([e.nodeName])),o=Le(t,yl(e),e),o-n})(e)+"]",xl=(e,t)=>{let o,n=[],r=t.container(),s=t.offset();if(hl(r))o=((e,t)=>{let o=e;for(;(o=o.previousSibling)&&hl(o);)t+=o.data.length;return t})(r,s);else{const e=r.childNodes;s>=e.length?(o="after",s=e.length-1):o="before",r=e[s]}n.push(wl(r));let a=((e,t)=>{const o=[];for(let n=t.parentNode;n&&n!==e;n=n.parentNode)o.push(n);return o})(e,r);return a=Re(a,R(rr)),n=n.concat(Ne(a,(e=>wl(e)))),n.reverse().join("/")+","+o},Cl=(e,t)=>{if(!t)return null;const o=t.split(","),n=o[0].split("/"),r=o.length>1?o[1]:"before",s=Be(n,((e,t)=>{const o=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t);return o?("text()"===o[1]&&(o[1]="#text"),((e,t,o)=>{let n=bl(e);return n=Re(n,((e,t)=>!hl(e)||!hl(n[t-1]))),n=Re(n,or([t])),n[o]})(e,o[1],parseInt(o[2],10))):null}),e);if(!s)return null;if(!hl(s)&&s.parentNode){let e;return e="after"===r?fl(s)+1:fl(s),ml(s.parentNode,e)}return((e,t)=>{let o=e,n=0;for(;hl(o);){const r=o.data.length;if(t>=n&&t<=n+r){e=o,t-=n;break}if(!hl(o.nextSibling)){e=o,t=r;break}n+=r,o=o.nextSibling}return hl(e)&&t>e.data.length&&(t=e.data.length),ml(e,t)})(s,parseInt(r,10))},Sl=vr,kl=(e,t,o,n,r)=>{const s=r?n.startContainer:n.endContainer;let a=r?n.startOffset:n.endOffset;const i=[],l=e.getRoot();if(lr(s))i.push(o?((e,t,o)=>{let n=e(t.data.slice(0,o)).length;for(let o=t.previousSibling;o&&lr(o);o=o.previousSibling)n+=e(o.data).length;return n})(t,s,a):a);else{let t=0;const n=s.childNodes;a>=n.length&&n.length&&(t=1,a=Math.max(0,n.length-1)),i.push(e.nodeIndex(n[a],o)+t)}for(let t=s;t&&t!==l;t=t.parentNode)i.push(e.nodeIndex(t,o));return i},_l=(e,t,o)=>{let n=0;return Lt.each(e.select(t),(e=>"all"===e.getAttribute("data-mce-bogus")?void 0:e!==o&&void n++)),n},El=(e,t)=>{let o=t?e.startContainer:e.endContainer,n=t?e.startOffset:e.endOffset;if(Qn(o)&&"TR"===o.nodeName){const r=o.childNodes;o=r[Math.min(t?n:n-1,r.length-1)],o&&(n=t?0:o.childNodes.length,t?e.setStart(o,n):e.setEnd(o,n))}},Tl=e=>(El(e,!0),El(e,!1),e),Ol=(e,t)=>{if(Qn(e)&&(e=Ri(e,t),Sl(e)))return e;if(vi(e)){lr(e)&&pi(e)&&(e=e.parentNode);let t=e.previousSibling;if(Sl(t))return t;if(t=e.nextSibling,Sl(t))return t}},Al=(e,t,o)=>{const n=o.getNode(),r=o.getRng();if("IMG"===n.nodeName||Sl(n)){const e=n.nodeName;return{name:e,index:_l(o.dom,e,n)}}const s=(e=>Ol(e.startContainer,e.startOffset)||Ol(e.endContainer,e.endOffset))(r);if(s){const e=s.tagName;return{name:e,index:_l(o.dom,e,s)}}return((e,t,o,n)=>{const r=t.dom,s=kl(r,e,o,n,!0),a=t.isForward(),i=ki(n)?{isFakeCaret:!0}:{};return t.isCollapsed()?{start:s,forward:a,...i}:{start:s,end:kl(r,e,o,n,!1),forward:a,...i}})(e,o,t,r)},Dl=(e,t,o)=>{const n={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return o?e.create("span",n,""):e.create("span",n)},Ml=(e,t)=>{const o=e.dom;let n=e.getRng();const r=o.uniqueId(),s=e.isCollapsed(),a=e.getNode(),i=a.nodeName,l=e.isForward();if("IMG"===i)return{name:i,index:_l(o,i,a)};const c=Tl(n.cloneRange());if(!s){c.collapse(!1);const e=Dl(o,r+"_end",t);gl(o,c,e)}n=Tl(n),n.collapse(!0);const d=Dl(o,r+"_start",t);return gl(o,n,d),e.moveToBookmark({id:r,keep:!0,forward:l}),{id:r,forward:l}},Nl=(e,t,o=!1)=>2===t?Al(ui,o,e):3===t?(e=>{const t=e.getRng();return{start:xl(e.dom.getRoot(),ml.fromRangeStart(t)),end:xl(e.dom.getRoot(),ml.fromRangeEnd(t)),forward:e.isForward()}})(e):t?(e=>({rng:e.getRng(),forward:e.isForward()}))(e):Ml(e,!1),Rl=N(Al,D,!0),Bl=e=>{const t=t=>t(e),o=A(e),n=()=>r,r={tag:!0,inner:e,fold:(t,o)=>o(e),isValue:P,isError:I,map:t=>Hl.value(t(e)),mapError:n,bind:t,exists:t,forall:t,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:t=>{t(e)},toOptional:()=>F.some(e)};return r},Ll=e=>{const t=()=>o,o={tag:!1,inner:e,fold:(t,o)=>t(e),isValue:I,isError:P,map:t,mapError:t=>Hl.error(t(e)),bind:t,exists:I,forall:P,getOr:D,or:D,getOrThunk:L,orThunk:L,getOrDie:B(String(e)),each:E,toOptional:F.none};return o},Hl={value:Bl,error:Ll,fromOption:(e,t)=>e.fold((()=>Ll(t)),Bl)},Il=e=>{if(!v(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],o={};return q(e,((n,r)=>{const s=pe(n);if(1!==s.length)throw new Error("one and only one name per case");const a=s[0],i=n[a];if(void 0!==o[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!v(i))throw new Error("case arguments must be an array");t.push(a),o[a]=(...o)=>{const n=o.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+i.length+" ("+i+"), got "+n);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[r].apply(null,o)},match:e=>{const n=pe(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));if(!re(t,(e=>j(n,e))))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,o)},log:e=>{console.log(e,{constructors:t,constructor:a,params:o})}}}})),o};Il([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const Pl=e=>"inline-command"===e.type||"inline-format"===e.type,Fl=e=>"block-command"===e.type||"block-format"===e.type,zl=e=>{var t;const o=t=>Hl.error({message:t,pattern:e}),n=(t,n,r)=>{if(void 0!==e.format){let r;if(v(e.format)){if(!re(e.format,h))return o(t+" pattern has non-string items in the `format` array");r=e.format}else{if(!h(e.format))return o(t+" pattern has non-string `format` parameter");r=[e.format]}return Hl.value(n(r))}return void 0!==e.cmd?h(e.cmd)?Hl.value(r(e.cmd,e.value)):o(t+" pattern has non-string `cmd` parameter"):o(t+" pattern is missing both `format` and `cmd` parameters")};if(!p(e))return o("Raw pattern is not an object");if(!h(e.start))return o("Raw pattern is missing `start` parameter");if(void 0!==e.end){if(!h(e.end))return o("Inline pattern has non-string `end` parameter");if(0===e.start.length&&0===e.end.length)return o("Inline pattern has empty `start` and `end` parameters");let t=e.start,r=e.end;return 0===r.length&&(r=t,t=""),n("Inline",(e=>({type:"inline-format",start:t,end:r,format:e})),((e,o)=>({type:"inline-command",start:t,end:r,cmd:e,value:o})))}if(void 0!==e.replacement)return h(e.replacement)?0===e.start.length?o("Replacement pattern has empty `start` parameter"):Hl.value({type:"inline-command",start:"",end:e.start,cmd:"mceInsertContent",value:e.replacement}):o("Replacement pattern has non-string `replacement` parameter");{const r=null!==(t=e.trigger)&&void 0!==t?t:"space";return 0===e.start.length?o("Block pattern has empty `start` parameter"):n("Block",(t=>({type:"block-format",start:e.start,format:t[0],trigger:r})),((t,o)=>({type:"block-command",start:e.start,cmd:t,value:o,trigger:r})))}},Vl=e=>Y(e,Fl),Zl=e=>Y(e,Pl),Ul=(e,t)=>({...e,blockPatterns:Y(e.blockPatterns,(e=>((e,t)=>("block-command"===e.type||"block-format"===e.type)&&e.trigger===t)(e,t)))}),jl=e=>{const t=(e=>{const t=[],o=[];return q(e,(e=>{e.fold((e=>{t.push(e)}),(e=>{o.push(e)}))})),{errors:t,values:o}})($(e,zl));return q(t.errors,(e=>console.error(e.message,e.pattern))),t.values},Wl=kt().deviceType,$l=Wl.isTouch(),ql=ya.DOM,Gl=e=>g(e,RegExp),Kl=e=>t=>t.options.get(e),Yl=e=>h(e)||p(e),Xl=(e,t="")=>o=>{const n=h(o);if(n){if(-1!==o.indexOf("=")){const r=(e=>{const t=e.indexOf("=")>0?e.split(/[;,](?![^=;,]*(?:[;,]|$))/):e.split(",");return J(t,((e,t)=>{const o=t.split("="),n=o[0],r=o.length>1?o[1]:n;return e[Ge(n)]=Ge(r),e}),{})})(o);return{value:_e(r,e.id).getOr(t),valid:n}}return{value:o,valid:n}}return{valid:!1,message:"Must be a string."}},Jl=Kl("iframe_attrs"),Ql=Kl("doctype"),ec=Kl("document_base_url"),tc=Kl("body_id"),oc=Kl("body_class"),nc=Kl("content_security_policy"),rc=Kl("br_in_pre"),sc=Kl("forced_root_block"),ac=Kl("forced_root_block_attrs"),ic=Kl("newline_behavior"),lc=Kl("br_newline_selector"),cc=Kl("no_newline_selector"),dc=Kl("keep_styles"),mc=Kl("end_container_on_empty_block"),uc=Kl("automatic_uploads"),gc=Kl("images_reuse_filename"),hc=Kl("images_replace_blob_uris"),pc=Kl("icons"),fc=Kl("icons_url"),vc=Kl("images_upload_url"),bc=Kl("images_upload_base_path"),yc=Kl("images_upload_credentials"),wc=Kl("images_upload_handler"),xc=Kl("content_css_cors"),Cc=Kl("referrer_policy"),Sc=Kl("language"),kc=Kl("language_url"),_c=Kl("indent_use_margin"),Ec=Kl("indentation"),Tc=Kl("content_css"),Oc=Kl("content_style"),Ac=Kl("font_css"),Dc=Kl("directionality"),Mc=Kl("inline_boundaries_selector"),Nc=Kl("object_resizing"),Rc=Kl("resize_img_proportional"),Bc=Kl("placeholder"),Lc=Kl("event_root"),Hc=Kl("service_message"),Ic=Kl("theme"),Pc=Kl("theme_url"),Fc=Kl("model"),zc=Kl("model_url"),Vc=Kl("inline_boundaries"),Zc=Kl("formats"),Uc=Kl("preview_styles"),jc=Kl("format_empty_lines"),Wc=Kl("format_noneditable_selector"),$c=Kl("custom_ui_selector"),qc=Kl("inline"),Gc=Kl("hidden_input"),Kc=Kl("submit_patch"),Yc=Kl("add_form_submit_trigger"),Xc=Kl("add_unload_trigger"),Jc=Kl("custom_undo_redo_levels"),Qc=Kl("disable_nodechange"),ed=Kl("readonly"),td=Kl("editable_root"),od=Kl("content_css_cors"),nd=Kl("plugins"),rd=Kl("external_plugins"),sd=Kl("block_unsupported_drop"),ad=Kl("visual"),id=Kl("visual_table_class"),ld=Kl("visual_anchor_class"),cd=Kl("iframe_aria_text"),dd=Kl("setup"),md=Kl("init_instance_callback"),ud=Kl("urlconverter_callback"),gd=Kl("auto_focus"),hd=Kl("browser_spellcheck"),pd=Kl("protect"),fd=Kl("paste_block_drop"),vd=Kl("paste_data_images"),bd=Kl("paste_preprocess"),yd=Kl("paste_postprocess"),wd=Kl("newdocument_content"),xd=Kl("paste_webkit_styles"),Cd=Kl("paste_remove_styles_if_webkit"),Sd=Kl("paste_merge_formats"),kd=Kl("smart_paste"),_d=Kl("paste_as_text"),Ed=Kl("paste_tab_spaces"),Td=Kl("allow_html_data_urls"),Od=Kl("text_patterns"),Ad=Kl("text_patterns_lookup"),Dd=Kl("noneditable_class"),Md=Kl("editable_class"),Nd=Kl("noneditable_regexp"),Rd=Kl("preserve_cdata"),Bd=Kl("highlight_on_focus"),Ld=Kl("xss_sanitization"),Hd=Kl("init_content_sync"),Id=e=>Lt.explode(e.options.get("images_file_types")),Pd=Kl("table_tab_navigation"),Fd=Kl("details_initial_state"),zd=Kl("details_serialized_state"),Vd=Kl("sandbox_iframes"),Zd=e=>e.options.get("sandbox_iframes_exclusions"),Ud=Kl("convert_unsafe_embeds"),jd=Kl("license_key"),Wd=Kl("api_key"),$d=Qn,qd=lr,Gd=e=>{const t=e.parentNode;t&&t.removeChild(e)},Kd=e=>{const t=ui(e);return{count:e.length-t.length,text:t}},Yd=e=>{let t;for(;-1!==(t=e.data.lastIndexOf(di));)e.deleteData(t,1)},Xd=(e,t)=>(tm(e),t),Jd=(e,t)=>{const o=t.container(),n=((e,t)=>{const o=U(e,t);return-1===o?F.none():F.some(o)})(ue(o.childNodes),e).map((e=>eqd(e)&&t.container()===e?((e,t)=>{const o=Kd(e.data.substr(0,t.offset())),n=Kd(e.data.substr(t.offset()));return(o.text+n.text).length>0?(Yd(e),ml(e,t.offset()-o.count)):t})(e,t):Xd(e,t),em=(e,t)=>ml.isTextPosition(t)?Qd(e,t):((e,t)=>t.container()===e.parentNode?Jd(e,t):Xd(e,t))(e,t),tm=e=>{$d(e)&&vi(e)&&(bi(e)?e.removeAttribute("data-mce-caret"):Gd(e)),qd(e)&&(Yd(e),0===e.data.length&&Gd(e))},om=vr,nm=wr,rm=br,sm=(e,t,o)=>{const n=Ti(t.getBoundingClientRect(),o);let r,s;if("BODY"===e.tagName){const t=e.ownerDocument.documentElement;r=e.scrollLeft||t.scrollLeft,s=e.scrollTop||t.scrollTop}else{const t=e.getBoundingClientRect();r=e.scrollLeft-t.left,s=e.scrollTop-t.top}n.left+=r,n.right+=r,n.top+=s,n.bottom+=s,n.width=1;let a=t.offsetWidth-t.clientWidth;return a>0&&(o&&(a*=-1),n.left+=a,n.right+=a),n},am=(e,t,o,n)=>{const r=Lr();let s,a;const i=sc(e),l=e.dom,c=()=>{(e=>{var t,o;const n=Fn(wo.fromDom(e),"*[contentEditable=false],video,audio,embed,object");for(let e=0;e{l.remove(e.caret),r.clear()})),s&&(clearInterval(s),s=void 0)},d=()=>{s=setInterval((()=>{r.on((e=>{n()?l.toggleClass(e.caret,"mce-visual-caret-hidden"):l.addClass(e.caret,"mce-visual-caret-hidden")}))}),500)};return{show:(e,n)=>{let s;if(c(),rm(n))return null;if(!o(n))return a=((e,t)=>{var o;const n=(null!==(o=e.ownerDocument)&&void 0!==o?o:document).createTextNode(di),r=e.parentNode;if(t){const t=e.previousSibling;if(hi(t)){if(vi(t))return t;if(Ci(t))return t.splitText(t.data.length-1)}null==r||r.insertBefore(n,e)}else{const t=e.nextSibling;if(hi(t)){if(vi(t))return t;if(xi(t))return t.splitText(1),t}e.nextSibling?null==r||r.insertBefore(n,e.nextSibling):null==r||r.appendChild(n)}return n})(n,e),s=n.ownerDocument.createRange(),lm(a.nextSibling)?(s.setStart(a,0),s.setEnd(a,0)):(s.setStart(a,1),s.setEnd(a,1)),s;{const o=((e,t,o)=>{var n;const r=(null!==(n=t.ownerDocument)&&void 0!==n?n:document).createElement(e);r.setAttribute("data-mce-caret",o?"before":"after"),r.setAttribute("data-mce-bogus","all"),r.appendChild(li().dom);const s=t.parentNode;return o?null==s||s.insertBefore(r,t):t.nextSibling?null==s||s.insertBefore(r,t.nextSibling):null==s||s.appendChild(r),r})(i,n,e),c=sm(t,n,e);l.setStyle(o,"top",c.top),l.setStyle(o,"caret-color","transparent"),a=o;const m=l.create("div",{class:"mce-visual-caret","data-mce-bogus":"all"});l.setStyles(m,{...c}),l.add(t,m),r.set({caret:m,element:n,before:e}),e&&l.addClass(m,"mce-visual-caret-before"),d(),s=n.ownerDocument.createRange(),s.setStart(o,0),s.setEnd(o,0)}return s},hide:c,getCss:()=>".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}",reposition:()=>{r.on((e=>{const o=sm(t,e.element,e.before);l.setStyles(e.caret,{...o})}))},destroy:()=>clearInterval(s)}},im=()=>Mt.browser.isFirefox(),lm=e=>om(e)||nm(e),cm=e=>(lm(e)||sr(e)&&im())&&Do(wo.fromDom(e)).exists(on),dm=fr,mm=vr,um=wr,gm=nr("display","block table table-cell table-caption list-item"),hm=vi,pm=pi,fm=Qn,vm=lr,bm=ji,ym=e=>e>0,wm=e=>e<0,xm=(e,t)=>{let o;for(;o=e(t);)if(!pm(o))return o;return null},Cm=(e,t,o,n,r)=>{const s=new Un(e,n),a=mm(e)||pm(e);let i;if(wm(t)){if(a&&(i=xm(s.prev.bind(s),!0),o(i)))return i;for(;i=xm(s.prev.bind(s),r);)if(o(i))return i}if(ym(t)){if(a&&(i=xm(s.next.bind(s),!0),o(i)))return i;for(;i=xm(s.next.bind(s),r);)if(o(i))return i}return null},Sm=(e,t)=>{for(;e&&e!==t;){if(gm(e))return e;e=e.parentNode}return null},km=(e,t,o)=>Sm(e.container(),o)===Sm(t.container(),o),_m=(e,t)=>{if(!t)return F.none();const o=t.container(),n=t.offset();return fm(o)?F.from(o.childNodes[n+e]):F.none()},Em=(e,t)=>{var o;const n=(null!==(o=t.ownerDocument)&&void 0!==o?o:document).createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},Tm=(e,t,o)=>Sm(t,e)===Sm(o,e),Om=(e,t,o)=>{const n=e?"previousSibling":"nextSibling";let r=o;for(;r&&r!==t;){let e=r[n];if(e&&hm(e)&&(e=e[n]),mm(e)||um(e)){if(Tm(t,e,r))return e;break}if(bm(e))break;r=r.parentNode}return null},Am=N(Em,!0),Dm=N(Em,!1),Mm=(e,t,o)=>{let n;const r=N(Om,!0,t),s=N(Om,!1,t),a=o.startContainer,i=o.startOffset;if(pi(a)){const e=vm(a)?a.parentNode:a,t=e.getAttribute("data-mce-caret");if("before"===t&&(n=e.nextSibling,cm(n)))return Am(n);if("after"===t&&(n=e.previousSibling,cm(n)))return Dm(n)}if(!o.collapsed)return o;if(lr(a)){if(hm(a)){if(1===e){if(n=s(a),n)return Am(n);if(n=r(a),n)return Dm(n)}if(-1===e){if(n=r(a),n)return Dm(n);if(n=s(a),n)return Am(n)}return o}if(Ci(a)&&i>=a.data.length-1)return 1===e&&(n=s(a),n)?Am(n):o;if(xi(a)&&i<=1)return-1===e&&(n=r(a),n)?Dm(n):o;if(i===a.data.length)return n=s(a),n?Am(n):o;if(0===i)return n=r(a),n?Dm(n):o}return o},Nm=(e,t)=>_m(e?0:-1,t).filter(mm),Rm=(e,t,o)=>{const n=Mm(e,t,o);return-1===e?ml.fromRangeStart(n):ml.fromRangeEnd(n)},Bm=e=>F.from(e.getNode()).map(wo.fromDom),Lm=(e,t)=>{let o=t;for(;o=e(o);)if(o.isVisible())return o;return o},Hm=(e,t)=>{const o=km(e,t);return!(o||!hr(e.getNode()))||o};var Im;!function(e){e[e.Backwards=-1]="Backwards",e[e.Forwards=1]="Forwards"}(Im||(Im={}));const Pm=vr,Fm=lr,zm=Qn,Vm=hr,Zm=ji,Um=e=>Vi(e)||(e=>!!Wi(e)&&!J(ue(e.getElementsByTagName("*")),((e,t)=>e||Hi(t)),!1))(e),jm=$i,Wm=(e,t)=>e.hasChildNodes()&&t{if(ym(e)){if(Zm(t.previousSibling)&&!Fm(t.previousSibling))return ml.before(t);if(Fm(t))return ml(t,0)}if(wm(e)){if(Zm(t.nextSibling)&&!Fm(t.nextSibling))return ml.after(t);if(Fm(t))return ml(t,t.data.length)}return wm(e)?Vm(t)?ml.before(t):ml.after(t):ml.before(t)},qm=(e,t,o)=>{let n,r,s,a;if(!zm(o)||!t)return null;if(t.isEqual(ml.after(o))&&o.lastChild){if(a=ml.after(o.lastChild),wm(e)&&Zm(o.lastChild)&&zm(o.lastChild))return Vm(o.lastChild)?ml.before(o.lastChild):a}else a=t;const i=a.container();let l=a.offset();if(Fm(i)){if(wm(e)&&l>0)return ml(i,--l);if(ym(e)&&l0&&(r=Wm(i,l-1),Zm(r)))return!Um(r)&&(s=Cm(r,e,jm,r),s)?Fm(s)?ml(s,s.data.length):ml.after(s):Fm(r)?ml(r,r.data.length):ml.before(r);if(ym(e)&&l{const o=t.nextSibling;return o&&Zm(o)?Fm(o)?ml(o,0):ml.before(o):qm(Im.Forwards,ml.after(t),e)})(o,r):!Um(r)&&(s=Cm(r,e,jm,r),s)?Fm(s)?ml(s,0):ml.before(s):Fm(r)?ml(r,0):ml.after(r);n=r||a.getNode()}if(n&&(ym(e)&&a.isAtEnd()||wm(e)&&a.isAtStart())&&(n=Cm(n,e,P,o,!0),jm(n,o)))return $m(e,n);r=n?Cm(n,e,jm,o):n;const c=He(Y(((e,t)=>{const o=[];let n=e;for(;n&&n!==t;)o.push(n),n=n.parentNode;return o})(i,o),Pm));return!c||r&&c.contains(r)?r?$m(e,r):null:(a=ym(e)?ml.after(c):ml.before(c),a)},Gm=e=>({next:t=>qm(Im.Forwards,t,e),prev:t=>qm(Im.Backwards,t,e)}),Km=e=>ml.isTextPosition(e)?0===e.offset():ji(e.getNode()),Ym=e=>{if(ml.isTextPosition(e)){const t=e.container();return e.offset()===t.data.length}return ji(e.getNode(!0))},Xm=(e,t)=>!ml.isTextPosition(e)&&!ml.isTextPosition(t)&&e.getNode()===t.getNode(!0),Jm=(e,t,o)=>{return e?!Xm(t,o)&&(n=t,!(!ml.isTextPosition(n)&&hr(n.getNode())))&&Ym(t)&&Km(o):!Xm(o,t)&&Km(t)&&Ym(o);var n},Qm=(e,t,o)=>{const n=Gm(t);return F.from(e?n.next(o):n.prev(o))},eu=(e,t,o)=>Qm(e,t,o).bind((n=>km(o,n,t)&&Jm(e,o,n)?Qm(e,t,n):F.some(n))),tu=(e,t,o,n)=>eu(e,t,o).bind((o=>n(o)?tu(e,t,o,n):F.some(o))),ou=(e,t)=>{const o=e?t.firstChild:t.lastChild;return lr(o)?F.some(ml(o,e?0:o.data.length)):o?ji(o)?F.some(e?ml.before(o):hr(n=o)?ml.before(n):ml.after(n)):((e,t,o)=>{const n=e?ml.before(o):ml.after(o);return Qm(e,t,n)})(e,t,o):F.none();var n},nu=N(Qm,!0),ru=N(Qm,!1),su=N(ou,!0),au=N(ou,!1),iu="_mce_caret",lu=e=>Qn(e)&&e.id===iu,cu=(e,t)=>{let o=t;for(;o&&o!==e;){if(lu(o))return o;o=o.parentNode}return null},du=e=>Ee(e,"name"),mu=e=>Lt.isArray(e.start),uu=e=>!(!du(e)&&y(e.forward))||e.forward,gu=(e,t)=>(Qn(t)&&e.isBlock(t)&&!t.innerHTML&&(t.innerHTML='
    '),t),hu=(e,t)=>au(e).fold(I,(e=>(t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0))),pu=(e,t,o)=>!(!(e=>!e.hasChildNodes())(t)||!cu(e,t)||(((e,t)=>{var o;const n=(null!==(o=e.ownerDocument)&&void 0!==o?o:document).createTextNode(di);e.appendChild(n),t.setStart(n,0),t.setEnd(n,0)})(t,o),0)),fu=(e,t,o,n)=>{const r=o[t?"start":"end"],s=e.getRoot();if(r){let e=s,o=r[0];for(let t=r.length-1;e&&t>=1;t--){const o=e.childNodes;if(pu(s,e,n))return!0;if(r[t]>o.length-1)return!!pu(s,e,n)||hu(e,n);e=o[r[t]]}lr(e)&&(o=Math.min(r[0],e.data.length)),Qn(e)&&(o=Math.min(r[0],e.childNodes.length)),t?n.setStart(e,o):n.setEnd(e,o)}return!0},vu=e=>lr(e)&&e.data.length>0,bu=(e,t,o)=>{const n=e.get(o.id+"_"+t),r=null==n?void 0:n.parentNode,s=o.keep;if(n&&r){let a,i;if("start"===t?s?n.hasChildNodes()?(a=n.firstChild,i=1):vu(n.nextSibling)?(a=n.nextSibling,i=0):vu(n.previousSibling)?(a=n.previousSibling,i=n.previousSibling.data.length):(a=r,i=e.nodeIndex(n)+1):(a=r,i=e.nodeIndex(n)):s?n.hasChildNodes()?(a=n.firstChild,i=1):vu(n.previousSibling)?(a=n.previousSibling,i=n.previousSibling.data.length):(a=r,i=e.nodeIndex(n)):(a=r,i=e.nodeIndex(n)),!s){const r=n.previousSibling,s=n.nextSibling;let l;for(Lt.each(Lt.grep(n.childNodes),(e=>{lr(e)&&(e.data=e.data.replace(/\uFEFF/g,""))}));l=e.get(o.id+"_"+t);)e.remove(l,!0);if(lr(s)&&lr(r)&&!Mt.browser.isOpera()){const t=r.data.length;r.appendData(s.data),e.remove(s),a=r,i=t}}return F.some(ml(a,i))}return F.none()},yu=(e,t)=>{const o=e.dom;if(t){if(mu(t))return((e,t)=>{const o=e.createRng();return fu(e,!0,t,o)&&fu(e,!1,t,o)?F.some({range:o,forward:uu(t)}):F.none()})(o,t);if((e=>h(e.start))(t))return((e,t)=>{const o=F.from(Cl(e.getRoot(),t.start)),n=F.from(Cl(e.getRoot(),t.end));return Pt(o,n,((o,n)=>{const r=e.createRng();return r.setStart(o.container(),o.offset()),r.setEnd(n.container(),n.offset()),{range:r,forward:uu(t)}}))})(o,t);if((e=>Ee(e,"id"))(t))return((e,t)=>{const o=bu(e,"start",t),n=bu(e,"end",t);return Pt(o,n.or(o),((o,n)=>{const r=e.createRng();return r.setStart(gu(e,o.container()),o.offset()),r.setEnd(gu(e,n.container()),n.offset()),{range:r,forward:uu(t)}}))})(o,t);if(du(t))return((e,t)=>F.from(e.select(t.name)[t.index]).map((t=>{const o=e.createRng();return o.selectNode(t),{range:o,forward:!0}})))(o,t);if((e=>Ee(e,"rng"))(t))return F.some({range:t.rng,forward:uu(t)})}return F.none()},wu=(e,t,o)=>Nl(e,t,o),xu=(e,t)=>{yu(e,t).each((({range:t,forward:o})=>{e.setRng(t,o)}))},Cu=e=>Qn(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type"),Su=(ku=Wn,e=>ku===e);var ku;const _u=e=>""!==e&&-1!==" \f\n\r\t\v".indexOf(e),Eu=e=>!_u(e)&&!Su(e)&&!$n(e),Tu=e=>{const t=[];if(e)for(let o=0;oY((e=>ne(e,(e=>{const t=Ni(e);return t?[wo.fromDom(t)]:[]})))(e),si),Au=(e,t)=>{const o=Fn(t,"td[data-mce-selected],th[data-mce-selected]");return o.length>0?o:Ou(e)},Du=e=>Au(Tu(e.selection.getSel()),wo.fromDom(e.getBody())),Mu=(e,t)=>Qo(e,"table",t),Nu=e=>Po(e).fold(A([e]),(t=>[e].concat(Nu(t)))),Ru=e=>Fo(e).fold(A([e]),(t=>"br"===Wt(t)?No(t).map((t=>[e].concat(Ru(t)))).getOr([]):[e].concat(Ru(t)))),Bu=(e,t)=>Pt((e=>{const t=e.startContainer,o=e.startOffset;return lr(t)?0===o?F.some(wo.fromDom(t)):F.none():F.from(t.childNodes[o]).map(wo.fromDom)})(t),(e=>{const t=e.endContainer,o=e.endOffset;return lr(t)?o===t.data.length?F.some(wo.fromDom(t)):F.none():F.from(t.childNodes[o-1]).map(wo.fromDom)})(t),((t,o)=>{const n=ee(Nu(e),N(ko,t)),r=ee(Ru(e),N(ko,o));return n.isSome()&&r.isSome()})).getOr(!1),Lu=(e,t,o,n)=>{const r=o,s=new Un(o,r),a=Ce(e.schema.getMoveCaretBeforeOnEnterElements(),((e,t)=>!j(["td","th","table"],t.toLowerCase())));let i=o;do{if(lr(i)&&0!==Lt.trim(i.data).length)return void(n?t.setStart(i,0):t.setEnd(i,i.data.length));if(a[i.nodeName])return void(n?t.setStartBefore(i):"BR"===i.nodeName?t.setEndBefore(i):t.setEndAfter(i))}while(i=n?s.next():s.prev());"BODY"===r.nodeName&&(n?t.setStart(r,0):t.setEnd(r,r.childNodes.length))},Hu=e=>{const t=e.selection.getSel();return C(t)&&t.rangeCount>0},Iu=(e,t)=>{const o=Du(e);o.length>0?q(o,(o=>{const n=o.dom,r=e.dom.createRng();r.setStartBefore(n),r.setEndAfter(n),t(r,!0)})):t(e.selection.getRng(),!1)},Pu=(e,t,o)=>{const n=Ml(e,t);o(n),e.moveToBookmark(n)},Fu=e=>k(null==e?void 0:e.nodeType),zu=e=>Qn(e)&&!Cu(e)&&!lu(e)&&!rr(e),Vu=(e,t,o)=>{const{selection:n,dom:r}=e,s=n.getNode(),a=vr(s);Pu(n,!0,(()=>{t()})),a&&vr(s)&&r.isChildOf(s,e.getBody())?e.selection.select(s):o(n.getStart())&&Zu(r,n)},Zu=(e,t)=>{var o,n;const r=t.getRng(),{startContainer:s,startOffset:a}=r;if(!((e,t)=>{if(zu(t)&&!/^(TD|TH)$/.test(t.nodeName)){const o=e.getAttrib(t,"data-mce-selected"),n=parseInt(o,10);return!isNaN(n)&&n>0}return!1})(e,t.getNode())&&Qn(s)){const i=s.childNodes,l=e.getRoot();let c;if(a{if(e){const o=t?"nextSibling":"previousSibling";for(e=e[o];e;e=e[o])if(Qn(e)||!$u(e))return e}},ju=(e,t)=>!!e.getTextBlockElements()[t.nodeName.toLowerCase()]||Jr(e,t),Wu=(e,t,o)=>e.schema.isValidChild(t,o),$u=(e,t=!1)=>{if(C(e)&&lr(e)){const o=t?e.data.replace(/ /g," "):e.data;return Gn(o)}return!1},qu=(e,t)=>{const o=e.dom;return zu(t)&&"false"===o.getContentEditable(t)&&((e,t)=>{const o="[data-mce-cef-wrappable]",n=Wc(e),r=Je(n)?o:`${o},${n}`;return Co(wo.fromDom(t),r)})(e,t)&&0===o.select('[contenteditable="true"]',t).length},Gu=(e,t)=>S(e)?e(t):(C(t)&&(e=e.replace(/%(\w+)/g,((e,o)=>t[o]||e))),e),Ku=(e,t)=>(t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()),Yu=(e,t)=>{if(x(e))return null;{let o=String(e);return"color"!==t&&"backgroundColor"!==t||(o=Js(o)),"fontWeight"===t&&700===e&&(o="bold"),"fontFamily"===t&&(o=o.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),o}},Xu=(e,t,o)=>{const n=e.getStyle(t,o);return Yu(n,o)},Ju=(e,t)=>{let o;return e.getParent(t,(t=>!!Qn(t)&&(o=e.getStyle(t,"text-decoration"),!!o&&"none"!==o))),o},Qu=(e,t,o)=>e.getParents(t,o,e.getRoot()),eg=(e,t,o)=>{const n=e.formatter.get(t);return C(n)&&W(n,o)},tg=(e,t,o)=>{const n=["inline","block","selector","attributes","styles","classes"],r=e=>Ce(e,((e,t)=>W(n,(e=>e===t))));return eg(e,t,(t=>{const n=r(t);return eg(e,o,(e=>{const t=r(e);return((e,t,o=i)=>a(o).eq(e,t))(n,t)}))}))},og=e=>Te(e,"block"),ng=e=>Te(e,"selector"),rg=e=>Te(e,"inline"),sg=e=>ng(e)&&!1!==e.expand&&!rg(e),ag=e=>(e=>{const t=[];let o=e;for(;o;){if(lr(o)&&o.data!==di||o.childNodes.length>1)return[];Qn(o)&&t.push(o),o=o.firstChild}return t})(e).length>0,ig=e=>lu(e.dom)&&ag(e.dom),lg=Cu,cg=Qu,dg=$u,mg=ju,ug=(e,t)=>{let o=t;for(;o;){if(Qn(o)&&e.getContentEditable(o))return"false"===e.getContentEditable(o)?o:t;o=o.parentNode}return t},gg=(e,t,o,n)=>{const r=t.data;if(e){for(let e=o;e>0;e--)if(n(r.charAt(e-1)))return e}else for(let e=o;egg(e,t,o,(e=>Su(e)||_u(e))),pg=(e,t,o)=>gg(e,t,o,Eu),fg=(e,t,o,n,r,s)=>{let a;const i=e.getParent(o,e.isBlock)||t,l=(t,o,n)=>{const s=Ka(e),l=r?s.backwards:s.forwards;return F.from(l(t,o,((e,t)=>lg(e.parentNode)?-1:(a=e,n(r,e,t))),i))};return l(o,n,hg).bind((e=>s?l(e.container,e.offset+(r?-1:0),pg):F.some(e))).orThunk((()=>a?F.some({container:a,offset:r?0:a.length}):F.none()))},vg=(e,t,o,n,r)=>{const s=n[r];lr(n)&&Je(n.data)&&s&&(n=s);const a=cg(e,n);for(let n=0;n{var r;let s=o;const a=e.getRoot(),i=t[0];if(og(i)&&(s=i.wrapper?null:e.getParent(o,i.block,a)),!s){const t=null!==(r=e.getParent(o,"LI,TD,TH,SUMMARY"))&&void 0!==r?r:a;s=e.getParent(lr(o)?o.parentNode:o,(t=>t!==a&&mg(e.schema,t)),t)}if(s&&og(i)&&i.wrapper&&(s=cg(e,s,"ul,ol").reverse()[0]||s),!s)for(s=o;s&&s[n]&&!e.isBlock(s[n])&&(s=s[n],!Ku(s,"br")););return s||o},yg=(e,t,o,n)=>{const r=o.parentNode;return!C(o[n])&&(!(r!==t&&!x(r)&&!e.isBlock(r))||yg(e,t,r,n))},wg=(e,t,o,n,r)=>{let s=o;const a=r?"previousSibling":"nextSibling",i=e.getRoot();if(lr(o)&&!dg(o)&&(r?n>0:nlg(e.parentNode)||lg(e),Cg=(e,t,o,n=!1)=>{let{startContainer:r,startOffset:s,endContainer:a,endOffset:i}=t;const l=o[0];return Qn(r)&&r.hasChildNodes()&&(r=Ri(r,s),lr(r)&&(s=0)),Qn(a)&&a.hasChildNodes()&&(a=Ri(a,t.collapsed?i:i-1),lr(a)&&(i=a.data.length)),r=ug(e,r),a=ug(e,a),xg(r)&&(r=lg(r)?r:r.parentNode,r=t.collapsed?r.previousSibling||r:r.nextSibling||r,lr(r)&&(s=t.collapsed?r.length:0)),xg(a)&&(a=lg(a)?a:a.parentNode,a=t.collapsed?a.nextSibling||a:a.previousSibling||a,lr(a)&&(i=t.collapsed?0:a.length)),t.collapsed&&(fg(e,e.getRoot(),r,s,!0,n).each((({container:e,offset:t})=>{r=e,s=t})),fg(e,e.getRoot(),a,i,!1,n).each((({container:e,offset:t})=>{a=e,i=t}))),(rg(l)||l.block_expand)&&(rg(l)&&lr(r)&&0!==s||(r=wg(e,o,r,s,!0)),rg(l)&&lr(a)&&i!==a.data.length||(a=wg(e,o,a,i,!1))),sg(l)&&(r=vg(e,o,t,r,"previousSibling"),a=vg(e,o,t,a,"nextSibling")),(og(l)||ng(l))&&(r=bg(e,o,r,"previousSibling"),a=bg(e,o,a,"nextSibling"),og(l)&&(e.isBlock(r)||(r=wg(e,o,r,s,!0),lr(r)&&(s=0)),e.isBlock(a)||(a=wg(e,o,a,i,!1),lr(a)&&(i=a.data.length)))),Qn(r)&&r.parentNode&&(s=e.nodeIndex(r),r=r.parentNode),Qn(a)&&a.parentNode&&(i=e.nodeIndex(a)+1,a=a.parentNode),{startContainer:r,startOffset:s,endContainer:a,endOffset:i}},Sg=(e,t,o)=>{var n;const r=t.startOffset,s=Ri(t.startContainer,r),a=t.endOffset,i=Ri(t.endContainer,a-1),l=e=>{const t=e[0];lr(t)&&t===s&&r>=t.data.length&&e.splice(0,1);const o=e[e.length-1];return 0===a&&e.length>0&&o===i&&lr(o)&&e.splice(e.length-1,1),e},c=(e,t,o)=>{const n=[];for(;e&&e!==o;e=e[t])n.push(e);return n},d=(t,o)=>e.getParent(t,(e=>e.parentNode===o),o),m=(e,t,n)=>{const r=n?"nextSibling":"previousSibling";for(let s=e,a=s.parentNode;s&&s!==t;s=a){a=s.parentNode;const t=c(s===e?s:s[r],r);t.length&&(n||t.reverse(),o(l(t)))}};if(s===i)return o(l([s]));const u=null!==(n=e.findCommonAncestor(s,i))&&void 0!==n?n:e.getRoot();if(e.isChildOf(s,i))return m(s,u,!0);if(e.isChildOf(i,s))return m(i,u);const g=d(s,u)||s,h=d(i,u)||i;m(s,g,!0);const p=c(g===s?g:g.nextSibling,"nextSibling",h===i?h.nextSibling:h);p.length&&o(l(p)),m(i,h)},kg=['pre[class*=language-][contenteditable="false"]',"figure.image","div[data-ephox-embed-iri]","div.tiny-pageembed","div.mce-toc","div[data-mce-toc]"],_g=(e,t,o,n)=>Ao(t).fold((()=>"skipping"),(r=>"br"===n||(e=>Yt(e)&&Xa(e)===di)(t)?"valid":(e=>Kt(e)&&bo(e,Aa()))(t)?"existing":lu(t.dom)?"caret":W(kg,(e=>Co(t,e)))?"valid-block":Wu(e,o,n)&&Wu(e,Wt(r),o)?"valid":"invalid-child")),Eg=(e,t,o,n,r,s)=>{const{uid:a=t,...i}=o;ho(e,Aa()),to(e,`${Ma()}`,a),to(e,`${Da()}`,n);const{attributes:l={},classes:c=[]}=r(a,i);if(oo(e,l),((e,t)=>{q(t,(t=>{ho(e,t)}))})(e,c),s){c.length>0&&to(e,`${Ra()}`,c.join(","));const t=pe(l);t.length>0&&to(e,`${Ba()}`,t.join(","))}},Tg=e=>{fo(e,Aa()),ao(e,`${Ma()}`),ao(e,`${Da()}`),ao(e,`${Na()}`);const t=ro(e,`${Ba()}`).map((e=>e.split(","))).getOr([]),o=ro(e,`${Ra()}`).map((e=>e.split(","))).getOr([]);var n;q(t,(t=>ao(e,t))),n=e,q(o,(e=>{fo(n,e)})),ao(e,`${Ra()}`),ao(e,`${Ba()}`)},Og=(e,t,o,n,r)=>{const s=wo.fromTag("span",e);return Eg(s,t,o,n,r,!1),s},Ag=(e,t,o,n,r,s)=>{const a=[],i=Og(e.getDoc(),o,s,n,r),l=Lr(),c=()=>{l.clear()},d=e=>{q(e,m)},m=t=>{switch(_g(e,t,"span",Wt(t))){case"invalid-child":{c();const e=Ho(t);d(e),c();break}case"valid-block":c(),Eg(t,o,s,n,r,!0);break;case"valid":{const e=l.get().getOrThunk((()=>{const e=Wa(i);return a.push(e),l.set(e),e}));bn(t,e);break}}};return Sg(e.dom,t,(e=>{c(),(e=>{const t=$(e,wo.fromDom);d(t)})(e)})),a},Dg=(e,t,o,n)=>{e.undoManager.transact((()=>{const r=e.selection,s=r.getRng(),a=Du(e).length>0,i=Ua("mce-annotation");if(s.collapsed&&!a&&((e,t)=>{const o=Cg(e.dom,t,[{inline:"span"}]);t.setStart(o.startContainer,o.startOffset),t.setEnd(o.endContainer,o.endOffset),e.selection.setRng(t)})(e,s),r.getRng().collapsed&&!a){const s=Og(e.getDoc(),i,n,t,o.decorate);_n(s,Wn),r.getRng().insertNode(s.dom),r.select(s.dom)}else Pu(r,!1,(()=>{Iu(e,(r=>{Ag(e,r,i,t,o.decorate,n)}))}))}))},Mg=e=>{const t=(()=>{const e={};return{register:(t,o)=>{e[t]={name:t,settings:o}},lookup:t=>_e(e,t).map((e=>e.settings)),getNames:()=>pe(e)}})();((e,t)=>{const o=Da(),n=e=>F.from(e.attr(o)).bind(t.lookup),r=e=>{var t,o;e.attr(Ma(),null),e.attr(Da(),null),e.attr(Na(),null);const n=F.from(e.attr(Ba())).map((e=>e.split(","))).getOr([]),r=F.from(e.attr(Ra())).map((e=>e.split(","))).getOr([]);q(n,(t=>e.attr(t,null)));const s=null!==(o=null===(t=e.attr("class"))||void 0===t?void 0:t.split(" "))&&void 0!==o?o:[],a=ae(s,[Aa()].concat(r));e.attr("class",a.length>0?a.join(" "):null),e.attr(Ra(),null),e.attr(Ba(),null)};e.serializer.addTempAttr(Na()),e.serializer.addAttributeFilter(o,(e=>{for(const t of e)n(t).each((e=>{!1===e.persistent&&("span"===t.name?t.unwrap():r(t))}))}))})(e,t);const o=za(e,t),n=Qt("span"),r=e=>{q(e,(e=>{n(e)?Cn(e):Tg(e)}))};return{register:(e,o)=>{t.register(e,o)},annotate:(o,n)=>{t.lookup(o).each((t=>{Dg(e,o,t,n)}))},annotationChanged:(e,t)=>{o.addListener(e,t)},remove:t=>{Ha(e,F.some(t)).each((({elements:t})=>{const o=e.selection.getBookmark();r(t),e.selection.moveToBookmark(o)}))},removeAll:t=>{const o=e.selection.getBookmark();ve(Fa(e,t),((e,t)=>{r(e)})),e.selection.moveToBookmark(o)},getAll:t=>{const o=Fa(e,t);return be(o,(e=>$(e,(e=>e.dom))))}}},Ng=e=>({getBookmark:N(wu,e),moveToBookmark:N(xu,e)});Ng.isBookmarkNode=Cu;const Rg=(e,t,o)=>!o.collapsed&&W(o.getClientRects(),(o=>((e,t,o)=>t>=e.left&&t<=e.right&&o>=e.top&&o<=e.bottom)(o,e,t))),Bg=(e,t,o)=>{e.dispatch(t,o)},Lg=(e,t,o,n)=>{e.dispatch("FormatApply",{format:t,node:o,vars:n})},Hg=(e,t,o,n)=>{e.dispatch("FormatRemove",{format:t,node:o,vars:n})},Ig=(e,t)=>e.dispatch("SetContent",t),Pg=(e,t)=>e.dispatch("GetContent",t),Fg=(e,t)=>{e.dispatch("AutocompleterUpdateActiveRange",t)},zg=(e,t)=>e.dispatch("PastePlainTextToggle",{state:t}),Vg={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:e=>e.shiftKey||e.ctrlKey||e.altKey||Vg.metaKeyPressed(e),metaKeyPressed:e=>Mt.os.isMacOS()||Mt.os.isiOS()?e.metaKey:e.ctrlKey&&!e.altKey},Zg="data-mce-selected",Ug=Math.abs,jg=Math.round,Wg={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},$g=(e,t)=>{const o=t.dom,n=t.getDoc(),r=document,s=t.getBody();let a,i,l,c,d,m,u,g,h,p,f,v,b,y,w;const x=e=>C(e)&&(pr(e)||o.is(e,"figure.image")),S=e=>wr(e)||o.hasClass(e,"mce-preview-object"),k=e=>{const o=e.target;((e,t)=>{if((e=>"longpress"===e.type||0===e.type.indexOf("touch"))(e)){const o=e.touches[0];return x(e.target)&&!Rg(o.clientX,o.clientY,t)}return x(e.target)&&!Rg(e.clientX,e.clientY,t)})(e,t.selection.getRng())&&!e.isDefaultPrevented()&&t.selection.select(o)},_=e=>o.hasClass(e,"mce-preview-object")&&C(e.firstElementChild)?[e,e.firstElementChild]:o.is(e,"figure.image")?[e.querySelector("img")]:[e],E=e=>{const n=Nc(t);return!!n&&"false"!==e.getAttribute("data-mce-resize")&&e!==t.getBody()&&(o.hasClass(e,"mce-preview-object")&&C(e.firstElementChild)?Co(wo.fromDom(e.firstElementChild),n):Co(wo.fromDom(e),n))},T=(e,n,r)=>{if(C(r)){const s=_(e);q(s,(e=>{e.style[n]||!t.schema.isValid(e.nodeName.toLowerCase(),n)?o.setStyle(e,n,r):o.setAttrib(e,n,""+r)}))}},O=(e,t,o)=>{T(e,"width",t),T(e,"height",o)},A=e=>{let n,r,d,C,k;n=e.screenX-m,r=e.screenY-u,v=n*c[2]+g,b=r*c[3]+h,v=v<5?5:v,b=b<5?5:b,d=(x(a)||S(a))&&!1!==Rc(t)?!Vg.modifierPressed(e):Vg.modifierPressed(e),d&&(Ug(n)>Ug(r)?(b=jg(v*p),v=jg(b/p)):(v=jg(b/p),b=jg(v*p))),O(i,v,b),C=c.startPos.x+n,k=c.startPos.y+r,C=C>0?C:0,k=k>0?k:0,o.setStyles(l,{left:C,top:k,display:"block"}),l.innerHTML=v+" × "+b,c[2]<0&&i.clientWidth<=v&&o.setStyle(i,"left",void 0+(g-v)),c[3]<0&&i.clientHeight<=b&&o.setStyle(i,"top",void 0+(h-b)),n=s.scrollWidth-y,r=s.scrollHeight-w,n+r!==0&&o.setStyles(l,{left:C-n,top:k-r}),f||(((e,t,o,n,r)=>{e.dispatch("ObjectResizeStart",{target:t,width:o,height:n,origin:r})})(t,a,g,h,"corner-"+c.name),f=!0)},D=()=>{const e=f;f=!1,e&&(T(a,"width",v),T(a,"height",b)),o.unbind(n,"mousemove",A),o.unbind(n,"mouseup",D),r!==n&&(o.unbind(r,"mousemove",A),o.unbind(r,"mouseup",D)),o.remove(i),o.remove(l),o.remove(d),M(a),e&&(((e,t,o,n,r)=>{e.dispatch("ObjectResized",{target:t,width:o,height:n,origin:r})})(t,a,v,b,"corner-"+c.name),o.setAttrib(a,"style",o.getAttrib(a,"style"))),t.nodeChanged()},M=e=>{H();const f=o.getPos(e,s),x=f.x,C=f.y,k=e.getBoundingClientRect(),T=k.width||k.right-k.left,M=k.height||k.bottom-k.top;a!==e&&(R(),a=e,v=b=0);const N=t.dispatch("ObjectSelected",{target:e});E(e)&&!N.isDefaultPrevented()?ve(Wg,((e,t)=>{const f=f=>{const v=_(a)[0];m=f.screenX,u=f.screenY,g=v.clientWidth,h=v.clientHeight,p=h/g,c=e,c.name=t,c.startPos={x:T*e[0]+x,y:M*e[1]+C},y=s.scrollWidth,w=s.scrollHeight,d=o.add(s,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),o.setStyles(d,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),i=((e,t)=>{if(S(t))return e.create("img",{src:Mt.transparentSrc});if(sr(t)){const o=We(c.name,"n")?de:me,n=t.cloneNode(!0);return o(e.select("tr",n)).each((t=>{const o=e.select("td,th",t);e.setStyle(t,"height",null),q(o,(t=>e.setStyle(t,"height",null)))})),n}return t.cloneNode(!0)})(o,a),o.addClass(i,"mce-clonedresizable"),o.setAttrib(i,"data-mce-bogus","all"),i.contentEditable="false",o.setStyles(i,{left:x,top:C,margin:0}),O(i,T,M),i.removeAttribute(Zg),s.appendChild(i),o.bind(n,"mousemove",A),o.bind(n,"mouseup",D),r!==n&&(o.bind(r,"mousemove",A),o.bind(r,"mouseup",D)),l=o.add(s,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},g+" × "+h)};let v=o.get("mceResizeHandle"+t);v&&o.remove(v),v=o.add(s,"div",{id:"mceResizeHandle"+t,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+t+"-resize; margin:0; padding:0"}),o.bind(v,"mousedown",(e=>{e.stopImmediatePropagation(),e.preventDefault(),f(e)})),e.elm=v,o.setStyles(v,{left:T*e[0]+x-v.offsetWidth/2,top:M*e[1]+C-v.offsetHeight/2})})):R(!1)},N=Ta(M,0),R=(e=!0)=>{N.cancel(),H(),a&&e&&a.removeAttribute(Zg),ve(Wg,((e,t)=>{const n=o.get("mceResizeHandle"+t);n&&(o.unbind(n),o.remove(n))}))},B=(e,t)=>o.isChildOf(e,t),L=n=>{if(f||t.removed||t.composing)return;const r="mousedown"===n.type?n.target:e.getNode(),a=tn(wo.fromDom(r),"table,img,figure.image,hr,video,span.mce-preview-object,details").map((e=>e.dom)).filter((e=>o.isEditable(e.parentElement)||"IMG"===e.nodeName&&o.isEditable(e))).getOrUndefined(),i=C(a)?o.getAttrib(a,Zg,"1"):"1";if(q(o.select(`img[${Zg}],hr[${Zg}]`),(e=>{e.removeAttribute(Zg)})),C(a)&&B(a,s)&&t.hasFocus()){I();const t=e.getStart(!0);if(B(t,a)&&B(e.getEnd(!0),a))return o.setAttrib(a,Zg,i),void N.throttle(a)}R()},H=()=>{ve(Wg,(e=>{e.elm&&(o.unbind(e.elm),delete e.elm)}))},I=()=>{try{t.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(e){}};return t.on("init",(()=>{I(),t.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",L),t.on("keyup compositionend",(e=>{a&&"TABLE"===a.nodeName&&L(e)})),t.on("hide blur",R),t.on("contextmenu longpress",k,!0)})),t.on("remove",H),{isResizable:E,showResizeRect:M,hideResizeRect:R,updateResizeRect:L,destroy:()=>{N.cancel(),a=i=d=null}}},qg=(e,t,o)=>{const n=e.document.createRange();var r;return r=n,t.fold((e=>{r.setStartBefore(e.dom)}),((e,t)=>{r.setStart(e.dom,t)}),(e=>{r.setStartAfter(e.dom)})),((e,t)=>{t.fold((t=>{e.setEndBefore(t.dom)}),((t,o)=>{e.setEnd(t.dom,o)}),(t=>{e.setEndAfter(t.dom)}))})(n,o),n},Gg=(e,t,o,n,r)=>{const s=e.document.createRange();return s.setStart(t.dom,o),s.setEnd(n.dom,r),s},Kg=Il([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Yg=(e,t,o)=>t(wo.fromDom(o.startContainer),o.startOffset,wo.fromDom(o.endContainer),o.endOffset),Xg=(e,t)=>{const o=((e,t)=>t.match({domRange:e=>({ltr:A(e),rtl:F.none}),relative:(t,o)=>({ltr:Ie((()=>qg(e,t,o))),rtl:Ie((()=>F.some(qg(e,o,t))))}),exact:(t,o,n,r)=>({ltr:Ie((()=>Gg(e,t,o,n,r))),rtl:Ie((()=>F.some(Gg(e,n,r,t,o))))})}))(e,t);return((e,t)=>{const o=t.ltr();return o.collapsed?t.rtl().filter((e=>!1===e.collapsed)).map((e=>Kg.rtl(wo.fromDom(e.endContainer),e.endOffset,wo.fromDom(e.startContainer),e.startOffset))).getOrThunk((()=>Yg(0,Kg.ltr,o))):Yg(0,Kg.ltr,o)})(0,o)};Kg.ltr,Kg.rtl;const Jg=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n}),Qg=(e,t,o)=>e.caretPositionFromPoint?((e,t,o)=>{var n;return F.from(null===(n=e.caretPositionFromPoint)||void 0===n?void 0:n.call(e,t,o)).bind((t=>{if(null===t.offsetNode)return F.none();const o=e.createRange();return o.setStart(t.offsetNode,t.offset),o.collapse(),F.some(o)}))})(e,t,o):e.caretRangeFromPoint?((e,t,o)=>{var n;return F.from(null===(n=e.caretRangeFromPoint)||void 0===n?void 0:n.call(e,t,o))})(e,t,o):F.none(),eh=Il([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),th={before:eh.before,on:eh.on,after:eh.after,cata:(e,t,o,n)=>e.fold(t,o,n),getStart:e=>e.fold(D,D,D)},oh=Il([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),nh={domRange:oh.domRange,relative:oh.relative,exact:oh.exact,exactFromRange:e=>oh.exact(e.start,e.soffset,e.finish,e.foffset),getWin:e=>{const t=(e=>e.match({domRange:e=>wo.fromDom(e.startContainer),relative:(e,t)=>th.getStart(e),exact:(e,t,o,n)=>e}))(e);return Oo(t)},range:Jg},rh=(e,t)=>{const o=Wt(e);return"input"===o?th.after(e):j(["br","img"],o)?0===t?th.before(e):th.after(e):th.on(e,t)},sh=(e,t)=>{const o=e.fold(th.before,rh,th.after),n=t.fold(th.before,rh,th.after);return nh.relative(o,n)},ah=(e,t,o,n)=>{const r=rh(e,t),s=rh(o,n);return nh.relative(r,s)},ih=(e,t)=>{const o=document.createDocumentFragment();return q(e,(e=>{o.appendChild(e.dom)})),wo.fromDom(o)},lh=e=>{const t=nh.getWin(e).dom,o=(e,o,n,r)=>Gg(t,e,o,n,r),n=(e=>e.match({domRange:e=>{const t=wo.fromDom(e.startContainer),o=wo.fromDom(e.endContainer);return ah(t,e.startOffset,o,e.endOffset)},relative:sh,exact:ah}))(e);return Xg(t,n).match({ltr:o,rtl:o})},ch=(e,t,o)=>((e,t,o)=>{const n=e.document;return Qg(n,t,o).map((e=>Jg(wo.fromDom(e.startContainer),e.startOffset,wo.fromDom(e.endContainer),e.endOffset)))})(e,t,o),dh=(e,t,o)=>{const n=Oo(wo.fromDom(o));return ch(n.dom,e,t).map((e=>{const t=o.createRange();return t.setStart(e.start.dom,e.soffset),t.setEnd(e.finish.dom,e.foffset),t})).getOrUndefined()},mh=(e,t)=>C(e)&&C(t)&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset,uh=(e,t,o)=>null!==((e,t,o)=>{let n=e;for(;n&&n!==t;){if(o(n))return n;n=n.parentNode}return null})(e,t,o),gh=(e,t,o)=>uh(e,t,(e=>e.nodeName===o)),hh=(e,t)=>vi(e)&&!uh(e,t,lu),ph=(e,t,o)=>{const n=t.parentNode;if(n){const r=new Un(t,e.getParent(n,e.isBlock)||e.getRoot());let s;for(;s=r[o?"prev":"next"]();)if(hr(s))return!0}return!1},fh=(e,t,o,n,r)=>{const s=e.getRoot(),a=e.schema.getNonEmptyElements(),i=r.parentNode;let l,c;if(!i)return F.none();const d=e.getParent(i,e.isBlock)||s;if(n&&hr(r)&&t&&e.isEmpty(d))return F.some(ml(i,e.nodeIndex(r)));const m=new Un(r,d);for(;c=m[n?"prev":"next"]();){if("false"===e.getContentEditableParent(c)||hh(c,s))return F.none();if(lr(c)&&c.data.length>0)return gh(c,s,"A")?F.none():F.some(ml(c,n?c.data.length:0));if(e.isBlock(c)||a[c.nodeName.toLowerCase()])return F.none();l=c}return mr(l)?F.none():o&&l?F.some(ml(l,0)):F.none()},vh=(e,t,o,n)=>{const r=e.getRoot();let s,a=!1,i=o?n.startContainer:n.endContainer,l=o?n.startOffset:n.endOffset;const c=Qn(i)&&l===i.childNodes.length,d=e.schema.getNonEmptyElements();let m=o;if(vi(i))return F.none();if(Qn(i)&&l>i.childNodes.length-1&&(m=!1),ur(i)&&(i=r,l=0),i===r){if(m&&(s=i.childNodes[l>0?l-1:0],s)){if(vi(s))return F.none();if(d[s.nodeName]||sr(s))return F.none()}if(i.hasChildNodes()){if(l=Math.min(!m&&l>0?l-1:l,i.childNodes.length-1),i=i.childNodes[l],l=lr(i)&&c?i.data.length:0,!t&&i===r.lastChild&&sr(i))return F.none();if(((e,t)=>{let o=t;for(;o&&o!==e;){if(vr(o))return!0;o=o.parentNode}return!1})(r,i)||vi(i))return F.none();if(Cr(i))return F.none();if(i.hasChildNodes()&&!sr(i)){s=i;const t=new Un(i,r);do{if(vr(s)||vi(s)){a=!1;break}if(lr(s)&&s.data.length>0){l=m?0:s.data.length,i=s,a=!0;break}if(d[s.nodeName.toLowerCase()]&&!yr(s)){l=e.nodeIndex(s),i=s.parentNode,m||l++,a=!0;break}}while(s=m?t.next():t.prev())}}}return t&&(lr(i)&&0===l&&fh(e,c,t,!0,i).each((e=>{i=e.container(),l=e.offset(),a=!0})),Qn(i)&&(s=i.childNodes[l],s||(s=i.childNodes[l-1]),!s||!hr(s)||((e,t)=>{var o;return(null===(o=e.previousSibling)||void 0===o?void 0:o.nodeName)===t})(s,"A")||ph(e,s,!1)||ph(e,s,!0)||fh(e,c,t,!0,s).each((e=>{i=e.container(),l=e.offset(),a=!0})))),m&&!t&&lr(i)&&l===i.data.length&&fh(e,c,t,!1,i).each((e=>{i=e.container(),l=e.offset(),a=!0})),a&&i?F.some(ml(i,l)):F.none()},bh=(e,t)=>{const o=t.collapsed,n=t.cloneRange(),r=ml.fromRangeStart(t);return vh(e,o,!0,n).each((e=>{o&&ml.isAbove(r,e)||n.setStart(e.container(),e.offset())})),o||vh(e,o,!1,n).each((e=>{n.setEnd(e.container(),e.offset())})),o&&n.collapse(!0),mh(t,n)?F.none():F.some(n)},yh=(e,t)=>e.splitText(t),wh=e=>{let t=e.startContainer,o=e.startOffset,n=e.endContainer,r=e.endOffset;if(t===n&&lr(t)){if(o>0&&oo){r-=o;const e=yh(n,r).previousSibling;t=n=e,r=e.data.length,o=0}else r=0}else if(lr(t)&&o>0&&o0&&r({walk:(t,o)=>Sg(e,t,o),split:wh,expand:(t,o={type:"word"})=>{if("word"===o.type){const o=Cg(e,t,[{inline:"span"}]),n=e.createRng();return n.setStart(o.startContainer,o.startOffset),n.setEnd(o.endContainer,o.endOffset),n}return t},normalize:t=>bh(e,t).fold(I,(e=>(t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0)))});xh.compareRanges=mh,xh.getCaretRangeFromPoint=dh,xh.getSelectedNode=Ni,xh.getNode=Ri;const Ch=((e,t)=>{const o=o=>{const n=t(o);if(n<=0||null===n){const t=cn(o,e);return parseFloat(t)||0}return n},n=(e,t)=>J(t,((t,o)=>{const n=cn(e,o),r=void 0===n?0:parseInt(n,10);return isNaN(r)?t:t+r}),0);return{set:(t,o)=>{if(!k(o)&&!o.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+o);const n=t.dom;rn(n)&&(n.style[e]=o+"px")},get:o,getOuter:o,aggregate:n,max:(e,t,o)=>{const r=n(e,o);return t>r?t-r:0}}})("height",(e=>{const t=e.dom;return qo(e)?t.getBoundingClientRect().height:t.offsetHeight})),Sh=()=>wo.fromDom(document),kh=(e,t)=>e.view(t).fold(A([]),(t=>{const o=e.owner(t),n=kh(e,o);return[t].concat(n)}));var _h=Object.freeze({__proto__:null,view:e=>{var t;return(e.dom===document?F.none():F.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(wo.fromDom)},owner:e=>To(e)});const Eh=e=>{const t=Sh(),o=Rn(t),n=((e,t)=>{const o=t.owner(e);return kh(t,o)})(e,_h),r=Nn(e),s=X(n,((e,t)=>{const o=Nn(t);return{left:e.left+o.left,top:e.top+o.top}}),{left:0,top:0});return Dn(s.left+r.left+o.left,s.top+r.top+o.top)},Th=e=>"textarea"===Wt(e),Oh=(e,t)=>{const o=(e=>{const t=e.dom.ownerDocument,o=t.body,n=t.defaultView,r=t.documentElement;if(o===e.dom)return Dn(o.offsetLeft,o.offsetTop);const s=Mn(null==n?void 0:n.pageYOffset,r.scrollTop),a=Mn(null==n?void 0:n.pageXOffset,r.scrollLeft),i=Mn(r.clientTop,o.clientTop),l=Mn(r.clientLeft,o.clientLeft);return Nn(e).translate(a-l,s-i)})(e),n=(e=>Ch.get(e))(e);return{element:e,bottom:o.top+n,height:n,pos:o,cleanup:t}},Ah=(e,t)=>{const o=((e,t)=>{const o=Ho(e);if(0===o.length||Th(e))return{element:e,offset:t};if(t\ufeff
    ');return hn(o.element,n),Oh(n,(()=>xn(n)))},Dh=(e,t,o,n)=>{Bh(e,((r,s)=>Nh(e,t,o,n)),o)},Mh=(e,t,o,n,r)=>{const s={elm:n.element.dom,alignToTop:r};((e,t)=>e.dispatch("ScrollIntoView",t).isDefaultPrevented())(e,s)||(o(e,t,Rn(t).top,n,r),((e,t)=>{e.dispatch("AfterScrollIntoView",t)})(e,s))},Nh=(e,t,o,n)=>{const r=wo.fromDom(e.getBody()),s=wo.fromDom(e.getDoc());r.dom.offsetWidth;const a=Ah(wo.fromDom(o.startContainer),o.startOffset);Mh(e,s,t,a,n),a.cleanup()},Rh=(e,t,o,n)=>{const r=wo.fromDom(e.getDoc());Mh(e,r,o,(e=>Oh(wo.fromDom(e),E))(t),n)},Bh=(e,t,o)=>{const n=o.startContainer,r=o.startOffset,s=o.endContainer,a=o.endOffset;t(wo.fromDom(n),wo.fromDom(s));const i=e.dom.createRng();i.setStart(n,r),i.setEnd(s,a),e.selection.setRng(o)},Lh=(e,t,o,n,r)=>{const s=t.pos;if(n)Bn(s.left,s.top,r);else{const n=s.top-o+t.height;Bn(-e.getBody().getBoundingClientRect().left,n,r)}},Hh=(e,t,o,n,r,s)=>{const a=n+o,i=r.pos.top,l=r.bottom,c=l-i>=n;ia?Lh(e,r,n,c?!1!==s:!0===s,t):l>a&&!c&&Lh(e,r,n,!0===s,t)},Ih=(e,t,o,n,r)=>{const s=Oo(t).dom.innerHeight;Hh(e,t,o,s,n,r)},Ph=(e,t,o,n,r)=>{const s=Oo(t).dom.innerHeight;Hh(e,t,o,s,n,r);const a=Eh(n.element),i=In(window);a.topi.bottom&&Ln(n.element,!0===r)},Fh=(e,t,o)=>Dh(e,Ih,t,o),zh=(e,t,o)=>Rh(e,t,Ih,o),Vh=(e,t,o)=>Dh(e,Ph,t,o),Zh=(e,t,o)=>Rh(e,t,Ph,o),Uh=(e,t,o)=>{(e.inline?Fh:Vh)(e,t,o)},jh=(e,t=!1)=>e.dom.focus({preventScroll:t}),Wh=e=>{const t=Zo(e).dom;return e.dom===t.activeElement},$h=(e=Sh())=>F.from(e.dom.activeElement).map(wo.fromDom),qh=(e,t)=>{const o=Yt(t)?Xa(t).length:Ho(t).length+1;return e>o?o:e<0?0:e},Gh=e=>nh.range(e.start,qh(e.soffset,e.start),e.finish,qh(e.foffset,e.finish)),Kh=(e,t)=>!Jn(t.dom)&&(_o(e,t)||ko(e,t)),Yh=e=>t=>Kh(e,t.start)&&Kh(e,t.finish),Xh=e=>nh.range(wo.fromDom(e.startContainer),e.startOffset,wo.fromDom(e.endContainer),e.endOffset),Jh=e=>(e=>{const t=e.getSelection();return(t&&0!==t.rangeCount?F.from(t.getRangeAt(0)):F.none()).map(Xh)})(Oo(e).dom).filter(Yh(e)),Qh=e=>{const t=document.createRange();try{return t.setStart(e.start.dom,e.soffset),t.setEnd(e.finish.dom,e.foffset),F.some(t)}catch(e){return F.none()}},ep=e=>{const t=(e=>e.inline||Mt.browser.isFirefox())(e)?Jh(wo.fromDom(e.getBody())):F.none();e.bookmark=t.isSome()?t:e.bookmark},tp=e=>(e.bookmark?e.bookmark:F.none()).bind((t=>((e,t)=>F.from(t).filter(Yh(e)).map(Gh))(wo.fromDom(e.getBody()),t))).bind(Qh),op={isEditorUIElement:e=>{const t=e.className.toString();return-1!==t.indexOf("tox-")||-1!==t.indexOf("mce-")}},np={setEditorTimeout:(e,t,o)=>((e,t)=>(k(t)||(t=0),setTimeout(e,t)))((()=>{e.removed||t()}),o),setEditorInterval:(e,t,o)=>{const n=((e,t)=>(k(t)||(t=0),setInterval(e,t)))((()=>{e.removed?clearInterval(n):t()}),o);return n}},rp=e=>{const t=Ta((()=>{ep(e)}),0);e.on("init",(()=>{e.inline&&((e,t)=>{const o=()=>{t.throttle()};ya.DOM.bind(document,"mouseup",o),e.on("remove",(()=>{ya.DOM.unbind(document,"mouseup",o)}))})(e,t),((e,t)=>{((e,t)=>{e.on("mouseup touchend",(e=>{t.throttle()}))})(e,t),e.on("keyup NodeChange AfterSetSelectionRange",(t=>{(e=>"nodechange"===e.type&&e.selectionChange)(t)||ep(e)}))})(e,t)})),e.on("remove",(()=>{t.cancel()}))};let sp;const ap=ya.DOM,ip=e=>{const t=e.classList;return void 0!==t&&(t.contains("tox-edit-area")||t.contains("tox-edit-area__iframe")||t.contains("mce-content-body"))},lp=(e,t)=>{const o=$c(e),n=ap.getParent(t,(t=>(e=>Qn(e)&&op.isEditorUIElement(e))(t)||!!o&&e.dom.is(t,o)));return null!==n},cp=e=>{try{const t=Zo(wo.fromDom(e.getElement()));return $h(t).fold((()=>document.body),(e=>e.dom))}catch(e){return document.body}},dp=(e,t)=>{const o=t.editor;rp(o);const n=(e,t)=>{Bd(e)&&!0!==e.inline&&t(wo.fromDom(e.getContainer()),"tox-edit-focus")};o.on("focusin",(()=>{const t=e.focusedEditor;ip(cp(o))&&n(o,ho),t!==o&&(t&&t.dispatch("blur",{focusedEditor:o}),e.setActive(o),e.focusedEditor=o,o.dispatch("focus",{blurredEditor:t}),o.focus(!0))})),o.on("focusout",(()=>{np.setEditorTimeout(o,(()=>{const t=e.focusedEditor;ip(cp(o))&&t===o||n(o,fo),lp(o,cp(o))||t!==o||(o.dispatch("blur",{focusedEditor:null}),e.focusedEditor=null)}))})),sp||(sp=t=>{const o=e.activeEditor;o&&Wo(t).each((t=>{const n=t;n.ownerDocument===document&&(n===document.body||lp(o,n)||e.focusedEditor!==o||(o.dispatch("blur",{focusedEditor:null}),e.focusedEditor=null))}))},ap.bind(document,"focusin",sp))},mp=(e,t)=>{e.focusedEditor===t.editor&&(e.focusedEditor=null),!e.activeEditor&&sp&&(ap.unbind(document,"focusin",sp),sp=null)},up=(e,t)=>(e=>e.collapsed?F.from(Ri(e.startContainer,e.startOffset)).map(wo.fromDom):F.none())(t).bind((t=>ri(t)?F.some(t):_o(e,t)?F.none():F.some(e))),gp=(e,t)=>{up(wo.fromDom(e.getBody()),t).bind((e=>su(e.dom))).fold((()=>{e.selection.normalize()}),(t=>e.selection.setRng(t.toRange())))},hp=e=>{if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},pp=e=>{return Wh(e)||(t=e,$h(Zo(t)).filter((e=>t.dom.contains(e.dom)))).isSome();var t},fp=e=>e.inline?(e=>{const t=e.getBody();return t&&pp(wo.fromDom(t))})(e):(e=>C(e.iframeElement)&&Wh(wo.fromDom(e.iframeElement)))(e),vp=e=>fp(e)||(e=>{const t=Zo(wo.fromDom(e.getElement()));return $h(t).filter((t=>!ip(t.dom)&&lp(e,t.dom))).isSome()})(e),bp=e=>e.editorManager.setActive(e),yp=(e,t)=>{e.removed||(t?bp(e):(e=>{const t=e.selection,o=e.getBody();let n=t.getRng();e.quirks.refreshContentEditable();const r=e=>{tp(e).each((t=>{e.selection.setRng(t),n=t}))};!fp(e)&&e.hasEditableRoot()&&r(e);const s=((e,t)=>e.dom.getParent(t,(t=>"true"===e.dom.getContentEditable(t))))(e,t.getNode());if(s&&e.dom.isChildOf(s,o))return((e,t)=>null!==e.dom.getParent(t,(t=>"false"===e.dom.getContentEditable(t))))(e,s)||hp(o),hp(s),e.hasEditableRoot()||r(e),gp(e,n),void bp(e);e.inline||(Mt.browser.isOpera()||hp(o),e.getWin().focus()),(Mt.browser.isFirefox()||e.inline)&&(hp(o),gp(e,n)),bp(e)})(e))},wp=(e,t)=>t.collapsed?e.isEditable(t.startContainer):e.isEditable(t.startContainer)&&e.isEditable(t.endContainer),xp=(e,t,o,n,r)=>{const s=o?t.startContainer:t.endContainer,a=o?t.startOffset:t.endOffset;return F.from(s).map(wo.fromDom).map((e=>n&&t.collapsed?e:Io(e,r(e,a)).getOr(e))).bind((e=>Kt(e)?F.some(e):Ao(e).filter(Kt))).map((e=>e.dom)).getOr(e)},Cp=(e,t,o=!1)=>xp(e,t,!0,o,((e,t)=>Math.min(zo(e),t))),Sp=(e,t,o=!1)=>xp(e,t,!1,o,((e,t)=>t>0?t-1:t)),kp=(e,t)=>{const o=e;for(;e&&lr(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||o},_p=(e,t)=>$(t,(t=>{const o=e.dispatch("GetSelectionRange",{range:t});return o.range!==t?o.range:t})),Ep={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Tp=(e,t,o)=>{const n=o?"lastChild":"firstChild",r=o?"prev":"next";if(e[n])return e[n];if(e!==t){let o=e[r];if(o)return o;for(let n=e.parent;n&&n!==t;n=n.parent)if(o=n[r],o)return o}},Op=e=>{var t;const o=null!==(t=e.value)&&void 0!==t?t:"";if(!Gn(o))return!1;const n=e.parent;return!n||"span"===n.name&&!n.attr("style")||!/^[ ]+$/.test(o)},Ap=e=>{const t="a"===e.name&&!e.attr("href")&&e.attr("id");return e.attr("name")||e.attr("id")&&!e.firstChild||e.attr("data-mce-bookmark")||t};class Dp{static create(e,t){const o=new Dp(e,Ep[e]||1);return t&&ve(t,((e,t)=>{o.attr(t,e)})),o}constructor(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}replace(e){const t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t}attr(e,t){const o=this;if(!h(e))return C(e)&&ve(e,((e,t)=>{o.attr(t,e)})),o;const n=o.attributes;if(n){if(void 0!==t){if(null===t){if(e in n.map){delete n.map[e];let t=n.length;for(;t--;)if(n[t].name===e)return n.splice(t,1),o}return o}if(e in n.map){let o=n.length;for(;o--;)if(n[o].name===e){n[o].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,o}return n.map[e]}}clone(){const e=this,t=new Dp(e.name,e.type),o=e.attributes;if(o){const e=[];e.map={};for(let t=0,n=o.length;th(e.nodeValue)&&e.nodeValue.includes(di),Rp=e=>(0===e.length?"":`${$(e,(e=>`[${e}]`)).join(",")},`)+'[data-mce-bogus="all"]',Bp=e=>document.createTreeWalker(e,NodeFilter.SHOW_COMMENT,(e=>Np(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP)),Lp=e=>document.createTreeWalker(e,NodeFilter.SHOW_TEXT,(e=>{if(Np(e)){const t=e.parentNode;return t&&Ee(Mp,t.nodeName)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}return NodeFilter.FILTER_SKIP})),Hp=e=>null!==Bp(e).nextNode(),Ip=e=>null!==Lp(e).nextNode(),Pp=(e,t)=>null!==t.querySelector(Rp(e)),Fp=(e,t)=>{q(((e,t)=>t.querySelectorAll(Rp(e)))(e,t),(t=>{const o=wo.fromDom(t);"all"===no(o,"data-mce-bogus")?xn(o):q(e,(e=>{so(o,e)&&ao(o,e)}))}))},zp=e=>{let t=e.nextNode();for(;null!==t;)t.nodeValue=null,t=e.nextNode()},Vp=T(zp,Bp),Zp=T(zp,Lp),Up=(e,t)=>{const o=[{condition:N(Pp,t),action:N(Fp,t)},{condition:Hp,action:Vp},{condition:Ip,action:Zp}];let n=e,r=!1;return q(o,(({condition:t,action:o})=>{t(n)&&(r||(n=e.cloneNode(!0),r=!0),o(n))})),n},jp=e=>{const t=Fn(e,"[data-mce-bogus]");q(t,(e=>{"all"===no(e,"data-mce-bogus")?xn(e):ei(e)?(hn(e,wo.fromText(jn)),xn(e)):Cn(e)}))},Wp=e=>{const t=Fn(e,"input");q(t,(e=>{ao(e,"name")}))},$p=(e,t)=>{const o=e.getDoc(),n=Zo(wo.fromDom(e.getBody())),r=wo.fromTag("div",o);to(r,"data-mce-bogus","all"),ln(r,{position:"fixed",left:"-9999999px",top:"0"}),_n(r,t.innerHTML),jp(r),Wp(r);const s=(e=>Vo(e)?e:wo.fromDom(To(e).dom.body))(n);vn(s,r);const a=ui(r.dom.innerText);return xn(r),a},qp=(e,t,o)=>{let n;return n="raw"===t.format?Lt.trim(ui(Up(o,e.serializer.getTempAttrs()).innerHTML)):"text"===t.format?$p(e,o):"tree"===t.format?e.serializer.serialize(o,t):((e,t)=>{const o=sc(e),n=new RegExp(`^(<${o}[^>]*>( | |\\s| |
    |)<\\/${o}>[\r\n]*|
    [\r\n]*)$`);return t.replace(n,"")})(e,e.serializer.serialize(o,t)),"text"!==t.format&&!ai(wo.fromDom(o))&&h(n)?Lt.trim(n):n},Gp=Lt.makeMap,Kp=e=>{const t=[],o=(e=e||{}).indent,n=Gp(e.indent_before||""),r=Gp(e.indent_after||""),s=ks.getEncodeFunc(e.entity_encoding||"raw",e.entities),a="xhtml"!==e.element_format;return{start:(e,i,l)=>{if(o&&n[e]&&t.length>0){const e=t[t.length-1];e.length>0&&"\n"!==e&&t.push("\n")}if(t.push("<",e),i)for(let e=0,o=i.length;e":" />",l&&o&&r[e]&&t.length>0){const e=t[t.length-1];e.length>0&&"\n"!==e&&t.push("\n")}},end:e=>{let n;t.push(""),o&&r[e]&&t.length>0&&(n=t[t.length-1],n.length>0&&"\n"!==n&&t.push("\n"))},text:(e,o)=>{e.length>0&&(t[t.length]=o?e:s(e))},cdata:e=>{t.push("")},comment:e=>{t.push("\x3c!--",e,"--\x3e")},pi:(e,n)=>{n?t.push(""):t.push(""),o&&t.push("\n")},doctype:e=>{t.push("",o?"\n":"")},reset:()=>{t.length=0},getContent:()=>t.join("").replace(/\n$/,"")}},Yp=(e={},t=Us())=>{const o=Kp(e);return e.validate=!("validate"in e)||e.validate,{serialize:n=>{const r=e.validate,s={3:e=>{var t;o.text(null!==(t=e.value)&&void 0!==t?t:"",e.raw)},8:e=>{var t;o.comment(null!==(t=e.value)&&void 0!==t?t:"")},7:e=>{o.pi(e.name,e.value)},10:e=>{var t;o.doctype(null!==(t=e.value)&&void 0!==t?t:"")},4:e=>{var t;o.cdata(null!==(t=e.value)&&void 0!==t?t:"")},11:e=>{let t=e;if(t=t.firstChild)do{a(t)}while(t=t.next)}};o.reset();const a=e=>{var n;const i=s[e.type];if(i)i(e);else{const s=e.name,i=s in t.getVoidElements();let l=e.attributes;if(r&&l&&l.length>1){const o=[];o.map={};const n=t.getElementRule(e.name);if(n){for(let e=0,t=n.attributesOrder.length;e{Xp.add(e)}));const Jp=new Set;q(["background-color"],(e=>{Jp.add(e)}));const Qp=["font","text-decoration","text-emphasis"],ef=(e,t)=>pe(((e,t)=>e.parseStyle(e.getAttrib(t,"style")))(e,t)),tf=(e,t)=>W(ef(e,t),(e=>(e=>Xp.has(e))(e))),of=(e,t)=>tf(e,t)&&W(ef(e,t),(e=>(e=>Jp.has(e))(e))),nf=(e,t,o)=>{const n=ef(e,t),r=ef(e,o),s=n=>{var r,s;const a=null!==(r=e.getStyle(t,n))&&void 0!==r?r:"",i=null!==(s=e.getStyle(o,n))&&void 0!==s?s:"";return Xe(a)&&Xe(i)&&a!==i};return W(n,(e=>{const t=t=>W(t,(t=>t===e));if(!t(r)&&t(Qp)){const e=Y(r,(e=>W(Qp,(t=>We(e,t)))));return W(e,s)}return s(e)}))},rf=(e,t,o)=>F.from(o.container()).filter(lr).exists((n=>{const r=e?0:-1;return t(n.data.charAt(o.offset()+r))})),sf=N(rf,!0,_u),af=N(rf,!1,_u),lf=e=>{const t=e.container();return lr(t)&&(0===t.data.length||mi(t.data)&&Ng.isBookmarkNode(t.parentNode))},cf=(e,t)=>o=>_m(e?0:-1,o).filter(t).isSome(),df=e=>pr(e)&&"block"===cn(wo.fromDom(e),"display"),mf=e=>vr(e)&&!(e=>Qn(e)&&"all"===e.getAttribute("data-mce-bogus"))(e),uf=cf(!0,df),gf=cf(!1,df),hf=cf(!0,wr),pf=cf(!1,wr),ff=cf(!0,sr),vf=cf(!1,sr),bf=cf(!0,mf),yf=cf(!1,mf),wf=(e,t)=>((e,t,o)=>_o(t,e)?Mo(e,(e=>o(e)||ko(e,t))).slice(0,-1):[])(e,t,I),xf=(e,t)=>[e].concat(wf(e,t)),Cf=(e,t,o)=>tu(e,t,o,lf),Sf=(e,t,o)=>ee(xf(wo.fromDom(t.container()),e),(e=>t=>e.isBlock(Wt(t)))(o)),kf=(e,t,o,n)=>Cf(e,t.dom,o).forall((e=>Sf(t,o,n).fold((()=>!km(e,o,t.dom)),(n=>!km(e,o,t.dom)&&_o(n,wo.fromDom(e.container())))))),_f=(e,t,o,n)=>Sf(t,o,n).fold((()=>Cf(e,t.dom,o).forall((e=>!km(e,o,t.dom)))),(t=>Cf(e,t.dom,o).isNone())),Ef=N(_f,!1),Tf=N(_f,!0),Of=N(kf,!1),Af=N(kf,!0),Df=e=>Bm(e).exists(ei),Mf=(e,t,o,n)=>{const r=Y(xf(wo.fromDom(o.container()),t),(e=>n.isBlock(Wt(e)))),s=de(r).getOr(t);return Qm(e,s.dom,o).filter(Df)},Nf=(e,t,o)=>Bm(t).exists(ei)||Mf(!0,e,t,o).isSome(),Rf=(e,t,o)=>(e=>F.from(e.getNode(!0)).map(wo.fromDom))(t).exists(ei)||Mf(!1,e,t,o).isSome(),Bf=N(Mf,!1),Lf=N(Mf,!0),Hf=e=>ml.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd(),If=(e,t,o)=>{const n=Y(xf(wo.fromDom(t.container()),e),(e=>o.isBlock(Wt(e))));return de(n).getOr(e)},Pf=(e,t,o)=>Hf(t)?af(t):af(t)||ru(If(e,t,o).dom,t).exists(af),Ff=(e,t,o)=>Hf(t)?sf(t):sf(t)||nu(If(e,t,o).dom,t).exists(sf),zf=e=>Bm(e).bind((e=>Yo(e,Kt))).exists((e=>(e=>j(["pre","pre-wrap"],e))(cn(e,"white-space")))),Vf=(e,t,o)=>((e,t)=>ru(e.dom,t).isNone())(e,t)||((e,t)=>nu(e.dom,t).isNone())(e,t)||Ef(e,t,o)||Tf(e,t,o)||Rf(e,t,o)||Nf(e,t,o),Zf=(e,t)=>o=>{return n=new Un(o,e)[t](),C(n)&&vr(n)&&gm(n);var n},Uf=(e,t,o)=>!zf(t)&&(Vf(e,t,o)||Pf(e,t,o)||Ff(e,t,o)),jf=(e,t,o)=>!zf(t)&&(Ef(e,t,o)||Of(e,t,o)||Rf(e,t,o)||Pf(e,t,o)||((e,t)=>{const o=ru(e.dom,t).getOr(t),n=Zf(e.dom,"prev");return t.isAtStart()&&(n(t.container())||n(o.container()))})(e,t)),Wf=(e,t,o)=>!zf(t)&&(Tf(e,t,o)||Af(e,t,o)||Nf(e,t,o)||Ff(e,t,o)||((e,t)=>{const o=nu(e.dom,t).getOr(t),n=Zf(e.dom,"next");return t.isAtEnd()&&(n(t.container())||n(o.container()))})(e,t)),$f=(e,t,o)=>jf(e,t,o)||Wf(e,(e=>{const t=e.container(),o=e.offset();return lr(t)&&oSu(e.charAt(t)),Gf=(e,t)=>_u(e.charAt(t)),Kf=(e,t,o,n)=>{const r=t.data,s=ml(t,0);return o||!qf(r,0)||$f(e,s,n)?!!(o&&Gf(r,0)&&jf(e,s,n))&&(t.data=Wn+r.slice(1),!0):(t.data=" "+r.slice(1),!0)},Yf=e=>{const t=e.data,o=(e=>{const t=e.split("");return $(t,((e,o)=>Su(e)&&o>0&&o{const r=t.data,s=ml(t,r.length-1);return o||!qf(r,r.length-1)||$f(e,s,n)?!!(o&&Gf(r,r.length-1)&&Wf(e,s,n))&&(t.data=r.slice(0,-1)+Wn,!0):(t.data=r.slice(0,-1)+" ",!0)},Jf=(e,t,o)=>{const n=t.container();if(!lr(n))return F.none();if((e=>{const t=e.container();return lr(t)&&je(t.data,Wn)})(t)){const r=Kf(e,n,!1,o)||Yf(n)||Xf(e,n,!1,o);return Ft(r,t)}if($f(e,t,o)){const r=Kf(e,n,!0,o)||Xf(e,n,!0,o);return Ft(r,t)}return F.none()},Qf=(e,t,o,n)=>{if(0===o)return;const r=wo.fromDom(e),s=Ko(r,(e=>n.isBlock(Wt(e)))).getOr(r),a=e.data.slice(t,t+o),i=t+o>=e.data.length&&Wf(s,ml(e,e.data.length),n),l=0===t&&jf(s,ml(e,0),n);e.replaceData(t,o,Yn(a,4,l,i))},ev=(e,t,o)=>{const n=e.data.slice(t),r=n.length-Ke(n).length;Qf(e,t,r,o)},tv=(e,t,o)=>{const n=e.data.slice(0,t),r=n.length-Ye(n).length;Qf(e,t-r,r,o)},ov=(e,t,o,n,r=!0)=>{const s=Ye(e.data).length,a=r?e:t,i=r?t:e;return r?a.appendData(i.data):a.insertData(0,i.data),xn(wo.fromDom(i)),n&&ev(a,s,o),a},nv=(e,t)=>((e,t)=>{const o=e.container(),n=e.offset();return!ml.isTextPosition(e)&&o===t.parentNode&&n>ml.before(t).offset()})(t,e)?ml(t.container(),t.offset()-1):t,rv=e=>{return ji(e.previousSibling)?F.some((t=e.previousSibling,lr(t)?ml(t,t.data.length):ml.after(t))):e.previousSibling?au(e.previousSibling):F.none();var t},sv=e=>{return ji(e.nextSibling)?F.some((t=e.nextSibling,lr(t)?ml(t,0):ml.before(t))):e.nextSibling?su(e.nextSibling):F.none();var t},av=(e,t)=>rv(t).orThunk((()=>sv(t))).orThunk((()=>((e,t)=>F.from(t.previousSibling?t.previousSibling:t.parentNode).bind((t=>ru(e,ml.before(t)))).orThunk((()=>nu(e,ml.after(t)))))(e,t))),iv=(e,t)=>sv(t).orThunk((()=>rv(t))).orThunk((()=>((e,t)=>nu(e,ml.after(t)).orThunk((()=>ru(e,ml.before(t)))))(e,t))),lv=(e,t,o)=>((e,t,o)=>e?iv(t,o):av(t,o))(e,t,o).map(N(nv,o)),cv=(e,t,o)=>{o.fold((()=>{e.focus()}),(o=>{e.selection.setRng(o.toRange(),t)}))},dv=(e,t)=>t&&Ee(e.schema.getBlockElements(),Wt(t)),mv=(e,t,o,n)=>{const r=No(e).filter(Yt),s=Ro(e).filter(Yt);return xn(e),(a=r,i=s,l=t,c=(e,t,r)=>{const s=e.dom,a=t.dom,i=s.data.length;return ov(s,a,o,n),r.container()===a?ml(s,i):r},a.isSome()&&i.isSome()&&l.isSome()?F.some(c(a.getOrDie(),i.getOrDie(),l.getOrDie())):F.none()).orThunk((()=>(n&&(r.each((e=>tv(e.dom,e.dom.length,o))),s.each((e=>ev(e.dom,0,o)))),t)));var a,i,l,c},uv=(e,t,o,n=!0,r=!1)=>{const s=lv(t,e.getBody(),o.dom),a=Ko(o,N(dv,e),(i=e.getBody(),e=>e.dom===i));var i;const l=mv(o,s,e.schema,((e,t)=>Ee(e.schema.getTextInlineElements(),Wt(t)))(e,o));e.dom.isEmpty(e.getBody())?(e.setContent(""),e.selection.setCursorLocation()):a.bind((t=>((e,t,o)=>{if(Mr(e,t)){const e=wo.fromHtml('
    ');return o?q(Ho(t),(e=>{ig(e)||xn(e)})):wn(t),vn(t,e),F.some(ml.before(e.dom))}return F.none()})(e.schema,t,r))).fold((()=>{n&&cv(e,t,l)}),(o=>{n&&cv(e,t,F.some(o))}))},gv=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,hv=(e,t)=>Co(wo.fromDom(t),Mc(e))&&!Jr(e.schema,t)&&e.dom.isEditable(t),pv=e=>{var t;return"rtl"===ya.DOM.getStyle(e,"direction",!0)||(e=>gv.test(e))(null!==(t=e.textContent)&&void 0!==t?t:"")},fv=(e,t,o)=>{const n=((e,t,o)=>Y(ya.DOM.getParents(o.container(),"*",t),e))(e,t,o);return F.from(n[n.length-1])},vv=(e,t)=>{const o=t.container(),n=t.offset();return e?fi(o)?lr(o.nextSibling)?ml(o.nextSibling,0):ml.after(o):yi(t)?ml(o,n+1):t:fi(o)?lr(o.previousSibling)?ml(o.previousSibling,o.previousSibling.data.length):ml.before(o):wi(t)?ml(o,n-1):t},bv=N(vv,!0),yv=N(vv,!1),wv=(e,t)=>{const o=e=>e.stopImmediatePropagation();e.on("beforeinput input",o,!0),e.getDoc().execCommand(t),e.off("beforeinput input",o)},xv=e=>wv(e,"Delete"),Cv=e=>wv(e,"ForwardDelete"),Sv=e=>ti(e)||ni(e),kv=(e,t)=>_o(e,t)?Yo(t,Sv,(e=>t=>Ht(Ao(t),e,ko))(e)):F.none(),_v=(e,t=!0)=>{e.dom.isEmpty(e.getBody())&&e.setContent("",{no_selection:!t})},Ev=(e,t,o)=>Pt(su(o),au(o),((n,r)=>{const s=vv(!0,n),a=vv(!1,r),i=vv(!1,t);return e?nu(o,i).exists((e=>e.isEqual(a)&&t.isEqual(s))):ru(o,i).exists((e=>e.isEqual(s)&&t.isEqual(a)))})).getOr(!0),Tv=e=>{var t;return(8===$t(t=e)||"#comment"===Wt(t)?No(e):Fo(e)).bind(Tv).orThunk((()=>F.some(e)))},Ov=(e,t,o,n=!0)=>{var r;t.deleteContents();const s=Tv(o).getOr(o),a=wo.fromDom(null!==(r=e.dom.getParent(s.dom,e.dom.isBlock))&&void 0!==r?r:o.dom);if(a.dom===e.getBody()?_v(e,n):Mr(e.schema,a,{checkRootAsContent:!1})&&(ci(a),n&&e.selection.setCursorLocation(a.dom,0)),!ko(o,a)){const t=Ht(Ao(a),o)?[]:Ao(i=a).map(Ho).map((e=>Y(e,(e=>!ko(i,e))))).getOr([]);q(t.concat(Ho(o)),(t=>{ko(t,a)||_o(t,a)||!Mr(e.schema,t)||xn(t)}))}var i},Av=e=>Fn(e,"td,th"),Dv=(e,t)=>Mu(wo.fromDom(e),t),Mv=e=>(e=>Pt(e.startTable,e.endTable,((t,o)=>{const n=Zn(t,(e=>ko(e,o))),r=Zn(o,(e=>ko(e,t)));return n||r?{...e,startTable:n?F.none():e.startTable,endTable:r?F.none():e.endTable,isSameTable:!1,isMultiTable:!1}:e})).getOr(e))(e),Nv=(e,t)=>({start:e,end:t}),Rv=Il([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),Bv=(e,t)=>tn(wo.fromDom(e),"td,th",t),Lv=e=>!ko(e.start,e.end),Hv=(e,t)=>Mu(e.start,t).bind((o=>Mu(e.end,t).bind((e=>Ft(ko(o,e),o))))),Iv=e=>t=>Hv(t,e).map((e=>((e,t,o)=>({rng:e,table:t,cells:o}))(t,e,Av(e)))),Pv=(e,t,o,n)=>{if(o.collapsed||!e.forall(Lv))return F.none();if(t.isSameTable){const t=e.bind(Iv(n));return F.some({start:t,end:t})}{const e=Bv(o.startContainer,n),t=Bv(o.endContainer,n),r=e.bind((e=>t=>Mu(t,e).bind((e=>me(Av(e)).map((e=>Nv(t,e))))))(n)).bind(Iv(n)),s=t.bind((e=>t=>Mu(t,e).bind((e=>de(Av(e)).map((e=>Nv(e,t))))))(n)).bind(Iv(n));return F.some({start:r,end:s})}},Fv=(e,t)=>te(e,(e=>ko(e,t))),zv=e=>Pt(Fv(e.cells,e.rng.start),Fv(e.cells,e.rng.end),((t,o)=>e.cells.slice(t,o+1))),Vv=(e,t,o)=>e.exists((e=>((e,t)=>!Lv(e)&&Hv(e,t).exists((e=>{const t=e.dom.rows;return 1===t.length&&1===t[0].cells.length})))(e,o)&&Bu(e.start,t))),Zv=(e,t)=>{const{startTable:o,endTable:n}=t,r=e.cloneRange();return o.each((e=>r.setStartAfter(e.dom))),n.each((e=>r.setEndBefore(e.dom))),r},Uv=(e,t)=>{const o=(e=>t=>ko(e,t))(e),n=((e,t)=>{const o=Bv(e.startContainer,t),n=Bv(e.endContainer,t);return Pt(o,n,Nv)})(t,o),r=((e,t)=>{const o=Dv(e.startContainer,t),n=Dv(e.endContainer,t),r=o.isSome(),s=n.isSome(),a=Pt(o,n,ko).getOr(!1);return Mv({startTable:o,endTable:n,isStartInTable:r,isEndInTable:s,isSameTable:a,isMultiTable:!a&&r&&s})})(t,o);return Vv(n,t,o)?n.map((e=>Rv.singleCellTable(t,e.start))):r.isMultiTable?((e,t,o,n)=>Pv(e,t,o,n).bind((({start:e,end:n})=>{const r=e.bind(zv).getOr([]),s=n.bind(zv).getOr([]);if(r.length>0&&s.length>0){const e=Zv(o,t);return F.some(Rv.multiTable(r,s,e))}return F.none()})))(n,r,t,o):((e,t,o,n)=>Pv(e,t,o,n).bind((({start:e,end:t})=>e.or(t))).bind((e=>{const{isSameTable:n}=t,r=zv(e).getOr([]);if(n&&e.cells.length===r.length)return F.some(Rv.fullTable(e.table));if(r.length>0){if(n)return F.some(Rv.partialTable(r,F.none()));{const e=Zv(o,t);return F.some(Rv.partialTable(r,F.some({...t,rng:e})))}}return F.none()})))(n,r,t,o)},jv=e=>q(e,(e=>{ao(e,"contenteditable"),ci(e)})),Wv=(e,t,o,n)=>{const r=o.cloneRange();n?(r.setStart(o.startContainer,o.startOffset),r.setEndAfter(t.dom.lastChild)):(r.setStartBefore(t.dom.firstChild),r.setEnd(o.endContainer,o.endOffset)),Kv(e,r,t,!1).each((e=>e()))},$v=e=>{const t=Du(e),o=wo.fromDom(e.selection.getNode());br(o.dom)&&Mr(e.schema,o)?e.selection.setCursorLocation(o.dom,0):e.selection.collapse(!0),t.length>1&&W(t,(e=>ko(e,o)))&&to(o,"data-mce-selected","1")},qv=(e,t,o)=>F.some((()=>{const n=e.selection.getRng(),r=o.bind((({rng:o,isStartInTable:r})=>{const s=((e,t)=>F.from(e.dom.getParent(t,e.dom.isBlock)).map(wo.fromDom))(e,r?o.endContainer:o.startContainer);o.deleteContents(),((e,t,o)=>{o.each((o=>{t?xn(o):(ci(o),e.selection.setCursorLocation(o.dom,0))}))})(e,r,s.filter(N(Mr,e.schema)));const a=r?t[0]:t[t.length-1];return Wv(e,a,n,r),Mr(e.schema,a)?F.none():F.some(r?t.slice(1):t.slice(0,-1))})).getOr(t);jv(r),$v(e)})),Gv=(e,t,o,n)=>F.some((()=>{const r=e.selection.getRng(),s=t[0],a=o[o.length-1];Wv(e,s,r,!0),Wv(e,a,r,!1);const i=Mr(e.schema,s)?t:t.slice(1),l=Mr(e.schema,a)?o:o.slice(0,-1);jv(i.concat(l)),n.deleteContents(),$v(e)})),Kv=(e,t,o,n=!0)=>F.some((()=>{Ov(e,t,o,n)})),Yv=(e,t)=>F.some((()=>uv(e,!1,t))),Xv=(e,t,o,n)=>Qv(t,n).fold((()=>((e,t,o)=>Uv(t,o).bind((t=>t.fold(N(Kv,e),N(Yv,e),N(qv,e),N(Gv,e)))))(e,t,o)),(t=>((e,t)=>eb(e,t))(e,t))),Jv=(e,t)=>ee(xf(t,e),si),Qv=(e,t)=>ee(xf(t,e),Qt("caption")),eb=(e,t)=>F.some((()=>{ci(t),e.selection.setCursorLocation(t.dom,0)})),tb=(e,t,o,n,r)=>eu(o,e.getBody(),r).fold((()=>F.some(E)),(s=>((e,t,o,n)=>su(e.dom).bind((r=>au(e.dom).map((e=>t?o.isEqual(r)&&n.isEqual(e):o.isEqual(e)&&n.isEqual(r))))).getOr(!0))(n,o,r,s)?((e,t)=>eb(e,t))(e,n):((e,t,o)=>Qv(e,wo.fromDom(o.getNode())).fold((()=>F.some(E)),(e=>Ft(!ko(e,t),E))))(t,n,s))),ob=(e,t,o,n)=>{const r=ml.fromRangeStart(e.selection.getRng());return Jv(o,n).bind((n=>Mr(e.schema,n,{checkRootAsContent:!1})?eb(e,n):((e,t,o,n,r)=>eu(o,e.getBody(),r).bind((e=>Jv(t,wo.fromDom(e.getNode())).bind((e=>ko(e,n)?F.none():F.some(E))))))(e,o,t,n,r)))},nb=(e,t)=>e?ff(t):vf(t),rb=(e,t,o)=>{const n=wo.fromDom(e.getBody());return Qv(n,o).fold((()=>ob(e,t,n,o).orThunk((()=>Ft(((e,t)=>{const o=ml.fromRangeStart(e.selection.getRng());return nb(t,o)||Qm(t,e.getBody(),o).exists((e=>nb(t,e)))})(e,t),E)))),(o=>((e,t,o,n)=>{const r=ml.fromRangeStart(e.selection.getRng());return Mr(e.schema,n)?eb(e,n):tb(e,o,t,n,r)})(e,t,n,o)))},sb=(e,t)=>{const o=wo.fromDom(e.selection.getStart(!0)),n=Du(e);return e.selection.isCollapsed()&&0===n.length?rb(e,t,o):((e,t,o)=>{const n=wo.fromDom(e.getBody()),r=e.selection.getRng();return 0!==o.length?qv(e,o,F.none()):Xv(e,n,r,t)})(e,o,n)},ab=(e,t)=>{let o=t;for(;o&&o!==e;){if(fr(o)||vr(o))return o;o=o.parentNode}return null},ib=["data-ephox-","data-mce-","data-alloy-","data-snooker-","_"],lb=Lt.each,cb=e=>{const t=e.dom,o=new Set(e.serializer.getTempAttrs()),n=e=>W(ib,(t=>We(e,t)))||o.has(e);return{compare:(e,o)=>{if(e.nodeName!==o.nodeName||e.nodeType!==o.nodeType)return!1;const r=e=>{const o={};return lb(t.getAttribs(e),(r=>{const s=r.nodeName.toLowerCase();"style"===s||n(s)||(o[s]=t.getAttrib(e,s))})),o},s=(e,t)=>{for(const o in e)if(Ee(e,o)){const n=t[o];if(w(n))return!1;if(e[o]!==n)return!1;delete t[o]}for(const e in t)if(Ee(t,e))return!1;return!0};if(Qn(e)&&Qn(o)){if(!s(r(e),r(o)))return!1;if(!s(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(o,"style"))))return!1}return!Cu(e)&&!Cu(o)},isAttributeInternal:n}},db=e=>["h1","h2","h3","h4","h5","h6"].includes(e.name),mb=(e,t,o,n)=>{const r=o.name;for(let t=0,s=e.length;t{const o=(e,o)=>{ve(e,(e=>{const n=ue(e.nodes);q(e.filter.callbacks,(r=>{for(let t=n.length-1;t>=0;t--){const r=n[t];(o?void 0!==r.attr(e.filter.name):r.name===e.filter.name)&&!x(r.parent)||n.splice(t,1)}n.length>0&&r(n,e.filter.name,t)}))}))};o(e.nodes,!1),o(e.attributes,!0)},gb=(e,t,o,n={})=>{const r=((e,t,o)=>{const n={nodes:{},attributes:{}};return o.firstChild&&((e,t)=>{let o=e;for(;o=o.walk();)t(o)})(o,(o=>{mb(e,t,o,n)})),n})(e,t,o);ub(r,n)},hb=(e,t,o,n)=>{if((e.pad_empty_with_br||t.insert)&&o(n)){const e=new Dp("br",1);t.insert&&e.attr("data-mce-bogus","1"),n.empty().append(e)}else n.empty().append(new Dp("#text",3)).value=Wn},pb=(e,t)=>{const o=null==e?void 0:e.firstChild;return C(o)&&o===e.lastChild&&o.name===t},fb=(e,t,o,n)=>n.isEmpty(t,o,(t=>((e,t)=>{const o=e.getElementRule(t.name);return!0===(null==o?void 0:o.paddEmpty)})(e,t))),vb=e=>{let t;for(let o=e;o;o=o.parent){const e=o.attr("contenteditable");if("false"===e)break;"true"===e&&(t=o)}return F.from(t)},bb=(e,t,o=e.parent)=>{if(t.getSpecialElements()[e.name])e.empty().remove();else{const n=e.children();for(const e of n)o&&!t.isValidChild(o.name,e.name)&&bb(e,t,o);e.unwrap()}},yb=(e,t,o,n=E)=>{const r=t.getTextBlockElements(),s=t.getNonEmptyElements(),a=t.getWhitespaceElements(),i=Lt.makeMap("tr,td,th,tbody,thead,tfoot,table,summary"),l=new Set,c=e=>e!==o&&!i[e.name];for(let o=0;o1)if(wb(t,i,d))bb(i,t);else{g.reverse(),m=g[0].clone(),n(m);let e=m;for(let o=0;o0?(u=g[o].clone(),n(u),e.append(u)):u=e;for(let e=g[o].firstChild;e&&e!==g[o+1];){const t=e.next;u.append(e),e=t}e=u}fb(t,s,a,m)?d.insert(i,g[0],!0):(d.insert(m,g[0],!0),d.insert(i,m)),d=g[0],(fb(t,s,a,d)||pb(d,"br"))&&d.empty().remove()}else if(i.parent){if("li"===i.name){let e=i.prev;if(e&&("ul"===e.name||"ol"===e.name)){e.append(i);continue}if(e=i.next,e&&("ul"===e.name||"ol"===e.name)&&e.firstChild){e.insert(i,e.firstChild,!0);continue}const t=new Dp("ul",1);n(t),i.wrap(t);continue}if(t.isValidChild(i.parent.name,"div")&&t.isValidChild("div",i.name)){const e=new Dp("div",1);n(e),i.wrap(e)}else bb(i,t)}}},wb=(e,t,o=t.parent)=>!(!o||(!e.children[t.name]||e.isValidChild(o.name,t.name))&&("a"!==t.name||!((e,t)=>{let o=e;for(;o;){if(o.name===t)return!0;o=o.parent}return!1})(o,"a"))&&(!(e=>"summary"===e.name)(o)||!db(t)||(null==o?void 0:o.firstChild)===t&&(null==o?void 0:o.lastChild)===t)),xb=e=>{const t=ml.fromRangeStart(e),o=ml.fromRangeEnd(e),n=e.commonAncestorContainer;return Qm(!1,n,o).map((r=>!km(t,o,n)&&km(t,r,n)?((e,t,o,n)=>{const r=document.createRange();return r.setStart(e,t),r.setEnd(o,n),r})(t.container(),t.offset(),r.container(),r.offset()):e)).getOr(e)},Cb=e=>e.collapsed?e:xb(e),Sb=(e,t)=>e.getBlockElements()[t.name]&&(e=>C(e.firstChild)&&e.firstChild===e.lastChild)(t)&&(e=>"br"===e.name||e.value===Wn)(t.firstChild),kb=(e,t)=>{let o=t.firstChild,n=t.lastChild;return o&&"meta"===o.name&&(o=o.next),n&&"mce_marker"===n.attr("id")&&(n=n.prev),((e,t)=>{const o=e.getNonEmptyElements();return C(t)&&(t.isEmpty(o)||Sb(e,t))})(e,n)&&(n=null==n?void 0:n.prev),!(!o||o!==n||"ul"!==o.name&&"ol"!==o.name)},_b=e=>C(null==e?void 0:e.firstChild)&&e.firstChild===e.lastChild&&(e=>e.data===Wn||hr(e))(e.firstChild),Eb=e=>{return e.length>0&&(!(t=e[e.length-1]).firstChild||_b(t))?e.slice(0,-1):e;var t},Tb=(e,t)=>{const o=e.getParent(t,e.isBlock);return o&&"LI"===o.nodeName?o:null},Ob=(e,t)=>{const o=ml.after(e),n=Gm(t).prev(o);return n?n.toRange():null},Ab=(e,t,o)=>{const n=e.parentNode;return n&&Lt.each(t,(t=>{n.insertBefore(t,e)})),((e,t)=>{const o=ml.before(e),n=Gm(t).next(o);return n?n.toRange():null})(e,o)},Db=(e,t,o,n)=>{const r=((e,t,o)=>{const n=t.serialize(o);return(e=>{var t,o;const n=e.firstChild,r=e.lastChild;return n&&"META"===n.nodeName&&(null===(t=n.parentNode)||void 0===t||t.removeChild(n)),r&&"mce_marker"===r.id&&(null===(o=r.parentNode)||void 0===o||o.removeChild(r)),e})(e.createFragment(n))})(t,e,n),s=Tb(t,o.startContainer),a=Eb((i=r.firstChild,Y(null!==(l=null==i?void 0:i.childNodes)&&void 0!==l?l:[],(e=>"LI"===e.nodeName))));var i,l;const c=t.getRoot(),d=e=>{const n=ml.fromRangeStart(o),r=Gm(t.getRoot()),a=1===e?r.prev(n):r.next(n),i=null==a?void 0:a.getNode();return!i||Tb(t,i)!==s};return s?d(1)?Ab(s,a,c):d(2)?((e,t,o,n)=>(n.insertAfter(t.reverse(),e),Ob(t[0],o)))(s,a,c,t):((e,t,o,n)=>{const r=((e,t)=>{const o=t.cloneRange(),n=t.cloneRange();return o.setStartBefore(e),n.setEndAfter(e),[o.cloneContents(),n.cloneContents()]})(e,n),s=e.parentNode;return s&&(s.insertBefore(r[0],e),Lt.each(t,(t=>{s.insertBefore(t,e)})),s.insertBefore(r[1],e),s.removeChild(e)),Ob(t[t.length-1],o)})(s,a,c,o):null},Mb=["pre"],Nb=br,Rb=(e,t,o)=>{F.from(e.getParent(t,"td,th")).map(wo.fromDom).each((e=>((e,t)=>{Fo(e).each((o=>{No(o).each((n=>{t.isBlock(Wt(e))&&ei(o)&&t.isBlock(Wt(n))&&xn(o)}))}))})(e,o)))},Bb=(e,t)=>{var o,n,r;let s;const a=e.dom,i=e.selection;if(!t)return;i.scrollIntoView(t);const l=ab(e.getBody(),t);if(l&&"false"===a.getContentEditable(l))return a.remove(t),void i.select(l);let c=a.createRng();const d=t.previousSibling;if(lr(d)){c.setStart(d,null!==(n=null===(o=d.nodeValue)||void 0===o?void 0:o.length)&&void 0!==n?n:0);const e=t.nextSibling;lr(e)&&(d.appendData(e.data),null===(r=e.parentNode)||void 0===r||r.removeChild(e))}else c.setStartBefore(t),c.setEndBefore(t);const m=a.getParent(t,a.isBlock);if(a.remove(t),m&&a.isEmpty(m)){const t=Nb(m);wn(wo.fromDom(m)),c.setStart(m,0),c.setEnd(m,0),t||(e=>!!e.getAttribute("data-mce-fragment"))(m)||!(s=(t=>{let o=ml.fromRangeStart(t);return o=Gm(e.getBody()).next(o),null==o?void 0:o.toRange()})(c))?a.add(m,a.create("br",t?{}:{"data-mce-bogus":"1"})):(c=s,a.remove(m))}i.setRng(c)},Lb=e=>{const t=e.dom,o=Cb(e.selection.getRng());e.selection.setRng(o);const n=t.getParent(o.startContainer,Nb);((e,t,o)=>!!C(o)&&(o===e.getParent(t.endContainer,Nb)&&Bu(wo.fromDom(o),t)))(t,o,n)?Kv(e,o,wo.fromDom(n)):o.startContainer===o.endContainer&&o.endOffset-o.startOffset==1&&lr(o.startContainer.childNodes[o.startOffset])?o.deleteContents():e.getDoc().execCommand("Delete",!1)},Hb=(e,t,o)=>{var n,r;const s=e.selection,a=e.dom,i=e.parser,l=o.merge,c=Yp({validate:!0},e.schema),d='';o.preserve_zwsp||(t=ui(t)),-1===t.indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);let m=s.getRng();const u=m.startContainer,g=e.getBody();u===g&&s.isCollapsed()&&a.isBlock(g.firstChild)&&((e,t)=>C(t)&&!e.schema.getVoidElements()[t.nodeName])(e,g.firstChild)&&a.isEmpty(g.firstChild)&&(m=a.createRng(),m.setStart(g.firstChild,0),m.setEnd(g.firstChild,0),s.setRng(m)),s.isCollapsed()||Lb(e);const h=s.getNode(),p={context:h.nodeName.toLowerCase(),data:o.data,insert:!0},f=i.parse(t,p);if(!0===o.paste&&kb(e.schema,f)&&((e,t)=>!!Tb(e,t))(a,h))return m=Db(c,a,s.getRng(),f),m&&s.setRng(m),t;!0===o.paste&&((e,t,o,n)=>{var r;const s=t.firstChild,a=t.lastChild,i=s===("bookmark"===a.attr("data-mce-type")?a.prev:a),l=j(Mb,s.name);if(i&&l){const t="false"!==s.attr("contenteditable"),a=(null===(r=e.getParent(o,e.isBlock))||void 0===r?void 0:r.nodeName.toLowerCase())===s.name,i=F.from(ab(n,o)).forall(fr);return t&&a&&i}return!1})(a,f,h,e.getBody())&&(null===(n=f.firstChild)||void 0===n||n.unwrap()),(e=>{let t=e;for(;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")})(f);let v=f.lastChild;if(v&&"mce_marker"===v.attr("id")){const t=v;for(v=v.prev;v;v=v.walk(!0))if(3===v.type||!a.isBlock(v.name)){v.parent&&e.schema.isValidChild(v.parent.name,"span")&&v.parent.insert(t,v,"br"===v.name);break}}if(e._selectionOverrides.showBlockCaretContainer(h),p.invalid||((e,t,o)=>{var n;return W(o.children(),db)&&"SUMMARY"===(null===(n=e.getParent(t,e.isBlock))||void 0===n?void 0:n.nodeName)})(a,h,f)){e.selection.setContent(d);let o,n=s.getNode();const l=e.getBody();for(ur(n)?n=o=l:o=n;o&&o!==l;)n=o,o=o.parentNode;t=n===l?l.innerHTML:a.getOuterHTML(n);const m=i.parse(t),u=(e=>{for(let t=e;t;t=t.walk())if("mce_marker"===t.attr("id"))return F.some(t);return F.none()})(m),g=u.bind(vb).getOr(m);u.each((e=>e.replace(f)));const h=f.children(),p=null!==(r=f.parent)&&void 0!==r?r:m;f.unwrap();const v=Y(h,(t=>wb(e.schema,t,p)));yb(v,e.schema,g),gb(i.getNodeFilters(),i.getAttributeFilters(),m),t=c.serialize(m),n===l?a.setHTML(l,t):a.setOuterHTML(n,t)}else t=c.serialize(f),((e,t,o)=>{var n;if("all"===o.getAttribute("data-mce-bogus"))null===(n=o.parentNode)||void 0===n||n.insertBefore(e.dom.createFragment(t),o);else{const n=o.firstChild,r=o.lastChild;!n||n===r&&"BR"===n.nodeName?e.dom.setHTML(o,t):e.selection.setContent(t,{no_events:!0})}})(e,t,h);var b;return((e,t)=>{const o=e.schema.getTextInlineElements(),n=e.dom;if(t){const t=e.getBody(),r=cb(e),s="*[data-mce-fragment]",a=n.select(s);Lt.each(a,(e=>{const a=e=>C(o[e.nodeName.toLowerCase()]),i=e=>1===e.childNodes.length;if(!tf(n,l=e)&&!of(n,l)&&a(e)&&i(e)){const o=ef(n,e),l=(e,t)=>re(e,(e=>j(t,e))),c=t=>i(e)&&n.is(t,s)&&a(t)&&(t.nodeName===e.nodeName&&l(o,ef(n,t))||c(t.children[0])),d=o=>C(o)&&o!==t&&(r.compare(e,o)||d(o.parentElement)),m=o=>C(o)&&o!==t&&n.is(o,s)&&(nf(n,e,o)||m(o.parentElement));(c(e.children[0])||d(e.parentElement)&&!m(e.parentElement))&&n.remove(e,!0)}var l}))}})(e,l),Bb(e,a.get("mce_marker")),b=e.getBody(),Lt.each(b.getElementsByTagName("*"),(e=>{e.removeAttribute("data-mce-fragment")})),Rb(a,s.getStart(),e.schema),((e,t,o)=>{const n=Mo(wo.fromDom(o),(e=>ko(e,wo.fromDom(t))));ce(n,n.length-2).filter(Kt).fold((()=>qr(e,t)),(t=>qr(e,t.dom)))})(e.schema,e.getBody(),s.getStart()),t},Ib=e=>e instanceof Dp,Pb=(e,t,o)=>{e.dom.setHTML(e.getBody(),t),!0!==o&&(e=>{fp(e)&&su(e.getBody()).each((t=>{const o=t.getNode(),n=sr(o)?su(o).getOr(t):t;e.selection.setRng(n.toRange())}))})(e)},Fb=(e,t,o)=>F.from(e.getBody()).map((n=>Ib(t)?((e,t,o,n)=>{gb(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),o);const r=Yp({validate:!1},e.schema).serialize(o),s=ui(ai(wo.fromDom(t))?r:Lt.trim(r));return Pb(e,s,n.no_selection),{content:o,html:s}})(e,n,t,o):((e,t,o,n)=>{if(0===(o=ui(o)).length||/^\s+$/.test(o)){const r='
    ';"TABLE"===t.nodeName?o=""+r+"":/^(UL|OL)$/.test(t.nodeName)&&(o="
  • "+r+"
  • ");const s=sc(e);return e.schema.isValidChild(t.nodeName.toLowerCase(),s.toLowerCase())?(o=r,o=e.dom.createHTML(s,ac(e),o)):o||(o=r),Pb(e,o,n.no_selection),{content:o,html:o}}{"raw"!==n.format&&(o=Yp({validate:!1},e.schema).serialize(e.parser.parse(o,{isRootContent:!0,insert:!0})));const r=ai(wo.fromDom(t))?o:Lt.trim(o);return Pb(e,r,n.no_selection),{content:r,html:r}}})(e,n,t,o))).getOr({content:t,html:Ib(o.content)?"":o.content}),zb=e=>S(e)?e:I,Vb=(e,t,o)=>{const n=t(e),r=zb(o);return n.orThunk((()=>r(e)?F.none():((e,t,o)=>{let n=e.dom;const r=zb(o);for(;n.parentNode;){n=n.parentNode;const e=wo.fromDom(n),o=t(e);if(o.isSome())return o;if(r(e))break}return F.none()})(e,t,r)))},Zb=Ku,Ub=(e,t,o)=>{const n=e.formatter.get(o);if(n)for(let o=0;o{const s=e.dom.getRoot();if(t===s)return!1;const a=e.dom.getParent(t,(t=>!!Ub(e,t,o)||t.parentNode===s||!!qb(e,t,o,n,!0)));return!!qb(e,a,o,n,r)},Wb=(e,t,o)=>!(!rg(o)||!Zb(t,o.inline))||!(!og(o)||!Zb(t,o.block))||!!ng(o)&&Qn(t)&&e.is(t,o.selector),$b=(e,t,o,n,r,s)=>{const a=o[n],i="attributes"===n;if(S(o.onmatch))return o.onmatch(t,o,n);if(a)if(Ae(a)){for(let o=0;o{const s=e.formatter.get(o),a=e.dom;if(s&&Qn(t))for(let o=0;o{if(n)return jb(e,n,t,o,r);if(n=e.selection.getNode(),jb(e,n,t,o,r))return!0;const s=e.selection.getStart();return!(s===n||!jb(e,s,t,o,r))},Kb=(e,t)=>{const o=t=>ko(t,wo.fromDom(e.getBody()));return F.from(e.selection.getStart(!0)).bind((n=>Vb(wo.fromDom(n),(o=>ge(t,(t=>((t,o)=>qb(e,t.dom,o)?F.some(o):F.none())(o,t)))),o))).getOrNull()},Yb=(e,t,o)=>J(o,((o,n)=>{const r=((e,t)=>eg(e,t,(e=>{const t=e=>S(e)||e.length>1&&"%"===e.charAt(0);return W(["styles","attributes"],(o=>_e(e,o).exists((e=>{const o=v(e)?e:ke(e);return W(o,t)}))))})))(e,n);return e.formatter.matchNode(t,n,{},r)?o.concat([n]):o}),[]),Xb=di,Jb=e=>{if(e){const t=new Un(e,e);for(let e=t.current();e;e=t.next())if(lr(e))return e}return null},Qb=e=>{const t=wo.fromTag("span");return oo(t,{id:iu,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&vn(t,wo.fromText(Xb)),t},ey=(e,t,o)=>{const n=e.dom,r=e.selection;if(ag(t))uv(e,!1,wo.fromDom(t),o,!0);else{const e=r.getRng(),o=n.getParent(t,n.isBlock),s=e.startContainer,a=e.startOffset,i=e.endContainer,l=e.endOffset,c=(e=>{const t=Jb(e);return t&&t.data.charAt(0)===Xb&&t.deleteData(0,1),t})(t);n.remove(t,!0),s===c&&a>0&&e.setStart(c,a-1),i===c&&l>0&&e.setEnd(c,l-1),o&&n.isEmpty(o)&&ci(wo.fromDom(o)),r.setRng(e)}},ty=(e,t,o)=>{const n=e.dom,r=e.selection;if(t)ey(e,t,o);else if(!(t=cu(e.getBody(),r.getStart())))for(;t=n.get(iu);)ey(e,t,o)},oy=(e,t)=>(e.appendChild(t),t),ny=(e,t)=>{var o;const n=X(e,((e,t)=>oy(e,t.cloneNode(!1))),t),r=null!==(o=n.ownerDocument)&&void 0!==o?o:document;return oy(n,r.createTextNode(Xb))},ry=e=>Ja(e,Xa(e).replace(new RegExp(`${Wn}$`)," ")),sy=(e,t)=>{const o=()=>{null===t||e.dom.isEmpty(t)||No(wo.fromDom(t)).each((e=>{Yt(e)?ry(e):Jo(e,(e=>Yt(e))).each((e=>{Yt(e)&&ry(e)}))}))};e.once("input",(t=>{t.data&&!_u(t.data)&&(t.isComposing?e.once("compositionend",(()=>{o()})):o())}))},ay=(e,t,o,n)=>{const r=e.dom,s=e.selection;let a=!1;const i=e.formatter.get(t);if(!i)return;const l=s.getRng(),c=l.startContainer,d=l.startOffset;let m=c;lr(c)&&(d!==c.data.length&&(a=!0),m=m.parentNode);const u=[];let g;for(;m;){if(qb(e,m,t,o,n)){g=m;break}m.nextSibling&&(a=!0),u.push(m),m=m.parentNode}if(g)if(a){const a=s.getBookmark();l.collapse(!0);let c=Cg(r,l,i,!0);c=wh(c),e.formatter.remove(t,o,c,n),s.moveToBookmark(a)}else{const a=cu(e.getBody(),g),i=C(a)?r.getParents(g.parentNode,P,a):[],l=Qb(!1).dom;((e,t,o)=>{var n,r;const s=e.dom,a=s.getParent(o,N(ju,e.schema));a&&s.isEmpty(a)?null===(n=o.parentNode)||void 0===n||n.replaceChild(t,o):(ii(wo.fromDom(o)),s.isEmpty(o)?null===(r=o.parentNode)||void 0===r||r.replaceChild(t,o):s.insertAfter(t,o))})(e,l,null!=a?a:g);const c=((e,t,o,n,r,s)=>{const a=e.formatter,i=e.dom,l=Y(pe(a.get()),(e=>e!==n&&!je(e,"removeformat"))),c=Yb(e,o,l);if(Y(c,(t=>!tg(e,t,n))).length>0){const e=o.cloneNode(!1);return i.add(t,e),a.remove(n,r,e,s),i.remove(e),F.some(e)}return F.none()})(e,l,g,t,o,n),d=ny([...u,...c.toArray(),...i],l);a&&ey(e,a,C(a)),s.setCursorLocation(d,1),sy(e,l),r.isEmpty(g)&&r.remove(g)}},iy=e=>{e.on("mouseup keydown",(t=>{var o;((e,t,o)=>{const n=e.selection,r=e.getBody();ty(e,null,o),8!==t&&46!==t||!n.isCollapsed()||n.getStart().innerHTML!==Xb||ty(e,cu(r,n.getStart()),!0),37!==t&&39!==t||ty(e,cu(r,n.getStart()),!0)})(e,t.keyCode,(o=e.selection.getRng().endContainer,lr(o)&&$e(o.data,Wn)))}))},ly=e=>{const t=Qb(!1),o=ny(e,t.dom);return{caretContainer:t,caretPosition:ml(o,0)}},cy=(e,t)=>{const{caretContainer:o,caretPosition:n}=ly(t);return hn(wo.fromDom(e),o),xn(wo.fromDom(e)),n},dy=(e,t)=>{if(lu(t.dom))return!1;const o=e.schema.getTextInlineElements();return Ee(o,Wt(t))&&!lu(t.dom)&&!rr(t.dom)},my={},uy=or(["pre"]);((e,t)=>{my[e]||(my[e]=[]),my[e].push(t)})("pre",(e=>{const t=e.selection.getRng();if(!t.collapsed){const t=e.selection.getSelectedBlocks(),o=Y(Y(t,uy),(e=>t=>{const o=t.previousSibling;return uy(o)&&j(e,o)})(t));q(o,(e=>{((e,t)=>{const o=wo.fromDom(t),n=To(o).dom;xn(o),yn(wo.fromDom(e),[wo.fromTag("br",n),wo.fromTag("br",n),...Ho(o)])})(e.previousSibling,e)}))}}));const gy=["fontWeight","fontStyle","color","fontSize","fontFamily"],hy=e=>ee(e,(e=>rg(e)&&"span"===e.inline&&(e=>p(e.styles)&&W(pe(e.styles),(e=>j(gy,e))))(e))),py=(e,t)=>{const o=e.get(t);return v(o)?hy(o):F.none()},fy=(e,t)=>ru(t,ml.fromRangeStart(e)).isNone(),vy=(e,t)=>!1===nu(t,ml.fromRangeEnd(e)).exists((e=>!hr(e.getNode())||nu(t,e).isSome())),by=e=>t=>xr(t)&&e.isEditable(t),yy=e=>Y((e=>{const t=e.getSelectedBlocks(),o=e.getRng();if(e.isCollapsed())return[];if(1===t.length)return fy(o,t[0])&&vy(o,t[0])?t:[];{const e=de(t).filter((e=>fy(o,e))).toArray(),n=me(t).filter((e=>vy(o,e))).toArray(),r=t.slice(1,-1);return e.concat(r).concat(n)}})(e),by(e.dom)),wy=e=>Y(e.getSelectedBlocks(),by(e.dom)),xy=Lt.each,Cy=e=>Qn(e)&&!Cu(e)&&!lu(e)&&!rr(e),Sy=(e,t)=>{for(let o=e;o;o=o[t]){if(lr(o)&&Xe(o.data))return e;if(Qn(o)&&!Cu(o))return o}return e},ky=(e,t,o)=>{const n=cb(e),r=er(t)&&e.dom.isEditable(t),s=er(o)&&e.dom.isEditable(o);if(r&&s){const r=Sy(t,"previousSibling"),s=Sy(o,"nextSibling");if(n.compare(r,s)){for(let e=r.nextSibling;e&&e!==s;){const t=e;e=e.nextSibling,r.appendChild(t)}return e.dom.remove(s),Lt.each(Lt.grep(s.childNodes),(e=>{r.appendChild(e)})),r}}return o},_y=(e,t,o,n)=>{var r;if(n&&!1!==t.merge_siblings){const t=null!==(r=ky(e,Uu(n),n))&&void 0!==r?r:n;ky(e,t,Uu(t,!0))}},Ey=(e,t,o)=>{xy(e.childNodes,(e=>{Cy(e)&&(t(e)&&o(e),e.hasChildNodes()&&Ey(e,t,o))}))},Ty=(e,t)=>o=>!(!o||!Xu(e,o,t)),Oy=(e,t,o)=>n=>{e.setStyle(n,t,o),""===n.getAttribute("style")&&n.removeAttribute("style"),((e,t)=>{"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)})(e,n)},Ay=Il([{keep:[]},{rename:["name"]},{removed:[]}]),Dy=/^(src|href|style)$/,My=Lt.each,Ny=Ku,Ry=(e,t,o)=>e.isChildOf(t,o)&&t!==o&&!e.isBlock(o),By=(e,t,o)=>{let n=t[o?"startContainer":"endContainer"],r=t[o?"startOffset":"endOffset"];if(Qn(n)){const e=n.childNodes.length-1;!o&&r&&r--,n=n.childNodes[r>e?e:r]}return lr(n)&&o&&r>=n.data.length&&(n=new Un(n,e.getBody()).next()||n),lr(n)&&!o&&0===r&&(n=new Un(n,e.getBody()).prev()||n),n},Ly=(e,t)=>{const o=t?"firstChild":"lastChild",n=e[o];return(e=>/^(TR|TH|TD)$/.test(e.nodeName))(e)&&n?"TR"===e.nodeName&&n[o]||n:e},Hy=(e,t,o,n)=>{var r;const s=e.create(o,n);return null===(r=t.parentNode)||void 0===r||r.insertBefore(s,t),s.appendChild(t),s},Iy=(e,t,o,n,r)=>{const s=wo.fromDom(t),a=wo.fromDom(e.create(n,r)),i=o?Lo(s):Bo(s);return yn(a,i),o?(hn(s,a),fn(a,s)):(pn(s,a),vn(a,s)),a.dom},Py=(e,t,o)=>{const n=t.parentNode;let r;const s=e.dom,a=sc(e);og(o)&&n===s.getRoot()&&(o.list_block&&Ny(t,o.list_block)||q(ue(t.childNodes),(t=>{Wu(e,a,t.nodeName.toLowerCase())?r?r.appendChild(t):(r=Hy(s,t,a),s.setAttribs(r,ac(e))):r=null}))),(e=>ng(e)&&rg(e)&&Ht(_e(e,"mixed"),!0))(o)&&!Ny(o.inline,t)||s.remove(t,!0)},Fy=(e,t,o)=>k(e)?{name:t,value:null}:{name:e,value:Gu(t,o)},zy=(e,t)=>{""===e.getAttrib(t,"style")&&(t.removeAttribute("style"),t.removeAttribute("data-mce-style"))},Vy=(e,t,o,n,r)=>{let s=!1;My(o.styles,((a,i)=>{const{name:l,value:c}=Fy(i,a,n),d=Yu(c,l);(o.remove_similar||b(c)||!Qn(r)||Ny(Xu(e,r,l),d))&&e.setStyle(t,l,""),s=!0})),s&&zy(e,t)},Zy=(e,t,o,n,r)=>{const s=e.dom,a=cb(e),i=e.schema;if(rg(t)&&Yr(i,t.inline)&&Jr(i,n)&&n.parentElement===e.getBody())return Py(e,n,t),Ay.removed();if(!t.ceFalseOverride&&n&&"false"===s.getContentEditableParent(n))return Ay.keep();if(n&&!Wb(s,n,t)&&!((e,t)=>t.links&&"A"===e.nodeName)(n,t))return Ay.keep();const l=n,c=t.preserve_attributes;if(rg(t)&&"all"===t.remove&&v(c)){const e=Y(s.getAttribs(l),(e=>j(c,e.name.toLowerCase())));if(s.removeAllAttribs(l),q(e,(e=>s.setAttrib(l,e.name,e.value))),e.length>0)return Ay.rename("span")}if("all"!==t.remove){Vy(s,l,t,o,r),My(t.attributes,((e,n)=>{const{name:a,value:i}=Fy(n,e,o);if(t.remove_similar||b(i)||!Qn(r)||Ny(s.getAttrib(r,a),i)){if("class"===a){const e=s.getAttrib(l,a);if(e){let t="";if(q(e.split(/\s+/),(e=>{/mce\-\w+/.test(e)&&(t+=(t?" ":"")+e)})),t)return void s.setAttrib(l,a,t)}}if(Dy.test(a)&&l.removeAttribute("data-mce-"+a),"style"===a&&or(["li"])(l)&&"none"===s.getStyle(l,"list-style-type"))return l.removeAttribute(a),void s.setStyle(l,"list-style-type","none");"class"===a&&l.removeAttribute("className"),l.removeAttribute(a)}})),My(t.classes,(e=>{e=Gu(e,o),Qn(r)&&!s.hasClass(r,e)||s.removeClass(l,e)}));const e=s.getAttribs(l);for(let t=0;tZy(e,t,o,n,n).fold(A(n),(t=>(e.dom.createFragment().appendChild(n),e.dom.rename(n,t))),A(null)),jy=(e,t,o,n,r)=>{const s=e.formatter.get(t),a=s[0],i=e.dom,l=e.selection,c=n=>{const i=((e,t,o,n,r)=>{let s;return t.parentNode&&q(Qu(e.dom,t.parentNode).reverse(),(t=>{if(!s&&Qn(t)&&"_start"!==t.id&&"_end"!==t.id){const a=qb(e,t,o,n,r);a&&!1!==a.split&&(s=t)}})),s})(e,n,t,o,r);return((e,t,o,n,r,s,a,i)=>{var l,c;let d,m;const u=e.dom;if(o){const s=o.parentNode;for(let o=n.parentNode;o&&o!==s;o=o.parentNode){let n=u.clone(o,!1);for(let o=0;oW(s,(n=>$y(e,n,o,t,t))),m=t=>{const o=ue(t.childNodes),n=d(t)||W(s,(e=>Wb(i,t,e))),r=t.parentNode;if(!n&&C(r)&&sg(a)&&d(r),a.deep&&o.length)for(let e=0;e{Qn(t)&&e.dom.getStyle(t,"text-decoration")===o&&t.parentNode&&Ju(i,t.parentNode)===o&&$y(e,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:o}},void 0,t)}))},u=e=>{const t=i.get(e?"_start":"_end");if(t){let o=t[e?"firstChild":"lastChild"];return(e=>Cu(e)&&Qn(e)&&("_start"===e.id||"_end"===e.id))(o)&&(o=o[e?"firstChild":"lastChild"]),lr(o)&&0===o.data.length&&(o=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),i.remove(t,!0),o}return null},g=t=>{let o,n,r=Cg(i,t,s,t.collapsed);if(a.split){if(r=wh(r),o=By(e,r,!0),n=By(e,r),o!==n){if(o=Ly(o,!0),n=Ly(n,!1),Ry(i,o,n)){const e=F.from(o.firstChild).getOr(o);return c(Iy(i,e,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void u(!0)}if(Ry(i,n,o)){const e=F.from(n.lastChild).getOr(n);return c(Iy(i,e,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void u(!1)}o=Hy(i,o,"span",{id:"_start","data-mce-type":"bookmark"}),n=Hy(i,n,"span",{id:"_end","data-mce-type":"bookmark"});const e=i.createRng();e.setStartAfter(o),e.setEndBefore(n),Sg(i,e,(e=>{q(e,(e=>{Cu(e)||Cu(e.parentNode)||c(e)}))})),c(o),c(n),o=u(!0),n=u()}else o=n=c(o);r.startContainer=o.parentNode?o.parentNode:o,r.startOffset=i.nodeIndex(o),r.endContainer=n.parentNode?n.parentNode:n,r.endOffset=i.nodeIndex(n)+1}Sg(i,r,(e=>{q(e,m)}))};if(n){if(Fu(n)){const e=i.createRng();e.setStartBefore(n),e.setEndAfter(n),g(e)}else g(n);Hg(e,t,n,o)}else l.isCollapsed()&&rg(a)&&!Du(e).length?ay(e,t,o,r):(Vu(e,(()=>Iu(e,g)),(n=>rg(a)&&Gb(e,t,o,n))),e.nodeChanged()),((e,t,o)=>{"removeformat"===t?q(wy(e.selection),(t=>{q(gy,(o=>e.dom.setStyle(t,o,""))),zy(e.dom,t)})):py(e.formatter,t).each((t=>{q(wy(e.selection),(n=>Vy(e.dom,n,t,o,null)))}))})(e,t,o),Hg(e,t,n,o)},Wy=(e,t,o,n,r)=>{(n||e.selection.isEditable())&&jy(e,t,o,n,r)},$y=(e,t,o,n,r)=>Zy(e,t,o,n,r).fold(I,(t=>(e.dom.rename(n,t),!0)),P),qy=Lt.each,Gy=(e,t,o,n)=>{qy(t,(t=>{rg(t)&&qy(e.dom.select(t.inline,n),(n=>{Cy(n)&&$y(e,t,o,n,t.exact?n:null)})),((e,t,o)=>{if(t.clear_child_styles){const n=t.links?"*:not(a)":"*";xy(e.select(n,o),(o=>{Cy(o)&&e.isEditable(o)&&xy(t.styles,((t,n)=>{e.setStyle(o,n,"")}))}))}})(e.dom,t,n)}))},Ky=Lt.each,Yy=(e,t,o,n)=>{if(Ky(o.styles,((o,r)=>{e.setStyle(t,r,Gu(o,n))})),o.styles){const o=e.getAttrib(t,"style");o&&e.setAttrib(t,"data-mce-style",o)}},Xy=(e,t,o,n)=>{const r=e.formatter.get(t),s=r[0],a=!n&&e.selection.isCollapsed(),i=e.dom,l=e.selection,c=(e,t=s)=>{S(t.onformat)&&t.onformat(e,t,o,n),Yy(i,e,t,o),Ky(t.attributes,((t,n)=>{i.setAttrib(e,n,Gu(t,o))})),Ky(t.classes,(t=>{const n=Gu(t,o);i.hasClass(e,n)||i.addClass(e,n)}))},d=(e,t)=>{let o=!1;return Ky(e,(e=>!(!ng(e)||("false"!==i.getContentEditable(t)||e.ceFalseOverride)&&(!C(e.collapsed)||e.collapsed===a)&&i.is(t,e.selector)&&!lu(t)&&(c(t,e),o=!0,1)))),o},m=e=>{if(h(e)){const t=i.create(e);return c(t),t}return null},u=(n,a,i)=>{const l=[];let u=!0;const g=s.inline||s.block,h=m(g),p=n=>(e=>og(e)&&!0===e.wrapper)(s)&&qb(e,n,t,o),f=(t,o,n)=>{const r=(e=>og(e)&&!0!==e.wrapper)(s)&&ju(e.schema,t)&&Wu(e,o,g);return n&&r};Sg(n,a,(t=>{let o;const a=t=>{let m=!1,v=u,b=!1;const y=t.parentNode,w=y.nodeName.toLowerCase(),x=n.getContentEditable(t);C(x)&&(v=u,u="true"===x,m=!0,b=qu(e,t));const S=u&&!m;if(hr(t)&&!((e,t,o,n)=>{if(jc(e)&&rg(t)&&o.parentNode){const t=Vs(e.schema),r=Vn(wo.fromDom(o),(e=>lu(e.dom)));return Te(t,n)&&Dr(e.schema,o.parentNode,{skipBogus:!1,includeZwsp:!0})&&!r}return!1})(e,s,t,w))return o=null,void(og(s)&&n.remove(t));if(p(t))o=null;else{if(f(t,w,S)){const e=n.rename(t,g);return c(e),l.push(e),void(o=null)}if(ng(s)){let e=d(r,t);if(!e&&C(y)&&sg(s)&&(e=d(r,y)),!rg(s)||e)return void(o=null)}C(h)&&((t,o,r,a)=>{const l=t.nodeName.toLowerCase(),c=Wu(e,g,l)&&Wu(e,o,g),d=!i&&lr(t)&&mi(t.data),m=lu(t),u=!rg(s)||!n.isBlock(t);return(r||a)&&c&&!d&&!m&&u})(t,w,S,b)?(o||(o=n.clone(h,!1),y.insertBefore(o,t),l.push(o)),b&&m&&(u=v),o.appendChild(t)):(o=null,q(ue(t.childNodes),a),m&&(u=v),o=null)}};q(t,a)})),!0===s.links&&q(l,(e=>{const t=e=>{"A"===e.nodeName&&c(e,s),q(ue(e.childNodes),t)};t(e)})),q(l,(a=>{const i=(e=>{let t=0;return q(e.childNodes,(e=>{(e=>C(e)&&lr(e)&&0===e.length)(e)||Cu(e)||t++})),t})(a);!(l.length>1)&&n.isBlock(a)||0!==i?(rg(s)||og(s)&&s.wrapper)&&(s.exact||1!==i||(a=(e=>{const t=ee(e.childNodes,zu).filter((e=>"false"!==n.getContentEditable(e)&&Wb(n,e,s)));return t.map((t=>{const o=n.clone(t,!1);return c(o),n.replace(o,e,!0),n.remove(t,!0),o})).getOr(e)})(a)),Gy(e,r,o,a),((e,t,o,n,r)=>{const s=r.parentNode;qb(e,s,o,n)&&$y(e,t,n,r)||t.merge_with_parents&&s&&e.dom.getParent(s,(s=>!!qb(e,s,o,n)&&($y(e,t,n,r),!0)))})(e,s,t,o,a),((e,t,o,n)=>{if(t.styles&&t.styles.backgroundColor){const r=Ty(e,"fontSize");Ey(n,(t=>r(t)&&e.isEditable(t)),Oy(e,"backgroundColor",Gu(t.styles.backgroundColor,o)))}})(n,s,o,a),((e,t,o,n)=>{const r=t=>{if(er(t)&&Qn(t.parentNode)&&e.isEditable(t)){const o=Ju(e,t.parentNode);e.getStyle(t,"color")&&o?e.setStyle(t,"text-decoration",o):e.getStyle(t,"text-decoration")===o&&e.setStyle(t,"text-decoration",null)}};t.styles&&(t.styles.color||t.styles.textDecoration)&&(Lt.walk(n,r,"childNodes"),r(n))})(n,s,0,a),((e,t,o,n)=>{if(rg(t)&&("sub"===t.inline||"sup"===t.inline)){const o=Ty(e,"fontSize");Ey(n,(t=>o(t)&&e.isEditable(t)),Oy(e,"fontSize",""));const r=Y(e.select("sup"===t.inline?"sub":"sup",n),e.isEditable);e.remove(r,!0)}})(n,s,0,a),_y(e,s,0,a)):n.remove(a,!0)}))},g=Fu(n)?n:l.getNode();if("false"===i.getContentEditable(g)&&!qu(e,g))return d(r,n=g),void Lg(e,t,n,o);if(s){if(n)if(Fu(n)){if(!d(r,n)){const e=i.createRng();e.setStartBefore(n),e.setEndAfter(n),u(i,Cg(i,e,r),!0)}}else u(i,n,!0);else a&&rg(s)&&!Du(e).length?((e,t,o)=>{let n;const r=e.selection,s=e.formatter.get(t);if(!s)return;const a=r.getRng();let i=a.startOffset;const l=a.startContainer.nodeValue;n=cu(e.getBody(),r.getStart());const c=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(l&&i>0&&i{Iu(e,((e,t)=>{const o=t?e:Cg(i,e,r);u(i,o,!1)}))}),P),e.nodeChanged()),py(e.formatter,t).each((t=>{q(yy(e.selection),(e=>Yy(i,e,t,o)))}));((e,t)=>{Ee(my,e)&&q(my[e],(e=>{e(t)}))})(t,e)}Lg(e,t,n,o)},Jy=(e,t,o,n)=>{(n||e.selection.isEditable())&&Xy(e,t,o,n)},Qy=e=>Ee(e,"vars"),ew=e=>e.selection.getStart(),tw=(e,t,o,n,r)=>Q(t,(t=>{const s=e.formatter.matchNode(t,o,null!=r?r:{},n);return!w(s)}),(t=>!!Ub(e,t,o)||!n&&C(e.formatter.matchNode(t,o,r,!0)))),ow=(e,t)=>{const o=null!=t?t:ew(e);return Y(Qu(e.dom,o),(e=>Qn(e)&&!rr(e)))},nw=(e,t,o)=>{const n=ow(e,t);ve(o,((o,r)=>{const s=o=>{const s=tw(e,n,r,o.similar,Qy(o)?o.vars:void 0),a=s.isSome();if(o.state.get()!==a){o.state.set(a);const e=s.getOr(t);Qy(o)?o.callback(a,{node:e,format:r,parents:n}):q(o.callbacks,(t=>t(a,{node:e,format:r,parents:n})))}};q([o.withSimilar,o.withoutSimilar],s),q(o.withVars,s)}))},rw=(e,t,o,n,r,s)=>(((e,t,o,n,r,s)=>{const a=t.get();q(o.split(","),(t=>{const o=_e(a,t).getOrThunk((()=>{const e={withSimilar:{state:Rr(!1),similar:!0,callbacks:[]},withoutSimilar:{state:Rr(!1),similar:!1,callbacks:[]},withVars:[]};return a[t]=e,e})),i=()=>{const o=ow(e);return tw(e,o,t,r,s).isSome()};if(w(s)){const e=r?o.withSimilar:o.withoutSimilar;e.callbacks.push(n),1===e.callbacks.length&&e.state.set(i())}else o.withVars.push({state:Rr(i()),similar:r,vars:s,callback:n})})),t.set(a)})(e,t,o,n,r,s),{unbind:()=>((e,t,o)=>{const n=e.get();q(t.split(","),(e=>_e(n,e).each((t=>{n[e]={withSimilar:{...t.withSimilar,callbacks:Y(t.withSimilar.callbacks,(e=>e!==o))},withoutSimilar:{...t.withoutSimilar,callbacks:Y(t.withoutSimilar.callbacks,(e=>e!==o))},withVars:Y(t.withVars,(e=>e.callback!==o))}})))),e.set(n)})(t,o,n)}),sw=Lt.explode,aw=()=>{const e={};return{addFilter:(t,o)=>{q(sw(t),(t=>{Ee(e,t)||(e[t]={name:t,callbacks:[]}),e[t].callbacks.push(o)}))},getFilters:()=>ke(e),removeFilter:(t,o)=>{q(sw(t),(t=>{if(Ee(e,t))if(C(o)){const n=e[t],r=Y(n.callbacks,(e=>e!==o));r.length>0?n.callbacks=r:delete e[t]}else delete e[t]}))}}},iw=(e,t,o)=>{e.addNodeFilter("font",(e=>{q(e,(e=>{const n=t.parse(e.attr("style")),r=e.attr("color"),s=e.attr("face"),a=e.attr("size");r&&(n.color=r),s&&(n["font-family"]=s),a&&Qe(a).each((e=>{n["font-size"]=o[e-1]})),e.name="span",e.attr("style",t.serialize(n)),((e,t)=>{q(t,(t=>{e.attr(t,null)}))})(e,["color","face","size"])}))}))},lw=(e,t,o)=>{var n;const r=Qs();t.convert_fonts_to_spans&&iw(e,r,Lt.explode(null!==(n=t.font_size_legacy_values)&&void 0!==n?n:"")),((e,t,o)=>{e.addNodeFilter("strike",(e=>{const n="html4"!==t.type;q(e,(e=>{if(n)e.name="s";else{const t=o.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",o.serialize(t))}}))}))})(e,o,r)},cw=e=>{const[t,...o]=e.split(","),n=o.join(","),r=/data:([^/]+\/[^;]+)(;.+)?/.exec(t);if(r){const e=";base64"===r[2],t=e?(e=>{const t=/([a-z0-9+\/=\s]+)/i.exec(e);return t?t[1]:""})(n):decodeURIComponent(n);return F.some({type:r[1],data:t,base64Encoded:e})}return F.none()},dw=(e,t,o=!0)=>{let n=t;if(o)try{n=atob(t)}catch(e){return F.none()}const r=new Uint8Array(n.length);for(let e=0;e{return We(e,"blob:")?(e=>fetch(e).then((e=>e.ok?e.blob():Promise.reject())).catch((()=>Promise.reject({message:`Cannot convert ${e} to Blob. Resource might not exist or is inaccessible.`,uriType:"blob"}))))(e):We(e,"data:")?(t=e,new Promise(((e,o)=>{cw(t).bind((({type:e,data:t,base64Encoded:o})=>dw(e,t,o))).fold((()=>o("Invalid data URI")),e)}))):Promise.reject("Unknown URI format");var t},uw=e=>new Promise(((t,o)=>{const n=new FileReader;n.onloadend=()=>{t(n.result)},n.onerror=()=>{var e;o(null===(e=n.error)||void 0===e?void 0:e.message)},n.readAsDataURL(e)}));let gw=0;const hw=(e,t,o)=>cw(e).bind((({data:e,type:n,base64Encoded:r})=>{if(t&&!r)return F.none();{const t=r?e:btoa(e);return o(t,n)}})),pw=(e,t,o)=>{const n=e.create("blobid"+gw++,t,o);return e.add(n),n},fw=(e,t,o=!1)=>hw(t,o,((t,o)=>F.from(e.getByData(t,o)).orThunk((()=>dw(o,t).map((o=>pw(e,o,t))))))),vw=/^(?:(?:(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)([A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*))(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+)?)?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+)?)?)$/,bw=e=>F.from(e.match(vw)).bind((e=>ce(e,1))).map((e=>We(e,"www.")?e.substring(4):e)),yw=(e,t)=>{F.from(e.attr("src")).bind(bw).forall((e=>!j(t,e)))&&e.attr("sandbox","")},ww=(e,t)=>We(e,`${t}/`),xw=({type:e,src:t,width:o,height:n}={},r,s)=>{const a=(e=>w(e)?"iframe":ww(e,"image")?"img":ww(e,"video")?"video":ww(e,"audio")?"audio":"iframe")(e),i=new Dp(a,1);return i.attr("audio"===a?{src:t}:{src:t,width:o,height:n}),"audio"!==a&&"video"!==a||i.attr("controls",""),"iframe"===a&&r&&yw(i,s),i},Cw=(e,t)=>{const{blob_cache:o}=t;if(o){const t=e=>{const t=e.attr("src");(e=>e.attr("src")===Mt.transparentSrc||C(e.attr("data-mce-placeholder")))(e)||(e=>C(e.attr("data-mce-bogus")))(e)||x(t)||fw(o,t,!0).each((t=>{e.attr("src",t.blobUri())}))};e.addAttributeFilter("src",(e=>q(e,t)))}},{entries:Sw,setPrototypeOf:kw,isFrozen:_w,getPrototypeOf:Ew,getOwnPropertyDescriptor:Tw}=Object;let{freeze:Ow,seal:Aw,create:Dw}=Object,{apply:Mw,construct:Nw}="undefined"!=typeof Reflect&&Reflect;Mw||(Mw=function(e,t,o){return e.apply(t,o)}),Ow||(Ow=function(e){return e}),Aw||(Aw=function(e){return e}),Nw||(Nw=function(e,t){return new e(...t)});const Rw=Ww(Array.prototype.forEach),Bw=Ww(Array.prototype.pop),Lw=Ww(Array.prototype.push),Hw=Ww(String.prototype.toLowerCase),Iw=Ww(String.prototype.toString),Pw=Ww(String.prototype.match),Fw=Ww(String.prototype.replace),zw=Ww(String.prototype.indexOf),Vw=Ww(String.prototype.trim),Zw=Ww(RegExp.prototype.test),Uw=(jw=TypeError,function(){for(var e=arguments.length,t=new Array(e),o=0;o1?o-1:0),r=1;r/gm),lx=Aw(/\${[\w\W]*}/gm),cx=Aw(/^data-[\-\w.\u00B7-\uFFFF]/),dx=Aw(/^aria-[\-\w]+$/),mx=Aw(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ux=Aw(/^(?:\w+script|data):/i),gx=Aw(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),hx=Aw(/^html$/i);var px=Object.freeze({__proto__:null,MUSTACHE_EXPR:ax,ERB_EXPR:ix,TMPLIT_EXPR:lx,DATA_ATTR:cx,ARIA_ATTR:dx,IS_ALLOWED_URI:mx,IS_SCRIPT_OR_DATA:ux,ATTR_WHITESPACE:gx,DOCTYPE_NAME:hx});const fx=()=>"undefined"==typeof window?null:window;var vx=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fx();const o=t=>e(t);if(o.version="3.0.5",o.removed=[],!t||!t.document||9!==t.document.nodeType)return o.isSupported=!1,o;const n=t.document,r=n.currentScript;let{document:s}=t;const{DocumentFragment:a,HTMLTemplateElement:i,Node:l,Element:c,NodeFilter:d,NamedNodeMap:m=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:u,DOMParser:g,trustedTypes:h}=t,p=c.prototype,f=Gw(p,"cloneNode"),v=Gw(p,"nextSibling"),b=Gw(p,"childNodes"),y=Gw(p,"parentNode");if("function"==typeof i){const e=s.createElement("template");e.content&&e.content.ownerDocument&&(s=e.content.ownerDocument)}let w,x="";const{implementation:C,createNodeIterator:S,createDocumentFragment:k,getElementsByTagName:_}=s,{importNode:E}=n;let T={};o.isSupported="function"==typeof Sw&&"function"==typeof y&&C&&void 0!==C.createHTMLDocument;const{MUSTACHE_EXPR:O,ERB_EXPR:A,TMPLIT_EXPR:D,DATA_ATTR:M,ARIA_ATTR:N,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:B}=px;let{IS_ALLOWED_URI:L}=px,H=null;const I=$w({},[...Kw,...Yw,...Xw,...Qw,...tx]);let P=null;const F=$w({},[...ox,...nx,...rx,...sx]);let z=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),V=null,Z=null,U=!0,j=!0,W=!1,$=!0,q=!1,G=!1,K=!1,Y=!1,X=!1,J=!1,Q=!1,ee=!0,te=!1,oe=!0,ne=!1,re={},se=null;const ae=$w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ie=null;const le=$w({},["audio","video","img","source","image","track"]);let ce=null;const de=$w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),me="http://www.w3.org/1998/Math/MathML",ue="http://www.w3.org/2000/svg",ge="http://www.w3.org/1999/xhtml";let he=ge,pe=!1,fe=null;const ve=$w({},[me,ue,ge],Iw);let be;const ye=["application/xhtml+xml","text/html"];let we,xe=null;const Ce=s.createElement("form"),Se=function(e){return e instanceof RegExp||e instanceof Function},ke=function(e){if(!xe||xe!==e){if(e&&"object"==typeof e||(e={}),e=qw(e),be=be=-1===ye.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,we="application/xhtml+xml"===be?Iw:Hw,H="ALLOWED_TAGS"in e?$w({},e.ALLOWED_TAGS,we):I,P="ALLOWED_ATTR"in e?$w({},e.ALLOWED_ATTR,we):F,fe="ALLOWED_NAMESPACES"in e?$w({},e.ALLOWED_NAMESPACES,Iw):ve,ce="ADD_URI_SAFE_ATTR"in e?$w(qw(de),e.ADD_URI_SAFE_ATTR,we):de,ie="ADD_DATA_URI_TAGS"in e?$w(qw(le),e.ADD_DATA_URI_TAGS,we):le,se="FORBID_CONTENTS"in e?$w({},e.FORBID_CONTENTS,we):ae,V="FORBID_TAGS"in e?$w({},e.FORBID_TAGS,we):{},Z="FORBID_ATTR"in e?$w({},e.FORBID_ATTR,we):{},re="USE_PROFILES"in e&&e.USE_PROFILES,U=!1!==e.ALLOW_ARIA_ATTR,j=!1!==e.ALLOW_DATA_ATTR,W=e.ALLOW_UNKNOWN_PROTOCOLS||!1,$=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,q=e.SAFE_FOR_TEMPLATES||!1,G=e.WHOLE_DOCUMENT||!1,X=e.RETURN_DOM||!1,J=e.RETURN_DOM_FRAGMENT||!1,Q=e.RETURN_TRUSTED_TYPE||!1,Y=e.FORCE_BODY||!1,ee=!1!==e.SANITIZE_DOM,te=e.SANITIZE_NAMED_PROPS||!1,oe=!1!==e.KEEP_CONTENT,ne=e.IN_PLACE||!1,L=e.ALLOWED_URI_REGEXP||mx,he=e.NAMESPACE||ge,z=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(z.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(z.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(z.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(j=!1),J&&(X=!0),re&&(H=$w({},[...tx]),P=[],!0===re.html&&($w(H,Kw),$w(P,ox)),!0===re.svg&&($w(H,Yw),$w(P,nx),$w(P,sx)),!0===re.svgFilters&&($w(H,Xw),$w(P,nx),$w(P,sx)),!0===re.mathMl&&($w(H,Qw),$w(P,rx),$w(P,sx))),e.ADD_TAGS&&(H===I&&(H=qw(H)),$w(H,e.ADD_TAGS,we)),e.ADD_ATTR&&(P===F&&(P=qw(P)),$w(P,e.ADD_ATTR,we)),e.ADD_URI_SAFE_ATTR&&$w(ce,e.ADD_URI_SAFE_ATTR,we),e.FORBID_CONTENTS&&(se===ae&&(se=qw(se)),$w(se,e.FORBID_CONTENTS,we)),oe&&(H["#text"]=!0),G&&$w(H,["html","head","body"]),H.table&&($w(H,["tbody"]),delete V.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Uw('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Uw('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,x=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let o=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(o=t.getAttribute(n));const r="dompurify"+(o?"#"+o:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(h,r)),null!==w&&"string"==typeof x&&(x=w.createHTML(""));Ow&&Ow(e),xe=e}},_e=$w({},["mi","mo","mn","ms","mtext"]),Ee=$w({},["foreignobject","desc","title","annotation-xml"]),Te=$w({},["title","style","font","a","script"]),Oe=$w({},Yw);$w(Oe,Xw),$w(Oe,Jw);const Ae=$w({},Qw);$w(Ae,ex);const De=function(e){Lw(o.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},Me=function(e,t){try{Lw(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Lw(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!P[e])if(X||J)try{De(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Ne=function(e){let t,o;if(Y)e=""+e;else{const t=Pw(e,/^[\r\n\t ]+/);o=t&&t[0]}"application/xhtml+xml"===be&&he===ge&&(e=''+e+"");const n=w?w.createHTML(e):e;if(he===ge)try{t=(new g).parseFromString(n,be)}catch(e){}if(!t||!t.documentElement){t=C.createDocument(he,"template",null);try{t.documentElement.innerHTML=pe?x:n}catch(e){}}const r=t.body||t.documentElement;return e&&o&&r.insertBefore(s.createTextNode(o),r.childNodes[0]||null),he===ge?_.call(t,G?"html":"body")[0]:G?t.documentElement:r},Re=function(e){return S.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT,null,!1)},Be=function(e){return"object"==typeof l?e instanceof l:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Le=function(e,t,n){T[e]&&Rw(T[e],(e=>{e.call(o,t,n,xe)}))},He=function(e){let t;if(Le("beforeSanitizeElements",e,null),(n=e)instanceof u&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof m)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return De(e),!0;var n;const r=we(e.nodeName);if(Le("uponSanitizeElement",e,{tagName:r,allowedTags:H}),e.hasChildNodes()&&!Be(e.firstElementChild)&&(!Be(e.content)||!Be(e.content.firstElementChild))&&Zw(/<[/\w]/g,e.innerHTML)&&Zw(/<[/\w]/g,e.textContent))return De(e),!0;if(!H[r]||V[r]){if(!V[r]&&Pe(r)){if(z.tagNameCheck instanceof RegExp&&Zw(z.tagNameCheck,r))return!1;if(z.tagNameCheck instanceof Function&&z.tagNameCheck(r))return!1}if(oe&&!se[r]){const t=y(e)||e.parentNode,o=b(e)||e.childNodes;if(o&&t)for(let n=o.length-1;n>=0;--n)t.insertBefore(f(o[n],!0),v(e))}return De(e),!0}return e instanceof c&&!function(e){let t=y(e);t&&t.tagName||(t={namespaceURI:he,tagName:"template"});const o=Hw(e.tagName),n=Hw(t.tagName);return!!fe[e.namespaceURI]&&(e.namespaceURI===ue?t.namespaceURI===ge?"svg"===o:t.namespaceURI===me?"svg"===o&&("annotation-xml"===n||_e[n]):Boolean(Oe[o]):e.namespaceURI===me?t.namespaceURI===ge?"math"===o:t.namespaceURI===ue?"math"===o&&Ee[n]:Boolean(Ae[o]):e.namespaceURI===ge?!(t.namespaceURI===ue&&!Ee[n])&&!(t.namespaceURI===me&&!_e[n])&&!Ae[o]&&(Te[o]||!Oe[o]):!("application/xhtml+xml"!==be||!fe[e.namespaceURI]))}(e)?(De(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!Zw(/<\/no(script|embed|frames)/i,e.innerHTML)?(q&&3===e.nodeType&&(t=e.textContent,t=Fw(t,O," "),t=Fw(t,A," "),t=Fw(t,D," "),e.textContent!==t&&(Lw(o.removed,{element:e.cloneNode()}),e.textContent=t)),Le("afterSanitizeElements",e,null),!1):(De(e),!0)},Ie=function(e,t,o){if(ee&&("id"===t||"name"===t)&&(o in s||o in Ce))return!1;if(j&&!Z[t]&&Zw(M,t));else if(U&&Zw(N,t));else if(!P[t]||Z[t]){if(!(Pe(e)&&(z.tagNameCheck instanceof RegExp&&Zw(z.tagNameCheck,e)||z.tagNameCheck instanceof Function&&z.tagNameCheck(e))&&(z.attributeNameCheck instanceof RegExp&&Zw(z.attributeNameCheck,t)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(t))||"is"===t&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&Zw(z.tagNameCheck,o)||z.tagNameCheck instanceof Function&&z.tagNameCheck(o))))return!1}else if(ce[t]);else if(Zw(L,Fw(o,B,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==zw(o,"data:")||!ie[e])if(W&&!Zw(R,Fw(o,B,"")));else if(o)return!1;return!0},Pe=function(e){return e.indexOf("-")>0},Fe=function(e){let t,o,n,r;Le("beforeSanitizeAttributes",e,null);const{attributes:s}=e;if(!s)return;const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:P};for(r=s.length;r--;){t=s[r];const{name:i,namespaceURI:l}=t;o="value"===i?t.value:Vw(t.value);const c=o;if(n=we(i),a.attrName=n,a.attrValue=o,a.keepAttr=!0,a.forceKeepAttr=void 0,Le("uponSanitizeAttribute",e,a),o=a.attrValue,a.forceKeepAttr)continue;if(!a.keepAttr){Me(i,e);continue}if(!$&&Zw(/\/>/i,o)){Me(i,e);continue}q&&(o=Fw(o,O," "),o=Fw(o,A," "),o=Fw(o,D," "));const d=we(e.nodeName);if(Ie(d,n,o)){if(!te||"id"!==n&&"name"!==n||(Me(i,e),o="user-content-"+o),w&&"object"==typeof h&&"function"==typeof h.getAttributeType)if(l);else switch(h.getAttributeType(d,n)){case"TrustedHTML":o=w.createHTML(o);break;case"TrustedScriptURL":o=w.createScriptURL(o)}if(o!==c)try{l?e.setAttributeNS(l,i,o):e.setAttribute(i,o)}catch(t){Me(i,e)}}else Me(i,e)}Le("afterSanitizeAttributes",e,null)},ze=function e(t){let o;const n=Re(t);for(Le("beforeSanitizeShadowDOM",t,null);o=n.nextNode();)Le("uponSanitizeShadowNode",o,null),He(o)||(o.content instanceof a&&e(o.content),Fe(o));Le("afterSanitizeShadowDOM",t,null)};return o.sanitize=function(e){let t,r,s,i,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(pe=!e,pe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Be(e)){if("function"!=typeof e.toString)throw Uw("toString is not a function");if("string"!=typeof(e=e.toString()))throw Uw("dirty is not a string, aborting")}if(!o.isSupported)return e;if(K||ke(c),o.removed=[],"string"==typeof e&&(ne=!1),ne){if(e.nodeName){const t=we(e.nodeName);if(!H[t]||V[t])throw Uw("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)t=Ne("\x3c!----\x3e"),r=t.ownerDocument.importNode(e,!0),1===r.nodeType&&"BODY"===r.nodeName||"HTML"===r.nodeName?t=r:t.appendChild(r);else{if(!X&&!q&&!G&&-1===e.indexOf("<"))return w&&Q?w.createHTML(e):e;if(t=Ne(e),!t)return X?null:Q?x:""}t&&Y&&De(t.firstChild);const d=Re(ne?e:t);for(;s=d.nextNode();)He(s)||(s.content instanceof a&&ze(s.content),Fe(s));if(ne)return e;if(X){if(J)for(i=k.call(t.ownerDocument);t.firstChild;)i.appendChild(t.firstChild);else i=t;return(P.shadowroot||P.shadowrootmode)&&(i=E.call(n,i,!0)),i}let m=G?t.outerHTML:t.innerHTML;return G&&H["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&Zw(hx,t.ownerDocument.doctype.name)&&(m="\n"+m),q&&(m=Fw(m,O," "),m=Fw(m,A," "),m=Fw(m,D," ")),w&&Q?w.createHTML(m):m},o.setConfig=function(e){ke(e),K=!0},o.clearConfig=function(){xe=null,K=!1},o.isValidAttribute=function(e,t,o){xe||ke({});const n=we(e),r=we(t);return Ie(n,r,o)},o.addHook=function(e,t){"function"==typeof t&&(T[e]=T[e]||[],Lw(T[e],t))},o.removeHook=function(e){if(T[e])return Bw(T[e])},o.removeHooks=function(e){T[e]&&(T[e]=[])},o.removeAllHooks=function(){T={}},o}();const bx=Lt.each,yx=Lt.trim,wx=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],xx={ftp:21,http:80,https:443,mailto:25},Cx=["img","video"],Sx=(e,t,o)=>{const n=(e=>{try{return decodeURIComponent(e)}catch(t){return unescape(e)}})(t).replace(/\s/g,"");return!e.allow_script_urls&&(!!/((java|vb)script|mhtml):/i.test(n)||!e.allow_html_data_urls&&(/^data:image\//i.test(n)?((e,t)=>C(e)?!e:!C(t)||!j(Cx,t))(e.allow_svg_data_urls,o)&&/^data:image\/svg\+xml/i.test(n):/^data:/i.test(n)))};class kx{static parseDataUri(e){let t;const o=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(o[0]);return n&&(t=n[1]),{type:t,data:o[1]}}static isDomSafe(e,t,o={}){if(o.allow_script_urls)return!0;{const n=ks.decode(e).replace(/[\s\u0000-\u001F]+/g,"");return!Sx(o,n,t)}}static getDocumentBaseUrl(e){var t;let o;return o=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?null!==(t=e.href)&&void 0!==t?t:"":e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(o)&&(o=o.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(o)||(o+="/")),o}constructor(e,t={}){this.path="",this.directory="",e=yx(e),this.settings=t;const o=t.base_uri,n=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(n.source=e);const r=0===e.indexOf("//");if(0!==e.indexOf("/")||r||(e=(o&&o.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){const t=o?o.path:new kx(document.location.href).directory;if(""===(null==o?void 0:o.protocol))e="//mce_host"+n.toAbsPath(t,e);else{const r=/([^#?]*)([#?]?.*)/.exec(e);r&&(e=(o&&o.protocol||"http")+"://mce_host"+n.toAbsPath(t,r[1])+r[2])}}e=e.replace(/@@/g,"(mce_at)");const s=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);s&&bx(wx,((e,t)=>{let o=s[t];o&&(o=o.replace(/\(mce_at\)/g,"@@")),n[e]=o})),o&&(n.protocol||(n.protocol=o.protocol),n.userInfo||(n.userInfo=o.userInfo),n.port||"mce_host"!==n.host||(n.port=o.port),n.host&&"mce_host"!==n.host||(n.host=o.host),n.source=""),r&&(n.protocol="")}setPath(e){const t=/^(.*?)\/?(\w+)?$/.exec(e);t&&(this.path=t[0],this.directory=t[1],this.file=t[2]),this.source="",this.getURI()}toRelative(e){if("./"===e)return e;const t=new kx(e,{base_uri:this});if("mce_host"!==t.host&&this.host!==t.host&&t.host||this.port!==t.port||this.protocol!==t.protocol&&""!==t.protocol)return t.getURI();const o=this.getURI(),n=t.getURI();if(o===n||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===n)return o;let r=this.toRelPath(this.path,t.path);return t.query&&(r+="?"+t.query),t.anchor&&(r+="#"+t.anchor),r}toAbsolute(e,t){const o=new kx(e,{base_uri:this});return o.getURI(t&&this.isSameOrigin(o))}isSameOrigin(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;const t=this.protocol?xx[this.protocol]:null;if(t&&(this.port||t)==(e.port||t))return!0}return!1}toRelPath(e,t){let o,n,r=0,s="";const a=e.substring(0,e.lastIndexOf("/")).split("/"),i=t.split("/");if(a.length>=i.length)for(o=0,n=a.length;o=i.length||a[o]!==i[o]){r=o+1;break}if(a.length=a.length||a[o]!==i[o]){r=o+1;break}if(1===r)return t;for(o=0,n=a.length-(r-1);o{e&&a.push(e)}));const i=[];for(let e=s.length-1;e>=0;e--)0!==s[e].length&&"."!==s[e]&&(".."!==s[e]?o>0?o--:i.push(s[e]):o++);const l=a.length-o;let c;return c=l<=0?se(i).join("/"):a.slice(0,l).join("/")+"/"+se(i).join("/"),0!==c.indexOf("/")&&(c="/"+c),n&&c.lastIndexOf("/")!==c.length-1&&(c+=n),c}getURI(e=!1){let t;return this.source&&!e||(t="",e||(this.protocol?t+=this.protocol+"://":t+="//",this.userInfo&&(t+=this.userInfo+"@"),this.host&&(t+=this.host),this.port&&(t+=":"+this.port)),this.path&&(t+=this.path),this.query&&(t+="?"+this.query),this.anchor&&(t+="#"+this.anchor),this.source=t),this.source}}const _x=Lt.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),Ex="data-mce-type";let Tx=0;const Ox=(e,t,o,n,r)=>{var s,a,i,l;const c=t.validate,d=o.getSpecialElements();8===e.nodeType&&!t.allow_conditional_comments&&/^\[if/i.test(null!==(s=e.nodeValue)&&void 0!==s?s:"")&&(e.nodeValue=" "+e.nodeValue);const m=null!==(a=null==r?void 0:r.tagName)&&void 0!==a?a:e.nodeName.toLowerCase();if("html"!==n&&o.isValid(n))return void(C(r)&&(r.allowedTags[m]=!0));if(1!==e.nodeType||"body"===m)return;const u=wo.fromDom(e),g=so(u,Ex),p=no(u,"data-mce-bogus");if(!g&&h(p))return void("all"===p?xn(u):Cn(u));const f=o.getElementRule(m);if(!c||f){if(C(r)&&(r.allowedTags[m]=!0),c&&f&&!g){if(q(null!==(i=f.attributesForced)&&void 0!==i?i:[],(e=>{to(u,e.name,"{$uid}"===e.value?"mce_"+Tx++:e.value)})),q(null!==(l=f.attributesDefault)&&void 0!==l?l:[],(e=>{so(u,e.name)||to(u,e.name,"{$uid}"===e.value?"mce_"+Tx++:e.value)})),f.attributesRequired&&!W(f.attributesRequired,(e=>so(u,e))))return void Cn(u);if(f.removeEmptyAttrs&&(e=>{const t=e.dom.attributes;return null==t||0===t.length})(u))return void Cn(u);f.outputName&&f.outputName!==m&&qa(u,f.outputName)}}else Ee(d,m)?xn(u):Cn(u)},Ax=(e,t,o,n,r,s)=>"html"!==o&&!Ir(n)||!(r in _x&&Sx(e,s,n))&&(!e.validate||t.isValid(n,r)||We(r,"data-")||We(r,"aria-")),Dx=(e,t)=>e.hasAttribute(Ex)&&("id"===t||"class"===t||"style"===t),Mx=(e,t)=>e in t.getBoolAttrs(),Nx=(e,t,o,n)=>{const{attributes:r}=e;for(let s=r.length-1;s>=0;s--){const a=r[s],i=a.name,l=a.value;Ax(t,o,n,e.tagName.toLowerCase(),i,l)||Dx(e,i)?Mx(i,o)&&e.setAttribute(i,i):e.removeAttribute(i)}},Rx=(e,t,o)=>{const n=vx();return n.addHook("uponSanitizeElement",((n,r)=>{Ox(n,e,t,o.track(n),r)})),n.addHook("uponSanitizeAttribute",((n,r)=>{((e,t,o,n,r)=>{const s=e.tagName.toLowerCase(),{attrName:a,attrValue:i}=r;r.keepAttr=Ax(t,o,n,s,a,i),r.keepAttr?(r.allowedAttributes[a]=!0,Mx(a,o)&&(r.attrValue=a),t.allow_svg_data_urls&&We(i,"data:image/svg+xml")&&(r.forceKeepAttr=!0)):Dx(e,a)&&(r.forceKeepAttr=!0)})(n,e,t,o.current(),r)})),n},Bx=e=>{const t=Fr(e);if("svg"===t){const t=["type","href","role","arcrole","title","show","actuate","label","from","to"].map((e=>`xlink:${e}`)),o={IN_PLACE:!0,USE_PROFILES:{html:!0,svg:!0,svgFilters:!0},ALLOWED_ATTR:t};vx().sanitize(e,o)}else{if("math"!==t)throw new Error("Not a namespace element");{const t={IN_PLACE:!0,USE_PROFILES:{mathMl:!0}};vx().sanitize(e,t)}}},Lx=(e,t)=>{const o=(()=>{const e=Lr(),t=()=>e.get().map(Fr).getOr("html");return{track:o=>(Pr(o)?e.set(o):e.get().exists((e=>!e.contains(o)))&&e.clear(),t()),current:t,reset:()=>{e.clear()}}})();if(e.sanitize){const n=Rx(e,t,o),r=(t,r)=>{n.sanitize(t,((e,t)=>{const o={IN_PLACE:!0,ALLOW_UNKNOWN_PROTOCOLS:!0,ALLOWED_TAGS:["#comment","#cdata-section","body"],ALLOWED_ATTR:[]};return o.PARSER_MEDIA_TYPE=t,e.allow_script_urls?o.ALLOWED_URI_REGEXP=/.*/:e.allow_html_data_urls&&(o.ALLOWED_URI_REGEXP=/^(?!(\w+script|mhtml):)/i),o})(e,r)),n.removed=[],o.reset()};return{sanitizeHtmlElement:r,sanitizeNamespaceElement:Bx}}return{sanitizeHtmlElement:(n,r)=>{const s=document.createNodeIterator(n,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_TEXT);let a;for(;a=s.nextNode();){const n=o.track(a);Ox(a,e,t,n),Qn(a)&&Nx(a,e,t,n)}o.reset()},sanitizeNamespaceElement:E}},Hx=Lt.makeMap,Ix=Lt.extend,Px=(e,t,o,n)=>{const r=e.name,s=r in o&&"title"!==r&&"textarea"!==r&&"noscript"!==r,a=t.childNodes;for(let t=0,r=a.length;t{const r=o.validate,s=t.getNonEmptyElements(),a=t.getWhitespaceElements(),i=Ix(Hx("script,style,head,html,body,title,meta,param"),t.getBlockElements()),l=Vs(t),c=/[ \t\r\n]+/g,d=/^[ \t\r\n]+/,m=/[ \t\r\n]+$/,u=e=>{let t=e.parent;for(;C(t);){if(t.name in a)return!0;t=t.parent}return!1},g=o=>o.name in i||es(t,o)||Ir(o.name)&&o.parent===e,h=(t,o)=>{const r=o?t.prev:t.next;return!C(r)&&!x(t.parent)&&g(t.parent)&&(t.parent!==e||!0===n.isRootContent)};return[e=>{var t;if(3===e.type&&!u(e)){let o=null!==(t=e.value)&&void 0!==t?t:"";o=o.replace(c," "),(((e,t)=>C(e)&&(t(e)||"br"===e.name))(e.prev,g)||h(e,!0))&&(o=o.replace(d,"")),0===o.length||" "===o&&e.prev&&8===e.prev.type&&e.next&&8===e.next.type?e.remove():e.value=o}},e=>{var i;if(1===e.type){const i=t.getElementRule(e.name);if(r&&i){const r=fb(t,s,a,e);i.paddInEmptyBlock&&r&&(e=>{let o=e;for(;C(o);){if(o.name in l)return fb(t,s,a,o);o=o.parent}return!1})(e)?hb(o,n,g,e):i.removeEmpty&&r?g(e)?e.remove():e.unwrap():i.paddEmpty&&(r||(e=>{var t;return pb(e,"#text")&&(null===(t=null==e?void 0:e.firstChild)||void 0===t?void 0:t.value)===Wn})(e))&&hb(o,n,g,e)}}else if(3===e.type&&!u(e)){let t=null!==(i=e.value)&&void 0!==i?i:"";(e.next&&g(e.next)||h(e,!1))&&(t=t.replace(m,"")),0===t.length?e.remove():e.value=t}}]},zx=(e={},t=Us())=>{const o=aw(),n=aw(),r={validate:!0,root_name:"body",sanitize:!0,...e},s=new DOMParser,a=Lx(r,t),i=o.addFilter,l=o.getFilters,c=o.removeFilter,d=n.addFilter,m=n.getFilters,u=n.removeFilter,g=(e,o)=>{const n=h(o.attr(Ex)),r=1===o.type&&!Ee(e,o.name)&&!es(t,o)&&!Ir(o.name);return 3===o.type||r&&!n},p={schema:t,addAttributeFilter:d,getAttributeFilters:m,removeAttributeFilter:u,addNodeFilter:i,getNodeFilters:l,removeNodeFilter:c,parse:(e,o={})=>{var n;const i=r.validate,c=null!==(n=o.context)&&void 0!==n?n:r.root_name,d=((e,o,n="html")=>{const r="xhtml"===n?"application/xhtml+xml":"text/html",i=Ee(t.getSpecialElements(),o.toLowerCase()),l=i?`<${o}>${e}`:e,c=s.parseFromString("xhtml"===n?`${l}`:/^[\s]*${l}`:`${l}`,r).body;return a.sanitizeHtmlElement(c,r),i?c.firstChild:c})(e,c,o.format);qr(t,d);const u=new Dp(c,11);Px(u,d,t.getSpecialElements(),a.sanitizeNamespaceElement),d.innerHTML="";const[h,p]=Fx(u,t,r,o),f=[],v=i?e=>((e,o)=>{wb(t,e)&&o.push(e)})(e,f):E,b={nodes:{},attributes:{}},y=e=>mb(l(),m(),e,b);if(((e,t,o)=>{const n=[];for(let o=e,r=o;o;r=o,o=o.walk()){const s=o;q(t,(e=>e(s))),x(s.parent)&&s!==e?o=r:n.push(s)}for(let e=n.length-1;e>=0;e--){const t=n[e];q(o,(e=>e(t)))}})(u,[h,y],[p,v]),f.reverse(),i&&f.length>0)if(o.context){const{pass:e,fail:n}=K(f,(e=>e.parent===u));yb(n,t,u,y),o.invalid=e.length>0}else yb(f,t,u,y);const w=((e,t)=>{var o;const n=null!==(o=t.forced_root_block)&&void 0!==o?o:e.forced_root_block;return!1===n?"":!0===n?"p":n})(r,o);return w&&("body"===u.name||o.isRootContent)&&((e,o)=>{const n=Ix(Hx("script,style,head,html,body,title,meta,param"),t.getBlockElements()),s=/^[ \t\r\n]+/,a=/[ \t\r\n]+$/;let i=e.firstChild,l=null;const c=e=>{var t,o;e&&(i=e.firstChild,i&&3===i.type&&(i.value=null===(t=i.value)||void 0===t?void 0:t.replace(s,"")),i=e.lastChild,i&&3===i.type&&(i.value=null===(o=i.value)||void 0===o?void 0:o.replace(a,"")))};if(t.isValidChild(e.name,o.toLowerCase())){for(;i;){const t=i.next;g(n,i)?(l||(l=new Dp(o,1),l.attr(r.forced_root_block_attrs),e.insert(l,i)),l.append(i)):(c(l),l=null),i=t}c(l)}})(u,w),o.invalid||ub(b,o),u}};return((e,t)=>{var o,n;const r=e.schema;e.addAttributeFilter("href",(e=>{let o=e.length;const n=e=>{const t=e?Lt.trim(e):"";return/\b(noopener)\b/g.test(t)?t:(e=>e.split(" ").filter((e=>e.length>0)).concat(["noopener"]).sort().join(" "))(t)};if(!t.allow_unsafe_link_target)for(;o--;){const t=e[o];"a"===t.name&&"_blank"===t.attr("target")&&t.attr("rel",n(t.attr("rel")))}})),t.allow_html_in_named_anchor||e.addAttributeFilter("id,name",(e=>{let t,o,n,r,s=e.length;for(;s--;)if(r=e[s],"a"===r.name&&r.firstChild&&!r.attr("href"))for(n=r.parent,t=r.lastChild;t&&n;)o=t.prev,n.insert(t,r),t=o})),t.fix_list_elements&&e.addNodeFilter("ul,ol",(e=>{let t,o,n=e.length;for(;n--;)if(t=e[n],o=t.parent,o&&("ul"===o.name||"ol"===o.name))if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{const e=new Dp("li",1);e.attr("style","list-style-type: none"),t.wrap(e)}}));const s=r.getValidClasses();t.validate&&s&&e.addAttributeFilter("class",(e=>{var t;let o=e.length;for(;o--;){const n=e[o],r=null!==(t=n.attr("class"))&&void 0!==t?t:"",a=Lt.explode(r," ");let i="";for(let e=0;eq(e,(e=>{e.replace(xw({type:e.attr("type"),src:"object"===e.name?e.attr("data"):e.attr("src"),width:e.attr("width"),height:e.attr("height")},a,i))})))),a&&e.addNodeFilter("iframe",(e=>q(e,(e=>yw(e,i)))))})(p,r),((e,t,o)=>{t.inline_styles&&lw(e,t,o)})(p,r,t),p},Vx=(e,t,o)=>{const n=(e=>Ib(e)?Yp({validate:!1}).serialize(e):e)(e),r=t(n);if(r.isDefaultPrevented())return r;if(Ib(e)){if(r.content!==n){const t=zx({validate:!1,forced_root_block:!1,...o}).parse(r.content,{context:e.name});return{...r,content:t}}return{...r,content:e}}return r},Zx=e=>({sanitize:Ld(e),sandbox_iframes:Vd(e),sandbox_iframes_exclusions:Zd(e)}),Ux=(e,t)=>{if(t.no_events)return Hl.value(t);{const o=((e,t)=>e.dispatch("BeforeGetContent",t))(e,t);return o.isDefaultPrevented()?Hl.error(Pg(e,{content:"",...o}).content):Hl.value(o)}},jx=(e,t,o)=>{if(o.no_events)return t;{const n=Vx(t,(t=>Pg(e,{...o,content:t})),Zx(e));return n.content}},Wx=(e,t)=>{if(t.no_events)return Hl.value(t);{const o=Vx(t.content,(o=>((e,t)=>e.dispatch("BeforeSetContent",t))(e,{...t,content:o})),Zx(e));return o.isDefaultPrevented()?(Ig(e,o),Hl.error(void 0)):Hl.value(o)}},$x=(e,t,o)=>{o.no_events||Ig(e,{...o,content:t})},qx=(e,t,o)=>({element:e,width:t,rows:o}),Gx=(e,t)=>({element:e,cells:t}),Kx=(e,t)=>({x:e,y:t}),Yx=(e,t)=>ro(e,t).bind(Qe).getOr(1),Xx=(e,t,o)=>{const n=e.rows;return!!(n[o]?n[o].cells:[])[t]},Jx=e=>J(e,((e,t)=>t.cells.length>e?t.cells.length:e),0),Qx=(e,t)=>{const o=e.rows;for(let e=0;e{const s=[],a=e.rows;for(let e=o;e<=r;e++){const o=a[e].cells,r=t{const t=qx(Wa(e),0,[]);return q(Fn(e,"tr"),((e,o)=>{q(Fn(e,"td,th"),((n,r)=>{((e,t,o,n,r)=>{const s=Yx(r,"rowspan"),a=Yx(r,"colspan"),i=e.rows;for(let e=o;e{for(;Xx(e,t,o);)t++;return t})(t,r,o),o,e,n)}))})),qx(t.element,Jx(t.rows),t.rows)},oC=e=>((e,t)=>{const o=Wa(e.element),n=wo.fromTag("tbody");return yn(n,t),vn(o,n),o})(e,(e=>$(e.rows,(e=>{const t=$(e.cells,(e=>{const t=$a(e);return ao(t,"colspan"),ao(t,"rowspan"),t})),o=Wa(e.element);return yn(o,t),o})))(e)),nC=(e,t,o)=>Qx(e,t).bind((t=>Qx(e,o).map((o=>((e,t,o)=>{const n=t.x,r=t.y,s=o.x,a=o.y,i=ree(e,(e=>"li"===Wt(e)&&Bu(e,t))).fold(A([]),(t=>(e=>ee(e,(e=>"ul"===Wt(e)||"ol"===Wt(e))))(e).map((e=>{const t=wo.fromTag(Wt(e)),o=Ce(un(e),((e,t)=>We(t,"list-style")));return ln(t,o),[wo.fromTag("li"),t]})).getOr([]))),sC=(e,t,o)=>{const n=wo.fromDom(t.commonAncestorContainer),r=xf(n,e),s=Y(r,(e=>o.isWrapper(Wt(e)))),a=rC(r,t),i=s.concat(a.length?a:(e=>ni(e)?Ao(e).filter(oi).fold(A([]),(t=>[e,t])):oi(e)?[e]:[])(n));return $(i,Wa)},aC=()=>ih([]),iC=(e,t,o)=>((e,t)=>{const o=J(t,((e,t)=>(vn(t,e),t)),e);return t.length>0?ih([o]):o})(wo.fromDom(t.cloneContents()),sC(e,t,o)),lC=(e,t)=>((e,t)=>Qo(t,"table",N(ko,e)))(e,t[0]).bind((e=>{const o=t[0],n=t[t.length-1],r=tC(e);return nC(r,o,n).map((e=>ih([oC(e)])))})).getOrThunk(aC),cC=(e,t,o)=>{const n=Au(t,e);return n.length>0?lC(e,n):((e,t,o)=>t.length>0&&t[0].collapsed?aC():iC(e,t[0],o))(e,t,o)},dC=(e,t)=>t>=0&&tui(e.innerText),uC=(e,t)=>{if("text"===t.format)return(e=>F.from(e.selection.getRng()).map((t=>{var o;const n=F.from(e.dom.getParent(t.commonAncestorContainer,e.dom.isBlock)),r=e.getBody(),s=(e=>e.map((e=>e.nodeName)).getOr("div").toLowerCase())(n),a=wo.fromDom(t.cloneContents());jp(a),Wp(a);const i=e.dom.add(r,s,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},a.dom),l=mC(i),c=ui(null!==(o=i.textContent)&&void 0!==o?o:"");if(e.dom.remove(i),dC(c,0)||dC(c,c.length-1)){const e=n.getOr(r),t=mC(e),o=t.indexOf(l);return-1===o?l:(dC(t,o-1)?" ":"")+l+(dC(t,o+l.length)?" ":"")}return l})).getOr(""))(e);{const o=((e,t)=>{const o=e.selection.getRng(),n=e.dom.create("body"),r=e.selection.getSel(),s=_p(e,Tu(r)),a=t.contextual?cC(wo.fromDom(e.getBody()),s,e.schema).dom:o.cloneContents();return a&&n.appendChild(a),e.selection.serializer.serialize(n,t)})(e,t);return"tree"===t.format?o:e.selection.isCollapsed()?"":o}},gC=e=>Qn(e)?e.outerHTML:lr(e)?ks.encodeRaw(e.data,!1):mr(e)?"\x3c!--"+e.data+"--\x3e":"",hC=(e,t,o)=>{const n=(e=>{let t;const o=document.createElement("div"),n=document.createDocumentFragment();for(e&&(o.innerHTML=e);t=o.firstChild;)n.appendChild(t);return n})(t);if(e.hasChildNodes()&&o(((e,t)=>{let o=0;q(e,(e=>{0===e[0]?o++:1===e[0]?(hC(t,e[1],o),o++):2===e[0]&&((e,t)=>{if(e.hasChildNodes()&&t{const o=e.length+t.length+2,n=new Array(o),r=new Array(o),s=(o,n,r,a,l)=>{const c=i(o,n,r,a);if(null===c||c.start===n&&c.diag===n-a||c.end===o&&c.diag===o-r){let s=o,i=r;for(;sa-r?(l.push([2,e[s]]),++s):(l.push([1,t[i]]),++i)}else{s(o,c.start,r,c.start-c.diag,l);for(let t=c.start;t{let a=o;for(;a-n({start:e,end:t,diag:o}))(o,a,n)},i=(o,s,i,l)=>{const c=s-o,d=l-i;if(0===c||0===d)return null;const m=c-d,u=d+c,g=(u%2==0?u:u+1)/2;let h,p,f,v,b;for(n[1+g]=o,r[1+g]=s+1,h=0;h<=g;++h){for(p=-h;p<=h;p+=2){for(f=p+g,p===-h||p!==h&&n[f-1]=o&&b>=i&&e[v]===t[b];)r[f]=v--,b--;if(m%2==0&&-h<=p&&p<=h&&r[f]<=n[f+m])return a(r[f],p+o-i,s,l)}}return null},l=[];return s(0,e.length,0,t.length,l),l})($(ue(t.childNodes),gC),e),t),t),fC=Ie((()=>document.implementation.createHTMLDocument("undo"))),vC=e=>{const t=e.serializer.getTempAttrs(),o=Up(e.getBody(),t);return(e=>null!==e.querySelector("iframe"))(o)?{type:"fragmented",fragments:Y($(ue(o.childNodes),T(ui,gC)),(e=>e.length>0)),content:"",bookmark:null,beforeBookmark:null}:{type:"complete",fragments:null,content:ui(o.innerHTML),bookmark:null,beforeBookmark:null}},bC=(e,t,o)=>{const n=o?t.beforeBookmark:t.bookmark;"fragmented"===t.type?pC(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw",no_selection:!C(n)||!mu(n)||!n.isFakeCaret}),n&&(e.selection.moveToBookmark(n),e.selection.scrollIntoView())},yC=e=>"fragmented"===e.type?e.fragments.join(""):e.content,wC=e=>{const t=wo.fromTag("body",fC());return _n(t,yC(e)),q(Fn(t,"*[data-mce-bogus]"),Cn),kn(t)},xC=(e,t)=>!(!e||!t)&&(!!((e,t)=>yC(e)===yC(t))(e,t)||((e,t)=>wC(e)===wC(t))(e,t)),CC=e=>0===e.get(),SC=(e,t,o)=>{CC(o)&&(e.typing=t)},kC=(e,t)=>{e.typing&&(SC(e,!1,t),e.add())},_C=e=>({init:{bindEvents:E},undoManager:{beforeChange:(t,o)=>((e,t,o)=>{CC(t)&&o.set(Rl(e.selection))})(e,t,o),add:(t,o,n,r,s,a)=>((e,t,o,n,r,s,a)=>{const i=vC(e),l=Lt.extend(s||{},i);if(!CC(n)||e.removed)return null;const c=t.data[o.get()];if(e.dispatch("BeforeAddUndo",{level:l,lastLevel:c,originalEvent:a}).isDefaultPrevented())return null;if(c&&xC(c,l))return null;t.data[o.get()]&&r.get().each((e=>{t.data[o.get()].beforeBookmark=e}));const d=Jc(e);if(d&&t.data.length>d){for(let e=0;e0?(e.setDirty(!0),e.dispatch("AddUndo",m),e.dispatch("change",m)):e.dispatch("AddUndo",m),l})(e,t,o,n,r,s,a),undo:(t,o,n)=>((e,t,o,n)=>{let r;return t.typing&&(t.add(),t.typing=!1,SC(t,!1,o)),n.get()>0&&(n.set(n.get()-1),r=t.data[n.get()],bC(e,r,!0),e.setDirty(!0),e.dispatch("Undo",{level:r})),r})(e,t,o,n),redo:(t,o)=>((e,t,o)=>{let n;return t.get()((e,t,o)=>{t.data=[],o.set(0),t.typing=!1,e.dispatch("ClearUndos")})(e,t,o),reset:e=>(e=>{e.clear(),e.add()})(e),hasUndo:(t,o)=>((e,t,o)=>o.get()>0||t.typing&&t.data[0]&&!xC(vC(e),t.data[0]))(e,t,o),hasRedo:(e,t)=>((e,t)=>t.get()((e,t,o)=>(kC(e,t),e.beforeChange(),e.ignore(o),e.add()))(e,t,o),ignore:(e,t)=>((e,t)=>{try{e.set(e.get()+1),t()}finally{e.set(e.get()-1)}})(e,t),extra:(t,o,n,r)=>((e,t,o,n,r)=>{if(t.transact(n)){const n=t.data[o.get()].bookmark,s=t.data[o.get()-1];bC(e,s,!0),t.transact(r)&&(t.data[o.get()-1].beforeBookmark=n)}})(e,t,o,n,r)},formatter:{match:(t,o,n,r)=>Gb(e,t,o,n,r),matchAll:(t,o)=>((e,t,o)=>{const n=[],r={},s=e.selection.getStart();return e.dom.getParent(s,(s=>{for(let a=0;aqb(e,t,o,n,r),canApply:t=>((e,t)=>{const o=e.formatter.get(t),n=e.dom;if(o&&e.selection.isEditable()){const t=e.selection.getStart(),r=Qu(n,t);for(let e=o.length-1;e>=0;e--){const t=o[e];if(!ng(t))return!0;for(let e=r.length-1;e>=0;e--)if(n.is(r[e],t.selector))return!0}}return!1})(e,t),closest:t=>Kb(e,t),apply:(t,o,n)=>Jy(e,t,o,n),remove:(t,o,n,r)=>Wy(e,t,o,n,r),toggle:(t,o,n)=>((e,t,o,n)=>{const r=e.formatter.get(t);r&&(!Gb(e,t,o,n)||"toggle"in r[0]&&!r[0].toggle?Jy(e,t,o,n):Wy(e,t,o,n))})(e,t,o,n),formatChanged:(t,o,n,r,s)=>rw(e,t,o,n,r,s)},editor:{getContent:t=>((e,t)=>F.from(e.getBody()).fold(A("tree"===t.format?new Dp("body",11):""),(o=>qp(e,t,o))))(e,t),setContent:(t,o)=>Fb(e,t,o),insertContent:(t,o)=>Hb(e,t,o),addVisual:t=>((e,t)=>{const o=e.dom,n=C(t)?t:e.getBody();q(o.select("table,a",n),(t=>{switch(t.nodeName){case"TABLE":const n=id(e),r=o.getAttrib(t,"border");r&&"0"!==r||!e.hasVisual?o.removeClass(t,n):o.addClass(t,n);break;case"A":if(!o.getAttrib(t,"href")){const n=o.getAttrib(t,"name")||t.id,r=ld(e);n&&e.hasVisual?o.addClass(t,r):o.removeClass(t,r)}}})),e.dispatch("VisualAid",{element:t,hasVisual:e.hasVisual})})(e,t)},selection:{getContent:(t,o)=>((e,t,o={})=>{const n=((e,t)=>({...e,format:t,get:!0,selection:!0,getInner:!0}))(o,t);return Ux(e,n).fold(D,(t=>{const o=uC(e,t);return jx(e,o,t)}))})(e,t,o)},autocompleter:{addDecoration:E,removeDecoration:E},raw:{getModel:()=>F.none()}}),EC=e=>Ee(e.plugins,"rtc"),TC=e=>{const t=e;return(e=>_e(e.plugins,"rtc").bind((e=>F.from(e.setup))))(e).fold((()=>(t.rtcInstance=_C(e),F.none())),(e=>(t.rtcInstance=(()=>{const e=A(null),t=A("");return{init:{bindEvents:E},undoManager:{beforeChange:E,add:e,undo:e,redo:e,clear:E,reset:E,hasUndo:I,hasRedo:I,transact:e,ignore:E,extra:E},formatter:{match:I,matchAll:A([]),matchNode:A(void 0),canApply:I,closest:t,apply:E,remove:E,toggle:E,formatChanged:A({unbind:E})},editor:{getContent:t,setContent:A({content:"",html:""}),insertContent:A(""),addVisual:E},selection:{getContent:t},autocompleter:{addDecoration:E,removeDecoration:E},raw:{getModel:A(F.none())}}})(),F.some((()=>e().then((e=>(t.rtcInstance=(e=>{const t=e=>p(e)?e:{},{init:o,undoManager:n,formatter:r,editor:s,selection:a,autocompleter:i,raw:l}=e;return{init:{bindEvents:o.bindEvents},undoManager:{beforeChange:n.beforeChange,add:n.add,undo:n.undo,redo:n.redo,clear:n.clear,reset:n.reset,hasUndo:n.hasUndo,hasRedo:n.hasRedo,transact:(e,t,o)=>n.transact(o),ignore:(e,t)=>n.ignore(t),extra:(e,t,o,r)=>n.extra(o,r)},formatter:{match:(e,o,n,s)=>r.match(e,t(o),s),matchAll:r.matchAll,matchNode:r.matchNode,canApply:e=>r.canApply(e),closest:e=>r.closest(e),apply:(e,o,n)=>r.apply(e,t(o)),remove:(e,o,n,s)=>r.remove(e,t(o)),toggle:(e,o,n)=>r.toggle(e,t(o)),formatChanged:(e,t,o,n,s)=>r.formatChanged(t,o,n,s)},editor:{getContent:e=>s.getContent(e),setContent:(e,t)=>({content:s.setContent(e,t),html:""}),insertContent:(e,t)=>(s.insertContent(e),""),addVisual:s.addVisual},selection:{getContent:(e,t)=>a.getContent(t)},autocompleter:{addDecoration:i.addDecoration,removeDecoration:i.removeDecoration},raw:{getModel:()=>F.some(l.getRawModel())}}})(e),e.rtc.isRemote))))))))},OC=e=>e.rtcInstance?e.rtcInstance:_C(e),AC=e=>{const t=e.rtcInstance;if(t)return t;throw new Error("Failed to get RTC instance not yet initialized.")},DC=e=>AC(e).init.bindEvents(),MC=(e,t={})=>((e,t,o)=>AC(e).selection.getContent(t,o))(e,t.format?t.format:"html",t),NC=e=>0===e.dom.length?(xn(e),F.none()):F.some(e),RC=(e,t,o,n,r)=>{e.bind((e=>((n?tv:ev)(e.dom,n?e.dom.length:0,r),t.filter(Yt).map((t=>((e,t,o,n,r)=>{const s=e.dom,a=t.dom,i=n?s.length:a.length;n?(ov(s,a,r,!1,!n),o.setStart(a,i)):(ov(a,s,r,!1,!n),o.setEnd(a,i))})(e,t,o,n,r)))))).orThunk((()=>{const e=((e,t)=>e.filter((e=>Ng.isBookmarkNode(e.dom))).bind(t?Ro:No))(t,n).or(t).filter(Yt);return e.map((e=>((e,t,o)=>{Ao(e).each((n=>{const r=e.dom;t&&jf(n,ml(r,0),o)?ev(r,0,o):!t&&Wf(n,ml(r,r.length),o)&&tv(r,r.length,o)}))})(e,n,r)))}))},BC=(e,t,o={})=>{const n=((e,t)=>({format:"html",...e,set:!0,selection:!0,content:t}))(o,t);Wx(e,n).each((t=>{const o=((e,t)=>{if("raw"!==t.format){const o=e.selection.getRng(),n=e.dom.getParent(o.commonAncestorContainer,e.dom.isBlock),r=n?{context:n.nodeName.toLowerCase()}:{},s=e.parser.parse(t.content,{forced_root_block:!1,...r,...t});return Yp({validate:!1},e.schema).serialize(s)}return t.content})(e,t),n=e.selection.getRng();((e,t,o)=>{const n=F.from(t.firstChild).map(wo.fromDom),r=F.from(t.lastChild).map(wo.fromDom);e.deleteContents(),e.insertNode(t);const s=n.bind(No).filter(Yt).bind(NC),a=r.bind(Ro).filter(Yt).bind(NC);RC(s,n,e,!0,o),RC(a,r,e,!1,o),e.collapse(!1)})(n,n.createContextualFragment(o),e.schema),e.selection.setRng(n),Uh(e,n),$x(e,o,t)}))},LC=(e,t,o)=>{if(Ee(e,t)){const n=Y(e[t],(e=>e!==o));0===n.length?delete e[t]:e[t]=n}};var HC=(e,t)=>{let o,n;const r=(t,o)=>ee(o,(o=>e.is(o,t))),s=t=>e.getParents(t,void 0,e.getRoot());return{selectorChangedWithUnbind:(e,a)=>(o||(o={},n={},t.on("NodeChange",(e=>{const t=e.element,a=s(t),i={};ve(o,((e,t)=>{r(t,a).each((o=>{n[t]||(q(e,(e=>{e(!0,{node:o,selector:t,parents:a})})),n[t]=e),i[t]=e}))})),ve(n,((e,o)=>{i[o]||(delete n[o],q(e,(e=>{e(!1,{node:t,selector:o,parents:a})})))}))}))),o[e]||(o[e]=[]),o[e].push(a),r(e,s(t.selection.getStart())).each((()=>{n[e]=o[e]})),{unbind:()=>{LC(o,e,a),LC(n,e,a)}})}};const IC=e=>!(!e||!e.ownerDocument)&&_o(wo.fromDom(e.ownerDocument),wo.fromDom(e)),PC=(e,t,o,n)=>{let r,s;const{selectorChangedWithUnbind:a}=HC(e,n),i=(e,t)=>BC(n,e,t),l=e=>{const t=d();t.collapse(!!e),m(t)},c=()=>t.getSelection?t.getSelection():t.document.selection,d=()=>{let o;const a=(e,t,o)=>{try{return t.compareBoundaryPoints(e,o)}catch(e){return-1}},i=t.document;if(C(n.bookmark)&&!fp(n)){const e=tp(n);if(e.isSome())return e.map((e=>_p(n,[e])[0])).getOr(i.createRange())}try{const e=c();e&&!Jn(e.anchorNode)&&(o=e.rangeCount>0?e.getRangeAt(0):i.createRange(),o=_p(n,[o])[0])}catch(e){}if(o||(o=i.createRange()),ur(o.startContainer)&&o.collapsed){const t=e.getRoot();o.setStart(t,0),o.setEnd(t,0)}return r&&s&&(0===a(o.START_TO_START,o,r)&&0===a(o.END_TO_END,o,r)?o=s:(r=null,s=null)),o},m=(e,t)=>{if(!(e=>!!e&&IC(e.startContainer)&&IC(e.endContainer))(e))return;const o=c();if(e=n.dispatch("SetSelectionRange",{range:e,forward:t}).range,o){s=e;try{o.removeAllRanges(),o.addRange(e)}catch(e){}!1===t&&o.extend&&(o.collapse(e.endContainer,e.endOffset),o.extend(e.startContainer,e.startOffset)),r=o.rangeCount>0?o.getRangeAt(0):null}if(!e.collapsed&&e.startContainer===e.endContainer&&(null==o?void 0:o.setBaseAndExtent)&&e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()){const t=e.startContainer.childNodes[e.startOffset];t&&"IMG"===t.nodeName&&(o.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),o.anchorNode===e.startContainer&&o.focusNode===e.endContainer||o.setBaseAndExtent(t,0,t,1))}n.dispatch("AfterSetSelectionRange",{range:e,forward:t})},u=()=>{const t=c(),o=null==t?void 0:t.anchorNode,n=null==t?void 0:t.focusNode;if(!t||!o||!n||Jn(o)||Jn(n))return!0;const r=e.createRng(),s=e.createRng();try{r.setStart(o,t.anchorOffset),r.collapse(!0),s.setStart(n,t.focusOffset),s.collapse(!0)}catch(e){return!0}return r.compareBoundaryPoints(r.START_TO_START,s)<=0},g={dom:e,win:t,serializer:o,editor:n,expand:(t={type:"word"})=>m(xh(e).expand(d(),t)),collapse:l,setCursorLocation:(t,o)=>{const r=e.createRng();C(t)&&C(o)?(r.setStart(t,o),r.setEnd(t,o),m(r),l(!1)):(Lu(e,r,n.getBody(),!0),m(r))},getContent:e=>MC(n,e),setContent:i,getBookmark:(e,t)=>h.getBookmark(e,t),moveToBookmark:e=>h.moveToBookmark(e),select:(t,o)=>(((e,t,o)=>F.from(t).bind((t=>F.from(t.parentNode).map((n=>{const r=e.nodeIndex(t),s=e.createRng();return s.setStart(n,r),s.setEnd(n,r+1),o&&(Lu(e,s,t,!0),Lu(e,s,t,!1)),s})))))(e,t,o).each(m),t),isCollapsed:()=>{const e=d(),t=c();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isEditable:()=>{const t=d(),o=n.getBody().querySelectorAll('[data-mce-selected="1"]');return o.length>0?re(o,(t=>e.isEditable(t.parentElement))):wp(e,t)},isForward:u,setNode:t=>(i(e.getOuterHTML(t)),t),getNode:()=>((e,t)=>{if(!t)return e;let o=t.startContainer,n=t.endContainer;const r=t.startOffset,s=t.endOffset;let a=t.commonAncestorContainer;t.collapsed||(o===n&&s-r<2&&o.hasChildNodes()&&(a=o.childNodes[r]),lr(o)&&lr(n)&&(o=o.length===r?kp(o.nextSibling,!0):o.parentNode,n=0===s?kp(n.previousSibling,!1):n.parentNode,o&&o===n&&(a=o)));const i=lr(a)?a.parentNode:a;return er(i)?i:e})(n.getBody(),d()),getSel:c,setRng:m,getRng:d,getStart:e=>Cp(n.getBody(),d(),e),getEnd:e=>Sp(n.getBody(),d(),e),getSelectedBlocks:(t,o)=>((e,t,o,n)=>{const r=[],s=e.getRoot(),a=e.getParent(o||Cp(s,t,t.collapsed),e.isBlock),i=e.getParent(n||Sp(s,t,t.collapsed),e.isBlock);if(a&&a!==s&&r.push(a),a&&i&&a!==i){let t;const o=new Un(a,s);for(;(t=o.next())&&t!==i;)e.isBlock(t)&&r.push(t)}return i&&a!==i&&i!==s&&r.push(i),r})(e,d(),t,o),normalize:()=>{const t=d(),o=c();if(!(Tu(o).length>1)&&Hu(n)){const o=bh(e,t);return o.each((e=>{m(e,u())})),o.getOr(t)}return t},selectorChanged:(e,t)=>(a(e,t),g),selectorChangedWithUnbind:a,getScrollContainer:()=>{let t,o=e.getRoot();for(;o&&"BODY"!==o.nodeName;){if(o.scrollHeight>o.clientHeight){t=o;break}o=o.parentNode}return t},scrollIntoView:(e,t)=>{C(e)?((e,t,o)=>{(e.inline?zh:Zh)(e,t,o)})(n,e,t):Uh(n,d(),t)},placeCaretAt:(e,t)=>m(dh(e,t,n.getDoc())),getBoundingClientRect:()=>{const e=d();return e.collapsed?ml.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:()=>{t=r=s=null,p.destroy()}},h=Ng(g),p=$g(g,n);return g.bookmarkManager=h,g.controlSelection=p,g},FC=(e,t,o)=>{e.addAttributeFilter("data-mce-tabindex",((e,t)=>{let o=e.length;for(;o--;){const n=e[o];n.attr("tabindex",n.attr("data-mce-tabindex")),n.attr(t,null)}})),e.addAttributeFilter("src,href,style",((e,n)=>{const r="data-mce-"+n,s=t.url_converter,a=t.url_converter_scope;let i=e.length;for(;i--;){const t=e[i];let l=t.attr(r);void 0!==l?(t.attr(n,l.length>0?l:null),t.attr(r,null)):(l=t.attr(n),"style"===n?l=o.serializeStyle(o.parseStyle(l),t.name):s&&(l=s.call(a,l,n,t.name)),t.attr(n,l.length>0?l:null))}})),e.addAttributeFilter("class",(e=>{let t=e.length;for(;t--;){const o=e[t];let n=o.attr("class");n&&(n=n.replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),o.attr("class",n.length>0?n:null))}})),e.addAttributeFilter("data-mce-type",((e,t,o)=>{let n=e.length;for(;n--;){const t=e[n];if("bookmark"===t.attr("data-mce-type")&&!o.cleanup){const e=F.from(t.firstChild).exists((e=>{var t;return!mi(null!==(t=e.value)&&void 0!==t?t:"")}));e?t.unwrap():t.remove()}}})),e.addNodeFilter("script,style",((e,o)=>{var n;const r=e=>e.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"");let s=e.length;for(;s--;){const a=e[s],i=a.firstChild,l=null!==(n=null==i?void 0:i.value)&&void 0!==n?n:"";if("script"===o){const e=a.attr("type");e&&a.attr("type","mce-no/type"===e?null:e.replace(/^mce\-/,"")),"xhtml"===t.element_format&&i&&l.length>0&&(i.value="// ")}else"xhtml"===t.element_format&&i&&l.length>0&&(i.value="\x3c!--\n"+r(l)+"\n--\x3e")}})),e.addNodeFilter("#comment",(e=>{let n=e.length;for(;n--;){const r=e[n],s=r.value;t.preserve_cdata&&0===(null==s?void 0:s.indexOf("[CDATA["))?(r.name="#cdata",r.type=4,r.value=o.decode(s.replace(/^\[CDATA\[|\]\]$/g,""))):0===(null==s?void 0:s.indexOf("mce:protected "))&&(r.name="#text",r.type=3,r.raw=!0,r.value=unescape(s).substr(14))}})),e.addNodeFilter("xml:namespace,input",((e,t)=>{let o=e.length;for(;o--;){const n=e[o];7===n.type?n.remove():1===n.type&&("input"!==t||n.attr("type")||n.attr("type","text"))}})),e.addAttributeFilter("data-mce-type",(t=>{q(t,(t=>{"format-caret"===t.attr("data-mce-type")&&(t.isEmpty(e.schema.getNonEmptyElements())?t.remove():t.unwrap())}))})),e.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-block,data-mce-type,data-mce-resize,data-mce-placeholder",((e,t)=>{let o=e.length;for(;o--;)e[o].attr(t,null)})),t.remove_trailing_brs&&((e,t,o)=>{t.addNodeFilter("br",((t,n,r)=>{const s=Lt.extend({},o.getBlockElements()),a=o.getNonEmptyElements(),i=o.getWhitespaceElements();s.body=1;const l=e=>e.name in s||es(o,e);for(let n=0,c=t.length;n((e,t)=>C(e)&&e.hasEventListeners("PreProcess")&&!t.no_events)(e,o)?((e,t,o)=>{let n;const r=e.dom;let s=t.cloneNode(!0);const a=document.implementation;if(a.createHTMLDocument){const e=a.createHTMLDocument("");Lt.each("BODY"===s.nodeName?s.childNodes:[s],(t=>{e.body.appendChild(e.importNode(t,!0))})),s="BODY"!==s.nodeName?e.body.firstChild:e.body,n=r.doc,r.doc=e}return((e,t)=>{e.dispatch("PreProcess",t)})(e,{...o,node:s}),n&&(r.doc=n),s})(e,t,o):t,VC=(e,t,o)=>{-1===Lt.inArray(t,o)&&(e.addAttributeFilter(o,((e,t)=>{let o=e.length;for(;o--;)e[o].attr(t,null)})),t.push(o))},ZC=(e,t,o,n,r)=>{const s=((e,t,o)=>Yp(e,t).serialize(o))(t,o,n);return((e,t,o)=>{if(!t.no_events&&e){const n=((e,t)=>e.dispatch("PostProcess",t))(e,{...t,content:o});return n.content}return o})(e,r,s)},UC=(e,t)=>{const o=["data-mce-selected"],n={entity_encoding:"named",remove_trailing_brs:!0,pad_empty_with_br:!1,...e},r=t&&t.dom?t.dom:ya.DOM,s=t&&t.schema?t.schema:Us(n),a=zx(n,s);return FC(a,n,r),{schema:s,addNodeFilter:a.addNodeFilter,addAttributeFilter:a.addAttributeFilter,serialize:(e,o={})=>{const i={format:"html",...o},l=zC(t,e,i),c=((e,t,o)=>{const n=ui(o.getInner?t.innerHTML:e.getOuterHTML(t));return o.selection||ai(wo.fromDom(t))?n:Lt.trim(n)})(r,l,i),d=((e,t,o)=>{const n=o.selection?{forced_root_block:!1,...o}:o,r=e.parse(t,n);return(e=>{const t=e=>"br"===(null==e?void 0:e.name),o=e.lastChild;if(t(o)){const e=o.prev;t(e)&&(o.remove(),e.remove())}})(r),r})(a,c,i);return"tree"===i.format?d:ZC(t,n,s,d,i)},addRules:s.addValidElements,setRules:s.setValidElements,addTempAttr:N(VC,a,o),getTempAttrs:A(o),getNodeFilters:a.getNodeFilters,getAttributeFilters:a.getAttributeFilters,removeNodeFilter:a.removeNodeFilter,removeAttributeFilter:a.removeAttributeFilter}},jC=(e,t)=>{const o=UC(e,t);return{schema:o.schema,addNodeFilter:o.addNodeFilter,addAttributeFilter:o.addAttributeFilter,serialize:o.serialize,addRules:o.addRules,setRules:o.setRules,addTempAttr:o.addTempAttr,getTempAttrs:o.getTempAttrs,getNodeFilters:o.getNodeFilters,getAttributeFilters:o.getAttributeFilters,removeNodeFilter:o.removeNodeFilter,removeAttributeFilter:o.removeAttributeFilter}},WC=(e,t={})=>{const o=((e,t)=>({...e,format:t,get:!0,getInner:!0}))(t,t.format?t.format:"html");return Ux(e,o).fold(D,(t=>{const o=((e,t)=>OC(e).editor.getContent(t))(e,t);return jx(e,o,t)}))},$C=(e,t,o={})=>{const n=((e,t)=>({format:"html",...e,set:!0,content:t}))(o,t);return Wx(e,n).map((t=>{const o=((e,t,o)=>OC(e).editor.setContent(t,o))(e,t.content,t);return $x(e,o.html,t),o.content})).getOr(t)},qC="autoresize_on_init,content_editable_state,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,tabfocus_elements,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_enable_default_filters,paste_filter_drop,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists,template_cdate_classes,template_mdate_classes,template_selected_content_classes,template_preview_replace_values,template_replace_values,templates,template_cdate_format,template_mdate_format".split(","),GC=[],KC="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,template,textcolor,rtc".split(","),YC=[],XC=(e,t)=>{const o=Y(t,(t=>Ee(e,t)));return le(o)},JC=e=>{const t=XC(e,qC),o=e.forced_root_block;return!1!==o&&""!==o||t.push("forced_root_block (false only)"),le(t)},QC=e=>XC(e,GC),eS=(e,t)=>{const o=Lt.makeMap(e.plugins," "),n=Y(t,(e=>Ee(o,e)));return le(n)},tS=e=>eS(e,KC),oS=e=>eS(e,YC.map((e=>e.name))),nS=e=>ee(YC,(t=>t.name===e)).fold((()=>e),(t=>t.replacedWith?`${e}, replaced by ${t.replacedWith}`:e)),rS=(e,t)=>{((e,t)=>{const o=JC(e),n=tS(t),r=n.length>0,s=o.length>0,a="mobile"===t.theme;if(r||s||a){const e="\n- ",t=a?`\n\nThemes:${e}mobile`:"",i=r?`\n\nPlugins:${e}${n.join(e)}`:"",l=s?`\n\nOptions:${e}${o.join(e)}`:"";console.warn("The following deprecated features are currently enabled and have been removed in TinyMCE 7.0. These features will no longer work and should be removed from the TinyMCE configuration. See https://www.tiny.cloud/docs/tinymce/7/migration-from-6x/ for more information."+t+i+l)}})(e,t),((e,t)=>{const o=QC(e),n=oS(t),r=n.length>0,s=o.length>0;if(r||s){const e="\n- ",t=r?`\n\nPlugins:${e}${n.map(nS).join(e)}`:"",a=s?`\n\nOptions:${e}${o.join(e)}`:"";console.warn("The following deprecated features are currently enabled but will be removed soon."+t+a)}})(e,t)},sS=ya.DOM,aS=e=>F.from(e).each((e=>e.destroy())),iS=e=>{if(!e.removed){const{_selectionOverrides:t,editorUpload:o}=e,n=e.getBody(),r=e.getElement();n&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&C(null==r?void 0:r.nextSibling)&&sS.remove(r.nextSibling),(e=>{e.dispatch("remove")})(e),e.editorManager.remove(e),!e.inline&&n&&(e=>{sS.setStyle(e.id,"display",e.orgDisplay)})(e),(e=>{e.dispatch("detach")})(e),sS.remove(e.getContainer()),aS(t),aS(o),e.destroy()}},lS=(e,t)=>{const{selection:o,dom:n}=e;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),aS(o),aS(n)),(e=>{const t=e.formElement;t&&(t._mceOldSubmit&&(t.submit=t._mceOldSubmit,delete t._mceOldSubmit),sS.unbind(t,"submit reset",e.formEventDelegate))})(e),(e=>{const t=e;t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null;const o=e.selection;if(o){const e=o.dom;t.selection=o.win=o.dom=e.doc=null}})(e),e.destroyed=!0):e.remove())},cS=(()=>{const e={};return{add:(t,o)=>{e[t]=o},get:t=>e[t]?e[t]:{icons:{}},has:t=>Ee(e,t)}})(),dS=Ea.ModelManager,mS=(e,t)=>t.dom[e],uS=(e,t)=>parseInt(cn(t,e),10),gS=N(mS,"clientWidth"),hS=N(mS,"clientHeight"),pS=N(uS,"margin-top"),fS=N(uS,"margin-left"),vS=(e,t,o)=>{const n=wo.fromDom(e.getBody()),r=e.inline?n:(s=n,wo.fromDom(To(s).dom.documentElement));var s;const a=((e,t,o,n)=>{const r=(e=>e.dom.getBoundingClientRect())(t);return{x:o-(e?r.left+t.dom.clientLeft+fS(t):0),y:n-(e?r.top+t.dom.clientTop+pS(t):0)}})(e.inline,r,t,o);return((e,t,o)=>{const n=gS(e),r=hS(e);return t>=0&&o>=0&&t<=n&&o<=r})(r,a.x,a.y)},bS=e=>{const t=e.inline?e.getBody():e.getContentAreaContainer();return(o=t,F.from(o).map(wo.fromDom)).map(qo).getOr(!1);var o},yS=e=>{const t=[],o=()=>{const t=e.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():(()=>{const e=()=>{throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:e,close:e,getArgs:e}})()},n=()=>F.from(t[0]),r=()=>{n().each((e=>{e.reposition()}))},s=e=>{te(t,(t=>t===e)).each((e=>{t.splice(e,1)}))},a=(n,a=!0)=>e.removed||!bS(e)?{}:(a&&e.dispatch("BeforeOpenNotification",{notification:n}),ee(t,(e=>{return t=o().getArgs(e),r=n,!(t.type!==r.type||t.text!==r.text||t.progressBar||t.timeout||r.progressBar||r.timeout);var t,r})).getOrThunk((()=>{e.editorManager.setActive(e);const a=o().open(n,(()=>{s(a)}),(()=>vp(e)));return(e=>{t.push(e)})(a),r(),e.dispatch("OpenNotification",{notification:{...a}}),a}))),i=A(t);return(e=>{e.on("SkinLoaded",(()=>{const t=Hc(e);t&&a({text:t,type:"warning",timeout:0},!1),r()})),e.on("show ResizeEditor ResizeWindow NodeChange ToggleView FullscreenStateChanged",(()=>{requestAnimationFrame(r)})),e.on("remove",(()=>{q(t.slice(),(e=>{o().close(e)}))})),e.addShortcut("alt+F12","Focus to notification",(()=>n().map((e=>wo.fromDom(e.getEl()))).each((e=>jh(e)))))})(e),{open:a,close:()=>{n().each((e=>{o().close(e),s(e),r()}))},getNotifications:i}},wS=Ea.PluginManager,xS=Ea.ThemeManager,CS=e=>{let t=[];const o=()=>{const t=e.theme;return t&&t.getWindowManagerImpl?t.getWindowManagerImpl():(()=>{const e=()=>{throw new Error("Theme did not provide a WindowManager implementation.")};return{open:e,openUrl:e,alert:e,confirm:e,close:e}})()},n=(e,t)=>(...o)=>t?t.apply(e,o):void 0,r=o=>{t.push(o),(t=>{e.dispatch("OpenWindow",{dialog:t})})(o)},s=o=>{(t=>{e.dispatch("CloseWindow",{dialog:t})})(o),t=Y(t,(e=>e!==o)),0===t.length&&e.focus()},a=t=>{e.editorManager.setActive(e),ep(e),e.ui.show();const o=t();return r(o),o};return e.on("remove",(()=>{q(t,(e=>{o().close(e)}))})),{open:(e,t)=>a((()=>o().open(e,t,s))),openUrl:e=>a((()=>o().openUrl(e,s))),alert:(e,t,r)=>{const s=o();s.alert(e,n(r||s,t))},confirm:(e,t,r)=>{const s=o();s.confirm(e,n(r||s,t))},close:()=>{F.from(t[t.length-1]).each((e=>{o().close(e),s(e)}))}}},SS=(e,t)=>{e.notificationManager.open({type:"error",text:t})},kS=(e,t)=>{e._skinLoaded?SS(e,t):e.on("SkinLoaded",(()=>{SS(e,t)}))},_S=(e,t,o)=>{Bg(e,t,{message:o}),console.error(o)},ES=(e,t,o)=>o?`Failed to load ${e}: ${o} from url ${t}`:`Failed to load ${e} url: ${t}`,TS=(e,...t)=>{const o=window.console;o&&(o.error?o.error(e,...t):o.log(e,...t))},OS=e=>"content/"+e+"/content.css",AS=(e,t)=>{const o=e.editorManager.baseURL+"/skins/content",n=`content${e.editorManager.suffix}.css`;return $(t,(t=>(e=>tinymce.Resource.has(OS(e)))(t)?t:(e=>/^[a-z0-9\-]+$/i.test(e))(t)&&!e.inline?`${o}/${t}/${n}`:e.documentBaseURI.toAbsolute(t)))},DS=e=>{e.contentCSS=e.contentCSS.concat((e=>AS(e,Tc(e)))(e),(e=>AS(e,Ac(e)))(e))},MS=(e,t)=>{const o={};return{findAll:(n,r=P)=>{const s=Y((e=>e?ue(e.getElementsByTagName("img")):[])(n),(t=>{const o=t.src;return!t.hasAttribute("data-mce-bogus")&&!t.hasAttribute("data-mce-placeholder")&&!(!o||o===Mt.transparentSrc)&&(We(o,"blob:")?!e.isUploaded(o)&&r(t):!!We(o,"data:")&&r(t))})),a=$(s,(e=>{const n=e.src;if(Ee(o,n))return o[n].then((t=>h(t)?t:{image:e,blobInfo:t.blobInfo}));{const r=((e,t)=>{const o=()=>Promise.reject("Invalid data URI");if(We(t,"blob:")){const n=e.getByUri(t);return C(n)?Promise.resolve(n):mw(t).then((t=>uw(t).then((n=>hw(n,!1,(o=>F.some(pw(e,t,o)))).getOrThunk(o)))))}return We(t,"data:")?fw(e,t).fold(o,(e=>Promise.resolve(e))):Promise.reject("Unknown image data format")})(t,n).then((t=>(delete o[n],{image:e,blobInfo:t}))).catch((e=>(delete o[n],e)));return o[n]=r,r}}));return Promise.all(a)}}},NS=()=>{let e={};const t=(e,t)=>({status:e,resultUri:t}),o=t=>t in e;return{hasBlobUri:o,getResultUri:t=>{const o=e[t];return o?o.resultUri:null},isPending:t=>!!o(t)&&1===e[t].status,isUploaded:t=>!!o(t)&&2===e[t].status,markPending:o=>{e[o]=t(1,null)},markUploaded:(o,n)=>{e[o]=t(2,n)},removeFailed:t=>{delete e[t]},destroy:()=>{e={}}}};let RS=0;const BS=e=>e+RS+++(()=>{const e=()=>Math.round(4294967295*Va()).toString(36);return"s"+(new Date).getTime().toString(36)+e()+e()+e()})(),LS=(e,t)=>{const o={},n=(e,o)=>new Promise(((n,r)=>{const s=new XMLHttpRequest;s.open("POST",t.url),s.withCredentials=t.credentials,s.upload.onprogress=e=>{o(e.loaded/e.total*100)},s.onerror=()=>{r("Image upload failed due to a XHR Transport error. Code: "+s.status)},s.onload=()=>{if(s.status<200||s.status>=300)return void r("HTTP Error: "+s.status);const e=JSON.parse(s.responseText);var o,a;e&&h(e.location)?n((o=t.basePath,a=e.location,o?o.replace(/\/$/,"")+"/"+a.replace(/^\//,""):a)):r("Invalid JSON: "+s.responseText)};const a=new FormData;a.append("file",e.blob(),e.filename()),s.send(a)})),r=S(t.handler)?t.handler:n,s=(e,t)=>({url:t,blobInfo:e,status:!0}),a=(e,t)=>({url:"",blobInfo:e,status:!1,error:t}),i=(e,t)=>{Lt.each(o[e],(e=>{e(t)})),delete o[e]},l=(t,n)=>(t=Lt.grep(t,(t=>!e.isUploaded(t.blobUri()))),Promise.all(Lt.map(t,(t=>e.isPending(t.blobUri())?(e=>{const t=e.blobUri();return new Promise((e=>{o[t]=o[t]||[],o[t].push(e)}))})(t):((t,o,n)=>(e.markPending(t.blobUri()),new Promise((r=>{let l,c;try{const d=()=>{l&&(l.close(),c=E)},m=o=>{d(),e.markUploaded(t.blobUri(),o),i(t.blobUri(),s(t,o)),r(s(t,o))},u=o=>{d(),e.removeFailed(t.blobUri()),i(t.blobUri(),a(t,o)),r(a(t,o))};c=e=>{e<0||e>100||F.from(l).orThunk((()=>F.from(n).map(L))).each((t=>{l=t,t.progressBar.value(e)}))},o(t,c).then(m,(e=>{u(h(e)?{message:e}:e)}))}catch(e){r(a(t,e))}}))))(t,r,n)))));return{upload:(e,o)=>t.url||r!==n?l(e,o):new Promise((e=>{e([])}))}},HS=e=>()=>e.notificationManager.open({text:e.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0}),IS=(e,t)=>LS(t,{url:vc(e),basePath:bc(e),credentials:yc(e),handler:wc(e)}),PS=e=>t=>{((e,t)=>e.dom.isEmpty(t.dom)&&C(e.schema.getTextBlockElements()[Wt(t)]))(e,t)&&vn(t,wo.fromHtml('
    '))},FS=e=>{const t=(()=>{let e=[];const t=e=>{if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");const t=e.id||BS("blobid"),o=e.name||t,n=e.blob;return{id:A(t),name:A(o),filename:A(e.filename||o+"."+(r=n.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[r.toLowerCase()]||"dat")),blob:A(n),base64:A(e.base64),blobUri:A(e.blobUri||URL.createObjectURL(n)),uri:A(e.uri)};var r},o=t=>ee(e,t).getOrUndefined(),n=e=>o((t=>t.id()===e));return{create:(e,o,n,r,s)=>{if(h(e))return t({id:e,name:r,filename:s,blob:o,base64:n});if(p(e))return t(e);throw new Error("Unknown input type")},add:t=>{n(t.id())||e.push(t)},get:n,getByUri:e=>o((t=>t.blobUri()===e)),getByData:(e,t)=>o((o=>o.base64()===e&&o.blob().type===t)),findFirst:o,removeByUri:t=>{e=Y(e,(e=>e.blobUri()!==t||(URL.revokeObjectURL(e.blobUri()),!1)))},destroy:()=>{q(e,(e=>{URL.revokeObjectURL(e.blobUri())})),e=[]}}})();let o,n;const r=NS(),s=[],a=t=>o=>e.selection?t(o):[],i=(e,t,o)=>{let n=0;do{n=e.indexOf(t,n),-1!==n&&(e=e.substring(0,n)+o+e.substr(n+t.length),n+=o.length-t.length+1)}while(-1!==n);return e},l=(e,t,o)=>{const n=`src="${o}"${o===Mt.transparentSrc?' data-mce-placeholder="1"':""}`;return e=i(e,`src="${t}"`,n),e=i(e,'data-mce-src="'+t+'"','data-mce-src="'+o+'"')},c=(t,o)=>{q(e.undoManager.data,(e=>{"fragmented"===e.type?e.fragments=$(e.fragments,(e=>l(e,t,o))):e.content=l(e.content,t,o)}))},d=()=>(o||(o=IS(e,r)),g().then(a((n=>{const r=$(n,(e=>e.blobInfo));return o.upload(r,HS(e)).then(a((o=>{const r=[];let s=!1;const a=$(o,((o,a)=>{const{blobInfo:i,image:l}=n[a];let d=!1;return o.status&&hc(e)?(o.url&&!je(l.src,o.url)&&(s=!0),t.removeByUri(l.src),EC(e)||((t,o)=>{const n=e.convertURL(o,"src");var r;c(t.src,o),oo(wo.fromDom(t),{src:gc(e)?(r=o,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):o,"data-mce-src":n})})(l,o.url)):o.error&&(o.error.remove&&(c(l.src,Mt.transparentSrc),r.push(l),d=!0),((e,t)=>{kS(e,_a.translate(["Failed to upload image: {0}",t]))})(e,o.error.message)),{element:l,status:o.status,uploadUri:o.url,blobInfo:i,removed:d}}));return r.length>0&&!EC(e)?e.undoManager.transact((()=>{q(Sn(r),(o=>{const n=Ao(o);xn(o),n.each(PS(e)),t.removeByUri(o.dom.src)}))})):s&&e.undoManager.dispatchChange(),a})))})))),m=()=>uc(e)?d():Promise.resolve([]),u=e=>re(s,(t=>t(e))),g=()=>(n||(n=MS(r,t)),n.findAll(e.getBody(),u).then(a((t=>{const o=Y(t,(t=>h(t)?(kS(e,t),!1):"blob"!==t.uriType));return EC(e)||q(o,(e=>{c(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")})),o})))),f=o=>o.replace(/src="(blob:[^"]+)"/g,((o,n)=>{const s=r.getResultUri(n);if(s)return'src="'+s+'"';let a=t.getByUri(n);return a||(a=J(e.editorManager.get(),((e,t)=>e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)),void 0)),a?'src="data:'+a.blob().type+";base64,"+a.base64()+'"':o}));return e.on("SetContent",(()=>{uc(e)?m():g()})),e.on("RawSaveContent",(e=>{e.content=f(e.content)})),e.on("GetContent",(e=>{e.source_view||"raw"===e.format||"tree"===e.format||(e.content=f(e.content))})),e.on("PostRender",(()=>{e.parser.addNodeFilter("img",(e=>{q(e,(e=>{const o=e.attr("src");if(!o||t.getByUri(o))return;const n=r.getResultUri(o);n&&e.attr("src",n)}))}))})),{blobCache:t,addFilter:e=>{s.push(e)},uploadImages:d,uploadImagesAuto:m,scanForImages:g,destroy:()=>{t.destroy(),r.destroy(),n=o=null}}},zS={remove_similar:!0,inherit:!1},VS={selector:"td,th",...zS},ZS={tablecellbackgroundcolor:{styles:{backgroundColor:"%value"},...VS},tablecellverticalalign:{styles:{"vertical-align":"%value"},...VS},tablecellbordercolor:{styles:{borderColor:"%value"},...VS},tablecellclass:{classes:["%value"],...VS},tableclass:{selector:"table",classes:["%value"],...zS},tablecellborderstyle:{styles:{borderStyle:"%value"},...VS},tablecellborderwidth:{styles:{borderWidth:"%value"},...VS}},US=A(ZS),jS=e=>{const t={},o=(e,n)=>{e&&(h(e)?(v(n)||(n=[n]),q(n,(e=>{w(e.deep)&&(e.deep=!ng(e)),w(e.split)&&(e.split=!ng(e)||rg(e)),w(e.remove)&&ng(e)&&!rg(e)&&(e.remove="none"),ng(e)&&rg(e)&&(e.mixed=!0,e.block_expand=!0),h(e.classes)&&(e.classes=e.classes.split(/\s+/))})),t[e]=n):ve(e,((e,t)=>{o(t,e)})))};return o((e=>{const t=e.dom,o=e.schema.type,n={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"left"},inherit:!1,preview:!1},{selector:"img,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"},{selector:"table",collapsed:!1,styles:{marginLeft:"0px",marginRight:"auto"},onformat:e=>{t.setStyle(e,"float",null)},preview:"font-family font-size"},{selector:".mce-preview-object,[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{float:"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"},{selector:".mce-preview-object",ceFalseOverride:!0,styles:{display:"table",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{marginLeft:"auto",marginRight:"auto"},preview:!1}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"},{selector:"table",collapsed:!1,styles:{marginRight:"0px",marginLeft:"auto"},onformat:e=>{t.setStyle(e,"float",null)},preview:"font-family font-size"},{selector:".mce-preview-object,[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{float:"right"},preview:!1}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"justify"},inherit:!1,preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:(()=>{const e={inline:"span",styles:{textDecoration:"line-through"},exact:!0},t={inline:"strike",remove:"all",preserve_attributes:["class","style"]},n={inline:"s",remove:"all",preserve_attributes:["class","style"]};return"html4"!==o?[n,e,t]:[e,n,t]})(),forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:(e,t,o)=>Qn(e)&&e.hasAttribute("href"),onformat:(e,o,n)=>{Lt.each(n,((o,n)=>{t.setAttrib(e,n,o)}))}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":e=>{var t;return null!==(t=null==e?void 0:e.customValue)&&void 0!==t?t:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return Lt.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),(e=>{n[e]={block:e,remove:"all"}})),n})(e)),o(US()),o(Zc(e)),{get:e=>C(e)?t[e]:t,has:e=>Ee(t,e),register:o,unregister:e=>(e&&t[e]&&delete t[e],t)}},WS=Lt.each,$S=ya.DOM,qS=e=>C(e)&&p(e),GS=(e,t)=>{const o=t&&t.schema||Us({}),n=e=>{const t=h(e)?{name:e,classes:[],attrs:{}}:e,o=$S.create(t.name);return((e,t)=>{t.classes.length>0&&$S.addClass(e,t.classes.join(" ")),$S.setAttribs(e,t.attrs)})(o,t),o},r=(e,t,s)=>{let a;const i=t[0],l=qS(i)?i.name:void 0,c=((e,t)=>{const n=o.getElementRule(e.nodeName.toLowerCase()),r=null==n?void 0:n.parentsRequired;return!(!r||!r.length)&&(t&&j(r,t)?t:r[0])})(e,l);if(c)l===c?(a=i,t=t.slice(1)):a=c;else if(i)a=i,t=t.slice(1);else if(!s)return e;const d=a?n(a):$S.create("div");d.appendChild(e),s&&Lt.each(s,(t=>{const o=n(t);d.insertBefore(o,e)}));const m=qS(a)?a.siblings:void 0;return r(d,t,m)},s=$S.create("div");if(e.length>0){const t=e[0],o=n(t),a=qS(t)?t.siblings:void 0;s.appendChild(r(o,e.slice(1),a))}return s},KS=e=>{let t="div";const o={name:t,classes:[],attrs:{},selector:e=Lt.trim(e)};return"*"!==e&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,((e,t,n,r,s)=>{switch(t){case"#":o.attrs.id=n;break;case".":o.classes.push(n);break;case":":-1!==Lt.inArray("checked disabled enabled read-only required".split(" "),n)&&(o.attrs[n]=n)}if("["===r){const e=s.match(/([\w\-]+)(?:\=\"([^\"]+))?/);e&&(o.attrs[e[1]]=e[2])}return""}))),o.name=t||"div",o},YS=(e,t)=>{let o="",n=Uc(e);if(""===n)return"";const r=e=>h(e)?e.replace(/%(\w+)/g,""):"",s=(t,o)=>$S.getStyle(null!=o?o:e.getBody(),t,!0);if(h(t)){const o=e.formatter.get(t);if(!o)return"";t=o[0]}if("preview"in t){const e=t.preview;if(!1===e)return"";n=e||n}let a,i=t.block||t.inline||"span";const l=(c=t.selector,h(c)?(c=(c=c.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),Lt.map(c.split(/(?:>|\s+(?![^\[\]]+\]))/),(e=>{const t=Lt.map(e.split(/(?:~\+|~|\+)/),KS),o=t.pop();return t.length&&(o.siblings=t),o})).reverse()):[]);var c;l.length>0?(l[0].name||(l[0].name=i),i=t.selector,a=GS(l,e)):a=GS([i],e);const d=$S.select(i,a)[0]||a.firstChild;WS(t.styles,((e,t)=>{const o=r(e);o&&$S.setStyle(d,t,o)})),WS(t.attributes,((e,t)=>{const o=r(e);o&&$S.setAttrib(d,t,o)})),WS(t.classes,(e=>{const t=r(e);$S.hasClass(d,t)||$S.addClass(d,t)})),e.dispatch("PreviewFormats"),$S.setStyles(a,{position:"absolute",left:-65535}),e.getBody().appendChild(a);const m=s("fontSize"),u=/px$/.test(m)?parseInt(m,10):0;return WS(n.split(" "),(e=>{let t=s(e,d);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=s(e),"#ffffff"===Js(t).toLowerCase())||"color"===e&&"#000000"===Js(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===u)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*u+"px"}"border"===e&&t&&(o+="padding:0 2px;"),o+=e+":"+t+";"}})),e.dispatch("AfterPreviewFormats"),$S.remove(a),o},XS=e=>{const t=jS(e),o=Rr({});return(e=>{e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(let t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])})(e),iy(e),EC(e)||((e,t)=>{e.set({}),t.on("NodeChange",(o=>{nw(t,o.element,e.get())})),t.on("FormatApply FormatRemove",(o=>{const n=F.from(o.node).map((e=>Fu(e)?e:e.startContainer)).bind((e=>Qn(e)?F.some(e):F.from(e.parentElement))).getOrThunk((()=>ew(t)));nw(t,n,e.get())}))})(o,e),{get:t.get,has:t.has,register:t.register,unregister:t.unregister,apply:(t,o,n)=>{((e,t,o,n)=>{AC(e).formatter.apply(t,o,n)})(e,t,o,n)},remove:(t,o,n,r)=>{((e,t,o,n,r)=>{AC(e).formatter.remove(t,o,n,r)})(e,t,o,n,r)},toggle:(t,o,n)=>{((e,t,o,n)=>{AC(e).formatter.toggle(t,o,n)})(e,t,o,n)},match:(t,o,n,r)=>((e,t,o,n,r)=>AC(e).formatter.match(t,o,n,r))(e,t,o,n,r),closest:t=>((e,t)=>AC(e).formatter.closest(t))(e,t),matchAll:(t,o)=>((e,t,o)=>AC(e).formatter.matchAll(t,o))(e,t,o),matchNode:(t,o,n,r)=>((e,t,o,n,r)=>AC(e).formatter.matchNode(t,o,n,r))(e,t,o,n,r),canApply:t=>((e,t)=>AC(e).formatter.canApply(t))(e,t),formatChanged:(t,n,r,s)=>((e,t,o,n,r,s)=>AC(e).formatter.formatChanged(t,o,n,r,s))(e,o,t,n,r,s),getCssText:N(YS,e)}},JS=e=>{switch(e.toLowerCase()){case"undo":case"redo":case"mcefocus":return!0;default:return!1}},QS=e=>{const t=Lr(),o=Rr(0),n=Rr(0),r={data:[],typing:!1,beforeChange:()=>{((e,t,o)=>{AC(e).undoManager.beforeChange(t,o)})(e,o,t)},add:(s,a)=>((e,t,o,n,r,s,a)=>AC(e).undoManager.add(t,o,n,r,s,a))(e,r,n,o,t,s,a),dispatchChange:()=>{e.setDirty(!0);const t=vC(e);t.bookmark=Rl(e.selection),e.dispatch("change",{level:t,lastLevel:ce(r.data,n.get()).getOrUndefined()})},undo:()=>((e,t,o,n)=>AC(e).undoManager.undo(t,o,n))(e,r,o,n),redo:()=>((e,t,o)=>AC(e).undoManager.redo(t,o))(e,n,r.data),clear:()=>{((e,t,o)=>{AC(e).undoManager.clear(t,o)})(e,r,n)},reset:()=>{((e,t)=>{AC(e).undoManager.reset(t)})(e,r)},hasUndo:()=>((e,t,o)=>AC(e).undoManager.hasUndo(t,o))(e,r,n),hasRedo:()=>((e,t,o)=>AC(e).undoManager.hasRedo(t,o))(e,r,n),transact:t=>((e,t,o,n)=>AC(e).undoManager.transact(t,o,n))(e,r,o,t),ignore:t=>{((e,t,o)=>{AC(e).undoManager.ignore(t,o)})(e,o,t)},extra:(t,o)=>{((e,t,o,n,r)=>{AC(e).undoManager.extra(t,o,n,r)})(e,r,n,t,o)}};return EC(e)||((e,t,o)=>{const n=Rr(!1),r=e=>{SC(t,!1,o),t.add({},e)};e.on("init",(()=>{t.add()})),e.on("BeforeExecCommand",(e=>{const n=e.command;JS(n)||(kC(t,o),t.beforeChange())})),e.on("ExecCommand",(e=>{const t=e.command;JS(t)||r(e)})),e.on("ObjectResizeStart cut",(()=>{t.beforeChange()})),e.on("SaveContent ObjectResized blur",r),e.on("dragend",r),e.on("keyup",(o=>{const s=o.keyCode;if(o.isDefaultPrevented())return;const a=Mt.os.isMacOS()&&"Meta"===o.key;(s>=33&&s<=36||s>=37&&s<=40||45===s||o.ctrlKey||a)&&(r(),e.nodeChanged()),46!==s&&8!==s||e.nodeChanged(),n.get()&&t.typing&&!xC(vC(e),t.data[0])&&(e.isDirty()||e.setDirty(!0),e.dispatch("TypingUndo"),n.set(!1),e.nodeChanged())})),e.on("keydown",(e=>{const s=e.keyCode;if(e.isDefaultPrevented())return;if(s>=33&&s<=36||s>=37&&s<=40||45===s)return void(t.typing&&r(e));const a=e.ctrlKey&&!e.altKey||e.metaKey;if((s<16||s>20)&&224!==s&&91!==s&&!t.typing&&!a)return t.beforeChange(),SC(t,!0,o),t.add({},e),void n.set(!0);(Mt.os.isMacOS()?e.metaKey:e.ctrlKey&&!e.altKey)&&t.beforeChange()})),e.on("mousedown",(e=>{t.typing&&r(e)})),e.on("input",(e=>{var t;e.inputType&&("insertReplacementText"===e.inputType||"insertText"===(t=e).inputType&&null===t.data||(e=>"insertFromPaste"===e.inputType||"insertFromDrop"===e.inputType)(e))&&r(e)})),e.on("AddUndo Undo Redo ClearUndos",(t=>{t.isDefaultPrevented()||e.nodeChanged()}))})(e,r,o),(e=>{e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo")})(e),r},ek=[9,27,Vg.HOME,Vg.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,Vg.DOWN,Vg.UP,Vg.LEFT,Vg.RIGHT].concat(Mt.browser.isFirefox()?[224]:[]),tk="data-mce-placeholder",ok=e=>"keydown"===e.type||"keyup"===e.type,nk=e=>{const t=e.keyCode;return t===Vg.BACKSPACE||t===Vg.DELETE},rk=e=>{var t;const o=e.dom,n=sc(e),r=null!==(t=Bc(e))&&void 0!==t?t:"",s=(t,a)=>{if((e=>{if(ok(e)){const t=e.keyCode;return!nk(e)&&(Vg.metaKeyPressed(e)||e.altKey||t>=112&&t<=123||j(ek,t))}return!1})(t))return;const i=e.getBody(),l=!(e=>ok(e)&&!(nk(e)||"keyup"===e.type&&229===e.keyCode))(t)&&((e,t,o)=>{if(e.isEmpty(t,void 0,{skipBogus:!1,includeZwsp:!0})){const n=t.firstElementChild;return!n||!e.getStyle(t.firstElementChild,"padding-left")&&!e.getStyle(t.firstElementChild,"padding-right")&&o===n.nodeName.toLowerCase()}return!1})(o,i,n);(""!==o.getAttrib(i,tk)!==l||a)&&(o.setAttrib(i,tk,l?r:null),((e,t)=>{e.dispatch("PlaceholderToggle",{state:t})})(e,l),e.on(l?"keydown":"keyup",s),e.off(l?"keyup":"keydown",s))};Xe(r)&&e.on("init",(t=>{s(t,!0),e.on("change SetContent ExecCommand",s),e.on("paste",(t=>np.setEditorTimeout(e,(()=>s(t)))))}))},sk=(e,t)=>({from:e,to:t}),ak=(e,t)=>{const o=wo.fromDom(e),n=wo.fromDom(t.container());return kv(o,n).map((e=>((e,t)=>({block:e,position:t}))(e,t)))},ik=(e,t)=>Yo(t,(e=>si(e)||fr(e.dom)),(t=>ko(t,e))).filter(Kt).getOr(e),lk=(e,t,o,n)=>{const r=ak(t,ml.fromRangeStart(n)),s=r.bind((n=>Qm(o,t,n.position).bind((n=>ak(t,n).map((n=>((e,t,o,n)=>hr(n.position.getNode())&&!Mr(e,n.block)?ou(!1,n.block.dom).bind((e=>e.isEqual(n.position)?Qm(o,t,e).bind((e=>ak(t,e))):F.some(n))).getOr(n):n)(e,t,o,n)))))));return Pt(r,s,sk).filter((e=>(e=>!ko(e.from.block,e.to.block))(e)&&((e,t)=>{const o=wo.fromDom(e);return ko(ik(o,t.from.block),ik(o,t.to.block))})(t,e)&&(e=>!1===vr(e.from.block.dom)&&!1===vr(e.to.block.dom))(e)&&(e=>{const t=e=>ti(e)||Kr(e.dom)||ni(e);return t(e.from.block)&&t(e.to.block)})(e)&&(e=>!(_o(e.to.block,e.from.block)||_o(e.from.block,e.to.block)))(e)))},ck=(e,t)=>{const o=((e,t)=>{const o=Ho(e);return te(o,(e=>t.isBlock(Wt(e)))).fold(A(o),(e=>o.slice(0,e)))})(e,t);return q(o,xn),o},dk=(e,t,o)=>{const n=xf(o,t);return ee(n.reverse(),(t=>Mr(e,t))).each(xn)},mk=(e,t,o,n,r)=>{if(Mr(n,o))return ci(o),su(o.dom);((e,t)=>0===Y(Bo(t),(t=>!Mr(e,t))).length)(n,r)&&Mr(n,t)&&hn(r,wo.fromTag("br"));const s=ru(o.dom,ml.before(r.dom));return q(ck(t,n),(e=>{hn(r,e)})),dk(n,e,t),s},uk=(e,t,o,n)=>{if(Mr(n,o)){if(Mr(n,t)){const e=e=>{const t=(e,o)=>Po(e).fold((()=>o),(e=>((e,t)=>e.isInline(Wt(t)))(n,e)?t(e,o.concat(Wa(e))):o));return t(e,[])},r=X(e(o),((e,t)=>(bn(e,t),t)),li());wn(t),vn(t,r)}return xn(o),su(t.dom)}const r=au(o.dom);return q(ck(t,n),(e=>{vn(o,e)})),dk(n,e,t),r},gk=(e,t)=>_o(t,e)?((e,t)=>{const o=xf(t,e);return F.from(o[o.length-1])})(t,e):F.none(),hk=(e,t)=>{ou(e,t.dom).bind((e=>F.from(e.getNode()))).map(wo.fromDom).filter(ei).each(xn)},pk=(e,t,o,n)=>(hk(!0,t),hk(!1,o),gk(t,o).fold(N(uk,e,t,o,n),N(mk,e,t,o,n))),fk=(e,t,o,n,r)=>t?pk(e,n,o,r):pk(e,o,n,r),vk=(e,t)=>{const o=wo.fromDom(e.getBody()),n=((e,t,o,n)=>n.collapsed?lk(e,t,o,n):F.none())(e.schema,o.dom,t,e.selection.getRng()).map((n=>()=>{fk(o,t,n.from.block,n.to.block,e.schema).each((t=>{e.selection.setRng(t.toRange())}))}));return n},bk=(e,t)=>{const o=wo.fromDom(t),n=N(ko,e);return Ko(o,si,n).isSome()},yk=(e,t)=>{const o=ru(e.dom,ml.fromRangeStart(t)).isNone(),n=nu(e.dom,ml.fromRangeEnd(t)).isNone();return!((e,t)=>bk(e,t.startContainer)||bk(e,t.endContainer))(e,t)&&o&&n},wk=e=>{const t=wo.fromDom(e.getBody()),o=e.selection.getRng();return yk(t,o)?(e=>F.some((()=>{e.setContent(""),e.selection.setCursorLocation()})))(e):((e,t,o)=>{const n=t.getRng();return Pt(kv(e,wo.fromDom(n.startContainer)),kv(e,wo.fromDom(n.endContainer)),((r,s)=>ko(r,s)?F.none():F.some((()=>{n.deleteContents(),fk(e,!0,r,s,o).each((e=>{t.setRng(e.toRange())}))})))).getOr(F.none())})(t,e.selection,e.schema)},xk=(e,t)=>e.selection.isCollapsed()?F.none():wk(e),Ck=(e,t,o,n,r)=>F.from(t._selectionOverrides.showCaret(e,o,n,r)),Sk=(e,t)=>e.dispatch("BeforeObjectSelected",{target:t}).isDefaultPrevented()?F.none():F.some((e=>{const t=e.ownerDocument.createRange();return t.selectNode(e),t})(t)),kk=(e,t,o)=>t.collapsed?((e,t,o)=>{const n=Mm(1,e.getBody(),t),r=ml.fromRangeStart(n),s=r.getNode();if(lm(s))return Ck(1,e,s,!r.isAtEnd(),!1);const a=r.getNode(!0);if(lm(a))return Ck(1,e,a,!1,!1);const i=ab(e.dom.getRoot(),r.getNode());return lm(i)?Ck(1,e,i,!1,o):F.none()})(e,t,o).getOr(t):t,_k=e=>bf(e)||hf(e),Ek=e=>yf(e)||pf(e),Tk=(e,t,o,n,r,s)=>{Ck(n,e,s.getNode(!r),r,!0).each((o=>{if(t.collapsed){const e=t.cloneRange();r?e.setEnd(o.startContainer,o.startOffset):e.setStart(o.endContainer,o.endOffset),e.deleteContents()}else t.deleteContents();e.selection.setRng(o)})),((e,t)=>{lr(t)&&0===t.data.length&&e.remove(t)})(e.dom,o)},Ok=(e,t)=>((e,t)=>{const o=e.selection.getRng();if(!lr(o.commonAncestorContainer))return F.none();const n=t?Im.Forwards:Im.Backwards,r=Gm(e.getBody()),s=N(Lm,t?r.next:r.prev),a=t?_k:Ek,i=Rm(n,e.getBody(),o),l=s(i),c=l?vv(t,l):l;if(!c||!Hm(i,c))return F.none();if(a(c))return F.some((()=>Tk(e,o,i.getNode(),n,t,c)));const d=s(c);return d&&a(d)&&Hm(c,d)?F.some((()=>Tk(e,o,i.getNode(),n,t,d))):F.none()})(e,t),Ak=(e,t)=>{const o=e.getBody();return t?su(o).filter(bf):au(o).filter(yf)},Dk=e=>{const t=e.selection.getRng();return!t.collapsed&&(Ak(e,!0).exists((e=>e.isEqual(ml.fromRangeStart(t))))||Ak(e,!1).exists((e=>e.isEqual(ml.fromRangeEnd(t)))))},Mk=Il([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),Nk=(e,t,o,n,r)=>{const s=r.getNode(!o);return kv(wo.fromDom(t),wo.fromDom(n.getNode())).map((t=>Mr(e,t)?Mk.remove(t.dom):Mk.moveToElement(s))).orThunk((()=>F.some(Mk.moveToElement(s))))},Rk=(e,t,o,n)=>Qm(t,e,o).bind((r=>{return s=r.getNode(),C(s)&&(si(wo.fromDom(s))||ni(wo.fromDom(s)))||((e,t,o,n,r)=>{const s=t=>r.isInline(t.nodeName.toLowerCase())&&!km(o,n,e);return Nm(!t,o).fold((()=>Nm(t,n).fold(I,s)),s)})(e,t,o,r,n)?F.none():t&&vr(r.getNode())||!t&&vr(r.getNode(!0))?Nk(n,e,t,o,r):t&&yf(o)||!t&&bf(o)?F.some(Mk.moveToPosition(r)):F.none();var s})),Bk=(e,t,o,n)=>((e,t)=>{const o=t.getNode(!e),n=e?"after":"before";return Qn(o)&&o.getAttribute("data-mce-caret")===n})(t,o)?((e,t)=>x(t)?F.none():e&&vr(t.nextSibling)?F.some(Mk.moveToElement(t.nextSibling)):!e&&vr(t.previousSibling)?F.some(Mk.moveToElement(t.previousSibling)):F.none())(t,o.getNode(!t)).orThunk((()=>Rk(e,t,o,n))):Rk(e,t,o,n).bind((t=>((e,t,o)=>o.fold((e=>F.some(Mk.remove(e))),(e=>F.some(Mk.moveToElement(e))),(o=>km(t,o,e)?F.none():F.some(Mk.moveToPosition(o)))))(e,o,t))),Lk=(e,t)=>F.from(ab(e.getBody(),t)),Hk=(e,t)=>{const o=e.selection.getNode();return Lk(e,o).filter(vr).fold((()=>((e,t,o,n)=>{const r=Mm(t?1:-1,e,o),s=ml.fromRangeStart(r),a=wo.fromDom(e);return!t&&yf(s)?F.some(Mk.remove(s.getNode(!0))):t&&bf(s)?F.some(Mk.remove(s.getNode())):!t&&bf(s)&&Rf(a,s,n)?Bf(a,s,n).map((e=>Mk.remove(e.getNode()))):t&&yf(s)&&Nf(a,s,n)?Lf(a,s,n).map((e=>Mk.remove(e.getNode()))):Bk(e,t,s,n)})(e.getBody(),t,e.selection.getRng(),e.schema).map((o=>()=>o.fold(((e,t)=>o=>(e._selectionOverrides.hideFakeCaret(),uv(e,t,wo.fromDom(o)),!0))(e,t),((e,t)=>o=>{const n=t?ml.before(o):ml.after(o);return e.selection.setRng(n.toRange()),!0})(e,t),(e=>t=>(e.selection.setRng(t.toRange()),!0))(e))))),(()=>F.some(E)))},Ik=(e,t)=>{const o=e.selection.getNode();return vr(o)&&!br(o)?Lk(e,o.parentNode).filter(vr).fold((()=>F.some((()=>{var o;o=wo.fromDom(e.getBody()),q(Fn(o,".mce-offscreen-selection"),xn),uv(e,t,wo.fromDom(e.selection.getNode())),_v(e)}))),(()=>F.some(E))):Dk(e)?F.some((()=>{Ov(e,e.selection.getRng(),wo.fromDom(e.getBody()))})):F.none()},Pk=e=>{const t=e.dom,o=e.selection,n=ab(e.getBody(),o.getNode());if(fr(n)&&t.isBlock(n)&&t.isEmpty(n)){const e=t.create("br",{"data-mce-bogus":"1"});t.setHTML(n,""),n.appendChild(e),o.setRng(ml.before(e).toRange())}return!0},Fk=(e,t)=>e.selection.isCollapsed()?Hk(e,t):Ik(e,t),zk=e=>e.hasOwnProperty("text"),Vk=e=>e.hasOwnProperty("marker"),Zk=(e,t)=>{const o=(e,o)=>{if(lr(e))return{text:e,offset:o};{const n=t(),r=e.childNodes;return o{var t,o;const{start:n,end:r}=e,s=new window.Range;return zk(n)?s.setStart(n.text,n.offset):Vk(n)&&(n.before?s.setStartBefore(n.marker):s.setStartAfter(n.marker),null===(t=n.marker.parentNode)||void 0===t||t.removeChild(n.marker)),zk(r)?s.setEnd(r.text,r.offset):Vk(r)&&(r.before?s.setEndBefore(r.marker):s.setEndAfter(r.marker),null===(o=r.marker.parentNode)||void 0===o||o.removeChild(r.marker)),s},jk=(e,t)=>{var o;const n=e.dom,r=n.getParent(e.selection.getStart(),n.isBlock),s=n.getParent(e.selection.getEnd(),n.isBlock),a=e.getBody();if("div"===(null===(o=null==r?void 0:r.nodeName)||void 0===o?void 0:o.toLowerCase())&&r&&s&&r===a.firstChild&&s===a.lastChild&&!n.isEmpty(a)){const o=r.cloneNode(!1),n=()=>{if(t?Cv(e):xv(e),a.firstChild!==r){const t=Zk(e.selection.getRng(),(()=>document.createElement("span")));Array.from(a.childNodes).forEach((e=>o.appendChild(e))),a.appendChild(o),e.selection.setRng(Uk(t))}};return F.some(n)}return F.none()},Wk=(e,t)=>e.selection.isCollapsed()?((e,t)=>{const o=ml.fromRangeStart(e.selection.getRng());return Qm(t,e.getBody(),o).filter((e=>t?uf(e):gf(e))).bind((e=>_m(t?0:-1,e))).map((t=>()=>e.selection.select(t)))})(e,t):F.none(),$k=lr,qk=e=>$k(e)&&e.data[0]===di,Gk=e=>$k(e)&&e.data[e.data.length-1]===di,Kk=e=>{var t;return(null!==(t=e.ownerDocument)&&void 0!==t?t:document).createTextNode(di)},Yk=(e,t)=>e?(e=>{var t;if($k(e.previousSibling))return Gk(e.previousSibling)||e.previousSibling.appendData(di),e.previousSibling;if($k(e))return qk(e)||e.insertData(0,di),e;{const o=Kk(e);return null===(t=e.parentNode)||void 0===t||t.insertBefore(o,e),o}})(t):(e=>{var t,o;if($k(e.nextSibling))return qk(e.nextSibling)||e.nextSibling.insertData(0,di),e.nextSibling;if($k(e))return Gk(e)||e.appendData(di),e;{const n=Kk(e);return e.nextSibling?null===(t=e.parentNode)||void 0===t||t.insertBefore(n,e.nextSibling):null===(o=e.parentNode)||void 0===o||o.appendChild(n),n}})(t),Xk=N(Yk,!0),Jk=N(Yk,!1),Qk=(e,t)=>lr(e.container())?Yk(t,e.container()):Yk(t,e.getNode()),e_=(e,t)=>{const o=t.get();return o&&e.container()===o&&fi(o)},t_=(e,t)=>t.fold((t=>{tm(e.get());const o=Xk(t);return e.set(o),F.some(ml(o,o.length-1))}),(t=>su(t).map((t=>{if(e_(t,e)){const t=e.get();return ml(t,1)}{tm(e.get());const o=Qk(t,!0);return e.set(o),ml(o,1)}}))),(t=>au(t).map((t=>{if(e_(t,e)){const t=e.get();return ml(t,t.length-1)}{tm(e.get());const o=Qk(t,!1);return e.set(o),ml(o,o.length-1)}}))),(t=>{tm(e.get());const o=Jk(t);return e.set(o),F.some(ml(o,1))})),o_=(e,t)=>{for(let o=0;o{const o=Sm(t,e);return o||e},s_=(e,t,o)=>{const n=bv(o),r=r_(t,n.container());return fv(e,r,n).fold((()=>nu(r,n).bind(N(fv,e,r)).map((e=>n_.before(e)))),F.none)},a_=(e,t)=>null===cu(e,t),i_=(e,t,o)=>fv(e,t,o).filter(N(a_,t)),l_=(e,t,o)=>{const n=yv(o);return i_(e,t,n).bind((e=>ru(e,n).isNone()?F.some(n_.start(e)):F.none()))},c_=(e,t,o)=>{const n=bv(o);return i_(e,t,n).bind((e=>nu(e,n).isNone()?F.some(n_.end(e)):F.none()))},d_=(e,t,o)=>{const n=yv(o),r=r_(t,n.container());return fv(e,r,n).fold((()=>ru(r,n).bind(N(fv,e,r)).map((e=>n_.after(e)))),F.none)},m_=e=>!pv(g_(e)),u_=(e,t,o)=>o_([s_,l_,c_,d_],[e,t,o]).filter(m_),g_=e=>e.fold(D,D,D,D),h_=e=>e.fold(A("before"),A("start"),A("end"),A("after")),p_=e=>e.fold(n_.before,n_.before,n_.after,n_.after),f_=e=>e.fold(n_.start,n_.start,n_.end,n_.end),v_=(e,t,o,n,r,s)=>Pt(fv(t,o,n),fv(t,o,r),((t,n)=>t!==n&&((e,t,o)=>{const n=Sm(t,e),r=Sm(o,e);return C(n)&&n===r})(o,t,n)?n_.after(e?t:n):s)).getOr(s),b_=(e,t)=>e.fold(P,(e=>{return n=t,!(h_(o=e)===h_(n)&&g_(o)===g_(n));var o,n})),y_=(e,t)=>e?t.fold(T(F.some,n_.start),F.none,T(F.some,n_.after),F.none):t.fold(F.none,T(F.some,n_.before),F.none,T(F.some,n_.end)),w_=(e,t,o,n)=>{const r=vv(e,n),s=u_(t,o,r);return u_(t,o,r).bind(N(y_,e)).orThunk((()=>((e,t,o,n,r)=>{const s=vv(e,r);return Qm(e,o,s).map(N(vv,e)).fold((()=>n.map(p_)),(r=>u_(t,o,r).map(N(v_,e,t,o,s,r)).filter(N(b_,n)))).filter(m_)})(e,t,o,s,n)))},x_=(e,t,o)=>{const n=e?1:-1;return t.setRng(ml(o.container(),o.offset()+n).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},C_=(e,t)=>{const o=t.selection.getRng(),n=e?ml.fromRangeEnd(o):ml.fromRangeStart(o);return!!(e=>S(e.selection.getSel().modify))(t)&&(e&&yi(n)?x_(!0,t.selection,n):!(e||!wi(n))&&x_(!1,t.selection,n))};var S_;!function(e){e[e.Br=0]="Br",e[e.Block=1]="Block",e[e.Wrap=2]="Wrap",e[e.Eol=3]="Eol"}(S_||(S_={}));const k_=(e,t)=>e===Im.Backwards?se(t):t,__=(e,t,o)=>e===Im.Forwards?t.next(o):t.prev(o),E_=(e,t,o,n)=>hr(n.getNode(t===Im.Forwards))?S_.Br:!1===km(o,n)?S_.Block:S_.Wrap,T_=(e,t,o,n)=>{const r=Gm(o);let s=n;const a=[];for(;s;){const o=__(t,r,s);if(!o)break;if(hr(o.getNode(!1)))return t===Im.Forwards?{positions:k_(t,a).concat([o]),breakType:S_.Br,breakAt:F.some(o)}:{positions:k_(t,a),breakType:S_.Br,breakAt:F.some(o)};if(o.isVisible()){if(e(s,o)){const e=E_(0,t,s,o);return{positions:k_(t,a),breakType:e,breakAt:F.some(o)}}a.push(o),s=o}else s=o}return{positions:k_(t,a),breakType:S_.Eol,breakAt:F.none()}},O_=(e,t,o,n)=>t(o,n).breakAt.map((n=>{const r=t(o,n).positions;return e===Im.Backwards?r.concat(n):[n].concat(r)})).getOr([]),A_=(e,t)=>J(e,((e,o)=>e.fold((()=>F.some(o)),(n=>Pt(de(n.getClientRects()),de(o.getClientRects()),((e,r)=>{const s=Math.abs(t-e.left);return Math.abs(t-r.left)<=s?o:n})).or(e)))),F.none()),D_=(e,t)=>de(t.getClientRects()).bind((t=>A_(e,t.left))),M_=N(T_,ml.isAbove,-1),N_=N(T_,ml.isBelow,1),R_=N(O_,-1,M_),B_=N(O_,1,N_),L_=(e,t)=>M_(e,t).breakAt.isNone(),H_=(e,t)=>N_(e,t).breakAt.isNone(),I_=(e,t)=>D_(R_(e,t),t),P_=(e,t)=>D_(B_(e,t),t),F_=vr,z_=(e,t)=>Math.abs(e.left-t),V_=(e,t)=>Math.abs(e.right-t),Z_=(e,t)=>Be(e,((e,o)=>{const n=Math.min(z_(e,t),V_(e,t)),r=Math.min(z_(o,t),V_(o,t));return r===n&&Te(o,"node")&&F_(o.node)||r{const t=t=>$(t,(t=>{const o=Ei(t);return o.node=e,o}));if(Qn(e))return t(e.getClientRects());if(lr(e)){const o=e.ownerDocument.createRange();return o.setStart(e,0),o.setEnd(e,e.data.length),t(o.getClientRects())}return[]},j_=e=>ne(e,U_);var W_;!function(e){e[e.Up=-1]="Up",e[e.Down=1]="Down"}(W_||(W_={}));const $_=(e,t,o,n,r,s)=>{let a=0;const i=[],l=n=>{let s=j_([n]);-1===e&&(s=s.reverse());for(let e=0;e0&&t(n,He(i))&&a++,n.line=a,r(n))return!0;i.push(n)}}return!1},c=He(s.getClientRects());if(!c)return i;const d=s.getNode();return d&&(l(d),((e,t,o,n)=>{let r=n;for(;r=Cm(r,e,$i,t);)if(o(r))return})(e,n,l,d)),i},q_=N($_,W_.Up,Ai,Di),G_=N($_,W_.Down,Di,Ai),K_=e=>He(e.getClientRects()),Y_=e=>t=>((e,t)=>t.line>e)(e,t),X_=e=>t=>((e,t)=>t.line===e)(e,t),J_=(e,t)=>{e.selection.setRng(t),Uh(e,e.selection.getRng())},Q_=(e,t,o)=>F.some(kk(e,t,o)),eE=(e,t,o,n,r,s)=>{const a=t===Im.Forwards,i=Gm(e.getBody()),l=N(Lm,a?i.next:i.prev),c=a?n:r;if(!o.collapsed){const n=Ni(o);if(s(n))return Ck(t,e,n,t===Im.Backwards,!1);if(Dk(e)){const e=o.cloneRange();return e.collapse(t===Im.Backwards),F.from(e)}}const d=Rm(t,e.getBody(),o);if(c(d))return Sk(e,d.getNode(!a));let m=l(d);const u=ki(o);if(!m)return u?F.some(o):F.none();if(m=vv(a,m),c(m))return Ck(t,e,m.getNode(!a),a,!1);const g=l(m);return g&&c(g)&&Hm(m,g)?Ck(t,e,g.getNode(!a),a,!1):u?Q_(e,m.toRange(),!1):F.none()},tE=(e,t,o,n,r,s)=>{const a=Rm(t,e.getBody(),o),i=He(a.getClientRects()),l=t===W_.Down,c=e.getBody();if(!i)return F.none();if(Dk(e)){const e=l?ml.fromRangeEnd(o):ml.fromRangeStart(o);return(l?P_:I_)(c,e).orThunk((()=>F.from(e))).map((e=>e.toRange()))}const d=(l?G_:q_)(c,Y_(1),a),m=Y(d,X_(1)),u=i.left,g=Z_(m,u);if(g&&s(g.node)){const o=Math.abs(u-g.left),n=Math.abs(u-g.right);return Ck(t,e,g.node,o{const r=Gm(t);let s,a,i,l;const c=[];let d=0;1===e?(s=r.next,a=Di,i=Ai,l=ml.after(n)):(s=r.prev,a=Ai,i=Di,l=ml.before(n));const m=K_(l);do{if(!l.isVisible())continue;const e=K_(l);if(i(e,m))continue;c.length>0&&a(e,He(c))&&d++;const t=Ei(e);if(t.position=l,t.line=d,o(t))return c;c.push(t)}while(l=s(l));return c})(t,c,Y_(1),h);let n=Z_(Y(o,X_(1)),u);if(n)return Q_(e,n.position.toRange(),!1);if(n=He(Y(o,X_(0))),n)return Q_(e,n.position.toRange(),!1)}return 0===m.length?oE(e,l).filter(l?r:n).map((t=>kk(e,t.toRange(),!1))):F.none()},oE=(e,t)=>{const o=e.selection.getRng(),n=t?ml.fromRangeEnd(o):ml.fromRangeStart(o),r=(s=n.container(),a=e.getBody(),Ko(wo.fromDom(s),(e=>dm(e.dom)),(e=>e.dom===a)).map((e=>e.dom)).getOr(a));var s,a;if(t){const e=N_(r,n);return me(e.positions)}{const e=M_(r,n);return de(e.positions)}},nE=(e,t,o)=>oE(e,t).filter(o).exists((t=>(e.selection.setRng(t.toRange()),!0))),rE=(e,t)=>{const o=e.dom.createRng();o.setStart(t.container(),t.offset()),o.setEnd(t.container(),t.offset()),e.selection.setRng(o)},sE=(e,t)=>{e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},aE=(e,t,o)=>t_(t,o).map((t=>(rE(e,t),o))),iE=(e,t,o)=>{const n=e.getBody(),r=((e,t,o)=>{const n=ml.fromRangeStart(e);if(e.collapsed)return n;{const r=ml.fromRangeEnd(e);return o?ru(t,r).getOr(r):nu(t,n).getOr(n)}})(e.selection.getRng(),n,o),s=N(hv,e);return w_(o,s,n,r).bind((o=>aE(e,t,o)))},lE=(e,t)=>{const o=t.get();if(e.selection.isCollapsed()&&!e.composing&&o){const n=ml.fromRangeStart(e.selection.getRng());ml.isTextPosition(n)&&!(e=>yi(e)||wi(e))(n)&&(rE(e,em(o,n)),t.set(null))}},cE=(e,t,o)=>!!Vc(e)&&iE(e,t,o).isSome(),dE=(e,t,o)=>!!Vc(t)&&C_(e,t),mE=e=>{const t=Rr(null),o=N(hv,e);return e.on("NodeChange",(n=>{Vc(e)&&(((e,t,o)=>{const n=$(Fn(wo.fromDom(t.getRoot()),'*[data-mce-selected="inline-boundary"]'),(e=>e.dom)),r=Y(n,e),s=Y(o,e);q(ae(r,s),N(sE,!1)),q(ae(s,r),N(sE,!0))})(o,e.dom,n.parents),lE(e,t),((e,t,o,n)=>{if(t.selection.isCollapsed()){const r=Y(n,e);q(r,(n=>{const r=ml.fromRangeStart(t.selection.getRng());u_(e,t.getBody(),r).bind((e=>aE(t,o,e)))}))}})(o,e,t,n.parents))})),t},uE=N(dE,!0),gE=N(dE,!1),hE=(e,t,o)=>{if(Vc(e)){const n=oE(e,t).getOrThunk((()=>{const o=e.selection.getRng();return t?ml.fromRangeEnd(o):ml.fromRangeStart(o)}));return u_(N(hv,e),e.getBody(),n).exists((t=>{const n=p_(t);return t_(o,n).exists((t=>(rE(e,t),!0)))}))}return!1},pE=(e,t)=>o=>t_(t,o).map((t=>()=>rE(e,t))),fE=(e,t,o,n)=>{const r=e.getBody(),s=N(hv,e);e.undoManager.ignore((()=>{e.selection.setRng(((e,t)=>{const o=document.createRange();return o.setStart(e.container(),e.offset()),o.setEnd(t.container(),t.offset()),o})(o,n)),xv(e),u_(s,r,ml.fromRangeStart(e.selection.getRng())).map(f_).bind(pE(e,t)).each(H)})),e.nodeChanged()},vE=(e,t,o,n)=>{const r=((e,t)=>{const o=Sm(t,e);return o||e})(e.getBody(),n.container()),s=N(hv,e),a=u_(s,r,n);return a.bind((e=>o?e.fold(A(F.some(f_(e))),F.none,A(F.some(p_(e))),F.none):e.fold(F.none,A(F.some(p_(e))),F.none,A(F.some(f_(e)))))).map(pE(e,t)).getOrThunk((()=>{const i=eu(o,r,n),l=i.bind((e=>u_(s,r,e)));return Pt(a,l,(()=>fv(s,r,n).bind((t=>(e=>Pt(su(e),au(e),((t,o)=>{const n=vv(!0,t),r=vv(!1,o);return nu(e,n).forall((e=>e.isEqual(r)))})).getOr(!0))(t)?F.some((()=>{uv(e,o,wo.fromDom(t))})):F.none())))).getOrThunk((()=>l.bind((()=>i.map((r=>()=>{o?fE(e,t,n,r):fE(e,t,r,n)}))))))}))},bE=(e,t,o)=>{if(e.selection.isCollapsed()&&Vc(e)){const n=ml.fromRangeStart(e.selection.getRng());return vE(e,t,o,n)}return F.none()},yE=(e,t)=>{const o=wo.fromDom(e.getBody()),n=wo.fromDom(e.selection.getStart()),r=xf(n,o);return te(r,t).fold(A(r),(e=>r.slice(0,e)))},wE=e=>1===zo(e),xE=e=>yE(e,(t=>e.schema.isBlock(Wt(t))||(e=>zo(e)>1)(t))),CE=(e,t)=>{const o=N(dy,e);return ne(t,(e=>o(e)?[e.dom]:[]))},SE=e=>{const t=(e=>yE(e,(t=>e.schema.isBlock(Wt(t)))))(e);return CE(e,t)},kE=(e,t)=>{const o=Y(xE(e),wE);return me(o).bind((n=>{const r=ml.fromRangeStart(e.selection.getRng());return Ev(t,r,n.dom)&&!ig(n)?F.some((()=>((e,t,o,n)=>{const r=CE(t,n);if(0===r.length)uv(t,e,o);else{const e=cy(o.dom,r);t.selection.setRng(e.toRange())}})(t,e,n,o))):F.none()}))},_E=(e,t)=>{const o=e.selection.getStart(),n=((e,t)=>{const o=t.parentElement;return hr(t)&&!b(o)&&e.dom.isEmpty(o)})(e,o)||(r=o,ig(wo.fromDom(r)))?cy(o,t):((e,t)=>{const{caretContainer:o,caretPosition:n}=ly(t);return e.insertNode(o.dom),n})(e.selection.getRng(),t);var r;e.selection.setRng(n.toRange())},EE=e=>lr(e.startContainer),TE=e=>(e=>{const t=e.startContainer.parentNode,o=e.endContainer.parentNode;return!b(t)&&!b(o)&&t.isEqualNode(o)})(e)&&(e=>{const t=e.endContainer;return e.endOffset===(lr(t)?t.length:t.childNodes.length)})(e),OE=e=>{const t=e.selection.getRng();return(e=>0===e.startOffset&&EE(e))(t)&&((e,t)=>{const o=t.startContainer.parentElement;return!b(o)&&dy(e,wo.fromDom(o))})(e,t)&&(e=>TE(e)||(e=>!e.endContainer.isEqualNode(e.commonAncestorContainer))(e))(t)},AE=e=>{if(OE(e)){const t=SE(e);return F.some((()=>{xv(e),((e,t)=>{const o=ae(t,SE(e));o.length>0&&_E(e,o)})(e,t)}))}return F.none()},DE=(e,t)=>e.selection.isCollapsed()?kE(e,t):AE(e),ME=e=>{return t=wo.fromDom(e.selection.getStart()),o=e.schema,zn(t,(e=>lu(e.dom)),(e=>o.isBlock(Wt(e))));var t,o},NE=e=>((e=>{const t=e.selection.getRng();return t.collapsed&&(EE(t)||e.dom.isEmpty(t.startContainer))&&!ME(e)})(e)&&_E(e,[]),!0),RE=(e,t,o)=>C(o)?F.some((()=>{e._selectionOverrides.hideFakeCaret(),uv(e,t,wo.fromDom(o))})):F.none(),BE=(e,t)=>e.selection.isCollapsed()?((e,t)=>{const o=t?hf:pf,n=t?Im.Forwards:Im.Backwards,r=Rm(n,e.getBody(),e.selection.getRng());return o(r)?RE(e,t,r.getNode(!t)):F.from(vv(t,r)).filter((e=>o(e)&&Hm(r,e))).bind((o=>RE(e,t,o.getNode(!t))))})(e,t):((e,t)=>{const o=e.selection.getNode();return wr(o)?RE(e,t,o):F.none()})(e,t),LE=e=>Qe(null!=e?e:"").getOr(0),HE=(e,t)=>(e||"table"===Wt(t)?"margin":"padding")+("rtl"===cn(t,"direction")?"-right":"-left"),IE=e=>{const t=FE(e);return!e.mode.isReadOnly()&&(t.length>1||((e,t)=>re(t,(t=>{const o=HE(_c(e),t),n=mn(t,o).map(LE).getOr(0);return"false"!==e.dom.getContentEditable(t.dom)&&n>0})))(e,t))},PE=e=>oi(e)||ni(e),FE=e=>Y(Sn(e.selection.getSelectedBlocks()),(e=>!PE(e)&&!(e=>Ao(e).exists(PE))(e)&&Yo(e,(e=>fr(e.dom)||vr(e.dom))).exists((e=>fr(e.dom))))),zE=(e,t)=>{var o,n;const{dom:r}=e,s=Ec(e),a=null!==(n=null===(o=/[a-z%]+$/i.exec(s))||void 0===o?void 0:o[0])&&void 0!==n?n:"px",i=LE(s),l=_c(e);q(FE(e),(e=>{((e,t,o,n,r,s)=>{const a=HE(o,wo.fromDom(s)),i=LE(e.getStyle(s,a));if("outdent"===t){const t=Math.max(0,i-n);e.setStyle(s,a,t?t+r:"")}else{const t=i+n+r;e.setStyle(s,a,t)}})(r,t,l,i,a,e.dom)}))},VE=e=>zE(e,"outdent"),ZE=e=>{if(e.selection.isCollapsed()&&IE(e)){const t=e.dom,o=e.selection.getRng(),n=ml.fromRangeStart(o),r=t.getParent(o.startContainer,t.isBlock);if(null!==r&&Ef(wo.fromDom(r),n,e.schema))return F.some((()=>VE(e)))}return F.none()},UE=(e,t,o)=>ge([ZE,Fk,Ok,(e,o)=>bE(e,t,o),vk,sb,Wk,BE,xk,DE,jk],(t=>t(e,o))).filter((t=>e.selection.isEditable())),jE=(e,t)=>{e.addCommand("delete",(()=>{((e,t)=>{UE(e,t,!1).fold((()=>{e.selection.isEditable()&&(xv(e),_v(e))}),H)})(e,t)})),e.addCommand("forwardDelete",(()=>{((e,t)=>{UE(e,t,!0).fold((()=>{e.selection.isEditable()&&Cv(e)}),H)})(e,t)}))},WE=e=>void 0===e.touches||1!==e.touches.length?F.none():F.some(e.touches[0]),$E=e=>{const t=Lr(),o=Rr(!1),n=Oa((t=>{e.dispatch("longpress",{...t,type:"longpress"}),o.set(!0)}),400);e.on("touchstart",(e=>{WE(e).each((r=>{n.cancel();const s={x:r.clientX,y:r.clientY,target:e.target};n.throttle(e),o.set(!1),t.set(s)}))}),!0),e.on("touchmove",(r=>{n.cancel(),WE(r).each((n=>{t.on((r=>{((e,t)=>{const o=Math.abs(e.clientX-t.x),n=Math.abs(e.clientY-t.y);return o>5||n>5})(n,r)&&(t.clear(),o.set(!1),e.dispatch("longpresscancel"))}))}))}),!0),e.on("touchend touchcancel",(r=>{n.cancel(),"touchcancel"!==r.type&&t.get().filter((e=>e.target.isEqualNode(r.target))).each((()=>{o.get()?r.preventDefault():e.dispatch("tap",{...r,type:"tap"})}))}),!0)},qE=(e,t)=>Ee(e,t.nodeName),GE=(e,t)=>!!lr(t)||!!Qn(t)&&!(qE(e.getBlockElements(),t)||Cu(t)||Jr(e,t)||Pr(t)),KE=(e,t)=>{if(lr(t)){if(0===t.data.length)return!0;if(/^\s+$/.test(t.data))return!t.nextSibling||qE(e,t.nextSibling)||Pr(t.nextSibling)}return!1},YE=e=>e.dom.create(sc(e),ac(e)),XE=e=>{const t=e.dom,o=e.selection,n=e.schema,r=n.getBlockElements(),s=o.getStart(),a=e.getBody();let i,l,c=null;const d=sc(e);if(!s||!Qn(s))return;const m=a.nodeName.toLowerCase();if(!n.isValidChild(m,d.toLowerCase())||((e,t,o)=>W(wf(wo.fromDom(o),wo.fromDom(t)),(t=>qE(e,t.dom))))(r,a,s))return;if(a.firstChild===a.lastChild&&hr(a.firstChild))return i=YE(e),i.appendChild(li().dom),a.replaceChild(i,a.firstChild),e.selection.setCursorLocation(i,0),void e.nodeChanged();let u=a.firstChild;for(;u;)if(Qn(u)&&Gr(n,u),GE(n,u)){if(KE(r,u)){l=u,u=u.nextSibling,t.remove(l);continue}if(!i){if(!c&&e.hasFocus()&&(c=Zk(e.selection.getRng(),(()=>document.createElement("span")))),!u.parentNode){u=null;break}i=YE(e),a.insertBefore(i,u)}l=u,u=u.nextSibling,i.appendChild(l)}else i=null,u=u.nextSibling;c&&(e.selection.setRng(Uk(c)),e.nodeChanged())},JE=(e,t,o)=>{const n=wo.fromDom(YE(e)),r=li();vn(n,r),o(t,n);const s=document.createRange();return s.setStartBefore(r.dom),s.setEndBefore(r.dom),s},QE=e=>t=>-1!==(" "+t.attr("class")+" ").indexOf(e),eT=(e,t,o)=>function(n){const r=arguments,s=r[r.length-2],a=s>0?t.charAt(s-1):"";if('"'===a)return n;if(">"===a){const e=t.lastIndexOf("<",s);if(-1!==e&&-1!==t.substring(e,s).indexOf('contenteditable="false"'))return n}return''+e.dom.encode("string"==typeof r[1]?r[1]:r[0])+""},tT=(e,t)=>re(e,(e=>{const o=t.match(e);return null!==o&&o[0].length===t.length})),oT=e=>{const t="contenteditable",o=" "+Lt.trim(Md(e))+" ",n=" "+Lt.trim(Dd(e))+" ",r=QE(o),s=QE(n),a=Nd(e);a.length>0&&e.on("BeforeSetContent",(t=>{((e,t,o)=>{let n=t.length,r=o.content;if("raw"!==o.format){for(;n--;)r=r.replace(t[n],eT(e,r,Dd(e)));o.content=r}})(e,a,t)})),e.parser.addAttributeFilter("class",(e=>{let o=e.length;for(;o--;){const n=e[o];r(n)?n.attr(t,"true"):s(n)&&n.attr(t,"false")}})),e.serializer.addAttributeFilter(t,(e=>{let o=e.length;for(;o--;){const n=e[o];if(!r(n)&&!s(n))continue;const i=n.attr("data-mce-content");a.length>0&&i?tT(a,i)?(n.name="#text",n.type=3,n.raw=!0,n.value=i):n.remove():n.attr(t,null)}}))},nT=(e,t)=>{t.hasAttribute("data-mce-caret")&&(Si(t),e.selection.setRng(e.selection.getRng()),e.selection.scrollIntoView(t))},rT=(e,t)=>{const o=(e=>en(wo.fromDom(e.getBody()),"*[data-mce-caret]").map((e=>e.dom)).getOrNull())(e);if(o)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void nT(e,o)):void(bi(o)&&(nT(e,o),e.undoManager.add()))},sT=vr,aT=(e,t,o)=>{const n=Gm(e.getBody()),r=N(Lm,1===t?n.next:n.prev);if(o.collapsed){const n=e.dom.getParent(o.startContainer,"PRE");if(!n)return;if(!r(ml.fromRangeStart(o))){const o=wo.fromDom((e=>{const t=e.dom.create(sc(e));return t.innerHTML='
    ',t})(e));1===t?pn(wo.fromDom(n),o):hn(wo.fromDom(n),o),e.selection.select(o.dom,!0),e.selection.collapse()}}},iT=(e,t)=>{const o=t?Im.Forwards:Im.Backwards,n=e.selection.getRng();return((e,t,o)=>eE(t,e,o,bf,yf,sT))(o,e,n).orThunk((()=>(aT(e,o,n),F.none())))},lT=(e,t)=>{const o=t?1:-1,n=e.selection.getRng();return((e,t,o)=>tE(t,e,o,(e=>bf(e)||ff(e)),(e=>yf(e)||vf(e)),sT))(o,e,n).orThunk((()=>(aT(e,o,n),F.none())))},cT=(e,t)=>iT(e,((e,t)=>{const o=t?e.getEnd(!0):e.getStart(!0);return pv(o)?!t:t})(e.selection,t)).exists((t=>(J_(e,t),!0))),dT=(e,t)=>lT(e,t).exists((t=>(J_(e,t),!0))),mT=(e,t)=>nE(e,t,t?yf:bf),uT=(e,t)=>Ak(e,!t).map((o=>{const n=o.toRange(),r=e.selection.getRng();return t?n.setStart(r.startContainer,r.startOffset):n.setEnd(r.endContainer,r.endOffset),n})).exists((t=>(J_(e,t),!0))),gT=e=>j(["figcaption"],Wt(e)),hT=(e,t)=>{const o=wo.fromDom(e.getBody()),n=ml.fromRangeStart(e.selection.getRng());return((e,t,o)=>{const n=N(ko,t);return Yo(wo.fromDom(e.container()),(e=>o.isBlock(Wt(e))),n).filter(gT)})(n,o,e.schema).exists((()=>{if(((e,t,o)=>t?H_(e.dom,o):L_(e.dom,o))(o,t,n)){const n=JE(e,o,t?vn:fn);return e.selection.setRng(n),!0}return!1}))},pT=(e,t)=>!!e.selection.isCollapsed()&&hT(e,t),fT=(e,t)=>t?F.from(e.dom.getParent(e.selection.getNode(),"details")).map((t=>((e,t)=>{const o=e.selection.getRng(),n=ml.fromRangeStart(o);return!(e.getBody().lastChild!==t||!H_(t,n)||(e.execCommand("InsertNewBlockAfter"),0))})(e,t))).getOr(!1):F.from(e.dom.getParent(e.selection.getNode(),"summary")).bind((t=>F.from(e.dom.getParent(t,"details")).map((o=>((e,t,o)=>{const n=e.selection.getRng(),r=ml.fromRangeStart(n);return!(e.getBody().firstChild!==t||!L_(o,r)||(e.execCommand("InsertNewBlockBefore"),0))})(e,o,t))))).getOr(!1),vT=(e,t)=>fT(e,t),bT={shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0},yT=(e,t)=>t.keyCode===e.keyCode&&t.shiftKey===e.shiftKey&&t.altKey===e.altKey&&t.ctrlKey===e.ctrlKey&&t.metaKey===e.metaKey,wT=(e,t)=>ne((e=>$(e,(e=>({...bT,...e}))))(e),(e=>yT(e,t)?[e]:[])),xT=(e,t)=>ne((e=>$(e,(e=>({...bT,...e}))))(e),(e=>yT(e,t)?[e]:[])),CT=(e,...t)=>()=>e.apply(null,t),ST=(e,t)=>ee(wT(e,t),(e=>e.action())),kT=(e,t)=>ge(xT(e,t),(e=>e.action())),_T=(e,t)=>{const o=t?Im.Forwards:Im.Backwards,n=e.selection.getRng();return eE(e,o,n,hf,pf,wr).exists((t=>(J_(e,t),!0)))},ET=(e,t)=>{const o=t?1:-1,n=e.selection.getRng();return tE(e,o,n,hf,pf,wr).exists((t=>(J_(e,t),!0)))},TT=(e,t)=>nE(e,t,t?pf:hf),OT=Il([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),AT={...OT,none:e=>OT.none(e)},DT=(e,t,o)=>ne(Ho(e),(e=>Co(e,t)?o(e)?[e]:[]:DT(e,t,o))),MT=(e,t)=>((e,t,o=I)=>o(t)?F.none():j(e,Wt(t))?F.some(t):Qo(t,e.join(","),(e=>Co(e,"table")||o(e))))(["td","th"],e,t),NT=e=>DT(e,"th,td",P),RT=(e,t)=>tn(e,"table",t),BT=(e,t,o,n,r=P)=>{const s=1===n;if(!s&&o<=0)return AT.first(e[0]);if(s&&o>=e.length-1)return AT.last(e[e.length-1]);{const s=o+n,a=e[s];return r(a)?AT.middle(t,a):BT(e,t,s,n,r)}},LT=(e,t)=>RT(e,t).bind((t=>{const o=NT(t);return te(o,(t=>ko(e,t))).map((e=>({index:e,all:o})))})),HT=e=>{return(t=e,Ya.getOption(t)).filter((e=>0!==e.trim().length||e.indexOf(Wn)>-1)).isSome();var t},IT=["img","br"],PT=e=>HT(e)||j(IT,Wt(e))||(e=>Gt(e)&&"false"===no(e,"contenteditable"))(e),FT=(e,t,o,n,r)=>{const s=Fn(wo.fromDom(o),"td,th,caption").map((e=>e.dom)),a=Y(((e,t)=>ne(t,(t=>{const o=((e,t)=>({left:e.left-t,top:e.top-t,right:e.right+2*t,bottom:e.bottom+2*t,width:e.width+t,height:e.height+t}))(Ei(t.getBoundingClientRect()),-1);return[{x:o.left,y:e(o),cell:t},{x:o.right,y:e(o),cell:t}]})))(e,s),(e=>t(e,r)));return((e,t,o)=>J(e,((e,n)=>e.fold((()=>F.some(n)),(e=>{const r=Math.sqrt(Math.abs(e.x-t)+Math.abs(e.y-o)),s=Math.sqrt(Math.abs(n.x-t)+Math.abs(n.y-o));return F.some(se.cell))},zT=N(FT,(e=>e.bottom),((e,t)=>e.ye.top),((e,t)=>e.y>t)),ZT=(e,t)=>de(t.getClientRects()).bind((t=>zT(e,t.left,t.top))).bind((e=>{return D_(au(o=e).map((e=>M_(o,e).positions.concat(e))).getOr([]),t);var o})),UT=(e,t)=>me(t.getClientRects()).bind((t=>VT(e,t.left,t.top))).bind((e=>{return D_(su(o=e).map((e=>[e].concat(N_(o,e).positions))).getOr([]),t);var o})),jT=(e,t,o)=>{const n=e(t,o);return(e=>e.breakType===S_.Wrap&&0===e.positions.length)(n)||!hr(o.getNode())&&(e=>e.breakType===S_.Br&&1===e.positions.length)(n)?!((e,t,o)=>o.breakAt.exists((o=>e(t,o).breakAt.isSome())))(e,t,n):n.breakAt.isNone()},WT=N(jT,M_),$T=N(jT,N_),qT=(e,t,o,n)=>{const r=e.selection.getRng(),s=t?1:-1;return!(!im()||!((e,t,o)=>{const n=ml.fromRangeStart(t);return ou(!e,o).exists((e=>e.isEqual(n)))})(t,r,o)||(Ck(s,e,o,!t,!1).each((t=>{J_(e,t)})),0))},GT=(e,t)=>{const o=t.getNode(e);return sr(o)?F.some(o):F.none()},KT=(e,t,o)=>{const n=GT(!!t,o),r=!1===t;n.fold((()=>J_(e,o.toRange())),(n=>ou(r,e.getBody()).filter((e=>e.isEqual(o))).fold((()=>J_(e,o.toRange())),(o=>((e,t,o)=>{t.undoManager.transact((()=>{const n=e?pn:hn,r=JE(t,wo.fromDom(o),n);J_(t,r)}))})(t,e,n)))))},YT=(e,t,o,n)=>{const r=e.selection.getRng(),s=ml.fromRangeStart(r),a=e.getBody();if(!t&&WT(n,s)){const n=((e,t,o)=>ZT(t,o).orThunk((()=>de(o.getClientRects()).bind((o=>A_(R_(e,ml.before(t)),o.left))))).getOr(ml.before(t)))(a,o,s);return KT(e,t,n),!0}if(t&&$T(n,s)){const n=((e,t,o)=>UT(t,o).orThunk((()=>de(o.getClientRects()).bind((o=>A_(B_(e,ml.after(t)),o.left))))).getOr(ml.after(t)))(a,o,s);return KT(e,t,n),!0}return!1},XT=(e,t,o)=>F.from(e.dom.getParent(e.selection.getNode(),"td,th")).bind((n=>F.from(e.dom.getParent(n,"table")).map((r=>o(e,t,r,n))))).getOr(!1),JT=(e,t)=>XT(e,t,qT),QT=(e,t)=>XT(e,t,YT),eO=(e,t,o)=>o.fold(F.none,F.none,((e,t)=>{return(o=t,Jo(o,PT)).map((e=>(e=>{const t=nh.exact(e,0,e,0);return lh(t)})(e)));var o}),(o=>(e.execCommand("mceTableInsertRowAfter"),tO(e,t,o)))),tO=(e,t,o)=>eO(e,t,((e,t,o)=>LT(e,o).fold((()=>AT.none(e)),(o=>BT(o.all,e,o.index,1,t))))(o,on)),oO=(e,t,o)=>eO(e,t,((e,t,o)=>LT(e,o).fold((()=>AT.none()),(o=>BT(o.all,e,o.index,-1,t))))(o,on)),nO=(e,t)=>{const o=["table","li","dl"],n=wo.fromDom(e.getBody()),r=e=>{const t=Wt(e);return ko(e,n)||j(o,t)},s=e.selection.getRng(),a=wo.fromDom(t?s.endContainer:s.startContainer);return MT(a,r).map((o=>(RT(o,r).each((t=>{e.model.table.clearSelectedCells(t.dom)})),e.selection.collapse(!t),(t?tO:oO)(e,r,o).each((t=>{e.selection.setRng(t)})),!0))).getOr(!1)},rO=(e,t)=>{e.on("keydown",(o=>{o.isDefaultPrevented()||((e,t,o)=>{const n=Mt.os.isMacOS()||Mt.os.isiOS();ST([{keyCode:Vg.RIGHT,action:CT(cT,e,!0)},{keyCode:Vg.LEFT,action:CT(cT,e,!1)},{keyCode:Vg.UP,action:CT(dT,e,!1)},{keyCode:Vg.DOWN,action:CT(dT,e,!0)},...n?[{keyCode:Vg.UP,action:CT(uT,e,!1),metaKey:!0,shiftKey:!0},{keyCode:Vg.DOWN,action:CT(uT,e,!0),metaKey:!0,shiftKey:!0}]:[],{keyCode:Vg.RIGHT,action:CT(JT,e,!0)},{keyCode:Vg.LEFT,action:CT(JT,e,!1)},{keyCode:Vg.UP,action:CT(QT,e,!1)},{keyCode:Vg.DOWN,action:CT(QT,e,!0)},{keyCode:Vg.UP,action:CT(QT,e,!1)},{keyCode:Vg.UP,action:CT(vT,e,!1)},{keyCode:Vg.DOWN,action:CT(vT,e,!0)},{keyCode:Vg.RIGHT,action:CT(_T,e,!0)},{keyCode:Vg.LEFT,action:CT(_T,e,!1)},{keyCode:Vg.UP,action:CT(ET,e,!1)},{keyCode:Vg.DOWN,action:CT(ET,e,!0)},{keyCode:Vg.RIGHT,action:CT(cE,e,t,!0)},{keyCode:Vg.LEFT,action:CT(cE,e,t,!1)},{keyCode:Vg.RIGHT,ctrlKey:!n,altKey:n,action:CT(uE,e,t)},{keyCode:Vg.LEFT,ctrlKey:!n,altKey:n,action:CT(gE,e,t)},{keyCode:Vg.UP,action:CT(pT,e,!1)},{keyCode:Vg.DOWN,action:CT(pT,e,!0)}],o).each((e=>{o.preventDefault()}))})(e,t,o)}))},sO=(e,t)=>({container:e,offset:t}),aO=ya.DOM,iO=e=>t=>e===t?-1:0,lO=(e,t,o)=>{if(lr(e)&&t>=0)return F.some(sO(e,t));{const n=Ka(aO);return F.from(n.backwards(e,t,iO(e),o)).map((e=>sO(e.container,e.container.data.length)))}},cO=(e,t,o)=>{if(!lr(e))return F.none();const n=e.data;if(t>=0&&t<=n.length)return F.some(sO(e,t));{const n=Ka(aO);return F.from(n.backwards(e,t,iO(e),o)).bind((e=>{const n=e.container.data;return cO(e.container,t+n.length,o)}))}},dO=(e,t,o)=>{if(!lr(e))return F.none();const n=e.data;if(t<=n.length)return F.some(sO(e,t));{const r=Ka(aO);return F.from(r.forwards(e,t,iO(e),o)).bind((e=>dO(e.container,t-n.length,o)))}},mO=(e,t,o,n,r)=>{const s=Ka(e,(e=>t=>e.isBlock(t)||j(["BR","IMG","HR","INPUT"],t.nodeName)||"false"===e.getContentEditable(t))(e));return F.from(s.backwards(t,o,n,r))},uO=e=>""!==e&&-1!=="  \f\n\r\t\v".indexOf(e),gO=(e,t)=>e.substring(t.length),hO=(e,t,o,n=!1)=>{if(!(r=t).collapsed||!lr(r.startContainer))return F.none();var r;const s={text:"",offset:0},a=e.getParent(t.startContainer,e.isBlock)||e.getRoot();return mO(e,t.startContainer,t.startOffset,((e,t,r)=>(s.text=r+s.text,s.offset+=t,((e,t,o,n=!1)=>{let r;const s=o.charAt(0);for(r=t-1;r>=0;r--){const a=e.charAt(r);if(!n&&uO(a))return F.none();if(s===a&&je(e,o,r,t))break}return F.some(r)})(s.text,s.offset,o,n).getOr(t))),a).bind((e=>{const n=t.cloneRange();if(n.setStart(e.container,e.offset),n.setEnd(t.endContainer,t.endOffset),n.collapsed)return F.none();const r=(e=>ui(e.toString().replace(/\u00A0/g," ")))(n);return 0!==r.lastIndexOf(o)?F.none():F.some({text:gO(r,o),range:n,trigger:o})}))},pO=e=>{if((e=>3===e.nodeType)(e))return sO(e,e.data.length);{const t=e.childNodes;return t.length>0?pO(t[t.length-1]):sO(e,t.length)}},fO=(e,t)=>{const o=e.childNodes;return o.length>0&&t0&&(e=>1===e.nodeType)(e)&&o.length===t?pO(o[o.length-1]):sO(e,t)},vO=e=>t=>{const o=fO(t.startContainer,t.startOffset);return!((e,t)=>{var o;const n=null!==(o=e.getParent(t.container,e.isBlock))&&void 0!==o?o:e.getRoot();return mO(e,t.container,t.offset,((e,t)=>0===t?-1:t),n).filter((e=>{const t=e.container.data.charAt(e.offset-1);return!uO(t)})).isSome()})(e,o)},bO=(e,t)=>{const o=t(),n=e.selection.getRng();return((e,t,o)=>ge(o.triggers,(o=>hO(e,t,o))))(e.dom,n,o).bind((o=>yO(e,t,o)))},yO=(e,t,o,n={})=>{var r;const s=t(),a=null!==(r=e.selection.getRng().startContainer.nodeValue)&&void 0!==r?r:"",i=Y(s.lookupByTrigger(o.trigger),(t=>o.text.length>=t.minChars&&t.matches.getOrThunk((()=>vO(e.dom)))(o.range,a,o.text)));if(0===i.length)return F.none();const l=Promise.all($(i,(e=>e.fetch(o.text,e.maxResults,n).then((t=>({matchText:o.text,items:t,columns:e.columns,onAction:e.onAction,highlightOn:e.highlightOn}))))));return F.some({lookupData:l,context:o})};var wO;!function(e){e[e.Error=0]="Error",e[e.Value=1]="Value"}(wO||(wO={}));const xO=(e,t,o)=>e.stype===wO.Error?t(e.serror):o(e.svalue),CO=e=>({stype:wO.Value,svalue:e}),SO=e=>({stype:wO.Error,serror:e}),kO=e=>xO(e,Hl.error,Hl.value),_O=CO,EO=e=>{const t=[],o=[];return q(e,(e=>{xO(e,(e=>o.push(e)),(e=>t.push(e)))})),{values:t,errors:o}},TO=SO,OO=(e,t)=>e.stype===wO.Error?t(e.serror):e,AO=(e,t)=>e.stype===wO.Value?{stype:wO.Value,svalue:t(e.svalue)}:e,DO=(e,t)=>e.stype===wO.Error?{stype:wO.Error,serror:t(e.serror)}:e,MO=xO,NO=e=>p(e)&&pe(e).length>100?" removed due to size":JSON.stringify(e,null,2),RO=(e,t)=>TO([{path:e,getErrorInfo:t}]),BO=(e,t,o,n)=>_e(o,n).fold((()=>((e,t,o)=>RO(e,(()=>'The chosen schema: "'+o+'" did not exist in branches: '+NO(t))))(e,o,n)),(o=>o.extract(e.concat(["branch: "+n]),t))),LO=(e,t)=>({extract:(o,n)=>_e(n,e).fold((()=>((e,t)=>RO(e,(()=>'Choice schema did not contain choice key: "'+t+'"')))(o,e)),(e=>BO(o,n,t,e))),toString:()=>"chooseOn("+e+"). Possible values: "+pe(t)}),HO=e=>(...t)=>{if(0===t.length)throw new Error("Can't merge zero objects");const o={};for(let n=0;nf(e)&&f(t)?IO(e,t):t)),PO=HO(((e,t)=>t)),FO=e=>({tag:"defaultedThunk",process:A(e)}),zO=e=>T(TO,oe)(e),VO=e=>{const t=EO(e);return t.errors.length>0?zO(t.errors):_O(t.values)},ZO=(e,t,o)=>{switch(e.tag){case"field":return t(e.key,e.newKey,e.presence,e.prop);case"custom":return o(e.newKey,e.instantiator)}},UO=e=>({extract:(t,o)=>OO(e(o),(e=>((e,t)=>RO(e,A(t)))(t,e))),toString:A("val")}),jO=UO(_O),WO=(e,t,o,n)=>_e(t,o).fold((()=>((e,t,o)=>RO(e,(()=>'Could not find valid *required* value for "'+t+'" in '+NO(o))))(e,o,t)),n),$O=(e,t,o,n)=>n(_e(e,t).getOrThunk((()=>o(e)))),qO=(e,t,o,n,r)=>{const s=e=>r.extract(t.concat([n]),e),a=e=>e.fold((()=>_O(F.none())),(e=>{const o=r.extract(t.concat([n]),e);return AO(o,F.some)}));switch(e.tag){case"required":return WO(t,o,n,s);case"defaultedThunk":return $O(o,n,e.process,s);case"option":return((e,t,o)=>o(_e(e,t)))(o,n,a);case"defaultedOptionThunk":return((e,t,o,n)=>n(_e(e,t).map((t=>!0===t?o(e):t))))(o,n,e.process,a);case"mergeWithThunk":return $O(o,n,A({}),(t=>{const n=IO(e.process(o),t);return s(n)}))}},GO=e=>({extract:(t,o)=>((e,t,o)=>{const n={},r=[];for(const s of o)ZO(s,((o,s,a,i)=>{const l=qO(a,e,t,o,i);MO(l,(e=>{r.push(...e)}),(e=>{n[s]=e}))}),((e,o)=>{n[e]=o(t)}));return r.length>0?TO(r):_O(n)})(t,o,e),toString:()=>{const t=$(e,(e=>ZO(e,((e,t,o,n)=>e+" -> "+n.toString()),((e,t)=>"state("+e+")"))));return"obj{\n"+t.join("\n")+"}"}}),KO=e=>({extract:(t,o)=>{const n=$(o,((o,n)=>e.extract(t.concat(["["+n+"]"]),o)));return VO(n)},toString:()=>"array("+e.toString()+")"}),YO=(e,t,o)=>kO(((e,t,o)=>{const n=t.extract([e],o);return DO(n,(e=>({input:o,errors:e})))})(e,t,o)),XO=e=>"Errors: \n"+(e=>{const t=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:A("... (only showing first ten failures)")}]):e;return $(t,(e=>"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()))})(e.errors).join("\n")+"\n\nInput object: "+NO(e.input),JO=(e,t)=>LO(e,be(t,GO)),QO=A(jO),eA=(e,t)=>UO((o=>{const n=typeof o;return e(o)?_O(o):TO(`Expected type: ${t} but got: ${n}`)})),tA=eA(k,"number"),oA=eA(h,"string"),nA=eA(y,"boolean"),rA=eA(S,"function"),sA=(e,t,o,n)=>({tag:"field",key:e,newKey:t,presence:o,prop:n}),aA=(e,t)=>({tag:"custom",newKey:e,instantiator:t}),iA=e=>{return t=t=>j(e,t)?Hl.value(t):Hl.error(`Unsupported value: "${t}", choose one of "${e.join(", ")}".`),UO((e=>t(e).fold(TO,_O)));var t},lA=(e,t)=>sA(e,e,{tag:"required",process:{}},t),cA=e=>lA(e,oA),dA=e=>lA(e,rA),mA=(e,t)=>sA(e,e,{tag:"option",process:{}},t),uA=e=>mA(e,oA),gA=(e,t,o)=>sA(e,e,FO(t),o),hA=(e,t)=>gA(e,t,tA),pA=(e,t,o)=>gA(e,t,iA(o)),fA=(e,t)=>gA(e,t,nA),vA=(e,t)=>gA(e,t,rA),bA=cA("type"),yA=dA("fetch"),wA=dA("onAction"),xA=vA("onSetup",(()=>E)),CA=uA("text"),SA=uA("icon"),kA=uA("tooltip"),_A=uA("label"),EA=fA("active",!1),TA=fA("enabled",!0),OA=fA("primary",!1),AA=e=>((e,t)=>gA(e,t,oA))("type",e),DA=GO([bA,cA("trigger"),hA("minChars",1),(NA=1,((e,t)=>sA(e,e,FO(t),QO()))("columns",NA)),hA("maxResults",10),(MA="matches",mA(MA,rA)),yA,wA,((e,t,o)=>gA(e,t,KO(o)))("highlightOn",[],oA)]);var MA,NA;const RA=[TA,kA,SA,CA,xA],BA=[EA].concat(RA),LA=[vA("predicate",I),pA("scope","node",["node","editor"]),pA("position","selection",["node","selection","line"])],HA=RA.concat([AA("contextformbutton"),OA,wA,aA("original",D)]),IA=BA.concat([AA("contextformbutton"),OA,wA,aA("original",D)]),PA=RA.concat([AA("contextformbutton")]),FA=BA.concat([AA("contextformtogglebutton")]),zA=JO("type",{contextformbutton:HA,contextformtogglebutton:IA});GO([AA("contextform"),vA("initValue",A("")),_A,((e,t)=>sA(e,e,{tag:"required",process:{}},KO(t)))("commands",zA),mA("launch",JO("type",{contextformbutton:PA,contextformtogglebutton:FA}))].concat(LA));const VA=e=>{const t=e.ui.registry.getAll().popups,o=be(t,(e=>{return(t=e,YO("Autocompleter",DA,t)).fold((e=>{throw new Error(XO(e))}),D);var t})),n=Oe(Se(o,(e=>e.trigger))),r=ke(o);return{dataset:o,triggers:n,lookupByTrigger:e=>Y(r,(t=>t.trigger===e))}},ZA=e=>{const t=Lr(),o=Rr(!1),n=t.isSet,r=()=>{n()&&((e=>{e.dispatch("AutocompleterEnd")})(e),o.set(!1),t.clear())},s=Ie((()=>VA(e))),a=a=>{(o=>t.get().map((t=>hO(e.dom,e.selection.getRng(),t.trigger,!0).bind((t=>yO(e,s,t,o))))).getOrThunk((()=>bO(e,s))))(a).fold(r,(r=>{(e=>{n()||t.set({trigger:e.trigger,matchLength:e.text.length})})(r.context),r.lookupData.then((n=>{t.get().map((s=>{const a=r.context;s.trigger===a.trigger&&(t.set({...s,matchLength:a.text.length}),o.get()?(Fg(e,{range:a.range}),((e,t)=>{e.dispatch("AutocompleterUpdate",t)})(e,{lookupData:n})):(o.set(!0),Fg(e,{range:a.range}),((e,t)=>{e.dispatch("AutocompleterStart",t)})(e,{lookupData:n})))}))}))}))},i=()=>t.get().bind((({trigger:t})=>{const n=e.selection.getRng();return hO(e.dom,n,t,o.get()).filter((({range:e})=>((e,t)=>{const o=e.compareBoundaryPoints(window.Range.START_TO_START,t),n=e.compareBoundaryPoints(window.Range.END_TO_END,t);return o>=0&&n<=0})(n,e))).map((({range:e})=>e))}));e.addCommand("mceAutocompleterReload",((e,t)=>{const o=p(t)?t.fetchOptions:{};a(o)})),e.addCommand("mceAutocompleterClose",r),e.addCommand("mceAutocompleterRefreshActiveRange",(()=>{i().each((t=>{Fg(e,{range:t})}))})),e.editorCommands.addQueryStateHandler("mceAutoCompleterInRange",(()=>i().isSome())),((e,t)=>{const o=Oa(t.load,50);e.on("input",(t=>{("insertCompositionText"!==t.inputType||e.composing)&&o.throttle()})),e.on("keydown",(e=>{const n=e.which;8===n?o.throttle():27===n?(o.cancel(),t.cancelIfNecessary()):38!==n&&40!==n||o.cancel()}),!0),e.on("remove",o.cancel)})(e,{cancelIfNecessary:r,load:a})},UA=kt().browser.isSafari(),jA=e=>ci(wo.fromDom(e)),WA=(e,t)=>{var o;return 0===e.startOffset&&e.endOffset===(null===(o=t.textContent)||void 0===o?void 0:o.length)},$A=(e,t)=>F.from(e.getParent(t.container(),"details")),qA=(e,t)=>$A(e,t).isSome(),GA=(e,t)=>t.startSummary.exists((t=>((e,t)=>su(t).exists((t=>t.isEqual(e))))(e,t))),KA=(e,t)=>t.startSummary.exists((t=>((e,t)=>au(t).exists((o=>hr(o.getNode())&&ru(t,o).exists((t=>t.isEqual(e)))||o.isEqual(e))))(e,t))),YA=(e,t)=>{const o=t.getNode();w(o)||e.selection.setCursorLocation(o,t.offset())},XA=(e,t,o)=>{const n=e.dom.getParent(t.container(),"details");if(n&&!n.open){const t=e.dom.select("summary",n)[0];t&&(o?su(t):au(t)).each((t=>YA(e,t)))}else YA(e,t)},JA=(e,t,o)=>{const{dom:n,selection:r}=e,s=e.getBody();if("character"===o){const o=ml.fromRangeStart(r.getRng()),a=n.getParent(o.container(),n.isBlock),i=$A(n,o),l=a&&n.isEmpty(a),c=b(null==a?void 0:a.previousSibling),d=b(null==a?void 0:a.nextSibling);return!!(l&&(t?d:c)&&eu(!t,s,o).exists((e=>qA(n,e)&&!It(i,$A(n,e)))))||eu(t,s,o).fold(I,(o=>{const r=$A(n,o);if(qA(n,o)&&!It(i,r)){if(t||XA(e,o,!1),a&&l){if(t&&c)return!0;if(!t&&d)return!0;XA(e,o,t),e.dom.remove(a)}return!0}return!1}))}return!1},QA=(e,t,o,n)=>{const r=e.selection.getRng(),s=ml.fromRangeStart(r),a=e.getBody();return"selection"===n?((e,t)=>{const o=t.startSummary.exists((t=>t.contains(e.startContainer))),n=t.startSummary.exists((t=>t.contains(e.endContainer))),r=t.startDetails.forall((e=>t.endDetails.forall((t=>e!==t))));return(o||n)&&!(o&&n)||r})(r,t):o?KA(s,t)||((e,t,o)=>o.startDetails.exists((o=>nu(e,t).forall((e=>!o.contains(e.container()))))))(a,s,t):GA(s,t)||((e,t)=>t.startDetails.exists((o=>ru(o,e).forall((o=>t.startSummary.exists((t=>!t.contains(e.container())&&t.contains(o.container()))))))))(s,t)},eD=(e,t,o)=>((e,t)=>{const o=F.from(e.getParent(t.startContainer,"details")),n=F.from(e.getParent(t.endContainer,"details"));if(o.isSome()||n.isSome()){const t=o.bind((t=>F.from(e.select("summary",t)[0])));return F.some({startSummary:t,startDetails:o,endDetails:n})}return F.none()})(e.dom,e.selection.getRng()).fold((()=>JA(e,t,o)),(n=>QA(e,n,t,o)||JA(e,t,o))),tD=(e,t,o)=>{const n=e.selection,r=n.getNode(),s=n.getRng(),a=ml.fromRangeStart(s);return!!Sr(r)&&("selection"===o&&WA(s,r)||Ev(t,a,r)?jA(r):e.undoManager.transact((()=>{const s=n.getSel();let{anchorNode:a,anchorOffset:i,focusNode:l,focusOffset:c}=null!=s?s:{};const d=()=>{C(a)&&C(i)&&C(l)&&C(c)&&(null==s||s.setBaseAndExtent(a,i,l,c))},m=(e,t)=>{q(e.childNodes,(e=>{Fu(e)&&t.appendChild(e)}))},u=e.dom.create("span",{"data-mce-bogus":"1"});m(r,u),r.appendChild(u),d(),"word"!==o&&"line"!==o||null==s||s.modify("extend",t?"right":"left",o),!n.isCollapsed()&&WA(n.getRng(),u)?jA(r):(e.execCommand(t?"ForwardDelete":"Delete"),a=null==s?void 0:s.anchorNode,i=null==s?void 0:s.anchorOffset,l=null==s?void 0:s.focusNode,c=null==s?void 0:s.focusOffset,m(u,r),d()),e.dom.remove(u)})),!0)},oD=(e,t,o)=>eD(e,t,o)||UA&&tD(e,t,o)?F.some(E):F.none(),nD=e=>(t,o,n={})=>{const r=t.getBody(),s={bubbles:!0,composed:!0,data:null,isComposing:!1,detail:0,view:null,target:r,currentTarget:r,eventPhase:Event.AT_TARGET,originalTarget:r,explicitOriginalTarget:r,isTrusted:!1,srcElement:r,cancelable:!1,preventDefault:E,inputType:o},a=oa(new InputEvent(e));return t.dispatch(e,{...a,...s,...n})},rD=nD("input"),sD=nD("beforeinput"),aD=kt(),iD=aD.os,lD=iD.isMacOS()||iD.isiOS(),cD=aD.browser.isFirefox(),dD=(e,t)=>{let o=!1;e.on("keydown",(n=>{o=n.keyCode===Vg.BACKSPACE,n.isDefaultPrevented()||((e,t,o)=>{const n=o.keyCode===Vg.BACKSPACE?"deleteContentBackward":"deleteContentForward",r=e.selection.isCollapsed(),s=r?"character":"selection",a=e=>r?e?"word":"line":"selection";kT([{keyCode:Vg.BACKSPACE,action:CT(ZE,e)},{keyCode:Vg.BACKSPACE,action:CT(Fk,e,!1)},{keyCode:Vg.DELETE,action:CT(Fk,e,!0)},{keyCode:Vg.BACKSPACE,action:CT(Ok,e,!1)},{keyCode:Vg.DELETE,action:CT(Ok,e,!0)},{keyCode:Vg.BACKSPACE,action:CT(bE,e,t,!1)},{keyCode:Vg.DELETE,action:CT(bE,e,t,!0)},{keyCode:Vg.BACKSPACE,action:CT(sb,e,!1)},{keyCode:Vg.DELETE,action:CT(sb,e,!0)},{keyCode:Vg.BACKSPACE,action:CT(oD,e,!1,s)},{keyCode:Vg.DELETE,action:CT(oD,e,!0,s)},...lD?[{keyCode:Vg.BACKSPACE,altKey:!0,action:CT(oD,e,!1,a(!0))},{keyCode:Vg.DELETE,altKey:!0,action:CT(oD,e,!0,a(!0))},{keyCode:Vg.BACKSPACE,metaKey:!0,action:CT(oD,e,!1,a(!1))}]:[{keyCode:Vg.BACKSPACE,ctrlKey:!0,action:CT(oD,e,!1,a(!0))},{keyCode:Vg.DELETE,ctrlKey:!0,action:CT(oD,e,!0,a(!0))}],{keyCode:Vg.BACKSPACE,action:CT(Wk,e,!1)},{keyCode:Vg.DELETE,action:CT(Wk,e,!0)},{keyCode:Vg.BACKSPACE,action:CT(BE,e,!1)},{keyCode:Vg.DELETE,action:CT(BE,e,!0)},{keyCode:Vg.BACKSPACE,action:CT(xk,e,!1)},{keyCode:Vg.DELETE,action:CT(xk,e,!0)},{keyCode:Vg.BACKSPACE,action:CT(vk,e,!1)},{keyCode:Vg.DELETE,action:CT(vk,e,!0)},{keyCode:Vg.BACKSPACE,action:CT(DE,e,!1)},{keyCode:Vg.DELETE,action:CT(DE,e,!0)},{keyCode:Vg.BACKSPACE,action:CT(jk,e,!1)},{keyCode:Vg.DELETE,action:CT(jk,e,!0)}],o).filter((t=>e.selection.isEditable())).each((t=>{o.preventDefault(),sD(e,n).isDefaultPrevented()||(t(),rD(e,n))}))})(e,t,n)})),e.on("keyup",(t=>{t.isDefaultPrevented()||((e,t,o)=>{ST([{keyCode:Vg.BACKSPACE,action:CT(Pk,e)},{keyCode:Vg.DELETE,action:CT(Pk,e)},...lD?[{keyCode:Vg.BACKSPACE,altKey:!0,action:CT(NE,e)},{keyCode:Vg.DELETE,altKey:!0,action:CT(NE,e)},...o?[{keyCode:cD?224:91,action:CT(NE,e)}]:[]]:[{keyCode:Vg.BACKSPACE,ctrlKey:!0,action:CT(NE,e)},{keyCode:Vg.DELETE,ctrlKey:!0,action:CT(NE,e)}]],t)})(e,t,o),o=!1}))},mD=(e,t)=>{const o=e.dom,n=e.schema.getMoveCaretBeforeOnEnterElements();if(!t)return;if(/^(LI|DT|DD)$/.test(t.nodeName)){const e=(e=>{for(;e;){if(Qn(e)||lr(e)&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}return null})(t.firstChild);e&&/^(UL|OL|DL)$/.test(e.nodeName)&&t.insertBefore(o.doc.createTextNode(Wn),t.firstChild)}const r=o.createRng();if(t.normalize(),t.hasChildNodes()){const e=new Un(t,t);let o,s=t;for(;o=e.current();){if(lr(o)){r.setStart(o,0),r.setEnd(o,0);break}if(n[o.nodeName.toLowerCase()]){r.setStartBefore(o),r.setEndBefore(o);break}s=o,o=e.next()}o||(r.setStart(s,0),r.setEnd(s,0))}else hr(t)?t.nextSibling&&o.isBlock(t.nextSibling)?(r.setStartBefore(t),r.setEndBefore(t)):(r.setStartAfter(t),r.setEndAfter(t)):(r.setStart(t,0),r.setEnd(t,0));e.selection.setRng(r),Uh(e,r)},uD=(e,t)=>{const o=e.getRoot();let n,r=t;for(;r!==o&&r&&"false"!==e.getContentEditable(r);){if("true"===e.getContentEditable(r)){n=r;break}r=r.parentNode}return r!==o?n:o},gD=e=>F.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock)),hD=e=>{e.innerHTML='
    '},pD=(e,t)=>{sc(e).toLowerCase()===t.tagName.toLowerCase()&&((e,t,o)=>{const n=e.dom;F.from(o.style).map(n.parseStyle).each((e=>{const o={...un(wo.fromDom(t)),...e};n.setStyles(t,o)}));const r=F.from(o.class).map((e=>e.split(/\s+/))),s=F.from(t.className).map((e=>Y(e.split(/\s+/),(e=>""!==e))));Pt(r,s,((e,o)=>{const r=Y(o,(t=>!j(e,t))),s=[...e,...r];n.setAttrib(t,"class",s.join(" "))}));const a=["style","class"],i=Ce(o,((e,t)=>!j(a,t)));n.setAttribs(t,i)})(e,t,ac(e))},fD=(e,t,o,n,r=!0,s,a)=>{const i=e.dom,l=e.schema,c=sc(e),d=o?o.nodeName.toUpperCase():"";let m=t;const u=l.getTextInlineElements();let g;g=s||"TABLE"===d||"HR"===d?i.create(s||c,a||{}):o.cloneNode(!1);let h=g;if(r){do{if(u[m.nodeName]){if(lu(m)||Cu(m))continue;const e=m.cloneNode(!1);i.setAttrib(e,"id",""),g.hasChildNodes()?(e.appendChild(g.firstChild),g.appendChild(e)):(h=e,g.appendChild(e))}}while((m=m.parentNode)&&m!==n)}else i.setAttrib(g,"style",null),i.setAttrib(g,"class",null);return pD(e,g),hD(h),g},vD=(e,t,o)=>!t&&o.nodeName.toLowerCase()===sc(e)&&e.dom.isEmpty(o)&&((e,t,o)=>{let n=t;for(;n&&n!==e&&b(n.nextSibling);){const e=n.parentElement;if(!e||!o(e))return Cr(e);n=e}return!1})(e.getBody(),o,(t=>Ee(e.schema.getTextBlockElements(),t.nodeName.toLowerCase()))),bD=(e,t,o)=>{var n,r,s;const a=t(sc(e)),i=((e,t)=>e.dom.getParent(t,Cr))(e,o);i&&(e.dom.insertAfter(a,i),mD(e,a),(null!==(s=null===(r=null===(n=o.parentElement)||void 0===n?void 0:n.childNodes)||void 0===r?void 0:r.length)&&void 0!==s?s:0)>1&&e.dom.remove(o))},yD=(e,t)=>{const o=null==e?void 0:e.parentNode;return C(o)&&o.nodeName===t},wD=e=>C(e)&&/^(OL|UL|LI)$/.test(e.nodeName),xD=e=>C(e)&&/^(LI|DT|DD)$/.test(e.nodeName),CD=e=>{const t=e.parentNode;return xD(t)?t:e},SD=(e,t,o)=>{let n=e[o?"firstChild":"lastChild"];for(;n&&!Qn(n);)n=n[o?"nextSibling":"previousSibling"];return n===t},kD=e=>J(Se(un(wo.fromDom(e)),((e,t)=>`${t}: ${e};`)),((e,t)=>e+t),""),_D=(e,t,o,n,r)=>{const s=e.dom,a=e.selection.getRng(),i=o.parentNode;if(o===e.getBody()||!i)return;var l;wD(l=o)&&wD(l.parentNode)&&(r="LI");const c=xD(n)?kD(n):void 0;let d=xD(n)&&c?t(r,{style:kD(n)}):t(r);if(SD(o,n,!0)&&SD(o,n,!1))if(yD(o,"LI")){const e=CD(o);s.insertAfter(d,e),(e=>{var t;return(null===(t=e.parentNode)||void 0===t?void 0:t.firstChild)===e})(o)?s.remove(e):s.remove(o)}else s.replace(d,o);else if(SD(o,n,!0))yD(o,"LI")?(s.insertAfter(d,CD(o)),d.appendChild(s.doc.createTextNode(" ")),d.appendChild(o)):i.insertBefore(d,o),s.remove(n);else if(SD(o,n,!1))s.insertAfter(d,CD(o)),s.remove(n);else{o=CD(o);const e=a.cloneRange();e.setStartAfter(n),e.setEndAfter(o);const t=e.extractContents();if("LI"===r&&((e,t)=>e.firstChild&&e.firstChild.nodeName===t)(t,"LI")){const e=Y($(d.children,wo.fromDom),R(Qt("br")));d=t.firstChild,s.insertAfter(t,o),q(e,(e=>fn(wo.fromDom(d),e))),c&&d.setAttribute("style",c)}else s.insertAfter(t,o),s.insertAfter(d,o);s.remove(n)}mD(e,d)},ED=(e,t)=>t&&"A"===t.nodeName&&e.isEmpty(t),TD=(e,t)=>e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t,OD=(e,t)=>C(t)&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&e.isEditable(t.parentNode)&&"false"!==e.getContentEditable(t),AD=(e,t,o)=>lr(t)?e?1===o&&t.data.charAt(o-1)===di?0:o:o===t.data.length-1&&t.data.charAt(o)===di?t.data.length:o:o,DD={insert:(e,t)=>{let o,n,r,s,a=!1;const i=e.dom,l=e.schema.getNonEmptyElements(),c=e.selection.getRng(),d=sc(e),m=wo.fromDom(c.startContainer),u=Io(m,c.startOffset),g=u.exists((e=>Gt(e)&&!on(e))),p=c.collapsed&&g,f=(t,n)=>fD(e,o,k,S,dc(e),t,n),v=e=>{const t=AD(e,o,n);if(lr(o)&&(e?t>0:t{let t;return t=/^(H[1-6]|PRE|FIGURE)$/.test(r)&&"HGROUP"!==_?f(d):f(),((e,t)=>{const o=mc(e);return!x(t)&&(h(o)?j(Lt.explode(o),t.nodeName.toLowerCase()):o)})(e,s)&&OD(i,s)&&i.isEmpty(k,void 0,{includeZwsp:!0})?t=i.split(s,k):i.insertAfter(t,k),mD(e,t),t};bh(i,c).each((e=>{c.setStart(e.startContainer,e.startOffset),c.setEnd(e.endContainer,e.endOffset)})),o=c.startContainer,n=c.startOffset;const y=!(!t||!t.shiftKey),w=!(!t||!t.ctrlKey);Qn(o)&&o.hasChildNodes()&&!p&&(a=n>o.childNodes.length-1,o=o.childNodes[Math.min(n,o.childNodes.length-1)]||o,n=a&&lr(o)?o.data.length:0);const S=uD(i,o);if(!S||((e,t)=>{const o=e.dom.getParent(t,"ol,ul,dl");return null!==o&&"false"===e.dom.getContentEditableParent(o)})(e,o))return;y||(o=((e,t,o,n,r)=>{var s,a;const i=e.dom,l=null!==(s=uD(i,n))&&void 0!==s?s:i.getRoot();let c=i.getParent(n,i.isBlock);if(!c||!OD(i,c)){if(c=c||l,!c.hasChildNodes()){const n=i.create(t);return pD(e,n),c.appendChild(n),o.setStart(n,0),o.setEnd(n,0),n}let s,d=n;for(;d&&d.parentNode!==c;)d=d.parentNode;for(;d&&!i.isBlock(d);)s=d,d=d.previousSibling;const m=null===(a=null==s?void 0:s.parentElement)||void 0===a?void 0:a.nodeName;if(s&&m&&e.schema.isValidChild(m,t.toLowerCase())){const a=s.parentNode,l=i.create(t);for(pD(e,l),a.insertBefore(l,s),d=s;d&&!i.isBlock(d);){const e=d.nextSibling;l.appendChild(d),d=e}o.setStart(n,r),o.setEnd(n,r)}}return n})(e,d,c,o,n));let k=i.getParent(o,i.isBlock)||i.getRoot();s=C(null==k?void 0:k.parentNode)?i.getParent(k.parentNode,i.isBlock):null,r=k?k.nodeName.toUpperCase():"";const _=s?s.nodeName.toUpperCase():"";if("LI"!==_||w||(k=s,s=s.parentNode,r=_),Qn(s)&&vD(e,y,k))return bD(e,f,k);if(/^(LI|DT|DD)$/.test(r)&&Qn(s)&&i.isEmpty(k))return void _D(e,f,s,k,d);if(!(p||k!==e.getBody()&&OD(i,k)))return;const E=k.parentNode;let T;if(p)T=f(d),u.fold((()=>{vn(m,wo.fromDom(T))}),(e=>{hn(e,wo.fromDom(T))})),e.selection.setCursorLocation(T,0);else if(pi(k))T=Si(k),i.isEmpty(k)&&hD(k),pD(e,T),mD(e,T);else if(v(!1))T=b();else if(v(!0)&&E){const t=ml.fromRangeStart(c),o=vf(t),n=wo.fromDom(k),r=Rf(n,t,e.schema)?Bf(n,t,e.schema).bind((e=>F.from(e.getNode()))):F.none();T=E.insertBefore(f(),k);const s=TD(k,"HR")||o?T:r.getOr(k);mD(e,s)}else{const t=(e=>{const t=e.cloneRange();return t.setStart(e.startContainer,AD(!0,e.startContainer,e.startOffset)),t.setEnd(e.endContainer,AD(!1,e.endContainer,e.endOffset)),t})(c).cloneRange();t.setEndAfter(k);const o=t.extractContents();(e=>{q(Pn(wo.fromDom(e),Yt),(e=>{const t=e.dom;t.nodeValue=ui(t.data)}))})(o),(e=>{let t=e;do{lr(t)&&(t.data=t.data.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)})(o),T=o.firstChild,i.insertAfter(o,k),((e,t,o)=>{var n;const r=[];if(!o)return;let s=o;for(;s=s.firstChild;){if(e.isBlock(s))return;Qn(s)&&!t[s.nodeName.toLowerCase()]&&r.push(s)}let a=r.length;for(;a--;)s=r[a],(!s.hasChildNodes()||s.firstChild===s.lastChild&&""===(null===(n=s.firstChild)||void 0===n?void 0:n.nodeValue)||ED(e,s))&&e.remove(s)})(i,l,T),((e,t)=>{t.normalize();const o=t.lastChild;(!o||Qn(o)&&/^(left|right)$/gi.test(e.getStyle(o,"float",!0)))&&e.add(t,"br")})(i,k),i.isEmpty(k)&&hD(k),T.normalize(),i.isEmpty(T)?(i.remove(T),b()):(pD(e,T),mD(e,T))}i.setAttrib(T,"id",""),e.dispatch("NewBlock",{newBlock:T})},fakeEventName:"insertParagraph"},MD=(e,t,o)=>{const n=e.dom.createRng();o?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),e.selection.setRng(n),Uh(e,n)},ND=(e,t)=>{const o=e.selection,n=e.dom,r=o.getRng();let s,a=!1;bh(n,r).each((e=>{r.setStart(e.startContainer,e.startOffset),r.setEnd(e.endContainer,e.endOffset)}));let i=r.startOffset,l=r.startContainer;if(Qn(l)&&l.hasChildNodes()){const e=i>l.childNodes.length-1;l=l.childNodes[Math.min(i,l.childNodes.length-1)]||l,i=e&&lr(l)?l.data.length:0}let c=n.getParent(l,n.isBlock);const d=c&&c.parentNode?n.getParent(c.parentNode,n.isBlock):null,m=d?d.nodeName.toUpperCase():"",u=!(!t||!t.ctrlKey);"LI"!==m||u||(c=d),lr(l)&&i>=l.data.length&&(((e,t,o)=>{const n=new Un(t,o);let r;const s=e.getNonEmptyElements();for(;r=n.next();)if(s[r.nodeName.toLowerCase()]||lr(r)&&r.length>0)return!0;return!1})(e.schema,l,c||n.getRoot())||(s=n.create("br"),r.insertNode(s),r.setStartAfter(s),r.setEndAfter(s),a=!0)),s=n.create("br"),gl(n,r,s),MD(e,s,a),e.undoManager.add()},RD=(e,t)=>{const o=wo.fromTag("br");hn(wo.fromDom(t),o),e.undoManager.add()},BD=(e,t)=>{LD(e.getBody(),t)||pn(wo.fromDom(t),wo.fromTag("br"));const o=wo.fromTag("br");pn(wo.fromDom(t),o),MD(e,o.dom,!1),e.undoManager.add()},LD=(e,t)=>{return o=ml.after(t),!!hr(o.getNode())||nu(e,ml.after(t)).map((e=>hr(e.getNode()))).getOr(!1);var o},HD=e=>e&&"A"===e.nodeName&&"href"in e,ID=e=>e.fold(I,HD,HD,I),PD=(e,t)=>{t.fold(E,N(RD,e),N(BD,e),E)},FD={insert:(e,t)=>{const o=(e=>{const t=N(hv,e),o=ml.fromRangeStart(e.selection.getRng());return u_(t,e.getBody(),o).filter(ID)})(e);o.isSome()?o.each(N(PD,e)):ND(e,t)},fakeEventName:"insertLineBreak"},zD=(e,t)=>gD(e).filter((e=>t.length>0&&Co(wo.fromDom(e),t))).isSome(),VD=Il([{br:[]},{block:[]},{none:[]}]),ZD=(e,t)=>(e=>zD(e,cc(e)))(e),UD=e=>(t,o)=>(e=>gD(e).filter((e=>ni(wo.fromDom(e)))).isSome())(t)===e,jD=(e,t)=>(o,n)=>{const r=(e=>gD(e).fold(A(""),(e=>e.nodeName.toUpperCase())))(o)===e.toUpperCase();return r===t},WD=e=>{const t=uD(e.dom,e.selection.getStart());return x(t)},$D=e=>jD("pre",e),qD=e=>(t,o)=>rc(t)===e,GD=(e,t)=>(e=>zD(e,lc(e)))(e),KD=(e,t)=>t,YD=e=>{const t=sc(e),o=uD(e.dom,e.selection.getStart());return C(o)&&e.schema.isValidChild(o.nodeName,t)},XD=e=>{const t=e.selection.getRng(),o=wo.fromDom(t.startContainer),n=Io(o,t.startOffset).map((e=>Gt(e)&&!on(e)));return t.collapsed&&n.getOr(!0)},JD=(e,t)=>(o,n)=>J(e,((e,t)=>e&&t(o,n)),!0)?F.some(t):F.none(),QD=(e,t,o)=>{t.selection.isCollapsed()||(e=>{e.execCommand("delete")})(t),C(o)&&sD(t,e.fakeEventName).isDefaultPrevented()||(e.insert(t,o),C(o)&&rD(t,e.fakeEventName))},eM=(e,t)=>{const o=()=>QD(FD,e,t),n=()=>QD(DD,e,t),r=((e,t)=>o_([JD([ZD],VD.none()),JD([$D(!0),WD],VD.none()),JD([jD("summary",!0)],VD.br()),JD([$D(!0),qD(!1),KD],VD.br()),JD([$D(!0),qD(!1)],VD.block()),JD([$D(!0),qD(!0),KD],VD.block()),JD([$D(!0),qD(!0)],VD.br()),JD([UD(!0),KD],VD.br()),JD([UD(!0)],VD.block()),JD([GD],VD.br()),JD([KD],VD.br()),JD([YD],VD.block()),JD([XD],VD.block())],[e,!(!t||!t.shiftKey)]).getOr(VD.none()))(e,t);switch(ic(e)){case"linebreak":r.fold(o,o,E);break;case"block":r.fold(n,n,E);break;case"invert":r.fold(n,o,E);break;default:r.fold(o,n,E)}},tM=kt(),oM=tM.os.isiOS()&&tM.browser.isSafari(),nM=(e,t)=>{var o;t.isDefaultPrevented()||(t.preventDefault(),(o=e.undoManager).typing&&(o.typing=!1,o.add()),e.undoManager.transact((()=>{eM(e,t)})))},rM=e=>{let t=F.none();e.on("keydown",(o=>{o.keyCode===Vg.ENTER&&(oM&&(e=>{if(!e.collapsed)return!1;const t=e.startContainer;if(lr(t)){const o=/^[\uAC00-\uD7AF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uD7B0-\uD7FF]$/,n=t.data.charAt(e.startOffset-1);return o.test(n)}return!1})(e.selection.getRng())?(e=>{t=F.some(e.selection.getBookmark()),e.undoManager.add()})(e):nM(e,o))})),e.on("keyup",(o=>{o.keyCode===Vg.ENTER&&t.each((()=>((e,o)=>{e.undoManager.undo(),t.fold(E,(t=>e.selection.moveToBookmark(t))),nM(e,o),t=F.none()})(e,o)))}))},sM=(e,t)=>{e.on("keydown",(o=>{o.isDefaultPrevented()||((e,t,o)=>{const n=Mt.os.isMacOS()||Mt.os.isiOS();ST([{keyCode:Vg.END,action:CT(mT,e,!0)},{keyCode:Vg.HOME,action:CT(mT,e,!1)},...n?[]:[{keyCode:Vg.HOME,action:CT(uT,e,!1),ctrlKey:!0,shiftKey:!0},{keyCode:Vg.END,action:CT(uT,e,!0),ctrlKey:!0,shiftKey:!0}],{keyCode:Vg.END,action:CT(TT,e,!0)},{keyCode:Vg.HOME,action:CT(TT,e,!1)},{keyCode:Vg.END,action:CT(hE,e,!0,t)},{keyCode:Vg.HOME,action:CT(hE,e,!1,t)}],o).each((e=>{o.preventDefault()}))})(e,t,o)}))},aM=e=>{e.on("input",(t=>{t.isComposing||(e=>{const t=wo.fromDom(e.getBody());e.selection.isCollapsed()&&Jf(t,ml.fromRangeStart(e.selection.getRng()),e.schema).each((t=>{e.selection.setRng(t.toRange())}))})(e)}))},iM=kt(),lM=e=>e.stopImmediatePropagation(),cM=e=>e.keyCode===Vg.PAGE_UP||e.keyCode===Vg.PAGE_DOWN,dM=(e,t,o)=>{o&&!e.get()?t.on("NodeChange",lM,!0):!o&&e.get()&&t.off("NodeChange",lM),e.set(o)},mM=(e,t)=>{if(iM.os.isMacOS())return;const o=Rr(!1);e.on("keydown",(t=>{cM(t)&&dM(o,e,!0)})),e.on("keyup",(n=>{n.isDefaultPrevented()||((e,t,o)=>{ST([{keyCode:Vg.PAGE_UP,action:CT(hE,e,!1,t)},{keyCode:Vg.PAGE_DOWN,action:CT(hE,e,!0,t)}],o)})(e,t,n),cM(n)&&o.get()&&(dM(o,e,!1),e.nodeChanged())}))},uM=(e,t)=>{const o=t.container(),n=t.offset();return lr(o)?(o.insertData(n,e),F.some(ml(o,n+e.length))):Bm(t).map((o=>{const n=wo.fromText(e);return t.isAtEnd()?pn(o,n):hn(o,n),ml(n.dom,e.length)}))},gM=N(uM,Wn),hM=N(uM," "),pM=e=>t=>{e.selection.setRng(t.toRange()),e.nodeChanged()},fM=e=>{const t=ml.fromRangeStart(e.selection.getRng()),o=wo.fromDom(e.getBody());if(e.selection.isCollapsed()){const n=N(hv,e),r=ml.fromRangeStart(e.selection.getRng());return u_(n,e.getBody(),r).bind((e=>t=>t.fold((t=>ru(e.dom,ml.before(t))),(e=>su(e)),(e=>au(e)),(t=>nu(e.dom,ml.after(t)))))(o)).map((n=>()=>((e,t,o)=>n=>Uf(e,n,o)?gM(t):hM(t))(o,t,e.schema)(n).each(pM(e))))}return F.none()},vM=e=>{return Ft(Mt.browser.isFirefox()&&e.selection.isEditable()&&(t=e.dom,o=e.selection.getRng().startContainer,t.isEditable(t.getParent(o,"summary"))),(()=>{const t=wo.fromDom(e.getBody());e.selection.isCollapsed()||e.getDoc().execCommand("Delete"),((e,t,o)=>Uf(e,t,o)?gM(t):hM(t))(t,ml.fromRangeStart(e.selection.getRng()),e.schema).each(pM(e))}));var t,o},bM=e=>{e.on("keydown",(t=>{t.isDefaultPrevented()||((e,t)=>{kT([{keyCode:Vg.SPACEBAR,action:CT(fM,e)},{keyCode:Vg.SPACEBAR,action:CT(vM,e)}],t).each((o=>{t.preventDefault(),sD(e,"insertText",{data:" "}).isDefaultPrevented()||(o(),rD(e,"insertText",{data:" "}))}))})(e,t)}))},yM=e=>Pd(e)?[{keyCode:Vg.TAB,action:CT(nO,e,!0)},{keyCode:Vg.TAB,shiftKey:!0,action:CT(nO,e,!1)}]:[],wM=e=>{e.on("keydown",(t=>{t.isDefaultPrevented()||((e,t)=>{ST([...yM(e)],t).each((e=>{t.preventDefault()}))})(e,t)}))},xM=e=>{if(e.addShortcut("Meta+P","","mcePrint"),ZA(e),EC(e))return Rr(null);{const t=mE(e);return(e=>{e.on("beforeinput",(t=>{e.selection.isEditable()&&!W(t.getTargetRanges(),(t=>!wp(e.dom,t)))||t.preventDefault()}))})(e),(e=>{e.on("keyup compositionstart",N(rT,e))})(e),rO(e,t),dD(e,t),rM(e),bM(e),aM(e),wM(e),sM(e,t),mM(e,t),t}};class CM{constructor(e){let t;this.lastPath=[],this.editor=e;const o=this;"onselectionchange"in e.getDoc()||e.on("NodeChange click mouseup keyup focus",(o=>{const n=e.selection.getRng(),r={startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset};"nodechange"!==o.type&&mh(r,t)||e.dispatch("SelectionChange"),t=r})),e.on("contextmenu",(()=>{ep(e),e.dispatch("SelectionChange")})),e.on("SelectionChange",(()=>{const t=e.selection.getStart(!0);t&&Hu(e)&&!o.isSameElementPath(t)&&e.dom.isChildOf(t,e.getBody())&&e.nodeChanged({selectionChange:!0})})),e.on("mouseup",(t=>{!t.isDefaultPrevented()&&Hu(e)&&("IMG"===e.selection.getNode().nodeName?np.setEditorTimeout(e,(()=>{e.nodeChanged()})):e.nodeChanged())}))}nodeChanged(e={}){const t=this.editor.selection;let o;if(this.editor.initialized&&t&&!Qc(this.editor)&&!this.editor.mode.isReadOnly()){const n=this.editor.getBody();o=t.getStart(!0)||n,o.ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(o,n)||(o=n);const r=[];this.editor.dom.getParent(o,(e=>e===n||(r.push(e),!1))),this.editor.dispatch("NodeChange",{...e,element:o,parents:r})}}isSameElementPath(e){let t;const o=this.editor,n=se(o.dom.getParents(e,P,o.getBody()));if(n.length===this.lastPath.length){for(t=n.length;t>=0&&n[t]===this.lastPath[t];t--);if(-1===t)return this.lastPath=n,!0}return this.lastPath=n,!1}}const SM=Ua("image"),kM=Ua("event"),_M=e=>t=>{t[kM]=e},EM=_M(0),TM=_M(2),OM=_M(1),AM=(DM=0,e=>{const t=e;return F.from(t[kM]).exists((e=>e===DM))});var DM;const MM=Ua("mode"),NM=e=>t=>{t[MM]=e},RM=(e,t)=>NM(t)(e),BM=NM(0),LM=NM(2),HM=NM(1),IM=e=>t=>{const o=t;return F.from(o[MM]).exists((t=>t===e))},PM=IM(0),FM=IM(1),zM=["none","copy","link","move"],VM=["none","copy","copyLink","copyMove","link","linkMove","move","all","uninitialized"],ZM=()=>{const e=new window.DataTransfer;let t="move",o="all";const n={get dropEffect(){return t},set dropEffect(e){j(zM,e)&&(t=e)},get effectAllowed(){return o},set effectAllowed(e){AM(n)&&j(VM,e)&&(o=e)},get items(){return((e,t)=>({...t,get length(){return t.length},add:(o,n)=>{if(PM(e)){if(!h(o))return t.add(o);if(!w(n))return t.add(o,n)}return null},remove:o=>{PM(e)&&t.remove(o)},clear:()=>{PM(e)&&t.clear()}}))(n,e.items)},get files(){return FM(n)?Object.freeze({length:0,item:e=>null}):e.files},get types(){return e.types},setDragImage:(t,o,r)=>{var s;PM(n)&&(s={image:t,x:o,y:r},n[SM]=s,e.setDragImage(t,o,r))},getData:t=>FM(n)?"":e.getData(t),setData:(t,o)=>{PM(n)&&e.setData(t,o)},clearData:t=>{PM(n)&&e.clearData(t)}};return BM(n),n},UM=e=>{const t=ZM(),o=(e=>{const t=e;return F.from(t[MM])})(e);return LM(e),EM(t),t.dropEffect=e.dropEffect,t.effectAllowed=e.effectAllowed,(e=>{const t=e;return F.from(t[SM])})(e).each((e=>t.setDragImage(e.image,e.x,e.y))),q(e.types,(o=>{"Files"!==o&&t.setData(o,e.getData(o))})),q(e.files,(e=>t.items.add(e))),(e=>{const t=e;return F.from(t[kM])})(e).each((e=>{((e,t)=>{_M(t)(e)})(t,e)})),o.each((o=>{RM(e,o),RM(t,o)})),t},jM=(e,t)=>e.setData("text/html",t),WM="x-tinymce/html",$M=A(WM),qM="\x3c!-- "+WM+" --\x3e",GM=e=>qM+e,KM=e=>-1!==e.indexOf(qM),YM=(e,t,o)=>{const n=e.split(/\n\n/),r=((e,t)=>{let o="<"+e;const n=Se(t,((e,t)=>t+'="'+ks.encodeAllRaw(e)+'"'));return n.length&&(o+=" "+n.join(" ")),o+">"})(t,o),s="",a=$(n,(e=>e.split(/\n/).join("
    ")));return 1===a.length?a[0]:$(a,(e=>r+e+s)).join("")},XM="%MCEPASTEBIN%",JM=e=>e.dom.get("mcepastebin"),QM=e=>C(e)&&"mcepastebin"===e.id,eN=e=>e===XM,tN=e=>{const t=Rr(null);return{create:()=>((e,t)=>{const{dom:o,selection:n}=e,r=e.getBody();t.set(n.getRng());const s=o.add(e.getBody(),"div",{id:"mcepastebin",class:"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},XM);Mt.browser.isFirefox()&&o.setStyle(s,"left","rtl"===o.getStyle(r,"direction",!0)?65535:-65535),o.bind(s,"beforedeactivate focusin focusout",(e=>{e.stopPropagation()})),s.focus(),n.select(s,!0)})(e,t),remove:()=>((e,t)=>{const o=e.dom;if(JM(e)){let n;const r=t.get();for(;n=JM(e);)o.remove(n),o.unbind(n);r&&e.selection.setRng(r)}t.set(null)})(e,t),getEl:()=>JM(e),getHtml:()=>(e=>{const t=e.dom,o=(e,o)=>{e.appendChild(o),t.remove(o,!0)},[n,...r]=Y(e.getBody().childNodes,QM);q(r,(e=>{o(n,e)}));const s=t.select("div[id=mcepastebin]",n);for(let e=s.length-1;e>=0;e--){const r=t.create("div");n.insertBefore(r,s[e]),o(r,s[e])}return n?n.innerHTML:""})(e),getLastRng:t.get}},oN=(e,t)=>(Lt.each(t,(t=>{e=g(t,RegExp)?e.replace(t,""):e.replace(t[0],t[1])})),e),nN=e=>e=oN(e,[/^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/|/g,[/( ?)\u00a0<\/span>( ?)/g,(e,t,o)=>t||o?Wn:" "],/
    /g,/
    $/i]),rN=(e,t)=>({content:e,cancelled:t}),sN=(e,t,o)=>{const n=((e,t,o)=>e.dispatch("PastePreProcess",{content:t,internal:o}))(e,t,o),r=((e,t)=>{const o=zx({sanitize:Ld(e),sandbox_iframes:Vd(e),sandbox_iframes_exclusions:Zd(e),convert_unsafe_embeds:Ud(e)},e.schema);o.addNodeFilter("meta",(e=>{Lt.each(e,(e=>{e.remove()}))}));const n=o.parse(t,{forced_root_block:!1,isRootContent:!0});return Yp({validate:!0},e.schema).serialize(n)})(e,n.content);return e.hasEventListeners("PastePostProcess")&&!n.isDefaultPrevented()?((e,t,o)=>{const n=e.dom.create("div",{style:"display:none"},t),r=((e,t,o)=>e.dispatch("PastePostProcess",{node:t,internal:o}))(e,n,o);return rN(r.node.innerHTML,r.isDefaultPrevented())})(e,r,o):rN(r,n.isDefaultPrevented())},aN=(e,t)=>(e.insertContent(t,{merge:Sd(e),paste:!0}),!0),iN=e=>/^https?:\/\/[\w\-\/+=.,!;:&%@^~(){}?#]+$/i.test(e),lN=(e,t,o)=>!(e.selection.isCollapsed()||!iN(t))&&((e,t,o)=>(e.undoManager.extra((()=>{o(e,t)}),(()=>{e.execCommand("mceInsertLink",!1,t)})),!0))(e,t,o),cN=(e,t,o)=>!!((e,t)=>iN(t)&&W(Id(e),(e=>$e(t.toLowerCase(),`.${e.toLowerCase()}`))))(e,t)&&((e,t,o)=>(e.undoManager.extra((()=>{o(e,t)}),(()=>{e.insertContent('')})),!0))(e,t,o),dN=(e,t,o)=>{o||!kd(e)?aN(e,t):((e,t)=>{Lt.each([lN,cN,aN],(o=>!o(e,t,aN)))})(e,t)},mN=(e=>{let t=0;return()=>e+t++})("mceclip"),uN=e=>{const t=ZM();return jM(t,e),LM(t),t},gN=(e,t,o,n,r)=>{const s=((e,t,o)=>sN(e,t,o))(e,t,o);if(!s.cancelled){const t=s.content,o=()=>dN(e,t,n);r?sD(e,"insertFromPaste",{dataTransfer:uN(t)}).isDefaultPrevented()||(o(),rD(e,"insertFromPaste")):o()}},hN=(e,t,o,n)=>{const r=o||KM(t);gN(e,(e=>e.replace(qM,""))(t),r,!1,n)},pN=(e,t,o)=>{const n=e.dom.encode(t).replace(/\r\n/g,"\n"),r=Yn(n,Ed(e)),s=YM(r,sc(e),ac(e));gN(e,s,!1,!0,o)},fN=e=>{const t={};if(e&&e.types)for(let o=0;ot in e&&e[t].length>0,bN=e=>vN(e,"text/html")||vN(e,"text/plain"),yN=(e,t,o,n)=>{const r=mN(),s=gc(e)&&C(o.name),a=s?((e,t)=>{const o=t.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return C(o)?e.dom.encode(o[1]):void 0})(e,o.name):r,i=s?o.name:void 0,l=t.create(r,o,n,a,i);return t.add(l),l},wN=e=>{const t=Id(e);return e=>We(e.type,"image/")&&W(t,(t=>(e=>{const t=e.toLowerCase(),o={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"};return Lt.hasOwn(o,t)?"image/"+o[t]:"image/"+t})(t)===e.type))},xN=(e,t,o)=>{const n="paste"===t.type?t.clipboardData:t.dataTransfer;var r;if(vd(e)&&n){const s=((e,t)=>{const o=t.items?ne(ue(t.items),(e=>"file"===e.kind?[e.getAsFile()]:[])):[],n=t.files?ue(t.files):[];return Y(o.length>0?o:n,wN(e))})(e,n);if(s.length>0)return t.preventDefault(),(r=s,Promise.all($(r,(e=>uw(e).then((t=>({file:e,uri:t}))))))).then((t=>{o&&e.selection.setRng(o),q(t,(t=>{((e,t)=>{cw(t.uri).each((({data:o,type:n,base64Encoded:r})=>{const s=r?o:btoa(o),a=t.file,i=e.editorUpload.blobCache,l=i.getByData(s,n),c=null!=l?l:yN(e,i,a,s);hN(e,``,!1,!0)}))})(e,t)}))})),!0}return!1},CN=(e,t,o,n,r)=>{let s=nN(o);const a=vN(t,$M())||KM(o),i=!a&&(e=>!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(e))(s),l=iN(s);(eN(s)||!s.length||i&&!l)&&(n=!0),(n||l)&&(s=vN(t,"text/plain")&&i?t["text/plain"]:(e=>{const t=Us(),o=zx({},t);let n="";const r=t.getVoidElements(),s=Lt.makeMap("script noscript style textarea video audio iframe object"," "),a=t.getBlockElements(),i=e=>{const o=e.name,l=e;if("br"!==o){if("wbr"!==o)if(r[o]&&(n+=" "),s[o])n+=" ";else{if(3===e.type&&(n+=e.value),!(e.name in t.getVoidElements())){let t=e.firstChild;if(t)do{i(t)}while(t=t.next)}a[o]&&l.next&&(n+="\n","p"===o&&(n+="\n"))}}else n+="\n"};return e=oN(e,[//g]),i(o.parse(e)),n})(s)),eN(s)||(n?pN(e,s,r):hN(e,s,a,r))},SN=(e,t,o)=>{let n;e.on("keydown",(e=>{(e=>Vg.metaKeyPressed(e)&&86===e.keyCode||e.shiftKey&&45===e.keyCode)(e)&&!e.isDefaultPrevented()&&(n=e.shiftKey&&86===e.keyCode)})),e.on("paste",(r=>{if(r.isDefaultPrevented()||(e=>{var t,o;return Mt.os.isAndroid()&&0===(null===(o=null===(t=e.clipboardData)||void 0===t?void 0:t.items)||void 0===o?void 0:o.length)})(r))return;const s="text"===o.get()||n;n=!1;const a=fN(r.clipboardData);!bN(a)&&xN(e,r,t.getLastRng()||e.selection.getRng())||(vN(a,"text/html")?(r.preventDefault(),CN(e,a,a["text/html"],s,!0)):vN(a,"text/plain")&&vN(a,"text/uri-list")?(r.preventDefault(),CN(e,a,a["text/plain"],s,!0)):(t.create(),np.setEditorTimeout(e,(()=>{const o=t.getHtml();t.remove(),CN(e,a,o,s,!1)}),0)))}))},kN=(e,t,o)=>{SN(e,t,o),(e=>{const t=e=>We(e,"webkit-fake-url"),o=e=>We(e,"data:");e.parser.addNodeFilter("img",((n,r,s)=>{if(!vd(e)&&(e=>{var t;return!0===(null===(t=e.data)||void 0===t?void 0:t.paste)})(s))for(const r of n){const n=r.attr("src");h(n)&&!r.attr("data-mce-object")&&n!==Mt.transparentSrc&&(t(n)||!Td(e)&&o(n))&&r.remove()}}))})(e)},_N=(e,t)=>{e.addCommand("mceTogglePlainTextPaste",(()=>{((e,t)=>{"text"===t.get()?(t.set("html"),zg(e,!1)):(t.set("text"),zg(e,!0)),e.focus()})(e,t)})),e.addCommand("mceInsertClipboardContent",((t,o)=>{o.html&&hN(e,o.html,o.internal,!1),o.text&&pN(e,o.text,!1)}))},EN=(e,t,o,n)=>{((e,t,o)=>{if(!e)return!1;try{return e.clearData(),e.setData("text/html",t),e.setData("text/plain",o),e.setData($M(),t),!0}catch(e){return!1}})(e.clipboardData,t.html,t.text)?(e.preventDefault(),n()):o(t.html,n)},TN=e=>(t,o)=>{const{dom:n,selection:r}=e,s=n.create("div",{contenteditable:"false","data-mce-bogus":"all"}),a=n.create("div",{contenteditable:"true"},t);n.setStyles(s,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),s.appendChild(a),n.add(e.getBody(),s);const i=r.getRng();a.focus();const l=n.createRng();l.selectNodeContents(a),r.setRng(l),np.setEditorTimeout(e,(()=>{r.setRng(i),n.remove(s),o()}),0)},ON=e=>({html:GM(e.selection.getContent({contextual:!0})),text:e.selection.getContent({format:"text"})}),AN=e=>!e.selection.isCollapsed()||(e=>!!e.dom.getParent(e.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",e.getBody()))(e),DN=e=>{e.on("cut",(e=>t=>{!t.isDefaultPrevented()&&AN(e)&&e.selection.isEditable()&&EN(t,ON(e),TN(e),(()=>{if(Mt.browser.isChromium()||Mt.browser.isFirefox()){const t=e.selection.getRng();np.setEditorTimeout(e,(()=>{e.selection.setRng(t),e.execCommand("Delete")}),0)}else e.execCommand("Delete")}))})(e)),e.on("copy",(e=>t=>{!t.isDefaultPrevented()&&AN(e)&&EN(t,ON(e),TN(e),E)})(e))},MN=(e,t)=>{var o,n;return xh.getCaretRangeFromPoint(null!==(o=t.clientX)&&void 0!==o?o:0,null!==(n=t.clientY)&&void 0!==n?n:0,e.getDoc())},NN=(e,t)=>{e.focus(),t&&e.selection.setRng(t)},RN=(e,t)=>{fd(e)&&e.on("dragend dragover draggesture dragdrop drop drag",(e=>{e.preventDefault(),e.stopPropagation()})),vd(e)||e.on("drop",(e=>{const t=e.dataTransfer;t&&(e=>W(e.files,(e=>/^image\//.test(e.type))))(t)&&e.preventDefault()})),e.on("drop",(o=>{if(o.isDefaultPrevented())return;const n=MN(e,o);if(x(n))return;const r=fN(o.dataTransfer),s=vN(r,$M());if((!bN(r)||(e=>{const t=e["text/plain"];return!!t&&0===t.indexOf("file://")})(r))&&xN(e,o,n))return;const a=r[$M()],i=a||r["text/html"]||r["text/plain"],l=((e,t,o,n)=>{const r=e.getParent(o,(e=>Jr(t,e)));if(!b(e.getParent(o,"summary")))return!0;if(r&&Ee(n,"text/html")){const e=(new DOMParser).parseFromString(n["text/html"],"text/html").body;return!b(e.querySelector(r.nodeName.toLowerCase()))}return!1})(e.dom,e.schema,n.startContainer,r),c=t.get();c&&!l||i&&(o.preventDefault(),np.setEditorTimeout(e,(()=>{e.undoManager.transact((()=>{(a||c&&l)&&e.execCommand("Delete"),NN(e,n);const t=nN(i);r["text/html"]?hN(e,t,s,!0):pN(e,t,!0)}))})))})),e.on("dragstart",(e=>{t.set(!0)})),e.on("dragover dragend",(o=>{vd(e)&&!t.get()&&(o.preventDefault(),NN(e,MN(e,o))),"dragend"===o.type&&t.set(!1)})),(e=>{e.on("input",(t=>{const o=e=>b(e.querySelector("summary"));if("deleteByDrag"===t.inputType){const t=Y(e.dom.select("details"),o);q(t,(t=>{hr(t.firstChild)&&t.firstChild.remove();const o=e.dom.create("summary");o.appendChild(li().dom),t.prepend(o)}))}}))})(e)},BN=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,LN=e=>Lt.trim(e).replace(BN,Js).toLowerCase(),HN=(e,t,o)=>{const n=xd(e);if(o||"all"===n||!Cd(e))return t;const r=n?n.split(/[, ]/):[];if(r&&"none"!==n){const o=e.dom,n=e.selection.getNode();t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,((e,t,s,a)=>{const i=o.parseStyle(o.decode(s)),l={};for(let e=0;e]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return t=t.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,((e,t,o,n)=>t+' style="'+o+'"'+n)),t},IN=e=>{const t=Rr(!1),o=Rr(_d(e)?"text":"html"),n=tN(e);(e=>{(Mt.browser.isChromium()||Mt.browser.isSafari())&&((e,t)=>{e.on("PastePreProcess",(o=>{o.content=t(e,o.content,o.internal)}))})(e,HN)})(e),_N(e,o),(e=>{const t=t=>o=>{t(e,o)},o=bd(e);S(o)&&e.on("PastePreProcess",t(o));const n=yd(e);S(n)&&e.on("PastePostProcess",t(n))})(e),e.addQueryStateHandler("mceTogglePlainTextPaste",(()=>"text"===o.get())),e.on("PreInit",(()=>{DN(e),RN(e,t),kN(e,n,o)}))},PN=e=>{(e=>{e.on("click",(t=>{e.dom.getParent(t.target,"details")&&t.preventDefault()}))})(e),(e=>{e.parser.addNodeFilter("details",(t=>{const o=Fd(e);q(t,(e=>{"expanded"===o?e.attr("open","open"):"collapsed"===o&&e.attr("open",null)}))})),e.serializer.addNodeFilter("details",(t=>{const o=zd(e);q(t,(e=>{"expanded"===o?e.attr("open","open"):"collapsed"===o&&e.attr("open",null)}))}))})(e)},FN=hr,zN=lr,VN=e=>vr(e.dom),ZN=e=>t=>ko(wo.fromDom(e),t),UN=(e,t,o)=>Yo(wo.fromDom(e),(e=>(e=>fr(e.dom))(e)||o.isBlock(Wt(e))),ZN(t)).getOr(wo.fromDom(t)).dom,jN=(e,t)=>Yo(wo.fromDom(e),VN,ZN(t)),WN=(e,t,o)=>{const n=new Un(e,t),r=o?n.next.bind(n):n.prev.bind(n);let s=e;for(let t=o?e:r();t&&!FN(t);t=r())ji(t)&&(s=t);return s},$N=e=>{const t=((e,t,o)=>{const n=ml.fromRangeStart(e).getNode(),r=UN(n,t,o),s=WN(n,r,!1),a=WN(n,r,!0),i=document.createRange();return jN(s,r).fold((()=>{zN(s)?i.setStart(s,0):i.setStartBefore(s)}),(e=>i.setStartBefore(e.dom))),jN(a,r).fold((()=>{zN(a)?i.setEnd(a,a.data.length):i.setEndAfter(a)}),(e=>i.setEndAfter(e.dom))),i})(e.selection.getRng(),e.getBody(),e.schema);e.selection.setRng(Cb(t))};var qN;!function(e){e.Before="before",e.After="after"}(qN||(qN={}));const GN=(e,t)=>Math.abs(e.left-t),KN=(e,t)=>Math.abs(e.right-t),YN=(e,t)=>{const o=((e,t)=>Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top)))(e,t)/Math.min(e.height,t.height);return((e,t)=>e.topt.top)(e,t)&&o>.5},XN=(e,t)=>(e=>J(e,((e,t)=>e.fold((()=>F.some(t)),(e=>{const o=Math.min(t.left,e.left),n=Math.min(t.top,e.top),r=Math.max(t.right,e.right),s=Math.max(t.bottom,e.bottom);return F.some({top:n,right:r,bottom:s,left:o,width:r-o,height:s-n})}))),F.none()))(Y(e,(e=>{return(o=t)>=(n=e).top&&o<=n.bottom;var o,n}))).fold((()=>[[],e]),(t=>{const{pass:o,fail:n}=K(e,(e=>YN(e,t)));return[o,n]})),JN=(e,t,o)=>t>e.left&&t{const r=e=>ji(e.node)?F.some(e):Qn(e.node)?QN(ue(e.node.childNodes),t,o,!1):F.none(),s=(e,s)=>{const a=le(e,((e,n)=>s(e,t,o)-s(n,t,o)));return ge(a,r).map((e=>n&&!lr(e.node)&&a.length>1?((e,n,s)=>r(n).filter((n=>Math.abs(s(e,t,o)-s(n,t,o))<2&&lr(n.node))))(e,a[1],s).getOr(e):e))},[a,i]=XN(j_(e),o),{pass:l,fail:c}=K(i,(e=>e.tops(c,Mi))).orThunk((()=>s(l,Mi)))},eR=(e,t,o)=>{const n=wo.fromDom(e),r=To(n),s=wo.fromPoint(r,t,o).filter((e=>_o(n,e))).getOr(n);return((e,t,o,n)=>{const r=(t,s)=>{const a=Y(t.dom.childNodes,R((e=>Qn(e)&&e.classList.contains("mce-drag-container"))));return s.fold((()=>QN(a,o,n,!0)),(e=>{const t=Y(a,(t=>t!==e.dom));return QN(t,o,n,!0)})).orThunk((()=>(ko(t,e)?F.none():Do(t)).bind((e=>r(e,F.some(t))))))};return r(t,F.none())})(n,s,t,o)},tR=(e,t,o)=>eR(e,t,o).filter((e=>cm(e.node))).map((e=>((e,t)=>({node:e.node,position:GN(e,t){var t,o;const n=e.getBoundingClientRect(),r=e.ownerDocument,s=r.documentElement,a=r.defaultView;return{top:n.top+(null!==(t=null==a?void 0:a.scrollY)&&void 0!==t?t:0)-s.clientTop,left:n.left+(null!==(o=null==a?void 0:a.scrollX)&&void 0!==o?o:0)-s.clientLeft}},nR=(e,t)=>{return o=(e=>e.inline?oR(e.getBody()):{left:0,top:0})(e),n=(e=>{const t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}})(e),r=((e,t)=>{if(t.target.ownerDocument!==e.getDoc()){const o=oR(e.getContentAreaContainer()),n=(e=>{const t=e.getBody(),o=e.getDoc().documentElement,n={left:t.scrollLeft,top:t.scrollTop},r={left:t.scrollLeft||o.scrollLeft,top:t.scrollTop||o.scrollTop};return e.inline?n:r})(e);return{left:t.pageX-o.left+n.left,top:t.pageY-o.top+n.top}}return{left:t.pageX,top:t.pageY}})(e,t),{pageX:r.left-o.left+n.left,pageY:r.top-o.top+n.top};var o,n,r},rR=e=>({target:e,srcElement:e}),sR=(e,t,o,n)=>{const r=((e,t)=>{const o=UM(e);return"dragstart"===t?(EM(o),BM(o)):"drop"===t?(TM(o),LM(o)):(OM(o),HM(o)),o})(o,e);return w(n)?((e,t,o)=>{const n=B("Function not supported on simulated event.");return{bubbles:!0,cancelBubble:!1,cancelable:!0,composed:!1,currentTarget:null,defaultPrevented:!1,eventPhase:0,isTrusted:!0,returnValue:!1,timeStamp:0,type:e,composedPath:n,initEvent:n,preventDefault:E,stopImmediatePropagation:E,stopPropagation:E,AT_TARGET:window.Event.AT_TARGET,BUBBLING_PHASE:window.Event.BUBBLING_PHASE,CAPTURING_PHASE:window.Event.CAPTURING_PHASE,NONE:window.Event.NONE,altKey:!1,button:0,buttons:0,clientX:0,clientY:0,ctrlKey:!1,metaKey:!1,movementX:0,movementY:0,offsetX:0,offsetY:0,pageX:0,pageY:0,relatedTarget:null,screenX:0,screenY:0,shiftKey:!1,x:0,y:0,detail:0,view:null,which:0,initUIEvent:n,initMouseEvent:n,getModifierState:n,dataTransfer:o,...rR(t)}})(e,t,r):((e,t,o,n)=>({...t,dataTransfer:n,type:e,...rR(o)}))(e,n,t,r)},aR=vr,iR=((...e)=>t=>{for(let o=0;o{const r=e.dom,s=t.cloneNode(!0);r.setStyles(s,{width:o,height:n}),r.setAttrib(s,"data-mce-selected",null);const a=r.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return r.setStyles(a,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:o,height:n}),r.setStyles(s,{margin:0,boxSizing:"border-box"}),a.appendChild(s),a},cR=(e,t)=>o=>()=>{const n="left"===e?o.scrollX:o.scrollY;o.scroll({[e]:n+t,behavior:"smooth"})},dR=cR("left",-32),mR=cR("left",32),uR=cR("top",-32),gR=cR("top",32),hR=e=>{e&&e.parentNode&&e.parentNode.removeChild(e)},pR=(e,t)=>o=>{if((e=>0===e.button)(o)){const n=ee(t.dom.getParents(o.target),iR).getOr(null);if(C(n)&&((e,t,o)=>aR(o)&&o!==t&&e.isEditable(o.parentElement))(t.dom,t.getBody(),n)){const r=t.dom.getPos(n),s=t.getBody(),a=t.getDoc().documentElement;e.set({element:n,dataTransfer:ZM(),dragging:!1,screenX:o.screenX,screenY:o.screenY,maxX:(t.inline?s.scrollWidth:a.offsetWidth)-2,maxY:(t.inline?s.scrollHeight:a.offsetHeight)-2,relX:o.pageX-r.x,relY:o.pageY-r.y,width:n.offsetWidth,height:n.offsetHeight,ghost:lR(t,n,n.offsetWidth,n.offsetHeight),intervalId:Br(100)})}}},fR=(e,t,o,n,r)=>{"dragstart"===t&&jM(n,e.dom.getOuterHTML(o));const s=sR(t,o,n,r);return e.dispatch(t,s)},vR=(e,t)=>{const o=Ta(((e,o)=>((e,t,o)=>{e._selectionOverrides.hideFakeCaret(),tR(e.getBody(),t,o).fold((()=>e.selection.placeCaretAt(t,o)),(n=>{const r=e._selectionOverrides.showCaret(1,n.node,n.position===qN.Before,!1);r?e.selection.setRng(r):e.selection.placeCaretAt(t,o)}))})(t,e,o)),0);t.on("remove",o.cancel);const n=e;return r=>e.on((e=>{const s=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(!e.dragging&&s>10){const o=fR(t,"dragstart",e.element,e.dataTransfer,r);if(C(o.dataTransfer)&&(e.dataTransfer=o.dataTransfer),o.isDefaultPrevented())return;e.dragging=!0,t.focus()}if(e.dragging){const s=r.currentTarget===t.getDoc().documentElement,l=((e,t)=>({pageX:t.pageX-e.relX,pageY:t.pageY+5}))(e,nR(t,r));a=e.ghost,i=t.getBody(),a.parentNode!==i&&i.appendChild(a),((e,t,o,n,r,s,a,i,l,c,d,m)=>{let u=0,g=0;e.style.left=t.pageX+"px",e.style.top=t.pageY+"px",t.pageX+o>r&&(u=t.pageX+o-r),t.pageY+n>s&&(g=t.pageY+n-s),e.style.width=o-u+"px",e.style.height=n-g+"px";const h=l.clientHeight,p=l.clientWidth,f=a+l.getBoundingClientRect().top,v=i+l.getBoundingClientRect().left;d.on((e=>{e.intervalId.clear(),e.dragging&&m&&(a+8>=h?e.intervalId.set(gR(c)):a-8<=0?e.intervalId.set(uR(c)):i+8>=p?e.intervalId.set(mR(c)):i-8<=0?e.intervalId.set(dR(c)):f+16>=window.innerHeight?e.intervalId.set(gR(window)):f-16<=0?e.intervalId.set(uR(window)):v+16>=window.innerWidth?e.intervalId.set(mR(window)):v-16<=0&&e.intervalId.set(dR(window)))}))})(e.ghost,l,e.width,e.height,e.maxX,e.maxY,r.clientY,r.clientX,t.getContentAreaContainer(),t.getWin(),n,s),o.throttle(r.clientX,r.clientY)}var a,i}))},bR=(e,t)=>o=>{e.on((e=>{var n;if(e.intervalId.clear(),e.dragging){if(((e,t,o)=>!x(t)&&t!==o&&!e.dom.isChildOf(t,o)&&e.dom.isEditable(t))(t,(e=>{const t=e.getSel();if(C(t)){const e=t.getRangeAt(0).startContainer;return lr(e)?e.parentNode:e}return null})(t.selection),e.element)){const r=null!==(n=t.getDoc().elementFromPoint(o.clientX,o.clientY))&&void 0!==n?n:t.getBody();fR(t,"drop",r,e.dataTransfer,o).isDefaultPrevented()||t.undoManager.transact((()=>{((e,t)=>{const o=e.getParent(t.parentNode,e.isBlock);hR(t),o&&o!==e.getRoot()&&e.isEmpty(o)&&ci(wo.fromDom(o))})(t.dom,e.element),(e=>{const t=e.getData("text/html");return""===t?F.none():F.some(t)})(e.dataTransfer).each((e=>t.insertContent(e))),t._selectionOverrides.hideFakeCaret()}))}fR(t,"dragend",t.getBody(),e.dataTransfer,o)}})),wR(e)},yR=(e,t,o)=>{e.on((e=>{e.intervalId.clear(),e.dragging&&o.fold((()=>fR(t,"dragend",e.element,e.dataTransfer)),(o=>fR(t,"dragend",e.element,e.dataTransfer,o)))})),wR(e)},wR=e=>{e.on((e=>{e.intervalId.clear(),hR(e.ghost)})),e.clear()},xR=e=>{const t=Lr(),o=ya.DOM,n=document,r=pR(t,e),s=vR(t,e),a=bR(t,e),i=((e,t)=>o=>yR(e,t,F.some(o)))(t,e);e.on("mousedown",r),e.on("mousemove",s),e.on("mouseup",a),o.bind(n,"mousemove",s),o.bind(n,"mouseup",i),e.on("remove",(()=>{o.unbind(n,"mousemove",s),o.unbind(n,"mouseup",i)})),e.on("keydown",(o=>{o.keyCode===Vg.ESC&&yR(t,e,F.none())}))},CR=e=>{xR(e),sd(e)&&(e=>{const t=t=>{if(!t.isDefaultPrevented()){const o=t.dataTransfer;o&&(j(o.types,"Files")||o.files.length>0)&&(t.preventDefault(),"drop"===t.type&&kS(e,"Dropped file type is not supported"))}},o=o=>{lp(e,o.target)&&t(o)},n=()=>{const n=ya.DOM,r=e.dom,s=document,a=e.inline?e.getBody():e.getDoc(),i=["drop","dragover"];q(i,(e=>{n.bind(s,e,o),r.bind(a,e,t)})),e.on("remove",(()=>{q(i,(e=>{n.unbind(s,e,o),r.unbind(a,e,t)}))}))};e.on("init",(()=>{np.setEditorTimeout(e,n,0)}))})(e)},SR=vr,kR=(e,t)=>ab(e.getBody(),t),_R=e=>{const t=e.selection,o=e.dom,n=e.getBody(),r=am(e,n,o.isBlock,(()=>fp(e))),s="sel-"+o.uniqueId(),a="data-mce-selected";let i;const l=e=>e!==n&&(SR(e)||wr(e))&&o.isChildOf(e,n)&&o.isEditable(e.parentNode),c=(o,n,s,a=!0)=>e.dispatch("ShowCaret",{target:n,direction:o,before:s}).isDefaultPrevented()?null:(a&&t.scrollIntoView(n,-1===o),r.show(s,n)),d=()=>{e.on("click",(t=>{o.isEditable(t.target)||(t.preventDefault(),e.focus())})),e.on("blur NewBlock",f),e.on("ResizeWindow FullscreenStateChanged",r.reposition),e.on("tap",(t=>{const o=t.target,n=kR(e,o);SR(n)?(t.preventDefault(),Sk(e,n).each(p)):l(o)&&Sk(e,o).each(p)}),!0),e.on("mousedown",(r=>{const s=r.target;if(s!==n&&"HTML"!==s.nodeName&&!o.isChildOf(s,n))return;if(!vS(e,r.clientX,r.clientY))return;f(),v();const a=kR(e,s);SR(a)?(r.preventDefault(),Sk(e,a).each(p)):tR(n,r.clientX,r.clientY).each((o=>{r.preventDefault(),(e=>{e&&t.setRng(e)})(c(1,o.node,o.position===qN.Before,!1)),er(a)?a.focus():e.getBody().focus()}))})),e.on("keypress",(e=>{Vg.modifierPressed(e)||SR(t.getNode())&&e.preventDefault()})),e.on("GetSelectionRange",(e=>{let t=e.range;if(i){if(!i.parentNode)return void(i=null);t=t.cloneRange(),t.selectNode(i),e.range=t}})),e.on("SetSelectionRange",(e=>{e.range=g(e.range);const t=p(e.range,e.forward);t&&(e.range=t)})),e.on("AfterSetSelectionRange",(e=>{const t=e.range,n=t.startContainer.parentElement;var r;u(t)||Qn(r=n)&&"mcepastebin"===r.id||v(),(e=>C(e)&&o.hasClass(e,"mce-offscreen-selection"))(n)||f()})),CR(e),(e=>{const t=Ta((()=>{if(!e.removed&&e.getBody().contains(document.activeElement)){const t=e.selection.getRng();if(t.collapsed){const o=kk(e,t,!1);e.selection.setRng(o)}}}),0);e.on("focus",(()=>{t.throttle()})),e.on("blur",(()=>{t.cancel()}))})(e),(e=>{e.on("init",(()=>{e.on("focusin",(t=>{const o=t.target;if(wr(o)){const t=ab(e.getBody(),o),n=vr(t)?t:o;e.selection.getNode()!==n&&Sk(e,n).each((t=>e.selection.setRng(t)))}}))}))})(e)},m=e=>vi(e)||xi(e)||Ci(e),u=e=>m(e.startContainer)||m(e.endContainer),g=t=>{const n=e.schema.getVoidElements(),r=o.createRng(),s=t.startContainer,a=t.startOffset,i=t.endContainer,l=t.endOffset;return Ee(n,s.nodeName.toLowerCase())?0===a?r.setStartBefore(s):r.setStartAfter(s):r.setStart(s,a),Ee(n,i.nodeName.toLowerCase())?0===l?r.setEndBefore(i):r.setEndAfter(i):r.setEnd(i,l),r},h=n=>{const r=n.cloneNode(!0),l=e.dispatch("ObjectSelected",{target:n,targetClone:r});if(l.isDefaultPrevented())return null;const c=((n,r)=>{const a=wo.fromDom(e.getBody()),i=e.getDoc(),l=en(a,"#"+s).getOrThunk((()=>{const e=wo.fromHtml('
    ',i);return to(e,"id",s),vn(a,e),e})),c=o.createRng();wn(l),yn(l,[wo.fromText(Wn,i),wo.fromDom(r),wo.fromText(Wn,i)]),c.setStart(l.dom.firstChild,1),c.setEnd(l.dom.lastChild,0),ln(l,{top:o.getPos(n,e.getBody()).y+"px"}),jh(l);const d=t.getSel();return d&&(d.removeAllRanges(),d.addRange(c)),c})(n,l.targetClone),d=wo.fromDom(n);return q(Fn(wo.fromDom(e.getBody()),`*[${a}]`),(e=>{ko(d,e)||ao(e,a)})),o.getAttrib(n,a)||n.setAttribute(a,"1"),i=n,v(),c},p=(e,t)=>{if(!e)return null;if(e.collapsed){if(!u(e)){const r=t?1:-1,s=Rm(r,n,e),a=s.getNode(!t);if(C(a)){if(cm(a))return c(r,a,!!t&&!s.isAtEnd(),!1);if(fi(a)&&vr(a.nextSibling)){const e=o.createRng();return e.setStart(a,0),e.setEnd(a,0),e}}const i=s.getNode(t);if(C(i)){if(cm(i))return c(r,i,!t&&!s.isAtEnd(),!1);if(fi(i)&&vr(i.previousSibling)){const e=o.createRng();return e.setStart(i,1),e.setEnd(i,1),e}}}return null}let r=e.startContainer,s=e.startOffset;const a=e.endOffset;if(lr(r)&&0===s&&SR(r.parentNode)&&(r=r.parentNode,s=o.nodeIndex(r),r=r.parentNode),!Qn(r))return null;if(a===s+1&&r===e.endContainer){const e=r.childNodes[s];if(l(e))return h(e)}return null},f=()=>{i&&i.removeAttribute(a),en(wo.fromDom(e.getBody()),"#"+s).each(xn),i=null},v=()=>{r.hide()};return EC(e)||d(),{showCaret:c,showBlockCaretContainer:e=>{e.hasAttribute("data-mce-caret")&&(Si(e),t.scrollIntoView(e))},hideFakeCaret:v,destroy:()=>{r.destroy(),i=null}}},ER=(e,t)=>{let o=t;for(let t=e.previousSibling;lr(t);t=t.previousSibling)o+=t.data.length;return o},TR=(e,t,o,n,r)=>{if(lr(o)&&(n<0||n>o.data.length))return[];const s=r&&lr(o)?[ER(o,n)]:[n];let a=o;for(;a!==t&&a.parentNode;)s.push(e.nodeIndex(a,r)),a=a.parentNode;return a===t?s.reverse():[]},OR=(e,t,o,n,r,s,a=!1)=>({start:TR(e,t,o,n,a),end:TR(e,t,r,s,a)}),AR=(e,t)=>{const o=t.slice(),n=o.pop();return k(n)?J(o,((e,t)=>e.bind((e=>F.from(e.childNodes[t])))),F.some(e)).bind((e=>lr(e)&&(n<0||n>e.data.length)?F.none():F.some({node:e,offset:n}))):F.none()},DR=(e,t)=>AR(e,t.start).bind((({node:o,offset:n})=>AR(e,t.end).map((({node:e,offset:t})=>{const r=document.createRange();return r.setStart(o,n),r.setEnd(e,t),r})))),MR=(e,t,o)=>{if(t&&e.isEmpty(t)&&!o(t)){const n=t.parentNode;e.remove(t,lr(t.firstChild)&&Gn(t.firstChild.data)),MR(e,n,o)}},NR=(e,t,o,n=!0)=>{const r=t.startContainer.parentNode,s=t.endContainer.parentNode;t.deleteContents(),n&&!o(t.startContainer)&&(lr(t.startContainer)&&0===t.startContainer.data.length&&e.remove(t.startContainer),lr(t.endContainer)&&0===t.endContainer.data.length&&e.remove(t.endContainer),MR(e,r,o),r!==s&&MR(e,s,o))},RR=(e,t)=>F.from(e.dom.getParent(t.startContainer,e.dom.isBlock)),BR=(e,t,o)=>{const n=e.dynamicPatternsLookup({text:o,block:t});return{...e,blockPatterns:Vl(n).concat(e.blockPatterns),inlinePatterns:Zl(n).concat(e.inlinePatterns)}},LR=(e,t,o,n)=>{const r=e.createRng();return r.setStart(t,0),r.setEnd(o,n),r.toString()},HR=(e,t)=>e.create("span",{"data-mce-type":"bookmark",id:t}),IR=(e,t)=>{const o=e.createRng();return o.setStartAfter(t.start),o.setEndBefore(t.end),o},PR=(e,t,o)=>{const n=DR(e.getRoot(),o).getOrDie("Unable to resolve path range"),r=n.startContainer,s=n.endContainer,a=0===n.endOffset?s:s.splitText(n.endOffset),i=0===n.startOffset?r:r.splitText(n.startOffset),l=i.parentNode;return{prefix:t,end:a.parentNode.insertBefore(HR(e,t+"-end"),a),start:l.insertBefore(HR(e,t+"-start"),i)}},FR=(e,t,o)=>{MR(e,e.get(t.prefix+"-end"),o),MR(e,e.get(t.prefix+"-start"),o)},zR=e=>0===e.start.length,VR=(e,t,o,n)=>{const r=t.start;var s;return mO(e,n.container,n.offset,(s=r,(e,t)=>{const o=e.data.substring(0,t),n=o.lastIndexOf(s.charAt(s.length-1)),r=o.lastIndexOf(s);return-1!==r?r+s.length:-1!==n?n+1:-1}),o).bind((n=>{var s,a;const i=null!==(a=null===(s=o.textContent)||void 0===s?void 0:s.indexOf(r))&&void 0!==a?a:-1;if(-1!==i&&n.offset>=i+r.length){const t=e.createRng();return t.setStart(n.container,n.offset-r.length),t.setEnd(n.container,n.offset),F.some(t)}{const s=n.offset-r.length;return cO(n.container,s,o).map((t=>{const o=e.createRng();return o.setStart(t.container,t.offset),o.setEnd(n.container,n.offset),o})).filter((e=>e.toString()===r)).orThunk((()=>VR(e,t,o,sO(n.container,0))))}}))},ZR=(e,t,o,n)=>{const r=e.dom,s=r.getRoot(),a=o.pattern,i=o.position.container,l=o.position.offset;return cO(i,l-o.pattern.end.length,t).bind((c=>{const d=OR(r,s,c.container,c.offset,i,l,n);if(zR(a))return F.some({matches:[{pattern:a,startRng:d,endRng:d}],position:c});{const i=UR(e,o.remainingPatterns,c.container,c.offset,t,n),l=i.getOr({matches:[],position:c}),m=l.position,u=((e,t,o,n,r,s=!1)=>{if(0===t.start.length&&!s){const t=e.createRng();return t.setStart(o,n),t.setEnd(o,n),F.some(t)}return lO(o,n,r).bind((o=>VR(e,t,r,o).bind((e=>{var t;if(s){if(e.endContainer===o.container&&e.endOffset===o.offset)return F.none();if(0===o.offset&&(null===(t=e.endContainer.textContent)||void 0===t?void 0:t.length)===e.endOffset)return F.none()}return F.some(e)}))))})(r,a,m.container,m.offset,t,i.isNone());return u.map((e=>{const t=((e,t,o,n=!1)=>OR(e,t,o.startContainer,o.startOffset,o.endContainer,o.endOffset,n))(r,s,e,n);return{matches:l.matches.concat([{pattern:a,startRng:t,endRng:d}]),position:sO(e.startContainer,e.startOffset)}}))}}))},UR=(e,t,o,n,r,s)=>{const a=e.dom;return lO(o,n,a.getRoot()).bind((i=>{const l=LR(a,r,o,n);for(let a=0;a0)return UR(e,t,o,n-1,r,s);if(m.isSome())return m}return F.none()}))},jR=(e,t,o)=>{e.selection.setRng(o),"inline-format"===t.type?q(t.format,(t=>{e.formatter.apply(t)})):e.execCommand(t.cmd,!1,t.value)},WR=(e,t,o,n,r,s)=>{var a;return((e,t)=>{const o=re(e,(e=>W(t,(t=>e.pattern.start===t.pattern.start&&e.pattern.end===t.pattern.end))));return e.length===t.length?o?e:t:e.length>t.length?e:t})(UR(e,r.inlinePatterns,o,n,t,s).fold((()=>[]),(e=>e.matches)),UR(e,(a=r.inlinePatterns,le(a,((e,t)=>t.end.length-e.end.length))),o,n,t,s).fold((()=>[]),(e=>e.matches)))},$R=(e,t)=>{if(0===t.length)return;const o=e.dom,n=e.selection.getBookmark(),r=((e,t)=>{const o=Ua("mce_textpattern"),n=X(t,((t,n)=>{const r=PR(e,o+`_end${t.length}`,n.endRng);return t.concat([{...n,endMarker:r}])}),[]);return X(n,((t,r)=>{const s=n.length-t.length-1,a=zR(r.pattern)?r.endMarker:PR(e,o+`_start${s}`,r.startRng);return t.concat([{...r,startMarker:a}])}),[])})(o,t);q(r,(t=>{const n=o.getParent(t.startMarker.start,o.isBlock),r=e=>e===n;zR(t.pattern)?((e,t,o,n)=>{const r=IR(e.dom,o);NR(e.dom,r,n),jR(e,t,r)})(e,t.pattern,t.endMarker,r):((e,t,o,n,r)=>{const s=e.dom,a=IR(s,n),i=IR(s,o);NR(s,i,r),NR(s,a,r);const l={prefix:o.prefix,start:o.end,end:n.start},c=IR(s,l);jR(e,t,c)})(e,t.pattern,t.startMarker,t.endMarker,r),FR(o,t.endMarker,r),FR(o,t.startMarker,r)})),e.selection.moveToBookmark(n)},qR=(e,t,o)=>((e,t,o)=>{if(lr(e)&&t>=e.length)return F.some(sO(e,t));{const n=Ka(aO);return F.from(n.forwards(e,t,iO(e),o)).map((e=>sO(e.container,0)))}})(t,0,t).map((n=>{const r=n.container;return dO(r,o.start.length,t).each((o=>{const n=e.createRng();n.setStart(r,0),n.setEnd(o.container,o.offset),NR(e,n,(e=>e===t))})),r})),GR=e=>(t,o)=>{const n=t.dom,r=o.pattern,s=DR(n.getRoot(),o.range).getOrDie("Unable to resolve path range");return RR(t,s).each((o=>{"block-format"===r.type?((e,t)=>{const o=t.get(e);return v(o)&&de(o).exists((e=>Ee(e,"block")))})(r.format,t.formatter)&&t.undoManager.transact((()=>{e(t.dom,o,r),t.formatter.apply(r.format)})):"block-command"===r.type&&t.undoManager.transact((()=>{e(t.dom,o,r),t.execCommand(r.cmd,!1,r.value)}))})),!0},KR=e=>(t,o)=>{const n=(e=>le(e,((e,t)=>t.start.length-e.start.length)))(t),r=o.replace(Wn," ");return ee(n,(t=>e(t,o,r)))},YR=(e,t)=>(o,n,r,s,a)=>{var i;void 0===a&&(a=null!==(i=n.textContent)&&void 0!==i?i:"");const l=o.dom,c=sc(o);return l.is(n,c)?e(r.blockPatterns,a).map((e=>t&&Lt.trim(a).length===e.start.length?[]:[{pattern:e,range:OR(l,l.getRoot(),n,0,n,0,s)}])).getOr([]):[]},XR=GR(((e,t,o)=>{qR(e,t,o).each((e=>{const t=wo.fromDom(e),o=Xa(t);/^\s[^\s]/.test(o)&&Ja(t,o.slice(1))}))})),JR=KR(((e,t,o)=>0===t.indexOf(e.start)||0===o.indexOf(e.start))),QR=YR(JR,!0),eB=GR(qR),tB=KR(((e,t,o)=>t===e.start||o===e.start)),oB=YR(tB,!1),nB=(e,t)=>((e,t)=>{const o=e.selection.getRng();return RR(e,o).map((n=>{var r;const s=Math.max(0,o.startOffset),a=BR(t,n,null!==(r=n.textContent)&&void 0!==r?r:"");return{inlineMatches:WR(e,n,o.startContainer,s,a,!0),blockMatches:QR(e,n,a,!0)}})).filter((({inlineMatches:e,blockMatches:t})=>t.length>0||e.length>0))})(e,t).fold(I,(({inlineMatches:t,blockMatches:o})=>(e.undoManager.add(),e.undoManager.extra((()=>{e.execCommand("mceInsertNewLine")}),(()=>{(e=>{e.insertContent(di,{preserve_zwsp:!0})})(e),$R(e,t),((e,t)=>{if(0===t.length)return;const o=e.selection.getBookmark();q(t,(t=>XR(e,t))),e.selection.moveToBookmark(o)})(e,o);const n=e.selection.getRng(),r=lO(n.startContainer,n.startOffset,e.dom.getRoot());e.execCommand("mceInsertNewLine"),r.each((t=>{const o=t.container;o.data.charAt(t.offset-1)===jn&&(o.deleteData(t.offset-1,1),MR(e.dom,o.parentNode,(t=>t===e.dom.getRoot())))}))})),!0))),rB=(e,t)=>((e,t)=>{const o=e.selection.getRng();return RR(e,o).map((n=>{const r=Math.max(0,o.startOffset),s=LR(e.dom,n,o.startContainer,r),a=BR(t,n,s);return oB(e,n,a,!1,s)})).filter((e=>e.length>0))})(e,t).fold(I,(t=>(e.undoManager.transact((()=>{((e,t)=>{q(t,(t=>eB(e,t)))})(e,t)})),!0))),sB=(e,t,o)=>{for(let n=0;n{const t=[",",".",";",":","!","?"],o=[32],n=()=>{return t=Od(e).filter((t=>"inline-command"!==t.type&&"block-command"!==t.type||e.queryCommandSupported(t.cmd))),o=Ad(e),{inlinePatterns:Zl(t),blockPatterns:Vl(t),dynamicPatternsLookup:o};var t,o},r=()=>(e=>e.options.isSet("text_patterns_lookup"))(e);e.on("keydown",(t=>{if(13===t.keyCode&&!Vg.modifierPressed(t)&&e.selection.isCollapsed()){const o=Ul(n(),"enter");(o.inlinePatterns.length>0||o.blockPatterns.length>0||r())&&nB(e,o)&&t.preventDefault()}}),!0),e.on("keydown",(t=>{if(32===t.keyCode&&e.selection.isCollapsed()){const o=Ul(n(),"space");(o.blockPatterns.length>0||r())&&rB(e,o)&&t.preventDefault()}}),!0);const s=()=>{if(e.selection.isCollapsed()){const t=Ul(n(),"space");(t.inlinePatterns.length>0||r())&&((e,t)=>{const o=e.selection.getRng();RR(e,o).map((n=>{const r=Math.max(0,o.startOffset-1),s=LR(e.dom,n,o.startContainer,r),a=BR(t,n,s),i=WR(e,n,o.startContainer,r,a,!1);i.length>0&&e.undoManager.transact((()=>{$R(e,i)}))}))})(e,t)}};e.on("keyup",(e=>{sB(o,e,((e,t)=>e===t.keyCode&&!Vg.modifierPressed(t)))&&s()})),e.on("keypress",(o=>{sB(t,o,((e,t)=>e.charCodeAt(0)===t.charCode))&&np.setEditorTimeout(e,s)}))},iB=e=>{const t=Lt.each,o=Vg.BACKSPACE,n=Vg.DELETE,r=e.dom,s=e.selection,a=e.parser,i=Mt.browser,l=i.isFirefox(),c=i.isChromium()||i.isSafari(),d=Mt.deviceType.isiPhone()||Mt.deviceType.isiPad(),m=Mt.os.isMacOS()||Mt.os.isiOS(),u=(t,o)=>{try{e.getDoc().execCommand(t,!1,String(o))}catch(e){}},g=e=>e.isDefaultPrevented(),h=()=>{const t=e=>{const t=r.create("body"),o=e.cloneContents();return t.appendChild(o),s.serializer.serialize(t,{format:"html"})};e.on("keydown",(s=>{const a=s.keyCode;if(!g(s)&&(a===n||a===o)&&e.selection.isEditable()){const o=e.selection.isCollapsed(),n=e.getBody();if(o&&!Dr(e.schema,n))return;if(!o&&!(o=>{const n=t(o),s=r.createRng();return s.selectNode(e.getBody()),n===t(s)})(e.selection.getRng()))return;s.preventDefault(),e.setContent(""),n.firstChild&&r.isBlock(n.firstChild)?e.selection.setCursorLocation(n.firstChild,0):e.selection.setCursorLocation(n,0),e.nodeChanged()}}))},p=()=>{e.shortcuts.add("meta+a",null,"SelectAll")},f=()=>{e.inline||r.bind(e.getDoc(),"mousedown mouseup",(t=>{let o;if(t.target===e.getDoc().documentElement)if(o=s.getRng(),e.getBody().focus(),"mousedown"===t.type){if(vi(o.startContainer))return;s.placeCaretAt(t.clientX,t.clientY)}else s.setRng(o)}))},v=()=>{Range.prototype.getClientRects||e.on("mousedown",(t=>{if(!g(t)&&"HTML"===t.target.nodeName){const t=e.getBody();t.blur(),np.setEditorTimeout(e,(()=>{t.focus()}))}}))},b=()=>{const t=ld(e);e.on("click",(o=>{const n=o.target;/^(IMG|HR)$/.test(n.nodeName)&&r.isEditable(n)&&(o.preventDefault(),e.selection.select(n),e.nodeChanged()),"A"===n.nodeName&&r.hasClass(n,t)&&0===n.childNodes.length&&r.isEditable(n.parentNode)&&(o.preventDefault(),s.select(n))}))},y=()=>{e.on("keydown",(e=>{if(!g(e)&&e.keyCode===o&&s.isCollapsed()&&0===s.getRng().startOffset){const t=s.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}return!0}))},w=()=>{const t=()=>{u("StyleWithCSS",!1),u("enableInlineTableEditing",!1),Nc(e)||u("enableObjectResizing",!1)};ed(e)||e.on("BeforeExecCommand mousedown",t)},x=()=>{e.on("SetContent ExecCommand",(e=>{"setcontent"!==e.type&&"mceInsertLink"!==e.command||t(r.select("a:not([data-mce-block])"),(e=>{var t;let o=e.parentNode;const n=r.getRoot();if((null==o?void 0:o.lastChild)===e){for(;o&&!r.isBlock(o);){if((null===(t=o.parentNode)||void 0===t?void 0:t.lastChild)!==o||o===n)return;o=o.parentNode}r.add(o,"br",{"data-mce-bogus":1})}}))}))},C=()=>{e.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},S=()=>{e.inline||e.on("keydown",(()=>{document.activeElement===document.body&&e.getWin().focus()}))},k=()=>{e.inline||(e.contentStyles.push("body {min-height: 150px}"),e.on("click",(t=>{let o;"HTML"===t.target.nodeName&&(o=e.selection.getRng(),e.getBody().focus(),e.selection.setRng(o),e.selection.normalize(),e.nodeChanged())})))},_=()=>{m&&e.on("keydown",(t=>{!Vg.metaKeyPressed(t)||t.shiftKey||37!==t.keyCode&&39!==t.keyCode||(t.preventDefault(),e.selection.getSel().modify("move",37===t.keyCode?"backward":"forward","lineboundary"))}))},T=()=>{e.on("click",(e=>{let t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)})),e.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},O=()=>{e.on("init",(()=>{e.dom.bind(e.getBody(),"submit",(e=>{e.preventDefault()}))}))},A=E,D=()=>{e.on("keydown",(t=>{if(g(t)||t.keyCode!==Vg.BACKSPACE)return;let o=s.getRng();const n=o.startContainer,a=o.startOffset,i=r.getRoot();let l=n;if(o.collapsed&&0===a){for(;l.parentNode&&l.parentNode.firstChild===l&&l.parentNode!==i;)l=l.parentNode;"BLOCKQUOTE"===l.nodeName&&(e.formatter.toggle("blockquote",void 0,l),o=r.createRng(),o.setStart(n,0),o.setEnd(n,0),s.setRng(o))}})),h(),Mt.windowsPhone||e.on("keyup focusin mouseup",(t=>{Vg.modifierPressed(t)||(e=>{const t=e.getBody(),o=e.selection.getRng();return o.startContainer===o.endContainer&&o.startContainer===t&&0===o.startOffset&&o.endOffset===t.childNodes.length})(e)||s.normalize()}),!0),c&&(f(),b(),e.on("init",(()=>{u("DefaultParagraphSeparator",sc(e))})),O(),y(),a.addNodeFilter("br",(e=>{let t=e.length;for(;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()})),d?(S(),k(),T()):p()),l&&(e.on("keydown",(t=>{if(!g(t)&&t.keyCode===o){if(!e.getBody().getElementsByTagName("hr").length)return;if(s.isCollapsed()&&0===s.getRng().startOffset){const e=s.getNode(),o=e.previousSibling;if("HR"===e.nodeName)return r.remove(e),void t.preventDefault();o&&o.nodeName&&"hr"===o.nodeName.toLowerCase()&&(r.remove(o),t.preventDefault())}}})),v(),(()=>{const o=()=>{const o=r.getAttribs(s.getStart().cloneNode(!1));return()=>{const n=s.getStart();n!==e.getBody()&&(r.setAttrib(n,"style",null),t(o,(e=>{n.setAttributeNode(e.cloneNode(!0))})))}},n=()=>!s.isCollapsed()&&r.getParent(s.getStart(),r.isBlock)!==r.getParent(s.getEnd(),r.isBlock);e.on("keypress",(t=>{let r;return!(!(g(t)||8!==t.keyCode&&46!==t.keyCode)&&n()&&(r=o(),e.getDoc().execCommand("delete",!1),r(),t.preventDefault(),1))})),r.bind(e.getDoc(),"cut",(t=>{if(!g(t)&&n()){const t=o();np.setEditorTimeout(e,(()=>{t()}))}}))})(),w(),x(),C(),_(),y())};return EC(e)?(c&&(f(),b(),O(),p(),d&&(S(),k(),T())),l&&(v(),w(),C(),_())):D(),{refreshContentEditable:A,isHidden:()=>{if(!l||e.removed)return!1;const t=e.selection.getSel();return!t||!t.rangeCount||0===t.rangeCount}}},lB=ya.DOM,cB=e=>e.inline?e.getElement().nodeName.toLowerCase():void 0,dB=e=>Ce(e,(e=>!1===w(e))),mB=e=>{const t=e.options.get,o=e.editorUpload.blobCache;return dB({allow_conditional_comments:t("allow_conditional_comments"),allow_html_data_urls:t("allow_html_data_urls"),allow_svg_data_urls:t("allow_svg_data_urls"),allow_html_in_named_anchor:t("allow_html_in_named_anchor"),allow_script_urls:t("allow_script_urls"),allow_unsafe_link_target:t("allow_unsafe_link_target"),convert_unsafe_embeds:t("convert_unsafe_embeds"),convert_fonts_to_spans:t("convert_fonts_to_spans"),fix_list_elements:t("fix_list_elements"),font_size_legacy_values:t("font_size_legacy_values"),forced_root_block:t("forced_root_block"),forced_root_block_attrs:t("forced_root_block_attrs"),preserve_cdata:t("preserve_cdata"),inline_styles:t("inline_styles"),root_name:cB(e),sandbox_iframes:t("sandbox_iframes"),sandbox_iframes_exclusions:Zd(e),sanitize:t("xss_sanitization"),validate:!0,blob_cache:o,document:e.getDoc()})},uB=e=>{const t=e.options.get;return dB({custom_elements:t("custom_elements"),extended_valid_elements:t("extended_valid_elements"),invalid_elements:t("invalid_elements"),invalid_styles:t("invalid_styles"),schema:t("schema"),valid_children:t("valid_children"),valid_classes:t("valid_classes"),valid_elements:t("valid_elements"),valid_styles:t("valid_styles"),verify_html:t("verify_html"),padd_empty_block_inline_children:t("format_empty_lines")})},gB=e=>{e.bindPendingEventDelegates(),e.initialized=!0,(e=>{e.dispatch("Init")})(e),e.focus(!0),(e=>{const t=e.dom.getRoot();e.inline||Hu(e)&&e.selection.getStart(!0)!==t||su(t).each((t=>{const o=t.getNode(),n=sr(o)?su(o).getOr(t):t;e.selection.setRng(n.toRange())}))})(e),e.nodeChanged({initial:!0});const t=md(e);S(t)&&t.call(e,e),(e=>{const t=gd(e);t&&np.setEditorTimeout(e,(()=>{let o;o=!0===t?e:e.editorManager.get(t),o&&!o.destroyed&&(o.focus(),o.selection.scrollIntoView())}),100)})(e)},hB=e=>e.inline?e.ui.styleSheetLoader:e.dom.styleSheetLoader,pB=e=>{const t=hB(e),o=Ac(e),n=e.contentCSS,r=()=>{t.unloadAll(n),e.inline||e.ui.styleSheetLoader.unloadAll(o)},s=()=>{e.removed?r():e.on("remove",r)};if(e.contentStyles.length>0){let t="";Lt.each(e.contentStyles,(e=>{t+=e+"\r\n"})),e.dom.addStyle(t)}const a=Promise.all(((e,t,o)=>{const{pass:n,fail:r}=K(t,(e=>tinymce.Resource.has(OS(e)))),s=n.map((t=>{const o=tinymce.Resource.get(OS(t));return h(o)?Promise.resolve(hB(e).loadRawCss(t,o)):Promise.resolve()})),a=[...s,hB(e).loadAll(r)];return e.inline?a:a.concat([e.ui.styleSheetLoader.loadAll(o)])})(e,n,o)).then(s).catch(s),i=Oc(e);return i&&((e,t)=>{const o=wo.fromDom(e.getBody()),n=Uo(Zo(o)),r=wo.fromTag("style");to(r,"type","text/css"),vn(r,wo.fromText(t)),vn(n,r),e.on("remove",(()=>{xn(r)}))})(e,i),a},fB=e=>{!0!==e.removed&&((e=>{EC(e)||e.load({initial:!0,format:"html"}),e.startContent=e.getContent({format:"raw"})})(e),gB(e))},vB=e=>{const t=e.getElement();let o=e.getDoc();e.inline&&(lB.addClass(t,"mce-content-body"),e.contentDocument=o=document,e.contentWindow=window,e.bodyElement=t,e.contentAreaContainer=t);const n=e.getBody();n.disabled=!0,e.readonly=ed(e),e._editableRoot=td(e),!e.readonly&&e.hasEditableRoot()&&(e.inline&&"static"===lB.getStyle(n,"position",!0)&&(n.style.position="relative"),n.contentEditable="true"),n.disabled=!1,e.editorUpload=FS(e),e.schema=Us(uB(e)),e.dom=ya(o,{keep_values:!0,url_converter:e.convertURL,url_converter_scope:e,update_styles:!0,root_element:e.inline?e.getBody():null,collect:e.inline,schema:e.schema,contentCssCors:xc(e),referrerPolicy:Cc(e),onSetAttrib:t=>{e.dispatch("SetAttrib",t)}}),e.parser=(e=>{const t=zx(mB(e),e.schema);return t.addAttributeFilter("src,href,style,tabindex",((t,o)=>{const n=e.dom,r="data-mce-"+o;let s=t.length;for(;s--;){const a=t[s];let i=a.attr(o);if(i&&!a.attr(r)){if(0===i.indexOf("data:")||0===i.indexOf("blob:"))continue;"style"===o?(i=n.serializeStyle(n.parseStyle(i),a.name),i.length||(i=null),a.attr(r,i),a.attr(o,i)):"tabindex"===o?(a.attr(r,i),a.attr(o,null)):a.attr(r,e.convertURL(i,o,a.name))}}})),t.addNodeFilter("script",(e=>{let t=e.length;for(;t--;){const o=e[t],n=o.attr("type")||"no/type";0!==n.indexOf("mce-")&&o.attr("type","mce-"+n)}})),Rd(e)&&t.addNodeFilter("#cdata",(t=>{var o;let n=t.length;for(;n--;){const r=t[n];r.type=8,r.name="#comment",r.value="[CDATA["+e.dom.encode(null!==(o=r.value)&&void 0!==o?o:"")+"]]"}})),t.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(t=>{let o=t.length;const n=e.schema.getNonEmptyElements();for(;o--;){const e=t[o];e.isEmpty(n)&&0===e.getAll("br").length&&e.append(new Dp("br",1))}})),t})(e),e.serializer=jC((e=>{const t=e.options.get;return{...mB(e),...uB(e),...dB({remove_trailing_brs:t("remove_trailing_brs"),pad_empty_with_br:t("pad_empty_with_br"),url_converter:t("url_converter"),url_converter_scope:t("url_converter_scope"),element_format:t("element_format"),entities:t("entities"),entity_encoding:t("entity_encoding"),indent:t("indent"),indent_after:t("indent_after"),indent_before:t("indent_before")})}})(e),e),e.selection=PC(e.dom,e.getWin(),e.serializer,e),e.annotator=Mg(e),e.formatter=XS(e),e.undoManager=QS(e),e._nodeChangeDispatcher=new CM(e),e._selectionOverrides=_R(e),$E(e),PN(e),oT(e),EC(e)||((e=>{e.on("mousedown",(t=>{t.detail>=3&&(t.preventDefault(),$N(e))}))})(e),(e=>{aB(e)})(e));const r=xM(e);jE(e,r),(e=>{e.on("NodeChange",(()=>XE(e)))})(e),rk(e),IN(e);const s=TC(e);(e=>{const t=e.getDoc(),o=e.getBody();(e=>{e.dispatch("PreInit")})(e),hd(e)||(t.body.spellcheck=!1,lB.setAttrib(o,"spellcheck","false")),e.quirks=iB(e),(e=>{e.dispatch("PostRender")})(e);const n=Dc(e);void 0!==n&&(o.dir=n);const r=pd(e);r&&e.on("BeforeSetContent",(e=>{Lt.each(r,(t=>{e.content=e.content.replace(t,(e=>"\x3c!--mce:protected "+escape(e)+"--\x3e"))}))})),e.on("SetContent",(()=>{e.addVisual(e.getBody())})),e.on("compositionstart compositionend",(t=>{e.composing="compositionstart"===t.type}))})(e),(e=>{const t=jd(e);h(Wd(e))||!w(t)&&"INVALID"!==(e=>(e=>"gpl"===e.toLowerCase())(e)||(e=>e.length>=64&&e.length<=255)(e)?"VALID":"INVALID")(t)||console.warn("TinyMCE is running in evaluation mode. Provide a valid license key or add license_key: 'gpl' to the init config to agree to the open source license terms. Read more at https://www.tiny.cloud/license-key/")})(e),s.fold((()=>{const t=(e=>{let t=!1;const o=setTimeout((()=>{t||e.setProgressState(!0)}),500);return()=>{clearTimeout(o),t=!0,e.setProgressState(!1)}})(e);pB(e).then((()=>{fB(e),t()}))}),(t=>{e.setProgressState(!0),pB(e).then((()=>{t().then((t=>{e.setProgressState(!1),fB(e),DC(e)}),(t=>{e.notificationManager.open({type:"error",text:String(t)}),fB(e),DC(e)}))}))}))},bB=P,yB=ya.DOM,wB=(e,t)=>{const o=Mt.browser.isFirefox()?cd(e):"Rich Text Area",n=e.translate(o),r=ro(wo.fromDom(e.getElement()),"tabindex").bind(Qe),s=((e,t,o,n)=>{const r=wo.fromTag("iframe");return n.each((e=>to(r,"tabindex",e))),oo(r,o),oo(r,{id:e+"_ifr",frameBorder:"0",allowTransparency:"true",title:t}),ho(r,"tox-edit-area__iframe"),r})(e.id,n,Jl(e),r).dom;s.onload=()=>{s.onload=null,e.dispatch("load")},e.contentAreaContainer=t.iframeContainer,e.iframeElement=s,e.iframeHTML=(e=>{let t=Ql(e)+"";ec(e)!==e.documentBaseUrl&&(t+=''),t+='';const o=tc(e),n=oc(e),r=e.translate(cd(e));return nc(e)&&(t+=''),t+=`
    `,t})(e),yB.add(t.iframeContainer,s)},xB=e=>{const t=e.iframeElement,o=()=>{e.contentDocument=t.contentDocument,vB(e)};if(Hd(e)||Mt.browser.isFirefox()){const t=e.getDoc();t.open(),t.write(e.iframeHTML),t.close(),o()}else{const r=(n=wo.fromDom(t),Tn(n,"load",bB,(()=>{r.unbind(),o()})));t.srcdoc=e.iframeHTML}var n},CB=ya.DOM,SB=(e,t,o)=>{const n=wS.get(o),r=wS.urls[o]||e.documentBaseUrl.replace(/\/$/,"");if(o=Lt.trim(o),n&&-1===Lt.inArray(t,o)){if(e.plugins[o])return;try{const s=n(e,r)||{};e.plugins[o]=s,S(s.init)&&(s.init(e,r),t.push(o))}catch(t){((e,t,o)=>{const n=_a.translate(["Failed to initialize plugin: {0}",t]);Bg(e,"PluginLoadError",{message:n}),TS(n,o),kS(e,n)})(e,o,t)}}},kB=(e,t)=>({editorContainer:e,iframeContainer:t,api:{}}),_B=e=>{const t=e.getElement();return e.inline?kB(null):(e=>{const t=CB.create("div");return CB.insertAfter(t,e),kB(t,t)})(t)},EB=e=>{const t=e.getElement();return e.orgDisplay=t.style.display,h(Ic(e))?(e=>{const t=e.theme.renderUI;return t?t():_B(e)})(e):S(Ic(e))?(e=>{const t=e.getElement(),o=Ic(e)(e,t);return o.editorContainer.nodeType&&(o.editorContainer.id=o.editorContainer.id||e.id+"_parent"),o.iframeContainer&&o.iframeContainer.nodeType&&(o.iframeContainer.id=o.iframeContainer.id||e.id+"_iframecontainer"),o.height=o.iframeHeight?o.iframeHeight:t.offsetHeight,o})(e):_B(e)},TB=async e=>{e.dispatch("ScriptsLoaded"),(e=>{const t=Lt.trim(pc(e)),o=e.ui.registry.getAll().icons,n={...cS.get("default").icons,...cS.get(t).icons};ve(n,((t,n)=>{Ee(o,n)||e.ui.registry.addIcon(n,t)}))})(e),(e=>{const t=Ic(e);if(h(t)){const o=xS.get(t);e.theme=o(e,xS.urls[t])||{},S(e.theme.init)&&e.theme.init(e,xS.urls[t]||e.documentBaseUrl.replace(/\/$/,""))}else e.theme={}})(e),(e=>{const t=Fc(e),o=dS.get(t);e.model=o(e,dS.urls[t])})(e),(e=>{const t=[];q(nd(e),(o=>{SB(e,t,(e=>e.replace(/^\-/,""))(o))}))})(e);const t=await EB(e);((e,t)=>{const o={show:F.from(t.show).getOr(E),hide:F.from(t.hide).getOr(E),isEnabled:F.from(t.isEnabled).getOr(P),setEnabled:o=>{e.mode.isReadOnly()||F.from(t.setEnabled).each((e=>e(o)))}};e.ui={...e.ui,...o}})(e,F.from(t.api).getOr({})),e.editorContainer=t.editorContainer,DS(e),e.inline?vB(e):((e,t)=>{wB(e,t),t.editorContainer&&(t.editorContainer.style.display=e.orgDisplay,e.hidden=yB.isHidden(t.editorContainer)),e.getElement().style.display="none",yB.setAttrib(e.id,"aria-hidden","true"),e.getElement().style.visibility=e.orgVisibility,xB(e)})(e,{editorContainer:t.editorContainer,iframeContainer:t.iframeContainer})},OB=ya.DOM,AB=e=>"-"===e.charAt(0),DB=(e,t)=>{const o=Sc(t),n=kc(t);if(!_a.hasCode(o)&&"en"!==o){const r=Xe(n)?n:`${t.editorManager.baseURL}/langs/${o}.js`;e.add(r).catch((()=>{((e,t,o)=>{_S(e,"LanguageLoadError",ES("language",t,o))})(t,r,o)}))}},MB=(e,t)=>{const o=Ic(e);if(h(o)&&!AB(o)&&!Ee(xS.urls,o)){const n=Pc(e),r=n?e.documentBaseURI.toAbsolute(n):`themes/${o}/theme${t}.js`;xS.load(o,r).catch((()=>{((e,t,o)=>{_S(e,"ThemeLoadError",ES("theme",t,o))})(e,r,o)}))}},NB=(e,t)=>{const o=Fc(e);if("plugin"!==o&&!Ee(dS.urls,o)){const n=zc(e),r=h(n)?e.documentBaseURI.toAbsolute(n):`models/${o}/model${t}.js`;dS.load(o,r).catch((()=>{((e,t,o)=>{_S(e,"ModelLoadError",ES("model",t,o))})(e,r,o)}))}},RB=(e,t,o)=>F.from(t).filter((e=>Xe(e)&&!cS.has(e))).map((t=>({url:`${e.editorManager.baseURL}/icons/${t}/icons${o}.js`,name:F.some(t)}))),BB=(e,t,o)=>{const n=RB(t,"default",o),r=(e=>F.from(fc(e)).filter(Xe).map((e=>({url:e,name:F.none()}))))(t).orThunk((()=>RB(t,pc(t),"")));q((e=>{const t=[],o=e=>{t.push(e)};for(let t=0;t{e.add(o.url).catch((()=>{((e,t,o)=>{_S(e,"IconsLoadError",ES("icons",t,o))})(t,o.url,o.name.getOrUndefined())}))}))},LB=(e,t)=>{const o=(t,o)=>{wS.load(t,o).catch((()=>{((e,t,o)=>{_S(e,"PluginLoadError",ES("plugin",t,o))})(e,o,t)}))};ve(rd(e),((t,n)=>{o(n,t),e.options.set("plugins",nd(e).concat(n))})),q(nd(e),(e=>{!(e=Lt.trim(e))||wS.urls[e]||AB(e)||o(e,`plugins/${e}/plugin${t}.js`)}))},HB=(e,t)=>{const o=xa.ScriptLoader,n=()=>{!e.removed&&(e=>{const t=Ic(e);return!h(t)||C(xS.get(t))})(e)&&(e=>{const t=Fc(e);return C(dS.get(t))})(e)&&TB(e)};MB(e,t),NB(e,t),DB(o,e),BB(o,e,t),LB(e,t),o.loadQueue().then(n,n)},IB=e=>{const t=e.id;_a.setCode(Sc(e));const o=()=>{OB.unbind(window,"ready",o),e.render()};if(!ca.Event.domLoaded)return void OB.bind(window,"ready",o);if(!e.getElement())return;const n=wo.fromDom(e.getElement()),r=io(n);e.on("remove",(()=>{G(n.dom.attributes,(e=>ao(n,e.name))),oo(n,r)})),e.ui.styleSheetLoader=((e,t)=>as.forElement(e,{contentCssCors:od(t),referrerPolicy:Cc(t)}))(n,e),qc(e)?e.inline=!0:(e.orgVisibility=e.getElement().style.visibility,e.getElement().style.visibility="hidden");const s=e.getElement().form||OB.getParent(t,"form");s&&(e.formElement=s,Gc(e)&&!ir(e.getElement())&&(OB.insertAfter(OB.create("input",{type:"hidden",name:t}),t),e.hasHiddenInput=!0),e.formEventDelegate=t=>{e.dispatch(t.type,t)},OB.bind(s,"submit reset",e.formEventDelegate),e.on("reset",(()=>{e.resetContent()})),!Kc(e)||s.submit.nodeType||s.submit.length||s._mceOldSubmit||(s._mceOldSubmit=s.submit,s.submit=()=>(e.editorManager.triggerSave(),e.setDirty(!1),s._mceOldSubmit(s)))),e.windowManager=CS(e),e.notificationManager=yS(e),(e=>"xml"===e.options.get("encoding"))(e)&&e.on("GetContent",(e=>{e.save&&(e.content=OB.encode(e.content))})),Yc(e)&&e.on("submit",(()=>{e.initialized&&e.save()})),Xc(e)&&(e._beforeUnload=()=>{!e.initialized||e.destroyed||e.isHidden()||e.save({format:"raw",no_events:!0,set_dirty:!1})},e.editorManager.on("BeforeUnload",e._beforeUnload)),e.editorManager.add(e),HB(e,e.suffix)},PB=kt().deviceType,FB=PB.isPhone(),zB=PB.isTablet(),VB=e=>{if(x(e))return[];{const t=v(e)?e:e.split(/[ ,]/),o=$(t,Ge);return Y(o,Xe)}},ZB=(e,t)=>{const o=((e,t)=>{const o={},n={};return xe(e,t,we(o),we(n)),{t:o,f:n}})(t,((t,o)=>j(e,o)));return n=o.t,r=o.f,{sections:A(n),options:A(r)};var n,r},UB=(e,t)=>Ee(e.sections(),t),jB=(e,t)=>({table_grid:!1,object_resizing:!1,resize:!1,toolbar_mode:_e(e,"toolbar_mode").getOr("scrolling"),toolbar_sticky:!1,...t?{menubar:!1}:{}}),WB=(e,t)=>{var o;const n=null!==(o=t.external_plugins)&&void 0!==o?o:{};return e&&e.external_plugins?Lt.extend({},e.external_plugins,n):n},$B=(e,t,o,n)=>{const r=VB(o.forced_plugins),s=VB(n.plugins),a=((e,t)=>UB(e,t)?e.sections()[t]:{})(t,"mobile"),i=((e,t,o,n)=>e&&UB(t,"mobile")?n:o)(e,t,s,a.plugins?VB(a.plugins):s),l=((e,t)=>[...VB(e),...VB(t)])(r,i);return Lt.extend(n,{forced_plugins:r,plugins:l})},qB=(e,t,o,n,r)=>{var s;const a=e?{mobile:jB(null!==(s=r.mobile)&&void 0!==s?s:{},t)}:{},i=ZB(["mobile"],IO(a,r)),l=Lt.extend(o,n,i.options(),((e,t)=>e&&UB(t,"mobile"))(e,i)?((e,t,o={})=>{const n=e.sections(),r=_e(n,t).getOr({});return Lt.extend({},o,r)})(i,"mobile"):{},{external_plugins:WB(n,i.options())});return $B(e,i,n,l)},GB=(e,t)=>((e,t)=>AC(e).editor.addVisual(t))(e,t),KB=e=>{const t=t=>()=>{q("left,center,right,justify".split(","),(o=>{t!==o&&e.formatter.remove("align"+o)})),"none"!==t&&((t,o)=>{e.formatter.toggle(t,o),e.nodeChanged()})("align"+t)};e.editorCommands.addCommands({JustifyLeft:t("left"),JustifyCenter:t("center"),JustifyRight:t("right"),JustifyFull:t("justify"),JustifyNone:t("none")})},YB=e=>{KB(e),(e=>{const t=t=>()=>{const o=e.selection,n=o.isCollapsed()?[e.dom.getParent(o.getNode(),e.dom.isBlock)]:o.getSelectedBlocks();return W(n,(o=>C(e.formatter.matchNode(o,t))))};e.editorCommands.addCommands({JustifyLeft:t("alignleft"),JustifyCenter:t("aligncenter"),JustifyRight:t("alignright"),JustifyFull:t("alignjustify")},"state")})(e)},XB=(e,t)=>{const o=e.selection,n=e.dom;return/^ | $/.test(t)?((e,t,o,n)=>{const r=wo.fromDom(e.getRoot());return o=jf(r,ml.fromRangeStart(t),n)?o.replace(/^ /," "):o.replace(/^ /," "),Wf(r,ml.fromRangeEnd(t),n)?o.replace(/( | )()?$/," "):o.replace(/ ()?$/," ")})(n,o.getRng(),t,e.schema):t},JB=(e,t)=>{if(e.selection.isEditable()){const{content:o,details:n}=(e=>{if("string"!=typeof e){const t=Lt.extend({paste:e.paste,data:{paste:e.paste}},e);return{content:e.content,details:t}}return{content:e,details:{}}})(t);Wx(e,{...n,content:XB(e,o),format:"html",set:!1,selection:!0}).each((t=>{const o=((e,t,o)=>OC(e).editor.insertContent(t,o))(e,t.content,n);$x(e,o,t),e.addVisual()}))}},QB={"font-size":"size","font-family":"face"},eL=Qt("font"),tL=(e,t,o)=>Vb(wo.fromDom(o),(t=>(t=>mn(t,e).orThunk((()=>eL(t)?_e(QB,e).bind((e=>ro(t,e))):F.none())))(t)),(e=>ko(wo.fromDom(t),e))),oL=e=>(t,o)=>F.from(o).map(wo.fromDom).filter(Kt).bind((o=>tL(e,t,o.dom).or(((e,t)=>F.from(ya.DOM.getStyle(t,e,!0)))(e,o.dom)))).getOr(""),nL=oL("font-size"),rL=T((e=>e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")),oL("font-family")),sL=e=>su(e.getBody()).bind((e=>{const t=e.container();return F.from(lr(t)?t.parentNode:t)})),aL=(e,t)=>(e=>F.from(e.selection.getRng()).bind((t=>{const o=e.getBody();return t.startContainer===o&&0===t.startOffset?F.none():F.from(e.selection.getStart(!0))})))(e).orThunk(N(sL,e)).map(wo.fromDom).filter(Kt).bind(t),iL=(e,t)=>aL(e,O(F.some,t)),lL=(e,t)=>{if(/^[0-9.]+$/.test(t)){const o=parseInt(t,10);if(o>=1&&o<=7){const n=(e=>Lt.explode(e.options.get("font_size_style_values")))(e),r=(e=>Lt.explode(e.options.get("font_size_classes")))(e);return r.length>0?r[o-1]||t:n[o-1]||t}return t}return t},cL=e=>{const t=e.split(/\s*,\s*/);return $(t,(e=>-1===e.indexOf(" ")||We(e,'"')||We(e,"'")?e:`'${e}'`)).join(",")},dL=e=>{const t=(t,o)=>{e.formatter.toggle(t,o),e.nodeChanged()};e.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":e=>{t(e)},"ForeColor,HiliteColor":(e,o,n)=>{t(e,{value:n})},BackColor:(e,o,n)=>{t("hilitecolor",{value:n})},FontName:(t,o,n)=>{((e,t)=>{const o=lL(e,t);e.formatter.toggle("fontname",{value:cL(o)}),e.nodeChanged()})(e,n)},FontSize:(t,o,n)=>{((e,t)=>{e.formatter.toggle("fontsize",{value:lL(e,t)}),e.nodeChanged()})(e,n)},LineHeight:(t,o,n)=>{((e,t)=>{e.formatter.toggle("lineheight",{value:String(t)}),e.nodeChanged()})(e,n)},Lang:(e,o,n)=>{var r;t(e,{value:n.code,customValue:null!==(r=n.customCode)&&void 0!==r?r:null})},RemoveFormat:t=>{e.formatter.remove(t)},mceBlockQuote:()=>{t("blockquote")},FormatBlock:(e,o,n)=>{t(h(n)?n:"p")},mceToggleFormat:(e,o,n)=>{t(n)}})},mL=e=>{const t=t=>e.formatter.match(t);e.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":e=>t(e),mceBlockQuote:()=>t("blockquote")},"state"),e.editorCommands.addQueryValueHandler("FontName",(()=>(e=>iL(e,(t=>rL(e.getBody(),t.dom))).getOr(""))(e))),e.editorCommands.addQueryValueHandler("FontSize",(()=>(e=>iL(e,(t=>nL(e.getBody(),t.dom))).getOr(""))(e))),e.editorCommands.addQueryValueHandler("LineHeight",(()=>(e=>iL(e,(t=>{const o=wo.fromDom(e.getBody()),n=Vb(t,(e=>mn(e,"line-height")),N(ko,o));return n.getOrThunk((()=>{const e=parseFloat(cn(t,"line-height")),o=parseFloat(cn(t,"font-size"));return String(e/o)}))})).getOr(""))(e)))},uL=e=>{e.editorCommands.addCommands({Indent:()=>{(e=>{zE(e,"indent")})(e)},Outdent:()=>{VE(e)}}),e.editorCommands.addCommands({Outdent:()=>IE(e)},"state")},gL=(e,t)=>{const o=e.dom,n=e.selection.getRng(),r=t?e.selection.getStart():e.selection.getEnd(),s=t?n.startContainer:n.endContainer,a=uD(o,s);if(!a||!a.isContentEditable)return;const i=t?hn:pn,l=sc(e);((e,t,o,n)=>{const r=e.dom,s=e=>r.isBlock(e)&&e.parentElement===o,a=s(t)?t:r.getParent(n,s,o);return F.from(a).map(wo.fromDom)})(e,r,a,s).each((t=>{const o=fD(e,s,t.dom,a,!1,l);i(t,wo.fromDom(o)),e.selection.setCursorLocation(o,0),e.dispatch("NewBlock",{newBlock:o}),rD(e,"insertParagraph")}))},hL=e=>{e.editorCommands.addCommands({InsertNewBlockBefore:()=>{(e=>{gL(e,!0)})(e)},InsertNewBlockAfter:()=>{(e=>{gL(e,!1)})(e)}})},pL=e=>{YB(e),(e=>{e.editorCommands.addCommands({"Cut,Copy,Paste":t=>{const o=e.getDoc();let n;try{o.execCommand(t)}catch(e){n=!0}if("paste"!==t||o.queryCommandEnabled(t)||(n=!0),n||!o.queryCommandSupported(t)){let t=e.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");(Mt.os.isMacOS()||Mt.os.isiOS())&&(t=t.replace(/Ctrl\+/g,"⌘+")),e.notificationManager.open({text:t,type:"error"})}}})})(e),(e=>{e.editorCommands.addCommands({mceAddUndoLevel:()=>{e.undoManager.add()},mceEndUndoLevel:()=>{e.undoManager.add()},Undo:()=>{e.undoManager.undo()},Redo:()=>{e.undoManager.redo()}})})(e),(e=>{e.editorCommands.addCommands({mceSelectNodeDepth:(t,o,n)=>{let r=0;e.dom.getParent(e.selection.getNode(),(t=>!Qn(t)||r++!==n||(e.selection.select(t),!1)),e.getBody())},mceSelectNode:(t,o,n)=>{e.selection.select(n)},selectAll:()=>{const t=e.dom.getParent(e.selection.getStart(),fr);if(t){const o=e.dom.createRng();o.selectNodeContents(t),e.selection.setRng(o)}}})})(e),(e=>{e.editorCommands.addCommands({mceCleanup:()=>{const t=e.selection.getBookmark();e.setContent(e.getContent()),e.selection.moveToBookmark(t)},insertImage:(t,o,n)=>{JB(e,e.dom.createHTML("img",{src:n}))},insertHorizontalRule:()=>{e.execCommand("mceInsertContent",!1,"
    ")},insertText:(t,o,n)=>{JB(e,e.dom.encode(n))},insertHTML:(t,o,n)=>{JB(e,n)},mceInsertContent:(t,o,n)=>{JB(e,n)},mceSetContent:(t,o,n)=>{e.setContent(n)},mceReplaceContent:(t,o,n)=>{e.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,e.selection.getContent({format:"text"})))},mceNewDocument:()=>{e.setContent(wd(e))}})})(e),(e=>{const t=(t,o,n)=>{const r=h(n)?{href:n}:n,s=e.dom.getParent(e.selection.getNode(),"a");p(r)&&h(r.href)&&(r.href=r.href.replace(/ /g,"%20"),s&&r.href||e.formatter.remove("link"),r.href&&e.formatter.apply("link",r,s))};e.editorCommands.addCommands({unlink:()=>{if(e.selection.isEditable()){if(e.selection.isCollapsed()){const t=e.dom.getParent(e.selection.getStart(),"a");return void(t&&e.dom.remove(t,!0))}e.formatter.remove("link")}},mceInsertLink:t,createLink:t})})(e),uL(e),hL(e),(e=>{e.editorCommands.addCommands({insertParagraph:()=>{QD(DD,e)},mceInsertNewLine:(t,o,n)=>{eM(e,n)},InsertLineBreak:(t,o,n)=>{QD(FD,e)}})})(e),(e=>{dL(e),mL(e)})(e),(e=>{e.editorCommands.addCommands({mceRemoveNode:(t,o,n)=>{const r=null!=n?n:e.selection.getNode();if(r!==e.getBody()){const t=e.selection.getBookmark();e.dom.remove(r,!0),e.selection.moveToBookmark(t)}},mcePrint:()=>{e.getWin().print()},mceFocus:(t,o,n)=>{yp(e,!0===n)},mceToggleVisualAid:()=>{e.hasVisual=!e.hasVisual,e.addVisual()}})})(e)},fL=["toggleview"],vL=e=>j(fL,e.toLowerCase());class bL{constructor(e){this.commands={state:{},exec:{},value:{}},this.editor=e}execCommand(e,t=!1,o,n){const r=this.editor,s=e.toLowerCase(),a=null==n?void 0:n.skip_focus;if(r.removed)return!1;if("mcefocus"!==s&&(/^(mceAddUndoLevel|mceEndUndoLevel)$/i.test(s)||a?(e=>{tp(e).each((t=>e.selection.setRng(t)))})(r):r.focus()),r.dispatch("BeforeExecCommand",{command:e,ui:t,value:o}).isDefaultPrevented())return!1;const i=this.commands.exec[s];return!!S(i)&&(i(s,t,o),r.dispatch("ExecCommand",{command:e,ui:t,value:o}),!0)}queryCommandState(e){if(!vL(e)&&this.editor.quirks.isHidden()||this.editor.removed)return!1;const t=e.toLowerCase(),o=this.commands.state[t];return!!S(o)&&o(t)}queryCommandValue(e){if(!vL(e)&&this.editor.quirks.isHidden()||this.editor.removed)return"";const t=e.toLowerCase(),o=this.commands.value[t];return S(o)?o(t):""}addCommands(e,t="exec"){const o=this.commands;ve(e,((e,n)=>{q(n.toLowerCase().split(","),(n=>{o[t][n]=e}))}))}addCommand(e,t,o){const n=e.toLowerCase();this.commands.exec[n]=(e,n,r)=>t.call(null!=o?o:this.editor,n,r)}queryCommandSupported(e){const t=e.toLowerCase();return!!this.commands.exec[t]}addQueryStateHandler(e,t,o){this.commands.state[e.toLowerCase()]=()=>t.call(null!=o?o:this.editor)}addQueryValueHandler(e,t,o){this.commands.value[e.toLowerCase()]=()=>t.call(null!=o?o:this.editor)}}const yL="data-mce-contenteditable",wL=(e,t,o)=>{try{e.getDoc().execCommand(t,!1,String(o))}catch(e){}},xL=(e,t)=>{e.dom.contentEditable=t?"true":"false"},CL=(e,t)=>{const o=wo.fromDom(e.getBody());((e,t,o)=>{bo(e,t)&&!o?fo(e,t):o&&ho(e,t)})(o,"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e._selectionOverrides.hideFakeCaret(),(e=>{F.from(e.selection.getNode()).each((e=>{e.removeAttribute("data-mce-selected")}))})(e),e.readonly=!0,xL(o,!1),q(Fn(o,'*[contenteditable="true"]'),(e=>{to(e,yL,"true"),xL(e,!1)}))):(e.readonly=!1,e.hasEditableRoot()&&xL(o,!0),(e=>{q(Fn(e,`*[${yL}="true"]`),(e=>{ao(e,yL),xL(e,!0)}))})(o),wL(e,"StyleWithCSS",!1),wL(e,"enableInlineTableEditing",!1),wL(e,"enableObjectResizing",!1),vp(e)&&e.focus(),(e=>{e.selection.setRng(e.selection.getRng())})(e),e.nodeChanged())},SL=e=>e.readonly,kL=e=>{e.parser.addAttributeFilter("contenteditable",(t=>{SL(e)&&q(t,(e=>{e.attr(yL,e.attr("contenteditable")),e.attr("contenteditable","false")}))})),e.serializer.addAttributeFilter(yL,(t=>{SL(e)&&q(t,(e=>{e.attr("contenteditable",e.attr(yL))}))})),e.serializer.addTempAttr(yL)},_L=["copy"],EL=(e,t)=>{if((e=>"click"===e.type)(t)&&!Vg.metaKeyPressed(t)){const o=wo.fromDom(t.target);((e,t)=>tn(t,"a",(t=>ko(t,wo.fromDom(e.getBody())))).bind((e=>ro(e,"href"))))(e,o).each((o=>{if(t.preventDefault(),/^#/.test(o)){const t=e.dom.select(`${o},[name="${Ue(o,"#")}"]`);t.length&&e.selection.scrollIntoView(t[0],!0)}else window.open(o,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes")}))}else(e=>j(_L,e.type))(t)&&e.dispatch(t.type,t)},TL=Lt.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," ");class OL{static isNative(e){return!!TL[e.toLowerCase()]}constructor(e){this.bindings={},this.settings=e||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||I}fire(e,t){return this.dispatch(e,t)}dispatch(e,t){const o=e.toLowerCase(),n=na(o,null!=t?t:{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(n);const r=this.bindings[o];if(r)for(let e=0,t=r.length;e{this.toggleEvent(t,!1),delete this.bindings[t]})),this;if(s){if(t){const e=K(s,(e=>e.func===t));s=e.fail,this.bindings[r]=s,q(e.pass,(e=>{e.removed=!0}))}else s.length=0;s.length||(this.toggleEvent(e,!1),delete this.bindings[r])}}}else ve(this.bindings,((e,t)=>{this.toggleEvent(t,!1)})),this.bindings={};return this}once(e,t,o){return this.on(e,t,o,{once:!0})}has(e){e=e.toLowerCase();const t=this.bindings[e];return!(!t||0===t.length)}}const AL=e=>(e._eventDispatcher||(e._eventDispatcher=new OL({scope:e,toggleEvent:(t,o)=>{OL.isNative(t)&&e.toggleNativeEvent&&e.toggleNativeEvent(t,o)}})),e._eventDispatcher),DL={fire(e,t,o){return this.dispatch(e,t,o)},dispatch(e,t,o){const n=this;if(n.removed&&"remove"!==e&&"detach"!==e)return na(e.toLowerCase(),null!=t?t:{},n);const r=AL(n).dispatch(e,t);if(!1!==o&&n.parent){let t=n.parent();for(;t&&!r.isPropagationStopped();)t.dispatch(e,r,!1),t=t.parent?t.parent():void 0}return r},on(e,t,o){return AL(this).on(e,t,o)},off(e,t){return AL(this).off(e,t)},once(e,t){return AL(this).once(e,t)},hasEventListeners(e){return AL(this).has(e)}},ML=ya.DOM;let NL;const RL=(e,t)=>{if("selectionchange"===t)return e.getDoc();if(!e.inline&&/^(?:mouse|touch|click|contextmenu|drop|dragover|dragend)/.test(t))return e.getDoc().documentElement;const o=Lc(e);return o?(e.eventRoot||(e.eventRoot=ML.select(o)[0]),e.eventRoot):e.getBody()},BL=(e,t,o)=>{(e=>!e.hidden&&!SL(e))(e)?e.dispatch(t,o):SL(e)&&EL(e,o)},LL=(e,t)=>{if(e.delegates||(e.delegates={}),e.delegates[t]||e.removed)return;const o=RL(e,t);if(Lc(e)){if(NL||(NL={},e.editorManager.on("removeEditor",(()=>{e.editorManager.activeEditor||NL&&(ve(NL,((t,o)=>{e.dom.unbind(RL(e,o))})),NL=null)}))),NL[t])return;const n=o=>{const n=o.target,r=e.editorManager.get();let s=r.length;for(;s--;){const e=r[s].getBody();(e===n||ML.isChildOf(n,e))&&BL(r[s],t,o)}};NL[t]=n,ML.bind(o,t,n)}else{const n=o=>{BL(e,t,o)};ML.bind(o,t,n),e.delegates[t]=n}},HL={...DL,bindPendingEventDelegates(){const e=this;Lt.each(e._pendingNativeEvents,(t=>{LL(e,t)}))},toggleNativeEvent(e,t){const o=this;"focus"!==e&&"blur"!==e&&(o.removed||(t?o.initialized?LL(o,e):o._pendingNativeEvents?o._pendingNativeEvents.push(e):o._pendingNativeEvents=[e]:o.initialized&&o.delegates&&(o.dom.unbind(RL(o,e),e,o.delegates[e]),delete o.delegates[e])))},unbindAllNativeEvents(){const e=this,t=e.getBody(),o=e.dom;e.delegates&&(ve(e.delegates,((t,o)=>{e.dom.unbind(RL(e,o),o,t)})),delete e.delegates),!e.inline&&t&&o&&(t.onload=null,o.unbind(e.getWin()),o.unbind(e.getDoc())),o&&(o.unbind(t),o.unbind(e.getContainer()))}},IL=e=>h(e)?{value:e.split(/[ ,]/),valid:!0}:_(e,h)?{value:e,valid:!0}:{valid:!1,message:"The value must be a string[] or a comma/space separated string."},PL=(e,t)=>e+(Je(t.message)?"":`. ${t.message}`),FL=e=>e.valid,zL=(e,t,o="")=>{const n=t(e);return y(n)?n?{value:e,valid:!0}:{valid:!1,message:o}:n},VL=(e,t,o=t)=>{const n={},r={},s=(e,t,o)=>{const n=zL(t,o);return FL(n)?(r[e]=n.value,!0):(console.warn(PL(`Invalid value passed for the ${e} option`,n)),!1)},a=e=>Ee(n,e);return{register:(e,o)=>{const a=(e=>h(e.processor))(o)?(e=>{const t=(()=>{switch(e){case"array":return v;case"boolean":return y;case"function":return S;case"number":return k;case"object":return p;case"string":return h;case"string[]":return IL;case"object[]":return e=>_(e,p);case"regexp":return e=>g(e,RegExp);default:return P}})();return o=>zL(o,t,`The value must be a ${e}.`)})(o.processor):o.processor,i=((e,t,o)=>{if(!w(t)){const n=zL(t,o);if(FL(n))return n.value;console.error(PL(`Invalid default value passed for the "${e}" option`,n))}})(e,o.default,a);n[e]={...o,default:i,processor:a},_e(r,e).orThunk((()=>_e(t,e))).each((t=>s(e,t,a)))},isRegistered:a,get:e=>_e(r,e).orThunk((()=>_e(n,e).map((e=>e.default)))).getOrUndefined(),set:(e,t)=>{if(a(e)){const o=n[e];return o.immutable?(console.error(`"${e}" is an immutable option and cannot be updated`),!1):s(e,t,o.processor)}return console.warn(`"${e}" is not a registered option. Ensure the option has been registered before setting a value.`),!1},unset:e=>{const t=a(e);return t&&delete r[e],t},isSet:e=>Ee(r,e),debug:()=>{try{console.log(JSON.parse(JSON.stringify(o,((e,t)=>y(t)||k(t)||h(t)||b(t)||v(t)||f(t)?t:Object.prototype.toString.call(t)))))}catch(e){console.error(e)}}}},ZL=["design","readonly"],UL=(e,t,o,n)=>{const r=o[t.get()],s=o[n];try{s.activate()}catch(e){return void console.error(`problem while activating editor mode ${n}:`,e)}r.deactivate(),r.editorReadOnly!==s.editorReadOnly&&CL(e,s.editorReadOnly),t.set(n),((e,t)=>{e.dispatch("SwitchMode",{mode:t})})(e,n)},jL=e=>{const t=Rr("design"),o=Rr({design:{activate:E,deactivate:E,editorReadOnly:!1},readonly:{activate:E,deactivate:E,editorReadOnly:!0}});return(e=>{e.serializer?kL(e):e.on("PreInit",(()=>{kL(e)}))})(e),(e=>{e.on("ShowCaret",(t=>{SL(e)&&t.preventDefault()})),e.on("ObjectSelected",(t=>{SL(e)&&t.preventDefault()}))})(e),{isReadOnly:()=>SL(e),set:n=>((e,t,o,n)=>{if(n!==o.get()){if(!Ee(t,n))throw new Error(`Editor mode '${n}' is invalid`);e.initialized?UL(e,o,t,n):e.on("init",(()=>UL(e,o,t,n)))}})(e,o.get(),t,n),get:()=>t.get(),register:(e,t)=>{o.set(((e,t,o)=>{if(j(ZL,t))throw new Error(`Cannot override default mode ${t}`);return{...e,[t]:{...o,deactivate:()=>{try{o.deactivate()}catch(e){console.error(`problem while deactivating editor mode ${t}:`,e)}}}}})(o.get(),e,t))}}},WL=Lt.each,$L=Lt.explode,qL={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},GL=Lt.makeMap("alt,ctrl,shift,meta,access"),KL=e=>{const t={},o=Mt.os.isMacOS()||Mt.os.isiOS();WL($L(e.toLowerCase(),"+"),(e=>{(e=>e in GL)(e)?t[e]=!0:/^[0-9]{2,}$/.test(e)?t.keyCode=parseInt(e,10):(t.charCode=e.charCodeAt(0),t.keyCode=qL[e]||e.toUpperCase().charCodeAt(0))}));const n=[t.keyCode];let r;for(r in GL)t[r]?n.push(r):t[r]=!1;return t.id=n.join(","),t.access&&(t.alt=!0,o?t.ctrl=!0:t.shift=!0),t.meta&&(o?t.meta=!0:(t.ctrl=!0,t.meta=!1)),t};class YL{constructor(e){this.shortcuts={},this.pendingPatterns=[],this.editor=e;const t=this;e.on("keyup keypress keydown",(e=>{!t.hasModifier(e)&&!t.isFunctionKey(e)||e.isDefaultPrevented()||(WL(t.shortcuts,(o=>{t.matchShortcut(e,o)&&(t.pendingPatterns=o.subpatterns.slice(0),"keydown"===e.type&&t.executeShortcutAction(o))})),t.matchShortcut(e,t.pendingPatterns[0])&&(1===t.pendingPatterns.length&&"keydown"===e.type&&t.executeShortcutAction(t.pendingPatterns[0]),t.pendingPatterns.shift()))}))}add(e,t,o,n){const r=this,s=r.normalizeCommandFunc(o);return WL($L(Lt.trim(e)),(e=>{const o=r.createShortcut(e,t,s,n);r.shortcuts[o.id]=o})),!0}remove(e){const t=this.createShortcut(e);return!!this.shortcuts[t.id]&&(delete this.shortcuts[t.id],!0)}normalizeCommandFunc(e){const t=this,o=e;return"string"==typeof o?()=>{t.editor.execCommand(o,!1,null)}:Lt.isArray(o)?()=>{t.editor.execCommand(o[0],o[1],o[2])}:o}createShortcut(e,t,o,n){const r=Lt.map($L(e,">"),KL);return r[r.length-1]=Lt.extend(r[r.length-1],{func:o,scope:n||this.editor}),Lt.extend(r[0],{desc:this.editor.translate(t),subpatterns:r.slice(1)})}hasModifier(e){return e.altKey||e.ctrlKey||e.metaKey}isFunctionKey(e){return"keydown"===e.type&&e.keyCode>=112&&e.keyCode<=123}matchShortcut(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)}executeShortcutAction(e){return e.func?e.func.call(e.scope):null}}const XL=()=>{const e=(()=>{const e={},t={},o={},n={},r={},s={},a={},i={},l=(e,t)=>(o,n)=>{e[o.toLowerCase()]={...n,type:t}};return{addButton:l(e,"button"),addGroupToolbarButton:l(e,"grouptoolbarbutton"),addToggleButton:l(e,"togglebutton"),addMenuButton:l(e,"menubutton"),addSplitButton:l(e,"splitbutton"),addMenuItem:l(t,"menuitem"),addNestedMenuItem:l(t,"nestedmenuitem"),addToggleMenuItem:l(t,"togglemenuitem"),addAutocompleter:l(o,"autocompleter"),addContextMenu:l(r,"contextmenu"),addContextToolbar:l(s,"contexttoolbar"),addContextForm:l(s,"contextform"),addSidebar:l(a,"sidebar"),addView:l(i,"views"),addIcon:(e,t)=>n[e.toLowerCase()]=t,getAll:()=>({buttons:e,menuItems:t,icons:n,popups:o,contextMenus:r,contextToolbars:s,sidebars:a,views:i})}})();return{addAutocompleter:e.addAutocompleter,addButton:e.addButton,addContextForm:e.addContextForm,addContextMenu:e.addContextMenu,addContextToolbar:e.addContextToolbar,addIcon:e.addIcon,addMenuButton:e.addMenuButton,addMenuItem:e.addMenuItem,addNestedMenuItem:e.addNestedMenuItem,addSidebar:e.addSidebar,addSplitButton:e.addSplitButton,addToggleButton:e.addToggleButton,addGroupToolbarButton:e.addGroupToolbarButton,addToggleMenuItem:e.addToggleMenuItem,addView:e.addView,getAll:e.getAll}},JL=ya.DOM,QL=Lt.extend,eH=Lt.each;class tH{constructor(e,t,o){this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.composing=!1,this.destroyed=!1,this.hasHiddenInput=!1,this.iframeElement=null,this.initialized=!1,this.readonly=!1,this.removed=!1,this.startContent="",this._pendingNativeEvents=[],this._skinLoaded=!1,this._editableRoot=!0,this.editorManager=o,this.documentBaseUrl=o.documentBaseURL,QL(this,HL);const n=this;this.id=e,this.hidden=!1;const r=((e,t)=>{const o=PO(t);return qB(FB||zB,FB,o,e,o)})(o.defaultOptions,t);this.options=VL(0,r,t),(e=>{const t=e.options.register;t("id",{processor:"string",default:e.id}),t("selector",{processor:"string"}),t("target",{processor:"object"}),t("suffix",{processor:"string"}),t("cache_suffix",{processor:"string"}),t("base_url",{processor:"string"}),t("referrer_policy",{processor:"string",default:""}),t("language_load",{processor:"boolean",default:!0}),t("inline",{processor:"boolean",default:!1}),t("iframe_attrs",{processor:"object",default:{}}),t("doctype",{processor:"string",default:""}),t("document_base_url",{processor:"string",default:e.documentBaseUrl}),t("body_id",{processor:Xl(e,"tinymce"),default:"tinymce"}),t("body_class",{processor:Xl(e),default:""}),t("content_security_policy",{processor:"string",default:""}),t("br_in_pre",{processor:"boolean",default:!0}),t("forced_root_block",{processor:e=>{const t=h(e)&&Xe(e);return t?{value:e,valid:t}:{valid:!1,message:"Must be a non-empty string."}},default:"p"}),t("forced_root_block_attrs",{processor:"object",default:{}}),t("newline_behavior",{processor:e=>{const t=j(["block","linebreak","invert","default"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be one of: block, linebreak, invert or default."}},default:"default"}),t("br_newline_selector",{processor:"string",default:".mce-toc h2,figcaption,caption"}),t("no_newline_selector",{processor:"string",default:""}),t("keep_styles",{processor:"boolean",default:!0}),t("end_container_on_empty_block",{processor:e=>y(e)||h(e)?{valid:!0,value:e}:{valid:!1,message:"Must be boolean or a string"},default:"blockquote"}),t("font_size_style_values",{processor:"string",default:"xx-small,x-small,small,medium,large,x-large,xx-large"}),t("font_size_legacy_values",{processor:"string",default:"xx-small,small,medium,large,x-large,xx-large,300%"}),t("font_size_classes",{processor:"string",default:""}),t("automatic_uploads",{processor:"boolean",default:!0}),t("images_reuse_filename",{processor:"boolean",default:!1}),t("images_replace_blob_uris",{processor:"boolean",default:!0}),t("icons",{processor:"string",default:""}),t("icons_url",{processor:"string",default:""}),t("images_upload_url",{processor:"string",default:""}),t("images_upload_base_path",{processor:"string",default:""}),t("images_upload_credentials",{processor:"boolean",default:!1}),t("images_upload_handler",{processor:"function"}),t("language",{processor:"string",default:"en"}),t("language_url",{processor:"string",default:""}),t("entity_encoding",{processor:"string",default:"named"}),t("indent",{processor:"boolean",default:!0}),t("indent_before",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),t("indent_after",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),t("indent_use_margin",{processor:"boolean",default:!1}),t("indentation",{processor:"string",default:"40px"}),t("content_css",{processor:e=>{const t=!1===e||h(e)||_(e,h);return t?h(e)?{value:$(e.split(","),Ge),valid:t}:v(e)?{value:e,valid:t}:!1===e?{value:[],valid:t}:{value:e,valid:t}:{valid:!1,message:"Must be false, a string or an array of strings."}},default:qc(e)?[]:["default"]}),t("content_style",{processor:"string"}),t("content_css_cors",{processor:"boolean",default:!1}),t("font_css",{processor:e=>{const t=h(e)||_(e,h);return t?{value:v(e)?e:$(e.split(","),Ge),valid:t}:{valid:!1,message:"Must be a string or an array of strings."}},default:[]}),t("inline_boundaries",{processor:"boolean",default:!0}),t("inline_boundaries_selector",{processor:"string",default:"a[href],code,span.mce-annotation"}),t("object_resizing",{processor:e=>{const t=y(e)||h(e);return t?!1===e||Wl.isiPhone()||Wl.isiPad()?{value:"",valid:t}:{value:!0===e?"table,img,figure.image,div,video,iframe":e,valid:t}:{valid:!1,message:"Must be boolean or a string"}},default:!$l}),t("resize_img_proportional",{processor:"boolean",default:!0}),t("event_root",{processor:"string"}),t("service_message",{processor:"string"}),t("theme",{processor:e=>!1===e||h(e)||S(e),default:"silver"}),t("theme_url",{processor:"string"}),t("formats",{processor:"object"}),t("format_empty_lines",{processor:"boolean",default:!1}),t("format_noneditable_selector",{processor:"string",default:""}),t("preview_styles",{processor:e=>{const t=!1===e||h(e);return t?{value:!1===e?"":e,valid:t}:{valid:!1,message:"Must be false or a string"}},default:"font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"}),t("custom_ui_selector",{processor:"string",default:""}),t("hidden_input",{processor:"boolean",default:!0}),t("submit_patch",{processor:"boolean",default:!0}),t("encoding",{processor:"string"}),t("add_form_submit_trigger",{processor:"boolean",default:!0}),t("add_unload_trigger",{processor:"boolean",default:!0}),t("custom_undo_redo_levels",{processor:"number",default:0}),t("disable_nodechange",{processor:"boolean",default:!1}),t("readonly",{processor:"boolean",default:!1}),t("editable_root",{processor:"boolean",default:!0}),t("plugins",{processor:"string[]",default:[]}),t("external_plugins",{processor:"object"}),t("forced_plugins",{processor:"string[]"}),t("model",{processor:"string",default:e.hasPlugin("rtc")?"plugin":"dom"}),t("model_url",{processor:"string"}),t("block_unsupported_drop",{processor:"boolean",default:!0}),t("visual",{processor:"boolean",default:!0}),t("visual_table_class",{processor:"string",default:"mce-item-table"}),t("visual_anchor_class",{processor:"string",default:"mce-item-anchor"}),t("iframe_aria_text",{processor:"string",default:"Rich Text Area. Press ALT-0 for help."}),t("setup",{processor:"function"}),t("init_instance_callback",{processor:"function"}),t("url_converter",{processor:"function",default:e.convertURL}),t("url_converter_scope",{processor:"object",default:e}),t("urlconverter_callback",{processor:"function"}),t("allow_conditional_comments",{processor:"boolean",default:!1}),t("allow_html_data_urls",{processor:"boolean",default:!1}),t("allow_svg_data_urls",{processor:"boolean"}),t("allow_html_in_named_anchor",{processor:"boolean",default:!1}),t("allow_script_urls",{processor:"boolean",default:!1}),t("allow_unsafe_link_target",{processor:"boolean",default:!1}),t("convert_fonts_to_spans",{processor:"boolean",default:!0,deprecated:!0}),t("fix_list_elements",{processor:"boolean",default:!1}),t("preserve_cdata",{processor:"boolean",default:!1}),t("remove_trailing_brs",{processor:"boolean",default:!0}),t("pad_empty_with_br",{processor:"boolean",default:!1}),t("inline_styles",{processor:"boolean",default:!0,deprecated:!0}),t("element_format",{processor:"string",default:"html"}),t("entities",{processor:"string"}),t("schema",{processor:"string",default:"html5"}),t("convert_urls",{processor:"boolean",default:!0}),t("relative_urls",{processor:"boolean",default:!0}),t("remove_script_host",{processor:"boolean",default:!0}),t("custom_elements",{processor:Yl}),t("extended_valid_elements",{processor:"string"}),t("invalid_elements",{processor:"string"}),t("invalid_styles",{processor:Yl}),t("valid_children",{processor:"string"}),t("valid_classes",{processor:Yl}),t("valid_elements",{processor:"string"}),t("valid_styles",{processor:Yl}),t("verify_html",{processor:"boolean",default:!0}),t("auto_focus",{processor:e=>h(e)||!0===e}),t("browser_spellcheck",{processor:"boolean",default:!1}),t("protect",{processor:"array"}),t("images_file_types",{processor:"string",default:"jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp"}),t("deprecation_warnings",{processor:"boolean",default:!0}),t("a11y_advanced_options",{processor:"boolean",default:!1}),t("api_key",{processor:"string"}),t("license_key",{processor:"string"}),t("paste_block_drop",{processor:"boolean",default:!1}),t("paste_data_images",{processor:"boolean",default:!0}),t("paste_preprocess",{processor:"function"}),t("paste_postprocess",{processor:"function"}),t("paste_webkit_styles",{processor:"string",default:"none"}),t("paste_remove_styles_if_webkit",{processor:"boolean",default:!0}),t("paste_merge_formats",{processor:"boolean",default:!0}),t("smart_paste",{processor:"boolean",default:!0}),t("paste_as_text",{processor:"boolean",default:!1}),t("paste_tab_spaces",{processor:"number",default:4}),t("text_patterns",{processor:e=>_(e,p)||!1===e?{value:jl(!1===e?[]:e),valid:!0}:{valid:!1,message:"Must be an array of objects or false."},default:[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1",trigger:"space"},{start:"##",format:"h2",trigger:"space"},{start:"###",format:"h3",trigger:"space"},{start:"####",format:"h4",trigger:"space"},{start:"#####",format:"h5",trigger:"space"},{start:"######",format:"h6",trigger:"space"},{start:"1.",cmd:"InsertOrderedList",trigger:"space"},{start:"*",cmd:"InsertUnorderedList",trigger:"space"},{start:"-",cmd:"InsertUnorderedList",trigger:"space"},{start:">",cmd:"mceBlockQuote",trigger:"space"},{start:"---",cmd:"InsertHorizontalRule",trigger:"space"}]}),t("text_patterns_lookup",{processor:e=>{return S(e)?{value:(t=e,e=>{const o=t(e);return jl(o)}),valid:!0}:{valid:!1,message:"Must be a single function"};var t},default:e=>[]}),t("noneditable_class",{processor:"string",default:"mceNonEditable"}),t("editable_class",{processor:"string",default:"mceEditable"}),t("noneditable_regexp",{processor:e=>_(e,Gl)?{value:e,valid:!0}:Gl(e)?{value:[e],valid:!0}:{valid:!1,message:"Must be a RegExp or an array of RegExp."},default:[]}),t("table_tab_navigation",{processor:"boolean",default:!0}),t("highlight_on_focus",{processor:"boolean",default:!0}),t("xss_sanitization",{processor:"boolean",default:!0}),t("details_initial_state",{processor:e=>{const t=j(["inherited","collapsed","expanded"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),t("details_serialized_state",{processor:e=>{const t=j(["inherited","collapsed","expanded"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),t("init_content_sync",{processor:"boolean",default:!1}),t("newdocument_content",{processor:"string",default:""}),t("sandbox_iframes",{processor:"boolean",default:!0}),t("sandbox_iframes_exclusions",{processor:"string[]",default:["youtube.com","youtu.be","vimeo.com","player.vimeo.com","dailymotion.com","embed.music.apple.com","open.spotify.com","giphy.com","dai.ly","codepen.io"]}),t("convert_unsafe_embeds",{processor:"boolean",default:!0}),e.on("ScriptsLoaded",(()=>{t("directionality",{processor:"string",default:_a.isRtl()?"rtl":void 0}),t("placeholder",{processor:"string",default:ql.getAttrib(e.getElement(),"placeholder")})}))})(n);const s=this.options.get;s("deprecation_warnings")&&rS(t,r);const a=s("suffix");a&&(o.suffix=a),this.suffix=o.suffix;const i=s("base_url");i&&o._setBaseUrl(i),this.baseUri=o.baseURI;const l=Cc(n);l&&(xa.ScriptLoader._setReferrerPolicy(l),ya.DOM.styleSheetLoader._setReferrerPolicy(l));const c=od(n);C(c)&&ya.DOM.styleSheetLoader._setContentCssCors(c),Ea.languageLoad=s("language_load"),Ea.baseURL=o.baseURL,this.setDirty(!1),this.documentBaseURI=new kx(ec(n),{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=qc(n),this.hasVisual=ad(n),this.shortcuts=new YL(this),this.editorCommands=new bL(this),pL(this);const d=s("cache_suffix");d&&(Mt.cacheSuffix=d.replace(/^[\?\&]+/,"")),this.ui={registry:XL(),styleSheetLoader:void 0,show:E,hide:E,setEnabled:E,isEnabled:P},this.mode=jL(n),o.dispatch("SetupEditor",{editor:this});const m=dd(n);S(m)&&m.call(n,n)}render(){IB(this)}focus(e){this.execCommand("mceFocus",!1,e)}hasFocus(){return fp(this)}translate(e){return _a.translate(e)}getParam(e,t,o){const n=this.options;return n.isRegistered(e)||(C(o)?n.register(e,{processor:o,default:t}):n.register(e,{processor:P,default:t})),n.isSet(e)||w(t)?n.get(e):t}hasPlugin(e,t){return!(!j(nd(this),e)||t&&void 0===wS.get(e))}nodeChanged(e){this._nodeChangeDispatcher.nodeChanged(e)}addCommand(e,t,o){this.editorCommands.addCommand(e,t,o)}addQueryStateHandler(e,t,o){this.editorCommands.addQueryStateHandler(e,t,o)}addQueryValueHandler(e,t,o){this.editorCommands.addQueryValueHandler(e,t,o)}addShortcut(e,t,o,n){this.shortcuts.add(e,t,o,n)}execCommand(e,t,o,n){return this.editorCommands.execCommand(e,t,o,n)}queryCommandState(e){return this.editorCommands.queryCommandState(e)}queryCommandValue(e){return this.editorCommands.queryCommandValue(e)}queryCommandSupported(e){return this.editorCommands.queryCommandSupported(e)}show(){const e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable="true":(JL.show(e.getContainer()),JL.hide(e.id)),e.load(),e.dispatch("show"))}hide(){const e=this;e.hidden||(e.save(),e.inline?(e.getBody().contentEditable="false",e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(JL.hide(e.getContainer()),JL.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.dispatch("hide"))}isHidden(){return this.hidden}setProgressState(e,t){this.dispatch("ProgressState",{state:e,time:t})}load(e={}){const t=this,o=t.getElement();if(t.removed)return"";if(o){const n={...e,load:!0},r=ir(o)?o.value:o.innerHTML,s=t.setContent(r,n);return n.no_events||t.dispatch("LoadContent",{...n,element:o}),s}return""}save(e={}){const t=this;let o=t.getElement();if(!o||!t.initialized||t.removed)return"";const n={...e,save:!0,element:o};let r=t.getContent(n);const s={...n,content:r};if(s.no_events||t.dispatch("SaveContent",s),"raw"===s.format&&t.dispatch("RawSaveContent",s),r=s.content,ir(o))o.value=r;else{!e.is_removing&&t.inline||(o.innerHTML=r);const n=JL.getParent(t.id,"form");n&&eH(n.elements,(e=>e.name!==t.id||(e.value=r,!1)))}return s.element=n.element=o=null,!1!==s.set_dirty&&t.setDirty(!1),r}setContent(e,t){return $C(this,e,t)}getContent(e){return WC(this,e)}insertContent(e,t){t&&(e=QL({content:e},t)),this.execCommand("mceInsertContent",!1,e)}resetContent(e){void 0===e?$C(this,this.startContent,{format:"raw"}):$C(this,e),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()}isDirty(){return!this.isNotDirty}setDirty(e){const t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.dispatch("dirty")}getContainer(){const e=this;return e.container||(e.container=e.editorContainer||JL.get(e.id+"_parent")),e.container}getContentAreaContainer(){return this.contentAreaContainer}getElement(){return this.targetElm||(this.targetElm=JL.get(this.id)),this.targetElm}getWin(){const e=this;if(!e.contentWindow){const t=e.iframeElement;t&&(e.contentWindow=t.contentWindow)}return e.contentWindow}getDoc(){const e=this;if(!e.contentDocument){const t=e.getWin();t&&(e.contentDocument=t.document)}return e.contentDocument}getBody(){var e,t;const o=this.getDoc();return null!==(t=null!==(e=this.bodyElement)&&void 0!==e?e:null==o?void 0:o.body)&&void 0!==t?t:null}convertURL(e,t,o){const n=this,r=n.options.get,s=ud(n);if(S(s))return s.call(n,e,o,!0,t);if(!r("convert_urls")||"link"===o||p(o)&&"LINK"===o.nodeName||0===e.indexOf("file:")||0===e.length)return e;const a=new kx(e);return"http"!==a.protocol&&"https"!==a.protocol&&""!==a.protocol?e:r("relative_urls")?n.documentBaseURI.toRelative(e):e=n.documentBaseURI.toAbsolute(e,r("remove_script_host"))}addVisual(e){GB(this,e)}setEditableRoot(e){((e,t)=>{e._editableRoot!==t&&(e._editableRoot=t,e.readonly||(e.getBody().contentEditable=String(e.hasEditableRoot()),e.nodeChanged()),((e,t)=>{e.dispatch("EditableRootStateChange",{state:t})})(e,t))})(this,e)}hasEditableRoot(){return this._editableRoot}remove(){iS(this)}destroy(e){lS(this,e)}uploadImages(){return this.editorUpload.uploadImages()}_scanForImages(){return this.editorUpload.scanForImages()}}const oH=ya.DOM,nH=Lt.each;let rH,sH=!1,aH=[];const iH=e=>{const t=e.type;nH(mH.get(),(o=>{switch(t){case"scroll":o.dispatch("ScrollWindow",e);break;case"resize":o.dispatch("ResizeWindow",e)}}))},lH=e=>{if(e!==sH){const t=ya.DOM;e?(t.bind(window,"resize",iH),t.bind(window,"scroll",iH)):(t.unbind(window,"resize",iH),t.unbind(window,"scroll",iH)),sH=e}},cH=e=>{const t=aH;return aH=Y(aH,(t=>e!==t)),mH.activeEditor===e&&(mH.activeEditor=aH.length>0?aH[0]:null),mH.focusedEditor===e&&(mH.focusedEditor=null),t.length!==aH.length},dH="CSS1Compat"!==document.compatMode,mH={...DL,baseURI:null,baseURL:null,defaultOptions:{},documentBaseURL:null,suffix:null,majorVersion:"7",minorVersion:"3.0",releaseDate:"2024-08-07",i18n:_a,activeEditor:null,focusedEditor:null,setup(){const e=this;let t="",o="",n=kx.getDocumentBaseUrl(document.location);/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"));const r=window.tinymce||window.tinyMCEPreInit;if(r)t=r.base||r.baseURL,o=r.suffix;else{const e=document.getElementsByTagName("script");for(let n=0;n{Ea.PluginManager.urls[t]=e}))},init(e){const t=this;let o;const n=Lt.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," ");let r=e=>{o=e};const s=()=>{let o=0;const a=[];let i;oH.unbind(window,"ready",s),(o=>{const n=e[o];n&&n.apply(t,[])})("onpageload"),i=he((e=>Mt.browser.isIE()||Mt.browser.isEdge()?(TS("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tiny.cloud/docs/tinymce/7/support/#supportedwebbrowsers"),[]):dH?(TS("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[]):h(e.selector)?oH.select(e.selector):C(e.target)?[e.target]:[])(e)),Lt.each(i,(e=>{var o;(o=t.get(e.id))&&o.initialized&&!(o.getContainer()||o.getBody()).parentNode&&(cH(o),o.unbindAllNativeEvents(),o.destroy(!0),o.removed=!0)})),i=Lt.grep(i,(e=>!t.get(e.id))),0===i.length?r([]):nH(i,(s=>{((e,t)=>e.inline&&t.tagName.toLowerCase()in n)(e,s)?TS("Could not initialize inline editor on invalid inline target element",s):((e,n,s)=>{const l=new tH(e,n,t);a.push(l),l.on("init",(()=>{++o===i.length&&r(a)})),l.targetElm=l.targetElm||s,l.render()})((e=>{let t=e.id;return t||(t=_e(e,"name").filter((e=>!oH.get(e))).getOrThunk(oH.uniqueId),e.setAttribute("id",t)),t})(s),e,s)}))};return oH.bind(window,"ready",s),new Promise((e=>{o?e(o):r=t=>{e(t)}}))},get(e){return 0===arguments.length?aH.slice(0):h(e)?ee(aH,(t=>t.id===e)).getOr(null):k(e)&&aH[e]?aH[e]:null},add(e){const t=this,o=t.get(e.id);return o===e||(null===o&&aH.push(e),lH(!0),t.activeEditor=e,t.dispatch("AddEditor",{editor:e}),rH||(rH=e=>{const o=t.dispatch("BeforeUnload");if(o.returnValue)return e.preventDefault(),e.returnValue=o.returnValue,o.returnValue},window.addEventListener("beforeunload",rH))),e},createEditor(e,t){return this.add(new tH(e,t,this))},remove(e){const t=this;let o;if(e){if(!h(e))return o=e,b(t.get(o.id))?null:(cH(o)&&t.dispatch("RemoveEditor",{editor:o}),0===aH.length&&window.removeEventListener("beforeunload",rH),o.remove(),lH(aH.length>0),o);nH(oH.select(e),(e=>{o=t.get(e.id),o&&t.remove(o)}))}else for(let e=aH.length-1;e>=0;e--)t.remove(aH[e])},execCommand(e,t,o){var n;const r=this,s=p(o)?null!==(n=o.id)&&void 0!==n?n:o.index:o;switch(e){case"mceAddEditor":if(!r.get(s)){const e=o.options;new tH(s,e,r).render()}return!0;case"mceRemoveEditor":{const e=r.get(s);return e&&e.remove(),!0}case"mceToggleEditor":{const e=r.get(s);return e?(e.isHidden()?e.show():e.hide(),!0):(r.execCommand("mceAddEditor",!1,o),!0)}}return!!r.activeEditor&&r.activeEditor.execCommand(e,t,o)},triggerSave:()=>{nH(aH,(e=>{e.save()}))},addI18n:(e,t)=>{_a.add(e,t)},translate:e=>_a.translate(e),setActive(e){const t=this.activeEditor;this.activeEditor!==e&&(t&&t.dispatch("deactivate",{relatedTarget:e}),e.dispatch("activate",{relatedTarget:t})),this.activeEditor=e},_setBaseUrl(e){this.baseURL=new kx(this.documentBaseURL).toAbsolute(e.replace(/\/+$/,"")),this.baseURI=new kx(this.baseURL)}};mH.setup();const uH=(()=>{const e=Lr();return{FakeClipboardItem:e=>({items:e,types:pe(e),getType:t=>_e(e,t).getOrUndefined()}),write:t=>{e.set(t)},read:()=>e.get().getOrUndefined(),clear:e.clear}})(),gH=Math.min,hH=Math.max,pH=Math.round,fH=(e,t,o)=>{let n=t.x,r=t.y;const s=e.w,a=e.h,i=t.w,l=t.h,c=(o||"").split("");return"b"===c[0]&&(r+=l),"r"===c[1]&&(n+=i),"c"===c[0]&&(r+=pH(l/2)),"c"===c[1]&&(n+=pH(i/2)),"b"===c[3]&&(r-=a),"r"===c[4]&&(n-=s),"c"===c[3]&&(r-=pH(a/2)),"c"===c[4]&&(n-=pH(s/2)),vH(n,r,s,a)},vH=(e,t,o,n)=>({x:e,y:t,w:o,h:n}),bH={inflate:(e,t,o)=>vH(e.x-t,e.y-o,e.w+2*t,e.h+2*o),relativePosition:fH,findBestRelativePosition:(e,t,o,n)=>{for(let r=0;r=o.x&&s.x+s.w<=o.w+o.x&&s.y>=o.y&&s.y+s.h<=o.h+o.y)return n[r]}return null},intersect:(e,t)=>{const o=hH(e.x,t.x),n=hH(e.y,t.y),r=gH(e.x+e.w,t.x+t.w),s=gH(e.y+e.h,t.y+t.h);return r-o<0||s-n<0?null:vH(o,n,r-o,s-n)},clamp:(e,t,o)=>{let n=e.x,r=e.y,s=e.x+e.w,a=e.y+e.h;const i=t.x+t.w,l=t.y+t.h,c=hH(0,t.x-n),d=hH(0,t.y-r),m=hH(0,s-i),u=hH(0,a-l);return n+=c,r+=d,o&&(s+=c,a+=d,n-=m,r-=u),s-=m,a-=u,vH(n,r,s-n,a-r)},create:vH,fromClientRect:e=>vH(e.left,e.top,e.width,e.height)},yH=(()=>{const e={},t={},o={};return{load:(o,n)=>{const r=`Script at URL "${n}" failed to load`,s=`Script at URL "${n}" did not call \`tinymce.Resource.add('${o}', data)\` within 1 second`;if(void 0!==e[o])return e[o];{const a=new Promise(((e,a)=>{const i=((e,t,o=1e3)=>{let n=!1,r=null;const s=e=>(...t)=>{n||(n=!0,null!==r&&(clearTimeout(r),r=null),e.apply(null,t))},a=s(e),i=s(t);return{start:(...e)=>{n||null!==r||(r=setTimeout((()=>i.apply(null,e)),o))},resolve:a,reject:i}})(e,a);t[o]=i.resolve,xa.ScriptLoader.loadScript(n).then((()=>i.start(s)),(()=>i.reject(r)))}));return e[o]=a,a}},add:(n,r)=>{void 0!==t[n]&&(t[n](r),delete t[n]),e[n]=Promise.resolve(r),o[n]=r},has:e=>e in o,get:e=>o[e],unload:t=>{delete e[t],delete o[t]}}})();let wH;try{const e="__storage_test__";wH=window.localStorage,wH.setItem(e,e),wH.removeItem(e)}catch(e){wH=(()=>{let e={},t=[];const o={getItem:t=>e[t]||null,setItem:(o,n)=>{t.push(o),e[o]=String(n)},key:e=>t[e],removeItem:o=>{t=t.filter((e=>e===o)),delete e[o]},clear:()=>{t=[],e={}},length:0};return Object.defineProperty(o,"length",{get:()=>t.length,configurable:!1,enumerable:!1}),o})()}const xH={geom:{Rect:bH},util:{Delay:np,Tools:Lt,VK:Vg,URI:kx,EventDispatcher:OL,Observable:DL,I18n:_a,LocalStorage:wH,ImageUploader:e=>{const t=NS(),o=IS(e,t);return{upload:(t,n=!0)=>o.upload(t,n?HS(e):void 0)}}},dom:{EventUtils:ca,TreeWalker:Un,TextSeeker:Ka,DOMUtils:ya,ScriptLoader:xa,RangeUtils:xh,Serializer:jC,StyleSheetLoader:ss,ControlSelection:$g,BookmarkManager:Ng,Selection:PC,Event:ca.Event},html:{Styles:Qs,Entities:ks,Node:Dp,Schema:Us,DomParser:zx,Writer:Kp,Serializer:Yp},Env:Mt,AddOnManager:Ea,Annotator:Mg,Formatter:XS,UndoManager:QS,EditorCommands:bL,WindowManager:CS,NotificationManager:yS,EditorObservable:HL,Shortcuts:YL,Editor:tH,FocusManager:op,EditorManager:mH,DOM:ya.DOM,ScriptLoader:xa.ScriptLoader,PluginManager:wS,ThemeManager:xS,ModelManager:dS,IconManager:cS,Resource:yH,FakeClipboard:uH,trim:Lt.trim,isArray:Lt.isArray,is:Lt.is,toArray:Lt.toArray,makeMap:Lt.makeMap,each:Lt.each,map:Lt.map,grep:Lt.grep,inArray:Lt.inArray,extend:Lt.extend,walk:Lt.walk,resolve:Lt.resolve,explode:Lt.explode,_addCacheSuffix:Lt._addCacheSuffix},CH=Lt.extend(mH,xH);(e=>{window.tinymce=e,window.tinyMCE=e})(CH),(e=>{try{t.exports=e}catch(e){}})(CH)}();var n=e(o.exports);tinymce.IconManager.add("default",{icons:{"accessibility-check":'',"accordion-toggle":'',accordion:'',"action-next":'',"action-prev":'',addtag:'',"ai-prompt":'',ai:'',"align-center":'',"align-justify":'',"align-left":'',"align-none":'',"align-right":'',"arrow-left":'',"arrow-right":'',bold:'',bookmark:'',"border-style":'',"border-width":'',brightness:'',browse:'',cancel:'',"cell-background-color":'',"cell-border-color":'',"change-case":'',"character-count":'',"checklist-rtl":'',checklist:'',checkmark:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',close:'',"code-sample":'',"color-levels":'',"color-picker":'',"color-swatch-remove-color":'',"color-swatch":'',"comment-add":'',comment:'',contrast:'',copy:'',crop:'',"cut-column":'',"cut-row":'',cut:'',"document-properties":'',drag:'',"duplicate-column":'',"duplicate-row":'',duplicate:'',"edit-block":'',"edit-image":'',"embed-page":'',embed:'',emoji:'',export:'',fill:'',"flip-horizontally":'',"flip-vertically":'',footnote:'',"format-code":'',"format-painter":'',format:'',fullscreen:'',gallery:'',gamma:'',help:'',"highlight-bg-color":'',home:'',"horizontal-rule":'',"image-options":'',image:'',indent:'',info:'',"insert-character":'',"insert-time":'',invert:'',italic:'',language:'',"line-height":'',line:'',link:'',"list-bull-circle":'',"list-bull-default":'',"list-bull-square":'',"list-num-default-rtl":'',"list-num-default":'',"list-num-lower-alpha-rtl":'',"list-num-lower-alpha":'',"list-num-lower-greek-rtl":'',"list-num-lower-greek":'',"list-num-lower-roman-rtl":'',"list-num-lower-roman":'',"list-num-upper-alpha-rtl":'',"list-num-upper-alpha":'',"list-num-upper-roman-rtl":'',"list-num-upper-roman":'',lock:'',ltr:'',"math-equation":'',minus:'',"more-drawer":'',"new-document":'',"new-tab":'',"non-breaking":'',notice:'',"ordered-list-rtl":'',"ordered-list":'',orientation:'',outdent:'',"export-pdf":'',"export-word":'',"import-word":'',"page-break":'',paragraph:'',"paste-column-after":'',"paste-column-before":'',"paste-row-after":'',"paste-row-before":'',"paste-text":'',paste:'',"permanent-pen":'',plus:'',preferences:'',preview:'',print:'',quote:'',redo:'',reload:'',"remove-formatting":'',remove:'',"resize-handle":'',resize:'',"restore-draft":'',"revision-history":'',"rotate-left":'',"rotate-right":'',rtl:'',save:'',search:'',"select-all":'',selected:'',send:'',settings:'',sharpen:'',sourcecode:'',"spell-check":'',"strike-through":'',subscript:'',superscript:'',"table-caption":'',"table-cell-classes":'',"table-cell-properties":'',"table-cell-select-all":'',"table-cell-select-inner":'',"table-classes":'',"table-delete-column":'',"table-delete-row":'',"table-delete-table":'',"table-insert-column-after":'',"table-insert-column-before":'',"table-insert-row-above":'',"table-insert-row-after":'',"table-left-header":'',"table-merge-cells":'',"table-row-numbering-rtl":'',"table-row-numbering":'',"table-row-properties":'',"table-split-cells":'',"table-top-header":'',table:'',"template-add":'',template:'',"temporary-placeholder":'',"text-color":'',"text-size-decrease":'',"text-size-increase":'',toc:'',translate:'',typography:'',underline:'',undo:'',unlink:'',unlock:'',"unordered-list":'',unselected:'',upload:'',user:'',"vertical-align":'',visualblocks:'',visualchars:'',warning:'',"zoom-in":'',"zoom-out":''}}),function(){const e=Object.getPrototypeOf,t=(e,t,o)=>{var n;return!!o(e,t.prototype)||(null===(n=e.constructor)||void 0===n?void 0:n.name)===t.name},o=e=>o=>(e=>{const o=typeof e;return null===e?"null":"object"===o&&Array.isArray(e)?"array":"object"===o&&t(e,String,((e,t)=>t.isPrototypeOf(e)))?"string":o})(o)===e,n=e=>t=>typeof t===e,r=e=>t=>e===t,s=o("string"),a=o("object"),i=o=>((o,n)=>a(o)&&t(o,n,((t,o)=>e(t)===o)))(o,Object),l=o("array"),c=r(null),d=n("boolean"),m=r(void 0),u=e=>null==e,g=e=>!u(e),h=n("function"),p=n("number"),f=(e,t)=>{if(l(e)){for(let o=0,n=e.length;o{},b=e=>()=>e(),y=(e,t)=>(...o)=>e(t.apply(null,o)),w=e=>()=>e,x=e=>e,C=(e,t)=>e===t;function S(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const k=e=>t=>!e(t),_=e=>()=>{throw new Error(e)},E=e=>e(),T=w(!1),O=w(!0);class A{constructor(e,t){this.tag=e,this.value=t}static some(e){return new A(!0,e)}static none(){return A.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?A.some(e(this.value)):A.none()}bind(e){return this.tag?e(this.value):A.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:A.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return g(e)?A.some(e):A.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}A.singletonNone=new A(!1);const D=Array.prototype.slice,M=Array.prototype.indexOf,N=Array.prototype.push,R=(e,t)=>M.call(e,t),B=(e,t)=>R(e,t)>-1,L=(e,t)=>{for(let o=0,n=e.length;o{const o=[];for(let n=0;n{const o=[];for(let n=0;n{const o=e.length,n=new Array(o);for(let r=0;r{for(let o=0,n=e.length;o{const o=[],n=[];for(let r=0,s=e.length;r{const o=[];for(let n=0,r=e.length;n(((e,t)=>{for(let o=e.length-1;o>=0;o--)t(e[o],o)})(e,((e,n)=>{o=t(o,e,n)})),o),U=(e,t,o)=>(F(e,((e,n)=>{o=t(o,e,n)})),o),j=(e,t)=>((e,t,o)=>{for(let n=0,r=e.length;n{for(let o=0,n=e.length;o{const t=[];for(let o=0,n=e.length;o$(P(e,t)),G=(e,t)=>{for(let o=0,n=e.length;o{const t=D.call(e,0);return t.reverse(),t},Y=(e,t)=>V(e,(e=>!B(t,e))),X=(e,t)=>{const o={};for(let n=0,r=e.length;n[e],Q=(e,t)=>{const o=D.call(e,0);return o.sort(t),o},ee=(e,t)=>t>=0&&tee(e,0),oe=e=>ee(e,e.length-1),ne=h(Array.from)?Array.from:e=>D.call(e),re=(e,t)=>{for(let o=0;o{const o=se(e);for(let n=0,r=o.length;nce(e,((e,o)=>({k:o,v:t(e,o)}))),ce=(e,t)=>{const o={};return ie(e,((e,n)=>{const r=t(e,n);o[r.k]=r.v})),o},de=e=>(t,o)=>{e[o]=t},me=(e,t,o,n)=>{ie(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))},ue=(e,t)=>{const o={};return me(e,t,de(o),v),o},ge=(e,t)=>{const o=[];return ie(e,((e,n)=>{o.push(t(e,n))})),o},he=(e,t)=>{const o=se(e);for(let n=0,r=o.length;nge(e,x),fe=(e,t)=>ve(e,t)?A.from(e[t]):A.none(),ve=(e,t)=>ae.call(e,t),be=(e,t)=>ve(e,t)&&void 0!==e[t]&&null!==e[t],ye=(e,t,o=C)=>e.exists((e=>o(e,t))),we=e=>{const t=[],o=e=>{t.push(e)};for(let t=0;te.isSome()&&t.isSome()?A.some(o(e.getOrDie(),t.getOrDie())):A.none(),Ce=(e,t)=>null!=e?A.some(t(e)):A.none(),Se=(e,t)=>e?A.some(t):A.none(),ke=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,_e=(e,t)=>Te(e,t)?((e,t)=>e.substring(t))(e,t.length):e,Ee=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!m(n)||r+t.length<=n)},Te=(e,t)=>ke(e,t,0),Oe=(e,t)=>ke(e,t,e.length-t.length),Ae=(e=>t=>t.replace(e,""))(/^\s+|\s+$/g),De=e=>e.length>0,Me=e=>!De(e),Ne=e=>void 0!==e.style&&h(e.style.getPropertyValue),Re=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},Be={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return Re(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return Re(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return Re(o)},fromDom:Re,fromPoint:(e,t,o)=>A.from(e.dom.elementFromPoint(t,o)).map(Re)},Le="undefined"!=typeof window?window:Function("return this;")(),He=(e,t)=>((e,t)=>{let o=null!=t?t:Le;for(let t=0;t{const o=((e,t)=>He(e,t))(e,t);if(null==o)throw new Error(e+" not available on this browser");return o},Pe=Object.getPrototypeOf,Fe=e=>{const t=He("ownerDocument.defaultView",e);return a(e)&&((e=>Ie("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(Pe(e).constructor.name))},ze=e=>e.dom.nodeName.toLowerCase(),Ve=e=>t=>(e=>e.dom.nodeType)(t)===e,Ze=e=>Ue(e)&&Fe(e.dom),Ue=Ve(1),je=Ve(3),We=Ve(9),$e=Ve(11),qe=e=>t=>Ue(t)&&ze(t)===e,Ge=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},Ke=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,Ye=(e,t)=>{const o=void 0===t?document:t.dom;return Ke(o)?A.none():A.from(o.querySelector(e)).map(Be.fromDom)},Xe=(e,t)=>e.dom===t.dom,Je=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},Qe=e=>Be.fromDom(e.dom.ownerDocument),et=e=>We(e)?e:Qe(e),tt=e=>Be.fromDom(et(e).dom.documentElement),ot=e=>Be.fromDom(et(e).dom.defaultView),nt=e=>A.from(e.dom.parentNode).map(Be.fromDom),rt=e=>A.from(e.dom.parentElement).map(Be.fromDom),st=e=>A.from(e.dom.offsetParent).map(Be.fromDom),at=e=>P(e.dom.childNodes,Be.fromDom),it=(e,t)=>{const o=e.dom.childNodes;return A.from(o[t]).map(Be.fromDom)},lt=e=>it(e,0),ct=(e,t)=>({element:e,offset:t}),dt=(e,t)=>{const o=at(e);return o.length>0&&t$e(e)&&g(e.dom.host),ut=e=>Be.fromDom(e.dom.getRootNode()),gt=e=>mt(e)?e:Be.fromDom(et(e).dom.body),ht=e=>{const t=ut(e);return mt(t)?A.some(t):A.none()},pt=e=>Be.fromDom(e.dom.host),ft=e=>g(e.dom.shadowRoot),vt=e=>{const t=je(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return ht(Be.fromDom(t)).fold((()=>o.body.contains(t)),(n=vt,r=pt,e=>n(r(e))));var n,r},bt=()=>yt(Be.fromDom(document)),yt=e=>{const t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return Be.fromDom(t)},wt=(e,t,o)=>{if(!(s(o)||d(o)||p(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")},xt=(e,t,o)=>{wt(e.dom,t,o)},Ct=(e,t)=>{const o=e.dom;ie(t,((e,t)=>{wt(o,t,e)}))},St=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},kt=(e,t)=>A.from(St(e,t)),_t=(e,t)=>{const o=e.dom;return!(!o||!o.hasAttribute)&&o.hasAttribute(t)},Et=(e,t)=>{e.dom.removeAttribute(t)},Tt=(e,t,o)=>{if(!s(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);Ne(e)&&e.style.setProperty(t,o)},Ot=(e,t)=>{Ne(e)&&e.style.removeProperty(t)},At=(e,t,o)=>{const n=e.dom;Tt(n,t,o)},Dt=(e,t)=>{const o=e.dom;ie(t,((e,t)=>{Tt(o,t,e)}))},Mt=(e,t)=>{const o=e.dom;ie(t,((e,t)=>{e.fold((()=>{Ot(o,t)}),(e=>{Tt(o,t,e)}))}))},Nt=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||vt(e)?n:Rt(o,t)},Rt=(e,t)=>Ne(e)?e.style.getPropertyValue(t):"",Bt=(e,t)=>{const o=e.dom,n=Rt(o,t);return A.from(n).filter((e=>e.length>0))},Lt=e=>{const t={},o=e.dom;if(Ne(o))for(let e=0;e{const n=Be.fromTag(e);At(n,t,o);return Bt(n,t).isSome()},It=(e,t)=>{const o=e.dom;Ot(o,t),ye(kt(e,"style").map(Ae),"")&&Et(e,"style")},Pt=e=>e.dom.offsetWidth,Ft=(e,t)=>{const o=o=>{const n=t(o);if(n<=0||null===n){const t=Nt(o,e);return parseFloat(t)||0}return n},n=(e,t)=>U(t,((t,o)=>{const n=Nt(e,o),r=void 0===n?0:parseInt(n,10);return isNaN(r)?t:t+r}),0);return{set:(t,o)=>{if(!p(o)&&!o.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+o);const n=t.dom;Ne(n)&&(n.style[e]=o+"px")},get:o,getOuter:o,aggregate:n,max:(e,t,o)=>{const r=n(e,o);return t>r?t-r:0}}},zt=Ft("height",(e=>{const t=e.dom;return vt(e)?t.getBoundingClientRect().height:t.offsetHeight})),Vt=e=>zt.get(e),Zt=e=>zt.getOuter(e),Ut=(e,t)=>({left:e,top:t,translate:(o,n)=>Ut(e+o,t+n)}),jt=Ut,Wt=(e,t)=>void 0!==e?e:void 0!==t?t:0,$t=e=>{const t=e.dom.ownerDocument,o=t.body,n=t.defaultView,r=t.documentElement;if(o===e.dom)return jt(o.offsetLeft,o.offsetTop);const s=Wt(null==n?void 0:n.pageYOffset,r.scrollTop),a=Wt(null==n?void 0:n.pageXOffset,r.scrollLeft),i=Wt(r.clientTop,o.clientTop),l=Wt(r.clientLeft,o.clientLeft);return qt(e).translate(a-l,s-i)},qt=e=>{const t=e.dom,o=t.ownerDocument.body;return o===t?jt(o.offsetLeft,o.offsetTop):vt(e)?(e=>{const t=e.getBoundingClientRect();return jt(t.left,t.top)})(t):jt(0,0)},Gt=Ft("width",(e=>e.dom.offsetWidth)),Kt=e=>Gt.get(e),Yt=e=>Gt.getOuter(e),Xt=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},Jt=()=>Qt(0,0),Qt=(e,t)=>({major:e,minor:t}),eo={nu:Qt,detect:(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?Jt():((e,t)=>{const o=((e,t)=>{for(let o=0;oNumber(t.replace(o,"$"+e));return Qt(n(1),n(2))})(e,o)},unknown:Jt},to=(e,t)=>{const o=String(t).toLowerCase();return j(e,(e=>e.search(o)))},oo=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,no=e=>t=>Ee(t,e),ro=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>Ee(e,"edge/")&&Ee(e,"chrome")&&Ee(e,"safari")&&Ee(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,oo],search:e=>Ee(e,"chrome")&&!Ee(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>Ee(e,"msie")||Ee(e,"trident")},{name:"Opera",versionRegexes:[oo,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:no("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:no("firefox")},{name:"Safari",versionRegexes:[oo,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(Ee(e,"safari")||Ee(e,"mobile/"))&&Ee(e,"applewebkit")}],so=[{name:"Windows",search:no("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>Ee(e,"iphone")||Ee(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:no("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:no("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:no("linux"),versionRegexes:[]},{name:"Solaris",search:no("sunos"),versionRegexes:[]},{name:"FreeBSD",search:no("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:no("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],ao={browsers:w(ro),oses:w(so)},io="Edge",lo="Chromium",co="Opera",mo="Firefox",uo="Safari",go=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(io),isChromium:n(lo),isIE:n("IE"),isOpera:n(co),isFirefox:n(mo),isSafari:n(uo)}},ho={unknown:()=>go({current:void 0,version:eo.unknown()}),nu:go,edge:w(io),chromium:w(lo),ie:w("IE"),opera:w(co),firefox:w(mo),safari:w(uo)},po="Windows",fo="Android",vo="Linux",bo="macOS",yo="Solaris",wo="FreeBSD",xo="ChromeOS",Co=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(po),isiOS:n("iOS"),isAndroid:n(fo),isMacOS:n(bo),isLinux:n(vo),isSolaris:n(yo),isFreeBSD:n(wo),isChromeOS:n(xo)}},So={unknown:()=>Co({current:void 0,version:eo.unknown()}),nu:Co,windows:w(po),ios:w("iOS"),android:w(fo),linux:w(vo),macos:w(bo),solaris:w(yo),freebsd:w(wo),chromeos:w(xo)},ko=(e,t,o)=>{const n=ao.browsers(),r=ao.oses(),s=t.bind((e=>((e,t)=>re(t.brands,(t=>{const o=t.brand.toLowerCase();return j(e,(e=>{var t;return o===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:eo.nu(parseInt(t.version,10),0)})))})))(n,e))).orThunk((()=>((e,t)=>to(e,t).map((e=>{const o=eo.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(n,e))).fold(ho.unknown,ho.nu),a=((e,t)=>to(e,t).map((e=>{const o=eo.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(r,e).fold(So.unknown,So.nu),i=((e,t,o,n)=>{const r=e.isiOS()&&!0===/ipad/i.test(o),s=e.isiOS()&&!r,a=e.isiOS()||e.isAndroid(),i=a||n("(pointer:coarse)"),l=r||!s&&a&&n("(min-device-width:768px)"),c=s||a&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),m=!c&&!l&&!d;return{isiPad:w(r),isiPhone:w(s),isTablet:w(l),isPhone:w(c),isTouch:w(i),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:w(d),isDesktop:w(m)}})(a,s,e,o);return{browser:s,os:a,deviceType:i}},_o=e=>window.matchMedia(e).matches;let Eo=Xt((()=>ko(window.navigator.userAgent,A.from(window.navigator.userAgentData),_o)));const To=()=>Eo(),Oo=e=>{const t=Be.fromDom((e=>{if(g(e.target)){const t=Be.fromDom(e.target);if(Ue(t)&&ft(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return te(t)}}return A.from(e.target)})(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),r=y(n,o);return((e,t,o,n,r,s,a)=>({target:e,x:t,y:o,stop:n,prevent:r,kill:s,raw:a}))(t,e.clientX,e.clientY,o,n,r,e)},Ao=(e,t,o,n,r)=>{const s=((e,t)=>o=>{e(o)&&t(Oo(o))})(o,n);return e.dom.addEventListener(t,s,r),{unbind:S(Do,e,t,s,r)}},Do=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},Mo=(e,t)=>{nt(e).each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},No=(e,t)=>{const o=(e=>A.from(e.dom.nextSibling).map(Be.fromDom))(e);o.fold((()=>{nt(e).each((e=>{Bo(e,t)}))}),(e=>{Mo(e,t)}))},Ro=(e,t)=>{lt(e).fold((()=>{Bo(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},Bo=(e,t)=>{e.dom.appendChild(t.dom)},Lo=(e,t)=>{F(t,(t=>{Bo(e,t)}))},Ho=e=>{e.dom.textContent="",F(at(e),(e=>{Io(e)}))},Io=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},Po=e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return jt(o,n)},Fo=(e,t,o)=>{const n=(void 0!==o?o.dom:document).defaultView;n&&n.scrollTo(e,t)},zo=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),Vo=e=>{const t=void 0===e?window:e,o=t.document,n=Po(Be.fromDom(o));return(e=>{const t=void 0===e?window:e;return To().browser.isFirefox()?A.none():A.from(t.visualViewport)})(t).fold((()=>{const e=t.document.documentElement,o=e.clientWidth,r=e.clientHeight;return zo(n.left,n.top,o,r)}),(e=>zo(Math.max(e.pageLeft,n.left),Math.max(e.pageTop,n.top),e.width,e.height)))},Zo=()=>Be.fromDom(document),Uo=(e,t)=>e.view(t).fold(w([]),(t=>{const o=e.owner(t),n=Uo(e,o);return[t].concat(n)}));var jo=Object.freeze({__proto__:null,view:e=>{var t;return(e.dom===document?A.none():A.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(Be.fromDom)},owner:e=>Qe(e)});const Wo=e=>{const t=Zo(),o=Po(t),n=((e,t)=>{const o=t.owner(e),n=Uo(t,o);return A.some(n)})(e,jo);return n.fold(S($t,e),(t=>{const n=qt(e),r=Z(t,((e,t)=>{const o=qt(t);return{left:e.left+o.left,top:e.top+o.top}}),{left:0,top:0});return jt(r.left+n.left+o.left,r.top+n.top+o.top)}))},$o=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),qo=e=>{const t=$t(e),o=Yt(e),n=Zt(e);return $o(t.left,t.top,o,n)},Go=e=>{const t=Wo(e),o=Yt(e),n=Zt(e);return $o(t.left,t.top,o,n)},Ko=(e,t)=>{const o=Math.max(e.x,t.x),n=Math.max(e.y,t.y),r=Math.min(e.right,t.right),s=Math.min(e.bottom,t.bottom);return $o(o,n,r-o,s-n)},Yo=()=>Vo(window),Xo=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},Jo=e=>{const t=Xo(A.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(A.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(A.some(e))}}},Qo=()=>Jo((e=>e.unbind())),en=()=>{const e=Jo(v);return{...e,on:t=>e.get().each(t)}};var tn=tinymce.util.Tools.resolve("tinymce.ThemeManager");const on=e=>{const t=t=>t(e),o=w(e),n=()=>r,r={tag:!0,inner:e,fold:(t,o)=>o(e),isValue:O,isError:T,map:t=>rn.value(t(e)),mapError:n,bind:t,exists:t,forall:t,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:t=>{t(e)},toOptional:()=>A.some(e)};return r},nn=e=>{const t=()=>o,o={tag:!1,inner:e,fold:(t,o)=>t(e),isValue:T,isError:O,map:t,mapError:t=>rn.error(t(e)),bind:t,exists:T,forall:O,getOr:x,or:x,getOrThunk:E,orThunk:E,getOrDie:_(String(e)),each:v,toOptional:A.none};return o},rn={value:on,error:nn,fromOption:(e,t)=>e.fold((()=>nn(t)),on)};var sn;!function(e){e[e.Error=0]="Error",e[e.Value=1]="Value"}(sn||(sn={}));const an=(e,t,o)=>e.stype===sn.Error?t(e.serror):o(e.svalue),ln=e=>({stype:sn.Value,svalue:e}),cn=e=>({stype:sn.Error,serror:e}),dn=e=>e.fold(cn,ln),mn=e=>an(e,rn.error,rn.value),un=ln,gn=e=>{const t=[],o=[];return F(e,(e=>{an(e,(e=>o.push(e)),(e=>t.push(e)))})),{values:t,errors:o}},hn=cn,pn=(e,t)=>e.stype===sn.Value?t(e.svalue):e,fn=(e,t)=>e.stype===sn.Error?t(e.serror):e,vn=(e,t)=>e.stype===sn.Value?{stype:sn.Value,svalue:t(e.svalue)}:e,bn=(e,t)=>e.stype===sn.Error?{stype:sn.Error,serror:t(e.serror)}:e,yn=an,wn=(e,t,o,n)=>({tag:"field",key:e,newKey:t,presence:o,prop:n}),xn=(e,t,o)=>{switch(e.tag){case"field":return t(e.key,e.newKey,e.presence,e.prop);case"custom":return o(e.newKey,e.instantiator)}},Cn=e=>(...t)=>{if(0===t.length)throw new Error("Can't merge zero objects");const o={};for(let n=0;ni(e)&&i(t)?Sn(e,t):t)),kn=Cn(((e,t)=>t)),_n=e=>({tag:"defaultedThunk",process:e}),En=e=>_n(w(e)),Tn=e=>({tag:"mergeWithThunk",process:e}),On=e=>y(hn,$)(e),An=e=>{const t=gn(e);return t.errors.length>0?On(t.errors):un(t.values)},Dn=e=>a(e)&&se(e).length>100?" removed due to size":JSON.stringify(e,null,2),Mn=(e,t)=>hn([{path:e,getErrorInfo:t}]),Nn=e=>({extract:(t,o)=>fn(e(o),(e=>((e,t)=>Mn(e,w(t)))(t,e))),toString:w("val")}),Rn=Nn(un),Bn=(e,t,o,n)=>fe(t,o).fold((()=>((e,t,o)=>Mn(e,(()=>'Could not find valid *required* value for "'+t+'" in '+Dn(o))))(e,o,t)),n),Ln=(e,t,o,n)=>n(fe(e,t).getOrThunk((()=>o(e)))),Hn=(e,t,o,n,r)=>{const s=e=>r.extract(t.concat([n]),e),a=e=>e.fold((()=>un(A.none())),(e=>{const o=r.extract(t.concat([n]),e);return vn(o,A.some)}));switch(e.tag){case"required":return Bn(t,o,n,s);case"defaultedThunk":return Ln(o,n,e.process,s);case"option":return((e,t,o)=>o(fe(e,t)))(o,n,a);case"defaultedOptionThunk":return((e,t,o,n)=>n(fe(e,t).map((t=>!0===t?o(e):t))))(o,n,e.process,a);case"mergeWithThunk":return Ln(o,n,w({}),(t=>{const n=Sn(e.process(o),t);return s(n)}))}},In=e=>({extract:(t,o)=>e().extract(t,o),toString:()=>e().toString()}),Pn=e=>se(ue(e,g)),Fn=e=>{const t=zn(e),o=Z(e,((e,t)=>xn(t,(t=>Sn(e,{[t]:!0})),w(e))),{});return{extract:(e,n)=>{const r=d(n)?[]:Pn(n),s=V(r,(e=>!be(o,e)));return 0===s.length?t.extract(e,n):((e,t)=>Mn(e,(()=>"There are unsupported fields: ["+t.join(", ")+"] specified")))(e,s)},toString:t.toString}},zn=e=>({extract:(t,o)=>((e,t,o)=>{const n={},r=[];for(const s of o)xn(s,((o,s,a,i)=>{const l=Hn(a,e,t,o,i);yn(l,(e=>{r.push(...e)}),(e=>{n[s]=e}))}),((e,o)=>{n[e]=o(t)}));return r.length>0?hn(r):un(n)})(t,o,e),toString:()=>{const t=P(e,(e=>xn(e,((e,t,o,n)=>e+" -> "+n.toString()),((e,t)=>"state("+e+")"))));return"obj{\n"+t.join("\n")+"}"}}),Vn=e=>({extract:(t,o)=>{const n=P(o,((o,n)=>e.extract(t.concat(["["+n+"]"]),o)));return An(n)},toString:()=>"array("+e.toString()+")"}),Zn=(e,t)=>{const o=void 0!==t?t:x;return{extract:(t,n)=>{const r=[];for(const s of e){const e=s.extract(t,n);if(e.stype===sn.Value)return{stype:sn.Value,svalue:o(e.svalue)};r.push(e)}return An(r)},toString:()=>"oneOf("+P(e,(e=>e.toString())).join(", ")+")"}},Un=(e,t)=>({extract:(o,n)=>{const r=se(n),s=((t,o)=>Vn(Nn(e)).extract(t,o))(o,r);return pn(s,(e=>{const r=P(e,(e=>wn(e,e,{tag:"required",process:{}},t)));return zn(r).extract(o,n)}))},toString:()=>"setOf("+t.toString()+")"}),jn=y(Vn,zn),Wn=w(Rn),$n=(e,t)=>Nn((o=>{const n=typeof o;return e(o)?un(o):hn(`Expected type: ${t} but got: ${n}`)})),qn=$n(p,"number"),Gn=$n(s,"string"),Kn=$n(d,"boolean"),Yn=$n(h,"function"),Xn=e=>{if(Object(e)!==e)return!0;switch({}.toString.call(e).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(e).every((t=>Xn(e[t])));default:return!1}},Jn=Nn((e=>Xn(e)?un(e):hn("Expected value to be acceptable for sending via postMessage"))),Qn=(e,t,o,n)=>fe(o,n).fold((()=>((e,t,o)=>Mn(e,(()=>'The chosen schema: "'+o+'" did not exist in branches: '+Dn(t))))(e,o,n)),(o=>o.extract(e.concat(["branch: "+n]),t))),er=(e,t)=>({extract:(o,n)=>fe(n,e).fold((()=>((e,t)=>Mn(e,(()=>'Choice schema did not contain choice key: "'+t+'"')))(o,e)),(e=>Qn(o,n,t,e))),toString:()=>"chooseOn("+e+"). Possible values: "+se(t)}),tr=e=>Nn((t=>e(t).fold(hn,un))),or=(e,t)=>Un((t=>dn(e(t))),t),nr=(e,t,o)=>mn(((e,t,o)=>{const n=t.extract([e],o);return bn(n,(e=>({input:o,errors:e})))})(e,t,o)),rr=e=>e.fold((e=>{throw new Error(ar(e))}),x),sr=(e,t,o)=>rr(nr(e,t,o)),ar=e=>"Errors: \n"+(e=>{const t=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:w("... (only showing first ten failures)")}]):e;return P(t,(e=>"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()))})(e.errors).join("\n")+"\n\nInput object: "+Dn(e.input),ir=(e,t)=>er(e,le(t,zn)),lr=(e,t)=>((e,t)=>{const o=Xt(t);return{extract:(e,t)=>o().extract(e,t),toString:()=>o().toString()}})(0,t),cr=wn,dr=(e,t)=>({tag:"custom",newKey:e,instantiator:t}),mr=e=>tr((t=>B(e,t)?rn.value(t):rn.error(`Unsupported value: "${t}", choose one of "${e.join(", ")}".`))),ur=e=>cr(e,e,{tag:"required",process:{}},Wn()),gr=(e,t)=>cr(e,e,{tag:"required",process:{}},t),hr=e=>gr(e,qn),pr=e=>gr(e,Gn),fr=(e,t)=>cr(e,e,{tag:"required",process:{}},mr(t)),vr=e=>gr(e,Yn),br=(e,t)=>cr(e,e,{tag:"required",process:{}},zn(t)),yr=(e,t)=>cr(e,e,{tag:"required",process:{}},jn(t)),wr=(e,t)=>cr(e,e,{tag:"required",process:{}},Vn(t)),xr=e=>cr(e,e,{tag:"option",process:{}},Wn()),Cr=(e,t)=>cr(e,e,{tag:"option",process:{}},t),Sr=e=>Cr(e,qn),kr=e=>Cr(e,Gn),_r=(e,t)=>Cr(e,mr(t)),Er=e=>Cr(e,Yn),Tr=(e,t)=>Cr(e,Vn(t)),Or=(e,t)=>Cr(e,zn(t)),Ar=(e,t)=>cr(e,e,En(t),Wn()),Dr=(e,t,o)=>cr(e,e,En(t),o),Mr=(e,t)=>Dr(e,t,qn),Nr=(e,t)=>Dr(e,t,Gn),Rr=(e,t,o)=>Dr(e,t,mr(o)),Br=(e,t)=>Dr(e,t,Kn),Lr=(e,t)=>Dr(e,t,Yn),Hr=(e,t,o)=>Dr(e,t,Vn(o)),Ir=(e,t,o)=>Dr(e,t,zn(o)),Pr=e=>{if(!l(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],o={};return F(e,((n,r)=>{const s=se(n);if(1!==s.length)throw new Error("one and only one name per case");const a=s[0],i=n[a];if(void 0!==o[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!l(i))throw new Error("case arguments must be an array");t.push(a),o[a]=(...o)=>{const n=o.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+i.length+" ("+i+"), got "+n);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[r].apply(null,o)},match:e=>{const n=se(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));if(!G(t,(e=>B(n,e))))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,o)},log:e=>{console.log(e,{constructors:t,constructor:a,params:o})}}}})),o};Pr([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const Fr=(e,t)=>((e,t)=>{const o={};return ie(e,((e,n)=>{B(t,n)||(o[n]=e)})),o})(e,t),zr=(e,t)=>((e,t)=>({[e]:t}))(e,t),Vr=e=>(e=>{const t={};return F(e,(e=>{t[e.key]=e.value})),t})(e),Zr=(e,t)=>{const o=(e=>{const t=[],o=[];return F(e,(e=>{e.fold((e=>{t.push(e)}),(e=>{o.push(e)}))})),{errors:t,values:o}})(e);return o.errors.length>0?(n=o.errors,rn.error($(n))):((e,t)=>0===e.length?rn.value(t):rn.value(Sn(t,kn.apply(void 0,e))))(o.values,t);var n},Ur=e=>h(e)?e:T,jr=(e,t,o)=>{let n=e.dom;const r=Ur(o);for(;n.parentNode;){n=n.parentNode;const e=Be.fromDom(n),o=t(e);if(o.isSome())return o;if(r(e))break}return A.none()},Wr=(e,t,o)=>{const n=t(e),r=Ur(o);return n.orThunk((()=>r(e)?A.none():jr(e,t,r)))},$r=(e,t)=>Xe(e.element,t.event.target),qr={can:O,abort:T,run:v},Gr=e=>{if(!be(e,"can")&&!be(e,"abort")&&!be(e,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(e,null,2)+" does not have can, abort, or run!");return{...qr,...e}},Kr=e=>{const t=((e,t)=>(...o)=>U(e,((e,n)=>e&&t(n).apply(void 0,o)),!0))(e,(e=>e.can)),o=((e,t)=>(...o)=>U(e,((e,n)=>e||t(n).apply(void 0,o)),!1))(e,(e=>e.abort));return{can:t,abort:o,run:(...t)=>{F(e,(e=>{e.run.apply(void 0,t)}))}}},Yr=w,Xr=Yr("touchstart"),Jr=Yr("touchmove"),Qr=Yr("touchend"),es=Yr("touchcancel"),ts=Yr("mousedown"),os=Yr("mousemove"),ns=Yr("mouseout"),rs=Yr("mouseup"),ss=Yr("mouseover"),as=Yr("focusin"),is=Yr("focusout"),ls=Yr("keydown"),cs=Yr("keyup"),ds=Yr("input"),ms=Yr("change"),us=Yr("click"),gs=Yr("transitioncancel"),hs=Yr("transitionend"),ps=Yr("transitionstart"),fs=Yr("selectstart"),vs=e=>w("alloy."+e),bs={tap:vs("tap")},ys=vs("focus"),ws=vs("blur.post"),xs=vs("paste.post"),Cs=vs("receive"),Ss=vs("execute"),ks=vs("focus.item"),_s=bs.tap,Es=vs("longpress"),Ts=vs("sandbox.close"),Os=vs("typeahead.cancel"),As=vs("system.init"),Ds=vs("system.touchmove"),Ms=vs("system.touchend"),Ns=vs("system.scroll"),Rs=vs("system.resize"),Bs=vs("system.attached"),Ls=vs("system.detached"),Hs=vs("system.dismissRequested"),Is=vs("system.repositionRequested"),Ps=vs("focusmanager.shifted"),Fs=vs("slotcontainer.visibility"),zs=vs("system.external.element.scroll"),Vs=vs("change.tab"),Zs=vs("dismiss.tab"),Us=vs("highlight"),js=vs("dehighlight"),Ws=(e,t)=>{Ks(e,e.element,t,{})},$s=(e,t,o)=>{Ks(e,e.element,t,o)},qs=e=>{Ws(e,Ss())},Gs=(e,t,o)=>{Ks(e,t,o,{})},Ks=(e,t,o,n)=>{const r={target:t,...n};e.getSystem().triggerEvent(o,t,r)},Ys=(e,t,o,n)=>{e.getSystem().triggerEvent(o,t,n.event)},Xs=e=>Vr(e),Js=(e,t)=>({key:e,value:Gr({abort:t})}),Qs=e=>({key:e,value:Gr({run:(e,t)=>{t.event.prevent()}})}),ea=(e,t)=>({key:e,value:Gr({run:t})}),ta=(e,t,o)=>({key:e,value:Gr({run:(e,n)=>{t.apply(void 0,[e,n].concat(o))}})}),oa=e=>t=>({key:e,value:Gr({run:(e,o)=>{$r(e,o)&&t(e,o)}})}),na=(e,t,o)=>((e,t)=>ea(e,((o,n)=>{o.getSystem().getByUid(t).each((t=>{Ys(t,t.element,e,n)}))})))(e,t.partUids[o]),ra=(e,t)=>ea(e,((e,o)=>{const n=o.event,r=e.getSystem().getByDom(n.target).getOrThunk((()=>Wr(n.target,(t=>e.getSystem().getByDom(t).toOptional()),T).getOr(e)));t(e,r,o)})),sa=e=>ea(e,((e,t)=>{t.cut()})),aa=e=>ea(e,((e,t)=>{t.stop()})),ia=(e,t)=>oa(e)(t),la=oa(Bs()),ca=oa(Ls()),da=oa(As()),ma=(e=>t=>ea(e,t))(Ss()),ua=e=>P(e,(e=>Oe(e,"/*")?e.substring(0,e.length-2):e)),ga=(e,t)=>{const o=e.toString(),n=o.indexOf(")")+1,r=o.indexOf("("),s=o.substring(r+1,n-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:t,parameters:ua(s)}),e},ha=e=>({classes:m(e.classes)?[]:e.classes,attributes:m(e.attributes)?{}:e.attributes,styles:m(e.styles)?{}:e.styles}),pa=(e,t,o)=>da(((n,r)=>{o(n,e,t)})),fa=(e,t,o)=>((e,t,o)=>{const n=o.toString(),r=n.indexOf(")")+1,s=n.indexOf("("),a=n.substring(s+1,r-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:t,parameters:ua(a.slice(0,1).concat(a.slice(3)))}),e})(((n,...r)=>{const s=[n].concat(r);return n.config({name:w(e)}).fold((()=>{throw new Error("We could not find any behaviour configuration for: "+e+". Using API: "+o)}),(e=>{const o=Array.prototype.slice.call(s,1);return t.apply(void 0,[n,e.config,e.state].concat(o))}))}),o,t),va=e=>({key:e,value:void 0}),ba=(e,t,o,n,r,s,a)=>{const i=e=>be(e,o)?e[o]():A.none(),l=le(r,((e,t)=>fa(o,e,t))),c={...le(s,((e,t)=>ga(e,t))),...l,revoke:S(va,o),config:t=>{const n=sr(o+"-config",e,t);return{key:o,value:{config:n,me:c,configAsRaw:Xt((()=>sr(o+"-config",e,t))),initialConfig:t,state:a}}},schema:w(t),exhibit:(e,t)=>xe(i(e),fe(n,"exhibit"),((e,o)=>o(t,e.config,e.state))).getOrThunk((()=>ha({}))),name:w(o),handlers:e=>i(e).map((e=>fe(n,"events").getOr((()=>({})))(e.config,e.state))).getOr({})};return c},ya={init:()=>wa({readState:w("No State required")})},wa=e=>e,xa=e=>Vr(e),Ca=Fn([ur("fields"),ur("name"),Ar("active",{}),Ar("apis",{}),Ar("state",ya),Ar("extra",{})]),Sa=e=>{const t=sr("Creating behaviour: "+e.name,Ca,e);return((e,t,o,n,r,s)=>{const a=Fn(e),i=Or(t,[(l="config",c=e,Cr(l,Fn(c)))]);var l,c;return ba(a,i,t,o,n,r,s)})(t.fields,t.name,t.active,t.apis,t.extra,t.state)},ka=Fn([ur("branchKey"),ur("branches"),ur("name"),Ar("active",{}),Ar("apis",{}),Ar("state",ya),Ar("extra",{})]),_a=e=>{const t=sr("Creating behaviour: "+e.name,ka,e);return((e,t,o,n,r,s)=>{const a=e,i=Or(t,[Cr("config",e)]);return ba(a,i,t,o,n,r,s)})(ir(t.branchKey,t.branches),t.name,t.active,t.apis,t.extra,t.state)},Ea=w(void 0),Ta=(e,t)=>{const o=St(e,t);return void 0===o||""===o?[]:o.split(" ")},Oa=e=>void 0!==e.dom.classList,Aa=e=>Ta(e,"class"),Da=(e,t)=>((e,t,o)=>{const n=Ta(e,t).concat([o]);return xt(e,t,n.join(" ")),!0})(e,"class",t),Ma=(e,t)=>((e,t,o)=>{const n=V(Ta(e,t),(e=>e!==o));return n.length>0?xt(e,t,n.join(" ")):Et(e,t),!1})(e,"class",t),Na=(e,t)=>{Oa(e)?e.dom.classList.add(t):Da(e,t)},Ra=e=>{0===(Oa(e)?e.dom.classList:Aa(e)).length&&Et(e,"class")},Ba=(e,t)=>{if(Oa(e)){e.dom.classList.remove(t)}else Ma(e,t);Ra(e)},La=(e,t)=>{const o=Oa(e)?e.dom.classList.toggle(t):((e,t)=>B(Aa(e),t)?Ma(e,t):Da(e,t))(e,t);return Ra(e),o},Ha=(e,t)=>Oa(e)&&e.dom.classList.contains(t),Ia=(e,t)=>{F(t,(t=>{Na(e,t)}))},Pa=(e,t)=>{F(t,(t=>{Ba(e,t)}))},Fa=e=>Oa(e)?(e=>{const t=e.dom.classList,o=new Array(t.length);for(let e=0;e{const s=e=>e+"px";return{position:e,left:t.map(s),top:o.map(s),right:n.map(s),bottom:r.map(s)}},Va=(e,t)=>{Mt(e,(e=>({...e,position:A.some(e.position)}))(t))},Za=e=>(ye(Bt(e,"position"),"fixed")?A.none():st(e)).orThunk((()=>{const t=Be.fromTag("span");return nt(e).bind((e=>{Bo(e,t);const o=st(t);return Io(t),o}))})),Ua=e=>Za(e).map($t).getOrThunk((()=>jt(0,0))),ja=(e,t)=>{const o=e.element;Na(o,t.transitionClass),Ba(o,t.fadeOutClass),Na(o,t.fadeInClass),t.onShow(e)},Wa=(e,t)=>{const o=e.element;Na(o,t.transitionClass),Ba(o,t.fadeInClass),Na(o,t.fadeOutClass),t.onHide(e)},$a=(e,t)=>e.y>=t.y,qa=(e,t)=>e.bottom<=t.bottom,Ga=(e,t,o)=>({location:"top",leftX:t,topY:o.bounds.y-e.y}),Ka=(e,t,o)=>({location:"bottom",leftX:t,bottomY:e.bottom-o.bounds.bottom}),Ya=e=>e.box.x-e.win.x,Xa=(e,t,o)=>o.getInitialPos().map((o=>{const n=((e,t)=>{const o=t.optScrollEnv.fold(w(e.bounds.y),(t=>t.scrollElmTop+(e.bounds.y-t.currentScrollTop)));return jt(e.bounds.x,o)})(o,t);return{box:$o(n.left,n.top,Kt(e),Vt(e)),location:o.location}})),Ja=(e,t,o,n,r)=>{const s=((e,t)=>{const o=t.optScrollEnv.fold(w(e.y),(t=>e.y+t.currentScrollTop-t.scrollElmTop));return jt(e.x,o)})(t,o),a=$o(s.left,s.top,t.width,t.height);n.setInitialPos({style:Lt(e),position:Nt(e,"position")||"static",bounds:a,location:r.location})},Qa=(e,t,o)=>o.getInitialPos().bind((n=>{var r;switch(o.clearInitialPos(),n.position){case"static":return A.some({morph:"static"});case"absolute":const o=Za(e).getOr(bt()),s=qo(o),a=null!==(r=o.dom.scrollTop)&&void 0!==r?r:0;return A.some({morph:"absolute",positionCss:za("absolute",fe(n.style,"left").map((e=>t.x-s.x)),fe(n.style,"top").map((e=>t.y-s.y+a)),fe(n.style,"right").map((e=>s.right-t.right)),fe(n.style,"bottom").map((e=>s.bottom-t.bottom)))});default:return A.none()}})),ei=(e,t,o)=>Xa(e,t,o).filter((({box:e})=>((e,t,o)=>G(e,(e=>{switch(e){case"bottom":return qa(t,o.bounds);case"top":return $a(t,o.bounds)}})))(o.getModes(),e,t))).bind((({box:t})=>Qa(e,t,o))),ti=e=>{switch(e.location){case"top":return A.some({morph:"fixed",positionCss:za("fixed",A.some(e.leftX),A.some(e.topY),A.none(),A.none())});case"bottom":return A.some({morph:"fixed",positionCss:za("fixed",A.some(e.leftX),A.none(),A.none(),A.some(e.bottomY))});default:return A.none()}},oi=(e,t,o)=>{const n=qo(e),r=Yo(),s=((e,t,o)=>{const n=t.win,r=t.box,s=Ya(t);return re(e,(e=>{switch(e){case"bottom":return qa(r,o.bounds)?A.none():A.some(Ka(n,s,o));case"top":return $a(r,o.bounds)?A.none():A.some(Ga(n,s,o));default:return A.none()}})).getOr({location:"no-dock"})})(o.getModes(),{win:r,box:n},t);return"top"===s.location||"bottom"===s.location?(Ja(e,n,t,o,s),ti(s)):A.none()},ni=(e,t,o)=>{const n=e.element;return ye(Bt(n,"position"),"fixed")?((e,t,o)=>ei(e,t,o).orThunk((()=>t.optScrollEnv.bind((n=>Xa(e,t,o))).bind((({box:e,location:o})=>{const n=Yo(),r=Ya({win:n,box:e}),s="top"===o?Ga(n,r,t):Ka(n,r,t);return ti(s)})))))(n,t,o):oi(n,t,o)},ri=(e,t,o,n)=>{const r=qo(e),s=Yo(),a=n(s,Ya({win:s,box:r}),t);return"bottom"===a.location||"top"===a.location?(((e,t,o,n,r)=>{n.getInitialPos().fold((()=>Ja(e,t,o,n,r)),(()=>v))})(e,r,t,o,a),ti(a)):A.none()},si=(e,t,o)=>{o.setDocked(!1),F(["left","right","top","bottom","position"],(t=>It(e.element,t))),t.onUndocked(e)},ai=(e,t,o,n)=>{const r="fixed"===n.position;o.setDocked(r),Va(e.element,n);(r?t.onDocked:t.onUndocked)(e)},ii=(e,t,o,n,r=!1)=>{t.contextual.each((t=>{t.lazyContext(e).each((s=>{const a=((e,t)=>e.yt.y)(s,n.bounds);if(a!==o.isVisible())if(o.setVisible(a),r&&!a)Ia(e.element,[t.fadeOutClass]),t.onHide(e);else{(a?ja:Wa)(e,t)}}))}))},li=(e,t,o,n,r)=>{ii(e,t,o,n,!0),ai(e,t,o,r.positionCss)},ci=(e,t,o)=>{const n=t.lazyViewport(e);ii(e,t,o,n),ni(e,n,o).each((r=>{((e,t,o,n,r)=>{switch(r.morph){case"static":return si(e,t,o);case"absolute":return ai(e,t,o,r.positionCss);case"fixed":li(e,t,o,n,r)}})(e,t,o,n,r)}))},di=(e,t,o)=>{const n=e.element;o.setDocked(!1);const r=t.lazyViewport(e);((e,t,o)=>{const n=e.element;return Xa(n,t,o).bind((({box:e})=>Qa(n,e,o)))})(e,r,o).each((n=>{switch(n.morph){case"static":si(e,t,o);break;case"absolute":ai(e,t,o,n.positionCss)}})),o.setVisible(!0),t.contextual.each((t=>{Pa(n,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(e)})),mi(e,t,o)},mi=(e,t,o)=>{e.getSystem().isConnected()&&ci(e,t,o)},ui=(e,t,o)=>{o.isDocked()&&di(e,t,o)},gi=e=>(t,o,n)=>{const r=o.lazyViewport(t);ri(t.element,r,n,e).each((e=>{li(t,o,n,r,e)}))},hi=gi(Ga),pi=gi(Ka);var fi=Object.freeze({__proto__:null,refresh:mi,reset:ui,isDocked:(e,t,o)=>o.isDocked(),getModes:(e,t,o)=>o.getModes(),setModes:(e,t,o,n)=>o.setModes(n),forceDockToTop:hi,forceDockToBottom:pi});var vi=Object.freeze({__proto__:null,events:(e,t)=>Xs([ia(hs(),((o,n)=>{e.contextual.each((e=>{if(Ha(o.element,e.transitionClass)){Pa(o.element,[e.transitionClass,e.fadeInClass]);(t.isVisible()?e.onShown:e.onHidden)(o)}n.stop()}))})),ea(Ns(),((o,n)=>{mi(o,e,t)})),ea(zs(),((o,n)=>{mi(o,e,t)})),ea(Rs(),((o,n)=>{ui(o,e,t)}))])});const bi=e=>e.dom.innerHTML,yi=(e,t)=>{const o=Qe(e).dom,n=Be.fromDom(o.createDocumentFragment()),r=((e,t)=>{const o=(t||document).createElement("div");return o.innerHTML=e,at(Be.fromDom(o))})(t,o);Lo(n,r),Ho(e),Bo(e,n)},wi=(e,t)=>Be.fromDom(e.dom.cloneNode(t)),xi=e=>{if(mt(e))return"#shadow-root";{const t=(e=>wi(e,!1))(e);return(e=>{const t=Be.fromTag("div"),o=Be.fromDom(e.dom.cloneNode(!0));return Bo(t,o),bi(t)})(t)}},Ci=e=>xi(e),Si="unknown";var ki;!function(e){e[e.STOP=0]="STOP",e[e.NORMAL=1]="NORMAL",e[e.LOGGING=2]="LOGGING"}(ki||(ki={}));const _i=Xo({}),Ei=(e,t,o)=>{switch(fe(_i.get(),e).orThunk((()=>{const t=se(_i.get());return re(t,(t=>e.indexOf(t)>-1?A.some(_i.get()[t]):A.none()))})).getOr(ki.NORMAL)){case ki.NORMAL:return o(Ai());case ki.LOGGING:{const n=((e,t)=>{const o=[],n=(new Date).getTime();return{logEventCut:(e,t,n)=>{o.push({outcome:"cut",target:t,purpose:n})},logEventStopped:(e,t,n)=>{o.push({outcome:"stopped",target:t,purpose:n})},logNoParent:(e,t,n)=>{o.push({outcome:"no-parent",target:t,purpose:n})},logEventNoHandlers:(e,t)=>{o.push({outcome:"no-handlers-left",target:t})},logEventResponse:(e,t,n)=>{o.push({outcome:"response",purpose:n,target:t})},write:()=>{const r=(new Date).getTime();B(["mousemove","mouseover","mouseout",As()],e)||console.log(e,{event:e,time:r-n,target:t.dom,sequence:P(o,(e=>B(["cut","stopped","response"],e.outcome)?"{"+e.purpose+"} "+e.outcome+" at ("+Ci(e.target)+")":e.outcome))})}}})(e,t),r=o(n);return n.write(),r}case ki.STOP:return!0}},Ti=["alloy/data/Fields","alloy/debugging/Debugging"],Oi=(e,t,o)=>Ei(e,t,o),Ai=w({logEventCut:v,logEventStopped:v,logNoParent:v,logEventNoHandlers:v,logEventResponse:v,write:v}),Di=w([ur("menu"),ur("selectedMenu")]),Mi=w([ur("item"),ur("selectedItem")]);w(zn(Mi().concat(Di())));const Ni=w(zn(Mi())),Ri=br("initSize",[ur("numColumns"),ur("numRows")]),Bi=()=>br("markers",[ur("backgroundMenu")].concat(Di()).concat(Mi())),Li=e=>br("markers",P(e,ur)),Hi=(e,t,o)=>((()=>{const e=new Error;if(void 0!==e.stack){const t=e.stack.split("\n");return j(t,(e=>e.indexOf("alloy")>0&&!L(Ti,(t=>e.indexOf(t)>-1)))).getOr(Si)}})(),cr(t,t,o,tr((e=>rn.value(((...t)=>e.apply(void 0,t))))))),Ii=e=>Hi(0,e,En(v)),Pi=e=>Hi(0,e,En(A.none)),Fi=e=>Hi(0,e,{tag:"required",process:{}}),zi=e=>Hi(0,e,{tag:"required",process:{}}),Vi=(e,t)=>dr(e,w(t)),Zi=e=>dr(e,x),Ui=w(Ri);var ji=[Or("contextual",[pr("fadeInClass"),pr("fadeOutClass"),pr("transitionClass"),vr("lazyContext"),Ii("onShow"),Ii("onShown"),Ii("onHide"),Ii("onHidden")]),Lr("lazyViewport",(()=>({bounds:Yo(),optScrollEnv:A.none()}))),Hr("modes",["top","bottom"],Gn),Ii("onDocked"),Ii("onUndocked")];const Wi=Sa({fields:ji,name:"docking",active:vi,apis:fi,state:Object.freeze({__proto__:null,init:e=>{const t=Xo(!1),o=Xo(!0),n=en(),r=Xo(e.modes);return wa({isDocked:t.get,setDocked:t.set,getInitialPos:n.get,setInitialPos:n.set,clearInitialPos:n.clear,isVisible:o.get,setVisible:o.set,getModes:r.get,setModes:r.set,readState:()=>`docked: ${t.get()}, visible: ${o.get()}, modes: ${r.get().join(",")}`})}})}),$i=Xs([((e,t)=>({key:e,value:Gr({can:t})}))(ys(),((e,t)=>{const o=t.event,n=o.originator,r=o.target;return!((e,t,o)=>Xe(t,e.element)&&!Xe(t,o))(e,n,r)||(console.warn(ys()+" did not get interpreted by the desired target. \nOriginator: "+Ci(n)+"\nTarget: "+Ci(r)+"\nCheck the "+ys()+" event handlers"),!1)}))]);var qi=Object.freeze({__proto__:null,events:$i});const Gi=(e,t,o,n)=>{const r=e+t;return r>n?o:rMath.min(Math.max(e,t),o);let Yi=0;const Xi=e=>{const t=(new Date).getTime(),o=Math.floor(window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295*1e9);return Yi++,e+"_"+o+Yi+String(t)},Ji=w("alloy-id-"),Qi=w("data-alloy-id"),el=Ji(),tl=Qi(),ol=(e,t)=>{Object.defineProperty(e.dom,tl,{value:t,writable:!0})},nl=e=>{const t=Ue(e)?e.dom[tl]:null;return A.from(t)},rl=e=>Xi(e),sl=x,al=e=>{const t=t=>`The component must be in a context to execute: ${t}`+(e?"\n"+Ci(e().element)+" is not in context.":""),o=e=>()=>{throw new Error(t(e))},n=e=>()=>{console.warn(t(e))};return{debugInfo:w("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),broadcastEvent:n("broadcastEvent"),build:o("build"),buildOrPatch:o("buildOrPatch"),addToWorld:o("addToWorld"),removeFromWorld:o("removeFromWorld"),addToGui:o("addToGui"),removeFromGui:o("removeFromGui"),getByUid:o("getByUid"),getByDom:o("getByDom"),isConnected:T}},il=al(),ll=Xi("alloy-premade"),cl=e=>(Object.defineProperty(e.element.dom,ll,{value:e.uid,writable:!0}),zr(ll,e)),dl=e=>fe(e,ll),ml=e=>((e,t)=>{const o=t.toString(),n=o.indexOf(")")+1,r=o.indexOf("("),s=o.substring(r+1,n-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:"OVERRIDE",parameters:ua(s.slice(1))}),e})(((t,...o)=>e(t.getApis(),t,...o)),e),ul=(e,t)=>{const o={};return ie(e,((e,n)=>{ie(e,((e,r)=>{const s=fe(o,r).getOr([]);o[r]=s.concat([t(n,e)])}))})),o},gl=e=>e.cHandler,hl=(e,t)=>({name:e,handler:t}),pl=(e,t)=>{const o={};return F(e,(e=>{o[e.name()]=e.handlers(t)})),o},fl=(e,t,o,n)=>{const r=((e,t,o)=>{const n={...o,...pl(t,e)};return ul(n,hl)})(e,o,n);return yl(r,t)},vl=e=>{const t=(e=>h(e)?{can:O,abort:T,run:e}:e)(e);return(e,o,...n)=>{const r=[e,o].concat(n);t.abort.apply(void 0,r)?o.stop():t.can.apply(void 0,r)&&t.run.apply(void 0,r)}},bl=(e,t,o)=>{const n=t[o];return n?((e,t,o,n)=>{try{const r=Q(o,((o,r)=>{const s=o[t],a=r[t],i=n.indexOf(s),l=n.indexOf(a);if(-1===i)throw new Error("The ordering for "+e+" does not have an entry for "+s+".\nOrder specified: "+JSON.stringify(n,null,2));if(-1===l)throw new Error("The ordering for "+e+" does not have an entry for "+a+".\nOrder specified: "+JSON.stringify(n,null,2));return i{const t=P(e,(e=>e.handler));return Kr(t)})):((e,t)=>rn.error(["The event ("+e+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(P(t,(e=>e.name)),null,2)]))(o,e)},yl=(e,t)=>{const o=ge(e,((e,o)=>(1===e.length?rn.value(e[0].handler):bl(e,t,o)).map((n=>{const r=vl(n),s=e.length>1?V(t[o],(t=>L(e,(e=>e.name===t)))).join(" > "):e[0].name;return zr(o,((e,t)=>({handler:e,purpose:t}))(r,s))}))));return Zr(o,{})},wl="alloy.base.behaviour",xl=zn([cr("dom","dom",{tag:"required",process:{}},zn([ur("tag"),Ar("styles",{}),Ar("classes",[]),Ar("attributes",{}),xr("value"),xr("innerHtml")])),ur("components"),ur("uid"),Ar("events",{}),Ar("apis",{}),cr("eventOrder","eventOrder",(e=>Tn(w(e)))({[Ss()]:["disabling",wl,"toggling","typeaheadevents"],[ys()]:[wl,"focusing","keying"],[As()]:[wl,"disabling","toggling","representing","tooltipping"],[ds()]:[wl,"representing","streaming","invalidating"],[Ls()]:[wl,"representing","item-events","toolbar-button-events","tooltipping"],[ts()]:["focusing",wl,"item-type-events"],[Xr()]:["focusing",wl,"item-type-events"],[ss()]:["item-type-events","tooltipping"],[Cs()]:["receiving","reflecting","tooltipping"]}),Wn()),xr("domModification")]),Cl=e=>e.events,Sl=e=>e.dom.value,kl=(e,t)=>{if(void 0===t)throw new Error("Value.set was undefined");e.dom.value=t},_l=(e,t,o)=>{o.fold((()=>Bo(e,t)),(e=>{Xe(e,t)||(Mo(e,t),Io(e))}))},El=(e,t,o)=>{const n=P(t,o),r=at(e);return F(r.slice(n.length),Io),n},Tl=(e,t,o,n)=>{const r=it(e,t),s=n(o,r),a=((e,t,o)=>it(e,t).map((e=>{if(o.exists((t=>!Xe(t,e)))){const t=o.map(ze).getOr("span"),n=Be.fromTag(t);return Mo(e,n),n}return e})))(e,t,r);return _l(e,s.element,a),s},Ol=(e,t)=>{const o=se(e),n=se(t),r=Y(n,o),s=((e,t)=>{const o={},n={};return me(e,t,de(o),de(n)),{t:o,f:n}})(e,((e,o)=>!ve(t,o)||e!==t[o])).t;return{toRemove:r,toSet:s}},Al=(e,t)=>{const{class:o,style:n,...r}=(e=>U(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}))(t),{toSet:s,toRemove:a}=Ol(e.attributes,r),i=Lt(t),{toSet:l,toRemove:c}=Ol(e.styles,i),d=Fa(t),m=Y(d,e.classes),u=Y(e.classes,d);return F(a,(e=>Et(t,e))),Ct(t,s),Ia(t,u),Pa(t,m),F(c,(e=>It(t,e))),Dt(t,l),e.innerHtml.fold((()=>{const o=e.domChildren;((e,t)=>{El(e,t,((t,o)=>{const n=it(e,o);return _l(e,t,n),t}))})(t,o)}),(e=>{yi(t,e)})),(()=>{const o=t,n=e.value.getOrUndefined();n!==Sl(o)&&kl(o,null!=n?n:"")})(),t},Dl=(e,t)=>{const o=t.filter((t=>ze(t)===e.tag&&!(e=>e.innerHtml.isSome()&&e.domChildren.length>0)(e)&&!(e=>ve(e.dom,ll))(t))).bind((t=>((e,t)=>{try{const o=Al(e,t);return A.some(o)}catch(e){return A.none()}})(e,t))).getOrThunk((()=>(e=>{const t=Be.fromTag(e.tag);Ct(t,e.attributes),Ia(t,e.classes),Dt(t,e.styles),e.innerHtml.each((e=>yi(t,e)));const o=e.domChildren;return Lo(t,o),e.value.each((e=>{kl(t,e)})),t})(e)));return ol(o,e.uid),o},Ml=(e,t)=>((e,t)=>{const o=P(t,(e=>Or(e.name(),[ur("config"),Ar("state",ya)]))),n=nr("component.behaviours",zn(o),e.behaviours).fold((t=>{throw new Error(ar(t)+"\nComplete spec:\n"+JSON.stringify(e,null,2))}),x);return{list:t,data:le(n,(e=>{const t=e.map((e=>({config:e.config,state:e.state.init(e.config)})));return w(t)}))}})(e,t),Nl=e=>{const t=(e=>{const t=fe(e,"behaviours").getOr({});return q(se(t),(e=>{const o=t[e];return g(o)?[o.me]:[]}))})(e);return Ml(e,t)},Rl=(e,t,o)=>{const n={...(r=e).dom,uid:r.uid,domChildren:P(r.components,(e=>e.element))};var r;const s=(e=>e.domModification.fold((()=>ha({})),ha))(e),a={"alloy.base.modification":s},i=t.length>0?((e,t,o,n)=>{const r={...t};F(o,(t=>{r[t.name()]=t.exhibit(e,n)}));const s=ul(r,((e,t)=>({name:e,modification:t}))),a=e=>Z(e,((e,t)=>({...t.modification,...e})),{}),i=Z(s.classes,((e,t)=>t.modification.concat(e)),[]),l=a(s.attributes),c=a(s.styles);return ha({classes:i,attributes:l,styles:c})})(o,a,t,n):s;return l=n,c=i,{...l,attributes:{...l.attributes,...c.attributes},styles:{...l.styles,...c.styles},classes:l.classes.concat(c.classes)};var l,c},Bl=(e,t)=>{const o=()=>u,n=Xo(il),r=rr((e=>nr("custom.definition",xl,e))(e)),s=Nl(e),a=(e=>e.list)(s),i=(e=>e.data)(s),l=Rl(r,a,i),c=Dl(l,t),d=((e,t,o)=>{const n={"alloy.base.behaviour":Cl(e)};return fl(o,e.eventOrder,t,n).getOrDie()})(r,a,i),m=Xo(r.components),u={uid:e.uid,getSystem:n.get,config:t=>{const o=i;return(h(o[t.name()])?o[t.name()]:()=>{throw new Error("Could not find "+t.name()+" in "+JSON.stringify(e,null,2))})()},hasConfigured:e=>h(i[e.name()]),spec:e,readState:e=>i[e]().map((e=>e.state.readState())).getOr("not enabled"),getApis:()=>r.apis,connect:e=>{n.set(e)},disconnect:()=>{n.set(al(o))},element:c,syncComponents:()=>{const e=at(c),t=q(e,(e=>n.get().getByDom(e).fold((()=>[]),J)));m.set(t)},components:m.get,events:d};return u},Ll=(e,t)=>{const{events:o,...n}=sl(e),r=((e,t)=>{const o=fe(e,"components").getOr([]);return t.fold((()=>P(o,zl)),(e=>P(o,((t,o)=>Fl(t,it(e,o))))))})(n,t),s={...n,events:{...qi,...o},components:r};return rn.value(Bl(s,t))},Hl=e=>{const t=Be.fromText(e);return Il({element:t})},Il=e=>{const t=sr("external.component",Fn([ur("element"),xr("uid")]),e),o=Xo(al()),n=t.uid.getOrThunk((()=>rl("external")));ol(t.element,n);const r={uid:n,getSystem:o.get,config:A.none,hasConfigured:T,connect:e=>{o.set(e)},disconnect:()=>{o.set(al((()=>r)))},getApis:()=>({}),element:t.element,spec:e,readState:w("No state"),syncComponents:v,components:w([]),events:{}};return cl(r)},Pl=rl,Fl=(e,t)=>dl(e).getOrThunk((()=>{const o=(e=>ve(e,"uid"))(e)?e:{uid:Pl(""),...e};return Ll(o,t).getOrDie()})),zl=e=>Fl(e,A.none()),Vl=cl;var Zl=(e,t,o,n,r)=>e(o,n)?A.some(o):h(r)&&r(o)?A.none():t(o,n,r);const Ul=(e,t,o)=>{let n=e.dom;const r=h(o)?o:T;for(;n.parentNode;){n=n.parentNode;const e=Be.fromDom(n);if(t(e))return A.some(e);if(r(e))break}return A.none()},jl=(e,t,o)=>Zl(((e,t)=>t(e)),Ul,e,t,o),Wl=(e,t)=>j(e.dom.childNodes,(e=>t(Be.fromDom(e)))).map(Be.fromDom),$l=(e,t,o)=>jl(e,t,o).isSome(),ql=(e,t,o)=>Ul(e,(e=>Ge(e,t)),o),Gl=(e,t)=>((e,t)=>{const o=e.dom;return o.parentNode?Wl(Be.fromDom(o.parentNode),(o=>!Xe(e,o)&&t(o))):A.none()})(e,(e=>Ge(e,t))),Kl=(e,t)=>Wl(e,(e=>Ge(e,t))),Yl=(e,t)=>Ye(t,e),Xl=(e,t,o)=>Zl(((e,t)=>Ge(e,t)),ql,e,t,o),Jl="aria-controls",Ql=()=>{const e=Xi(Jl);return{id:e,link:t=>{xt(t,Jl,e)},unlink:e=>{Et(e,Jl)}}},ec=(e,t)=>(e=>jl(e,(e=>{if(!Ue(e))return!1;const t=St(e,"id");return void 0!==t&&t.indexOf(Jl)>-1})).bind((e=>{const t=St(e,"id"),o=ut(e);return Yl(o,`[${Jl}="${t}"]`)})))(t).exists((t=>tc(e,t))),tc=(e,t)=>$l(t,(t=>Xe(t,e.element)),T)||ec(e,t),oc=(e,t,o,n,r,s,a,i=!1)=>({x:e,y:t,bubble:o,direction:n,placement:r,restriction:s,label:`${a}-${r}`,alwaysFit:i}),nc=Pr([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),rc=nc.southeast,sc=nc.southwest,ac=nc.northeast,ic=nc.northwest,lc=nc.south,cc=nc.north,dc=nc.east,mc=nc.west,uc=(e,t)=>X(["left","right","top","bottom"],(o=>fe(t,o).map((t=>((e,t)=>{switch(t){case 1:return e.x;case 0:return e.x+e.width;case 2:return e.y;case 3:return e.y+e.height}})(e,t))))),gc="layout",hc=e=>e.x,pc=(e,t)=>e.x+e.width/2-t.width/2,fc=(e,t)=>e.x+e.width-t.width,vc=(e,t)=>e.y-t.height,bc=e=>e.y+e.height,yc=(e,t)=>e.y+e.height/2-t.height/2,wc=(e,t,o)=>oc(hc(e),bc(e),o.southeast(),rc(),"southeast",uc(e,{left:1,top:3}),gc),xc=(e,t,o)=>oc(fc(e,t),bc(e),o.southwest(),sc(),"southwest",uc(e,{right:0,top:3}),gc),Cc=(e,t,o)=>oc(hc(e),vc(e,t),o.northeast(),ac(),"northeast",uc(e,{left:1,bottom:2}),gc),Sc=(e,t,o)=>oc(fc(e,t),vc(e,t),o.northwest(),ic(),"northwest",uc(e,{right:0,bottom:2}),gc),kc=(e,t,o)=>oc(pc(e,t),vc(e,t),o.north(),cc(),"north",uc(e,{bottom:2}),gc),_c=(e,t,o)=>oc(pc(e,t),bc(e),o.south(),lc(),"south",uc(e,{top:3}),gc),Ec=(e,t,o)=>oc((e=>e.x+e.width)(e),yc(e,t),o.east(),dc(),"east",uc(e,{left:0}),gc),Tc=(e,t,o)=>oc(((e,t)=>e.x-t.width)(e,t),yc(e,t),o.west(),mc(),"west",uc(e,{right:1}),gc),Oc=()=>[wc,xc,Cc,Sc,_c,kc,Ec,Tc],Ac=()=>[xc,wc,Sc,Cc,_c,kc,Ec,Tc],Dc=()=>[Cc,Sc,wc,xc,kc,_c],Mc=()=>[Sc,Cc,xc,wc,kc,_c],Nc=()=>[wc,xc,Cc,Sc,_c,kc],Rc=()=>[xc,wc,Sc,Cc,_c,kc];var Bc=Object.freeze({__proto__:null,events:e=>Xs([ea(Cs(),((t,o)=>{const n=e.channels,r=se(n),s=o,a=((e,t)=>t.universal?e:V(e,(e=>B(t.channels,e))))(r,s);F(a,(e=>{const o=n[e],r=o.schema,a=sr("channel["+e+"] data\nReceiver: "+Ci(t.element),r,s.data);o.onReceive(t,a)}))}))])}),Lc=[gr("channels",or(rn.value,Fn([Fi("onReceive"),Ar("schema",Wn())])))];const Hc=Sa({fields:Lc,name:"receiving",active:Bc});var Ic=Object.freeze({__proto__:null,exhibit:(e,t)=>ha({classes:[],styles:t.useFixed()?{}:{position:"relative"}})});const Pc=(e,t=!1)=>e.dom.focus({preventScroll:t}),Fc=e=>e.dom.blur(),zc=e=>{const t=ut(e).dom;return e.dom===t.activeElement},Vc=(e=Zo())=>A.from(e.dom.activeElement).map(Be.fromDom),Zc=e=>Vc(ut(e)).filter((t=>e.dom.contains(t.dom))),Uc=(e,t)=>{const o=ut(t),n=Vc(o).bind((e=>{const o=t=>Xe(e,t);return o(t)?A.some(t):((e,t)=>{const o=e=>{for(let n=0;n{Vc(o).filter((t=>Xe(t,e))).fold((()=>{Pc(e)}),v)})),r},jc=Pr([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Wc=(e,t,o,n,r,s)=>{const a=t.rect,i=a.x-o,l=a.y-n,c=r-(i+a.width),d=s-(l+a.height),m=A.some(i),u=A.some(l),g=A.some(c),h=A.some(d),p=A.none();return((e,t,o,n,r,s,a,i,l)=>e.fold(t,o,n,r,s,a,i,l))(t.direction,(()=>za(e,m,u,p,p)),(()=>za(e,p,u,g,p)),(()=>za(e,m,p,p,h)),(()=>za(e,p,p,g,h)),(()=>za(e,m,u,p,p)),(()=>za(e,m,p,p,h)),(()=>za(e,m,u,p,p)),(()=>za(e,p,u,g,p)))},$c=(e,t)=>e.fold((()=>{const e=t.rect;return za("absolute",A.some(e.x),A.some(e.y),A.none(),A.none())}),((e,o,n,r)=>Wc("absolute",t,e,o,n,r)),((e,o,n,r)=>Wc("fixed",t,e,o,n,r))),qc=(e,t)=>{const o=S(Wo,t),n=e.fold(o,o,(()=>{const e=Po();return Wo(t).translate(-e.left,-e.top)})),r=Yt(t),s=Zt(t);return $o(n.left,n.top,r,s)},Gc=(e,t)=>t.fold((()=>e.fold(Yo,Yo,$o)),(t=>e.fold(w(t),w(t),(()=>{const o=Kc(e,t.x,t.y);return $o(o.left,o.top,t.width,t.height)})))),Kc=(e,t,o)=>{const n=jt(t,o);return e.fold(w(n),w(n),(()=>{const e=Po();return n.translate(-e.left,-e.top)}))};jc.none;const Yc=jc.relative,Xc=jc.fixed,Jc=(e,t)=>((e,t)=>({anchorBox:e,origin:t}))(e,t),Qc="data-alloy-placement",ed=e=>kt(e,Qc),td=Pr([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),od=(e,t,o,n)=>{const r=e.bubble,s=r.offset,a=((e,t,o)=>{const n=(n,r)=>t[n].map((t=>{const s="top"===n||"bottom"===n,a=s?o.top:o.left,i=("left"===n||"top"===n?Math.max:Math.min)(t,r)+a;return s?Ki(i,e.y,e.bottom):Ki(i,e.x,e.right)})).getOr(r),r=n("left",e.x),s=n("top",e.y),a=n("right",e.right),i=n("bottom",e.bottom);return $o(r,s,a-r,i-s)})(n,e.restriction,s),i=e.x+s.left,l=e.y+s.top,c=$o(i,l,t,o),{originInBounds:d,sizeInBounds:m,visibleW:u,visibleH:g}=((e,t)=>{const{x:o,y:n,right:r,bottom:s}=t,{x:a,y:i,right:l,bottom:c,width:d,height:m}=e;return{originInBounds:a>=o&&a<=r&&i>=n&&i<=s,sizeInBounds:l<=r&&l>=o&&c<=s&&c>=n,visibleW:Math.min(d,a>=o?r-a:l-o),visibleH:Math.min(m,i>=n?s-i:c-n)}})(c,a),h=d&&m,p=h?c:((e,t)=>{const{x:o,y:n,right:r,bottom:s}=t,{x:a,y:i,width:l,height:c}=e,d=Math.max(o,r-l),m=Math.max(n,s-c),u=Ki(a,o,d),g=Ki(i,n,m),h=Math.min(u+l,r)-u,p=Math.min(g+c,s)-g;return $o(u,g,h,p)})(c,a),f=p.width>0&&p.height>0,{maxWidth:v,maxHeight:b}=((e,t,o)=>{const n=w(t.bottom-o.y),r=w(o.bottom-t.y),s=((e,t,o,n)=>e.fold(t,t,n,n,t,n,o,o))(e,r,r,n),a=w(t.right-o.x),i=w(o.right-t.x),l=((e,t,o,n)=>e.fold(t,n,t,n,o,o,t,n))(e,i,i,a);return{maxWidth:l,maxHeight:s}})(e.direction,p,n),y={rect:p,maxHeight:b,maxWidth:v,direction:e.direction,placement:e.placement,classes:{on:r.classesOn,off:r.classesOff},layout:e.label,testY:l};return h||e.alwaysFit?td.fit(y):td.nofit(y,u,g,f)},nd=O,rd=(e,t,o)=>((e,t,o,n)=>Ao(e,t,o,n,!1))(e,t,nd,o),sd=(e,t,o)=>((e,t,o,n)=>Ao(e,t,o,n,!0))(e,t,nd,o),ad=Oo,id=["top","bottom","right","left"],ld="data-alloy-transition-timer",cd=(e,t)=>((e,t)=>G(t,(t=>Ha(e,t))))(e,t.classes),dd=(e,t)=>{const o=e=>parseFloat(e).toFixed(3);return he(t,((t,n)=>!((e,t,o=C)=>xe(e,t,o).getOr(e.isNone()&&t.isNone()))(e[n].map(o),t.map(o)))).isSome()},md=(e,t)=>{const o=Qo(),n=Qo();let r;const a=t=>{var o;const n=null!==(o=t.raw.pseudoElement)&&void 0!==o?o:"";return Xe(t.target,e)&&Me(n)&&B(id,t.raw.propertyName)},i=s=>{if(u(s)||a(s)){o.clear(),n.clear();const a=null==s?void 0:s.raw.type;(u(a)||a===hs())&&(clearTimeout(r),Et(e,ld),Pa(e,t.classes))}},l=rd(e,ps(),(t=>{a(t)&&(l.unbind(),o.set(rd(e,hs(),i)),n.set(rd(e,gs(),i)))})),c=(e=>{const t=t=>{const o=Nt(e,t).split(/\s*,\s*/);return V(o,De)},o=e=>{if(s(e)&&/^[\d.]+/.test(e)){const t=parseFloat(e);return Oe(e,"ms")?t:1e3*t}return 0},n=t("transition-delay"),r=t("transition-duration");return U(r,((e,t,r)=>{const s=o(n[r])+o(t);return Math.max(e,s)}),0)})(e);requestAnimationFrame((()=>{r=setTimeout(i,c+17),xt(e,ld,r)}))},ud=(e,t,o,n,r,s)=>{const a=((e,t,o)=>o.exists((o=>{const n=e.mode;return"all"===n||o[n]!==t[n]})))(n,r,s);if(a||cd(e,n)){At(e,"position",o.position);const s=qc(t,e),i=$c(t,{...r,rect:s}),l=X(id,(e=>i[e]));dd(o,l)&&(Mt(e,l),a&&((e,t)=>{Ia(e,t.classes),kt(e,ld).each((t=>{clearTimeout(parseInt(t,10)),Et(e,ld)})),md(e,t)})(e,n),Pt(e))}else Pa(e,n.classes)},gd=(e,t,o,n)=>{It(t,"max-height"),It(t,"max-width");const r={width:Yt(s=t),height:Zt(s)};var s;return((e,t,o,n,r,s)=>{const a=n.width,i=n.height,l=(t,l,c,d,m)=>{const u=t(o,n,r,e,s),g=od(u,a,i,s);return g.fold(w(g),((e,t,o,n)=>(m===n?o>d||t>c:!m&&n)?g:td.nofit(l,c,d,m)))},c=U(t,((e,t)=>{const o=S(l,t);return e.fold(w(e),o)}),td.nofit({rect:o,maxHeight:n.height,maxWidth:n.width,direction:rc(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:o.y},-1,-1,!1));return c.fold(x,x)})(t,n.preference,e,r,o,n.bounds)},hd=(e,t)=>{((e,t)=>{xt(e,Qc,t)})(e,t.placement)},pd=(e,t)=>{((e,t)=>{const o=zt.max(e,t,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);At(e,"max-height",o+"px")})(e,Math.floor(t))},fd=w(((e,t)=>{pd(e,t),Dt(e,{"overflow-x":"hidden","overflow-y":"auto"})})),vd=w(((e,t)=>{pd(e,t)})),bd=(e,t,o)=>void 0===e[t]?o:e[t],yd=(e,t,o,n)=>{const r=gd(e,t,o,n);return((e,t,o)=>{const n=$c(o.origin,t);o.transition.each((r=>{ud(e,o.origin,n,r,t,o.lastPlacement)})),Va(e,n)})(t,r,n),hd(t,r),((e,t)=>{const o=t.classes;Pa(e,o.off),Ia(e,o.on)})(t,r),((e,t,o)=>{(0,o.maxHeightFunction)(e,t.maxHeight)})(t,r,n),((e,t,o)=>{(0,o.maxWidthFunction)(e,t.maxWidth)})(t,r,n),{layout:r.layout,placement:r.placement}},wd=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],xd=(e,t,o,n=1)=>{const r=e*n,s=t*n,a=e=>fe(o,e).getOr([]),i=(e,t,o)=>{const n=Y(wd,o);return{offset:jt(e,t),classesOn:q(o,a),classesOff:q(n,a)}};return{southeast:()=>i(-e,t,["top","alignLeft"]),southwest:()=>i(e,t,["top","alignRight"]),south:()=>i(-e/2,t,["top","alignCentre"]),northeast:()=>i(-e,-t,["bottom","alignLeft"]),northwest:()=>i(e,-t,["bottom","alignRight"]),north:()=>i(-e/2,-t,["bottom","alignCentre"]),east:()=>i(e,-t/2,["valignCentre","left"]),west:()=>i(-e,-t/2,["valignCentre","right"]),insetNortheast:()=>i(r,s,["top","alignLeft","inset"]),insetNorthwest:()=>i(-r,s,["top","alignRight","inset"]),insetNorth:()=>i(-r/2,s,["top","alignCentre","inset"]),insetSoutheast:()=>i(r,-s,["bottom","alignLeft","inset"]),insetSouthwest:()=>i(-r,-s,["bottom","alignRight","inset"]),insetSouth:()=>i(-r/2,-s,["bottom","alignCentre","inset"]),insetEast:()=>i(-r,-s/2,["valignCentre","right","inset"]),insetWest:()=>i(r,-s/2,["valignCentre","left","inset"])}},Cd=()=>xd(0,0,{}),Sd=x,kd=(e,t)=>o=>"rtl"===_d(o)?t:e,_d=e=>"rtl"===Nt(e,"direction")?"rtl":"ltr";var Ed;!function(e){e.TopToBottom="toptobottom",e.BottomToTop="bottomtotop"}(Ed||(Ed={}));const Td="data-alloy-vertical-dir",Od=e=>$l(e,(e=>Ue(e)&&St(e,"data-alloy-vertical-dir")===Ed.BottomToTop)),Ad=()=>Or("layouts",[ur("onLtr"),ur("onRtl"),xr("onBottomLtr"),xr("onBottomRtl")]),Dd=(e,t,o,n,r,s,a)=>{const i=a.map(Od).getOr(!1),l=t.layouts.map((t=>t.onLtr(e))),c=t.layouts.map((t=>t.onRtl(e))),d=i?t.layouts.bind((t=>t.onBottomLtr.map((t=>t(e))))).or(l).getOr(r):l.getOr(o),m=i?t.layouts.bind((t=>t.onBottomRtl.map((t=>t(e))))).or(c).getOr(s):c.getOr(n);return kd(d,m)(e)};var Md=[ur("hotspot"),xr("bubble"),Ar("overrides",{}),Ad(),Vi("placement",((e,t,o)=>{const n=t.hotspot,r=qc(o,n.element),s=Dd(e.element,t,Nc(),Rc(),Dc(),Mc(),A.some(t.hotspot.element));return A.some(Sd({anchorBox:r,bubble:t.bubble.getOr(Cd()),overrides:t.overrides,layouts:s}))}))];var Nd=[ur("x"),ur("y"),Ar("height",0),Ar("width",0),Ar("bubble",Cd()),Ar("overrides",{}),Ad(),Vi("placement",((e,t,o)=>{const n=Kc(o,t.x,t.y),r=$o(n.left,n.top,t.width,t.height),s=Dd(e.element,t,Oc(),Ac(),Oc(),Ac(),A.none());return A.some(Sd({anchorBox:r,bubble:t.bubble,overrides:t.overrides,layouts:s}))}))];const Rd=Pr([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Bd=e=>e.fold(x,((e,t,o)=>e.translate(-t,-o))),Ld=e=>e.fold(x,x),Hd=e=>U(e,((e,t)=>e.translate(t.left,t.top)),jt(0,0)),Id=e=>{const t=P(e,Ld);return Hd(t)},Pd=Rd.screen,Fd=Rd.absolute,zd=(e,t,o)=>{const n=Qe(e.element),r=Po(n),s=((e,t,o)=>{const n=ot(o.root).dom;return A.from(n.frameElement).map(Be.fromDom).filter((t=>{const o=Qe(t),n=Qe(e.element);return Xe(o,n)})).map($t)})(e,0,o).getOr(r);return Fd(s,r.left,r.top)},Vd=(e,t,o,n)=>{const r=Pd(jt(e,t));return A.some(((e,t,o)=>({point:e,width:t,height:o}))(r,o,n))},Zd=(e,t,o,n,r)=>e.map((e=>{const s=[t,e.point],a=(i=()=>Id(s),l=()=>Id(s),c=()=>(e=>{const t=P(e,Bd);return Hd(t)})(s),n.fold(i,l,c));var i,l,c;const d=((e,t,o,n)=>({x:e,y:t,width:o,height:n}))(a.left,a.top,e.width,e.height),m=o.showAbove?Dc():Nc(),u=o.showAbove?Mc():Rc(),g=Dd(r,o,m,u,m,u,A.none());return Sd({anchorBox:d,bubble:o.bubble.getOr(Cd()),overrides:o.overrides,layouts:g})}));var Ud=[ur("node"),ur("root"),xr("bubble"),Ad(),Ar("overrides",{}),Ar("showAbove",!1),Vi("placement",((e,t,o)=>{const n=zd(e,0,t);return t.node.filter(vt).bind((r=>{const s=r.dom.getBoundingClientRect(),a=Vd(s.left,s.top,s.width,s.height),i=t.node.getOr(e.element);return Zd(a,n,t,o,i)}))}))];const jd=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n}),Wd=Pr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),$d=(Wd.before,Wd.on,Wd.after,e=>e.fold(x,x,x)),qd=Pr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Gd={domRange:qd.domRange,relative:qd.relative,exact:qd.exact,exactFromRange:e=>qd.exact(e.start,e.soffset,e.finish,e.foffset),getWin:e=>{const t=(e=>e.match({domRange:e=>Be.fromDom(e.startContainer),relative:(e,t)=>$d(e),exact:(e,t,o,n)=>e}))(e);return ot(t)},range:jd},Kd=(e,t,o)=>{const n=e.document.createRange();var r;return r=n,t.fold((e=>{r.setStartBefore(e.dom)}),((e,t)=>{r.setStart(e.dom,t)}),(e=>{r.setStartAfter(e.dom)})),((e,t)=>{t.fold((t=>{e.setEndBefore(t.dom)}),((t,o)=>{e.setEnd(t.dom,o)}),(t=>{e.setEndAfter(t.dom)}))})(n,o),n},Yd=(e,t,o,n,r)=>{const s=e.document.createRange();return s.setStart(t.dom,o),s.setEnd(n.dom,r),s},Xd=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}),Jd=Pr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Qd=(e,t,o)=>t(Be.fromDom(o.startContainer),o.startOffset,Be.fromDom(o.endContainer),o.endOffset),em=(e,t)=>{const o=((e,t)=>t.match({domRange:e=>({ltr:w(e),rtl:A.none}),relative:(t,o)=>({ltr:Xt((()=>Kd(e,t,o))),rtl:Xt((()=>A.some(Kd(e,o,t))))}),exact:(t,o,n,r)=>({ltr:Xt((()=>Yd(e,t,o,n,r))),rtl:Xt((()=>A.some(Yd(e,n,r,t,o))))})}))(e,t);return((e,t)=>{const o=t.ltr();if(o.collapsed)return t.rtl().filter((e=>!1===e.collapsed)).map((e=>Jd.rtl(Be.fromDom(e.endContainer),e.endOffset,Be.fromDom(e.startContainer),e.startOffset))).getOrThunk((()=>Qd(0,Jd.ltr,o)));return Qd(0,Jd.ltr,o)})(0,o)},tm=(e,t)=>em(e,t).match({ltr:(t,o,n,r)=>{const s=e.document.createRange();return s.setStart(t.dom,o),s.setEnd(n.dom,r),s},rtl:(t,o,n,r)=>{const s=e.document.createRange();return s.setStart(n.dom,r),s.setEnd(t.dom,o),s}});Jd.ltr,Jd.rtl;const om=(e,t,o)=>V(((e,t)=>{const o=h(t)?t:T;let n=e.dom;const r=[];for(;null!==n.parentNode&&void 0!==n.parentNode;){const e=n.parentNode,t=Be.fromDom(e);if(r.push(t),!0===o(t))break;n=e}return r})(e,o),t),nm=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return Ke(o)?[]:P(o.querySelectorAll(e),Be.fromDom)})(t,e),rm=(e,t,o,n)=>{const r=((e,t,o,n)=>{const r=Qe(e).dom.createRange();return r.setStart(e.dom,t),r.setEnd(o.dom,n),r})(e,t,o,n),s=Xe(e,o)&&t===n;return r.collapsed&&!s},sm=e=>{if(e.rangeCount>0){const t=e.getRangeAt(0),o=e.getRangeAt(e.rangeCount-1);return A.some(jd(Be.fromDom(t.startContainer),t.startOffset,Be.fromDom(o.endContainer),o.endOffset))}return A.none()},am=e=>{if(null===e.anchorNode||null===e.focusNode)return sm(e);{const t=Be.fromDom(e.anchorNode),o=Be.fromDom(e.focusNode);return rm(t,e.anchorOffset,o,e.focusOffset)?A.some(jd(t,e.anchorOffset,o,e.focusOffset)):sm(e)}},im=e=>(e=>A.from(e.getSelection()))(e).filter((e=>e.rangeCount>0)).bind(am),lm=(e,t)=>(e=>{const t=e.getClientRects(),o=t.length>0?t[0]:e.getBoundingClientRect();return o.width>0||o.height>0?A.some(o).map(Xd):A.none()})(tm(e,t)),cm=(e,t)=>(e=>{const t=e.getBoundingClientRect();return t.width>0||t.height>0?A.some(t).map(Xd):A.none()})(tm(e,t)),dm=((e,t)=>{const o=t=>e(t)?A.from(t.dom.nodeValue):A.none();return{get:n=>{if(!e(n))throw new Error("Can only get "+t+" value of a "+t+" node");return o(n).getOr("")},getOption:o,set:(o,n)=>{if(!e(o))throw new Error("Can only set raw "+t+" value of a "+t+" node");o.dom.nodeValue=n}}})(je,"text"),mm=(e,t)=>({element:e,offset:t}),um=(e,t)=>{const o=at(e);if(0===o.length)return mm(e,t);if(tdm.get(e))(e).length:at(e).length;return mm(e,t)}},gm=(e,t)=>je(e)?mm(e,t):um(e,t),hm=e=>void 0!==e.foffset,pm=(e,t)=>t.getSelection.getOrThunk((()=>()=>im(e)))().map((e=>{if(hm(e)){const t=gm(e.start,e.soffset),o=gm(e.finish,e.foffset);return Gd.range(t.element,t.offset,o.element,o.offset)}return e}));var fm=[xr("getSelection"),ur("root"),xr("bubble"),Ad(),Ar("overrides",{}),Ar("showAbove",!1),Vi("placement",((e,t,o)=>{const n=ot(t.root).dom,r=zd(e,0,t),s=pm(n,t).bind((e=>{if(hm(e)){const t=cm(n,Gd.exactFromRange(e)).orThunk((()=>{const t=Be.fromText("\ufeff");Mo(e.start,t);const o=lm(n,Gd.exact(t,0,t,1));return Io(t),o}));return t.bind((e=>Vd(e.left,e.top,e.width,e.height)))}{const t=le(e,(e=>e.dom.getBoundingClientRect())),o={left:Math.min(t.firstCell.left,t.lastCell.left),right:Math.max(t.firstCell.right,t.lastCell.right),top:Math.min(t.firstCell.top,t.lastCell.top),bottom:Math.max(t.firstCell.bottom,t.lastCell.bottom)};return Vd(o.left,o.top,o.right-o.left,o.bottom-o.top)}})),a=pm(n,t).bind((e=>hm(e)?Ue(e.start)?A.some(e.start):rt(e.start):A.some(e.firstCell))).getOr(e.element);return Zd(s,r,t,o,a)}))];const vm="link-layout",bm=e=>e.x+e.width,ym=(e,t)=>e.x-t.width,wm=(e,t)=>e.y-t.height+e.height,xm=e=>e.y,Cm=(e,t,o)=>oc(bm(e),xm(e),o.southeast(),rc(),"southeast",uc(e,{left:0,top:2}),vm),Sm=(e,t,o)=>oc(ym(e,t),xm(e),o.southwest(),sc(),"southwest",uc(e,{right:1,top:2}),vm),km=(e,t,o)=>oc(bm(e),wm(e,t),o.northeast(),ac(),"northeast",uc(e,{left:0,bottom:3}),vm),_m=(e,t,o)=>oc(ym(e,t),wm(e,t),o.northwest(),ic(),"northwest",uc(e,{right:1,bottom:3}),vm),Em=()=>[Cm,Sm,km,_m],Tm=()=>[Sm,Cm,_m,km];var Om=[ur("item"),Ad(),Ar("overrides",{}),Vi("placement",((e,t,o)=>{const n=qc(o,t.item.element),r=Dd(e.element,t,Em(),Tm(),Em(),Tm(),A.none());return A.some(Sd({anchorBox:n,bubble:Cd(),overrides:t.overrides,layouts:r}))}))],Am=ir("type",{selection:fm,node:Ud,hotspot:Md,submenu:Om,makeshift:Nd});const Dm=[wr("classes",Gn),Rr("mode","all",["all","layout","placement"])],Mm=[Ar("useFixed",T),xr("getBounds")],Nm=[gr("anchor",Am),Or("transition",Dm)],Rm=(e,t,o,n,r,s)=>((e,t,o,n,r,s,a,i)=>{const l=bd(a,"maxHeightFunction",fd()),c=bd(a,"maxWidthFunction",v),d=e.anchorBox,m=e.origin,u={bounds:Gc(m,s),origin:m,preference:n,maxHeightFunction:l,maxWidthFunction:c,lastPlacement:r,transition:i};return yd(d,t,o,u)})(Jc(t.anchorBox,e),n.element,t.bubble,t.layouts,r,o,t.overrides,s),Bm=(e,t,o,n,r,s)=>{const a=sr("placement.info",zn(Nm),r),i=a.anchor,l=n.element,c=o.get(n.uid);Uc((()=>{At(l,"position","fixed");const r=Bt(l,"visibility");At(l,"visibility","hidden");const d=t.useFixed()?(()=>{const e=document.documentElement;return Xc(0,0,e.clientWidth,e.clientHeight)})():(e=>{const t=$t(e.element),o=e.element.dom.getBoundingClientRect();return Yc(t.left,t.top,o.width,o.height)})(e);i.placement(e,i,d).each((e=>{const r=s.orThunk((()=>t.getBounds.map(E))),i=Rm(d,e,r,n,c,a.transition);o.set(n.uid,i)})),r.fold((()=>{It(l,"visibility")}),(e=>{At(l,"visibility",e)})),Bt(l,"left").isNone()&&Bt(l,"top").isNone()&&Bt(l,"right").isNone()&&Bt(l,"bottom").isNone()&&ye(Bt(l,"position"),"fixed")&&It(l,"position")}),l)};var Lm=Object.freeze({__proto__:null,position:(e,t,o,n,r)=>{const s=A.none();Bm(e,t,o,n,r,s)},positionWithinBounds:Bm,getMode:(e,t,o)=>t.useFixed()?"fixed":"absolute",reset:(e,t,o,n)=>{const r=n.element;F(["position","left","right","top","bottom"],(e=>It(r,e))),(e=>{Et(e,Qc)})(r),o.clear(n.uid)}});const Hm=Sa({fields:Mm,name:"positioning",active:Ic,apis:Lm,state:Object.freeze({__proto__:null,init:()=>{let e={};return wa({readState:()=>e,clear:t=>{g(t)?delete e[t]:e={}},set:(t,o)=>{e[t]=o},get:t=>fe(e,t)})}})}),Im=e=>e.getSystem().isConnected(),Pm=e=>{Ws(e,Ls());const t=e.components();F(t,Pm)},Fm=e=>{const t=e.components();F(t,Fm),Ws(e,Bs())},zm=(e,t)=>{e.getSystem().addToWorld(t),vt(e.element)&&Fm(t)},Vm=e=>{Pm(e),e.getSystem().removeFromWorld(e)},Zm=(e,t)=>{Bo(e.element,t.element)},Um=(e,t,o)=>{const n=e.components();(e=>{F(e.components(),(e=>Io(e.element))),Ho(e.element),e.syncComponents()})(e);const r=o(t),s=Y(n,r);F(s,(t=>{Pm(t),e.getSystem().removeFromWorld(t)})),F(r,(t=>{Im(t)?Zm(e,t):(e.getSystem().addToWorld(t),Zm(e,t),vt(e.element)&&Fm(t))})),e.syncComponents()},jm=(e,t)=>{Wm(e,t,Bo)},Wm=(e,t,o)=>{e.getSystem().addToWorld(t),o(e.element,t.element),vt(e.element)&&Fm(t),e.syncComponents()},$m=e=>{Pm(e),Io(e.element),e.getSystem().removeFromWorld(e)},qm=e=>{const t=nt(e.element).bind((t=>e.getSystem().getByDom(t).toOptional()));$m(e),t.each((e=>{e.syncComponents()}))},Gm=e=>{const t=e.components();F(t,$m),Ho(e.element),e.syncComponents()},Km=(e,t)=>{Xm(e,t,Bo)},Ym=(e,t)=>{Xm(e,t,No)},Xm=(e,t,o)=>{o(e,t.element);const n=at(t.element);F(n,(e=>{t.getByDom(e).each(Fm)}))},Jm=e=>{const t=at(e.element);F(t,(t=>{e.getByDom(t).each(Pm)})),Io(e.element)},Qm=(e,t,o,n)=>{o.get().each((t=>{Gm(e)}));const r=t.getAttachPoint(e);jm(r,e);const s=e.getSystem().build(n);return jm(e,s),o.set(s),s},eu=(e,t,o,n)=>{const r=Qm(e,t,o,n);return t.onOpen(e,r),r},tu=(e,t,o)=>{o.get().each((n=>{Gm(e),qm(e),t.onClose(e,n),o.clear()}))},ou=(e,t,o)=>o.isOpen(),nu=(e,t,o)=>{const n=t.getAttachPoint(e);At(e.element,"position",Hm.getMode(n)),((e,t,o,n)=>{Bt(e.element,t).fold((()=>{Et(e.element,o)}),(t=>{xt(e.element,o,t)})),At(e.element,t,n)})(e,"visibility",t.cloakVisibilityAttr,"hidden")},ru=(e,t,o)=>{(e=>L(["top","left","right","bottom"],(t=>Bt(e,t).isSome())))(e.element)||It(e.element,"position"),((e,t,o)=>{kt(e.element,o).fold((()=>It(e.element,t)),(o=>At(e.element,t,o)))})(e,"visibility",t.cloakVisibilityAttr)};var su=Object.freeze({__proto__:null,cloak:nu,decloak:ru,open:eu,openWhileCloaked:(e,t,o,n,r)=>{nu(e,t),eu(e,t,o,n),r(),ru(e,t)},close:tu,isOpen:ou,isPartOf:(e,t,o,n)=>ou(0,0,o)&&o.get().exists((o=>t.isPartOf(e,o,n))),getState:(e,t,o)=>o.get(),setContent:(e,t,o,n)=>o.get().map((()=>Qm(e,t,o,n)))});var au=Object.freeze({__proto__:null,events:(e,t)=>Xs([ea(Ts(),((o,n)=>{tu(o,e,t)}))])}),iu=[Ii("onOpen"),Ii("onClose"),ur("isPartOf"),ur("getAttachPoint"),Ar("cloakVisibilityAttr","data-precloak-visibility")];var lu=Object.freeze({__proto__:null,init:()=>{const e=en(),t=w("not-implemented");return wa({readState:t,isOpen:e.isSet,clear:e.clear,set:e.set,get:e.get})}});const cu=Sa({fields:iu,name:"sandboxing",active:au,apis:su,state:lu}),du=w("dismiss.popups"),mu=w("reposition.popups"),uu=w("mouse.released"),gu=Fn([Ar("isExtraPart",T),Or("fireEventInstead",[Ar("event",Hs())])]),hu=e=>{const t=sr("Dismissal",gu,e);return{[du()]:{schema:Fn([ur("target")]),onReceive:(e,o)=>{if(cu.isOpen(e)){cu.isPartOf(e,o.target)||t.isExtraPart(e,o.target)||t.fireEventInstead.fold((()=>cu.close(e)),(t=>Ws(e,t.event)))}}}}},pu=Fn([Or("fireEventInstead",[Ar("event",Is())]),vr("doReposition")]),fu=e=>{const t=sr("Reposition",pu,e);return{[mu()]:{onReceive:e=>{cu.isOpen(e)&&t.fireEventInstead.fold((()=>t.doReposition(e)),(t=>Ws(e,t.event)))}}}},vu=(e,t,o)=>{t.store.manager.onLoad(e,t,o)},bu=(e,t,o)=>{t.store.manager.onUnload(e,t,o)};var yu=Object.freeze({__proto__:null,onLoad:vu,onUnload:bu,setValue:(e,t,o,n)=>{t.store.manager.setValue(e,t,o,n)},getValue:(e,t,o)=>t.store.manager.getValue(e,t,o),getState:(e,t,o)=>o});var wu=Object.freeze({__proto__:null,events:(e,t)=>{const o=e.resetOnDom?[la(((o,n)=>{vu(o,e,t)})),ca(((o,n)=>{bu(o,e,t)}))]:[pa(e,t,vu)];return Xs(o)}});const xu=()=>{const e=Xo(null);return wa({set:e.set,get:e.get,isNotSet:()=>null===e.get(),clear:()=>{e.set(null)},readState:()=>({mode:"memory",value:e.get()})})},Cu=()=>{const e=Xo({}),t=Xo({});return wa({readState:()=>({mode:"dataset",dataByValue:e.get(),dataByText:t.get()}),lookup:o=>fe(e.get(),o).orThunk((()=>fe(t.get(),o))),update:o=>{const n=e.get(),r=t.get(),s={},a={};F(o,(e=>{s[e.value]=e,fe(e,"meta").each((t=>{fe(t,"text").each((t=>{a[t]=e}))}))})),e.set({...n,...s}),t.set({...r,...a})},clear:()=>{e.set({}),t.set({})}})};var Su=Object.freeze({__proto__:null,memory:xu,dataset:Cu,manual:()=>wa({readState:v}),init:e=>e.store.manager.state(e)});const ku=(e,t,o,n)=>{const r=t.store;o.update([n]),r.setValue(e,n),t.onSetValue(e,n)};var _u=[xr("initialValue"),ur("getFallbackEntry"),ur("getDataKey"),ur("setValue"),Vi("manager",{setValue:ku,getValue:(e,t,o)=>{const n=t.store,r=n.getDataKey(e);return o.lookup(r).getOrThunk((()=>n.getFallbackEntry(r)))},onLoad:(e,t,o)=>{t.store.initialValue.each((n=>{ku(e,t,o,n)}))},onUnload:(e,t,o)=>{o.clear()},state:Cu})];var Eu=[ur("getValue"),Ar("setValue",v),xr("initialValue"),Vi("manager",{setValue:(e,t,o,n)=>{t.store.setValue(e,n),t.onSetValue(e,n)},getValue:(e,t,o)=>t.store.getValue(e),onLoad:(e,t,o)=>{t.store.initialValue.each((o=>{t.store.setValue(e,o)}))},onUnload:v,state:ya.init})];var Tu=[xr("initialValue"),Vi("manager",{setValue:(e,t,o,n)=>{o.set(n),t.onSetValue(e,n)},getValue:(e,t,o)=>o.get(),onLoad:(e,t,o)=>{t.store.initialValue.each((e=>{o.isNotSet()&&o.set(e)}))},onUnload:(e,t,o)=>{o.clear()},state:xu})],Ou=[Dr("store",{mode:"memory"},ir("mode",{memory:Tu,manual:Eu,dataset:_u})),Ii("onSetValue"),Ar("resetOnDom",!1)];const Au=Sa({fields:Ou,name:"representing",active:wu,apis:yu,extra:{setValueFrom:(e,t)=>{const o=Au.getValue(t);Au.setValue(e,o)}},state:Su}),Du=(e,t)=>Ir(e,{},P(t,(t=>{return o=t.name(),n="Cannot configure "+t.name()+" for "+e,cr(o,o,{tag:"option",process:{}},Nn((e=>hn("The field: "+o+" is forbidden. "+n))));var o,n})).concat([dr("dump",x)])),Mu=e=>e.dump,Nu=(e,t)=>({...xa(t),...e.dump}),Ru=Du,Bu=Nu,Lu="placeholder",Hu=Pr([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Iu=e=>ve(e,"uiType"),Pu=(e,t,o,n)=>Iu(o)&&o.uiType===Lu?((e,t,o,n)=>e.exists((e=>e!==o.owner))?Hu.single(!0,w(o)):fe(n,o.name).fold((()=>{throw new Error("Unknown placeholder component: "+o.name+"\nKnown: ["+se(n)+"]\nNamespace: "+e.getOr("none")+"\nSpec: "+JSON.stringify(o,null,2))}),(e=>e.replace())))(e,0,o,n):Hu.single(!1,w(o)),Fu=(e,t,o,n)=>Pu(e,0,o,n).fold(((r,s)=>{const a=Iu(o)?s(t,o.config,o.validated):s(t),i=fe(a,"components").getOr([]),l=q(i,(o=>Fu(e,t,o,n)));return[{...a,components:l}]}),((e,n)=>{if(Iu(o)){const e=n(t,o.config,o.validated);return o.validated.preprocess.getOr(x)(e)}return n(t)})),zu=(e,t,o,n)=>{const r=le(n,((e,t)=>((e,t)=>{let o=!1;return{name:w(e),required:()=>t.fold(((e,t)=>e),((e,t)=>e)),used:()=>o,replace:()=>{if(o)throw new Error("Trying to use the same placeholder more than once: "+e);return o=!0,t}}})(t,e))),s=((e,t,o,n)=>q(o,(o=>Fu(e,t,o,n))))(e,t,o,r);return ie(r,(o=>{if(!1===o.used()&&o.required())throw new Error("Placeholder: "+o.name()+" was not found in components list\nNamespace: "+e.getOr("none")+"\nComponents: "+JSON.stringify(t.components,null,2))})),s},Vu=Hu.single,Zu=Hu.multiple,Uu=w(Lu),ju=Pr([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Wu=Ar("factory",{sketch:x}),$u=Ar("schema",[]),qu=ur("name"),Gu=cr("pname","pname",_n((e=>"")),Wn()),Ku=dr("schema",(()=>[xr("preprocess")])),Yu=Ar("defaults",w({})),Xu=Ar("overrides",w({})),Ju=zn([Wu,$u,qu,Gu,Yu,Xu]),Qu=zn([Wu,$u,qu,Yu,Xu]),eg=zn([Wu,$u,qu,Gu,Yu,Xu]),tg=zn([Wu,Ku,qu,ur("unit"),Gu,Yu,Xu]),og=e=>e.fold(A.some,A.none,A.some,A.some),ng=e=>{const t=e=>e.name;return e.fold(t,t,t,t)},rg=(e,t)=>o=>{const n=sr("Converting part type",t,o);return e(n)},sg=rg(ju.required,Ju),ag=rg(ju.external,Qu),ig=rg(ju.optional,eg),lg=rg(ju.group,tg),cg=w("entirety");var dg=Object.freeze({__proto__:null,required:sg,external:ag,optional:ig,group:lg,asNamedPart:og,name:ng,asCommon:e=>e.fold(x,x,x,x),original:cg});const mg=(e,t,o,n)=>Sn(t.defaults(e,o,n),o,{uid:e.partUids[t.name]},t.overrides(e,o,n)),ug=(e,t)=>{const o={};return F(t,(t=>{og(t).each((t=>{const n=gg(e,t.pname);o[t.name]=o=>{const r=sr("Part: "+t.name+" in "+e,zn(t.schema),o);return{...n,config:o,validated:r}}}))})),o},gg=(e,t)=>({uiType:Uu(),owner:e,name:t}),hg=(e,t,o)=>({uiType:Uu(),owner:e,name:t,config:o,validated:{}}),pg=e=>q(e,(e=>e.fold(A.none,A.some,A.none,A.none).map((e=>br(e.name,e.schema.concat([Zi(cg())])))).toArray())),fg=e=>P(e,ng),vg=(e,t,o)=>((e,t,o)=>{const n={},r={};return F(o,(e=>{e.fold((e=>{n[e.pname]=Vu(!0,((t,o,n)=>e.factory.sketch(mg(t,e,o,n))))}),(e=>{const o=t.parts[e.name];r[e.name]=w(e.factory.sketch(mg(t,e,o[cg()]),o))}),(e=>{n[e.pname]=Vu(!1,((t,o,n)=>e.factory.sketch(mg(t,e,o,n))))}),(e=>{n[e.pname]=Zu(!0,((t,o,n)=>{const r=t[e.name];return P(r,(o=>e.factory.sketch(Sn(e.defaults(t,o,n),o,e.overrides(t,o)))))}))}))})),{internals:w(n),externals:w(r)}})(0,t,o),bg=(e,t,o)=>zu(A.some(e),t,t.components,o),yg=(e,t,o)=>{const n=t.partUids[o];return e.getSystem().getByUid(n).toOptional()},wg=(e,t,o)=>yg(e,t,o).getOrDie("Could not find part: "+o),xg=(e,t,o)=>{const n={},r=t.partUids,s=e.getSystem();return F(o,(e=>{n[e]=w(s.getByUid(r[e]))})),n},Cg=(e,t)=>{const o=e.getSystem();return le(t.partUids,((e,t)=>w(o.getByUid(e))))},Sg=e=>se(e.partUids),kg=(e,t,o)=>{const n={},r=t.partUids,s=e.getSystem();return F(o,(e=>{n[e]=w(s.getByUid(r[e]).getOrDie())})),n},_g=(e,t)=>{const o=fg(t);return Vr(P(o,(t=>({key:t,value:e+"-"+t}))))},Eg=e=>cr("partUids","partUids",Tn((t=>_g(t.uid,e))),Wn());var Tg=Object.freeze({__proto__:null,generate:ug,generateOne:hg,schemas:pg,names:fg,substitutes:vg,components:bg,defaultUids:_g,defaultUidsSchema:Eg,getAllParts:Cg,getAllPartNames:Sg,getPart:yg,getPartOrDie:wg,getParts:xg,getPartsOrDie:kg});const Og=(e,t,o,n,r)=>{const s=((e,t)=>(e.length>0?[br("parts",e)]:[]).concat([ur("uid"),Ar("dom",{}),Ar("components",[]),Zi("originalSpec"),Ar("debug.sketcher",{})]).concat(t))(n,r);return sr(e+" [SpecSchema]",Fn(s.concat(t)),o)},Ag=(e,t,o,n,r)=>{const s=Dg(r),a=pg(o),i=Eg(o),l=Og(e,t,s,a,[i]),c=vg(0,l,o);return n(l,bg(e,l,c.internals()),s,c.externals())},Dg=e=>(e=>ve(e,"uid"))(e)?e:{...e,uid:rl("uid")},Mg=Fn([ur("name"),ur("factory"),ur("configFields"),Ar("apis",{}),Ar("extraApis",{})]),Ng=Fn([ur("name"),ur("factory"),ur("configFields"),ur("partFields"),Ar("apis",{}),Ar("extraApis",{})]),Rg=e=>{const t=sr("Sketcher for "+e.name,Mg,e),o=le(t.apis,ml),n=le(t.extraApis,((e,t)=>ga(e,t)));return{name:t.name,configFields:t.configFields,sketch:e=>((e,t,o,n)=>{const r=Dg(n);return o(Og(e,t,r,[],[]),r)})(t.name,t.configFields,t.factory,e),...o,...n}},Bg=e=>{const t=sr("Sketcher for "+e.name,Ng,e),o=ug(t.name,t.partFields),n=le(t.apis,ml),r=le(t.extraApis,((e,t)=>ga(e,t)));return{name:t.name,partFields:t.partFields,configFields:t.configFields,sketch:e=>Ag(t.name,t.configFields,t.partFields,t.factory,e),parts:o,...n,...r}},Lg=e=>qe("input")(e)&&"radio"!==St(e,"type")||qe("textarea")(e);var Hg=Object.freeze({__proto__:null,getCurrent:(e,t,o)=>t.find(e)});const Ig=[ur("find")],Pg=Sa({fields:Ig,name:"composing",apis:Hg}),Fg=["input","button","textarea","select"],zg=(e,t,o)=>{(t.disabled()?$g:qg)(e,t)},Vg=(e,t)=>!0===t.useNative&&B(Fg,ze(e.element)),Zg=e=>{xt(e.element,"disabled","disabled")},Ug=e=>{Et(e.element,"disabled")},jg=e=>{xt(e.element,"aria-disabled","true")},Wg=e=>{xt(e.element,"aria-disabled","false")},$g=(e,t,o)=>{t.disableClass.each((t=>{Na(e.element,t)}));(Vg(e,t)?Zg:jg)(e),t.onDisabled(e)},qg=(e,t,o)=>{t.disableClass.each((t=>{Ba(e.element,t)}));(Vg(e,t)?Ug:Wg)(e),t.onEnabled(e)},Gg=(e,t)=>Vg(e,t)?(e=>_t(e.element,"disabled"))(e):(e=>"true"===St(e.element,"aria-disabled"))(e);var Kg=Object.freeze({__proto__:null,enable:qg,disable:$g,isDisabled:Gg,onLoad:zg,set:(e,t,o,n)=>{(n?$g:qg)(e,t)}});var Yg=Object.freeze({__proto__:null,exhibit:(e,t)=>ha({classes:t.disabled()?t.disableClass.toArray():[]}),events:(e,t)=>Xs([Js(Ss(),((t,o)=>Gg(t,e))),pa(e,t,zg)])}),Xg=[Lr("disabled",T),Ar("useNative",!0),xr("disableClass"),Ii("onDisabled"),Ii("onEnabled")];const Jg=Sa({fields:Xg,name:"disabling",active:Yg,apis:Kg}),Qg=(e,t,o,n)=>{const r=nm(e.element,"."+t.highlightClass);F(r,(o=>{L(n,(e=>Xe(e.element,o)))||(Ba(o,t.highlightClass),e.getSystem().getByDom(o).each((o=>{t.onDehighlight(e,o),Ws(o,js())})))}))},eh=(e,t,o,n)=>{Qg(e,t,0,[n]),th(e,t,o,n)||(Na(n.element,t.highlightClass),t.onHighlight(e,n),Ws(n,Us()))},th=(e,t,o,n)=>Ha(n.element,t.highlightClass),oh=(e,t,o,n)=>{const r=nm(e.element,"."+t.itemClass);return A.from(r[n]).fold((()=>rn.error(new Error("No element found with index "+n))),e.getSystem().getByDom)},nh=(e,t,o)=>Yl(e.element,"."+t.itemClass).bind((t=>e.getSystem().getByDom(t).toOptional())),rh=(e,t,o)=>{const n=nm(e.element,"."+t.itemClass);return(n.length>0?A.some(n[n.length-1]):A.none()).bind((t=>e.getSystem().getByDom(t).toOptional()))},sh=(e,t,o,n)=>{const r=nm(e.element,"."+t.itemClass),s=W(r,(e=>Ha(e,t.highlightClass)));return s.bind((t=>{const o=Gi(t,n,0,r.length-1);return e.getSystem().getByDom(r[o]).toOptional()}))},ah=(e,t,o)=>{const n=nm(e.element,"."+t.itemClass);return we(P(n,(t=>e.getSystem().getByDom(t).toOptional())))};var ih=Object.freeze({__proto__:null,dehighlightAll:(e,t,o)=>Qg(e,t,0,[]),dehighlight:(e,t,o,n)=>{th(e,t,o,n)&&(Ba(n.element,t.highlightClass),t.onDehighlight(e,n),Ws(n,js()))},highlight:eh,highlightFirst:(e,t,o)=>{nh(e,t).each((n=>{eh(e,t,o,n)}))},highlightLast:(e,t,o)=>{rh(e,t).each((n=>{eh(e,t,o,n)}))},highlightAt:(e,t,o,n)=>{oh(e,t,o,n).fold((e=>{throw e}),(n=>{eh(e,t,o,n)}))},highlightBy:(e,t,o,n)=>{const r=ah(e,t);j(r,n).each((n=>{eh(e,t,o,n)}))},isHighlighted:th,getHighlighted:(e,t,o)=>Yl(e.element,"."+t.highlightClass).bind((t=>e.getSystem().getByDom(t).toOptional())),getFirst:nh,getLast:rh,getPrevious:(e,t,o)=>sh(e,t,0,-1),getNext:(e,t,o)=>sh(e,t,0,1),getCandidates:ah}),lh=[ur("highlightClass"),ur("itemClass"),Ii("onHighlight"),Ii("onDehighlight")];const ch=Sa({fields:lh,name:"highlighting",apis:ih}),dh=[8],mh=[9],uh=[13],gh=[27],hh=[32],ph=[37],fh=[38],vh=[39],bh=[40],yh=(e,t,o)=>{const n=K(e.slice(0,t)),r=K(e.slice(t+1));return j(n.concat(r),o)},wh=(e,t,o)=>{const n=K(e.slice(0,t));return j(n,o)},xh=(e,t,o)=>{const n=e.slice(0,t),r=e.slice(t+1);return j(r.concat(n),o)},Ch=(e,t,o)=>{const n=e.slice(t+1);return j(n,o)},Sh=e=>t=>{const o=t.raw;return B(e,o.which)},kh=e=>t=>G(e,(e=>e(t))),_h=e=>!0===e.raw.shiftKey,Eh=e=>!0===e.raw.ctrlKey,Th=k(_h),Oh=(e,t)=>({matches:e,classification:t}),Ah=(e,t,o)=>{t.exists((e=>o.exists((t=>Xe(t,e)))))||$s(e,Ps(),{prevFocus:t,newFocus:o})},Dh=()=>{const e=e=>Zc(e.element);return{get:e,set:(t,o)=>{const n=e(t);t.getSystem().triggerFocus(o,t.element);const r=e(t);Ah(t,n,r)}}},Mh=()=>{const e=e=>ch.getHighlighted(e).map((e=>e.element));return{get:e,set:(t,o)=>{const n=e(t);t.getSystem().getByDom(o).fold(v,(e=>{ch.highlight(t,e)}));const r=e(t);Ah(t,n,r)}}};var Nh;!function(e){e.OnFocusMode="onFocus",e.OnEnterOrSpaceMode="onEnterOrSpace",e.OnApiMode="onApi"}(Nh||(Nh={}));const Rh=(e,t,o,n,r)=>{const s=(e,t,o,n,r)=>((e,t)=>{const o=j(e,(e=>e.matches(t)));return o.map((e=>e.classification))})(o(e,t,n,r),t.event).bind((o=>o(e,t,n,r))),a={schema:()=>e.concat([Ar("focusManager",Dh()),Dr("focusInside","onFocus",tr((e=>B(["onFocus","onEnterOrSpace","onApi"],e)?rn.value(e):rn.error("Invalid value for focusInside")))),Vi("handler",a),Vi("state",t),Vi("sendFocusIn",r)]),processKey:s,toEvents:(e,t)=>{const a=e.focusInside!==Nh.OnFocusMode?A.none():r(e).map((o=>ea(ys(),((n,r)=>{o(n,e,t),r.stop()})))),i=[ea(ls(),((n,a)=>{s(n,a,o,e,t).fold((()=>{((o,n)=>{const s=Sh(hh.concat(uh))(n.event);e.focusInside===Nh.OnEnterOrSpaceMode&&s&&$r(o,n)&&r(e).each((r=>{r(o,e,t),n.stop()}))})(n,a)}),(e=>{a.stop()}))})),ea(cs(),((o,r)=>{s(o,r,n,e,t).each((e=>{r.stop()}))}))];return Xs(a.toArray().concat(i))}};return a},Bh=e=>{const t=[xr("onEscape"),xr("onEnter"),Ar("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Ar("firstTabstop",0),Ar("useTabstopAt",O),xr("visibilitySelector")].concat([e]),o=(e,t)=>{const o=e.visibilitySelector.bind((e=>Xl(t,e))).getOr(t);return Vt(o)>0},n=(e,t)=>t.focusManager.get(e).bind((e=>Xl(e,t.selector))),r=(e,t,n)=>{((e,t)=>{const n=nm(e.element,t.selector),r=V(n,(e=>o(t,e)));return A.from(r[t.firstTabstop])})(e,t).each((o=>{t.focusManager.set(e,o)}))},s=(e,t,n,r,s)=>s(t,n,(e=>((e,t)=>o(e,t)&&e.useTabstopAt(t))(r,e))).fold((()=>r.cyclic?A.some(!0):A.none()),(t=>(r.focusManager.set(e,t),A.some(!0)))),a=(e,t,o,r)=>{const a=nm(e.element,o.selector);return n(e,o).bind((t=>W(a,S(Xe,t)).bind((t=>s(e,a,t,o,r)))))},i=(e,t,o)=>{const n=o.cyclic?yh:wh;return a(e,0,o,n)},l=(e,t,o)=>{const n=o.cyclic?xh:Ch;return a(e,0,o,n)},c=e=>(e=>nt(e))(e).bind(lt).exists((t=>Xe(t,e))),d=w([Oh(kh([_h,Sh(mh)]),i),Oh(Sh(mh),l),Oh(kh([Th,Sh(uh)]),((e,t,o)=>o.onEnter.bind((o=>o(e,t)))))]),m=w([Oh(Sh(gh),((e,t,o)=>o.onEscape.bind((o=>o(e,t))))),Oh(Sh(mh),((e,t,o)=>n(e,o).filter((e=>!o.useTabstopAt(e))).bind((n=>(c(n)?i:l)(e,t,o)))))]);return Rh(t,ya.init,d,m,(()=>A.some(r)))};var Lh=Bh(dr("cyclic",T)),Hh=Bh(dr("cyclic",O));const Ih=(e,t,o)=>Lg(o)&&Sh(hh)(t.event)?A.none():((e,t,o)=>(Gs(e,o,Ss()),A.some(!0)))(e,0,o),Ph=(e,t)=>A.some(!0),Fh=[Ar("execute",Ih),Ar("useSpace",!1),Ar("useEnter",!0),Ar("useControlEnter",!1),Ar("useDown",!1)],zh=(e,t,o)=>o.execute(e,t,e.element);var Vh=Rh(Fh,ya.init,((e,t,o,n)=>{const r=o.useSpace&&!Lg(e.element)?hh:[],s=o.useEnter?uh:[],a=o.useDown?bh:[],i=r.concat(s).concat(a);return[Oh(Sh(i),zh)].concat(o.useControlEnter?[Oh(kh([Eh,Sh(uh)]),zh)]:[])}),((e,t,o,n)=>o.useSpace&&!Lg(e.element)?[Oh(Sh(hh),Ph)]:[]),(()=>A.none()));const Zh=()=>{const e=en();return wa({readState:()=>e.get().map((e=>({numRows:String(e.numRows),numColumns:String(e.numColumns)}))).getOr({numRows:"?",numColumns:"?"}),setGridSize:(t,o)=>{e.set({numRows:t,numColumns:o})},getNumRows:()=>e.get().map((e=>e.numRows)),getNumColumns:()=>e.get().map((e=>e.numColumns))})};var Uh=Object.freeze({__proto__:null,flatgrid:Zh,init:e=>e.state(e)});const jh=e=>(t,o,n,r)=>{const s=e(t.element);return Gh(s,t,o,n,r)},Wh=(e,t)=>{const o=kd(e,t);return jh(o)},$h=(e,t)=>{const o=kd(t,e);return jh(o)},qh=e=>(t,o,n,r)=>Gh(e,t,o,n,r),Gh=(e,t,o,n,r)=>n.focusManager.get(t).bind((o=>e(t.element,o,n,r))).map((e=>(n.focusManager.set(t,e),!0))),Kh=qh,Yh=qh,Xh=qh,Jh=e=>!(e=>e.offsetWidth<=0&&e.offsetHeight<=0)(e.dom),Qh=(e,t,o)=>{const n=nm(e,o);return((e,t)=>W(e,t).map((t=>({index:t,candidates:e}))))(V(n,Jh),(e=>Xe(e,t)))},ep=(e,t)=>W(e,(e=>Xe(t,e))),tp=(e,t,o,n)=>n(Math.floor(t/o),t%o).bind((t=>{const n=t.row*o+t.column;return n>=0&&ntp(e,t,n,((t,s)=>{const a=t===o-1?e.length-t*n:n,i=Gi(s,r,0,a-1);return A.some({row:t,column:i})})),np=(e,t,o,n,r)=>tp(e,t,n,((t,s)=>{const a=Gi(t,r,0,o-1),i=a===o-1?e.length-a*n:n,l=Ki(s,0,i-1);return A.some({row:a,column:l})})),rp=[ur("selector"),Ar("execute",Ih),Pi("onEscape"),Ar("captureTab",!1),Ui()],sp=(e,t,o)=>{Yl(e.element,t.selector).each((o=>{t.focusManager.set(e,o)}))},ap=e=>(t,o,n,r)=>Qh(t,o,n.selector).bind((t=>e(t.candidates,t.index,r.getNumRows().getOr(n.initSize.numRows),r.getNumColumns().getOr(n.initSize.numColumns)))),ip=(e,t,o)=>o.captureTab?A.some(!0):A.none(),lp=ap(((e,t,o,n)=>op(e,t,o,n,-1))),cp=ap(((e,t,o,n)=>op(e,t,o,n,1))),dp=ap(((e,t,o,n)=>np(e,t,o,n,-1))),mp=ap(((e,t,o,n)=>np(e,t,o,n,1))),up=w([Oh(Sh(ph),Wh(lp,cp)),Oh(Sh(vh),$h(lp,cp)),Oh(Sh(fh),Kh(dp)),Oh(Sh(bh),Yh(mp)),Oh(kh([_h,Sh(mh)]),ip),Oh(kh([Th,Sh(mh)]),ip),Oh(Sh(hh.concat(uh)),((e,t,o,n)=>((e,t)=>t.focusManager.get(e).bind((e=>Xl(e,t.selector))))(e,o).bind((n=>o.execute(e,t,n)))))]),gp=w([Oh(Sh(gh),((e,t,o)=>o.onEscape(e,t))),Oh(Sh(hh),Ph)]);var hp=Rh(rp,Zh,up,gp,(()=>A.some(sp)));const pp=(e,t,o,n,r)=>{const s=(e,t,o)=>r(e,t,n,0,o.length-1,o[t],(t=>{return n=o[t],"button"===ze(n)&&"disabled"===St(n,"disabled")?s(e,t,o):A.from(o[t]);var n}));return Qh(e,o,t).bind((e=>{const t=e.index,o=e.candidates;return s(t,t,o)}))},fp=(e,t,o,n)=>pp(e,t,o,n,((e,t,o,n,r,s,a)=>{const i=Ki(t+o,n,r);return i===e?A.from(s):a(i)})),vp=(e,t,o,n)=>pp(e,t,o,n,((e,t,o,n,r,s,a)=>{const i=Gi(t,o,n,r);return i===e?A.none():a(i)})),bp=[ur("selector"),Ar("getInitial",A.none),Ar("execute",Ih),Pi("onEscape"),Ar("executeOnMove",!1),Ar("allowVertical",!0),Ar("allowHorizontal",!0),Ar("cycles",!0)],yp=(e,t,o)=>((e,t)=>t.focusManager.get(e).bind((e=>Xl(e,t.selector))))(e,o).bind((n=>o.execute(e,t,n))),wp=(e,t,o)=>{t.getInitial(e).orThunk((()=>Yl(e.element,t.selector))).each((o=>{t.focusManager.set(e,o)}))},xp=(e,t,o)=>(o.cycles?vp:fp)(e,o.selector,t,-1),Cp=(e,t,o)=>(o.cycles?vp:fp)(e,o.selector,t,1),Sp=e=>(t,o,n,r)=>e(t,o,n,r).bind((()=>n.executeOnMove?yp(t,o,n):A.some(!0))),kp=w([Oh(Sh(hh),Ph),Oh(Sh(gh),((e,t,o)=>o.onEscape(e,t)))]);var _p=Rh(bp,ya.init,((e,t,o,n)=>{const r=[...o.allowHorizontal?ph:[]].concat(o.allowVertical?fh:[]),s=[...o.allowHorizontal?vh:[]].concat(o.allowVertical?bh:[]);return[Oh(Sh(r),Sp(Wh(xp,Cp))),Oh(Sh(s),Sp($h(xp,Cp))),Oh(Sh(uh),yp),Oh(Sh(hh),yp)]}),kp,(()=>A.some(wp)));const Ep=(e,t,o)=>A.from(e[t]).bind((e=>A.from(e[o]).map((e=>({rowIndex:t,columnIndex:o,cell:e}))))),Tp=(e,t,o,n)=>{const r=e[t].length,s=Gi(o,n,0,r-1);return Ep(e,t,s)},Op=(e,t,o,n)=>{const r=Gi(o,n,0,e.length-1),s=e[r].length,a=Ki(t,0,s-1);return Ep(e,r,a)},Ap=(e,t,o,n)=>{const r=e[t].length,s=Ki(o+n,0,r-1);return Ep(e,t,s)},Dp=(e,t,o,n)=>{const r=Ki(o+n,0,e.length-1),s=e[r].length,a=Ki(t,0,s-1);return Ep(e,r,a)},Mp=[br("selectors",[ur("row"),ur("cell")]),Ar("cycles",!0),Ar("previousSelector",A.none),Ar("execute",Ih)],Np=(e,t,o)=>{t.previousSelector(e).orThunk((()=>{const o=t.selectors;return Yl(e.element,o.cell)})).each((o=>{t.focusManager.set(e,o)}))},Rp=(e,t)=>(o,n,r)=>{const s=r.cycles?e:t;return Xl(n,r.selectors.row).bind((e=>{const t=nm(e,r.selectors.cell);return ep(t,n).bind((t=>{const n=nm(o,r.selectors.row);return ep(n,e).bind((e=>{const o=((e,t)=>P(e,(e=>nm(e,t.selectors.cell))))(n,r);return s(o,e,t).map((e=>e.cell))}))}))}))},Bp=Rp(((e,t,o)=>Tp(e,t,o,-1)),((e,t,o)=>Ap(e,t,o,-1))),Lp=Rp(((e,t,o)=>Tp(e,t,o,1)),((e,t,o)=>Ap(e,t,o,1))),Hp=Rp(((e,t,o)=>Op(e,o,t,-1)),((e,t,o)=>Dp(e,o,t,-1))),Ip=Rp(((e,t,o)=>Op(e,o,t,1)),((e,t,o)=>Dp(e,o,t,1))),Pp=w([Oh(Sh(ph),Wh(Bp,Lp)),Oh(Sh(vh),$h(Bp,Lp)),Oh(Sh(fh),Kh(Hp)),Oh(Sh(bh),Yh(Ip)),Oh(Sh(hh.concat(uh)),((e,t,o)=>Zc(e.element).bind((n=>o.execute(e,t,n)))))]),Fp=w([Oh(Sh(hh),Ph)]);var zp=Rh(Mp,ya.init,Pp,Fp,(()=>A.some(Np)));const Vp=[ur("selector"),Ar("execute",Ih),Ar("moveOnTab",!1)],Zp=(e,t,o)=>o.focusManager.get(e).bind((n=>o.execute(e,t,n))),Up=(e,t,o)=>{Yl(e.element,t.selector).each((o=>{t.focusManager.set(e,o)}))},jp=(e,t,o)=>vp(e,o.selector,t,-1),Wp=(e,t,o)=>vp(e,o.selector,t,1),$p=w([Oh(Sh(fh),Xh(jp)),Oh(Sh(bh),Xh(Wp)),Oh(kh([_h,Sh(mh)]),((e,t,o,n)=>o.moveOnTab?Xh(jp)(e,t,o,n):A.none())),Oh(kh([Th,Sh(mh)]),((e,t,o,n)=>o.moveOnTab?Xh(Wp)(e,t,o,n):A.none())),Oh(Sh(uh),Zp),Oh(Sh(hh),Zp)]),qp=w([Oh(Sh(hh),Ph)]);var Gp=Rh(Vp,ya.init,$p,qp,(()=>A.some(Up)));const Kp=[Pi("onSpace"),Pi("onEnter"),Pi("onShiftEnter"),Pi("onLeft"),Pi("onRight"),Pi("onTab"),Pi("onShiftTab"),Pi("onUp"),Pi("onDown"),Pi("onEscape"),Ar("stopSpaceKeyup",!1),xr("focusIn")];var Yp=Rh(Kp,ya.init,((e,t,o)=>[Oh(Sh(hh),o.onSpace),Oh(kh([Th,Sh(uh)]),o.onEnter),Oh(kh([_h,Sh(uh)]),o.onShiftEnter),Oh(kh([_h,Sh(mh)]),o.onShiftTab),Oh(kh([Th,Sh(mh)]),o.onTab),Oh(Sh(fh),o.onUp),Oh(Sh(bh),o.onDown),Oh(Sh(ph),o.onLeft),Oh(Sh(vh),o.onRight),Oh(Sh(hh),o.onSpace)]),((e,t,o)=>[...o.stopSpaceKeyup?[Oh(Sh(hh),Ph)]:[],Oh(Sh(gh),o.onEscape)]),(e=>e.focusIn));const Xp=Lh.schema(),Jp=Hh.schema(),Qp=_p.schema(),ef=hp.schema(),tf=zp.schema(),of=Vh.schema(),nf=Gp.schema(),rf=Yp.schema();const sf=_a({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:Xp,cyclic:Jp,flow:Qp,flatgrid:ef,matrix:tf,execution:of,menu:nf,special:rf}),name:"keying",active:{events:(e,t)=>e.handler.toEvents(e,t)},apis:{focusIn:(e,t,o)=>{t.sendFocusIn(t).fold((()=>{e.getSystem().triggerFocus(e.element,e.element)}),(n=>{n(e,t,o)}))},setGridSize:(e,t,o,n,r)=>{(e=>be(e,"setGridSize"))(o)?o.setGridSize(n,r):console.error("Layout does not support setGridSize")}},state:Uh}),af=(e,t)=>{Uc((()=>{Um(e,t,(()=>P(t,e.getSystem().build)))}),e.element)},lf=(e,t)=>{Uc((()=>{((e,t,o)=>{const n=e.components(),r=q(t,(e=>dl(e).toArray()));F(n,(e=>{B(r,e)||Vm(e)}));const s=o(t),a=Y(n,s);F(a,(e=>{Im(e)&&Vm(e)})),F(s,(t=>{Im(t)||zm(e,t)})),e.syncComponents()})(e,t,(()=>((e,t,o)=>El(e,t,((t,n)=>Tl(e,n,t,o))))(e.element,t,e.getSystem().buildOrPatch)))}),e.element)},cf=(e,t,o,n)=>{Vm(t);const r=Tl(e.element,o,n,e.getSystem().buildOrPatch);zm(e,r),e.syncComponents()},df=(e,t,o)=>{const n=e.getSystem().build(o);Wm(e,n,t)},mf=(e,t,o,n)=>{qm(t),df(e,((e,t)=>((e,t,o)=>{it(e,o).fold((()=>{Bo(e,t)}),(e=>{Mo(e,t)}))})(e,t,o)),n)},uf=(e,t)=>e.components(),gf=(e,t,o,n,r)=>{const s=uf(e);return A.from(s[n]).map((o=>(r.fold((()=>qm(o)),(r=>{(t.reuseDom?cf:mf)(e,o,n,r)})),o)))};var hf=Object.freeze({__proto__:null,append:(e,t,o,n)=>{df(e,Bo,n)},prepend:(e,t,o,n)=>{df(e,Ro,n)},remove:(e,t,o,n)=>{const r=uf(e),s=j(r,(e=>Xe(n.element,e.element)));s.each(qm)},replaceAt:gf,replaceBy:(e,t,o,n,r)=>{const s=uf(e);return W(s,n).bind((o=>gf(e,t,0,o,r)))},set:(e,t,o,n)=>(t.reuseDom?lf:af)(e,n),contents:uf});const pf=Sa({fields:[Br("reuseDom",!0)],name:"replacing",apis:hf}),ff=(e,t)=>{const o=((e,t)=>{const o=Xs(t);return Sa({fields:[ur("enabled")],name:e,active:{events:w(o)}})})(e,t);return{key:e,value:{config:{},me:o,configAsRaw:w({}),initialConfig:{},state:ya}}},vf=(e,t)=>{t.ignore||(Pc(e.element),t.onFocus(e))};var bf=Object.freeze({__proto__:null,focus:vf,blur:(e,t)=>{t.ignore||Fc(e.element)},isFocused:e=>zc(e.element)});var yf=Object.freeze({__proto__:null,exhibit:(e,t)=>{const o=t.ignore?{}:{attributes:{tabindex:"-1"}};return ha(o)},events:e=>Xs([ea(ys(),((t,o)=>{vf(t,e),o.stop()}))].concat(e.stopMousedown?[ea(ts(),((e,t)=>{t.event.prevent()}))]:[]))}),wf=[Ii("onFocus"),Ar("stopMousedown",!1),Ar("ignore",!1)];const xf=Sa({fields:wf,name:"focusing",active:yf,apis:bf}),Cf=(e,t,o,n)=>{const r=o.get();o.set(n),((e,t,o)=>{t.toggleClass.each((t=>{o.get()?Na(e.element,t):Ba(e.element,t)}))})(e,t,o),((e,t,o)=>{const n=t.aria;n.update(e,n,o.get())})(e,t,o),r!==n&&t.onToggled(e,n)},Sf=(e,t,o)=>{Cf(e,t,o,!o.get())},kf=(e,t,o)=>{Cf(e,t,o,t.selected)};var _f=Object.freeze({__proto__:null,onLoad:kf,toggle:Sf,isOn:(e,t,o)=>o.get(),on:(e,t,o)=>{Cf(e,t,o,!0)},off:(e,t,o)=>{Cf(e,t,o,!1)},set:Cf});var Ef=Object.freeze({__proto__:null,exhibit:()=>ha({}),events:(e,t)=>{const o=(n=e,r=t,s=Sf,ma((e=>{s(e,n,r)})));var n,r,s;const a=pa(e,t,kf);return Xs($([e.toggleOnExecute?[o]:[],[a]]))}});const Tf=(e,t,o)=>{xt(e.element,"aria-expanded",o)};var Of=[Ar("selected",!1),xr("toggleClass"),Ar("toggleOnExecute",!0),Ii("onToggled"),Dr("aria",{mode:"none"},ir("mode",{pressed:[Ar("syncWithExpanded",!1),Vi("update",((e,t,o)=>{xt(e.element,"aria-pressed",o),t.syncWithExpanded&&Tf(e,t,o)}))],checked:[Vi("update",((e,t,o)=>{xt(e.element,"aria-checked",o)}))],expanded:[Vi("update",Tf)],selected:[Vi("update",((e,t,o)=>{xt(e.element,"aria-selected",o)}))],none:[Vi("update",v)]}))];const Af=Sa({fields:Of,name:"toggling",active:Ef,apis:_f,state:(Df=!1,{init:()=>{const e=Xo(Df);return{get:()=>e.get(),set:t=>e.set(t),clear:()=>e.set(Df),readState:()=>e.get()}}})});var Df;const Mf=()=>{const e=(e,t)=>{t.stop(),qs(e)};return[ea(us(),e),ea(_s(),e),sa(Xr()),sa(ts())]},Nf=e=>Xs($([e.map((e=>ma(((t,o)=>{e(t),o.stop()})))).toArray(),Mf()])),Rf="alloy.item-hover",Bf="alloy.item-focus",Lf="alloy.item-toggled",Hf=e=>{(Zc(e.element).isNone()||xf.isFocused(e))&&(xf.isFocused(e)||xf.focus(e),$s(e,Rf,{item:e}))},If=e=>{$s(e,Bf,{item:e})},Pf=w(Rf),Ff=w(Bf),zf=w(Lf),Vf=e=>e.role.fold((()=>e.toggling.map((e=>e.exclusive?"menuitemradio":"menuitemcheckbox")).getOr("menuitem")),x),Zf=(e,t)=>({aria:{mode:t?"selected":"checked"},...ue(e,((e,t)=>"exclusive"!==t)),onToggled:(t,o)=>{h(e.onToggled)&&e.onToggled(t,o),((e,t)=>{$s(e,Lf,{item:e,state:t})})(t,o)}}),Uf=[ur("data"),ur("components"),ur("dom"),Ar("hasSubmenu",!1),xr("toggling"),xr("role"),Ru("itemBehaviours",[Af,xf,sf,Au]),Ar("ignoreFocus",!1),Ar("domModification",{}),Vi("builder",(e=>({dom:e.dom,domModification:{...e.domModification,attributes:{role:Vf(e),...e.domModification.attributes,"aria-haspopup":e.hasSubmenu,...e.hasSubmenu?{"aria-expanded":!1}:{}}},behaviours:Bu(e.itemBehaviours,[e.toggling.fold(Af.revoke,(t=>Af.config(Zf(t,e.role.exists((e=>"option"===e)))))),xf.config({ignore:e.ignoreFocus,stopMousedown:e.ignoreFocus,onFocus:e=>{If(e)}}),sf.config({mode:"execution"}),Au.config({store:{mode:"memory",initialValue:e.data}}),ff("item-type-events",[...Mf(),ea(ss(),Hf),ea(ks(),xf.focus)])]),components:e.components,eventOrder:e.eventOrder}))),Ar("eventOrder",{})],jf=[ur("dom"),ur("components"),Vi("builder",(e=>({dom:e.dom,components:e.components,events:Xs([aa(ks())])})))],Wf=w("item-widget"),$f=w([sg({name:"widget",overrides:e=>({behaviours:xa([Au.config({store:{mode:"manual",getValue:t=>e.data,setValue:v}})])})})]),qf=[ur("uid"),ur("data"),ur("components"),ur("dom"),Ar("autofocus",!1),Ar("ignoreFocus",!1),Ru("widgetBehaviours",[Au,xf,sf]),Ar("domModification",{}),Eg($f()),Vi("builder",(e=>{const t=vg(Wf(),e,$f()),o=bg(Wf(),e,t.internals()),n=t=>yg(t,e,"widget").map((e=>(sf.focusIn(e),e))),r=(t,o)=>Lg(o.event.target)?A.none():e.autofocus?(o.setSource(t.element),A.none()):A.none();return{dom:e.dom,components:o,domModification:e.domModification,events:Xs([ma(((e,t)=>{n(e).each((e=>{t.stop()}))})),ea(ss(),Hf),ea(ks(),((t,o)=>{e.autofocus?n(t):xf.focus(t)}))]),behaviours:Bu(e.widgetBehaviours,[Au.config({store:{mode:"memory",initialValue:e.data}}),xf.config({ignore:e.ignoreFocus,onFocus:e=>{If(e)}}),sf.config({mode:"special",focusIn:e.autofocus?e=>{n(e)}:Ea(),onLeft:r,onRight:r,onEscape:(t,o)=>xf.isFocused(t)||e.autofocus?e.autofocus?(o.setSource(t.element),A.none()):A.none():(xf.focus(t),A.some(!0))})])}}))],Gf=ir("type",{widget:qf,item:Uf,separator:jf}),Kf=w([lg({factory:{sketch:e=>{const t=sr("menu.spec item",Gf,e);return t.builder(t)}},name:"items",unit:"item",defaults:(e,t)=>ve(t,"uid")?t:{...t,uid:rl("item")},overrides:(e,t)=>({type:t.type,ignoreFocus:e.fakeFocus,domModification:{classes:[e.markers.item]}})})]),Yf=w([kr("role"),ur("value"),ur("items"),ur("dom"),ur("components"),Ar("eventOrder",{}),Du("menuBehaviours",[ch,Au,Pg,sf]),Dr("movement",{mode:"menu",moveOnTab:!0},ir("mode",{grid:[Ui(),Vi("config",((e,t)=>({mode:"flatgrid",selector:"."+e.markers.item,initSize:{numColumns:t.initSize.numColumns,numRows:t.initSize.numRows},focusManager:e.focusManager})))],matrix:[Vi("config",((e,t)=>({mode:"matrix",selectors:{row:t.rowSelector,cell:"."+e.markers.item},previousSelector:t.previousSelector,focusManager:e.focusManager}))),ur("rowSelector"),Ar("previousSelector",A.none)],menu:[Ar("moveOnTab",!0),Vi("config",((e,t)=>({mode:"menu",selector:"."+e.markers.item,moveOnTab:t.moveOnTab,focusManager:e.focusManager})))]})),gr("markers",Ni()),Ar("fakeFocus",!1),Ar("focusManager",Dh()),Ii("onHighlight"),Ii("onDehighlight"),Ar("showMenuRole",!0)]),Xf=w("alloy.menu-focus"),Jf=Bg({name:"Menu",configFields:Yf(),partFields:Kf(),factory:(e,t,o,n)=>({uid:e.uid,dom:e.dom,markers:e.markers,behaviours:Nu(e.menuBehaviours,[ch.config({highlightClass:e.markers.selectedItem,itemClass:e.markers.item,onHighlight:e.onHighlight,onDehighlight:e.onDehighlight}),Au.config({store:{mode:"memory",initialValue:e.value}}),Pg.config({find:A.some}),sf.config(e.movement.config(e,e.movement))]),events:Xs([ea(Ff(),((e,t)=>{const o=t.event;e.getSystem().getByDom(o.target).each((o=>{ch.highlight(e,o),t.stop(),$s(e,Xf(),{menu:e,item:o})}))})),ea(Pf(),((e,t)=>{const o=t.event.item;ch.highlight(e,o)})),ea(zf(),((e,t)=>{const{item:o,state:n}=t.event;n&&"menuitemradio"===St(o.element,"role")&&((e,t)=>{const o=nm(e.element,'[role="menuitemradio"][aria-checked="true"]');F(o,(o=>{Xe(o,t.element)||e.getSystem().getByDom(o).each((e=>{Af.off(e)}))}))})(e,o)}))]),components:t,eventOrder:e.eventOrder,...e.showMenuRole?{domModification:{attributes:{role:e.role.getOr("menu")}}}:{}})}),Qf=(e,t,o,n)=>fe(o,n).bind((n=>fe(e,n).bind((n=>{const r=Qf(e,t,o,n);return A.some([n].concat(r))})))).getOr([]),ev=(e,t)=>{const o={};ie(e,((e,t)=>{F(e,(e=>{o[e]=t}))}));const n=t,r=ce(t,((e,t)=>({k:e,v:t})));const s=le(r,((e,t)=>[t].concat(Qf(o,n,r,t))));return le(o,(e=>fe(s,e).getOr([e])))},tv=e=>"prepared"===e.type?A.some(e.menu):A.none(),ov={init:()=>{const e=Xo({}),t=Xo({}),o=Xo({}),n=en(),r=Xo({}),s=(t,o,n)=>a(t).bind((r=>(t=>he(e.get(),((e,o)=>e===t)))(t).bind((e=>o(e).map((e=>({triggeredMenu:r,triggeringItem:e,triggeringPath:n}))))))),a=e=>i(e).bind(tv),i=e=>fe(t.get(),e),l=t=>fe(e.get(),t);return{setMenuBuilt:(e,o)=>{t.set({...t.get(),[e]:{type:"prepared",menu:o}})},setContents:(s,a,i,l)=>{n.set(s),e.set(i),t.set(a),r.set(l);const c=ev(l,i);o.set(c)},expand:t=>fe(e.get(),t).map((e=>{const n=fe(o.get(),t).getOr([]);return[e].concat(n)})),refresh:e=>fe(o.get(),e),collapse:e=>fe(o.get(),e).bind((e=>e.length>1?A.some(e.slice(1)):A.none())),lookupMenu:i,lookupItem:l,otherMenus:e=>{const t=r.get();return Y(se(t),e)},getPrimary:()=>n.get().bind(a),getMenus:()=>t.get(),clear:()=>{e.set({}),t.set({}),o.set({}),n.clear()},isClear:()=>n.get().isNone(),getTriggeringPath:(e,t)=>{const r=V(l(e).toArray(),(e=>a(e).isSome()));return fe(o.get(),e).bind((e=>{const o=K(r.concat(e));return(e=>{const t=[];for(let o=0;os(e,t,o.slice(0,r+1)).fold((()=>ye(n.get(),e)?[]:[A.none()]),(e=>[A.some(e)])))))}))}}},extractPreparedMenu:tv},nv=Xi("tiered-menu-item-highlight"),rv=Xi("tiered-menu-item-dehighlight");var sv;!function(e){e[e.HighlightMenuAndItem=0]="HighlightMenuAndItem",e[e.HighlightJustMenu=1]="HighlightJustMenu",e[e.HighlightNone=2]="HighlightNone"}(sv||(sv={}));const av=w("collapse-item"),iv=Rg({name:"TieredMenu",configFields:[zi("onExecute"),zi("onEscape"),Fi("onOpenMenu"),Fi("onOpenSubmenu"),Ii("onRepositionMenu"),Ii("onCollapseMenu"),Ar("highlightOnOpen",sv.HighlightMenuAndItem),br("data",[ur("primary"),ur("menus"),ur("expansions")]),Ar("fakeFocus",!1),Ii("onHighlightItem"),Ii("onDehighlightItem"),Ii("onHover"),Bi(),ur("dom"),Ar("navigateOnHover",!0),Ar("stayInDom",!1),Du("tmenuBehaviours",[sf,ch,Pg,pf]),Ar("eventOrder",{})],apis:{collapseMenu:(e,t)=>{e.collapseMenu(t)},highlightPrimary:(e,t)=>{e.highlightPrimary(t)},repositionMenus:(e,t)=>{e.repositionMenus(t)}},factory:(e,t)=>{const o=en(),n=ov.init(),r=t=>{const o=((t,o,n)=>le(n,((n,r)=>{const s=()=>Jf.sketch({...n,value:r,markers:e.markers,fakeFocus:e.fakeFocus,onHighlight:(e,t)=>{$s(e,nv,{menuComp:e,itemComp:t})},onDehighlight:(e,t)=>{$s(e,rv,{menuComp:e,itemComp:t})},focusManager:e.fakeFocus?Mh():Dh()});return r===o?{type:"prepared",menu:t.getSystem().build(s())}:{type:"notbuilt",nbMenu:s}})))(t,e.data.primary,e.data.menus),r=a();return n.setContents(e.data.primary,o,e.data.expansions,r),n.getPrimary()},s=e=>Au.getValue(e).value,a=t=>le(e.data.menus,((e,t)=>q(e.items,(e=>"separator"===e.type?[]:[e.data.value])))),i=ch.highlight,l=(t,o)=>{i(t,o),ch.getHighlighted(o).orThunk((()=>ch.getFirst(o))).each((n=>{e.fakeFocus?ch.highlight(o,n):Gs(t,n.element,ks())}))},c=(e,t)=>we(P(t,(t=>e.lookupMenu(t).bind((e=>"prepared"===e.type?A.some(e.menu):A.none()))))),d=(t,o,n)=>{const r=c(o,o.otherMenus(n));F(r,(o=>{Pa(o.element,[e.markers.backgroundMenu]),e.stayInDom||pf.remove(t,o)}))},m=(t,n)=>{const r=(t=>o.get().getOrThunk((()=>{const n={},r=nm(t.element,`.${e.markers.item}`),a=V(r,(e=>"true"===St(e,"aria-haspopup")));return F(a,(e=>{t.getSystem().getByDom(e).each((e=>{const t=s(e);n[t]=e}))})),o.set(n),n})))(t);ie(r,((e,t)=>{const o=B(n,t);xt(e.element,"aria-expanded",o)}))},u=(t,o,n)=>A.from(n[0]).bind((r=>o.lookupMenu(r).bind((r=>{if("notbuilt"===r.type)return A.none();{const s=r.menu,a=c(o,n.slice(1));return F(a,(t=>{Na(t.element,e.markers.backgroundMenu)})),vt(s.element)||pf.append(t,Vl(s)),Pa(s.element,[e.markers.backgroundMenu]),l(t,s),d(t,o,n),A.some(s)}}))));let g;!function(e){e[e.HighlightSubmenu=0]="HighlightSubmenu",e[e.HighlightParent=1]="HighlightParent"}(g||(g={}));const h=(t,o,r=g.HighlightSubmenu)=>{if(o.hasConfigured(Jg)&&Jg.isDisabled(o))return A.some(o);{const a=s(o);return n.expand(a).bind((s=>(m(t,s),A.from(s[0]).bind((a=>n.lookupMenu(a).bind((i=>{const l=((e,t,o)=>{if("notbuilt"===o.type){const r=e.getSystem().build(o.nbMenu());return n.setMenuBuilt(t,r),r}return o.menu})(t,a,i);return vt(l.element)||pf.append(t,Vl(l)),e.onOpenSubmenu(t,o,l,K(s)),r===g.HighlightSubmenu?(ch.highlightFirst(l),u(t,n,s)):(ch.dehighlightAll(l),A.some(o))})))))))}},p=(t,o)=>{const r=s(o);return n.collapse(r).bind((r=>(m(t,r),u(t,n,r).map((n=>(e.onCollapseMenu(t,o,n),n))))))},f=t=>(o,n)=>Xl(n.getSource(),`.${e.markers.item}`).bind((e=>o.getSystem().getByDom(e).toOptional().bind((e=>t(o,e).map(O))))),b=Xs([ea(Xf(),((e,t)=>{const o=t.event.item;n.lookupItem(s(o)).each((()=>{const o=t.event.menu;ch.highlight(e,o);const r=s(t.event.item);n.refresh(r).each((t=>d(e,n,t)))}))})),ma(((t,o)=>{const n=o.event.target;t.getSystem().getByDom(n).each((o=>{0===s(o).indexOf("collapse-item")&&p(t,o),h(t,o,g.HighlightSubmenu).fold((()=>{e.onExecute(t,o)}),v)}))})),la(((t,o)=>{r(t).each((o=>{pf.append(t,Vl(o)),e.onOpenMenu(t,o),e.highlightOnOpen===sv.HighlightMenuAndItem?l(t,o):e.highlightOnOpen===sv.HighlightJustMenu&&i(t,o)}))})),ea(nv,((t,o)=>{e.onHighlightItem(t,o.event.menuComp,o.event.itemComp)})),ea(rv,((t,o)=>{e.onDehighlightItem(t,o.event.menuComp,o.event.itemComp)})),...e.navigateOnHover?[ea(Pf(),((t,o)=>{const r=o.event.item;((e,t)=>{const o=s(t);n.refresh(o).bind((t=>(m(e,t),u(e,n,t))))})(t,r),h(t,r,g.HighlightParent),e.onHover(t,r)}))]:[]]),y=e=>ch.getHighlighted(e).bind(ch.getHighlighted),w={collapseMenu:e=>{y(e).each((t=>{p(e,t)}))},highlightPrimary:e=>{n.getPrimary().each((t=>{l(e,t)}))},repositionMenus:t=>{const o=n.getPrimary().bind((e=>y(t).bind((e=>{const t=s(e),o=pe(n.getMenus()),r=we(P(o,ov.extractPreparedMenu));return n.getTriggeringPath(t,(e=>((e,t,o)=>re(t,(e=>{if(!e.getSystem().isConnected())return A.none();const t=ch.getCandidates(e);return j(t,(e=>s(e)===o))})))(0,r,e)))})).map((t=>({primary:e,triggeringPath:t})))));o.fold((()=>{(e=>A.from(e.components()[0]).filter((e=>"menu"===St(e.element,"role"))))(t).each((o=>{e.onRepositionMenu(t,o,[])}))}),(({primary:o,triggeringPath:n})=>{e.onRepositionMenu(t,o,n)}))}};return{uid:e.uid,dom:e.dom,markers:e.markers,behaviours:Nu(e.tmenuBehaviours,[sf.config({mode:"special",onRight:f(((e,t)=>Lg(t.element)?A.none():h(e,t,g.HighlightSubmenu))),onLeft:f(((e,t)=>Lg(t.element)?A.none():p(e,t))),onEscape:f(((t,o)=>p(t,o).orThunk((()=>e.onEscape(t,o).map((()=>t)))))),focusIn:(e,t)=>{n.getPrimary().each((t=>{Gs(e,t.element,ks())}))}}),ch.config({highlightClass:e.markers.selectedMenu,itemClass:e.markers.menu}),Pg.config({find:e=>ch.getHighlighted(e)}),pf.config({})]),eventOrder:e.eventOrder,apis:w,events:b}},extraApis:{tieredData:(e,t,o)=>({primary:e,menus:t,expansions:o}),singleData:(e,t)=>({primary:e,menus:zr(e,t),expansions:{}}),collapseItem:e=>({value:Xi(av()),meta:{text:e}})}}),lv=Rg({name:"InlineView",configFields:[ur("lazySink"),Ii("onShow"),Ii("onHide"),Er("onEscape"),Du("inlineBehaviours",[cu,Au,Hc]),Or("fireDismissalEventInstead",[Ar("event",Hs())]),Or("fireRepositionEventInstead",[Ar("event",Is())]),Ar("getRelated",A.none),Ar("isExtraPart",T),Ar("eventOrder",A.none)],factory:(e,t)=>{const o=(t,o,n,r)=>{const s=e.lazySink(t).getOrDie();cu.openWhileCloaked(t,o,(()=>Hm.positionWithinBounds(s,t,n,r()))),Au.setValue(t,A.some({mode:"position",config:n,getBounds:r}))},n=(t,o,n,r)=>{const s=((e,t,o,n,r)=>{const s=()=>e.lazySink(t),a="horizontal"===n.type?{layouts:{onLtr:()=>Nc(),onRtl:()=>Rc()}}:{},i=e=>(e=>2===e.length)(e)?a:{};return iv.sketch({dom:{tag:"div"},data:n.data,markers:n.menu.markers,highlightOnOpen:n.menu.highlightOnOpen,fakeFocus:n.menu.fakeFocus,onEscape:()=>(cu.close(t),e.onEscape.map((e=>e(t))),A.some(!0)),onExecute:()=>A.some(!0),onOpenMenu:(e,t)=>{Hm.positionWithinBounds(s().getOrDie(),t,o,r())},onOpenSubmenu:(e,t,o,n)=>{const r=s().getOrDie();Hm.position(r,o,{anchor:{type:"submenu",item:t,...i(n)}})},onRepositionMenu:(e,t,n)=>{const a=s().getOrDie();Hm.positionWithinBounds(a,t,o,r()),F(n,(e=>{const t=i(e.triggeringPath);Hm.position(a,e.triggeredMenu,{anchor:{type:"submenu",item:e.triggeringItem,...t}})}))}})})(e,t,o,n,r);cu.open(t,s),Au.setValue(t,A.some({mode:"menu",menu:s}))},r=t=>{cu.isOpen(t)&&Au.getValue(t).each((o=>{switch(o.mode){case"menu":cu.getState(t).each(iv.repositionMenus);break;case"position":const n=e.lazySink(t).getOrDie();Hm.positionWithinBounds(n,t,o.config,o.getBounds())}}))},s={setContent:(e,t)=>{cu.setContent(e,t)},showAt:(e,t,n)=>{const r=A.none;o(e,t,n,r)},showWithinBounds:o,showMenuAt:(e,t,o)=>{n(e,t,o,A.none)},showMenuWithinBounds:n,hide:e=>{cu.isOpen(e)&&(Au.setValue(e,A.none()),cu.close(e))},getContent:e=>cu.getState(e),reposition:r,isOpen:cu.isOpen};return{uid:e.uid,dom:e.dom,behaviours:Nu(e.inlineBehaviours,[cu.config({isPartOf:(t,o,n)=>tc(o,n)||((t,o)=>e.getRelated(t).exists((e=>tc(e,o))))(t,n),getAttachPoint:t=>e.lazySink(t).getOrDie(),onOpen:t=>{e.onShow(t)},onClose:t=>{e.onHide(t)}}),Au.config({store:{mode:"memory",initialValue:A.none()}}),Hc.config({channels:{...hu({isExtraPart:t.isExtraPart,...e.fireDismissalEventInstead.map((e=>({fireEventInstead:{event:e.event}}))).getOr({})}),...fu({...e.fireRepositionEventInstead.map((e=>({fireEventInstead:{event:e.event}}))).getOr({}),doReposition:r})}})]),eventOrder:e.eventOrder,apis:s}},apis:{showAt:(e,t,o,n)=>{e.showAt(t,o,n)},showWithinBounds:(e,t,o,n,r)=>{e.showWithinBounds(t,o,n,r)},showMenuAt:(e,t,o,n)=>{e.showMenuAt(t,o,n)},showMenuWithinBounds:(e,t,o,n,r)=>{e.showMenuWithinBounds(t,o,n,r)},hide:(e,t)=>{e.hide(t)},isOpen:(e,t)=>e.isOpen(t),getContent:(e,t)=>e.getContent(t),setContent:(e,t,o)=>{e.setContent(t,o)},reposition:(e,t)=>{e.reposition(t)}}});var cv,dv,mv=tinymce.util.Tools.resolve("tinymce.util.Delay"),uv=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),gv=tinymce.util.Tools.resolve("tinymce.EditorManager"),hv=tinymce.util.Tools.resolve("tinymce.Env");!function(e){e.default="wrap",e.floating="floating",e.sliding="sliding",e.scrolling="scrolling"}(cv||(cv={})),function(e){e.auto="auto",e.top="top",e.bottom="bottom"}(dv||(dv={}));const pv=e=>t=>t.options.get(e),fv=e=>t=>A.from(e(t)),vv=e=>{const t=hv.deviceType.isPhone(),o=hv.deviceType.isTablet()||t,n=e.options.register,r=e=>s(e)||!1===e,a=e=>s(e)||p(e);n("skin",{processor:e=>s(e)||!1===e,default:"oxide"}),n("skin_url",{processor:"string"}),n("height",{processor:a,default:Math.max(e.getElement().offsetHeight,400)}),n("width",{processor:a,default:uv.DOM.getStyle(e.getElement(),"width")}),n("min_height",{processor:"number",default:100}),n("min_width",{processor:"number"}),n("max_height",{processor:"number"}),n("max_width",{processor:"number"}),n("style_formats",{processor:"object[]"}),n("style_formats_merge",{processor:"boolean",default:!1}),n("style_formats_autohide",{processor:"boolean",default:!1}),n("line_height_formats",{processor:"string",default:"1 1.1 1.2 1.3 1.4 1.5 2"}),n("font_family_formats",{processor:"string",default:"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"}),n("font_size_formats",{processor:"string",default:"8pt 10pt 12pt 14pt 18pt 24pt 36pt"}),n("font_size_input_default_unit",{processor:"string",default:"pt"}),n("block_formats",{processor:"string",default:"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre"}),n("content_langs",{processor:"object[]"}),n("removed_menuitems",{processor:"string",default:""}),n("menubar",{processor:e=>s(e)||d(e),default:!t}),n("menu",{processor:"object",default:{}}),n("toolbar",{processor:e=>d(e)||s(e)||l(e)?{value:e,valid:!0}:{valid:!1,message:"Must be a boolean, string or array."},default:!0}),H(9,(e=>{n("toolbar"+(e+1),{processor:"string"})})),n("toolbar_mode",{processor:"string",default:o?"scrolling":"floating"}),n("toolbar_groups",{processor:"object",default:{}}),n("toolbar_location",{processor:"string",default:dv.auto}),n("toolbar_persist",{processor:"boolean",default:!1}),n("toolbar_sticky",{processor:"boolean",default:e.inline}),n("toolbar_sticky_offset",{processor:"number",default:0}),n("fixed_toolbar_container",{processor:"string",default:""}),n("fixed_toolbar_container_target",{processor:"object"}),n("ui_mode",{processor:"string",default:"combined"}),n("file_picker_callback",{processor:"function"}),n("file_picker_validator_handler",{processor:"function"}),n("file_picker_types",{processor:"string"}),n("typeahead_urls",{processor:"boolean",default:!0}),n("anchor_top",{processor:r,default:"#top"}),n("anchor_bottom",{processor:r,default:"#bottom"}),n("draggable_modal",{processor:"boolean",default:!1}),n("statusbar",{processor:"boolean",default:!0}),n("elementpath",{processor:"boolean",default:!0}),n("branding",{processor:"boolean",default:!0}),n("promotion",{processor:"boolean",default:!0}),n("resize",{processor:e=>"both"===e||d(e),default:!hv.deviceType.isTouch()}),n("sidebar_show",{processor:"string"}),n("help_accessibility",{processor:"boolean",default:e.hasPlugin("help")}),n("default_font_stack",{processor:"string[]",default:[]})},bv=pv("readonly"),yv=pv("height"),wv=pv("width"),xv=fv(pv("min_width")),Cv=fv(pv("min_height")),Sv=fv(pv("max_width")),kv=fv(pv("max_height")),_v=fv(pv("style_formats")),Ev=pv("style_formats_merge"),Tv=pv("style_formats_autohide"),Ov=pv("content_langs"),Av=pv("removed_menuitems"),Dv=pv("toolbar_mode"),Mv=pv("toolbar_groups"),Nv=pv("toolbar_location"),Rv=pv("fixed_toolbar_container"),Bv=pv("fixed_toolbar_container_target"),Lv=pv("toolbar_persist"),Hv=pv("toolbar_sticky_offset"),Iv=pv("menubar"),Pv=pv("toolbar"),Fv=pv("file_picker_callback"),zv=pv("file_picker_validator_handler"),Vv=pv("font_size_input_default_unit"),Zv=pv("file_picker_types"),Uv=pv("typeahead_urls"),jv=pv("anchor_top"),Wv=pv("anchor_bottom"),$v=pv("draggable_modal"),qv=pv("statusbar"),Gv=pv("elementpath"),Kv=pv("branding"),Yv=pv("resize"),Xv=pv("paste_as_text"),Jv=pv("sidebar_show"),Qv=pv("promotion"),eb=pv("help_accessibility"),tb=pv("default_font_stack"),ob=e=>!1===e.options.get("skin"),nb=e=>!1!==e.options.get("menubar"),rb=e=>{const t=e.options.get("skin_url");if(ob(e))return t;if(t)return e.documentBaseURI.toAbsolute(t);{const t=e.options.get("skin");return gv.baseURL+"/skins/ui/"+t}},sb=e=>A.from(e.options.get("skin_url")),ab=e=>e.options.get("line_height_formats").split(" "),ib=e=>{const t=Pv(e),o=s(t),n=l(t)&&t.length>0;return!cb(e)&&(n||o||!0===t)},lb=e=>{const t=H(9,(t=>e.options.get("toolbar"+(t+1)))),o=V(t,s);return Se(o.length>0,o)},cb=e=>lb(e).fold((()=>{const t=Pv(e);return f(t,s)&&t.length>0}),O),db=e=>Nv(e)===dv.bottom,mb=e=>{var t;if(!e.inline)return A.none();const o=null!==(t=Rv(e))&&void 0!==t?t:"";if(o.length>0)return Yl(bt(),o);const n=Bv(e);return g(n)?A.some(Be.fromDom(n)):A.none()},ub=e=>e.inline&&mb(e).isSome(),gb=e=>mb(e).getOrThunk((()=>gt(ut(Be.fromDom(e.getElement()))))),hb=e=>e.inline&&!nb(e)&&!ib(e)&&!cb(e),pb=e=>(e.options.get("toolbar_sticky")||e.inline)&&!ub(e)&&!hb(e),fb=e=>!ub(e)&&"split"===e.options.get("ui_mode"),vb=e=>{const t=e.options.get("menu");return le(t,(e=>({...e,items:e.items})))};var bb=Object.freeze({__proto__:null,get ToolbarMode(){return cv},get ToolbarLocation(){return dv},register:vv,getSkinUrl:rb,getSkinUrlOption:sb,isReadOnly:bv,isSkinDisabled:ob,getHeightOption:yv,getWidthOption:wv,getMinWidthOption:xv,getMinHeightOption:Cv,getMaxWidthOption:Sv,getMaxHeightOption:kv,getUserStyleFormats:_v,shouldMergeStyleFormats:Ev,shouldAutoHideStyleFormats:Tv,getLineHeightFormats:ab,getContentLanguages:Ov,getRemovedMenuItems:Av,isMenubarEnabled:nb,isMultipleToolbars:cb,isToolbarEnabled:ib,isToolbarPersist:Lv,getMultipleToolbarsOption:lb,getUiContainer:gb,useFixedContainer:ub,isSplitUiMode:fb,getToolbarMode:Dv,isDraggableModal:$v,isDistractionFree:hb,isStickyToolbar:pb,getStickyToolbarOffset:Hv,getToolbarLocation:Nv,isToolbarLocationBottom:db,getToolbarGroups:Mv,getMenus:vb,getMenubar:Iv,getToolbar:Pv,getFilePickerCallback:Fv,getFilePickerTypes:Zv,useTypeaheadUrls:Uv,getAnchorTop:jv,getAnchorBottom:Wv,getFilePickerValidatorHandler:zv,getFontSizeInputDefaultUnit:Vv,useStatusBar:qv,useElementPath:Gv,promotionEnabled:Qv,useBranding:Kv,getResize:Yv,getPasteAsText:Xv,getSidebarShow:Jv,useHelpAccessibility:eb,getDefaultFontStack:tb});const yb=["visible","hidden","clip"],wb=e=>Ae(e).length>0&&!B(yb,e),xb=e=>{if(Ze(e)){const t=Nt(e,"overflow-x"),o=Nt(e,"overflow-y");return wb(t)||wb(o)}return!1},Cb=(e,t)=>fb(e)?((e,t)=>{const o=om(t,xb),n=0===o.length?ht(t).map(pt).map((e=>om(e,xb))).getOr([]):o;return te(n).map((t=>({element:t,others:n.slice(1),isFullscreen:()=>(e=>e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen())(e)})))})(e,t):A.none(),Sb=e=>{const t=[...P(e.others,qo),Yo()];return e.isFullscreen()?Yo():((e,t)=>U(t,((e,t)=>Ko(e,t)),e))(qo(e.element),t)},kb=Rg({name:"Button",factory:e=>{const t=Nf(e.action),o=e.dom.tag,n=t=>fe(e.dom,"attributes").bind((e=>fe(e,t)));return{uid:e.uid,dom:e.dom,components:e.components,events:t,behaviours:Bu(e.buttonBehaviours,[xf.config({}),sf.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:(()=>{if("button"===o){return{type:n("type").getOr("button"),...n("role").map((e=>({role:e}))).getOr({})}}return{role:e.role.getOr(n("role").getOr("button"))}})()},eventOrder:e.eventOrder}},configFields:[Ar("uid",void 0),ur("dom"),Ar("components",[]),Ru("buttonBehaviours",[xf,sf]),xr("action"),xr("role"),Ar("eventOrder",{})]}),_b=e=>{const t=Be.fromHtml(e),o=at(t),n=(e=>{const t=void 0!==e.dom.attributes?e.dom.attributes:[];return U(t,((e,t)=>"class"===t.name?e:{...e,[t.name]:t.value}),{})})(t),r=(e=>Array.prototype.slice.call(e.dom.classList,0))(t),s=0===o.length?{}:{innerHtml:bi(t)};return{tag:ze(t),classes:r,attributes:n,...s}},Eb=e=>{const t=(e=>void 0!==e.uid)(e)&&be(e,"uid")?e.uid:rl("memento");return{get:e=>e.getSystem().getByUid(t).getOrDie(),getOpt:e=>e.getSystem().getByUid(t).toOptional(),asSpec:()=>({...e,uid:t})}};var Tb=Object.freeze({__proto__:null,exhibit:(e,t)=>ha({attributes:Vr([{key:t.tabAttr,value:"true"}])})}),Ob=[Ar("tabAttr","data-alloy-tabstop")];const Ab=Sa({fields:Ob,name:"tabstopping",active:Tb}),Db=Xi("tooltip.exclusive"),Mb=Xi("tooltip.show"),Nb=Xi("tooltip.hide"),Rb=Xi("tooltip.immediateHide"),Bb=Xi("tooltip.immediateShow"),Lb=(e,t,o)=>{e.getSystem().broadcastOn([Db],{})};var Hb=Object.freeze({__proto__:null,hideAllExclusive:Lb,immediateOpenClose:(e,t,o,n)=>Ws(e,n?Bb:Rb),isEnabled:(e,t,o)=>o.isEnabled(),setComponents:(e,t,o,n)=>{o.getTooltip().each((e=>{e.getSystem().isConnected()&&pf.set(e,n)}))},setEnabled:(e,t,o,n)=>o.setEnabled(n)});var Ib=Object.freeze({__proto__:null,events:(e,t)=>{const o=o=>{t.getTooltip().each((n=>{n.getSystem().isConnected()&&(qm(n),e.onHide(o,n),t.clearTooltip())})),t.clearTimer()},n=o=>{if(!t.isShowing()&&t.isEnabled()){Lb(o);const n=e.lazySink(o).getOrDie(),r=o.getSystem().build({dom:e.tooltipDom,components:e.tooltipComponents,events:Xs("normal"===e.mode?[ea(ss(),(e=>{Ws(o,Mb)})),ea(ns(),(e=>{Ws(o,Nb)}))]:[]),behaviours:xa([pf.config({})])});t.setTooltip(r),jm(n,r),e.onShow(o,r),Hm.position(n,r,{anchor:e.anchor(o)})}},r=o=>{t.getTooltip().each((t=>{const n=e.lazySink(o).getOrDie();Hm.position(n,t,{anchor:e.anchor(o)})}))};return Xs($([[da((t=>{e.onSetup(t)})),ea(Mb,(o=>{t.resetTimer((()=>{n(o)}),e.delayForShow())})),ea(Nb,(n=>{t.resetTimer((()=>{o(n)}),e.delayForHide())})),ea(Bb,(e=>{t.resetTimer((()=>{n(e)}),0)})),ea(Rb,(e=>{t.resetTimer((()=>{o(e)}),0)})),ea(Cs(),((e,t)=>{const n=t;n.universal||B(n.channels,Db)&&o(e)})),ca((e=>{o(e)}))],(()=>{switch(e.mode){case"normal":return[ea(as(),(e=>{Ws(e,Bb)})),ea(ws(),(e=>{Ws(e,Rb)})),ea(ss(),(e=>{Ws(e,Mb)})),ea(ns(),(e=>{Ws(e,Nb)}))];case"follow-highlight":return[ea(Us(),((e,t)=>{Ws(e,Mb)})),ea(js(),(e=>{Ws(e,Nb)}))];case"children-normal":return[ea(as(),((o,n)=>{Zc(o.element).each((s=>{Ge(n.event.target,"[data-mce-tooltip]")&&t.getTooltip().fold((()=>{Ws(o,Bb)}),(n=>{t.isShowing()&&(e.onShow(o,n),r(o))}))}))})),ea(ws(),(e=>{Zc(e.element).fold((()=>{Ws(e,Rb)}),v)})),ea(ss(),(o=>{Yl(o.element,"[data-mce-tooltip]:hover").each((n=>{t.getTooltip().fold((()=>{Ws(o,Mb)}),(n=>{t.isShowing()&&(e.onShow(o,n),r(o))}))}))})),ea(ns(),(e=>{Yl(e.element,"[data-mce-tooltip]:hover").fold((()=>{Ws(e,Nb)}),v)}))];default:return[ea(as(),((o,n)=>{Zc(o.element).each((s=>{Ge(n.event.target,"[data-mce-tooltip]")&&t.getTooltip().fold((()=>{Ws(o,Bb)}),(n=>{t.isShowing()&&(e.onShow(o,n),r(o))}))}))})),ea(ws(),(e=>{Zc(e.element).fold((()=>{Ws(e,Rb)}),v)}))]}})()]))}}),Pb=[ur("lazySink"),ur("tooltipDom"),Ar("exclusive",!0),Ar("tooltipComponents",[]),Lr("delayForShow",w(300)),Lr("delayForHide",w(300)),Lr("onSetup",v),Rr("mode","normal",["normal","follow-highlight","children-keyboard-focus","children-normal"]),Ar("anchor",(e=>({type:"hotspot",hotspot:e,layouts:{onLtr:w([_c,kc,wc,Cc,xc,Sc]),onRtl:w([_c,kc,wc,Cc,xc,Sc])},bubble:xd(0,-2,{})}))),Ii("onHide"),Ii("onShow")];var Fb=Object.freeze({__proto__:null,init:()=>{const e=Xo(!0),t=en(),o=en(),n=()=>{t.on(clearTimeout)},r=w("not-implemented");return wa({getTooltip:o.get,isShowing:o.isSet,setTooltip:o.set,clearTooltip:o.clear,clearTimer:n,resetTimer:(e,o)=>{n(),t.set(setTimeout(e,o))},readState:r,isEnabled:()=>e.get(),setEnabled:t=>e.set(t)})}});const zb=Sa({fields:Pb,name:"tooltipping",active:Ib,state:Fb,apis:Hb}),{entries:Vb,setPrototypeOf:Zb,isFrozen:Ub,getPrototypeOf:jb,getOwnPropertyDescriptor:Wb}=Object;let{freeze:$b,seal:qb,create:Gb}=Object,{apply:Kb,construct:Yb}="undefined"!=typeof Reflect&&Reflect;Kb||(Kb=function(e,t,o){return e.apply(t,o)}),$b||($b=function(e){return e}),qb||(qb=function(e){return e}),Yb||(Yb=function(e,t){return new e(...t)});const Xb=cy(Array.prototype.forEach),Jb=cy(Array.prototype.pop),Qb=cy(Array.prototype.push),ey=cy(String.prototype.toLowerCase),ty=cy(String.prototype.toString),oy=cy(String.prototype.match),ny=cy(String.prototype.replace),ry=cy(String.prototype.indexOf),sy=cy(String.prototype.trim),ay=cy(RegExp.prototype.test),iy=(ly=TypeError,function(){for(var e=arguments.length,t=new Array(e),o=0;o1?o-1:0),r=1;r/gm),Ey=qb(/\${[\w\W]*}/gm),Ty=qb(/^data-[\-\w.\u00B7-\uFFFF]/),Oy=qb(/^aria-[\-\w]+$/),Ay=qb(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Dy=qb(/^(?:\w+script|data):/i),My=qb(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ny=qb(/^html$/i);var Ry=Object.freeze({__proto__:null,MUSTACHE_EXPR:ky,ERB_EXPR:_y,TMPLIT_EXPR:Ey,DATA_ATTR:Ty,ARIA_ATTR:Oy,IS_ALLOWED_URI:Ay,IS_SCRIPT_OR_DATA:Dy,ATTR_WHITESPACE:My,DOCTYPE_NAME:Ny});const By=()=>"undefined"==typeof window?null:window;var Ly=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:By();const o=t=>e(t);if(o.version="3.0.5",o.removed=[],!t||!t.document||9!==t.document.nodeType)return o.isSupported=!1,o;const n=t.document,r=n.currentScript;let{document:s}=t;const{DocumentFragment:a,HTMLTemplateElement:i,Node:l,Element:c,NodeFilter:d,NamedNodeMap:m=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:u,DOMParser:g,trustedTypes:h}=t,p=c.prototype,f=uy(p,"cloneNode"),v=uy(p,"nextSibling"),b=uy(p,"childNodes"),y=uy(p,"parentNode");if("function"==typeof i){const e=s.createElement("template");e.content&&e.content.ownerDocument&&(s=e.content.ownerDocument)}let w,x="";const{implementation:C,createNodeIterator:S,createDocumentFragment:k,getElementsByTagName:_}=s,{importNode:E}=n;let T={};o.isSupported="function"==typeof Vb&&"function"==typeof y&&C&&void 0!==C.createHTMLDocument;const{MUSTACHE_EXPR:O,ERB_EXPR:A,TMPLIT_EXPR:D,DATA_ATTR:M,ARIA_ATTR:N,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:B}=Ry;let{IS_ALLOWED_URI:L}=Ry,H=null;const I=dy({},[...gy,...hy,...py,...vy,...yy]);let P=null;const F=dy({},[...wy,...xy,...Cy,...Sy]);let z=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),V=null,Z=null,U=!0,j=!0,W=!1,$=!0,q=!1,G=!1,K=!1,Y=!1,X=!1,J=!1,Q=!1,ee=!0,te=!1,oe=!0,ne=!1,re={},se=null;const ae=dy({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ie=null;const le=dy({},["audio","video","img","source","image","track"]);let ce=null;const de=dy({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),me="http://www.w3.org/1998/Math/MathML",ue="http://www.w3.org/2000/svg",ge="http://www.w3.org/1999/xhtml";let he=ge,pe=!1,fe=null;const ve=dy({},[me,ue,ge],ty);let be;const ye=["application/xhtml+xml","text/html"];let we,xe=null;const Ce=s.createElement("form"),Se=function(e){return e instanceof RegExp||e instanceof Function},ke=function(e){if(!xe||xe!==e){if(e&&"object"==typeof e||(e={}),e=my(e),be=be=-1===ye.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,we="application/xhtml+xml"===be?ty:ey,H="ALLOWED_TAGS"in e?dy({},e.ALLOWED_TAGS,we):I,P="ALLOWED_ATTR"in e?dy({},e.ALLOWED_ATTR,we):F,fe="ALLOWED_NAMESPACES"in e?dy({},e.ALLOWED_NAMESPACES,ty):ve,ce="ADD_URI_SAFE_ATTR"in e?dy(my(de),e.ADD_URI_SAFE_ATTR,we):de,ie="ADD_DATA_URI_TAGS"in e?dy(my(le),e.ADD_DATA_URI_TAGS,we):le,se="FORBID_CONTENTS"in e?dy({},e.FORBID_CONTENTS,we):ae,V="FORBID_TAGS"in e?dy({},e.FORBID_TAGS,we):{},Z="FORBID_ATTR"in e?dy({},e.FORBID_ATTR,we):{},re="USE_PROFILES"in e&&e.USE_PROFILES,U=!1!==e.ALLOW_ARIA_ATTR,j=!1!==e.ALLOW_DATA_ATTR,W=e.ALLOW_UNKNOWN_PROTOCOLS||!1,$=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,q=e.SAFE_FOR_TEMPLATES||!1,G=e.WHOLE_DOCUMENT||!1,X=e.RETURN_DOM||!1,J=e.RETURN_DOM_FRAGMENT||!1,Q=e.RETURN_TRUSTED_TYPE||!1,Y=e.FORCE_BODY||!1,ee=!1!==e.SANITIZE_DOM,te=e.SANITIZE_NAMED_PROPS||!1,oe=!1!==e.KEEP_CONTENT,ne=e.IN_PLACE||!1,L=e.ALLOWED_URI_REGEXP||Ay,he=e.NAMESPACE||ge,z=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(z.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(z.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(z.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(j=!1),J&&(X=!0),re&&(H=dy({},[...yy]),P=[],!0===re.html&&(dy(H,gy),dy(P,wy)),!0===re.svg&&(dy(H,hy),dy(P,xy),dy(P,Sy)),!0===re.svgFilters&&(dy(H,py),dy(P,xy),dy(P,Sy)),!0===re.mathMl&&(dy(H,vy),dy(P,Cy),dy(P,Sy))),e.ADD_TAGS&&(H===I&&(H=my(H)),dy(H,e.ADD_TAGS,we)),e.ADD_ATTR&&(P===F&&(P=my(P)),dy(P,e.ADD_ATTR,we)),e.ADD_URI_SAFE_ATTR&&dy(ce,e.ADD_URI_SAFE_ATTR,we),e.FORBID_CONTENTS&&(se===ae&&(se=my(se)),dy(se,e.FORBID_CONTENTS,we)),oe&&(H["#text"]=!0),G&&dy(H,["html","head","body"]),H.table&&(dy(H,["tbody"]),delete V.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw iy('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw iy('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,x=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let o=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(o=t.getAttribute(n));const r="dompurify"+(o?"#"+o:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(h,r)),null!==w&&"string"==typeof x&&(x=w.createHTML(""));$b&&$b(e),xe=e}},_e=dy({},["mi","mo","mn","ms","mtext"]),Ee=dy({},["foreignobject","desc","title","annotation-xml"]),Te=dy({},["title","style","font","a","script"]),Oe=dy({},hy);dy(Oe,py),dy(Oe,fy);const Ae=dy({},vy);dy(Ae,by);const De=function(e){Qb(o.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},Me=function(e,t){try{Qb(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Qb(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!P[e])if(X||J)try{De(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Ne=function(e){let t,o;if(Y)e=""+e;else{const t=oy(e,/^[\r\n\t ]+/);o=t&&t[0]}"application/xhtml+xml"===be&&he===ge&&(e=''+e+"");const n=w?w.createHTML(e):e;if(he===ge)try{t=(new g).parseFromString(n,be)}catch(e){}if(!t||!t.documentElement){t=C.createDocument(he,"template",null);try{t.documentElement.innerHTML=pe?x:n}catch(e){}}const r=t.body||t.documentElement;return e&&o&&r.insertBefore(s.createTextNode(o),r.childNodes[0]||null),he===ge?_.call(t,G?"html":"body")[0]:G?t.documentElement:r},Re=function(e){return S.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT,null,!1)},Be=function(e){return"object"==typeof l?e instanceof l:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Le=function(e,t,n){T[e]&&Xb(T[e],(e=>{e.call(o,t,n,xe)}))},He=function(e){let t;if(Le("beforeSanitizeElements",e,null),(n=e)instanceof u&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof m)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return De(e),!0;var n;const r=we(e.nodeName);if(Le("uponSanitizeElement",e,{tagName:r,allowedTags:H}),e.hasChildNodes()&&!Be(e.firstElementChild)&&(!Be(e.content)||!Be(e.content.firstElementChild))&&ay(/<[/\w]/g,e.innerHTML)&&ay(/<[/\w]/g,e.textContent))return De(e),!0;if(!H[r]||V[r]){if(!V[r]&&Pe(r)){if(z.tagNameCheck instanceof RegExp&&ay(z.tagNameCheck,r))return!1;if(z.tagNameCheck instanceof Function&&z.tagNameCheck(r))return!1}if(oe&&!se[r]){const t=y(e)||e.parentNode,o=b(e)||e.childNodes;if(o&&t){for(let n=o.length-1;n>=0;--n)t.insertBefore(f(o[n],!0),v(e))}}return De(e),!0}return e instanceof c&&!function(e){let t=y(e);t&&t.tagName||(t={namespaceURI:he,tagName:"template"});const o=ey(e.tagName),n=ey(t.tagName);return!!fe[e.namespaceURI]&&(e.namespaceURI===ue?t.namespaceURI===ge?"svg"===o:t.namespaceURI===me?"svg"===o&&("annotation-xml"===n||_e[n]):Boolean(Oe[o]):e.namespaceURI===me?t.namespaceURI===ge?"math"===o:t.namespaceURI===ue?"math"===o&&Ee[n]:Boolean(Ae[o]):e.namespaceURI===ge?!(t.namespaceURI===ue&&!Ee[n])&&!(t.namespaceURI===me&&!_e[n])&&!Ae[o]&&(Te[o]||!Oe[o]):!("application/xhtml+xml"!==be||!fe[e.namespaceURI]))}(e)?(De(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!ay(/<\/no(script|embed|frames)/i,e.innerHTML)?(q&&3===e.nodeType&&(t=e.textContent,t=ny(t,O," "),t=ny(t,A," "),t=ny(t,D," "),e.textContent!==t&&(Qb(o.removed,{element:e.cloneNode()}),e.textContent=t)),Le("afterSanitizeElements",e,null),!1):(De(e),!0)},Ie=function(e,t,o){if(ee&&("id"===t||"name"===t)&&(o in s||o in Ce))return!1;if(j&&!Z[t]&&ay(M,t));else if(U&&ay(N,t));else if(!P[t]||Z[t]){if(!(Pe(e)&&(z.tagNameCheck instanceof RegExp&&ay(z.tagNameCheck,e)||z.tagNameCheck instanceof Function&&z.tagNameCheck(e))&&(z.attributeNameCheck instanceof RegExp&&ay(z.attributeNameCheck,t)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(t))||"is"===t&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&ay(z.tagNameCheck,o)||z.tagNameCheck instanceof Function&&z.tagNameCheck(o))))return!1}else if(ce[t]);else if(ay(L,ny(o,B,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==ry(o,"data:")||!ie[e]){if(W&&!ay(R,ny(o,B,"")));else if(o)return!1}else;return!0},Pe=function(e){return e.indexOf("-")>0},Fe=function(e){let t,o,n,r;Le("beforeSanitizeAttributes",e,null);const{attributes:s}=e;if(!s)return;const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:P};for(r=s.length;r--;){t=s[r];const{name:i,namespaceURI:l}=t;o="value"===i?t.value:sy(t.value);const c=o;if(n=we(i),a.attrName=n,a.attrValue=o,a.keepAttr=!0,a.forceKeepAttr=void 0,Le("uponSanitizeAttribute",e,a),o=a.attrValue,a.forceKeepAttr)continue;if(!a.keepAttr){Me(i,e);continue}if(!$&&ay(/\/>/i,o)){Me(i,e);continue}q&&(o=ny(o,O," "),o=ny(o,A," "),o=ny(o,D," "));const d=we(e.nodeName);if(Ie(d,n,o)){if(!te||"id"!==n&&"name"!==n||(Me(i,e),o="user-content-"+o),w&&"object"==typeof h&&"function"==typeof h.getAttributeType)if(l);else switch(h.getAttributeType(d,n)){case"TrustedHTML":o=w.createHTML(o);break;case"TrustedScriptURL":o=w.createScriptURL(o)}if(o!==c)try{l?e.setAttributeNS(l,i,o):e.setAttribute(i,o)}catch(t){Me(i,e)}}else Me(i,e)}Le("afterSanitizeAttributes",e,null)},ze=function e(t){let o;const n=Re(t);for(Le("beforeSanitizeShadowDOM",t,null);o=n.nextNode();)Le("uponSanitizeShadowNode",o,null),He(o)||(o.content instanceof a&&e(o.content),Fe(o));Le("afterSanitizeShadowDOM",t,null)};return o.sanitize=function(e){let t,r,s,i,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(pe=!e,pe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Be(e)){if("function"!=typeof e.toString)throw iy("toString is not a function");if("string"!=typeof(e=e.toString()))throw iy("dirty is not a string, aborting")}if(!o.isSupported)return e;if(K||ke(c),o.removed=[],"string"==typeof e&&(ne=!1),ne){if(e.nodeName){const t=we(e.nodeName);if(!H[t]||V[t])throw iy("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)t=Ne("\x3c!----\x3e"),r=t.ownerDocument.importNode(e,!0),1===r.nodeType&&"BODY"===r.nodeName||"HTML"===r.nodeName?t=r:t.appendChild(r);else{if(!X&&!q&&!G&&-1===e.indexOf("<"))return w&&Q?w.createHTML(e):e;if(t=Ne(e),!t)return X?null:Q?x:""}t&&Y&&De(t.firstChild);const d=Re(ne?e:t);for(;s=d.nextNode();)He(s)||(s.content instanceof a&&ze(s.content),Fe(s));if(ne)return e;if(X){if(J)for(i=k.call(t.ownerDocument);t.firstChild;)i.appendChild(t.firstChild);else i=t;return(P.shadowroot||P.shadowrootmode)&&(i=E.call(n,i,!0)),i}let m=G?t.outerHTML:t.innerHTML;return G&&H["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&ay(Ny,t.ownerDocument.doctype.name)&&(m="\n"+m),q&&(m=ny(m,O," "),m=ny(m,A," "),m=ny(m,D," ")),w&&Q?w.createHTML(m):m},o.setConfig=function(e){ke(e),K=!0},o.clearConfig=function(){xe=null,K=!1},o.isValidAttribute=function(e,t,o){xe||ke({});const n=we(e),r=we(t);return Ie(n,r,o)},o.addHook=function(e,t){"function"==typeof t&&(T[e]=T[e]||[],Qb(T[e],t))},o.removeHook=function(e){if(T[e])return Jb(T[e])},o.removeHooks=function(e){T[e]&&(T[e]=[])},o.removeAllHooks=function(){T={}},o}();const Hy=e=>Ly().sanitize(e);var Iy=tinymce.util.Tools.resolve("tinymce.util.I18n");const Py={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},Fy="temporary-placeholder",zy=e=>()=>fe(e,Fy).getOr("!not found!"),Vy=(e,t)=>{const o=e.toLowerCase();if(Iy.isRtl()){const e=((e,t)=>Oe(e,t)?e:((e,t)=>e+t)(e,t))(o,"-rtl");return ve(t,e)?e:o}return o},Zy=(e,t)=>fe(t,Vy(e,t)),Uy=(e,t)=>{const o=t();return Zy(e,o).getOrThunk(zy(o))},jy=()=>ff("add-focusable",[la((e=>{Kl(e.element,"svg").each((e=>xt(e,"focusable","false")))}))]),Wy=(e,t,o,n)=>{var r,s;const a=(e=>!!Iy.isRtl()&&ve(Py,e))(t)?["tox-icon--flip"]:[],i=fe(o,Vy(t,o)).or(n).getOrThunk(zy(o));return{dom:{tag:e.tag,attributes:null!==(r=e.attributes)&&void 0!==r?r:{},classes:e.classes.concat(a),innerHtml:i},behaviours:xa([...null!==(s=e.behaviours)&&void 0!==s?s:[],jy()])}},$y=(e,t,o,n=A.none())=>Wy(t,e,o(),n),qy={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Gy=Rg({name:"Notification",factory:e=>{const t=Xi("notification-text"),o=Eb({dom:_b(`

    ${Hy(e.backstageProvider.translate(e.text))}

    `),behaviours:xa([pf.config({})])}),n=e=>({dom:{tag:"div",classes:["tox-bar"],styles:{width:`${e}%`}}}),r=e=>({dom:{tag:"div",classes:["tox-text"],innerHtml:`${e}%`}}),s=Eb({dom:{tag:"div",classes:e.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(0)]},r(0)],behaviours:xa([pf.config({})])}),a={updateProgress:(e,t)=>{e.getSystem().isConnected()&&s.getOpt(e).each((e=>{pf.set(e,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(t)]},r(t)])}))},updateText:(e,t)=>{if(e.getSystem().isConnected()){const n=o.get(e);pf.set(n,[Hl(t)])}}},i=$([e.icon.toArray(),e.level.toArray(),e.level.bind((e=>A.from(qy[e]))).toArray()]),l=Eb(kb.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"],attributes:{"aria-label":e.backstageProvider.translate("Close")}},components:[$y("close",{tag:"span",classes:["tox-icon"]},e.iconProvider)],buttonBehaviours:xa([Ab.config({}),zb.config({...e.backstageProvider.tooltips.getConfig({tooltipText:e.backstageProvider.translate("Close")})})]),action:t=>{e.onAction(t)}})),c=((e,t,o)=>{const n=o(),r=j(e,(e=>ve(n,Vy(e,n))));return Wy(t,r.getOr(Fy),n,A.none())})(i,{tag:"div",classes:["tox-notification__icon"]},e.iconProvider),d=[c,{dom:{tag:"div",classes:["tox-notification__body"]},components:[o.asSpec()],behaviours:xa([pf.config({})])}];return{uid:e.uid,dom:{tag:"div",attributes:{role:"alert","aria-labelledby":t},classes:e.level.map((e=>["tox-notification","tox-notification--in",`tox-notification--${e}`])).getOr(["tox-notification","tox-notification--in"])},behaviours:xa([Ab.config({}),xf.config({}),sf.config({mode:"special",onEscape:t=>(e.onAction(t),A.some(!0))})]),components:d.concat(e.progress?[s.asSpec()]:[]).concat([l.asSpec()]),apis:a}},configFields:[xr("level"),ur("progress"),xr("icon"),ur("onAction"),ur("text"),ur("iconProvider"),ur("backstageProvider")],apis:{updateProgress:(e,t,o)=>{e.updateProgress(t,o)},updateText:(e,t,o)=>{e.updateText(t,o)}}});var Ky=(e,t,o,n)=>{const r=t.backstage.shared,s=()=>Be.fromDom(""===e.queryCommandValue("ToggleView")?e.getContentAreaContainer():e.getContainer()),a=()=>{const e=qo(s());return A.some(e)},i=e=>{a().each((t=>{F(e,(e=>{It(e.element,"width"),Kt(e.element)>t.width&&At(e.element,"width",t.width+"px")}))}))};return{open:(t,l,c)=>{const d=()=>{const t=(t,o)=>{lv.hide(t),n.clear(),o&&e.focus()},o=(e,t)=>{t&&sf.focusIn(e)};n.on((e=>{l();const n=c();(e=>{pf.remove(e,m),u()})(e),((e,n)=>{0===at(e.element).length?t(e,n):o(e,n)})(e,n)}))},m=zl(Gy.sketch({text:t.text,level:B(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:t.icon,onAction:d,iconProvider:r.providers.icons,backstageProvider:r.providers}));if(n.isSet()){const e=Vl(m);n.on((t=>{pf.append(t,e),lv.reposition(t),Wi.refresh(t),i(t.components())}))}else{const t=zl(lv.sketch({dom:{tag:"div",classes:["tox-notifications-container"],attributes:{"aria-label":"Notifications",role:"region"}},lazySink:r.getSink,fireDismissalEventInstead:{},...r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}},inlineBehaviours:xa([sf.config({mode:"cyclic",selector:".tox-notification, .tox-notification a, .tox-notification button"}),pf.config({}),...pb(e)&&!r.header.isPositionedAtTop()?[]:[Wi.config({contextual:{lazyContext:()=>A.some(qo(s())),fadeInClass:"tox-notification-container-dock-fadein",fadeOutClass:"tox-notification-container-dock-fadeout",transitionClass:"tox-notification-container-dock-transition"},modes:["top"],lazyViewport:t=>Cb(e,t.element).map((e=>({bounds:Sb(e),optScrollEnv:A.some({currentScrollTop:e.element.dom.scrollTop,scrollElmTop:$t(e.element).top})}))).getOrThunk((()=>({bounds:Yo(),optScrollEnv:A.none()})))})]])})),i=Vl(m),l={maxHeightFunction:vd()},c={...r.anchors.banner(),overrides:l};n.set(t),o.add(t),lv.showWithinBounds(t,i,{anchor:c},a)}p(t.timeout)&&t.timeout>0&&mv.setEditorTimeout(e,(()=>{d()}),t.timeout);const u=()=>{n.on((e=>{lv.reposition(e),Wi.refresh(e),i(e.components())}))};return{close:d,reposition:u,text:e=>{Gy.updateText(m,e)},settings:t,getEl:()=>m.element.dom,progressBar:{value:e=>{Gy.updateProgress(m,e)}}}},close:e=>{e.close()},getArgs:e=>e.settings}};const Yy=(e,t)=>{const o=(e,t)=>{$s(e,ls(),{raw:t})},n=()=>e.getMenu().bind(ch.getHighlighted);t.on("keydown",(t=>{const r=t.which;e.isActive()&&(e.isMenuOpen()?13===r?(n().each(qs),t.preventDefault()):40===r?(n().fold((()=>{e.getMenu().each(ch.highlightFirst)}),(e=>{o(e,t)})),t.preventDefault(),t.stopImmediatePropagation()):37!==r&&38!==r&&39!==r||n().each((e=>{o(e,t),t.preventDefault(),t.stopImmediatePropagation()})):13!==r&&38!==r&&40!==r||e.cancelIfNecessary())})),t.on("NodeChange",(()=>{!e.isActive()||e.isProcessingAction()||t.queryCommandState("mceAutoCompleterInRange")||e.cancelIfNecessary()}))};var Xy;!function(e){e[e.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",e[e.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(Xy||(Xy={}));var Jy=Xy;const Qy="tox-menu-nav__js",ew="tox-collection__item",tw="tox-swatch",ow={normal:Qy,color:tw},nw="tox-collection__item--enabled",rw="tox-collection__item-icon",sw="tox-collection__item-label",aw="tox-collection__item-caret",iw="tox-collection__item--active",lw="tox-collection__item-container",cw="tox-collection__item-container--row",dw=e=>fe(ow,e).getOr(Qy),mw=e=>"color"===e?"tox-swatches":"tox-menu",uw=e=>({backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:mw(e),tieredMenu:"tox-tiered-menu"}),gw=e=>{const t=uw(e);return{backgroundMenu:t.backgroundMenu,selectedMenu:t.selectedMenu,menu:t.menu,selectedItem:t.selectedItem,item:dw(e)}},hw=(e,t,o)=>{const n=uw(o);return{tag:"div",classes:$([[n.menu,`tox-menu-${t}-column`],e?[n.hasIcons]:[]])}},pw=[Jf.parts.items({})],fw=(e,t,o)=>{const n=uw(o);return{dom:{tag:"div",classes:$([[n.tieredMenu]])},markers:gw(o)}},vw=w([xr("data"),Ar("inputAttributes",{}),Ar("inputStyles",{}),Ar("tag","input"),Ar("inputClasses",[]),Ii("onSetValue"),Ar("styles",{}),Ar("eventOrder",{}),Du("inputBehaviours",[Au,xf]),Ar("selectOnFocus",!0)]),bw=e=>xa([xf.config({onFocus:e.selectOnFocus?e=>{const t=e.element,o=Sl(t);t.dom.setSelectionRange(0,o.length)}:v})]),yw=e=>({...bw(e),...Nu(e.inputBehaviours,[Au.config({store:{mode:"manual",...e.data.map((e=>({initialValue:e}))).getOr({}),getValue:e=>Sl(e.element),setValue:(e,t)=>{Sl(e.element)!==t&&kl(e.element,t)}},onSetValue:e.onSetValue})])}),ww=e=>({tag:e.tag,attributes:{type:"text",...e.inputAttributes},styles:e.inputStyles,classes:e.inputClasses}),xw=Rg({name:"Input",configFields:vw(),factory:(e,t)=>({uid:e.uid,dom:ww(e),components:[],behaviours:yw(e),eventOrder:e.eventOrder})}),Cw=Xi("refetch-trigger-event"),Sw=Xi("redirect-menu-item-interaction"),kw="tox-menu__searcher",_w=e=>Yl(e.element,`.${kw}`).bind((t=>e.getSystem().getByDom(t).toOptional())),Ew=_w,Tw=e=>({fetchPattern:Au.getValue(e),selectionStart:e.element.dom.selectionStart,selectionEnd:e.element.dom.selectionEnd}),Ow=e=>{const t=(e,t)=>(t.cut(),A.none()),o=(e,t)=>{const o={interactionEvent:t.event,eventType:t.event.raw.type};return $s(e,Sw,o),A.some(!0)},n="searcher-events";return{dom:{tag:"div",classes:[ew]},components:[xw.sketch({inputClasses:[kw,"tox-textfield"],inputAttributes:{...e.placeholder.map((t=>({placeholder:e.i18n(t)}))).getOr({}),type:"search","aria-autocomplete":"list"},inputBehaviours:xa([ff(n,[ea(ds(),(e=>{Ws(e,Cw)})),ea(ls(),((e,t)=>{"Escape"===t.event.raw.key&&t.stop()}))]),sf.config({mode:"special",onLeft:t,onRight:t,onSpace:t,onEnter:o,onEscape:o,onUp:o,onDown:o})]),eventOrder:{keydown:[n,sf.name()]}})]}},Aw="tox-collection--results__js",Dw=e=>{var t;return e.dom?{...e,dom:{...e.dom,attributes:{...null!==(t=e.dom.attributes)&&void 0!==t?t:{},id:Xi("aria-item-search-result-id"),"aria-selected":"false"}}}:e},Mw=(e,t)=>o=>{const n=I(o,t);return P(n,(t=>({dom:e,components:t})))},Nw=(e,t)=>{const o=[];let n=[];return F(e,((e,r)=>{t(e,r)?(n.length>0&&o.push(n),n=[],(ve(e.dom,"innerHtml")||e.components&&e.components.length>0)&&n.push(e)):n.push(e)})),n.length>0&&o.push(n),P(o,(e=>({dom:{tag:"div",classes:["tox-collection__group"]},components:e})))},Rw=(e,t,o)=>Jf.parts.items({preprocess:n=>{const r=P(n,o);return"auto"!==e&&e>1?Mw({tag:"div",classes:["tox-collection__group"]},e)(r):Nw(r,((e,o)=>"separator"===t[o].type))}}),Bw=(e,t,o=!0)=>({dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===e?["tox-collection--list"]:["tox-collection--grid"])},components:[Rw(e,t,x)]}),Lw=e=>L(e,(e=>"icon"in e&&void 0!==e.icon)),Hw=e=>(console.error(ar(e)),console.log(e),A.none()),Iw=(e,t,o,n,r)=>{const s=(a=o,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Jf.parts.items({preprocess:e=>Nw(e,((e,t)=>"separator"===a[t].type))})]});var a;return{value:e,dom:s.dom,components:s.components,items:o}},Pw=(e,t,o,n,r)=>{const s=()=>"searchable"!==r.menuType?Bw(n,o):"search-with-field"===r.searchMode.searchMode?((e,t,o)=>{const n=Xi("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===e?["tox-collection--list"]:["tox-collection--grid"])},components:[Ow({i18n:Iy.translate,placeholder:o.placeholder}),{dom:{tag:"div",classes:[...1===e?["tox-collection--list"]:["tox-collection--grid"],Aw],attributes:{id:n}},components:[Rw(e,t,Dw)]}]}})(n,o,r.searchMode):((e,t)=>{const o=Xi("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection",Aw].concat(1===e?["tox-collection--list"]:["tox-collection--grid"]),attributes:{id:o}},components:[Rw(e,t,Dw)]}})(n,o);if("color"===r.menuType){const t=(e=>({dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Jf.parts.items({preprocess:"auto"!==e?Mw({tag:"div",classes:["tox-swatches__row"]},e):x})]}]}))(n);return{value:e,dom:t.dom,components:t.components,items:o}}if("normal"===r.menuType&&"auto"===n){const t=Bw(n,o);return{value:e,dom:t.dom,components:t.components,items:o}}if("normal"===r.menuType||"searchable"===r.menuType){const t=s();return{value:e,dom:t.dom,components:t.components,items:o}}if("listpreview"===r.menuType&&"auto"!==n){const t=(e=>({dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Jf.parts.items({preprocess:Mw({tag:"div",classes:["tox-collection__group"]},e)})]}))(n);return{value:e,dom:t.dom,components:t.components,items:o}}return{value:e,dom:hw(t,n,r.menuType),components:pw,items:o}},Fw=pr("type"),zw=pr("name"),Vw=pr("label"),Zw=pr("text"),Uw=pr("title"),jw=pr("icon"),Ww=pr("value"),$w=vr("fetch"),qw=vr("getSubmenuItems"),Gw=vr("onAction"),Kw=vr("onItemAction"),Yw=Lr("onSetup",(()=>v)),Xw=kr("name"),Jw=kr("text"),Qw=kr("role"),ex=kr("icon"),tx=kr("tooltip"),ox=kr("label"),nx=kr("shortcut"),rx=Er("select"),sx=Br("active",!1),ax=Br("borderless",!1),ix=Br("enabled",!0),lx=Br("primary",!1),cx=e=>Ar("columns",e),dx=Ar("meta",{}),mx=Lr("onAction",v),ux=e=>Nr("type",e),gx=e=>cr("name","name",_n((()=>Xi(`${e}-name`))),Gn),hx=zn([Fw,Jw]),px=zn([ux("autocompleteitem"),sx,ix,dx,Ww,Jw,ex]),fx=[ix,tx,ex,Jw,Yw],vx=zn([Fw,Gw,nx].concat(fx)),bx=e=>nr("toolbarbutton",vx,e),yx=[sx].concat(fx),wx=zn(yx.concat([Fw,Gw,nx])),xx=e=>nr("ToggleButton",wx,e),Cx=[Lr("predicate",T),Rr("scope","node",["node","editor"]),Rr("position","selection",["node","selection","line"])],Sx=fx.concat([ux("contextformbutton"),lx,Gw,dr("original",x)]),kx=yx.concat([ux("contextformbutton"),lx,Gw,dr("original",x)]),_x=fx.concat([ux("contextformbutton")]),Ex=yx.concat([ux("contextformtogglebutton")]),Tx=ir("type",{contextformbutton:Sx,contextformtogglebutton:kx}),Ox=zn([ux("contextform"),Lr("initValue",w("")),ox,wr("commands",Tx),Cr("launch",ir("type",{contextformbutton:_x,contextformtogglebutton:Ex}))].concat(Cx)),Ax=zn([ux("contexttoolbar"),pr("items")].concat(Cx)),Dx=[Fw,pr("src"),kr("alt"),Hr("classes",[],Gn)],Mx=zn(Dx),Nx=[Fw,Zw,Xw,Hr("classes",["tox-collection__item-label"],Gn)],Rx=zn(Nx),Bx=In((()=>er("type",{cardimage:Mx,cardtext:Rx,cardcontainer:Lx}))),Lx=zn([Fw,Nr("direction","horizontal"),Nr("align","left"),Nr("valign","middle"),wr("items",Bx)]),Hx=[ix,Jw,Qw,nx,(Ix="menuitem",cr("value","value",_n((()=>Xi(`${Ix}-value`))),Wn())),dx];var Ix;const Px=zn([Fw,ox,wr("items",Bx),Yw,mx].concat(Hx)),Fx=zn([Fw,sx,ex].concat(Hx)),zx=[Fw,pr("fancytype"),mx],Vx=[Ar("initData",{})].concat(zx),Zx=[Er("select"),Ir("initData",{},[Br("allowCustomColors",!0),Nr("storageKey","default"),Tr("colors",Wn())])].concat(zx),Ux=ir("fancytype",{inserttable:Vx,colorswatch:Zx}),jx=zn([Fw,Yw,mx,ex].concat(Hx)),Wx=zn([Fw,qw,Yw,ex].concat(Hx)),$x=zn([Fw,ex,sx,Yw,Gw].concat(Hx)),qx=(e,t,o)=>{const n=nm(e.element,"."+o);if(n.length>0){const e=W(n,(e=>{const o=e.dom.getBoundingClientRect().top,r=n[0].dom.getBoundingClientRect().top;return Math.abs(o-r)>t})).getOr(n.length);return A.some({numColumns:e,numRows:Math.ceil(n.length/e)})}return A.none()},Gx=(e,t)=>xa([ff(e,t)]),Kx=e=>Gx(Xi("unnamed-events"),e),Yx="silver.readonly",Xx=zn([(Jx="readonly",gr(Jx,Kn))]);var Jx;const Qx=(e,t)=>{const o=e.mainUi.outerContainer.element,n=[e.mainUi.mothership,...e.uiMotherships];t&&F(n,(e=>{e.broadcastOn([du()],{target:o})})),F(n,(e=>{e.broadcastOn([Yx],{readonly:t})}))},eC=(e,t)=>{e.on("init",(()=>{e.mode.isReadOnly()&&Qx(t,!0)})),e.on("SwitchMode",(()=>Qx(t,e.mode.isReadOnly()))),bv(e)&&e.mode.set("readonly")},tC=()=>Hc.config({channels:{[Yx]:{schema:Xx,onReceive:(e,t)=>{Jg.set(e,t.readonly)}}}}),oC=e=>Jg.config({disabled:e,disableClass:"tox-collection__item--state-disabled"}),nC=e=>Jg.config({disabled:e}),rC=e=>Jg.config({disabled:e,disableClass:"tox-tbtn--disabled"}),sC=e=>Jg.config({disabled:e,disableClass:"tox-tbtn--disabled",useNative:!1}),aC=(e,t)=>{const o=e.getApi(t);return e=>{e(o)}},iC=(e,t)=>la((o=>{aC(e,o)((o=>{const n=e.onSetup(o);h(n)&&t.set(n)}))})),lC=(e,t)=>ca((o=>aC(e,o)(t.get()))),cC=(e,t)=>ma(((o,n)=>{aC(e,o)(e.onAction),e.triggersSubmenu||t!==Jy.CLOSE_ON_EXECUTE||(o.getSystem().isConnected()&&Ws(o,Ts()),n.stop())})),dC={[Ss()]:["disabling","alloy.base.behaviour","toggling","item-events"]},mC=we,uC=(e,t,o,n)=>{const r=Xo(v);return{type:"item",dom:t.dom,components:mC(t.optComponents),data:e.data,eventOrder:dC,hasSubmenu:e.triggersSubmenu,itemBehaviours:xa([ff("item-events",[cC(e,o),iC(e,r),lC(e,r)]),oC((()=>!e.enabled||n.isDisabled())),tC(),pf.config({})].concat(e.itemBehaviours))}},gC=e=>({value:e.value,meta:{text:e.text.getOr(""),...e.meta}}),hC=e=>{const t=hv.os.isMacOS()||hv.os.isiOS(),o=t?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},n=e.split("+"),r=P(n,(e=>{const t=e.toLowerCase().trim();return ve(o,t)?o[t]:e}));return t?r.join(""):r.join("+")},pC=(e,t,o=[rw])=>$y(e,{tag:"div",classes:o},t),fC=e=>({dom:{tag:"div",classes:[sw]},components:[Hl(Iy.translate(e))]}),vC=(e,t)=>({dom:{tag:"div",classes:t,innerHtml:e}}),bC=(e,t)=>({dom:{tag:"div",classes:[sw]},components:[{dom:{tag:e.tag,styles:e.styles},components:[Hl(Iy.translate(t))]}]}),yC=e=>({dom:{tag:"div",classes:["tox-collection__item-accessory"]},components:[Hl(hC(e))]}),wC=e=>pC("checkmark",e,["tox-collection__item-checkmark"]),xC=(e,t,o)=>{const n=e.value,r=e.iconContent.map((e=>((e,t,o)=>{const n=t();return Zy(e,n).or(o).getOrThunk(zy(n))})(e,t.icons,o))),s=e.ariaLabel.map((e=>({"aria-label":t.translate(e),"data-mce-name":e}))).getOr({});return{dom:(()=>{const e=tw,t=r.getOr(""),o={tag:"div",attributes:s,classes:[e]};return"custom"===n?{...o,tag:"button",classes:[...o.classes,"tox-swatches__picker-btn"],innerHtml:t}:"remove"===n?{...o,classes:[...o.classes,"tox-swatch--remove"],innerHtml:t}:g(n)?{...o,attributes:{...o.attributes,"data-mce-color":n},styles:{"background-color":n},innerHtml:t}:o})(),optComponents:[]}},CC=e=>{const t=e.map((e=>({attributes:{id:Xi("menu-item"),"aria-label":Iy.translate(e)}}))).getOr({});return{tag:"div",classes:[Qy,ew],...t}},SC=(e,t,o,n=A.none())=>"color"===e.presets?xC(e,t,n):((e,t,o,n)=>{const r={tag:"div",classes:[rw]},s=o?e.iconContent.map((e=>$y(e,r,t.icons,n))).orThunk((()=>A.some({dom:r}))):A.none(),a=e.checkMark,i=A.from(e.meta).fold((()=>fC),(e=>ve(e,"style")?S(bC,e.style):fC)),l=e.htmlContent.fold((()=>e.textContent.map(i)),(e=>A.some(vC(e,[sw]))));return{dom:CC(e.ariaLabel),optComponents:[s,l,e.shortcutContent.map(yC),a,e.caret]}})(e,t,o,n),kC=(e,t,o)=>fe(e,"tooltipWorker").map((e=>[zb.config({lazySink:t.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:e=>({type:"submenu",item:e,overrides:{maxHeightFunction:vd}}),mode:"follow-highlight",onShow:(t,o)=>{e((e=>{zb.setComponents(t,[Il({element:Be.fromDom(e)})])}))}})])).getOrThunk((()=>o.map((e=>[zb.config({...t.providers.tooltips.getConfig({tooltipText:e}),mode:"follow-highlight"})])).getOr([]))),_C=(e,t)=>{const o=(e=>uv.DOM.encode(e))(Iy.translate(e));if(t.length>0){const e=new RegExp((e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t),"gi");return o.replace(e,(e=>`${e}`))}return o},EC=(e,t)=>P(e,(e=>{switch(e.type){case"cardcontainer":return((e,t)=>{const o="vertical"===e.direction?"tox-collection__item-container--column":cw,n="left"===e.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right";return{dom:{tag:"div",classes:[lw,o,n,(()=>{switch(e.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}})()]},components:t}})(e,EC(e.items,t));case"cardimage":return((e,t,o)=>({dom:{tag:"img",classes:t,attributes:{src:e,alt:o.getOr("")}}}))(e.src,e.classes,e.alt);case"cardtext":const o=e.name.exists((e=>B(t.cardText.highlightOn,e))),n=o?A.from(t.cardText.matchText).getOr(""):"";return vC(_C(e.text,n),e.classes)}})),TC=ug(Wf(),$f()),OC=e=>({value:NC(e)}),AC=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,DC=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,MC=e=>AC.test(e)||DC.test(e),NC=e=>_e(e,"#").toUpperCase(),RC=e=>{const t=(e=>{const t=e.value.replace(AC,((e,t,o,n)=>t+t+o+o+n+n));return{value:t}})(e),o=DC.exec(t.value);return null===o?["FFFFFF","FF","FF","FF"]:o},BC=e=>{const t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},LC=e=>{const t=BC(e.red)+BC(e.green)+BC(e.blue);return OC(t)},HC=Math.min,IC=Math.max,PC=Math.round,FC=/^\s*rgb\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*\)\s*$/i,zC=/^\s*rgba\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*((?:\d?\.\d+|\d+)%?)\s*\)\s*$/i,VC=(e,t,o,n)=>({red:e,green:t,blue:o,alpha:n}),ZC=e=>{const t=parseInt(e,10);return t.toString()===e&&t>=0&&t<=255},UC=e=>{let t,o,n;const r=(e.hue||0)%360;let s=e.saturation/100,a=e.value/100;if(s=IC(0,HC(s,1)),a=IC(0,HC(a,1)),0===s)return t=o=n=PC(255*a),VC(t,o,n,1);const i=r/60,l=a*s,c=l*(1-Math.abs(i%2-1)),d=a-l;switch(Math.floor(i)){case 0:t=l,o=c,n=0;break;case 1:t=c,o=l,n=0;break;case 2:t=0,o=l,n=c;break;case 3:t=0,o=c,n=l;break;case 4:t=c,o=0,n=l;break;case 5:t=l,o=0,n=c;break;default:t=o=n=0}return t=PC(255*(t+d)),o=PC(255*(o+d)),n=PC(255*(n+d)),VC(t,o,n,1)},jC=e=>{const t=RC(e),o=parseInt(t[1],16),n=parseInt(t[2],16),r=parseInt(t[3],16);return VC(o,n,r,1)},WC=(e,t,o,n)=>{const r=parseInt(e,10),s=parseInt(t,10),a=parseInt(o,10),i=parseFloat(n);return VC(r,s,a,i)},$C=e=>{const t=FC.exec(e);if(null!==t)return A.some(WC(t[1],t[2],t[3],"1"));const o=zC.exec(e);return null!==o?A.some(WC(o[1],o[2],o[3],o[4])):A.none()},qC=e=>`rgba(${e.red},${e.green},${e.blue},${e.alpha})`,GC=VC(255,0,0,1),KC=(e,t)=>{e.dispatch("ResizeContent",t)},YC=(e,t)=>{e.dispatch("TextColorChange",t)},XC=(e,t)=>e.dispatch("ResolveName",{name:t.nodeName.toLowerCase(),target:t}),JC=(e,t)=>()=>{e(),t()},QC=e=>tS(e,"NodeChange",(t=>{t.setEnabled(e.selection.isEditable())})),eS=(e,t)=>o=>{const n=QC(e)(o),r=((e,t)=>o=>{const n=Qo(),r=()=>{o.setActive(e.formatter.match(t));const r=e.formatter.formatChanged(t,o.setActive);n.set(r)};return e.initialized?r():e.once("init",r),()=>{e.off("init",r),n.clear()}})(e,t)(o);return()=>{n(),r()}},tS=(e,t,o)=>n=>{const r=()=>o(n),s=()=>{o(n),e.on(t,r)};return e.initialized?s():e.once("init",s),()=>{e.off("init",s),e.off(t,r)}},oS=e=>t=>()=>{e.undoManager.transact((()=>{e.focus(),e.execCommand("mceToggleFormat",!1,t.format)}))},nS=(e,t)=>()=>e.execCommand(t);var rS=tinymce.util.Tools.resolve("tinymce.util.LocalStorage");const sS={},aS=(e,t=10)=>{const o=rS.getItem(e),n=s(o)?JSON.parse(o):[],r=t-(a=n).length<0?a.slice(0,t):a;var a;const i=e=>{r.splice(e,1)};return{add:o=>{((e,t)=>{const o=R(e,t);return-1===o?A.none():A.some(o)})(r,o).each(i),r.unshift(o),r.length>t&&r.pop(),rS.setItem(e,JSON.stringify(r))},state:()=>r.slice(0)}},iS=e=>fe(sS,e).getOrThunk((()=>{const t=`tinymce-custom-colors-${e}`,o=rS.getItem(t);if(u(o)){const e=rS.getItem("tinymce-custom-colors");rS.setItem(t,g(e)?e:"[]")}const n=aS(t,10);return sS[e]=n,n})),lS=(e,t)=>{iS(e).add(t)},cS=(e,t,o)=>({hue:e,saturation:t,value:o}),dS=e=>{let t=0,o=0,n=0;const r=e.red/255,s=e.green/255,a=e.blue/255,i=Math.min(r,Math.min(s,a)),l=Math.max(r,Math.max(s,a));if(i===l)return n=i,cS(0,0,100*n);return t=r===i?3:a===i?1:5,t=60*(t-(r===i?s-a:a===i?r-s:a-r)/(l-i)),o=(l-i)/l,n=l,cS(Math.round(t),Math.round(100*o),Math.round(100*n))},mS=e=>LC(UC(e)),uS=e=>{return(t=e,MC(t)?A.some({value:NC(t)}):A.none()).orThunk((()=>$C(e).map(LC))).getOrThunk((()=>{const t=document.createElement("canvas");t.height=1,t.width=1;const o=t.getContext("2d");o.clearRect(0,0,t.width,t.height),o.fillStyle="#FFFFFF",o.fillStyle=e,o.fillRect(0,0,1,1);const n=o.getImageData(0,0,1,1).data,r=n[0],s=n[1],a=n[2],i=n[3];return LC(VC(r,s,a,i))}));var t},gS="forecolor",hS="hilitecolor",pS=e=>{const t=[];for(let o=0;ot=>t.options.get(e),vS="#000000",bS=(e,t)=>t===gS&&e.options.isSet("color_map_foreground")?fS("color_map_foreground")(e):t===hS&&e.options.isSet("color_map_background")?fS("color_map_background")(e):fS("color_map")(e),yS=(e,t="default")=>Math.max(5,Math.ceil(Math.sqrt(bS(e,t).length))),wS=(e,t)=>{const o=fS("color_cols")(e),n=yS(e,t);return o===yS(e)?n:o},xS=(e,t="default")=>Math.round(t===gS?fS("color_cols_foreground")(e):t===hS?fS("color_cols_background")(e):fS("color_cols")(e)),CS=fS("custom_colors"),SS=fS("color_default_foreground"),kS=fS("color_default_background"),_S=e=>Wr(e,(e=>{if(Ue(e)){const t=Nt(e,"background-color");return Se((e=>$C(e).exists((e=>0!==e.alpha)))(t),t)}return A.none()})).getOr("rgba(0, 0, 0, 0)"),ES=(e,t)=>{const o=Be.fromDom(e.selection.getStart()),n="hilitecolor"===t?_S(o):Nt(o,"color");return $C(n).map((e=>"#"+LC(e).value))},TS=e=>{const t="choiceitem",o={type:t,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return e?[o,{type:t,text:"Custom color",icon:"color-picker",value:"custom"}]:[o]},OS=(e,t,o,n)=>{if("custom"===o){IS(e)((o=>{o.each((o=>{lS(t,o),e.execCommand("mceApplyTextcolor",t,o),n(o)}))}),ES(e,t).getOr(vS))}else"remove"===o?(n(""),e.execCommand("mceRemoveTextcolor",t)):(n(o),e.execCommand("mceApplyTextcolor",t,o))},AS=(e,t,o)=>e.concat((e=>P(iS(e).state(),(e=>({type:"choiceitem",text:e,icon:"checkmark",value:e}))))(t).concat(TS(o))),DS=(e,t,o)=>n=>{n(AS(e,t,o))},MS=(e,t,o)=>{const n="forecolor"===t?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";e.setIconFill(n,o)},NS=(e,t)=>{e.setTooltip(t)},RS=(e,t)=>o=>{const n=ES(e,t);return ye(n,o.toUpperCase())},BS=(e,t,o)=>{if(Me(o))return"forecolor"===t?"Text color":"Background color";const n="forecolor"===t?"Text color {0}":"Background color {0}",r=AS(bS(e,t),t,!1),s=j(r,(e=>e.value===o)).getOr({text:""}).text;return e.translate([n,e.translate(s)])},LS=(e,t,o,n)=>{e.ui.registry.addSplitButton(t,{tooltip:BS(e,o,n.get()),presets:"color",icon:"forecolor"===t?"text-color":"highlight-bg-color",select:RS(e,o),columns:xS(e,o),fetch:DS(bS(e,o),o,CS(e)),onAction:t=>{OS(e,o,n.get(),v)},onItemAction:(r,s)=>{OS(e,o,s,(o=>{n.set(o),YC(e,{name:t,color:o})}))},onSetup:r=>{MS(r,t,n.get());const s=n=>{n.name===t&&(MS(r,n.name,n.color),NS(r,BS(e,o,n.color)))};return e.on("TextColorChange",s),JC(QC(e)(r),(()=>{e.off("TextColorChange",s)}))}})},HS=(e,t,o,n,r)=>{e.ui.registry.addNestedMenuItem(t,{text:n,icon:"forecolor"===t?"text-color":"highlight-bg-color",onSetup:n=>(NS(n,BS(e,o,r.get())),MS(n,t,r.get()),QC(e)(n)),getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"colorswatch",select:RS(e,o),initData:{storageKey:o},onAction:n=>{OS(e,o,n.value,(o=>{r.set(o),YC(e,{name:t,color:o})}))}}]})},IS=e=>(t,o)=>{let n=!1;const r={colorpicker:o};e.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onAction:(e,t)=>{"hex-valid"===t.name&&(n=t.value)},onSubmit:o=>{const r=o.getData().colorpicker;n?(t(A.from(r)),o.close()):e.windowManager.alert(e.translate(["Invalid hex color code: {0}",r]))},onClose:v,onCancel:()=>{t(A.none())}})},PS=(e,t,o,n,r,s,a,i)=>{const l=Lw(t),c=FS(t,o,n,"color"!==r?"normal":"color",s,a,i);return Pw(e,l,c,n,{menuType:r})},FS=(e,t,o,n,r,s,a)=>we(P(e,(i=>{return"choiceitem"===i.type?(l=i,nr("choicemenuitem",Fx,l)).fold(Hw,(i=>A.some(((e,t,o,n,r,s,a,i=!0)=>{const l=SC({presets:o,textContent:t?e.text:A.none(),htmlContent:A.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:t?e.shortcut:A.none(),checkMark:t?A.some(wC(a.icons)):A.none(),caret:A.none(),value:e.value},a,i),c=e.text.filter(w(!t)).map((e=>zb.config(a.tooltips.getConfig({tooltipText:a.translate(e)}))));return Sn(uC({data:gC(e),enabled:e.enabled,getApi:e=>({setActive:t=>{Af.set(e,t)},isActive:()=>Af.isOn(e),isEnabled:()=>!Jg.isDisabled(e),setEnabled:t=>Jg.set(e,!t)}),onAction:t=>n(e.value),onSetup:e=>(e.setActive(r),v),triggersSubmenu:!1,itemBehaviours:[...c.toArray()]},l,s,a),{toggling:{toggleClass:nw,toggleOnExecute:!1,selected:e.active,exclusive:!0}})})(i,1===o,n,t,s(i.value),r,a,Lw(e))))):A.none();var l}))),zS=(e,t)=>{const o=gw(t);if(1===e)return{mode:"menu",moveOnTab:!0};if("auto"===e)return{mode:"grid",selector:"."+o.item,initSize:{numColumns:1,numRows:1}};return{mode:"matrix",rowSelector:"."+("color"===t?"tox-swatches__row":"tox-collection__group"),previousSelector:e=>"color"===t?Yl(e.element,"[aria-checked=true]"):A.none()}},VS=(e,t)=>{const o=e.initData.allowCustomColors&&t.colorinput.hasCustomColors();return e.initData.colors.fold((()=>AS(t.colorinput.getColors(e.initData.storageKey),e.initData.storageKey,o)),(e=>e.concat(TS(o))))},ZS=Xi("cell-over"),US=Xi("cell-execute"),jS=(e,t,o)=>{const n=o=>$s(o,US,{row:e,col:t}),r=(e,t)=>{t.stop(),n(e)};return zl({dom:{tag:"div",attributes:{role:"button","aria-label":o}},behaviours:xa([ff("insert-table-picker-cell",[ea(ss(),xf.focus),ea(Ss(),n),ea(us(),r),ea(_s(),r)]),Af.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),xf.config({onFocus:o=>$s(o,ZS,{row:e,col:t})})])})},WS=e=>q(e,(e=>P(e,Vl))),$S=(e,t)=>Hl(`${t}x${e}`),qS={inserttable:(e,t)=>{const o=(e=>(t,o)=>e.shared.providers.translate(["{0} columns, {1} rows",o,t]))(t),n=((e,t,o)=>{const n=[];for(let r=0;r{pf.set(s.get(e),[r])})),ra(ZS,((e,t,o)=>{const{row:r,col:a}=o.event;((e,t,o,n,r)=>{for(let s=0;s{const{row:r,col:s}=n.event;Ws(t,Ts()),e.onAction({numRows:r+1,numColumns:s+1})}))]),sf.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:(e,t)=>{const o=VS(e,t),n=t.colorinput.getColorCols(e.initData.storageKey),r="color",s=PS(Xi("menu-value"),o,(t=>{e.onAction({value:t})}),n,r,Jy.CLOSE_ON_EXECUTE,e.select.getOr(T),t.shared.providers),a={...s,markers:gw(r),movement:zS(n,r),showMenuRole:!1};return{type:"widget",data:{value:Xi("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[TC.widget(Jf.sketch(a))]}}},GS=(e,t,o,n,r,s,a,i=!0)=>{const l=SC({presets:n,textContent:A.none(),htmlContent:o?e.text.map((e=>_C(e,t))):A.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:A.none(),checkMark:A.none(),caret:A.none(),value:e.value},a.providers,i,e.icon),c=e.text.filter((e=>!o&&""!==e));return uC({data:gC(e),enabled:e.enabled,getApi:w({}),onAction:t=>r(e.value,e.meta),onSetup:w(v),triggersSubmenu:!1,itemBehaviours:kC(e,a,c)},l,s,a.providers)},KS=e=>({type:"separator",dom:{tag:"div",classes:[ew,"tox-collection__group-heading"]},components:e.text.map(Hl).toArray()}),YS=(e,t,o,n=!0)=>{const r=SC({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:A.none(),ariaLabel:e.text,caret:A.none(),checkMark:A.none(),shortcutContent:e.shortcut},o,n);return uC({data:gC(e),getApi:e=>({isEnabled:()=>!Jg.isDisabled(e),setEnabled:t=>Jg.set(e,!t)}),enabled:e.enabled,onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,t,o)},XS=(e,t,o,n=!0,r=!1)=>{const s=r?(a=o.icons,pC("chevron-down",a,[aw])):(e=>pC("chevron-right",e,[aw]))(o.icons);var a;const i=SC({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:A.none(),ariaLabel:e.text,caret:A.some(s),checkMark:A.none(),shortcutContent:e.shortcut},o,n);return uC({data:gC(e),getApi:e=>({isEnabled:()=>!Jg.isDisabled(e),setEnabled:t=>Jg.set(e,!t),setIconFill:(t,o)=>{Yl(e.element,`svg path[class="${t}"], rect[class="${t}"]`).each((e=>{xt(e,"fill",o)}))},setTooltip:t=>{const n=o.translate(t);xt(e.element,"aria-label",n)}}),enabled:e.enabled,onAction:v,onSetup:e.onSetup,triggersSubmenu:!0,itemBehaviours:[]},i,t,o)},JS=(e,t,o,n=!0)=>{const r=SC({iconContent:e.icon,textContent:e.text,htmlContent:A.none(),ariaLabel:e.text,checkMark:A.some(wC(o.icons)),caret:A.none(),shortcutContent:e.shortcut,presets:"normal",meta:e.meta},o,n);return Sn(uC({data:gC(e),enabled:e.enabled,getApi:e=>({setActive:t=>{Af.set(e,t)},isActive:()=>Af.isOn(e),isEnabled:()=>!Jg.isDisabled(e),setEnabled:t=>Jg.set(e,!t)}),onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,t,o),{toggling:{toggleClass:nw,toggleOnExecute:!1,selected:e.active},role:e.role.getOrUndefined()})},QS=(e,t)=>fe(qS,e.fancytype).map((o=>o(e,t))),ek=(e,t,o,n)=>{const r={dom:CC(e.label),optComponents:[A.some({dom:{tag:"div",classes:[lw,cw]},components:EC(e.items,n)})]};return uC({data:gC({text:A.none(),...e}),enabled:e.enabled,getApi:e=>({isEnabled:()=>!Jg.isDisabled(e),setEnabled:t=>{Jg.set(e,!t),F(nm(e.element,"*"),(o=>{e.getSystem().getByDom(o).each((e=>{e.hasConfigured(Jg)&&Jg.set(e,!t)}))}))}}),onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:A.from(n.itemBehaviours).getOr([])},r,t,o.providers)};var tk=Object.freeze({__proto__:null,getCoupled:(e,t,o,n)=>o.getOrCreate(e,t,n),getExistingCoupled:(e,t,o,n)=>o.getExisting(e,t,n)}),ok=[gr("others",or(rn.value,Wn()))];var nk=Object.freeze({__proto__:null,init:()=>{const e={},t=(t,o)=>{if(0===se(t.others).length)throw new Error("Cannot find any known coupled components");return fe(e,o)},o=w({});return wa({readState:o,getExisting:(e,o,n)=>t(o,n).orThunk((()=>(fe(o.others,n).getOrDie("No information found for coupled component: "+n),A.none()))),getOrCreate:(o,n,r)=>t(n,r).getOrThunk((()=>{const t=fe(n.others,r).getOrDie("No information found for coupled component: "+r)(o),s=o.getSystem().build(t);return e[r]=s,s}))})}});const rk=Sa({fields:ok,name:"coupling",apis:tk,state:nk}),sk=e=>{let t=A.none(),o=[];const n=e=>{r()?a(e):o.push(e)},r=()=>t.isSome(),s=e=>{F(e,a)},a=e=>{t.each((t=>{setTimeout((()=>{e(t)}),0)}))};return e((e=>{r()||(t=A.some(e),s(o),o=[])})),{get:n,map:e=>sk((t=>{n((o=>{t(e(o))}))})),isReady:r}},ak={nu:sk,pure:e=>sk((t=>{t(e)}))},ik=e=>{setTimeout((()=>{throw e}),0)},lk=e=>{const t=t=>{e().then(t,ik)};return{map:t=>lk((()=>e().then(t))),bind:t=>lk((()=>e().then((e=>t(e).toPromise())))),anonBind:t=>lk((()=>e().then((()=>t.toPromise())))),toLazy:()=>ak.nu(t),toCached:()=>{let t=null;return lk((()=>(null===t&&(t=e()),t)))},toPromise:e,get:t}},ck=e=>lk((()=>new Promise(e))),dk=e=>lk((()=>Promise.resolve(e))),mk=w("sink"),uk=w(ig({name:mk(),overrides:w({dom:{tag:"div"},behaviours:xa([Hm.config({useFixed:O})]),events:Xs([sa(ls()),sa(ts()),sa(us())])})})),gk=(e,t)=>{const o=e.getHotspot(t).getOr(t),n="hotspot",r=e.getAnchorOverrides();return e.layouts.fold((()=>({type:n,hotspot:o,overrides:r})),(e=>({type:n,hotspot:o,overrides:r,layouts:e})))},hk=(e,t,o,n,r,s,a)=>{const i=((e,t,o,n,r,s,a)=>{const i=((e,t,o)=>(0,e.fetch)(o).map(t))(e,t,n),l=bk(n,e);return i.map((t=>t.bind((t=>{const i=t.menus[t.primary];return A.from(i).each((t=>{e.listRole.each((e=>{t.role=e}))})),A.from(iv.sketch({...s.menu(),uid:rl(""),data:t,highlightOnOpen:a,onOpenMenu:(e,t)=>{const n=l().getOrDie();Hm.position(n,t,{anchor:o}),cu.decloak(r)},onOpenSubmenu:(e,t,o)=>{const n=l().getOrDie();Hm.position(n,o,{anchor:{type:"submenu",item:t}}),cu.decloak(r)},onRepositionMenu:(e,t,n)=>{const r=l().getOrDie();Hm.position(r,t,{anchor:o}),F(n,(e=>{Hm.position(r,e.triggeredMenu,{anchor:{type:"submenu",item:e.triggeringItem}})}))},onEscape:()=>(xf.focus(n),cu.close(r),A.some(!0))}))}))))})(e,t,gk(e,o),o,n,r,a);return i.map((e=>(e.fold((()=>{cu.isOpen(n)&&cu.close(n)}),(e=>{cu.cloak(n),cu.open(n,e),s(n)})),n)))},pk=(e,t,o,n,r,s,a)=>(cu.close(n),dk(n)),fk=(e,t,o,n,r,s)=>{const a=rk.getCoupled(o,"sandbox");return(cu.isOpen(a)?pk:hk)(e,t,o,a,n,r,s)},vk=(e,t,o)=>{const n=Pg.getCurrent(t).getOr(t),r=Kt(e.element);o?At(n.element,"min-width",r+"px"):((e,t)=>{Gt.set(e,t)})(n.element,r)},bk=(e,t)=>e.getSystem().getByUid(t.uid+"-"+mk()).map((e=>()=>rn.value(e))).getOrThunk((()=>t.lazySink.fold((()=>()=>rn.error(new Error("No internal sink is specified, nor could an external sink be found"))),(t=>()=>t(e))))),yk=e=>{cu.getState(e).each((e=>{iv.repositionMenus(e)}))},wk=(e,t,o)=>{const n=Ql(),r=bk(t,e);return{dom:{tag:"div",classes:e.sandboxClasses,attributes:{id:n.id}},behaviours:Bu(e.sandboxBehaviours,[Au.config({store:{mode:"memory",initialValue:t}}),cu.config({onOpen:(r,s)=>{const a=gk(e,t);n.link(t.element),e.matchWidth&&vk(a.hotspot,s,e.useMinWidth),e.onOpen(a,r,s),void 0!==o&&void 0!==o.onOpen&&o.onOpen(r,s)},onClose:(e,s)=>{n.unlink(t.element),r().getOr(s).element.dom.dispatchEvent(new window.FocusEvent("focusout")),void 0!==o&&void 0!==o.onClose&&o.onClose(e,s)},isPartOf:(e,o,n)=>tc(o,n)||tc(t,n),getAttachPoint:()=>r().getOrDie()}),Pg.config({find:e=>cu.getState(e).bind((e=>Pg.getCurrent(e)))}),Hc.config({channels:{...hu({isExtraPart:T}),...fu({doReposition:yk})}})])}},xk=e=>{const t=rk.getCoupled(e,"sandbox");yk(t)},Ck=()=>[Ar("sandboxClasses",[]),Ru("sandboxBehaviours",[Pg,Hc,cu,Au])],Sk=w([ur("dom"),ur("fetch"),Ii("onOpen"),Pi("onExecute"),Ar("getHotspot",A.some),Ar("getAnchorOverrides",w({})),Ad(),Du("dropdownBehaviours",[Af,rk,sf,xf]),ur("toggleClass"),Ar("eventOrder",{}),xr("lazySink"),Ar("matchWidth",!1),Ar("useMinWidth",!1),xr("role"),xr("listRole")].concat(Ck())),kk=w([ag({schema:[Bi(),Ar("fakeFocus",!1)],name:"menu",defaults:e=>({onExecute:e.onExecute})}),uk()]),_k=Bg({name:"Dropdown",configFields:Sk(),partFields:kk(),factory:(e,t,o,n)=>{const r=e=>{cu.getState(e).each((e=>{iv.highlightPrimary(e)}))},s=(t,o,r)=>fk(e,x,t,n,o,r),a={expand:e=>{Af.isOn(e)||s(e,v,sv.HighlightNone).get(v)},open:e=>{Af.isOn(e)||s(e,v,sv.HighlightMenuAndItem).get(v)},refetch:t=>rk.getExistingCoupled(t,"sandbox").fold((()=>s(t,v,sv.HighlightMenuAndItem).map(v)),(o=>hk(e,x,t,o,n,v,sv.HighlightMenuAndItem).map(v))),isOpen:Af.isOn,close:e=>{Af.isOn(e)&&s(e,v,sv.HighlightMenuAndItem).get(v)},repositionMenus:e=>{Af.isOn(e)&&xk(e)}},i=(e,t)=>(qs(e),A.some(!0));return{uid:e.uid,dom:e.dom,components:t,behaviours:Nu(e.dropdownBehaviours,[Af.config({toggleClass:e.toggleClass,aria:{mode:"expanded"}}),rk.config({others:{sandbox:t=>wk(e,t,{onOpen:()=>Af.on(t),onClose:()=>Af.off(t)})}}),sf.config({mode:"special",onSpace:i,onEnter:i,onDown:(e,t)=>{if(_k.isOpen(e)){const t=rk.getCoupled(e,"sandbox");r(t)}else _k.open(e);return A.some(!0)},onEscape:(e,t)=>_k.isOpen(e)?(_k.close(e),A.some(!0)):A.none()}),xf.config({})]),events:Nf(A.some((e=>{s(e,r,sv.HighlightMenuAndItem).get(v)}))),eventOrder:{...e.eventOrder,[Ss()]:["disabling","toggling","alloy.base.behaviour"]},apis:a,domModification:{attributes:{"aria-haspopup":e.listRole.getOr("true"),...e.role.fold((()=>({})),(e=>({role:e}))),..."button"===e.dom.tag?{type:(l="type",fe(e.dom,"attributes").bind((e=>fe(e,l)))).getOr("button")}:{}}}};var l},apis:{open:(e,t)=>e.open(t),refetch:(e,t)=>e.refetch(t),expand:(e,t)=>e.expand(t),close:(e,t)=>e.close(t),isOpen:(e,t)=>e.isOpen(t),repositionMenus:(e,t)=>e.repositionMenus(t)}}),Ek=e=>{const t=Au.getValue(e),o=_w(e).map(Tw);_k.refetch(t).get((()=>{const e=rk.getCoupled(t,"sandbox");o.each((t=>_w(e).each((e=>((e,t)=>{Au.setValue(e,t.fetchPattern),e.element.dom.selectionStart=t.selectionStart,e.element.dom.selectionEnd=t.selectionEnd})(e,t)))))}))},Tk=e=>cu.getState(e).bind(ch.getHighlighted).bind(ch.getHighlighted),Ok=(e,t,o)=>{Ew(e).each((e=>{((e,t)=>{kt(t.element,"id").each((t=>xt(e.element,"aria-activedescendant",t)))})(e,o);var n;(Ha((n=t).element,Aw)?A.some(n.element):Yl(n.element,"."+Aw)).each((t=>{kt(t,"id").each((t=>xt(e.element,"aria-controls",t)))}))})),xt(o.element,"aria-selected","true")},Ak=(e,t,o)=>{xt(o.element,"aria-selected","false")},Dk=e=>rk.getExistingCoupled(e,"sandbox").bind(_w).map(Tw).map((e=>e.fetchPattern)).getOr("");var Mk;!function(e){e[e.ContentFocus=0]="ContentFocus",e[e.UiFocus=1]="UiFocus"}(Mk||(Mk={}));const Nk=(e,t,o,n,r)=>{const s=o.shared.providers,a=e=>r?{...e,shortcut:A.none(),icon:e.text.isSome()?A.none():e.icon}:e;switch(e.type){case"menuitem":return(i=e,nr("menuitem",jx,i)).fold(Hw,(e=>A.some(YS(a(e),t,s,n))));case"nestedmenuitem":return(e=>nr("nestedmenuitem",Wx,e))(e).fold(Hw,(e=>A.some(XS(a(e),t,s,n,r))));case"togglemenuitem":return(e=>nr("togglemenuitem",$x,e))(e).fold(Hw,(e=>A.some(JS(a(e),t,s,n))));case"separator":return(e=>nr("separatormenuitem",hx,e))(e).fold(Hw,(e=>A.some(KS(e))));case"fancymenuitem":return(e=>nr("fancymenuitem",Ux,e))(e).fold(Hw,(e=>QS(e,o)));default:return console.error("Unknown item in general menu",e),A.none()}var i},Rk=(e,t,o,n,r,s,a)=>{const i=1===n,l=!i||Lw(e);return we(P(e,(e=>{switch(e.type){case"separator":return(n=e,nr("Autocompleter.Separator",hx,n)).fold(Hw,(e=>A.some(KS(e))));case"cardmenuitem":return(e=>nr("cardmenuitem",Px,e))(e).fold(Hw,(e=>A.some(ek({...e,onAction:t=>{e.onAction(t),o(e.value,e.meta)}},r,s,{itemBehaviours:kC(e.meta,s,A.none()),cardText:{matchText:t,highlightOn:a}}))));default:return(e=>nr("Autocompleter.Item",px,e))(e).fold(Hw,(e=>A.some(GS(e,t,i,"normal",o,r,s,l))))}var n})))},Bk=(e,t,o,n,r,s)=>{const a=Lw(t),i=we(P(t,(e=>{const t=e=>Nk(e,o,n,(e=>r?!ve(e,"text"):a)(e),r);return"nestedmenuitem"===e.type&&e.getSubmenuItems().length<=0?t({...e,enabled:!1}):t(e)}))),l=(e=>"no-search"===e.searchMode?{menuType:"normal"}:{menuType:"searchable",searchMode:e})(s);return(r?Iw:Pw)(e,a,i,1,l)},Lk=e=>iv.singleData(e.value,e),Hk=e=>jd(Be.fromDom(e.startContainer),e.startOffset,Be.fromDom(e.endContainer),e.endOffset),Ik=(e,t)=>{const o=Xi("autocompleter"),n=Xo(!1),r=Xo(!1),s=en(),a=zl(lv.sketch({dom:{tag:"div",classes:["tox-autocompleter"],attributes:{id:o}},components:[],fireDismissalEventInstead:{},inlineBehaviours:xa([ff("dismissAutocompleter",[ea(Hs(),(()=>m())),ea(Us(),((t,o)=>{kt(o.event.target,"id").each((t=>xt(Be.fromDom(e.getBody()),"aria-activedescendant",t)))}))])]),lazySink:t.getSink})),i=()=>lv.isOpen(a),l=r.get,c=()=>{if(i()){lv.hide(a),e.dom.remove(o,!1);const t=Be.fromDom(e.getBody());kt(t,"aria-owns").filter((e=>e===o)).each((()=>{Et(t,"aria-owns"),Et(t,"aria-activedescendant")}))}},d=()=>lv.getContent(a).bind((e=>ee(e.components(),0))),m=()=>e.execCommand("mceAutocompleterClose"),u=(t,o)=>{const n=re(t,(e=>A.from(e.columns))).getOr(1);lv.showMenuAt(a,{anchor:{type:"selection",getSelection:()=>s.get().map(Hk),root:Be.fromDom(e.getBody())}},((e,t,o,n)=>{const r=zS(t,n),s=gw(n);return{data:Lk({...e,movement:r,menuBehaviours:Kx("auto"!==t?[]:[la(((e,t)=>{qx(e,4,s.item).each((({numColumns:t,numRows:o})=>{sf.setGridSize(e,o,t)}))}))])}),menu:{markers:gw(n),fakeFocus:o===Mk.ContentFocus}}})(Pw("autocompleter-value",!0,o,n,{menuType:"normal"}),n,Mk.ContentFocus,"normal")),d().each(ch.highlightFirst)},g=r=>{const a=(o=>{const r=re(o,(e=>A.from(e.columns))).getOr(1);return q(o,(o=>{const a=o.items;return Rk(a,o.matchText,((t,r)=>{const a={hide:()=>m(),reload:t=>{c(),e.execCommand("mceAutocompleterReload",!1,{fetchOptions:t})}};e.execCommand("mceAutocompleterRefreshActiveRange"),s.get().each((e=>{n.set(!0),o.onAction(a,e,t,r),n.set(!1)}))}),r,Jy.BUBBLE_TO_SANDBOX,t,o.highlightOn)}))})(r);a.length>0?(u(r,a),xt(Be.fromDom(e.getBody()),"aria-owns",o),e.inline||h()):c()},h=()=>{e.dom.get(o)&&e.dom.remove(o,!1);const t=e.getDoc().documentElement,n=e.selection.getNode(),r=(e=>wi(e,!0))(a.element);Dt(r,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",top:`${n.offsetTop}px`,left:`${n.offsetLeft}px`}),e.dom.add(t,r.dom),Yl(r,'[role="menu"]').each((e=>{It(e,"position"),It(e,"max-height")}))};e.on("AutocompleterStart",(({lookupData:e})=>{r.set(!0),n.set(!1),g(e)})),e.on("AutocompleterUpdate",(({lookupData:e})=>g(e))),e.on("AutocompleterUpdateActiveRange",(({range:e})=>s.set(e))),e.on("AutocompleterEnd",(()=>{c(),r.set(!1),n.set(!1),s.clear()}));const p={cancelIfNecessary:m,isMenuOpen:i,isActive:l,isProcessingAction:n.get,getMenu:d};Yy(p,e)},Pk=(e,t,o)=>Xl(e,t,o).isSome(),Fk=(e,t)=>{let o=null;return{cancel:()=>{null!==o&&(clearTimeout(o),o=null)},schedule:(...n)=>{o=setTimeout((()=>{e.apply(null,n),o=null}),t)}}},zk=e=>{const t=e.raw;return void 0===t.touches||1!==t.touches.length?A.none():A.some(t.touches[0])},Vk=e=>{const t=en(),o=Xo(!1),n=Fk((t=>{e.triggerEvent(Es(),t),o.set(!0)}),400),r=Vr([{key:Xr(),value:e=>(zk(e).each((r=>{n.cancel();const s={x:r.clientX,y:r.clientY,target:e.target};n.schedule(e),o.set(!1),t.set(s)})),A.none())},{key:Jr(),value:e=>(n.cancel(),zk(e).each((e=>{t.on((o=>{((e,t)=>{const o=Math.abs(e.clientX-t.x),n=Math.abs(e.clientY-t.y);return o>5||n>5})(e,o)&&t.clear()}))})),A.none())},{key:Qr(),value:r=>{n.cancel();return t.get().filter((e=>Xe(e.target,r.target))).map((t=>o.get()?(r.prevent(),!1):e.triggerEvent(_s(),r)))}}]);return{fireIfReady:(e,t)=>fe(r,t).bind((t=>t(e)))}},Zk=(e,t)=>{const o={stopBackspace:!0,...t},n=Vk(o),r=P(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(t=>rd(e,t,(e=>{n.fireIfReady(e,t).each((t=>{t&&e.kill()}));o.triggerEvent(t,e)&&e.kill()})))),s=en(),a=rd(e,"paste",(e=>{n.fireIfReady(e,"paste").each((t=>{t&&e.kill()}));o.triggerEvent("paste",e)&&e.kill(),s.set(setTimeout((()=>{o.triggerEvent(xs(),e)}),0))})),i=rd(e,"keydown",(e=>{o.triggerEvent("keydown",e)?e.kill():o.stopBackspace&&(e=>e.raw.which===dh[0]&&!B(["input","textarea"],ze(e.target))&&!Pk(e.target,'[contenteditable="true"]'))(e)&&e.prevent()})),l=rd(e,"focusin",(e=>{o.triggerEvent("focusin",e)&&e.kill()})),c=en(),d=rd(e,"focusout",(e=>{o.triggerEvent("focusout",e)&&e.kill(),c.set(setTimeout((()=>{o.triggerEvent(ws(),e)}),0))}));return{unbind:()=>{F(r,(e=>{e.unbind()})),i.unbind(),l.unbind(),d.unbind(),a.unbind(),s.on(clearTimeout),c.on(clearTimeout)}}},Uk=(e,t)=>{const o=fe(e,"target").getOr(t);return Xo(o)},jk=Pr([{stopped:[]},{resume:["element"]},{complete:[]}]),Wk=(e,t,o,n,r,s)=>{const a=e(t,n),i=((e,t)=>{const o=Xo(!1),n=Xo(!1);return{stop:()=>{o.set(!0)},cut:()=>{n.set(!0)},isStopped:o.get,isCut:n.get,event:e,setSource:t.set,getSource:t.get}})(o,r);return a.fold((()=>(s.logEventNoHandlers(t,n),jk.complete())),(e=>{const o=e.descHandler;return gl(o)(i),i.isStopped()?(s.logEventStopped(t,e.element,o.purpose),jk.stopped()):i.isCut()?(s.logEventCut(t,e.element,o.purpose),jk.complete()):nt(e.element).fold((()=>(s.logNoParent(t,e.element,o.purpose),jk.complete())),(n=>(s.logEventResponse(t,e.element,o.purpose),jk.resume(n))))}))},$k=(e,t,o,n,r,s)=>Wk(e,t,o,n,r,s).fold(O,(n=>$k(e,t,o,n,r,s)),T),qk=(e,t,o)=>{const n=(e=>{const t=Xo(!1);return{stop:()=>{t.set(!0)},cut:v,isStopped:t.get,isCut:T,event:e,setSource:_("Cannot set source of a broadcasted event"),getSource:_("Cannot get source of a broadcasted event")}})(t);return F(e,(e=>{const t=e.descHandler;gl(t)(n)})),n.isStopped()},Gk=(e,t,o,n,r)=>{const s=Uk(o,n);return $k(e,t,o,n,s,r)},Kk=()=>{const e={};return{registerId:(t,o,n)=>{ie(n,((n,r)=>{const s=void 0!==e[r]?e[r]:{};s[o]=((e,t)=>{return o=S.apply(void 0,[e.handler].concat(t)),n=e.purpose,{cHandler:o,purpose:n};var o,n})(n,t),e[r]=s}))},unregisterId:t=>{ie(e,((e,o)=>{ve(e,t)&&delete e[t]}))},filterByType:t=>fe(e,t).map((e=>ge(e,((e,t)=>((e,t)=>({id:e,descHandler:t}))(t,e))))).getOr([]),find:(t,o,n)=>fe(e,o).bind((e=>Wr(n,(t=>((e,t)=>nl(t).bind((t=>fe(e,t))).map((e=>((e,t)=>({element:e,descHandler:t}))(t,e))))(e,t)),t)))}},Yk=()=>{const e=Kk(),t={},o=e=>{const t=e.element;return nl(t).getOrThunk((()=>((e,t)=>{const o=Xi(el+e);return ol(t,o),o})("uid-",e.element)))},n=o=>{nl(o.element).each((o=>{delete t[o],e.unregisterId(o)}))};return{find:(t,o,n)=>e.find(t,o,n),filter:t=>e.filterByType(t),register:r=>{const s=o(r);be(t,s)&&((e,o)=>{const r=t[o];if(r!==e)throw new Error('The tagId "'+o+'" is already used by: '+Ci(r.element)+"\nCannot use it for: "+Ci(e.element)+"\nThe conflicting element is"+(vt(r.element)?" ":" not ")+"already in the DOM");n(e)})(r,s);const a=[r];e.registerId(a,s,r.events),t[s]=r},unregister:n,getById:e=>fe(t,e)}},Xk=Rg({name:"Container",factory:e=>{const{attributes:t,...o}=e.dom;return{uid:e.uid,dom:{tag:"div",attributes:{role:"presentation",...t},...o},components:e.components,behaviours:Mu(e.containerBehaviours),events:e.events,domModification:e.domModification,eventOrder:e.eventOrder}},configFields:[Ar("components",[]),Du("containerBehaviours",[]),Ar("events",{}),Ar("domModification",{}),Ar("eventOrder",{})]}),Jk=e=>{const t=t=>nt(e.element).fold(O,(e=>Xe(t,e))),o=Yk(),n=(e,n)=>o.find(t,e,n),r=Zk(e.element,{triggerEvent:(e,t)=>Oi(e,t.target,(o=>((e,t,o,n)=>Gk(e,t,o,o.target,n))(n,e,t,o)))}),s={debugInfo:w("real"),triggerEvent:(e,t,o)=>{Oi(e,t,(r=>Gk(n,e,o,t,r)))},triggerFocus:(e,t)=>{nl(e).fold((()=>{Pc(e)}),(o=>{Oi(ys(),e,(o=>(((e,t,o,n,r)=>{const s=Uk(o,n);Wk(e,t,o,n,s,r)})(n,ys(),{originator:t,kill:v,prevent:v,target:e},e,o),!1)))}))},triggerEscape:(e,t)=>{s.triggerEvent("keydown",e.element,t.event)},getByUid:e=>h(e),getByDom:e=>p(e),build:zl,buildOrPatch:Fl,addToGui:e=>{l(e)},removeFromGui:e=>{c(e)},addToWorld:e=>{a(e)},removeFromWorld:e=>{i(e)},broadcast:e=>{m(e)},broadcastOn:(e,t)=>{u(e,t)},broadcastEvent:(e,t)=>{g(e,t)},isConnected:O},a=e=>{e.connect(s),je(e.element)||(o.register(e),F(e.components(),a),s.triggerEvent(As(),e.element,{target:e.element}))},i=e=>{je(e.element)||(F(e.components(),i),o.unregister(e)),e.disconnect()},l=t=>{jm(e,t)},c=e=>{qm(e)},d=e=>{const t=o.filter(Cs());F(t,(t=>{const o=t.descHandler;gl(o)(e)}))},m=e=>{d({universal:!0,data:e})},u=(e,t)=>{d({universal:!1,channels:e,data:t})},g=(e,t)=>{const n=o.filter(e);return qk(n,t)},h=e=>o.getById(e).fold((()=>rn.error(new Error('Could not find component with uid: "'+e+'" in system.'))),rn.value),p=e=>{const t=nl(e).getOr("not found");return h(t)};return a(e),{root:e,element:e.element,destroy:()=>{r.unbind(),Io(e.element)},add:l,remove:c,getByUid:h,getByDom:p,addToWorld:a,removeFromWorld:i,broadcast:m,broadcastOn:u,broadcastEvent:g}},Qk=w([Ar("prefix","form-field"),Du("fieldBehaviours",[Pg,Au])]),e_=w([ig({schema:[ur("dom")],name:"label"}),ig({factory:{sketch:e=>({uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}})},schema:[ur("text")],name:"aria-descriptor"}),sg({factory:{sketch:e=>{const t=Fr(e,["factory"]);return e.factory.sketch(t)}},schema:[ur("factory")],name:"field"})]),t_=Bg({name:"FormField",configFields:Qk(),partFields:e_(),factory:(e,t,o,n)=>{const r=Nu(e.fieldBehaviours,[Pg.config({find:t=>yg(t,e,"field")}),Au.config({store:{mode:"manual",getValue:e=>Pg.getCurrent(e).bind(Au.getValue),setValue:(e,t)=>{Pg.getCurrent(e).each((e=>{Au.setValue(e,t)}))}}})]),s=Xs([la(((t,o)=>{const n=xg(t,e,["label","field","aria-descriptor"]);n.field().each((t=>{const o=Xi(e.prefix);n.label().each((e=>{xt(e.element,"for",o),xt(t.element,"id",o)})),n["aria-descriptor"]().each((o=>{const n=Xi(e.prefix);xt(o.element,"id",n),xt(t.element,"aria-describedby",n)}))}))}))]),a={getField:t=>yg(t,e,"field"),getLabel:t=>yg(t,e,"label")};return{uid:e.uid,dom:e.dom,components:t,behaviours:r,events:s,apis:a}},apis:{getField:(e,t)=>e.getField(t),getLabel:(e,t)=>e.getLabel(t)}});var o_=tinymce.util.Tools.resolve("tinymce.html.Entities");const n_=(e,t,o,n)=>{const r=r_(e,t,o,n);return t_.sketch(r)},r_=(e,t,o,n)=>({dom:s_(o),components:e.toArray().concat([t]),fieldBehaviours:xa(n)}),s_=e=>({tag:"div",classes:["tox-form__group"].concat(e)}),a_=(e,t)=>t_.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Hl(t.translate(e))]}),i_=Xi("form-component-change"),l_=Xi("form-close"),c_=Xi("form-cancel"),d_=Xi("form-action"),m_=Xi("form-submit"),u_=Xi("form-block"),g_=Xi("form-unblock"),h_=Xi("form-tabchange"),p_=Xi("form-resize"),f_=(e,t,o)=>{const n=e.label.map((e=>a_(e,t))),r=t.icons(),s=e=>(t,o)=>{Xl(o.event.target,"[data-collection-item-value]").each((n=>{e(t,o,n,St(n,"data-collection-item-value"))}))},a=(o,n)=>{const s=P(n,(o=>{const n=Iy.translate(o.text),s=1===e.columns?`
    ${n}
    `:"",a=`
    ${(e=>{var t;return null!==(t=r[e])&&void 0!==t?t:e})(o.icon)}
    `,i={_:" "," - ":" ","-":" "},l=n.replace(/\_| \- |\-/g,(e=>i[e]));return`
    ${a}${s}
    `})),a="auto"!==e.columns&&e.columns>1?I(s,e.columns):[s],i=P(a,(e=>`
    ${e.join("")}
    `));yi(o.element,i.join(""))},i=s(((o,n,r,s)=>{n.stop(),t.isDisabled()||$s(o,d_,{name:e.name,value:s})})),l=[ea(ss(),s(((e,t,o)=>{Pc(o)}))),ea(us(),i),ea(_s(),i),ea(as(),s(((e,t,o)=>{Yl(e.element,"."+iw).each((e=>{Ba(e,iw)})),Na(o,iw)}))),ea(is(),s((e=>{Yl(e.element,"."+iw).each((e=>{Ba(e,iw),Fc(e)}))}))),ma(s(((t,o,n,r)=>{$s(t,d_,{name:e.name,value:r})})))],c=(e,t)=>P(nm(e.element,".tox-collection__item"),t),d=t_.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==e.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:x},behaviours:xa([Jg.config({disabled:t.isDisabled,onDisabled:e=>{c(e,(e=>{Na(e,"tox-collection__item--state-disabled"),xt(e,"aria-disabled",!0)}))},onEnabled:e=>{c(e,(e=>{Ba(e,"tox-collection__item--state-disabled"),Et(e,"aria-disabled")}))}}),tC(),pf.config({}),zb.config({...t.tooltips.getConfig({tooltipText:"",onShow:e=>{Yl(e.element,"."+iw+"[data-mce-tooltip]").each((o=>{kt(o,"data-mce-tooltip").each((o=>{zb.setComponents(e,t.tooltips.getComponents({tooltipText:o}))}))}))}}),mode:"children-keyboard-focus",anchor:e=>({type:"node",node:Yl(e.element,"."+iw).orThunk((()=>Ye(".tox-collection__item"))),root:e.element,layouts:{onLtr:w([_c,kc,wc,Cc,xc,Sc]),onRtl:w([_c,kc,wc,Cc,xc,Sc])},bubble:xd(0,-2,{})})}),Au.config({store:{mode:"memory",initialValue:o.getOr([])},onSetValue:(t,o)=>{a(t,o),"auto"===e.columns&&qx(t,5,"tox-collection__item").each((({numRows:e,numColumns:o})=>{sf.setGridSize(t,e,o)})),Ws(t,p_)}}),Ab.config({}),sf.config((m=e.columns,u="normal",1===m?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===m?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===u?".tox-swatches__row":".tox-collection__group",cell:"color"===u?`.${tw}`:`.${ew}`}})),ff("collection-events",l)]),eventOrder:{[Ss()]:["disabling","alloy.base.behaviour","collection-events"],[as()]:["collection-events","tooltipping"]}});var m,u;return n_(n,d,["tox-form__group--collection"],[])},v_=["input","textarea"],b_=e=>{const t=ze(e);return B(v_,t)},y_=(e,t)=>{const o=t.getRoot(e).getOr(e.element);Ba(o,t.invalidClass),t.notify.each((t=>{b_(e.element)&&xt(e.element,"aria-invalid",!1),t.getContainer(e).each((e=>{yi(e,t.validHtml)})),t.onValid(e)}))},w_=(e,t,o,n)=>{const r=t.getRoot(e).getOr(e.element);Na(r,t.invalidClass),t.notify.each((t=>{b_(e.element)&&xt(e.element,"aria-invalid",!0),t.getContainer(e).each((e=>{yi(e,n)})),t.onInvalid(e,n)}))},x_=(e,t,o)=>t.validator.fold((()=>dk(rn.value(!0))),(t=>t.validate(e))),C_=(e,t,o)=>(t.notify.each((t=>{t.onValidate(e)})),x_(e,t).map((o=>e.getSystem().isConnected()?o.fold((o=>(w_(e,t,0,o),rn.error(o))),(o=>(y_(e,t),rn.value(o)))):rn.error("No longer in system"))));var S_=Object.freeze({__proto__:null,markValid:y_,markInvalid:w_,query:x_,run:C_,isInvalid:(e,t)=>{const o=t.getRoot(e).getOr(e.element);return Ha(o,t.invalidClass)}});var k_=Object.freeze({__proto__:null,events:(e,t)=>e.validator.map((t=>Xs([ea(t.onEvent,(t=>{C_(t,e).get(x)}))].concat(t.validateOnLoad?[la((t=>{C_(t,e).get(v)}))]:[])))).getOr({})}),__=[ur("invalidClass"),Ar("getRoot",A.none),Or("notify",[Ar("aria","alert"),Ar("getContainer",A.none),Ar("validHtml",""),Ii("onValid"),Ii("onInvalid"),Ii("onValidate")]),Or("validator",[ur("validate"),Ar("onEvent","input"),Ar("validateOnLoad",!0)])];const E_=Sa({fields:__,name:"invalidating",active:k_,apis:S_,extra:{validation:e=>t=>{const o=Au.getValue(t);return dk(e(o))}}});const T_=Sa({fields:[],name:"unselecting",active:Object.freeze({__proto__:null,events:()=>Xs([Js(fs(),O)]),exhibit:()=>ha({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})})}),O_=Xi("color-input-change"),A_=Xi("color-swatch-change"),D_=Xi("color-picker-cancel"),M_=(e,t,o,n)=>{const r=t_.parts.field({factory:xw,inputClasses:["tox-textfield"],data:n,onSetValue:e=>E_.run(e).get(v),inputBehaviours:xa([Jg.config({disabled:t.providers.isDisabled}),tC(),Ab.config({}),E_.config({invalidClass:"tox-textbox-field-invalid",getRoot:e=>rt(e.element),notify:{onValid:e=>{const t=Au.getValue(e);$s(e,O_,{color:t})}},validator:{validateOnLoad:!1,validate:e=>{const t=Au.getValue(e);if(0===t.length)return dk(rn.value(!0));{const e=Be.fromTag("span");At(e,"background-color",t);const o=Bt(e,"background-color").fold((()=>rn.error("blah")),(e=>rn.value(t)));return dk(o)}}}})]),selectOnFocus:!1}),s=e.label.map((e=>a_(e,t.providers))),a=(e,t)=>{$s(e,A_,{value:t})},i=Eb(((e,t)=>_k.sketch({dom:e.dom,components:e.components,toggleClass:"mce-active",dropdownBehaviours:xa([nC(t.providers.isDisabled),tC(),T_.config({}),Ab.config({})]),layouts:e.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:t.getSink,fetch:o=>ck((t=>e.fetch(t))).map((n=>A.from(Lk(Sn(PS(Xi("menu-value"),n,(t=>{e.onItemAction(o,t)}),e.columns,e.presets,Jy.CLOSE_ON_EXECUTE,T,t.providers),{movement:zS(e.columns,e.presets)}))))),parts:{menu:fw(0,0,e.presets)}}))({dom:{tag:"span",attributes:{"aria-label":t.providers.translate("Color swatch")}},layouts:{onRtl:()=>[xc,wc,_c],onLtr:()=>[wc,xc,_c]},components:[],fetch:DS(o.getColors(e.storageKey),e.storageKey,o.hasCustomColors()),columns:o.getColorCols(e.storageKey),presets:"color",onItemAction:(t,n)=>{i.getOpt(t).each((t=>{"custom"===n?o.colorPicker((o=>{o.fold((()=>Ws(t,D_)),(o=>{a(t,o),lS(e.storageKey,o)}))}),"#ffffff"):a(t,"remove"===n?"":n)}))}},t));return t_.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:s.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,i.asSpec()]}]),fieldBehaviours:xa([ff("form-field-events",[ea(O_,((t,o)=>{i.getOpt(t).each((e=>{At(e.element,"background-color",o.event.color)})),$s(t,i_,{name:e.name})})),ea(A_,((e,t)=>{t_.getField(e).each((o=>{Au.setValue(o,t.event.value),Pg.getCurrent(e).each(xf.focus)}))})),ea(D_,((e,t)=>{t_.getField(e).each((t=>{Pg.getCurrent(e).each(xf.focus)}))}))])])})},N_=ig({schema:[ur("dom")],name:"label"}),R_=e=>ig({name:e+"-edge",overrides:t=>t.model.manager.edgeActions[e].fold((()=>({})),(e=>({events:Xs([ta(Xr(),((t,o,n)=>e(t,n)),[t]),ta(ts(),((t,o,n)=>e(t,n)),[t]),ta(os(),((t,o,n)=>{n.mouseIsDown.get()&&e(t,n)}),[t])])})))}),B_=R_("top-left"),L_=R_("top"),H_=R_("top-right"),I_=R_("right"),P_=R_("bottom-right"),F_=R_("bottom"),z_=R_("bottom-left"),V_=R_("left"),Z_=sg({name:"thumb",defaults:w({dom:{styles:{position:"absolute"}}}),overrides:e=>({events:Xs([na(Xr(),e,"spectrum"),na(Jr(),e,"spectrum"),na(Qr(),e,"spectrum"),na(ts(),e,"spectrum"),na(os(),e,"spectrum"),na(rs(),e,"spectrum")])})}),U_=e=>_h(e.event),j_=sg({schema:[dr("mouseIsDown",(()=>Xo(!1)))],name:"spectrum",overrides:e=>{const t=e.model.manager,o=(o,n)=>t.getValueFromEvent(n).map((n=>t.setValueFrom(o,e,n)));return{behaviours:xa([sf.config({mode:"special",onLeft:(o,n)=>t.onLeft(o,e,U_(n)),onRight:(o,n)=>t.onRight(o,e,U_(n)),onUp:(o,n)=>t.onUp(o,e,U_(n)),onDown:(o,n)=>t.onDown(o,e,U_(n))}),Ab.config({}),xf.config({})]),events:Xs([ea(Xr(),o),ea(Jr(),o),ea(ts(),o),ea(os(),((t,n)=>{e.mouseIsDown.get()&&o(t,n)}))])}}});var W_=[N_,V_,I_,L_,F_,B_,H_,z_,P_,Z_,j_];const $_=w("slider.change.value"),q_=e=>{const t=e.event.raw;if((e=>-1!==e.type.indexOf("touch"))(t)){const e=t;return void 0!==e.touches&&1===e.touches.length?A.some(e.touches[0]).map((e=>jt(e.clientX,e.clientY))):A.none()}{const e=t;return void 0!==e.clientX?A.some(e).map((e=>jt(e.clientX,e.clientY))):A.none()}},G_=e=>e.model.minX,K_=e=>e.model.minY,Y_=e=>e.model.minX-1,X_=e=>e.model.minY-1,J_=e=>e.model.maxX,Q_=e=>e.model.maxY,eE=e=>e.model.maxX+1,tE=e=>e.model.maxY+1,oE=(e,t,o)=>t(e)-o(e),nE=e=>oE(e,J_,G_),rE=e=>oE(e,Q_,K_),sE=e=>nE(e)/2,aE=e=>rE(e)/2,iE=(e,t)=>t?e.stepSize*e.speedMultiplier:e.stepSize,lE=e=>e.snapToGrid,cE=e=>e.snapStart,dE=e=>e.rounded,mE=(e,t)=>void 0!==e[t+"-edge"],uE=e=>mE(e,"left"),gE=e=>mE(e,"right"),hE=e=>mE(e,"top"),pE=e=>mE(e,"bottom"),fE=e=>e.model.value.get(),vE=(e,t)=>({x:e,y:t}),bE=(e,t)=>{$s(e,$_(),{value:t})},yE=(e,t,o,n)=>eo?o:e===t?t-1:Math.max(t,e-n),wE=(e,t,o,n)=>e>o?e:eMath.max(t,Math.min(o,e)),CE=e=>{const{min:t,max:o,range:n,value:r,step:s,snap:a,snapStart:i,rounded:l,hasMinEdge:c,hasMaxEdge:d,minBound:m,maxBound:u,screenRange:g}=e,h=c?t-1:t,p=d?o+1:o;if(ru)return p;{const e=((e,t,o)=>Math.min(o,Math.max(e,t))-t)(r,m,u),c=xE(e/g*n+t,h,p);return a&&c>=t&&c<=o?((e,t,o,n,r)=>r.fold((()=>{const r=e-t,s=Math.round(r/n)*n;return xE(t+s,t-1,o+1)}),(t=>{const r=(e-t)%n,s=Math.round(r/n),a=Math.floor((e-t)/n),i=Math.floor((o-t)/n),l=t+Math.min(i,a+s)*n;return Math.max(t,l)})))(c,t,o,s,i):l?Math.round(c):c}},SE=e=>{const{min:t,max:o,range:n,value:r,hasMinEdge:s,hasMaxEdge:a,maxBound:i,maxOffset:l,centerMinEdge:c,centerMaxEdge:d}=e;return ro?a?i:d:(r-t)/n*l},kE="top",_E="right",EE="bottom",TE="left",OE=e=>e.element.dom.getBoundingClientRect(),AE=(e,t)=>e[t],DE=e=>{const t=OE(e);return AE(t,TE)},ME=e=>{const t=OE(e);return AE(t,_E)},NE=e=>{const t=OE(e);return AE(t,kE)},RE=e=>{const t=OE(e);return AE(t,EE)},BE=e=>{const t=OE(e);return AE(t,"width")},LE=e=>{const t=OE(e);return AE(t,"height")},HE=(e,t,o)=>(e+t)/2-o,IE=(e,t)=>{const o=OE(e),n=OE(t),r=AE(o,TE),s=AE(o,_E),a=AE(n,TE);return HE(r,s,a)},PE=(e,t)=>{const o=OE(e),n=OE(t),r=AE(o,kE),s=AE(o,EE),a=AE(n,kE);return HE(r,s,a)},FE=(e,t)=>{$s(e,$_(),{value:t})},zE=(e,t,o)=>{const n={min:G_(t),max:J_(t),range:nE(t),value:o,step:iE(t),snap:lE(t),snapStart:cE(t),rounded:dE(t),hasMinEdge:uE(t),hasMaxEdge:gE(t),minBound:DE(e),maxBound:ME(e),screenRange:BE(e)};return CE(n)},VE=e=>(t,o,n)=>((e,t,o,n)=>{const r=(e>0?wE:yE)(fE(o),G_(o),J_(o),iE(o,n));return FE(t,r),A.some(r)})(e,t,o,n).map(O),ZE=(e,t,o,n,r,s)=>{const a=((e,t,o,n,r)=>{const s=BE(e),a=n.bind((t=>A.some(IE(t,e)))).getOr(0),i=r.bind((t=>A.some(IE(t,e)))).getOr(s),l={min:G_(t),max:J_(t),range:nE(t),value:o,hasMinEdge:uE(t),hasMaxEdge:gE(t),minBound:DE(e),minOffset:0,maxBound:ME(e),maxOffset:s,centerMinEdge:a,centerMaxEdge:i};return SE(l)})(t,s,o,n,r);return DE(t)-DE(e)+a},UE=VE(-1),jE=VE(1),WE=A.none,$E=A.none,qE={"top-left":A.none(),top:A.none(),"top-right":A.none(),right:A.some(((e,t)=>{bE(e,eE(t))})),"bottom-right":A.none(),bottom:A.none(),"bottom-left":A.none(),left:A.some(((e,t)=>{bE(e,Y_(t))}))};var GE=Object.freeze({__proto__:null,setValueFrom:(e,t,o)=>{const n=zE(e,t,o);return FE(e,n),n},setToMin:(e,t)=>{const o=G_(t);FE(e,o)},setToMax:(e,t)=>{const o=J_(t);FE(e,o)},findValueOfOffset:zE,getValueFromEvent:e=>q_(e).map((e=>e.left)),findPositionOfValue:ZE,setPositionFromValue:(e,t,o,n)=>{const r=fE(o),s=ZE(e,n.getSpectrum(e),r,n.getLeftEdge(e),n.getRightEdge(e),o),a=Kt(t.element)/2;At(t.element,"left",s-a+"px")},onLeft:UE,onRight:jE,onUp:WE,onDown:$E,edgeActions:qE});const KE=(e,t)=>{$s(e,$_(),{value:t})},YE=(e,t,o)=>{const n={min:K_(t),max:Q_(t),range:rE(t),value:o,step:iE(t),snap:lE(t),snapStart:cE(t),rounded:dE(t),hasMinEdge:hE(t),hasMaxEdge:pE(t),minBound:NE(e),maxBound:RE(e),screenRange:LE(e)};return CE(n)},XE=e=>(t,o,n)=>((e,t,o,n)=>{const r=(e>0?wE:yE)(fE(o),K_(o),Q_(o),iE(o,n));return KE(t,r),A.some(r)})(e,t,o,n).map(O),JE=(e,t,o,n,r,s)=>{const a=((e,t,o,n,r)=>{const s=LE(e),a=n.bind((t=>A.some(PE(t,e)))).getOr(0),i=r.bind((t=>A.some(PE(t,e)))).getOr(s),l={min:K_(t),max:Q_(t),range:rE(t),value:o,hasMinEdge:hE(t),hasMaxEdge:pE(t),minBound:NE(e),minOffset:0,maxBound:RE(e),maxOffset:s,centerMinEdge:a,centerMaxEdge:i};return SE(l)})(t,s,o,n,r);return NE(t)-NE(e)+a},QE=A.none,eT=A.none,tT=XE(-1),oT=XE(1),nT={"top-left":A.none(),top:A.some(((e,t)=>{bE(e,X_(t))})),"top-right":A.none(),right:A.none(),"bottom-right":A.none(),bottom:A.some(((e,t)=>{bE(e,tE(t))})),"bottom-left":A.none(),left:A.none()};var rT=Object.freeze({__proto__:null,setValueFrom:(e,t,o)=>{const n=YE(e,t,o);return KE(e,n),n},setToMin:(e,t)=>{const o=K_(t);KE(e,o)},setToMax:(e,t)=>{const o=Q_(t);KE(e,o)},findValueOfOffset:YE,getValueFromEvent:e=>q_(e).map((e=>e.top)),findPositionOfValue:JE,setPositionFromValue:(e,t,o,n)=>{const r=fE(o),s=JE(e,n.getSpectrum(e),r,n.getTopEdge(e),n.getBottomEdge(e),o),a=Vt(t.element)/2;At(t.element,"top",s-a+"px")},onLeft:QE,onRight:eT,onUp:tT,onDown:oT,edgeActions:nT});const sT=(e,t)=>{$s(e,$_(),{value:t})},aT=(e,t)=>({x:e,y:t}),iT=(e,t)=>(o,n,r)=>((e,t,o,n,r)=>{const s=e>0?wE:yE,a=t?fE(n).x:s(fE(n).x,G_(n),J_(n),iE(n,r)),i=t?s(fE(n).y,K_(n),Q_(n),iE(n,r)):fE(n).y;return sT(o,aT(a,i)),A.some(a)})(e,t,o,n,r).map(O),lT=iT(-1,!1),cT=iT(1,!1),dT=iT(-1,!0),mT=iT(1,!0),uT={"top-left":A.some(((e,t)=>{bE(e,vE(Y_(t),X_(t)))})),top:A.some(((e,t)=>{bE(e,vE(sE(t),X_(t)))})),"top-right":A.some(((e,t)=>{bE(e,vE(eE(t),X_(t)))})),right:A.some(((e,t)=>{bE(e,vE(eE(t),aE(t)))})),"bottom-right":A.some(((e,t)=>{bE(e,vE(eE(t),tE(t)))})),bottom:A.some(((e,t)=>{bE(e,vE(sE(t),tE(t)))})),"bottom-left":A.some(((e,t)=>{bE(e,vE(Y_(t),tE(t)))})),left:A.some(((e,t)=>{bE(e,vE(Y_(t),aE(t)))}))};var gT=Object.freeze({__proto__:null,setValueFrom:(e,t,o)=>{const n=zE(e,t,o.left),r=YE(e,t,o.top),s=aT(n,r);return sT(e,s),s},setToMin:(e,t)=>{const o=G_(t),n=K_(t);sT(e,aT(o,n))},setToMax:(e,t)=>{const o=J_(t),n=Q_(t);sT(e,aT(o,n))},getValueFromEvent:e=>q_(e),setPositionFromValue:(e,t,o,n)=>{const r=fE(o),s=ZE(e,n.getSpectrum(e),r.x,n.getLeftEdge(e),n.getRightEdge(e),o),a=JE(e,n.getSpectrum(e),r.y,n.getTopEdge(e),n.getBottomEdge(e),o),i=Kt(t.element)/2,l=Vt(t.element)/2;At(t.element,"left",s-i+"px"),At(t.element,"top",a-l+"px")},onLeft:lT,onRight:cT,onUp:dT,onDown:mT,edgeActions:uT});const hT=Bg({name:"Slider",configFields:[Ar("stepSize",1),Ar("speedMultiplier",10),Ar("onChange",v),Ar("onChoose",v),Ar("onInit",v),Ar("onDragStart",v),Ar("onDragEnd",v),Ar("snapToGrid",!1),Ar("rounded",!0),xr("snapStart"),gr("model",ir("mode",{x:[Ar("minX",0),Ar("maxX",100),dr("value",(e=>Xo(e.mode.minX))),ur("getInitialValue"),Vi("manager",GE)],y:[Ar("minY",0),Ar("maxY",100),dr("value",(e=>Xo(e.mode.minY))),ur("getInitialValue"),Vi("manager",rT)],xy:[Ar("minX",0),Ar("maxX",100),Ar("minY",0),Ar("maxY",100),dr("value",(e=>Xo({x:e.mode.minX,y:e.mode.minY}))),ur("getInitialValue"),Vi("manager",gT)]})),Du("sliderBehaviours",[sf,Au]),dr("mouseIsDown",(()=>Xo(!1)))],partFields:W_,factory:(e,t,o,n)=>{const r=t=>wg(t,e,"thumb"),s=t=>wg(t,e,"spectrum"),a=t=>yg(t,e,"left-edge"),i=t=>yg(t,e,"right-edge"),l=t=>yg(t,e,"top-edge"),c=t=>yg(t,e,"bottom-edge"),d=e.model,m=d.manager,u=(t,o)=>{m.setPositionFromValue(t,o,e,{getLeftEdge:a,getRightEdge:i,getTopEdge:l,getBottomEdge:c,getSpectrum:s})},g=(e,t)=>{d.value.set(t);const o=r(e);u(e,o)},h=t=>{const o=e.mouseIsDown.get();e.mouseIsDown.set(!1),o&&yg(t,e,"thumb").each((o=>{const n=d.value.get();e.onChoose(t,o,n)}))},p=(t,o)=>{o.stop(),e.mouseIsDown.set(!0),e.onDragStart(t,r(t))},f=(t,o)=>{o.stop(),e.onDragEnd(t,r(t)),h(t)},v=t=>{yg(t,e,"spectrum").map(sf.focusIn)};return{uid:e.uid,dom:e.dom,components:t,behaviours:Nu(e.sliderBehaviours,[sf.config({mode:"special",focusIn:v}),Au.config({store:{mode:"manual",getValue:e=>d.value.get(),setValue:g}}),Hc.config({channels:{[uu()]:{onReceive:h}}})]),events:Xs([ea($_(),((t,o)=>{((t,o)=>{g(t,o);const n=r(t);e.onChange(t,n,o),A.some(!0)})(t,o.event.value)})),la(((t,o)=>{const n=d.getInitialValue();d.value.set(n);const a=r(t);u(t,a);const i=s(t);e.onInit(t,a,i,d.value.get())})),ea(Xr(),p),ea(Qr(),f),ea(ts(),((e,t)=>{v(e),p(e,t)})),ea(rs(),f)]),apis:{resetToMin:t=>{m.setToMin(t,e)},resetToMax:t=>{m.setToMax(t,e)},setValue:g,refresh:u},domModification:{styles:{position:"relative"}}}},apis:{setValue:(e,t,o)=>{e.setValue(t,o)},resetToMin:(e,t)=>{e.resetToMin(t)},resetToMax:(e,t)=>{e.resetToMax(t)},refresh:(e,t)=>{e.refresh(t)}}}),pT=Xi("rgb-hex-update"),fT=Xi("slider-update"),vT=Xi("palette-update"),bT="form",yT=[Du("formBehaviours",[Au])],wT=e=>"",xT=(e,t)=>({uid:e.uid,dom:e.dom,components:t,behaviours:Nu(e.formBehaviours,[Au.config({store:{mode:"manual",getValue:t=>{const o=Cg(t,e);return le(o,((e,t)=>e().bind((e=>{const o=Pg.getCurrent(e);return n=o,r=new Error(`Cannot find a current component to extract the value from for form part '${t}': `+Ci(e.element)),n.fold((()=>rn.error(r)),rn.value);var n,r})).map(Au.getValue)))},setValue:(t,o)=>{ie(o,((o,n)=>{yg(t,e,n).each((e=>{Pg.getCurrent(e).each((e=>{Au.setValue(e,o)}))}))}))}}})]),apis:{getField:(t,o)=>yg(t,e,o).bind(Pg.getCurrent)}}),CT={getField:ml(((e,t,o)=>e.getField(t,o))),sketch:e=>{const t=(()=>{const e=[];return{field:(t,o)=>(e.push(t),hg(bT,wT(t),o)),record:w(e)}})(),o=e(t),n=t.record(),r=P(n,(e=>sg({name:e,pname:wT(e)})));return Ag(bT,yT,r,xT,o)}},ST=Xi("valid-input"),kT=Xi("invalid-input"),_T=Xi("validating-input"),ET="colorcustom.rgb.",TT={isEnabled:O,setEnabled:v,immediatelyShow:v,immediatelyHide:v},OT=(e,t,o,n,r,s)=>{const a=(e,t)=>{const o=t.get();e!==o.isEnabled()&&(o.setEnabled(e),e?o.immediatelyShow():o.immediatelyHide())},i=(o,n,r)=>E_.config({invalidClass:t("invalid"),notify:{onValidate:e=>{$s(e,_T,{type:o})},onValid:e=>{a(!1,r),$s(e,ST,{type:o,value:Au.getValue(e)})},onInvalid:e=>{a(!0,r),$s(e,kT,{type:o,value:Au.getValue(e)})}},validator:{validate:t=>{const o=Au.getValue(t),r=n(o)?rn.value(!0):rn.error(e("aria.input.invalid"));return dk(r)},validateOnLoad:!1}}),l=(o,n,a,l,c)=>{const d=Xo(TT),m=e(ET+"range"),u=t_.parts.label({dom:{tag:"label",attributes:{"aria-label":l}},components:[Hl(a)]}),g=t_.parts.field({data:c,factory:xw,inputAttributes:{type:"text",..."hex"===n?{"aria-live":"polite"}:{}},inputClasses:[t("textfield")],inputBehaviours:xa([i(n,o,d),Ab.config({}),zb.config({...r({tooltipText:"",onSetup:e=>{d.set({isEnabled:()=>zb.isEnabled(e),setEnabled:t=>zb.setEnabled(e,t),immediatelyShow:()=>zb.immediateOpenClose(e,!0),immediatelyHide:()=>zb.immediateOpenClose(e,!1)}),zb.setEnabled(e,!1)},onShow:(o,r)=>{zb.setComponents(o,[{dom:{tag:"p",classes:[t("rgb-warning-note")]},components:[Hl(e("hex"===n?"colorcustom.rgb.invalidHex":"colorcustom.rgb.invalid"))]}])}})})]),onSetValue:e=>{if(E_.isInvalid(e)){E_.run(e).get(v)}}}),h=Xi("aria-invalid"),p=Eb(s("invalid",A.some(h),"warning")),f=[u,g,Eb({dom:{tag:"div",classes:[t("invalid-icon")]},components:[p.asSpec()]}).asSpec()],b="hex"!==n?[t_.parts["aria-descriptor"]({text:m})]:[],y=f.concat(b);return{dom:{tag:"div",attributes:{role:"presentation"},classes:[t("rgb-container")]},components:y}},c=(e,t)=>{const o=t.red,n=t.green,r=t.blue;Au.setValue(e,{red:o,green:n,blue:r})},d=Eb({dom:{tag:"div",classes:[t("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),m=(e,t)=>{d.getOpt(e).each((e=>{At(e.element,"background-color","#"+t.value)}))},u=Rg({factory:()=>{const r={red:Xo(A.some(255)),green:Xo(A.some(255)),blue:Xo(A.some(255)),hex:Xo(A.some("ffffff"))},s=e=>r[e].get(),a=(e,t)=>{r[e].set(t)},i=e=>{const t=e.red,o=e.green,n=e.blue;a("red",A.some(t)),a("green",A.some(o)),a("blue",A.some(n))},u=(e,t)=>{const o=t.event;"hex"!==o.type?a(o.type,A.none()):n(e)},g=(e,t,o)=>{const n=parseInt(o,10);a(t,A.some(n)),s("red").bind((e=>s("green").bind((t=>s("blue").map((o=>VC(e,t,o,1))))))).each((t=>{const o=((e,t)=>{const o=LC(t);return CT.getField(e,"hex").each((t=>{xf.isFocused(t)||Au.setValue(e,{hex:o.value})})),o})(e,t);$s(e,pT,{hex:o}),m(e,o)}))},h=(e,t)=>{const n=t.event;(e=>"hex"===e.type)(n)?((e,t)=>{o(e);const n=OC(t);a("hex",A.some(n.value));const r=jC(n);c(e,r),i(r),$s(e,pT,{hex:n}),m(e,n)})(e,n.value):g(e,n.type,n.value)},p=t=>({label:e(ET+t+".label"),description:e(ET+t+".description")}),f=p("red"),v=p("green"),b=p("blue"),y=p("hex");return Sn(CT.sketch((o=>({dom:{tag:"form",classes:[t("rgb-form")],attributes:{"aria-label":e("aria.color.picker")}},components:[o.field("red",t_.sketch(l(ZC,"red",f.label,f.description,255))),o.field("green",t_.sketch(l(ZC,"green",v.label,v.description,255))),o.field("blue",t_.sketch(l(ZC,"blue",b.label,b.description,255))),o.field("hex",t_.sketch(l(MC,"hex",y.label,y.description,"ffffff"))),d.asSpec()],formBehaviours:xa([E_.config({invalidClass:t("form-invalid")}),ff("rgb-form-events",[ea(ST,h),ea(kT,u),ea(_T,u)])])}))),{apis:{updateHex:(e,t)=>{Au.setValue(e,{hex:t.value}),((e,t)=>{const o=jC(t);c(e,o),i(o)})(e,t),m(e,t)}}})},name:"RgbForm",configFields:[],apis:{updateHex:(e,t,o)=>{e.updateHex(t,o)}},extraApis:{}});return u},AT=(e,t)=>{const o=hT.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[t("sv-palette-spectrum")]}}),n=hT.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[t("sv-palette-thumb")],innerHtml:``}}),r=(e,t)=>{const{width:o,height:n}=e,r=e.getContext("2d");if(null===r)return;r.fillStyle=t,r.fillRect(0,0,o,n);const s=r.createLinearGradient(0,0,o,0);s.addColorStop(0,"rgba(255,255,255,1)"),s.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=s,r.fillRect(0,0,o,n);const a=r.createLinearGradient(0,0,0,n);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=a,r.fillRect(0,0,o,n)},s=Rg({factory:s=>{const a=w({x:0,y:0}),i=xa([Pg.config({find:A.some}),xf.config({})]);return hT.sketch({dom:{tag:"div",attributes:{role:"slider","aria-valuetext":e(["Saturation {0}%, Brightness {1}%",0,0])},classes:[t("sv-palette")]},model:{mode:"xy",getInitialValue:a},rounded:!1,components:[o,n],onChange:(t,o,n)=>{p(n)||xt(t.element,"aria-valuetext",e(["Saturation {0}%, Brightness {1}%",Math.floor(n.x),Math.floor(100-n.y)])),$s(t,vT,{value:n})},onInit:(e,t,o,n)=>{r(o.element.dom,qC(GC))},sliderBehaviours:i})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:(e,t,o)=>{((e,t)=>{const o=e.components()[0].element.dom,n=cS(t,100,100),s=UC(n);r(o,qC(s))})(t,o)},setThumb:(t,o,n)=>{((t,o)=>{const n=dS(jC(o));hT.setValue(t,{x:n.saturation,y:100-n.value}),xt(t.element,"aria-valuetext",e(["Saturation {0}%, Brightness {1}%",n.saturation,n.value]))})(o,n)}},extraApis:{}});return s},DT=(e,t,o,n)=>{const r=Rg({name:"ColourPicker",configFields:[ur("dom"),Ar("onValidHex",v),Ar("onInvalidHex",v)],factory:r=>{const s=OT(e,t,r.onValidHex,r.onInvalidHex,o,n),a=AT(e,t),i={paletteRgba:Xo(GC),paletteHue:Xo(0)},l=Eb(((e,t)=>{const o=hT.parts.spectrum({dom:{tag:"div",classes:[t("hue-slider-spectrum")],attributes:{role:"presentation"}}}),n=hT.parts.thumb({dom:{tag:"div",classes:[t("hue-slider-thumb")],attributes:{role:"presentation"}}});return hT.sketch({dom:{tag:"div",classes:[t("hue-slider")],attributes:{role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":120}},rounded:!1,model:{mode:"y",getInitialValue:w(0)},components:[o,n],sliderBehaviours:xa([xf.config({})]),onChange:(e,t,o)=>{xt(e.element,"aria-valuenow",Math.floor(360-3.6*o)),$s(e,fT,{value:o})}})})(0,t)),c=Eb(a.sketch({})),d=Eb(s.sketch({})),m=(e,t,o)=>{c.getOpt(e).each((e=>{a.setHue(e,o)}))},u=(e,t)=>{d.getOpt(e).each((e=>{s.updateHex(e,t)}))},g=(e,t,o)=>{l.getOpt(e).each((e=>{hT.setValue(e,(e=>100-e/360*100)(o))}))},h=(e,t)=>{c.getOpt(e).each((e=>{a.setThumb(e,t)}))},p=(e,t,o,n)=>{((e,t)=>{const o=jC(e);i.paletteRgba.set(o),i.paletteHue.set(t)})(t,o),F(n,(n=>{n(e,t,o)}))};return{uid:r.uid,dom:r.dom,components:[c.asSpec(),l.asSpec(),d.asSpec()],behaviours:xa([ff("colour-picker-events",[ea(pT,(()=>{const e=[m,g,h];return(t,o)=>{const n=o.event.hex,r=(e=>dS(jC(e)))(n);p(t,n,r.hue,e)}})()),ea(vT,(()=>{const e=[u];return(t,o)=>{const n=o.event.value,r=i.paletteHue.get(),s=cS(r,n.x,100-n.y),a=mS(s);p(t,a,r,e)}})()),ea(fT,(()=>{const e=[m,u];return(t,o)=>{const n=(e=>(100-e)/100*360)(o.event.value),r=i.paletteRgba.get(),s=dS(r),a=cS(n,s.saturation,s.value),l=mS(a);p(t,l,n,e)}})())]),Pg.config({find:e=>d.getOpt(e)}),sf.config({mode:"acyclic"})])}}});return r},MT=()=>Pg.config({find:A.some}),NT=e=>Pg.config({find:e.getOpt}),RT=e=>Pg.config({find:t=>it(t.element,e).bind((e=>t.getSystem().getByDom(e).toOptional()))}),BT=zn([Ar("preprocess",x),Ar("postprocess",x)]),LT=(e,t)=>{const o=sr("RepresentingConfigs.memento processors",BT,t);return Au.config({store:{mode:"manual",getValue:t=>{const n=e.get(t),r=Au.getValue(n);return o.postprocess(r)},setValue:(t,n)=>{const r=o.preprocess(n),s=e.get(t);Au.setValue(s,r)}}})},HT=(e,t,o)=>Au.config({store:{mode:"manual",...e.map((e=>({initialValue:e}))).getOr({}),getValue:t,setValue:o}}),IT=(e,t,o)=>HT(e,(e=>t(e.element)),((e,t)=>o(e.element,t))),PT=e=>Au.config({store:{mode:"memory",initialValue:e}}),FT={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.rgb.invalid":"Numbers only, 0 to 255","colorcustom.rgb.invalidHex":"Hexadecimal only, 000000 to FFFFFF","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},zT=(e,t,o)=>{const n=e=>"tox-"+e,r=DT((e=>t=>s(t)?e.translate(FT[t]):e.translate(t))(t),n,t.tooltips.getConfig,((e,o,n=e,r=e)=>$y(n,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+e],attributes:{title:t.translate(r),"aria-live":"polite",...o.fold((()=>({})),(e=>({id:e})))}},t.icons))),a=Eb(r.sketch({dom:{tag:"div",classes:[n("color-picker-container")],attributes:{role:"presentation"}},onValidHex:e=>{$s(e,d_,{name:"hex-valid",value:!0})},onInvalidHex:e=>{$s(e,d_,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[a.asSpec()],behaviours:xa([HT(o,(e=>{const t=a.get(e);return Pg.getCurrent(t).bind((e=>Au.getValue(e).hex)).map((e=>"#"+_e(e,"#"))).getOr("")}),((e,t)=>{const o=A.from(/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(t)).bind((e=>ee(e,1))),n=a.get(e);Pg.getCurrent(n).fold((()=>{console.log("Can not find form")}),(e=>{Au.setValue(e,{hex:o.getOr("")}),CT.getField(e,"hex").each((e=>{Ws(e,ds())}))}))})),MT()])}};var VT=tinymce.util.Tools.resolve("tinymce.Resource");const ZT=e=>ve(e,"init");var UT=tinymce.util.Tools.resolve("tinymce.util.Tools");const jT=(e,t,o)=>{const n=(e,t)=>{t.stop()},r=e=>(t,o)=>{F(e,(e=>{e(t,o)}))},s=(e,t)=>{var o;if(!Jg.isDisabled(e)){const n=t.event.raw;i(e,null===(o=n.dataTransfer)||void 0===o?void 0:o.files)}},a=(e,t)=>{const o=t.event.raw.target;i(e,o.files)},i=(o,n)=>{n&&(Au.setValue(o,((e,t)=>{const o=UT.explode(t.getOption("images_file_types"));return V(ne(e),(e=>L(o,(t=>Oe(e.name.toLowerCase(),`.${t.toLowerCase()}`)))))})(n,t)),$s(o,i_,{name:e.name}))},l=Eb({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:xa([ff("input-file-events",[sa(us()),sa(_s())])])}),c=e.label.map((e=>a_(e,t))),d=t_.parts.field({factory:{sketch:e=>({uid:e.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:xa([PT(o.getOr([])),MT(),Jg.config({}),Af.config({toggleClass:"dragenter",toggleOnExecute:!1}),ff("dropzone-events",[ea("dragenter",r([n,Af.toggle])),ea("dragleave",r([n,Af.toggle])),ea("dragover",n),ea("drop",r([n,s])),ea(ms(),a)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p"},components:[Hl(t.translate("Drop an image here"))]},kb.sketch({dom:{tag:"button",styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[Hl(t.translate("Browse for an image")),l.asSpec()],action:e=>{l.get(e).element.dom.click()},buttonBehaviours:xa([Ab.config({}),nC(t.isDisabled),tC()])})]}]})}});return n_(c,d,["tox-form__group--stretched"],[])},WT=(e,t)=>{let o=null;const n=()=>{c(o)||(clearTimeout(o),o=null)};return{cancel:n,throttle:(...r)=>{n(),o=setTimeout((()=>{o=null,e.apply(null,r)}),t)}}},$T=Xi("alloy-fake-before-tabstop"),qT=Xi("alloy-fake-after-tabstop"),GT=e=>({dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:e},behaviours:xa([xf.config({ignore:!0}),Ab.config({})])}),KT=(e,t)=>({dom:{tag:"div",classes:["tox-navobj",...e.getOr([])]},components:[GT([$T]),t,GT([qT])],behaviours:xa([RT(1)])}),YT=(e,t)=>{$s(e,ls(),{raw:{which:9,shiftKey:t}})},XT=(e,t)=>{const o=t.element;Ha(o,$T)?YT(e,!0):Ha(o,qT)&&YT(e,!1)},JT=e=>Pk(e,["."+$T,"."+qT].join(","),T),QT=Xi("update-dialog"),eO=Xi("update-title"),tO=Xi("update-body"),oO=Xi("update-footer"),nO=Xi("body-send-message"),rO=Xi("dialog-focus-shifted"),sO=To().browser,aO=sO.isSafari(),iO=sO.isFirefox(),lO=aO||iO,cO=sO.isChromium(),dO=({scrollTop:e,scrollHeight:t,clientHeight:o})=>Math.ceil(e)+o>=t,mO=(e,t)=>e.scrollTo(0,"bottom"===t?99999999:t),uO=(e,t,o)=>{const n=e.dom;A.from(n.contentDocument).fold(o,(e=>{let o=0;const r=((e,t)=>{const o=e.body;return A.from(!/^1))?o:e.documentElement)})(e,t).map((e=>(o=e.scrollTop,e))).forall(dO),s=()=>{const e=n.contentWindow;g(e)&&(r?mO(e,"bottom"):!r&&lO&&0!==o&&mO(e,o))};aO&&n.addEventListener("load",s,{once:!0}),e.open(),e.write(t),e.close(),aO||s()}))},gO=Se(lO,aO?500:200).map((e=>((e,t)=>{let o=null,n=null;return{cancel:()=>{c(o)||(clearTimeout(o),o=null,n=null)},throttle:(...r)=>{n=r,c(o)&&(o=setTimeout((()=>{const t=n;o=null,n=null,e.apply(null,t)}),t))}}})(uO,e))),hO=(e,t,o)=>{const n="tox-dialog__iframe",r=e.transparent?[]:[`${n}--opaque`],s=e.border?["tox-navobj-bordered"]:[],a={...e.label.map((e=>({title:e}))).getOr({}),...o.map((e=>({srcdoc:e}))).getOr({}),...e.sandboxed?{sandbox:"allow-scripts allow-same-origin"}:{}},i=((e,t)=>{const o=Xo(e.getOr(""));return{getValue:e=>o.get(),setValue:(e,n)=>{if(o.get()!==n){const o=e.element,r=()=>xt(o,"srcdoc",n);t?gO.fold(w(uO),(e=>e.throttle))(o,n,r):r()}o.set(n)}}})(o,e.streamContent),l=e.label.map((e=>a_(e,t))),c=t_.parts.field({factory:{sketch:e=>KT(A.from(s),{uid:e.uid,dom:{tag:"iframe",attributes:a,classes:[n,...r]},behaviours:xa([Ab.config({}),xf.config({}),HT(o,i.getValue,i.setValue),Hc.config({channels:{[rO]:{onReceive:(e,t)=>{t.newFocus.each((t=>{rt(e.element).each((o=>{(Xe(e.element,t)?Na:Ba)(o,"tox-navobj-bordered-focus")}))}))}}}})])})}});return n_(l,c,["tox-form__group--stretched"],[])},pO=(e,t)=>{const o=Xo(t.getOr({url:""})),n=Eb({dom:{tag:"img",classes:["tox-imagepreview__image"],attributes:t.map((e=>({src:e.url}))).getOr({})}}),r=Eb({dom:{tag:"div",classes:["tox-imagepreview__container"],attributes:{role:"presentation"}},components:[n.asSpec()]}),s={};e.height.each((e=>s.height=e));const a=t.map((e=>({url:e.url,zoom:A.from(e.zoom),cachedWidth:A.from(e.cachedWidth),cachedHeight:A.from(e.cachedHeight)})));return{dom:{tag:"div",classes:["tox-imagepreview"],styles:s,attributes:{role:"presentation"}},components:[r.asSpec()],behaviours:xa([MT(),HT(a,(()=>o.get()),((e,t)=>{const s={url:t.url};t.zoom.each((e=>s.zoom=e)),t.cachedWidth.each((e=>s.cachedWidth=e)),t.cachedHeight.each((e=>s.cachedHeight=e)),o.set(s);const a=()=>{const{cachedWidth:t,cachedHeight:o,zoom:n}=s;if(!m(t)&&!m(o)){if(m(n)){const n=((e,t,o)=>{const n=Kt(e),r=Vt(e);return Math.min(n/t,r/o,1)})(e.element,t,o);s.zoom=n}const a=((e,t,o,n,r)=>{const s=o*r,a=n*r,i=Math.max(0,e/2-s/2),l=Math.max(0,t/2-a/2);return{left:i.toString()+"px",top:l.toString()+"px",width:s.toString()+"px",height:a.toString()+"px"}})(Kt(e.element),Vt(e.element),t,o,s.zoom);r.getOpt(e).each((e=>{Dt(e.element,a)}))}};n.getOpt(e).each((o=>{const n=o.element;t.url!==St(n,"src")&&(xt(n,"src",t.url),Ba(e.element,"tox-imagepreview__loaded")),a(),(e=>new Promise(((t,o)=>{const n=()=>{s(),t(e)},r=[rd(e,"load",n),rd(e,"error",(()=>{s(),o("Unable to load data from image: "+e.dom.src)}))],s=()=>F(r,(e=>e.unbind()));e.dom.complete&&n()})))(n).then((t=>{e.getSystem().isConnected()&&(Na(e.element,"tox-imagepreview__loaded"),s.cachedWidth=t.dom.naturalWidth,s.cachedHeight=t.dom.naturalHeight,a())}))}))}))])}},fO=Xi("toolbar.button.execute"),vO=Xi("common-button-display-events"),bO={[Ss()]:["disabling","alloy.base.behaviour","toggling","toolbar-button-events","tooltipping"],[Bs()]:["toolbar-button-events",vO],[Ls()]:["toolbar-button-events","dropdown-events","tooltipping"],[ts()]:["focusing","alloy.base.behaviour",vO]},yO=e=>At(e.element,"width",Nt(e.element,"width")),wO=(e,t,o)=>$y(e,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:o},t),xO=(e,t)=>wO(e,t,[]),CO=(e,t)=>wO(e,t,[pf.config({})]),SO=(e,t,o)=>({dom:{tag:"span",classes:[`${t}__select-label`]},components:[Hl(o.translate(e))],behaviours:xa([pf.config({})])}),kO=Xi("update-menu-text"),_O=Xi("update-menu-icon"),EO=(e,t,o,n)=>{const r=Xo(v),s=e.text.map((e=>Eb(SO(e,t,o.providers)))),a=e.icon.map((e=>Eb(CO(e,o.providers.icons)))),i=(e,t)=>{const o=Au.getValue(e);return xf.focus(o),$s(o,"keydown",{raw:t.event.raw}),_k.close(o),A.some(!0)},l=e.role.fold((()=>({})),(e=>({role:e}))),c=A.from(e.listRole).map((e=>({listRole:e}))).getOr({}),d=e.ariaLabel.fold((()=>({})),(e=>({"aria-label":o.providers.translate(e)}))),m=$y("chevron-down",{tag:"div",classes:[`${t}__select-chevron`]},o.providers.icons),u=Xi("common-button-display-events"),h="dropdown-events",p=Eb(_k.sketch({...e.uid?{uid:e.uid}:{},...l,...c,dom:{tag:"button",classes:[t,`${t}--select`].concat(P(e.classes,(e=>`${t}--${e}`))),attributes:{...d,...g(n)?{"data-mce-name":n}:{}}},components:mC([a.map((e=>e.asSpec())),s.map((e=>e.asSpec())),A.some(m)]),matchWidth:!0,useMinWidth:!0,onOpen:(t,o,n)=>{e.searchable&&(e=>{Ew(e).each((e=>xf.focus(e)))})(n)},dropdownBehaviours:xa([...e.dropdownBehaviours,nC((()=>e.disabled||o.providers.isDisabled())),tC(),T_.config({}),pf.config({}),...e.tooltip.map((e=>zb.config(o.providers.tooltips.getConfig({tooltipText:o.providers.translate(e)})))).toArray(),ff(h,[iC(e,r),lC(e,r)]),ff(u,[la(((t,o)=>"listbox"===e.listRole?v:yO(t)))]),ff("menubutton-update-display-text",[ea(kO,((e,t)=>{s.bind((t=>t.getOpt(e))).each((e=>{pf.set(e,[Hl(o.providers.translate(t.event.text))])}))})),ea(_O,((e,t)=>{a.bind((t=>t.getOpt(e))).each((e=>{pf.set(e,[CO(t.event.icon,o.providers.icons)])}))}))])]),eventOrder:Sn(bO,{[ts()]:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"],[Bs()]:["toolbar-button-events",zb.name(),h,u]}),sandboxBehaviours:xa([sf.config({mode:"special",onLeft:i,onRight:i}),ff("dropdown-sandbox-events",[ea(Cw,((e,t)=>{Ek(e),t.stop()})),ea(Sw,((e,t)=>{((e,t)=>{Tk(e).each((o=>{((e,t,o,n)=>{const r={...n,target:t};e.getSystem().triggerEvent(o,t,r)})(e,o.element,t.event.eventType,t.event.interactionEvent)}))})(e,t),t.stop()}))])]),lazySink:o.getSink,toggleClass:`${t}--active`,parts:{menu:{...fw(0,e.columns,e.presets),fakeFocus:e.searchable,..."listbox"===e.listRole?{}:{onHighlightItem:Ok,onCollapseMenu:(e,t,o)=>{ch.getHighlighted(o).each((t=>{Ok(e,o,t)}))},onDehighlightItem:Ak}}},getAnchorOverrides:()=>({maxHeightFunction:(e,t)=>{fd()(e,t-10)}}),fetch:t=>ck(S(e.fetch,t))}));return p.asSpec()},TO=e=>"separator"===e.type,OO={type:"separator"},AO=(e,t)=>{const o=U(e,((e,o)=>(e=>s(e))(o)?""===o?e:"|"===o?e.length>0&&!TO(e[e.length-1])?e.concat([OO]):e:ve(t,o.toLowerCase())?e.concat([t[o.toLowerCase()]]):e:e.concat([o])),[]);return o.length>0&&TO(o[o.length-1])&&o.pop(),o},DO=(e,t)=>{const o=AO(s(e)?e.split(" "):e,t);return Z(o,((e,o)=>{if((e=>ve(e,"getSubmenuItems"))(o)){const n=(e=>{const t=fe(e,"value").getOrThunk((()=>Xi("generated-menu-item")));return Sn({value:t},e)})(o),r=((e,t)=>{const o=e.getSubmenuItems(),n=DO(o,t);return{item:e,menus:Sn(n.menus,{[e.value]:n.items}),expansions:Sn(n.expansions,{[e.value]:e.value})}})(n,t);return{menus:Sn(e.menus,r.menus),items:[r.item,...e.items],expansions:Sn(e.expansions,r.expansions)}}return{...e,items:[o,...e.items]}}),{menus:{},expansions:{},items:[]})},MO=(e,t,o,n)=>{const r=Xi("primary-menu"),s=DO(e,o.shared.providers.menuItems());if(0===s.items.length)return A.none();const a=(e=>e.search.fold((()=>({searchMode:"no-search"})),(e=>({searchMode:"search-with-field",placeholder:e.placeholder}))))(n),i=Bk(r,s.items,t,o,n.isHorizontalMenu,a),l=(e=>e.search.fold((()=>({searchMode:"no-search"})),(e=>({searchMode:"search-with-results"}))))(n),c=le(s.menus,((e,n)=>Bk(n,e,t,o,!1,l))),d=Sn(c,zr(r,i));return A.from(iv.tieredData(r,d,s.expansions))},NO=e=>!ve(e,"items"),RO="data-value",BO=(e,t,o,n,r)=>P(o,(o=>NO(o)?{type:"togglemenuitem",...r?{}:{role:"option"},text:o.text,value:o.value,active:o.value===n,onAction:()=>{Au.setValue(e,o.value),$s(e,i_,{name:t}),xf.focus(e)}}:{type:"nestedmenuitem",text:o.text,getSubmenuItems:()=>BO(e,t,o.items,n,r)})),LO=(e,t)=>re(e,(e=>NO(e)?Se(e.value===t,e):LO(e.items,t))),HO=Rg({name:"HtmlSelect",configFields:[ur("options"),Du("selectBehaviours",[xf,Au]),Ar("selectClasses",[]),Ar("selectAttributes",{}),xr("data")],factory:(e,t)=>{const o=P(e.options,(e=>({dom:{tag:"option",value:e.value,innerHtml:e.text}}))),n=e.data.map((e=>zr("initialValue",e))).getOr({});return{uid:e.uid,dom:{tag:"select",classes:e.selectClasses,attributes:e.selectAttributes},components:o,behaviours:Nu(e.selectBehaviours,[xf.config({}),Au.config({store:{mode:"manual",getValue:e=>Sl(e.element),setValue:(t,o)=>{const n=te(e.options);j(e.options,(e=>e.value===o)).isSome()?kl(t.element,o):-1===t.element.dom.selectedIndex&&""===o&&n.each((e=>kl(t.element,e.value)))},...n}})])}}}),IO=w([Ar("field1Name","field1"),Ar("field2Name","field2"),Fi("onLockedChange"),Li(["lockClass"]),Ar("locked",!1),Ru("coupledFieldBehaviours",[Pg,Au])]),PO=(e,t)=>sg({factory:t_,name:e,overrides:e=>({fieldBehaviours:xa([ff("coupled-input-behaviour",[ea(ds(),(o=>{((e,t,o)=>yg(e,t,o).bind(Pg.getCurrent))(o,e,t).each((t=>{yg(o,e,"lock").each((n=>{Af.isOn(n)&&e.onLockedChange(o,t,n)}))}))}))])])})}),FO=w([PO("field1","field2"),PO("field2","field1"),sg({factory:kb,schema:[ur("dom")],name:"lock",overrides:e=>({buttonBehaviours:xa([Af.config({selected:e.locked,toggleClass:e.markers.lockClass,aria:{mode:"pressed"}})])})})]),zO=Bg({name:"FormCoupledInputs",configFields:IO(),partFields:FO(),factory:(e,t,o,n)=>({uid:e.uid,dom:e.dom,components:t,behaviours:Bu(e.coupledFieldBehaviours,[Pg.config({find:A.some}),Au.config({store:{mode:"manual",getValue:t=>{const o=kg(t,e,["field1","field2"]);return{[e.field1Name]:Au.getValue(o.field1()),[e.field2Name]:Au.getValue(o.field2())}},setValue:(t,o)=>{const n=kg(t,e,["field1","field2"]);be(o,e.field1Name)&&Au.setValue(n.field1(),o[e.field1Name]),be(o,e.field2Name)&&Au.setValue(n.field2(),o[e.field2Name])}}})]),apis:{getField1:t=>yg(t,e,"field1"),getField2:t=>yg(t,e,"field2"),getLock:t=>yg(t,e,"lock")}}),apis:{getField1:(e,t)=>e.getField1(t),getField2:(e,t)=>e.getField2(t),getLock:(e,t)=>e.getLock(t)}}),VO=e=>{const t=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(e);if(null!==t){const e=parseFloat(t[1]),o=t[2];return rn.value({value:e,unit:o})}return rn.error(e)},ZO=(e,t)=>{const o={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},n=e=>ve(o,e);return e.unit===t?A.some(e.value):n(e.unit)&&n(t)?o[e.unit]===o[t]?A.some(e.value):A.some(e.value/o[e.unit]*o[t]):A.none()},UO=e=>A.none(),jO=(e,t)=>{const o=VO(e).toOptional(),n=VO(t).toOptional();return xe(o,n,((e,t)=>ZO(e,t.unit).map((e=>t.value/e)).map((e=>{return o=e,n=t.unit,e=>ZO(e,n).map((e=>({value:e*o,unit:n})));var o,n})).getOr(UO))).getOr(UO)},WO=(e,t)=>{const o=e.label.map((e=>a_(e,t))),n=[Jg.config({disabled:()=>e.disabled||t.isDisabled()}),tC(),sf.config({mode:"execution",useEnter:!0!==e.multiline,useControlEnter:!0===e.multiline,execute:e=>(Ws(e,m_),A.some(!0))}),ff("textfield-change",[ea(ds(),((t,o)=>{$s(t,i_,{name:e.name})})),ea(xs(),((t,o)=>{$s(t,i_,{name:e.name})}))]),Ab.config({})],r=e.validation.map((e=>E_.config({getRoot:e=>rt(e.element),invalidClass:"tox-invalid",validator:{validate:t=>{const o=Au.getValue(t),n=e.validator(o);return dk(!0===n?rn.value(o):rn.error(n))},validateOnLoad:e.validateOnLoad}}))).toArray(),s={...e.placeholder.fold(w({}),(e=>({placeholder:t.translate(e)}))),...e.inputMode.fold(w({}),(e=>({inputmode:e}))),"data-mce-name":e.name},a=t_.parts.field({tag:!0===e.multiline?"textarea":"input",...e.data.map((e=>({data:e}))).getOr({}),inputAttributes:s,inputClasses:[e.classname],inputBehaviours:xa($([n,r])),selectOnFocus:!1,factory:xw}),i=e.multiline?{dom:{tag:"div",classes:["tox-textarea-wrap"]},components:[a]}:a,l=(e.flex?["tox-form__group--stretched"]:[]).concat(e.maximized?["tox-form-group--maximize"]:[]),c=[Jg.config({disabled:()=>e.disabled||t.isDisabled(),onDisabled:e=>{t_.getField(e).each(Jg.disable)},onEnabled:e=>{t_.getField(e).each(Jg.enable)}}),tC()];return n_(o,i,l,c)},$O=(e,t)=>t.getAnimationRoot.fold((()=>e.element),(t=>t(e))),qO=e=>e.dimension.property,GO=(e,t)=>e.dimension.getDimension(t),KO=(e,t)=>{const o=$O(e,t);Pa(o,[t.shrinkingClass,t.growingClass])},YO=(e,t)=>{Ba(e.element,t.openClass),Na(e.element,t.closedClass),At(e.element,qO(t),"0px"),Pt(e.element)},XO=(e,t)=>{Ba(e.element,t.closedClass),Na(e.element,t.openClass),It(e.element,qO(t))},JO=(e,t,o,n)=>{o.setCollapsed(),At(e.element,qO(t),GO(t,e.element)),KO(e,t),YO(e,t),t.onStartShrink(e),t.onShrunk(e)},QO=(e,t,o,n)=>{const r=n.getOrThunk((()=>GO(t,e.element)));o.setCollapsed(),At(e.element,qO(t),r),Pt(e.element);const s=$O(e,t);Ba(s,t.growingClass),Na(s,t.shrinkingClass),YO(e,t),t.onStartShrink(e)},eA=(e,t,o)=>{const n=GO(t,e.element);("0px"===n?JO:QO)(e,t,o,A.some(n))},tA=(e,t,o)=>{const n=$O(e,t),r=Ha(n,t.shrinkingClass),s=GO(t,e.element);XO(e,t);const a=GO(t,e.element);(r?()=>{At(e.element,qO(t),s),Pt(e.element)}:()=>{YO(e,t)})(),Ba(n,t.shrinkingClass),Na(n,t.growingClass),XO(e,t),At(e.element,qO(t),a),o.setExpanded(),t.onStartGrow(e)},oA=(e,t,o)=>{const n=$O(e,t);return!0===Ha(n,t.growingClass)},nA=(e,t,o)=>{const n=$O(e,t);return!0===Ha(n,t.shrinkingClass)};var rA=Object.freeze({__proto__:null,refresh:(e,t,o)=>{if(o.isExpanded()){It(e.element,qO(t));const o=GO(t,e.element);At(e.element,qO(t),o)}},grow:(e,t,o)=>{o.isExpanded()||tA(e,t,o)},shrink:(e,t,o)=>{o.isExpanded()&&eA(e,t,o)},immediateShrink:(e,t,o)=>{o.isExpanded()&&JO(e,t,o)},hasGrown:(e,t,o)=>o.isExpanded(),hasShrunk:(e,t,o)=>o.isCollapsed(),isGrowing:oA,isShrinking:nA,isTransitioning:(e,t,o)=>oA(e,t)||nA(e,t),toggleGrow:(e,t,o)=>{(o.isExpanded()?eA:tA)(e,t,o)},disableTransitions:KO,immediateGrow:(e,t,o)=>{o.isExpanded()||(XO(e,t),At(e.element,qO(t),GO(t,e.element)),KO(e,t),o.setExpanded(),t.onStartGrow(e),t.onGrown(e))}});var sA=Object.freeze({__proto__:null,exhibit:(e,t,o)=>{const n=t.expanded;return ha(n?{classes:[t.openClass],styles:{}}:{classes:[t.closedClass],styles:zr(t.dimension.property,"0px")})},events:(e,t)=>Xs([ia(hs(),((o,n)=>{if(n.event.raw.propertyName===e.dimension.property){KO(o,e),t.isExpanded()&&It(o.element,e.dimension.property);(t.isExpanded()?e.onGrown:e.onShrunk)(o)}}))])}),aA=[ur("closedClass"),ur("openClass"),ur("shrinkingClass"),ur("growingClass"),xr("getAnimationRoot"),Ii("onShrunk"),Ii("onStartShrink"),Ii("onGrown"),Ii("onStartGrow"),Ar("expanded",!1),gr("dimension",ir("property",{width:[Vi("property","width"),Vi("getDimension",(e=>Kt(e)+"px"))],height:[Vi("property","height"),Vi("getDimension",(e=>Vt(e)+"px"))]}))];const iA=Sa({fields:aA,name:"sliding",active:sA,apis:rA,state:Object.freeze({__proto__:null,init:e=>{const t=Xo(e.expanded);return wa({isExpanded:()=>!0===t.get(),isCollapsed:()=>!1===t.get(),setCollapsed:S(t.set,!1),setExpanded:S(t.set,!0),readState:()=>"expanded: "+t.get()})}})}),lA=e=>({isEnabled:()=>!Jg.isDisabled(e),setEnabled:t=>Jg.set(e,!t),setActive:t=>{const o=e.element;t?(Na(o,"tox-tbtn--enabled"),xt(o,"aria-pressed",!0)):(Ba(o,"tox-tbtn--enabled"),Et(o,"aria-pressed"))},isActive:()=>Ha(e.element,"tox-tbtn--enabled"),setText:t=>{$s(e,kO,{text:t})},setIcon:t=>$s(e,_O,{icon:t})}),cA=(e,t,o,n,r=!0,s)=>EO({text:e.text,icon:e.icon,tooltip:e.tooltip,ariaLabel:e.tooltip,searchable:e.search.isSome(),role:n,fetch:(t,n)=>{const r={pattern:e.search.isSome()?Dk(t):""};e.fetch((t=>{n(MO(t,Jy.CLOSE_ON_EXECUTE,o,{isHorizontalMenu:!1,search:e.search}))}),r,lA(t))},onSetup:e.onSetup,getApi:lA,columns:1,presets:"normal",classes:[],dropdownBehaviours:[...r?[Ab.config({})]:[]]},t,o.shared,s),dA=(e,t,o)=>{const n=e=>n=>{const r=!n.isActive();n.setActive(r),e.storage.set(r),o.shared.getSink().each((o=>{t().getOpt(o).each((t=>{Pc(t.element),$s(t,d_,{name:e.name,value:e.storage.get()})}))}))},r=e=>t=>{t.setActive(e.storage.get())};return t=>{t(P(e,(e=>{const t=e.text.fold((()=>({})),(e=>({text:e})));return{type:e.type,active:!1,...t,onAction:n(e),onSetup:r(e)}})))}},mA=e=>({dom:{tag:"span",classes:["tox-tree__label"],attributes:{"aria-label":e}},components:[Hl(e)]}),uA=Xi("leaf-label-event-id"),gA=({leaf:e,onLeafAction:t,visible:o,treeId:n,selectedId:r,backstage:s})=>{const a=e.menu.map((e=>cA(e,"tox-mbtn",s,A.none(),o))),i=[mA(e.title)];return a.each((e=>i.push(e))),kb.sketch({dom:{tag:"div",classes:["tox-tree--leaf__label","tox-trbtn"].concat(o?["tox-tree--leaf__label--visible"]:[])},components:i,role:"treeitem",action:o=>{t(e.id),o.getSystem().broadcastOn([`update-active-item-${n}`],{value:e.id})},eventOrder:{[ls()]:[uA,"keying"]},buttonBehaviours:xa([...o?[Ab.config({})]:[],Af.config({toggleClass:"tox-trbtn--enabled",toggleOnExecute:!1,aria:{mode:"selected"}}),Hc.config({channels:{[`update-active-item-${n}`]:{onReceive:(t,o)=>{(o.value===e.id?Af.on:Af.off)(t)}}}}),ff(uA,[la(((t,o)=>{r.each((o=>{(o===e.id?Af.on:Af.off)(t)}))})),ea(ls(),((e,t)=>{const o="ArrowLeft"===t.event.raw.code,n="ArrowRight"===t.event.raw.code;o?(ql(e.element,".tox-tree--directory").each((t=>{e.getSystem().getByDom(t).each((e=>{Kl(t,".tox-tree--directory__label").each((t=>{e.getSystem().getByDom(t).each(xf.focus)}))}))})),t.stop()):n&&t.stop()}))])])})},hA=(e,t)=>((e,t,o)=>$y(e,{tag:"span",classes:["tox-tree__icon-wrap","tox-icon"],behaviours:o},t))(e,t,[]),pA=Xi("directory-label-event-id"),fA=({directory:e,visible:t,noChildren:o,backstage:n})=>{const r=e.menu.map((e=>cA(e,"tox-mbtn",n,A.none()))),s=[{dom:{tag:"div",classes:["tox-chevron"]},components:[hA("chevron-right",n.shared.providers.icons)]},mA(e.title)];r.each((e=>{s.push(e)}));const a=t=>{ql(t.element,".tox-tree--directory").each((o=>{t.getSystem().getByDom(o).each((o=>{const n=!Af.isOn(o);Af.toggle(o),$s(t,"expand-tree-node",{expanded:n,node:e.id})}))}))};return kb.sketch({dom:{tag:"div",classes:["tox-tree--directory__label","tox-trbtn"].concat(t?["tox-tree--directory__label--visible"]:[])},components:s,action:a,eventOrder:{[ls()]:[pA,"keying"]},buttonBehaviours:xa([...t?[Ab.config({})]:[],ff(pA,[ea(ls(),((e,t)=>{const n="ArrowRight"===t.event.raw.code,r="ArrowLeft"===t.event.raw.code;n&&o&&t.stop(),(n||r)&&ql(e.element,".tox-tree--directory").each((o=>{e.getSystem().getByDom(o).each((o=>{!Af.isOn(o)&&n||Af.isOn(o)&&r?(a(e),t.stop()):r&&!Af.isOn(o)&&(ql(o.element,".tox-tree--directory").each((e=>{Kl(e,".tox-tree--directory__label").each((e=>{o.getSystem().getByDom(e).each(xf.focus)}))})),t.stop())}))}))}))])])})},vA=({children:e,onLeafAction:t,visible:o,treeId:n,expandedIds:r,selectedId:s,backstage:a})=>({dom:{tag:"div",classes:["tox-tree--directory__children"]},components:e.map((e=>"leaf"===e.type?gA({leaf:e,selectedId:s,onLeafAction:t,visible:o,treeId:n,backstage:a}):yA({directory:e,expandedIds:r,selectedId:s,onLeafAction:t,labelTabstopping:o,treeId:n,backstage:a}))),behaviours:xa([iA.config({dimension:{property:"height"},closedClass:"tox-tree--directory__children--closed",openClass:"tox-tree--directory__children--open",growingClass:"tox-tree--directory__children--growing",shrinkingClass:"tox-tree--directory__children--shrinking",expanded:o}),pf.config({})])}),bA=Xi("directory-event-id"),yA=({directory:e,onLeafAction:t,labelTabstopping:o,treeId:n,backstage:r,expandedIds:s,selectedId:a})=>{const{children:i}=e,l=Xo(s),c=s.includes(e.id);return{dom:{tag:"div",classes:["tox-tree--directory"],attributes:{role:"treeitem"}},components:[fA({directory:e,visible:o,noChildren:0===e.children.length,backstage:r}),vA({children:i,expandedIds:s,selectedId:a,onLeafAction:t,visible:c,treeId:n,backstage:r})],behaviours:xa([ff(bA,[la(((e,t)=>{Af.set(e,c)})),ea("expand-tree-node",((e,t)=>{const{expanded:o,node:n}=t.event;l.set(o?[...l.get(),n]:l.get().filter((e=>e!==n)))}))]),Af.config({...e.children.length>0?{aria:{mode:"expanded"}}:{},toggleClass:"tox-tree--directory--expanded",onToggled:(e,o)=>{const s=e.components()[1],c=(d=o,i.map((e=>"leaf"===e.type?gA({leaf:e,selectedId:a,onLeafAction:t,visible:d,treeId:n,backstage:r}):yA({directory:e,expandedIds:l.get(),selectedId:a,onLeafAction:t,labelTabstopping:d,treeId:n,backstage:r}))));var d;o?iA.grow(s):iA.shrink(s),pf.set(s,c)}})])}},wA=Xi("tree-event-id");var xA=Object.freeze({__proto__:null,events:(e,t)=>{const o=e.stream.streams.setup(e,t);return Xs([ea(e.event,o),ca((()=>t.cancel()))].concat(e.cancelEvent.map((e=>[ea(e,(()=>t.cancel()))])).getOr([])))}});const CA=e=>{const t=Xo(null);return wa({readState:()=>({timer:null!==t.get()?"set":"unset"}),setTimer:e=>{t.set(e)},cancel:()=>{const e=t.get();null!==e&&e.cancel()}})};var SA=Object.freeze({__proto__:null,throttle:CA,init:e=>e.stream.streams.state(e)});var kA=[gr("stream",ir("mode",{throttle:[ur("delay"),Ar("stopEvent",!0),Vi("streams",{setup:(e,t)=>{const o=e.stream,n=WT(e.onStream,o.delay);return t.setTimer(n),(e,t)=>{n.throttle(e,t),o.stopEvent&&t.stop()}},state:CA})]})),Ar("event","input"),xr("cancelEvent"),Fi("onStream")];const _A=Sa({fields:kA,name:"streaming",active:xA,state:SA}),EA=(e,t,o)=>{const n=Au.getValue(o);Au.setValue(t,n),OA(t)},TA=(e,t)=>{const o=e.element,n=Sl(o),r=o.dom;"number"!==St(o,"type")&&t(r,n)},OA=e=>{TA(e,((e,t)=>e.setSelectionRange(t.length,t.length)))},AA=(e,t,o)=>{if(e.selectsOver){const n=Au.getValue(t),r=e.getDisplayText(n),s=Au.getValue(o);return 0===e.getDisplayText(s).indexOf(r)?A.some((()=>{EA(0,t,o),((e,t)=>{TA(e,((e,o)=>e.setSelectionRange(t,o.length)))})(t,r.length)})):A.none()}return A.none()},DA=w("alloy.typeahead.itemexecute"),MA=w([xr("lazySink"),ur("fetch"),Ar("minChars",5),Ar("responseTime",1e3),Ii("onOpen"),Ar("getHotspot",A.some),Ar("getAnchorOverrides",w({})),Ar("layouts",A.none()),Ar("eventOrder",{}),Ir("model",{},[Ar("getDisplayText",(e=>void 0!==e.meta&&void 0!==e.meta.text?e.meta.text:e.value)),Ar("selectsOver",!0),Ar("populateFromBrowse",!0)]),Ii("onSetValue"),Pi("onExecute"),Ii("onItemExecute"),Ar("inputClasses",[]),Ar("inputAttributes",{}),Ar("inputStyles",{}),Ar("matchWidth",!0),Ar("useMinWidth",!1),Ar("dismissOnBlur",!0),Li(["openClass"]),xr("initialData"),xr("listRole"),Du("typeaheadBehaviours",[xf,Au,_A,sf,Af,rk]),dr("lazyTypeaheadComp",(()=>Xo(A.none))),dr("previewing",(()=>Xo(!0)))].concat(vw()).concat(Ck())),NA=w([ag({schema:[Bi()],name:"menu",overrides:e=>({fakeFocus:!0,onHighlightItem:(t,o,n)=>{e.previewing.get()?e.lazyTypeaheadComp.get().each((t=>{AA(e.model,t,n).fold((()=>{e.model.selectsOver?(ch.dehighlight(o,n),e.previewing.set(!0)):e.previewing.set(!1)}),(t=>{t(),e.previewing.set(!1)}))})):e.lazyTypeaheadComp.get().each((t=>{e.model.populateFromBrowse&&EA(e.model,t,n),kt(n.element,"id").each((e=>xt(t.element,"aria-activedescendant",e)))}))},onExecute:(t,o)=>e.lazyTypeaheadComp.get().map((e=>($s(e,DA(),{item:o}),!0))),onHover:(t,o)=>{e.previewing.set(!1),e.lazyTypeaheadComp.get().each((t=>{e.model.populateFromBrowse&&EA(e.model,t,o)}))}})})]),RA=Bg({name:"Typeahead",configFields:MA(),partFields:NA(),factory:(e,t,o,n)=>{const r=(t,o,r)=>{e.previewing.set(!1);const s=rk.getCoupled(t,"sandbox");if(cu.isOpen(s))Pg.getCurrent(s).each((e=>{ch.getHighlighted(e).fold((()=>{r(e)}),(()=>{Ys(s,e.element,"keydown",o)}))}));else{const o=e=>{Pg.getCurrent(e).each(r)};hk(e,a(t),t,s,n,o,sv.HighlightMenuAndItem).get(v)}},s=bw(e),a=e=>t=>t.map((t=>{const o=pe(t.menus),n=q(o,(e=>V(e.items,(e=>"item"===e.type))));return Au.getState(e).update(P(n,(e=>e.data))),t})),i=e=>Pg.getCurrent(e),l="typeaheadevents",c=[xf.config({}),Au.config({onSetValue:e.onSetValue,store:{mode:"dataset",getDataKey:e=>Sl(e.element),getFallbackEntry:e=>({value:e,meta:{}}),setValue:(t,o)=>{kl(t.element,e.model.getDisplayText(o))},...e.initialData.map((e=>zr("initialValue",e))).getOr({})}}),_A.config({stream:{mode:"throttle",delay:e.responseTime,stopEvent:!1},onStream:(t,o)=>{const r=rk.getCoupled(t,"sandbox");if(xf.isFocused(t)&&Sl(t.element).length>=e.minChars){const o=i(r).bind((e=>ch.getHighlighted(e).map(Au.getValue)));e.previewing.set(!0);const s=t=>{i(r).each((t=>{o.fold((()=>{e.model.selectsOver&&ch.highlightFirst(t)}),(e=>{ch.highlightBy(t,(t=>Au.getValue(t).value===e.value)),ch.getHighlighted(t).orThunk((()=>(ch.highlightFirst(t),A.none())))}))}))};hk(e,a(t),t,r,n,s,sv.HighlightJustMenu).get(v)}},cancelEvent:Os()}),sf.config({mode:"special",onDown:(e,t)=>(r(e,t,ch.highlightFirst),A.some(!0)),onEscape:e=>{const t=rk.getCoupled(e,"sandbox");return cu.isOpen(t)?(cu.close(t),A.some(!0)):A.none()},onUp:(e,t)=>(r(e,t,ch.highlightLast),A.some(!0)),onEnter:t=>{const o=rk.getCoupled(t,"sandbox"),n=cu.isOpen(o);if(n&&!e.previewing.get())return i(o).bind((e=>ch.getHighlighted(e))).map((e=>($s(t,DA(),{item:e}),!0)));{const r=Au.getValue(t);return Ws(t,Os()),e.onExecute(o,t,r),n&&cu.close(o),A.some(!0)}}}),Af.config({toggleClass:e.markers.openClass,aria:{mode:"expanded"}}),rk.config({others:{sandbox:t=>wk(e,t,{onOpen:()=>Af.on(t),onClose:()=>{e.lazyTypeaheadComp.get().each((e=>Et(e.element,"aria-activedescendant"))),Af.off(t)}})}}),ff(l,[la((t=>{e.lazyTypeaheadComp.set(A.some(t))})),ca((t=>{e.lazyTypeaheadComp.set(A.none())})),ma((t=>{const o=v;fk(e,a(t),t,n,o,sv.HighlightMenuAndItem).get(v)})),ea(DA(),((t,o)=>{const n=rk.getCoupled(t,"sandbox");EA(e.model,t,o.event.item),Ws(t,Os()),e.onItemExecute(t,n,o.event.item,Au.getValue(t)),cu.close(n),OA(t)}))].concat(e.dismissOnBlur?[ea(ws(),(e=>{const t=rk.getCoupled(e,"sandbox");Zc(t.element).isNone()&&cu.close(t)}))]:[]))],d={[Ls()]:[Au.name(),_A.name(),l],...e.eventOrder};return{uid:e.uid,dom:ww(Sn(e,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:{...s,...Nu(e.typeaheadBehaviours,c)},eventOrder:d}}}),BA=e=>({...e,toCached:()=>BA(e.toCached()),bindFuture:t=>BA(e.bind((e=>e.fold((e=>dk(rn.error(e))),(e=>t(e)))))),bindResult:t=>BA(e.map((e=>e.bind(t)))),mapResult:t=>BA(e.map((e=>e.map(t)))),mapError:t=>BA(e.map((e=>e.mapError(t)))),foldResult:(t,o)=>e.map((e=>e.fold(t,o))),withTimeout:(t,o)=>BA(ck((n=>{let r=!1;const s=setTimeout((()=>{r=!0,n(rn.error(o()))}),t);e.get((e=>{r||(clearTimeout(s),n(e))}))})))}),LA=e=>BA(ck(e)),HA=LA,IA=(e,t,o=[],n,r,s,a)=>{const i=t.fold((()=>({})),(e=>({action:e}))),l={buttonBehaviours:xa([nC((()=>!e.enabled||a.isDisabled())),tC(),Ab.config({}),...s.map((e=>zb.config(a.tooltips.getConfig({tooltipText:a.translate(e)})))).toArray(),ff("button press",[Qs("click")])].concat(o)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]},...i},c=Sn(l,{dom:n});return Sn(c,{components:r})},PA=(e,t,o,n=[],r)=>{const s={tag:"button",classes:["tox-tbtn"],attributes:{...e.tooltip.map((e=>({"aria-label":o.translate(e)}))).getOr({}),"data-mce-name":r}},a=e.icon.map((e=>xO(e,o.icons))),i=mC([a]);return IA(e,t,n,s,i,e.tooltip,o)},FA=e=>{switch(e){case"primary":return["tox-button"];case"toolbar":return["tox-tbtn"];default:return["tox-button","tox-button--secondary"]}},zA=(e,t,o,n=[],r=[])=>{const s=o.translate(e.text),a=e.icon.map((e=>xO(e,o.icons))),i=[a.getOrThunk((()=>Hl(s)))],l=e.buttonType.getOr(e.primary||e.borderless?"primary":"secondary"),c={tag:"button",classes:[...FA(l),...a.isSome()?["tox-button--icon"]:[],...e.borderless?["tox-button--naked"]:[],...r],attributes:{"aria-label":s,"data-mce-name":e.text}},d=e.icon.map(w(s));return IA(e,t,n,c,i,d,o)},VA=(e,t,o,n=[],r=[])=>{const s=zA(e,A.some(t),o,n,r);return kb.sketch(s)},ZA=(e,t)=>o=>{"custom"===t?$s(o,d_,{name:e,value:{}}):"submit"===t?Ws(o,m_):"cancel"===t?Ws(o,c_):console.error("Unknown button type: ",t)},UA=(e,t,o)=>{if(((e,t)=>"menu"===t)(0,t)){const t=()=>s,n=e,r={...e,type:"menubutton",search:A.none(),onSetup:t=>(t.setEnabled(e.enabled),v),fetch:dA(n.items,t,o)},s=Eb(cA(r,"tox-tbtn",o,A.none(),!0,e.text.or(e.tooltip).getOrUndefined()));return s.asSpec()}if(((e,t)=>"custom"===t||"cancel"===t||"submit"===t)(0,t)){const n=ZA(e.name,t),r={...e,borderless:!1};return VA(r,n,o.shared.providers,[])}if(((e,t)=>"togglebutton"===t)(0,t))return((e,t,o)=>{var n,r;const s=e.icon.map((e=>CO(e,t.icons))).map(Eb),a=e.buttonType.getOr(e.primary?"primary":"secondary"),i={...e,name:null!==(n=e.name)&&void 0!==n?n:"",primary:"primary"===a,tooltip:e.tooltip,enabled:null!==(r=e.enabled)&&void 0!==r&&r,borderless:!1},l=i.tooltip.or(e.text).map((e=>({"aria-label":t.translate(e)}))).getOr({}),c=FA(null!=a?a:"secondary"),d=e.icon.isSome()&&e.text.isSome(),m={tag:"button",classes:[...c.concat(e.icon.isSome()?["tox-button--icon"]:[]),...e.active?["tox-button--enabled"]:[],...d?["tox-button--icon-and-text"]:[]],attributes:{...l,...g(o)?{"data-mce-name":o}:{}}},u=t.translate(e.text.getOr("")),h=Hl(u),p=[...mC([s.map((e=>e.asSpec()))]),...e.text.isSome()?[h]:[]],f=IA(i,A.some((o=>{$s(o,d_,{name:e.name,value:{setIcon:e=>{s.map((n=>n.getOpt(o).each((o=>{pf.set(o,[CO(e,t.icons)])}))))}}})})),[],m,p,e.tooltip,t);return kb.sketch(f)})(e,o.shared.providers,e.text.or(e.tooltip).getOrUndefined());throw console.error("Unknown footer button type: ",t),new Error("Unknown footer button type")},jA=(e,t)=>{const o=ZA(e.name,"custom");return n=A.none(),r=t_.parts.field({factory:kb,...zA(e,A.some(o),t,[PT(""),MT()])}),n_(n,r,[],[]);var n,r},WA={type:"separator"},$A=e=>({type:"menuitem",value:e.url,text:e.title,meta:{attach:e.attach},onAction:v}),qA=(e,t)=>({type:"menuitem",value:t,text:e,meta:{attach:void 0},onAction:v}),GA=(e,t)=>(e=>P(e,$A))(((e,t)=>V(t,(t=>t.type===e)))(e,t)),KA=e=>GA("header",e.targets),YA=e=>GA("anchor",e.targets),XA=e=>A.from(e.anchorTop).map((e=>qA("",e))).toArray(),JA=e=>A.from(e.anchorBottom).map((e=>qA("",e))).toArray(),QA=(e,t)=>{const o=e.toLowerCase();return V(t,(e=>{var t;const n=void 0!==e.meta&&void 0!==e.meta.text?e.meta.text:e.text,r=null!==(t=e.value)&&void 0!==t?t:"";return Ee(n.toLowerCase(),o)||Ee(r.toLowerCase(),o)}))},eD=(e,t,o)=>{var n,r;const s=Au.getValue(t),a=null!==(r=null===(n=null==s?void 0:s.meta)||void 0===n?void 0:n.text)&&void 0!==r?r:s.value;return o.getLinkInformation().fold((()=>[]),(t=>{const n=QA(a,(e=>P(e,(e=>qA(e,e))))(o.getHistory(e)));return"file"===e?(r=[n,QA(a,KA(t)),QA(a,$([XA(t),YA(t),JA(t)]))],U(r,((e,t)=>0===e.length||0===t.length?e.concat(t):e.concat(WA,t)),[])):n;var r}))},tD=Xi("aria-invalid"),oD=(e,t)=>{e.dom.checked=t},nD=e=>e.dom.checked,rD=e=>(t,o,n,r,s)=>fe(o,"name").fold((()=>e(o,r,A.none(),s)),(a=>t.field(a,e(o,r,fe(n,a),s)))),sD={bar:rD(((e,t)=>((e,t)=>({dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:P(e.items,t.interpreter)}))(e,t.shared))),collection:rD(((e,t,o)=>f_(e,t.shared.providers,o))),alertbanner:rD(((e,t)=>((e,t)=>{const o=Uy(e.icon,t.icons);return Xk.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in",`tox-notification--${e.level}`]},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:e.url?void 0:o},components:e.url?[kb.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:o,attributes:{title:t.translate(e.iconTooltip)}},action:t=>$s(t,d_,{name:"alert-banner",value:e.url}),buttonBehaviours:xa([jy()])})]:void 0},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:t.translate(e.text)}}]})})(e,t.shared.providers))),input:rD(((e,t,o)=>((e,t,o)=>WO({name:e.name,multiline:!1,label:e.label,inputMode:e.inputMode,placeholder:e.placeholder,flex:!1,disabled:!e.enabled,classname:"tox-textfield",validation:A.none(),maximized:e.maximized,data:o},t))(e,t.shared.providers,o))),textarea:rD(((e,t,o)=>((e,t,o)=>WO({name:e.name,multiline:!0,label:e.label,inputMode:A.none(),placeholder:e.placeholder,flex:!0,disabled:!e.enabled,classname:"tox-textarea",validation:A.none(),maximized:e.maximized,data:o},t))(e,t.shared.providers,o))),label:rD(((e,t,o,n)=>((e,t,o)=>{const n="tox-label",r="center"===e.align?[`${n}--center`]:[],s="end"===e.align?[`${n}--end`]:[],a=Eb({dom:{tag:"label",classes:[n,...r,...s]},components:[Hl(t.providers.translate(e.label))]}),i=P(e.items,t.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[a.asSpec(),...i],behaviours:xa([MT(),pf.config({}),(l=A.none(),IT(l,bi,yi)),sf.config({mode:"acyclic"}),ff("label",[la((t=>{e.for.each((e=>{o(e).each((e=>{a.getOpt(t).each((t=>{var o;const n=null!==(o=St(e.element,"id"))&&void 0!==o?o:Xi("form-field");xt(e.element,"id",n),xt(t.element,"for",n)}))}))}))}))])])};var l})(e,t.shared,n))),iframe:(e=>(t,o,n,r,s)=>{const a=Sn(o,{source:"dynamic"});return rD(e)(t,a,n,r,s)})(((e,t,o)=>hO(e,t.shared.providers,o))),button:rD(((e,t)=>jA(e,t.shared.providers))),checkbox:rD(((e,t,o)=>((e,t,o)=>{const n=e=>(e.element.dom.click(),A.some(!0)),r=t_.parts.field({factory:{sketch:x},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:xa([MT(),Jg.config({disabled:()=>!e.enabled||t.isDisabled(),onDisabled:e=>{rt(e.element).each((e=>Na(e,"tox-checkbox--disabled")))},onEnabled:e=>{rt(e.element).each((e=>Ba(e,"tox-checkbox--disabled")))}}),Ab.config({}),xf.config({}),IT(o,nD,oD),sf.config({mode:"special",onEnter:n,onSpace:n,stopSpaceKeyup:!0}),ff("checkbox-events",[ea(ms(),((t,o)=>{$s(t,i_,{name:e.name})}))])])}),s=t_.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"]},components:[Hl(t.translate(e.label))],behaviours:xa([T_.config({})])}),a=e=>$y("checked"===e?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+e]},t.icons),i=Eb({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[a("checked"),a("unchecked")]});return t_.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[r,i.asSpec(),s],fieldBehaviours:xa([Jg.config({disabled:()=>!e.enabled||t.isDisabled()}),tC()])})})(e,t.shared.providers,o))),colorinput:rD(((e,t,o)=>M_(e,t.shared,t.colorinput,o))),colorpicker:rD(((e,t,o)=>zT(0,t.shared.providers,o))),dropzone:rD(((e,t,o)=>jT(e,t.shared.providers,o))),grid:rD(((e,t)=>((e,t)=>({dom:{tag:"div",classes:["tox-form__grid",`tox-form__grid--${e.columns}col`]},components:P(e.items,t.interpreter)}))(e,t.shared))),listbox:rD(((e,t,o)=>((e,t,o)=>{const n=L(e.items,(e=>!NO(e))),r=t.shared.providers,s=o.bind((t=>LO(e.items,t))).orThunk((()=>te(e.items).filter(NO))),a=e.label.map((e=>a_(e,r))),i=t_.parts.field({dom:{},factory:{sketch:o=>EO({uid:o.uid,text:s.map((e=>e.text)),icon:A.none(),tooltip:A.none(),role:Se(!n,"combobox"),...n?{}:{listRole:"listbox"},ariaLabel:e.label,fetch:(o,r)=>{const s=BO(o,e.name,e.items,Au.getValue(o),n);r(MO(s,Jy.CLOSE_ON_EXECUTE,t,{isHorizontalMenu:!1,search:A.none()}))},onSetup:w(v),getApi:w({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Ab.config({}),HT(s.map((e=>e.value)),(e=>St(e.element,RO)),((t,o)=>{LO(e.items,o).each((e=>{xt(t.element,RO,e.value),$s(t,kO,{text:e.text})}))}))]},"tox-listbox",t.shared)}}),l={dom:{tag:"div",classes:["tox-listboxfield"]},components:[i]};return t_.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:$([a.toArray(),[l]]),fieldBehaviours:xa([Jg.config({disabled:w(!e.enabled),onDisabled:e=>{t_.getField(e).each(Jg.disable)},onEnabled:e=>{t_.getField(e).each(Jg.enable)}})])})})(e,t,o))),selectbox:rD(((e,t,o)=>((e,t,o)=>{const n=P(e.items,(e=>({text:t.translate(e.text),value:e.value}))),r=e.label.map((e=>a_(e,t))),s=t_.parts.field({dom:{},...o.map((e=>({data:e}))).getOr({}),selectAttributes:{size:e.size},options:n,factory:HO,selectBehaviours:xa([Jg.config({disabled:()=>!e.enabled||t.isDisabled()}),Ab.config({}),ff("selectbox-change",[ea(ms(),((t,o)=>{$s(t,i_,{name:e.name})}))])])}),a=e.size>1?A.none():A.some($y("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},t.icons)),i={dom:{tag:"div",classes:["tox-selectfield"]},components:$([[s],a.toArray()])};return t_.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:$([r.toArray(),[i]]),fieldBehaviours:xa([Jg.config({disabled:()=>!e.enabled||t.isDisabled(),onDisabled:e=>{t_.getField(e).each(Jg.disable)},onEnabled:e=>{t_.getField(e).each(Jg.enable)}}),tC()])})})(e,t.shared.providers,o))),sizeinput:rD(((e,t)=>((e,t)=>{let o=UO;const n=Xi("ratio-event"),r=e=>$y(e,{tag:"span",classes:["tox-icon","tox-lock-icon__"+e]},t.icons),s=e.label.getOr("Constrain proportions"),a=t.translate(s),i=zO.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{"aria-label":a,"data-mce-name":s}},components:[r("lock"),r("unlock")],buttonBehaviours:xa([Jg.config({disabled:()=>!e.enabled||t.isDisabled()}),tC(),Ab.config({}),zb.config(t.tooltips.getConfig({tooltipText:a}))])}),l=e=>({dom:{tag:"div",classes:["tox-form__group"]},components:e}),c=o=>t_.parts.field({factory:xw,inputClasses:["tox-textfield"],inputBehaviours:xa([Jg.config({disabled:()=>!e.enabled||t.isDisabled()}),tC(),Ab.config({}),ff("size-input-events",[ea(as(),((e,t)=>{$s(e,n,{isField1:o})})),ea(ms(),((t,o)=>{$s(t,i_,{name:e.name})}))])]),selectOnFocus:!1}),d=e=>({dom:{tag:"label",classes:["tox-label"]},components:[Hl(t.translate(e))]}),m=zO.parts.field1(l([t_.parts.label(d("Width")),c(!0)])),u=zO.parts.field2(l([t_.parts.label(d("Height")),c(!1)]));return zO.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[m,u,l([d(" "),i])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:(e,t,n)=>{VO(Au.getValue(e)).each((e=>{o(e).each((e=>{Au.setValue(t,(e=>{const t={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4};let o=e.value.toFixed((n=e.unit)in t?t[n]:1);var n;return-1!==o.indexOf(".")&&(o=o.replace(/\.?0*$/,"")),o+e.unit})(e))}))}))},coupledFieldBehaviours:xa([Jg.config({disabled:()=>!e.enabled||t.isDisabled(),onDisabled:e=>{zO.getField1(e).bind(t_.getField).each(Jg.disable),zO.getField2(e).bind(t_.getField).each(Jg.disable),zO.getLock(e).each(Jg.disable)},onEnabled:e=>{zO.getField1(e).bind(t_.getField).each(Jg.enable),zO.getField2(e).bind(t_.getField).each(Jg.enable),zO.getLock(e).each(Jg.enable)}}),tC(),ff("size-input-events2",[ea(n,((e,t)=>{const n=t.event.isField1,r=n?zO.getField1(e):zO.getField2(e),s=n?zO.getField2(e):zO.getField1(e),a=r.map(Au.getValue).getOr(""),i=s.map(Au.getValue).getOr("");o=jO(a,i)}))])])})})(e,t.shared.providers))),slider:rD(((e,t,o)=>((e,t,o)=>{const n=hT.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Hl(t.translate(e.label))]}),r=hT.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),s=hT.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return hT.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:e.min,maxX:e.max,getInitialValue:w(o.getOrThunk((()=>(Math.abs(e.max)-Math.abs(e.min))/2)))},components:[n,r,s],sliderBehaviours:xa([MT(),xf.config({})]),onChoose:(t,o,n)=>{$s(t,i_,{name:e.name,value:n})},onChange:(t,o,n)=>{$s(t,i_,{name:e.name,value:n})}})})(e,t.shared.providers,o))),urlinput:rD(((e,t,o)=>((e,t,o,n)=>{const r=t.shared.providers,s=t=>{const n=Au.getValue(t);o.addToHistory(n.value,e.filetype)},a={...n.map((e=>({initialData:e}))).getOr({}),dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":tD,type:"url"},minChars:0,responseTime:0,fetch:n=>{const r=eD(e.filetype,n,o),s=MO(r,Jy.BUBBLE_TO_SANDBOX,t,{isHorizontalMenu:!1,search:A.none()});return dk(s)},getHotspot:e=>g.getOpt(e),onSetValue:(e,t)=>{e.hasConfigured(E_)&&E_.run(e).get(v)},typeaheadBehaviours:xa([...o.getValidationHandler().map((t=>E_.config({getRoot:e=>rt(e.element),invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:(e,t)=>{c.getOpt(e).each((e=>{xt(e.element,"title",r.translate(t))}))}},validator:{validate:o=>{const n=Au.getValue(o);return HA((o=>{t({type:e.filetype,url:n.value},(e=>{if("invalid"===e.status){const t=rn.error(e.message);o(t)}else{const t=rn.value(e.message);o(t)}}))}))},validateOnLoad:!1}}))).toArray(),Jg.config({disabled:()=>!e.enabled||r.isDisabled()}),Ab.config({}),ff("urlinput-events",[ea(ds(),(t=>{const o=Sl(t.element),n=o.trim();n!==o&&kl(t.element,n),"file"===e.filetype&&$s(t,i_,{name:e.name})})),ea(ms(),(t=>{$s(t,i_,{name:e.name}),s(t)})),ea(xs(),(t=>{$s(t,i_,{name:e.name}),s(t)}))])]),eventOrder:{[ds()]:["streaming","urlinput-events","invalidating"]},model:{getDisplayText:e=>e.value,selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:t.shared.getSink,parts:{menu:fw(0,0,"normal")},onExecute:(e,t,o)=>{$s(t,m_,{})},onItemExecute:(t,o,n,r)=>{s(t),$s(t,i_,{name:e.name})}},i=t_.parts.field({...a,factory:RA}),l=e.label.map((e=>a_(e,r))),c=Eb(((e,t,o=e,n=e)=>$y(o,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+e],attributes:{title:r.translate(n),"aria-live":"polite",...t.fold((()=>({})),(e=>({id:e})))}},r.icons))("invalid",A.some(tD),"warning")),d=Eb({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[c.asSpec()]}),m=o.getUrlPicker(e.filetype),u=Xi("browser.url.event"),g=Eb({dom:{tag:"div",classes:["tox-control-wrap"]},components:[i,d.asSpec()],behaviours:xa([Jg.config({disabled:()=>!e.enabled||r.isDisabled()})])}),h=Eb(VA({name:e.name,icon:A.some("browse"),text:e.picker_text.or(e.label).getOr(""),enabled:e.enabled,primary:!1,buttonType:A.none(),borderless:!0},(e=>Ws(e,u)),r,[],["tox-browse-url"]));return t_.sketch({dom:s_([]),components:l.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:$([[g.asSpec()],m.map((()=>h.asSpec())).toArray()])}]),fieldBehaviours:xa([Jg.config({disabled:()=>!e.enabled||r.isDisabled(),onDisabled:e=>{t_.getField(e).each(Jg.disable),h.getOpt(e).each(Jg.disable)},onEnabled:e=>{t_.getField(e).each(Jg.enable),h.getOpt(e).each(Jg.enable)}}),tC(),ff("url-input-events",[ea(u,(t=>{Pg.getCurrent(t).each((o=>{const n=Au.getValue(o),r={fieldname:e.name,...n};m.each((n=>{n(r).get((n=>{Au.setValue(o,n),$s(t,i_,{name:e.name})}))}))}))}))])])})})(e,t,t.urlinput,o))),customeditor:rD((e=>{const t=en(),o=Eb({dom:{tag:e.tag}}),n=en(),r=!ZT(e)&&e.onFocus.isSome()?[xf.config({onFocus:t=>{e.onFocus.each((e=>{e(t.element.dom)}))}}),Ab.config({})]:[];return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:xa([ff("custom-editor-events",[la((r=>{o.getOpt(r).each((o=>{(ZT(e)?e.init(o.element.dom):VT.load(e.scriptId,e.scriptUrl).then((t=>t(o.element.dom,e.settings)))).then((e=>{n.on((t=>{e.setValue(t)})),n.clear(),t.set(e)}))}))}))]),HT(A.none(),(()=>t.get().fold((()=>n.get().getOr("")),(e=>e.getValue()))),((e,o)=>{t.get().fold((()=>n.set(o)),(e=>e.setValue(o)))})),MT()].concat(r)),components:[o.asSpec()]}})),htmlpanel:rD(((e,t)=>((e,t)=>{const o=["tox-form__group",...e.stretched?["tox-form__group--stretched"]:[]],n=ff("htmlpanel",[la((t=>{e.onInit(t.element.dom)}))]);return"presentation"===e.presets?Xk.sketch({dom:{tag:"div",classes:o,innerHtml:e.html},containerBehaviours:xa([zb.config({...t.tooltips.getConfig({tooltipText:"",onShow:e=>{Yl(e.element,"[data-mce-tooltip]:hover").orThunk((()=>Zc(e.element))).each((o=>{kt(o,"data-mce-tooltip").each((o=>{zb.setComponents(e,t.tooltips.getComponents({tooltipText:o}))}))}))}}),mode:"children-normal",anchor:e=>({type:"node",node:Yl(e.element,"[data-mce-tooltip]:hover").orThunk((()=>Zc(e.element).filter((e=>kt(e,"data-mce-tooltip").isSome())))),root:e.element,layouts:{onLtr:w([_c,kc,wc,Cc,xc,Sc]),onRtl:w([_c,kc,wc,Cc,xc,Sc])},bubble:xd(0,-2,{})})}),n])}):Xk.sketch({dom:{tag:"div",classes:o,innerHtml:e.html,attributes:{role:"document"}},containerBehaviours:xa([Ab.config({}),xf.config({}),n])})})(e,t.shared.providers))),imagepreview:rD(((e,t,o)=>pO(e,o))),table:rD(((e,t)=>((e,t)=>{const o=e=>({dom:{tag:"th",innerHtml:t.translate(e)}}),n=e=>({dom:{tag:"td",innerHtml:t.translate(e)}}),r=e=>({dom:{tag:"tr"},components:P(e,n)});return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(a=e.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:P(a,o)}]}),(s=e.cells,{dom:{tag:"tbody"},components:P(s,r)})],behaviours:xa([Ab.config({}),xf.config({})])};var s,a})(e,t.shared.providers))),tree:rD(((e,t)=>((e,t)=>{const o=e.onLeafAction.getOr(v),n=e.onToggleExpand.getOr(v),r=e.defaultExpandedIds,s=Xo(r),a=Xo(e.defaultSelectedId),i=Xi("tree-id"),l=(n,r)=>e.items.map((e=>"leaf"===e.type?gA({leaf:e,selectedId:n,onLeafAction:o,visible:!0,treeId:i,backstage:t}):yA({directory:e,selectedId:n,onLeafAction:o,expandedIds:r,labelTabstopping:!0,treeId:i,backstage:t})));return{dom:{tag:"div",classes:["tox-tree"],attributes:{role:"tree"}},components:l(a.get(),s.get()),behaviours:xa([sf.config({mode:"flow",selector:".tox-tree--leaf__label--visible, .tox-tree--directory__label--visible",cycles:!1}),ff(wA,[ea("expand-tree-node",((e,t)=>{const{expanded:o,node:r}=t.event;s.set(o?[...s.get(),r]:s.get().filter((e=>e!==r))),n(s.get(),{expanded:o,node:r})}))]),Hc.config({channels:{[`update-active-item-${i}`]:{onReceive:(e,t)=>{a.set(A.some(t.value)),pf.set(e,l(A.some(t.value),s.get()))}}}}),pf.config({})])}})(e,t))),panel:rD(((e,t)=>((e,t)=>({dom:{tag:"div",classes:e.classes},components:P(e.items,t.shared.interpreter)}))(e,t)))},aD={field:(e,t)=>t,record:w([])},iD=(e,t,o,n,r)=>{const s=Sn(n,{shared:{interpreter:t=>lD(e,t,o,s,r)}});return lD(e,t,o,s,r)},lD=(e,t,o,n,r)=>fe(sD,t.type).fold((()=>(console.error(`Unknown factory type "${t.type}", defaulting to container: `,t),t)),(s=>s(e,t,o,n,r))),cD=(e,t,o,n)=>lD(aD,e,t,o,n),dD="layout-inset",mD=e=>e.x,uD=(e,t)=>e.x+e.width/2-t.width/2,gD=(e,t)=>e.x+e.width-t.width,hD=e=>e.y,pD=(e,t)=>e.y+e.height-t.height,fD=(e,t)=>e.y+e.height/2-t.height/2,vD=(e,t,o)=>oc(gD(e,t),pD(e,t),o.insetSouthwest(),ic(),"southwest",uc(e,{right:0,bottom:3}),dD),bD=(e,t,o)=>oc(mD(e),pD(e,t),o.insetSoutheast(),ac(),"southeast",uc(e,{left:1,bottom:3}),dD),yD=(e,t,o)=>oc(gD(e,t),hD(e),o.insetNorthwest(),sc(),"northwest",uc(e,{right:0,top:2}),dD),wD=(e,t,o)=>oc(mD(e),hD(e),o.insetNortheast(),rc(),"northeast",uc(e,{left:1,top:2}),dD),xD=(e,t,o)=>oc(uD(e,t),hD(e),o.insetNorth(),lc(),"north",uc(e,{top:2}),dD),CD=(e,t,o)=>oc(uD(e,t),pD(e,t),o.insetSouth(),cc(),"south",uc(e,{bottom:3}),dD),SD=(e,t,o)=>oc(gD(e,t),fD(e,t),o.insetEast(),mc(),"east",uc(e,{right:0}),dD),kD=(e,t,o)=>oc(mD(e),fD(e,t),o.insetWest(),dc(),"west",uc(e,{left:1}),dD),_D=e=>{switch(e){case"north":return xD;case"northeast":return wD;case"northwest":return yD;case"south":return CD;case"southeast":return bD;case"southwest":return vD;case"east":return SD;case"west":return kD}},ED=(e,t,o,n,r)=>ed(n).map(_D).getOr(xD)(e,t,o,n,r),TD=e=>{switch(e){case"north":return CD;case"northeast":return bD;case"northwest":return vD;case"south":return xD;case"southeast":return wD;case"southwest":return yD;case"east":return kD;case"west":return SD}},OD=(e,t,o,n,r)=>ed(n).map(TD).getOr(xD)(e,t,o,n,r),AD={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},DD=(e,t,o)=>{const n={maxHeightFunction:vd()};return()=>o()?{type:"node",root:gt(ut(e())),node:A.from(e()),bubble:xd(12,12,AD),layouts:{onRtl:()=>[wD],onLtr:()=>[yD]},overrides:n}:{type:"hotspot",hotspot:t(),bubble:xd(-12,12,AD),layouts:{onRtl:()=>[wc,xc,_c],onLtr:()=>[xc,wc,_c]},overrides:n}},MD=(e,t,o,n)=>{const r={maxHeightFunction:vd()};return()=>n()?{type:"node",root:gt(ut(t())),node:A.from(t()),bubble:xd(12,12,AD),layouts:{onRtl:()=>[xD],onLtr:()=>[xD]},overrides:r}:e?{type:"node",root:gt(ut(t())),node:A.from(t()),bubble:xd(0,-Zt(t()),AD),layouts:{onRtl:()=>[kc],onLtr:()=>[kc]},overrides:r}:{type:"hotspot",hotspot:o(),bubble:xd(0,0,AD),layouts:{onRtl:()=>[kc],onLtr:()=>[kc]},overrides:r}},ND=(e,t,o)=>()=>o()?{type:"node",root:gt(ut(e())),node:A.from(e()),layouts:{onRtl:()=>[xD],onLtr:()=>[xD]}}:{type:"hotspot",hotspot:t(),layouts:{onRtl:()=>[_c],onLtr:()=>[_c]}},RD=(e,t)=>()=>({type:"selection",root:t(),getSelection:()=>{const t=e.selection.getRng(),o=e.model.table.getSelectedCells();if(o.length>1){const e=o[0],t=o[o.length-1],n={firstCell:Be.fromDom(e),lastCell:Be.fromDom(t)};return A.some(n)}return A.some(Gd.range(Be.fromDom(t.startContainer),t.startOffset,Be.fromDom(t.endContainer),t.endOffset))}}),BD=e=>t=>({type:"node",root:e(),node:t}),LD=(e,t,o,n)=>{const r=ub(e),s=()=>Be.fromDom(e.getBody()),a=()=>Be.fromDom(e.getContentAreaContainer()),i=()=>r||!n();return{inlineDialog:DD(a,t,i),inlineBottomDialog:MD(e.inline,a,o,i),banner:ND(a,t,i),cursor:RD(e,s),node:BD(s)}},HD=e=>(t,o)=>{IS(e)(t,o)},ID=e=>()=>CS(e),PD=e=>t=>bS(e,t),FD=e=>t=>xS(e,t),zD=e=>()=>$v(e),VD=e=>be(e,"items"),ZD=e=>be(e,"format"),UD=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],jD=e=>U(e,((e,t)=>{if(ve(t,"items")){const o=jD(t.items);return{customFormats:e.customFormats.concat(o.customFormats),formats:e.formats.concat([{title:t.title,items:o.formats}])}}if((e=>ve(e,"inline"))(t)||(e=>ve(e,"block"))(t)||(e=>ve(e,"selector"))(t)){const o=`custom-${s(t.name)?t.name:t.title.toLowerCase()}`;return{customFormats:e.customFormats.concat([{name:o,format:t}]),formats:e.formats.concat([{title:t.title,format:o,icon:t.icon}])}}return{...e,formats:e.formats.concat(t)}}),{customFormats:[],formats:[]}),WD=e=>_v(e).map((t=>{const o=((e,t)=>{const o=jD(t),n=t=>{F(t,(t=>{e.formatter.has(t.name)||e.formatter.register(t.name,t.format)}))};return e.formatter?n(o.customFormats):e.on("init",(()=>{n(o.customFormats)})),o.formats})(e,t);return Ev(e)?UD.concat(o):o})).getOr(UD),$D=(e,t,o)=>({...e,type:"formatter",isSelected:t(e.format),getStylePreview:o(e.format)}),qD=(e,t,o,n)=>{const r=t=>P(t,(t=>VD(t)?(e=>{const t=r(e.items);return{...e,type:"submenu",getStyleItems:w(t)}})(t):ZD(t)?(e=>$D(e,o,n))(t):(e=>{const t=se(e);return 1===t.length&&B(t,"title")})(t)?{...t,type:"separator"}:(t=>{const r=s(t.name)?t.name:Xi(t.title),a=`custom-${r}`,i={...t,type:"formatter",format:a,isSelected:o(a),getStylePreview:n(a)};return e.formatter.register(r,i),i})(t)));return r(t)},GD=e=>{let t=0;const o=e=>[{dom:{tag:"div",classes:["tox-tooltip__body"]},components:[Hl(e.tooltipText)]}];return{getConfig:n=>({delayForShow:()=>t>0?60:300,delayForHide:w(300),exclusive:!0,lazySink:e,tooltipDom:{tag:"div",classes:["tox-tooltip","tox-tooltip--up"]},tooltipComponents:o(n),onShow:(e,o)=>{t++,n.onShow&&n.onShow(e,o)},onHide:(e,o)=>{t--,n.onHide&&n.onHide(e,o)},onSetup:n.onSetup}),getComponents:o}},KD=UT.trim,YD=e=>t=>{if((e=>g(e)&&1===e.nodeType)(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1},XD=YD("true"),JD=YD("false"),QD=(e,t,o,n,r)=>({type:e,title:t,url:o,level:n,attach:r}),eM=e=>e.innerText||e.textContent,tM=e=>(e=>e&&"A"===e.nodeName&&void 0!==(e.id||e.name))(e)&&nM(e),oM=e=>e&&/^(H[1-6])$/.test(e.nodeName),nM=e=>(e=>{let t=e;for(;t=t.parentNode;){const e=t.contentEditable;if(e&&"inherit"!==e)return XD(t)}return!1})(e)&&!JD(e),rM=e=>oM(e)&&nM(e),sM=e=>{var t;const o=(e=>e.id?e.id:Xi("h"))(e);return QD("header",null!==(t=eM(e))&&void 0!==t?t:"","#"+o,(e=>oM(e)?parseInt(e.nodeName.substr(1),10):0)(e),(()=>{e.id=o}))},aM=e=>{const t=e.id||e.name,o=eM(e);return QD("anchor",o||"#"+t,"#"+t,0,v)},iM=e=>{const t=(o="h1,h2,h3,h4,h5,h6,a:not([href])",n=e,P(nm(Be.fromDom(n),o),(e=>e.dom)));var o,n;return t},lM=e=>KD(e.title).length>0,cM=e=>{const t=iM(e);return V((e=>P(V(e,rM),sM))(t).concat((e=>P(V(e,tM),aM))(t)),lM)},dM="tinymce-url-history",mM=e=>s(e)&&/^https?/.test(e),uM=e=>a(e)&&he(e,(e=>{return!(l(t=e)&&t.length<=5&&G(t,mM));var t})).isNone(),gM=()=>{const e=rS.getItem(dM);if(null===e)return{};let t;try{t=JSON.parse(e)}catch(e){if(e instanceof SyntaxError)return console.log("Local storage "+dM+" was not valid JSON",e),{};throw e}return uM(t)?t:(console.log("Local storage "+dM+" was not valid format",t),{})},hM=e=>{const t=gM();return fe(t,e).getOr([])},pM=(e,t)=>{if(!mM(e))return;const o=gM(),n=fe(o,t).getOr([]),r=V(n,(t=>t!==e));o[t]=[e].concat(r).slice(0,5),(e=>{if(!uM(e))throw new Error("Bad format for history:\n"+JSON.stringify(e));rS.setItem(dM,JSON.stringify(e))})(o)},fM=e=>!!e,vM=e=>le(UT.makeMap(e,/[, ]/),fM),bM=e=>A.from(Fv(e)),yM=(e,t)=>{const o=(e=>{const t=A.from(Zv(e)).filter(fM).map(vM);return bM(e).fold(T,(e=>t.fold(O,(e=>se(e).length>0&&e))))})(e);return d(o)?o?bM(e):A.none():o[t]?bM(e):A.none()},wM=e=>A.from(e).filter(s).getOrUndefined(),xM=e=>({getHistory:hM,addToHistory:pM,getLinkInformation:()=>(e=>Uv(e)?A.some({targets:cM(e.getBody()),anchorTop:wM(jv(e)),anchorBottom:wM(Wv(e))}):A.none())(e),getValidationHandler:()=>(e=>A.from(zv(e)))(e),getUrlPicker:t=>((e,t)=>yM(e,t).map((o=>n=>ck((r=>{const i={filetype:t,fieldname:n.fieldname,...A.from(n.meta).getOr({})};o.call(e,((e,t)=>{if(!s(e))throw new Error("Expected value to be string");if(void 0!==t&&!a(t))throw new Error("Expected meta to be a object");r({value:e,meta:t})}),n.value,i)})))))(e,t)}),CM=(e,t,o,n)=>{const r=Xo(!1),s=(e=>{const t=Xo(db(e)?"bottom":"top");return{isPositionedAtTop:()=>"top"===t.get(),getDockingMode:t.get,setDockingMode:t.set}})(t),a={icons:()=>t.ui.registry.getAll().icons,menuItems:()=>t.ui.registry.getAll().menuItems,translate:Iy.translate,isDisabled:()=>t.mode.isReadOnly()||!t.ui.isEnabled(),getOption:t.options.get,tooltips:GD(e.dialog)},i=xM(t),l=(e=>{const t=t=>()=>e.formatter.match(t),o=t=>()=>{const o=e.formatter.get(t);return void 0!==o?A.some({tag:o.length>0&&(o[0].inline||o[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):A.none()},n=Xo([]),r=Xo([]),s=Xo(!1);return e.on("PreInit",(r=>{const s=WD(e),a=qD(e,s,t,o);n.set(a)})),e.on("addStyleModifications",(n=>{const a=qD(e,n.items,t,o);r.set(a),s.set(n.replace)})),{getData:()=>{const e=s.get()?[]:n.get(),t=r.get();return e.concat(t)}}})(t),c=(e=>({colorPicker:HD(e),hasCustomColors:ID(e),getColors:PD(e),getColorCols:FD(e)}))(t),d=(e=>({isDraggableModal:zD(e)}))(t),m={shared:{providers:a,anchors:LD(t,o,n,s.isPositionedAtTop),header:s},urlinput:i,styles:l,colorinput:c,dialog:d,isContextMenuOpen:()=>r.get(),setContextMenuState:e=>r.set(e)},u=e=>A.none(),g={...m,shared:{...m.shared,interpreter:e=>cD(e,{},g,u),getSink:e.popup}},h={...m,shared:{...m.shared,interpreter:e=>cD(e,{},h,u),getSink:e.dialog}};return{popup:g,dialog:h}},SM=Tg,kM=dg,_M=w([Ar("shell",!1),ur("makeItem"),Ar("setupItem",v),Ru("listBehaviours",[pf])]),EM=ig({name:"items",overrides:()=>({behaviours:xa([pf.config({})])})}),TM=w([EM]),OM=Bg({name:w("CustomList")(),configFields:_M(),partFields:TM(),factory:(e,t,o,n)=>{const r=e.shell?{behaviours:[pf.config({})],components:[]}:{behaviours:[],components:t},s=t=>e.shell?A.some(t):yg(t,e,"items");return{uid:e.uid,dom:e.dom,components:r.components,behaviours:Nu(e.listBehaviours,r.behaviours),apis:{setItems:(t,o)=>{s(t).fold((()=>{throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")}),(n=>{const r=pf.contents(n),s=o.length,a=s-r.length,i=a>0?H(a,(()=>e.makeItem())):[],l=r.slice(s);F(l,(e=>pf.remove(n,e))),F(i,(e=>pf.append(n,e)));const c=pf.contents(n);F(c,((n,r)=>{e.setupItem(t,n,o[r],r)}))}))}}}},apis:{setItems:(e,t,o)=>{e.setItems(t,o)}}}),AM=w([ur("dom"),Ar("shell",!0),Du("toolbarBehaviours",[pf])]),DM=w([ig({name:"groups",overrides:()=>({behaviours:xa([pf.config({})])})})]),MM=Bg({name:"Toolbar",configFields:AM(),partFields:DM(),factory:(e,t,o,n)=>{const r=t=>e.shell?A.some(t):yg(t,e,"groups"),s=e.shell?{behaviours:[pf.config({})],components:[]}:{behaviours:[],components:t};return{uid:e.uid,dom:e.dom,components:s.components,behaviours:Nu(e.toolbarBehaviours,s.behaviours),apis:{setGroups:(e,t)=>{r(e).fold((()=>{throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")}),(e=>{pf.set(e,t)}))},refresh:v},domModification:{attributes:{role:"group"}}}},apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)}}}),NM=v,RM=T,BM=w([]);var LM=Object.freeze({__proto__:null,setup:NM,isDocked:RM,getBehaviours:BM});const HM=w(Xi("toolbar-height-change")),IM={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},PM="tox-tinymce--toolbar-sticky-on",FM="tox-tinymce--toolbar-sticky-off",zM=(e,t)=>B(Wi.getModes(e),t),VM=e=>{const t=e.element;rt(t).each((o=>{const n="padding-"+Wi.getModes(e)[0];if(Wi.isDocked(e)){const e=Kt(o);At(t,"width",e+"px"),At(o,n,(e=>Zt(e)+(parseInt(Nt(e,"margin-top"),10)||0)+(parseInt(Nt(e,"margin-bottom"),10)||0))(t)+"px")}else It(t,"width"),It(o,n)}))},ZM=(e,t)=>{t?(Ba(e,IM.fadeOutClass),Ia(e,[IM.transitionClass,IM.fadeInClass])):(Ba(e,IM.fadeInClass),Ia(e,[IM.fadeOutClass,IM.transitionClass]))},UM=(e,t)=>{const o=Be.fromDom(e.getContainer());t?(Na(o,PM),Ba(o,FM)):(Na(o,FM),Ba(o,PM))},jM=(e,t)=>{const o=en(),n=t.getSink,r=e=>{n().each((t=>e(t.element)))},s=t=>{e.inline||VM(t),UM(e,Wi.isDocked(t)),t.getSystem().broadcastOn([mu()],{}),n().each((e=>e.getSystem().broadcastOn([mu()],{})))},a=e.inline?[]:[Hc.config({channels:{[HM()]:{onReceive:VM}}})];return[xf.config({}),Wi.config({contextual:{lazyContext:t=>{const o=Zt(t.element),n=e.inline?e.getContentAreaContainer():e.getContainer();return A.from(n).map((n=>{const r=qo(Be.fromDom(n));return Cb(e,t.element).fold((()=>{const e=r.height-o,n=r.y+(zM(t,"top")?0:o);return $o(r.x,n,r.width,e)}),(e=>{const n=Ko(r,Sb(e)),s=zM(t,"top")?n.y:n.y+o;return $o(n.x,s,n.width,n.height-o)}))}))},onShow:()=>{r((e=>ZM(e,!0)))},onShown:e=>{r((e=>Pa(e,[IM.transitionClass,IM.fadeInClass]))),o.get().each((t=>{((e,t)=>{const o=Qe(t);Vc(o).filter((e=>!Xe(t,e))).filter((t=>Xe(t,Be.fromDom(o.dom.body))||Je(e,t))).each((()=>Pc(t)))})(e.element,t),o.clear()}))},onHide:e=>{((e,t)=>Zc(e).orThunk((()=>t().toOptional().bind((e=>Zc(e.element))))))(e.element,n).fold(o.clear,o.set),r((e=>ZM(e,!1)))},onHidden:()=>{r((e=>Pa(e,[IM.transitionClass])))},...IM},lazyViewport:t=>Cb(e,t.element).fold((()=>{const o=Yo(),n=Hv(e),r=o.y+(zM(t,"top")?n:0),s=o.height-(zM(t,"bottom")?n:0);return{bounds:$o(o.x,r,o.width,s),optScrollEnv:A.none()}}),(e=>({bounds:Sb(e),optScrollEnv:A.some({currentScrollTop:e.element.dom.scrollTop,scrollElmTop:$t(e.element).top})}))),modes:[t.header.getDockingMode()],onDocked:s,onUndocked:s}),...a]};var WM=Object.freeze({__proto__:null,setup:(e,t,o)=>{e.inline||(t.header.isPositionedAtTop()||e.on("ResizeEditor",(()=>{o().each(Wi.reset)})),e.on("ResizeWindow ResizeEditor",(()=>{o().each(VM)})),e.on("SkinLoaded",(()=>{o().each((e=>{Wi.isDocked(e)?Wi.reset(e):Wi.refresh(e)}))})),e.on("FullscreenStateChanged",(()=>{o().each(Wi.reset)}))),e.on("AfterScrollIntoView",(e=>{o().each((t=>{Wi.refresh(t);const o=t.element;Jh(o)&&((e,t)=>{const o=Qe(t),n=ot(t).dom.innerHeight,r=Po(o),s=Be.fromDom(e.elm),a=Go(s),i=Vt(s),l=a.y,c=l+i,d=$t(t),m=Vt(t),u=d.top,g=u+m,h=Math.abs(u-r.top)<2,p=Math.abs(g-(r.top+n))<2;if(h&&lu){const e=l-n+i+m;Fo(r.left,e,o)}})(e,o)}))})),e.on("PostRender",(()=>{UM(e,!1)}))},isDocked:e=>e().map(Wi.isDocked).getOr(!1),getBehaviours:jM});const $M=zn([Fw,gr("items",Zn([jn([zw,wr("items",Gn)]),Gn]))].concat(fx)),qM=[kr("text"),kr("tooltip"),kr("icon"),Dr("search",!1,Zn([Kn,zn([kr("placeholder")])],(e=>d(e)?e?A.some({placeholder:A.none()}):A.none():A.some(e)))),vr("fetch"),Lr("onSetup",(()=>v))],GM=zn([Fw,...qM]),KM=e=>nr("menubutton",GM,e),YM=zn([Fw,tx,ex,Jw,rx,$w,Yw,Rr("presets","normal",["normal","color","listpreview"]),cx(1),Gw,Kw]);var XM=Rg({factory:(e,t)=>{const o={focus:sf.focusIn,setMenus:(e,o)=>{const n=P(o,(e=>{const o={type:"menubutton",text:e.text,fetch:t=>{t(e.getItems())}},n=KM(o).mapError((e=>ar(e))).getOrDie();return cA(n,"tox-mbtn",t.backstage,A.some("menuitem"))}));pf.set(e,n)}};return{uid:e.uid,dom:e.dom,components:[],behaviours:xa([pf.config({}),ff("menubar-events",[la((t=>{e.onSetup(t)})),ea(ss(),((e,t)=>{Yl(e.element,".tox-mbtn--active").each((o=>{Xl(t.event.target,".tox-mbtn").each((t=>{Xe(o,t)||e.getSystem().getByDom(o).each((o=>{e.getSystem().getByDom(t).each((e=>{_k.expand(e),_k.close(o),xf.focus(e)}))}))}))}))})),ea(Ps(),((e,t)=>{t.event.prevFocus.bind((t=>e.getSystem().getByDom(t).toOptional())).each((o=>{t.event.newFocus.bind((t=>e.getSystem().getByDom(t).toOptional())).each((e=>{_k.isOpen(o)&&(_k.expand(e),_k.close(o))}))}))}))]),sf.config({mode:"flow",selector:".tox-mbtn",onEscape:t=>(e.onEscape(t),A.some(!0))}),Ab.config({})]),apis:o,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[ur("dom"),ur("uid"),ur("onEscape"),ur("backstage"),Ar("onSetup",v)],apis:{focus:(e,t)=>{e.focus(t)},setMenus:(e,t,o)=>{e.setMenus(t,o)}}});const JM="container",QM=[Du("slotBehaviours",[])],eN=e=>"",tN=(e,t)=>{const o=t=>Sg(e),n=(t,o)=>(n,r)=>yg(n,e,r).map((e=>t(e,r))).getOr(o),r=(e,t)=>"true"!==St(e.element,"aria-hidden"),s=n(r,!1),a=n(((e,t)=>{if(r(e)){const o=e.element;At(o,"display","none"),xt(o,"aria-hidden","true"),$s(e,Fs(),{name:t,visible:!1})}})),i=(e=>(t,o)=>{F(o,(o=>e(t,o)))})(a),l=n(((e,t)=>{if(!r(e)){const o=e.element;It(o,"display"),Et(o,"aria-hidden"),$s(e,Fs(),{name:t,visible:!0})}})),c={getSlotNames:o,getSlot:(t,o)=>yg(t,e,o),isShowing:s,hideSlot:a,hideAllSlots:e=>i(e,o()),showSlot:l};return{uid:e.uid,dom:e.dom,components:t,behaviours:Mu(e.slotBehaviours),apis:c}},oN=le({getSlotNames:(e,t)=>e.getSlotNames(t),getSlot:(e,t,o)=>e.getSlot(t,o),isShowing:(e,t,o)=>e.isShowing(t,o),hideSlot:(e,t,o)=>e.hideSlot(t,o),hideAllSlots:(e,t)=>e.hideAllSlots(t),showSlot:(e,t,o)=>e.showSlot(t,o)},(e=>ml(e))),nN={...oN,sketch:e=>{const t=(()=>{const e=[];return{slot:(t,o)=>(e.push(t),hg(JM,eN(t),o)),record:w(e)}})(),o=e(t),n=t.record(),r=P(n,(e=>sg({name:e,pname:eN(e)})));return Ag(JM,QM,r,tN,o)}},rN=zn([ex,tx,Lr("onShow",v),Lr("onHide",v),Yw]),sN=e=>({element:()=>e.element.dom}),aN=(e,t)=>{const o=P(se(t),(e=>{const o=t[e],n=rr((e=>nr("sidebar",rN,e))(o));return{name:e,getApi:sN,onSetup:n.onSetup,onShow:n.onShow,onHide:n.onHide}}));return P(o,(t=>{const n=Xo(v);return e.slot(t.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Kx([iC(t,n),lC(t,n),ea(Fs(),((e,t)=>{const n=t.event,r=j(o,(e=>e.name===n.name));r.each((t=>{(n.visible?t.onShow:t.onHide)(t.getApi(e))}))}))])})}))},iN=e=>nN.sketch((t=>({dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:aN(t,e),slotBehaviours:Kx([la((e=>nN.hideAllSlots(e)))])}))),lN=(e,t)=>{xt(e,"role",t)},cN=e=>Pg.getCurrent(e).bind((e=>{if(iA.isGrowing(e)||iA.hasGrown(e)){return Pg.getCurrent(e).bind((e=>j(nN.getSlotNames(e),(t=>nN.isShowing(e,t)))))}return A.none()})),dN=Xi("FixSizeEvent"),mN=Xi("AutoSizeEvent");var uN=Object.freeze({__proto__:null,block:(e,t,o,n)=>{xt(e.element,"aria-busy",!0);const r=t.getRoot(e).getOr(e),s=xa([sf.config({mode:"special",onTab:()=>A.some(!0),onShiftTab:()=>A.some(!0)}),xf.config({})]),a=n(r,s),i=r.getSystem().build(a);pf.append(r,Vl(i)),i.hasConfigured(sf)&&t.focus&&sf.focusIn(i),o.isBlocked()||t.onBlock(e),o.blockWith((()=>pf.remove(r,i)))},unblock:(e,t,o)=>{Et(e.element,"aria-busy"),o.isBlocked()&&t.onUnblock(e),o.clear()},isBlocked:(e,t,o)=>o.isBlocked()}),gN=[Lr("getRoot",A.none),Br("focus",!0),Ii("onBlock"),Ii("onUnblock")];const hN=Sa({fields:gN,name:"blocking",apis:uN,state:Object.freeze({__proto__:null,init:()=>{const e=Jo((e=>e.destroy()));return wa({readState:e.isSet,blockWith:t=>{e.set({destroy:t})},clear:e.clear,isBlocked:e.isSet})}})}),pN=e=>Pg.getCurrent(e).each((e=>Pc(e.element,!0))),fN=(e,t,o,n)=>{const r=t.element;if(((e,t)=>{const o="tabindex",n=`data-mce-${o}`;A.from(e.iframeElement).map(Be.fromDom).each((e=>{t?(kt(e,o).each((t=>xt(e,n,t))),xt(e,o,-1)):(Et(e,o),kt(e,n).each((t=>{xt(e,o,t),Et(e,n)})))}))})(e,o),o)hN.block(t,(e=>(t,o)=>({dom:{tag:"div",attributes:{"aria-label":e.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:_b('
    ')}]}))(n)),It(r,"display"),Et(r,"aria-hidden"),e.hasFocus()&&pN(t);else{const o=Pg.getCurrent(t).exists((e=>zc(e.element)));hN.unblock(t),At(r,"display","none"),xt(r,"aria-hidden","true"),o&&e.focus()}},vN=(e,t,o)=>{const n=Xo(!1),r=en(),s=o=>{n.get()&&!(e=>{if((e=>"focusin"===e.type)(e))return(e.composed?te(e.composedPath()):A.from(e.target)).map(Be.fromDom).filter(Ue).exists((e=>Ha(e,"mce-pastebin")));return!1})(o)&&(o.preventDefault(),pN(t()),e.editorManager.setActive(e))};e.inline||e.on("PreInit",(()=>{e.dom.bind(e.getWin(),"focusin",s),e.on("BeforeExecCommand",(e=>{"mcefocus"===e.command.toLowerCase()&&!0!==e.value&&s(e)}))}));const a=r=>{r!==n.get()&&(n.set(r),fN(e,t(),r,o.providers),((e,t)=>{e.dispatch("AfterProgressState",{state:t})})(e,r))};e.on("ProgressState",(t=>{if(r.on(clearTimeout),p(t.time)){const o=mv.setEditorTimeout(e,(()=>a(t.state)),t.time);r.set(o)}else a(t.state),r.clear()}))},bN=(e,t,o)=>({within:e,extra:t,withinWidth:o}),yN=(e,t,o)=>{const n=((e,t)=>{const o=U(e,((e,o)=>t(o,e.len).fold(w(e),(t=>({len:t.finish,list:e.list.concat([t])})))),{len:0,list:[]});return o.list})(e,((e,t)=>{const n=o(e);return A.some({element:e,start:t,finish:t+n,width:n})})),r=V(n,(e=>e.finish<=t)),s=Z(r,((e,t)=>e+t.width),0);return{within:r,extra:n.slice(r.length),withinWidth:s}},wN=e=>P(e,(e=>e.element)),xN=(e,t,o,n)=>{const r=((e,t,o)=>{const n=yN(t,e,o);return 0===n.extra.length?A.some(n):A.none()})(e,t,o).getOrThunk((()=>yN(t,e-o(n),o))),s=r.within,a=r.extra,i=r.withinWidth;return 1===a.length&&a[0].width<=o(n)?((e,t,o)=>{const n=wN(e.concat(t));return bN(n,[],o)})(s,a,i):a.length>=1?((e,t,o,n)=>{const r=wN(e).concat([o]);return bN(r,wN(t),n)})(s,a,n,i):((e,t,o)=>bN(wN(e),[],o))(s,0,i)},CN=(e,t)=>{const o=P(t,(e=>Vl(e)));MM.setGroups(e,o)},SN=(e,t,o)=>{const n=t.builtGroups.get();if(0===n.length)return;const r=wg(e,t,"primary"),s=rk.getCoupled(e,"overflowGroup");At(r.element,"visibility","hidden");const a=n.concat([s]),i=re(a,(e=>Zc(e.element).bind((t=>e.getSystem().getByDom(t).toOptional()))));o([]),CN(r,a);const l=Kt(r.element),c=xN(l,t.builtGroups.get(),(e=>Math.ceil(e.element.dom.getBoundingClientRect().width)),s);0===c.extra.length?(pf.remove(r,s),o([])):(CN(r,c.within),o(c.extra)),It(r.element,"visibility"),Pt(r.element),i.each(xf.focus)},kN=w([Du("splitToolbarBehaviours",[rk]),dr("builtGroups",(()=>Xo([])))]),_N=w([Li(["overflowToggledClass"]),Er("getOverflowBounds"),ur("lazySink"),dr("overflowGroups",(()=>Xo([]))),Ii("onOpened"),Ii("onClosed")].concat(kN())),EN=w([sg({factory:MM,schema:AM(),name:"primary"}),ag({schema:AM(),name:"overflow"}),ag({name:"overflow-button"}),ag({name:"overflow-group"})]),TN=w(((e,t)=>{((e,t)=>{const o=Gt.max(e,t,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);At(e,"max-width",o+"px")})(e,Math.floor(t))})),ON=w([Li(["toggledClass"]),ur("lazySink"),vr("fetch"),Er("getBounds"),Or("fireDismissalEventInstead",[Ar("event",Hs())]),Ad(),Ii("onToggled")]),AN=w([ag({name:"button",overrides:e=>({dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:xa([Af.config({toggleClass:e.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1,onToggled:e.onToggled})])})}),ag({factory:MM,schema:AM(),name:"toolbar",overrides:e=>({toolbarBehaviours:xa([sf.config({mode:"cyclic",onEscape:t=>(yg(t,e,"button").each(xf.focus),A.none())})])})})]),DN=en(),MN=(e,t)=>{const o=rk.getCoupled(e,"toolbarSandbox");cu.isOpen(o)?cu.close(o):cu.open(o,t.toolbar())},NN=(e,t,o,n)=>{const r=o.getBounds.map((e=>e())),s=o.lazySink(e).getOrDie();Hm.positionWithinBounds(s,t,{anchor:{type:"hotspot",hotspot:e,layouts:n,overrides:{maxWidthFunction:TN()}}},r)},RN=(e,t,o,n,r)=>{MM.setGroups(t,r),NN(e,t,o,n),Af.on(e)},BN=Bg({name:"FloatingToolbarButton",factory:(e,t,o,n)=>({...kb.sketch({...n.button(),action:e=>{MN(e,n)},buttonBehaviours:Bu({dump:n.button().buttonBehaviours},[rk.config({others:{toolbarSandbox:t=>((e,t,o)=>{const n=Ql();return{dom:{tag:"div",attributes:{id:n.id}},behaviours:xa([sf.config({mode:"special",onEscape:e=>(cu.close(e),A.some(!0))}),cu.config({onOpen:(r,s)=>{const a=DN.get().getOr(!1);o.fetch().get((r=>{RN(e,s,o,t.layouts,r),n.link(e.element),a||sf.focusIn(s)}))},onClose:()=>{Af.off(e),DN.get().getOr(!1)||xf.focus(e),n.unlink(e.element)},isPartOf:(t,o,n)=>tc(o,n)||tc(e,n),getAttachPoint:()=>o.lazySink(e).getOrDie()}),Hc.config({channels:{...hu({isExtraPart:T,...o.fireDismissalEventInstead.map((e=>({fireEventInstead:{event:e.event}}))).getOr({})}),...fu({doReposition:()=>{cu.getState(rk.getCoupled(e,"toolbarSandbox")).each((n=>{NN(e,n,o,t.layouts)}))}})}})])}})(t,o,e)}})])}),apis:{setGroups:(t,n)=>{cu.getState(rk.getCoupled(t,"toolbarSandbox")).each((r=>{RN(t,r,e,o.layouts,n)}))},reposition:t=>{cu.getState(rk.getCoupled(t,"toolbarSandbox")).each((n=>{NN(t,n,e,o.layouts)}))},toggle:e=>{MN(e,n)},toggleWithoutFocusing:e=>{((e,t)=>{DN.set(!0),MN(e,t),DN.clear()})(e,n)},getToolbar:e=>cu.getState(rk.getCoupled(e,"toolbarSandbox")),isOpen:e=>cu.isOpen(rk.getCoupled(e,"toolbarSandbox"))}}),configFields:ON(),partFields:AN(),apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)},reposition:(e,t)=>{e.reposition(t)},toggle:(e,t)=>{e.toggle(t)},toggleWithoutFocusing:(e,t)=>{e.toggleWithoutFocusing(t)},getToolbar:(e,t)=>e.getToolbar(t),isOpen:(e,t)=>e.isOpen(t)}}),LN=w([ur("items"),Li(["itemSelector"]),Du("tgroupBehaviours",[sf])]),HN=w([lg({name:"items",unit:"item"})]),IN=Bg({name:"ToolbarGroup",configFields:LN(),partFields:HN(),factory:(e,t,o,n)=>({uid:e.uid,dom:e.dom,components:t,behaviours:Nu(e.tgroupBehaviours,[sf.config({mode:"flow",selector:e.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}})}),PN=e=>P(e,(e=>Vl(e))),FN=(e,t,o)=>{SN(e,o,(n=>{o.overflowGroups.set(n),t.getOpt(e).each((e=>{BN.setGroups(e,PN(n))}))}))},zN=Bg({name:"SplitFloatingToolbar",configFields:_N(),partFields:EN(),factory:(e,t,o,n)=>{const r=Eb(BN.sketch({fetch:()=>ck((t=>{t(PN(e.overflowGroups.get()))})),layouts:{onLtr:()=>[xc,wc],onRtl:()=>[wc,xc],onBottomLtr:()=>[Sc,Cc],onBottomRtl:()=>[Cc,Sc]},getBounds:o.getOverflowBounds,lazySink:e.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:e.markers.overflowToggledClass},parts:{button:n["overflow-button"](),toolbar:n.overflow()},onToggled:(t,o)=>e[o?"onOpened":"onClosed"](t)}));return{uid:e.uid,dom:e.dom,components:t,behaviours:Nu(e.splitToolbarBehaviours,[rk.config({others:{overflowGroup:()=>IN.sketch({...n["overflow-group"](),items:[r.asSpec()]})}})]),apis:{setGroups:(t,o)=>{e.builtGroups.set(P(o,t.getSystem().build)),FN(t,r,e)},refresh:t=>FN(t,r,e),toggle:e=>{r.getOpt(e).each((e=>{BN.toggle(e)}))},toggleWithoutFocusing:e=>{r.getOpt(e).each(BN.toggleWithoutFocusing)},isOpen:e=>r.getOpt(e).map(BN.isOpen).getOr(!1),reposition:e=>{r.getOpt(e).each((e=>{BN.reposition(e)}))},getOverflow:e=>r.getOpt(e).bind(BN.getToolbar)},domModification:{attributes:{role:"group"}}}},apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)},refresh:(e,t)=>{e.refresh(t)},reposition:(e,t)=>{e.reposition(t)},toggle:(e,t)=>{e.toggle(t)},toggleWithoutFocusing:(e,t)=>{e.toggle(t)},isOpen:(e,t)=>e.isOpen(t),getOverflow:(e,t)=>e.getOverflow(t)}}),VN=w([Li(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Ii("onOpened"),Ii("onClosed")].concat(kN())),ZN=w([sg({factory:MM,schema:AM(),name:"primary"}),sg({factory:MM,schema:AM(),name:"overflow",overrides:e=>({toolbarBehaviours:xa([iA.config({dimension:{property:"height"},closedClass:e.markers.closedClass,openClass:e.markers.openClass,shrinkingClass:e.markers.shrinkingClass,growingClass:e.markers.growingClass,onShrunk:t=>{yg(t,e,"overflow-button").each((e=>{Af.off(e)})),e.onClosed(t)},onGrown:t=>{e.onOpened(t)},onStartGrow:t=>{yg(t,e,"overflow-button").each(Af.on)}}),sf.config({mode:"acyclic",onEscape:t=>(yg(t,e,"overflow-button").each(xf.focus),A.some(!0))})])})}),ag({name:"overflow-button",overrides:e=>({buttonBehaviours:xa([Af.config({toggleClass:e.markers.overflowToggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])})}),ag({name:"overflow-group"})]),UN=(e,t,o)=>{yg(e,t,"overflow-button").each((n=>{yg(e,t,"overflow").each((r=>{if(jN(e,t),iA.hasShrunk(r)){const e=t.onOpened;t.onOpened=n=>{o||sf.focusIn(r),e(n),t.onOpened=e}}else{const e=t.onClosed;t.onClosed=r=>{o||xf.focus(n),e(r),t.onClosed=e}}iA.toggleGrow(r)}))}))},jN=(e,t)=>{yg(e,t,"overflow").each((o=>{SN(e,t,(e=>{const t=P(e,(e=>Vl(e)));MM.setGroups(o,t)})),yg(e,t,"overflow-button").each((e=>{iA.hasGrown(o)&&Af.on(e)})),iA.refresh(o)}))},WN=Bg({name:"SplitSlidingToolbar",configFields:VN(),partFields:ZN(),factory:(e,t,o,n)=>{const r="alloy.toolbar.toggle";return{uid:e.uid,dom:e.dom,components:t,behaviours:Nu(e.splitToolbarBehaviours,[rk.config({others:{overflowGroup:e=>IN.sketch({...n["overflow-group"](),items:[kb.sketch({...n["overflow-button"](),action:t=>{Ws(e,r)}})]})}}),ff("toolbar-toggle-events",[ea(r,(t=>{UN(t,e,!1)}))])]),apis:{setGroups:(t,o)=>{((t,o)=>{const n=P(o,t.getSystem().build);e.builtGroups.set(n)})(t,o),jN(t,e)},refresh:t=>jN(t,e),toggle:t=>{UN(t,e,!1)},toggleWithoutFocusing:t=>{UN(t,e,!0)},isOpen:t=>((e,t)=>yg(e,t,"overflow").map(iA.hasGrown).getOr(!1))(t,e)},domModification:{attributes:{role:"group"}}}},apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)},refresh:(e,t)=>{e.refresh(t)},toggle:(e,t)=>{e.toggle(t)},isOpen:(e,t)=>e.isOpen(t)}}),$N=e=>{const t=e.title.fold((()=>({})),(e=>({attributes:{title:e}})));return{dom:{tag:"div",classes:["tox-toolbar__group"],...t},components:[IN.parts.items({})],items:e.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled]), .tox-number-input:not([disabled])"},tgroupBehaviours:xa([Ab.config({}),xf.config({})])}},qN=e=>IN.sketch($N(e)),GN=(e,t)=>{const o=la((t=>{const o=P(e.initGroups,qN);MM.setGroups(t,o)}));return xa([sC(e.providers.isDisabled),tC(),sf.config({mode:t,onEscape:e.onEscape,selector:".tox-toolbar__group"}),ff("toolbar-events",[o])])},KN=e=>{const t=e.cyclicKeying?"cyclic":"acyclic";return{uid:e.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":$N({title:A.none(),items:[]}),"overflow-button":PA({name:"more",icon:A.some("more-drawer"),enabled:!0,tooltip:A.some("Reveal or hide additional toolbar items"),primary:!1,buttonType:A.none(),borderless:!1},A.none(),e.providers,[],"overflow-button")},splitToolbarBehaviours:GN(e,t)}},YN=e=>{const t=KN(e),o=zN.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return zN.sketch({...t,lazySink:e.getSink,getOverflowBounds:()=>{const t=e.moreDrawerData.lazyHeader().element,o=Go(t),n=tt(t),r=Go(n),s=Math.max(n.dom.scrollHeight,r.height);return $o(o.x+4,r.y,o.width-8,s)},parts:{...t.parts,overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:e.attributes}}},components:[o],markers:{overflowToggledClass:"tox-tbtn--enabled"},onOpened:t=>e.onToggled(t,!0),onClosed:t=>e.onToggled(t,!1)})},XN=e=>{const t=WN.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),o=WN.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),n=KN(e);return WN.sketch({...n,components:[t,o],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:t=>{t.getSystem().broadcastOn([HM()],{type:"opened"}),e.onToggled(t,!0)},onClosed:t=>{t.getSystem().broadcastOn([HM()],{type:"closed"}),e.onToggled(t,!1)}})},JN=e=>{const t=e.cyclicKeying?"cyclic":"acyclic";return MM.sketch({uid:e.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(e.type===cv.scrolling?["tox-toolbar--scrolling"]:[])},components:[MM.parts.groups({})],toolbarBehaviours:GN(e,t)})},QN=[Jw,ex,kr("tooltip"),Rr("buttonType","secondary",["primary","secondary"]),Br("borderless",!1),vr("onAction")],eR={button:[...QN,Zw,fr("type",["button"])],togglebutton:[...QN,Br("active",!1),fr("type",["togglebutton"])]},tR=[fr("type",["group"]),Hr("buttons",[],ir("type",eR))],oR=ir("type",{...eR,group:tR}),nR=zn([Hr("buttons",[],oR),vr("onShow"),vr("onHide")]),rR=(e,t)=>((e,t)=>{var o,n;const r="togglebutton"===e.type,s=e.icon.map((e=>CO(e,t.icons))).map(Eb),a=o=>{const n=e=>{s.map((n=>n.getOpt(o).each((o=>{pf.set(o,[CO(e,t.icons)])}))))},a=e=>{const t=o.element;e?(Na(t,"tox-button--enabled"),xt(t,"aria-pressed",!0)):(Ba(t,"tox-button--enabled"),Et(t,"aria-pressed"))},i=()=>Ha(o.element,"tox-button--enabled");return r?e.onAction({setIcon:n,setActive:a,isActive:i}):"button"===e.type?e.onAction({setIcon:n}):void 0},i={...e,name:r?e.text.getOr(e.icon.getOr("")):null!==(o=e.text)&&void 0!==o?o:e.icon.getOr(""),primary:"primary"===e.buttonType,buttonType:A.from(e.buttonType),tooltip:e.tooltip,icon:e.icon,enabled:!0,borderless:e.borderless},l=FA(null!==(n=e.buttonType)&&void 0!==n?n:"secondary"),c=r?e.text.map(t.translate):A.some(t.translate(e.text)),d=c.map(Hl),m=i.tooltip.or(c).map((e=>({"aria-label":t.translate(e)}))).getOr({}),u=s.map((e=>e.asSpec())),g=mC([u,d]),h=e.icon.isSome()&&d.isSome(),p={tag:"button",classes:l.concat(...e.icon.isSome()&&!h?["tox-button--icon"]:[]).concat(...h?["tox-button--icon-and-text"]:[]).concat(...e.borderless?["tox-button--naked"]:[]).concat(..."togglebutton"===e.type&&e.active?["tox-button--enabled"]:[]),attributes:m},f=IA(i,A.some(a),[],p,g,e.tooltip,t);return kb.sketch(f)})(e,t),sR=To().deviceType,aR=sR.isPhone(),iR=sR.isTablet();var lR=Bg({name:"silver.View",configFields:[ur("viewConfig")],partFields:[ig({factory:{sketch:e=>{let t=!1;const o=P(e.buttons,(o=>"group"===o.type?(t=!0,((e,t)=>({dom:{tag:"div",classes:["tox-view__toolbar__group"]},components:P(e.buttons,(e=>rR(e,t)))}))(o,e.providers)):rR(o,e.providers)));return{uid:e.uid,dom:{tag:"div",classes:[t?"tox-view__toolbar":"tox-view__header",...aR||iR?["tox-view--mobile","tox-view--scrolling"]:[]]},behaviours:xa([xf.config({}),sf.config({mode:"flow",selector:"button, .tox-button",focusInside:Nh.OnEnterOrSpaceMode})]),components:t?o:[Xk.sketch({dom:{tag:"div",classes:["tox-view__header-start"]},components:[]}),Xk.sketch({dom:{tag:"div",classes:["tox-view__header-end"]},components:o})]}}},schema:[ur("buttons"),ur("providers")],name:"header"}),ig({factory:{sketch:e=>({uid:e.uid,behaviours:xa([xf.config({}),Ab.config({})]),dom:{tag:"div",classes:["tox-view__pane"]}})},schema:[],name:"pane"})],factory:(e,t,o,n)=>{const r={getPane:t=>SM.getPart(t,e,"pane"),getOnShow:t=>e.viewConfig.onShow,getOnHide:t=>e.viewConfig.onHide};return{uid:e.uid,dom:e.dom,components:t,behaviours:xa([xf.config({}),sf.config({mode:"cyclic",focusInside:Nh.OnEnterOrSpaceMode})]),apis:r}},apis:{getPane:(e,t)=>e.getPane(t),getOnShow:(e,t)=>e.getOnShow(t),getOnHide:(e,t)=>e.getOnHide(t)}});const cR=(e,t,o)=>ge(t,((t,n)=>{const r=rr(nr("view",nR,t));return e.slot(n,lR.sketch({dom:{tag:"div",classes:["tox-view"]},viewConfig:r,components:[...r.buttons.length>0?[lR.parts.header({buttons:r.buttons,providers:o})]:[],lR.parts.pane({})]}))})),dR=(e,t)=>nN.sketch((o=>({dom:{tag:"div",classes:["tox-view-wrap__slot-container"]},components:cR(o,e,t),slotBehaviours:Kx([la((e=>nN.hideAllSlots(e)))])}))),mR=e=>j(nN.getSlotNames(e),(t=>nN.isShowing(e,t))),uR=(e,t,o)=>{nN.getSlot(e,t).each((e=>{lR.getPane(e).each((t=>{var n;o(e)((n=t.element.dom,{getContainer:w(n)}))}))}))};var gR=Rg({factory:(e,t)=>{const o={setViews:(e,o)=>{pf.set(e,[dR(o,t.backstage.shared.providers)])},whichView:e=>Pg.getCurrent(e).bind(mR),toggleView:(e,t,o,n)=>Pg.getCurrent(e).exists((r=>{const s=mR(r),a=s.exists((e=>n===e)),i=nN.getSlot(r,n).isSome();return i&&(nN.hideAllSlots(r),a?((e=>{const t=e.element;At(t,"display","none"),xt(t,"aria-hidden","true")})(e),t()):(o(),(e=>{const t=e.element;It(t,"display"),Et(t,"aria-hidden")})(e),nN.showSlot(r,n),((e,t)=>{uR(e,t,lR.getOnShow)})(r,n)),s.each((e=>((e,t)=>uR(e,t,lR.getOnHide))(r,e)))),i}))};return{uid:e.uid,dom:{tag:"div",classes:["tox-view-wrap"],attributes:{"aria-hidden":"true"},styles:{display:"none"}},components:[],behaviours:xa([pf.config({}),Pg.config({find:e=>{const t=pf.contents(e);return te(t)}})]),apis:o}},name:"silver.ViewWrapper",configFields:[ur("backstage")],apis:{setViews:(e,t,o)=>e.setViews(t,o),toggleView:(e,t,o,n,r)=>e.toggleView(t,o,n,r),whichView:(e,t)=>e.whichView(t)}});const hR=kM.optional({factory:XM,name:"menubar",schema:[ur("backstage")]}),pR=kM.optional({factory:{sketch:e=>OM.sketch({uid:e.uid,dom:e.dom,listBehaviours:xa([sf.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:()=>JN({type:e.type,uid:Xi("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:e.providers,onEscape:()=>(e.onEscape(),A.some(!0))}),setupItem:(e,t,o,n)=>{MM.setGroups(t,o)},shell:!0})},name:"multiple-toolbar",schema:[ur("dom"),ur("onEscape")]}),fR=kM.optional({factory:{sketch:e=>{const t=(e=>e.type===cv.sliding?XN:e.type===cv.floating?YN:JN)(e);return t({type:e.type,uid:e.uid,onEscape:()=>(e.onEscape(),A.some(!0)),onToggled:(t,o)=>e.onToolbarToggled(o),cyclicKeying:!1,initGroups:[],getSink:e.getSink,providers:e.providers,moreDrawerData:{lazyToolbar:e.lazyToolbar,lazyMoreButton:e.lazyMoreButton,lazyHeader:e.lazyHeader},attributes:e.attributes})}},name:"toolbar",schema:[ur("dom"),ur("onEscape"),ur("getSink")]}),vR=kM.optional({factory:{sketch:e=>{const t=e.editor,o=e.sticky?jM:BM;return{uid:e.uid,dom:e.dom,components:e.components,behaviours:xa(o(t,e.sharedBackstage))}}},name:"header",schema:[ur("dom")]}),bR=kM.optional({factory:{sketch:e=>({uid:e.uid,dom:e.dom,components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/tinymce-self-hosted-premium-features/?utm_campaign=self_hosted_upgrade_promo&utm_source=tiny&utm_medium=referral",rel:"noopener",target:"_blank","aria-hidden":"true"},classes:["tox-promotion-link"],innerHtml:"⚡️Upgrade"}}]})},name:"promotion",schema:[ur("dom")]}),yR=kM.optional({name:"socket",schema:[ur("dom")]}),wR=kM.optional({factory:{sketch:e=>({uid:e.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"presentation"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:xa([Ab.config({}),xf.config({}),iA.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:e=>{Pg.getCurrent(e).each(nN.hideAllSlots),Ws(e,mN)},onGrown:e=>{Ws(e,mN)},onStartGrow:e=>{$s(e,dN,{width:Bt(e.element,"width").getOr("")})},onStartShrink:e=>{$s(e,dN,{width:Kt(e.element)+"px"})}}),pf.config({}),Pg.config({find:e=>{const t=pf.contents(e);return te(t)}})])}],behaviours:xa([RT(0),ff("sidebar-sliding-events",[ea(dN,((e,t)=>{At(e.element,"width",t.event.width)})),ea(mN,((e,t)=>{It(e.element,"width")}))])])})},name:"sidebar",schema:[ur("dom")]}),xR=kM.optional({factory:{sketch:e=>({uid:e.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:xa([pf.config({}),hN.config({focus:!1}),Pg.config({find:e=>te(e.components())})]),components:[]})},name:"throbber",schema:[ur("dom")]}),CR=kM.optional({factory:gR,name:"viewWrapper",schema:[ur("backstage")]}),SR=kM.optional({factory:{sketch:e=>({uid:e.uid,dom:{tag:"div",classes:["tox-editor-container"]},components:e.components})},name:"editorContainer",schema:[]});var kR=Bg({name:"OuterContainer",factory:(e,t,o)=>{let n=!1;const r=e=>{Gl(e,".tox-statusbar").each((e=>{"none"===Nt(e,"display")&&"true"===St(e,"aria-hidden")?(It(e,"display"),Et(e,"aria-hidden")):(At(e,"display","none"),xt(e,"aria-hidden","true"))}))},a={getSocket:t=>SM.getPart(t,e,"socket"),setSidebar:(t,o,n)=>{SM.getPart(t,e,"sidebar").each((e=>((e,t,o)=>{Pg.getCurrent(e).each((n=>{pf.set(n,[iN(t)]);const r=null==o?void 0:o.toLowerCase();s(r)&&ve(t,r)&&Pg.getCurrent(n).each((t=>{nN.showSlot(t,r),iA.immediateGrow(n),It(n.element,"width"),lN(e.element,"region")}))}))})(e,o,n)))},toggleSidebar:(t,o)=>{SM.getPart(t,e,"sidebar").each((e=>((e,t)=>{Pg.getCurrent(e).each((o=>{Pg.getCurrent(o).each((n=>{iA.hasGrown(o)?nN.isShowing(n,t)?(iA.shrink(o),lN(e.element,"presentation")):(nN.hideAllSlots(n),nN.showSlot(n,t),lN(e.element,"region")):(nN.hideAllSlots(n),nN.showSlot(n,t),iA.grow(o),lN(e.element,"region"))}))}))})(e,o)))},whichSidebar:t=>SM.getPart(t,e,"sidebar").bind(cN).getOrNull(),getHeader:t=>SM.getPart(t,e,"header"),getToolbar:t=>SM.getPart(t,e,"toolbar"),setToolbar:(t,o)=>{SM.getPart(t,e,"toolbar").each((e=>{const t=P(o,qN);e.getApis().setGroups(e,t)}))},setToolbars:(t,o)=>{SM.getPart(t,e,"multiple-toolbar").each((e=>{const t=P(o,(e=>P(e,qN)));OM.setItems(e,t)}))},refreshToolbar:t=>{SM.getPart(t,e,"toolbar").each((e=>e.getApis().refresh(e)))},toggleToolbarDrawer:t=>{SM.getPart(t,e,"toolbar").each((e=>{Ce(e.getApis().toggle,(t=>t(e)))}))},toggleToolbarDrawerWithoutFocusing:t=>{SM.getPart(t,e,"toolbar").each((e=>{Ce(e.getApis().toggleWithoutFocusing,(t=>t(e)))}))},isToolbarDrawerToggled:t=>SM.getPart(t,e,"toolbar").bind((e=>A.from(e.getApis().isOpen).map((t=>t(e))))).getOr(!1),getThrobber:t=>SM.getPart(t,e,"throbber"),focusToolbar:t=>{SM.getPart(t,e,"toolbar").orThunk((()=>SM.getPart(t,e,"multiple-toolbar"))).each((e=>{sf.focusIn(e)}))},setMenubar:(t,o)=>{SM.getPart(t,e,"menubar").each((e=>{XM.setMenus(e,o)}))},focusMenubar:t=>{SM.getPart(t,e,"menubar").each((e=>{XM.focus(e)}))},setViews:(t,o)=>{SM.getPart(t,e,"viewWrapper").each((e=>{gR.setViews(e,o)}))},toggleView:(t,o)=>SM.getPart(t,e,"viewWrapper").exists((e=>gR.toggleView(e,(()=>a.showMainView(t)),(()=>a.hideMainView(t)),o))),whichView:t=>SM.getPart(t,e,"viewWrapper").bind(gR.whichView).getOrNull(),hideMainView:t=>{n=a.isToolbarDrawerToggled(t),n&&a.toggleToolbarDrawer(t),SM.getPart(t,e,"editorContainer").each((e=>{const t=e.element;r(t),At(t,"display","none"),xt(t,"aria-hidden","true")}))},showMainView:t=>{n&&a.toggleToolbarDrawer(t),SM.getPart(t,e,"editorContainer").each((e=>{const t=e.element;r(t),It(t,"display"),Et(t,"aria-hidden")}))}};return{uid:e.uid,dom:e.dom,components:t,apis:a,behaviours:e.behaviours}},configFields:[ur("dom"),ur("behaviours")],partFields:[vR,hR,fR,pR,yR,wR,bR,xR,CR,SR],apis:{getSocket:(e,t)=>e.getSocket(t),setSidebar:(e,t,o,n)=>{e.setSidebar(t,o,n)},toggleSidebar:(e,t,o)=>{e.toggleSidebar(t,o)},whichSidebar:(e,t)=>e.whichSidebar(t),getHeader:(e,t)=>e.getHeader(t),getToolbar:(e,t)=>e.getToolbar(t),setToolbar:(e,t,o)=>{e.setToolbar(t,o)},setToolbars:(e,t,o)=>{e.setToolbars(t,o)},refreshToolbar:(e,t)=>e.refreshToolbar(t),toggleToolbarDrawer:(e,t)=>{e.toggleToolbarDrawer(t)},toggleToolbarDrawerWithoutFocusing:(e,t)=>{e.toggleToolbarDrawerWithoutFocusing(t)},isToolbarDrawerToggled:(e,t)=>e.isToolbarDrawerToggled(t),getThrobber:(e,t)=>e.getThrobber(t),setMenubar:(e,t,o)=>{e.setMenubar(t,o)},focusMenubar:(e,t)=>{e.focusMenubar(t)},focusToolbar:(e,t)=>{e.focusToolbar(t)},setViews:(e,t,o)=>{e.setViews(t,o)},toggleView:(e,t,o)=>e.toggleView(t,o),whichView:(e,t)=>e.whichView(t)}});const _R={file:{title:"File",items:"newdocument restoredraft | preview | importword exportpdf exportword | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code revisionhistory | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed inserttemplate codesample inserttable accordion math | charmap emoticons hr | pagebreak nonbreaking anchor tableofcontents footnotes | mergetags | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | styles blocks fontfamily fontsize align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"aidialog aishortcuts | spellchecker spellcheckerlanguage | autocorrect capitalization | a11ycheck code typography wordcount addtemplate"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},ER=e=>e.split(" "),TR=(e,t)=>{const o={..._R,...t.menus},n=se(t.menus).length>0,r=void 0===t.menubar||!0===t.menubar?ER("file edit view insert format tools table help"):ER(!1===t.menubar?"":t.menubar),a=V(r,(e=>{const o=ve(_R,e);return n?o||fe(t.menus,e).exists((e=>ve(e,"items"))):o})),i=P(a,(n=>{const r=o[n];return((e,t,o)=>{const n=Av(o).split(/[ ,]/);return{text:e.title,getItems:()=>q(e.items,(e=>{const o=e.toLowerCase();return 0===o.trim().length||L(n,(e=>e===o))?[]:"separator"===o||"|"===o?[{type:"separator"}]:t.menuItems[o]?[t.menuItems[o]]:[]}))}})({title:r.title,items:ER(r.items)},t,e)}));return V(i,(e=>e.getItems().length>0&&L(e.getItems(),(e=>s(e)||"separator"!==e.type))))},OR=(e,t,o)=>(e.on("remove",(()=>o.unload(t))),o.load(t)),AR=(e,t,o,n)=>(e.on("remove",(()=>n.unloadRawCss(t))),n.loadRawCss(t,o)),DR=async(e,t)=>{const o="ui/"+sb(e).getOr("default")+"/skin.css",n=tinymce.Resource.get(o);if(!s(n)){const o=e.editorManager.suffix;return OR(e,t+`/skin${o}.css`,e.ui.styleSheetLoader)}AR(e,o,n,e.ui.styleSheetLoader)},MR=async(e,t)=>{var o;if(o=Be.fromDom(e.getElement()),ht(o).isSome()){const o="ui/"+sb(e).getOr("default")+"/skin.shadowdom.css",n=tinymce.Resource.get(o);if(!s(n)){const o=e.editorManager.suffix;return OR(e,t+`/skin.shadowdom${o}.css`,uv.DOM.styleSheetLoader)}AR(e,o,n,uv.DOM.styleSheetLoader)}},NR=(e,t)=>(async(e,t)=>{const o=()=>{const o=rb(t),n=t.editorManager.suffix;o&&t.contentCSS.push(o+(e?"/content.inline":"/content")+`${n}.css`)};sb(t).fold(o,(n=>{const r="ui/"+n+(e?"/content.inline":"/content")+".css",a=tinymce.Resource.get(r);s(a)?AR(t,r,a,t.ui.styleSheetLoader):o()}));const n=rb(t);if(!ob(t)&&s(n))return Promise.all([DR(t,n),MR(t,n)]).then()})(e,t).then((e=>{const t=()=>{e._skinLoaded=!0,(e=>{e.dispatch("SkinLoaded")})(e)};return()=>{e.initialized?t():e.on("init",t)}})(t),((e,t)=>()=>((e,t)=>{e.dispatch("SkinLoadError",t)})(e,{message:t}))(t,"Skin could not be loaded")),RR=S(NR,!1),BR=S(NR,!0),LR=(e,t,o)=>Me(o)?e.translate(t):e.translate([t,e.translate(o)]),HR=(e,t)=>{const o=(o,r,s,a)=>{const i=e.shared.providers.translate(o.title);if("separator"===o.type)return A.some({type:"separator",text:i});if("submenu"===o.type){const e=q(o.getStyleItems(),(e=>n(e,r,a)));return 0===r&&e.length<=0?A.none():A.some({type:"nestedmenuitem",text:i,enabled:e.length>0,getSubmenuItems:()=>q(o.getStyleItems(),(e=>n(e,r,a)))})}return A.some({type:"togglemenuitem",text:i,icon:o.icon,active:o.isSelected(a),enabled:!s,onAction:t.onAction(o),...o.getStylePreview().fold((()=>({})),(e=>({meta:{style:e}})))})},n=(e,n,r)=>{const s="formatter"===e.type&&t.isInvalid(e);return 0===n?s?[]:o(e,n,!1,r).toArray():o(e,n,s,r).toArray()},r=e=>{const o=t.getCurrentValue(),r=t.shouldHide?0:1;return q(e,(e=>n(e,r,o)))};return{validateItems:r,getFetch:(e,t)=>(o,n)=>{const s=t(),a=r(s);n(MO(a,Jy.CLOSE_ON_EXECUTE,e,{isHorizontalMenu:!1,search:A.none()}))}}},IR=(e,t)=>{const o=t.dataset,n="basic"===o.type?()=>P(o.data,(e=>$D(e,t.isSelectedFor,t.getPreviewFor))):o.getData;return{items:HR(e,t),getStyleItems:n}},PR=(e,t,o,n,r,s)=>{const{items:a,getStyleItems:i}=IR(t,o),l=Xo(o.tooltip);return EO({text:o.icon.isSome()?A.none():o.text,icon:o.icon,ariaLabel:A.some(o.tooltip),tooltip:A.none(),role:A.none(),fetch:a.getFetch(t,i),onSetup:t=>{const s=o=>t.setTooltip(LR(e,n(o.value),o.value));return e.on(r,s),JC(tS(e,"NodeChange",(t=>{const n=t.getComponent();o.updateText(n),Jg.set(t.getComponent(),!e.selection.isEditable())}))(t),(()=>e.off(r,s)))},getApi:e=>({getComponent:w(e),setTooltip:o=>{const n=t.shared.providers.translate(o);xt(e.element,"aria-label",n),l.set(o)}}),columns:1,presets:"normal",classes:o.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[zb.config({...t.shared.providers.tooltips.getConfig({tooltipText:t.shared.providers.translate(o.tooltip),onShow:e=>{if(o.tooltip!==l.get()){const o=t.shared.providers.translate(l.get());zb.setComponents(e,t.shared.providers.tooltips.getComponents({tooltipText:o}))}}})})]},"tox-tbtn",t.shared,s)};var FR;!function(e){e[e.SemiColon=0]="SemiColon",e[e.Space=1]="Space"}(FR||(FR={}));const zR=(e,t,o)=>{const n=(e=>P(e,(e=>{let t=e,o=e;const n=e.split("=");return n.length>1&&(t=n[0],o=n[1]),{title:t,format:o}})))(((e,t)=>t===FR.SemiColon?e.replace(/;$/,"").split(";"):e.split(" "))(e.options.get(t),o));return{type:"basic",data:n}},VR=w("Alignment {0}"),ZR="left",UR=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],jR=e=>{const t={type:"basic",data:UR};return{tooltip:LR(e,VR(),ZR),text:A.none(),icon:A.some("align-left"),isSelectedFor:t=>()=>e.formatter.match(t),getCurrentValue:A.none,getPreviewFor:e=>A.none,onAction:t=>()=>j(UR,(e=>e.format===t.format)).each((t=>e.execCommand(t.command))),updateText:t=>{const o=j(UR,(t=>e.formatter.match(t.format))),n=o.fold(w(ZR),(e=>e.title.toLowerCase()));$s(t,_O,{icon:`align-${n}`}),((e,t)=>{e.dispatch("AlignTextUpdate",t)})(e,{value:n})},dataset:t,shouldHide:!1,isInvalid:t=>!e.formatter.canApply(t.format)}},WR=(e,t)=>{const o=t(),n=P(o,(e=>e.format));return A.from(e.formatter.closest(n)).bind((e=>j(o,(t=>t.format===e))))},$R=w("Block {0}"),qR="Paragraph",GR=e=>{const t=zR(e,"block_formats",FR.SemiColon);return{tooltip:LR(e,$R(),qR),text:A.some(qR),icon:A.none(),isSelectedFor:t=>()=>e.formatter.match(t),getCurrentValue:A.none,getPreviewFor:t=>()=>{const o=e.formatter.get(t);return o?A.some({tag:o.length>0&&(o[0].inline||o[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):A.none()},onAction:oS(e),updateText:o=>{const n=WR(e,(()=>t.data)).fold(w(qR),(e=>e.title));$s(o,kO,{text:n}),((e,t)=>{e.dispatch("BlocksTextUpdate",t)})(e,{value:n})},dataset:t,shouldHide:!1,isInvalid:t=>!e.formatter.canApply(t.format)}},KR=w("Font {0}"),YR="System Font",XR=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],JR=e=>{const t=e.split(/\s*,\s*/);return P(t,(e=>e.replace(/^['"]+|['"]+$/g,"")))},QR=(e,t)=>t.length>0&&G(t,(t=>e.indexOf(t.toLowerCase())>-1)),eB=e=>{const t=()=>{const t=e=>e?JR(e)[0]:"",n=e.queryCommandValue("FontName"),r=o.data,s=n?n.toLowerCase():"",a=tb(e),i=j(r,(e=>{const o=e.format;return o.toLowerCase()===s||t(o).toLowerCase()===t(s).toLowerCase()})).orThunk((()=>Se(((e,t)=>{if(0===e.indexOf("-apple-system")||t.length>0){const o=JR(e.toLowerCase());return QR(o,XR)||QR(o,t)}return!1})(s,a),{title:YR,format:s})));return{matchOpt:i,font:n}},o=zR(e,"font_family_formats",FR.SemiColon);return{tooltip:LR(e,KR(),YR),text:A.some(YR),icon:A.none(),isSelectedFor:e=>t=>t.exists((t=>t.format===e)),getCurrentValue:()=>{const{matchOpt:e}=t();return e},getPreviewFor:e=>()=>A.some({tag:"div",styles:-1===e.indexOf("dings")?{"font-family":e}:{}}),onAction:t=>()=>{e.undoManager.transact((()=>{e.focus(),e.execCommand("FontName",!1,t.format)}))},updateText:o=>{const{matchOpt:n,font:r}=t(),s=n.fold(w(r),(e=>e.title));$s(o,kO,{text:s}),((e,t)=>{e.dispatch("FontFamilyTextUpdate",t)})(e,{value:s})},dataset:o,shouldHide:!1,isInvalid:T}},tB={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},oB=(()=>{const e="[0-9]+",t="[eE]"+("[+-]?"+e),o=e=>`(?:${e})?`,n=["Infinity",e+"\\."+o(e)+o(t),"\\."+e+o(t),e+o(t)].join("|");return new RegExp(`^(${`[+-]?(?:${n})`})(.*)$`)})(),nB=(e,t)=>A.from(oB.exec(e)).bind((e=>{const o=Number(e[1]),n=e[2];return((e,t)=>L(t,(t=>L(tB[t],(t=>e===t)))))(n,t)?A.some({value:o,unit:n}):A.none()})),rB={tab:w(9),escape:w(27),enter:w(13),backspace:w(8),delete:w(46),left:w(37),up:w(38),right:w(39),down:w(40),space:w(32),home:w(36),end:w(35),pageUp:w(33),pageDown:w(34)},sB=(e,t,o,n)=>{let r=A.none();const s=tS(e,"NodeChange SwitchMode",(t=>{const n=t.getComponent();r=A.some(n),o.updateInputValue(n),Jg.set(n,!e.selection.isEditable())})),a=e=>({getComponent:w(e)}),i=Xo(v),l=Xi("custom-number-input-events"),c=(e,t,n)=>{const s=r.map((e=>Au.getValue(e))).getOr("");const a=o.getNewValue(s,e),i=s.length-`${a}`.length,l=r.map((e=>e.element.dom.selectionStart-i)),c=r.map((e=>e.element.dom.selectionEnd-i));o.onAction(a,n),r.each((e=>{Au.setValue(e,a),t&&(l.each((t=>e.element.dom.selectionStart=t)),c.each((t=>e.element.dom.selectionEnd=t)))}))},d=(e,t)=>c(((e,t)=>e-t),e,t),m=(e,t)=>c(((e,t)=>e+t),e,t),u=e=>rt(e.element).fold(A.none,(e=>(Pc(e),A.some(!0)))),h=e=>zc(e.element)?(lt(e.element).each((e=>Pc(e))),A.some(!0)):A.none(),p=(o,n,r,s)=>{const i=Xo(v),l=t.shared.providers.translate(r),c=Xi("altExecuting"),d=tS(e,"NodeChange SwitchMode",(t=>{Jg.set(t.getComponent(),!e.selection.isEditable())})),m=e=>{Jg.isDisabled(e)||o(!0)};return kb.sketch({dom:{tag:"button",attributes:{"aria-label":l,"data-mce-name":n},classes:s.concat(n)},components:[xO(n,t.shared.providers.icons)],buttonBehaviours:xa([Jg.config({}),zb.config(t.shared.providers.tooltips.getConfig({tooltipText:l})),ff(c,[iC({onSetup:d,getApi:a},i),lC({getApi:a},i),ea(ls(),((e,t)=>{t.event.raw.keyCode!==rB.space()&&t.event.raw.keyCode!==rB.enter()||Jg.isDisabled(e)||o(!1)})),ea(us(),m),ea(Qr(),m)])]),eventOrder:{[ls()]:[c,"keying"],[us()]:[c,"alloy.base.behaviour"],[Qr()]:[c,"alloy.base.behaviour"],[Bs()]:["alloy.base.behaviour",c,"tooltipping"],[Ls()]:[c,"tooltipping"]}})},f=Eb(p((e=>d(!1,e)),"minus","Decrease font size",[])),b=Eb(p((e=>m(!1,e)),"plus","Increase font size",[])),y=Eb({dom:{tag:"div",classes:["tox-input-wrapper"]},components:[xw.sketch({inputBehaviours:xa([Jg.config({}),ff(l,[iC({onSetup:s,getApi:a},i),lC({getApi:a},i)]),ff("input-update-display-text",[ea(kO,((e,t)=>{Au.setValue(e,t.event.text)})),ea(is(),(e=>{o.onAction(Au.getValue(e))})),ea(ms(),(e=>{o.onAction(Au.getValue(e))}))]),sf.config({mode:"special",onEnter:e=>(c(x,!0,!0),A.some(!0)),onEscape:u,onUp:e=>(m(!0,!1),A.some(!0)),onDown:e=>(d(!0,!1),A.some(!0)),onLeft:(e,t)=>(t.cut(),A.none()),onRight:(e,t)=>(t.cut(),A.none())})])})],behaviours:xa([xf.config({}),sf.config({mode:"special",onEnter:h,onSpace:h,onEscape:u}),ff("input-wrapper-events",[ea(ss(),(e=>{F([f,b],(t=>{const o=Be.fromDom(t.get(e).element.dom);zc(o)&&Fc(o)}))}))])])});return{dom:{tag:"div",classes:["tox-number-input"],attributes:{...g(n)?{"data-mce-name":n}:{}}},components:[f.asSpec(),y.asSpec(),b.asSpec()],behaviours:xa([xf.config({}),sf.config({mode:"flow",focusInside:Nh.OnEnterOrSpaceMode,cycles:!1,selector:"button, .tox-input-wrapper",onEscape:e=>zc(e.element)?A.none():(Pc(e.element),A.some(!0))})])}},aB=w("Font size {0}"),iB="12pt",lB={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},cB={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},dB=(e,t)=>/[0-9.]+px$/.test(e)?((e,t)=>{const o=Math.pow(10,t);return Math.round(e*o)/o})(72*parseInt(e,10)/96,t||0)+"pt":fe(cB,e).getOr(e),mB=e=>fe(lB,e).getOr(""),uB=e=>{const t=()=>{let t=A.none();const o=n.data,r=e.queryCommandValue("FontSize");if(r)for(let e=3;t.isNone()&&e>=0;e--){const n=dB(r,e),s=mB(n);t=j(o,(e=>e.format===r||e.format===n||e.format===s))}return{matchOpt:t,size:r}},o=w(A.none),n=zR(e,"font_size_formats",FR.Space);return{tooltip:LR(e,aB(),iB),text:A.some(iB),icon:A.none(),isSelectedFor:e=>t=>t.exists((t=>t.format===e)),getPreviewFor:o,getCurrentValue:()=>{const{matchOpt:e}=t();return e},onAction:t=>()=>{e.undoManager.transact((()=>{e.focus(),e.execCommand("FontSize",!1,t.format)}))},updateText:o=>{const{matchOpt:n,size:r}=t(),s=n.fold(w(r),(e=>e.title));$s(o,kO,{text:s}),((e,t)=>{e.dispatch("FontSizeTextUpdate",t)})(e,{value:s})},dataset:n,shouldHide:!1,isInvalid:T}},gB=e=>Me(e)?"Formats":"Format {0}",hB=(e,t)=>{const o="Formats";return{tooltip:LR(e,gB(""),""),text:A.some(o),icon:A.none(),isSelectedFor:t=>()=>e.formatter.match(t),getCurrentValue:A.none,getPreviewFor:t=>()=>{const o=e.formatter.get(t);return void 0!==o?A.some({tag:o.length>0&&(o[0].inline||o[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):A.none()},onAction:oS(e),updateText:t=>{const n=e=>VD(e)?q(e.items,n):ZD(e)?[{title:e.title,format:e.format}]:[],r=q(WD(e),n),s=WR(e,w(r)).fold(w({title:o,tooltipLabel:""}),(e=>({title:e.title,tooltipLabel:e.title})));$s(t,kO,{text:s.title}),((e,t)=>{e.dispatch("StylesTextUpdate",t)})(e,{value:s.tooltipLabel})},shouldHide:Tv(e),isInvalid:t=>!e.formatter.canApply(t.format),dataset:t}},pB=w([ur("toggleClass"),ur("fetch"),Fi("onExecute"),Ar("getHotspot",A.some),Ar("getAnchorOverrides",w({})),Ad(),Fi("onItemExecute"),xr("lazySink"),ur("dom"),Ii("onOpen"),Du("splitDropdownBehaviours",[rk,sf,xf]),Ar("matchWidth",!1),Ar("useMinWidth",!1),Ar("eventOrder",{}),xr("role"),xr("listRole")].concat(Ck())),fB=sg({factory:kb,schema:[ur("dom")],name:"arrow",defaults:()=>({buttonBehaviours:xa([xf.revoke()])}),overrides:e=>({dom:{tag:"span",attributes:{role:"presentation"}},action:t=>{t.getSystem().getByUid(e.uid).each(qs)},buttonBehaviours:xa([Af.config({toggleOnExecute:!1,toggleClass:e.toggleClass})])})}),vB=sg({factory:kb,schema:[ur("dom")],name:"button",defaults:()=>({buttonBehaviours:xa([xf.revoke()])}),overrides:e=>({dom:{tag:"span",attributes:{role:"presentation"}},action:t=>{t.getSystem().getByUid(e.uid).each((o=>{e.onExecute(o,t)}))}})}),bB=w([fB,vB,ig({factory:{sketch:e=>({uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}})},schema:[ur("text")],name:"aria-descriptor"}),ag({schema:[Bi()],name:"menu",defaults:e=>({onExecute:(t,o)=>{t.getSystem().getByUid(e.uid).each((n=>{e.onItemExecute(n,t,o)}))}})}),uk()]),yB=Bg({name:"SplitDropdown",configFields:pB(),partFields:bB(),factory:(e,t,o,n)=>{const r=e=>{Pg.getCurrent(e).each((e=>{ch.highlightFirst(e),sf.focusIn(e)}))},s=t=>{fk(e,x,t,n,r,sv.HighlightMenuAndItem).get(v)},a=t=>{const o=wg(t,e,"button");return qs(o),A.some(!0)},i={...Xs([la(((t,o)=>{yg(t,e,"aria-descriptor").each((e=>{const o=Xi("aria");xt(e.element,"id",o),xt(t.element,"aria-describedby",o)}))}))]),...Nf(A.some(s))},l={repositionMenus:e=>{Af.isOn(e)&&xk(e)}};return{uid:e.uid,dom:e.dom,components:t,apis:l,eventOrder:{...e.eventOrder,[Ss()]:["disabling","toggling","alloy.base.behaviour"]},events:i,behaviours:Nu(e.splitDropdownBehaviours,[rk.config({others:{sandbox:t=>{const o=wg(t,e,"arrow");return wk(e,t,{onOpen:()=>{Af.on(o),Af.on(t)},onClose:()=>{Af.off(o),Af.off(t)}})}}}),sf.config({mode:"special",onSpace:a,onEnter:a,onDown:e=>(s(e),A.some(!0))}),xf.config({}),Af.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:e.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:(e,t)=>e.repositionMenus(t)}}),wB=e=>({isEnabled:()=>!Jg.isDisabled(e),setEnabled:t=>Jg.set(e,!t),setText:t=>$s(e,kO,{text:t}),setIcon:t=>$s(e,_O,{icon:t})}),xB=e=>({setActive:t=>{Af.set(e,t)},isActive:()=>Af.isOn(e),isEnabled:()=>!Jg.isDisabled(e),setEnabled:t=>Jg.set(e,!t),setText:t=>$s(e,kO,{text:t}),setIcon:t=>$s(e,_O,{icon:t})}),CB=(e,t)=>e.map((e=>({"aria-label":t.translate(e)}))).getOr({}),SB=Xi("focus-button"),kB=(e,t,o,n,r,s)=>{const a=t.map((e=>Eb(SO(e,"tox-tbtn",r)))),i=e.map((e=>Eb(CO(e,r.icons))));return{dom:{tag:"button",classes:["tox-tbtn"].concat(t.isSome()?["tox-tbtn--select"]:[]),attributes:{...CB(o,r),...g(s)?{"data-mce-name":s}:{}}},components:mC([i.map((e=>e.asSpec())),a.map((e=>e.asSpec()))]),eventOrder:{[ts()]:["focusing","alloy.base.behaviour",vO],[Bs()]:[vO,"toolbar-group-button-events"]},buttonBehaviours:xa([sC(r.isDisabled),tC(),ff(vO,[la(((e,t)=>yO(e))),ea(kO,((e,t)=>{a.bind((t=>t.getOpt(e))).each((e=>{pf.set(e,[Hl(r.translate(t.event.text))])}))})),ea(_O,((e,t)=>{i.bind((t=>t.getOpt(e))).each((e=>{pf.set(e,[CO(t.event.icon,r.icons)])}))})),ea(ts(),((e,t)=>{t.event.prevent(),Ws(e,SB)}))])].concat(n.getOr([])))}},_B=(e,t,o,n)=>{var r;const s=Xo(v),a=kB(e.icon,e.text,e.tooltip,A.none(),o,n);return kb.sketch({dom:a.dom,components:a.components,eventOrder:bO,buttonBehaviours:{...xa([ff("toolbar-button-events",[(i={onAction:e.onAction,getApi:t.getApi},ma(((e,t)=>{aC(i,e)((t=>{$s(e,fO,{buttonApi:t}),i.onAction(t)}))}))),iC(t,s),lC(t,s)]),...e.tooltip.map((t=>zb.config(o.tooltips.getConfig({tooltipText:o.translate(t)+e.shortcut.map((e=>` (${hC(e)})`)).getOr("")})))).toArray(),sC((()=>!e.enabled||o.isDisabled())),tC()].concat(t.toolbarButtonBehaviours)),[vO]:null===(r=a.buttonBehaviours)||void 0===r?void 0:r[vO]}});var i},EB=(e,t,o,n)=>_B(e,{toolbarButtonBehaviours:o.length>0?[ff("toolbarButtonWith",o)]:[],getApi:wB,onSetup:e.onSetup},t,n),TB=(e,t,o,n)=>_B(e,{toolbarButtonBehaviours:[pf.config({}),Af.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(o.length>0?[ff("toolbarToggleButtonWith",o)]:[]),getApi:xB,onSetup:e.onSetup},t,n),OB=(e,t,o)=>n=>ck((e=>t.fetch(e))).map((r=>A.from(Lk(Sn(PS(Xi("menu-value"),r,(o=>{t.onItemAction(e(n),o)}),t.columns,t.presets,Jy.CLOSE_ON_EXECUTE,t.select.getOr(T),o),{movement:zS(t.columns,t.presets),menuBehaviours:Kx("auto"!==t.columns?[]:[la(((e,o)=>{qx(e,4,dw(t.presets)).each((({numRows:t,numColumns:o})=>{sf.setGridSize(e,t,o)}))}))])}))))),AB=[{name:"history",items:["undo","redo"]},{name:"ai",items:["aidialog","aishortcuts"]},{name:"styles",items:["styles"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],DB=(e,t)=>(o,n,r,s)=>{const a=e(o).mapError((e=>ar(e))).getOrDie();return t(a,n,r,s)},MB={button:DB(bx,((e,t,o,n)=>((e,t,o)=>EB(e,t,[],o))(e,t.shared.providers,n))),togglebutton:DB(xx,((e,t,o,n)=>((e,t,o)=>TB(e,t,[],o))(e,t.shared.providers,n))),menubutton:DB(KM,((e,t,o,n)=>cA(e,"tox-tbtn",t,A.none(),!1,n))),splitbutton:DB((e=>nr("SplitButton",YM,e)),((e,t,o,n)=>((e,t,o)=>{const n=Xo(e.tooltip.getOr("")),r=e=>({isEnabled:()=>!Jg.isDisabled(e),setEnabled:t=>Jg.set(e,!t),setIconFill:(t,o)=>{Yl(e.element,`svg path[class="${t}"], rect[class="${t}"]`).each((e=>{xt(e,"fill",o)}))},setActive:t=>{xt(e.element,"aria-pressed",t),Yl(e.element,"span").each((o=>{e.getSystem().getByDom(o).each((e=>Af.set(e,t)))}))},isActive:()=>Yl(e.element,"span").exists((t=>e.getSystem().getByDom(t).exists(Af.isOn))),setText:t=>Yl(e.element,"span").each((o=>e.getSystem().getByDom(o).each((e=>$s(e,kO,{text:t}))))),setIcon:t=>Yl(e.element,"span").each((o=>e.getSystem().getByDom(o).each((e=>$s(e,_O,{icon:t}))))),setTooltip:o=>{const r=t.providers.translate(o);xt(e.element,"aria-label",r),n.set(o)}}),s=Xo(v),a={getApi:r,onSetup:e.onSetup};return yB.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:{"aria-pressed":!1,...CB(e.tooltip,t.providers),...g(o)?{"data-mce-name":o}:{}}},onExecute:t=>{const o=r(t);o.isEnabled()&&e.onAction(o)},onItemExecute:(e,t,o)=>{},splitDropdownBehaviours:xa([rC(t.providers.isDisabled),tC(),ff("split-dropdown-events",[la(((e,t)=>yO(e))),ea(SB,xf.focus),iC(a,s),lC(a,s)]),T_.config({}),...e.tooltip.map((e=>zb.config({...t.providers.tooltips.getConfig({tooltipText:t.providers.translate(e),onShow:o=>{if(n.get()!==e){const e=t.providers.translate(n.get());zb.setComponents(o,t.providers.tooltips.getComponents({tooltipText:e}))}}})}))).toArray()]),eventOrder:{[Bs()]:["alloy.base.behaviour","split-dropdown-events","tooltipping"],[Ls()]:["split-dropdown-events","tooltipping"]},toggleClass:"tox-tbtn--enabled",lazySink:t.getSink,fetch:OB(r,e,t.providers),parts:{menu:fw(0,e.columns,e.presets)},components:[yB.parts.button(kB(e.icon,e.text,A.none(),A.some([Af.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),t.providers)),yB.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:Uy("chevron-down",t.providers.icons)},buttonBehaviours:xa([rC(t.providers.isDisabled),tC(),jy()])}),yB.parts["aria-descriptor"]({text:t.providers.translate("To open the popup, press Shift+Enter")})]})})(e,t.shared,n))),grouptoolbarbutton:DB((e=>nr("GroupToolbarButton",$M,e)),((e,t,o,n)=>{const r=o.ui.registry.getAll().buttons,s=e=>LB(o,{buttons:r,toolbar:e,allowToolbarGroups:!1},t,A.none()),a={[Td]:t.shared.header.isPositionedAtTop()?Ed.TopToBottom:Ed.BottomToTop};if(Dv(o)===cv.floating)return((e,t,o,n,r)=>{const s=t.shared,a=Xo(v),i={toolbarButtonBehaviours:[],getApi:wB,onSetup:e.onSetup},l=[ff("toolbar-group-button-events",[iC(i,a),lC(i,a)])];return BN.sketch({lazySink:s.getSink,fetch:()=>ck((t=>{t(P(o(e.items),qN))})),markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:kB(e.icon,e.text,e.tooltip,A.some(l),s.providers,r),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:n}}}})})(e,t,s,a,n);throw new Error("Toolbar groups are only supported when using floating toolbar mode")}))},NB={styles:(e,t)=>{const o={type:"advanced",...t.styles};return PR(e,t,hB(e,o),gB,"StylesTextUpdate","styles")},fontsize:(e,t)=>PR(e,t,uB(e),aB,"FontSizeTextUpdate","fontsize"),fontsizeinput:(e,t)=>sB(e,t,(e=>{const t=()=>e.queryCommandValue("FontSize");return{updateInputValue:e=>$s(e,kO,{text:t()}),onAction:(t,o)=>e.execCommand("FontSize",!1,t,{skip_focus:!o}),getNewValue:(o,n)=>{nB(o,["unsupportedLength","empty"]);const r=t(),s=nB(o,["unsupportedLength","empty"]).or(nB(r,["unsupportedLength","empty"])),a=s.map((e=>e.value)).getOr(16),i=Vv(e),l=s.map((e=>e.unit)).filter((e=>""!==e)).getOr(i),c=n(a,(e=>{var t;return null!==(t={em:{step:.1},cm:{step:.1},in:{step:.1},pc:{step:.1},ch:{step:.1},rem:{step:.1}}[e])&&void 0!==t?t:{step:1}})(l).step),d=`${(e=>e>=0)(c)?c:a}${l}`;return d!==r&&((e,t)=>{e.dispatch("FontSizeInputTextUpdate",t)})(e,{value:d}),d}}})(e),"fontsizeinput"),fontfamily:(e,t)=>PR(e,t,eB(e),KR,"FontFamilyTextUpdate","fontfamily"),blocks:(e,t)=>PR(e,t,GR(e),$R,"BlocksTextUpdate","blocks"),align:(e,t)=>PR(e,t,jR(e),VR,"AlignTextUpdate","align")},RB=e=>{const t=e.toolbar,o=e.buttons;return!1===t?[]:void 0===t||!0===t?(e=>{const t=P(AB,(t=>{const o=V(t.items,(t=>ve(e,t)||ve(NB,t)));return{name:t.name,items:o}}));return V(t,(e=>e.items.length>0))})(o):s(t)?(e=>{const t=e.split("|");return P(t,(e=>({items:e.trim().split(" ")})))})(t):(e=>f(e,(e=>ve(e,"name")&&ve(e,"items"))))(t)?t:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},BB=(e,t,o,n,r,s)=>fe(t,o.toLowerCase()).orThunk((()=>s.bind((e=>re(e,(e=>fe(t,e+o.toLowerCase()))))))).fold((()=>fe(NB,o.toLowerCase()).map((t=>t(e,r)))),(t=>"grouptoolbarbutton"!==t.type||n?((e,t,o,n)=>fe(MB,e.type).fold((()=>(console.error("skipping button defined by",e),A.none())),(r=>A.some(r(e,t,o,n)))))(t,r,e,o.toLowerCase()):(console.warn(`Ignoring the '${o}' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested.`),A.none()))),LB=(e,t,o,n)=>{const r=RB(t),s=P(r,(r=>{const s=q(r.items,(r=>0===r.trim().length?[]:BB(e,t.buttons,r,t.allowToolbarGroups,o,n).toArray()));return{title:A.from(e.translate(r.name)),items:s}}));return V(s,(e=>e.items.length>0))},HB=(e,t,o,n)=>{const r=t.mainUi.outerContainer,a=o.toolbar,i=o.buttons;if(f(a,s)){const t=a.map((t=>{const r={toolbar:t,buttons:i,allowToolbarGroups:o.allowToolbarGroups};return LB(e,r,n,A.none())}));kR.setToolbars(r,t)}else kR.setToolbar(r,LB(e,o,n,A.none()))},IB=To(),PB=IB.os.isiOS()&&IB.os.version.major<=12;var FB=Object.freeze({__proto__:null,render:(e,t,o,n,r)=>{const{mainUi:s,uiMotherships:a}=t,i=Xo(0),l=s.outerContainer;RR(e);const d=Be.fromDom(r.targetNode),m=gt(ut(d));Ym(d,s.mothership),((e,t,o)=>{fb(e)&&Ym(o.mainUi.mothership.element,o.popupUi.mothership),Km(t,o.dialogUi.mothership)})(e,m,t),e.on("SkinLoaded",(()=>{kR.setSidebar(l,o.sidebar,Jv(e)),HB(e,t,o,n),i.set(e.getWin().innerWidth),kR.setMenubar(l,TR(e,o)),kR.setViews(l,o.views),((e,t)=>{const{uiMotherships:o}=t,n=e.dom;let r=e.getWin();const s=e.getDoc().documentElement,a=Xo(jt(r.innerWidth,r.innerHeight)),i=Xo(jt(s.offsetWidth,s.offsetHeight)),l=()=>{const t=a.get();t.left===r.innerWidth&&t.top===r.innerHeight||(a.set(jt(r.innerWidth,r.innerHeight)),KC(e))},c=()=>{const t=e.getDoc().documentElement,o=i.get();o.left===t.offsetWidth&&o.top===t.offsetHeight||(i.set(jt(t.offsetWidth,t.offsetHeight)),KC(e))},d=t=>{((e,t)=>{e.dispatch("ScrollContent",t)})(e,t)};n.bind(r,"resize",l),n.bind(r,"scroll",d);const m=sd(Be.fromDom(e.getBody()),"load",c);e.on("hide",(()=>{F(o,(e=>{At(e.element,"display","none")}))})),e.on("show",(()=>{F(o,(e=>{It(e.element,"display")}))})),e.on("NodeChange",c),e.on("remove",(()=>{m.unbind(),n.unbind(r,"resize",l),n.unbind(r,"scroll",d),r=null}))})(e,t)}));const u=kR.getSocket(l).getOrDie("Could not find expected socket element");if(PB){Dt(u.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});const t=((e,t)=>{let o=null;return{cancel:()=>{c(o)||(clearTimeout(o),o=null)},throttle:(...n)=>{c(o)&&(o=setTimeout((()=>{o=null,e.apply(null,n)}),t))}}})((()=>{e.dispatch("ScrollContent")}),20),o=rd(u.element,"scroll",t.throttle);e.on("remove",o.unbind)}eC(e,t),e.addCommand("ToggleSidebar",((t,o)=>{kR.toggleSidebar(l,o),(e=>{e.dispatch("ToggleSidebar")})(e)})),e.addQueryValueHandler("ToggleSidebar",(()=>{var e;return null!==(e=kR.whichSidebar(l))&&void 0!==e?e:""})),e.addCommand("ToggleView",((t,o)=>{if(kR.toggleView(l,o)){const t=l.element;s.mothership.broadcastOn([du()],{target:t}),F(a,(e=>{e.broadcastOn([du()],{target:t})})),c(kR.whichView(l))&&(e.focus(),e.nodeChanged(),kR.refreshToolbar(l)),(e=>{e.dispatch("ToggleView")})(e)}})),e.addQueryValueHandler("ToggleView",(()=>{var e;return null!==(e=kR.whichView(l))&&void 0!==e?e:""}));const g=Dv(e);g!==cv.sliding&&g!==cv.floating||e.on("ResizeWindow ResizeEditor ResizeContent",(()=>{const o=e.getWin().innerWidth;o!==i.get()&&(kR.refreshToolbar(t.mainUi.outerContainer),i.set(o))}));const h={setEnabled:e=>{Qx(t,!e)},isEnabled:()=>!Jg.isDisabled(l)};return{iframeContainer:u.element.dom,editorContainer:l.element.dom,api:h}}});const zB=e=>/^[0-9\.]+(|px)$/i.test(""+e)?A.some(parseInt(""+e,10)):A.none(),VB=e=>p(e)?e+"px":e,ZB=(e,t,o)=>{const n=t.filter((t=>ee>t));return n.or(r).getOr(e)},UB=e=>{const t=(e=>{const t=yv(e),o=Cv(e),n=kv(e);return zB(t).map((e=>ZB(e,o,n)))})(e);return t.getOr(yv(e))},jB=e=>{const t=wv(e),o=xv(e),n=Sv(e);return zB(t).map((e=>ZB(e,o,n)))},{ToolbarLocation:WB,ToolbarMode:$B}=bb,qB=(e,t,o,n,r)=>{const{mainUi:s,uiMotherships:a}=o,i=uv.DOM,l=ub(e),c=pb(e),d=Sv(e).or(jB(e)),m=n.shared.header,u=m.isPositionedAtTop,g=Dv(e),h=g===$B.sliding||g===$B.floating,p=Xo(!1),f=()=>p.get()&&!e.removed,v=e=>h?e.fold(w(0),(e=>e.components().length>1?Vt(e.components()[1].element):0)):0,b=(e,t)=>fb(e)?Za(t):A.none(),y=()=>{F(a,(e=>{e.broadcastOn([mu()],{})}))},x=o=>{if(!f())return;l||r.on((e=>{const o=d.getOrThunk((()=>Vo().width-qt(t).left-10));At(e.element,"max-width",o+"px")}));const n=Po(),a=!l&&(()=>{if(!l&&($t(s.outerContainer.element).left+Yt(s.outerContainer.element)>=window.innerWidth-40||Bt(s.outerContainer.element,"width").isSome()))return At(s.outerContainer.element,"position","absolute"),At(s.outerContainer.element,"left","0px"),It(s.outerContainer.element,"width"),!0;return!1})();if(h&&kR.refreshToolbar(s.outerContainer),!l){const o=Po(),i=Se(n.left!==o.left,n);((o,n)=>{r.on((r=>{const a=kR.getToolbar(s.outerContainer),i=v(a),l=qo(t),c=b(e,s.outerContainer.element),d=c.fold((()=>l.x),(e=>{const t=qo(e);return Xe(e,bt())?l.x:l.x-t.x})),m=Se(o,Math.ceil(s.outerContainer.element.dom.getBoundingClientRect().width)).filter((e=>e>150)).map((e=>{const t=n.getOr(Po()),o=window.innerWidth-(d-t.left),r=Math.max(Math.min(e,o),150);return ou()?Math.max(l.y-Vt(r.element)+i,0):l.bottom),(e=>{var t;const o=qo(e),n=null!==(t=e.dom.scrollTop)&&void 0!==t?t:0,s=Xe(e,bt())?Math.max(l.y-Vt(r.element)+i,0):l.y-o.y+n-Vt(r.element)+i;return u()?s:l.bottom}))+"px"};Dt(s.outerContainer.element,{...g,...m})}))})(a,i),i.each((e=>{Fo(e.left,o.top)}))}c&&r.on(o),y()},C=()=>!(l||!c||!f())&&r.get().exists((o=>{const n=m.getDockingMode(),a=(o=>{switch(Nv(e)){case WB.auto:const e=kR.getToolbar(s.outerContainer),n=v(e),r=Vt(o.element)-n,a=qo(t);if(a.y>r)return"top";{const e=tt(t),o=Math.max(e.dom.scrollHeight,Vt(e));return a.bottom{Wi.setModes(e,[i]),m.setDockingMode(i);const t=u()?Ed.TopToBottom:Ed.BottomToTop;xt(e.element,Td,t)})),!0);var i}));return{isVisible:f,isPositionedAtTop:u,show:()=>{p.set(!0),At(s.outerContainer.element,"display","flex"),i.addClass(e.getBody(),"mce-edit-focus"),F(a,(e=>{It(e.element,"display")})),C(),fb(e)?x((e=>Wi.isDocked(e)?Wi.reset(e):Wi.refresh(e))):x(Wi.refresh)},hide:()=>{p.set(!1),At(s.outerContainer.element,"display","none"),i.removeClass(e.getBody(),"mce-edit-focus"),F(a,(e=>{At(e.element,"display","none")}))},update:x,updateMode:()=>{C()&&x(Wi.reset)},repositionPopups:y}},GB=(e,t)=>{const o=qo(e);return{pos:t?o.y:o.bottom,bounds:o}};var KB=Object.freeze({__proto__:null,render:(e,t,o,n,r)=>{const{mainUi:s}=t,a=en(),i=Be.fromDom(r.targetNode),l=qB(e,i,t,n,a),c=Lv(e);BR(e);const d=()=>{if(a.isSet())return void l.show();a.set(kR.getHeader(s.outerContainer).getOrDie());const r=gb(e);fb(e)?(Ym(i,s.mothership),Ym(i,t.popupUi.mothership)):Km(r,s.mothership),Km(r,t.dialogUi.mothership);const d=()=>{HB(e,t,o,n),kR.setMenubar(s.outerContainer,TR(e,o)),l.show(),((e,t,o,n)=>{const r=Xo(GB(t,o.isPositionedAtTop())),s=n=>{const{pos:s,bounds:a}=GB(t,o.isPositionedAtTop()),{pos:i,bounds:l}=r.get(),c=a.height!==l.height||a.width!==l.width;r.set({pos:s,bounds:a}),c&&KC(e,n),o.isVisible()&&(i!==s?o.update(Wi.reset):c&&(o.updateMode(),o.repositionPopups()))};n||(e.on("activate",o.show),e.on("deactivate",o.hide)),e.on("SkinLoaded ResizeWindow",(()=>o.update(Wi.reset))),e.on("NodeChange keydown",(e=>{requestAnimationFrame((()=>s(e)))}));let a=0;const i=WT((()=>o.update(Wi.refresh)),33);e.on("ScrollWindow",(()=>{const e=Po().left;e!==a&&(a=e,i.throttle()),o.updateMode()})),fb(e)&&e.on("ElementScroll",(e=>{o.update(Wi.refresh)}));const l=Qo();l.set(sd(Be.fromDom(e.getBody()),"load",(e=>s(e.raw)))),e.on("remove",(()=>{l.clear()}))})(e,i,l,c),e.nodeChanged()};c?e.once("SkinLoaded",d):d()};e.on("show",d),e.on("hide",l.hide),c||(e.on("focus",d),e.on("blur",l.hide)),e.on("init",(()=>{(e.hasFocus()||c)&&d()})),eC(e,t);const m={show:d,hide:l.hide,setEnabled:e=>{Qx(t,!e)},isEnabled:()=>!Jg.isDisabled(s.outerContainer)};return{editorContainer:s.outerContainer.element.dom,api:m}}});const YB="contexttoolbar-hide",XB=(e,t)=>ea(fO,((o,n)=>{const r=(e=>({hide:()=>Ws(e,Ts()),getValue:()=>Au.getValue(e)}))(e.get(o));t.onAction(r,n.event.buttonApi)})),JB=(e,t,o)=>(e=>"contextformtogglebutton"===e.type)(t)?((e,t,o)=>{const{primary:n,...r}=t.original,s=rr(xx({...r,type:"togglebutton",onAction:v}));return TB(s,o,[XB(e,t)])})(e,t,o):((e,t,o)=>{const{primary:n,...r}=t.original,s=rr(bx({...r,type:"button",onAction:v}));return EB(s,o,[XB(e,t)])})(e,t,o),QB=(e,t)=>{const o=e.label.fold((()=>({})),(e=>({"aria-label":e}))),n=Eb(xw.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:e.initValue(),inputAttributes:o,selectOnFocus:!0,inputBehaviours:xa([sf.config({mode:"special",onEnter:e=>r.findPrimary(e).map((e=>(qs(e),!0))),onLeft:(e,t)=>(t.cut(),A.none()),onRight:(e,t)=>(t.cut(),A.none())})])})),r=((e,t,o)=>{const n=P(t,(t=>Eb(JB(e,t,o))));return{asSpecs:()=>P(n,(e=>e.asSpec())),findPrimary:e=>re(t,((t,o)=>t.primary?A.from(n[o]).bind((t=>t.getOpt(e))).filter(k(Jg.isDisabled)):A.none()))}})(n,e.commands,t);return[{title:A.none(),items:[n.asSpec()]},{title:A.none(),items:r.asSpecs()}]},eL=QB,tL=(e,t,o)=>t.bottom-e.y>=o&&e.bottom-t.y>=o,oL=e=>{const t=(e=>{const t=e.getBoundingClientRect();if(t.height<=0&&t.width<=0){const o=dt(Be.fromDom(e.startContainer),e.startOffset).element;return(je(o)?nt(o):A.some(o)).filter(Ue).map((e=>e.dom.getBoundingClientRect())).getOr(t)}return t})(e.selection.getRng());if(e.inline){const e=Po();return $o(e.left+t.left,e.top+t.top,t.width,t.height)}{const o=Go(Be.fromDom(e.getBody()));return $o(o.x+t.left,o.y+t.top,t.width,t.height)}},nL=(e,t,o,n=0)=>{const r=Vo(window),s=qo(Be.fromDom(e.getContentAreaContainer())),a=nb(e)||ib(e)||cb(e),{x:i,width:l}=((e,t,o)=>{const n=Math.max(e.x+o,t.x);return{x:n,width:Math.min(e.right-o,t.right)-n}})(s,r,n);if(e.inline&&!a)return $o(i,r.y,l,r.height);{const a=t.header.isPositionedAtTop(),{y:c,bottom:d}=((e,t,o,n,r,s)=>{const a=Be.fromDom(e.getContainer()),i=Yl(a,".tox-editor-header").getOr(a),l=qo(i),c=l.y>=t.bottom,d=n&&!c;if(e.inline&&d)return{y:Math.max(l.bottom+s,o.y),bottom:o.bottom};if(e.inline&&!d)return{y:o.y,bottom:Math.min(l.y-s,o.bottom)};const m="line"===r?qo(a):t;return d?{y:Math.max(l.bottom+s,o.y),bottom:Math.min(m.bottom-s,o.bottom)}:{y:Math.max(m.y+s,o.y),bottom:Math.min(l.y-s,o.bottom)}})(e,s,r,a,o,n);return $o(i,c,l,d-c)}},rL={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"],inset:["tox-pop--inset"]},sL={maxHeightFunction:vd(),maxWidthFunction:TN()},aL=e=>"node"===e,iL=(e,t,o,n,r)=>{const s=oL(e),a=n.lastElement().exists((e=>Xe(o,e)));if(((e,t)=>{const o=e.selection.getRng(),n=dt(Be.fromDom(o.startContainer),o.startOffset);return o.startContainer===o.endContainer&&o.startOffset===o.endOffset-1&&Xe(n.element,t)})(e,o))return a?ED:xD;if(a)return((e,t,o)=>{const n=Bt(e,"position");At(e,"position",t);const r=o(e);return n.each((t=>At(e,"position",t))),r})(t,n.getMode(),(()=>tL(s,qo(t),-20)&&!n.isReposition()?OD:ED));return("fixed"===n.getMode()?r.y+Po().top:r.y)+(Vt(t)+12)<=s.y?xD:CD},lL=(e,t,o,n)=>{const r=t=>(n,r,s,a,i)=>({...iL(e,a,t,o,i)({...n,y:i.y,height:i.height},r,s,a,i),alwaysFit:!0}),s=e=>aL(n)?[r(e)]:[];return t?{onLtr:e=>[_c,wc,xc,Cc,Sc,kc].concat(s(e)),onRtl:e=>[_c,xc,wc,Sc,Cc,kc].concat(s(e))}:{onLtr:e=>[kc,_c,Cc,wc,Sc,xc].concat(s(e)),onRtl:e=>[kc,_c,Sc,xc,Cc,wc].concat(s(e))}},cL=(e,t)=>{const o=V(t,(t=>t.predicate(e.dom))),{pass:n,fail:r}=z(o,(e=>"contexttoolbar"===e.type));return{contextToolbars:n,contextForms:r}},dL=(e,t,o)=>{const n=cL(e,t);if(n.contextForms.length>0)return A.some({elem:e,toolbars:[n.contextForms[0]]});{const t=cL(e,o);if(t.contextForms.length>0)return A.some({elem:e,toolbars:[t.contextForms[0]]});if(n.contextToolbars.length>0||t.contextToolbars.length>0){const o=(e=>{if(e.length<=1)return e;{const t=t=>L(e,(e=>e.position===t)),o=t=>V(e,(e=>e.position===t)),n=t("selection"),r=t("node");if(n||r){if(r&&n){const e=o("node"),t=P(o("selection"),(e=>({...e,position:"node"})));return e.concat(t)}return o(n?"selection":"node")}return o("line")}})(n.contextToolbars.concat(t.contextToolbars));return A.some({elem:e,toolbars:o})}return A.none()}},mL=(e,t,o)=>e(t)?A.none():jr(t,(e=>{if(Ue(e)){const{contextToolbars:t,contextForms:n}=cL(e,o.inNodeScope),r=n.length>0?n:(e=>{if(e.length<=1)return e;{const t=t=>j(e,(e=>e.position===t)),o=t("selection").orThunk((()=>t("node"))).orThunk((()=>t("line"))).map((e=>e.position));return o.fold((()=>[]),(t=>V(e,(e=>e.position===t))))}})(t);return r.length>0?A.some({elem:e,toolbars:r}):A.none()}return A.none()}),e),uL=(e,t)=>{const o={},n=[],r=[],s={},a={},i=(e,i)=>{const l=rr(nr("ContextForm",Ox,i));o[e]=l,l.launch.map((o=>{s["form:"+e]={...i.launch,type:"contextformtogglebutton"===o.type?"togglebutton":"button",onAction:()=>{t(l)}}})),"editor"===l.scope?r.push(l):n.push(l),a[e]=l},l=(e,t)=>{var o;(o=t,nr("ContextToolbar",Ax,o)).each((o=>{"editor"===t.scope?r.push(o):n.push(o),a[e]=o}))},c=se(e);return F(c,(t=>{const o=e[t];"contextform"===o.type?i(t,o):"contexttoolbar"===o.type&&l(t,o)})),{forms:o,inNodeScope:n,inEditorScope:r,lookupTable:a,formNavigators:s}},gL=Xi("forward-slide"),hL=Xi("backward-slide"),pL=Xi("change-slide-event"),fL="tox-pop--resizing",vL="tox-pop--transition",bL=(e,t,o,n)=>{const r=n.backstage,s=r.shared,a=To().deviceType.isTouch,i=en(),l=en(),c=en(),d=zl((e=>{const t=Xo([]);return lv.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:e=>{t.set([]),lv.getContent(e).each((e=>{It(e.element,"visibility")})),Ba(e.element,fL),It(e.element,"width")},inlineBehaviours:xa([ff("context-toolbar-events",[ia(hs(),((e,t)=>{"width"===t.event.raw.propertyName&&(Ba(e.element,fL),It(e.element,"width"))})),ea(pL,((e,t)=>{const o=e.element;It(o,"width");const n=Kt(o);lv.setContent(e,t.event.contents),Na(o,fL);const r=Kt(o);At(o,"width",n+"px"),lv.getContent(e).each((e=>{t.event.focus.bind((e=>(Pc(e),Zc(o)))).orThunk((()=>(sf.focusIn(e),Vc(ut(o)))))})),setTimeout((()=>{At(e.element,"width",r+"px")}),0)})),ea(gL,((e,o)=>{lv.getContent(e).each((o=>{t.set(t.get().concat([{bar:o,focus:Vc(ut(e.element))}]))})),$s(e,pL,{contents:o.event.forwardContents,focus:A.none()})})),ea(hL,((e,o)=>{oe(t.get()).each((o=>{t.set(t.get().slice(0,t.get().length-1)),$s(e,pL,{contents:Vl(o.bar),focus:o.focus})}))}))]),sf.config({mode:"special",onEscape:o=>oe(t.get()).fold((()=>e.onEscape()),(e=>(Ws(o,hL),A.some(!0))))})]),lazySink:()=>rn.value(e.sink)})})({sink:o,onEscape:()=>(e.focus(),A.some(!0))})),m=()=>{const t=c.get().getOr("node"),o=aL(t)?1:0;return nL(e,s,t,o)},u=()=>!(e.removed||a()&&r.isContextMenuOpen()),g=()=>{if(u()){const t=m(),o=ye(c.get(),"node")?((e,t)=>t.filter((e=>vt(e)&&Ze(e))).map(Go).getOrThunk((()=>oL(e))))(e,i.get()):oL(e);return t.height<=0||!tL(o,t,.01)}return!0},h=()=>{i.clear(),l.clear(),c.clear(),lv.hide(d)},p=()=>{if(lv.isOpen(d)){const e=d.element;It(e,"display"),g()?At(e,"display","none"):(l.set(0),lv.reposition(d))}},f=t=>({dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:xa([sf.config({mode:"acyclic"}),ff("pop-dialog-wrap-events",[la((t=>{e.shortcuts.add("ctrl+F9","focus statusbar",(()=>sf.focusIn(t)))})),ca((t=>{e.shortcuts.remove("ctrl+F9")}))])])}),b=Xt((()=>uL(t,(e=>{const t=y([e]);$s(d,gL,{forwardContents:f(t)})})))),y=t=>{const{buttons:o}=e.ui.registry.getAll(),r={...o,...b().formNavigators},a=Dv(e)===cv.scrolling?cv.scrolling:cv.default,i=$(P(t,(t=>"contexttoolbar"===t.type?((t,o)=>LB(e,{buttons:t,toolbar:o.items,allowToolbarGroups:!1},n.backstage,A.some(["form:"])))(r,t):((e,t)=>eL(e,t))(t,s.providers))));return JN({type:a,uid:Xi("context-toolbar"),initGroups:i,onEscape:A.none,cyclicKeying:!0,providers:s.providers})},w=(t,n)=>{const r="node"===t?s.anchors.node(n):s.anchors.cursor(),c=((e,t,o,n)=>"line"===t?{bubble:xd(12,0,rL),layouts:{onLtr:()=>[Ec],onRtl:()=>[Tc]},overrides:sL}:{bubble:xd(0,12,rL,1/12),layouts:lL(e,o,n,t),overrides:sL})(e,t,a(),{lastElement:i.get,isReposition:()=>ye(l.get(),0),getMode:()=>Hm.getMode(o)});return Sn(r,c)},x=(e,t)=>{if(S.cancel(),!u())return;const n=y(e),r=e[0].position,s=w(r,t);c.set(r),l.set(1);const a=d.element;It(a,"display"),(e=>ye(xe(e,i.get(),Xe),!0))(t)||(Ba(a,vL),Hm.reset(o,d)),lv.showWithinBounds(d,f(n),{anchor:s,transition:{classes:[vL],mode:"placement"}},(()=>A.some(m()))),t.fold(i.clear,i.set),g()&&At(a,"display","none")};let C=!1;const S=WT((()=>{if(e.hasFocus()&&!e.removed&&!C)if(Ha(d.element,vL))S.throttle();else{((e,t)=>{const o=Be.fromDom(t.getBody()),n=e=>Xe(e,o),r=Be.fromDom(t.selection.getNode());return(e=>!n(e)&&!Je(o,e))(r)?A.none():dL(r,e.inNodeScope,e.inEditorScope).orThunk((()=>mL(n,r,e)))})(b(),e).fold(h,(e=>{x(e.toolbars,A.some(e.elem))}))}}),17);e.on("init",(()=>{e.on("remove",h),e.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",p),e.on("click keyup focus SetContent",S.throttle),e.on(YB,h),e.on("contexttoolbar-show",(t=>{const o=b();fe(o.lookupTable,t.toolbarKey).each((o=>{x([o],Se(t.target!==e,t.target)),lv.getContent(d).each(sf.focusIn)}))})),e.on("focusout",(t=>{mv.setEditorTimeout(e,(()=>{Zc(o.element).isNone()&&Zc(d.element).isNone()&&h()}),0)})),e.on("SwitchMode",(()=>{e.mode.isReadOnly()&&h()})),e.on("ExecCommand",(({command:e})=>{"toggleview"===e.toLowerCase()&&h()})),e.on("AfterProgressState",(t=>{t.state?h():e.hasFocus()&&S.throttle()})),e.on("dragstart",(()=>{C=!0})),e.on("dragend drop",(()=>{C=!1})),e.on("NodeChange",(e=>{Zc(d.element).fold(S.throttle,v)}))}))},yL=(e,t)=>{const o=()=>{const o=t.getOptions(e),n=t.getCurrent(e).map(t.hash),r=en();return P(o,(o=>({type:"togglemenuitem",text:t.display(o),onSetup:s=>{const a=e=>{e&&(r.on((e=>e.setActive(!1))),r.set(s)),s.setActive(e)};a(ye(n,t.hash(o)));const i=t.watcher(e,o,a);return()=>{r.clear(),i()}},onAction:()=>t.setCurrent(e,o)})))};e.ui.registry.addMenuButton(t.name,{tooltip:t.text,icon:t.icon,fetch:e=>e(o()),onSetup:t.onToolbarSetup}),e.ui.registry.addNestedMenuItem(t.name,{type:"nestedmenuitem",text:t.text,getSubmenuItems:o,onSetup:t.onMenuSetup})},wL=e=>({name:"lineheight",text:"Line height",icon:"line-height",getOptions:ab,hash:e=>((e,t)=>nB(e,t).map((({value:e,unit:t})=>e+t)))(e,["fixed","relative","empty"]).getOr(e),display:x,watcher:(e,t,o)=>e.formatter.formatChanged("lineheight",o,!1,{value:t}).unbind,getCurrent:e=>A.from(e.queryCommandValue("LineHeight")),setCurrent:(e,t)=>e.execCommand("LineHeight",!1,t),onToolbarSetup:QC(e),onMenuSetup:QC(e)}),xL=e=>{yL(e,wL(e)),(e=>A.from(Ov(e)).map((t=>({name:"language",text:"Language",icon:"language",getOptions:w(t),hash:e=>m(e.customCode)?e.code:`${e.code}/${e.customCode}`,display:e=>e.title,watcher:(e,t,o)=>{var n;return e.formatter.formatChanged("lang",o,!1,{value:t.code,customValue:null!==(n=t.customCode)&&void 0!==n?n:null}).unbind},getCurrent:e=>{const t=Be.fromDom(e.selection.getNode());return Wr(t,(e=>A.some(e).filter(Ue).bind((e=>kt(e,"lang").map((t=>({code:t,customCode:kt(e,"data-mce-lang").getOrUndefined(),title:""})))))))},setCurrent:(e,t)=>e.execCommand("Lang",!1,t),onToolbarSetup:t=>{const o=Qo();return t.setActive(e.formatter.match("lang",{},void 0,!0)),o.set(e.formatter.formatChanged("lang",t.setActive,!0)),JC(o.clear,QC(e)(t))},onMenuSetup:QC(e)}))))(e).each((t=>yL(e,t)))},CL=(e,t)=>{((e,t)=>{const o=IR(t,jR(e));e.ui.registry.addNestedMenuItem("align",{text:t.shared.providers.translate("Align"),onSetup:QC(e),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})})(e,t),((e,t)=>{const o=IR(t,eB(e));e.ui.registry.addNestedMenuItem("fontfamily",{text:t.shared.providers.translate("Fonts"),onSetup:QC(e),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})})(e,t),((e,t)=>{const o={type:"advanced",...t.styles},n=IR(t,hB(e,o));e.ui.registry.addNestedMenuItem("styles",{text:"Formats",onSetup:QC(e),getSubmenuItems:()=>n.items.validateItems(n.getStyleItems())})})(e,t),((e,t)=>{const o=IR(t,GR(e));e.ui.registry.addNestedMenuItem("blocks",{text:"Blocks",onSetup:QC(e),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})})(e,t),((e,t)=>{const o=IR(t,uB(e));e.ui.registry.addNestedMenuItem("fontsize",{text:"Font sizes",onSetup:QC(e),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})})(e,t)},SL=e=>tS(e,"NodeChange",(t=>{t.setEnabled(e.queryCommandState("outdent")&&e.selection.isEditable())})),kL=e=>{(e=>{e.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:SL(e),onAction:nS(e,"outdent")}),e.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onSetup:QC(e),onAction:nS(e,"indent")})})(e)},_L=(e,t)=>o=>{o.setActive(t.get());const n=e=>{t.set(e.state),o.setActive(e.state)};return e.on("PastePlainTextToggle",n),JC((()=>e.off("PastePlainTextToggle",n)),QC(e)(o))},EL=(e,t)=>()=>{e.execCommand("mceToggleFormat",!1,t)},TL=e=>{(e=>{UT.each([{name:"bold",text:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],((t,o)=>{e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:eS(e,t.name),onAction:EL(e,t.name),shortcut:t.shortcut})}));for(let t=1;t<=6;t++){const o="h"+t,n=`Access+${t}`;e.ui.registry.addToggleButton(o,{text:o.toUpperCase(),tooltip:"Heading "+t,onSetup:eS(e,o),onAction:EL(e,o),shortcut:n})}})(e),(e=>{UT.each([{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"help",text:"Help",action:"mceHelp",icon:"help",shortcut:"Alt+0"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"print",text:"Print",action:"mcePrint",icon:"print",shortcut:"Meta+P"}],(t=>{e.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:nS(e,t.action),shortcut:t.shortcut})})),UT.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],(t=>{e.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:QC(e),onAction:nS(e,t.action)})}))})(e),(e=>{UT.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(t=>{e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:nS(e,t.action),onSetup:eS(e,t.name)})}))})(e)},OL=e=>{TL(e),(e=>{UT.each([{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"},{name:"print",text:"Print...",action:"mcePrint",icon:"print",shortcut:"Meta+P"}],(t=>{e.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onAction:nS(e,t.action)})})),UT.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],(t=>{e.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onSetup:QC(e),onAction:nS(e,t.action)})})),e.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onSetup:QC(e),onAction:EL(e,"code")})})(e)},AL=(e,t)=>tS(e,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(o=>{o.setEnabled(!e.mode.isReadOnly()&&e.undoManager[t]())})),DL=e=>{(e=>{e.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:AL(e,"hasUndo"),onAction:nS(e,"undo")}),e.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:AL(e,"hasRedo"),onAction:nS(e,"redo")})})(e),(e=>{e.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",enabled:!1,onSetup:AL(e,"hasUndo"),onAction:nS(e,"undo"),shortcut:"Meta+Z"}),e.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",enabled:!1,onSetup:AL(e,"hasRedo"),onAction:nS(e,"redo"),shortcut:"Meta+Y"})})(e)},ML=e=>tS(e,"VisualAid",(t=>{t.setActive(e.hasVisual)})),NL=e=>{(e=>{e.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:nS(e,"mceToggleVisualAid")})})(e),(e=>{e.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:ML(e),onAction:nS(e,"mceToggleVisualAid")})})(e)},RL=(e,t)=>{(e=>{F([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],(t=>{e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:nS(e,t.cmd),onSetup:eS(e,t.name)})})),e.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onSetup:QC(e),onAction:nS(e,"JustifyNone")})})(e),OL(e),CL(e,t),DL(e),(e=>{(e=>{e.addCommand("mceApplyTextcolor",((t,o)=>{((e,t,o)=>{e.undoManager.transact((()=>{e.focus(),e.formatter.apply(t,{value:o}),e.nodeChanged()}))})(e,t,o)})),e.addCommand("mceRemoveTextcolor",(t=>{((e,t)=>{e.undoManager.transact((()=>{e.focus(),e.formatter.remove(t,{value:null},void 0,!0),e.nodeChanged()}))})(e,t)}))})(e);const t=SS(e),o=kS(e),n=Xo(t),r=Xo(o);LS(e,"forecolor","forecolor",n),LS(e,"backcolor","hilitecolor",r),HS(e,"forecolor","forecolor","Text color",n),HS(e,"backcolor","hilitecolor","Background color",r)})(e),NL(e),kL(e),xL(e),(e=>{const t=Xo(Xv(e)),o=()=>e.execCommand("mceTogglePlainTextPaste");e.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:o,onSetup:_L(e,t)}),e.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:o,onSetup:_L(e,t)})})(e)},BL=e=>s(e)?e.split(/[ ,]/):e,LL=e=>t=>t.options.get(e),HL=LL("contextmenu_never_use_native"),IL=LL("contextmenu_avoid_overlap"),PL=e=>{const t=e.ui.registry.getAll().contextMenus,o=e.options.get("contextmenu");return e.options.isSet("contextmenu")?o:V(o,(e=>ve(t,e)))},FL=(e,t)=>({type:"makeshift",x:e,y:t}),zL=e=>"longpress"===e.type||0===e.type.indexOf("touch"),VL=(e,t)=>{const o=uv.DOM.getPos(e);return((e,t,o)=>FL(e.x+t,e.y+o))(t,o.x,o.y)},ZL=(e,t)=>"contextmenu"===t.type||"longpress"===t.type?e.inline?(e=>{if(zL(e)){const t=e.touches[0];return FL(t.pageX,t.pageY)}return FL(e.pageX,e.pageY)})(t):VL(e.getContentAreaContainer(),(e=>{if(zL(e)){const t=e.touches[0];return FL(t.clientX,t.clientY)}return FL(e.clientX,e.clientY)})(t)):UL(e),UL=e=>({type:"selection",root:Be.fromDom(e.selection.getNode())}),jL=(e,t,o)=>{switch(o){case"node":return(e=>({type:"node",node:A.some(Be.fromDom(e.selection.getNode())),root:Be.fromDom(e.getBody())}))(e);case"point":return ZL(e,t);case"selection":return UL(e)}},WL=(e,t,o,n,r,s)=>{const a=o(),i=jL(e,t,s);MO(a,Jy.CLOSE_ON_EXECUTE,n,{isHorizontalMenu:!1,search:A.none()}).map((e=>{t.preventDefault(),lv.showMenuAt(r,{anchor:i},{menu:{markers:gw("normal")},data:e})}))},$L={onLtr:()=>[_c,wc,xc,Cc,Sc,kc,xD,CD,wD,bD,yD,vD],onRtl:()=>[_c,xc,wc,Sc,Cc,kc,xD,CD,yD,vD,wD,bD]},qL={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},GL=(e,t,o,n,r,s,a)=>{const i=((e,t,o)=>{const n=jL(e,t,o);return{bubble:xd(0,"point"===o?12:0,qL),layouts:$L,overrides:{maxWidthFunction:TN(),maxHeightFunction:vd()},...n}})(e,t,s);MO(o,Jy.CLOSE_ON_EXECUTE,n,{isHorizontalMenu:!0,search:A.none()}).map((o=>{t.preventDefault();const l=a?sv.HighlightMenuAndItem:sv.HighlightNone;lv.showMenuWithinBounds(r,{anchor:i},{menu:{markers:gw("normal"),highlightOnOpen:l},data:o,type:"horizontal"},(()=>A.some(nL(e,n.shared,"node"===s?"node":"selection")))),e.dispatch(YB)}))},KL=(e,t,o,n,r,s)=>{const a=To(),i=a.os.isiOS(),l=a.os.isMacOS(),c=a.os.isAndroid(),d=a.deviceType.isTouch(),m=()=>{const a=o();GL(e,t,a,n,r,s,!(c||i||l&&d))};if((l||i)&&"node"!==s){const o=()=>{(e=>{const t=e.selection.getRng(),o=()=>{mv.setEditorTimeout(e,(()=>{e.selection.setRng(t)}),10),s()};e.once("touchend",o);const n=e=>{e.preventDefault(),e.stopImmediatePropagation()};e.on("mousedown",n,!0);const r=()=>s();e.once("longpresscancel",r);const s=()=>{e.off("touchend",o),e.off("longpresscancel",r),e.off("mousedown",n)}})(e),m()};((e,t)=>{const o=e.selection;if(o.isCollapsed()||t.touches.length<1)return!1;{const n=t.touches[0],r=o.getRng();return lm(e.getWin(),Gd.domRange(r)).exists((e=>e.left<=n.clientX&&e.right>=n.clientX&&e.top<=n.clientY&&e.bottom>=n.clientY))}})(e,t)?o():(e.once("selectionchange",o),e.once("touchend",(()=>e.off("selectionchange",o))))}else m()},YL=e=>s(e)?"|"===e:"separator"===e.type,XL={type:"separator"},JL=e=>{const t=e=>({text:e.text,icon:e.icon,enabled:e.enabled,shortcut:e.shortcut});if(s(e))return e;switch(e.type){case"separator":return XL;case"submenu":return{type:"nestedmenuitem",...t(e),getSubmenuItems:()=>{const t=e.getSubmenuItems();return s(t)?t:P(t,JL)}};default:const o=e;return{type:"menuitem",...t(o),onAction:b(o.onAction)}}},QL=(e,t)=>{if(0===t.length)return e;const o=oe(e).filter((e=>!YL(e))),n=o.fold((()=>[]),(e=>[XL]));return e.concat(n).concat(t).concat([XL])},eH=(e,t)=>!(e=>"longpress"===e.type||ve(e,"touches"))(t)&&(2!==t.button||t.target===e.getBody()&&""===t.pointerType),tH=(e,t)=>eH(e,t)?e.selection.getStart(!0):t.target,oH=(e,t,o)=>{const n=To().deviceType.isTouch,r=zl(lv.sketch({dom:{tag:"div"},lazySink:t,onEscape:()=>e.focus(),onShow:()=>o.setContextMenuState(!0),onHide:()=>o.setContextMenuState(!1),fireDismissalEventInstead:{},inlineBehaviours:xa([ff("dismissContextMenu",[ea(Hs(),((t,o)=>{cu.close(t),e.focus()}))])])})),a=()=>lv.hide(r),i=t=>{if(HL(e)&&t.preventDefault(),((e,t)=>t.ctrlKey&&!HL(e))(e,t)||(e=>0===PL(e).length)(e))return;const a=((e,t)=>{const o=IL(e),n=eH(e,t)?"selection":"point";if(De(o)){const r=tH(e,t);return Pk(Be.fromDom(r),o)?"node":n}return n})(e,t);(n()?KL:WL)(e,t,(()=>{const o=tH(e,t),n=e.ui.registry.getAll(),r=PL(e);return((e,t,o)=>{const n=U(t,((t,n)=>fe(e,n.toLowerCase()).map((e=>{const n=e.update(o);if(s(n)&&De(Ae(n)))return QL(t,n.split(" "));if(l(n)&&n.length>0){const e=P(n,JL);return QL(t,e)}return t})).getOrThunk((()=>t.concat([n])))),[]);return n.length>0&&YL(n[n.length-1])&&n.pop(),n})(n.contextMenus,r,o)}),o,r,a)};e.on("init",(()=>{const t="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(n()?"":" ResizeWindow");e.on(t,a),e.on("longpress contextmenu",i)}))},nH=Pr([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),rH=e=>t=>t.translate(-e.left,-e.top),sH=e=>t=>t.translate(e.left,e.top),aH=e=>(t,o)=>U(e,((e,t)=>t(e)),jt(t,o)),iH=(e,t,o)=>e.fold(aH([sH(o),rH(t)]),aH([rH(t)]),aH([])),lH=(e,t,o)=>e.fold(aH([sH(o)]),aH([]),aH([sH(t)])),cH=(e,t,o)=>e.fold(aH([]),aH([rH(o)]),aH([sH(t),rH(o)])),dH=(e,t,o)=>{const n=e.fold(((e,t)=>({position:A.some("absolute"),left:A.some(e+"px"),top:A.some(t+"px")})),((e,t)=>({position:A.some("absolute"),left:A.some(e-o.left+"px"),top:A.some(t-o.top+"px")})),((e,t)=>({position:A.some("fixed"),left:A.some(e+"px"),top:A.some(t+"px")})));return{right:A.none(),bottom:A.none(),...n}},mH=(e,t,o,n)=>{const r=(e,r)=>(s,a)=>{const i=e(t,o,n);return r(s.getOr(i.left),a.getOr(i.top))};return e.fold(r(cH,uH),r(lH,gH),r(iH,hH))},uH=nH.offset,gH=nH.absolute,hH=nH.fixed,pH=(e,t)=>{const o=St(e,t);return m(o)?NaN:parseInt(o,10)},fH=(e,t,o,n)=>((e,t)=>{const o=e.element,n=pH(o,t.leftAttr),r=pH(o,t.topAttr);return isNaN(n)||isNaN(r)?A.none():A.some(jt(n,r))})(e,t).fold((()=>o),(e=>hH(e.left+n.left,e.top+n.top))),vH=(e,t,o,n,r,s)=>{const a=fH(e,t,o,n),i=t.mustSnap?wH(e,t,a,r,s):xH(e,t,a,r,s),l=iH(a,r,s);return((e,t,o)=>{const n=e.element;xt(n,t.leftAttr,o.left+"px"),xt(n,t.topAttr,o.top+"px")})(e,t,l),i.fold((()=>({coord:hH(l.left,l.top),extra:A.none()})),(e=>({coord:e.output,extra:e.extra})))},bH=(e,t)=>{((e,t)=>{const o=e.element;Et(o,t.leftAttr),Et(o,t.topAttr)})(e,t)},yH=(e,t,o,n)=>re(e,(e=>{const r=e.sensor,s=((e,t,o,n,r,s)=>{const a=lH(e,r,s),i=lH(t,r,s);return Math.abs(a.left-i.left)<=o&&Math.abs(a.top-i.top)<=n})(t,r,e.range.left,e.range.top,o,n);return s?A.some({output:mH(e.output,t,o,n),extra:e.extra}):A.none()})),wH=(e,t,o,n,r)=>{const s=t.getSnapPoints(e);return yH(s,o,n,r).orThunk((()=>{const e=U(s,((e,t)=>{const s=t.sensor,a=((e,t,o,n,r,s)=>{const a=lH(e,r,s),i=lH(t,r,s),l=Math.abs(a.left-i.left),c=Math.abs(a.top-i.top);return jt(l,c)})(o,s,t.range.left,t.range.top,n,r);return e.deltas.fold((()=>({deltas:A.some(a),snap:A.some(t)})),(o=>(a.left+a.top)/2<=(o.left+o.top)/2?{deltas:A.some(a),snap:A.some(t)}:e))}),{deltas:A.none(),snap:A.none()});return e.snap.map((e=>({output:mH(e.output,o,n,r),extra:e.extra})))}))},xH=(e,t,o,n,r)=>{const s=t.getSnapPoints(e);return yH(s,o,n,r)};var CH=Object.freeze({__proto__:null,snapTo:(e,t,o,n)=>{const r=t.getTarget(e.element);if(t.repositionTarget){const t=Qe(e.element),o=Po(t),s=Ua(r),a=((e,t,o)=>({coord:mH(e.output,e.output,t,o),extra:e.extra}))(n,o,s),i=dH(a.coord,0,s);Mt(r,i)}}});const SH="data-initial-z-index",kH=(e,t)=>{e.getSystem().addToGui(t),(e=>{nt(e.element).filter(Ue).each((t=>{Bt(t,"z-index").each((e=>{xt(t,SH,e)})),At(t,"z-index",Nt(e.element,"z-index"))}))})(t)},_H=e=>{(e=>{nt(e.element).filter(Ue).each((e=>{kt(e,SH).fold((()=>It(e,"z-index")),(t=>At(e,"z-index",t))),Et(e,SH)}))})(e),e.getSystem().removeFromGui(e)},EH=(e,t,o)=>e.getSystem().build(Xk.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[t]},events:o}));var TH=Or("snaps",[ur("getSnapPoints"),Ii("onSensor"),ur("leftAttr"),ur("topAttr"),Ar("lazyViewport",Yo),Ar("mustSnap",!1)]);const OH=[Ar("useFixed",T),ur("blockerClass"),Ar("getTarget",x),Ar("onDrag",v),Ar("repositionTarget",!0),Ar("onDrop",v),Lr("getBounds",Yo),TH],AH=e=>((e,t,o,n)=>e.isSome()&&t.isSome()&&o.isSome()?A.some(n(e.getOrDie(),t.getOrDie(),o.getOrDie())):A.none())(Bt(e,"left"),Bt(e,"top"),Bt(e,"position"),((e,t,o)=>("fixed"===o?hH:uH)(parseInt(e,10),parseInt(t,10)))).getOrThunk((()=>{const t=$t(e);return gH(t.left,t.top)})),DH=(e,t,o,n,r,s,a)=>((e,t,o,n,r)=>{const s=r.bounds,a=lH(t,o,n),i=Ki(a.left,s.x,s.x+s.width-r.width),l=Ki(a.top,s.y,s.y+s.height-r.height),c=gH(i,l);return t.fold((()=>{const e=cH(c,o,n);return uH(e.left,e.top)}),w(c),(()=>{const e=iH(c,o,n);return hH(e.left,e.top)}))})(0,t.fold((()=>{const e=(t=o,a=s.left,i=s.top,t.fold(((e,t)=>uH(e+a,t+i)),((e,t)=>gH(e+a,t+i)),((e,t)=>hH(e+a,t+i))));var t,a,i;const l=iH(e,n,r);return hH(l.left,l.top)}),(t=>{const a=vH(e,t,o,s,n,r);return a.extra.each((o=>{t.onSensor(e,o)})),a.coord})),n,r,a),MH=(e,t)=>({bounds:e.getBounds(),height:Zt(t.element),width:Yt(t.element)}),NH=(e,t,o,n,r)=>{const s=o.update(n,r),a=o.getStartData().getOrThunk((()=>MH(t,e)));s.each((o=>{((e,t,o,n)=>{const r=t.getTarget(e.element);if(t.repositionTarget){const s=Qe(e.element),a=Po(s),i=Ua(r),l=AH(r),c=DH(e,t.snaps,l,a,i,n,o),d=dH(c,0,i);Mt(r,d)}t.onDrag(e,r,n)})(e,t,a,o)}))},RH=(e,t,o,n)=>{t.each(_H),o.snaps.each((t=>{bH(e,t)}));const r=o.getTarget(e.element);n.reset(),o.onDrop(e,r)},BH=e=>(t,o)=>{const n=e=>{o.setStartData(MH(t,e))};return Xs([ea(Ns(),(e=>{o.getStartData().each((()=>n(e)))})),...e(t,o,n)])};var LH=Object.freeze({__proto__:null,getData:e=>A.from(jt(e.x,e.y)),getDelta:(e,t)=>jt(t.left-e.left,t.top-e.top)});const HH=(e,t,o)=>[ea(ts(),((n,r)=>{if(0!==r.event.raw.button)return;r.stop();const s=()=>RH(n,A.some(l),e,t),a=Fk(s,200),i={drop:s,delayDrop:a.schedule,forceDrop:s,move:o=>{a.cancel(),NH(n,e,t,LH,o)}},l=EH(n,e.blockerClass,(e=>Xs([ea(ts(),e.forceDrop),ea(rs(),e.drop),ea(os(),((t,o)=>{e.move(o.event)})),ea(ns(),e.delayDrop)]))(i));o(n),kH(n,l)}))],IH=[...OH,Vi("dragger",{handlers:BH(HH)})];var PH=Object.freeze({__proto__:null,getData:e=>{const t=e.raw.touches;return 1===t.length?(e=>{const t=e[0];return A.some(jt(t.clientX,t.clientY))})(t):A.none()},getDelta:(e,t)=>jt(t.left-e.left,t.top-e.top)});const FH=(e,t,o)=>{const n=en(),r=o=>{RH(o,n.get(),e,t),n.clear()};return[ea(Xr(),((s,a)=>{a.stop();const i=()=>r(s),l={drop:i,delayDrop:v,forceDrop:i,move:o=>{NH(s,e,t,PH,o)}},c=EH(s,e.blockerClass,(e=>Xs([ea(Xr(),e.forceDrop),ea(Qr(),e.drop),ea(es(),e.drop),ea(Jr(),((t,o)=>{e.move(o.event)}))]))(l));n.set(c);o(s),kH(s,c)})),ea(Jr(),((o,n)=>{n.stop(),NH(o,e,t,PH,n.event)})),ea(Qr(),((e,t)=>{t.stop(),r(e)})),ea(es(),r)]},zH=IH,VH=[...OH,Vi("dragger",{handlers:BH(FH)})],ZH=[...OH,Vi("dragger",{handlers:BH(((e,t,o)=>[...HH(e,t,o),...FH(e,t,o)]))})];var UH=Object.freeze({__proto__:null,mouse:zH,touch:VH,mouseOrTouch:ZH});var jH=Object.freeze({__proto__:null,init:()=>{let e=A.none(),t=A.none();const o=w({});return wa({readState:o,reset:()=>{e=A.none(),t=A.none()},update:(t,o)=>t.getData(o).bind((o=>((t,o)=>{const n=e.map((e=>t.getDelta(e,o)));return e=A.some(o),n})(t,o))),getStartData:()=>t,setStartData:e=>{t=A.some(e)}})}});const WH=_a({branchKey:"mode",branches:UH,name:"dragging",active:{events:(e,t)=>e.dragger.handlers(e,t)},extra:{snap:e=>({sensor:e.sensor,range:e.range,output:e.output,extra:A.from(e.extra)})},state:jH,apis:CH}),$H=(e,t,o,n,r,s)=>e.fold((()=>WH.snap({sensor:gH(o-20,n-20),range:jt(r,s),output:gH(A.some(o),A.some(n)),extra:{td:t}})),(e=>{const r=o-20,s=n-20,a=e.element.dom.getBoundingClientRect();return WH.snap({sensor:gH(r,s),range:jt(40,40),output:gH(A.some(o-a.width/2),A.some(n-a.height/2)),extra:{td:t}})})),qH=(e,t,o)=>({getSnapPoints:e,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:(e,n)=>{const r=n.td;((e,t)=>e.exists((e=>Xe(e,t))))(t.get(),r)||(t.set(r),o(r))},mustSnap:!0}),GH=e=>Eb(kb.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:xa([WH.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:e}),T_.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}})),KH=(e,t)=>{const o=Xo([]),n=Xo([]),r=Xo(!1),s=en(),a=en(),i=e=>{const o=Go(e);return $H(m.getOpt(t),e,o.x,o.y,o.width,o.height)},l=e=>{const o=Go(e);return $H(u.getOpt(t),e,o.right,o.bottom,o.width,o.height)},c=qH((()=>P(o.get(),(e=>i(e)))),s,(t=>{a.get().each((o=>{e.dispatch("TableSelectorChange",{start:t,finish:o})}))})),d=qH((()=>P(n.get(),(e=>l(e)))),a,(t=>{s.get().each((o=>{e.dispatch("TableSelectorChange",{start:o,finish:t})}))})),m=GH(c),u=GH(d),g=zl(m.asSpec()),h=zl(u.asSpec()),p=(t,o,n,r)=>{const s=n(o);WH.snapTo(t,s);((t,o,n,r)=>{const s=o.dom.getBoundingClientRect();It(t.element,"display");const a=ot(Be.fromDom(e.getBody())).dom.innerHeight,i=n(s),l=r(s,a);(i||l)&&At(t.element,"display","none")})(t,o,(e=>e[r]<0),((e,t)=>e[r]>t))},f=e=>p(g,e,i,"top"),v=e=>p(h,e,l,"bottom");if(To().deviceType.isTouch()){const i=e=>P(e,Be.fromDom);e.on("TableSelectionChange",(e=>{r.get()||(jm(t,g),jm(t,h),r.set(!0));const l=Be.fromDom(e.start),c=Be.fromDom(e.finish);s.set(l),a.set(c),A.from(e.otherCells).each((e=>{o.set(i(e.upOrLeftCells)),n.set(i(e.downOrRightCells)),f(l),v(c)}))})),e.on("ResizeEditor ResizeWindow ScrollContent",(()=>{s.get().each(f),a.get().each(v)})),e.on("TableSelectionClear",(()=>{r.get()&&(qm(g),qm(h),r.set(!1)),s.clear(),a.clear()}))}};const YH=(e,t,o)=>{var n;const r=null!==(n=t.delimiter)&&void 0!==n?n:"›",s=(t,n,r)=>kb.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{"data-index":r}},components:[Hl(t)],action:t=>{e.focus(),e.selection.select(n),e.nodeChanged()},buttonBehaviours:xa([zb.config({...o.tooltips.getConfig({tooltipText:o.translate(["Select the {0} element",n.nodeName.toLowerCase()]),onShow:(e,t)=>{((e,t)=>{const o=A.from(St(e,"id")).getOrThunk((()=>{const e=Xi("aria");return xt(t,"id",e),e}));xt(e,"aria-describedby",o)})(e.element,t.element)},onHide:e=>{var t;t=e.element,Et(t,"aria-describedby")}})}),nC(o.isDisabled),tC()])});return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:xa([sf.config({mode:"flow",selector:"div[role=button]"}),Jg.config({disabled:o.isDisabled}),tC(),Ab.config({}),pf.config({}),ff("elementPathEvents",[la(((t,o)=>{e.shortcuts.add("alt+F11","focus statusbar elementpath",(()=>sf.focusIn(t))),e.on("NodeChange",(o=>{const n=(t=>{const o=[];let n=t.length;for(;n-- >0;){const s=t[n];if(1===s.nodeType&&"BR"!==(r=s).nodeName&&!r.getAttribute("data-mce-bogus")&&"bookmark"!==r.getAttribute("data-mce-type")){const t=XC(e,s);if(t.isDefaultPrevented()||o.push({name:t.name,element:s}),t.isPropagationStopped())break}}var r;return o})(o.parents),a=n.length>0?U(n,((e,t,o)=>{const n=s(t.name,t.element,o);return 0===o?e.concat([n]):e.concat([{dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0}},components:[Hl(` ${r} `)]},n])}),[]):[];pf.set(t,a)}))}))])]),components:[]}};var XH;!function(e){e[e.None=0]="None",e[e.Both=1]="Both",e[e.Vertical=2]="Vertical"}(XH||(XH={}));const JH=(e,t,o)=>{const n=Be.fromDom(e.getContainer()),r=((e,t,o,n,r)=>{const s={height:ZB(n+t.top,Cv(e),kv(e))};return o===XH.Both&&(s.width=ZB(r+t.left,xv(e),Sv(e))),s})(e,t,o,Vt(n),Kt(n));ie(r,((e,t)=>{p(e)&&At(n,t,VB(e))})),(e=>{e.dispatch("ResizeEditor")})(e)},QH=(e,t,o,n)=>{const r=jt(20*o,20*n);return JH(e,r,t),A.some(!0)},eI=(e,t)=>{const o=(e=>{const t=Yv(e);return!1===t?XH.None:"both"===t?XH.Both:XH.Vertical})(e);if(o===XH.None)return A.none();const n=o===XH.Both?"Press the arrow keys to resize the editor.":"Press the Up and Down arrow keys to resize the editor.";return A.some($y("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{"aria-label":t.translate(n),"data-mce-name":"resize-handle"},behaviours:[WH.config({mode:"mouse",repositionTarget:!1,onDrag:(t,n,r)=>JH(e,r,o),blockerClass:"tox-blocker"}),sf.config({mode:"special",onLeft:()=>QH(e,o,-1,0),onRight:()=>QH(e,o,1,0),onUp:()=>QH(e,o,0,-1),onDown:()=>QH(e,o,0,1)}),Ab.config({}),xf.config({}),zb.config(t.tooltips.getConfig({tooltipText:t.translate("Resize")}))]},t.icons))},tI=(e,t)=>{const o=()=>{const o=[];return e.hasPlugin("wordcount")&&o.push(((e,t)=>{const o=(e,o,n)=>pf.set(e,[Hl(t.translate(["{0} "+n,o[n]]))]);return kb.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:xa([nC(t.isDisabled),tC(),Ab.config({}),pf.config({}),Au.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),ff("wordcount-events",[ma((e=>{const t=Au.getValue(e),n="words"===t.mode?"characters":"words";Au.setValue(e,{mode:n,count:t.count}),o(e,t.count,n)})),la((t=>{e.on("wordCountUpdate",(e=>{const{mode:n}=Au.getValue(t);Au.setValue(t,{mode:n,count:e.wordCount}),o(t,e.wordCount,n)}))}))])]),eventOrder:{[Ss()]:["disabling","alloy.base.behaviour","wordcount-events"]}})})(e,t)),Kv(e)&&o.push({dom:{tag:"span",classes:["tox-statusbar__branding"]},components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/powered-by-tiny?utm_campaign=poweredby&utm_source=tiny&utm_medium=referral&utm_content=v7",rel:"noopener",target:"_blank","aria-label":e.translate(["Build with {0}","TinyMCE"])},innerHtml:e.translate(["Build with {0}",'\n'.trim()])},behaviours:xa([xf.config({})])}]}),{dom:{tag:"div",classes:["tox-statusbar__right-container"]},components:o}},n=()=>{const n=[],r=eb(e),s=Gv(e),a=Kv(e)||e.hasPlugin("wordcount"),i=()=>{const e="tox-statusbar__text-container--flex-start",t="tox-statusbar__text-container--flex-end";if(r){const o="tox-statusbar__text-container-3-cols";return a||s?a&&!s?[o,t]:[o,e]:[o,"tox-statusbar__text-container--space-around"]}return[a&&!s?t:e]};return s&&n.push(YH(e,{},t)),r&&n.push((()=>{const e=hC("Alt+0");return{dom:{tag:"div",classes:["tox-statusbar__help-text"]},components:[Hl(Iy.translate(["Press {0} for help",e]))]}})()),a&&n.push(o()),n.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container",...i()]},components:n}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(()=>{const o=n(),r=eI(e,t);return o.concat(r.toArray())})()}},oI=(e,t)=>t.get().getOrDie(`UI for ${e} has not been rendered`),nI=(e,t)=>{const o=e.inline,n=o?KB:FB,r=pb(e)?WM:LM,s=(()=>{const e=en(),t=en(),o=en();return{dialogUi:e,popupUi:t,mainUi:o,getUiMotherships:()=>{const o=e.get().map((e=>e.mothership)),n=t.get().map((e=>e.mothership));return o.fold((()=>n.toArray()),(e=>n.fold((()=>[e]),(t=>Xe(e.element,t.element)?[e]:[e,t]))))},lazyGetInOuterOrDie:(e,t)=>()=>o.get().bind((e=>t(e.outerContainer))).getOrDie(`Could not find ${e} element in OuterContainer`)}})(),a=en(),i=en(),l=en(),c=To().deviceType.isTouch()?["tox-platform-touch"]:[],d=db(e),m=Dv(e),u=Eb({dom:{tag:"div",classes:["tox-anchorbar"]}}),g=Eb({dom:{tag:"div",classes:["tox-bottom-anchorbar"]}}),h=()=>s.mainUi.get().map((e=>e.outerContainer)).bind(kR.getHeader),p=s.lazyGetInOuterOrDie("anchor bar",u.getOpt),f=s.lazyGetInOuterOrDie("bottom anchor bar",g.getOpt),v=s.lazyGetInOuterOrDie("toolbar",kR.getToolbar),b=s.lazyGetInOuterOrDie("throbber",kR.getThrobber),y=CM({popup:()=>rn.fromOption(s.popupUi.get().map((e=>e.sink)),"(popup) UI has not been rendered"),dialog:()=>rn.fromOption(s.dialogUi.get().map((e=>e.sink)),"UI has not been rendered")},e,p,f),w=()=>kR.parts.promotion({dom:{tag:"div",classes:["tox-promotion"]}}),x=()=>{const t=(()=>{const t={attributes:{[Td]:d?Ed.BottomToTop:Ed.TopToBottom}},o=kR.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:y.popup,onEscape:()=>{e.focus()}}),n=kR.parts.toolbar({dom:{tag:"div",classes:["tox-toolbar"]},getSink:y.popup.shared.getSink,providers:y.popup.shared.providers,onEscape:()=>{e.focus()},onToolbarToggled:t=>{((e,t)=>{e.dispatch("ToggleToolbarDrawer",{state:t})})(e,t)},type:m,lazyToolbar:v,lazyHeader:()=>h().getOrDie("Could not find header element"),...t}),r=kR.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:y.popup.shared.providers,onEscape:()=>{e.focus()},type:m}),s=cb(e),a=ib(e),i=nb(e),l=Qv(e),c=w(),g=s||a||i,p=l?[c,o]:[o];return kR.parts.header({dom:{tag:"div",classes:["tox-editor-header"].concat(g?[]:["tox-editor-header--empty"]),...t},components:$([i?p:[],s?[r]:a?[n]:[],ub(e)?[]:[u.asSpec()]]),sticky:pb(e),editor:e,sharedBackstage:y.popup.shared})})(),n={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[kR.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),kR.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}})]},r=kR.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:y.popup}),s=kR.parts.viewWrapper({backstage:y.popup}),i=qv(e)&&!o?A.some(tI(e,y.popup.shared.providers)):A.none(),l=$([d?[]:[t],o?[]:[n],d?[t]:[]]),p=kR.parts.editorContainer({components:$([l,o?[]:[g.asSpec()]])}),f=hb(e),b={role:"application",...Iy.isRtl()?{dir:"rtl"}:{},...f?{"aria-hidden":"true"}:{}},x=zl(kR.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(o?["tox-tinymce-inline"]:[]).concat(d?["tox-tinymce--toolbar-bottom"]:[]).concat(c),styles:{visibility:"hidden",...f?{opacity:"0",border:"0"}:{}},attributes:b},components:[p,...o?[]:[s,...i.toArray()],r],behaviours:xa([tC(),Jg.config({disableClass:"tox-tinymce--disabled"}),sf.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])})),C=Jk(x);return a.set(C),{mothership:C,outerContainer:x}},C=t=>{const o=VB(UB(e)),n=VB((e=>jB(e).getOr(wv(e)))(e));return e.inline||(Ht("div","width",n)&&At(t.element,"width",n),Ht("div","height",o)?At(t.element,"height",o):At(t.element,"height","400px")),o},S=t=>{const{mainUi:o,popupUi:s,uiMotherships:a}=t;le(Mv(e),((t,o)=>{e.ui.registry.addGroupToolbarButton(o,t)}));const{buttons:i,menuItems:l,contextToolbars:c,sidebars:d,views:u}=e.ui.registry.getAll(),g=lb(e),p={menuItems:l,menus:vb(e),menubar:Iv(e),toolbar:g.getOrThunk((()=>Pv(e))),allowToolbarGroups:m===cv.floating,buttons:i,sidebar:d,views:u};var f;f=o.outerContainer,e.addShortcut("alt+F9","focus menubar",(()=>{kR.focusMenubar(f)})),e.addShortcut("alt+F10","focus toolbar",(()=>{kR.focusToolbar(f)})),e.addCommand("ToggleToolbarDrawer",((e,t)=>{(null==t?void 0:t.skipFocus)?kR.toggleToolbarDrawerWithoutFocusing(f):kR.toggleToolbarDrawer(f)})),e.addQueryStateHandler("ToggleToolbarDrawer",(()=>kR.isToolbarDrawerToggled(f))),((e,t,o)=>{const n=(e,n)=>{F([t,...o],(t=>{t.broadcastEvent(e,n)}))},r=(e,n)=>{F([t,...o],(t=>{t.broadcastOn([e],n)}))},s=e=>r(du(),{target:e.target}),a=Zo(),i=rd(a,"touchstart",s),l=rd(a,"touchmove",(e=>n(Ds(),e))),c=rd(a,"touchend",(e=>n(Ms(),e))),d=rd(a,"mousedown",s),m=rd(a,"mouseup",(e=>{0===e.raw.button&&r(uu(),{target:e.target})})),u=e=>r(du(),{target:Be.fromDom(e.target)}),g=e=>{0===e.button&&r(uu(),{target:Be.fromDom(e.target)})},h=()=>{F(e.editorManager.get(),(t=>{e!==t&&t.dispatch("DismissPopups",{relatedTarget:e})}))},p=e=>n(Ns(),ad(e)),f=e=>{r(mu(),{}),n(Rs(),ad(e))},v=ut(Be.fromDom(e.getElement())),b=sd(v,"scroll",(o=>{requestAnimationFrame((()=>{if(null!=e.getContainer()){const r=Cb(e,t.element).map((e=>[e.element,...e.others])).getOr([]);L(r,(e=>Xe(e,o.target)))&&(e.dispatch("ElementScroll",{target:o.target.dom}),n(zs(),o))}}))})),y=()=>r(mu(),{}),w=t=>{t.state&&r(du(),{target:Be.fromDom(e.getContainer())})},x=e=>{r(du(),{target:Be.fromDom(e.relatedTarget.getContainer())})},C=t=>e.dispatch("focusin",t),S=t=>e.dispatch("focusout",t);e.on("PostRender",(()=>{e.on("click",u),e.on("tap",u),e.on("mouseup",g),e.on("mousedown",h),e.on("ScrollWindow",p),e.on("ResizeWindow",f),e.on("ResizeEditor",y),e.on("AfterProgressState",w),e.on("DismissPopups",x),F([t,...o],(e=>{e.element.dom.addEventListener("focusin",C),e.element.dom.addEventListener("focusout",S)}))})),e.on("remove",(()=>{e.off("click",u),e.off("tap",u),e.off("mouseup",g),e.off("mousedown",h),e.off("ScrollWindow",p),e.off("ResizeWindow",f),e.off("ResizeEditor",y),e.off("AfterProgressState",w),e.off("DismissPopups",x),F([t,...o],(e=>{e.element.dom.removeEventListener("focusin",C),e.element.dom.removeEventListener("focusout",S)})),d.unbind(),i.unbind(),l.unbind(),c.unbind(),m.unbind(),b.unbind()})),e.on("detach",(()=>{F([t,...o],Jm),F([t,...o],(e=>e.destroy()))}))})(e,o.mothership,a),r.setup(e,y.popup.shared,h),RL(e,y.popup),oH(e,y.popup.shared.getSink,y.popup),(e=>{const{sidebars:t}=e.ui.registry.getAll();F(se(t),(o=>{const n=t[o],r=()=>ye(A.from(e.queryCommandValue("ToggleSidebar")),o);e.ui.registry.addToggleButton(o,{icon:n.icon,tooltip:n.tooltip,onAction:t=>{e.execCommand("ToggleSidebar",!1,o),t.setActive(r())},onSetup:t=>{t.setActive(r());const o=()=>t.setActive(r());return e.on("ToggleSidebar",o),()=>{e.off("ToggleSidebar",o)}}})}))})(e),vN(e,b,y.popup.shared),bL(e,c,s.sink,{backstage:y.popup}),KH(e,s.sink);const v={targetNode:e.getElement(),height:C(o.outerContainer)};return n.render(e,t,p,y.popup,v)};return{popups:{backstage:y.popup,getMothership:()=>oI("popups",l)},dialogs:{backstage:y.dialog,getMothership:()=>oI("dialogs",i)},renderUI:()=>{const o=x(),n=(()=>{const t=gb(e),o=Xe(bt(),t)&&"grid"===Nt(t,"display"),n={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(c),attributes:{...Iy.isRtl()?{dir:"rtl"}:{}}},behaviours:xa([Hm.config({useFixed:()=>r.isDocked(h)})])},s={dom:{styles:{width:document.body.clientWidth+"px"}},events:Xs([ea(Rs(),(e=>{At(e.element,"width",document.body.clientWidth+"px")}))])},a=zl(Sn(n,o?s:{})),l=Jk(a);return i.set(l),{sink:a,mothership:l}})(),a=fb(e)?(()=>{const e={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-silver-popup-sink","tox-tinymce-aux"].concat(c),attributes:{...Iy.isRtl()?{dir:"rtl"}:{}}},behaviours:xa([Hm.config({useFixed:()=>r.isDocked(h),getBounds:()=>t.getPopupSinkBounds()})])},o=zl(e),n=Jk(o);return l.set(n),{sink:o,mothership:n}})():(e=>(l.set(e.mothership),e))(n);s.dialogUi.set(n),s.popupUi.set(a),s.mainUi.set(o);const d={popupUi:a,dialogUi:n,mainUi:o,uiMotherships:s.getUiMotherships()};return S(d)}}},rI=w([ur("lazySink"),xr("dragBlockClass"),Lr("getBounds",Yo),Ar("useTabstopAt",O),Ar("firstTabstop",0),Ar("eventOrder",{}),Du("modalBehaviours",[sf]),Pi("onExecute"),zi("onEscape")]),sI={sketch:x},aI=w([ig({name:"draghandle",overrides:(e,t)=>({behaviours:xa([WH.config({mode:"mouse",getTarget:e=>ql(e,'[role="dialog"]').getOr(e),blockerClass:e.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(t,null,2)).message),getBounds:e.getDragBounds})])})}),sg({schema:[ur("dom")],name:"title"}),sg({factory:sI,schema:[ur("dom")],name:"close"}),sg({factory:sI,schema:[ur("dom")],name:"body"}),ig({factory:sI,schema:[ur("dom")],name:"footer"}),ag({factory:{sketch:(e,t)=>({...e,dom:t.dom,components:t.components})},schema:[Ar("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Ar("components",[])],name:"blocker"})]),iI=Bg({name:"ModalDialog",configFields:rI(),partFields:aI(),factory:(e,t,o,n)=>{const r=en(),s=Xi("modal-events"),a={...e.eventOrder,[Bs()]:[s].concat(e.eventOrder["alloy.system.attached"]||[])},i=To();return{uid:e.uid,dom:e.dom,components:t,apis:{show:t=>{r.set(t);const o=e.lazySink(t).getOrDie(),s=n.blocker(),a=o.getSystem().build({...s,components:s.components.concat([Vl(t)]),behaviours:xa([xf.config({}),ff("dialog-blocker-events",[ia(as(),(()=>{hN.isBlocked(t)||sf.focusIn(t)}))])])});jm(o,a),sf.focusIn(t)},hide:e=>{r.clear(),nt(e.element).each((t=>{e.getSystem().getByDom(t).each((e=>{qm(e)}))}))},getBody:t=>wg(t,e,"body"),getFooter:t=>yg(t,e,"footer"),setIdle:e=>{hN.unblock(e)},setBusy:(e,t)=>{hN.block(e,t)}},eventOrder:a,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Nu(e.modalBehaviours,[pf.config({}),sf.config({mode:"cyclic",onEnter:e.onExecute,onEscape:e.onEscape,useTabstopAt:e.useTabstopAt,firstTabstop:e.firstTabstop}),hN.config({getRoot:r.get}),ff(s,[la((t=>{const o=wg(t,e,"title").element,n=(e=>e.dom.textContent)(o);i.os.isMacOS()&&g(n)?xt(t.element,"aria-label",n):((e,t)=>{const o=kt(e,"id").fold((()=>{const e=Xi("dialog-label");return xt(t,"id",e),e}),x);xt(e,"aria-labelledby",o)})(t.element,o)}))])])}},apis:{show:(e,t)=>{e.show(t)},hide:(e,t)=>{e.hide(t)},getBody:(e,t)=>e.getBody(t),getFooter:(e,t)=>e.getFooter(t),setBusy:(e,t,o)=>{e.setBusy(t,o)},setIdle:(e,t)=>{e.setIdle(t)}}}),lI=zn([Fw,zw].concat(Hx)),cI=Kn,dI=[gx("button"),ex,Rr("align","end",["start","end"]),lx,ix,_r("buttonType",["primary","secondary"])],mI=[...dI,Zw],uI=[fr("type",["submit","cancel","custom"]),...mI],gI=[fr("type",["menu"]),Jw,tx,ex,wr("items",lI),...dI],hI=[...dI,fr("type",["togglebutton"]),tx,ex,Jw,Br("active",!1)],pI=ir("type",{submit:uI,cancel:uI,custom:uI,menu:gI,togglebutton:hI}),fI=[Fw,Zw,fr("level",["info","warn","error","success"]),jw,Ar("url","")],vI=zn(fI),bI=[Fw,Zw,ix,gx("button"),ex,ax,_r("buttonType",["primary","secondary","toolbar"]),lx],yI=zn(bI),wI=[Fw,zw],xI=wI.concat([ox]),CI=wI.concat([Vw,ix]),SI=zn(CI),kI=Kn,_I=xI.concat([cx("auto")]),EI=zn(_I),TI=jn([Ww,Zw,jw]),OI=xI.concat([Nr("storageKey","default")]),AI=zn(OI),DI=Gn,MI=zn(xI),NI=Gn,RI=wI.concat([Nr("tag","textarea"),pr("scriptId"),pr("scriptUrl"),Er("onFocus"),((e,t)=>Dr(e,t,Jn))("settings",void 0)]),BI=wI.concat([Nr("tag","textarea"),vr("init")]),LI=tr((e=>nr("customeditor.old",Fn(BI),e).orThunk((()=>nr("customeditor.new",Fn(RI),e))))),HI=Gn,II=zn(xI),PI=Vn(Rn),FI=e=>[Fw,hr("columns"),e],zI=[Fw,pr("html"),Rr("presets","presentation",["presentation","document"]),Lr("onInit",v),Br("stretched",!1)],VI=zn(zI),ZI=xI.concat([Br("border",!1),Br("sandboxed",!0),Br("streamContent",!1),Br("transparent",!0)]),UI=zn(ZI),jI=Gn,WI=zn(wI.concat([kr("height")])),$I=zn([pr("url"),Sr("zoom"),Sr("cachedWidth"),Sr("cachedHeight")]),qI=xI.concat([kr("inputMode"),kr("placeholder"),Br("maximized",!1),ix]),GI=zn(qI),KI=Gn,YI=e=>[Fw,Vw,e,Rr("align","start",["start","center","end"]),kr("for")],XI=[Zw,Ww],JI=[Zw,wr("items",lr(0,(()=>QI)))],QI=Zn([zn(XI),zn(JI)]),eP=xI.concat([wr("items",QI),ix]),tP=zn(eP),oP=Gn,nP=xI.concat([yr("items",[Zw,Ww]),Mr("size",1),ix]),rP=zn(nP),sP=Gn,aP=xI.concat([Br("constrain",!0),ix]),iP=zn(aP),lP=zn([pr("width"),pr("height")]),cP=wI.concat([Vw,Mr("min",0),Mr("max",0)]),dP=zn(cP),mP=qn,uP=[Fw,wr("header",Gn),wr("cells",Vn(Gn))],gP=zn(uP),hP=xI.concat([kr("placeholder"),Br("maximized",!1),ix]),pP=zn(hP),fP=Gn,vP=[fr("type",["directory","leaf"]),Uw,pr("id"),Cr("menu",GM)],bP=zn(vP),yP=vP.concat([wr("children",lr(0,(()=>er("type",{directory:wP,leaf:bP}))))]),wP=zn(yP),xP=er("type",{directory:wP,leaf:bP}),CP=[Fw,wr("items",xP),Er("onLeafAction"),Er("onToggleExpand"),Hr("defaultExpandedIds",[],Gn),kr("defaultSelectedId")],SP=zn(CP),kP=xI.concat([Rr("filetype","file",["image","media","file"]),ix,kr("picker_text")]),_P=zn(kP),EP=zn([Ww,dx]),TP=e=>cr("items","items",{tag:"required",process:{}},Vn(tr((t=>nr(`Checking item of ${e}`,OP,t).fold((e=>rn.error(ar(e))),(e=>rn.value(e))))))),OP=In((()=>{return er("type",{alertbanner:vI,bar:zn((e=TP("bar"),[Fw,e])),button:yI,checkbox:SI,colorinput:AI,colorpicker:MI,dropzone:II,grid:zn(FI(TP("grid"))),iframe:UI,input:GI,listbox:tP,selectbox:rP,sizeinput:iP,slider:dP,textarea:pP,urlinput:_P,customeditor:LI,htmlpanel:VI,imagepreview:WI,collection:EI,label:zn(YI(TP("label"))),table:gP,tree:SP,panel:DP});var e})),AP=[Fw,Ar("classes",[]),wr("items",OP)],DP=zn(AP),MP=[gx("tab"),Uw,wr("items",OP)],NP=[Fw,yr("tabs",MP)],RP=zn(NP),BP=mI,LP=pI,HP=zn([pr("title"),gr("body",er("type",{panel:DP,tabpanel:RP})),Nr("size","normal"),Hr("buttons",[],LP),Ar("initialData",{}),Lr("onAction",v),Lr("onChange",v),Lr("onSubmit",v),Lr("onClose",v),Lr("onCancel",v),Lr("onTabChange",v)]),IP=zn([fr("type",["cancel","custom"]),...BP]),PP=zn([pr("title"),pr("url"),Sr("height"),Sr("width"),Tr("buttons",IP),Lr("onAction",v),Lr("onCancel",v),Lr("onClose",v),Lr("onMessage",v)]),FP=e=>a(e)?[e].concat(q(pe(e),FP)):l(e)?q(e,FP):[],zP=e=>s(e.type)&&s(e.name),VP={checkbox:kI,colorinput:DI,colorpicker:NI,dropzone:PI,input:KI,iframe:jI,imagepreview:$I,selectbox:sP,sizeinput:lP,slider:mP,listbox:oP,size:lP,textarea:fP,urlinput:EP,customeditor:HI,collection:TI,togglemenuitem:cI},ZP=e=>{const t=(e=>V(FP(e),zP))(e),o=q(t,(e=>(e=>A.from(VP[e.type]))(e).fold((()=>[]),(t=>[gr(e.name,t)]))));return zn(o)},UP=e=>{var t;return{internalDialog:rr(nr("dialog",HP,e)),dataValidator:ZP(e),initialData:null!==(t=e.initialData)&&void 0!==t?t:{}}},jP={open:(e,t)=>{const o=UP(t);return e(o.internalDialog,o.initialData,o.dataValidator)},openUrl:(e,t)=>e(rr(nr("dialog",PP,t))),redial:e=>UP(e)};var WP=Object.freeze({__proto__:null,events:(e,t)=>{const o=(o,n)=>{e.updateState.each((e=>{const r=e(o,n);t.set(r)})),e.renderComponents.each((r=>{const s=r(n,t.get());(e.reuseDom?lf:af)(o,s)}))};return Xs([ea(Cs(),((t,n)=>{const r=n;if(!r.universal){const n=e.channel;B(r.channels,n)&&o(t,r.data)}})),la(((t,n)=>{e.initialData.each((e=>{o(t,e)}))}))])}});var $P=Object.freeze({__proto__:null,getState:(e,t,o)=>o}),qP=[ur("channel"),xr("renderComponents"),xr("updateState"),xr("initialData"),Br("reuseDom",!0)];const GP=Sa({fields:qP,name:"reflecting",active:WP,apis:$P,state:Object.freeze({__proto__:null,init:()=>{const e=Xo(A.none());return{readState:()=>e.get().getOr("none"),get:e.get,set:e.set,clear:()=>e.set(A.none())}}})}),KP=e=>{const t=[],o={};return ie(e,((e,n)=>{e.fold((()=>{t.push(n)}),(e=>{o[n]=e}))})),t.length>0?rn.error(t):rn.value(o)},YP=(e,t,o,n)=>{const r=Eb(CT.sketch((r=>({dom:{tag:"div",classes:["tox-form"].concat(e.classes)},components:P(e.items,(e=>iD(r,e,t,o,n)))}))));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[r.asSpec()]}],behaviours:xa([sf.config({mode:"acyclic",useTabstopAt:k(JT)}),NT(r),LT(r,{postprocess:e=>KP(e).fold((e=>(console.error(e),{})),x)}),ff("dialog-body-panel",[ea(as(),((e,t)=>{e.getSystem().broadcastOn([rO],{newFocus:A.some(t.event.target)})}))])])}},XP=Rg({name:"TabButton",configFields:[Ar("uid",void 0),ur("value"),cr("dom","dom",Tn((()=>({attributes:{role:"tab",id:Xi("aria"),"aria-selected":"false"}}))),Wn()),xr("action"),Ar("domModification",{}),Du("tabButtonBehaviours",[xf,sf,Au]),ur("view")],factory:(e,t)=>({uid:e.uid,dom:e.dom,components:e.components,events:Nf(e.action),behaviours:Nu(e.tabButtonBehaviours,[xf.config({}),sf.config({mode:"execution",useSpace:!0,useEnter:!0}),Au.config({store:{mode:"memory",initialValue:e.value}})]),domModification:e.domModification})}),JP=w([ur("tabs"),ur("dom"),Ar("clickToDismiss",!1),Du("tabbarBehaviours",[ch,sf]),Li(["tabClass","selectedClass"])]),QP=lg({factory:XP,name:"tabs",unit:"tab",overrides:e=>{const t=(e,t)=>{ch.dehighlight(e,t),$s(e,Zs(),{tabbar:e,button:t})},o=(e,t)=>{ch.highlight(e,t),$s(e,Vs(),{tabbar:e,button:t})};return{action:n=>{const r=n.getSystem().getByUid(e.uid).getOrDie(),s=ch.isHighlighted(r,n);(s&&e.clickToDismiss?t:s?v:o)(r,n)},domModification:{classes:[e.markers.tabClass]}}}}),eF=w([QP]),tF=Bg({name:"Tabbar",configFields:JP(),partFields:eF(),factory:(e,t,o,n)=>({uid:e.uid,dom:e.dom,components:t,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Nu(e.tabbarBehaviours,[ch.config({highlightClass:e.markers.selectedClass,itemClass:e.markers.tabClass,onHighlight:(e,t)=>{xt(t.element,"aria-selected","true")},onDehighlight:(e,t)=>{xt(t.element,"aria-selected","false")}}),sf.config({mode:"flow",getInitial:e=>ch.getHighlighted(e).map((e=>e.element)),selector:"."+e.markers.tabClass,executeOnMove:!0})])})}),oF=Rg({name:"Tabview",configFields:[Du("tabviewBehaviours",[pf])],factory:(e,t)=>({uid:e.uid,dom:e.dom,behaviours:Nu(e.tabviewBehaviours,[pf.config({})]),domModification:{attributes:{role:"tabpanel"}}})}),nF=w([Ar("selectFirst",!0),Ii("onChangeTab"),Ii("onDismissTab"),Ar("tabs",[]),Du("tabSectionBehaviours",[])]),rF=sg({factory:tF,schema:[ur("dom"),br("markers",[ur("tabClass"),ur("selectedClass")])],name:"tabbar",defaults:e=>({tabs:e.tabs})}),sF=sg({factory:oF,name:"tabview"}),aF=w([rF,sF]),iF=Bg({name:"TabSection",configFields:nF(),partFields:aF(),factory:(e,t,o,n)=>{const r=(t,o)=>{yg(t,e,"tabbar").each((e=>{o(e).each(qs)}))};return{uid:e.uid,dom:e.dom,components:t,behaviours:Mu(e.tabSectionBehaviours),events:Xs($([e.selectFirst?[la(((e,t)=>{r(e,ch.getFirst)}))]:[],[ea(Vs(),((t,o)=>{(t=>{const o=Au.getValue(t);yg(t,e,"tabview").each((n=>{const r=j(e.tabs,(e=>e.value===o));r.each((o=>{const r=o.view();kt(t.element,"id").each((e=>{xt(n.element,"aria-labelledby",e)})),pf.set(n,r),e.onChangeTab(n,t,r)}))}))})(o.event.button)})),ea(Zs(),((t,o)=>{const n=o.event.button;e.onDismissTab(t,n)}))]])),apis:{getViewItems:t=>yg(t,e,"tabview").map((e=>pf.contents(e))).getOr([]),showTab:(e,t)=>{r(e,(e=>{const o=ch.getCandidates(e);return j(o,(e=>Au.getValue(e)===t)).filter((t=>!ch.isHighlighted(e,t)))}))}}}},apis:{getViewItems:(e,t)=>e.getViewItems(t),showTab:(e,t,o)=>{e.showTab(t,o)}}}),lF=(e,t)=>{At(e,"height",t+"px"),At(e,"flex-basis",t+"px")},cF=(e,t,o)=>{ql(e,'[role="dialog"]').each((e=>{Yl(e,'[role="tablist"]').each((n=>{o.get().map((o=>(At(t,"height","0"),At(t,"flex-basis","0"),Math.min(o,((e,t,o)=>{const n=tt(e).dom,r=ql(e,".tox-dialog-wrap").getOr(e);let s;s="fixed"===Nt(r,"position")?Math.max(n.clientHeight,window.innerHeight):Math.max(n.offsetHeight,n.scrollHeight);const a=Vt(t),i=t.dom.offsetLeft>=o.dom.offsetLeft+Kt(o)?Math.max(Vt(o),a):a,l=parseInt(Nt(e,"margin-top"),10)||0,c=parseInt(Nt(e,"margin-bottom"),10)||0;return s-(Vt(e)+l+c-i)})(e,t,n))))).each((e=>{lF(t,e)}))}))}))},dF=e=>Yl(e,'[role="tabpanel"]'),mF=e=>{const t=en(),o=[la((o=>{const n=o.element;dF(n).each((r=>{At(r,"visibility","hidden"),o.getSystem().getByDom(r).toOptional().each((o=>{const n=((e,t,o)=>P(e,((n,r)=>{pf.set(o,e[r].view());const s=t.dom.getBoundingClientRect();return pf.set(o,[]),s.height})))(e,r,o),s=(e=>te(Q(e,((e,t)=>e>t?-1:e{te(e).each((e=>iF.showTab(t,e.value)))})(e,o),requestAnimationFrame((()=>{cF(n,r,t)}))}))})),ea(Rs(),(e=>{const o=e.element;dF(o).each((e=>{cF(o,e,t)}))})),ea(p_,((e,o)=>{const n=e.element;dF(n).each((e=>{const o=Vc(ut(e));At(e,"visibility","hidden");const r=Bt(e,"height").map((e=>parseInt(e,10)));It(e,"height"),It(e,"flex-basis");const s=e.dom.getBoundingClientRect().height;r.forall((e=>s>e))?(t.set(s),cF(n,e,t)):r.each((t=>{lF(e,t)})),It(e,"visibility"),o.each(Pc)}))}))];return{extraEvents:o,selectFirst:!1}},uF="send-data-to-section",gF="send-data-to-view",hF=(e,t,o,n)=>{const r=Xo({}),s=e=>{const t=Au.getValue(e),o=KP(t).getOr({}),n=r.get(),s=Sn(n,o);r.set(s)},a=e=>{const t=r.get();Au.setValue(e,t)},i=Xo(null),l=P(e.tabs,(e=>({value:e.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"]},components:[Hl(o.shared.providers.translate(e.title))],view:()=>[CT.sketch((r=>({dom:{tag:"div",classes:["tox-form"]},components:P(e.items,(e=>iD(r,e,t,o,n))),formBehaviours:xa([sf.config({mode:"acyclic",useTabstopAt:k(JT)}),ff("TabView.form.events",[la(a),ca(s)]),Hc.config({channels:Vr([{key:uF,value:{onReceive:s}},{key:gF,value:{onReceive:a}}])})])})))]}))),c=mF(l);return iF.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:(e,t,o)=>{const n=Au.getValue(t);$s(e,h_,{name:n,oldName:i.get()}),i.set(n)},tabs:l,components:[iF.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[tF.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:xa([Ab.config({})])}),iF.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:c.selectFirst,tabSectionBehaviours:xa([ff("tabpanel",c.extraEvents),sf.config({mode:"acyclic"}),Pg.config({find:e=>te(iF.getViewItems(e))}),HT(A.none(),(e=>(e.getSystem().broadcastOn([uF],{}),r.get())),((e,t)=>{r.set(t),e.getSystem().broadcastOn([gF],{})}))])})},pF=(e,t,o,n,r,s)=>({dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:{...o.map((e=>({id:e}))).getOr({}),...r?{"aria-live":"polite"}:{}}},components:[],behaviours:xa([RT(0),GP.config({channel:`${tO}-${t}`,updateState:(e,t)=>A.some({isTabPanel:()=>"tabpanel"===t.body.type}),renderComponents:e=>{const t=e.body;return"tabpanel"===t.type?[hF(t,e.initialData,n,s)]:[YP(t,e.initialData,n,s)]},initialData:e})])}),fF=hv.deviceType.isTouch(),vF=(e,t)=>({dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[e,t]}),bF=(e,t)=>iI.parts.close(kb.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close")}},action:e,buttonBehaviours:xa([Ab.config({})])})),yF=()=>iI.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}}),wF=(e,t)=>iI.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:_b(`

    ${Hy(t.translate(e))}

    `)}]}]}),xF=e=>iI.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:e}),CF=(e,t)=>[Xk.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:e}),Xk.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:t})],SF=e=>{const t="tox-dialog",o=t+"-wrap",n=o+"__backdrop",r=t+"__disable-scroll";return iI.sketch({lazySink:e.lazySink,onEscape:t=>(e.onEscape(t),A.some(!0)),useTabstopAt:e=>!JT(e),firstTabstop:e.firstTabstop,dom:{tag:"div",classes:[t].concat(e.extraClasses),styles:{position:"relative",...e.extraStyles}},components:[e.header,e.body,...e.footer.toArray()],parts:{blocker:{dom:_b(`
    `),components:[{dom:{tag:"div",classes:fF?[n,n+"--opaque"]:[n]}}]}},dragBlockClass:o,modalBehaviours:xa([xf.config({}),ff("dialog-events",e.dialogEvents.concat([ia(as(),((e,t)=>{hN.isBlocked(e)||sf.focusIn(e)})),ea(Ps(),((e,t)=>{e.getSystem().broadcastOn([rO],{newFocus:t.event.newFocus})}))])),ff("scroll-lock",[la((()=>{Na(bt(),r)})),ca((()=>{Ba(bt(),r)}))]),...e.extraBehaviours]),eventOrder:{[Ss()]:["dialog-events"],[Bs()]:["scroll-lock","dialog-events","alloy.base.behaviour"],[Ls()]:["alloy.base.behaviour","dialog-events","scroll-lock"],...e.eventOrder}})},kF=e=>kb.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close"),"data-mce-name":"close"}},buttonBehaviours:xa([Ab.config({}),zb.config(e.tooltips.getConfig({tooltipText:e.translate("Close")}))]),components:[$y("close",{tag:"span",classes:["tox-icon"]},e.icons)],action:e=>{Ws(e,c_)}}),_F=(e,t,o,n)=>({dom:{tag:"h1",classes:["tox-dialog__title"],attributes:{...o.map((e=>({id:e}))).getOr({})}},components:[],behaviours:xa([GP.config({channel:`${eO}-${t}`,initialData:e,renderComponents:e=>[Hl(n.translate(e.title))]})])}),EF=()=>({dom:_b('
    ')}),TF=(e,t,o)=>((e,t,o)=>{const n=iI.parts.title(_F(e,t,A.none(),o)),r=iI.parts.draghandle(EF()),s=iI.parts.close(kF(o)),a=[n].concat(e.draggable?[r]:[]).concat([s]);return Xk.sketch({dom:_b('
    '),components:a})})({title:o.shared.providers.translate(e),draggable:o.dialog.isDraggableModal()},t,o.shared.providers),OF=(e,t,o,n)=>({dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":o.translate(e)},styles:{left:"0px",right:"0px",bottom:"0px",top:`${n.getOr(0)}px`,position:"absolute"}},behaviours:t,components:[{dom:_b('
    ')}]}),AF=(e,t,o)=>({onClose:()=>o.closeWindow(),onBlock:o=>{const n=Yl(e().element,".tox-dialog__header").map((e=>Vt(e)));iI.setBusy(e(),((e,r)=>OF(o.message,r,t,n)))},onUnblock:()=>{iI.setIdle(e())}}),DF="tox-dialog--fullscreen",MF="tox-dialog--width-lg",NF="tox-dialog--width-md",RF=e=>{switch(e){case"large":return A.some(MF);case"medium":return A.some(NF);default:return A.none()}},BF=(e,t)=>{const o=Be.fromDom(t.element.dom);Ha(o,DF)||(Pa(o,[MF,NF]),RF(e).each((e=>Na(o,e))))},LF=(e,t)=>{const o=Be.fromDom(e.element.dom),n=Fa(o),r=j(n,(e=>e===MF||e===NF)).or(RF(t));((e,t)=>{F(t,(t=>{La(e,t)}))})(o,[DF,...r.toArray()])},HF=(e,t,o)=>zl(SF({...e,firstTabstop:1,lazySink:o.shared.getSink,extraBehaviours:[PT({}),...e.extraBehaviours],onEscape:e=>{Ws(e,c_)},dialogEvents:t,eventOrder:{[Cs()]:[GP.name(),Hc.name()],[Bs()]:["scroll-lock",GP.name(),"messages","dialog-events","alloy.base.behaviour"],[Ls()]:["alloy.base.behaviour","dialog-events","messages",GP.name(),"scroll-lock"]}})),IF=(e,t={})=>P(e,(e=>"menu"===e.type?(e=>{const o=P(e.items,(e=>{const o=fe(t,e.name).getOr(Xo(!1));return{...e,storage:o}}));return{...e,items:o}})(e):e)),PF=e=>U(e,((e,t)=>{if("menu"===t.type){return U(t.items,((e,t)=>(e[t.name]=t.storage,e)),e)}return e}),{}),FF=(e,t)=>[ra(as(),XT),e(l_,((e,o,n,r)=>{Vc(ut(r.element)).fold(v,Fc),t.onClose(),o.onClose()})),e(c_,((e,t,o,n)=>{t.onCancel(e),Ws(n,l_)})),ea(g_,((e,o)=>t.onUnblock())),ea(u_,((e,o)=>t.onBlock(o.event)))],zF=(e,t,o)=>{const n=(t,o)=>ea(t,((t,n)=>{r(t,((r,s)=>{o(e(),r,n.event,t)}))})),r=(e,t)=>{GP.getState(e).get().each((o=>{t(o.internalDialog,e)}))};return[...FF(n,t),n(m_,((e,t)=>t.onSubmit(e))),n(i_,((e,t,o)=>{t.onChange(e,{name:o.name})})),n(d_,((e,t,n,r)=>{const s=()=>r.getSystem().isConnected()?sf.focusIn(r):void 0,a=e=>_t(e,"disabled")||kt(e,"aria-disabled").exists((e=>"true"===e)),i=ut(r.element),l=Vc(i);t.onAction(e,{name:n.name,value:n.value}),Vc(i).fold(s,(e=>{a(e)||l.exists((t=>Je(e,t)&&a(t)))?s():o().toOptional().filter((t=>!Je(t.element,e))).each(s)}))})),n(h_,((e,t,o)=>{t.onTabChange(e,{newTabName:o.name,oldTabName:o.oldName})})),ca((t=>{const o=e();Au.setValue(t,o.getData())}))]},VF=(e,t)=>{const o=t.map((e=>e.footerButtons)).getOr([]),n=z(o,(e=>"start"===e.align)),r=(e,t)=>Xk.sketch({dom:{tag:"div",classes:[`tox-dialog__footer-${e}`]},components:P(t,(e=>e.memento.asSpec()))});return[r("start",n.pass),r("end",n.fail)]},ZF=(e,t,o)=>({dom:_b(''),components:[],behaviours:xa([GP.config({channel:`${oO}-${t}`,initialData:e,updateState:(e,t)=>{const n=P(t.buttons,(e=>{const t=Eb(((e,t)=>UA(e,e.type,t))(e,o));return{name:e.name,align:e.align,memento:t}}));return A.some({lookupByName:t=>((e,t,o)=>j(t,(e=>e.name===o)).bind((t=>t.memento.getOpt(e))))(e,n,t),footerButtons:n})},renderComponents:VF})])}),UF=(e,t,o)=>iI.parts.footer(ZF(e,t,o)),jF=(e,t)=>{if(e.getRoot().getSystem().isConnected()){const o=Pg.getCurrent(e.getFormWrapper()).getOr(e.getFormWrapper());return CT.getField(o,t).orThunk((()=>{const o=e.getFooter().bind((e=>GP.getState(e).get()));return o.bind((e=>e.lookupByName(t)))}))}return A.none()},WF=(e,t,o)=>{const n=t=>{const o=e.getRoot();o.getSystem().isConnected()&&t(o)},r={getData:()=>{const t=e.getRoot(),n=t.getSystem().isConnected()?e.getFormWrapper():t;return{...Au.getValue(n),...le(o,(e=>e.get()))}},setData:t=>{n((n=>{const s=r.getData(),a=Sn(s,t),i=((e,t)=>{const o=e.getRoot();return GP.getState(o).get().map((e=>rr(nr("data",e.dataValidator,t)))).getOr(t)})(e,a),l=e.getFormWrapper();Au.setValue(l,i),ie(o,((e,t)=>{ve(a,t)&&e.set(a[t])}))}))},setEnabled:(t,o)=>{jF(e,t).each(o?Jg.enable:Jg.disable)},focus:t=>{jF(e,t).each(xf.focus)},block:e=>{if(!s(e))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");n((t=>{$s(t,u_,{message:e})}))},unblock:()=>{n((e=>{Ws(e,g_)}))},showTab:t=>{n((o=>{const n=e.getBody();GP.getState(n).get().exists((e=>e.isTabPanel()))&&Pg.getCurrent(n).each((e=>{iF.showTab(e,t)}))}))},redial:s=>{n((n=>{const a=e.getId(),i=t(s),l=IF(i.internalDialog.buttons,o);n.getSystem().broadcastOn([`${QT}-${a}`],i),n.getSystem().broadcastOn([`${eO}-${a}`],i.internalDialog),n.getSystem().broadcastOn([`${tO}-${a}`],i.internalDialog),n.getSystem().broadcastOn([`${oO}-${a}`],{...i.internalDialog,buttons:l}),r.setData(i.initialData)}))},close:()=>{n((e=>{Ws(e,l_)}))},toggleFullscreen:e.toggleFullscreen};return r},$F=(e,t,o)=>{const n=Xi("dialog"),r=e.internalDialog,s=TF(r.title,n,o),a=Xo(r.size),i=RF(a.get()).toArray(),l=((e,t,o,n)=>{const r=pF(e,t,A.none(),o,!1,n);return iI.parts.body(r)})({body:r.body,initialData:r.initialData},n,o,(e=>jF(p,e))),c=IF(r.buttons),d=PF(c),m=Se(0!==c.length,UF({buttons:c},n,o)),u=zF((()=>f),AF((()=>h),o.shared.providers,t),o.shared.getSink),g={id:n,header:s,body:l,footer:m,extraClasses:i,extraBehaviours:[GP.config({channel:`${QT}-${n}`,updateState:(e,t)=>(a.set(t.internalDialog.size),BF(t.internalDialog.size,e),A.some(t)),initialData:e})],extraStyles:{}},h=HF(g,u,o),p={getId:w(n),getRoot:w(h),getBody:()=>iI.getBody(h),getFooter:()=>iI.getFooter(h),getFormWrapper:()=>{const e=iI.getBody(h);return Pg.getCurrent(e).getOr(e)},toggleFullscreen:()=>{LF(h,a.get())}},f=WF(p,t.redial,d);return{dialog:h,instanceApi:f}},qF=(e,t,o,n=!1,r)=>{const s=Xi("dialog"),a=Xi("dialog-label"),i=Xi("dialog-content"),l=e.internalDialog,c=Xo(l.size),d=RF(c.get()).toArray(),m=Eb(((e,t,o,n)=>Xk.sketch({dom:_b('
    '),components:[_F(e,t,A.some(o),n),EF(),kF(n)],containerBehaviours:xa([WH.config({mode:"mouse",blockerClass:"blocker",getTarget:e=>Xl(e,'[role="dialog"]').getOrDie(),snaps:{getSnapPoints:()=>[],leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))({title:l.title,draggable:!0},s,a,o.shared.providers)),u=Eb(((e,t,o,n,r,s)=>pF(e,t,A.some(o),n,r,s))({body:l.body,initialData:l.initialData},s,i,o,n,(e=>jF(y,e)))),g=IF(l.buttons),h=PF(g),p=Se(0!==g.length,Eb(((e,t,o)=>ZF(e,t,o))({buttons:g},s,o))),f=zF((()=>x),{onBlock:e=>{hN.block(b,((t,n)=>{const r=m.getOpt(b).map((e=>Vt(e.element)));return OF(e.message,n,o.shared.providers,r)}))},onUnblock:()=>{hN.unblock(b)},onClose:()=>t.closeWindow()},o.shared.getSink),v=To().os,b=zl({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline",...d],attributes:{role:"dialog",...v.isMacOS()?{"aria-label":l.title}:{"aria-labelledby":a}}},eventOrder:{[Cs()]:[GP.name(),Hc.name()],[Ss()]:["execute-on-form"],[Bs()]:["reflecting","execute-on-form"]},behaviours:xa([sf.config({mode:"cyclic",onEscape:e=>(Ws(e,l_),A.some(!0)),useTabstopAt:e=>!JT(e)&&("button"!==ze(e)||"disabled"!==St(e,"disabled")),firstTabstop:1}),GP.config({channel:`${QT}-${s}`,updateState:(e,t)=>(c.set(t.internalDialog.size),BF(t.internalDialog.size,e),r(),A.some(t)),initialData:e}),xf.config({}),ff("execute-on-form",f.concat([ia(as(),((e,t)=>{sf.focusIn(e)})),ea(Ps(),((e,t)=>{e.getSystem().broadcastOn([rO],{newFocus:t.event.newFocus})}))])),hN.config({getRoot:()=>A.some(b)}),pf.config({}),PT({})]),components:[m.asSpec(),u.asSpec(),...p.map((e=>e.asSpec())).toArray()]}),y={getId:w(s),getRoot:w(b),getFooter:()=>p.map((e=>e.get(b))),getBody:()=>u.get(b),getFormWrapper:()=>{const e=u.get(b);return Pg.getCurrent(e).getOr(e)},toggleFullscreen:()=>{LF(b,c.get())}},x=WF(y,t.redial,h);return{dialog:b,instanceApi:x}};var GF=tinymce.util.Tools.resolve("tinymce.util.URI");const KF=["insertContent","setContent","execCommand","close","block","unblock"],YF=e=>a(e)&&-1!==KF.indexOf(e.mceAction),XF=(e,t,o,n)=>{const r=Xi("dialog"),i=TF(e.title,r,n),l=(e=>{const t={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[KT(A.none(),{dom:{tag:"iframe",attributes:{src:e.url}},behaviours:xa([Ab.config({}),xf.config({})])})]}],behaviours:xa([sf.config({mode:"acyclic",useTabstopAt:k(JT)})])};return iI.parts.body(t)})(e),c=e.buttons.bind((e=>0===e.length?A.none():A.some(UF({buttons:e},r,n)))),m=((e,t)=>{const o=(t,o)=>ea(t,((t,r)=>{n(t,((n,s)=>{o(e(),n,r.event,t)}))})),n=(e,t)=>{GP.getState(e).get().each((o=>{t(o,e)}))};return[...FF(o,t),o(d_,((e,t,o)=>{t.onAction(e,{name:o.name})}))]})((()=>w),AF((()=>y),n.shared.providers,t)),u={...e.height.fold((()=>({})),(e=>({height:e+"px","max-height":e+"px"}))),...e.width.fold((()=>({})),(e=>({width:e+"px","max-width":e+"px"})))},h=e.width.isNone()&&e.height.isNone()?["tox-dialog--width-lg"]:[],p=new GF(e.url,{base_uri:new GF(window.location.href)}),f=`${p.protocol}://${p.host}${p.port?":"+p.port:""}`,v=Qo(),b=[GP.config({channel:`${QT}-${r}`,updateState:(e,t)=>A.some(t),initialData:e}),ff("messages",[la((()=>{const t=rd(Be.fromDom(window),"message",(t=>{if(p.isSameOrigin(new GF(t.raw.origin))){const n=t.raw.data;YF(n)?((e,t,o)=>{switch(o.mceAction){case"insertContent":e.insertContent(o.content);break;case"setContent":e.setContent(o.content);break;case"execCommand":const n=!!d(o.ui)&&o.ui;e.execCommand(o.cmd,n,o.value);break;case"close":t.close();break;case"block":t.block(o.message);break;case"unblock":t.unblock()}})(o,w,n):(e=>!YF(e)&&a(e)&&ve(e,"mceAction"))(n)&&e.onMessage(w,n)}}));v.set(t)})),ca(v.clear)]),Hc.config({channels:{[nO]:{onReceive:(e,t)=>{Yl(e.element,"iframe").each((e=>{const o=e.dom.contentWindow;g(o)&&o.postMessage(t,f)}))}}}})],y=HF({id:r,header:i,body:l,footer:c,extraClasses:h,extraBehaviours:b,extraStyles:u},m,n),w=(e=>{const t=t=>{e.getSystem().isConnected()&&t(e)};return{block:e=>{if(!s(e))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t((t=>{$s(t,u_,{message:e})}))},unblock:()=>{t((e=>{Ws(e,g_)}))},close:()=>{t((e=>{Ws(e,l_)}))},sendMessage:e=>{t((t=>{t.getSystem().broadcastOn([nO],e)}))}}})(y);return{dialog:y,instanceApi:w}},JF=(e,t)=>rr(nr("data",t,e)),QF=e=>Pk(e,".tox-alert-dialog")||Pk(e,".tox-confirm-dialog"),ez=(e,t,o)=>t&&o?[]:[Wi.config({contextual:{lazyContext:()=>A.some(qo(Be.fromDom(e.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"],lazyViewport:t=>Cb(e,t.element).map((e=>({bounds:Sb(e),optScrollEnv:A.some({currentScrollTop:e.element.dom.scrollTop,scrollElmTop:$t(e.element).top})}))).getOrThunk((()=>({bounds:Yo(),optScrollEnv:A.none()})))})],tz=e=>{const t=e.editor,o=pb(t),n=(e=>{const t=e.shared;return{open:(o,n)=>{const r=()=>{iI.hide(l),n()},s=Eb(UA({name:"close-alert",text:"OK",primary:!0,buttonType:A.some("primary"),align:"end",enabled:!0,icon:A.none()},"cancel",e)),a=yF(),i=bF(r,t.providers),l=zl(SF({lazySink:()=>t.getSink(),header:vF(a,i),body:wF(o,t.providers),footer:A.some(xF(CF([],[s.asSpec()]))),onEscape:r,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[ea(c_,r)],eventOrder:{}}));iI.show(l);const c=s.get(l);xf.focus(c)}}})(e.backstages.dialog),r=(e=>{const t=e.shared;return{open:(o,n)=>{const r=e=>{iI.hide(c),n(e)},s=Eb(UA({name:"yes",text:"Yes",primary:!0,buttonType:A.some("primary"),align:"end",enabled:!0,icon:A.none()},"submit",e)),a=UA({name:"no",text:"No",primary:!1,buttonType:A.some("secondary"),align:"end",enabled:!0,icon:A.none()},"cancel",e),i=yF(),l=bF((()=>r(!1)),t.providers),c=zl(SF({lazySink:()=>t.getSink(),header:vF(i,l),body:wF(o,t.providers),footer:A.some(xF(CF([],[a,s.asSpec()]))),onEscape:()=>r(!1),extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[ea(c_,(()=>r(!1))),ea(m_,(()=>r(!0)))],eventOrder:{}}));iI.show(c);const d=s.get(c);xf.focus(d)}}})(e.backstages.dialog),s=(o,n)=>jP.openUrl((o=>{const r=XF(o,{closeWindow:()=>{iI.hide(r.dialog),n(r.instanceApi)}},t,e.backstages.dialog);return iI.show(r.dialog),r.instanceApi}),o),a=(t,o)=>jP.open(((t,n,r)=>{const s=n,a=$F({dataValidator:r,initialData:s,internalDialog:t},{redial:jP.redial,closeWindow:()=>{iI.hide(a.dialog),o(a.instanceApi)}},e.backstages.dialog);return iI.show(a.dialog),a.instanceApi.setData(s),a.instanceApi}),t),i=(n,r,s,a)=>jP.open(((n,i,l)=>{const c=JF(i,l),d=en(),m=e.backstages.popup.shared.header.isPositionedAtTop(),u=()=>d.on((e=>{lv.reposition(e),o&&m||Wi.refresh(e)})),g=qF({dataValidator:l,initialData:c,internalDialog:n},{redial:jP.redial,closeWindow:()=>{d.on(lv.hide),t.off("ResizeEditor",u),d.clear(),s(g.instanceApi)}},e.backstages.popup,a.ariaAttrs,u),h=zl(lv.sketch({lazySink:e.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:a.persistent?{event:"doNotDismissYet"}:{},...m?{}:{fireRepositionEventInstead:{}},inlineBehaviours:xa([ff("window-manager-inline-events",[ea(Hs(),((e,t)=>{Ws(g.dialog,c_)}))]),...ez(t,o,m)]),isExtraPart:(e,t)=>QF(t)}));d.set(h);return lv.showWithinBounds(h,Vl(g.dialog),{anchor:r},(()=>{const e=t.inline?bt():Be.fromDom(t.getContainer()),o=qo(e);return A.some(o)})),o&&m||(Wi.refresh(h),t.on("ResizeEditor",u)),g.instanceApi.setData(c),sf.focusIn(g.dialog),g.instanceApi}),n),l=(o,n,r,s)=>jP.open(((o,a,i)=>{const l=JF(a,i),c=en(),d=e.backstages.popup.shared.header.isPositionedAtTop(),m=()=>c.on((e=>{lv.reposition(e),Wi.refresh(e)})),u=qF({dataValidator:i,initialData:l,internalDialog:o},{redial:jP.redial,closeWindow:()=>{c.on(lv.hide),t.off("ResizeEditor ScrollWindow ElementScroll",m),c.clear(),r(u.instanceApi)}},e.backstages.popup,s.ariaAttrs,m),g=zl(lv.sketch({lazySink:e.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:s.persistent?{event:"doNotDismissYet"}:{},...d?{}:{fireRepositionEventInstead:{}},inlineBehaviours:xa([ff("window-manager-inline-events",[ea(Hs(),((e,t)=>{Ws(u.dialog,c_)}))]),Wi.config({contextual:{lazyContext:()=>A.some(qo(Be.fromDom(t.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top","bottom"],lazyViewport:e=>Cb(t,e.element).map((e=>({bounds:Sb(e),optScrollEnv:A.some({currentScrollTop:e.element.dom.scrollTop,scrollElmTop:$t(e.element).top})}))).getOrThunk((()=>({bounds:Yo(),optScrollEnv:A.none()})))})]),isExtraPart:(e,t)=>QF(t)}));c.set(g);return lv.showWithinBounds(g,Vl(u.dialog),{anchor:n},(()=>e.backstages.popup.shared.getSink().toOptional().bind((e=>{const o=Cb(t,e.element).map((e=>Sb(e))).getOr(Yo()),n=qo(Be.fromDom(t.getContentAreaContainer())),r=Ko(n,o);return A.some($o(r.x,r.y,r.width,r.height-15))})))),Wi.refresh(g),t.on("ResizeEditor ScrollWindow ElementScroll ResizeWindow",m),u.instanceApi.setData(l),sf.focusIn(u.dialog),u.instanceApi}),o);return{open:(t,o,n)=>{if(!m(o)){if("toolbar"===o.inline)return i(t,e.backstages.popup.shared.anchors.inlineDialog(),n,o);if("bottom"===o.inline)return l(t,e.backstages.popup.shared.anchors.inlineBottomDialog(),n,o);if("cursor"===o.inline)return i(t,e.backstages.popup.shared.anchors.cursor(),n,o)}return a(t,n)},openUrl:(e,t)=>s(e,t),alert:(e,t)=>{n.open(e,t)},close:e=>{e.close()},confirm:(e,t)=>{r.open(e,t)}}},oz=e=>{vv(e),(e=>{const t=e.options.register,o=e=>f(e,s)?{value:pS(e),valid:!0}:{valid:!1,message:"Must be an array of strings."},n=e=>p(e)&&e>0?{value:e,valid:!0}:{valid:!1,message:"Must be a positive number."};t("color_map",{processor:o,default:["#BFEDD2","Light Green","#FBEEB8","Light Yellow","#F8CAC6","Light Red","#ECCAFA","Light Purple","#C2E0F4","Light Blue","#2DC26B","Green","#F1C40F","Yellow","#E03E2D","Red","#B96AD9","Purple","#3598DB","Blue","#169179","Dark Turquoise","#E67E23","Orange","#BA372A","Dark Red","#843FA1","Dark Purple","#236FA1","Dark Blue","#ECF0F1","Light Gray","#CED4D9","Medium Gray","#95A5A6","Gray","#7E8C8D","Dark Gray","#34495E","Navy Blue","#000000","Black","#ffffff","White"]}),t("color_map_background",{processor:o}),t("color_map_foreground",{processor:o}),t("color_cols",{processor:n,default:yS(e)}),t("color_cols_foreground",{processor:n,default:wS(e,gS)}),t("color_cols_background",{processor:n,default:wS(e,hS)}),t("custom_colors",{processor:"boolean",default:!0}),t("color_default_foreground",{processor:"string",default:vS}),t("color_default_background",{processor:"string",default:vS})})(e),(e=>{const t=e.options.register;t("contextmenu_avoid_overlap",{processor:"string",default:""}),t("contextmenu_never_use_native",{processor:"boolean",default:!1}),t("contextmenu",{processor:e=>!1===e?{value:[],valid:!0}:s(e)||f(e,s)?{value:BL(e),valid:!0}:{valid:!1,message:"Must be false or a string."},default:"link linkchecker image editimage table spellchecker configurepermanentpen"})})(e)};tn.add("silver",(e=>{oz(e);let t=()=>Yo();const{dialogs:o,popups:n,renderUI:r}=nI(e,{getPopupSinkBounds:()=>t()});Ik(e,n.backstage.shared);const s=tz({editor:e,backstages:{popup:n.backstage,dialog:o.backstage}}),a=en();return{renderUI:()=>{const o=r();return Cb(e,n.getMothership().element).each((e=>{t=()=>Sb(e)})),o},getWindowManagerImpl:w(s),getNotificationManagerImpl:()=>Ky(e,{backstage:n.backstage},n.getMothership(),a)}}))}(),function(){var e=tinymce.util.Tools.resolve("tinymce.ModelManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=r=e,n=(s=String).prototype,n.isPrototypeOf(o)||(null===(a=r.constructor)||void 0===a?void 0:a.name)===s.name)?"string":t;var o,n;var r,s,a})(t)===e,o=e=>t=>typeof t===e,n=e=>t=>e===t,r=t("string"),s=t("object"),a=t("array"),i=n(null),l=o("boolean"),c=n(void 0),d=e=>!(e=>null==e)(e),m=o("function"),u=o("number"),g=()=>{},h=e=>()=>e,p=e=>e,f=(e,t)=>e===t;function v(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const b=e=>t=>!e(t),y=e=>e(),w=h(!1),x=h(!0);class C{constructor(e,t){this.tag=e,this.value=t}static some(e){return new C(!0,e)}static none(){return C.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?C.some(e(this.value)):C.none()}bind(e){return this.tag?e(this.value):C.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:C.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return d(e)?C.some(e):C.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}C.singletonNone=new C(!1);const S=Array.prototype.slice,k=Array.prototype.indexOf,_=Array.prototype.push,E=(e,t)=>{return o=e,n=t,k.call(o,n)>-1;var o,n},T=(e,t)=>{for(let o=0,n=e.length;o{const o=[];for(let n=0;n{const o=e.length,n=new Array(o);for(let r=0;r{for(let o=0,n=e.length;o{const o=[],n=[];for(let r=0,s=e.length;r{const o=[];for(let n=0,r=e.length;n(((e,t)=>{for(let o=e.length-1;o>=0;o--)t(e[o],o)})(e,((e,n)=>{o=t(o,e,n)})),o),B=(e,t,o)=>(D(e,((e,n)=>{o=t(o,e,n)})),o),L=(e,t)=>((e,t,o)=>{for(let n=0,r=e.length;n{for(let o=0,n=e.length;o{const t=[];for(let o=0,n=e.length;oI(A(e,t)),F=(e,t)=>{for(let o=0,n=e.length;o{const o={};for(let n=0,r=e.length;nt>=0&&tV(e,0),U=e=>V(e,e.length-1),j=(e,t)=>{for(let o=0;o{const o=W(e);for(let n=0,r=o.length;nK(e,((e,o)=>({k:o,v:t(e,o)}))),K=(e,t)=>{const o={};return q(e,((e,n)=>{const r=t(e,n);o[r.k]=r.v})),o},Y=(e,t)=>{const o={};return((e,t,o,n)=>{q(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))})(e,t,(e=>(t,o)=>{e[o]=t})(o),g),o},X=(e,t)=>{const o=[];return q(e,((e,n)=>{o.push(t(e,n))})),o},J=e=>X(e,p),Q=(e,t)=>$.call(e,t),ee="undefined"!=typeof window?window:Function("return this;")(),te=(e,t)=>((e,t)=>{let o=null!=t?t:ee;for(let t=0;t{const o=((e,t)=>te(e,t))(e,t);if(null==o)throw new Error(e+" not available on this browser");return o},ne=Object.getPrototypeOf,re=e=>{const t=te("ownerDocument.defaultView",e);return s(e)&&((e=>oe("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(ne(e).constructor.name))},se=e=>e.dom.nodeName.toLowerCase(),ae=e=>e.dom.nodeType,ie=e=>t=>ae(t)===e,le=e=>8===ae(e)||"#comment"===se(e),ce=e=>de(e)&&re(e.dom),de=ie(1),me=ie(3),ue=ie(9),ge=ie(11),he=e=>t=>de(t)&&se(t)===e,pe=(e,t,o)=>{if(!(r(o)||l(o)||u(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")},fe=(e,t,o)=>{pe(e.dom,t,o)},ve=(e,t)=>{const o=e.dom;q(t,((e,t)=>{pe(o,t,e)}))},be=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},ye=(e,t)=>C.from(be(e,t)),we=(e,t)=>{e.dom.removeAttribute(t)},xe=e=>B(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}),Ce=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},Se={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return Ce(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return Ce(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return Ce(o)},fromDom:Ce,fromPoint:(e,t,o)=>C.from(e.dom.elementFromPoint(t,o)).map(Ce)},ke=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},_e=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,Ee=(e,t)=>{const o=void 0===t?document:t.dom;return _e(o)?C.none():C.from(o.querySelector(e)).map(Se.fromDom)},Te=(e,t)=>e.dom===t.dom,Oe=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},Ae=ke,De=e=>Se.fromDom(e.dom.ownerDocument),Me=e=>ue(e)?e:De(e),Ne=e=>C.from(e.dom.parentNode).map(Se.fromDom),Re=e=>C.from(e.dom.parentElement).map(Se.fromDom),Be=(e,t)=>{const o=m(t)?t:w;let n=e.dom;const r=[];for(;null!==n.parentNode&&void 0!==n.parentNode;){const e=n.parentNode,t=Se.fromDom(e);if(r.push(t),!0===o(t))break;n=e}return r},Le=e=>C.from(e.dom.previousSibling).map(Se.fromDom),He=e=>C.from(e.dom.nextSibling).map(Se.fromDom),Ie=e=>A(e.dom.childNodes,Se.fromDom),Pe=(e,t)=>{const o=e.dom.childNodes;return C.from(o[t]).map(Se.fromDom)},Fe=(e,t)=>{Ne(e).each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},ze=(e,t)=>{He(e).fold((()=>{Ne(e).each((e=>{Ze(e,t)}))}),(e=>{Fe(e,t)}))},Ve=(e,t)=>{const o=(e=>Pe(e,0))(e);o.fold((()=>{Ze(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},Ze=(e,t)=>{e.dom.appendChild(t.dom)},Ue=(e,t)=>{Fe(e,t),Ze(t,e)},je=(e,t)=>{D(t,((o,n)=>{const r=0===n?e:t[n-1];ze(r,o)}))},We=(e,t)=>{D(t,(t=>{Ze(e,t)}))},$e=e=>{e.dom.textContent="",D(Ie(e),(e=>{qe(e)}))},qe=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},Ge=e=>{const t=Ie(e);t.length>0&&je(e,t),qe(e)},Ke=(e,t)=>Se.fromDom(e.dom.cloneNode(t)),Ye=e=>Ke(e,!1),Xe=e=>Ke(e,!0),Je=(e,t)=>{const o=Se.fromTag(t),n=xe(e);return ve(o,n),o},Qe=["tfoot","thead","tbody","colgroup"],et=(e,t,o)=>({element:e,rowspan:t,colspan:o}),tt=(e,t,o)=>({element:e,cells:t,section:o}),ot=(e,t,o)=>({element:e,isNew:t,isLocked:o}),nt=(e,t,o,n)=>({element:e,cells:t,section:o,isNew:n}),rt=e=>{const t=(e=>Se.fromDom(e.dom.getRootNode()))(e);return ge(o=t)&&d(o.dom.host)?C.some(t):C.none();var o},st=e=>Se.fromDom(e.dom.host),at=e=>d(e.dom.shadowRoot),it=e=>{const t=me(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return rt(Se.fromDom(t)).fold((()=>o.body.contains(t)),(n=it,r=st,e=>n(r(e))));var n,r},lt=e=>{const t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return Se.fromDom(t)},ct=(e,t)=>{let o=[];return D(Ie(e),(e=>{t(e)&&(o=o.concat([e])),o=o.concat(ct(e,t))})),o},dt=(e,t,o)=>((e,t,o)=>N(Be(e,o),t))(e,(e=>ke(e,t)),o),mt=(e,t)=>((e,t)=>N(Ie(e),t))(e,(e=>ke(e,t))),ut=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return _e(o)?[]:A(o.querySelectorAll(e),Se.fromDom)})(t,e);var gt=(e,t,o,n,r)=>e(o,n)?C.some(o):m(r)&&r(o)?C.none():t(o,n,r);const ht=(e,t,o)=>{let n=e.dom;const r=m(o)?o:w;for(;n.parentNode;){n=n.parentNode;const e=Se.fromDom(n);if(t(e))return C.some(e);if(r(e))break}return C.none()},pt=(e,t,o)=>gt(((e,t)=>t(e)),ht,e,t,o),ft=(e,t,o)=>ht(e,(e=>ke(e,t)),o),vt=(e,t)=>((e,t)=>L(e.dom.childNodes,(e=>t(Se.fromDom(e)))).map(Se.fromDom))(e,(e=>ke(e,t))),bt=(e,t)=>Ee(t,e),yt=(e,t,o)=>gt(((e,t)=>ke(e,t)),ft,e,t,o),wt=(e,t,o=f)=>e.exists((e=>o(e,t))),xt=e=>{const t=[],o=e=>{t.push(e)};for(let t=0;te?C.some(t):C.none(),St=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,kt=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!c(n)||r+t.length<=n)},_t=(e,t)=>St(e,t,0),Et=(e,t)=>St(e,t,e.length-t.length),Tt=(e=>t=>t.replace(e,""))(/^\s+|\s+$/g),Ot=e=>e.length>0,At=e=>void 0!==e.style&&m(e.style.getPropertyValue),Dt=(e,t,o)=>{if(!r(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);At(e)&&e.style.setProperty(t,o)},Mt=(e,t,o)=>{const n=e.dom;Dt(n,t,o)},Nt=(e,t)=>{const o=e.dom;q(t,((e,t)=>{Dt(o,t,e)}))},Rt=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||it(e)?n:Bt(o,t)},Bt=(e,t)=>At(e)?e.style.getPropertyValue(t):"",Lt=(e,t)=>{const o=e.dom,n=Bt(o,t);return C.from(n).filter((e=>e.length>0))},Ht=(e,t)=>{((e,t)=>{At(e)&&e.style.removeProperty(t)})(e.dom,t),wt(ye(e,"style").map(Tt),"")&&we(e,"style")},It=(e,t,o=0)=>ye(e,t).map((e=>parseInt(e,10))).getOr(o),Pt=(e,t)=>It(e,t,1),Ft=e=>he("col")(e)?It(e,"span",1)>1:Pt(e,"colspan")>1,zt=(e,t)=>parseInt(Rt(e,t),10),Vt=h(10),Zt=h(10),Ut=(e,t)=>jt(e,t,x),jt=(e,t,o)=>P(Ie(e),(e=>ke(e,t)?o(e)?[e]:[]:jt(e,t,o))),Wt=(e,t)=>((e,t,o=w)=>o(t)?C.none():E(e,se(t))?C.some(t):ft(t,e.join(","),(e=>ke(e,"table")||o(e))))(["td","th"],e,t),$t=e=>Ut(e,"th,td"),qt=e=>ke(e,"colgroup")?mt(e,"col"):P(Yt(e),(e=>mt(e,"col"))),Gt=(e,t)=>yt(e,"table",t),Kt=e=>Ut(e,"tr"),Yt=e=>Gt(e).fold(h([]),(e=>mt(e,"colgroup"))),Xt=(e,t)=>A(e,(e=>{if("colgroup"===se(e)){const t=A(qt(e),(e=>{const t=It(e,"span",1);return et(e,1,t)}));return tt(e,t,"colgroup")}{const o=A($t(e),(e=>{const t=It(e,"rowspan",1),o=It(e,"colspan",1);return et(e,t,o)}));return tt(e,o,t(e))}})),Jt=e=>Ne(e).map((e=>{const t=se(e);return(e=>E(Qe,e))(t)?t:"tbody"})).getOr("tbody"),Qt=e=>{const t=Kt(e),o=[...Yt(e),...t];return Xt(o,Jt)},eo=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},to=()=>oo(0,0),oo=(e,t)=>({major:e,minor:t}),no={nu:oo,detect:(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?to():((e,t)=>{const o=((e,t)=>{for(let o=0;oNumber(t.replace(o,"$"+e));return oo(n(1),n(2))})(e,o)},unknown:to},ro=(e,t)=>{const o=String(t).toLowerCase();return L(e,(e=>e.search(o)))},so=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ao=e=>t=>kt(t,e),io=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>kt(e,"edge/")&&kt(e,"chrome")&&kt(e,"safari")&&kt(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,so],search:e=>kt(e,"chrome")&&!kt(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>kt(e,"msie")||kt(e,"trident")},{name:"Opera",versionRegexes:[so,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ao("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ao("firefox")},{name:"Safari",versionRegexes:[so,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(kt(e,"safari")||kt(e,"mobile/"))&&kt(e,"applewebkit")}],lo=[{name:"Windows",search:ao("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>kt(e,"iphone")||kt(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ao("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:ao("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ao("linux"),versionRegexes:[]},{name:"Solaris",search:ao("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ao("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:ao("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],co={browsers:h(io),oses:h(lo)},mo="Edge",uo="Chromium",go="Opera",ho="Firefox",po="Safari",fo=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(mo),isChromium:n(uo),isIE:n("IE"),isOpera:n(go),isFirefox:n(ho),isSafari:n(po)}},vo={unknown:()=>fo({current:void 0,version:no.unknown()}),nu:fo,edge:h(mo),chromium:h(uo),ie:h("IE"),opera:h(go),firefox:h(ho),safari:h(po)},bo="Windows",yo="Android",wo="Linux",xo="macOS",Co="Solaris",So="FreeBSD",ko="ChromeOS",_o=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(bo),isiOS:n("iOS"),isAndroid:n(yo),isMacOS:n(xo),isLinux:n(wo),isSolaris:n(Co),isFreeBSD:n(So),isChromeOS:n(ko)}},Eo={unknown:()=>_o({current:void 0,version:no.unknown()}),nu:_o,windows:h(bo),ios:h("iOS"),android:h(yo),linux:h(wo),macos:h(xo),solaris:h(Co),freebsd:h(So),chromeos:h(ko)},To=(e,t,o)=>{const n=co.browsers(),r=co.oses(),s=t.bind((e=>((e,t)=>j(t.brands,(t=>{const o=t.brand.toLowerCase();return L(e,(e=>{var t;return o===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:no.nu(parseInt(t.version,10),0)})))})))(n,e))).orThunk((()=>((e,t)=>ro(e,t).map((e=>{const o=no.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(n,e))).fold(vo.unknown,vo.nu),a=((e,t)=>ro(e,t).map((e=>{const o=no.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(r,e).fold(Eo.unknown,Eo.nu),i=((e,t,o,n)=>{const r=e.isiOS()&&!0===/ipad/i.test(o),s=e.isiOS()&&!r,a=e.isiOS()||e.isAndroid(),i=a||n("(pointer:coarse)"),l=r||!s&&a&&n("(min-device-width:768px)"),c=s||a&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),m=!c&&!l&&!d;return{isiPad:h(r),isiPhone:h(s),isTablet:h(l),isPhone:h(c),isTouch:h(i),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:h(d),isDesktop:h(m)}})(a,s,e,o);return{browser:s,os:a,deviceType:i}},Oo=e=>window.matchMedia(e).matches;let Ao=eo((()=>To(window.navigator.userAgent,C.from(window.navigator.userAgentData),Oo)));const Do=()=>Ao(),Mo=(e,t)=>{const o=o=>{const n=t(o);if(n<=0||null===n){const t=Rt(o,e);return parseFloat(t)||0}return n},n=(e,t)=>B(t,((t,o)=>{const n=Rt(e,o),r=void 0===n?0:parseInt(n,10);return isNaN(r)?t:t+r}),0);return{set:(t,o)=>{if(!u(o)&&!o.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+o);const n=t.dom;At(n)&&(n.style[e]=o+"px")},get:o,getOuter:o,aggregate:n,max:(e,t,o)=>{const r=n(e,o);return t>r?t-r:0}}},No=(e,t)=>(e=>{const t=parseFloat(e);return isNaN(t)?C.none():C.some(t)})(e).getOr(t),Ro=(e,t,o)=>No(Rt(e,t),o),Bo=(e,t)=>{const o=e.dom,n=o.getBoundingClientRect().width||o.offsetWidth;return"border-box"===t?n:((e,t,o,n)=>t-Ro(e,`padding-${o}`,0)-Ro(e,`padding-${n}`,0)-Ro(e,`border-${o}-width`,0)-Ro(e,`border-${n}-width`,0))(e,n,"left","right")},Lo=Mo("width",(e=>e.dom.offsetWidth)),Ho=e=>Lo.get(e),Io=e=>Lo.getOuter(e),Po=e=>Bo(e,"content-box"),Fo=e=>Ro(e,"width",e.dom.offsetWidth),zo=(e,t,o)=>{const n=e.cells,r=n.slice(0,t),s=n.slice(t),a=r.concat(o).concat(s);return Uo(e,a)},Vo=(e,t,o)=>zo(e,t,[o]),Zo=(e,t,o)=>{e.cells[t]=o},Uo=(e,t)=>nt(e.element,t,e.section,e.isNew),jo=(e,t)=>e.cells[t],Wo=(e,t)=>jo(e,t).element,$o=e=>e.cells.length,qo=e=>{const t=M(e,(e=>"colgroup"===e.section));return{rows:t.fail,cols:t.pass}},Go=(e,t,o)=>{const n=A(e.cells,o);return nt(t(e.element),n,e.section,!0)},Ko="data-snooker-locked-cols",Yo=e=>ye(e,Ko).bind((e=>C.from(e.match(/\d+/g)))).map((e=>z(e,x))),Xo=e=>{const t=B(qo(e).rows,((e,t)=>(D(t.cells,((t,o)=>{t.isLocked&&(e[o]=!0)})),e)),{}),o=X(t,((e,t)=>parseInt(t,10)));return((e,t)=>{const o=S.call(e,0);return o.sort(t),o})(o)},Jo=(e,t)=>e+","+t,Qo=(e,t)=>{const o=P(e.all,(e=>e.cells));return N(o,t)},en=e=>{const t={},o=[],n=Z(e).map((e=>e.element)).bind(Gt).bind(Yo).getOr({});let r=0,s=0,a=0;const{pass:i,fail:l}=M(e,(e=>"colgroup"===e.section));D(l,(e=>{const i=[];D(e.cells,(e=>{let o=0;for(;void 0!==t[Jo(a,o)];)o++;const r=((e,t)=>Q(e,t)&&void 0!==e[t]&&null!==e[t])(n,o.toString()),l=((e,t,o,n,r,s)=>({element:e,rowspan:t,colspan:o,row:n,column:r,isLocked:s}))(e.element,e.rowspan,e.colspan,a,o,r);for(let n=0;n{const t=(e=>{const t={};let o=0;return D(e.cells,(e=>{const n=e.colspan;O(n,(r=>{const s=o+r;t[s]=((e,t,o)=>({element:e,colspan:t,column:o}))(e.element,n,s)})),o+=n})),t})(e),o=((e,t)=>({element:e,columns:t}))(e.element,J(t));return{colgroups:[o],columns:t}})).getOrThunk((()=>({colgroups:[],columns:{}}))),m=((e,t)=>({rows:e,columns:t}))(r,s);return{grid:m,access:t,all:o,columns:c,colgroups:d}},tn={fromTable:e=>{const t=Qt(e);return en(t)},generate:en,getAt:(e,t,o)=>C.from(e.access[Jo(t,o)]),findItem:(e,t,o)=>{const n=Qo(e,(e=>o(t,e.element)));return n.length>0?C.some(n[0]):C.none()},filterItems:Qo,justCells:e=>P(e.all,(e=>e.cells)),justColumns:e=>J(e.columns),hasColumns:e=>W(e.columns).length>0,getColumnAt:(e,t)=>C.from(e.columns[t])},on=(e,t=x)=>{const o=e.grid,n=O(o.columns,p),r=O(o.rows,p);return A(n,(o=>nn((()=>P(r,(t=>tn.getAt(e,t,o).filter((e=>e.column===o)).toArray()))),(e=>1===e.colspan&&t(e.element)),(()=>tn.getAt(e,0,o)))))},nn=(e,t,o)=>{const n=e();return L(n,t).orThunk((()=>C.from(n[0]).orThunk(o))).map((e=>e.element))},rn=e=>{const t=e.grid,o=O(t.rows,p),n=O(t.columns,p);return A(o,(t=>nn((()=>P(n,(o=>tn.getAt(e,t,o).filter((e=>e.row===t)).fold(h([]),(e=>[e]))))),(e=>1===e.rowspan),(()=>tn.getAt(e,t,0)))))},sn=(e,t)=>{if(t<0||t>=e.length-1)return C.none();const o=e[t].fold((()=>{const o=(e=>{const t=S.call(e,0);return t.reverse(),t})(e.slice(0,t));return j(o,((e,t)=>e.map((e=>({value:e,delta:t+1})))))}),(e=>C.some({value:e,delta:0}))),n=e[t+1].fold((()=>{const o=e.slice(t+1);return j(o,((e,t)=>e.map((e=>({value:e,delta:t+1})))))}),(e=>C.some({value:e,delta:1})));return o.bind((e=>n.map((t=>{const o=t.delta+e.delta;return Math.abs(t.value-e.value)/o}))))},an=(e,t)=>o=>"rtl"===ln(o)?t:e,ln=e=>"rtl"===Rt(e,"direction")?"rtl":"ltr",cn=Mo("height",(e=>{const t=e.dom;return it(e)?t.getBoundingClientRect().height:t.offsetHeight})),dn=e=>cn.get(e),mn=e=>cn.getOuter(e),un=e=>Ro(e,"height",e.dom.offsetHeight),gn=(e,t)=>({left:e,top:t,translate:(o,n)=>gn(e+o,t+n)}),hn=gn,pn=(e,t)=>void 0!==e?e:void 0!==t?t:0,fn=e=>{const t=e.dom.ownerDocument,o=t.body,n=t.defaultView,r=t.documentElement;if(o===e.dom)return hn(o.offsetLeft,o.offsetTop);const s=pn(null==n?void 0:n.pageYOffset,r.scrollTop),a=pn(null==n?void 0:n.pageXOffset,r.scrollLeft),i=pn(r.clientTop,o.clientTop),l=pn(r.clientLeft,o.clientLeft);return vn(e).translate(a-l,s-i)},vn=e=>{const t=e.dom,o=t.ownerDocument.body;return o===t?hn(o.offsetLeft,o.offsetTop):it(e)?(e=>{const t=e.getBoundingClientRect();return hn(t.left,t.top)})(t):hn(0,0)},bn=(e,t)=>({row:e,y:t}),yn=(e,t)=>({col:e,x:t}),wn=e=>fn(e).left+Io(e),xn=e=>fn(e).left,Cn=(e,t)=>yn(e,xn(t)),Sn=(e,t)=>yn(e,wn(t)),kn=e=>fn(e).top,_n=(e,t)=>bn(e,kn(t)),En=(e,t)=>bn(e,kn(t)+mn(t)),Tn=(e,t,o)=>{if(0===o.length)return[];const n=A(o.slice(1),((t,o)=>t.map((t=>e(o,t))))),r=o[o.length-1].map((e=>t(o.length-1,e)));return n.concat([r])},On={delta:p,positions:e=>Tn(_n,En,e),edge:kn},An=an({delta:p,edge:xn,positions:e=>Tn(Cn,Sn,e)},{delta:e=>-e,edge:wn,positions:e=>Tn(Sn,Cn,e)}),Dn={delta:(e,t)=>An(t).delta(e,t),positions:(e,t)=>An(t).positions(e,t),edge:e=>An(e).edge(e)},Mn={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},Nn=(()=>{const e="[0-9]+",t="[eE]"+("[+-]?"+e),o=e=>`(?:${e})?`,n=["Infinity",e+"\\."+o(e)+o(t),"\\."+e+o(t),e+o(t)].join("|");return new RegExp(`^(${`[+-]?(?:${n})`})(.*)$`)})(),Rn=(e,t)=>C.from(Nn.exec(e)).bind((e=>{const o=Number(e[1]),n=e[2];return((e,t)=>T(t,(t=>T(Mn[t],(t=>e===t)))))(n,t)?C.some({value:o,unit:n}):C.none()})),Bn=/(\d+(\.\d+)?)%/,Ln=/(\d+(\.\d+)?)px|em/,Hn=he("col"),In=he("tr"),Pn=(e,t,o)=>{const n=Re(e).getOrThunk((()=>lt(De(e))));return t(e)/o(n)*100},Fn=(e,t)=>{Mt(e,"width",t+"px")},zn=(e,t)=>{Mt(e,"width",t+"%")},Vn=(e,t)=>{Mt(e,"height",t+"px")},Zn=(e,t,o,n)=>{const r=parseFloat(e);return Et(e,"%")&&"table"!==se(t)?((e,t,o,n)=>{const r=Gt(e).map((e=>{const n=o(e);return Math.floor(t/100*n)})).getOr(t);return n(e,r),r})(t,r,o,n):r},Un=e=>{const t=(e=>un(e)+"px")(e);return t?Zn(t,e,dn,Vn):dn(e)},jn=(e,t)=>Lt(e,t).orThunk((()=>ye(e,t).map((e=>e+"px")))),Wn=e=>jn(e,"width"),$n=e=>Pn(e,Ho,Po),qn=e=>Hn(e)?Ho(e):Fo(e),Gn=e=>In(e)?dn(e):((e,t,o)=>o(e)/Pt(e,t))(e,"rowspan",Un),Kn=(e,t,o)=>{Mt(e,"width",t+o)},Yn=e=>Pn(e,Ho,Po)+"%",Xn=h(Bn),Jn=he("col"),Qn=e=>Wn(e).getOrThunk((()=>qn(e)+"px")),er=e=>{return(t=e,jn(t,"height")).getOrThunk((()=>Gn(e)+"px"));var t},tr=(e,t,o,n,r,s)=>e.filter(n).fold((()=>s(sn(o,t))),(e=>r(e))),or=(e,t,o,n)=>{const r=on(e),s=tn.hasColumns(e)?(e=>A(tn.justColumns(e),(e=>C.from(e.element))))(e):r,a=[C.some(Dn.edge(t))].concat(A(Dn.positions(r,t),(e=>e.map((e=>e.x))))),i=b(Ft);return A(s,((e,t)=>tr(e,t,a,i,(e=>{if((e=>{const t=Do().browser,o=t.isChromium()||t.isFirefox();return!Jn(e)||o})(e))return o(e);{const e=(s=r[t],l=p,null!=s?l(s):C.none());return tr(e,t,a,i,(e=>n(C.some(Ho(e)))),n)}var s,l}),n)))},nr=e=>e.map((e=>e+"px")).getOr(""),rr=(e,t,o)=>or(e,t,qn,(e=>e.getOrThunk(o.minCellWidth))),sr=(e,t,o,n)=>{const r=rn(e),s=A(e.all,(e=>C.some(e.element))),a=[C.some(On.edge(t))].concat(A(On.positions(r,t),(e=>e.map((e=>e.y)))));return A(s,((e,t)=>tr(e,t,a,x,o,n)))},ar=(e,t)=>()=>it(e)?t(e):parseFloat(Lt(e,"width").getOr("0")),ir=e=>{const t=ar(e,Ho),o=h(0);return{width:t,pixelWidth:t,getWidths:(t,o)=>rr(t,e,o),getCellDelta:o,singleColumnWidth:h([0]),minCellWidth:o,setElementWidth:g,adjustTableWidth:g,isRelative:!0,label:"none"}},lr=e=>{const t=ar(e,(e=>parseFloat(Yn(e)))),o=ar(e,Ho);return{width:t,pixelWidth:o,getWidths:(t,o)=>((e,t,o)=>or(e,t,$n,(e=>e.fold((()=>o.minCellWidth()),(e=>e/o.pixelWidth()*100)))))(t,e,o),getCellDelta:e=>e/o()*100,singleColumnWidth:(e,t)=>[100-e],minCellWidth:()=>Vt()/o()*100,setElementWidth:zn,adjustTableWidth:o=>{const n=t();zn(e,n+o/100*n)},isRelative:!0,label:"percent"}},cr=e=>{const t=ar(e,Ho);return{width:t,pixelWidth:t,getWidths:(t,o)=>rr(t,e,o),getCellDelta:p,singleColumnWidth:(e,t)=>[Math.max(Vt(),e+t)-e],minCellWidth:Vt,setElementWidth:Fn,adjustTableWidth:o=>{const n=t()+o;Fn(e,n)},isRelative:!1,label:"pixel"}},dr=e=>Wn(e).fold((()=>ir(e)),(t=>((e,t)=>null!==Xn().exec(t)?lr(e):cr(e))(e,t))),mr=cr,ur=lr,gr=(e,t,o)=>{const n=e[o].element,r=Se.fromTag("td");Ze(r,Se.fromTag("br"));(t?Ze:Ve)(n,r)},hr=(e,t)=>{const o=e=>ke(e.element,t),n=Xe(e),r=Qt(n),s=dr(e),a=tn.generate(r),i=((e,t)=>{const o=e.grid.columns;let n=e.grid.rows,r=o,s=0,a=0;const i=[],l=[];return q(e.access,(e=>{if(i.push(e),t(e)){l.push(e);const t=e.row,o=t+e.rowspan-1,i=e.column,c=i+e.colspan-1;ts&&(s=o),ia&&(a=c)}})),((e,t,o,n,r,s)=>({minRow:e,minCol:t,maxRow:o,maxCol:n,allCells:r,selectedCells:s}))(n,r,s,a,i,l)})(a,o),l="th:not("+t+"),td:not("+t+")",c=jt(n,"th,td",(e=>ke(e,l)));D(c,qe),((e,t,o,n)=>{const r=N(e,(e=>"colgroup"!==e.section)),s=t.grid.columns,a=t.grid.rows;for(let e=0;eo.maxRow||io.maxCol||(tn.getAt(t,e,i).filter(n).isNone()?gr(r,a,e):a=!0)}})(r,a,i,o);const d=((e,t,o,n)=>{if(0===n.minCol&&t.grid.columns===n.maxCol+1)return 0;const r=rr(t,e,o),s=B(r,((e,t)=>e+t),0),a=B(r.slice(n.minCol,n.maxCol+1),((e,t)=>e+t),0),i=a/s*o.pixelWidth()-o.pixelWidth();return o.getCellDelta(i)})(e,tn.fromTable(e),s,i);return((e,t,o,n)=>{q(o.columns,(e=>{(e.columnt.maxCol)&&qe(e.element)}));const r=N(Ut(e,"tr"),(e=>0===e.dom.childElementCount));D(r,qe),t.minCol!==t.maxCol&&t.minRow!==t.maxRow||D(Ut(e,"th,td"),(e=>{we(e,"rowspan"),we(e,"colspan")})),we(e,Ko),we(e,"data-snooker-col-series"),dr(e).adjustTableWidth(n)})(n,i,a,d),n},pr=((e,t)=>{const o=t=>e(t)?C.from(t.dom.nodeValue):C.none();return{get:n=>{if(!e(n))throw new Error("Can only get "+t+" value of a "+t+" node");return o(n).getOr("")},getOption:o,set:(o,n)=>{if(!e(o))throw new Error("Can only set raw "+t+" value of a "+t+" node");o.dom.nodeValue=n}}})(me,"text"),fr=e=>pr.get(e),vr=e=>pr.getOption(e),br=(e,t)=>pr.set(e,t),yr=e=>"img"===se(e)?1:vr(e).fold((()=>Ie(e).length),(e=>e.length)),wr=["img","br"],xr=e=>vr(e).filter((e=>0!==e.trim().length||e.indexOf(" ")>-1)).isSome()||E(wr,se(e))||(e=>ce(e)&&"false"===be(e,"contenteditable"))(e),Cr=e=>((e,t)=>{const o=e=>{for(let n=0;nkr(e,xr),kr=(e,t)=>{const o=e=>{const n=Ie(e);for(let e=n.length-1;e>=0;e--){const r=n[e];if(t(r))return C.some(r);const s=o(r);if(s.isSome())return s}return C.none()};return o(e)},_r={scope:["row","col"]},Er=e=>()=>{const t=Se.fromTag("td",e.dom);return Ze(t,Se.fromTag("br",e.dom)),t},Tr=e=>()=>Se.fromTag("col",e.dom),Or=e=>()=>Se.fromTag("colgroup",e.dom),Ar=e=>()=>Se.fromTag("tr",e.dom),Dr=(e,t,o)=>{const n=((e,t)=>{const o=Je(e,t),n=Ie(Xe(e));return We(o,n),o})(e,t);return q(o,((e,t)=>{null===e?we(n,t):fe(n,t,e)})),n},Mr=e=>e,Nr=(e,t,o)=>{const n=(e,t)=>{((e,t)=>{const o=e.dom,n=t.dom;At(o)&&At(n)&&(n.style.cssText=o.style.cssText)})(e.element,t),Ht(t,"height"),1!==e.colspan&&Ht(t,"width")};return{col:o=>{const r=Se.fromTag(se(o.element),t.dom);return n(o,r),e(o.element,r),r},colgroup:Or(t),row:Ar(t),cell:r=>{const s=Se.fromTag(se(r.element),t.dom),a=o.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),i=a.length>0?((e,t,o)=>Cr(e).map((n=>{const r=o.join(","),s=dt(n,r,(t=>Te(t,e)));return R(s,((e,t)=>{const o=Ye(t);return Ze(e,o),o}),t)})).getOr(t))(r.element,s,a):s;return Ze(i,Se.fromTag("br")),n(r,s),((e,t)=>{q(_r,((o,n)=>ye(e,n).filter((e=>E(o,e))).each((e=>fe(t,n,e)))))})(r.element,s),e(r.element,s),s},replace:Dr,colGap:Tr(t),gap:Er(t)}},Rr=e=>({col:Tr(e),colgroup:Or(e),row:Ar(e),cell:Er(e),replace:Mr,colGap:Tr(e),gap:Er(e)}),Br=e=>t=>t.options.get(e),Lr="100%",Hr=e=>{var t;const o=e.dom,n=null!==(t=o.getParent(e.selection.getStart(),o.isBlock))&&void 0!==t?t:e.getBody();return Po(Se.fromDom(n))+"px"},Ir=e=>C.from(e.options.get("table_clone_elements")),Pr=Br("table_header_type"),Fr=Br("table_column_resizing"),zr=e=>"preservetable"===Fr(e),Vr=e=>"resizetable"===Fr(e),Zr=Br("table_sizing_mode"),Ur=e=>"relative"===Zr(e),jr=e=>"fixed"===Zr(e),Wr=e=>"responsive"===Zr(e),$r=Br("table_resize_bars"),qr=Br("table_style_by_css"),Gr=Br("table_merge_content_on_paste"),Kr=e=>{const t=e.options,o=t.get("table_default_attributes");return t.isSet("table_default_attributes")?o:((e,t)=>Wr(e)||qr(e)?t:jr(e)?{...t,width:Hr(e)}:{...t,width:Lr})(e,o)},Yr=e=>{const t=e.options,o=t.get("table_default_styles");return t.isSet("table_default_styles")?o:((e,t)=>Wr(e)||!qr(e)?t:jr(e)?{...t,width:Hr(e)}:{...t,width:Lr})(e,o)},Xr=Br("table_use_colgroups"),Jr=e=>yt(e,"[contenteditable]"),Qr=(e,t=!1)=>it(e)?e.dom.isContentEditable:Jr(e).fold(h(t),(e=>"true"===es(e))),es=e=>e.dom.contentEditable,ts=e=>Se.fromDom(e.getBody()),os=e=>t=>Te(t,ts(e)),ns=e=>{we(e,"data-mce-style");const t=e=>we(e,"data-mce-style");D($t(e),t),D(qt(e),t),D(Kt(e),t)},rs=e=>Se.fromDom(e.selection.getStart()),ss=e=>e.getBoundingClientRect().width,as=e=>e.getBoundingClientRect().height,is=e=>(t,o)=>{const n=t.dom.getStyle(o,e)||t.dom.getAttrib(o,e);return C.from(n).filter(Ot)},ls=is("width"),cs=is("height"),ds=e=>pt(e,he("table")).exists(Qr),ms=(e,t)=>{const o=t.column,n=t.column+t.colspan-1,r=t.row,s=t.row+t.rowspan-1;return o<=e.finishCol&&n>=e.startCol&&r<=e.finishRow&&s>=e.startRow},us=(e,t)=>t.column>=e.startCol&&t.column+t.colspan-1<=e.finishCol&&t.row>=e.startRow&&t.row+t.rowspan-1<=e.finishRow,gs=(e,t,o)=>{const n=tn.findItem(e,t,Te),r=tn.findItem(e,o,Te);return n.bind((e=>r.map((t=>{return o=e,n=t,r=Math.min(o.row,n.row),s=Math.min(o.column,n.column),a=Math.max(o.row+o.rowspan-1,n.row+n.rowspan-1),i=Math.max(o.column+o.colspan-1,n.column+n.colspan-1),{startRow:r,startCol:s,finishRow:a,finishCol:i};var o,n,r,s,a,i}))))},hs=(e,t,o)=>gs(e,t,o).bind((t=>((e,t)=>{let o=!0;const n=v(us,t);for(let r=t.startRow;r<=t.finishRow;r++)for(let s=t.startCol;s<=t.finishCol;s++)o=o&&tn.getAt(e,r,s).exists(n);return o?C.some(t):C.none()})(e,t))),ps=(e,t,o)=>gs(e,t,o).map((t=>{const o=tn.filterItems(e,v(ms,t));return A(o,(e=>e.element))})),fs=(e,t)=>tn.findItem(e,t,((e,t)=>Oe(t,e))).map((e=>e.element)),vs=(e,t,o)=>Gt(e).bind((n=>((e,t,o,n)=>tn.findItem(e,t,Te).bind((t=>{const r=o>0?t.row+t.rowspan-1:t.row,s=n>0?t.column+t.colspan-1:t.column;return tn.getAt(e,r+o,s+n).map((e=>e.element))})))(ws(n),e,t,o))),bs=(e,t,o)=>{const n=ws(e);return ps(n,t,o)},ys=(e,t,o,n,r)=>{const s=ws(e),a=Te(e,o)?C.some(t):fs(s,t),i=Te(e,r)?C.some(n):fs(s,n);return a.bind((e=>i.bind((t=>ps(s,e,t)))))},ws=tn.fromTable;var xs=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Cs=()=>({up:h({selector:ft,closest:yt,predicate:ht,all:Be}),down:h({selector:ut,predicate:ct}),styles:h({get:Rt,getRaw:Lt,set:Mt,remove:Ht}),attrs:h({get:be,set:fe,remove:we,copyTo:(e,t)=>{const o=xe(e);ve(t,o)}}),insert:h({before:Fe,after:ze,afterAll:je,append:Ze,appendAll:We,prepend:Ve,wrap:Ue}),remove:h({unwrap:Ge,remove:qe}),create:h({nu:Se.fromTag,clone:e=>Se.fromDom(e.dom.cloneNode(!1)),text:Se.fromText}),query:h({comparePosition:(e,t)=>e.dom.compareDocumentPosition(t.dom),prevSibling:Le,nextSibling:He}),property:h({children:Ie,name:se,parent:Ne,document:e=>Me(e).dom,isText:me,isComment:le,isElement:de,isSpecial:e=>{const t=se(e);return E(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)},getLanguage:e=>de(e)?ye(e,"lang"):C.none(),getText:fr,setText:br,isBoundary:e=>!!de(e)&&("body"===se(e)||E(xs,se(e))),isEmptyTag:e=>!!de(e)&&E(["br","img","hr","input"],se(e)),isNonEditable:e=>de(e)&&"false"===be(e,"contenteditable")}),eq:Te,is:Ae});const Ss=(e,t,o,n)=>{const r=t(e,o);return R(n,((o,n)=>{const r=t(e,n);return ks(e,o,r)}),r)},ks=(e,t,o)=>t.bind((t=>o.filter(v(e.eq,t)))),_s=(e,t,o)=>o.length>0?((e,t,o,n)=>n(e,t,o[0],o.slice(1)))(e,t,o,Ss):C.none(),Es=(e,t,o,n=w)=>{const r=[t].concat(e.up().all(t)),s=[o].concat(e.up().all(o)),a=e=>H(e,n).fold((()=>e),(t=>e.slice(0,t+1))),i=a(r),l=a(s),c=L(i,(t=>T(l,((e,t)=>v(e.eq,t))(e,t))));return{firstpath:i,secondpath:l,shared:c}},Ts=Cs(),Os=(e,t)=>_s(Ts,((t,o)=>e(o)),t),As=e=>ft(e,"table"),Ds=(e,t,o)=>{const n=e=>t=>void 0!==o&&o(t)||Te(t,e);return Te(e,t)?C.some({boxes:C.some([e]),start:e,finish:t}):As(e).bind((r=>As(t).bind((s=>{if(Te(r,s))return C.some({boxes:bs(r,e,t),start:e,finish:t});if(Oe(r,s)){const o=dt(t,"td,th",n(r)),a=o.length>0?o[o.length-1]:t;return C.some({boxes:ys(r,e,r,t,s),start:e,finish:a})}if(Oe(s,r)){const o=dt(e,"td,th",n(s)),a=o.length>0?o[o.length-1]:e;return C.some({boxes:ys(s,e,r,t,s),start:e,finish:a})}return((e,t,o)=>Es(Ts,e,t,o))(e,t).shared.bind((a=>yt(a,"table",o).bind((o=>{const a=dt(t,"td,th",n(o)),i=a.length>0?a[a.length-1]:t,l=dt(e,"td,th",n(o)),c=l.length>0?l[l.length-1]:e;return C.some({boxes:ys(o,e,r,t,s),start:c,finish:i})}))))}))))},Ms=(e,t)=>{const o=ut(e,t);return o.length>0?C.some(o):C.none()},Ns=(e,t,o)=>bt(e,t).bind((t=>bt(e,o).bind((e=>Os(As,[t,e]).map((o=>({first:t,last:e,table:o}))))))),Rs=(e,t,o,n,r)=>((e,t)=>L(e,(e=>ke(e,t))))(e,r).bind((e=>vs(e,t,o).bind((e=>((e,t)=>ft(e,"table").bind((o=>bt(o,t).bind((t=>Ds(t,e).bind((e=>e.boxes.map((t=>({boxes:t,start:e.start,finish:e.finish}))))))))))(e,n))))),Bs=(e,t)=>Ms(e,t),Ls=(e,t,o)=>Ns(e,t,o).bind((t=>{const o=t=>Te(e,t),n="thead,tfoot,tbody,table",r=ft(t.first,n,o),s=ft(t.last,n,o);return r.bind((e=>s.bind((o=>Te(e,o)?((e,t,o)=>{const n=ws(e);return hs(n,t,o)})(t.table,t.first,t.last):C.none()))))})),Hs=p,Is=e=>{const t=(e,t)=>ye(e,t).exists((e=>parseInt(e,10)>1));return e.length>0&&F(e,(e=>t(e,"rowspan")||t(e,"colspan")))?C.some(e):C.none()},Ps=(e,t,o)=>t.length<=1?C.none():Ls(e,o.firstSelectedSelector,o.lastSelectedSelector).map((e=>({bounds:e,cells:t}))),Fs="data-mce-selected",zs="td["+Fs+"],th["+Fs+"]",Vs="["+Fs+"]",Zs="data-mce-first-selected",Us="td["+Zs+"],th["+Zs+"]",js="data-mce-last-selected",Ws="td["+js+"],th["+js+"]",$s=Vs,qs={selected:Fs,selectedSelector:zs,firstSelected:Zs,firstSelectedSelector:Us,lastSelected:js,lastSelectedSelector:Ws},Gs=(e,t,o)=>({element:o,mergable:Ps(t,e,qs),unmergable:Is(e),selection:Hs(e)}),Ks=e=>(t,o)=>{const n=se(t),r="col"===n||"colgroup"===n?Gt(s=t).bind((e=>Bs(e,qs.firstSelectedSelector))).fold(h(s),(e=>e[0])):t;var s;return yt(r,e,o)},Ys=Ks("th,td,caption"),Xs=Ks("th,td"),Js=e=>{return t=e.model.table.getSelectedCells(),A(t,Se.fromDom);var t},Qs=(e,t)=>{e.on("BeforeGetContent",(t=>{const o=o=>{t.preventDefault(),(e=>Gt(e[0]).map((e=>{const t=hr(e,$s);return ns(t),[t]})))(o).each((o=>{t.content="text"===t.format?(e=>A(e,(e=>e.dom.innerText)).join(""))(o):((e,t)=>A(t,(t=>e.selection.serializer.serialize(t.dom,{}))).join(""))(e,o)}))};if(!0===t.selection){const t=(e=>N(Js(e),(e=>ke(e,qs.selectedSelector))))(e);t.length>=1&&o(t)}})),e.on("BeforeSetContent",(o=>{if(!0===o.selection&&!0===o.paste){const n=Js(e);Z(n).each((n=>{Gt(n).each((r=>{const s=N((e=>{const t=document.createElement("div");return t.innerHTML=e,Ie(Se.fromDom(t))})(o.content),(e=>"meta"!==se(e))),a=he("table");if(Gr(e)&&1===s.length&&a(s[0])){o.preventDefault();const a=Se.fromDom(e.getDoc()),i=Rr(a),l=((e,t,o)=>({element:e,clipboard:t,generators:o}))(n,s[0],i);t.pasteCells(r,l).each((()=>{e.focus()}))}}))}))}}))},ea=(e,t)=>({element:e,offset:t}),ta=(e,t,o)=>e.property().isText(t)&&0===e.property().getText(t).trim().length||e.property().isComment(t)?o(t).bind((t=>ta(e,t,o).orThunk((()=>C.some(t))))):C.none(),oa=(e,t)=>{if(e.property().isText(t))return e.property().getText(t).length;return e.property().children(t).length},na=(e,t)=>{const o=ta(e,t,e.query().prevSibling).getOr(t);if(e.property().isText(o))return ea(o,oa(e,o));const n=e.property().children(o);return n.length>0?na(e,n[n.length-1]):ea(o,oa(e,o))},ra=na,sa=Cs(),aa=(e,t)=>{if(!Ft(e)){const o=(e=>Wn(e).bind((e=>Rn(e,["fixed","relative","empty"]))))(e);o.each((o=>{const n=o.value/2;Kn(e,n,o.unit),Kn(t,n,o.unit)}))}},ia=e=>A(e,h(0)),la=(e,t,o,n,r)=>r(e.slice(0,t)).concat(n).concat(r(e.slice(o))),ca=e=>(t,o,n,r)=>{if(e(n)){const e=Math.max(r,t[o]-Math.abs(n)),s=Math.abs(e-t[o]);return n>=0?s:-s}return n},da=ca((e=>e<0)),ma=ca(x),ua=()=>{const e=(e,t,o,n)=>{const r=(100+o)/100,s=Math.max(n,(e[t]+o)/r);return A(e,((e,o)=>(o===t?s:e/r)-e))},t=(t,o,n,r,s,a)=>a?e(t,o,r,s):((e,t,o,n,r)=>{const s=da(e,t,n,r);return la(e,t,o+1,[s,0],ia)})(t,o,n,r,s);return{resizeTable:(e,t)=>e(t),clampTableDelta:da,calcLeftEdgeDeltas:t,calcMiddleDeltas:(e,o,n,r,s,a,i)=>t(e,n,r,s,a,i),calcRightEdgeDeltas:(t,o,n,r,s,a)=>{if(a)return e(t,n,r,s);{const e=da(t,n,r,s);return ia(t.slice(0,n)).concat([e])}},calcRedestributedWidths:(e,t,o,n)=>{if(n){const n=(t+o)/t,r=A(e,(e=>e/n));return{delta:100*n-100,newSizes:r}}return{delta:o,newSizes:e}}}},ga=()=>{const e=(e,t,o,n,r)=>{const s=ma(e,n>=0?o:t,n,r);return la(e,t,o+1,[s,-s],ia)};return{resizeTable:(e,t,o)=>{o&&e(t)},clampTableDelta:(e,t,o,n,r)=>{if(r){if(o>=0)return o;{const t=B(e,((e,t)=>e+t-n),0);return Math.max(-t,o)}}return da(e,t,o,n)},calcLeftEdgeDeltas:e,calcMiddleDeltas:(t,o,n,r,s,a)=>e(t,n,r,s,a),calcRightEdgeDeltas:(e,t,o,n,r,s)=>{if(s)return ia(e);{const t=n/e.length;return A(e,h(t))}},calcRedestributedWidths:(e,t,o,n)=>({delta:0,newSizes:e})}},ha=e=>tn.fromTable(e).grid,pa=he("th"),fa=e=>F(e,(e=>pa(e.element))),va=(e,t)=>e&&t?"sectionCells":e?"section":"cells",ba=e=>{const t="thead"===e.section,o=wt(ya(e.cells),"th");return"tfoot"===e.section?{type:"footer"}:t||o?{type:"header",subType:va(t,o)}:{type:"body"}},ya=e=>{const t=N(e,(e=>pa(e.element)));return 0===t.length?C.some("td"):t.length===e.length?C.some("th"):C.none()},wa=(e,t,o)=>ot(o(e.element,t),!0,e.isLocked),xa=(e,t)=>e.section!==t?nt(e.element,e.cells,t,e.isNew):e,Ca=()=>({transformRow:xa,transformCell:(e,t,o)=>{const n=o(e.element,t),r="td"!==se(n)?((e,t)=>{const o=Je(e,t);ze(e,o);const n=Ie(e);return We(o,n),qe(e),o})(n,"td"):n;return ot(r,e.isNew,e.isLocked)}}),Sa=()=>({transformRow:xa,transformCell:wa}),ka=()=>({transformRow:(e,t)=>xa(e,"thead"===t?"tbody":t),transformCell:wa}),_a=(e,t)=>{const o=(e=>j(e.all,(e=>{const t=ba(e);return"header"===t.type?C.from(t.subType):C.none()})))(tn.fromTable(e)).getOr(t);switch(o){case"section":return Ca();case"sectionCells":return Sa();case"cells":return ka()}},Ea=Ca,Ta=Sa,Oa=ka,Aa=()=>({transformRow:p,transformCell:wa}),Da=(e,t,o,n)=>{o===n?we(e,t):fe(e,t,o)},Ma=(e,t,o)=>{U(mt(e,t)).fold((()=>Ve(e,o)),(e=>ze(e,o)))},Na=(e,t)=>{const o=[],n=[],r=e=>A(e,(e=>{e.isNew&&o.push(e.element);const t=e.element;return $e(t),D(e.cells,(e=>{e.isNew&&n.push(e.element),Da(e.element,"colspan",e.colspan,1),Da(e.element,"rowspan",e.rowspan,1),Ze(t,e.element)})),t})),s=e=>P(e,(e=>A(e.cells,(e=>(Da(e.element,"span",e.colspan,1),e.element))))),a=(t,o)=>{const n=((e,t)=>{const o=vt(e,t).getOrThunk((()=>{const o=Se.fromTag(t,De(e).dom);return"thead"===t?Ma(e,"caption,colgroup",o):"colgroup"===t?Ma(e,"caption",o):Ze(e,o),o}));return $e(o),o})(e,o),a=("colgroup"===o?s:r)(t);We(n,a)},i=(t,o)=>{t.length>0?a(t,o):(t=>{vt(e,t).each(qe)})(o)},l=[],c=[],d=[],m=[];return D(t,(e=>{switch(e.section){case"thead":l.push(e);break;case"tbody":c.push(e);break;case"tfoot":d.push(e);break;case"colgroup":m.push(e)}})),i(m,"colgroup"),i(l,"thead"),i(c,"tbody"),i(d,"tfoot"),{newRows:o,newCells:n}},Ra=(e,t)=>{if(0===e.length)return 0;const o=e[0];return H(e,(e=>!t(o.element,e.element))).getOr(e.length)},Ba=(e,t,o,n)=>{const r=((e,t)=>e[t])(e,t),s="colgroup"===r.section,a=Ra(r.cells.slice(o),n),i=s?1:Ra(((e,t)=>A(e,(e=>jo(e,t))))(e.slice(t),o),n);return{colspan:a,rowspan:i}},La=(e,t)=>{const o=A(e,(e=>A(e.cells,w)));return A(e,((n,r)=>{const s=P(n.cells,((n,s)=>{if(!1===o[r][s]){const d=Ba(e,r,s,t);return((e,t,n,r)=>{for(let s=e;s({element:e,cells:t,section:o,isNew:n}))(n.element,s,n.section,n.isNew)}))},Ha=(e,t,o)=>{const n=[];D(e.colgroups,(r=>{const s=[];for(let n=0;not(e.element,o,!1))).getOrThunk((()=>ot(t.colGap(),!0,!1)));s.push(r)}n.push(nt(r.element,s,"colgroup",o))}));for(let r=0;rot(e.element,o,e.isLocked))).getOrThunk((()=>ot(t.gap(),!0,!1)));s.push(a)}const a=e.all[r],i=nt(a.element,s,a.section,o);n.push(i)}return n},Ia=e=>La(e,Te),Pa=(e,t)=>j(e.all,(e=>L(e.cells,(e=>Te(t,e.element))))),Fa=(e,t,o)=>{const n=A(t.selection,(t=>Wt(t).bind((t=>Pa(e,t))).filter(o))),r=xt(n);return Ct(r.length>0,r)},za=(e,t,o,n,r)=>(s,a,i,l)=>{const c=tn.fromTable(s),d=C.from(null==l?void 0:l.section).getOrThunk(Aa);return t(c,a).map((t=>{const o=((e,t)=>Ha(e,t,!1))(c,i),n=e(o,t,Te,r(i),d),s=Xo(n.grid);return{info:t,grid:Ia(n.grid),cursor:n.cursor,lockedColumns:s}})).bind((e=>{const t=Na(s,e.grid),r=C.from(null==l?void 0:l.sizing).getOrThunk((()=>dr(s))),a=C.from(null==l?void 0:l.resize).getOrThunk(ga);return o(s,e.grid,e.info,{sizing:r,resize:a,section:d}),n(s),we(s,Ko),e.lockedColumns.length>0&&fe(s,Ko,e.lockedColumns.join(",")),C.some({cursor:e.cursor,newRows:t.newRows,newCells:t.newCells})}))},Va=(e,t)=>Fa(e,t,x).map((e=>({cells:e,generators:t.generators,clipboard:t.clipboard}))),Za=(e,t)=>Fa(e,t,x),Ua=(e,t)=>Fa(e,t,(e=>!e.isLocked)),ja=(e,t)=>F(t,(t=>((e,t)=>Pa(e,t).exists((e=>!e.isLocked)))(e,t))),Wa=(e,t,o,n)=>{const r=qo(e).rows;let s=!0;for(let e=0;e{const r=qo(e).rows;if(t>0&&tB(e,((e,o)=>T(e,(e=>t(e.element,o.element)))?e:e.concat([o])),[]))(r[t-1].cells,o);D(e,(e=>{let s=C.none();for(let a=t;a{Zo(i,t,ot(e,!0,l.isLocked))})))}}))}return e},qa=e=>{const t=t=>t(e),o=h(e),n=()=>r,r={tag:!0,inner:e,fold:(t,o)=>o(e),isValue:x,isError:w,map:t=>Ka.value(t(e)),mapError:n,bind:t,exists:t,forall:t,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:t=>{t(e)},toOptional:()=>C.some(e)};return r},Ga=e=>{const t=()=>o,o={tag:!1,inner:e,fold:(t,o)=>t(e),isValue:w,isError:x,map:t,mapError:t=>Ka.error(t(e)),bind:t,exists:w,forall:x,getOr:p,or:p,getOrThunk:y,orThunk:y,getOrDie:(n=String(e),()=>{throw new Error(n)}),each:g,toOptional:C.none};var n;return o},Ka={value:qa,error:Ga,fromOption:(e,t)=>e.fold((()=>Ga(t)),qa)},Ya=(e,t)=>({rowDelta:0,colDelta:$o(e[0])-$o(t[0])}),Xa=(e,t)=>({rowDelta:e.length-t.length,colDelta:0}),Ja=(e,t,o,n)=>{const r="colgroup"===t.section?o.col:o.cell;return O(e,(e=>ot(r(),!0,n(e))))},Qa=(e,t,o,n)=>{const r=e[e.length-1];return e.concat(O(t,(()=>{const e="colgroup"===r.section?o.colgroup:o.row,t=Go(r,e,p),s=Ja(t.cells.length,t,o,(e=>Q(n,e.toString())));return Uo(t,s)})))},ei=(e,t,o,n)=>A(e,(e=>{const r=Ja(t,e,o,w);return zo(e,n,r)})),ti=(e,t,o)=>{const n=t.colDelta<0?ei:p,r=t.rowDelta<0?Qa:p,s=Xo(e),a=$o(e[0]),i=T(s,(e=>e===a-1)),l=n(e,Math.abs(t.colDelta),o,i?a-1:a),c=Xo(l);return r(l,Math.abs(t.rowDelta),o,z(c,x))},oi=(e,t,o,n)=>{const r=v(n,jo(e[t],o).element),s=e[t];return e.length>1&&$o(s)>1&&(o>0&&r(Wo(s,o-1))||o0&&r(Wo(e[t-1],o))||tN(o,(o=>o>=e.column&&o<=$o(t[0])+e.column)),ri=(e,t,o,n,r)=>{const s=Xo(t),a=((e,t,o)=>{const n=$o(t[0]),r=qo(t).cols.length+e.row,s=O(n-e.column,(t=>t+e.column)),a=L(s,(e=>F(o,(t=>t!==e)))).getOr(n-1);return{row:r,column:a}})(e,t,s),i=qo(o).rows,l=ni(a,i,s),c=((e,t,o)=>{if(e.row>=t.length||e.column>$o(t[0]))return Ka.error("invalid start address out of table bounds, row: "+e.row+", column: "+e.column);const n=t.slice(e.row),r=n[0].cells.slice(e.column),s=$o(o[0]),a=o.length;return Ka.value({rowDelta:n.length-a,colDelta:r.length-s})})(a,t,i);return c.map((e=>{const o={...e,colDelta:e.colDelta-l.length},s=ti(t,o,n),c=Xo(s),d=ni(a,i,c);return((e,t,o,n,r,s)=>{const a=e.row,i=e.column,l=a+o.length,c=i+$o(o[0])+s.length,d=z(s,x);for(let e=a;e{((e,t,o,n)=>{t>0&&t{const r=e.cells[t-1];let s=0;const a=n();for(;e.cells.length>t+s&&o(r.element,e.cells[t+s].element);)Zo(e,t+s,ot(a,!0,e.cells[t+s].isLocked)),s++}))})(t,e,r,n.cell);const s=Xa(o,t),a=ti(o,s,n),i=Xa(t,a),l=ti(t,i,n);return A(l,((t,o)=>zo(t,e,a[o].cells)))},ai=(e,t,o,n,r)=>{$a(t,e,r,n.cell);const s=Xo(t),a=Ya(t,o),i={...a,colDelta:a.colDelta-s.length},l=ti(t,i,n),{cols:c,rows:d}=qo(l),m=Xo(l),u=Ya(o,t),g={...u,colDelta:u.colDelta+m.length},h=((e,t,o)=>A(e,(e=>B(o,((o,n)=>{const r=Ja(1,e,t,x)[0];return Vo(o,n,r)}),e))))(o,n,m),p=ti(h,g,n);return[...c,...d.slice(0,e),...p,...d.slice(e,d.length)]},ii=(e,t,o,n,r)=>{const{rows:s,cols:a}=qo(e),i=s.slice(0,t),l=s.slice(t),c=((e,t,o,n)=>Go(e,(e=>n(e,o)),t))(s[o],((e,o)=>t>0&&tA(e,(e=>{const s=t>0&&t<$o(e)&&n(Wo(e,t-1),Wo(e,t)),a=((e,t,o,n,r,s,a)=>{if("colgroup"!==o&&n)return jo(e,t);{const t=jo(e,r);return ot(a(t.element,s),!0,!1)}})(e,t,e.section,s,o,n,r);return Vo(e,t,a)})),ci=(e,t,o,n)=>((e,t,o,n)=>void 0!==Wo(e[t],o)&&t>0&&n(Wo(e[t-1],o),Wo(e[t],o)))(e,t,o,n)||((e,t,o)=>t>0&&o(Wo(e,t-1),Wo(e,t)))(e[t],o,n),di=(e,t,o,n)=>{const r=e=>"row"===e?(e=>Pt(e,"rowspan")>1)(t):Ft(t),s=e=>r(e)?`${e}group`:e;if(e)return pa(t)?s(o):null;if(n&&pa(t)){return s("row"===o?"col":"row")}return null},mi=(e,t,o)=>ot(o(e.element,t),!0,e.isLocked),ui=(e,t,o,n,r,s,a)=>A(e,((e,i)=>((e,t)=>{const o=e.cells,n=A(o,t);return nt(e.element,n,e.section,e.isNew)})(e,((e,l)=>{if((e=>T(t,(t=>o(e.element,t.element))))(e)){const t=a(e,i,l)?r(e,o,n):e;return s(t,i,l).each((e=>{var o,n;o=t.element,n={scope:C.from(e)},q(n,((e,t)=>{e.fold((()=>{we(o,t)}),(e=>{pe(o.dom,t,e)}))}))})),t}return e})))),gi=(e,t,o)=>P(e,((n,r)=>ci(e,r,t,o)?[]:[jo(n,t)])),hi=(e,t,o,n,r)=>{const s=qo(e).rows,a=P(t,(e=>gi(s,e,n))),i=A(s,(e=>fa(e.cells))),l=((e,t)=>F(t,p)&&fa(e)?x:(e,o,n)=>!("th"===se(e.element)&&t[o]))(a,i),c=((e,t)=>(o,n)=>C.some(di(e,o.element,"row",t[n])))(o,i);return ui(e,a,n,r,mi,c,l)},pi=(e,t,o,n,r,s,a)=>{const{cols:i,rows:l}=qo(e),c=l[t[0]],d=P(t,(e=>((e,t,o)=>{const n=e[t];return P(n.cells,((n,r)=>ci(e,t,r,o)?[]:[n]))})(l,e,r))),m=A(c.cells,((e,t)=>fa(gi(l,t,r)))),u=[...l];D(t,(e=>{u[e]=a.transformRow(l[e],o)}));const g=[...i,...u],h=((e,t)=>F(t,p)&&fa(e.cells)?x:(e,o,n)=>!("th"===se(e.element)&&t[n]))(c,m),f=((e,t)=>(o,n,r)=>C.some(di(e,o.element,"col",t[r])))(n,m);return ui(g,d,r,s,a.transformCell,f,h)},fi=(e,t,o,n)=>{const r=qo(e).rows,s=A(t,(e=>jo(r[e.row],e.column)));return ui(e,s,o,n,mi,C.none,x)},vi=e=>{if(!a(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],o={};return D(e,((n,r)=>{const s=W(n);if(1!==s.length)throw new Error("one and only one name per case");const i=s[0],l=n[i];if(void 0!==o[i])throw new Error("duplicate key detected:"+i);if("cata"===i)throw new Error("cannot have a case named cata (sorry)");if(!a(l))throw new Error("case arguments must be an array");t.push(i),o[i]=(...o)=>{const n=o.length;if(n!==l.length)throw new Error("Wrong number of arguments to case "+i+". Expected "+l.length+" ("+l+"), got "+n);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[r].apply(null,o)},match:e=>{const n=W(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));if(!F(t,(e=>E(n,e))))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[i].apply(null,o)},log:e=>{console.log(e,{constructors:t,constructor:i,params:o})}}}})),o},bi={...vi([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])},yi=(e,t,o,n,r)=>{const s=e.slice(0),a=((e,t)=>0===e.length?bi.none():1===e.length?bi.only(0):0===t?bi.left(0,1):t===e.length-1?bi.right(t-1,t):t>0&&tn.singleColumnWidth(s[e],o)),((e,t)=>r.calcLeftEdgeDeltas(s,e,t,o,n.minCellWidth(),n.isRelative)),((e,t,a)=>r.calcMiddleDeltas(s,e,t,a,o,n.minCellWidth(),n.isRelative)),((e,t)=>r.calcRightEdgeDeltas(s,e,t,o,n.minCellWidth(),n.isRelative)))},wi=(e,t)=>tn.hasColumns(e)?((e,t)=>{const o=tn.justColumns(e);return A(o,((e,o)=>({element:e.element,width:t[o],colspan:e.colspan})))})(e,t):((e,t)=>{const o=tn.justCells(e);return A(o,(e=>{const o=((e,t,o)=>{let n=0;for(let r=e;r{const n=wi(e,t);D(n,(e=>{o.setElementWidth(e.element,e.width)}))},Ci=(e,t,o,n,r)=>{const s=tn.fromTable(e),a=r.getCellDelta(t),i=r.getWidths(s,r),l=o===s.grid.columns-1,c=n.clampTableDelta(i,o,a,r.minCellWidth(),l),d=yi(i,o,c,r,n),m=A(d,((e,t)=>e+i[t]));xi(s,m,r),n.resizeTable(r.adjustTableWidth,c,l)},Si=(e,t,o)=>{const n=tn.fromTable(e),r=((e,t)=>sr(e,t,Gn,(e=>e.getOrThunk(Zt))))(n,e),s=A(r,((e,n)=>o===n?Math.max(t+e,Zt()):e)),a=((e,t)=>A(e.all,((e,o)=>({element:e.element,height:t[o]}))))(n,s);D(a,(e=>{Vn(e.element,e.height)})),D(tn.justCells(n),(e=>{(e=>{Ht(e,"height")})(e.element)}));const i=R(s,((e,t)=>e+t),0);Vn(e,i)},ki=e=>B(e,((e,t)=>T(e,(e=>e.column===t.column))?e:e.concat([t])),[]).sort(((e,t)=>e.column-t.column)),_i=he("col"),Ei=he("colgroup"),Ti=e=>"tr"===se(e)||Ei(e),Oi=e=>({element:e,colspan:It(e,"colspan",1),rowspan:It(e,"rowspan",1)}),Ai=e=>ye(e,"scope").map((e=>e.substr(0,3))),Di=(e,t=Oi)=>{const o=o=>{if(Ti(o))return Ei((r={element:o}).element)?e.colgroup(r):e.row(r);{const r=o,s=(t=>_i(t.element)?e.col(t):e.cell(t))(t(r));return n=C.some({item:r,replacement:s}),s}var r};let n=C.none();return{getOrInit:(e,t)=>n.fold((()=>o(e)),(n=>t(e,n.item)?n.replacement:o(e)))}},Mi=e=>t=>{const o=[],n=n=>{const r="td"===e?{scope:null}:{},s=t.replace(n,e,r);return o.push({item:n,sub:s}),s};return{replaceOrInit:(e,t)=>{if(Ti(e)||_i(e))return e;{const r=e;return((e,t)=>L(o,(o=>t(o.item,e))))(r,t).fold((()=>n(r)),(o=>t(e,o.item)?o.sub:n(r)))}}}},Ni=e=>({unmerge:t=>{const o=Ai(t);return o.each((e=>fe(t,"scope",e))),()=>{const n=e.cell({element:t,colspan:1,rowspan:1});return Ht(n,"width"),Ht(t,"width"),o.each((e=>fe(n,"scope",e))),n}},merge:e=>(Ht(e[0],"width"),(()=>{const t=xt(A(e,Ai));if(0===t.length)return C.none();{const e=t[0],o=["row","col"];return T(t,(t=>t!==e&&E(o,t)))?C.none():C.from(e)}})().fold((()=>we(e[0],"scope")),(t=>fe(e[0],"scope",t+"group"))),h(e[0]))}),Ri=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Bi=Cs(),Li=e=>((e,t)=>{const o=e.property().name(t);return E(Ri,o)})(Bi,e),Hi=e=>((e,t)=>{const o=e.property().name(t);return E(["ol","ul"],o)})(Bi,e),Ii=e=>((e,t)=>E(["br","img","hr","input"],e.property().name(t)))(Bi,e),Pi=e=>{const t=he("br"),o=e=>Sr(e).bind((o=>{const n=He(o).map((e=>!!Li(e)||!!Ii(e)&&"img"!==se(e))).getOr(!1);return Ne(o).map((r=>!0===n||(e=>"li"===se(e)||ht(e,Hi).isSome())(r)||t(o)||Li(r)&&!Te(e,r)?[]:[Se.fromTag("br")]))})).getOr([]),n=(()=>{const n=P(e,(e=>{const n=Ie(e);return(e=>F(e,(e=>t(e)||me(e)&&0===fr(e).trim().length)))(n)?[]:n.concat(o(e))}));return 0===n.length?[Se.fromTag("br")]:n})();$e(e[0]),We(e[0],n)},Fi=e=>Qr(e,!0),zi=e=>{0===$t(e).length&&qe(e)},Vi=(e,t)=>({grid:e,cursor:t}),Zi=(e,t,o)=>{var n,r;const s=qo(e).rows;return C.from(null===(r=null===(n=s[t])||void 0===n?void 0:n.cells[o])||void 0===r?void 0:r.element).filter(Fi).orThunk((()=>(e=>j(e,(e=>j(e.cells,(e=>{const t=e.element;return Ct(Fi(t),t)})))))(s)))},Ui=(e,t,o)=>{const n=Zi(e,t,o);return Vi(e,n)},ji=e=>B(e,((e,t)=>T(e,(e=>e.row===t.row))?e:e.concat([t])),[]).sort(((e,t)=>e.row-t.row)),Wi=(e,t)=>(o,n,r,s,a)=>{const i=ji(n),l=A(i,(e=>e.row)),c=pi(o,l,e,t,r,s.replaceOrInit,a);return Ui(c,n[0].row,n[0].column)},$i=Wi("thead",!0),qi=Wi("tbody",!1),Gi=Wi("tfoot",!1),Ki=(e,t,o)=>{const n=((e,t)=>Xt(e,(()=>t)))(e,o.section),r=tn.generate(n);return Ha(r,t,!0)},Yi=(e,t,o,n)=>((e,t,o,n)=>{const r=tn.generate(t),s=n.getWidths(r,n);xi(r,s,n)})(0,t,0,n.sizing),Xi=(e,t,o,n)=>((e,t,o,n,r)=>{const s=tn.generate(t),a=n.getWidths(s,n),i=n.pixelWidth(),{newSizes:l,delta:c}=r.calcRedestributedWidths(a,i,o.pixelDelta,n.isRelative);xi(s,l,n),n.adjustTableWidth(c)})(0,t,o,n.sizing,n.resize),Ji=(e,t)=>T(t,(e=>0===e.column&&e.isLocked)),Qi=(e,t)=>T(t,(t=>t.column+t.colspan>=e.grid.columns&&t.isLocked)),el=(e,t)=>{const o=on(e),n=ki(t);return B(n,((e,t)=>e+o[t.column].map(Io).getOr(0)),0)},tl=e=>(t,o)=>Za(t,o).filter((o=>!(e?Ji:Qi)(t,o))).map((e=>({details:e,pixelDelta:el(t,e)}))),ol=e=>(t,o)=>Va(t,o).filter((o=>!(e?Ji:Qi)(t,o.cells))),nl=Mi("th"),rl=Mi("td"),sl=za(((e,t,o,n)=>{const r=t[0].row,s=ji(t),a=R(s,((e,t)=>({grid:ii(e.grid,r,t.row+e.delta,o,n.getOrInit),delta:e.delta+1})),{grid:e,delta:0}).grid;return Ui(a,r,t[0].column)}),Za,g,g,Di),al=za(((e,t,o,n)=>{const r=ji(t),s=r[r.length-1],a=s.row+s.rowspan,i=R(r,((e,t)=>ii(e,a,t.row,o,n.getOrInit)),e);return Ui(i,a,t[0].column)}),Za,g,g,Di),il=za(((e,t,o,n)=>{const r=t.details,s=ki(r),a=s[0].column,i=R(s,((e,t)=>({grid:li(e.grid,a,t.column+e.delta,o,n.getOrInit),delta:e.delta+1})),{grid:e,delta:0}).grid;return Ui(i,r[0].row,a)}),tl(!0),Xi,g,Di),ll=za(((e,t,o,n)=>{const r=t.details,s=r[r.length-1],a=s.column+s.colspan,i=ki(r),l=R(i,((e,t)=>li(e,a,t.column,o,n.getOrInit)),e);return Ui(l,r[0].row,a)}),tl(!1),Xi,g,Di),cl=za(((e,t,o,n)=>{const r=ki(t.details),s=((e,t)=>P(e,(e=>{const o=e.cells,n=R(t,((e,t)=>t>=0&&t0?[nt(e.element,n,e.section,e.isNew)]:[]})))(e,A(r,(e=>e.column))),a=s.length>0?s[0].cells.length-1:0;return Ui(s,r[0].row,Math.min(r[0].column,a))}),((e,t)=>Ua(e,t).map((t=>({details:t,pixelDelta:-el(e,t)})))),Xi,zi,Di),dl=za(((e,t,o,n)=>{const r=ji(t),s=((e,t,o)=>{const{rows:n,cols:r}=qo(e);return[...r,...n.slice(0,t),...n.slice(o+1)]})(e,r[0].row,r[r.length-1].row),a=Math.max(qo(s).rows.length-1,0);return Ui(s,Math.min(t[0].row,a),t[0].column)}),Za,g,zi,Di),ml=za(((e,t,o,n)=>{const r=ki(t),s=A(r,(e=>e.column)),a=hi(e,s,!0,o,n.replaceOrInit);return Ui(a,t[0].row,t[0].column)}),Ua,g,g,nl),ul=za(((e,t,o,n)=>{const r=ki(t),s=A(r,(e=>e.column)),a=hi(e,s,!1,o,n.replaceOrInit);return Ui(a,t[0].row,t[0].column)}),Ua,g,g,rl),gl=za($i,Ua,g,g,nl),hl=za(qi,Ua,g,g,rl),pl=za(Gi,Ua,g,g,rl),fl=za(((e,t,o,n)=>{const r=fi(e,t,o,n.replaceOrInit);return Ui(r,t[0].row,t[0].column)}),Ua,g,g,nl),vl=za(((e,t,o,n)=>{const r=fi(e,t,o,n.replaceOrInit);return Ui(r,t[0].row,t[0].column)}),Ua,g,g,rl),bl=za(((e,t,o,n)=>{const r=t.cells;Pi(r);const s=((e,t,o,n)=>{const r=qo(e).rows;if(0===r.length)return e;for(let e=t.startRow;e<=t.finishRow;e++)for(let o=t.startCol;o<=t.finishCol;o++){const t=r[e],s=jo(t,o).isLocked;Zo(t,o,ot(n(),!1,s))}return e})(e,t.bounds,0,n.merge(r));return Vi(s,C.from(r[0]))}),((e,t)=>((e,t)=>t.mergable)(0,t).filter((t=>ja(e,t.cells)))),Yi,g,Ni),yl=za(((e,t,o,n)=>{const r=R(t,((e,t)=>Wa(e,t,o,n.unmerge(t))),e);return Vi(r,C.from(t[0]))}),((e,t)=>((e,t)=>t.unmergable)(0,t).filter((t=>ja(e,t)))),Yi,g,Ni),wl=za(((e,t,o,n)=>{const r=((e,t)=>{const o=tn.fromTable(e);return Ha(o,t,!0)})(t.clipboard,t.generators),s=((e,t)=>({row:e,column:t}))(t.row,t.column);return ri(s,e,r,t.generators,o).fold((()=>Vi(e,C.some(t.element))),(e=>Ui(e,t.row,t.column)))}),((e,t)=>Wt(t.element).bind((o=>Pa(e,o).map((e=>({...e,generators:t.generators,clipboard:t.clipboard})))))),Yi,g,Di),xl=za(((e,t,o,n)=>{const r=qo(e).rows,s=t.cells[0].column,a=r[t.cells[0].row],i=Ki(t.clipboard,t.generators,a),l=si(s,e,i,t.generators,o);return Ui(l,t.cells[0].row,t.cells[0].column)}),ol(!0),g,g,Di),Cl=za(((e,t,o,n)=>{const r=qo(e).rows,s=t.cells[t.cells.length-1].column+t.cells[t.cells.length-1].colspan,a=r[t.cells[0].row],i=Ki(t.clipboard,t.generators,a),l=si(s,e,i,t.generators,o);return Ui(l,t.cells[0].row,s)}),ol(!1),g,g,Di),Sl=za(((e,t,o,n)=>{const r=qo(e).rows,s=t.cells[0].row,a=r[s],i=Ki(t.clipboard,t.generators,a),l=ai(s,e,i,t.generators,o);return Ui(l,t.cells[0].row,t.cells[0].column)}),Va,g,g,Di),kl=za(((e,t,o,n)=>{const r=qo(e).rows,s=t.cells[t.cells.length-1].row+t.cells[t.cells.length-1].rowspan,a=r[t.cells[0].row],i=Ki(t.clipboard,t.generators,a),l=ai(s,e,i,t.generators,o);return Ui(l,s,t.cells[0].column)}),Va,g,g,Di),_l=(e,t)=>{const o=tn.fromTable(e);return Za(o,t).bind((e=>{const t=e[e.length-1],n=e[0].column,r=t.column+t.colspan,s=I(A(o.all,(e=>N(e.cells,(e=>e.column>=n&&e.column{const o=tn.fromTable(e);return Za(o,t).bind(ya).getOr("")},Tl=(e,t)=>{const o=tn.fromTable(e);return Za(o,t).bind((e=>{const t=e[e.length-1],n=e[0].row,r=t.row+t.rowspan;return(e=>{const t=A(e,(e=>ba(e).type)),o=E(t,"header"),n=E(t,"footer");if(o||n){const e=E(t,"body");return!o||e||n?o||e||!n?C.none():C.some("footer"):C.some("header")}return C.some("body")})(o.all.slice(n,r))})).getOr("")},Ol=(e,t)=>e.dispatch("NewRow",{node:t}),Al=(e,t)=>e.dispatch("NewCell",{node:t}),Dl=(e,t,o)=>{e.dispatch("TableModified",{...o,table:t})},Ml={structure:!1,style:!0},Nl={structure:!0,style:!1},Rl={structure:!0,style:!0},Bl=(e,t)=>Ur(e)?ur(t):jr(e)?mr(t):dr(t),Ll=(e,t,o)=>{const n=e=>"table"===se(ts(e)),r=Ir(e),s=Vr(e)?g:aa,a=t=>{switch(Pr(e)){case"section":return Ea();case"sectionCells":return Ta();case"cells":return Oa();default:return _a(t,"section")}},i=(t,n)=>n.cursor.fold((()=>{const n=$t(t);return Z(n).filter(it).map((n=>{o.clearSelectedCells(t.dom);const r=e.dom.createRng();return r.selectNode(n.dom),e.selection.setRng(r),fe(n,"data-mce-selected","1"),r}))}),(n=>{const r=ra(sa,n);const s=e.dom.createRng();return s.setStart(r.element.dom,r.offset),s.setEnd(r.element.dom,r.offset),e.selection.setRng(s),o.clearSelectedCells(t.dom),C.some(s)})),l=(o,n,s,l)=>(c,d,m=!1)=>{ns(c);const u=Se.fromDom(e.getDoc()),g=Nr(s,u,r),h={sizing:Bl(e,c),resize:Vr(e)?ua():ga(),section:a(c)};return n(c)?o(c,d,g,h).bind((o=>{t.refresh(c.dom),D(o.newRows,(t=>{Ol(e,t.dom)})),D(o.newCells,(t=>{Al(e,t.dom)}));const n=i(c,o);return it(c)&&(ns(c),m||Dl(e,c.dom,l)),n.map((e=>({rng:e,effect:l})))})):C.none()},c=l(dl,(t=>!n(e)||ha(t).rows>1),g,Nl),d=l(cl,(t=>!n(e)||ha(t).columns>1),g,Nl);return{deleteRow:c,deleteColumn:d,insertRowsBefore:l(sl,x,g,Nl),insertRowsAfter:l(al,x,g,Nl),insertColumnsBefore:l(il,x,s,Nl),insertColumnsAfter:l(ll,x,s,Nl),mergeCells:l(bl,x,g,Nl),unmergeCells:l(yl,x,g,Nl),pasteColsBefore:l(xl,x,g,Nl),pasteColsAfter:l(Cl,x,g,Nl),pasteRowsBefore:l(Sl,x,g,Nl),pasteRowsAfter:l(kl,x,g,Nl),pasteCells:l(wl,x,g,Rl),makeCellsHeader:l(fl,x,g,Nl),unmakeCellsHeader:l(vl,x,g,Nl),makeColumnsHeader:l(ml,x,g,Nl),unmakeColumnsHeader:l(ul,x,g,Nl),makeRowsHeader:l(gl,x,g,Nl),makeRowsBody:l(hl,x,g,Nl),makeRowsFooter:l(pl,x,g,Nl),getTableRowType:Tl,getTableCellType:El,getTableColType:_l}},Hl=(e,t,o)=>{const n=It(e,t,1);1===o||n<=1?we(e,t):fe(e,t,Math.min(o,n))},Il=(e,t)=>o=>{const n=o.column+o.colspan-1,r=o.column;return n>=e&&r{const o=tn.fromTable(e);return Ua(o,t).map((e=>{const t=e[e.length-1],n=e[0].column,r=t.column+t.colspan,s=((e,t,o)=>{if(tn.hasColumns(e)){const n=N(tn.justColumns(e),Il(t,o)),r=A(n,(e=>{const n=Xe(e.element);return Hl(n,"span",o-t),n})),s=Se.fromTag("colgroup");return We(s,r),[s]}return[]})(o,n,r),a=((e,t,o)=>A(e.all,(e=>{const n=N(e.cells,Il(t,o)),r=A(n,(e=>{const n=Xe(e.element);return Hl(n,"colspan",o-t),n})),s=Se.fromTag("tr");return We(s,r),s})))(o,n,r);return[...s,...a]}))},Fl=(e,t,o)=>{const n=tn.fromTable(e);return Za(n,t).bind((e=>{const t=Ha(n,o,!1),r=qo(t).rows.slice(e[0].row,e[e.length-1].row+e[e.length-1].rowspan),s=P(r,(e=>{const t=N(e.cells,(e=>!e.isLocked));return t.length>0?[{...e,cells:t}]:[]})),a=Ia(s);return Ct(a.length>0,a)})).map((e=>(e=>A(e,(e=>{const t=Ye(e.element);return D(e.cells,(e=>{const o=Xe(e.element);Da(o,"colspan",e.colspan,1),Da(o,"rowspan",e.rowspan,1),Ze(t,o)})),t})))(e)))},zl=vi([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),Vl=(e,t,o)=>{const n=o.substring(0,o.length-e.length),r=parseFloat(n);return n===r.toString()?t(r):zl.invalid(o)},Zl={...zl,from:e=>Et(e,"%")?Vl("%",zl.percent,e):Et(e,"px")?Vl("px",zl.pixels,e):zl.invalid(e)},Ul=(e,t,o)=>e.fold((()=>t),(e=>((e,t,o)=>{const n=o/t;return A(e,(e=>Zl.from(e).fold((()=>e),(e=>e*n+"px"),(e=>e/100*o+"px"))))})(t,o,e)),(e=>((e,t)=>A(e,(e=>Zl.from(e).fold((()=>e),(e=>e/t*100+"%"),(e=>e+"%")))))(t,o))),jl=(e,t,o)=>{const n=Zl.from(o),r=F(e,(e=>"0px"===e))?((e,t)=>{const o=e.fold((()=>h("")),(e=>h(e/t+"px")),(()=>h(100/t+"%")));return O(t,o)})(n,e.length):Ul(n,e,t);return ql(r)},Wl=(e,t)=>0===e.length?t:R(e,((e,t)=>Zl.from(t).fold(h(0),p,p)+e),0),$l=(e,t)=>Zl.from(e).fold(h(e),(e=>e+t+"px"),(e=>e+t+"%")),ql=e=>{if(0===e.length)return e;const t=R(e,((e,t)=>{const o=Zl.from(t).fold((()=>({value:t,remainder:0})),(e=>((e,t)=>{const o=Math.floor(e);return{value:o+t,remainder:e-o}})(e,"px")),(e=>({value:e+"%",remainder:0})));return{output:[o.value].concat(e.output),remainder:e.remainder+o.remainder}}),{output:[],remainder:0}),o=t.output;return o.slice(0,o.length-1).concat([$l(o[o.length-1],Math.round(t.remainder))])},Gl=Zl.from,Kl=(e,t,o)=>{const n=tn.fromTable(e),r=n.all,s=tn.justCells(n),a=tn.justColumns(n);t.each((t=>{const o=Gl(t).fold(h("px"),h("px"),h("%"));const r=Ho(e),i=((e,t)=>or(e,t,Qn,nr))(n,e),l=jl(i,r,t);tn.hasColumns(n)?((e,t,o)=>{D(t,((t,n)=>{const r=Wl([e[n]],Vt());Mt(t.element,"width",r+o)}))})(l,a,o):((e,t,o)=>{D(t,(t=>{const n=e.slice(t.column,t.colspan+t.column),r=Wl(n,Vt());Mt(t.element,"width",r+o)}))})(l,s,o),Mt(e,"width",t)})),o.each((t=>{const o=dn(e),a=((e,t)=>sr(e,t,er,nr))(n,e);((e,t,o)=>{D(o,(e=>{Ht(e.element,"height")})),D(t,((t,o)=>{Mt(t.element,"height",e[o])}))})(jl(a,o,t),r,s),Mt(e,"height",t)}))},Yl=e=>Wn(e).exists((e=>Bn.test(e))),Xl=e=>Wn(e).exists((e=>Ln.test(e))),Jl=e=>Wn(e).isNone(),Ql=e=>{we(e,"width"),we(e,"height")},ec=e=>{const t=Yn(e);Kl(e,C.some(t),C.none()),Ql(e)},tc=e=>{const t=(e=>Ho(e)+"px")(e);Kl(e,C.some(t),C.none()),Ql(e)},oc=e=>{const t=(e=>dn(e)+"px")(e);Kl(e,C.none(),C.some(t)),Ql(e)},nc=e=>{Ht(e,"width");const t=qt(e),o=t.length>0?t:$t(e);D(o,(e=>{Ht(e,"width"),Ql(e)})),Ql(e)},rc={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},sc=e=>{const t=Se.fromTag("colgroup");return O(e,(()=>Ze(t,Se.fromTag("col")))),t},ac=(e,t,o,n)=>O(e,(e=>((e,t,o,n)=>{const r=Se.fromTag("tr");for(let s=0;s{e.selection.select(t.dom,!0),e.selection.collapse(!0)},lc=(e,t,o,n,s)=>{const a=Yr(e),i={styles:a,attributes:Kr(e),colGroups:Xr(e)};return e.undoManager.ignore((()=>{const r=((e,t,o,n,r,s=rc)=>{const a=Se.fromTag("table"),i="cells"!==r;Nt(a,s.styles),ve(a,s.attributes),s.colGroups&&Ze(a,sc(t));const l=Math.min(e,o);if(i&&o>0){const e=Se.fromTag("thead");Ze(a,e);const s=ac(o,t,"sectionCells"===r?l:0,n);We(e,s)}const c=Se.fromTag("tbody");Ze(a,c);const d=ac(i?e-l:e,t,i?0:o,n);return We(c,d),a})(o,t,s,n,Pr(e),i);fe(r,"data-mce-id","__mce");const a=(e=>{const t=Se.fromTag("div"),o=Se.fromDom(e.dom.cloneNode(!0));return Ze(t,o),(e=>e.dom.innerHTML)(t)})(r);e.insertContent(a),e.addVisual()})),bt(ts(e),'table[data-mce-id="__mce"]').map((t=>(jr(e)?tc(t):Wr(e)?nc(t):(Ur(e)||(e=>r(e)&&-1!==e.indexOf("%"))(a.width))&&ec(t),ns(t),we(t,"data-mce-id"),((e,t)=>{D(ut(t,"tr"),(t=>{Ol(e,t.dom),D(ut(t,"th,td"),(t=>{Al(e,t.dom)}))}))})(e,t),((e,t)=>{bt(t,"td,th").each(v(ic,e))})(e,t),t.dom))).getOrNull()};var cc=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const dc="x-tinymce/dom-table-",mc=dc+"rows",uc=dc+"columns",gc=e=>{const t=cc.FakeClipboardItem(e);cc.write([t])},hc=e=>{var t;const o=null!==(t=cc.read())&&void 0!==t?t:[];return j(o,(t=>C.from(t.getType(e))))},pc=e=>{hc(e).isSome()&&cc.clear()},fc=e=>{e.fold(bc,(e=>gc({[mc]:e})))},vc=()=>hc(mc),bc=()=>pc(mc),yc=e=>{e.fold(xc,(e=>gc({[uc]:e})))},wc=()=>hc(uc),xc=()=>pc(uc),Cc=e=>Ys(rs(e),os(e)).filter(ds),Sc=(e,t)=>{const o=os(e),n=e=>Gt(e,o),a=t=>(e=>Xs(rs(e),os(e)).filter(ds))(e).bind((e=>n(e).map((o=>t(o,e))))),i=t=>{e.focus()},l=(t,o=!1)=>a(((n,r)=>{const s=Gs(Js(e),n,r);t(n,s,o).each(i)})),c=()=>a(((t,o)=>{const n=Gs(Js(e),t,o),r=Nr(g,Se.fromDom(e.getDoc()),C.none());return Fl(t,n,r)})),d=()=>a(((t,o)=>{const n=Gs(Js(e),t,o);return Pl(t,n)})),m=(t,o)=>o().each((o=>{const n=A(o,(e=>Xe(e)));a(((o,r)=>{const s=Rr(Se.fromDom(e.getDoc())),a=((e,t,o,n)=>({selection:Hs(e),clipboard:o,generators:n}))(Js(e),0,n,s);t(o,a).each(i)}))})),h=e=>(t,o)=>((e,t)=>Q(e,t)?C.from(e[t]):C.none())(o,"type").each((t=>{l(e(t),o.no_events)}));q({mceTableSplitCells:()=>l(t.unmergeCells),mceTableMergeCells:()=>l(t.mergeCells),mceTableInsertRowBefore:()=>l(t.insertRowsBefore),mceTableInsertRowAfter:()=>l(t.insertRowsAfter),mceTableInsertColBefore:()=>l(t.insertColumnsBefore),mceTableInsertColAfter:()=>l(t.insertColumnsAfter),mceTableDeleteCol:()=>l(t.deleteColumn),mceTableDeleteRow:()=>l(t.deleteRow),mceTableCutCol:()=>d().each((e=>{yc(e),l(t.deleteColumn)})),mceTableCutRow:()=>c().each((e=>{fc(e),l(t.deleteRow)})),mceTableCopyCol:()=>d().each((e=>yc(e))),mceTableCopyRow:()=>c().each((e=>fc(e))),mceTablePasteColBefore:()=>m(t.pasteColsBefore,wc),mceTablePasteColAfter:()=>m(t.pasteColsAfter,wc),mceTablePasteRowBefore:()=>m(t.pasteRowsBefore,vc),mceTablePasteRowAfter:()=>m(t.pasteRowsAfter,vc),mceTableDelete:()=>Cc(e).each((t=>{Gt(t,o).filter(b(o)).each((t=>{const o=Se.fromText("");if(ze(t,o),qe(t),e.dom.isEmpty(e.getBody()))e.setContent(""),e.selection.setCursorLocation();else{const t=e.dom.createRng();t.setStart(o.dom,0),t.setEnd(o.dom,0),e.selection.setRng(t),e.nodeChanged()}}))})),mceTableCellToggleClass:(t,o)=>{a((t=>{const n=Js(e),r=F(n,(t=>e.formatter.match("tablecellclass",{value:o},t.dom))),s=r?e.formatter.remove:e.formatter.apply;D(n,(e=>s("tablecellclass",{value:o},e.dom))),Dl(e,t.dom,Ml)}))},mceTableToggleClass:(t,o)=>{a((t=>{e.formatter.toggle("tableclass",{value:o},t.dom),Dl(e,t.dom,Ml)}))},mceTableToggleCaption:()=>{Cc(e).each((t=>{Gt(t,o).each((o=>{vt(o,"caption").fold((()=>{const t=Se.fromTag("caption");Ze(t,Se.fromText("Caption")),((e,t,o)=>{Pe(e,o).fold((()=>{Ze(e,t)}),(e=>{Fe(e,t)}))})(o,t,0),e.selection.setCursorLocation(t.dom,0)}),(n=>{he("caption")(t)&&Ee("td",o).each((t=>e.selection.setCursorLocation(t.dom,0))),qe(n)})),Dl(e,o.dom,Nl)}))}))},mceTableSizingMode:(t,n)=>(t=>Cc(e).each((n=>{Wr(e)||jr(e)||Ur(e)||Gt(n,o).each((o=>{"relative"!==t||Yl(o)?"fixed"!==t||Xl(o)?"responsive"!==t||Jl(o)||nc(o):tc(o):ec(o),ns(o),Dl(e,o.dom,Nl)}))})))(n),mceTableCellType:h((e=>"th"===e?t.makeCellsHeader:t.unmakeCellsHeader)),mceTableColType:h((e=>"th"===e?t.makeColumnsHeader:t.unmakeColumnsHeader)),mceTableRowType:h((e=>{switch(e){case"header":return t.makeRowsHeader;case"footer":return t.makeRowsFooter;default:return t.makeRowsBody}}))},((t,o)=>e.addCommand(o,t))),e.addCommand("mceInsertTable",((t,o)=>{((e,t,o,n={})=>{const r=e=>u(e)&&e>0;if(r(t)&&r(o)){const r=n.headerRows||0,s=n.headerColumns||0;return lc(e,o,t,s,r)}console.error("Invalid values for mceInsertTable - rows and columns values are required to insert a table.")})(e,o.rows,o.columns,o.options)})),e.addCommand("mceTableApplyCellStyle",((t,o)=>{const a=e=>"tablecell"+e.toLowerCase().replace("-","");if(!s(o))return;const i=N(Js(e),ds);if(0===i.length)return;const l=Y(o,((t,o)=>e.formatter.has(a(o))&&r(t)));(e=>{for(const t in e)if($.call(e,t))return!1;return!0})(l)||(q(l,((t,o)=>{const n=a(o);D(i,(o=>{""===t?e.formatter.remove(n,{value:null},o.dom,!0):e.formatter.apply(n,{value:t},o.dom)}))})),n(i[0]).each((t=>Dl(e,t.dom,Ml))))}))},kc=vi([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),_c={before:kc.before,on:kc.on,after:kc.after,cata:(e,t,o,n)=>e.fold(t,o,n),getStart:e=>e.fold(p,p,p)},Ec=(e,t)=>({selection:e,kill:t}),Tc=(e,t)=>{const o=e.document.createRange();return o.selectNode(t.dom),o},Oc=(e,t)=>{const o=e.document.createRange();return Ac(o,t),o},Ac=(e,t)=>e.selectNodeContents(t.dom),Dc=(e,t,o)=>{const n=e.document.createRange();var r;return r=n,t.fold((e=>{r.setStartBefore(e.dom)}),((e,t)=>{r.setStart(e.dom,t)}),(e=>{r.setStartAfter(e.dom)})),((e,t)=>{t.fold((t=>{e.setEndBefore(t.dom)}),((t,o)=>{e.setEnd(t.dom,o)}),(t=>{e.setEndAfter(t.dom)}))})(n,o),n},Mc=(e,t,o,n,r)=>{const s=e.document.createRange();return s.setStart(t.dom,o),s.setEnd(n.dom,r),s},Nc=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}),Rc=vi([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Bc=(e,t,o)=>t(Se.fromDom(o.startContainer),o.startOffset,Se.fromDom(o.endContainer),o.endOffset),Lc=(e,t)=>{const o=((e,t)=>t.match({domRange:e=>({ltr:h(e),rtl:C.none}),relative:(t,o)=>({ltr:eo((()=>Dc(e,t,o))),rtl:eo((()=>C.some(Dc(e,o,t))))}),exact:(t,o,n,r)=>({ltr:eo((()=>Mc(e,t,o,n,r))),rtl:eo((()=>C.some(Mc(e,n,r,t,o))))})}))(e,t);return((e,t)=>{const o=t.ltr();if(o.collapsed)return t.rtl().filter((e=>!1===e.collapsed)).map((e=>Rc.rtl(Se.fromDom(e.endContainer),e.endOffset,Se.fromDom(e.startContainer),e.startOffset))).getOrThunk((()=>Bc(0,Rc.ltr,o)));return Bc(0,Rc.ltr,o)})(0,o)},Hc=(e,t)=>Lc(e,t).match({ltr:(t,o,n,r)=>{const s=e.document.createRange();return s.setStart(t.dom,o),s.setEnd(n.dom,r),s},rtl:(t,o,n,r)=>{const s=e.document.createRange();return s.setStart(n.dom,r),s.setEnd(t.dom,o),s}});Rc.ltr,Rc.rtl;const Ic=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n}),Pc=(e,t,o,n)=>({start:_c.on(e,t),finish:_c.on(o,n)}),Fc=(e,t)=>{const o=Hc(e,t);return Ic(Se.fromDom(o.startContainer),o.startOffset,Se.fromDom(o.endContainer),o.endOffset)},zc=Pc,Vc=(e,t,o,n,r)=>Te(o,n)?C.none():Ds(o,n,t).bind((t=>{const n=t.boxes.getOr([]);return n.length>1?(r(e,n,t.start,t.finish),C.some(Ec(C.some(zc(o,0,o,yr(o))),!0))):C.none()})),Zc=(e,t)=>({item:e,mode:t}),Uc=(e,t,o,n=jc)=>e.property().parent(t).map((e=>Zc(e,n))),jc=(e,t,o,n=Wc)=>o.sibling(e,t).map((e=>Zc(e,n))),Wc=(e,t,o,n=Wc)=>{const r=e.property().children(t);return o.first(r).map((e=>Zc(e,n)))},$c=[{current:Uc,next:jc,fallback:C.none()},{current:jc,next:Wc,fallback:C.some(Uc)},{current:Wc,next:Wc,fallback:C.some(jc)}],qc=(e,t,o,n,r=$c)=>L(r,(e=>e.current===o)).bind((o=>o.current(e,t,n,o.next).orThunk((()=>o.fallback.bind((o=>qc(e,t,o,n))))))),Gc=()=>({sibling:(e,t)=>e.query().prevSibling(t),first:e=>e.length>0?C.some(e[e.length-1]):C.none()}),Kc=()=>({sibling:(e,t)=>e.query().nextSibling(t),first:e=>e.length>0?C.some(e[0]):C.none()}),Yc=(e,t,o,n,r,s)=>qc(e,t,n,r).bind((t=>s(t.item)?C.none():o(t.item)?C.some(t.item):Yc(e,t.item,o,t.mode,r,s))),Xc=e=>t=>0===e.property().children(t).length,Jc=(e,t,o,n)=>Yc(e,t,o,jc,Gc(),n),Qc=(e,t,o,n)=>Yc(e,t,o,jc,Kc(),n),ed=Cs(),td=(e,t)=>((e,t,o)=>Jc(e,t,Xc(e),o))(ed,e,t),od=(e,t)=>((e,t,o)=>Qc(e,t,Xc(e),o))(ed,e,t),nd=vi([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),rd=e=>yt(e,"tr"),sd={...nd,verify:(e,t,o,n,r,s,a)=>yt(n,"td,th",a).bind((o=>yt(t,"td,th",a).map((t=>Te(o,t)?Te(n,o)&&yr(o)===r?s(t):nd.none("in same cell"):Os(rd,[o,t]).fold((()=>((e,t,o)=>{const n=e.getRect(t),r=e.getRect(o);return r.right>n.left&&r.lefts(t))))))).getOr(nd.none("default")),cata:(e,t,o,n,r)=>e.fold(t,o,n,r)},ad=(e,t)=>H(e,v(Te,t)),id=he("br"),ld=(e,t,o)=>t(e,o).bind((e=>me(e)&&0===fr(e).trim().length?ld(e,t,o):C.some(e))),cd=(e,t,o,n)=>((e,t)=>Pe(e,t).filter(id).orThunk((()=>Pe(e,t-1).filter(id))))(t,o).bind((t=>n.traverse(t).fold((()=>ld(t,n.gather,e).map(n.relative)),(e=>(e=>Ne(e).bind((t=>{const o=Ie(t);return ad(o,e).map((n=>((e,t,o,n)=>({parent:e,children:t,element:o,index:n}))(t,o,e,n)))})))(e).map((e=>_c.on(e.parent,e.index))))))),dd=(e,t,o,n)=>{const r=id(t)?((e,t,o)=>o.traverse(t).orThunk((()=>ld(t,o.gather,e))).map(o.relative))(e,t,n):cd(e,t,o,n);return r.map((e=>({start:e,finish:e})))},md=(e,t)=>({left:e.left,top:e.top+t,right:e.right,bottom:e.bottom+t}),ud=(e,t)=>({left:e.left,top:e.top-t,right:e.right,bottom:e.bottom-t}),gd=(e,t,o)=>({left:e.left+t,top:e.top+o,right:e.right+t,bottom:e.bottom+o}),hd=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom}),pd=(e,t)=>C.some(e.getRect(t)),fd=(e,t,o)=>de(t)?pd(e,t).map(hd):me(t)?((e,t,o)=>o>=0&&o0?e.getRangedRect(t,o-1,t,o):C.none())(e,t,o).map(hd):C.none(),vd=(e,t)=>de(t)?pd(e,t).map(hd):me(t)?e.getRangedRect(t,0,t,yr(t)).map(hd):C.none(),bd=vi([{none:[]},{retry:["caret"]}]),yd=(e,t,o)=>pt(t,Li).fold(w,(t=>vd(e,t).exists((e=>((e,t)=>e.leftt.right)(o,e))))),wd={point:e=>e.bottom,adjuster:(e,t,o,n,r)=>{const s=md(r,5);return Math.abs(o.bottom-n.bottom)<1||o.top>r.bottom?bd.retry(s):o.top===r.bottom?bd.retry(md(r,1)):yd(e,t,r)?bd.retry(gd(s,5,0)):bd.none()},move:md,gather:od},xd=(e,t,o,n,r)=>0===r?C.some(n):((e,t,o)=>e.elementFromPoint(t,o).filter((e=>"table"===se(e))).isSome())(e,n.left,t.point(n))?((e,t,o,n,r)=>xd(e,t,o,t.move(n,5),r))(e,t,o,n,r-1):e.situsFromPoint(n.left,t.point(n)).bind((s=>s.start.fold(C.none,(s=>vd(e,s).bind((a=>t.adjuster(e,s,a,o,n).fold(C.none,(n=>xd(e,t,o,n,r-1))))).orThunk((()=>C.some(n)))),C.none))),Cd=(e,t,o)=>{const n=e.move(o,5),r=xd(t,e,o,n,100).getOr(n);return((e,t,o)=>e.point(t)>o.getInnerHeight()?C.some(e.point(t)-o.getInnerHeight()):e.point(t)<0?C.some(-e.point(t)):C.none())(e,r,t).fold((()=>t.situsFromPoint(r.left,e.point(r))),(o=>(t.scrollBy(0,o),t.situsFromPoint(r.left,e.point(r)-o))))},Sd={tryUp:v(Cd,{point:e=>e.top,adjuster:(e,t,o,n,r)=>{const s=ud(r,5);return Math.abs(o.top-n.top)<1||o.bottome.getSelection().bind((n=>dd(t,n.finish,n.foffset,o).fold((()=>C.some(ea(n.finish,n.foffset))),(r=>{const s=e.fromSitus(r);return(e=>sd.cata(e,(e=>C.none()),(()=>C.none()),(e=>C.some(ea(e,0))),(e=>C.some(ea(e,yr(e))))))(sd.verify(e,n.finish,n.foffset,s.finish,s.foffset,o.failure,t))})))),_d=(e,t,o,n,r,s)=>0===s?C.none():Od(e,t,o,n,r).bind((a=>{const i=e.fromSitus(a),l=sd.verify(e,o,n,i.finish,i.foffset,r.failure,t);return sd.cata(l,(()=>C.none()),(()=>C.some(a)),(a=>Te(o,a)&&0===n?Ed(e,o,n,ud,r):_d(e,t,a,0,r,s-1)),(a=>Te(o,a)&&n===yr(a)?Ed(e,o,n,md,r):_d(e,t,a,yr(a),r,s-1)))})),Ed=(e,t,o,n,r)=>fd(e,t,o).bind((t=>Td(e,r,n(t,Sd.getJumpSize())))),Td=(e,t,o)=>{const n=Do().browser;return n.isChromium()||n.isSafari()||n.isFirefox()?t.retry(e,o):C.none()},Od=(e,t,o,n,r)=>fd(e,o,n).bind((t=>Td(e,r,t))),Ad=(e,t)=>{return ht(e,(e=>Ne(e).exists((e=>Te(e,t)))),o).isSome();var o},Dd=(e,t,o,n,r)=>yt(n,"td,th",t).bind((n=>yt(n,"table",t).bind((s=>Ad(r,s)?((e,t,o)=>kd(e,t,o).bind((n=>_d(e,t,n.element,n.offset,o,20).map(e.fromSitus))))(e,t,o).bind((e=>yt(e.finish,"td,th",t).map((t=>({start:n,finish:t,range:e}))))):C.none())))),Md=(e,t,o,n,r,s)=>s(n,t).orThunk((()=>Dd(e,t,o,n,r).map((e=>{const t=e.range;return Ec(C.some(zc(t.start,t.soffset,t.finish,t.foffset)),!0)})))),Nd=(e,t)=>yt(e,"tr",t).bind((e=>yt(e,"table",t).bind((o=>{const n=ut(o,"tr");return Te(e,n[0])?((e,t,o)=>Jc(ed,e,t,o))(o,(e=>Sr(e).isSome()),t).map((e=>{const t=yr(e);return Ec(C.some(zc(e,t,e,t)),!0)})):C.none()})))),Rd=(e,t)=>yt(e,"tr",t).bind((e=>yt(e,"table",t).bind((o=>{const n=ut(o,"tr");return Te(e,n[n.length-1])?((e,t,o)=>Qc(ed,e,t,o))(o,(e=>Cr(e).isSome()),t).map((e=>Ec(C.some(zc(e,0,e,0)),!0))):C.none()})))),Bd=(e,t,o,n,r,s,a)=>Dd(e,o,n,r,s).bind((e=>Vc(t,o,e.start,e.finish,a))),Ld=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},Hd=()=>{const e=(e=>{const t=Ld(C.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(C.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(C.some(e))}}})(g);return{...e,on:t=>e.get().each(t)}},Id=(e,t)=>yt(e,"td,th",t),Pd=e=>Re(e).exists(Qr),Fd={traverse:He,gather:od,relative:_c.before,retry:Sd.tryDown,failure:sd.failedDown},zd={traverse:Le,gather:td,relative:_c.before,retry:Sd.tryUp,failure:sd.failedUp},Vd=e=>t=>t===e,Zd=Vd(38),Ud=Vd(40),jd=e=>e>=37&&e<=40,Wd={isBackward:Vd(37),isForward:Vd(39)},$d={isBackward:Vd(39),isForward:Vd(37)},qd=vi([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Gd={domRange:qd.domRange,relative:qd.relative,exact:qd.exact,exactFromRange:e=>qd.exact(e.start,e.soffset,e.finish,e.foffset),getWin:e=>{const t=(e=>e.match({domRange:e=>Se.fromDom(e.startContainer),relative:(e,t)=>_c.getStart(e),exact:(e,t,o,n)=>e}))(e);return o=t,Se.fromDom(Me(o).dom.defaultView);var o},range:Ic},Kd=(e,t,o)=>e.caretPositionFromPoint?((e,t,o)=>{var n;return C.from(null===(n=e.caretPositionFromPoint)||void 0===n?void 0:n.call(e,t,o)).bind((t=>{if(null===t.offsetNode)return C.none();const o=e.createRange();return o.setStart(t.offsetNode,t.offset),o.collapse(),C.some(o)}))})(e,t,o):e.caretRangeFromPoint?((e,t,o)=>{var n;return C.from(null===(n=e.caretRangeFromPoint)||void 0===n?void 0:n.call(e,t,o))})(e,t,o):C.none(),Yd=(e,t)=>{const o=se(e);return"input"===o?_c.after(e):E(["br","img"],o)?0===t?_c.before(e):_c.after(e):_c.on(e,t)},Xd=(e,t,o,n)=>{const r=((e,t,o,n)=>{const r=De(e).dom.createRange();return r.setStart(e.dom,t),r.setEnd(o.dom,n),r})(e,t,o,n),s=Te(e,o)&&t===n;return r.collapsed&&!s},Jd=e=>C.from(e.getSelection()),Qd=(e,t)=>{Jd(e).each((e=>{e.removeAllRanges(),e.addRange(t)}))},em=(e,t,o,n,r)=>{const s=Mc(e,t,o,n,r);Qd(e,s)},tm=(e,t)=>Lc(e,t).match({ltr:(t,o,n,r)=>{em(e,t,o,n,r)},rtl:(t,o,n,r)=>{Jd(e).each((s=>{if(s.setBaseAndExtent)s.setBaseAndExtent(t.dom,o,n.dom,r);else if(s.extend)try{((e,t,o,n,r,s)=>{t.collapse(o.dom,n),t.extend(r.dom,s)})(0,s,t,o,n,r)}catch(s){em(e,n,r,t,o)}else em(e,n,r,t,o)}))}}),om=(e,t,o,n,r)=>{const s=((e,t,o,n)=>{const r=Yd(e,t),s=Yd(o,n);return Gd.relative(r,s)})(t,o,n,r);tm(e,s)},nm=(e,t,o)=>{const n=((e,t)=>{const o=e.fold(_c.before,Yd,_c.after),n=t.fold(_c.before,Yd,_c.after);return Gd.relative(o,n)})(t,o);tm(e,n)},rm=e=>{if(e.rangeCount>0){const t=e.getRangeAt(0),o=e.getRangeAt(e.rangeCount-1);return C.some(Ic(Se.fromDom(t.startContainer),t.startOffset,Se.fromDom(o.endContainer),o.endOffset))}return C.none()},sm=e=>{if(null===e.anchorNode||null===e.focusNode)return rm(e);{const t=Se.fromDom(e.anchorNode),o=Se.fromDom(e.focusNode);return Xd(t,e.anchorOffset,o,e.focusOffset)?C.some(Ic(t,e.anchorOffset,o,e.focusOffset)):rm(e)}},am=(e,t,o=!0)=>{const n=(o?Oc:Tc)(e,t);Qd(e,n)},im=e=>(e=>Jd(e).filter((e=>e.rangeCount>0)).bind(sm))(e).map((e=>Gd.exact(e.start,e.soffset,e.finish,e.foffset))),lm=(e,t)=>(e=>{const t=e.getClientRects(),o=t.length>0?t[0]:e.getBoundingClientRect();return o.width>0||o.height>0?C.some(o).map(Nc):C.none()})(Hc(e,t)),cm=(e,t,o)=>((e,t,o)=>{const n=e.document;return Kd(n,t,o).map((e=>Ic(Se.fromDom(e.startContainer),e.startOffset,Se.fromDom(e.endContainer),e.endOffset)))})(e,t,o),dm=e=>({elementFromPoint:(t,o)=>Se.fromPoint(Se.fromDom(e.document),t,o),getRect:e=>e.dom.getBoundingClientRect(),getRangedRect:(t,o,n,r)=>{const s=Gd.exact(t,o,n,r);return lm(e,s)},getSelection:()=>im(e).map((t=>Fc(e,t))),fromSitus:t=>{const o=Gd.relative(t.start,t.finish);return Fc(e,o)},situsFromPoint:(t,o)=>cm(e,t,o).map((e=>Pc(e.start,e.soffset,e.finish,e.foffset))),clearSelection:()=>{(e=>{Jd(e).each((e=>e.removeAllRanges()))})(e)},collapseSelection:(t=!1)=>{im(e).each((o=>o.fold((e=>e.collapse(t)),((o,n)=>{const r=t?o:n;nm(e,r,r)}),((o,n,r,s)=>{const a=t?o:r,i=t?n:s;om(e,a,i,a,i)}))))},setSelection:t=>{om(e,t.start,t.soffset,t.finish,t.foffset)},setRelativeSelection:(t,o)=>{nm(e,t,o)},selectNode:t=>{am(e,t,!1)},selectContents:t=>{am(e,t)},getInnerHeight:()=>e.innerHeight,getScrollY:()=>(e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return hn(o,n)})(Se.fromDom(e.document)).top,scrollBy:(t,o)=>{((e,t,o)=>{const n=(void 0!==o?o.dom:document).defaultView;n&&n.scrollBy(e,t)})(t,o,Se.fromDom(e.document))}}),mm=(e,t)=>({rows:e,cols:t}),um=(e,t,o,n)=>{const r=((e,t,o,n)=>{const r=Hd(),s=r.clear,a=s=>{r.on((r=>{n.clearBeforeUpdate(t),Id(s.target,o).each((a=>{Ds(r,a,o).each((o=>{const r=o.boxes.getOr([]);if(1===r.length){const e=r[0],o="false"===es(e),a=wt(Jr(s.target),e,Te);o&&a&&n.selectRange(t,r,e,e)}else r.length>1&&(n.selectRange(t,r,o.start,o.finish),e.selectContents(a))}))}))}))};return{clearstate:s,mousedown:e=>{n.clear(t),Id(e.target,o).filter(Pd).each(r.set)},mouseover:e=>{a(e)},mouseup:e=>{a(e),s()}}})(dm(e),t,o,n);return{clearstate:r.clearstate,mousedown:r.mousedown,mouseover:r.mouseover,mouseup:r.mouseup}},gm=e=>pt(e,ce).exists(Qr),hm=(e,t)=>gm(e)||gm(t),pm=(e,t,o,n)=>{const r=dm(e),s=()=>(n.clear(t),C.none());return{keydown:(e,a,i,l,c,d)=>{const m=e.raw,u=m.which,g=!0===m.shiftKey,h=Ms(t,n.selectedSelector).fold((()=>(jd(u)&&!g&&n.clearBeforeUpdate(t),jd(u)&&g&&!hm(a,l)?C.none:Ud(u)&&g?v(Bd,r,t,o,Fd,l,a,n.selectRange):Zd(u)&&g?v(Bd,r,t,o,zd,l,a,n.selectRange):Ud(u)?v(Md,r,o,Fd,l,a,Rd):Zd(u)?v(Md,r,o,zd,l,a,Nd):C.none)),(e=>{const o=o=>()=>{const s=j(o,(o=>((e,t,o,n,r)=>Rs(n,e,t,r.firstSelectedSelector,r.lastSelectedSelector).map((e=>(r.clearBeforeUpdate(o),r.selectRange(o,e.boxes,e.start,e.finish),e.boxes))))(o.rows,o.cols,t,e,n)));return s.fold((()=>Ns(t,n.firstSelectedSelector,n.lastSelectedSelector).map((e=>{const o=Ud(u)||d.isForward(u)?_c.after:_c.before;return r.setRelativeSelection(_c.on(e.first,0),o(e.table)),n.clear(t),Ec(C.none(),!0)}))),(e=>C.some(Ec(C.none(),!0))))};return jd(u)&&g&&!hm(a,l)?C.none:Ud(u)&&g?o([mm(1,0)]):Zd(u)&&g?o([mm(-1,0)]):d.isBackward(u)&&g?o([mm(0,-1),mm(-1,0)]):d.isForward(u)&&g?o([mm(0,1),mm(1,0)]):jd(u)&&!g?s:C.none}));return h()},keyup:(e,r,s,a,i)=>Ms(t,n.selectedSelector).fold((()=>{const l=e.raw,c=l.which;return!0===l.shiftKey&&jd(c)&&hm(r,a)?((e,t,o,n,r,s,a)=>Te(o,r)&&n===s?C.none():yt(o,"td,th",t).bind((o=>yt(r,"td,th",t).bind((n=>Vc(e,t,o,n,a))))))(t,o,r,s,a,i,n.selectRange):C.none()}),C.none)}},fm=(e,t)=>{const o=be(e,t);return void 0===o||""===o?[]:o.split(" ")},vm=e=>void 0!==e.dom.classList,bm=(e,t)=>((e,t,o)=>{const n=fm(e,t).concat([o]);return fe(e,t,n.join(" ")),!0})(e,"class",t),ym=(e,t)=>{vm(e)?e.dom.classList.add(t):bm(e,t)},wm=(e,t)=>vm(e)&&e.dom.classList.contains(t),xm=(e,t,o)=>{const n=t=>{we(t,e.selected),we(t,e.firstSelected),we(t,e.lastSelected)},r=t=>{fe(t,e.selected,"1")},s=e=>{a(e),o()},a=t=>{const o=ut(t,`${e.selectedSelector},${e.firstSelectedSelector},${e.lastSelectedSelector}`);D(o,n)};return{clearBeforeUpdate:a,clear:s,selectRange:(o,n,a,i)=>{s(o),D(n,r),fe(a,e.firstSelected,"1"),fe(i,e.lastSelected,"1"),t(n,a,i)},selectedSelector:e.selectedSelector,firstSelectedSelector:e.firstSelectedSelector,lastSelectedSelector:e.lastSelectedSelector}},Cm=()=>({tag:"none"}),Sm=e=>({tag:"multiple",elements:e}),km=e=>({tag:"single",element:e}),_m=(e,t,o)=>{const n=tn.fromTable(e);return Za(n,t).map((e=>{const t=Ha(n,o,!1),{rows:r}=qo(t),s=((e,t)=>{const o=e.slice(0,t[t.length-1].row+1),n=Ia(o);return P(n,(e=>{const o=e.cells.slice(0,t[t.length-1].column+1);return A(o,(e=>e.element))}))})(r,e),a=((e,t)=>{const o=e.slice(t[0].row+t[0].rowspan-1,e.length),n=Ia(o);return P(n,(e=>{const o=e.cells.slice(t[0].column+t[0].colspan-1,e.cells.length);return A(o,(e=>e.element))}))})(r,e);return{upOrLeftCells:s,downOrRightCells:a}}))},Em=e=>{const t=Se.fromDom((e=>{if(d(e.target)){const t=Se.fromDom(e.target);if(de(t)&&at(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return Z(t)}}return C.from(e.target)})(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),r=(s=n,a=o,(...e)=>s(a.apply(null,e)));var s,a;return((e,t,o,n,r,s,a)=>({target:e,x:t,y:o,stop:n,prevent:r,kill:s,raw:a}))(t,e.clientX,e.clientY,o,n,r,e)},Tm=(e,t,o,n,r)=>{const s=((e,t)=>o=>{e(o)&&t(Em(o))})(o,n);return e.dom.addEventListener(t,s,r),{unbind:v(Om,e,t,s,r)}},Om=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},Am=x,Dm=(e,t,o)=>((e,t,o,n)=>Tm(e,t,o,n,!1))(e,t,Am,o),Mm=Em,Nm=e=>!wm(Se.fromDom(e.target),"ephox-snooker-resizer-bar"),Rm=(e,t)=>{const o=((e,t,o)=>({get:()=>Bs(e(),o).fold((()=>t().fold(Cm,km)),Sm)}))((()=>Se.fromDom(e.getBody())),(()=>Xs(rs(e),os(e))),qs.selectedSelector),n=xm(qs,((t,o,n)=>{Gt(o).each((r=>{const s=A(t,(e=>e.dom)),a=Ir(e),i=Nr(g,Se.fromDom(e.getDoc()),a),l=Js(e),c=_m(r,{selection:l},i).map((e=>G(e,(e=>A(e,(e=>e.dom)))))).getOrUndefined();((e,t,o,n,r)=>{e.dispatch("TableSelectionChange",{cells:t,start:o,finish:n,otherCells:r})})(e,s,o.dom,n.dom,c)}))}),(()=>(e=>{e.dispatch("TableSelectionClear")})(e)));e.on("init",(o=>{const r=e.getWin(),s=ts(e),a=os(e),i=um(r,s,a,n),l=pm(r,s,a,n),c=((e,t,o,n)=>{const r=dm(e);return(e,s)=>{n.clearBeforeUpdate(t),Ds(e,s,o).each((e=>{const o=e.boxes.getOr([]);n.selectRange(t,o,e.start,e.finish),r.selectContents(s),r.collapseSelection()}))}})(r,s,a,n);e.on("TableSelectorChange",(e=>c(e.start,e.finish)));const d=(t,o)=>{(e=>!0===e.raw.shiftKey)(t)&&(o.kill&&t.kill(),o.selection.each((t=>{const o=Gd.relative(t.start,t.finish),n=Hc(r,o);e.selection.setRng(n)})))},m=e=>0===e.button,u=(()=>{const e=Ld(Se.fromDom(s)),t=Ld(0);return{touchEnd:o=>{const n=Se.fromDom(o.target);if(he("td")(n)||he("th")(n)){const r=e.get(),s=t.get();Te(r,n)&&o.timeStamp-s<300&&(o.preventDefault(),c(n,n))}e.set(n),t.set(o.timeStamp)}}})();e.on("dragstart",(e=>{i.clearstate()})),e.on("mousedown",(e=>{m(e)&&Nm(e)&&i.mousedown(Mm(e))})),e.on("mouseover",(e=>{var t;(void 0===(t=e).buttons||1&t.buttons)&&Nm(e)&&i.mouseover(Mm(e))})),e.on("mouseup",(e=>{m(e)&&Nm(e)&&i.mouseup(Mm(e))})),e.on("touchend",u.touchEnd),e.on("keyup",(t=>{const o=Mm(t);if(o.raw.shiftKey&&jd(o.raw.which)){const t=e.selection.getRng(),n=Se.fromDom(t.startContainer),r=Se.fromDom(t.endContainer);l.keyup(o,n,t.startOffset,r,t.endOffset).each((e=>{d(o,e)}))}})),e.on("keydown",(o=>{const n=Mm(o);t.hide();const r=e.selection.getRng(),s=Se.fromDom(r.startContainer),a=Se.fromDom(r.endContainer),i=an(Wd,$d)(Se.fromDom(e.selection.getStart()));l.keydown(n,s,r.startOffset,a,r.endOffset,i).each((e=>{d(n,e)})),t.show()})),e.on("NodeChange",(()=>{const t=e.selection,o=Se.fromDom(t.getStart()),r=Se.fromDom(t.getEnd());Os(Gt,[o,r]).fold((()=>n.clear(s)),g)}))})),e.on("PreInit",(()=>{e.serializer.addTempAttr(qs.firstSelected),e.serializer.addTempAttr(qs.lastSelected)}));return{getSelectedCells:()=>((e,t,o,n)=>{switch(e.tag){case"none":return t();case"single":return n(e.element);case"multiple":return o(e.elements)}})(o.get(),h([]),(e=>A(e,(e=>e.dom))),(e=>[e.dom])),clearSelectedCells:e=>n.clear(Se.fromDom(e))}},Bm=e=>{let t=[];return{bind:e=>{if(void 0===e)throw new Error("Event bind error: undefined handler");t.push(e)},unbind:e=>{t=N(t,(t=>t!==e))},trigger:(...o)=>{const n={};D(e,((e,t)=>{n[e]=o[t]})),D(t,(e=>{e(n)}))}}},Lm=e=>({registry:G(e,(e=>({bind:e.bind,unbind:e.unbind}))),trigger:G(e,(e=>e.trigger))}),Hm=e=>e.slice(0).sort(),Im=(e,t,o)=>{if(0===t.length)throw new Error("You must specify at least one required field.");return((e,t)=>{if(!a(t))throw new Error("The "+e+" fields must be an array. Was: "+t+".");D(t,(t=>{if(!r(t))throw new Error("The value "+t+" in the "+e+" fields was not a string.")}))})("required",t),(e=>{const t=Hm(e);L(t,((e,o)=>o{throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+t.join(", ")+"].")}))})(t),n=>{const r=W(n);F(t,(e=>E(r,e)))||((e,t)=>{throw new Error("All required keys ("+Hm(e).join(", ")+") were not specified. Specified keys were: "+Hm(t).join(", ")+".")})(t,r),e(t,r);const s=N(t,(e=>!o.validate(n[e],e)));return s.length>0&&((e,t)=>{throw new Error("All values need to be of type: "+t+". Keys ("+Hm(e).join(", ")+") were not.")})(s,o.label),n}},Pm=(e,t)=>{const o=N(t,(t=>!E(e,t)));o.length>0&&(e=>{throw new Error("Unsupported keys for object: "+Hm(e).join(", "))})(o)},Fm=e=>((e,t)=>Im(e,t,{validate:m,label:"function"}))(Pm,e),zm=Fm(["compare","extract","mutate","sink"]),Vm=Fm(["element","start","stop","destroy"]),Zm=Fm(["forceDrop","drop","move","delayDrop"]),Um=()=>{let e=C.none();const t=Lm({move:Bm(["info"])});return{onEvent:(o,n)=>{n.extract(o).each((o=>{const r=((t,o)=>{const n=e.map((e=>t.compare(e,o)));return e=C.some(o),n})(n,o);r.each((e=>{t.trigger.move(e)}))}))},reset:()=>{e=C.none()},events:t.registry}},jm=()=>{const e=(()=>{const e=Lm({move:Bm(["info"])});return{onEvent:g,reset:g,events:e.registry}})(),t=Um();let o=e;return{on:()=>{o.reset(),o=t},off:()=>{o.reset(),o=e},isOn:()=>o===t,onEvent:(e,t)=>{o.onEvent(e,t)},events:t.events}},Wm=(e,t,o)=>{let n=!1;const r=Lm({start:Bm([]),stop:Bm([])}),s=jm(),a=()=>{d.stop(),s.isOn()&&(s.off(),r.trigger.stop())},l=((e,t)=>{let o=null;const n=()=>{i(o)||(clearTimeout(o),o=null)};return{cancel:n,throttle:(...r)=>{n(),o=setTimeout((()=>{o=null,e.apply(null,r)}),t)}}})(a,200);s.events.move.bind((o=>{t.mutate(e,o.info)}));const c=e=>(...t)=>{n&&e.apply(null,t)},d=t.sink(Zm({forceDrop:a,drop:c(a),move:c((e=>{l.cancel(),s.onEvent(e,t)})),delayDrop:c(l.throttle)}),o);return{element:d.element,go:e=>{d.start(e),s.on(),r.trigger.start()},on:()=>{n=!0},off:()=>{n=!1},isActive:()=>n,destroy:()=>{d.destroy()},events:r.registry}},$m=e=>{const t=e.replace(/\./g,"-");return{resolve:e=>t+"-"+e}},qm=$m("ephox-dragster").resolve;var Gm=zm({compare:(e,t)=>hn(t.left-e.left,t.top-e.top),extract:e=>C.some(hn(e.x,e.y)),sink:(e,t)=>{const o=(e=>{const t={layerClass:qm("blocker"),...e},o=Se.fromTag("div");return fe(o,"role","presentation"),Nt(o,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),ym(o,qm("blocker")),ym(o,t.layerClass),{element:h(o),destroy:()=>{qe(o)}}})(t),n=Dm(o.element(),"mousedown",e.forceDrop),r=Dm(o.element(),"mouseup",e.drop),s=Dm(o.element(),"mousemove",e.move),a=Dm(o.element(),"mouseout",e.delayDrop);return Vm({element:o.element,start:e=>{Ze(e,o.element())},stop:()=>{qe(o.element())},destroy:()=>{o.destroy(),r.unbind(),s.unbind(),a.unbind(),n.unbind()}})},mutate:(e,t)=>{e.mutate(t.left,t.top)}});const Km=$m("ephox-snooker").resolve,Ym=()=>{const e=Lm({drag:Bm(["xDelta","yDelta","target"])});let t=C.none();const o=(()=>{const e=Lm({drag:Bm(["xDelta","yDelta"])});return{mutate:(t,o)=>{e.trigger.drag(t,o)},events:e.registry}})();o.events.drag.bind((o=>{t.each((t=>{e.trigger.drag(o.xDelta,o.yDelta,t)}))}));return{assign:e=>{t=C.some(e)},get:()=>t,mutate:o.mutate,events:e.registry}},Xm=Km("resizer-bar"),Jm=Km("resizer-rows"),Qm=Km("resizer-cols"),eu=e=>{const t=ut(e.parent(),"."+Xm);D(t,qe)},tu=(e,t,o)=>{const n=e.origin();D(t,(t=>{t.each((t=>{const r=o(n,t);ym(r,Xm),Ze(e.parent(),r)}))}))},ou=(e,t,o,n)=>{tu(e,t,((e,t)=>{const r=((e,t,o,n,r)=>{const s=Se.fromTag("div");return Nt(s,{position:"absolute",left:t-n/2+"px",top:o+"px",height:r+"px",width:n+"px"}),ve(s,{"data-column":e,role:"presentation"}),s})(t.col,t.x-e.left,o.top-e.top,7,n);return ym(r,Qm),r}))},nu=(e,t,o,n)=>{tu(e,t,((e,t)=>{const r=((e,t,o,n,r)=>{const s=Se.fromTag("div");return Nt(s,{position:"absolute",left:t+"px",top:o-r/2+"px",height:r+"px",width:n+"px"}),ve(s,{"data-row":e,role:"presentation"}),s})(t.row,o.left-e.left,t.y-e.top,n,7);return ym(r,Jm),r}))},ru=(e,t,o,n,r)=>{const s=fn(o),a=t.isResizable,i=n.length>0?On.positions(n,o):[],l=i.length>0?((e,t)=>P(e.all,((e,o)=>t(e.element)?[o]:[])))(e,a):[],c=N(i,((e,t)=>T(l,(e=>t===e))));nu(t,c,s,Io(o));const d=r.length>0?Dn.positions(r,o):[],m=d.length>0?((e,t)=>{const o=[];return O(e.grid.columns,(n=>{const r=tn.getColumnAt(e,n).map((e=>e.element));r.forall(t)&&o.push(n)})),N(o,(o=>{const n=tn.filterItems(e,(e=>e.column===o));return F(n,(e=>t(e.element)))}))})(e,a):[],u=N(d,((e,t)=>T(m,(e=>t===e))));ou(t,u,s,mn(o))},su=(e,t)=>{if(eu(e),e.isResizable(t)){const o=tn.fromTable(t),n=rn(o),r=on(o);ru(o,e,t,n,r)}},au=(e,t)=>{const o=ut(e.parent(),"."+Xm);D(o,t)},iu=e=>{au(e,(e=>{Mt(e,"display","none")}))},lu=e=>{au(e,(e=>{Mt(e,"display","block")}))},cu=Km("resizer-bar-dragging"),du=e=>{const t=Ym(),o=((e,t={})=>{var o;const n=null!==(o=t.mode)&&void 0!==o?o:Gm;return Wm(e,n,t)})(t,{});let n=C.none();const r=(e,t)=>C.from(be(e,t));t.events.drag.bind((e=>{r(e.target,"data-row").each((t=>{const o=zt(e.target,"top");Mt(e.target,"top",o+e.yDelta+"px")})),r(e.target,"data-column").each((t=>{const o=zt(e.target,"left");Mt(e.target,"left",o+e.xDelta+"px")}))}));const s=(e,t)=>zt(e,t)-It(e,"data-initial-"+t,0);o.events.stop.bind((()=>{t.get().each((t=>{n.each((o=>{r(t,"data-row").each((e=>{const n=s(t,"top");we(t,"data-initial-top"),d.trigger.adjustHeight(o,n,parseInt(e,10))})),r(t,"data-column").each((e=>{const n=s(t,"left");we(t,"data-initial-left"),d.trigger.adjustWidth(o,n,parseInt(e,10))})),su(e,o)}))}))}));const a=(n,r)=>{d.trigger.startAdjust(),t.assign(n),fe(n,"data-initial-"+r,zt(n,r)),ym(n,cu),Mt(n,"opacity","0.2"),o.go(e.parent())},i=Dm(e.parent(),"mousedown",(e=>{var t;t=e.target,wm(t,Jm)&&a(e.target,"top"),(e=>wm(e,Qm))(e.target)&&a(e.target,"left")})),l=t=>Te(t,e.view()),c=Dm(e.view(),"mouseover",(t=>{var r;(r=t.target,yt(r,"table",l).filter(Qr)).fold((()=>{it(t.target)&&eu(e)}),(t=>{o.isActive()&&(n=C.some(t),su(e,t))}))})),d=Lm({adjustHeight:Bm(["table","delta","row"]),adjustWidth:Bm(["table","delta","column"]),startAdjust:Bm([])});return{destroy:()=>{i.unbind(),c.unbind(),o.destroy(),eu(e)},refresh:t=>{su(e,t)},on:o.on,off:o.off,hideBars:v(iu,e),showBars:v(lu,e),events:d.registry}},mu=(e,t,o)=>{const n=On,r=Dn,s=du(e),a=Lm({beforeResize:Bm(["table","type"]),afterResize:Bm(["table","type"]),startDrag:Bm([])});return s.events.adjustHeight.bind((e=>{const t=e.table;a.trigger.beforeResize(t,"row");const o=n.delta(e.delta,t);Si(t,o,e.row),a.trigger.afterResize(t,"row")})),s.events.startAdjust.bind((e=>{a.trigger.startDrag()})),s.events.adjustWidth.bind((e=>{const n=e.table;a.trigger.beforeResize(n,"col");const s=r.delta(e.delta,n),i=o(n);Ci(n,s,e.column,t,i),a.trigger.afterResize(n,"col")})),{on:s.on,off:s.off,refreshBars:s.refresh,hideBars:s.hideBars,showBars:s.showBars,destroy:s.destroy,events:a.registry}},uu=(e,t)=>{const o=ue(e)?(e=>Se.fromDom(Me(e).dom.documentElement))(e):e;return{parent:h(o),view:h(e),origin:h(hn(0,0)),isResizable:t}},gu=(e,t,o)=>({parent:h(t),view:h(e),origin:h(hn(0,0)),isResizable:o}),hu=()=>{const e=Se.fromTag("div");return Nt(e,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Ze(lt(Se.fromDom(document)),e),e},pu=e=>d(e)&&"TABLE"===e.nodeName,fu="bar-",vu=e=>"false"!==be(e,"data-mce-resize"),bu=e=>{return _t(t=e,o="corner-")?((e,t)=>e.substring(t))(t,o.length):t;var t,o},yu=e=>{const t=Hd(),o=Hd(),n=Hd();let r,s,a,i;const l=t=>Bl(e,t),c=()=>zr(e)?ga():ua(),d=(t,o,n,d)=>{const m=bu(o),u=Et(m,"e"),g=_t(m,"n");if(""===s&&ec(t),""===i&&oc(t),n!==r&&""!==s){Mt(t,"width",s);const o=c(),a=l(t),i=zr(e)||u?(e=>ha(e).columns)(t)-1:0;Ci(t,n-r,i,o,a)}else if((e=>/^(\d+(\.\d+)?)%$/.test(e))(s)){const e=parseFloat(s.replace("%",""));Mt(t,"width",n*e/r+"%")}if((e=>/^(\d+(\.\d+)?)px$/.test(e))(s)&&(e=>{const t=tn.fromTable(e);tn.hasColumns(t)||D($t(e),(e=>{const t=Rt(e,"width");Mt(e,"width",t),we(e,"width")}))})(t),d!==a&&""!==i){Mt(t,"height",i);const e=g?0:(e=>ha(e).rows)(t)-1;Si(t,d-a,e)}},m=()=>{o.on((e=>{e.destroy()})),n.on((t=>{((e,t)=>{e.inline&&qe(t.parent())})(e,t)}))};e.on("init",(()=>{const r=((e,t)=>e.inline?gu(Se.fromDom(e.getBody()),hu(),t):uu(Se.fromDom(e.getDoc()),t))(e,vu);if(n.set(r),(e=>{const t=e.options.get("object_resizing");return E(t.split(","),"table")})(e)&&$r(e)){const n=c(),s=mu(r,n,l);s.on(),s.events.startDrag.bind((o=>{t.set(e.selection.getRng())})),s.events.beforeResize.bind((t=>{const o=t.table.dom;((e,t,o,n,r)=>{e.dispatch("ObjectResizeStart",{target:t,width:o,height:n,origin:r})})(e,o,ss(o),as(o),fu+t.type)})),s.events.afterResize.bind((o=>{const n=o.table,r=n.dom;ns(n),t.on((t=>{e.selection.setRng(t),e.focus()})),((e,t,o,n,r)=>{e.dispatch("ObjectResized",{target:t,width:o,height:n,origin:r})})(e,r,ss(r),as(r),fu+o.type),e.undoManager.add()})),o.set(s)}})),e.on("ObjectResizeStart",(t=>{const o=t.target;if(pu(o)){const n=Se.fromDom(o);D(e.dom.select(".mce-clonedresizable"),(t=>{e.dom.addClass(t,"mce-"+Fr(e)+"-columns")})),!Xl(n)&&jr(e)?tc(n):!Yl(n)&&Ur(e)&&ec(n),Jl(n)&&_t(t.origin,fu)&&ec(n),r=t.width,s=Wr(e)?"":ls(e,o).getOr(""),a=t.height,i=cs(e,o).getOr("")}})),e.on("ObjectResized",(t=>{const o=t.target;if(pu(o)){const n=Se.fromDom(o),r=t.origin;(e=>_t(e,"corner-"))(r)&&d(n,r,t.width,t.height),ns(n),Dl(e,n.dom,Ml)}})),e.on("SwitchMode",(()=>{o.on((t=>{e.mode.isReadOnly()?t.hideBars():t.showBars()}))})),e.on("dragstart dragend",(e=>{o.on((t=>{"dragstart"===e.type?(t.hideBars(),t.off()):(t.on(),t.showBars())}))})),e.on("remove",(()=>{m()}));return{refresh:e=>{o.on((t=>t.refreshBars(Se.fromDom(e))))},hide:()=>{o.on((e=>e.hideBars()))},show:()=>{o.on((e=>e.showBars()))}}},wu=e=>{(e=>{const t=e.options.register;t("table_clone_elements",{processor:"string[]"}),t("table_use_colgroups",{processor:"boolean",default:!0}),t("table_header_type",{processor:e=>{const t=E(["section","cells","sectionCells","auto"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be one of: section, cells, sectionCells or auto."}},default:"section"}),t("table_sizing_mode",{processor:"string",default:"auto"}),t("table_default_attributes",{processor:"object",default:{border:"1"}}),t("table_default_styles",{processor:"object",default:{"border-collapse":"collapse"}}),t("table_column_resizing",{processor:e=>{const t=E(["preservetable","resizetable"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be preservetable, or resizetable."}},default:"preservetable"}),t("table_resize_bars",{processor:"boolean",default:!0}),t("table_style_by_css",{processor:"boolean",default:!0}),t("table_merge_content_on_paste",{processor:"boolean",default:!0})})(e);const t=yu(e),o=Rm(e,t),n=Ll(e,t,o);return Sc(e,n),((e,t)=>{const o=os(e),n=t=>Xs(rs(e)).bind((n=>Gt(n,o).map((o=>{const r=Gs(Js(e),o,n);return t(o,r)})))).getOr("");q({mceTableRowType:()=>n(t.getTableRowType),mceTableCellType:()=>n(t.getTableCellType),mceTableColType:()=>n(t.getTableColType)},((t,o)=>e.addQueryValueHandler(o,t)))})(e,n),Qs(e,n),{getSelectedCells:o.getSelectedCells,clearSelectedCells:o.clearSelectedCells}},xu=e=>({table:wu(e)});e.add("dom",xu)}(),function(){var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=(r="allow_html_in_named_anchor",e=>e.options.get(r));var r;const s="a:not([href])",a=e=>!e,i=e=>e.getAttribute("id")||e.getAttribute("name")||"",l=e=>(e=>"a"===e.nodeName.toLowerCase())(e)&&!e.getAttribute("href")&&""!==i(e),c=e=>{const n=e.dom;t(n).walk(e.selection.getRng(),(e=>{o.each(e,(e=>{var t;l(t=e)&&!t.firstChild&&n.remove(e,!1)}))}))},d=e=>e.dom.getParent(e.selection.getStart(),s),m=(e,t)=>{const o=d(e);o?((e,t,o)=>{o.removeAttribute("name"),o.id=t,e.addVisual(),e.undoManager.add()})(e,t,o):((e,t)=>{e.undoManager.transact((()=>{n(e)||e.selection.collapse(!0),e.selection.isCollapsed()?e.insertContent(e.dom.createHTML("a",{id:t})):(c(e),e.formatter.remove("namedAnchor",void 0,void 0,!0),e.formatter.apply("namedAnchor",{value:t}),e.addVisual())}))})(e,t),e.focus()},u=e=>{const t=(e=>{const t=d(e);return t?i(t):""})(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:t=>{((e,t)=>/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)?(m(e,t),!0):(e.windowManager.alert("ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!1))(e,t.getData().id)&&t.close()}})},g=e=>(e=>a(e.attr("href"))&&!a(e.attr("id")||e.attr("name")))(e)&&!e.firstChild,h=e=>t=>{for(let o=0;ot=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",o),o(),()=>{e.off("NodeChange",o)}};e.add("anchor",(e=>{(e=>{(0,e.options.register)("allow_html_in_named_anchor",{processor:"boolean",default:!1})})(e),(e=>{e.on("PreInit",(()=>{e.parser.addNodeFilter("a",h("false")),e.serializer.addNodeFilter("a",h(null))}))})(e),(e=>{e.addCommand("mceAnchor",(()=>{u(e)}))})(e),(e=>{const t=()=>e.execCommand("mceAnchor");e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:t,onSetup:t=>{const o=e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind,n=p(e)(t);return()=>{o(),n()}}}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:t,onSetup:p(e)})})(e),e.on("PreInit",(()=>{(e=>{e.formatter.register("namedAnchor",{inline:"a",selector:s,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:(e,t,o)=>l(e)})})(e)}))}))}(),function(){var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=(e,t)=>{const o=((e,t)=>e.dispatch("insertCustomChar",{chr:t}))(e,t).chr;e.execCommand("mceInsertContent",!1,o)},o=e=>t=>e===t,n=(r="array",e=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=n=e,(r=String).prototype.isPrototypeOf(o)||(null===(s=n.constructor)||void 0===s?void 0:s.name)===r.name)?"string":t;var o,n,r,s})(e)===r);var r;const s=o(null),a=o(void 0),i=(e=>t=>typeof t===e)("function"),l=(c=!1,()=>c);var c;class d{constructor(e,t){this.tag=e,this.value=t}static some(e){return new d(!0,e)}static none(){return d.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?d.some(e(this.value)):d.none()}bind(e){return this.tag?e(this.value):d.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:d.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return(e=>null==e)(e)?d.none():d.some(e)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}d.singletonNone=new d(!1);const m=Array.prototype.push,u=(e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r((e,t,o)=>{for(let n=0,r=e.length;n(e=>{const t=[];for(let o=0,r=e.length;ot=>t.options.get(e),v=f("charmap"),b=f("charmap_append"),y=p.isArray,w="User Defined",x=e=>{return y(e)?(t=e,p.grep(t,(e=>y(e)&&2===e.length))):"function"==typeof e?e():[];var t},C=e=>{const t=((e,t)=>{const o=v(e);o&&(t=[{name:w,characters:x(o)}]);const n=b(e);if(n){const e=p.grep(t,(e=>e.name===w));return e.length?(e[0].characters=[...e[0].characters,...x(n)],t):t.concat({name:w,characters:x(n)})}return t})(e,[{name:"Currency",characters:[[36,"dollar sign"],[162,"cent sign"],[8364,"euro sign"],[163,"pound sign"],[165,"yen sign"],[164,"currency sign"],[8352,"euro-currency sign"],[8353,"colon sign"],[8354,"cruzeiro sign"],[8355,"french franc sign"],[8356,"lira sign"],[8357,"mill sign"],[8358,"naira sign"],[8359,"peseta sign"],[8360,"rupee sign"],[8361,"won sign"],[8362,"new sheqel sign"],[8363,"dong sign"],[8365,"kip sign"],[8366,"tugrik sign"],[8367,"drachma sign"],[8368,"german penny symbol"],[8369,"peso sign"],[8370,"guarani sign"],[8371,"austral sign"],[8372,"hryvnia sign"],[8373,"cedi sign"],[8374,"livre tournois sign"],[8375,"spesmilo sign"],[8376,"tenge sign"],[8377,"indian rupee sign"],[8378,"turkish lira sign"],[8379,"nordic mark sign"],[8380,"manat sign"],[8381,"ruble sign"],[20870,"yen character"],[20803,"yuan character"],[22291,"yuan character, in hong kong and taiwan"],[22278,"yen/yuan character variant one"]]},{name:"Text",characters:[[169,"copyright sign"],[174,"registered sign"],[8482,"trade mark sign"],[8240,"per mille sign"],[181,"micro sign"],[183,"middle dot"],[8226,"bullet"],[8230,"three dot leader"],[8242,"minutes / feet"],[8243,"seconds / inches"],[167,"section sign"],[182,"paragraph sign"],[223,"sharp s / ess-zed"]]},{name:"Quotations",characters:[[8249,"single left-pointing angle quotation mark"],[8250,"single right-pointing angle quotation mark"],[171,"left pointing guillemet"],[187,"right pointing guillemet"],[8216,"left single quotation mark"],[8217,"right single quotation mark"],[8220,"left double quotation mark"],[8221,"right double quotation mark"],[8218,"single low-9 quotation mark"],[8222,"double low-9 quotation mark"],[60,"less-than sign"],[62,"greater-than sign"],[8804,"less-than or equal to"],[8805,"greater-than or equal to"],[8211,"en dash"],[8212,"em dash"],[175,"macron"],[8254,"overline"],[164,"currency sign"],[166,"broken bar"],[168,"diaeresis"],[161,"inverted exclamation mark"],[191,"turned question mark"],[710,"circumflex accent"],[732,"small tilde"],[176,"degree sign"],[8722,"minus sign"],[177,"plus-minus sign"],[247,"division sign"],[8260,"fraction slash"],[215,"multiplication sign"],[185,"superscript one"],[178,"superscript two"],[179,"superscript three"],[188,"fraction one quarter"],[189,"fraction one half"],[190,"fraction three quarters"]]},{name:"Mathematical",characters:[[402,"function / florin"],[8747,"integral"],[8721,"n-ary sumation"],[8734,"infinity"],[8730,"square root"],[8764,"similar to"],[8773,"approximately equal to"],[8776,"almost equal to"],[8800,"not equal to"],[8801,"identical to"],[8712,"element of"],[8713,"not an element of"],[8715,"contains as member"],[8719,"n-ary product"],[8743,"logical and"],[8744,"logical or"],[172,"not sign"],[8745,"intersection"],[8746,"union"],[8706,"partial differential"],[8704,"for all"],[8707,"there exists"],[8709,"diameter"],[8711,"backward difference"],[8727,"asterisk operator"],[8733,"proportional to"],[8736,"angle"]]},{name:"Extended Latin",characters:[[192,"A - grave"],[193,"A - acute"],[194,"A - circumflex"],[195,"A - tilde"],[196,"A - diaeresis"],[197,"A - ring above"],[256,"A - macron"],[198,"ligature AE"],[199,"C - cedilla"],[200,"E - grave"],[201,"E - acute"],[202,"E - circumflex"],[203,"E - diaeresis"],[274,"E - macron"],[204,"I - grave"],[205,"I - acute"],[206,"I - circumflex"],[207,"I - diaeresis"],[298,"I - macron"],[208,"ETH"],[209,"N - tilde"],[210,"O - grave"],[211,"O - acute"],[212,"O - circumflex"],[213,"O - tilde"],[214,"O - diaeresis"],[216,"O - slash"],[332,"O - macron"],[338,"ligature OE"],[352,"S - caron"],[217,"U - grave"],[218,"U - acute"],[219,"U - circumflex"],[220,"U - diaeresis"],[362,"U - macron"],[221,"Y - acute"],[376,"Y - diaeresis"],[562,"Y - macron"],[222,"THORN"],[224,"a - grave"],[225,"a - acute"],[226,"a - circumflex"],[227,"a - tilde"],[228,"a - diaeresis"],[229,"a - ring above"],[257,"a - macron"],[230,"ligature ae"],[231,"c - cedilla"],[232,"e - grave"],[233,"e - acute"],[234,"e - circumflex"],[235,"e - diaeresis"],[275,"e - macron"],[236,"i - grave"],[237,"i - acute"],[238,"i - circumflex"],[239,"i - diaeresis"],[299,"i - macron"],[240,"eth"],[241,"n - tilde"],[242,"o - grave"],[243,"o - acute"],[244,"o - circumflex"],[245,"o - tilde"],[246,"o - diaeresis"],[248,"o slash"],[333,"o macron"],[339,"ligature oe"],[353,"s - caron"],[249,"u - grave"],[250,"u - acute"],[251,"u - circumflex"],[252,"u - diaeresis"],[363,"u - macron"],[253,"y - acute"],[254,"thorn"],[255,"y - diaeresis"],[563,"y - macron"],[913,"Alpha"],[914,"Beta"],[915,"Gamma"],[916,"Delta"],[917,"Epsilon"],[918,"Zeta"],[919,"Eta"],[920,"Theta"],[921,"Iota"],[922,"Kappa"],[923,"Lambda"],[924,"Mu"],[925,"Nu"],[926,"Xi"],[927,"Omicron"],[928,"Pi"],[929,"Rho"],[931,"Sigma"],[932,"Tau"],[933,"Upsilon"],[934,"Phi"],[935,"Chi"],[936,"Psi"],[937,"Omega"],[945,"alpha"],[946,"beta"],[947,"gamma"],[948,"delta"],[949,"epsilon"],[950,"zeta"],[951,"eta"],[952,"theta"],[953,"iota"],[954,"kappa"],[955,"lambda"],[956,"mu"],[957,"nu"],[958,"xi"],[959,"omicron"],[960,"pi"],[961,"rho"],[962,"final sigma"],[963,"sigma"],[964,"tau"],[965,"upsilon"],[966,"phi"],[967,"chi"],[968,"psi"],[969,"omega"]]},{name:"Symbols",characters:[[8501,"alef symbol"],[982,"pi symbol"],[8476,"real part symbol"],[978,"upsilon - hook symbol"],[8472,"Weierstrass p"],[8465,"imaginary part"]]},{name:"Arrows",characters:[[8592,"leftwards arrow"],[8593,"upwards arrow"],[8594,"rightwards arrow"],[8595,"downwards arrow"],[8596,"left right arrow"],[8629,"carriage return"],[8656,"leftwards double arrow"],[8657,"upwards double arrow"],[8658,"rightwards double arrow"],[8659,"downwards double arrow"],[8660,"left right double arrow"],[8756,"therefore"],[8834,"subset of"],[8835,"superset of"],[8836,"not a subset of"],[8838,"subset of or equal to"],[8839,"superset of or equal to"],[8853,"circled plus"],[8855,"circled times"],[8869,"perpendicular"],[8901,"dot operator"],[8968,"left ceiling"],[8969,"right ceiling"],[8970,"left floor"],[8971,"right floor"],[9001,"left-pointing angle bracket"],[9002,"right-pointing angle bracket"],[9674,"lozenge"],[9824,"black spade suit"],[9827,"black club suit"],[9829,"black heart suit"],[9830,"black diamond suit"],[8194,"en space"],[8195,"em space"],[8201,"thin space"],[8204,"zero width non-joiner"],[8205,"zero width joiner"],[8206,"left-to-right mark"],[8207,"right-to-left mark"]]}]);return t.length>1?[{name:"All",characters:h(t,(e=>e.characters))}].concat(t):t},S=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},k=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!a(n)||r+t.length<=n)},_=String.fromCodePoint,E=(e,t)=>{const o=[],n=t.toLowerCase();return((e,t)=>{for(let o=0,n=e.length;o{((e,t,o)=>!!k(_(e).toLowerCase(),o)||k(t.toLowerCase(),o)||k(t.toLowerCase().replace(/\s+/g,""),o))(e[0],e[1],n)&&o.push(e)})),u(o,(e=>({text:e[1],value:_(e[0]),icon:_(e[0])})))},T="pattern",O=(e,o)=>{const n=()=>[{label:"Search",type:"input",name:T},{type:"collection",name:"results"}],r=1===o.length?S(w):S("All"),a=((e,t)=>{let o=null;const n=()=>{s(o)||(clearTimeout(o),o=null)};return{cancel:n,throttle:(...r)=>{n(),o=setTimeout((()=>{o=null,e.apply(null,r)}),t)}}})((e=>{const t=e.getData().pattern;((e,t)=>{g(o,(e=>e.name===r.get())).each((o=>{const n=E(o,t);e.setData({results:n})}))})(e,t)}),40),i={title:"Special Character",size:"normal",body:1===o.length?{type:"panel",items:n()}:{type:"tabpanel",tabs:u(o,(e=>({title:e.name,name:e.name,items:n()})))},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{pattern:"",results:E(o[0],"")},onAction:(o,n)=>{"results"===n.name&&(t(e,n.value),o.close())},onTabChange:(e,t)=>{r.set(t.newTabName),a.throttle(e)},onChange:(e,t)=>{t.name===T&&a.throttle(e)}};e.windowManager.open(i).focus(T)},A=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",o),o(),()=>{e.off("NodeChange",o)}};e.add("charmap",(e=>{(e=>{const t=e.options.register,o=e=>i(e)||n(e);t("charmap",{processor:o}),t("charmap_append",{processor:o})})(e);const o=C(e);return((e,t)=>{e.addCommand("mceShowCharmap",(()=>{O(e,t)}))})(e,o),(e=>{const t=()=>e.execCommand("mceShowCharmap");e.ui.registry.addButton("charmap",{icon:"insert-character",tooltip:"Special character",onAction:t,onSetup:A(e)}),e.ui.registry.addMenuItem("charmap",{icon:"insert-character",text:"Special character...",onAction:t,onSetup:A(e)})})(e),((e,t)=>{e.ui.registry.addAutocompleter("charmap",{trigger:":",columns:"auto",minChars:2,fetch:(e,o)=>new Promise(((o,n)=>{o(E(t,e))})),onAction:(t,o,n)=>{e.selection.setRng(o),e.insertContent(n),t.hide()}})})(e,o[0]),(e=>({getCharMap:()=>C(e),insertChar:o=>{t(e,o)}}))(e)}))}(),tinymce.util.Tools.resolve("tinymce.PluginManager").add("code",(e=>((e=>{e.addCommand("mceCodeEditor",(()=>{(e=>{const t=(e=>e.getContent({source_view:!0}))(e);e.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:t},onSubmit:t=>{((e,t)=>{e.focus(),e.undoManager.transact((()=>{e.setContent(t)})),e.selection.setCursorLocation(),e.nodeChanged()})(e,t.getData().code),t.close()}})})(e)}))})(e),(e=>{const t=()=>e.execCommand("mceCodeEditor");e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:t}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:t})})(e),{}))),function(){var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>typeof t===e,o=(e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=r=e,n=(s=String).prototype,n.isPrototypeOf(o)||(null===(a=r.constructor)||void 0===a?void 0:a.name)===s.name)?"string":t;var o,n;var r,s,a})(t)===e)("string"),n=t("boolean"),r=e=>!(e=>null==e)(e),s=t("function"),a=t("number"),i=(l=!1,()=>l);var l;class c{constructor(e,t){this.tag=e,this.value=t}static some(e){return new c(!0,e)}static none(){return c.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?c.some(e(this.value)):c.none()}bind(e){return this.tag?e(this.value):c.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:c.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return r(e)?c.some(e):c.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}c.singletonNone=new c(!1);const d=(e,t)=>{for(let o=0,n=e.length;o{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},u={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return m(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return m(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return m(o)},fromDom:m,fromPoint:(e,t,o)=>c.from(e.dom.elementFromPoint(t,o)).map(m)},g=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}};"undefined"!=typeof window?window:Function("return this;")();const h=e=>t=>(e=>e.dom.nodeType)(t)===e,p=h(1),f=h(3),v=h(11),b=e=>((e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r{((e,t,r)=>{if(!(o(r)||n(r)||a(r)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",r,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,r+"")})(e.dom,t,r)},w=(e,t)=>{e.dom.removeAttribute(t)},x=e=>{const t=(e=>u.fromDom(e.dom.getRootNode()))(e);return v(o=t)&&r(o.dom.host)?c.some(t):c.none();var o},C=e=>u.fromDom(e.dom.host),S=e=>{const t=f(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return x(u.fromDom(t)).fold((()=>o.body.contains(t)),(n=S,r=C,e=>n(r(e))));var n,r},k=(e,t,o)=>((e,t,o)=>{let n=e.dom;const r=s(o)?o:i;for(;n.parentNode;){n=n.parentNode;const e=u.fromDom(n);if(t(e))return c.some(e);if(r(e))break}return c.none()})(e,(e=>g(e,t)),o),_=(e,t)=>(e=>void 0!==e.style&&s(e.style.getPropertyValue))(e)?e.style.getPropertyValue(t):"",E=e=>"rtl"===((e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||S(e)?n:_(o,t)})(e,"direction")?"rtl":"ltr",T=(e,t)=>((e,t)=>((e,t)=>{const o=[];for(let n=0,r=e.length;ng(e,t))),O=e=>(e=>c.from(e.dom.parentNode).map(u.fromDom))(e).filter(p),A=(D="li",e=>p(e)&&e.dom.nodeName.toLowerCase()===D);var D;const M=(e,t,o)=>{d(t,(t=>{const n=u.fromDom(t),r=A(n),s=((e,t)=>(t?k(e,"ol,ul"):c.some(e)).getOr(e))(n,r);O(s).each((t=>{e.setStyle(s.dom,"direction",null);if(E(t)===o?w(s,"dir"):y(s,"dir",o),E(s)!==o&&e.setStyle(s.dom,"direction",o),r){const t=T(s,"li[dir],li[style]");d(t,(t=>{w(t,"dir"),e.setStyle(t.dom,"direction",null)}))}}))}))},N=(e,t)=>{e.selection.isEditable()&&(M(e.dom,e.selection.getSelectedBlocks(),t),e.nodeChanged())},R=(e,t)=>o=>{const n=n=>{const r=u.fromDom(n.element);o.setActive(E(r)===t),o.setEnabled(e.selection.isEditable())};return e.on("NodeChange",n),o.setEnabled(e.selection.isEditable()),()=>e.off("NodeChange",n)};e.add("directionality",(e=>{(e=>{e.addCommand("mceDirectionLTR",(()=>{N(e,"ltr")})),e.addCommand("mceDirectionRTL",(()=>{N(e,"rtl")}))})(e),(e=>{e.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:()=>e.execCommand("mceDirectionLTR"),onSetup:R(e,"ltr")}),e.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:()=>e.execCommand("mceDirectionRTL"),onSetup:R(e,"rtl")})})(e)}))}(),function(){const e=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}};var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const o=e=>({isFullscreen:()=>null!==e.get()}),n=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=r=e,n=(s=String).prototype,n.isPrototypeOf(o)||(null===(a=r.constructor)||void 0===a?void 0:a.name)===s.name)?"string":t;var o,n;var r,s,a})(t)===e,r=e=>t=>typeof t===e,s=e=>t=>e===t,a=n("string"),i=n("object"),l=n("array"),c=s(null),d=r("boolean"),m=s(void 0),u=e=>!(e=>null==e)(e),g=r("function"),h=r("number"),p=()=>{},f=e=>()=>e;function v(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const b=f(!1),y=f(!0);class w{constructor(e,t){this.tag=e,this.value=t}static some(e){return new w(!0,e)}static none(){return w.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?w.some(e(this.value)):w.none()}bind(e){return this.tag?e(this.value):w.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:w.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return u(e)?w.some(e):w.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}w.singletonNone=new w(!1);const x=Array.prototype.push,C=(e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r{for(let o=0,n=e.length;o{const o=[];for(let n=0,r=e.length;n((e,t,o)=>{for(let n=0,r=e.length;n(e=>{const t=[];for(let o=0,n=e.length;o((e,t)=>t>=0&&t{const o=e(w.none()),n=()=>o.get().each(t);return{clear:()=>{n(),o.set(w.none())},isSet:()=>o.get().isSome(),get:()=>o.get(),set:e=>{n(),o.set(w.some(e))}}},A=()=>O((e=>e.unbind())),D=Object.keys,M="undefined"!=typeof window?window:Function("return this;")(),N=(e,t)=>((e,t)=>{let o=null!=t?t:M;for(let t=0;t{const o=((e,t)=>N(e,t))(e,t);if(null==o)throw new Error(e+" not available on this browser");return o},B=Object.getPrototypeOf,L=e=>{const t=N("ownerDocument.defaultView",e);return i(e)&&((e=>R("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(B(e).constructor.name))},H=e=>t=>(e=>e.dom.nodeType)(t)===e,I=H(1),P=H(3),F=H(11),z=(e,t,o)=>{((e,t,o)=>{if(!(a(o)||d(o)||h(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")})(e.dom,t,o)},V=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},Z=(e,t)=>{e.dom.removeAttribute(t)},U=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!m(n)||r+t.length<=n)},j=e=>void 0!==e.style&&g(e.style.getPropertyValue),W=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},$={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return W(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return W(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return W(o)},fromDom:W,fromPoint:(e,t,o)=>w.from(e.dom.elementFromPoint(t,o)).map(W)},q=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},G=e=>$.fromDom(e.dom.ownerDocument),K=e=>(e=>w.from(e.dom.parentNode).map($.fromDom))(e).map(Y).map((t=>k(t,(t=>{return o=t,!(e.dom===o.dom);var o})))).getOr([]),Y=e=>C(e.dom.childNodes,$.fromDom),X=e=>{const t=(e=>$.fromDom(e.dom.getRootNode()))(e);return F(o=t)&&u(o.dom.host)?w.some(t):w.none();var o},J=e=>$.fromDom(e.dom.host),Q=e=>u(e.dom.shadowRoot),ee=e=>{const t=P(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return X($.fromDom(t)).fold((()=>o.body.contains(t)),(n=ee,r=J,e=>n(r(e))));var n,r},te=(e,t,o)=>{if(!a(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);j(e)&&e.style.setProperty(t,o)},oe=(e,t,o)=>{const n=e.dom;te(n,t,o)},ne=(e,t)=>{const o=e.dom;((e,t)=>{const o=D(e);for(let n=0,r=o.length;n{te(o,t,e)}))},re=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||ee(e)?n:se(o,t)},se=(e,t)=>j(e)?e.style.getPropertyValue(t):"",ae=e=>{const t=$.fromDom((e=>{if(u(e.target)){const t=$.fromDom(e.target);if(I(t)&&Q(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return T(t)}}return w.from(e.target)})(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),r=(s=n,a=o,(...e)=>s(a.apply(null,e)));var s,a;return((e,t,o,n,r,s,a)=>({target:e,x:t,y:o,stop:n,prevent:r,kill:s,raw:a}))(t,e.clientX,e.clientY,o,n,r,e)},ie=(e,t,o,n,r)=>{const s=((e,t)=>o=>{e(o)&&t(ae(o))})(o,n);return e.dom.addEventListener(t,s,r),{unbind:v(le,e,t,s,r)}},le=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},ce=y,de=(e,t,o)=>((e,t,o,n)=>ie(e,t,o,n,!1))(e,t,ce,o),me=()=>ue(0,0),ue=(e,t)=>({major:e,minor:t}),ge={nu:ue,detect:(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?me():((e,t)=>{const o=((e,t)=>{for(let o=0;oNumber(t.replace(o,"$"+e));return ue(n(1),n(2))})(e,o)},unknown:me},he=(e,t)=>((e,t)=>{for(let o=0;o{const o=t.brand.toLowerCase();return _(e,(e=>{var t;return o===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:ge.nu(parseInt(t.version,10),0)})))})),pe=(e,t)=>{const o=String(t).toLowerCase();return _(e,(e=>e.search(o)))},fe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ve=e=>t=>U(t,e),be=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>U(e,"edge/")&&U(e,"chrome")&&U(e,"safari")&&U(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,fe],search:e=>U(e,"chrome")&&!U(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>U(e,"msie")||U(e,"trident")},{name:"Opera",versionRegexes:[fe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ve("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ve("firefox")},{name:"Safari",versionRegexes:[fe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(U(e,"safari")||U(e,"mobile/"))&&U(e,"applewebkit")}],ye=[{name:"Windows",search:ve("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>U(e,"iphone")||U(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ve("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:ve("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ve("linux"),versionRegexes:[]},{name:"Solaris",search:ve("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ve("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:ve("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],we={browsers:f(be),oses:f(ye)},xe="Edge",Ce="Chromium",Se="Opera",ke="Firefox",_e="Safari",Ee=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(xe),isChromium:n(Ce),isIE:n("IE"),isOpera:n(Se),isFirefox:n(ke),isSafari:n(_e)}},Te={unknown:()=>Ee({current:void 0,version:ge.unknown()}),nu:Ee,edge:f(xe),chromium:f(Ce),ie:f("IE"),opera:f(Se),firefox:f(ke),safari:f(_e)},Oe="Windows",Ae="Android",De="Linux",Me="macOS",Ne="Solaris",Re="FreeBSD",Be="ChromeOS",Le=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(Oe),isiOS:n("iOS"),isAndroid:n(Ae),isMacOS:n(Me),isLinux:n(De),isSolaris:n(Ne),isFreeBSD:n(Re),isChromeOS:n(Be)}},He={unknown:()=>Le({current:void 0,version:ge.unknown()}),nu:Le,windows:f(Oe),ios:f("iOS"),android:f(Ae),linux:f(De),macos:f(Me),solaris:f(Ne),freebsd:f(Re),chromeos:f(Be)},Ie=(e,t,o)=>{const n=we.browsers(),r=we.oses(),s=t.bind((e=>he(n,e))).orThunk((()=>((e,t)=>pe(e,t).map((e=>{const o=ge.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(n,e))).fold(Te.unknown,Te.nu),a=((e,t)=>pe(e,t).map((e=>{const o=ge.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(r,e).fold(He.unknown,He.nu),i=((e,t,o,n)=>{const r=e.isiOS()&&!0===/ipad/i.test(o),s=e.isiOS()&&!r,a=e.isiOS()||e.isAndroid(),i=a||n("(pointer:coarse)"),l=r||!s&&a&&n("(min-device-width:768px)"),c=s||a&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),m=!c&&!l&&!d;return{isiPad:f(r),isiPhone:f(s),isTablet:f(l),isPhone:f(c),isTouch:f(i),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:f(d),isDesktop:f(m)}})(a,s,e,o);return{browser:s,os:a,deviceType:i}},Pe=e=>window.matchMedia(e).matches;let Fe=(e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)})((()=>Ie(window.navigator.userAgent,w.from(window.navigator.userAgentData),Pe)));const ze=(e,t)=>({left:e,top:t,translate:(o,n)=>ze(e+o,t+n)}),Ve=ze,Ze=e=>{const t=void 0===e?window:e;return Fe().browser.isFirefox()?w.none():w.from(t.visualViewport)},Ue=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),je=e=>{const t=void 0===e?window:e,o=t.document,n=(e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return Ve(o,n)})($.fromDom(o));return Ze(t).fold((()=>{const e=t.document.documentElement,o=e.clientWidth,r=e.clientHeight;return Ue(n.left,n.top,o,r)}),(e=>Ue(Math.max(e.pageLeft,n.left),Math.max(e.pageTop,n.top),e.width,e.height)))},We=(e,t,o)=>Ze(o).map((o=>{const n=e=>t(ae(e));return o.addEventListener(e,n),{unbind:()=>o.removeEventListener(e,n)}})).getOrThunk((()=>({unbind:p})));var $e=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),qe=tinymce.util.Tools.resolve("tinymce.Env");const Ge=(e,t)=>{e.dispatch("FullscreenStateChanged",{state:t}),e.dispatch("ResizeEditor")},Ke=(Ye="fullscreen_native",e=>e.options.get(Ye));var Ye;const Xe=e=>{const t=$.fromDom(e.getElement());return X(t).map(J).getOrThunk((()=>(e=>{const t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return $.fromDom(t)})(G(t))))},Je=e=>{return e.dom===(void 0!==(t=G(e).dom).fullscreenElement?t.fullscreenElement:void 0!==t.msFullscreenElement?t.msFullscreenElement:void 0!==t.webkitFullscreenElement?t.webkitFullscreenElement:null);var t},Qe=(e,t,o)=>k(((e,t)=>{const o=g(t)?t:b;let n=e.dom;const r=[];for(;null!==n.parentNode&&void 0!==n.parentNode;){const e=n.parentNode,t=$.fromDom(e);if(r.push(t),!0===o(t))break;n=e}return r})(e,o),t),et=e=>(e=>{const t=document;return 1!==(o=t).nodeType&&9!==o.nodeType&&11!==o.nodeType||0===o.childElementCount?[]:C(t.querySelectorAll(e),$.fromDom);var o})(e),tt=(e,t,o)=>Qe(e,(e=>q(e,t)),o),ot=(e,t)=>((e,t)=>k(K(e),t))(e,(e=>q(e,t))),nt="data-ephox-mobile-fullscreen-style",rt="position:absolute!important;",st="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",at=qe.os.isAndroid(),it=(e,t,o)=>{const n=t=>o=>{const n=V(o,"style"),r=void 0===n?"no-styles":n.trim();r!==t&&(z(o,nt,r),ne(o,e.parseStyle(t)))},r=tt(t,"*"),s=E(r,(e=>ot(e,"*:not(.tox-silver-sink)"))),a=(e=>{const t=re(e,"background-color");return void 0!==t&&""!==t?"background-color:"+t+"!important":"background-color:rgb(255,255,255)!important;"})(o);S(s,n("display:none!important;")),S(r,n(rt+st+a));n((!0===at?"":rt)+st+a)(t)},lt=$e.DOM,ct=Ze().fold((()=>({bind:p,unbind:p})),(e=>{const t=(()=>{const e=O(p);return{...e,on:t=>e.get().each(t)}})(),o=A(),n=A(),r=((e,t)=>{let o=null;return{cancel:()=>{c(o)||(clearTimeout(o),o=null)},throttle:(...n)=>{c(o)&&(o=setTimeout((()=>{o=null,e.apply(null,n)}),t))}}})((()=>{document.body.scrollTop=0,document.documentElement.scrollTop=0,window.requestAnimationFrame((()=>{t.on((t=>ne(t,{top:e.offsetTop+"px",left:e.offsetLeft+"px",height:e.height+"px",width:e.width+"px"})))}))}),50);return{bind:e=>{t.set(e),r.throttle(),o.set(We("resize",r.throttle)),n.set(We("scroll",r.throttle))},unbind:()=>{t.on((()=>{o.clear(),n.clear()})),t.clear()}}})),dt=(e,t)=>{const o=document.body,n=document.documentElement,r=e.getContainer(),s=$.fromDom(r),a=(i=s,w.from(i.dom.nextSibling).map($.fromDom)).filter((e=>(e=>I(e)&&L(e.dom))(e)&&((e,t)=>(e=>void 0!==e.dom.classList)(e)&&e.dom.classList.contains(t))(e,"tox-silver-sink")));var i;const l=Xe(e),c=t.get(),d=$.fromDom(e.getBody()),m=qe.deviceType.isTouch(),u=r.style,g=e.iframeElement,h=null==g?void 0:g.style,p=e=>{e(o,"tox-fullscreen"),e(n,"tox-fullscreen"),e(r,"tox-fullscreen"),X(s).map((e=>J(e).dom)).each((t=>{e(t,"tox-fullscreen"),e(t,"tox-shadowhost")}))},f=()=>{m&&(e=>{const t=et("["+nt+"]");S(t,(t=>{const o=V(t,nt);o&&"no-styles"!==o?ne(t,e.parseStyle(o)):Z(t,"style"),Z(t,nt)}))})(e.dom),p(lt.removeClass),ct.unbind(),w.from(t.get()).each((e=>e.fullscreenChangeHandler.unbind()))};if(c)c.fullscreenChangeHandler.unbind(),Ke(e)&&Je(l)&&(e=>{const t=e.dom;t.exitFullscreen?t.exitFullscreen():t.msExitFullscreen?t.msExitFullscreen():t.webkitCancelFullScreen&&t.webkitCancelFullScreen()})(G(l)),h.width=c.iframeWidth,h.height=c.iframeHeight,u.width=c.containerWidth,u.height=c.containerHeight,u.top=c.containerTop,u.left=c.containerLeft,b=a,y=c.sinkCssPosition,x=(e,t)=>{oe(e,"position",t)},b.isSome()&&y.isSome()?w.some(x(b.getOrDie(),y.getOrDie())):w.none(),f(),v=c.scrollPos,window.scrollTo(v.x,v.y),t.set(null),Ge(e,!1),e.off("remove",f);else{const o=de(G(l),void 0!==document.fullscreenElement?"fullscreenchange":void 0!==document.msFullscreenElement?"MSFullscreenChange":void 0!==document.webkitFullscreenElement?"webkitfullscreenchange":"fullscreenchange",(o=>{Ke(e)&&(Je(l)||null===t.get()||dt(e,t))})),n={scrollPos:je(window),containerWidth:u.width,containerHeight:u.height,containerTop:u.top,containerLeft:u.left,iframeWidth:h.width,iframeHeight:h.height,fullscreenChangeHandler:o,sinkCssPosition:a.map((e=>re(e,"position")))};m&&it(e.dom,s,d),h.width=h.height="100%",u.width=u.height="",p(lt.addClass),a.each((e=>{oe(e,"position","fixed")})),ct.bind(s),e.on("remove",f),t.set(n),Ke(e)&&(e=>{const t=e.dom;t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.webkitRequestFullScreen&&t.webkitRequestFullScreen()})(l),Ge(e,!0)}var v,b,y,x};var mt=tinymce.util.Tools.resolve("tinymce.util.VK");const ut=(e,t)=>o=>{o.setActive(null!==t.get());const n=e=>o.setActive(e.state);return e.on("FullscreenStateChanged",n),()=>e.off("FullscreenStateChanged",n)};t.add("fullscreen",(t=>{const n=e(null);return t.inline||((e=>{(0,e.options.register)("fullscreen_native",{processor:"boolean",default:!1})})(t),((e,t)=>{e.addCommand("mceFullScreen",(()=>{dt(e,t)}))})(t,n),((e,t)=>{const o=()=>e.execCommand("mceFullScreen");e.ui.registry.addToggleMenuItem("fullscreen",{text:"Fullscreen",icon:"fullscreen",shortcut:"Meta+Shift+F",onAction:o,onSetup:ut(e,t)}),e.ui.registry.addToggleButton("fullscreen",{tooltip:"Fullscreen",icon:"fullscreen",onAction:o,onSetup:ut(e,t),shortcut:"Meta+Shift+F"})})(t,n),((e,t)=>{e.on("init",(()=>{e.on("keydown",(e=>{e.keyCode!==mt.TAB||e.metaKey||e.ctrlKey||!t.get()||e.preventDefault()}))}))})(t,n),t.addShortcut("Meta+Shift+F","","mceFullScreen")),o(n)}))}(),function(){var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=r=e,n=(s=String).prototype,n.isPrototypeOf(o)||(null===(a=r.constructor)||void 0===a?void 0:a.name)===s.name)?"string":t;var o,n;var r,s,a})(t)===e,o=e=>t=>typeof t===e,n=t("string"),r=t("object"),s=t("array"),a=(i=null,e=>i===e);var i;const l=o("boolean"),c=e=>!(e=>null==e)(e),d=o("function"),m=(e,t)=>{if(s(e)){for(let o=0,n=e.length;o{},g=(e,t)=>e===t;class h{constructor(e,t){this.tag=e,this.value=t}static some(e){return new h(!0,e)}static none(){return h.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?h.some(e(this.value)):h.none()}bind(e){return this.tag?e(this.value):h.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:h.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return c(e)?h.some(e):h.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}h.singletonNone=new h(!1);const p=Array.prototype.indexOf,f=Array.prototype.push,v=(e,t)=>((e,t)=>p.call(e,t))(e,t)>-1,b=e=>{const t=[];for(let o=0,n=e.length;ob(((e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r{for(let o=0;oe.exists((e=>o(e,t))),C=e=>{const t=[],o=e=>{t.push(e)};for(let t=0;te?h.some(t):h.none(),k=e=>t=>t.options.get(e),_=k("link_assume_external_targets"),E=k("link_context_toolbar"),T=k("link_list"),O=k("link_default_target"),A=k("link_default_protocol"),D=k("link_target_list"),M=k("link_rel_list"),N=k("link_class_list"),R=k("link_title"),B=k("allow_unsafe_link_target"),L=k("link_quicklink"),H=Object.keys,I=Object.hasOwnProperty,P=(e,t,o,n)=>{((e,t)=>{const o=H(e);for(let n=0,r=o.length;n{(t(e,r)?o:n)(e,r)}))},F=(e,t)=>I.call(e,t);var z=tinymce.util.Tools.resolve("tinymce.util.URI"),V=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Z=tinymce.util.Tools.resolve("tinymce.util.Tools");const U=e=>c(e)&&"a"===e.nodeName.toLowerCase(),j=e=>U(e)&&!!q(e),W=(e,t)=>{if(e.collapsed)return[];{const o=e.cloneContents(),n=o.firstChild,r=new V(n,o),s=[];let a=n;do{t(a)&&s.push(a)}while(a=r.next());return s}},$=e=>/^\w+:/i.test(e),q=e=>{var t,o;return null!==(o=null!==(t=e.getAttribute("data-mce-href"))&&void 0!==t?t:e.getAttribute("href"))&&void 0!==o?o:""},G=(e,t)=>{const o=["noopener"],n=e?e.split(/\s+/):[],r=e=>e.filter((e=>-1===Z.inArray(o,e))),s=t?(e=>(e=r(e)).length>0?e.concat(o):o)(n):r(n);return s.length>0?(e=>Z.trim(e.sort().join(" ")))(s):""},K=(e,t)=>(t=t||J(e.selection.getRng())[0]||e.selection.getNode(),oe(t)?h.from(e.dom.select("a[href]",t)[0]):h.from(e.dom.getParent(t,"a[href]"))),Y=(e,t)=>K(e,t).isSome(),X=(e,t)=>(e=>e.replace(/\uFEFF/g,""))(t.fold((()=>e.getContent({format:"text"})),(e=>e.innerText||e.textContent||""))),J=e=>W(e,j),Q=e=>Z.grep(e,j),ee=e=>Q(e).length>0,te=e=>{const t=e.schema.getTextInlineElements(),o=e=>1===e.nodeType&&!U(e)&&!F(t,e.nodeName.toLowerCase());if(K(e).exists((e=>e.hasAttribute("data-mce-block"))))return!1;const n=e.selection.getRng();if(n.collapsed)return!0;return 0===W(n,o).length},oe=e=>c(e)&&"FIGURE"===e.nodeName&&/\bimage\b/i.test(e.className),ne=(e,t)=>{const o={...t};if(0===M(e).length&&!B(e)){const e=G(o.rel,"_blank"===o.target);o.rel=e||null}return h.from(o.target).isNone()&&!1===D(e)&&(o.target=O(e)),o.href=((e,t)=>"http"!==t&&"https"!==t||$(e)?e:t+"://"+e)(o.href,_(e)),o},re=(e,t,o)=>{const n=e.selection.getNode(),r=K(e,n),s=ne(e,(e=>{return t=["title","rel","class","target"],o=(t,o)=>(e[o].each((e=>{t[o]=e.length>0?e:null})),t),n={href:e.href},((e,t)=>{for(let o=0,n=e.length;o{n=o(n,e,t)})),n;var t,o,n})(o));e.undoManager.transact((()=>{o.href===t.href&&t.attach(),r.fold((()=>{((e,t,o,n)=>{const r=e.dom;oe(t)?ce(r,t,n):o.fold((()=>{e.execCommand("mceInsertLink",!1,n)}),(t=>{e.insertContent(r.createHTML("a",n,r.encode(t)))}))})(e,n,o.text,s)}),(t=>{e.focus(),((e,t,o,n)=>{o.each((e=>{F(t,"innerText")?t.innerText=e:t.textContent=e})),e.dom.setAttribs(t,n),e.selection.select(t)})(e,t,o.text,s)}))}))},se=e=>{const{class:t,href:o,rel:n,target:r,text:s,title:i}=e;return((e,t)=>{const o={};var n;return P(e,t,(n=o,(e,t)=>{n[t]=e}),u),o})({class:t.getOrNull(),href:o,rel:n.getOrNull(),target:r.getOrNull(),text:s.getOrNull(),title:i.getOrNull()},((e,t)=>!1===a(e)))},ae=(e,t,o)=>{const n=((e,t)=>{const o=e.options.get,n={allow_html_data_urls:o("allow_html_data_urls"),allow_script_urls:o("allow_script_urls"),allow_svg_data_urls:o("allow_svg_data_urls")},r=t.href;return{...t,href:z.isDomSafe(r,"a",n)?r:""}})(e,o);e.hasPlugin("rtc",!0)?e.execCommand("createlink",!1,se(n)):re(e,t,n)},ie=e=>{e.hasPlugin("rtc",!0)?e.execCommand("unlink"):(e=>{e.undoManager.transact((()=>{const t=e.selection.getNode();oe(t)?le(e,t):(e=>{const t=e.dom,o=e.selection,n=o.getBookmark(),r=o.getRng().cloneRange(),s=t.getParent(r.startContainer,"a[href]",e.getBody()),a=t.getParent(r.endContainer,"a[href]",e.getBody());s&&r.setStartBefore(s),a&&r.setEndAfter(a),o.setRng(r),e.execCommand("unlink"),o.moveToBookmark(n)})(e),e.focus()}))})(e)},le=(e,t)=>{var o;const n=e.dom.select("img",t)[0];if(n){const r=e.dom.getParents(n,"a[href]",t)[0];r&&(null===(o=r.parentNode)||void 0===o||o.insertBefore(n,r),e.dom.remove(r))}},ce=(e,t,o)=>{var n;const r=e.select("img",t)[0];if(r){const t=e.create("a",o);null===(n=r.parentNode)||void 0===n||n.insertBefore(t,r),t.appendChild(r)}},de=e=>n(e.value)?e.value:"",me=(e,t)=>{const o=[];return Z.each(e,(e=>{const r=(e=>n(e.text)?e.text:n(e.title)?e.title:"")(e);if(void 0!==e.menu){const n=me(e.menu,t);o.push({text:r,items:n})}else{const n=t(e);o.push({text:r,value:n})}})),o},ue=(e=de)=>t=>h.from(t).map((t=>me(t,e))),ge={sanitize:e=>ue(de)(e),sanitizeWith:ue,createUi:(e,t)=>o=>({name:e,type:"listbox",label:t,items:o}),getValue:de},he=e=>{return F(t=e,o="items")&&void 0!==t[o]&&null!==t[o];var t,o},pe=(e,t)=>w(t,(t=>he(t)?pe(e,t.items):S(t.value===e,t))),fe=(e,t,o,n)=>{const r=n[t],s=e.length>0;return void 0!==r?pe(r,o).map((t=>({url:{value:t.value,meta:{text:s?e:t.text,attach:u}},text:s?e:t.text}))):h.none()},ve=(e,t)=>{const o={text:e.text,title:e.title},n=e=>{const t=(n=e.url,S(o.text.length<=0,h.from(null===(r=n.meta)||void 0===r?void 0:r.text).getOr(n.value)));var n,r;const s=(e=>{var t;return S(o.title.length<=0,h.from(null===(t=e.meta)||void 0===t?void 0:t.title).getOr(""))})(e.url);return t.isSome()||s.isSome()?h.some({...t.map((e=>({text:e}))).getOr({}),...s.map((e=>({title:e}))).getOr({})}):h.none()},r=(e,n)=>{const r=(s=t,a=n,"link"===a?s.link:"anchor"===a?s.anchor:h.none()).getOr([]);var s,a;return fe(o.text,n,r,e)};return{onChange:(e,t)=>{const s=t.name;return"url"===s?n(e()):v(["anchor","link"],s)?r(e(),s):"text"===s||"title"===s?(o[s]=e()[s],h.none()):h.none()}}};var be=tinymce.util.Tools.resolve("tinymce.util.Delay");const ye=e=>{const t=e.href;return t.indexOf("@")>0&&-1===t.indexOf("/")&&-1===t.indexOf("mailto:")?h.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:e=>({...e,href:"mailto:"+t})}):h.none()},we=(e,t)=>o=>{const n=o.href;return 1===e&&!$(n)||0===e&&/^\s*www(\.|\d\.)/i.test(n)?h.some({message:`The URL you entered seems to be an external link. Do you want to add the required ${t}:// prefix?`,preprocess:e=>({...e,href:t+"://"+n})}):h.none()},xe=(e,t)=>w([ye,we(_(e),A(e))],(e=>e(t))).fold((()=>Promise.resolve(t)),(o=>new Promise((n=>{((e,t,o)=>{const n=e.selection.getRng();be.setEditorTimeout(e,(()=>{e.windowManager.confirm(t,(t=>{e.selection.setRng(n),o(t)}))}))})(e,o.message,(e=>{n(e?o.preprocess(t):t)}))})))),Ce=e=>{const t=e.dom.select("a:not([href])"),o=y(t,(e=>{const t=e.name||e.id;return t?[{text:t,value:"#"+t}]:[]}));return o.length>0?h.some([{text:"None",value:""}].concat(o)):h.none()},Se=e=>{const t=N(e);return t.length>0?ge.sanitize(t):h.none()},ke=e=>{try{return h.some(JSON.parse(e))}catch(e){return h.none()}},_e=e=>{const t=t=>e.convertURL(t.value||t.url||"","href"),o=T(e);return new Promise((e=>{n(o)?fetch(o).then((e=>e.ok?e.text().then(ke):Promise.reject())).then(e,(()=>e(h.none()))):d(o)?o((t=>e(h.some(t)))):e(h.from(o))})).then((e=>e.bind(ge.sanitizeWith(t)).map((e=>{if(e.length>0){return[{text:"None",value:""}].concat(e)}return e}))))},Ee=(e,t)=>{const o=M(e);if(o.length>0){const n=x(t,"_blank"),r=e=>G(ge.getValue(e),n);return(!1===B(e)?ge.sanitizeWith(r):ge.sanitize)(o)}return h.none()},Te=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Oe=e=>{const t=D(e);return s(t)?ge.sanitize(t).orThunk((()=>h.some(Te))):!1===t?h.none():h.some(Te)},Ae=(e,t,o)=>{const n=e.getAttrib(t,o);return null!==n&&n.length>0?h.some(n):h.none()},De=(e,t)=>_e(e).then((o=>{const n=((e,t)=>{const o=e.dom,n=te(e)?h.some(X(e.selection,t)):h.none(),r=t.bind((e=>h.from(o.getAttrib(e,"href")))),s=t.bind((e=>h.from(o.getAttrib(e,"target")))),a=t.bind((e=>Ae(o,e,"rel"))),i=t.bind((e=>Ae(o,e,"class")));return{url:r,text:n,title:t.bind((e=>Ae(o,e,"title"))),target:s,rel:a,linkClass:i}})(e,t);return{anchor:n,catalogs:{targets:Oe(e),rels:Ee(e,n.target),classes:Se(e),anchor:Ce(e),link:o},optNode:t,flags:{titleEnabled:R(e)}}})),Me=e=>{const t=(e=>{const t=K(e);return De(e,t)})(e);t.then((t=>{const o=((e,t)=>o=>{const n=o.getData();if(!n.url.value)return ie(e),void o.close();const r=e=>h.from(n[e]).filter((o=>!x(t.anchor[e],o))),s={href:n.url.value,text:r("text"),target:r("target"),rel:r("rel"),class:r("linkClass"),title:r("title")},a={href:n.url.value,attach:void 0!==n.url.meta&&n.url.meta.attach?n.url.meta.attach:u};xe(e,s).then((t=>{ae(e,a,t)})),o.close()})(e,t);return((e,t,o)=>{const n=e.anchor.text.map((()=>({name:"text",type:"input",label:"Text to display"}))).toArray(),r=e.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],s=((e,t)=>{const o=e.anchor,n=o.url.getOr("");return{url:{value:n,meta:{original:{value:n}}},text:o.text.getOr(""),title:o.title.getOr(""),anchor:n,link:n,rel:o.rel.getOr(""),target:o.target.or(t).getOr(""),linkClass:o.linkClass.getOr("")}})(e,h.from(O(o))),a=e.catalogs,i=ve(s,a);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:b([[{name:"url",type:"urlinput",filetype:"file",label:"URL",picker_text:"Browse links"}],n,r,C([a.anchor.map(ge.createUi("anchor","Anchors")),a.rels.map(ge.createUi("rel","Rel")),a.targets.map(ge.createUi("target","Open link in...")),a.link.map(ge.createUi("link","Link list")),a.classes.map(ge.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:s,onChange:(e,{name:t})=>{i.onChange(e.getData,{name:t}).each((t=>{e.setData(t)}))},onSubmit:t}})(t,o,e)})).then((t=>{e.windowManager.open(t)}))},Ne=()=>{const e=(e=>{const t=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})(h.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(h.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(h.some(e))}}})(u);return{...e,on:t=>e.get().each(t)}};var Re=tinymce.util.Tools.resolve("tinymce.util.VK");const Be=e=>{const t=document.createElement("a");t.target="_blank",t.href=e,t.rel="noreferrer noopener";const o=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});document.dispatchEvent(o),((e,t)=>{document.body.appendChild(e),e.dispatchEvent(t),document.body.removeChild(e)})(t,o)},Le=(e,t)=>{if(t){const o=q(t);if(/^#/.test(o)){const t=e.dom.select(o);t.length&&e.selection.scrollIntoView(t[0],!0)}else Be(t.href)}},He=(e,t)=>{const o=Q(e.dom.getParents(t));return S(1===o.length,o[0])},Ie=e=>e.selection.isCollapsed()||(e=>{const t=e.selection.getRng(),o=t.startContainer;return j(o)&&t.startContainer===t.endContainer&&1===e.dom.select("img",o).length})(e)?He(e,e.selection.getStart()):(e=>{const t=J(e.selection.getRng());return S(t.length>0,t[0]).or(He(e,e.selection.getNode()))})(e),Pe=e=>()=>{e.execCommand("mceLink",!1,{dialog:!0})},Fe=(e,t)=>(e.on("NodeChange",t),()=>e.off("NodeChange",t)),ze=e=>t=>{const o=()=>{t.setActive(!e.mode.isReadOnly()&&Y(e,e.selection.getNode())),t.setEnabled(e.selection.isEditable())};return o(),Fe(e,o)},Ve=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return o(),Fe(e,o)},Ze=e=>t=>{const o=t=>{return ee(t)||(o=e.selection.getRng(),J(o).length>0);var o},n=e.dom.getParents(e.selection.getStart()),r=n=>{t.setEnabled(o(n)&&e.selection.isEditable())};return r(n),Fe(e,(e=>r(e.parents)))},Ue=(e,t)=>{const o=t=>{const o=e.selection.getNode();return t.setEnabled(Y(e,o)),u};e.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:ze(e)},label:"Link",predicate:t=>E(e)&&Y(e,t),initValue:()=>K(e).fold((e=>()=>e)(""),q),commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:t=>{const o=e.selection.getNode();return t.setActive(Y(e,o)),ze(e)(t)},onAction:t=>{const o=t.getValue(),n=(t=>{const o=K(e),n=te(e);if(o.isNone()&&n){const n=X(e.selection,o);return S(0===n.length,t)}return h.none()})(o);ae(e,{href:o,attach:u},{href:o,text:n,title:h.none(),rel:h.none(),target:h.from(O(e)),class:h.none()}),(e=>{e.selection.collapse(!1)})(e),t.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:o,onAction:t=>{ie(e),t.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:o,onAction:e=>{t.gotoSelectedLink(),e.hide()}}]})},je=e=>{const t=(e=>{const t=Ne(),o=()=>t.get().or(Ie(e));return e.on("contextmenu",(o=>{He(e,o.target).each(t.set)})),e.on("SelectionChange",(()=>{t.isSet()||Ie(e).each(t.set)})),e.on("click",(o=>{t.clear();const n=Q(e.dom.getParents(o.target));1===n.length&&Re.metaKeyPressed(o)&&(o.preventDefault(),Le(e,n[0]))})),e.on("keydown",(n=>{t.clear(),!n.isDefaultPrevented()&&13===n.keyCode&&(e=>!0===e.altKey&&!1===e.shiftKey&&!1===e.ctrlKey&&!1===e.metaKey)(n)&&o().each((t=>{n.preventDefault(),Le(e,t)}))})),{gotoSelectedLink:()=>o().each((t=>Le(e,t)))}})(e);((e,t)=>{e.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Meta+K",onAction:Pe(e),onSetup:ze(e)}),e.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:t.gotoSelectedLink,onSetup:Ze(e)}),e.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:()=>ie(e),onSetup:Ze(e)})})(e,t),((e,t)=>{e.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:t.gotoSelectedLink,onSetup:Ze(e)}),e.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:Pe(e),onSetup:Ve(e)}),e.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:()=>ie(e),onSetup:Ze(e)})})(e,t),(e=>{e.ui.registry.addContextMenu("link",{update:t=>e.dom.isEditable(t)?ee(e.dom.getParents(t,"a"))?"link unlink openlink":"link":""})})(e),Ue(e,t)};e.add("link",(e=>{(e=>{const t=e.options.register;t("link_assume_external_targets",{processor:e=>{const t=n(e)||l(e);return t?!0===e?{value:1,valid:t}:"http"===e||"https"===e?{value:e,valid:t}:{value:0,valid:t}:{valid:!1,message:"Must be a string or a boolean."}},default:!1}),t("link_context_toolbar",{processor:"boolean",default:!1}),t("link_list",{processor:e=>n(e)||d(e)||m(e,r)}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"}),t("link_target_list",{processor:e=>l(e)||m(e,r),default:!0}),t("link_rel_list",{processor:"object[]",default:[]}),t("link_class_list",{processor:"object[]",default:[]}),t("link_title",{processor:"boolean",default:!0}),t("allow_unsafe_link_target",{processor:"boolean",default:!1}),t("link_quicklink",{processor:"boolean",default:!1})})(e),(e=>{e.addCommand("mceLink",((t,o)=>{!0!==(null==o?void 0:o.dialog)&&L(e)?e.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"}):Me(e)}))})(e),je(e),(e=>{e.addShortcut("Meta+K","",(()=>{e.execCommand("mceLink")}))})(e)}))}(),function(){var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=r=e,n=(s=String).prototype,n.isPrototypeOf(o)||(null===(a=r.constructor)||void 0===a?void 0:a.name)===s.name)?"string":t;var o,n;var r,s,a})(t)===e,o=e=>t=>typeof t===e,n=t("string"),r=t("object"),s=t("array"),a=o("boolean"),i=e=>!(e=>null==e)(e),l=o("function"),c=o("number"),d=()=>{},m=e=>()=>e,u=(e,t)=>e===t;const g=e=>t=>!e(t),h=m(!1);class p{constructor(e,t){this.tag=e,this.value=t}static some(e){return new p(!0,e)}static none(){return p.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?p.some(e(this.value)):p.none()}bind(e){return this.tag?e(this.value):p.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:p.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return i(e)?p.some(e):p.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}p.singletonNone=new p(!1);const f=Array.prototype.slice,v=Array.prototype.indexOf,b=Array.prototype.push,y=(e,t)=>{return o=e,n=t,v.call(o,n)>-1;var o,n},w=(e,t)=>{for(let o=0,n=e.length;o{const o=e.length,n=new Array(o);for(let r=0;r{for(let o=0,n=e.length;o{const o=[];for(let n=0,r=e.length;n(C(e,((e,n)=>{o=t(o,e,n)})),o),_=(e,t,o)=>{for(let n=0,r=e.length;n_(e,t,h),T=(e,t)=>(e=>{const t=[];for(let o=0,n=e.length;o{const t=f.call(e,0);return t.reverse(),t},A=(e,t)=>t>=0&&tA(e,0),M=e=>A(e,e.length-1),N=(e,t)=>{const o=[],n=l(t)?e=>w(o,(o=>t(o,e))):e=>y(o,e);for(let t=0,r=e.length;te.exists((e=>o(e,t))),B=(e,t,o)=>e.isSome()&&t.isSome()?p.some(o(e.getOrDie(),t.getOrDie())):p.none(),L=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},H={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return L(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return L(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return L(o)},fromDom:L,fromPoint:(e,t,o)=>p.from(e.dom.elementFromPoint(t,o)).map(L)},I=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},P=(e,t)=>e.dom===t.dom,F=I,z="undefined"!=typeof window?window:Function("return this;")(),V=(e,t)=>((e,t)=>{let o=null!=t?t:z;for(let t=0;t{const o=((e,t)=>V(e,t))(e,t);if(null==o)throw new Error(e+" not available on this browser");return o},U=Object.getPrototypeOf,j=e=>{const t=V("ownerDocument.defaultView",e);return r(e)&&((e=>Z("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(U(e).constructor.name))},W=e=>e.dom.nodeName.toLowerCase(),$=e=>e.dom.nodeType,q=e=>t=>$(t)===e,G=e=>K(e)&&j(e.dom),K=q(1),Y=q(3),X=q(11),J=e=>t=>K(t)&&W(t)===e,Q=e=>p.from(e.dom.parentNode).map(H.fromDom),ee=e=>x(e.dom.childNodes,H.fromDom),te=(e,t)=>{const o=e.dom.childNodes;return p.from(o[t]).map(H.fromDom)},oe=e=>te(e,0),ne=e=>te(e,e.dom.childNodes.length-1),re=e=>{const t=(e=>H.fromDom(e.dom.getRootNode()))(e);return X(o=t)&&i(o.dom.host)?p.some(t):p.none();var o},se=e=>H.fromDom(e.dom.host),ae=e=>{const t=Y(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return re(H.fromDom(t)).fold((()=>o.body.contains(t)),(n=ae,r=se,e=>n(r(e))));var n,r};var ie=(e,t,o,n,r)=>e(o,n)?p.some(o):l(r)&&r(o)?p.none():t(o,n,r);const le=(e,t,o)=>{let n=e.dom;const r=l(o)?o:h;for(;n.parentNode;){n=n.parentNode;const e=H.fromDom(n);if(t(e))return p.some(e);if(r(e))break}return p.none()},ce=(e,t,o)=>ie(((e,t)=>t(e)),le,e,t,o),de=(e,t,o)=>le(e,(e=>I(e,t)),o),me=e=>{return ie(((e,t)=>I(e,t)),de,e,"[contenteditable]",t);var t},ue=e=>e.dom.contentEditable,ge=(e,t)=>{Q(e).each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},he=(e,t)=>{const o=(e=>p.from(e.dom.nextSibling).map(H.fromDom))(e);o.fold((()=>{Q(e).each((e=>{pe(e,t)}))}),(e=>{ge(e,t)}))},pe=(e,t)=>{e.dom.appendChild(t.dom)},fe=(e,t)=>{C(t,(t=>{pe(e,t)}))},ve=e=>{e.dom.textContent="",C(ee(e),(e=>{be(e)}))},be=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)};var ye=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),we=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),xe=tinymce.util.Tools.resolve("tinymce.util.VK");const Ce=e=>x(e,H.fromDom),Se=Object.keys,ke=(e,t)=>{const o=Se(e);for(let n=0,r=o.length;n{const o={};var n;return((e,t,o,n)=>{ke(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))})(e,t,(n=o,(e,t)=>{n[t]=e}),d),o},Ee=(e,t)=>{const o=e.dom;ke(t,((e,t)=>{((e,t,o)=>{if(!(n(o)||a(o)||c(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")})(o,t,e)}))},Te=e=>k(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}),Oe=e=>((e,t)=>H.fromDom(e.dom.cloneNode(t)))(e,!0),Ae=(e,t)=>{const o=((e,t)=>{const o=H.fromTag(t),n=Te(e);return Ee(o,n),o})(e,t);he(e,o);const n=ee(e);return fe(o,n),be(e),o};var De=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Me=tinymce.util.Tools.resolve("tinymce.util.Tools");const Ne=e=>t=>i(t)&&t.nodeName.toLowerCase()===e,Re=e=>t=>i(t)&&e.test(t.nodeName),Be=e=>i(e)&&3===e.nodeType,Le=e=>i(e)&&1===e.nodeType,He=Re(/^(OL|UL|DL)$/),Ie=Re(/^(OL|UL)$/),Pe=Ne("ol"),Fe=Re(/^(LI|DT|DD)$/),ze=Re(/^(DT|DD)$/),Ve=Re(/^(TH|TD)$/),Ze=Ne("br"),Ue=(e,t)=>i(t)&&t.nodeName in e.schema.getTextBlockElements(),je=(e,t)=>i(e)&&e.nodeName in t,We=(e,t)=>i(t)&&t.nodeName in e.schema.getVoidElements(),$e=(e,t,o)=>{const n=e.isEmpty(t);return!(o&&e.select("span[data-mce-type=bookmark]",t).length>0)&&n},qe=(e,t)=>e.isChildOf(t,e.getRoot()),Ge=e=>t=>t.options.get(e),Ke=Ge("lists_indent_on_tab"),Ye=Ge("forced_root_block"),Xe=Ge("forced_root_block_attrs"),Je=(e,t,o={})=>{const n=e.dom,r=e.schema.getBlockElements(),s=n.createFragment(),a=Ye(e),i=Xe(e);let l,c,d=!1;for(c=n.create(a,{...i,...o.style?{style:o.style}:{}}),je(t.firstChild,r)||s.appendChild(c);l=t.firstChild;){const e=l.nodeName;d||"SPAN"===e&&"bookmark"===l.getAttribute("data-mce-type")||(d=!0),je(l,r)?(s.appendChild(l),c=null):(c||(c=n.create(a,i),s.appendChild(c)),c.appendChild(l))}return!d&&c&&c.appendChild(n.create("br",{"data-mce-bogus":"1"})),s},Qe=De.DOM,et=(e,t,o)=>{const n=Qe.select('span[data-mce-type="bookmark"]',t),r=Je(e,o),s=Qe.createRng();s.setStartAfter(o),s.setEndAfter(t);const a=s.extractContents();for(let t=a.firstChild;t;t=t.firstChild)if("LI"===t.nodeName&&e.dom.isEmpty(t)){Qe.remove(t);break}e.dom.isEmpty(a)||Qe.insertAfter(a,t),Qe.insertAfter(r,t);const i=o.parentElement;i&&$e(e.dom,i)&&(e=>{const t=e.parentNode;t&&Me.each(n,(e=>{t.insertBefore(e,o.parentNode)})),Qe.remove(e)})(i),Qe.remove(o),$e(e.dom,t)&&Qe.remove(t)},tt=J("dd"),ot=J("dt"),nt=(e,t)=>{var o;tt(t)?Ae(t,"dt"):ot(t)&&(o=t,p.from(o.dom.parentElement).map(H.fromDom)).each((o=>et(e,o.dom,t.dom)))},rt=e=>{ot(e)&&Ae(e,"dd")},st=(e,t)=>{if(Be(e))return{container:e,offset:t};const o=ye.getNode(e,t);return Be(o)?{container:o,offset:t>=e.childNodes.length?o.data.length:0}:o.previousSibling&&Be(o.previousSibling)?{container:o.previousSibling,offset:o.previousSibling.data.length}:o.nextSibling&&Be(o.nextSibling)?{container:o.nextSibling,offset:0}:{container:e,offset:t}},at=e=>{const t=e.cloneRange(),o=st(e.startContainer,e.startOffset);t.setStart(o.container,o.offset);const n=st(e.endContainer,e.endOffset);return t.setEnd(n.container,n.offset),t},it=["OL","UL","DL"],lt=it.join(","),ct=(e,t)=>{const o=t||e.selection.getStart(!0);return e.dom.getParent(o,lt,gt(e,o))},dt=e=>{const t=ct(e),o=e.selection.getSelectedBlocks();return((e,t)=>i(e)&&1===t.length&&t[0]===e)(t,o)?(e=>S(e.querySelectorAll(lt),He))(t):S(o,(e=>He(e)&&t!==e))},mt=e=>{const t=e.selection.getSelectedBlocks();return S(((e,t)=>{const o=Me.map(t,(t=>e.dom.getParent(t,"li,dd,dt",gt(e,t))||t));return N(o)})(e,t),Fe)},ut=(e,t)=>{const o=e.dom.getParents(t,"TD,TH");return o.length>0?o[0]:e.getBody()},gt=(e,t)=>{const o=e.dom.getParents(t,e.dom.isBlock),n=E(o,(t=>{return(t=>t.nodeName.toLowerCase()!==Ye(e))(t)&&(o=e.schema,!He(n=t)&&!Fe(n)&&w(it,(e=>o.isValidChild(n.nodeName,e))));var o,n}));return n.getOr(e.getBody())},ht=(e,t)=>{const o=e.dom.getParents(t,"ol,ul",gt(e,t));return M(o)},pt=e=>{const t=(e=>{const t=ht(e,e.selection.getStart()),o=S(e.selection.getSelectedBlocks(),Ie);return t.toArray().concat(o)})(e),o=(e=>{const t=e.selection.getStart();return e.dom.getParents(t,"ol,ul",gt(e,t))})(e);return E(o,(e=>{return t=H.fromDom(e),Q(t).exists((e=>Fe(e.dom)&&oe(e).exists((e=>!He(e.dom)))&&ne(e).exists((e=>!He(e.dom)))));var t})).fold((()=>ft(e,t)),(e=>[e]))},ft=(e,t)=>{const o=x(t,(t=>ht(e,t).getOr(t)));return N(o)},vt=e=>/\btox\-/.test(e.className),bt=(e,t)=>_(e,He,Ve).exists((e=>e.nodeName===t&&!vt(e))),yt=(e,t)=>null!==t&&!e.dom.isEditable(t),wt=(e,t)=>{const o=e.dom.getParent(t,"ol,ul,dl");return yt(e,o)},xt=(e,t)=>{const o=e.selection.getNode();return t({parents:e.dom.getParents(o),element:o}),e.on("NodeChange",t),()=>e.off("NodeChange",t)},Ct=(e,t)=>{const o=document.createDocumentFragment();return C(e,(e=>{o.appendChild(e.dom)})),H.fromDom(o)},St=(e,t,o)=>e.dispatch("ListMutation",{action:t,element:o}),kt=(_t=/^\s+|\s+$/g,e=>e.replace(_t,""));var _t;const Et=(e,t,o)=>{if(!n(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);(e=>void 0!==e.style&&l(e.style.getPropertyValue))(e)&&e.style.setProperty(t,o)},Tt=(e,t,o)=>{const n=e.dom;Et(n,t,o)},Ot=e=>F(e,"OL,UL"),At=e=>oe(e).exists(Ot),Dt=e=>"listAttributes"in e,Mt=e=>"isComment"in e,Nt=e=>e.depth>0,Rt=e=>e.isSelected,Bt=e=>{const t=ee(e),o=ne(e).exists(Ot)?t.slice(0,-1):t;return x(o,Oe)},Lt=(e,t)=>{pe(e.item,t.list)},Ht=(e,t)=>{const o={list:H.fromTag(t,e),item:H.fromTag("li",e)};return pe(o.list,o.item),o},It=(e,t,o)=>{const n=t.slice(0,o.depth);return M(n).each((t=>{if(Dt(o)){const n=((e,t,o)=>{const n=H.fromTag("li",e);return Ee(n,t),fe(n,o),n})(e,o.itemAttributes,o.content);((e,t)=>{pe(e.list,t),e.item=t})(t,n),((e,t)=>{W(e.list)!==t.listType&&(e.list=Ae(e.list,t.listType)),Ee(e.list,t.listAttributes)})(t,o)}else if((e=>"isFragment"in e)(o))fe(t.item,o.content);else{const e=H.fromHtml(`\x3c!--${o.content}--\x3e`);pe(t.list,e)}})),n},Pt=(e,t,o)=>{const n=((e,t,o)=>{const n=[];for(let r=0;r{for(let t=1;t{for(let t=0;t{Dt(t)&&(Ee(e.list,t.listAttributes),Ee(e.item,t.itemAttributes)),fe(e.item,t.content)}))})(n,o),r=n,B(M(t),D(r),Lt),t.concat(n)},Ft=(e,t)=>{let o=p.none();const n=k(t,((t,n,r)=>Mt(n)?0===r?(o=p.some(n),t):It(e,t,n):n.depth>t.length?Pt(e,t,n):It(e,t,n)),[]);return o.each((e=>{const t=H.fromHtml(`\x3c!--${e.content}--\x3e`);D(n).each((e=>{((e,t)=>{oe(e).fold((()=>{pe(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))})(e.list,t)}))})),D(n).map((e=>e.list))},zt=e=>(C(e,((t,o)=>{((e,t)=>{const o=e[t].depth,n=e=>e.depth===o&&!e.dirty,r=e=>e.depth_(e.slice(t+1),n,r)))})(e,o).fold((()=>{t.dirty&&Dt(t)&&(e=>{e.listAttributes=_e(e.listAttributes,((e,t)=>"start"!==t))})(t)}),(e=>{return n=e,void(Dt(o=t)&&Dt(n)&&(o.listType=n.listType,o.listAttributes={...n.listAttributes}));var o,n}))})),e),Vt=(e,t,o,n)=>{var r,s;if(8===$(s=n)||"#comment"===W(s))return[{depth:e+1,content:null!==(r=n.dom.nodeValue)&&void 0!==r?r:"",dirty:!1,isSelected:!1,isComment:!0}];t.each((e=>{P(e.start,n)&&o.set(!0)}));const a=((e,t,o)=>Q(e).filter(K).map((n=>({depth:t,dirty:!1,isSelected:o,content:Bt(e),itemAttributes:Te(e),listAttributes:Te(n),listType:W(n),isInPreviousLi:!1}))))(n,e,o.get());t.each((e=>{P(e.end,n)&&o.set(!1)}));const i=ne(n).filter(Ot).map((n=>Ut(e,t,o,n))).getOr([]);return a.toArray().concat(i)},Zt=(e,t,o,n)=>oe(n).filter(Ot).fold((()=>Vt(e,t,o,n)),(r=>{const s=k(ee(n),((n,s,a)=>{if(0===a)return n;if(F(s,"LI"))return n.concat(Vt(e,t,o,s));{const t={isFragment:!0,depth:e,content:[s],isSelected:!1,dirty:!1,parentListType:W(r)};return n.concat(t)}}),[]);return Ut(e,t,o,r).concat(s)})),Ut=(e,t,o,n)=>T(ee(n),(n=>(Ot(n)?Ut:Zt)(e+1,t,o,n))),jt=(e,t)=>T(((e,t)=>{if(0===e.length)return[];{let o=t(e[0]);const n=[];let r=[];for(let s=0,a=e.length;sD(t).exists(Nt)?((e,t)=>{const o=zt(t);return Ft(e.contentDocument,o).toArray()})(e,t):((e,t)=>{const o=zt(t);return x(o,(t=>{const o=Mt(t)?Ct([H.fromHtml(`\x3c!--${t.content}--\x3e`)]):Ct(t.content),n=Dt(t)?t.itemAttributes:{};return H.fromDom(Je(e,o.dom,n))}))})(e,t))),Wt=(e,t,o)=>{const n=((e,t)=>{const o=(()=>{let e=!1;return{get:()=>e,set:t=>{e=t}}})();return x(e,(e=>({sourceList:e,entries:Ut(0,t,o,e)})))})(t,(e=>{const t=x(mt(e),H.fromDom);return B(E(t,g(At)),E(O(t),g(At)),((e,t)=>({start:e,end:t})))})(e));C(n,(t=>{((e,t)=>{C(S(e,Rt),(e=>((e,t)=>{switch(e){case"Indent":t.depth++;break;case"Outdent":t.depth--;break;case"Flatten":t.depth=0}t.dirty=!0})(t,e)))})(t.entries,o);const n=jt(e,t.entries);var r;C(n,(t=>{St(e,"Indent"===o?"IndentList":"OutdentList",t.dom)})),r=t.sourceList,C(n,(e=>{ge(r,e)})),be(t.sourceList)}))},$t=(e,t)=>{const o=Ce(pt(e)),n=Ce((e=>S(mt(e),ze))(e));let r=!1;if(o.length||n.length){const s=e.selection.getBookmark();Wt(e,o,t),((e,t,o)=>{C(o,"Indent"===t?rt:t=>nt(e,t))})(e,t,n),e.selection.moveToBookmark(s),e.selection.setRng(at(e.selection.getRng())),e.nodeChanged(),r=!0}return r},qt=(e,t)=>!(e=>{const t=ct(e);return yt(e,t)})(e)&&$t(e,t),Gt=e=>qt(e,"Indent"),Kt=e=>qt(e,"Outdent"),Yt=e=>qt(e,"Flatten"),Xt=e=>"\ufeff"===e,Jt=(e,t)=>{return o=e,n=function(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}(P,t),le(o,n,r).isSome();var o,n,r};var Qt=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager");const eo=De.DOM,to=e=>{const t={},o=o=>{let n=e[o?"startContainer":"endContainer"],r=e[o?"startOffset":"endOffset"];if(Le(n)){const e=eo.create("span",{"data-mce-type":"bookmark"});n.hasChildNodes()?(r=Math.min(r,n.childNodes.length-1),o?n.insertBefore(e,n.childNodes[r]):eo.insertAfter(e,n.childNodes[r])):n.appendChild(e),n=e,r=0}t[o?"startContainer":"endContainer"]=n,t[o?"startOffset":"endOffset"]=r};return o(!0),e.collapsed||o(),t},oo=e=>{const t=t=>{let o=e[t?"startContainer":"endContainer"],n=e[t?"startOffset":"endOffset"];if(o){if(Le(o)&&o.parentNode){const e=o;n=(e=>{var t;let o=null===(t=e.parentNode)||void 0===t?void 0:t.firstChild,n=0;for(;o;){if(o===e)return n;Le(o)&&"bookmark"===o.getAttribute("data-mce-type")||n++,o=o.nextSibling}return-1})(o),o=o.parentNode,eo.remove(e),!o.hasChildNodes()&&eo.isBlock(o)&&o.appendChild(eo.create("br"))}e[t?"startContainer":"endContainer"]=o,e[t?"startOffset":"endOffset"]=n}};t(!0),t();const o=eo.createRng();return o.setStart(e.startContainer,e.startOffset),e.endContainer&&o.setEnd(e.endContainer,e.endOffset),at(o)},no=e=>{switch(e){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},ro=(e,t)=>{Me.each(t,((t,o)=>{e.setAttribute(o,t)}))},so=(e,t,o)=>{((e,t,o)=>{const n=o["list-style-type"]?o["list-style-type"]:null;e.setStyle(t,"list-style-type",n)})(e,t,o),((e,t,o)=>{ro(t,o["list-attributes"]),Me.each(e.select("li",t),(e=>{ro(e,o["list-item-attributes"])}))})(e,t,o)},ao=(e,t)=>i(t)&&!je(t,e.schema.getBlockElements()),io=(e,t,o,n)=>{let r=t[o?"startContainer":"endContainer"];const s=t[o?"startOffset":"endOffset"];Le(r)&&(r=r.childNodes[Math.min(s,r.childNodes.length-1)]||r),!o&&Ze(r.nextSibling)&&(r=r.nextSibling);const a=(t,o)=>{var r;const s=new we(t,(t=>{for(;!e.dom.isBlock(t)&&t.parentNode&&n!==t;)t=t.parentNode;return t})(t)),a=o?"next":"prev";let i;for(;i=s[a]();)if(!We(e,i)&&!Xt(i.textContent)&&0!==(null===(r=i.textContent)||void 0===r?void 0:r.length))return p.some(i);return p.none()};if(o&&Be(r))if(Xt(r.textContent))r=a(r,!1).getOr(r);else for(null!==r.parentNode&&ao(e,r.parentNode)&&(r=r.parentNode);null!==r.previousSibling&&(ao(e,r.previousSibling)||Be(r.previousSibling));)r=r.previousSibling;if(!o&&Be(r))if(Xt(r.textContent))r=a(r,!0).getOr(r);else for(null!==r.parentNode&&ao(e,r.parentNode)&&(r=r.parentNode);null!==r.nextSibling&&(ao(e,r.nextSibling)||Be(r.nextSibling));)r=r.nextSibling;for(;r.parentNode!==n;){const t=r.parentNode;if(Ue(e,r))return r;if(/^(TD|TH)$/.test(t.nodeName))return r;r=t}return r},lo=(e,t,o)=>{const n=e.selection.getRng();let r="LI";const s=gt(e,((e,t)=>{const o=e.selection.getStart(!0),n=io(e,t,!0,e.getBody());return Jt(H.fromDom(n),H.fromDom(t.commonAncestorContainer))?t.commonAncestorContainer:o})(e,n)),a=e.dom;if("false"===a.getContentEditable(e.selection.getNode()))return;"DL"===(t=t.toUpperCase())&&(r="DT");const i=to(n),l=S(((e,t,o)=>{const n=[],r=e.dom,s=io(e,t,!0,o),a=io(e,t,!1,o);let i;const l=[];for(let e=s;e&&(l.push(e),e!==a);e=e.nextSibling);return Me.each(l,(t=>{var s;if(Ue(e,t))return n.push(t),void(i=null);if(r.isBlock(t)||Ze(t))return Ze(t)&&r.remove(t),void(i=null);const a=t.nextSibling;Qt.isBookmarkNode(t)&&(He(a)||Ue(e,a)||!a&&t.parentNode===o)?i=null:(i||(i=r.create("p"),null===(s=t.parentNode)||void 0===s||s.insertBefore(i,t),n.push(i)),i.appendChild(t))})),n})(e,n,s),e.dom.isEditable);Me.each(l,(n=>{let s;const i=n.previousSibling,l=n.parentNode;Fe(l)||(i&&He(i)&&i.nodeName===t&&((e,t,o)=>{const n=e.getStyle(t,"list-style-type");let r=o?o["list-style-type"]:"";return r=null===r?"":r,n===r})(a,i,o)?(s=i,n=a.rename(n,r),i.appendChild(n)):(s=a.create(t),l.insertBefore(s,n),s.appendChild(n),n=a.rename(n,r)),((e,t,o)=>{Me.each(o,(o=>e.setStyle(t,o,"")))})(a,n,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),so(a,s,o),mo(e.dom,s))})),e.selection.setRng(oo(i))},co=(e,t,o)=>{return((e,t)=>He(e)&&e.nodeName===(null==t?void 0:t.nodeName))(t,o)&&((e,t,o)=>e.getStyle(t,"list-style-type",!0)===e.getStyle(o,"list-style-type",!0))(e,t,o)&&(n=o,t.className===n.className);var n},mo=(e,t)=>{let o,n=t.nextSibling;if(co(e,t,n)){const r=n;for(;o=r.firstChild;)t.appendChild(o);e.remove(r)}if(n=t.previousSibling,co(e,t,n)){const r=n;for(;o=r.lastChild;)t.insertBefore(o,t.firstChild);e.remove(r)}},uo=(e,t,o,n)=>{if(t.nodeName!==o){const r=e.dom.rename(t,o);so(e.dom,r,n),St(e,no(o),r)}else so(e.dom,t,n),St(e,no(o),t)},go=(e,t,o,n)=>{if(t.classList.forEach(((e,o,n)=>{e.startsWith("tox-")&&(n.remove(e),0===n.length&&t.removeAttribute("class"))})),t.nodeName!==o){const r=e.dom.rename(t,o);so(e.dom,r,n),St(e,no(o),r)}else so(e.dom,t,n),St(e,no(o),t)},ho=e=>"list-style-type"in e,po=(e,t,o)=>{const n=ct(e);if(wt(e,n))return;const s=dt(e),a=r(o)?o:{};s.length>0?((e,t,o,n,r)=>{const s=He(t);if(!s||t.nodeName!==n||ho(r)||vt(t)){lo(e,n,r);const a=to(e.selection.getRng()),i=s?[t,...o]:o,l=s&&vt(t)?go:uo;Me.each(i,(t=>{l(e,t,n,r)})),e.selection.setRng(oo(a))}else Yt(e)})(e,n,s,t,a):((e,t,o,n)=>{if(t!==e.getBody())if(t)if(t.nodeName!==o||ho(n)||vt(t)){const r=to(e.selection.getRng());vt(t)&&t.classList.forEach(((e,o,n)=>{e.startsWith("tox-")&&(n.remove(e),0===n.length&&t.removeAttribute("class"))})),so(e.dom,t,n);const s=e.dom.rename(t,o);mo(e.dom,s),e.selection.setRng(oo(r)),lo(e,o,n),St(e,no(o),s)}else Yt(e);else lo(e,o,n),St(e,no(o),t)})(e,n,t,a)},fo=De.DOM,vo=(e,t)=>{const o=Me.grep(e.select("ol,ul",t));Me.each(o,(t=>{((e,t)=>{const o=t.parentElement;if(o&&"LI"===o.nodeName&&o.firstChild===t){const n=o.previousSibling;n&&"LI"===n.nodeName?(n.appendChild(t),$e(e,o)&&fo.remove(o)):fo.setStyle(o,"listStyleType","none")}if(He(o)){const e=o.previousSibling;e&&"LI"===e.nodeName&&e.appendChild(t)}})(e,t)}))},bo=(e,t,o,n)=>{let r=t.startContainer;const s=t.startOffset;if(Be(r)&&(o?s0))return r;const a=e.schema.getNonEmptyElements();Le(r)&&(r=ye.getNode(r,s));const i=new we(r,n);o&&((e,t)=>!!Ze(t)&&e.isBlock(t.nextSibling)&&!Ze(t.previousSibling))(e.dom,r)&&i.next();const l=o?i.next.bind(i):i.prev2.bind(i);for(;r=l();){if("LI"===r.nodeName&&!r.hasChildNodes())return r;if(a[r.nodeName])return r;if(Be(r)&&r.data.length>0)return r}return null},yo=(e,t)=>{const o=t.childNodes;return 1===o.length&&!He(o[0])&&e.isBlock(o[0])},wo=e=>p.from(e).map(H.fromDom).filter(G).exists((e=>((e,t=!1)=>ae(e)?e.dom.isContentEditable:me(e).fold(m(t),(e=>"true"===ue(e))))(e)&&!y(["details"],W(e)))),xo=(e,t,o)=>{let n;const r=yo(e,o)?o.firstChild:o;if(((e,t)=>{yo(e,t)&&wo(t.firstChild)&&e.remove(t.firstChild,!0)})(e,t),!$e(e,t,!0))for(;n=t.firstChild;)r.appendChild(n)},Co=(e,t,o)=>{let n;const r=t.parentNode;if(!qe(e,t)||!qe(e,o))return;He(o.lastChild)&&(n=o.lastChild),r===o.lastChild&&Ze(r.previousSibling)&&e.remove(r.previousSibling);const s=o.lastChild;s&&Ze(s)&&t.hasChildNodes()&&e.remove(s),$e(e,o,!0)&&ve(H.fromDom(o)),xo(e,t,o),n&&o.appendChild(n);const a=((e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)})(H.fromDom(o),H.fromDom(t))?e.getParents(t,He,o):[];e.remove(t),C(a,(t=>{$e(e,t)&&t!==e.getRoot()&&e.remove(t)}))},So=(e,t,o,n)=>{const r=e.dom;if(r.isEmpty(n))((e,t,o)=>{ve(H.fromDom(o)),Co(e.dom,t,o),e.selection.setCursorLocation(o,0)})(e,o,n);else{const s=to(t);Co(r,o,n),e.selection.setRng(oo(s))}},ko=(e,t)=>{const o=e.dom,n=e.selection,r=n.getStart(),s=ut(e,r),a=o.getParent(n.getStart(),"LI",s);if(a){const r=a.parentElement;if(r===e.getBody()&&$e(o,r))return!0;const i=at(n.getRng()),l=o.getParent(bo(e,i,t,s),"LI",s),c=l&&(t?o.isChildOf(a,l):o.isChildOf(l,a));if(l&&l!==a&&!c)return e.undoManager.transact((()=>{var o,n;t?So(e,i,l,a):(null===(n=(o=a).parentNode)||void 0===n?void 0:n.firstChild)===o?Kt(e):((e,t,o,n)=>{const r=to(t);Co(e.dom,o,n);const s=oo(r);e.selection.setRng(s)})(e,i,a,l)})),!0;if(c&&!t&&l!==a)return e.undoManager.transact((()=>{if(i.commonAncestorContainer.parentElement){const t=to(i),n=i.commonAncestorContainer.parentElement;xo(o,i.commonAncestorContainer.parentElement,l),n.remove();const r=oo(t);e.selection.setRng(r)}})),!0;if(!l&&!t&&0===i.startOffset&&0===i.endOffset)return e.undoManager.transact((()=>{Yt(e)})),!0}return!1},_o=(e,t)=>{const o=e.dom,n=e.selection.getStart(),r=ut(e,n),s=o.getParent(n,o.isBlock,r);if(s&&o.isEmpty(s,void 0,{checkRootAsContent:!0})){const n=at(e.selection.getRng()),a=o.getParent(bo(e,n,t,r),"LI",r);if(a){const i=e=>y(["td","th","caption"],W(e)),l=e=>e.dom===r;return!!((e,t,o=u)=>B(e,t,o).getOr(e.isNone()&&t.isNone()))(ce(H.fromDom(a),i,l),ce(H.fromDom(n.startContainer),i,l),P)&&(e.undoManager.transact((()=>{const n=a.parentNode;((e,t,o)=>{const n=e.getParent(t.parentNode,e.isBlock,o);e.remove(t),n&&e.isEmpty(n)&&e.remove(n)})(o,s,r),mo(o,n),e.selection.select(a,!0),e.selection.collapse(t)})),!0)}}return!1},Eo=e=>{const t=e.selection.getStart(),o=ut(e,t);return e.dom.getParent(t,"LI,DT,DD",o)||mt(e).length>0},To=(e,t)=>{const o=e.selection;return!wt(e,o.getNode())&&(o.isCollapsed()?((e,t)=>ko(e,t)||_o(e,t))(e,t):(e=>!!Eo(e)&&(e.undoManager.transact((()=>{e.execCommand("Delete"),vo(e.dom,e.getBody())})),!0))(e))},Oo=e=>{const t=O(kt(e).split("")),o=x(t,((e,t)=>{const o=e.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,t)*o}));return k(o,((e,t)=>e+t),0)},Ao=e=>{if(--e<0)return"";{const t=e%26,o=Math.floor(e/26);return Ao(o)+String.fromCharCode("A".charCodeAt(0)+t)}},Do=e=>{const t=parseInt(e.start,10);return R(e.listStyleType,"upper-alpha")?Ao(t):R(e.listStyleType,"lower-alpha")?Ao(t).toLowerCase():e.start},Mo=e=>{const t=ct(e);Pe(t)&&!wt(e,t)&&e.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:Do({start:e.dom.getAttrib(t,"start","1"),listStyleType:p.from(e.dom.getStyle(t,"list-style-type"))})},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:t=>{(e=>{switch((e=>/^[0-9]+$/.test(e)?2:/^[A-Z]+$/.test(e)?0:(e=>/^[a-z]+$/.test(e))(e)?1:e.length>0?4:3)(e)){case 2:return p.some({listStyleType:p.none(),start:e});case 0:return p.some({listStyleType:p.some("upper-alpha"),start:Oo(e).toString()});case 1:return p.some({listStyleType:p.some("lower-alpha"),start:Oo(e).toString()});case 3:return p.some({listStyleType:p.none(),start:""});case 4:return p.none()}})(t.getData().start).each((t=>{e.execCommand("mceListUpdate",!1,{attrs:{start:"1"===t.start?"":t.start},styles:{"list-style-type":t.listStyleType.getOr("")}})})),t.close()}})},No=(e,t)=>()=>{const o=ct(e);return i(o)&&o.nodeName===t},Ro=e=>{e.addCommand("mceListProps",(()=>{Mo(e)}))},Bo=e=>{e.on("BeforeExecCommand",(t=>{const o=t.command.toLowerCase();"indent"===o?Gt(e):"outdent"===o&&Kt(e)})),e.addCommand("InsertUnorderedList",((t,o)=>{po(e,"UL",o)})),e.addCommand("InsertOrderedList",((t,o)=>{po(e,"OL",o)})),e.addCommand("InsertDefinitionList",((t,o)=>{po(e,"DL",o)})),e.addCommand("RemoveList",(()=>{Yt(e)})),Ro(e),e.addCommand("mceListUpdate",((t,o)=>{r(o)&&((e,t)=>{const o=ct(e);null===o||wt(e,o)||e.undoManager.transact((()=>{r(t.styles)&&e.dom.setStyles(o,t.styles),r(t.attrs)&&ke(t.attrs,((t,n)=>e.dom.setAttrib(o,n,t)))}))})(e,o)})),e.addQueryStateHandler("InsertUnorderedList",No(e,"UL")),e.addQueryStateHandler("InsertOrderedList",No(e,"OL")),e.addQueryStateHandler("InsertDefinitionList",No(e,"DL"))};var Lo=tinymce.util.Tools.resolve("tinymce.html.Node");const Ho=e=>3===e.type,Io=e=>0===e.length,Po=e=>{const t=(t,o)=>{const n=Lo.create("li");C(t,(e=>n.append(e))),o?e.insert(n,o,!0):e.append(n)},o=k(e.children(),((e,o)=>Ho(o)?[...e,o]:Io(e)||Ho(o)?e:(t(e,o),[])),[]);Io(o)||t(o)},Fo=e=>{Ke(e)&&(e=>{e.on("keydown",(t=>{t.keyCode!==xe.TAB||xe.metaKeyPressed(t)||e.undoManager.transact((()=>{(t.shiftKey?Kt(e):Gt(e))&&t.preventDefault()}))}))})(e),(e=>{e.on("ExecCommand",(t=>{const o=t.command.toLowerCase();"delete"!==o&&"forwarddelete"!==o||!Eo(e)||vo(e.dom,e.getBody())})),e.on("keydown",(t=>{t.keyCode===xe.BACKSPACE?To(e,!1)&&t.preventDefault():t.keyCode===xe.DELETE&&To(e,!0)&&t.preventDefault()}))})(e)},zo=(e,t)=>o=>(o.setEnabled(e.selection.isEditable()),xt(e,(n=>{o.setActive(bt(n.parents,t)),o.setEnabled(!wt(e,n.element)&&e.selection.isEditable())}))),Vo=(e,t)=>o=>xt(e,(n=>o.setEnabled(bt(n.parents,t)&&!wt(e,n.element))));e.add("lists",(e=>((e=>{(0,e.options.register)("lists_indent_on_tab",{processor:"boolean",default:!0})})(e),(e=>{e.on("PreInit",(()=>{const{parser:t}=e;t.addNodeFilter("ul,ol",(e=>C(e,Po)))}))})(e),e.hasPlugin("rtc",!0)?Ro(e):(Fo(e),Bo(e)),(e=>{const t=t=>()=>e.execCommand(t);e.hasPlugin("advlist")||(e.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:t("InsertOrderedList"),onSetup:zo(e,"OL")}),e.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:t("InsertUnorderedList"),onSetup:zo(e,"UL")}))})(e),(e=>{const t={text:"List properties...",icon:"ordered-list",onAction:()=>e.execCommand("mceListProps"),onSetup:Vo(e,"OL")};e.ui.registry.addMenuItem("listprops",t),e.ui.registry.addContextMenu("lists",{update:t=>{const o=ct(e,t);return Pe(o)?["listprops"]:[]}})})(e),(e=>({backspaceDelete:t=>{To(e,t)}}))(e))))}();export{n as default}; diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index 764b0419f5..0000000000 --- a/yarn.lock +++ /dev/null @@ -1,4388 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@aashutoshrathi/word-wrap@^1.2.3": - version "1.2.6" - resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" - integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== - -"@ampproject/remapping@^2.2.0": - version "2.2.1" - resolved "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz" - integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== - dependencies: - "@jridgewell/gen-mapping" "^0.3.0" - "@jridgewell/trace-mapping" "^0.3.9" - -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.7.tgz#882fd9e09e8ee324e496bd040401c6f046ef4465" - integrity sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA== - dependencies: - "@babel/highlight" "^7.24.7" - picocolors "^1.0.0" - -"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.24.8": - version "7.24.9" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.24.9.tgz#53eee4e68f1c1d0282aa0eb05ddb02d033fc43a0" - integrity sha512-e701mcfApCJqMMueQI0Fb68Amflj83+dvAvHawoBpAz+GDjCIyGHzNwnefjsWJ3xiYAqqiQFoWbspGYBdb2/ng== - -"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.24.9": - version "7.24.9" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.24.9.tgz#dc07c9d307162c97fa9484ea997ade65841c7c82" - integrity sha512-5e3FI4Q3M3Pbr21+5xJwCv6ZT6KmGkI0vw3Tozy5ODAQFTIWe37iT8Cr7Ice2Ntb+M3iSKCEWMB1MBgKrW3whg== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.24.7" - "@babel/generator" "^7.24.9" - "@babel/helper-compilation-targets" "^7.24.8" - "@babel/helper-module-transforms" "^7.24.9" - "@babel/helpers" "^7.24.8" - "@babel/parser" "^7.24.8" - "@babel/template" "^7.24.7" - "@babel/traverse" "^7.24.8" - "@babel/types" "^7.24.9" - convert-source-map "^2.0.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.3" - semver "^6.3.1" - -"@babel/generator@^7.24.8", "@babel/generator@^7.24.9", "@babel/generator@^7.7.2": - version "7.24.10" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.24.10.tgz#a4ab681ec2a78bbb9ba22a3941195e28a81d8e76" - integrity sha512-o9HBZL1G2129luEUlG1hB4N/nlYNWHnpwlND9eOMclRqqu1YDy2sSYVCFUZwl8I1Gxh+QSRrP2vD7EpUmFVXxg== - dependencies: - "@babel/types" "^7.24.9" - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.25" - jsesc "^2.5.1" - -"@babel/helper-annotate-as-pure@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.24.7.tgz#5373c7bc8366b12a033b4be1ac13a206c6656aab" - integrity sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg== - dependencies: - "@babel/types" "^7.24.7" - -"@babel/helper-builder-binary-assignment-operator-visitor@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.24.7.tgz#37d66feb012024f2422b762b9b2a7cfe27c7fba3" - integrity sha512-xZeCVVdwb4MsDBkkyZ64tReWYrLRHlMN72vP7Bdm3OUOuyFZExhsHUUnuWnm2/XOlAJzR0LfPpB56WXZn0X/lA== - dependencies: - "@babel/traverse" "^7.24.7" - "@babel/types" "^7.24.7" - -"@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.24.7", "@babel/helper-compilation-targets@^7.24.8": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.8.tgz#b607c3161cd9d1744977d4f97139572fe778c271" - integrity sha512-oU+UoqCHdp+nWVDkpldqIQL/i/bvAv53tRqLG/s+cOXxe66zOYLU7ar/Xs3LdmBihrUMEUhwu6dMZwbNOYDwvw== - dependencies: - "@babel/compat-data" "^7.24.8" - "@babel/helper-validator-option" "^7.24.8" - browserslist "^4.23.1" - lru-cache "^5.1.1" - semver "^6.3.1" - -"@babel/helper-create-class-features-plugin@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.7.tgz#2eaed36b3a1c11c53bdf80d53838b293c52f5b3b" - integrity sha512-kTkaDl7c9vO80zeX1rJxnuRpEsD5tA81yh11X1gQo+PhSti3JS+7qeZo9U4RHobKRiFPKaGK3svUAeb8D0Q7eg== - dependencies: - "@babel/helper-annotate-as-pure" "^7.24.7" - "@babel/helper-environment-visitor" "^7.24.7" - "@babel/helper-function-name" "^7.24.7" - "@babel/helper-member-expression-to-functions" "^7.24.7" - "@babel/helper-optimise-call-expression" "^7.24.7" - "@babel/helper-replace-supers" "^7.24.7" - "@babel/helper-skip-transparent-expression-wrappers" "^7.24.7" - "@babel/helper-split-export-declaration" "^7.24.7" - semver "^6.3.1" - -"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.24.7.tgz#be4f435a80dc2b053c76eeb4b7d16dd22cfc89da" - integrity sha512-03TCmXy2FtXJEZfbXDTSqq1fRJArk7lX9DOFC/47VthYcxyIOx+eXQmdo6DOQvrbpIix+KfXwvuXdFDZHxt+rA== - dependencies: - "@babel/helper-annotate-as-pure" "^7.24.7" - regexpu-core "^5.3.1" - semver "^6.3.1" - -"@babel/helper-define-polyfill-provider@^0.6.1": - version "0.6.1" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.1.tgz#fadc63f0c2ff3c8d02ed905dcea747c5b0fb74fd" - integrity sha512-o7SDgTJuvx5vLKD6SFvkydkSMBvahDKGiNJzG22IZYXhiqoe9efY7zocICBgzHV4IRg5wdgl2nEL/tulKIEIbA== - dependencies: - "@babel/helper-compilation-targets" "^7.22.6" - "@babel/helper-plugin-utils" "^7.22.5" - debug "^4.1.1" - lodash.debounce "^4.0.8" - resolve "^1.14.2" - -"@babel/helper-environment-visitor@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz#4b31ba9551d1f90781ba83491dd59cf9b269f7d9" - integrity sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ== - dependencies: - "@babel/types" "^7.24.7" - -"@babel/helper-function-name@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz#75f1e1725742f39ac6584ee0b16d94513da38dd2" - integrity sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA== - dependencies: - "@babel/template" "^7.24.7" - "@babel/types" "^7.24.7" - -"@babel/helper-hoist-variables@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz#b4ede1cde2fd89436397f30dc9376ee06b0f25ee" - integrity sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ== - dependencies: - "@babel/types" "^7.24.7" - -"@babel/helper-member-expression-to-functions@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.24.7.tgz#67613d068615a70e4ed5101099affc7a41c5225f" - integrity sha512-LGeMaf5JN4hAT471eJdBs/GK1DoYIJ5GCtZN/EsL6KUiiDZOvO/eKE11AMZJa2zP4zk4qe9V2O/hxAmkRc8p6w== - dependencies: - "@babel/traverse" "^7.24.7" - "@babel/types" "^7.24.7" - -"@babel/helper-module-imports@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz#f2f980392de5b84c3328fc71d38bd81bbb83042b" - integrity sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA== - dependencies: - "@babel/traverse" "^7.24.7" - "@babel/types" "^7.24.7" - -"@babel/helper-module-transforms@^7.24.7", "@babel/helper-module-transforms@^7.24.8", "@babel/helper-module-transforms@^7.24.9": - version "7.24.9" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.24.9.tgz#e13d26306b89eea569180868e652e7f514de9d29" - integrity sha512-oYbh+rtFKj/HwBQkFlUzvcybzklmVdVV3UU+mN7n2t/q3yGHbuVdNxyFvSBO1tfvjyArpHNcWMAzsSPdyI46hw== - dependencies: - "@babel/helper-environment-visitor" "^7.24.7" - "@babel/helper-module-imports" "^7.24.7" - "@babel/helper-simple-access" "^7.24.7" - "@babel/helper-split-export-declaration" "^7.24.7" - "@babel/helper-validator-identifier" "^7.24.7" - -"@babel/helper-optimise-call-expression@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.24.7.tgz#8b0a0456c92f6b323d27cfd00d1d664e76692a0f" - integrity sha512-jKiTsW2xmWwxT1ixIdfXUZp+P5yURx2suzLZr5Hi64rURpDYdMW0pv+Uf17EYk2Rd428Lx4tLsnjGJzYKDM/6A== - dependencies: - "@babel/types" "^7.24.7" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.24.7", "@babel/helper-plugin-utils@^7.24.8", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz#94ee67e8ec0e5d44ea7baeb51e571bd26af07878" - integrity sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg== - -"@babel/helper-remap-async-to-generator@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.24.7.tgz#b3f0f203628522713849d49403f1a414468be4c7" - integrity sha512-9pKLcTlZ92hNZMQfGCHImUpDOlAgkkpqalWEeftW5FBya75k8Li2ilerxkM/uBEj01iBZXcCIB/bwvDYgWyibA== - dependencies: - "@babel/helper-annotate-as-pure" "^7.24.7" - "@babel/helper-environment-visitor" "^7.24.7" - "@babel/helper-wrap-function" "^7.24.7" - -"@babel/helper-replace-supers@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.24.7.tgz#f933b7eed81a1c0265740edc91491ce51250f765" - integrity sha512-qTAxxBM81VEyoAY0TtLrx1oAEJc09ZK67Q9ljQToqCnA+55eNwCORaxlKyu+rNfX86o8OXRUSNUnrtsAZXM9sg== - dependencies: - "@babel/helper-environment-visitor" "^7.24.7" - "@babel/helper-member-expression-to-functions" "^7.24.7" - "@babel/helper-optimise-call-expression" "^7.24.7" - -"@babel/helper-simple-access@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz#bcade8da3aec8ed16b9c4953b74e506b51b5edb3" - integrity sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg== - dependencies: - "@babel/traverse" "^7.24.7" - "@babel/types" "^7.24.7" - -"@babel/helper-skip-transparent-expression-wrappers@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.24.7.tgz#5f8fa83b69ed5c27adc56044f8be2b3ea96669d9" - integrity sha512-IO+DLT3LQUElMbpzlatRASEyQtfhSE0+m465v++3jyyXeBTBUjtVZg28/gHeV5mrTJqvEKhKroBGAvhW+qPHiQ== - dependencies: - "@babel/traverse" "^7.24.7" - "@babel/types" "^7.24.7" - -"@babel/helper-split-export-declaration@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz#83949436890e07fa3d6873c61a96e3bbf692d856" - integrity sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA== - dependencies: - "@babel/types" "^7.24.7" - -"@babel/helper-string-parser@^7.24.8": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz#5b3329c9a58803d5df425e5785865881a81ca48d" - integrity sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ== - -"@babel/helper-validator-identifier@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz#75b889cfaf9e35c2aaf42cf0d72c8e91719251db" - integrity sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w== - -"@babel/helper-validator-option@^7.24.8": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz#3725cdeea8b480e86d34df15304806a06975e33d" - integrity sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q== - -"@babel/helper-wrap-function@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.24.7.tgz#52d893af7e42edca7c6d2c6764549826336aae1f" - integrity sha512-N9JIYk3TD+1vq/wn77YnJOqMtfWhNewNE+DJV4puD2X7Ew9J4JvrzrFDfTfyv5EgEXVy9/Wt8QiOErzEmv5Ifw== - dependencies: - "@babel/helper-function-name" "^7.24.7" - "@babel/template" "^7.24.7" - "@babel/traverse" "^7.24.7" - "@babel/types" "^7.24.7" - -"@babel/helpers@^7.24.8": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.24.8.tgz#2820d64d5d6686cca8789dd15b074cd862795873" - integrity sha512-gV2265Nkcz7weJJfvDoAEVzC1e2OTDpkGbEsebse8koXUJUXPsCMi7sRo/+SPMuMZ9MtUPnGwITTnQnU5YjyaQ== - dependencies: - "@babel/template" "^7.24.7" - "@babel/types" "^7.24.8" - -"@babel/highlight@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.7.tgz#a05ab1df134b286558aae0ed41e6c5f731bf409d" - integrity sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw== - dependencies: - "@babel/helper-validator-identifier" "^7.24.7" - chalk "^2.4.2" - js-tokens "^4.0.0" - picocolors "^1.0.0" - -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.24.7", "@babel/parser@^7.24.8": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.8.tgz#58a4dbbcad7eb1d48930524a3fd93d93e9084c6f" - integrity sha512-WzfbgXOkGzZiXXCqk43kKwZjzwx4oulxZi3nq2TYL9mOjQv6kYwul9mz6ID36njuL7Xkp6nJEfok848Zj10j/w== - -"@babel/plugin-bugfix-firefox-class-in-computed-class-key@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.24.7.tgz#fd059fd27b184ea2b4c7e646868a9a381bbc3055" - integrity sha512-TiT1ss81W80eQsN+722OaeQMY/G4yTb4G9JrqeiDADs3N8lbPMGldWi9x8tyqCW5NLx1Jh2AvkE6r6QvEltMMQ== - dependencies: - "@babel/helper-environment-visitor" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.24.7.tgz#468096ca44bbcbe8fcc570574e12eb1950e18107" - integrity sha512-unaQgZ/iRu/By6tsjMZzpeBZjChYfLYry6HrEXPoz3KmfF0sVBQ1l8zKMQ4xRGLWVsjuvB8nQfjNP/DcfEOCsg== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.24.7.tgz#e4eabdd5109acc399b38d7999b2ef66fc2022f89" - integrity sha512-+izXIbke1T33mY4MSNnrqhPXDz01WYhEf3yF5NbnUtkiNnm+XBZJl3kNfoK6NKmYlz/D07+l2GWVK/QfDkNCuQ== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - "@babel/helper-skip-transparent-expression-wrappers" "^7.24.7" - "@babel/plugin-transform-optional-chaining" "^7.24.7" - -"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.24.7.tgz#71b21bb0286d5810e63a1538aa901c58e87375ec" - integrity sha512-utA4HuR6F4Vvcr+o4DnjL8fCOlgRFGbeeBEGNg3ZTrLFw6VWG5XmUrvcQ0FjIYMU2ST4XcR2Wsp7t9qOAPnxMg== - dependencies: - "@babel/helper-environment-visitor" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2": - version "7.21.0-placeholder-for-preset-env.2" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz" - integrity sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w== - -"@babel/plugin-syntax-async-generators@^7.8.4": - version "7.8.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz" - integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-bigint@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz" - integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-class-properties@^7.12.13", "@babel/plugin-syntax-class-properties@^7.8.3": - version "7.12.13" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz" - integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/plugin-syntax-class-static-block@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz" - integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-dynamic-import@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz" - integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-export-namespace-from@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz" - integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q== - dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - -"@babel/plugin-syntax-import-assertions@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.24.7.tgz#2a0b406b5871a20a841240586b1300ce2088a778" - integrity sha512-Ec3NRUMoi8gskrkBe3fNmEQfxDvY8bgfQpz6jlk/41kX9eUjvpyqWU7PBP/pLAvMaSQjbMNKJmvX57jP+M6bPg== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-syntax-import-attributes@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.24.7.tgz#b4f9ea95a79e6912480c4b626739f86a076624ca" - integrity sha512-hbX+lKKeUMGihnK8nvKqmXBInriT3GVjzXKFriV3YC6APGxMbP8RZNFwy91+hocLXq90Mta+HshoB31802bb8A== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-syntax-import-meta@^7.10.4", "@babel/plugin-syntax-import-meta@^7.8.3": - version "7.10.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz" - integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-json-strings@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz" - integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-jsx@^7.7.2": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz" - integrity sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-syntax-logical-assignment-operators@^7.10.4", "@babel/plugin-syntax-logical-assignment-operators@^7.8.3": - version "7.10.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz" - integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz" - integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-numeric-separator@^7.10.4", "@babel/plugin-syntax-numeric-separator@^7.8.3": - version "7.10.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz" - integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-object-rest-spread@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz" - integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-catch-binding@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz" - integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-chaining@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz" - integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-private-property-in-object@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz" - integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-top-level-await@^7.14.5", "@babel/plugin-syntax-top-level-await@^7.8.3": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz" - integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-typescript@^7.7.2": - version "7.23.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz" - integrity sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-syntax-unicode-sets-regex@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz" - integrity sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-arrow-functions@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.24.7.tgz#4f6886c11e423bd69f3ce51dbf42424a5f275514" - integrity sha512-Dt9LQs6iEY++gXUwY03DNFat5C2NbO48jj+j/bSAz6b3HgPs39qcPiYt77fDObIcFwj3/C2ICX9YMwGflUoSHQ== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-async-generator-functions@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.24.7.tgz#7330a5c50e05181ca52351b8fd01642000c96cfd" - integrity sha512-o+iF77e3u7ZS4AoAuJvapz9Fm001PuD2V3Lp6OSE4FYQke+cSewYtnek+THqGRWyQloRCyvWL1OkyfNEl9vr/g== - dependencies: - "@babel/helper-environment-visitor" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.7" - "@babel/helper-remap-async-to-generator" "^7.24.7" - "@babel/plugin-syntax-async-generators" "^7.8.4" - -"@babel/plugin-transform-async-to-generator@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.24.7.tgz#72a3af6c451d575842a7e9b5a02863414355bdcc" - integrity sha512-SQY01PcJfmQ+4Ash7NE+rpbLFbmqA2GPIgqzxfFTL4t1FKRq4zTms/7htKpoCUI9OcFYgzqfmCdH53s6/jn5fA== - dependencies: - "@babel/helper-module-imports" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.7" - "@babel/helper-remap-async-to-generator" "^7.24.7" - -"@babel/plugin-transform-block-scoped-functions@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.24.7.tgz#a4251d98ea0c0f399dafe1a35801eaba455bbf1f" - integrity sha512-yO7RAz6EsVQDaBH18IDJcMB1HnrUn2FJ/Jslc/WtPPWcjhpUJXU/rjbwmluzp7v/ZzWcEhTMXELnnsz8djWDwQ== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-block-scoping@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.24.7.tgz#42063e4deb850c7bd7c55e626bf4e7ab48e6ce02" - integrity sha512-Nd5CvgMbWc+oWzBsuaMcbwjJWAcp5qzrbg69SZdHSP7AMY0AbWFqFO0WTFCA1jxhMCwodRwvRec8k0QUbZk7RQ== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-class-properties@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.24.7.tgz#256879467b57b0b68c7ddfc5b76584f398cd6834" - integrity sha512-vKbfawVYayKcSeSR5YYzzyXvsDFWU2mD8U5TFeXtbCPLFUqe7GyCgvO6XDHzje862ODrOwy6WCPmKeWHbCFJ4w== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-class-static-block@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.24.7.tgz#c82027ebb7010bc33c116d4b5044fbbf8c05484d" - integrity sha512-HMXK3WbBPpZQufbMG4B46A90PkuuhN9vBCb5T8+VAHqvAqvcLi+2cKoukcpmUYkszLhScU3l1iudhrks3DggRQ== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.7" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - -"@babel/plugin-transform-classes@^7.24.8": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.24.8.tgz#ad23301fe5bc153ca4cf7fb572a9bc8b0b711cf7" - integrity sha512-VXy91c47uujj758ud9wx+OMgheXm4qJfyhj1P18YvlrQkNOSrwsteHk+EFS3OMGfhMhpZa0A+81eE7G4QC+3CA== - dependencies: - "@babel/helper-annotate-as-pure" "^7.24.7" - "@babel/helper-compilation-targets" "^7.24.8" - "@babel/helper-environment-visitor" "^7.24.7" - "@babel/helper-function-name" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.8" - "@babel/helper-replace-supers" "^7.24.7" - "@babel/helper-split-export-declaration" "^7.24.7" - globals "^11.1.0" - -"@babel/plugin-transform-computed-properties@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.24.7.tgz#4cab3214e80bc71fae3853238d13d097b004c707" - integrity sha512-25cS7v+707Gu6Ds2oY6tCkUwsJ9YIDbggd9+cu9jzzDgiNq7hR/8dkzxWfKWnTic26vsI3EsCXNd4iEB6e8esQ== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - "@babel/template" "^7.24.7" - -"@babel/plugin-transform-destructuring@^7.24.8": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.24.8.tgz#c828e814dbe42a2718a838c2a2e16a408e055550" - integrity sha512-36e87mfY8TnRxc7yc6M9g9gOB7rKgSahqkIKwLpz4Ppk2+zC2Cy1is0uwtuSG6AE4zlTOUa+7JGz9jCJGLqQFQ== - dependencies: - "@babel/helper-plugin-utils" "^7.24.8" - -"@babel/plugin-transform-dotall-regex@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.24.7.tgz#5f8bf8a680f2116a7207e16288a5f974ad47a7a0" - integrity sha512-ZOA3W+1RRTSWvyqcMJDLqbchh7U4NRGqwRfFSVbOLS/ePIP4vHB5e8T8eXcuqyN1QkgKyj5wuW0lcS85v4CrSw== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-duplicate-keys@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.24.7.tgz#dd20102897c9a2324e5adfffb67ff3610359a8ee" - integrity sha512-JdYfXyCRihAe46jUIliuL2/s0x0wObgwwiGxw/UbgJBr20gQBThrokO4nYKgWkD7uBaqM7+9x5TU7NkExZJyzw== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-dynamic-import@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.24.7.tgz#4d8b95e3bae2b037673091aa09cd33fecd6419f4" - integrity sha512-sc3X26PhZQDb3JhORmakcbvkeInvxz+A8oda99lj7J60QRuPZvNAk9wQlTBS1ZynelDrDmTU4pw1tyc5d5ZMUg== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - -"@babel/plugin-transform-exponentiation-operator@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.24.7.tgz#b629ee22645f412024297d5245bce425c31f9b0d" - integrity sha512-Rqe/vSc9OYgDajNIK35u7ot+KeCoetqQYFXM4Epf7M7ez3lWlOjrDjrwMei6caCVhfdw+mIKD4cgdGNy5JQotQ== - dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-export-namespace-from@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.24.7.tgz#176d52d8d8ed516aeae7013ee9556d540c53f197" - integrity sha512-v0K9uNYsPL3oXZ/7F9NNIbAj2jv1whUEtyA6aujhekLs56R++JDQuzRcP2/z4WX5Vg/c5lE9uWZA0/iUoFhLTA== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - -"@babel/plugin-transform-for-of@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.24.7.tgz#f25b33f72df1d8be76399e1b8f3f9d366eb5bc70" - integrity sha512-wo9ogrDG1ITTTBsy46oGiN1dS9A7MROBTcYsfS8DtsImMkHk9JXJ3EWQM6X2SUw4x80uGPlwj0o00Uoc6nEE3g== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - "@babel/helper-skip-transparent-expression-wrappers" "^7.24.7" - -"@babel/plugin-transform-function-name@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.24.7.tgz#6d8601fbffe665c894440ab4470bc721dd9131d6" - integrity sha512-U9FcnA821YoILngSmYkW6FjyQe2TyZD5pHt4EVIhmcTkrJw/3KqcrRSxuOo5tFZJi7TE19iDyI1u+weTI7bn2w== - dependencies: - "@babel/helper-compilation-targets" "^7.24.7" - "@babel/helper-function-name" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-json-strings@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.24.7.tgz#f3e9c37c0a373fee86e36880d45b3664cedaf73a" - integrity sha512-2yFnBGDvRuxAaE/f0vfBKvtnvvqU8tGpMHqMNpTN2oWMKIR3NqFkjaAgGwawhqK/pIN2T3XdjGPdaG0vDhOBGw== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - "@babel/plugin-syntax-json-strings" "^7.8.3" - -"@babel/plugin-transform-literals@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.24.7.tgz#36b505c1e655151a9d7607799a9988fc5467d06c" - integrity sha512-vcwCbb4HDH+hWi8Pqenwnjy+UiklO4Kt1vfspcQYFhJdpthSnW8XvWGyDZWKNVrVbVViI/S7K9PDJZiUmP2fYQ== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-logical-assignment-operators@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.24.7.tgz#a58fb6eda16c9dc8f9ff1c7b1ba6deb7f4694cb0" - integrity sha512-4D2tpwlQ1odXmTEIFWy9ELJcZHqrStlzK/dAOWYyxX3zT0iXQB6banjgeOJQXzEc4S0E0a5A+hahxPaEFYftsw== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - -"@babel/plugin-transform-member-expression-literals@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.24.7.tgz#3b4454fb0e302e18ba4945ba3246acb1248315df" - integrity sha512-T/hRC1uqrzXMKLQ6UCwMT85S3EvqaBXDGf0FaMf4446Qx9vKwlghvee0+uuZcDUCZU5RuNi4781UQ7R308zzBw== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-modules-amd@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.24.7.tgz#65090ed493c4a834976a3ca1cde776e6ccff32d7" - integrity sha512-9+pB1qxV3vs/8Hdmz/CulFB8w2tuu6EB94JZFsjdqxQokwGa9Unap7Bo2gGBGIvPmDIVvQrom7r5m/TCDMURhg== - dependencies: - "@babel/helper-module-transforms" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-modules-commonjs@^7.24.8": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.8.tgz#ab6421e564b717cb475d6fff70ae7f103536ea3c" - integrity sha512-WHsk9H8XxRs3JXKWFiqtQebdh9b/pTk4EgueygFzYlTKAg0Ud985mSevdNjdXdFBATSKVJGQXP1tv6aGbssLKA== - dependencies: - "@babel/helper-module-transforms" "^7.24.8" - "@babel/helper-plugin-utils" "^7.24.8" - "@babel/helper-simple-access" "^7.24.7" - -"@babel/plugin-transform-modules-systemjs@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.24.7.tgz#f8012316c5098f6e8dee6ecd58e2bc6f003d0ce7" - integrity sha512-GYQE0tW7YoaN13qFh3O1NCY4MPkUiAH3fiF7UcV/I3ajmDKEdG3l+UOcbAm4zUE3gnvUU+Eni7XrVKo9eO9auw== - dependencies: - "@babel/helper-hoist-variables" "^7.24.7" - "@babel/helper-module-transforms" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.7" - "@babel/helper-validator-identifier" "^7.24.7" - -"@babel/plugin-transform-modules-umd@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.24.7.tgz#edd9f43ec549099620df7df24e7ba13b5c76efc8" - integrity sha512-3aytQvqJ/h9z4g8AsKPLvD4Zqi2qT+L3j7XoFFu1XBlZWEl2/1kWnhmAbxpLgPrHSY0M6UA02jyTiwUVtiKR6A== - dependencies: - "@babel/helper-module-transforms" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-named-capturing-groups-regex@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.24.7.tgz#9042e9b856bc6b3688c0c2e4060e9e10b1460923" - integrity sha512-/jr7h/EWeJtk1U/uz2jlsCioHkZk1JJZVcc8oQsJ1dUlaJD83f4/6Zeh2aHt9BIFokHIsSeDfhUmju0+1GPd6g== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-new-target@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.24.7.tgz#31ff54c4e0555cc549d5816e4ab39241dfb6ab00" - integrity sha512-RNKwfRIXg4Ls/8mMTza5oPF5RkOW8Wy/WgMAp1/F1yZ8mMbtwXW+HDoJiOsagWrAhI5f57Vncrmr9XeT4CVapA== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-nullish-coalescing-operator@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.24.7.tgz#1de4534c590af9596f53d67f52a92f12db984120" - integrity sha512-Ts7xQVk1OEocqzm8rHMXHlxvsfZ0cEF2yomUqpKENHWMF4zKk175Y4q8H5knJes6PgYad50uuRmt3UJuhBw8pQ== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - -"@babel/plugin-transform-numeric-separator@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.24.7.tgz#bea62b538c80605d8a0fac9b40f48e97efa7de63" - integrity sha512-e6q1TiVUzvH9KRvicuxdBTUj4AdKSRwzIyFFnfnezpCfP2/7Qmbb8qbU2j7GODbl4JMkblitCQjKYUaX/qkkwA== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - -"@babel/plugin-transform-object-rest-spread@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.24.7.tgz#d13a2b93435aeb8a197e115221cab266ba6e55d6" - integrity sha512-4QrHAr0aXQCEFni2q4DqKLD31n2DL+RxcwnNjDFkSG0eNQ/xCavnRkfCUjsyqGC2OviNJvZOF/mQqZBw7i2C5Q== - dependencies: - "@babel/helper-compilation-targets" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.7" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.24.7" - -"@babel/plugin-transform-object-super@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.24.7.tgz#66eeaff7830bba945dd8989b632a40c04ed625be" - integrity sha512-A/vVLwN6lBrMFmMDmPPz0jnE6ZGx7Jq7d6sT/Ev4H65RER6pZ+kczlf1DthF5N0qaPHBsI7UXiE8Zy66nmAovg== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - "@babel/helper-replace-supers" "^7.24.7" - -"@babel/plugin-transform-optional-catch-binding@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.24.7.tgz#00eabd883d0dd6a60c1c557548785919b6e717b4" - integrity sha512-uLEndKqP5BfBbC/5jTwPxLh9kqPWWgzN/f8w6UwAIirAEqiIVJWWY312X72Eub09g5KF9+Zn7+hT7sDxmhRuKA== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - -"@babel/plugin-transform-optional-chaining@^7.24.7", "@babel/plugin-transform-optional-chaining@^7.24.8": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.24.8.tgz#bb02a67b60ff0406085c13d104c99a835cdf365d" - integrity sha512-5cTOLSMs9eypEy8JUVvIKOu6NgvbJMnpG62VpIHrTmROdQ+L5mDAaI40g25k5vXti55JWNX5jCkq3HZxXBQANw== - dependencies: - "@babel/helper-plugin-utils" "^7.24.8" - "@babel/helper-skip-transparent-expression-wrappers" "^7.24.7" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - -"@babel/plugin-transform-parameters@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.24.7.tgz#5881f0ae21018400e320fc7eb817e529d1254b68" - integrity sha512-yGWW5Rr+sQOhK0Ot8hjDJuxU3XLRQGflvT4lhlSY0DFvdb3TwKaY26CJzHtYllU0vT9j58hc37ndFPsqT1SrzA== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-private-methods@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.24.7.tgz#e6318746b2ae70a59d023d5cc1344a2ba7a75f5e" - integrity sha512-COTCOkG2hn4JKGEKBADkA8WNb35TGkkRbI5iT845dB+NyqgO8Hn+ajPbSnIQznneJTa3d30scb6iz/DhH8GsJQ== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-private-property-in-object@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.24.7.tgz#4eec6bc701288c1fab5f72e6a4bbc9d67faca061" - integrity sha512-9z76mxwnwFxMyxZWEgdgECQglF2Q7cFLm0kMf8pGwt+GSJsY0cONKj/UuO4bOH0w/uAel3ekS4ra5CEAyJRmDA== - dependencies: - "@babel/helper-annotate-as-pure" "^7.24.7" - "@babel/helper-create-class-features-plugin" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.7" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - -"@babel/plugin-transform-property-literals@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.24.7.tgz#f0d2ed8380dfbed949c42d4d790266525d63bbdc" - integrity sha512-EMi4MLQSHfd2nrCqQEWxFdha2gBCqU4ZcCng4WBGZ5CJL4bBRW0ptdqqDdeirGZcpALazVVNJqRmsO8/+oNCBA== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-regenerator@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.24.7.tgz#021562de4534d8b4b1851759fd7af4e05d2c47f8" - integrity sha512-lq3fvXPdimDrlg6LWBoqj+r/DEWgONuwjuOuQCSYgRroXDH/IdM1C0IZf59fL5cHLpjEH/O6opIRBbqv7ELnuA== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - regenerator-transform "^0.15.2" - -"@babel/plugin-transform-reserved-words@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.24.7.tgz#80037fe4fbf031fc1125022178ff3938bb3743a4" - integrity sha512-0DUq0pHcPKbjFZCfTss/pGkYMfy3vFWydkUBd9r0GHpIyfs2eCDENvqadMycRS9wZCXR41wucAfJHJmwA0UmoQ== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-shorthand-properties@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.24.7.tgz#85448c6b996e122fa9e289746140aaa99da64e73" - integrity sha512-KsDsevZMDsigzbA09+vacnLpmPH4aWjcZjXdyFKGzpplxhbeB4wYtury3vglQkg6KM/xEPKt73eCjPPf1PgXBA== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-spread@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.24.7.tgz#e8a38c0fde7882e0fb8f160378f74bd885cc7bb3" - integrity sha512-x96oO0I09dgMDxJaANcRyD4ellXFLLiWhuwDxKZX5g2rWP1bTPkBSwCYv96VDXVT1bD9aPj8tppr5ITIh8hBng== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - "@babel/helper-skip-transparent-expression-wrappers" "^7.24.7" - -"@babel/plugin-transform-sticky-regex@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.24.7.tgz#96ae80d7a7e5251f657b5cf18f1ea6bf926f5feb" - integrity sha512-kHPSIJc9v24zEml5geKg9Mjx5ULpfncj0wRpYtxbvKyTtHCYDkVE3aHQ03FrpEo4gEe2vrJJS1Y9CJTaThA52g== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-template-literals@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.24.7.tgz#a05debb4a9072ae8f985bcf77f3f215434c8f8c8" - integrity sha512-AfDTQmClklHCOLxtGoP7HkeMw56k1/bTQjwsfhL6pppo/M4TOBSq+jjBUBLmV/4oeFg4GWMavIl44ZeCtmmZTw== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-typeof-symbol@^7.24.8": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.24.8.tgz#383dab37fb073f5bfe6e60c654caac309f92ba1c" - integrity sha512-adNTUpDCVnmAE58VEqKlAA6ZBlNkMnWD0ZcW76lyNFN3MJniyGFZfNwERVk8Ap56MCnXztmDr19T4mPTztcuaw== - dependencies: - "@babel/helper-plugin-utils" "^7.24.8" - -"@babel/plugin-transform-unicode-escapes@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.24.7.tgz#2023a82ced1fb4971630a2e079764502c4148e0e" - integrity sha512-U3ap1gm5+4edc2Q/P+9VrBNhGkfnf+8ZqppY71Bo/pzZmXhhLdqgaUl6cuB07O1+AQJtCLfaOmswiNbSQ9ivhw== - dependencies: - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-unicode-property-regex@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.24.7.tgz#9073a4cd13b86ea71c3264659590ac086605bbcd" - integrity sha512-uH2O4OV5M9FZYQrwc7NdVmMxQJOCCzFeYudlZSzUAHRFeOujQefa92E74TQDVskNHCzOXoigEuoyzHDhaEaK5w== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-unicode-regex@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.24.7.tgz#dfc3d4a51127108099b19817c0963be6a2adf19f" - integrity sha512-hlQ96MBZSAXUq7ltkjtu3FJCCSMx/j629ns3hA3pXnBXjanNP0LHi+JpPeA81zaWgVK1VGH95Xuy7u0RyQ8kMg== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/plugin-transform-unicode-sets-regex@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.24.7.tgz#d40705d67523803a576e29c63cef6e516b858ed9" - integrity sha512-2G8aAvF4wy1w/AGZkemprdGMRg5o6zPNhbHVImRz3lss55TYCBd6xStN19rt8XJHq20sqV0JbyWjOWwQRwV/wg== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.24.7" - "@babel/helper-plugin-utils" "^7.24.7" - -"@babel/preset-env@^7.24.8": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.24.8.tgz#e0db94d7f17d6f0e2564e8d29190bc8cdacec2d1" - integrity sha512-vObvMZB6hNWuDxhSaEPTKCwcqkAIuDtE+bQGn4XMXne1DSLzFVY8Vmj1bm+mUQXYNN8NmaQEO+r8MMbzPr1jBQ== - dependencies: - "@babel/compat-data" "^7.24.8" - "@babel/helper-compilation-targets" "^7.24.8" - "@babel/helper-plugin-utils" "^7.24.8" - "@babel/helper-validator-option" "^7.24.8" - "@babel/plugin-bugfix-firefox-class-in-computed-class-key" "^7.24.7" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.24.7" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.24.7" - "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly" "^7.24.7" - "@babel/plugin-proposal-private-property-in-object" "7.21.0-placeholder-for-preset-env.2" - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-class-properties" "^7.12.13" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-import-assertions" "^7.24.7" - "@babel/plugin-syntax-import-attributes" "^7.24.7" - "@babel/plugin-syntax-import-meta" "^7.10.4" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - "@babel/plugin-syntax-top-level-await" "^7.14.5" - "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" - "@babel/plugin-transform-arrow-functions" "^7.24.7" - "@babel/plugin-transform-async-generator-functions" "^7.24.7" - "@babel/plugin-transform-async-to-generator" "^7.24.7" - "@babel/plugin-transform-block-scoped-functions" "^7.24.7" - "@babel/plugin-transform-block-scoping" "^7.24.7" - "@babel/plugin-transform-class-properties" "^7.24.7" - "@babel/plugin-transform-class-static-block" "^7.24.7" - "@babel/plugin-transform-classes" "^7.24.8" - "@babel/plugin-transform-computed-properties" "^7.24.7" - "@babel/plugin-transform-destructuring" "^7.24.8" - "@babel/plugin-transform-dotall-regex" "^7.24.7" - "@babel/plugin-transform-duplicate-keys" "^7.24.7" - "@babel/plugin-transform-dynamic-import" "^7.24.7" - "@babel/plugin-transform-exponentiation-operator" "^7.24.7" - "@babel/plugin-transform-export-namespace-from" "^7.24.7" - "@babel/plugin-transform-for-of" "^7.24.7" - "@babel/plugin-transform-function-name" "^7.24.7" - "@babel/plugin-transform-json-strings" "^7.24.7" - "@babel/plugin-transform-literals" "^7.24.7" - "@babel/plugin-transform-logical-assignment-operators" "^7.24.7" - "@babel/plugin-transform-member-expression-literals" "^7.24.7" - "@babel/plugin-transform-modules-amd" "^7.24.7" - "@babel/plugin-transform-modules-commonjs" "^7.24.8" - "@babel/plugin-transform-modules-systemjs" "^7.24.7" - "@babel/plugin-transform-modules-umd" "^7.24.7" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.24.7" - "@babel/plugin-transform-new-target" "^7.24.7" - "@babel/plugin-transform-nullish-coalescing-operator" "^7.24.7" - "@babel/plugin-transform-numeric-separator" "^7.24.7" - "@babel/plugin-transform-object-rest-spread" "^7.24.7" - "@babel/plugin-transform-object-super" "^7.24.7" - "@babel/plugin-transform-optional-catch-binding" "^7.24.7" - "@babel/plugin-transform-optional-chaining" "^7.24.8" - "@babel/plugin-transform-parameters" "^7.24.7" - "@babel/plugin-transform-private-methods" "^7.24.7" - "@babel/plugin-transform-private-property-in-object" "^7.24.7" - "@babel/plugin-transform-property-literals" "^7.24.7" - "@babel/plugin-transform-regenerator" "^7.24.7" - "@babel/plugin-transform-reserved-words" "^7.24.7" - "@babel/plugin-transform-shorthand-properties" "^7.24.7" - "@babel/plugin-transform-spread" "^7.24.7" - "@babel/plugin-transform-sticky-regex" "^7.24.7" - "@babel/plugin-transform-template-literals" "^7.24.7" - "@babel/plugin-transform-typeof-symbol" "^7.24.8" - "@babel/plugin-transform-unicode-escapes" "^7.24.7" - "@babel/plugin-transform-unicode-property-regex" "^7.24.7" - "@babel/plugin-transform-unicode-regex" "^7.24.7" - "@babel/plugin-transform-unicode-sets-regex" "^7.24.7" - "@babel/preset-modules" "0.1.6-no-external-plugins" - babel-plugin-polyfill-corejs2 "^0.4.10" - babel-plugin-polyfill-corejs3 "^0.10.4" - babel-plugin-polyfill-regenerator "^0.6.1" - core-js-compat "^3.37.1" - semver "^6.3.1" - -"@babel/preset-modules@0.1.6-no-external-plugins": - version "0.1.6-no-external-plugins" - resolved "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz" - integrity sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/types" "^7.4.4" - esutils "^2.0.2" - -"@babel/regjsgen@^0.8.0": - version "0.8.0" - resolved "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz" - integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== - -"@babel/runtime@^7.8.4": - version "7.23.5" - resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.5.tgz" - integrity sha512-NdUTHcPe4C99WxPub+K9l9tK5/lV4UXIoaHSYgzco9BCyjKAAwzdBI+wWtYqHt7LJdbo74ZjRPJgzVweq1sz0w== - dependencies: - regenerator-runtime "^0.14.0" - -"@babel/template@^7.24.7", "@babel/template@^7.3.3": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.24.7.tgz#02efcee317d0609d2c07117cb70ef8fb17ab7315" - integrity sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig== - dependencies: - "@babel/code-frame" "^7.24.7" - "@babel/parser" "^7.24.7" - "@babel/types" "^7.24.7" - -"@babel/traverse@^7.24.7", "@babel/traverse@^7.24.8": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.24.8.tgz#6c14ed5232b7549df3371d820fbd9abfcd7dfab7" - integrity sha512-t0P1xxAPzEDcEPmjprAQq19NWum4K0EQPjMwZQZbHt+GiZqvjCHjj755Weq1YRPVzBI+3zSfvScfpnuIecVFJQ== - dependencies: - "@babel/code-frame" "^7.24.7" - "@babel/generator" "^7.24.8" - "@babel/helper-environment-visitor" "^7.24.7" - "@babel/helper-function-name" "^7.24.7" - "@babel/helper-hoist-variables" "^7.24.7" - "@babel/helper-split-export-declaration" "^7.24.7" - "@babel/parser" "^7.24.8" - "@babel/types" "^7.24.8" - debug "^4.3.1" - globals "^11.1.0" - -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.24.7", "@babel/types@^7.24.8", "@babel/types@^7.24.9", "@babel/types@^7.3.3", "@babel/types@^7.4.4": - version "7.24.9" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.9.tgz#228ce953d7b0d16646e755acf204f4cf3d08cc73" - integrity sha512-xm8XrMKz0IlUdocVbYJe0Z9xEgidU7msskG8BbhnTPK/HZ2z/7FP7ykqPgrUH+C+r414mNfNWam1f2vqOjqjYQ== - dependencies: - "@babel/helper-string-parser" "^7.24.8" - "@babel/helper-validator-identifier" "^7.24.7" - to-fast-properties "^2.0.0" - -"@bcoe/v8-coverage@^0.2.3": - version "0.2.3" - resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz" - integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== - -"@ctrl/tinycolor@^4.0.2": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@ctrl/tinycolor/-/tinycolor-4.0.3.tgz#c56d96ef0d7be598cf68d1ab53f990849a79f5b4" - integrity sha512-e9nEVehVJwkymQpkGhdSNzLT2Lr9UTTby+JePq4Z2SxBbOQjY7pLgSouAaXvfaGQVSAaY0U4eJdwfSDmCbItcw== - -"@eslint-community/eslint-utils@^4.2.0": - version "4.4.0" - resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" - integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== - dependencies: - eslint-visitor-keys "^3.3.0" - -"@eslint-community/regexpp@^4.6.1": - version "4.10.0" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63" - integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== - -"@eslint/eslintrc@^2.1.4": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz#388a269f0f25c1b6adc317b5a2c55714894c70ad" - integrity sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ== - dependencies: - ajv "^6.12.4" - debug "^4.3.2" - espree "^9.6.0" - globals "^13.19.0" - ignore "^5.2.0" - import-fresh "^3.2.1" - js-yaml "^4.1.0" - minimatch "^3.1.2" - strip-json-comments "^3.1.1" - -"@eslint/js@8.57.0": - version "8.57.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f" - integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g== - -"@floating-ui/core@^1.0.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.6.0.tgz#fa41b87812a16bf123122bf945946bae3fdf7fc1" - integrity sha512-PcF++MykgmTj3CIyOQbKA/hDzOAiqI3mhuoN44WRCopIs1sgoDoU4oty4Jtqaj/y3oDU6fnVSm4QG0a3t5i0+g== - dependencies: - "@floating-ui/utils" "^0.2.1" - -"@floating-ui/dom@^1.5.3": - version "1.6.3" - resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.6.3.tgz#954e46c1dd3ad48e49db9ada7218b0985cee75ef" - integrity sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw== - dependencies: - "@floating-ui/core" "^1.0.0" - "@floating-ui/utils" "^0.2.0" - -"@floating-ui/utils@^0.2.0", "@floating-ui/utils@^0.2.1": - version "0.2.1" - resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.1.tgz#16308cea045f0fc777b6ff20a9f25474dd8293d2" - integrity sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q== - -"@humanwhocodes/config-array@^0.11.14": - version "0.11.14" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b" - integrity sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg== - dependencies: - "@humanwhocodes/object-schema" "^2.0.2" - debug "^4.3.1" - minimatch "^3.0.5" - -"@humanwhocodes/module-importer@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" - integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== - -"@humanwhocodes/object-schema@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz#d9fae00a2d5cb40f92cfe64b47ad749fbc38f917" - integrity sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw== - -"@istanbuljs/load-nyc-config@^1.0.0": - version "1.1.0" - resolved "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz" - integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== - dependencies: - camelcase "^5.3.1" - find-up "^4.1.0" - get-package-type "^0.1.0" - js-yaml "^3.13.1" - resolve-from "^5.0.0" - -"@istanbuljs/schema@^0.1.2": - version "0.1.3" - resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz" - integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== - -"@jest/console@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz" - integrity sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg== - dependencies: - "@jest/types" "^29.6.3" - "@types/node" "*" - chalk "^4.0.0" - jest-message-util "^29.7.0" - jest-util "^29.7.0" - slash "^3.0.0" - -"@jest/core@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz" - integrity sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg== - dependencies: - "@jest/console" "^29.7.0" - "@jest/reporters" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - ansi-escapes "^4.2.1" - chalk "^4.0.0" - ci-info "^3.2.0" - exit "^0.1.2" - graceful-fs "^4.2.9" - jest-changed-files "^29.7.0" - jest-config "^29.7.0" - jest-haste-map "^29.7.0" - jest-message-util "^29.7.0" - jest-regex-util "^29.6.3" - jest-resolve "^29.7.0" - jest-resolve-dependencies "^29.7.0" - jest-runner "^29.7.0" - jest-runtime "^29.7.0" - jest-snapshot "^29.7.0" - jest-util "^29.7.0" - jest-validate "^29.7.0" - jest-watcher "^29.7.0" - micromatch "^4.0.4" - pretty-format "^29.7.0" - slash "^3.0.0" - strip-ansi "^6.0.0" - -"@jest/environment@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz" - integrity sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw== - dependencies: - "@jest/fake-timers" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - jest-mock "^29.7.0" - -"@jest/expect-utils@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz" - integrity sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA== - dependencies: - jest-get-type "^29.6.3" - -"@jest/expect@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz" - integrity sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ== - dependencies: - expect "^29.7.0" - jest-snapshot "^29.7.0" - -"@jest/fake-timers@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz" - integrity sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ== - dependencies: - "@jest/types" "^29.6.3" - "@sinonjs/fake-timers" "^10.0.2" - "@types/node" "*" - jest-message-util "^29.7.0" - jest-mock "^29.7.0" - jest-util "^29.7.0" - -"@jest/globals@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz" - integrity sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ== - dependencies: - "@jest/environment" "^29.7.0" - "@jest/expect" "^29.7.0" - "@jest/types" "^29.6.3" - jest-mock "^29.7.0" - -"@jest/reporters@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz" - integrity sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg== - dependencies: - "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" - "@jridgewell/trace-mapping" "^0.3.18" - "@types/node" "*" - chalk "^4.0.0" - collect-v8-coverage "^1.0.0" - exit "^0.1.2" - glob "^7.1.3" - graceful-fs "^4.2.9" - istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^6.0.0" - istanbul-lib-report "^3.0.0" - istanbul-lib-source-maps "^4.0.0" - istanbul-reports "^3.1.3" - jest-message-util "^29.7.0" - jest-util "^29.7.0" - jest-worker "^29.7.0" - slash "^3.0.0" - string-length "^4.0.1" - strip-ansi "^6.0.0" - v8-to-istanbul "^9.0.1" - -"@jest/schemas@^29.6.3": - version "29.6.3" - resolved "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz" - integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== - dependencies: - "@sinclair/typebox" "^0.27.8" - -"@jest/source-map@^29.6.3": - version "29.6.3" - resolved "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz" - integrity sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw== - dependencies: - "@jridgewell/trace-mapping" "^0.3.18" - callsites "^3.0.0" - graceful-fs "^4.2.9" - -"@jest/test-result@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz" - integrity sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA== - dependencies: - "@jest/console" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/istanbul-lib-coverage" "^2.0.0" - collect-v8-coverage "^1.0.0" - -"@jest/test-sequencer@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz" - integrity sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw== - dependencies: - "@jest/test-result" "^29.7.0" - graceful-fs "^4.2.9" - jest-haste-map "^29.7.0" - slash "^3.0.0" - -"@jest/transform@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz" - integrity sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw== - dependencies: - "@babel/core" "^7.11.6" - "@jest/types" "^29.6.3" - "@jridgewell/trace-mapping" "^0.3.18" - babel-plugin-istanbul "^6.1.1" - chalk "^4.0.0" - convert-source-map "^2.0.0" - fast-json-stable-stringify "^2.1.0" - graceful-fs "^4.2.9" - jest-haste-map "^29.7.0" - jest-regex-util "^29.6.3" - jest-util "^29.7.0" - micromatch "^4.0.4" - pirates "^4.0.4" - slash "^3.0.0" - write-file-atomic "^4.0.2" - -"@jest/types@^29.6.3": - version "29.6.3" - resolved "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz" - integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== - dependencies: - "@jest/schemas" "^29.6.3" - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^17.0.8" - chalk "^4.0.0" - -"@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.5": - version "0.3.5" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" - integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== - dependencies: - "@jridgewell/set-array" "^1.2.1" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping" "^0.3.24" - -"@jridgewell/resolve-uri@^3.1.0": - version "3.1.1" - resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz" - integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== - -"@jridgewell/set-array@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" - integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== - -"@jridgewell/source-map@^0.3.3": - version "0.3.5" - resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.5.tgz#a3bb4d5c6825aab0d281268f47f6ad5853431e91" - integrity sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ== - dependencies: - "@jridgewell/gen-mapping" "^0.3.0" - "@jridgewell/trace-mapping" "^0.3.9" - -"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.4.15": - version "1.4.15" - resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz" - integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== - -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.25" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" - integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== - dependencies: - "@jridgewell/resolve-uri" "^3.1.0" - "@jridgewell/sourcemap-codec" "^1.4.14" - -"@lit-labs/ssr-dom-shim@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.2.0.tgz#353ce4a76c83fadec272ea5674ede767650762fd" - integrity sha512-yWJKmpGE6lUURKAaIltoPIE/wrbY3TEkqQt+X0m+7fQNnAv0keydnYvbiJFP1PnMhizmIWRWOG5KLhYyc/xl+g== - -"@lit/react@^1.0.0": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@lit/react/-/react-1.0.4.tgz#85538bea5c04b812903122e597f33b652e302576" - integrity sha512-6HBvk3AwF46z17fTkZp5F7/EdCJW9xqqQgYKr3sQGgoEJv0TKV1voWydG4UQQA2RWkoD4SHjy08snSpzyoyd0w== - -"@lit/reactive-element@^2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@lit/reactive-element/-/reactive-element-2.0.4.tgz#8f2ed950a848016383894a26180ff06c56ae001b" - integrity sha512-GFn91inaUa2oHLak8awSIigYz0cU0Payr1rcFsrkf5OJ5eSPxElyZfKh0f2p9FsTiZWXQdWGJeXZICEfXXYSXQ== - dependencies: - "@lit-labs/ssr-dom-shim" "^1.2.0" - -"@nodelib/fs.scandir@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@2.0.5": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - -"@nodelib/fs.walk@^1.2.8": - version "1.2.8" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - -"@rails/ujs@^7.1.3": - version "7.1.3" - resolved "https://registry.yarnpkg.com/@rails/ujs/-/ujs-7.1.3.tgz#6d94a68b7da5046147d31716e0c187a4ead4fb93" - integrity sha512-FxtgKNvvIonoBE1TK7U10VMf6CYvzq8SIZ1XZ1Q8zcn/BEXzPzid3zC9qFiojuI5WXVwWhO8GFqApq0stD+OqQ== - -"@rollup/plugin-commonjs@^25.0.8": - version "25.0.8" - resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-25.0.8.tgz#c77e608ab112a666b7f2a6bea625c73224f7dd34" - integrity sha512-ZEZWTK5n6Qde0to4vS9Mr5x/0UZoqCxPVR9KRUjU4kA2sO7GEUn1fop0DAwpO6z0Nw/kJON9bDmSxdWxO/TT1A== - dependencies: - "@rollup/pluginutils" "^5.0.1" - commondir "^1.0.1" - estree-walker "^2.0.2" - glob "^8.0.3" - is-reference "1.2.1" - magic-string "^0.30.3" - -"@rollup/plugin-node-resolve@^15.2.3": - version "15.2.3" - resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.2.3.tgz#e5e0b059bd85ca57489492f295ce88c2d4b0daf9" - integrity sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ== - dependencies: - "@rollup/pluginutils" "^5.0.1" - "@types/resolve" "1.20.2" - deepmerge "^4.2.2" - is-builtin-module "^3.2.1" - is-module "^1.0.0" - resolve "^1.22.1" - -"@rollup/plugin-terser@^0.4.4": - version "0.4.4" - resolved "https://registry.yarnpkg.com/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz#15dffdb3f73f121aa4fbb37e7ca6be9aeea91962" - integrity sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A== - dependencies: - serialize-javascript "^6.0.1" - smob "^1.0.0" - terser "^5.17.4" - -"@rollup/pluginutils@^5.0.1": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.1.0.tgz#7e53eddc8c7f483a4ad0b94afb1f7f5fd3c771e0" - integrity sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g== - dependencies: - "@types/estree" "^1.0.0" - estree-walker "^2.0.2" - picomatch "^2.3.1" - -"@rollup/rollup-android-arm-eabi@4.18.1": - version "4.18.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.1.tgz#f0da481244b7d9ea15296b35f7fe39cd81157396" - integrity sha512-lncuC4aHicncmbORnx+dUaAgzee9cm/PbIqgWz1PpXuwc+sa1Ct83tnqUDy/GFKleLiN7ZIeytM6KJ4cAn1SxA== - -"@rollup/rollup-android-arm64@4.18.1": - version "4.18.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.1.tgz#82ab3c575f4235fb647abea5e08eec6cf325964e" - integrity sha512-F/tkdw0WSs4ojqz5Ovrw5r9odqzFjb5LIgHdHZG65dFI1lWTWRVy32KDJLKRISHgJvqUeUhdIvy43fX41znyDg== - -"@rollup/rollup-darwin-arm64@4.18.1": - version "4.18.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.1.tgz#6a530452e68a9152809ce58de1f89597632a085b" - integrity sha512-vk+ma8iC1ebje/ahpxpnrfVQJibTMyHdWpOGZ3JpQ7Mgn/3QNHmPq7YwjZbIE7km73dH5M1e6MRRsnEBW7v5CQ== - -"@rollup/rollup-darwin-x64@4.18.1": - version "4.18.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.1.tgz#47727479f5ca292cf434d7e75af2725b724ecbc7" - integrity sha512-IgpzXKauRe1Tafcej9STjSSuG0Ghu/xGYH+qG6JwsAUxXrnkvNHcq/NL6nz1+jzvWAnQkuAJ4uIwGB48K9OCGA== - -"@rollup/rollup-linux-arm-gnueabihf@4.18.1": - version "4.18.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.1.tgz#46193c498aa7902a8db89ac00128060320e84fef" - integrity sha512-P9bSiAUnSSM7EmyRK+e5wgpqai86QOSv8BwvkGjLwYuOpaeomiZWifEos517CwbG+aZl1T4clSE1YqqH2JRs+g== - -"@rollup/rollup-linux-arm-musleabihf@4.18.1": - version "4.18.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.1.tgz#22d831fe239643c1d05c98906420325cee439d85" - integrity sha512-5RnjpACoxtS+aWOI1dURKno11d7krfpGDEn19jI8BuWmSBbUC4ytIADfROM1FZrFhQPSoP+KEa3NlEScznBTyQ== - -"@rollup/rollup-linux-arm64-gnu@4.18.1": - version "4.18.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.1.tgz#19abd33695ec9d588b4a858d122631433084e4a3" - integrity sha512-8mwmGD668m8WaGbthrEYZ9CBmPug2QPGWxhJxh/vCgBjro5o96gL04WLlg5BA233OCWLqERy4YUzX3bJGXaJgQ== - -"@rollup/rollup-linux-arm64-musl@4.18.1": - version "4.18.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.1.tgz#d60af8c0b9be424424ff96a0ba19fce65d26f6ab" - integrity sha512-dJX9u4r4bqInMGOAQoGYdwDP8lQiisWb9et+T84l2WXk41yEej8v2iGKodmdKimT8cTAYt0jFb+UEBxnPkbXEQ== - -"@rollup/rollup-linux-powerpc64le-gnu@4.18.1": - version "4.18.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.1.tgz#b1194e5ed6d138fdde0842d126fccde74a90f457" - integrity sha512-V72cXdTl4EI0x6FNmho4D502sy7ed+LuVW6Ym8aI6DRQ9hQZdp5sj0a2usYOlqvFBNKQnLQGwmYnujo2HvjCxQ== - -"@rollup/rollup-linux-riscv64-gnu@4.18.1": - version "4.18.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.1.tgz#f5a635c017b9bff8b856b0221fbd5c0e3373b7ec" - integrity sha512-f+pJih7sxoKmbjghrM2RkWo2WHUW8UbfxIQiWo5yeCaCM0TveMEuAzKJte4QskBp1TIinpnRcxkquY+4WuY/tg== - -"@rollup/rollup-linux-s390x-gnu@4.18.1": - version "4.18.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.1.tgz#f1043d9f4026bf6995863cb3f8dd4732606e4baa" - integrity sha512-qb1hMMT3Fr/Qz1OKovCuUM11MUNLUuHeBC2DPPAWUYYUAOFWaxInaTwTQmc7Fl5La7DShTEpmYwgdt2hG+4TEg== - -"@rollup/rollup-linux-x64-gnu@4.18.1": - version "4.18.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.1.tgz#1e781730be445119f06c9df5f185e193bc82c610" - integrity sha512-7O5u/p6oKUFYjRbZkL2FLbwsyoJAjyeXHCU3O4ndvzg2OFO2GinFPSJFGbiwFDaCFc+k7gs9CF243PwdPQFh5g== - -"@rollup/rollup-linux-x64-musl@4.18.1": - version "4.18.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.1.tgz#08f12e1965d6f27d6898ff932592121cca6abc4b" - integrity sha512-pDLkYITdYrH/9Cv/Vlj8HppDuLMDUBmgsM0+N+xLtFd18aXgM9Nyqupb/Uw+HeidhfYg2lD6CXvz6CjoVOaKjQ== - -"@rollup/rollup-win32-arm64-msvc@4.18.1": - version "4.18.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.1.tgz#4a5dcbbe7af7d41cac92b09798e7c1831da1f599" - integrity sha512-W2ZNI323O/8pJdBGil1oCauuCzmVd9lDmWBBqxYZcOqWD6aWqJtVBQ1dFrF4dYpZPks6F+xCZHfzG5hYlSHZ6g== - -"@rollup/rollup-win32-ia32-msvc@4.18.1": - version "4.18.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.1.tgz#075b0713de627843a73b4cf0e087c56b53e9d780" - integrity sha512-ELfEX1/+eGZYMaCIbK4jqLxO1gyTSOIlZr6pbC4SRYFaSIDVKOnZNMdoZ+ON0mrFDp4+H5MhwNC1H/AhE3zQLg== - -"@rollup/rollup-win32-x64-msvc@4.18.1": - version "4.18.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.1.tgz#0cb240c147c0dfd0e3eaff4cc060a772d39e155c" - integrity sha512-yjk2MAkQmoaPYCSu35RLJ62+dz358nE83VfTePJRp8CG7aMg25mEJYpXFiD+NcevhX8LxD5OP5tktPXnXN7GDw== - -"@shoelace-style/animations@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@shoelace-style/animations/-/animations-1.1.0.tgz#17539abafd6dcbf2a79e089e1593175e9f7835b5" - integrity sha512-Be+cahtZyI2dPKRm8EZSx3YJQ+jLvEcn3xzRP7tM4tqBnvd/eW/64Xh0iOf0t2w5P8iJKfdBbpVNE9naCaOf2g== - -"@shoelace-style/localize@^3.1.2": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@shoelace-style/localize/-/localize-3.1.2.tgz#2c63f16d8aa80842dbe5127845c76ed53f6a5e8e" - integrity sha512-Hf45HeO+vdQblabpyZOTxJ4ZeZsmIUYXXPmoYrrR4OJ5OKxL+bhMz5mK8JXgl7HsoEowfz7+e248UGi861de9Q== - -"@shoelace-style/shoelace@^2.16.0": - version "2.16.0" - resolved "https://registry.yarnpkg.com/@shoelace-style/shoelace/-/shoelace-2.16.0.tgz#87cf2291e15d72433c7db368e5b35ee0baa703c7" - integrity sha512-OV4XYAAZv0OfOR4RlpxCYOn7pH8ETIL8Pkh5hFvIrL+BN4/vlBLoeESYDU2tB/f9iichu4cfwdPquJITmKdY1w== - dependencies: - "@ctrl/tinycolor" "^4.0.2" - "@floating-ui/dom" "^1.5.3" - "@lit/react" "^1.0.0" - "@shoelace-style/animations" "^1.1.0" - "@shoelace-style/localize" "^3.1.2" - composed-offset-position "^0.0.4" - lit "^3.0.0" - qr-creator "^1.0.0" - -"@sinclair/typebox@^0.27.8": - version "0.27.8" - resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz" - integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== - -"@sinonjs/commons@^3.0.0": - version "3.0.0" - resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz" - integrity sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA== - dependencies: - type-detect "4.0.8" - -"@sinonjs/fake-timers@^10.0.2": - version "10.3.0" - resolved "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz" - integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA== - dependencies: - "@sinonjs/commons" "^3.0.0" - -"@tootallnate/once@2": - version "2.0.0" - resolved "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz" - integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== - -"@types/babel__core@^7.1.14": - version "7.20.5" - resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz" - integrity sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA== - dependencies: - "@babel/parser" "^7.20.7" - "@babel/types" "^7.20.7" - "@types/babel__generator" "*" - "@types/babel__template" "*" - "@types/babel__traverse" "*" - -"@types/babel__generator@*": - version "7.6.7" - resolved "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.7.tgz" - integrity sha512-6Sfsq+EaaLrw4RmdFWE9Onp63TOUue71AWb4Gpa6JxzgTYtimbM086WnYTy2U67AofR++QKCo08ZP6pwx8YFHQ== - dependencies: - "@babel/types" "^7.0.0" - -"@types/babel__template@*": - version "7.4.4" - resolved "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz" - integrity sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A== - dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - -"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.20.4" - resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.4.tgz" - integrity sha512-mSM/iKUk5fDDrEV/e83qY+Cr3I1+Q3qqTuEn++HAWYjEa1+NxZr6CNrcJGf2ZTnq4HoFGC3zaTPZTobCzCFukA== - dependencies: - "@babel/types" "^7.20.7" - -"@types/estree@*", "@types/estree@1.0.5", "@types/estree@^1.0.0": - version "1.0.5" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" - integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== - -"@types/graceful-fs@^4.1.3": - version "4.1.9" - resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz" - integrity sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ== - dependencies: - "@types/node" "*" - -"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": - version "2.0.6" - resolved "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz" - integrity sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w== - -"@types/istanbul-lib-report@*": - version "3.0.3" - resolved "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz" - integrity sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA== - dependencies: - "@types/istanbul-lib-coverage" "*" - -"@types/istanbul-reports@^3.0.0": - version "3.0.4" - resolved "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz" - integrity sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ== - dependencies: - "@types/istanbul-lib-report" "*" - -"@types/jsdom@^20.0.0": - version "20.0.1" - resolved "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.1.tgz" - integrity sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ== - dependencies: - "@types/node" "*" - "@types/tough-cookie" "*" - parse5 "^7.0.0" - -"@types/node@*": - version "20.10.1" - resolved "https://registry.npmjs.org/@types/node/-/node-20.10.1.tgz" - integrity sha512-T2qwhjWwGH81vUEx4EXmBKsTJRXFXNZTL4v0gi01+zyBmCwzE6TyHszqX01m+QHTEq+EZNo13NeJIdEqf+Myrg== - dependencies: - undici-types "~5.26.4" - -"@types/resolve@1.20.2": - version "1.20.2" - resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.20.2.tgz#97d26e00cd4a0423b4af620abecf3e6f442b7975" - integrity sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q== - -"@types/stack-utils@^2.0.0": - version "2.0.3" - resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz" - integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== - -"@types/tough-cookie@*": - version "4.0.5" - resolved "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz" - integrity sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA== - -"@types/trusted-types@^2.0.2": - version "2.0.7" - resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.7.tgz#baccb07a970b91707df3a3e8ba6896c57ead2d11" - integrity sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw== - -"@types/yargs-parser@*": - version "21.0.3" - resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz" - integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== - -"@types/yargs@^17.0.8": - version "17.0.32" - resolved "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz" - integrity sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog== - dependencies: - "@types/yargs-parser" "*" - -"@ungap/custom-elements@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@ungap/custom-elements/-/custom-elements-1.3.0.tgz#c1b7623887f774f274f308a1468098894826c2be" - integrity sha512-f4q/s76+8nOy+fhrNHyetuoPDR01lmlZB5czfCG+OOnBw/Wf+x48DcCDPmMQY7oL8xYFL8qfenMoiS8DUkKBUw== - -"@ungap/structured-clone@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" - integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== - -abab@^2.0.6: - version "2.0.6" - resolved "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz" - integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== - -acorn-globals@^7.0.0: - version "7.0.1" - resolved "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz" - integrity sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q== - dependencies: - acorn "^8.1.0" - acorn-walk "^8.0.2" - -acorn-jsx@^5.3.2: - version "5.3.2" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" - integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== - -acorn-walk@^8.0.2: - version "8.3.0" - resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.0.tgz" - integrity sha512-FS7hV565M5l1R08MXqo8odwMTB02C2UqzB17RVgu9EyuYFBqJZ3/ZY97sQD5FewVu1UyDFc1yztUDrAwT0EypA== - -acorn@^8.1.0, acorn@^8.8.1, acorn@^8.8.2, acorn@^8.9.0: - version "8.11.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" - integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== - -agent-base@6: - version "6.0.2" - resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - -ajv@^6.12.4: - version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ansi-escapes@^4.2.1: - version "4.3.2" - resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz" - integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== - dependencies: - type-fest "^0.21.3" - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -ansi-styles@^5.0.0: - version "5.2.0" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz" - integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== - -anymatch@^3.0.3, anymatch@~3.1.2: - version "3.1.3" - resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz" - integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" - integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== - -babel-jest@^29.6.4, babel-jest@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz" - integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== - dependencies: - "@jest/transform" "^29.7.0" - "@types/babel__core" "^7.1.14" - babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^29.6.3" - chalk "^4.0.0" - graceful-fs "^4.2.9" - slash "^3.0.0" - -babel-plugin-istanbul@^6.1.1: - version "6.1.1" - resolved "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz" - integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@istanbuljs/load-nyc-config" "^1.0.0" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-instrument "^5.0.4" - test-exclude "^6.0.0" - -babel-plugin-jest-hoist@^29.6.3: - version "29.6.3" - resolved "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz" - integrity sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg== - dependencies: - "@babel/template" "^7.3.3" - "@babel/types" "^7.3.3" - "@types/babel__core" "^7.1.14" - "@types/babel__traverse" "^7.0.6" - -babel-plugin-polyfill-corejs2@^0.4.10: - version "0.4.10" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.10.tgz#276f41710b03a64f6467433cab72cbc2653c38b1" - integrity sha512-rpIuu//y5OX6jVU+a5BCn1R5RSZYWAl2Nar76iwaOdycqb6JPxediskWFMMl7stfwNJR4b7eiQvh5fB5TEQJTQ== - dependencies: - "@babel/compat-data" "^7.22.6" - "@babel/helper-define-polyfill-provider" "^0.6.1" - semver "^6.3.1" - -babel-plugin-polyfill-corejs3@^0.10.4: - version "0.10.4" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.4.tgz#789ac82405ad664c20476d0233b485281deb9c77" - integrity sha512-25J6I8NGfa5YkCDogHRID3fVCadIR8/pGl1/spvCkzb6lVn6SR3ojpx9nOn9iEBcUsjY24AmdKm5khcfKdylcg== - dependencies: - "@babel/helper-define-polyfill-provider" "^0.6.1" - core-js-compat "^3.36.1" - -babel-plugin-polyfill-regenerator@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.1.tgz#4f08ef4c62c7a7f66a35ed4c0d75e30506acc6be" - integrity sha512-JfTApdE++cgcTWjsiCQlLyFBMbTUft9ja17saCc93lgV33h4tuCVj7tlvu//qpLwaG+3yEz7/KhahGrUMkVq9g== - dependencies: - "@babel/helper-define-polyfill-provider" "^0.6.1" - -babel-preset-current-node-syntax@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz" - integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ== - dependencies: - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-bigint" "^7.8.3" - "@babel/plugin-syntax-class-properties" "^7.8.3" - "@babel/plugin-syntax-import-meta" "^7.8.3" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.8.3" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-top-level-await" "^7.8.3" - -babel-preset-jest@^29.6.3: - version "29.6.3" - resolved "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz" - integrity sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA== - dependencies: - babel-plugin-jest-hoist "^29.6.3" - babel-preset-current-node-syntax "^1.0.0" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -bezier-easing@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/bezier-easing/-/bezier-easing-2.1.0.tgz" - integrity sha512-gbIqZ/eslnUFC1tjEvtz0sgx+xTK20wDnYMIA27VA04R7w6xxXQPZDbibjA9DTWZRA2CXtwHykkVzlCaAJAZig== - -binary-extensions@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" - integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" - integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== - dependencies: - balanced-match "^1.0.0" - -braces@^3.0.2, braces@~3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" - integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== - dependencies: - fill-range "^7.1.1" - -browserslist@^4.23.0, browserslist@^4.23.1: - version "4.23.2" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.2.tgz#244fe803641f1c19c28c48c4b6ec9736eb3d32ed" - integrity sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA== - dependencies: - caniuse-lite "^1.0.30001640" - electron-to-chromium "^1.4.820" - node-releases "^2.0.14" - update-browserslist-db "^1.1.0" - -bser@2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz" - integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== - dependencies: - node-int64 "^0.4.0" - -buffer-from@^1.0.0: - version "1.1.2" - resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - -builtin-modules@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" - integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== - -call-bind@^1.0.0: - version "1.0.5" - resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz" - integrity sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ== - dependencies: - function-bind "^1.1.2" - get-intrinsic "^1.2.1" - set-function-length "^1.1.1" - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -camelcase@^6.2.0: - version "6.3.0" - resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz" - integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== - -caniuse-lite@^1.0.30001640: - version "1.0.30001643" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz#9c004caef315de9452ab970c3da71085f8241dbd" - integrity sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg== - -chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^4.0.0: - version "4.1.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -char-regex@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz" - integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== - -"chokidar@>=3.0.0 <4.0.0": - version "3.6.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" - integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - -ci-info@^3.2.0: - version "3.9.0" - resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz" - integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== - -cjs-module-lexer@^1.0.0: - version "1.2.3" - resolved "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz" - integrity sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ== - -clipboard@^2.0.11: - version "2.0.11" - resolved "https://registry.yarnpkg.com/clipboard/-/clipboard-2.0.11.tgz#62180360b97dd668b6b3a84ec226975762a70be5" - integrity sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw== - dependencies: - good-listener "^1.2.2" - select "^1.1.2" - tiny-emitter "^2.0.0" - -cliui@^8.0.1: - version "8.0.1" - resolved "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz" - integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.1" - wrap-ansi "^7.0.0" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz" - integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== - -collect-v8-coverage@^1.0.0: - version "1.0.2" - resolved "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz" - integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -commander@^2.20.0: - version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - -commondir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== - -composed-offset-position@^0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/composed-offset-position/-/composed-offset-position-0.0.4.tgz#ca8854abf15e3c235ecf4df125a27fe88af76ea4" - integrity sha512-vMlvu1RuNegVE0YsCDSV/X4X10j56mq7PCIyOKK74FxkXzGLwhOUmdkJLSdOBOMwWycobGUMgft2lp+YgTe8hw== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - -convert-source-map@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz" - integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== - -core-js-compat@^3.36.1, core-js-compat@^3.37.1: - version "3.37.1" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.37.1.tgz#c844310c7852f4bdf49b8d339730b97e17ff09ee" - integrity sha512-9TNiImhKvQqSUkOvk/mMRZzOANTiEVC7WaBNhHcKM7x+/5E1l5NvsysR19zuDQScE8k+kfQXWRN3AtS/eOSHpg== - dependencies: - browserslist "^4.23.0" - -create-jest@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz" - integrity sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q== - dependencies: - "@jest/types" "^29.6.3" - chalk "^4.0.0" - exit "^0.1.2" - graceful-fs "^4.2.9" - jest-config "^29.7.0" - jest-util "^29.7.0" - prompts "^2.0.1" - -cross-spawn@^7.0.2, cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -css-mediaquery@^0.1.2: - version "0.1.2" - resolved "https://registry.npmjs.org/css-mediaquery/-/css-mediaquery-0.1.2.tgz" - integrity sha512-COtn4EROW5dBGlE/4PiKnh6rZpAPxDeFLaEEwt4i10jpDMFt2EhQGS79QmmrO+iKCHv0PU/HrOWEhijFd1x99Q== - -cssom@^0.5.0: - version "0.5.0" - resolved "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz" - integrity sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw== - -cssom@~0.3.6: - version "0.3.8" - resolved "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz" - integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== - -cssstyle@^2.3.0: - version "2.3.0" - resolved "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz" - integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== - dependencies: - cssom "~0.3.6" - -data-urls@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz" - integrity sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ== - dependencies: - abab "^2.0.6" - whatwg-mimetype "^3.0.0" - whatwg-url "^11.0.0" - -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: - version "4.3.4" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - -decimal.js@^10.4.2: - version "10.4.3" - resolved "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz" - integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== - -dedent@^1.0.0: - version "1.5.1" - resolved "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz" - integrity sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg== - -deep-is@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" - integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== - -deepmerge@^4.2.2: - version "4.3.1" - resolved "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz" - integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== - -define-data-property@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz" - integrity sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ== - dependencies: - get-intrinsic "^1.2.1" - gopd "^1.0.1" - has-property-descriptors "^1.0.0" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" - integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== - -delegate@^3.1.2: - version "3.2.0" - resolved "https://registry.yarnpkg.com/delegate/-/delegate-3.2.0.tgz#b66b71c3158522e8ab5744f720d8ca0c2af59166" - integrity sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw== - -detect-newline@^3.0.0: - version "3.1.0" - resolved "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz" - integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== - -diff-sequences@^29.6.3: - version "29.6.3" - resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz" - integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== - -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - -dom-walk@^0.1.0: - version "0.1.2" - resolved "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz" - integrity sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w== - -domexception@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz" - integrity sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw== - dependencies: - webidl-conversions "^7.0.0" - -electron-to-chromium@^1.4.820: - version "1.5.1" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.1.tgz#24640bd4dcfaccb6d82bb4c3f4c7311503241581" - integrity sha512-FKbOCOQ5QRB3VlIbl1LZQefWIYwszlBloaXcY2rbfpu9ioJnNh3TK03YtIDKDo3WKBi8u+YV4+Fn2CkEozgf4w== - -emittery@^0.13.1: - version "0.13.1" - resolved "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz" - integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -entities@^4.4.0: - version "4.5.0" - resolved "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz" - integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== - -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -escalade@^3.1.1, escalade@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27" - integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA== - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== - -escape-string-regexp@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz" - integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== - -escape-string-regexp@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - -escodegen@^2.0.0: - version "2.1.0" - resolved "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz" - integrity sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w== - dependencies: - esprima "^4.0.1" - estraverse "^5.2.0" - esutils "^2.0.2" - optionalDependencies: - source-map "~0.6.1" - -eslint-scope@^7.2.2: - version "7.2.2" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" - integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== - dependencies: - esrecurse "^4.3.0" - estraverse "^5.2.0" - -eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: - version "3.4.3" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" - integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== - -eslint@^8.57.0: - version "8.57.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.57.0.tgz#c786a6fd0e0b68941aaf624596fb987089195668" - integrity sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ== - dependencies: - "@eslint-community/eslint-utils" "^4.2.0" - "@eslint-community/regexpp" "^4.6.1" - "@eslint/eslintrc" "^2.1.4" - "@eslint/js" "8.57.0" - "@humanwhocodes/config-array" "^0.11.14" - "@humanwhocodes/module-importer" "^1.0.1" - "@nodelib/fs.walk" "^1.2.8" - "@ungap/structured-clone" "^1.2.0" - ajv "^6.12.4" - chalk "^4.0.0" - cross-spawn "^7.0.2" - debug "^4.3.2" - doctrine "^3.0.0" - escape-string-regexp "^4.0.0" - eslint-scope "^7.2.2" - eslint-visitor-keys "^3.4.3" - espree "^9.6.1" - esquery "^1.4.2" - esutils "^2.0.2" - fast-deep-equal "^3.1.3" - file-entry-cache "^6.0.1" - find-up "^5.0.0" - glob-parent "^6.0.2" - globals "^13.19.0" - graphemer "^1.4.0" - ignore "^5.2.0" - imurmurhash "^0.1.4" - is-glob "^4.0.0" - is-path-inside "^3.0.3" - js-yaml "^4.1.0" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.4.1" - lodash.merge "^4.6.2" - minimatch "^3.1.2" - natural-compare "^1.4.0" - optionator "^0.9.3" - strip-ansi "^6.0.1" - text-table "^0.2.0" - -espree@^9.6.0, espree@^9.6.1: - version "9.6.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" - integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== - dependencies: - acorn "^8.9.0" - acorn-jsx "^5.3.2" - eslint-visitor-keys "^3.4.1" - -esprima@^4.0.0, esprima@^4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -esquery@^1.4.2: - version "1.5.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" - integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== - dependencies: - estraverse "^5.1.0" - -esrecurse@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" - integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== - dependencies: - estraverse "^5.2.0" - -estraverse@^5.1.0, estraverse@^5.2.0: - version "5.3.0" - resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" - integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== - -estree-walker@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" - integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== - -esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - -execa@^5.0.0: - version "5.1.1" - resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz" - integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== - dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" - strip-final-newline "^2.0.0" - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz" - integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== - -expect@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz" - integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== - dependencies: - "@jest/expect-utils" "^29.7.0" - jest-get-type "^29.6.3" - jest-matcher-utils "^29.7.0" - jest-message-util "^29.7.0" - jest-util "^29.7.0" - -fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fast-levenshtein@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== - -fastq@^1.6.0: - version "1.16.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.16.0.tgz#83b9a9375692db77a822df081edb6a9cf6839320" - integrity sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA== - dependencies: - reusify "^1.0.4" - -fb-watchman@^2.0.0: - version "2.0.2" - resolved "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz" - integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA== - dependencies: - bser "2.1.1" - -file-entry-cache@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" - integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== - dependencies: - flat-cache "^3.0.4" - -fill-range@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" - integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== - dependencies: - to-regex-range "^5.0.1" - -find-up@^4.0.0, find-up@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - -find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -flat-cache@^3.0.4: - version "3.2.0" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" - integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== - dependencies: - flatted "^3.2.9" - keyv "^4.5.3" - rimraf "^3.0.2" - -flatpickr@^4.6.13: - version "4.6.13" - resolved "https://registry.yarnpkg.com/flatpickr/-/flatpickr-4.6.13.tgz#8a029548187fd6e0d670908471e43abe9ad18d94" - integrity sha512-97PMG/aywoYpB4IvbvUJi0RQi8vearvU0oov1WW3k0WZPBMrTQVqekSX5CjSG/M4Q3i6A/0FKXC7RyAoAUUSPw== - -flatted@^3.2.9: - version "3.2.9" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf" - integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== - -form-data@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" - integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== - -fsevents@^2.3.2, fsevents@~2.3.2: - version "2.3.3" - resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz" - integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== - -function-bind@^1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz" - integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== - -gensync@^1.0.0-beta.2: - version "1.0.0-beta.2" - resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz" - integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== - -get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-intrinsic@^1.0.2, get-intrinsic@^1.1.3, get-intrinsic@^1.2.1, get-intrinsic@^1.2.2: - version "1.2.2" - resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz" - integrity sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA== - dependencies: - function-bind "^1.1.2" - has-proto "^1.0.1" - has-symbols "^1.0.3" - hasown "^2.0.0" - -get-package-type@^0.1.0: - version "0.1.0" - resolved "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz" - integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== - -get-stream@^6.0.0: - version "6.0.1" - resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" - integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== - -glob-parent@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" - integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== - dependencies: - is-glob "^4.0.3" - -glob-parent@~5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob@^7.1.3, glob@^7.1.4: - version "7.2.3" - resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^8.0.3: - version "8.1.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" - integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^5.0.1" - once "^1.3.0" - -global@^4.3.0: - version "4.4.0" - resolved "https://registry.npmjs.org/global/-/global-4.4.0.tgz" - integrity sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w== - dependencies: - min-document "^2.19.0" - process "^0.11.10" - -globals@^11.1.0: - version "11.12.0" - resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - -globals@^13.19.0: - version "13.24.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.24.0.tgz#8432a19d78ce0c1e833949c36adb345400bb1171" - integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== - dependencies: - type-fest "^0.20.2" - -good-listener@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/good-listener/-/good-listener-1.2.2.tgz#d53b30cdf9313dffb7dc9a0d477096aa6d145c50" - integrity sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw== - dependencies: - delegate "^3.1.2" - -gopd@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz" - integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== - dependencies: - get-intrinsic "^1.1.3" - -graceful-fs@^4.2.9: - version "4.2.11" - resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz" - integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== - -graphemer@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" - integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has-property-descriptors@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz" - integrity sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg== - dependencies: - get-intrinsic "^1.2.2" - -has-proto@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz" - integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== - -has-symbols@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz" - integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== - -hasown@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz" - integrity sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA== - dependencies: - function-bind "^1.1.2" - -html-encoding-sniffer@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz" - integrity sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA== - dependencies: - whatwg-encoding "^2.0.0" - -html-escaper@^2.0.0: - version "2.0.2" - resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz" - integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== - -http-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz" - integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== - dependencies: - "@tootallnate/once" "2" - agent-base "6" - debug "4" - -https-proxy-agent@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz" - integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== - dependencies: - agent-base "6" - debug "4" - -human-signals@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz" - integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== - -iconv-lite@0.6.3: - version "0.6.3" - resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz" - integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== - dependencies: - safer-buffer ">= 2.1.2 < 3.0.0" - -ignore@^5.2.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78" - integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg== - -immutable@^4.0.0: - version "4.3.6" - resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.6.tgz#6a05f7858213238e587fb83586ffa3b4b27f0447" - integrity sha512-Ju0+lEMyzMVZarkTn/gqRpdqd5dOPaz1mCZ0SH3JV6iFw81PldE/PEB1hWVEA288HPt4WXW8O7AWxB10M+03QQ== - -import-fresh@^3.2.1: - version "3.3.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" - integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -import-local@^3.0.2: - version "3.1.0" - resolved "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz" - integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg== - dependencies: - pkg-dir "^4.2.0" - resolve-cwd "^3.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" - integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" - integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.4" - resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" - integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-builtin-module@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-3.2.1.tgz#f03271717d8654cfcaf07ab0463faa3571581169" - integrity sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A== - dependencies: - builtin-modules "^3.3.0" - -is-core-module@^2.13.0: - version "2.13.1" - resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz" - integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw== - dependencies: - hasown "^2.0.0" - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-generator-fn@^2.0.0: - version "2.1.0" - resolved "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz" - integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== - -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" - integrity sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g== - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-path-inside@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" - integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== - -is-potential-custom-element-name@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz" - integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== - -is-reference@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" - integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== - dependencies: - "@types/estree" "*" - -is-stream@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz" - integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" - integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== - -istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: - version "3.2.2" - resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz" - integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg== - -istanbul-lib-instrument@^5.0.4: - version "5.2.1" - resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz" - integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== - dependencies: - "@babel/core" "^7.12.3" - "@babel/parser" "^7.14.7" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-coverage "^3.2.0" - semver "^6.3.0" - -istanbul-lib-instrument@^6.0.0: - version "6.0.1" - resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.1.tgz" - integrity sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA== - dependencies: - "@babel/core" "^7.12.3" - "@babel/parser" "^7.14.7" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-coverage "^3.2.0" - semver "^7.5.4" - -istanbul-lib-report@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz" - integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== - dependencies: - istanbul-lib-coverage "^3.0.0" - make-dir "^4.0.0" - supports-color "^7.1.0" - -istanbul-lib-source-maps@^4.0.0: - version "4.0.1" - resolved "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz" - integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== - dependencies: - debug "^4.1.1" - istanbul-lib-coverage "^3.0.0" - source-map "^0.6.1" - -istanbul-reports@^3.1.3: - version "3.1.6" - resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz" - integrity sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg== - dependencies: - html-escaper "^2.0.0" - istanbul-lib-report "^3.0.0" - -jest-changed-files@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz" - integrity sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w== - dependencies: - execa "^5.0.0" - jest-util "^29.7.0" - p-limit "^3.1.0" - -jest-circus@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz" - integrity sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw== - dependencies: - "@jest/environment" "^29.7.0" - "@jest/expect" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - chalk "^4.0.0" - co "^4.6.0" - dedent "^1.0.0" - is-generator-fn "^2.0.0" - jest-each "^29.7.0" - jest-matcher-utils "^29.7.0" - jest-message-util "^29.7.0" - jest-runtime "^29.7.0" - jest-snapshot "^29.7.0" - jest-util "^29.7.0" - p-limit "^3.1.0" - pretty-format "^29.7.0" - pure-rand "^6.0.0" - slash "^3.0.0" - stack-utils "^2.0.3" - -jest-cli@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz" - integrity sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg== - dependencies: - "@jest/core" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/types" "^29.6.3" - chalk "^4.0.0" - create-jest "^29.7.0" - exit "^0.1.2" - import-local "^3.0.2" - jest-config "^29.7.0" - jest-util "^29.7.0" - jest-validate "^29.7.0" - yargs "^17.3.1" - -jest-config@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz" - integrity sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ== - dependencies: - "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.7.0" - "@jest/types" "^29.6.3" - babel-jest "^29.7.0" - chalk "^4.0.0" - ci-info "^3.2.0" - deepmerge "^4.2.2" - glob "^7.1.3" - graceful-fs "^4.2.9" - jest-circus "^29.7.0" - jest-environment-node "^29.7.0" - jest-get-type "^29.6.3" - jest-regex-util "^29.6.3" - jest-resolve "^29.7.0" - jest-runner "^29.7.0" - jest-util "^29.7.0" - jest-validate "^29.7.0" - micromatch "^4.0.4" - parse-json "^5.2.0" - pretty-format "^29.7.0" - slash "^3.0.0" - strip-json-comments "^3.1.1" - -jest-diff@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz" - integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== - dependencies: - chalk "^4.0.0" - diff-sequences "^29.6.3" - jest-get-type "^29.6.3" - pretty-format "^29.7.0" - -jest-docblock@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz" - integrity sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g== - dependencies: - detect-newline "^3.0.0" - -jest-each@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz" - integrity sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ== - dependencies: - "@jest/types" "^29.6.3" - chalk "^4.0.0" - jest-get-type "^29.6.3" - jest-util "^29.7.0" - pretty-format "^29.7.0" - -jest-environment-jsdom@^29.6.4: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-29.7.0.tgz" - integrity sha512-k9iQbsf9OyOfdzWH8HDmrRT0gSIcX+FLNW7IQq94tFX0gynPwqDTW0Ho6iMVNjGz/nb+l/vW3dWM2bbLLpkbXA== - dependencies: - "@jest/environment" "^29.7.0" - "@jest/fake-timers" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/jsdom" "^20.0.0" - "@types/node" "*" - jest-mock "^29.7.0" - jest-util "^29.7.0" - jsdom "^20.0.0" - -jest-environment-node@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz" - integrity sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw== - dependencies: - "@jest/environment" "^29.7.0" - "@jest/fake-timers" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - jest-mock "^29.7.0" - jest-util "^29.7.0" - -jest-get-type@^29.6.3: - version "29.6.3" - resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz" - integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== - -jest-haste-map@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz" - integrity sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA== - dependencies: - "@jest/types" "^29.6.3" - "@types/graceful-fs" "^4.1.3" - "@types/node" "*" - anymatch "^3.0.3" - fb-watchman "^2.0.0" - graceful-fs "^4.2.9" - jest-regex-util "^29.6.3" - jest-util "^29.7.0" - jest-worker "^29.7.0" - micromatch "^4.0.4" - walker "^1.0.8" - optionalDependencies: - fsevents "^2.3.2" - -jest-leak-detector@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz" - integrity sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw== - dependencies: - jest-get-type "^29.6.3" - pretty-format "^29.7.0" - -jest-matcher-utils@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz" - integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g== - dependencies: - chalk "^4.0.0" - jest-diff "^29.7.0" - jest-get-type "^29.6.3" - pretty-format "^29.7.0" - -jest-message-util@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz" - integrity sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w== - dependencies: - "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.6.3" - "@types/stack-utils" "^2.0.0" - chalk "^4.0.0" - graceful-fs "^4.2.9" - micromatch "^4.0.4" - pretty-format "^29.7.0" - slash "^3.0.0" - stack-utils "^2.0.3" - -jest-mock@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz" - integrity sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw== - dependencies: - "@jest/types" "^29.6.3" - "@types/node" "*" - jest-util "^29.7.0" - -jest-pnp-resolver@^1.2.2: - version "1.2.3" - resolved "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz" - integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== - -jest-regex-util@^29.6.3: - version "29.6.3" - resolved "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz" - integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg== - -jest-resolve-dependencies@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz" - integrity sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA== - dependencies: - jest-regex-util "^29.6.3" - jest-snapshot "^29.7.0" - -jest-resolve@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz" - integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== - dependencies: - chalk "^4.0.0" - graceful-fs "^4.2.9" - jest-haste-map "^29.7.0" - jest-pnp-resolver "^1.2.2" - jest-util "^29.7.0" - jest-validate "^29.7.0" - resolve "^1.20.0" - resolve.exports "^2.0.0" - slash "^3.0.0" - -jest-runner@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz" - integrity sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ== - dependencies: - "@jest/console" "^29.7.0" - "@jest/environment" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - chalk "^4.0.0" - emittery "^0.13.1" - graceful-fs "^4.2.9" - jest-docblock "^29.7.0" - jest-environment-node "^29.7.0" - jest-haste-map "^29.7.0" - jest-leak-detector "^29.7.0" - jest-message-util "^29.7.0" - jest-resolve "^29.7.0" - jest-runtime "^29.7.0" - jest-util "^29.7.0" - jest-watcher "^29.7.0" - jest-worker "^29.7.0" - p-limit "^3.1.0" - source-map-support "0.5.13" - -jest-runtime@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz" - integrity sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ== - dependencies: - "@jest/environment" "^29.7.0" - "@jest/fake-timers" "^29.7.0" - "@jest/globals" "^29.7.0" - "@jest/source-map" "^29.6.3" - "@jest/test-result" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - chalk "^4.0.0" - cjs-module-lexer "^1.0.0" - collect-v8-coverage "^1.0.0" - glob "^7.1.3" - graceful-fs "^4.2.9" - jest-haste-map "^29.7.0" - jest-message-util "^29.7.0" - jest-mock "^29.7.0" - jest-regex-util "^29.6.3" - jest-resolve "^29.7.0" - jest-snapshot "^29.7.0" - jest-util "^29.7.0" - slash "^3.0.0" - strip-bom "^4.0.0" - -jest-snapshot@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz" - integrity sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw== - dependencies: - "@babel/core" "^7.11.6" - "@babel/generator" "^7.7.2" - "@babel/plugin-syntax-jsx" "^7.7.2" - "@babel/plugin-syntax-typescript" "^7.7.2" - "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" - babel-preset-current-node-syntax "^1.0.0" - chalk "^4.0.0" - expect "^29.7.0" - graceful-fs "^4.2.9" - jest-diff "^29.7.0" - jest-get-type "^29.6.3" - jest-matcher-utils "^29.7.0" - jest-message-util "^29.7.0" - jest-util "^29.7.0" - natural-compare "^1.4.0" - pretty-format "^29.7.0" - semver "^7.5.3" - -jest-util@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz" - integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== - dependencies: - "@jest/types" "^29.6.3" - "@types/node" "*" - chalk "^4.0.0" - ci-info "^3.2.0" - graceful-fs "^4.2.9" - picomatch "^2.2.3" - -jest-validate@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz" - integrity sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw== - dependencies: - "@jest/types" "^29.6.3" - camelcase "^6.2.0" - chalk "^4.0.0" - jest-get-type "^29.6.3" - leven "^3.1.0" - pretty-format "^29.7.0" - -jest-watcher@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz" - integrity sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g== - dependencies: - "@jest/test-result" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - ansi-escapes "^4.2.1" - chalk "^4.0.0" - emittery "^0.13.1" - jest-util "^29.7.0" - string-length "^4.0.1" - -jest-worker@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz" - integrity sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw== - dependencies: - "@types/node" "*" - jest-util "^29.7.0" - merge-stream "^2.0.0" - supports-color "^8.0.0" - -jest@^29.6.4: - version "29.7.0" - resolved "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz" - integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== - dependencies: - "@jest/core" "^29.7.0" - "@jest/types" "^29.6.3" - import-local "^3.0.2" - jest-cli "^29.7.0" - -jquery@^3.7.1: - version "3.7.1" - resolved "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz" - integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg== - -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - -jsdom-testing-mocks@^1.13.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/jsdom-testing-mocks/-/jsdom-testing-mocks-1.13.0.tgz#35ab133520fe5af6f9c0a770d88821711f66eb65" - integrity sha512-NALf9jUnvx3TF0HuHFcP6vjMmHZXqYMAB5GCmRd0heWvkIZyTx71ZdmSmTFfJopERaIIorU+Mbiue0YYd17Wkg== - dependencies: - bezier-easing "^2.1.0" - css-mediaquery "^0.1.2" - -jsdom@^20.0.0: - version "20.0.3" - resolved "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz" - integrity sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ== - dependencies: - abab "^2.0.6" - acorn "^8.8.1" - acorn-globals "^7.0.0" - cssom "^0.5.0" - cssstyle "^2.3.0" - data-urls "^3.0.2" - decimal.js "^10.4.2" - domexception "^4.0.0" - escodegen "^2.0.0" - form-data "^4.0.0" - html-encoding-sniffer "^3.0.0" - http-proxy-agent "^5.0.0" - https-proxy-agent "^5.0.1" - is-potential-custom-element-name "^1.0.1" - nwsapi "^2.2.2" - parse5 "^7.1.1" - saxes "^6.0.0" - symbol-tree "^3.2.4" - tough-cookie "^4.1.2" - w3c-xmlserializer "^4.0.0" - webidl-conversions "^7.0.0" - whatwg-encoding "^2.0.0" - whatwg-mimetype "^3.0.0" - whatwg-url "^11.0.0" - ws "^8.11.0" - xml-name-validator "^4.0.0" - -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== - -jsesc@~0.5.0: - version "0.5.0" - resolved "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz" - integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== - -json-buffer@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" - integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== - -json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== - -json5@^2.2.3: - version "2.2.3" - resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz" - integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== - -keymaster@^1.6.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/keymaster/-/keymaster-1.6.2.tgz#e1ae54d0ea9488f9f60b66b668f02e9a1946c6eb" - integrity sha512-OvA/AALN8IDKKkTk2Z+bDrzs/SQao4lo/QPbwSdDvm+frxfiYiYCSn1aHFUypJY3SruAO1y/c771agBmTXqUtg== - -keyv@^4.5.3: - version "4.5.4" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" - integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== - dependencies: - json-buffer "3.0.1" - -kleur@^3.0.3: - version "3.0.3" - resolved "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz" - integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== - -leven@^3.1.0: - version "3.1.0" - resolved "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz" - integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== - -levn@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" - integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== - dependencies: - prelude-ls "^1.2.1" - type-check "~0.4.0" - -lines-and-columns@^1.1.6: - version "1.2.4" - resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz" - integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== - -lit-element@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-4.0.4.tgz#e0b37ebbe2394bcb9578d611a409f49475dff361" - integrity sha512-98CvgulX6eCPs6TyAIQoJZBCQPo80rgXR+dVBs61cstJXqtI+USQZAbA4gFHh6L/mxBx9MrgPLHLsUgDUHAcCQ== - dependencies: - "@lit-labs/ssr-dom-shim" "^1.2.0" - "@lit/reactive-element" "^2.0.4" - lit-html "^3.1.2" - -lit-html@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-3.1.2.tgz#6655ce82367472de7680c62b1bcb0beb0e426fa1" - integrity sha512-3OBZSUrPnAHoKJ9AMjRL/m01YJxQMf+TMHanNtTHG68ubjnZxK0RFl102DPzsw4mWnHibfZIBJm3LWCZ/LmMvg== - dependencies: - "@types/trusted-types" "^2.0.2" - -lit@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lit/-/lit-3.1.2.tgz#f276258e8a56593f1d834a5fd00a7eb5e891ae73" - integrity sha512-VZx5iAyMtX7CV4K8iTLdCkMaYZ7ipjJZ0JcSdJ0zIdGxxyurjIn7yuuSxNBD7QmjvcNJwr0JS4cAdAtsy7gZ6w== - dependencies: - "@lit/reactive-element" "^2.0.4" - lit-element "^4.0.4" - lit-html "^3.1.2" - -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - -lodash.debounce@^4.0.8: - version "4.0.8" - resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz" - integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== - -lodash.merge@^4.6.2: - version "4.6.2" - resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" - integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== - -lru-cache@^5.1.1: - version "5.1.1" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz" - integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== - dependencies: - yallist "^3.0.2" - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -magic-string@^0.30.3: - version "0.30.5" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.5.tgz#1994d980bd1c8835dc6e78db7cbd4ae4f24746f9" - integrity sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA== - dependencies: - "@jridgewell/sourcemap-codec" "^1.4.15" - -make-dir@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz" - integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== - dependencies: - semver "^7.5.3" - -makeerror@1.0.12: - version "1.0.12" - resolved "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz" - integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== - dependencies: - tmpl "1.0.5" - -merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - -micromatch@^4.0.4: - version "4.0.5" - resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz" - integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== - dependencies: - braces "^3.0.2" - picomatch "^2.3.1" - -mime-db@1.52.0: - version "1.52.0" - resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz" - integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== - -mime-types@^2.1.12: - version "2.1.35" - resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz" - integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== - dependencies: - mime-db "1.52.0" - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -min-document@^2.19.0: - version "2.19.0" - resolved "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz" - integrity sha512-9Wy1B3m3f66bPPmU5hdA4DR4PB2OfDU/+GS3yAB7IQozE3tqXaVv2zOjgla7MEGSRv95+ILmOuvhLkOK6wJtCQ== - dependencies: - dom-walk "^0.1.0" - -minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: - version "3.1.2" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -minimatch@^5.0.1: - version "5.1.6" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" - integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== - dependencies: - brace-expansion "^2.0.1" - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" - integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== - -node-int64@^0.4.0: - version "0.4.0" - resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz" - integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== - -node-releases@^2.0.14: - version "2.0.14" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b" - integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -npm-run-path@^4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz" - integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== - dependencies: - path-key "^3.0.0" - -nwsapi@^2.2.2: - version "2.2.7" - resolved "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz" - integrity sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ== - -object-inspect@^1.9.0: - version "1.13.1" - resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz" - integrity sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ== - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== - dependencies: - wrappy "1" - -onetime@^5.1.2: - version "5.1.2" - resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - -optionator@^0.9.3: - version "0.9.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" - integrity sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg== - dependencies: - "@aashutoshrathi/word-wrap" "^1.2.3" - deep-is "^0.1.3" - fast-levenshtein "^2.0.6" - levn "^0.4.1" - prelude-ls "^1.2.1" - type-check "^0.4.0" - -p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - -p-limit@^3.0.2, p-limit@^3.1.0: - version "3.1.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - -parse-json@^5.2.0: - version "5.2.0" - resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz" - integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - -parse5@^7.0.0, parse5@^7.1.1: - version "7.1.2" - resolved "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz" - integrity sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw== - dependencies: - entities "^4.4.0" - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" - integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== - -path-key@^3.0.0, path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-parse@^1.0.7: - version "1.0.7" - resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -picocolors@^1.0.0, picocolors@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.1.tgz#a8ad579b571952f0e5d25892de5445bcfe25aaa1" - integrity sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew== - -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -pirates@^4.0.4: - version "4.0.6" - resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz" - integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== - -pkg-dir@^4.2.0: - version "4.2.0" - resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== - dependencies: - find-up "^4.0.0" - -prelude-ls@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" - integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== - -prettier@^3.3.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105" - integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew== - -pretty-format@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz" - integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== - dependencies: - "@jest/schemas" "^29.6.3" - ansi-styles "^5.0.0" - react-is "^18.0.0" - -process@^0.11.10: - version "0.11.10" - resolved "https://registry.npmjs.org/process/-/process-0.11.10.tgz" - integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== - -prompts@^2.0.1: - version "2.4.2" - resolved "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz" - integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== - dependencies: - kleur "^3.0.3" - sisteransi "^1.0.5" - -psl@^1.1.33: - version "1.9.0" - resolved "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz" - integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== - -punycode@^1.4.1: - version "1.4.1" - resolved "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz" - integrity sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ== - -punycode@^2.1.0, punycode@^2.1.1: - version "2.3.1" - resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz" - integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== - -pure-rand@^6.0.0: - version "6.0.4" - resolved "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.4.tgz" - integrity sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA== - -qr-creator@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/qr-creator/-/qr-creator-1.0.0.tgz#f350a8f0b5be02bd1fc1ef133a038a06ef8bc5ef" - integrity sha512-C0cqfbS1P5hfqN4NhsYsUXePlk9BO+a45bAQ3xLYjBL3bOIFzoVEjs79Fado9u9BPBD3buHi3+vY+C8tHh4qMQ== - -qs@^6.11.2: - version "6.11.2" - resolved "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz" - integrity sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA== - dependencies: - side-channel "^1.0.4" - -querystringify@^2.1.1: - version "2.2.0" - resolved "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz" - integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== - -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - -randombytes@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - -react-is@^18.0.0: - version "18.2.0" - resolved "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz" - integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== - -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - -regenerate-unicode-properties@^10.1.0: - version "10.1.1" - resolved "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.1.tgz" - integrity sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q== - dependencies: - regenerate "^1.4.2" - -regenerate@^1.4.2: - version "1.4.2" - resolved "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz" - integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== - -regenerator-runtime@^0.14.0: - version "0.14.0" - resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz" - integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA== - -regenerator-transform@^0.15.2: - version "0.15.2" - resolved "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz" - integrity sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg== - dependencies: - "@babel/runtime" "^7.8.4" - -regexpu-core@^5.3.1: - version "5.3.2" - resolved "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz" - integrity sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ== - dependencies: - "@babel/regjsgen" "^0.8.0" - regenerate "^1.4.2" - regenerate-unicode-properties "^10.1.0" - regjsparser "^0.9.1" - unicode-match-property-ecmascript "^2.0.0" - unicode-match-property-value-ecmascript "^2.1.0" - -regjsparser@^0.9.1: - version "0.9.1" - resolved "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz" - integrity sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ== - dependencies: - jsesc "~0.5.0" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" - integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== - -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz" - integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== - -resolve-cwd@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz" - integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== - dependencies: - resolve-from "^5.0.0" - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -resolve-from@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - -resolve.exports@^2.0.0: - version "2.0.2" - resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz" - integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== - -resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.1: - version "1.22.8" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz" - integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== - dependencies: - is-core-module "^2.13.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - -rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - -rollup@^4.18.1: - version "4.18.1" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.18.1.tgz#18a606df5e76ca53b8a69f2d8eab256d69dda851" - integrity sha512-Elx2UT8lzxxOXMpy5HWQGZqkrQOtrVDDa/bm9l10+U4rQnVzbL/LgZ4NOM1MPIDyHk69W4InuYDF5dzRh4Kw1A== - dependencies: - "@types/estree" "1.0.5" - optionalDependencies: - "@rollup/rollup-android-arm-eabi" "4.18.1" - "@rollup/rollup-android-arm64" "4.18.1" - "@rollup/rollup-darwin-arm64" "4.18.1" - "@rollup/rollup-darwin-x64" "4.18.1" - "@rollup/rollup-linux-arm-gnueabihf" "4.18.1" - "@rollup/rollup-linux-arm-musleabihf" "4.18.1" - "@rollup/rollup-linux-arm64-gnu" "4.18.1" - "@rollup/rollup-linux-arm64-musl" "4.18.1" - "@rollup/rollup-linux-powerpc64le-gnu" "4.18.1" - "@rollup/rollup-linux-riscv64-gnu" "4.18.1" - "@rollup/rollup-linux-s390x-gnu" "4.18.1" - "@rollup/rollup-linux-x64-gnu" "4.18.1" - "@rollup/rollup-linux-x64-musl" "4.18.1" - "@rollup/rollup-win32-arm64-msvc" "4.18.1" - "@rollup/rollup-win32-ia32-msvc" "4.18.1" - "@rollup/rollup-win32-x64-msvc" "4.18.1" - fsevents "~2.3.2" - -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - -safe-buffer@^5.1.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -"safer-buffer@>= 2.1.2 < 3.0.0": - version "2.1.2" - resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -sass@^1.77.8: - version "1.77.8" - resolved "https://registry.yarnpkg.com/sass/-/sass-1.77.8.tgz#9f18b449ea401759ef7ec1752a16373e296b52bd" - integrity sha512-4UHg6prsrycW20fqLGPShtEvo/WyHRVRHwOP4DzkUrObWoWI05QBSfzU71TVB7PFaL104TwNaHpjlWXAZbQiNQ== - dependencies: - chokidar ">=3.0.0 <4.0.0" - immutable "^4.0.0" - source-map-js ">=0.6.2 <2.0.0" - -saxes@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz" - integrity sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA== - dependencies: - xmlchars "^2.2.0" - -select@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/select/-/select-1.1.2.tgz#0e7350acdec80b1108528786ec1d4418d11b396d" - integrity sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA== - -semver@^6.3.0, semver@^6.3.1: - version "6.3.1" - resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" - integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== - -semver@^7.5.3, semver@^7.5.4: - version "7.5.4" - resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz" - integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== - dependencies: - lru-cache "^6.0.0" - -serialize-javascript@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.1.tgz#b206efb27c3da0b0ab6b52f48d170b7996458e5c" - integrity sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w== - dependencies: - randombytes "^2.1.0" - -set-function-length@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz" - integrity sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ== - dependencies: - define-data-property "^1.1.1" - get-intrinsic "^1.2.1" - gopd "^1.0.1" - has-property-descriptors "^1.0.0" - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== - dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" - -signal-exit@^3.0.3, signal-exit@^3.0.7: - version "3.0.7" - resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" - integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== - -sisteransi@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz" - integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== - -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - -smob@^1.0.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/smob/-/smob-1.4.1.tgz#66270e7df6a7527664816c5b577a23f17ba6f5b5" - integrity sha512-9LK+E7Hv5R9u4g4C3p+jjLstaLe11MDsL21UpYaCNmapvMkYhqCV4A/f/3gyH8QjMyh6l68q9xC85vihY9ahMQ== - -sortablejs@^1.15.2: - version "1.15.2" - resolved "https://registry.yarnpkg.com/sortablejs/-/sortablejs-1.15.2.tgz#4e9f7bda4718bd1838add9f1866ec77169149809" - integrity sha512-FJF5jgdfvoKn1MAKSdGs33bIqLi3LmsgVTliuX6iITj834F+JRQZN90Z93yql8h0K2t0RwDPBmxwlbZfDcxNZA== - -"source-map-js@>=0.6.2 <2.0.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.0.tgz#16b809c162517b5b8c3e7dcd315a2a5c2612b2af" - integrity sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg== - -source-map-support@0.5.13: - version "0.5.13" - resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz" - integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-support@~0.5.20: - version "0.5.21" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: - version "0.6.1" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" - integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== - -stack-utils@^2.0.3: - version "2.0.6" - resolved "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz" - integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== - dependencies: - escape-string-regexp "^2.0.0" - -string-length@^4.0.1: - version "4.0.2" - resolved "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz" - integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ== - dependencies: - char-regex "^1.0.2" - strip-ansi "^6.0.0" - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-bom@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz" - integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== - -strip-final-newline@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz" - integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== - -strip-json-comments@^3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -supports-color@^8.0.0: - version "8.1.1" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - -supports-preserve-symlinks-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz" - integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== - -symbol-tree@^3.2.4: - version "3.2.4" - resolved "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz" - integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== - -terser@^5.17.4: - version "5.26.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.26.0.tgz#ee9f05d929f4189a9c28a0feb889d96d50126fe1" - integrity sha512-dytTGoE2oHgbNV9nTzgBEPaqAWvcJNl66VZ0BkJqlvp71IjO8CxdBx/ykCNb47cLnCmCvRZ6ZR0tLkqvZCdVBQ== - dependencies: - "@jridgewell/source-map" "^0.3.3" - acorn "^8.8.2" - commander "^2.20.0" - source-map-support "~0.5.20" - -test-exclude@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz" - integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== - dependencies: - "@istanbuljs/schema" "^0.1.2" - glob "^7.1.4" - minimatch "^3.0.4" - -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== - -tiny-emitter@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz#1d1a56edfc51c43e863cbb5382a72330e3555423" - integrity sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q== - -tinymce@^7.2.1: - version "7.2.1" - resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-7.2.1.tgz#9b4f6b5a0fa647e2953c174ac69aa47483683332" - integrity sha512-ADd1cvdIuq6NWyii0ZOZRuu+9sHIdQfcRNWBcBps2K8vy7OjlRkX6iw7zz1WlL9kY4z4L1DvIP+xOrVX/46aHA== - -tmpl@1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz" - integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== - -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz" - integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -tough-cookie@^4.1.2: - version "4.1.3" - resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz" - integrity sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw== - dependencies: - psl "^1.1.33" - punycode "^2.1.1" - universalify "^0.2.0" - url-parse "^1.5.3" - -tr46@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz" - integrity sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA== - dependencies: - punycode "^2.1.1" - -type-check@^0.4.0, type-check@~0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" - integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== - dependencies: - prelude-ls "^1.2.1" - -type-detect@4.0.8: - version "4.0.8" - resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== - -type-fest@^0.20.2: - version "0.20.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" - integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== - -type-fest@^0.21.3: - version "0.21.3" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz" - integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== - -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - -unicode-canonical-property-names-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz" - integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ== - -unicode-match-property-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz" - integrity sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q== - dependencies: - unicode-canonical-property-names-ecmascript "^2.0.0" - unicode-property-aliases-ecmascript "^2.0.0" - -unicode-match-property-value-ecmascript@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz" - integrity sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA== - -unicode-property-aliases-ecmascript@^2.0.0: - version "2.1.0" - resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz" - integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== - -universalify@^0.2.0: - version "0.2.0" - resolved "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz" - integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== - -update-browserslist-db@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz#7ca61c0d8650766090728046e416a8cde682859e" - integrity sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ== - dependencies: - escalade "^3.1.2" - picocolors "^1.0.1" - -uri-js@^4.2.2: - version "4.4.1" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== - dependencies: - punycode "^2.1.0" - -url-parse@^1.5.3: - version "1.5.10" - resolved "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz" - integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== - dependencies: - querystringify "^2.1.1" - requires-port "^1.0.0" - -url@^0.11.0: - version "0.11.3" - resolved "https://registry.npmjs.org/url/-/url-0.11.3.tgz" - integrity sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw== - dependencies: - punycode "^1.4.1" - qs "^6.11.2" - -v8-to-istanbul@^9.0.1: - version "9.2.0" - resolved "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz" - integrity sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA== - dependencies: - "@jridgewell/trace-mapping" "^0.3.12" - "@types/istanbul-lib-coverage" "^2.0.1" - convert-source-map "^2.0.0" - -w3c-xmlserializer@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz" - integrity sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw== - dependencies: - xml-name-validator "^4.0.0" - -walker@^1.0.8: - version "1.0.8" - resolved "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz" - integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== - dependencies: - makeerror "1.0.12" - -webidl-conversions@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz" - integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== - -whatwg-encoding@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz" - integrity sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg== - dependencies: - iconv-lite "0.6.3" - -whatwg-mimetype@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz" - integrity sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q== - -whatwg-url@^11.0.0: - version "11.0.0" - resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz" - integrity sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ== - dependencies: - tr46 "^3.0.0" - webidl-conversions "^7.0.0" - -which@^2.0.1: - version "2.0.2" - resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== - -write-file-atomic@^4.0.2: - version "4.0.2" - resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz" - integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== - dependencies: - imurmurhash "^0.1.4" - signal-exit "^3.0.7" - -ws@^8.11.0: - version "8.17.1" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" - integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== - -xhr-mock@^2.5.1: - version "2.5.1" - resolved "https://registry.npmjs.org/xhr-mock/-/xhr-mock-2.5.1.tgz" - integrity sha512-UKOjItqjFgPUwQGPmRAzNBn8eTfIhcGjBVGvKYAWxUQPQsXNGD6KEckGTiHwyaAUp9C9igQlnN1Mp79KWCg7CQ== - dependencies: - global "^4.3.0" - url "^0.11.0" - -xml-name-validator@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz" - integrity sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw== - -xmlchars@^2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz" - integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== - -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - -yallist@^3.0.2: - version "3.1.1" - resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yargs-parser@^21.1.1: - version "21.1.1" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz" - integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== - -yargs@^17.3.1: - version "17.7.2" - resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz" - integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== - dependencies: - cliui "^8.0.1" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.3" - y18n "^5.0.5" - yargs-parser "^21.1.1" - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==