@brightspot/ui 6.0.3 → 6.0.4-pr.228.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.json +237 -237
- package/dist/storybook/assets/{ActionBar.stories-BSwwf2PX.js → ActionBar.stories-B3W9l3sW.js} +1 -1
- package/dist/storybook/assets/{ActionItem.stories-SCIA5Rt0.js → ActionItem.stories-Bgq9Si14.js} +1 -1
- package/dist/storybook/assets/{AiSparkle.stories-ByeiNU3G.js → AiSparkle.stories-BvZZGCv0.js} +1 -1
- package/dist/storybook/assets/{Avatar.stories-1EUJytBr.js → Avatar.stories-DKefO8vf.js} +1 -1
- package/dist/storybook/assets/{AvatarGroup.stories-Bstlt4go.js → AvatarGroup.stories-DLU0xm5i.js} +1 -1
- package/dist/storybook/assets/{Badge.stories-X7m0Vl2G.js → Badge.stories-DYf4buS2.js} +1 -1
- package/dist/storybook/assets/{Banner.stories-ljxjOtEc.js → Banner.stories-kvxGWQ8i.js} +1 -1
- package/dist/storybook/assets/{Button-Dbpmp5Ih.js → Button-QbHhnaex.js} +1 -1
- package/dist/storybook/assets/{Button.stories-C5qS3rIw.js → Button.stories-Cbc2kacG.js} +1 -1
- package/dist/storybook/assets/{ButtonGroup.stories-Bl1Ko9jX.js → ButtonGroup.stories-BlMr_i2l.js} +1 -1
- package/dist/storybook/assets/{Card.stories-CfFIzXg5.js → Card.stories-CXgpz0_-.js} +1 -1
- package/dist/storybook/assets/{Celebrate.stories-TSJrIQR8.js → Celebrate.stories-DGuheVhJ.js} +1 -1
- package/dist/storybook/assets/{Checkbox.stories-DUpT9Iwh.js → Checkbox.stories-D5gjg3gd.js} +1 -1
- package/dist/storybook/assets/{CircularProgress.stories-usNosiIU.js → CircularProgress.stories-BtEajA8s.js} +1 -1
- package/dist/storybook/assets/{ClipboardMixin.stories-0jnZ0Drs.js → ClipboardMixin.stories-CVWhGXfx.js} +1 -1
- package/dist/storybook/assets/{Color-6BZIO3FS-C6ecAOER.js → Color-6BZIO3FS-Cy2iWC0B.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-DcbIlkPs.js → Colors.stories-lMKhdwtD.js} +1 -1
- package/dist/storybook/assets/{CombinedEffects.stories-CU-hwRPT.js → CombinedEffects.stories-GYFjehaD.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin-Dcz-J-hg.js → ComponentStatesMixin-Cxyscq1q.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin.stories-orhdmIUX.js → ComponentStatesMixin.stories-Czvdt00v.js} +1 -1
- package/dist/storybook/assets/{CopyToClipboard.stories-D1R2yCQL.js → CopyToClipboard.stories-EYf9o4P1.js} +1 -1
- package/dist/storybook/assets/{Debounce.stories-6z8aEn7O.js → Debounce.stories-B4zKKGEF.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-B-fTNYB5.js → DocsRenderer-LL677BLK-BTEtWPBs.js} +3 -3
- package/dist/storybook/assets/{Dropdown.stories-CeVpVPrP.js → Dropdown.stories-WQFH9gjF.js} +1 -1
- package/dist/storybook/assets/{EmptyState.stories-DdCyApUP.js → EmptyState.stories-CtZTgOyf.js} +1 -1
- package/dist/storybook/assets/{EscaAvatar.stories-DNK85ssI.js → EscaAvatar.stories-PJbKYuIx.js} +1 -1
- package/dist/storybook/assets/{Events.stories-B1qeq2wy.js → Events.stories-CED0yKoW.js} +1 -1
- package/dist/storybook/assets/{Heading.stories-DRu5hUyJ.js → Heading.stories-Yo84UBrv.js} +1 -1
- package/dist/storybook/assets/{HueRipple.stories-D3zqVZWM.js → HueRipple.stories-DQaK4bfx.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-CKG5fIIH.js → Icon.stories-BLBUeiJt.js} +1 -1
- package/dist/storybook/assets/{IconButton.stories-B3RZKBqV.js → IconButton.stories-DE-AWDCu.js} +1 -1
- package/dist/storybook/assets/{LinearProgress.stories-BPvFKGi0.js → LinearProgress.stories-BMOO9ziw.js} +1 -1
- package/dist/storybook/assets/{Message.stories-Dq3YDccT.js → Message.stories-CQ4FeNtL.js} +1 -1
- package/dist/storybook/assets/{OnFindMixin.stories-qKTooUKN.js → OnFindMixin.stories-BgF86VyY.js} +1 -1
- package/dist/storybook/assets/{Pagination.stories-BaFWcckS.js → Pagination.stories-BQz3D7WR.js} +1 -1
- package/dist/storybook/assets/{Popover.stories-DlHlfWrk.js → Popover.stories-BySl8X_V.js} +1 -1
- package/dist/storybook/assets/{ReadyMixin-BQ-q8NO4.js → ReadyMixin-ZKicHfUd.js} +1 -1
- package/dist/storybook/assets/{RovingTabindexMixin.stories-CQkteE6h.js → RovingTabindexMixin.stories-DSHo6CDn.js} +1 -1
- package/dist/storybook/assets/{Rtc.stories-BWBDrPM8.js → Rtc.stories-k6JRiPH-.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-BtM7Q6Ys.js → ScrollShadow.stories-DC0FuAGC.js} +1 -1
- package/dist/storybook/assets/{Switch.stories-Ys6MzOf7.js → Switch.stories-wOpKQIoZ.js} +1 -1
- package/dist/storybook/assets/{Tab.stories-CNIDOscR.js → Tab.stories-48kIvcjq.js} +1 -1
- package/dist/storybook/assets/{Tabs.stories-oAxuRqKE.js → Tabs.stories-BOy2M1hf.js} +1 -1
- package/dist/storybook/assets/{Throttle.stories-D2nPrZEL.js → Throttle.stories-nWsWmaUP.js} +1 -1
- package/dist/storybook/assets/{Tooltip.stories-DJhjWYNV.js → Tooltip.stories-lw4S0OCL.js} +1 -1
- package/dist/storybook/assets/{Upload.stories-DBveASQF.js → Upload.stories-CT96w70S.js} +1 -1
- package/dist/storybook/assets/{UploadItem.stories-Co5bGJs6.js → UploadItem.stories-DAQ0uKRd.js} +1 -1
- package/dist/storybook/assets/{Welcome.stories-Cls_kv8A.js → Welcome.stories-D_tWLJfQ.js} +1 -1
- package/dist/storybook/assets/{Widget.stories-CXpqw5z8.js → Widget.stories-Vklgd-HE.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-Ik6o5Ygb.js → WithTooltip-65CFNBJE-CkTzfxlJ.js} +1 -1
- package/dist/storybook/assets/{blocks-DjXAnVrm.js → blocks-Dcu5vb5v.js} +5 -5
- package/dist/storybook/assets/{formatter-EIJCOSYU-CQXaWVan.js → formatter-EIJCOSYU-Dv3UXZl_.js} +1 -1
- package/dist/storybook/assets/if-defined-Ct57L3GT.js +1 -0
- package/dist/storybook/assets/{iframe-D43T7JCn.js → iframe-DUPD-I_r.js} +4 -4
- package/dist/storybook/assets/{index-DIk8fbbl.js → index-DonibaDQ.js} +1 -1
- package/dist/storybook/assets/onFind-BCF79WfX.js +1 -0
- package/dist/storybook/assets/{onFind.stories-DgxMtTTG.js → onFind.stories-CUNfMRDo.js} +20 -20
- package/dist/storybook/assets/{onRemove.stories-DltMfNLX.js → onRemove.stories-SA3czp21.js} +1 -1
- package/dist/storybook/assets/{onVisible.stories-x3VhGAuF.js → onVisible.stories-BaKmrATX.js} +1 -1
- package/dist/storybook/assets/{style-map-C5J-rKx9.js → style-map-DcmF1KuF.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-CphVNry2.js → syntaxhighlighter-ED5Y7EFY-CgbdQuEL.js} +1 -1
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/project.json +1 -1
- package/dist/util/onFind.d.ts.map +1 -1
- package/dist/util/onFind.js +137 -66
- package/dist/util/onFind.js.map +1 -1
- package/package.json +1 -1
- package/src/legacy/tool-ui/src/dom/onFind.ts +29 -270
- package/src/legacy/tool-ui/src/main/webapp/dist/{6086.7ca02b827506f29db590.js → 1478.b8f12bb302ba4337da4c.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7033.4cd6efbe12e7aaa35745.js → 1536.9b3398bf3ebc2f20f009.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{2111.3956b5196a514b2c0131.js → 2111.efb40a1ab7d6b02913dd.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{2456.5bcfb782c2ec27de32ed.js → 2456.2c20c3564647ca071b26.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{2537.e8f1359bedd328bf57f4.js → 2537.a4d0a358f9c1a60ebc68.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{270.3011484ff80f3093083a.js → 270.8fb1c93bc009582a32cd.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{2825.c1342ac2662d11fd4125.js → 2825.9c2b897f2a3799dcbd19.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{2947.f96d21c44c05980974ef.js → 2947.52cb126b0e2ab4415189.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/3409.8e764d5fa8e2c2cf4d00.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{3532.c358dfbb2cde0f802c7f.js → 3532.ed7716198932139a4fb1.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{3543.2d704cf9e170322468e7.js → 3543.c62d88fc2904cccc7e64.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{3611.61837ffa933f74502094.js → 3611.5466757310c53bea4b6e.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{4374.37147747a254da8f5f8a.js → 4374.a2ea1952e2daf222dc20.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{4450.16dd5684292fd0a7ea7f.js → 4450.9eaca48c71e3dfb64a45.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{4478.93f64e6a6ccb35a6c6d4.js → 4478.3c6e9704ad67996b53a8.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{4790.10d75f7c7f8e54ce83a1.js → 4790.ff3be0fd92b8d7422ae0.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/4795.d4ba3cc84dbf7e58fecb.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{5098.33613009827cfc80aafb.js → 5098.36bb17ff636e87930c6c.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/5306.b41630da0d1df3453bc0.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{5385.6656501b67424994820b.js → 5385.a7d0efb64a5e06173012.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{5598.d84773ca53126661bdca.js → 5598.2f1f3ddbbaefdc2fce5a.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{5617.c81ecb679371ca302f1f.js → 5617.96a2611314c9148efa9c.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{6216.2d532054fcb8e634f96b.js → 6216.3ad86a4e1c11cd87b2cc.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{6497.b7d8dcbf0e7c8d8d538d.js → 6497.17547f58bb12eb6df22d.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{6565.0e5abc3bd344c53ae154.js → 6565.9abec7b54647bee08edc.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7361.793163ca71dfac69d9eb.js → 6664.ec6ef73e3bb33125bd4c.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/6996.f0fbe667259b36548b69.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{5718.449113ae2463a3bb8a83.js → 7175.43f44b9e832f6734d8ea.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{7202.1e5b8f21215ea6eae20a.js → 7202.237027436f4c50941edf.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7524.2990be869cf0a2988d17.js → 7524.ae0837d4dafc92523de7.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7741.0b2789c4e783af835763.js → 7741.84e705c31c3ebc66db92.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{7863.2a1d1fd229778a47e10b.js → 7863.043ee730e243753af268.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/8430.0e134152362fff9ad9d0.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{8752.3d02a0f42ec39786fdf0.js → 8752.3e4315bdb4ad40297406.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{8897.bfeed19f2a4acbb6d67c.js → 8897.b12d749c9564eaa0c945.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{8934.e90ceca8169fc25e4e1b.js → 8934.9f3371f510334b7bae6d.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{9277.88b2d89b3ba1c24e7f93.js → 9277.385ca94e4e3722d25e81.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{9360.bb0352313d610cae11de.js → 9360.269cf0d9b358dcf52f55.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{9576.174d6a99544d17e7416d.js → 9576.18cf577b8886dd85372e.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/Appetizeio.47287ce7992dc52bcb47.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/CISpectrum.45b362ff7dbae9d80cd9.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{CodeMirror.5ddffe054374f883d6f8.js → CodeMirror.2fda1e731cfcb7bec629.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{ImageEditor.14e3b3035666436f53a5.js → ImageEditor.a6da6e88cc958354ec68.js} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/RTEProseMirror.5a8f4754ee77adc85db2.js +500 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/TimedContent.2d0ed03e8d1c994ecfb2.js +1 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{VideoEditor.11c89dda5cf125738a33.js → VideoEditor.c183998c7b2b0dae98f6.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{v4.e496a62fb1d4be0544d4.js → v4.18729ea4f861ad351303.js} +9 -9
- package/src/legacy/tool-ui/src/main/webapp/dist/{v5.1711204aaf6c5fa01b1b.js → v5.beb4fdae5f572ba09fa3.js} +8 -8
- package/dist/storybook/assets/if-defined-BVO6TNCy.js +0 -1
- package/dist/storybook/assets/onFind-CamigPPi.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/4114.57fe159e416e716f8cbc.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/4582.243dbaa3d8a8648f6f40.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/4795.034ebc93a67b7a3d6536.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/Appetizeio.185641211f7c0e42a455.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/CISpectrum.74db7dc80b3a6797a167.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/RTEProseMirror.24cbb57c0030725925a0.js +0 -500
- package/src/legacy/tool-ui/src/main/webapp/dist/TimedContent.4bb4dc83ffbe4019dd7b.js +0 -1
- /package/src/legacy/tool-ui/src/main/webapp/dist/{3543.2d704cf9e170322468e7.js.LICENSE.txt → 3543.c62d88fc2904cccc7e64.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{5598.d84773ca53126661bdca.js.LICENSE.txt → 5598.2f1f3ddbbaefdc2fce5a.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{5718.449113ae2463a3bb8a83.js.LICENSE.txt → 7175.43f44b9e832f6734d8ea.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{9277.88b2d89b3ba1c24e7f93.js.LICENSE.txt → 9277.385ca94e4e3722d25e81.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{9360.bb0352313d610cae11de.js.LICENSE.txt → 9360.269cf0d9b358dcf52f55.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{RTEProseMirror.24cbb57c0030725925a0.js.LICENSE.txt → RTEProseMirror.5a8f4754ee77adc85db2.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{VideoEditor.11c89dda5cf125738a33.js.LICENSE.txt → VideoEditor.c183998c7b2b0dae98f6.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{v4.e496a62fb1d4be0544d4.js.LICENSE.txt → v4.18729ea4f861ad351303.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{v5.1711204aaf6c5fa01b1b.js.LICENSE.txt → v5.beb4fdae5f572ba09fa3.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkbrightspot_cms=self.webpackChunkbrightspot_cms||[]).push([[5857],{21527(e){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC"},8718(e){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC"},14932(e,t,i){function s(e,t){return e?(Array.isArray(t)&&(t=t.join(",")),e.closest(t)):null}i.d(t,{A:()=>s}),Object.defineProperty(s,"name",{value:"default",configurable:!0})},27741(e,t,i){function s(e,t){return e?(Array.isArray(t)&&(t=t.join(",")),e.closest(t)):null}i.d(t,{A:()=>s}),Object.defineProperty(s,"name",{value:"default",configurable:!0})},40627(e,t,i){function s(e,t){return e?(Array.isArray(t)&&(t=t.join(",")),e.querySelectorAll(t)):[]}i.d(t,{A:()=>s}),Object.defineProperty(s,"name",{value:"default",configurable:!0})},76394(e,t,i){function s(e,t){return e?(Array.isArray(t)&&(t=t.join(",")),e.querySelectorAll(t)):[]}i.d(t,{A:()=>s}),Object.defineProperty(s,"name",{value:"default",configurable:!0})},22274(e,t,i){i.d(t,{A:()=>o});let s=!1;function o(e,t){const i=new MutationObserver(o=>{for(const n of o)for(const o of n.removedNodes)o.contains(e)&&!s&&(i.disconnect(),t())});i.observe(document,{childList:!0,subtree:!0})}o.pause=()=>{s=!0},o.resume=()=>{s=!1}},35083(e,t,i){i.d(t,{A:()=>o});let s=!1;function o(e,t){const i=new MutationObserver(o=>{for(const n of o)for(const o of n.removedNodes)o.contains(e)&&!s&&(i.disconnect(),t())});i.observe(document,{childList:!0,subtree:!0})}o.pause=()=>{s=!0},o.resume=()=>{s=!1}},5603(e,t,i){i.a(e,async(e,s)=>{try{i.r(t),i.d(t,{default:()=>y}),i(84978),i(13722),i(25809),i(75178);var o=i(14932),n=i(5292),r=i(94622),a=i.n(r),l=i(95628),c=i(85313),d=i(32246),h=i(22127),p=i(73609),u=i(40627),g=i(66556),m=(i(7466),i(36711));window.BRIGHTSPOT?.ui.cms.enableV5UI||await i.e(8934).then(i.bind(i,76553));const e=window.BRIGHTSPOT?.ui.tooltips,f="400",v=40,E=new Map,b=".cropper-canvas > img, .cropper-view-box > img, .imageEditor-sizePreview";class y{constructor(t){const i="is-imageEditorOpen",s="is-imageEditorLoading",r="is-imageEditorReady",a=(0,o.A)(t,".inputContainer"),c=(0,l.A)(a,".fileSelector"),d=t.parentNode,h=(0,l.A)(t,".imageEditor-image > img"),p=t.closest(".RCIG-item");if(!d||!h)return;this._element=t,this._renditions=new Map,this._focusUI=null,this._editUI=null,this._initialContainerHeight=null,this._form=this._element.closest("form"),this._implicitFocus=t.dataset.implicitFocus,this._isContextual="contextual"in t.dataset,this._element.setAttribute("hidden","");let v=d;for(;v.parentElement?.closest(".CIG-row");)v=v.parentElement?.closest(".CIG-row");const E=this.getForm().querySelector('.inputContainer[data-name$=".hotspots"]');E&&(E.style.display="none"),new ResizeObserver(e=>{for(let t of e)this.repaint(t.contentRect.height)}).observe(document.body);const b=(0,n.A)("div",{className:"ImageEditor-preview-loader"}),y=h.cloneNode();y.onload=()=>{d.classList.add("is-imagePreview"),d.classList.add(s),this.getElement().classList.add(s),b.style.width=`${y.offsetWidth}px`,b.style.height=`${y.offsetHeight}px`};const A=e=>{"Escape"===e.key&&this._element.querySelector(".ImageEditor-closeButton")?.click()},C=(0,n.A)("button",{className:"true"===this.getElement().getAttribute("editor")?"ImageEditor-open":"ImageEditor-open noEditor","aria-haspopup":!0,"aria-label":e.imageEditor.open,title:e.imageEditor.open,type:"button",onclick:e=>{this._element.removeAttribute("hidden"),d.classList.add(i),v.style.zIndex=f;const t=this.getElement().closest(".ContentEdit-left");t&&(t.style.position="fixed",t.style.zIndex=f),d.classList.contains(r)||(d.classList.add(r),this._initialContainerHeight=this.getElement().offsetHeight,this._renditions=this.flattenAndSortRenditions(this.getRenditions()),this.renderRenditionPreviews(this._renditions),this.renderTabs()),p&&p.classList.add(i),this._element.querySelector(".ImageEditor-edit button")?.focus(),window.addEventListener("keydown",A),setTimeout(()=>{this.repaint(document.body.offsetHeight),this._hotspotUI&&(this._hotspotUI.reflow(),this._hotspotUI.reveal())},250)}}),I=(0,l.A)(this.getElement(),".imageEditor-aside"),_=(0,l.A)(I,".imageEditor-tools ul");_.classList.add("ImageEditor-editTools"),_.setAttribute("role","menu");const w=(0,n.A)("button",{className:"ImageEditor-editToggle",type:"button",title:e.imageEditor.actions,"aria-label":e.imageEditor.actions,"aria-haspopup":"menu","aria-expanded":!1,onclick:e=>{(0,g.AM)(_,w)}});(0,g.D1)(_,w);const P=(0,l.A)(this.getElement(),".ImageEditor-groups");P&&(m.A.pause(),d.appendChild(P),requestAnimationFrame(m.A.resume));const R=this.getElement().getAttribute("data-focus-message"),S=(0,n.A)("div",{className:"ImageEditor-focusMessage"},R),x=(0,n.A)("span",{className:"ImageEditor-implicitMessage is-hidden"},this.getElement().dataset.implicitFocusMessage),L=function(e){S.textContent=R+" "+e,S.classList.remove("is-hidden")};this._cropSelect=d.querySelector(".ImageEditor-groups > select"),this._cropSelect&&this._cropSelect.addEventListener("change",e=>{const t=this._cropSelect.selectedIndex,i=this._cropSelect.options[t];S.classList.remove("is-hidden"),L(i.textContent);let s=this._focusUI.getFocusCoordinatesRelative(i.value);const o=(0,l.A)(d,".ImageEditor-focus-point");if(s){const e=this.getFocusCoords(i.value);null!==e.xPercent&&null!==e.yPercent?(o&&o.classList.remove("is-implicit"),x.classList.add("is-hidden")):this.getImplicitFocus()&&(o&&o.classList.add("is-implicit"),o&&o.classList.remove("is-hidden"),x.classList.remove("is-hidden")),o&&o.classList.remove("is-hidden"),this._focusUI.moveTo(s)}else if(this.getImplicitFocus()){const e=this.getImplicitFocus().split(",");s={x:e[0],xPercent:100*e[0],y:e[1],yPercent:100*e[1]},x.classList.remove("is-hidden"),o&&o.classList.add("is-implicit"),this._focusUI.moveTo(s)}else o&&o.classList.add("is-hidden");this.showPreview()}),c&&(0,l.A)(c,"select").addEventListener("change",e=>{C.style.display="keep"===e.target.value?"":"none",w.style.display="keep"===e.target.value?"":"none"}),d.insertBefore((0,n.A)("div",{className:"ImageEditor-preview"},y,b),t),d.append(C,w,_);const q=(0,n.A)("button",{className:"ImageEditor-closeButton",name:"action-done",onclick:e=>{v.style.zIndex="auto";const t=this.getElement().closest(".ContentEdit-left");t&&(t.style.position="initial",t.style.zIndex="auto"),this._element.setAttribute("hidden",""),this.renderPreview(),this._focusUI&&this.showPreview(),d.classList.remove(i),p&&p.classList.remove(i),C.focus(),window.removeEventListener("keydown",A),e.preventDefault()}},"Done");this.getElement().appendChild((0,n.A)("div",{className:"ActionBar"},q));const F=e=>{const{brightness:t,contrast:i,invert:s,grayscale:o,sepia:n,flipH:r,flipV:a,rotate:l}={...e};this.applyFilter("brightness",`${this.convertValueToPercent(t)}%`),this.applyFilter("contrast",`${this.convertValueToPercent(i)}%`),this.applyFilter("sepia",n?"100%":null),this.applyFilter("invert",s?"100%":null),this.applyFilter("grayscale",o?"100%":null),r?this._croptool.scale(-1,a?-1:1):this._croptool.scale(1,a?-1:1),a?this._croptool.scale(r?-1:1,-1):this._croptool.scale(r?-1:1,1),l&&this._croptool.rotateTo(l)},T=()=>{const e=(0,u.A)(this._cropSelect,'option:not([value=""])'),t=Object.values(this.getRenditions());if(e.forEach(e=>{const i=t.filter(t=>t.group===e.value&&0!==t.aspectRatio);if(i.length>0){const t=i.reduce((e,t)=>e+t.aspectRatio,0)/i.length;e.setAttribute("data-preview-ratio",t)}else this._cropSelect.removeChild(e)}),1===this._cropSelect.children.length){const e=(0,l.A)(P,".ComboInput");e&&(e.style.display="none")}},k=e=>{this.initCropTool(e).then(e=>{if(this.getElement().classList.remove(s),d.classList.remove(s),d.classList.add("is-imageEditorLoaded"),F(this.getEditValues()),this.renderPreview(),x&&d.appendChild(x),this._cropSelect){S&&d.appendChild(S);const e=this._cropSelect.selectedIndex,t=this._cropSelect.options[e];L(t.textContent),this.imageMask=(0,n.A)("div",{className:"ImageEditor-preview-border"}),d.querySelector(".ImageEditor-preview").append(this.imageMask),this._focusUI=this.createFocusUI(d,()=>{this.updateAllRenditionPreviews()}),T(),this.showPreview()}})};h.complete?k(h):h.onload=e=>{k(h)}}applyFilter(e,t){let i="";const s=[...this.getElement().querySelectorAll(b),this.getPreviewContainer()];t?E.set(e,t):E.delete(e),E.forEach((e,t)=>{i+=` ${t}(${e}) `}),s.forEach(e=>e.style.filter=`${i.trim()}`)}convertValueToPercent(e){let t=parseFloat(e);return t=100*t+100,t}async initCropTool(e){await new Promise((t,i)=>{this._croptool=new(a())(e,{autoCrop:!1,autoCropArea:1,movable:!1,restore:!1,responsive:!0,scalable:!0,toggleDragModeOnDblclick:!1,viewMode:1,zoomable:!1,zoomOnTouch:!1,zoomOnWheel:!1,minContainerHeight:-1,minContainerWidth:-1,ready:e=>{t()},crop:e=>{const t=this.getCurrentRendition();t&&this.updateRenditionPreview(t,this._croptool.getCroppedCanvas())},cropend:e=>{const t=this.getCurrentRendition(),i=this._croptool.getCropBoxData();t&&(t.modifiedCropData=i,this.showRenditionResetButton(t),this.getRenditionElFromRendition(t).classList.add("ImageEditor-sizeModified"),this.setCropInputValues(t))}})})}repaint(e){const t=this.getElement().querySelector(".ImageEditor-main"),i=e-document.querySelector(".Page-header").offsetHeight,s=t.getBoundingClientRect().width;window.dispatchEvent(new Event("resize")),i===this._croptool?.getCanvasData().height&&this._croptool.setCanvasData({top:this._croptool.getCanvasData().top+24,left:this._croptool.getCanvasData().left+24,height:this._croptool.getCanvasData().height-48}),s===this._croptool?.getCanvasData().width&&this._croptool.setCanvasData({top:this._croptool.getCanvasData().top+24,left:this._croptool.getCanvasData().left+24,width:this._croptool.getCanvasData().width-48}),this.updateAllRenditionPreviews()}getFocusCoords(e){let t,i;if(this._cropSelect){const t=this._cropSelect.selectedIndex;e||(e=this._cropSelect.options[t].value)}return e&&""!==e&&"independent"!==e?(t=this.getElement().querySelector('input[name$=".focusX.'+e+'"]'),i=this.getElement().querySelector('input[name$=".focusY.'+e+'"]'),""!==t.value&&""!==i.value||(t=this.getElement().querySelector('input[name$=".focusX"]'),i=this.getElement().querySelector('input[name$=".focusY"]'))):(t=this.getElement().querySelector('input[name$=".focusX"]'),i=this.getElement().querySelector('input[name$=".focusY"]')),{xPercent:""!==t.value?100*t.value:null,yPercent:""!==i.value?100*i.value:null}}getDefaults(){let e={brightness:0,contrast:0,flipH:!1,flipV:!1,grayscale:!1,invert:!1,rotate:"0",sepia:!1,"no-filter":!0};if(!this._isContextual)return e;let t=this._element.dataset.defaultEdits;if(!t)return e;const i=JSON.parse(t),{grayscale:s,sepia:o,invert:n}=i;return(s||o||n)&&(i["no-filter"]=!1),e=Object.assign(e,i),e}getEditValues(){const e=this.getElement().getAttribute("editor");return[..."true"===e?this.getElement().querySelectorAll(".ImageEditor-edit input[name]"):Object.entries(JSON.parse(this.getElement().getAttribute("edits")))].reduce((t,i)=>{if("true"===e){const e=i.name.substring(i.name.lastIndexOf(".")+1);Object.assign(t,{[e]:"checkbox"===i.type?i.checked:i.value})}else{const e=i[0];Object.assign(t,{[e]:i[1]})}return t},{})}createHotspotUI(e,t,i,s){let o=!1;const r=this.getForm().querySelector('.inputContainer[data-name$=".hotspots"]');if(!r)return;r.style.display="block";const a=(0,n.A)("div",{class:"ImageEditor-hotspot-container",onclick:e=>{e.preventDefault()}}),l=(0,n.A)("div",{class:"ImageEditor-hotspotableArea",onclick:e=>{if(!a.classList.contains("is-hidden")){const t=this.getClickCoordsLocal(e.target,e);t.xPercent*=100,t.yPercent*=100}}});a.appendChild(l),this.getElement().querySelector(".ImageEditor-main").appendChild(a),e.append(r),(0,d.A)(e,".ImageEditor-hotspot-item",e=>{new MutationObserver(t=>{t.forEach(t=>{t.target.classList.contains("is-removing")?u(e):g(e)})}).observe(e,{attributeFilter:["class"]})});const p=()=>{e.querySelectorAll(".ImageEditor-hotspot-item").forEach(e=>{const t=v/2,{x:i,y:s}=l.getBoundingClientRect(),o=l.offsetWidth,n=l.offsetHeight,r=e.draggableRef,{x:a,y:c}=m(e),{xPercent:d,yPercent:h}=f({x:a,y:c}),p=o*(d/100),u=n*(h/100);r.position(),r.left=p+i-t,r.top=u+s-t}),window.dispatchEvent(new Event("resize"))},u=e=>{e.hotspotRefEl.classList.add("is-removing")},g=e=>{e.hotspotRefEl.classList.remove("is-removing")},m=e=>({x:e.querySelector('input[name$="cms.image.x"]').value,y:e.querySelector('input[name$="cms.image.y"]').value}),f=({x:e,y:s})=>({xPercent:e/t*100,yPercent:s/i*100});new MutationObserver(e=>{for(const t of e)"style"===t.attributeName&&E(t.target)}).observe(this.getElement().querySelector(".cropper-canvas"),{attributes:!0});const E=e=>{l.style.height=`${e.offsetHeight}px`,l.style.width=`${e.offsetWidth}px`,l.style.transform=e.style.transform,p()};return E(this.getElement().querySelector(".cropper-canvas")),(()=>{let s=null;const r=(e,s)=>{const o=e.parentNode.getBoundingClientRect();let n=s.left-o.left,r=s.top-o.top;n+=e.offsetWidth/2,r+=e.offsetHeight/2,((e,t)=>{const i=e.querySelector('input[name$="/cms.image.x"]'),s=e.querySelector('input[name$="/cms.image.y"]');i.value=t.x,s.value=t.y,i.dispatchEvent(new Event("change",{bubbles:!0})),s.dispatchEvent(new Event("change",{bubbles:!0}))})(e.itemRefEl,(({x:e,y:s})=>{const o=l.offsetWidth/t,n=l.offsetHeight/i;return{x:e=parseInt(e/o),y:s=parseInt(s/n)}})({x:n,y:r}))};(0,d.A)(e,".RCIG-item[data-hotspot-point]",e=>{const{x:t,y:i}=m(e);(e=>{e.parentNode.querySelectorAll(".ImageEditor-hotspot-item:not(.collapsed):not(.is-collapsed)").forEach(e=>{e.classList.add("is-collapsed"),e.classList.add("collapsed")})})(e),setTimeout(()=>{e.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},100),e.classList.add("ImageEditor-hotspot-item"),e.hotspotRefEl=(({item:e,x:t,y:i,label:a})=>{const d=(0,n.A)("div",{className:"ImageEditor-hotspot",onclick:e=>{(e=>{const t=e.itemRefEl;e.classList.remove("is-added"),t.classList.contains("is-collapsed")&&t.querySelector(":scope .repeatableLabel")?.click(),setTimeout(()=>{t.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},100),s=e})(e.target)},onmouseenter:e=>{o||(e.target.classList.remove("is-added"),e.target.classList.add("is-hovered"),e.target.itemRefEl.classList.add("is-hovered"),e.preventDefault(),e.stopPropagation())},onmouseleave:e=>{o||(e.target.classList.remove("is-hovered"),e.target.itemRefEl.classList.remove("is-hovered"),e.preventDefault(),e.stopPropagation())}});d.innerHTML=a,d.itemRefEl=e,l.appendChild(d);const u=new h.A(d,{leftTop:!1,containment:l});if(h.A.draggableClass="is-draggable",h.A.draggingClass="is-dragging",h.A.movingClass="is-moving",u.onMove=e=>{l.classList.add("is-dragging"),o=!0},u.onDragEnd=e=>{o=!1,l.classList.remove("is-dragging"),r(d,e)},e.draggableRef=u,""===t&&""===i){const e=new c.A,t=.3,i=Math.random()<.5?-1:1,s=Math.random()<.5?-1:1,o=d.parentNode.getBoundingClientRect(),n=o.left+o.width/2,a=o.top+o.height/2,l=n+i*(v*e.getVal(i*t)),h=a+s*(v*e.getVal(s*t));r(d,{left:l,top:h}),p(),d.classList.add("is-added")}return d})({item:e,x:t,y:i,label:Array.from(e.parentElement.children).indexOf(e)+1}),e.onmouseenter=e=>{e.target.hotspotRefEl.classList.remove("is-added"),e.target.hotspotRefEl.classList.add("is-hovered"),e.preventDefault(),e.stopPropagation()},e.onmouseleave=e=>{e.target.hotspotRefEl.classList.remove("is-hovered"),e.preventDefault(),e.stopPropagation()}})})(),l.querySelectorAll(".ImageEditor-hotspot").forEach(e=>{e.classList.add("is-hidden")}),s(),{reflow:p,reveal:()=>{e.querySelectorAll(".ImageEditor-hotspot-item").forEach(e=>{e.hotspotRefEl.classList.remove("is-hidden")})}}}createFocusUI(t,i){const s=(0,n.A)("div",{className:"ImageEditor-focus-point",title:e.imageEditor.focus});let o=this.getElement().querySelector('input[name$=".focusX"]').value,r=this.getElement().querySelector('input[name$=".focusY"]').value;if(!o&&!r&&this.getImplicitFocus()){const e=this.getImplicitFocus().split(",");o=e[0],r=e[1],s.classList.add("is-implicit"),t.querySelector(".ImageEditor-implicitMessage").classList.remove("is-hidden")}const a=()=>{this._cropSelect.querySelectorAll('option:not([value=""])').forEach(e=>{const t=this.getElement().querySelector('input[name$=".focusX.'+e.value+'"]'),i=this.getElement().querySelector('input[name$=".focusY.'+e.value+'"]');t&&i&&(t.value="",i.value="")})},c=({xPercent:e,yPercent:t})=>{const i=this._cropSelect.selectedIndex,s=this._cropSelect.options[i],o=""===s.value?this.getElement().querySelector('input[name$=".focusX"]'):this.getElement().querySelector('input[name$=".focusX.'+s.value+'"]'),n=""===s.value?this.getElement().querySelector('input[name$=".focusY"]'):this.getElement().querySelector('input[name$=".focusY.'+s.value+'"]'),r=h({xPercent:e,yPercent:t});o.value=r.xPercent/100,n.value=r.yPercent/100,""===s.value&&a(),o.dispatchEvent(new Event("change",{bubbles:!0})),n.dispatchEvent(new Event("change",{bubbles:!0}))},d=({xPercent:e,yPercent:i})=>{(0,l.A)(t,".ImageEditor-focus-point")||t.append(s),s.classList.remove("is-hidden"),((e,t)=>{s.style.left=`${e}%`,s.style.top=`${t}%`})(e,i)},h=({xPercent:e,yPercent:t})=>{let i={};if(""===e&&""===t)return null;const{rotate:s,scaleX:o,scaleY:n}=this._croptool.getImageData(),{width:r,height:a}=this._croptool.getImageData(),{width:l,height:c}=this._croptool.getCanvasData(),d=r*e/100,h=a*t/100;i={xPercent:e,yPercent:t};const p=(e,t,i,s,o,n)=>{let r,a;90===e||-270===e?(r=i,a=s-t):180===e||-180===e?(r=s-t,a=o-i):-90===e||270===e?(r=o-i,a=t):(r=t,a=i),n.xPercent=r/l*100,n.yPercent=a/c*100};return p(s,d,h,r,a,i),-1===o&&-1===n?p(s-180,d,h,r,a,i):(-1===o&&(i.xPercent=90===s||-270===s?100-i.xPercent:180===s||-180===s?e:-90===s||270===s?100-i.xPercent:100-e),-1===n&&(90===s||-270===s?(i.xPercent=t,i.yPercent=e):180===s||-180===s?(i.xPercent=100-e,i.yPercent=t):-90===s||270===s?(i.xPercent=100-i.yPercent,i.yPercent=i.xPercent):i.yPercent=100-t)),{x:i.xPercent/100,y:i.yPercent/100,xPercent:i.xPercent,yPercent:i.yPercent}},p=(0,n.A)("div",{class:"ImageEditor-focus-container",dblclick:e=>e.preventDefault(),onclick:e=>{e.preventDefault();const s=(0,l.A)(t,".ImageEditor-focus-point"),o=(0,l.A)(t,".ImageEditor-implicitMessage");s&&s.classList.remove("is-implicit"),o&&o.classList.add("is-hidden"),(0,l.A)(t,".ImageEditor-focusMessage").classList.add("is-hidden");const n=this.getClickCoordsLocal(e.target,e);n.xPercent*=100,n.yPercent*=100;const{xPercent:r,yPercent:a}=n;c({xPercent:r,yPercent:a}),d({xPercent:r,yPercent:a}),this.showPreview(),i()}});return this.getPreviewContainer().appendChild(p),""!==o&&""!==r&&d({xPercent:100*o,yPercent:100*r}),{disable:()=>{p.style.pointerEvents="none"},enable:()=>{p.style.pointerEvents="initial"},moveTo:d,getFocusCoordinatesRelative:e=>{let t={};const i=this.getFocusCoords(e);if(null===i.xPercent&&null===i.yPercent){if(!this.getImplicitFocus())return null;{const e=this.getImplicitFocus().split(",");i.xPercent=100*e[0],i.yPercent=100*e[1]}}const{rotate:s,scaleX:o,scaleY:n}=this._croptool.getImageData(),{width:r,height:a}=this._croptool.getImageData(),{width:l,height:c}=this._croptool.getCanvasData(),d=r*i.xPercent/100,h=a*i.yPercent/100;t={...i};const p=(e,t,i,s,o,n)=>{let r,a;90===e||-270===e?(r=o-i,a=t):180===e||-180===e?(r=s-t,a=o-i):-90===e||270===e?(r=i,a=s-t):(r=t,a=i),n.xPercent=r/l*100,n.yPercent=a/c*100};return p(s,d,h,r,a,t),-1===o&&-1===n?p(s-180,d,h,r,a,t):(-1===o&&(90===s||-270===s?t.yPercent=100-i.xPercent:180===s||-180===s?t.xPercent=i.xPercent:-90===s||270===s?t.yPercent=i.xPercent:t.xPercent=100-i.xPercent),-1===n&&(90===s||-270===s?t.xPercent=i.yPercent:180===s||-180===s?(t.xPercent=100-i.xPercent,t.yPercent=i.yPercent):270===s?t.xPercent=100-t.xPercent:t.yPercent=100-i.yPercent)),{x:t.xPercent/100,y:t.yPercent/100,xPercent:t.xPercent,yPercent:t.yPercent}}}}applyAllEdits(e){const{brightness:t,contrast:i,invert:s,grayscale:o,sepia:n,flipH:r,flipV:a,rotate:l}={...e};this.applyFilter("brightness",`${this.convertValueToPercent(t)}%`),this.applyFilter("contrast",`${this.convertValueToPercent(i)}%`),this.applyFilter("sepia",n?"100%":null),this.applyFilter("invert",s?"100%":null),this.applyFilter("grayscale",o?"100%":null),r?this._croptool.scale(-1,a?-1:1):this._croptool.scale(1,a?-1:1),a?this._croptool.scale(r?-1:1,-1):this._croptool.scale(r?-1:1,1),l&&(this._croptool.rotateTo(l),this.moveFocusCoords(),this.updateAllRenditionPreviews(),this.repaint(document.body.offsetHeight))}createEditUI(t,i,s,o,r,a){const c=this.getDefaults(),d=t.querySelector(".imageEditor-tools"),h=t.querySelector(".imageEditor-edit"),p=(0,n.A)("div",{class:"ImageEditor-editableArea",onclick:e=>e.preventDefault(),dblclick:e=>e.preventDefault()});this.getElement().querySelector(".ImageEditor-main").appendChild(p);const u=e=>{let t=parseFloat(e);return t=100*t+100,t},g=this.getElement(),m=g.querySelector('input[name$=".brightness"]'),f=g.querySelector('input[name$=".contrast"]'),v=g.querySelector('input[name$=".sepia"]'),E=g.querySelector('input[name$=".invert"]'),b=g.querySelector('input[name$=".grayscale"]'),y=g.querySelector('input[name$=".no-filter"]'),A=e=>{const t=this.getElement();Object.entries(e).forEach(([e,i])=>{const s=t.querySelector(`.ImageEditor-edit input[name$='.${e}']`);"checkbox"===s.type?s.checked=i:s.value=i})};m.onchange=e=>{this.applyFilter("brightness",`${u(e.target.value)}%`)},f.onchange=e=>{this.applyFilter("contrast",`${u(e.target.value)}%`)};const C={grayscale:b,invert:E,sepia:v,"no-filter":y},I=e=>{C[e].checked?"no-filter"!==e&&this.applyFilter(e,C[e].checked?"100%":null):C[e].checked=!0;for(const t in C)t!==e&&(this.applyFilter(t,null),C[t].checked=!1)};v.onchange=()=>{I("sepia")},E.onchange=()=>{I("invert")},b.onchange=()=>{I("grayscale")},y.onchange=()=>{I("no-filter")};const _=(0,n.A)("button",{class:"ImageEditor-rotate-left","aria-label":e.imageEditor.rotateLeft,title:e.imageEditor.rotateLeft,type:"button",onclick:e=>{s.rotate(-90),this.moveFocusCoords(),r(),a(),B(s.getData().rotate)}},e.imageEditor.rotateLeft),w=(0,n.A)("button",{class:"ImageEditor-rotate-right","aria-label":e.imageEditor.rotateRight,title:e.imageEditor.rotateRight,type:"button",onclick:e=>{s.rotate(90),this.moveFocusCoords(),r(),a(),B(s.getData().rotate)}},e.imageEditor.rotateRight),P=(0,n.A)("button",{class:"ImageEditor-flip-h","aria-label":e.imageEditor.flipH,title:e.imageEditor.flipH,type:"button",onclick:e=>{const t=s.getData().rotate;0===t||180===t||-180===t?x():L(),r(),a()}},e.imageEditor.flipH),R=(0,n.A)("button",{class:"ImageEditor-flip-v","aria-label":e.imageEditor.flipV,title:e.imageEditor.flipV,type:"button",onclick:e=>{const t=s.getData().rotate;0===t||180===t||-180===t?L():x(),r(),a()}},e.imageEditor.flipV),S=(0,n.A)("button",{class:"ImageEditor-resetButton","aria-label":e.reset,type:"button",onclick:e=>{e.preventDefault(),e.stopPropagation(),this.applyAllEdits(c),A(c),this.resetAllRenditionPreviews(),a()},onkeydown:e=>{"Tab"!==e.key||e.shiftKey||(e.preventDefault(),this._element.querySelector(".TabBar-item.is-selected").focus())}},e.reset);(0,l.A)(this.getElement(),".ActionBar").appendChild(S);const x=()=>{const e=q(),t=T();s.scale(e?1:-1,t?-1:1),this.moveFocusCoords(),F()},L=()=>{const e=T(),t=q();s.scale(t?-1:1,e?1:-1),this.moveFocusCoords(),k()},q=()=>{const e=this.getElement().querySelector(".ImageEditor-edit input[name$='.flipH']");return!!e&&e.checked},F=()=>{const e=this.getElement().querySelector(".ImageEditor-edit input[name$='.flipH']");e&&(e.checked=!e.checked,e.dispatchEvent(new Event("change",{bubbles:!0})))},T=()=>{const e=this.getElement().querySelector(".ImageEditor-edit input[name$='.flipV']");return!!e&&e.checked},k=()=>{const e=this.getElement().querySelector(".ImageEditor-edit input[name$='.flipV']");e&&(e.checked=!e.checked,e.dispatchEvent(new Event("change",{bubbles:!0})))},B=e=>{const t=this.getElement().querySelector(".ImageEditor-edit input[name$='.rotate']");let i=e;-180===e?i=180:-270===e?i=90:270===e&&(i=-90),t&&(t.value=i,t.dispatchEvent(new Event("change",{bubbles:!0})))},D=(0,n.A)("div",{class:"CIG-row"},(0,n.A)("label",{class:"CIG-label"},e.imageEditor.brightness,m)),z=(0,n.A)("div",{class:"CIG-row"},(0,n.A)("label",{class:"CIG-label"},e.imageEditor.contrast,f)),$=(0,n.A)("div",{class:"CIG-row",role:"radiogroup"},(0,n.A)("div",{class:"CIG-label"},"Filter"),(0,n.A)("div",{class:"CIG-small",role:"radio",tabIndex:0},(0,n.A)("label",y,e.imageEditor.filters)),(0,n.A)("div",{class:"CIG-small",role:"radio",tabIndex:0},(0,n.A)("label",v,e.imageEditor.sepia)),(0,n.A)("div",{class:"CIG-small",role:"radio",tabIndex:0},(0,n.A)("label",E,e.imageEditor.invert)),(0,n.A)("div",{class:"CIG-small",role:"radio",tabIndex:0},(0,n.A)("label",b,e.imageEditor.grayscale))),M=(0,n.A)("div",{class:"CIG-row"},(0,n.A)("label",{class:"CIG-label"},e.imageEditor.rotate+"/"+e.imageEditor.flip),(0,n.A)("div",{class:"CIG-small"},[_,w,P,R]));h.append(M,D,z,$),i.appendChild(d),i.appendChild(h);const U=this.getEditValues();this.applyAllEdits(U)}filterRenditionPreviews(){const e=this._cropSelect.selectedIndex,t=this._cropSelect.options[e];this.hideCropUI(),this._renditions.forEach(e=>{e.current&&this.toggleRendition(e),this.getRenditionElFromRendition(e).classList.toggle("is-visible",""===t.value||e.cropRatio===t.value)})}moveFocusCoords(){if(!this._focusUI)return;const e=this._focusUI.getFocusCoordinatesRelative();e&&this._focusUI.moveTo(e)}showPreview(){const e=this._cropSelect.selectedIndex,t=this._cropSelect.options[e],i=t.value,s=this._focusUI.getFocusCoordinatesRelative(i),{width:o,height:n}=this.getPreviewContainer().getBoundingClientRect(),r=Math.floor(o/n*100)/100;let a,l,c=0,d=0,h=0,p=0;if(""!==i&&s){const e=t.getAttribute("data-preview-ratio");r>e?(a=n*e,c=o*s.x-a/2,c<=0&&(c=0),d=o-a-c,d<=0&&(d=0,c=o-a)):r<e&&(l=o/e,h=n*s.y-l/2,h<=0&&(h=0),p=n-l-h,p<=0&&(p=0,h=n-l))}this.imageMask.style.borderLeftWidth=`${c}px`,this.imageMask.style.borderRightWidth=`${d}px`,this.imageMask.style.borderTopWidth=`${h}px`,this.imageMask.style.borderBottomWidth=`${p}px`}getClickCoordsLocal(e,t){const{width:i,height:s,top:o,left:n}=e.getBoundingClientRect(),r=o+document.body.scrollTop,a=n+document.body.scrollLeft;let l=Math.ceil(t.pageX-a)||1,c=Math.ceil(t.pageY-r)||1;return l<=0&&(l=1),c<=0&&(c=1),{x:l,y:c,xPercent:l/i,yPercent:c/s,width:i,height:s}}getCropTool(){return this._croptool}getElement(){return this._element}getForm(){return this._form}getImplicitFocus(){return this._implicitFocus}getPreviewCanvas(){return this.getPreviewContainer().querySelector("canvas")}getPreviewContainer(){return this.getElement().parentNode.querySelector(".ImageEditor-preview")}getRenditions(){const e={},t=["x","y","width","height","texts","textSizes","textXs","textYs","textWidths"],i=this.getElement().querySelector(".imageEditor-sizes table");return i&&i.querySelectorAll("th").forEach(i=>{const s=i.closest("tr"),o=s.getAttribute("data-size-group"),n=s.getAttribute("data-size-name"),r=s.getAttribute("data-display-name"),a=s.getAttribute("data-description"),l=parseFloat(s.getAttribute("data-size-width")),c=parseFloat(s.getAttribute("data-size-height"));let d="true"===s.getAttribute("data-size-independent"),h=l/c;0!==l&&0!==c||(h=0,d=!0);const p={};t.forEach(e=>{p[e]=s.querySelector(`input[name$='.${e}']`)});const u=this.getFocusCoords();e[n]={group:o,name:n,description:a,displayName:r,inputs:p,independent:d,width:l,height:c,aspectRatio:h,focusCrop:u}}),e}flattenAndSortRenditions(e){const t=new Map,i=t=>({name:t.name,cropRatio:t.group,sizeInfos:{[t.name]:{...e[t.name]}}});for(const s in e){const o=e[s];t.set(o.name,i(o))}return s=t,new Map(Array.from(s).sort((e,t)=>e[0]-t[0]));var s}hideCropUI(){this._croptool.clear()}showCropUI(){this._croptool.enable();const e=this.getCurrentRendition();e&&(e.current=!1,this.setCurrentRendition(e))}hideEditUI(){this.getElement().querySelector(".ImageEditor-editableArea").classList.add("is-hidden")}showEditUI(){this.getElement().querySelector(".ImageEditor-editableArea").classList.remove("is-hidden")}hideHotspotUI(){this.getElement().querySelector(".ImageEditor-hotspot-container").classList.add("is-hidden")}showHotspotUI(){this.getElement().querySelector(".ImageEditor-hotspot-container").classList.remove("is-hidden"),this._hotspotUI.reflow()}renderPreview(){this.getPreviewContainer().classList.add("is-hidden");const e=this._croptool.getCropBoxData();this._croptool.clear();const t=this._croptool.getCroppedCanvas();this._croptool.setCropBoxData(e);const i=this.getPreviewCanvas();i?this.getPreviewContainer().replaceChild(t,i):this.getPreviewContainer().appendChild(t)}renderRenditionPreviews(e){const t=(0,n.A)("ol",{class:"ImageEditor-sizeSelectors"}),i=e=>{const t=this.getCropTool(),i=(0,n.A)("div",{class:"imageEditor-sizePreview"});this.positionCrop(e);const s=t.getCroppedCanvas();return i.appendChild(s),i};e.forEach((e,s)=>{const o=(0,n.A)("li",{class:"imageEditor-sizeButton "+(e.current?"imageEditor-sizeSelected":""),onclick:t=>{t.preventDefault(),t.stopPropagation(),this.setCurrentRendition(e)}});o.setAttribute("data-group-name",e.sizeInfos[s].group),o.setAttribute("data-size-name",s),e.sizeInfos[s]&&e.sizeInfos[s].independent&&o.setAttribute("data-independent","true");const r=(0,n.A)("div",{className:"imageEditor-sizeLabel"},(a=e,a.sizeInfos[a.name].displayName??=""));var a;const l=(0,n.A)("div",{className:"ImageEditor-sizeContainer"});l.append(r);const c=(0,n.A)("div",{className:"ImageEditor-sizeDescription"});c.append(...(e=>{const t=new Map;for(const i in e.sizeInfos){let s=e.sizeInfos[i].description;s&&t.set(s,(0,n.A)("span",s))}return[...t.values()]})(e));const d=this.getElement().getAttribute("data-inherit"),h=this.getElement().getAttribute("data-override");e.cropRatio&&"independent"!==e.cropRatio&&(c.append((0,n.A)("span",{className:"is-inherit"},d+" "+e.cropRatio)),c.append((0,n.A)("span",{className:"is-override"},h+" "+e.cropRatio)));const p=(0,n.A)("a",{class:"ImageEditor-renditionResetButton",onclick:t=>{t.preventDefault(),t.stopPropagation(),e.current||this.setCurrentRendition(e),this.resetCropInputValues(this.getCurrentRendition()),this.resetRendition(this.getCurrentRendition())}},"Reset");o.append(l,c,i(e)),l.append(p),t.appendChild(o)});const s=this.getElement().querySelector(".ImageEditor-sizes");s&&s.appendChild(t)}renderTabs(){const e=this.getElement().querySelector(".imageEditor-aside"),t=this.getPreviewContainer().querySelector("img"),i=(0,n.A)("div",{class:"ImageEditor-editGroup",dataset:{tab:"Edit"}});"true"===this.getElement().getAttribute("editor")&&e.appendChild(i);const s=this.getElement().querySelector(".imageEditor-sizes");s&&(s.dataset.tab="Sizes",e.appendChild(s)),"true"===this.getElement().getAttribute("editor")?this._editUI=this.createEditUI(e,i,this._croptool,this._focusUI,()=>{this.updateAllRenditionPreviews()},()=>{this.repaint(document.body.offsetHeight)}):this.applyAllEdits(this.getEditValues());const o=!!this.getForm().querySelector('.inputContainer[data-name$=".hotspots"]');let r;o&&(r=(0,n.A)("div",{class:"ImageEditor-hotspots",dataset:{tab:"Hotspots"}}),e.appendChild(r)),this._hotspotUI=o?this.createHotspotUI(r,t.getAttribute("data-width"),t.getAttribute("data-height"),()=>{}):null;const a=new MutationObserver(e=>{for(const t of e)if("class"===t.attributeName){const e=t.target,i=e.dataset.tab;e.classList.contains("TC-unselected")?"Sizes"===i?this.hideCropUI():"Edit"===i?this.hideEditUI():"Hotspots"===i&&this.hideHotspotUI():"Sizes"===i?this.showCropUI():"Edit"===i?this.showEditUI():"Hotspots"===i&&this.showHotspotUI()}});a.observe(i,{attributes:!0}),s&&a.observe(s,{attributes:!0}),r&&a.observe(r,{attributes:!0}),new p.A(e)}updateRenditionPreview(e,t){const i=this.getRenditionElFromRendition(e),s=i.querySelector(".imageEditor-sizePreview canvas");i.querySelector(".imageEditor-sizePreview").replaceChild(t,s)}updateAllRenditionPreviews(){this._renditions.forEach(e=>{this.positionCrop(e);const t=this._croptool.getCroppedCanvas();this._croptool.clear(),this.updateRenditionPreview(e,t)})}setCropInputValues(e,t=null){const i=this._croptool.getCanvasData();let s=t||this._croptool.getCropBoxData(),{left:o,top:n,width:r,height:a}=s;o=0!==o?(o-i.left)/i.width:0,n=0!==n?(n-i.top)/i.height:0,r/=i.width,a/=i.height,s={x:o,y:n,width:r,height:a};for(const t in e.sizeInfos)for(const i in s){const o=e.sizeInfos[t].inputs[i];o.value=s[i],o.removeAttribute("disabled")}}getCropInputValues(e){const t=["x","y","width","height"];let i={};for(const s in e.sizeInfos)t.forEach(t=>{Object.assign(i,{[t]:e.sizeInfos[s].inputs[t].value})});return i}resetCropInputValues(e){this.setCropInputValues(e,{left:0,top:0,width:0,height:0})}resetRendition(e){delete e.modifiedCropData,this.getRenditionElFromRendition(e).classList.remove("ImageEditor-sizeModified"),this.hideRenditionResetButton(e),this.applyRenditionCrop(e)}resetAllRenditionPreviews(){this.getCurrentRendition()&&this.unsetCurrentRendition(this.getCurrentRendition()),this._renditions.forEach(e=>{this.resetCropInputValues(e),delete e.modifiedCropData,this.getRenditionElFromRendition(e).classList.remove("ImageEditor-sizeModified")})}showRenditionResetButton(e){this.getRenditionElFromRendition(e)?.querySelector(":scope .ImageEditor-renditionResetButton")?.classList.add("is-visible")}hideRenditionResetButton(e){this.getRenditionElFromRendition(e)?.querySelector(":scope .ImageEditor-renditionResetButton")?.classList.remove("is-visible")}getRenditionElFromRendition(e){const t=e.name;return this.getElement().querySelector(`.imageEditor-sizeButton[data-size-name='${t}']`)}getIsCropCentered(){return"true"===this.getElement().querySelector(".imageEditor-sizes table").getAttribute("data-crop-center")}getCurrentRendition(){let e=null;return this._renditions.forEach(t=>{t.current&&(e=t)}),e}toggleRendition(e){this.unsetCurrentRendition(e),this._focusUI&&this._focusUI.enable(),this.positionCrop(e);const t=this._croptool.getCroppedCanvas();this._croptool.clear(),this.updateRenditionPreview(e,t)}unsetCurrentRendition(e){this.getRenditionElFromRendition(e).classList.remove("imageEditor-sizeSelected"),e.current=!1}setCurrentRendition(e){e.current?this.toggleRendition(e):(this._renditions.forEach(e=>{e.current&&(this.unsetCurrentRendition(e),this.toggleRendition(e))}),e.current=!0,this.applyRenditionCrop(e))}applyRenditionCrop(e){const t=this.getRenditionElFromRendition(e);t&&(t.classList.add("imageEditor-sizeSelected"),this.positionCrop(e))}positionCrop(e){let t,i,s=this.getCropInputValues(e);const o=this._croptool.getCanvasData();this._focusUI&&(i=this._focusUI.getFocusCoordinatesRelative(e.cropRatio));for(const i in e.sizeInfos)t=e.sizeInfos[i].aspectRatio;if(this._croptool.crop(),this._croptool.setAspectRatio(t),this.getIsCropCentered()||this.getCropTool().setCropBoxData({left:0,top:0}),parseFloat(s.width)&&parseFloat(s.height)){this.getRenditionElFromRendition(e)&&this.showRenditionResetButton(e);const t=o.width*s.x+o.left,i=o.height*s.y+o.top,n=o.width*s.width,r=o.height*s.height;this._croptool.setCropBoxData({left:t,top:i,width:n,height:r})}else if(i){const t=this._croptool.getCanvasData(),s=this._croptool.getCropBoxData(),o={left:t.width*i.x-s.width/2+t.left,top:t.height*i.y-s.height/2+t.top,width:s.width,height:s.height};this._croptool.setCropBoxData(o);for(const t in e.sizeInfos)e.sizeInfos[t].focusCrop=o}}}(0,d.A)(".imageEditor",e=>{new y(e)}),(0,d.A)(".ImageEditor .TabBar-item",e=>{e.addEventListener("keydown",t=>{"Tab"===t.key&&t.shiftKey&&(t.preventDefault(),e.closest(".ImageEditor")?.querySelector(".ImageEditor-resetButton")?.focus())})}),s()}catch(e){s(e)}},1)},92954(e,t,i){i.a(e,async(e,s)=>{try{i.r(t),i.d(t,{default:()=>y}),i(49371),i(42723),i(96648),i(55763);var o=i(27741),n=i(18101),r=i(59015),a=i.n(r),l=i(60021),c=i(78578),d=i(45055),h=i(10910),p=i(9216),u=i(76394),g=i(79365),m=(i(20115),i(23902));window.BRIGHTSPOT?.ui.cms.enableV5UI||await i.e(5001).then(i.bind(i,95001));const e=window.BRIGHTSPOT?.ui.tooltips,f="400",v=40,E=new Map,b=".cropper-canvas > img, .cropper-view-box > img, .imageEditor-sizePreview";class y{constructor(t){const i="is-imageEditorOpen",s="is-imageEditorLoading",r="is-imageEditorReady",a=(0,o.A)(t,".inputContainer"),c=(0,l.A)(a,".fileSelector"),d=t.parentNode,h=(0,l.A)(t,".imageEditor-image > img"),p=t.closest(".RCIG-item");if(!d||!h)return;this._element=t,this._renditions=new Map,this._focusUI=null,this._editUI=null,this._initialContainerHeight=null,this._form=this._element.closest("form"),this._implicitFocus=t.dataset.implicitFocus,this._isContextual="contextual"in t.dataset,this._element.setAttribute("hidden","");let v=d;for(;v.parentElement?.closest(".CIG-row");)v=v.parentElement?.closest(".CIG-row");const E=this.getForm().querySelector('.inputContainer[data-name$=".hotspots"]');E&&(E.style.display="none"),new ResizeObserver(e=>{for(let t of e)this.repaint(t.contentRect.height)}).observe(document.body);const b=(0,n.A)("div",{className:"ImageEditor-preview-loader"}),y=h.cloneNode();y.onload=()=>{d.classList.add("is-imagePreview"),d.classList.add(s),this.getElement().classList.add(s),b.style.width=`${y.offsetWidth}px`,b.style.height=`${y.offsetHeight}px`};const A=e=>{"Escape"===e.key&&this._element.querySelector(".ImageEditor-closeButton")?.click()},C=(0,n.A)("button",{className:"true"===this.getElement().getAttribute("editor")?"ImageEditor-open":"ImageEditor-open noEditor","aria-haspopup":!0,"aria-label":e.imageEditor.open,title:e.imageEditor.open,type:"button",onclick:e=>{this._element.removeAttribute("hidden"),d.classList.add(i),v.style.zIndex=f;const t=this.getElement().closest(".ContentEdit-left");t&&(t.style.position="fixed",t.style.zIndex=f),d.classList.contains(r)||(d.classList.add(r),this._initialContainerHeight=this.getElement().offsetHeight,this._renditions=this.flattenAndSortRenditions(this.getRenditions()),this.renderRenditionPreviews(this._renditions),this.renderTabs()),p&&p.classList.add(i),this._element.querySelector(".ImageEditor-edit button")?.focus(),window.addEventListener("keydown",A),setTimeout(()=>{this.repaint(document.body.offsetHeight),this._hotspotUI&&(this._hotspotUI.reflow(),this._hotspotUI.reveal())},250)}}),I=(0,l.A)(this.getElement(),".imageEditor-aside"),_=(0,l.A)(I,".imageEditor-tools ul");_.classList.add("ImageEditor-editTools"),_.setAttribute("role","menu");const w=(0,n.A)("button",{className:"ImageEditor-editToggle",type:"button",title:e.imageEditor.actions,"aria-label":e.imageEditor.actions,"aria-haspopup":"menu","aria-expanded":!1,onclick:e=>{(0,g.AM)(_,w)}});(0,g.D1)(_,w);const P=(0,l.A)(this.getElement(),".ImageEditor-groups");P&&(m.A.pause(),d.appendChild(P),requestAnimationFrame(m.A.resume));const R=this.getElement().getAttribute("data-focus-message"),S=(0,n.A)("div",{className:"ImageEditor-focusMessage"},R),x=(0,n.A)("span",{className:"ImageEditor-implicitMessage is-hidden"},this.getElement().dataset.implicitFocusMessage),L=function(e){S.textContent=R+" "+e,S.classList.remove("is-hidden")};this._cropSelect=d.querySelector(".ImageEditor-groups > select"),this._cropSelect&&this._cropSelect.addEventListener("change",e=>{const t=this._cropSelect.selectedIndex,i=this._cropSelect.options[t];S.classList.remove("is-hidden"),L(i.textContent);let s=this._focusUI.getFocusCoordinatesRelative(i.value);const o=(0,l.A)(d,".ImageEditor-focus-point");if(s){const e=this.getFocusCoords(i.value);null!==e.xPercent&&null!==e.yPercent?(o&&o.classList.remove("is-implicit"),x.classList.add("is-hidden")):this.getImplicitFocus()&&(o&&o.classList.add("is-implicit"),o&&o.classList.remove("is-hidden"),x.classList.remove("is-hidden")),o&&o.classList.remove("is-hidden"),this._focusUI.moveTo(s)}else if(this.getImplicitFocus()){const e=this.getImplicitFocus().split(",");s={x:e[0],xPercent:100*e[0],y:e[1],yPercent:100*e[1]},x.classList.remove("is-hidden"),o&&o.classList.add("is-implicit"),this._focusUI.moveTo(s)}else o&&o.classList.add("is-hidden");this.showPreview()}),c&&(0,l.A)(c,"select").addEventListener("change",e=>{C.style.display="keep"===e.target.value?"":"none",w.style.display="keep"===e.target.value?"":"none"}),d.insertBefore((0,n.A)("div",{className:"ImageEditor-preview"},y,b),t),d.append(C,w,_);const q=(0,n.A)("button",{className:"ImageEditor-closeButton",name:"action-done",onclick:e=>{v.style.zIndex="auto";const t=this.getElement().closest(".ContentEdit-left");t&&(t.style.position="initial",t.style.zIndex="auto"),this._element.setAttribute("hidden",""),this.renderPreview(),this._focusUI&&this.showPreview(),d.classList.remove(i),p&&p.classList.remove(i),C.focus(),window.removeEventListener("keydown",A),e.preventDefault()}},"Done");this.getElement().appendChild((0,n.A)("div",{className:"ActionBar"},q));const F=e=>{const{brightness:t,contrast:i,invert:s,grayscale:o,sepia:n,flipH:r,flipV:a,rotate:l}={...e};this.applyFilter("brightness",`${this.convertValueToPercent(t)}%`),this.applyFilter("contrast",`${this.convertValueToPercent(i)}%`),this.applyFilter("sepia",n?"100%":null),this.applyFilter("invert",s?"100%":null),this.applyFilter("grayscale",o?"100%":null),r?this._croptool.scale(-1,a?-1:1):this._croptool.scale(1,a?-1:1),a?this._croptool.scale(r?-1:1,-1):this._croptool.scale(r?-1:1,1),l&&this._croptool.rotateTo(l)},T=()=>{const e=(0,u.A)(this._cropSelect,'option:not([value=""])'),t=Object.values(this.getRenditions());if(e.forEach(e=>{const i=t.filter(t=>t.group===e.value&&0!==t.aspectRatio);if(i.length>0){const t=i.reduce((e,t)=>e+t.aspectRatio,0)/i.length;e.setAttribute("data-preview-ratio",t)}else this._cropSelect.removeChild(e)}),1===this._cropSelect.children.length){const e=(0,l.A)(P,".ComboInput");e&&(e.style.display="none")}},k=e=>{this.initCropTool(e).then(e=>{if(this.getElement().classList.remove(s),d.classList.remove(s),d.classList.add("is-imageEditorLoaded"),F(this.getEditValues()),this.renderPreview(),x&&d.appendChild(x),this._cropSelect){S&&d.appendChild(S);const e=this._cropSelect.selectedIndex,t=this._cropSelect.options[e];L(t.textContent),this.imageMask=(0,n.A)("div",{className:"ImageEditor-preview-border"}),d.querySelector(".ImageEditor-preview").append(this.imageMask),this._focusUI=this.createFocusUI(d,()=>{this.updateAllRenditionPreviews()}),T(),this.showPreview()}})};h.complete?k(h):h.onload=e=>{k(h)}}applyFilter(e,t){let i="";const s=[...this.getElement().querySelectorAll(b),this.getPreviewContainer()];t?E.set(e,t):E.delete(e),E.forEach((e,t)=>{i+=` ${t}(${e}) `}),s.forEach(e=>e.style.filter=`${i.trim()}`)}convertValueToPercent(e){let t=parseFloat(e);return t=100*t+100,t}async initCropTool(e){await new Promise((t,i)=>{this._croptool=new(a())(e,{autoCrop:!1,autoCropArea:1,movable:!1,restore:!1,responsive:!0,scalable:!0,toggleDragModeOnDblclick:!1,viewMode:1,zoomable:!1,zoomOnTouch:!1,zoomOnWheel:!1,minContainerHeight:-1,minContainerWidth:-1,ready:e=>{t()},crop:e=>{const t=this.getCurrentRendition();t&&this.updateRenditionPreview(t,this._croptool.getCroppedCanvas())},cropend:e=>{const t=this.getCurrentRendition(),i=this._croptool.getCropBoxData();t&&(t.modifiedCropData=i,this.showRenditionResetButton(t),this.getRenditionElFromRendition(t).classList.add("ImageEditor-sizeModified"),this.setCropInputValues(t))}})})}repaint(e){const t=this.getElement().querySelector(".ImageEditor-main"),i=e-document.querySelector(".Page-header").offsetHeight,s=t.getBoundingClientRect().width;window.dispatchEvent(new Event("resize")),i===this._croptool?.getCanvasData().height&&this._croptool.setCanvasData({top:this._croptool.getCanvasData().top+24,left:this._croptool.getCanvasData().left+24,height:this._croptool.getCanvasData().height-48}),s===this._croptool?.getCanvasData().width&&this._croptool.setCanvasData({top:this._croptool.getCanvasData().top+24,left:this._croptool.getCanvasData().left+24,width:this._croptool.getCanvasData().width-48}),this.updateAllRenditionPreviews()}getFocusCoords(e){let t,i;if(this._cropSelect){const t=this._cropSelect.selectedIndex;e||(e=this._cropSelect.options[t].value)}return e&&""!==e&&"independent"!==e?(t=this.getElement().querySelector('input[name$=".focusX.'+e+'"]'),i=this.getElement().querySelector('input[name$=".focusY.'+e+'"]'),""!==t.value&&""!==i.value||(t=this.getElement().querySelector('input[name$=".focusX"]'),i=this.getElement().querySelector('input[name$=".focusY"]'))):(t=this.getElement().querySelector('input[name$=".focusX"]'),i=this.getElement().querySelector('input[name$=".focusY"]')),{xPercent:""!==t.value?100*t.value:null,yPercent:""!==i.value?100*i.value:null}}getDefaults(){let e={brightness:0,contrast:0,flipH:!1,flipV:!1,grayscale:!1,invert:!1,rotate:"0",sepia:!1,"no-filter":!0};if(!this._isContextual)return e;let t=this._element.dataset.defaultEdits;if(!t)return e;const i=JSON.parse(t),{grayscale:s,sepia:o,invert:n}=i;return(s||o||n)&&(i["no-filter"]=!1),e=Object.assign(e,i),e}getEditValues(){const e=this.getElement().getAttribute("editor");return[..."true"===e?this.getElement().querySelectorAll(".ImageEditor-edit input[name]"):Object.entries(JSON.parse(this.getElement().getAttribute("edits")))].reduce((t,i)=>{if("true"===e){const e=i.name.substring(i.name.lastIndexOf(".")+1);Object.assign(t,{[e]:"checkbox"===i.type?i.checked:i.value})}else{const e=i[0];Object.assign(t,{[e]:i[1]})}return t},{})}createHotspotUI(e,t,i,s){let o=!1;const r=this.getForm().querySelector('.inputContainer[data-name$=".hotspots"]');if(!r)return;r.style.display="block";const a=(0,n.A)("div",{class:"ImageEditor-hotspot-container",onclick:e=>{e.preventDefault()}}),l=(0,n.A)("div",{class:"ImageEditor-hotspotableArea",onclick:e=>{if(!a.classList.contains("is-hidden")){const t=this.getClickCoordsLocal(e.target,e);t.xPercent*=100,t.yPercent*=100}}});a.appendChild(l),this.getElement().querySelector(".ImageEditor-main").appendChild(a),e.append(r),(0,d.A)(e,".ImageEditor-hotspot-item",e=>{new MutationObserver(t=>{t.forEach(t=>{t.target.classList.contains("is-removing")?u(e):g(e)})}).observe(e,{attributeFilter:["class"]})});const p=()=>{e.querySelectorAll(".ImageEditor-hotspot-item").forEach(e=>{const t=v/2,{x:i,y:s}=l.getBoundingClientRect(),o=l.offsetWidth,n=l.offsetHeight,r=e.draggableRef,{x:a,y:c}=m(e),{xPercent:d,yPercent:h}=f({x:a,y:c}),p=o*(d/100),u=n*(h/100);r.position(),r.left=p+i-t,r.top=u+s-t}),window.dispatchEvent(new Event("resize"))},u=e=>{e.hotspotRefEl.classList.add("is-removing")},g=e=>{e.hotspotRefEl.classList.remove("is-removing")},m=e=>({x:e.querySelector('input[name$="cms.image.x"]').value,y:e.querySelector('input[name$="cms.image.y"]').value}),f=({x:e,y:s})=>({xPercent:e/t*100,yPercent:s/i*100});new MutationObserver(e=>{for(const t of e)"style"===t.attributeName&&E(t.target)}).observe(this.getElement().querySelector(".cropper-canvas"),{attributes:!0});const E=e=>{l.style.height=`${e.offsetHeight}px`,l.style.width=`${e.offsetWidth}px`,l.style.transform=e.style.transform,p()};return E(this.getElement().querySelector(".cropper-canvas")),(()=>{let s=null;const r=(e,s)=>{const o=e.parentNode.getBoundingClientRect();let n=s.left-o.left,r=s.top-o.top;n+=e.offsetWidth/2,r+=e.offsetHeight/2,((e,t)=>{const i=e.querySelector('input[name$="/cms.image.x"]'),s=e.querySelector('input[name$="/cms.image.y"]');i.value=t.x,s.value=t.y,i.dispatchEvent(new Event("change",{bubbles:!0})),s.dispatchEvent(new Event("change",{bubbles:!0}))})(e.itemRefEl,(({x:e,y:s})=>{const o=l.offsetWidth/t,n=l.offsetHeight/i;return{x:e=parseInt(e/o),y:s=parseInt(s/n)}})({x:n,y:r}))};(0,d.A)(e,".RCIG-item[data-hotspot-point]",e=>{const{x:t,y:i}=m(e);(e=>{e.parentNode.querySelectorAll(".ImageEditor-hotspot-item:not(.collapsed):not(.is-collapsed)").forEach(e=>{e.classList.add("is-collapsed"),e.classList.add("collapsed")})})(e),setTimeout(()=>{e.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},100),e.classList.add("ImageEditor-hotspot-item"),e.hotspotRefEl=(({item:e,x:t,y:i,label:a})=>{const d=(0,n.A)("div",{className:"ImageEditor-hotspot",onclick:e=>{(e=>{const t=e.itemRefEl;e.classList.remove("is-added"),t.classList.contains("is-collapsed")&&t.querySelector(":scope .repeatableLabel")?.click(),setTimeout(()=>{t.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},100),s=e})(e.target)},onmouseenter:e=>{o||(e.target.classList.remove("is-added"),e.target.classList.add("is-hovered"),e.target.itemRefEl.classList.add("is-hovered"),e.preventDefault(),e.stopPropagation())},onmouseleave:e=>{o||(e.target.classList.remove("is-hovered"),e.target.itemRefEl.classList.remove("is-hovered"),e.preventDefault(),e.stopPropagation())}});d.innerHTML=a,d.itemRefEl=e,l.appendChild(d);const u=new h.A(d,{leftTop:!1,containment:l});if(h.A.draggableClass="is-draggable",h.A.draggingClass="is-dragging",h.A.movingClass="is-moving",u.onMove=e=>{l.classList.add("is-dragging"),o=!0},u.onDragEnd=e=>{o=!1,l.classList.remove("is-dragging"),r(d,e)},e.draggableRef=u,""===t&&""===i){const e=new c.A,t=.3,i=Math.random()<.5?-1:1,s=Math.random()<.5?-1:1,o=d.parentNode.getBoundingClientRect(),n=o.left+o.width/2,a=o.top+o.height/2,l=n+i*(v*e.getVal(i*t)),h=a+s*(v*e.getVal(s*t));r(d,{left:l,top:h}),p(),d.classList.add("is-added")}return d})({item:e,x:t,y:i,label:Array.from(e.parentElement.children).indexOf(e)+1}),e.onmouseenter=e=>{e.target.hotspotRefEl.classList.remove("is-added"),e.target.hotspotRefEl.classList.add("is-hovered"),e.preventDefault(),e.stopPropagation()},e.onmouseleave=e=>{e.target.hotspotRefEl.classList.remove("is-hovered"),e.preventDefault(),e.stopPropagation()}})})(),l.querySelectorAll(".ImageEditor-hotspot").forEach(e=>{e.classList.add("is-hidden")}),s(),{reflow:p,reveal:()=>{e.querySelectorAll(".ImageEditor-hotspot-item").forEach(e=>{e.hotspotRefEl.classList.remove("is-hidden")})}}}createFocusUI(t,i){const s=(0,n.A)("div",{className:"ImageEditor-focus-point",title:e.imageEditor.focus});let o=this.getElement().querySelector('input[name$=".focusX"]').value,r=this.getElement().querySelector('input[name$=".focusY"]').value;if(!o&&!r&&this.getImplicitFocus()){const e=this.getImplicitFocus().split(",");o=e[0],r=e[1],s.classList.add("is-implicit"),t.querySelector(".ImageEditor-implicitMessage").classList.remove("is-hidden")}const a=()=>{this._cropSelect.querySelectorAll('option:not([value=""])').forEach(e=>{const t=this.getElement().querySelector('input[name$=".focusX.'+e.value+'"]'),i=this.getElement().querySelector('input[name$=".focusY.'+e.value+'"]');t&&i&&(t.value="",i.value="")})},c=({xPercent:e,yPercent:t})=>{const i=this._cropSelect.selectedIndex,s=this._cropSelect.options[i],o=""===s.value?this.getElement().querySelector('input[name$=".focusX"]'):this.getElement().querySelector('input[name$=".focusX.'+s.value+'"]'),n=""===s.value?this.getElement().querySelector('input[name$=".focusY"]'):this.getElement().querySelector('input[name$=".focusY.'+s.value+'"]'),r=h({xPercent:e,yPercent:t});o.value=r.xPercent/100,n.value=r.yPercent/100,""===s.value&&a(),o.dispatchEvent(new Event("change",{bubbles:!0})),n.dispatchEvent(new Event("change",{bubbles:!0}))},d=({xPercent:e,yPercent:i})=>{(0,l.A)(t,".ImageEditor-focus-point")||t.append(s),s.classList.remove("is-hidden"),((e,t)=>{s.style.left=`${e}%`,s.style.top=`${t}%`})(e,i)},h=({xPercent:e,yPercent:t})=>{let i={};if(""===e&&""===t)return null;const{rotate:s,scaleX:o,scaleY:n}=this._croptool.getImageData(),{width:r,height:a}=this._croptool.getImageData(),{width:l,height:c}=this._croptool.getCanvasData(),d=r*e/100,h=a*t/100;i={xPercent:e,yPercent:t};const p=(e,t,i,s,o,n)=>{let r,a;90===e||-270===e?(r=i,a=s-t):180===e||-180===e?(r=s-t,a=o-i):-90===e||270===e?(r=o-i,a=t):(r=t,a=i),n.xPercent=r/l*100,n.yPercent=a/c*100};return p(s,d,h,r,a,i),-1===o&&-1===n?p(s-180,d,h,r,a,i):(-1===o&&(i.xPercent=90===s||-270===s?100-i.xPercent:180===s||-180===s?e:-90===s||270===s?100-i.xPercent:100-e),-1===n&&(90===s||-270===s?(i.xPercent=t,i.yPercent=e):180===s||-180===s?(i.xPercent=100-e,i.yPercent=t):-90===s||270===s?(i.xPercent=100-i.yPercent,i.yPercent=i.xPercent):i.yPercent=100-t)),{x:i.xPercent/100,y:i.yPercent/100,xPercent:i.xPercent,yPercent:i.yPercent}},p=(0,n.A)("div",{class:"ImageEditor-focus-container",dblclick:e=>e.preventDefault(),onclick:e=>{e.preventDefault();const s=(0,l.A)(t,".ImageEditor-focus-point"),o=(0,l.A)(t,".ImageEditor-implicitMessage");s&&s.classList.remove("is-implicit"),o&&o.classList.add("is-hidden"),(0,l.A)(t,".ImageEditor-focusMessage").classList.add("is-hidden");const n=this.getClickCoordsLocal(e.target,e);n.xPercent*=100,n.yPercent*=100;const{xPercent:r,yPercent:a}=n;c({xPercent:r,yPercent:a}),d({xPercent:r,yPercent:a}),this.showPreview(),i()}});return this.getPreviewContainer().appendChild(p),""!==o&&""!==r&&d({xPercent:100*o,yPercent:100*r}),{disable:()=>{p.style.pointerEvents="none"},enable:()=>{p.style.pointerEvents="initial"},moveTo:d,getFocusCoordinatesRelative:e=>{let t={};const i=this.getFocusCoords(e);if(null===i.xPercent&&null===i.yPercent){if(!this.getImplicitFocus())return null;{const e=this.getImplicitFocus().split(",");i.xPercent=100*e[0],i.yPercent=100*e[1]}}const{rotate:s,scaleX:o,scaleY:n}=this._croptool.getImageData(),{width:r,height:a}=this._croptool.getImageData(),{width:l,height:c}=this._croptool.getCanvasData(),d=r*i.xPercent/100,h=a*i.yPercent/100;t={...i};const p=(e,t,i,s,o,n)=>{let r,a;90===e||-270===e?(r=o-i,a=t):180===e||-180===e?(r=s-t,a=o-i):-90===e||270===e?(r=i,a=s-t):(r=t,a=i),n.xPercent=r/l*100,n.yPercent=a/c*100};return p(s,d,h,r,a,t),-1===o&&-1===n?p(s-180,d,h,r,a,t):(-1===o&&(90===s||-270===s?t.yPercent=100-i.xPercent:180===s||-180===s?t.xPercent=i.xPercent:-90===s||270===s?t.yPercent=i.xPercent:t.xPercent=100-i.xPercent),-1===n&&(90===s||-270===s?t.xPercent=i.yPercent:180===s||-180===s?(t.xPercent=100-i.xPercent,t.yPercent=i.yPercent):270===s?t.xPercent=100-t.xPercent:t.yPercent=100-i.yPercent)),{x:t.xPercent/100,y:t.yPercent/100,xPercent:t.xPercent,yPercent:t.yPercent}}}}applyAllEdits(e){const{brightness:t,contrast:i,invert:s,grayscale:o,sepia:n,flipH:r,flipV:a,rotate:l}={...e};this.applyFilter("brightness",`${this.convertValueToPercent(t)}%`),this.applyFilter("contrast",`${this.convertValueToPercent(i)}%`),this.applyFilter("sepia",n?"100%":null),this.applyFilter("invert",s?"100%":null),this.applyFilter("grayscale",o?"100%":null),r?this._croptool.scale(-1,a?-1:1):this._croptool.scale(1,a?-1:1),a?this._croptool.scale(r?-1:1,-1):this._croptool.scale(r?-1:1,1),l&&(this._croptool.rotateTo(l),this.moveFocusCoords(),this.updateAllRenditionPreviews(),this.repaint(document.body.offsetHeight))}createEditUI(t,i,s,o,r,a){const c=this.getDefaults(),d=t.querySelector(".imageEditor-tools"),h=t.querySelector(".imageEditor-edit"),p=(0,n.A)("div",{class:"ImageEditor-editableArea",onclick:e=>e.preventDefault(),dblclick:e=>e.preventDefault()});this.getElement().querySelector(".ImageEditor-main").appendChild(p);const u=e=>{let t=parseFloat(e);return t=100*t+100,t},g=this.getElement(),m=g.querySelector('input[name$=".brightness"]'),f=g.querySelector('input[name$=".contrast"]'),v=g.querySelector('input[name$=".sepia"]'),E=g.querySelector('input[name$=".invert"]'),b=g.querySelector('input[name$=".grayscale"]'),y=g.querySelector('input[name$=".no-filter"]'),A=e=>{const t=this.getElement();Object.entries(e).forEach(([e,i])=>{const s=t.querySelector(`.ImageEditor-edit input[name$='.${e}']`);"checkbox"===s.type?s.checked=i:s.value=i})};m.onchange=e=>{this.applyFilter("brightness",`${u(e.target.value)}%`)},f.onchange=e=>{this.applyFilter("contrast",`${u(e.target.value)}%`)};const C={grayscale:b,invert:E,sepia:v,"no-filter":y},I=e=>{C[e].checked?"no-filter"!==e&&this.applyFilter(e,C[e].checked?"100%":null):C[e].checked=!0;for(const t in C)t!==e&&(this.applyFilter(t,null),C[t].checked=!1)};v.onchange=()=>{I("sepia")},E.onchange=()=>{I("invert")},b.onchange=()=>{I("grayscale")},y.onchange=()=>{I("no-filter")};const _=(0,n.A)("button",{class:"ImageEditor-rotate-left","aria-label":e.imageEditor.rotateLeft,title:e.imageEditor.rotateLeft,type:"button",onclick:e=>{s.rotate(-90),this.moveFocusCoords(),r(),a(),B(s.getData().rotate)}},e.imageEditor.rotateLeft),w=(0,n.A)("button",{class:"ImageEditor-rotate-right","aria-label":e.imageEditor.rotateRight,title:e.imageEditor.rotateRight,type:"button",onclick:e=>{s.rotate(90),this.moveFocusCoords(),r(),a(),B(s.getData().rotate)}},e.imageEditor.rotateRight),P=(0,n.A)("button",{class:"ImageEditor-flip-h","aria-label":e.imageEditor.flipH,title:e.imageEditor.flipH,type:"button",onclick:e=>{const t=s.getData().rotate;0===t||180===t||-180===t?x():L(),r(),a()}},e.imageEditor.flipH),R=(0,n.A)("button",{class:"ImageEditor-flip-v","aria-label":e.imageEditor.flipV,title:e.imageEditor.flipV,type:"button",onclick:e=>{const t=s.getData().rotate;0===t||180===t||-180===t?L():x(),r(),a()}},e.imageEditor.flipV),S=(0,n.A)("button",{class:"ImageEditor-resetButton","aria-label":e.reset,type:"button",onclick:e=>{e.preventDefault(),e.stopPropagation(),this.applyAllEdits(c),A(c),this.resetAllRenditionPreviews(),a()},onkeydown:e=>{"Tab"!==e.key||e.shiftKey||(e.preventDefault(),this._element.querySelector(".TabBar-item.is-selected").focus())}},e.reset);(0,l.A)(this.getElement(),".ActionBar").appendChild(S);const x=()=>{const e=q(),t=T();s.scale(e?1:-1,t?-1:1),this.moveFocusCoords(),F()},L=()=>{const e=T(),t=q();s.scale(t?-1:1,e?1:-1),this.moveFocusCoords(),k()},q=()=>{const e=this.getElement().querySelector(".ImageEditor-edit input[name$='.flipH']");return!!e&&e.checked},F=()=>{const e=this.getElement().querySelector(".ImageEditor-edit input[name$='.flipH']");e&&(e.checked=!e.checked,e.dispatchEvent(new Event("change",{bubbles:!0})))},T=()=>{const e=this.getElement().querySelector(".ImageEditor-edit input[name$='.flipV']");return!!e&&e.checked},k=()=>{const e=this.getElement().querySelector(".ImageEditor-edit input[name$='.flipV']");e&&(e.checked=!e.checked,e.dispatchEvent(new Event("change",{bubbles:!0})))},B=e=>{const t=this.getElement().querySelector(".ImageEditor-edit input[name$='.rotate']");let i=e;-180===e?i=180:-270===e?i=90:270===e&&(i=-90),t&&(t.value=i,t.dispatchEvent(new Event("change",{bubbles:!0})))},D=(0,n.A)("div",{class:"CIG-row"},(0,n.A)("label",{class:"CIG-label"},e.imageEditor.brightness,m)),z=(0,n.A)("div",{class:"CIG-row"},(0,n.A)("label",{class:"CIG-label"},e.imageEditor.contrast,f)),$=(0,n.A)("div",{class:"CIG-row",role:"radiogroup"},(0,n.A)("div",{class:"CIG-label"},"Filter"),(0,n.A)("div",{class:"CIG-small",role:"radio",tabIndex:0},(0,n.A)("label",y,e.imageEditor.filters)),(0,n.A)("div",{class:"CIG-small",role:"radio",tabIndex:0},(0,n.A)("label",v,e.imageEditor.sepia)),(0,n.A)("div",{class:"CIG-small",role:"radio",tabIndex:0},(0,n.A)("label",E,e.imageEditor.invert)),(0,n.A)("div",{class:"CIG-small",role:"radio",tabIndex:0},(0,n.A)("label",b,e.imageEditor.grayscale))),M=(0,n.A)("div",{class:"CIG-row"},(0,n.A)("label",{class:"CIG-label"},e.imageEditor.rotate+"/"+e.imageEditor.flip),(0,n.A)("div",{class:"CIG-small"},[_,w,P,R]));h.append(M,D,z,$),i.appendChild(d),i.appendChild(h);const U=this.getEditValues();this.applyAllEdits(U)}filterRenditionPreviews(){const e=this._cropSelect.selectedIndex,t=this._cropSelect.options[e];this.hideCropUI(),this._renditions.forEach(e=>{e.current&&this.toggleRendition(e),this.getRenditionElFromRendition(e).classList.toggle("is-visible",""===t.value||e.cropRatio===t.value)})}moveFocusCoords(){if(!this._focusUI)return;const e=this._focusUI.getFocusCoordinatesRelative();e&&this._focusUI.moveTo(e)}showPreview(){const e=this._cropSelect.selectedIndex,t=this._cropSelect.options[e],i=t.value,s=this._focusUI.getFocusCoordinatesRelative(i),{width:o,height:n}=this.getPreviewContainer().getBoundingClientRect(),r=Math.floor(o/n*100)/100;let a,l,c=0,d=0,h=0,p=0;if(""!==i&&s){const e=t.getAttribute("data-preview-ratio");r>e?(a=n*e,c=o*s.x-a/2,c<=0&&(c=0),d=o-a-c,d<=0&&(d=0,c=o-a)):r<e&&(l=o/e,h=n*s.y-l/2,h<=0&&(h=0),p=n-l-h,p<=0&&(p=0,h=n-l))}this.imageMask.style.borderLeftWidth=`${c}px`,this.imageMask.style.borderRightWidth=`${d}px`,this.imageMask.style.borderTopWidth=`${h}px`,this.imageMask.style.borderBottomWidth=`${p}px`}getClickCoordsLocal(e,t){const{width:i,height:s,top:o,left:n}=e.getBoundingClientRect(),r=o+document.body.scrollTop,a=n+document.body.scrollLeft;let l=Math.ceil(t.pageX-a)||1,c=Math.ceil(t.pageY-r)||1;return l<=0&&(l=1),c<=0&&(c=1),{x:l,y:c,xPercent:l/i,yPercent:c/s,width:i,height:s}}getCropTool(){return this._croptool}getElement(){return this._element}getForm(){return this._form}getImplicitFocus(){return this._implicitFocus}getPreviewCanvas(){return this.getPreviewContainer().querySelector("canvas")}getPreviewContainer(){return this.getElement().parentNode.querySelector(".ImageEditor-preview")}getRenditions(){const e={},t=["x","y","width","height","texts","textSizes","textXs","textYs","textWidths"],i=this.getElement().querySelector(".imageEditor-sizes table");return i&&i.querySelectorAll("th").forEach(i=>{const s=i.closest("tr"),o=s.getAttribute("data-size-group"),n=s.getAttribute("data-size-name"),r=s.getAttribute("data-display-name"),a=s.getAttribute("data-description"),l=parseFloat(s.getAttribute("data-size-width")),c=parseFloat(s.getAttribute("data-size-height"));let d="true"===s.getAttribute("data-size-independent"),h=l/c;0!==l&&0!==c||(h=0,d=!0);const p={};t.forEach(e=>{p[e]=s.querySelector(`input[name$='.${e}']`)});const u=this.getFocusCoords();e[n]={group:o,name:n,description:a,displayName:r,inputs:p,independent:d,width:l,height:c,aspectRatio:h,focusCrop:u}}),e}flattenAndSortRenditions(e){const t=new Map,i=t=>({name:t.name,cropRatio:t.group,sizeInfos:{[t.name]:{...e[t.name]}}});for(const s in e){const o=e[s];t.set(o.name,i(o))}return s=t,new Map(Array.from(s).sort((e,t)=>e[0]-t[0]));var s}hideCropUI(){this._croptool.clear()}showCropUI(){this._croptool.enable();const e=this.getCurrentRendition();e&&(e.current=!1,this.setCurrentRendition(e))}hideEditUI(){this.getElement().querySelector(".ImageEditor-editableArea").classList.add("is-hidden")}showEditUI(){this.getElement().querySelector(".ImageEditor-editableArea").classList.remove("is-hidden")}hideHotspotUI(){this.getElement().querySelector(".ImageEditor-hotspot-container").classList.add("is-hidden")}showHotspotUI(){this.getElement().querySelector(".ImageEditor-hotspot-container").classList.remove("is-hidden"),this._hotspotUI.reflow()}renderPreview(){this.getPreviewContainer().classList.add("is-hidden");const e=this._croptool.getCropBoxData();this._croptool.clear();const t=this._croptool.getCroppedCanvas();this._croptool.setCropBoxData(e);const i=this.getPreviewCanvas();i?this.getPreviewContainer().replaceChild(t,i):this.getPreviewContainer().appendChild(t)}renderRenditionPreviews(e){const t=(0,n.A)("ol",{class:"ImageEditor-sizeSelectors"}),i=e=>{const t=this.getCropTool(),i=(0,n.A)("div",{class:"imageEditor-sizePreview"});this.positionCrop(e);const s=t.getCroppedCanvas();return i.appendChild(s),i};e.forEach((e,s)=>{const o=(0,n.A)("li",{class:"imageEditor-sizeButton "+(e.current?"imageEditor-sizeSelected":""),onclick:t=>{t.preventDefault(),t.stopPropagation(),this.setCurrentRendition(e)}});o.setAttribute("data-group-name",e.sizeInfos[s].group),o.setAttribute("data-size-name",s),e.sizeInfos[s]&&e.sizeInfos[s].independent&&o.setAttribute("data-independent","true");const r=(0,n.A)("div",{className:"imageEditor-sizeLabel"},(a=e,a.sizeInfos[a.name].displayName??=""));var a;const l=(0,n.A)("div",{className:"ImageEditor-sizeContainer"});l.append(r);const c=(0,n.A)("div",{className:"ImageEditor-sizeDescription"});c.append(...(e=>{const t=new Map;for(const i in e.sizeInfos){let s=e.sizeInfos[i].description;s&&t.set(s,(0,n.A)("span",s))}return[...t.values()]})(e));const d=this.getElement().getAttribute("data-inherit"),h=this.getElement().getAttribute("data-override");e.cropRatio&&"independent"!==e.cropRatio&&(c.append((0,n.A)("span",{className:"is-inherit"},d+" "+e.cropRatio)),c.append((0,n.A)("span",{className:"is-override"},h+" "+e.cropRatio)));const p=(0,n.A)("a",{class:"ImageEditor-renditionResetButton",onclick:t=>{t.preventDefault(),t.stopPropagation(),e.current||this.setCurrentRendition(e),this.resetCropInputValues(this.getCurrentRendition()),this.resetRendition(this.getCurrentRendition())}},"Reset");o.append(l,c,i(e)),l.append(p),t.appendChild(o)});const s=this.getElement().querySelector(".ImageEditor-sizes");s&&s.appendChild(t)}renderTabs(){const e=this.getElement().querySelector(".imageEditor-aside"),t=this.getPreviewContainer().querySelector("img"),i=(0,n.A)("div",{class:"ImageEditor-editGroup",dataset:{tab:"Edit"}});"true"===this.getElement().getAttribute("editor")&&e.appendChild(i);const s=this.getElement().querySelector(".imageEditor-sizes");s&&(s.dataset.tab="Sizes",e.appendChild(s)),"true"===this.getElement().getAttribute("editor")?this._editUI=this.createEditUI(e,i,this._croptool,this._focusUI,()=>{this.updateAllRenditionPreviews()},()=>{this.repaint(document.body.offsetHeight)}):this.applyAllEdits(this.getEditValues());const o=!!this.getForm().querySelector('.inputContainer[data-name$=".hotspots"]');let r;o&&(r=(0,n.A)("div",{class:"ImageEditor-hotspots",dataset:{tab:"Hotspots"}}),e.appendChild(r)),this._hotspotUI=o?this.createHotspotUI(r,t.getAttribute("data-width"),t.getAttribute("data-height"),()=>{}):null;const a=new MutationObserver(e=>{for(const t of e)if("class"===t.attributeName){const e=t.target,i=e.dataset.tab;e.classList.contains("TC-unselected")?"Sizes"===i?this.hideCropUI():"Edit"===i?this.hideEditUI():"Hotspots"===i&&this.hideHotspotUI():"Sizes"===i?this.showCropUI():"Edit"===i?this.showEditUI():"Hotspots"===i&&this.showHotspotUI()}});a.observe(i,{attributes:!0}),s&&a.observe(s,{attributes:!0}),r&&a.observe(r,{attributes:!0}),new p.A(e)}updateRenditionPreview(e,t){const i=this.getRenditionElFromRendition(e),s=i.querySelector(".imageEditor-sizePreview canvas");i.querySelector(".imageEditor-sizePreview").replaceChild(t,s)}updateAllRenditionPreviews(){this._renditions.forEach(e=>{this.positionCrop(e);const t=this._croptool.getCroppedCanvas();this._croptool.clear(),this.updateRenditionPreview(e,t)})}setCropInputValues(e,t=null){const i=this._croptool.getCanvasData();let s=t||this._croptool.getCropBoxData(),{left:o,top:n,width:r,height:a}=s;o=0!==o?(o-i.left)/i.width:0,n=0!==n?(n-i.top)/i.height:0,r/=i.width,a/=i.height,s={x:o,y:n,width:r,height:a};for(const t in e.sizeInfos)for(const i in s){const o=e.sizeInfos[t].inputs[i];o.value=s[i],o.removeAttribute("disabled")}}getCropInputValues(e){const t=["x","y","width","height"];let i={};for(const s in e.sizeInfos)t.forEach(t=>{Object.assign(i,{[t]:e.sizeInfos[s].inputs[t].value})});return i}resetCropInputValues(e){this.setCropInputValues(e,{left:0,top:0,width:0,height:0})}resetRendition(e){delete e.modifiedCropData,this.getRenditionElFromRendition(e).classList.remove("ImageEditor-sizeModified"),this.hideRenditionResetButton(e),this.applyRenditionCrop(e)}resetAllRenditionPreviews(){this.getCurrentRendition()&&this.unsetCurrentRendition(this.getCurrentRendition()),this._renditions.forEach(e=>{this.resetCropInputValues(e),delete e.modifiedCropData,this.getRenditionElFromRendition(e).classList.remove("ImageEditor-sizeModified")})}showRenditionResetButton(e){this.getRenditionElFromRendition(e)?.querySelector(":scope .ImageEditor-renditionResetButton")?.classList.add("is-visible")}hideRenditionResetButton(e){this.getRenditionElFromRendition(e)?.querySelector(":scope .ImageEditor-renditionResetButton")?.classList.remove("is-visible")}getRenditionElFromRendition(e){const t=e.name;return this.getElement().querySelector(`.imageEditor-sizeButton[data-size-name='${t}']`)}getIsCropCentered(){return"true"===this.getElement().querySelector(".imageEditor-sizes table").getAttribute("data-crop-center")}getCurrentRendition(){let e=null;return this._renditions.forEach(t=>{t.current&&(e=t)}),e}toggleRendition(e){this.unsetCurrentRendition(e),this._focusUI&&this._focusUI.enable(),this.positionCrop(e);const t=this._croptool.getCroppedCanvas();this._croptool.clear(),this.updateRenditionPreview(e,t)}unsetCurrentRendition(e){this.getRenditionElFromRendition(e).classList.remove("imageEditor-sizeSelected"),e.current=!1}setCurrentRendition(e){e.current?this.toggleRendition(e):(this._renditions.forEach(e=>{e.current&&(this.unsetCurrentRendition(e),this.toggleRendition(e))}),e.current=!0,this.applyRenditionCrop(e))}applyRenditionCrop(e){const t=this.getRenditionElFromRendition(e);t&&(t.classList.add("imageEditor-sizeSelected"),this.positionCrop(e))}positionCrop(e){let t,i,s=this.getCropInputValues(e);const o=this._croptool.getCanvasData();this._focusUI&&(i=this._focusUI.getFocusCoordinatesRelative(e.cropRatio));for(const i in e.sizeInfos)t=e.sizeInfos[i].aspectRatio;if(this._croptool.crop(),this._croptool.setAspectRatio(t),this.getIsCropCentered()||this.getCropTool().setCropBoxData({left:0,top:0}),parseFloat(s.width)&&parseFloat(s.height)){this.getRenditionElFromRendition(e)&&this.showRenditionResetButton(e);const t=o.width*s.x+o.left,i=o.height*s.y+o.top,n=o.width*s.width,r=o.height*s.height;this._croptool.setCropBoxData({left:t,top:i,width:n,height:r})}else if(i){const t=this._croptool.getCanvasData(),s=this._croptool.getCropBoxData(),o={left:t.width*i.x-s.width/2+t.left,top:t.height*i.y-s.height/2+t.top,width:s.width,height:s.height};this._croptool.setCropBoxData(o);for(const t in e.sizeInfos)e.sizeInfos[t].focusCrop=o}}}(0,d.A)(".imageEditor",e=>{new y(e)}),(0,d.A)(".ImageEditor .TabBar-item",e=>{e.addEventListener("keydown",t=>{"Tab"===t.key&&t.shiftKey&&(t.preventDefault(),e.closest(".ImageEditor")?.querySelector(".ImageEditor-resetButton")?.focus())})}),s()}catch(e){s(e)}},1)},73609(e,t,i){i.d(t,{A:()=>d}),i(67219),i(44764),i(84978),i(13722),i(39589),i(25809);var s=i(1439),o=i.n(s),n=i(5292);if(7717==i.j)var r=i(26594);if(7717==i.j)var a=i(40627);if(7717==i.j)var l=i(95628);var c=i(66556);class d{constructor(e){this._container=e,this._update=(0,r.A)(this._update.bind(this)),this._update(),window.addEventListener("brightspot-content-state-change",()=>{this._toggle()})}_forEachChild(e){for(const t of this._container.children){const i=t.dataset.tab;void 0!==i&&e(i,t)}}_toArray(e){if(e)try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{}return[]}_update(){this._observer&&(this._observer.disconnect(),this._observer=null);const e=(0,n.A)("div",{className:"TabBar",role:"tablist"}),t=(0,n.A)("button",{className:"TabBar-menuToggle",title:window.BRIGHTSPOT?.ui.tooltips.tabs,type:"button","aria-haspopup":"menu","aria-expanded":"false","aria-label":window.BRIGHTSPOT?.ui.tooltips.tabs}),i=(0,n.A)("div",{className:"TabBar-menuList",role:"menu","aria-label":window.BRIGHTSPOT?.ui.tooltips.tabs}),s=(0,n.A)("div",{className:"TabBar-menu"},t,i);t.onclick=()=>{(0,c.AM)(i,t,e)};const o="MENU"===this._container.dataset.tcMode,r=this._container.dataset.tcMain,d=this._toArray(this._container.dataset.tcExceptions),h=new Set;this._defaultTab=null;for(const e of this._container.children){const t=e.dataset.tab;void 0!==t&&(h.has(t)||(this._defaultTab||(this._defaultTab=t),h.add(t)))}const p=this._toArray(this._container.dataset.tcStart),u=this._toArray(this._container.dataset.tcEnd),g=[];for(const e of p)h.has(e)&&g.push(e);for(const e of h)p.includes(e)||u.includes(e)||g.push(e);for(const e of u)h.has(e)&&g.push(e);for(const t of g){const s=d.indexOf(t)>-1?o?e:i:o?i:e;s.insertBefore((0,n.A)("button",{className:"TabBar-item",dataset:{tab:t},role:"tab",onclick:e=>{e.preventDefault(),this.select(t,e)},onkeydown:e=>{var t=e.currentTarget,i=t.closest(".TabBar");switch(e.key){case"ArrowRight":return void(t.nextSibling?t.nextSibling.focus():i.firstChild.focus());case"ArrowLeft":return void(t.previousSibling?t.previousSibling.focus():i.lastChild.focus())}}},t),t===r?s.firstChild:null)}g.includes(r)&&(this._defaultTab=r),1===e.children.length&&i.insertBefore(e.children[0],i.firstChild);for(const e of i.children)e.className="TabBar-menuItem",e.setAttribute("role","menuitem");if((0,c.D1)(i,t),this._bar&&(this._bar.remove(),this._bar=null,this._menu=null,this._menuToggle=null,this._menuList=null),0===g.length||g.length<2&&!this._container.getAttribute("data-show-tabs")){this._container.dataset.tabless="true";const e=this._container.querySelectorAll(":scope > .TC-unselected");return void Array.from(e).forEach(e=>{e.classList.remove("TC-unselected")})}this._bar=e,this._container.insertBefore(e,this._container.firstChild),i.children.length>0&&(0===e.children.length&&(e.classList.add("is-menuOnly"),e.removeAttribute("role")),this._menu=s,this._menuToggle=t,this._menuList=i,this._bar.appendChild(s));const m=this._toggle();m.includes(this._defaultTab)||(this._defaultTab=m[0]),e.hidden=1===Array.from(i.children).filter(e=>!e.hidden).length;let f=!1;for(const e of(0,a.A)(this._container,".CIG-row > .Message.is-error")){let t,i=e;do{t=i,i=t.parentNode}while(i!==this._container);const s=(0,l.A)(this._bar,`[data-tab="${t.dataset.tab}"]`);s&&!s.classList.contains("is-error")&&(s.classList.add("is-error"),s.classList.contains("TabBar-menuItem")&&(f=!0))}f&&e.classList.add("is-menuError"),this.select()}_toggle(){const e=[];this._forEachChild((t,i)=>{i.hidden||i instanceof HTMLHeadingElement||e.push(t)});for(const t of[this._bar,this._menuList])if(t)for(const i of t.children)i!==this._menu&&(i.hidden=!e.includes(i.dataset.tab));return e}select(e,t){const i=e&&this._container.closest(".ContentEdit.is-new, .StandardForm.is-new");if(e||(e=this._defaultTab),this._bar&&!this._bar.classList.contains("is-menuOnly"))for(const t of this._bar.children){const i=t.dataset.tab===e;t.classList.toggle("is-selected",i),t.setAttribute("aria-selected",i),i?t.removeAttribute("tabindex"):t.setAttribute("tabindex","-1")}if(this._menuList){let t=!1;for(const i of this._menuList.children)i.classList.toggle("is-selected",i.dataset.tab===e)&&(t=e!==this._defaultTab);this._bar.classList.toggle("is-menuSelected",t),this._menuToggle.innerText=t?e:""}if(this._forEachChild((t,i)=>{i.classList.toggle("TC-unselected",t!==e)}),window.dispatchEvent(new Event("resize")),o()(this._container).find("> [data-tab]").trigger("tabbedShow"),o()(this._bar).trigger("tabbed-select"),i){const t=this._container.querySelector(`:scope > .CIG-row:not(.inputContainer-readOnly)[data-tab="${e}"] > .CIG-label > label`)?.htmlFor;t&&document.getElementById(t)?.focus()}else t&&t.target.scrollIntoView({block:"nearest"})}}},9216(e,t,i){i.d(t,{A:()=>d}),i(86634),i(57573),i(49371),i(42723),i(26780),i(96648);var s=i(88630),o=i.n(s),n=i(18101);if(3324==i.j)var r=i(39403);if(3324==i.j)var a=i(76394);if(3324==i.j)var l=i(60021);var c=i(79365);class d{constructor(e){this._container=e,this._update=(0,r.A)(this._update.bind(this)),this._update(),window.addEventListener("brightspot-content-state-change",()=>{this._toggle()})}_forEachChild(e){for(const t of this._container.children){const i=t.dataset.tab;void 0!==i&&e(i,t)}}_toArray(e){if(e)try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{}return[]}_update(){this._observer&&(this._observer.disconnect(),this._observer=null);const e=(0,n.A)("div",{className:"TabBar",role:"tablist"}),t=(0,n.A)("button",{className:"TabBar-menuToggle",title:window.BRIGHTSPOT?.ui.tooltips.tabs,type:"button","aria-haspopup":"menu","aria-expanded":"false","aria-label":window.BRIGHTSPOT?.ui.tooltips.tabs}),i=(0,n.A)("div",{className:"TabBar-menuList",role:"menu","aria-label":window.BRIGHTSPOT?.ui.tooltips.tabs}),s=(0,n.A)("div",{className:"TabBar-menu"},t,i);t.onclick=()=>{(0,c.AM)(i,t,e)};const o="MENU"===this._container.dataset.tcMode,r=this._container.dataset.tcMain,d=this._toArray(this._container.dataset.tcExceptions),h=new Set;this._defaultTab=null;for(const e of this._container.children){const t=e.dataset.tab;void 0!==t&&(h.has(t)||(this._defaultTab||(this._defaultTab=t),h.add(t)))}const p=this._toArray(this._container.dataset.tcStart),u=this._toArray(this._container.dataset.tcEnd),g=[];for(const e of p)h.has(e)&&g.push(e);for(const e of h)p.includes(e)||u.includes(e)||g.push(e);for(const e of u)h.has(e)&&g.push(e);for(const t of g){const s=d.indexOf(t)>-1?o?e:i:o?i:e;s.insertBefore((0,n.A)("button",{className:"TabBar-item",dataset:{tab:t},role:"tab",onclick:e=>{e.preventDefault(),this.select(t,e)},onkeydown:e=>{var t=e.currentTarget,i=t.closest(".TabBar");switch(e.key){case"ArrowRight":return void(t.nextSibling?t.nextSibling.focus():i.firstChild.focus());case"ArrowLeft":return void(t.previousSibling?t.previousSibling.focus():i.lastChild.focus())}}},t),t===r?s.firstChild:null)}g.includes(r)&&(this._defaultTab=r),1===e.children.length&&i.insertBefore(e.children[0],i.firstChild);for(const e of i.children)e.className="TabBar-menuItem",e.setAttribute("role","menuitem");if((0,c.D1)(i,t),this._bar&&(this._bar.remove(),this._bar=null,this._menu=null,this._menuToggle=null,this._menuList=null),0===g.length||g.length<2&&!this._container.getAttribute("data-show-tabs")){this._container.dataset.tabless="true";const e=this._container.querySelectorAll(":scope > .TC-unselected");return void Array.from(e).forEach(e=>{e.classList.remove("TC-unselected")})}this._bar=e,this._container.insertBefore(e,this._container.firstChild),i.children.length>0&&(0===e.children.length&&(e.classList.add("is-menuOnly"),e.removeAttribute("role")),this._menu=s,this._menuToggle=t,this._menuList=i,this._bar.appendChild(s));const m=this._toggle();m.includes(this._defaultTab)||(this._defaultTab=m[0]),e.hidden=1===Array.from(i.children).filter(e=>!e.hidden).length;let f=!1;for(const e of(0,a.A)(this._container,".CIG-row > .Message.is-error")){let t,i=e;do{t=i,i=t.parentNode}while(i!==this._container);const s=(0,l.A)(this._bar,`[data-tab="${t.dataset.tab}"]`);s&&!s.classList.contains("is-error")&&(s.classList.add("is-error"),s.classList.contains("TabBar-menuItem")&&(f=!0))}f&&e.classList.add("is-menuError"),this.select()}_toggle(){const e=[];this._forEachChild((t,i)=>{i.hidden||i instanceof HTMLHeadingElement||e.push(t)});for(const t of[this._bar,this._menuList])if(t)for(const i of t.children)i!==this._menu&&(i.hidden=!e.includes(i.dataset.tab));return e}select(e,t){const i=e&&this._container.closest(".ContentEdit.is-new, .StandardForm.is-new");if(e||(e=this._defaultTab),this._bar&&!this._bar.classList.contains("is-menuOnly"))for(const t of this._bar.children){const i=t.dataset.tab===e;t.classList.toggle("is-selected",i),t.setAttribute("aria-selected",i),i?t.removeAttribute("tabindex"):t.setAttribute("tabindex","-1")}if(this._menuList){let t=!1;for(const i of this._menuList.children)i.classList.toggle("is-selected",i.dataset.tab===e)&&(t=e!==this._defaultTab);this._bar.classList.toggle("is-menuSelected",t),this._menuToggle.innerText=t?e:""}if(this._forEachChild((t,i)=>{i.classList.toggle("TC-unselected",t!==e)}),window.dispatchEvent(new Event("resize")),o()(this._container).find("> [data-tab]").trigger("tabbedShow"),o()(this._bar).trigger("tabbed-select"),i){const t=this._container.querySelector(`:scope > .CIG-row:not(.inputContainer-readOnly)[data-tab="${e}"] > .CIG-label > label`)?.htmlFor;t&&document.getElementById(t)?.focus()}else t&&t.target.scrollIntoView({block:"nearest"})}}},36711(e,t,i){i.d(t,{A:()=>s.A});var s=i(22274)},23902(e,t,i){i.d(t,{A:()=>s.A});var s=i(35083)},85313(e,t,i){function s(){let e=1,t=1;const i=[];for(let e=0;e<256;++e)i.push(Math.random());return{getVal:function(s){const o=s*t,n=Math.floor(o),r=o-n,a=r*r*(3-2*r),l=255&n,c=l+1&255;return function(e,t,i){return e*(1-i)+t*i}(i[l],i[c],a)*e},setAmplitude:function(t){e=t},setScale:function(e){t=e}}}i.d(t,{A:()=>s}),i(44764),Object.defineProperty(s,"name",{value:"default",configurable:!0})},78578(e,t,i){function s(){let e=1,t=1;const i=[];for(let e=0;e<256;++e)i.push(Math.random());return{getVal:function(s){const o=s*t,n=Math.floor(o),r=o-n,a=r*r*(3-2*r),l=255&n,c=l+1&255;return function(e,t,i){return e*(1-i)+t*i}(i[l],i[c],a)*e},setAmplitude:function(t){e=t},setScale:function(e){t=e}}}i.d(t,{A:()=>s}),i(57573),Object.defineProperty(s,"name",{value:"default",configurable:!0})}}]);
|
|
1
|
+
"use strict";(self.webpackChunkbrightspot_cms=self.webpackChunkbrightspot_cms||[]).push([[5857],{21527(e){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC"},8718(e){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC"},14932(e,t,i){function s(e,t){return e?(Array.isArray(t)&&(t=t.join(",")),e.closest(t)):null}i.d(t,{A:()=>s}),Object.defineProperty(s,"name",{value:"default",configurable:!0})},27741(e,t,i){function s(e,t){return e?(Array.isArray(t)&&(t=t.join(",")),e.closest(t)):null}i.d(t,{A:()=>s}),Object.defineProperty(s,"name",{value:"default",configurable:!0})},40627(e,t,i){function s(e,t){return e?(Array.isArray(t)&&(t=t.join(",")),e.querySelectorAll(t)):[]}i.d(t,{A:()=>s}),Object.defineProperty(s,"name",{value:"default",configurable:!0})},76394(e,t,i){function s(e,t){return e?(Array.isArray(t)&&(t=t.join(",")),e.querySelectorAll(t)):[]}i.d(t,{A:()=>s}),Object.defineProperty(s,"name",{value:"default",configurable:!0})},22274(e,t,i){i.d(t,{A:()=>o});let s=!1;function o(e,t){const i=new MutationObserver(o=>{for(const n of o)for(const o of n.removedNodes)o.contains(e)&&!s&&(i.disconnect(),t())});i.observe(document,{childList:!0,subtree:!0})}o.pause=()=>{s=!0},o.resume=()=>{s=!1}},35083(e,t,i){i.d(t,{A:()=>o});let s=!1;function o(e,t){const i=new MutationObserver(o=>{for(const n of o)for(const o of n.removedNodes)o.contains(e)&&!s&&(i.disconnect(),t())});i.observe(document,{childList:!0,subtree:!0})}o.pause=()=>{s=!0},o.resume=()=>{s=!1}},5603(e,t,i){i.a(e,async(e,s)=>{try{i.r(t),i.d(t,{default:()=>y}),i(84978),i(13722),i(25809),i(75178);var o=i(14932),n=i(5292),r=i(94622),a=i.n(r),l=i(95628),c=i(85313),d=i(32246),h=i(22127),p=i(73609),u=i(40627),g=i(66556),m=(i(7466),i(36711));window.BRIGHTSPOT?.ui.cms.enableV5UI||await i.e(8934).then(i.bind(i,98934));const e=window.BRIGHTSPOT?.ui.tooltips,f="400",v=40,E=new Map,b=".cropper-canvas > img, .cropper-view-box > img, .imageEditor-sizePreview";class y{constructor(t){const i="is-imageEditorOpen",s="is-imageEditorLoading",r="is-imageEditorReady",a=(0,o.A)(t,".inputContainer"),c=(0,l.A)(a,".fileSelector"),d=t.parentNode,h=(0,l.A)(t,".imageEditor-image > img"),p=t.closest(".RCIG-item");if(!d||!h)return;this._element=t,this._renditions=new Map,this._focusUI=null,this._editUI=null,this._initialContainerHeight=null,this._form=this._element.closest("form"),this._implicitFocus=t.dataset.implicitFocus,this._isContextual="contextual"in t.dataset,this._element.setAttribute("hidden","");let v=d;for(;v.parentElement?.closest(".CIG-row");)v=v.parentElement?.closest(".CIG-row");const E=this.getForm().querySelector('.inputContainer[data-name$=".hotspots"]');E&&(E.style.display="none"),new ResizeObserver(e=>{for(let t of e)this.repaint(t.contentRect.height)}).observe(document.body);const b=(0,n.A)("div",{className:"ImageEditor-preview-loader"}),y=h.cloneNode();y.onload=()=>{d.classList.add("is-imagePreview"),d.classList.add(s),this.getElement().classList.add(s),b.style.width=`${y.offsetWidth}px`,b.style.height=`${y.offsetHeight}px`};const A=e=>{"Escape"===e.key&&this._element.querySelector(".ImageEditor-closeButton")?.click()},C=(0,n.A)("button",{className:"true"===this.getElement().getAttribute("editor")?"ImageEditor-open":"ImageEditor-open noEditor","aria-haspopup":!0,"aria-label":e.imageEditor.open,title:e.imageEditor.open,type:"button",onclick:e=>{this._element.removeAttribute("hidden"),d.classList.add(i),v.style.zIndex=f;const t=this.getElement().closest(".ContentEdit-left");t&&(t.style.position="fixed",t.style.zIndex=f),d.classList.contains(r)||(d.classList.add(r),this._initialContainerHeight=this.getElement().offsetHeight,this._renditions=this.flattenAndSortRenditions(this.getRenditions()),this.renderRenditionPreviews(this._renditions),this.renderTabs()),p&&p.classList.add(i),this._element.querySelector(".ImageEditor-edit button")?.focus(),window.addEventListener("keydown",A),setTimeout(()=>{this.repaint(document.body.offsetHeight),this._hotspotUI&&(this._hotspotUI.reflow(),this._hotspotUI.reveal())},250)}}),I=(0,l.A)(this.getElement(),".imageEditor-aside"),_=(0,l.A)(I,".imageEditor-tools ul");_.classList.add("ImageEditor-editTools"),_.setAttribute("role","menu");const w=(0,n.A)("button",{className:"ImageEditor-editToggle",type:"button",title:e.imageEditor.actions,"aria-label":e.imageEditor.actions,"aria-haspopup":"menu","aria-expanded":!1,onclick:e=>{(0,g.AM)(_,w)}});(0,g.D1)(_,w);const P=(0,l.A)(this.getElement(),".ImageEditor-groups");P&&(m.A.pause(),d.appendChild(P),requestAnimationFrame(m.A.resume));const R=this.getElement().getAttribute("data-focus-message"),S=(0,n.A)("div",{className:"ImageEditor-focusMessage"},R),x=(0,n.A)("span",{className:"ImageEditor-implicitMessage is-hidden"},this.getElement().dataset.implicitFocusMessage),L=function(e){S.textContent=R+" "+e,S.classList.remove("is-hidden")};this._cropSelect=d.querySelector(".ImageEditor-groups > select"),this._cropSelect&&this._cropSelect.addEventListener("change",e=>{const t=this._cropSelect.selectedIndex,i=this._cropSelect.options[t];S.classList.remove("is-hidden"),L(i.textContent);let s=this._focusUI.getFocusCoordinatesRelative(i.value);const o=(0,l.A)(d,".ImageEditor-focus-point");if(s){const e=this.getFocusCoords(i.value);null!==e.xPercent&&null!==e.yPercent?(o&&o.classList.remove("is-implicit"),x.classList.add("is-hidden")):this.getImplicitFocus()&&(o&&o.classList.add("is-implicit"),o&&o.classList.remove("is-hidden"),x.classList.remove("is-hidden")),o&&o.classList.remove("is-hidden"),this._focusUI.moveTo(s)}else if(this.getImplicitFocus()){const e=this.getImplicitFocus().split(",");s={x:e[0],xPercent:100*e[0],y:e[1],yPercent:100*e[1]},x.classList.remove("is-hidden"),o&&o.classList.add("is-implicit"),this._focusUI.moveTo(s)}else o&&o.classList.add("is-hidden");this.showPreview()}),c&&(0,l.A)(c,"select").addEventListener("change",e=>{C.style.display="keep"===e.target.value?"":"none",w.style.display="keep"===e.target.value?"":"none"}),d.insertBefore((0,n.A)("div",{className:"ImageEditor-preview"},y,b),t),d.append(C,w,_);const q=(0,n.A)("button",{className:"ImageEditor-closeButton",name:"action-done",onclick:e=>{v.style.zIndex="auto";const t=this.getElement().closest(".ContentEdit-left");t&&(t.style.position="initial",t.style.zIndex="auto"),this._element.setAttribute("hidden",""),this.renderPreview(),this._focusUI&&this.showPreview(),d.classList.remove(i),p&&p.classList.remove(i),C.focus(),window.removeEventListener("keydown",A),e.preventDefault()}},"Done");this.getElement().appendChild((0,n.A)("div",{className:"ActionBar"},q));const F=e=>{const{brightness:t,contrast:i,invert:s,grayscale:o,sepia:n,flipH:r,flipV:a,rotate:l}={...e};this.applyFilter("brightness",`${this.convertValueToPercent(t)}%`),this.applyFilter("contrast",`${this.convertValueToPercent(i)}%`),this.applyFilter("sepia",n?"100%":null),this.applyFilter("invert",s?"100%":null),this.applyFilter("grayscale",o?"100%":null),r?this._croptool.scale(-1,a?-1:1):this._croptool.scale(1,a?-1:1),a?this._croptool.scale(r?-1:1,-1):this._croptool.scale(r?-1:1,1),l&&this._croptool.rotateTo(l)},T=()=>{const e=(0,u.A)(this._cropSelect,'option:not([value=""])'),t=Object.values(this.getRenditions());if(e.forEach(e=>{const i=t.filter(t=>t.group===e.value&&0!==t.aspectRatio);if(i.length>0){const t=i.reduce((e,t)=>e+t.aspectRatio,0)/i.length;e.setAttribute("data-preview-ratio",t)}else this._cropSelect.removeChild(e)}),1===this._cropSelect.children.length){const e=(0,l.A)(P,".ComboInput");e&&(e.style.display="none")}},k=e=>{this.initCropTool(e).then(e=>{if(this.getElement().classList.remove(s),d.classList.remove(s),d.classList.add("is-imageEditorLoaded"),F(this.getEditValues()),this.renderPreview(),x&&d.appendChild(x),this._cropSelect){S&&d.appendChild(S);const e=this._cropSelect.selectedIndex,t=this._cropSelect.options[e];L(t.textContent),this.imageMask=(0,n.A)("div",{className:"ImageEditor-preview-border"}),d.querySelector(".ImageEditor-preview").append(this.imageMask),this._focusUI=this.createFocusUI(d,()=>{this.updateAllRenditionPreviews()}),T(),this.showPreview()}})};h.complete?k(h):h.onload=e=>{k(h)}}applyFilter(e,t){let i="";const s=[...this.getElement().querySelectorAll(b),this.getPreviewContainer()];t?E.set(e,t):E.delete(e),E.forEach((e,t)=>{i+=` ${t}(${e}) `}),s.forEach(e=>e.style.filter=`${i.trim()}`)}convertValueToPercent(e){let t=parseFloat(e);return t=100*t+100,t}async initCropTool(e){await new Promise((t,i)=>{this._croptool=new(a())(e,{autoCrop:!1,autoCropArea:1,movable:!1,restore:!1,responsive:!0,scalable:!0,toggleDragModeOnDblclick:!1,viewMode:1,zoomable:!1,zoomOnTouch:!1,zoomOnWheel:!1,minContainerHeight:-1,minContainerWidth:-1,ready:e=>{t()},crop:e=>{const t=this.getCurrentRendition();t&&this.updateRenditionPreview(t,this._croptool.getCroppedCanvas())},cropend:e=>{const t=this.getCurrentRendition(),i=this._croptool.getCropBoxData();t&&(t.modifiedCropData=i,this.showRenditionResetButton(t),this.getRenditionElFromRendition(t).classList.add("ImageEditor-sizeModified"),this.setCropInputValues(t))}})})}repaint(e){const t=this.getElement().querySelector(".ImageEditor-main"),i=e-document.querySelector(".Page-header").offsetHeight,s=t.getBoundingClientRect().width;window.dispatchEvent(new Event("resize")),i===this._croptool?.getCanvasData().height&&this._croptool.setCanvasData({top:this._croptool.getCanvasData().top+24,left:this._croptool.getCanvasData().left+24,height:this._croptool.getCanvasData().height-48}),s===this._croptool?.getCanvasData().width&&this._croptool.setCanvasData({top:this._croptool.getCanvasData().top+24,left:this._croptool.getCanvasData().left+24,width:this._croptool.getCanvasData().width-48}),this.updateAllRenditionPreviews()}getFocusCoords(e){let t,i;if(this._cropSelect){const t=this._cropSelect.selectedIndex;e||(e=this._cropSelect.options[t].value)}return e&&""!==e&&"independent"!==e?(t=this.getElement().querySelector('input[name$=".focusX.'+e+'"]'),i=this.getElement().querySelector('input[name$=".focusY.'+e+'"]'),""!==t.value&&""!==i.value||(t=this.getElement().querySelector('input[name$=".focusX"]'),i=this.getElement().querySelector('input[name$=".focusY"]'))):(t=this.getElement().querySelector('input[name$=".focusX"]'),i=this.getElement().querySelector('input[name$=".focusY"]')),{xPercent:""!==t.value?100*t.value:null,yPercent:""!==i.value?100*i.value:null}}getDefaults(){let e={brightness:0,contrast:0,flipH:!1,flipV:!1,grayscale:!1,invert:!1,rotate:"0",sepia:!1,"no-filter":!0};if(!this._isContextual)return e;let t=this._element.dataset.defaultEdits;if(!t)return e;const i=JSON.parse(t),{grayscale:s,sepia:o,invert:n}=i;return(s||o||n)&&(i["no-filter"]=!1),e=Object.assign(e,i),e}getEditValues(){const e=this.getElement().getAttribute("editor");return[..."true"===e?this.getElement().querySelectorAll(".ImageEditor-edit input[name]"):Object.entries(JSON.parse(this.getElement().getAttribute("edits")))].reduce((t,i)=>{if("true"===e){const e=i.name.substring(i.name.lastIndexOf(".")+1);Object.assign(t,{[e]:"checkbox"===i.type?i.checked:i.value})}else{const e=i[0];Object.assign(t,{[e]:i[1]})}return t},{})}createHotspotUI(e,t,i,s){let o=!1;const r=this.getForm().querySelector('.inputContainer[data-name$=".hotspots"]');if(!r)return;r.style.display="block";const a=(0,n.A)("div",{class:"ImageEditor-hotspot-container",onclick:e=>{e.preventDefault()}}),l=(0,n.A)("div",{class:"ImageEditor-hotspotableArea",onclick:e=>{if(!a.classList.contains("is-hidden")){const t=this.getClickCoordsLocal(e.target,e);t.xPercent*=100,t.yPercent*=100}}});a.appendChild(l),this.getElement().querySelector(".ImageEditor-main").appendChild(a),e.append(r),(0,d.A)(e,".ImageEditor-hotspot-item",e=>{new MutationObserver(t=>{t.forEach(t=>{t.target.classList.contains("is-removing")?u(e):g(e)})}).observe(e,{attributeFilter:["class"]})});const p=()=>{e.querySelectorAll(".ImageEditor-hotspot-item").forEach(e=>{const t=v/2,{x:i,y:s}=l.getBoundingClientRect(),o=l.offsetWidth,n=l.offsetHeight,r=e.draggableRef,{x:a,y:c}=m(e),{xPercent:d,yPercent:h}=f({x:a,y:c}),p=o*(d/100),u=n*(h/100);r.position(),r.left=p+i-t,r.top=u+s-t}),window.dispatchEvent(new Event("resize"))},u=e=>{e.hotspotRefEl.classList.add("is-removing")},g=e=>{e.hotspotRefEl.classList.remove("is-removing")},m=e=>({x:e.querySelector('input[name$="cms.image.x"]').value,y:e.querySelector('input[name$="cms.image.y"]').value}),f=({x:e,y:s})=>({xPercent:e/t*100,yPercent:s/i*100});new MutationObserver(e=>{for(const t of e)"style"===t.attributeName&&E(t.target)}).observe(this.getElement().querySelector(".cropper-canvas"),{attributes:!0});const E=e=>{l.style.height=`${e.offsetHeight}px`,l.style.width=`${e.offsetWidth}px`,l.style.transform=e.style.transform,p()};return E(this.getElement().querySelector(".cropper-canvas")),(()=>{let s=null;const r=(e,s)=>{const o=e.parentNode.getBoundingClientRect();let n=s.left-o.left,r=s.top-o.top;n+=e.offsetWidth/2,r+=e.offsetHeight/2,((e,t)=>{const i=e.querySelector('input[name$="/cms.image.x"]'),s=e.querySelector('input[name$="/cms.image.y"]');i.value=t.x,s.value=t.y,i.dispatchEvent(new Event("change",{bubbles:!0})),s.dispatchEvent(new Event("change",{bubbles:!0}))})(e.itemRefEl,(({x:e,y:s})=>{const o=l.offsetWidth/t,n=l.offsetHeight/i;return{x:e=parseInt(e/o),y:s=parseInt(s/n)}})({x:n,y:r}))};(0,d.A)(e,".RCIG-item[data-hotspot-point]",e=>{const{x:t,y:i}=m(e);(e=>{e.parentNode.querySelectorAll(".ImageEditor-hotspot-item:not(.collapsed):not(.is-collapsed)").forEach(e=>{e.classList.add("is-collapsed"),e.classList.add("collapsed")})})(e),setTimeout(()=>{e.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},100),e.classList.add("ImageEditor-hotspot-item"),e.hotspotRefEl=(({item:e,x:t,y:i,label:a})=>{const d=(0,n.A)("div",{className:"ImageEditor-hotspot",onclick:e=>{(e=>{const t=e.itemRefEl;e.classList.remove("is-added"),t.classList.contains("is-collapsed")&&t.querySelector(":scope .repeatableLabel")?.click(),setTimeout(()=>{t.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},100),s=e})(e.target)},onmouseenter:e=>{o||(e.target.classList.remove("is-added"),e.target.classList.add("is-hovered"),e.target.itemRefEl.classList.add("is-hovered"),e.preventDefault(),e.stopPropagation())},onmouseleave:e=>{o||(e.target.classList.remove("is-hovered"),e.target.itemRefEl.classList.remove("is-hovered"),e.preventDefault(),e.stopPropagation())}});d.innerHTML=a,d.itemRefEl=e,l.appendChild(d);const u=new h.A(d,{leftTop:!1,containment:l});if(h.A.draggableClass="is-draggable",h.A.draggingClass="is-dragging",h.A.movingClass="is-moving",u.onMove=e=>{l.classList.add("is-dragging"),o=!0},u.onDragEnd=e=>{o=!1,l.classList.remove("is-dragging"),r(d,e)},e.draggableRef=u,""===t&&""===i){const e=new c.A,t=.3,i=Math.random()<.5?-1:1,s=Math.random()<.5?-1:1,o=d.parentNode.getBoundingClientRect(),n=o.left+o.width/2,a=o.top+o.height/2,l=n+i*(v*e.getVal(i*t)),h=a+s*(v*e.getVal(s*t));r(d,{left:l,top:h}),p(),d.classList.add("is-added")}return d})({item:e,x:t,y:i,label:Array.from(e.parentElement.children).indexOf(e)+1}),e.onmouseenter=e=>{e.target.hotspotRefEl.classList.remove("is-added"),e.target.hotspotRefEl.classList.add("is-hovered"),e.preventDefault(),e.stopPropagation()},e.onmouseleave=e=>{e.target.hotspotRefEl.classList.remove("is-hovered"),e.preventDefault(),e.stopPropagation()}})})(),l.querySelectorAll(".ImageEditor-hotspot").forEach(e=>{e.classList.add("is-hidden")}),s(),{reflow:p,reveal:()=>{e.querySelectorAll(".ImageEditor-hotspot-item").forEach(e=>{e.hotspotRefEl.classList.remove("is-hidden")})}}}createFocusUI(t,i){const s=(0,n.A)("div",{className:"ImageEditor-focus-point",title:e.imageEditor.focus});let o=this.getElement().querySelector('input[name$=".focusX"]').value,r=this.getElement().querySelector('input[name$=".focusY"]').value;if(!o&&!r&&this.getImplicitFocus()){const e=this.getImplicitFocus().split(",");o=e[0],r=e[1],s.classList.add("is-implicit"),t.querySelector(".ImageEditor-implicitMessage").classList.remove("is-hidden")}const a=()=>{this._cropSelect.querySelectorAll('option:not([value=""])').forEach(e=>{const t=this.getElement().querySelector('input[name$=".focusX.'+e.value+'"]'),i=this.getElement().querySelector('input[name$=".focusY.'+e.value+'"]');t&&i&&(t.value="",i.value="")})},c=({xPercent:e,yPercent:t})=>{const i=this._cropSelect.selectedIndex,s=this._cropSelect.options[i],o=""===s.value?this.getElement().querySelector('input[name$=".focusX"]'):this.getElement().querySelector('input[name$=".focusX.'+s.value+'"]'),n=""===s.value?this.getElement().querySelector('input[name$=".focusY"]'):this.getElement().querySelector('input[name$=".focusY.'+s.value+'"]'),r=h({xPercent:e,yPercent:t});o.value=r.xPercent/100,n.value=r.yPercent/100,""===s.value&&a(),o.dispatchEvent(new Event("change",{bubbles:!0})),n.dispatchEvent(new Event("change",{bubbles:!0}))},d=({xPercent:e,yPercent:i})=>{(0,l.A)(t,".ImageEditor-focus-point")||t.append(s),s.classList.remove("is-hidden"),((e,t)=>{s.style.left=`${e}%`,s.style.top=`${t}%`})(e,i)},h=({xPercent:e,yPercent:t})=>{let i={};if(""===e&&""===t)return null;const{rotate:s,scaleX:o,scaleY:n}=this._croptool.getImageData(),{width:r,height:a}=this._croptool.getImageData(),{width:l,height:c}=this._croptool.getCanvasData(),d=r*e/100,h=a*t/100;i={xPercent:e,yPercent:t};const p=(e,t,i,s,o,n)=>{let r,a;90===e||-270===e?(r=i,a=s-t):180===e||-180===e?(r=s-t,a=o-i):-90===e||270===e?(r=o-i,a=t):(r=t,a=i),n.xPercent=r/l*100,n.yPercent=a/c*100};return p(s,d,h,r,a,i),-1===o&&-1===n?p(s-180,d,h,r,a,i):(-1===o&&(i.xPercent=90===s||-270===s?100-i.xPercent:180===s||-180===s?e:-90===s||270===s?100-i.xPercent:100-e),-1===n&&(90===s||-270===s?(i.xPercent=t,i.yPercent=e):180===s||-180===s?(i.xPercent=100-e,i.yPercent=t):-90===s||270===s?(i.xPercent=100-i.yPercent,i.yPercent=i.xPercent):i.yPercent=100-t)),{x:i.xPercent/100,y:i.yPercent/100,xPercent:i.xPercent,yPercent:i.yPercent}},p=(0,n.A)("div",{class:"ImageEditor-focus-container",dblclick:e=>e.preventDefault(),onclick:e=>{e.preventDefault();const s=(0,l.A)(t,".ImageEditor-focus-point"),o=(0,l.A)(t,".ImageEditor-implicitMessage");s&&s.classList.remove("is-implicit"),o&&o.classList.add("is-hidden"),(0,l.A)(t,".ImageEditor-focusMessage").classList.add("is-hidden");const n=this.getClickCoordsLocal(e.target,e);n.xPercent*=100,n.yPercent*=100;const{xPercent:r,yPercent:a}=n;c({xPercent:r,yPercent:a}),d({xPercent:r,yPercent:a}),this.showPreview(),i()}});return this.getPreviewContainer().appendChild(p),""!==o&&""!==r&&d({xPercent:100*o,yPercent:100*r}),{disable:()=>{p.style.pointerEvents="none"},enable:()=>{p.style.pointerEvents="initial"},moveTo:d,getFocusCoordinatesRelative:e=>{let t={};const i=this.getFocusCoords(e);if(null===i.xPercent&&null===i.yPercent){if(!this.getImplicitFocus())return null;{const e=this.getImplicitFocus().split(",");i.xPercent=100*e[0],i.yPercent=100*e[1]}}const{rotate:s,scaleX:o,scaleY:n}=this._croptool.getImageData(),{width:r,height:a}=this._croptool.getImageData(),{width:l,height:c}=this._croptool.getCanvasData(),d=r*i.xPercent/100,h=a*i.yPercent/100;t={...i};const p=(e,t,i,s,o,n)=>{let r,a;90===e||-270===e?(r=o-i,a=t):180===e||-180===e?(r=s-t,a=o-i):-90===e||270===e?(r=i,a=s-t):(r=t,a=i),n.xPercent=r/l*100,n.yPercent=a/c*100};return p(s,d,h,r,a,t),-1===o&&-1===n?p(s-180,d,h,r,a,t):(-1===o&&(90===s||-270===s?t.yPercent=100-i.xPercent:180===s||-180===s?t.xPercent=i.xPercent:-90===s||270===s?t.yPercent=i.xPercent:t.xPercent=100-i.xPercent),-1===n&&(90===s||-270===s?t.xPercent=i.yPercent:180===s||-180===s?(t.xPercent=100-i.xPercent,t.yPercent=i.yPercent):270===s?t.xPercent=100-t.xPercent:t.yPercent=100-i.yPercent)),{x:t.xPercent/100,y:t.yPercent/100,xPercent:t.xPercent,yPercent:t.yPercent}}}}applyAllEdits(e){const{brightness:t,contrast:i,invert:s,grayscale:o,sepia:n,flipH:r,flipV:a,rotate:l}={...e};this.applyFilter("brightness",`${this.convertValueToPercent(t)}%`),this.applyFilter("contrast",`${this.convertValueToPercent(i)}%`),this.applyFilter("sepia",n?"100%":null),this.applyFilter("invert",s?"100%":null),this.applyFilter("grayscale",o?"100%":null),r?this._croptool.scale(-1,a?-1:1):this._croptool.scale(1,a?-1:1),a?this._croptool.scale(r?-1:1,-1):this._croptool.scale(r?-1:1,1),l&&(this._croptool.rotateTo(l),this.moveFocusCoords(),this.updateAllRenditionPreviews(),this.repaint(document.body.offsetHeight))}createEditUI(t,i,s,o,r,a){const c=this.getDefaults(),d=t.querySelector(".imageEditor-tools"),h=t.querySelector(".imageEditor-edit"),p=(0,n.A)("div",{class:"ImageEditor-editableArea",onclick:e=>e.preventDefault(),dblclick:e=>e.preventDefault()});this.getElement().querySelector(".ImageEditor-main").appendChild(p);const u=e=>{let t=parseFloat(e);return t=100*t+100,t},g=this.getElement(),m=g.querySelector('input[name$=".brightness"]'),f=g.querySelector('input[name$=".contrast"]'),v=g.querySelector('input[name$=".sepia"]'),E=g.querySelector('input[name$=".invert"]'),b=g.querySelector('input[name$=".grayscale"]'),y=g.querySelector('input[name$=".no-filter"]'),A=e=>{const t=this.getElement();Object.entries(e).forEach(([e,i])=>{const s=t.querySelector(`.ImageEditor-edit input[name$='.${e}']`);"checkbox"===s.type?s.checked=i:s.value=i})};m.onchange=e=>{this.applyFilter("brightness",`${u(e.target.value)}%`)},f.onchange=e=>{this.applyFilter("contrast",`${u(e.target.value)}%`)};const C={grayscale:b,invert:E,sepia:v,"no-filter":y},I=e=>{C[e].checked?"no-filter"!==e&&this.applyFilter(e,C[e].checked?"100%":null):C[e].checked=!0;for(const t in C)t!==e&&(this.applyFilter(t,null),C[t].checked=!1)};v.onchange=()=>{I("sepia")},E.onchange=()=>{I("invert")},b.onchange=()=>{I("grayscale")},y.onchange=()=>{I("no-filter")};const _=(0,n.A)("button",{class:"ImageEditor-rotate-left","aria-label":e.imageEditor.rotateLeft,title:e.imageEditor.rotateLeft,type:"button",onclick:e=>{s.rotate(-90),this.moveFocusCoords(),r(),a(),B(s.getData().rotate)}},e.imageEditor.rotateLeft),w=(0,n.A)("button",{class:"ImageEditor-rotate-right","aria-label":e.imageEditor.rotateRight,title:e.imageEditor.rotateRight,type:"button",onclick:e=>{s.rotate(90),this.moveFocusCoords(),r(),a(),B(s.getData().rotate)}},e.imageEditor.rotateRight),P=(0,n.A)("button",{class:"ImageEditor-flip-h","aria-label":e.imageEditor.flipH,title:e.imageEditor.flipH,type:"button",onclick:e=>{const t=s.getData().rotate;0===t||180===t||-180===t?x():L(),r(),a()}},e.imageEditor.flipH),R=(0,n.A)("button",{class:"ImageEditor-flip-v","aria-label":e.imageEditor.flipV,title:e.imageEditor.flipV,type:"button",onclick:e=>{const t=s.getData().rotate;0===t||180===t||-180===t?L():x(),r(),a()}},e.imageEditor.flipV),S=(0,n.A)("button",{class:"ImageEditor-resetButton","aria-label":e.reset,type:"button",onclick:e=>{e.preventDefault(),e.stopPropagation(),this.applyAllEdits(c),A(c),this.resetAllRenditionPreviews(),a()},onkeydown:e=>{"Tab"!==e.key||e.shiftKey||(e.preventDefault(),this._element.querySelector(".TabBar-item.is-selected").focus())}},e.reset);(0,l.A)(this.getElement(),".ActionBar").appendChild(S);const x=()=>{const e=q(),t=T();s.scale(e?1:-1,t?-1:1),this.moveFocusCoords(),F()},L=()=>{const e=T(),t=q();s.scale(t?-1:1,e?1:-1),this.moveFocusCoords(),k()},q=()=>{const e=this.getElement().querySelector(".ImageEditor-edit input[name$='.flipH']");return!!e&&e.checked},F=()=>{const e=this.getElement().querySelector(".ImageEditor-edit input[name$='.flipH']");e&&(e.checked=!e.checked,e.dispatchEvent(new Event("change",{bubbles:!0})))},T=()=>{const e=this.getElement().querySelector(".ImageEditor-edit input[name$='.flipV']");return!!e&&e.checked},k=()=>{const e=this.getElement().querySelector(".ImageEditor-edit input[name$='.flipV']");e&&(e.checked=!e.checked,e.dispatchEvent(new Event("change",{bubbles:!0})))},B=e=>{const t=this.getElement().querySelector(".ImageEditor-edit input[name$='.rotate']");let i=e;-180===e?i=180:-270===e?i=90:270===e&&(i=-90),t&&(t.value=i,t.dispatchEvent(new Event("change",{bubbles:!0})))},D=(0,n.A)("div",{class:"CIG-row"},(0,n.A)("label",{class:"CIG-label"},e.imageEditor.brightness,m)),z=(0,n.A)("div",{class:"CIG-row"},(0,n.A)("label",{class:"CIG-label"},e.imageEditor.contrast,f)),$=(0,n.A)("div",{class:"CIG-row",role:"radiogroup"},(0,n.A)("div",{class:"CIG-label"},"Filter"),(0,n.A)("div",{class:"CIG-small",role:"radio",tabIndex:0},(0,n.A)("label",y,e.imageEditor.filters)),(0,n.A)("div",{class:"CIG-small",role:"radio",tabIndex:0},(0,n.A)("label",v,e.imageEditor.sepia)),(0,n.A)("div",{class:"CIG-small",role:"radio",tabIndex:0},(0,n.A)("label",E,e.imageEditor.invert)),(0,n.A)("div",{class:"CIG-small",role:"radio",tabIndex:0},(0,n.A)("label",b,e.imageEditor.grayscale))),M=(0,n.A)("div",{class:"CIG-row"},(0,n.A)("label",{class:"CIG-label"},e.imageEditor.rotate+"/"+e.imageEditor.flip),(0,n.A)("div",{class:"CIG-small"},[_,w,P,R]));h.append(M,D,z,$),i.appendChild(d),i.appendChild(h);const U=this.getEditValues();this.applyAllEdits(U)}filterRenditionPreviews(){const e=this._cropSelect.selectedIndex,t=this._cropSelect.options[e];this.hideCropUI(),this._renditions.forEach(e=>{e.current&&this.toggleRendition(e),this.getRenditionElFromRendition(e).classList.toggle("is-visible",""===t.value||e.cropRatio===t.value)})}moveFocusCoords(){if(!this._focusUI)return;const e=this._focusUI.getFocusCoordinatesRelative();e&&this._focusUI.moveTo(e)}showPreview(){const e=this._cropSelect.selectedIndex,t=this._cropSelect.options[e],i=t.value,s=this._focusUI.getFocusCoordinatesRelative(i),{width:o,height:n}=this.getPreviewContainer().getBoundingClientRect(),r=Math.floor(o/n*100)/100;let a,l,c=0,d=0,h=0,p=0;if(""!==i&&s){const e=t.getAttribute("data-preview-ratio");r>e?(a=n*e,c=o*s.x-a/2,c<=0&&(c=0),d=o-a-c,d<=0&&(d=0,c=o-a)):r<e&&(l=o/e,h=n*s.y-l/2,h<=0&&(h=0),p=n-l-h,p<=0&&(p=0,h=n-l))}this.imageMask.style.borderLeftWidth=`${c}px`,this.imageMask.style.borderRightWidth=`${d}px`,this.imageMask.style.borderTopWidth=`${h}px`,this.imageMask.style.borderBottomWidth=`${p}px`}getClickCoordsLocal(e,t){const{width:i,height:s,top:o,left:n}=e.getBoundingClientRect(),r=o+document.body.scrollTop,a=n+document.body.scrollLeft;let l=Math.ceil(t.pageX-a)||1,c=Math.ceil(t.pageY-r)||1;return l<=0&&(l=1),c<=0&&(c=1),{x:l,y:c,xPercent:l/i,yPercent:c/s,width:i,height:s}}getCropTool(){return this._croptool}getElement(){return this._element}getForm(){return this._form}getImplicitFocus(){return this._implicitFocus}getPreviewCanvas(){return this.getPreviewContainer().querySelector("canvas")}getPreviewContainer(){return this.getElement().parentNode.querySelector(".ImageEditor-preview")}getRenditions(){const e={},t=["x","y","width","height","texts","textSizes","textXs","textYs","textWidths"],i=this.getElement().querySelector(".imageEditor-sizes table");return i&&i.querySelectorAll("th").forEach(i=>{const s=i.closest("tr"),o=s.getAttribute("data-size-group"),n=s.getAttribute("data-size-name"),r=s.getAttribute("data-display-name"),a=s.getAttribute("data-description"),l=parseFloat(s.getAttribute("data-size-width")),c=parseFloat(s.getAttribute("data-size-height"));let d="true"===s.getAttribute("data-size-independent"),h=l/c;0!==l&&0!==c||(h=0,d=!0);const p={};t.forEach(e=>{p[e]=s.querySelector(`input[name$='.${e}']`)});const u=this.getFocusCoords();e[n]={group:o,name:n,description:a,displayName:r,inputs:p,independent:d,width:l,height:c,aspectRatio:h,focusCrop:u}}),e}flattenAndSortRenditions(e){const t=new Map,i=t=>({name:t.name,cropRatio:t.group,sizeInfos:{[t.name]:{...e[t.name]}}});for(const s in e){const o=e[s];t.set(o.name,i(o))}return s=t,new Map(Array.from(s).sort((e,t)=>e[0]-t[0]));var s}hideCropUI(){this._croptool.clear()}showCropUI(){this._croptool.enable();const e=this.getCurrentRendition();e&&(e.current=!1,this.setCurrentRendition(e))}hideEditUI(){this.getElement().querySelector(".ImageEditor-editableArea").classList.add("is-hidden")}showEditUI(){this.getElement().querySelector(".ImageEditor-editableArea").classList.remove("is-hidden")}hideHotspotUI(){this.getElement().querySelector(".ImageEditor-hotspot-container").classList.add("is-hidden")}showHotspotUI(){this.getElement().querySelector(".ImageEditor-hotspot-container").classList.remove("is-hidden"),this._hotspotUI.reflow()}renderPreview(){this.getPreviewContainer().classList.add("is-hidden");const e=this._croptool.getCropBoxData();this._croptool.clear();const t=this._croptool.getCroppedCanvas();this._croptool.setCropBoxData(e);const i=this.getPreviewCanvas();i?this.getPreviewContainer().replaceChild(t,i):this.getPreviewContainer().appendChild(t)}renderRenditionPreviews(e){const t=(0,n.A)("ol",{class:"ImageEditor-sizeSelectors"}),i=e=>{const t=this.getCropTool(),i=(0,n.A)("div",{class:"imageEditor-sizePreview"});this.positionCrop(e);const s=t.getCroppedCanvas();return i.appendChild(s),i};e.forEach((e,s)=>{const o=(0,n.A)("li",{class:"imageEditor-sizeButton "+(e.current?"imageEditor-sizeSelected":""),onclick:t=>{t.preventDefault(),t.stopPropagation(),this.setCurrentRendition(e)}});o.setAttribute("data-group-name",e.sizeInfos[s].group),o.setAttribute("data-size-name",s),e.sizeInfos[s]&&e.sizeInfos[s].independent&&o.setAttribute("data-independent","true");const r=(0,n.A)("div",{className:"imageEditor-sizeLabel"},(a=e,a.sizeInfos[a.name].displayName??=""));var a;const l=(0,n.A)("div",{className:"ImageEditor-sizeContainer"});l.append(r);const c=(0,n.A)("div",{className:"ImageEditor-sizeDescription"});c.append(...(e=>{const t=new Map;for(const i in e.sizeInfos){let s=e.sizeInfos[i].description;s&&t.set(s,(0,n.A)("span",s))}return[...t.values()]})(e));const d=this.getElement().getAttribute("data-inherit"),h=this.getElement().getAttribute("data-override");e.cropRatio&&"independent"!==e.cropRatio&&(c.append((0,n.A)("span",{className:"is-inherit"},d+" "+e.cropRatio)),c.append((0,n.A)("span",{className:"is-override"},h+" "+e.cropRatio)));const p=(0,n.A)("a",{class:"ImageEditor-renditionResetButton",onclick:t=>{t.preventDefault(),t.stopPropagation(),e.current||this.setCurrentRendition(e),this.resetCropInputValues(this.getCurrentRendition()),this.resetRendition(this.getCurrentRendition())}},"Reset");o.append(l,c,i(e)),l.append(p),t.appendChild(o)});const s=this.getElement().querySelector(".ImageEditor-sizes");s&&s.appendChild(t)}renderTabs(){const e=this.getElement().querySelector(".imageEditor-aside"),t=this.getPreviewContainer().querySelector("img"),i=(0,n.A)("div",{class:"ImageEditor-editGroup",dataset:{tab:"Edit"}});"true"===this.getElement().getAttribute("editor")&&e.appendChild(i);const s=this.getElement().querySelector(".imageEditor-sizes");s&&(s.dataset.tab="Sizes",e.appendChild(s)),"true"===this.getElement().getAttribute("editor")?this._editUI=this.createEditUI(e,i,this._croptool,this._focusUI,()=>{this.updateAllRenditionPreviews()},()=>{this.repaint(document.body.offsetHeight)}):this.applyAllEdits(this.getEditValues());const o=!!this.getForm().querySelector('.inputContainer[data-name$=".hotspots"]');let r;o&&(r=(0,n.A)("div",{class:"ImageEditor-hotspots",dataset:{tab:"Hotspots"}}),e.appendChild(r)),this._hotspotUI=o?this.createHotspotUI(r,t.getAttribute("data-width"),t.getAttribute("data-height"),()=>{}):null;const a=new MutationObserver(e=>{for(const t of e)if("class"===t.attributeName){const e=t.target,i=e.dataset.tab;e.classList.contains("TC-unselected")?"Sizes"===i?this.hideCropUI():"Edit"===i?this.hideEditUI():"Hotspots"===i&&this.hideHotspotUI():"Sizes"===i?this.showCropUI():"Edit"===i?this.showEditUI():"Hotspots"===i&&this.showHotspotUI()}});a.observe(i,{attributes:!0}),s&&a.observe(s,{attributes:!0}),r&&a.observe(r,{attributes:!0}),new p.A(e)}updateRenditionPreview(e,t){const i=this.getRenditionElFromRendition(e),s=i.querySelector(".imageEditor-sizePreview canvas");i.querySelector(".imageEditor-sizePreview").replaceChild(t,s)}updateAllRenditionPreviews(){this._renditions.forEach(e=>{this.positionCrop(e);const t=this._croptool.getCroppedCanvas();this._croptool.clear(),this.updateRenditionPreview(e,t)})}setCropInputValues(e,t=null){const i=this._croptool.getCanvasData();let s=t||this._croptool.getCropBoxData(),{left:o,top:n,width:r,height:a}=s;o=0!==o?(o-i.left)/i.width:0,n=0!==n?(n-i.top)/i.height:0,r/=i.width,a/=i.height,s={x:o,y:n,width:r,height:a};for(const t in e.sizeInfos)for(const i in s){const o=e.sizeInfos[t].inputs[i];o.value=s[i],o.removeAttribute("disabled")}}getCropInputValues(e){const t=["x","y","width","height"];let i={};for(const s in e.sizeInfos)t.forEach(t=>{Object.assign(i,{[t]:e.sizeInfos[s].inputs[t].value})});return i}resetCropInputValues(e){this.setCropInputValues(e,{left:0,top:0,width:0,height:0})}resetRendition(e){delete e.modifiedCropData,this.getRenditionElFromRendition(e).classList.remove("ImageEditor-sizeModified"),this.hideRenditionResetButton(e),this.applyRenditionCrop(e)}resetAllRenditionPreviews(){this.getCurrentRendition()&&this.unsetCurrentRendition(this.getCurrentRendition()),this._renditions.forEach(e=>{this.resetCropInputValues(e),delete e.modifiedCropData,this.getRenditionElFromRendition(e).classList.remove("ImageEditor-sizeModified")})}showRenditionResetButton(e){this.getRenditionElFromRendition(e)?.querySelector(":scope .ImageEditor-renditionResetButton")?.classList.add("is-visible")}hideRenditionResetButton(e){this.getRenditionElFromRendition(e)?.querySelector(":scope .ImageEditor-renditionResetButton")?.classList.remove("is-visible")}getRenditionElFromRendition(e){const t=e.name;return this.getElement().querySelector(`.imageEditor-sizeButton[data-size-name='${t}']`)}getIsCropCentered(){return"true"===this.getElement().querySelector(".imageEditor-sizes table").getAttribute("data-crop-center")}getCurrentRendition(){let e=null;return this._renditions.forEach(t=>{t.current&&(e=t)}),e}toggleRendition(e){this.unsetCurrentRendition(e),this._focusUI&&this._focusUI.enable(),this.positionCrop(e);const t=this._croptool.getCroppedCanvas();this._croptool.clear(),this.updateRenditionPreview(e,t)}unsetCurrentRendition(e){this.getRenditionElFromRendition(e).classList.remove("imageEditor-sizeSelected"),e.current=!1}setCurrentRendition(e){e.current?this.toggleRendition(e):(this._renditions.forEach(e=>{e.current&&(this.unsetCurrentRendition(e),this.toggleRendition(e))}),e.current=!0,this.applyRenditionCrop(e))}applyRenditionCrop(e){const t=this.getRenditionElFromRendition(e);t&&(t.classList.add("imageEditor-sizeSelected"),this.positionCrop(e))}positionCrop(e){let t,i,s=this.getCropInputValues(e);const o=this._croptool.getCanvasData();this._focusUI&&(i=this._focusUI.getFocusCoordinatesRelative(e.cropRatio));for(const i in e.sizeInfos)t=e.sizeInfos[i].aspectRatio;if(this._croptool.crop(),this._croptool.setAspectRatio(t),this.getIsCropCentered()||this.getCropTool().setCropBoxData({left:0,top:0}),parseFloat(s.width)&&parseFloat(s.height)){this.getRenditionElFromRendition(e)&&this.showRenditionResetButton(e);const t=o.width*s.x+o.left,i=o.height*s.y+o.top,n=o.width*s.width,r=o.height*s.height;this._croptool.setCropBoxData({left:t,top:i,width:n,height:r})}else if(i){const t=this._croptool.getCanvasData(),s=this._croptool.getCropBoxData(),o={left:t.width*i.x-s.width/2+t.left,top:t.height*i.y-s.height/2+t.top,width:s.width,height:s.height};this._croptool.setCropBoxData(o);for(const t in e.sizeInfos)e.sizeInfos[t].focusCrop=o}}}(0,d.A)(".imageEditor",e=>{new y(e)}),(0,d.A)(".ImageEditor .TabBar-item",e=>{e.addEventListener("keydown",t=>{"Tab"===t.key&&t.shiftKey&&(t.preventDefault(),e.closest(".ImageEditor")?.querySelector(".ImageEditor-resetButton")?.focus())})}),s()}catch(e){s(e)}},1)},92954(e,t,i){i.a(e,async(e,s)=>{try{i.r(t),i.d(t,{default:()=>y}),i(49371),i(42723),i(96648),i(55763);var o=i(27741),n=i(18101),r=i(59015),a=i.n(r),l=i(60021),c=i(78578),d=i(45055),h=i(10910),p=i(9216),u=i(76394),g=i(79365),m=(i(20115),i(23902));window.BRIGHTSPOT?.ui.cms.enableV5UI||await i.e(5001).then(i.bind(i,95001));const e=window.BRIGHTSPOT?.ui.tooltips,f="400",v=40,E=new Map,b=".cropper-canvas > img, .cropper-view-box > img, .imageEditor-sizePreview";class y{constructor(t){const i="is-imageEditorOpen",s="is-imageEditorLoading",r="is-imageEditorReady",a=(0,o.A)(t,".inputContainer"),c=(0,l.A)(a,".fileSelector"),d=t.parentNode,h=(0,l.A)(t,".imageEditor-image > img"),p=t.closest(".RCIG-item");if(!d||!h)return;this._element=t,this._renditions=new Map,this._focusUI=null,this._editUI=null,this._initialContainerHeight=null,this._form=this._element.closest("form"),this._implicitFocus=t.dataset.implicitFocus,this._isContextual="contextual"in t.dataset,this._element.setAttribute("hidden","");let v=d;for(;v.parentElement?.closest(".CIG-row");)v=v.parentElement?.closest(".CIG-row");const E=this.getForm().querySelector('.inputContainer[data-name$=".hotspots"]');E&&(E.style.display="none"),new ResizeObserver(e=>{for(let t of e)this.repaint(t.contentRect.height)}).observe(document.body);const b=(0,n.A)("div",{className:"ImageEditor-preview-loader"}),y=h.cloneNode();y.onload=()=>{d.classList.add("is-imagePreview"),d.classList.add(s),this.getElement().classList.add(s),b.style.width=`${y.offsetWidth}px`,b.style.height=`${y.offsetHeight}px`};const A=e=>{"Escape"===e.key&&this._element.querySelector(".ImageEditor-closeButton")?.click()},C=(0,n.A)("button",{className:"true"===this.getElement().getAttribute("editor")?"ImageEditor-open":"ImageEditor-open noEditor","aria-haspopup":!0,"aria-label":e.imageEditor.open,title:e.imageEditor.open,type:"button",onclick:e=>{this._element.removeAttribute("hidden"),d.classList.add(i),v.style.zIndex=f;const t=this.getElement().closest(".ContentEdit-left");t&&(t.style.position="fixed",t.style.zIndex=f),d.classList.contains(r)||(d.classList.add(r),this._initialContainerHeight=this.getElement().offsetHeight,this._renditions=this.flattenAndSortRenditions(this.getRenditions()),this.renderRenditionPreviews(this._renditions),this.renderTabs()),p&&p.classList.add(i),this._element.querySelector(".ImageEditor-edit button")?.focus(),window.addEventListener("keydown",A),setTimeout(()=>{this.repaint(document.body.offsetHeight),this._hotspotUI&&(this._hotspotUI.reflow(),this._hotspotUI.reveal())},250)}}),I=(0,l.A)(this.getElement(),".imageEditor-aside"),_=(0,l.A)(I,".imageEditor-tools ul");_.classList.add("ImageEditor-editTools"),_.setAttribute("role","menu");const w=(0,n.A)("button",{className:"ImageEditor-editToggle",type:"button",title:e.imageEditor.actions,"aria-label":e.imageEditor.actions,"aria-haspopup":"menu","aria-expanded":!1,onclick:e=>{(0,g.AM)(_,w)}});(0,g.D1)(_,w);const P=(0,l.A)(this.getElement(),".ImageEditor-groups");P&&(m.A.pause(),d.appendChild(P),requestAnimationFrame(m.A.resume));const R=this.getElement().getAttribute("data-focus-message"),S=(0,n.A)("div",{className:"ImageEditor-focusMessage"},R),x=(0,n.A)("span",{className:"ImageEditor-implicitMessage is-hidden"},this.getElement().dataset.implicitFocusMessage),L=function(e){S.textContent=R+" "+e,S.classList.remove("is-hidden")};this._cropSelect=d.querySelector(".ImageEditor-groups > select"),this._cropSelect&&this._cropSelect.addEventListener("change",e=>{const t=this._cropSelect.selectedIndex,i=this._cropSelect.options[t];S.classList.remove("is-hidden"),L(i.textContent);let s=this._focusUI.getFocusCoordinatesRelative(i.value);const o=(0,l.A)(d,".ImageEditor-focus-point");if(s){const e=this.getFocusCoords(i.value);null!==e.xPercent&&null!==e.yPercent?(o&&o.classList.remove("is-implicit"),x.classList.add("is-hidden")):this.getImplicitFocus()&&(o&&o.classList.add("is-implicit"),o&&o.classList.remove("is-hidden"),x.classList.remove("is-hidden")),o&&o.classList.remove("is-hidden"),this._focusUI.moveTo(s)}else if(this.getImplicitFocus()){const e=this.getImplicitFocus().split(",");s={x:e[0],xPercent:100*e[0],y:e[1],yPercent:100*e[1]},x.classList.remove("is-hidden"),o&&o.classList.add("is-implicit"),this._focusUI.moveTo(s)}else o&&o.classList.add("is-hidden");this.showPreview()}),c&&(0,l.A)(c,"select").addEventListener("change",e=>{C.style.display="keep"===e.target.value?"":"none",w.style.display="keep"===e.target.value?"":"none"}),d.insertBefore((0,n.A)("div",{className:"ImageEditor-preview"},y,b),t),d.append(C,w,_);const q=(0,n.A)("button",{className:"ImageEditor-closeButton",name:"action-done",onclick:e=>{v.style.zIndex="auto";const t=this.getElement().closest(".ContentEdit-left");t&&(t.style.position="initial",t.style.zIndex="auto"),this._element.setAttribute("hidden",""),this.renderPreview(),this._focusUI&&this.showPreview(),d.classList.remove(i),p&&p.classList.remove(i),C.focus(),window.removeEventListener("keydown",A),e.preventDefault()}},"Done");this.getElement().appendChild((0,n.A)("div",{className:"ActionBar"},q));const F=e=>{const{brightness:t,contrast:i,invert:s,grayscale:o,sepia:n,flipH:r,flipV:a,rotate:l}={...e};this.applyFilter("brightness",`${this.convertValueToPercent(t)}%`),this.applyFilter("contrast",`${this.convertValueToPercent(i)}%`),this.applyFilter("sepia",n?"100%":null),this.applyFilter("invert",s?"100%":null),this.applyFilter("grayscale",o?"100%":null),r?this._croptool.scale(-1,a?-1:1):this._croptool.scale(1,a?-1:1),a?this._croptool.scale(r?-1:1,-1):this._croptool.scale(r?-1:1,1),l&&this._croptool.rotateTo(l)},T=()=>{const e=(0,u.A)(this._cropSelect,'option:not([value=""])'),t=Object.values(this.getRenditions());if(e.forEach(e=>{const i=t.filter(t=>t.group===e.value&&0!==t.aspectRatio);if(i.length>0){const t=i.reduce((e,t)=>e+t.aspectRatio,0)/i.length;e.setAttribute("data-preview-ratio",t)}else this._cropSelect.removeChild(e)}),1===this._cropSelect.children.length){const e=(0,l.A)(P,".ComboInput");e&&(e.style.display="none")}},k=e=>{this.initCropTool(e).then(e=>{if(this.getElement().classList.remove(s),d.classList.remove(s),d.classList.add("is-imageEditorLoaded"),F(this.getEditValues()),this.renderPreview(),x&&d.appendChild(x),this._cropSelect){S&&d.appendChild(S);const e=this._cropSelect.selectedIndex,t=this._cropSelect.options[e];L(t.textContent),this.imageMask=(0,n.A)("div",{className:"ImageEditor-preview-border"}),d.querySelector(".ImageEditor-preview").append(this.imageMask),this._focusUI=this.createFocusUI(d,()=>{this.updateAllRenditionPreviews()}),T(),this.showPreview()}})};h.complete?k(h):h.onload=e=>{k(h)}}applyFilter(e,t){let i="";const s=[...this.getElement().querySelectorAll(b),this.getPreviewContainer()];t?E.set(e,t):E.delete(e),E.forEach((e,t)=>{i+=` ${t}(${e}) `}),s.forEach(e=>e.style.filter=`${i.trim()}`)}convertValueToPercent(e){let t=parseFloat(e);return t=100*t+100,t}async initCropTool(e){await new Promise((t,i)=>{this._croptool=new(a())(e,{autoCrop:!1,autoCropArea:1,movable:!1,restore:!1,responsive:!0,scalable:!0,toggleDragModeOnDblclick:!1,viewMode:1,zoomable:!1,zoomOnTouch:!1,zoomOnWheel:!1,minContainerHeight:-1,minContainerWidth:-1,ready:e=>{t()},crop:e=>{const t=this.getCurrentRendition();t&&this.updateRenditionPreview(t,this._croptool.getCroppedCanvas())},cropend:e=>{const t=this.getCurrentRendition(),i=this._croptool.getCropBoxData();t&&(t.modifiedCropData=i,this.showRenditionResetButton(t),this.getRenditionElFromRendition(t).classList.add("ImageEditor-sizeModified"),this.setCropInputValues(t))}})})}repaint(e){const t=this.getElement().querySelector(".ImageEditor-main"),i=e-document.querySelector(".Page-header").offsetHeight,s=t.getBoundingClientRect().width;window.dispatchEvent(new Event("resize")),i===this._croptool?.getCanvasData().height&&this._croptool.setCanvasData({top:this._croptool.getCanvasData().top+24,left:this._croptool.getCanvasData().left+24,height:this._croptool.getCanvasData().height-48}),s===this._croptool?.getCanvasData().width&&this._croptool.setCanvasData({top:this._croptool.getCanvasData().top+24,left:this._croptool.getCanvasData().left+24,width:this._croptool.getCanvasData().width-48}),this.updateAllRenditionPreviews()}getFocusCoords(e){let t,i;if(this._cropSelect){const t=this._cropSelect.selectedIndex;e||(e=this._cropSelect.options[t].value)}return e&&""!==e&&"independent"!==e?(t=this.getElement().querySelector('input[name$=".focusX.'+e+'"]'),i=this.getElement().querySelector('input[name$=".focusY.'+e+'"]'),""!==t.value&&""!==i.value||(t=this.getElement().querySelector('input[name$=".focusX"]'),i=this.getElement().querySelector('input[name$=".focusY"]'))):(t=this.getElement().querySelector('input[name$=".focusX"]'),i=this.getElement().querySelector('input[name$=".focusY"]')),{xPercent:""!==t.value?100*t.value:null,yPercent:""!==i.value?100*i.value:null}}getDefaults(){let e={brightness:0,contrast:0,flipH:!1,flipV:!1,grayscale:!1,invert:!1,rotate:"0",sepia:!1,"no-filter":!0};if(!this._isContextual)return e;let t=this._element.dataset.defaultEdits;if(!t)return e;const i=JSON.parse(t),{grayscale:s,sepia:o,invert:n}=i;return(s||o||n)&&(i["no-filter"]=!1),e=Object.assign(e,i),e}getEditValues(){const e=this.getElement().getAttribute("editor");return[..."true"===e?this.getElement().querySelectorAll(".ImageEditor-edit input[name]"):Object.entries(JSON.parse(this.getElement().getAttribute("edits")))].reduce((t,i)=>{if("true"===e){const e=i.name.substring(i.name.lastIndexOf(".")+1);Object.assign(t,{[e]:"checkbox"===i.type?i.checked:i.value})}else{const e=i[0];Object.assign(t,{[e]:i[1]})}return t},{})}createHotspotUI(e,t,i,s){let o=!1;const r=this.getForm().querySelector('.inputContainer[data-name$=".hotspots"]');if(!r)return;r.style.display="block";const a=(0,n.A)("div",{class:"ImageEditor-hotspot-container",onclick:e=>{e.preventDefault()}}),l=(0,n.A)("div",{class:"ImageEditor-hotspotableArea",onclick:e=>{if(!a.classList.contains("is-hidden")){const t=this.getClickCoordsLocal(e.target,e);t.xPercent*=100,t.yPercent*=100}}});a.appendChild(l),this.getElement().querySelector(".ImageEditor-main").appendChild(a),e.append(r),(0,d.A)(e,".ImageEditor-hotspot-item",e=>{new MutationObserver(t=>{t.forEach(t=>{t.target.classList.contains("is-removing")?u(e):g(e)})}).observe(e,{attributeFilter:["class"]})});const p=()=>{e.querySelectorAll(".ImageEditor-hotspot-item").forEach(e=>{const t=v/2,{x:i,y:s}=l.getBoundingClientRect(),o=l.offsetWidth,n=l.offsetHeight,r=e.draggableRef,{x:a,y:c}=m(e),{xPercent:d,yPercent:h}=f({x:a,y:c}),p=o*(d/100),u=n*(h/100);r.position(),r.left=p+i-t,r.top=u+s-t}),window.dispatchEvent(new Event("resize"))},u=e=>{e.hotspotRefEl.classList.add("is-removing")},g=e=>{e.hotspotRefEl.classList.remove("is-removing")},m=e=>({x:e.querySelector('input[name$="cms.image.x"]').value,y:e.querySelector('input[name$="cms.image.y"]').value}),f=({x:e,y:s})=>({xPercent:e/t*100,yPercent:s/i*100});new MutationObserver(e=>{for(const t of e)"style"===t.attributeName&&E(t.target)}).observe(this.getElement().querySelector(".cropper-canvas"),{attributes:!0});const E=e=>{l.style.height=`${e.offsetHeight}px`,l.style.width=`${e.offsetWidth}px`,l.style.transform=e.style.transform,p()};return E(this.getElement().querySelector(".cropper-canvas")),(()=>{let s=null;const r=(e,s)=>{const o=e.parentNode.getBoundingClientRect();let n=s.left-o.left,r=s.top-o.top;n+=e.offsetWidth/2,r+=e.offsetHeight/2,((e,t)=>{const i=e.querySelector('input[name$="/cms.image.x"]'),s=e.querySelector('input[name$="/cms.image.y"]');i.value=t.x,s.value=t.y,i.dispatchEvent(new Event("change",{bubbles:!0})),s.dispatchEvent(new Event("change",{bubbles:!0}))})(e.itemRefEl,(({x:e,y:s})=>{const o=l.offsetWidth/t,n=l.offsetHeight/i;return{x:e=parseInt(e/o),y:s=parseInt(s/n)}})({x:n,y:r}))};(0,d.A)(e,".RCIG-item[data-hotspot-point]",e=>{const{x:t,y:i}=m(e);(e=>{e.parentNode.querySelectorAll(".ImageEditor-hotspot-item:not(.collapsed):not(.is-collapsed)").forEach(e=>{e.classList.add("is-collapsed"),e.classList.add("collapsed")})})(e),setTimeout(()=>{e.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},100),e.classList.add("ImageEditor-hotspot-item"),e.hotspotRefEl=(({item:e,x:t,y:i,label:a})=>{const d=(0,n.A)("div",{className:"ImageEditor-hotspot",onclick:e=>{(e=>{const t=e.itemRefEl;e.classList.remove("is-added"),t.classList.contains("is-collapsed")&&t.querySelector(":scope .repeatableLabel")?.click(),setTimeout(()=>{t.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},100),s=e})(e.target)},onmouseenter:e=>{o||(e.target.classList.remove("is-added"),e.target.classList.add("is-hovered"),e.target.itemRefEl.classList.add("is-hovered"),e.preventDefault(),e.stopPropagation())},onmouseleave:e=>{o||(e.target.classList.remove("is-hovered"),e.target.itemRefEl.classList.remove("is-hovered"),e.preventDefault(),e.stopPropagation())}});d.innerHTML=a,d.itemRefEl=e,l.appendChild(d);const u=new h.A(d,{leftTop:!1,containment:l});if(h.A.draggableClass="is-draggable",h.A.draggingClass="is-dragging",h.A.movingClass="is-moving",u.onMove=e=>{l.classList.add("is-dragging"),o=!0},u.onDragEnd=e=>{o=!1,l.classList.remove("is-dragging"),r(d,e)},e.draggableRef=u,""===t&&""===i){const e=new c.A,t=.3,i=Math.random()<.5?-1:1,s=Math.random()<.5?-1:1,o=d.parentNode.getBoundingClientRect(),n=o.left+o.width/2,a=o.top+o.height/2,l=n+i*(v*e.getVal(i*t)),h=a+s*(v*e.getVal(s*t));r(d,{left:l,top:h}),p(),d.classList.add("is-added")}return d})({item:e,x:t,y:i,label:Array.from(e.parentElement.children).indexOf(e)+1}),e.onmouseenter=e=>{e.target.hotspotRefEl.classList.remove("is-added"),e.target.hotspotRefEl.classList.add("is-hovered"),e.preventDefault(),e.stopPropagation()},e.onmouseleave=e=>{e.target.hotspotRefEl.classList.remove("is-hovered"),e.preventDefault(),e.stopPropagation()}})})(),l.querySelectorAll(".ImageEditor-hotspot").forEach(e=>{e.classList.add("is-hidden")}),s(),{reflow:p,reveal:()=>{e.querySelectorAll(".ImageEditor-hotspot-item").forEach(e=>{e.hotspotRefEl.classList.remove("is-hidden")})}}}createFocusUI(t,i){const s=(0,n.A)("div",{className:"ImageEditor-focus-point",title:e.imageEditor.focus});let o=this.getElement().querySelector('input[name$=".focusX"]').value,r=this.getElement().querySelector('input[name$=".focusY"]').value;if(!o&&!r&&this.getImplicitFocus()){const e=this.getImplicitFocus().split(",");o=e[0],r=e[1],s.classList.add("is-implicit"),t.querySelector(".ImageEditor-implicitMessage").classList.remove("is-hidden")}const a=()=>{this._cropSelect.querySelectorAll('option:not([value=""])').forEach(e=>{const t=this.getElement().querySelector('input[name$=".focusX.'+e.value+'"]'),i=this.getElement().querySelector('input[name$=".focusY.'+e.value+'"]');t&&i&&(t.value="",i.value="")})},c=({xPercent:e,yPercent:t})=>{const i=this._cropSelect.selectedIndex,s=this._cropSelect.options[i],o=""===s.value?this.getElement().querySelector('input[name$=".focusX"]'):this.getElement().querySelector('input[name$=".focusX.'+s.value+'"]'),n=""===s.value?this.getElement().querySelector('input[name$=".focusY"]'):this.getElement().querySelector('input[name$=".focusY.'+s.value+'"]'),r=h({xPercent:e,yPercent:t});o.value=r.xPercent/100,n.value=r.yPercent/100,""===s.value&&a(),o.dispatchEvent(new Event("change",{bubbles:!0})),n.dispatchEvent(new Event("change",{bubbles:!0}))},d=({xPercent:e,yPercent:i})=>{(0,l.A)(t,".ImageEditor-focus-point")||t.append(s),s.classList.remove("is-hidden"),((e,t)=>{s.style.left=`${e}%`,s.style.top=`${t}%`})(e,i)},h=({xPercent:e,yPercent:t})=>{let i={};if(""===e&&""===t)return null;const{rotate:s,scaleX:o,scaleY:n}=this._croptool.getImageData(),{width:r,height:a}=this._croptool.getImageData(),{width:l,height:c}=this._croptool.getCanvasData(),d=r*e/100,h=a*t/100;i={xPercent:e,yPercent:t};const p=(e,t,i,s,o,n)=>{let r,a;90===e||-270===e?(r=i,a=s-t):180===e||-180===e?(r=s-t,a=o-i):-90===e||270===e?(r=o-i,a=t):(r=t,a=i),n.xPercent=r/l*100,n.yPercent=a/c*100};return p(s,d,h,r,a,i),-1===o&&-1===n?p(s-180,d,h,r,a,i):(-1===o&&(i.xPercent=90===s||-270===s?100-i.xPercent:180===s||-180===s?e:-90===s||270===s?100-i.xPercent:100-e),-1===n&&(90===s||-270===s?(i.xPercent=t,i.yPercent=e):180===s||-180===s?(i.xPercent=100-e,i.yPercent=t):-90===s||270===s?(i.xPercent=100-i.yPercent,i.yPercent=i.xPercent):i.yPercent=100-t)),{x:i.xPercent/100,y:i.yPercent/100,xPercent:i.xPercent,yPercent:i.yPercent}},p=(0,n.A)("div",{class:"ImageEditor-focus-container",dblclick:e=>e.preventDefault(),onclick:e=>{e.preventDefault();const s=(0,l.A)(t,".ImageEditor-focus-point"),o=(0,l.A)(t,".ImageEditor-implicitMessage");s&&s.classList.remove("is-implicit"),o&&o.classList.add("is-hidden"),(0,l.A)(t,".ImageEditor-focusMessage").classList.add("is-hidden");const n=this.getClickCoordsLocal(e.target,e);n.xPercent*=100,n.yPercent*=100;const{xPercent:r,yPercent:a}=n;c({xPercent:r,yPercent:a}),d({xPercent:r,yPercent:a}),this.showPreview(),i()}});return this.getPreviewContainer().appendChild(p),""!==o&&""!==r&&d({xPercent:100*o,yPercent:100*r}),{disable:()=>{p.style.pointerEvents="none"},enable:()=>{p.style.pointerEvents="initial"},moveTo:d,getFocusCoordinatesRelative:e=>{let t={};const i=this.getFocusCoords(e);if(null===i.xPercent&&null===i.yPercent){if(!this.getImplicitFocus())return null;{const e=this.getImplicitFocus().split(",");i.xPercent=100*e[0],i.yPercent=100*e[1]}}const{rotate:s,scaleX:o,scaleY:n}=this._croptool.getImageData(),{width:r,height:a}=this._croptool.getImageData(),{width:l,height:c}=this._croptool.getCanvasData(),d=r*i.xPercent/100,h=a*i.yPercent/100;t={...i};const p=(e,t,i,s,o,n)=>{let r,a;90===e||-270===e?(r=o-i,a=t):180===e||-180===e?(r=s-t,a=o-i):-90===e||270===e?(r=i,a=s-t):(r=t,a=i),n.xPercent=r/l*100,n.yPercent=a/c*100};return p(s,d,h,r,a,t),-1===o&&-1===n?p(s-180,d,h,r,a,t):(-1===o&&(90===s||-270===s?t.yPercent=100-i.xPercent:180===s||-180===s?t.xPercent=i.xPercent:-90===s||270===s?t.yPercent=i.xPercent:t.xPercent=100-i.xPercent),-1===n&&(90===s||-270===s?t.xPercent=i.yPercent:180===s||-180===s?(t.xPercent=100-i.xPercent,t.yPercent=i.yPercent):270===s?t.xPercent=100-t.xPercent:t.yPercent=100-i.yPercent)),{x:t.xPercent/100,y:t.yPercent/100,xPercent:t.xPercent,yPercent:t.yPercent}}}}applyAllEdits(e){const{brightness:t,contrast:i,invert:s,grayscale:o,sepia:n,flipH:r,flipV:a,rotate:l}={...e};this.applyFilter("brightness",`${this.convertValueToPercent(t)}%`),this.applyFilter("contrast",`${this.convertValueToPercent(i)}%`),this.applyFilter("sepia",n?"100%":null),this.applyFilter("invert",s?"100%":null),this.applyFilter("grayscale",o?"100%":null),r?this._croptool.scale(-1,a?-1:1):this._croptool.scale(1,a?-1:1),a?this._croptool.scale(r?-1:1,-1):this._croptool.scale(r?-1:1,1),l&&(this._croptool.rotateTo(l),this.moveFocusCoords(),this.updateAllRenditionPreviews(),this.repaint(document.body.offsetHeight))}createEditUI(t,i,s,o,r,a){const c=this.getDefaults(),d=t.querySelector(".imageEditor-tools"),h=t.querySelector(".imageEditor-edit"),p=(0,n.A)("div",{class:"ImageEditor-editableArea",onclick:e=>e.preventDefault(),dblclick:e=>e.preventDefault()});this.getElement().querySelector(".ImageEditor-main").appendChild(p);const u=e=>{let t=parseFloat(e);return t=100*t+100,t},g=this.getElement(),m=g.querySelector('input[name$=".brightness"]'),f=g.querySelector('input[name$=".contrast"]'),v=g.querySelector('input[name$=".sepia"]'),E=g.querySelector('input[name$=".invert"]'),b=g.querySelector('input[name$=".grayscale"]'),y=g.querySelector('input[name$=".no-filter"]'),A=e=>{const t=this.getElement();Object.entries(e).forEach(([e,i])=>{const s=t.querySelector(`.ImageEditor-edit input[name$='.${e}']`);"checkbox"===s.type?s.checked=i:s.value=i})};m.onchange=e=>{this.applyFilter("brightness",`${u(e.target.value)}%`)},f.onchange=e=>{this.applyFilter("contrast",`${u(e.target.value)}%`)};const C={grayscale:b,invert:E,sepia:v,"no-filter":y},I=e=>{C[e].checked?"no-filter"!==e&&this.applyFilter(e,C[e].checked?"100%":null):C[e].checked=!0;for(const t in C)t!==e&&(this.applyFilter(t,null),C[t].checked=!1)};v.onchange=()=>{I("sepia")},E.onchange=()=>{I("invert")},b.onchange=()=>{I("grayscale")},y.onchange=()=>{I("no-filter")};const _=(0,n.A)("button",{class:"ImageEditor-rotate-left","aria-label":e.imageEditor.rotateLeft,title:e.imageEditor.rotateLeft,type:"button",onclick:e=>{s.rotate(-90),this.moveFocusCoords(),r(),a(),B(s.getData().rotate)}},e.imageEditor.rotateLeft),w=(0,n.A)("button",{class:"ImageEditor-rotate-right","aria-label":e.imageEditor.rotateRight,title:e.imageEditor.rotateRight,type:"button",onclick:e=>{s.rotate(90),this.moveFocusCoords(),r(),a(),B(s.getData().rotate)}},e.imageEditor.rotateRight),P=(0,n.A)("button",{class:"ImageEditor-flip-h","aria-label":e.imageEditor.flipH,title:e.imageEditor.flipH,type:"button",onclick:e=>{const t=s.getData().rotate;0===t||180===t||-180===t?x():L(),r(),a()}},e.imageEditor.flipH),R=(0,n.A)("button",{class:"ImageEditor-flip-v","aria-label":e.imageEditor.flipV,title:e.imageEditor.flipV,type:"button",onclick:e=>{const t=s.getData().rotate;0===t||180===t||-180===t?L():x(),r(),a()}},e.imageEditor.flipV),S=(0,n.A)("button",{class:"ImageEditor-resetButton","aria-label":e.reset,type:"button",onclick:e=>{e.preventDefault(),e.stopPropagation(),this.applyAllEdits(c),A(c),this.resetAllRenditionPreviews(),a()},onkeydown:e=>{"Tab"!==e.key||e.shiftKey||(e.preventDefault(),this._element.querySelector(".TabBar-item.is-selected").focus())}},e.reset);(0,l.A)(this.getElement(),".ActionBar").appendChild(S);const x=()=>{const e=q(),t=T();s.scale(e?1:-1,t?-1:1),this.moveFocusCoords(),F()},L=()=>{const e=T(),t=q();s.scale(t?-1:1,e?1:-1),this.moveFocusCoords(),k()},q=()=>{const e=this.getElement().querySelector(".ImageEditor-edit input[name$='.flipH']");return!!e&&e.checked},F=()=>{const e=this.getElement().querySelector(".ImageEditor-edit input[name$='.flipH']");e&&(e.checked=!e.checked,e.dispatchEvent(new Event("change",{bubbles:!0})))},T=()=>{const e=this.getElement().querySelector(".ImageEditor-edit input[name$='.flipV']");return!!e&&e.checked},k=()=>{const e=this.getElement().querySelector(".ImageEditor-edit input[name$='.flipV']");e&&(e.checked=!e.checked,e.dispatchEvent(new Event("change",{bubbles:!0})))},B=e=>{const t=this.getElement().querySelector(".ImageEditor-edit input[name$='.rotate']");let i=e;-180===e?i=180:-270===e?i=90:270===e&&(i=-90),t&&(t.value=i,t.dispatchEvent(new Event("change",{bubbles:!0})))},D=(0,n.A)("div",{class:"CIG-row"},(0,n.A)("label",{class:"CIG-label"},e.imageEditor.brightness,m)),z=(0,n.A)("div",{class:"CIG-row"},(0,n.A)("label",{class:"CIG-label"},e.imageEditor.contrast,f)),$=(0,n.A)("div",{class:"CIG-row",role:"radiogroup"},(0,n.A)("div",{class:"CIG-label"},"Filter"),(0,n.A)("div",{class:"CIG-small",role:"radio",tabIndex:0},(0,n.A)("label",y,e.imageEditor.filters)),(0,n.A)("div",{class:"CIG-small",role:"radio",tabIndex:0},(0,n.A)("label",v,e.imageEditor.sepia)),(0,n.A)("div",{class:"CIG-small",role:"radio",tabIndex:0},(0,n.A)("label",E,e.imageEditor.invert)),(0,n.A)("div",{class:"CIG-small",role:"radio",tabIndex:0},(0,n.A)("label",b,e.imageEditor.grayscale))),M=(0,n.A)("div",{class:"CIG-row"},(0,n.A)("label",{class:"CIG-label"},e.imageEditor.rotate+"/"+e.imageEditor.flip),(0,n.A)("div",{class:"CIG-small"},[_,w,P,R]));h.append(M,D,z,$),i.appendChild(d),i.appendChild(h);const U=this.getEditValues();this.applyAllEdits(U)}filterRenditionPreviews(){const e=this._cropSelect.selectedIndex,t=this._cropSelect.options[e];this.hideCropUI(),this._renditions.forEach(e=>{e.current&&this.toggleRendition(e),this.getRenditionElFromRendition(e).classList.toggle("is-visible",""===t.value||e.cropRatio===t.value)})}moveFocusCoords(){if(!this._focusUI)return;const e=this._focusUI.getFocusCoordinatesRelative();e&&this._focusUI.moveTo(e)}showPreview(){const e=this._cropSelect.selectedIndex,t=this._cropSelect.options[e],i=t.value,s=this._focusUI.getFocusCoordinatesRelative(i),{width:o,height:n}=this.getPreviewContainer().getBoundingClientRect(),r=Math.floor(o/n*100)/100;let a,l,c=0,d=0,h=0,p=0;if(""!==i&&s){const e=t.getAttribute("data-preview-ratio");r>e?(a=n*e,c=o*s.x-a/2,c<=0&&(c=0),d=o-a-c,d<=0&&(d=0,c=o-a)):r<e&&(l=o/e,h=n*s.y-l/2,h<=0&&(h=0),p=n-l-h,p<=0&&(p=0,h=n-l))}this.imageMask.style.borderLeftWidth=`${c}px`,this.imageMask.style.borderRightWidth=`${d}px`,this.imageMask.style.borderTopWidth=`${h}px`,this.imageMask.style.borderBottomWidth=`${p}px`}getClickCoordsLocal(e,t){const{width:i,height:s,top:o,left:n}=e.getBoundingClientRect(),r=o+document.body.scrollTop,a=n+document.body.scrollLeft;let l=Math.ceil(t.pageX-a)||1,c=Math.ceil(t.pageY-r)||1;return l<=0&&(l=1),c<=0&&(c=1),{x:l,y:c,xPercent:l/i,yPercent:c/s,width:i,height:s}}getCropTool(){return this._croptool}getElement(){return this._element}getForm(){return this._form}getImplicitFocus(){return this._implicitFocus}getPreviewCanvas(){return this.getPreviewContainer().querySelector("canvas")}getPreviewContainer(){return this.getElement().parentNode.querySelector(".ImageEditor-preview")}getRenditions(){const e={},t=["x","y","width","height","texts","textSizes","textXs","textYs","textWidths"],i=this.getElement().querySelector(".imageEditor-sizes table");return i&&i.querySelectorAll("th").forEach(i=>{const s=i.closest("tr"),o=s.getAttribute("data-size-group"),n=s.getAttribute("data-size-name"),r=s.getAttribute("data-display-name"),a=s.getAttribute("data-description"),l=parseFloat(s.getAttribute("data-size-width")),c=parseFloat(s.getAttribute("data-size-height"));let d="true"===s.getAttribute("data-size-independent"),h=l/c;0!==l&&0!==c||(h=0,d=!0);const p={};t.forEach(e=>{p[e]=s.querySelector(`input[name$='.${e}']`)});const u=this.getFocusCoords();e[n]={group:o,name:n,description:a,displayName:r,inputs:p,independent:d,width:l,height:c,aspectRatio:h,focusCrop:u}}),e}flattenAndSortRenditions(e){const t=new Map,i=t=>({name:t.name,cropRatio:t.group,sizeInfos:{[t.name]:{...e[t.name]}}});for(const s in e){const o=e[s];t.set(o.name,i(o))}return s=t,new Map(Array.from(s).sort((e,t)=>e[0]-t[0]));var s}hideCropUI(){this._croptool.clear()}showCropUI(){this._croptool.enable();const e=this.getCurrentRendition();e&&(e.current=!1,this.setCurrentRendition(e))}hideEditUI(){this.getElement().querySelector(".ImageEditor-editableArea").classList.add("is-hidden")}showEditUI(){this.getElement().querySelector(".ImageEditor-editableArea").classList.remove("is-hidden")}hideHotspotUI(){this.getElement().querySelector(".ImageEditor-hotspot-container").classList.add("is-hidden")}showHotspotUI(){this.getElement().querySelector(".ImageEditor-hotspot-container").classList.remove("is-hidden"),this._hotspotUI.reflow()}renderPreview(){this.getPreviewContainer().classList.add("is-hidden");const e=this._croptool.getCropBoxData();this._croptool.clear();const t=this._croptool.getCroppedCanvas();this._croptool.setCropBoxData(e);const i=this.getPreviewCanvas();i?this.getPreviewContainer().replaceChild(t,i):this.getPreviewContainer().appendChild(t)}renderRenditionPreviews(e){const t=(0,n.A)("ol",{class:"ImageEditor-sizeSelectors"}),i=e=>{const t=this.getCropTool(),i=(0,n.A)("div",{class:"imageEditor-sizePreview"});this.positionCrop(e);const s=t.getCroppedCanvas();return i.appendChild(s),i};e.forEach((e,s)=>{const o=(0,n.A)("li",{class:"imageEditor-sizeButton "+(e.current?"imageEditor-sizeSelected":""),onclick:t=>{t.preventDefault(),t.stopPropagation(),this.setCurrentRendition(e)}});o.setAttribute("data-group-name",e.sizeInfos[s].group),o.setAttribute("data-size-name",s),e.sizeInfos[s]&&e.sizeInfos[s].independent&&o.setAttribute("data-independent","true");const r=(0,n.A)("div",{className:"imageEditor-sizeLabel"},(a=e,a.sizeInfos[a.name].displayName??=""));var a;const l=(0,n.A)("div",{className:"ImageEditor-sizeContainer"});l.append(r);const c=(0,n.A)("div",{className:"ImageEditor-sizeDescription"});c.append(...(e=>{const t=new Map;for(const i in e.sizeInfos){let s=e.sizeInfos[i].description;s&&t.set(s,(0,n.A)("span",s))}return[...t.values()]})(e));const d=this.getElement().getAttribute("data-inherit"),h=this.getElement().getAttribute("data-override");e.cropRatio&&"independent"!==e.cropRatio&&(c.append((0,n.A)("span",{className:"is-inherit"},d+" "+e.cropRatio)),c.append((0,n.A)("span",{className:"is-override"},h+" "+e.cropRatio)));const p=(0,n.A)("a",{class:"ImageEditor-renditionResetButton",onclick:t=>{t.preventDefault(),t.stopPropagation(),e.current||this.setCurrentRendition(e),this.resetCropInputValues(this.getCurrentRendition()),this.resetRendition(this.getCurrentRendition())}},"Reset");o.append(l,c,i(e)),l.append(p),t.appendChild(o)});const s=this.getElement().querySelector(".ImageEditor-sizes");s&&s.appendChild(t)}renderTabs(){const e=this.getElement().querySelector(".imageEditor-aside"),t=this.getPreviewContainer().querySelector("img"),i=(0,n.A)("div",{class:"ImageEditor-editGroup",dataset:{tab:"Edit"}});"true"===this.getElement().getAttribute("editor")&&e.appendChild(i);const s=this.getElement().querySelector(".imageEditor-sizes");s&&(s.dataset.tab="Sizes",e.appendChild(s)),"true"===this.getElement().getAttribute("editor")?this._editUI=this.createEditUI(e,i,this._croptool,this._focusUI,()=>{this.updateAllRenditionPreviews()},()=>{this.repaint(document.body.offsetHeight)}):this.applyAllEdits(this.getEditValues());const o=!!this.getForm().querySelector('.inputContainer[data-name$=".hotspots"]');let r;o&&(r=(0,n.A)("div",{class:"ImageEditor-hotspots",dataset:{tab:"Hotspots"}}),e.appendChild(r)),this._hotspotUI=o?this.createHotspotUI(r,t.getAttribute("data-width"),t.getAttribute("data-height"),()=>{}):null;const a=new MutationObserver(e=>{for(const t of e)if("class"===t.attributeName){const e=t.target,i=e.dataset.tab;e.classList.contains("TC-unselected")?"Sizes"===i?this.hideCropUI():"Edit"===i?this.hideEditUI():"Hotspots"===i&&this.hideHotspotUI():"Sizes"===i?this.showCropUI():"Edit"===i?this.showEditUI():"Hotspots"===i&&this.showHotspotUI()}});a.observe(i,{attributes:!0}),s&&a.observe(s,{attributes:!0}),r&&a.observe(r,{attributes:!0}),new p.A(e)}updateRenditionPreview(e,t){const i=this.getRenditionElFromRendition(e),s=i.querySelector(".imageEditor-sizePreview canvas");i.querySelector(".imageEditor-sizePreview").replaceChild(t,s)}updateAllRenditionPreviews(){this._renditions.forEach(e=>{this.positionCrop(e);const t=this._croptool.getCroppedCanvas();this._croptool.clear(),this.updateRenditionPreview(e,t)})}setCropInputValues(e,t=null){const i=this._croptool.getCanvasData();let s=t||this._croptool.getCropBoxData(),{left:o,top:n,width:r,height:a}=s;o=0!==o?(o-i.left)/i.width:0,n=0!==n?(n-i.top)/i.height:0,r/=i.width,a/=i.height,s={x:o,y:n,width:r,height:a};for(const t in e.sizeInfos)for(const i in s){const o=e.sizeInfos[t].inputs[i];o.value=s[i],o.removeAttribute("disabled")}}getCropInputValues(e){const t=["x","y","width","height"];let i={};for(const s in e.sizeInfos)t.forEach(t=>{Object.assign(i,{[t]:e.sizeInfos[s].inputs[t].value})});return i}resetCropInputValues(e){this.setCropInputValues(e,{left:0,top:0,width:0,height:0})}resetRendition(e){delete e.modifiedCropData,this.getRenditionElFromRendition(e).classList.remove("ImageEditor-sizeModified"),this.hideRenditionResetButton(e),this.applyRenditionCrop(e)}resetAllRenditionPreviews(){this.getCurrentRendition()&&this.unsetCurrentRendition(this.getCurrentRendition()),this._renditions.forEach(e=>{this.resetCropInputValues(e),delete e.modifiedCropData,this.getRenditionElFromRendition(e).classList.remove("ImageEditor-sizeModified")})}showRenditionResetButton(e){this.getRenditionElFromRendition(e)?.querySelector(":scope .ImageEditor-renditionResetButton")?.classList.add("is-visible")}hideRenditionResetButton(e){this.getRenditionElFromRendition(e)?.querySelector(":scope .ImageEditor-renditionResetButton")?.classList.remove("is-visible")}getRenditionElFromRendition(e){const t=e.name;return this.getElement().querySelector(`.imageEditor-sizeButton[data-size-name='${t}']`)}getIsCropCentered(){return"true"===this.getElement().querySelector(".imageEditor-sizes table").getAttribute("data-crop-center")}getCurrentRendition(){let e=null;return this._renditions.forEach(t=>{t.current&&(e=t)}),e}toggleRendition(e){this.unsetCurrentRendition(e),this._focusUI&&this._focusUI.enable(),this.positionCrop(e);const t=this._croptool.getCroppedCanvas();this._croptool.clear(),this.updateRenditionPreview(e,t)}unsetCurrentRendition(e){this.getRenditionElFromRendition(e).classList.remove("imageEditor-sizeSelected"),e.current=!1}setCurrentRendition(e){e.current?this.toggleRendition(e):(this._renditions.forEach(e=>{e.current&&(this.unsetCurrentRendition(e),this.toggleRendition(e))}),e.current=!0,this.applyRenditionCrop(e))}applyRenditionCrop(e){const t=this.getRenditionElFromRendition(e);t&&(t.classList.add("imageEditor-sizeSelected"),this.positionCrop(e))}positionCrop(e){let t,i,s=this.getCropInputValues(e);const o=this._croptool.getCanvasData();this._focusUI&&(i=this._focusUI.getFocusCoordinatesRelative(e.cropRatio));for(const i in e.sizeInfos)t=e.sizeInfos[i].aspectRatio;if(this._croptool.crop(),this._croptool.setAspectRatio(t),this.getIsCropCentered()||this.getCropTool().setCropBoxData({left:0,top:0}),parseFloat(s.width)&&parseFloat(s.height)){this.getRenditionElFromRendition(e)&&this.showRenditionResetButton(e);const t=o.width*s.x+o.left,i=o.height*s.y+o.top,n=o.width*s.width,r=o.height*s.height;this._croptool.setCropBoxData({left:t,top:i,width:n,height:r})}else if(i){const t=this._croptool.getCanvasData(),s=this._croptool.getCropBoxData(),o={left:t.width*i.x-s.width/2+t.left,top:t.height*i.y-s.height/2+t.top,width:s.width,height:s.height};this._croptool.setCropBoxData(o);for(const t in e.sizeInfos)e.sizeInfos[t].focusCrop=o}}}(0,d.A)(".imageEditor",e=>{new y(e)}),(0,d.A)(".ImageEditor .TabBar-item",e=>{e.addEventListener("keydown",t=>{"Tab"===t.key&&t.shiftKey&&(t.preventDefault(),e.closest(".ImageEditor")?.querySelector(".ImageEditor-resetButton")?.focus())})}),s()}catch(e){s(e)}},1)},73609(e,t,i){i.d(t,{A:()=>d}),i(67219),i(44764),i(84978),i(13722),i(39589),i(25809);var s=i(1439),o=i.n(s),n=i(5292);if(7717==i.j)var r=i(26594);if(7717==i.j)var a=i(40627);if(7717==i.j)var l=i(95628);var c=i(66556);class d{constructor(e){this._container=e,this._update=(0,r.A)(this._update.bind(this)),this._update(),window.addEventListener("brightspot-content-state-change",()=>{this._toggle()})}_forEachChild(e){for(const t of this._container.children){const i=t.dataset.tab;void 0!==i&&e(i,t)}}_toArray(e){if(e)try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{}return[]}_update(){this._observer&&(this._observer.disconnect(),this._observer=null);const e=(0,n.A)("div",{className:"TabBar",role:"tablist"}),t=(0,n.A)("button",{className:"TabBar-menuToggle",title:window.BRIGHTSPOT?.ui.tooltips.tabs,type:"button","aria-haspopup":"menu","aria-expanded":"false","aria-label":window.BRIGHTSPOT?.ui.tooltips.tabs}),i=(0,n.A)("div",{className:"TabBar-menuList",role:"menu","aria-label":window.BRIGHTSPOT?.ui.tooltips.tabs}),s=(0,n.A)("div",{className:"TabBar-menu"},t,i);t.onclick=()=>{(0,c.AM)(i,t,e)};const o="MENU"===this._container.dataset.tcMode,r=this._container.dataset.tcMain,d=this._toArray(this._container.dataset.tcExceptions),h=new Set;this._defaultTab=null;for(const e of this._container.children){const t=e.dataset.tab;void 0!==t&&(h.has(t)||(this._defaultTab||(this._defaultTab=t),h.add(t)))}const p=this._toArray(this._container.dataset.tcStart),u=this._toArray(this._container.dataset.tcEnd),g=[];for(const e of p)h.has(e)&&g.push(e);for(const e of h)p.includes(e)||u.includes(e)||g.push(e);for(const e of u)h.has(e)&&g.push(e);for(const t of g){const s=d.indexOf(t)>-1?o?e:i:o?i:e;s.insertBefore((0,n.A)("button",{className:"TabBar-item",dataset:{tab:t},role:"tab",onclick:e=>{e.preventDefault(),this.select(t,e)},onkeydown:e=>{var t=e.currentTarget,i=t.closest(".TabBar");switch(e.key){case"ArrowRight":return void(t.nextSibling?t.nextSibling.focus():i.firstChild.focus());case"ArrowLeft":return void(t.previousSibling?t.previousSibling.focus():i.lastChild.focus())}}},t),t===r?s.firstChild:null)}g.includes(r)&&(this._defaultTab=r),1===e.children.length&&i.insertBefore(e.children[0],i.firstChild);for(const e of i.children)e.className="TabBar-menuItem",e.setAttribute("role","menuitem");if((0,c.D1)(i,t),this._bar&&(this._bar.remove(),this._bar=null,this._menu=null,this._menuToggle=null,this._menuList=null),0===g.length||g.length<2&&!this._container.getAttribute("data-show-tabs")){this._container.dataset.tabless="true";const e=this._container.querySelectorAll(":scope > .TC-unselected");return void Array.from(e).forEach(e=>{e.classList.remove("TC-unselected")})}this._bar=e,this._container.insertBefore(e,this._container.firstChild),i.children.length>0&&(0===e.children.length&&(e.classList.add("is-menuOnly"),e.removeAttribute("role")),this._menu=s,this._menuToggle=t,this._menuList=i,this._bar.appendChild(s));const m=this._toggle();m.includes(this._defaultTab)||(this._defaultTab=m[0]),e.hidden=1===Array.from(i.children).filter(e=>!e.hidden).length;let f=!1;for(const e of(0,a.A)(this._container,".CIG-row > .Message.is-error")){let t,i=e;do{t=i,i=t.parentNode}while(i!==this._container);const s=(0,l.A)(this._bar,`[data-tab="${t.dataset.tab}"]`);s&&!s.classList.contains("is-error")&&(s.classList.add("is-error"),s.classList.contains("TabBar-menuItem")&&(f=!0))}f&&e.classList.add("is-menuError"),this.select()}_toggle(){const e=[];this._forEachChild((t,i)=>{i.hidden||i instanceof HTMLHeadingElement||e.push(t)});for(const t of[this._bar,this._menuList])if(t)for(const i of t.children)i!==this._menu&&(i.hidden=!e.includes(i.dataset.tab));return e}select(e,t){const i=e&&this._container.closest(".ContentEdit.is-new, .StandardForm.is-new");if(e||(e=this._defaultTab),this._bar&&!this._bar.classList.contains("is-menuOnly"))for(const t of this._bar.children){const i=t.dataset.tab===e;t.classList.toggle("is-selected",i),t.setAttribute("aria-selected",i),i?t.removeAttribute("tabindex"):t.setAttribute("tabindex","-1")}if(this._menuList){let t=!1;for(const i of this._menuList.children)i.classList.toggle("is-selected",i.dataset.tab===e)&&(t=e!==this._defaultTab);this._bar.classList.toggle("is-menuSelected",t),this._menuToggle.innerText=t?e:""}if(this._forEachChild((t,i)=>{i.classList.toggle("TC-unselected",t!==e)}),window.dispatchEvent(new Event("resize")),o()(this._container).find("> [data-tab]").trigger("tabbedShow"),o()(this._bar).trigger("tabbed-select"),i){const t=this._container.querySelector(`:scope > .CIG-row:not(.inputContainer-readOnly)[data-tab="${e}"] > .CIG-label > label`)?.htmlFor;t&&document.getElementById(t)?.focus()}else t&&t.target.scrollIntoView({block:"nearest"})}}},9216(e,t,i){i.d(t,{A:()=>d}),i(86634),i(57573),i(49371),i(42723),i(26780),i(96648);var s=i(88630),o=i.n(s),n=i(18101);if(3324==i.j)var r=i(39403);if(3324==i.j)var a=i(76394);if(3324==i.j)var l=i(60021);var c=i(79365);class d{constructor(e){this._container=e,this._update=(0,r.A)(this._update.bind(this)),this._update(),window.addEventListener("brightspot-content-state-change",()=>{this._toggle()})}_forEachChild(e){for(const t of this._container.children){const i=t.dataset.tab;void 0!==i&&e(i,t)}}_toArray(e){if(e)try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{}return[]}_update(){this._observer&&(this._observer.disconnect(),this._observer=null);const e=(0,n.A)("div",{className:"TabBar",role:"tablist"}),t=(0,n.A)("button",{className:"TabBar-menuToggle",title:window.BRIGHTSPOT?.ui.tooltips.tabs,type:"button","aria-haspopup":"menu","aria-expanded":"false","aria-label":window.BRIGHTSPOT?.ui.tooltips.tabs}),i=(0,n.A)("div",{className:"TabBar-menuList",role:"menu","aria-label":window.BRIGHTSPOT?.ui.tooltips.tabs}),s=(0,n.A)("div",{className:"TabBar-menu"},t,i);t.onclick=()=>{(0,c.AM)(i,t,e)};const o="MENU"===this._container.dataset.tcMode,r=this._container.dataset.tcMain,d=this._toArray(this._container.dataset.tcExceptions),h=new Set;this._defaultTab=null;for(const e of this._container.children){const t=e.dataset.tab;void 0!==t&&(h.has(t)||(this._defaultTab||(this._defaultTab=t),h.add(t)))}const p=this._toArray(this._container.dataset.tcStart),u=this._toArray(this._container.dataset.tcEnd),g=[];for(const e of p)h.has(e)&&g.push(e);for(const e of h)p.includes(e)||u.includes(e)||g.push(e);for(const e of u)h.has(e)&&g.push(e);for(const t of g){const s=d.indexOf(t)>-1?o?e:i:o?i:e;s.insertBefore((0,n.A)("button",{className:"TabBar-item",dataset:{tab:t},role:"tab",onclick:e=>{e.preventDefault(),this.select(t,e)},onkeydown:e=>{var t=e.currentTarget,i=t.closest(".TabBar");switch(e.key){case"ArrowRight":return void(t.nextSibling?t.nextSibling.focus():i.firstChild.focus());case"ArrowLeft":return void(t.previousSibling?t.previousSibling.focus():i.lastChild.focus())}}},t),t===r?s.firstChild:null)}g.includes(r)&&(this._defaultTab=r),1===e.children.length&&i.insertBefore(e.children[0],i.firstChild);for(const e of i.children)e.className="TabBar-menuItem",e.setAttribute("role","menuitem");if((0,c.D1)(i,t),this._bar&&(this._bar.remove(),this._bar=null,this._menu=null,this._menuToggle=null,this._menuList=null),0===g.length||g.length<2&&!this._container.getAttribute("data-show-tabs")){this._container.dataset.tabless="true";const e=this._container.querySelectorAll(":scope > .TC-unselected");return void Array.from(e).forEach(e=>{e.classList.remove("TC-unselected")})}this._bar=e,this._container.insertBefore(e,this._container.firstChild),i.children.length>0&&(0===e.children.length&&(e.classList.add("is-menuOnly"),e.removeAttribute("role")),this._menu=s,this._menuToggle=t,this._menuList=i,this._bar.appendChild(s));const m=this._toggle();m.includes(this._defaultTab)||(this._defaultTab=m[0]),e.hidden=1===Array.from(i.children).filter(e=>!e.hidden).length;let f=!1;for(const e of(0,a.A)(this._container,".CIG-row > .Message.is-error")){let t,i=e;do{t=i,i=t.parentNode}while(i!==this._container);const s=(0,l.A)(this._bar,`[data-tab="${t.dataset.tab}"]`);s&&!s.classList.contains("is-error")&&(s.classList.add("is-error"),s.classList.contains("TabBar-menuItem")&&(f=!0))}f&&e.classList.add("is-menuError"),this.select()}_toggle(){const e=[];this._forEachChild((t,i)=>{i.hidden||i instanceof HTMLHeadingElement||e.push(t)});for(const t of[this._bar,this._menuList])if(t)for(const i of t.children)i!==this._menu&&(i.hidden=!e.includes(i.dataset.tab));return e}select(e,t){const i=e&&this._container.closest(".ContentEdit.is-new, .StandardForm.is-new");if(e||(e=this._defaultTab),this._bar&&!this._bar.classList.contains("is-menuOnly"))for(const t of this._bar.children){const i=t.dataset.tab===e;t.classList.toggle("is-selected",i),t.setAttribute("aria-selected",i),i?t.removeAttribute("tabindex"):t.setAttribute("tabindex","-1")}if(this._menuList){let t=!1;for(const i of this._menuList.children)i.classList.toggle("is-selected",i.dataset.tab===e)&&(t=e!==this._defaultTab);this._bar.classList.toggle("is-menuSelected",t),this._menuToggle.innerText=t?e:""}if(this._forEachChild((t,i)=>{i.classList.toggle("TC-unselected",t!==e)}),window.dispatchEvent(new Event("resize")),o()(this._container).find("> [data-tab]").trigger("tabbedShow"),o()(this._bar).trigger("tabbed-select"),i){const t=this._container.querySelector(`:scope > .CIG-row:not(.inputContainer-readOnly)[data-tab="${e}"] > .CIG-label > label`)?.htmlFor;t&&document.getElementById(t)?.focus()}else t&&t.target.scrollIntoView({block:"nearest"})}}},36711(e,t,i){i.d(t,{A:()=>s.A});var s=i(22274)},23902(e,t,i){i.d(t,{A:()=>s.A});var s=i(35083)},85313(e,t,i){function s(){let e=1,t=1;const i=[];for(let e=0;e<256;++e)i.push(Math.random());return{getVal:function(s){const o=s*t,n=Math.floor(o),r=o-n,a=r*r*(3-2*r),l=255&n,c=l+1&255;return function(e,t,i){return e*(1-i)+t*i}(i[l],i[c],a)*e},setAmplitude:function(t){e=t},setScale:function(e){t=e}}}i.d(t,{A:()=>s}),i(44764),Object.defineProperty(s,"name",{value:"default",configurable:!0})},78578(e,t,i){function s(){let e=1,t=1;const i=[];for(let e=0;e<256;++e)i.push(Math.random());return{getVal:function(s){const o=s*t,n=Math.floor(o),r=o-n,a=r*r*(3-2*r),l=255&n,c=l+1&255;return function(e,t,i){return e*(1-i)+t*i}(i[l],i[c],a)*e},setAmplitude:function(t){e=t},setScale:function(e){t=e}}}i.d(t,{A:()=>s}),i(57573),Object.defineProperty(s,"name",{value:"default",configurable:!0})}}]);
|