PNG  IHDRQgAMA a cHRMz&u0`:pQ<bKGDgmIDATxwUﹻ& ^CX(J I@ "% (** BX +*i"]j(IH{~R)[~>h{}gy)I$Ij .I$I$ʊy@}x.: $I$Ii}VZPC)I$IF ^0ʐJ$I$Q^}{"r=OzI$gRZeC.IOvH eKX $IMpxsk.쒷/&r[޳<v| .I~)@$updYRa$I |M.e JaֶpSYR6j>h%IRز if&uJ)M$I vLi=H;7UJ,],X$I1AҒJ$ XY XzI@GNҥRT)E@;]K*Mw;#5_wOn~\ DC&$(A5 RRFkvIR}l!RytRl;~^ǷJj اy뷦BZJr&ӥ8Pjw~vnv X^(I;4R=P[3]J,]ȏ~:3?[ a&e)`e*P[4]T=Cq6R[ ~ޤrXR Հg(t_HZ-Hg M$ãmL5R uk*`%C-E6/%[t X.{8P9Z.vkXŐKjgKZHg(aK9ڦmKjѺm_ \#$5,)-  61eJ,5m| r'= &ڡd%-]J on Xm|{ RҞe $eڧY XYrԮ-a7RK6h>n$5AVڴi*ֆK)mѦtmr1p| q:흺,)Oi*ֺK)ܬ֦K-5r3>0ԔHjJئEZj,%re~/z%jVMڸmrt)3]J,T K֦OvԒgii*bKiNO~%PW0=dii2tJ9Jݕ{7"I P9JKTbu,%r"6RKU}Ij2HKZXJ,妝 XYrP ެ24c%i^IK|.H,%rb:XRl1X4Pe/`x&P8Pj28Mzsx2r\zRPz4J}yP[g=L) .Q[6RjWgp FIH*-`IMRaK9TXcq*I y[jE>cw%gLRԕiFCj-ďa`#e~I j,%r,)?[gp FI˨mnWX#>mʔ XA DZf9,nKҲzIZXJ,L#kiPz4JZF,I,`61%2s $,VOϚ2/UFJfy7K> X+6 STXIeJILzMfKm LRaK9%|4p9LwJI!`NsiazĔ)%- XMq>pk$-$Q2x#N ؎-QR}ᶦHZډ)J,l#i@yn3LN`;nڔ XuX5pF)m|^0(>BHF9(cզEerJI rg7 4I@z0\JIi䵙RR0s;$s6eJ,`n 䂦0a)S)A 1eJ,堌#635RIgpNHuTH_SԕqVe ` &S)>p;S$魁eKIuX`I4춒o}`m$1":PI<[v9^\pTJjriRŭ P{#{R2,`)e-`mgj~1ϣLKam7&U\j/3mJ,`F;M'䱀 .KR#)yhTq;pcK9(q!w?uRR,n.yw*UXj#\]ɱ(qv2=RqfB#iJmmL<]Y͙#$5 uTU7ӦXR+q,`I}qL'`6Kͷ6r,]0S$- [RKR3oiRE|nӦXR.(i:LDLTJjY%o:)6rxzҒqTJjh㞦I.$YR.ʼnGZ\ֿf:%55 I˼!6dKxm4E"mG_ s? .e*?LRfK9%q#uh$)i3ULRfK9yxm܌bj84$i1U^@Wbm4uJ,ҪA>_Ij?1v32[gLRD96oTaR׿N7%L2 NT,`)7&ƝL*꽙yp_$M2#AS,`)7$rkTA29_Iye"|/0t)$n XT2`YJ;6Jx".e<`$) PI$5V4]29SRI>~=@j]lp2`K9Jaai^" Ԋ29ORI%:XV5]JmN9]H;1UC39NI%Xe78t)a;Oi Ҙ>Xt"~G>_mn:%|~ޅ_+]$o)@ǀ{hgN;IK6G&rp)T2i୦KJuv*T=TOSV>(~D>dm,I*Ɛ:R#ۙNI%D>G.n$o;+#RR!.eU˽TRI28t)1LWϚ>IJa3oFbu&:tJ*(F7y0ZR ^p'Ii L24x| XRI%ۄ>S1]Jy[zL$adB7.eh4%%누>WETf+3IR:I3Xה)3אOۦSRO'ٺ)S}"qOr[B7ϙ.edG)^ETR"RtRݜh0}LFVӦDB^k_JDj\=LS(Iv─aTeZ%eUAM-0;~˃@i|l @S4y72>sX-vA}ϛBI!ݎߨWl*)3{'Y|iSlEڻ(5KtSI$Uv02,~ԩ~x;P4ցCrO%tyn425:KMlD ^4JRxSهF_}شJTS6uj+ﷸk$eZO%G*^V2u3EMj3k%)okI]dT)URKDS 7~m@TJR~荪fT"֛L \sM -0T KfJz+nإKr L&j()[E&I ߴ>e FW_kJR|!O:5/2跌3T-'|zX ryp0JS ~^F>-2< `*%ZFP)bSn"L :)+pʷf(pO3TMW$~>@~ū:TAIsV1}S2<%ޟM?@iT ,Eūoz%i~g|`wS(]oȤ8)$ ntu`өe`6yPl IzMI{ʣzʨ )IZ2= ld:5+請M$-ї;U>_gsY$ÁN5WzWfIZ)-yuXIfp~S*IZdt;t>KūKR|$#LcԀ+2\;kJ`]YǔM1B)UbG"IRߊ<xܾӔJ0Z='Y嵤 Leveg)$znV-º^3Ւof#0Tfk^Zs[*I꯳3{)ˬW4Ւ4 OdpbZRS|*I 55#"&-IvT&/윚Ye:i$ 9{LkuRe[I~_\ؠ%>GL$iY8 9ܕ"S`kS.IlC;Ҏ4x&>u_0JLr<J2(^$5L s=MgV ~,Iju> 7r2)^=G$1:3G< `J3~&IR% 6Tx/rIj3O< ʔ&#f_yXJiގNSz; Tx(i8%#4 ~AS+IjerIUrIj362v885+IjAhK__5X%nV%Iͳ-y|7XV2v4fzo_68"S/I-qbf; LkF)KSM$ Ms>K WNV}^`-큧32ŒVؙGdu,^^m%6~Nn&͓3ŒVZMsRpfEW%IwdǀLm[7W&bIRL@Q|)* i ImsIMmKmyV`i$G+R 0tV'!V)֏28vU7͒vHꦼtxꗞT ;S}7Mf+fIRHNZUkUx5SAJㄌ9MqμAIRi|j5)o*^'<$TwI1hEU^c_j?Е$%d`z cyf,XO IJnTgA UXRD }{H}^S,P5V2\Xx`pZ|Yk:$e ~ @nWL.j+ϝYb퇪bZ BVu)u/IJ_ 1[p.p60bC >|X91P:N\!5qUB}5a5ja `ubcVxYt1N0Zzl4]7­gKj]?4ϻ *[bg$)+À*x쳀ogO$~,5 زUS9 lq3+5mgw@np1sso Ӻ=|N6 /g(Wv7U;zωM=wk,0uTg_`_P`uz?2yI!b`kĸSo+Qx%!\οe|އԁKS-s6pu_(ֿ$i++T8=eY; צP+phxWQv*|p1. ά. XRkIQYP,drZ | B%wP|S5`~́@i޾ E;Չaw{o'Q?%iL{u D?N1BD!owPHReFZ* k_-~{E9b-~P`fE{AܶBJAFO wx6Rox5 K5=WwehS8 (JClJ~ p+Fi;ŗo+:bD#g(C"wA^ r.F8L;dzdIHUX݆ϞXg )IFqem%I4dj&ppT{'{HOx( Rk6^C٫O.)3:s(۳(Z?~ٻ89zmT"PLtw䥈5&b<8GZ-Y&K?e8,`I6e(֍xb83 `rzXj)F=l($Ij 2*(F?h(/9ik:I`m#p3MgLaKjc/U#n5S# m(^)=y=đx8ŬI[U]~SцA4p$-F i(R,7Cx;X=cI>{Km\ o(Tv2vx2qiiDJN,Ҏ!1f 5quBj1!8 rDFd(!WQl,gSkL1Bxg''՞^ǘ;pQ P(c_ IRujg(Wz bs#P­rz> k c&nB=q+ؔXn#r5)co*Ũ+G?7< |PQӣ'G`uOd>%Mctz# Ԫڞ&7CaQ~N'-P.W`Oedp03C!IZcIAMPUۀ5J<\u~+{9(FbbyAeBhOSܳ1 bÈT#ŠyDžs,`5}DC-`̞%r&ڙa87QWWp6e7 Rϫ/oY ꇅ Nܶըtc!LA T7V4Jsū I-0Pxz7QNF_iZgúWkG83 0eWr9 X]㾮݁#Jˢ C}0=3ݱtBi]_ &{{[/o[~ \q鯜00٩|cD3=4B_b RYb$óBRsf&lLX#M*C_L܄:gx)WΘsGSbuL rF$9';\4Ɍq'n[%p.Q`u hNb`eCQyQ|l_C>Lb꟟3hSb #xNxSs^ 88|Mz)}:](vbۢamŖ࿥ 0)Q7@0=?^k(*J}3ibkFn HjB׻NO z x}7p 0tfDX.lwgȔhԾŲ }6g E |LkLZteu+=q\Iv0쮑)QٵpH8/2?Σo>Jvppho~f>%bMM}\//":PTc(v9v!gոQ )UfVG+! 35{=x\2+ki,y$~A1iC6#)vC5^>+gǵ@1Hy٪7u;p psϰu/S <aʸGu'tD1ԝI<pg|6j'p:tպhX{o(7v],*}6a_ wXRk,O]Lܳ~Vo45rp"N5k;m{rZbΦ${#)`(Ŵg,;j%6j.pyYT?}-kBDc3qA`NWQū20/^AZW%NQ MI.X#P#,^Ebc&?XR tAV|Y.1!؅⨉ccww>ivl(JT~ u`ٵDm q)+Ri x/x8cyFO!/*!/&,7<.N,YDŽ&ܑQF1Bz)FPʛ?5d 6`kQձ λc؎%582Y&nD_$Je4>a?! ͨ|ȎWZSsv8 j(I&yj Jb5m?HWp=g}G3#|I,5v珿] H~R3@B[☉9Ox~oMy=J;xUVoj bUsl_35t-(ՃɼRB7U!qc+x4H_Qo֮$[GO<4`&č\GOc[.[*Af%mG/ ňM/r W/Nw~B1U3J?P&Y )`ѓZ1p]^l“W#)lWZilUQu`-m|xĐ,_ƪ|9i:_{*(3Gѧ}UoD+>m_?VPۅ15&}2|/pIOʵ> GZ9cmíتmnz)yߐbD >e}:) r|@R5qVSA10C%E_'^8cR7O;6[eKePGϦX7jb}OTGO^jn*媓7nGMC t,k31Rb (vyܴʭ!iTh8~ZYZp(qsRL ?b}cŨʊGO^!rPJO15MJ[c&~Z`"ѓޔH1C&^|Ш|rʼ,AwĴ?b5)tLU)F| &g٣O]oqSUjy(x<Ϳ3 .FSkoYg2 \_#wj{u'rQ>o;%n|F*O_L"e9umDds?.fuuQbIWz |4\0 sb;OvxOSs; G%T4gFRurj(֍ڑb uԖKDu1MK{1^ q; C=6\8FR艇!%\YÔU| 88m)֓NcLve C6z;o&X x59:q61Z(T7>C?gcļxѐ Z oo-08jہ x,`' ҔOcRlf~`jj".Nv+sM_]Zk g( UOPyεx%pUh2(@il0ݽQXxppx-NS( WO+轾 nFߢ3M<;z)FBZjciu/QoF 7R¥ ZFLF~#ȣߨ^<쩡ݛкvџ))ME>ώx4m#!-m!L;vv#~Y[đKmx9.[,UFS CVkZ +ߟrY٧IZd/ioi$%͝ب_ֶX3ܫhNU ZZgk=]=bbJS[wjU()*I =ώ:}-蹞lUj:1}MWm=̛ _ ¾,8{__m{_PVK^n3esw5ӫh#$-q=A̟> ,^I}P^J$qY~Q[ Xq9{#&T.^GVj__RKpn,b=`żY@^՝;z{paVKkQXj/)y TIc&F;FBG7wg ZZDG!x r_tƢ!}i/V=M/#nB8 XxЫ ^@CR<{䤭YCN)eKOSƟa $&g[i3.C6xrOc8TI;o hH6P&L{@q6[ Gzp^71j(l`J}]e6X☉#͕ ׈$AB1Vjh㭦IRsqFBjwQ_7Xk>y"N=MB0 ,C #o6MRc0|$)ف"1!ixY<B9mx `,tA>)5ػQ?jQ?cn>YZe Tisvh# GMމȇp:ԴVuږ8ɼH]C.5C!UV;F`mbBk LTMvPʍϤj?ԯ/Qr1NB`9s"s TYsz &9S%U԰> {<ؿSMxB|H\3@!U| k']$U+> |HHMLޢ?V9iD!-@x TIî%6Z*9X@HMW#?nN ,oe6?tQwڱ.]-y':mW0#!J82qFjH -`ѓ&M0u Uγmxϵ^-_\])@0Rt.8/?ٰCY]x}=sD3ojަЫNuS%U}ԤwHH>ڗjܷ_3gN q7[q2la*ArǓԖ+p8/RGM ]jacd(JhWko6ڎbj]i5Bj3+3!\j1UZLsLTv8HHmup<>gKMJj0@H%,W΃7R) ">c, xixј^ aܖ>H[i.UIHc U1=yW\=S*GR~)AF=`&2h`DzT󑓶J+?W+}C%P:|0H܆}-<;OC[~o.$~i}~HQ TvXΈr=b}$vizL4:ȰT|4~*!oXQR6Lk+#t/g lԁߖ[Jڶ_N$k*". xsxX7jRVbAAʯKҎU3)zSNN _'s?f)6X!%ssAkʱ>qƷb hg %n ~p1REGMHH=BJiy[<5 ǁJҖgKR*倳e~HUy)Ag,K)`Vw6bRR:qL#\rclK/$sh*$ 6덤 KԖc 3Z9=Ɣ=o>X Ώ"1 )a`SJJ6k(<c e{%kϊP+SL'TcMJWRm ŏ"w)qc ef꒵i?b7b('"2r%~HUS1\<(`1Wx9=8HY9m:X18bgD1u ~|H;K-Uep,, C1 RV.MR5άh,tWO8WC$ XRVsQS]3GJ|12 [vM :k#~tH30Rf-HYݺ-`I9%lIDTm\ S{]9gOڒMNCV\G*2JRŨ;Rҏ^ڽ̱mq1Eu?To3I)y^#jJw^Ńj^vvlB_⋌P4x>0$c>K†Aļ9s_VjTt0l#m>E-,,x,-W)سo&96RE XR.6bXw+)GAEvL)͞K4$p=Ũi_ѱOjb HY/+@θH9޼]Nԥ%n{ &zjT? Ty) s^ULlb,PiTf^<À] 62R^V7)S!nllS6~͝V}-=%* ʻ>G DnK<y&>LPy7'r=Hj 9V`[c"*^8HpcO8bnU`4JȪAƋ#1_\ XϘHPRgik(~G~0DAA_2p|J묭a2\NCr]M_0 ^T%e#vD^%xy-n}-E\3aS%yN!r_{ )sAw ڼp1pEAk~v<:`'ӭ^5 ArXOI驻T (dk)_\ PuA*BY]yB"l\ey hH*tbK)3 IKZ򹞋XjN n *n>k]X_d!ryBH ]*R 0(#'7 %es9??ښFC,ՁQPjARJ\Ρw K#jahgw;2$l*) %Xq5!U᢯6Re] |0[__64ch&_}iL8KEgҎ7 M/\`|.p,~`a=BR?xܐrQ8K XR2M8f ?`sgWS%" Ԉ 7R%$ N}?QL1|-эټwIZ%pvL3Hk>,ImgW7{E xPHx73RA @RS CC !\ȟ5IXR^ZxHл$Q[ŝ40 (>+ _C >BRt<,TrT {O/H+˟Pl6 I B)/VC<6a2~(XwV4gnXR ϱ5ǀHٻ?tw똤Eyxp{#WK qG%5],(0ӈH HZ])ג=K1j&G(FbM@)%I` XRg ʔ KZG(vP,<`[ Kn^ SJRsAʠ5xՅF`0&RbV tx:EaUE/{fi2;.IAwW8/tTxAGOoN?G}l L(n`Zv?pB8K_gI+ܗ #i?ޙ.) p$utc ~DžfՈEo3l/)I-U?aԅ^jxArA ΧX}DmZ@QLےbTXGd.^|xKHR{|ΕW_h] IJ`[G9{).y) 0X YA1]qp?p_k+J*Y@HI>^?gt.06Rn ,` ?);p pSF9ZXLBJPWjgQ|&)7! HjQt<| ؅W5 x W HIzYoVMGP Hjn`+\(dNW)F+IrS[|/a`K|ͻ0Hj{R,Q=\ (F}\WR)AgSG`IsnAR=|8$}G(vC$)s FBJ?]_u XRvύ6z ŨG[36-T9HzpW̞ú Xg큽=7CufzI$)ki^qk-) 0H*N` QZkk]/tnnsI^Gu't=7$ Z;{8^jB% IItRQS7[ϭ3 $_OQJ`7!]W"W,)Iy W AJA;KWG`IY{8k$I$^%9.^(`N|LJ%@$I}ֽp=FB*xN=gI?Q{٥4B)mw $Igc~dZ@G9K X?7)aK%݅K$IZ-`IpC U6$I\0>!9k} Xa IIS0H$I H ?1R.Чj:4~Rw@p$IrA*u}WjWFPJ$I➓/6#! LӾ+ X36x8J |+L;v$Io4301R20M I$-E}@,pS^ޟR[/s¹'0H$IKyfŸfVOπFT*a$I>He~VY/3R/)>d$I>28`Cjw,n@FU*9ttf$I~<;=/4RD~@ X-ѕzἱI$: ԍR a@b X{+Qxuq$IЛzo /~3\8ڒ4BN7$IҀj V]n18H$IYFBj3̵̚ja pp $Is/3R Ӻ-Yj+L;.0ŔI$Av? #!5"aʄj}UKmɽH$IjCYs?h$IDl843.v}m7UiI=&=0Lg0$I4: embe` eQbm0u? $IT!Sƍ'-sv)s#C0:XB2a w I$zbww{."pPzO =Ɔ\[ o($Iaw]`E).Kvi:L*#gР7[$IyGPI=@R 4yR~̮´cg I$I/<tPͽ hDgo 94Z^k盇΄8I56^W$I^0̜N?4*H`237}g+hxoq)SJ@p|` $I%>-hO0eO>\ԣNߌZD6R=K ~n($I$y3D>o4b#px2$yڪtzW~a $I~?x'BwwpH$IZݑnC㧄Pc_9sO gwJ=l1:mKB>Ab<4Lp$Ib o1ZQ@85b̍ S'F,Fe,^I$IjEdù{l4 8Ys_s Z8.x m"+{~?q,Z D!I$ϻ'|XhB)=…']M>5 rgotԎ 獽PH$IjIPhh)n#cÔqA'ug5qwU&rF|1E%I$%]!'3AFD/;Ck_`9 v!ٴtPV;x`'*bQa w I$Ix5 FC3D_~A_#O݆DvV?<qw+I$I{=Z8".#RIYyjǪ=fDl9%M,a8$I$Ywi[7ݍFe$s1ՋBVA?`]#!oz4zjLJo8$I$%@3jAa4(o ;p,,dya=F9ً[LSPH$IJYЉ+3> 5"39aZ<ñh!{TpBGkj}Sp $IlvF.F$I z< '\K*qq.f<2Y!S"-\I$IYwčjF$ w9 \ߪB.1v!Ʊ?+r:^!I$BϹB H"B;L'G[ 4U#5>੐)|#o0aڱ$I>}k&1`U#V?YsV x>{t1[I~D&(I$I/{H0fw"q"y%4 IXyE~M3 8XψL}qE$I[> nD?~sf ]o΁ cT6"?'_Ἣ $I>~.f|'!N?⟩0G KkXZE]ޡ;/&?k OۘH$IRۀwXӨ<7@PnS04aӶp.:@\IWQJ6sS%I$e5ڑv`3:x';wq_vpgHyXZ 3gЂ7{{EuԹn±}$I$8t;b|591nءQ"P6O5i }iR̈́%Q̄p!I䮢]O{H$IRϻ9s֧ a=`- aB\X0"+5"C1Hb?߮3x3&gşggl_hZ^,`5?ߎvĸ%̀M!OZC2#0x LJ0 Gw$I$I}<{Eb+y;iI,`ܚF:5ܛA8-O-|8K7s|#Z8a&><a&/VtbtLʌI$I$I$I$I$I$IRjDD%tEXtdate:create2022-05-31T04:40:26+00:00!Î%tEXtdate:modify2022-05-31T04:40:26+00:00|{2IENDB`Mini Shell

HOME


Mini Shell 1.0
DIR:/home/htlwork.com/www/costmaster12/assets/plugins/
Upload File :
Current File : /home/htlwork.com/www/costmaster12/assets/plugins/tinymce.bundle.js
!function(){"use strict";var t=function(t){if(null===t)return"null";if(void 0===t)return"undefined";var e=typeof t;return"object"==e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},e=function(t){return{eq:t}},n=e((function(t,e){return t===e})),r=function(t){return e((function(e,n){if(e.length!==n.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!t.eq(e[o],n[o]))return!1;return!0}))},o=function(t,n){return o=r(t),i=function(t){return e=t,r=n,Array.prototype.slice.call(e).sort(r);var e,r},e((function(t,e){return o.eq(i(t),i(e))}));var o,i},i=function(t){return e((function(e,r){var i=Object.keys(e),u=Object.keys(r);if(!o(n).eq(i,u))return!1;for(var a=i.length,c=0;c<a;c++){var s=i[c];if(!t.eq(e[s],r[s]))return!1}return!0}))},u=e((function(e,n){if(e===n)return!0;var o=t(e);return o===t(n)&&(-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(o)?e===n:"array"===o?r(u).eq(e,n):"object"===o&&i(u).eq(e,n))})),a=function(){},c=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},s=function(t){return function(){return t}},f=function(t){return t};function l(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var d,m,g,p=function(t){return function(e){return!t(e)}},h=function(t){return function(){throw new Error(t)}},v=function(t){t()},b=s(!1),y=s(!0),x=function(){return w},w=(d=function(t){return t.isNone()},{fold:function(t,e){return t()},is:b,isSome:b,isNone:y,getOr:g=function(t){return t},getOrThunk:m=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:s(null),getOrUndefined:s(void 0),or:g,orThunk:m,map:x,each:a,bind:x,exists:b,forall:y,filter:x,equals:d,equals_:d,toArray:function(){return[]},toString:s("none()")}),C=function(t){var e=s(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:y,isNone:b,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return C(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:w},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(b,(function(e){return n(t,e)}))}};return o},S={some:C,none:x,from:function(t){return null==t?w:C(t)}},k=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"==r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},O=function(t){return function(e){return typeof e===t}},_=function(t){return function(e){return t===e}},E=k("string"),T=k("object"),A=k("array"),B=_(null),N=O("boolean"),D=_(void 0),R=function(t){return null==t},M=function(t){return!R(t)},I=O("function"),P=O("number"),F=Array.prototype.slice,L=Array.prototype.indexOf,V=Array.prototype.push,H=function(t,e){return L.call(t,e)},z=function(t,e){return-1<H(t,e)},j=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},U=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},W=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},q=function(t,e){for(var n=t.length-1;0<=n;n--)e(t[n],n)},G=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},$=function(t,e,n){return q(t,(function(t){n=e(n,t)})),n},X=function(t,e,n){return W(t,(function(t){n=e(n,t)})),n},Y=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return S.some(i);if(n(i,r))break}return S.none()}(t,e,b)},K=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return S.some(n);return S.none()},J=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!A(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);V.apply(e,t[n])}return e}(U(t,e))},Q=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},Z=function(t){var e=F.call(t,0);return e.reverse(),e},tt=function(t,e){return G(t,(function(t){return!z(e,t)}))},et=function(t,e){return 0<=e&&e<t.length?S.some(t[e]):S.none()},nt=function(t){return et(t,0)},rt=function(t){return et(t,t.length-1)},ot=I(Array.from)?Array.from:function(t){return F.call(t)},it=Object.keys,ut=Object.hasOwnProperty,at=function(t,e){for(var n=it(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},ct=function(t,e){return st(t,(function(t,n){return{k:n,v:e(t,n)}}))},st=function(t,e){var n={};return at(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},ft=function(t){return function(e,n){t[n]=e}},lt=function(t,e,n,r){return at(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},dt=function(t,e){var n={},r={};return lt(t,e,ft(n),ft(r)),{t:n,f:r}},mt=function(t,e){var n={};return lt(t,e,ft(n),a),n},gt=function(t,e){return pt(t,e)?S.from(t[e]):S.none()},pt=function(t,e){return ut.call(t,e)},ht=function(t,e){return pt(t,e)&&void 0!==t[e]&&null!==t[e]},vt=Array.isArray,bt=function(t,e,n){var r,o;if(!t)return!1;if(n=n||t,void 0!==t.length){for(r=0,o=t.length;r<o;r++)if(!1===e.call(n,t[r],r,t))return!1}else for(r in t)if(t.hasOwnProperty(r)&&!1===e.call(n,t[r],r,t))return!1;return!0},yt=function(t,e){var n=[];return bt(t,(function(r,o){n.push(e(r,o,t))})),n},xt=function(t,e){var n=[];return bt(t,(function(r,o){e&&!e(r,o,t)||n.push(r)})),n},wt=function(t,e){if(t)for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},Ct=function(t,e,n,r){for(var o=D(n)?t[0]:n,i=0;i<t.length;i++)o=e.call(r,o,t[i],i);return o},St=function(t,e,n){for(var r=0,o=t.length;r<o;r++)if(e.call(n,t[r],r,t))return r;return-1},kt=function(t){return t[t.length-1]},Ot=function(){return(Ot=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function _t(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}var Et,Tt,At,Bt,Nt,Dt,Rt=function(){return Mt(0,0)},Mt=function(t,e){return{major:t,minor:e}},It=function(t,e){var n=String(e).toLowerCase();return 0===t.length?Rt():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Mt(r(1),r(2))}(t,n)},Pt=Rt,Ft=function(t,e){var n=String(e).toLowerCase();return Y(t,(function(t){return t.search(n)}))},Lt=function(t,e){return-1!==t.indexOf(e)},Vt=function(t,e){return n=t,0,""===(r=e)||n.length>=r.length&&n.substr(0,0+r.length)===r;var n,r},Ht=function(t){return function(e){return e.replace(t,"")}},zt=Ht(/^\s+|\s+$/g),jt=Ht(/^\s+/g),Ut=Ht(/\s+$/g),Wt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,qt=function(t){return function(e){return Lt(e,t)}},Gt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Lt(t,"edge/")&&Lt(t,"chrome")&&Lt(t,"safari")&&Lt(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Wt],search:function(t){return Lt(t,"chrome")&&!Lt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Lt(t,"msie")||Lt(t,"trident")}},{name:"Opera",versionRegexes:[Wt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:qt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:qt("firefox")},{name:"Safari",versionRegexes:[Wt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Lt(t,"safari")||Lt(t,"mobile/"))&&Lt(t,"applewebkit")}}],$t=[{name:"Windows",search:qt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Lt(t,"iphone")||Lt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:qt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:qt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:qt("linux"),versionRegexes:[]},{name:"Solaris",search:qt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:qt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:qt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Xt={browsers:s(Gt),oses:s($t)},Yt="Firefox",Kt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r(Yt),isSafari:r("Safari")}},Jt=function(){return Kt({current:void 0,version:Pt()})},Qt=Kt,Zt=(s("Edge"),s("Chrome"),s("IE"),s("Opera"),s(Yt),s("Safari"),"Windows"),te="Android",ee="Solaris",ne="FreeBSD",re="ChromeOS",oe=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Zt),isiOS:r("iOS"),isAndroid:r(te),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r(ee),isFreeBSD:r(ne),isChromeOS:r(re)}},ie=function(){return oe({current:void 0,version:Pt()})},ue=oe,ae=(s(Zt),s("iOS"),s(te),s("Linux"),s("OSX"),s(ee),s(ne),s(re),function(t,e){var n,r,o,i,u,a,c,f,l,d,m,g,p=Xt.browsers(),h=Xt.oses(),v=function(t,e){return Ft(t,e).map((function(t){var n=It(t.versionRegexes,e);return{current:t.name,version:n}}))}(p,t).fold(Jt,Qt),b=function(t,e){return Ft(t,e).map((function(t){var n=It(t.versionRegexes,e);return{current:t.name,version:n}}))}(h,t).fold(ie,ue);return{browser:v,os:b,deviceType:(r=v,o=t,i=e,u=(n=b).isiOS()&&!0===/ipad/i.test(o),a=n.isiOS()&&!u,c=n.isiOS()||n.isAndroid(),f=c||i("(pointer:coarse)"),l=u||!a&&c&&i("(min-device-width:768px)"),d=a||c&&!l,m=r.isSafari()&&n.isiOS()&&!1===/safari/i.test(o),g=!d&&!l&&!m,{isiPad:s(u),isiPhone:s(a),isTablet:s(l),isPhone:s(d),isTouch:s(f),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:s(m),isDesktop:s(g)})}}),ce=function(t){return window.matchMedia(t).matches},se=(At=!(Et=function(){return ae(navigator.userAgent,ce)}),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return At||(At=!0,Tt=Et.apply(null,t)),Tt}),fe=function(){return se()},le=navigator.userAgent,de=fe(),me=de.browser,ge=de.os,pe=de.deviceType,he=/WebKit/.test(le)&&!me.isEdge(),ve="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,be=-1!==le.indexOf("Windows Phone"),ye={opera:me.isOpera(),webkit:he,ie:!(!me.isIE()&&!me.isEdge())&&me.version.major,gecko:me.isFirefox(),mac:ge.isOSX()||ge.isiOS(),iOS:pe.isiPad()||pe.isiPhone(),android:ge.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:me.isIE()?document.documentMode||7:10,fileApi:ve,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!me.isIE(),desktop:pe.isDesktop(),windowsPhone:be,browser:{current:me.current,version:me.version,isChrome:me.isChrome,isEdge:me.isEdge,isFirefox:me.isFirefox,isIE:me.isIE,isOpera:me.isOpera,isSafari:me.isSafari},os:{current:ge.current,version:ge.version,isAndroid:ge.isAndroid,isChromeOS:ge.isChromeOS,isFreeBSD:ge.isFreeBSD,isiOS:ge.isiOS,isLinux:ge.isLinux,isOSX:ge.isOSX,isSolaris:ge.isSolaris,isWindows:ge.isWindows},deviceType:{isDesktop:pe.isDesktop,isiPad:pe.isiPad,isiPhone:pe.isiPhone,isPhone:pe.isPhone,isTablet:pe.isTablet,isTouch:pe.isTouch,isWebView:pe.isWebView}},xe=/^\s*|\s*$/g,we=function(t){return null==t?"":(""+t).replace(xe,"")},Ce=function(t,e){return e?!("array"!==e||!vt(t))||typeof t===e:void 0!==t},Se=function(t,e,n,r){r=r||this,t&&(n&&(t=t[n]),bt(t,(function(t,o){return!1!==e.call(r,t,o,n)&&void Se(t,e,n,r)})))},ke={trim:we,isArray:vt,is:Ce,toArray:function(t){if(vt(t))return t;for(var e=[],n=0,r=t.length;n<r;n++)e[n]=t[n];return e},makeMap:function(t,e,n){var r;for(e=e||",","string"==typeof(t=t||[])&&(t=t.split(e)),n=n||{},r=t.length;r--;)n[t[r]]={};return n},each:bt,map:yt,grep:xt,inArray:wt,hasOwn:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},extend:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var o,i=e[r];for(var u in i)!i.hasOwnProperty(u)||void 0!==(o=i[u])&&(t[u]=o)}return t},create:function(t,e,n){var r,o,i,u=this,a=0,c=(t=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(t))[3].match(/(^|\.)(\w+)$/i)[2],s=u.createNS(t[3].replace(/\.\w+$/,""),n);if(!s[c]){if("static"===t[2])return s[c]=e,void(this.onCreate&&this.onCreate(t[2],t[3],s[c]));e[c]||(e[c]=function(){},a=1),s[c]=e[c],u.extend(s[c].prototype,e),t[5]&&(r=u.resolve(t[5]).prototype,o=t[5].match(/\.(\w+)$/i)[1],i=s[c],s[c]=a?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},s[c].prototype[c]=s[c],u.each(r,(function(t,e){s[c].prototype[e]=r[e]})),u.each(e,(function(t,e){r[e]?s[c].prototype[e]=function(){return this.parent=r[e],t.apply(this,arguments)}:e!==c&&(s[c].prototype[e]=t)}))),u.each(e.static,(function(t,e){s[c][e]=t}))}},walk:Se,createNS:function(t,e){var n,r;for(e=e||window,t=t.split("."),n=0;n<t.length;n++)e[r=t[n]]||(e[r]={}),e=e[r];return e},resolve:function(t,e){var n,r;for(e=e||window,n=0,r=(t=t.split(".")).length;n<r&&(e=e[t[n]]);n++);return e},explode:function(t,e){return!t||Ce(t,"array")?t:yt(t.split(e||","),we)},_addCacheSuffix:function(t){var e=ye.cacheSuffix;return e&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t}},Oe=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},_e=function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Oe(n.childNodes[0])},Ee=function(t,e){var n=(e||document).createElement(t);return Oe(n)},Te=function(t,e){var n=(e||document).createTextNode(t);return Oe(n)},Ae=Oe,Be=function(t,e){for(var n=[],r=function(t){return n.push(t),e(t)},o=e(t);(o=o.bind(r)).isSome(););return n},Ne=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},De=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Re=function(t,e){return t.dom===e.dom},Me=function(t,e){return fe().browser.isIE()?function(t,e){return n=t.dom,r=e.dom,o=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(n.compareDocumentPosition(r)&o);var n,r,o}(t,e):(n=e,(r=t.dom)!==(o=n.dom)&&r.contains(o));var n,r,o},Ie=("undefined"!=typeof window||Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),Pe=function(t){return t.dom.nodeType},Fe=function(t){return function(e){return Pe(e)===t}},Le=Fe(1),Ve=Fe(3),He=Fe(9),ze=Fe(11),je=function(t){return Ae(t.dom.ownerDocument)},Ue=function(t){return He(t)?t:je(t)},We=function(t){return Ae(Ue(t).dom.defaultView)},qe=function(t){return S.from(t.dom.parentNode).map(Ae)},Ge=function(t){return S.from(t.dom.previousSibling).map(Ae)},$e=function(t){return S.from(t.dom.nextSibling).map(Ae)},Xe=function(t){return Z(Be(t,Ge))},Ye=function(t){return Be(t,$e)},Ke=function(t){return U(t.dom.childNodes,Ae)},Je=function(t,e){var n=t.dom.childNodes;return S.from(n[e]).map(Ae)},Qe=function(t){return Je(t,0)},Ze=function(t){return Je(t,t.dom.childNodes.length-1)},tn=function(t){return ze(t)},en=I(Element.prototype.attachShadow)&&I(Node.prototype.getRootNode),nn=s(en),rn=en?function(t){return Ae(t.dom.getRootNode())}:Ue,on=function(t){return tn(t)?t:function(t){var e=t.dom.head;if(null==e)throw new Error("Head is not available yet");return Ae(e)}(Ue(t))},un=function(t){return Ae(t.dom.host)},an=function(t,e){qe(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},cn=function(t,e){$e(t).fold((function(){qe(t).each((function(t){fn(t,e)}))}),(function(t){an(t,e)}))},sn=function(t,e){Qe(t).fold((function(){fn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},fn=function(t,e){t.dom.appendChild(e.dom)},ln=function(t,e){W(e,(function(e){fn(t,e)}))},dn=function(t){t.dom.textContent="",W(Ke(t),(function(t){mn(t)}))},mn=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},gn=function(t){var e,n=Ke(t);0<n.length&&(e=t,W(n,(function(t){an(e,t)}))),mn(t)},pn=function(t){var e=Ve(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o,i,u=e.ownerDocument;return o=Ae(e),i=rn(o),(tn(i)?S.some(i):S.none()).fold((function(){return u.body.contains(e)}),(n=pn,r=un,function(t){return n(r(t))}))},hn=function(t,e){return{left:t,top:e,translate:function(n,r){return hn(t+n,e+r)}}},vn=hn,bn=function(t,e){return void 0!==t?t:void 0!==e?e:0},yn=function(t){var e,n=t.dom,r=n.ownerDocument.body;return r===n?vn(r.offsetLeft,r.offsetTop):pn(t)?(e=n.getBoundingClientRect(),vn(e.left,e.top)):vn(0,0)},xn=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return vn(n,r)},wn=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},Cn=function(t,e){fe().browser.isSafari()&&I(t.dom.scrollIntoViewIfNeeded)?t.dom.scrollIntoViewIfNeeded(!1):t.dom.scrollIntoView(e)},Sn=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},kn=function(t){var e,n,r=void 0===t?window:t,o=r.document,i=xn(Ae(o));return n=void 0===(e=r)?window:e,S.from(n.visualViewport).fold((function(){var t=r.document.documentElement,e=t.clientWidth,n=t.clientHeight;return Sn(i.left,i.top,e,n)}),(function(t){return Sn(Math.max(t.pageLeft,i.left),Math.max(t.pageTop,i.top),t.width,t.height)}))},On=function(t){return function(e){return!!e&&e.nodeType===t}},_n=function(t){return!!t&&!Object.getPrototypeOf(t)},En=On(1),Tn=function(t){var e=t.map((function(t){return t.toLowerCase()}));return function(t){if(t&&t.nodeName){var n=t.nodeName.toLowerCase();return z(e,n)}return!1}},An=function(t,e){var n=e.toLowerCase().split(" ");return function(e){var r;if(En(e))for(r=0;r<n.length;r++){var o=e.ownerDocument.defaultView.getComputedStyle(e,null);if((o?o.getPropertyValue(t):null)===n[r])return!0}return!1}},Bn=function(t){return function(e){return En(e)&&e.hasAttribute(t)}},Nn=function(t){return En(t)&&t.hasAttribute("data-mce-bogus")},Dn=function(t){return En(t)&&"TABLE"===t.tagName},Rn=function(t){return function(e){if(En(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Mn=Tn(["textarea","input"]),In=On(3),Pn=On(8),Fn=On(9),Ln=On(11),Vn=Tn(["br"]),Hn=Tn(["img"]),zn=Rn("true"),jn=Rn("false"),Un=Tn(["td","th"]),Wn=Tn(["video","audio","object","embed"]),qn=function(t){return void 0!==t.style&&I(t.style.getPropertyValue)},Gn=function(t,e,n){if(!(E(n)||N(n)||P(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},$n=function(t,e,n){Gn(t.dom,e,n)},Xn=function(t,e){var n=t.dom;at(e,(function(t,e){Gn(n,e,t)}))},Yn=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Kn=function(t,e){return S.from(Yn(t,e))},Jn=function(t,e){t.dom.removeAttribute(e)},Qn=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||pn(t)?r:Zn(n,e)},Zn=function(t,e){return qn(t)?t.style.getPropertyValue(e):""},tr=function(t,e){var n=t.dom,r=Zn(n,e);return S.from(r).filter((function(t){return 0<t.length}))},er=function(t){var e={},n=t.dom;if(qn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},nr=fe().browser,rr=function(t){return Y(t,Le)},or=function(t,e){return t.children&&z(t.children,e)},ir={},ur={exports:ir};Bt=void 0,Nt=ir,Dt=ur,function(t){"object"==typeof Nt&&void 0!==Dt?Dt.exports=t():"function"==typeof Bt&&Bt.amd?Bt([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}((function(){return function t(e,n,r){function o(u,a){if(!n[u]){if(!e[u]){var c=!1;if(!a&&c)return c(u,!0);if(i)return i(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var f=n[u]={exports:{}};e[u][0].call(f.exports,(function(t){return o(e[u][1][t]||t)}),f,f.exports,t,e,n,r)}return n[u].exports}for(var i=!1,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var s,f=[],l=!1,d=-1;function m(){l&&s&&(l=!1,s.length?f=s.concat(f):d=-1,f.length&&g())}function g(){if(!l){var t=c(m);l=!0;for(var e=f.length;e;){for(s=f,f=[];++d<e;)s&&s[d].run();d=-1,e=f.length}s=null,l=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function h(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];f.push(new p(t,e)),1!==f.length||l||c(g)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){function n(){}function r(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],s(t,this)}function o(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,r._immediateFn((function(){var n,r=1===t._state?e.onFulfilled:e.onRejected;if(null!==r){try{n=r(t._value)}catch(t){return void u(e.promise,t)}i(e.promise,n)}else(1===t._state?i:u)(e.promise,t._value)}))):t._deferreds.push(e)}function i(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof r)return t._state=3,t._value=e,void a(t);if("function"==typeof n)return void s((o=n,i=e,function(){o.apply(i,arguments)}),t)}t._state=1,t._value=e,a(t)}catch(e){u(t,e)}var o,i}function u(t,e){t._state=2,t._value=e,a(t)}function a(t){2===t._state&&0===t._deferreds.length&&r._immediateFn((function(){t._handled||r._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)o(t,t._deferreds[e]);t._deferreds=null}function c(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function s(t,e){var n=!1;try{t((function(t){n||(n=!0,i(e,t))}),(function(t){n||(n=!0,u(e,t))}))}catch(t){if(n)return;n=!0,u(e,t)}}var f;f=setTimeout,r.prototype.catch=function(t){return this.then(null,t)},r.prototype.then=function(t,e){var r=new this.constructor(n);return o(this,new c(t,e,r)),r},r.all=function(t){var e=Array.prototype.slice.call(t);return new r((function(t,n){if(0===e.length)return t([]);for(var r=e.length,o=0;o<e.length;o++)!function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0==--r&&t(e)}catch(t){n(t)}}(o,e[o])}))},r.resolve=function(t){return t&&"object"==typeof t&&t.constructor===r?t:new r((function(e){e(t)}))},r.reject=function(t){return new r((function(e,n){n(t)}))},r.race=function(t){return new r((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},r._immediateFn="function"==typeof t?function(e){t(e)}:function(t){f(t,0)},r._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},r._setImmediateFn=function(t){r._immediateFn=t},r._setUnhandledRejectionFn=function(t){r._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=r:this.Promise||(this.Promise=r)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,u=Array.prototype.slice,a={},c=0;function s(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;0<=e&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"==typeof e?e:function(t){var e=c++,r=!(arguments.length<2)&&u.call(arguments,1);return a[e]=!0,o((function(){a[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"==typeof r?r:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}));var ar=ur.exports.boltExport,cr=function(t){var e=S.none(),n=[],r=function(t){o()?i(t):n.push(t)},o=function(){return e.isSome()},i=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=S.some(t),function(t){W(t,i)}(n),n=[])})),{get:r,map:function(t){return cr((function(e){r((function(n){e(t(n))}))}))},isReady:o}},sr={nu:cr,pure:function(t){return cr((function(e){e(t)}))}},fr=function(t){setTimeout((function(){throw t}),0)},lr=function(t){var e=function(e){t().then(e,fr)};return{map:function(e){return lr((function(){return t().then(e)}))},bind:function(e){return lr((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return lr((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return sr.nu(e)},toCached:function(){var e=null;return lr((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},dr=function(t){return lr((function(){return new ar(t)}))},mr=function(t){return{is:function(e){return t===e},isValue:y,isError:b,getOr:s(t),getOrThunk:s(t),getOrDie:s(t),or:function(e){return mr(t)},orThunk:function(e){return mr(t)},fold:function(e,n){return n(t)},map:function(e){return mr(e(t))},mapError:function(e){return mr(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return S.some(t)}}},gr=function(t){return{is:b,isValue:b,isError:y,getOr:f,getOrThunk:function(t){return t()},getOrDie:function(){return h(String(t))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return gr(t)},mapError:function(e){return gr(e(t))},each:a,bind:function(e){return gr(t)},exists:b,forall:y,toOptional:S.none}},pr={value:mr,error:gr,fromOption:function(t,e){return t.fold((function(){return gr(e)}),mr)}},hr=function(t){if(!A(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return W(t,(function(r,o){var i=it(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!A(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){var n=arguments.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);return arguments[o].apply(null,r)},match:function(t){var n=it(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!Q(e,(function(t){return z(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,r)},log:function(t){console.log(t,{constructors:e,constructor:u,params:r})}}}})),n},vr=(hr([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t){return t.fold(f,f)});function br(t,e,n,r,o){return t(n,r)?S.some(n):I(o)&&o(n)?S.none():e(n,r,o)}var yr,xr,wr,Cr,Sr=function(t,e,n){for(var r=t.dom,o=I(n)?n:b;r.parentNode;){r=r.parentNode;var i=Ae(r);if(e(i))return S.some(i);if(o(i))break}return S.none()},kr=function(t,e,n){return br((function(t,e){return e(t)}),Sr,t,e,n)},Or=function(t,e,n){return Sr(t,(function(t){return Ne(t,e)}),n)},_r=function(t,e){return n=e,o=void 0===(r=t)?document:r.dom,De(o)?S.none():S.from(o.querySelector(n)).map(Ae);var n,r,o},Er=function(t,e,n){return br(Ne,Or,t,e,n)},Tr=window.Promise?window.Promise:(yr=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},wr=(xr=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],Ir(t,Ar(Nr,this),Ar(Dr,this))}).immediateFn||"function"==typeof setImmediate&&setImmediate||function(t){setTimeout(t,1)},xr.prototype.catch=function(t){return this.then(null,t)},xr.prototype.then=function(t,e){var n=this;return new xr((function(r,o){Br.call(n,new Mr(t,e,r,o))}))},xr.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&yr(arguments[0])?arguments[0]:arguments);return new xr((function(e,n){if(0===t.length)return e([]);for(var r=t.length,o=0;o<t.length;o++)!function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}t[i]=u,0==--r&&e(t)}catch(t){n(t)}}(o,t[o])}))},xr.resolve=function(t){return t&&"object"==typeof t&&t.constructor===xr?t:new xr((function(e){e(t)}))},xr.reject=function(t){return new xr((function(e,n){n(t)}))},xr.race=function(t){return new xr((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},xr);function Ar(t,e){return function(){t.apply(e,arguments)}}function Br(t){var e=this;null!==this._state?wr((function(){var n,r=e._state?t.onFulfilled:t.onRejected;if(null!==r){try{n=r(e._value)}catch(e){return void t.reject(e)}t.resolve(n)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function Nr(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void Ir(Ar(e,t),Ar(Nr,this),Ar(Dr,this))}this._state=!0,this._value=t,Rr.call(this)}catch(t){Dr.call(this,t)}}function Dr(t){this._state=!1,this._value=t,Rr.call(this)}function Rr(){for(var t=0,e=this._deferreds.length;t<e;t++)Br.call(this,this._deferreds[t]);this._deferreds=null}function Mr(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function Ir(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}}var Pr=function(t,e){return"number"!=typeof e&&(e=0),setTimeout(t,e)},Fr=function(t,e){return"number"!=typeof e&&(e=1),setInterval(t,e)},Lr=function(t,e){var n,r=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=Pr((function(){t.apply(this,r)}),e)};return r.stop=function(){clearTimeout(n)},r},Vr={requestAnimationFrame:function(t,e){Cr?Cr.then(t):Cr=new Tr((function(t){!function(t,e){for(var n=window.requestAnimationFrame,r=["ms","moz","webkit"],o=0;o<r.length&&!n;o++)n=window[r[o]+"RequestAnimationFrame"];(n=n||function(t){window.setTimeout(t,0)})(t,e)}(t,e=e||document.body)})).then(t)},setTimeout:Pr,setInterval:Fr,setEditorTimeout:function(t,e,n){return Pr((function(){t.removed||e()}),n)},setEditorInterval:function(t,e,n){var r=Fr((function(){t.removed?clearInterval(r):e()}),n);return r},debounce:Lr,throttle:Lr,clearInterval:function(t){return clearInterval(t)},clearTimeout:function(t){return clearTimeout(t)}};function Hr(t,e){void 0===e&&(e={});var n=0,r={},o=Ae(t),i=Ue(o),u=e.maxLoadTime||5e3,a=function(a,c,s){var f,l=ke._addCacheSuffix(a),d=gt(r,l).getOrThunk((function(){return{id:"mce-u"+n++,passed:[],failed:[],count:0}}));(r[l]=d).count++;var m,g,p,h=function(t,e){for(var n=t.length;n--;)t[n]();d.status=e,d.passed=[],d.failed=[],f&&(f.onload=null,f.onerror=null,f=null)},v=function(){return h(d.passed,2)},b=function(){return h(d.failed,3)},y=function(){var e;e=y,function(){for(var e=t.styleSheets,n=e.length;n--;){var r=e[n].ownerNode;if(r&&r.id===f.id)return v(),1}}()||(Date.now()-g<u?Vr.setTimeout(e):b())};c&&d.passed.push(c),s&&d.failed.push(s),1!==d.status&&(2!==d.status?3!==d.status?(d.status=1,m=Ee("link",i.dom),Xn(m,{rel:"stylesheet",type:"text/css",id:d.id}),g=Date.now(),e.contentCssCors&&$n(m,"crossOrigin","anonymous"),e.referrerPolicy&&$n(m,"referrerpolicy",e.referrerPolicy),(f=m.dom).onload=y,f.onerror=b,p=m,fn(on(o),p),$n(m,"href",l)):b():v())},f=function(t){return dr((function(e){a(t,c(e,s(pr.value(t))),c(e,s(pr.error(t))))}))},l=function(t){var e=ke._addCacheSuffix(t);gt(r,e).each((function(t){var n,i;0==--t.count&&(delete r[e],n=t.id,i=on(o),_r(i,"#"+n).each(mn))}))};return{load:a,loadAll:function(t,e,n){(function(t,e){return e((function(e){var n=[],r=0;0===t.length?e([]):W(t,(function(o,i){var u;o.get((u=i,function(o){n[u]=o,++r>=t.length&&e(n)}))}))}))})(U(t,f),dr).get((function(t){var r=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u)?n:r).push(u)}return{pass:n,fail:r}}(t,(function(t){return t.isValue()}));0<r.fail.length?n(r.fail.map(vr)):e(r.pass.map(vr))}))},unload:l,unloadAll:function(t){W(t,(function(t){l(t)}))},_setReferrerPolicy:function(t){e.referrerPolicy=t}}}var zr,jr=(zr=new WeakMap,{forElement:function(t,e){var n=rn(t).dom;return S.from(zr.get(n)).getOrThunk((function(){var t=Hr(n,e);return zr.set(n,t),t}))}}),Ur=(Wr.prototype.current=function(){return this.node},Wr.prototype.next=function(t){return this.node=this.findSibling(this.node,"firstChild","nextSibling",t),this.node},Wr.prototype.prev=function(t){return this.node=this.findSibling(this.node,"lastChild","previousSibling",t),this.node},Wr.prototype.prev2=function(t){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",t),this.node},Wr.prototype.findSibling=function(t,e,n,r){var o,i;if(t){if(!r&&t[e])return t[e];if(t!==this.rootNode){if(o=t[n])return o;for(i=t.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},Wr.prototype.findPreviousNode=function(t,e,n,r){var o,i,u;if(t){if(o=t[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(u=o[e];u;u=u[e])if(!u[e])return u;return o}if((i=t.parentNode)&&i!==this.rootNode)return i}},Wr);function Wr(t,e){this.node=t,this.rootNode=e,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}var qr=function(t){var e;return function(n){return(e=e||function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n}(t,y)).hasOwnProperty(Ie(n))}},Gr=qr(["h1","h2","h3","h4","h5","h6"]),$r=qr(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),Xr=function(t){return Le(t)&&!$r(t)},Yr=function(t){return Le(t)&&"br"===Ie(t)},Kr=qr(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),Jr=qr(["ul","ol","dl"]),Qr=qr(["li","dd","dt"]),Zr=qr(["thead","tbody","tfoot"]),to=qr(["td","th"]),eo=qr(["pre","script","textarea","style"]),no=" ",ro="\ufeff",oo=function(t){return"\ufeff"===t},io=function(t){return t.replace(/\uFEFF/g,"")},uo=En,ao=In,co=function(t){return ao(t)&&(t=t.parentNode),uo(t)&&t.hasAttribute("data-mce-caret")},so=function(t){return ao(t)&&oo(t.data)},fo=function(t){return co(t)||so(t)},lo=function(t){return t.firstChild!==t.lastChild||!Vn(t.firstChild)},mo=function(t){var e=t.container();return!!In(e)&&(e.data.charAt(t.offset())===ro||t.isAtStart()&&so(e.previousSibling))},go=function(t){var e=t.container();return!!In(e)&&(e.data.charAt(t.offset()-1)===ro||t.isAtEnd()&&so(e.nextSibling))},po=function(t){return ao(t)&&t.data[0]===ro},ho=function(t){return ao(t)&&t.data[t.data.length-1]===ro},vo=function(t){return t&&t.hasAttribute("data-mce-caret")?(n=(e=t.getElementsByTagName("br"))[e.length-1],Nn(n)&&n.parentNode.removeChild(n),t.removeAttribute("data-mce-caret"),t.removeAttribute("data-mce-bogus"),t.removeAttribute("style"),t.removeAttribute("_moz_abspos"),t):null;var e,n},bo=zn,yo=jn,xo=Vn,wo=In,Co=Tn(["script","style","textarea"]),So=Tn(["img","input","textarea","hr","iframe","video","audio","object","embed"]),ko=Tn(["table"]),Oo=fo,_o=function(t){return!Oo(t)&&(wo(t)?!Co(t.parentNode):So(t)||xo(t)||ko(t)||Eo(t))},Eo=function(t){return!1===(En(e=t)&&"true"===e.getAttribute("unselectable"))&&yo(t);var e},To=function(t,e){return _o(t)&&function(t,e){for(t=t.parentNode;t&&t!==e;t=t.parentNode){if(Eo(t))return!1;if(bo(t))return!0}return!0}(t,e)},Ao=/^[ \t\r\n]*$/,Bo=function(t){return Ao.test(t)},No=function(t,e){return _o(t)&&!1===(o=e,In(r=t)&&Bo(r.data)&&!1===function(t,e){var n,r,o=Ae(e);return n=Ae(t),r=l(Re,o),Or(n,"pre,code",r).isSome()}(r,o))||En(n=t)&&"A"===n.nodeName&&!n.hasAttribute("href")&&(n.hasAttribute("name")||n.hasAttribute("id"))||Do(t);var n,r,o},Do=Bn("data-mce-bookmark"),Ro=Bn("data-mce-bogus"),Mo=("data-mce-bogus","all",function(t){return En(t)&&"all"===t.getAttribute("data-mce-bogus")}),Io=function(t,e){return void 0===e&&(e=!0),function(t,e){var n,r=0;if(No(t,t))return!1;if(!(n=t.firstChild))return!0;var o=new Ur(n,t);do{if(e){if(Mo(n)){n=o.next(!0);continue}if(Ro(n)){n=o.next();continue}}if(Vn(n))r++,n=o.next();else{if(No(n,t))return!1;n=o.next()}}while(n);return r<=1}(t.dom,e)},Po=function(t,e){return M(t)&&(No(t,e)||Xr(Ae(t)))},Fo=function(t){return"span"===t.nodeName.toLowerCase()&&"bookmark"===t.getAttribute("data-mce-type")},Lo=function(t,e,n){var r=n||e;if(En(e)&&Fo(e))return e;for(var o,i,u,a=e.childNodes,c=a.length-1;0<=c;c--)Lo(t,a[c],r);return!En(e)||1===(o=e.childNodes).length&&Fo(o[0])&&e.parentNode.insertBefore(o[0],e),Ln(u=e)||Fn(u)||No(e,r)||En(i=e)&&0<i.childNodes.length||function(t,e){return In(t)&&0<t.data.length&&(o=new Ur(n=t,r=e).prev(!1),i=new Ur(n,r).next(!1),u=D(o)||Po(o,r),a=D(i)||Po(i,r),u&&a);var n,r,o,i,u,a}(e,r)||t.remove(e),e},Vo=ke.makeMap,Ho=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,zo=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,jo=/[<>&\"\']/g,Uo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Wo={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:"Ÿ"},qo={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},Go={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},$o=function(t,e){var n,r,o,i={};if(t){for(t=t.split(","),e=e||10,n=0;n<t.length;n+=2)r=String.fromCharCode(parseInt(t[n],e)),qo[r]||(o="&"+t[n+1]+";",i[r]=o,i[o]=r);return i}},Xo=$o("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),Yo=function(t,e){return t.replace(e?Ho:zo,(function(t){return qo[t]||t}))},Ko=function(t,e){return t.replace(e?Ho:zo,(function(t){return 1<t.length?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":qo[t]||"&#"+t.charCodeAt(0)+";"}))},Jo=function(t,e,n){return n=n||Xo,t.replace(e?Ho:zo,(function(t){return qo[t]||n[t]||t}))},Qo={encodeRaw:Yo,encodeAllRaw:function(t){return(""+t).replace(jo,(function(t){return qo[t]||t}))},encodeNumeric:Ko,encodeNamed:Jo,getEncodeFunc:function(t,e){var n=$o(e)||Xo,r=Vo(t.replace(/\+/g,","));return r.named&&r.numeric?function(t,e){return t.replace(e?Ho:zo,(function(t){return void 0!==qo[t]?qo[t]:void 0!==n[t]?n[t]:1<t.length?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":"&#"+t.charCodeAt(0)+";"}))}:r.named?e?function(t,e){return Jo(t,e,n)}:Jo:r.numeric?Ko:Yo},decode:function(t){return t.replace(Uo,(function(t,e){return e?65535<(e="x"===e.charAt(0).toLowerCase()?parseInt(e.substr(1),16):parseInt(e,10))?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):Wo[e]||String.fromCharCode(e):Go[t]||Xo[t]||(n=t,(r=Ee("div").dom).innerHTML=n,r.textContent||r.innerText||n);var n,r}))}},Zo={},ti={},ei=ke.makeMap,ni=ke.each,ri=ke.extend,oi=ke.explode,ii=ke.inArray,ui=function(t,e){return(t=ke.trim(t))?t.split(e||" "):[]},ai=function(t,e){var n;return t&&(n={},"string"==typeof t&&(t={"*":t}),ni(t,(function(t,r){n[r]=n[r.toUpperCase()]=("map"===e?ei:oi)(t,/[, ]/)}))),n};function ci(t){var e={},n={},r=[],o={},i={},u=function(e,n,r){var o=t[e];return o?o=ei(o,/[, ]/,ei(o.toUpperCase(),/[, ]/)):(o=Zo[e])||(o=ei(n," ",ei(n.toUpperCase()," ")),o=ri(o,r),Zo[e]=o),o},a=function(t){var e,n,r,o,i,u,a={},c=function(t,n,r){var o,i,u=function(t,e){for(var n={},r=0,o=t.length;r<o;r++)n[t[r]]=e||{};return n};n=n||"","string"==typeof(r=r||[])&&(r=ui(r));for(var c=ui(t),s=c.length;s--;)i={attributes:u(o=ui([e,n].join(" "))),attributesOrder:o,children:u(r,ti)},a[c[s]]=i},s=function(t,e){for(var n,r,o,i=ui(t),u=i.length,c=ui(e);u--;)for(n=a[i[u]],r=0,o=c.length;r<o;r++)n.attributes[c[r]]={},n.attributesOrder.push(c[r])};return Zo[t]?Zo[t]:(e="id accesskey class dir lang style tabindex title role",n="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",r="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"!==t&&(e+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==t&&(e+=" xml:lang",r=[r,u="acronym applet basefont big font strike tt"].join(" "),ni(ui(u),(function(t){c(t,"",r)})),n=[n,i="center dir isindex noframes"].join(" "),o=[n,r].join(" "),ni(ui(i),(function(t){c(t,"",o)}))),o=o||[n,r].join(" "),c("html","manifest","head body"),c("head","","base command link meta noscript script style title"),c("title hr noscript br"),c("base","href target"),c("link","href rel media hreflang type sizes hreflang"),c("meta","name http-equiv content charset"),c("style","media type scoped"),c("script","src async defer type charset"),c("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),c("address dt dd div caption","",o),c("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","",r),c("blockquote","cite",o),c("ol","reversed start type","li"),c("ul","","li"),c("li","value",o),c("dl","","dt dd"),c("a","href target rel media hreflang type",r),c("q","cite",r),c("ins del","cite datetime",o),c("img","src sizes srcset alt usemap ismap width height"),c("iframe","src name width height",o),c("embed","src type width height"),c("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),c("param","name value"),c("map","name",[o,"area"].join(" ")),c("area","alt coords shape href target rel media hreflang type"),c("table","border","caption colgroup thead tfoot tbody tr"+("html4"===t?" col":"")),c("colgroup","span","col"),c("col","span"),c("tbody thead tfoot","","tr"),c("tr","","td th"),c("td","colspan rowspan headers",o),c("th","colspan rowspan headers scope abbr",o),c("form","accept-charset action autocomplete enctype method name novalidate target",o),c("fieldset","disabled form name",[o,"legend"].join(" ")),c("label","form for",r),c("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"),c("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===t?o:r),c("select","disabled form multiple name required size","option optgroup"),c("optgroup","disabled label","option"),c("option","disabled label selected value"),c("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),c("menu","type label",[o,"li"].join(" ")),c("noscript","",o),"html4"!==t&&(c("wbr"),c("ruby","",[r,"rt rp"].join(" ")),c("figcaption","",o),c("mark rt rp summary bdi","",r),c("canvas","width height",o),c("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),c("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),c("picture","","img source"),c("source","src srcset type media sizes"),c("track","kind src srclang label default"),c("datalist","",[r,"option"].join(" ")),c("article section nav aside main header footer","",o),c("hgroup","","h1 h2 h3 h4 h5 h6"),c("figure","",[o,"figcaption"].join(" ")),c("time","datetime",r),c("dialog","open",o),c("command","type label icon disabled checked radiogroup command"),c("output","for form name",r),c("progress","value max",r),c("meter","value min max low high optimum",r),c("details","open",[o,"summary"].join(" ")),c("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==t&&(s("script","language xml:space"),s("style","xml:space"),s("object","declare classid code codebase codetype archive standby align border hspace vspace"),s("embed","align name hspace vspace"),s("param","valuetype type"),s("a","charset name rev shape coords"),s("br","clear"),s("applet","codebase archive code object alt name width height align hspace vspace"),s("img","name longdesc align border hspace vspace"),s("iframe","longdesc frameborder marginwidth marginheight scrolling align"),s("font basefont","size color face"),s("input","usemap align"),s("select"),s("textarea"),s("h1 h2 h3 h4 h5 h6 div p legend caption","align"),s("ul","type compact"),s("li","type"),s("ol dl menu dir","compact"),s("pre","width xml:space"),s("hr","align noshade size width"),s("isindex","prompt"),s("table","summary width frame rules cellspacing cellpadding align bgcolor"),s("col","width align char charoff valign"),s("colgroup","width align char charoff valign"),s("thead","align char charoff valign"),s("tr","align char charoff valign bgcolor"),s("th","axis align char charoff valign nowrap bgcolor width height"),s("form","accept"),s("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),s("tfoot","align char charoff valign"),s("tbody","align char charoff valign"),s("area","nohref"),s("body","background bgcolor text link vlink alink")),"html4"!==t&&(s("input button select textarea","autofocus"),s("input textarea","placeholder"),s("a","download"),s("link script img","crossorigin"),s("img","loading"),s("iframe","sandbox seamless allowfullscreen loading")),ni(ui("a form meter progress dfn"),(function(t){a[t]&&delete a[t].children[t]})),delete a.caption.children.table,delete a.script,Zo[t]=a)}((t=t||{}).schema);!1===t.verify_html&&(t.valid_elements="*[*]");var c=ai(t.valid_styles),s=ai(t.invalid_styles,"map"),f=ai(t.valid_classes,"map"),l=u("whitespace_elements","pre script noscript style textarea video audio iframe object code"),d=u("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),m=u("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),g=u("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),p="td th iframe video audio object script code",h=u("non_empty_elements",p+" pre",m),v=u("move_caret_before_on_enter_elements",p+" table",m),b=u("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),y=u("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",b),x=u("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp");ni((t.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),(function(t){i[t]=new RegExp("</"+t+"[^>]*>","gi")}));var w=function(t){return new RegExp("^"+t.replace(/([?+*])/g,".$1")+"$")},C=function(t){var n,o,i,u,a,c,s,f,l,d,m,g,p,h,v,b,y,x,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,S=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,k=/[*?+]/;if(t){var O=ui(t,",");for(e["@"]&&(b=e["@"].attributes,y=e["@"].attributesOrder),n=0,o=O.length;n<o;n++)if(a=C.exec(O[n])){if(h=a[1],l=a[2],v=a[3],f=a[5],c={attributes:g={},attributesOrder:p=[]},"#"===h&&(c.paddEmpty=!0),"-"===h&&(c.removeEmpty=!0),"!"===a[4]&&(c.removeEmptyAttrs=!0),b&&(at(b,(function(t,e){g[e]=t})),p.push.apply(p,y)),f)for(i=0,u=(f=ui(f,"|")).length;i<u;i++)if(a=S.exec(f[i])){if(s={},m=a[1],d=a[2].replace(/[\\:]:/g,":"),h=a[3],x=a[4],"!"===m&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(d),s.required=!0),"-"===m){delete g[d],p.splice(ii(p,d),1);continue}h&&("="===h&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:d,value:x}),s.defaultValue=x),":"===h&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:d,value:x}),s.forcedValue=x),"<"===h&&(s.validValues=ei(x,"?"))),k.test(d)?(c.attributePatterns=c.attributePatterns||[],s.pattern=w(d),c.attributePatterns.push(s)):(g[d]||p.push(d),g[d]=s)}b||"@"!==l||(b=g,y=p),v&&(c.outputName=l,e[v]=c),k.test(l)?(c.pattern=w(l),r.push(c)):e[l]=c}}},S=function(t){e={},r=[],C(t),ni(a,(function(t,e){n[e]=t.children}))},k=function(t){var r=/^(~)?(.+)$/;t&&(Zo.text_block_elements=Zo.block_elements=null,ni(ui(t,","),(function(t){var i,u=r.exec(t),a="~"===u[1],c=a?"span":"div",s=u[2];n[s]=n[c],o[s]=c,a||(y[s.toUpperCase()]={},y[s]={}),e[s]||(i=e[c],delete(i=ri({},i)).removeEmptyAttrs,delete i.removeEmpty,e[s]=i),ni(n,(function(t,e){t[c]&&(n[e]=t=ri({},n[e]),t[s]=t[c])}))})))},O=function(e){var r=/^([+\-]?)([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]+)\[([^\]]+)]$/;Zo[t.schema]=null,e&&ni(ui(e,","),(function(t){var e,o,i=r.exec(t);i&&(o=i[1],e=o?n[i[2]]:n[i[2]]={"#comment":{}},e=n[i[2]],ni(ui(i[3],"|"),(function(t){"-"===o?delete e[t]:e[t]={}})))}))},_=function(t){var n,o=e[t];if(o)return o;for(n=r.length;n--;)if((o=r[n]).pattern.test(t))return o};return t.valid_elements?S(t.valid_elements):(ni(a,(function(t,r){e[r]={attributes:t.attributes,attributesOrder:t.attributesOrder},n[r]=t.children})),"html5"!==t.schema&&ni(ui("strong/b em/i"),(function(t){var n=ui(t,"/");e[n[1]].outputName=n[0]})),ni(ui("ol ul sub sup blockquote span font a table tbody strong em b i"),(function(t){e[t]&&(e[t].removeEmpty=!0)})),ni(ui("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(t){e[t].paddEmpty=!0})),ni(ui("span"),(function(t){e[t].removeEmptyAttrs=!0}))),k(t.custom_elements),O(t.valid_children),C(t.extended_valid_elements),O("+ol[ul|ol],+ul[ul|ol]"),ni({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"},(function(t,n){e[n]&&(e[n].parentsRequired=ui(t))})),t.invalid_elements&&ni(oi(t.invalid_elements),(function(t){e[t]&&delete e[t]})),_("span")||C("span[!data-mce-type|*]"),{children:n,elements:e,getValidStyles:function(){return c},getValidClasses:function(){return f},getBlockElements:function(){return y},getInvalidStyles:function(){return s},getShortEndedElements:function(){return m},getTextBlockElements:function(){return b},getTextInlineElements:function(){return x},getBoolAttrs:function(){return g},getElementRule:_,getSelfClosingElements:function(){return d},getNonEmptyElements:function(){return h},getMoveCaretBeforeOnEnterElements:function(){return v},getWhiteSpaceElements:function(){return l},getSpecialElements:function(){return i},isValidChild:function(t,e){var r=n[t.toLowerCase()];return!(!r||!r[e.toLowerCase()])},isValid:function(t,e){var n,r,o=_(t);if(o){if(!e)return!0;if(o.attributes[e])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(t))return!0}return!1},getCustomElements:function(){return o},addValidElements:C,setValidElements:S,addCustomElements:k,addValidChildren:O}}var si=function(t,e,n,r){var o=function(t){return 1<(t=parseInt(t,10).toString(16)).length?t:"0"+t};return"#"+o(e)+o(n)+o(r)},fi=function(t,e){var n,r,o=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,u=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,c={},s="\ufeff";t=t||{},e&&(n=e.getValidStyles(),r=e.getInvalidStyles());for(var f="\\\" \\' \\; \\: ; : \ufeff".split(" "),l=0;l<f.length;l++)c[f[l]]=s+l,c[s+l]=f[l];return{toHex:function(t){return t.replace(o,si)},parse:function(e){var n,r,f,d,m,g,p,h={},v=t.url_converter,b=t.url_converter_scope||this,y=function(t,e,n){var r=h[t+"-top"+e];if(r){var o=h[t+"-right"+e];if(o){var i=h[t+"-bottom"+e];if(i){var u=h[t+"-left"+e];if(u){var a=[r,o,i,u];for(l=a.length-1;l--&&a[l]===a[l+1];);-1<l&&n||(h[t+e]=-1===l?a[0]:a.join(" "),delete h[t+"-top"+e],delete h[t+"-right"+e],delete h[t+"-bottom"+e],delete h[t+"-left"+e])}}}}},x=function(t){var e,n=h[t];if(n){for(e=(n=n.split(" ")).length;e--;)if(n[e]!==n[0])return!1;return h[t]=n[0],!0}},w=function(t){return d=!0,c[t]},C=function(t,e){return d&&(t=t.replace(/\uFEFF[0-9]/g,(function(t){return c[t]}))),e||(t=t.replace(/\\([\'\";:])/g,"$1")),t},S=function(t){return String.fromCharCode(parseInt(t.slice(1),16))},k=function(t){return t.replace(/\\[0-9a-f]+/gi,S)},O=function(e,n,r,o,i,u){if(i=i||u)return"'"+(i=C(i)).replace(/\'/g,"\\'")+"'";if(n=C(n||r||o),!t.allow_script_urls){var a=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!t.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return v&&(n=v.call(b,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,w).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(t){return t.replace(/[;:]/g,w)}));n=u.exec(e);)if(u.lastIndex=n.index+n[0].length,r=n[1].replace(a,"").toLowerCase(),f=n[2].replace(a,""),r&&f){if(r=k(r),f=k(f),-1!==r.indexOf(s)||-1!==r.indexOf('"'))continue;if(!t.allow_script_urls&&("behavior"===r||/expression\s*\(|\/\*|\*\//.test(f)))continue;"font-weight"===r&&"700"===f?f="bold":"color"!==r&&"background-color"!==r||(f=f.toLowerCase()),f=(f=f.replace(o,si)).replace(i,O),h[r]=d?C(f,!0):f}y("border","",!0),y("border","-width"),y("border","-color"),y("border","-style"),y("padding",""),y("margin",""),"border",g="border-style",p="border-color",x(m="border-width")&&x(g)&&x(p)&&(h.border=h[m]+" "+h[g]+" "+h[p],delete h[m],delete h[g],delete h[p]),"medium none"===h.border&&delete h.border,"none"===h["border-image"]&&delete h["border-image"]}return h},serialize:function(t,e){var o="",i=function(e){var r,i=n[e];if(i)for(var u=0,a=i.length;u<a;u++)e=i[u],(r=t[e])&&(o+=(0<o.length?" ":"")+e+": "+r+";")};return e&&n?(i("*"),i(e)):at(t,(function(t,n){var i,u,a;!t||r&&(i=n,u=e,(a=r["*"])&&a[i]||(a=r[u])&&a[i])||(o+=(0<o.length?" ":"")+n+": "+t+";")})),o}}},li=/^(?:mouse|contextmenu)|click/,di={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1,mozPressure:1},mi=function(){return!1},gi=function(){return!0},pi=function(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)},hi=function(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)},vi=function(t,e){var n,r,o,i,u,a,c=e||{};for(n in t)di[n]||(c[n]=t[n]);return c.target||(c.target=c.srcElement||document),c.composedPath&&(c.composedPath=function(){return t.composedPath()}),t&&(u=t,li.test(u.type))&&void 0===t.pageX&&void 0!==t.clientX&&(o=(r=c.target.ownerDocument||document).documentElement,i=r.body,c.pageX=t.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),c.pageY=t.clientY+(o&&o.scrollTop||i&&i.scrollTop||0)-(o&&o.clientTop||i&&i.clientTop||0)),c.preventDefault=function(){c.isDefaultPrevented=gi,t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},c.stopPropagation=function(){c.isPropagationStopped=gi,t&&(t.stopPropagation?t.stopPropagation():t.cancelBubble=!0)},!(c.stopImmediatePropagation=function(){c.isImmediatePropagationStopped=gi,c.stopPropagation()})==((a=c).isDefaultPrevented===gi||a.isDefaultPrevented===mi)&&(c.isDefaultPrevented=mi,c.isPropagationStopped=mi,c.isImmediatePropagationStopped=mi),void 0===c.metaKey&&(c.metaKey=!1),c},bi=(yi.prototype.bind=function(t,e,n,r){var o,i,u,a,c,s,f=this,l=window,d=function(t){f.executeHandlers(vi(t||l.event),o)};if(t&&3!==t.nodeType&&8!==t.nodeType){t[f.expando]?o=t[f.expando]:(o=f.count++,t[f.expando]=o,f.events[o]={}),r=r||t;for(var m=e.split(" "),g=m.length;g--;)c=d,a=s=!1,"DOMContentLoaded"===(u=m[g])&&(u="ready"),f.domLoaded&&"ready"===u&&"complete"===t.readyState?n.call(r,vi({type:u})):(f.hasMouseEnterLeave||(a=f.mouseEnterLeave[u])&&(c=function(t){var e=t.currentTarget,n=t.relatedTarget;if(n&&e.contains)n=e.contains(n);else for(;n&&n!==e;)n=n.parentNode;n||((t=vi(t||l.event)).type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=e,f.executeHandlers(t,o))}),f.hasFocusIn||"focusin"!==u&&"focusout"!==u||(s=!0,a="focusin"===u?"focus":"blur",c=function(t){(t=vi(t||l.event)).type="focus"===t.type?"focusin":"focusout",f.executeHandlers(t,o)}),(i=f.events[o][u])?"ready"===u&&f.domLoaded?n(vi({type:u})):i.push({func:n,scope:r}):(f.events[o][u]=i=[{func:n,scope:r}],i.fakeName=a,i.capture=s,i.nativeHandler=c,"ready"===u?function(t,e,n){var r,o=t.document,i={type:"ready"};n.domLoaded?e(i):(r=function(){hi(t,"DOMContentLoaded",r),hi(t,"load",r),n.domLoaded||(n.domLoaded=!0,e(i)),t=null},"complete"===o.readyState||"interactive"===o.readyState&&o.body?r():pi(t,"DOMContentLoaded",r),n.domLoaded||pi(t,"load",r))}(t,c,f):pi(t,a||u,c,s)));return t=i=null,n}},yi.prototype.unbind=function(t,e,n){var r,o,i;if(!t||3===t.nodeType||8===t.nodeType)return this;var u=t[this.expando];if(u){if(i=this.events[u],e){for(var a,c,s,f,l=e.split(" "),d=l.length;d--;)if(f=i[o=l[d]]){if(n)for(r=f.length;r--;)f[r].func===n&&(a=f.nativeHandler,c=f.fakeName,s=f.capture,(f=f.slice(0,r).concat(f.slice(r+1))).nativeHandler=a,f.fakeName=c,f.capture=s,i[o]=f);n&&0!==f.length||(delete i[o],hi(t,f.fakeName||o,f.nativeHandler,f.capture))}}else at(i,(function(e,n){hi(t,e.fakeName||n,e.nativeHandler,e.capture)})),i={};for(o in i)if(pt(i,o))return this;delete this.events[u];try{delete t[this.expando]}catch(e){t[this.expando]=null}}return this},yi.prototype.fire=function(t,e,n){var r;if(!t||3===t.nodeType||8===t.nodeType)return this;var o=vi(null,n);for(o.type=e,o.target=t;(r=t[this.expando])&&this.executeHandlers(o,r),(t=t.parentNode||t.ownerDocument||t.defaultView||t.parentWindow)&&!o.isPropagationStopped(););return this},yi.prototype.clean=function(t){var e,n;if(!t||3===t.nodeType||8===t.nodeType)return this;if(t[this.expando]&&this.unbind(t),t.getElementsByTagName||(t=t.document),t&&t.getElementsByTagName)for(this.unbind(t),e=(n=t.getElementsByTagName("*")).length;e--;)(t=n[e])[this.expando]&&this.unbind(t);return this},yi.prototype.destroy=function(){this.events={}},yi.prototype.cancel=function(t){return t&&(t.preventDefault(),t.stopImmediatePropagation()),!1},yi.prototype.executeHandlers=function(t,e){var n=this.events[e],r=n&&n[t.type];if(r)for(var o=0,i=r.length;o<i;o++){var u=r[o];if(u&&!1===u.func.call(u.scope,t)&&t.preventDefault(),t.isImmediatePropagationStopped())return}},yi.Event=new yi,yi);function yi(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}var xi,wi,Ci,Si,ki,Oi,_i,Ei,Ti,Ai,Bi,Ni,Di,Ri,Mi,Ii,Pi,Fi="sizzle"+-new Date,Li=window.document,Vi=0,Hi=0,zi=yu(),ji=yu(),Ui=yu(),Wi=function(t,e){return t===e&&(Ai=!0),0},qi="undefined",Gi={}.hasOwnProperty,$i=[],Xi=$i.pop,Yi=$i.push,Ki=$i.push,Ji=$i.slice,Qi=$i.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},Zi="[\\x20\\t\\r\\n\\f]",tu="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",eu="\\["+Zi+"*("+tu+")(?:"+Zi+"*([*^$|!~]?=)"+Zi+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+tu+"))|)"+Zi+"*\\]",nu=":("+tu+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+eu+")*)|.*)\\)|)",ru=new RegExp("^"+Zi+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Zi+"+$","g"),ou=new RegExp("^"+Zi+"*,"+Zi+"*"),iu=new RegExp("^"+Zi+"*([>+~]|"+Zi+")"+Zi+"*"),uu=new RegExp("="+Zi+"*([^\\]'\"]*?)"+Zi+"*\\]","g"),au=new RegExp(nu),cu=new RegExp("^"+tu+"$"),su={ID:new RegExp("^#("+tu+")"),CLASS:new RegExp("^\\.("+tu+")"),TAG:new RegExp("^("+tu+"|[*])"),ATTR:new RegExp("^"+eu),PSEUDO:new RegExp("^"+nu),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+Zi+"*(even|odd|(([+-]|)(\\d*)n|)"+Zi+"*(?:([+-]|)"+Zi+"*(\\d+)|))"+Zi+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+Zi+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+Zi+"*((?:-\\d)?\\d*)"+Zi+"*\\)|)(?=[^-]|$)","i")},fu=/^(?:input|select|textarea|button)$/i,lu=/^h\d$/i,du=/^[^{]+\{\s*\[native \w/,mu=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,gu=/[+~]/,pu=/'|\\/g,hu=new RegExp("\\\\([\\da-f]{1,6}"+Zi+"?|("+Zi+")|.)","ig"),vu=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(65536+r):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Ki.apply($i=Ji.call(Li.childNodes),Li.childNodes),$i[Li.childNodes.length].nodeType}catch(t){Ki={apply:$i.length?function(t,e){Yi.apply(t,Ji.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}var bu=function(t,e,n,r){var o,i,u,a,c,s,f,l,d,m;if((e?e.ownerDocument||e:Li)!==Ni&&Bi(e),n=n||[],!t||"string"!=typeof t)return n;if(1!==(a=(e=e||Ni).nodeType)&&9!==a)return[];if(Ri&&!r){if(o=mu.exec(t))if(u=o[1]){if(9===a){if(!(i=e.getElementById(u))||!i.parentNode)return n;if(i.id===u)return n.push(i),n}else if(e.ownerDocument&&(i=e.ownerDocument.getElementById(u))&&Pi(e,i)&&i.id===u)return n.push(i),n}else{if(o[2])return Ki.apply(n,e.getElementsByTagName(t)),n;if((u=o[3])&&xi.getElementsByClassName)return Ki.apply(n,e.getElementsByClassName(u)),n}if(xi.qsa&&(!Mi||!Mi.test(t))){if(l=f=Fi,d=e,m=9===a&&t,1===a&&"object"!==e.nodeName.toLowerCase()){for(s=ki(t),(f=e.getAttribute("id"))?l=f.replace(pu,"\\$&"):e.setAttribute("id",l),l="[id='"+l+"'] ",c=s.length;c--;)s[c]=l+Ou(s[c]);d=gu.test(t)&&Su(e.parentNode)||e,m=s.join(",")}if(m)try{return Ki.apply(n,d.querySelectorAll(m)),n}catch(t){}finally{f||e.removeAttribute("id")}}}return _i(t.replace(ru,"$1"),e,n,r)};function yu(){var t=[];return function e(n,r){return t.push(n+" ")>wi.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function xu(t){return t[Fi]=!0,t}function wu(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||1<<31)-(~t.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function Cu(t){return xu((function(e){return e=+e,xu((function(n,r){for(var o,i=t([],n.length,e),u=i.length;u--;)n[o=i[u]]&&(n[o]=!(r[o]=n[o]))}))}))}function Su(t){return t&&typeof t.getElementsByTagName!=qi&&t}function ku(){}function Ou(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function _u(t,e,n){var r=e.dir,o=n&&"parentNode"===r,i=Hi++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||o)return t(e,n,i)}:function(e,n,u){var a,c,s=[Vi,i];if(u){for(;e=e[r];)if((1===e.nodeType||o)&&t(e,n,u))return!0}else for(;e=e[r];)if(1===e.nodeType||o){if((a=(c=e[Fi]||(e[Fi]={}))[r])&&a[0]===Vi&&a[1]===i)return s[2]=a[2];if((c[r]=s)[2]=t(e,n,u))return!0}}}function Eu(t){return 1<t.length?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function Tu(t,e,n,r,o){for(var i,u=[],a=0,c=t.length,s=null!=e;a<c;a++)(i=t[a])&&(n&&!n(i,r,o)||(u.push(i),s&&e.push(a)));return u}function Au(t,e,n,r,o,i){return r&&!r[Fi]&&(r=Au(r)),o&&!o[Fi]&&(o=Au(o,i)),xu((function(i,u,a,c){var s,f,l,d=[],m=[],g=u.length,p=i||function(t,e,n){for(var r=0,o=e.length;r<o;r++)bu(t,e[r],n);return n}(e||"*",a.nodeType?[a]:a,[]),h=!t||!i&&e?p:Tu(p,d,t,a,c),v=n?o||(i?t:g||r)?[]:u:h;if(n&&n(h,v,a,c),r)for(s=Tu(v,m),r(s,[],a,c),f=s.length;f--;)(l=s[f])&&(v[m[f]]=!(h[m[f]]=l));if(i){if(o||t){if(o){for(s=[],f=v.length;f--;)(l=v[f])&&s.push(h[f]=l);o(null,v=[],s,c)}for(f=v.length;f--;)(l=v[f])&&-1<(s=o?Qi.call(i,l):d[f])&&(i[s]=!(u[s]=l))}}else v=Tu(v===u?v.splice(g,v.length):v),o?o(null,u,v,c):Ki.apply(u,v)}))}xi=bu.support={},Si=bu.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},Bi=bu.setDocument=function(t){var e,n=t?t.ownerDocument||t:Li,r=n.defaultView;return n!==Ni&&9===n.nodeType&&n.documentElement?(Di=(Ni=n).documentElement,Ri=!Si(n),r&&r!==function(t){try{return t.top}catch(t){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",(function(){Bi()}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){Bi()}))),xi.attributes=!0,xi.getElementsByTagName=!0,xi.getElementsByClassName=du.test(n.getElementsByClassName),xi.getById=!0,wi.find.ID=function(t,e){if(typeof e.getElementById!=qi&&Ri){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},wi.filter.ID=function(t){var e=t.replace(hu,vu);return function(t){return t.getAttribute("id")===e}},wi.find.TAG=xi.getElementsByTagName?function(t,e){if(typeof e.getElementsByTagName!=qi)return e.getElementsByTagName(t)}:function(t,e){var n,r=[],o=0,i=e.getElementsByTagName(t);if("*"!==t)return i;for(;n=i[o++];)1===n.nodeType&&r.push(n);return r},wi.find.CLASS=xi.getElementsByClassName&&function(t,e){if(Ri)return e.getElementsByClassName(t)},Ii=[],Mi=[],xi.disconnectedMatch=!0,Mi=Mi.length&&new RegExp(Mi.join("|")),Ii=Ii.length&&new RegExp(Ii.join("|")),e=du.test(Di.compareDocumentPosition),Pi=e||du.test(Di.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},Wi=e?function(t,e){if(t===e)return Ai=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!xi.sortDetached&&e.compareDocumentPosition(t)===r?t===n||t.ownerDocument===Li&&Pi(Li,t)?-1:e===n||e.ownerDocument===Li&&Pi(Li,e)?1:Ti?Qi.call(Ti,t)-Qi.call(Ti,e):0:4&r?-1:1)}:function(t,e){if(t===e)return Ai=!0,0;var r,o=0,i=t.parentNode,u=e.parentNode,a=[t],c=[e];if(!i||!u)return t===n?-1:e===n?1:i?-1:u?1:Ti?Qi.call(Ti,t)-Qi.call(Ti,e):0;if(i===u)return wu(t,e);for(r=t;r=r.parentNode;)a.unshift(r);for(r=e;r=r.parentNode;)c.unshift(r);for(;a[o]===c[o];)o++;return o?wu(a[o],c[o]):a[o]===Li?-1:c[o]===Li?1:0},n):Ni},bu.matches=function(t,e){return bu(t,null,null,e)},bu.matchesSelector=function(t,e){if((t.ownerDocument||t)!==Ni&&Bi(t),e=e.replace(uu,"='$1']"),xi.matchesSelector&&Ri&&(!Ii||!Ii.test(e))&&(!Mi||!Mi.test(e)))try{var n=(void 0).call(t,e);if(n||xi.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){}return 0<bu(e,Ni,null,[t]).length},bu.contains=function(t,e){return(t.ownerDocument||t)!==Ni&&Bi(t),Pi(t,e)},bu.attr=function(t,e){(t.ownerDocument||t)!==Ni&&Bi(t);var n=wi.attrHandle[e.toLowerCase()],r=n&&Gi.call(wi.attrHandle,e.toLowerCase())?n(t,e,!Ri):void 0;return void 0!==r?r:xi.attributes||!Ri?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},bu.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},bu.uniqueSort=function(t){var e,n=[],r=0,o=0;if(Ai=!xi.detectDuplicates,Ti=!xi.sortStable&&t.slice(0),t.sort(Wi),Ai){for(;e=t[o++];)e===t[o]&&(r=n.push(o));for(;r--;)t.splice(n[r],1)}return Ti=null,t},Ci=bu.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=Ci(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=Ci(e);return n},(wi=bu.selectors={cacheLength:50,createPseudo:xu,match:su,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(hu,vu),t[3]=(t[3]||t[4]||t[5]||"").replace(hu,vu),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||bu.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&bu.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return su.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&au.test(n)&&(e=ki(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(hu,vu).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=zi[t+" "];return e||(e=new RegExp("(^|"+Zi+")"+t+"("+Zi+"|$)"))&&zi(t,(function(t){return e.test("string"==typeof t.className&&t.className||typeof t.getAttribute!=qi&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var o=bu.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&-1<o.indexOf(n):"$="===e?n&&o.slice(-n.length)===n:"~="===e?-1<(" "+o+" ").indexOf(n):"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),u="last"!==t.slice(-4),a="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,c){var s,f,l,d,m,g,p=i!=u?"nextSibling":"previousSibling",h=e.parentNode,v=a&&e.nodeName.toLowerCase(),b=!c&&!a;if(h){if(i){for(;p;){for(l=e;l=l[p];)if(a?l.nodeName.toLowerCase()===v:1===l.nodeType)return!1;g=p="only"===t&&!g&&"nextSibling"}return!0}if(g=[u?h.firstChild:h.lastChild],u&&b){for(m=(s=(f=h[Fi]||(h[Fi]={}))[t]||[])[0]===Vi&&s[1],d=s[0]===Vi&&s[2],l=m&&h.childNodes[m];l=++m&&l&&l[p]||(d=m=0)||g.pop();)if(1===l.nodeType&&++d&&l===e){f[t]=[Vi,m,d];break}}else if(b&&(s=(e[Fi]||(e[Fi]={}))[t])&&s[0]===Vi)d=s[1];else for(;(l=++m&&l&&l[p]||(d=m=0)||g.pop())&&((a?l.nodeName.toLowerCase()!==v:1!==l.nodeType)||!++d||(b&&((l[Fi]||(l[Fi]={}))[t]=[Vi,d]),l!==e)););return(d-=o)===r||d%r==0&&0<=d/r}}},PSEUDO:function(t,e){var n,r=wi.pseudos[t]||wi.setFilters[t.toLowerCase()]||bu.error("unsupported pseudo: "+t);return r[Fi]?r(e):1<r.length?(n=[t,t,"",e],wi.setFilters.hasOwnProperty(t.toLowerCase())?xu((function(t,n){for(var o,i=r(t,e),u=i.length;u--;)t[o=Qi.call(t,i[u])]=!(n[o]=i[u])})):function(t){return r(t,0,n)}):r}},pseudos:{not:xu((function(t){var e=[],n=[],r=Oi(t.replace(ru,"$1"));return r[Fi]?xu((function(t,e,n,o){for(var i,u=r(t,null,o,[]),a=t.length;a--;)(i=u[a])&&(t[a]=!(e[a]=i))})):function(t,o,i){return e[0]=t,r(e,null,i,n),!n.pop()}})),has:xu((function(t){return function(e){return 0<bu(t,e).length}})),contains:xu((function(t){return t=t.replace(hu,vu),function(e){return-1<(e.textContent||e.innerText||Ci(e)).indexOf(t)}})),lang:xu((function(t){return cu.test(t||"")||bu.error("unsupported lang: "+t),t=t.replace(hu,vu).toLowerCase(),function(e){var n;do{if(n=Ri?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=window.location&&window.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===Di},focus:function(t){return t===Ni.activeElement&&(!Ni.hasFocus||Ni.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!wi.pseudos.empty(t)},header:function(t){return lu.test(t.nodeName)},input:function(t){return fu.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:Cu((function(){return[0]})),last:Cu((function(t,e){return[e-1]})),eq:Cu((function(t,e,n){return[n<0?n+e:n]})),even:Cu((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:Cu((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:Cu((function(t,e,n){for(var r=n<0?n+e:n;0<=--r;)t.push(r);return t})),gt:Cu((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}}).pseudos.nth=wi.pseudos.eq,W(["radio","checkbox","file","password","image"],(function(t){var e;wi.pseudos[t]=(e=t,function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e})})),W(["submit","reset"],(function(t){var e;wi.pseudos[t]=(e=t,function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e})})),ku.prototype=wi.filters=wi.pseudos,wi.setFilters=new ku,ki=bu.tokenize=function(t,e){var n,r,o,i,u,a,c,s=ji[t+" "];if(s)return e?0:s.slice(0);for(u=t,a=[],c=wi.preFilter;u;){for(i in n&&!(r=ou.exec(u))||(r&&(u=u.slice(r[0].length)||u),a.push(o=[])),n=!1,(r=iu.exec(u))&&(n=r.shift(),o.push({value:n,type:r[0].replace(ru," ")}),u=u.slice(n.length)),wi.filter)wi.filter.hasOwnProperty(i)&&(!(r=su[i].exec(u))||c[i]&&!(r=c[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),u=u.slice(n.length)));if(!n)break}return e?u.length:u?bu.error(t):ji(t,a).slice(0)},Oi=bu.compile=function(t,e){var n,r,o,i,u,a,c=[],s=[],f=Ui[t+" "];if(!f){for(n=(e=e||ki(t)).length;n--;)(f=function t(e){for(var n,r,o,i=e.length,u=wi.relative[e[0].type],a=u||wi.relative[" "],c=u?1:0,s=_u((function(t){return t===n}),a,!0),f=_u((function(t){return-1<Qi.call(n,t)}),a,!0),l=[function(t,e,r){return!u&&(r||e!==Ei)||((n=e).nodeType?s:f)(t,e,r)}];c<i;c++)if(r=wi.relative[e[c].type])l=[_u(Eu(l),r)];else{if((r=wi.filter[e[c].type].apply(null,e[c].matches))[Fi]){for(o=++c;o<i&&!wi.relative[e[o].type];o++);return Au(1<c&&Eu(l),1<c&&Ou(e.slice(0,c-1).concat({value:" "===e[c-2].type?"*":""})).replace(ru,"$1"),r,c<o&&t(e.slice(c,o)),o<i&&t(e=e.slice(o)),o<i&&Ou(e))}l.push(r)}return Eu(l)}(e[n]))[Fi]?c.push(f):s.push(f);(f=Ui(t,(r=s,i=0<(o=c).length,u=0<r.length,a=function(t,e,n,a,c){var s,f,l,d=0,m="0",g=t&&[],p=[],h=Ei,v=t||u&&wi.find.TAG("*",c),b=Vi+=null==h?1:Math.random()||.1,y=v.length;for(c&&(Ei=e!==Ni&&e);m!==y&&null!=(s=v[m]);m++){if(u&&s){for(f=0;l=r[f++];)if(l(s,e,n)){a.push(s);break}c&&(Vi=b)}i&&((s=!l&&s)&&d--,t&&g.push(s))}if(d+=m,i&&m!==d){for(f=0;l=o[f++];)l(g,p,e,n);if(t){if(0<d)for(;m--;)g[m]||p[m]||(p[m]=Xi.call(a));p=Tu(p)}Ki.apply(a,p),c&&!t&&0<p.length&&1<d+o.length&&bu.uniqueSort(a)}return c&&(Vi=b,Ei=h),g},i?xu(a):a))).selector=t}return f},_i=bu.select=function(t,e,n,r){var o,i,u,a,c,s="function"==typeof t&&t,f=!r&&ki(t=s.selector||t);if(n=n||[],1===f.length){if(2<(i=f[0]=f[0].slice(0)).length&&"ID"===(u=i[0]).type&&xi.getById&&9===e.nodeType&&Ri&&wi.relative[i[1].type]){if(!(e=(wi.find.ID(u.matches[0].replace(hu,vu),e)||[])[0]))return n;s&&(e=e.parentNode),t=t.slice(i.shift().value.length)}for(o=su.needsContext.test(t)?0:i.length;o--&&(u=i[o],!wi.relative[a=u.type]);)if((c=wi.find[a])&&(r=c(u.matches[0].replace(hu,vu),gu.test(i[0].type)&&Su(e.parentNode)||e))){if(i.splice(o,1),!(t=r.length&&Ou(i)))return Ki.apply(n,r),n;break}}return(s||Oi(t,f))(r,e,!Ri,n,gu.test(t)&&Su(e.parentNode)||e),n},xi.sortStable=Fi.split("").sort(Wi).join("")===Fi,xi.detectDuplicates=!!Ai,Bi(),xi.sortDetached=!0;var Bu=document,Nu=Array.prototype.push,Du=Array.prototype.slice,Ru=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Mu=bi.Event,Iu=ke.makeMap("children,contents,next,prev"),Pu=function(t){return void 0!==t},Fu=function(t){return"string"==typeof t},Lu=function(t,e){var n,r=(e=e||Bu).createElement("div"),o=e.createDocumentFragment();for(r.innerHTML=t;n=r.firstChild;)o.appendChild(n);return o},Vu=function(t,e,n,r){var o;if(Fu(e))e=Lu(e,Zu(t[0]));else if(e.length&&!e.nodeType){if(e=oa.makeArray(e),r)for(o=e.length-1;0<=o;o--)Vu(t,e[o],n,r);else for(o=0;o<e.length;o++)Vu(t,e[o],n,r);return t}if(e.nodeType)for(o=t.length;o--;)n.call(t[o],e);return t},Hu=function(t,e){return t&&e&&-1!==(" "+t.className+" ").indexOf(" "+e+" ")},zu=function(t,e,n){var r,o;return e=oa(e)[0],t.each((function(){n&&r===this.parentNode||(r=this.parentNode,o=e.cloneNode(!1),this.parentNode.insertBefore(o,this)),o.appendChild(this)})),t},ju=ke.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Uu=ke.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Wu={for:"htmlFor",class:"className",readonly:"readOnly"},qu={float:"cssFloat"},Gu={},$u={},Xu=function(t,e){return new oa.fn.init(t,e)},Yu=/^\s*|\s*$/g,Ku=function(t){return null==t?"":(""+t).replace(Yu,"")},Ju=function(t,e){var n,r,o,i;if(t)if(void 0===(n=t.length)){for(r in t)if(t.hasOwnProperty(r)&&(i=t[r],!1===e.call(i,r,i)))break}else for(o=0;o<n&&(i=t[o],!1!==e.call(i,o,i));o++);return t},Qu=function(t,e){var n=[];return Ju(t,(function(t,r){e(r,t)&&n.push(r)})),n},Zu=function(t){return t?9===t.nodeType?t:t.ownerDocument:Bu};Xu.fn=Xu.prototype={constructor:Xu,selector:"",context:null,length:0,init:function(t,e){var n,r,o=this;if(!t)return o;if(t.nodeType)return o.context=o[0]=t,o.length=1,o;if(e&&e.nodeType)o.context=e;else{if(e)return oa(t).attr(e);o.context=e=document}if(Fu(t)){if(!(n="<"===(o.selector=t).charAt(0)&&">"===t.charAt(t.length-1)&&3<=t.length?[null,t,null]:Ru.exec(t)))return oa(e).find(t);if(n[1])for(r=Lu(t,Zu(e)).firstChild;r;)Nu.call(o,r),r=r.nextSibling;else{if(!(r=Zu(e).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(t);o.length=1,o[0]=r}}else this.add(t,!1);return o},toArray:function(){return ke.toArray(this)},add:function(t,e){var n,r;if(Fu(t))return this.add(oa(t));if(!1!==e)for(n=oa.unique(this.toArray().concat(oa.makeArray(t))),this.length=n.length,r=0;r<n.length;r++)this[r]=n[r];else Nu.apply(this,oa.makeArray(t));return this},attr:function(t,e){var n,r=this;if("object"==typeof t)Ju(t,(function(t,e){r.attr(t,e)}));else{if(!Pu(e)){if(r[0]&&1===r[0].nodeType){if((n=Gu[t])&&n.get)return n.get(r[0],t);if(Uu[t])return r.prop(t)?t:void 0;null===(e=r[0].getAttribute(t,2))&&(e=void 0)}return e}this.each((function(){var n;if(1===this.nodeType){if((n=Gu[t])&&n.set)return void n.set(this,e);null===e?this.removeAttribute(t,2):this.setAttribute(t,e,2)}}))}return r},removeAttr:function(t){return this.attr(t,null)},prop:function(t,e){var n=this;if("object"==typeof(t=Wu[t]||t))Ju(t,(function(t,e){n.prop(t,e)}));else{if(!Pu(e))return n[0]&&n[0].nodeType&&t in n[0]?n[0][t]:e;this.each((function(){1===this.nodeType&&(this[t]=e)}))}return n},css:function(t,e){var n,r,o=this,i=function(t){return t.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()}))},u=function(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t}))};if("object"==typeof t)Ju(t,(function(t,e){o.css(t,e)}));else if(Pu(e))t=i(t),"number"!=typeof e||ju[t]||(e=e.toString()+"px"),o.each((function(){var n=this.style;if((r=$u[t])&&r.set)r.set(this,e);else{try{this.style[qu[t]||t]=e}catch(t){}null!==e&&""!==e||(n.removeProperty?n.removeProperty(u(t)):n.removeAttribute(t))}}));else{if(n=o[0],(r=$u[t])&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(t)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(u(t))}catch(t){return}}return o},remove:function(){for(var t,e=this.length;e--;)t=this[e],Mu.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var t,e=this.length;e--;)for(t=this[e];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(t){var e;if(Pu(t)){e=this.length;try{for(;e--;)this[e].innerHTML=t}catch(n){oa(this[e]).empty().append(t)}return this}return this[0]?this[0].innerHTML:""},text:function(t){var e;if(Pu(t)){for(e=this.length;e--;)"innerText"in this[e]?this[e].innerText=t:this[0].textContent=t;return this}return this[0]?this[0].innerText||this[0].textContent:""},append:function(){return Vu(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(t)}))},prepend:function(){return Vu(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(t,this.firstChild)}),!0)},before:function(){return this[0]&&this[0].parentNode?Vu(this,arguments,(function(t){this.parentNode.insertBefore(t,this)})):this},after:function(){return this[0]&&this[0].parentNode?Vu(this,arguments,(function(t){this.parentNode.insertBefore(t,this.nextSibling)}),!0):this},appendTo:function(t){return oa(t).append(this),this},prependTo:function(t){return oa(t).prepend(this),this},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){return zu(this,t)},wrapAll:function(t){return zu(this,t,!0)},wrapInner:function(t){return this.each((function(){oa(this).contents().wrapAll(t)})),this},unwrap:function(){return this.parent().each((function(){oa(this).replaceWith(this.childNodes)}))},clone:function(){var t=[];return this.each((function(){t.push(this.cloneNode(!0))})),oa(t)},addClass:function(t){return this.toggleClass(t,!0)},removeClass:function(t){return this.toggleClass(t,!1)},toggleClass:function(t,e){var n=this;return"string"!=typeof t||(-1!==t.indexOf(" ")?Ju(t.split(" "),(function(){n.toggleClass(this,e)})):n.each((function(n,r){var o,i=Hu(r,t);i!==e&&(o=r.className,i?r.className=Ku((" "+o+" ").replace(" "+t+" "," ")):r.className+=o?" "+t:t)}))),n},hasClass:function(t){return Hu(this[0],t)},each:function(t){return Ju(this,t)},on:function(t,e){return this.each((function(){Mu.bind(this,t,e)}))},off:function(t,e){return this.each((function(){Mu.unbind(this,t,e)}))},trigger:function(t){return this.each((function(){"object"==typeof t?Mu.fire(this,t.type,t):Mu.fire(this,t)}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new oa(Du.apply(this,arguments))},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(t){for(var e=[],n=0,r=this.length;n<r;n++)oa.find(t,this[n],e);return oa(e)},filter:function(t){return oa("function"==typeof t?Qu(this.toArray(),(function(e,n){return t(n,e)})):oa.filter(t,this.toArray()))},closest:function(t){var e=[];return t instanceof oa&&(t=t[0]),this.each((function(n,r){for(;r;){if("string"==typeof t&&oa(r).is(t)){e.push(r);break}if(r===t){e.push(r);break}r=r.parentNode}})),oa(e)},offset:function(t){var e,n,r,o,i=0,u=0;return t?this.css(t):((e=this[0])&&(r=(n=e.ownerDocument).documentElement,e.getBoundingClientRect&&(i=(o=e.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,u=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:u})},push:Nu,sort:Array.prototype.sort,splice:Array.prototype.splice},ke.extend(Xu,{extend:ke.extend,makeArray:function(t){return(e=t)&&e===e.window||t.nodeType?[t]:ke.toArray(t);var e},inArray:function(t,e){var n;if(e.indexOf)return e.indexOf(t);for(n=e.length;n--;)if(e[n]===t)return n;return-1},isArray:ke.isArray,each:Ju,trim:Ku,grep:Qu,find:bu,expr:bu.selectors,unique:bu.uniqueSort,text:bu.getText,contains:bu.contains,filter:function(t,e,n){var r=e.length;for(n&&(t=":not("+t+")");r--;)1!==e[r].nodeType&&e.splice(r,1);return 1===e.length?oa.find.matchesSelector(e[0],t)?[e[0]]:[]:oa.find.matches(t,e)}});var ta=function(t,e,n){var r=[],o=t[e];for("string"!=typeof n&&n instanceof oa&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&oa(o).is(n))break}1===o.nodeType&&r.push(o),o=o[e]}return r},ea=function(t,e,n,r){var o=[];for(r instanceof oa&&(r=r[0]);t;t=t[e])if(!n||t.nodeType===n){if(void 0!==r){if(t===r)break;if("string"==typeof r&&oa(t).is(r))break}o.push(t)}return o},na=function(t,e,n){for(t=t[e];t;t=t[e])if(t.nodeType===n)return t;return null};Ju({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return ta(t,"parentNode")},next:function(t){return na(t,"nextSibling",1)},prev:function(t){return na(t,"previousSibling",1)},children:function(t){return ea(t.firstChild,"nextSibling",1)},contents:function(t){return ke.toArray(("iframe"===t.nodeName?t.contentDocument||t.contentWindow.document:t).childNodes)}},(function(t,e){Xu.fn[t]=function(n){var r=[];this.each((function(){var t=e.call(r,this,n,r);t&&(oa.isArray(t)?r.push.apply(r,t):r.push(t))})),1<this.length&&(Iu[t]||(r=oa.unique(r)),0===t.indexOf("parents")&&(r=r.reverse()));var o=oa(r);return n?o.filter(n):o}})),Ju({parentsUntil:function(t,e){return ta(t,"parentNode",e)},nextUntil:function(t,e){return ea(t,"nextSibling",1,e).slice(1)},prevUntil:function(t,e){return ea(t,"previousSibling",1,e).slice(1)}},(function(t,e){Xu.fn[t]=function(n,r){var o=[];this.each((function(){var t=e.call(o,this,n,o);t&&(oa.isArray(t)?o.push.apply(o,t):o.push(t))})),1<this.length&&(o=oa.unique(o),0!==t.indexOf("parents")&&"prevUntil"!==t||(o=o.reverse()));var i=oa(o);return r?i.filter(r):i}})),Xu.fn.is=function(t){return!!t&&0<this.filter(t).length},Xu.fn.init.prototype=Xu.fn,Xu.overrideDefaults=function(t){var e,n=function(r,o){return e=e||t(),0===arguments.length&&(r=e.element),o=o||e.context,new n.fn.init(r,o)};return oa.extend(n,this),n},Xu.attrHooks=Gu,Xu.cssHooks=$u;var ra,oa=Xu,ia=ke.each,ua=ke.grep,aa=ye.ie,ca=/^([a-z0-9],?)+$/i,sa=function(t,e){var n=e.attr("style"),r=(r=t.serialize(t.parse(n),e[0].nodeName))||null;e.attr("data-mce-style",r)},fa=function(t,e){var n,r,o=0;if(t)for(n=t.nodeType,t=t.previousSibling;t;t=t.previousSibling)r=t.nodeType,(!e||3!==r||r!==n&&t.nodeValue.length)&&(o++,n=r);return o};function la(t,e){var n=this;void 0===e&&(e={});var r={},o=window,i={},u=0,c=jr.forElement(Ae(t),{contentCssCors:e.contentCssCors,referrerPolicy:e.referrerPolicy}),s=[],f=e.schema?e.schema:ci({}),l=fi({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope},e.schema),d=e.ownEvents?new bi:bi.Event,m=f.getBlockElements(),g=oa.overrideDefaults((function(){return{context:t,element:U.getRoot()}})),p=function(e){return e&&t&&E(e)?t.getElementById(e):e},h=function(t){return g("string"==typeof t?p(t):t)},v=function(t,e,n){var r,o,i=h(t);return i.length&&(o=(r=q[e])&&r.get?r.get(i,e):i.attr(e)),void 0===o&&(o=n||""),o},b=function(t){var e=p(t);return e?e.attributes:[]},y=function(t,n,r){""===r&&(r=null);var o,i=h(t),u=i.attr(n);i.length&&((o=q[n])&&o.set?o.set(i,r,n):i.attr(n,r),u!==r&&e.onSetAttrib&&e.onSetAttrib({attrElm:i,attrName:n,attrValue:r}))},x=function(){return e.root_element||t.body},w=function(e,n){return function(t,e,n){var r,o,i,u=0,a=0,c=t.ownerDocument;if(n=n||t,e){if(n===t&&e.getBoundingClientRect&&"static"===Qn(Ae(t),"position"))return{x:u=(o=e.getBoundingClientRect()).left+(c.documentElement.scrollLeft||t.scrollLeft)-c.documentElement.clientLeft,y:a=o.top+(c.documentElement.scrollTop||t.scrollTop)-c.documentElement.clientTop};for(r=e;r&&r!==n&&r.nodeType&&!or(r,n);)u+=r.offsetLeft||0,a+=r.offsetTop||0,r=r.offsetParent;for(r=e.parentNode;r&&r!==n&&r.nodeType&&!or(r,n);)u-=r.scrollLeft||0,a-=r.scrollTop||0,r=r.parentNode;a+=(i=Ae(e),nr.isFirefox()&&"table"===Ie(i)?rr(Ke(i)).filter((function(t){return"caption"===Ie(t)})).bind((function(t){return rr(Ye(t)).map((function(e){var n=e.dom.offsetTop,r=t.dom.offsetTop,o=t.dom.offsetHeight;return n<=r?-o:0}))})).getOr(0):0)}return{x:u,y:a}}(t.body,p(e),n)},C=function(t,e,n){var r=h(t);return n?r.css(e):("float"===(e=e.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()})))&&(e=ye.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[e]:void 0)},S=function(t){var e,n;return t=p(t),e=C(t,"width"),n=C(t,"height"),-1===e.indexOf("px")&&(e=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(e,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},k=function(t,e){if(!t)return!1;if(!Array.isArray(t)){if("*"===e)return 1===t.nodeType;if(ca.test(e)){for(var n=e.toLowerCase().split(/,/),r=t.nodeName.toLowerCase(),o=n.length-1;0<=o;o--)if(n[o]===r)return!0;return!1}if(t.nodeType&&1!==t.nodeType)return!1}var i=Array.isArray(t)?t:[t];return 0<bu(e,i[0].ownerDocument||i[0],null,i).length},O=function(t,e,n,r){var o,i=[],u=p(t);for(r=void 0===r,n=n||("BODY"!==x().nodeName?x().parentNode:null),ke.is(e,"string")&&(e="*"===(o=e)?function(t){return 1===t.nodeType}:function(t){return k(t,o)});u&&!(u===n||R(u.nodeType)||Fn(u)||Ln(u));){if(!e||"function"==typeof e&&e(u)){if(!r)return[u];i.push(u)}u=u.parentNode}return r?i:null},_=function(t,e,n){var r=e;if(t)for("string"==typeof e&&(r=function(t){return k(t,e)}),t=t[n];t;t=t[n])if("function"==typeof r&&r(t))return t;return null},T=function(t,e,r){var o,i="string"==typeof t?p(t):t;if(!i)return!1;if(ke.isArray(i)&&(i.length||0===i.length))return o=[],ia(i,(function(t,n){t&&o.push(e.call(r,"string"==typeof t?p(t):t,n))})),o;var u=r||n;return e.call(u,i)},A=function(t,e){h(t).each((function(t,n){ia(e,(function(t,e){y(n,e,t)}))}))},B=function(t,e){var n=h(t);aa?n.each((function(t,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+e,n.removeChild(n.firstChild)}catch(t){oa("<div></div>").html("<br>"+e).contents().slice(1).appendTo(n)}return e}})):n.html(e)},N=function(e,n,r,o,i){return T(e,(function(e){var u="string"==typeof n?t.createElement(n):n;return A(u,r),o&&("string"!=typeof o&&o.nodeType?u.appendChild(o):"string"==typeof o&&B(u,o)),i?u:e.appendChild(u)}))},D=function(e,n,r){return N(t.createElement(e),e,n,r,!0)},M=Qo.encodeAllRaw,I=function(t,e){var n=h(t);return e?n.each((function(){for(var t;t=this.firstChild;)3===t.nodeType&&0===t.data.length?this.removeChild(t):this.parentNode.insertBefore(t,this)})).remove():n.remove(),1<n.length?n.toArray():n[0]},P=function(t,e,n){h(t).toggleClass(e,n).each((function(){""===this.className&&oa(this).attr("class",null)}))},F=function(t,e,n){return T(e,(function(e){return ke.is(e,"array")&&(t=t.cloneNode(!0)),n&&ia(ua(e.childNodes),(function(e){t.appendChild(e)})),e.parentNode.replaceChild(t,e)}))},L=function(t){if(En(t)){var e="a"===t.nodeName.toLowerCase()&&!v(t,"href")&&v(t,"id");if(v(t,"name")||v(t,"data-mce-bookmark")||e)return!0}return!1},V=function(){return t.createRange()},H=function(n,r,i,u){if(ke.isArray(n)){for(var a=n.length,c=[];a--;)c[a]=H(n[a],r,i,u);return c}return!e.collect||n!==t&&n!==o||s.push([n,r,i,u]),d.bind(n,r,i,u||U)},z=function(e,n,r){if(ke.isArray(e)){for(var i=e.length,u=[];i--;)u[i]=z(e[i],n,r);return u}if(0<s.length&&(e===t||e===o))for(i=s.length;i--;){var a=s[i];e!==a[0]||n&&n!==a[1]||r&&r!==a[2]||d.unbind(a[0],a[1],a[2])}return d.unbind(e,n,r)},j=function(t){if(t&&En(t)){var e=t.getAttribute("data-mce-contenteditable");return e&&"inherit"!==e?e:"inherit"!==t.contentEditable?t.contentEditable:null}return null},U={doc:t,settings:e,win:o,files:i,stdMode:!0,boxModel:!0,styleSheetLoader:c,boundEvents:s,styles:l,schema:f,events:d,isBlock:function(t){if("string"==typeof t)return!!m[t];if(t){var e=t.nodeType;if(e)return!(1!==e||!m[t.nodeName])}return!1},$:g,$$:h,root:null,clone:function(e,n){if(!aa||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return ia(b(e),(function(t){y(r,t.nodeName,v(e,t.nodeName))})),r},getRoot:x,getViewPort:function(t){var e=kn(t);return{x:e.x,y:e.y,w:e.width,h:e.height}},getRect:function(t){t=p(t);var e=w(t),n=S(t);return{x:e.x,y:e.y,w:n.w,h:n.h}},getSize:S,getParent:function(t,e,n){var r=O(t,e,n,!1);return r&&0<r.length?r[0]:null},getParents:O,get:p,getNext:function(t,e){return _(t,e,"nextSibling")},getPrev:function(t,e){return _(t,e,"previousSibling")},select:function(n,r){return bu(n,p(r)||e.root_element||t,[])},is:k,add:N,create:D,createHTML:function(t,e,n){var r,o="";for(r in o+="<"+t,e)e.hasOwnProperty(r)&&null!==e[r]&&void 0!==e[r]&&(o+=" "+r+'="'+M(e[r])+'"');return void 0!==n?o+">"+n+"</"+t+">":o+" />"},createFragment:function(e){var n,r=t.createElement("div"),o=t.createDocumentFragment();for(o.appendChild(r),e&&(r.innerHTML=e);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:I,setStyle:function(t,n,r){var o=E(n)?h(t).css(n,r):h(t).css(n);e.update_styles&&sa(l,o)},getStyle:C,setStyles:function(t,n){var r=h(t).css(n);e.update_styles&&sa(l,r)},removeAllAttribs:function(t){return T(t,(function(t){for(var e=t.attributes,n=e.length-1;0<=n;n--)t.removeAttributeNode(e.item(n))}))},setAttrib:y,setAttribs:A,getAttrib:v,getPos:w,parseStyle:function(t){return l.parse(t)},serializeStyle:function(t,e){return l.serialize(t,e)},addStyle:function(e){var n,o;if(U!==la.DOM&&t===document){if(r[e])return;r[e]=!0}(o=t.getElementById("mceDefaultStyles"))||((o=t.createElement("style")).id="mceDefaultStyles",o.type="text/css",(n=t.getElementsByTagName("head")[0]).firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o)),o.styleSheet?o.styleSheet.cssText+=e:o.appendChild(t.createTextNode(e))},loadCSS:function(t){W((t=t||"").split(","),(function(t){i[t]=!0,c.load(t,a)}))},addClass:function(t,e){h(t).addClass(e)},removeClass:function(t,e){P(t,e,!1)},hasClass:function(t,e){return h(t).hasClass(e)},toggleClass:P,show:function(t){h(t).show()},hide:function(t){h(t).hide()},isHidden:function(t){return"none"===h(t).css("display")},uniqueId:function(t){return(t||"mce_")+u++},setHTML:B,getOuterHTML:function(t){var e="string"==typeof t?p(t):t;return En(e)?e.outerHTML:oa("<div></div>").append(oa(e).clone()).html()},setOuterHTML:function(t,e){h(t).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}I(oa(this).html(e),!0)}))},decode:Qo.decode,encode:M,insertAfter:function(t,e){var n=p(e);return T(t,(function(t){var e=n.parentNode,r=n.nextSibling;return r?e.insertBefore(t,r):e.appendChild(t),t}))},replace:F,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=D(e),ia(b(t),(function(e){y(n,e.nodeName,v(t,e.nodeName))})),F(n,t,!0)),n||t},findCommonAncestor:function(t,e){for(var n,r=t;r;){for(n=e;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&t.ownerDocument?t.ownerDocument.documentElement:r},toHex:function(t){return l.toHex(ke.trim(t))},run:T,getAttribs:b,isEmpty:function(t,e){var n,r,o=0;if(L(t))return!1;if(t=t.firstChild){var i=new Ur(t,t.parentNode),u=f?f.getWhiteSpaceElements():{};e=e||(f?f.getNonEmptyElements():null);do{if(n=t.nodeType,En(t)){var a=t.getAttribute("data-mce-bogus");if(a){t=i.next("all"===a);continue}if(r=t.nodeName.toLowerCase(),e&&e[r]){if("br"!==r)return!1;o++,t=i.next();continue}if(L(t))return!1}if(8===n)return!1;if(3===n&&!Bo(t.nodeValue))return!1;if(3===n&&t.parentNode&&u[t.parentNode.nodeName]&&Bo(t.nodeValue))return!1;t=i.next()}while(t)}return o<=1},createRng:V,nodeIndex:fa,split:function(t,e,n){var r,o,i,u=V();if(t&&e)return u.setStart(t.parentNode,fa(t)),u.setEnd(e.parentNode,fa(e)),r=u.extractContents(),(u=V()).setStart(e.parentNode,fa(e)+1),u.setEnd(t.parentNode,fa(t)+1),o=u.extractContents(),(i=t.parentNode).insertBefore(Lo(U,r),t),n?i.insertBefore(n,t):i.insertBefore(e,t),i.insertBefore(Lo(U,o),t),I(t),n||e},bind:H,unbind:z,fire:function(t,e,n){return d.fire(t,e,n)},getContentEditable:j,getContentEditableParent:function(t){for(var e=x(),n=null;t&&t!==e&&null===(n=j(t));t=t.parentNode);return n},destroy:function(){if(0<s.length)for(var t=s.length;t--;){var e=s[t];d.unbind(e[0],e[1],e[2])}at(i,(function(t,e){c.unload(e),delete i[e]})),bu.setDocument&&bu.setDocument()},isChildOf:function(t,e){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},dumpRng:function(t){return"startContainer: "+t.startContainer.nodeName+", startOffset: "+t.startOffset+", endContainer: "+t.endContainer.nodeName+", endOffset: "+t.endOffset}},q=function(t,e,n){var r=e.keep_values,o={set:function(t,r,o){e.url_converter&&(r=e.url_converter.call(e.url_converter_scope||n(),r,o,t[0])),t.attr("data-mce-"+o,r).attr(o,r)},get:function(t,e){return t.attr("data-mce-"+e)||t.attr(e)}},i={style:{set:function(e,n){null===n||"object"!=typeof n?(r&&e.attr("data-mce-style",n),null!==n&&"string"==typeof n?(e.removeAttr("style"),e.css(t.parse(n))):e.attr("style",n)):e.css(n)},get:function(e){var n=e.attr("data-mce-style")||e.attr("style");return t.serialize(t.parse(n),e[0].nodeName)}}};return r&&(i.href=i.src=o),i}(l,e,(function(){return U}));return U}(ra=la=la||{}).DOM=ra(document),ra.nodeIndex=fa;var da=la,ma=da.DOM,ga=ke.each,pa=ke.grep,ha=(va.prototype._setReferrerPolicy=function(t){this.settings.referrerPolicy=t},va.prototype.loadScript=function(t,e,n){var r=ma,o=function(){r.remove(i),u&&(u.onerror=u.onload=u=null)},i=r.uniqueId(),u=document.createElement("script");u.id=i,u.type="text/javascript",u.src=ke._addCacheSuffix(t),this.settings.referrerPolicy&&r.setAttrib(u,"referrerpolicy",this.settings.referrerPolicy),u.onload=function(){o(),e()},u.onerror=function(){o(),I(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName("head")[0]||document.body).appendChild(u)},va.prototype.isDone=function(t){return 2===this.states[t]},va.prototype.markDone=function(t){this.states[t]=2},va.prototype.add=function(t,e,n,r){var o=this.states[t];this.queue.push(t),void 0===o&&(this.states[t]=0),e&&(this.scriptLoadedCallbacks[t]||(this.scriptLoadedCallbacks[t]=[]),this.scriptLoadedCallbacks[t].push({success:e,failure:r,scope:n||this}))},va.prototype.load=function(t,e,n,r){return this.add(t,e,n,r)},va.prototype.remove=function(t){delete this.states[t],delete this.scriptLoadedCallbacks[t]},va.prototype.loadQueue=function(t,e,n){this.loadScripts(this.queue,t,e,n)},va.prototype.loadScripts=function(t,e,n,r){var o=this,i=[],u=function(t,e){ga(o.scriptLoadedCallbacks[e],(function(e){I(e[t])&&e[t].call(e.scope)})),o.scriptLoadedCallbacks[e]=void 0};o.queueLoadedCallbacks.push({success:e,failure:r,scope:n||this});var a=function(){var e,n=pa(t);t.length=0,ga(n,(function(t){2!==o.states[t]?3!==o.states[t]?1!==o.states[t]&&(o.states[t]=1,o.loading++,o.loadScript(t,(function(){o.states[t]=2,o.loading--,u("success",t),a()}),(function(){o.states[t]=3,o.loading--,i.push(t),u("failure",t),a()}))):u("failure",t):u("success",t)})),o.loading||(e=o.queueLoadedCallbacks.slice(0),o.queueLoadedCallbacks.length=0,ga(e,(function(t){0===i.length?I(t.success)&&t.success.call(t.scope):I(t.failure)&&t.failure.call(t.scope,i)})))};a()},va.ScriptLoader=new va,va);function va(t){void 0===t&&(t={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=t}var ba,ya=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},xa={},wa=ya("en"),Ca=function(){return gt(xa,wa.get())},Sa={getData:function(){return ct(xa,(function(t){return Ot({},t)}))},setCode:function(t){t&&wa.set(t)},getCode:function(){return wa.get()},add:function(t,e){var n=xa[t];n||(xa[t]=n={}),at(e,(function(t,e){n[e.toLowerCase()]=t}))},translate:function(t){var e,n,r=Ca().getOr({}),o=function(t){return I(t)?Object.prototype.toString.call(t):i(t)?"":""+t},i=function(t){return""===t||null==t},u=function(t){var e=o(t);return gt(r,e.toLowerCase()).map(o).getOr(e)},a=function(t){return t.replace(/{context:\w+}$/,"")};if(i(t))return"";if(T(e=t)&&pt(e,"raw"))return o(t.raw);if(A(n=t)&&1<n.length){var c=t.slice(1);return a(u(t[0]).replace(/\{([0-9]+)\}/g,(function(t,e){return pt(c,e)?o(c[e]):t})))}return a(u(t))},isRtl:function(){return Ca().bind((function(t){return gt(t,"_dir")})).exists((function(t){return"rtl"===t}))},hasCode:function(t){return pt(xa,t)}};function ka(){var t=this,e=[],n={},r={},o=[],i=function(t,e){var n=G(o,(function(n){return n.name===t&&n.state===e}));W(n,(function(t){return t.callback()}))},u=function(t){var e;return r[t]&&(e=r[t].dependencies),e||[]},a=function(t,e){return"object"==typeof e?e:"string"==typeof t?{prefix:"",resource:e,suffix:""}:{prefix:t.prefix,resource:e,suffix:t.suffix}},c=function(t,e,o,s,f){var l,d;n[t]||(0!==(l="string"==typeof e?e:e.prefix+e.resource+e.suffix).indexOf("/")&&-1===l.indexOf("://")&&(l=ka.baseURL+"/"+l),n[t]=l.substring(0,l.lastIndexOf("/")),d=function(){var n,r,f,l;i(t,"loaded"),n=e,r=o,f=s,l=u(t),W(l,(function(t){var e=a(n,t);c(e.resource,e,void 0,void 0)})),r&&(f?r.call(f):r.call(ha))},r[t]?d():ha.ScriptLoader.add(l,d,s,f))},s=function(t,e,i){void 0===i&&(i="added"),pt(r,t)&&"added"===i||pt(n,t)&&"loaded"===i?e():o.push({name:t,state:i,callback:e})};return{items:e,urls:n,lookup:r,_listeners:o,get:function(t){return r[t]?r[t].instance:void 0},dependencies:u,requireLangPack:function(t,e){!1!==ka.languageLoad&&s(t,(function(){var r=Sa.getCode();!r||e&&-1===(","+(e||"")+",").indexOf(","+r+",")||ha.ScriptLoader.add(n[t]+"/langs/"+r+".js")}),"loaded")},add:function(t,n,o){var u=n;return e.push(u),r[t]={instance:u,dependencies:o},i(t,"added"),u},remove:function(t){delete n[t],delete r[t]},createUrl:a,addComponents:function(e,n){var r=t.urls[e];W(n,(function(t){ha.ScriptLoader.add(r+"/"+t)}))},load:c,waitFor:s}}(ba=ka=ka||{}).PluginManager=ba(),ba.ThemeManager=ba();var Oa,_a=ka,Ea=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];null===n&&(n=setTimeout((function(){t.apply(null,r),n=null}),e))}}},Ta=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];null!==n&&clearTimeout(n),n=setTimeout((function(){t.apply(null,r),n=null}),e)}}},Aa=function(t,e){var n=Yn(t,e);return void 0===n||""===n?[]:n.split(" ")},Ba=function(t){return void 0!==t.dom.classList},Na=function(t,e){Ba(t)?t.dom.classList.add(e):function(t,e){return r=e,o=Aa(n=t,"class").concat([r]),$n(n,"class",o.join(" ")),!0;var n,r,o}(t,e)},Da=function(t,e){return Ba(t)&&t.dom.classList.contains(e)},Ra=function(t,e){var n=[];return W(Ke(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(Ra(t,e))})),n},Ma=function(t,e){return n=e,o=void 0===(r=t)?document:r.dom,De(o)?[]:U(o.querySelectorAll(n),Ae);var n,r,o},Ia=s("mce-annotation"),Pa=s("data-mce-annotation"),Fa=s("data-mce-annotation-uid"),La=function(t,e){var n=t.selection.getRng(),r=Ae(n.startContainer),o=Ae(t.getBody()),i=e.fold((function(){return"."+Ia()}),(function(t){return"["+Pa()+'="'+t+'"]'})),u=Je(r,n.startOffset).getOr(r),a=Er(u,i,(function(t){return Re(t,o)})),c=function(t,e){return n=e,(r=t.dom)&&r.hasAttribute&&r.hasAttribute(n)?S.some(Yn(t,e)):S.none();var n,r};return a.bind((function(e){return c(e,""+Fa()).bind((function(n){return c(e,""+Pa()).map((function(e){var r=Va(t,n);return{uid:n,name:e,elements:r}}))}))}))},Va=function(t,e){var n=Ae(t.getBody());return Ma(n,"["+Fa()+'="'+e+'"]')},Ha=0,za=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++Ha+String(e)},ja=function(t,e){var n,r,o=je(t).dom,i=Ae(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,Ke(Ae(r)));ln(i,u),dn(t),fn(t,i)},Ua=function(t,e){return Ae(t.dom.cloneNode(e))},Wa=function(t){return Ua(t,!1)},qa=function(t){return Ua(t,!0)},Ga=function(t,e,n){void 0===n&&(n=b);var r=new Ur(t,e),o=function(t){for(var e;(e=r[t]())&&!In(e)&&!n(e););return S.from(e).filter(In)};return{current:function(){return S.from(r.current()).filter(In)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},$a=function(t,e){var n=e||function(e){return t.isBlock(e)||Vn(e)||jn(e)},r=function(t,e,n,o){if(In(t)){var i=o(t,e,t.data);if(-1!==i)return S.some({container:t,offset:i})}return n().bind((function(t){return r(t.container,t.offset,n,o)}))};return{backwards:function(t,e,o,i){var u=Ga(t,i,n);return r(t,e,(function(){return u.prev().map((function(t){return{container:t,offset:t.length}}))}),o).getOrNull()},forwards:function(t,e,o,i){var u=Ga(t,i,n);return r(t,e,(function(){return u.next().map((function(t){return{container:t,offset:0}}))}),o).getOrNull()}}},Xa=function(t,e,n){return t.isSome()&&e.isSome()?S.some(n(t.getOrDie(),e.getOrDie())):S.none()},Ya=Math.round,Ka=function(t){return t?{left:Ya(t.left),top:Ya(t.top),bottom:Ya(t.bottom),right:Ya(t.right),width:Ya(t.width),height:Ya(t.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},Ja=function(t,e){return t=Ka(t),e||(t.left=t.left+t.width),t.right=t.left,t.width=0,t},Qa=function(t,e,n){return 0<=t&&t<=Math.min(e.height,n.height)/2},Za=function(t,e){var n=Math.min(e.height/2,t.height/2);return t.bottom-n<e.top||!(t.top>e.bottom)&&Qa(e.top-t.bottom,t,e)},tc=function(t,e){return t.top>e.bottom||!(t.bottom<e.top)&&Qa(e.bottom-t.top,t,e)},ec=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},nc=function(t){var e=t.startContainer,n=t.startOffset;return e.hasChildNodes()&&t.endOffset===n+1?e.childNodes[n]:null},rc=function(t,e){return 1===t.nodeType&&t.hasChildNodes()&&(e>=t.childNodes.length&&(e=t.childNodes.length-1),t=t.childNodes[e]),t},oc=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),ic=function(t){return"string"==typeof t&&768<=t.charCodeAt(0)&&oc.test(t)},uc=En,ac=_o,cc=An("display","block table"),sc=An("float","left right"),fc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(!t[n](e))return!1;return!0}}(uc,ac,p(sc)),lc=p(An("white-space","pre pre-line pre-wrap")),dc=In,mc=Vn,gc=da.nodeIndex,pc=rc,hc=function(t){return"createRange"in t?t.createRange():da.DOM.createRng()},vc=function(t){return t&&/[\r\n\t ]/.test(t)},bc=function(t){return!!t.setStart&&!!t.setEnd},yc=function(t){var e,n=t.startContainer,r=t.startOffset;return!!(vc(t.toString())&&lc(n.parentNode)&&In(n)&&(e=n.data,vc(e[r-1])||vc(e[r+1])))},xc=function(t){return 0===t.left&&0===t.right&&0===t.top&&0===t.bottom},wc=function(t){var e=t.getClientRects(),n=0<e.length?Ka(e[0]):Ka(t.getBoundingClientRect());return!bc(t)&&mc(t)&&xc(n)?function(t){var e=t.ownerDocument,n=hc(e),r=e.createTextNode(no),o=t.parentNode;o.insertBefore(r,t),n.setStart(r,0),n.setEnd(r,1);var i=Ka(n.getBoundingClientRect());return o.removeChild(r),i}(t):xc(n)&&bc(t)?function(t){var e=t.startContainer,n=t.endContainer,r=t.startOffset,o=t.endOffset;if(e===n&&In(n)&&0===r&&1===o){var i=t.cloneRange();return i.setEndAfter(n),wc(i)}return null}(t):n},Cc=function(t,e){var n=Ja(t,e);return n.width=1,n.right=n.left+1,n};function Sc(t,e,n){var r=function(){return n=n||function(t){var e,n,r=[],o=function(t){var e,n;0!==t.height&&(0<r.length&&(e=t,n=r[r.length-1],e.left===n.left&&e.top===n.top&&e.bottom===n.bottom&&e.right===n.right)||r.push(t))},i=function(t,e){var n=hc(t.ownerDocument);if(e<t.data.length){if(ic(t.data[e]))return r;if(ic(t.data[e-1])&&(n.setStart(t,e),n.setEnd(t,e+1),!yc(n)))return o(Cc(wc(n),!1)),r}0<e&&(n.setStart(t,e-1),n.setEnd(t,e),yc(n)||o(Cc(wc(n),!1))),e<t.data.length&&(n.setStart(t,e),n.setEnd(t,e+1),yc(n)||o(Cc(wc(n),!0)))};if(dc(t.container()))return i(t.container(),t.offset()),r;if(uc(t.container()))if(t.isAtEnd())n=pc(t.container(),t.offset()),dc(n)&&i(n,n.data.length),fc(n)&&!mc(n)&&o(Cc(wc(n),!1));else{if(n=pc(t.container(),t.offset()),dc(n)&&i(n,0),fc(n)&&t.isAtEnd())return o(Cc(wc(n),!1)),r;e=pc(t.container(),t.offset()-1),fc(e)&&!mc(e)&&(!cc(e)&&!cc(n)&&fc(n)||o(Cc(wc(e),!1))),fc(n)&&o(Cc(wc(n),!0))}return r}(Sc(t,e))};return{container:s(t),offset:s(e),toRange:function(){var n=hc(t.ownerDocument);return n.setStart(t,e),n.setEnd(t,e),n},getClientRects:r,isVisible:function(){return 0<r().length},isAtStart:function(){return dc(t),0===e},isAtEnd:function(){return dc(t)?e>=t.data.length:e>=t.childNodes.length},isEqual:function(n){return n&&t===n.container()&&e===n.offset()},getNode:function(n){return pc(t,n?e-1:e)}}}(Oa=Sc=Sc||{}).fromRangeStart=function(t){return Oa(t.startContainer,t.startOffset)},Oa.fromRangeEnd=function(t){return Oa(t.endContainer,t.endOffset)},Oa.after=function(t){return Oa(t.parentNode,gc(t)+1)},Oa.before=function(t){return Oa(t.parentNode,gc(t))},Oa.isAbove=function(t,e){return Xa(nt(e.getClientRects()),rt(t.getClientRects()),Za).getOr(!1)},Oa.isBelow=function(t,e){return Xa(rt(e.getClientRects()),nt(t.getClientRects()),tc).getOr(!1)},Oa.isAtStart=function(t){return!!t&&t.isAtStart()},Oa.isAtEnd=function(t){return!!t&&t.isAtEnd()},Oa.isTextPosition=function(t){return!!t&&In(t.container())},Oa.isElementPosition=function(t){return!1===Oa.isTextPosition(t)};var kc,Oc,_c=Sc,Ec=function(t,e){In(e)&&0===e.data.length&&t.remove(e)},Tc=function(t,e,n){var r,o,i,u,a,c,s;Ln(n)?(i=t,u=e,a=n,c=S.from(a.firstChild),s=S.from(a.lastChild),u.insertNode(a),c.each((function(t){return Ec(i,t.previousSibling)})),s.each((function(t){return Ec(i,t.nextSibling)}))):(r=t,o=n,e.insertNode(o),Ec(r,o.previousSibling),Ec(r,o.nextSibling))},Ac=In,Bc=Nn,Nc=da.nodeIndex,Dc=function(t){var e=t.parentNode;return Bc(e)?Dc(e):e},Rc=function(t){return t?Ct(t.childNodes,(function(t,e){return Bc(e)&&"BR"!==e.nodeName?t=t.concat(Rc(e)):t.push(e),t}),[]):[]},Mc=function(t){return function(e){return t===e}},Ic=function(t){return(Ac(t)?"text()":t.nodeName.toLowerCase())+"["+function(t){var e=Rc(Dc(t)),n=St(e,Mc(t),t);e=e.slice(0,n+1);var r=Ct(e,(function(t,n,r){return Ac(n)&&Ac(e[r-1])&&t++,t}),0);return e=xt(e,Tn([t.nodeName])),(n=St(e,Mc(t),t))-r}(t)+"]"},Pc=function(t,e){var n,r,o,i=[],u=e.container(),a=e.offset();return Ac(u)?n=function(t,e){for(;(t=t.previousSibling)&&Ac(t);)e+=t.data.length;return e}(u,a):(a>=(r=u.childNodes).length?(n="after",a=r.length-1):n="before",u=r[a]),i.push(Ic(u)),o=function(t,e,n){var r=[];for(e=e.parentNode;e!==t;e=e.parentNode)r.push(e);return r}(t,u),o=xt(o,p(Nn)),(i=i.concat(yt(o,Ic))).reverse().join("/")+","+n},Fc=function(t,e){if(!e)return null;var n=e.split(","),r=n[0].split("/"),o=1<n.length?n[1]:"before",i=Ct(r,(function(t,e){var n,r,o,i,u=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(e);return u?("text()"===u[1]&&(u[1]="#text"),n=t,r=u[1],o=parseInt(u[2],10),i=Rc(n),i=xt(i,(function(t,e){return!Ac(t)||!Ac(i[e-1])})),(i=xt(i,Tn([r])))[o]):null}),t);return i?Ac(i)?function(t,e){for(var n,r=t,o=0;Ac(r);){if(n=r.data.length,o<=e&&e<=o+n){t=r,e-=o;break}if(!Ac(r.nextSibling)){t=r,e=n;break}o+=n,r=r.nextSibling}return Ac(t)&&e>t.data.length&&(e=t.data.length),_c(t,e)}(i,parseInt(o,10)):(o="after"===o?Nc(i)+1:Nc(i),_c(i.parentNode,o)):null},Lc=jn,Vc=function(t,e,n,r,o){var i,u=r[o?"startContainer":"endContainer"],a=r[o?"startOffset":"endOffset"],c=[],s=0,f=t.getRoot();for(In(u)?c.push(n?function(t,e,n){for(var r=t(e.data.slice(0,n)).length,o=e.previousSibling;o&&In(o);o=o.previousSibling)r+=t(o.data).length;return r}(e,u,a):a):(a>=(i=u.childNodes).length&&i.length&&(s=1,a=Math.max(0,i.length-1)),c.push(t.nodeIndex(i[a],n)+s));u&&u!==f;u=u.parentNode)c.push(t.nodeIndex(u,n));return c},Hc=function(t,e,n){var r=0;return ke.each(t.select(e),(function(t){if("all"!==t.getAttribute("data-mce-bogus"))return t!==n&&void r++})),r},zc=function(t,e){var n,r=e?"start":"end",o=t[r+"Container"],i=t[r+"Offset"];En(o)&&"TR"===o.nodeName&&(o=(n=o.childNodes)[Math.min(e?i:i-1,n.length-1)])&&(i=e?0:o.childNodes.length,t["set"+(e?"Start":"End")](o,i))},jc=function(t){return zc(t,!0),zc(t,!1),t},Uc=function(t,e){var n;if(En(t)&&(t=rc(t,e),Lc(t)))return t;if(fo(t)){if(In(t)&&co(t)&&(t=t.parentNode),n=t.previousSibling,Lc(n))return n;if(n=t.nextSibling,Lc(n))return n}},Wc=function(t,e,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(Lc(r)||"IMG"===o)return{name:o,index:Hc(n.dom,o,r)};var u,a,c,s,f,l,d,m=Uc((u=i).startContainer,u.startOffset)||Uc(u.endContainer,u.endOffset);return m?{name:o=m.tagName,index:Hc(n.dom,o,m)}:(a=t,s=e,f=i,l=(c=n).dom,(d={}).start=Vc(l,a,s,f,!0),c.isCollapsed()||(d.end=Vc(l,a,s,f,!1)),d)},qc=function(t,e,n){var r={"data-mce-type":"bookmark",id:e,style:"overflow:hidden;line-height:0px"};return n?t.create("span",r,"&#xFEFF;"):t.create("span",r)},Gc=function(t,e){var n=t.dom,r=t.getRng(),o=n.uniqueId(),i=t.isCollapsed(),u=t.getNode(),a=u.nodeName;if("IMG"===a)return{name:a,index:Hc(n,a,u)};var c,s=jc(r.cloneRange());i||(s.collapse(!1),c=qc(n,o+"_end",e),Tc(n,s,c)),(r=jc(r)).collapse(!0);var f=qc(n,o+"_start",e);return Tc(n,r,f),t.moveToBookmark({id:o,keep:!0}),{id:o}},$c=l(Wc,f,!0),Xc=da.DOM,Yc=function(t,e,n){var r=t.getParam(e,n);if(-1===r.indexOf("="))return r;var o=t.getParam(e,"","hash");return o.hasOwnProperty(t.id)?o[t.id]:n},Kc=function(t){return t.getParam("content_security_policy","")},Jc=function(t){if(t.getParam("force_p_newlines",!1))return"p";var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},Qc=function(t){return t.getParam("forced_root_block_attrs",{})},Zc=function(t){return t.getParam("automatic_uploads",!0,"boolean")},ts=function(t){return t.getParam("icons","","string")},es=function(t){return t.getParam("referrer_policy","","string")},ns=function(t){return t.getParam("language","en","string")},rs=function(t){return t.getParam("indent_use_margin",!1)},os=function(t){var e=t.getParam("object_resizing");return!1!==e&&!ye.iOS&&(E(e)?e:"table,img,figure.image,div")},is=function(t){return t.getParam("event_root")},us=function(t){return t.getParam("theme")},as=function(t){return!1!==t.getParam("inline_boundaries")},cs=function(t){return t.getParam("plugins","","string")},ss=En,fs=In,ls=function(t){var e=t.parentNode;e&&e.removeChild(t)},ds=function(t){var e=io(t);return{count:t.length-e.length,text:e}},ms=function(t){for(var e;-1!==(e=t.data.lastIndexOf(ro));)t.deleteData(e,1)},gs=function(t,e){return vs(t),e},ps=function(t,e){var n,r,o=e.container(),i=(n=ot(o.childNodes),(-1===(r=H(n,t))?S.none():S.some(r)).map((function(t){return t<e.offset()?_c(o,e.offset()-1):e})).getOr(e));return vs(t),i},hs=function(t,e){return _c.isTextPosition(e)?function(t,e){return fs(t)&&e.container()===t?(r=e,o=ds((n=t).data.substr(0,r.offset())),i=ds(n.data.substr(r.offset())),0<(o.text+i.text).length?(ms(n),_c(n,r.offset()-o.count)):r):gs(t,e);var n,r,o,i}(t,e):(n=t,((r=e).container()===n.parentNode?ps:gs)(n,r));var n,r},vs=function(t){ss(t)&&fo(t)&&(lo(t)?t.removeAttribute("data-mce-caret"):ls(t)),fs(t)&&(ms(t),0===t.data.length&&ls(t))},bs=fe().browser,ys=jn,xs=Wn,ws=Un,Cs=function(t,e,n){var r,o,i,u,a=Ja(e.getBoundingClientRect(),n),c="BODY"===t.tagName?(r=t.ownerDocument.documentElement,o=t.scrollLeft||r.scrollLeft,t.scrollTop||r.scrollTop):(u=t.getBoundingClientRect(),o=t.scrollLeft-u.left,t.scrollTop-u.top);return a.left+=o,a.right+=o,a.top+=c,a.bottom+=c,a.width=1,0<(i=e.offsetWidth-e.clientWidth)&&(n&&(i*=-1),a.left+=i,a.right+=i),a},Ss=function(t,e,n,r){var o,i,u=ya(S.none()),a=Jc(t),c=0<a.length?a:"p",s=function(){!function(t){for(var e=Ma(Ae(t),"*[contentEditable=false],video,audio,embed,object"),n=0;n<e.length;n++){var r,o=e[n].dom,i=o.previousSibling;ho(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(r.length-1,1)),i=o.nextSibling,po(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(0,1))}}(e),i&&(vs(i),i=null),u.get().each((function(t){oa(t.caret).remove(),u.set(S.none())})),o&&(Vr.clearInterval(o),o=null)},f=function(){o=Vr.setInterval((function(){r()?oa("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):oa("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")}),500)};return{show:function(t,r){var o,a;if(s(),ws(r))return null;if(!n(r))return i=function(t,e){var n,r=t.ownerDocument.createTextNode(ro),o=t.parentNode;if(e){if(n=t.previousSibling,ao(n)){if(fo(n))return n;if(ho(n))return n.splitText(n.data.length-1)}o.insertBefore(r,t)}else{if(n=t.nextSibling,ao(n)){if(fo(n))return n;if(po(n))return n.splitText(1),n}t.nextSibling?o.insertBefore(r,t.nextSibling):o.appendChild(r)}return r}(r,t),a=r.ownerDocument.createRange(),Os(i.nextSibling)?(a.setStart(i,0),a.setEnd(i,0)):(a.setStart(i,1),a.setEnd(i,1)),a;i=function(t,e,n){var r,o=e.ownerDocument.createElement(t);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(((r=document.createElement("br")).setAttribute("data-mce-bogus","1"),r));var i=e.parentNode;return n?i.insertBefore(o,e):e.nextSibling?i.insertBefore(o,e.nextSibling):i.appendChild(o),o}(c,r,t),o=Cs(e,r,t),oa(i).css("top",o.top);var l=oa('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(o).appendTo(e)[0];return u.set(S.some({caret:l,element:r,before:t})),u.get().each((function(e){t&&oa(e.caret).addClass("mce-visual-caret-before")})),f(),(a=r.ownerDocument.createRange()).setStart(i,0),a.setEnd(i,0),a},hide:s,getCss:function(){return".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:function(){u.get().each((function(t){var n=Cs(e,t.element,t.before);oa(t.caret).css(Ot({},n))}))},destroy:function(){return Vr.clearInterval(o)}}},ks=function(){return bs.isIE()||bs.isEdge()||bs.isFirefox()},Os=function(t){return ys(t)||xs(t)},_s=function(t){return Os(t)||Dn(t)&&ks()},Es=jn,Ts=Wn,As=An("display","block table table-cell table-caption list-item"),Bs=fo,Ns=co,Ds=En,Rs=_o,Ms=function(t,e){for(var n;n=t(e);)if(!Ns(n))return n;return null},Is=function(t,e,n,r,o){var i=new Ur(t,r),u=Es(t)||Ns(t);if(e<0){if(u&&n(t=Ms(i.prev,!0)))return t;for(;t=Ms(i.prev,o);)if(n(t))return t}if(0<e){if(u&&n(t=Ms(i.next,!0)))return t;for(;t=Ms(i.next,o);)if(n(t))return t}return null},Ps=function(t,e){for(;t&&t!==e;){if(As(t))return t;t=t.parentNode}return null},Fs=function(t,e,n){return Ps(t.container(),n)===Ps(e.container(),n)},Ls=function(t,e){if(!e)return null;var n=e.container(),r=e.offset();return Ds(n)?n.childNodes[r+t]:null},Vs=function(t,e){var n=e.ownerDocument.createRange();return t?(n.setStartBefore(e),n.setEndBefore(e)):(n.setStartAfter(e),n.setEndAfter(e)),n},Hs=function(t,e,n){for(var r,o,i,u=t?"previousSibling":"nextSibling";n&&n!==e;){if(r=n[u],Bs(r)&&(r=r[u]),Es(r)||Ts(r)){if(i=n,Ps(r,o=e)===Ps(i,o))return r;break}if(Rs(r))break;n=n.parentNode}return null},zs=l(Vs,!0),js=l(Vs,!1),Us=function(t,e,n){var r,o,i=l(Hs,!0,e),u=l(Hs,!1,e),a=n.startContainer,c=n.startOffset;if(co(a)){if(Ds(a)||(a=a.parentNode),"before"===(o=a.getAttribute("data-mce-caret"))&&(r=a.nextSibling,_s(r)))return zs(r);if("after"===o&&(r=a.previousSibling,_s(r)))return js(r)}if(!n.collapsed)return n;if(In(a)){if(Bs(a)){if(1===t){if(r=u(a))return zs(r);if(r=i(a))return js(r)}if(-1===t){if(r=i(a))return js(r);if(r=u(a))return zs(r)}return n}if(ho(a)&&c>=a.data.length-1)return 1===t&&(r=u(a))?zs(r):n;if(po(a)&&c<=1)return-1===t&&(r=i(a))?js(r):n;if(c===a.data.length)return(r=u(a))?zs(r):n;if(0===c)return(r=i(a))?js(r):n}return n},Ws=function(t,e){return S.from(Ls(t?0:-1,e)).filter(Es)},qs=function(t,e,n){var r=Us(t,e,n);return-1===t?Sc.fromRangeStart(r):Sc.fromRangeEnd(r)},Gs=function(t){return S.from(t.getNode()).map(Ae)},$s=function(t,e){for(;e=t(e);)if(e.isVisible())return e;return e},Xs=function(t,e){var n=Fs(t,e);return!(n||!Vn(t.getNode()))||n};(Oc=kc=kc||{})[Oc.Backwards=-1]="Backwards",Oc[Oc.Forwards=1]="Forwards";var Ys,Ks,Js=jn,Qs=In,Zs=En,tf=Vn,ef=_o,nf=function(t){return So(t)||!!Eo(e=t)&&!0!==X(ot(e.getElementsByTagName("*")),(function(t,e){return t||bo(e)}),!1);var e},rf=To,of=function(t,e){return t.hasChildNodes()&&e<t.childNodes.length?t.childNodes[e]:null},uf=function(t,e){if(0<t){if(ef(e.previousSibling)&&!Qs(e.previousSibling))return _c.before(e);if(Qs(e))return _c(e,0)}if(t<0){if(ef(e.nextSibling)&&!Qs(e.nextSibling))return _c.after(e);if(Qs(e))return _c(e,e.data.length)}return t<0&&!tf(e)?_c.after(e):_c.before(e)},af=function(t,e,n){var r,o,i,u;if(!Zs(n)||!e)return null;if(e.isEqual(_c.after(n))&&n.lastChild){if(u=_c.after(n.lastChild),t<0&&ef(n.lastChild)&&Zs(n.lastChild))return tf(n.lastChild)?_c.before(n.lastChild):u}else u=e;var a,c,s,f=u.container(),l=u.offset();if(Qs(f)){if(t<0&&0<l)return _c(f,--l);if(0<t&&l<f.length)return _c(f,++l);r=f}else{if(t<0&&0<l&&(o=of(f,l-1),ef(o)))return!nf(o)&&(i=Is(o,t,rf,o))?Qs(i)?_c(i,i.data.length):_c.after(i):Qs(o)?_c(o,o.data.length):_c.before(o);if(0<t&&l<f.childNodes.length&&(o=of(f,l),ef(o)))return tf(o)?(a=n,(s=(c=o).nextSibling)&&ef(s)?Qs(s)?_c(s,0):_c.before(s):af(kc.Forwards,_c.after(c),a)):!nf(o)&&(i=Is(o,t,rf,o))?Qs(i)?_c(i,0):_c.before(i):Qs(o)?_c(o,0):_c.after(o);r=o||u.getNode()}if((0<t&&u.isAtEnd()||t<0&&u.isAtStart())&&(r=Is(r,t,y,n,!0),rf(r,n)))return uf(t,r);o=Is(r,t,rf,n);var d=kt(G(function(t,e){for(var n=[];t&&t!==e;)n.push(t),t=t.parentNode;return n}(f,n),Js));return!d||o&&d.contains(o)?o?uf(t,o):null:u=0<t?_c.after(d):_c.before(d)},cf=function(t){return{next:function(e){return af(kc.Forwards,e,t)},prev:function(e){return af(kc.Backwards,e,t)}}},sf=function(t){return _c.isTextPosition(t)?0===t.offset():_o(t.getNode())},ff=function(t){if(_c.isTextPosition(t)){var e=t.container();return t.offset()===e.data.length}return _o(t.getNode(!0))},lf=function(t,e){return!_c.isTextPosition(t)&&!_c.isTextPosition(e)&&t.getNode()===e.getNode(!0)},df=function(t,e,n){var r=cf(e);return S.from(t?r.next(n):r.prev(n))},mf=function(t,e,n){return df(t,e,n).bind((function(r){return Fs(n,r,e)&&function(t,e,n){return t?!lf(e,n)&&(r=e,!(!_c.isTextPosition(r)&&Vn(r.getNode())))&&ff(e)&&sf(n):!lf(n,e)&&sf(e)&&ff(n);var r}(t,n,r)?df(t,e,r):S.some(r)}))},gf=function(t,e,n,r){return mf(t,e,n).bind((function(n){return r(n)?gf(t,e,n,r):S.some(n)}))},pf=function(t,e){var n,r,o,i,u,a=t?e.firstChild:e.lastChild;return In(a)?S.some(_c(a,t?0:a.data.length)):a?_o(a)?S.some(t?_c.before(a):Vn(u=a)?_c.before(u):_c.after(u)):(r=e,o=a,i=(n=t)?_c.before(o):_c.after(o),df(n,r,i)):S.none()},hf=l(df,!0),vf=l(df,!1),bf=l(pf,!0),yf=l(pf,!1),xf="_mce_caret",wf=function(t){return En(t)&&t.id===xf},Cf=function(t,e){for(;e&&e!==t;){if(e.id===xf)return e;e=e.parentNode}return null},Sf=function(t,e){return En(e)&&t.isBlock(e)&&!e.innerHTML&&!ye.ie&&(e.innerHTML='<br data-mce-bogus="1" />'),e},kf=function(t,e,n){return!(!1!==e.hasChildNodes()||!Cf(t,e)||(o=n,i=(r=e).ownerDocument.createTextNode(ro),r.appendChild(i),o.setStart(i,0),o.setEnd(i,0),0));var r,o,i},Of=function(t,e,n,r){var o,i,u,a,c=n[e?"start":"end"],s=t.getRoot();if(c){for(u=c[0],i=s,o=c.length-1;1<=o;o--){if(a=i.childNodes,kf(s,i,r))return!0;if(c[o]>a.length-1)return!!kf(s,i,r)||function(t,e){return yf(t).fold((function(){return!1}),(function(t){return e.setStart(t.container(),t.offset()),e.setEnd(t.container(),t.offset()),!0}))}(i,r);i=a[c[o]]}3===i.nodeType&&(u=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(u=Math.min(c[0],i.childNodes.length)),e?r.setStart(i,u):r.setEnd(i,u)}return!0},_f=function(t){return In(t)&&0<t.data.length},Ef=function(t,e,n){var r,o,i,u,a,c,s=t.get(n.id+"_"+e),f=n.keep;if(s){if(r=s.parentNode,o="start"===e?f?s.hasChildNodes()?(r=s.firstChild,1):_f(s.nextSibling)?(r=s.nextSibling,0):_f(s.previousSibling)?(r=s.previousSibling,s.previousSibling.data.length):(r=s.parentNode,t.nodeIndex(s)+1):t.nodeIndex(s):f?s.hasChildNodes()?(r=s.firstChild,1):_f(s.previousSibling)?(r=s.previousSibling,s.previousSibling.data.length):(r=s.parentNode,t.nodeIndex(s)):t.nodeIndex(s),a=r,c=o,!f){for(u=s.previousSibling,i=s.nextSibling,ke.each(ke.grep(s.childNodes),(function(t){In(t)&&(t.nodeValue=t.nodeValue.replace(/\uFEFF/g,""))}));s=t.get(n.id+"_"+e);)t.remove(s,!0);u&&i&&u.nodeType===i.nodeType&&In(u)&&!ye.opera&&(o=u.nodeValue.length,u.appendData(i.nodeValue),t.remove(i),a=u,c=o)}return S.some(_c(a,c))}return S.none()},Tf=function(t,e,n){return 2===e?Wc(io,n,t):3===e?(o=(r=t).getRng(),{start:Pc(r.dom.getRoot(),_c.fromRangeStart(o)),end:Pc(r.dom.getRoot(),_c.fromRangeEnd(o))}):e?{rng:t.getRng()}:Gc(t,!1);var r,o},Af=function(t,e){(function(t,e){var n,r,o,i,u,a,c,s,f,l,d,m,g,p,h=t.dom;if(e){if(p=e,ke.isArray(p.start))return m=e,g=(d=h).createRng(),Of(d,!0,m,g)&&Of(d,!1,m,g)?S.some(g):S.none();if("string"==typeof e.start)return S.some((s=e,f=(c=h).createRng(),l=Fc(c.getRoot(),s.start),f.setStart(l.container(),l.offset()),l=Fc(c.getRoot(),s.end),f.setEnd(l.container(),l.offset()),f));if(e.hasOwnProperty("id"))return u=Ef(o=h,"start",i=e),a=Ef(o,"end",i),Xa(u,a.or(u),(function(t,e){var n=o.createRng();return n.setStart(Sf(o,t.container()),t.offset()),n.setEnd(Sf(o,e.container()),e.offset()),n}));if(e.hasOwnProperty("name"))return n=h,r=e,S.from(n.select(r.name)[r.index]).map((function(t){var e=n.createRng();return e.selectNode(t),e}));if(e.hasOwnProperty("rng"))return S.some(e.rng)}return S.none()})(t,e).each((function(e){t.setRng(e)}))},Bf=function(t){return En(t)&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},Nf=(no,function(t){return" "===t}),Df=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},Rf=function(t){return!Df(t)&&!Nf(t)},Mf=function(t){return!!t.nodeType},If=function(t,e,n){var r,o,i,u,a=n.startOffset,c=n.startContainer;if(!(n.startContainer===n.endContainer&&(u=n.startContainer.childNodes[n.startOffset])&&/^(IMG)$/.test(u.nodeName)||1!==c.nodeType))for(a<(i=c.childNodes).length?(c=i[a],r=new Ur(c,t.getParent(c,t.isBlock))):(c=i[i.length-1],(r=new Ur(c,t.getParent(c,t.isBlock))).next(!0)),o=r.current();o;o=r.next())if(3===o.nodeType&&!Vf(o))return n.setStart(o,0),void e.setRng(n)},Pf=function(t,e,n){if(t){var r=e?"nextSibling":"previousSibling";for(t=n?t:t[r];t;t=t[r])if(1===t.nodeType||!Vf(t))return t}},Ff=function(t,e){return Mf(e)&&(e=e.nodeName),!!t.schema.getTextBlockElements()[e.toLowerCase()]},Lf=function(t,e,n){return t.schema.isValidChild(e,n)},Vf=function(t,e){if(void 0===e&&(e=!1),M(t)&&In(t)){var n=e?t.data.replace(/ /g," "):t.data;return Bo(n)}return!1},Hf=function(t,e){return"string"!=typeof t?t=t(e):e&&(t=t.replace(/%(\w+)/g,(function(t,n){return e[n]||t}))),t},zf=function(t,e){return t=""+((t=t||"").nodeName||t),e=""+((e=e||"").nodeName||e),t.toLowerCase()===e.toLowerCase()},jf=function(t,e,n){return"color"!==n&&"backgroundColor"!==n||(e=t.toHex(e)),"fontWeight"===n&&700===e&&(e="bold"),"fontFamily"===n&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e},Uf=function(t,e,n){return jf(t,t.getStyle(e,n),n)},Wf=function(t,e){var n;return t.getParent(e,(function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n})),n},qf=function(t,e,n){return t.getParents(e,n,t.getRoot())},Gf=function(t,e,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(t){return mt(t,(function(t,e){return j(r,(function(t){return t===e}))}))};return j(t.formatter.get(e),(function(e){var r=o(e);return j(t.formatter.get(n),(function(t){var e,n,a,c=o(t);return e=r,n=c,void 0===a&&(a=u),i(a).eq(e,n)}))}))},$f=function(t){return ht(t,"block")},Xf=function(t){return ht(t,"selector")},Yf=function(t){return ht(t,"inline")},Kf=Bf,Jf=qf,Qf=Vf,Zf=Ff,tl=function(t,e){for(var n=e;n;){if(En(n)&&t.getContentEditable(n))return"false"===t.getContentEditable(n)?n:e;n=n.parentNode}return e},el=function(t,e,n,r){for(var o=e.data,i=n;t?0<=i:i<o.length;t?i--:i++)if(r(o.charAt(i)))return t?i+1:i;return-1},nl=function(t,e,n){return el(t,e,n,(function(t){return Nf(t)||Df(t)}))},rl=function(t,e,n){return el(t,e,n,Rf)},ol=function(t,e,n,r,o,i){var u,a=t.getParent(n,t.isBlock)||e,c=function(e,n,r){var i=$a(t),c=o?i.backwards:i.forwards;return S.from(c(e,n,(function(t,e){return Kf(t.parentNode)?-1:r(o,u=t,e)}),a))};return c(n,r,nl).bind((function(t){return i?c(t.container,t.offset+(o?-1:0),rl):S.some(t)})).orThunk((function(){return u?S.some({container:u,offset:o?0:u.length}):S.none()}))},il=function(t,e,n,r,o){In(r)&&0===r.nodeValue.length&&r[o]&&(r=r[o]);for(var i=Jf(t,r),u=0;u<i.length;u++)for(var a=0;a<e.length;a++){var c=e[a];if((!("collapsed"in c)||c.collapsed===n.collapsed)&&t.is(i[u],c.selector))return i[u]}return r},ul=function(t,e,n,r){var o,i,u=t.dom,a=u.getRoot();if(e[0].wrapper||(i=u.getParent(n,e[0].block,a)),i||(o=u.getParent(n,"LI,TD,TH"),i=u.getParent(In(n)?n.parentNode:n,(function(e){return e!==a&&Zf(t,e)}),o)),i&&e[0].wrapper&&(i=Jf(u,i,"ul,ol").reverse()[0]||i),!i)for(i=n;i[r]&&!u.isBlock(i[r])&&(i=i[r],!zf(i,"br")););return i||n},al=function(t,e,n,r){var o=n.parentNode;return!M(n[r])&&(!(o!==e&&!R(o)&&!t.isBlock(o))||al(t,e,o,r))},cl=function(t,e,n,r,o){var i,u,a=n,c=o?"previousSibling":"nextSibling",s=t.getRoot();if(In(n)&&!Qf(n)&&(o?0<r:r<n.data.length))return n;for(;;){if(!e[0].block_expand&&t.isBlock(a))return a;for(i=a[c];i;i=i[c]){var f=In(i)&&!al(t,s,i,c);if(!Kf(i)&&(!Vn(u=i)||!u.getAttribute("data-mce-bogus")||u.nextSibling)&&!Qf(i,f))return a}if(a===s||a.parentNode===s){n=a;break}a=a.parentNode}return n},sl=function(t){return Kf(t.parentNode)||Kf(t)},fl=function(t,e,n,r){void 0===r&&(r=!1);var o=e.startContainer,i=e.startOffset,u=e.endContainer,a=e.endOffset,c=t.dom;return En(o)&&o.hasChildNodes()&&(o=rc(o,i),In(o)&&(i=0)),En(u)&&u.hasChildNodes()&&(u=rc(u,e.collapsed?a:a-1),In(u)&&(a=u.nodeValue.length)),o=tl(c,o),u=tl(c,u),sl(o)&&(o=Kf(o)?o:o.parentNode,o=e.collapsed?o.previousSibling||o:o.nextSibling||o,In(o)&&(i=e.collapsed?o.length:0)),sl(u)&&(u=Kf(u)?u:u.parentNode,u=e.collapsed?u.nextSibling||u:u.previousSibling||u,In(u)&&(a=e.collapsed?0:u.length)),e.collapsed&&(ol(c,t.getBody(),o,i,!0,r).each((function(t){var e=t.container,n=t.offset;o=e,i=n})),ol(c,t.getBody(),u,a,!1,r).each((function(t){var e=t.container,n=t.offset;u=e,a=n}))),(n[0].inline||n[0].block_expand)&&(n[0].inline&&In(o)&&0!==i||(o=cl(c,n,o,i,!0)),n[0].inline&&In(u)&&a!==u.nodeValue.length||(u=cl(c,n,u,a,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(o=il(c,n,e,o,"previousSibling"),u=il(c,n,e,u,"nextSibling")),(n[0].block||n[0].selector)&&(o=ul(t,n,o,"previousSibling"),u=ul(t,n,u,"nextSibling"),n[0].block&&(c.isBlock(o)||(o=cl(c,n,o,i,!0)),c.isBlock(u)||(u=cl(c,n,u,a,!1)))),En(o)&&(i=c.nodeIndex(o),o=o.parentNode),En(u)&&(a=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:o,startOffset:i,endContainer:u,endOffset:a}},ll=function(t,e){var n=t.childNodes;return e>=n.length?e=n.length-1:e<0&&(e=0),n[e]||t},dl=function(t,e,n){var r=e.startContainer,o=e.startOffset,i=e.endContainer,u=e.endOffset,a=function(t){var e=t[0];return 3===e.nodeType&&e===r&&o>=e.nodeValue.length&&t.splice(0,1),e=t[t.length-1],0===u&&0<t.length&&e===i&&3===e.nodeType&&t.splice(t.length-1,1),t},c=function(t,e,n){for(var r=[];t&&t!==n;t=t[e])r.push(t);return r},s=function(t,e){do{if(t.parentNode===e)return t;t=t.parentNode}while(t)},f=function(t,e,r){for(var o=r?"nextSibling":"previousSibling",i=t,u=i.parentNode;i&&i!==e;i=u){u=i.parentNode;var s=c(i===t?i:i[o],o);s.length&&(r||s.reverse(),n(a(s)))}};if(1===r.nodeType&&r.hasChildNodes()&&(r=ll(r,o)),1===i.nodeType&&i.hasChildNodes()&&(i=ll(i,u-1)),r===i)return n(a([r]));for(var l=t.findCommonAncestor(r,i),d=r;d;d=d.parentNode){if(d===i)return f(r,l,!0);if(d===l)break}for(d=i;d;d=d.parentNode){if(d===r)return f(i,l);if(d===l)break}var m=s(r,l)||r,g=s(i,l)||i;f(r,m,!0);var p=c(m===r?m:m.nextSibling,"nextSibling",g===i?g.nextSibling:g);p.length&&n(a(p)),f(i,g)},ml=function(t){var e=[];if(t)for(var n=0;n<t.rangeCount;n++)e.push(t.getRangeAt(n));return e},gl=function(t,e){var n=Ma(e,"td[data-mce-selected],th[data-mce-selected]");return 0<n.length?n:function(t){return G(J(t,(function(t){var e=nc(t);return e?[Ae(e)]:[]})),to)}(t)},pl=function(t){return gl(ml(t.selection.getSel()),Ae(t.getBody()))},hl=function(t){return Qe(t).fold(s([t]),(function(e){return[t].concat(hl(e))}))},vl=function(t){return Ze(t).fold(s([t]),(function(e){return"br"===Ie(e)?Ge(e).map((function(e){return[t].concat(vl(e))})).getOr([]):[t].concat(vl(e))}))},bl=function(t,e){return Xa((u=(i=e).startContainer,a=i.startOffset,In(u)?0===a?S.some(Ae(u)):S.none():S.from(u.childNodes[a]).map(Ae)),(r=(n=e).endContainer,o=n.endOffset,In(r)?o===r.data.length?S.some(Ae(r)):S.none():S.from(r.childNodes[o-1]).map(Ae)),(function(e,n){var r=Y(hl(t),l(Re,e)),o=Y(vl(t),l(Re,n));return r.isSome()&&o.isSome()})).getOr(!1);var n,r,o,i,u,a},yl=function(t,e,n,r){var o=n,i=new Ur(n,o),u=mt(t.schema.getMoveCaretBeforeOnEnterElements(),(function(t,e){return!z(["td","th","table"],e.toLowerCase())}));do{if(In(n)&&0!==ke.trim(n.nodeValue).length)return void(r?e.setStart(n,0):e.setEnd(n,n.nodeValue.length));if(u[n.nodeName])return void(r?e.setStartBefore(n):"BR"===n.nodeName?e.setEndBefore(n):e.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?e.setStart(o,0):e.setEnd(o,o.childNodes.length))},xl=function(t){var e=t.selection.getSel();return e&&0<e.rangeCount},wl=function(t,e){var n=pl(t);0<n.length?W(n,(function(n){var r=n.dom,o=t.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),e(o,!0)})):e(t.selection.getRng(),!1)},Cl=function(t,e,n){var r=Gc(t,e);n(r),t.moveToBookmark(r)},Sl=(Ys=Ve,"text",{get:function(t){if(!Ys(t))throw new Error("Can only get text value of a text node");return Ks(t).getOr("")},getOption:Ks=function(t){return Ys(t)?S.from(t.dom.nodeValue):S.none()},set:function(t,e){if(!Ys(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=e}}),kl=function(t){return Sl.get(t)},Ol=function(t,e,n,r){var o=e.uid,i=void 0===o?za("mce-annotation"):o,u=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["uid"]),a=Ee("span",t);Na(a,Ia()),$n(a,""+Fa(),i),$n(a,""+Pa(),n);var c,s=r(i,u),f=s.attributes,l=void 0===f?{}:f,d=s.classes,m=void 0===d?[]:d;return Xn(a,l),c=a,W(m,(function(t){Na(c,t)})),a},_l=function(t,e,n,r,o){var i=[],u=Ol(t.getDoc(),o,n,r),a=ya(S.none()),c=function(){a.set(S.none())},s=function(t){W(t,f)},f=function(e){var n,r;switch(function(t,e,n,r){return qe(e).fold((function(){return"skipping"}),(function(o){return"br"===r||Ve(u=e)&&kl(u)===ro?"valid":Le(i=e)&&Da(i,Ia())?"existing":wf(e.dom)?"caret":Lf(t,n,r)&&Lf(t,Ie(o),n)?"valid":"invalid-child";var i,u}))}(t,e,"span",Ie(e))){case"invalid-child":c();var o=Ke(e);s(o),c();break;case"valid":var f=a.get().getOrThunk((function(){var t=Wa(u);return i.push(t),a.set(S.some(t)),t}));an(n=e,r=f),fn(r,n)}};return dl(t.dom,e,(function(t){var e;c(),e=U(t,Ae),s(e)})),i},El=function(t){var e,n=(e={},{register:function(t,n){e[t]={name:t,settings:n}},lookup:function(t){return e.hasOwnProperty(t)?S.from(e[t]).map((function(t){return t.settings})):S.none()}});!function(t,e){t.on("init",(function(){t.serializer.addNodeFilter("span",(function(t){W(t,(function(t){var n;n=t,S.from(n.attr(Pa())).bind(e.lookup).each((function(e){!1===e.persistent&&t.unwrap()}))}))}))}))}(t,n);var r=function(t,e){var n=ya({}),r=function(t,e){o(t,(function(t){return e(t),t}))},o=function(t,e){var r=n.get(),o=e(r.hasOwnProperty(t)?r[t]:{listeners:[],previous:ya(S.none())});r[t]=o,n.set(r)},i=Ta((function(){var e,i,u=n.get(),a=(e=it(u),(i=F.call(e,0)).sort(void 0),i);W(a,(function(e){o(e,(function(n){var o=n.previous.get();return La(t,S.some(e)).fold((function(){var t;o.isSome()&&(r(t=e,(function(e){W(e.listeners,(function(e){return e(!1,t)}))})),n.previous.set(S.none()))}),(function(t){var e,i,u,a=t.uid,c=t.name,s=t.elements;o.is(a)||(i=a,u=s,r(e=c,(function(t){W(t.listeners,(function(t){return t(!0,e,{uid:i,nodes:U(u,(function(t){return t.dom}))})}))})),n.previous.set(S.some(a)))})),{previous:n.previous,listeners:n.listeners}}))}))}),30);return t.on("remove",(function(){i.cancel()})),t.on("NodeChange",(function(){i.throttle()})),{addListener:function(t,e){o(t,(function(t){return{previous:t.previous,listeners:t.listeners.concat([e])}}))}}}(t);return{register:function(t,e){n.register(t,e)},annotate:function(e,r){n.lookup(e).each((function(n){!function(t,e,n,r){t.undoManager.transact((function(){var o,i,u,a,c=t.selection,s=c.getRng(),f=0<pl(t).length;s.collapsed&&!f&&(u=fl(o=t,i=s,[{inline:!0}]),i.setStart(u.startContainer,u.startOffset),i.setEnd(u.endContainer,u.endOffset),o.selection.setRng(i)),c.getRng().collapsed&&!f?(a=Ol(t.getDoc(),r,e,n.decorate),ja(a,no),c.getRng().insertNode(a.dom),c.select(a.dom)):Cl(c,!1,(function(){wl(t,(function(o){_l(t,o,e,n.decorate,r)}))}))}))}(t,e,n,r)}))},annotationChanged:function(t,e){r.addListener(t,e)},remove:function(e){La(t,S.some(e)).each((function(t){var e=t.elements;W(e,gn)}))},getAll:function(e){var n,r,o,i,u=(n=e,r=Ae(t.getBody()),o=Ma(r,"["+Pa()+'="'+n+'"]'),i={},W(o,(function(t){var e=Yn(t,Fa()),n=i.hasOwnProperty(e)?i[e]:[];i[e]=n.concat([t])})),i);return ct(u,(function(t){return U(t,(function(t){return t.dom}))}))}}};function Tl(t){return{getBookmark:l(Tf,t),moveToBookmark:l(Af,t)}}(Tl=Tl||{}).isBookmarkNode=Bf;var Al,Bl=Tl,Nl=function(t,e){for(;e&&e!==t;){if(zn(e)||jn(e))return e;e=e.parentNode}return null},Dl=function(t,e,n){if(n.collapsed)return!1;if(ye.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(En(r))return j(r.getClientRects(),(function(n){return ec(n,t,e)}))}return j(n.getClientRects(),(function(n){return ec(n,t,e)}))},Rl={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,END:35,HOME:36,modifierPressed:function(t){return t.shiftKey||t.ctrlKey||t.altKey||this.metaKeyPressed(t)},metaKeyPressed:function(t){return ye.mac?t.metaKey:t.ctrlKey&&!t.altKey}},Ml=jn,Il=function(t,e){var n,r,o,i,u,a,c,s,f,l,d,m,g,p,h=e.dom,v=ke.each,b=e.getDoc(),y=document,x=Math.abs,w=Math.round,C=e.getBody(),S={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},k=function(t){return t&&("IMG"===t.nodeName||e.dom.is(t,"figure.image"))},O=function(t){var n=t.target;!function(t,e){if("longpress"!==t.type&&0!==t.type.indexOf("touch"))return k(t.target)&&!Dl(t.clientX,t.clientY,e);var n=t.touches[0];return k(t.target)&&!Dl(n.clientX,n.clientY,e)}(t,e.selection.getRng())||t.isDefaultPrevented()||e.selection.select(n)},_=function(t){return e.dom.is(t,"figure.image")?t.querySelector("img"):t},E=function(t){var n=os(e);return!!n&&"false"!==t.getAttribute("data-mce-resize")&&t!==e.getBody()&&Ne(Ae(t),n)},T=function(t,e,n){h.setStyles(_(t),{width:e,height:n})},A=function(t){var v,b,y,S,O,_,E,A=t.screenX-u,B=t.screenY-a;d=A*i[2]+c,m=B*i[3]+s,d=d<5?5:d,m=m<5?5:m,(k(n)&&!1!==e.getParam("resize_img_proportional",!0,"boolean")?!Rl.modifierPressed(t):Rl.modifierPressed(t))&&(x(A)>x(B)?(m=w(d*f),d=w(m/f)):(d=w(m/f),m=w(d*f))),T(r,d,m),v=0<(v=i.startPos.x+A)?v:0,b=0<(b=i.startPos.y+B)?b:0,h.setStyles(o,{left:v,top:b,display:"block"}),o.innerHTML=d+" &times; "+m,i[2]<0&&r.clientWidth<=d&&h.setStyle(r,"left",void 0+(c-d)),i[3]<0&&r.clientHeight<=m&&h.setStyle(r,"top",void 0+(s-m)),(A=C.scrollWidth-g)+(B=C.scrollHeight-p)!=0&&h.setStyles(o,{left:v-A,top:b-B}),l||(y=e,S=n,O=c,_=s,E="corner-"+i.name,y.fire("ObjectResizeStart",{target:S,width:O,height:_,origin:E}),l=!0)},B=function(){var t=l;l=!1;var u,a,c,s,f,g=function(t,r){r&&(n.style[t]||!e.schema.isValid(n.nodeName.toLowerCase(),t)?h.setStyle(_(n),t,r):h.setAttrib(_(n),t,""+r))};t&&(g("width",d),g("height",m)),h.unbind(b,"mousemove",A),h.unbind(b,"mouseup",B),y!==b&&(h.unbind(y,"mousemove",A),h.unbind(y,"mouseup",B)),h.remove(r),h.remove(o),N(n),t&&(u=e,a=n,c=d,s=m,f="corner-"+i.name,u.fire("ObjectResized",{target:a,width:c,height:s,origin:f}),h.setAttrib(n,"style",h.getAttrib(n,"style"))),e.nodeChanged()},N=function(t){D(),I();var l=h.getPos(t,C),x=l.x,w=l.y,k=t.getBoundingClientRect(),O=k.width||k.right-k.left,N=k.height||k.bottom-k.top;n!==t&&(n=t,d=m=0);var R=e.fire("ObjectSelected",{target:t});E(t)&&!R.isDefaultPrevented()?v(S,(function(t,e){var l=h.get("mceResizeHandle"+e);l&&h.remove(l),l=h.add(C,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===ye.ie&&(l.contentEditable=!1),h.bind(l,"mousedown",(function(l){var d;l.stopImmediatePropagation(),l.preventDefault(),u=(d=l).screenX,a=d.screenY,c=_(n).clientWidth,s=_(n).clientHeight,f=s/c,(i=t).name=e,i.startPos={x:O*t[0]+x,y:N*t[1]+w},g=C.scrollWidth,p=C.scrollHeight,r=n.cloneNode(!0),h.addClass(r,"mce-clonedresizable"),h.setAttrib(r,"data-mce-bogus","all"),r.contentEditable=!1,r.unSelectabe=!0,h.setStyles(r,{left:x,top:w,margin:0}),T(r,O,N),r.removeAttribute("data-mce-selected"),C.appendChild(r),h.bind(b,"mousemove",A),h.bind(b,"mouseup",B),y!==b&&(h.bind(y,"mousemove",A),h.bind(y,"mouseup",B)),o=h.add(C,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},c+" &times; "+s)})),t.elm=l,h.setStyles(l,{left:O*t[0]+x-l.offsetWidth/2,top:N*t[1]+w-l.offsetHeight/2})})):D(),n.setAttribute("data-mce-selected","1")},D=function(){I(),n&&n.removeAttribute("data-mce-selected"),at(S,(function(t,e){var n=h.get("mceResizeHandle"+e);n&&(h.unbind(n),h.remove(n))}))},R=function(n){var r,o=function(t,e){if(t)do{if(t===e)return!0}while(t=t.parentNode)};l||e.removed||(v(h.select("img[data-mce-selected],hr[data-mce-selected]"),(function(t){t.removeAttribute("data-mce-selected")})),r="mousedown"===n.type?n.target:t.getNode(),o(r=h.$(r).closest("table,img,figure.image,hr")[0],C)&&(P(),o(t.getStart(!0),r)&&o(t.getEnd(!0),r))?N(r):D())},M=function(t){return Ml(Nl(e.getBody(),t))},I=function(){at(S,(function(t){t.elm&&(h.unbind(t.elm),delete t.elm)}))},P=function(){try{e.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(t){}};return e.on("init",(function(){var t;P(),(ye.browser.isIE()||ye.browser.isEdge())&&(e.on("mousedown click",(function(t){var n=t.target,r=n.nodeName;l||!/^(TABLE|IMG|HR)$/.test(r)||M(n)||(2!==t.button&&e.selection.select(n,"TABLE"===r),"mousedown"===t.type&&e.nodeChanged())})),t=function(t){var n=function(t){Vr.setEditorTimeout(e,(function(){return e.selection.select(t)}))};if(M(t.target)||Wn(t.target))return t.preventDefault(),void n(t.target);/^(TABLE|IMG|HR)$/.test(t.target.nodeName)&&(t.preventDefault(),"IMG"===t.target.tagName&&n(t.target))},h.bind(C,"mscontrolselect",t),e.on("remove",(function(){return h.unbind(C,"mscontrolselect",t)})));var r=Vr.throttle((function(t){e.composing||R(t)}));e.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",r),e.on("keyup compositionend",(function(t){n&&"TABLE"===n.nodeName&&r(t)})),e.on("hide blur",D),e.on("contextmenu longpress",O,!0)})),e.on("remove",I),{isResizable:E,showResizeRect:N,hideResizeRect:D,updateResizeRect:R,destroy:function(){n=r=null}}},Pl=function(t){return zn(t)||jn(t)},Fl=function(t,e,n){var r,o,i,u,a,c=n;if(c.caretPositionFromPoint)(o=c.caretPositionFromPoint(t,e))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(t,e);else if(c.body.createTextRange){r=c.body.createTextRange();try{r.moveToPoint(t,e),r.collapse(!0)}catch(o){r=function(t,e,n){var r,o=n.elementFromPoint(t,e),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),0<(r=(r=ke.toArray(i.getClientRects())).sort((function(t,n){return(t=Math.abs(Math.max(t.top-e,t.bottom-e)))-Math.abs(Math.max(n.top-e,n.bottom-e))}))).length){e=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(t,e),i.collapse(!0),i}catch(t){}}return null}(t,e,n)}return i=r,u=n.body,a=i&&i.parentElement?i.parentElement():null,jn(function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(a,u,Pl))?null:i}return r},Ll=function(t,e){return t&&e&&t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset},Vl=function(t,e,n){return null!==function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(t,e,n)},Hl=function(t){return t&&"TABLE"===t.nodeName},zl=function(t,e,n){for(var r=new Ur(e,t.getParent(e.parentNode,t.isBlock)||t.getRoot());e=r[n?"prev":"next"]();)if(Vn(e))return!0},jl=function(t,e,n,r,o){var i,u,a=t.getRoot(),c=t.schema.getNonEmptyElements(),s=t.getParent(o.parentNode,t.isBlock)||a;if(r&&Vn(o)&&e&&t.isEmpty(s))return S.some(Sc(o.parentNode,t.nodeIndex(o)));for(var f,l,d=new Ur(o,s);u=d[r?"prev":"next"]();){if("false"===t.getContentEditableParent(u)||(l=a,fo(f=u)&&!1===Vl(f,l,wf)))return S.none();if(In(u)&&0<u.nodeValue.length)return!1===function(t,e,n){return Vl(t,e,(function(t){return"A"===t.nodeName}))}(u,a)?S.some(Sc(u,r?u.nodeValue.length:0)):S.none();if(t.isBlock(u)||c[u.nodeName.toLowerCase()])return S.none();i=u}return n&&i?S.some(Sc(i,0)):S.none()},Ul=function(t,e,n,r){var o,i,u,a=t.getRoot(),c=!1,s=r[(n?"start":"end")+"Container"],f=r[(n?"start":"end")+"Offset"],l=En(s)&&f===s.childNodes.length,d=t.schema.getNonEmptyElements(),m=n;if(fo(s))return S.none();if(En(s)&&f>s.childNodes.length-1&&(m=!1),Fn(s)&&(s=a,f=0),s===a){if(m&&(o=s.childNodes[0<f?f-1:0])){if(fo(o))return S.none();if(d[o.nodeName]||Hl(o))return S.none()}if(s.hasChildNodes()){if(f=Math.min(!m&&0<f?f-1:f,s.childNodes.length-1),s=s.childNodes[f],f=In(s)&&l?s.data.length:0,!e&&s===a.lastChild&&Hl(s))return S.none();if(function(t,e){for(;e&&e!==t;){if(jn(e))return!0;e=e.parentNode}return!1}(a,s)||fo(s))return S.none();if(s.hasChildNodes()&&!1===Hl(s)){var g=new Ur(o=s,a);do{if(jn(o)||fo(o)){c=!1;break}if(In(o)&&0<o.nodeValue.length){f=m?0:o.nodeValue.length,s=o,c=!0;break}if(d[o.nodeName.toLowerCase()]&&(!(i=o)||!/^(TD|TH|CAPTION)$/.test(i.nodeName))){f=t.nodeIndex(o),s=o.parentNode,m||f++,c=!0;break}}while(o=m?g.next():g.prev())}}}return e&&(In(s)&&0===f&&jl(t,l,e,!0,s).each((function(t){s=t.container(),f=t.offset(),c=!0})),En(s)&&(!(o=(o=s.childNodes[f])||s.childNodes[f-1])||!Vn(o)||("A",(u=o).previousSibling&&"A"===u.previousSibling.nodeName)||zl(t,o,!1)||zl(t,o,!0)||jl(t,l,e,!0,o).each((function(t){s=t.container(),f=t.offset(),c=!0})))),m&&!e&&In(s)&&f===s.nodeValue.length&&jl(t,l,e,!1,s).each((function(t){s=t.container(),f=t.offset(),c=!0})),c?S.some(Sc(s,f)):S.none()},Wl=function(t,e){var n=e.collapsed,r=e.cloneRange(),o=Sc.fromRangeStart(e);return Ul(t,n,!0,r).each((function(t){n&&Sc.isAbove(o,t)||r.setStart(t.container(),t.offset())})),n||Ul(t,n,!1,r).each((function(t){r.setEnd(t.container(),t.offset())})),n&&r.collapse(!0),Ll(e,r)?S.none():S.some(r)},ql=function(t,e){return t.splitText(e)},Gl=function(t){var e=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset;return e===r&&In(e)?0<n&&n<e.nodeValue.length&&(e=(r=ql(e,n)).previousSibling,n<o?(e=r=ql(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(In(e)&&0<n&&n<e.nodeValue.length&&(e=ql(e,n),n=0),In(r)&&0<o&&o<r.nodeValue.length&&(o=(r=ql(r,o).previousSibling).nodeValue.length)),{startContainer:e,startOffset:n,endContainer:r,endOffset:o}};function $l(t){return{walk:function(e,n){return dl(t,e,n)},split:Gl,normalize:function(e){return Wl(t,e).fold(b,(function(t){return e.setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),!0}))}}}(Al=$l=$l||{}).compareRanges=Ll,Al.getCaretRangeFromPoint=Fl,Al.getSelectedNode=nc,Al.getNode=rc;var Xl,Yl,Kl,Jl,Ql,Zl=$l,td=(Xl="height",Yl=function(t){var e=t.dom;return pn(t)?e.getBoundingClientRect().height:e.offsetHeight},{set:function(t,e){if(!P(e)&&!e.match(/^[0-9]+$/))throw new Error(Xl+".set accepts only positive integer values. Value was "+e);var n=t.dom;qn(n)&&(n.style[Xl]=e+"px")},get:Kl=function(t){var e=Yl(t);if(e<=0||null===e){var n=Qn(t,Xl);return parseFloat(n)||0}return e},getOuter:Kl,aggregate:Jl=function(t,e){return X(e,(function(e,n){var r=Qn(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)},max:function(t,e,n){var r=Jl(t,n);return r<e?e-r:0}}),ed=function(t,e){return t.view(e).fold(s([]),(function(e){var n=t.owner(e),r=ed(t,n);return[e].concat(r)}))},nd=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?S.none():S.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(Ae)},owner:Ue}),rd=function(t){return"textarea"===Ie(t)},od=function(t,e){var n,r=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return vn(n.offsetLeft,n.offsetTop);var i=bn(null==r?void 0:r.pageYOffset,o.scrollTop),u=bn(null==r?void 0:r.pageXOffset,o.scrollLeft),a=bn(o.clientTop,n.clientTop),c=bn(o.clientLeft,n.clientLeft);return yn(t).translate(u-c,i-a)}(t),o=(n=t,td.get(n));return{element:t,bottom:r.top+o,height:o,pos:r,cleanup:e}},id=function(t,e,n,r){sd(t,(function(o,i){return ad(t,e,n,r)}),n)},ud=function(t,e,n,r,o){var i,u,a={elm:r.element.dom,alignToTop:o};i=a,t.fire("ScrollIntoView",i).isDefaultPrevented()||(n(e,xn(e).top,r,o),u=a,t.fire("AfterScrollIntoView",u))},ad=function(t,e,n,r){var o=Ae(t.getBody()),i=Ae(t.getDoc());o.dom.offsetWidth;var u=function(t,e){var n=function(t,e){var n=Ke(t);if(0===n.length||rd(t))return{element:t,offset:e};if(e<n.length&&!rd(n[e]))return{element:n[e],offset:0};var r=n[n.length-1];return rd(r)?{element:t,offset:e}:"img"===Ie(r)?{element:r,offset:1}:Ve(r)?{element:r,offset:kl(r).length}:{element:r,offset:Ke(r).length}}(t,e),r=_e('<span data-mce-bogus="all">\ufeff</span>');return an(n.element,r),od(r,(function(){return mn(r)}))}(Ae(n.startContainer),n.startOffset);ud(t,i,e,u,r),u.cleanup()},cd=function(t,e,n,r){var o=Ae(t.getDoc());ud(t,o,n,od(Ae(e),a),r)},sd=function(t,e,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,u=n.endOffset;e(Ae(r),Ae(i));var a=t.dom.createRng();a.setStart(r,o),a.setEnd(i,u),t.selection.setRng(n)},fd=function(t,e,n,r){var o,i=t.pos;n?wn(i.left,i.top,r):(o=i.top-e+t.height,wn(i.left,o,r))},ld=function(t,e,n,r,o){var i=n+e,u=r.pos.top,a=r.bottom,c=n<=a-u;u<e?fd(r,n,!1!==o,t):i<u?fd(r,n,c?!1!==o:!0===o,t):i<a&&!c&&fd(r,n,!0===o,t)},dd=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;ld(t,e,o,n,r)},md=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;ld(t,e,o,n,r);var i=function(t){var e,n,r,o=Ae(document),i=xn(o),u=(e=t,r=(n=nd).owner(e),ed(n,r)),a=yn(t),c=$(u,(function(t,e){var n=yn(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return vn(c.left+a.left+i.left,c.top+a.top+i.top)}(n.element),u=kn(window);i.top<u.y?Cn(n.element,!1!==r):i.top>u.bottom&&Cn(n.element,!0===r)},gd=function(t,e,n){return id(t,dd,e,n)},pd=function(t,e,n){return cd(t,e,dd,n)},hd=function(t,e,n){return id(t,md,e,n)},vd=function(t,e,n){return cd(t,e,md,n)},bd=function(t,e,n){(t.inline?gd:hd)(t,e,n)},yd=function(t){var e=rn(t).dom;return t.dom===e.activeElement},xd=function(t){return void 0===t&&(t=Ae(document)),S.from(t.dom.activeElement).map(Ae)},wd=hr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Cd=(wd.before,wd.on,wd.after,hr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}])),Sd=(Cd.domRange,Cd.relative,Cd.exact,function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}}),kd=fe().browser,Od=function(t,e){var n=Ve(e)?kl(e).length:Ke(e).length+1;return n<t?n:t<0?0:t},_d=function(t){return Sd(t.start,Od(t.soffset,t.start),t.finish,Od(t.foffset,t.finish))},Ed=function(t,e){return!_n(e.dom)&&(Me(t,e)||Re(t,e))},Td=function(t){return function(e){return Ed(t,e.start)&&Ed(t,e.finish)}},Ad=function(t){return!0===t.inline||kd.isIE()},Bd=function(t){return Sd(Ae(t.startContainer),t.startOffset,Ae(t.endContainer),t.endOffset)},Nd=function(t){var e=document.createRange();try{return e.setStart(t.start.dom,t.soffset),e.setEnd(t.finish.dom,t.foffset),S.some(e)}catch(t){return S.none()}},Dd=function(t){var e=Ad(t)?function(t){var e;return((e=We(t).dom.getSelection())&&0!==e.rangeCount?S.from(e.getRangeAt(0)):S.none()).map(Bd).filter(Td(t))}(Ae(t.getBody())):S.none();t.bookmark=e.isSome()?e:t.bookmark},Rd=function(t){return(t.bookmark?t.bookmark:S.none()).bind((function(e){return n=Ae(t.getBody()),r=e,S.from(r).filter(Td(n)).map(_d);var n,r})).bind(Nd)},Md={isEditorUIElement:function(t){var e=t.className.toString();return-1!==e.indexOf("tox-")||-1!==e.indexOf("mce-")}},Id=function(t){var e=Ea((function(){Dd(t)}),0);t.on("init",(function(){var n,r,o;t.inline&&(n=t,r=e,o=function(){r.throttle()},da.DOM.bind(document,"mouseup",o),n.on("remove",(function(){da.DOM.unbind(document,"mouseup",o)}))),function(t,e){var n,r;fe().browser.isIE()?(r=t).on("focusout",(function(){Dd(r)})):(n=e,t.on("mouseup touchend",(function(t){n.throttle()}))),t.on("keyup NodeChange",(function(e){var n;"nodechange"===(n=e).type&&n.selectionChange||Dd(t)}))}(t,e)})),t.on("remove",(function(){e.cancel()}))},Pd=da.DOM,Fd=function(t,e){var n=t.getParam("custom_ui_selector","","string");return null!==Pd.getParent(e,(function(e){return Md.isEditorUIElement(e)||!!n&&t.dom.is(e,n)}))},Ld=function(t,e){var n=e.editor;Id(n),n.on("focusin",(function(){var e=t.focusedEditor;e!==this&&(e&&e.fire("blur",{focusedEditor:this}),t.setActive(this),(t.focusedEditor=this).fire("focus",{blurredEditor:e}),this.focus(!0))})),n.on("focusout",(function(){var e=this;Vr.setEditorTimeout(e,(function(){var n=t.focusedEditor;Fd(e,function(t){try{var e=rn(Ae(t.getElement()));return xd(e).fold((function(){return document.body}),(function(t){return t.dom}))}catch(t){return document.body}}(e))||n!==e||(e.fire("blur",{focusedEditor:null}),t.focusedEditor=null)}))})),Ql||(Ql=function(e){var n=t.activeEditor;n&&function(t){if(nn()&&M(t.target)){var e=Ae(t.target);if(Le(e)&&function(t){return M(t.dom.shadowRoot)}(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return nt(n)}}return S.from(t.target)}(e).each((function(e){e.ownerDocument===document&&(e===document.body||Fd(n,e)||t.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null))}))},Pd.bind(document,"focusin",Ql))},Vd=function(t,e){t.focusedEditor===e.editor&&(t.focusedEditor=null),t.activeEditor||(Pd.unbind(document,"focusin",Ql),Ql=null)},Hd=function(t,e){(function(t,e){return((n=e).collapsed?S.from(rc(n.startContainer,n.startOffset)).map(Ae):S.none()).bind((function(e){return Zr(e)?S.some(e):!1===Me(t,e)?S.some(t):S.none()}));var n})(Ae(t.getBody()),e).bind((function(t){return bf(t.dom)})).fold((function(){t.selection.normalize()}),(function(e){return t.selection.setRng(e.toRange())}))},zd=function(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()},jd=function(t){return t.inline?(n=t.getBody())&&function(t){return yd(t)||xd(rn(e=t)).filter((function(t){return e.dom.contains(t.dom)})).isSome();var e}(Ae(n)):(e=t).iframeElement&&yd(Ae(e.iframeElement));var e,n},Ud=function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===jd(t)&&Rd(t).each((function(e){t.selection.setRng(e),r=e}));var o,i,u=(o=t,i=e.getNode(),o.dom.getParent(i,(function(t){return"true"===o.dom.getContentEditable(t)})));if(t.$.contains(n,u))return zd(u),Hd(t,r),void Wd(t);t.inline||(ye.opera||zd(n),t.getWin().focus()),(ye.gecko||t.inline)&&(zd(n),Hd(t,r)),Wd(t)},Wd=function(t){return t.editorManager.setActive(t)},qd=function(t,e,n,r,o){var i=n?e.startContainer:e.endContainer,u=n?e.startOffset:e.endOffset;return S.from(i).map(Ae).map((function(t){return r&&e.collapsed?t:Je(t,o(t,u)).getOr(t)})).bind((function(t){return Le(t)?S.some(t):qe(t).filter(Le)})).map((function(t){return t.dom})).getOr(t)},Gd=function(t,e,n){return qd(t,e,!0,n,(function(t,e){return Math.min(t.dom.childNodes.length,e)}))},$d=function(t,e,n){return qd(t,e,!1,n,(function(t,e){return 0<e?e-1:e}))},Xd=function(t,e){for(var n=t;t&&In(t)&&0===t.length;)t=e?t.nextSibling:t.previousSibling;return t||n},Yd=function(t,e){return U(e,(function(e){var n=t.fire("GetSelectionRange",{range:e});return n.range!==e?n.range:e}))},Kd=function(t){return I(t)?t:b},Jd=function(t,e,n){var r=e(t),o=Kd(n);return r.orThunk((function(){return o(t)?S.none():function(t,e,n){for(var r=t.dom,o=Kd(n);r.parentNode;){r=r.parentNode;var i=Ae(r),u=e(i);if(u.isSome())return u;if(o(i))break}return S.none()}(t,e,o)}))},Qd=zf,Zd=function(t,e,n){var r=t.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&t.dom.is(e,r[o].selector))return!0;return!1},tm=function(t,e,n,r){var o=t.dom.getRoot();return e!==o&&(e=t.dom.getParent(e,(function(e){return!!Zd(t,e,n)||e.parentNode===o||!!rm(t,e,n,r,!0)})),rm(t,e,n,r))},em=function(t,e,n){return!!Qd(e,n.inline)||!!Qd(e,n.block)||(n.selector?1===e.nodeType&&t.is(e,n.selector):void 0)},nm=function(t,e,n,r,o,i){var u,a,c,s=n[r];if(n.onmatch)return n.onmatch(e,n,r);if(s)if(void 0===s.length){for(u in s)if(s.hasOwnProperty(u)){if(a="attributes"===r?t.getAttrib(e,u):Uf(t,e,u),o&&!a&&!n.exact)return;if((!o||n.exact)&&!Qd(a,jf(t,Hf(s[u],i),u)))return}}else for(c=0;c<s.length;c++)if("attributes"===r?t.getAttrib(e,s[c]):Uf(t,e,s[c]))return n;return n},rm=function(t,e,n,r,o){var i,u,a,c,s=t.formatter.get(n),f=t.dom;if(s&&e)for(u=0;u<s.length;u++)if(i=s[u],em(t.dom,e,i)&&nm(f,e,i,"attributes",o,r)&&nm(f,e,i,"styles",o,r)){if(c=i.classes)for(a=0;a<c.length;a++)if(!t.dom.hasClass(e,c[a]))return;return i}},om=function(t,e,n,r){if(r)return tm(t,r,e,n);if(r=t.selection.getNode(),tm(t,r,e,n))return!0;var o=t.selection.getStart();return!(o===r||!tm(t,o,e,n))},im=function(t,e,n){return X(n,(function(n,r){var o,i=(o=r,j(t.formatter.get(o),(function(t){var e=function(t){return 1<t.length&&"%"===t.charAt(0)};return j(["styles","attributes"],(function(n){return gt(t,n).exists((function(t){var n=A(t)?t:function(t){return e=[],at(t,(function(t,n){e.push(t)})),e;var e}(t);return j(n,e)}))}))})));return t.formatter.matchNode(e,r,{},i)?n.concat([r]):n}),[])},um={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},am=function(t,e,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(t[r])return t[r];if(t!==e){var i=t[o];if(i)return i;for(var u=t.parent;u&&u!==e;u=u.parent)if(i=u[o])return i}},cm=function(t){var e="a"===t.name&&!t.attr("href")&&t.attr("id");return t.attr("name")||t.attr("id")&&!t.firstChild||t.attr("data-mce-bookmark")||e},sm=(fm.create=function(t,e){var n=new fm(t,um[t]||1);return e&&at(e,(function(t,e){n.attr(e,t)})),n},fm.prototype.replace=function(t){return t.parent&&t.remove(),this.insert(t,this),this.remove(),this},fm.prototype.attr=function(t,e){var n,r=this;if("string"!=typeof t)return null!=t&&at(t,(function(t,e){r.attr(e,t)})),r;if(n=r.attributes){if(void 0===e)return n.map[t];if(null===e){if(t in n.map){delete n.map[t];for(var o=n.length;o--;)if(n[o].name===t)return n.splice(o,1),r}return r}if(t in n.map){for(o=n.length;o--;)if(n[o].name===t){n[o].value=e;break}}else n.push({name:t,value:e});return n.map[t]=e,r}},fm.prototype.clone=function(){var t,e=new fm(this.name,this.type);if(t=this.attributes){var n=[];n.map={};for(var r=0,o=t.length;r<o;r++){var i=t[r];"id"!==i.name&&(n[n.length]={name:i.name,value:i.value},n.map[i.name]=i.value)}e.attributes=n}return e.value=this.value,e.shortEnded=this.shortEnded,e},fm.prototype.wrap=function(t){return this.parent.insert(t,this),t.append(this),this},fm.prototype.unwrap=function(){for(var t=this.firstChild;t;){var e=t.next;this.insert(t,this,!0),t=e}this.remove()},fm.prototype.remove=function(){var t=this.parent,e=this.next,n=this.prev;return t&&(t.firstChild===this?(t.firstChild=e)&&(e.prev=null):n.next=e,t.lastChild===this?(t.lastChild=n)&&(n.next=null):e.prev=n,this.parent=this.next=this.prev=null),this},fm.prototype.append=function(t){t.parent&&t.remove();var e=this.lastChild;return e?((e.next=t).prev=e,this.lastChild=t):this.lastChild=this.firstChild=t,t.parent=this,t},fm.prototype.insert=function(t,e,n){t.parent&&t.remove();var r=e.parent||this;return n?(e===r.firstChild?r.firstChild=t:e.prev.next=t,t.prev=e.prev,(t.next=e).prev=t):(e===r.lastChild?r.lastChild=t:e.next.prev=t,t.next=e.next,(t.prev=e).next=t),t.parent=r,t},fm.prototype.getAll=function(t){for(var e=[],n=this.firstChild;n;n=am(n,this))n.name===t&&e.push(n);return e},fm.prototype.empty=function(){if(this.firstChild){for(var t=[],e=this.firstChild;e;e=am(e,this))t.push(e);for(var n=t.length;n--;)(e=t[n]).parent=e.firstChild=e.lastChild=e.next=e.prev=null}return this.firstChild=this.lastChild=null,this},fm.prototype.isEmpty=function(t,e,n){void 0===e&&(e={});var r=this.firstChild;if(cm(this))return!1;if(r)do{if(1===r.type){if(r.attr("data-mce-bogus"))continue;if(t[r.name])return!1;if(cm(r))return!1}if(8===r.type)return!1;if(3===r.type&&!function(t){if(Bo(t.value)){var e=t.parent;return!e||"span"===e.name&&!e.attr("style")||!/^[ ]+$/.test(t.value)}}(r))return!1;if(3===r.type&&r.parent&&e[r.parent.name]&&Bo(r.value))return!1;if(n&&n(r))return!1}while(r=am(r,this));return!0},fm.prototype.walk=function(t){return am(this,null,t)},fm);function fm(t,e){this.name=t,1===(this.type=e)&&(this.attributes=[],this.attributes.map={})}var lm=ke.makeMap,dm=function(t){var e=[],n=(t=t||{}).indent,r=lm(t.indent_before||""),o=lm(t.indent_after||""),i=Qo.getEncodeFunc(t.entity_encoding||"raw",t.entities),u="html"===t.element_format;return{start:function(t,a,c){var s,f,l,d;if(n&&r[t]&&0<e.length&&0<(d=e[e.length-1]).length&&"\n"!==d&&e.push("\n"),e.push("<",t),a)for(s=0,f=a.length;s<f;s++)l=a[s],e.push(" ",l.name,'="',i(l.value,!0),'"');e[e.length]=!c||u?">":" />",c&&n&&o[t]&&0<e.length&&0<(d=e[e.length-1]).length&&"\n"!==d&&e.push("\n")},end:function(t){var r;e.push("</",t,">"),n&&o[t]&&0<e.length&&0<(r=e[e.length-1]).length&&"\n"!==r&&e.push("\n")},text:function(t,n){0<t.length&&(e[e.length]=n?t:i(t))},cdata:function(t){e.push("<![CDATA[",t,"]]>")},comment:function(t){e.push("\x3c!--",t,"--\x3e")},pi:function(t,r){r?e.push("<?",t," ",i(r),"?>"):e.push("<?",t,"?>"),n&&e.push("\n")},doctype:function(t){e.push("<!DOCTYPE",t,">",n?"\n":"")},reset:function(){e.length=0},getContent:function(){return e.join("").replace(/\n$/,"")}}},mm=function(t,e){void 0===e&&(e=ci());var n=dm(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(r){var o=t.validate,i={3:function(t){n.text(t.value,t.raw)},8:function(t){n.comment(t.value)},7:function(t){n.pi(t.name,t.value)},10:function(t){n.doctype(t.value)},4:function(t){n.cdata(t.value)},11:function(t){if(t=t.firstChild)for(;u(t),t=t.next;);}};n.reset();var u=function(t){var r,a,c,s,f,l,d,m,g,p=i[t.type];if(p)p(t);else{if(r=t.name,a=t.shortEnded,c=t.attributes,o&&c&&1<c.length&&((l=[]).map={},g=e.getElementRule(t.name))){for(d=0,m=g.attributesOrder.length;d<m;d++)(s=g.attributesOrder[d])in c.map&&(f=c.map[s],l.map[s]=f,l.push({name:s,value:f}));for(d=0,m=c.length;d<m;d++)(s=c[d].name)in l.map||(f=c.map[s],l.map[s]=f,l.push({name:s,value:f}));c=l}if(n.start(t.name,c,a),!a){if(t=t.firstChild)for(;u(t),t=t.next;);n.end(r)}}};return 1!==r.type||t.inner?i[11](r):u(r),n.getContent()}}},gm=function(t,e){return t.replace(new RegExp(e.prefix+"_[0-9]+","g"),(function(t){return gt(e.uris,t).getOr(t)}))},pm=["img","video"],hm=function(t,e,n){return!t.allow_html_data_urls&&(/^data:image\//i.test(e)?(r=t.allow_svg_data_urls,o=n,!(R(r)?z(pm,o):r)&&/^data:image\/svg\+xml/i.test(e)):/^data:/i.test(e));var r,o},vm=function(t,e,n){var r,o,i=1,u=t.getShortEndedElements(),a=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;for(a.lastIndex=r=n;o=a.exec(e);){if(r=a.lastIndex,"/"===o[1])i--;else if(!o[1]){if(o[2]in u)continue;i++}if(0===i)break}return r};function bm(t,e){void 0===e&&(e=ci());var n=function(){};!1!==(t=t||{}).fix_self_closing&&(t.fix_self_closing=!0);var r=t.comment?t.comment:n,o=t.cdata?t.cdata:n,i=t.text?t.text:n,u=t.start?t.start:n,a=t.end?t.end:n,c=t.pi?t.pi:n,s=t.doctype?t.doctype:n;return{parse:function(n,f){void 0===f&&(f="html"),function(n,f){void 0===f&&(f="html");for(var l,d,m,g,p,h,v,b,y,x,w,C,S,k,O,_,E,T,A,B=n.html,N=0,D=[],R=0,M=Qo.decode,I=ke.makeMap("src,href,data,background,formaction,poster,xlink:href"),P=/((java|vb)script|mhtml):/i,F="html"===f?0:1,L=function(t){for(var e,n=D.length;n--&&D[n].name!==t;);if(0<=n){for(e=D.length-1;n<=e;e--)(t=D[e]).valid&&a(t.name);D.length=n}},V=function(t,e){return i(gm(t,n),e)},H=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),t.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),r(gm(e,n)))},z=function(t,e){var n=t||"",r=!Vt(n,"--"),o=function(t,e,n){void 0===n&&(n=0);var r=t.toLowerCase();if(-1!==r.indexOf("[if ",n)&&(a=n,/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(r.substr(a)))){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(e){var i=r.indexOf(">",n);return-1!==i?i:r.length}var u=/--!?>/;u.lastIndex=n;var a,c=u.exec(t);return c?c.index+c[0].length:r.length}(B,r,e);return t=B.substr(e,o-e),H(r?n+t:t),o+1},j=function(e,r,o,i,u){var a,c,s,f;if(s=(r=r.toLowerCase())in $?r:M(o||i||u||""),o=gt(n.uris,s).getOr(s),X&&!b&&0==(0===(f=r).indexOf("data-")||0===f.indexOf("aria-"))){if(!(a=k[r])&&O){for(c=O.length;c--&&!(a=O[c]).pattern.test(r););-1===c&&(a=null)}if(!a)return;if(a.validValues&&!(o in a.validValues))return}if(I[r]&&!t.allow_script_urls){var l=o.replace(/[\s\u0000-\u001F]+/g,"");try{l=decodeURIComponent(l)}catch(t){l=unescape(l)}if(P.test(l))return;if(hm(t,l,e))return}b&&(r in I||0===r.indexOf("on"))||(g.map[r]=o,g.push({name:r,value:o}))},U=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),W=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,q=e.getShortEndedElements(),G=t.self_closing_elements||e.getSelfClosingElements(),$=e.getBoolAttrs(),X=t.validate,Y=t.remove_internals,K=t.fix_self_closing,J=e.getSpecialElements(),Q=B+">";l=U.exec(Q);){var Z=l[0];if(N<l.index&&V(M(B.substr(N,l.index-N))),d=l[7])":"===(d=d.toLowerCase()).charAt(0)&&(d=d.substr(1)),L(d);else if(d=l[8]){if(l.index+Z.length>B.length){V(M(B.substr(l.index))),N=l.index+Z.length;continue}":"===(d=d.toLowerCase()).charAt(0)&&(d=d.substr(1)),y=d in q,K&&G[d]&&0<D.length&&D[D.length-1].name===d&&L(d);var tt=function(t,e){var n=t.exec(e);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null}(W,l[9]);if(null!==tt){if("all"===tt){N=vm(e,B,U.lastIndex),U.lastIndex=N;continue}w=!1}if(!X||(x=e.getElementRule(d))){if(w=!0,X&&(k=x.attributes,O=x.attributePatterns),(S=l[9])?((b=-1!==S.indexOf("data-mce-type"))&&Y&&(w=!1),(g=[]).map={},S.replace(W,(function(t,e,n,r,o){return j(d,e,n,r,o),""}))):(g=[]).map={},X&&!b){if(_=x.attributesRequired,E=x.attributesDefault,T=x.attributesForced,x.removeEmptyAttrs&&!g.length&&(w=!1),T)for(p=T.length;p--;)v=(C=T[p]).name,"{$uid}"===(A=C.value)&&(A="mce_"+R++),g.map[v]=A,g.push({name:v,value:A});if(E)for(p=E.length;p--;)(v=(C=E[p]).name)in g.map||("{$uid}"===(A=C.value)&&(A="mce_"+R++),g.map[v]=A,g.push({name:v,value:A}));if(_){for(p=_.length;p--&&!(_[p]in g.map););-1===p&&(w=!1)}if(C=g.map["data-mce-bogus"]){if("all"===C){N=vm(e,B,U.lastIndex),U.lastIndex=N;continue}w=!1}}w&&u(d,g,y)}else w=!1;if(m=J[d]){m.lastIndex=N=l.index+Z.length,N=(l=m.exec(B))?(w&&(h=B.substr(N,l.index-N)),l.index+l[0].length):(h=B.substr(N),B.length),w&&(0<h.length&&V(h,!0),a(d)),U.lastIndex=N;continue}y||(S&&S.indexOf("/")===S.length-1?w&&a(d):D.push({name:d,valid:w}))}else if(d=l[1])H(d);else if(d=l[2]){if(!(1==F||t.preserve_cdata||0<D.length&&e.isValidChild(D[D.length-1].name,"#cdata"))){N=z("",l.index+2),U.lastIndex=N;continue}o(d)}else if(d=l[3])s(d);else{if((d=l[4])||"<!"===Z){N=z(d,l.index+Z.length),U.lastIndex=N;continue}if(d=l[5]){if(1!=F){N=z("?",l.index+2),U.lastIndex=N;continue}c(d,l[6])}}N=l.index+Z.length}for(N<B.length&&V(M(B.substr(N))),p=D.length-1;0<=p;p--)(d=D[p]).valid&&a(d.name)}(function(t){for(var e,n=/data:[^;]+;base64,([a-z0-9\+\/=]+)/gi,r=[],o={},i=za("img"),u=0,a=0;e=n.exec(t);){var c=e[0],s=i+"_"+a++;o[s]=c,u<e.index&&r.push(t.substr(u,e.index-u)),r.push(s),u=e.index+c.length}return 0===u?{prefix:i,uris:o,html:t}:(u<t.length&&r.push(t.substr(u)),{prefix:i,uris:o,html:r.join("")})}(n),f)}}}(bm=bm||{}).findEndTag=vm;var ym,xm=bm,wm=function(t,e){var n,r,o,i,u,a,c,s=e,f=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,l=t.schema;u=t.getTempAttrs(),a=s,c=new RegExp(["\\s?("+u.join("|")+')="[^"]+"'].join("|"),"gi"),s=a.replace(c,"");for(var d=l.getShortEndedElements();i=f.exec(s);)r=f.lastIndex,o=i[0].length,n=d[i[1]]?r:xm.findEndTag(l,s,r),s=s.substring(0,r-o)+s.substring(n),f.lastIndex=r-o;return io(s)},Cm=wm,Sm=ke.each,km=function(t){this.compare=function(e,n){if(e.nodeName!==n.nodeName)return!1;var r=function(e){var n={};return Sm(t.getAttribs(e),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=t.getAttrib(e,o))})),n},o=function(t,e){var n,r;for(r in t)if(t.hasOwnProperty(r)){if(void 0===(n=e[r]))return!1;if(t[r]!==n)return!1;delete e[r]}for(r in e)if(e.hasOwnProperty(r))return!1;return!0};return!(!o(r(e),r(n))||!o(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(n,"style")))||Bf(e)||Bf(n))}},Om=function(t,e,n){return S.from(n.container()).filter(In).exists((function(r){var o=t?0:-1;return e(r.data.charAt(n.offset()+o))}))},_m=l(Om,!0,Df),Em=l(Om,!1,Df),Tm=function(t){var e=t.container();return In(e)&&(0===e.data.length||oo(e.data)&&Bl.isBookmarkNode(e.parentNode))},Am=function(t,e){return function(n){return S.from(Ls(t?0:-1,n)).filter(e).isSome()}},Bm=function(t){return Hn(t)&&"block"===Qn(Ae(t),"display")},Nm=function(t){return jn(t)&&!(En(e=t)&&"all"===e.getAttribute("data-mce-bogus"));var e},Dm=Am(!0,Bm),Rm=Am(!1,Bm),Mm=Am(!0,Wn),Im=Am(!1,Wn),Pm=Am(!0,Dn),Fm=Am(!1,Dn),Lm=Am(!0,Nm),Vm=Am(!1,Nm),Hm=function(t){dn(t),fn(t,_e('<br data-mce-bogus="1">'))},zm=function(t){Ze(t).each((function(e){Ge(e).each((function(n){$r(t)&&Yr(e)&&$r(n)&&mn(e)}))}))},jm=function(t,e){return function(t,e,n){return Me(e,t)?function(t,e){for(var n=I(e)?e:b,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=Ae(i);if(o.push(u),!0===n(u))break;r=i}return o}(t,(function(t){return n(t)||Re(t,e)})).slice(0,-1):[]}(t,e,b)},Um=function(t,e){return[t].concat(jm(t,e))},Wm=function(t,e,n){return gf(t,e,n,Tm)},qm=function(t,e){return Y(Um(Ae(e.container()),t),$r)},Gm=function(t,e,n){return Wm(t,e.dom,n).forall((function(t){return qm(e,n).fold((function(){return!1===Fs(t,n,e.dom)}),(function(r){return!1===Fs(t,n,e.dom)&&Me(r,Ae(t.container()))}))}))},$m=function(t,e,n){return qm(e,n).fold((function(){return Wm(t,e.dom,n).forall((function(t){return!1===Fs(t,n,e.dom)}))}),(function(e){return Wm(t,e.dom,n).isNone()}))},Xm=l($m,!1),Ym=l($m,!0),Km=l(Gm,!1),Jm=l(Gm,!0),Qm=function(t){return Gs(t).exists(Yr)},Zm=function(t,e,n){var r=G(Um(Ae(n.container()),e),$r),o=nt(r).getOr(e);return df(t,o.dom,n).filter(Qm)},tg=function(t,e){return Gs(e).exists(Yr)||Zm(!0,t,e).isSome()},eg=function(t,e){return n=e,S.from(n.getNode(!0)).map(Ae).exists(Yr)||Zm(!1,t,e).isSome();var n},ng=l(Zm,!1),rg=l(Zm,!0),og=function(t){return Sc.isTextPosition(t)&&!t.isAtStart()&&!t.isAtEnd()},ig=function(t,e){var n=G(Um(Ae(e.container()),t),$r);return nt(n).getOr(t)},ug=function(t,e){return og(e)?Em(e):Em(e)||vf(ig(t,e).dom,e).exists(Em)},ag=function(t,e){return og(e)?_m(e):_m(e)||hf(ig(t,e).dom,e).exists(_m)},cg=function(t){return Gs(t).bind((function(t){return kr(t,Le)})).exists((function(t){return e=Qn(t,"white-space"),z(["pre","pre-wrap"],e);var e}))},sg=function(t,e){return!cg(e)&&(Xm(t,e)||Km(t,e)||eg(t,e)||ug(t,e))},fg=function(t,e){return!cg(e)&&(Ym(t,e)||Jm(t,e)||tg(t,e)||ag(t,e))},lg=function(t,e){return sg(t,e)||fg(t,(r=(n=e).container(),o=n.offset(),In(r)&&o<r.data.length?Sc(r,o+1):n));var n,r,o},dg=function(t,e){return Nf(t.charAt(e))},mg=function(t){var e=t.container();return In(e)&&Lt(e.data,no)},gg=function(t,e){return S.some(e).filter(mg).bind((function(e){var n,r,o,i,u,a,c,s,f=e.container();return u=t,c=(a=f).data,s=Sc(a,0),dg(c,0)&&!lg(u,s)&&(a.data=" "+c.slice(1),1)||function(t){var e,n=t.data,r=(e=n.split(""),U(e,(function(t,n){return Nf(t)&&0<n&&n<e.length-1&&Rf(e[n-1])&&Rf(e[n+1])?" ":t})).join(""));return r!==n&&(t.data=r,!0)}(f)||(n=t,o=(r=f).data,i=Sc(r,o.length-1),dg(o,o.length-1)&&!lg(n,i)&&(r.data=o.slice(0,-1)+" ",1))?S.some(e):S.none()}))},pg=function(t){var e=Ae(t.getBody());t.selection.isCollapsed()&&gg(e,Sc.fromRangeStart(t.selection.getRng())).each((function(e){t.selection.setRng(e.toRange())}))},hg=function(t,e,n){var r,o,i,u,a,c,s,f;0!==n&&(r=Ae(t),o=Sr(r,$r).getOr(r),i=t.data.slice(e,e+n),u=e+n>=t.data.length&&fg(o,_c(t,t.data.length)),a=0===e&&sg(o,_c(t,0)),t.replaceData(e,n,(s=a,f=u,X(c=i,(function(t,e){return Df(e)||Nf(e)?t.previousCharIsSpace||""===t.str&&s||t.str.length===c.length-1&&f?{previousCharIsSpace:!1,str:t.str+no}:{previousCharIsSpace:!0,str:t.str+" "}:{previousCharIsSpace:!1,str:t.str+e}}),{previousCharIsSpace:!1,str:""}).str)))},vg=function(t,e){var n=t.data.slice(e),r=n.length-jt(n).length;return hg(t,e,r)},bg=function(t,e){var n=t.data.slice(0,e),r=n.length-Ut(n).length;return hg(t,e-r,r)},yg=function(t,e,n,r){void 0===r&&(r=!0);var o=Ut(t.data).length,i=r?t:e,u=r?e:t;return r?i.appendData(u.data):i.insertData(0,u.data),mn(Ae(u)),n&&vg(i,o),i},xg=function(t,e){return r=t,o=(n=e).container(),i=n.offset(),!1===_c.isTextPosition(n)&&o===r.parentNode&&i>_c.before(r).offset()?_c(e.container(),e.offset()-1):e;var n,r,o,i},wg=function(t){return _o(t.previousSibling)?S.some((e=t.previousSibling,In(e)?_c(e,e.data.length):_c.after(e))):t.previousSibling?yf(t.previousSibling):S.none();var e},Cg=function(t){return _o(t.nextSibling)?S.some((e=t.nextSibling,In(e)?_c(e,0):_c.before(e))):t.nextSibling?bf(t.nextSibling):S.none();var e},Sg=function(t,e){return wg(e).orThunk((function(){return Cg(e)})).orThunk((function(){return n=t,r=e,o=_c.before(r.previousSibling?r.previousSibling:r.parentNode),vf(n,o).fold((function(){return hf(n,_c.after(r))}),S.some);var n,r,o}))},kg=function(t,e){return Cg(e).orThunk((function(){return wg(e)})).orThunk((function(){return r=e,hf(n=t,_c.after(r)).fold((function(){return vf(n,_c.before(r))}),S.some);var n,r}))},Og=function(t,e,n){return(t?kg:Sg)(e,n).map(l(xg,n))},_g=function(t,e,n){n.fold((function(){t.focus()}),(function(n){t.selection.setRng(n.toRange(),e)}))},Eg=function(t,e){return e&&pt(t.schema.getBlockElements(),Ie(e))},Tg=function(t){if(Io(t)){var e=_e('<br data-mce-bogus="1">');return dn(t),fn(t,e),S.some(_c.before(e.dom))}return S.none()},Ag=function(t,e,n,r){void 0===r&&(r=!0);var o,i,u=Og(e,t.getBody(),n.dom),a=Sr(n,l(Eg,t),(o=t.getBody(),function(t){return t.dom===o})),c=function(t,e,n){var r,o,i,u,a=Ge(t).filter(Ve),c=$e(t).filter(Ve);return mn(t),o=c,i=e,u=function(t,e,r){var o=t.dom,i=e.dom,u=o.data.length;return yg(o,i,n),r.container()===i?_c(o,u):r},((r=a).isSome()&&o.isSome()&&i.isSome()?S.some(u(r.getOrDie(),o.getOrDie(),i.getOrDie())):S.none()).orThunk((function(){return n&&(a.each((function(t){return bg(t.dom,t.dom.length)})),c.each((function(t){return vg(t.dom,0)}))),e}))}(n,u,(i=n,pt(t.schema.getTextInlineElements(),Ie(i))));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):a.bind(Tg).fold((function(){r&&_g(t,e,c)}),(function(n){r&&_g(t,e,S.some(n))}))},Bg=function(t,e){return{start:t,end:e}},Ng=hr([{removeTable:["element"]},{emptyCells:["cells"]},{deleteCellSelection:["rng","cell"]}]),Dg=function(t,e){return Er(Ae(t),"td,th",e)},Rg=function(t,e){return Or(t,"table",e)},Mg=function(t){return!Re(t.start,t.end)},Ig=function(t,e){return Rg(t.start,e).bind((function(n){return Rg(t.end,e).bind((function(t){return e=Re(n,t),r=n,e?S.some(r):S.none();var e,r}))}))},Pg=function(t){return Ma(t,"td,th")},Fg=function(t,e){return Ig(e,t).isSome()},Lg=function(t,e,n){return t.filter((function(t){return Mg(t)&&Fg(n,t)})).orThunk((function(){return function(t,e){var n=Dg(e.startContainer,t),r=Dg(e.endContainer,t);return e.collapsed?S.none():Xa(n,r,Bg).fold((function(){return n.fold((function(){return r.bind((function(e){return Rg(e,t).bind((function(t){return nt(Pg(t)).map((function(t){return Bg(t,e)}))}))}))}),(function(e){return Rg(e,t).bind((function(t){return rt(Pg(t)).map((function(t){return Bg(e,t)}))}))}))}),(function(e){return Fg(t,e)?S.none():(r=t,Rg((n=e).start,r).bind((function(t){return rt(Pg(t)).map((function(t){return Bg(n.start,t)}))})));var n,r}))}(n,e)})).bind((function(t){return Ig(e=t,n).map((function(t){return{rng:e,table:t,cells:Pg(t)}}));var e}))},Vg=function(t,e){return K(t,(function(t){return Re(t,e)}))},Hg=function(t){return Xa(Vg((e=t).cells,e.rng.start),Vg(e.cells,e.rng.end),(function(t,n){return e.cells.slice(t,n+1)})).map((function(e){var n=t.cells;return e.length===n.length?Ng.removeTable(t.table):Ng.emptyCells(e)}));var e},zg=function(t,e){var n,r,o,i,u,a=(n=t,function(t){return Re(n,t)}),c=(o=a,i=Dg((r=e).startContainer,o),u=Dg(r.endContainer,o),Xa(i,u,Bg));return function(t,e,n){return t.filter((function(t){return o=n,!Mg(r=t)&&Ig(r,o).exists((function(t){var e=t.dom.rows;return 1===e.length&&1===e[0].cells.length}))&&bl(t.start,e);var r,o})).map((function(t){return t.start}))}(c,e,a).map((function(t){return Ng.deleteCellSelection(e,t)})).orThunk((function(){return Lg(c,e,a).bind(Hg)}))},jg=function(t){var e;return(8===Pe(e=t)||"#comment"===Ie(e)?Ge:Ze)(t).bind(jg).orThunk((function(){return S.some(t)}))},Ug=function(t,e){return W(e,Hm),t.selection.setCursorLocation(e[0].dom,0),!0},Wg=function(t,e,n){e.deleteContents();var r,o,i=jg(n).getOr(n),u=Ae(t.dom.getParent(i.dom,t.dom.isBlock));return Io(u)&&(Hm(u),t.selection.setCursorLocation(u.dom,0)),Re(n,u)||(r=qe(u).is(n)?[]:qe(o=u).map(Ke).map((function(t){return G(t,(function(t){return!Re(o,t)}))})).getOr([]),W(r.concat(Ke(n)),(function(t){Re(t,u)||Me(t,u)||mn(t)}))),!0},qg=function(t,e){return Ag(t,!1,e),!0},Gg=function(t,e){return Y(Um(e,t),to)},$g=function(t,e){return Y(Um(e,t),(function(t){return"caption"===Ie(t)}))},Xg=function(t,e){return Hm(e),t.selection.setCursorLocation(e.dom,0),S.some(!0)},Yg=function(t,e){return(t?Pm:Fm)(e)},Kg=function(t,e,n){var r=Ae(t.getBody());return $g(r,n).fold((function(){return function(t,e,n,r){var o=_c.fromRangeStart(t.selection.getRng());return Gg(n,r).bind((function(r){return Io(r)?Xg(t,r):(i=n,u=r,a=o,mf(e,t.getBody(),a).bind((function(t){return Gg(i,Ae(t.getNode())).map((function(t){return!1===Re(t,u)}))})));var i,u,a})).getOr(!1)}(t,e,r,n)||(o=t,i=e,u=_c.fromRangeStart(o.selection.getRng()),Yg(i,u)||df(i,o.getBody(),u).exists((function(t){return Yg(i,t)})));var o,i,u}),(function(n){return o=t,i=e,u=r,a=n,c=_c.fromRangeStart(o.selection.getRng()),(Io(a)?Xg(o,a):function(t,e,n,r,o){return mf(n,t.getBody(),o).bind((function(i){return c=n,s=o,f=i,bf((a=r).dom).bind((function(t){return yf(a.dom).map((function(e){return c?s.isEqual(t)&&f.isEqual(e):s.isEqual(e)&&f.isEqual(t)}))})).getOr(!0)?Xg(t,r):(u=r,$g(e,Ae(i.getNode())).map((function(t){return!1===Re(t,u)})));var u,a,c,s,f})).or(S.some(!0))}(o,u,i,a,c)).getOr(!1);var o,i,u,a,c}))},Jg=function(t,e){var n,r,o,i,u,a=Ae(t.selection.getStart(!0)),c=pl(t);return t.selection.isCollapsed()&&0===c.length?Kg(t,e,a):(r=a,o=Ae((n=t).getBody()),i=n.selection.getRng(),0!==(u=pl(n)).length?Ug(n,u):function(t,e,n,r){return $g(e,r).fold((function(){return r=t,zg(e,n).map((function(t){return t.fold(l(qg,r),l(Ug,r),l(Wg,r))}));var r}),(function(e){return Xg(t,e)})).getOr(!1)}(n,o,i,r))},Qg=function(t){return t.collapsed?t:function(t){var e=_c.fromRangeStart(t),n=_c.fromRangeEnd(t),r=t.commonAncestorContainer;return df(!1,r,n).map((function(o){return!Fs(e,n,r)&&Fs(e,o,r)?(i=e.container(),u=e.offset(),a=o.container(),c=o.offset(),(s=document.createRange()).setStart(i,u),s.setEnd(a,c),s):t;var i,u,a,c,s})).getOr(t)}(t)},Zg=function(t,e){var n,r,o,i=e.firstChild,u=e.lastChild;return i&&"meta"===i.name&&(i=i.next),u&&"mce_marker"===u.attr("id")&&(u=u.prev),r=u,o=(n=t).getNonEmptyElements(),r&&(r.isEmpty(o)||function(t,e){var n,r;return t.getBlockElements()[e.name]&&(r=e).firstChild&&r.firstChild===r.lastChild&&("br"===(n=e.firstChild).name||n.value===no)}(n,r))&&(u=u.prev),!(!i||i!==u||"ul"!==i.name&&"ol"!==i.name)},tp=function(t){return 0<t.length&&(!(e=t[t.length-1]).firstChild||function(t){return t&&t.firstChild&&t.firstChild===t.lastChild&&((e=t.firstChild).data===no||Vn(e));var e}(e))?t.slice(0,-1):t;var e},ep=function(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null},np=function(t,e){var n=_c.after(t),r=cf(e).prev(n);return r?r.toRange():null},rp=function(t,e,n,r){var o,i,u,a,c,s,f,l,d,m,g,p,h,v,b,y,x,w,C,S=(o=e,i=r,s=t.serialize(i),a=(u=o.createFragment(s)).firstChild,c=u.lastChild,a&&"META"===a.nodeName&&a.parentNode.removeChild(a),c&&"mce_marker"===c.id&&c.parentNode.removeChild(c),u),k=ep(e,n.startContainer),O=tp((f=S.firstChild,ke.grep(f.childNodes,(function(t){return"LI"===t.nodeName})))),_=e.getRoot(),E=function(t){var r=_c.fromRangeStart(n),o=cf(e.getRoot()),i=1===t?o.prev(r):o.next(r);return!i||ep(e,i.getNode())!==k};return E(1)?function(t,e,n){var r,o,i,u,a=t.parentNode;return ke.each(e,(function(e){a.insertBefore(e,t)})),r=t,o=n,i=_c.before(r),(u=cf(o).next(i))?u.toRange():null}(k,O,_):E(2)?(l=k,d=O,m=_,e.insertAfter(d.reverse(),l),np(d[0],m)):(p=O,h=_,v=g=k,y=(b=n).cloneRange(),x=b.cloneRange(),y.setStartBefore(v),x.setEndAfter(v),w=[y.cloneContents(),x.cloneContents()],(C=g.parentNode).insertBefore(w[0],g),ke.each(p,(function(t){C.insertBefore(t,g)})),C.insertBefore(w[1],g),C.removeChild(g),np(p[p.length-1],h))},op=Un,ip=function(t,e,n){var r,o,i,u,a,c,s,f,l,d=t.selection,m=t.dom;/^ | $/.test(e)&&(c=m,s=d.getRng(),f=e,l=Ae(c.getRoot()),f=sg(l,_c.fromRangeStart(s))?f.replace(/^ /,"&nbsp;"):f.replace(/^&nbsp;/," "),e=f=fg(l,_c.fromRangeEnd(s))?f.replace(/(&nbsp;| )(<br( \/)>)?$/,"&nbsp;"):f.replace(/&nbsp;(<br( \/)?>)?$/," "));var g=t.parser,p=n.merge,h=mm({validate:t.getParam("validate")},t.schema),v='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;</span>',b={content:e,format:"html",selection:!0,paste:n.paste};if((b=t.fire("BeforeSetContent",b)).isDefaultPrevented())t.fire("SetContent",{content:b.content,format:"html",selection:!0,paste:n.paste});else{-1===(e=b.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,v);var y,x,w=(u=d.getRng()).startContainer||(u.parentElement?u.parentElement():null),C=t.getBody();w===C&&d.isCollapsed()&&m.isBlock(C.firstChild)&&(y=t,(x=C.firstChild)&&!y.schema.getShortEndedElements()[x.nodeName])&&m.isEmpty(C.firstChild)&&((u=m.createRng()).setStart(C.firstChild,0),u.setEnd(C.firstChild,0),d.setRng(u)),d.isCollapsed()||function(t){var e=t.dom,n=Qg(t.selection.getRng());t.selection.setRng(n);var r,o,i=e.getParent(n.startContainer,op);r=n,null!==(o=i)&&o===e.getParent(r.endContainer,op)&&bl(Ae(o),r)?Wg(t,n,Ae(i)):t.getDoc().execCommand("Delete",!1,null)}(t);var k,O,_,E,T,A,B,N,D,R,M,I,P,F,L={context:(r=d.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},V=g.parse(e,L);if(!0===n.paste&&Zg(t.schema,V)&&ep(m,r))return u=rp(h,m,d.getRng(),V),d.setRng(u),void t.fire("SetContent",b);if(function(t){for(var e=t;e=e.walk();)1===e.type&&e.attr("data-mce-fragment","1")}(V),"mce_marker"===(a=V.lastChild).attr("id"))for(a=(i=a).prev;a;a=a.walk(!0))if(3===a.type||!m.isBlock(a.name)){t.schema.isValidChild(a.parent.name,"span")&&a.parent.insert(i,a,"br"===a.name);break}if(t._selectionOverrides.showBlockCaretContainer(r),L.invalid){for(t.selection.setContent(v),r=d.getNode(),o=t.getBody(),9===r.nodeType?r=a=o:a=r;a!==o;)a=(r=a).parentNode;e=r===o?o.innerHTML:m.getOuterHTML(r),e=h.serialize(g.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,(function(){return h.serialize(V)})))),r===o?m.setHTML(o,e):m.setOuterHTML(r,e)}else k=t,O=e=h.serialize(V),"all"===(_=r).getAttribute("data-mce-bogus")?_.parentNode.insertBefore(k.dom.createFragment(O),_):(E=_.firstChild,T=_.lastChild,!E||E===T&&"BR"===E.nodeName?k.dom.setHTML(_,O):k.selection.setContent(O));B=p,R=(A=t).schema.getTextInlineElements(),M=A.dom,B&&(N=A.getBody(),D=new km(M),ke.each(M.select("*[data-mce-fragment]"),(function(t){for(var e=t.parentNode;e&&e!==N;e=e.parentNode)R[t.nodeName.toLowerCase()]&&D.compare(e,t)&&M.remove(t,!0)}))),function(t,e){var n,r,o=t.dom,i=t.selection;if(e){i.scrollIntoView(e);var u=function(e){for(var n=t.getBody();e&&e!==n;e=e.parentNode)if("false"===o.getContentEditable(e))return e;return null}(e);if(u)return o.remove(e),i.select(u);var a=o.createRng(),c=e.previousSibling;c&&3===c.nodeType?(a.setStart(c,c.nodeValue.length),ye.ie||(r=e.nextSibling)&&3===r.nodeType&&(c.appendData(r.data),r.parentNode.removeChild(r))):(a.setStartBefore(e),a.setEndBefore(e));var s=o.getParent(e,o.isBlock);o.remove(e),s&&o.isEmpty(s)&&(t.$(s).empty(),a.setStart(s,0),a.setEnd(s,0),op(s)||s.getAttribute("data-mce-fragment")||!(n=function(e){var n=_c.fromRangeStart(e);if(n=cf(t.getBody()).next(n))return n.toRange()}(a))?o.add(s,o.create("br",{"data-mce-bogus":"1"})):(a=n,o.remove(s))),i.setRng(a)}}(t,m.get("mce_marker")),I=t.getBody(),ke.each(I.getElementsByTagName("*"),(function(t){t.removeAttribute("data-mce-fragment")})),P=m,F=d.getStart(),S.from(P.getParent(F,"td,th")).map(Ae).each(zm),t.fire("SetContent",b),t.addVisual()}},up=function(t,e){e(t),t.firstChild&&up(t.firstChild,e),t.next&&up(t.next,e)},ap=function(t,e,n){var r=function(t,e,n){var r={},o={},i=[];for(var u in n.firstChild&&up(n.firstChild,(function(n){W(t,(function(t){t.name===n.name&&(r[t.name]?r[t.name].nodes.push(n):r[t.name]={filter:t,nodes:[n]})})),W(e,(function(t){"string"==typeof n.attr(t.name)&&(o[t.name]?o[t.name].nodes.push(n):o[t.name]={filter:t,nodes:[n]})}))})),r)r.hasOwnProperty(u)&&i.push(r[u]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i}(t,e,n);W(r,(function(t){W(t.filter.callbacks,(function(e){e(t.nodes,t.filter.name,{})}))}))},cp=function(t){return t instanceof sm},sp=function(t,e){var n;t.dom.setHTML(t.getBody(),e),jd(n=t)&&bf(n.getBody()).each((function(t){var e=t.getNode(),r=Dn(e)?bf(e).getOr(t):t;n.selection.setRng(r.toRange())}))},fp=function(t,e){return r=e,((o=(n=t).dom).parentNode?function(t,e){return Y(t.dom.childNodes,(function(t){return e(Ae(t))})).map(Ae)}(Ae(o.parentNode),(function(t){return!Re(n,t)&&r(t)})):S.none()).isSome();var n,r,o},lp=ro,dp="_mce_caret",mp=function(t){return 0<function(t){for(var e=[];t;){if(3===t.nodeType&&t.nodeValue!==lp||1<t.childNodes.length)return[];1===t.nodeType&&e.push(t),t=t.firstChild}return e}(t).length},gp=function(t){if(t){var e=new Ur(t,t);for(t=e.current();t;t=e.next())if(In(t))return t}return null},pp=function(t){var e=Ee("span");return Xn(e,{id:dp,"data-mce-bogus":"1","data-mce-type":"format-caret"}),t&&fn(e,Te(lp)),e},hp=function(t,e,n){void 0===n&&(n=!0);var r,o,i,u,a,c,s,f,l=t.dom,d=t.selection;mp(e)?Ag(t,!1,Ae(e),n):(r=d.getRng(),o=l.getParent(e,l.isBlock),i=r.startContainer,u=r.startOffset,a=r.endContainer,c=r.endOffset,(f=gp(e))&&f.nodeValue.charAt(0)===lp&&f.deleteData(0,1),s=f,l.remove(e,!0),i===s&&0<u&&r.setStart(s,u-1),a===s&&0<c&&r.setEnd(s,c-1),o&&l.isEmpty(o)&&Hm(Ae(o)),d.setRng(r))},vp=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(e)hp(t,e,n);else if(!(e=Cf(t.getBody(),o.getStart())))for(;e=r.get(dp);)hp(t,e,!1)},bp=function(t,e){return t.appendChild(e),e},yp=function(t,e){var n=$(t,(function(t,e){return bp(t,e.cloneNode(!1))}),e);return bp(n,n.ownerDocument.createTextNode(lp))},xp=function(t,e,n,r){var o,i,u,a,c,s,f,d,m,g,p,h,v,b=t.dom,y=t.selection,x=[],w=y.getRng(),C=w.startContainer,k=w.startOffset,O=C;for(3===C.nodeType&&(k!==C.nodeValue.length&&(o=!0),O=O.parentNode);O;){if(rm(t,O,e,n,r)){i=O;break}O.nextSibling&&(o=!0),x.push(O),O=O.parentNode}i&&(o?(u=y.getBookmark(),w.collapse(!0),a=fl(t,w,t.formatter.get(e),!0),a=Gl(a),t.formatter.remove(e,n,a,r),y.moveToBookmark(u)):(c=Cf(t.getBody(),i),g=s=pp(!1).dom,p=null!==c?c:i,(v=(h=(m=t).dom).getParent(p,l(Ff,m)))&&h.isEmpty(v)?p.parentNode.replaceChild(g,p):(function(t){var e=Ma(t,"br"),n=G(function(t){for(var e=[],n=t.dom;n;)e.push(Ae(n)),n=n.lastChild;return e}(t).slice(-1),Yr);e.length===n.length&&W(n,mn)}(Ae(p)),h.isEmpty(p)?p.parentNode.replaceChild(g,p):h.insertAfter(g,p)),f=function(t,e,n,r,o,i){var u=t.formatter,a=t.dom,c=G(it(u.get()),(function(t){return t!==r&&!Lt(t,"removeformat")})),s=im(t,n,c);if(0<G(s,(function(e){return!Gf(t,e,r)})).length){var f=n.cloneNode(!1);return a.add(e,f),u.remove(r,o,f,i),a.remove(f),S.some(f)}return S.none()}(t,s,i,e,n,r),d=yp(x.concat(f.toArray()),s),hp(t,c,!1),y.setCursorLocation(d,1),b.isEmpty(i)&&b.remove(i)))},wp=function(t,e){return t.schema.getTextInlineElements().hasOwnProperty(Ie(e))&&!wf(e.dom)&&!Nn(e.dom)},Cp={},Sp=xt,kp=bt;ym=function(t){var e,n=t.selection.getRng(),r=Tn(["pre"]);n.collapsed||(e=t.selection.getSelectedBlocks(),kp(Sp(Sp(e,r),(function(t){return r(t.previousSibling)&&-1!==wt(e,t.previousSibling)})),(function(t){var e,n;e=t.previousSibling,oa(n=t).remove(),oa(e).append("<br><br>").append(n.childNodes)})))},Cp["pre"]||(Cp.pre=[]),Cp.pre.push(ym);var Op=ke.each,_p=function(t){return En(t)&&!Bf(t)&&!wf(t)&&!Nn(t)},Ep=function(t,e){for(var n=t;n;n=n[e]){if(In(n)&&0!==n.nodeValue.length)return t;if(En(n)&&!Bf(n))return n}return t},Tp=function(t,e,n){var r,o,i=new km(t);if(e&&n&&(e=Ep(e,"previousSibling"),n=Ep(n,"nextSibling"),i.compare(e,n))){for(r=e.nextSibling;r&&r!==n;)r=(o=r).nextSibling,e.appendChild(o);return t.remove(n),ke.each(ke.grep(n.childNodes),(function(t){e.appendChild(t)})),e}return n},Ap=function(t,e,n,r){var o;r&&!1!==e.merge_siblings&&(o=Tp(t,Pf(r),r),Tp(t,o,Pf(o,!0)))},Bp=function(t,e,n){Op(t.childNodes,(function(t){_p(t)&&(e(t)&&n(t),t.hasChildNodes()&&Bp(t,e,n))}))},Np=function(t,e){return function(n){return!(!n||!Uf(t,n,e))}},Dp=function(t,e,n){return function(r){var o,i;t.setStyle(r,e,n),""===r.getAttribute("style")&&r.removeAttribute("style"),o=t,"SPAN"===(i=r).nodeName&&0===o.getAttribs(i).length&&o.remove(i,!0)}},Rp=hr([{keep:[]},{rename:["name"]},{removed:[]}]),Mp=/^(src|href|style)$/,Ip=ke.each,Pp=zf,Fp=function(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)},Lp=function(t,e,n){var r,o=e[n?"startContainer":"endContainer"],i=e[n?"startOffset":"endOffset"];return En(o)&&(r=o.childNodes.length-1,!n&&i&&i--,o=o.childNodes[r<i?r:i]),In(o)&&n&&i>=o.nodeValue.length&&(o=new Ur(o,t.getBody()).next()||o),In(o)&&!n&&0===i&&(o=new Ur(o,t.getBody()).prev()||o),o},Vp=function(t,e){var n=e?"firstChild":"lastChild";if(/^(TR|TH|TD)$/.test(t.nodeName)&&t[n]){var r=t[n];return"TR"===t.nodeName&&r[n]||r}return t},Hp=function(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o},zp=function(t,e,n,r,o){var i=Ae(e),u=Ae(t.create(r,o)),a=(n?Ye:Xe)(i);return ln(u,a),n?(an(i,u),sn(u,i)):(cn(i,u),fn(u,i)),u.dom},jp=function(t,e,n,r){return!(e=Pf(e,n,r))||"BR"===e.nodeName||t.isBlock(e)},Up=function(t,e,n,r,o){var i,u,a,c,s,f=t.dom;if(a=f,!(Pp(c=r,(s=e).inline)||Pp(c,s.block)||s.selector&&En(c)&&a.is(c,s.selector)||(u=r,e.links&&"A"===u.nodeName)))return Rp.keep();var l,d,m,g,p,h,v,b=r;if(e.inline&&"all"===e.remove&&A(e.preserve_attributes)){var y=G(f.getAttribs(b),(function(t){return z(e.preserve_attributes,t.name.toLowerCase())}));if(f.removeAllAttribs(b),W(y,(function(t){return f.setAttrib(b,t.name,t.value)})),0<y.length)return Rp.rename("span")}if("all"!==e.remove){Ip(e.styles,(function(t,r){t=jf(f,Hf(t,n),r+""),P(r)&&(r=t,o=null),!e.remove_similar&&o&&!Pp(Uf(f,o,r),t)||f.setStyle(b,r,""),i=!0})),i&&""===f.getAttrib(b,"style")&&(b.removeAttribute("style"),b.removeAttribute("data-mce-style")),Ip(e.attributes,(function(t,r){var i;if(t=Hf(t,n),P(r)&&(r=t,o=null),e.remove_similar||!o||Pp(f.getAttrib(o,r),t)){if("class"===r&&(t=f.getAttrib(b,r))&&(i="",W(t.split(/\s+/),(function(t){/mce\-\w+/.test(t)&&(i+=(i?" ":"")+t)})),i))return void f.setAttrib(b,r,i);"class"===r&&b.removeAttribute("className"),Mp.test(r)&&b.removeAttribute("data-mce-"+r),b.removeAttribute(r)}})),Ip(e.classes,(function(t){t=Hf(t,n),o&&!f.hasClass(o,t)||f.removeClass(b,t)}));for(var x=f.getAttribs(b),w=0;w<x.length;w++){var C=x[w].nodeName;if(0!==C.indexOf("_")&&0!==C.indexOf("data-"))return Rp.keep()}}return"none"!==e.remove?(l=t,m=e,p=(d=b).parentNode,h=l.dom,v=Jc(l),m.block&&(v?p===h.getRoot()&&(m.list_block&&Pp(d,m.list_block)||W(ot(d.childNodes),(function(t){Lf(l,v,t.nodeName.toLowerCase())?g?g.appendChild(t):(g=Hp(h,t,v),h.setAttribs(g,l.settings.forced_root_block_attrs)):g=0}))):h.isBlock(d)&&!h.isBlock(p)&&(jp(h,d,!1)||jp(h,d.firstChild,!0,!0)||d.insertBefore(h.create("br"),d.firstChild),jp(h,d,!0)||jp(h,d.lastChild,!1,!0)||d.appendChild(h.create("br")))),m.selector&&m.inline&&!Pp(m.inline,d)||h.remove(d,!0),Rp.removed()):Rp.keep()},Wp=function(t,e,n,r,o){return Up(t,e,n,r,o).fold(b,(function(e){return t.dom.rename(r,e),!0}),y)},qp=function(t,e,n,r,o){var i,u=t.formatter.get(e),a=u[0],c=!0,f=t.dom,l=t.selection,d=function(r){var i,c,f,l,d,m,g=(c=r,f=e,l=n,d=o,W(qf((i=t).dom,c.parentNode).reverse(),(function(t){var e;m||"_start"===t.id||"_end"===t.id||(e=rm(i,t,f,l,d))&&!1!==e.split&&(m=t)})),m);return function(t,e,n,r,o,i,u,a){var c,f,l,d=t.dom;if(n){for(var m=n.parentNode,g=r.parentNode;g&&g!==m;g=g.parentNode){c=d.clone(g,!1);for(var p=0;p<e.length&&null!==(c=function(t,e,n,r){return Up(t,e,n,r,r).fold(s(r),(function(e){return t.dom.createFragment().appendChild(r),t.dom.rename(r,e)}),s(null))}(t,e[p],a,c));p++);c&&(f&&c.appendChild(f),l=l||c,f=c)}!i||u.mixed&&d.isBlock(n)||(r=d.split(n,r)),f&&(o.parentNode.insertBefore(f,o),l.appendChild(o),u.inline&&Ap(d,u,0,f))}return r}(t,u,g,r,r,!0,a,n)},m=function(e){var r,o;En(e)&&f.getContentEditable(e)&&(r=c,c="true"===f.getContentEditable(e),o=!0);var i=ot(e.childNodes);if(c&&!o)for(var s=0;s<u.length&&!Wp(t,u[s],n,e,e);s++);if(a.deep&&i.length){for(s=0;s<i.length;s++)m(i[s]);o&&(c=r)}},g=function(t){var e,n=f.get(t?"_start":"_end"),r=n[t?"firstChild":"lastChild"];return Bf(e=r)&&En(e)&&("_start"===e.id||"_end"===e.id)&&(r=r[t?"firstChild":"lastChild"]),In(r)&&0===r.data.length&&(r=t?n.previousSibling||n.nextSibling:n.nextSibling||n.previousSibling),f.remove(n,!0),r},p=function(e){var n,r,o=fl(t,e,u,e.collapsed);if(a.split){if(o=Gl(o),(n=Lp(t,o,!0))!==(r=Lp(t,o))){if(n=Vp(n,!0),r=Vp(r,!1),Fp(f,n,r)){var i=S.from(n.firstChild).getOr(n);return d(zp(f,i,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void g(!0)}if(Fp(f,r,n))return i=S.from(r.lastChild).getOr(r),d(zp(f,i,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void g(!1);n=Hp(f,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=Hp(f,r,"span",{id:"_end","data-mce-type":"bookmark"});var c=f.createRng();c.setStartAfter(n),c.setEndBefore(r),dl(f,c,(function(t){W(t,(function(t){Bf(t)||Bf(t.parentNode)||d(t)}))})),d(n),d(r),n=g(!0),r=g()}else n=r=d(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=f.nodeIndex(n),o.endContainer=r.parentNode?r.parentNode:r,o.endOffset=f.nodeIndex(r)+1}dl(f,o,(function(e){W(e,(function(e){m(e),W(["underline","line-through","overline"],(function(n){En(e)&&t.dom.getStyle(e,"text-decoration")===n&&e.parentNode&&Wf(f,e.parentNode)===n&&Wp(t,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,e)}))}))}))};if(r)Mf(r)?((i=f.createRng()).setStartBefore(r),i.setEndAfter(r),p(i)):p(r);else if("false"!==f.getContentEditable(l.getNode()))l.isCollapsed()&&a.inline&&!pl(t).length?xp(t,e,n,o):(Cl(l,!0,(function(){wl(t,p)})),a.inline&&om(t,e,n,l.getStart())&&If(f,l,l.getRng()),t.nodeChanged());else{r=l.getNode();for(var h=0;h<u.length&&(!u[h].ceFalseOverride||!Wp(t,u[h],n,r,r));h++);}},Gp=ke.each,$p=ke.each,Xp=ht,Yp=function(t,e,n,r){var o,i,u,a,c=t.formatter.get(e),s=c[0],f=!r&&t.selection.isCollapsed(),l=t.dom,d=t.selection,m=function(t,e){var o;e=e||s,t&&(e.onformat&&e.onformat(t,e,n,r),$p(e.styles,(function(e,r){l.setStyle(t,r,Hf(e,n))})),!e.styles||(o=l.getAttrib(t,"style"))&&l.setAttrib(t,"data-mce-style",o),$p(e.attributes,(function(e,r){l.setAttrib(t,r,Hf(e,n))})),$p(e.classes,(function(e){e=Hf(e,n),l.hasClass(t,e)||l.addClass(t,e)})))},g=function(t,e){var n=!1;return!!Xf(s)&&($p(t,(function(t){if(!("collapsed"in t)||t.collapsed===f)return l.is(e,t.selector)&&!wf(e)?(m(e,t),!(n=!0)):void 0})),n)},p=function(r,o,i,u){var a=[],f=!0,l=s.inline||s.block,d=r.create(l);m(d),dl(r,o,(function(o){var i,p=function(o){var h=!1,v=f,b=o.nodeName.toLowerCase(),y=o.parentNode.nodeName.toLowerCase();if(En(o)&&r.getContentEditable(o)&&(v=f,f="true"===r.getContentEditable(o),h=!0),Vn(o)&&!function(t,e,n,r){if(t.getParam("format_empty_lines",!1,"boolean")&&Yf(e)){var o=Ot(Ot({},t.schema.getTextBlockElements()),{td:{},th:{},li:{},dt:{},dd:{},figcaption:{},caption:{},details:{},summary:{}}),i=fp(Ae(n),(function(t){return wf(t.dom)}));return ht(o,r)&&Io(Ae(n.parentNode),!1)&&!i}return!1}(t,s,o,y))return i=null,void($f(s)&&r.remove(o));if(s.wrapper&&rm(t,o,e,n))i=null;else{if(f&&!h&&$f(s)&&!s.wrapper&&Ff(t,b)&&Lf(t,y,l)){var x=r.rename(o,l);return m(x),a.push(x),void(i=null)}if(Xf(s)){var w=g(c,o);if(!Xp(s,"inline")||w)return void(i=null)}!f||h||!Lf(t,l,b)||!Lf(t,y,l)||!u&&3===o.nodeType&&1===o.nodeValue.length&&65279===o.nodeValue.charCodeAt(0)||wf(o)||Xp(s,"inline")&&r.isBlock(o)?(i=null,$p(ke.grep(o.childNodes),p),h&&(f=v),i=null):(i||(i=r.clone(d,!1),o.parentNode.insertBefore(i,o),a.push(i)),i.appendChild(o))}};$p(o,p)})),!0===s.links&&$p(a,(function(t){var e=function(t){"A"===t.nodeName&&m(t,s),$p(ke.grep(t.childNodes),e)};e(t)})),$p(a,(function(o){var i,u,f,l,d,g,p,h,v,b,y,x,w,C,S,k,O,_,E,T,A=(i=0,$p(o.childNodes,(function(t){var e;M(e=t)&&In(e)&&0===e.length||Bf(t)||i++})),i);!(1<a.length)&&r.isBlock(o)||0!==A?(Yf(s)||s.wrapper)&&(s.exact||1!==A||((T=function(t){var e=!1;return $p(t.childNodes,(function(t){if((n=t)&&1===n.nodeType&&!Bf(n)&&!wf(n)&&!Nn(n))return e=t,!1;var n})),e}(_=o))&&!Bf(T)&&em(r,T,s)&&(E=r.clone(T,!1),m(E),r.replace(E,_,!0),r.remove(T,!0)),o=E||_),function(t,e,n,r){Gp(e,(function(e){var o,i,u,a;Gp(t.dom.select(e.inline,r),(function(r){_p(r)&&Wp(t,e,n,r,e.exact?r:null)})),o=t.dom,u=r,(i=e).clear_child_styles&&(a=i.links?"*:not(a)":"*",Op(o.select(a,u),(function(t){_p(t)&&Op(i.styles,(function(e,n){o.setStyle(t,n,"")}))})))}))}(t,c,n,o),C=s,S=e,k=n,rm(w=t,(O=o).parentNode,S,k)&&Wp(w,C,k,O)||C.merge_with_parents&&w.dom.getParent(O.parentNode,(function(t){if(rm(w,t,S,k))return Wp(w,C,k,O),!0})),v=r,y=n,x=o,(b=s).styles&&b.styles.backgroundColor&&Bp(x,Np(v,"fontSize"),Dp(v,"backgroundColor",Hf(b.styles.backgroundColor,y))),d=r,p=o,h=function(t){var e;1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType&&(e=Wf(d,t.parentNode),d.getStyle(t,"color")&&e?d.setStyle(t,"text-decoration",e):d.getStyle(t,"text-decoration")===e&&d.setStyle(t,"text-decoration",null))},(g=s).styles&&(g.styles.color||g.styles.textDecoration)&&(ke.walk(p,h,"childNodes"),h(p)),u=r,l=o,"sub"!==(f=s).inline&&"sup"!==f.inline||(Bp(l,Np(u,"fontSize"),Dp(u,"fontSize","")),u.remove(u.select("sup"===f.inline?"sub":"sup",l),!0)),Ap(r,s,0,o)):r.remove(o,!0)}))};if("false"!==l.getContentEditable(d.getNode()))s&&(r?Mf(r)?g(c,r)||((o=l.createRng()).setStartBefore(r),o.setEndAfter(r),p(l,fl(t,o,c),0,!0)):p(l,r,0,!0):f&&Yf(s)&&!pl(t).length?function(t,e,n){var r,o=t.selection,i=o.getRng(),u=i.startOffset,a=i.startContainer.nodeValue,c=Cf(t.getBody(),o.getStart());c&&(r=gp(c));var s,f,l,d,m=/[^\s\u00a0\u00ad\u200b\ufeff]/;a&&0<u&&u<a.length&&m.test(a.charAt(u))&&m.test(a.charAt(u-1))?(s=o.getBookmark(),i.collapse(!0),f=fl(t,i,t.formatter.get(e)),f=Gl(f),t.formatter.apply(e,n,f),o.moveToBookmark(s)):(c&&r.nodeValue===lp||(l=t.getDoc(),d=pp(!0).dom,r=(c=l.importNode(d,!0)).firstChild,i.insertNode(c),u=1),t.formatter.apply(e,n,c),o.setCursorLocation(r,u))}(t,e,n):(i=d.getNode(),u=c[0],t.settings.forced_root_block||!u.defaultBlock||l.getParent(i,l.isBlock)||Yp(t,u.defaultBlock),d.setRng(Qg(d.getRng())),Cl(d,!0,(function(e){wl(t,(function(e,n){var r=n?e:fl(t,e,c);p(l,r)}))})),If(l,d,d.getRng()),t.nodeChanged()),a=t,kp(Cp[e],(function(t){t(a)})));else{r=d.getNode();for(var h=0,v=c.length;h<v;h++){var b=c[h];if(b.ceFalseOverride&&Xf(b)&&l.is(r,b.selector))return void m(r,b)}}},Kp=function(t,e,n,r){return dt(t,(function(t,o){return!!pt(e,o)||(W(t,(function(t){t(!1,{node:n,format:o,parents:r})})),!1)})).t},Jp=function(t,e,n,r,o){var i,u,a,c,s,f,l,d;return null===e.get()&&(u=t,a=ya({}),(i=e).set({}),u.on("NodeChange",(function(t){!function(t,e,n,r){var o=it(n.get()),i={},u={},a=G(qf(t.dom,e),(function(t){return 1===t.nodeType&&!t.getAttribute("data-mce-bogus")}));at(r,(function(e,n){ke.each(a,(function(r){return t.formatter.matchNode(r,n,{},e.similar)?(-1===o.indexOf(n)&&(W(e.callbacks,(function(t){t(!0,{node:r,format:n,parents:a})})),i[n]=e.callbacks),u[n]=e.callbacks,!1):!Zd(t,r,n)&&void 0}))}));var c=Kp(n.get(),u,e,a);n.set(Ot(Ot({},i),c))}(u,t.element,a,i.get())}))),s=n,f=r,l=o,d=(c=e).get(),W(s.split(","),(function(t){d[t]||(d[t]={similar:l,callbacks:[]}),d[t].callbacks.push(f)})),c.set(d),{unbind:function(){return o=n,i=r,u=(t=e).get(),W(o.split(","),(function(t){u[t].callbacks=G(u[t].callbacks,(function(t){return t!==i})),0===u[t].callbacks.length&&delete u[t]})),void t.set(u);var t,o,i,u}}},Qp=function(t,e){var n=(e||document).createDocumentFragment();return W(t,(function(t){n.appendChild(t.dom)})),Ae(n)},Zp=function(t,e,n){return{element:t,width:e,rows:n}},th=function(t,e){return{element:t,cells:e}},eh=function(t,e){var n=parseInt(Yn(t,e),10);return isNaN(n)?1:n},nh=function(t){return X(t,(function(t,e){return e.cells.length>t?e.cells.length:t}),0)},rh=function(t,e){for(var n=t.rows,r=0;r<n.length;r++)for(var o=n[r].cells,i=0;i<o.length;i++)if(Re(o[i],e))return S.some({x:i,y:r});return S.none()},oh=function(t,e,n,r,o){for(var i=[],u=t.rows,a=n;a<=o;a++){var c=u[a].cells,s=e<r?c.slice(e,r+1):c.slice(r,e+1);i.push(th(u[a].element,s))}return i},ih=function(t){return n=U((e=t).rows,(function(t){var e=U(t.cells,(function(t){var e=qa(t);return Jn(e,"colspan"),Jn(e,"rowspan"),e})),n=Wa(t.element);return ln(n,e),n})),r=Wa(e.element),o=Ee("tbody"),ln(o,n),fn(r,o),r;var e,n,r,o},uh=function(t,e){return Y(t,(function(t){return"li"===Ie(t)&&bl(t,e)})).fold(s([]),(function(e){return Y(t,(function(t){return"ul"===Ie(t)||"ol"===Ie(t)})).map((function(t){var e=Ee(Ie(t));return function(t,e){var n=t.dom;at(e,(function(t,e){!function(t,e,n){if(!E(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);qn(t)&&t.style.setProperty(e,n)}(n,e,t)}))}(e,mt(er(t),(function(t,e){return Vt(e,"list-style")}))),[Ee("li"),e]})).getOr([])}))},ah=function(){return Qp([])},ch=function(t,e){return n=Ae(e.cloneContents()),r=function(t,e){var n,r=Ae(e.commonAncestorContainer),o=Um(r,t),i=G(o,(function(t){return Xr(t)||Gr(t)})),u=uh(o,e),a=i.concat(u.length?u:Qr(n=r)?qe(n).filter(Jr).fold(s([]),(function(t){return[n,t]})):Jr(n)?[n]:[]);return U(a,Wa)}(t,e),o=X(r,(function(t,e){return fn(e,t),e}),n),0<r.length?Qp([o]):o;var n,r,o},sh=function(t,e){return n=t,r=e[0],Or(r,"table",l(Re,n)).bind((function(t){var n=e[0],r=e[e.length-1];return function(t,e,n){return rh(t,e).bind((function(e){return rh(t,n).map((function(n){return r=t,i=n,u=(o=e).x,a=o.y,c=i.x,f=a<(s=i.y)?oh(r,u,a,c,s):oh(r,u,s,c,a),Zp(r.element,nh(f),f);var r,o,i,u,a,c,s,f}))}))}(function(t){var e=Zp(Wa(t),0,[]);return W(Ma(t,"tr"),(function(t,n){W(Ma(t,"td,th"),(function(r,o){!function(t,e,n,r,o){for(var i=eh(o,"rowspan"),u=eh(o,"colspan"),a=t.rows,c=n;c<n+i;c++){a[c]||(a[c]=th(qa(r),[]));for(var s=e;s<e+u;s++)a[c].cells[s]=c===n&&s===e?o:Wa(o)}}(e,function(t,e,n){for(;r=e,o=n,((i=t.rows)[o]?i[o].cells:[])[r];)e++;var r,o,i;return e}(e,o,n),n,t,r)}))})),Zp(e.element,nh(e.rows),e.rows)}(t),n,r).map((function(t){return Qp([ih(t)])}))})).getOrThunk(ah);var n,r},fh=function(t,e){return 0<=e&&e<t.length&&Df(t.charAt(e))},lh=function(t,e){var n=io(t.innerText);return e?n.replace(/^[ \f\n\r\t\v]+/,""):n},dh=function(t,e,n){if(void 0===n&&(n={}),n.get=!0,n.format=e,n.selection=!0,(n=t.fire("BeforeGetContent",n)).isDefaultPrevented())return t.fire("GetContent",n),n.content;if("text"===n.format)return function(t){return S.from(t.selection.getRng()).map((function(e){var n=S.from(t.dom.getParent(e.commonAncestorContainer,t.dom.isBlock)),r=t.getBody(),o=n.map((function(t){return t.nodeName})).getOr("div").toLowerCase(),i=ye.browser.isIE()&&"pre"!==o,u=t.dom.add(r,o,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),a=lh(u,i),c=io(u.textContent);if(t.dom.remove(u),fh(c,0)||fh(c,c.length-1)){var s=n.getOr(r),f=lh(s,i),l=f.indexOf(a);return-1===l?a:(fh(f,l-1)?" ":"")+a+(fh(f,l+a.length)?" ":"")}return a})).getOr("")}(t);n.getInner=!0;var r,o,i,u,a,c,s,f=(o=n,i=(r=t).selection.getRng(),u=r.dom.create("body"),a=r.selection.getSel(),c=Yd(r,ml(a)),(s=o.contextual?function(t,e){var n,r,o=gl(e,t);return 0<o.length?sh(t,o):(n=t,0<(r=e).length&&r[0].collapsed?ah():ch(n,r[0]))}(Ae(r.getBody()),c).dom:i.cloneContents())&&u.appendChild(s),r.selection.serializer.serialize(u,o));return"tree"===n.format?f:(n.content=t.selection.isCollapsed()?"":f,t.fire("GetContent",n),n.content)},mh=function(t){return En(t)?t.outerHTML:In(t)?Qo.encodeRaw(t.data,!1):Pn(t)?"\x3c!--"+t.data+"--\x3e":""},gh=function(t,e){var n=0;W(t,(function(t){var r,o,i;0===t[0]?n++:1===t[0]?(function(t,e,n){var r,o=function(t){var e,n=document.createElement("div"),r=document.createDocumentFragment();for(t&&(n.innerHTML=t);e=n.firstChild;)r.appendChild(e);return r}(e);t.hasChildNodes()&&n<t.childNodes.length?(r=t.childNodes[n]).parentNode.insertBefore(o,r):t.appendChild(o)}(e,t[1],n),n++):2===t[0]&&(o=n,(r=e).hasChildNodes()&&o<r.childNodes.length&&(i=r.childNodes[o]).parentNode.removeChild(i))}))},ph=ya(S.none()),hh=function(t){var e,n=(e=t.getBody(),G(U(ot(e.childNodes),mh),(function(t){return 0<t.length}))),r=J(n,(function(e){var n=wm(t.serializer,e);return 0<n.length?[n]:[]})),o=r.join("");return-1!==o.indexOf("</iframe>")?{type:"fragmented",fragments:r,content:"",bookmark:null,beforeBookmark:null}:{type:"complete",fragments:null,content:o,bookmark:null,beforeBookmark:null}},vh=function(t,e,n){"fragmented"===e.type?function(t,e){var n,r,o,i,u,a,c,s,f,l=U(ot(e.childNodes),mh);gh((r=t,o=(n=l).length+r.length+2,i=new Array(o),u=new Array(o),a=function(t,e,o,i,u){var c=s(t,e,o,i);if(null===c||c.start===e&&c.diag===e-i||c.end===t&&c.diag===t-o)for(var f=t,l=o;f<e||l<i;)f<e&&l<i&&n[f]===r[l]?(u.push([0,n[f]]),++f,++l):i-o<e-t?(u.push([2,n[f]]),++f):(u.push([1,r[l]]),++l);else{a(t,c.start,o,c.start-c.diag,u);for(var d=c.start;d<c.end;++d)u.push([0,n[d]]);a(c.end,e,c.end-c.diag,i,u)}},c=function(t,e,o,i){for(var u=t;u-e<i&&u<o&&n[u]===r[u-e];)++u;return{start:t,end:u,diag:e}},s=function(t,e,o,a){var s=e-t,f=a-o;if(0==s||0==f)return null;var l,d,m,g,p,h=s-f,v=f+s,b=(v%2==0?v:1+v)/2;for(i[1+b]=t,u[1+b]=e+1,l=0;l<=b;++l){for(d=-l;d<=l;d+=2){for(m=d+b,d===-l||d!==l&&i[m-1]<i[m+1]?i[m]=i[m+1]:i[m]=i[m-1]+1,p=(g=i[m])-t+o-d;g<e&&p<a&&n[g]===r[p];)i[m]=++g,++p;if(h%2!=0&&h-l<=d&&d<=h+l&&u[m-h]<=i[m])return c(u[m-h],d+t-o,e,a)}for(d=h-l;d<=h+l;d+=2){for(m=d+b-h,d===h-l||d!==h+l&&u[m+1]<=u[m-1]?u[m]=u[m+1]-1:u[m]=u[m-1],p=(g=u[m]-1)-t+o-d;t<=g&&o<=p&&n[g]===r[p];)u[m]=g--,p--;if(h%2==0&&-l<=d&&d<=l&&u[m]<=i[m+h])return c(u[m],d+t-o,e,a)}}},f=[],a(0,n.length,0,r.length,f),f),e)}(e.fragments,t.getBody()):t.setContent(e.content,{format:"raw"}),t.selection.moveToBookmark(n?e.beforeBookmark:e.bookmark)},bh=function(t){return"fragmented"===t.type?t.fragments.join(""):t.content},yh=function(t){var e=Ee("body",ph.get().getOrThunk((function(){var t=document.implementation.createHTMLDocument("undo");return ph.set(S.some(t)),t})));return ja(e,bh(t)),W(Ma(e,"*[data-mce-bogus]"),gn),e.dom.innerHTML},xh=function(t,e){return!(!t||!e)&&(r=e,bh(t)===bh(r)||(n=e,yh(t)===yh(n)));var n,r},wh=function(t){return 0===t.get()},Ch=function(t,e,n){wh(n)&&(t.typing=e)},Sh=function(t,e){t.typing&&(Ch(t,!1,e),t.add())},kh=function(t){return t instanceof sm},Oh=function(t,e){ap(t.serializer.getNodeFilters(),t.serializer.getAttributeFilters(),e)},_h=function(t){return{undoManager:{beforeChange:function(e,n){return r=t,o=n,void(wh(e)&&o.set(S.some($c(r.selection))));var r,o},addUndoLevel:function(e,n,r,o,i,u){return function(t,e,n,r,o,i,u){var a=hh(t);if(i=i||{},i=ke.extend(i,a),!1===wh(r)||t.removed)return null;var c=e.data[n.get()];if(t.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:u}).isDefaultPrevented())return null;if(c&&xh(c,i))return null;e.data[n.get()]&&o.get().each((function(t){e.data[n.get()].beforeBookmark=t}));var s=t.getParam("custom_undo_redo_levels",0,"number");if(s&&e.data.length>s){for(var f=0;f<e.data.length-1;f++)e.data[f]=e.data[f+1];e.data.length--,n.set(e.data.length)}i.bookmark=$c(t.selection),n.get()<e.data.length-1&&(e.data.length=n.get()+1),e.data.push(i),n.set(e.data.length-1);var l={level:i,lastLevel:c,originalEvent:u};return 0<n.get()?(t.setDirty(!0),t.fire("AddUndo",l),t.fire("change",l)):t.fire("AddUndo",l),i}(t,e,n,r,o,i,u)},undo:function(e,n,r){return o=t,u=n,a=r,(i=e).typing&&(i.add(),i.typing=!1,Ch(i,!1,u)),0<a.get()&&(a.set(a.get()-1),c=i.data[a.get()],vh(o,c,!0),o.setDirty(!0),o.fire("Undo",{level:c})),c;var o,i,u,a,c},redo:function(e,n){return r=t,i=n,(o=e).get()<i.length-1&&(o.set(o.get()+1),u=i[o.get()],vh(r,u,!1),r.setDirty(!0),r.fire("Redo",{level:u})),u;var r,o,i,u},clear:function(e,n){return r=t,i=n,(o=e).data=[],i.set(0),o.typing=!1,void r.fire("ClearUndos");var r,o,i},reset:function(t){return(e=t).clear(),void e.add();var e},hasUndo:function(e,n){return r=t,o=e,0<n.get()||o.typing&&o.data[0]&&!xh(hh(r),o.data[0]);var r,o},hasRedo:function(t,e){return n=t,e.get()<n.data.length-1&&!n.typing;var n},transact:function(t,e,n){return o=n,Sh(r=t,e),r.beforeChange(),r.ignore(o),r.add();var r,o},ignore:function(t,e){try{t.set(t.get()+1),e()}finally{t.set(t.get()-1)}},extra:function(e,n,r,o){return i=t,a=n,c=r,s=o,void((u=e).transact(c)&&(f=u.data[a.get()].bookmark,l=u.data[a.get()-1],vh(i,l,!0),u.transact(s)&&(u.data[a.get()-1].beforeBookmark=f)));var i,u,a,c,s,f,l}},formatter:{match:function(e,n,r){return om(t,e,n,r)},matchAll:function(e,n){return o=e,i=n,u=[],a={},c=(r=t).selection.getStart(),r.dom.getParent(c,(function(t){for(var e=0;e<o.length;e++){var n=o[e];!a[n]&&rm(r,t,n,i)&&(a[n]=!0,u.push(n))}}),r.dom.getRoot()),u;var r,o,i,u,a,c},matchNode:function(e,n,r,o){return rm(t,e,n,r,o)},canApply:function(e){return function(t,e){var n,r,o,i,u,a=t.formatter.get(e),c=t.dom;if(a)for(n=t.selection.getStart(),r=qf(c,n),i=a.length-1;0<=i;i--){if(!(u=a[i].selector)||a[i].defaultBlock)return!0;for(o=r.length-1;0<=o;o--)if(c.is(r[o],u))return!0}return!1}(t,e)},closest:function(e){return function(t,e){var n=function(e){return Re(e,Ae(t.getBody()))};return S.from(t.selection.getStart(!0)).bind((function(r){return Jd(Ae(r),(function(n){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n]);if(r.isSome())return r}return S.none()}(e,(function(e){return r=e,rm(t,n.dom,r)?S.some(r):S.none();var r}))}),n)})).getOrNull()}(t,e)},apply:function(e,n,r){return Yp(t,e,n,r)},remove:function(e,n,r,o){return qp(t,e,n,r,o)},toggle:function(e,n,r){return i=e,u=n,a=r,c=(o=t).formatter.get(i),void(!om(o,i,u,a)||"toggle"in c[0]&&!c[0].toggle?Yp:qp)(o,i,u,a);var o,i,u,a,c},formatChanged:function(e,n,r,o){return Jp(t,e,n,r,o)}},editor:{getContent:function(e,n){return r=t,o=e,i=n,S.from(r.getBody()).fold(s("tree"===o.format?new sm("body",11):""),(function(t){return function(t,e,n,r){var o,i,u,a,c;return e.format=n,e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),o="raw"===e.format?ke.trim(Cm(t.serializer,r.innerHTML)):"text"===e.format?t.dom.isEmpty(r)?"":io(r.innerText||r.textContent):"tree"===e.format?t.serializer.serialize(r,e):(u=(i=t).serializer.serialize(r,e),a=Jc(i),c=new RegExp("^(<"+a+"[^>]*>(&nbsp;|&#160;|\\s| |<br \\/>|)<\\/"+a+">[\r\n]*|<br \\/>[\r\n]*)$"),u.replace(c,"")),z(["text","tree"],e.format)||eo(Ae(r))?e.content=o:e.content=ke.trim(o),e.no_events||t.fire("GetContent",e),e.content}(r,o,i,t)}));var r,o,i},setContent:function(e,n){return function(t,e,n){return n.format=n.format?n.format:"html",n.set=!0,n.content=cp(e)?"":e,n.no_events||t.fire("BeforeSetContent",n),cp(e)||(e=n.content),S.from(t.getBody()).fold(s(e),(function(r){return cp(e)?function(t,e,n,r){ap(t.parser.getNodeFilters(),t.parser.getAttributeFilters(),n);var o=mm({validate:t.validate},t.schema).serialize(n);return r.content=eo(Ae(e))?o:ke.trim(o),sp(t,r.content),r.no_events||t.fire("SetContent",r),n}(t,r,e,n):(o=t,i=r,a=n,0===(u=e).length||/^\s+$/.test(u)?(s='<br data-mce-bogus="1">',"TABLE"===i.nodeName?u="<tr><td>"+s+"</td></tr>":/^(UL|OL)$/.test(i.nodeName)&&(u="<li>"+s+"</li>"),u=(c=Jc(o))&&o.schema.isValidChild(i.nodeName.toLowerCase(),c.toLowerCase())?(u=s,o.dom.createHTML(c,Qc(o),u)):u||'<br data-mce-bogus="1">',sp(o,u),o.fire("SetContent",a)):("raw"!==a.format&&(u=mm({validate:o.validate},o.schema).serialize(o.parser.parse(u,{isRootContent:!0,insert:!0}))),a.content=eo(Ae(i))?u:ke.trim(u),sp(o,a.content),a.no_events||o.fire("SetContent",a)),a.content);var o,i,u,a,c,s}))}(t,e,n)},insertContent:function(e,n){return ip(t,e,n)},addVisual:function(e){return r=e,o=(n=t).dom,i=M(r)?r:n.getBody(),D(n.hasVisual)&&(n.hasVisual=n.getParam("visual",!0,"boolean")),W(o.select("table,a",i),(function(t){switch(t.nodeName){case"TABLE":var e=n.getParam("visual_table_class","mce-item-table","string"),r=o.getAttrib(t,"border");r&&"0"!==r||!n.hasVisual?o.removeClass(t,e):o.addClass(t,e);break;case"A":var i,u;o.getAttrib(t,"href")||(i=o.getAttrib(t,"name")||t.id,u=n.getParam("visual_anchor_class","mce-item-anchor","string"),i&&n.hasVisual?o.addClass(t,u):o.removeClass(t,u))}})),void n.fire("VisualAid",{element:r,hasVisual:n.hasVisual});var n,r,o,i}},selection:{getContent:function(e,n){return dh(t,e,n)}},raw:{getModel:function(){return S.none()}}}},Eh=function(t,e){var n=function(t){return T(t)?t:{}},r=h("Unimplemented feature for rtc");return{undoManager:{beforeChange:a,addUndoLevel:r,undo:function(){return e.undo(),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},redo:function(){return e.redo(),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},clear:r,reset:r,hasUndo:function(){return e.hasUndo()},hasRedo:function(){return e.hasRedo()},transact:function(t,n,r){return e.transact(r),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},ignore:r,extra:r},formatter:{match:function(t,r,o){return e.matchFormat(t,n(r))},matchAll:r,matchNode:r,canApply:function(t){return e.canApplyFormat(t)},closest:function(t){return e.closestFormat(t)},apply:function(t,r,o){return e.applyFormat(t,n(r))},remove:function(t,r,o,i){return e.removeFormat(t,n(r))},toggle:function(t,r,o){return e.toggleFormat(t,n(r))},formatChanged:function(t,n,r,o){return e.formatChanged(n,r,o)}},editor:{getContent:function(n,r){if("html"!==r&&"tree"!==r)return _h(t).editor.getContent(n,r);var o=e.getContent(),i=mm({inner:!0});return Oh(t,o),"tree"===r?o:i.serialize(o)},setContent:function(n,r){var o=kh(n)?n:t.parser.parse(n,{isRootContent:!0,insert:!0});return e.setContent(o),n},insertContent:function(n,r){var o,i=(o=t,S.from(o.selection.getStart(!0)).map((function(t){return t.nodeName.toLowerCase()})).fold((function(){return{}}),(function(t){return{context:t}}))),u=kh(n)?n:t.parser.parse(n,Ot(Ot({},i),{insert:!0}));e.insertContent(u)},addVisual:function(t){}},selection:{getContent:function(n,r){if("html"!==n&&"tree"!==n)return _h(t).selection.getContent(n,r);var o=e.getSelectedContent(),i=mm({});return Oh(t,o),"tree"===n?o:i.serialize(o)}},raw:{getModel:function(){return S.some(e.getRawModel())}}}},Th=function(t){return pt(t.plugins,"rtc")},Ah=function(t){return t.rtcInstance?t.rtcInstance:_h(t)},Bh=function(t){var e=t.rtcInstance;if(e)return e;throw new Error("Failed to get RTC instance not yet initialized.")},Nh=function(t){return 0===t.dom.length?(mn(t),S.none()):S.some(t)},Dh=function(t,e,n,r){t.bind((function(t){return(r?bg:vg)(t.dom,r?t.dom.length:0),e.filter(Ve).map((function(e){return o=e,i=n,u=r,a=t.dom,c=o.dom,s=u?a.length:c.length,void(u?(yg(a,c,!1,!u),i.setStart(c,s)):(yg(c,a,!1,!u),i.setEnd(c,s)));var o,i,u,a,c,s}))})).orThunk((function(){var t;return(t=r,e.filter((function(t){return Bl.isBookmarkNode(t.dom)})).bind(t?$e:Ge).or(e).filter(Ve)).map((function(t){return n=r,void qe(e=t).each((function(t){var r=e.dom;n&&sg(t,_c(r,0))?vg(r,0):!n&&fg(t,_c(r,r.length))&&bg(r,r.length)}));var e,n}))}))},Rh=function(t,e,n){var r;t&&t.hasOwnProperty(e)&&(0===(r=G(t[e],(function(t){return t!==n}))).length?delete t[e]:t[e]=r)},Mh=function(t){return!!t.select},Ih=function(t){return!(!t||!t.ownerDocument)&&Me(Ae(t.ownerDocument),Ae(t))},Ph=function(t,e,n,r){var o,i,u,a,c,s,f=function(t,e){return c||(c={},s={},a.on("NodeChange",(function(t){var e=t.element,n=u.getParents(e,null,u.getRoot()),r={};ke.each(c,(function(t,e){ke.each(n,(function(o){if(u.is(o,e))return s[e]||(ke.each(t,(function(t){t(!0,{node:o,selector:e,parents:n})})),s[e]=t),r[e]=t,!1}))})),ke.each(s,(function(t,o){r[o]||(delete s[o],ke.each(t,(function(t){t(!1,{node:e,selector:o,parents:n})})))}))}))),c[t]||(c[t]=[]),c[t].push(e),{unbind:function(){Rh(c,t,e),Rh(s,t,e)}}},l=function(t,e){return function(t,e,n){void 0===n&&(n={});var r,o,i=(r=e,Ot(Ot({format:"html"},n),{set:!0,selection:!0,content:r}));i.no_events||!(i=t.fire("BeforeSetContent",i)).isDefaultPrevented()?(n.content=function(t,e){if("raw"===e.format)return e.content;var n=t.selection.getRng(),r=t.dom.getParent(n.commonAncestorContainer,t.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=t.parser.parse(e.content,Ot(Ot({isRootContent:!0,forced_root_block:!1},o),e));return mm({validate:t.validate},t.schema).serialize(i)}(t,i),function(t,e){var n=S.from(e.firstChild).map(Ae),r=S.from(e.lastChild).map(Ae);t.deleteContents(),t.insertNode(e);var o=n.bind(Ge).filter(Ve).bind(Nh),i=r.bind($e).filter(Ve).bind(Nh);Dh(o,n,t,!0),Dh(i,r,t,!1),t.collapse(!1)}(o=t.selection.getRng(),o.createContextualFragment(n.content)),t.selection.setRng(o),bd(t,o),i.no_events||t.fire("SetContent",i)):t.fire("SetContent",i)}(r,t,e)},d=function(t){var e=g();e.collapse(!!t),p(e)},m=function(){return e.getSelection?e.getSelection():e.document.selection},g=function(){var n,u,a,c=function(t,e,n){try{return e.compareBoundaryPoints(t,n)}catch(t){return-1}};if(!e)return null;var s=e.document;if(null==s)return null;if(void 0!==r.bookmark&&!1===jd(r)){var f=Rd(r);if(f.isSome())return f.map((function(t){return Yd(r,[t])[0]})).getOr(s.createRange())}try{(n=m())&&!_n(n.anchorNode)&&(u=0<n.rangeCount?n.getRangeAt(0):n.createRange?n.createRange():s.createRange(),u=Yd(r,[u])[0])}catch(t){}return(u=u||(s.createRange?s.createRange():s.body.createTextRange())).setStart&&9===u.startContainer.nodeType&&u.collapsed&&(a=t.getRoot(),u.setStart(a,0),u.setEnd(a,0)),o&&i&&(0===c(u.START_TO_START,u,o)&&0===c(u.END_TO_END,u,o)?u=i:i=o=null),u},p=function(t,e){var n;if((u=t)&&(Mh(u)||Ih(u.startContainer)&&Ih(u.endContainer))){var u,a=Mh(t)?t:null;if(a){i=null;try{a.select()}catch(t){}}else{var c=m();if(t=r.fire("SetSelectionRange",{range:t,forward:e}).range,c){i=t;try{c.removeAllRanges(),c.addRange(t)}catch(t){}!1===e&&c.extend&&(c.collapse(t.endContainer,t.endOffset),c.extend(t.startContainer,t.startOffset)),o=0<c.rangeCount?c.getRangeAt(0):null}t.collapsed||t.startContainer!==t.endContainer||!c.setBaseAndExtent||ye.ie||t.endOffset-t.startOffset<2&&t.startContainer.hasChildNodes()&&(n=t.startContainer.childNodes[t.startOffset])&&"IMG"===n.tagName&&(c.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset),c.anchorNode===t.startContainer&&c.focusNode===t.endContainer||c.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:t,forward:e})}}},h=function(){var e=m(),n=null==e?void 0:e.anchorNode,r=null==e?void 0:e.focusNode;if(!e||!n||!r||_n(n)||_n(r))return!0;var o=t.createRng();o.setStart(n,e.anchorOffset),o.collapse(!0);var i=t.createRng();return i.setStart(r,e.focusOffset),i.collapse(!0),o.compareBoundaryPoints(o.START_TO_START,i)<=0},v={bookmarkManager:null,controlSelection:null,dom:u=t,win:e,serializer:n,editor:a=r,collapse:d,setCursorLocation:function(e,n){var o=t.createRng();e?(o.setStart(e,n),o.setEnd(e,n),p(o),d(!1)):(yl(t,o,r.getBody(),!0),p(o))},getContent:function(t){return function(t,e){var n,r;return void 0===e&&(e={}),n=e.format?e.format:"html",r=e,Bh(t).selection.getContent(n,r)}(r,t)},setContent:l,getBookmark:function(t,e){return b.getBookmark(t,e)},moveToBookmark:function(t){return b.moveToBookmark(t)},select:function(e,n){var r,o,i;return r=t,o=e,i=n,S.from(o).map((function(t){var e=r.nodeIndex(t),n=r.createRng();return n.setStart(t.parentNode,e),n.setEnd(t.parentNode,e+1),i&&(yl(r,n,t,!0),yl(r,n,t,!1)),n})).each(p),e},isCollapsed:function(){var t=g(),e=m();return!(!t||t.item)&&(t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!e||t.collapsed)},isForward:h,setNode:function(e){return l(t.getOuterHTML(e)),e},getNode:function(){return function(t,e){var n,r;if(!e)return t;n=e.startContainer,r=e.endContainer;var o=e.startOffset,i=e.endOffset,u=e.commonAncestorContainer;return!e.collapsed&&(n===r&&i-o<2&&n.hasChildNodes()&&(u=n.childNodes[o]),3===n.nodeType&&3===r.nodeType&&(n=n.length===o?Xd(n.nextSibling,!0):n.parentNode,r=0===i?Xd(r.previousSibling,!1):r.parentNode,n&&n===r))?n:u&&3===u.nodeType?u.parentNode:u}(r.getBody(),g())},getSel:m,setRng:p,getRng:g,getStart:function(t){return Gd(r.getBody(),g(),t)},getEnd:function(t){return $d(r.getBody(),g(),t)},getSelectedBlocks:function(e,n){return function(t,e,n,r){var o,i=[],u=t.getRoot();if(n=t.getParent(n||Gd(u,e,e.collapsed),t.isBlock),r=t.getParent(r||$d(u,e,e.collapsed),t.isBlock),n&&n!==u&&i.push(n),n&&r&&n!==r)for(var a=new Ur(o=n,u);(o=a.next())&&o!==r;)t.isBlock(o)&&i.push(o);return r&&n!==r&&r!==u&&i.push(r),i}(t,g(),e,n)},normalize:function(){var e=g(),n=m();if(1<ml(n).length||!xl(r))return e;var o=Wl(t,e);return o.each((function(t){p(t,h())})),o.getOr(e)},selectorChanged:function(t,e){return f(t,e),v},selectorChangedWithUnbind:f,getScrollContainer:function(){for(var e,n=t.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){e=n;break}n=n.parentNode}return e},scrollIntoView:function(t,e){return o=t,i=e,void((n=r).inline?pd:vd)(n,o,i);var n,o,i},placeCaretAt:function(t,e){return p(Fl(t,e,r.getDoc()))},getBoundingClientRect:function(){var t=g();return t.collapsed?_c.fromRangeStart(t).getClientRects()[0]:t.getBoundingClientRect()},destroy:function(){e=o=i=null,y.destroy()}},b=Bl(v),y=Il(v,r);return v.bookmarkManager=b,v.controlSelection=y,v},Fh=function(t,e){var n,r=fi();e.convert_fonts_to_spans&&function(t,e,n){t.addNodeFilter("font",(function(t){W(t,(function(t){var r,o=e.parse(t.attr("style")),i=t.attr("color"),u=t.attr("face"),a=t.attr("size");i&&(o.color=i),u&&(o["font-family"]=u),a&&(o["font-size"]=n[parseInt(t.attr("size"),10)-1]),t.name="span",t.attr("style",e.serialize(o)),r=t,W(["color","face","size"],(function(t){r.attr(t,null)}))}))}))}(t,r,ke.explode(e.font_size_legacy_values)),n=r,t.addNodeFilter("strike",(function(t){W(t,(function(t){var e=n.parse(t.attr("style"));e["text-decoration"]="line-through",t.name="span",t.attr("style",n.serialize(e))}))}))},Lh=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},Vh=function(t,e){var n;try{n=atob(e)}catch(t){return S.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return S.some(new Blob([r],{type:t}))},Hh=function(t){return 0===t.indexOf("blob:")?(e=t,new Tr((function(t,n){var r=function(){n("Cannot convert "+e+" to Blob. Resource might not exist or is inaccessible.")};try{var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="blob",o.onload=function(){200===this.status?t(this.response):r()},o.onerror=r,o.send()}catch(t){r()}}))):0===t.indexOf("data:")?(n=t,new Tr((function(t){var e=Lh(n),r=e.type,o=e.data;Vh(r,o).fold((function(){return t(new Blob([]))}),t)}))):null;var e,n},zh=0,jh=function(t){return(t||"blobid")+zh++};function Uh(t,e){var n={};return{findAll:function(r,o){o=o||y;var i,u=G((i=r)?ot(i.getElementsByTagName("img")):[],(function(e){var n=e.src;return!!ye.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&!(!n||n===ye.transparentSrc)&&(0===n.indexOf("blob:")?!t.isUploaded(n)&&o(e):0===n.indexOf("data:")&&o(e))})),a=U(u,(function(t){if(void 0!==n[t.src])return new Tr((function(e){n[t.src].then((function(n){return"string"==typeof n?n:void e({image:t,blobInfo:n.blobInfo})}))}));var r=new Tr((function(n,r){!function(t,e,n,r){var o,i,u,a,c;0!==e.src.indexOf("blob:")?(i=(o=Lh(e.src)).data,u=o.type,a=i,(c=t.getByData(a,u))?n({image:e,blobInfo:c}):Hh(e.src).then((function(r){c=t.create(jh(),r,a),t.add(c),n({image:e,blobInfo:c})}),(function(t){r(t)}))):(c=t.getByUri(e.src))?n({image:e,blobInfo:c}):Hh(e.src).then((function(r){var o;o=r,new Tr((function(t){var e=new FileReader;e.onloadend=function(){t(e.result)},e.readAsDataURL(o)})).then((function(o){a=Lh(o).data,c=t.create(jh(),r,a),t.add(c),n({image:e,blobInfo:c})}))}),(function(t){r(t)}))}(e,t,n,r)})).then((function(t){return delete n[t.image.src],t})).catch((function(e){return delete n[t.src],e}));return n[t.src]=r}));return Tr.all(a)}}}var Wh,qh,Gh=function(t,e,n,r){(t.padd_empty_with_br||e.insert)&&n[r.name]?r.empty().append(new sm("br",1)).shortEnded=!0:r.empty().append(new sm("#text",3)).value=no},$h=function(t,e){return t&&t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.name===e},Xh=function(t,e,n,r){return r.isEmpty(e,n,(function(e){return n=e,(r=t.getElementRule(n.name))&&r.paddEmpty;var n,r}))},Yh=function(t,e){var n=t.schema;e.remove_trailing_brs&&t.addNodeFilter("br",(function(t,r,o){var i,u,a,c,s,f,l,d,m=t.length,g=ke.extend({},n.getBlockElements()),p=n.getNonEmptyElements(),h=n.getWhiteSpaceElements();for(g.body=1,i=0;i<m;i++)if(a=(u=t[i]).parent,g[u.parent.name]&&u===a.lastChild){for(s=u.prev;s;){if("span"!==(f=s.name)||"bookmark"!==s.attr("data-mce-type")){"br"===f&&(u=null);break}s=s.prev}u&&(u.remove(),Xh(n,p,h,a)&&(l=n.getElementRule(a.name))&&(l.removeEmpty?a.remove():l.paddEmpty&&Gh(e,o,g,a)))}else{for(c=u;a&&a.firstChild===c&&a.lastChild===c&&!g[(c=a).name];)a=a.parent;c===a&&!0!==e.padd_empty_with_br&&((d=new sm("#text",3)).value=no,u.replace(d))}})),t.addAttributeFilter("href",(function(t){var n,r,o=t.length;if(!e.allow_unsafe_link_target)for(;o--;){var i=t[o];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",(r=(n=i.attr("rel"))?ke.trim(n):"",/\b(noopener)\b/g.test(r)?r:r.split(" ").filter((function(t){return 0<t.length})).concat(["noopener"]).sort().join(" ")))}})),e.allow_html_in_named_anchor||t.addAttributeFilter("id,name",(function(t){for(var e,n,r,o,i=t.length;i--;)if("a"===(o=t[i]).name&&o.firstChild&&!o.attr("href"))for(r=o.parent,e=o.lastChild;n=e.prev,r.insert(e,o),e=n;);})),e.fix_list_elements&&t.addNodeFilter("ul,ol",(function(t){for(var e,n,r,o=t.length;o--;)"ul"!==(r=(n=t[o]).parent).name&&"ol"!==r.name||(n.prev&&"li"===n.prev.name?n.prev.append(n):((e=new sm("li",1)).attr("style","list-style-type: none"),n.wrap(e)))})),e.validate&&n.getValidClasses()&&t.addAttributeFilter("class",(function(t){for(var e,r,o,i,u,a,c,s=t.length,f=n.getValidClasses();s--;){for(r=(e=t[s]).attr("class").split(" "),u="",o=0;o<r.length;o++)i=r[o],c=!1,(a=f["*"])&&a[i]&&(c=!0),a=f[e.name],!c&&a&&a[i]&&(c=!0),c&&(u&&(u+=" "),u+=i);u.length||(u=null),e.attr("class",u)}})),function(t,e){var n=e.blob_cache,r=function(t){var r,o,i=t.attr("src");(r=t).attr("src")===ye.transparentSrc||r.attr("data-mce-placeholder")||t.attr("data-mce-bogus")||((o=/data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(i))?S.some({type:o[1],data:decodeURIComponent(o[2])}):S.none()).filter((function(){return function(t,e){if(e.images_dataimg_filter){var n=new Image;return n.src=t.attr("src"),at(t.attributes.map,(function(t,e){n.setAttribute(e,t)})),e.images_dataimg_filter(n)}return!0}(t,e)})).bind((function(t){var e=t.type,r=t.data;return S.from(n.getByData(r,e)).orThunk((function(){return Vh(e,r).map((function(t){var e=n.create(jh(),t,r);return n.add(e),e}))}))})).each((function(e){t.attr("src",e.blobUri())}))};n&&t.addAttributeFilter("src",(function(t){return W(t,r)}))}(t,e)},Kh=ke.makeMap,Jh=ke.each,Qh=ke.explode,Zh=ke.extend,tv=function(t,e){void 0===e&&(e=ci());var n={},r=[],o={},i={};(t=t||{}).validate=!("validate"in t)||t.validate,t.root_name=t.root_name||"body";var u,a,c=function(t){var e,u,a=t.name;a in n&&((u=o[a])?u.push(t):o[a]=[t]),e=r.length;for(;e--;)(a=r[e].name)in t.attributes.map&&((u=i[a])?u.push(t):i[a]=[t]);return t},s={schema:e,addAttributeFilter:function(t,e){Jh(Qh(t),(function(t){for(var n=0;n<r.length;n++)if(r[n].name===t)return void r[n].callbacks.push(e);r.push({name:t,callbacks:[e]})}))},getAttributeFilters:function(){return[].concat(r)},addNodeFilter:function(t,e){Jh(Qh(t),(function(t){var r=n[t];r||(n[t]=r=[]),r.push(e)}))},getNodeFilters:function(){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push({name:e,callbacks:n[e]});return t},filterNode:c,parse:function(u,a){var s,f,l,d,m,g,p,h,v=[];a=a||{},o={},i={};var b,y=Zh(Kh("script,style,head,html,body,title,meta,param"),e.getBlockElements()),x=e.getNonEmptyElements(),w=e.children,C=t.validate,S=!1===(b="forced_root_block"in a?a.forced_root_block:t.forced_root_block)?"":!0===b?"p":b,k=e.getWhiteSpaceElements(),O=/^[ \t\r\n]+/,_=/[ \t\r\n]+$/,E=/[ \t\r\n]+/g,T=/^[ \t\r\n]+$/,A=k.hasOwnProperty(a.context)||k.hasOwnProperty(t.root_name),B=function(t,e){var r,i=new sm(t,e);return t in n&&((r=o[t])?r.push(i):o[t]=[i]),i},N=function(t){for(var n,r,o,i=e.getBlockElements(),u=t.prev;u&&3===u.type;){if(0<(r=u.value.replace(_,"")).length)return void(u.value=r);if(n=u.next){if(3===n.type&&n.value.length){u=u.prev;continue}if(!i[n.name]&&"script"!==n.name&&"style"!==n.name){u=u.prev;continue}}o=u.prev,u.remove(),u=o}},D=xm({validate:C,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_script_urls:t.allow_script_urls,allow_conditional_comments:t.allow_conditional_comments,preserve_cdata:t.preserve_cdata,self_closing_elements:function(t){var e,n={};for(e in t)"li"!==e&&"p"!==e&&(n[e]=t[e]);return n}(e.getSelfClosingElements()),cdata:function(t){h.append(B("#cdata",4)).value=t},text:function(t,e){var n,r;A||(t=t.replace(E," "),(r=h.lastChild)&&(y[r.name]||"br"===r.name)&&(t=t.replace(O,""))),0!==t.length&&((n=B("#text",3)).raw=!!e,h.append(n).value=t)},comment:function(t){h.append(B("#comment",8)).value=t},pi:function(t,e){h.append(B(t,7)).value=e,N(h)},doctype:function(t){h.append(B("#doctype",10)).value=t,N(h)},start:function(t,n,o){var u,a,c,s,f=C?e.getElementRule(t):{};if(f){for((u=B(f.outputName||t,1)).attributes=n,u.shortEnded=o,h.append(u),(s=w[h.name])&&w[u.name]&&!s[u.name]&&v.push(u),a=r.length;a--;)(c=r[a].name)in n.map&&((g=i[c])?g.push(u):i[c]=[u]);y[t]&&N(u),o||(h=u),!A&&k[t]&&(A=!0)}},end:function(n){var r,o,i,u,c,s=C?e.getElementRule(n):{};if(s){if(y[n]&&!A){if((r=h.firstChild)&&3===r.type)if(0<(o=r.value.replace(O,"")).length)r.value=o,r=r.next;else for(i=r.next,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.next,0!==o.length&&!T.test(o)||(r.remove(),r=i),r=i;if((r=h.lastChild)&&3===r.type)if(0<(o=r.value.replace(_,"")).length)r.value=o,r=r.prev;else for(i=r.prev,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.prev,0!==o.length&&!T.test(o)||(r.remove(),r=i),r=i}if(A&&k[n]&&(A=!1),s.removeEmpty&&Xh(e,x,k,h))return u=h.parent,y[h.name]?h.empty().remove():h.unwrap(),void(h=u);s.paddEmpty&&($h(c=h,"#text")&&c.firstChild.value===no||Xh(e,x,k,h))&&Gh(t,a,y,h),h=h.parent}}},e),R=h=new sm(a.context||t.root_name,11);if(D.parse(u,a.format),C&&v.length&&(a.context?a.invalid=!0:function(t){for(var n,r,o,i,u,a,s,f,l,d,m=Kh("tr,td,th,tbody,thead,tfoot,table"),g=e.getNonEmptyElements(),p=e.getWhiteSpaceElements(),h=e.getTextBlockElements(),v=e.getSpecialElements(),b=0;b<t.length;b++)if((n=t[b]).parent&&!n.fixed)if(h[n.name]&&"li"===n.parent.name){for(l=n.next;l&&h[l.name];)l.name="li",l.fixed=!0,n.parent.insert(l,n.parent),l=l.next;n.unwrap(n)}else{for(o=[n],r=n.parent;r&&!e.isValidChild(r.name,n.name)&&!m[r.name];r=r.parent)o.push(r);if(r&&1<o.length){for(o.reverse(),i=u=c(o[0].clone()),f=0;f<o.length-1;f++){for(e.isValidChild(u.name,o[f].name)?(a=c(o[f].clone()),u.append(a)):a=u,s=o[f].firstChild;s&&s!==o[f+1];)d=s.next,a.append(s),s=d;u=a}Xh(e,g,p,i)?r.insert(n,o[0],!0):(r.insert(i,o[0],!0),r.insert(n,i)),r=o[0],(Xh(e,g,p,r)||$h(r,"br"))&&r.empty().remove()}else if(n.parent){if("li"===n.name){if((l=n.prev)&&("ul"===l.name||"ol"===l.name)){l.append(n);continue}if((l=n.next)&&("ul"===l.name||"ol"===l.name)){l.insert(n,l.firstChild,!0);continue}n.wrap(c(new sm("ul",1)));continue}e.isValidChild(n.parent.name,"div")&&e.isValidChild("div",n.name)?n.wrap(c(new sm("div",1))):v[n.name]?n.empty().remove():n.unwrap()}}}(v)),S&&("body"===R.name||a.isRootContent)&&function(){var n,r,o=R.firstChild,i=function(t){t&&((o=t.firstChild)&&3===o.type&&(o.value=o.value.replace(O,"")),(o=t.lastChild)&&3===o.type&&(o.value=o.value.replace(_,"")))};if(e.isValidChild(R.name,S.toLowerCase())){for(;o;)n=o.next,3===o.type||1===o.type&&"p"!==o.name&&!y[o.name]&&!o.attr("data-mce-type")?(r||((r=B(S,1)).attr(t.forced_root_block_attrs),R.insert(r,o)),r.append(o)):(i(r),r=null),o=n;i(r)}}(),!a.invalid){for(p in o)if(o.hasOwnProperty(p)){for(g=n[p],d=(s=o[p]).length;d--;)s[d].parent||s.splice(d,1);for(f=0,l=g.length;f<l;f++)g[f](s,p,a)}for(f=0,l=r.length;f<l;f++)if((g=r[f]).name in i){for(d=(s=i[g.name]).length;d--;)s[d].parent||s.splice(d,1);for(d=0,m=g.callbacks.length;d<m;d++)g.callbacks[d](s,g.name,a)}}return R}};return Yh(s,t),u=s,(a=t).inline_styles&&Fh(u,a),s},ev=function(t,e,n){-1===ke.inArray(e,n)&&(t.addAttributeFilter(n,(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)})),e.push(n))},nv=function(t,e){var n=["data-mce-selected"],r=e&&e.dom?e.dom:da.DOM,o=e&&e.schema?e.schema:ci(t);t.entity_encoding=t.entity_encoding||"named",t.remove_trailing_brs=!("remove_trailing_brs"in t)||t.remove_trailing_brs;var i,u,a,c=tv(t,o);return u=t,a=r,(i=c).addAttributeFilter("data-mce-tabindex",(function(t,e){for(var n,r=t.length;r--;)(n=t[r]).attr("tabindex",n.attr("data-mce-tabindex")),n.attr(e,null)})),i.addAttributeFilter("src,href,style",(function(t,e){for(var n,r,o=t.length,i="data-mce-"+e,c=u.url_converter,s=u.url_converter_scope;o--;)void 0!==(r=(n=t[o]).attr(i))?(n.attr(e,0<r.length?r:null),n.attr(i,null)):(r=n.attr(e),"style"===e?r=a.serializeStyle(a.parseStyle(r),n.name):c&&(r=c.call(s,r,e,n.name)),n.attr(e,0<r.length?r:null))})),i.addAttributeFilter("class",(function(t){for(var e,n,r=t.length;r--;)(n=(e=t[r]).attr("class"))&&(n=e.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),e.attr("class",0<n.length?n:null))})),i.addAttributeFilter("data-mce-type",(function(t,e,n){for(var r,o=t.length;o--;)"bookmark"!==(r=t[o]).attr("data-mce-type")||n.cleanup||(S.from(r.firstChild).exists((function(t){return!oo(t.value)}))?r.unwrap():r.remove())})),i.addNodeFilter("noscript",(function(t){for(var e,n=t.length;n--;)(e=t[n].firstChild)&&(e.value=Qo.decode(e.value))})),i.addNodeFilter("script,style",(function(t,e){for(var n,r,o,i=t.length,a=function(t){return t.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};i--;)r=(n=t[i]).firstChild?n.firstChild.value:"","script"===e?((o=n.attr("type"))&&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===u.element_format&&0<r.length&&(n.firstChild.value="// <![CDATA[\n"+a(r)+"\n// ]]>")):"xhtml"===u.element_format&&0<r.length&&(n.firstChild.value="\x3c!--\n"+a(r)+"\n--\x3e")})),i.addNodeFilter("#comment",(function(t){for(var e,n=t.length;n--;)e=t[n],u.preserve_cdata&&0===e.value.indexOf("[CDATA[")?(e.name="#cdata",e.type=4,e.value=a.decode(e.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===e.value.indexOf("mce:protected ")&&(e.name="#text",e.type=3,e.raw=!0,e.value=unescape(e.value).substr(14))})),i.addNodeFilter("xml:namespace,input",(function(t,e){for(var n,r=t.length;r--;)7===(n=t[r]).type?n.remove():1===n.type&&("input"!==e||n.attr("type")||n.attr("type","text"))})),i.addAttributeFilter("data-mce-type",(function(t){W(t,(function(t){"format-caret"===t.attr("data-mce-type")&&(t.isEmpty(i.schema.getNonEmptyElements())?t.remove():t.unwrap())}))})),i.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)})),{schema:o,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,serialize:function(n,i){void 0===i&&(i={});var u,a,s,f,l,d,m,g,p,h,v,b,y=Ot({format:"html"},i),x=function(t,e,n){return o=n,(r=t)&&r.hasEventListeners("PreProcess")&&!o.no_events?function(t,e,n){var r,o,i=t.dom;e=e.cloneNode(!0);var u,a,c=document.implementation;return c.createHTMLDocument&&(r=c.createHTMLDocument(""),ke.each("BODY"===e.nodeName?e.childNodes:[e],(function(t){r.body.appendChild(r.importNode(t,!0))})),e="BODY"!==e.nodeName?r.body.firstChild:r.body,o=i.doc,i.doc=r),u=t,a=Ot(Ot({},n),{node:e}),u.fire("PreProcess",a),o&&(i.doc=o),e}(t,e,n):e;var r,o}(e,n,y),w=(u=r,a=x,f=io((s=y).getInner?a.innerHTML:u.getOuterHTML(a)),s.selection||eo(Ae(a))?f:ke.trim(f)),C=(l=c,d=w,v=(m=y).selection?Ot({forced_root_block:!1},m):m,!(p=function(t){return t&&"br"===t.name})(h=(b=l.parse(d,v)).lastChild)||p(g=h.prev)&&(h.remove(),g.remove()),b);return"tree"===y.format?C:function(t,e,n,r,o){var i,u,a,c,s,f;return u=t,i=r,c=mm(e,n).serialize(i),(a=o).no_events||!u?c:(s=u,f=Ot(Ot({},a),{content:c}),s.fire("PostProcess",f).content)}(e,t,o,C,y)},addRules:function(t){o.addValidElements(t)},setRules:function(t){o.setValidElements(t)},addTempAttr:l(ev,c,n),getTempAttrs:function(){return n},getNodeFilters:c.getNodeFilters,getAttributeFilters:c.getAttributeFilters}},rv=function(t,e){var n=nv(t,e);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}},ov=function(t,e,n){return void 0===n&&(n={}),r=e,o=n,Ah(t).editor.setContent(r,o);var r,o},iv=da.DOM,uv=function(t){return S.from(t).each((function(t){return t.destroy()}))},av=Object.prototype.hasOwnProperty,cv=(Wh=function(t,e){return T(t)&&T(e)?cv(t,e):e},function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o=t[r];for(var i in o)av.call(o,i)&&(n[i]=Wh(n[i],o[i]))}return n}),sv=fe().deviceType,fv=sv.isTouch(),lv=sv.isPhone(),dv=sv.isTablet(),mv=["lists","autolink","autosave"],gv={table_grid:!1,object_resizing:!1,resize:!1},pv=function(t){var e=A(t)?t.join(" "):t,n=U(E(e)?e.split(" "):[],zt);return G(n,(function(t){return 0<t.length}))},hv=function(t,e){return t.sections().hasOwnProperty(e)},vv=function(t,e){return gt(t,"toolbar_mode").orThunk((function(){return gt(t,"toolbar_drawer").map((function(t){return!1===t?"wrap":t}))})).getOr(e)},bv=function(t,e,n,r){var o,i,u=pv(n.forced_plugins),a=pv(r.plugins),c=hv(o=e,"mobile")?o.sections().mobile:{},s=function(t,e,n,r){return t&&(u=i="mobile",a=(o=e).sections(),hv(o,i)&&a[i].theme===u)?G(r,l(z,mv)):t&&hv(e,"mobile")?r:n;var o,i,u,a}(t,e,a,c.plugins?pv(c.plugins):a),f=(i=s,[].concat(pv(u)).concat(pv(i)));if(ye.browser.isIE()&&z(f,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return ke.extend(r,{plugins:f.join(" ")})},yv=function(t,e,n,r,o){var i,u,a,c,f,l,d=t?{mobile:(i=o.mobile||{},u=e,a={resize:!1,toolbar_mode:vv(i,"scrolling"),toolbar_sticky:!1},Ot(Ot(Ot({},gv),a),u?{menubar:!1}:{}))}:{},m=function(t,e){var n,r,o=dt(e,(function(e,n){return z(t,n)}));return n=o.t,r=o.f,{sections:s(n),settings:s(r)}}(["mobile"],cv(d,o)),g=ke.extend(n,r,m.settings(),t&&hv(m,"mobile")?function(t,e,n){void 0===n&&(n={});var r=t.sections(),o=r.hasOwnProperty(e)?r[e]:{};return ke.extend({},n,o)}(m,"mobile"):{},{validate:!0,external_plugins:(c=r,f=m.settings(),l=f.external_plugins?f.external_plugins:{},c&&c.external_plugins?ke.extend({},c.external_plugins,l):l)});return bv(t,m,r,g)},xv=function(t,e,n){return S.from(e.settings[n]).filter(t)},wv=(qh={},{add:function(t,e){qh[t]=e},get:function(t){return qh[t]?qh[t]:{icons:{}}},has:function(t){return pt(qh,t)}}),Cv=function(t,e){return e.dom[t]},Sv=function(t,e){return parseInt(Qn(e,t),10)},kv=l(Cv,"clientWidth"),Ov=l(Cv,"clientHeight"),_v=l(Sv,"margin-top"),Ev=l(Sv,"margin-left"),Tv=function(t,e,n){var r,o,i,u,a,c,s,f,l,d,m=Ae(t.getBody()),g=t.inline?m:Ae(Ue(m).dom.documentElement),p=(r=t.inline,i=e,u=n,a=(o=g).dom.getBoundingClientRect(),{x:i-(r?a.left+o.dom.clientLeft+Ev(o):0),y:u-(r?a.top+o.dom.clientTop+_v(o):0)});return s=p.x,f=p.y,l=kv(c=g),d=Ov(c),0<=s&&0<=f&&s<=l&&f<=d};function Av(t){var e,n=[],r=function(){var e,n=t.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},o=function(){return S.from(n[0])},i=function(){0<n.length&&r().reposition(n)},u=function(t){K(n,(function(e){return e===t})).each((function(t){n.splice(t,1)}))},a=function(e,a){if(void 0===a&&(a=!0),!t.removed&&function(t){var e;return e=t.inline?t.getBody():t.getContentAreaContainer(),S.from(e).map(Ae).map(pn).getOr(!1)}(t))return a&&t.fire("BeforeOpenNotification",{notification:e}),Y(n,(function(t){return n=r().getArgs(t),o=e,!(n.type!==o.type||n.text!==o.text||n.progressBar||n.timeout||o.progressBar||o.timeout);var n,o})).getOrThunk((function(){t.editorManager.setActive(t);var a,c=r().open(e,(function(){u(c),i(),o().fold((function(){return t.focus()}),(function(t){return Ae(t.getEl()).dom.focus()}))}));return a=c,n.push(a),i(),t.fire("OpenNotification",Ot({},c)),c}))};return(e=t).on("SkinLoaded",(function(){var t=e.getParam("service_message");t&&a({text:t,type:"warning",timeout:0},!1)})),e.on("ResizeEditor ResizeWindow NodeChange",(function(){Vr.requestAnimationFrame(i)})),e.on("remove",(function(){W(n.slice(),(function(t){r().close(t)}))})),{open:a,close:function(){o().each((function(t){r().close(t),u(t),i()}))},getNotifications:function(){return n}}}var Bv=_a.PluginManager,Nv=_a.ThemeManager,Dv=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},openUrl:e,alert:e,confirm:e,close:e,getParams:e,setParams:e}},r=function(t,e){return function(){return e?e.apply(t,arguments):void 0}},o=function(n){var r;r=n,t.fire("CloseWindow",{dialog:r}),0===(e=G(e,(function(t){return t!==n}))).length&&t.focus()},i=function(n){t.editorManager.setActive(t),Dd(t);var r=n();return function(n){var r;e.push(n),r=n,t.fire("OpenWindow",{dialog:r})}(r),r};return t.on("remove",(function(){W(e,(function(t){n().close(t)}))})),{open:function(t,e){return i((function(){return n().open(t,e,o)}))},openUrl:function(t){return i((function(){return n().openUrl(t,o)}))},alert:function(t,e,o){n().alert(t,r(o||this,e))},confirm:function(t,e,o){n().confirm(t,r(o||this,e))},close:function(){S.from(e[e.length-1]).each((function(t){n().close(t),o(t)}))}}},Rv=function(t,e){t.notificationManager.open({type:"error",text:e})},Mv=function(t,e){t._skinLoaded?Rv(t,e):t.on("SkinLoaded",(function(){Rv(t,e)}))},Iv=function(t,e,n){var r,o;r=e,o={message:n},t.fire(r,o),console.error(n)},Pv=function(t,e,n){return n?"Failed to load "+t+": "+n+" from url "+e:"Failed to load "+t+" url: "+e},Fv=function(t,e,n){Iv(t,"PluginLoadError",Pv("plugin",e,n))},Lv=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,_t([t],e)):r.log.apply(r,_t([t],e)))};function Vv(t,e){var n={},r=function(t,n,r,o){var i=new XMLHttpRequest;i.open("POST",e.url),i.withCredentials=e.credentials,i.upload.onprogress=function(t){o(t.loaded/t.total*100)},i.onerror=function(){r("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var t,o,u;i.status<200||300<=i.status?r("HTTP Error: "+i.status):(t=JSON.parse(i.responseText))&&"string"==typeof t.location?n((o=e.basePath,u=t.location,o?o.replace(/\/$/,"")+"/"+u.replace(/^\//,""):u)):r("Invalid JSON: "+i.responseText)};var u=new FormData;u.append("file",t.blob(),t.filename()),i.send(u)},o=function(t,e){return{url:e,blobInfo:t,status:!0}},i=function(t,e,n){return{url:"",blobInfo:t,status:!1,error:{message:e,options:n}}},u=function(t,e){ke.each(n[t],(function(t){t(e)})),delete n[t]};return!1===I(e.handler)&&(e.handler=r),{upload:function(a,c){return e.url||e.handler!==r?function(r,a){return r=ke.grep(r,(function(e){return!t.isUploaded(e.blobUri())})),Tr.all(ke.map(r,(function(r){return t.isPending(r.blobUri())?(l=r.blobUri(),new Tr((function(t){n[l]=n[l]||[],n[l].push(t)}))):(c=r,s=e.handler,f=a,t.markPending(c.blobUri()),new Tr((function(e){var n;try{var r=function(){n&&n.close()};s(c,(function(n){r(),t.markUploaded(c.blobUri(),n),u(c.blobUri(),o(c,n)),e(o(c,n))}),(function(n,o){var a=o||{};r(),t.removeFailed(c.blobUri()),u(c.blobUri(),i(c,n,a)),e(i(c,n,a))}),(function(t){t<0||100<t||(n=n||f()).progressBar.value(t)}))}catch(t){e(i(c,t.message,{}))}})));var c,s,f,l})))}(a,c):new Tr((function(t){t([])}))}}}var Hv=0,zv=function(t){return t+Hv+++(e=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+e()+e()+e());var e},jv=function(t){var e,n,r,o,i,u,a,c,f,l=(e=[],n=function(t){if(!t.blob||!t.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var e=t.id||zv("blobid"),n=t.name||e,r=t.blob;return{id:s(e),name:s(n),filename:s(t.filename||n+"."+({"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.type.toLowerCase()]||"dat")),blob:s(r),base64:s(t.base64),blobUri:s(t.blobUri||URL.createObjectURL(r)),uri:s(t.uri)}},{create:function(t,e,r,o,i){if(E(t))return n({id:t,name:o,filename:i,blob:e,base64:r});if(T(t))return n(t);throw new Error("Unknown input type")},add:function(t){o(t.id())||e.push(t)},get:o=function(t){return r((function(e){return e.id()===t}))},getByUri:function(t){return r((function(e){return e.blobUri()===t}))},getByData:function(t,e){return r((function(n){return n.base64()===t&&n.blob().type===e}))},findFirst:r=function(t){return Y(e,t).getOrUndefined()},removeByUri:function(t){e=G(e,(function(e){return e.blobUri()!==t||(URL.revokeObjectURL(e.blobUri()),!1)}))},destroy:function(){W(e,(function(t){URL.revokeObjectURL(t.blobUri())})),e=[]}}),d=(a={},c=function(t,e){return{status:t,resultUri:e}},{hasBlobUri:f=function(t){return t in a},getResultUri:function(t){var e=a[t];return e?e.resultUri:null},isPending:function(t){return!!f(t)&&1===a[t].status},isUploaded:function(t){return!!f(t)&&2===a[t].status},markPending:function(t){a[t]=c(1,null)},markUploaded:function(t,e){a[t]=c(2,e)},removeFailed:function(t){delete a[t]},destroy:function(){a={}}}),m=[],g=function(t){var e=ya(null);return t.on("change AddUndo",(function(t){e.set(Ot({},t.level))})),{fireIfChanged:function(){var n=t.undoManager.data;rt(n).filter((function(t){return!xh(e.get(),t)})).each((function(e){t.setDirty(!0),t.fire("change",{level:e,lastLevel:et(n,n.length-2).getOrNull()})}))}}}(t),p=function(e){return function(n){return t.selection?e(n):[]}},h=function(t,e,n){for(var r=0;-1!==(r=t.indexOf(e,r))&&(t=t.substring(0,r)+n+t.substr(r+e.length),r+=n.length-e.length+1),-1!==r;);return t},v=function(t,e,n){var r='src="'+n+'"'+(n===ye.transparentSrc?' data-mce-placeholder="1"':"");return t=h(t,'src="'+e+'"',r),h(t,'data-mce-src="'+e+'"','data-mce-src="'+n+'"')},b=function(e,n){W(t.undoManager.data,(function(t){"fragmented"===t.type?t.fragments=U(t.fragments,(function(t){return v(t,e,n)})):t.content=v(t.content,e,n)}))},x=function(){return t.notificationManager.open({text:t.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},w=function(e){return i=i||Vv(d,{url:t.getParam("images_upload_url","","string"),basePath:t.getParam("images_upload_base_path","","string"),credentials:t.getParam("images_upload_credentials",!1,"boolean"),handler:t.getParam("images_upload_handler",null,"function")}),k().then(p((function(n){var r=U(n,(function(t){return t.blobInfo}));return i.upload(r,x).then(p((function(r){var o=[],i=U(r,(function(e,r){var i,u,a=n[r].blobInfo,c=n[r].image;return e.status&&t.getParam("images_replace_blob_uris",!0,"boolean")?(l.removeByUri(c.src),function(e,n){var r,o=t.convertURL(n,"src");b(e.src,n),t.$(e).attr({src:t.getParam("images_reuse_filename",!1,"boolean")?(r=n)+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime():n,"data-mce-src":o})}(c,e.url)):e.error&&(e.error.options.remove&&(b(c.getAttribute("src"),ye.transparentSrc),o.push(c)),i=t,u=e.error.message,Mv(i,Sa.translate(["Failed to upload image: {0}",u]))),{element:c,status:e.status,uploadUri:e.url,blobInfo:a}}));return 0<i.length&&g.fireIfChanged(),0<o.length&&(Th(t)?console.error("Removing images on failed uploads is currently unsupported for RTC"):t.undoManager.transact((function(){W(o,(function(e){t.dom.remove(e),l.removeByUri(e.src)}))}))),e&&e(i),i})))})))},C=function(e){if(Zc(t))return w(e)},S=function(e){return!1!==Q(m,(function(t){return t(e)}))&&(0!==e.getAttribute("src").indexOf("data:")||t.getParam("images_dataimg_filter",y,"function")(e))},k=function(){return(u=u||Uh(d,l)).findAll(t.getBody(),S).then(p((function(e){return e=G(e,(function(e){return"string"!=typeof e||(Mv(t,e),!1)})),W(e,(function(t){b(t.image.src,t.blobInfo.blobUri()),t.image.src=t.blobInfo.blobUri(),t.image.removeAttribute("data-mce-src")})),e})))},O=function(e){return e.replace(/src="(blob:[^"]+)"/g,(function(e,n){var r=d.getResultUri(n);if(r)return'src="'+r+'"';var o=l.getByUri(n);return(o=o||X(t.editorManager.get(),(function(t,e){return t||e.editorUpload&&e.editorUpload.blobCache.getByUri(n)}),null))?'src="data:'+o.blob().type+";base64,"+o.base64()+'"':e}))};return t.on("SetContent",(function(){(Zc(t)?C:k)()})),t.on("RawSaveContent",(function(t){t.content=O(t.content)})),t.on("GetContent",(function(t){t.source_view||"raw"===t.format||"tree"===t.format||(t.content=O(t.content))})),t.on("PostRender",(function(){t.parser.addNodeFilter("img",(function(t){W(t,(function(t){var e,n=t.attr("src");l.getByUri(n)||(e=d.getResultUri(n))&&t.attr("src",e)}))}))})),{blobCache:l,addFilter:function(t){m.push(t)},uploadImages:w,uploadImagesAuto:C,scanForImages:k,destroy:function(){l.destroy(),d.destroy(),u=i=null}}};var Uv,Wv,qv=ke.each,Gv=da.DOM,$v=function(t,e){var n,r,o,i=e&&e.schema||ci({}),u=function(t){r="string"==typeof t?{name:t,classes:[],attrs:{}}:t;var e,n,o=Gv.create(r.name);return e=o,(n=r).classes.length&&Gv.addClass(e,n.classes.join(" ")),Gv.setAttribs(e,n.attrs),o},a=function(t,e,n){var r,o,c,s,f,l,d,m=0<e.length&&e[0],g=m&&m.name,p=(s=g,f="string"!=typeof(c=t)?c.nodeName.toLowerCase():c,!(!(d=(l=i.getElementRule(f))&&l.parentsRequired)||!d.length)&&(s&&-1!==ke.inArray(d,s)?s:d[0]));if(p)g===p?(o=e[0],e=e.slice(1)):o=p;else if(m)o=e[0],e=e.slice(1);else if(!n)return t;return o&&(r=u(o)).appendChild(t),n&&(r||(r=Gv.create("div")).appendChild(t),ke.each(n,(function(e){var n=u(e);r.insertBefore(n,t)}))),a(r,e,o&&o.siblings)};return t&&t.length?(r=t[0],n=u(r),(o=Gv.create("div")).appendChild(a(n,t.slice(1),r.siblings)),o):""},Xv=function(t){var e,n={classes:[],attrs:{}};return"*"!==(t=n.selector=ke.trim(t))&&(e=t.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(t,e,r,o,i){switch(e){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==ke.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r)}var u;return"["!==o||(u=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/))&&(n.attrs[u[1]]=u[2]),""}))),n.name=e||"div",n},Yv=function(t,e){var n,r,o,i="",u=(o=t.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"),E(o)?o:"");if(""===u)return"";var a=function(t){return t.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=t.formatter.get(e)))return;e=e[0]}if("preview"in e){var c=gt(e,"preview");if(c.is(!1))return"";u=c.getOr(u)}n=e.block||e.inline||"span";var s,f=(s=e.selector)&&"string"==typeof s?(s=(s=s.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),ke.map(s.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(t){var e=ke.map(t.split(/(?:~\+|~|\+)/),Xv),n=e.pop();return e.length&&(n.siblings=e),n})).reverse()):[],l=f.length?(f[0].name||(f[0].name=n),n=e.selector,$v(f,t)):$v([n],t),d=Gv.select(n,l)[0]||l.firstChild;return qv(e.styles,(function(t,e){var n=a(t);n&&Gv.setStyle(d,e,n)})),qv(e.attributes,(function(t,e){var n=a(t);n&&Gv.setAttrib(d,e,n)})),qv(e.classes,(function(t){var e=a(t);Gv.hasClass(d,e)||Gv.addClass(d,e)})),t.fire("PreviewFormats"),Gv.setStyles(l,{position:"absolute",left:-65535}),t.getBody().appendChild(l),r=Gv.getStyle(t.getBody(),"fontSize",!0),r=/px$/.test(r)?parseInt(r,10):0,qv(u.split(" "),(function(e){var n=Gv.getStyle(d,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=Gv.getStyle(t.getBody(),e,!0),"#ffffff"===Gv.toHex(n).toLowerCase())||"color"===e&&"#000000"===Gv.toHex(n).toLowerCase())){if("font-size"===e&&/em|%$/.test(n)){if(0===r)return;n=parseFloat(n)/(/%$/.test(n)?100:1)*r+"px"}"border"===e&&n&&(i+="padding:0 2px;"),i+=e+":"+n+";"}})),t.fire("AfterPreviewFormats"),Gv.remove(l),i},Kv=function(t){var e=function(t){var e,n,r={},o=function(t,e){t&&("string"!=typeof t?ke.each(t,(function(t,e){o(e,t)})):(A(e)||(e=[e]),ke.each(e,(function(t){void 0===t.deep&&(t.deep=!t.selector),void 0===t.split&&(t.split=!t.selector||t.inline),void 0===t.remove&&t.selector&&!t.inline&&(t.remove="none"),t.selector&&t.inline&&(t.mixed=!0,t.block_expand=!0),"string"==typeof t.classes&&(t.classes=t.classes.split(/\s+/))})),r[t]=e))};return o((e=t.dom,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",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img",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"}],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",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",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:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],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",defaultBlock:"p",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:function(t,e,n){return En(t)&&t.hasAttribute("href")},onformat:function(t,n,r){ke.each(r,(function(n,r){e.setAttrib(t,r,n)}))}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",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}]},ke.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),(function(t){n[t]={block:t,remove:"all"}})),n)),o(t.getParam("formats")),{get:function(t){return t?r[t]:r},has:function(t){return pt(r,t)},register:o,unregister:function(t){return t&&r[t]&&delete r[t],r}}}(t),n=ya(null);return function(t){t.addShortcut("meta+b","","Bold"),t.addShortcut("meta+i","","Italic"),t.addShortcut("meta+u","","Underline");for(var e=1;e<=6;e++)t.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);t.addShortcut("access+7","",["FormatBlock",!1,"p"]),t.addShortcut("access+8","",["FormatBlock",!1,"div"]),t.addShortcut("access+9","",["FormatBlock",!1,"address"])}(t),function(t){t.on("mouseup keydown",(function(e){var n,r,o,i;n=t,r=e.keyCode,o=n.selection,i=n.getBody(),vp(n,null,!1),8!==r&&46!==r||!o.isCollapsed()||o.getStart().innerHTML!==lp||vp(n,Cf(i,o.getStart())),37!==r&&39!==r||vp(n,Cf(i,o.getStart()))}))}(t),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,n,r){var o,i,u;o=e,i=n,u=r,Bh(t).formatter.apply(o,i,u)},remove:function(e,n,r,o){var i,u,a,c;i=e,u=n,a=r,c=o,Bh(t).formatter.remove(i,u,a,c)},toggle:function(e,n,r){var o,i,u;o=e,i=n,u=r,Bh(t).formatter.toggle(o,i,u)},match:function(e,n,r){return o=e,i=n,u=r,Bh(t).formatter.match(o,i,u);var o,i,u},closest:function(e){return n=e,Bh(t).formatter.closest(n);var n},matchAll:function(e,n){return r=e,o=n,Bh(t).formatter.matchAll(r,o);var r,o},matchNode:function(e,n,r,o){return i=e,u=n,a=r,c=o,Bh(t).formatter.matchNode(i,u,a,c);var i,u,a,c},canApply:function(e){return n=e,Bh(t).formatter.canApply(n);var n},formatChanged:function(e,r,o){return i=n,u=e,a=r,void 0===(c=o)&&(c=!1),Bh(t).formatter.formatChanged(i,u,a,c);var i,u,a,c},getCssText:l(Yv,t)}},Jv=function(t){var e,n=ya(S.none()),r=ya(0),o=ya(0),i={data:[],typing:!1,beforeChange:function(){var e,o;e=r,o=n,Bh(t).undoManager.beforeChange(e,o)},add:function(e,u){return a=i,c=o,s=r,f=n,l=e,d=u,Bh(t).undoManager.addUndoLevel(a,c,s,f,l,d);var a,c,s,f,l,d},undo:function(){return e=i,n=r,u=o,Bh(t).undoManager.undo(e,n,u);var e,n,u},redo:function(){return e=t,n=o,r=i.data,Bh(e).undoManager.redo(n,r);var e,n,r},clear:function(){var e,n;e=i,n=o,Bh(t).undoManager.clear(e,n)},reset:function(){var e;e=i,Bh(t).undoManager.reset(e)},hasUndo:function(){return e=i,n=o,Bh(t).undoManager.hasUndo(e,n);var e,n},hasRedo:function(){return e=i,n=o,Bh(t).undoManager.hasRedo(e,n);var e,n},transact:function(e){return n=i,o=r,u=e,Bh(t).undoManager.transact(n,o,u);var n,o,u},ignore:function(e){var n,o;n=r,o=e,Bh(t).undoManager.ignore(n,o)},extra:function(e,n){var r,u,a,c;r=i,u=o,a=e,c=n,Bh(t).undoManager.extra(r,u,a,c)}};return Th(t)||function(t,e,n){var r=ya(!1),o=function(t){Ch(e,!1,n),e.add({},t)};t.on("init",(function(){e.add()})),t.on("BeforeExecCommand",(function(t){var r=t.command.toLowerCase();"undo"!==r&&"redo"!==r&&"mcerepaint"!==r&&(Sh(e,n),e.beforeChange())})),t.on("ExecCommand",(function(t){var e=t.command.toLowerCase();"undo"!==e&&"redo"!==e&&"mcerepaint"!==e&&o(t)})),t.on("ObjectResizeStart cut",(function(){e.beforeChange()})),t.on("SaveContent ObjectResized blur",o),t.on("dragend",o),t.on("keyup",(function(n){var i=n.keyCode;n.isDefaultPrevented()||((33<=i&&i<=36||37<=i&&i<=40||45===i||n.ctrlKey)&&(o(),t.nodeChanged()),46!==i&&8!==i||t.nodeChanged(),r.get()&&e.typing&&!1===xh(hh(t),e.data[0])&&(!1===t.isDirty()&&(t.setDirty(!0),t.fire("change",{level:e.data[0],lastLevel:null})),t.fire("TypingUndo"),r.set(!1),t.nodeChanged()))})),t.on("keydown",(function(t){var i,u=t.keyCode;t.isDefaultPrevented()||(33<=u&&u<=36||37<=u&&u<=40||45===u?e.typing&&o(t):(i=t.ctrlKey&&!t.altKey||t.metaKey,!(u<16||20<u)||224===u||91===u||e.typing||i||(e.beforeChange(),Ch(e,!0,n),e.add({},t),r.set(!0))))})),t.on("mousedown",(function(t){e.typing&&o(t)})),t.on("input",(function(t){var e,n;t.inputType&&("insertReplacementText"===t.inputType||"insertText"===(n=t).inputType&&null===n.data||"insertFromPaste"===(e=t).inputType||"insertFromDrop"===e.inputType)&&o(t)})),t.on("AddUndo Undo Redo ClearUndos",(function(e){e.isDefaultPrevented()||t.nodeChanged()}))}(t,i,r),(e=t).addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo"),i},Qv=[9,27,Rl.HOME,Rl.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,Rl.DOWN,Rl.UP,Rl.LEFT,Rl.RIGHT].concat(ye.browser.isFirefox()?[224]:[]),Zv="data-mce-placeholder",tb=function(t){return"keydown"===t.type||"keyup"===t.type},eb=function(t){var e=t.keyCode;return e===Rl.BACKSPACE||e===Rl.DELETE},nb=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,rb=function(t,e){return Ne(Ae(e),t.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string"))},ob=function(t,e,n){var r,o,i,u=(r=t,o=e,i=n,G(da.DOM.getParents(i.container(),"*",o),r));return S.from(u[u.length-1])},ib=function(t,e){if(!e)return e;var n=e.container(),r=e.offset();return t?so(n)?In(n.nextSibling)?_c(n.nextSibling,0):_c.after(n):mo(e)?_c(n,r+1):e:so(n)?In(n.previousSibling)?_c(n.previousSibling,n.previousSibling.data.length):_c.before(n):go(e)?_c(n,r-1):e},ub=l(ib,!0),ab=l(ib,!1),cb=function(t,e){return Me(t,e)?kr(e,(function(t){return Kr(t)||Qr(t)}),(n=t,function(t){return Re(n,Ae(t.dom.parentNode))})):S.none();var n},sb=function(t){var e,n,r;t.dom.isEmpty(t.getBody())&&(t.setContent(""),r=(n=(e=t).getBody()).firstChild&&e.dom.isBlock(n.firstChild)?n.firstChild:n,e.selection.setCursorLocation(r,0))},fb=function(t,e){return{from:t,to:e}},lb=function(t,e){var n=Ae(t),r=Ae(e.container());return cb(n,r).map((function(t){return{block:t,position:e}}))},db=function(t){var e,n=(e=Ke(t),K(e,$r).fold((function(){return e}),(function(t){return e.slice(0,t)})));return W(n,mn),n},mb=function(t,e){var n=Um(e,t);return Y(n.reverse(),(function(t){return Io(t)})).each(mn)},gb=function(t,e,n,r){if(Io(n))return Hm(n),bf(n.dom);0===G(Xe(r),(function(t){return!Io(t)})).length&&Io(e)&&an(r,Ee("br"));var o=vf(n.dom,_c.before(r.dom));return W(db(e),(function(t){an(r,t)})),mb(t,e),o},pb=function(t,e,n){if(Io(n))return mn(n),Io(e)&&Hm(e),bf(e.dom);var r=yf(n.dom);return W(db(e),(function(t){fn(n,t)})),mb(t,e),r},hb=function(t,e){pf(t,e.dom).map((function(t){return t.getNode()})).map(Ae).filter(Yr).each(mn)},vb=function(t,e,n){return hb(!0,e),hb(!1,n),function(t,e){return Me(e,t)?(n=Um(t,e),S.from(n[n.length-1])):S.none();var n}(e,n).fold(l(pb,t,e,n),l(gb,t,e,n))},bb=function(t,e,n,r){return e?vb(t,r,n):vb(t,n,r)},yb=function(t,e){var n,r,o,i=Ae(t.getBody()),u=(n=i.dom,r=e,((o=t.selection.getRng()).collapsed?function(t,e,n){var r=lb(t,_c.fromRangeStart(n)),o=r.bind((function(n){return df(e,t,n.position).bind((function(n){return lb(t,n).map((function(n){return r=t,o=e,Vn((i=n).position.getNode())&&!1===Io(i.block)?pf(!1,i.block.dom).bind((function(t){return t.isEqual(i.position)?df(o,r,t).bind((function(t){return lb(r,t)})):S.some(i)})).getOr(i):i;var r,o,i}))}))}));return Xa(r,o,fb).filter((function(t){return!1===Re((r=t).from.block,r.to.block)&&qe((n=t).from.block).bind((function(t){return qe(n.to.block).filter((function(e){return Re(t,e)}))})).isSome()&&!1===jn((e=t).from.block.dom)&&!1===jn(e.to.block.dom);var e,n,r}))}(n,r,o):S.none()).bind((function(t){return bb(i,e,t.from.block,t.to.block)})));return u.each((function(e){t.selection.setRng(e.toRange())})),u.isSome()},xb=function(t,e){var n=Ae(e),r=l(Re,t);return Sr(n,to,r).isSome()},wb=function(t){var e,n,r,o,i=Ae(t.getBody());return function(t,e){var n,r,o=vf(t.dom,_c.fromRangeStart(e)).isNone(),i=hf(t.dom,_c.fromRangeEnd(e)).isNone();return!(xb(n=t,(r=e).startContainer)||xb(n,r.endContainer))&&o&&i}(i,t.selection.getRng())?((o=t).setContent(""),o.selection.setCursorLocation(),!0):(e=i,n=t.selection,r=n.getRng(),Xa(cb(e,Ae(r.startContainer)),cb(e,Ae(r.endContainer)),(function(t,o){return!1===Re(t,o)&&(r.deleteContents(),bb(e,!0,t,o).each((function(t){n.setRng(t.toRange())})),!0)})).getOr(!1))},Cb=function(t,e){return!t.selection.isCollapsed()&&wb(t)},Sb=zn,kb=jn,Ob=function(t,e,n,r,o){return S.from(e._selectionOverrides.showCaret(t,n,r,o))},_b=function(t,e){var n,r;return t.fire("BeforeObjectSelected",{target:e}).isDefaultPrevented()?S.none():S.some(((r=(n=e).ownerDocument.createRange()).selectNode(n),r))},Eb=function(t,e,n){var r=Us(1,t.getBody(),e),o=_c.fromRangeStart(r),i=o.getNode();if(Os(i))return Ob(1,t,i,!o.isAtEnd(),!1);var u=o.getNode(!0);if(Os(u))return Ob(1,t,u,!1,!1);var a=t.dom.getParent(o.getNode(),(function(t){return kb(t)||Sb(t)}));return Os(a)?Ob(1,t,a,!1,n):S.none()},Tb=function(t,e,n){return e.collapsed?Eb(t,e,n).getOr(e):e},Ab=function(t){return Lm(t)||Mm(t)},Bb=function(t){return Vm(t)||Im(t)},Nb=function(t,e,n,r,o,i){var u,a;return Ob(r,t,i.getNode(!o),o,!0).each((function(n){var r;e.collapsed?(r=e.cloneRange(),o?r.setEnd(n.startContainer,n.startOffset):r.setStart(n.endContainer,n.endOffset),r.deleteContents()):e.deleteContents(),t.selection.setRng(n)})),u=t.dom,In(a=n)&&0===a.data.length&&u.remove(a),!0},Db=function(t,e){var n=t.selection.getRng();if(!In(n.commonAncestorContainer))return!1;var r=e?kc.Forwards:kc.Backwards,o=cf(t.getBody()),i=l($s,e?o.next:o.prev),u=e?Ab:Bb,a=qs(r,t.getBody(),n),c=ib(e,i(a));if(!c||!Xs(a,c))return!1;if(u(c))return Nb(t,n,a.getNode(),r,e,c);var s=i(c);return!!(s&&u(s)&&Xs(c,s))&&Nb(t,n,a.getNode(),r,e,s)},Rb=hr([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),Mb=function(t,e,n){return df(e,t,n).bind((function(r){return s=r.getNode(),to(Ae(s))||Qr(Ae(s))?S.none():(o=t,a=r,c=function(t){return Xr(Ae(t))&&!Fs(u,a,o)},Ws(!(i=e),u=n).fold((function(){return Ws(i,a).fold(b,c)}),c)?S.none():e&&jn(r.getNode())||!1===e&&jn(r.getNode(!0))?function(t,e,n,r){var o=r.getNode(!1===e);return cb(Ae(t),Ae(n.getNode())).map((function(t){return Io(t)?Rb.remove(t.dom):Rb.moveToElement(o)})).orThunk((function(){return S.some(Rb.moveToElement(o))}))}(t,e,n,r):e&&Vm(n)||!1===e&&Lm(n)?S.some(Rb.moveToPosition(r)):S.none());var o,i,u,a,c,s}))},Ib=function(t,e){return S.from(Nl(t.getBody(),e))},Pb=function(t,e){var n=t.selection.getNode();return Ib(t,n).filter(jn).fold((function(){return n=t.getBody(),r=e,o=t.selection.getRng(),i=Us(r?1:-1,n,o),u=_c.fromRangeStart(i),a=Ae(n),(!1===r&&Vm(u)?S.some(Rb.remove(u.getNode(!0))):r&&Lm(u)?S.some(Rb.remove(u.getNode())):!1===r&&Lm(u)&&eg(a,u)?ng(a,u).map((function(t){return Rb.remove(t.getNode())})):r&&Vm(u)&&tg(a,u)?rg(a,u).map((function(t){return Rb.remove(t.getNode())})):function(t,e,n){return i=e,u=n.getNode(!1===i),a=i?"after":"before",En(u)&&u.getAttribute("data-mce-caret")===a?(r=e,o=n.getNode(!1===e),(r&&jn(o.nextSibling)?S.some(Rb.moveToElement(o.nextSibling)):!1===r&&jn(o.previousSibling)?S.some(Rb.moveToElement(o.previousSibling)):S.none()).fold((function(){return Mb(t,e,n)}),S.some)):Mb(t,e,n).bind((function(e){return r=t,o=n,e.fold((function(t){return S.some(Rb.remove(t))}),(function(t){return S.some(Rb.moveToElement(t))}),(function(t){return Fs(o,t,r)?S.none():S.some(Rb.moveToPosition(t))}));var r,o}));var r,o,i,u,a}(n,r,u)).exists((function(n){return n.fold((function(t){return u._selectionOverrides.hideFakeCaret(),Ag(u,a,Ae(t)),!0}),(i=a=e,function(t){var e=i?_c.before(t):_c.after(t);return o.selection.setRng(e.toRange()),!0}),(r=o=u=t,function(t){return r.selection.setRng(t.toRange()),!0}));var r,o,i,u,a}));var n,r,o,i,u,a}),y)},Fb=function(t,e){var n=t.selection.getNode();return!!jn(n)&&Ib(t,n.parentNode).filter(jn).fold((function(){var n;return n=Ae(t.getBody()),W(Ma(n,".mce-offscreen-selection"),mn),Ag(t,e,Ae(t.selection.getNode())),sb(t),!0}),(function(){return!0}))},Lb=function(t){var e,n=t.dom,r=t.selection,o=Nl(t.getBody(),r.getNode());return zn(o)&&n.isBlock(o)&&n.isEmpty(o)&&(e=n.create("br",{"data-mce-bogus":"1"}),n.setHTML(o,""),o.appendChild(e),r.setRng(_c.before(e).toRange())),!0},Vb=function(t,e){return(t.selection.isCollapsed()?Pb:Fb)(t,e)},Hb=function(t,e){return!!t.selection.isCollapsed()&&(n=t,r=e,o=_c.fromRangeStart(n.selection.getRng()),df(r,n.getBody(),o).filter((function(t){return(r?Dm:Rm)(t)})).bind((function(t){return S.from(Ls(r?0:-1,t))})).exists((function(t){return n.selection.select(t),!0})));var n,r,o},zb=In,jb=function(t){return zb(t)&&t.data[0]===ro},Ub=function(t){return zb(t)&&t.data[t.data.length-1]===ro},Wb=function(t){return t.ownerDocument.createTextNode(ro)},qb=function(t,e){return(t?function(t){if(zb(t.previousSibling))return Ub(t.previousSibling)||t.previousSibling.appendData(ro),t.previousSibling;if(zb(t))return jb(t)||t.insertData(0,ro),t;var e=Wb(t);return t.parentNode.insertBefore(e,t),e}:function(t){if(zb(t.nextSibling))return jb(t.nextSibling)||t.nextSibling.insertData(0,ro),t.nextSibling;if(zb(t))return Ub(t)||t.appendData(ro),t;var e=Wb(t);return t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e})(e)},Gb=l(qb,!0),$b=l(qb,!1),Xb=function(t,e){return In(t.container())?qb(e,t.container()):qb(e,t.getNode())},Yb=function(t,e){var n=e.get();return n&&t.container()===n&&so(n)},Kb=function(t,e){return e.fold((function(e){vs(t.get());var n=Gb(e);return t.set(n),S.some(_c(n,n.length-1))}),(function(e){return bf(e).map((function(e){if(Yb(e,t))return _c(t.get(),1);vs(t.get());var n=Xb(e,!0);return t.set(n),_c(n,1)}))}),(function(e){return yf(e).map((function(e){if(Yb(e,t))return _c(t.get(),t.get().length-1);vs(t.get());var n=Xb(e,!1);return t.set(n),_c(n,n.length-1)}))}),(function(e){vs(t.get());var n=$b(e);return t.set(n),S.some(_c(n,1))}))},Jb=function(t,e){for(var n=0;n<t.length;n++){var r=t[n].apply(null,e);if(r.isSome())return r}return S.none()},Qb=hr([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),Zb=function(t,e){return Ps(e,t)||t},ty=function(t,e,n){var r=ub(n),o=Zb(e,r.container());return ob(t,o,r).fold((function(){return hf(o,r).bind(l(ob,t,o)).map((function(t){return Qb.before(t)}))}),S.none)},ey=function(t,e){return null===Cf(t,e)},ny=function(t,e,n){return ob(t,e,n).filter(l(ey,e))},ry=function(t,e,n){var r=ab(n);return ny(t,e,r).bind((function(t){return vf(t,r).isNone()?S.some(Qb.start(t)):S.none()}))},oy=function(t,e,n){var r=ub(n);return ny(t,e,r).bind((function(t){return hf(t,r).isNone()?S.some(Qb.end(t)):S.none()}))},iy=function(t,e,n){var r=ab(n),o=Zb(e,r.container());return ob(t,o,r).fold((function(){return vf(o,r).bind(l(ob,t,o)).map((function(t){return Qb.after(t)}))}),S.none)},uy=function(t){return!1===function(t){return"rtl"===da.DOM.getStyle(t,"direction",!0)||(e=t.textContent,nb.test(e));var e}(cy(t))},ay=function(t,e,n){return Jb([ty,ry,oy,iy],[t,e,n]).filter(uy)},cy=function(t){return t.fold(f,f,f,f)},sy=function(t){return t.fold(s("before"),s("start"),s("end"),s("after"))},fy=function(t){return t.fold(Qb.before,Qb.before,Qb.after,Qb.after)},ly=function(t){return t.fold(Qb.start,Qb.start,Qb.end,Qb.end)},dy=function(t,e,n,r,o,i){return Xa(ob(e,n,r),ob(e,n,o),(function(e,r){return e!==r&&(u=r,a=Ps(e,o=n),c=Ps(u,o),a&&a===c)?Qb.after(t?e:r):i;var o,u,a,c})).getOr(i)},my=function(t,e){return t.fold(y,(function(t){return r=e,!(sy(n=t)===sy(r)&&cy(n)===cy(r));var n,r}))},gy=function(t,e){return t?e.fold(c(S.some,Qb.start),S.none,c(S.some,Qb.after),S.none):e.fold(S.none,c(S.some,Qb.before),S.none,c(S.some,Qb.end))},py=function(t,e,n,r){var o=ib(t,r),i=ay(e,n,o);return ay(e,n,o).bind(l(gy,t)).orThunk((function(){return u=e,a=n,c=i,s=ib(o=t,r),df(o,a,s).map(l(ib,o)).fold((function(){return c.map(fy)}),(function(t){return ay(u,a,t).map(l(dy,o,u,a,s,t)).filter(l(my,c))})).filter(uy);var o,u,a,c,s}))},hy=(l(py,!1),l(py,!0),function(t,e,n){var r=t?1:-1;return e.setRng(_c(n.container(),n.offset()+r).toRange()),e.getSel().modify("move",t?"forward":"backward","word"),!0}),vy=function(t,e){var n=t.dom.createRng();n.setStart(e.container(),e.offset()),n.setEnd(e.container(),e.offset()),t.selection.setRng(n)},by=function(t,e){t?e.setAttribute("data-mce-selected","inline-boundary"):e.removeAttribute("data-mce-selected")},yy=function(t,e,n){return Kb(e,n).map((function(e){return vy(t,e),n}))},xy=function(t,e,n){return!!as(t)&&(o=e,i=n,u=(r=t).getBody(),a=_c.fromRangeStart(r.selection.getRng()),c=l(rb,r),py(i,c,u,a).bind((function(t){return yy(r,o,t)})).isSome());var r,o,i,u,a,c},wy=function(t,e,n){return!!as(e)&&function(t,e){var n=e.selection.getRng(),r=t?_c.fromRangeEnd(n):_c.fromRangeStart(n);return!!I(e.selection.getSel().modify)&&(t&&mo(r)?hy(!0,e.selection,r):!(t||!go(r))&&hy(!1,e.selection,r))}(t,e)},Cy=function(t){var e=ya(null),n=l(rb,t);return t.on("NodeChange",(function(r){var o,i,u,a,c,s,f,d,m,g,p;!as(t)||ye.browser.isIE()&&r.initial||(s=n,f=t.dom,d=r.parents,m=U(Ma(Ae(f.getRoot()),'*[data-mce-selected="inline-boundary"]'),(function(t){return t.dom})),g=G(m,s),p=G(d,s),W(tt(g,p),l(by,!1)),W(tt(p,g),l(by,!0)),function(t,e){var n,r;t.selection.isCollapsed()&&!0!==t.composing&&e.get()&&(n=_c.fromRangeStart(t.selection.getRng()),_c.isTextPosition(n)&&!1===(mo(r=n)||go(r))&&(vy(t,hs(e.get(),n)),e.set(null)))}(t,e),o=n,i=t,u=e,a=r.parents,i.selection.isCollapsed()&&(c=G(a,o),W(c,(function(t){var e=_c.fromRangeStart(i.selection.getRng());ay(o,i.getBody(),e).bind((function(t){return yy(i,u,t)}))}))))})),e},Sy=l(wy,!0),ky=l(wy,!1),Oy=function(t,e){return function(n){return Kb(e,n).exists((function(e){return vy(t,e),!0}))}},_y=function(t,e,n,r){var o=t.getBody(),i=l(rb,t);t.undoManager.ignore((function(){var u,a,c;t.selection.setRng((u=n,a=r,(c=document.createRange()).setStart(u.container(),u.offset()),c.setEnd(a.container(),a.offset()),c)),t.execCommand("Delete"),ay(i,o,_c.fromRangeStart(t.selection.getRng())).map(ly).map(Oy(t,e))})),t.nodeChanged()},Ey=function(t,e,n){if(t.selection.isCollapsed()&&as(t)){var r=_c.fromRangeStart(t.selection.getRng());return function(t,e,n,r){var o,i,u=(o=t.getBody(),i=r.container(),Ps(i,o)||o),a=l(rb,t),c=ay(a,u,r);return c.bind((function(t){return n?t.fold(s(S.some(ly(t))),S.none,s(S.some(fy(t))),S.none):t.fold(S.none,s(S.some(fy(t))),S.none,s(S.some(ly(t))))})).map(Oy(t,e)).getOrThunk((function(){var o=mf(n,u,r),i=o.bind((function(t){return ay(a,u,t)}));return Xa(c,i,(function(){return ob(a,u,r).exists((function(e){return!!Xa(bf(r=e),yf(r),(function(t,e){var n=ib(!0,t),o=ib(!1,e);return hf(r,n).forall((function(t){return t.isEqual(o)}))})).getOr(!0)&&(Ag(t,n,Ae(e)),!0);var r}))})).orThunk((function(){return i.bind((function(i){return o.map((function(o){return n?_y(t,e,r,o):_y(t,e,o,r),!0}))}))})).getOr(!1)}))}(t,e,n,r)}return!1},Ty=function(t){return 1===Ke(t).length},Ay=function(t,e){var n,r=Ae(t.getBody()),o=Ae(t.selection.getStart()),i=G((n=Um(o,r),K(n,$r).fold(s(n),(function(t){return n.slice(0,t)}))),Ty);return rt(i).exists((function(n){var r,o,u,a,c=_c.fromRangeStart(t.selection.getRng());return o=e,u=c,a=n.dom,!(!Xa(bf(a),yf(a),(function(t,e){var n=ib(!0,t),r=ib(!1,e),i=ib(!1,u);return o?hf(a,i).exists((function(t){return t.isEqual(r)&&u.isEqual(n)})):vf(a,i).exists((function(t){return t.isEqual(n)&&u.isEqual(r)}))})).getOr(!0)||wf((r=n).dom)&&mp(r.dom)||(function(t,e,n,r){var o,i,u,a,c,s=l(wp,e),f=U(G(r,s),(function(t){return t.dom}));0===f.length?Ag(e,t,n):(i=n.dom,u=f,a=pp(!1),c=yp(u,a.dom),an(Ae(i),a),mn(Ae(i)),o=_c(c,0),e.selection.setRng(o.toRange()))}(e,t,n,i),0))}))},By=function(t,e){return!!t.selection.isCollapsed()&&Ay(t,e)},Ny=function(t,e,n){return t._selectionOverrides.hideFakeCaret(),Ag(t,e,Ae(n)),!0},Dy=function(t,e){return t.selection.isCollapsed()?(i=t,a=(u=e)?Mm:Im,c=u?kc.Forwards:kc.Backwards,s=qs(c,i.getBody(),i.selection.getRng()),a(s)?Ny(i,u,s.getNode(!u)):S.from(ib(u,s)).filter((function(t){return a(t)&&Xs(s,t)})).exists((function(t){return Ny(i,u,t.getNode(!u))}))):(r=e,o=(n=t).selection.getNode(),!!Wn(o)&&Ny(n,r,o));var n,r,o,i,u,a,c,s},Ry=function(t){var e=parseInt(t,10);return isNaN(e)?0:e},My=function(t,e){return(t||"table"===Ie(e)?"margin":"padding")+("rtl"===Qn(e,"direction")?"-right":"-left")},Iy=function(t){var e,n=Fy(t);return!t.mode.isReadOnly()&&(1<n.length||(e=t,Q(n,(function(t){var n=My(rs(e),t),r=tr(t,n).map(Ry).getOr(0);return"false"!==e.dom.getContentEditable(t.dom)&&0<r}))))},Py=function(t){return Jr(t)||Qr(t)},Fy=function(t){return G(U(t.selection.getSelectedBlocks(),Ae),(function(t){return!Py(t)&&!qe(t).map(Py).getOr(!1)&&kr(t,(function(t){return zn(t.dom)||jn(t.dom)})).exists((function(t){return zn(t.dom)}))}))},Ly=function(t,e){var n=t.dom,r=t.selection,o=t.formatter,i=t.getParam("indentation","40px","string"),u=/[a-z%]+$/i.exec(i)[0],a=parseInt(i,10),c=rs(t),s=Jc(t);t.queryCommandState("InsertUnorderedList")||t.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),W(Fy(t),(function(t){var r,o,i,s,f,l,d,m;r=n,o=e,i=c,s=a,f=u,l=t.dom,m=My(i,Ae(l)),"outdent"===o?(d=Math.max(0,Ry(l.style[m])-s),r.setStyle(l,m,d?d+f:"")):(d=Ry(l.style[m])+s+f,r.setStyle(l,m,d))}))},Vy=function(t,e){if(t.selection.isCollapsed()&&Iy(t)){var n=t.dom,r=t.selection.getRng(),o=_c.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&Xm(Ae(i),o))return Ly(t,"outdent"),!0}return!1},Hy=function(t,e){t.getDoc().execCommand(e,!1,null)},zy=function(t){return void 0===t.touches||1!==t.touches.length?S.none():S.some(t.touches[0])},jy=function(t,e){return t.hasOwnProperty(e.nodeName)},Uy=function(t){var e,n,r,o=t.dom,i=t.selection,u=t.schema,a=u.getBlockElements(),c=i.getStart(),s=t.getBody(),f=Jc(t);if(c&&En(c)&&f){var l=s.nodeName.toLowerCase();if(u.isValidChild(l,f.toLowerCase())&&(d=a,m=s,!j(jm(Ae(c),Ae(m)),(function(t){return jy(d,t.dom)})))){var d,m,g,p,h=i.getRng(),v=h.startContainer,b=h.startOffset,y=h.endContainer,x=h.endOffset,w=jd(t);for(c=s.firstChild;c;)if(g=a,In(p=c)||En(p)&&!jy(g,p)&&!Bf(p)){if(function(t,e){if(In(e)){if(0===e.nodeValue.length)return!0;if(/^\s+$/.test(e.nodeValue)&&(!e.nextSibling||jy(t,e.nextSibling)))return!0}return!1}(a,c)){c=(n=c).nextSibling,o.remove(n);continue}e||(e=o.create(f,Qc(t)),c.parentNode.insertBefore(e,c),r=!0),c=(n=c).nextSibling,e.appendChild(n)}else e=null,c=c.nextSibling;r&&w&&(h.setStart(v,b),h.setEnd(y,x),i.setRng(h),t.nodeChanged())}}},Wy=function(t,e){var n;e.hasAttribute("data-mce-caret")&&(vo(e),(n=t).selection.setRng(n.selection.getRng()),t.selection.scrollIntoView(e))},qy=function(t,e){var n=_r(Ae(t.getBody()),"*[data-mce-caret]").fold(s(null),(function(t){return t.dom}));if(n)return"compositionstart"===e.type?(e.preventDefault(),e.stopPropagation(),void Wy(t,n)):void(lo(n)&&(Wy(t,n),t.undoManager.add()))};(Wv=Uv=Uv||{})[Wv.Br=0]="Br",Wv[Wv.Block=1]="Block",Wv[Wv.Wrap=2]="Wrap",Wv[Wv.Eol=3]="Eol";var Gy,$y,Xy=function(t,e){return t===kc.Backwards?Z(e):e},Yy=function(t,e,n,r){for(var o,i,u,a,c,s,f=cf(n),l=r,d=[];l&&(c=f,s=l,o=e===kc.Forwards?c.next(s):c.prev(s));){if(Vn(o.getNode(!1)))return e===kc.Forwards?{positions:Xy(e,d).concat([o]),breakType:Uv.Br,breakAt:S.some(o)}:{positions:Xy(e,d),breakType:Uv.Br,breakAt:S.some(o)};if(o.isVisible()){if(t(l,o)){var m=(i=e,u=l,Vn((a=o).getNode(i===kc.Forwards))?Uv.Br:!1===Fs(u,a)?Uv.Block:Uv.Wrap);return{positions:Xy(e,d),breakType:m,breakAt:S.some(o)}}d.push(o),l=o}else l=o}return{positions:Xy(e,d),breakType:Uv.Eol,breakAt:S.none()}},Ky=function(t,e,n,r){return e(n,r).breakAt.map((function(r){var o=e(n,r).positions;return t===kc.Backwards?o.concat(r):[r].concat(o)})).getOr([])},Jy=function(t,e){return X(t,(function(t,n){return t.fold((function(){return S.some(n)}),(function(r){return Xa(nt(r.getClientRects()),nt(n.getClientRects()),(function(t,o){var i=Math.abs(e-t.left);return Math.abs(e-o.left)<=i?n:r})).or(t)}))}),S.none())},Qy=function(t,e){return nt(e.getClientRects()).bind((function(e){return Jy(t,e.left)}))},Zy=l(Yy,Sc.isAbove,-1),tx=l(Yy,Sc.isBelow,1),ex=l(Ky,-1,Zy),nx=l(Ky,1,tx),rx=function(t){var e=function(e){return U(e,(function(e){return(e=Ka(e)).node=t,e}))};if(En(t))return e(t.getClientRects());if(In(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}},ox=function(t){return J(t,rx)};($y=Gy=Gy||{})[$y.Up=-1]="Up",$y[$y.Down=1]="Down";var ix=function(t,e,n,r,o,i){var u=0,a=[],c=function(r){var i,c,f=ox([r]);for(-1===t&&(f=f.reverse()),i=0;i<f.length;i++)if(c=f[i],!n(c,s)){if(0<a.length&&e(c,kt(a))&&u++,c.line=u,o(c))return!0;a.push(c)}},s=kt(i.getClientRects());if(!s)return a;var f=i.getNode();return c(f),function(t,e,n,r){for(;r=Is(r,t,To,e);)if(n(r))return}(t,r,c,f),a},ux=l(ix,Gy.Up,Za,tc),ax=l(ix,Gy.Down,tc,Za),cx=function(t){return function(e){return n=t,e.line>n;var n}},sx=function(t){return function(e){return n=t,e.line===n;var n}},fx=jn,lx=Is,dx=function(t,e){return Math.abs(t.left-e)},mx=function(t,e){return Math.abs(t.right-e)},gx=function(t,e){return t>=e.left&&t<=e.right},px=function(t,e){return t>=e.top&&t<=e.bottom},hx=function(t,e){return Ct(t,(function(t,n){var r=Math.min(dx(t,e),mx(t,e)),o=Math.min(dx(n,e),mx(n,e));return gx(e,n)||!gx(e,t)&&(o===r&&fx(n.node)||o<r)?n:t}))},vx=function(t,e,n,r,o){var i=lx(r,t,To,e,!o);do{if(!i||n(i))return}while(i=lx(i,t,To,e))},bx=function(t,e){t.selection.setRng(e),bd(t,t.selection.getRng())},yx=function(t,e,n){return S.some(Tb(t,e,n))},xx=function(t,e,n,r,o,i){var u=e===kc.Forwards,a=cf(t.getBody()),c=l($s,u?a.next:a.prev),s=u?r:o;if(!n.collapsed){var f=nc(n);if(i(f))return Ob(e,t,f,e===kc.Backwards,!1)}var d=qs(e,t.getBody(),n);if(s(d))return _b(t,d.getNode(!u));var m=ib(u,c(d)),g=co(n.startContainer);if(!m)return g?S.some(n):S.none();if(s(m))return Ob(e,t,m.getNode(!u),u,!1);var p=c(m);return p&&s(p)&&Xs(m,p)?Ob(e,t,p.getNode(!u),u,!1):g?yx(t,m.toRange(),!1):S.none()},wx=function(t,e,n,r,o,i){var u=qs(e,t.getBody(),n),a=kt(u.getClientRects()),c=e===Gy.Down;if(!a)return S.none();var s,f=(c?ax:ux)(t.getBody(),cx(1),u),l=G(f,sx(1)),d=a.left,m=hx(l,d);if(m&&i(m.node)){var g=Math.abs(d-m.left),p=Math.abs(d-m.right);return Ob(e,t,m.node,g<p,!1)}if(s=r(u)?u.getNode():o(u)?u.getNode(!0):nc(n)){var h=function(t,e,n,r){var o,i,u,a,c=cf(e),s=[],f=0,l=function(t){return kt(t.getClientRects())},d=1===t?(o=c.next,i=tc,u=Za,_c.after(r)):(o=c.prev,i=Za,u=tc,_c.before(r)),m=l(d);do{if(d.isVisible()&&!u(a=l(d),m)){if(0<s.length&&i(a,kt(s))&&f++,(a=Ka(a)).position=d,a.line=f,n(a))return s;s.push(a)}}while(d=o(d));return s}(e,t.getBody(),cx(1),s),v=hx(G(h,sx(1)),d);if(v)return yx(t,v.position.toRange(),!1);if(v=kt(G(h,sx(0))))return yx(t,v.position.toRange(),!1)}return 0===l.length?Cx(t,c).filter(c?o:r).map((function(e){return Tb(t,e.toRange(),!1)})):S.none()},Cx=function(t,e){var n=t.selection.getRng(),r=t.getBody();if(e){var o=_c.fromRangeEnd(n),i=tx(r,o);return rt(i.positions)}return o=_c.fromRangeStart(n),i=Zy(r,o),nt(i.positions)},Sx=function(t,e,n){return Cx(t,e).filter(n).exists((function(e){return t.selection.setRng(e.toRange()),!0}))},kx=jn,Ox=function(t,e,n){var r,o,i=cf(t.getBody()),u=l($s,1===e?i.next:i.prev);if(n.collapsed&&""!==Jc(t)){var a,c=t.dom.getParent(n.startContainer,"PRE");if(!c)return;u(_c.fromRangeStart(n))||(o=(r=t).dom.create(Jc(r)),(!ye.ie||11<=ye.ie)&&(o.innerHTML='<br data-mce-bogus="1">'),a=o,1===e?t.$(c).after(a):t.$(c).before(a),t.selection.select(a,!0),t.selection.collapse())}},_x=function(t,e){return function(t,e){var n=e?kc.Forwards:kc.Backwards,r=t.selection.getRng();return xx(t,n,r,Lm,Vm,kx).orThunk((function(){return Ox(t,n,r),S.none()}))}(t,e).exists((function(e){return bx(t,e),!0}))},Ex=function(t,e){return function(t,e){var n=e?1:-1,r=t.selection.getRng();return wx(t,n,r,(function(t){return Lm(t)||Pm(t)}),(function(t){return Vm(t)||Fm(t)}),kx).orThunk((function(){return Ox(t,n,r),S.none()}))}(t,e).exists((function(e){return bx(t,e),!0}))},Tx=function(t,e){return Sx(t,e,e?Vm:Lm)},Ax=function(t){return z(["figcaption"],Ie(t))},Bx=function(t){var e=document.createRange();return e.setStartBefore(t.dom),e.setEndBefore(t.dom),e},Nx=function(t,e,n){(n?fn:sn)(t,e)},Dx=function(t,e){var n,r,o=Ae(t.getBody()),i=_c.fromRangeStart(t.selection.getRng()),u=Jc(t),a=Qc(t);return n=i,r=l(Re,o),kr(Ae(n.container()),$r,r).filter(Ax).exists((function(){if(function(t,e,n){return e?(o=t.dom,tx(o,n).breakAt.isNone()):(r=t.dom,Zy(r,n).breakAt.isNone());var r,o}(o,e,i)){var n=function(t,e,n,r){return""===e?(s=t,f=r,l=Ee("br"),Nx(s,l,f),Bx(l)):(o=t,i=r,u=n,a=Ee(e),c=Ee("br"),Xn(a,u),fn(a,c),Nx(o,a,i),Bx(c));var o,i,u,a,c,s,f,l}(o,u,a,e);return t.selection.setRng(n),!0}return!1}))},Rx=function(t,e){return!!t.selection.isCollapsed()&&Dx(t,e)},Mx=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(null,e)}},Ix=function(t,e){return Y(function(t,e){return J(U(t,(function(t){return Ot({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:a},t)})),(function(t){return n=t,(r=e).keyCode===n.keyCode&&r.shiftKey===n.shiftKey&&r.altKey===n.altKey&&r.ctrlKey===n.ctrlKey&&r.metaKey===n.metaKey?[t]:[];var n,r}))}(t,e),(function(t){return t.action()}))},Px=function(t,e){var n=e?kc.Forwards:kc.Backwards,r=t.selection.getRng();return xx(t,n,r,Mm,Im,Wn).exists((function(e){return bx(t,e),!0}))},Fx=function(t,e){var n=e?1:-1,r=t.selection.getRng();return wx(t,n,r,Mm,Im,Wn).exists((function(e){return bx(t,e),!0}))},Lx=function(t,e){return Sx(t,e,e?Im:Mm)},Vx=function(t,e,n,r,o){var i,u,a=Ma(Ae(n),"td,th,caption").map((function(t){return t.dom})),c=G(function(t,e){return J(e,(function(e){var n,r,o=(r=-1,{left:(n=Ka(e.getBoundingClientRect())).left-r,top:n.top-r,right:n.right+-2,bottom:n.bottom+-2,width:n.width+r,height:n.height+r});return[{x:o.left,y:t(o),cell:e},{x:o.right,y:t(o),cell:e}]}))}(t,a),(function(t){return e(t,o)}));return i=r,u=o,X(c,(function(t,e){return t.fold((function(){return S.some(e)}),(function(t){var n=Math.sqrt(Math.abs(t.x-i)+Math.abs(t.y-u)),r=Math.sqrt(Math.abs(e.x-i)+Math.abs(e.y-u));return S.some(r<n?e:t)}))}),S.none()).map((function(t){return t.cell}))},Hx=l(Vx,(function(t){return t.bottom}),(function(t,e){return t.y<e})),zx=l(Vx,(function(t){return t.top}),(function(t,e){return t.y>e})),jx=function(t,e,n){var r,o,i,u,a=t(e,n);return(u=a).breakType===Uv.Wrap&&0===u.positions.length||!Vn(n.getNode())&&(i=a).breakType===Uv.Br&&1===i.positions.length?(r=t,o=e,!a.breakAt.exists((function(t){return r(o,t).breakAt.isSome()}))):a.breakAt.isNone()},Ux=l(jx,Zy),Wx=l(jx,tx),qx=function(t,e,n,r){var o,i,u,a,c=t.selection.getRng(),s=e?1:-1;return!(!ks()||(o=e,i=c,u=n,a=_c.fromRangeStart(i),!pf(!o,u).exists((function(t){return t.isEqual(a)})))||(Ob(s,t,n,!e,!1).each((function(e){bx(t,e)})),0))},Gx=function(t,e,n){var r=function(t,e){var n=e.getNode(t);return En(n)&&"TABLE"===n.nodeName?S.some(n):S.none()}(!!e,n),o=!1===e;r.fold((function(){return bx(t,n.toRange())}),(function(r){return pf(o,t.getBody()).filter((function(t){return t.isEqual(n)})).fold((function(){return bx(t,n.toRange())}),(function(o){return i=e,a=r,c=n,void((s=Jc(u=t))?u.undoManager.transact((function(){var t=Ee(s);Xn(t,Qc(u)),fn(t,Ee("br")),(i?cn:an)(Ae(a),t);var e=u.dom.createRng();e.setStart(t.dom,0),e.setEnd(t.dom,0),bx(u,e)})):bx(u,c.toRange()));var i,u,a,c,s}))}))},$x=function(t,e,n,r){var o,i,u,a,c,s,f=t.selection.getRng(),l=_c.fromRangeStart(f),d=t.getBody();if(!e&&Ux(r,l)){var m=(a=d,function(t,e){return nt(e.getClientRects()).bind((function(e){return Hx(t,e.left,e.top)})).bind((function(t){return Qy(yf(n=t).map((function(t){return Zy(n,t).positions.concat(t)})).getOr([]),e);var n}))}(c=n,s=l).orThunk((function(){return nt(s.getClientRects()).bind((function(t){return Jy(ex(a,_c.before(c)),t.left)}))})).getOr(_c.before(c)));return Gx(t,e,m),!0}return!(!e||!Wx(r,l))&&(o=d,m=function(t,e){return rt(e.getClientRects()).bind((function(e){return zx(t,e.left,e.top)})).bind((function(t){return Qy(bf(n=t).map((function(t){return[t].concat(tx(n,t).positions)})).getOr([]),e);var n}))}(i=n,u=l).orThunk((function(){return nt(u.getClientRects()).bind((function(t){return Jy(nx(o,_c.after(i)),t.left)}))})).getOr(_c.after(i)),Gx(t,e,m),!0)},Xx=function(t,e,n){return S.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind((function(r){return S.from(t.dom.getParent(r,"table")).map((function(o){return n(t,e,o,r)}))})).getOr(!1)},Yx=function(t,e){return Xx(t,e,qx)},Kx=function(t,e){return Xx(t,e,$x)},Jx=function(t,e){var n,r,o=e,i=t.dom,u=t.schema.getMoveCaretBeforeOnEnterElements();if(e){!/^(LI|DT|DD)$/.test(e.nodeName)||(r=function(t){for(;t;){if(1===t.nodeType||3===t.nodeType&&t.data&&/[\r\n\s]/.test(t.data))return t;t=t.nextSibling}}(e.firstChild))&&/^(UL|OL|DL)$/.test(r.nodeName)&&e.insertBefore(i.doc.createTextNode(no),e.firstChild);var a=i.createRng();if(e.normalize(),e.hasChildNodes()){for(var c=new Ur(e,e);n=c.current();){if(In(n)){a.setStart(n,0),a.setEnd(n,0);break}if(u[n.nodeName.toLowerCase()]){a.setStartBefore(n),a.setEndBefore(n);break}o=n,n=c.next()}n||(a.setStart(o,0),a.setEnd(o,0))}else Vn(e)?e.nextSibling&&i.isBlock(e.nextSibling)?(a.setStartBefore(e),a.setEndBefore(e)):(a.setStartAfter(e),a.setEndAfter(e)):(a.setStart(e,0),a.setEnd(e,0));t.selection.setRng(a),bd(t,a)}},Qx=function(t){return S.from(t.dom.getParent(t.selection.getStart(!0),t.dom.isBlock))},Zx=function(t,e){return t&&t.parentNode&&t.parentNode.nodeName===e},tw=function(t){return t&&/^(OL|UL|LI)$/.test(t.nodeName)},ew=function(t){var e=t.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:t},nw=function(t,e,n){for(var r=t[n?"firstChild":"lastChild"];r&&!En(r);)r=r[n?"nextSibling":"previousSibling"];return r===e},rw=function(t){t.innerHTML='<br data-mce-bogus="1">'},ow=function(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e},iw=function(t,e){return e&&t.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==t.getContentEditable(e)},uw=function(t,e,n){return!1===In(e)?n:t?1===n&&e.data.charAt(n-1)===ro?0:n:n===e.data.length-1&&e.data.charAt(n)===ro?e.data.length:n},aw=function(t,e){for(var n,r=t.getRoot(),o=e;o!==r&&"false"!==t.getContentEditable(o);)"true"===t.getContentEditable(o)&&(n=o),o=o.parentNode;return o!==r?n:r},cw=function(t,e){var n=Jc(t);n&&n.toLowerCase()===e.tagName.toLowerCase()&&function(t,e,n){var r=t.dom;S.from(n.style).map(r.parseStyle).each((function(t){var n=er(Ae(e)),o=Ot(Ot({},n),t);r.setStyles(e,o)}));var o=S.from(n.class).map((function(t){return t.split(/\s+/)})),i=S.from(e.className).map((function(t){return G(t.split(/\s+/),(function(t){return""!==t}))}));Xa(o,i,(function(t,n){var o=G(n,(function(e){return!z(t,e)})),i=_t(t,o);r.setAttrib(e,"class",i.join(" "))}));var u=["style","class"],a=mt(n,(function(t,e){return!z(u,e)}));r.setAttribs(e,a)}(t,e,Qc(t))},sw=function(t,e){var n,r,o,i,u,a,c,s,f,l=t.dom,d=t.schema,m=d.getNonEmptyElements(),g=t.selection.getRng(),p=function(e){var n,o=r,u=d.getTextInlineElements(),a=e||"TABLE"===s||"HR"===s?l.create(e||S):i.cloneNode(!1),c=a;if(!1===t.getParam("keep_styles",!0))l.setAttrib(a,"style",null),l.setAttrib(a,"class",null);else do{if(u[o.nodeName]){if(wf(o)||Bf(o))continue;n=o.cloneNode(!1),l.setAttrib(n,"id",""),a.hasChildNodes()?n.appendChild(a.firstChild):c=n,a.appendChild(n)}}while((o=o.parentNode)&&o!==k);return cw(t,a),rw(c),a},h=function(t){var e,n,u=uw(t,r,o);if(In(r)&&(t?0<u:u<r.nodeValue.length))return!1;if(r.parentNode===i&&f&&!t)return!0;if(t&&En(r)&&r===i.firstChild)return!0;if(ow(r,"TABLE")||ow(r,"HR"))return f&&!t||!f&&t;var a=new Ur(r,i);for(In(r)&&(t&&0===u?a.prev():t||u!==r.nodeValue.length||a.next());e=a.current();){if(En(e)){if(!e.getAttribute("data-mce-bogus")&&(n=e.nodeName.toLowerCase(),m[n]&&"br"!==n))return!1}else if(In(e)&&!Bo(e.nodeValue))return!1;t?a.prev():a.next()}return!0},v=function(){u=/^(H[1-6]|PRE|FIGURE)$/.test(s)&&"HGROUP"!==x?p(S):p(),t.getParam("end_container_on_empty_block",!1)&&iw(l,c)&&l.isEmpty(i)?u=l.split(c,i):l.insertAfter(u,i),Jx(t,u)};Wl(l,g).each((function(t){g.setStart(t.startContainer,t.startOffset),g.setEnd(t.endContainer,t.endOffset)})),r=g.startContainer,o=g.startOffset,S=Jc(t);var b=!(!e||!e.shiftKey),y=!(!e||!e.ctrlKey);En(r)&&r.hasChildNodes()&&(f=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=f&&In(r)?r.nodeValue.length:0);var x,w,C,S,k=aw(l,r);k&&((S&&!b||!S&&b)&&(r=function(t,e,n,r,o){var i,u,a,c,s,f,l=e||"P",d=t.dom,m=aw(d,r),g=d.getParent(r,d.isBlock);if(!g||!iw(d,g)){if(s=(g=g||m)===t.getBody()||(f=g)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?g.nodeName.toLowerCase():g.parentNode.nodeName.toLowerCase(),!g.hasChildNodes())return i=d.create(l),cw(t,i),g.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(a=r;a.parentNode!==g;)a=a.parentNode;for(;a&&!d.isBlock(a);)a=(u=a).previousSibling;if(u&&t.schema.isValidChild(s,l.toLowerCase())){for(i=d.create(l),cw(t,i),u.parentNode.insertBefore(i,u),a=u;a&&!d.isBlock(a);)c=a.nextSibling,i.appendChild(a),a=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(t,S,g,r,o)),i=l.getParent(r,l.isBlock),c=i?l.getParent(i.parentNode,l.isBlock):null,s=i?i.nodeName.toUpperCase():"","LI"!==(x=c?c.nodeName.toUpperCase():"")||y||(c=(i=c).parentNode,s=x),/^(LI|DT|DD)$/.test(s)&&l.isEmpty(i)?function(t,e,n,r,o){var i,u,a,c,s,f=t.dom,l=t.selection.getRng();n!==t.getBody()&&(tw(i=n)&&tw(i.parentNode)&&(o="LI"),u=o?e(o):f.create("BR"),nw(n,r,!0)&&nw(n,r,!1)?Zx(n,"LI")?f.insertAfter(u,ew(n)):f.replace(u,n):nw(n,r,!0)?Zx(n,"LI")?(f.insertAfter(u,ew(n)),u.appendChild(f.doc.createTextNode(" ")),u.appendChild(n)):n.parentNode.insertBefore(u,n):nw(n,r,!1)?f.insertAfter(u,ew(n)):(n=ew(n),(a=l.cloneRange()).setStartAfter(r),a.setEndAfter(n),c=a.extractContents(),"LI"===o&&(s=c).firstChild&&"LI"===s.firstChild.nodeName?(u=c.firstChild,f.insertAfter(c,n)):(f.insertAfter(c,n),f.insertAfter(u,n))),f.remove(r),Jx(t,u))}(t,p,c,i,S):S&&i===t.getBody()||(S=S||"P",co(i)?(u=vo(i),l.isEmpty(i)&&rw(i),cw(t,u),Jx(t,u)):h()?v():h(!0)?(u=i.parentNode.insertBefore(p(),i),Jx(t,ow(i,"HR")?u:i)):((C=(w=g).cloneRange()).setStart(w.startContainer,uw(!0,w.startContainer,w.startOffset)),C.setEnd(w.endContainer,uw(!1,w.endContainer,w.endOffset)),(n=C.cloneRange()).setEndAfter(i),a=n.extractContents(),W(Ra(Ae(a),Ve),(function(t){var e=t.dom;e.nodeValue=io(e.nodeValue)})),function(t){for(;In(t)&&(t.nodeValue=t.nodeValue.replace(/^[\r\n]+/,"")),t=t.firstChild;);}(a),u=a.firstChild,l.insertAfter(a,i),function(t,e,n){var r,o,i,u=n,a=[];if(u){for(;u=u.firstChild;){if(t.isBlock(u))return;En(u)&&!e[u.nodeName.toLowerCase()]&&a.push(u)}for(r=a.length;r--;)!(u=a[r]).hasChildNodes()||u.firstChild===u.lastChild&&""===u.firstChild.nodeValue?t.remove(u):(o=t,(i=u)&&"A"===i.nodeName&&o.isEmpty(i)&&t.remove(u))}}(l,m,u),function(t,e){e.normalize();var n=e.lastChild;n&&!/^(left|right)$/gi.test(t.getStyle(n,"float",!0))||t.add(e,"br")}(l,i),l.isEmpty(i)&&rw(i),u.normalize(),l.isEmpty(u)?(l.remove(u),v()):(cw(t,u),Jx(t,u))),l.setAttrib(u,"id",""),t.fire("NewBlock",{newBlock:u})))},fw=function(t,e,n){var r=t.create("span",{},"&nbsp;");n.parentNode.insertBefore(r,n),e.scrollIntoView(r),t.remove(r)},lw=function(t,e,n,r){var o=t.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),e.setRng(o)},dw=function(t,e){var n=Ee("br");an(Ae(e),n),t.undoManager.add()},mw=function(t,e){gw(t.getBody(),e)||cn(Ae(e),Ee("br"));var n=Ee("br");cn(Ae(e),n),fw(t.dom,t.selection,n.dom),lw(t.dom,t.selection,n.dom,!1),t.undoManager.add()},gw=function(t,e){return n=_c.after(e),!!Vn(n.getNode())||hf(t,_c.after(e)).map((function(t){return Vn(t.getNode())})).getOr(!1);var n},pw=function(t){return t&&"A"===t.nodeName&&"href"in t},hw=function(t){return t.fold(b,pw,pw,b)},vw=function(t,e){e.fold(a,l(dw,t),l(mw,t),a)},bw=function(t,e){var n,r,o,i=(r=l(rb,n=t),o=_c.fromRangeStart(n.selection.getRng()),ay(r,n.getBody(),o).filter(hw));i.isSome()?i.each(l(vw,t)):function(t,e){var n,r,o=t.selection,i=t.dom,u=o.getRng();Wl(i,u).each((function(t){u.setStart(t.startContainer,t.startOffset),u.setEnd(t.endContainer,t.endOffset)}));var a,c=u.startOffset,s=u.startContainer;1===s.nodeType&&s.hasChildNodes()&&(a=c>s.childNodes.length-1,s=s.childNodes[Math.min(c,s.childNodes.length-1)]||s,c=a&&3===s.nodeType?s.nodeValue.length:0);var f=i.getParent(s,i.isBlock),l=f?i.getParent(f.parentNode,i.isBlock):null,d=l?l.nodeName.toUpperCase():"",m=!(!e||!e.ctrlKey);"LI"!==d||m||(f=l),s&&3===s.nodeType&&c>=s.nodeValue.length&&!function(t,e,n){for(var r,o=new Ur(e,n),i=t.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0<r.length)return!0}(t.schema,s,f)&&(n=i.create("br"),u.insertNode(n),u.setStartAfter(n),u.setEndAfter(n),r=!0),n=i.create("br"),Tc(i,u,n),fw(i,o,n),lw(i,o,n,r),t.undoManager.add()}(t,e)},yw=function(t,e){return Qx(t).filter((function(t){return 0<e.length&&Ne(Ae(t),e)})).isSome()},xw=hr([{br:[]},{block:[]},{none:[]}]),ww=function(t,e){return yw(n=t,n.getParam("no_newline_selector",""));var n},Cw=function(t){return function(e,n){return""===Jc(e)===t}},Sw=function(t){return function(e,n){return Qx(e).filter((function(t){return Qr(Ae(t))})).isSome()===t}},kw=function(t,e){return function(n,r){return Qx(n).fold(s(""),(function(t){return t.nodeName.toUpperCase()}))===t.toUpperCase()===e}},Ow=function(t){return kw("pre",t)},_w=function(t){return function(e,n){return e.getParam("br_in_pre",!0)===t}},Ew=function(t,e){return yw(n=t,n.getParam("br_newline_selector",".mce-toc h2,figcaption,caption"));var n},Tw=function(t,e){return e},Aw=function(t){var e=Jc(t),n=function(t,e){for(var n,r=t.getRoot(),o=e;o!==r&&"false"!==t.getContentEditable(o);)"true"===t.getContentEditable(o)&&(n=o),o=o.parentNode;return o!==r?n:r}(t.dom,t.selection.getStart());return n&&t.schema.isValidChild(n.nodeName,e||"P")},Bw=function(t,e){return function(n,r){return X(t,(function(t,e){return t&&e(n,r)}),!0)?S.some(e):S.none()}},Nw=function(t,e){(function(t,e){return Jb([Bw([ww],xw.none()),Bw([kw("summary",!0)],xw.br()),Bw([Ow(!0),_w(!1),Tw],xw.br()),Bw([Ow(!0),_w(!1)],xw.block()),Bw([Ow(!0),_w(!0),Tw],xw.block()),Bw([Ow(!0),_w(!0)],xw.br()),Bw([Sw(!0),Tw],xw.br()),Bw([Sw(!0)],xw.block()),Bw([Cw(!0),Tw,Aw],xw.block()),Bw([Cw(!0)],xw.br()),Bw([Ew],xw.br()),Bw([Cw(!1),Tw],xw.br()),Bw([Aw],xw.block())],[t,!(!e||!e.shiftKey)]).getOr(xw.none())})(t,e).fold((function(){bw(t,e)}),(function(){sw(t,e)}),a)},Dw=fe().browser,Rw=function(t,e){var n=e.container(),r=e.offset();return In(n)?(n.insertData(r,t),S.some(Sc(n,r+t.length))):Gs(e).map((function(n){var r=Te(t);return(e.isAtEnd()?cn:an)(n,r),Sc(r.dom,t.length)}))},Mw=l(Rw,no),Iw=l(Rw," "),Pw=function(t,e){return function(n){return r=t,(!cg(o=n)&&(function(t,e){return r=e,vf(t.dom,r).isNone()||(n=e,hf(t.dom,n).isNone())||Xm(t,e)||Ym(t,e)||eg(t,e)||tg(t,e);var n,r}(r,o)||ug(r,o)||ag(r,o))?Mw:Iw)(e);var r,o}},Fw=function(t){var e,n,r=_c.fromRangeStart(t.selection.getRng()),o=Ae(t.getBody());if(t.selection.isCollapsed()){var i=l(rb,t),u=_c.fromRangeStart(t.selection.getRng());return ay(i,t.getBody(),u).bind((n=o,function(t){return t.fold((function(t){return vf(n.dom,_c.before(t))}),(function(t){return bf(t)}),(function(t){return yf(t)}),(function(t){return hf(n.dom,_c.after(t))}))})).bind(Pw(o,r)).exists((e=t,function(t){return e.selection.setRng(t.toRange()),e.nodeChanged(),!0}))}return!1},Lw=function(t){var e,n=Cy(t);return(e=t).on("keyup compositionstart",l(qy,e)),function(t,e){t.on("keydown",(function(n){var r,o,i,u;!1===n.isDefaultPrevented()&&(r=t,o=e,i=n,u=fe().os,Ix([{keyCode:Rl.RIGHT,action:Mx(_x,r,!0)},{keyCode:Rl.LEFT,action:Mx(_x,r,!1)},{keyCode:Rl.UP,action:Mx(Ex,r,!1)},{keyCode:Rl.DOWN,action:Mx(Ex,r,!0)},{keyCode:Rl.RIGHT,action:Mx(Yx,r,!0)},{keyCode:Rl.LEFT,action:Mx(Yx,r,!1)},{keyCode:Rl.UP,action:Mx(Kx,r,!1)},{keyCode:Rl.DOWN,action:Mx(Kx,r,!0)},{keyCode:Rl.RIGHT,action:Mx(Px,r,!0)},{keyCode:Rl.LEFT,action:Mx(Px,r,!1)},{keyCode:Rl.UP,action:Mx(Fx,r,!1)},{keyCode:Rl.DOWN,action:Mx(Fx,r,!0)},{keyCode:Rl.RIGHT,action:Mx(xy,r,o,!0)},{keyCode:Rl.LEFT,action:Mx(xy,r,o,!1)},{keyCode:Rl.RIGHT,ctrlKey:!u.isOSX(),altKey:u.isOSX(),action:Mx(Sy,r,o)},{keyCode:Rl.LEFT,ctrlKey:!u.isOSX(),altKey:u.isOSX(),action:Mx(ky,r,o)},{keyCode:Rl.UP,action:Mx(Rx,r,!1)},{keyCode:Rl.DOWN,action:Mx(Rx,r,!0)}],i).each((function(t){i.preventDefault()})))}))}(t,n),function(t,e){t.on("keydown",(function(n){var r,o,i;!1===n.isDefaultPrevented()&&(r=t,o=e,i=n,Ix([{keyCode:Rl.BACKSPACE,action:Mx(Vy,r,!1)},{keyCode:Rl.BACKSPACE,action:Mx(Vb,r,!1)},{keyCode:Rl.DELETE,action:Mx(Vb,r,!0)},{keyCode:Rl.BACKSPACE,action:Mx(Db,r,!1)},{keyCode:Rl.DELETE,action:Mx(Db,r,!0)},{keyCode:Rl.BACKSPACE,action:Mx(Ey,r,o,!1)},{keyCode:Rl.DELETE,action:Mx(Ey,r,o,!0)},{keyCode:Rl.BACKSPACE,action:Mx(Jg,r,!1)},{keyCode:Rl.DELETE,action:Mx(Jg,r,!0)},{keyCode:Rl.BACKSPACE,action:Mx(Hb,r,!1)},{keyCode:Rl.DELETE,action:Mx(Hb,r,!0)},{keyCode:Rl.BACKSPACE,action:Mx(Dy,r,!1)},{keyCode:Rl.DELETE,action:Mx(Dy,r,!0)},{keyCode:Rl.BACKSPACE,action:Mx(Cb,r,!1)},{keyCode:Rl.DELETE,action:Mx(Cb,r,!0)},{keyCode:Rl.BACKSPACE,action:Mx(yb,r,!1)},{keyCode:Rl.DELETE,action:Mx(yb,r,!0)},{keyCode:Rl.BACKSPACE,action:Mx(By,r,!1)},{keyCode:Rl.DELETE,action:Mx(By,r,!0)}],i).each((function(t){i.preventDefault()})))})),t.on("keyup",(function(e){var n,r;!1===e.isDefaultPrevented()&&(n=t,r=e,Ix([{keyCode:Rl.BACKSPACE,action:Mx(Lb,n)},{keyCode:Rl.DELETE,action:Mx(Lb,n)}],r))}))}(t,n),function(t){t.on("keydown",(function(e){var n,r,o;e.keyCode===Rl.ENTER&&(n=t,(r=e).isDefaultPrevented()||(r.preventDefault(),(o=n.undoManager).typing&&(o.typing=!1,o.add()),n.undoManager.transact((function(){!1===n.selection.isCollapsed()&&n.execCommand("Delete"),Nw(n,r)}))))}))}(t),function(t){t.on("keydown",(function(e){var n,r;!1===e.isDefaultPrevented()&&(n=t,r=e,Ix([{keyCode:Rl.SPACEBAR,action:Mx(Fw,n)}],r).each((function(t){r.preventDefault()})))}))}(t),function(t){var e,n;e=t,n=Ea((function(){e.composing||pg(e)}),0),Dw.isIE()&&(e.on("keypress",(function(t){n.throttle()})),e.on("remove",(function(t){n.cancel()}))),t.on("input",(function(e){!1===e.isComposing&&pg(t)}))}(t),function(t){t.on("keydown",(function(e){var n,r;!1===e.isDefaultPrevented()&&(n=t,r=e,Ix([{keyCode:Rl.END,action:Mx(Tx,n,!0)},{keyCode:Rl.HOME,action:Mx(Tx,n,!1)},{keyCode:Rl.END,action:Mx(Lx,n,!0)},{keyCode:Rl.HOME,action:Mx(Lx,n,!1)}],r).each((function(t){r.preventDefault()})))}))}(t),n},Vw=(Hw.prototype.nodeChanged=function(t){var e,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(e=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(e,r)||(e=r),n=[],this.editor.dom.getParent(e,(function(t){return t===r||void n.push(t)})),(t=t||{}).element=e,t.parents=n,this.editor.fire("NodeChange",t))},Hw.prototype.isSameElementPath=function(t){var e,n=this.editor.$(t).parentsUntil(this.editor.getBody()).add(t);if(n.length===this.lastPath.length){for(e=n.length;0<=e&&n[e]===this.lastPath[e];e--);if(-1===e)return this.lastPath=n,!0}return this.lastPath=n,!1},Hw);function Hw(t){var e;this.lastPath=[],this.editor=t;var n=this;"onselectionchange"in t.getDoc()||t.on("NodeChange click mouseup keyup focus",(function(n){var r=t.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&Ll(o,e)||t.fire("SelectionChange"),e=o})),t.on("contextmenu",(function(){t.fire("SelectionChange")})),t.on("SelectionChange",(function(){var e=t.selection.getStart(!0);!e||!ye.range&&t.selection.isCollapsed()||xl(t)&&!n.isSameElementPath(e)&&t.dom.isChildOf(e,t.getBody())&&t.nodeChanged({selectionChange:!0})})),t.on("mouseup",(function(e){!e.isDefaultPrevented()&&xl(t)&&("IMG"===t.selection.getNode().nodeName?Vr.setEditorTimeout(t,(function(){t.nodeChanged()})):t.nodeChanged())}))}var zw=function(t){return En(t)&&Kr(Ae(t))},jw=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:e.top+o.pageYOffset-r.clientTop,left:e.left+o.pageXOffset-r.clientLeft}},Uw=function(t,e){return n=(a=t).inline?jw(a.getBody()):{left:0,top:0},u=(i=t).getBody(),r=i.inline?{left:u.scrollLeft,top:u.scrollTop}:{left:0,top:0},{pageX:(o=function(t,e){if(e.target.ownerDocument===t.getDoc())return{left:e.pageX,top:e.pageY};var n,r,o,i,u,a=jw(t.getContentAreaContainer()),c=(r=(n=t).getBody(),o=n.getDoc().documentElement,i={left:r.scrollLeft,top:r.scrollTop},u={left:r.scrollLeft||o.scrollLeft,top:r.scrollTop||o.scrollTop},n.inline?i:u);return{left:e.pageX-a.left+c.left,top:e.pageY-a.top+c.top}}(t,e)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o,i,u,a},Ww=jn,qw=zn,Gw=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},$w=function(t){t.on((function(t){Gw(t.ghost)})),t.clear()},Xw=function(t){var e,n,r,o=(e=ya(S.none()),{clear:function(){return e.set(S.none())},set:function(t){return e.set(S.some(t))},isSet:function(){return e.get().isSome()},on:function(t){return e.get().each(t)}}),i=da.DOM,u=document,a=function(t,e){return function(n){var r,o,i,u,a,c;0===n.button&&(r=Y(e.dom.getParents(n.target),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(t[n](e))return!0;return!1}}(Ww,qw)).getOr(null),a=e.getBody(),Ww(c=r)&&c!==a&&(o=e.dom.getPos(r),i=e.getBody(),u=e.getDoc().documentElement,t.set({element:r,dragging:!1,screenX:n.screenX,screenY:n.screenY,maxX:(e.inline?i.scrollWidth:u.offsetWidth)-2,maxY:(e.inline?i.scrollHeight:u.offsetHeight)-2,relX:n.pageX-o.x,relY:n.pageY-o.y,width:r.offsetWidth,height:r.offsetHeight,ghost:function(t,e,n,r){var o=t.dom,i=e.cloneNode(!0);o.setStyles(i,{width:n,height:r}),o.setAttrib(i,"data-mce-selected",null);var u=o.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return o.setStyles(u,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),o.setStyles(i,{margin:0,boxSizing:"border-box"}),u.appendChild(i),u}(e,r,r.offsetWidth,r.offsetHeight)})))}}(o,t),c=function(t,e){var n=Vr.throttle((function(t,n){e._selectionOverrides.hideFakeCaret(),e.selection.placeCaretAt(t,n)}),0);return e.on("remove",n.stop),function(r){return t.on((function(t){var o,i,u,a,c,s,f,l,d,m,g,p,h,v=Math.max(Math.abs(r.screenX-t.screenX),Math.abs(r.screenY-t.screenY));if(!t.dragging&&10<v){if(e.fire("dragstart",{target:t.element}).isDefaultPrevented())return;t.dragging=!0,e.focus()}t.dragging&&(p=t,o={pageX:(h=Uw(e,r)).pageX-p.relX,pageY:h.pageY+5},m=t.ghost,g=e.getBody(),m.parentNode!==g&&g.appendChild(m),i=t.ghost,u=o,a=t.width,c=t.height,s=t.maxX,f=t.maxY,d=l=0,i.style.left=u.pageX+"px",i.style.top=u.pageY+"px",u.pageX+a>s&&(l=u.pageX+a-s),u.pageY+c>f&&(d=u.pageY+c-f),i.style.width=a-l+"px",i.style.height=c-d+"px",n(r.clientX,r.clientY))}))}}(o,t),s=function(t,e){return function(n){t.on((function(t){var r,o,i,u,a,c;t.dragging&&((u=3===(c=(i=e).selection.getSel().getRangeAt(0).startContainer).nodeType?c.parentNode:c)===(a=t.element)||i.dom.isChildOf(u,a)||Ww(u)||((o=t.element.cloneNode(!0)).removeAttribute("data-mce-selected"),r=o,e.fire("drop",{clientX:n.clientX,clientY:n.clientY}).isDefaultPrevented()||e.undoManager.transact((function(){Gw(t.element),e.insertContent(e.dom.getOuterHTML(r)),e._selectionOverrides.hideFakeCaret()}))))})),$w(t)}}(o,t),f=(n=o,function(){n.on((function(t){t.dragging&&r.fire("dragend")})),$w(n)});(r=t).on("mousedown",a),t.on("mousemove",c),t.on("mouseup",s),i.bind(u,"mousemove",c),i.bind(u,"mouseup",f),t.on("remove",(function(){i.unbind(u,"mousemove",c),i.unbind(u,"mouseup",f)}))},Yw=zn,Kw=jn,Jw=function(t,e){return Nl(t.getBody(),e)},Qw=function(t){var e,n=t.selection,r=t.dom,o=r.isBlock,i=t.getBody(),u=Ss(t,i,o,(function(){return jd(t)})),a="sel-"+r.uniqueId(),c="data-mce-selected",s=function(t){return t!==i&&(Kw(t)||Wn(t))&&r.isChildOf(t,i)},f=function(t){t&&n.setRng(t)},d=n.getRng,m=function(e,r,o,i){return void 0===i&&(i=!0),t.fire("ShowCaret",{target:r,direction:e,before:o}).isDefaultPrevented()?null:(i&&n.scrollIntoView(r,-1===e),u.show(o,r))},g=function(t){return fo(t)||po(t)||ho(t)},p=function(t){return g(t.startContainer)||g(t.endContainer)},h=function(o){var i=o.cloneNode(!0),u=t.fire("ObjectSelected",{target:o,targetClone:i});if(u.isDefaultPrevented())return null;var s=function(e,o,i){var u=t.$,c=_r(Ae(t.getBody()),"#"+a).fold((function(){return u([])}),(function(t){return u([t.dom])}));0===c.length&&(c=u('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",a)).appendTo(t.getBody());var s=r.createRng();o===i&&ye.ie?(c.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(o),s.setStartAfter(c[0].firstChild.firstChild),s.setEndAfter(o)):(c.empty().append(no).append(o).append(no),s.setStart(c[0].firstChild,1),s.setEnd(c[0].lastChild,0)),c.css({top:r.getPos(e,t.getBody()).y}),c[0].focus();var f=n.getSel();return f.removeAllRanges(),f.addRange(s),s}(o,u.targetClone,i),f=Ae(o);return W(Ma(Ae(t.getBody()),"*[data-mce-selected]"),(function(t){Re(f,t)||Jn(t,c)})),r.getAttrib(o,c)||o.setAttribute(c,"1"),e=o,y(),s},v=function(t,e){if(!t)return null;if(t.collapsed){if(!p(t)){var n=e?1:-1,o=qs(n,i,t),u=o.getNode(!e);if(_s(u))return m(n,u,!!e&&!o.isAtEnd(),!1);var a=o.getNode(e);if(_s(a))return m(n,a,!e&&!o.isAtEnd(),!1)}return null}var c=t.startContainer,f=t.startOffset,l=t.endOffset;if(3===c.nodeType&&0===f&&Kw(c.parentNode)&&(c=c.parentNode,f=r.nodeIndex(c),c=c.parentNode),1!==c.nodeType)return null;if(l===f+1&&c===t.endContainer){var d=c.childNodes[f];if(s(d))return h(d)}return null},b=function(){e&&e.removeAttribute(c),_r(Ae(t.getBody()),"#"+a).each(mn),e=null},y=function(){u.hide()};return ye.ceFalse&&function(){t.on("mouseup",(function(e){var n=d();n.collapsed&&Tv(t,e.clientX,e.clientY)&&Eb(t,n,!1).each(f)})),t.on("click",(function(e){var o=Jw(t,e.target);o&&(Kw(o)&&(e.preventDefault(),t.focus()),Yw(o)&&r.isChildOf(o,n.getNode())&&b())})),t.on("blur NewBlock",b),t.on("ResizeWindow FullscreenStateChanged",u.reposition);var c,g,h,x=function(e,n){var i,u,a=r.getParent(e,o),c=r.getParent(n,o);return!(!a||e===c||!r.isChildOf(a,c)||!1!==Kw(Jw(t,a)))||a&&(i=a,u=c,!(r.getParent(i,o)===r.getParent(u,o)))&&function(t){var e=cf(t);if(!t.firstChild)return!1;var n,r=_c.before(t.firstChild),o=e.next(r);return o&&!(Lm(n=o)||Vm(n)||Mm(n)||Im(n))}(a)};t.on("tap",(function(e){var n=e.target,r=Jw(t,n);Kw(r)?(e.preventDefault(),_b(t,r).each(v)):s(n)&&_b(t,n).each(v)}),!0),t.on("mousedown",(function(e){var o,u,a,c=e.target;c!==i&&"HTML"!==c.nodeName&&!r.isChildOf(c,i)||!1===Tv(t,e.clientX,e.clientY)||((o=Jw(t,c))?Kw(o)?(e.preventDefault(),_b(t,o).each(v)):(b(),Yw(o)&&e.shiftKey||Dl(e.clientX,e.clientY,n.getRng())||(y(),n.placeCaretAt(e.clientX,e.clientY))):s(c)?_b(t,c).each(v):!1===_s(c)&&(b(),y(),(u=function(t,e,n){var r,o,i=ox(G(ot(t.getElementsByTagName("*")),_s)),u=G(i,l(px,n));if(a=hx(u,e)){var a,c=!Dn(a.node)&&!Wn(a.node);if((a=hx(function(t,e,n){void 0===n&&(n=!0);var r=[],o=function(t,n){var o=G(ox([n]),(function(n){return!t(n,e)}));return r=r.concat(o),0===o.length};return r.push(e),vx(Gy.Up,t,l(o,Za),e.node,n),vx(Gy.Down,t,l(o,tc),e.node,n),r}(t,a,c),e))&&_s(a.node))return o=e,{node:(r=a).node,before:dx(r,o)<mx(r,o)}}return null}(i,e.clientX,e.clientY))&&(x(c,u.node)||(e.preventDefault(),a=m(1,u.node,u.before,!1),t.getBody().focus(),f(a)))))})),t.on("keypress",(function(t){Rl.modifierPressed(t)||Kw(n.getNode())&&t.preventDefault()})),t.on("GetSelectionRange",(function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);(n=n.cloneRange()).selectNode(e),t.range=n}})),t.on("SetSelectionRange",(function(e){e.range=function(e){var n=t.schema.getShortEndedElements(),o=r.createRng(),i=e.startContainer,u=e.startOffset,a=e.endContainer,c=e.endOffset;return pt(n,i.nodeName.toLowerCase())?0===u?o.setStartBefore(i):o.setStartAfter(i):o.setStart(i,u),pt(n,a.nodeName.toLowerCase())?0===c?o.setEndBefore(a):o.setEndAfter(a):o.setEnd(a,c),o}(e.range);var n=v(e.range,e.forward);n&&(e.range=n)})),t.on("AfterSetSelectionRange",(function(t){var e,n=t.range,o=n.startContainer.parentNode;p(n)||"mcepastebin"===o.id||y(),e=o,r.hasClass(e,"mce-offscreen-selection")||b()})),t.on("copy",(function(t){var e,n,o=t.clipboardData;t.isDefaultPrevented()||!t.clipboardData||ye.ie||(e=(n=r.get(a))?n.getElementsByTagName("*")[0]:n)&&(t.preventDefault(),o.clearData(),o.setData("text/html",e.outerHTML),o.setData("text/plain",e.outerText||e.innerText))})),function(t){var e,n,r,o,i;Xw(t),(e=t).on("drop",(function(t){var n=void 0!==t.clientX?e.getDoc().elementFromPoint(t.clientX,t.clientY):null;!Ww(n)&&"false"!==e.dom.getContentEditableParent(n)||t.preventDefault()})),t.getParam("block_unsupported_drop",!0,"boolean")&&(r=function(t){var e;t.defaultPrevented||(e=t.dataTransfer)&&(z(e.types,"Files")||0<e.files.length)&&(t.preventDefault(),"drop"===t.type&&Mv(n,"Dropped file type is not supported"))},o=function(t){Fd(n,t.target)&&r(t)},i=function(){var t=da.DOM,e=n.dom,i=document,u=n.inline?n.getBody():n.getDoc(),a=["drop","dragover"];W(a,(function(n){t.bind(i,n,o),e.bind(u,n,r)})),n.on("remove",(function(){W(a,(function(n){t.unbind(i,n,o),e.unbind(u,n,r)}))}))},(n=t).on("init",(function(){Vr.setEditorTimeout(n,i,0)})))}(t),g=Ea((function(){var t,e;c.removed||!c.getBody().contains(document.activeElement)||(t=c.selection.getRng()).collapsed&&(e=Tb(c,t,!1),c.selection.setRng(e))}),0),(c=t).on("focus",(function(){g.throttle()})),c.on("blur",(function(){g.cancel()})),(h=t).on("init",(function(){h.on("focusin",(function(t){var e,n,r=t.target;Wn(r)&&(e=Nl(h.getBody(),r),n=jn(e)?e:r,h.selection.getNode()!==n&&_b(h,n).each((function(t){return h.selection.setRng(t)})))}))}))}(),{showCaret:m,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(vo(t),f(d()),n.scrollIntoView(t))},hideFakeCaret:y,destroy:function(){u.destroy(),e=null}}},Zw=da.DOM,tC=function(t){return mt(t,(function(t){return!1===D(t)}))},eC=function(t){var e,n=t.settings,r=t.editorUpload.blobCache;return tC({allow_conditional_comments:n.allow_conditional_comments,allow_html_data_urls:n.allow_html_data_urls,allow_svg_data_urls:n.allow_svg_data_urls,allow_html_in_named_anchor:n.allow_html_in_named_anchor,allow_script_urls:n.allow_script_urls,allow_unsafe_link_target:n.allow_unsafe_link_target,convert_fonts_to_spans:n.convert_fonts_to_spans,fix_list_elements:n.fix_list_elements,font_size_legacy_values:n.font_size_legacy_values,forced_root_block:n.forced_root_block,forced_root_block_attrs:n.forced_root_block_attrs,padd_empty_with_br:n.padd_empty_with_br,preserve_cdata:n.preserve_cdata,remove_trailing_brs:n.remove_trailing_brs,inline_styles:n.inline_styles,root_name:(e=t).inline?e.getElement().nodeName.toLowerCase():void 0,validate:!0,blob_cache:r,images_dataimg_filter:n.images_dataimg_filter})},nC=function(t){var e;t.bindPendingEventDelegates(),t.initialized=!0,t.fire("Init"),t.focus(!0),function(t){var e=t.dom.getRoot();t.inline||xl(t)&&t.selection.getStart(!0)!==e||bf(e).each((function(e){var n,r,o,i,u=e.getNode(),a=Dn(u)?bf(u).getOr(e):e;ye.browser.isIE()?(n=t,r=a.toRange(),o=Ae(n.getBody()),i=(Ad(n)?S.from(r):S.none()).map(Bd).filter(Td(o)),n.bookmark=i.isSome()?i:n.bookmark):t.selection.setRng(a.toRange())}))}(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),(e=t).settings.auto_focus&&Vr.setEditorTimeout(e,(function(){var t=!0===e.settings.auto_focus?e:e.editorManager.get(e.settings.auto_focus);t.destroyed||t.focus()}),100)},rC=function(t,e){var n=t.settings,r=t.getDoc(),o=t.getBody();n.browser_spellcheck||n.gecko_spellcheck||(r.body.spellcheck=!1,Zw.setAttrib(o,"spellcheck","false")),t.quirks=function(t){var e,n,r,o=ke.each,i=Rl.BACKSPACE,u=Rl.DELETE,a=t.dom,c=t.selection,s=t.parser,f=ye.gecko,l=ye.ie,d=ye.webkit,m="data:text/mce-internal,",g=l?"Text":"URL",p=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},h=function(t){return t.isDefaultPrevented()},v=function(){t.shortcuts.add("meta+a",null,"SelectAll")},b=function(){t.on("keydown",(function(t){if(!h(t)&&t.keyCode===i&&c.isCollapsed()&&0===c.getRng().startOffset){var e=c.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))},y=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(11<ye.ie)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))};return t.on("keydown",(function(e){var n;if(!h(e)&&e.keyCode===Rl.BACKSPACE){var r=(n=c.getRng()).startContainer,o=n.startOffset,i=a.getRoot(),u=r;if(n.collapsed&&0===o){for(;u&&u.parentNode&&u.parentNode.firstChild===u&&u.parentNode!==i;)u=u.parentNode;"BLOCKQUOTE"===u.tagName&&(t.formatter.toggle("blockquote",null,u),(n=a.createRng()).setStart(r,0),n.setEnd(r,0),c.setRng(n))}}})),e=function(t){var e=a.create("body"),n=t.cloneContents();return e.appendChild(n),c.serializer.serialize(e,{format:"html"})},t.on("keydown",(function(n){var r,o,c,s,f,l=n.keyCode;if(!h(n)&&(l===u||l===i)){if(r=t.selection.isCollapsed(),o=t.getBody(),r&&!a.isEmpty(o))return;if(!r&&(c=t.selection.getRng(),s=e(c),(f=a.createRng()).selectNode(t.getBody()),s!==e(f)))return;n.preventDefault(),t.setContent(""),o.firstChild&&a.isBlock(o.firstChild)?t.selection.setCursorLocation(o.firstChild,0):t.selection.setCursorLocation(o,0),t.nodeChanged()}})),ye.windowsPhone||t.on("keyup focusin mouseup",(function(t){Rl.modifierPressed(t)||c.normalize()}),!0),d&&(t.inline||a.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;if(e.target===t.getDoc().documentElement)if(n=c.getRng(),t.getBody().focus(),"mousedown"===e.type){if(fo(n.startContainer))return;c.placeCaretAt(e.clientX,e.clientY)}else c.setRng(n)})),t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==a.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&a.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),c.select(n))})),Jc(t)&&t.on("init",(function(){p("DefaultParagraphSeparator",Jc(t))})),t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))})),b(),s.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),ye.iOS?(t.inline||t.on("keydown",(function(){document.activeElement===document.body&&t.getWin().focus()})),y(),t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):v()),11<=ye.ie&&(y(),b()),ye.ie&&(v(),p("AutoUrlDetect",!1),t.on("dragstart",(function(e){var n,r,o;(n=e).dataTransfer&&(t.selection.isCollapsed()&&"IMG"===n.target.tagName&&c.select(n.target),0<(r=t.selection.getContent()).length&&(o=m+escape(t.id)+","+escape(r),n.dataTransfer.setData(g,o)))})),t.on("drop",(function(e){var n,r,o,i,u;h(e)||(n=(i=e).dataTransfer&&(u=i.dataTransfer.getData(g))&&0<=u.indexOf(m)?(u=u.substr(m.length).split(","),{id:unescape(u[0]),html:unescape(u[1])}):null)&&n.id!==t.id&&(e.preventDefault(),r=Fl(e.x,e.y,t.getDoc()),c.setRng(r),o=n.html,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:o,internal:!0}):t.execCommand("mceInsertContent",!1,o))}))),f&&(t.on("keydown",(function(e){if(!h(e)&&e.keyCode===i){if(!t.getBody().getElementsByTagName("hr").length)return;if(c.isCollapsed()&&0===c.getRng().startOffset){var n=c.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return a.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(a.remove(r),e.preventDefault())}}})),Range.prototype.getClientRects||t.on("mousedown",(function(e){var n;h(e)||"HTML"!==e.target.nodeName||((n=t.getBody()).blur(),Vr.setEditorTimeout(t,(function(){n.focus()})))})),n=function(){var e=a.getAttribs(c.getStart().cloneNode(!1));return function(){var n=c.getStart();n!==t.getBody()&&(a.setAttrib(n,"style",null),o(e,(function(t){n.setAttributeNode(t.cloneNode(!0))})))}},r=function(){return!c.isCollapsed()&&a.getParent(c.getStart(),a.isBlock)!==a.getParent(c.getEnd(),a.isBlock)},t.on("keypress",(function(e){var o;if(!h(e)&&(8===e.keyCode||46===e.keyCode)&&r())return o=n(),t.getDoc().execCommand("delete",!1,null),o(),e.preventDefault(),!1})),a.bind(t.getDoc(),"cut",(function(e){var o;!h(e)&&r()&&(o=n(),Vr.setEditorTimeout(t,(function(){o()})))})),t.getParam("readonly")||t.on("BeforeExecCommand mousedown",(function(){p("StyleWithCSS",!1),p("enableInlineTableEditing",!1),os(t)||p("enableObjectResizing",!1)})),t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||o(a.select("a"),(function(t){var e=t.parentNode,n=a.getRoot();if(e.lastChild===t){for(;e&&!a.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}a.add(e,"br",{"data-mce-bogus":1})}}))})),t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),ye.mac&&t.on("keydown",(function(e){!Rl.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))})),b()),{refreshContentEditable:function(){},isHidden:function(){if(!f||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}}(t),t.fire("PostRender");var i,u,a,c,s,f,l,d,m,g,p,h=t.getParam("directionality",Sa.isRtl()?"rtl":void 0);void 0!==h&&(o.dir=h),n.protect&&t.on("BeforeSetContent",(function(t){ke.each(n.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),!1===e&&t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type})),0<t.contentStyles.length&&(i="",ke.each(t.contentStyles,(function(t){i+=t+"\r\n"})),t.dom.addStyle(i)),a=(u=t).contentCSS,f=function(){u.on("remove",(function(){return s.unloadAll(a)})),nC(u)},(s=(c=u).inline?c.ui.styleSheetLoader:c.dom.styleSheetLoader).loadAll(a,f,f),n.content_style&&(l=t,d=n.content_style,m=Ae(l.getBody()),g=on(rn(m)),p=Ee("style"),$n(p,"type","text/css"),fn(p,Te(d)),fn(g,p),l.on("remove",(function(){mn(p)})))},oC=function(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(Zw.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var i,u,a,c,s=t.getBody();s.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===Zw.getStyle(s,"position",!0)&&(s.style.position="relative"),s.contentEditable=t.getParam("content_editable_state",!0)),s.disabled=!1,t.editorUpload=jv(t),t.schema=ci(n),t.dom=da(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:t.getParam("content_css_cors",!1,"boolean"),referrerPolicy:es(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=((u=tv(eC(i=t),i.schema)).addAttributeFilter("src,href,style,tabindex",(function(t,e){for(var n,r,o=t.length,u=i.dom,a="data-mce-"+e;o--;)if((r=(n=t[o]).attr(e))&&!n.attr(a)){if(0===r.indexOf("data:")||0===r.indexOf("blob:"))continue;"style"===e?((r=u.serializeStyle(u.parseStyle(r),n.name)).length||(r=null),n.attr(a,r),n.attr(e,r)):"tabindex"===e?(n.attr(a,r),n.attr(e,null)):n.attr(a,i.convertURL(r,e,n.name))}})),u.addNodeFilter("script",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),i.settings.preserve_cdata&&u.addNodeFilter("#cdata",(function(t){for(var e=t.length;e--;){var n=t[e];n.type=8,n.name="#comment",n.value="[CDATA["+i.dom.encode(n.value)+"]]"}})),u.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(t){for(var e=t.length,n=i.schema.getNonEmptyElements();e--;){var r=t[e];r.isEmpty(n)&&0===r.getAll("br").length&&(r.append(new sm("br",1)).shortEnded=!0)}})),u),t.serializer=rv((c=(a=t).settings,Ot(Ot({},eC(a)),tC({url_converter:c.url_converter,url_converter_scope:c.url_converter_scope,element_format:c.element_format,entities:c.entities,entity_encoding:c.entity_encoding,indent:c.indent,indent_after:c.indent_after,indent_before:c.indent_before,block_elements:c.block_elements,boolean_attributes:c.boolean_attributes,custom_elements:c.custom_elements,extended_valid_elements:c.extended_valid_elements,invalid_elements:c.invalid_elements,invalid_styles:c.invalid_styles,move_caret_before_on_enter_elements:c.move_caret_before_on_enter_elements,non_empty_elements:c.non_empty_elements,schema:c.schema,self_closing_elements:c.self_closing_elements,short_ended_elements:c.short_ended_elements,special:c.special,text_block_elements:c.text_block_elements,text_inline_elements:c.text_inline_elements,valid_children:c.valid_children,valid_classes:c.valid_classes,valid_elements:c.valid_elements,valid_styles:c.valid_styles,verify_html:c.verify_html,whitespace_elements:c.whitespace_elements}))),t),t.selection=Ph(t.dom,t.getWin(),t.serializer,t),t.annotator=El(t),t.formatter=Kv(t),t.undoManager=Jv(t),t._nodeChangeDispatcher=new Vw(t),t._selectionOverrides=Qw(t),function(t){var e=ya(S.none()),n=ya(!1),r=Ta((function(e){t.fire("longpress",Ot(Ot({},e),{type:"longpress"})),n.set(!0)}),400);t.on("touchstart",(function(t){zy(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.throttle(t),n.set(!1),e.set(S.some(i))}))}),!0),t.on("touchmove",(function(o){r.cancel(),zy(o).each((function(r){e.get().each((function(o){var i,u,a,c;i=r,u=o,a=Math.abs(i.clientX-u.x),c=Math.abs(i.clientY-u.y),(5<a||5<c)&&(e.set(S.none()),n.set(!1),t.fire("longpresscancel"))}))}))}),!0),t.on("touchend touchcancel",(function(o){r.cancel(),"touchcancel"!==o.type&&e.get().filter((function(t){return t.target.isEqualNode(o.target)})).each((function(){n.get()?o.preventDefault():t.fire("tap",Ot(Ot({},o),{type:"tap"}))}))}),!0)}(t),function(t){var e,n;(e=t).on("click",(function(t){e.dom.getParent(t.target,"details")&&t.preventDefault()})),(n=t).parser.addNodeFilter("details",(function(t){W(t,(function(t){t.attr("data-mce-open",t.attr("open")),t.attr("open","open")}))})),n.serializer.addNodeFilter("details",(function(t){W(t,(function(t){var e=t.attr("data-mce-open");t.attr("open",E(e)?e:null),t.attr("data-mce-open",null)}))}))}(t),Th(t)||function(t){t.on("click",(function(e){var n,r,o,i,u;3<=e.detail&&(o=(n=t).selection.getRng(),i=Sc.fromRangeStart(o),u=Sc.fromRangeEnd(o),Sc.isElementPosition(i)&&(r=i.container(),zw(r)&&bf(r).each((function(t){return o.setStart(t.container(),t.offset())}))),Sc.isElementPosition(u)&&(r=i.container(),zw(r)&&yf(r).each((function(t){return o.setEnd(t.container(),t.offset())}))),n.selection.setRng(Qg(o)))}))}(t);var f,d,m,g,p=Th(f=t)?ya(null):Lw(f);(function(t,e){t.addCommand("delete",(function(){var n,r;r=e,Vy(n=t)||Vb(n,!1)||Db(n,!1)||Ey(n,r,!1)||yb(n,!1)||Jg(n)||Hb(n,!1)||Dy(n,!1)||Cb(n)||By(n,!1)||(Hy(n,"Delete"),sb(n))})),t.addCommand("forwardDelete",(function(){var n,r;r=e,Vb(n=t,!0)||Db(n,!0)||Ey(n,r,!0)||yb(n,!0)||Jg(n)||Hb(n,!0)||Dy(n,!0)||Cb(n)||By(n,!0)||Hy(n,"ForwardDelete")}))})(t,p),Jc(d=t)&&d.on("NodeChange",l(Uy,d)),function(t){var e,n=t.dom,r=Jc(t),o=(e=t).getParam("placeholder",Xc.getAttrib(e.getElement(),"placeholder"),"string"),i=function(e,u){var a,c,s,f;!function(t){if(tb(t)){var e=t.keyCode;return!eb(t)&&(Rl.metaKeyPressed(t)||t.altKey||112<=e&&e<=123||z(Qv,e))}return!1}(e)&&(a=t.getBody(),c=!(tb(s=e)&&!(eb(s)||"keyup"===s.type&&229===s.keyCode))&&function(t,e,n){if(Io(Ae(e),!1)){var r=""===n,o=e.firstElementChild;return!o||!t.getStyle(e.firstElementChild,"padding-left")&&!t.getStyle(e.firstElementChild,"padding-right")&&(r?!t.isBlock(o):n===o.nodeName.toLowerCase())}return!1}(n,a,r),""!==n.getAttrib(a,Zv)===c&&!u||(n.setAttrib(a,Zv,c?o:null),n.setAttrib(a,"aria-placeholder",c?o:null),f=c,t.fire("PlaceholderToggle",{state:f}),t.on(c?"keydown":"keyup",i),t.off(c?"keyup":"keydown",i)))};o&&t.on("init",(function(e){i(e,!0),t.on("change SetContent ExecCommand",i),t.on("paste",(function(e){return Vr.setEditorTimeout(t,(function(){return i(e)}))}))}))}(t),t.fire("PreInit"),gt((g=m=t).plugins,"rtc").fold((function(){return g.rtcInstance=_h(m),S.none()}),(function(t){return S.some(t.setup().then((function(t){return g.rtcInstance=Eh(m,t),t.isRemote})))})).fold((function(){rC(t,!1)}),(function(e){t.setProgressState(!0),e.then((function(e){t.setProgressState(!1),rC(t,e)}))}))},iC=da.DOM,uC=function(t,e){var n,r,o,i,u=t.editorManager.translate("Rich Text Area. Press ALT-0 for help."),a=(n=t.id,r=u,e.height,o=t.getParam("iframe_attrs",{}),i=Ee("iframe"),Xn(i,o),Xn(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),Na(i,"tox-edit-area__iframe"),i.dom);a.onload=function(){a.onload=null,t.fire("load")};var c=function(t,e){if(document.domain!==window.location.hostname&&ye.browser.isIE()){var n=zv("mce");t[n]=function(){oC(t)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return iC.setAttrib(e,"src",r),!0}return!1}(t,a);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=a,t.iframeHTML=function(t){var e=t.getParam("doctype","<!DOCTYPE html>")+"<html><head>";t.getParam("document_base_url","")!==t.documentBaseUrl&&(e+='<base href="'+t.documentBaseURI.getURI()+'" />'),e+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=Yc(t,"body_id","tinymce"),r=Yc(t,"body_class","");return Kc(t)&&(e+='<meta http-equiv="Content-Security-Policy" content="'+Kc(t)+'" />'),e+'</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+t.id+'"><br></body></html>'}(t),iC.add(e.iframeContainer,a),c},aC=da.DOM,cC=function(t,e,n){var r=Bv.get(n),o=Bv.urls[n]||t.documentBaseUrl.replace(/\/$/,"");if(n=ke.trim(n),r&&-1===ke.inArray(e,n)){if(ke.each(Bv.dependencies(n),(function(n){cC(t,e,n)})),t.plugins[n])return;try{var i=new r(t,o,t.$);(t.plugins[n]=i).init&&(i.init(t,o),e.push(n))}catch(e){!function(t,e,n){var r=Sa.translate(["Failed to initialize plugin: {0}",e]);Lv(r,n),Mv(t,r)}(t,n,e)}}},sC=function(t){return t.replace(/^\-/,"")},fC=function(t){return{editorContainer:t,iframeContainer:t,api:{}}},lC=function(t){var e,n,r,o=t.getElement();return t.orgDisplay=o.style.display,E(us(t))?t.theme.renderUI():I(us(t))?(n=(e=t).getElement(),(r=us(e)(e,n)).editorContainer.nodeType&&(r.editorContainer.id=r.editorContainer.id||e.id+"_parent"),r.iframeContainer&&r.iframeContainer.nodeType&&(r.iframeContainer.id=r.iframeContainer.id||e.id+"_iframecontainer"),r.height=r.iframeHeight?r.iframeHeight:n.offsetHeight,r):function(t){var e,n,r=t.getElement();return t.inline?fC(null):(e=r,n=aC.create("div"),aC.insertAfter(n,e),fC(n))}(t)},dC=function(t){var e,n,r,o,i,u,c,s,f;t.fire("ScriptsLoaded"),e=t,n=ke.trim(ts(e)),r=e.ui.registry.getAll().icons,o=Ot(Ot({},wv.get("default").icons),wv.get(n).icons),at(o,(function(t,n){pt(r,n)||e.ui.registry.addIcon(n,t)})),c=us(i=t),E(c)?(i.settings.theme=sC(c),u=Nv.get(c),i.theme=new u(i,Nv.urls[c]),i.theme.init&&i.theme.init(i,Nv.urls[c]||i.documentBaseUrl.replace(/\/$/,""),i.$)):i.theme={},s=t,f=[],ke.each(cs(s).split(/[ ,]/),(function(t){cC(s,f,sC(t))}));var l,d,m,g=lC(t);l=t,d=S.from(g.api).getOr({}),m={show:S.from(d.show).getOr(a),hide:S.from(d.hide).getOr(a),disable:S.from(d.disable).getOr(a),isDisabled:S.from(d.isDisabled).getOr(b),enable:function(){l.mode.isReadOnly()||S.from(d.enable).map(v)}},l.ui=Ot(Ot({},l.ui),m);var p,h,y,x,w={editorContainer:g.editorContainer,iframeContainer:g.iframeContainer};return t.editorContainer=w.editorContainer?w.editorContainer:null,(p=t).contentCSS=p.contentCSS.concat(function(t){var e,n,r=(n=(e=t).getParam("content_css"),E(n)?U(n.split(","),zt):A(n)?n:!1===n||e.inline?[]:["default"]),o=t.editorManager.baseURL+"/skins/content",i="content"+t.editorManager.suffix+".css",u=!0===t.inline;return U(r,(function(e){return/^[a-z0-9\-]+$/i.test(e)&&!u?o+"/"+e+"/"+i:t.documentBaseURI.toAbsolute(e)}))}(p)),t.inline?oC(t):(x=uC(h=t,y=w),y.editorContainer&&(iC.get(y.editorContainer).style.display=h.orgDisplay,h.hidden=iC.isHidden(y.editorContainer)),h.getElement().style.display="none",iC.setAttrib(h.id,"aria-hidden","true"),void(x||oC(h)))},mC=da.DOM,gC=function(t){return"-"===t.charAt(0)},pC=function(t,e,n){return S.from(e).filter((function(t){return 0<t.length&&!wv.has(t)})).map((function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:S.some(e)}}))},hC=function(t,e){var n,r,o,i,u,c,s=ha.ScriptLoader;n=s,o=e,i=function(){var n,r;(function(t,e){var n,r=ns(e),o=e.getParam("language_url","","string");!1===Sa.hasCode(r)&&"en"!==r&&(n=""!==o?o:e.editorManager.baseURL+"/langs/"+r+".js",t.add(n,a,void 0,(function(){Iv(e,"LanguageLoadError",Pv("language",n,r))})))})(s,t),function(t,e,n){var r,o=pC(e,"default",n),i=(r=e,S.from(r.getParam("icons_url","","string")).filter((function(t){return 0<t.length})).map((function(t){return{url:t,name:S.none()}})).orThunk((function(){return pC(e,ts(e),"")})));W(function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e}([o,i]),(function(n){t.add(n.url,a,void 0,(function(){var t,r,o;t=e,r=n.url,o=n.name.getOrUndefined(),Iv(t,"IconsLoadError",Pv("icons",r,o))}))}))}(s,t,e),n=t,r=e,ke.each(n.getParam("external_plugins"),(function(t,e){Bv.load(e,t,a,void 0,(function(){Fv(n,t,e)})),n.settings.plugins+=" "+e})),ke.each(cs(n).split(/[ ,]/),(function(t){var e,o;(t=ke.trim(t))&&!Bv.urls[t]&&(gC(t)?(t=t.substr(1,t.length),e=Bv.dependencies(t),ke.each(e,(function(t){var e={prefix:"plugins/",resource:t,suffix:"/plugin"+r+".js"},o=Bv.createUrl(e,t);Bv.load(o.resource,o,a,void 0,(function(){Fv(n,o.prefix+o.resource+o.suffix,o.resource)}))}))):(o={prefix:"plugins/",resource:t,suffix:"/plugin"+r+".js"},Bv.load(t,o,a,void 0,(function(){Fv(n,o.prefix+o.resource+o.suffix,t)}))))})),s.loadQueue((function(){t.removed||dC(t)}),t,(function(){t.removed||dC(t)}))},c=us(r=t),E(c)?(gC(c)||Nv.urls.hasOwnProperty(c)||((u=r.getParam("theme_url"))?Nv.load(c,r.documentBaseURI.toAbsolute(u)):Nv.load(c,"themes/"+c+"/theme"+o+".js")),n.loadQueue((function(){Nv.waitFor(c,i)}))):i()},vC={"font-size":"size","font-family":"face"},bC=function(t){return function(e,n){return S.from(n).map(Ae).filter(Le).bind((function(n){return function(t,e,n){return Jd(Ae(n),(function(e){return tr(n=e,t).orThunk((function(){return"font"===Ie(n)?gt(vC,t).bind((function(t){return Kn(n,t)})):S.none()}));var n}),(function(t){return Re(Ae(e),t)}))}(t,e,n.dom).or((r=t,o=n.dom,S.from(da.DOM.getStyle(o,r,!0))));var r,o})).getOr("")}},yC=bC("font-size"),xC=c((function(t){return t.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")}),bC("font-family")),wC=function(t){return bf(t.getBody()).map((function(t){var e=t.container();return In(e)?e.parentNode:e}))},CC=function(t,e){return n=t,S.from(n.selection.getRng()).bind((function(t){var e=n.getBody();return t.startContainer===e&&0===t.startOffset?S.none():S.from(n.selection.getStart(!0))})).orThunk(l(wC,t)).map(Ae).filter(Le).map(e);var n},SC=function(t,e){if(/^[0-9.]+$/.test(e)){var n=parseInt(e,10);if(1<=n&&n<=7){var r=(u=t,ke.explode(u.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))),o=(i=t,ke.explode(i.getParam("font_size_classes","")));return o?o[n-1]||e:r[n-1]||e}return e}return e;var i,u},kC=ke.each,OC=ke.map,_C=ke.inArray,EC=(TC.prototype.execCommand=function(t,e,n,r){var o,i,u=!1,a=this;if(!a.editor.removed){if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||r&&r.skip_focus?(i=a.editor,Rd(i).each((function(t){return i.selection.setRng(t)}))):a.editor.focus(),(r=a.editor.fire("BeforeExecCommand",{command:t,ui:e,value:n})).isDefaultPrevented())return!1;var c=t.toLowerCase();if(o=a.commands.exec[c])return o(c,e,n),a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;if(kC(this.editor.plugins,(function(r){if(r.execCommand&&r.execCommand(t,e,n))return a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!(u=!0)})),u)return u;if(a.editor.theme&&a.editor.theme.execCommand&&a.editor.theme.execCommand(t,e,n))return a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;try{u=a.editor.getDoc().execCommand(t,e,n)}catch(t){}return!!u&&(a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0)}},TC.prototype.queryCommandState=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.state[t])return e(t);try{return this.editor.getDoc().queryCommandState(t)}catch(t){}return!1}},TC.prototype.queryCommandValue=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.value[t])return e(t);try{return this.editor.getDoc().queryCommandValue(t)}catch(t){}}},TC.prototype.addCommands=function(t,e){void 0===e&&(e="exec");var n=this;kC(t,(function(t,r){kC(r.toLowerCase().split(","),(function(r){n.commands[e][r]=t}))}))},TC.prototype.addCommand=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.exec[t]=function(t,o,i,u){return e.call(n||r.editor,o,i,u)}},TC.prototype.queryCommandSupported=function(t){if(t=t.toLowerCase(),this.commands.exec[t])return!0;try{return this.editor.getDoc().queryCommandSupported(t)}catch(t){}return!1},TC.prototype.addQueryStateHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.state[t]=function(){return e.call(n||r.editor)}},TC.prototype.addQueryValueHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.value[t]=function(){return e.call(n||r.editor)}},TC.prototype.hasCustomCommand=function(t){return t=t.toLowerCase(),!!this.commands.exec[t]},TC.prototype.execNativeCommand=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(t,e,n)},TC.prototype.isFormatMatch=function(t){return this.editor.formatter.match(t)},TC.prototype.toggleFormat=function(t,e){this.editor.formatter.toggle(t,e?{value:e}:void 0),this.editor.nodeChanged()},TC.prototype.storeSelection=function(t){this.selectionBookmark=this.editor.selection.getBookmark(t)},TC.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},TC.prototype.setupCommands=function(t){var e=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){t.undoManager.add()},"Cut,Copy,Paste":function(n){var r,o,i=t.getDoc();try{e.execNativeCommand(n)}catch(t){r=!0}"paste"!==n||i.queryCommandEnabled(n)||(r=!0),!r&&i.queryCommandSupported(n)||(o=t.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead."),ye.mac&&(o=o.replace(/Ctrl\+/g,"⌘+")),t.notificationManager.open({text:o,type:"error"}))},unlink:function(){var e;t.selection.isCollapsed()?(e=t.dom.getParent(t.selection.getStart(),"a"))&&t.dom.remove(e,!0):t.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),kC("left,center,right,justify".split(","),(function(e){r!==e&&t.formatter.remove("align"+e)})),"none"!==r&&e.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r;e.execNativeCommand(n);var o=t.dom.getParent(t.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(e.storeSelection(),t.dom.split(r,o),e.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){e.toggleFormat(t)},"ForeColor,HiliteColor":function(t,n,r){e.toggleFormat(t,r)},FontName:function(e,n,r){!function(t,e){var n,r=SC(t,e);t.formatter.toggle("fontname",{value:(n=r.split(/\s*,\s*/),U(n,(function(t){return-1===t.indexOf(" ")||Vt(t,'"')||Vt(t,"'")?t:"'"+t+"'"})).join(","))}),t.nodeChanged()}(t,r)},FontSize:function(e,n,r){var o,i;i=r,(o=t).formatter.toggle("fontsize",{value:SC(o,i)}),o.nodeChanged()},LineHeight:function(e,n,r){var o,i;i=r,(o=t).undoManager.transact((function(){o.formatter.toggle("lineheight",{value:String(i)}),o.nodeChanged()}))},RemoveFormat:function(e){t.formatter.remove(e)},mceBlockQuote:function(){e.toggleFormat("blockquote")},FormatBlock:function(t,n,r){return e.toggleFormat(r||"p")},mceCleanup:function(){var e=t.selection.getBookmark();t.setContent(t.getContent()),t.selection.moveToBookmark(e)},mceRemoveNode:function(n,r,o){var i=o||t.selection.getNode();i!==t.getBody()&&(e.storeSelection(),t.dom.remove(i,!0),e.restoreSelection())},mceSelectNodeDepth:function(e,n,r){var o=0;t.dom.getParent(t.selection.getNode(),(function(e){if(1===e.nodeType&&o++===r)return t.selection.select(e),!1}),t.getBody())},mceSelectNode:function(e,n,r){t.selection.select(r)},mceInsertContent:function(e,n,r){!function(t,e){var n,r,o,i,u="string"!=typeof(n=e)?(r=ke.extend({paste:n.paste,data:{paste:n.paste}},n),{content:n.content,details:r}):{content:n,details:{}};o=u.content,i=u.details,Ah(t).editor.insertContent(o,i)}(t,r)},mceInsertRawHTML:function(e,n,r){t.selection.setContent("tiny_mce_marker");var o=t.getContent();t.setContent(o.replace(/tiny_mce_marker/g,(function(){return r})))},mceInsertNewLine:function(e,n,r){Nw(t,r)},mceToggleFormat:function(t,n,r){e.toggleFormat(r)},mceSetContent:function(e,n,r){t.setContent(r)},"Indent,Outdent":function(e){Ly(t,e)},mceRepaint:function(){},InsertHorizontalRule:function(){t.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){t.hasVisual=!t.hasVisual,t.addVisual()},mceReplaceContent:function(e,n,r){t.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,t.selection.getContent({format:"text"})))},mceInsertLink:function(e,n,r){"string"==typeof r&&(r={href:r});var o=t.dom.getParent(t.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||t.formatter.remove("link"),r.href&&t.formatter.apply("link",r,o)},selectAll:function(){var e,n=t.dom.getParent(t.selection.getStart(),zn);n&&((e=t.dom.createRng()).selectNodeContents(n),t.selection.setRng(e))},mceNewDocument:function(){t.setContent("")},InsertLineBreak:function(e,n,r){return bw(t,r),!0}});var n=function(e){return function(){var n=t.selection,r=n.isCollapsed()?[t.dom.getParent(n.getNode(),t.dom.isBlock)]:n.getSelectedBlocks(),o=OC(r,(function(n){return!!t.formatter.matchNode(n,e)}));return-1!==_C(o,!0)}};e.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){return e.isFormatMatch(t)},mceBlockQuote:function(){return e.isFormatMatch("blockquote")},Outdent:function(){return Iy(t)},"InsertUnorderedList,InsertOrderedList":function(e){var n=t.dom.getParent(t.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===e&&"UL"===n.tagName||"insertorderedlist"===e&&"OL"===n.tagName)}},"state"),e.addCommands({Undo:function(){t.undoManager.undo()},Redo:function(){t.undoManager.redo()}}),e.addQueryValueHandler("FontName",(function(){return CC(e=t,(function(t){return xC(e.getBody(),t.dom)})).getOr("");var e}),this),e.addQueryValueHandler("FontSize",(function(){return CC(e=t,(function(t){return yC(e.getBody(),t.dom)})).getOr("");var e}),this),e.addQueryValueHandler("LineHeight",(function(){return CC(e=t,(function(t){var n=Ae(e.getBody());return Jd(t,(function(t){return tr(t,"line-height")}),l(Re,n)).getOrThunk((function(){var e=parseFloat(Qn(t,"line-height")),n=parseFloat(Qn(t,"font-size"));return String(e/n)}))})).getOr("");var e}),this)},TC);function TC(t){this.commands={state:{},exec:{},value:{}},this.editor=t,this.setupCommands(t)}var AC="data-mce-contenteditable",BC=function(t,e,n){var r,o;Da(t,e)&&!1===n?(o=e,Ba(r=t)?r.dom.classList.remove(o):function(t,e){return o=e,0<(i=G(Aa(n=t,r="class"),(function(t){return t!==o}))).length?$n(n,r,i.join(" ")):Jn(n,r),!1;var n,r,o,i}(r,o),function(t){0===(Ba(t)?t.dom.classList:Aa(t,"class")).length&&Jn(t,"class")}(r)):n&&Na(t,e)},NC=function(t,e,n){try{t.getDoc().execCommand(e,!1,String(n))}catch(t){}},DC=function(t,e){t.dom.contentEditable=e?"true":"false"},RC=function(t,e){var n,r,o,i=Ae(t.getBody());BC(i,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),o=t,S.from(o.selection.getNode()).each((function(t){t.removeAttribute("data-mce-selected")})),t.readonly=!0,DC(i,!1),W(Ma(i,'*[contenteditable="true"]'),(function(t){$n(t,AC,"true"),DC(t,!1)}))):(t.readonly=!1,DC(i,!0),W(Ma(i,"*["+AC+'="true"]'),(function(t){Jn(t,AC),DC(t,!0)})),NC(t,"StyleWithCSS",!1),NC(t,"enableInlineTableEditing",!1),NC(t,"enableObjectResizing",!1),(jd(r=t)||function(t){return xd().filter((function(e){return!(void 0!==(n=e.dom.classList)&&(n.contains("tox-edit-area")||n.contains("tox-edit-area__iframe")||n.contains("mce-content-body")))&&Fd(t,e.dom);var n})).isSome()}(r))&&t.focus(),(n=t).selection.setRng(n.selection.getRng()),t.nodeChanged())},MC=function(t){return t.readonly},IC=function(t){t.parser.addAttributeFilter("contenteditable",(function(e){MC(t)&&W(e,(function(t){t.attr(AC,t.attr("contenteditable")),t.attr("contenteditable","false")}))})),t.serializer.addAttributeFilter(AC,(function(e){MC(t)&&W(e,(function(t){t.attr("contenteditable",t.attr(AC))}))})),t.serializer.addTempAttr(AC)},PC=ke.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"," "),FC=(LC.isNative=function(t){return!!PC[t.toLowerCase()]},LC.prototype.fire=function(t,e){var n=t.toLowerCase(),r=e||{};r.type=n,r.target||(r.target=this.scope),r.preventDefault||(r.preventDefault=function(){r.isDefaultPrevented=y},r.stopPropagation=function(){r.isPropagationStopped=y},r.stopImmediatePropagation=function(){r.isImmediatePropagationStopped=y},r.isDefaultPrevented=b,r.isPropagationStopped=b,r.isImmediatePropagationStopped=b),this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,u=o.length;i<u;i++){var a=o[i];if(a.once&&this.off(n,a.func),r.isImmediatePropagationStopped())return r.stopPropagation(),r;if(!1===a.func.call(this.scope,r))return r.preventDefault(),r}return r},LC.prototype.on=function(t,e,n,r){if(!1===e&&(e=b),e){var o={func:e};r&&ke.extend(o,r);for(var i=t.toLowerCase().split(" "),u=i.length;u--;){var a=i[u],c=this.bindings[a];c||(c=this.bindings[a]=[],this.toggleEvent(a,!0)),n?c.unshift(o):c.push(o)}}return this},LC.prototype.off=function(t,e){var n=this;if(t)for(var r=t.toLowerCase().split(" "),o=r.length;o--;){var i=r[o],u=this.bindings[i];if(!i)return at(this.bindings,(function(t,e){n.toggleEvent(e,!1),delete n.bindings[e]})),this;if(u){if(e)for(var a=u.length;a--;)u[a].func===e&&(u=u.slice(0,a).concat(u.slice(a+1)),this.bindings[i]=u);else u.length=0;u.length||(this.toggleEvent(t,!1),delete this.bindings[i])}}else at(this.bindings,(function(t,e){n.toggleEvent(e,!1)})),this.bindings={};return this},LC.prototype.once=function(t,e,n){return this.on(t,e,n,{once:!0})},LC.prototype.has=function(t){return t=t.toLowerCase(),!(!this.bindings[t]||0===this.bindings[t].length)},LC);function LC(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||b}var VC,HC=function(t){return t._eventDispatcher||(t._eventDispatcher=new FC({scope:t,toggleEvent:function(e,n){FC.isNative(e)&&t.toggleNativeEvent&&t.toggleNativeEvent(e,n)}})),t._eventDispatcher},zC={fire:function(t,e,n){if(this.removed&&"remove"!==t&&"detach"!==t)return e;var r=HC(this).fire(t,e);if(!1!==n&&this.parent)for(var o=this.parent();o&&!r.isPropagationStopped();)o.fire(t,r,!1),o=o.parent();return r},on:function(t,e,n){return HC(this).on(t,e,n)},off:function(t,e){return HC(this).off(t,e)},once:function(t,e){return HC(this).once(t,e)},hasEventListeners:function(t){return HC(this).has(t)}},jC=da.DOM,UC=function(t,e){if("selectionchange"===e)return t.getDoc();if(!t.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(e))return t.getDoc().documentElement;var n=is(t);return n?(t.eventRoot||(t.eventRoot=jC.select(n)[0]),t.eventRoot):t.getBody()},WC=function(t,e,n){var r;(r=t).hidden||MC(r)?MC(t)&&function(t,e){var n,r;"click"!==e.type||Rl.metaKeyPressed(e)||(n=Ae(e.target),r=t,Er(n,"a",(function(t){return Re(t,Ae(r.getBody()))})).bind((function(t){return Kn(t,"href")})).each((function(n){var r,o,i,u;e.preventDefault(),/^#/.test(n)?(r=t.dom.select(n+',[name="'+(Vt(o=n,"#")?(i=o,u="#".length,i.substring(u)):o)+'"]')).length&&t.selection.scrollIntoView(r[0],!0):window.open(n,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes")})))}(t,n):t.fire(e,n)},qC=function(t,e){var n;if(t.delegates||(t.delegates={}),!t.delegates[e]&&!t.removed){var r=UC(t,e);if(is(t)){if(VC||(VC={},t.editorManager.on("removeEditor",(function(){t.editorManager.activeEditor||VC&&(at(VC,(function(e,n){t.dom.unbind(UC(t,n))})),VC=null)}))),VC[e])return;n=function(n){for(var r=n.target,o=t.editorManager.get(),i=o.length;i--;){var u=o[i].getBody();u!==r&&!jC.isChildOf(r,u)||WC(o[i],e,n)}},VC[e]=n,jC.bind(r,e,n)}else n=function(n){WC(t,e,n)},jC.bind(r,e,n),t.delegates[e]=n}},GC=Ot(Ot({},zC),{bindPendingEventDelegates:function(){var t=this;ke.each(t._pendingNativeEvents,(function(e){qC(t,e)}))},toggleNativeEvent:function(t,e){var n=this;"focus"!==t&&"blur"!==t&&(e?n.initialized?qC(n,t):n._pendingNativeEvents?n._pendingNativeEvents.push(t):n._pendingNativeEvents=[t]:n.initialized&&(n.dom.unbind(UC(n,t),t,n.delegates[t]),delete n.delegates[t]))},unbindAllNativeEvents:function(){var t=this,e=t.getBody(),n=t.dom;t.delegates&&(at(t.delegates,(function(e,n){t.dom.unbind(UC(t,n),n,e)})),delete t.delegates),!t.inline&&e&&n&&(e.onload=null,n.unbind(t.getWin()),n.unbind(t.getDoc())),n&&(n.unbind(e),n.unbind(t.getContainer()))}}),$C=["design","readonly"],XC=function(t,e,n,r){var o,i=n[e.get()],u=n[r];try{u.activate()}catch(t){return void console.error("problem while activating editor mode "+r+":",t)}i.deactivate(),i.editorReadOnly!==u.editorReadOnly&&RC(t,u.editorReadOnly),e.set(r),o=r,t.fire("SwitchMode",{mode:o})},YC=ke.each,KC=ke.explode,JC={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},QC=ke.makeMap("alt,ctrl,shift,meta,access"),ZC=(tS.prototype.add=function(t,e,n,r){var o=this,i=o.normalizeCommandFunc(n);return YC(KC(ke.trim(t)),(function(t){var n=o.createShortcut(t,e,i,r);o.shortcuts[n.id]=n})),!0},tS.prototype.remove=function(t){var e=this.createShortcut(t);return!!this.shortcuts[e.id]&&(delete this.shortcuts[e.id],!0)},tS.prototype.normalizeCommandFunc=function(t){var e=this,n=t;return"string"==typeof n?function(){e.editor.execCommand(n,!1,null)}:ke.isArray(n)?function(){e.editor.execCommand(n[0],n[1],n[2])}:n},tS.prototype.parseShortcut=function(t){var e,n={};YC(KC(t.toLowerCase(),"+"),(function(t){t in QC?n[t]=!0:/^[0-9]{2,}$/.test(t)?n.keyCode=parseInt(t,10):(n.charCode=t.charCodeAt(0),n.keyCode=JC[t]||t.toUpperCase().charCodeAt(0))}));var r=[n.keyCode];for(e in QC)n[e]?r.push(e):n[e]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,ye.mac?n.ctrl=!0:n.shift=!0),n.meta&&(ye.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},tS.prototype.createShortcut=function(t,e,n,r){var o=ke.map(KC(t,">"),this.parseShortcut);return o[o.length-1]=ke.extend(o[o.length-1],{func:n,scope:r||this.editor}),ke.extend(o[0],{desc:this.editor.translate(e),subpatterns:o.slice(1)})},tS.prototype.hasModifier=function(t){return t.altKey||t.ctrlKey||t.metaKey},tS.prototype.isFunctionKey=function(t){return"keydown"===t.type&&112<=t.keyCode&&t.keyCode<=123},tS.prototype.matchShortcut=function(t,e){return!!e&&e.ctrl===t.ctrlKey&&e.meta===t.metaKey&&e.alt===t.altKey&&e.shift===t.shiftKey&&!!(t.keyCode===e.keyCode||t.charCode&&t.charCode===e.charCode)&&(t.preventDefault(),!0)},tS.prototype.executeShortcutAction=function(t){return t.func?t.func.call(t.scope):null},tS);function tS(t){this.shortcuts={},this.pendingPatterns=[],this.editor=t;var e=this;t.on("keyup keypress keydown",(function(t){!e.hasModifier(t)&&!e.isFunctionKey(t)||t.isDefaultPrevented()||(YC(e.shortcuts,(function(n){if(e.matchShortcut(t,n))return e.pendingPatterns=n.subpatterns.slice(0),"keydown"===t.type&&e.executeShortcutAction(n),!0})),e.matchShortcut(t,e.pendingPatterns[0])&&(1===e.pendingPatterns.length&&"keydown"===t.type&&e.executeShortcutAction(e.pendingPatterns[0]),e.pendingPatterns.shift()))}))}var eS=function(){var t,e,n,r,o,i,u,a,c=(e={},n={},r={},o={},i={},u={},{addButton:(a=function(t,e){return function(n,r){return t[n.toLowerCase()]=Ot(Ot({},r),{type:e})}})(t={},"button"),addGroupToolbarButton:a(t,"grouptoolbarbutton"),addToggleButton:a(t,"togglebutton"),addMenuButton:a(t,"menubutton"),addSplitButton:a(t,"splitbutton"),addMenuItem:a(e,"menuitem"),addNestedMenuItem:a(e,"nestedmenuitem"),addToggleMenuItem:a(e,"togglemenuitem"),addAutocompleter:a(n,"autocompleter"),addContextMenu:a(o,"contextmenu"),addContextToolbar:a(i,"contexttoolbar"),addContextForm:a(i,"contextform"),addSidebar:a(u,"sidebar"),addIcon:function(t,e){return r[t.toLowerCase()]=e},getAll:function(){return{buttons:t,menuItems:e,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:u}}});return{addAutocompleter:c.addAutocompleter,addButton:c.addButton,addContextForm:c.addContextForm,addContextMenu:c.addContextMenu,addContextToolbar:c.addContextToolbar,addIcon:c.addIcon,addMenuButton:c.addMenuButton,addMenuItem:c.addMenuItem,addNestedMenuItem:c.addNestedMenuItem,addSidebar:c.addSidebar,addSplitButton:c.addSplitButton,addToggleButton:c.addToggleButton,addGroupToolbarButton:c.addGroupToolbarButton,addToggleMenuItem:c.addToggleMenuItem,getAll:c.getAll}},nS=ke.each,rS=ke.trim,oS="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),iS={ftp:21,http:80,https:443,mailto:25},uS=(aS.parseDataUri=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},aS.getDocumentBaseUrl=function(t){var e=0!==t.protocol.indexOf("http")&&"file:"!==t.protocol?t.href:t.protocol+"//"+t.host+t.pathname;return/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/")),e},aS.prototype.setPath=function(t){var e=/^(.*?)\/?(\w+)?$/.exec(t);this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},aS.prototype.toRelative=function(t){var e;if("./"===t)return t;var n=new aS(t,{base_uri:this});if("mce_host"!==n.host&&this.host!==n.host&&n.host||this.port!==n.port||this.protocol!==n.protocol&&""!==n.protocol)return n.getURI();var r=this.getURI(),o=n.getURI();return r===o||"/"===r.charAt(r.length-1)&&r.substr(0,r.length-1)===o?r:(e=this.toRelPath(this.path,n.path),n.query&&(e+="?"+n.query),n.anchor&&(e+="#"+n.anchor),e)},aS.prototype.toAbsolute=function(t,e){var n=new aS(t,{base_uri:this});return n.getURI(e&&this.isSameOrigin(n))},aS.prototype.isSameOrigin=function(t){if(this.host==t.host&&this.protocol==t.protocol){if(this.port==t.port)return!0;var e=iS[this.protocol];if(e&&(this.port||e)==(t.port||e))return!0}return!1},aS.prototype.toRelPath=function(t,e){var n,r,o=0,i="",u=t.substring(0,t.lastIndexOf("/")).split("/"),a=e.split("/");if(u.length>=a.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||u[n]!==a[n]){o=n+1;break}if(u.length<a.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||u[n]!==a[n]){o=n+1;break}if(1===o)return e;for(n=0,r=u.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=a.length;n<r;n++)i+=n!==o-1?"/"+a[n]:a[n];return i},aS.prototype.toAbsPath=function(t,e){var n,r,o=0,i=[],u=/\/$/.test(e)?"/":"",a=t.split("/"),c=e.split("/");for(nS(a,(function(t){t&&i.push(t)})),a=i,n=c.length-1,i=[];0<=n;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?0<o?o--:i.push(c[n]):o++);return 0!==(r=(n=a.length-o)<=0?Z(i).join("/"):a.slice(0,n).join("/")+"/"+Z(i).join("/")).indexOf("/")&&(r="/"+r),u&&r.lastIndexOf("/")!==r.length-1&&(r+=u),r},aS.prototype.getURI=function(t){var e;return void 0===t&&(t=!1),this.source&&!t||(e="",t||(this.protocol?e+=this.protocol+"://":e+="//",this.userInfo&&(e+=this.userInfo+"@"),this.host&&(e+=this.host),this.port&&(e+=":"+this.port)),this.path&&(e+=this.path),this.query&&(e+="?"+this.query),this.anchor&&(e+="#"+this.anchor),this.source=e),this.source},aS);function aS(t,e){t=rS(t),this.settings=e||{};var n,r,o,i,u=this.settings.base_uri,a=this;/^([\w\-]+):([^\/]{2})/i.test(t)||/^\s*#/.test(t)?a.source=t:(n=0===t.indexOf("//"),0!==t.indexOf("/")||n||(t=(u&&u.protocol||"http")+"://mce_host"+t),/^[\w\-]*:?\/\//.test(t)||(r=this.settings.base_uri?this.settings.base_uri.path:new aS(document.location.href).directory,t=this.settings.base_uri&&""==this.settings.base_uri.protocol?"//mce_host"+a.toAbsPath(r,t):(o=/([^#?]*)([#?]?.*)/.exec(t),(u&&u.protocol||"http")+"://mce_host"+a.toAbsPath(r,o[1])+o[2])),t=t.replace(/@@/g,"(mce_at)"),i=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(t),nS(oS,(function(t,e){var n=(n=i[e])&&n.replace(/\(mce_at\)/g,"@@");a[t]=n})),u&&(a.protocol||(a.protocol=u.protocol),a.userInfo||(a.userInfo=u.userInfo),a.port||"mce_host"!==a.host||(a.port=u.port),a.host&&"mce_host"!==a.host||(a.host=u.host),a.source=""),n&&(a.protocol=""))}var cS=da.DOM,sS=ke.extend,fS=ke.each,lS=ke.resolve,dS=ye.ie,mS=(gS.prototype.render=function(){!function(t){var e=t.id;Sa.setCode(ns(t));var n,r,o,i,u,a=function(){mC.unbind(window,"ready",a),t.render()};bi.Event.domLoaded?t.getElement()&&ye.contentEditable&&(n=Ae(t.getElement()),r=X(n.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{}),t.on("remove",(function(){q(n.dom.attributes,(function(t){return Jn(n,t.name),0})),Xn(n,r)})),t.ui.styleSheetLoader=(o=n,i=t,jr.forElement(o,{contentCssCors:i.getParam("content_css_cors"),referrerPolicy:es(i)})),t.getParam("inline")?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden"),(u=t.getElement().form||mC.getParent(e,"form"))&&(t.formElement=u,t.getParam("hidden_input")&&!Mn(t.getElement())&&(mC.insertAfter(mC.create("input",{type:"hidden",name:e}),e),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},mC.bind(u,"submit reset",t.formEventDelegate),t.on("reset",(function(){t.resetContent()})),!t.getParam("submit_patch")||u.submit.nodeType||u.submit.length||u._mceOldSubmit||(u._mceOldSubmit=u.submit,u.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),u._mceOldSubmit(u)})),t.windowManager=Dv(t),t.notificationManager=Av(t),"xml"===t.getParam("encoding")&&t.on("GetContent",(function(t){t.save&&(t.content=mC.encode(t.content))})),t.getParam("add_form_submit_trigger")&&t.on("submit",(function(){t.initialized&&t.save()})),t.getParam("add_unload_trigger")&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),hC(t,t.suffix)):mC.bind(window,"ready",a)}(this)},gS.prototype.focus=function(t){var e;e=t,this.removed||(e?Wd:Ud)(this)},gS.prototype.hasFocus=function(){return jd(this)},gS.prototype.execCallback=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r,o=this.settings[t];if(o)return this.callbackLookup&&(r=this.callbackLookup[t])&&(o=r.func,r=r.scope),"string"==typeof o&&(r=(r=o.replace(/\.\w+$/,""))?lS(r):0,o=lS(o),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[t]={func:o,scope:r}),o.apply(r||this,e)},gS.prototype.translate=function(t){return Sa.translate(t)},gS.prototype.getParam=function(t,e,n){return function(t,e,n,r){var o,i,u,a=e in t.settings?t.settings[e]:n;return"hash"===r?(u={},"string"==typeof(i=a)?W(0<i.indexOf("=")?i.split(/[;,](?![^=;,]*(?:[;,]|$))/):i.split(","),(function(t){var e=t.split("=");1<e.length?u[ke.trim(e[0])]=ke.trim(e[1]):u[ke.trim(e[0])]=ke.trim(e[0])})):u=i,u):"string"===r?xv(E,t,e).getOr(n):"number"===r?xv(P,t,e).getOr(n):"boolean"===r?xv(N,t,e).getOr(n):"object"===r?xv(T,t,e).getOr(n):"array"===r?xv(A,t,e).getOr(n):"string[]"===r?xv((o=E,function(t){return A(t)&&Q(t,o)}),t,e).getOr(n):"function"===r?xv(I,t,e).getOr(n):a}(this,t,e,n)},gS.prototype.hasPlugin=function(t,e){return!(!z(cs(this).split(/[ ,]/),t)||e&&void 0===Bv.get(t))},gS.prototype.nodeChanged=function(t){this._nodeChangeDispatcher.nodeChanged(t)},gS.prototype.addCommand=function(t,e,n){this.editorCommands.addCommand(t,e,n)},gS.prototype.addQueryStateHandler=function(t,e,n){this.editorCommands.addQueryStateHandler(t,e,n)},gS.prototype.addQueryValueHandler=function(t,e,n){this.editorCommands.addQueryValueHandler(t,e,n)},gS.prototype.addShortcut=function(t,e,n,r){this.shortcuts.add(t,e,n,r)},gS.prototype.execCommand=function(t,e,n,r){return this.editorCommands.execCommand(t,e,n,r)},gS.prototype.queryCommandState=function(t){return this.editorCommands.queryCommandState(t)},gS.prototype.queryCommandValue=function(t){return this.editorCommands.queryCommandValue(t)},gS.prototype.queryCommandSupported=function(t){return this.editorCommands.queryCommandSupported(t)},gS.prototype.show=function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable="true":(cS.show(this.getContainer()),cS.hide(this.id)),this.load(),this.fire("show"))},gS.prototype.hide=function(){var t=this,e=t.getDoc();t.hidden||(dS&&e&&!t.inline&&e.execCommand("SelectAll"),t.save(),t.inline?(t.getBody().contentEditable="false",t===t.editorManager.focusedEditor&&(t.editorManager.focusedEditor=null)):(cS.hide(t.getContainer()),cS.setStyle(t.id,"display",t.orgDisplay)),t.hidden=!0,t.fire("hide"))},gS.prototype.isHidden=function(){return!!this.hidden},gS.prototype.setProgressState=function(t,e){this.fire("ProgressState",{state:t,time:e})},gS.prototype.load=function(t){var e=this.getElement();if(this.removed)return"";if(e){(t=t||{}).load=!0;var n=Mn(e)?e.value:e.innerHTML,r=this.setContent(n,t);return t.element=e,t.no_events||this.fire("LoadContent",t),t.element=e=null,r}},gS.prototype.save=function(t){var e,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(t=t||{}).save=!0,t.element=o,t.content=r.getContent(t),t.no_events||r.fire("SaveContent",t),"raw"===t.format&&r.fire("RawSaveContent",t),e=t.content,Mn(o)?o.value=e:(!t.is_removing&&r.inline||(o.innerHTML=e),(n=cS.getParent(r.id,"form"))&&fS(n.elements,(function(t){if(t.name===r.id)return t.value=e,!1}))),t.element=o=null,!1!==t.set_dirty&&r.setDirty(!1),e},gS.prototype.setContent=function(t,e){return ov(this,t,e)},gS.prototype.getContent=function(t){return function(t,e){var n,r;return void 0===e&&(e={}),n=e,r=e.format?e.format:"html",Ah(t).editor.getContent(n,r)}(this,t)},gS.prototype.insertContent=function(t,e){e&&(t=sS({content:t},e)),this.execCommand("mceInsertContent",!1,t)},gS.prototype.resetContent=function(t){void 0===t?ov(this,this.startContent,{format:"raw"}):ov(this,t),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},gS.prototype.isDirty=function(){return!this.isNotDirty},gS.prototype.setDirty=function(t){var e=!this.isNotDirty;this.isNotDirty=!t,t&&t!==e&&this.fire("dirty")},gS.prototype.getContainer=function(){return this.container||(this.container=cS.get(this.editorContainer||this.id+"_parent")),this.container},gS.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},gS.prototype.getElement=function(){return this.targetElm||(this.targetElm=cS.get(this.id)),this.targetElm},gS.prototype.getWin=function(){var t;return this.contentWindow||(t=this.iframeElement)&&(this.contentWindow=t.contentWindow),this.contentWindow},gS.prototype.getDoc=function(){var t;return this.contentDocument||(t=this.getWin())&&(this.contentDocument=t.document),this.contentDocument},gS.prototype.getBody=function(){var t=this.getDoc();return this.bodyElement||(t?t.body:null)},gS.prototype.convertURL=function(t,e,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",t,n,!0,e):!r.convert_urls||n&&"LINK"===n.nodeName||0===t.indexOf("file:")||0===t.length?t:r.relative_urls?this.documentBaseURI.toRelative(t):t=this.documentBaseURI.toAbsolute(t,r.remove_script_host)},gS.prototype.addVisual=function(t){!function(t,e){return n=e,Bh(t).editor.addVisual(n);var n}(this,t)},gS.prototype.remove=function(){!function(t){var e,n,r,o,i;t.removed||(e=t._selectionOverrides,n=t.editorUpload,r=t.getBody(),o=t.getElement(),r&&t.save({is_removing:!0}),t.removed=!0,t.unbindAllNativeEvents(),t.hasHiddenInput&&o&&iv.remove(o.nextSibling),t.fire("remove"),t.editorManager.remove(t),!t.inline&&r&&(i=t,iv.setStyle(i.id,"display",i.orgDisplay)),t.fire("detach"),iv.remove(t.getContainer()),uv(e),uv(n),t.destroy())}(this)},gS.prototype.destroy=function(t){!function(t,e){var n,r,o,i=t.selection,u=t.dom;t.destroyed||(e||t.removed?(e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),uv(i),uv(u)),(r=(n=t).formElement)&&(r._mceOldSubmit&&(r.submit=r._mceOldSubmit,r._mceOldSubmit=null),iv.unbind(r,"submit reset",n.formEventDelegate)),(o=t).contentAreaContainer=o.formElement=o.container=o.editorContainer=null,o.bodyElement=o.contentDocument=o.contentWindow=null,o.iframeElement=o.targetElm=null,o.selection&&(o.selection=o.selection.win=o.selection.dom=o.selection.dom.doc=null),t.destroyed=!0):t.remove())}(this,t)},gS.prototype.uploadImages=function(t){return this.editorUpload.uploadImages(t)},gS.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},gS.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},gS.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},gS.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},gS.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},gS);function gS(t,e,n){var r=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,sS(this,GC),this.settings=function(t,e,n,r,o){var i,u,a,c,s=(i=n,u=fv,a=t,c={id:e,theme:"silver",toolbar_mode:vv(o,"floating"),plugins:"",document_base_url:i,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"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,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"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,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:a.convertURL,url_converter_scope:a},Ot(Ot({},c),u?gv:{}));return yv(lv||dv,lv,s,r,o)}(this,t,this.documentBaseUrl,n.defaultSettings,e),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(ha.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),da.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),_a.languageLoad=this.settings.language_load,_a.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new uS(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new ZC(this),this.editorCommands=new EC(this),this.settings.cache_suffix&&(ye.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:eS(),styleSheetLoader:void 0,show:a,hide:a,enable:a,disable:a,isDisabled:b};var o=function(t){var e,n,r=ya("design"),o=ya({design:{activate:a,deactivate:a,editorReadOnly:!1},readonly:{activate:a,deactivate:a,editorReadOnly:!0}});return(e=t).serializer?IC(e):e.on("PreInit",(function(){IC(e)})),(n=t).on("ShowCaret",(function(t){MC(n)&&t.preventDefault()})),n.on("ObjectSelected",(function(t){MC(n)&&t.preventDefault()})),{isReadOnly:function(){return MC(t)},set:function(e){return function(t,e,n,r){if(r!==n.get()){if(!pt(e,r))throw new Error("Editor mode '"+r+"' is invalid");t.initialized?XC(t,n,e,r):t.on("init",(function(){return XC(t,n,e,r)}))}}(t,o.get(),r,e)},get:function(){return r.get()},register:function(t,e){o.set(function(t,e,n){var r;if(z($C,e))throw new Error("Cannot override default mode "+e);return Ot(Ot({},t),((r={})[e]=Ot(Ot({},n),{deactivate:function(){try{n.deactivate()}catch(t){console.error("problem while deactivating editor mode "+e+":",t)}}}),r))}(o.get(),t,e))}}}(this);this.mode=o,this.setMode=o.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=oa.overrideDefaults((function(){return{context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}}))}var pS,hS=da.DOM,vS=ke.explode,bS=ke.each,yS=ke.extend,xS=0,wS=!1,CS=[],SS=[],kS=function(t){var e=t.type;bS(TS.get(),(function(n){switch(e){case"scroll":n.fire("ScrollWindow",t);break;case"resize":n.fire("ResizeWindow",t)}}))},OS=function(t){t!==wS&&(t?oa(window).on("resize scroll",kS):oa(window).off("resize scroll",kS),wS=t)},_S=function(t){var e=SS;delete CS[t.id];for(var n=0;n<CS.length;n++)if(CS[n]===t){CS.splice(n,1);break}return SS=G(SS,(function(e){return t!==e})),TS.activeEditor===t&&(TS.activeEditor=0<SS.length?SS[0]:null),TS.focusedEditor===t&&(TS.focusedEditor=null),e.length!==SS.length},ES="CSS1Compat"!==document.compatMode,TS=Ot(Ot({},zC),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:oa,majorVersion:"5",minorVersion:"6.2",releaseDate:"2020-12-08",editors:CS,i18n:Sa,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,e="",n=uS.getDocumentBaseUrl(document.location);/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"));var r,o=window.tinymce||window.tinyMCEPreInit;if(o)t=o.base||o.baseURL,e=o.suffix;else{for(var i,u=document.getElementsByTagName("script"),a=0;a<u.length;a++)if(""!==(i=u[a].src||"")){var c=i.substring(i.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(i)){-1!==c.indexOf(".min")&&(e=".min"),t=i.substring(0,i.lastIndexOf("/"));break}}!t&&document.currentScript&&(-1!==(i=document.currentScript.src).indexOf(".min")&&(e=".min"),t=i.substring(0,i.lastIndexOf("/")))}this.baseURL=new uS(n).toAbsolute(t),this.documentBaseURL=n,this.baseURI=new uS(this.baseURL),this.suffix=e,(r=this).on("AddEditor",l(Ld,r)),r.on("RemoveEditor",l(Vd,r))},overrideDefaults:function(t){var e=t.base_url;e&&this._setBaseUrl(e);var n=t.suffix;t.suffix&&(this.suffix=n);var r=(this.defaultSettings=t).plugin_base_urls;void 0!==r&&at(r,(function(t,e){_a.PluginManager.urls[e]=t}))},init:function(t){var e,n=this,r=ke.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"," "),o=function(t){var e=t.id;return e||(e=gt(t,"name").filter((function(t){return!hS.get(t)})).getOrThunk(hS.uniqueId),t.setAttribute("id",e)),e},i=function(t,e){return e.constructor===RegExp?e.test(t.className):hS.hasClass(t,e)},u=function(t){e=t},a=function(){var e,c=0,s=[],f=function(t,r,o){var i=new mS(t,r,n);s.push(i),i.on("init",(function(){++c===e.length&&u(s)})),i.targetElm=i.targetElm||o,i.render()};hS.unbind(window,"ready",a),function(e){var r=t[e];r&&r.apply(n,Array.prototype.slice.call(arguments,2))}("onpageload"),e=oa.unique(function(t){var e=[];if(ye.browser.isIE()&&ye.browser.version.major<11)return Lv("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(ES)return Lv("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return bS(t.types,(function(t){e=e.concat(hS.select(t.selector))})),e;if(t.selector)return hS.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var n=t.elements||"";0<n.length&&bS(vS(n),(function(t){var n=hS.get(t);n?e.push(n):bS(document.forms,(function(n){bS(n.elements,(function(n){n.name===t&&(t="mce_editor_"+xS++,hS.setAttrib(n,"id",t),e.push(n))}))}))}));break;case"textareas":case"specific_textareas":bS(hS.select("textarea"),(function(n){t.editor_deselector&&i(n,t.editor_deselector)||t.editor_selector&&!i(n,t.editor_selector)||e.push(n)}))}return e}(t)),t.types?bS(t.types,(function(n){ke.each(e,(function(e){return!hS.is(e,n.selector)||(f(o(e),yS({},t,n),e),!1)}))})):(ke.each(e,(function(t){var e;(e=n.get(t.id))&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(_S(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null)})),0===(e=ke.grep(e,(function(t){return!n.get(t.id)}))).length?u([]):bS(e,(function(e){var n;n=e,t.inline&&n.tagName.toLowerCase()in r?Lv("Could not initialize inline editor on invalid inline target element",e):f(o(e),t,e)})))};return n.settings=t,hS.bind(window,"ready",a),new Tr((function(t){e?t(e):u=function(e){t(e)}}))},get:function(t){return 0===arguments.length?SS.slice(0):E(t)?Y(SS,(function(e){return e.id===t})).getOr(null):P(t)&&SS[t]?SS[t]:null},add:function(t){var e=this;return CS[t.id]===t||(null===e.get(t.id)&&("length"!==t.id&&(CS[t.id]=t),CS.push(t),SS.push(t)),OS(!0),e.activeEditor=t,e.fire("AddEditor",{editor:t}),pS||(pS=function(t){var n=e.fire("BeforeUnload");if(n.returnValue)return t.preventDefault(),t.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",pS))),t},createEditor:function(t,e){return this.add(new mS(t,e,this))},remove:function(t){var e,n,r=this;if(t){if(!E(t))return n=t,B(r.get(n.id))?null:(_S(n)&&r.fire("RemoveEditor",{editor:n}),0===SS.length&&window.removeEventListener("beforeunload",pS),n.remove(),OS(0<SS.length),n);bS(hS.select(t),(function(t){(n=r.get(t.id))&&r.remove(n)}))}else for(e=SS.length-1;0<=e;e--)r.remove(SS[e])},execCommand:function(t,e,n){var r=this.get(n);switch(t){case"mceAddEditor":return this.get(n)||new mS(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?(r.isHidden()?r.show():r.hide(),!0):(this.execCommand("mceAddEditor",0,n),!0)}return!!this.activeEditor&&this.activeEditor.execCommand(t,e,n)},triggerSave:function(){bS(SS,(function(t){t.save()}))},addI18n:function(t,e){Sa.add(t,e)},translate:function(t){return Sa.translate(t)},setActive:function(t){var e=this.activeEditor;this.activeEditor!==t&&(e&&e.fire("deactivate",{relatedTarget:t}),t.fire("activate",{relatedTarget:e})),this.activeEditor=t},_setBaseUrl:function(t){this.baseURL=new uS(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new uS(this.baseURL)}});TS.setup();var AS,BS,NS,DS,RS=Math.min,MS=Math.max,IS=Math.round,PS=function(t,e,n){var r=e.x,o=e.y,i=t.w,u=t.h,a=e.w,c=e.h,s=(n||"").split("");return"b"===s[0]&&(o+=c),"r"===s[1]&&(r+=a),"c"===s[0]&&(o+=IS(c/2)),"c"===s[1]&&(r+=IS(a/2)),"b"===s[3]&&(o-=u),"r"===s[4]&&(r-=i),"c"===s[3]&&(o-=IS(u/2)),"c"===s[4]&&(r-=IS(i/2)),FS(r,o,i,u)},FS=function(t,e,n,r){return{x:t,y:e,w:n,h:r}},LS={inflate:function(t,e,n){return FS(t.x-e,t.y-n,t.w+2*e,t.h+2*n)},relativePosition:PS,findBestRelativePosition:function(t,e,n,r){for(var o,i=0;i<r.length;i++)if((o=PS(t,e,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(t,e){var n=MS(t.x,e.x),r=MS(t.y,e.y),o=RS(t.x+t.w,e.x+e.w),i=RS(t.y+t.h,e.y+e.h);return o-n<0||i-r<0?null:FS(n,r,o-n,i-r)},clamp:function(t,e,n){var r=t.x,o=t.y,i=t.x+t.w,u=t.y+t.h,a=e.x+e.w,c=e.y+e.h,s=MS(0,e.x-r),f=MS(0,e.y-o),l=MS(0,i-a),d=MS(0,u-c);return r+=s,o+=f,n&&(i+=s,u+=f,r-=l,o-=d),FS(r,o,(i-=l)-r,(u-=d)-o)},create:FS,fromClientRect:function(t){return FS(t.left,t.top,t.width,t.height)}},VS=(AS={},BS={},{load:function(t,e){var n='Script at URL "'+e+'" failed to load',r='Script at URL "'+e+"\" did not call `tinymce.Resource.add('"+t+"', data)` within 1 second";if(void 0!==AS[t])return AS[t];var o=new Tr((function(o,i){var u=function(t,e,n){void 0===n&&(n=1e3);var r=!1,o=null,i=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(r=!0,null!==o&&(clearTimeout(o),o=null),t.apply(null,e))}},u=i(t),a=i(e);return{start:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];r||null!==o||(o=setTimeout((function(){return a.apply(null,t)}),n))},resolve:u,reject:a}}(o,i);BS[t]=u.resolve,ha.ScriptLoader.loadScript(e,(function(){return u.start(r)}),(function(){return u.reject(n)}))}));return AS[t]=o},add:function(t,e){void 0!==BS[t]&&(BS[t](e),delete BS[t]),AS[t]=Tr.resolve(e)}}),HS=ke.each,zS=ke.extend,jS=function(){};jS.extend=NS=function(t){var e=this.prototype,n=function(){var t,e,n;if(!DS&&(this.init&&this.init.apply(this,arguments),e=this.Mixins))for(t=e.length;t--;)(n=e[t]).init&&n.init.apply(this,arguments)},r=function(){return this};DS=!0;var o=new this;return DS=!1,t.Mixins&&(HS(t.Mixins,(function(e){for(var n in e)"init"!==n&&(t[n]=e[n])})),e.Mixins&&(t.Mixins=e.Mixins.concat(t.Mixins))),t.Methods&&HS(t.Methods.split(","),(function(e){t[e]=r})),t.Properties&&HS(t.Properties.split(","),(function(e){var n="_"+e;t[e]=function(t){return void 0!==t?(this[n]=t,this):this[n]}})),t.Statics&&HS(t.Statics,(function(t,e){n[e]=t})),t.Defaults&&e.Defaults&&(t.Defaults=zS({},e.Defaults,t.Defaults)),at(t,(function(t,n){var r,i;"function"==typeof t&&e[n]?o[n]=(r=n,i=t,function(){var t=this._super;this._super=e[r];var n=i.apply(this,arguments);return this._super=t,n}):o[n]=t})),n.prototype=o,(n.constructor=n).extend=NS,n};var US=Math.min,WS=Math.max,qS=Math.round,GS={serialize:function(t){var e=JSON.stringify(t);return E(e)?e.replace(/[\u0080-\uFFFF]/g,(function(t){var e=t.charCodeAt(0).toString(16);return"\\u"+"0000".substring(e.length)+e})):e},parse:function(t){try{return JSON.parse(t)}catch(t){}}},$S={callbacks:{},count:0,send:function(t){var e=this,n=da.DOM,r=void 0!==t.count?t.count:e.count,o="tinymce_jsonp_"+r;e.callbacks[r]=function(i){n.remove(o),delete e.callbacks[r],t.callback(i)},n.add(n.doc.body,"script",{id:o,src:t.url,type:"text/javascript"}),e.count++}},XS=Ot(Ot({},zC),{send:function(t){var e,n=0,r=function(){!t.async||4===e.readyState||1e4<n++?(t.success&&n<1e4&&200===e.status?t.success.call(t.success_scope,""+e.responseText,e,t):t.error&&t.error.call(t.error_scope,1e4<n?"TIMED_OUT":"GENERAL",e,t),e=null):Vr.setTimeout(r,10)};if(t.scope=t.scope||this,t.success_scope=t.success_scope||t.scope,t.error_scope=t.error_scope||t.scope,t.async=!1!==t.async,t.data=t.data||"",XS.fire("beforeInitialize",{settings:t}),(e=new XMLHttpRequest).overrideMimeType&&e.overrideMimeType(t.content_type),e.open(t.type||(t.data?"POST":"GET"),t.url,t.async),t.crossDomain&&(e.withCredentials=!0),t.content_type&&e.setRequestHeader("Content-Type",t.content_type),t.requestheaders&&ke.each(t.requestheaders,(function(t){e.setRequestHeader(t.key,t.value)})),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),(e=XS.fire("beforeSend",{xhr:e,settings:t}).xhr).send(t.data),!t.async)return r();Vr.setTimeout(r,10)}}),YS=ke.extend,KS=(JS.sendRPC=function(t){return(new JS).send(t)},JS.prototype.send=function(t){var e=t.error,n=t.success,r=YS(this.settings,t);r.success=function(t,o){void 0===(t=GS.parse(t))&&(t={error:"JSON Parse error."}),t.error?e.call(r.error_scope||r.scope,t.error,o):n.call(r.success_scope||r.scope,t.result)},r.error=function(t,n){e&&e.call(r.error_scope||r.scope,t,n)},r.data=GS.serialize({id:t.id||"c"+this.count++,method:t.method,params:t.params}),r.content_type="application/json",XS.send(r)},JS);function JS(t){this.settings=YS({},t),this.count=0}try{var QS,ZS="__storage_test__";(QS=window.localStorage).setItem(ZS,ZS),QS.removeItem(ZS)}catch(t){QS=function(){return t={},e=[],n={getItem:function(e){return t[e]||null},setItem:function(n,r){e.push(n),t[n]=String(r)},key:function(t){return e[t]},removeItem:function(n){e=e.filter((function(t){return t===n})),delete t[n]},clear:function(){e=[],t={}},length:0},Object.defineProperty(n,"length",{get:function(){return e.length},configurable:!1,enumerable:!1}),n;var t,e,n}()}var tk,ek={geom:{Rect:LS},util:{Promise:Tr,Delay:Vr,Tools:ke,VK:Rl,URI:uS,Class:jS,EventDispatcher:FC,Observable:zC,I18n:Sa,XHR:XS,JSON:GS,JSONRequest:KS,JSONP:$S,LocalStorage:QS,Color:function(t){var e={},n=0,r=0,o=0,i=function(t){var i;return"object"==typeof t?"r"in t?(n=t.r,r=t.g,o=t.b):"v"in t&&function(t,e,i){if(t=(parseInt(t,10)||0)%360,e=parseInt(e,10)/100,i=parseInt(i,10)/100,e=WS(0,US(e,1)),i=WS(0,US(i,1)),0!==e){var u=t/60,a=i*e,c=a*(1-Math.abs(u%2-1)),s=i-a;switch(Math.floor(u)){case 0:n=a,r=c,o=0;break;case 1:n=c,r=a,o=0;break;case 2:n=0,r=a,o=c;break;case 3:n=0,r=c,o=a;break;case 4:n=c,r=0,o=a;break;case 5:n=a,r=0,o=c;break;default:n=r=o=0}n=qS(255*(n+s)),r=qS(255*(r+s)),o=qS(255*(o+s))}else n=r=o=qS(255*i)}(t.h,t.s,t.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(t))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(t))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(t))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:255<n?255:n,r=r<0?0:255<r?255:r,o=o<0?0:255<o?255:o,e};return t&&i(t),e.toRgb=function(){return{r:n,g:r,b:o}},e.toHsv=function(){return t=n,e=r,i=o,a=0,(c=US(t/=255,US(e/=255,i/=255)))===(s=WS(t,WS(e,i)))?{h:0,s:0,v:100*(a=c)}:(u=(s-c)/s,{h:qS(60*((t===c?3:i===c?1:5)-(t===c?e-i:i===c?t-e:i-t)/((a=s)-c))),s:qS(100*u),v:qS(100*a)});var t,e,i,u,a,c,s},e.toHex=function(){var t=function(t){return 1<(t=parseInt(t,10).toString(16)).length?t:"0"+t};return"#"+t(n)+t(r)+t(o)},e.parse=i,e}},dom:{EventUtils:bi,Sizzle:bu,DomQuery:oa,TreeWalker:Ur,TextSeeker:$a,DOMUtils:da,ScriptLoader:ha,RangeUtils:Zl,Serializer:rv,StyleSheetLoader:Hr,ControlSelection:Il,BookmarkManager:Bl,Selection:Ph,Event:bi.Event},html:{Styles:fi,Entities:Qo,Node:sm,Schema:ci,SaxParser:xm,DomParser:tv,Writer:dm,Serializer:mm},Env:ye,AddOnManager:_a,Annotator:El,Formatter:Kv,UndoManager:Jv,EditorCommands:EC,WindowManager:Dv,NotificationManager:Av,EditorObservable:GC,Shortcuts:ZC,Editor:mS,FocusManager:Md,EditorManager:TS,DOM:da.DOM,ScriptLoader:ha.ScriptLoader,PluginManager:Bv,ThemeManager:Nv,IconManager:wv,Resource:VS,trim:ke.trim,isArray:ke.isArray,is:ke.is,toArray:ke.toArray,makeMap:ke.makeMap,each:ke.each,map:ke.map,grep:ke.grep,inArray:ke.inArray,extend:ke.extend,create:ke.create,walk:ke.walk,createNS:ke.createNS,resolve:ke.resolve,explode:ke.explode,_addCacheSuffix:ke._addCacheSuffix,isOpera:ye.opera,isWebKit:ye.webkit,isIE:ye.ie,isGecko:ye.gecko,isMac:ye.mac},nk=ke.extend(TS,ek);tk=nk,window.tinymce=tk,window.tinyMCE=tk,function(t){if("object"==typeof module)try{module.exports=t}catch(t){}}(nk)}(),function(){"use strict";var t=function(){},e=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},n=function(t){return function(){return t}},r=function(t){return t};function o(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var i=function(t){return function(e){return!t(e)}},u=function(t){return function(){throw new Error(t)}},a=n(!1),c=n(!0),s=tinymce.util.Tools.resolve("tinymce.ThemeManager"),f=function(){return(f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function l(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function d(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}var m,g=function(){return p},p=function(){var e=function(t){return t.isNone()},r=function(t){return t()},o=function(t){return t};return{fold:function(t,e){return t()},is:a,isSome:a,isNone:c,getOr:o,getOrThunk:r,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:n(null),getOrUndefined:n(void 0),or:o,orThunk:r,map:g,each:t,bind:g,exists:a,forall:c,filter:g,equals:e,equals_:e,toArray:function(){return[]},toString:n("none()")}}(),h=function(t){var e=n(t),r=function(){return i},o=function(e){return e(t)},i={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:c,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:r,orThunk:r,map:function(e){return h(e(t))},each:function(e){e(t)},bind:o,exists:o,forall:o,filter:function(e){return e(t)?i:p},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(a,(function(e){return n(t,e)}))}};return i},v={some:h,none:g,from:function(t){return null==t?p:h(t)}},b=function(t){return function(e){return function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(e)===t}},y=function(t){return function(e){return typeof e===t}},x=b("string"),w=b("object"),C=b("array"),S=y("boolean"),k=function(t){return function(e){return t===e}}(void 0),O=function(t){return!function(t){return null==t}(t)},_=y("function"),E=y("number"),T=function(t,e){if(C(t)){for(var n=0,r=t.length;n<r;++n)if(!e(t[n]))return!1;return!0}return!1},A=Array.prototype.slice,B=Array.prototype.indexOf,N=Array.prototype.push,D=function(t,e){return B.call(t,e)},R=function(t,e){return D(t,e)>-1},M=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},I=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},P=function(t,e){for(var n=[],r=0;r<t.length;r+=e){var o=A.call(t,r,r+e);n.push(o)}return n},F=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},L=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},V=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u,o)?n:r).push(u)}return{pass:n,fail:r}},H=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},z=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)}(t,(function(t){n=e(n,t)})),n},j=function(t,e,n){return L(t,(function(t){n=e(n,t)})),n},U=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return v.some(i);if(n(i,r))break}return v.none()}(t,e,a)},W=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return v.some(n)}return v.none()},q=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!C(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);N.apply(e,t[n])}return e},G=function(t,e){return q(F(t,e))},$=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},X=function(t){var e=A.call(t,0);return e.reverse(),e},Y=function(t,e){return H(t,(function(t){return!R(e,t)}))},K=function(t,e){var n=A.call(t,0);return n.sort(e),n},J=function(t,e){return e>=0&&e<t.length?v.some(t[e]):v.none()},Q=function(t){return J(t,0)},Z=function(t){return J(t,t.length-1)},tt=_(Array.from)?Array.from:function(t){return A.call(t)},et=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return v.none()},nt=function(t){return{is:function(e){return t===e},isValue:c,isError:a,getOr:n(t),getOrThunk:n(t),getOrDie:n(t),or:function(e){return nt(t)},orThunk:function(e){return nt(t)},fold:function(e,n){return n(t)},map:function(e){return nt(e(t))},mapError:function(e){return nt(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return v.some(t)}}},rt=function(e){return{is:a,isValue:a,isError:c,getOr:r,getOrThunk:function(t){return t()},getOrDie:function(){return u(String(e))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return rt(e)},mapError:function(t){return rt(t(e))},each:t,bind:function(t){return rt(e)},exists:a,forall:c,toOptional:v.none}},ot={value:nt,error:rt,fromOption:function(t,e){return t.fold((function(){return rt(e)}),nt)}};!function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"}(m||(m={}));var it=function(t,e,n){return t.stype===m.Error?e(t.serror):n(t.svalue)},ut=function(t){return{stype:m.Value,svalue:t}},at=function(t){return{stype:m.Error,serror:t}},ct=function(t){return t.fold(at,ut)},st=function(t){return it(t,ot.error,ot.value)},ft=ut,lt=function(t){var e=[],n=[];return L(t,(function(t){it(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},dt=at,mt=function(t,e){return t.stype===m.Value?e(t.svalue):t},gt=function(t,e){return t.stype===m.Error?e(t.serror):t},pt=function(t,e){return t.stype===m.Value?{stype:m.Value,svalue:e(t.svalue)}:t},ht=function(t,e){return t.stype===m.Error?{stype:m.Error,serror:e(t.serror)}:t},vt=Object.keys,bt=Object.hasOwnProperty,yt=function(t,e){for(var n=vt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},xt=function(t,e){return wt(t,(function(t,n){return{k:n,v:e(t,n)}}))},wt=function(t,e){var n={};return yt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},Ct=function(e,n){var r={};return function(t,e,n,r){yt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(e,n,function(t){return function(e,n){t[n]=e}}(r),t),r},St=function(t,e){var n=[];return yt(t,(function(t,r){n.push(e(t,r))})),n},kt=function(t,e){for(var n=vt(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];if(e(u,i,t))return v.some(u)}return v.none()},Ot=function(t){return St(t,(function(t){return t}))},_t=function(t,e){return Et(t,e)?v.from(t[e]):v.none()},Et=function(t,e){return bt.call(t,e)},Tt=function(t,e){return Et(t,e)&&void 0!==t[e]&&null!==t[e]},At=function(t){if(!C(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return L(t,(function(r,o){var i=vt(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!C(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){var n=arguments.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];var c=function(t){var n=vt(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!$(e,(function(t){return R(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,r)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[o];return e.apply(null,r)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:r})}}}})),n},Bt=Object.prototype.hasOwnProperty,Nt=function(t){return function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)Bt.call(i,u)&&(r[u]=t(r[u],i[u]))}return r}},Dt=Nt((function(t,e){return w(t)&&w(e)?Dt(t,e):e})),Rt=Nt((function(t,e){return e})),Mt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},It=At([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),Pt=function(t){return It.defaultedThunk(n(t))},Ft=function(t){return It.mergeWithThunk(n(t))},Lt=It.strict,Vt=It.asOption,Ht=It.defaultedThunk,zt=(It.asDefaultedOptionThunk,It.mergeWithThunk),jt=(At([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t,e){var n;return(n={})[t]=e,n}),Ut=function(t,e){return function(t,e){var n={};return yt(t,(function(t,r){R(e,r)||(n[r]=t)})),n}(t,e)},Wt=function(t,e){return jt(t,e)},qt=function(t){return function(t){var e={};return L(t,(function(t){e[t.key]=t.value})),e}(t)},Gt=function(t,e){var n,r=function(t){var e=[],n=[];return L(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}}(t);return r.errors.length>0?(n=r.errors,ot.error(q(n))):function(t,e){return 0===t.length?ot.value(e):ot.value(Dt(e,Rt.apply(void 0,t)))}(r.values,e)},$t=function(t){return e(dt,q)(t)},Xt=function(t,e){var n=lt(t);return n.errors.length>0?$t(n.errors):function(t,e){return t.length>0?ft(Dt(e,Rt.apply(void 0,t))):ft(e)}(n.values,e)},Yt=function(t){var e=lt(t);return e.errors.length>0?$t(e.errors):ft(e.values)},Kt=function(t){return w(t)&&vt(t).length>100?" removed due to size":JSON.stringify(t,null,2)},Jt=function(t,e){return dt([{path:t,getErrorInfo:e}])},Qt=At([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),Zt=function(t,e,n){return _t(e,n).fold((function(){return function(t,e,n){return Jt(t,(function(){return'Could not find valid *strict* value for "'+e+'" in '+Kt(n)}))}(t,n,e)}),ft)},te=function(t,e,n){var o=_t(t,e).fold((function(){return n(t)}),r);return ft(o)},ee=function(t,e,r,o){return r.fold((function(r,i,u,a){var c=function(e){var n=a.extract(t.concat([r]),o,e);return pt(n,(function(t){return jt(i,o(t))}))},s=function(e){return e.fold((function(){var t=jt(i,o(v.none()));return ft(t)}),(function(e){var n=a.extract(t.concat([r]),o,e);return pt(n,(function(t){return jt(i,o(v.some(t)))}))}))};return u.fold((function(){return mt(Zt(t,e,r),c)}),(function(t){return mt(te(e,r,t),c)}),(function(){return mt(function(t,e){return ft(_t(t,e))}(e,r),s)}),(function(t){return mt(function(t,e,n){var r=_t(t,e).map((function(e){return!0===e?n(t):e}));return ft(r)}(e,r,t),s)}),(function(t){var o=t(e),i=pt(te(e,r,n({})),(function(t){return Dt(o,t)}));return mt(i,c)}))}),(function(t,n){var r=n(e);return ft(jt(t,o(r)))}))},ne=function(t){return{extract:function(e,n,r){return gt(t(r,n),(function(t){return function(t,e){return Jt(t,(function(){return e}))}(e,t)}))},toString:function(){return"val"}}},re=function(t){return vt(Ct(t,(function(t){return null!=t})))},oe=function(t){var e=ie(t),r=z(t,(function(t,e){return e.fold((function(e){return Dt(t,Wt(e,!0))}),n(t))}),{});return{extract:function(t,n,o){var i=S(o)?[]:re(o),u=H(i,(function(t){return!Tt(r,t)}));return 0===u.length?e.extract(t,n,o):function(t,e){return Jt(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))}(t,u)},toString:e.toString}},ie=function(t){return{extract:function(e,n,r){return function(t,e,n,r){var o=F(n,(function(n){return ee(t,e,n,r)}));return Xt(o,{})}(e,r,t,n)},toString:function(){return"obj{\n"+F(t,(function(t){return t.fold((function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))})).join("\n")+"}"}}},ue=function(t){return{extract:function(e,n,r){var o=F(r,(function(r,o){return t.extract(e.concat(["["+o+"]"]),n,r)}));return Yt(o)},toString:function(){return"array("+t.toString()+")"}}},ae=function(t){return{extract:function(e,n,r){for(var o=[],i=0,u=t;i<u.length;i++){var a=u[i].extract(e,n,r);if(a.stype===m.Value)return a;o.push(a)}return Yt(o)},toString:function(){return"oneOf("+F(t,(function(t){return t.toString()})).join(", ")+")"}}},ce=function(t,e){return{extract:function(n,o,i){var u=vt(i),a=function(e,n){return ue(ne(t)).extract(e,r,n)}(n,u);return mt(a,(function(t){var r=F(t,(function(t){return Qt.field(t,t,Lt(),e)}));return ie(r).extract(n,o,i)}))},toString:function(){return"setOf("+e.toString()+")"}}},se=n(ne(ft)),fe=e(ue,ie),le=Qt.state,de=Qt.field,me=function(t,e,n,r,o){return _t(r,o).fold((function(){return function(t,e,n){return Jt(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+Kt(e)}))}(t,r,o)}),(function(r){return r.extract(t.concat(["branch: "+o]),e,n)}))},ge=function(t,e){return{extract:function(n,r,o){return _t(o,t).fold((function(){return function(t,e){return Jt(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))}(n,t)}),(function(t){return me(n,r,o,e,t)}))},toString:function(){return"chooseOn("+t+"). Possible values: "+vt(e)}}},pe=ne(ft),he=function(t){return fe(t)},ve=function(t){return{extract:function(e,n,r){return t().extract(e,n,r)},toString:function(){return t().toString()}}},be=function(t){return ne((function(e){return t(e).fold(dt,ft)}))},ye=function(t,e){return ce((function(e){return ct(t(e))}),e)},xe=function(t,e,n){return st(function(t,e,n,r){var o=e.extract([t],n,r);return ht(o,(function(t){return{input:r,errors:t}}))}(t,e,r,n))},we=function(t){return t.fold((function(t){throw new Error(Se(t))}),r)},Ce=function(t,e,n){return we(xe(t,e,n))},Se=function(t){return"Errors: \n"+(e=t.errors,n=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,F(n,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))).join("\n")+"\n\nInput object: "+Kt(t.input);var e,n},ke=function(t,e){return ge(t,e)},Oe=function(t,e){return ge(t,xt(e,ie))},_e=n(pe),Ee=function(t,e){return ne((function(n){var r=typeof n;return t(n)?ft(n):dt("Expected type: "+e+" but got: "+r)}))},Te=Ee(E,"number"),Ae=Ee(x,"string"),Be=Ee(S,"boolean"),Ne=Ee(_,"function"),De=function(t){var e=function(t,e){for(var n=t.next();!n.done;){if(!e(n.value))return!1;n=t.next()}return!0};if(Object(t)!==t)return!0;switch({}.toString.call(t).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(t).every((function(e){return De(t[e])}));case"Map":return e(t.keys(),De)&&e(t.values(),De);case"Set":return e(t.keys(),De);default:return!1}},Re=ne((function(t){return De(t)?ft(t):dt("Expected value to be acceptable for sending via postMessage")})),Me=function(t){return be((function(e){return R(t,e)?ot.value(e):ot.error('Unsupported value: "'+e+'", choose one of "'+t.join(", ")+'".')}))},Ie=function(t){return de(t,t,Lt(),se())},Pe=function(t,e){return de(t,t,Lt(),e)},Fe=function(t){return Pe(t,Te)},Le=function(t){return Pe(t,Ae)},Ve=function(t,e){return de(t,t,Lt(),Me(e))},He=function(t){return Pe(t,Ne)},ze=function(t,e){return de(t,t,Lt(),ie(e))},je=function(t,e){return de(t,t,Lt(),fe(e))},Ue=function(t,e){return de(t,t,Lt(),ue(e))},We=function(t){return de(t,t,Vt(),se())},qe=function(t,e){return de(t,t,Vt(),e)},Ge=function(t){return qe(t,Te)},$e=function(t){return qe(t,Ae)},Xe=function(t){return qe(t,Ne)},Ye=function(t,e){return qe(t,ie(e))},Ke=function(t,e){return de(t,t,Pt(e),se())},Je=function(t,e,n){return de(t,t,Pt(e),n)},Qe=function(t,e){return Je(t,e,Te)},Ze=function(t,e){return Je(t,e,Ae)},tn=function(t,e,n){return Je(t,e,Me(n))},en=function(t,e){return Je(t,e,Be)},nn=function(t,e){return Je(t,e,Ne)},rn=function(t,e,n){return Je(t,e,ue(n))},on=function(t,e,n){return Je(t,e,ie(n))},un=function(t,e){return le(t,e)},an=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},cn=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},sn={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return cn(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return cn(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return cn(n)},fromDom:cn,fromPoint:function(t,e,n){return v.from(t.dom.elementFromPoint(e,n)).map(cn)}},fn=function(){return ln(0,0)},ln=function(t,e){return{major:t,minor:e}},dn={nu:ln,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?fn():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return ln(r(1),r(2))}(t,n)},unknown:fn},mn=function(t,e){var n=String(e).toLowerCase();return U(t,(function(t){return t.search(n)}))},gn=function(t,e){return mn(t,e).map((function(t){var n=dn.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},pn=function(t,e){return mn(t,e).map((function(t){var n=dn.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},hn=function(t,e){return-1!==t.indexOf(e)},vn=function(t,e){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(t,e,t.length-e.length)},bn=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),yn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,xn=function(t){return function(e){return hn(e,t)}},wn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return hn(t,"edge/")&&hn(t,"chrome")&&hn(t,"safari")&&hn(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,yn],search:function(t){return hn(t,"chrome")&&!hn(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return hn(t,"msie")||hn(t,"trident")}},{name:"Opera",versionRegexes:[yn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:xn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:xn("firefox")},{name:"Safari",versionRegexes:[yn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(hn(t,"safari")||hn(t,"mobile/"))&&hn(t,"applewebkit")}}],Cn=[{name:"Windows",search:xn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return hn(t,"iphone")||hn(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:xn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:xn("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:xn("linux"),versionRegexes:[]},{name:"Solaris",search:xn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:xn("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:xn("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Sn={browsers:n(wn),oses:n(Cn)},kn="Edge",On="Chrome",_n="Opera",En="Firefox",Tn="Safari",An=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(kn),isChrome:r(On),isIE:r("IE"),isOpera:r(_n),isFirefox:r(En),isSafari:r(Tn)}},Bn={unknown:function(){return An({current:void 0,version:dn.unknown()})},nu:An,edge:n(kn),chrome:n(On),ie:n("IE"),opera:n(_n),firefox:n(En),safari:n(Tn)},Nn="Windows",Dn="Android",Rn="Linux",Mn="Solaris",In="FreeBSD",Pn="ChromeOS",Fn=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Nn),isiOS:r("iOS"),isAndroid:r(Dn),isOSX:r("OSX"),isLinux:r(Rn),isSolaris:r(Mn),isFreeBSD:r(In),isChromeOS:r(Pn)}},Ln={unknown:function(){return Fn({current:void 0,version:dn.unknown()})},nu:Fn,windows:n(Nn),ios:n("iOS"),android:n(Dn),linux:n(Rn),osx:n("OSX"),solaris:n(Mn),freebsd:n(In),chromeos:n(Pn)},Vn=function(t,e){var r=Sn.browsers(),o=Sn.oses(),i=gn(r,t).fold(Bn.unknown,Bn.nu),u=pn(o,t).fold(Ln.unknown,Ln.nu),a=function(t,e,r,o){var i=t.isiOS()&&!0===/ipad/i.test(r),u=t.isiOS()&&!i,a=t.isiOS()||t.isAndroid(),c=a||o("(pointer:coarse)"),s=i||!u&&a&&o("(min-device-width:768px)"),f=u||a&&!s,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),d=!f&&!s&&!l;return{isiPad:n(i),isiPhone:n(u),isTablet:n(s),isPhone:n(f),isTouch:n(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:n(l),isDesktop:n(d)}}(u,i,t,e);return{browser:i,os:u,deviceType:a}},Hn=function(t){return window.matchMedia(t).matches},zn=Mt((function(){return Vn(navigator.userAgent,Hn)})),jn=function(){return zn()},Un=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Wn=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},qn=function(t,e){return t.dom===e.dom},Gn=function(t,e){return function(t,e){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t,e,Node.DOCUMENT_POSITION_CONTAINED_BY)}(t.dom,e.dom)},$n=function(t,e){return jn().browser.isIE()?Gn(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},Xn=function(t){return _(t)?t:a},Yn=function(t,e,n){for(var r=t.dom,o=Xn(n);r.parentNode;){r=r.parentNode;var i=sn.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return v.none()},Kn=function(t,e,n){var r=e(t),o=Xn(n);return r.orThunk((function(){return o(t)?v.none():Yn(t,e,o)}))},Jn=function(t,e){return qn(t.element,e.event.target)},Qn=function(e){if(!Tt(e,"can")&&!Tt(e,"abort")&&!Tt(e,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(e,null,2)+" does not have can, abort, or run!");return Ce("Extracting event.handler",oe([Ke("can",c),Ke("abort",a),Ke("run",t)]),e)},Zn=function(t){var e=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return j(t,(function(t,r){return t&&e(r).apply(void 0,n)}),!0)}}(t,(function(t){return t.can})),n=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return j(t,(function(t,r){return t||e(r).apply(void 0,n)}),!1)}}(t,(function(t){return t.abort}));return Qn({can:e,abort:n,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];L(t,(function(t){t.run.apply(void 0,e)}))}})},tr=n,er=tr("touchstart"),nr=tr("touchmove"),rr=tr("touchend"),or=tr("touchcancel"),ir=tr("mousedown"),ur=tr("mousemove"),ar=tr("mouseout"),cr=tr("mouseup"),sr=tr("mouseover"),fr=tr("focusin"),lr=tr("focusout"),dr=tr("keydown"),mr=tr("keyup"),gr=tr("input"),pr=tr("change"),hr=tr("click"),vr=tr("transitionend"),br=tr("selectstart"),yr=function(t){return n("alloy."+t)},xr={tap:yr("tap")},wr=yr("focus"),Cr=yr("blur.post"),Sr=yr("paste.post"),kr=yr("receive"),Or=yr("execute"),_r=yr("focus.item"),Er=xr.tap,Tr=yr("longpress"),Ar=yr("sandbox.close"),Br=yr("typeahead.cancel"),Nr=yr("system.init"),Dr=yr("system.touchmove"),Rr=yr("system.touchend"),Mr=yr("system.scroll"),Ir=yr("system.resize"),Pr=yr("system.attached"),Fr=yr("system.detached"),Lr=yr("system.dismissRequested"),Vr=yr("system.repositionRequested"),Hr=yr("focusmanager.shifted"),zr=yr("slotcontainer.visibility"),jr=yr("change.tab"),Ur=yr("dismiss.tab"),Wr=yr("highlight"),qr=yr("dehighlight"),Gr=function(t,e){Kr(t,t.element,e,{})},$r=function(t,e,n){Kr(t,t.element,e,n)},Xr=function(t){Gr(t,Or())},Yr=function(t,e,n){Kr(t,e,n,{})},Kr=function(t,e,n,r){var o=f({target:e},r);t.getSystem().triggerEvent(n,e,o)},Jr=function(t,e,n,r){t.getSystem().triggerEvent(n,e,r.event)},Qr=function(t){return qt(t)},Zr=function(t,e){return{key:t,value:Qn({abort:e})}},to=function(t){return{key:t,value:Qn({run:function(t,e){e.event.prevent()}})}},eo=function(t,e){return{key:t,value:Qn({run:e})}},no=function(t,e,n){return{key:t,value:Qn({run:function(t,r){e.apply(void 0,[t,r].concat(n))}})}},ro=function(t){return function(e){return{key:t,value:Qn({run:function(t,n){Jn(t,n)&&e(t,n)}})}}},oo=function(t,e,n){return function(t,e){return eo(t,(function(n,r){n.getSystem().getByUid(e).each((function(e){Jr(e,e.element,t,r)}))}))}(t,e.partUids[n])},io=function(t,e){return eo(t,(function(t,n){var r=n.event,o=t.getSystem().getByDom(r.target).fold((function(){return Kn(r.target,(function(e){return t.getSystem().getByDom(e).toOptional()}),a).getOr(t)}),(function(t){return t}));e(t,o,n)}))},uo=function(t){return eo(t,(function(t,e){e.cut()}))},ao=function(t){return eo(t,(function(t,e){e.stop()}))},co=function(t,e){return ro(t)(e)},so=ro(Pr()),fo=ro(Fr()),lo=ro(Nr()),mo=function(t){return function(e){return eo(t,e)}}(Or()),go=("undefined"!=typeof window?window:Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),po=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},ho=po(1),vo=po(3),bo=po(9),yo=po(11),xo=function(t){return sn.fromDom(t.dom.ownerDocument)},wo=function(t){return bo(t)?t:xo(t)},Co=function(t){return sn.fromDom(wo(t).dom.documentElement)},So=function(t){return sn.fromDom(wo(t).dom.defaultView)},ko=function(t){return v.from(t.dom.parentNode).map(sn.fromDom)},Oo=function(t){return v.from(t.dom.offsetParent).map(sn.fromDom)},_o=function(t){return F(t.dom.childNodes,sn.fromDom)},Eo=function(t,e){var n=t.dom.childNodes;return v.from(n[e]).map(sn.fromDom)},To=function(t,e){ko(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Ao=function(t,e){(function(t){return v.from(t.dom.nextSibling).map(sn.fromDom)})(t).fold((function(){ko(t).each((function(t){No(t,e)}))}),(function(t){To(t,e)}))},Bo=function(t,e){(function(t){return Eo(t,0)})(t).fold((function(){No(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},No=function(t,e){t.dom.appendChild(e.dom)},Do=function(t,e){L(e,(function(e){No(t,e)}))},Ro=function(t){t.dom.textContent="",L(_o(t),(function(t){Mo(t)}))},Mo=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Io=function(t){var e,n=_o(t);n.length>0&&(e=t,L(n,(function(t){To(e,t)}))),Mo(t)},Po=function(t){return t.dom.innerHTML},Fo=function(t,e){var n,r,o=xo(t).dom,i=sn.fromDom(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,_o(sn.fromDom(r)));Do(i,u),Ro(t),No(t,i)},Lo=function(t,e,n){if(!(x(n)||S(n)||E(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Vo=function(t,e,n){Lo(t.dom,e,n)},Ho=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},zo=function(t,e){return v.from(Ho(t,e))},jo=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},Uo=function(t,e){t.dom.removeAttribute(e)},Wo=function(t){return function(t,e){return sn.fromDom(t.dom.cloneNode(e))}(t,!1)},qo=function(t){return function(t){var e=sn.fromTag("div"),n=sn.fromDom(t.dom.cloneNode(!0));return No(e,n),Po(e)}(Wo(t))},Go=function(t){return qo(t)},$o=Qr([function(t,e){return{key:t,value:Qn({can:e})}}(wr(),(function(t,e){var n=e.event,r=n.originator,o=n.target;return!function(t,e,n){return qn(e,t.element)&&!qn(e,n)}(t,r,o)||(console.warn(wr()+" did not get interpreted by the desired target. \nOriginator: "+Go(r)+"\nTarget: "+Go(o)+"\nCheck the "+wr()+" event handlers"),!1)}))]),Xo=Object.freeze({__proto__:null,events:$o}),Yo=0,Ko=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++Yo+String(e)},Jo=n("alloy-id-"),Qo=n("data-alloy-id"),Zo=Jo(),ti=Qo(),ei=function(t,e){Object.defineProperty(t.dom,ti,{value:e,writable:!0})},ni=function(t){var e=ho(t)?t.dom[ti]:null;return v.from(e)},ri=function(t){return Ko(t)},oi=r,ii=function(t){var e=function(e){return function(){throw new Error("The component must be in a context to send: "+e+(t?"\n"+Go(t().element)+" is not in context.":""))}};return{debugInfo:n("fake"),triggerEvent:e("triggerEvent"),triggerFocus:e("triggerFocus"),triggerEscape:e("triggerEscape"),build:e("build"),addToWorld:e("addToWorld"),removeFromWorld:e("removeFromWorld"),addToGui:e("addToGui"),removeFromGui:e("removeFromGui"),getByUid:e("getByUid"),getByDom:e("getByDom"),broadcast:e("broadcast"),broadcastOn:e("broadcastOn"),broadcastEvent:e("broadcastEvent"),isConnected:a}},ui=ii(),ai=function(t){return F(t,(function(t){return vn(t,"/*")?t.substring(0,t.length-"/*".length):t}))},ci=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:ai(i)}},t},si=Ko("alloy-premade"),fi=function(t){return Wt(si,t)},li=function(t){return function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:ai(i.slice(1))}},t}((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return t.apply(void 0,d([e.getApis(),e],n))}),t)},di={init:function(){return mi({readState:function(){return"No State required"}})}},mi=function(t){return t},gi=function(t,e){var n={};return yt(t,(function(t,r){yt(t,(function(t,o){var i=_t(n,o).getOr([]);n[o]=i.concat([e(r,t)])}))})),n},pi=function(t){return{classes:void 0!==t.classes?t.classes:[],attributes:void 0!==t.attributes?t.attributes:{},styles:void 0!==t.styles?t.styles:{}}},hi=function(t){return t.cHandler},vi=function(t,e){return{name:t,handler:e}},bi=function(t,e,n){var r=f(f({},n),function(t,e){var n={};return L(t,(function(t){n[t.name()]=t.handlers(e)})),n}(e,t));return gi(r,vi)},yi=function(t){var e=function(t){return _(t)?{can:n(!0),abort:n(!1),run:t}:t}(t);return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[t,n].concat(r);e.abort.apply(void 0,i)?n.stop():e.can.apply(void 0,i)&&e.run.apply(void 0,i)}},xi=function(t,e,n){var r=e[n];return r?function(t,e,n,r){try{var o=K(n,(function(n,o){var i=n[e],u=o[e],a=r.indexOf(i),c=r.indexOf(u);if(-1===a)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===c)throw new Error("The ordering for "+t+" does not have an entry for "+u+".\nOrder specified: "+JSON.stringify(r,null,2));return a<c?-1:c<a?1:0}));return ot.value(o)}catch(t){return ot.error([t])}}("Event: "+n,"name",t,r).map((function(t){var e=F(t,(function(t){return t.handler}));return Zn(e)})):function(t,e){return ot.error(["The event ("+t+') 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(F(e,(function(t){return t.name})),null,2)])}(n,t)},wi=function(t,e){var n=St(t,(function(t,n){return(1===t.length?ot.value(t[0].handler):xi(t,e,n)).map((function(r){var o=yi(r),i=t.length>1?H(e[n],(function(e){return M(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return Wt(n,function(t,e){return{handler:t,purpose:e}}(o,i))}))}));return Gt(n,{})},Ci="alloy.base.behaviour",Si=function(t){return t.events},ki=function(t,e){var n=Ho(t,e);return void 0===n||""===n?[]:n.split(" ")},Oi=function(t){return void 0!==t.dom.classList},_i=function(t,e){return function(t,e,n){var r=ki(t,e).concat([n]);return Vo(t,e,r.join(" ")),!0}(t,"class",e)},Ei=function(t,e){return function(t,e,n){var r=H(ki(t,e),(function(t){return t!==n}));return r.length>0?Vo(t,e,r.join(" ")):Uo(t,e),!1}(t,"class",e)},Ti=function(t,e){Oi(t)?t.dom.classList.add(e):_i(t,e)},Ai=function(t){0===(Oi(t)?t.dom.classList:function(t){return ki(t,"class")}(t)).length&&Uo(t,"class")},Bi=function(t,e){Oi(t)?t.dom.classList.remove(e):Ei(t,e);Ai(t)},Ni=function(t,e){return Oi(t)&&t.dom.classList.contains(e)},Di=function(t,e){L(e,(function(e){Ti(t,e)}))},Ri=function(t,e){L(e,(function(e){Bi(t,e)}))},Mi=function(t){return void 0!==t.style&&_(t.style.getPropertyValue)},Ii=function(t){return yo(t)},Pi=_(Element.prototype.attachShadow)&&_(Node.prototype.getRootNode),Fi=n(Pi),Li=Pi?function(t){return sn.fromDom(t.dom.getRootNode())}:wo,Vi=function(t){return Ii(t)?t:sn.fromDom(wo(t).dom.body)},Hi=function(t){var e=Li(t);return Ii(e)?v.some(e):v.none()},zi=function(t){return sn.fromDom(t.dom.host)},ji=function(t){return O(t.dom.shadowRoot)},Ui=function(t){var e=vo(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return Hi(sn.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=Ui,r=zi,function(t){return n(r(t))}))},Wi=function(){return qi(sn.fromDom(document))},qi=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return sn.fromDom(e)},Gi=function(t,e,n){if(!x(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Mi(t)&&t.style.setProperty(e,n)},$i=function(t,e){Mi(t)&&t.style.removeProperty(e)},Xi=function(t,e,n){var r=t.dom;Gi(r,e,n)},Yi=function(t,e){var n=t.dom;yt(e,(function(t,e){Gi(n,e,t)}))},Ki=function(t,e){var n=t.dom;yt(e,(function(t,e){t.fold((function(){$i(n,e)}),(function(t){Gi(n,e,t)}))}))},Ji=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||Ui(t)?r:Qi(n,e)},Qi=function(t,e){return Mi(t)?t.style.getPropertyValue(e):""},Zi=function(t,e){var n=t.dom,r=Qi(n,e);return v.from(r).filter((function(t){return t.length>0}))},tu=function(t){var e={},n=t.dom;if(Mi(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},eu=function(t,e,n){var r=sn.fromTag(t);return Xi(r,e,n),Zi(r,e).isSome()},nu=function(t,e){var n=t.dom;$i(n,e),zo(t,"style").map(bn).is("")&&Uo(t,"style")},ru=function(t){return t.dom.offsetWidth},ou=function(t){return t.dom.value},iu=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},uu=function(t){var e=sn.fromTag(t.tag);!function(t,e){var n=t.dom;yt(e,(function(t,e){Lo(n,e,t)}))}(e,t.attributes),Di(e,t.classes),Yi(e,t.styles),t.innerHtml.each((function(t){return Fo(e,t)}));var n=t.domChildren;return Do(e,n),t.value.each((function(t){iu(e,t)})),t.uid,ei(e,t.uid),e},au=function(t,e){return function(t,e){var n=F(e,(function(t){return Ye(t.name(),[Ie("config"),Ke("state",di)])})),r=xe("component.behaviours",ie(n),t.behaviours).fold((function(e){throw new Error(Se(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))}),(function(t){return t}));return{list:e,data:xt(r,(function(t){var e=t.map((function(t){return{config:t.config,state:t.state.init(t.config)}}));return function(){return e}}))}}(t,e)},cu=function(t){var e=function(t){var e=_t(t,"behaviours").getOr({}),n=H(vt(e),(function(t){return void 0!==e[t]}));return F(n,(function(t){return e[t].me}))}(t);return au(t,e)},su=function(t,e,n){var r,o,i,u=f(f({},(r=t).dom),{uid:r.uid,domChildren:F(r.components,(function(t){return t.element}))}),a=function(t){return t.domModification.fold((function(){return pi({})}),pi)}(t),c={"alloy.base.modification":a},s=e.length>0?function(t,e,n,r){var o=f({},e);L(n,(function(e){o[e.name()]=e.exhibit(t,r)}));var i=gi(o,(function(t,e){return{name:t,modification:e}})),u=function(t){return z(t,(function(t,e){return f(f({},e.modification),t)}),{})},a=z(i.classes,(function(t,e){return e.modification.concat(t)}),[]),c=u(i.attributes),s=u(i.styles);return pi({classes:a,attributes:c,styles:s})}(n,c,e,u):a;return i=s,f(f({},o=u),{attributes:f(f({},o.attributes),i.attributes),styles:f(f({},o.styles),i.styles),classes:o.classes.concat(i.classes)})},fu=function(t,e,n){var r={"alloy.base.behaviour":Si(t)};return function(t,e,n,r){var o=bi(t,n,r);return wi(o,e)}(n,t.eventOrder,e,r).getOrDie()},lu=function(t){var e=function(){return l},n=an(ui),r=we(function(t){var e;return xe("custom.definition",ie([de("dom","dom",Lt(),ie([Ie("tag"),Ke("styles",{}),Ke("classes",[]),Ke("attributes",{}),We("value"),We("innerHtml")])),Ie("components"),Ie("uid"),Ke("events",{}),Ke("apis",{}),de("eventOrder","eventOrder",Ft((e={},e[Or()]=["disabling",Ci,"toggling","typeaheadevents"],e[wr()]=[Ci,"focusing","keying"],e[Nr()]=[Ci,"disabling","toggling","representing"],e[gr()]=[Ci,"representing","streaming","invalidating"],e[Fr()]=[Ci,"representing","item-events","tooltipping"],e[ir()]=["focusing",Ci,"item-type-events"],e[er()]=["focusing",Ci,"item-type-events"],e[sr()]=["item-type-events","tooltipping"],e[kr()]=["receiving","reflecting","tooltipping"],e)),_e()),We("domModification")]),t)}(t)),o=cu(t),i=function(t){return t.list}(o),u=function(t){return t.data}(o),a=su(r,i,u),c=uu(a),s=fu(r,i,u),f=an(r.components),l={getSystem:n.get,config:function(e){var n=u;return(_(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(t){return _(u[t.name()])},spec:t,readState:function(t){return u[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},getApis:function(){return r.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(ii(e))},element:c,syncComponents:function(){var t=_o(c),e=G(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),(function(t){return[t]}))}));f.set(e)},components:f.get,events:s};return l},du=function(t){var e=oi(t),n=e.events,r=l(e,["events"]),o=function(t){var e=_t(t,"components").getOr([]);return F(e,hu)}(r),i=f(f({},r),{events:f(f({},Xo),n),components:o});return ot.value(lu(i))},mu=function(t){var e=sn.fromText(t);return gu({element:e})},gu=function(e){var r=Ce("external.component",oe([Ie("element"),We("uid")]),e),o=an(ii());r.uid.each((function(t){ei(r.element,t)}));var i={getSystem:o.get,config:v.none,hasConfigured:a,connect:function(t){o.set(t)},disconnect:function(){o.set(ii((function(){return i})))},getApis:function(){return{}},element:r.element,spec:e,readState:n("No state"),syncComponents:t,components:n([]),events:{}};return fi(i)},pu=ri,hu=function(t){return function(t){return _t(t,si)}(t).fold((function(){var e=t.hasOwnProperty("uid")?t:f({uid:pu("")},t);return du(e).getOrDie()}),(function(t){return t}))},vu=fi;function bu(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Ji(n,t);return parseFloat(o)||0}return r},r=function(t,e){return j(e,(function(e,n){var r=Ji(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!E(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Mi(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}var yu=bu("height",(function(t){var e=t.dom;return Ui(t)?e.getBoundingClientRect().height:e.offsetHeight})),xu=function(t){return yu.get(t)},wu=function(t){return yu.getOuter(t)},Cu=function(t,e){return{left:t,top:e,translate:function(n,r){return Cu(t+n,e+r)}}},Su=Cu,ku=function(t,e){return void 0!==t?t:void 0!==e?e:0},Ou=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return Su(n.offsetLeft,n.offsetTop);var i=ku(null==r?void 0:r.pageYOffset,o.scrollTop),u=ku(null==r?void 0:r.pageXOffset,o.scrollLeft),a=ku(o.clientTop,n.clientTop),c=ku(o.clientLeft,n.clientLeft);return _u(t).translate(u-c,i-a)},_u=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?Su(n.offsetLeft,n.offsetTop):Ui(t)?function(t){var e=t.getBoundingClientRect();return Su(e.left,e.top)}(e):Su(0,0)},Eu=bu("width",(function(t){return t.dom.offsetWidth})),Tu=function(t){return Eu.get(t)},Au=function(t){return Eu.getOuter(t)},Bu=function(t){var n=sn.fromDom(function(t){if(Fi()&&O(t.target)){var e=sn.fromDom(t.target);if(ho(e)&&ji(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return Q(n)}}return v.from(t.target)}(t).getOr(t.target)),r=function(){return t.stopPropagation()},o=function(){return t.preventDefault()},i=e(o,r);return function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}}(n,t.clientX,t.clientY,r,o,i,t)},Nu=function(t,e,n,r,i){var u=function(t,e){return function(n){t(n)&&e(Bu(n))}}(n,r);return t.dom.addEventListener(e,u,i),{unbind:o(Du,t,e,u,i)}},Du=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Ru=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return Su(n,r)},Mu=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},Iu=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Pu=function(t){var e=void 0===t?window:t,n=e.document,r=Ru(sn.fromDom(n));return function(t){var e=void 0===t?window:t;return v.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return Iu(r.left,r.top,n,o)}),(function(t){return Iu(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Fu=function(t,e){return t.view(e).fold(n([]),(function(e){var n=t.owner(e),r=Fu(t,n);return[e].concat(r)}))},Lu=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?v.none():v.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(sn.fromDom)},owner:function(t){return xo(t)}}),Vu=function(t){var e=sn.fromDom(document),n=Ru(e);return function(t,e){var n=e.owner(t),r=Fu(e,n);return v.some(r)}(t,Lu).fold(o(Ou,t),(function(e){var r=_u(t),o=z(e,(function(t,e){var n=_u(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return Su(o.left+r.left+n.left,o.top+r.top+n.top)}))},Hu=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},zu=function(t){var e=Ou(t),n=Au(t),r=wu(t);return Hu(e.left,e.top,n,r)},ju=function(t){var e=Vu(t),n=Au(t),r=wu(t);return Hu(e.left,e.top,n,r)},Uu=function(){return Pu(window)};function Wu(t,e,n,r,o){return t(n,r)?v.some(n):_(o)&&o(n)?v.none():e(n,r,o)}var qu,Gu=function(t,e,n){for(var r=t.dom,o=_(n)?n:a;r.parentNode;){r=r.parentNode;var i=sn.fromDom(r);if(e(i))return v.some(i);if(o(i))break}return v.none()},$u=function(t,e,n){return Wu((function(t,e){return e(t)}),Gu,t,e,n)},Xu=function(t,e,n){return $u(t,e,n).isSome()},Yu=function(t,e,n){return Gu(t,(function(t){return Un(t,e)}),n)},Ku=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Wn(n)?v.none():v.from(n.querySelector(t)).map(sn.fromDom)}(e,t)},Ju=function(t,e,n){return Wu((function(t,e){return Un(t,e)}),Yu,t,e,n)},Qu=function(){var t=Ko("aria-owns");return{id:t,link:function(e){Vo(e,"aria-owns",t)},unlink:function(t){Uo(t,"aria-owns")}}},Zu=function(t,e){return function(t){return $u(t,(function(t){if(!ho(t))return!1;var e=Ho(t,"id");return void 0!==e&&e.indexOf("aria-owns")>-1})).bind((function(t){var e=Ho(t,"id"),n=Li(t);return Ku(n,'[aria-owns="'+e+'"]')}))}(e).exists((function(e){return ta(t,e)}))},ta=function(t,e){return Xu(e,(function(e){return qn(e,t.element)}),a)||Zu(t,e)},ea="unknown";!function(t){t[t.STOP=0]="STOP",t[t.NORMAL=1]="NORMAL",t[t.LOGGING=2]="LOGGING"}(qu||(qu={}));var na,ra=an({}),oa=function(t,e,n){switch(_t(ra.get(),t).orThunk((function(){var e=vt(ra.get());return et(e,(function(e){return t.indexOf(e)>-1?v.some(ra.get()[e]):v.none()}))})).getOr(qu.NORMAL)){case qu.NORMAL:return n(aa());case qu.LOGGING:var r=function(t,e){var n=[],r=(new Date).getTime();return{logEventCut:function(t,e,r){n.push({outcome:"cut",target:e,purpose:r})},logEventStopped:function(t,e,r){n.push({outcome:"stopped",target:e,purpose:r})},logNoParent:function(t,e,r){n.push({outcome:"no-parent",target:e,purpose:r})},logEventNoHandlers:function(t,e){n.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,r){n.push({outcome:"response",purpose:r,target:e})},write:function(){var o=(new Date).getTime();R(["mousemove","mouseover","mouseout",Nr()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:F(n,(function(t){return R(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Go(t.target)+")":t.outcome}))})}}}(t,e),o=n(r);return r.write(),o;case qu.STOP:return!0}},ia=["alloy/data/Fields","alloy/debugging/Debugging"],ua=function(t,e,n){return oa(t,e,n)},aa=n({logEventCut:t,logEventStopped:t,logNoParent:t,logEventNoHandlers:t,logEventResponse:t,write:t}),ca=n([Ie("menu"),Ie("selectedMenu")]),sa=n([Ie("item"),Ie("selectedItem")]),fa=(n(ie(sa().concat(ca()))),n(ie(sa()))),la=ze("initSize",[Ie("numColumns"),Ie("numRows")]),da=function(){return ze("markers",[Ie("backgroundMenu")].concat(ca()).concat(sa()))},ma=function(t){return ze("markers",F(t,Ie))},ga=function(t,e,n){!function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");return U(e,(function(t){return t.indexOf("alloy")>0&&!M(ia,(function(e){return t.indexOf(e)>-1}))})).getOr(ea)}}();return de(e,e,n,be((function(t){return ot.value((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}))})))},pa=function(e){return ga(0,e,Pt(t))},ha=function(t){return ga(0,t,Pt(v.none))},va=function(t){return ga(0,t,Lt())},ba=function(t){return ga(0,t,Lt())},ya=function(t,e){return un(t,n(e))},xa=function(t){return un(t,r)},wa=n(la),Ca=function(t,e,n,r,o,i){return{x:t,y:e,bubble:n,direction:r,boundsRestriction:o,label:i}},Sa=At([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),ka=Sa.southeast,Oa=Sa.southwest,_a=Sa.northeast,Ea=Sa.northwest,Ta=Sa.south,Aa=Sa.north,Ba=Sa.east,Na=Sa.west,Da=function(t,e){return function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n}(["left","right","top","bottom"],(function(n){return _t(e,n).map((function(e){return function(t,e){switch(e){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}}(t,e)}))}))},Ra=function(t){return t.x},Ma=function(t,e){return t.x+t.width/2-e.width/2},Ia=function(t,e){return t.x+t.width-e.width},Pa=function(t,e){return t.y-e.height},Fa=function(t){return t.y+t.height},La=function(t,e){return t.y+t.height/2-e.height/2},Va=function(t,e,n){return Ca(Ra(t),Fa(t),n.southeast(),ka(),Da(t,{left:1,top:3}),"layout-se")},Ha=function(t,e,n){return Ca(Ia(t,e),Fa(t),n.southwest(),Oa(),Da(t,{right:0,top:3}),"layout-sw")},za=function(t,e,n){return Ca(Ra(t),Pa(t,e),n.northeast(),_a(),Da(t,{left:1,bottom:2}),"layout-ne")},ja=function(t,e,n){return Ca(Ia(t,e),Pa(t,e),n.northwest(),Ea(),Da(t,{right:0,bottom:2}),"layout-nw")},Ua=function(t,e,n){return Ca(Ma(t,e),Pa(t,e),n.north(),Aa(),Da(t,{bottom:2}),"layout-n")},Wa=function(t,e,n){return Ca(Ma(t,e),Fa(t),n.south(),Ta(),Da(t,{top:3}),"layout-s")},qa=function(t,e,n){return Ca(function(t){return t.x+t.width}(t),La(t,e),n.east(),Ba(),Da(t,{left:0}),"layout-e")},Ga=function(t,e,n){return Ca(function(t,e){return t.x-e.width}(t,e),La(t,e),n.west(),Na(),Da(t,{right:1}),"layout-w")},$a=function(){return[Va,Ha,za,ja,Wa,Ua,qa,Ga]},Xa=function(){return[Ha,Va,ja,za,Wa,Ua,qa,Ga]},Ya=function(){return[za,ja,Va,Ha,Ua,Wa]},Ka=function(){return[ja,za,Ha,Va,Ua,Wa]},Ja=function(){return[Va,Ha,za,ja,Wa,Ua]},Qa=function(){return[Ha,Va,ja,za,Wa,Ua]},Za=Object.freeze({__proto__:null,events:function(t){return Qr([eo(kr(),(function(e,n){var r=t.channels,o=vt(r),i=n,u=function(t,e){return e.universal?t:H(t,(function(t){return R(e.channels,t)}))}(o,i);L(u,(function(t){var n=r[t],o=n.schema,u=Ce("channel["+t+"] data\nReceiver: "+Go(e.element),o,i.data);n.onReceive(e,u)}))}))])}}),tc=[Pe("channels",ye(ot.value,oe([va("onReceive"),Ke("schema",_e())])))],ec=function(t,e,n){return lo((function(r,o){n(r,t,e)}))},nc=function(t,e,r){return function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),u=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:ai(u.slice(0,1).concat(u.slice(3)))}},t}((function(o){for(var i=[],u=1;u<arguments.length;u++)i[u-1]=arguments[u];var a=[o].concat(i);return o.config({name:n(t)}).fold((function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+r)}),(function(t){var n=Array.prototype.slice.call(a,1);return e.apply(void 0,[o,t.config,t.state].concat(n))}))}),r,e)},rc=function(t){return{key:t,value:void 0}},oc=function(t,e,n,r,i,u,a){var c=function(t){return Tt(t,n)?t[n]():v.none()},s=xt(i,(function(t,e){return nc(n,t,e)})),l=xt(u,(function(t,e){return ci(t,e)})),d=f(f(f({},l),s),{revoke:o(rc,n),config:function(e){var r=Ce(n+"-config",t,e);return{key:n,value:{config:r,me:d,configAsRaw:Mt((function(){return Ce(n+"-config",t,e)})),initialConfig:e,state:a}}},schema:function(){return e},exhibit:function(t,e){return c(t).bind((function(t){return _t(r,"exhibit").map((function(n){return n(e,t.config,t.state)}))})).getOr(pi({}))},name:function(){return n},handlers:function(t){return c(t).map((function(t){return _t(r,"events").getOr((function(){return{}}))(t.config,t.state)})).getOr({})}});return d},ic=function(t){return qt(t)},uc=oe([Ie("fields"),Ie("name"),Ke("active",{}),Ke("apis",{}),Ke("state",di),Ke("extra",{})]),ac=function(t){var e=Ce("Creating behaviour: "+t.name,uc,t);return function(t,e,n,r,o,i){var u,a,c=oe(t),s=Ye(e,[(u="config",a=t,qe(u,oe(a)))]);return oc(c,s,e,n,r,o,i)}(e.fields,e.name,e.active,e.apis,e.extra,e.state)},cc=oe([Ie("branchKey"),Ie("branches"),Ie("name"),Ke("active",{}),Ke("apis",{}),Ke("state",di),Ke("extra",{})]),sc=function(t){var e=Ce("Creating behaviour: "+t.name,cc,t);return function(t,e,n,r,o,i){var u=t,a=Ye(e,[qe("config",t)]);return oc(u,a,e,n,r,o,i)}(Oe(e.branchKey,e.branches),e.name,e.active,e.apis,e.extra,e.state)},fc=n(void 0),lc=ac({fields:tc,name:"receiving",active:Za}),dc=Object.freeze({__proto__:null,exhibit:function(t,e){return pi({classes:[],styles:e.useFixed()?{}:{position:"relative"}})}}),mc=function(t){return t.dom.focus()},gc=function(t){return void 0===t&&(t=sn.fromDom(document)),v.from(t.dom.activeElement).map(sn.fromDom)},pc=function(t){return gc(Li(t)).filter((function(e){return t.dom.contains(e.dom)}))},hc=function(e,n){var r=Li(n),o=gc(r).bind((function(t){var e,r,o=function(e){return qn(t,e)};return o(n)?v.some(n):(e=o,(r=function(t){for(var n=0;n<t.childNodes.length;n++){var o=sn.fromDom(t.childNodes[n]);if(e(o))return v.some(o);var i=r(t.childNodes[n]);if(i.isSome())return i}return v.none()})(n.dom))})),i=e(n);return o.each((function(e){gc(r).filter((function(t){return qn(t,e)})).fold((function(){mc(e)}),t)})),i},vc=function(t,e,n,r,o){return{position:t,left:e,top:n,right:r,bottom:o}},bc=function(t,e){var n=function(t){return t+"px"};Ki(t,{position:v.some(e.position),left:e.left.map(n),top:e.top.map(n),right:e.right.map(n),bottom:e.bottom.map(n)})},yc=At([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),xc=function(t,e,n,r,o,i){var u=e.x-n,a=e.y-r,c=o-(u+e.width),s=i-(a+e.height),f=v.some(u),l=v.some(a),d=v.some(c),m=v.some(s),g=v.none();return function(t,e,n,r,o,i,u,a,c){return t.fold(e,n,r,o,i,u,a,c)}(e.direction,(function(){return vc(t,f,l,g,g)}),(function(){return vc(t,g,l,d,g)}),(function(){return vc(t,f,g,g,m)}),(function(){return vc(t,g,g,d,m)}),(function(){return vc(t,f,l,g,g)}),(function(){return vc(t,f,g,g,m)}),(function(){return vc(t,f,l,g,g)}),(function(){return vc(t,g,l,d,g)}))},wc=function(t,e){var n=o(Vu,e),r=t.fold(n,n,(function(){var t=Ru();return Vu(e).translate(-t.left,-t.top)})),i=Au(e),u=wu(e);return Hu(r.left,r.top,i,u)},Cc=function(t,e){return e.fold((function(){return t.fold(Uu,Uu,Hu)}),(function(e){return t.fold(e,e,(function(){var n=e(),r=Sc(t,n.x,n.y);return Hu(r.left,r.top,n.width,n.height)}))}))},Sc=function(t,e,r){var o=Su(e,r);return t.fold(n(o),n(o),(function(){var t=Ru();return o.translate(-t.left,-t.top)}))},kc=(yc.none,yc.relative),Oc=yc.fixed,_c=function(t,e){return function(t,e){return{anchorBox:t,origin:e}}(t,e)},Ec=function(t,e,n,r){var o=t+e;return o>r?n:o<n?r:o},Tc=function(t,e,n){return Math.min(Math.max(t,e),n)},Ac=At([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),Bc=function(t,e,o,i){var u=t.x,a=t.y,c=t.bubble.offset,s=c.left,f=c.top,l=function(t,e,n){var o=function(t,o){var i="top"===t||"bottom"===t?n.top:n.left;return _t(e,t).bind(r).bind((function(e){return"left"===t||"top"===t?e>=o?v.some(e):v.none():e<=o?v.some(e):v.none()})).map((function(t){return t+i})).getOr(o)},i=o("left",t.x),u=o("top",t.y),a=o("right",t.right),c=o("bottom",t.bottom);return Hu(i,u,a-i,c-u)}(i,t.boundsRestriction,c),d=l.y,m=l.bottom,g=l.x,p=l.right,h=a+f,b=function(t,e,n,r,o){var i=o.x,u=o.y,a=o.width,c=o.height,s=t>=i,f=e>=u,l=s&&f,d=t+n<=i+a&&e+r<=u+c,m=Math.abs(Math.min(n,s?i+a-t:i-(t+n))),g=Math.abs(Math.min(r,f?u+c-e:u-(e+r))),p=Math.max(o.x,o.right-n),h=Math.max(o.y,o.bottom-r);return{originInBounds:l,sizeInBounds:d,limitX:Tc(t,o.x,p),limitY:Tc(e,o.y,h),deltaW:m,deltaH:g}}(u+s,h,e,o,l),y=b.originInBounds,x=b.sizeInBounds,w=b.limitX,C=b.limitY,S=b.deltaW,k=b.deltaH,O=n(C+k-d),_=n(m-C),E=function(t,e,n,r){return t.fold(e,e,r,r,e,r,n,n)}(t.direction,_,_,O),T=n(w+S-g),A=n(p-w),B={x:w,y:C,width:S,height:k,maxHeight:E,maxWidth:function(t,e,n,r){return t.fold(e,r,e,r,n,n,e,r)}(t.direction,A,A,T),direction:t.direction,classes:{on:t.bubble.classesOn,off:t.bubble.classesOff},label:t.label,candidateYforTest:h};return y&&x?Ac.fit(B):Ac.nofit(B,S,k)},Nc=function(t,e,n,i){nu(e,"max-height"),nu(e,"max-width");var u,a={width:Au(u=e),height:wu(u)};return function(t,e,n,i,u){var a=n.width,c=n.height,s=function(t,r,o,s){var f=t(e,n,i);return Bc(f,a,c,u).fold(Ac.fit,(function(t,e,n){return n>s||e>o?Ac.nofit(t,e,n):Ac.nofit(r,o,s)}))};return j(t,(function(t,e){var n=o(s,e);return t.fold(Ac.fit,n)}),Ac.nofit({x:e.x,y:e.y,width:n.width,height:n.height,maxHeight:n.height,maxWidth:n.width,direction:ka(),classes:{on:[],off:[]},label:"none",candidateYforTest:e.y},-1,-1)).fold(r,r)}(i.preference,t,a,n,i.bounds)},Dc=function(t,e,n){bc(t,function(t,e){return t.fold((function(){return vc("absolute",v.some(e.x),v.some(e.y),v.none(),v.none())}),(function(t,n,r,o){return xc("absolute",e,t,n,r,o)}),(function(t,n,r,o){return xc("fixed",e,t,n,r,o)}))}(n.origin,e))},Rc=function(t,e){!function(t,e){var n=yu.max(t,e,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Xi(t,"max-height",n+"px")}(t,Math.floor(e))},Mc=n((function(t,e){Rc(t,e),Yi(t,{"overflow-x":"hidden","overflow-y":"auto"})})),Ic=n((function(t,e){Rc(t,e)})),Pc=function(t,e,n){return void 0===t[e]?n:t[e]},Fc=function(t,e,n,r){var o=Nc(t,e,n,r);Dc(e,o,r),function(t,e){var n=e.classes;Ri(t,n.off),Di(t,n.on)}(e,o),function(t,e,n){(0,n.maxHeightFunction)(t,e.maxHeight)}(e,o,r),function(t,e,n){(0,n.maxWidthFunction)(t,e.maxWidth)}(e,o,r)},Lc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],Vc=function(t,e,n){var r=function(t){return _t(n,t).getOr([])},o=function(t,e,n){var o=Y(Lc,n);return{offset:Su(t,e),classesOn:G(n,r),classesOff:G(o,r)}};return{southeast:function(){return o(-t,e,["top","alignLeft"])},southwest:function(){return o(t,e,["top","alignRight"])},south:function(){return o(-t/2,e,["top","alignCentre"])},northeast:function(){return o(-t,-e,["bottom","alignLeft"])},northwest:function(){return o(t,-e,["bottom","alignRight"])},north:function(){return o(-t/2,-e,["bottom","alignCentre"])},east:function(){return o(t,-e/2,["valignCentre","left"])},west:function(){return o(-t,-e/2,["valignCentre","right"])},innerNorthwest:function(){return o(-t,e,["top","alignRight"])},innerNortheast:function(){return o(t,e,["top","alignLeft"])},innerNorth:function(){return o(-t/2,e,["top","alignCentre"])},innerSouthwest:function(){return o(-t,-e,["bottom","alignRight"])},innerSoutheast:function(){return o(t,-e,["bottom","alignLeft"])},innerSouth:function(){return o(-t/2,-e,["bottom","alignCentre"])},innerWest:function(){return o(t,-e/2,["valignCentre","right"])},innerEast:function(){return o(-t,-e/2,["valignCentre","left"])}}},Hc=function(){return Vc(0,0,{})},zc=function(t,e){return function(n){return"rtl"===jc(n)?e:t}},jc=function(t){return"rtl"===Ji(t,"direction")?"rtl":"ltr"};!function(t){t.TopToBottom="toptobottom",t.BottomToTop="bottomtotop"}(na||(na={}));var Uc="data-alloy-vertical-dir",Wc=function(t){return Xu(t,(function(t){return ho(t)&&Ho(t,"data-alloy-vertical-dir")===na.BottomToTop}))},qc=function(){return Ye("layouts",[Ie("onLtr"),Ie("onRtl"),We("onBottomLtr"),We("onBottomRtl")])},Gc=function(t,e,n,r,o,i,u){var a=u.map(Wc).getOr(!1),c=e.layouts.map((function(e){return e.onLtr(t)})),s=e.layouts.map((function(e){return e.onRtl(t)})),f=a?e.layouts.bind((function(e){return e.onBottomLtr.map((function(e){return e(t)}))})).or(c).getOr(o):c.getOr(n),l=a?e.layouts.bind((function(e){return e.onBottomRtl.map((function(e){return e(t)}))})).or(s).getOr(i):s.getOr(r);return zc(f,l)(t)},$c=[Ie("hotspot"),We("bubble"),Ke("overrides",{}),qc(),ya("placement",(function(t,e,n){var r=e.hotspot,o=wc(n,r.element),i=Gc(t.element,e,Ja(),Qa(),Ya(),Ka(),v.some(e.hotspot.element));return v.some({anchorBox:o,bubble:e.bubble.getOr(Hc()),overrides:e.overrides,layouts:i,placer:v.none()})}))],Xc=[Ie("x"),Ie("y"),Ke("height",0),Ke("width",0),Ke("bubble",Hc()),Ke("overrides",{}),qc(),ya("placement",(function(t,e,n){var r=Sc(n,e.x,e.y),o=Hu(r.left,r.top,e.width,e.height),i=Gc(t.element,e,$a(),Xa(),$a(),Xa(),v.none());return v.some({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:v.none()})}))],Yc=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Kc=At([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Jc=(Kc.before,Kc.on,Kc.after,function(t){return t.fold(r,r,r)}),Qc=At([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Zc={domRange:Qc.domRange,relative:Qc.relative,exact:Qc.exact,exactFromRange:function(t){return Qc.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return sn.fromDom(t.startContainer)},relative:function(t,e){return Jc(t)},exact:function(t,e,n,r){return t}})}(t);return So(e)},range:Yc},ts=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},es=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},ns=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},rs=At([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),os=function(t,e,n){return e(sn.fromDom(n.startContainer),n.startOffset,sn.fromDom(n.endContainer),n.endOffset)},is=function(t,e){return function(t,e){var n=e.ltr();return n.collapsed?e.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return rs.rtl(sn.fromDom(t.endContainer),t.endOffset,sn.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return os(0,rs.ltr,n)})):os(0,rs.ltr,n)}(0,function(t,e){return e.match({domRange:function(t){return{ltr:n(t),rtl:v.none}},relative:function(e,n){return{ltr:Mt((function(){return ts(t,e,n)})),rtl:Mt((function(){return v.some(ts(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:Mt((function(){return es(t,e,n,r,o)})),rtl:Mt((function(){return v.some(es(t,r,o,e,n))}))}}})}(t,e))};rs.ltr,rs.rtl;var us=function(t,e){var n=function(e){return t(e)?v.from(e.dom.nodeValue):v.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(vo,"text"),as=function(t){return us.getOption(t)},cs=["img","br"],ss=function(t){return as(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||R(cs,go(t))},fs=function(t,e){var n=function(t){for(var r=_o(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return v.some(i);var u=n(i);if(u.isSome())return u}return v.none()};return n(t)},ls=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Wn(n)?[]:F(n.querySelectorAll(t),sn.fromDom)}(e,t)},ds=function(t,e,n,r){var o=function(t,e,n,r){var o=xo(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=qn(t,n)&&e===r;return o.collapsed&&!i},ms=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return v.some(Yc(sn.fromDom(e.startContainer),e.startOffset,sn.fromDom(n.endContainer),n.endOffset))}return v.none()},gs=function(t){if(null===t.anchorNode||null===t.focusNode)return ms(t);var e=sn.fromDom(t.anchorNode),n=sn.fromDom(t.focusNode);return ds(e,t.anchorOffset,n,t.focusOffset)?v.some(Yc(e,t.anchorOffset,n,t.focusOffset)):ms(t)},ps=function(t){return function(t){return v.from(t.getSelection())}(t).filter((function(t){return t.rangeCount>0})).bind(gs)},hs=function(t,e){return function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?v.some(n).map(ns):v.none()}(function(t,e){return is(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})}(t,e))},vs=function(t,e){return{element:t,offset:e}},bs=function(t,e){var n=_o(t);if(0===n.length)return vs(t,e);if(e<n.length)return vs(n[e],0);var r=n[n.length-1],o=vo(r)?function(t){return us.get(t)}(r).length:_o(r).length;return vs(r,o)},ys=At([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),xs=function(t){return t.fold(r,(function(t,e,n){return t.translate(-e,-n)}))},ws=function(t){return t.fold(r,r)},Cs=function(t){return j(t,(function(t,e){return t.translate(e.left,e.top)}),Su(0,0))},Ss=function(t){var e=F(t,ws);return Cs(e)},ks=ys.screen,Os=ys.absolute,_s=function(t,e,n){var r=xo(t.element),o=Ru(r),i=function(t,e,n){var r=So(n.root).dom;return v.from(r.frameElement).map(sn.fromDom).filter((function(e){var n=xo(e),r=xo(t.element);return qn(n,r)})).map(Ou)}(t,0,n).getOr(o);return Os(i,o.left,o.top)},Es=function(t,e,n,r){var o=t,i=e,u=n,a=r;t<0&&(o=0,u=n+t),e<0&&(i=0,a=r+e);var c=ks(Su(o,i));return v.some(function(t,e,n){return{point:t,width:e,height:n}}(c,u,a))},Ts=function(t,e,n,r,o){return t.map((function(t){var i,u,a,c=[e,t.point],s=(i=function(){return Ss(c)},u=function(){return Ss(c)},a=function(){return function(t){var e=F(t,xs);return Cs(e)}(c)},r.fold(i,u,a)),f=function(t,e,n,r){return{x:t,y:e,width:n,height:r}}(s.left,s.top,t.width,t.height),l=n.showAbove?Ya():Ja(),d=n.showAbove?Ka():Qa(),m=Gc(o,n,l,d,l,d,v.none());return{anchorBox:f,bubble:n.bubble.getOr(Hc()),overrides:n.overrides,layouts:m,placer:v.none()}}))},As=function(t,e){return vo(t)?vs(t,e):bs(t,e)},Bs=function(t,e){return e.getSelection.getOrThunk((function(){return function(){return ps(t)}}))().map((function(t){var e=As(t.start,t.soffset),n=As(t.finish,t.foffset);return Zc.range(e.element,e.offset,n.element,n.offset)}))},Ns=[We("getSelection"),Ie("root"),We("bubble"),qc(),Ke("overrides",{}),Ke("showAbove",!1),ya("placement",(function(t,e,n){var r=So(e.root).dom,o=_s(t,0,e),i=Bs(r,e).bind((function(t){return hs(r,Zc.exactFromRange(t)).orThunk((function(){var e=sn.fromText("\ufeff");return To(t.start,e),hs(r,Zc.exact(e,0,e,1)).map((function(t){return Mo(e),t}))})).bind((function(t){return Es(t.left,t.top,t.width,t.height)}))})),u=Bs(r,e).bind((function(t){return ho(t.start)?v.some(t.start):function(t){return ko(t)}(t.start)})).getOr(t.element);return Ts(i,o,e,n,u)}))],Ds=[Ie("node"),Ie("root"),We("bubble"),qc(),Ke("overrides",{}),Ke("showAbove",!1),ya("placement",(function(t,e,n){var r=_s(t,0,e);return e.node.bind((function(o){var i=o.dom.getBoundingClientRect(),u=Es(i.left,i.top,i.width,i.height),a=e.node.getOr(t.element);return Ts(u,r,e,n,a)}))}))],Rs=function(t){return t.x+t.width},Ms=function(t,e){return t.x-e.width},Is=function(t,e){return t.y-e.height+t.height},Ps=function(t){return t.y},Fs=function(t,e,n){return Ca(Rs(t),Ps(t),n.southeast(),ka(),Da(t,{left:0,top:2}),"link-layout-se")},Ls=function(t,e,n){return Ca(Ms(t,e),Ps(t),n.southwest(),Oa(),Da(t,{right:1,top:2}),"link-layout-sw")},Vs=function(t,e,n){return Ca(Rs(t),Is(t,e),n.northeast(),_a(),Da(t,{left:0,bottom:3}),"link-layout-ne")},Hs=function(t,e,n){return Ca(Ms(t,e),Is(t,e),n.northwest(),Ea(),Da(t,{right:1,bottom:3}),"link-layout-nw")},zs=function(){return[Fs,Ls,Vs,Hs]},js=function(){return[Ls,Fs,Hs,Vs]},Us=[Ie("item"),qc(),Ke("overrides",{}),ya("placement",(function(t,e,n){var r=wc(n,e.item.element),o=Gc(t.element,e,zs(),js(),zs(),js(),v.none());return v.some({anchorBox:r,bubble:Hc(),overrides:e.overrides,layouts:o,placer:v.none()})}))],Ws=Oe("anchor",{selection:Ns,node:Ds,hotspot:$c,submenu:Us,makeshift:Xc}),qs=function(e,n,r,o,i){!function(e,n,r,o,i,u){var a=Pc(u,"maxHeightFunction",Mc()),c=Pc(u,"maxWidthFunction",t),s=e.anchorBox,f=e.origin,l={bounds:Cc(f,i),origin:f,preference:o,maxHeightFunction:a,maxWidthFunction:c};Fc(s,n,r,l)}(_c(r.anchorBox,n),i.element,r.bubble,r.layouts,o,r.overrides)},Gs=function(t,e,n,r,o,i){var u=i.map(zu);return $s(t,e,n,r,o,u)},$s=function(t,e,r,o,i,u){var a=Ce("positioning anchor.info",Ws,o);hc((function(){Xi(i.element,"position","fixed");var r=Zi(i.element,"visibility");Xi(i.element,"visibility","hidden");var o,c=e.useFixed()?(o=document.documentElement,Oc(0,0,o.clientWidth,o.clientHeight)):function(t){var e=Ou(t.element),n=t.element.dom.getBoundingClientRect();return kc(e.left,e.top,n.width,n.height)}(t),s=a.placement,f=u.map(n).or(e.getBounds);s(t,a,c).each((function(e){e.placer.getOr(qs)(t,c,e,f,i)})),r.fold((function(){nu(i.element,"visibility")}),(function(t){Xi(i.element,"visibility",t)})),Zi(i.element,"left").isNone()&&Zi(i.element,"top").isNone()&&Zi(i.element,"right").isNone()&&Zi(i.element,"bottom").isNone()&&Zi(i.element,"position").is("fixed")&&nu(i.element,"position")}),i.element)},Xs=Object.freeze({__proto__:null,position:function(t,e,n,r,o){Gs(t,e,n,r,o,v.none())},positionWithin:Gs,positionWithinBounds:$s,getMode:function(t,e,n){return e.useFixed()?"fixed":"absolute"}}),Ys=[Ke("useFixed",a),We("getBounds")],Ks=ac({fields:Ys,name:"positioning",active:dc,apis:Xs}),Js=function(t){Gr(t,Fr());var e=t.components();L(e,Js)},Qs=function(t){var e=t.components();L(e,Qs),Gr(t,Pr())},Zs=function(t,e){No(t.element,e.element)},tf=function(t,e){var n=t.components();!function(t){L(t.components(),(function(t){return Mo(t.element)})),Ro(t.element),t.syncComponents()}(t);var r=Y(n,e);L(r,(function(e){Js(e),t.getSystem().removeFromWorld(e)})),L(e,(function(e){e.getSystem().isConnected()?Zs(t,e):(t.getSystem().addToWorld(e),Zs(t,e),Ui(t.element)&&Qs(e)),t.syncComponents()}))},ef=function(t,e){nf(t,e,No)},nf=function(t,e,n){t.getSystem().addToWorld(e),n(t.element,e.element),Ui(t.element)&&Qs(e),t.syncComponents()},rf=function(t){Js(t),Mo(t.element),t.getSystem().removeFromWorld(t)},of=function(t){var e=ko(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}));rf(t),e.each((function(t){t.syncComponents()}))},uf=function(t){var e=t.components();L(e,rf),Ro(t.element),t.syncComponents()},af=function(t,e){cf(t,e,No)},cf=function(t,e,n){n(t,e.element);var r=_o(e.element);L(r,(function(t){e.getByDom(t).each(Qs)}))},sf=function(t){var e=_o(t.element);L(e,(function(e){t.getByDom(e).each(Js)})),Mo(t.element)},ff=function(t,e,n,r){n.get().each((function(e){uf(t)}));var o=e.getAttachPoint(t);ef(o,t);var i=t.getSystem().build(r);return ef(t,i),n.set(i),i},lf=function(t,e,n,r){var o=ff(t,e,n,r);return e.onOpen(t,o),o},df=function(t,e,n){n.get().each((function(r){uf(t),of(t),e.onClose(t,r),n.clear()}))},mf=function(t,e,n){return n.isOpen()},gf=function(t,e,n){var r=e.getAttachPoint(t);Xi(t.element,"position",Ks.getMode(r)),function(t,e,n,r){Zi(t.element,e).fold((function(){Uo(t.element,n)}),(function(e){Vo(t.element,n,e)})),Xi(t.element,e,r)}(t,"visibility",e.cloakVisibilityAttr,"hidden")},pf=function(t,e,n){(function(t){return M(["top","left","right","bottom"],(function(e){return Zi(t,e).isSome()}))})(t.element)||nu(t.element,"position"),function(t,e,n){zo(t.element,n).fold((function(){return nu(t.element,e)}),(function(n){return Xi(t.element,e,n)}))}(t,"visibility",e.cloakVisibilityAttr)},hf=Object.freeze({__proto__:null,cloak:gf,decloak:pf,open:lf,openWhileCloaked:function(t,e,n,r,o){gf(t,e),lf(t,e,n,r),o(),pf(t,e)},close:df,isOpen:mf,isPartOf:function(t,e,n,r){return mf(0,0,n)&&n.get().exists((function(n){return e.isPartOf(t,n,r)}))},getState:function(t,e,n){return n.get()},setContent:function(t,e,n,r){return n.get().map((function(){return ff(t,e,n,r)}))}}),vf=Object.freeze({__proto__:null,events:function(t,e){return Qr([eo(Ar(),(function(n,r){df(n,t,e)}))])}}),bf=[pa("onOpen"),pa("onClose"),Ie("isPartOf"),Ie("getAttachPoint"),Ke("cloakVisibilityAttr","data-precloak-visibility")],yf=ac({fields:bf,name:"sandboxing",active:vf,apis:hf,state:Object.freeze({__proto__:null,init:function(){var t=an(v.none()),e=n("not-implemented");return mi({readState:e,isOpen:function(){return t.get().isSome()},clear:function(){t.set(v.none())},set:function(e){t.set(v.some(e))},get:function(){return t.get()}})}})}),xf=n("dismiss.popups"),wf=n("reposition.popups"),Cf=n("mouse.released"),Sf=oe([Ke("isExtraPart",a),Ye("fireEventInstead",[Ke("event",Lr())])]),kf=function(t){var e,n=Ce("Dismissal",Sf,t);return(e={})[xf()]={schema:oe([Ie("target")]),onReceive:function(t,e){yf.isOpen(t)&&(yf.isPartOf(t,e.target)||n.isExtraPart(t,e.target)||n.fireEventInstead.fold((function(){return yf.close(t)}),(function(e){return Gr(t,e.event)})))}},e},Of=oe([Ye("fireEventInstead",[Ke("event",Vr())]),He("doReposition")]),_f=function(t){var e,n=Ce("Reposition",Of,t);return(e={})[wf()]={onReceive:function(t){yf.isOpen(t)&&n.fireEventInstead.fold((function(){return n.doReposition(t)}),(function(e){return Gr(t,e.event)}))}},e},Ef=function(t,e,n){e.store.manager.onLoad(t,e,n)},Tf=function(t,e,n){e.store.manager.onUnload(t,e,n)},Af=Object.freeze({__proto__:null,onLoad:Ef,onUnload:Tf,setValue:function(t,e,n,r){e.store.manager.setValue(t,e,n,r)},getValue:function(t,e,n){return e.store.manager.getValue(t,e,n)},getState:function(t,e,n){return n}}),Bf=Object.freeze({__proto__:null,events:function(t,e){var n=t.resetOnDom?[so((function(n,r){Ef(n,t,e)})),fo((function(n,r){Tf(n,t,e)}))]:[ec(t,e,Ef)];return Qr(n)}}),Nf=function(){var t=an(null);return mi({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},Df=function(){var t=an({}),e=an({});return mi({readState:function(){return{mode:"dataset",dataByValue:t.get(),dataByText:e.get()}},lookup:function(n){return _t(t.get(),n).orThunk((function(){return _t(e.get(),n)}))},update:function(n){var r=t.get(),o=e.get(),i={},u={};L(n,(function(t){i[t.value]=t,_t(t,"meta").each((function(e){_t(e,"text").each((function(e){u[e]=t}))}))})),t.set(f(f({},r),i)),e.set(f(f({},o),u))},clear:function(){t.set({}),e.set({})}})},Rf=Object.freeze({__proto__:null,memory:Nf,dataset:Df,manual:function(){return mi({readState:function(){}})},init:function(t){return t.store.manager.state(t)}}),Mf=function(t,e,n,r){var o=e.store;n.update([r]),o.setValue(t,r),e.onSetValue(t,r)},If=[We("initialValue"),Ie("getFallbackEntry"),Ie("getDataKey"),Ie("setValue"),ya("manager",{setValue:Mf,getValue:function(t,e,n){var r=e.store,o=r.getDataKey(t);return n.lookup(o).fold((function(){return r.getFallbackEntry(o)}),(function(t){return t}))},onLoad:function(t,e,n){e.store.initialValue.each((function(r){Mf(t,e,n,r)}))},onUnload:function(t,e,n){n.clear()},state:Df})],Pf=[Ie("getValue"),Ke("setValue",t),We("initialValue"),ya("manager",{setValue:function(t,e,n,r){e.store.setValue(t,r),e.onSetValue(t,r)},getValue:function(t,e,n){return e.store.getValue(t)},onLoad:function(t,e,n){e.store.initialValue.each((function(n){e.store.setValue(t,n)}))},onUnload:t,state:di.init})],Ff=[We("initialValue"),ya("manager",{setValue:function(t,e,n,r){n.set(r),e.onSetValue(t,r)},getValue:function(t,e,n){return n.get()},onLoad:function(t,e,n){e.store.initialValue.each((function(t){n.isNotSet()&&n.set(t)}))},onUnload:function(t,e,n){n.clear()},state:Nf})],Lf=[Je("store",{mode:"memory"},Oe("mode",{memory:Ff,manual:Pf,dataset:If})),pa("onSetValue"),Ke("resetOnDom",!1)],Vf=ac({fields:Lf,name:"representing",active:Bf,apis:Af,extra:{setValueFrom:function(t,e){var n=Vf.getValue(e);Vf.setValue(t,n)}},state:Rf}),Hf=function(t,e){return on(t,{},F(e,(function(e){return n=e.name(),r="Cannot configure "+e.name()+" for "+t,de(n,n,Vt(),ne((function(t){return dt("The field: "+n+" is forbidden. "+r)})));var n,r})).concat([un("dump",r)]))},zf=function(t){return t.dump},jf=function(t,e){return f(f({},t.dump),ic(e))},Uf=Hf,Wf=jf,qf="placeholder",Gf=At([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),$f=function(t){return Et(t,"uiType")},Xf=function(t,e,r,o){return $f(r)&&r.uiType===qf?function(t,e,r,o){return t.exists((function(t){return t!==r.owner}))?Gf.single(!0,n(r)):_t(o,r.name).fold((function(){throw new Error("Unknown placeholder component: "+r.name+"\nKnown: ["+vt(o)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(r,null,2))}),(function(t){return t.replace()}))}(t,0,r,o):Gf.single(!1,n(r))},Yf=function(t,e,n,o){return Xf(t,0,n,o).fold((function(r,i){var u=$f(n)?i(e,n.config,n.validated):i(e),a=_t(u,"components").getOr([]),c=G(a,(function(n){return Yf(t,e,n,o)}));return[f(f({},u),{components:c})]}),(function(t,o){if($f(n)){var i=o(e,n.config,n.validated);return n.validated.preprocess.getOr(r)(i)}return o(e)}))},Kf=function(t,e,r,o){var i=xt(o,(function(t,e){return o=t,i=!1,{name:n(r=e),required:function(){return o.fold((function(t,e){return t}),(function(t,e){return t}))},used:function(){return i},replace:function(){if(i)throw new Error("Trying to use the same placeholder more than once: "+r);return i=!0,o}};var r,o,i})),u=function(t,e,n,r){return G(n,(function(n){return Yf(t,e,n,r)}))}(t,e,r,i);return yt(i,(function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))})),u},Jf=Gf.single,Qf=Gf.multiple,Zf=n(qf),tl=At([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),el=Ke("factory",{sketch:r}),nl=Ke("schema",[]),rl=Ie("name"),ol=de("pname","pname",Ht((function(t){return"<alloy."+Ko(t.name)+">"})),_e()),il=un("schema",(function(){return[We("preprocess")]})),ul=Ke("defaults",n({})),al=Ke("overrides",n({})),cl=ie([el,nl,rl,ol,ul,al]),sl=ie([el,nl,rl,ul,al]),fl=ie([el,nl,rl,ol,ul,al]),ll=ie([el,il,rl,Ie("unit"),ol,ul,al]),dl=function(t){return t.fold(v.some,v.none,v.some,v.some)},ml=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},gl=function(t,e){return function(n){var r=Ce("Converting part type",e,n);return t(r)}},pl=gl(tl.required,cl),hl=gl(tl.external,sl),vl=gl(tl.optional,fl),bl=gl(tl.group,ll),yl=n("entirety"),xl=Object.freeze({__proto__:null,required:pl,external:hl,optional:vl,group:bl,asNamedPart:dl,name:ml,asCommon:function(t){return t.fold(r,r,r,r)},original:yl}),wl=function(t,e,n,r){return Dt(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},Cl=function(t,e){var n={};return L(e,(function(e){dl(e).each((function(e){var r=Sl(t,e.pname);n[e.name]=function(n){var o=Ce("Part: "+e.name+" in "+t,ie(e.schema),n);return f(f({},r),{config:n,validated:o})}}))})),n},Sl=function(t,e){return{uiType:Zf(),owner:t,name:e}},kl=function(t,e,n){return{uiType:Zf(),owner:t,name:e,config:n,validated:{}}},Ol=function(t){return G(t,(function(t){return t.fold(v.none,v.some,v.none,v.none).map((function(t){return ze(t.name,t.schema.concat([xa(yl())]))})).toArray()}))},_l=function(t){return F(t,ml)},El=function(t,e,r){return function(t,e,r){var o={},i={};return L(r,(function(t){t.fold((function(t){o[t.pname]=Jf(!0,(function(e,n,r){return t.factory.sketch(wl(e,t,n,r))}))}),(function(t){var r=e.parts[t.name];i[t.name]=n(t.factory.sketch(wl(e,t,r[yl()]),r))}),(function(t){o[t.pname]=Jf(!1,(function(e,n,r){return t.factory.sketch(wl(e,t,n,r))}))}),(function(t){o[t.pname]=Qf(!0,(function(e,n,r){var o=e[t.name];return F(o,(function(n){return t.factory.sketch(Dt(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:n(o),externals:n(i)}}(0,e,r)},Tl=function(t,e,n){return Kf(v.some(t),e,e.components,n)},Al=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},Bl=function(t,e,n){return Al(t,e,n).getOrDie("Could not find part: "+n)},Nl=function(t,e,r){var o={},i=e.partUids,u=t.getSystem();return L(r,(function(t){o[t]=n(u.getByUid(i[t]))})),o},Dl=function(t,e){var r=t.getSystem();return xt(e.partUids,(function(t,e){return n(r.getByUid(t))}))},Rl=function(t){return vt(t.partUids)},Ml=function(t,e,r){var o={},i=e.partUids,u=t.getSystem();return L(r,(function(t){o[t]=n(u.getByUid(i[t]).getOrDie())})),o},Il=function(t,e){var n=_l(e);return qt(F(n,(function(e){return{key:e,value:t+"-"+e}})))},Pl=function(t){return de("partUids","partUids",zt((function(e){return Il(e.uid,t)})),_e())},Fl=Object.freeze({__proto__:null,generate:Cl,generateOne:kl,schemas:Ol,names:_l,substitutes:El,components:Tl,defaultUids:Il,defaultUidsSchema:Pl,getAllParts:Dl,getAllPartNames:Rl,getPart:Al,getPartOrDie:Bl,getParts:Nl,getPartsOrDie:Ml}),Ll=function(t,e,n,r,o){var i=function(t,e){return(t.length>0?[ze("parts",t)]:[]).concat([Ie("uid"),Ke("dom",{}),Ke("components",[]),xa("originalSpec"),Ke("debug.sketcher",{})]).concat(e)}(r,o);return Ce(t+" [SpecSchema]",oe(i.concat(e)),n)},Vl=function(t,e,n,r,o){var i=Hl(o),u=Ol(n),a=Pl(n),c=Ll(t,e,i,u,[a]),s=El(0,c,n);return r(c,Tl(t,c,s.internals()),i,s.externals())},Hl=function(t){return function(t){return Et(t,"uid")}(t)?t:f(f({},t),{uid:ri("uid")})};var zl,jl=oe([Ie("name"),Ie("factory"),Ie("configFields"),Ke("apis",{}),Ke("extraApis",{})]),Ul=oe([Ie("name"),Ie("factory"),Ie("configFields"),Ie("partFields"),Ke("apis",{}),Ke("extraApis",{})]),Wl=function(t){var e=Ce("Sketcher for "+t.name,jl,t),n=xt(e.apis,li),r=xt(e.extraApis,(function(t,e){return ci(t,e)}));return f(f({name:e.name,configFields:e.configFields,sketch:function(t){return function(t,e,n,r){var o=Hl(r);return n(Ll(t,e,o,[],[]),o)}(e.name,e.configFields,e.factory,t)}},n),r)},ql=function(t){var e=Ce("Sketcher for "+t.name,Ul,t),n=Cl(e.name,e.partFields),r=xt(e.apis,li),o=xt(e.extraApis,(function(t,e){return ci(t,e)}));return f(f({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:function(t){return Vl(e.name,e.configFields,e.partFields,e.factory,t)},parts:n},r),o)},Gl=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},$l=function(t,e){return t?v.some(e):v.none()},Xl=function(t){return"input"===go(t)&&"radio"!==Ho(t,"type")||"textarea"===go(t)},Yl=Object.freeze({__proto__:null,getCurrent:function(t,e,n){return e.find(t)}}),Kl=[Ie("find")],Jl=ac({fields:Kl,name:"composing",apis:Yl}),Ql=function(t,e,n,r){var o=ls(t.element,"."+e.highlightClass);L(o,(function(n){M(r,(function(t){return t.element===n}))||(Bi(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),Gr(n,qr())})))}))},Zl=function(t,e,n,r){Ql(t,e,0,[r]),td(t,e,n,r)||(Ti(r.element,e.highlightClass),e.onHighlight(t,r),Gr(r,Wr()))},td=function(t,e,n,r){return Ni(r.element,e.highlightClass)},ed=function(t,e,n,r){var o=ls(t.element,"."+e.itemClass);return v.from(o[r]).fold((function(){return ot.error("No element found with index "+r)}),t.getSystem().getByDom)},nd=function(t,e,n){return Ku(t.element,"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},rd=function(t,e,n){var r=ls(t.element,"."+e.itemClass);return(r.length>0?v.some(r[r.length-1]):v.none()).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},od=function(t,e,n,r){var o=ls(t.element,"."+e.itemClass);return W(o,(function(t){return Ni(t,e.highlightClass)})).bind((function(e){var n=Ec(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},id=function(t,e,n){var r=ls(t.element,"."+e.itemClass);return Gl(F(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},ud=Object.freeze({__proto__:null,dehighlightAll:function(t,e,n){return Ql(t,e,0,[])},dehighlight:function(t,e,n,r){td(t,e,n,r)&&(Bi(r.element,e.highlightClass),e.onDehighlight(t,r),Gr(r,qr()))},highlight:Zl,highlightFirst:function(t,e,n){nd(t,e).each((function(r){Zl(t,e,n,r)}))},highlightLast:function(t,e,n){rd(t,e).each((function(r){Zl(t,e,n,r)}))},highlightAt:function(t,e,n,r){ed(t,e,n,r).fold((function(t){throw new Error(t)}),(function(r){Zl(t,e,n,r)}))},highlightBy:function(t,e,n,r){var o=id(t,e);U(o,r).each((function(r){Zl(t,e,n,r)}))},isHighlighted:td,getHighlighted:function(t,e,n){return Ku(t.element,"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},getFirst:nd,getLast:rd,getPrevious:function(t,e,n){return od(t,e,0,-1)},getNext:function(t,e,n){return od(t,e,0,1)},getCandidates:id}),ad=[Ie("highlightClass"),Ie("itemClass"),pa("onHighlight"),pa("onDehighlight")],cd=ac({fields:ad,name:"highlighting",apis:ud}),sd=[8],fd=[9],ld=[13],dd=[27],md=[32],gd=[37],pd=[38],hd=[39],vd=[40],bd=function(t,e,n){var r=X(t.slice(0,e)),o=X(t.slice(e+1));return U(r.concat(o),n)},yd=function(t,e,n){var r=X(t.slice(0,e));return U(r,n)},xd=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return U(o.concat(r),n)},wd=function(t,e,n){var r=t.slice(e+1);return U(r,n)},Cd=function(t){return function(e){var n=e.raw;return R(t,n.which)}},Sd=function(t){return function(e){return $(t,(function(t){return t(e)}))}},kd=function(t){return!0===t.raw.shiftKey},Od=function(t){return!0===t.raw.ctrlKey},_d=i(kd),Ed=function(t,e){return{matches:t,classification:e}},Td=function(t,e,n){e.exists((function(t){return n.exists((function(e){return qn(e,t)}))}))||$r(t,Hr(),{prevFocus:e,newFocus:n})},Ad=function(){var t=function(t){return pc(t.element)};return{get:t,set:function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);Td(e,r,o)}}},Bd=function(){var e=function(t){return cd.getHighlighted(t).map((function(t){return t.element}))};return{get:e,set:function(n,r){var o=e(n);n.getSystem().getByDom(r).fold(t,(function(t){cd.highlight(n,t)}));var i=e(n);Td(n,o,i)}}};!function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"}(zl||(zl={}));var Nd,Dd=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i,u,a=n(t,e,r,o);return(i=a,u=e.event,U(i,(function(t){return t.matches(u)})).map((function(t){return t.classification}))).bind((function(n){return n(t,e,r,o)}))},u={schema:function(){return t.concat([Ke("focusManager",Ad()),Je("focusInside","onFocus",be((function(t){return R(["onFocus","onEnterOrSpace","onApi"],t)?ot.value(t):ot.error("Invalid value for focusInside")}))),ya("handler",u),ya("state",e),ya("sendFocusIn",o)])},processKey:i,toEvents:function(t,e){var u=t.focusInside!==zl.OnFocusMode?v.none():o(t).map((function(n){return eo(wr(),(function(r,o){n(r,t,e),o.stop()}))})),a=[eo(dr(),(function(r,u){i(r,u,n,t,e).fold((function(){!function(n,r){var i=Cd(md.concat(ld))(r.event);t.focusInside===zl.OnEnterOrSpaceMode&&i&&Jn(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))}(r,u)}),(function(t){u.stop()}))})),eo(mr(),(function(n,o){i(n,o,r,t,e).each((function(t){o.stop()}))}))];return Qr(u.toArray().concat(a))}};return u},Rd=function(t){var e=[We("onEscape"),We("onEnter"),Ke("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Ke("firstTabstop",0),Ke("useTabstopAt",c),We("visibilitySelector")].concat([t]),r=function(t,e){var n=t.visibilitySelector.bind((function(t){return Ju(e,t)})).getOr(e);return xu(n)>0},i=function(t,e,n){(function(t,e){var n=ls(t.element,e.selector),o=H(n,(function(t){return r(e,t)}));return v.from(o[e.firstTabstop])})(t,e).each((function(n){e.focusManager.set(t,n)}))},u=function(t,e,n,o,i){return i(e,n,(function(t){return function(t,e){return r(t,e)&&t.useTabstopAt(e)}(o,t)})).fold((function(){return o.cyclic?v.some(!0):v.none()}),(function(e){return o.focusManager.set(t,e),v.some(!0)}))},a=function(t,e,n,r){var i=ls(t.element,n.selector);return function(t,e){return e.focusManager.get(t).bind((function(t){return Ju(t,e.selector)}))}(t,n).bind((function(e){return W(i,o(qn,e)).bind((function(e){return u(t,i,e,n,r)}))}))},s=n([Ed(Sd([kd,Cd(fd)]),(function(t,e,n){var r=n.cyclic?bd:yd;return a(t,0,n,r)})),Ed(Cd(fd),(function(t,e,n){var r=n.cyclic?xd:wd;return a(t,0,n,r)})),Ed(Cd(dd),(function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))})),Ed(Sd([_d,Cd(ld)]),(function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))}))]),f=n([]);return Dd(e,di.init,s,f,(function(){return v.some(i)}))},Md=Rd(un("cyclic",a)),Id=Rd(un("cyclic",c)),Pd=function(t,e,n){return Xl(n)&&Cd(md)(e.event)?v.none():function(t,e,n){return Yr(t,n,Or()),v.some(!0)}(t,0,n)},Fd=function(t,e){return v.some(!0)},Ld=[Ke("execute",Pd),Ke("useSpace",!1),Ke("useEnter",!0),Ke("useControlEnter",!1),Ke("useDown",!1)],Vd=function(t,e,n){return n.execute(t,e,t.element)},Hd=Dd(Ld,di.init,(function(t,e,n,r){var o=n.useSpace&&!Xl(t.element)?md:[],i=n.useEnter?ld:[],u=n.useDown?vd:[],a=o.concat(i).concat(u);return[Ed(Cd(a),Vd)].concat(n.useControlEnter?[Ed(Sd([Od,Cd(ld)]),Vd)]:[])}),(function(t,e,n,r){return n.useSpace&&!Xl(t.element)?[Ed(Cd(md),Fd)]:[]}),(function(){return v.none()})),zd=function(){var t=an(v.none());return mi({readState:function(){return t.get().map((function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(e,n){t.set(v.some({numRows:e,numColumns:n}))},getNumRows:function(){return t.get().map((function(t){return t.numRows}))},getNumColumns:function(){return t.get().map((function(t){return t.numColumns}))}})},jd=Object.freeze({__proto__:null,flatgrid:zd,init:function(t){return t.state(t)}}),Ud=function(t){return function(e,n,r,o){var i=t(e.element);return $d(i,e,n,r,o)}},Wd=function(t,e){var n=zc(t,e);return Ud(n)},qd=function(t,e){var n=zc(e,t);return Ud(n)},Gd=function(t){return function(e,n,r,o){return $d(t,e,n,r,o)}},$d=function(t,e,n,r,o){return r.focusManager.get(e).bind((function(n){return t(e.element,n,r,o)})).map((function(t){return r.focusManager.set(e,t),!0}))},Xd=Gd,Yd=Gd,Kd=Gd,Jd=function(t){return!function(t){return t.offsetWidth<=0&&t.offsetHeight<=0}(t.dom)},Qd=function(t,e,n){var r=ls(t,n);return function(t,e){return W(t,e).map((function(e){return{index:e,candidates:t}}))}(H(r,Jd),(function(t){return qn(t,e)}))},Zd=function(t,e){return W(t,(function(t){return qn(e,t)}))},tm=function(t,e,n,r){return r(Math.floor(e/n),e%n).bind((function(e){var r=e.row*n+e.column;return r>=0&&r<t.length?v.some(t[r]):v.none()}))},em=function(t,e,n,r,o){return tm(t,e,r,(function(e,i){var u=e===n-1?t.length-e*r:r,a=Ec(i,o,0,u-1);return v.some({row:e,column:a})}))},nm=function(t,e,n,r,o){return tm(t,e,r,(function(e,i){var u=Ec(e,o,0,n-1),a=u===n-1?t.length-u*r:r,c=Tc(i,0,a-1);return v.some({row:u,column:c})}))},rm=[Ie("selector"),Ke("execute",Pd),ha("onEscape"),Ke("captureTab",!1),wa()],om=function(t,e,n){Ku(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},im=function(t){return function(e,n,r,o){return Qd(e,n,r.selector).bind((function(e){return t(e.candidates,e.index,o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))}))}},um=function(t,e,n){return n.captureTab?v.some(!0):v.none()},am=im((function(t,e,n,r){return em(t,e,n,r,-1)})),cm=im((function(t,e,n,r){return em(t,e,n,r,1)})),sm=im((function(t,e,n,r){return nm(t,e,n,r,-1)})),fm=im((function(t,e,n,r){return nm(t,e,n,r,1)})),lm=n([Ed(Cd(gd),Wd(am,cm)),Ed(Cd(hd),qd(am,cm)),Ed(Cd(pd),Xd(sm)),Ed(Cd(vd),Yd(fm)),Ed(Sd([kd,Cd(fd)]),um),Ed(Sd([_d,Cd(fd)]),um),Ed(Cd(dd),(function(t,e,n){return n.onEscape(t,e)})),Ed(Cd(md.concat(ld)),(function(t,e,n,r){return function(t,e){return e.focusManager.get(t).bind((function(t){return Ju(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))}))]),dm=n([Ed(Cd(md),Fd)]),mm=Dd(rm,zd,lm,dm,(function(){return v.some(om)})),gm=function(t,e,n,r){var o=function(t,e,n){var i,u=Ec(e,r,0,n.length-1);return u===t?v.none():(i=n[u],"button"===go(i)&&"disabled"===Ho(i,"disabled")?o(t,u,n):v.from(n[u]))};return Qd(t,n,e).bind((function(t){var e=t.index,n=t.candidates;return o(e,e,n)}))},pm=[Ie("selector"),Ke("getInitial",v.none),Ke("execute",Pd),ha("onEscape"),Ke("executeOnMove",!1),Ke("allowVertical",!0)],hm=function(t,e,n){return function(t,e){return e.focusManager.get(t).bind((function(t){return Ju(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))},vm=function(t,e,n){e.getInitial(t).orThunk((function(){return Ku(t.element,e.selector)})).each((function(n){e.focusManager.set(t,n)}))},bm=function(t,e,n){return gm(t,n.selector,e,-1)},ym=function(t,e,n){return gm(t,n.selector,e,1)},xm=function(t){return function(e,n,r,o){return t(e,n,r,o).bind((function(){return r.executeOnMove?hm(e,n,r):v.some(!0)}))}},wm=function(t,e,n){return n.onEscape(t,e)},Cm=n([Ed(Cd(md),Fd)]),Sm=Dd(pm,di.init,(function(t,e,n,r){var o=gd.concat(n.allowVertical?pd:[]),i=hd.concat(n.allowVertical?vd:[]);return[Ed(Cd(o),xm(Wd(bm,ym))),Ed(Cd(i),xm(qd(bm,ym))),Ed(Cd(ld),hm),Ed(Cd(md),hm),Ed(Cd(dd),wm)]}),Cm,(function(){return v.some(vm)})),km=function(t,e,n){return v.from(t[e]).bind((function(t){return v.from(t[n]).map((function(t){return{rowIndex:e,columnIndex:n,cell:t}}))}))},Om=function(t,e,n,r){var o=t[e].length,i=Ec(n,r,0,o-1);return km(t,e,i)},_m=function(t,e,n,r){var o=Ec(n,r,0,t.length-1),i=t[o].length,u=Tc(e,0,i-1);return km(t,o,u)},Em=function(t,e,n,r){var o=t[e].length,i=Tc(n+r,0,o-1);return km(t,e,i)},Tm=function(t,e,n,r){var o=Tc(n+r,0,t.length-1),i=t[o].length,u=Tc(e,0,i-1);return km(t,o,u)},Am=[ze("selectors",[Ie("row"),Ie("cell")]),Ke("cycles",!0),Ke("previousSelector",v.none),Ke("execute",Pd)],Bm=function(t,e,n){e.previousSelector(t).orThunk((function(){var n=e.selectors;return Ku(t.element,n.cell)})).each((function(n){e.focusManager.set(t,n)}))},Nm=function(t,e){return function(n,r,o){var i=o.cycles?t:e;return Ju(r,o.selectors.row).bind((function(t){var e=ls(t,o.selectors.cell);return Zd(e,r).bind((function(e){var r=ls(n,o.selectors.row);return Zd(r,t).bind((function(t){var n=function(t,e){return F(t,(function(t){return ls(t,e.selectors.cell)}))}(r,o);return i(n,t,e).map((function(t){return t.cell}))}))}))}))}},Dm=Nm((function(t,e,n){return Om(t,e,n,-1)}),(function(t,e,n){return Em(t,e,n,-1)})),Rm=Nm((function(t,e,n){return Om(t,e,n,1)}),(function(t,e,n){return Em(t,e,n,1)})),Mm=Nm((function(t,e,n){return _m(t,n,e,-1)}),(function(t,e,n){return Tm(t,n,e,-1)})),Im=Nm((function(t,e,n){return _m(t,n,e,1)}),(function(t,e,n){return Tm(t,n,e,1)})),Pm=n([Ed(Cd(gd),Wd(Dm,Rm)),Ed(Cd(hd),qd(Dm,Rm)),Ed(Cd(pd),Xd(Mm)),Ed(Cd(vd),Yd(Im)),Ed(Cd(md.concat(ld)),(function(t,e,n){return pc(t.element).bind((function(r){return n.execute(t,e,r)}))}))]),Fm=n([Ed(Cd(md),Fd)]),Lm=Dd(Am,di.init,Pm,Fm,(function(){return v.some(Bm)})),Vm=[Ie("selector"),Ke("execute",Pd),Ke("moveOnTab",!1)],Hm=function(t,e,n){return n.focusManager.get(t).bind((function(r){return n.execute(t,e,r)}))},zm=function(t,e,n){Ku(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},jm=function(t,e,n){return gm(t,n.selector,e,-1)},Um=function(t,e,n){return gm(t,n.selector,e,1)},Wm=n([Ed(Cd(pd),Kd(jm)),Ed(Cd(vd),Kd(Um)),Ed(Sd([kd,Cd(fd)]),(function(t,e,n,r){return n.moveOnTab?Kd(jm)(t,e,n,r):v.none()})),Ed(Sd([_d,Cd(fd)]),(function(t,e,n,r){return n.moveOnTab?Kd(Um)(t,e,n,r):v.none()})),Ed(Cd(ld),Hm),Ed(Cd(md),Hm)]),qm=n([Ed(Cd(md),Fd)]),Gm=Dd(Vm,di.init,Wm,qm,(function(){return v.some(zm)})),$m=[ha("onSpace"),ha("onEnter"),ha("onShiftEnter"),ha("onLeft"),ha("onRight"),ha("onTab"),ha("onShiftTab"),ha("onUp"),ha("onDown"),ha("onEscape"),Ke("stopSpaceKeyup",!1),We("focusIn")],Xm=Dd($m,di.init,(function(t,e,n){return[Ed(Cd(md),n.onSpace),Ed(Sd([_d,Cd(ld)]),n.onEnter),Ed(Sd([kd,Cd(ld)]),n.onShiftEnter),Ed(Sd([kd,Cd(fd)]),n.onShiftTab),Ed(Sd([_d,Cd(fd)]),n.onTab),Ed(Cd(pd),n.onUp),Ed(Cd(vd),n.onDown),Ed(Cd(gd),n.onLeft),Ed(Cd(hd),n.onRight),Ed(Cd(md),n.onSpace),Ed(Cd(dd),n.onEscape)]}),(function(t,e,n){return n.stopSpaceKeyup?[Ed(Cd(md),Fd)]:[]}),(function(t){return t.focusIn})),Ym=Md.schema(),Km=Id.schema(),Jm=Sm.schema(),Qm=mm.schema(),Zm=Lm.schema(),tg=Hd.schema(),eg=Gm.schema(),ng=Xm.schema(),rg=sc({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:Ym,cyclic:Km,flow:Jm,flatgrid:Qm,matrix:Zm,execution:tg,menu:eg,special:ng}),name:"keying",active:{events:function(t,e){return t.handler.toEvents(t,e)}},apis:{focusIn:function(t,e,n){e.sendFocusIn(e).fold((function(){t.getSystem().triggerFocus(t.element,t.element)}),(function(r){r(t,e,n)}))},setGridSize:function(t,e,n,r,o){!function(t){return Tt(t,"setGridSize")}(n)?console.error("Layout does not support setGridSize"):n.setGridSize(r,o)}},state:jd}),og=function(t,e,n,r){var o=t.getSystem().build(r);nf(t,o,n)},ig=function(t,e,n,r){var o=ug(t);U(o,(function(t){return qn(r.element,t.element)})).each(of)},ug=function(t,e){return t.components()},ag=function(t,e,n,r,o){var i=ug(t);return v.from(i[r]).map((function(e){return ig(t,0,0,e),o.each((function(e){og(t,0,(function(t,e){!function(t,e,n){Eo(t,n).fold((function(){No(t,e)}),(function(t){To(t,e)}))}(t,e,r)}),e)})),e}))},cg=ac({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(t,e,n,r){og(t,0,No,r)},prepend:function(t,e,n,r){og(t,0,Bo,r)},remove:ig,replaceAt:ag,replaceBy:function(t,e,n,r,o){var i=ug(t);return W(i,r).bind((function(e){return ag(t,0,0,e,o)}))},set:function(t,e,n,r){hc((function(){var e=F(r,t.getSystem().build);tf(t,e)}),t.element)},contents:ug})}),sg=function(t,e){return{key:t,value:{config:{},me:function(t,e){var r=Qr(e);return ac({fields:[Ie("enabled")],name:t,active:{events:n(r)}})}(t,e),configAsRaw:n({}),initialConfig:{},state:di}}},fg=function(t,e){e.ignore||(mc(t.element),e.onFocus(t))},lg=Object.freeze({__proto__:null,focus:fg,blur:function(t,e){e.ignore||function(t){t.dom.blur()}(t.element)},isFocused:function(t){return function(t){var e=Li(t).dom;return t.dom===e.activeElement}(t.element)}}),dg=Object.freeze({__proto__:null,exhibit:function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return pi(n)},events:function(t){return Qr([eo(wr(),(function(e,n){fg(e,t),n.stop()}))].concat(t.stopMousedown?[eo(ir(),(function(t,e){e.event.prevent()}))]:[]))}}),mg=[pa("onFocus"),Ke("stopMousedown",!1),Ke("ignore",!1)],gg=ac({fields:mg,name:"focusing",active:dg,apis:lg}),pg=function(t,e,n){var r=e.aria;r.update(t,r,n.get())},hg=function(t,e,n){e.toggleClass.each((function(e){n.get()?Ti(t.element,e):Bi(t.element,e)}))},vg=function(t,e,n){xg(t,e,n,!n.get())},bg=function(t,e,n){n.set(!0),hg(t,e,n),pg(t,e,n)},yg=function(t,e,n){n.set(!1),hg(t,e,n),pg(t,e,n)},xg=function(t,e,n,r){(r?bg:yg)(t,e,n)},wg=function(t,e,n){xg(t,e,n,e.selected)},Cg=Object.freeze({__proto__:null,onLoad:wg,toggle:vg,isOn:function(t,e,n){return n.get()},on:bg,off:yg,set:xg}),Sg=Object.freeze({__proto__:null,exhibit:function(){return pi({})},events:function(t,e){var n,r,o,i=(n=t,r=e,o=vg,mo((function(t){o(t,n,r)}))),u=ec(t,e,wg);return Qr(q([t.toggleOnExecute?[i]:[],[u]]))}}),kg=function(t,e,n){Vo(t.element,"aria-expanded",n)},Og=[Ke("selected",!1),We("toggleClass"),Ke("toggleOnExecute",!0),Je("aria",{mode:"none"},Oe("mode",{pressed:[Ke("syncWithExpanded",!1),ya("update",(function(t,e,n){Vo(t.element,"aria-pressed",n),e.syncWithExpanded&&kg(t,e,n)}))],checked:[ya("update",(function(t,e,n){Vo(t.element,"aria-checked",n)}))],expanded:[ya("update",kg)],selected:[ya("update",(function(t,e,n){Vo(t.element,"aria-selected",n)}))],none:[ya("update",t)]}))],_g=ac({fields:Og,name:"toggling",active:Sg,apis:Cg,state:(Nd=!1,{init:function(){var t=an(Nd);return{get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(Nd)},readState:function(){return t.get()}}}})}),Eg=function(){var t=function(t,e){e.stop(),Xr(t)};return[eo(hr(),t),eo(Er(),t),uo(er()),uo(ir())]},Tg=function(t){return Qr(q([t.map((function(t){return mo((function(e,n){t(e),n.stop()}))})).toArray(),Eg()]))},Ag="alloy.item-hover",Bg="alloy.item-focus",Ng=function(t){(pc(t.element).isNone()||gg.isFocused(t))&&(gg.isFocused(t)||gg.focus(t),$r(t,Ag,{item:t}))},Dg=function(t){$r(t,Bg,{item:t})},Rg=n(Ag),Mg=n(Bg),Ig=[Ie("data"),Ie("components"),Ie("dom"),Ke("hasSubmenu",!1),We("toggling"),Uf("itemBehaviours",[_g,gg,rg,Vf]),Ke("ignoreFocus",!1),Ke("domModification",{}),ya("builder",(function(t){return{dom:t.dom,domModification:f(f({},t.domModification),{attributes:f(f(f({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Wf(t.itemBehaviours,[t.toggling.fold(_g.revoke,(function(t){return _g.config(f({aria:{mode:"checked"}},t))})),gg.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){Dg(t)}}),rg.config({mode:"execution"}),Vf.config({store:{mode:"memory",initialValue:t.data}}),sg("item-type-events",d(Eg(),[eo(sr(),Ng),eo(_r(),gg.focus)]))]),components:t.components,eventOrder:t.eventOrder}})),Ke("eventOrder",{})],Pg=[Ie("dom"),Ie("components"),ya("builder",(function(t){return{dom:t.dom,components:t.components,events:Qr([ao(_r())])}}))],Fg=n([pl({name:"widget",overrides:function(t){return{behaviours:ic([Vf.config({store:{mode:"manual",getValue:function(e){return t.data},setValue:function(){}}})])}}})]),Lg=[Ie("uid"),Ie("data"),Ie("components"),Ie("dom"),Ke("autofocus",!1),Ke("ignoreFocus",!1),Uf("widgetBehaviours",[Vf,gg,rg]),Ke("domModification",{}),Pl(Fg()),ya("builder",(function(t){var e=El(0,t,Fg()),n=Tl("item-widget",t,e.internals()),r=function(e){return Al(e,t,"widget").map((function(t){return rg.focusIn(t),t}))},o=function(e,n){return Xl(n.event.target)?v.none():t.autofocus?(n.setSource(e.element),v.none()):v.none()};return{dom:t.dom,components:n,domModification:t.domModification,events:Qr([mo((function(t,e){r(t).each((function(t){e.stop()}))})),eo(sr(),Ng),eo(_r(),(function(e,n){t.autofocus?r(e):gg.focus(e)}))]),behaviours:Wf(t.widgetBehaviours,[Vf.config({store:{mode:"memory",initialValue:t.data}}),gg.config({ignore:t.ignoreFocus,onFocus:function(t){Dg(t)}}),rg.config({mode:"special",focusIn:t.autofocus?function(t){r(t)}:fc(),onLeft:o,onRight:o,onEscape:function(e,n){return gg.isFocused(e)||t.autofocus?t.autofocus?(n.setSource(e.element),v.none()):v.none():(gg.focus(e),v.some(!0))}})])}}))],Vg=Oe("type",{widget:Lg,item:Ig,separator:Pg}),Hg=n([bl({factory:{sketch:function(t){var e=Ce("menu.spec item",Vg,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return e.hasOwnProperty("uid")?e:f(f({},e),{uid:ri("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),zg=n([Ie("value"),Ie("items"),Ie("dom"),Ie("components"),Ke("eventOrder",{}),Hf("menuBehaviours",[cd,Vf,Jl,rg]),Je("movement",{mode:"menu",moveOnTab:!0},Oe("mode",{grid:[wa(),ya("config",(function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}}))],matrix:[ya("config",(function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}})),Ie("rowSelector")],menu:[Ke("moveOnTab",!0),ya("config",(function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}}))]})),Pe("markers",fa()),Ke("fakeFocus",!1),Ke("focusManager",Ad()),pa("onHighlight")]),jg=n("alloy.menu-focus"),Ug=ql({name:"Menu",configFields:zg(),partFields:Hg(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:jf(t.menuBehaviours,[cd.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),Vf.config({store:{mode:"memory",initialValue:t.value}}),Jl.config({find:v.some}),rg.config(t.movement.config(t,t.movement))]),events:Qr([eo(Mg(),(function(t,e){var n=e.event;t.getSystem().getByDom(n.target).each((function(n){cd.highlight(t,n),e.stop(),$r(t,jg(),{menu:t,item:n})}))})),eo(Rg(),(function(t,e){var n=e.event.item;cd.highlight(t,n)}))]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Wg=function(t,e,n,r){return _t(n,r).bind((function(r){return _t(t,r).bind((function(r){var o=Wg(t,e,n,r);return v.some([r].concat(o))}))})).getOr([])},qg=function(t,e){var n={};yt(t,(function(t,e){L(t,(function(t){n[t]=e}))}));var r=e,o=wt(e,(function(t,e){return{k:t,v:e}})),i=xt(o,(function(t,e){return[e].concat(Wg(n,r,o,e))}));return xt(n,(function(t){return _t(i,t).getOr([t])}))},Gg=function(t){return"prepared"===t.type?v.some(t.menu):v.none()},$g={init:function(){var t=an({}),e=an({}),n=an({}),r=an(v.none()),o=an({}),i=function(e,n,r){return u(e).bind((function(o){return function(e){return kt(t.get(),(function(t,n){return t===e}))}(e).bind((function(t){return n(t).map((function(t){return{triggeredMenu:o,triggeringItem:t,triggeringPath:r}}))}))}))},u=function(t){return a(t).bind(Gg)},a=function(t){return _t(e.get(),t)},c=function(e){return _t(t.get(),e)};return{setMenuBuilt:function(t,n){var r;e.set(f(f({},e.get()),((r={})[t]={type:"prepared",menu:n},r)))},setContents:function(i,u,a,c){r.set(v.some(i)),t.set(a),e.set(u),o.set(c);var s=qg(c,a);n.set(s)},expand:function(e){return _t(t.get(),e).map((function(t){var r=_t(n.get(),e).getOr([]);return[t].concat(r)}))},refresh:function(t){return _t(n.get(),t)},collapse:function(t){return _t(n.get(),t).bind((function(t){return t.length>1?v.some(t.slice(1)):v.none()}))},lookupMenu:a,lookupItem:c,otherMenus:function(t){var e=o.get();return Y(vt(e),t)},getPrimary:function(){return r.get().bind(u)},getMenus:function(){return e.get()},clear:function(){t.set({}),e.set({}),n.set({}),r.set(v.none())},isClear:function(){return r.get().isNone()},getTriggeringPath:function(t,e){var o=H(c(t).toArray(),(function(t){return u(t).isSome()}));return _t(n.get(),t).bind((function(t){var n=X(o.concat(t));return function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r.isSome())return v.none();e.push(r.getOrDie())}return v.some(e)}(G(n,(function(t,o){return i(t,e,n.slice(0,o+1)).fold((function(){return r.get().is(t)?[]:[v.none()]}),(function(t){return[v.some(t)]}))})))}))}}},extractPreparedMenu:Gg},Xg=n("collapse-item"),Yg=Wl({name:"TieredMenu",configFields:[ba("onExecute"),ba("onEscape"),va("onOpenMenu"),va("onOpenSubmenu"),pa("onRepositionMenu"),pa("onCollapseMenu"),Ke("highlightImmediately",!0),ze("data",[Ie("primary"),Ie("menus"),Ie("expansions")]),Ke("fakeFocus",!1),pa("onHighlight"),pa("onHover"),da(),Ie("dom"),Ke("navigateOnHover",!0),Ke("stayInDom",!1),Hf("tmenuBehaviours",[rg,cd,Jl,cg]),Ke("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:function(t,e){var n,r=an(v.none()),o=$g.init(),i=function(e){var n=function(e,n,r){return xt(r,(function(r,o){var i=function(){return Ug.sketch(f(f({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?Bd():Ad()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))}(e,t.data.primary,t.data.menus),r=a();return o.setContents(t.data.primary,n,t.data.expansions,r),o.getPrimary()},u=function(t){return Vf.getValue(t).value},a=function(e){return xt(t.data.menus,(function(t,e){return G(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},c=function(t,e){cd.highlight(t,e),cd.getHighlighted(e).orThunk((function(){return cd.getFirst(e)})).each((function(e){Yr(t,e.element,_r())}))},s=function(t,e){return Gl(F(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?v.some(t.menu):v.none()}))})))},l=function(e,n,r){var o=s(n,n.otherMenus(r));L(o,(function(n){Ri(n.element,[t.markers.backgroundMenu]),t.stayInDom||cg.remove(e,n)}))},d=function(e,n){var o=function(e){return r.get().getOrThunk((function(){var n={},o=ls(e.element,"."+t.markers.item),i=H(o,(function(t){return"true"===Ho(t,"aria-haspopup")}));return L(i,(function(t){e.getSystem().getByDom(t).each((function(t){var e=u(t);n[e]=t}))})),r.set(v.some(n)),n}))}(e);yt(o,(function(t,e){var r=R(n,e);Vo(t.element,"aria-expanded",r)}))},m=function(e,n,r){return v.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return v.none();var i=o.menu,u=s(n,r.slice(1));return L(u,(function(e){Ti(e.element,t.markers.backgroundMenu)})),Ui(i.element)||cg.append(e,vu(i)),Ri(i.element,[t.markers.backgroundMenu]),c(e,i),l(e,n,r),v.some(i)}))}))};!function(t){t[t.HighlightSubmenu=0]="HighlightSubmenu",t[t.HighlightParent=1]="HighlightParent"}(n||(n={}));var g=function(e,r,i){void 0===i&&(i=n.HighlightSubmenu);var a=u(r);return o.expand(a).bind((function(u){return d(e,u),v.from(u[0]).bind((function(a){return o.lookupMenu(a).bind((function(c){var s=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return o.setMenuBuilt(e,r),r}return n.menu}(e,a,c);return Ui(s.element)||cg.append(e,vu(s)),t.onOpenSubmenu(e,r,s,X(u)),i===n.HighlightSubmenu?(cd.highlightFirst(s),m(e,o,u)):(cd.dehighlightAll(s),v.some(r))}))}))}))},p=function(e,n){var r=u(n);return o.collapse(r).bind((function(r){return d(e,r),m(e,o,r).map((function(r){return t.onCollapseMenu(e,n,r),r}))}))},h=function(e){return function(n,r){return Ju(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOptional().bind((function(t){return e(n,t).map((function(){return!0}))}))}))}},b=Qr([eo(jg(),(function(t,e){var n=e.event.item;o.lookupItem(u(n)).each((function(){var n=e.event.menu;cd.highlight(t,n);var r=u(e.event.item);o.refresh(r).each((function(e){return l(t,o,e)}))}))})),mo((function(e,r){var o=r.event.target;e.getSystem().getByDom(o).each((function(r){0===u(r).indexOf("collapse-item")&&p(e,r),g(e,r,n.HighlightSubmenu).fold((function(){t.onExecute(e,r)}),(function(){}))}))})),so((function(e,n){i(e).each((function(n){cg.append(e,vu(n)),t.onOpenMenu(e,n),t.highlightImmediately&&c(e,n)}))}))].concat(t.navigateOnHover?[eo(Rg(),(function(e,r){var i=r.event.item;!function(t,e){var n=u(e);o.refresh(n).bind((function(e){return d(t,e),m(t,o,e)}))}(e,i),g(e,i,n.HighlightParent),t.onHover(e,i)}))]:[])),y=function(t){return cd.getHighlighted(t).bind(cd.getHighlighted)},x={collapseMenu:function(t){y(t).each((function(e){p(t,e)}))},highlightPrimary:function(t){o.getPrimary().each((function(e){c(t,e)}))},repositionMenus:function(e){o.getPrimary().bind((function(t){return y(e).bind((function(t){var e=u(t),n=Ot(o.getMenus()),r=Gl(F(n,$g.extractPreparedMenu));return o.getTriggeringPath(e,(function(t){return function(t,e,n){return et(e,(function(t){if(!t.getSystem().isConnected())return v.none();var e=cd.getCandidates(t);return U(e,(function(t){return u(t)===n}))}))}(0,r,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))})).fold((function(){(function(t){return v.from(t.components()[0]).filter((function(t){return"menu"===Ho(t.element,"role")}))})(e).each((function(n){t.onRepositionMenu(e,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)}))}};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:jf(t.tmenuBehaviours,[rg.config({mode:"special",onRight:h((function(t,e){return Xl(e.element)?v.none():g(t,e,n.HighlightSubmenu)})),onLeft:h((function(t,e){return Xl(e.element)?v.none():p(t,e)})),onEscape:h((function(e,n){return p(e,n).orThunk((function(){return t.onEscape(e,n).map((function(){return e}))}))})),focusIn:function(t,e){o.getPrimary().each((function(e){Yr(t,e.element,_r())}))}}),cd.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),Jl.config({find:function(t){return cd.getHighlighted(t)}}),cg.config({})]),eventOrder:t.eventOrder,apis:x,events:b}},extraApis:{tieredData:function(t,e,n){return{primary:t,menus:e,expansions:n}},singleData:function(t,e){return{primary:t,menus:Wt(t,e),expansions:{}}},collapseItem:function(t){return{value:Ko(Xg()),meta:{text:t}}}}}),Kg=Wl({name:"InlineView",configFields:[Ie("lazySink"),pa("onShow"),pa("onHide"),Xe("onEscape"),Hf("inlineBehaviours",[yf,Vf,lc]),Ye("fireDismissalEventInstead",[Ke("event",Lr())]),Ye("fireRepositionEventInstead",[Ke("event",Vr())]),Ke("getRelated",v.none),Ke("isExtraPart",a),Ke("eventOrder",v.none)],factory:function(t,e){var n=function(t,e,n,o){r(t,e,n,(function(){return o.map((function(t){return zu(t)}))}))},r=function(e,n,r,o){var i=t.lazySink(e).getOrDie();yf.openWhileCloaked(e,r,(function(){return Ks.positionWithinBounds(i,n,e,o())})),Vf.setValue(e,v.some({mode:"position",anchor:n,getBounds:o}))},o=function(e,n,r,o){var i=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},u="horizontal"===r.type?{layouts:{onLtr:function(){return Ja()},onRtl:function(){return Qa()}}}:{},a=function(t){return function(t){return 2===t.length}(t)?u:{}};return Yg.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return yf.close(e),t.onEscape.map((function(t){return t(e)})),v.some(!0)},onExecute:function(){return v.some(!0)},onOpenMenu:function(t,e){Ks.positionWithinBounds(i().getOrDie(),n,e,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();Ks.position(o,f({anchor:"submenu",item:e},a(r)),n)},onRepositionMenu:function(t,e,r){var u=i().getOrDie();Ks.positionWithinBounds(u,n,e,o()),L(r,(function(t){var e=a(t.triggeringPath);Ks.position(u,f({anchor:"submenu",item:t.triggeringItem},e),t.triggeredMenu)}))}})}(t,e,n,r,o);yf.open(e,i),Vf.setValue(e,v.some({mode:"menu",menu:i}))},i=function(e){yf.isOpen(e)&&Vf.getValue(e).each((function(n){switch(n.mode){case"menu":yf.getState(e).each((function(t){Yg.repositionMenus(t)}));break;case"position":var r=t.lazySink(e).getOrDie();Ks.positionWithinBounds(r,n.anchor,e,n.getBounds())}}))},u={setContent:function(t,e){yf.setContent(t,e)},showAt:function(t,e,r){n(t,e,r,v.none())},showWithin:n,showWithinBounds:r,showMenuAt:function(t,e,n){o(t,e,n,(function(){return v.none()}))},showMenuWithinBounds:o,hide:function(t){yf.isOpen(t)&&(Vf.setValue(t,v.none()),yf.close(t))},getContent:function(t){return yf.getState(t)},reposition:i,isOpen:yf.isOpen};return{uid:t.uid,dom:t.dom,behaviours:jf(t.inlineBehaviours,[yf.config({isPartOf:function(e,n,r){return ta(n,r)||function(e,n){return t.getRelated(e).exists((function(t){return ta(t,n)}))}(e,r)},getAttachPoint:function(e){return t.lazySink(e).getOrDie()},onOpen:function(e){t.onShow(e)},onClose:function(e){t.onHide(e)}}),Vf.config({store:{mode:"memory",initialValue:v.none()}}),lc.config({channels:f(f({},kf(f({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),_f(f(f({},t.fireRepositionEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})),{doReposition:i})))})]),eventOrder:t.eventOrder,apis:u}},apis:{showAt:function(t,e,n,r){t.showAt(e,n,r)},showWithin:function(t,e,n,r,o){t.showWithin(e,n,r,o)},showWithinBounds:function(t,e,n,r,o){t.showWithinBounds(e,n,r,o)},showMenuAt:function(t,e,n,r){t.showMenuAt(e,n,r)},showMenuWithinBounds:function(t,e,n,r,o){t.showMenuWithinBounds(e,n,r,o)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)},reposition:function(t,e){t.reposition(e)}}}),Jg=function(t){return t.x},Qg=function(t,e){return t.x+t.width/2-e.width/2},Zg=function(t,e){return t.x+t.width-e.width},tp=function(t){return t.y},ep=function(t,e){return t.y+t.height-e.height},np=function(t,e,n){return Ca(Zg(t,e),ep(t,e),n.innerSoutheast(),Ea(),Da(t,{right:0,bottom:3}),"layout-inner-se")},rp=function(t,e,n){return Ca(Jg(t),ep(t,e),n.innerSouthwest(),_a(),Da(t,{left:1,bottom:3}),"layout-inner-sw")},op=function(t,e,n){return Ca(Zg(t,e),tp(t),n.innerNortheast(),Oa(),Da(t,{right:0,top:2}),"layout-inner-ne")},ip=function(t,e,n){return Ca(Jg(t),tp(t),n.innerNorthwest(),ka(),Da(t,{left:1,top:2}),"layout-inner-nw")},up=function(t,e,n){return Ca(Qg(t,e),tp(t),n.innerNorth(),Ta(),Da(t,{top:2}),"layout-inner-n")},ap=function(t,e,n){return Ca(Qg(t,e),ep(t,e),n.innerSouth(),Aa(),Da(t,{bottom:3}),"layout-inner-s")},cp=tinymce.util.Tools.resolve("tinymce.util.Delay"),sp=Wl({name:"Button",factory:function(t){var e=Tg(t.action),n=t.dom.tag,r=function(e){return _t(t.dom,"attributes").bind((function(t){return _t(t,e)}))};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:Wf(t.buttonBehaviours,[gg.config({}),rg.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map((function(t){return{role:t}})).getOr({});return f({type:t},e)}return{role:r("role").getOr("button")}}()},eventOrder:t.eventOrder}},configFields:[Ke("uid",void 0),Ie("dom"),Ke("components",[]),Uf("buttonBehaviours",[gg,rg]),We("action"),We("role"),Ke("eventOrder",{})]}),fp=function(t){var e=function(t){return void 0!==t.uid}(t)&&Tt(t,"uid")?t.uid:ri("memento");return{get:function(t){return t.getSystem().getByUid(e).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(e).toOptional()},asSpec:function(){return f(f({},t),{uid:e})}}},lp=function(t){return v.from(t()["temporary-placeholder"]).getOr("!not found!")},dp=function(t,e){return v.from(e()[t.toLowerCase()]).getOrThunk((function(){return lp(e)}))},mp=function(t,e){return et(t,(function(t){return v.from(e()[t.toLowerCase()])})).getOrThunk((function(){return lp(e)}))},gp={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},pp=Wl({name:"Notification",factory:function(t){var e=fp({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:ic([cg.config({})])}),n=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},r=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},o=fp({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(0)]},r(0)],behaviours:ic([cg.config({})])}),i={updateProgress:function(t,e){t.getSystem().isConnected()&&o.getOpt(t).each((function(t){cg.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(e)]},r(e)])}))},updateText:function(t,n){if(t.getSystem().isConnected()){var r=e.get(t);cg.set(r,[mu(n)])}}},u=q([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return v.from(gp[t])})).toArray()]),a=fp(sp.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:dp("close",t.iconProvider),attributes:{"aria-label":t.translationProvider("Close")}}}],action:function(e){t.onAction(e)}})),c=[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:mp(u,t.iconProvider)}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[e.asSpec()],behaviours:ic([cg.config({})])}];return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map((function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]})).getOr(["tox-notification","tox-notification--in"])},behaviours:ic([gg.config({}),sg("notification-events",[eo(fr(),(function(t){a.getOpt(t).each(gg.focus)}))])]),components:c.concat(t.progress?[o.asSpec()]:[]).concat(t.closeButton?[a.asSpec()]:[]),apis:i}},configFields:[We("level"),Ie("progress"),Ie("icon"),Ie("onAction"),Ie("text"),Ie("iconProvider"),Ie("translationProvider"),en("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function hp(t,e,n){var r=e.backstage;return{open:function(t,o){var i=!t.closeButton&&t.timeout&&(t.timeout>0||t.timeout<0),u=function(){o(),Kg.hide(c)},a=hu(pp.sketch({text:t.text,level:R(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:v.from(t.icon),closeButton:!i,onAction:u,iconProvider:r.shared.providers.icons,translationProvider:r.shared.providers.translate})),c=hu(Kg.sketch(f({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:e.backstage.shared.getSink,fireDismissalEventInstead:{}},r.shared.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));return n.add(c),t.timeout>0&&cp.setTimeout((function(){u()}),t.timeout),{close:u,moveTo:function(t,e){Kg.showAt(c,{anchor:"makeshift",x:t,y:e},vu(a))},moveRel:function(t,n){if("banner"!==n){var r=function(t){switch(t){case"bc-bc":return ap;case"tc-tc":return up;case"tc-bc":return Ua;case"bc-tc":default:return Wa}}(n),o={anchor:"node",root:Wi(),node:v.some(sn.fromDom(t)),layouts:{onRtl:function(){return[r]},onLtr:function(){return[r]}}};Kg.showAt(c,o,vu(a))}else Kg.showAt(c,e.backstage.shared.anchors.banner(),vu(a))},text:function(t){pp.updateText(a,t)},settings:t,getEl:function(){return a.element.dom},progressBar:{value:function(t){pp.updateProgress(a,t)}}}},close:function(t){t.close()},reposition:function(t){!function(t){L(t,(function(t){return t.moveTo(0,0)}))}(t),function(t){t.length>0&&(Q(t).each((function(t){return t.moveRel(null,"banner")})),L(t,(function(e,n){n>0&&e.moveRel(t[n-1].getEl(),"bc-tc")})))}(t)},getArgs:function(t){return t.settings}}}var vp,bp=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];null!==n&&clearTimeout(n),n=setTimeout((function(){t.apply(null,r),n=null}),e)}}},yp=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),xp=function(t,e,n,r,o){var i=yp(t,(function(e){return function(t,e){return t.isBlock(e)||R(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}(t,e)}));return v.from(i.backwards(e,n,r,o))},wp=function(t,e){return Cp(sn.fromDom(t.selection.getNode())).getOrThunk((function(){var n=sn.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',t.getDoc());return No(n,sn.fromDom(e.extractContents())),e.insertNode(n.dom),ko(n).each((function(t){return t.dom.normalize()})),function(t){return fs(t,ss)}(n).map((function(e){t.selection.setCursorLocation(e.dom,function(t){return"img"===go(t)?1:as(t).fold((function(){return _o(t).length}),(function(t){return t.length}))}(e))})),n}))},Cp=function(t){return Ju(t,"[data-mce-autocompleter]")},Sp=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},kp=function(t){return""!==t&&-1!=="  \f\n\r\t\v".indexOf(t)},Op=function(t,e){return t.substring(e.length)},_p=function(t,e,n,r){if(void 0===r&&(r=0),!(o=e).collapsed||3!==o.startContainer.nodeType)return v.none();var o,i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return xp(t,e.startContainer,e.startOffset,(function(t,e,r){return function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(kp(o))return v.none();if(o===n)break}return v.some(r)}(r,e,n).getOr(e)}),i).bind((function(t){var o=e.cloneRange();if(o.setStart(t.container,t.offset),o.setEnd(e.endContainer,e.endOffset),o.collapsed)return v.none();var i=Sp(o);return 0!==i.lastIndexOf(n)||Op(i,n).length<r?v.none():v.some({text:Op(i,n),range:o,triggerChar:n})}))},Ep=function(t,e,n,r){return void 0===r&&(r=0),Cp(sn.fromDom(e.startContainer)).fold((function(){return _p(t,e,n,r)}),(function(e){var r=t.createRng();r.selectNode(e.dom);var o=Sp(r);return v.some({range:r,text:Op(o,n),triggerChar:n})}))},Tp=function(t,e){e.on("keypress compositionend",t.onKeypress.throttle),e.on("remove",t.onKeypress.cancel);var n=function(t,e){$r(t,dr(),{raw:e})};e.on("keydown",(function(e){var r=function(){return t.getView().bind(cd.getHighlighted)};8===e.which&&t.onKeypress.throttle(e),t.isActive()&&(27===e.which&&t.cancelIfNecessary(),t.isMenuOpen()?13===e.which?(r().each(Xr),e.preventDefault()):40===e.which?(r().fold((function(){t.getView().each(cd.highlightFirst)}),(function(t){n(t,e)})),e.preventDefault(),e.stopImmediatePropagation()):37!==e.which&&38!==e.which&&39!==e.which||r().each((function(t){n(t,e),e.preventDefault(),e.stopImmediatePropagation()})):13!==e.which&&38!==e.which&&40!==e.which||t.cancelIfNecessary())})),e.on("NodeChange",(function(e){t.isActive()&&!t.isProcessingAction()&&Cp(sn.fromDom(e.element)).isNone()&&t.cancelIfNecessary()}))},Ap=tinymce.util.Tools.resolve("tinymce.util.Promise"),Bp=function(t,e){return{container:t,offset:e}},Np=function(t){if(function(t){return 3===t.nodeType}(t))return Bp(t,t.data.length);var e=t.childNodes;return e.length>0?Np(e[e.length-1]):Bp(t,e.length)},Dp=function(t,e){var n=t.childNodes;return n.length>0&&e<n.length?Dp(n[e],0):n.length>0&&function(t){return 1===t.nodeType}(t)&&n.length===e?Np(n[n.length-1]):Bp(t,e)},Rp=function(t){return function(e){var n=Dp(e.startContainer,e.startOffset);return!function(t,e){return xp(t,e.container,e.offset,(function(t,e){return 0===e?-1:e}),t.getRoot()).filter((function(t){var e=t.container.data.charAt(t.offset-1);return!kp(e)})).isSome()}(t,n)}},Mp=function(t,e){var n=e(),r=t.selection.getRng();return function(t,e,n){return et(n.triggerChars,(function(n){return Ep(t,e,n)}))}(t.dom,r,n).bind((function(n){return Ip(t,e,n)}))},Ip=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng().startContainer.nodeValue,u=H(o.lookupByChar(n.triggerChar),(function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk((function(){return Rp(t.dom)}))(n.range,i,n.text)}));if(0===u.length)return v.none();var a=Ap.all(F(u,(function(t){return t.fetch(n.text,t.maxResults,r).then((function(e){return{matchText:n.text,items:e,columns:t.columns,onAction:t.onAction,highlightOn:t.highlightOn}}))})));return v.some({lookupData:a,context:n})},Pp=ie([Le("type"),$e("text")]),Fp=ie([Ke("type","autocompleteitem"),Ke("active",!1),Ke("disabled",!1),Ke("meta",{}),Le("value"),$e("text"),$e("icon")]),Lp=ie([Le("type"),Le("ch"),Qe("minChars",1),Ke("columns",1),Qe("maxResults",10),Xe("matches"),He("fetch"),He("onAction"),rn("highlightOn",[],Ae)]),Vp=[en("disabled",!1),$e("tooltip"),$e("icon"),$e("text"),nn("onSetup",(function(){return t}))],Hp=ie([Le("type"),He("onAction")].concat(Vp)),zp=function(t){return xe("toolbarbutton",Hp,t)},jp=[en("active",!1)].concat(Vp),Up=ie(jp.concat([Le("type"),He("onAction")])),Wp=function(t){return xe("ToggleButton",Up,t)},qp=[nn("predicate",(function(){return!1})),tn("scope","node",["node","editor"]),tn("position","selection",["node","selection","line"])],Gp=Vp.concat([Ke("type","contextformbutton"),Ke("primary",!1),He("onAction"),un("original",r)]),$p=jp.concat([Ke("type","contextformbutton"),Ke("primary",!1),He("onAction"),un("original",r)]),Xp=Vp.concat([Ke("type","contextformbutton")]),Yp=jp.concat([Ke("type","contextformtogglebutton")]),Kp=Oe("type",{contextformbutton:Gp,contextformtogglebutton:$p}),Jp=ie([Ke("type","contextform"),nn("initValue",(function(){return""})),$e("label"),Ue("commands",Kp),qe("launch",Oe("type",{contextformbutton:Xp,contextformtogglebutton:Yp}))].concat(qp)),Qp=ie([Ke("type","contexttoolbar"),Le("items")].concat(qp)),Zp=function(t){var e=t.ui.registry.getAll().popups,n=xt(e,(function(t){return(e=t,xe("Autocompleter",Lp,e)).fold((function(t){throw new Error(Se(t))}),(function(t){return t}));var e})),r=function(t){var e={};return L(t,(function(t){e[t]={}})),vt(e)}(St(n,(function(t){return t.ch}))),o=Ot(n);return{dataset:n,triggerChars:r,lookupByChar:function(t){return H(o,(function(e){return e.ch===t}))}}};!function(t){t[t.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",t[t.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(vp||(vp={}));var th,eh=vp,nh="tox-menu-nav__js",rh="tox-collection__item",oh="tox-swatch",ih={normal:nh,color:oh},uh="tox-collection__item--enabled",ah="tox-collection__item-label",ch="tox-collection__item-caret",sh="tox-collection__item--active",fh="tox-collection__item-container",lh="tox-collection__item-container--row",dh=function(t){return _t(ih,t).getOr(nh)},mh=function(t){return"color"===t?"tox-swatches":"tox-menu"},gh=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:mh(t),tieredMenu:"tox-tiered-menu"}},ph=function(t){var e=gh(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:dh(t)}},hh=function(t,e,n){var r=gh(n);return{tag:"div",classes:q([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},vh=[Ug.parts.items({})],bh=function(t,e,n){var r=gh(n);return{dom:{tag:"div",classes:q([[r.tieredMenu]])},markers:ph(n)}},yh=function(t,e){return function(n){var r=P(n,e);return F(r,(function(e){return{dom:t,components:e}}))}},xh=function(t,e){var n=[],r=[];return L(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],Et(t.dom,"innerHtml")&&r.push(t)):r.push(t)})),r.length>0&&n.push(r),F(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},wh=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[Ug.parts.items({preprocess:function(n){return"auto"!==t&&t>1?yh({tag:"div",classes:["tox-collection__group"]},t)(n):xh(n,(function(t,n){return"separator"===e[n].type}))}})]}},Ch=function(t){return M(t,(function(t){return"icon"in t&&void 0!==t.icon}))},Sh=function(t){return console.error(Se(t)),console.log(t),v.none()},kh=function(t,e,n,r,o){var i,u=(i=n,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Ug.parts.items({preprocess:function(t){return xh(t,(function(t,e){return"separator"===i[e].type}))}})]});return{value:t,dom:u.dom,components:u.components,items:n}},Oh=function(t,e,n,o,i){var u;return"color"===i?{value:t,dom:(u=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Ug.parts.items({preprocess:"auto"!==t?yh({tag:"div",classes:["tox-swatches__row"]},t):r})]}]}}(o)).dom,components:u.components,items:n}:"normal"===i&&"auto"===o?{value:t,dom:(u=wh(o,n)).dom,components:u.components,items:n}:"normal"===i&&1===o?{value:t,dom:(u=wh(1,n)).dom,components:u.components,items:n}:"normal"===i?{value:t,dom:(u=wh(o,n)).dom,components:u.components,items:n}:"listpreview"===i&&"auto"!==o?{value:t,dom:(u=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Ug.parts.items({preprocess:yh({tag:"div",classes:["tox-collection__group"]},t)})]}}(o)).dom,components:u.components,items:n}:{value:t,dom:hh(e,o,i),components:vh,items:n}},_h=[Le("type"),Le("src"),$e("alt"),rn("classes",[],Ae)],Eh=ie(_h),Th=[Le("type"),Le("text"),$e("name"),rn("classes",["tox-collection__item-label"],Ae)],Ah=ie(Th),Bh=ve((function(){return ke("type",{cardimage:Eh,cardtext:Ah,cardcontainer:Nh})})),Nh=ie([Le("type"),Ze("direction","horizontal"),Ze("align","left"),Ze("valign","middle"),Ue("items",Bh)]),Dh=[en("disabled",!1),$e("text"),$e("shortcut"),de("value","value",Ht((function(){return Ko("menuitem-value")})),_e()),Ke("meta",{})],Rh=ie([Le("type"),$e("label"),Ue("items",Bh),nn("onSetup",(function(){return t})),nn("onAction",t)].concat(Dh)),Mh=ie([Le("type"),en("active",!1),$e("icon")].concat(Dh)),Ih=ie([Le("type"),Ve("fancytype",["inserttable","colorswatch"]),nn("onAction",t)]),Ph=ie([Le("type"),nn("onSetup",(function(){return t})),nn("onAction",t),$e("icon")].concat(Dh)),Fh=ie([Le("type"),He("getSubmenuItems"),nn("onSetup",(function(){return t})),$e("icon")].concat(Dh)),Lh=ie([Le("type"),$e("icon"),en("active",!1),nn("onSetup",(function(){return t})),He("onAction")].concat(Dh)),Vh=function(t,e,n){var r=ls(t.element,"."+n);if(r.length>0){var o=W(r,(function(t){var n=t.dom.getBoundingClientRect().top,o=r[0].dom.getBoundingClientRect().top;return Math.abs(n-o)>e})).getOr(r.length);return v.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return v.none()},Hh=function(t,e){return ic([sg(t,e)])},zh=function(t){return Hh(Ko("unnamed-events"),t)},jh=[Ie("lazySink"),Ie("tooltipDom"),Ke("exclusive",!0),Ke("tooltipComponents",[]),Ke("delay",300),tn("mode","normal",["normal","follow-highlight"]),Ke("anchor",(function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:n([Wa,Ua,Va,za,Ha,ja]),onRtl:n([Wa,Ua,Va,za,Ha,ja])}}})),pa("onHide"),pa("onShow")],Uh=Object.freeze({__proto__:null,init:function(){var t=an(v.none()),e=an(v.none()),r=function(){t.get().each((function(t){clearTimeout(t)}))},o=n("not-implemented");return mi({getTooltip:function(){return e.get()},isShowing:function(){return e.get().isSome()},setTooltip:function(t){e.set(v.some(t))},clearTooltip:function(){e.set(v.none())},clearTimer:r,resetTimer:function(e,n){r(),t.set(v.some(setTimeout((function(){e()}),n)))},readState:o})}}),Wh=Ko("tooltip.exclusive"),qh=Ko("tooltip.show"),Gh=Ko("tooltip.hide"),$h=function(t,e,n){t.getSystem().broadcastOn([Wh],{})},Xh=Object.freeze({__proto__:null,hideAllExclusive:$h,setComponents:function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&cg.set(t,r)}))}}),Yh=ac({fields:jh,name:"tooltipping",active:Object.freeze({__proto__:null,events:function(t,e){var n=function(n){e.getTooltip().each((function(r){of(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()};return Qr(q([[eo(qh,(function(n){e.resetTimer((function(){!function(n){if(!e.isShowing()){$h(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:Qr("normal"===t.mode?[eo(sr(),(function(t){Gr(n,qh)})),eo(ar(),(function(t){Gr(n,Gh)}))]:[]),behaviours:ic([cg.config({})])});e.setTooltip(o),ef(r,o),t.onShow(n,o),Ks.position(r,t.anchor(n),o)}}(n)}),t.delay)})),eo(Gh,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),eo(kr(),(function(t,e){var r=e;r.universal||R(r.channels,Wh)&&n(t)})),fo((function(t){n(t)}))],"normal"===t.mode?[eo(fr(),(function(t){Gr(t,qh)})),eo(Cr(),(function(t){Gr(t,Gh)})),eo(sr(),(function(t){Gr(t,qh)})),eo(ar(),(function(t){Gr(t,Gh)}))]:[eo(Wr(),(function(t,e){Gr(t,qh)})),eo(qr(),(function(t){Gr(t,Gh)}))]]))}}),state:Uh,apis:Xh}),Kh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Jh=tinymce.util.Tools.resolve("tinymce.util.I18n"),Qh=["input","button","textarea","select"],Zh=function(t,e,n){(e.disabled()?iv:uv)(t,e)},tv=function(t,e){return!0===e.useNative&&R(Qh,go(t.element))},ev=function(t){Vo(t.element,"disabled","disabled")},nv=function(t){Uo(t.element,"disabled")},rv=function(t){Vo(t.element,"aria-disabled","true")},ov=function(t){Vo(t.element,"aria-disabled","false")},iv=function(t,e,n){e.disableClass.each((function(e){Ti(t.element,e)})),(tv(t,e)?ev:rv)(t),e.onDisabled(t)},uv=function(t,e,n){e.disableClass.each((function(e){Bi(t.element,e)})),(tv(t,e)?nv:ov)(t),e.onEnabled(t)},av=function(t,e){return tv(t,e)?function(t){return jo(t.element,"disabled")}(t):function(t){return"true"===Ho(t.element,"aria-disabled")}(t)},cv=Object.freeze({__proto__:null,enable:uv,disable:iv,isDisabled:av,onLoad:Zh,set:function(t,e,n,r){(r?iv:uv)(t,e)}}),sv=Object.freeze({__proto__:null,exhibit:function(t,e){return pi({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,e){return Qr([Zr(Or(),(function(e,n){return av(e,t)})),ec(t,e,Zh)])}}),fv=[nn("disabled",a),Ke("useNative",!0),We("disableClass"),pa("onDisabled"),pa("onEnabled")],lv=ac({fields:fv,name:"disabling",active:sv,apis:cv}),dv=tinymce.util.Tools.resolve("tinymce.EditorManager"),mv=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},gv=function(t){return t.getParam("width",Kh.DOM.getStyle(t.getElement(),"width"))},pv=function(t){return v.from(t.getParam("min_width")).filter(E)},hv=function(t){return v.from(t.getParam("min_height")).filter(E)},vv=function(t){return v.from(t.getParam("max_width")).filter(E)},bv=function(t){return v.from(t.getParam("max_height")).filter(E)},yv=function(t){return!1!==t.getParam("menubar",!0,"boolean")},xv=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=x(e),o=C(e)&&e.length>0;return!Cv(t)&&(o||r||n)},wv=function(t){var e=I(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=H(e,(function(t){return"string"==typeof t}));return n.length>0?v.some(n):v.none()},Cv=function(t){return wv(t).fold((function(){return t.getParam("toolbar",[],"string[]").length>0}),(function(){return!0}))};!function(t){t.default="wrap",t.floating="floating",t.sliding="sliding",t.scrolling="scrolling"}(th||(th={}));var Sv,kv=function(t){return t.getParam("toolbar_mode","","string")};!function(t){t.auto="auto",t.top="top",t.bottom="bottom"}(Sv||(Sv={}));var Ov,_v,Ev=function(t){return t.getParam("toolbar_location",Sv.auto,"string")},Tv=function(t){return Ev(t)===Sv.bottom},Av=function(t){var e=function(t){return t.getParam("fixed_toolbar_container","","string")}(t);return e.length>0&&t.inline?Ku(Wi(),e):v.none()},Bv=function(t){return t.inline&&Av(t).isSome()},Nv=function(t){return Av(t).getOrThunk((function(){return Vi(Li(sn.fromDom(t.getElement())))}))},Dv=function(t){return t.inline&&!yv(t)&&!xv(t)&&!Cv(t)},Rv=function(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!Bv(t)&&!Dv(t)},Mv=function(t){var e=t.getParam("menu");return e?xt(e,(function(t){return f(f({},t),{items:t.items})})):{}},Iv=function(t){return t.getParam("menubar")},Pv=function(t){return t.getParam("anchor_top","#top")},Fv=function(t){return t.getParam("anchor_bottom","#bottom")},Lv="silver.readonly",Vv=ie([(Ov="readonly",Pe(Ov,Be))]),Hv=function(t,e){var n=t.outerContainer.element;e&&(t.mothership.broadcastOn([xf()],{target:n}),t.uiMothership.broadcastOn([xf()],{target:n})),t.mothership.broadcastOn([Lv],{readonly:e}),t.uiMothership.broadcastOn([Lv],{readonly:e})},zv=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&Hv(e,!0)})),t.on("SwitchMode",(function(){return Hv(e,t.mode.isReadOnly())})),function(t){return t.getParam("readonly",!1,"boolean")}(t)&&t.setMode("readonly")},jv=function(){var t;return lc.config({channels:(t={},t[Lv]={schema:Vv,onReceive:function(t,e){lv.set(t,e.readonly)}},t)})},Uv=function(t){return lv.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},Wv=function(t){return lv.config({disabled:t})},qv=function(t){return lv.config({disabled:t,disableClass:"tox-tbtn--disabled"})},Gv=function(t){return lv.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},$v=function(t,e){var n=t.getApi(e);return function(t){t(n)}},Xv=function(t,e){return so((function(n){$v(t,n)((function(n){var r=t.onSetup(n);null!=r&&e.set(r)}))}))},Yv=function(t,e){return fo((function(n){return $v(t,n)(e.get())}))},Kv=function(t,e){return mo((function(n,r){$v(t,n)(t.onAction),t.triggersSubmenu||e!==eh.CLOSE_ON_EXECUTE||(Gr(n,Ar()),r.stop())}))},Jv=((_v={})[Or()]=["disabling","alloy.base.behaviour","toggling","item-events"],_v),Qv=function(t){return G(t,(function(t){return t.toArray()}))},Zv=function(e,n,r,o){var i=an(t);return{type:"item",dom:n.dom,components:Qv(n.optComponents),data:e.data,eventOrder:Jv,hasSubmenu:e.triggersSubmenu,itemBehaviours:ic([sg("item-events",[Kv(e,r),Xv(e,i),Yv(e,i)]),Uv((function(){return e.disabled||o.isDisabled()})),jv(),cg.config({})].concat(e.itemBehaviours))}},tb=function(t){return{value:t.value,meta:f({text:t.text.getOr("")},t.meta)}},eb=tinymce.util.Tools.resolve("tinymce.Env"),nb=function(t){var e=eb.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),r=F(n,(function(t){var n=t.toLowerCase().trim();return Et(e,n)?e[n]:t}));return eb.mac?r.join(""):r.join("+")},rb=function(t){return{dom:{tag:"div",classes:["tox-collection__item-icon"],innerHtml:t}}},ob=function(t){return{dom:{tag:"div",classes:[ah]},components:[mu(Jh.translate(t))]}},ib=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},ub=function(t,e){return{dom:{tag:"div",classes:[ah]},components:[{dom:{tag:t.tag,styles:t.styles},components:[mu(Jh.translate(e))]}]}},ab=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:nb(t)}}},cb=function(t){return{dom:{tag:"div",classes:["tox-collection__item-checkmark"],innerHtml:dp("checkmark",t)}}},sb=function(t,e){var n=e.map((function(t){return{attributes:{title:Jh.translate(t)}}})).getOr({});return f({tag:"div",classes:[nh,rh].concat(t?["tox-collection__item-icon-rtl"]:[])},n)},fb=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],lb=["list-bull-circle","list-bull-default","list-bull-square"],db=function(t,e,n,r){void 0===r&&(r=v.none());var i,u=Jh.isRtl()&&t.iconContent.exists((function(t){return R(lb,t)})),a=(i=t.iconContent,i.map((function(t){return Jh.isRtl()&&R(fb,t)?t+"-rtl":t}))).map((function(t){return function(t,e,n){return v.from(e()[t.toLowerCase()]).or(n).getOrThunk((function(){return lp(e)}))}(t,e.icons,r)})),c=v.from(t.meta).fold((function(){return ob}),(function(t){return Et(t,"style")?o(ub,t.style):ob}));return"color"===t.presets?function(t,e,n,r){var o,i;return{dom:(o=n.getOr(""),i={tag:"div",attributes:t.map((function(t){return{title:r.translate(t)}})).getOr({}),classes:["tox-swatch"]},f(f({},i),"custom"===e?{tag:"button",classes:d(i.classes,["tox-swatches__picker-btn"]),innerHtml:o}:"remove"===e?{classes:d(i.classes,["tox-swatch--remove"]),innerHtml:o}:{attributes:f(f({},i.attributes),{"data-mce-color":e}),styles:{"background-color":e}})),optComponents:[]}}(t.ariaLabel,t.value,a,e):function(t,e,n,r,o){var i=n?e.or(v.some("")).map(rb):v.none(),u=t.checkMark,a=t.htmlContent.fold((function(){return t.textContent.map(r)}),(function(t){return v.some(ib(t,[ah]))}));return{dom:sb(o,t.ariaLabel),optComponents:[i,a,t.shortcutContent.map(ab),u,t.caret]}}(t,a,n,c,u)},mb=function(t,e){return _t(t,"tooltipWorker").map((function(t){return[Yh.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{anchor:"submenu",item:t,overrides:{maxHeightFunction:Ic}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){Yh.setComponents(e,[gu({element:sn.fromDom(t)})])}))}})]})).getOr([])},gb=function(t,e){var n=function(t){return Kh.DOM.encode(t)}(Jh.translate(t));if(e.length>0){var r=new RegExp(function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(e),"gi");return n.replace(r,(function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"}))}return n},pb=Cl("item-widget",Fg()),hb=function(t){return{value:t}},vb=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,bb=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,yb=function(t){return vb.test(t)||bb.test(t)},xb=function(t){var e=function(t){return{value:t.value.replace(vb,(function(t,e,n,r){return e+e+n+n+r+r}))}}(t),n=bb.exec(e.value);return null===n?["FFFFFF","FF","FF","FF"]:n},wb=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e},Cb=function(t){var e=wb(t.red)+wb(t.green)+wb(t.blue);return hb(e)},Sb=Math.min,kb=Math.max,Ob=Math.round,_b=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Eb=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Tb=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},Ab=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},Bb=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=kb(0,Sb(i,1)),u=kb(0,Sb(u,1)),0===i)return e=n=r=Ob(255*u),Tb(e,n,r,1);var a=o/60,c=u*i,s=c*(1-Math.abs(a%2-1)),f=u-c;switch(Math.floor(a)){case 0:e=c,n=s,r=0;break;case 1:e=s,n=c,r=0;break;case 2:e=0,n=c,r=s;break;case 3:e=0,n=s,r=c;break;case 4:e=s,n=0,r=c;break;case 5:e=c,n=0,r=s;break;default:e=n=r=0}return e=Ob(255*(e+f)),n=Ob(255*(n+f)),r=Ob(255*(r+f)),Tb(e,n,r,1)},Nb=function(t){var e=xb(t),n=parseInt(e[1],16),r=parseInt(e[2],16),o=parseInt(e[3],16);return Tb(n,r,o,1)},Db=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return Tb(o,i,u,a)},Rb=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},Mb=Tb(255,0,0,1),Ib=function(t,e){return t.fire("ResizeContent",e)},Pb=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Fb="tinymce-custom-colors";var Lb="choiceitem",Vb=[{type:Lb,text:"Light Green",value:"#BFEDD2"},{type:Lb,text:"Light Yellow",value:"#FBEEB8"},{type:Lb,text:"Light Red",value:"#F8CAC6"},{type:Lb,text:"Light Purple",value:"#ECCAFA"},{type:Lb,text:"Light Blue",value:"#C2E0F4"},{type:Lb,text:"Green",value:"#2DC26B"},{type:Lb,text:"Yellow",value:"#F1C40F"},{type:Lb,text:"Red",value:"#E03E2D"},{type:Lb,text:"Purple",value:"#B96AD9"},{type:Lb,text:"Blue",value:"#3598DB"},{type:Lb,text:"Dark Turquoise",value:"#169179"},{type:Lb,text:"Orange",value:"#E67E23"},{type:Lb,text:"Dark Red",value:"#BA372A"},{type:Lb,text:"Dark Purple",value:"#843FA1"},{type:Lb,text:"Dark Blue",value:"#236FA1"},{type:Lb,text:"Light Gray",value:"#ECF0F1"},{type:Lb,text:"Medium Gray",value:"#CED4D9"},{type:Lb,text:"Gray",value:"#95A5A6"},{type:Lb,text:"Dark Gray",value:"#7E8C8D"},{type:Lb,text:"Navy Blue",value:"#34495E"},{type:Lb,text:"Black",value:"#000000"},{type:Lb,text:"White",value:"#ffffff"}],Hb=function(t){void 0===t&&(t=10);var e,n=Pb.getItem(Fb),r=x(n)?JSON.parse(n):[],o=t-(e=r).length<0?e.slice(0,t):e,i=function(t){o.splice(t,1)};return{add:function(e){(function(t,e){var n=D(t,e);return-1===n?v.none():v.some(n)})(o,e).each(i),o.unshift(e),o.length>t&&o.pop(),Pb.setItem(Fb,JSON.stringify(o))},state:function(){return o.slice(0)}}}(10),zb=function(t){return!1!==t.getParam("custom_colors")},jb=function(t){var e=function(t){return t.getParam("color_map")}(t);return void 0!==e?function(t){var e=[],n=document.createElement("canvas");n.height=1,n.width=1;for(var r=n.getContext("2d"),o=function(t,e){var n=e/255;return("0"+Math.round(t*n+255*(1-n)).toString(16)).slice(-2).toUpperCase()},i=function(t){if(/^[0-9A-Fa-f]{6}$/.test(t))return"#"+t.toUpperCase();r.clearRect(0,0,n.width,n.height),r.fillStyle="#FFFFFF",r.fillStyle=t,r.fillRect(0,0,1,1);var e=r.getImageData(0,0,1,1).data,i=e[0],u=e[1],a=e[2],c=e[3];return"#"+o(i,c)+o(u,c)+o(a,c)},u=0;u<t.length;u+=2)e.push({text:t[u+1],value:i(t[u]),type:"choiceitem"});return e}(e):Vb},Ub=function(t){Hb.add(t)},Wb=function(t){return function(t,e){return t.getParam("color_cols",e,"number")}(t,function(t){return Math.max(5,Math.ceil(Math.sqrt(t)))}(jb(t).length))},qb=function(t,e,n,r){"custom"===n?Jb(t)((function(n){n.each((function(n){Ub(n),t.execCommand("mceApplyTextcolor",e,n),r(n)}))}),"#000000"):"remove"===n?(r(""),t.execCommand("mceRemoveTextcolor",e)):(r(n),t.execCommand("mceApplyTextcolor",e,n))},Gb=function(t,e){return t.concat(F(Hb.state(),(function(t){return{type:Lb,text:t,value:t}})).concat(function(t){var e="choiceitem",n={type:e,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return t?[n,{type:e,text:"Custom color",icon:"color-picker",value:"custom"}]:[n]}(e)))},$b=function(t,e){return function(n){n(Gb(t,e))}},Xb=function(t,e,n){var r,o;r="forecolor"===e?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",o=n,t.setIconFill(r,o),t.setIconStroke(r,o)},Yb=function(t,e,n,r,o){t.ui.registry.addSplitButton(e,{tooltip:r,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){return v.from(function(t,e){var n;return t.dom.getParents(t.selection.getStart(),(function(t){var r;(r=t.style["forecolor"===e?"color":"background-color"])&&(n=n||r)})),n}(t,n)).bind((function(t){return function(t){if("transparent"===t)return v.some(Tb(0,0,0,0));var e=_b.exec(t);if(null!==e)return v.some(Db(e[1],e[2],e[3],"1"));var n=Eb.exec(t);return null!==n?v.some(Db(n[1],n[2],n[3],n[4])):v.none()}(t).map((function(t){var n=Cb(t).value;return hn(e.toLowerCase(),n)}))})).getOr(!1)},columns:Wb(t),fetch:$b(jb(t),zb(t)),onAction:function(e){null!==o.get()&&qb(t,n,o.get(),(function(){}))},onItemAction:function(r,i){qb(t,n,i,(function(n){o.set(n),function(t,e){t.fire("TextColorChange",e)}(t,{name:e,color:n})}))},onSetup:function(n){null!==o.get()&&Xb(n,e,o.get());var r=function(t){t.name===e&&Xb(n,t.name,t.color)};return t.on("TextColorChange",r),function(){t.off("TextColorChange",r)}}})},Kb=function(e,n,r,o){e.ui.registry.addNestedMenuItem(n,{text:o,icon:"forecolor"===n?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(n){qb(e,r,n.value,t)}}]}})},Jb=function(t){return function(e,n){var r={colorpicker:n},o=function(t){return function(e){var n=e.getData();t(v.from(n.colorpicker)),e.close()}}(e);t.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:function(t,e){"hex-valid"===e.name&&(e.value?t.enable("ok"):t.disable("ok"))},onSubmit:o,onClose:function(){},onCancel:function(){e(v.none())}})}},Qb=function(t,e,n,r,o,i,u,a){var c=Ch(e),s=Zb(e,n,r,"color"!==o?"normal":"color",i,u,a);return Oh(t,c,s,r,o)},Zb=function(t,e,n,r,o,i,u){return Gl(F(t,(function(a){return"choiceitem"===a.type?(c=a,xe("choicemenuitem",Mh,c)).fold(Sh,(function(c){return v.some(function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=db({presets:n,textContent:e?t.text:v.none(),htmlContent:v.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:v.none(),checkMark:e?v.some(cb(u.icons)):v.none(),caret:v.none(),value:t.value},u,a);return Dt(Zv({data:tb(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){_g.set(t,e)},isActive:function(){return _g.isOn(t)},isDisabled:function(){return lv.isDisabled(t)},setDisabled:function(e){return lv.set(t,e)}}},onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),function(){}},triggersSubmenu:!1,itemBehaviours:[]},c,i,u),{toggling:{toggleClass:uh,toggleOnExecute:!1,selected:t.active}})}(c,1===n,r,e,i(a.value),o,u,Ch(t)))})):v.none();var c})))},ty=function(t,e){var n=ph(e);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===e?"tox-swatches__row":"tox-collection__group")}};var ey,ny=Ko("cell-over"),ry=Ko("cell-execute"),oy=function(t,e,n){var r,o=function(n){return $r(n,ry,{row:t,col:e})},i=function(t,e){e.stop(),o(t)};return hu({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:ic([sg("insert-table-picker-cell",[eo(sr(),gg.focus),eo(Or(),o),eo(hr(),i),eo(Er(),i)]),_g.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),gg.config({onFocus:function(n){return $r(n,ny,{row:t,col:e})}})])})},iy=function(t){return G(t,(function(t){return F(t,vu)}))},uy=function(t,e){return mu(e+1+"x"+(t+1))},ay={inserttable:function(t){var e=Ko("size-label"),n=function(t,e,n){for(var r=[],o=0;o<e;o++){for(var i=[],u=0;u<n;u++)i.push(oy(o,u,t));r.push(i)}return r}(e,10,10),r=fp({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:e}},components:[mu("0x0")],behaviours:ic([cg.config({})])});return{type:"widget",data:{value:Ko("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[pb.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:iy(n).concat(r.asSpec()),behaviours:ic([sg("insert-table-picker",[io(ny,(function(t,e,o){var i=o.event.row,u=o.event.col;!function(t,e,n,r,o){for(var i=0;i<r;i++)for(var u=0;u<o;u++)_g.set(t[i][u],i<=e&&u<=n)}(n,i,u,10,10),cg.set(r.get(t),[uy(i,u)])})),io(ry,(function(e,n,r){t.onAction({numRows:r.event.row+1,numColumns:r.event.col+1}),Gr(e,Ar())}))]),rg.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(t,e){var n=Gb(e.colorinput.getColors(),e.colorinput.hasCustomColors()),r=e.colorinput.getColorCols(),o="color",i=Qb(Ko("menu-value"),n,(function(e){t.onAction({value:e})}),r,o,eh.CLOSE_ON_EXECUTE,(function(){return!1}),e.shared.providers),u=f(f({},i),{markers:ph(o),movement:ty(r,o)});return{type:"widget",data:{value:Ko("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[pb.widget(Ug.sketch(u))]}}},cy=function(t,e){return F(t,(function(t){switch(t.type){case"cardcontainer":return function(t,e){var n="vertical"===t.direction?"tox-collection__item-container--column":lh,r="left"===t.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right";return{dom:{tag:"div",classes:[fh,n,r,function(){switch(t.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:e}}(t,cy(t.items,e));case"cardimage":return function(t,e,n){return{dom:{tag:"img",classes:e,attributes:{src:t,alt:n.getOr("")}}}}(t.src,t.classes,t.alt);case"cardtext":var n=t.name.exists((function(t){return R(e.cardText.highlightOn,t)}))?v.from(e.cardText.matchText).getOr(""):"";return ib(gb(t.text,n),t.classes)}}))},sy=function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=db({presets:r,textContent:v.none(),htmlContent:n?t.text.map((function(t){return gb(t,e)})):v.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:v.none(),checkMark:v.none(),caret:v.none(),value:t.value},u.providers,a,t.icon);return Zv({data:tb(t),disabled:t.disabled,getApi:function(){return{}},onAction:function(e){return o(t.value,t.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:mb(t.meta,u)},c,i,u.providers)},fy=function(t){var e=t.text.fold((function(){return{}}),(function(t){return{innerHtml:t}}));return{type:"separator",dom:f({tag:"div",classes:[rh,"tox-collection__group-heading"]},e),components:[]}},ly=function(t,e,n,r){void 0===r&&(r=!0);var o=db({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:v.none(),ariaLabel:t.text,caret:v.none(),checkMark:v.none(),shortcutContent:t.shortcut},n,r);return Zv({data:tb(t),getApi:function(t){return{isDisabled:function(){return lv.isDisabled(t)},setDisabled:function(e){return lv.set(t,e)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n)},dy=function(e,n,r,o,i){void 0===o&&(o=!0),void 0===i&&(i=!1);var u,a=i?(u=r.icons,{dom:{tag:"div",classes:[ch],innerHtml:dp("chevron-down",u)}}):function(t){return{dom:{tag:"div",classes:[ch],innerHtml:dp("chevron-right",t)}}}(r.icons),c=db({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:v.none(),ariaLabel:e.text,caret:v.some(a),checkMark:v.none(),shortcutContent:e.shortcut},r,o);return Zv({data:tb(e),getApi:function(t){return{isDisabled:function(){return lv.isDisabled(t)},setDisabled:function(e){return lv.set(t,e)}}},disabled:e.disabled,onAction:t,onSetup:e.onSetup,triggersSubmenu:!0,itemBehaviours:[]},c,n,r)},my=function(t,e,n,r){void 0===r&&(r=!0);var o=db({iconContent:t.icon,textContent:t.text,htmlContent:v.none(),ariaLabel:t.text,checkMark:v.some(cb(n.icons)),caret:v.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},n,r);return Dt(Zv({data:tb(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){_g.set(t,e)},isActive:function(){return _g.isOn(t)},isDisabled:function(){return lv.isDisabled(t)},setDisabled:function(e){return lv.set(t,e)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n),{toggling:{toggleClass:uh,toggleOnExecute:!1,selected:t.active}})},gy=function(t,e){return function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?v.some(t[e]):v.none()}(ay,t.fancytype).map((function(n){return n(t,e)}))},py=function(t,e,n,r){var o={dom:sb(!1,t.label),optComponents:[v.some({dom:{tag:"div",classes:[fh,lh]},components:cy(t.items,r)})]};return Zv({data:tb(f({text:v.none()},t)),disabled:t.disabled,getApi:function(t){return{isDisabled:function(){return lv.isDisabled(t)},setDisabled:function(e){lv.set(t,e),L(ls(t.element,"*"),(function(n){t.getSystem().getByDom(n).each((function(t){t.hasConfigured(lv)&&lv.set(t,e)}))}))}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:v.from(r.itemBehaviours).getOr([])},o,e,n.providers)};!function(t){t[t.ContentFocus=0]="ContentFocus",t[t.UiFocus=1]="UiFocus"}(ey||(ey={}));var hy=function(t,e,n,r,o){var i,u=n.shared.providers,a=function(t){return o?f(f({},t),{shortcut:v.none(),icon:t.text.isSome()?v.none():t.icon}):t};switch(t.type){case"menuitem":return(i=t,xe("menuitem",Ph,i)).fold(Sh,(function(t){return v.some(ly(a(t),e,u,r))}));case"nestedmenuitem":return function(t){return xe("nestedmenuitem",Fh,t)}(t).fold(Sh,(function(t){return v.some(dy(a(t),e,u,r,o))}));case"togglemenuitem":return function(t){return xe("togglemenuitem",Lh,t)}(t).fold(Sh,(function(t){return v.some(my(a(t),e,u,r))}));case"separator":return function(t){return xe("separatormenuitem",Pp,t)}(t).fold(Sh,(function(t){return v.some(fy(t))}));case"fancymenuitem":return function(t){return xe("fancymenuitem",Ih,t)}(t).fold(Sh,(function(t){return gy(a(t),n)}));default:return console.error("Unknown item in general menu",t),v.none()}},vy=function(t,e,n,r,o,i,u){var a=1===r,c=!a||Ch(t);return Gl(F(t,(function(t){switch(t.type){case"separator":return(r=t,xe("Autocompleter.Separator",Pp,r)).fold(Sh,(function(t){return v.some(fy(t))}));case"cardmenuitem":return function(t){return xe("cardmenuitem",Rh,t)}(t).fold(Sh,(function(t){return v.some(py(f(f({},t),{onAction:function(e){t.onAction(e),n(t.value,t.meta)}}),o,i,{itemBehaviours:mb(t.meta,i),cardText:{matchText:e,highlightOn:u}}))}));case"autocompleteitem":default:return function(t){return xe("Autocompleter.Item",Fp,t)}(t).fold(Sh,(function(t){return v.some(sy(t,e,a,"normal",n,o,i,c))}))}var r})))},by=function(t,e,n,r,o){var i=Ch(e),u=Gl(F(e,(function(t){var e=function(t){return hy(t,n,r,function(t){return o?!t.hasOwnProperty("text"):i}(t),o)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?e(f(f({},t),{disabled:!0})):e(t)})));return(o?kh:Oh)(t,i,u,1,"normal")},yy=function(t){return Yg.singleData(t.value,t)},xy=function(t,e){var n=an(v.none()),r=an(!1),o=hu(Kg.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:ic([sg("dismissAutocompleter",[eo(Lr(),(function(){return a()}))])]),lazySink:e.getSink})),i=function(){return n.get().isSome()},u=function(){i()&&Kg.hide(o)},a=function(){if(i()){var e=n.get().map((function(t){return t.element}));Cp(e.getOr(sn.fromDom(t.selection.getNode()))).each(Io),u(),n.set(v.none()),r.set(!1)}},c=Mt((function(){return Zp(t)})),s=function(e,n,r,i){e.matchLength=n.text.length;var u=et(r,(function(t){return v.from(t.columns)})).getOr(1);Kg.showAt(o,{anchor:"node",root:sn.fromDom(t.getBody()),node:v.from(e.element)},Ug.sketch(function(t,e,n,r){var o=n===ey.ContentFocus?Bd():Ad(),i=ty(e,r),u=ph(r);return{dom:t.dom,components:t.components,items:t.items,value:t.value,markers:{selectedItem:u.selectedItem,item:u.item},movement:i,fakeFocus:n===ey.ContentFocus,focusManager:o,menuBehaviours:zh("auto"!==e?[]:[so((function(t,e){Vh(t,4,u.item).each((function(e){var n=e.numColumns,r=e.numRows;rg.setGridSize(t,r,n)}))}))])}}(Oh("autocompleter-value",!0,i,u,"normal"),u,ey.ContentFocus,"normal"))),Kg.getContent(o).each(cd.highlightFirst)},f=function(o){(function(e){return n.get().map((function(n){return Ep(t.dom,t.selection.getRng(),n.triggerChar).bind((function(n){return Ip(t,c,n,e)}))})).getOrThunk((function(){return Mp(t,c)}))})(o).fold(a,(function(o){!function(e){if(!i()){var o=wp(t,e.range);n.set(v.some({triggerChar:e.triggerChar,element:o,matchLength:e.text.length})),r.set(!1)}}(o.context),o.lookupData.then((function(i){n.get().map((function(n){var c,l,d,m=o.context;if(n.triggerChar===m.triggerChar){var g=(c=m.triggerChar,d=et(l=i,(function(t){return v.from(t.columns)})).getOr(1),G(l,(function(n){var o=n.items;return vy(o,n.matchText,(function(e,o){var i=t.selection.getRng();Ep(t.dom,i,c).fold((function(){return console.error("Lost context. Cursor probably moved")}),(function(t){var i=t.range,c={hide:function(){a()},reload:function(t){u(),f(t)}};r.set(!0),n.onAction(c,i,e,o),r.set(!1)}))}),d,eh.BUBBLE_TO_SANDBOX,e,n.highlightOn)})));g.length>0?s(n,m,i,g):m.text.length-n.matchLength>=10?a():u()}}))}))}))},l={onKeypress:bp((function(t){27!==t.which&&f()}),50),cancelIfNecessary:a,isMenuOpen:function(){return Kg.isOpen(o)},isActive:i,isProcessingAction:r.get,getView:function(){return Kg.getContent(o)}};!1===t.hasPlugin("rtc")&&Tp(l,t)},wy=c,Cy=function(t,e,n){return function(t,e,n,r){return Nu(t,e,n,r,!1)}(t,e,wy,n)},Sy=function(t,e,n){return function(t,e,n,r){return Nu(t,e,n,r,!0)}(t,e,wy,n)},ky=Bu,Oy=function(t,e,n){return Ju(t,e,n).isSome()};function _y(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},schedule:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n=setTimeout((function(){t.apply(null,r),n=null}),e)}}}var Ey=function(t){var e=t.raw;return void 0===e.touches||1!==e.touches.length?v.none():v.some(e.touches[0])},Ty=function(t){var e=an(v.none()),n=an(!1),r=_y((function(e){t.triggerEvent(Tr(),e),n.set(!0)}),400),o=qt([{key:er(),value:function(t){return Ey(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.schedule(t),n.set(!1),e.set(v.some(i))})),v.none()}},{key:nr(),value:function(t){return r.cancel(),Ey(t).each((function(t){e.get().each((function(n){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(t,n)&&e.set(v.none())}))})),v.none()}},{key:rr(),value:function(o){r.cancel();return e.get().filter((function(t){return qn(t.target,o.target)})).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(Er(),o)}))}}]);return{fireIfReady:function(t,e){return _t(o,e).bind((function(e){return e(t)}))}}},Ay=function(){return jn().browser.isFirefox()},By=oe([He("triggerEvent"),Ke("stopBackspace",!0)]),Ny=function(t,e){var n=Ce("Getting GUI events settings",By,e),r=Ty(n),o=F(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return Cy(t,e,(function(t){r.fireIfReady(t,e).each((function(e){e&&t.kill()})),n.triggerEvent(e,t)&&t.kill()}))})),i=an(v.none()),u=Cy(t,"paste",(function(t){r.fireIfReady(t,"paste").each((function(e){e&&t.kill()})),n.triggerEvent("paste",t)&&t.kill(),i.set(v.some(setTimeout((function(){n.triggerEvent(Sr(),t)}),0)))})),a=Cy(t,"keydown",(function(t){n.triggerEvent("keydown",t)?t.kill():!0===n.stopBackspace&&function(t){return t.raw.which===sd[0]&&!R(["input","textarea"],go(t.target))&&!Oy(t.target,'[contenteditable="true"]')}(t)&&t.prevent()})),c=function(t,e){return Ay()?Sy(t,"focus",e):Cy(t,"focusin",e)}(t,(function(t){n.triggerEvent("focusin",t)&&t.kill()})),s=an(v.none()),f=function(t,e){return Ay()?Sy(t,"blur",e):Cy(t,"focusout",e)}(t,(function(t){n.triggerEvent("focusout",t)&&t.kill(),s.set(v.some(setTimeout((function(){n.triggerEvent(Cr(),t)}),0)))}));return{unbind:function(){L(o,(function(t){t.unbind()})),a.unbind(),c.unbind(),f.unbind(),u.unbind(),i.get().each(clearTimeout),s.get().each(clearTimeout)}}},Dy=function(t,e){var n=_t(t,"target").getOr(e);return an(n)},Ry=At([{stopped:[]},{resume:["element"]},{complete:[]}]),My=function(t,e,n,r,o,i){var u=t(e,r),a=function(t,e){var n=an(!1),r=an(!1);return{stop:function(){n.set(!0)},cut:function(){r.set(!0)},isStopped:n.get,isCut:r.get,event:t,setSource:e.set,getSource:e.get}}(n,o);return u.fold((function(){return i.logEventNoHandlers(e,r),Ry.complete()}),(function(t){var n=t.descHandler;return hi(n)(a),a.isStopped()?(i.logEventStopped(e,t.element,n.purpose),Ry.stopped()):a.isCut()?(i.logEventCut(e,t.element,n.purpose),Ry.complete()):ko(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),Ry.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),Ry.resume(r)}))}))},Iy=function(t,e,n,r,o,i){return My(t,e,n,r,o,i).fold((function(){return!0}),(function(r){return Iy(t,e,n,r,o,i)}),(function(){return!1}))},Py=function(e,n,r){var o=function(e){var n=an(!1);return{stop:function(){n.set(!0)},cut:t,isStopped:n.get,isCut:a,event:e,setSource:u("Cannot set source of a broadcasted event"),getSource:u("Cannot get source of a broadcasted event")}}(n);return L(e,(function(t){var e=t.descHandler;hi(e)(o)})),o.isStopped()},Fy=function(t,e,n,r,o){var i=Dy(n,r);return Iy(t,e,n,r,i,o)};function Ly(){var t={};return{registerId:function(e,n,r){yt(r,(function(r,i){var u=void 0!==t[i]?t[i]:{};u[n]=function(t,e){return n=o.apply(void 0,[t.handler].concat(e)),r=t.purpose,{cHandler:n,purpose:r};var n,r}(r,e),t[i]=u}))},unregisterId:function(e){yt(t,(function(t,n){t.hasOwnProperty(e)&&delete t[e]}))},filterByType:function(e){return _t(t,e).map((function(t){return St(t,(function(t,e){return function(t,e){return{id:t,descHandler:e}}(e,t)}))})).getOr([])},find:function(e,n,r){var o=_t(t,n);return Kn(r,(function(t){return function(t,e){return ni(e).fold((function(){return v.none()}),(function(n){return t.bind((function(t){return _t(t,n)})).map((function(t){return function(t,e){return{element:t,descHandler:e}}(e,t)}))}))}(o,t)}),e)}}}function Vy(){var t=Ly(),e={},n=function(t){var e=t.element;return ni(e).fold((function(){return function(t,e){var n=Ko(Zo+t);return ei(e,n),n}("uid-",t.element)}),(function(t){return t}))},r=function(n){ni(n.element).each((function(n){delete e[n],t.unregisterId(n)}))};return{find:function(e,n,r){return t.find(e,n,r)},filter:function(e){return t.filterByType(e)},register:function(o){var i=n(o);Tt(e,i)&&function(t,n){var o=e[n];if(o!==t)throw new Error('The tagId "'+n+'" is already used by: '+Go(o.element)+"\nCannot use it for: "+Go(t.element)+"\nThe conflicting element is"+(Ui(o.element)?" ":" not ")+"already in the DOM");r(t)}(o,i);var u=[o];t.registerId(u,i,o.events),e[i]=o},unregister:r,getById:function(t){return _t(e,t)}}}var Hy=Wl({name:"Container",factory:function(t){var e=t.dom,n=e.attributes,r=l(e,["attributes"]);return{uid:t.uid,dom:f({tag:"div",attributes:f({role:"presentation"},n)},r),components:t.components,behaviours:zf(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[Ke("components",[]),Hf("containerBehaviours",[]),Ke("events",{}),Ke("domModification",{}),Ke("eventOrder",{})]}),zy=function(e){var r=function(t){return ko(e.element).fold((function(){return!0}),(function(e){return qn(t,e)}))},o=Vy(),i=function(t,e){return o.find(r,t,e)},u=Ny(e.element,{triggerEvent:function(t,e){return ua(t,e.target,(function(n){return function(t,e,n,r){return Fy(t,e,n,n.target,r)}(i,t,e,n)}))}}),a={debugInfo:n("real"),triggerEvent:function(t,e,n){ua(t,e,(function(r){return Fy(i,t,n,e,r)}))},triggerFocus:function(e,n){ni(e).fold((function(){mc(e)}),(function(r){ua(wr(),e,(function(r){return function(t,e,n,r,o){var i=Dy(n,r);My(t,e,n,r,i,o)}(i,wr(),{originator:n,kill:t,prevent:t,target:e},e,r),!1}))}))},triggerEscape:function(t,e){a.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return v(t)},getByDom:function(t){return b(t)},build:hu,addToGui:function(t){l(t)},removeFromGui:function(t){d(t)},addToWorld:function(t){s(t)},removeFromWorld:function(t){f(t)},broadcast:function(t){g(t)},broadcastOn:function(t,e){p(t,e)},broadcastEvent:function(t,e){h(t,e)},isConnected:c},s=function(t){t.connect(a),vo(t.element)||(o.register(t),L(t.components(),s),a.triggerEvent(Nr(),t.element,{target:t.element}))},f=function(t){vo(t.element)||(L(t.components(),f),o.unregister(t)),t.disconnect()},l=function(t){ef(e,t)},d=function(t){of(t)},m=function(t){var e=o.filter(kr());L(e,(function(e){var n=e.descHandler;hi(n)(t)}))},g=function(t){m({universal:!0,data:t})},p=function(t,e){m({universal:!1,channels:t,data:e})},h=function(t,e){var n=o.filter(t);return Py(n,e)},v=function(t){return o.getById(t).fold((function(){return ot.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),ot.value)},b=function(t){var e=ni(t).getOr("not found");return v(e)};return s(e),{root:e,element:e.element,destroy:function(){u.unbind(),Mo(e.element)},add:l,remove:d,getByUid:v,getByDom:b,addToWorld:s,removeFromWorld:f,broadcast:g,broadcastOn:p,broadcastEvent:h}},jy=n([Ke("prefix","form-field"),Hf("fieldBehaviours",[Jl,Vf])]),Uy=n([vl({schema:[Ie("dom")],name:"label"}),vl({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Ie("text")],name:"aria-descriptor"}),pl({factory:{sketch:function(t){var e=Ut(t,["factory"]);return t.factory.sketch(e)}},schema:[Ie("factory")],name:"field"})]),Wy=ql({name:"FormField",configFields:jy(),partFields:Uy(),factory:function(t,e,n,r){var o=jf(t.fieldBehaviours,[Jl.config({find:function(e){return Al(e,t,"field")}}),Vf.config({store:{mode:"manual",getValue:function(t){return Jl.getCurrent(t).bind(Vf.getValue)},setValue:function(t,e){Jl.getCurrent(t).each((function(t){Vf.setValue(t,e)}))}}})]),i=Qr([so((function(e,n){var r=Nl(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=Ko(t.prefix);r.label().each((function(t){Vo(t.element,"for",n),Vo(e.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=Ko(t.prefix);Vo(n.element,"id",r),Vo(e.element,"aria-describedby",r)}))}))}))]),u={getField:function(e){return Al(e,t,"field")},getLabel:function(e){return Al(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:u}},apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),qy=Object.freeze({__proto__:null,exhibit:function(t,e){return pi({attributes:qt([{key:e.tabAttr,value:"true"}])})}}),Gy=[Ke("tabAttr","data-alloy-tabstop")],$y=ac({fields:Gy,name:"tabstopping",active:qy}),Xy=tinymce.util.Tools.resolve("tinymce.html.Entities"),Yy=function(t,e,n,r){var o=Ky(t,e,n,r);return Wy.sketch(o)},Ky=function(t,e,n,r){return{dom:Jy(n),components:t.toArray().concat([e]),fieldBehaviours:ic(r)}},Jy=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},Qy=function(t,e){return Wy.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},Zy=Ko("form-component-change"),tx=Ko("form-close"),ex=Ko("form-cancel"),nx=Ko("form-action"),rx=Ko("form-submit"),ox=Ko("form-block"),ix=Ko("form-unblock"),ux=Ko("form-tabchange"),ax=Ko("form-resize"),cx=function(t,e){var n,o,i,u=t.label.map((function(t){return Qy(t,e)})),a=function(t){return function(e,n){Ju(n.event.target,"[data-collection-item-value]").each((function(r){t(e,n,r,Ho(r,"data-collection-item-value"))}))}},c=a((function(n,r,o,i){r.stop(),e.isDisabled()||$r(n,nx,{name:t.name,value:i})})),s=[eo(sr(),a((function(t,e,n){mc(n)}))),eo(hr(),c),eo(Er(),c),eo(fr(),a((function(t,e,n){Ku(t.element,"."+sh).each((function(t){Bi(t,sh)})),Ti(n,sh)}))),eo(lr(),a((function(t){Ku(t.element,"."+sh).each((function(t){Bi(t,sh)}))}))),mo(a((function(e,n,r,o){$r(e,nx,{name:t.name,value:o})})))],f=function(t,e){return F(ls(t.element,".tox-collection__item"),e)},l=Wy.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:r},behaviours:ic([lv.config({disabled:e.isDisabled,onDisabled:function(t){f(t,(function(t){Ti(t,"tox-collection__item--state-disabled"),Vo(t,"aria-disabled",!0)}))},onEnabled:function(t){f(t,(function(t){Bi(t,"tox-collection__item--state-disabled"),Uo(t,"aria-disabled")}))}}),jv(),cg.config({}),Vf.config({store:{mode:"memory",initialValue:[]},onSetValue:function(n,r){!function(n,r){var o=F(r,(function(n){var r=Jh.translate(n.text),o=1===t.columns?'<div class="tox-collection__item-label">'+r+"</div>":"",i='<div class="tox-collection__item-icon">'+n.icon+"</div>",u={_:" "," - ":" ","-":" "},a=r.replace(/\_| \- |\-/g,(function(t){return u[t]}));return'<div class="tox-collection__item'+(e.isDisabled()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+Xy.encodeAllRaw(n.value)+'" title="'+a+'" aria-label="'+a+'">'+i+o+"</div>"})),i="auto"!==t.columns&&t.columns>1?P(o,t.columns):[o],u=F(i,(function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}));Fo(n.element,u.join(""))}(n,r),"auto"===t.columns&&Vh(n,5,"tox-collection__item").each((function(t){var e=t.numRows,r=t.numColumns;rg.setGridSize(n,e,r)})),Gr(n,ax)}}),$y.config({}),rg.config((o=t.columns,i="normal",1===o?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===o?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===i?".tox-swatches__row":".tox-collection__group",cell:"color"===i?".tox-swatch":"."+rh}})),sg("collection-events",s)]),eventOrder:(n={},n[Or()]=["disabling","alloy.base.behaviour","collection-events"],n)});return Yy(u,l,["tox-form__group--collection"],[])},sx=n([We("data"),Ke("inputAttributes",{}),Ke("inputStyles",{}),Ke("tag","input"),Ke("inputClasses",[]),pa("onSetValue"),Ke("styles",{}),Ke("eventOrder",{}),Hf("inputBehaviours",[Vf,gg]),Ke("selectOnFocus",!0)]),fx=function(e){return ic([gg.config({onFocus:e.selectOnFocus?function(t){var e=t.element,n=ou(e);e.dom.setSelectionRange(0,n.length)}:t})])},lx=function(t){return f(f({},fx(t)),jf(t.inputBehaviours,[Vf.config({store:f(f({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return ou(t.element)},setValue:function(t,e){ou(t.element)!==e&&iu(t.element,e)}}),onSetValue:t.onSetValue})]))},dx=function(t){return{tag:t.tag,attributes:f({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},mx=Wl({name:"Input",configFields:sx(),factory:function(t,e){return{uid:t.uid,dom:dx(t),components:[],behaviours:lx(t),eventOrder:t.eventOrder}}}),gx={},px={exports:gx};!function(t,e,n,r){!function(r){if("object"==typeof e&&void 0!==n)n.exports=r();else if("function"==typeof t&&t.amd)t([],r);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=r()}}((function(){return function t(e,n,o){function i(a,c){if(!n[a]){if(!e[a]){var s="function"==typeof r&&r;if(!c&&s)return s(a,!0);if(u)return u(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[a]={exports:{}};e[a][0].call(l.exports,(function(t){return i(e[a][1][t]||t)}),l,l.exports,t,e,n,o)}return n[a].exports}for(var u="function"==typeof r&&r,a=0;a<o.length;a++)i(o[a]);return i}({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var s,f=[],l=!1,d=-1;function m(){l&&s&&(l=!1,s.length?f=s.concat(f):d=-1,f.length&&g())}function g(){if(!l){var t=c(m);l=!0;for(var e=f.length;e;){for(s=f,f=[];++d<e;)s&&s[d].run();d=-1,e=f.length}s=null,l=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function h(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];f.push(new p(t,e)),1!==f.length||l||c(g)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){!function(n){var r=setTimeout;function o(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function u(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void c(e.promise,t)}a(e.promise,r)}else(1===t._state?a:c)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void l((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){c(t,e)}var r,o}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)u(t,t._deferreds[e]);t._deferreds=null}function f(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,c(e,t))}))}catch(t){if(n)return;n=!0,c(e,t)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return u(this,new f(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},i._immediateFn="function"==typeof t?function(e){t(e)}:function(t){r(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,u=Array.prototype.slice,a={},c=0;function s(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"==typeof e?e:function(t){var e=c++,r=!(arguments.length<2)&&u.call(arguments,1);return a[e]=!0,o((function(){a[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"==typeof r?r:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}))}(void 0,gx,px,void 0);var hx,vx=px.exports.boltExport,bx=function(t){var e=v.none(),n=[],r=function(t){o()?u(t):n.push(t)},o=function(){return e.isSome()},i=function(t){L(t,u)},u=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=v.some(t),i(n),n=[])})),{get:r,map:function(t){return bx((function(e){r((function(n){e(t(n))}))}))},isReady:o}},yx={nu:bx,pure:function(t){return bx((function(e){e(t)}))}},xx=function(t){setTimeout((function(){throw t}),0)},wx=function(t){var e=function(e){t().then(e,xx)};return{map:function(e){return wx((function(){return t().then(e)}))},bind:function(e){return wx((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return wx((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return yx.nu(e)},toCached:function(){var e=null;return wx((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},Cx=function(t){return wx((function(){return new vx(t)}))},Sx=function(t){return wx((function(){return vx.resolve(t)}))},kx=["input","textarea"],Ox=function(t){var e=go(t);return R(kx,e)},_x=function(t,e){var n=e.getRoot(t).getOr(t.element);Bi(n,e.invalidClass),e.notify.each((function(e){Ox(t.element)&&Vo(t.element,"aria-invalid",!1),e.getContainer(t).each((function(t){Fo(t,e.validHtml)})),e.onValid(t)}))},Ex=function(t,e,n,r){var o=e.getRoot(t).getOr(t.element);Ti(o,e.invalidClass),e.notify.each((function(e){Ox(t.element)&&Vo(t.element,"aria-invalid",!0),e.getContainer(t).each((function(t){Fo(t,r)})),e.onInvalid(t,r)}))},Tx=function(t,e,n){return e.validator.fold((function(){return Sx(ot.value(!0))}),(function(e){return e.validate(t)}))},Ax=function(t,e,n){return e.notify.each((function(e){e.onValidate(t)})),Tx(t,e).map((function(n){return t.getSystem().isConnected()?n.fold((function(n){return Ex(t,e,0,n),ot.error(n)}),(function(n){return _x(t,e),ot.value(n)})):ot.error("No longer in system")}))},Bx=Object.freeze({__proto__:null,markValid:_x,markInvalid:Ex,query:Tx,run:Ax,isInvalid:function(t,e){var n=e.getRoot(t).getOr(t.element);return Ni(n,e.invalidClass)}}),Nx=Object.freeze({__proto__:null,events:function(e,n){return e.validator.map((function(n){return Qr([eo(n.onEvent,(function(t){Ax(t,e).get(r)}))].concat(n.validateOnLoad?[so((function(n){Ax(n,e).get(t)}))]:[]))})).getOr({})}}),Dx=[Ie("invalidClass"),Ke("getRoot",v.none),Ye("notify",[Ke("aria","alert"),Ke("getContainer",v.none),Ke("validHtml",""),pa("onValid"),pa("onInvalid"),pa("onValidate")]),Ye("validator",[Ie("validate"),Ke("onEvent","input"),Ke("validateOnLoad",!0)])],Rx=ac({fields:Dx,name:"invalidating",active:Nx,apis:Bx,extra:{validation:function(t){return function(e){var n=Vf.getValue(e);return Sx(t(n))}}}}),Mx=Object.freeze({__proto__:null,getCoupled:function(t,e,n,r){return n.getOrCreate(t,e,r)}}),Ix=[Pe("others",ye(ot.value,_e()))],Px=ac({fields:Ix,name:"coupling",apis:Mx,state:Object.freeze({__proto__:null,init:function(){var t={},e=n({});return mi({readState:e,getOrCreate:function(e,n,r){var o=vt(n.others);if(o)return _t(t,r).getOrThunk((function(){var o=_t(n.others,r).getOrDie("No information found for coupled component: "+r)(e),i=e.getSystem().build(o);return t[r]=i,i}));throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))}})}})}),Fx=n("sink"),Lx=n(vl({name:Fx(),overrides:n({dom:{tag:"div"},behaviours:ic([Ks.config({useFixed:c})]),events:Qr([uo(dr()),uo(ir()),uo(hr())])})}));!function(t){t[t.HighlightFirst=0]="HighlightFirst",t[t.HighlightNone=1]="HighlightNone"}(hx||(hx={}));var Vx=function(t,e){var n=t.getHotspot(e).getOr(e),r="hotspot",o=t.getAnchorOverrides();return t.layouts.fold((function(){return{anchor:r,hotspot:n,overrides:o}}),(function(t){return{anchor:r,hotspot:n,overrides:o,layouts:t}}))},Hx=function(t,e,n,r,o,i,u){return function(t,e,n,r,o,i,u){var a=function(t,e,n){return(0,t.fetch)(n).map(e)}(t,e,r),c=Wx(r,t);return a.map((function(t){return t.bind((function(t){return v.from(Yg.sketch(f(f({},i.menu()),{uid:ri(""),data:t,highlightImmediately:u===hx.HighlightFirst,onOpenMenu:function(t,e){var r=c().getOrDie();Ks.position(r,n,e),yf.decloak(o)},onOpenSubmenu:function(t,e,n){var r=c().getOrDie();Ks.position(r,{anchor:"submenu",item:e},n),yf.decloak(o)},onRepositionMenu:function(t,e,r){var o=c().getOrDie();Ks.position(o,n,e),L(r,(function(t){Ks.position(o,{anchor:"submenu",item:t.triggeringItem},t.triggeredMenu)}))},onEscape:function(){return gg.focus(r),yf.close(o),v.some(!0)}})))}))}))}(t,e,Vx(t,n),n,r,o,u).map((function(t){return t.fold((function(){yf.isOpen(r)&&yf.close(r)}),(function(t){yf.cloak(r),yf.open(r,t),i(r)})),r}))},zx=function(t,e,n,r,o,i,u){return yf.close(r),Sx(r)},jx=function(t,e,n,r,o,i){var u=Px.getCoupled(n,"sandbox");return(yf.isOpen(u)?zx:Hx)(t,e,n,u,r,o,i)},Ux=function(t,e,n){var r=Jl.getCurrent(e).getOr(e),o=Tu(t.element);n?Xi(r.element,"min-width",o+"px"):function(t,e){Eu.set(t,e)}(r.element,o)},Wx=function(t,e){return t.getSystem().getByUid(e.uid+"-"+Fx()).map((function(t){return function(){return ot.value(t)}})).getOrThunk((function(){return e.lazySink.fold((function(){return function(){return ot.error(new Error("No internal sink is specified, nor could an external sink be found"))}}),(function(e){return function(){return e(t)}}))}))},qx=function(t){yf.getState(t).each((function(t){Yg.repositionMenus(t)}))},Gx=function(t,e,n){var r=Qu(),o=Wx(e,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:r.id,role:"listbox"}},behaviours:Wf(t.sandboxBehaviours,[Vf.config({store:{mode:"memory",initialValue:e}}),yf.config({onOpen:function(o,i){var u=Vx(t,e);r.link(e.element),t.matchWidth&&Ux(u.hotspot,i,t.useMinWidth),t.onOpen(u,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},onClose:function(t,o){r.unlink(e.element),void 0!==n&&void 0!==n.onClose&&n.onClose(t,o)},isPartOf:function(t,n,r){return ta(n,r)||ta(e,r)},getAttachPoint:function(){return o().getOrDie()}}),Jl.config({find:function(t){return yf.getState(t).bind((function(t){return Jl.getCurrent(t)}))}}),lc.config({channels:f(f({},kf({isExtraPart:a})),_f({doReposition:qx}))})])}},$x=function(t){var e=Px.getCoupled(t,"sandbox");qx(e)},Xx=function(){return[Ke("sandboxClasses",[]),Uf("sandboxBehaviours",[Jl,lc,yf,Vf])]},Yx=n([Ie("dom"),Ie("fetch"),pa("onOpen"),ha("onExecute"),Ke("getHotspot",v.some),Ke("getAnchorOverrides",n({})),qc(),Hf("dropdownBehaviours",[_g,Px,rg,gg]),Ie("toggleClass"),Ke("eventOrder",{}),We("lazySink"),Ke("matchWidth",!1),Ke("useMinWidth",!1),We("role")].concat(Xx())),Kx=n([hl({schema:[da()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),Lx()]),Jx=ql({name:"Dropdown",configFields:Yx(),partFields:Kx(),factory:function(e,n,r,o){var i,u,a=function(t){yf.getState(t).each((function(t){Yg.highlightPrimary(t)}))},c={expand:function(n){_g.isOn(n)||jx(e,(function(t){return t}),n,o,t,hx.HighlightNone).get(t)},open:function(n){_g.isOn(n)||jx(e,(function(t){return t}),n,o,t,hx.HighlightFirst).get(t)},isOpen:_g.isOn,close:function(n){_g.isOn(n)&&jx(e,(function(t){return t}),n,o,t,hx.HighlightFirst).get(t)},repositionMenus:function(t){_g.isOn(t)&&$x(t)}},s=function(t,e){return Xr(t),v.some(!0)};return{uid:e.uid,dom:e.dom,components:n,behaviours:jf(e.dropdownBehaviours,[_g.config({toggleClass:e.toggleClass,aria:{mode:"expanded"}}),Px.config({others:{sandbox:function(t){return Gx(e,t,{onOpen:function(){_g.on(t)},onClose:function(){_g.off(t)}})}}}),rg.config({mode:"special",onSpace:s,onEnter:s,onDown:function(t,e){if(Jx.isOpen(t)){var n=Px.getCoupled(t,"sandbox");a(n)}else Jx.open(t);return v.some(!0)},onEscape:function(t,e){return Jx.isOpen(t)?(Jx.close(t),v.some(!0)):v.none()}}),gg.config({})]),events:Tg(v.some((function(n){jx(e,(function(t){return t}),n,o,a,hx.HighlightFirst).get(t)}))),eventOrder:f(f({},e.eventOrder),(i={},i[Or()]=["disabling","toggling","alloy.base.behaviour"],i)),apis:c,domModification:{attributes:f(f({"aria-haspopup":"true"},e.role.fold((function(){return{}}),(function(t){return{role:t}}))),"button"===e.dom.tag?{type:(u="type",_t(e.dom,"attributes").bind((function(t){return _t(t,u)}))).getOr("button")}:{})}}},apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)},repositionMenus:function(t,e){return t.repositionMenus(e)}}}),Qx=Object.freeze({__proto__:null,events:function(){return Qr([Zr(br(),c)])},exhibit:function(){return pi({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}}),Zx=ac({fields:[],name:"unselecting",active:Qx}),tw=Ko("color-input-change"),ew=Ko("color-swatch-change"),nw=Ko("color-picker-cancel"),rw=function(t,e,n){var r=Wy.parts.field({factory:mx,inputClasses:["tox-textfield"],onSetValue:function(t){return Rx.run(t).get((function(){}))},inputBehaviours:ic([lv.config({disabled:e.providers.isDisabled}),jv(),$y.config({}),Rx.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return ko(t.element)},notify:{onValid:function(t){var e=Vf.getValue(t);$r(t,tw,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=Vf.getValue(t);if(0===e.length)return Sx(ot.value(!0));var n=sn.fromTag("span");Xi(n,"background-color",e);var r=Zi(n,"background-color").fold((function(){return ot.error("blah")}),(function(t){return ot.value(e)}));return Sx(r)}}})]),selectOnFocus:!1}),o=t.label.map((function(t){return Qy(t,e.providers)})),i=function(t,e){$r(t,ew,{value:e})},u=fp(function(t,e){return Jx.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:ic([Wv(e.providers.isDisabled),jv(),Zx.config({}),$y.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:e.getSink,fetch:function(n){return Cx((function(e){return t.fetch(e)})).map((function(r){return v.from(yy(Dt(Qb(Ko("menu-value"),r,(function(e){t.onItemAction(n,e)}),t.columns,t.presets,eh.CLOSE_ON_EXECUTE,(function(){return!1}),e.providers),{movement:ty(t.columns,t.presets)})))}))},parts:{menu:bh(0,0,t.presets)}})}({dom:{tag:"span",attributes:{"aria-label":e.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[Ha,Va,Wa]},onLtr:function(){return[Va,Ha,Wa]}},components:[],fetch:$b(n.getColors(),n.hasCustomColors()),columns:n.getColorCols(),presets:"color",onItemAction:function(t,e){u.getOpt(t).each((function(t){"custom"===e?n.colorPicker((function(e){e.fold((function(){return Gr(t,nw)}),(function(e){i(t,e),Ub(e)}))}),"#ffffff"):i(t,"remove"===e?"":e)}))}},e));return Wy.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:o.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,u.asSpec()]}]),fieldBehaviours:ic([sg("form-field-events",[eo(tw,(function(e,n){u.getOpt(e).each((function(t){Xi(t.element,"background-color",n.event.color)})),$r(e,Zy,{name:t.name})})),eo(ew,(function(t,e){Wy.getField(t).each((function(n){Vf.setValue(n,e.event.value),Jl.getCurrent(t).each(gg.focus)}))})),eo(nw,(function(t,e){Wy.getField(t).each((function(e){Jl.getCurrent(t).each(gg.focus)}))}))])])})},ow=function(t,e,n){return{hue:t,saturation:e,value:n}},iw=Ko("rgb-hex-update"),uw=Ko("slider-update"),aw=Ko("palette-update"),cw=vl({schema:[Ie("dom")],name:"label"}),sw=function(t){return vl({name:t+"-edge",overrides:function(e){return e.model.manager.edgeActions[t].fold((function(){return{}}),(function(t){return{events:Qr([no(er(),(function(e,n,r){return t(e,r)}),[e]),no(ir(),(function(e,n,r){return t(e,r)}),[e]),no(ur(),(function(e,n,r){r.mouseIsDown.get()&&t(e,r)}),[e])])}}))}})},fw=sw("top-left"),lw=sw("top"),dw=sw("top-right"),mw=sw("right"),gw=sw("bottom-right"),pw=sw("bottom"),hw=sw("bottom-left"),vw=[cw,sw("left"),mw,lw,pw,fw,dw,hw,gw,pl({name:"thumb",defaults:n({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:Qr([oo(er(),t,"spectrum"),oo(nr(),t,"spectrum"),oo(rr(),t,"spectrum"),oo(ir(),t,"spectrum"),oo(ur(),t,"spectrum"),oo(cr(),t,"spectrum")])}}}),pl({schema:[un("mouseIsDown",(function(){return an(!1)}))],name:"spectrum",overrides:function(t){var e=t.model.manager,n=function(n,r){return e.getValueFromEvent(r).map((function(r){return e.setValueFrom(n,t,r)}))};return{behaviours:ic([rg.config({mode:"special",onLeft:function(n){return e.onLeft(n,t)},onRight:function(n){return e.onRight(n,t)},onUp:function(n){return e.onUp(n,t)},onDown:function(n){return e.onDown(n,t)}}),gg.config({})]),events:Qr([eo(er(),n),eo(nr(),n),eo(ir(),n),eo(ur(),(function(e,r){t.mouseIsDown.get()&&n(e,r)}))])}}})],bw=n("slider.change.value"),yw=function(t){var e=t.event.raw;if(function(t){return-1!==t.type.indexOf("touch")}(e)){var n=e;return void 0!==n.touches&&1===n.touches.length?v.some(n.touches[0]).map((function(t){return Su(t.clientX,t.clientY)})):v.none()}var r=e;return void 0!==r.clientX?v.some(r).map((function(t){return Su(t.clientX,t.clientY)})):v.none()},xw=function(t){return t.model.minX},ww=function(t){return t.model.minY},Cw=function(t){return t.model.minX-1},Sw=function(t){return t.model.minY-1},kw=function(t){return t.model.maxX},Ow=function(t){return t.model.maxY},_w=function(t){return t.model.maxX+1},Ew=function(t){return t.model.maxY+1},Tw=function(t,e,n){return e(t)-n(t)},Aw=function(t){return Tw(t,kw,xw)},Bw=function(t){return Tw(t,Ow,ww)},Nw=function(t){return Aw(t)/2},Dw=function(t){return Bw(t)/2},Rw=function(t){return t.stepSize},Mw=function(t){return t.snapToGrid},Iw=function(t){return t.snapStart},Pw=function(t){return t.rounded},Fw=function(t,e){return void 0!==t[e+"-edge"]},Lw=function(t){return Fw(t,"left")},Vw=function(t){return Fw(t,"right")},Hw=function(t){return Fw(t,"top")},zw=function(t){return Fw(t,"bottom")},jw=function(t){return t.model.value.get()},Uw=function(t){return{x:t}},Ww=function(t){return{y:t}},qw=function(t,e){return{x:t,y:e}},Gw=function(t,e){$r(t,bw(),{value:e})},$w=function(t,e,n,r){return t<e?t:t>n?n:t===e?e-1:Math.max(e,t-r)},Xw=function(t,e,n,r){return t>n?t:t<e?e:t===n?n+1:Math.min(n,t+r)},Yw=function(t,e,n){return Math.max(e,Math.min(n,t))},Kw=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,f=t.hasMaxEdge,l=t.minBound,d=t.maxBound,m=t.screenRange,g=s?e-1:e,p=f?n+1:n;if(o<l)return g;if(o>d)return p;var h=function(t,e,n){return Math.min(n,Math.max(t,e))-e}(o,l,d),v=Yw(h/m*r+e,g,p);return u&&v>=e&&v<=n?function(t,e,n,r,o){return o.fold((function(){var o=t-e,i=Math.round(o/r)*r;return Yw(e+i,e-1,n+1)}),(function(e){var o=(t-e)%r,i=Math.round(o/r),u=Math.floor((t-e)/r),a=Math.floor((n-e)/r),c=e+Math.min(a,u+i)*r;return Math.max(e,c)}))}(v,e,n,i,a):c?Math.round(v):v},Jw=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,f=t.centerMaxEdge;return o<e?i?0:s:o>n?u?a:f:(o-e)/r*c},Qw="top",Zw="right",tC="bottom",eC="left",nC=function(t){return t.element.dom.getBoundingClientRect()},rC=function(t,e){return t[e]},oC=function(t){var e=nC(t);return rC(e,eC)},iC=function(t){var e=nC(t);return rC(e,Zw)},uC=function(t){var e=nC(t);return rC(e,Qw)},aC=function(t){var e=nC(t);return rC(e,tC)},cC=function(t){var e=nC(t);return rC(e,"width")},sC=function(t){var e=nC(t);return rC(e,"height")},fC=function(t,e,n){return(t+e)/2-n},lC=function(t,e){var n=nC(t),r=nC(e),o=rC(n,eC),i=rC(n,Zw),u=rC(r,eC);return fC(o,i,u)},dC=function(t,e){var n=nC(t),r=nC(e),o=rC(n,Qw),i=rC(n,tC),u=rC(r,Qw);return fC(o,i,u)},mC=function(t,e){$r(t,bw(),{value:e})},gC=function(t){return{x:t}},pC=function(t,e,n){var r={min:xw(e),max:kw(e),range:Aw(e),value:n,step:Rw(e),snap:Mw(e),snapStart:Iw(e),rounded:Pw(e),hasMinEdge:Lw(e),hasMaxEdge:Vw(e),minBound:oC(t),maxBound:iC(t),screenRange:cC(t)};return Kw(r)},hC=function(t){return function(e,n){return function(t,e,n){var r=(t>0?Xw:$w)(jw(n).x,xw(n),kw(n),Rw(n));return mC(e,gC(r)),v.some(r)}(t,e,n).map((function(){return!0}))}},vC=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=cC(t),u=r.bind((function(e){return v.some(lC(e,t))})).getOr(0),a=o.bind((function(e){return v.some(lC(e,t))})).getOr(i),c={min:xw(e),max:kw(e),range:Aw(e),value:n,hasMinEdge:Lw(e),hasMaxEdge:Vw(e),minBound:oC(t),minOffset:0,maxBound:iC(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return Jw(c)}(e,i,n,r,o);return oC(e)-oC(t)+u},bC=hC(-1),yC=hC(1),xC=v.none,wC=v.none,CC={"top-left":v.none(),top:v.none(),"top-right":v.none(),right:v.some((function(t,e){Gw(t,Uw(_w(e)))})),"bottom-right":v.none(),bottom:v.none(),"bottom-left":v.none(),left:v.some((function(t,e){Gw(t,Uw(Cw(e)))}))},SC=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=pC(t,e,n),o=gC(r);return mC(t,o),r},setToMin:function(t,e){var n=xw(e);mC(t,gC(n))},setToMax:function(t,e){var n=kw(e);mC(t,gC(n))},findValueOfOffset:pC,getValueFromEvent:function(t){return yw(t).map((function(t){return t.left}))},findPositionOfValue:vC,setPositionFromValue:function(t,e,n,r){var o=jw(n),i=vC(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=Tu(e.element)/2;Xi(e.element,"left",i-u+"px")},onLeft:bC,onRight:yC,onUp:xC,onDown:wC,edgeActions:CC}),kC=function(t,e){$r(t,bw(),{value:e})},OC=function(t){return{y:t}},_C=function(t,e,n){var r={min:ww(e),max:Ow(e),range:Bw(e),value:n,step:Rw(e),snap:Mw(e),snapStart:Iw(e),rounded:Pw(e),hasMinEdge:Hw(e),hasMaxEdge:zw(e),minBound:uC(t),maxBound:aC(t),screenRange:sC(t)};return Kw(r)},EC=function(t){return function(e,n){return function(t,e,n){var r=(t>0?Xw:$w)(jw(n).y,ww(n),Ow(n),Rw(n));return kC(e,OC(r)),v.some(r)}(t,e,n).map((function(){return!0}))}},TC=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=sC(t),u=r.bind((function(e){return v.some(dC(e,t))})).getOr(0),a=o.bind((function(e){return v.some(dC(e,t))})).getOr(i),c={min:ww(e),max:Ow(e),range:Bw(e),value:n,hasMinEdge:Hw(e),hasMaxEdge:zw(e),minBound:uC(t),minOffset:0,maxBound:aC(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return Jw(c)}(e,i,n,r,o);return uC(e)-uC(t)+u},AC=v.none,BC=v.none,NC=EC(-1),DC=EC(1),RC={"top-left":v.none(),top:v.some((function(t,e){Gw(t,Ww(Sw(e)))})),"top-right":v.none(),right:v.none(),"bottom-right":v.none(),bottom:v.some((function(t,e){Gw(t,Ww(Ew(e)))})),"bottom-left":v.none(),left:v.none()},MC=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=_C(t,e,n),o=OC(r);return kC(t,o),r},setToMin:function(t,e){var n=ww(e);kC(t,OC(n))},setToMax:function(t,e){var n=Ow(e);kC(t,OC(n))},findValueOfOffset:_C,getValueFromEvent:function(t){return yw(t).map((function(t){return t.top}))},findPositionOfValue:TC,setPositionFromValue:function(t,e,n,r){var o=jw(n),i=TC(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=xu(e.element)/2;Xi(e.element,"top",i-u+"px")},onLeft:AC,onRight:BC,onUp:NC,onDown:DC,edgeActions:RC}),IC=function(t,e){$r(t,bw(),{value:e})},PC=function(t,e){return{x:t,y:e}},FC=function(t,e){return function(n,r){return function(t,e,n,r){var o=t>0?Xw:$w,i=e?jw(r).x:o(jw(r).x,xw(r),kw(r),Rw(r)),u=e?o(jw(r).y,ww(r),Ow(r),Rw(r)):jw(r).y;return IC(n,PC(i,u)),v.some(i)}(t,e,n,r).map((function(){return!0}))}},LC=FC(-1,!1),VC=FC(1,!1),HC=FC(-1,!0),zC=FC(1,!0),jC={"top-left":v.some((function(t,e){Gw(t,qw(Cw(e),Sw(e)))})),top:v.some((function(t,e){Gw(t,qw(Nw(e),Sw(e)))})),"top-right":v.some((function(t,e){Gw(t,qw(_w(e),Sw(e)))})),right:v.some((function(t,e){Gw(t,qw(_w(e),Dw(e)))})),"bottom-right":v.some((function(t,e){Gw(t,qw(_w(e),Ew(e)))})),bottom:v.some((function(t,e){Gw(t,qw(Nw(e),Ew(e)))})),"bottom-left":v.some((function(t,e){Gw(t,qw(Cw(e),Ew(e)))})),left:v.some((function(t,e){Gw(t,qw(Cw(e),Dw(e)))}))},UC=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=pC(t,e,n.left),o=_C(t,e,n.top),i=PC(r,o);return IC(t,i),i},setToMin:function(t,e){var n=xw(e),r=ww(e);IC(t,PC(n,r))},setToMax:function(t,e){var n=kw(e),r=Ow(e);IC(t,PC(n,r))},getValueFromEvent:function(t){return yw(t)},setPositionFromValue:function(t,e,n,r){var o=jw(n),i=vC(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=TC(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=Tu(e.element)/2,c=xu(e.element)/2;Xi(e.element,"left",i-a+"px"),Xi(e.element,"top",u-c+"px")},onLeft:LC,onRight:VC,onUp:HC,onDown:zC,edgeActions:jC}),WC=ql({name:"Slider",configFields:[Ke("stepSize",1),Ke("onChange",t),Ke("onChoose",t),Ke("onInit",t),Ke("onDragStart",t),Ke("onDragEnd",t),Ke("snapToGrid",!1),Ke("rounded",!0),We("snapStart"),Pe("model",Oe("mode",{x:[Ke("minX",0),Ke("maxX",100),un("value",(function(t){return an(t.mode.minX)})),Ie("getInitialValue"),ya("manager",SC)],y:[Ke("minY",0),Ke("maxY",100),un("value",(function(t){return an(t.mode.minY)})),Ie("getInitialValue"),ya("manager",MC)],xy:[Ke("minX",0),Ke("maxX",100),Ke("minY",0),Ke("maxY",100),un("value",(function(t){return an({x:t.mode.minX,y:t.mode.minY})})),Ie("getInitialValue"),ya("manager",UC)]})),Hf("sliderBehaviours",[rg,Vf]),un("mouseIsDown",(function(){return an(!1)}))],partFields:vw,factory:function(t,e,n,r){var o,i=function(e){return Bl(e,t,"thumb")},u=function(e){return Bl(e,t,"spectrum")},a=function(e){return Al(e,t,"left-edge")},s=function(e){return Al(e,t,"right-edge")},f=function(e){return Al(e,t,"top-edge")},l=function(e){return Al(e,t,"bottom-edge")},d=t.model,m=d.manager,g=function(e,n){m.setPositionFromValue(e,n,t,{getLeftEdge:a,getRightEdge:s,getTopEdge:f,getBottomEdge:l,getSpectrum:u})},p=function(e,n){d.value.set(n);var r=i(e);return g(e,r),t.onChange(e,r,n),v.some(!0)},h=function(e){var n=t.mouseIsDown.get();t.mouseIsDown.set(!1),n&&Al(e,t,"thumb").each((function(n){var r=d.value.get();t.onChoose(e,n,r)}))},b=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},y=function(e,n){n.stop(),t.onDragEnd(e,i(e)),h(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:jf(t.sliderBehaviours,[rg.config({mode:"special",focusIn:function(e){return Al(e,t,"spectrum").map(rg.focusIn).map(c)}}),Vf.config({store:{mode:"manual",getValue:function(t){return d.value.get()}}}),lc.config({channels:(o={},o[Cf()]={onReceive:h},o)})]),events:Qr([eo(bw(),(function(t,e){p(t,e.event.value)})),so((function(e,n){var r=d.getInitialValue();d.value.set(r);var o=i(e);g(e,o);var a=u(e);t.onInit(e,o,a,d.value.get())})),eo(er(),b),eo(rr(),y),eo(ir(),b),eo(cr(),y)]),apis:{resetToMin:function(e){m.setToMin(e,t)},resetToMax:function(e){m.setToMax(e,t)},changeValue:p,refresh:g},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),qC=function(t,e){var r=WC.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=WC.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return WC.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:n({y:0})},components:[r,o],sliderBehaviours:ic([gg.config({})]),onChange:function(t,e,n){$r(t,uw,{value:n})}})},GC="form",$C=[Hf("formBehaviours",[Vf])],XC=function(t){return"<alloy.field."+t+">"},YC=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:jf(t.formBehaviours,[Vf.config({store:{mode:"manual",getValue:function(e){var n=Dl(e,t);return xt(n,(function(t,e){return t().bind((function(t){var n,r,o=Jl.getCurrent(t);return n=o,r=new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+Go(t.element)),n.fold((function(){return ot.error(r)}),ot.value)})).map(Vf.getValue)}))},setValue:function(e,n){yt(n,(function(n,r){Al(e,t,r).each((function(t){Jl.getCurrent(t).each((function(t){Vf.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return Al(e,t,n).bind(Jl.getCurrent)}}}},KC={getField:li((function(t,e,n){return t.getField(e,n)})),sketch:function(t){var e=function(){var t=[];return{field:function(e,n){return t.push(e),kl(GC,XC(e),n)},record:function(){return t}}}(),n=t(e),r=e.record(),o=F(r,(function(t){return pl({name:t,pname:XC(t)})}));return Vl(GC,$C,o,YC,n)}},JC=Ko("valid-input"),QC=Ko("invalid-input"),ZC=Ko("validating-input"),tS="colorcustom.rgb.",eS=function(e,n,r,o){var i=function(t,r){return Rx.config({invalidClass:n("invalid"),notify:{onValidate:function(e){$r(e,ZC,{type:t})},onValid:function(e){$r(e,JC,{type:t,value:Vf.getValue(e)})},onInvalid:function(e){$r(e,QC,{type:t,value:Vf.getValue(e)})}},validator:{validate:function(t){var n=Vf.getValue(t),o=r(n)?ot.value(!0):ot.error(e("aria.input.invalid"));return Sx(o)},validateOnLoad:!1}})},u=function(r,o,u,a,c){var s=e("colorcustom.rgb.range"),l=[Wy.parts.label({dom:{tag:"label",innerHtml:u,attributes:{"aria-label":a}}}),Wy.parts.field({data:c,factory:mx,inputAttributes:f({type:"text"},"hex"===o?{"aria-live":"polite"}:{}),inputClasses:[n("textfield")],inputBehaviours:ic([i(o,r),$y.config({})]),onSetValue:function(e){Rx.isInvalid(e)&&Rx.run(e).get(t)}})],d="hex"!==o?[Wy.parts["aria-descriptor"]({text:s})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:l.concat(d)}},a=function(t,e){var n=e.red,r=e.green,o=e.blue;Vf.setValue(t,{red:n,green:r,blue:o})},c=fp({dom:{tag:"div",classes:[n("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),s=function(t,e){c.getOpt(t).each((function(t){Xi(t.element,"background-color","#"+e.value)}))};return Wl({factory:function(){var t={red:an(v.some(255)),green:an(v.some(255)),blue:an(v.some(255)),hex:an(v.some("ffffff"))},i=function(e){return t[e].get()},f=function(e,n){t[e].set(n)},l=function(t){var e=t.red,n=t.green,r=t.blue;f("red",v.some(e)),f("green",v.some(n)),f("blue",v.some(r))},d=function(t,e){var n=e.event;"hex"!==n.type?f(n.type,v.none()):o(t)},m=function(t,e,n){var r=parseInt(n,10);f(e,v.some(r)),i("red").bind((function(t){return i("green").bind((function(e){return i("blue").map((function(n){return Tb(t,e,n,1)}))}))})).each((function(e){var n=function(t,e){var n=Cb(e);return KC.getField(t,"hex").each((function(e){gg.isFocused(e)||Vf.setValue(t,{hex:n.value})})),n}(t,e);s(t,n)}))},g=function(t,e){var n=e.event;!function(t){return"hex"===t.type}(n)?m(t,n.type,n.value):function(t,e){r(t);var n=hb(e);f("hex",v.some(e));var o=Nb(n);a(t,o),l(o),$r(t,iw,{hex:n}),s(t,n)}(t,n.value)},p=function(t){return{label:e(tS+t+".label"),description:e(tS+t+".description")}},h=p("red"),b=p("green"),y=p("blue"),x=p("hex");return Dt(KC.sketch((function(t){return{dom:{tag:"form",classes:[n("rgb-form")],attributes:{"aria-label":e("aria.color.picker")}},components:[t.field("red",Wy.sketch(u(Ab,"red",h.label,h.description,255))),t.field("green",Wy.sketch(u(Ab,"green",b.label,b.description,255))),t.field("blue",Wy.sketch(u(Ab,"blue",y.label,y.description,255))),t.field("hex",Wy.sketch(u(yb,"hex",x.label,x.description,"ffffff"))),c.asSpec()],formBehaviours:ic([Rx.config({invalidClass:n("form-invalid")}),sg("rgb-form-events",[eo(JC,g),eo(QC,d),eo(ZC,d)])])}})),{apis:{updateHex:function(t,e){Vf.setValue(t,{hex:e.value}),function(t,e){var n=Nb(e);a(t,n),l(n)}(t,e),s(t,e)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}})},nS=function(t,e){var r=WC.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),o=WC.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"<div class="+e("sv-palette-inner-thumb")+' role="presentation"></div>'}}),i=function(t,e){var n=t.width,r=t.height,o=t.getContext("2d");if(null!==o){o.fillStyle=e,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var u=o.createLinearGradient(0,0,0,r);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=u,o.fillRect(0,0,n,r)}};return Wl({factory:function(t){var u=n({x:0,y:0}),a=ic([Jl.config({find:v.some}),gg.config({})]);return WC.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:u},rounded:!1,components:[r,o],onChange:function(t,e,n){$r(t,aw,{value:n})},onInit:function(t,e,n,r){i(n.element.dom,Rb(Mb))},sliderBehaviours:a})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,e,n){!function(t,e){var n=t.components()[0].element.dom;i(n,Rb(e))}(e,n)}},extraApis:{}})},rS=function(e,n){return Wl({name:"ColourPicker",configFields:[Ie("dom"),Ke("onValidHex",t),Ke("onInvalidHex",t)],factory:function(t){var r,o=eS(e,n,t.onValidHex,t.onInvalidHex),i=nS(0,n),u={paletteRgba:an(Mb)},a=fp(i.sketch({})),c=fp(o.sketch({})),s=function(t,e){a.getOpt(t).each((function(t){var n=Nb(e);u.paletteRgba.set(n),i.setRgba(t,n)}))},f=function(t,e){c.getOpt(t).each((function(t){o.updateHex(t,e)}))},l=function(t,e,n){L(n,(function(n){n(t,e)}))};return{uid:t.uid,dom:t.dom,components:[a.asSpec(),qC(0,n),c.asSpec()],behaviours:ic([sg("colour-picker-events",[eo(aw,(r=[f],function(t,e){var n=e.event.value,o=function(t){var e,n=0,r=0,o=t.red/255,i=t.green/255,u=t.blue/255,a=Math.min(o,Math.min(i,u)),c=Math.max(o,Math.max(i,u));return a===c?ow(0,0,100*(r=a)):(n=60*((n=o===a?3:u===a?1:5)-(o===a?i-u:u===a?o-i:u-o)/(c-a)),e=(c-a)/c,r=c,ow(Math.round(n),Math.round(100*e),Math.round(100*r)))}(u.paletteRgba.get()),i=ow(o.hue,n.x,100-n.y),a=Bb(i),c=Cb(a);l(t,c,r)})),eo(uw,function(){var t=[s,f];return function(e,n){var r=function(t){var e=ow((100-t)/100*360,100,100),n=Bb(e);return Cb(n)}(n.event.value.y);l(e,r,t)}}())]),Jl.config({find:function(t){return c.getOpt(t)}}),rg.config({mode:"acyclic"})])}}})},oS=function(){return Jl.config({find:v.some})},iS=function(t){return Jl.config({find:t.getOpt})},uS=function(t){return Jl.config({find:function(e){return Eo(e.element,t).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}})},aS={"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.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},cS=function(t){return function(t){return aS[t]}(t)},sS=tinymce.util.Tools.resolve("tinymce.Resource"),fS=tinymce.util.Tools.resolve("tinymce.util.Tools"),lS=ie([Ke("preprocess",r),Ke("postprocess",r)]),dS=function(t,e,n){return Vf.config(Dt({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},mS=function(t,e,n){return dS(t,(function(t){return e(t.element)}),(function(t,e){return n(t.element,e)}))},gS=function(t,e){var n=Ce("RepresentingConfigs.memento processors",lS,e);return Vf.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=Vf.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);Vf.setValue(i,o)}}})},pS=dS,hS=function(t){return mS(t,Po,Fo)},vS=function(t){return Vf.config({store:{mode:"memory",initialValue:t}})},bS=function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){L(t,(function(t){t(e,n)}))}},o=function(t,e){if(!lv.isDisabled(t)){var n=e.event.raw;u(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event.raw.target;u(t,n.files)},u=function(n,r){Vf.setValue(n,function(t,e){var n=fS.explode(e.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"));return H(tt(t),(function(t){return M(n,(function(e){return vn(t.name,"."+e)}))}))}(r,e)),$r(n,Zy,{name:t.name})},a=fp({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:ic([sg("input-file-events",[uo(hr()),uo(Er())])])}),c=t.label.map((function(t){return Qy(t,e)})),s=Wy.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:ic([vS([]),oS(),lv.config({}),_g.config({toggleClass:"dragenter",toggleOnExecute:!1}),sg("dropzone-events",[eo("dragenter",r([n,_g.toggle])),eo("dragleave",r([n,_g.toggle])),eo("dragover",n),eo("drop",r([n,o])),eo(pr(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},sp.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[a.asSpec()],action:function(t){a.get(t).element.dom.click()},buttonBehaviours:ic([$y.config({}),Wv(e.isDisabled),jv()])})]}]}}}});return Yy(c,s,["tox-form__group--stretched"],[])},yS=Ko("alloy-fake-before-tabstop"),xS=Ko("alloy-fake-after-tabstop"),wS=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:ic([gg.config({ignore:!0}),$y.config({})])}},CS=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[wS([yS]),t,wS([xS])],behaviours:ic([uS(1)])}},SS=function(t,e){$r(t,dr(),{raw:{which:9,shiftKey:e}})},kS=function(t,e){var n=e.element;Ni(n,yS)?SS(t,!0):Ni(n,xS)&&SS(t,!1)},OS=function(t){return Oy(t,["."+yS,"."+xS].join(","),a)},_S=!(jn().browser.isIE()||jn().browser.isEdge()),ES=function(t,e){var n=_S&&t.sandboxed,r=f(f({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=function(t){var e=an("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)Vo(n.element,"srcdoc",r);else{Vo(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}}(n),i=t.label.map((function(t){return Qy(t,e)})),u=Wy.parts.field({factory:{sketch:function(t){return CS({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:ic([$y.config({}),gg.config({}),pS(v.none(),o.getValue,o.setValue)])})}}});return Yy(i,u,["tox-form__group--stretched"],[])};function TS(t,e){return NS(document.createElement("canvas"),t,e)}function AS(t){var e=TS(t.width,t.height);return BS(e).drawImage(t,0,0),e}function BS(t){return t.getContext("2d")}function NS(t,e,n){return t.width=e,t.height=n,t}function DS(t){return t.naturalWidth||t.width}function RS(t){return t.naturalHeight||t.height}var MS=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(t,r(u,this),r(a,this))},e=window,n=t.immediateFn||"function"==typeof e.setImmediate&&e.setImmediate||function(t){setTimeout(t,1)};function r(t,e){return function(){return t.apply(e,arguments)}}var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t){var e=this;null!==this._state?n((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function u(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void f(r(e,t),r(u,this),r(a,this))}this._state=!0,this._value=t,c.call(this)}catch(t){a.call(this,t)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];i.call(this,n)}this._deferreds=[]}function s(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function f(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.then=function(e,n){var r=this;return new t((function(t,o){i.call(r,new s(e,n,t,o))}))},t.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Array.prototype.slice.call(1===e.length&&o(e[0])?e[0]:e);return new t((function(t,e){if(0===r.length)return t([]);var n=r.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),e)}r[i]=u,0==--n&&t(r)}catch(t){e(t)}}for(var i=0;i<r.length;i++)o(i,r[i])}))},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=0,o=e;r<o.length;r++){o[r].then(t,n)}}))},t}();function IS(t){return new MS((function(e,n){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return v.none();for(var r=n[1],o=e[1],i=1024,u=atob(o),a=u.length,c=Math.ceil(a/i),s=new Array(c),f=0;f<c;++f){for(var l=f*i,d=Math.min(l+i,a),m=new Array(d-l),g=l,p=0;g<d;++p,++g)m[p]=u[g].charCodeAt(0);s[f]=new Uint8Array(m)}return v.some(new Blob(s,{type:r}))})(t).fold((function(){n("uri is not base64: "+t)}),e)}))}function PS(t,e,n){return e=e||"image/png",_(HTMLCanvasElement.prototype.toBlob)?new MS((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):IS(t.toDataURL(e,n))}function FS(t){return function(t){return new MS((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",u),o.removeEventListener("error",a)};function u(){i(),e(o)}function a(){i(),n("Unable to load data of type "+t.type+": "+r)}o.addEventListener("load",u),o.addEventListener("error",a),o.src=r,o.complete&&u()}))}(t).then((function(t){!function(t){URL.revokeObjectURL(t.src)}(t);var e=TS(DS(t),RS(t));return BS(e).drawImage(t,0,0),e}))}function LS(t,e,r){var o=e.type;function i(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))}return{getType:n(o),toBlob:function(){return MS.resolve(e)},toDataURL:n(r),toBase64:function(){return r.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return PS(t,e,n)}))},toAdjustedDataURL:i,toAdjustedBase64:function(t,e){return i(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(AS)}}}function VS(t){return function(t){return new MS((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return LS(FS(t),t,e)}))}function HS(t,e){return PS(t,e).then((function(e){return LS(MS.resolve(t),e,t.toDataURL())}))}function zS(t,e,n){var r="string"==typeof t?parseFloat(t):t;return r>n?r=n:r<e&&(r=e),r}var jS=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function US(t,e){for(var n,r=[],o=new Array(25),i=0;i<5;i++){for(var u=0;u<5;u++)r[u]=e[u+5*i];for(u=0;u<5;u++){n=0;for(var a=0;a<5;a++)n+=t[u+5*a]*r[a];o[u+5*i]=n}}return o}function WS(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=BS(t);function o(t,e){for(var n,r,o,i,u=t.data,a=e[0],c=e[1],s=e[2],f=e[3],l=e[4],d=e[5],m=e[6],g=e[7],p=e[8],h=e[9],v=e[10],b=e[11],y=e[12],x=e[13],w=e[14],C=e[15],S=e[16],k=e[17],O=e[18],_=e[19],E=0;E<u.length;E+=4)n=u[E],r=u[E+1],o=u[E+2],i=u[E+3],u[E]=n*a+r*c+o*s+i*f+l,u[E+1]=n*d+r*m+o*g+i*p+h,u[E+2]=n*v+r*b+o*y+i*x+w,u[E+3]=n*C+r*S+o*k+i*O+_;return t}var i=o(r.getImageData(0,0,t.width,t.height),n);return r.putImageData(i,0,0),HS(t,e)}(n,t.getType(),e)}))}function qS(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=BS(t);function o(t,e,n){function r(t,e,n){return t>n?t=n:t<e&&(t=e),t}for(var o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),u=t.data,a=e.data,c=t.width,s=t.height,f=0;f<s;f++)for(var l=0;l<c;l++){for(var d=0,m=0,g=0,p=0;p<o;p++)for(var h=0;h<o;h++){var v=r(l+h-i,0,c-1),b=4*(r(f+p-i,0,s-1)*c+v),y=n[p*o+h];d+=u[b]*y,m+=u[b+1]*y,g+=u[b+2]*y}var x=4*(f*c+l);a[x]=r(d,0,255),a[x+1]=r(m,0,255),a[x+2]=r(g,0,255)}return e}var i=r.getImageData(0,0,t.width,t.height),u=r.getImageData(0,0,t.width,t.height);return u=o(i,u,n),r.putImageData(u,0,0),HS(t,e)}(n,t.getType(),e)}))}function GS(t){return function(e,n){return WS(e,t([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],n))}}var $S,XS,YS=function(t){return function(e){return WS(e,t)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1]),KS=GS((function(t,e){return US(t,[1,0,0,0,e=zS(255*e,-255,255),0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])})),JS=GS((function(t,e){var n;return e=zS(e,-1,1),US(t,[(n=(e*=100)<0?127+e/100*127:127*(n=0===(n=e%1)?jS[e]:jS[Math.floor(e)]*(1-n)+jS[Math.floor(e)+1]*n)+127)/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])})),QS=function(t,e,n,r){return WS(t,function(t,e,n,r){return US(t,[e=zS(e,0,2),0,0,0,0,0,n=zS(n,0,2),0,0,0,0,0,r=zS(r,0,2),0,0,0,0,0,1,0,0,0,0,0,1])}([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],e,n,r))},ZS=($S=[0,-1,0,-1,5,-1,0,-1,0],function(t){return qS(t,$S)}),tk=(XS=function(t,e){return 255*Math.pow(t/255,1-e)},function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){for(var r=BS(t),o=new Array(256),i=0;i<o.length;i++)o[i]=XS(i,n);var u=function(t,e){for(var n=t.data,r=0;r<n.length;r+=4)n[r]=e[n[r]],n[r+1]=e[n[r+1]],n[r+2]=e[n[r+2]];return t}(r.getImageData(0,0,t.width,t.height),o);return r.putImageData(u,0,0),HS(t,e)}(n,t.getType(),e)}))});function ek(t,e,n){var r=DS(t),o=RS(t),i=e/r,u=n/o,a=!1;(i<.5||i>2)&&(i=i<.5?.5:2,a=!0),(u<.5||u>2)&&(u=u<.5?.5:2,a=!0);var c=function(t,e,n){return new MS((function(r){var o=DS(t),i=RS(t),u=Math.floor(o*e),a=Math.floor(i*n),c=TS(u,a);BS(c).drawImage(t,0,0,o,i,0,0,u,a),r(c)}))}(t,i,u);return a?c.then((function(t){return ek(t,e,n)})):c}function nk(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=TS(t.width,t.height),o=BS(r),i=0,u=0;90!==(n=n<0?360+n:n)&&270!==n||NS(r,r.height,r.width);90!==n&&180!==n||(i=r.width);270!==n&&180!==n||(u=r.height);return o.translate(i,u),o.rotate(n*Math.PI/180),o.drawImage(t,0,0),HS(r,e)}(n,t.getType(),e)}))}function rk(t,e){return t.toCanvas().then((function(n){return function(t,e,n){var r=TS(t.width,t.height),o=BS(r);"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0));return HS(r,e)}(n,t.getType(),e)}))}function ok(t,e,n,r,o){return t.toCanvas().then((function(i){return function(t,e,n,r,o,i){var u=TS(o,i);return BS(u).drawImage(t,-n,-r),HS(u,e)}(i,t.getType(),e,n,r,o)}))}var ik,uk=function(t){return YS(t)},ak=function(t){return ZS(t)},ck=function(t,e){return tk(t,e)},sk=function(t,e){return KS(t,e)},fk=function(t,e){return JS(t,e)},lk=function(t,e){return rk(t,e)},dk=function(t,e,n){return function(t,e,n){return t.toCanvas().then((function(r){return ek(r,e,n).then((function(e){return HS(e,t.getType())}))}))}(t,e,n)},mk=function(t,e){return nk(t,e)},gk=function(t,e){return f({dom:{tag:"span",innerHtml:t,classes:["tox-icon","tox-tbtn__icon-wrap"]}},e)},pk=function(t,e){return gk(dp(t,e),{})},hk=function(t,e){return gk(dp(t,e),{behaviours:ic([cg.config({})])})},vk=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:ic([cg.config({})])}},bk=Ko("toolbar.button.execute"),yk=((ik={})[Or()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],ik),xk=Ko("update-menu-text"),wk=Ko("update-menu-icon"),Ck=function(e,n,r){var i=an(t),u=e.text.map((function(t){return fp(vk(t,n,r.providers))})),a=e.icon.map((function(t){return fp(hk(t,r.providers.icons))})),c=function(t,e){var n=Vf.getValue(t);return gg.focus(n),$r(n,"keydown",{raw:e.event.raw}),Jx.close(n),v.some(!0)},s=e.role.fold((function(){return{}}),(function(t){return{role:t}})),l=e.tooltip.fold((function(){return{}}),(function(t){var e=r.providers.translate(t);return{title:e,"aria-label":e}}));return fp(Jx.sketch(f(f(f({},e.uid?{uid:e.uid}:{}),s),{dom:{tag:"button",classes:[n,n+"--select"].concat(F(e.classes,(function(t){return n+"--"+t}))),attributes:f({},l)},components:Qv([a.map((function(t){return t.asSpec()})),u.map((function(t){return t.asSpec()})),v.some({dom:{tag:"div",classes:[n+"__select-chevron"],innerHtml:dp("chevron-down",r.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:ic(d(e.dropdownBehaviours,[Wv((function(){return e.disabled||r.providers.isDisabled()})),jv(),Zx.config({}),cg.config({}),sg("dropdown-events",[Xv(e,i),Yv(e,i)]),sg("menubutton-update-display-text",[eo(xk,(function(t,e){u.bind((function(e){return e.getOpt(t)})).each((function(t){cg.set(t,[mu(r.providers.translate(e.event.text))])}))})),eo(wk,(function(t,e){a.bind((function(e){return e.getOpt(t)})).each((function(t){cg.set(t,[hk(e.event.icon,r.providers.icons)])}))}))])])),eventOrder:Dt(yk,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:ic([rg.config({mode:"special",onLeft:c,onRight:c})]),lazySink:r.getSink,toggleClass:n+"--active",parts:{menu:bh(0,e.columns,e.presets)},fetch:function(t){return Cx(o(e.fetch,t))}}))).asSpec()},Sk=function(t){return"separator"===t.type},kk={type:"separator"},Ok=function(t,e){var n=j(t,(function(t,n){return function(t){return x(t)}(n)?""===n?t:"|"===n?t.length>0&&!Sk(t[t.length-1])?t.concat([kk]):t:Et(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&Sk(n[n.length-1])&&n.pop(),n},_k=function(t,e){return function(t){return Et(t,"getSubmenuItems")}(t)?function(t,e){var n=t.getSubmenuItems(),r=Ek(n,e);return{item:t,menus:Dt(r.menus,Wt(t.value,r.items)),expansions:Dt(r.expansions,Wt(t.value,t.value))}}(t,e):{item:t,menus:{},expansions:{}}},Ek=function(t,e){var n=Ok(x(t)?t.split(" "):t,e);return z(n,(function(t,n){var r=function(t){if(Sk(t))return t;var e=_t(t,"value").getOrThunk((function(){return Ko("generated-menu-item")}));return Dt({value:e},t)}(n),o=_k(r,e);return{menus:Dt(t.menus,o.menus),items:[o.item].concat(t.items),expansions:Dt(t.expansions,o.expansions)}}),{menus:{},expansions:{},items:[]})},Tk=function(t,e,n,r){var o=Ko("primary-menu"),i=Ek(t,n.shared.providers.menuItems());if(0===i.items.length)return v.none();var u=by(o,i.items,e,n,r),a=xt(i.menus,(function(t,r){return by(r,t,e,n,!1)})),c=Dt(a,Wt(o,u));return v.from(Yg.tieredData(o,c,i.expansions))},Ak=function(t){return{isDisabled:function(){return lv.isDisabled(t)},setDisabled:function(e){return lv.set(t,e)},setActive:function(e){var n=t.element;e?(Ti(n,"tox-tbtn--enabled"),Vo(n,"aria-pressed",!0)):(Bi(n,"tox-tbtn--enabled"),Uo(n,"aria-pressed"))},isActive:function(){return Ni(t.element,"tox-tbtn--enabled")}}},Bk=function(t,e,n,r){return Ck({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch((function(t){r(Tk(t,eh.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:Ak,columns:1,presets:"normal",classes:[],dropdownBehaviours:[$y.config({})]},e,n.shared)},Nk=function(t,e,n){var r=function(t){return function(r){var o=!r.isActive();r.setActive(o),t.storage.set(o),n.shared.getSink().each((function(n){e().getOpt(n).each((function(e){mc(e.element),$r(e,nx,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e(F(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return f(f({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},Dk=function(t,e,n,r,o,i){void 0===n&&(n=[]);var u=e.fold((function(){return{}}),(function(t){return{action:t}})),a=f({buttonBehaviours:ic([Wv((function(){return t.disabled||i.isDisabled()})),jv(),$y.config({}),sg("button press",[to("click"),to("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=Dt(a,{dom:r});return Dt(c,{components:o})},Rk=function(t,e,n,r){void 0===r&&(r=[]);var o={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map((function(t){return{"aria-label":n.translate(t),title:n.translate(t)}})).getOr({})},i=t.icon.map((function(t){return pk(t,n.icons)})),u=Qv([i]);return Dk(t,e,r,o,u,n)},Mk=function(t,e,n,r){void 0===r&&(r=[]);var o=Rk(t,v.some(e),n,r);return sp.sketch(o)},Ik=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),u=t.icon?t.icon.map((function(t){return pk(t,n.icons)})):v.none(),a=u.isSome()?Qv([u]):[],c=u.isSome()?{}:{innerHtml:i},s=d(t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],u.isSome()?["tox-button--icon"]:[],t.borderless?["tox-button--naked"]:[],o),l=f(f({tag:"button",classes:s},c),{attributes:{title:i}});return Dk(t,e,r,l,a,n)},Pk=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=Ik(t,v.some(e),n,r,o);return sp.sketch(i)},Fk=function(t,e){return function(n){"custom"===e?$r(n,nx,{name:t,value:{}}):"submit"===e?Gr(n,rx):"cancel"===e?Gr(n,ex):console.error("Unknown button type: ",e)}},Lk=function(e,n,r){if(function(t,e){return"menu"===e}(0,n)){var o=e,i=f(f({},e),{onSetup:function(n){return n.setDisabled(e.disabled),t},fetch:Nk(o.items,(function(){return u}),r)}),u=fp(Bk(i,"tox-tbtn",r,v.none()));return u.asSpec()}if(function(t,e){return"custom"===e||"cancel"===e||"submit"===e}(0,n)){var a=Fk(e.name,n),c=f(f({},e),{borderless:!1});return Pk(c,a,r.shared.providers,[])}console.error("Unknown footer button type: ",n)},Vk=function(t,e){var n,r,o=Fk(t.name,"custom");return n=v.none(),r=Wy.parts.field(f({factory:sp},Ik(t,v.some(o),e,[vS(""),oS()]))),Yy(n,r,[],[])},Hk=n([Ke("field1Name","field1"),Ke("field2Name","field2"),va("onLockedChange"),ma(["lockClass"]),Ke("locked",!1),Uf("coupledFieldBehaviours",[Jl,Vf])]),zk=function(t,e){return pl({factory:Wy,name:t,overrides:function(t){return{fieldBehaviours:ic([sg("coupled-input-behaviour",[eo(gr(),(function(n){(function(t,e,n){return Al(t,e,n).bind(Jl.getCurrent)})(n,t,e).each((function(e){Al(n,t,"lock").each((function(r){_g.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},jk=n([zk("field1","field2"),zk("field2","field1"),pl({factory:sp,schema:[Ie("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:ic([_g.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),Uk=ql({name:"FormCoupledInputs",configFields:Hk(),partFields:jk(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:Wf(t.coupledFieldBehaviours,[Jl.config({find:v.some}),Vf.config({store:{mode:"manual",getValue:function(e){var n,r=Ml(e,t,["field1","field2"]);return(n={})[t.field1Name]=Vf.getValue(r.field1()),n[t.field2Name]=Vf.getValue(r.field2()),n},setValue:function(e,n){var r=Ml(e,t,["field1","field2"]);Tt(n,t.field1Name)&&Vf.setValue(r.field1(),n[t.field1Name]),Tt(n,t.field2Name)&&Vf.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return Al(e,t,"field1")},getField2:function(e){return Al(e,t,"field2")},getLock:function(e){return Al(e,t,"lock")}}}},apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),Wk=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null!==e){var n=parseFloat(e[1]),r=e[2];return ot.value({value:n,unit:r})}return ot.error(t)},qk=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return Object.prototype.hasOwnProperty.call(n,t)};return t.unit===e?v.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?v.some(t.value):v.some(t.value/n[t.unit]*n[e]):v.none()},Gk=function(t){return v.none()},$k=function(t,e){var n,r,o,i=Wk(t).toOptional(),u=Wk(e).toOptional();return(n=i,r=u,o=function(t,e){return qk(t,e.unit).map((function(t){return e.value/t})).map((function(t){return function(t,e){return function(n){return qk(n,e).map((function(n){return{value:n*t,unit:e}}))}}(t,e.unit)})).getOr(Gk)},n.isSome()&&r.isSome()?v.some(o(n.getOrDie(),r.getOrDie())):v.none()).getOr(Gk)},Xk=function(t,e){var n=Gk,r=Ko("ratio-event"),o=Uk.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(t.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:dp("lock",e.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:dp("unlock",e.icons)}}],buttonBehaviours:ic([lv.config({disabled:function(){return t.disabled||e.isDisabled()}}),jv(),$y.config({})])}),i=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},u=function(n){return Wy.parts.field({factory:mx,inputClasses:["tox-textfield"],inputBehaviours:ic([lv.config({disabled:function(){return t.disabled||e.isDisabled()}}),jv(),$y.config({}),sg("size-input-events",[eo(fr(),(function(t,e){$r(t,r,{isField1:n})})),eo(pr(),(function(e,n){$r(e,Zy,{name:t.name})}))])]),selectOnFocus:!1})},a=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},c=Uk.parts.field1(i([Wy.parts.label(a("Width")),u(!0)])),s=Uk.parts.field2(i([Wy.parts.label(a("Height")),u(!1)]));return Uk.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,i([a("&nbsp;"),o])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){Wk(Vf.getValue(t)).each((function(t){n(t).each((function(t){Vf.setValue(e,function(t){var e,n={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},r=t.value.toFixed((e=t.unit)in n?n[e]:1);return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+t.unit}(t))}))}))},coupledFieldBehaviours:ic([lv.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){Uk.getField1(t).bind(Wy.getField).each(lv.disable),Uk.getField2(t).bind(Wy.getField).each(lv.disable),Uk.getLock(t).each(lv.disable)},onEnabled:function(t){Uk.getField1(t).bind(Wy.getField).each(lv.enable),Uk.getField2(t).bind(Wy.getField).each(lv.enable),Uk.getLock(t).each(lv.enable)}}),jv(),sg("size-input-events2",[eo(r,(function(t,e){var r=e.event.isField1,o=r?Uk.getField1(t):Uk.getField2(t),i=r?Uk.getField2(t):Uk.getField1(t),u=o.map(Vf.getValue).getOr(""),a=i.map(Vf.getValue).getOr("");n=$k(u,a)}))])])})},Yk={undo:n(Ko("undo")),redo:n(Ko("redo")),zoom:n(Ko("zoom")),back:n(Ko("back")),apply:n(Ko("apply")),swap:n(Ko("swap")),transform:n(Ko("transform")),tempTransform:n(Ko("temp-transform")),transformApply:n(Ko("transform-apply"))},Kk=n("save-state"),Jk=n("disable"),Qk=n("enable"),Zk={formActionEvent:nx,saveState:Kk,disable:Jk,enable:Qk},tO=function(e,r){var o=function(t,e,n,o){return fp(Pk({name:t,text:t,disabled:n,primary:o,icon:v.none(),borderless:!1},e,r))},i=function(t,e,n,o){return fp(Mk({name:t,icon:v.some(t),tooltip:v.some(e),disabled:o,primary:!1,borderless:!1},n,r))},u=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(lv)&&lv.disable(n)}))},a=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(lv)&&lv.enable(n)}))},c={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},s=t,f=function(t,e,n){$r(t,e,n)},l=function(t){return Gr(t,Zk.disable())},d=function(t){return Gr(t,Zk.enable())},m=function(t,e){l(t),f(t,Yk.transform(),{transform:e}),d(t)},g=function(t){return function(){et.getOpt(t).each((function(t){cg.set(t,[Z])}))}},p=function(t,e){l(t),f(t,Yk.transformApply(),{transform:e,swap:g(t)}),d(t)},h=function(){return o("Back",(function(t){return f(t,Yk.back(),{swap:g(t)})}),!1,!1)},b=function(){return fp({dom:{tag:"div",classes:["tox-spacer"]},behaviours:ic([lv.config({})])})},y=function(){return o("Apply",(function(t){return f(t,Yk.apply(),{swap:g(t)})}),!0,!0)},x=function(){return function(t){var n=e.getRect();return function(t,e,n,r,o){return ok(t,e,n,r,o)}(t,n.x,n.y,n.w,n.h)}},w=[h(),b(),o("Apply",(function(t){var n=x();p(t,n),e.hideCrop()}),!1,!0)],C=Hy.sketch({dom:c,components:w.map((function(t){return t.asSpec()})),containerBehaviours:ic([sg("image-tools-crop-buttons-events",[eo(Zk.disable(),(function(t,e){u(w,t)})),eo(Zk.enable(),(function(t,e){a(w,t)}))])])}),S=fp(Xk({name:"size",label:v.none(),constrain:!0,disabled:!1},r)),k=[h(),b(),S,b(),o("Apply",(function(t){S.getOpt(t).each((function(e){var n=Vf.getValue(e),r=function(t,e){return function(n){return dk(n,t,e)}}(parseInt(n.width,10),parseInt(n.height,10));p(t,r)}))}),!1,!0)],O=Hy.sketch({dom:c,components:k.map((function(t){return t.asSpec()})),containerBehaviours:ic([sg("image-tools-resize-buttons-events",[eo(Zk.disable(),(function(t,e){u(k,t)})),eo(Zk.enable(),(function(t,e){a(k,t)}))])])}),_=function(t,e){return function(n){return t(n,e)}},E=_(lk,"h"),T=_(lk,"v"),A=_(mk,-90),B=_(mk,90),N=function(t,e){!function(t,e){l(t),f(t,Yk.tempTransform(),{transform:e}),d(t)}(t,e)},D=[h(),b(),i("flip-horizontally","Flip horizontally",(function(t){N(t,E)}),!1),i("flip-vertically","Flip vertically",(function(t){N(t,T)}),!1),i("rotate-left","Rotate counterclockwise",(function(t){N(t,A)}),!1),i("rotate-right","Rotate clockwise",(function(t){N(t,B)}),!1),b(),y()],R=Hy.sketch({dom:c,components:D.map((function(t){return t.asSpec()})),containerBehaviours:ic([sg("image-tools-fliprotate-buttons-events",[eo(Zk.disable(),(function(t,e){u(D,t)})),eo(Zk.enable(),(function(t,e){a(D,t)}))])])}),M=function(t,e,o,i,u){var a=WC.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:r.translate(t)}}),c=WC.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),s=WC.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return fp(WC.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:o,maxX:u,getInitialValue:n({x:i})},components:[a,c,s],sliderBehaviours:ic([gg.config({})]),onChoose:e}))},I=function(t,e,n,r,o){return M(t,(function(t,n,r){var o=_(e,r.x/100);m(t,o)}),n,r,o)},P=function(t,e,n,r,o){var i=function(t,e,n,r,o){return[h(),I(t,e,n,r,o),y()]}(t,e,n,r,o);return Hy.sketch({dom:c,components:i.map((function(t){return t.asSpec()})),containerBehaviours:ic([sg("image-tools-filter-panel-buttons-events",[eo(Zk.disable(),(function(t,e){u(i,t)})),eo(Zk.enable(),(function(t,e){a(i,t)}))])])})},F=[h(),b(),y()],L=Hy.sketch({dom:c,components:F.map((function(t){return t.asSpec()}))}),V=P("Brightness",sk,-100,0,100),H=P("Contrast",fk,-100,0,100),z=P("Gamma",ck,-100,0,100),j=function(t,e,n){return function(r){return function(t,e,n,r){return QS(t,e,n,r)}(r,t,e,n)}},U=function(t){return M(t,(function(t,e,n){var r=W.getOpt(t),o=G.getOpt(t),i=q.getOpt(t);r.each((function(e){o.each((function(n){i.each((function(r){var o=Vf.getValue(e).x/100,i=Vf.getValue(r).x/100,u=Vf.getValue(n).x/100,a=j(o,i,u);m(t,a)}))}))}))}),0,100,200)},W=U("R"),q=U("G"),G=U("B"),$=[h(),W,q,G,y()],X=Hy.sketch({dom:c,components:$.map((function(t){return t.asSpec()}))}),Y=function(t,e,n){return function(r){f(r,Yk.swap(),{transform:e,swap:function(){et.getOpt(r).each((function(e){cg.set(e,[t]),n(e)}))}})}},K=v.some(ak),J=v.some(uk),Q=[i("crop","Crop",Y(C,v.none(),(function(t){e.showCrop()})),!1),i("resize","Resize",Y(O,v.none(),(function(t){S.getOpt(t).each((function(t){var n=e.getMeasurements(),r=n.width,o=n.height;Vf.setValue(t,{width:r,height:o})}))})),!1),i("orientation","Orientation",Y(R,v.none(),s),!1),i("brightness","Brightness",Y(V,v.none(),s),!1),i("sharpen","Sharpen",Y(L,K,s),!1),i("contrast","Contrast",Y(H,v.none(),s),!1),i("color-levels","Color levels",Y(X,v.none(),s),!1),i("gamma","Gamma",Y(z,v.none(),s),!1),i("invert","Invert",Y(L,J,s),!1)],Z=Hy.sketch({dom:c,components:Q.map((function(t){return t.asSpec()}))}),tt=Hy.sketch({dom:{tag:"div"},components:[Z],containerBehaviours:ic([cg.config({})])}),et=fp(tt);return{memContainer:et,getApplyButton:function(t){return et.getOpt(t).map((function(t){var e=t.components()[0];return e.components()[e.components().length-1]}))}}},eO=tinymce.util.Tools.resolve("tinymce.geom.Rect"),nO=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),rO=tinymce.util.Tools.resolve("tinymce.util.Observable"),oO=tinymce.util.Tools.resolve("tinymce.util.VK");function iO(t){var e,n;if(t.changedTouches)for(e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]}function uO(t,e){var n,r,o,i,u=e.document||document,a=u.getElementById(e.handle||t),c=function(t){if(iO(t),t.button!==r)return s(t);t.deltaX=t.screenX-o,t.deltaY=t.screenY-i,t.preventDefault(),e.drag(t)},s=function(t){iO(t),nO(u).off("mousemove touchmove",c).off("mouseup touchend",s),n.remove(),e.stop&&e.stop(t)};this.destroy=function(){nO(a).off()},nO(a).on("mousedown touchstart",(function(t){var f,l=function(t){var e=Math.max,n=t.documentElement,r=t.body,o=e(n.scrollWidth,r.scrollWidth),i=e(n.clientWidth,r.clientWidth),u=e(n.offsetWidth,r.offsetWidth),a=e(n.scrollHeight,r.scrollHeight),c=e(n.clientHeight,r.clientHeight);return{width:o<u?i:o,height:a<e(n.offsetHeight,r.offsetHeight)?c:a}}(u);iO(t),t.preventDefault(),r=t.button;var d=a;o=t.screenX,i=t.screenY,f=window.getComputedStyle?window.getComputedStyle(d,null).getPropertyValue("cursor"):d.runtimeStyle.cursor,n=nO("<div></div>").css({position:"absolute",top:0,left:0,width:l.width,height:l.height,zIndex:2147483647,opacity:1e-4,cursor:f}).appendTo(u.body),nO(u).on("mousemove touchmove",c).on("mouseup touchend",s),e.start(t)}))}var aO=0,cO=function(t,e,n,r,o){var i,u="tox-crid-"+aO++,a=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],c=["top","right","bottom","left"],s=function(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}};function f(e,r,o,i){var u,a,c,f,l;u=r.x,a=r.y,c=r.w,f=r.h,u+=o*e.deltaX,a+=i*e.deltaY,(c+=o*e.deltaW)<20&&(c=20),(f+=i*e.deltaH)<20&&(f=20),l=t=eO.clamp({x:u,y:a,w:c,h:f},n,"move"===e.name),l=s(n,l),g.fire("updateRect",{rect:l}),m(l)}function l(t){function n(t,e){e.h<0&&(e.h=0),e.w<0&&(e.w=0),nO("#"+u+"-"+t,r).css({left:e.x,top:e.y,width:e.w,height:e.h})}fS.each(a,(function(e){nO("#"+u+"-"+e.name,r).css({left:t.w*e.xMul+t.x,top:t.h*e.yMul+t.y})})),n("top",{x:e.x,y:e.y,w:e.w,h:t.y-e.y}),n("right",{x:t.x+t.w,y:t.y,w:e.w-t.x-t.w+e.x,h:t.h}),n("bottom",{x:e.x,y:t.y+t.h,w:e.w,h:e.h-t.y-t.h+e.y}),n("left",{x:e.x,y:t.y,w:t.x-e.x,h:t.h}),n("move",t)}function d(e){l(t=e)}function m(t){var e,r;d((e=n,{x:(r=t).x+e.x,y:r.y+e.y,w:r.w,h:r.h}))}nO('<div id="'+u+'" class="tox-croprect-container" role="grid" aria-dropeffect="execute">').appendTo(r),fS.each(c,(function(t){nO("#"+u,r).append('<div id="'+u+"-"+t+'"class="tox-croprect-block" style="display: none" data-mce-bogus="all">')})),fS.each(a,(function(t){nO("#"+u,r).append('<div id="'+u+"-"+t.name+'" class="tox-croprect-handle tox-croprect-handle-'+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false" title="'+t.label+'">')})),i=fS.map(a,(function(e){var n;return new uO(u,{document:r.ownerDocument,handle:u+"-"+e.name,start:function(){n=t},drag:function(t){f(e,n,t.deltaX,t.deltaY)}})})),l(t),nO(r).on("focusin focusout",(function(t){nO(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")})),nO(r).on("keydown",(function(e){var n;function r(t,e,r,o,i){t.stopPropagation(),t.preventDefault(),f(n,r,o,i)}switch(fS.each(a,(function(t){if(e.target.id===u+"-"+t.name)return n=t,!1})),e.keyCode){case oO.LEFT:r(e,0,t,-10,0);break;case oO.RIGHT:r(e,0,t,10,0);break;case oO.UP:r(e,0,t,0,-10);break;case oO.DOWN:r(e,0,t,0,10);break;case oO.ENTER:case oO.SPACEBAR:e.preventDefault(),o()}}));var g=fS.extend({toggleVisibility:function(t){var e=fS.map(a,(function(t){return"#"+u+"-"+t.name})).concat(fS.map(c,(function(t){return"#"+u+"-"+t}))).join(",");t?nO(e,r).show():nO(e,r).hide()},setClampRect:function(e){n=e,l(t)},setRect:d,getInnerRect:function(){return s(n,t)},setInnerRect:m,setViewPortRect:function(n){e=n,l(t)},destroy:function(){fS.each(i,(function(t){t.destroy()})),i=[]}},rO);return g},sO=function(t){var e=fp({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),n=an(1),r=an(v.none()),o=an({x:0,y:0,w:1,h:1}),i=an({x:0,y:0,w:1,h:1}),u=function(t,i){s.getOpt(t).each((function(t){var u=n.get(),a=Tu(t.element),c=xu(t.element),s=i.dom.naturalWidth*u,f=i.dom.naturalHeight*u,l=Math.max(0,a/2-s/2),d=Math.max(0,c/2-f/2),m={left:l.toString()+"px",top:d.toString()+"px",width:s.toString()+"px",height:f.toString()+"px",position:"absolute"};Yi(i,m),e.getOpt(t).each((function(t){Yi(t.element,m)})),r.get().each((function(t){var e=o.get();t.setRect({x:e.x*u+l,y:e.y*u+d,w:e.w*u,h:e.h*u}),t.setClampRect({x:l,y:d,w:s,h:f}),t.setViewPortRect({x:0,y:0,w:a,h:c})}))}))},a=function(t,e){var r,a=sn.fromTag("img");return Vo(a,"src",e),(r=a.dom,new Ap((function(t){var e=function(){r.removeEventListener("load",e),t(r)};r.complete?t(r):r.addEventListener("load",e)}))).then((function(){return s.getOpt(t).map((function(t){var e=gu({element:a});cg.replaceAt(t,1,v.some(e));var r=i.get(),c={x:0,y:0,w:a.dom.naturalWidth,h:a.dom.naturalHeight};i.set(c);var f=eO.inflate(c,-20,-20);return o.set(f),r.w===c.w&&r.h===c.h||function(t,e){s.getOpt(t).each((function(t){var r=Tu(t.element),o=xu(t.element),i=e.dom.naturalWidth,u=e.dom.naturalHeight,a=Math.min(r/i,o/u);a>=1?n.set(1):n.set(a)}))}(t,a),u(t,a),a}))}))},c=Hy.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[e.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:ic([sg("image-panel-crop-events",[so((function(t){s.getOpt(t).each((function(t){var e=t.element.dom,i=cO({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},e,(function(){}));i.toggleVisibility(!1),i.on("updateRect",(function(t){var e=t.rect,r=n.get(),i={x:Math.round(e.x/r),y:Math.round(e.y/r),w:Math.round(e.w/r),h:Math.round(e.h/r)};o.set(i)})),r.set(v.some(i))}))}))])])}],containerBehaviours:ic([cg.config({}),sg("image-panel-events",[so((function(e){a(e,t)}))])])}),s=fp(c);return{memContainer:s,updateSrc:a,zoom:function(t,e){var r=n.get(),o=e>0?Math.min(2,r+.1):Math.max(.1,r-.1);n.set(o),s.getOpt(t).each((function(t){var e=t.components()[1].element;u(t,e)}))},showCrop:function(){r.get().each((function(t){t.toggleVisibility(!0)}))},hideCrop:function(){r.get().each((function(t){t.toggleVisibility(!1)}))},getRect:function(){return o.get()},getMeasurements:function(){var t=i.get();return{width:t.w,height:t.h}}}},fO=function(t,e,n,r,o){return Mk({name:t,icon:v.some(e),disabled:n,tooltip:v.some(t),primary:!1,borderless:!1},r,o)},lO=function(t,e){e?lv.enable(t):lv.disable(t)};var dO,mO=function(t){var e=an(t),n=an(v.none()),r=function(){var t=[],e=-1;function n(){return e>0}function r(){return-1!==e&&e<t.length-1}return{data:t,add:function(n){var r=t.splice(++e);return t.push(n),{state:n,removed:r}},undo:function(){if(n())return t[--e]},redo:function(){if(r())return t[++e]},canUndo:n,canRedo:r}}();r.add(t);var o=function(t){e.set(t)},i=function(t){return{blob:t,url:URL.createObjectURL(t)}},u=function(t){URL.revokeObjectURL(t.url)},a=function(){n.get().each(u),n.set(v.none())},c=function(t){var e=i(t);o(e);var n,a=r.add(e).removed;return n=a,fS.each(n,u),e.url};return{getBlobState:function(){return e.get()},setBlobState:o,addBlobState:c,getTempState:function(){return n.get().fold((function(){return e.get()}),(function(t){return t}))},updateTempState:function(t){var e=i(t);return a(),n.set(v.some(e)),e.url},addTempState:function(t){var e=i(t);return n.set(v.some(e)),e.url},applyTempState:function(t){return n.get().fold((function(){}),(function(e){c(e.blob),t()}))},destroyTempState:a,undo:function(){var t=r.undo();return o(t),t.url},redo:function(){var t=r.redo();return o(t),t.url},getHistoryStates:function(){return{undoEnabled:r.canUndo(),redoEnabled:r.canRedo()}}}},gO=function(e,n){var r=mO(e.currentState),o=function(t){var e=r.getHistoryStates();m.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),$r(t,Zk.formActionEvent,{name:Zk.saveState(),value:e.undoEnabled})},i=function(t){return t.toBlob()},u=function(t){$r(t,Zk.formActionEvent,{name:Zk.disable(),value:{}})},a=function(t){g.getApplyButton(t).each((function(t){lv.enable(t)})),$r(t,Zk.formActionEvent,{name:Zk.enable(),value:{}})},c=function(t,e){return u(t),d.updateSrc(t,e)},s=function(t,e,n,r,s){return u(t),function(t){return VS(t)}(e).then(n).then(i).then(r).then((function(e){return c(t,e).then((function(e){return o(t),s(),a(t),e}))})).catch((function(e){return console.log(e),a(t),e}))},f=function(t,e,n){var o=r.getBlobState().blob;s(t,o,e,(function(t){return r.updateTempState(t)}),n)},l=function(t){var e=r.getBlobState().url;return r.destroyTempState(),o(t),e},d=sO(e.currentState.url),m=function(t){var e=fp(fO("Undo","undo",!0,(function(t){$r(t,Yk.undo(),{direction:1})}),t)),n=fp(fO("Redo","redo",!0,(function(t){$r(t,Yk.redo(),{direction:1})}),t));return{container:Hy.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[e.asSpec(),n.asSpec(),fO("Zoom in","zoom-in",!1,(function(t){$r(t,Yk.zoom(),{direction:1})}),t),fO("Zoom out","zoom-out",!1,(function(t){$r(t,Yk.zoom(),{direction:-1})}),t)]}),updateButtonUndoStates:function(t,r,o){e.getOpt(t).each((function(t){lO(t,r)})),n.getOpt(t).each((function(t){lO(t,o)}))}}}(n),g=tO(d,n);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[g.memContainer.asSpec(),d.memContainer.asSpec(),m.container],behaviours:ic([Vf.config({store:{mode:"manual",getValue:function(){return r.getBlobState()}}}),sg("image-tools-events",[eo(Yk.undo(),(function(t,e){var n=r.undo();c(t,n).then((function(e){a(t),o(t)}))})),eo(Yk.redo(),(function(t,e){var n=r.redo();c(t,n).then((function(e){a(t),o(t)}))})),eo(Yk.zoom(),(function(t,e){var n=e.event.direction;d.zoom(t,n)})),eo(Yk.back(),(function(t,e){!function(t){var e=l(t);c(t,e).then((function(e){a(t)}))}(t),(0,e.event.swap)(),d.hideCrop()})),eo(Yk.apply(),(function(t,e){r.applyTempState((function(){l(t),(0,e.event.swap)()}))})),eo(Yk.transform(),(function(e,n){return f(e,n.event.transform,t)})),eo(Yk.tempTransform(),(function(e,n){return function(e,n){var o=r.getTempState().blob;s(e,o,n,(function(t){return r.addTempState(t)}),t)}(e,n.event.transform)})),eo(Yk.transformApply(),(function(t,e){return function(t,e,n){var o=r.getBlobState().blob;s(t,o,e,(function(e){var n=r.addBlobState(e);return l(t),n}),n)}(t,e.event.transform,e.event.swap)})),eo(Yk.swap(),(function(t,e){!function(t){m.updateButtonUndoStates(t,!1,!1)}(t);var n=e.event.transform,r=e.event.swap;n.fold((function(){r()}),(function(e){f(t,e,r)}))}))]),oS()])}},pO=function(t){return!Et(t,"items")},hO="data-value",vO=function(t,e,n,r){return F(n,(function(n){return pO(n)?{type:"togglemenuitem",text:n.text,value:n.value,active:n.value===r,onAction:function(){Vf.setValue(t,n.value),$r(t,Zy,{name:e}),gg.focus(t)}}:{type:"nestedmenuitem",text:n.text,getSubmenuItems:function(){return vO(t,e,n.items,r)}}}))},bO=function(t,e){return et(t,(function(t){return pO(t)?$l(t.value===e,t):bO(t.items,e)}))},yO=Wl({name:"HtmlSelect",configFields:[Ie("options"),Hf("selectBehaviours",[gg,Vf]),Ke("selectClasses",[]),Ke("selectAttributes",{}),We("data")],factory:function(t,e){var n=F(t.options,(function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}})),r=t.data.map((function(t){return Wt("initialValue",t)})).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:n,behaviours:jf(t.selectBehaviours,[gg.config({}),Vf.config({store:f({mode:"manual",getValue:function(t){return ou(t.element)},setValue:function(e,n){U(t.options,(function(t){return t.value===n})).isSome()&&iu(e.element,n)}},r)})])}}}),xO=function(t,e){var r=t.label.map((function(t){return Qy(t,e)})),o=[lv.config({disabled:function(){return t.disabled||e.isDisabled()}}),jv(),rg.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return Gr(t,rx),v.some(!0)}}),sg("textfield-change",[eo(gr(),(function(e,n){$r(e,Zy,{name:t.name})})),eo(Sr(),(function(e,n){$r(e,Zy,{name:t.name})}))]),$y.config({})],i=t.validation.map((function(t){return Rx.config({getRoot:function(t){return ko(t.element)},invalidClass:"tox-invalid",validator:{validate:function(e){var n=Vf.getValue(e),r=t.validator(n);return Sx(!0===r?ot.value(n):ot.error(r))},validateOnLoad:t.validateOnLoad}})})).toArray(),u=t.placeholder.fold(n({}),(function(t){return{placeholder:e.translate(t)}})),a=t.inputMode.fold(n({}),(function(t){return{inputmode:t}})),c=f(f({},u),a),s=Wy.parts.field({tag:!0===t.multiline?"textarea":"input",inputAttributes:c,inputClasses:[t.classname],inputBehaviours:ic(q([o,i])),selectOnFocus:!1,factory:mx}),l=(t.flex?["tox-form__group--stretched"]:[]).concat(t.maximized?["tox-form-group--maximize"]:[]),d=[lv.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){Wy.getField(t).each(lv.disable)},onEnabled:function(t){Wy.getField(t).each(lv.enable)}}),jv()];return Yy(r,s,l,d)},wO=Object.freeze({__proto__:null,events:function(t,e){var n=t.stream.streams.setup(t,e);return Qr([eo(t.event,n),fo((function(){return e.cancel()}))].concat(t.cancelEvent.map((function(t){return[eo(t,(function(){return e.cancel()}))]})).getOr([])))}}),CO=function(t){var e=an(null);return mi({readState:function(){return{timer:null!==e.get()?"set":"unset"}},setTimer:function(t){e.set(t)},cancel:function(){var t=e.get();null!==t&&t.cancel()}})},SO=Object.freeze({__proto__:null,throttle:CO,init:function(t){return t.stream.streams.state(t)}}),kO=[Pe("stream",Oe("mode",{throttle:[Ie("delay"),Ke("stopEvent",!0),ya("streams",{setup:function(t,e){var n=t.stream,r=bp(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},state:CO})]})),Ke("event","input"),We("cancelEvent"),va("onStream")],OO=ac({fields:kO,name:"streaming",active:wO,state:SO}),_O=function(t,e,n){var r=Vf.getValue(n);Vf.setValue(e,r),TO(e)},EO=function(t,e){var n=t.element,r=ou(n),o=n.dom;"number"!==Ho(n,"type")&&e(o,r)},TO=function(t){EO(t,(function(t,e){return t.setSelectionRange(e.length,e.length)}))},AO=function(t,e,n){if(t.selectsOver){var r=Vf.getValue(e),o=t.getDisplayText(r),i=Vf.getValue(n);return 0===t.getDisplayText(i).indexOf(o)?v.some((function(){_O(0,e,n),function(t,e){EO(t,(function(t,n){return t.setSelectionRange(e,n.length)}))}(e,o.length)})):v.none()}return v.none()},BO=n("alloy.typeahead.itemexecute"),NO=n([We("lazySink"),Ie("fetch"),Ke("minChars",5),Ke("responseTime",1e3),pa("onOpen"),Ke("getHotspot",v.some),Ke("getAnchorOverrides",n({})),Ke("layouts",v.none()),Ke("eventOrder",{}),on("model",{},[Ke("getDisplayText",(function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value})),Ke("selectsOver",!0),Ke("populateFromBrowse",!0)]),pa("onSetValue"),ha("onExecute"),pa("onItemExecute"),Ke("inputClasses",[]),Ke("inputAttributes",{}),Ke("inputStyles",{}),Ke("matchWidth",!0),Ke("useMinWidth",!1),Ke("dismissOnBlur",!0),ma(["openClass"]),We("initialData"),Hf("typeaheadBehaviours",[gg,Vf,OO,rg,_g,Px]),un("previewing",(function(){return an(!0)}))].concat(sx()).concat(Xx())),DO=n([hl({schema:[da()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlight:function(e,n){t.previewing.get()?e.getSystem().getByUid(t.uid).each((function(r){AO(t.model,r,n).fold((function(){return cd.dehighlight(e,n)}),(function(t){return t()}))})):e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&_O(t.model,e,n)})),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOptional().map((function(t){return $r(t,BO(),{item:n}),!0}))},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&_O(t.model,e,n)}))}}}})]),RO=ql({name:"Typeahead",configFields:NO(),partFields:DO(),factory:function(e,n,r,o){var i=function(n,r,i){e.previewing.set(!1);var u=Px.getCoupled(n,"sandbox");if(yf.isOpen(u))Jl.getCurrent(u).each((function(t){cd.getHighlighted(t).fold((function(){i(t)}),(function(){Jr(u,t.element,"keydown",r)}))}));else{Hx(e,a(n),n,u,o,(function(t){Jl.getCurrent(t).each(i)}),hx.HighlightFirst).get(t)}},u=fx(e),a=function(t){return function(e){return e.map((function(e){var n=Ot(e.menus),r=G(n,(function(t){return H(t.items,(function(t){return"item"===t.type}))}));return Vf.getState(t).update(F(r,(function(t){return t.data}))),e}))}},c=[gg.config({}),Vf.config({onSetValue:e.onSetValue,store:f({mode:"dataset",getDataKey:function(t){return ou(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(t,n){iu(t.element,e.model.getDisplayText(n))}},e.initialData.map((function(t){return Wt("initialValue",t)})).getOr({}))}),OO.config({stream:{mode:"throttle",delay:e.responseTime,stopEvent:!1},onStream:function(n,r){var i=Px.getCoupled(n,"sandbox");if(gg.isFocused(n)&&ou(n.element).length>=e.minChars){var u=Jl.getCurrent(i).bind((function(t){return cd.getHighlighted(t).map(Vf.getValue)}));e.previewing.set(!0);Hx(e,a(n),n,i,o,(function(t){Jl.getCurrent(i).each((function(t){u.fold((function(){e.model.selectsOver&&cd.highlightFirst(t)}),(function(e){cd.highlightBy(t,(function(t){return Vf.getValue(t).value===e.value})),cd.getHighlighted(t).orThunk((function(){return cd.highlightFirst(t),v.none()}))}))}))}),hx.HighlightFirst).get(t)}},cancelEvent:Br()}),rg.config({mode:"special",onDown:function(t,e){return i(t,e,cd.highlightFirst),v.some(!0)},onEscape:function(t){var e=Px.getCoupled(t,"sandbox");return yf.isOpen(e)?(yf.close(e),v.some(!0)):v.none()},onUp:function(t,e){return i(t,e,cd.highlightLast),v.some(!0)},onEnter:function(t){var n=Px.getCoupled(t,"sandbox"),r=yf.isOpen(n);if(r&&!e.previewing.get())return Jl.getCurrent(n).bind((function(t){return cd.getHighlighted(t)})).map((function(e){return $r(t,BO(),{item:e}),!0}));var o=Vf.getValue(t);return Gr(t,Br()),e.onExecute(n,t,o),r&&yf.close(n),v.some(!0)}}),_g.config({toggleClass:e.markers.openClass,aria:{mode:"expanded"}}),Px.config({others:{sandbox:function(t){return Gx(e,t,{onOpen:function(){return _g.on(t)},onClose:function(){return _g.off(t)}})}}}),sg("typeaheadevents",[mo((function(n){var r=t;jx(e,a(n),n,o,r,hx.HighlightFirst).get(t)})),eo(BO(),(function(t,n){var r=Px.getCoupled(t,"sandbox");_O(e.model,t,n.event.item),Gr(t,Br()),e.onItemExecute(t,r,n.event.item,Vf.getValue(t)),yf.close(r),TO(t)}))].concat(e.dismissOnBlur?[eo(Cr(),(function(t){var e=Px.getCoupled(t,"sandbox");pc(e.element).isNone()&&yf.close(e)}))]:[]))];return{uid:e.uid,dom:dx(Dt(e,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:f(f({},u),jf(e.typeaheadBehaviours,c)),eventOrder:e.eventOrder}}}),MO=function(t){return f(f({},t),{toCached:function(){return MO(t.toCached())},bindFuture:function(e){return MO(t.bind((function(t){return t.fold((function(t){return Sx(ot.error(t))}),(function(t){return e(t)}))})))},bindResult:function(e){return MO(t.map((function(t){return t.bind(e)})))},mapResult:function(e){return MO(t.map((function(t){return t.map(e)})))},mapError:function(e){return MO(t.map((function(t){return t.mapError(e)})))},foldResult:function(e,n){return t.map((function(t){return t.fold(e,n)}))},withTimeout:function(e,n){return MO(Cx((function(r){var o=!1,i=setTimeout((function(){o=!0,r(ot.error(n()))}),e);t.get((function(t){o||(clearTimeout(i),r(t))}))})))}})},IO=function(t){return MO(Cx(t))},PO=IO,FO={type:"separator"},LO=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:function(){}}},VO=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:function(){}}},HO=function(t,e){return function(t){return F(t,LO)}(function(t,e){return H(e,(function(e){return e.type===t}))}(t,e))},zO=function(t){return HO("header",t.targets)},jO=function(t){return HO("anchor",t.targets)},UO=function(t){return v.from(t.anchorTop).map((function(t){return VO("<top>",t)})).toArray()},WO=function(t){return v.from(t.anchorBottom).map((function(t){return VO("<bottom>",t)})).toArray()},qO=function(t,e){var n=t.toLowerCase();return H(e,(function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return hn(e.toLowerCase(),n)||hn(t.value.toLowerCase(),n)}))},GO=function(t,e,n){var r=Vf.getValue(e),o=void 0!==r.meta.text?r.meta.text:r.value;return n.getLinkInformation().fold((function(){return[]}),(function(e){var r,i=qO(o,function(t){return F(t,(function(t){return VO(t,t)}))}(n.getHistory(t)));return"file"===t?(r=[i,qO(o,zO(e)),qO(o,q([UO(e),jO(e),WO(e)]))],j(r,(function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(FO,e)}),[])):i}))},$O=Ko("aria-invalid"),XO=function(t){return function(e,n,r){return _t(n,"name").fold((function(){return t(n,r)}),(function(o){return e.field(o,t(n,r))}))}},YO={bar:XO((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:F(t.items,e.interpreter)}}(t,e.shared)})),collection:XO((function(t,e){return cx(t,e.shared.providers)})),alertbanner:XO((function(t,e){return function(t,e){return Hy.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+t.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[sp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:dp(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){$r(e,nx,{name:"alert-banner",value:t.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})}(t,e.shared.providers)})),input:XO((function(t,e){return function(t,e){return xO({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:v.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),textarea:XO((function(t,e){return function(t,e){return xO({name:t.name,multiline:!0,label:t.label,inputMode:v.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:v.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),label:XO((function(t,e){return function(t,e){var n={dom:{tag:"label",innerHtml:e.providers.translate(t.label),classes:["tox-label"]}},r=F(t.items,e.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(r),behaviours:ic([oS(),cg.config({}),hS(v.none()),rg.config({mode:"acyclic"})])}}(t,e.shared)})),iframe:function(t){return function(e,n,r){var o=Dt(n,{source:"dynamic"});return XO(t)(e,o,r)}}((function(t,e){return ES(t,e.shared.providers)})),button:XO((function(t,e){return Vk(t,e.shared.providers)})),checkbox:XO((function(t,e){return function(t,e){var n=Vf.config({store:{mode:"manual",getValue:function(t){return t.element.dom.checked},setValue:function(t,e){t.element.dom.checked=e}}}),o=function(t){return t.element.dom.click(),v.some(!0)},i=Wy.parts.field({factory:{sketch:r},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:ic([oS(),lv.config({disabled:function(){return t.disabled||e.isDisabled()}}),$y.config({}),gg.config({}),n,rg.config({mode:"special",onEnter:o,onSpace:o,stopSpaceKeyup:!0}),sg("checkbox-events",[eo(pr(),(function(e,n){$r(e,Zy,{name:t.name})}))])])}),u=Wy.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:ic([Zx.config({})])}),a=function(t){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t],innerHtml:dp("checked"===t?"selected":"unselected",e.icons)}}},c=fp({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[a("checked"),a("unchecked")]});return Wy.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[i,c.asSpec(),u],fieldBehaviours:ic([lv.config({disabled:function(){return t.disabled||e.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){Wy.getField(t).each(lv.disable)},onEnabled:function(t){Wy.getField(t).each(lv.enable)}}),jv()])})}(t,e.shared.providers)})),colorinput:XO((function(t,e){return rw(t,e.shared,e.colorinput)})),colorpicker:XO((function(t){var e=function(t){return"tox-"+t},n=rS(cS,e),r=fp(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){$r(t,nx,{name:"hex-valid",value:!0})},onInvalidHex:function(t){$r(t,nx,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:ic([Vf.config({store:{mode:"manual",getValue:function(t){var e=r.get(t);return Jl.getCurrent(e).bind((function(t){return Vf.getValue(t).hex})).map((function(t){return"#"+t})).getOr("")},setValue:function(t,e){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(e),o=r.get(t);Jl.getCurrent(o).fold((function(){console.log("Can not find form")}),(function(t){Vf.setValue(t,{hex:v.from(n[1]).getOr("")}),KC.getField(t,"hex").each((function(t){Gr(t,gr())}))}))}}}),oS()])}})),dropzone:XO((function(t,e){return bS(t,e.shared.providers)})),grid:XO((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:F(t.items,e.interpreter)}}(t,e.shared)})),listbox:XO((function(e,r){return function(e,r){var o=r.shared.providers,i=Q(e.items).filter(pO),u=e.label.map((function(t){return Qy(t,o)})),a={dom:{tag:"div",classes:["tox-listboxfield"]},components:[Wy.parts.field({dom:{},factory:{sketch:function(o){return Ck({uid:o.uid,text:i.map((function(t){return t.text})),icon:v.none(),tooltip:e.label,role:v.none(),fetch:function(t,n){var o=vO(t,e.name,e.items,Vf.getValue(t));n(Tk(o,eh.CLOSE_ON_EXECUTE,r,!1))},onSetup:n(t),getApi:n({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[$y.config({}),Vf.config({store:{mode:"manual",initialValue:i.map((function(t){return t.value})).getOr(""),getValue:function(t){return Ho(t.element,hO)},setValue:function(t,n){bO(e.items,n).each((function(e){Vo(t.element,hO,e.value),$r(t,xk,{text:e.text})}))}}})]},"tox-listbox",r.shared)}}})]};return Wy.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:q([u.toArray(),[a]]),fieldBehaviours:ic([lv.config({disabled:n(e.disabled),onDisabled:function(t){Wy.getField(t).each(lv.disable)},onEnabled:function(t){Wy.getField(t).each(lv.enable)}})])})}(e,r)})),selectbox:XO((function(t,e){return function(t,e){var n=F(t.items,(function(t){return{text:e.translate(t.text),value:t.value}})),r=t.label.map((function(t){return Qy(t,e)})),o=Wy.parts.field({dom:{},selectAttributes:{size:t.size},options:n,factory:yO,selectBehaviours:ic([lv.config({disabled:function(){return t.disabled||e.isDisabled()}}),$y.config({}),sg("selectbox-change",[eo(pr(),(function(e,n){$r(e,Zy,{name:t.name})}))])])}),i=t.size>1?v.none():v.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:dp("chevron-down",e.icons)}}),u={dom:{tag:"div",classes:["tox-selectfield"]},components:q([[o],i.toArray()])};return Wy.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:q([r.toArray(),[u]]),fieldBehaviours:ic([lv.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){Wy.getField(t).each(lv.disable)},onEnabled:function(t){Wy.getField(t).each(lv.enable)}}),jv()])})}(t,e.shared.providers)})),sizeinput:XO((function(t,e){return Xk(t,e.shared.providers)})),urlinput:XO((function(e,n){return function(e,n,r){var o,i=n.shared.providers,u=function(t){var n=Vf.getValue(t);r.addToHistory(n.value,e.filetype)},a=Wy.parts.field({factory:RO,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":$O,type:"url"},minChars:0,responseTime:0,fetch:function(t){var o=GO(e.filetype,t,r),i=Tk(o,eh.BUBBLE_TO_SANDBOX,n,!1);return Sx(i)},getHotspot:function(t){return g.getOpt(t)},onSetValue:function(e,n){e.hasConfigured(Rx)&&Rx.run(e).get(t)},typeaheadBehaviours:ic(q([r.getValidationHandler().map((function(t){return Rx.config({getRoot:function(t){return ko(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){s.getOpt(t).each((function(t){Vo(t.element,"title",i.translate(e))}))}},validator:{validate:function(n){var r=Vf.getValue(n);return PO((function(n){t({type:e.filetype,url:r.value},(function(t){if("invalid"===t.status){var e=ot.error(t.message);n(e)}else{var r=ot.value(t.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[lv.config({disabled:function(){return e.disabled||i.isDisabled()}}),$y.config({}),sg("urlinput-events",q(["file"===e.filetype?[eo(gr(),(function(t){$r(t,Zy,{name:e.name})}))]:[],[eo(pr(),(function(t){$r(t,Zy,{name:e.name}),u(t)})),eo(Sr(),(function(t){$r(t,Zy,{name:e.name}),u(t)}))]]))]])),eventOrder:(o={},o[gr()]=["streaming","urlinput-events","invalidating"],o),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:n.shared.getSink,parts:{menu:bh(0,0,"normal")},onExecute:function(t,e,n){$r(e,rx,{})},onItemExecute:function(t,n,r,o){u(t),$r(t,Zy,{name:e.name})}}),c=e.label.map((function(t){return Qy(t,i)})),s=fp(function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],innerHtml:dp(n,i.icons),attributes:f({title:i.translate(r),"aria-live":"polite"},e.fold((function(){return{}}),(function(t){return{id:t}})))}}}("invalid",v.some($O),"warning")),l=fp({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[s.asSpec()]}),d=r.getUrlPicker(e.filetype),m=Ko("browser.url.event"),g=fp({dom:{tag:"div",classes:["tox-control-wrap"]},components:[a,l.asSpec()],behaviours:ic([lv.config({disabled:function(){return e.disabled||i.isDisabled()}})])}),p=fp(Pk({name:e.name,icon:v.some("browse"),text:e.label.getOr(""),disabled:e.disabled,primary:!1,borderless:!0},(function(t){return Gr(t,m)}),i,[],["tox-browse-url"]));return Wy.sketch({dom:Jy([]),components:c.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:q([[g.asSpec()],d.map((function(){return p.asSpec()})).toArray()])}]),fieldBehaviours:ic([lv.config({disabled:function(){return e.disabled||i.isDisabled()},onDisabled:function(t){Wy.getField(t).each(lv.disable),p.getOpt(t).each(lv.disable)},onEnabled:function(t){Wy.getField(t).each(lv.enable),p.getOpt(t).each(lv.enable)}}),jv(),sg("url-input-events",[eo(m,(function(t){Jl.getCurrent(t).each((function(n){var r=Vf.getValue(n),o=f({fieldname:e.name},r);d.each((function(r){r(o).get((function(r){Vf.setValue(n,r),$r(t,Zy,{name:e.name})}))}))}))}))])])})}(e,n,n.urlinput)})),customeditor:XO((function(t){var e=an(v.none()),n=fp({dom:{tag:t.tag}}),r=an(v.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:ic([sg("custom-editor-events",[so((function(o){n.getOpt(o).each((function(n){(!function(t){return Object.prototype.hasOwnProperty.call(t,"init")}(t)?sS.load(t.scriptId,t.scriptUrl).then((function(e){return e(n.element.dom,t.settings)})):t.init(n.element.dom)).then((function(t){r.get().each((function(e){t.setValue(e)})),r.set(v.none()),e.set(v.some(t))}))}))}))]),Vf.config({store:{mode:"manual",getValue:function(){return e.get().fold((function(){return r.get().getOr("")}),(function(t){return t.getValue()}))},setValue:function(t,n){e.get().fold((function(){r.set(v.some(n))}),(function(t){return t.setValue(n)}))}}}),oS()]),components:[n.asSpec()]}})),htmlpanel:XO((function(t){return"presentation"===t.presets?Hy.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):Hy.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:ic([$y.config({}),gg.config({})])})})),imagetools:XO((function(t,e){return gO(t,e.shared.providers)})),table:XO((function(t,e){return function(t,e){var n,r,o=function(t){return{dom:{tag:"th",innerHtml:e.translate(t)}}},i=function(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}},u=function(t){return{dom:{tag:"tr"},components:F(t,i)}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(r=t.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:F(r,o)}]}),(n=t.cells,{dom:{tag:"tbody"},components:F(n,u)})],behaviours:ic([$y.config({}),gg.config({})])}}(t,e.shared.providers)})),panel:XO((function(t,e){return function(t,e){return{dom:{tag:"div",classes:t.classes},components:F(t.items,e.shared.interpreter)}}(t,e)}))},KO={field:function(t,e){return e}},JO=function(t,e,n){var r=Dt(n,{shared:{interpreter:function(e){return QO(t,e,r)}}});return QO(t,e,r)},QO=function(t,e,n){return _t(YO,e.type).fold((function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e}),(function(r){return r(t,e,n)}))},ZO={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},t_=function(t,e,n){var r=Vc(-12,12,ZO),o={maxHeightFunction:Ic()};return function(){return n()?{anchor:"node",root:Vi(t()),node:v.from(t()),bubble:r,layouts:{onRtl:function(){return[ip]},onLtr:function(){return[op]}},overrides:o}:{anchor:"hotspot",hotspot:e(),bubble:r,layouts:{onRtl:function(){return[Va]},onLtr:function(){return[Ha]}},overrides:o}}},e_=function(t,e,n){return function(){return n()?{anchor:"node",root:Vi(t()),node:v.from(t()),layouts:{onRtl:function(){return[up]},onLtr:function(){return[up]}}}:{anchor:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[Wa]},onLtr:function(){return[Wa]}}}}},n_=function(t,e){return function(){return{anchor:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return v.some(Zc.range(sn.fromDom(e.startContainer),e.startOffset,sn.fromDom(e.endContainer),e.endOffset))}}}},r_=function(t){return function(e){return{anchor:"node",root:t(),node:e}}},o_=function(t,e,n){var r=Bv(t),o=function(){return sn.fromDom(t.getBody())},i=function(){return sn.fromDom(t.getContentAreaContainer())},u=function(){return r||!n()};return{inlineDialog:t_(i,e,u),banner:e_(i,e,u),cursor:n_(t,o),node:r_(o)}},i_=function(t){return function(e,n){Jb(t)(e,n)}},u_=function(t){return function(){return zb(t)}},a_=function(t){return function(){return jb(t)}},c_=function(t){return function(){return Wb(t)}},s_=function(t){return{colorPicker:i_(t),hasCustomColors:u_(t),getColors:a_(t),getColorCols:c_(t)}},f_=function(t){return function(){return function(t){return t.getParam("draggable_modal",!1,"boolean")}(t)}},l_=function(t){return{isDraggableModal:f_(t)}},d_=[{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"}]}],m_=function(t){return j(t,(function(t,e){if(Et(e,"items")){var n=m_(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(function(t){return Et(t,"inline")}(e)||function(t){return Et(t,"block")}(e)||function(t){return Et(t,"selector")}(e)){var r="custom-"+(x(e.name)?e.name:e.title.toLowerCase());return{customFormats:t.customFormats.concat([{name:r,format:e}]),formats:t.formats.concat([{title:e.title,format:r,icon:e.icon}])}}return f(f({},t),{formats:t.formats.concat(e)})}),{customFormats:[],formats:[]})},g_=function(t){return function(t){return v.from(t.getParam("style_formats")).filter(C)}(t).map((function(e){var n=function(t,e){var n=m_(e),r=function(e){L(e,(function(e){t.formatter.has(e.name)||t.formatter.register(e.name,e.format)}))};return t.formatter?r(n.customFormats):t.on("init",(function(){r(n.customFormats)})),n.formats}(t,e);return function(t){return t.getParam("style_formats_merge",!1,"boolean")}(t)?d_.concat(n):n})).getOr(d_)},p_=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return Dt(t,r)},h_=function(t,e,n,r){var o=function(e){return F(e,(function(e){var i=vt(e);if(Tt(e,"items")){var u=o(e.items);return Dt(function(t){return Dt(t,{type:"submenu"})}(e),{getStyleItems:function(){return u}})}return Tt(e,"format")?function(t){return p_(t,n,r)}(e):1===i.length&&R(i,"title")?Dt(e,{type:"separator"}):function(e){var o=x(e.name)?e.name:Ko(e.title),i="custom-"+o,u={type:"formatter",format:i,isSelected:n(i),getStylePreview:r(i)},a=Dt(e,u);return t.formatter.register(o,a),a}(e)}))};return o(e)},v_=function(t){var e=function(e){return function(){return t.formatter.match(e)}},n=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?v.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):v.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?G(e,r):[t.format]},o=an([]),i=an([]),u=an([]),a=an([]),c=an(!1);t.on("PreInit",(function(u){var a=g_(t),c=h_(t,a,e,n);o.set(c),i.set(G(c,r))})),t.on("addStyleModifications",(function(o){var i=h_(t,o.items,e,n);u.set(i),c.set(o.replace),a.set(G(i,r))}));return{getData:function(){var t=c.get()?[]:o.get(),e=u.get();return t.concat(e)},getFlattenedKeys:function(){var t=c.get()?[]:i.get(),e=a.get();return t.concat(e)}}},b_=fS.trim,y_=function(t){return function(e){if(e&&1===e.nodeType){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},x_=y_("true"),w_=y_("false"),C_=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},S_=function(t){return t.innerText||t.textContent},k_=function(t){return function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)}(t)&&__(t)},O_=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},__=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return x_(t)}return!1}(t)&&!w_(t)},E_=function(t){return O_(t)&&__(t)},T_=function(t){var e=function(t){return t.id?t.id:Ko("h")}(t);return C_("header",S_(t),"#"+e,function(t){return O_(t)?parseInt(t.nodeName.substr(1),10):0}(t),(function(){t.id=e}))},A_=function(e){var n=e.id||e.name,r=S_(e);return C_("anchor",r||"#"+n,"#"+n,0,t)},B_=function(t){var e,n;return e="h1,h2,h3,h4,h5,h6,a:not([href])",n=t,F(ls(sn.fromDom(n),e),(function(t){return t.dom}))},N_=function(t){return b_(t.title).length>0},D_=function(t){var e=B_(t);return H(function(t){return F(H(t,E_),T_)}(e).concat(function(t){return F(H(t,k_),A_)}(e)),N_)},R_="tinymce-url-history",M_=function(t){return x(t)&&/^https?/.test(t)},I_=function(t){return w(t)&&kt(t,(function(t){return!(C(e=t)&&e.length<=5&&$(e,M_));var e})).isNone()},P_=function(){var t,e=Pb.getItem(R_);if(null===e)return{};try{t=JSON.parse(e)}catch(t){if(t instanceof SyntaxError)return console.log("Local storage "+R_+" was not valid JSON",t),{};throw t}return I_(t)?t:(console.log("Local storage "+R_+" was not valid format",t),{})},F_=function(t){var e=P_();return Object.prototype.hasOwnProperty.call(e,t)?e[t]:[]},L_=function(t,e){if(M_(t)){var n=P_(),r=Object.prototype.hasOwnProperty.call(n,e)?n[e]:[],o=H(r,(function(e){return e!==t}));n[e]=[t].concat(o).slice(0,5),function(t){if(!I_(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));Pb.setItem(R_,JSON.stringify(t))}(n)}},V_=function(t){return!!t},H_=function(t){return xt(fS.makeMap(t,/[, ]/),V_)},z_=function(t){return v.from(function(t){return t.getParam("file_picker_callback")}(t)).filter(_)},j_=function(t,e){var n=function(t){var e=v.some(function(t){return t.getParam("file_picker_types")}(t)).filter(V_),n=v.some(function(t){return t.getParam("file_browser_callback_types")}(t)).filter(V_),r=e.or(n).map(H_);return z_(t).fold((function(){return!1}),(function(t){return r.fold((function(){return!0}),(function(t){return vt(t).length>0&&t}))}))}(t);return S(n)?n?z_(t):v.none():n[e]?z_(t):v.none()},U_=function(t){return v.from(t).filter(x).getOrUndefined()},W_=function(t){return{getHistory:F_,addToHistory:L_,getLinkInformation:function(){return function(t){return function(t){return!1===t.getParam("typeahead_urls")}(t)?v.none():v.some({targets:D_(t.getBody()),anchorTop:U_(Pv(t)),anchorBottom:U_(Fv(t))})}(t)},getValidationHandler:function(){return function(t){return v.from(function(t){var e=t.getParam("file_picker_validator_handler",void 0,"function");return void 0===e?t.getParam("filepicker_validator_handler",void 0,"function"):e}(t))}(t)},getUrlPicker:function(e){return function(t,e){return j_(t,e).map((function(n){return function(r){return Cx((function(o){var i=f({filetype:e,fieldname:r.fieldname},v.from(r.meta).getOr({}));n.call(t,(function(t,e){if(!x(t))throw new Error("Expected value to be string");if(void 0!==e&&!w(e))throw new Error("Expected meta to be a object");o({value:t,meta:e})}),r.value,i)}))}}))}(t,e)}}},q_=function(t,e,n){var r=an(!1),o=function(t){var e=an(Tv(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}}(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:Jh.translate,isDisabled:function(){return e.mode.isReadOnly()||e.ui.isDisabled()},getSetting:e.getParam.bind(e)},interpreter:function(t){return function(t,e){return QO(KO,t,e)}(t,i)},anchors:o_(e,n,o.isPositionedAtTop),header:o,getSink:function(){return ot.value(t)}},urlinput:W_(e),styleselect:v_(e),colorinput:s_(e),dialog:l_(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i},G_=n((function(t,e){!function(t,e){var n=Eu.max(t,e,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Xi(t,"max-width",n+"px")}(t,Math.floor(e))})),$_="contexttoolbar-hide",X_=n([Ie("dom"),Ke("shell",!0),Hf("toolbarBehaviours",[cg])]),Y_=n([vl({name:"groups",overrides:function(){return{behaviours:ic([cg.config({})])}}})]),K_=ql({name:"Toolbar",configFields:X_(),partFields:Y_(),factory:function(t,e,n,r){var o=function(e){return t.shell?v.some(e):Al(e,t,"groups")},i=t.shell?{behaviours:[cg.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:jf(t.toolbarBehaviours,i.behaviours),apis:{setGroups:function(t,e){o(t).fold((function(){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")}),(function(t){cg.set(t,e)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),J_=function(t,e,n){return{within:t,extra:e,withinWidth:n}},Q_=function(t,e,r){var o,i=(o=function(t,e){var n=r(t);return v.some({element:t,start:e,finish:e+n,width:n})},j(t,(function(t,e){return o(e,t.len).fold(n(t),(function(e){return{len:e.finish,list:t.list.concat([e])}}))}),{len:0,list:[]}).list),u=H(i,(function(t){return t.finish<=e})),a=z(u,(function(t,e){return t+e.width}),0);return{within:u,extra:i.slice(u.length),withinWidth:a}},Z_=function(t){return F(t,(function(t){return t.element}))},tE=function(t,e,n,r){var o=function(t,e,n){var r=Q_(e,t,n);return 0===r.extra.length?v.some(r):v.none()}(t,e,n).getOrThunk((function(){return Q_(e,t-n(r),n)})),i=o.within,u=o.extra,a=o.withinWidth;return 1===u.length&&u[0].width<=n(r)?function(t,e,n){var r=Z_(t.concat(e));return J_(r,[],n)}(i,u,a):u.length>=1?function(t,e,n,r){var o=Z_(t).concat([n]);return J_(o,Z_(e),r)}(i,u,r,a):function(t,e,n){return J_(Z_(t),[],n)}(i,0,a)},eE=function(t,e){var n=F(e,(function(t){return vu(t)}));K_.setGroups(t,n)},nE=function(t,e,n){var r=Bl(t,e,"primary"),o=Px.getCoupled(t,"overflowGroup");Xi(r.element,"visibility","hidden");var i=e.builtGroups.get().concat([o]),u=et(i,(function(t){return pc(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))}));n([]),eE(r,i);var a=Tu(r.element),c=tE(a,e.builtGroups.get(),(function(t){return Tu(t.element)}),o);0===c.extra.length?(cg.remove(r,o),n([])):(eE(r,c.within),n(c.extra)),nu(r.element,"visibility"),ru(r.element),u.each(gg.focus)},rE=n([Hf("splitToolbarBehaviours",[Px]),un("builtGroups",(function(){return an([])}))]),oE=n([ma(["overflowToggledClass"]),Xe("getOverflowBounds"),Ie("lazySink"),un("overflowGroups",(function(){return an([])}))].concat(rE())),iE=n([pl({factory:K_,schema:X_(),name:"primary"}),hl({schema:X_(),name:"overflow"}),hl({name:"overflow-button"}),hl({name:"overflow-group"})]),uE=n([ma(["toggledClass"]),Ie("lazySink"),He("fetch"),Xe("getBounds"),Ye("fireDismissalEventInstead",[Ke("event",Lr())]),qc()]),aE=n([hl({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:ic([_g.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),hl({factory:K_,schema:X_(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:ic([rg.config({mode:"cyclic",onEscape:function(e){return Al(e,t,"button").each(gg.focus),v.none()}})])}}})]),cE=function(t,e){var n=Px.getCoupled(t,"toolbarSandbox");yf.isOpen(n)?yf.close(n):yf.open(n,e.toolbar())},sE=function(t,e,n,r){var o=n.getBounds.map((function(t){return t()})),i=n.lazySink(t).getOrDie();Ks.positionWithinBounds(i,{anchor:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:G_()}},e,o)},fE=function(t,e,n,r,o){K_.setGroups(e,o),sE(t,e,n,r),_g.on(t)},lE=ql({name:"FloatingToolbarButton",factory:function(t,e,n,r){return f(f({},sp.sketch(f(f({},r.button()),{action:function(t){cE(t,r)},buttonBehaviours:Wf({dump:r.button().buttonBehaviours},[Px.config({others:{toolbarSandbox:function(e){return function(t,e,n){var r=Qu();return{dom:{tag:"div",attributes:{id:r.id}},behaviours:ic([rg.config({mode:"special",onEscape:function(t){return yf.close(t),v.some(!0)}}),yf.config({onOpen:function(o,i){n.fetch().get((function(o){fE(t,i,n,e.layouts,o),r.link(t.element),rg.focusIn(i)}))},onClose:function(){_g.off(t),gg.focus(t),r.unlink(t.element)},isPartOf:function(e,n,r){return ta(n,r)||ta(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),lc.config({channels:f(f({},kf(f({isExtraPart:a},n.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),_f({doReposition:function(){yf.getState(Px.getCoupled(t,"toolbarSandbox")).each((function(r){sE(t,r,n,e.layouts)}))}}))})])}}(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){yf.getState(Px.getCoupled(e,"toolbarSandbox")).each((function(o){fE(e,o,t,n.layouts,r)}))},reposition:function(e){yf.getState(Px.getCoupled(e,"toolbarSandbox")).each((function(r){sE(e,r,t,n.layouts)}))},toggle:function(t){cE(t,r)},getToolbar:function(t){return yf.getState(Px.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return yf.isOpen(Px.getCoupled(t,"toolbarSandbox"))}}})},configFields:uE(),partFields:aE(),apis:{setGroups:function(t,e,n){t.setGroups(e,n)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getToolbar:function(t,e){return t.getToolbar(e)},isOpen:function(t,e){return t.isOpen(e)}}}),dE=n([Ie("items"),ma(["itemSelector"]),Hf("tgroupBehaviours",[rg])]),mE=n([bl({name:"items",unit:"item"})]),gE=ql({name:"ToolbarGroup",configFields:dE(),partFields:mE(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:jf(t.tgroupBehaviours,[rg.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),pE=function(t){return F(t,(function(t){return vu(t)}))},hE=function(t,e,n){nE(t,n,(function(r){n.overflowGroups.set(r),e.getOpt(t).each((function(t){lE.setGroups(t,pE(r))}))}))},vE=ql({name:"SplitFloatingToolbar",configFields:oE(),partFields:iE(),factory:function(t,e,n,r){var o=fp(lE.sketch({fetch:function(){return Cx((function(e){e(pE(t.overflowGroups.get()))}))},layouts:{onLtr:function(){return[Ha,Va]},onRtl:function(){return[Va,Ha]},onBottomLtr:function(){return[ja,za]},onBottomRtl:function(){return[za,ja]}},getBounds:n.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:r["overflow-button"](),toolbar:r.overflow()}}));return{uid:t.uid,dom:t.dom,components:e,behaviours:jf(t.splitToolbarBehaviours,[Px.config({others:{overflowGroup:function(){return gE.sketch(f(f({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set(F(n,e.getSystem().build)),hE(e,o,t)},refresh:function(e){return hE(e,o,t)},toggle:function(t){o.getOpt(t).each((function(t){lE.toggle(t)}))},isOpen:function(t){return o.getOpt(t).map(lE.isOpen).getOr(!1)},reposition:function(t){o.getOpt(t).each((function(t){lE.reposition(t)}))},getOverflow:function(t){return o.getOpt(t).bind(lE.getToolbar)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)},getOverflow:function(t,e){return t.getOverflow(e)}}}),bE=function(t,e){return e.getAnimationRoot.fold((function(){return t.element}),(function(e){return e(t)}))},yE=function(t){return t.dimension.property},xE=function(t,e){return t.dimension.getDimension(e)},wE=function(t,e){var n=bE(t,e);Ri(n,[e.shrinkingClass,e.growingClass])},CE=function(t,e){Bi(t.element,e.openClass),Ti(t.element,e.closedClass),Xi(t.element,yE(e),"0px"),ru(t.element)},SE=function(t,e){Bi(t.element,e.closedClass),Ti(t.element,e.openClass),nu(t.element,yE(e))},kE=function(t,e,n,r){n.setCollapsed(),Xi(t.element,yE(e),xE(e,t.element)),ru(t.element),wE(t,e),CE(t,e),e.onStartShrink(t),e.onShrunk(t)},OE=function(t,e,n,r){var o=r.getOrThunk((function(){return xE(e,t.element)}));n.setCollapsed(),Xi(t.element,yE(e),o),ru(t.element);var i=bE(t,e);Bi(i,e.growingClass),Ti(i,e.shrinkingClass),CE(t,e),e.onStartShrink(t)},_E=function(t,e,n){var r=xE(e,t.element);("0px"===r?kE:OE)(t,e,n,v.some(r))},EE=function(t,e,n){var r=bE(t,e),o=Ni(r,e.shrinkingClass),i=xE(e,t.element);SE(t,e);var u=xE(e,t.element);(o?function(){Xi(t.element,yE(e),i),ru(t.element)}:function(){CE(t,e)})(),Bi(r,e.shrinkingClass),Ti(r,e.growingClass),SE(t,e),Xi(t.element,yE(e),u),n.setExpanded(),e.onStartGrow(t)},TE=function(t,e,n){var r=bE(t,e);return!0===Ni(r,e.growingClass)},AE=function(t,e,n){var r=bE(t,e);return!0===Ni(r,e.shrinkingClass)},BE=Object.freeze({__proto__:null,refresh:function(t,e,n){if(n.isExpanded()){nu(t.element,yE(e));var r=xE(e,t.element);Xi(t.element,yE(e),r)}},grow:function(t,e,n){n.isExpanded()||EE(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&_E(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&kE(t,e,n,v.none())},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:TE,isShrinking:AE,isTransitioning:function(t,e,n){return!0===TE(t,e)||!0===AE(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?_E:EE)(t,e,n)},disableTransitions:wE}),NE=Object.freeze({__proto__:null,exhibit:function(t,e,n){var r=e.expanded;return pi(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:Wt(e.dimension.property,"0px")})},events:function(t,e){return Qr([co(vr(),(function(n,r){r.event.raw.propertyName===t.dimension.property&&(wE(n,t),e.isExpanded()&&nu(n.element,t.dimension.property),(e.isExpanded()?t.onGrown:t.onShrunk)(n))}))])}}),DE=[Ie("closedClass"),Ie("openClass"),Ie("shrinkingClass"),Ie("growingClass"),We("getAnimationRoot"),pa("onShrunk"),pa("onStartShrink"),pa("onGrown"),pa("onStartGrow"),Ke("expanded",!1),Pe("dimension",Oe("property",{width:[ya("property","width"),ya("getDimension",(function(t){return Tu(t)+"px"}))],height:[ya("property","height"),ya("getDimension",(function(t){return xu(t)+"px"}))]}))],RE=ac({fields:DE,name:"sliding",active:NE,apis:BE,state:Object.freeze({__proto__:null,init:function(t){var e=an(t.expanded);return mi({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:o(e.set,!1),setExpanded:o(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),ME=n([ma(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),pa("onOpened"),pa("onClosed")].concat(rE())),IE=n([pl({factory:K_,schema:X_(),name:"primary"}),pl({factory:K_,schema:X_(),name:"overflow",overrides:function(t){return{toolbarBehaviours:ic([RE.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){Al(e,t,"overflow-button").each((function(t){_g.off(t),gg.focus(t)})),t.onClosed(e)},onGrown:function(e){rg.focusIn(e),t.onOpened(e)},onStartGrow:function(e){Al(e,t,"overflow-button").each(_g.on)}}),rg.config({mode:"acyclic",onEscape:function(e){return Al(e,t,"overflow-button").each(gg.focus),v.some(!0)}})])}}}),hl({name:"overflow-button",overrides:function(t){return{buttonBehaviours:ic([_g.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),hl({name:"overflow-group"})]),PE=function(t,e){Al(t,e,"overflow-button").bind((function(){return Al(t,e,"overflow")})).each((function(n){FE(t,e),RE.toggleGrow(n)}))},FE=function(t,e){Al(t,e,"overflow").each((function(n){nE(t,e,(function(t){var e=F(t,(function(t){return vu(t)}));K_.setGroups(n,e)})),Al(t,e,"overflow-button").each((function(t){RE.hasGrown(n)&&_g.on(t)})),RE.refresh(n)}))},LE=ql({name:"SplitSlidingToolbar",configFields:ME(),partFields:IE(),factory:function(t,e,n,r){var o="alloy.toolbar.toggle";return{uid:t.uid,dom:t.dom,components:e,behaviours:jf(t.splitToolbarBehaviours,[Px.config({others:{overflowGroup:function(t){return gE.sketch(f(f({},r["overflow-group"]()),{items:[sp.sketch(f(f({},r["overflow-button"]()),{action:function(e){Gr(t,o)}}))]}))}}}),sg("toolbar-toggle-events",[eo(o,(function(e){PE(e,t)}))])]),apis:{setGroups:function(e,n){!function(e,n){var r=F(n,e.getSystem().build);t.builtGroups.set(r)}(e,n),FE(e,t)},refresh:function(e){return FE(e,t)},toggle:function(e){return PE(e,t)},isOpen:function(e){return function(t,e){return Al(t,e,"overflow").map(RE.hasGrown).getOr(!1)}(e,t)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)}}}),VE=n(Ko("toolbar-height-change")),HE=function(t){var e=t.title.fold((function(){return{}}),(function(t){return{attributes:{title:t}}}));return{dom:f({tag:"div",classes:["tox-toolbar__group"]},e),components:[gE.parts.items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:ic([$y.config({}),gg.config({})])}},zE=function(t){return gE.sketch(HE(t))},jE=function(t,e){var n=so((function(e){var n=F(t.initGroups,zE);K_.setGroups(e,n)}));return ic([Gv(t.providers.isDisabled),jv(),rg.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),sg("toolbar-events",[n])])},UE=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":HE({title:v.none(),items:[]}),"overflow-button":Rk({name:"more",icon:v.some("more-drawer"),disabled:!1,tooltip:v.some("More..."),primary:!1,borderless:!1},v.none(),t.providers)},splitToolbarBehaviours:jE(t,e)}},WE=function(t){var e=UE(t),n=vE.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return vE.sketch(f(f({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element,n=ju(e),r=Co(e),o=ju(r),i=Math.max(r.dom.scrollHeight,o.height);return Hu(n.x+4,o.y,n.width-8,i)},parts:f(f({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},qE=function(t){var e=LE.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=LE.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=UE(t);return LE.sketch(f(f({},r),{components:[e,n],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:function(t){t.getSystem().broadcastOn([VE()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([VE()],{type:"closed"})}}))},GE=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return K_.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===th.scrolling?["tox-toolbar--scrolling"]:[])},components:[K_.parts.groups({})],toolbarBehaviours:jE(t,e)})},$E=ie([Le("type"),Pe("items",ae([he([Le("name"),Ue("items",Ae)]),Ae]))].concat(Vp)),XE=[$e("text"),$e("tooltip"),$e("icon"),He("fetch"),nn("onSetup",(function(){return t}))],YE=ie(d([Le("type")],XE)),KE=function(t){return xe("menubutton",YE,t)},JE=ie([Le("type"),$e("tooltip"),$e("icon"),$e("text"),Xe("select"),He("fetch"),nn("onSetup",(function(){return t})),tn("presets","normal",["normal","color","listpreview"]),Ke("columns",1),He("onAction"),He("onItemAction")]),QE=Object.freeze({__proto__:null,events:function(t,e){var n=function(n,r){t.updateState.each((function(t){var o=t(n,r);e.set(o)})),t.renderComponents.each((function(t){var o=t(r,e.get()),i=F(o,n.getSystem().build);tf(n,i)}))};return Qr([eo(kr(),(function(e,r){var o=r;if(!o.universal){var i=t.channel;R(o.channels,i)&&n(e,o.data)}})),so((function(e,r){t.initialData.each((function(t){n(e,t)}))}))])}}),ZE=Object.freeze({__proto__:null,getState:function(t,e,n){return n}}),tT=[Ie("channel"),We("renderComponents"),We("updateState"),We("initialData")],eT=ac({fields:tT,name:"reflecting",active:QE,apis:ZE,state:Object.freeze({__proto__:null,init:function(){var t=an(v.none());return{readState:function(){return t.get().fold((function(){return"none"}),(function(t){return t}))},get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(v.none())}}}})}),nT=n([Ie("toggleClass"),Ie("fetch"),va("onExecute"),Ke("getHotspot",v.some),Ke("getAnchorOverrides",n({})),qc(),va("onItemExecute"),We("lazySink"),Ie("dom"),pa("onOpen"),Hf("splitDropdownBehaviours",[Px,rg,gg]),Ke("matchWidth",!1),Ke("useMinWidth",!1),Ke("eventOrder",{}),We("role")].concat(Xx())),rT=pl({factory:sp,schema:[Ie("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:ic([gg.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(Xr)},buttonBehaviours:ic([_g.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),oT=pl({factory:sp,schema:[Ie("dom")],name:"button",defaults:function(){return{buttonBehaviours:ic([gg.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each((function(n){t.onExecute(n,e)}))}}}}),iT=n([rT,oT,vl({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Ie("text")],name:"aria-descriptor"}),hl({schema:[da()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each((function(r){t.onItemExecute(r,e,n)}))}}}}),Lx()]),uT=ql({name:"SplitDropdown",configFields:nT(),partFields:iT(),factory:function(e,n,r,o){var i,u=function(t){Jl.getCurrent(t).each((function(t){cd.highlightFirst(t),rg.focusIn(t)}))},a=function(n){jx(e,(function(t){return t}),n,o,u,hx.HighlightFirst).get(t)},c=function(t){var n=Bl(t,e,"button");return Xr(n),v.some(!0)},s=f(f({},Qr([so((function(t,n){Al(t,e,"aria-descriptor").each((function(e){var n=Ko("aria");Vo(e.element,"id",n),Vo(t.element,"aria-describedby",n)}))}))])),Tg(v.some(a))),l={repositionMenus:function(t){_g.isOn(t)&&$x(t)}};return{uid:e.uid,dom:e.dom,components:n,apis:l,eventOrder:f(f({},e.eventOrder),(i={},i[Or()]=["disabling","toggling","alloy.base.behaviour"],i)),events:s,behaviours:jf(e.splitDropdownBehaviours,[Px.config({others:{sandbox:function(t){var n=Bl(t,e,"arrow");return Gx(e,t,{onOpen:function(){_g.on(n),_g.on(t)},onClose:function(){_g.off(n),_g.off(t)}})}}}),rg.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t){return a(t),v.some(!0)}}),gg.config({}),_g.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:e.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),aT=function(t){return{isDisabled:function(){return lv.isDisabled(t)},setDisabled:function(e){return lv.set(t,e)}}},cT=function(t){return{setActive:function(e){_g.set(t,e)},isActive:function(){return _g.isOn(t)},isDisabled:function(){return lv.isDisabled(t)},setDisabled:function(e){return lv.set(t,e)}}},sT=function(t,e){return t.map((function(t){return{"aria-label":e.translate(t),title:e.translate(t)}})).getOr({})},fT=Ko("focus-button"),lT=["checklist","ordered-list"],dT=["indent","outdent","table-insert-column-after","table-insert-column-before","unordered-list"],mT=function(t,e,n,r,o,i){var u,a=function(t){return Jh.isRtl()&&R(lT,t)?t+"-rtl":t},c=Jh.isRtl()&&t.exists((function(t){return R(dT,t)}));return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]).concat(c?["tox-tbtn__icon-rtl"]:[]),attributes:sT(n,i)},components:Qv([t.map((function(t){return pk(a(t),i.icons)})),e.map((function(t){return vk(t,"tox-tbtn",i)}))]),eventOrder:(u={},u[ir()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:ic([Gv(i.isDisabled),jv(),sg("common-button-display-events",[eo(ir(),(function(t,e){e.event.prevent(),Gr(t,fT)}))])].concat(r.map((function(n){return eT.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return Qv([t.icon.map((function(t){return pk(a(t),i.icons)})),t.text.map((function(t){return vk(t,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},gT=function(e,n,r){var o,i=an(t),u=mT(e.icon,e.text,e.tooltip,v.none(),v.none(),r);return sp.sketch({dom:u.dom,components:u.components,eventOrder:yk,buttonBehaviours:ic([sg("toolbar-button-events",[(o={onAction:e.onAction,getApi:n.getApi},mo((function(t,e){$v(o,t)((function(e){$r(t,bk,{buttonApi:e}),o.onAction(e)}))}))),Xv(n,i),Yv(n,i)]),Gv((function(){return e.disabled||r.isDisabled()})),jv()].concat(n.toolbarButtonBehaviours))})},pT=function(t,e,n){return gT(t,{toolbarButtonBehaviours:[].concat(n.length>0?[sg("toolbarButtonWith",n)]:[]),getApi:aT,onSetup:t.onSetup},e)},hT=function(t,e,n){return Dt(gT(t,{toolbarButtonBehaviours:[cg.config({}),_g.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[sg("toolbarToggleButtonWith",n)]:[]),getApi:cT,onSetup:t.onSetup},e))},vT=function(t,e,n){return function(r){return Cx((function(t){return e.fetch(t)})).map((function(o){return v.from(yy(Dt(Qb(Ko("menu-value"),o,(function(n){e.onItemAction(t(r),n)}),e.columns,e.presets,eh.CLOSE_ON_EXECUTE,e.select.getOr((function(){return!1})),n),{movement:ty(e.columns,e.presets),menuBehaviours:zh("auto"!==e.columns?[]:[so((function(t,n){Vh(t,4,dh(e.presets)).each((function(e){var n=e.numRows,r=e.numColumns;rg.setGridSize(t,n,r)}))}))])})))}))}},bT=function(t,e){return eo(bk,(function(n,r){var o=function(t){return{hide:function(){return Gr(t,Ar())},getValue:function(){return Vf.getValue(t)}}}(t.get(n));e.onAction(o,r.event.buttonApi)}))},yT=function(t,e,n){var r={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===e.type?function(t,e,n){var r=e.original,o=(r.primary,l(r,["primary"])),i=we(Wp(f(f({},o),{type:"togglebutton",onAction:function(){}})));return hT(i,n.backstage.shared.providers,[bT(t,e)])}(t,e,r):function(t,e,n){var r=e.original,o=(r.primary,l(r,["primary"])),i=we(zp(f(f({},o),{type:"button",onAction:function(){}})));return pT(i,n.backstage.shared.providers,[bT(t,e)])}(t,e,r)},xT=function(t,e){var n=t.label.fold((function(){return{}}),(function(t){return{"aria-label":t}})),r=fp(mx.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:n,selectOnFocus:!0,inputBehaviours:ic([rg.config({mode:"special",onEnter:function(t){return o.findPrimary(t).map((function(t){return Xr(t),!0}))},onLeft:function(t,e){return e.cut(),v.none()},onRight:function(t,e){return e.cut(),v.none()}})])})),o=function(t,e,n){var r=F(e,(function(e){return fp(yT(t,e,n))}));return{asSpecs:function(){return F(r,(function(t){return t.asSpec()}))},findPrimary:function(t){return et(e,(function(e,n){return e.primary?v.from(r[n]).bind((function(e){return e.getOpt(t)})).filter(i(lv.isDisabled)):v.none()}))}}}(r,t.commands,e);return[{title:v.none(),items:[r.asSpec()]},{title:v.none(),items:o.asSpecs()}]},wT=xT,CT=function(t,e){var n=Pu(window),r=zu(sn.fromDom(t.getContentAreaContainer())),o=yv(t)||xv(t)||Cv(t),i=function(t,e){var n=Math.max(e.x,t.x),r=t.right-n,o=e.width-(n-e.x);return{x:n,width:Math.min(r,o)}}(r,n),u=i.x,a=i.width;if(t.inline&&!o)return Hu(u,n.y,a,n.height);var c=function(t,e,n,r){var o=sn.fromDom(t.getContainer()),i=Ku(o,".tox-editor-header").getOr(o),u=zu(i),a=u.y>=e.bottom,c=r&&!a;if(t.inline&&c)return{y:Math.max(u.bottom,n.y),bottom:n.bottom};if(t.inline&&!c)return{y:n.y,bottom:Math.min(u.y,n.bottom)};var s=zu(o);return c?{y:Math.max(u.bottom,n.y),bottom:Math.min(s.bottom,n.bottom)}:{y:Math.max(s.y,n.y),bottom:Math.min(u.y,n.bottom)}}(t,r,n,e.header.isPositionedAtTop()),s=c.y,f=c.bottom;return Hu(u,s,a,f-s)},ST=function(t,e){var n=H(e,(function(e){return e.predicate(t.dom)})),r=V(n,(function(t){return"contexttoolbar"===t.type}));return{contextToolbars:r.pass,contextForms:r.fail}},kT=function(t,e,n){var r=ST(t,e);if(r.contextForms.length>0)return v.some({elem:t,toolbars:[r.contextForms[0]]});var o=ST(t,n);if(o.contextForms.length>0)return v.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=function(t){if(t.length<=1)return t;var e=function(e){return M(t,(function(t){return t.position===e}))},n=function(e){return H(t,(function(t){return t.position===e}))},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),u=F(n("selection"),(function(t){return f(f({},t),{position:"node"})}));return i.concat(u)}return n(r?"selection":"node")}return n("line")}(r.contextToolbars.concat(o.contextToolbars));return v.some({elem:t,toolbars:i})}return v.none()},OT=function(t,e,n){return t(e)?v.none():Yn(e,(function(t){var e=ST(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:function(t){if(t.length<=1)return t;var e=function(e){return U(t,(function(t){return t.position===e}))};return e("selection").orThunk((function(){return e("node")})).orThunk((function(){return e("line")})).map((function(t){return t.position})).fold((function(){return[]}),(function(e){return H(t,(function(t){return t.position===e}))}))}(r);return i.length>0?v.some({elem:t,toolbars:i}):v.none()}),t)},_T=function(t,e){var n={},r=[],o=[],i={},u={},a=function(t,a){var c=we(xe("ContextForm",Jp,a));n[t]=c,c.launch.map((function(n){i["form:"+t]=f(f({},a.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){e(c)}})})),"editor"===c.scope?o.push(c):r.push(c),u[t]=c},c=function(t,e){var n;(n=e,xe("ContextToolbar",Qp,n)).each((function(n){"editor"===e.scope?o.push(n):r.push(n),u[t]=n}))},s=vt(t);return L(s,(function(e){var n=t[e];"contextform"===n.type?a(e,n):"contexttoolbar"===n.type&&c(e,n)})),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:u,formNavigators:i}},ET=Ko("forward-slide"),TT=Ko("backward-slide"),AT=Ko("change-slide-event"),BT="tox-pop--resizing",NT=function(t,e,n){var r=function(t,r,i,u){var a=e.shared.providers.translate(t.title);if("separator"===t.type)return v.some({type:"separator",text:a});if("submenu"===t.type){var c=G(t.getStyleItems(),(function(t){return o(t,r,u)}));return 0===r&&c.length<=0?v.none():v.some({type:"nestedmenuitem",text:a,disabled:c.length<=0,getSubmenuItems:function(){return G(t.getStyleItems(),(function(t){return o(t,r,u)}))}})}return v.some(f({type:"togglemenuitem",text:a,icon:t.icon,active:t.isSelected(u),disabled:i,onAction:n.onAction(t)},t.getStylePreview().fold((function(){return{}}),(function(t){return{meta:{style:t}}}))))},o=function(t,e,o){var i="formatter"===t.type&&n.isInvalid(t);return 0===e?i?[]:r(t,e,!1,o).toArray():r(t,e,i,o).toArray()},i=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return G(t,(function(t){return o(t,r,e)}))};return{validateItems:i,getFetch:function(t,e){return function(n,r){var o=e(),u=i(o);r(Tk(u,eh.CLOSE_ON_EXECUTE,t,!1))}}}},DT=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return F(r.data,(function(t){return p_(t,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:NT(0,e,n),getStyleItems:o}},RT=function(e,n,r){var o=DT(0,n,r),i=o.items,u=o.getStyleItems;return Ck({text:r.icon.isSome()?v.none():v.some(""),icon:r.icon,tooltip:v.from(r.tooltip),role:v.none(),fetch:i.getFetch(n,u),onSetup:function(n){return r.setInitialValue.each((function(t){return t(n.getComponent())})),r.nodeChangeHandler.map((function(t){var r=t(n.getComponent());return e.on("NodeChange",r),function(){e.off("NodeChange",r)}})).getOr(t)},getApi:function(t){return{getComponent:function(){return t}}},columns:1,presets:"normal",classes:r.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",n.shared)};!function(t){t[t.SemiColon=0]="SemiColon",t[t.Space=1]="Space"}(dO||(dO={}));var MT,IT,PT,FT,LT,VT=function(t,e,n,r){return{type:"basic",data:function(t){return F(t,(function(t){var e=t,n=t,r=t.split("=");return r.length>1&&(e=r[0],n=r[1]),{title:e,format:n}}))}(function(t,e){return e===dO.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")}(t.getParam(e,n,"string"),r))}},HT=[{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"}],zT=function(t){var e=function(e){var n=U(HT,(function(e){return t.formatter.match(e.format)})).fold((function(){return"left"}),(function(t){return t.title.toLowerCase()}));$r(e,wk,{icon:"align-"+n})},n=v.some((function(t){return function(){return e(t)}})),r=v.some((function(t){return e(t)})),o={type:"basic",data:HT};return{tooltip:"Align",icon:v.some("align-left"),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:v.none,getPreviewFor:function(t){return function(){return v.none()}},onAction:function(e){return function(){return U(HT,(function(t){return t.format===e.format})).each((function(e){return t.execCommand(e.command)}))}},setInitialValue:r,nodeChangeHandler:n,dataset:o,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},jT=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],UT=function(t){var e=t.split(/\s*,\s*/);return F(e,(function(t){return t.replace(/^['"]+|['"]+$/g,"")}))},WT=function(t){var e=function(){var e=function(t){return t?UT(t)[0]:""},n=t.queryCommandValue("FontName"),r=i.data,o=n?n.toLowerCase():"";return{matchOpt:U(r,(function(t){var n=t.format;return n.toLowerCase()===o||e(n).toLowerCase()===e(o).toLowerCase()})).orThunk((function(){return function(t){var e;return 0===t.indexOf("-apple-system")&&(e=UT(t.toLowerCase()),$(jT,(function(t){return e.indexOf(t.toLowerCase())>-1})))}(o)?v.from({title:"System Font",format:o}):v.none()})),font:n}},n=function(t){var n=e(),r=n.matchOpt,o=n.font,i=r.fold((function(){return o}),(function(t){return t.title}));$r(t,xk,{text:i})},r=v.some((function(t){return function(){return n(t)}})),o=v.some((function(t){return n(t)})),i=VT(t,"font_formats","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",dO.SemiColon);return{tooltip:"Fonts",icon:v.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getCurrentValue:function(){return e().matchOpt},getPreviewFor:function(t){return function(){return v.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontName",!1,e.format)}))}},setInitialValue:o,nodeChangeHandler:r,dataset:i,shouldHide:!1,isInvalid:function(){return!1}}},qT={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},GT={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},$T=function(t,e){return/[0-9.]+px$/.test(t)?function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}(72*parseInt(t,10)/96,e||0)+"pt":_t(GT,t).getOr(t)},XT=function(t){var e=function(){var e=v.none(),n=a.data,r=t.queryCommandValue("FontSize");if(r)for(var o=function(t){var o=$T(r,t),i=function(t){return _t(qT,t).getOr("")}(o);e=U(n,(function(t){return t.format===r||t.format===o||t.format===i}))},i=3;e.isNone()&&i>=0;i--)o(i);return{matchOpt:e,size:r}},r=n(v.none),o=function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold((function(){return o}),(function(t){return t.title}));$r(t,xk,{text:i})},i=v.some((function(t){return function(){return o(t)}})),u=v.some((function(t){return o(t)})),a=VT(t,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",dO.Space);return{tooltip:"Font sizes",icon:v.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getPreviewFor:r,getCurrentValue:function(){return e().matchOpt},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontSize",!1,e.format)}))}},setInitialValue:u,nodeChangeHandler:i,dataset:a,shouldHide:!1,isInvalid:function(){return!1}}},YT=function(t,e){var n=e(),r=F(n,(function(t){return t.format}));return v.from(t.formatter.closest(r)).bind((function(t){return U(n,(function(e){return e.format===t}))})).orThunk((function(){return $l(t.formatter.match("p"),{title:"Paragraph",format:"p"})}))},KT=function(t){var e=an(v.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(v.none())},isSet:function(){return e.get().isSome()},set:function(t){n(),e.set(v.some(t))}}},JT=function(){return KT((function(t){return t.destroy()}))},QT=function(){return KT((function(t){return t.unbind()}))},ZT=function(t,e){return function(n){var r=QT(),o=function(){n.setActive(t.formatter.match(e));var o=t.formatter.formatChanged(e,n.setActive);r.set(o)};return t.initialized?o():t.on("init",o),r.clear}},tA=function(t){return function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)}))}}},eA=function(t){var e=function(e){var n=YT(t,(function(){return o.data})).fold((function(){return"Paragraph"}),(function(t){return t.title}));$r(e,xk,{text:n})},n=v.some((function(t){return function(){return e(t)}})),r=v.some((function(t){return e(t)})),o=VT(t,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",dO.SemiColon);return{tooltip:"Blocks",icon:v.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:v.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return v.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},onAction:tA(t),setInitialValue:r,nodeChangeHandler:n,dataset:o,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},nA=function(t,e){var n=function(e){var n=function(t){var e=t.items;return void 0!==e&&e.length>0?G(e,n):[{title:t.title,format:t.format}]},r=G(g_(t),n),o=YT(t,(function(){return r})).fold((function(){return"Paragraph"}),(function(t){return t.title}));$r(e,xk,{text:o})},r=v.some((function(t){return function(){return n(t)}})),o=v.some((function(t){return n(t)}));return{tooltip:"Formats",icon:v.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:v.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return void 0!==n?v.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):v.none()}},onAction:tA(t),setInitialValue:o,nodeChangeHandler:r,shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},rA=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{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"]}],oA=function(t,e){return function(n,r,o){var i=t(n).mapError((function(t){return Se(t)})).getOrDie();return e(i,r,o)}},iA={button:oA(zp,(function(t,e){return n=t,r=e.backstage.shared.providers,pT(n,r,[]);var n,r})),togglebutton:oA(Wp,(function(t,e){return n=t,r=e.backstage.shared.providers,hT(n,r,[]);var n,r})),menubutton:oA(KE,(function(t,e){return Bk(t,"tox-tbtn",e.backstage,v.none())})),splitbutton:oA((function(t){return xe("SplitButton",JE,t)}),(function(e,n){return function(e,n){var r,o=Ko("channel-update-split-dropdown-display"),i=function(t){return{isDisabled:function(){return lv.isDisabled(t)},setDisabled:function(e){return lv.set(t,e)},setIconFill:function(e,n){Ku(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){Vo(t,"fill",n)}))},setIconStroke:function(e,n){Ku(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){Vo(t,"stroke",n)}))},setActive:function(e){Vo(t.element,"aria-pressed",e),Ku(t.element,"span").each((function(n){t.getSystem().getByDom(n).each((function(t){return _g.set(t,e)}))}))},isActive:function(){return Ku(t.element,"span").exists((function(e){return t.getSystem().getByDom(e).exists(_g.isOn)}))}}},u=an(t),a={getApi:i,onSetup:e.onSetup};return uT.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:f({"aria-pressed":!1},sT(e.tooltip,n.providers))},onExecute:function(t){e.onAction(i(t))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:ic([qv(n.providers.isDisabled),jv(),sg("split-dropdown-events",[eo(fT,gg.focus),Xv(a,u),Yv(a,u)]),Zx.config({})]),eventOrder:(r={},r[Pr()]=["alloy.base.behaviour","split-dropdown-events"],r),toggleClass:"tox-tbtn--enabled",lazySink:n.getSink,fetch:vT(i,e,n.providers),parts:{menu:bh(0,e.columns,e.presets)},components:[uT.parts.button(mT(e.icon,e.text,v.none(),v.some(o),v.some([_g.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),n.providers)),uT.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:dp("chevron-down",n.providers.icons)},buttonBehaviours:ic([qv(n.providers.isDisabled),jv()])}),uT.parts["aria-descriptor"]({text:n.providers.translate("To open the popup, press Shift+Enter")})]})}(e,n.backstage.shared)})),grouptoolbarbutton:oA((function(t){return xe("GroupToolbarButton",$E,t)}),(function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=((r={})[Uc]=e.backstage.shared.header.isPositionedAtTop()?na.TopToBottom:na.BottomToTop,r);switch(kv(n)){case th.floating:return function(t,e,n,r){var o=e.shared;return lE.sketch({lazySink:o.getSink,fetch:function(){return Cx((function(e){e(F(n(t.items),zE))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:mT(t.icon,t.text,t.tooltip,v.none(),v.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})}(t,e.backstage,(function(t){return sA(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,v.none())}),i);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})),styleSelectButton:function(t,e){return function(t,e){var n=f({type:"advanced"},e.styleselect);return RT(t,e,nA(t,n))}(t,e.backstage)},fontsizeSelectButton:function(t,e){return function(t,e){return RT(t,e,XT(t))}(t,e.backstage)},fontSelectButton:function(t,e){return function(t,e){return RT(t,e,WT(t))}(t,e.backstage)},formatButton:function(t,e){return function(t,e){return RT(t,e,eA(t))}(t,e.backstage)},alignMenuButton:function(t,e){return function(t,e){return RT(t,e,zT(t))}(t,e.backstage)}},uA={styleselect:iA.styleSelectButton,fontsizeselect:iA.fontsizeSelectButton,fontselect:iA.fontSelectButton,formatselect:iA.formatButton,align:iA.alignMenuButton},aA=function(t){var e,n=t.toolbar,r=t.buttons;return!1===n?[]:void 0===n||!0===n?function(t){var e=F(rA,(function(e){var n=H(e.items,(function(e){return Et(t,e)||Et(uA,e)}));return{name:e.name,items:n}}));return H(e,(function(t){return t.items.length>0}))}(r):x(n)?(e=n.split("|"),F(e,(function(t){return{items:t.trim().split(" ")}}))):function(t){return T(t,(function(t){return Et(t,"name")&&Et(t,"items")}))}(n)?n:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},cA=function(t,e,n,r,o,i){return _t(e,n.toLowerCase()).orThunk((function(){return i.bind((function(t){return et(t,(function(t){return _t(e,t+n.toLowerCase())}))}))})).fold((function(){return _t(uA,n.toLowerCase()).map((function(e){return e(t,o)})).orThunk((function(){return v.none()}))}),(function(e){return"grouptoolbarbutton"!==e.type||r?function(t,e,n){return _t(iA,t.type).fold((function(){return console.error("skipping button defined by",t),v.none()}),(function(r){return v.some(r(t,e,n))}))}(e,o,t):(console.warn("Ignoring the '"+n+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),v.none())}))},sA=function(t,e,n,r){var o=aA(e),i=F(o,(function(o){var i=G(o.items,(function(o){return 0===o.trim().length?[]:cA(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()}));return{title:v.from(t.translate(o.name)),items:i}}));return H(i,(function(t){return t.items.length>0}))},fA={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"]},lA={maxHeightFunction:Ic(),maxWidthFunction:G_()},dA={onLtr:function(){return[Ua,Wa,za,Va,ja,Ha,up,ap,op,np,ip,rp]},onRtl:function(){return[Ua,Wa,ja,Ha,za,Va,up,ap,ip,rp,op,np]}},mA={onLtr:function(){return[Wa,Va,Ha,za,ja,Ua,up,ap,op,np,ip,rp]},onRtl:function(){return[Wa,Ha,Va,ja,za,Ua,up,ap,ip,rp,op,np]}},gA=function(t,e,n,r){var o,i,u=jn().deviceType.isTouch,a=hu((o={sink:n,onEscape:function(){return t.focus(),v.some(!0)}},i=an([]),Kg.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),Kg.getContent(t).each((function(t){nu(t.element,"visibility")})),Bi(t.element,BT),nu(t.element,"width")},inlineBehaviours:ic([sg("context-toolbar-events",[co(vr(),(function(t,e){Bi(t.element,BT),nu(t.element,"width")})),eo(AT,(function(t,e){nu(t.element,"width");var n=Tu(t.element);Kg.setContent(t,e.event.contents),Ti(t.element,BT);var r=Tu(t.element);Xi(t.element,"width",n+"px"),Kg.getContent(t).each((function(n){e.event.focus.bind((function(e){return mc(e),pc(t.element)})).orThunk((function(){return rg.focusIn(n),gc()}))})),cp.setTimeout((function(){Xi(t.element,"width",r+"px")}),0)})),eo(ET,(function(t,e){Kg.getContent(t).each((function(t){i.set(i.get().concat([{bar:t,focus:gc()}]))})),$r(t,AT,{contents:e.event.forwardContents,focus:v.none()})})),eo(TT,(function(t,e){Z(i.get()).each((function(e){i.set(i.get().slice(0,i.get().length-1)),$r(t,AT,{contents:vu(e.bar),focus:e.focus})}))}))]),rg.config({mode:"special",onEscape:function(t){return Z(i.get()).fold((function(){return o.onEscape()}),(function(e){return Gr(t,TT),v.some(!0)}))}})]),lazySink:function(){return ot.value(o.sink)}}))),c=function(){return CT(t,r.backstage.shared)},s=function(){if(u()&&r.backstage.isContextMenuOpen())return!0;var e,n,o,i,a,s,f=(e=g.get().filter((function(t){return Ui(sn.fromDom(t))})).map((function(t){return t.getBoundingClientRect()})).getOrThunk((function(){return t.selection.getRng().getBoundingClientRect()})),n=t.inline?Ru().top:ju(sn.fromDom(t.getBody())).y,{y:e.top+n,bottom:e.bottom+n}),l=c();return o=f.y,i=f.bottom,a=l.y,s=l.bottom,!(Math.max(o,a)<=Math.min(i,s))},l=function(){Kg.hide(a)},d=function(){m.get().each((function(t){var e=a.element;nu(e,"display"),s()?Xi(e,"display","none"):Ks.positionWithinBounds(n,t,a,v.some(c()))}))},m=an(v.none()),g=an(v.none()),p=an(null),h=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:ic([rg.config({mode:"acyclic"}),sg("pop-dialog-wrap-events",[so((function(e){t.shortcuts.add("ctrl+F9","focus statusbar",(function(){return rg.focusIn(e)}))})),fo((function(e){t.shortcuts.remove("ctrl+F9")}))])])}},b=Mt((function(){return _T(e,(function(t){var e=y([t]);$r(a,ET,{forwardContents:h(e)})}))})),y=function(e){var n=t.ui.registry.getAll().buttons,o=b(),i=f(f({},n),o.formNavigators),u=kv(t)===th.scrolling?th.scrolling:th.default,a=q(F(e,(function(e){return"contexttoolbar"===e.type?function(e,n){return sA(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,v.some(["form:"]))}(i,e):function(t,e){return wT(t,e)}(e,r.backstage.shared.providers)})));return GE({type:u,uid:Ko("context-toolbar"),initGroups:a,onEscape:v.none,cyclicKeying:!0,providers:r.backstage.shared.providers})};t.on("contexttoolbar-show",(function(e){var n=b();_t(n.lookupTable,e.toolbarKey).each((function(n){w([n],e.target===t?v.none():v.some(e)),Kg.getContent(a).each(rg.focusIn)}))}));var x=function(t,e){var n="node"===t?r.backstage.shared.anchors.node(e):r.backstage.shared.anchors.cursor();return Dt(n,function(t,e){return"line"===t?{bubble:Vc(12,0,fA),layouts:{onLtr:function(){return[qa]},onRtl:function(){return[Ga]}},overrides:lA}:{bubble:Vc(0,12,fA),layouts:e?mA:dA,overrides:lA}}(t,u()))},w=function(t,e){if(S(),!u()||!r.backstage.isContextMenuOpen()){var n=y(t),o=e.map(sn.fromDom),i=x(t[0].position,o);m.set(v.some(i)),g.set(e);var f=a.element;nu(f,"display"),Kg.showWithinBounds(a,i,h(n),(function(){return v.some(c())})),s()&&Xi(f,"display","none")}},C=function(){t.hasFocus()&&function(t,e){var n=sn.fromDom(e.getBody()),r=function(t){return qn(t,n)},o=sn.fromDom(e.selection.getNode());return function(t){return!r(t)&&!$n(n,t)}(o)?v.none():kT(o,t.inNodeScope,t.inEditorScope).orThunk((function(){return OT(r,o,t)}))}(b(),t).fold((function(){m.set(v.none()),Kg.hide(a)}),(function(t){w(t.toolbars,v.some(t.elem.dom))}))},S=function(){var t=p.get();null!==t&&(cp.clearTimeout(t),p.set(null))},k=function(t){S(),p.set(t)};t.on("init",(function(){t.on($_,l),t.on("ScrollContent ScrollWindow longpress",d),t.on("click keyup focus SetContent ObjectResized ResizeEditor",(function(){k(cp.setEditorTimeout(t,C,0))})),t.on("focusout",(function(e){cp.setEditorTimeout(t,(function(){pc(n.element).isNone()&&pc(a.element).isNone()&&(m.set(v.none()),Kg.hide(a))}),0)})),t.on("SwitchMode",(function(){t.mode.isReadOnly()&&(m.set(v.none()),Kg.hide(a))})),t.on("NodeChange",(function(e){pc(a.element).fold((function(){k(cp.setEditorTimeout(t,C,0))}),(function(t){}))}))}))},pA=Fl,hA=xl,vA=n([Ke("shell",!1),Ie("makeItem"),Ke("setupItem",t),Uf("listBehaviours",[cg])]),bA=vl({name:"items",overrides:function(){return{behaviours:ic([cg.config({})])}}}),yA=n([bA]),xA=n("CustomList"),wA=ql({name:xA(),configFields:vA(),partFields:yA(),factory:function(t,e,n,r){var o=t.shell?{behaviours:[cg.config({})],components:[]}:{behaviours:[],components:e},i=function(e){return t.shell?v.some(e):Al(e,t,"items")};return{uid:t.uid,dom:t.dom,components:o.components,behaviours:jf(t.listBehaviours,o.behaviours),apis:{setItems:function(e,n){i(e).fold((function(){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")}),(function(r){var o=cg.contents(r),i=n.length,u=i-o.length,a=u>0?I(u,(function(){return t.makeItem()})):[],c=o.slice(i);L(c,(function(t){return cg.remove(r,t)})),L(a,(function(t){return cg.append(r,t)}));var s=cg.contents(r);L(s,(function(r,o){t.setupItem(e,r,n[o],o)}))}))}}}},apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),CA=t,SA=a,kA=n([]),OA=Object.freeze({__proto__:null,setup:CA,isDocked:SA,getBehaviours:kA}),_A=function(t){return(Zi(t,"position").is("fixed")?v.none():Oo(t)).orThunk((function(){var e=sn.fromTag("span");return ko(t).bind((function(t){No(t,e);var n=Oo(e);return Mo(e),n}))}))},EA=function(t){return _A(t).map(Ou).getOrThunk((function(){return Su(0,0)}))},TA=At([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),AA=function(t,e){var n=t.element;Ti(n,e.transitionClass),Bi(n,e.fadeOutClass),Ti(n,e.fadeInClass),e.onShow(t)},BA=function(t,e){var n=t.element;Ti(n,e.transitionClass),Bi(n,e.fadeInClass),Ti(n,e.fadeOutClass),e.onHide(t)},NA=function(t,e,n){return $(t,(function(t){switch(t){case"bottom":return function(t,e){return t.bottom<=e.bottom}(e,n);case"top":return function(t,e){return t.y>=e.y}(e,n)}}))},DA=function(t,e){return e.getInitialPosition().map((function(e){return Hu(e.bounds.x,e.bounds.y,Tu(t),xu(t))}))},RA=function(t,e,n){return n.getInitialPosition().bind((function(r){switch(n.setInitialPosition(v.none()),r.position){case"static":return v.some(TA.static());case"absolute":var o=_A(t).map(zu).getOrThunk((function(){return zu(Wi())}));return v.some(TA.absolute(vc("absolute",_t(r.style,"left").map((function(t){return e.x-o.x})),_t(r.style,"top").map((function(t){return e.y-o.y})),_t(r.style,"right").map((function(t){return o.right-e.right})),_t(r.style,"bottom").map((function(t){return o.bottom-e.bottom})))));default:return v.none()}}))},MA=function(t,e,n){var r=zu(t);if(NA(n.getModes(),r,e))return v.none();!function(t,e,n){n.setInitialPosition(v.some({style:tu(t),position:Ji(t,"position")||"static",bounds:e}))}(t,r,n);var o=Uu(),i=r.x-o.x,u=e.y-o.y,a=o.bottom-e.bottom,c=r.y<=e.y;return v.some(TA.fixed(vc("fixed",v.some(i),c?v.some(u):v.none(),v.none(),c?v.none():v.some(a))))},IA=function(t,e,n){var r=t.element;return Zi(r,"position").is("fixed")?function(t,e,n){return DA(t,n).filter((function(t){return NA(n.getModes(),t,e)})).bind((function(e){return RA(t,e,n)}))}(r,e,n):MA(r,e,n)},PA=function(t,e){L(["left","right","top","bottom","position"],(function(e){return nu(t.element,e)})),e.onUndocked(t)},FA=function(t,e,n){bc(t.element,n),("fixed"===n.position?e.onDocked:e.onUndocked)(t)},LA=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each((function(e){e.lazyContext(t).each((function(i){var u=function(t,e){return t.y<e.bottom&&t.bottom>e.y}(i,r);u!==n.isVisible()&&(n.setVisible(u),o&&!u?(Di(t.element,[e.fadeOutClass]),e.onHide(t)):(u?AA:BA)(t,e))}))}))},VA=function(e,n,r){var o=e.element;r.setDocked(!1),function(t,e){var n=t.element;return DA(n,e).bind((function(t){return RA(n,t,e)}))}(e,r).each((function(r){r.fold((function(){return PA(e,n)}),(function(t){return FA(e,n,t)}),t)})),r.setVisible(!0),n.contextual.each((function(t){Ri(o,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(e)})),HA(e,n,r)},HA=function(t,e,n){t.getSystem().isConnected()&&function(t,e,n){var r=e.lazyViewport(t),o=n.isDocked();o&&LA(t,e,n,r),IA(t,r,n).each((function(i){n.setDocked(!o),i.fold((function(){return PA(t,e)}),(function(n){return FA(t,e,n)}),(function(o){LA(t,e,n,r,!0),FA(t,e,o)}))}))}(t,e,n)},zA=function(t,e,n){n.isDocked()&&VA(t,e,n)},jA=Object.freeze({__proto__:null,refresh:HA,reset:zA,isDocked:function(t,e,n){return n.isDocked()},getModes:function(t,e,n){return n.getModes()},setModes:function(t,e,n,r){return n.setModes(r)}}),UA=Object.freeze({__proto__:null,events:function(t,e){return Qr([co(vr(),(function(n,r){t.contextual.each((function(t){Ni(n.element,t.transitionClass)&&(Ri(n.element,[t.transitionClass,t.fadeInClass]),(e.isVisible()?t.onShown:t.onHidden)(n));r.stop()}))})),eo(Mr(),(function(n,r){HA(n,t,e)})),eo(Ir(),(function(n,r){zA(n,t,e)}))])}}),WA=[Ye("contextual",[Le("fadeInClass"),Le("fadeOutClass"),Le("transitionClass"),He("lazyContext"),pa("onShow"),pa("onShown"),pa("onHide"),pa("onHidden")]),nn("lazyViewport",Uu),rn("modes",["top","bottom"],Ae),pa("onDocked"),pa("onUndocked")],qA=Object.freeze({__proto__:null,init:function(t){var e=an(!1),n=an(!0),r=an(v.none()),o=an(t.modes);return mi({isDocked:e.get,setDocked:e.set,getInitialPosition:r.get,setInitialPosition:r.set,isVisible:n.get,setVisible:n.set,getModes:o.get,setModes:o.set,readState:function(){return"docked:  "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")}})}}),GA=ac({fields:WA,name:"docking",active:UA,apis:jA,state:qA}),$A={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},XA="tox-tinymce--toolbar-sticky-on",YA="tox-tinymce--toolbar-sticky-off",KA=function(t){var e=t.element;ko(e).each((function(n){var r="padding-"+GA.getModes(t)[0];if(GA.isDocked(t)){var o=Tu(n);Xi(e,"width",o+"px"),Xi(n,r,function(t){return wu(t)+(parseInt(Ji(t,"margin-top"),10)||0)+(parseInt(Ji(t,"margin-bottom"),10)||0)}(e)+"px")}else nu(e,"width"),nu(n,r)}))},JA=function(t,e){e?(Bi(t,$A.fadeOutClass),Di(t,[$A.transitionClass,$A.fadeInClass])):(Bi(t,$A.fadeInClass),Di(t,[$A.fadeOutClass,$A.transitionClass]))},QA=function(t,e){var n=sn.fromDom(t.getContainer());e?(Ti(n,XA),Bi(n,YA)):(Ti(n,YA),Bi(n,XA))},ZA=function(t,e){var n=an(v.none()),r=e.getSink,o=function(t){r().each((function(e){return t(e.element)}))},i=function(e){t.inline||KA(e),QA(t,GA.isDocked(e)),e.getSystem().broadcastOn([wf()],{}),r().each((function(t){return t.getSystem().broadcastOn([wf()],{})}))},u=t.inline?[]:function(){var t;return[lc.config({channels:(t={},t[VE()]={onReceive:KA},t)})]}();return d([gg.config({}),GA.config({contextual:f({lazyContext:function(e){var n,r,o=wu(e.element),i=t.inline?t.getContentAreaContainer():t.getContainer(),u=zu(sn.fromDom(i)),a=u.height-o,c=u.y+(n=e,r="top",R(GA.getModes(n),r)?0:o);return v.some(Hu(u.x,c,u.width,a))},onShow:function(){o((function(t){return JA(t,!0)}))},onShown:function(t){o((function(t){return Ri(t,[$A.transitionClass,$A.fadeInClass])})),n.get().each((function(e){var r,o,i;r=t.element,i=xo(o=e),gc(i).filter((function(t){return!qn(o,t)})).filter((function(t){return qn(t,sn.fromDom(i.dom.body))||$n(r,t)})).each((function(){return mc(o)})),n.set(v.none())}))},onHide:function(t){n.set(function(t,e){return pc(t).orThunk((function(){return e().toOptional().bind((function(t){return pc(t.element)}))}))}(t.element,r)),o((function(t){return JA(t,!1)}))},onHidden:function(){o((function(t){return Ri(t,[$A.transitionClass])}))}},$A),modes:[e.header.getDockingMode()],onDocked:i,onUndocked:i})],u)},tB=Object.freeze({__proto__:null,setup:function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",(function(){n().each(GA.reset)})),t.on("ResizeWindow ResizeEditor",(function(){n().each(KA)})),t.on("SkinLoaded",(function(){n().each((function(t){GA.isDocked(t)?GA.reset(t):GA.refresh(t)}))})),t.on("FullscreenStateChanged",(function(){n().each(GA.reset)}))),t.on("AfterScrollIntoView",(function(t){n().each((function(e){GA.refresh(e);var n=e.element;Jd(n)&&function(t,e){var n=xo(e),r=n.dom.defaultView.innerHeight,o=Ru(n),i=sn.fromDom(t.elm),u=ju(i),a=xu(i),c=u.y,s=c+a,f=Ou(e),l=xu(e),d=f.top,m=d+l,g=Math.abs(d-o.top)<2,p=Math.abs(m-(o.top+r))<2;if(g&&c<m)Mu(o.left,c-l,n);else if(p&&s>d){var h=c-r+a+l;Mu(o.left,h,n)}}(t,n)}))})),t.on("PostRender",(function(){QA(t,!1)}))},isDocked:function(t){return t().map(GA.isDocked).getOr(!1)},getBehaviours:ZA}),eB=Wl({factory:function(t,e){var n={focus:rg.focusIn,setMenus:function(t,n){var r=F(n,(function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=KE(n).mapError((function(t){return Se(t)})).getOrDie();return Bk(r,"tox-mbtn",e.backstage,v.some("menuitem"))}));cg.set(t,r)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:ic([cg.config({}),sg("menubar-events",[so((function(e){t.onSetup(e)})),eo(sr(),(function(t,e){Ku(t.element,".tox-mbtn--active").each((function(n){Ju(e.event.target,".tox-mbtn").each((function(e){qn(n,e)||t.getSystem().getByDom(n).each((function(n){t.getSystem().getByDom(e).each((function(t){Jx.expand(t),Jx.close(n),gg.focus(t)}))}))}))}))})),eo(Hr(),(function(t,e){e.event.prevFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(n){e.event.newFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(t){Jx.isOpen(n)&&(Jx.expand(t),Jx.close(n))}))}))}))]),rg.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),v.some(!0)}}),$y.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Ie("dom"),Ie("uid"),Ie("onEscape"),Ie("backstage"),Ke("onSetup",t)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),nB="container",rB=[Hf("slotBehaviours",[])],oB=function(t){return"<alloy.field."+t+">"},iB=function(t,e){var n,r=function(e){return Rl(t)},o=function(e,n){return function(r,o){return Al(r,t,o).map((function(t){return e(t,o)})).getOr(n)}},i=function(t,e){return"true"!==Ho(t.element,"aria-hidden")},u=o(i,!1),a=o((function(t,e){if(i(t)){var n=t.element;Xi(n,"display","none"),Vo(n,"aria-hidden","true"),$r(t,zr(),{name:e,visible:!1})}})),c=(n=a,function(t,e){L(e,(function(e){return n(t,e)}))}),s=o((function(t,e){if(!i(t)){var n=t.element;nu(n,"display"),Uo(n,"aria-hidden"),$r(t,zr(),{name:e,visible:!0})}})),f={getSlotNames:r,getSlot:function(e,n){return Al(e,t,n)},isShowing:u,hideSlot:a,hideAllSlots:function(t){return c(t,r())},showSlot:s};return{uid:t.uid,dom:t.dom,components:e,behaviours:zf(t.slotBehaviours),apis:f}},uB=xt({getSlotNames:function(t,e){return t.getSlotNames(e)},getSlot:function(t,e,n){return t.getSlot(e,n)},isShowing:function(t,e,n){return t.isShowing(e,n)},hideSlot:function(t,e,n){return t.hideSlot(e,n)},hideAllSlots:function(t,e){return t.hideAllSlots(e)},showSlot:function(t,e,n){return t.showSlot(e,n)}},(function(t){return li(t)})),aB=f(f({},uB),{sketch:function(t){var e=function(){var t=[];return{slot:function(e,n){return t.push(e),kl(nB,oB(e),n)},record:function(){return t}}}(),n=t(e),r=e.record(),o=F(r,(function(t){return pl({name:t,pname:oB(t)})}));return Vl(nB,rB,o,iB,n)}}),cB=ie([$e("icon"),$e("tooltip"),nn("onShow",t),nn("onHide",t),nn("onSetup",(function(){return t}))]),sB=function(t){return{element:function(){return t.element.dom}}},fB=function(e,n){var r=F(vt(n),(function(t){var e=n[t],r=we(function(t){return xe("sidebar",cB,t)}(e));return{name:t,getApi:sB,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return F(r,(function(n){var o=an(t);return e.slot(n.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:zh([Xv(n,o),Yv(n,o),eo(zr(),(function(t,e){var n=e.event;U(r,(function(t){return t.name===n.name})).each((function(e){(n.visible?e.onShow:e.onHide)(e.getApi(t))}))}))])})}))},lB=function(t){return aB.sketch((function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:fB(e,t),slotBehaviours:zh([so((function(t){return aB.hideAllSlots(t)}))])}}))},dB=function(t){return Jl.getCurrent(t).bind((function(t){return RE.isGrowing(t)||RE.hasGrown(t)?Jl.getCurrent(t).bind((function(t){return U(aB.getSlotNames(t),(function(e){return aB.isShowing(t,e)}))})):v.none()}))},mB=Ko("FixSizeEvent"),gB=Ko("AutoSizeEvent"),pB=function(t){var e=sn.fromHtml(t),n=_o(e),r=function(t){var e=void 0!==t.dom.attributes?t.dom.attributes:[];return j(e,(function(t,e){var n;return"class"===e.name?t:f(f({},t),((n={})[e.name]=e.value,n))}),{})}(e),o=function(t){return Array.prototype.slice.call(t.dom.classList,0)}(e),i=0===n.length?{}:{innerHtml:Po(e)};return f({tag:go(e),classes:o,attributes:r},i)},hB=function(t){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading...")},classes:["tox-throbber__busy-spinner"]},components:[{dom:pB('<div class="tox-spinner"><div></div><div></div><div></div></div>')}],behaviours:ic([rg.config({mode:"special",onTab:function(){return v.some(!0)},onShiftTab:function(){return v.some(!0)}}),gg.config({})])}},vB=function(t,e,n){var r=an(!1),o=an(v.none()),i=function(t){t!==r.get()&&(!function(t,e,n){var r=t.element;!0===e?(cg.set(t,[hB(n)]),nu(r,"display"),Uo(r,"aria-hidden")):(cg.set(t,[]),Xi(r,"display","none"),Vo(r,"aria-hidden","true"))}(e(),t,n.providers),r.set(t))};t.on("ProgressState",(function(e){if(o.get().each(cp.clearTimeout),E(e.time)){var n=cp.setEditorTimeout(t,(function(){return i(e.state)}),e.time);o.set(v.some(n))}else i(e.state),o.set(v.none())}))},bB=hA.optional({factory:eB,name:"menubar",schema:[Ie("backstage")]}),yB=hA.optional({factory:{sketch:function(t){return wA.sketch({uid:t.uid,dom:t.dom,listBehaviours:ic([rg.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return GE({type:t.type,uid:Ko("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),v.some(!0)}})},setupItem:function(t,e,n,r){K_.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[Ie("dom"),Ie("onEscape")]}),xB=hA.optional({factory:{sketch:function(t){return function(t){return t.type===th.sliding?qE:t.type===th.floating?WE:GE}(t)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),v.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[Ie("dom"),Ie("onEscape"),Ie("getSink")]}),wB=hA.optional({factory:{sketch:function(t){var e=t.editor,n=t.sticky?ZA:kA;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:ic(n(e,t.sharedBackstage))}}},name:"header",schema:[Ie("dom")]}),CB=hA.optional({name:"socket",schema:[Ie("dom")]}),SB=hA.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:ic([$y.config({}),gg.config({}),RE.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:function(t){Jl.getCurrent(t).each(aB.hideAllSlots),Gr(t,gB)},onGrown:function(t){Gr(t,gB)},onStartGrow:function(t){$r(t,mB,{width:Zi(t.element,"width").getOr("")})},onStartShrink:function(t){$r(t,mB,{width:Tu(t.element)+"px"})}}),cg.config({}),Jl.config({find:function(t){var e=cg.contents(t);return Q(e)}})])}],behaviours:ic([uS(0),sg("sidebar-sliding-events",[eo(mB,(function(t,e){Xi(t.element,"width",e.event.width)})),eo(gB,(function(t,e){nu(t.element,"width")}))])])}}},name:"sidebar",schema:[Ie("dom")]}),kB=hA.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:ic([cg.config({})]),components:[]}}},name:"throbber",schema:[Ie("dom")]}),OB=ql({name:"OuterContainer",factory:function(t,e,n){var r={getSocket:function(e){return pA.getPart(e,t,"socket")},setSidebar:function(e,n){pA.getPart(e,t,"sidebar").each((function(t){return function(t,e){Jl.getCurrent(t).each((function(t){return cg.set(t,[lB(e)])}))}(t,n)}))},toggleSidebar:function(e,n){pA.getPart(e,t,"sidebar").each((function(t){return function(t,e){Jl.getCurrent(t).each((function(t){Jl.getCurrent(t).each((function(n){RE.hasGrown(t)?aB.isShowing(n,e)?RE.shrink(t):(aB.hideAllSlots(n),aB.showSlot(n,e)):(aB.hideAllSlots(n),aB.showSlot(n,e),RE.grow(t))}))}))}(t,n)}))},whichSidebar:function(e){return pA.getPart(e,t,"sidebar").bind(dB).getOrNull()},getHeader:function(e){return pA.getPart(e,t,"header")},getToolbar:function(e){return pA.getPart(e,t,"toolbar")},setToolbar:function(e,n){pA.getPart(e,t,"toolbar").each((function(t){t.getApis().setGroups(t,n)}))},setToolbars:function(e,n){pA.getPart(e,t,"multiple-toolbar").each((function(t){wA.setItems(t,n)}))},refreshToolbar:function(e){pA.getPart(e,t,"toolbar").each((function(t){return t.getApis().refresh(t)}))},toggleToolbarDrawer:function(e){pA.getPart(e,t,"toolbar").each((function(t){var e,n;e=t.getApis().toggle,n=function(e){return e(t)},null!=e?v.some(n(e)):v.none()}))},isToolbarDrawerToggled:function(e){return pA.getPart(e,t,"toolbar").bind((function(t){return v.from(t.getApis().isOpen).map((function(e){return e(t)}))})).getOr(!1)},getThrobber:function(e){return pA.getPart(e,t,"throbber")},focusToolbar:function(e){pA.getPart(e,t,"toolbar").orThunk((function(){return pA.getPart(e,t,"multiple-toolbar")})).each((function(t){rg.focusIn(t)}))},setMenubar:function(e,n){pA.getPart(e,t,"menubar").each((function(t){eB.setMenus(t,n)}))},focusMenubar:function(e){pA.getPart(e,t,"menubar").each((function(t){eB.focus(t)}))}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},configFields:[Ie("dom"),Ie("behaviours")],partFields:[wB,bB,xB,yB,CB,SB,kB],apis:{getSocket:function(t,e){return t.getSocket(e)},setSidebar:function(t,e,n){t.setSidebar(e,n)},toggleSidebar:function(t,e,n){t.toggleSidebar(e,n)},whichSidebar:function(t,e){return t.whichSidebar(e)},getHeader:function(t,e){return t.getHeader(e)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var r=F(n,(function(t){return zE(t)}));t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=F(n,(function(t){return F(t,zE)}));t.setToolbars(e,r)},refreshToolbar:function(t,e){return t.refreshToolbar(e)},toggleToolbarDrawer:function(t,e){t.toggleToolbarDrawer(e)},isToolbarDrawerToggled:function(t,e){return t.isToolbarDrawerToggled(e)},getThrobber:function(t,e){return t.getThrobber(e)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),_B={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},EB=function(t){return"string"==typeof t?t.split(" "):t},TB=function(t,e){var n=f(f({},_B),e.menus),r=vt(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?EB("file edit view insert format tools table help"):EB(!1===e.menubar?"":e.menubar),i=H(o,(function(t){return r&&e.menus.hasOwnProperty(t)&&e.menus[t].hasOwnProperty("items")||_B.hasOwnProperty(t)})),u=F(i,(function(r){var o=n[r];return function(t,e,n){var r=function(t){return t.getParam("removed_menuitems","")}(n).split(/[ ,]/);return{text:t.title,getItems:function(){return G(t.items,(function(t){var n=t.toLowerCase();return 0===n.trim().length||M(r,(function(t){return t===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]}))}}}({title:o.title,items:EB(o.items)},e,t)}));return H(u,(function(t){return t.getItems().length>0&&M(t.getItems(),(function(t){return"separator"!==t.type}))}))},AB=function(t){var e=function(){t._skinLoaded=!0,function(t){t.fire("SkinLoaded")}(t)};return function(){t.initialized?e():t.on("init",e)}},BB=function(t,e,n){return new Ap((function(r,o){n.load(e,r,o),t.on("remove",(function(){return n.unload(e)}))}))},NB=function(t,e){return BB(t,e+"/skin.min.css",t.ui.styleSheetLoader)},DB=function(t,e){var n;return(n=sn.fromDom(t.getElement()),Hi(n).isSome())?BB(t,e+"/skin.shadowdom.min.css",Kh.DOM.styleSheetLoader):Ap.resolve()},RB=function(t,e){var n=function(t){var e=t.getParam("skin"),n=t.getParam("skin_url");if(!1!==e){var r=e||"oxide";n=n?t.documentBaseURI.toAbsolute(n):dv.baseURL+"/skins/ui/"+r}return n}(e);n&&e.contentCSS.push(n+(t?"/content.inline":"/content")+".min.css"),!1===function(t){return!1===t.getParam("skin")}(e)&&x(n)?Ap.all([NB(e,n),DB(e,n)]).then(AB(e),function(t,e){return function(){return function(t,e){return t.fire("SkinLoadError",e)}(t,{message:e})}}(e,"Skin could not be loaded")):AB(e)()},MB=o(RB,!1),IB=o(RB,!0),PB=function(t,e,n,r){var o=e.outerContainer,i=n.toolbar,u=n.buttons;if(T(i,x)){var a=i.map((function(e){var o={toolbar:e,buttons:u,allowToolbarGroups:n.allowToolbarGroups};return sA(t,o,{backstage:r},v.none())}));OB.setToolbars(o,a)}else OB.setToolbar(o,sA(t,n,{backstage:r},v.none()))},FB=jn(),LB=FB.os.isiOS()&&FB.os.version.major<=12,VB=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=an(0),u=e.outerContainer;MB(t);var a=sn.fromDom(o.targetNode),c=Vi(Li(a));!function(t,e){cf(t,e,Ao)}(a,e.mothership),af(c,e.uiMothership),t.on("PostRender",(function(){PB(t,e,n,r),i.set(t.getWin().innerWidth),OB.setMenubar(u,TB(t,n)),OB.setSidebar(u,n.sidebar),function(t,e){var n=t.dom,r=t.getWin(),o=t.getDoc().documentElement,i=an(Su(r.innerWidth,r.innerHeight)),u=an(Su(o.offsetWidth,o.offsetHeight)),a=function(){var e=i.get();e.left===r.innerWidth&&e.top===r.innerHeight||(i.set(Su(r.innerWidth,r.innerHeight)),Ib(t))},c=function(){var e=t.getDoc().documentElement,n=u.get();n.left===e.offsetWidth&&n.top===e.offsetHeight||(u.set(Su(e.offsetWidth,e.offsetHeight)),Ib(t))},s=function(e){return function(t,e){return t.fire("ScrollContent",e)}(t,e)};n.bind(r,"resize",a),n.bind(r,"scroll",s);var f=Sy(sn.fromDom(t.getBody()),"load",c),l=e.uiMothership.element;t.on("hide",(function(){Xi(l,"display","none")})),t.on("show",(function(){nu(l,"display")})),t.on("NodeChange",c),t.on("remove",(function(){f.unbind(),n.unbind(r,"resize",a),n.unbind(r,"scroll",s),r=null}))}(t,e)}));var s,f,l,d=OB.getSocket(u).getOrDie("Could not find expected socket element");if(LB){Yi(d.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var m=(s=function(){t.fire("ScrollContent")},f=20,l=null,{cancel:function(){null!==l&&(clearTimeout(l),l=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];null===l&&(l=setTimeout((function(){s.apply(null,t),l=null}),f))}}),g=Cy(d.element,"scroll",m.throttle);t.on("remove",g.unbind)}zv(t,e),t.addCommand("ToggleSidebar",(function(e,n){OB.toggleSidebar(u,n),t.fire("ToggleSidebar")})),t.addQueryValueHandler("ToggleSidebar",(function(){return OB.whichSidebar(u)}));var p=kv(t);p!==th.sliding&&p!==th.floating||t.on("ResizeWindow ResizeEditor ResizeContent",(function(){var n=t.getWin().innerWidth;n!==i.get()&&(OB.refreshToolbar(e.outerContainer),i.set(n))}));var h={enable:function(){Hv(e,!1)},disable:function(){Hv(e,!0)},isDisabled:function(){return lv.isDisabled(u)}};return{iframeContainer:d.element.dom,editorContainer:u.element.dom,api:h}}}),HB=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?v.some(parseInt(""+t,10)):v.none()},zB=function(t){return E(t)?t+"px":t},jB=function(t,e,n){var r=e.filter((function(e){return t<e})),o=n.filter((function(e){return t>e}));return r.or(o).getOr(t)},UB=function(t){return function(t){var e=mv(t),n=hv(t),r=bv(t);return HB(e).map((function(t){return jB(t,n,r)}))}(t).getOr(mv(t))},WB=function(t){var e=gv(t),n=pv(t),r=vv(t);return HB(e).map((function(t){return jB(t,n,r)}))},qB=function(t,e,n,r,o){var i=n.uiMothership,u=n.outerContainer,a=Kh.DOM,c=Bv(t),s=Rv(t),f=vv(t).or(WB(t)),l=r.shared.header,d=l.isPositionedAtTop,m=kv(t),g=m===th.sliding||m===th.floating,p=an(!1),h=function(){return p.get()&&!t.removed},v=function(t){return g?t.fold((function(){return 0}),(function(t){return t.components().length>1?xu(t.components()[1].element):0})):0},b=function(){i.broadcastOn([wf()],{})},y=function(t){if(void 0===t&&(t=!1),h()){var n;if(c||(n=f.getOrThunk((function(){var t=HB(Ji(Wi(),"margin-left")).getOr(0);return Tu(Wi())-Ou(e).left+t})),Xi(o.get().element,"max-width",n+"px")),g&&OB.refreshToolbar(u),c||function(){var t=OB.getToolbar(u),n=v(t),r=zu(e),i=d()?Math.max(r.y-xu(o.get().element)+n,0):r.bottom;Yi(u.element,{position:"absolute",top:Math.round(i)+"px",left:Math.round(r.x)+"px"})}(),s){var r=o.get();t?GA.reset(r):GA.refresh(r)}b()}},x=function(n){if(void 0===n&&(n=!0),!c&&s&&h()){var r=l.getDockingMode(),i=function(n){switch(Ev(t)){case Sv.auto:var r=OB.getToolbar(u),o=v(r),i=xu(n.element)-o,a=zu(e);if(a.y>i)return"top";var c=Co(e),s=Math.max(c.dom.scrollHeight,xu(c));return a.bottom<s-i||Uu().bottom<a.bottom-i?"bottom":"top";case Sv.bottom:return"bottom";case Sv.top:default:return"top"}}(o.get());i!==r&&(!function(t){var e=o.get();GA.setModes(e,[t]),l.setDockingMode(t);var n=d()?na.TopToBottom:na.BottomToTop;Vo(e.element,Uc,n)}(i),n&&y(!0))}};return{isVisible:h,isPositionedAtTop:d,show:function(){p.set(!0),Xi(u.element,"display","flex"),a.addClass(t.getBody(),"mce-edit-focus"),nu(i.element,"display"),x(!1),y()},hide:function(){p.set(!1),n.outerContainer&&(Xi(u.element,"display","none"),a.removeClass(t.getBody(),"mce-edit-focus")),Xi(i.element,"display","none")},update:y,updateMode:x,repositionPopups:b}},GB=function(t,e){var n=zu(t);return{pos:e?n.y:n.bottom,bounds:n}},$B=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=e.mothership,u=e.uiMothership,a=e.outerContainer,c=an(null),s=sn.fromDom(o.targetNode),f=qB(t,s,e,r,c),l=function(t){return t.getParam("toolbar_persist",!1,"boolean")}(t);IB(t);var d=function(){if(c.get())f.show();else{c.set(OB.getHeader(a).getOrDie());var o=Nv(t);af(o,i),af(o,u),PB(t,e,n,r),OB.setMenubar(a,TB(t,n)),f.show(),function(t,e,n,r){var o=an(GB(e,n.isPositionedAtTop())),i=function(r){var i=GB(e,n.isPositionedAtTop()),u=i.pos,a=i.bounds,c=o.get(),s=c.pos,f=c.bounds,l=a.height!==f.height||a.width!==f.width;o.set({pos:u,bounds:a}),l&&Ib(t,r),n.isVisible()&&(s!==u?n.update(!0):l&&(n.updateMode(),n.repositionPopups()))};r||(t.on("activate",n.show),t.on("deactivate",n.hide)),t.on("SkinLoaded ResizeWindow",(function(){return n.update(!0)})),t.on("NodeChange keydown",(function(t){cp.requestAnimationFrame((function(){return i(t)}))})),t.on("ScrollWindow",(function(){return n.updateMode()}));var u=QT();u.set(Sy(sn.fromDom(t.getBody()),"load",i)),t.on("remove",(function(){u.clear()}))}(t,s,f,l),t.nodeChanged()}};t.on("show",d),t.on("hide",f.hide),l||(t.on("focus",d),t.on("blur",f.hide)),t.on("init",(function(){(t.hasFocus()||l)&&d()})),zv(t,e);var m={show:function(){f.show()},hide:function(){f.hide()},enable:function(){Hv(e,!1)},disable:function(){Hv(e,!0)},isDisabled:function(){return lv.isDisabled(a)}};return{editorContainer:a.element.dom,api:m}}}),XB=function(t,e){!function(t,e){var n=DT(0,e,zT(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=DT(0,e,WT(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=f({type:"advanced"},e.styleselect),r=DT(0,e,nA(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})}(t,e),function(t,e){var n=DT(0,e,eA(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=DT(0,e,XT(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e)},YB=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},KB=function(t){!function(t){fS.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],(function(e,n){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:ZT(t,e.name),onAction:YB(t,e.name)})}));for(var e=1;e<=6;e++){var n="h"+e;t.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+e,onSetup:ZT(t,n),onAction:YB(t,n)})}}(t),function(t){fS.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],(function(e){t.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onAction:function(){return t.execCommand(e.action)}})}))}(t),function(t){fS.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:function(){return t.execCommand(e.action)},onSetup:ZT(t,e.name)})}))}(t)},JB=function(t){KB(t),function(t){fS.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",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],(function(e){t.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onAction:function(){return t.execCommand(e.action)}})})),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:YB(t,"code")})}(t)},QB=function(t,e,n){var r=function(){return!!e.undoManager&&e.undoManager[n]()},o=function(){t.setDisabled(e.mode.isReadOnly()||!r())};return t.setDisabled(!r()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o),function(){return e.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o)}},ZB=function(t){!function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(e){return QB(e,t,"hasUndo")},onAction:function(){return t.execCommand("undo")}}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:function(e){return QB(e,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}})}(t),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(e){return QB(e,t,"hasUndo")},onAction:function(){return t.execCommand("undo")}}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(e){return QB(e,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}})}(t)},tN={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:[""]},eN=(IT="[eE][+-]?[0-9]+",FT=["Infinity","[0-9]+\\."+(PT=function(t){return"(?:"+t+")?"})(MT="[0-9]+")+PT(IT),"\\.[0-9]+"+PT(IT),MT+PT(IT)].join("|"),new RegExp("^([+-]?(?:"+FT+"))(.*)$")),nN=function(t,e){return v.from(eN.exec(t)).bind((function(t){var n=Number(t[1]),r=t[2];return function(t,e){return M(e,(function(e){return M(tN[e],(function(e){return t===e}))}))}(r,e)?v.some({value:n,unit:r}):v.none()}))},rN=function(t){return function(t,e){return nN(t,e).map((function(t){return t.value+t.unit}))}(t,["fixed","relative","empty"]).getOr(t)},oN=function(t){var e=function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")}(t),n=new Map,r=JT(),o=function(){var e=rN(t.queryCommandValue("LineHeight"));v.from(n.get(e)).fold((function(){return r.clear()}),(function(t){r.set({destroy:function(){t.setActive(!1)}}),t.setActive(!0)}))};return t.on("nodeChange",o),F(e,(function(i,u){return{type:"togglemenuitem",text:i,onSetup:function(a){return n.set(rN(i),a),u+1===e.length&&o(),function(){0===u&&(t.off("nodeChange",o),r.clear())}},onAction:function(){return t.execCommand("LineHeight",!1,i)}}}))},iN=function(t){!function(t){t.ui.registry.addNestedMenuItem("lineheight",{type:"nestedmenuitem",text:"Line height",getSubmenuItems:function(){return oN(t)}})}(t),function(t){t.ui.registry.addMenuButton("lineheight",{tooltip:"Line height",icon:"line-height",fetch:function(e){return e(oN(t))}})}(t)},uN=function(t,e){!function(t){fS.each([{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"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,onAction:function(){return t.execCommand(e.cmd)},icon:e.icon,onSetup:ZT(t,e.name)})}));var e="alignnone",n="No alignment",r="JustifyNone",o="align-none";t.ui.registry.addButton(e,{tooltip:n,onAction:function(){return t.execCommand(r)},icon:o})}(t),JB(t),XB(t,e),ZB(t),function(t){!function(t){t.addCommand("mceApplyTextcolor",(function(e,n){!function(t,e,n){t.undoManager.transact((function(){t.focus(),t.formatter.apply(e,{value:n}),t.nodeChanged()}))}(t,e,n)})),t.addCommand("mceRemoveTextcolor",(function(e){!function(t,e){t.undoManager.transact((function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()}))}(t,e)}))}(t);var e=an(null),n=an(null);Yb(t,"forecolor","forecolor","Text color",e),Yb(t,"backcolor","hilitecolor","Background color",n),Kb(t,"forecolor","forecolor","Text color"),Kb(t,"backcolor","hilitecolor","Background color")}(t),function(t){!function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){return t.execCommand("mceToggleVisualAid")}})}(t),function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(e){return function(t,e){t.setActive(e.hasVisual);var n=function(e){t.setActive(e.hasVisual)};return e.on("VisualAid",n),function(){return e.off("VisualAid",n)}}(e,t)},onAction:function(){t.execCommand("mceToggleVisualAid")}})}(t)}(t),function(t){!function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:function(e){return function(t,e){t.setDisabled(!e.queryCommandState("outdent"));var n=function(){t.setDisabled(!e.queryCommandState("outdent"))};return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}}(e,t)},onAction:function(){return t.execCommand("outdent")}}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:function(){return t.execCommand("indent")}})}(t)}(t),iN(t)},aN=function(t,e){return{anchor:"makeshift",x:t,y:e}},cN=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},sN=function(t,e){var n=Kh.DOM.getPos(t);return function(t,e,n){return aN(t.x+e,t.y+n)}(e,n.x,n.y)},fN=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?function(t){if(cN(t)){var e=t.touches[0];return aN(e.pageX,e.pageY)}return aN(t.pageX,t.pageY)}(e):sN(t.getContentAreaContainer(),function(t){if(cN(t)){var e=t.touches[0];return aN(e.clientX,e.clientY)}return aN(t.clientX,t.clientY)}(e)):lN(t)},lN=function(t){return{anchor:"selection",root:sn.fromDom(t.selection.getNode())}},dN=function(t){return{anchor:"node",node:v.some(sn.fromDom(t.selection.getNode())),root:sn.fromDom(t.getBody())}},mN=function(t,e,n,r,o,i){var u=n(),a=i?dN(t):fN(t,e);Tk(u,eh.CLOSE_ON_EXECUTE,r,!1).map((function(t){e.preventDefault(),Kg.showMenuAt(o,a,{menu:{markers:ph("normal")},data:t})}))},gN={onLtr:function(){return[Wa,Va,Ha,za,ja,Ua,up,ap,op,np,ip,rp]},onRtl:function(){return[Wa,Ha,Va,ja,za,Ua,up,ap,ip,rp,op,np]}},pN={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"]},hN=function(t,e,n,r,o,i,u){var a=i?dN(t):function(t,e){return f({bubble:Vc(0,12,pN),layouts:gN,overrides:{maxWidthFunction:G_(),maxHeightFunction:Ic()}},fN(t,e))}(t,e);Tk(n,eh.CLOSE_ON_EXECUTE,r,!0).map((function(n){e.preventDefault(),Kg.showMenuWithinBounds(o,a,{menu:{markers:ph("normal"),highlightImmediately:u},data:n,type:"horizontal"},(function(){return v.some(CT(t,r.shared))})),t.fire($_)}))},vN=function(t,e,n,r,o,i){var u=jn(),a=u.os.isiOS(),c=u.os.isOSX(),s=u.os.isAndroid(),f=u.deviceType.isTouch(),l=function(){var u=n();hN(t,e,u,r,o,i,!(s||a||c&&f))};if(!c&&!a||i)s&&!i&&t.selection.setCursorLocation(e.target,0),l();else{var d=function(){!function(t){var e=t.selection.getRng(),n=function(){cp.setEditorTimeout(t,(function(){t.selection.setRng(e)}),10),i()};t.once("touchend",n);var r=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",r,!0);var o=function(){return i()};t.once("longpresscancel",o);var i=function(){t.off("touchend",n),t.off("longpresscancel",o),t.off("mousedown",r)}}(t),l()};!function(t,e){var n=t.selection;if(n.isCollapsed()||e.touches.length<1)return!1;var r=e.touches[0],o=n.getRng();return hs(t.getWin(),Zc.domRange(o)).exists((function(t){return t.left<=r.clientX&&t.right>=r.clientX&&t.top<=r.clientY&&t.bottom>=r.clientY}))}(t,e)?(t.once("selectionchange",d),t.once("touchend",(function(){return t.off("selectionchange",d)}))):d()}},bN=function(t){return"string"==typeof t?t.split(/[ ,]/):t},yN=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},xN=function(t){return function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return v.from(t.getParam(e)).map(bN).getOrThunk((function(){return H(bN(n),(function(t){return Et(r,t)}))}))}(t,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},wN=function(t){return x(t)?"|"===t:"separator"===t.type},CN={type:"separator"},SN=function(t){if(x(t))return t;switch(t.type){case"separator":return CN;case"submenu":return{type:"nestedmenuitem",text:t.text,icon:t.icon,getSubmenuItems:function(){var e=t.getSubmenuItems();return x(e)?e:F(e,SN)}};default:return{type:"menuitem",text:t.text,icon:t.icon,onAction:(e=t.onAction,function(){return e()})}}var e},kN=function(t,e){if(0===e.length)return t;var n=Z(t).filter((function(t){return!wN(t)})).fold((function(){return[]}),(function(t){return[CN]}));return t.concat(n).concat(e).concat([CN])},ON=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)},_N=function(t,e){return ON(t,e)?t.selection.getStart(!0):e.target},EN=function(t,e,n){var r=jn().deviceType.isTouch,o=hu(Kg.sketch({dom:{tag:"div"},lazySink:e,onEscape:function(){return t.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:ic([sg("dismissContextMenu",[eo(Lr(),(function(e,n){yf.close(e),t.focus()}))])])})),i=function(t){return Kg.hide(o)},u=function(e){if(yN(t)&&e.preventDefault(),!function(t,e){return e.ctrlKey&&!yN(t)}(t,e)&&!function(t){return!1===t.getParam("contextmenu")}(t)){var i=function(t,e){var n=function(t){return t.getParam("contextmenu_avoid_overlap","","string")}(t);if(ON(t,e))return!0;if(n){var r=_N(t,e);return Oy(sn.fromDom(r),n)}return!1}(t,e);(r()?vN:mN)(t,e,(function(){var n=_N(t,e),r=t.ui.registry.getAll(),o=xN(t);return function(t,e,n){var r=j(e,(function(e,r){if(Et(t,r)){var o=t[r].update(n);if(x(o))return kN(e,o.split(" "));if(o.length>0){var i=F(o,SN);return kN(e,i)}return e}return e.concat([r])}),[]);return r.length>0&&wN(r[r.length-1])&&r.pop(),r}(r.contextMenus,o,n)}),n,o,i)}};t.on("init",(function(){var e="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(r()?"":" ResizeWindow");t.on(e,i),t.on("longpress contextmenu",u)}))},TN=At([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),AN=function(t){return function(e){return e.translate(-t.left,-t.top)}},BN=function(t){return function(e){return e.translate(t.left,t.top)}},NN=function(t){return function(e,n){return j(t,(function(t,e){return e(t)}),Su(e,n))}},DN=function(t,e,n){return t.fold(NN([BN(n),AN(e)]),NN([AN(e)]),NN([]))},RN=function(t,e,n){return t.fold(NN([BN(n)]),NN([]),NN([BN(e)]))},MN=function(t,e,n){return t.fold(NN([]),NN([AN(n)]),NN([BN(e),AN(n)]))},IN=function(t,e,n){var r=t.fold((function(t,e){return{position:v.some("absolute"),left:v.some(t+"px"),top:v.some(e+"px")}}),(function(t,e){return{position:v.some("absolute"),left:v.some(t-n.left+"px"),top:v.some(e-n.top+"px")}}),(function(t,e){return{position:v.some("fixed"),left:v.some(t+"px"),top:v.some(e+"px")}}));return f({right:v.none(),bottom:v.none()},r)},PN=function(t,e,n,r){var o=function(t,o){return function(i,u){var a=t(e,n,r);return o(i.getOr(a.left),u.getOr(a.top))}};return t.fold(o(MN,FN),o(RN,LN),o(DN,VN))},FN=TN.offset,LN=TN.absolute,VN=TN.fixed,HN=function(t,e){var n=Ho(t,e);return k(n)?NaN:parseInt(n,10)},zN=function(t,e,n,r){return function(t,e){var n=t.element,r=HN(n,e.leftAttr),o=HN(n,e.topAttr);return isNaN(r)||isNaN(o)?v.none():v.some(Su(r,o))}(t,e).fold((function(){return n}),(function(t){return VN(t.left+r.left,t.top+r.top)}))},jN=function(t,e,n,r,o,i){var u=zN(t,e,n,r),a=e.mustSnap?qN(t,e,u,o,i):GN(t,e,u,o,i),c=DN(u,o,i);return function(t,e,n){var r=t.element;Vo(r,e.leftAttr,n.left+"px"),Vo(r,e.topAttr,n.top+"px")}(t,e,c),a.fold((function(){return{coord:VN(c.left,c.top),extra:v.none()}}),(function(t){return{coord:t.output,extra:t.extra}}))},UN=function(t,e){!function(t,e){var n=t.element;Uo(n,e.leftAttr),Uo(n,e.topAttr)}(t,e)},WN=function(t,e,n,r){return et(t,(function(t){var o=t.sensor;return function(t,e,n,r,o,i){var u=RN(t,o,i),a=RN(e,o,i);return Math.abs(u.left-a.left)<=n&&Math.abs(u.top-a.top)<=r}(e,o,t.range.left,t.range.top,n,r)?v.some({output:PN(t.output,e,n,r),extra:t.extra}):v.none()}))},qN=function(t,e,n,r,o){var i=e.getSnapPoints(t);return WN(i,n,r,o).orThunk((function(){return j(i,(function(t,e){var i=e.sensor,u=function(t,e,n,r,o,i){var u=RN(t,o,i),a=RN(e,o,i),c=Math.abs(u.left-a.left),s=Math.abs(u.top-a.top);return Su(c,s)}(n,i,e.range.left,e.range.top,r,o);return t.deltas.fold((function(){return{deltas:v.some(u),snap:v.some(e)}}),(function(n){return(u.left+u.top)/2<=(n.left+n.top)/2?{deltas:v.some(u),snap:v.some(e)}:t}))}),{deltas:v.none(),snap:v.none()}).snap.map((function(t){return{output:PN(t.output,n,r,o),extra:t.extra}}))}))},GN=function(t,e,n,r,o){var i=e.getSnapPoints(t);return WN(i,n,r,o)},$N=Object.freeze({__proto__:null,snapTo:function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=xo(t.element),u=Ru(i),a=EA(o),c=function(t,e,n){return{coord:PN(t.output,t.output,e,n),extra:t.extra}}(r,u,a),s=IN(c.coord,0,a);Ki(o,s)}}}),XN="data-initial-z-index",YN=function(t,e){t.getSystem().addToGui(e),function(t){ko(t.element).filter(ho).each((function(e){Zi(e,"z-index").each((function(t){Vo(e,XN,t)})),Xi(e,"z-index",Ji(t.element,"z-index"))}))}(e)},KN=function(t){!function(t){ko(t.element).filter(ho).each((function(t){zo(t,XN).fold((function(){return nu(t,"z-index")}),(function(e){return Xi(t,"z-index",e)})),Uo(t,XN)}))}(t),t.getSystem().removeFromGui(t)},JN=function(t,e,n){return t.getSystem().build(Hy.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},QN=Ye("snaps",[Ie("getSnapPoints"),pa("onSensor"),Ie("leftAttr"),Ie("topAttr"),Ke("lazyViewport",Uu),Ke("mustSnap",!1)]),ZN=[Ke("useFixed",a),Ie("blockerClass"),Ke("getTarget",r),Ke("onDrag",t),Ke("repositionTarget",!0),Ke("onDrop",t),nn("getBounds",Uu),QN],tD=function(t){return(e=Zi(t,"left"),n=Zi(t,"top"),r=Zi(t,"position"),o=function(t,e,n){return("fixed"===n?VN:FN)(parseInt(t,10),parseInt(e,10))},e.isSome()&&n.isSome()&&r.isSome()?v.some(o(e.getOrDie(),n.getOrDie(),r.getOrDie())):v.none()).getOrThunk((function(){var e=Ou(t);return LN(e.left,e.top)}));var e,n,r,o},eD=function(t,e,n,r,o,i,u){return function(t,e,n,r,o){var i=o.bounds,u=RN(e,n,r),a=Tc(u.left,i.x,i.x+i.width-o.width),c=Tc(u.top,i.y,i.y+i.height-o.height),s=LN(a,c);return e.fold((function(){var t=MN(s,n,r);return FN(t.left,t.top)}),(function(){return s}),(function(){var t=DN(s,n,r);return VN(t.left,t.top)}))}(0,e.fold((function(){var t,e,u,a=(t=n,e=i.left,u=i.top,t.fold((function(t,n){return FN(t+e,n+u)}),(function(t,n){return LN(t+e,n+u)}),(function(t,n){return VN(t+e,n+u)}))),c=DN(a,r,o);return VN(c.left,c.top)}),(function(e){var u=jN(t,e,n,i,r,o);return u.extra.each((function(n){e.onSensor(t,n)})),u.coord})),r,o,u)},nD=function(t,e){return{bounds:t.getBounds(),height:wu(e.element),width:Au(e.element)}},rD=function(t,e,n,r,o){var i=n.update(r,o),u=n.getStartData().getOrThunk((function(){return nD(e,t)}));i.each((function(n){!function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=xo(t.element),u=Ru(i),a=EA(o),c=tD(o),s=eD(t,e.snaps,c,u,a,r,n),f=IN(s,0,a);Ki(o,f)}e.onDrag(t,o,r)}(t,e,u,n)}))},oD=function(t,e,n,r){e.each(KN),n.snaps.each((function(e){UN(t,e)}));var o=n.getTarget(t.element);r.reset(),n.onDrop(t,o)},iD=function(t){return function(e,n){var r=function(t){n.setStartData(nD(e,t))};return Qr(d([eo(Mr(),(function(t){n.getStartData().each((function(){return r(t)}))}))],t(e,n,r)))}},uD=Object.freeze({__proto__:null,getData:function(t){return v.from(Su(t.x,t.y))},getDelta:function(t,e){return Su(e.left-t.left,e.top-t.top)}}),aD=function(t,e,n){return[eo(ir(),(function(r,o){if(0===o.event.raw.button){o.stop();var i=function(){return oD(r,v.some(c),t,e)},u=_y(i,200),a={drop:i,delayDrop:u.schedule,forceDrop:i,move:function(n){u.cancel(),rD(r,t,e,uD,n)}},c=JN(r,t.blockerClass,function(t){return Qr([eo(ir(),t.forceDrop),eo(cr(),t.drop),eo(ur(),(function(e,n){t.move(n.event)})),eo(ar(),t.delayDrop)])}(a));n(r),YN(r,c)}}))]},cD=d(ZN,[ya("dragger",{handlers:iD(aD)})]),sD=Object.freeze({__proto__:null,getData:function(t){var e=t.raw.touches;return 1===e.length?function(t){var e=t[0];return v.some(Su(e.clientX,e.clientY))}(e):v.none()},getDelta:function(t,e){return Su(e.left-t.left,e.top-t.top)}}),fD=function(t,e,n){var r=an(v.none());return[eo(er(),(function(o,i){i.stop();var u=function(){oD(o,r.get(),t,e),r.set(v.none())},a={drop:u,delayDrop:function(){},forceDrop:u,move:function(n){rD(o,t,e,sD,n)}},c=JN(o,t.blockerClass,function(t){return Qr([eo(er(),t.forceDrop),eo(rr(),t.drop),eo(or(),t.drop),eo(nr(),(function(e,n){t.move(n.event)}))])}(a));r.set(v.some(c));n(o),YN(o,c)})),eo(nr(),(function(n,r){r.stop(),rD(n,t,e,sD,r.event)})),eo(rr(),(function(n,o){o.stop(),oD(n,r.get(),t,e),r.set(v.none())})),eo(or(),(function(n){oD(n,r.get(),t,e),r.set(v.none())}))]},lD=cD,dD=d(ZN,[ya("dragger",{handlers:iD(fD)})]),mD=d(ZN,[ya("dragger",{handlers:iD((function(t,e,n){return d(aD(t,e,n),fD(t,e,n))}))})]),gD=sc({branchKey:"mode",branches:Object.freeze({__proto__:null,mouse:lD,touch:dD,mouseOrTouch:mD}),name:"dragging",active:{events:function(t,e){return t.dragger.handlers(t,e)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:v.from(t.extra)}}},state:Object.freeze({__proto__:null,init:function(){var t=v.none(),e=v.none(),r=n({});return mi({readState:r,reset:function(){t=v.none(),e=v.none()},update:function(e,n){return e.getData(n).bind((function(n){return function(e,n){var r=t.map((function(t){return e.getDelta(t,n)}));return t=v.some(n),r}(e,n)}))},getStartData:function(){return e},setStartData:function(t){e=v.some(t)}})}}),apis:$N}),pD=function(t,e,n,r,o,i){return t.fold((function(){return gD.snap({sensor:LN(n-20,r-20),range:Su(o,i),output:LN(v.some(n),v.some(r)),extra:{td:e}})}),(function(t){var o=n-20,i=r-20,u=t.element.dom.getBoundingClientRect();return gD.snap({sensor:LN(o,i),range:Su(40,40),output:LN(v.some(n-u.width/2),v.some(r-u.height/2)),extra:{td:e}})}))},hD=function(t,e,n){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,r){var o=r.td;(function(t,e){return t.exists((function(t){return qn(t,e)}))})(e.get(),o)||(e.set(v.some(o)),n(o))},mustSnap:!0}},vD=function(t){return fp(sp.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:ic([gD.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),Zx.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},bD=function(t,e){var n=an([]),r=an([]),o=an(!1),i=an(v.none()),u=an(v.none()),a=function(t){var n=ju(t);return pD(l.getOpt(e),t,n.x,n.y,n.width,n.height)},c=function(t){var n=ju(t);return pD(d.getOpt(e),t,n.right,n.bottom,n.width,n.height)},s=hD((function(){return F(n.get(),(function(t){return a(t)}))}),i,(function(e){u.get().each((function(n){t.fire("TableSelectorChange",{start:e,finish:n})}))})),f=hD((function(){return F(r.get(),(function(t){return c(t)}))}),u,(function(e){i.get().each((function(n){t.fire("TableSelectorChange",{start:n,finish:e})}))})),l=vD(s),d=vD(f),m=hu(l.asSpec()),g=hu(d.asSpec()),p=function(e,n,r,o){var i=r(n);gD.snapTo(e,i);!function(e,n,r,o){var i=n.dom.getBoundingClientRect();nu(e.element,"display");var u=So(sn.fromDom(t.getBody())).dom.innerHeight,a=r(i),c=o(i,u);(a||c)&&Xi(e.element,"display","none")}(e,n,(function(t){return t[o]<0}),(function(t,e){return t[o]>e}))},h=function(t){return p(m,t,a,"top")},b=function(t){return p(g,t,c,"bottom")};jn().deviceType.isTouch()&&(t.on("TableSelectionChange",(function(t){o.get()||(ef(e,m),ef(e,g),o.set(!0)),i.set(v.some(t.start)),u.set(v.some(t.finish)),t.otherCells.each((function(e){n.set(e.upOrLeftCells),r.set(e.downOrRightCells),h(t.start),b(t.finish)}))})),t.on("ResizeEditor ResizeWindow ScrollContent",(function(){i.get().each(h),u.get().each(b)})),t.on("TableSelectionClear",(function(){o.get()&&(of(m),of(g),o.set(!1)),i.set(v.none()),u.set(v.none())})))};!function(t){t[t.None=0]="None",t[t.Both=1]="Both",t[t.Vertical=2]="Vertical"}(LT||(LT={}));var yD=function(t,e,n){var r=sn.fromDom(t.getContainer()),o=function(t,e,n,r,o){var i={};return i.height=jB(r+e.top,hv(t),bv(t)),n===LT.Both&&(i.width=jB(o+e.left,pv(t),vv(t))),i}(t,e,n,xu(r),Tu(r));yt(o,(function(t,e){return Xi(r,e,zB(t))})),function(t){t.fire("ResizeEditor")}(t)},xD=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},wD=function(t,e,n){e.delimiter||(e.delimiter="»");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:ic([rg.config({mode:"flow",selector:"div[role=button]"}),lv.config({disabled:n.isDisabled}),jv(),$y.config({}),cg.config({}),sg("elementPathEvents",[so((function(r,o){t.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return rg.focusIn(r)})),t.on("NodeChange",(function(o){var i,u,a=function(e){for(var n=[],r=e.length;r-- >0;){var o=e[r];if(1===o.nodeType&&!xD(o)){var i=t.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(i.isDefaultPrevented()||n.push({name:i.name,element:o}),i.isPropagationStopped())break}}return n}(o.parents);a.length>0?cg.set(r,(i=F(a||[],(function(e,r){return sp.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":r,"tab-index":-1,"aria-level":r+1},innerHtml:e.name},action:function(n){t.focus(),t.selection.select(e.element),t.nodeChanged()},buttonBehaviours:ic([Wv(n.isDisabled),jv()])})})),u={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}},j(i.slice(1),(function(t,e){var n=t;return n.push(u),n.push(e),n}),[i[0]]))):cg.set(r,[])}))}))])]),components:[]}},CD=function(t,e){var n=function(){var n,r=[];return t.getParam("elementpath",!0,"boolean")&&r.push(wD(t,{},e)),t.hasPlugin("wordcount")&&r.push(function(t,e){var n,r=function(t,n,r){return cg.set(t,[mu(e.translate(["{0} "+r,n[r]]))])};return sp.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:ic([Wv(e.isDisabled),jv(),$y.config({}),cg.config({}),Vf.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),sg("wordcount-events",[mo((function(t){var e=Vf.getValue(t),n="words"===e.mode?"characters":"words";Vf.setValue(t,{mode:n,count:e.count}),r(t,e.count,n)})),so((function(e){t.on("wordCountUpdate",(function(t){var n=Vf.getValue(e).mode;Vf.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)}))}))])]),eventOrder:(n={},n[Or()]=["disabling","alloy.base.behaviour","wordcount-events"],n)})}(t,e)),t.getParam("branding",!0,"boolean")&&r.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&amp;utm_medium=poweredby&amp;utm_source=tinymce&amp;utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(n=Jh.translate(["Powered by {0}","Tiny"]))+'">'+n+"</a>"}}),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:function(){var r=n(),o=function(t){var e=!t.hasPlugin("autoresize"),n=t.getParam("resize",e);return!1===n?LT.None:"both"===n?LT.Both:LT.Vertical}(t);return o!==LT.None&&r.push(function(n){return{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize"),"aria-hidden":"true"},innerHtml:dp("resize-handle",e.icons)},behaviours:ic([gD.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){yD(t,o,n)},blockerClass:"tox-blocker"})])}}(o)),r}()}},SD=function(t){var e,n,r,o,i=t.inline,u=i?$B:VB,a=Rv(t)?tB:OA,c=v.none(),s=jn(),l=s.browser.isIE()?["tox-platform-ie"]:[],d=s.deviceType.isTouch()?["tox-platform-touch"]:[],m=Tv(t),g=Nv(t),p=Jh.isRtl()?{attributes:{dir:"rtl"}}:{},h={attributes:(e={},e[Uc]=m?na.BottomToTop:na.TopToBottom,e)},b=function(){return c.bind(OB.getHeader)},y=function(){Xi(G.element,"width",document.body.clientWidth+"px")},x=hu((n=qn(Wi(),g)&&"grid"===Ji(g,"display"),r={dom:f({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(l).concat(d)},p),behaviours:ic([Ks.config({useFixed:function(){return a.isDocked(b)}})])},o={dom:{styles:{width:document.body.clientWidth+"px"}},events:Qr([eo(Ir(),y)])},Dt(r,n?o:{}))),w=function(){return ot.value(x)},C=fp({dom:{tag:"div",classes:["tox-anchorbar"]}}),S=function(){return c.bind((function(t){return OB.getThrobber(t)})).getOrDie("Could not find throbber element")},k=q_(x,t,(function(){return c.bind((function(t){return C.getOpt(t)})).getOrDie("Could not find a anchor bar element")})),O=OB.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:k,onEscape:function(){t.focus()}}),_=kv(t),E=OB.parts.toolbar(f({dom:{tag:"div",classes:["tox-toolbar"]},getSink:w,providers:k.shared.providers,onEscape:function(){t.focus()},type:_,lazyToolbar:function(){return c.bind((function(t){return OB.getToolbar(t)})).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return b().getOrDie("Could not find header element")}},h)),T=OB.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:k.shared.providers,onEscape:function(){t.focus()},type:_}),A=OB.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),B=OB.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),N=OB.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:k}),D=t.getParam("statusbar",!0,"boolean")&&!i?v.some(CD(t,k.shared.providers)):v.none(),R={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[A,B]},M=Cv(t),I=xv(t),P=yv(t),F=OB.parts.header({dom:f({tag:"div",classes:["tox-editor-header"]},h),components:q([P?[O]:[],M?[T]:I?[E]:[],Bv(t)?[]:[C.asSpec()]]),sticky:Rv(t),editor:t,sharedBackstage:k.shared}),V=q([m?[]:[F],i?[]:[R],m?[F]:[]]),H=q([[{dom:{tag:"div",classes:["tox-editor-container"]},components:V}],i?[]:D.toArray(),[N]]),z=Dv(t),j=f(f({role:"application"},Jh.isRtl()?{dir:"rtl"}:{}),z?{"aria-hidden":"true"}:{}),U=hu(OB.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(i?["tox-tinymce-inline"]:[]).concat(m?["tox-tinymce--toolbar-bottom"]:[]).concat(d).concat(l),styles:f({visibility:"hidden"},z?{opacity:"0",border:"0"}:{}),attributes:j},components:H,behaviours:ic([jv(),lv.config({disableClass:"tox-tinymce--disabled"}),rg.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"})])}));c=v.some(U),t.shortcuts.add("alt+F9","focus menubar",(function(){OB.focusMenubar(U)})),t.shortcuts.add("alt+F10","focus toolbar",(function(){OB.focusToolbar(U)})),t.addCommand("ToggleToolbarDrawer",(function(){OB.toggleToolbarDrawer(U)})),t.addQueryStateHandler("ToggleToolbarDrawer",(function(){return OB.isToolbarDrawerToggled(U)}));var W=zy(U),G=zy(x);!function(t,e,n){var r=function(t,r){L([e,n],(function(e){e.broadcastEvent(t,r)}))},o=function(t,r){L([e,n],(function(e){e.broadcastOn([t],r)}))},i=function(t){return o(xf(),{target:t.target})},u=Cy(sn.fromDom(document),"touchstart",i),a=Cy(sn.fromDom(document),"touchmove",(function(t){return r(Dr(),t)})),c=Cy(sn.fromDom(document),"touchend",(function(t){return r(Rr(),t)})),s=Cy(sn.fromDom(document),"mousedown",i),f=Cy(sn.fromDom(document),"mouseup",(function(t){0===t.raw.button&&o(Cf(),{target:t.target})})),l=function(t){return o(xf(),{target:sn.fromDom(t.target)})},d=function(t){0===t.button&&o(Cf(),{target:sn.fromDom(t.target)})},m=function(t){return r(Mr(),ky(t))},g=function(t){o(wf(),{}),r(Ir(),ky(t))},p=function(){return o(wf(),{})};t.on("PostRender",(function(){t.on("click",l),t.on("tap",l),t.on("mouseup",d),t.on("ScrollWindow",m),t.on("ResizeWindow",g),t.on("ResizeEditor",p)})),t.on("remove",(function(){t.off("click",l),t.off("tap",l),t.off("mouseup",d),t.off("ScrollWindow",m),t.off("ResizeWindow",g),t.off("ResizeEditor",p),s.unbind(),u.unbind(),a.unbind(),c.unbind(),f.unbind()})),t.on("detach",(function(){sf(e),sf(n),e.destroy(),n.destroy()}))}(t,W,G);var $=function(){var e=zB(UB(t)),n=zB(function(t){return WB(t).getOr(gv(t))}(t));return t.inline||(eu("div","width",n)&&Xi(U.element,"width",n),eu("div","height",e)?Xi(U.element,"height",e):Xi(U.element,"height","200px")),e};return{mothership:W,uiMothership:G,backstage:k,renderUI:function(){a.setup(t,k.shared,b),uN(t,k),EN(t,w,k),function(t){var e=t.ui.registry.getAll().sidebars;L(vt(e),(function(n){var r=e[n],o=function(){return v.from(t.queryCommandValue("ToggleSidebar")).is(n)};t.ui.registry.addToggleButton(n,{icon:r.icon,tooltip:r.tooltip,onAction:function(e){t.execCommand("ToggleSidebar",!1,n),e.setActive(o())},onSetup:function(e){var n=function(){return e.setActive(o())};return t.on("ToggleSidebar",n),function(){t.off("ToggleSidebar",n)}}})}))}(t),vB(t,S,k.shared),xt(function(t){return t.getParam("toolbar_groups",{},"object")}(t),(function(e,n){t.ui.registry.addGroupToolbarButton(n,e)}));var e=t.ui.registry.getAll(),n=e.buttons,r=e.menuItems,o=e.contextToolbars,i=e.sidebars,c=wv(t),s={menuItems:r,menus:Mv(t),menubar:Iv(t),toolbar:c.getOrThunk((function(){return function(t){return t.getParam("toolbar",!0)}(t)})),allowToolbarGroups:_===th.floating,buttons:n,sidebar:i};gA(t,o,x,{backstage:k}),bD(t,x);var f=t.getElement(),l=$(),d={mothership:W,uiMothership:G,outerContainer:U},m={targetNode:f,height:l};return u.render(t,d,s,k,m)},getUi:function(){return{channels:{broadcastAll:G.broadcast,broadcastOn:G.broadcastOn,register:function(){}}}}}},kD=n([Ie("lazySink"),We("dragBlockClass"),nn("getBounds",Uu),Ke("useTabstopAt",c),Ke("eventOrder",{}),Hf("modalBehaviours",[rg]),ha("onExecute"),ba("onEscape")]),OD={sketch:r},_D=n([vl({name:"draghandle",overrides:function(t,e){return{behaviours:ic([gD.config({mode:"mouse",getTarget:function(t){return Yu(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(e,null,2)).message),getBounds:t.getDragBounds})])}}}),pl({schema:[Ie("dom")],name:"title"}),pl({factory:OD,schema:[Ie("dom")],name:"close"}),pl({factory:OD,schema:[Ie("dom")],name:"body"}),vl({factory:OD,schema:[Ie("dom")],name:"footer"}),hl({factory:{sketch:function(t,e){return f(f({},t),{dom:e.dom,components:e.components})}},schema:[Ke("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Ke("components",[])],name:"blocker"})]),ED=Object.freeze({__proto__:null,block:function(t,e,n,r){Vo(t.element,"aria-busy",!0);var o=e.getRoot(t).getOr(t),i=ic([rg.config({mode:"special",onTab:function(){return v.some(!0)},onShiftTab:function(){return v.some(!0)}}),gg.config({})]),u=r(o,i),a=o.getSystem().build(u);cg.append(o,vu(a)),a.hasConfigured(rg)&&rg.focusIn(a),n.isBlocked()||e.onBlock(t),n.blockWith((function(){return cg.remove(o,a)}))},unblock:function(t,e,n){Uo(t.element,"aria-busy"),n.isBlocked()&&e.onUnblock(t),n.clear()}}),TD=[nn("getRoot",v.none),pa("onBlock"),pa("onUnblock")],AD=ac({fields:TD,name:"blocking",apis:ED,state:Object.freeze({__proto__:null,init:function(){var t=JT();return mi({readState:t.isSet,blockWith:function(e){t.set({destroy:e})},clear:t.clear,isBlocked:t.isSet})}})}),BD=ql({name:"ModalDialog",configFields:kD(),partFields:_D(),factory:function(t,e,n,o){var i,u=an(v.none()),a=Ko("modal-events"),c=f(f({},t.eventOrder),((i={})[Pr()]=[a].concat(t.eventOrder["alloy.system.attached"]||[]),i));return{uid:t.uid,dom:t.dom,components:e,apis:{show:function(e){u.set(v.some(e));var n=t.lazySink(e).getOrDie(),r=o.blocker(),i=n.getSystem().build(f(f({},r),{components:r.components.concat([vu(e)]),behaviours:ic([gg.config({}),sg("dialog-blocker-events",[co(fr(),(function(){rg.focusIn(e)}))])])}));ef(n,i),rg.focusIn(e)},hide:function(t){u.set(v.none()),ko(t.element).each((function(e){t.getSystem().getByDom(e).each((function(t){of(t)}))}))},getBody:function(e){return Bl(e,t,"body")},getFooter:function(e){return Bl(e,t,"footer")},setIdle:function(t){AD.unblock(t)},setBusy:function(t,e){AD.block(t,e)}},eventOrder:c,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:jf(t.modalBehaviours,[cg.config({}),rg.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),AD.config({getRoot:u.get}),sg(a,[so((function(e){var n,o,i,u,a,c;n=e.element,o=Bl(e,t,"title").element,i=zo(n,"id").fold((function(){var t=Ko("dialog-label");return Vo(o,"id",t),t}),r),Vo(n,"aria-labelledby",i),u=e.element,a=Bl(e,t,"body").element,c=v.from(Ho(u,"id")).fold((function(){var t=Ko("dialog-describe");return Vo(a,"id",t),t}),r),Vo(u,"aria-describedby",c)}))])])}},apis:{show:function(t,e){t.show(e)},hide:function(t,e){t.hide(e)},getBody:function(t,e){return t.getBody(e)},getFooter:function(t,e){return t.getFooter(e)},setBusy:function(t,e,n){t.setBusy(e,n)},setIdle:function(t,e){t.setIdle(e)}}}),ND=ie([Le("type"),Le("name")].concat(Dh)),DD=Be,RD=[de("name","name",Ht((function(){return Ko("button-name")})),Ae),$e("icon"),tn("align","end",["start","end"]),en("primary",!1),en("disabled",!1)],MD=d(RD,[Le("text")]),ID=d([Ve("type",["submit","cancel","custom"])],MD),PD=d([Ve("type",["menu"]),$e("text"),$e("tooltip"),$e("icon"),Ue("items",ND)],RD),FD=Oe("type",{submit:ID,cancel:ID,custom:ID,menu:PD}),LD=[Le("type"),Le("text"),Ve("level",["info","warn","error","success"]),Le("icon"),Ke("url","")],VD=ie(LD),HD=[Le("type"),Le("text"),en("disabled",!1),en("primary",!1),de("name","name",Ht((function(){return Ko("button-name")})),Ae),$e("icon"),en("borderless",!1)],zD=ie(HD),jD=[Le("type"),Le("name"),Le("label"),en("disabled",!1)],UD=ie(jD),WD=Be,qD=[Le("type"),Le("name")],GD=qD.concat([$e("label")]),$D=GD.concat([Ke("columns","auto")]),XD=ie($D),YD=he([Le("value"),Le("text"),Le("icon")]),KD=ie(GD),JD=Ae,QD=ie(GD),ZD=Ae,tR=qD.concat([Ze("tag","textarea"),Le("scriptId"),Le("scriptUrl"),function(t,e){return Je(t,e,Re)}("settings",void 0)]),eR=qD.concat([Ze("tag","textarea"),He("init")]),nR=be((function(t){return xe("customeditor.old",oe(eR),t).orThunk((function(){return xe("customeditor.new",oe(tR),t)}))})),rR=Ae,oR=ie(GD),iR=ue(pe),uR=function(t){return[Le("type"),Fe("columns"),t]},aR=[Le("type"),Le("html"),tn("presets","presentation",["presentation","document"])],cR=ie(aR),sR=GD.concat([en("sandboxed",!0)]),fR=ie(sR),lR=Ae,dR=GD.concat([Pe("currentState",ie([Ie("blob"),Le("url")]))]),mR=ie(dR),gR=GD.concat([$e("inputMode"),$e("placeholder"),en("maximized",!1),en("disabled",!1)]),pR=ie(gR),hR=Ae,vR=function(t){return[Le("type"),Le("label"),t]},bR=[Le("text"),Le("value")],yR=[Le("text"),Ue("items",function(t,e){return n=e,r=Mt((function(){return n()})),{extract:function(t,e,n){return r().extract(t,e,n)},toString:function(){return r().toString()}};var n,r}(0,(function(){return xR})))],xR=ae([ie(bR),ie(yR)]),wR=GD.concat([Ue("items",xR),en("disabled",!1)]),CR=ie(wR),SR=Ae,kR=GD.concat([je("items",[Le("text"),Le("value")]),Qe("size",1),en("disabled",!1)]),OR=ie(kR),_R=Ae,ER=GD.concat([en("constrain",!0),en("disabled",!1)]),TR=ie(ER),AR=ie([Le("width"),Le("height")]),BR=[Le("type"),Ue("header",Ae),Ue("cells",ue(Ae))],NR=ie(BR),DR=GD.concat([$e("placeholder"),en("maximized",!1),en("disabled",!1)]),RR=ie(DR),MR=Ae,IR=GD.concat([tn("filetype","file",["image","media","file"]),Ke("disabled",!1)]),PR=ie(IR),FR=ie([Le("value"),Ke("meta",{})]),LR=function(t){return de("items","items",Lt(),ue(be((function(e){return xe("Checking item of "+t,VR,e).fold((function(t){return ot.error(Se(t))}),(function(t){return ot.value(t)}))}))))},VR=ve((function(){return ke("type",{alertbanner:VD,bar:ie((t=LR("bar"),[Le("type"),t])),button:zD,checkbox:UD,colorinput:KD,colorpicker:QD,dropzone:oR,grid:ie(uR(LR("grid"))),iframe:fR,input:pR,listbox:CR,selectbox:OR,sizeinput:TR,textarea:RR,urlinput:PR,customeditor:nR,htmlpanel:cR,imagetools:mR,collection:XD,label:ie(vR(LR("label"))),table:NR,panel:zR});var t})),HR=[Le("type"),Ke("classes",[]),Ue("items",VR)],zR=ie(HR),jR=[de("name","name",Ht((function(){return Ko("tab-name")})),Ae),Le("title"),Ue("items",VR)],UR=[Le("type"),je("tabs",jR)],WR=ie(UR),qR=MD,GR=FD,$R=ie([Le("title"),Pe("body",ke("type",{panel:zR,tabpanel:WR})),Ze("size","normal"),Ue("buttons",GR),Ke("initialData",{}),nn("onAction",t),nn("onChange",t),nn("onSubmit",t),nn("onClose",t),nn("onCancel",t),Ke("onTabChange",t)]),XR=ie(d([Ve("type",["cancel","custom"])],qR)),YR=ie([Le("title"),Le("url"),Ge("height"),Ge("width"),function(t,e){return qe(t,ue(e))}("buttons",XR),nn("onAction",t),nn("onCancel",t),nn("onClose",t),nn("onMessage",t)]),KR=function(t){return w(t)?[t].concat(G(Ot(t),KR)):C(t)?G(t,KR):[]},JR=function(t){return x(t.type)&&x(t.name)},QR={checkbox:WD,colorinput:JD,colorpicker:ZD,dropzone:iR,input:hR,iframe:lR,sizeinput:AR,selectbox:_R,listbox:SR,size:AR,textarea:MR,urlinput:FR,customeditor:rR,collection:YD,togglemenuitem:DD},ZR=function(t){var e=function(t){return H(KR(t),JR)}(t),n=G(e,(function(t){return function(t){return v.from(QR[t.type])}(t).fold((function(){return[]}),(function(e){return[Pe(t.name,e)]}))}));return ie(n)},tM=function(t){return{internalDialog:we(xe("dialog",$R,t)),dataValidator:ZR(t),initialData:t.initialData}},eM={open:function(t,e){var n=tM(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){return t(we(xe("dialog",YR,e)))},redial:function(t){return tM(t)}},nM=function(t){var e=[],n={};return yt(t,(function(t,r){t.fold((function(){e.push(r)}),(function(t){n[r]=t}))})),e.length>0?ot.error(e):ot.value(n)},rM=function(t,e){var n=fp(KC.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:F(t.items,(function(t){return JO(n,t,e)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[n.asSpec()]}],behaviours:ic([rg.config({mode:"acyclic",useTabstopAt:i(OS)}),iS(n),gS(n,{postprocess:function(t){return nM(t).fold((function(t){return console.error(t),{}}),(function(t){return t}))}})])}},oM=Wl({name:"TabButton",configFields:[Ke("uid",void 0),Ie("value"),de("dom","dom",zt((function(){return{attributes:{role:"tab",id:Ko("aria"),"aria-selected":"false"}}})),_e()),We("action"),Ke("domModification",{}),Hf("tabButtonBehaviours",[gg,rg,Vf]),Ie("view")],factory:function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:Tg(t.action),behaviours:jf(t.tabButtonBehaviours,[gg.config({}),rg.config({mode:"execution",useSpace:!0,useEnter:!0}),Vf.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),iM=n([Ie("tabs"),Ie("dom"),Ke("clickToDismiss",!1),Hf("tabbarBehaviours",[cd,rg]),ma(["tabClass","selectedClass"])]),uM=bl({factory:oM,name:"tabs",unit:"tab",overrides:function(e){var n=function(t,e){cd.dehighlight(t,e),$r(t,Ur(),{tabbar:t,button:e})},r=function(t,e){cd.highlight(t,e),$r(t,jr(),{tabbar:t,button:e})};return{action:function(o){var i=o.getSystem().getByUid(e.uid).getOrDie(),u=cd.isHighlighted(i,o);(u&&e.clickToDismiss?n:u?t:r)(i,o)},domModification:{classes:[e.markers.tabClass]}}}}),aM=n([uM]),cM=ql({name:"Tabbar",configFields:iM(),partFields:aM(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:jf(t.tabbarBehaviours,[cd.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){Vo(e.element,"aria-selected","true")},onDehighlight:function(t,e){Vo(e.element,"aria-selected","false")}}),rg.config({mode:"flow",getInitial:function(t){return cd.getHighlighted(t).map((function(t){return t.element}))},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),sM=Wl({name:"Tabview",configFields:[Hf("tabviewBehaviours",[cg])],factory:function(t,e){return{uid:t.uid,dom:t.dom,behaviours:jf(t.tabviewBehaviours,[cg.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),fM=n([Ke("selectFirst",!0),pa("onChangeTab"),pa("onDismissTab"),Ke("tabs",[]),Hf("tabSectionBehaviours",[])]),lM=pl({factory:cM,schema:[Ie("dom"),ze("markers",[Ie("tabClass"),Ie("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),dM=pl({factory:sM,name:"tabview"}),mM=n([lM,dM]),gM=ql({name:"TabSection",configFields:fM(),partFields:mM(),factory:function(t,e,n,r){var o=function(e,n){Al(e,t,"tabbar").each((function(t){n(t).each(Xr)}))};return{uid:t.uid,dom:t.dom,components:e,behaviours:zf(t.tabSectionBehaviours),events:Qr(q([t.selectFirst?[so((function(t,e){o(t,cd.getFirst)}))]:[],[eo(jr(),(function(e,n){!function(e){var n=Vf.getValue(e);Al(e,t,"tabview").each((function(r){U(t.tabs,(function(t){return t.value===n})).each((function(n){var o=n.view();zo(e.element,"id").each((function(t){Vo(r.element,"aria-labelledby",t)})),cg.set(r,o),t.onChangeTab(r,e,o)}))}))}(n.event.button)})),eo(Ur(),(function(e,n){var r=n.event.button;t.onDismissTab(e,r)}))]])),apis:{getViewItems:function(e){return Al(e,t,"tabview").map((function(t){return cg.contents(t)})).getOr([])},showTab:function(t,e){o(t,(function(t){var n=cd.getCandidates(t);return U(n,(function(t){return Vf.getValue(t)===e})).filter((function(e){return!cd.isHighlighted(t,e)}))}))}}}},apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),pM=function(t,e){Xi(t,"height",e+"px"),jn().browser.isIE()?nu(t,"flex-basis"):Xi(t,"flex-basis",e+"px")},hM=function(t,e,n){Yu(t,'[role="dialog"]').each((function(t){Ku(t,'[role="tablist"]').each((function(r){n.get().map((function(n){return Xi(e,"height","0"),Xi(e,"flex-basis","0"),Math.min(n,function(t,e,n){var r,o=Co(t).dom,i=Yu(t,".tox-dialog-wrap").getOr(t);r="fixed"===Ji(i,"position")?Math.max(o.clientHeight,window.innerHeight):Math.max(o.offsetHeight,o.scrollHeight);var u=xu(e),a=e.dom.offsetLeft>=n.dom.offsetLeft+Tu(n)?Math.max(xu(n),u):u,c=parseInt(Ji(t,"margin-top"),10)||0,s=parseInt(Ji(t,"margin-bottom"),10)||0;return r-(xu(t)+c+s-a)}(t,e,r))})).each((function(t){pM(e,t)}))}))}))},vM=function(t){return Ku(t,'[role="tabpanel"]')},bM=function(t){var e;return{smartTabHeight:(e=an(v.none()),{extraEvents:[so((function(n){var r=n.element;vM(r).each((function(o){Xi(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each((function(n){var r=function(t){return Q(K(t,(function(t,e){return t>e?-1:t<e?1:0})))}(function(t,e,n){return F(t,(function(r,o){cg.set(n,t[o].view());var i=e.dom.getBoundingClientRect();return cg.set(n,[]),i.height}))}(t,o,n));e.set(r)})),hM(r,o,e),nu(o,"visibility"),function(t,e){Q(t).each((function(t){return gM.showTab(e,t.value)}))}(t,n),cp.requestAnimationFrame((function(){hM(r,o,e)}))}))})),eo(Ir(),(function(t){var n=t.element;vM(n).each((function(t){hM(n,t,e)}))})),eo(ax,(function(t,n){var r=t.element;vM(r).each((function(t){var n=gc();Xi(t,"visibility","hidden");var o=Zi(t,"height").map((function(t){return parseInt(t,10)}));nu(t,"height"),nu(t,"flex-basis");var i=t.dom.getBoundingClientRect().height;o.forall((function(t){return i>t}))?(e.set(v.from(i)),hM(r,t,e)):o.each((function(e){pM(t,e)})),nu(t,"visibility"),n.each(mc)}))}))],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}},yM="send-data-to-section",xM="send-data-to-view",wM=function(t,e){var n=an({}),r=function(t){var e=Vf.getValue(t),r=nM(e).getOr({}),o=n.get(),i=Dt(o,r);n.set(i)},o=function(t){var e=n.get();Vf.setValue(t,e)},u=an(null),a=F(t.tabs,(function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(t.title)},view:function(){return[KC.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:F(t.items,(function(t){return JO(n,t,e)})),formBehaviours:ic([rg.config({mode:"acyclic",useTabstopAt:i(OS)}),sg("TabView.form.events",[so(o),fo(r)]),lc.config({channels:qt([{key:yM,value:{onReceive:r}},{key:xM,value:{onReceive:o}}])})])}}))]}}})),c=bM(a).smartTabHeight;return gM.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=Vf.getValue(e);$r(t,ux,{name:r,oldName:u.get()}),u.set(r)},tabs:a,components:[gM.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[cM.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:ic([$y.config({})])}),gM.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:c.selectFirst,tabSectionBehaviours:ic([sg("tabpanel",c.extraEvents),rg.config({mode:"acyclic"}),Jl.config({find:function(t){return Q(gM.getViewItems(t))}}),Vf.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([yM],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn([xM],{})}}})])})},CM=Ko("update-dialog"),SM=Ko("update-title"),kM=Ko("update-body"),OM=Ko("update-footer"),_M=Ko("body-send-message"),EM=function(t,e,n,r){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:f(f({},e.map((function(t){return{id:t}})).getOr({})),r?{"aria-live":"polite"}:{})},components:[],behaviours:ic([uS(0),eT.config({channel:kM,updateState:function(t,e){return v.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[wM(t.body,n)];default:return[rM(t.body,n)]}},initialData:t})])}},TM=eb.deviceType.isTouch(),AM=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},BM=function(t,e){return BD.parts.close(sp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:ic([$y.config({})])}))},NM=function(){return BD.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},DM=function(t,e){return BD.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:pB("<p>"+e.translate(t)+"</p>")}]}]})},RM=function(t){return BD.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},MM=function(t,e){return[Hy.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),Hy.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},IM=function(t){var e,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return BD.sketch({lazySink:t.lazySink,onEscape:function(e){return t.onEscape(e),v.some(!0)},useTabstopAt:function(t){return!OS(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:f({position:"relative"},t.extraStyles)},components:d([t.header,t.body],t.footer.toArray()),parts:{blocker:{dom:pB('<div class="'+r+'"></div>'),components:[{dom:{tag:"div",classes:TM?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:ic(d([gg.config({}),sg("dialog-events",t.dialogEvents.concat([co(fr(),(function(t,e){rg.focusIn(t)}))])),sg("scroll-lock",[so((function(){Ti(Wi(),i)})),fo((function(){Bi(Wi(),i)}))])],t.extraBehaviours)),eventOrder:f((e={},e[Or()]=["dialog-events"],e[Pr()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[Fr()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},PM=function(t){return sp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:dp("close",t.icons)}}],action:function(t){Gr(t,ex)}})},FM=function(t,e,n){var r=function(t){return[mu(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:f({},e.map((function(t){return{id:t}})).getOr({}))},components:r(t),behaviours:ic([eT.config({channel:SM,renderComponents:r})])}},LM=function(){return{dom:pB('<div class="tox-dialog__draghandle"></div>')}},VM=function(t,e){return function(t,e){var n=BD.parts.title(FM(t,v.none(),e)),r=BD.parts.draghandle(LM()),o=BD.parts.close(PM(e)),i=[n].concat(t.draggable?[r]:[]).concat([o]);return Hy.sketch({dom:pB('<div class="tox-dialog__header"></div>'),components:i})}({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},e.shared.providers)},HM=function(t,e){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":t},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:e,components:[{dom:pB('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}},zM=function(t,e){return{onClose:function(){return e.closeWindow()},onBlock:function(e){BD.setBusy(t(),(function(t,n){return HM(e.message,n)}))},onUnblock:function(){BD.setIdle(t())}}},jM=function(t,e,n,r){var o;return hu(IM(f(f({},t),{lazySink:r.shared.getSink,extraBehaviours:d([eT.config({channel:CM,updateState:function(t,e){return v.some(e)},initialData:e}),vS({})],t.extraBehaviours),onEscape:function(t){Gr(t,ex)},dialogEvents:n,eventOrder:(o={},o[kr()]=[eT.name(),lc.name()],o[Pr()]=["scroll-lock",eT.name(),"messages","dialog-events","alloy.base.behaviour"],o[Fr()]=["alloy.base.behaviour","dialog-events","messages",eT.name(),"scroll-lock"],o)})))},UM=function(t){return F(t,(function(t){return"menu"===t.type?function(t){var e=F(t.items,(function(t){var e=an(!1);return f(f({},t),{storage:e})}));return f(f({},t),{items:e})}(t):t}))},WM=function(t){return j(t,(function(t,e){return"menu"===e.type?j(e.items,(function(t,e){return t[e.name]=e.storage,t}),t):t}),{})},qM=function(t,e){return[io(fr(),kS),t(tx,(function(t,n){e.onClose(),n.onClose()})),t(ex,(function(t,e,n,r){e.onCancel(t),Gr(r,tx)})),eo(ix,(function(t,n){return e.onUnblock()})),eo(ox,(function(t,n){return e.onBlock(n.event)}))]},GM=function(t,e){var n=function(e,n){return eo(e,(function(e,o){r(e,(function(r,i){n(t(),r,o.event,e)}))}))},r=function(t,e){eT.getState(t).get().each((function(n){e(n,t)}))};return d(qM(n,e),[n(nx,(function(t,e,n){e.onAction(t,{name:n.name})}))])},$M=function(t,e,n){var r=function(e,n){return eo(e,(function(e,r){o(e,(function(o,i){n(t(),o,r.event,e)}))}))},o=function(t,e){eT.getState(t).get().each((function(n){e(n.internalDialog,t)}))};return d(qM(r,e),[r(rx,(function(t,e){return e.onSubmit(t)})),r(Zy,(function(t,e,n){e.onChange(t,{name:n.name})})),r(nx,(function(t,e,r,o){var i=function(){return rg.focusIn(o)},u=function(t){return jo(t,"disabled")||zo(t,"aria-disabled").exists((function(t){return"true"===t}))},a=Li(o.element),c=gc(a);e.onAction(t,{name:r.name,value:r.value}),gc(a).fold(i,(function(t){u(t)||c.exists((function(e){return $n(t,e)&&u(e)}))?i():n().toOptional().filter((function(e){return!$n(e.element,t)})).each(i)}))})),r(ux,(function(t,e,n){e.onTabChange(t,{newTabName:n.name,oldTabName:n.oldName})})),fo((function(e){var n=t();Vf.setValue(e,n.getData())}))])},XM=function(t,e){var n=e.map((function(t){return t.footerButtons})).getOr([]),r=V(n,(function(t){return"start"===t.align})),o=function(t,e){return Hy.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:F(e,(function(t){return t.memento.asSpec()}))})};return[o("start",r.pass),o("end",r.fail)]},YM=function(t,e){return{dom:pB('<div class="tox-dialog__footer"></div>'),components:[],behaviours:ic([eT.config({channel:OM,initialData:t,updateState:function(t,n){var r=F(n.buttons,(function(t){var n=fp(function(t,e){return Lk(t,t.type,e)}(t,e));return{name:t.name,align:t.align,memento:n}}));return v.some({lookupByName:function(t,e){return function(t,e,n){return U(e,(function(t){return t.name===n})).bind((function(e){return e.memento.getOpt(t)}))}(t,r,e)},footerButtons:r})},renderComponents:XM})])}},KM=function(t,e){return BD.parts.footer(YM(t,e))},JM=function(t,e){if(t.getRoot().getSystem().isConnected()){var n=Jl.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return KC.getField(n,e).fold((function(){var r=t.getFooter();return eT.getState(r).get().bind((function(t){return t.lookupByName(n,e)}))}),(function(t){return v.some(t)}))}return v.none()},QM=function(t,e,n){var r=function(e){var n=t.getRoot();n.getSystem().isConnected()&&e(n)},o={getData:function(){var e=t.getRoot(),r=e.getSystem().isConnected()?t.getFormWrapper():e,o=Vf.getValue(r),i=xt(n,(function(t){return t.get()}));return f(f({},o),i)},setData:function(e){r((function(r){var i=o.getData(),u=f(f({},i),e),a=function(t,e){var n=t.getRoot();return eT.getState(n).get().map((function(t){return we(xe("data",t.dataValidator,e))})).getOr(e)}(t,u),c=t.getFormWrapper();Vf.setValue(c,a),yt(n,(function(t,e){Et(u,e)&&t.set(u[e])}))}))},disable:function(e){JM(t,e).each(lv.disable)},enable:function(e){JM(t,e).each(lv.enable)},focus:function(e){JM(t,e).each(gg.focus)},block:function(t){if(!x(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");r((function(e){$r(e,ox,{message:t})}))},unblock:function(){r((function(t){Gr(t,ix)}))},showTab:function(e){r((function(n){var r=t.getBody();eT.getState(r).get().exists((function(t){return t.isTabPanel()}))&&Jl.getCurrent(r).each((function(t){gM.showTab(t,e)}))}))},redial:function(t){r((function(n){var r=e(t);n.getSystem().broadcastOn([CM],r),n.getSystem().broadcastOn([SM],r.internalDialog),n.getSystem().broadcastOn([kM],r.internalDialog),n.getSystem().broadcastOn([OM],r.internalDialog),o.setData(r.initialData)}))},close:function(){r((function(t){Gr(t,tx)}))}};return o},ZM=function(t,e,n){var r=VM(t.internalDialog.title,n),o=function(t,e){var n=EM(t,v.none(),e,!1);return BD.parts.body(n)}({body:t.internalDialog.body},n),i=UM(t.internalDialog.buttons),u=WM(i),a=KM({buttons:i},n),c=$M((function(){return d}),zM((function(){return l}),e),n.shared.getSink),s=function(t){switch(t){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}}(t.internalDialog.size),f={header:r,body:o,footer:v.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},l=jM(f,t,c,n),d=QM({getRoot:function(){return l},getBody:function(){return BD.getBody(l)},getFooter:function(){return BD.getFooter(l)},getFormWrapper:function(){var t=BD.getBody(l);return Jl.getCurrent(t).getOr(t)}},e.redial,u);return{dialog:l,instanceApi:d}},tI=function(t,e,n,r){var o,i,u,a,c,s=Ko("dialog-label"),f=Ko("dialog-content"),l=fp((u={title:t.internalDialog.title,draggable:!0},a=s,c=n.shared.providers,Hy.sketch({dom:pB('<div class="tox-dialog__header"></div>'),components:[FM(u,v.some(a),c),LM(),PM(c)],containerBehaviours:ic([gD.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return Ju(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),d=fp(function(t,e,n,r){return EM(t,v.some(e),n,r)}({body:t.internalDialog.body},f,n,r)),m=UM(t.internalDialog.buttons),g=WM(m),p=fp(function(t,e){return YM(t,e)}({buttons:m},n)),h=$M((function(){return y}),{onBlock:function(t){AD.block(b,(function(e,n){return HM(t.message,n)}))},onUnblock:function(){AD.unblock(b)},onClose:function(){return e.closeWindow()}},n.shared.getSink),b=hu({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=s,o["aria-describedby"]=""+f,o)},eventOrder:(i={},i[kr()]=[eT.name(),lc.name()],i[Or()]=["execute-on-form"],i[Pr()]=["reflecting","execute-on-form"],i),behaviours:ic([rg.config({mode:"cyclic",onEscape:function(t){return Gr(t,tx),v.some(!0)},useTabstopAt:function(t){return!OS(t)&&("button"!==go(t)||"disabled"!==Ho(t,"disabled"))}}),eT.config({channel:CM,updateState:function(t,e){return v.some(e)},initialData:t}),gg.config({}),sg("execute-on-form",h.concat([co(fr(),(function(t,e){rg.focusIn(t)}))])),AD.config({getRoot:function(){return v.some(b)}}),cg.config({}),vS({})]),components:[l.asSpec(),d.asSpec(),p.asSpec()]}),y=QM({getRoot:function(){return b},getFooter:function(){return p.get(b)},getBody:function(){return d.get(b)},getFormWrapper:function(){var t=d.get(b);return Jl.getCurrent(t).getOr(t)}},e.redial,g);return{dialog:b,instanceApi:y}},eI=tinymce.util.Tools.resolve("tinymce.util.URI"),nI=["insertContent","setContent","execCommand","close","block","unblock"],rI=function(t){return w(t)&&-1!==nI.indexOf(t.mceAction)},oI=function(t,e,n,r){var o,u,a,c=VM(t.title,r),s=function(t){var e={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[CS({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:ic([$y.config({}),gg.config({})])})]}],behaviours:ic([rg.config({mode:"acyclic",useTabstopAt:i(OS)})])};return BD.parts.body(e)}(t),l=t.buttons.bind((function(t){return 0===t.length?v.none():v.some(KM({buttons:t},r))})),d=GM((function(){return k}),zM((function(){return C}),e)),m=f(f({},t.height.fold((function(){return{}}),(function(t){return{height:t+"px","max-height":t+"px"}}))),t.width.fold((function(){return{}}),(function(t){return{width:t+"px","max-width":t+"px"}}))),g=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],p=new eI(t.url,{base_uri:new eI(window.location.href)}),h=p.protocol+"://"+p.host+(p.port?":"+p.port:""),b=an(v.none()),y=[sg("messages",[so((function(){var e=Cy(sn.fromDom(window),"message",(function(e){if(p.isSameOrigin(new eI(e.raw.origin))){var r=e.raw.data;rI(r)?function(t,e,n){switch(n.mceAction){case"insertContent":t.insertContent(n.content);break;case"setContent":t.setContent(n.content);break;case"execCommand":var r=!!S(n.ui)&&n.ui;t.execCommand(n.cmd,r,n.value);break;case"close":e.close();break;case"block":e.block(n.message);break;case"unblock":e.unblock()}}(n,k,r):function(t){return!rI(t)&&w(t)&&Et(t,"mceAction")}(r)&&t.onMessage(k,r)}}));b.set(v.some(e))})),fo((function(){b.get().each((function(t){return t.unbind()}))}))]),lc.config({channels:(o={},o[_M]={onReceive:function(t,e){Ku(t.element,"iframe").each((function(t){t.dom.contentWindow.postMessage(e,h)}))}},o)})],C=jM({header:c,body:s,footer:l,extraClasses:g,extraBehaviours:y,extraStyles:m},t,d,r),k=(u=C,a=function(t){u.getSystem().isConnected()&&t(u)},{block:function(t){if(!x(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");a((function(e){$r(e,ox,{message:t})}))},unblock:function(){a((function(t){Gr(t,ix)}))},close:function(){a((function(t){Gr(t,tx)}))},sendMessage:function(t){a((function(e){e.getSystem().broadcastOn([_M],t)}))}});return{dialog:C,instanceApi:k}},iI=function(t,e,n){return e&&n?[]:[GA.config({contextual:{lazyContext:function(){return v.some(zu(sn.fromDom(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},uI=function(t){var e=t.backstage,n=t.editor,r=Rv(n),o=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(){BD.hide(c),r()},i=fp(Lk({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:v.none()},"cancel",t.backstage)),u=NM(),a=BM(o,e.providers),c=hu(IM({lazySink:function(){return e.getSink()},header:AM(u,a),body:DM(n,e.providers),footer:v.some(RM(MM([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[eo(ex,o)],eventOrder:{}}));BD.show(c);var s=i.get(c);gg.focus(s)}}}(t),i=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(t){BD.hide(s),r(t)},i=fp(Lk({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:v.none()},"submit",t.backstage)),u=Lk({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:v.none()},"cancel",t.backstage),a=NM(),c=BM((function(){return o(!1)}),e.providers),s=hu(IM({lazySink:function(){return e.getSink()},header:AM(a,c),body:DM(n,e.providers),footer:v.some(RM(MM([],[u,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[eo(ex,(function(){return o(!1)})),eo(rx,(function(){return o(!0)}))],eventOrder:{}}));BD.show(s);var f=i.get(s);gg.focus(f)}}}(t),u=function(t,r){return eM.openUrl((function(t){var o=oI(t,{closeWindow:function(){BD.hide(o.dialog),r(o.instanceApi)}},n,e);return BD.show(o.dialog),o.instanceApi}),t)},a=function(t,n){return eM.open((function(t,r,o){var i=r,u=ZM({dataValidator:o,initialData:i,internalDialog:t},{redial:eM.redial,closeWindow:function(){BD.hide(u.dialog),n(u.instanceApi)}},e);return BD.show(u.dialog),u.instanceApi.setData(i),u.instanceApi}),t)},c=function(t,o,i,u){return eM.open((function(t,a,c){var s,l=we(xe("data",c,a)),m=(s=an(v.none()),{clear:function(){return s.set(v.none())},set:function(t){return s.set(v.some(t))},isSet:function(){return s.get().isSome()},on:function(t){return s.get().each(t)}}),g=e.shared.header.isPositionedAtTop(),p=function(){return m.on((function(t){Kg.reposition(t),GA.refresh(t)}))},h=tI({dataValidator:c,initialData:l,internalDialog:t},{redial:eM.redial,closeWindow:function(){m.on(Kg.hide),n.off("ResizeEditor",p),m.clear(),i(h.instanceApi)}},e,u),b=hu(Kg.sketch(f(f({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},g?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:ic(d([sg("window-manager-inline-events",[eo(Lr(),(function(t,e){Gr(h.dialog,ex)}))])],iI(n,r,g))),isExtraPart:function(t,e){return function(t){return Oy(t,".tox-alert-dialog")||Oy(t,".tox-confirm-dialog")}(e)}})));return m.set(b),Kg.showWithin(b,o,vu(h.dialog),v.some(Wi())),r&&g||(GA.refresh(b),n.on("ResizeEditor",p)),h.instanceApi.setData(l),rg.focusIn(h.dialog),h.instanceApi}),t)};return{open:function(t,n,r){return void 0!==n&&"toolbar"===n.inline?c(t,e.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?c(t,e.shared.anchors.cursor(),r,n.ariaAttrs):a(t,r)},openUrl:function(t,e){return u(t,e)},alert:function(t,e){o.open(t,(function(){e()}))},close:function(t){t.close()},confirm:function(t,e){i.open(t,(function(t){e(t)}))}}};s.add("silver",(function(t){var e=SD(t),r=e.uiMothership,o=e.backstage,i=e.renderUI,u=e.getUi;xy(t,o.shared);var a=uI({editor:t,backstage:o});return{renderUI:i,getWindowManagerImpl:n(a),getNotificationManagerImpl:function(){return hp(0,{backstage:o},r)},ui:u()}}))}(),function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function e(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function n(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}var r=function(){},o=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},i=function(t){return function(){return t}},u=function(t){return t};function a(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var c,s=function(t){return function(e){return!t(e)}},f=function(t){return function(){throw new Error(t)}},l=function(t){return t()},d=i(!1),m=i(!0),g=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},p=function(){return h},h=function(){var t=function(t){return t.isNone()},e=function(t){return t()},n=function(t){return t};return{fold:function(t,e){return t()},is:d,isSome:d,isNone:m,getOr:n,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:n,orThunk:e,map:p,each:r,bind:p,exists:d,forall:m,filter:p,equals:t,equals_:t,toArray:function(){return[]},toString:i("none()")}}(),v=function(t){var e=i(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:m,isNone:d,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return v(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:h},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(d,(function(e){return n(t,e)}))}};return o},b={some:v,none:p,from:function(t){return null==t?h:v(t)}},y=function(t){return function(e){return function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(e)===t}},x=function(t){return function(e){return typeof e===t}},w=y("string"),C=y("object"),S=y("array"),k=x("boolean"),O=function(t){return!function(t){return null==t}(t)},_=x("function"),E=x("number"),T=Array.prototype.slice,A=Array.prototype.indexOf,B=Array.prototype.push,N=function(t,e){return function(t,e){return A.call(t,e)}(t,e)>-1},D=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},R=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},M=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},I=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},P=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)}(t,(function(t){n=e(n,t)})),n},F=function(t,e,n){return M(t,(function(t){n=e(n,t)})),n},L=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return b.some(i);if(n(i,r))break}return b.none()}(t,e,d)},V=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return b.some(n)}return b.none()},H=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!S(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);B.apply(e,t[n])}return e},z=function(t,e){return H(R(t,e))},j=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},U=function(t){var e=T.call(t,0);return e.reverse(),e},W=function(t,e){return I(t,(function(t){return!N(e,t)}))},q=function(t){return[t]},G=function(t){return function(t,e){return e>=0&&e<t.length?b.some(t[e]):b.none()}(t,0)},$=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return b.none()},X=function(){return Y(0,0)},Y=function(t,e){return{major:t,minor:e}},K={nu:Y,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?X():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Y(r(1),r(2))}(t,n)},unknown:X},J=function(t,e){var n=String(e).toLowerCase();return L(t,(function(t){return t.search(n)}))},Q=function(t,e){return J(t,e).map((function(t){var n=K.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},Z=function(t,e){return J(t,e).map((function(t){var n=K.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},tt=function(t,e){return-1!==t.indexOf(e)},et=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),nt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,rt=function(t){return function(e){return tt(e,t)}},ot=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return tt(t,"edge/")&&tt(t,"chrome")&&tt(t,"safari")&&tt(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,nt],search:function(t){return tt(t,"chrome")&&!tt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return tt(t,"msie")||tt(t,"trident")}},{name:"Opera",versionRegexes:[nt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:rt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:rt("firefox")},{name:"Safari",versionRegexes:[nt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(tt(t,"safari")||tt(t,"mobile/"))&&tt(t,"applewebkit")}}],it=[{name:"Windows",search:rt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return tt(t,"iphone")||tt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:rt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:rt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:rt("linux"),versionRegexes:[]},{name:"Solaris",search:rt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:rt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:rt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],ut={browsers:i(ot),oses:i(it)},at="Edge",ct="Chrome",st="Opera",ft="Firefox",lt="Safari",dt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(at),isChrome:r(ct),isIE:r("IE"),isOpera:r(st),isFirefox:r(ft),isSafari:r(lt)}},mt={unknown:function(){return dt({current:void 0,version:K.unknown()})},nu:dt,edge:i(at),chrome:i(ct),ie:i("IE"),opera:i(st),firefox:i(ft),safari:i(lt)},gt="Windows",pt="Android",ht="Linux",vt="Solaris",bt="FreeBSD",yt="ChromeOS",xt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(gt),isiOS:r("iOS"),isAndroid:r(pt),isOSX:r("OSX"),isLinux:r(ht),isSolaris:r(vt),isFreeBSD:r(bt),isChromeOS:r(yt)}},wt={unknown:function(){return xt({current:void 0,version:K.unknown()})},nu:xt,windows:i(gt),ios:i("iOS"),android:i(pt),linux:i(ht),osx:i("OSX"),solaris:i(vt),freebsd:i(bt),chromeos:i(yt)},Ct=function(t,e){var n=ut.browsers(),r=ut.oses(),o=Q(n,t).fold(mt.unknown,mt.nu),u=Z(r,t).fold(wt.unknown,wt.nu),a=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),u=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),c=a||r("(pointer:coarse)"),s=o||!u&&a&&r("(min-device-width:768px)"),f=u||a&&!s,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!f&&!s&&!l;return{isiPad:i(o),isiPhone:i(u),isTablet:i(s),isPhone:i(f),isTouch:i(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:i(l),isDesktop:i(d)}}(u,o,t,e);return{browser:o,os:u,deviceType:a}},St=function(t){return window.matchMedia(t).matches},kt=g((function(){return Ct(navigator.userAgent,St)})),Ot=function(){return kt()},_t=i,Et=_t("touchstart"),Tt=_t("touchmove"),At=_t("touchend"),Bt=_t("mousedown"),Nt=_t("mousemove"),Dt=_t("mouseup"),Rt=_t("mouseover"),Mt=_t("keydown"),It=_t("keyup"),Pt=_t("input"),Ft=_t("change"),Lt=_t("click"),Vt=_t("transitionend"),Ht=_t("selectstart"),zt=function(t){return i("alloy."+t)},jt={tap:zt("tap")},Ut=zt("focus"),Wt=zt("blur.post"),qt=zt("paste.post"),Gt=zt("receive"),$t=zt("execute"),Xt=zt("focus.item"),Yt=jt.tap,Kt=zt("longpress"),Jt=zt("system.init"),Qt=zt("system.attached"),Zt=zt("system.detached"),te=zt("focusmanager.shifted"),ee=zt("highlight"),ne=zt("dehighlight"),re=function(t,e){ae(t,t.element,e,{})},oe=function(t,e,n){ae(t,t.element,e,n)},ie=function(t){re(t,$t())},ue=function(t,e,n){ae(t,e,n,{})},ae=function(e,n,r,o){var i=t({target:n},o);e.getSystem().triggerEvent(r,n,i)},ce=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},se={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return ce(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return ce(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return ce(n)},fromDom:ce,fromPoint:function(t,e,n){return b.from(t.dom.elementFromPoint(e,n)).map(ce)}},fe=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},le=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},de=function(t,e){var n=void 0===e?document:e.dom;return le(n)?[]:R(n.querySelectorAll(t),se.fromDom)},me=function(t,e){var n=void 0===e?document:e.dom;return le(n)?b.none():b.from(n.querySelector(t)).map(se.fromDom)},ge=function(t,e){return t.dom===e.dom},pe=("undefined"!=typeof window?window:Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),he=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},ve=he(1),be=he(3),ye=he(9),xe=he(11),we=function(t){return se.fromDom(t.dom.ownerDocument)},Ce=function(t){return ye(t)?t:we(t)},Se=function(t){return b.from(t.dom.parentNode).map(se.fromDom)},ke=function(t){return R(t.dom.childNodes,se.fromDom)},Oe=function(t,e){var n=t.dom.childNodes;return b.from(n[e]).map(se.fromDom)},_e=function(t,e){Se(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Ee=function(t,e){(function(t){return b.from(t.dom.nextSibling).map(se.fromDom)})(t).fold((function(){Se(t).each((function(t){Ae(t,e)}))}),(function(t){_e(t,e)}))},Te=function(t,e){(function(t){return Oe(t,0)})(t).fold((function(){Ae(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Ae=function(t,e){t.dom.appendChild(e.dom)},Be=function(t,e){M(e,(function(e){Ae(t,e)}))},Ne=function(t){t.dom.textContent="",M(ke(t),(function(t){De(t)}))},De=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Re=_(Element.prototype.attachShadow)&&_(Node.prototype.getRootNode),Me=i(Re),Ie=Re?function(t){return se.fromDom(t.dom.getRootNode())}:Ce,Pe=function(t){var e=Ie(t);return xe(e)?b.some(e):b.none()},Fe=function(t){return se.fromDom(t.dom.host)},Le=function(t){return O(t.dom.shadowRoot)},Ve=function(t){var e=be(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return Pe(se.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=Ve,r=Fe,function(t){return n(r(t))}))},He=function(){return ze(se.fromDom(document))},ze=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return se.fromDom(e)},je=function(t){re(t,Zt());var e=t.components();M(e,je)},Ue=function(t){var e=t.components();M(e,Ue),re(t,Qt())},We=function(t,e){Ae(t.element,e.element)},qe=function(t,e){var n=t.components();!function(t){M(t.components(),(function(t){return De(t.element)})),Ne(t.element),t.syncComponents()}(t);var r=W(n,e);M(r,(function(e){je(e),t.getSystem().removeFromWorld(e)})),M(e,(function(e){e.getSystem().isConnected()?We(t,e):(t.getSystem().addToWorld(e),We(t,e),Ve(t.element)&&Ue(e)),t.syncComponents()}))},Ge=function(t,e,n){t.getSystem().addToWorld(e),n(t.element,e.element),Ve(t.element)&&Ue(e),t.syncComponents()},$e=function(t){var e=Se(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}));!function(t){je(t),De(t.element),t.getSystem().removeFromWorld(t)}(t),e.each((function(t){t.syncComponents()}))},Xe=function(t,e,n){n(t,e.element);var r=ke(e.element);M(r,(function(t){e.getByDom(t).each(Ue)}))},Ye=Object.keys,Ke=Object.hasOwnProperty,Je=function(t,e){for(var n=Ye(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Qe=function(t,e){return Ze(t,(function(t,n){return{k:n,v:e(t,n)}}))},Ze=function(t,e){var n={};return Je(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},tn=function(t,e){var n={};return function(t,e,n,r){Je(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),r),n},en=function(t,e){var n=[];return Je(t,(function(t,r){n.push(e(t,r))})),n},nn=function(t,e){return rn(t,e)?b.from(t[e]):b.none()},rn=function(t,e){return Ke.call(t,e)},on=function(t,e){return rn(t,e)&&void 0!==t[e]&&null!==t[e]},un=function(t,e,n){if(!(w(n)||k(n)||E(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},an=function(t,e,n){un(t.dom,e,n)},cn=function(t,e){var n=t.dom;Je(e,(function(t,e){un(n,e,t)}))},sn=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},fn=function(t,e){return b.from(sn(t,e))},ln=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},dn=function(t,e){t.dom.removeAttribute(e)},mn=function(t,e){var n=sn(t,e);return void 0===n||""===n?[]:n.split(" ")},gn=function(t){return void 0!==t.dom.classList},pn=function(t,e){return function(t,e,n){var r=mn(t,e).concat([n]);return an(t,e,r.join(" ")),!0}(t,"class",e)},hn=function(t,e){return function(t,e,n){var r=I(mn(t,e),(function(t){return t!==n}));return r.length>0?an(t,e,r.join(" ")):dn(t,e),!1}(t,"class",e)},vn=function(t,e){gn(t)?t.dom.classList.add(e):pn(t,e)},bn=function(t){0===(gn(t)?t.dom.classList:function(t){return mn(t,"class")}(t)).length&&dn(t,"class")},yn=function(t,e){gn(t)?t.dom.classList.remove(e):hn(t,e);bn(t)},xn=function(t,e){return gn(t)&&t.dom.classList.contains(e)},wn=function(t,e,n){yn(t,n),vn(t,e)},Cn=Object.freeze({__proto__:null,toAlpha:function(t,e,n){wn(t.element,e.alpha,e.omega)},toOmega:function(t,e,n){wn(t.element,e.omega,e.alpha)},isAlpha:function(t,e,n){return xn(t.element,e.alpha)},isOmega:function(t,e,n){return xn(t.element,e.omega)},clear:function(t,e,n){yn(t.element,e.alpha),yn(t.element,e.omega)}}),Sn=function(t){return{is:function(e){return t===e},isValue:m,isError:d,getOr:i(t),getOrThunk:i(t),getOrDie:i(t),or:function(e){return Sn(t)},orThunk:function(e){return Sn(t)},fold:function(e,n){return n(t)},map:function(e){return Sn(e(t))},mapError:function(e){return Sn(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return b.some(t)}}},kn=function(t){return{is:d,isValue:d,isError:m,getOr:u,getOrThunk:function(t){return t()},getOrDie:function(){return f(String(t))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return kn(t)},mapError:function(e){return kn(e(t))},each:r,bind:function(e){return kn(t)},exists:d,forall:m,toOptional:b.none}},On={value:Sn,error:kn,fromOption:function(t,e){return t.fold((function(){return kn(e)}),Sn)}};!function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"}(c||(c={}));var _n,En,Tn,An=function(t,e,n){return t.stype===c.Error?e(t.serror):n(t.svalue)},Bn=function(t){return{stype:c.Value,svalue:t}},Nn=function(t){return{stype:c.Error,serror:t}},Dn=function(t){return t.fold(Nn,Bn)},Rn=function(t){return An(t,On.error,On.value)},Mn=Bn,In=function(t){var e=[],n=[];return M(t,(function(t){An(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},Pn=Nn,Fn=function(t,e){return t.stype===c.Value?e(t.svalue):t},Ln=function(t,e){return t.stype===c.Error?e(t.serror):t},Vn=function(t,e){return t.stype===c.Value?{stype:c.Value,svalue:e(t.svalue)}:t},Hn=function(t,e){return t.stype===c.Error?{stype:c.Error,serror:e(t.serror)}:t},zn=function(t){if(!S(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return M(t,(function(r,o){var i=Ye(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!S(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){var n=arguments.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+n);for(var r=new Array(n),i=0;i<r.length;i++)r[i]=arguments[i];var c=function(t){var n=Ye(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!j(e,(function(t){return N(n,t)})))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,r)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[o];return e.apply(null,r)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:r})}}}})),n},jn=Object.prototype.hasOwnProperty,Un=function(t){return function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)jn.call(i,u)&&(r[u]=t(r[u],i[u]))}return r}},Wn=Un((function(t,e){return C(t)&&C(e)?Wn(t,e):e})),qn=Un((function(t,e){return e})),Gn=zn([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),$n=function(t){return Gn.defaultedThunk(i(t))},Xn=function(t){return Gn.mergeWithThunk(i(t))},Yn=Gn.strict,Kn=Gn.asOption,Jn=Gn.defaultedThunk,Qn=(Gn.asDefaultedOptionThunk,Gn.mergeWithThunk),Zn=(zn([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t,e){var n;return(n={})[t]=e,n}),tr=function(t,e){return function(t,e){var n={};return Je(t,(function(t,r){N(e,r)||(n[r]=t)})),n}(t,e)},er=function(t,e){return Zn(t,e)},nr=function(t){return function(t){var e={};return M(t,(function(t){e[t.key]=t.value})),e}(t)},rr=function(t,e){var n,r=function(t){var e=[],n=[];return M(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}}(t);return r.errors.length>0?(n=r.errors,On.error(H(n))):function(t,e){return 0===t.length?On.value(e):On.value(Wn(e,qn.apply(void 0,t)))}(r.values,e)},or=function(t){return o(Pn,H)(t)},ir=function(t,e){var n=In(t);return n.errors.length>0?or(n.errors):function(t,e){return t.length>0?Mn(Wn(e,qn.apply(void 0,t))):Mn(e)}(n.values,e)},ur=function(t){var e=In(t);return e.errors.length>0?or(e.errors):Mn(e.values)},ar=function(t){return C(t)&&Ye(t).length>100?" removed due to size":JSON.stringify(t,null,2)},cr=function(t,e){return Pn([{path:t,getErrorInfo:e}])},sr=zn([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),fr=function(t,e,n){return nn(e,n).fold((function(){return function(t,e,n){return cr(t,(function(){return'Could not find valid *strict* value for "'+e+'" in '+ar(n)}))}(t,n,e)}),Mn)},lr=function(t,e,n){var r=nn(t,e).fold((function(){return n(t)}),u);return Mn(r)},dr=function(t,e,n,r){return n.fold((function(n,o,u,a){var c=function(e){var i=a.extract(t.concat([n]),r,e);return Vn(i,(function(t){return Zn(o,r(t))}))},s=function(e){return e.fold((function(){var t=Zn(o,r(b.none()));return Mn(t)}),(function(e){var i=a.extract(t.concat([n]),r,e);return Vn(i,(function(t){return Zn(o,r(b.some(t)))}))}))};return u.fold((function(){return Fn(fr(t,e,n),c)}),(function(t){return Fn(lr(e,n,t),c)}),(function(){return Fn(function(t,e){return Mn(nn(t,e))}(e,n),s)}),(function(t){return Fn(function(t,e,n){var r=nn(t,e).map((function(e){return!0===e?n(t):e}));return Mn(r)}(e,n,t),s)}),(function(t){var r=t(e),o=Vn(lr(e,n,i({})),(function(t){return Wn(r,t)}));return Fn(o,c)}))}),(function(t,n){var o=n(e);return Mn(Zn(t,r(o)))}))},mr=function(t){return{extract:function(e,n,r){return Ln(t(r,n),(function(t){return function(t,e){return cr(t,(function(){return e}))}(e,t)}))},toString:function(){return"val"}}},gr=function(t){return Ye(tn(t,(function(t){return null!=t})))},pr=function(t){var e=hr(t),n=P(t,(function(t,e){return e.fold((function(e){return Wn(t,er(e,!0))}),i(t))}),{});return{extract:function(t,r,o){var i=k(o)?[]:gr(o),u=I(i,(function(t){return!on(n,t)}));return 0===u.length?e.extract(t,r,o):function(t,e){return cr(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))}(t,u)},toString:e.toString}},hr=function(t){return{extract:function(e,n,r){return function(t,e,n,r){var o=R(n,(function(n){return dr(t,e,n,r)}));return ir(o,{})}(e,r,t,n)},toString:function(){return"obj{\n"+R(t,(function(t){return t.fold((function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))})).join("\n")+"}"}}},vr=function(t,e){var n=function(e,n){return function(t){return{extract:function(e,n,r){var o=R(r,(function(r,o){return t.extract(e.concat(["["+o+"]"]),n,r)}));return ur(o)},toString:function(){return"array("+t.toString()+")"}}}(mr(t)).extract(e,u,n)};return{extract:function(t,r,o){var i=Ye(o),u=n(t,i);return Fn(u,(function(n){var i=R(n,(function(t){return sr.field(t,t,Yn(),e)}));return hr(i).extract(t,r,o)}))},toString:function(){return"setOf("+e.toString()+")"}}},br=i(mr(Mn)),yr=sr.state,xr=sr.field,wr=function(t,e,n,r,o){return nn(r,o).fold((function(){return function(t,e,n){return cr(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+ar(e)}))}(t,r,o)}),(function(r){return r.extract(t.concat(["branch: "+o]),e,n)}))},Cr=function(t,e){return{extract:function(n,r,o){return nn(o,t).fold((function(){return function(t,e){return cr(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))}(n,t)}),(function(t){return wr(n,r,o,e,t)}))},toString:function(){return"chooseOn("+t+"). Possible values: "+Ye(e)}}},Sr=mr(Mn),kr=function(t){return mr((function(e){return t(e).fold(Pn,Mn)}))},Or=function(t,e){return vr((function(e){return Dn(t(e))}),e)},_r=function(t,e,n){return Rn(function(t,e,n,r){var o=e.extract([t],n,r);return Hn(o,(function(t){return{input:r,errors:t}}))}(t,e,u,n))},Er=function(t){return t.fold((function(t){throw new Error(Ar(t))}),u)},Tr=function(t,e,n){return Er(_r(t,e,n))},Ar=function(t){return"Errors: \n"+(e=t.errors,n=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,R(n,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))).join("\n")+"\n\nInput object: "+ar(t.input);var e,n},Br=function(t,e){return Cr(t,Qe(e,hr))},Nr=i(Sr),Dr=(_n=_,En="function",mr((function(t){var e=typeof t;return _n(t)?Mn(t):Pn("Expected type: "+En+" but got: "+e)}))),Rr=function(t){return xr(t,t,Yn(),br())},Mr=function(t,e){return xr(t,t,Yn(),e)},Ir=function(t,e){return xr(t,t,Yn(),hr(e))},Pr=function(t){return xr(t,t,Kn(),br())},Fr=function(t,e){return xr(t,t,Kn(),e)},Lr=function(t,e){return Fr(t,hr(e))},Vr=function(t,e){return Fr(t,pr(e))},Hr=function(t,e){return xr(t,t,$n(e),br())},zr=function(t,e,n){return xr(t,t,$n(e),n)},jr=function(t,e){return yr(t,e)},Ur=[Rr("alpha"),Rr("omega")],Wr=function(t){return _(t)?t:d},qr=function(t,e,n){var r=e(t),o=Wr(n);return r.orThunk((function(){return o(t)?b.none():function(t,e,n){for(var r=t.dom,o=Wr(n);r.parentNode;){r=r.parentNode;var i=se.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return b.none()}(t,e,o)}))},Gr=function(t,e){return ge(t.element,e.event.target)},$r=function(t){if(!on(t,"can")&&!on(t,"abort")&&!on(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return Tr("Extracting event.handler",pr([Hr("can",m),Hr("abort",d),Hr("run",r)]),t)},Xr=function(t){var e=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return F(t,(function(t,r){return t&&e(r).apply(void 0,n)}),!0)}}(t,(function(t){return t.can})),n=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return F(t,(function(t,r){return t||e(r).apply(void 0,n)}),!1)}}(t,(function(t){return t.abort}));return $r({can:e,abort:n,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];M(t,(function(t){t.run.apply(void 0,e)}))}})},Yr=function(t){return nr(t)},Kr=function(t,e){return{key:t,value:$r({abort:e})}},Jr=function(t,e){return{key:t,value:$r({run:e})}},Qr=function(t,e,n){return{key:t,value:$r({run:function(t,r){e.apply(void 0,[t,r].concat(n))}})}},Zr=function(t){return function(e){return{key:t,value:$r({run:function(t,n){Gr(t,n)&&e(t,n)}})}}},to=function(t,e,n){return function(t,e){return Jr(t,(function(n,r){n.getSystem().getByUid(e).each((function(e){!function(t,e,n,r){t.getSystem().triggerEvent(n,e,r.event)}(e,e.element,t,r)}))}))}(t,e.partUids[n])},eo=function(t){return Jr(t,(function(t,e){e.cut()}))},no=function(t){return Jr(t,(function(t,e){e.stop()}))},ro=function(t,e){return Zr(t)(e)},oo=Zr(Qt()),io=Zr(Zt()),uo=Zr(Jt()),ao=function(t){return function(e){return Jr(t,e)}}($t()),co=function(t){return R(t,(function(t){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(e=t,n="/*",e.length-n.length)?t.substring(0,t.length-"/*".length):t;var e,n}))},so=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:co(i)}},t},fo=function(t){return{classes:void 0!==t.classes?t.classes:[],attributes:void 0!==t.attributes?t.attributes:{},styles:void 0!==t.styles?t.styles:{}}},lo=function(t,e,n){return uo((function(r,o){n(r,t,e)}))},mo=function(t,e,n){return function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),u=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:co(u.slice(0,1).concat(u.slice(3)))}},t}((function(r){for(var o=[],u=1;u<arguments.length;u++)o[u-1]=arguments[u];var a=[r].concat(o);return r.config({name:i(t)}).fold((function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+n)}),(function(t){var n=Array.prototype.slice.call(a,1);return e.apply(void 0,[r,t.config,t.state].concat(n))}))}),n,e)},go=function(t){return{key:t,value:void 0}},po=function(e,n,r,o,i,u,c){var s=function(t){return on(t,r)?t[r]():b.none()},f=Qe(i,(function(t,e){return mo(r,t,e)})),l=Qe(u,(function(t,e){return so(t,e)})),d=t(t(t({},l),f),{revoke:a(go,r),config:function(t){var n=Tr(r+"-config",e,t);return{key:r,value:{config:n,me:d,configAsRaw:g((function(){return Tr(r+"-config",e,t)})),initialConfig:t,state:c}}},schema:function(){return n},exhibit:function(t,e){return s(t).bind((function(t){return nn(o,"exhibit").map((function(n){return n(e,t.config,t.state)}))})).getOr(fo({}))},name:function(){return r},handlers:function(t){return s(t).map((function(t){return nn(o,"events").getOr((function(){return{}}))(t.config,t.state)})).getOr({})}});return d},ho={init:function(){return vo({readState:function(){return"No State required"}})}},vo=function(t){return t},bo=function(t){return nr(t)},yo=pr([Rr("fields"),Rr("name"),Hr("active",{}),Hr("apis",{}),Hr("state",ho),Hr("extra",{})]),xo=function(t){var e=Tr("Creating behaviour: "+t.name,yo,t);return function(t,e,n,r,o,i){var u=pr(t),a=Lr(e,[Vr("config",t)]);return po(u,a,e,n,r,o,i)}(e.fields,e.name,e.active,e.apis,e.extra,e.state)},wo=pr([Rr("branchKey"),Rr("branches"),Rr("name"),Hr("active",{}),Hr("apis",{}),Hr("state",ho),Hr("extra",{})]),Co=i(void 0),So=xo({fields:Ur,name:"swapping",apis:Cn}),ko=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Oo=function(t){return t.dom.focus()},_o=function(t){return t.dom.blur()},Eo=function(t){return void 0===t&&(t=se.fromDom(document)),b.from(t.dom.activeElement).map(se.fromDom)},To=function(t){return Eo(Ie(t)).filter((function(e){return t.dom.contains(e.dom)}))},Ao=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Bo=tinymce.util.Tools.resolve("tinymce.ThemeManager"),No=[{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",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],Do=["undo","bold","italic","link","image","bullist","styleselect"],Ro="formatChanged",Mo="orientationChanged",Io="dropupDismissed",Po=function(t){return t.dom.innerHTML},Fo=function(t,e){var n,r,o=we(t).dom,i=se.fromDom(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,ke(se.fromDom(r)));Be(i,u),Ne(t),Ae(t,i)},Lo=function(t){return function(t,e){return se.fromDom(t.dom.cloneNode(e))}(t,!1)},Vo=function(t){return function(t){var e=se.fromTag("div"),n=se.fromDom(t.dom.cloneNode(!0));return Ae(e,n),Po(e)}(Lo(t))},Ho=function(t){return Vo(t)},zo=Object.freeze({__proto__:null,events:function(t){return Yr([Jr(Gt(),(function(e,n){var r=t.channels,o=Ye(r),i=n,u=function(t,e){return e.universal?t:I(t,(function(t){return N(e.channels,t)}))}(o,i);M(u,(function(t){var n=r[t],o=n.schema,u=Tr("channel["+t+"] data\nReceiver: "+Ho(e.element),o,i.data);n.onReceive(e,u)}))}))])}}),jo="unknown";!function(t){t[t.STOP=0]="STOP",t[t.NORMAL=1]="NORMAL",t[t.LOGGING=2]="LOGGING"}(Tn||(Tn={}));var Uo,Wo=ko({}),qo=function(t,e,n){switch(nn(Wo.get(),t).orThunk((function(){var e=Ye(Wo.get());return $(e,(function(e){return t.indexOf(e)>-1?b.some(Wo.get()[e]):b.none()}))})).getOr(Tn.NORMAL)){case Tn.NORMAL:return n(Xo());case Tn.LOGGING:var r=function(t,e){var n=[],r=(new Date).getTime();return{logEventCut:function(t,e,r){n.push({outcome:"cut",target:e,purpose:r})},logEventStopped:function(t,e,r){n.push({outcome:"stopped",target:e,purpose:r})},logNoParent:function(t,e,r){n.push({outcome:"no-parent",target:e,purpose:r})},logEventNoHandlers:function(t,e){n.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,r){n.push({outcome:"response",purpose:r,target:e})},write:function(){var o=(new Date).getTime();N(["mousemove","mouseover","mouseout",Jt()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:R(n,(function(t){return N(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Ho(t.target)+")":t.outcome}))})}}}(t,e),o=n(r);return r.write(),o;case Tn.STOP:return!0}},Go=["alloy/data/Fields","alloy/debugging/Debugging"],$o=function(t,e,n){return qo(t,e,n)},Xo=i({logEventCut:r,logEventStopped:r,logNoParent:r,logEventNoHandlers:r,logEventResponse:r,write:r}),Yo=i([Rr("menu"),Rr("selectedMenu")]),Ko=i([Rr("item"),Rr("selectedItem")]),Jo=(i(hr(Ko().concat(Yo()))),i(hr(Ko()))),Qo=Ir("initSize",[Rr("numColumns"),Rr("numRows")]),Zo=function(t,e,n){!function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");return L(e,(function(t){return t.indexOf("alloy")>0&&!D(Go,(function(e){return t.indexOf(e)>-1}))})).getOr(jo)}}();return xr(e,e,n,kr((function(t){return On.value((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}))})))},ti=function(t){return Zo(0,t,$n(r))},ei=function(t){return Zo(0,t,$n(b.none))},ni=function(t){return Zo(0,t,Yn())},ri=function(t){return Zo(0,t,Yn())},oi=function(t,e){return jr(t,i(e))},ii=function(t){return jr(t,u)},ui=i(Qo),ai=[Mr("channels",Or(On.value,pr([ni("onReceive"),Hr("schema",Nr())])))],ci=xo({fields:ai,name:"receiving",active:zo}),si=function(t,e,n){var r=e.aria;r.update(t,r,n.get())},fi=function(t,e,n){e.toggleClass.each((function(e){n.get()?vn(t.element,e):yn(t.element,e)}))},li=function(t,e,n){gi(t,e,n,!n.get())},di=function(t,e,n){n.set(!0),fi(t,e,n),si(t,e,n)},mi=function(t,e,n){n.set(!1),fi(t,e,n),si(t,e,n)},gi=function(t,e,n,r){(r?di:mi)(t,e,n)},pi=function(t,e,n){gi(t,e,n,e.selected)},hi=Object.freeze({__proto__:null,onLoad:pi,toggle:li,isOn:function(t,e,n){return n.get()},on:di,off:mi,set:gi}),vi=Object.freeze({__proto__:null,exhibit:function(){return fo({})},events:function(t,e){var n,r,o,i=(n=t,r=e,o=li,ao((function(t){o(t,n,r)}))),u=lo(t,e,pi);return Yr(H([t.toggleOnExecute?[i]:[],[u]]))}}),bi=function(t,e,n){an(t.element,"aria-expanded",n)},yi=[Hr("selected",!1),Pr("toggleClass"),Hr("toggleOnExecute",!0),zr("aria",{mode:"none"},Br("mode",{pressed:[Hr("syncWithExpanded",!1),oi("update",(function(t,e,n){an(t.element,"aria-pressed",n),e.syncWithExpanded&&bi(t,e,n)}))],checked:[oi("update",(function(t,e,n){an(t.element,"aria-checked",n)}))],expanded:[oi("update",bi)],selected:[oi("update",(function(t,e,n){an(t.element,"aria-selected",n)}))],none:[oi("update",r)]}))],xi=xo({fields:yi,name:"toggling",active:vi,apis:hi,state:(Uo=!1,{init:function(){var t=ko(Uo);return{get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(Uo)},readState:function(){return t.get()}}}})}),wi=function(t,e){return ci.config({channels:er(Ro,{onReceive:function(n,r){r.command===t&&e(n,r.state)}})})},Ci=function(t){return ci.config({channels:er(Mo,{onReceive:t})})},Si=function(t,e){return{key:t,value:{onReceive:e}}},ki="tinymce-mobile",Oi=function(t){return ki+"-"+t},_i=function(){var t=function(t,e){e.stop(),ie(t)};return[Jr(Lt(),t),Jr(Yt(),t),eo(Et()),eo(Bt())]},Ei=function(t,e){e.ignore||(Oo(t.element),e.onFocus(t))},Ti=Object.freeze({__proto__:null,focus:Ei,blur:function(t,e){e.ignore||_o(t.element)},isFocused:function(t){return function(t){var e=Ie(t).dom;return t.dom===e.activeElement}(t.element)}}),Ai=Object.freeze({__proto__:null,exhibit:function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return fo(n)},events:function(t){return Yr([Jr(Ut(),(function(e,n){Ei(e,t),n.stop()}))].concat(t.stopMousedown?[Jr(Bt(),(function(t,e){e.event.prevent()}))]:[]))}}),Bi=[ti("onFocus"),Hr("stopMousedown",!1),Hr("ignore",!1)],Ni=xo({fields:Bi,name:"focusing",active:Ai,apis:Ti}),Di=function(t){return void 0!==t.style&&_(t.style.getPropertyValue)},Ri=function(t,e,n){if(!w(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Di(t)&&t.style.setProperty(e,n)},Mi=function(t,e,n){var r=t.dom;Ri(r,e,n)},Ii=function(t,e){var n=t.dom;Je(e,(function(t,e){Ri(n,e,t)}))},Pi=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||Ve(t)?r:Fi(n,e)},Fi=function(t,e){return Di(t)?t.style.getPropertyValue(e):""},Li=function(t,e){var n=t.dom,r=Fi(n,e);return b.from(r).filter((function(t){return t.length>0}))},Vi=function(t,e){!function(t,e){Di(t)&&t.style.removeProperty(e)}(t.dom,e),fn(t,"style").map(et).is("")&&dn(t,"style")},Hi=function(t){return t.dom.offsetWidth};function zi(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Pi(n,t);return parseFloat(o)||0}return r},r=function(t,e){return F(e,(function(e,n){var r=Pi(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!E(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Di(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}var ji=zi("height",(function(t){var e=t.dom;return Ve(t)?e.getBoundingClientRect().height:e.offsetHeight})),Ui=function(t){return ji.get(t)},Wi=function(t,e,n){return I(function(t,e){for(var n=_(e)?e:d,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=se.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o}(t,n),e)},qi=function(t,e){return I(function(t){return Se(t).map(ke).map((function(e){return I(e,(function(e){return!ge(t,e)}))})).getOr([])}(t),e)},Gi=function(t,e,n){return Wi(t,(function(t){return fe(t,e)}),n)},$i=function(t,e){return de(e,t)};function Xi(t,e,n,r,o){return t(n,r)?b.some(n):_(o)&&o(n)?b.none():e(n,r,o)}var Yi,Ki=function(t,e,n){for(var r=t.dom,o=_(n)?n:d;r.parentNode;){r=r.parentNode;var i=se.fromDom(r);if(e(i))return b.some(i);if(o(i))break}return b.none()},Ji=function(t){return me(t)},Qi=function(t,e,n){return Ki(t,(function(t){return fe(t,e)}),n)},Zi=function(t,e){return me(e,t)},tu=function(t,e,n){return Xi((function(t,e){return fe(t,e)}),Qi,t,e,n)},eu=[8],nu=[9],ru=[13],ou=[27],iu=[32],uu=[37],au=[38],cu=[39],su=[40],fu=function(t,e,n){var r=U(t.slice(0,e)),o=U(t.slice(e+1));return L(r.concat(o),n)},lu=function(t,e,n){var r=U(t.slice(0,e));return L(r,n)},du=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return L(o.concat(r),n)},mu=function(t,e,n){var r=t.slice(e+1);return L(r,n)},gu=function(t){return function(e){var n=e.raw;return N(t,n.which)}},pu=function(t){return function(e){return j(t,(function(t){return t(e)}))}},hu=function(t){return!0===t.raw.shiftKey},vu=function(t){return!0===t.raw.ctrlKey},bu=s(hu),yu=function(t,e){return{matches:t,classification:e}},xu=function(t,e,n,r){var o=t+e;return o>r?n:o<n?r:o},wu=function(t,e,n){return Math.min(Math.max(t,e),n)},Cu=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},Su=function(t,e,n,r){var o=$i(t.element,"."+e.highlightClass);M(o,(function(n){D(r,(function(t){return t.element===n}))||(yn(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),re(n,ne())})))}))},ku=function(t,e,n,r){Su(t,e,0,[r]),Ou(t,e,n,r)||(vn(r.element,e.highlightClass),e.onHighlight(t,r),re(r,ee()))},Ou=function(t,e,n,r){return xn(r.element,e.highlightClass)},_u=function(t,e,n,r){var o=$i(t.element,"."+e.itemClass);return b.from(o[r]).fold((function(){return On.error("No element found with index "+r)}),t.getSystem().getByDom)},Eu=function(t,e,n){return Zi(t.element,"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Tu=function(t,e,n){var r=$i(t.element,"."+e.itemClass);return(r.length>0?b.some(r[r.length-1]):b.none()).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Au=function(t,e,n,r){var o=$i(t.element,"."+e.itemClass);return V(o,(function(t){return xn(t,e.highlightClass)})).bind((function(e){var n=xu(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},Bu=function(t,e,n){var r=$i(t.element,"."+e.itemClass);return Cu(R(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},Nu=Object.freeze({__proto__:null,dehighlightAll:function(t,e,n){return Su(t,e,0,[])},dehighlight:function(t,e,n,r){Ou(t,e,n,r)&&(yn(r.element,e.highlightClass),e.onDehighlight(t,r),re(r,ne()))},highlight:ku,highlightFirst:function(t,e,n){Eu(t,e).each((function(r){ku(t,e,n,r)}))},highlightLast:function(t,e,n){Tu(t,e).each((function(r){ku(t,e,n,r)}))},highlightAt:function(t,e,n,r){_u(t,e,n,r).fold((function(t){throw new Error(t)}),(function(r){ku(t,e,n,r)}))},highlightBy:function(t,e,n,r){var o=Bu(t,e);L(o,r).each((function(r){ku(t,e,n,r)}))},isHighlighted:Ou,getHighlighted:function(t,e,n){return Zi(t.element,"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},getFirst:Eu,getLast:Tu,getPrevious:function(t,e,n){return Au(t,e,0,-1)},getNext:function(t,e,n){return Au(t,e,0,1)},getCandidates:Bu}),Du=[Rr("highlightClass"),Rr("itemClass"),ti("onHighlight"),ti("onDehighlight")],Ru=xo({fields:Du,name:"highlighting",apis:Nu}),Mu=function(t,e,n){e.exists((function(t){return n.exists((function(e){return ge(e,t)}))}))||oe(t,te(),{prevFocus:e,newFocus:n})},Iu=function(){var t=function(t){return To(t.element)};return{get:t,set:function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);Mu(e,r,o)}}},Pu=function(){var t=function(t){return Ru.getHighlighted(t).map((function(t){return t.element}))};return{get:t,set:function(e,n){var o=t(e);e.getSystem().getByDom(n).fold(r,(function(t){Ru.highlight(e,t)}));var i=t(e);Mu(e,o,i)}}};!function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"}(Yi||(Yi={}));var Fu=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i,u,a=n(t,e,r,o);return(i=a,u=e.event,L(i,(function(t){return t.matches(u)})).map((function(t){return t.classification}))).bind((function(n){return n(t,e,r,o)}))},u={schema:function(){return t.concat([Hr("focusManager",Iu()),zr("focusInside","onFocus",kr((function(t){return N(["onFocus","onEnterOrSpace","onApi"],t)?On.value(t):On.error("Invalid value for focusInside")}))),oi("handler",u),oi("state",e),oi("sendFocusIn",o)])},processKey:i,toEvents:function(t,e){var u=t.focusInside!==Yi.OnFocusMode?b.none():o(t).map((function(n){return Jr(Ut(),(function(r,o){n(r,t,e),o.stop()}))})),a=[Jr(Mt(),(function(r,u){i(r,u,n,t,e).fold((function(){!function(n,r){var i=gu(iu.concat(ru))(r.event);t.focusInside===Yi.OnEnterOrSpaceMode&&i&&Gr(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))}(r,u)}),(function(t){u.stop()}))})),Jr(It(),(function(n,o){i(n,o,r,t,e).each((function(t){o.stop()}))}))];return Yr(u.toArray().concat(a))}};return u},Lu=function(t){var e=[Pr("onEscape"),Pr("onEnter"),Hr("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Hr("firstTabstop",0),Hr("useTabstopAt",m),Pr("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return tu(e,t)})).getOr(e);return Ui(n)>0},r=function(t,e,r){(function(t,e){var r=$i(t.element,e.selector),o=I(r,(function(t){return n(e,t)}));return b.from(o[e.firstTabstop])})(t,e).each((function(n){e.focusManager.set(t,n)}))},o=function(t,e,r,o,i){return i(e,r,(function(t){return function(t,e){return n(t,e)&&t.useTabstopAt(e)}(o,t)})).fold((function(){return o.cyclic?b.some(!0):b.none()}),(function(e){return o.focusManager.set(t,e),b.some(!0)}))},u=function(t,e,n,r){var i=$i(t.element,n.selector);return function(t,e){return e.focusManager.get(t).bind((function(t){return tu(t,e.selector)}))}(t,n).bind((function(e){return V(i,a(ge,e)).bind((function(e){return o(t,i,e,n,r)}))}))},c=i([yu(pu([hu,gu(nu)]),(function(t,e,n){var r=n.cyclic?fu:lu;return u(t,0,n,r)})),yu(gu(nu),(function(t,e,n){var r=n.cyclic?du:mu;return u(t,0,n,r)})),yu(gu(ou),(function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))})),yu(pu([bu,gu(ru)]),(function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))}))]),s=i([]);return Fu(e,ho.init,c,s,(function(){return b.some(r)}))},Vu=Lu(jr("cyclic",d)),Hu=Lu(jr("cyclic",m)),zu=function(t){return"input"===pe(t)&&"radio"!==sn(t,"type")||"textarea"===pe(t)},ju=function(t,e,n){return zu(n)&&gu(iu)(e.event)?b.none():function(t,e,n){return ue(t,n,$t()),b.some(!0)}(t,0,n)},Uu=function(t,e){return b.some(!0)},Wu=[Hr("execute",ju),Hr("useSpace",!1),Hr("useEnter",!0),Hr("useControlEnter",!1),Hr("useDown",!1)],qu=function(t,e,n){return n.execute(t,e,t.element)},Gu=Fu(Wu,ho.init,(function(t,e,n,r){var o=n.useSpace&&!zu(t.element)?iu:[],i=n.useEnter?ru:[],u=n.useDown?su:[],a=o.concat(i).concat(u);return[yu(gu(a),qu)].concat(n.useControlEnter?[yu(pu([vu,gu(ru)]),qu)]:[])}),(function(t,e,n,r){return n.useSpace&&!zu(t.element)?[yu(gu(iu),Uu)]:[]}),(function(){return b.none()})),$u=function(){var t=ko(b.none());return vo({readState:function(){return t.get().map((function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(e,n){t.set(b.some({numRows:e,numColumns:n}))},getNumRows:function(){return t.get().map((function(t){return t.numRows}))},getNumColumns:function(){return t.get().map((function(t){return t.numColumns}))}})},Xu=Object.freeze({__proto__:null,flatgrid:$u,init:function(t){return t.state(t)}}),Yu=function(t,e){return function(n){return"rtl"===Ku(n)?e:t}},Ku=function(t){return"rtl"===Pi(t,"direction")?"rtl":"ltr"},Ju=function(t){return function(e,n,r,o){var i=t(e.element);return ea(i,e,n,r,o)}},Qu=function(t,e){var n=Yu(t,e);return Ju(n)},Zu=function(t,e){var n=Yu(e,t);return Ju(n)},ta=function(t){return function(e,n,r,o){return ea(t,e,n,r,o)}},ea=function(t,e,n,r,o){return r.focusManager.get(e).bind((function(n){return t(e.element,n,r,o)})).map((function(t){return r.focusManager.set(e,t),!0}))},na=ta,ra=ta,oa=ta,ia=function(t){return!function(t){return t.offsetWidth<=0&&t.offsetHeight<=0}(t.dom)},ua=function(t,e,n){var r=$i(t,n);return function(t,e){return V(t,e).map((function(e){return{index:e,candidates:t}}))}(I(r,ia),(function(t){return ge(t,e)}))},aa=function(t,e){return V(t,(function(t){return ge(e,t)}))},ca=function(t,e,n,r){return r(Math.floor(e/n),e%n).bind((function(e){var r=e.row*n+e.column;return r>=0&&r<t.length?b.some(t[r]):b.none()}))},sa=function(t,e,n,r,o){return ca(t,e,r,(function(e,i){var u=e===n-1?t.length-e*r:r,a=xu(i,o,0,u-1);return b.some({row:e,column:a})}))},fa=function(t,e,n,r,o){return ca(t,e,r,(function(e,i){var u=xu(e,o,0,n-1),a=u===n-1?t.length-u*r:r,c=wu(i,0,a-1);return b.some({row:u,column:c})}))},la=[Rr("selector"),Hr("execute",ju),ei("onEscape"),Hr("captureTab",!1),ui()],da=function(t,e,n){Zi(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},ma=function(t){return function(e,n,r,o){return ua(e,n,r.selector).bind((function(e){return t(e.candidates,e.index,o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))}))}},ga=function(t,e,n){return n.captureTab?b.some(!0):b.none()},pa=ma((function(t,e,n,r){return sa(t,e,n,r,-1)})),ha=ma((function(t,e,n,r){return sa(t,e,n,r,1)})),va=ma((function(t,e,n,r){return fa(t,e,n,r,-1)})),ba=ma((function(t,e,n,r){return fa(t,e,n,r,1)})),ya=i([yu(gu(uu),Qu(pa,ha)),yu(gu(cu),Zu(pa,ha)),yu(gu(au),na(va)),yu(gu(su),ra(ba)),yu(pu([hu,gu(nu)]),ga),yu(pu([bu,gu(nu)]),ga),yu(gu(ou),(function(t,e,n){return n.onEscape(t,e)})),yu(gu(iu.concat(ru)),(function(t,e,n,r){return function(t,e){return e.focusManager.get(t).bind((function(t){return tu(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))}))]),xa=i([yu(gu(iu),Uu)]),wa=Fu(la,$u,ya,xa,(function(){return b.some(da)})),Ca=function(t,e,n,r){var o=function(t,e,n){var i,u=xu(e,r,0,n.length-1);return u===t?b.none():(i=n[u],"button"===pe(i)&&"disabled"===sn(i,"disabled")?o(t,u,n):b.from(n[u]))};return ua(t,n,e).bind((function(t){var e=t.index,n=t.candidates;return o(e,e,n)}))},Sa=[Rr("selector"),Hr("getInitial",b.none),Hr("execute",ju),ei("onEscape"),Hr("executeOnMove",!1),Hr("allowVertical",!0)],ka=function(t,e,n){return function(t,e){return e.focusManager.get(t).bind((function(t){return tu(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))},Oa=function(t,e,n){e.getInitial(t).orThunk((function(){return Zi(t.element,e.selector)})).each((function(n){e.focusManager.set(t,n)}))},_a=function(t,e,n){return Ca(t,n.selector,e,-1)},Ea=function(t,e,n){return Ca(t,n.selector,e,1)},Ta=function(t){return function(e,n,r,o){return t(e,n,r,o).bind((function(){return r.executeOnMove?ka(e,n,r):b.some(!0)}))}},Aa=function(t,e,n){return n.onEscape(t,e)},Ba=i([yu(gu(iu),Uu)]),Na=Fu(Sa,ho.init,(function(t,e,n,r){var o=uu.concat(n.allowVertical?au:[]),i=cu.concat(n.allowVertical?su:[]);return[yu(gu(o),Ta(Qu(_a,Ea))),yu(gu(i),Ta(Zu(_a,Ea))),yu(gu(ru),ka),yu(gu(iu),ka),yu(gu(ou),Aa)]}),Ba,(function(){return b.some(Oa)})),Da=function(t,e,n){return b.from(t[e]).bind((function(t){return b.from(t[n]).map((function(t){return{rowIndex:e,columnIndex:n,cell:t}}))}))},Ra=function(t,e,n,r){var o=t[e].length,i=xu(n,r,0,o-1);return Da(t,e,i)},Ma=function(t,e,n,r){var o=xu(n,r,0,t.length-1),i=t[o].length,u=wu(e,0,i-1);return Da(t,o,u)},Ia=function(t,e,n,r){var o=t[e].length,i=wu(n+r,0,o-1);return Da(t,e,i)},Pa=function(t,e,n,r){var o=wu(n+r,0,t.length-1),i=t[o].length,u=wu(e,0,i-1);return Da(t,o,u)},Fa=[Ir("selectors",[Rr("row"),Rr("cell")]),Hr("cycles",!0),Hr("previousSelector",b.none),Hr("execute",ju)],La=function(t,e,n){e.previousSelector(t).orThunk((function(){var n=e.selectors;return Zi(t.element,n.cell)})).each((function(n){e.focusManager.set(t,n)}))},Va=function(t,e){return function(n,r,o){var i=o.cycles?t:e;return tu(r,o.selectors.row).bind((function(t){var e=$i(t,o.selectors.cell);return aa(e,r).bind((function(e){var r=$i(n,o.selectors.row);return aa(r,t).bind((function(t){var n=function(t,e){return R(t,(function(t){return $i(t,e.selectors.cell)}))}(r,o);return i(n,t,e).map((function(t){return t.cell}))}))}))}))}},Ha=Va((function(t,e,n){return Ra(t,e,n,-1)}),(function(t,e,n){return Ia(t,e,n,-1)})),za=Va((function(t,e,n){return Ra(t,e,n,1)}),(function(t,e,n){return Ia(t,e,n,1)})),ja=Va((function(t,e,n){return Ma(t,n,e,-1)}),(function(t,e,n){return Pa(t,n,e,-1)})),Ua=Va((function(t,e,n){return Ma(t,n,e,1)}),(function(t,e,n){return Pa(t,n,e,1)})),Wa=i([yu(gu(uu),Qu(Ha,za)),yu(gu(cu),Zu(Ha,za)),yu(gu(au),na(ja)),yu(gu(su),ra(Ua)),yu(gu(iu.concat(ru)),(function(t,e,n){return To(t.element).bind((function(r){return n.execute(t,e,r)}))}))]),qa=i([yu(gu(iu),Uu)]),Ga=Fu(Fa,ho.init,Wa,qa,(function(){return b.some(La)})),$a=[Rr("selector"),Hr("execute",ju),Hr("moveOnTab",!1)],Xa=function(t,e,n){return n.focusManager.get(t).bind((function(r){return n.execute(t,e,r)}))},Ya=function(t,e,n){Zi(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},Ka=function(t,e,n){return Ca(t,n.selector,e,-1)},Ja=function(t,e,n){return Ca(t,n.selector,e,1)},Qa=i([yu(gu(au),oa(Ka)),yu(gu(su),oa(Ja)),yu(pu([hu,gu(nu)]),(function(t,e,n,r){return n.moveOnTab?oa(Ka)(t,e,n,r):b.none()})),yu(pu([bu,gu(nu)]),(function(t,e,n,r){return n.moveOnTab?oa(Ja)(t,e,n,r):b.none()})),yu(gu(ru),Xa),yu(gu(iu),Xa)]),Za=i([yu(gu(iu),Uu)]),tc=Fu($a,ho.init,Qa,Za,(function(){return b.some(Ya)})),ec=[ei("onSpace"),ei("onEnter"),ei("onShiftEnter"),ei("onLeft"),ei("onRight"),ei("onTab"),ei("onShiftTab"),ei("onUp"),ei("onDown"),ei("onEscape"),Hr("stopSpaceKeyup",!1),Pr("focusIn")],nc=Fu(ec,ho.init,(function(t,e,n){return[yu(gu(iu),n.onSpace),yu(pu([bu,gu(ru)]),n.onEnter),yu(pu([hu,gu(ru)]),n.onShiftEnter),yu(pu([hu,gu(nu)]),n.onShiftTab),yu(pu([bu,gu(nu)]),n.onTab),yu(gu(au),n.onUp),yu(gu(su),n.onDown),yu(gu(uu),n.onLeft),yu(gu(cu),n.onRight),yu(gu(iu),n.onSpace),yu(gu(ou),n.onEscape)]}),(function(t,e,n){return n.stopSpaceKeyup?[yu(gu(iu),Uu)]:[]}),(function(t){return t.focusIn})),rc=Vu.schema(),oc=Hu.schema(),ic=Na.schema(),uc=wa.schema(),ac=Ga.schema(),cc=Gu.schema(),sc=tc.schema(),fc=nc.schema(),lc=function(t){var e=Tr("Creating behaviour: "+t.name,wo,t);return function(t,e,n,r,o,i){var u=t,a=Lr(e,[Fr("config",t)]);return po(u,a,e,n,r,o,i)}(Br(e.branchKey,e.branches),e.name,e.active,e.apis,e.extra,e.state)}({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:rc,cyclic:oc,flow:ic,flatgrid:uc,matrix:ac,execution:cc,menu:sc,special:fc}),name:"keying",active:{events:function(t,e){return t.handler.toEvents(t,e)}},apis:{focusIn:function(t,e,n){e.sendFocusIn(e).fold((function(){t.getSystem().triggerFocus(t.element,t.element)}),(function(r){r(t,e,n)}))},setGridSize:function(t,e,n,r,o){!function(t){return on(t,"setGridSize")}(n)?console.error("Layout does not support setGridSize"):n.setGridSize(r,o)}},state:Xu}),dc=function(t,e){return n=t,r={},o=R(e,(function(e){return n=e.name(),r="Cannot configure "+e.name()+" for "+t,xr(n,n,Kn(),mr((function(t){return Pn("The field: "+n+" is forbidden. "+r)})));var n,r})).concat([jr("dump",u)]),zr(n,r,hr(o));var n,r,o},mc=function(t){return t.dump},gc=function(e,n){return t(t({},e.dump),bo(n))},pc=dc,hc=gc,vc="placeholder",bc=zn([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),yc=function(t){return rn(t,"uiType")},xc=function(t,e,n,r){return yc(n)&&n.uiType===vc?function(t,e,n,r){return t.exists((function(t){return t!==n.owner}))?bc.single(!0,i(n)):nn(r,n.name).fold((function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+Ye(r)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))}),(function(t){return t.replace()}))}(t,0,n,r):bc.single(!1,i(n))},wc=function(e,n,r,o){return xc(e,0,r,o).fold((function(i,u){var a=yc(r)?u(n,r.config,r.validated):u(n),c=nn(a,"components").getOr([]),s=z(c,(function(t){return wc(e,n,t,o)}));return[t(t({},a),{components:s})]}),(function(t,e){if(yc(r)){var o=e(n,r.config,r.validated);return r.validated.preprocess.getOr(u)(o)}return e(n)}))},Cc=function(t,e,n,r){var o=Qe(r,(function(t,e){return r=t,o=!1,{name:i(n=e),required:function(){return r.fold((function(t,e){return t}),(function(t,e){return t}))},used:function(){return o},replace:function(){if(o)throw new Error("Trying to use the same placeholder more than once: "+n);return o=!0,r}};var n,r,o})),u=function(t,e,n,r){return z(n,(function(n){return wc(t,e,n,r)}))}(t,e,n,o);return Je(o,(function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))})),u},Sc=bc.single,kc=bc.multiple,Oc=i(vc),_c=0,Ec=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++_c+String(e)},Tc=zn([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Ac=Hr("factory",{sketch:u}),Bc=Hr("schema",[]),Nc=Rr("name"),Dc=xr("pname","pname",Jn((function(t){return"<alloy."+Ec(t.name)+">"})),Nr()),Rc=jr("schema",(function(){return[Pr("preprocess")]})),Mc=Hr("defaults",i({})),Ic=Hr("overrides",i({})),Pc=hr([Ac,Bc,Nc,Dc,Mc,Ic]),Fc=hr([Ac,Bc,Nc,Mc,Ic]),Lc=hr([Ac,Bc,Nc,Dc,Mc,Ic]),Vc=hr([Ac,Rc,Nc,Rr("unit"),Dc,Mc,Ic]),Hc=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},zc=function(t,e){return function(n){var r=Tr("Converting part type",e,n);return t(r)}},jc=zc(Tc.required,Pc),Uc=(zc(Tc.external,Fc),zc(Tc.optional,Lc)),Wc=zc(Tc.group,Vc),qc=i("entirety"),Gc=function(t,e,n,r){return Wn(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},$c=function(e,n){var r={};return M(n,(function(n){(function(t){return t.fold(b.some,b.none,b.some,b.some)})(n).each((function(n){var o=Xc(e,n.pname);r[n.name]=function(r){var i=Tr("Part: "+n.name+" in "+e,hr(n.schema),r);return t(t({},o),{config:r,validated:i})}}))})),r},Xc=function(t,e){return{uiType:Oc(),owner:t,name:e}},Yc=function(t,e,n){return function(t,e,n){var r={},o={};return M(n,(function(t){t.fold((function(t){r[t.pname]=Sc(!0,(function(e,n,r){return t.factory.sketch(Gc(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];o[t.name]=i(t.factory.sketch(Gc(e,t,n[qc()]),n))}),(function(t){r[t.pname]=Sc(!1,(function(e,n,r){return t.factory.sketch(Gc(e,t,n,r))}))}),(function(t){r[t.pname]=kc(!0,(function(e,n,r){var o=e[t.name];return R(o,(function(n){return t.factory.sketch(Wn(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:i(r),externals:i(o)}}(0,e,n)},Kc=function(t,e,n){return Cc(b.some(t),e,e.components,n)},Jc=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},Qc=function(t,e,n){return Jc(t,e,n).getOrDie("Could not find part: "+n)},Zc=function(t,e){var n=function(t){return R(t,Hc)}(e);return nr(R(n,(function(e){return{key:e,value:t+"-"+e}})))},ts=function(t){return xr("partUids","partUids",Qn((function(e){return Zc(e.uid,t)})),Nr())},es=Ec("alloy-premade"),ns=function(t){return er(es,t)},rs=function(t){return function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:co(i.slice(1))}},t}((function(e){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];return t.apply(void 0,n([e.getApis(),e],r))}),t)},os=i("alloy-id-"),is=i("data-alloy-id"),us=os(),as=is(),cs=function(t,e){Object.defineProperty(t.dom,as,{value:e,writable:!0})},ss=function(t){var e=ve(t)?t.dom[as]:null;return b.from(e)},fs=function(t){return Ec(t)},ls=function(t,e,n,r,o){var i=function(t,e){return(t.length>0?[Ir("parts",t)]:[]).concat([Rr("uid"),Hr("dom",{}),Hr("components",[]),ii("originalSpec"),Hr("debug.sketcher",{})]).concat(e)}(r,o);return Tr(t+" [SpecSchema]",pr(i.concat(e)),n)},ds=function(t,e,n,r,o){var i=ms(o),u=function(t){return z(t,(function(t){return t.fold(b.none,b.some,b.none,b.none).map((function(t){return Ir(t.name,t.schema.concat([ii(qc())]))})).toArray()}))}(n),a=ts(n),c=ls(t,e,i,u,[a]),s=Yc(0,c,n);return r(c,Kc(t,c,s.internals()),i,s.externals())},ms=function(e){return function(t){return rn(t,"uid")}(e)?e:t(t({},e),{uid:fs("uid")})};var gs=pr([Rr("name"),Rr("factory"),Rr("configFields"),Hr("apis",{}),Hr("extraApis",{})]),ps=pr([Rr("name"),Rr("factory"),Rr("configFields"),Rr("partFields"),Hr("apis",{}),Hr("extraApis",{})]),hs=function(e){var n=Tr("Sketcher for "+e.name,gs,e),r=Qe(n.apis,rs),o=Qe(n.extraApis,(function(t,e){return so(t,e)}));return t(t({name:n.name,configFields:n.configFields,sketch:function(t){return function(t,e,n,r){var o=ms(r);return n(ls(t,e,o,[],[]),o)}(n.name,n.configFields,n.factory,t)}},r),o)},vs=function(e){var n=Tr("Sketcher for "+e.name,ps,e),r=$c(n.name,n.partFields),o=Qe(n.apis,rs),i=Qe(n.extraApis,(function(t,e){return so(t,e)}));return t(t({name:n.name,partFields:n.partFields,configFields:n.configFields,sketch:function(t){return ds(n.name,n.configFields,n.partFields,n.factory,t)},parts:r},o),i)},bs=hs({name:"Button",factory:function(e){var n,r=(n=e.action,Yr(H([n.map((function(t){return ao((function(e,n){t(e),n.stop()}))})).toArray(),_i()]))),o=e.dom.tag,i=function(t){return nn(e.dom,"attributes").bind((function(e){return nn(e,t)}))};return{uid:e.uid,dom:e.dom,components:e.components,events:r,behaviours:hc(e.buttonBehaviours,[Ni.config({}),lc.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===o){var e=i("type").getOr("button"),n=i("role").map((function(t){return{role:t}})).getOr({});return t({type:e},n)}return{role:i("role").getOr("button")}}()},eventOrder:e.eventOrder}},configFields:[Hr("uid",void 0),Rr("dom"),Hr("components",[]),pc("buttonBehaviours",[Ni,lc]),Pr("action"),Pr("role"),Hr("eventOrder",{})]}),ys=Object.freeze({__proto__:null,events:function(){return Yr([Kr(Ht(),m)])},exhibit:function(){return fo({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}}),xs=xo({fields:[],name:"unselecting",active:ys}),ws=function(e){var n=se.fromHtml(e),r=ke(n),o=function(e){var n=void 0!==e.dom.attributes?e.dom.attributes:[];return F(n,(function(e,n){var r;return"class"===n.name?e:t(t({},e),((r={})[n.name]=n.value,r))}),{})}(n),i=function(t){return Array.prototype.slice.call(t.dom.classList,0)}(n),u=0===r.length?{}:{innerHtml:Po(n)};return t({tag:pe(n),classes:i,attributes:o},u)},Cs=function(t){var e,n=(e={prefix:ki},t.replace(/\$\{([^{}]*)\}/g,(function(t,n){var r=e[n];return function(t){var e=typeof t;return"string"===e||"number"===e}(r)?r.toString():t})));return ws(n)},Ss=function(t){return{dom:Cs(t)}},ks=function(t){return bo([xi.config({toggleClass:Oi("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),wi(t,(function(t,e){(e?xi.on:xi.off)(t)}))])},Os=function(t,e,n,r){var o=ks(n);return Es(e,r,o,t)},_s=function(t,e){var n=e.ui.registry.getAll().icons;return b.from(n[t]).fold((function(){return Cs('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item ${prefix}-icon-'+t+' ${prefix}-icon"></span>')}),(function(t){return Cs('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item">'+t+"</span>")}))},Es=function(t,e,n,r){return bs.sketch({dom:_s(t,r),action:e,buttonBehaviours:Wn(bo([xs.config({})]),n)})},Ts=Uc({schema:[Rr("dom")],name:"label"}),As=function(t){return Uc({name:t+"-edge",overrides:function(e){return e.model.manager.edgeActions[t].fold((function(){return{}}),(function(t){return{events:Yr([Qr(Et(),(function(e,n,r){return t(e,r)}),[e]),Qr(Bt(),(function(e,n,r){return t(e,r)}),[e]),Qr(Nt(),(function(e,n,r){r.mouseIsDown.get()&&t(e,r)}),[e])])}}))}})},Bs=As("top-left"),Ns=As("top"),Ds=As("top-right"),Rs=As("right"),Ms=As("bottom-right"),Is=As("bottom"),Ps=As("bottom-left"),Fs=[Ts,As("left"),Rs,Ns,Is,Bs,Ds,Ps,Ms,jc({name:"thumb",defaults:i({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:Yr([to(Et(),t,"spectrum"),to(Tt(),t,"spectrum"),to(At(),t,"spectrum"),to(Bt(),t,"spectrum"),to(Nt(),t,"spectrum"),to(Dt(),t,"spectrum")])}}}),jc({schema:[jr("mouseIsDown",(function(){return ko(!1)}))],name:"spectrum",overrides:function(t){var e=t.model.manager,n=function(n,r){return e.getValueFromEvent(r).map((function(r){return e.setValueFrom(n,t,r)}))};return{behaviours:bo([lc.config({mode:"special",onLeft:function(n){return e.onLeft(n,t)},onRight:function(n){return e.onRight(n,t)},onUp:function(n){return e.onUp(n,t)},onDown:function(n){return e.onDown(n,t)}}),Ni.config({})]),events:Yr([Jr(Et(),n),Jr(Tt(),n),Jr(Bt(),n),Jr(Nt(),(function(e,r){t.mouseIsDown.get()&&n(e,r)}))])}}})],Ls=function(t,e,n){e.store.manager.onLoad(t,e,n)},Vs=function(t,e,n){e.store.manager.onUnload(t,e,n)},Hs=Object.freeze({__proto__:null,onLoad:Ls,onUnload:Vs,setValue:function(t,e,n,r){e.store.manager.setValue(t,e,n,r)},getValue:function(t,e,n){return e.store.manager.getValue(t,e,n)},getState:function(t,e,n){return n}}),zs=Object.freeze({__proto__:null,events:function(t,e){var n=t.resetOnDom?[oo((function(n,r){Ls(n,t,e)})),io((function(n,r){Vs(n,t,e)}))]:[lo(t,e,Ls)];return Yr(n)}}),js=function(){var t=ko(null);return vo({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},Us=function(){var e=ko({}),n=ko({});return vo({readState:function(){return{mode:"dataset",dataByValue:e.get(),dataByText:n.get()}},lookup:function(t){return nn(e.get(),t).orThunk((function(){return nn(n.get(),t)}))},update:function(r){var o=e.get(),i=n.get(),u={},a={};M(r,(function(t){u[t.value]=t,nn(t,"meta").each((function(e){nn(e,"text").each((function(e){a[e]=t}))}))})),e.set(t(t({},o),u)),n.set(t(t({},i),a))},clear:function(){e.set({}),n.set({})}})},Ws=Object.freeze({__proto__:null,memory:js,dataset:Us,manual:function(){return vo({readState:function(){}})},init:function(t){return t.store.manager.state(t)}}),qs=function(t,e,n,r){var o=e.store;n.update([r]),o.setValue(t,r),e.onSetValue(t,r)},Gs=[Pr("initialValue"),Rr("getFallbackEntry"),Rr("getDataKey"),Rr("setValue"),oi("manager",{setValue:qs,getValue:function(t,e,n){var r=e.store,o=r.getDataKey(t);return n.lookup(o).fold((function(){return r.getFallbackEntry(o)}),(function(t){return t}))},onLoad:function(t,e,n){e.store.initialValue.each((function(r){qs(t,e,n,r)}))},onUnload:function(t,e,n){n.clear()},state:Us})],$s=[Rr("getValue"),Hr("setValue",r),Pr("initialValue"),oi("manager",{setValue:function(t,e,n,r){e.store.setValue(t,r),e.onSetValue(t,r)},getValue:function(t,e,n){return e.store.getValue(t)},onLoad:function(t,e,n){e.store.initialValue.each((function(n){e.store.setValue(t,n)}))},onUnload:r,state:ho.init})],Xs=[Pr("initialValue"),oi("manager",{setValue:function(t,e,n,r){n.set(r),e.onSetValue(t,r)},getValue:function(t,e,n){return n.get()},onLoad:function(t,e,n){e.store.initialValue.each((function(t){n.isNotSet()&&n.set(t)}))},onUnload:function(t,e,n){n.clear()},state:js})],Ys=[zr("store",{mode:"memory"},Br("mode",{memory:Xs,manual:$s,dataset:Gs})),ti("onSetValue"),Hr("resetOnDom",!1)],Ks=xo({fields:Ys,name:"representing",active:zs,apis:Hs,extra:{setValueFrom:function(t,e){var n=Ks.getValue(e);Ks.setValue(t,n)}},state:Ws}),Js=zi("width",(function(t){return t.dom.offsetWidth})),Qs=function(t,e){return Js.set(t,e)},Zs=function(t){return Js.get(t)},tf=function(t,e){return{left:t,top:e,translate:function(n,r){return tf(t+n,e+r)}}},ef=tf,nf=i("slider.change.value"),rf=function(t){var e=t.event.raw;if(function(t){return-1!==t.type.indexOf("touch")}(e)){var n=e;return void 0!==n.touches&&1===n.touches.length?b.some(n.touches[0]).map((function(t){return ef(t.clientX,t.clientY)})):b.none()}var r=e;return void 0!==r.clientX?b.some(r).map((function(t){return ef(t.clientX,t.clientY)})):b.none()},of=function(t){return t.model.minX},uf=function(t){return t.model.minY},af=function(t){return t.model.minX-1},cf=function(t){return t.model.minY-1},sf=function(t){return t.model.maxX},ff=function(t){return t.model.maxY},lf=function(t){return t.model.maxX+1},df=function(t){return t.model.maxY+1},mf=function(t,e,n){return e(t)-n(t)},gf=function(t){return mf(t,sf,of)},pf=function(t){return mf(t,ff,uf)},hf=function(t){return gf(t)/2},vf=function(t){return pf(t)/2},bf=function(t){return t.stepSize},yf=function(t){return t.snapToGrid},xf=function(t){return t.snapStart},wf=function(t){return t.rounded},Cf=function(t,e){return void 0!==t[e+"-edge"]},Sf=function(t){return Cf(t,"left")},kf=function(t){return Cf(t,"right")},Of=function(t){return Cf(t,"top")},_f=function(t){return Cf(t,"bottom")},Ef=function(t){return t.model.value.get()},Tf=function(t){return{x:t}},Af=function(t){return{y:t}},Bf=function(t,e){return{x:t,y:e}},Nf=function(t,e){oe(t,nf(),{value:e})},Df=function(t,e,n,r){return t<e?t:t>n?n:t===e?e-1:Math.max(e,t-r)},Rf=function(t,e,n,r){return t>n?t:t<e?e:t===n?n+1:Math.min(n,t+r)},Mf=function(t,e,n){return Math.max(e,Math.min(n,t))},If=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,f=t.hasMaxEdge,l=t.minBound,d=t.maxBound,m=t.screenRange,g=s?e-1:e,p=f?n+1:n;if(o<l)return g;if(o>d)return p;var h=function(t,e,n){return Math.min(n,Math.max(t,e))-e}(o,l,d),v=Mf(h/m*r+e,g,p);return u&&v>=e&&v<=n?function(t,e,n,r,o){return o.fold((function(){var o=t-e,i=Math.round(o/r)*r;return Mf(e+i,e-1,n+1)}),(function(e){var o=(t-e)%r,i=Math.round(o/r),u=Math.floor((t-e)/r),a=Math.floor((n-e)/r),c=e+Math.min(a,u+i)*r;return Math.max(e,c)}))}(v,e,n,i,a):c?Math.round(v):v},Pf=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,f=t.centerMaxEdge;return o<e?i?0:s:o>n?u?a:f:(o-e)/r*c},Ff="top",Lf="right",Vf="bottom",Hf="left",zf=function(t){return t.element.dom.getBoundingClientRect()},jf=function(t,e){return t[e]},Uf=function(t){var e=zf(t);return jf(e,Hf)},Wf=function(t){var e=zf(t);return jf(e,Lf)},qf=function(t){var e=zf(t);return jf(e,Ff)},Gf=function(t){var e=zf(t);return jf(e,Vf)},$f=function(t){var e=zf(t);return jf(e,"width")},Xf=function(t){var e=zf(t);return jf(e,"height")},Yf=function(t,e,n){return(t+e)/2-n},Kf=function(t,e){var n=zf(t),r=zf(e),o=jf(n,Hf),i=jf(n,Lf),u=jf(r,Hf);return Yf(o,i,u)},Jf=function(t,e){var n=zf(t),r=zf(e),o=jf(n,Ff),i=jf(n,Vf),u=jf(r,Ff);return Yf(o,i,u)},Qf=function(t,e){oe(t,nf(),{value:e})},Zf=function(t){return{x:t}},tl=function(t,e,n){var r={min:of(e),max:sf(e),range:gf(e),value:n,step:bf(e),snap:yf(e),snapStart:xf(e),rounded:wf(e),hasMinEdge:Sf(e),hasMaxEdge:kf(e),minBound:Uf(t),maxBound:Wf(t),screenRange:$f(t)};return If(r)},el=function(t){return function(e,n){return function(t,e,n){var r=(t>0?Rf:Df)(Ef(n).x,of(n),sf(n),bf(n));return Qf(e,Zf(r)),b.some(r)}(t,e,n).map((function(){return!0}))}},nl=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=$f(t),u=r.bind((function(e){return b.some(Kf(e,t))})).getOr(0),a=o.bind((function(e){return b.some(Kf(e,t))})).getOr(i),c={min:of(e),max:sf(e),range:gf(e),value:n,hasMinEdge:Sf(e),hasMaxEdge:kf(e),minBound:Uf(t),minOffset:0,maxBound:Wf(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return Pf(c)}(e,i,n,r,o);return Uf(e)-Uf(t)+u},rl=el(-1),ol=el(1),il=b.none,ul=b.none,al={"top-left":b.none(),top:b.none(),"top-right":b.none(),right:b.some((function(t,e){Nf(t,Tf(lf(e)))})),"bottom-right":b.none(),bottom:b.none(),"bottom-left":b.none(),left:b.some((function(t,e){Nf(t,Tf(af(e)))}))},cl=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=tl(t,e,n),o=Zf(r);return Qf(t,o),r},setToMin:function(t,e){var n=of(e);Qf(t,Zf(n))},setToMax:function(t,e){var n=sf(e);Qf(t,Zf(n))},findValueOfOffset:tl,getValueFromEvent:function(t){return rf(t).map((function(t){return t.left}))},findPositionOfValue:nl,setPositionFromValue:function(t,e,n,r){var o=Ef(n),i=nl(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=Zs(e.element)/2;Mi(e.element,"left",i-u+"px")},onLeft:rl,onRight:ol,onUp:il,onDown:ul,edgeActions:al}),sl=function(t,e){oe(t,nf(),{value:e})},fl=function(t){return{y:t}},ll=function(t,e,n){var r={min:uf(e),max:ff(e),range:pf(e),value:n,step:bf(e),snap:yf(e),snapStart:xf(e),rounded:wf(e),hasMinEdge:Of(e),hasMaxEdge:_f(e),minBound:qf(t),maxBound:Gf(t),screenRange:Xf(t)};return If(r)},dl=function(t){return function(e,n){return function(t,e,n){var r=(t>0?Rf:Df)(Ef(n).y,uf(n),ff(n),bf(n));return sl(e,fl(r)),b.some(r)}(t,e,n).map((function(){return!0}))}},ml=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=Xf(t),u=r.bind((function(e){return b.some(Jf(e,t))})).getOr(0),a=o.bind((function(e){return b.some(Jf(e,t))})).getOr(i),c={min:uf(e),max:ff(e),range:pf(e),value:n,hasMinEdge:Of(e),hasMaxEdge:_f(e),minBound:qf(t),minOffset:0,maxBound:Gf(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return Pf(c)}(e,i,n,r,o);return qf(e)-qf(t)+u},gl=b.none,pl=b.none,hl=dl(-1),vl=dl(1),bl={"top-left":b.none(),top:b.some((function(t,e){Nf(t,Af(cf(e)))})),"top-right":b.none(),right:b.none(),"bottom-right":b.none(),bottom:b.some((function(t,e){Nf(t,Af(df(e)))})),"bottom-left":b.none(),left:b.none()},yl=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=ll(t,e,n),o=fl(r);return sl(t,o),r},setToMin:function(t,e){var n=uf(e);sl(t,fl(n))},setToMax:function(t,e){var n=ff(e);sl(t,fl(n))},findValueOfOffset:ll,getValueFromEvent:function(t){return rf(t).map((function(t){return t.top}))},findPositionOfValue:ml,setPositionFromValue:function(t,e,n,r){var o=Ef(n),i=ml(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=Ui(e.element)/2;Mi(e.element,"top",i-u+"px")},onLeft:gl,onRight:pl,onUp:hl,onDown:vl,edgeActions:bl}),xl=function(t,e){oe(t,nf(),{value:e})},wl=function(t,e){return{x:t,y:e}},Cl=function(t,e){return function(n,r){return function(t,e,n,r){var o=t>0?Rf:Df,i=e?Ef(r).x:o(Ef(r).x,of(r),sf(r),bf(r)),u=e?o(Ef(r).y,uf(r),ff(r),bf(r)):Ef(r).y;return xl(n,wl(i,u)),b.some(i)}(t,e,n,r).map((function(){return!0}))}},Sl=Cl(-1,!1),kl=Cl(1,!1),Ol=Cl(-1,!0),_l=Cl(1,!0),El={"top-left":b.some((function(t,e){Nf(t,Bf(af(e),cf(e)))})),top:b.some((function(t,e){Nf(t,Bf(hf(e),cf(e)))})),"top-right":b.some((function(t,e){Nf(t,Bf(lf(e),cf(e)))})),right:b.some((function(t,e){Nf(t,Bf(lf(e),vf(e)))})),"bottom-right":b.some((function(t,e){Nf(t,Bf(lf(e),df(e)))})),bottom:b.some((function(t,e){Nf(t,Bf(hf(e),df(e)))})),"bottom-left":b.some((function(t,e){Nf(t,Bf(af(e),df(e)))})),left:b.some((function(t,e){Nf(t,Bf(af(e),vf(e)))}))},Tl=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=tl(t,e,n.left),o=ll(t,e,n.top),i=wl(r,o);return xl(t,i),i},setToMin:function(t,e){var n=of(e),r=uf(e);xl(t,wl(n,r))},setToMax:function(t,e){var n=sf(e),r=ff(e);xl(t,wl(n,r))},getValueFromEvent:function(t){return rf(t)},setPositionFromValue:function(t,e,n,r){var o=Ef(n),i=nl(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=ml(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=Zs(e.element)/2,c=Ui(e.element)/2;Mi(e.element,"left",i-a+"px"),Mi(e.element,"top",u-c+"px")},onLeft:Sl,onRight:kl,onUp:Ol,onDown:_l,edgeActions:El}),Al=[Hr("stepSize",1),Hr("onChange",r),Hr("onChoose",r),Hr("onInit",r),Hr("onDragStart",r),Hr("onDragEnd",r),Hr("snapToGrid",!1),Hr("rounded",!0),Pr("snapStart"),Mr("model",Br("mode",{x:[Hr("minX",0),Hr("maxX",100),jr("value",(function(t){return ko(t.mode.minX)})),Rr("getInitialValue"),oi("manager",cl)],y:[Hr("minY",0),Hr("maxY",100),jr("value",(function(t){return ko(t.mode.minY)})),Rr("getInitialValue"),oi("manager",yl)],xy:[Hr("minX",0),Hr("maxX",100),Hr("minY",0),Hr("maxY",100),jr("value",(function(t){return ko({x:t.mode.minX,y:t.mode.minY})})),Rr("getInitialValue"),oi("manager",Tl)]})),dc("sliderBehaviours",[lc,Ks]),jr("mouseIsDown",(function(){return ko(!1)}))],Bl=i("mouse.released"),Nl=vs({name:"Slider",configFields:Al,partFields:Fs,factory:function(t,e,n,r){var o,i=function(e){return Qc(e,t,"thumb")},u=function(e){return Qc(e,t,"spectrum")},a=function(e){return Jc(e,t,"left-edge")},c=function(e){return Jc(e,t,"right-edge")},s=function(e){return Jc(e,t,"top-edge")},f=function(e){return Jc(e,t,"bottom-edge")},l=t.model,d=l.manager,g=function(e,n){d.setPositionFromValue(e,n,t,{getLeftEdge:a,getRightEdge:c,getTopEdge:s,getBottomEdge:f,getSpectrum:u})},p=function(e,n){l.value.set(n);var r=i(e);return g(e,r),t.onChange(e,r,n),b.some(!0)},h=function(e){var n=t.mouseIsDown.get();t.mouseIsDown.set(!1),n&&Jc(e,t,"thumb").each((function(n){var r=l.value.get();t.onChoose(e,n,r)}))},v=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},y=function(e,n){n.stop(),t.onDragEnd(e,i(e)),h(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:gc(t.sliderBehaviours,[lc.config({mode:"special",focusIn:function(e){return Jc(e,t,"spectrum").map(lc.focusIn).map(m)}}),Ks.config({store:{mode:"manual",getValue:function(t){return l.value.get()}}}),ci.config({channels:(o={},o[Bl()]={onReceive:h},o)})]),events:Yr([Jr(nf(),(function(t,e){p(t,e.event.value)})),oo((function(e,n){var r=l.getInitialValue();l.value.set(r);var o=i(e);g(e,o);var a=u(e);t.onInit(e,o,a,l.value.get())})),Jr(Et(),v),Jr(At(),y),Jr(Bt(),v),Jr(Dt(),y)]),apis:{resetToMin:function(e){d.setToMin(e,t)},resetToMax:function(e){d.setToMax(e,t)},changeValue:p,refresh:g},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),Dl=function(t,e,n,r){return Es(e,(function(){var r=n();t.setContextToolbar([{label:e+" group",items:r}])}),{},r)},Rl=function(t){var e=function(t){return t<0?"black":t>360?"white":"hsl("+t+", 100%, 50%)"};return Nl.sketch({dom:Cs('<div class="${prefix}-slider ${prefix}-hue-slider-container"></div>'),components:[Nl.parts["left-edge"](Ss('<div class="${prefix}-hue-slider-black"></div>')),Nl.parts.spectrum({dom:Cs('<div class="${prefix}-slider-gradient-container"></div>'),components:[Ss('<div class="${prefix}-slider-gradient"></div>')],behaviours:bo([xi.config({toggleClass:Oi("thumb-active")})])}),Nl.parts["right-edge"](Ss('<div class="${prefix}-hue-slider-white"></div>')),Nl.parts.thumb({dom:Cs('<div class="${prefix}-slider-thumb"></div>'),behaviours:bo([xi.config({toggleClass:Oi("thumb-active")})])})],onChange:function(n,r,o){var i=e(o.x());Mi(r.element,"background-color",i),t.onChange(n,r,i)},onDragStart:function(t,e){xi.on(e)},onDragEnd:function(t,e){xi.off(e)},onInit:function(t,n,r,o){var i=e(o.x());Mi(n.element,"background-color",i)},stepSize:10,model:{mode:"x",minX:0,maxX:360,getInitialValue:function(){return{x:t.getInitialValue()}}},sliderBehaviours:bo([Ci(Nl.refresh)])})},Ml=function(t,e){var n={onChange:function(t,n,r){e.undoManager.transact((function(){e.formatter.apply("forecolor",{value:r}),e.nodeChanged()}))},getInitialValue:function(){return-1}};return Dl(t,"color-levels",(function(){return function(t){return[Rl(t)]}(n)}),e)},Il=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],Pl=function(t,e){return(ve(e)?b.some(e):Se(e).filter(ve)).map((function(e){return function(t,e,n){return Xi((function(t,e){return e(t)}),Ki,t,e,n)}(e,(function(t){return Li(t,"font-size").isSome()}),t).bind((function(t){return Li(t,"font-size")})).getOrThunk((function(){return Pi(e,"font-size")}))})).getOr("")},Fl=function(t){var e=t.selection.getStart(),n=se.fromDom(e),r=se.fromDom(t.getBody()),o=Pl((function(t){return ge(r,t)}),n);return L(Il,(function(t){return o===t})).getOr("medium")},Ll=function(t){return function(t){return V(Il,(function(e){return e===t}))}(Fl(t)).getOr(2)},Vl=function(t,e){(function(t){return b.from(Il[t])})(e).each((function(e){!function(t,e){Fl(t)!==e&&t.execCommand("fontSize",!1,e)}(t,e)}))},Hl=i(Il),zl=pr([Rr("getInitialValue"),Rr("onChange"),Rr("category"),Rr("sizes")]),jl=function(t){var e=Tr("SizeSlider",zl,t);return Nl.sketch({dom:{tag:"div",classes:[Oi("slider-"+e.category+"-size-container"),Oi("slider"),Oi("slider-size-container")]},onChange:function(t,n,r){var o=r.x();(function(t){return t>=0&&t<e.sizes.length})(o)&&e.onChange(o)},onDragStart:function(t,e){xi.on(e)},onDragEnd:function(t,e){xi.off(e)},model:{mode:"x",minX:0,maxX:e.sizes.length-1,getInitialValue:function(){return{x:e.getInitialValue()}}},stepSize:1,snapToGrid:!0,sliderBehaviours:bo([Ci(Nl.refresh)]),components:[Nl.parts.spectrum({dom:Cs('<div class="${prefix}-slider-size-container"></div>'),components:[Ss('<div class="${prefix}-slider-size-line"></div>')]}),Nl.parts.thumb({dom:Cs('<div class="${prefix}-slider-thumb"></div>'),behaviours:bo([xi.config({toggleClass:Oi("thumb-active")})])})]})},Ul=Hl(),Wl=function(t){return jl({onChange:t.onChange,sizes:Ul,category:"font",getInitialValue:t.getInitialValue})},ql=function(t){return[Ss('<span class="${prefix}-toolbar-button ${prefix}-icon-small-font ${prefix}-icon"></span>'),Wl(t),Ss('<span class="${prefix}-toolbar-button ${prefix}-icon-large-font ${prefix}-icon"></span>')]},Gl=function(e){var n=function(t){return void 0!==t.uid}(e)&&on(e,"uid")?e.uid:fs("memento");return{get:function(t){return t.getSystem().getByUid(n).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(n).toOptional()},asSpec:function(){return t(t({},e),{uid:n})}}},$l=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(t,r(u,this),r(a,this))},e=window,n=t.immediateFn||"function"==typeof e.setImmediate&&e.setImmediate||function(t){setTimeout(t,1)};function r(t,e){return function(){return t.apply(e,arguments)}}var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t){var e=this;null!==this._state?n((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function u(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void f(r(e,t),r(u,this),r(a,this))}this._state=!0,this._value=t,c.call(this)}catch(t){a.call(this,t)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];i.call(this,n)}this._deferreds=[]}function s(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function f(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.then=function(e,n){var r=this;return new t((function(t,o){i.call(r,new s(e,n,t,o))}))},t.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Array.prototype.slice.call(1===e.length&&o(e[0])?e[0]:e);return new t((function(t,e){if(0===r.length)return t([]);var n=r.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),e)}r[i]=u,0==--n&&t(r)}catch(t){e(t)}}for(var i=0;i<r.length;i++)o(i,r[i])}))},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=0,o=e;r<o.length;r++){o[r].then(t,n)}}))},t}();function Xl(t){return function(t){return new $l((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(t){return t.split(",")[1]}))}var Yl,Kl,Jl=function(t,e){(function(t){return Xl(t)})(e).then((function(n){t.undoManager.transact((function(){var r=t.editorUpload.blobCache,o=r.create(Ec("mceu"),e,n);r.add(o);var i=t.dom.createHTML("img",{src:o.blobUri()});t.insertContent(i)}))}))},Ql=function(t){var e=Gl({dom:{tag:"input",attributes:{accept:"image/*",type:"file",title:""},styles:{visibility:"hidden",position:"absolute"}},events:Yr([eo(Lt()),Jr(Ft(),(function(e,n){(function(t){var e=t.event.raw,n=e.target.files||e.dataTransfer.files;return b.from(n[0])})(n).each((function(e){Jl(t,e)}))}))])});return bs.sketch({dom:_s("image",t),components:[e.asSpec()],action:function(t){e.get(t).element.dom.click()}})},Zl=function(t){return t.dom.textContent},td=function(t){return t.length>0},ed=function(t){return null==t?"":t},nd=function(t){return id(t).fold((function(){return function(t){return{url:"",text:t.selection.getContent({format:"text"}),title:"",target:"",link:b.none()}}(t)}),(function(t){return function(t){var e=Zl(t),n=sn(t,"href"),r=sn(t,"title"),o=sn(t,"target");return{url:ed(n),text:e!==n?ed(e):"",title:ed(r),target:ed(o),link:b.some(t)}}(t)}))},rd=function(t,e,n){return n.text.toOptional().filter(td).fold((function(){return function(t){return sn(t,"href")===Zl(t)}(t)?b.some(e):b.none()}),b.some)},od=function(t,e){e.url.toOptional().filter(td).fold((function(){!function(t,e){e.link.bind(u).each((function(e){t.execCommand("unlink")}))}(t,e)}),(function(n){var r=function(t,e){var n={};return n.href=t,e.title.toOptional().filter(td).each((function(t){n.title=t})),e.target.toOptional().filter(td).each((function(t){n.target=t})),n}(n,e);e.link.bind(u).fold((function(){var o=e.text.toOptional().filter(td).getOr(n);t.insertContent(t.dom.createHTML("a",r,t.dom.encode(o)))}),(function(t){var o=rd(t,n,e);cn(t,r),o.each((function(e){!function(t,e){t.dom.textContent=e}(t,e)}))}))}))},id=function(t){var e=se.fromDom(t.selection.getStart());return tu(e,"a")},ud=Ot(),ad=function(t,e){var n=e.selection.getRng();t(),e.selection.setRng(n)},cd=function(t,e){return{key:t,value:{config:{},me:function(t,e){var n=Yr(e);return xo({fields:[Rr("enabled")],name:t,active:{events:i(n)}})}(t,e),configAsRaw:i({}),initialConfig:{},state:ho}}},sd=Object.freeze({__proto__:null,getCurrent:function(t,e,n){return e.find(t)}}),fd=[Rr("find")],ld=xo({fields:fd,name:"composing",apis:sd}),dd=hs({name:"Container",factory:function(n){var r=n.dom,o=r.attributes,i=e(r,["attributes"]);return{uid:n.uid,dom:t({tag:"div",attributes:t({role:"presentation"},o)},i),components:n.components,behaviours:mc(n.containerBehaviours),events:n.events,domModification:n.domModification,eventOrder:n.eventOrder}},configFields:[Hr("components",[]),dc("containerBehaviours",[]),Hr("events",{}),Hr("domModification",{}),Hr("eventOrder",{})]}),md=hs({name:"DataField",factory:function(t){return{uid:t.uid,dom:t.dom,behaviours:hc(t.dataBehaviours,[Ks.config({store:{mode:"memory",initialValue:t.getInitialValue()}}),ld.config({find:b.some})]),events:Yr([oo((function(e,n){Ks.setValue(e,t.getInitialValue())}))])}},configFields:[Rr("uid"),Rr("dom"),Rr("getInitialValue"),pc("dataBehaviours",[Ks,ld])]}),gd=function(t){return t.dom.value},pd=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},hd=i([Pr("data"),Hr("inputAttributes",{}),Hr("inputStyles",{}),Hr("tag","input"),Hr("inputClasses",[]),ti("onSetValue"),Hr("styles",{}),Hr("eventOrder",{}),dc("inputBehaviours",[Ks,Ni]),Hr("selectOnFocus",!0)]),vd=function(e){return t(t({},function(t){return bo([Ni.config({onFocus:t.selectOnFocus?function(t){var e=t.element,n=gd(e);e.dom.setSelectionRange(0,n.length)}:r})])}(e)),gc(e.inputBehaviours,[Ks.config({store:t(t({mode:"manual"},e.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return gd(t.element)},setValue:function(t,e){gd(t.element)!==e&&pd(t.element,e)}}),onSetValue:e.onSetValue})]))},bd=function(e){return{tag:e.tag,attributes:t({type:"text"},e.inputAttributes),styles:e.inputStyles,classes:e.inputClasses}},yd=hs({name:"Input",configFields:hd(),factory:function(t,e){return{uid:t.uid,dom:bd(t),components:[],behaviours:vd(t),eventOrder:t.eventOrder}}}),xd=Object.freeze({__proto__:null,exhibit:function(t,e){return fo({attributes:nr([{key:e.tabAttr,value:"true"}])})}}),wd=[Hr("tabAttr","data-alloy-tabstop")],Cd=xo({fields:wd,name:"tabstopping",active:xd}),Sd=tinymce.util.Tools.resolve("tinymce.util.I18n"),kd=function(t,e){var n=Gl(yd.sketch({inputAttributes:{placeholder:Sd.translate(e)},onSetValue:function(t,e){re(t,Pt())},inputBehaviours:bo([ld.config({find:b.some}),Cd.config({}),lc.config({mode:"execution"})]),selectOnFocus:!1})),r=Gl(bs.sketch({dom:Cs('<button class="${prefix}-input-container-x ${prefix}-icon-cancel-circle ${prefix}-icon"></button>'),action:function(t){var e=n.get(t);Ks.setValue(e,"")}}));return{name:t,spec:dd.sketch({dom:Cs('<div class="${prefix}-input-container"></div>'),components:[n.asSpec(),r.asSpec()],containerBehaviours:bo([xi.config({toggleClass:Oi("input-container-empty")}),ld.config({find:function(t){return b.some(n.get(t))}}),cd("input-clearing",[Jr(Pt(),(function(t){var e=n.get(t);(Ks.getValue(e).length>0?xi.off:xi.on)(t)}))])])})}},Od=function(t){return{name:t,spec:md.sketch({dom:{tag:"span",styles:{display:"none"}},getInitialValue:function(){return b.none()}})}},_d=["input","button","textarea","select"],Ed=function(t,e,n){(e.disabled()?Rd:Md)(t,e)},Td=function(t,e){return!0===e.useNative&&N(_d,pe(t.element))},Ad=function(t){an(t.element,"disabled","disabled")},Bd=function(t){dn(t.element,"disabled")},Nd=function(t){an(t.element,"aria-disabled","true")},Dd=function(t){an(t.element,"aria-disabled","false")},Rd=function(t,e,n){e.disableClass.each((function(e){vn(t.element,e)})),(Td(t,e)?Ad:Nd)(t),e.onDisabled(t)},Md=function(t,e,n){e.disableClass.each((function(e){yn(t.element,e)})),(Td(t,e)?Bd:Dd)(t),e.onEnabled(t)},Id=function(t,e){return Td(t,e)?function(t){return ln(t.element,"disabled")}(t):function(t){return"true"===sn(t.element,"aria-disabled")}(t)},Pd=Object.freeze({__proto__:null,enable:Md,disable:Rd,isDisabled:Id,onLoad:Ed,set:function(t,e,n,r){(r?Rd:Md)(t,e)}}),Fd=Object.freeze({__proto__:null,exhibit:function(t,e){return fo({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,e){return Yr([Kr($t(),(function(e,n){return Id(e,t)})),lo(t,e,Ed)])}}),Ld=[(Yl="disabled",Kl=d,zr(Yl,Kl,Dr)),Hr("useNative",!0),Pr("disableClass"),ti("onDisabled"),ti("onEnabled")],Vd=xo({fields:Ld,name:"disabling",active:Fd,apis:Pd}),Hd="form",zd=[dc("formBehaviours",[Ks])],jd=function(t){return"<alloy.field."+t+">"},Ud=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:gc(t.formBehaviours,[Ks.config({store:{mode:"manual",getValue:function(e){var n=function(t,e){var n=t.getSystem();return Qe(e.partUids,(function(t,e){return i(n.getByUid(t))}))}(e,t);return Qe(n,(function(t,e){return t().bind((function(t){var n,r,o=ld.getCurrent(t);return n=o,r=new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+Ho(t.element)),n.fold((function(){return On.error(r)}),On.value)})).map(Ks.getValue)}))},setValue:function(e,n){Je(n,(function(n,r){Jc(e,t,r).each((function(t){ld.getCurrent(t).each((function(t){Ks.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return Jc(e,t,n).bind(ld.getCurrent)}}}},Wd=(rs((function(t,e,n){return t.getField(e,n)})),function(t){var e=function(){var t=[];return{field:function(e,n){return t.push(e),function(t,e,n){return{uiType:Oc(),owner:t,name:e,config:n,validated:{}}}(Hd,jd(e),n)},record:function(){return t}}}(),n=t(e),r=e.record(),o=R(r,(function(t){return jc({name:t,pname:jd(t)})}));return ds(Hd,zd,o,Ud,n)}),qd=function(){var t=ko(b.none()),e=function(){return t.get().each((function(t){return t.destroy()}))};return{clear:function(){e(),t.set(b.none())},isSet:function(){return t.get().isSome()},set:function(n){e(),t.set(b.some(n))},run:function(e){return t.get().each(e)}}},Gd=function(){var t=ko(b.none());return{clear:function(){return t.set(b.none())},set:function(e){return t.set(b.some(e))},isSet:function(){return t.get().isSome()},on:function(e){return t.get().each(e)}}},$d=function(t){var e="navigateEvent",n=hr([Rr("fields"),Hr("maxFieldIndex",t.fields.length-1),Rr("onExecute"),Rr("getInitialValue"),jr("state",(function(){return{dialogSwipeState:Gd(),currentScreen:ko(0)}}))]),r=Tr("SerialisedDialog",n,t),o=function(t,n,r){return bs.sketch({dom:Cs('<span class="${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:function(n){oe(n,e,{direction:t})},buttonBehaviours:bo([Vd.config({disableClass:Oi("toolbar-navigation-disabled"),disabled:function(){return!r}})])})},i=function(t,e){var n=$i(t.element,"."+Oi("serialised-dialog-screen"));Zi(t.element,"."+Oi("serialised-dialog-chain")).each((function(t){r.state.currentScreen.get()+e>=0&&r.state.currentScreen.get()+e<n.length&&(Li(t,"left").each((function(r){var o=parseInt(r,10),i=Zs(n[0]);Mi(t,"left",o-e*i+"px")})),r.state.currentScreen.set(r.state.currentScreen.get()+e))}))},u=function(t){var e=$i(t.element,"input");b.from(e[r.state.currentScreen.get()]).each((function(e){t.getSystem().getByDom(e).each((function(e){var n,r;n=t,r=e.element,n.getSystem().triggerFocus(r,n.element)}))}));var n=c.get(t);Ru.highlightAt(n,r.state.currentScreen.get())},a=Gl(Wd((function(t){return{dom:Cs('<div class="${prefix}-serialised-dialog"></div>'),components:[dd.sketch({dom:Cs('<div class="${prefix}-serialised-dialog-chain" style="left: 0px; position: absolute;"></div>'),components:R(r.fields,(function(e,n){return n<=r.maxFieldIndex?dd.sketch({dom:Cs('<div class="${prefix}-serialised-dialog-screen"></div>'),components:[o(-1,"previous",n>0),t.field(e.name,e.spec),o(1,"next",n<r.maxFieldIndex)]}):t.field(e.name,e.spec)}))})],formBehaviours:bo([Ci((function(t,e){!function(t,e){Zi(t.element,"."+Oi("serialised-dialog-chain")).each((function(t){Mi(t,"left",-r.state.currentScreen.get()*e.width+"px")}))}(t,e)})),lc.config({mode:"special",focusIn:function(t,e){u(t)},onTab:function(t,e){return i(t,1),b.some(!0)},onShiftTab:function(t,e){return i(t,-1),b.some(!0)}}),cd("form-events",[oo((function(t,e){r.state.currentScreen.set(0),r.state.dialogSwipeState.clear();var n=c.get(t);Ru.highlightFirst(n),r.getInitialValue(t).each((function(e){Ks.setValue(t,e)}))})),ao(r.onExecute),Jr(Vt(),(function(t,e){"left"===e.event.raw.propertyName&&u(t)})),Jr(e,(function(t,e){var n=e.event.direction;i(t,n)}))])])}}))),c=Gl({dom:Cs('<div class="${prefix}-dot-container"></div>'),behaviours:bo([Ru.config({highlightClass:Oi("dot-active"),itemClass:Oi("dot-item")})]),components:z(r.fields,(function(t,e){return e<=r.maxFieldIndex?[Ss('<div class="${prefix}-dot-item ${prefix}-icon-full-dot ${prefix}-icon"></div>')]:[]}))});return{dom:Cs('<div class="${prefix}-serializer-wrapper"></div>'),components:[a.asSpec(),c.asSpec()],behaviours:bo([lc.config({mode:"special",focusIn:function(t){var e=a.get(t);lc.focusIn(e)}}),cd("serializer-wrapper-events",[Jr(Et(),(function(t,e){var n=e.event;r.state.dialogSwipeState.set(function(t){return{xValue:t,points:[]}}(n.raw.touches[0].clientX))})),Jr(Tt(),(function(t,e){var n=e.event;r.state.dialogSwipeState.on((function(t){e.event.prevent(),r.state.dialogSwipeState.set(function(t,e){if(e===t.xValue)return t;var n=e-t.xValue>0?1:-1,r={direction:n,xValue:e};return{xValue:e,points:(0===t.points.length?[]:t.points[t.points.length-1].direction===n?t.points.slice(0,t.points.length-1):t.points).concat([r])}}(t,n.raw.touches[0].clientX))}))})),Jr(At(),(function(t,e){r.state.dialogSwipeState.on((function(e){var n=a.get(t),r=-1*function(t){if(0===t.points.length)return 0;var e=t.points[0].direction,n=t.points[t.points.length-1].direction;return-1===e&&-1===n?-1:1===e&&1===n?1:0}(e);i(n,r)}))}))])])}},Xd=g((function(t,e){return[{label:"the link group",items:[$d({fields:[kd("url","Type or paste URL"),kd("text","Link text"),kd("title","Link title"),kd("target","Link target"),Od("link")],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return b.some(nd(e))},onExecute:function(n,r){var o=Ks.getValue(n);od(e,o),t.restoreToolbar(),e.focus()}})]}]})),Yd=function(t,e){return Os(e,"link","link",(function(){var n=Xd(t,e);t.setContextToolbar(n),function(t,e){(ud.os.isAndroid()?ad:l)(e,t)}(e,(function(){t.focusToolbar()})),id(e).each((function(t){e.selection.select(t.dom)}))}))},Kd=Yr([function(t,e){return{key:t,value:$r({can:e})}}(Ut(),(function(t,e){var n=e.event,r=n.originator,o=n.target;return!function(t,e,n){return ge(e,t.element)&&!ge(e,n)}(t,r,o)||(console.warn(Ut()+" did not get interpreted by the desired target. \nOriginator: "+Ho(r)+"\nTarget: "+Ho(o)+"\nCheck the "+Ut()+" event handlers"),!1)}))]),Jd=Object.freeze({__proto__:null,events:Kd}),Qd=u,Zd=function(t){var e=function(e){return function(){throw new Error("The component must be in a context to send: "+e+(t?"\n"+Ho(t().element)+" is not in context.":""))}};return{debugInfo:i("fake"),triggerEvent:e("triggerEvent"),triggerFocus:e("triggerFocus"),triggerEscape:e("triggerEscape"),build:e("build"),addToWorld:e("addToWorld"),removeFromWorld:e("removeFromWorld"),addToGui:e("addToGui"),removeFromGui:e("removeFromGui"),getByUid:e("getByUid"),getByDom:e("getByDom"),broadcast:e("broadcast"),broadcastOn:e("broadcastOn"),broadcastEvent:e("broadcastEvent"),isConnected:d}},tm=Zd(),em=function(t,e){var n={};return Je(t,(function(t,r){Je(t,(function(t,o){var i=nn(n,o).getOr([]);n[o]=i.concat([e(r,t)])}))})),n},nm=function(t,e,n,r){try{var o=(i=n,u=function(n,o){var i=n[e],u=o[e],a=r.indexOf(i),c=r.indexOf(u);if(-1===a)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===c)throw new Error("The ordering for "+t+" does not have an entry for "+u+".\nOrder specified: "+JSON.stringify(r,null,2));return a<c?-1:c<a?1:0},(a=T.call(i,0)).sort(u),a);return On.value(o)}catch(t){return On.error([t])}var i,u,a},rm=function(t){return t.cHandler},om=function(t,e){return{name:t,handler:e}},im=function(e,n,r){var o=t(t({},r),function(t,e){var n={};return M(t,(function(t){n[t.name()]=t.handlers(e)})),n}(n,e));return em(o,om)},um=function(t){var e=function(t){return _(t)?{can:i(!0),abort:i(!1),run:t}:t}(t);return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[t,n].concat(r);e.abort.apply(void 0,i)?n.stop():e.can.apply(void 0,i)&&e.run.apply(void 0,i)}},am=function(t,e,n){var r=e[n];return r?nm("Event: "+n,"name",t,r).map((function(t){var e=R(t,(function(t){return t.handler}));return Xr(e)})):function(t,e){return On.error(["The event ("+t+') 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(R(e,(function(t){return t.name})),null,2)])}(n,t)},cm=function(t,e){var n=en(t,(function(t,n){return(1===t.length?On.value(t[0].handler):am(t,e,n)).map((function(r){var o=um(r),i=t.length>1?I(e[n],(function(e){return D(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return er(n,function(t,e){return{handler:t,purpose:e}}(o,i))}))}));return rr(n,{})},sm="alloy.base.behaviour",fm=function(t){return t.events},lm=function(t,e){M(e,(function(e){vn(t,e)}))},dm=function(t,e){M(e,(function(e){yn(t,e)}))},mm=function(t,e){return function(t,e){var n=R(e,(function(t){return Lr(t.name(),[Rr("config"),Hr("state",ho)])})),r=_r("component.behaviours",hr(n),t.behaviours).fold((function(e){throw new Error(Ar(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))}),(function(t){return t}));return{list:e,data:Qe(r,(function(t){var e=t.map((function(t){return{config:t.config,state:t.state.init(t.config)}}));return function(){return e}}))}}(t,e)},gm=function(t){var e=function(t){var e=nn(t,"behaviours").getOr({}),n=I(Ye(e),(function(t){return void 0!==e[t]}));return R(n,(function(t){return e[t].me}))}(t);return mm(t,e)},pm=function(e,n,r){var o,i,u,a=t(t({},(o=e).dom),{uid:o.uid,domChildren:R(o.components,(function(t){return t.element}))}),c=function(t){return t.domModification.fold((function(){return fo({})}),fo)}(e),s={"alloy.base.modification":c},f=n.length>0?function(e,n,r,o){var i=t({},n);M(r,(function(t){i[t.name()]=t.exhibit(e,o)}));var u=em(i,(function(t,e){return{name:t,modification:e}})),a=function(e){return P(e,(function(e,n){return t(t({},n.modification),e)}),{})},c=P(u.classes,(function(t,e){return e.modification.concat(t)}),[]),s=a(u.attributes),f=a(u.styles);return fo({classes:c,attributes:s,styles:f})}(r,s,n,a):c;return u=f,t(t({},i=a),{attributes:t(t({},i.attributes),u.attributes),styles:t(t({},i.styles),u.styles),classes:i.classes.concat(u.classes)})},hm=function(t,e,n){var r={"alloy.base.behaviour":fm(t)};return function(t,e,n,r){var o=im(t,n,r);return cm(o,e)}(n,t.eventOrder,e,r).getOrDie()},vm=function(t){var e=function(){return f},n=ko(tm),r=Er(function(t){var e;return _r("custom.definition",hr([xr("dom","dom",Yn(),hr([Rr("tag"),Hr("styles",{}),Hr("classes",[]),Hr("attributes",{}),Pr("value"),Pr("innerHtml")])),Rr("components"),Rr("uid"),Hr("events",{}),Hr("apis",{}),xr("eventOrder","eventOrder",Xn((e={},e[$t()]=["disabling",sm,"toggling","typeaheadevents"],e[Ut()]=[sm,"focusing","keying"],e[Jt()]=[sm,"disabling","toggling","representing"],e[Pt()]=[sm,"representing","streaming","invalidating"],e[Zt()]=[sm,"representing","item-events","tooltipping"],e[Bt()]=["focusing",sm,"item-type-events"],e[Et()]=["focusing",sm,"item-type-events"],e[Rt()]=["item-type-events","tooltipping"],e[Gt()]=["receiving","reflecting","tooltipping"],e)),Nr()),Pr("domModification")]),t)}(t)),o=gm(t),i=function(t){return t.list}(o),u=function(t){return t.data}(o),a=function(t){var e=se.fromTag(t.tag);cn(e,t.attributes),lm(e,t.classes),Ii(e,t.styles),t.innerHtml.each((function(t){return Fo(e,t)}));var n=t.domChildren;return Be(e,n),t.value.each((function(t){pd(e,t)})),t.uid,cs(e,t.uid),e}(pm(r,i,u)),c=hm(r,i,u),s=ko(r.components),f={getSystem:n.get,config:function(e){var n=u;return(_(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(t){return _(u[t.name()])},spec:t,readState:function(t){return u[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},getApis:function(){return r.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(Zd(e))},element:a,syncComponents:function(){var t=ke(a),e=z(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),(function(t){return[t]}))}));s.set(e)},components:s.get,events:c};return f},bm=function(n){var r=Qd(n),o=r.events,i=e(r,["events"]),u=function(t){var e=nn(t,"components").getOr([]);return R(e,Cm)}(i),a=t(t({},i),{events:t(t({},Jd),o),components:u});return On.value(vm(a))},ym=function(t){var e=se.fromText(t);return xm({element:e})},xm=function(t){var e=Tr("external.component",pr([Rr("element"),Pr("uid")]),t),n=ko(Zd());e.uid.each((function(t){cs(e.element,t)}));var o={getSystem:n.get,config:b.none,hasConfigured:d,connect:function(t){n.set(t)},disconnect:function(){n.set(Zd((function(){return o})))},getApis:function(){return{}},element:e.element,spec:t,readState:i("No state"),syncComponents:r,components:i([]),events:{}};return ns(o)},wm=fs,Cm=function(e){return function(t){return nn(t,es)}(e).fold((function(){var n=e.hasOwnProperty("uid")?e:t({uid:wm("")},e);return bm(n).getOrDie()}),(function(t){return t}))},Sm=ns,km="alloy.item-hover",Om="alloy.item-focus",_m=function(t){(To(t.element).isNone()||Ni.isFocused(t))&&(Ni.isFocused(t)||Ni.focus(t),oe(t,km,{item:t}))},Em=function(t){oe(t,Om,{item:t})},Tm=i(km),Am=i(Om),Bm=[Rr("data"),Rr("components"),Rr("dom"),Hr("hasSubmenu",!1),Pr("toggling"),pc("itemBehaviours",[xi,Ni,lc,Ks]),Hr("ignoreFocus",!1),Hr("domModification",{}),oi("builder",(function(e){return{dom:e.dom,domModification:t(t({},e.domModification),{attributes:t(t(t({role:e.toggling.isSome()?"menuitemcheckbox":"menuitem"},e.domModification.attributes),{"aria-haspopup":e.hasSubmenu}),e.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:hc(e.itemBehaviours,[e.toggling.fold(xi.revoke,(function(e){return xi.config(t({aria:{mode:"checked"}},e))})),Ni.config({ignore:e.ignoreFocus,stopMousedown:e.ignoreFocus,onFocus:function(t){Em(t)}}),lc.config({mode:"execution"}),Ks.config({store:{mode:"memory",initialValue:e.data}}),cd("item-type-events",n(_i(),[Jr(Rt(),_m),Jr(Xt(),Ni.focus)]))]),components:e.components,eventOrder:e.eventOrder}})),Hr("eventOrder",{})],Nm=[Rr("dom"),Rr("components"),oi("builder",(function(t){return{dom:t.dom,components:t.components,events:Yr([no(Xt())])}}))],Dm=i([jc({name:"widget",overrides:function(t){return{behaviours:bo([Ks.config({store:{mode:"manual",getValue:function(e){return t.data},setValue:function(){}}})])}}})]),Rm=[Rr("uid"),Rr("data"),Rr("components"),Rr("dom"),Hr("autofocus",!1),Hr("ignoreFocus",!1),pc("widgetBehaviours",[Ks,Ni,lc]),Hr("domModification",{}),ts(Dm()),oi("builder",(function(t){var e=Yc(0,t,Dm()),n=Kc("item-widget",t,e.internals()),r=function(e){return Jc(e,t,"widget").map((function(t){return lc.focusIn(t),t}))},o=function(e,n){return zu(n.event.target)?b.none():t.autofocus?(n.setSource(e.element),b.none()):b.none()};return{dom:t.dom,components:n,domModification:t.domModification,events:Yr([ao((function(t,e){r(t).each((function(t){e.stop()}))})),Jr(Rt(),_m),Jr(Xt(),(function(e,n){t.autofocus?r(e):Ni.focus(e)}))]),behaviours:hc(t.widgetBehaviours,[Ks.config({store:{mode:"memory",initialValue:t.data}}),Ni.config({ignore:t.ignoreFocus,onFocus:function(t){Em(t)}}),lc.config({mode:"special",focusIn:t.autofocus?function(t){r(t)}:Co(),onLeft:o,onRight:o,onEscape:function(e,n){return Ni.isFocused(e)||t.autofocus?t.autofocus?(n.setSource(e.element),b.none()):b.none():(Ni.focus(e),b.some(!0))}})])}}))],Mm=Br("type",{widget:Rm,item:Bm,separator:Nm}),Im=i([Wc({factory:{sketch:function(t){var e=Tr("menu.spec item",Mm,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(e,n){return n.hasOwnProperty("uid")?n:t(t({},n),{uid:fs("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),Pm=i([Rr("value"),Rr("items"),Rr("dom"),Rr("components"),Hr("eventOrder",{}),dc("menuBehaviours",[Ru,Ks,ld,lc]),zr("movement",{mode:"menu",moveOnTab:!0},Br("mode",{grid:[ui(),oi("config",(function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}}))],matrix:[oi("config",(function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}})),Rr("rowSelector")],menu:[Hr("moveOnTab",!0),oi("config",(function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}}))]})),Mr("markers",Jo()),Hr("fakeFocus",!1),Hr("focusManager",Iu()),ti("onHighlight")]),Fm=i("alloy.menu-focus"),Lm=vs({name:"Menu",configFields:Pm(),partFields:Im(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:gc(t.menuBehaviours,[Ru.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),Ks.config({store:{mode:"memory",initialValue:t.value}}),ld.config({find:b.some}),lc.config(t.movement.config(t,t.movement))]),events:Yr([Jr(Am(),(function(t,e){var n=e.event;t.getSystem().getByDom(n.target).each((function(n){Ru.highlight(t,n),e.stop(),oe(t,Fm(),{menu:t,item:n})}))})),Jr(Tm(),(function(t,e){var n=e.event.item;Ru.highlight(t,n)}))]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Vm=function(t,e){var n=Ie(e),o=Eo(n).bind((function(t){var n,r,o=function(e){return ge(t,e)};return o(e)?b.some(e):(n=o,(r=function(t){for(var e=0;e<t.childNodes.length;e++){var o=se.fromDom(t.childNodes[e]);if(n(o))return b.some(o);var i=r(t.childNodes[e]);if(i.isSome())return i}return b.none()})(e.dom))})),i=t(e);return o.each((function(t){Eo(n).filter((function(e){return ge(e,t)})).fold((function(){Oo(t)}),r)})),i},Hm=function(t,e,n,r){var o=t.getSystem().build(r);Ge(t,o,n)},zm=function(t,e,n,r){var o=jm(t);L(o,(function(t){return ge(r.element,t.element)})).each($e)},jm=function(t,e){return t.components()},Um=function(t,e,n,r,o){var i=jm(t);return b.from(i[r]).map((function(e){return zm(t,0,0,e),o.each((function(e){Hm(t,0,(function(t,e){!function(t,e,n){Oe(t,n).fold((function(){Ae(t,e)}),(function(t){_e(t,e)}))}(t,e,r)}),e)})),e}))},Wm=xo({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(t,e,n,r){Hm(t,0,Ae,r)},prepend:function(t,e,n,r){Hm(t,0,Te,r)},remove:zm,replaceAt:Um,replaceBy:function(t,e,n,r,o){var i=jm(t);return V(i,r).bind((function(e){return Um(t,0,0,e,o)}))},set:function(t,e,n,r){Vm((function(){var e=R(r,t.getSystem().build);qe(t,e)}),t.element)},contents:jm})}),qm=function(t,e,n,r){return nn(n,r).bind((function(r){return nn(t,r).bind((function(r){var o=qm(t,e,n,r);return b.some([r].concat(o))}))})).getOr([])},Gm=function(t,e){var n={};Je(t,(function(t,e){M(t,(function(t){n[t]=e}))}));var r=e,o=Ze(e,(function(t,e){return{k:t,v:e}})),i=Qe(o,(function(t,e){return[e].concat(qm(n,r,o,e))}));return Qe(n,(function(t){return nn(i,t).getOr([t])}))},$m=function(t){return"prepared"===t.type?b.some(t.menu):b.none()},Xm={init:function(){var e=ko({}),n=ko({}),r=ko({}),o=ko(b.none()),i=ko({}),u=function(t){return function(t,e){for(var n=Ye(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];if(e(u,i,t))return b.some(u)}return b.none()}(e.get(),(function(e,n){return e===t}))},a=function(t){return c(t).bind($m)},c=function(t){return nn(n.get(),t)},s=function(t){return nn(e.get(),t)};return{setMenuBuilt:function(e,r){var o;n.set(t(t({},n.get()),((o={})[e]={type:"prepared",menu:r},o)))},setContents:function(t,u,a,c){o.set(b.some(t)),e.set(a),n.set(u),i.set(c);var s=Gm(c,a);r.set(s)},expand:function(t){return nn(e.get(),t).map((function(e){var n=nn(r.get(),t).getOr([]);return[e].concat(n)}))},refresh:function(t){return nn(r.get(),t)},collapse:function(t){return nn(r.get(),t).bind((function(t){return t.length>1?b.some(t.slice(1)):b.none()}))},lookupMenu:c,lookupItem:s,otherMenus:function(t){var e=i.get();return W(Ye(e),t)},getPrimary:function(){return o.get().bind(a)},getMenus:function(){return n.get()},clear:function(){e.set({}),n.set({}),r.set({}),o.set(b.none())},isClear:function(){return o.get().isNone()},getTriggeringPath:function(t,e){var n=I(s(t).toArray(),(function(t){return a(t).isSome()}));return nn(r.get(),t).bind((function(t){var r=U(n.concat(t));return function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r.isSome())return b.none();e.push(r.getOrDie())}return b.some(e)}(z(r,(function(t,n){return function(t,e,n){return a(t).bind((function(r){return u(t).bind((function(t){return e(t).map((function(t){return{triggeredMenu:r,triggeringItem:t,triggeringPath:n}}))}))}))}(t,e,r.slice(0,n+1)).fold((function(){return o.get().is(t)?[]:[b.none()]}),(function(t){return[b.some(t)]}))})))}))}}},extractPreparedMenu:$m},Ym=i("collapse-item"),Km=hs({name:"TieredMenu",configFields:[ri("onExecute"),ri("onEscape"),ni("onOpenMenu"),ni("onOpenSubmenu"),ti("onRepositionMenu"),ti("onCollapseMenu"),Hr("highlightImmediately",!0),Ir("data",[Rr("primary"),Rr("menus"),Rr("expansions")]),Hr("fakeFocus",!1),ti("onHighlight"),ti("onHover"),Ir("markers",[Rr("backgroundMenu")].concat(Yo()).concat(Ko())),Rr("dom"),Hr("navigateOnHover",!0),Hr("stayInDom",!1),dc("tmenuBehaviours",[lc,Ru,ld,Wm]),Hr("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:function(e,n){var r,o=ko(b.none()),i=Xm.init(),u=function(n){var r=function(n,r,o){return Qe(o,(function(o,i){var u=function(){return Lm.sketch(t(t({},o),{value:i,markers:e.markers,fakeFocus:e.fakeFocus,onHighlight:e.onHighlight,focusManager:e.fakeFocus?Pu():Iu()}))};return i===r?{type:"prepared",menu:n.getSystem().build(u())}:{type:"notbuilt",nbMenu:u}}))}(n,e.data.primary,e.data.menus),o=c();return i.setContents(e.data.primary,r,e.data.expansions,o),i.getPrimary()},a=function(t){return Ks.getValue(t).value},c=function(t){return Qe(e.data.menus,(function(t,e){return z(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},s=function(t,e){Ru.highlight(t,e),Ru.getHighlighted(e).orThunk((function(){return Ru.getFirst(e)})).each((function(e){ue(t,e.element,Xt())}))},f=function(t,e){return Cu(R(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?b.some(t.menu):b.none()}))})))},l=function(t,n,r){var o=f(n,n.otherMenus(r));M(o,(function(n){dm(n.element,[e.markers.backgroundMenu]),e.stayInDom||Wm.remove(t,n)}))},d=function(t,n){var r=function(t){return o.get().getOrThunk((function(){var n={},r=$i(t.element,"."+e.markers.item),i=I(r,(function(t){return"true"===sn(t,"aria-haspopup")}));return M(i,(function(e){t.getSystem().getByDom(e).each((function(t){var e=a(t);n[e]=t}))})),o.set(b.some(n)),n}))}(t);Je(r,(function(t,e){var r=N(n,e);an(t.element,"aria-expanded",r)}))},m=function(t,n,r){return b.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return b.none();var i=o.menu,u=f(n,r.slice(1));return M(u,(function(t){vn(t.element,e.markers.backgroundMenu)})),Ve(i.element)||Wm.append(t,Sm(i)),dm(i.element,[e.markers.backgroundMenu]),s(t,i),l(t,n,r),b.some(i)}))}))};!function(t){t[t.HighlightSubmenu=0]="HighlightSubmenu",t[t.HighlightParent=1]="HighlightParent"}(r||(r={}));var g=function(t,n,o){void 0===o&&(o=r.HighlightSubmenu);var u=a(n);return i.expand(u).bind((function(u){return d(t,u),b.from(u[0]).bind((function(a){return i.lookupMenu(a).bind((function(c){var s=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return i.setMenuBuilt(e,r),r}return n.menu}(t,a,c);return Ve(s.element)||Wm.append(t,Sm(s)),e.onOpenSubmenu(t,n,s,U(u)),o===r.HighlightSubmenu?(Ru.highlightFirst(s),m(t,i,u)):(Ru.dehighlightAll(s),b.some(n))}))}))}))},p=function(t,n){var r=a(n);return i.collapse(r).bind((function(r){return d(t,r),m(t,i,r).map((function(r){return e.onCollapseMenu(t,n,r),r}))}))},h=function(t){return function(n,r){return tu(r.getSource(),"."+e.markers.item).bind((function(e){return n.getSystem().getByDom(e).toOptional().bind((function(e){return t(n,e).map((function(){return!0}))}))}))}},v=Yr([Jr(Fm(),(function(t,e){var n=e.event.item;i.lookupItem(a(n)).each((function(){var n=e.event.menu;Ru.highlight(t,n);var r=a(e.event.item);i.refresh(r).each((function(e){return l(t,i,e)}))}))})),ao((function(t,n){var o=n.event.target;t.getSystem().getByDom(o).each((function(n){0===a(n).indexOf("collapse-item")&&p(t,n),g(t,n,r.HighlightSubmenu).fold((function(){e.onExecute(t,n)}),(function(){}))}))})),oo((function(t,n){u(t).each((function(n){Wm.append(t,Sm(n)),e.onOpenMenu(t,n),e.highlightImmediately&&s(t,n)}))}))].concat(e.navigateOnHover?[Jr(Tm(),(function(t,n){var o=n.event.item;!function(t,e){var n=a(e);i.refresh(n).bind((function(e){return d(t,e),m(t,i,e)}))}(t,o),g(t,o,r.HighlightParent),e.onHover(t,o)}))]:[])),y=function(t){return Ru.getHighlighted(t).bind(Ru.getHighlighted)},x={collapseMenu:function(t){y(t).each((function(e){p(t,e)}))},highlightPrimary:function(t){i.getPrimary().each((function(e){s(t,e)}))},repositionMenus:function(t){i.getPrimary().bind((function(e){return y(t).bind((function(t){var e,n=a(t),r=(e=i.getMenus(),en(e,(function(t){return t}))),o=Cu(R(r,Xm.extractPreparedMenu));return i.getTriggeringPath(n,(function(t){return function(t,e,n){return $(e,(function(t){if(!t.getSystem().isConnected())return b.none();var e=Ru.getCandidates(t);return L(e,(function(t){return a(t)===n}))}))}(0,o,t)}))})).map((function(t){return{primary:e,triggeringPath:t}}))})).fold((function(){(function(t){return b.from(t.components()[0]).filter((function(t){return"menu"===sn(t.element,"role")}))})(t).each((function(n){e.onRepositionMenu(t,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;e.onRepositionMenu(t,r,o)}))}};return{uid:e.uid,dom:e.dom,markers:e.markers,behaviours:gc(e.tmenuBehaviours,[lc.config({mode:"special",onRight:h((function(t,e){return zu(e.element)?b.none():g(t,e,r.HighlightSubmenu)})),onLeft:h((function(t,e){return zu(e.element)?b.none():p(t,e)})),onEscape:h((function(t,n){return p(t,n).orThunk((function(){return e.onEscape(t,n).map((function(){return t}))}))})),focusIn:function(t,e){i.getPrimary().each((function(e){ue(t,e.element,Xt())}))}}),Ru.config({highlightClass:e.markers.selectedMenu,itemClass:e.markers.menu}),ld.config({find:function(t){return Ru.getHighlighted(t)}}),Wm.config({})]),eventOrder:e.eventOrder,apis:x,events:v}},extraApis:{tieredData:function(t,e,n){return{primary:t,menus:e,expansions:n}},singleData:function(t,e){return{primary:t,menus:er(t,e),expansions:{}}},collapseItem:function(t){return{value:Ec(Ym()),meta:{text:t}}}}}),Jm=function(t,e,n,r){return nn(e.routes,r.start).bind((function(t){return nn(t,r.destination)}))},Qm=function(t,e,n,r){return Jm(0,e,0,r).bind((function(t){return t.transition.map((function(e){return{transition:e,route:t}}))}))},Zm=function(t,e,n){(function(t,e,n){return tg(t,e).bind((function(r){return Qm(t,e,n,r)}))})(t,e,n).each((function(n){var r=n.transition;yn(t.element,r.transitionClass),dn(t.element,e.destinationAttr)}))},tg=function(t,e,n){var r=t.element;return fn(r,e.destinationAttr).map((function(n){return{start:sn(t.element,e.stateAttr),destination:n}}))},eg=function(t,e,n,r){Zm(t,e,n),ln(t.element,e.stateAttr)&&sn(t.element,e.stateAttr)!==r&&e.onFinish(t,r),an(t.element,e.stateAttr,r)},ng=Object.freeze({__proto__:null,findRoute:Jm,disableTransition:Zm,getCurrentRoute:tg,jumpTo:eg,progressTo:function(t,e,n,r){!function(t,e,n,r){ln(t.element,e.destinationAttr)&&(fn(t.element,e.destinationAttr).each((function(n){an(t.element,e.stateAttr,n)})),dn(t.element,e.destinationAttr))}(t,e);var o=function(t,e,n,r){return{start:sn(t.element,e.stateAttr),destination:r}}(t,e,0,r);Qm(t,e,n,o).fold((function(){eg(t,e,n,r)}),(function(o){Zm(t,e,n);var i=o.transition;vn(t.element,i.transitionClass),an(t.element,e.destinationAttr,r)}))},getState:function(t,e,n){return fn(t.element,e.stateAttr)}}),rg=Object.freeze({__proto__:null,events:function(t,e){return Yr([Jr(Vt(),(function(n,r){var o=r.event.raw;tg(n,t).each((function(r){Jm(0,t,0,r).each((function(i){i.transition.each((function(i){o.propertyName===i.property&&(eg(n,t,e,r.destination),t.onTransition(n,r))}))}))}))})),oo((function(n,r){eg(n,t,e,t.initialState)}))])}}),og=[Hr("destinationAttr","data-transitioning-destination"),Hr("stateAttr","data-transitioning-state"),Rr("initialState"),ti("onTransition"),ti("onFinish"),Mr("routes",Or(On.value,Or(On.value,pr([Vr("transition",[Rr("property"),Rr("transitionClass")])]))))],ig=xo({fields:og,name:"transitioning",active:rg,apis:ng,extra:{createRoutes:function(t){var e={};return Je(t,(function(t,n){var r=n.split("<->");e[r[0]]=er(r[1],t),e[r[1]]=er(r[0],t)})),e},createBistate:function(t,e,n){return nr([{key:t,value:er(e,n)},{key:e,value:er(t,n)}])},createTristate:function(t,e,n,r){return nr([{key:t,value:nr([{key:e,value:r},{key:n,value:r}])},{key:e,value:nr([{key:t,value:r},{key:n,value:r}])},{key:n,value:nr([{key:t,value:r},{key:e,value:r}])}])}}}),ug=Oi("scrollable"),ag=function(t){vn(t,ug)},cg=function(t){yn(t,ug)},sg=ug,fg=function(t){return nn(t,"format").getOr(t.title)},lg=function(t,e,n,r,o){return{data:{value:t,text:e},type:"item",dom:{tag:"div",classes:o?[Oi("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:Oi("format-matches"),selected:n},itemBehaviours:bo(o?[]:[wi(t,(function(t,e){(e?xi.on:xi.off)(t)}))]),components:[{dom:{tag:"div",attributes:{style:r},innerHtml:e}}]}},dg=function(t,e,n,r){return{value:t,dom:{tag:"div"},components:[bs.sketch({dom:{tag:"div",classes:[Oi("styles-collapser")]},components:r?[{dom:{tag:"span",classes:[Oi("styles-collapse-icon")]}},ym(t)]:[ym(t)],action:function(t){if(r){var e=n().get(t);Km.collapseMenu(e)}}}),{dom:{tag:"div",classes:[Oi("styles-menu-items-container")]},components:[Lm.parts.items({})],behaviours:bo([cd("adhoc-scrollable-menu",[oo((function(t,e){Mi(t.element,"overflow-y","auto"),Mi(t.element,"-webkit-overflow-scrolling","touch"),ag(t.element)})),io((function(t){Vi(t.element,"overflow-y"),Vi(t.element,"-webkit-overflow-scrolling"),cg(t.element)}))])])}],items:e,menuBehaviours:bo([ig.config({initialState:"after",routes:ig.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},mg=function(t){var e,n,r,o,i,u=(e=t.formats,n=function(){return a},r=dg("Styles",[].concat(R(e.items,(function(t){return lg(fg(t),t.title,t.isSelected(),t.getPreview(),on(e.expansions,fg(t)))}))),n,!1),o=Qe(e.menus,(function(t,r){var o=R(t,(function(t){return lg(fg(t),t.title,void 0!==t.isSelected&&t.isSelected(),void 0!==t.getPreview?t.getPreview():"",on(e.expansions,fg(t)))}));return dg(r,o,n,!0)})),i=Wn(o,er("styles",r)),{tmenu:Km.tieredData("styles",i,e.expansions)}),a=Gl(Km.sketch({dom:{tag:"div",classes:[Oi("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(e,n){var r=Ks.getValue(n);return t.handle(n,r.value),b.none()},onEscape:function(){return b.none()},onOpenMenu:function(t,e){var n=Zs(t.element);Qs(e.element,n),ig.jumpTo(e,"current")},onOpenSubmenu:function(t,e,n){var r=Zs(t.element),o=Qi(e.element,'[role="menu"]').getOrDie("hacky"),i=t.getSystem().getByDom(o).getOrDie();Qs(n.element,r),ig.progressTo(i,"before"),ig.jumpTo(n,"after"),ig.progressTo(n,"current")},onCollapseMenu:function(t,e,n){var r=Qi(e.element,'[role="menu"]').getOrDie("hacky"),o=t.getSystem().getByDom(r).getOrDie();ig.progressTo(o,"after"),ig.progressTo(n,"current")},navigateOnHover:!1,highlightImmediately:!0,data:u.tmenu,markers:{backgroundMenu:Oi("styles-background-menu"),menu:Oi("styles-menu"),selectedMenu:Oi("styles-selected-menu"),item:Oi("styles-item"),selectedItem:Oi("styles-selected-item")}}));return a.asSpec()},gg=function(t){return on(t,"items")?function(t){var e=Wn(tr(t,["items"]),{menu:!0}),n=pg(t.items);return{item:e,menus:Wn(n.menus,er(t.title,n.items)),expansions:Wn(n.expansions,er(t.title,t.title))}}(t):{item:t,menus:{},expansions:{}}},pg=function(t){return P(t,(function(t,e){var n=gg(e);return{menus:Wn(t.menus,n.menus),items:[n.item].concat(t.items),expansions:Wn(t.expansions,n.expansions)}}),{menus:{},expansions:{},items:[]})},hg=function(t){var e=function(e){return function(){return t.formatter.match(e)}},n=function(e){return function(){return t.formatter.getCssText(e)}},r=function(o){return R(o,(function(o){if(on(o,"items")){var u=r(o.items);return Wn(function(t){return Wn(t,{isSelected:d,getPreview:i("")})}(o),{items:u})}return on(o,"format")?function(t){return Wn(t,{isSelected:e(t.format),getPreview:n(t.format)})}(o):function(r){var o=Ec(r.title),i=Wn(r,{format:o,isSelected:e(o),getPreview:n(o)});return t.formatter.register(o,i),i}(o)}))};return r(function(t){return t.getParam("style_formats",No,"array")}(t))},vg=function(t,e,n){var r=function(t,e){var n=function(e){return z(e,(function(e){return void 0!==e.items?n(e.items).length>0?[e]:[]:!on(e,"format")||t.formatter.canApply(e.format)?[e]:[]}))},r=n(e);return pg(r)}(t,e);return mg({formats:r,handle:function(e,r){t.undoManager.transact((function(){xi.isOn(e)?t.formatter.remove(r):t.formatter.apply(r)})),n()}})},bg=function(t){var e=t.replace(/\|/g," ").trim();return e.length>0?e.split(/\s+/):[]},yg=function(t){return z(t,(function(t){return S(t)?yg(t):bg(t)}))},xg=function(t){var e=function(t){return t.getParam("toolbar",Do,"array")}(t);return S(e)?yg(e):bg(e)},wg=function(t,e){var n=function(t){return function(){return function(t,e){return Es(e,(function(){t.execCommand(e)}),{},t)}(e,t)}},r=function(t){return function(){return function(t,e){var n=ks(e);return Es(e,(function(){t.execCommand(e)}),n,t)}(e,t)}},o=function(t,n,r){return function(){return Os(e,t,n,r)}},i=n("undo"),u=n("redo"),a=r("bold"),c=r("italic"),s=r("underline"),f=n("removeformat"),l=o("unlink","link",(function(){e.execCommand("unlink",null,!1)})),d=o("unordered-list","ul",(function(){e.execCommand("InsertUnorderedList",null,!1)})),m=o("ordered-list","ol",(function(){e.execCommand("InsertOrderedList",null,!1)})),g=hg(e),p=function(){return vg(e,g,(function(){e.fire("scrollIntoView")}))},h=function(t,n){return{isSupported:function(){var n=e.ui.registry.getAll().buttons;return t.forall((function(t){return on(n,t)}))},sketch:n}};return{undo:h(b.none(),i),redo:h(b.none(),u),bold:h(b.none(),a),italic:h(b.none(),c),underline:h(b.none(),s),removeformat:h(b.none(),f),link:h(b.none(),(function(){return Yd(t,e)})),unlink:h(b.none(),l),image:h(b.none(),(function(){return Ql(e)})),bullist:h(b.some("bullist"),d),numlist:h(b.some("numlist"),m),fontsizeselect:h(b.none(),(function(){return function(t,e){var n={onChange:function(t){Vl(e,t)},getInitialValue:function(){return Ll(e)}};return Dl(t,"font-size",(function(){return ql(n)}),e)}(t,e)})),forecolor:h(b.none(),(function(){return Ml(t,e)})),styleselect:h(b.none(),(function(){return Es("style-formats",(function(n){e.fire("toReading"),t.dropup.appear(p,xi.on,n)}),bo([xi.config({toggleClass:Oi("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),ci.config({channels:nr([Si(Mo,xi.off),Si(Io,xi.off)])})]),e)}))}},Cg=function(t){var e=se.fromDom(function(t){if(Me()&&O(t.target)){var e=se.fromDom(t.target);if(ve(e)&&Le(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return G(n)}}return b.from(t.target)}(t).getOr(t.target)),n=function(){return t.stopPropagation()},r=function(){return t.preventDefault()},i=o(r,n);return function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}}(e,t.clientX,t.clientY,n,r,i,t)},Sg=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(Cg(n))}}(n,r);return t.dom.addEventListener(e,i,o),{unbind:a(kg,t,e,i,o)}},kg=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Og=m,_g=function(t,e,n){return function(t,e,n,r){return Sg(t,e,n,r,!1)}(t,e,Og,n)},Eg=function(t,e,n){return function(t,e,n,r){return Sg(t,e,n,r,!0)}(t,e,Og,n)},Tg=tinymce.util.Tools.resolve("tinymce.util.Delay"),Ag=function(t){var e=t.matchMedia("(orientation: portrait)").matches;return{isPortrait:i(e)}},Bg=function(t){var e=Ot().os.isiOS(),n=Ag(t).isPortrait();return e&&!n?t.screen.height:t.screen.width},Ng=function(t,e){var n=se.fromDom(t),r=null,o=_g(n,"orientationchange",(function(){Tg.clearInterval(r);var n=Ag(t);e.onChange(n),i((function(){e.onReady(n)}))})),i=function(e){Tg.clearInterval(r);var n=t.innerHeight,o=0;r=Tg.setInterval((function(){n!==t.innerHeight?(Tg.clearInterval(r),e(b.some(t.innerHeight))):o>20&&(Tg.clearInterval(r),e(b.none())),o++}),50)};return{onAdjustment:i,destroy:function(){o.unbind()}}},Dg=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},Rg=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Mg=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},Ig=zn([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Pg=function(t,e,n){return e(se.fromDom(n.startContainer),n.startOffset,se.fromDom(n.endContainer),n.endOffset)},Fg=function(t,e){return function(t,e){var n=e.ltr();return n.collapsed?e.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return Ig.rtl(se.fromDom(t.endContainer),t.endOffset,se.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Pg(0,Ig.ltr,n)})):Pg(0,Ig.ltr,n)}(0,function(t,e){return e.match({domRange:function(t){return{ltr:i(t),rtl:b.none}},relative:function(e,n){return{ltr:g((function(){return Dg(t,e,n)})),rtl:g((function(){return b.some(Dg(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:g((function(){return Rg(t,e,n,r,o)})),rtl:g((function(){return b.some(Rg(t,r,o,e,n))}))}}})}(t,e))},Lg=(Ig.ltr,Ig.rtl,function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}});var Vg=function(t,e){var n=function(e){return t(e)?b.from(e.dom.nodeValue):b.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(be,"text"),Hg=function(t){return"img"===pe(t)?1:function(t){return Vg.getOption(t)}(t).fold((function(){return ke(t).length}),(function(t){return t.length}))},zg=zn([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),jg={before:zg.before,on:zg.on,after:zg.after,cata:function(t,e,n,r){return t.fold(e,n,r)},getStart:function(t){return t.fold(u,u,u)}},Ug=zn([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Wg={domRange:Ug.domRange,relative:Ug.relative,exact:Ug.exact,exactFromRange:function(t){return Ug.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){return function(t){return se.fromDom(Ce(t).dom.defaultView)}(function(t){return t.match({domRange:function(t){return se.fromDom(t.startContainer)},relative:function(t,e){return jg.getStart(t)},exact:function(t,e,n,r){return t}})}(t))},range:Lg},qg=function(t,e){var n=pe(t);return"input"===n?jg.after(t):N(["br","img"],n)?0===e?jg.before(t):jg.after(t):jg.on(t,e)},Gg=function(t,e,n,r){var o=function(t,e,n,r){var o=we(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=ge(t,n)&&e===r;return o.collapsed&&!i},$g=function(t){return b.from(t.getSelection())},Xg=function(t,e,n,r,o){!function(t,e){$g(t).each((function(t){t.removeAllRanges(),t.addRange(e)}))}(t,Rg(t,e,n,r,o))},Yg=function(t,e,n,r,o){!function(t,e){Fg(t,e).match({ltr:function(e,n,r,o){Xg(t,e,n,r,o)},rtl:function(e,n,r,o){$g(t).each((function(i){if(i.setBaseAndExtent)i.setBaseAndExtent(e.dom,n,r.dom,o);else if(i.extend)try{!function(t,e,n,r,o,i){e.collapse(n.dom,r),e.extend(o.dom,i)}(0,i,e,n,r,o)}catch(i){Xg(t,r,o,e,n)}else Xg(t,r,o,e,n)}))}})}(t,function(t,e,n,r){var o=qg(t,e),i=qg(n,r);return Wg.relative(o,i)}(e,n,r,o))},Kg=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return b.some(Lg(se.fromDom(e.startContainer),e.startOffset,se.fromDom(n.endContainer),n.endOffset))}return b.none()},Jg=function(t){if(null===t.anchorNode||null===t.focusNode)return Kg(t);var e=se.fromDom(t.anchorNode),n=se.fromDom(t.focusNode);return Gg(e,t.anchorOffset,n,t.focusOffset)?b.some(Lg(e,t.anchorOffset,n,t.focusOffset)):Kg(t)},Qg=function(t){return $g(t).filter((function(t){return t.rangeCount>0})).bind(Jg)},Zg=function(t,e){return function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?b.some(n).map(Mg):b.none()}(function(t,e){return Fg(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})}(t,e))},tp=function(t){return b.from(t.dom.contentWindow)},ep=function(t){return tp(t).bind(Qg)},np=function(t){return t.getFrame()},rp=function(t,e,n,r){return t[n].getOrThunk((function(){return function(t){return _g(e,r,t)}}))},op=function(t){var e=np(t);return function(t){return b.some(se.fromDom(t.dom.contentWindow.document.body))}(e).bind((function(n){return function(t){return b.some(se.fromDom(t.dom.contentWindow.document))}(e).bind((function(r){return tp(e).map((function(o){var i=se.fromDom(r.dom.documentElement),u=t.getCursorBox.getOrThunk((function(){return function(){return function(t){return Qg(t).map((function(t){return Wg.exact(t.start,t.soffset,t.finish,t.foffset)}))}(o).bind((function(t){return Zg(o,t).orThunk((function(){return function(t){return Qg(t).filter((function(t){return ge(t.start,t.finish)&&t.soffset===t.foffset})).bind((function(t){var e=t.start.dom.getBoundingClientRect();return e.width>0||e.height>0?b.some(e):b.none()}))}(o)}))}))}})),c=t.setSelection.getOrThunk((function(){return function(t,e,n,r){Yg(o,t,e,n,r)}})),s=t.clearSelection.getOrThunk((function(){return function(){!function(t){$g(t).each((function(t){return t.removeAllRanges()}))}(o)}}));return{body:n,doc:r,win:o,html:i,getSelection:a(ep,e),setSelection:c,clearSelection:s,frame:e,onKeyup:rp(t,r,"onKeyup","keyup"),onNodeChanged:rp(t,r,"onNodeChanged","SelectionChange"),onDomChanged:t.onDomChanged,onScrollToCursor:t.onScrollToCursor,onScrollToElement:t.onScrollToElement,onToReading:t.onToReading,onToEditing:t.onToEditing,onToolbarScrollStart:t.onToolbarScrollStart,onTouchContent:t.onTouchContent,onTapContent:t.onTapContent,onTouchToolstrip:t.onTouchToolstrip,getCursorBox:u}}))}))}))},ip=function(t,e){return function(n){return n[t].getOrThunk((function(){var t=np(n);return function(){return e(t)}}))()}}("getWin",tp),up=function(){var t=Ji("head").getOrDie(),e=Ji('meta[name="viewport"]').getOrThunk((function(){var e=se.fromTag("meta");return an(e,"name","viewport"),Ae(t,e),e})),n=sn(e,"content");return{maximize:function(){an(e,"content","width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0")},restore:function(){null!=n&&n.length>0?an(e,"content",n):an(e,"content","user-scalable=yes")}}},ap="data-ephox-mobile-fullscreen-style",cp="position:absolute!important;",sp="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",fp=Ot().os.isAndroid(),lp=function(t,e){var n=function(t){return function(e){var n=sn(e,"style"),r=void 0===n?"no-styles":n.trim();r!==t&&(an(e,ap,r),an(e,"style",t))}},r=Gi(t,"*"),o=z(r,(function(t){return e="*",qi(t,(function(t){return fe(t,e)}));var e})),i=function(t){var e=Pi(t,"background-color");return void 0!==e&&""!==e?"background-color:"+e+"!important":"background-color:rgb(255,255,255)!important;"}(e);M(o,n("display:none!important;")),M(r,n(cp+sp+i)),n((!0===fp?"":cp)+sp+i)(t)},dp=function(){var t=de("["+ap+"]");M(t,(function(t){var e=sn(t,ap);"no-styles"!==e?an(t,"style",e):dn(t,"style"),dn(t,ap)}))};var mp=function(t){var e=t.raw;return void 0===e.touches||1!==e.touches.length?b.none():b.some(e.touches[0])},gp=function(t){var e,n,r,o=ko(b.none()),i=ko(!1),u=(e=function(e){t.triggerEvent(Kt(),e),i.set(!0)},n=400,r=null,{cancel:function(){null!==r&&(clearTimeout(r),r=null)},schedule:function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];r=setTimeout((function(){e.apply(null,t),r=null}),n)}}),a=nr([{key:Et(),value:function(t){return mp(t).each((function(e){u.cancel();var n={x:e.clientX,y:e.clientY,target:t.target};u.schedule(t),i.set(!1),o.set(b.some(n))})),b.none()}},{key:Tt(),value:function(t){return u.cancel(),mp(t).each((function(t){o.get().each((function(e){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(t,e)&&o.set(b.none())}))})),b.none()}},{key:At(),value:function(e){u.cancel();return o.get().filter((function(t){return ge(t.target,e.target)})).map((function(n){return i.get()?(e.prevent(),!1):t.triggerEvent(Yt(),e)}))}}]);return{fireIfReady:function(t,e){return nn(a,e).bind((function(e){return e(t)}))}}},pp=function(t){var e=gp({triggerEvent:function(e,n){t.onTapContent(n)}});return{fireTouchstart:function(t){e.fireIfReady(t,"touchstart")},onTouchend:function(){return _g(t.body,"touchend",(function(t){e.fireIfReady(t,"touchend")}))},onTouchmove:function(){return _g(t.body,"touchmove",(function(t){e.fireIfReady(t,"touchmove")}))}}},hp=Ot().os.version.major>=6,vp=function(t,e,n){var o=pp(t),i=we(e),u=function(t){return!ge(t.start,t.finish)||t.soffset!==t.foffset},a=function(){var r=t.doc.dom.hasFocus()&&t.getSelection().exists(u);n.getByDom(e).each(!0===(r||Eo(i).filter((function(t){return"input"===pe(t)})).exists((function(t){return t.dom.selectionStart!==t.dom.selectionEnd})))?xi.on:xi.off)},c=[_g(t.body,"touchstart",(function(e){t.onTouchContent(),o.fireTouchstart(e)})),o.onTouchmove(),o.onTouchend(),_g(e,"touchstart",(function(e){t.onTouchToolstrip()})),t.onToReading((function(){_o(t.body)})),t.onToEditing(r),t.onScrollToCursor((function(e){e.preventDefault(),t.getCursorBox().each((function(e){var n=t.win,r=e.top>n.innerHeight||e.bottom>n.innerHeight?e.bottom-n.innerHeight+50:0;0!==r&&n.scrollTo(n.pageXOffset,n.pageYOffset+r)}))}))].concat(!0===hp?[]:[_g(se.fromDom(t.win),"blur",(function(){n.getByDom(e).each(xi.off)})),_g(i,"select",a),_g(t.doc,"selectionchange",a)]);return{destroy:function(){M(c,(function(t){t.unbind()}))}}},bp=function(t,e){var n=parseInt(sn(t,e),10);return isNaN(n)?0:n},yp=function(e){return t(t({},e),{width:2})},xp=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},wp=function(t){var e=t.getSelection();return void 0!==e&&e.rangeCount>0?function(t){if(t.collapsed){var e=se.fromDom(t.startContainer);return Se(e).bind((function(n){var r=Wg.exact(e,t.startOffset,n,Hg(n));return Zg(t.startContainer.ownerDocument.defaultView,r).map(yp).map(q)})).getOr([])}return R(t.getClientRects(),xp)}(e.getRangeAt(0)):[]},Cp=function(t){t.focus();var e=se.fromDom(t.document.body);(Eo().exists((function(t){return N(["input","textarea"],pe(t))}))?function(t){Tg.setTimeout((function(){t()}),0)}:l)((function(){Eo().each(_o),Oo(e)}))},Sp="data-"+Oi("last-outer-height"),kp=function(t,e){an(t,Sp,e)},Op=function(t){return{top:t.top,bottom:t.top+t.height}},_p=function(t,e){var n=function(t){return bp(t,Sp)}(e),r=t.innerHeight;return n>r?b.some(n-r):b.none()},Ep=function(t,e){var n=se.fromDom(e.document.body),r=_g(se.fromDom(t),"resize",(function(){_p(t,n).each((function(t){(function(t){var e=wp(t);return e.length>0?b.some(e[0]).map(Op):b.none()})(e).each((function(n){var r=function(t,e,n){return e.top>t.innerHeight||e.bottom>t.innerHeight?Math.min(n,e.bottom-t.innerHeight+50):0}(e,n,t);0!==r&&e.scrollTo(e.pageXOffset,e.pageYOffset+r)}))})),kp(n,t.innerHeight)}));kp(n,t.innerHeight);return{toEditing:function(){Cp(e)},destroy:function(){r.unbind()}}},Tp=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];null!==n&&clearTimeout(n),n=setTimeout((function(){t.apply(null,r),n=null}),e)}}},Ap=function(t,e){var n,r,o,i=Gl(dd.sketch({dom:Cs('<div aria-hidden="true" class="${prefix}-mask-tap-icon"></div>'),containerBehaviours:bo([xi.config({toggleClass:Oi("mask-tap-icon-selected"),toggleOnExecute:!1})])})),u=(n=t,r=200,o=null,{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];null===o&&(o=setTimeout((function(){n.apply(null,t),o=null}),r))}});return dd.sketch({dom:Cs('<div class="${prefix}-disabled-mask"></div>'),components:[dd.sketch({dom:Cs('<div class="${prefix}-content-container"></div>'),components:[bs.sketch({dom:Cs('<div class="${prefix}-content-tap-section"></div>'),components:[i.asSpec()],action:function(t){u.throttle()},buttonBehaviours:bo([xi.config({toggleClass:Oi("mask-tap-icon-selected")})])})]})]})},Bp=i({unbind:r}),Np=hr([Ir("editor",[Rr("getFrame"),Pr("getBody"),Pr("getDoc"),Pr("getWin"),Pr("getSelection"),Pr("setSelection"),Pr("clearSelection"),Pr("cursorSaver"),Pr("onKeyup"),Pr("onNodeChanged"),Pr("getCursorBox"),Rr("onDomChanged"),Hr("onTouchContent",r),Hr("onTapContent",r),Hr("onTouchToolstrip",r),Hr("onScrollToCursor",Bp),Hr("onScrollToElement",Bp),Hr("onToEditing",Bp),Hr("onToReading",Bp),Hr("onToolbarScrollStart",u)]),Rr("socket"),Rr("toolstrip"),Rr("dropup"),Rr("toolbar"),Rr("container"),Rr("alloy"),jr("win",(function(t){return we(t.socket).dom.defaultView})),jr("body",(function(t){return se.fromDom(t.socket.dom.ownerDocument.body)})),Hr("translate",u),Hr("setReadOnly",r),Hr("readOnlyOnInit",m)]),Dp=function(t){var e=Tr("Getting AndroidWebapp schema",Np,t);Mi(e.toolstrip,"width","100%");var n=Cm(Ap((function(){e.setReadOnly(e.readOnlyOnInit()),i.enter()}),e.translate));e.alloy.add(n);var o={show:function(){e.alloy.add(n)},hide:function(){e.alloy.remove(n)}};Ae(e.container,n.element);var i=function(t,e){var n=up(),r=qd(),o=qd();return{enter:function(){e.hide(),vn(t.container,Oi("fullscreen-maximized")),vn(t.container,Oi("android-maximized")),n.maximize(),vn(t.body,Oi("android-scroll-reload")),r.set(Ep(t.win,ip(t.editor).getOrDie("no"))),op(t.editor).each((function(e){lp(t.container,e.body),o.set(vp(e,t.toolstrip,t.alloy))}))},exit:function(){n.restore(),e.show(),yn(t.container,Oi("fullscreen-maximized")),yn(t.container,Oi("android-maximized")),dp(),yn(t.body,Oi("android-scroll-reload")),o.clear(),r.clear()}}}(e,o);return{setReadOnly:e.setReadOnly,refreshStructure:r,enter:i.enter,exit:i.exit,destroy:r}},Rp=i([Rr("dom"),Hr("shell",!0),dc("toolbarBehaviours",[Wm])]),Mp=i([Uc({name:"groups",overrides:function(){return{behaviours:bo([Wm.config({})])}}})]),Ip=vs({name:"Toolbar",configFields:Rp(),partFields:Mp(),factory:function(t,e,n,r){var o=function(e){return t.shell?b.some(e):Jc(e,t,"groups")},i=t.shell?{behaviours:[Wm.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:gc(t.toolbarBehaviours,i.behaviours),apis:{setGroups:function(t,e){o(t).fold((function(){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")}),(function(t){Wm.set(t,e)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),Pp=i([Rr("items"),function(t){return Ir("markers",R(t,Rr))}(["itemSelector"]),dc("tgroupBehaviours",[lc])]),Fp=i([Wc({name:"items",unit:"item"})]),Lp=vs({name:"ToolbarGroup",configFields:Pp(),partFields:Fp(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:gc(t.tgroupBehaviours,[lc.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),Vp="data-"+Oi("horizontal-scroll"),Hp=function(t){return"true"===sn(t,Vp)?function(t){return t.dom.scrollLeft>0||function(t){t.dom.scrollLeft=1;var e=0!==t.dom.scrollLeft;return t.dom.scrollLeft=0,e}(t)}(t):function(t){return t.dom.scrollTop>0||function(t){t.dom.scrollTop=1;var e=0!==t.dom.scrollTop;return t.dom.scrollTop=0,e}(t)}(t)},zp=function(){var t=function(t){var e=!0===t.scrollable?"${prefix}-toolbar-scrollable-group":"";return{dom:Cs('<div aria-label="'+t.label+'" class="${prefix}-toolbar-group '+e+'"></div>'),tgroupBehaviours:bo([cd("adhoc-scrollable-toolbar",!0===t.scrollable?[uo((function(t,e){var n;Mi(t.element,"overflow-x","auto"),n=t.element,an(n,Vp,"true"),ag(t.element)}))]:[])]),components:[dd.sketch({components:[Lp.parts.items({})]})],markers:{itemSelector:"."+Oi("toolbar-group-item")},items:t.items}},e=Cm(Ip.sketch({dom:Cs('<div class="${prefix}-toolbar"></div>'),components:[Ip.parts.groups({})],toolbarBehaviours:bo([xi.config({toggleClass:Oi("context-toolbar"),toggleOnExecute:!1,aria:{mode:"none"}}),lc.config({mode:"cyclic"})]),shell:!0})),n=Cm(dd.sketch({dom:{classes:[Oi("toolstrip")]},components:[Sm(e)],containerBehaviours:bo([xi.config({toggleClass:Oi("android-selection-context-toolbar"),toggleOnExecute:!1})])})),r=function(){Ip.setGroups(e,i.get()),xi.off(e)},i=ko([]);return{wrapper:n,toolbar:e,createGroups:function(e){return R(e,o(Lp.sketch,t))},setGroups:function(t){i.set(t),r()},setContextToolbar:function(t){xi.on(e),Ip.setGroups(e,t)},restoreToolbar:function(){xi.isOn(e)&&r()},refresh:function(){},focus:function(){lc.focusIn(e)}}},jp=function(t){return Cm(bs.sketch({dom:Cs('<div class="${prefix}-mask-edit-icon ${prefix}-icon"></div>'),action:function(){t.run((function(t){t.setReadOnly(!1)}))}}))},Up=function(){return Cm(dd.sketch({dom:Cs('<div class="${prefix}-editor-socket"></div>'),components:[],containerBehaviours:bo([Wm.config({})])}))},Wp=function(t,e){Wm.append(t,Sm(e))},qp=function(t,e){Wm.remove(t,e)},Gp=function(t,e,n,r){(!0===n?So.toAlpha:So.toOmega)(r),(n?Wp:qp)(t,e)},$p=function(t,e){return e.getAnimationRoot.fold((function(){return t.element}),(function(e){return e(t)}))},Xp=function(t){return t.dimension.property},Yp=function(t,e){return t.dimension.getDimension(e)},Kp=function(t,e){var n=$p(t,e);dm(n,[e.shrinkingClass,e.growingClass])},Jp=function(t,e){yn(t.element,e.openClass),vn(t.element,e.closedClass),Mi(t.element,Xp(e),"0px"),Hi(t.element)},Qp=function(t,e){yn(t.element,e.closedClass),vn(t.element,e.openClass),Vi(t.element,Xp(e))},Zp=function(t,e,n,r){n.setCollapsed(),Mi(t.element,Xp(e),Yp(e,t.element)),Hi(t.element),Kp(t,e),Jp(t,e),e.onStartShrink(t),e.onShrunk(t)},th=function(t,e,n,r){var o=r.getOrThunk((function(){return Yp(e,t.element)}));n.setCollapsed(),Mi(t.element,Xp(e),o),Hi(t.element);var i=$p(t,e);yn(i,e.growingClass),vn(i,e.shrinkingClass),Jp(t,e),e.onStartShrink(t)},eh=function(t,e,n){var r=Yp(e,t.element);("0px"===r?Zp:th)(t,e,n,b.some(r))},nh=function(t,e,n){var r=$p(t,e),o=xn(r,e.shrinkingClass),i=Yp(e,t.element);Qp(t,e);var u=Yp(e,t.element);(o?function(){Mi(t.element,Xp(e),i),Hi(t.element)}:function(){Jp(t,e)})(),yn(r,e.shrinkingClass),vn(r,e.growingClass),Qp(t,e),Mi(t.element,Xp(e),u),n.setExpanded(),e.onStartGrow(t)},rh=function(t,e,n){var r=$p(t,e);return!0===xn(r,e.growingClass)},oh=function(t,e,n){var r=$p(t,e);return!0===xn(r,e.shrinkingClass)},ih=Object.freeze({__proto__:null,refresh:function(t,e,n){if(n.isExpanded()){Vi(t.element,Xp(e));var r=Yp(e,t.element);Mi(t.element,Xp(e),r)}},grow:function(t,e,n){n.isExpanded()||nh(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&eh(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&Zp(t,e,n,b.none())},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:rh,isShrinking:oh,isTransitioning:function(t,e,n){return!0===rh(t,e)||!0===oh(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?eh:nh)(t,e,n)},disableTransitions:Kp}),uh=Object.freeze({__proto__:null,exhibit:function(t,e,n){var r=e.expanded;return fo(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:er(e.dimension.property,"0px")})},events:function(t,e){return Yr([ro(Vt(),(function(n,r){r.event.raw.propertyName===t.dimension.property&&(Kp(n,t),e.isExpanded()&&Vi(n.element,t.dimension.property),(e.isExpanded()?t.onGrown:t.onShrunk)(n))}))])}}),ah=[Rr("closedClass"),Rr("openClass"),Rr("shrinkingClass"),Rr("growingClass"),Pr("getAnimationRoot"),ti("onShrunk"),ti("onStartShrink"),ti("onGrown"),ti("onStartGrow"),Hr("expanded",!1),Mr("dimension",Br("property",{width:[oi("property","width"),oi("getDimension",(function(t){return Zs(t)+"px"}))],height:[oi("property","height"),oi("getDimension",(function(t){return Ui(t)+"px"}))]}))],ch=xo({fields:ah,name:"sliding",active:uh,apis:ih,state:Object.freeze({__proto__:null,init:function(t){var e=ko(t.expanded);return vo({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:a(e.set,!1),setExpanded:a(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),sh=function(t,e){var n=Cm(dd.sketch({dom:{tag:"div",classes:[Oi("dropup")]},components:[],containerBehaviours:bo([Wm.config({}),ch.config({closedClass:Oi("dropup-closed"),openClass:Oi("dropup-open"),shrinkingClass:Oi("dropup-shrinking"),growingClass:Oi("dropup-growing"),dimension:{property:"height"},onShrunk:function(n){t(),e(),Wm.set(n,[])},onGrown:function(n){t(),e()}}),Ci((function(t,e){o(r)}))])})),o=function(t){window.requestAnimationFrame((function(){t(),ch.shrink(n)}))};return{appear:function(t,e,r){!0===ch.hasShrunk(n)&&!1===ch.isTransitioning(n)&&window.requestAnimationFrame((function(){e(r),Wm.set(n,[t()]),ch.grow(n)}))},disappear:o,component:n,element:n.element}},fh=function(t){var e,n;return t.raw.which===eu[0]&&!N(["input","textarea"],pe(t.target))&&(e=t.target,!tu(e,'[contenteditable="true"]',n).isSome())},lh=function(){return Ot().browser.isFirefox()},dh=pr([function(t){return Mr(t,Dr)}("triggerEvent"),Hr("stopBackspace",!0)]),mh=function(t,e){var n=Tr("Getting GUI events settings",dh,e),r=gp(n),o=R(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return _g(t,e,(function(t){r.fireIfReady(t,e).each((function(e){e&&t.kill()})),n.triggerEvent(e,t)&&t.kill()}))})),i=ko(b.none()),u=_g(t,"paste",(function(t){r.fireIfReady(t,"paste").each((function(e){e&&t.kill()})),n.triggerEvent("paste",t)&&t.kill(),i.set(b.some(setTimeout((function(){n.triggerEvent(qt(),t)}),0)))})),a=_g(t,"keydown",(function(t){n.triggerEvent("keydown",t)?t.kill():!0===n.stopBackspace&&fh(t)&&t.prevent()})),c=function(t,e){return lh()?Eg(t,"focus",e):_g(t,"focusin",e)}(t,(function(t){n.triggerEvent("focusin",t)&&t.kill()})),s=ko(b.none()),f=function(t,e){return lh()?Eg(t,"blur",e):_g(t,"focusout",e)}(t,(function(t){n.triggerEvent("focusout",t)&&t.kill(),s.set(b.some(setTimeout((function(){n.triggerEvent(Wt(),t)}),0)))}));return{unbind:function(){M(o,(function(t){t.unbind()})),a.unbind(),c.unbind(),f.unbind(),u.unbind(),i.get().each(clearTimeout),s.get().each(clearTimeout)}}},gh=function(t,e){var n=nn(t,"target").getOr(e);return ko(n)},ph=zn([{stopped:[]},{resume:["element"]},{complete:[]}]),hh=function(t,e,n,r,o,i){var u=t(e,r),a=function(t,e){var n=ko(!1),r=ko(!1);return{stop:function(){n.set(!0)},cut:function(){r.set(!0)},isStopped:n.get,isCut:r.get,event:t,setSource:e.set,getSource:e.get}}(n,o);return u.fold((function(){return i.logEventNoHandlers(e,r),ph.complete()}),(function(t){var n=t.descHandler;return rm(n)(a),a.isStopped()?(i.logEventStopped(e,t.element,n.purpose),ph.stopped()):a.isCut()?(i.logEventCut(e,t.element,n.purpose),ph.complete()):Se(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),ph.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),ph.resume(r)}))}))},vh=function(t,e,n,r,o,i){return hh(t,e,n,r,o,i).fold((function(){return!0}),(function(r){return vh(t,e,n,r,o,i)}),(function(){return!1}))},bh=function(t,e,n){var o=function(t){var e=ko(!1);return{stop:function(){e.set(!0)},cut:r,isStopped:e.get,isCut:d,event:t,setSource:f("Cannot set source of a broadcasted event"),getSource:f("Cannot get source of a broadcasted event")}}(e);return M(t,(function(t){var e=t.descHandler;rm(e)(o)})),o.isStopped()},yh=function(t,e,n,r,o){var i=gh(n,r);return vh(t,e,n,r,i,o)};function xh(){var t={};return{registerId:function(e,n,r){Je(r,(function(r,o){var i=void 0!==t[o]?t[o]:{};i[n]=function(t,e){return n=a.apply(void 0,[t.handler].concat(e)),r=t.purpose,{cHandler:n,purpose:r};var n,r}(r,e),t[o]=i}))},unregisterId:function(e){Je(t,(function(t,n){t.hasOwnProperty(e)&&delete t[e]}))},filterByType:function(e){return nn(t,e).map((function(t){return en(t,(function(t,e){return function(t,e){return{id:t,descHandler:e}}(e,t)}))})).getOr([])},find:function(e,n,r){var o=nn(t,n);return qr(r,(function(t){return function(t,e){return ss(e).fold((function(){return b.none()}),(function(n){return t.bind((function(t){return nn(t,n)})).map((function(t){return function(t,e){return{element:t,descHandler:e}}(e,t)}))}))}(o,t)}),e)}}}function wh(){var t=xh(),e={},n=function(t){var e=t.element;return ss(e).fold((function(){return function(t,e){var n=Ec(us+t);return cs(e,n),n}("uid-",t.element)}),(function(t){return t}))},r=function(n){ss(n.element).each((function(n){delete e[n],t.unregisterId(n)}))};return{find:function(e,n,r){return t.find(e,n,r)},filter:function(e){return t.filterByType(e)},register:function(o){var i=n(o);on(e,i)&&function(t,n){var o=e[n];if(o!==t)throw new Error('The tagId "'+n+'" is already used by: '+Ho(o.element)+"\nCannot use it for: "+Ho(t.element)+"\nThe conflicting element is"+(Ve(o.element)?" ":" not ")+"already in the DOM");r(t)}(o,i);var u=[o];t.registerId(u,i,o.events),e[i]=o},unregister:r,getById:function(t){return nn(e,t)}}}var Ch=function(t){var e=function(e){return Se(t.element).fold((function(){return!0}),(function(t){return ge(e,t)}))},n=wh(),o=function(t,r){return n.find(e,t,r)},u=mh(t.element,{triggerEvent:function(t,e){return $o(t,e.target,(function(n){return function(t,e,n,r){return yh(t,e,n,n.target,r)}(o,t,e,n)}))}}),a={debugInfo:i("real"),triggerEvent:function(t,e,n){$o(t,e,(function(r){return yh(o,t,n,e,r)}))},triggerFocus:function(t,e){ss(t).fold((function(){Oo(t)}),(function(n){$o(Ut(),t,(function(n){return function(t,e,n,r,o){var i=gh(n,r);hh(t,e,n,r,i,o)}(o,Ut(),{originator:e,kill:r,prevent:r,target:t},t,n),!1}))}))},triggerEscape:function(t,e){a.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return v(t)},getByDom:function(t){return b(t)},build:Cm,addToGui:function(t){f(t)},removeFromGui:function(t){l(t)},addToWorld:function(t){c(t)},removeFromWorld:function(t){s(t)},broadcast:function(t){g(t)},broadcastOn:function(t,e){p(t,e)},broadcastEvent:function(t,e){h(t,e)},isConnected:m},c=function(t){t.connect(a),be(t.element)||(n.register(t),M(t.components(),c),a.triggerEvent(Jt(),t.element,{target:t.element}))},s=function(t){be(t.element)||(M(t.components(),s),n.unregister(t)),t.disconnect()},f=function(e){!function(t,e){Ge(t,e,Ae)}(t,e)},l=function(t){$e(t)},d=function(t){var e=n.filter(Gt());M(e,(function(e){var n=e.descHandler;rm(n)(t)}))},g=function(t){d({universal:!0,data:t})},p=function(t,e){d({universal:!1,channels:t,data:e})},h=function(t,e){var r=n.filter(t);return bh(r,e)},v=function(t){return n.getById(t).fold((function(){return On.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),On.value)},b=function(t){var e=ss(t).getOr("not found");return v(e)};return c(t),{root:t,element:t.element,destroy:function(){u.unbind(),De(t.element)},add:f,remove:l,getByUid:v,getByDom:b,addToWorld:c,removeFromWorld:s,broadcast:g,broadcastOn:p,broadcastEvent:h}},Sh=Oi("readonly-mode"),kh=Oi("edit-mode");function Oh(t){var e=Cm(dd.sketch({dom:{classes:[Oi("outer-container")].concat(t.classes)},containerBehaviours:bo([So.config({alpha:Sh,omega:kh})])}));return Ch(e)}var _h=function(t,e){var n=se.fromTag("input");Ii(n,{opacity:"0",position:"absolute",top:"-1000px",left:"-1000px"}),Ae(t,n),Oo(n),e(n),De(n)},Eh=function(t){var e=t.getSelection();if(e.rangeCount>0){var n=e.getRangeAt(0),r=t.document.createRange();r.setStart(n.startContainer,n.startOffset),r.setEnd(n.endContainer,n.endOffset),e.removeAllRanges(),e.addRange(r)}},Th=function(t,e){Eo().each((function(t){ge(t,e)||_o(t)})),t.focus(),Oo(se.fromDom(t.document.body)),Eh(t)},Ah=function(t,e,n,r){var o=function(){Th(e,r)},i=_g(n,"keydown",(function(t){N(["input","textarea"],pe(t.target))||o()}));return{toReading:function(){_h(t,_o)},toEditing:o,onToolbarTouch:function(){},destroy:function(){i.unbind()}}},Bh=function(t,e,n,r,o){var i=function(){e.run((function(t){t.refreshSelection()}))},u=function(t,n){var o=t-r.dom.scrollTop;e.run((function(t){t.scrollIntoView(o,o+n)}))},a=function(){e.run((function(t){t.clearSelection()}))},c=function(){t.getCursorBox().each((function(t){u(t.top,t.height)})),e.run((function(t){t.syncHeight()}))},s=pp(t),f=Tp(c,300),l=[t.onKeyup((function(){a(),f.throttle()})),t.onNodeChanged(i),t.onDomChanged(f.throttle),t.onDomChanged(i),t.onScrollToCursor((function(t){t.preventDefault(),f.throttle()})),t.onScrollToElement((function(t){t.element,u(e,r)})),t.onToEditing((function(){e.run((function(t){t.toEditing()}))})),t.onToReading((function(){e.run((function(t){t.toReading()}))})),_g(t.doc,"touchend",(function(e){ge(t.html,e.target)||ge(t.body,e.target)})),_g(n,"transitionend",(function(t){var r;"height"===t.raw.propertyName&&(r=Ui(n),e.run((function(t){t.setViewportOffset(r)})),i(),c())})),Eg(n,"touchstart",(function(n){var r;e.run((function(t){t.highlightSelection()})),r=n,e.run((function(t){t.onToolbarTouch(r)})),t.onTouchToolstrip()})),_g(t.body,"touchstart",(function(e){a(),t.onTouchContent(),s.fireTouchstart(e)})),s.onTouchmove(),s.onTouchend(),_g(t.body,"click",(function(t){t.kill()})),_g(n,"touchmove",(function(){t.onToolbarScrollStart()}))];return{destroy:function(){M(l,(function(t){t.unbind()}))}}};var Nh={},Dh={exports:Nh};!function(t,e,n,r){!function(r){if("object"==typeof e&&void 0!==n)n.exports=r();else if("function"==typeof t&&t.amd)t([],r);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=r()}}((function(){return function t(e,n,o){function i(a,c){if(!n[a]){if(!e[a]){var s="function"==typeof r&&r;if(!c&&s)return s(a,!0);if(u)return u(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[a]={exports:{}};e[a][0].call(l.exports,(function(t){return i(e[a][1][t]||t)}),l,l.exports,t,e,n,o)}return n[a].exports}for(var u="function"==typeof r&&r,a=0;a<o.length;a++)i(o[a]);return i}({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var s,f=[],l=!1,d=-1;function m(){l&&s&&(l=!1,s.length?f=s.concat(f):d=-1,f.length&&g())}function g(){if(!l){var t=c(m);l=!0;for(var e=f.length;e;){for(s=f,f=[];++d<e;)s&&s[d].run();d=-1,e=f.length}s=null,l=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function h(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];f.push(new p(t,e)),1!==f.length||l||c(g)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){!function(n){var r=setTimeout;function o(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function u(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void c(e.promise,t)}a(e.promise,r)}else(1===t._state?a:c)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void l((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){c(t,e)}var r,o}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)u(t,t._deferreds[e]);t._deferreds=null}function f(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,c(e,t))}))}catch(t){if(n)return;n=!0,c(e,t)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return u(this,new f(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},i._immediateFn="function"==typeof t?function(e){t(e)}:function(t){r(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,u=Array.prototype.slice,a={},c=0;function s(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"==typeof e?e:function(t){var e=c++,r=!(arguments.length<2)&&u.call(arguments,1);return a[e]=!0,o((function(){a[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"==typeof r?r:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}))}(void 0,Nh,Dh,void 0);var Rh,Mh=Dh.exports.boltExport,Ih=function(t){var e=b.none(),n=[],r=function(t){o()?u(t):n.push(t)},o=function(){return e.isSome()},i=function(t){M(t,u)},u=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=b.some(t),i(n),n=[])})),{get:r,map:function(t){return Ih((function(e){r((function(n){e(t(n))}))}))},isReady:o}},Ph={nu:Ih,pure:function(t){return Ih((function(e){e(t)}))}},Fh=function(t){setTimeout((function(){throw t}),0)},Lh=function(t){var e=function(e){t().then(e,Fh)};return{map:function(e){return Lh((function(){return t().then(e)}))},bind:function(e){return Lh((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return Lh((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return Ph.nu(e)},toCached:function(){var e=null;return Lh((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},Vh=function(t){return Lh((function(){return new Mh(t)}))},Hh=function(t){return Lh((function(){return Mh.resolve(t)}))},zh=function(t,e){return $([{width:320,height:480,keyboard:{portrait:300,landscape:240}},{width:320,height:568,keyboard:{portrait:300,landscape:240}},{width:375,height:667,keyboard:{portrait:305,landscape:240}},{width:414,height:736,keyboard:{portrait:320,landscape:240}},{width:768,height:1024,keyboard:{portrait:320,landscape:400}},{width:1024,height:1366,keyboard:{portrait:380,landscape:460}}],(function(n){return function(t,e){return t?b.some(e):b.none()}(t<=n.width&&e<=n.height,n.keyboard)})).getOr({portrait:e/5,landscape:t/4})},jh=function(t){var e=Ag(t).isPortrait(),n=function(t){return zh(t.screen.width,t.screen.height)}(t),r=e?n.portrait:n.landscape;return(e?t.screen.height:t.screen.width)-t.innerHeight>r?0:r},Uh=function(t,e){var n=we(t).dom.defaultView;return Ui(t)+Ui(e)-jh(n)},Wh=function(t,e,n){var r=Uh(e,n),o=Ui(e)+Ui(n)-r;Mi(t,"padding-bottom",o+"px")},qh=zn([{fixed:["element","property","offsetY"]},{scroller:["element","offsetY"]}]),Gh="data-"+Oi("position-y-fixed"),$h="data-"+Oi("y-property"),Xh="data-"+Oi("scrolling"),Yh="data-"+Oi("last-window-height"),Kh=function(t){return bp(t,Gh)},Jh=function(t,e){var n=function(t){return sn(t,$h)}(t);return qh.fixed(t,n,e)},Qh=function(t,e){return qh.scroller(t,e)},Zh=function(t){var e=Kh(t);return("true"===sn(t,Xh)?Qh:Jh)(t,e)},tv=function(t,e,n){var r=we(t).dom.defaultView.innerHeight;return an(t,Yh,r+"px"),r-e-n},ev=function(t,e,n,r){var o=we(t).dom.defaultView,i=function(t){var e=sn(t,"style");return Ii(t,{position:"absolute",top:"0px"}),an(t,Gh,"0px"),an(t,$h,"top"),{restore:function(){an(t,"style",e||""),dn(t,Gh),dn(t,$h)}}}(n),u=Ui(n),a=Ui(r),c=function(t,e,n){var r=sn(n,"style");return ag(n),Ii(n,{position:"absolute",height:e+"px",width:"100%",top:t+"px"}),an(n,Gh,t+"px"),an(n,Xh,"true"),an(n,$h,"top"),{restore:function(){cg(n),an(n,"style",r||""),dn(n,Gh),dn(n,Xh),dn(n,$h)}}}(u,tv(t,u,a),t),f=function(t){var e=sn(t,"style");return Ii(t,{position:"absolute",bottom:"0px"}),an(t,Gh,"0px"),an(t,$h,"bottom"),{restore:function(){an(t,"style",e||""),dn(t,Gh),dn(t,$h)}}}(r),l=!0,d=function(){return o.innerHeight>function(t){return bp(t,Yh)}(t)},m=function(){if(l){var o=Ui(n),i=Ui(r),u=tv(t,o,i);an(t,Gh,o+"px"),Mi(t,"height",u+"px"),Wh(e,t,r)}};return Wh(e,t,r),{setViewportOffset:function(e){an(t,Gh,e+"px"),m()},isExpanding:d,isShrinking:s(d),refresh:m,restore:function(){l=!1,i.restore(),c.restore(),f.restore()}}},nv=(Rh=null,{animate:function(t,e,n,r,o,i){var u=!1,a=function(t){u=!0,o(t)};Tg.clearInterval(Rh);var c=function(t){Tg.clearInterval(Rh),a(t)};Rh=Tg.setInterval((function(){var o=t();(function(t,e,n){return Math.abs(t-e)<=n?b.none():t<e?b.some(t+n):b.some(t-n)})(o,e,n).fold((function(){Tg.clearInterval(Rh),a(e)}),(function(n){if(r(n,c),!u){var i=t();(i!==n||Math.abs(i-e)>Math.abs(o-e))&&(Tg.clearInterval(Rh),a(e))}}))}),i)}}),rv="data-"+Oi("last-scroll-top"),ov=function(t){var e=Li(t,"top").getOr("0");return parseInt(e,10)},iv=function(t){return parseInt(t.dom.scrollTop,10)},uv=function(t,e){return Vh((function(n){var r=a(iv,t);an(t,rv,r());var o=Math.abs(e-r()),i=Math.ceil(o/10);nv.animate(r,e,i,(function(e,n){bp(t,rv)!==t.dom.scrollTop?n(t.dom.scrollTop):(t.dom.scrollTop=e,an(t,rv,e))}),(function(){t.dom.scrollTop=e,an(t,rv,e),n(e)}),10)}))},av=function(t,e){var n=e+Kh(t)+"px";Mi(t,"top",n)};var cv=function(t,e){return e((function(e){var n=[],r=0;0===t.length?e([]):M(t,(function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=t.length&&e(n)}}(i))}))}))},sv=function(t,e,n){var r=e+n,o=Li(t,"top").getOr(n),i=r-parseInt(o,10);return function(t,e,n){return Vh((function(r){var o=a(iv,t);nv.animate(o,e,15,(function(e){t.dom.scrollTop=e,Mi(t,"top",ov(t)+15+"px")}),(function(){t.dom.scrollTop=e,Mi(t,"top",n+"px"),r(e)}),10)}))}(t,t.dom.scrollTop+i,r)},fv=function(t,e){return t.fold((function(t,n,r){return function(t,e,n,r){return Mi(t,e,n+r+"px"),Hh(r)}(t,n,e,r)}),(function(t,n){return sv(t,e,n)}))},lv=function(t,e){var n=function(t){var e=$i(t,"["+Gh+"]");return R(e,Zh)}(t),r=R(n,(function(t){return fv(t,e)}));return cv(r,Vh)},dv=function(t,e,n,r,o,i){var a,c,s=(a=function(n){return function(t,e,n){var r=we(t).dom.defaultView;return Vh((function(o){av(t,n),av(e,n),r.scrollTo(0,n),o(n)}))}(t,e,n)},c=ko(Ph.pure({})),{start:function(t){var e=Ph.nu((function(e){return a(t).get(e)}));c.set(e)},idle:function(t){c.get().get((function(){t()}))}}),f=Tp((function(){s.idle((function(){lv(n,r.pageYOffset).get((function(){var t;(t=wp(i),b.from(t[0]).bind((function(t){var n=t.top-e.dom.scrollTop;return n>r.innerHeight+5||n<-5?b.some({top:n,bottom:n+t.height}):b.none()}))).each((function(t){e.dom.scrollTop=e.dom.scrollTop+t.top})),s.start(0),o.refresh()}))}))}),1e3),l=_g(se.fromDom(r),"scroll",(function(){r.pageYOffset<0||f.throttle()}));return lv(n,r.pageYOffset).get(u),{unbind:l.unbind}},mv=function(t){var e=t.cWin,n=t.ceBody,o=t.socket,i=t.toolstrip,c=t.contentElement,s=t.keyboardType,f=t.outerWindow,l=t.dropup,d=t.outerBody,m=ev(o,n,i,l),g=s(d,e,He(),c),p=Ng(f,{onChange:r,onReady:m.refresh});p.onAdjustment((function(){m.refresh()}));var h=_g(se.fromDom(f),"resize",(function(){m.isExpanding()&&m.refresh()})),v=dv(i,o,d,f,m,e),b=function(t,e){var n=t.document,r=se.fromTag("div");vn(r,Oi("unfocused-selections")),Ae(se.fromDom(n.documentElement),r);var o=_g(r,"touchstart",(function(n){n.prevent(),Th(t,e),u()})),i=function(t){var e=se.fromTag("span");return lm(e,[Oi("layer-editor"),Oi("unfocused-selection")]),Ii(e,{left:t.left+"px",top:t.top+"px",width:t.width+"px",height:t.height+"px"}),e},u=function(){Ne(r)};return{update:function(){u();var e=wp(t),n=R(e,i);Be(r,n)},isActive:function(){return ke(r).length>0},destroy:function(){o.unbind(),De(r)},clear:u}}(e,c),y=function(){b.clear()};return{toEditing:function(){g.toEditing(),y()},toReading:function(){g.toReading()},onToolbarTouch:function(t){g.onToolbarTouch()},refreshSelection:function(){b.isActive()&&b.update()},clearSelection:y,highlightSelection:function(){b.update()},scrollIntoView:function(t,n){!function(t,e,n,r,o){var i=Uh(e,n),u=a(Eh,t);r>i||o>i?uv(e,e.dom.scrollTop-i+o).get(u):r<0&&uv(e,e.dom.scrollTop+r).get(u)}(e,o,l,t,n)},updateToolbarPadding:r,setViewportOffset:function(t){m.setViewportOffset(t),function(t,e){return Vh((function(n){var r=a(ov,t),o=function(e){Mi(t,"top",e+"px")},i=Math.abs(e-r()),u=Math.ceil(i/10);nv.animate(r,e,u,o,(function(){o(e),n(e)}),10)}))}(o,t).get(u)},syncHeight:function(){Mi(c,"height",c.dom.contentWindow.document.body.scrollHeight+"px")},refreshStructure:m.refresh,destroy:function(){m.restore(),p.destroy(),v.unbind(),h.unbind(),g.destroy(),b.destroy(),_h(He(),_o)}}},gv=function(t){var e=Tr("Getting IosWebapp schema",Np,t);Mi(e.toolstrip,"width","100%"),Mi(e.container,"position","relative");var n=Cm(Ap((function(){e.setReadOnly(e.readOnlyOnInit()),i.enter()}),e.translate));e.alloy.add(n);var o={show:function(){e.alloy.add(n)},hide:function(){e.alloy.remove(n)}},i=function(t,e){var n=up(),o=Gd(),i=Gd(),u=qd(),a=qd();return{enter:function(){e.hide();var c=se.fromDom(document);op(t.editor).each((function(e){var s,f;o.set({socketHeight:Li(t.socket,"height"),iframeHeight:Li(e.frame,"height"),outerScroll:document.body.scrollTop}),i.set({exclusives:(s=c,f="."+sg,_g(s,"touchmove",(function(t){tu(t.target,f).filter(Hp).fold((function(){t.prevent()}),r)})))}),vn(t.container,Oi("fullscreen-maximized")),lp(t.container,e.body),n.maximize(),Mi(t.socket,"overflow","scroll"),Mi(t.socket,"-webkit-overflow-scrolling","touch"),Oo(e.body),u.set(mv({cWin:e.win,ceBody:e.body,socket:t.socket,toolstrip:t.toolstrip,dropup:t.dropup.element,contentElement:e.frame,outerBody:t.body,outerWindow:t.win,keyboardType:Ah})),u.run((function(t){t.syncHeight()})),a.set(Bh(e,u,t.toolstrip,t.socket,t.dropup))}))},refreshStructure:function(){u.run((function(t){t.refreshStructure()}))},exit:function(){n.restore(),a.clear(),u.clear(),e.show(),o.on((function(e){e.socketHeight.each((function(e){Mi(t.socket,"height",e)})),e.iframeHeight.each((function(e){Mi(t.editor.getFrame(),"height",e)})),document.body.scrollTop=e.scrollTop})),o.clear(),i.on((function(t){t.exclusives.unbind()})),i.clear(),yn(t.container,Oi("fullscreen-maximized")),dp(),cg(t.toolbar),Vi(t.socket,"overflow"),Vi(t.socket,"-webkit-overflow-scrolling"),_o(t.editor.getFrame()),op(t.editor).each((function(t){t.clearSelection()}))}}}(e,o);return{setReadOnly:e.setReadOnly,refreshStructure:i.refreshStructure,enter:i.enter,exit:i.exit,destroy:r}};var pv=tinymce.util.Tools.resolve("tinymce.EditorManager"),hv=function(t,e,n){t.system.broadcastOn([Ro],{command:e,state:n})},vv=function(t){return function(){var e=function(){t._skinLoaded=!0,t.fire("SkinLoaded")};t.initialized?e():t.on("init",e)}},bv="toReading",yv="toEditing",xv=function(t){return{getNotificationManagerImpl:function(){return{open:i({progressBar:{value:r},close:r,text:r,getEl:i(null),moveTo:r,moveRel:r,settings:{}}),close:r,reposition:r,getArgs:i({})}},renderUI:function(){var e=t.getElement(),n=function(t){var e=b.from(function(t){return t.getParam("skin_url")}(t)).fold((function(){return pv.baseURL+"/skins/ui/oxide"}),(function(t){return t}));return{content:e+"/content.mobile.min.css",ui:e+"/skin.mobile.min.css"}}(t);if(!1===function(t){return!1===t.getParam("skin")}(t)){var o=Ao.DOM.styleSheetLoader;t.contentCSS.push(n.content),o.load(n.ui,vv(t)),t.on("remove",(function(){return o.unload(n.ui)}))}else vv(t)();var i=function(){t.fire("ScrollIntoView")},u=Ot().os.isAndroid()?function(t){var e=Oh({classes:[Oi("android-container")]}),n=zp(),o=qd(),i=jp(o),u=Up(),a=sh(r,t);return e.add(n.wrapper),e.add(u),e.add(a.component),{system:e,element:e.element,init:function(t){o.set(Dp(t))},exit:function(){o.run((function(t){t.exit(),Wm.remove(u,i)}))},setToolbarGroups:function(t){var e=n.createGroups(t);n.setGroups(e)},setContextToolbar:function(t){var e=n.createGroups(t);n.setContextToolbar(e)},focusToolbar:function(){n.focus()},restoreToolbar:function(){n.restoreToolbar()},updateMode:function(t){Gp(u,i,t,e.root)},socket:u,dropup:a}}(i):function(t){var e=Oh({classes:[Oi("ios-container")]}),n=zp(),r=qd(),o=jp(r),i=Up(),u=sh((function(){r.run((function(t){t.refreshStructure()}))}),t);return e.add(n.wrapper),e.add(i),e.add(u.component),{system:e,element:e.element,init:function(t){r.set(gv(t))},exit:function(){r.run((function(t){Wm.remove(i,o),t.exit()}))},setToolbarGroups:function(t){var e=n.createGroups(t);n.setGroups(e)},setContextToolbar:function(t){var e=n.createGroups(t);n.setContextToolbar(e)},focusToolbar:function(){n.focus()},restoreToolbar:function(){n.restoreToolbar()},updateMode:function(t){Gp(i,o,t,e.root)},socket:i,dropup:u}}(i);!function(t,e){Xe(t,e,Ee)}(se.fromDom(e),u.system);var a=e.ownerDocument.defaultView,c=Ng(a,{onChange:function(){u.system.broadcastOn([Mo],{width:Bg(a)})},onReady:r}),s=function(e,n,r,o){!1===o&&t.selection.collapse();var i=f(e,n,r);u.setToolbarGroups(!0===o?i.readOnly:i.main),t.setMode(!0===o?"readonly":"design"),t.fire(!0===o?bv:yv),u.updateMode(o)},f=function(t,e,n){var r=t.get();return{readOnly:r.backToMask.concat(e.get()),main:r.backToMask.concat(n.get())}},l=function(e,n){return t.on(e,n),{unbind:function(){t.off(e)}}};return t.on("init",(function(){u.init({editor:{getFrame:function(){return se.fromDom(t.contentAreaContainer.querySelector("iframe"))},onDomChanged:function(){return{unbind:r}},onToReading:function(t){return l(bv,t)},onToEditing:function(t){return l(yv,t)},onScrollToCursor:function(e){t.on("ScrollIntoView",(function(t){e(t)}));return{unbind:function(){t.off("ScrollIntoView"),c.destroy()}}},onTouchToolstrip:function(){e()},onTouchContent:function(){var n,r=se.fromDom(t.editorContainer.querySelector("."+Oi("toolbar")));(n=r,To(n).bind((function(t){return u.system.getByDom(t).toOptional()}))).each(ie),u.restoreToolbar(),e()},onTapContent:function(e){var n=e.target;if("img"===pe(n))t.selection.select(n.dom),e.kill();else if("a"===pe(n)){u.system.getByDom(se.fromDom(t.editorContainer)).each((function(t){So.isAlpha(t)&&function(t){var e=document.createElement("a");e.target="_blank",e.href=t.href,e.rel="noreferrer noopener";var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),document.body.appendChild(e),e.dispatchEvent(n),document.body.removeChild(e)}(n.dom)}))}}},container:se.fromDom(t.editorContainer),socket:se.fromDom(t.contentAreaContainer),toolstrip:se.fromDom(t.editorContainer.querySelector("."+Oi("toolstrip"))),toolbar:se.fromDom(t.editorContainer.querySelector("."+Oi("toolbar"))),dropup:u.dropup,alloy:u.system,translate:r,setReadOnly:function(t){s(g,m,d,t)},readOnlyOnInit:function(){return!1}});var e=function(){u.dropup.disappear((function(){u.system.broadcastOn([Io],{})}))},n={label:"The first group",scrollable:!1,items:[Es("back",(function(){t.selection.collapse(),u.exit()}),{},t)]},o={label:"Back to read only",scrollable:!1,items:[Es("readonly-back",(function(){s(g,m,d,!0)}),{},t)]},i=wg(u,t),a=function(t,e){var n=xg(t),r={};return z(n,(function(t){var n=!on(r,t)&&on(e,t)&&e[t].isSupported()?[e[t].sketch()]:[];return r[t]=!0,n}))}(t,i),f={label:"The extra group",scrollable:!1,items:[]},d=ko([{label:"the action group",scrollable:!0,items:a},f]),m=ko([{label:"The read only mode group",scrollable:!0,items:[]},f]),g=ko({backToMask:[n],backToReadOnly:[o]});!function(t,e){var n=Ye(e.formatter.get());M(n,(function(n){e.formatter.formatChanged(n,(function(e){hv(t,n,e)}))})),M(["ul","ol"],(function(n){e.selection.selectorChanged(n,(function(e,r){hv(t,n,e)}))}))}(u,t)})),t.on("remove",(function(){u.exit()})),t.on("detach",(function(){var t,e;t=u.system,e=ke(t.element),M(e,(function(e){t.getByDom(e).each(je)})),De(t.element),u.system.destroy()})),{iframeContainer:u.socket.element.dom,editorContainer:u.element.dom}}}};Bo.add("mobile",xv)}();