@frontify/guideline-blocks-settings 1.0.13-alpha.4 → 1.0.13-alpha.5
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/components/Link/LinkSelector/LinkSelector.es.js +31 -39
- package/dist/components/Link/LinkSelector/LinkSelector.es.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,77 +1,69 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Dialog as
|
|
1
|
+
import { jsx as n, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { Dialog as o, Button as d, ScrollArea as y } from "@frontify/fondue/components";
|
|
3
3
|
import { IconLink as x } from "@frontify/fondue/icons";
|
|
4
4
|
import { useState as m, useEffect as L } from "react";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import { DocumentLinks as O } from "./DocumentLinks.es.js";
|
|
7
7
|
const j = ({
|
|
8
|
-
url:
|
|
8
|
+
url: r,
|
|
9
9
|
onUrlChange: s,
|
|
10
10
|
buttonSize: l = "medium",
|
|
11
|
-
getAllDocuments:
|
|
12
|
-
getDocumentPagesByDocumentId:
|
|
11
|
+
getAllDocuments: f,
|
|
12
|
+
getDocumentPagesByDocumentId: h,
|
|
13
13
|
getDocumentSectionsByDocumentPageId: u
|
|
14
14
|
}) => {
|
|
15
|
-
const [k, a] = m(!1), [
|
|
16
|
-
c(
|
|
17
|
-
}, P = (
|
|
18
|
-
|
|
15
|
+
const [k, a] = m(!1), [t, c] = m(r), D = (e) => {
|
|
16
|
+
c(e);
|
|
17
|
+
}, P = (e) => {
|
|
18
|
+
e.key === "Enter" && (e.preventDefault(), p());
|
|
19
19
|
};
|
|
20
20
|
L(() => {
|
|
21
|
-
|
|
22
|
-
}, [
|
|
21
|
+
r && !t && c(r);
|
|
22
|
+
}, [r, t]);
|
|
23
23
|
const p = () => {
|
|
24
|
-
s == null || s(
|
|
24
|
+
s == null || s(t), a(!1);
|
|
25
25
|
}, g = {
|
|
26
26
|
onOpenAutoFocus: () => {
|
|
27
27
|
},
|
|
28
28
|
showUnderlay: !0,
|
|
29
|
+
"data-is-underlay": !0,
|
|
29
30
|
minWidth: "800px"
|
|
30
31
|
};
|
|
31
32
|
return (
|
|
32
33
|
// eslint-disable-next-line jsx-a11y-x/no-static-element-interactions
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ n(
|
|
34
35
|
"div",
|
|
35
36
|
{
|
|
36
|
-
onPointerDownCapture: (
|
|
37
|
-
|
|
37
|
+
onPointerDownCapture: (e) => {
|
|
38
|
+
e.stopPropagation(), e.preventDefault();
|
|
38
39
|
},
|
|
39
|
-
onFocusCapture: (
|
|
40
|
-
|
|
40
|
+
onFocusCapture: (e) => {
|
|
41
|
+
e.stopPropagation(), e.preventDefault();
|
|
41
42
|
},
|
|
42
43
|
"data-test-id": "internal-link-selector",
|
|
43
44
|
onKeyDown: P,
|
|
44
|
-
children: /* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
45
|
+
children: /* @__PURE__ */ i(o.Root, { modal: !0, open: k, onOpenChange: a, children: [
|
|
46
|
+
/* @__PURE__ */ n(o.Trigger, { asChild: !0, children: /* @__PURE__ */ i(d, { size: l, emphasis: "default", children: [
|
|
47
|
+
/* @__PURE__ */ n(x, { size: "20" }),
|
|
47
48
|
"Internal link"
|
|
48
49
|
] }) }),
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ i(o.Content, { ...g, children: [
|
|
51
|
+
/* @__PURE__ */ n(o.Header, { children: /* @__PURE__ */ n(o.Title, { children: "Select internal link" }) }),
|
|
52
|
+
/* @__PURE__ */ n(o.Body, { padding: "none", children: /* @__PURE__ */ n(y, { padding: "compact", children: /* @__PURE__ */ n(
|
|
52
53
|
O,
|
|
53
54
|
{
|
|
54
|
-
selectedUrl:
|
|
55
|
+
selectedUrl: t,
|
|
55
56
|
onSelectUrl: D,
|
|
56
|
-
getAllDocuments:
|
|
57
|
-
getDocumentPagesByDocumentId:
|
|
57
|
+
getAllDocuments: f,
|
|
58
|
+
getDocumentPagesByDocumentId: h,
|
|
58
59
|
getDocumentSectionsByDocumentPageId: u
|
|
59
60
|
}
|
|
60
61
|
) }) }),
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
d,
|
|
65
|
-
{
|
|
66
|
-
size: l,
|
|
67
|
-
disabled: !o,
|
|
68
|
-
emphasis: "strong",
|
|
69
|
-
onPress: () => p(),
|
|
70
|
-
children: "Choose"
|
|
71
|
-
}
|
|
72
|
-
)
|
|
62
|
+
/* @__PURE__ */ i(o.Footer, { children: [
|
|
63
|
+
/* @__PURE__ */ n(d, { size: l, emphasis: "default", onPress: () => a(!1), children: "Cancel" }),
|
|
64
|
+
/* @__PURE__ */ n(d, { size: l, disabled: !t, emphasis: "strong", onPress: () => p(), children: "Choose" })
|
|
73
65
|
] })
|
|
74
|
-
] })
|
|
66
|
+
] })
|
|
75
67
|
] })
|
|
76
68
|
}
|
|
77
69
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkSelector.es.js","sources":["../../../../src/components/Link/LinkSelector/LinkSelector.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type Document, type DocumentPage, type DocumentSection } from '@frontify/app-bridge';\nimport { Button, Dialog, ScrollArea } from '@frontify/fondue/components';\nimport { IconLink } from '@frontify/fondue/icons';\nimport { type KeyboardEvent, type ReactElement, useEffect, useState } from 'react';\n\nimport './LinkSelector.css';\nimport { DocumentLinks } from './DocumentLinks';\n\ntype LinkSelectorProps = {\n url: string;\n onUrlChange?: (value: string) => void;\n buttonSize?: 'small' | 'medium' | 'large';\n getAllDocuments: () => Promise<Document[]>;\n getDocumentSectionsByDocumentPageId: (documentPageId: number) => Promise<DocumentSection[]>;\n getDocumentPagesByDocumentId: (documentId: number) => Promise<DocumentPage[]>;\n};\n\nexport const LinkSelector = ({\n url,\n onUrlChange,\n buttonSize = 'medium',\n getAllDocuments,\n getDocumentPagesByDocumentId,\n getDocumentSectionsByDocumentPageId,\n}: LinkSelectorProps): ReactElement => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n const [selectedUrl, setSelectedUrl] = useState<string>(url);\n\n const onSelectUrl = (url: string) => {\n setSelectedUrl(url);\n };\n\n const onPressEnter = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n saveLink();\n }\n };\n\n useEffect(() => {\n if (url && !selectedUrl) {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setSelectedUrl(url);\n }\n }, [url, selectedUrl]);\n\n const saveLink = () => {\n onUrlChange?.(selectedUrl);\n setIsModalOpen(false);\n };\n\n const dialogProps = {\n onOpenAutoFocus: () => {},\n showUnderlay: true,\n minWidth: '800px',\n };\n\n return (\n // eslint-disable-next-line jsx-a11y-x/no-static-element-interactions\n <div\n onPointerDownCapture={(event) => {\n event.stopPropagation();\n event.preventDefault();\n }}\n onFocusCapture={(event) => {\n event.stopPropagation();\n event.preventDefault();\n }}\n data-test-id=\"internal-link-selector\"\n onKeyDown={onPressEnter}\n >\n <Dialog.Root modal open={isModalOpen} onOpenChange={setIsModalOpen}>\n <Dialog.Trigger asChild>\n <Button size={buttonSize} emphasis=\"default\">\n <IconLink size=\"20\" />\n Internal link\n </Button>\n </Dialog.Trigger>\n <Dialog.Content {...dialogProps}>\n <
|
|
1
|
+
{"version":3,"file":"LinkSelector.es.js","sources":["../../../../src/components/Link/LinkSelector/LinkSelector.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type Document, type DocumentPage, type DocumentSection } from '@frontify/app-bridge';\nimport { Button, Dialog, ScrollArea } from '@frontify/fondue/components';\nimport { IconLink } from '@frontify/fondue/icons';\nimport { type KeyboardEvent, type ReactElement, useEffect, useState } from 'react';\n\nimport './LinkSelector.css';\nimport { DocumentLinks } from './DocumentLinks';\n\ntype LinkSelectorProps = {\n url: string;\n onUrlChange?: (value: string) => void;\n buttonSize?: 'small' | 'medium' | 'large';\n getAllDocuments: () => Promise<Document[]>;\n getDocumentSectionsByDocumentPageId: (documentPageId: number) => Promise<DocumentSection[]>;\n getDocumentPagesByDocumentId: (documentId: number) => Promise<DocumentPage[]>;\n};\n\nexport const LinkSelector = ({\n url,\n onUrlChange,\n buttonSize = 'medium',\n getAllDocuments,\n getDocumentPagesByDocumentId,\n getDocumentSectionsByDocumentPageId,\n}: LinkSelectorProps): ReactElement => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n const [selectedUrl, setSelectedUrl] = useState<string>(url);\n\n const onSelectUrl = (url: string) => {\n setSelectedUrl(url);\n };\n\n const onPressEnter = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n saveLink();\n }\n };\n\n useEffect(() => {\n if (url && !selectedUrl) {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setSelectedUrl(url);\n }\n }, [url, selectedUrl]);\n\n const saveLink = () => {\n onUrlChange?.(selectedUrl);\n setIsModalOpen(false);\n };\n\n const dialogProps = {\n onOpenAutoFocus: () => {},\n showUnderlay: true,\n 'data-is-underlay': true,\n minWidth: '800px',\n };\n\n return (\n // eslint-disable-next-line jsx-a11y-x/no-static-element-interactions\n <div\n onPointerDownCapture={(event) => {\n event.stopPropagation();\n event.preventDefault();\n }}\n onFocusCapture={(event) => {\n event.stopPropagation();\n event.preventDefault();\n }}\n data-test-id=\"internal-link-selector\"\n onKeyDown={onPressEnter}\n >\n <Dialog.Root modal open={isModalOpen} onOpenChange={setIsModalOpen}>\n <Dialog.Trigger asChild>\n <Button size={buttonSize} emphasis=\"default\">\n <IconLink size=\"20\" />\n Internal link\n </Button>\n </Dialog.Trigger>\n <Dialog.Content {...dialogProps}>\n <Dialog.Header>\n <Dialog.Title>Select internal link</Dialog.Title>\n </Dialog.Header>\n <Dialog.Body padding=\"none\">\n <ScrollArea padding=\"compact\">\n <DocumentLinks\n selectedUrl={selectedUrl}\n onSelectUrl={onSelectUrl}\n getAllDocuments={getAllDocuments}\n getDocumentPagesByDocumentId={getDocumentPagesByDocumentId}\n getDocumentSectionsByDocumentPageId={getDocumentSectionsByDocumentPageId}\n />\n </ScrollArea>\n </Dialog.Body>\n <Dialog.Footer>\n <Button size={buttonSize} emphasis=\"default\" onPress={() => setIsModalOpen(false)}>\n Cancel\n </Button>\n <Button size={buttonSize} disabled={!selectedUrl} emphasis=\"strong\" onPress={() => saveLink()}>\n Choose\n </Button>\n </Dialog.Footer>\n </Dialog.Content>\n </Dialog.Root>\n </div>\n );\n};\n"],"names":["LinkSelector","url","onUrlChange","buttonSize","getAllDocuments","getDocumentPagesByDocumentId","getDocumentSectionsByDocumentPageId","isModalOpen","setIsModalOpen","useState","selectedUrl","setSelectedUrl","onSelectUrl","onPressEnter","event","saveLink","useEffect","dialogProps","jsx","jsxs","Dialog","Button","IconLink","ScrollArea","DocumentLinks"],"mappings":";;;;;;AAmBO,MAAMA,IAAe,CAAC;AAAA,EACzB,KAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,iBAAAC;AAAA,EACA,8BAAAC;AAAA,EACA,qCAAAC;AACJ,MAAuC;AACnC,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9C,CAACC,GAAaC,CAAc,IAAIF,EAAiBR,CAAG,GAEpDW,IAAc,CAACX,MAAgB;AACjC,IAAAU,EAAeV,CAAG;AAAA,EACtB,GAEMY,IAAe,CAACC,MAA2C;AAC7D,IAAIA,EAAM,QAAQ,YACdA,EAAM,eAAA,GACNC,EAAA;AAAA,EAER;AAEA,EAAAC,EAAU,MAAM;AACZ,IAAIf,KAAO,CAACS,KAERC,EAAeV,CAAG;AAAA,EAE1B,GAAG,CAACA,GAAKS,CAAW,CAAC;AAErB,QAAMK,IAAW,MAAM;AACnB,IAAAb,KAAA,QAAAA,EAAcQ,IACdF,EAAe,EAAK;AAAA,EACxB,GAEMS,IAAc;AAAA,IAChB,iBAAiB,MAAM;AAAA,IAAC;AAAA,IACxB,cAAc;AAAA,IACd,oBAAoB;AAAA,IACpB,UAAU;AAAA,EAAA;AAGd;AAAA;AAAA,IAEI,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,sBAAsB,CAACJ,MAAU;AAC7B,UAAAA,EAAM,gBAAA,GACNA,EAAM,eAAA;AAAA,QACV;AAAA,QACA,gBAAgB,CAACA,MAAU;AACvB,UAAAA,EAAM,gBAAA,GACNA,EAAM,eAAA;AAAA,QACV;AAAA,QACA,gBAAa;AAAA,QACb,WAAWD;AAAA,QAEX,UAAA,gBAAAM,EAACC,EAAO,MAAP,EAAY,OAAK,IAAC,MAAMb,GAAa,cAAcC,GAChD,UAAA;AAAA,UAAA,gBAAAU,EAACE,EAAO,SAAP,EAAe,SAAO,IACnB,4BAACC,GAAA,EAAO,MAAMlB,GAAY,UAAS,WAC/B,UAAA;AAAA,YAAA,gBAAAe,EAACI,GAAA,EAAS,MAAK,KAAA,CAAK;AAAA,YAAE;AAAA,UAAA,EAAA,CAE1B,EAAA,CACJ;AAAA,UACA,gBAAAH,EAACC,EAAO,SAAP,EAAgB,GAAGH,GAChB,UAAA;AAAA,YAAA,gBAAAC,EAACE,EAAO,QAAP,EACG,UAAA,gBAAAF,EAACE,EAAO,OAAP,EAAa,kCAAoB,EAAA,CACtC;AAAA,YACA,gBAAAF,EAACE,EAAO,MAAP,EAAY,SAAQ,QACjB,UAAA,gBAAAF,EAACK,GAAA,EAAW,SAAQ,WAChB,UAAA,gBAAAL;AAAA,cAACM;AAAA,cAAA;AAAA,gBACG,aAAAd;AAAA,gBACA,aAAAE;AAAA,gBACA,iBAAAR;AAAA,gBACA,8BAAAC;AAAA,gBACA,qCAAAC;AAAA,cAAA;AAAA,YAAA,GAER,EAAA,CACJ;AAAA,YACA,gBAAAa,EAACC,EAAO,QAAP,EACG,UAAA;AAAA,cAAA,gBAAAF,EAACG,GAAA,EAAO,MAAMlB,GAAY,UAAS,WAAU,SAAS,MAAMK,EAAe,EAAK,GAAG,UAAA,SAAA,CAEnF;AAAA,cACA,gBAAAU,EAACG,GAAA,EAAO,MAAMlB,GAAY,UAAU,CAACO,GAAa,UAAS,UAAS,SAAS,MAAMK,EAAA,GAAY,UAAA,SAAA,CAE/F;AAAA,YAAA,EAAA,CACJ;AAAA,UAAA,EAAA,CACJ;AAAA,QAAA,EAAA,CACJ;AAAA,MAAA;AAAA,IAAA;AAAA;AAGZ;"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";var Rn=Object.defineProperty;var Dn=(e,t,n)=>t in e?Rn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var B=(e,t,n)=>Dn(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("@frontify/sidebar-settings"),s=require("react/jsx-runtime"),J=require("@frontify/app-bridge"),T=require("@frontify/fondue"),x=require("@frontify/fondue/components"),A=require("@frontify/fondue/icons"),g=require("react"),E=require("@dnd-kit/core"),Mn=require("@dnd-kit/modifiers"),pe=require("@dnd-kit/sortable"),dt=require("@react-aria/focus"),a=require("@frontify/fondue/rte"),xe=require("react-dom"),z=require("@ctrl/tinycolor"),V=e=>e.filter(Boolean).join(" "),Fn=({onDrop:e,label:t,icon:n,secondaryLabel:r,isLoading:o,fillParentContainer:i,onAssetChooseClick:l,onUploadClick:c,withMenu:d=!0,onClick:h,validFileType:p,verticalLayout:u})=>{const[f,v]=g.useState(!1),[w,C]=g.useState(),R=g.useRef(null),[I,M]=g.useState(void 0),$=k=>{if(k.preventDefault(),v(!1),!O(k.dataTransfer.files)){M("Invalid"),setTimeout(()=>{M(void 0)},1e3);return}e==null||e(k.dataTransfer.files)},O=k=>{if(!p)return!0;for(let F=0;F<k.length;F++){const _=k[F].name.split(".").pop()??"";if(!J.FileExtensionSets[p].includes(_))return!1}return!0},U=k=>{if(!R.current||o)return;const{clientX:F,clientY:_}=k,de=F===0&&_===0,{left:me,top:je,width:Ee,height:he}=R.current.getBoundingClientRect(),fe=de?Ee/2:F-me,W=de?he/2:_-je;C([fe,W])},S=g.useCallback(k=>{k(),C(void 0)},[]),Te=g.useMemo(()=>{const k=[];return c&&k.push({onSelect:()=>S(c),title:"Upload asset",icon:s.jsx(A.IconArrowCircleUp,{size:"20"})}),l&&k.push({onSelect:()=>S(l),title:"Browse asset",icon:s.jsx(A.IconImageStack,{size:"20"})}),k},[l,c,S]);return s.jsxs("button",{ref:R,"data-test-id":"block-inject-button",className:V(["tw-font-body tw-relative tw-text-sm tw-leading-4 tw-border tw-flex tw-items-center tw-justify-center tw-cursor-pointer tw-gap-3 tw-w-full first:tw-rounded-tl last:tw-rounded-br",u?"[&:not(:first-child)]:tw-border-t-0 first:tw-rounded-tr last:tw-rounded-bl":"[&:not(:first-child)]:tw-border-l-0 first:tw-rounded-bl last:tw-rounded-tr",i?"tw-h-full":"tw-h-[72px]",f&&!o?"tw-border-dashed":"tw-border-solid",w&&"tw-bg-blank-state-pressed-inverse",f&&"tw-bg-blank-state-weak-inverse",I?"!tw-border-red-50 !tw-cursor-not-allowed":" tw-border-blank-state-line",o||w||f||I?"":"tw-text-text-weak hover:tw-text-blank-state-hover hover:tw-bg-blank-state-hover-inverse hover:tw-border-blank-state-line-hover active:tw-text-blank-state-pressed active:tw-bg-blank-state-pressed-inverse active:tw-border-blank-state-line-hover",(f||w)&&!I?"[&>*]:tw-pointer-events-none tw-border-blank-state-line-hover":"tw-bg-blank-state-shaded-inverse tw-text-blank-state-shaded"]),onDragEnter:e?k=>{var F;if(v(!0),p==="Images")for(const _ of Array.from(k.dataTransfer.items))(F=_==null?void 0:_.type)!=null&&F.startsWith("image/")?M(void 0):M("Invalid")}:void 0,onDragLeave:e?()=>{v(!1),M(void 0)}:void 0,onDrop:e?$:void 0,onClick:k=>{d&&!w&&U(k),h==null||h()},children:[o?s.jsx(x.LoadingCircle,{}):I?s.jsxs("div",{className:" tw-flex tw-items-center tw-justify-center tw-text-red-60 tw-font-medium",children:[s.jsx(T.IconExclamationMarkTriangle,{}),I]}):s.jsxs(s.Fragment,{children:[n&&s.jsx("div",{children:n}),(t||r)&&s.jsxs("div",{className:"tw-flex tw-flex-col tw-items-start",children:[t&&s.jsx("div",{className:"tw-font-medium",children:t}),r&&s.jsx("div",{className:"tw-font-normal",children:r})]})]}),w&&s.jsx("div",{className:"tw-absolute tw-left-0 tw-top-full tw-z-20",style:{left:w[0],top:w[1]},children:s.jsxs(x.Flyout.Root,{open:!0,onOpenChange:k=>!k&&C(void 0),children:[s.jsx(x.Flyout.Trigger,{children:s.jsx("div",{})}),s.jsx(x.Flyout.Content,{triggerOffset:"compact",children:s.jsxs(x.Dropdown.Root,{open:!0,children:[s.jsx(x.Dropdown.Trigger,{children:s.jsx("div",{})}),s.jsx(x.Dropdown.Content,{triggerOffset:"compact",children:Te.map(k=>s.jsxs(x.Dropdown.Item,{onSelect:k.onSelect,children:[k.icon,k.title]},k.title))})]})})]})})]})},ee=e=>{const t=r=>typeof r=="object"&&["red","green","blue"].every(i=>r.hasOwnProperty(i)),n=r=>{const o=typeof r.alpha=="number"?r.alpha:1;return{r:r.red,g:r.green,b:r.blue,a:o}};return t(e)?n(e):e},On=e=>typeof e=="object"&&["red","green","blue"].every(n=>e==null?void 0:e.hasOwnProperty(n)),_n=(e,t)=>{const n=On(e)?ee(e):e,r=new z.TinyColor(n);return t?r.getBrightness()<t:r.isDark()||r.getAlpha()>.25&&r.getAlpha()<1},Un=e=>new z.TinyColor(ee(e)).toHex8String(),Hn=e=>new z.TinyColor(ee(e)).toHexString(),_e=e=>new z.TinyColor(ee(e)).toRgbString(),Vn=(e,t)=>new z.TinyColor(t).setAlpha(e).toRgbString(),zn=e=>{const{r:t,g:n,b:r,a:o}=new z.TinyColor(e);return{red:t,green:n,blue:r,alpha:o}},st=e=>typeof e=="object"&&["red","green","blue"].every(n=>e==null?void 0:e.hasOwnProperty(n)),$n=(e,t)=>{const n=st(e)?ee(e):e,r=st(t)?ee(t):t;let o=new z.TinyColor(n);const i=new z.TinyColor(r);for(;z.readability(o,i)<4.5;)o=o.darken(1);return o.toRgbString()},Wn=(e,t,n)=>{const r=[...e],o=n<0?r.length+n:n;if(o>=0&&o<r.length){const i=r.splice(t,1)[0];r.splice(o,0,i)}return r},qn=e=>({backgroundColor:_e(e)}),Gn={red:241,green:241,blue:241,alpha:1},ct={red:234,green:235,blue:235,alpha:1},Kn="1px",ce="24px",ue="24px";var H=(e=>(e.Solid="Solid",e.Dashed="Dashed",e.Dotted="Dotted",e))(H||{});const ut={Solid:"solid",Dotted:"dotted",Dashed:"dashed"};var q=(e=>(e.None="None",e.Small="Small",e.Medium="Medium",e.Large="Large",e))(q||{});const X={None:"0px",Small:"2px",Medium:"4px",Large:"12px"};var K=(e=>(e.None="None",e.Small="Small",e.Medium="Medium",e.Large="Large",e))(K||{});const te={None:"0px",Small:"24px",Medium:"36px",Large:"60px"};var Y=(e=>(e.None="None",e.Small="Small",e.Medium="Medium",e.Large="Large",e))(Y||{});const ne={None:"0px",Small:"24px",Medium:"36px",Large:"60px"};var Z=(e=>(e.Global="Global",e.Custom="Custom",e))(Z||{}),Q=(e=>(e.Auto="Auto",e.S="S",e.M="M",e.L="L",e))(Q||{});const gt={Auto:"4px",S:"10px",M:"30px",L:"50px"},Yn=(e=H.Solid,t="1px",n=ct)=>({borderStyle:ut[e],borderWidth:t,borderColor:_e(n)}),Qn=(e,t=!1,n)=>({borderRadius:t?n:X[e]}),Ue=g.createContext(!1);Ue.displayName="DragPreviewContext";const mt=({children:e,isDragPreview:t})=>s.jsx(Ue.Provider,{value:t,children:e}),ie=()=>g.useContext(Ue),He=g.createContext({openFlyoutIds:[],setOpenFlyoutIds:()=>console.error("No MultiFlyoutContext Provider found")});He.displayName="MultiFlyoutContext";const ht=({children:e,openFlyoutIds:t,setOpenFlyoutIds:n})=>{const r=g.useMemo(()=>({openFlyoutIds:t,setOpenFlyoutIds:n}),[t,n]);return s.jsx(He.Provider,{value:r,children:e})},ft=()=>g.useContext(He),ye=e=>{const{openFlyoutIds:t,setOpenFlyoutIds:n}=ft(),r=g.useCallback(o=>{n(i=>{const l=i.filter(c=>c!==e);return o?[...l,e]:l})},[e,n]);return{isOpen:t.includes(e),onOpenChange:r}},Ve=(e,t)=>{const{blockAssets:n,addAssetIdsToKey:r,deleteAssetIdsFromKey:o,updateAssetIdsFromKey:i}=t,l=(n==null?void 0:n[e])||[];return{onAttachmentsAdd:async u=>{await r(e,u.map(f=>f.id))},onAttachmentDelete:async u=>{await o(e,[u.id])},onAttachmentReplace:async(u,f)=>{const v=l.map(w=>w.id===u.id?f.id:w.id);await i(e,v)},onAttachmentsSorted:async u=>{const f=u.map(v=>v.id);await i(e,f)},attachments:l}},pt=(e,t)=>{const{onAttachmentsAdd:n,onAttachmentDelete:r,onAttachmentReplace:o,onAttachmentsSorted:i,attachments:l}=Ve(t,J.useBlockAssets(e));return{onAttachmentsAdd:n,onAttachmentDelete:r,onAttachmentReplace:o,onAttachmentsSorted:i,attachments:l,appBridge:e}},ve=g.createContext(null);ve.displayName="AttachmentsContext";const xt=({appBridge:e,children:t,assetId:n})=>{const r=pt(e,n);return s.jsx(ve.Provider,{value:r,children:t})},Xn=({blockAssetBundle:e,appBridge:t,children:n,assetId:r})=>{const o=Ve(r,e);return s.jsx(ve.Provider,{value:{...o,appBridge:t},children:n})},wt=()=>{const e=g.useContext(ve);if(!e)throw new Error("No AttachmentsContext Provided. Component must be wrapped in an 'AttachmentsProvider' or the 'withAttachmentsProvider' HOC");return e},Jn=(e,t)=>{const n=r=>s.jsx(xt,{appBridge:r.appBridge,assetId:t,children:s.jsx(e,{...r})});return n.displayName="withAttachmentsProvider",n},Zn=[E.KeyboardCode.Down,E.KeyboardCode.Right,E.KeyboardCode.Up,E.KeyboardCode.Left],bt=(e,t)=>(n,{currentCoordinates:r,context:{activeNode:o}})=>{if(n.preventDefault(),Zn.includes(n.code)){const i=(o==null?void 0:o.offsetWidth)??0,l=(o==null?void 0:o.offsetHeight)??0;switch(n.code){case E.KeyboardCode.Right:return{...r,x:r.x+i+e};case E.KeyboardCode.Left:return{...r,x:r.x-i-e};case E.KeyboardCode.Down:return{...r,y:r.y+l+t};case E.KeyboardCode.Up:return{...r,y:r.y-l-t}}}},er={start:["Space","Enter"],cancel:[],end:["Space","Enter","Escape"]},tr=(e=0,t=0)=>{const n=g.useMemo(()=>({coordinateGetter:bt(e,t),keyboardCodes:er}),[e,t]);return E.useSensors(E.useSensor(E.PointerSensor),E.useSensor(E.KeyboardSensor,n))},nr=e=>e==="IMAGE"?s.jsx(T.IconImage24,{}):e==="VIDEO"?s.jsx(T.IconPlayFrame24,{}):e==="AUDIO"?s.jsx(T.IconMusicNote24,{}):s.jsx(T.IconDocument24,{}),yt=g.forwardRef(({item:e,isEditing:t,draggableProps:n,transformStyle:r,isDragging:o,isOverlay:i,isLoading:l,onDelete:c,onReplaceWithBrowse:d,onReplaceWithUpload:h,onDownload:p},u)=>{const[f,v]=g.useState(),[w,{selectedFiles:C}]=J.useFileInput({multiple:!0,accept:"image/*"}),[R,{results:I,doneAll:M}]=J.useAssetUpload(),{focusProps:$,isFocusVisible:O}=dt.useFocusRing();g.useEffect(()=>{C&&R(C[0])},[C]),g.useEffect(()=>{M&&h(I[0])},[M,I]);const U=l||C&&!M;return s.jsxs("button",{"aria-label":"Download attachment","data-test-id":"attachments-item",onClick:()=>!f&&(p==null?void 0:p()),ref:u,style:{...r,opacity:o&&!i?.3:1,fontFamily:"var(-f-theme-settings-body-font-family)"},className:V(["tw-cursor-pointer tw-text-left tw-w-full tw-relative tw-flex tw-gap-3 tw-px-5 tw-py-3 tw-items-center tw-group hover:tw-bg-box-neutral-hover",o?"tw-bg-box-neutral-hover":""]),children:[s.jsx("div",{className:"tw-text-text-weak group-hover:tw-text-box-neutral-inverse-hover",children:U?s.jsx(x.LoadingCircle,{size:"small"}):nr(e.objectType)}),s.jsxs("div",{className:"tw-text-s tw-flex-1 tw-min-w-0",children:[s.jsx("div",{className:"tw-whitespace-nowrap tw-overflow-hidden tw-text-ellipsis tw-font-bold tw-text-text-weak group-hover:tw-text-box-neutral-inverse-hover",children:e.title}),s.jsx("div",{className:"tw-text-text-weak",children:`${e.fileSizeHumanReadable} - ${e.extension}`})]}),t&&s.jsxs("div",{"data-test-id":"attachments-actionbar",className:V(["tw-flex tw-gap-0.5 group-focus:tw-opacity-100 focus-visible:tw-opacity-100 focus-within:tw-opacity-100 group-hover:tw-opacity-100",i||(f==null?void 0:f.id)===e.id?"tw-opacity-100":"tw-opacity-0"]),children:[s.jsx("button",{...$,...n,"aria-label":"Drag attachment",className:V([" tw-border-button-border tw-bg-button-background active:tw-bg-button-background-pressed tw-group tw-border tw-box-box tw-relative tw-flex tw-items-center tw-justify-center tw-outline-none tw-font-medium tw-rounded tw-h-9 tw-w-9 ",o||i?"tw-cursor-grabbing tw-bg-button-background-pressed hover:tw-bg-button-background-pressed":"tw-cursor-grab hover:tw-bg-button-background-hover",O&&T.FOCUS_STYLE,O&&"tw-z-[2]"]),children:s.jsx(T.IconGrabHandle20,{})}),s.jsx("div",{"data-test-id":"attachments-actionbar-flyout",children:s.jsxs(x.Dropdown.Root,{open:(f==null?void 0:f.id)===e.id,onOpenChange:S=>v(S?e:void 0),children:[s.jsx(x.Dropdown.Trigger,{children:s.jsx(x.Button,{aspect:"square",ref:u,onPress:S=>{S==null||S.stopPropagation(),S==null||S.preventDefault()},emphasis:"default",children:s.jsx(A.IconPen,{size:"20"})})}),s.jsxs(x.Dropdown.Content,{side:"right",children:[s.jsxs(x.Dropdown.Group,{children:[s.jsxs(x.Dropdown.Item,{"data-test-id":"menu-item",onSelect:S=>{S==null||S.stopPropagation(),w(),v(void 0)},children:[s.jsx(A.IconArrowCircleUp,{size:"20"}),"Replace with upload"]}),s.jsxs(x.Dropdown.Item,{onSelect:S=>{S==null||S.stopPropagation(),d(),v(void 0)},children:[s.jsx(A.IconImageStack,{size:"20"}),"Replace with asset"]})]}),s.jsx(x.Dropdown.Group,{children:s.jsxs(x.Dropdown.Item,{emphasis:"danger",onSelect:S=>{S==null||S.stopPropagation(),c(),v(void 0)},children:[s.jsx(A.IconTrashBin,{size:"20"}),"Delete"]})})]})]})})]})]})});yt.displayName="AttachmentItem";const rr=e=>{const{attributes:t,listeners:n,setNodeRef:r,transform:o,transition:i,isDragging:l}=pe.useSortable({id:e.item.id}),c={transform:o?`translate(${o.x}px, ${o.y}px)`:"",transition:i,zIndex:l?2:1},d={...t,...n};return s.jsx(yt,{ref:r,isDragging:l,transformStyle:c,draggableProps:d,...e})},vt=g.forwardRef(({children:e,isFlyoutOpen:t,...n},r)=>s.jsxs("button",{ref:r,className:V(["tw-flex tw-text-xs tw-font-body tw-items-center tw-gap-1 tw-rounded-full tw-outline tw-outline-1 tw-outline-offset-1 tw-p-1.5 tw-outline-line",t?"tw-bg-box-neutral-pressed tw-text-box-neutral-inverse-pressed":"tw-bg-base hover:tw-bg-box-neutral-hover active:tw-bg-box-neutral-pressed tw-text-box-neutral-inverse hover:tw-text-box-neutral-inverse-hover active:tw-text-box-neutral-inverse-pressed"]),"data-test-id":"attachments-button-trigger",...n,children:[s.jsx(T.IconPaperclip16,{}),e,s.jsx(T.IconCaretDown12,{})]}));vt.displayName="AttachmentsButtonTrigger";const Ct=({items:e=[],onDelete:t,onReplaceWithBrowse:n,onReplaceWithUpload:r,onBrowse:o,onUpload:i,onSorted:l,appBridge:c,triggerComponent:d=vt,isOpen:h,onOpenChange:p})=>{const[u,f]=g.useState(e),[v,w]=g.useState(!1),C=E.useSensors(E.useSensor(E.PointerSensor),E.useSensor(E.KeyboardSensor)),[R,I]=g.useState(void 0),[M,$]=g.useState(!1),[O,U]=g.useState([]),[S,Te]=g.useState(null),k=J.useEditorState(c),{openAssetChooser:F,closeAssetChooser:_}=J.useAssetChooser(c),de=h!==void 0,me=de?h:v,je=u==null?void 0:u.find(y=>y.id===R),[Ee,{results:he,doneAll:fe}]=J.useAssetUpload({onUploadProgress:()=>!M&&$(!0)}),W=y=>{const D=de?p:w;D==null||D(y)};g.useEffect(()=>{f(e)},[e]),g.useEffect(()=>{S&&($(!0),Ee(S))},[S]),g.useEffect(()=>{(async()=>{fe&&(await i(he),$(!1))})()},[fe,he]);const Tn=()=>{W(!1),F(y=>{o(y),_(),W(!0)},{multiSelection:!0,selectedValueIds:u.map(y=>y.id)})},jn=y=>{W(!1),F(async D=>{W(!0),_(),U([...O,y.id]),await n(y,D[0]),U(O.filter(G=>G!==y.id))},{multiSelection:!1,selectedValueIds:u.map(D=>D.id)})},En=async(y,D)=>{U([...O,y.id]),await r(y,D),U(O.filter(G=>G!==y.id))},In=y=>{const{active:D}=y;I(D.id)},Bn=y=>{const{active:D,over:G}=y;if(G&&D.id!==G.id&&u){const An=u.findIndex(Ie=>Ie.id===D.id),Ln=u.findIndex(Ie=>Ie.id===G.id),rt=pe.arrayMove(u,An,Ln);f(rt),l(rt)}I(void 0)},Nn={onOpenAutoFocus:y=>{y.preventDefault()},onEscapeKeyDown:y=>{y.stopPropagation(),W(!1)}};return k||((u==null?void 0:u.length)??0)>0?s.jsx("div",{"data-test-id":"attachments-flyout-button",children:s.jsx(x.Flyout.Root,{open:me,onOpenChange:y=>W(je?!0:y),children:s.jsxs(x.Tooltip.Root,{enterDelay:500,children:[s.jsx(x.Tooltip.Trigger,{asChild:!0,children:s.jsx(x.Flyout.Trigger,{asChild:!0,"data-test-id":"attachments-button-trigger",children:s.jsx(d,{isFlyoutOpen:me,children:s.jsx("div",{children:e.length>0?e.length:"Add"})})})}),s.jsx(x.Flyout.Content,{side:"bottom",align:"end",...Nn,children:s.jsxs("div",{className:"tw-w-[300px]","data-test-id":"attachments-flyout-content",children:[u.length>0&&s.jsx(E.DndContext,{sensors:C,collisionDetection:E.closestCenter,onDragStart:In,onDragEnd:Bn,modifiers:[Mn.restrictToVerticalAxis],children:s.jsx(pe.SortableContext,{items:u,strategy:pe.rectSortingStrategy,children:s.jsx("div",{className:"tw-border-b tw-border-b-line tw-relative",children:u.map(y=>s.jsx(rr,{isEditing:k,isLoading:O.includes(y.id),item:y,onDelete:()=>t(y),onReplaceWithBrowse:()=>jn(y),onReplaceWithUpload:D=>En(y,D),onDownload:()=>c.dispatch({name:"downloadAsset",payload:y})},y.id))})})}),k&&s.jsxs("div",{className:"tw-px-5 tw-py-3",children:[s.jsx("div",{className:"tw-font-body tw-font-medium tw-text-text tw-text-s tw-my-4",children:"Add attachments"}),s.jsx(T.AssetInput,{isLoading:M,size:T.AssetInputSize.Small,onUploadClick:y=>Te(y),onLibraryClick:Tn})]})]})}),s.jsx(x.Tooltip.Content,{side:"top",children:"Attachments"})]})})}):null},sr=(e,t)=>{const n=[T.FOCUS_VISIBLE_STYLE,"tw-relative tw-inline-flex tw-items-center tw-justify-center","tw-h-6 tw-p-1","tw-rounded","tw-text-xs tw-font-medium","tw-gap-0.5","focus-visible:tw-z-10"];return t?n.push("tw-bg-box-neutral-pressed","tw-text-box-neutral-inverse-pressed",e==="grab"?"tw-cursor-grabbing":"tw-cursor-pointer"):n.push("hover:tw-bg-box-neutral-hover active:tw-bg-box-neutral-pressed","tw-text-text-weak hover:tw-text-box-neutral-inverse-hover active:tw-text-box-neutral-inverse-pressed",e==="grab"?"!tw-cursor-grab active:tw-cursor-grabbing":"tw-cursor-pointer"),V(n)},le=g.forwardRef(({onClick:e,children:t,forceActiveStyle:n,cursor:r="pointer","data-test-id":o="base-toolbar-button",...i},l)=>s.jsx("button",{onClick:e,className:sr(r,n),"data-test-id":o,...i,ref:l,children:t}));le.displayName="BaseToolbarButton";const kt=g.forwardRef(({children:e,isFlyoutOpen:t,...n},r)=>s.jsxs(le,{forceActiveStyle:t,"data-test-id":"attachments-toolbar-button-trigger",ref:r,...n,children:[s.jsx(T.IconPaperclip16,{}),e,s.jsx(T.IconCaretDown12,{})]}));kt.displayName="AttachmentsToolbarButtonTrigger";const St="attachments",Pt=({flyoutId:e=St})=>{const t=T.useMemoizedId(e),{appBridge:n,attachments:r,onAttachmentsAdd:o,onAttachmentDelete:i,onAttachmentReplace:l,onAttachmentsSorted:c}=wt(),{isOpen:d,onOpenChange:h}=ye(t),p=ie();return s.jsx(Ct,{onUpload:o,onDelete:i,onReplaceWithBrowse:l,onReplaceWithUpload:l,onSorted:c,onBrowse:o,items:r,appBridge:n,triggerComponent:kt,isOpen:d&&!p,onOpenChange:h})},Tt="Drag or press ↵ to move",jt="Move with ↑↓←→ and confirm with ↵",ze=({content:e,children:t,open:n,disabled:r})=>r?t:s.jsxs(x.Tooltip.Root,{enterDelay:300,open:n,children:[s.jsx(x.Tooltip.Trigger,{asChild:!0,children:t}),s.jsx(x.Tooltip.Content,{side:"top",children:s.jsx("div",{children:e})})]}),Et=({tooltip:e,icon:t,setActivatorNodeRef:n,draggableProps:r})=>{const o=ie();return s.jsx(ze,{...o&&{open:o},content:s.jsx("div",{children:o?jt:e??Tt}),children:s.jsx(le,{ref:n,"data-test-id":"block-item-wrapper-toolbar-btn",forceActiveStyle:o,cursor:"grab",...r,children:t})})},It=({content:e,icon:t,tooltip:n,flyoutId:r,flyoutFooter:o,flyoutHeader:i})=>{const l=T.useMemoizedId(r),{isOpen:c,onOpenChange:d}=ye(l),h=ie();return s.jsx(ze,{disabled:h||c,content:n,children:s.jsx("div",{className:"tw-flex tw-flex-shrink-0 tw-flex-1 tw-h-6 tw-relative",children:s.jsxs(x.Flyout.Root,{open:c&&!h,onOpenChange:d,children:[s.jsx(x.Flyout.Trigger,{asChild:!0,children:s.jsx(le,{"data-test-id":"block-item-wrapper-toolbar-flyout",forceActiveStyle:c&&!h,children:t})}),s.jsxs(x.Flyout.Content,{side:"bottom",align:"end",padding:"comfortable",children:[i?s.jsx(x.Flyout.Header,{children:i}):null,s.jsx(x.Flyout.Body,{children:e}),o?s.jsx(x.Flyout.Footer,{children:o}):null]})]})})})},$e="menu",Bt=({items:e,flyoutId:t=$e,tooltip:n="Options"})=>{const r=T.useMemoizedId(t),{isOpen:o,onOpenChange:i}=ye(r),l=ie();return s.jsx(x.Dropdown.Root,{open:o&&!l,onOpenChange:i,children:s.jsxs(x.Tooltip.Root,{children:[s.jsx(x.Tooltip.Trigger,{asChild:!0,children:s.jsx(x.Dropdown.Trigger,{asChild:!0,children:s.jsx(le,{"data-test-id":"block-item-wrapper-toolbar-flyout",children:s.jsx(A.IconDotsHorizontal,{size:"16"})})})}),s.jsx(x.Dropdown.Content,{children:e.map((c,d)=>s.jsx(x.Dropdown.Group,{children:c.map((h,p)=>s.jsxs(x.Dropdown.Item,{"data-test-id":"menu-item",onSelect:()=>{i(!1),h.onClick()},emphasis:h.style||"default",children:[s.jsx("div",{className:"tw-mr-2",children:h.icon}),s.jsx("span",{children:h.title})]},`${d}-${p}`))},d))}),s.jsx(x.Tooltip.Content,{children:n})]})})},ar=({tooltip:e,icon:t,onClick:n})=>{const r=ie();return s.jsx(ze,{disabled:r,content:e??"",children:s.jsx(le,{"data-test-id":"block-item-wrapper-toolbar-btn",onClick:n,children:t})})},at=({children:e})=>s.jsx("div",{"data-test-id":"block-item-wrapper-toolbar-segment",className:"tw-pointer-events-auto tw-flex tw-flex-shrink-0 tw-gap-px tw-px-px tw-h-[26px] tw-items-center tw-self-start tw-leading-none",children:e}),Nt=({items:e,attachments:t})=>s.jsxs("div",{"data-test-id":"block-item-wrapper-toolbar",className:"tw-rounded-md tw-bg-base tw-border tw-border-line-strong tw-divide-x tw-divide-line-strong tw-shadow-lg tw-flex tw-flex-none tw-items-center tw-isolate",children:[t.isEnabled&&s.jsx(at,{children:s.jsx(Pt,{})}),e.length>0&&s.jsx(at,{children:e.map(n=>{switch(n.type){case"dragHandle":return s.jsx(Et,{...n},n.tooltip+n.type);case"menu":return s.jsx(Bt,{...n},n.tooltip+n.type);case"flyout":return s.jsx(It,{...n},n.tooltip+n.type);default:return s.jsx(ar,{...n},n.tooltip+n.type)}})})]}),At=g.memo(({children:e,toolbarItems:t,shouldHideWrapper:n,shouldHideComponent:r=!1,isDragging:o=!1,shouldFillContainer:i,outlineOffset:l=0,shouldBeShown:c=!1,showAttachments:d=!1})=>{const[h,p]=g.useState(c?[$e]:[]),u=g.useRef(null);if(n)return s.jsx(s.Fragment,{children:e});const f=t==null?void 0:t.filter(w=>w!==void 0),v=h.length>0||c;return s.jsx(mt,{isDragPreview:o,children:s.jsx(ht,{openFlyoutIds:h,setOpenFlyoutIds:p,children:s.jsxs("div",{ref:u,"data-test-id":"block-item-wrapper",style:{outlineOffset:l},className:V(["tw-relative tw-group tw-outline-1 tw-outline-box-selected-inverse",i&&"tw-flex-1 tw-h-full tw-w-full","hover:tw-outline focus-within:tw-outline",v&&"tw-outline",r&&"tw-opacity-0"]),children:[s.jsx("div",{style:{right:-1-l,bottom:`calc(100% - ${2+l}px)`},className:V(["tw-pointer-events-none tw-absolute tw-bottom-[calc(100%-4px)] tw-right-[-3px] tw-w-full tw-opacity-0 tw-z-[60]","group-hover:tw-opacity-100 group-focus:tw-opacity-100 focus-within:tw-opacity-100","tw-flex tw-justify-end",v&&"tw-opacity-100"]),children:s.jsx(Nt,{attachments:{isEnabled:d},items:f})}),e]})})})});At.displayName="BlockItemWrapper";const or=({onDownload:e,ariaLabel:t})=>{const{isFocused:n,focusProps:r}=dt.useFocusRing();return s.jsxs(x.Tooltip.Root,{enterDelay:500,children:[s.jsx(x.Tooltip.Trigger,{asChild:!0,children:s.jsx("button",{tabIndex:0,"aria-label":t??"Download",...r,className:V(["tw-outline-none tw-rounded",n&&T.FOCUS_STYLE]),onClick:e,onPointerDown:o=>o.preventDefault(),"data-test-id":"download-button",children:s.jsx("span",{className:"tw-flex tw-text-xs tw-font-body tw-items-center tw-gap-1 tw-rounded-full tw-bg-box-neutral-strong-inverse hover:tw-bg-box-neutral-strong-inverse-hover active:tw-bg-box-neutral-strong-inverse-pressed tw-text-box-neutral-strong tw-outline tw-outline-1 tw-outline-offset-1 tw-p-1.5 tw-outline-line",children:s.jsx(T.IconArrowCircleDown16,{})})})}),s.jsx(x.Tooltip.Content,{side:"top",children:"Download"})]})},ir=({ref:e,disabled:t,onChange:n})=>{g.useEffect(()=>{if(t||!e.current)return;let r=!1;const o=new IntersectionObserver(([i])=>{i.isIntersecting!==r&&(r=i.isIntersecting,n(i.isIntersecting))});return o.observe(e.current),()=>{o.disconnect()}},[e,t,n])},lr=({value:e="",gap:t,customClass:n,show:r=!0,plugins:o})=>{const[i,l]=g.useState(null);return g.useEffect(()=>{(async()=>{const d=await a.serializeRawToHtmlAsync(e,o,void 0,t,n);l(d)})().catch(console.error)},[e,t,o,n]),!r||i==="<br />"||i===null?null:s.jsx("div",{className:"tw-w-full tw-whitespace-pre-wrap","data-test-id":"rte-content-html",dangerouslySetInnerHTML:{__html:i}})},We=a.createStore("floatingButton")({openEditorId:null,mouseDown:!1,updated:!1,url:"",text:"",buttonStyle:"primary",newTab:!1,mode:"",isEditing:!1}).extendActions(e=>({reset:()=>{e.url(""),e.text(""),e.buttonStyle("primary"),e.newTab(!1),e.mode(""),e.isEditing(!1)}})).extendActions(e=>({show:(t,n)=>{e.mode(t),e.isEditing(!1),e.openEditorId(n)},hide:()=>{e.reset(),e.openEditorId(null)}})).extendSelectors(e=>({isOpen:t=>e.openEditorId===t})),N=We.set,L=We.get,ge=()=>We.use,Lt=e=>{if(!e)return!1;const t=n=>n.some(r=>r.text?r.text!=="":r.children?t(r.children):!1);try{const n=JSON.parse(e);return t(n)}catch{return!1}},dr=(e="p",t="",n)=>Lt(t)?t:JSON.stringify([{type:e,children:[{text:t,textStyle:e}],align:n}]),cr=(e,t,n)=>e===Z.Custom?t:n,ur=e=>e.map(Rt),Rt=e=>({id:e.id,title:e.name,colors:e.colors.map(mr)}),gr=e=>"revision"in e,mr=e=>{if(gr(e)){const{title:t,revision:n}=e;return{alpha:n.rgba.alpha?n.rgba.alpha/255:1,red:n.rgba.red??0,green:n.rgba.green??0,blue:n.rgba.blue??0,name:t??""}}return{alpha:e.alpha?e.alpha/255:1,red:e.red??0,green:e.green??0,blue:e.blue??0,name:e.name??""}},qe=(e,t)=>{const n=a.getAboveNode(e,{match:{type:a.ELEMENT_LINK}});return Array.isArray(n)?t(n[0]):""},hr=e=>qe(e,t=>{var n,r;return((r=(n=t.chosenLink)==null?void 0:n.searchResult)==null?void 0:r.link)||""}),fr=e=>qe(e,t=>t.url||""),Ge=e=>{var t,n;return e.url||((n=(t=e.chosenLink)==null?void 0:t.searchResult)==null?void 0:n.link)||""},pr=e=>qe(e,Ge),Ke=/^\/(document|r)\/\S+$/i,Ce=e=>{if(Ke.test(e))return e;try{return new URL(e),e}catch{return`https://${e}`}},ke=e=>{if(Ke.test(e))return!0;try{const t=new URL(e);return["http:","https:","mailto:","tel:"].includes(t.protocol)&&t.pathname!==""}catch{return!1}},se=e=>ke(Ce(e))||e==="",Dt=(e,{type:t})=>{const{apply:n,normalizeNode:r}=e;return e.apply=o=>{if(o.type!=="set_selection"){n(o);return}const i=o.newProperties;if(!(i!=null&&i.focus)||!i.anchor||!a.isCollapsed(i)){n(o);return}const l=a.getAboveNode(e,{at:i,match:{type:a.getPluginType(e,P)}});if(l){const[,c]=l;let d;a.isStartPoint(e,i.focus,c)&&(d=a.getPreviousNodeEndPoint(e,c)),a.isEndPoint(e,i.focus,c)&&(d=a.getNextNodeStartPoint(e,c)),d&&(o.newProperties={anchor:d,focus:d})}n(o)},e.normalizeNode=([o,i])=>{if(o.type===a.getPluginType(e,P)){const l=e.selection;if(l&&a.isCollapsed(l)&&a.isEndPoint(e,l.focus,i)){const c=a.getNextNodeStartPoint(e,i);if(c)a.select(e,c);else{const d=a.Path.next(i);a.insertNodes(e,{text:""},{at:d}),a.select(e,d)}}}r([o,i])},a.withRemoveEmptyNodes(e,a.mockPlugin({options:{types:t}}))},Mt=(e,t,n)=>{a.insertNodes(e,[Ut(e,t)],n)},Ye=e=>{if(!e.selection)return;const{isUrl:t,forceSubmit:n}=a.getPluginOptions(e,P),r=L.url();if(!((t==null?void 0:t(r))||n))return;const i=L.text(),l=L.buttonStyle(),c=L.newTab()?void 0:"_self";return N.reset(),Ft(e,{url:r,text:i,buttonStyle:l,target:c,isUrl:d=>n||!t?!0:t(d)}),setTimeout(()=>{a.focusEditor(e,e.selection??void 0)},0),!0},ae=(e,t)=>a.withoutNormalizing(e,()=>{var n,r,o,i,l,c;if(t!=null&&t.split){if(a.getAboveNode(e,{at:(n=e.selection)==null?void 0:n.anchor,match:{type:a.getPluginType(e,P)}}))return a.splitNodes(e,{at:(r=e.selection)==null?void 0:r.anchor,match:p=>a.isElement(p)&&p.type===a.getPluginType(e,P)}),ae(e,{at:(o=e.selection)==null?void 0:o.anchor}),!0;if(a.getAboveNode(e,{at:(i=e.selection)==null?void 0:i.focus,match:{type:a.getPluginType(e,P)}}))return a.splitNodes(e,{at:(l=e.selection)==null?void 0:l.focus,match:p=>a.isElement(p)&&p.type===a.getPluginType(e,P)}),ae(e,{at:(c=e.selection)==null?void 0:c.focus}),!0}a.unwrapNodes(e,{match:{type:a.getPluginType(e,P)},...t})}),Ft=(e,{url:t,text:n,buttonStyle:r,target:o,insertTextInButton:i,insertNodesOptions:l,isUrl:c=a.getPluginOptions(e,P).isUrl})=>{var I;const d=e.selection;if(!d)return;const h=a.getAboveNode(e,{at:d,match:{type:a.getPluginType(e,P)}});if(i&&h)return e.insertText(t),!0;if(!(c!=null&&c(t)))return;if(a.isDefined(n)&&n.length===0&&(n=t),h)return br(t,e,h,o,r,n),!0;const p=a.findNode(e,{at:d,match:{type:a.getPluginType(e,P)}}),[u,f]=p??[],v=xr(e,f,n);if(a.isExpanded(d))return wr(h,e,t,r,o,n),!0;v&&a.removeNodes(e,{at:f});const w=a.getNodeProps(u??{}),C=(I=e.selection)==null?void 0:I.focus.path;if(!C)return;const R=a.getNodeLeaf(e,C);return n!=null&&n.length||(n=t),Mt(e,{...w,url:t,target:o,children:[{...R,text:n}]},l),!0};function xr(e,t,n){return t&&(n==null?void 0:n.length)&&n!==a.getEditorString(e,t)}function wr(e,t,n,r,o,i){e?ae(t,{at:e[1]}):ae(t,{split:!0}),Ot(t,{url:n,buttonStyle:r,target:o}),Qe(t,{text:i})}function br(e,t,n,r,o,i){var l,c,d;(e!==((l=n[0])==null?void 0:l.url)||r!==((c=n[0])==null?void 0:c.target)||o!==((d=n[0])==null?void 0:d.buttonStyle))&&a.setNodes(t,{url:e,target:r,buttonStyle:o},{at:n[1]}),Qe(t,{text:i})}const Qe=(e,{text:t})=>{const n=a.getAboveNode(e,{match:{type:a.getPluginType(e,P)}});if(n){const[r,o]=n;if(t!=null&&t.length&&t!==a.getEditorString(e,o)){const i=r.children[0];a.replaceNodeChildren(e,{at:o,nodes:{...i,text:t},insertOptions:{select:!0}})}}},Ot=(e,{url:t,buttonStyle:n,target:r,...o})=>{a.wrapNodes(e,{type:a.getPluginType(e,P),url:t,buttonStyle:n,target:r,children:[]},{split:!0,...o})},yr=(e,t)=>{const n=a.getAboveNode(e,{match:{type:P}});return Array.isArray(n)?t(n[0]):""},_t=e=>yr(e,t=>t.url??""),Ut=(e,{url:t,text:n="",buttonStyle:r="primary",target:o,children:i})=>({type:a.getPluginType(e,P),url:t,target:o,buttonStyle:r,children:i??[{text:n}]}),Ht=(e,{focused:t}={})=>{if(L.mode()==="edit"){Se(e);return}Xe(e,{focused:t})},Se=e=>{const t=a.findNode(e,{match:{type:a.getPluginType(e,P)}});if(!t)return;const[n,r]=t;let o=a.getEditorString(e,r);N.url(n.url),N.newTab(n.target===void 0),o===n.url&&(o=""),N.text(o),N.isEditing(!0)},Xe=(e,{focused:t}={})=>{L.mode()||!t||a.isRangeAcrossBlocks(e,{at:e.selection})||a.someNode(e,{match:{type:a.getPluginType(e,P)}})||(N.text(a.getEditorString(e,e.selection)),N.show("insert",e.id))},Be={marginTop:"10px",marginBottom:"10px",display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",verticalAlign:"middle",boxSizing:"border-box",overflowWrap:"normal"},Pe={buttonPrimary:{...Be,fontFamily:"var(--f-theme-settings-button-primary-font-family)",fontSize:"var(--f-theme-settings-button-primary-font-size)",fontWeight:"var(--f-theme-settings-button-primary-font-weight)",lineHeight:"var(--f-theme-settings-button-primary-line-height)",paddingTop:"var(--f-theme-settings-button-primary-padding-top)",paddingRight:"var(--f-theme-settings-button-primary-padding-right)",paddingBottom:"var(--f-theme-settings-button-primary-padding-bottom)",paddingLeft:"var(--f-theme-settings-button-primary-padding-left)",fontStyle:"var(--f-theme-settings-button-primary-font-style)",textTransform:"var(--f-theme-settings-button-primary-text-transform)",backgroundColor:"var(--f-theme-settings-button-primary-background-color)",borderColor:"var(--f-theme-settings-button-primary-border-color)",borderRadius:"var(--f-theme-settings-button-primary-border-radius)",borderWidth:"var(--f-theme-settings-button-primary-border-width)",color:"var(--f-theme-settings-button-primary-color)",hover:{backgroundColor:"var(--f-theme-settings-button-primary-background-color-hover)",borderColor:"var(--f-theme-settings-button-primary-border-color-hover)",color:"var(--f-theme-settings-button-primary-color-hover)"}},buttonSecondary:{...Be,fontFamily:"var(--f-theme-settings-button-secondary-font-family)",fontSize:"var(--f-theme-settings-button-secondary-font-size)",fontWeight:"var(--f-theme-settings-button-secondary-font-weight)",lineHeight:"var(--f-theme-settings-button-secondary-line-height)",paddingTop:"var(--f-theme-settings-button-secondary-padding-top)",paddingRight:"var(--f-theme-settings-button-secondary-padding-right)",paddingBottom:"var(--f-theme-settings-button-secondary-padding-bottom)",paddingLeft:"var(--f-theme-settings-button-secondary-padding-left)",fontStyle:"var(--f-theme-settings-button-secondary-font-style)",textTransform:"var(--f-theme-settings-button-secondary-text-transform)",backgroundColor:"var(--f-theme-settings-button-secondary-background-color)",borderColor:"var(--f-theme-settings-button-secondary-border-color)",borderRadius:"var(--f-theme-settings-button-secondary-border-radius)",borderWidth:"var(--f-theme-settings-button-secondary-border-width)",color:"var(--f-theme-settings-button-secondary-color)",hover:{backgroundColor:"var(--f-theme-settings-button-secondary-background-color-hover)",borderColor:"var(--f-theme-settings-button-secondary-border-color-hover)",color:"var(--f-theme-settings-button-secondary-color-hover)"}},buttonTertiary:{...Be,fontFamily:"var(--f-theme-settings-button-tertiary-font-family)",fontSize:"var(--f-theme-settings-button-tertiary-font-size)",fontWeight:"var(--f-theme-settings-button-tertiary-font-weight)",lineHeight:"var(--f-theme-settings-button-tertiary-line-height)",paddingTop:"var(--f-theme-settings-button-tertiary-padding-top)",paddingRight:"var(--f-theme-settings-button-tertiary-padding-right)",paddingBottom:"var(--f-theme-settings-button-tertiary-padding-bottom)",paddingLeft:"var(--f-theme-settings-button-tertiary-padding-left)",fontStyle:"var(--f-theme-settings-button-tertiary-font-style)",textTransform:"var(--f-theme-settings-button-tertiary-text-transform)",backgroundColor:"var(--f-theme-settings-button-tertiary-background-color)",borderColor:"var(--f-theme-settings-button-tertiary-border-color)",borderRadius:"var(--f-theme-settings-button-tertiary-border-radius)",borderWidth:"var(--f-theme-settings-button-tertiary-border-width)",color:"var(--f-theme-settings-button-tertiary-color)",hover:{backgroundColor:"var(--f-theme-settings-button-tertiary-background-color-hover)",borderColor:"var(--f-theme-settings-button-tertiary-border-color-hover)",color:"var(--f-theme-settings-button-tertiary-color-hover)"}}},vr=e=>{var l,c;const{attributes:t,children:n}=e,r=e.element.url||((c=(l=e.element.chosenLink)==null?void 0:l.searchResult)==null?void 0:c.link)||"",o=e.element.target||"_self",i=String(e.element.buttonStyle)||"primary";return s.jsx(Cr,{attributes:t,href:r,target:o,styles:Pe[`button${i.charAt(0).toUpperCase()+i.slice(1)}`],children:n})},Cr=({attributes:e,styles:t={hover:{}},children:n,href:r="#",target:o})=>{const[i,l]=g.useState(!1);return s.jsx("a",{...e,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),href:r,target:o,style:i?{...t,...t.hover}:t,children:n})};class kr extends a.MarkupElement{constructor(t=P,n=vr){super(t,n)}}const Vt=g.forwardRef((e,t)=>{const n=a.useEditorRef();return s.jsx(a.ToolbarButton,{ref:t,...e,onMouseDown:r=>{r.preventDefault(),a.focusEditor(n,n.selection??n.prevSelection??void 0)},onClick:()=>{Ht(n,{focused:!0})},children:s.jsx(a.IconStylingWrapper,{icon:s.jsx(A.IconButton,{size:16})})})});Vt.displayName="ButtonToolbarButton";const Sr=({editorId:e,id:t})=>{const n=a.useEditorState(a.useEventPlateId(e)),r=!!a.isRangeInSameBlock(n,{at:n.selection}),o=a.getPluginType(n,P),i=!!(n!=null&&n.selection)&&a.someNode(n,{match:{type:o}});return s.jsx("div",{"data-plugin-id":t,children:s.jsx(Vt,{pressed:i,disabled:!r,tooltip:a.getTooltip(r?`Button
|
|
2
|
-
${a.getHotkeyByPlatform("Ctrl+Shift+K")}`:"Buttons can only be set for a single text block.")})})},oe="link-plugin";var b=(e=>(e.heading1="heading1",e.heading2="heading2",e.heading3="heading3",e.heading4="heading4",e.custom1="custom1",e.custom2="custom2",e.custom3="custom3",e.quote="quote",e.imageCaption="imageCaption",e.imageTitle="imageTitle",e.p="p",e))(b||{});const j={heading1:{fontSize:"var(--f-theme-settings-heading1-font-size)",lineHeight:"var(--f-theme-settings-heading1-line-height)",marginTop:"var(--f-theme-settings-heading1-margin-top)",marginBottom:"var(--f-theme-settings-heading1-margin-bottom)",textDecoration:"var(--f-theme-settings-heading1-text-decoration)",fontStyle:"var(--f-theme-settings-heading1-font-style)",textTransform:"var(--f-theme-settings-heading1-text-transform)",letterSpacing:"var(--f-theme-settings-heading1-letter-spacing)",fontWeight:"var(--f-theme-settings-heading1-font-weight)",fontFamily:"var(--f-theme-settings-heading1-font-family)",color:"var(--f-theme-settings-heading1-color)"},heading2:{fontSize:"var(--f-theme-settings-heading2-font-size)",lineHeight:"var(--f-theme-settings-heading2-line-height)",marginTop:"var(--f-theme-settings-heading2-margin-top)",marginBottom:"var(--f-theme-settings-heading2-margin-bottom)",textDecoration:"var(--f-theme-settings-heading2-text-decoration)",fontStyle:"var(--f-theme-settings-heading2-font-style)",textTransform:"var(--f-theme-settings-heading2-text-transform)",letterSpacing:"var(--f-theme-settings-heading2-letter-spacing)",fontWeight:"var(--f-theme-settings-heading2-font-weight)",fontFamily:"var(--f-theme-settings-heading2-font-family)",color:"var(--f-theme-settings-heading2-color)"},heading3:{fontSize:"var(--f-theme-settings-heading3-font-size)",lineHeight:"var(--f-theme-settings-heading3-line-height)",marginTop:"var(--f-theme-settings-heading3-margin-top)",marginBottom:"var(--f-theme-settings-heading3-margin-bottom)",textDecoration:"var(--f-theme-settings-heading3-text-decoration)",fontStyle:"var(--f-theme-settings-heading3-font-style)",textTransform:"var(--f-theme-settings-heading3-text-transform)",letterSpacing:"var(--f-theme-settings-heading3-letter-spacing)",fontWeight:"var(--f-theme-settings-heading3-font-weight)",fontFamily:"var(--f-theme-settings-heading3-font-family)",color:"var(--f-theme-settings-heading3-color)"},heading4:{fontSize:"var(--f-theme-settings-heading4-font-size)",lineHeight:"var(--f-theme-settings-heading4-line-height)",marginTop:"var(--f-theme-settings-heading4-margin-top)",marginBottom:"var(--f-theme-settings-heading4-margin-bottom)",textDecoration:"var(--f-theme-settings-heading4-text-decoration)",fontStyle:"var(--f-theme-settings-heading4-font-style)",textTransform:"var(--f-theme-settings-heading4-text-transform)",letterSpacing:"var(--f-theme-settings-heading4-letter-spacing)",fontWeight:"var(--f-theme-settings-heading4-font-weight)",fontFamily:"var(--f-theme-settings-heading4-font-family)",color:"var(--f-theme-settings-heading4-color)"},custom1:{fontSize:"var(--f-theme-settings-custom1-font-size)",lineHeight:"var(--f-theme-settings-custom1-line-height)",marginTop:"var(--f-theme-settings-custom1-margin-top)",marginBottom:"var(--f-theme-settings-custom1-margin-bottom)",textDecoration:"var(--f-theme-settings-custom1-text-decoration)",fontStyle:"var(--f-theme-settings-custom1-font-style)",textTransform:"var(--f-theme-settings-custom1-text-transform)",letterSpacing:"var(--f-theme-settings-custom1-letter-spacing)",fontWeight:"var(--f-theme-settings-custom1-font-weight)",fontFamily:"var(--f-theme-settings-custom1-font-family)",color:"var(--f-theme-settings-custom1-color)"},custom2:{fontSize:"var(--f-theme-settings-custom2-font-size)",lineHeight:"var(--f-theme-settings-custom2-line-height)",marginTop:"var(--f-theme-settings-custom2-margin-top)",marginBottom:"var(--f-theme-settings-custom2-margin-bottom)",textDecoration:"var(--f-theme-settings-custom2-text-decoration)",fontStyle:"var(--f-theme-settings-custom2-font-style)",textTransform:"var(--f-theme-settings-custom2-text-transform)",letterSpacing:"var(--f-theme-settings-custom2-letter-spacing)",fontWeight:"var(--f-theme-settings-custom2-font-weight)",fontFamily:"var(--f-theme-settings-custom2-font-family)",color:"var(--f-theme-settings-custom2-color)"},custom3:{fontSize:"var(--f-theme-settings-custom3-font-size)",lineHeight:"var(--f-theme-settings-custom3-line-height)",marginTop:"var(--f-theme-settings-custom3-margin-top)",marginBottom:"var(--f-theme-settings-custom3-margin-bottom)",textDecoration:"var(--f-theme-settings-custom3-text-decoration)",fontStyle:"var(--f-theme-settings-custom3-font-style)",textTransform:"var(--f-theme-settings-custom3-text-transform)",letterSpacing:"var(--f-theme-settings-custom3-letter-spacing)",fontWeight:"var(--f-theme-settings-custom3-font-weight)",fontFamily:"var(--f-theme-settings-custom3-font-family)",color:"var(--f-theme-settings-custom3-color)"},p:{fontSize:"var(--f-theme-settings-body-font-size)",lineHeight:"var(--f-theme-settings-body-line-height)",marginTop:"var(--f-theme-settings-body-margin-top)",marginBottom:"var(--f-theme-settings-body-margin-bottom)",textDecoration:"var(--f-theme-settings-body-text-decoration)",fontStyle:"var(--f-theme-settings-body-font-style)",textTransform:"var(--f-theme-settings-body-text-transform)",letterSpacing:"var(--f-theme-settings-body-letter-spacing)",fontWeight:"var(--f-theme-settings-body-font-weight)",fontFamily:"var(--f-theme-settings-body-font-family)",color:"var(--f-theme-settings-body-color)"},quote:{fontSize:"var(--f-theme-settings-quote-font-size)",lineHeight:"var(--f-theme-settings-quote-line-height)",marginTop:"var(--f-theme-settings-quote-margin-top)",marginBottom:"var(--f-theme-settings-quote-margin-bottom)",textDecoration:"var(--f-theme-settings-quote-text-decoration)",fontStyle:"var(--f-theme-settings-quote-font-style)",textTransform:"var(--f-theme-settings-quote-text-transform)",letterSpacing:"var(--f-theme-settings-quote-letter-spacing)",fontWeight:"var(--f-theme-settings-quote-font-weight)",fontFamily:"var(--f-theme-settings-quote-font-family)",color:"var(--f-theme-settings-quote-color)"},imageCaption:{fontSize:"var(--f-theme-settings-image-caption-font-size)",lineHeight:"var(--f-theme-settings-image-caption-line-height)",marginTop:"var(--f-theme-settings-image-caption-margin-top)",marginBottom:"var(--f-theme-settings-image-caption-margin-bottom)",textDecoration:"var(--f-theme-settings-image-caption-text-decoration)",fontStyle:"var(--f-theme-settings-image-caption-font-style)",textTransform:"var(--f-theme-settings-image-caption-text-transform)",letterSpacing:"var(--f-theme-settings-image-caption-letter-spacing)",fontWeight:"var(--f-theme-settings-image-caption-font-weight)",fontFamily:"var(--f-theme-settings-image-caption-font-family)",color:"var(--f-theme-settings-image-caption-color)"},imageTitle:{fontSize:"var(--f-theme-settings-image-title-font-size)",lineHeight:"var(--f-theme-settings-image-title-line-height)",marginTop:"var(--f-theme-settings-image-title-margin-top)",marginBottom:"var(--f-theme-settings-image-title-margin-bottom)",textDecoration:"var(--f-theme-settings-image-title-text-decoration)",fontStyle:"var(--f-theme-settings-image-title-font-style)",textTransform:"var(--f-theme-settings-image-title-text-transform)",letterSpacing:"var(--f-theme-settings-image-title-letter-spacing)",fontWeight:"var(--f-theme-settings-image-title-font-weight)",fontFamily:"var(--f-theme-settings-image-title-font-family)",color:"var(--f-theme-settings-image-title-color)"},[oe]:{fontSize:"var(--f-theme-settings-link-font-size)",lineHeight:"var(--f-theme-settings-link-line-height)",marginTop:"var(--f-theme-settings-link-margin-top)",marginBottom:"var(--f-theme-settings-link-margin-bottom)",textDecoration:"var(--f-theme-settings-link-text-decoration)",fontStyle:"var(--f-theme-settings-link-font-style)",textTransform:"var(--f-theme-settings-link-text-transform)",letterSpacing:"var(--f-theme-settings-link-letter-spacing)",fontWeight:"var(--f-theme-settings-link-font-weight)",fontFamily:"var(--f-theme-settings-link-font-family)",color:"var(--f-theme-settings-link-color)"},...Pe},Pr=()=>{const e=a.useEditorRef();return s.jsx(a.FloatingModalWrapper,{padding:"16px",minWidth:"400px","data-test-id":"floating-button-edit",children:s.jsxs("span",{"data-test-id":"preview-button-flyout",className:"tw-flex tw-justify-between tw-items-center tw-gap-2",children:[s.jsx("a",{"data-test-id":"floating-button-edit-url",href:L.url(),target:"_blank",rel:"noopener noreferrer",style:j[oe],className:"tw-break-all",children:L.url()}),s.jsxs("span",{className:"tw-flex tw-gap-2",children:[s.jsx("button",{onClick:()=>{Se(e)},tabIndex:0,"data-test-id":"edit-button-button",className:"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",children:s.jsx(A.IconPen,{size:16})}),s.jsx("button",{onClick:()=>{ae(e),a.focusEditor(e,e.selection??void 0)},tabIndex:0,"data-test-id":"remove-button-button",className:"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",children:s.jsx(A.IconTrashBin,{size:16})})]})]})})},zt=e=>e.filter(t=>{var n;return!!((n=t.title)!=null&&n.trim())}),$t=()=>s.jsx("div",{className:"tw-flex tw-justify-center tw-h-10 tw-items-center",children:s.jsx(x.LoadingCircle,{size:"small"})}),Tr=({section:e,selectedUrl:t,onSelectUrl:n})=>{const r=e.permanentLink===t;return s.jsx("button",{"data-test-id":"internal-link-selector-section-link","data-is-active":r,className:T.merge(["tw-py-2 tw-pr-2.5 tw-pl-14 tw-leading-5 tw-cursor-pointer tw-w-full",r?"tw-bg-box-selected-strong tw-text-box-selected-strong-inverse hover:tw-bg-box-selected-strong-hover:hover hover:tw-text-box-selected-strong-inverse-hover:hover":"hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover"]),onClick:()=>n(e.permanentLink),children:s.jsxs("div",{className:"tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-h-6",children:[s.jsx(A.IconDocumentText,{size:16}),s.jsx("span",{className:"tw-text-s",children:e.title}),s.jsx("span",{className:"tw-flex-auto tw-font-sans tw-text-xs tw-text-right",children:"Section"})]})})},jr=({page:e,selectedUrl:t,onSelectUrl:n,itemsToExpandInitially:r,getDocumentSectionsByDocumentPageId:o})=>{const[i,l]=g.useState(e.id===r.documentId),[c,d]=g.useState([]),h=e.permanentLink===t;g.useEffect(()=>{(async()=>{const f=await o(e.id),v=zt(f);d(v)})()},[e.id,o]),g.useEffect(()=>{e.id===r.pageId&&l(!0)},[r,e.id]);const p=c.length>0;return s.jsxs(s.Fragment,{children:[s.jsx("button",{"data-test-id":"internal-link-selector-page-link",className:T.merge(["tw-py-2 tw-pr-2.5 tw-leading-5 tw-cursor-pointer tw-flex tw-w-full",p?"tw-pl-7":"tw-pl-12",h?"tw-bg-box-selected-strong tw-text-box-selected-strong-inverse hover:tw-bg-box-selected-strong-hover:hover hover:tw-text-box-selected-strong-inverse-hover:hover":"hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover"]),onClick:()=>n(e.permanentLink),children:s.jsxs("div",{className:"tw-flex tw-flex-1 tw-space-x-1 tw-items-center tw-h-6",children:[p&&s.jsx("button",{"data-test-id":"tree-item-toggle",className:"tw-flex tw-items-center tw-justify-center -tw-mr-2 tw-pr-3.5 tw-pt-1.5 tw-pb-1.5 tw-pl-3.5 tw-cursor-pointer",onClick:()=>l(!i),onKeyDown:u=>u.key==="Enter"&&u.stopPropagation(),children:s.jsx("div",{className:T.merge(["tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong",i?"tw-rotate-90":""])})}),s.jsx("span",{className:"tw-text-s",children:e.title}),s.jsx("span",{className:"tw-flex-auto tw-font-sans tw-text-xs tw-text-right",children:"Page"})]},e.id)}),i&&c.length>0&&c.map(u=>s.jsx(Tr,{section:u,selectedUrl:t,onSelectUrl:n},u.id))]})},Er=({documentId:e,selectedUrl:t,onSelectUrl:n,itemsToExpandInitially:r,getDocumentSectionsByDocumentPageId:o,getDocumentPagesByDocumentId:i})=>{const[l,c]=g.useState([]),[d,h]=g.useState(!0),p=[...l.values()],u=!d&&p.length>0;return g.useEffect(()=>{i(e).then(f=>{const v=f.filter(C=>!!C.category).sort((C,R)=>C.category.sort===R.category.sort?C.sort-R.sort:C.category.sort-R.category.sort),w=f.filter(C=>!C.category).sort((C,R)=>C.sort-R.sort);c([...v,...w])}).finally(()=>{h(!1)})},[]),d?s.jsx($t,{}):u?s.jsx(s.Fragment,{children:p.map(f=>s.jsx(jr,{page:f,selectedUrl:t,onSelectUrl:n,itemsToExpandInitially:r,getDocumentSectionsByDocumentPageId:o},f.id))}):s.jsx("div",{className:"tw-h-10 tw-flex tw-items-center tw-pr-2.5 tw-pl-7 tw-leading-5 tw-text-s tw-text-text-weak",children:"This document does not contain any pages."})},Ir=({document:e,selectedUrl:t,onSelectUrl:n,itemsToExpandInitially:r,getDocumentSectionsByDocumentPageId:o,getDocumentPagesByDocumentId:i})=>{const[l,c]=g.useState(e.id===r.documentId),d=e.permanentLink===t;return g.useEffect(()=>{e.id===r.documentId&&c(!0)},[r,e.id]),s.jsxs(s.Fragment,{children:[s.jsxs("button",{"data-test-id":"internal-link-selector-document-link",className:T.merge(["tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-py-2 tw-pr-2.5 tw-leading-5 tw-cursor-pointer tw-w-full",d?"tw-bg-box-selected-strong tw-text-box-selected-strong-inverse hover:tw-bg-box-selected-strong-hover:hover hover:tw-text-box-selected-strong-inverse-hover:hover":"hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover"]),onClick:()=>n(e.permanentLink),children:[s.jsx("button",{type:"button",tabIndex:0,"data-test-id":"tree-item-toggle",className:"tw-flex tw-items-center tw-justify-center -tw-mr-2 tw-pr-3.5 tw-pt-1.5 tw-pb-1.5 tw-pl-3.5 tw-cursor-pointer",onClick:()=>c(!l),onKeyDown:h=>h.key==="Enter"&&h.stopPropagation(),children:s.jsx("div",{className:T.merge(["tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong",l?"tw-rotate-90":""])})}),s.jsx(A.IconColorFan,{size:16}),s.jsx("span",{className:"tw-text-s",children:e.title}),s.jsx("span",{className:"tw-flex-auto tw-font-sans tw-text-xs tw-text-right",children:"Document"})]}),l&&s.jsx(Er,{documentId:e.id,selectedUrl:t,onSelectUrl:n,itemsToExpandInitially:r,getDocumentSectionsByDocumentPageId:o,getDocumentPagesByDocumentId:i})]})},Br=({selectedUrl:e,onSelectUrl:t,getAllDocuments:n,getDocumentPagesByDocumentId:r,getDocumentSectionsByDocumentPageId:o})=>{const[i,l]=g.useState(!0),[c,d]=g.useState([]),[h,p]=g.useState({documentId:void 0,pageId:void 0});g.useEffect(()=>{e&&c.length>0&&u().then(f=>{p(f)})},[c.length]),g.useEffect(()=>{n().then(f=>{d(f)}).finally(()=>{l(!1)})},[]);const u=async()=>{const f={documentId:void 0,pageId:void 0};if(c.find(w=>w.permanentLink===e))return f;for(const w of c){const C=await r(w.id);if(!!C.find(I=>I.permanentLink===e))return f.documentId=w.id,f;for(const I of C){const M=await o(I.id);if(!!zt(M).find(U=>U.permanentLink===e))return f.documentId=w.id,f.pageId=I.id,f}}return f};return i?s.jsx($t,{}):s.jsx(s.Fragment,{children:c.map(f=>s.jsx(Ir,{document:f,selectedUrl:e,onSelectUrl:t,itemsToExpandInitially:h,getDocumentSectionsByDocumentPageId:o,getDocumentPagesByDocumentId:r},f.id))})},Wt=({url:e,onUrlChange:t,buttonSize:n="medium",getAllDocuments:r,getDocumentPagesByDocumentId:o,getDocumentSectionsByDocumentPageId:i})=>{const[l,c]=g.useState(!1),[d,h]=g.useState(e),p=w=>{h(w)},u=w=>{w.key==="Enter"&&(w.preventDefault(),f())};g.useEffect(()=>{e&&!d&&h(e)},[e,d]);const f=()=>{t==null||t(d),c(!1)},v={onOpenAutoFocus:()=>{},showUnderlay:!0,minWidth:"800px"};return s.jsx("div",{onPointerDownCapture:w=>{w.stopPropagation(),w.preventDefault()},onFocusCapture:w=>{w.stopPropagation(),w.preventDefault()},"data-test-id":"internal-link-selector",onKeyDown:u,children:s.jsxs(x.Dialog.Root,{modal:!0,open:l,onOpenChange:c,children:[s.jsx(x.Dialog.Trigger,{asChild:!0,children:s.jsxs(x.Button,{size:n,emphasis:"default",children:[s.jsx(A.IconLink,{size:"20"}),"Internal link"]})}),s.jsx(x.Dialog.Content,{...v,children:s.jsxs("span",{"data-is-underlay":"true",style:{minWidth:"inherit"},children:[s.jsx(x.Dialog.Header,{children:s.jsx(x.Dialog.Title,{children:"Select internal link"})}),s.jsx(x.Dialog.Body,{padding:"none",children:s.jsx(x.ScrollArea,{padding:"compact",children:s.jsx(Br,{selectedUrl:d,onSelectUrl:p,getAllDocuments:r,getDocumentPagesByDocumentId:o,getDocumentSectionsByDocumentPageId:i})})}),s.jsxs(x.Dialog.Footer,{children:[s.jsx(x.Button,{size:n,emphasis:"default",onPress:()=>c(!1),children:"Cancel"}),s.jsx(x.Button,{size:n,disabled:!d,emphasis:"strong",onPress:()=>f(),children:"Choose"})]})]})})]})})},qt=({onUrlChange:e,onToggleTab:t,isValidUrlOrEmpty:n,appBridge:r,placeholder:o,newTab:i,url:l="",required:c,info:d,label:h,buttonSize:p,hideInternalLinkButton:u})=>{const f=n?n(l):se(l);return s.jsxs("div",{"data-test-id":"link-input",children:[s.jsx(T.FormControl,{label:{children:h,htmlFor:"url",required:c,tooltip:d?{content:d,position:"top"}:void 0},children:s.jsx(x.TextInput,{"data-test-id":"text-input",id:"url",value:l,onChange:v=>e==null?void 0:e(v.target.value),placeholder:o??"https://example.com"})}),!f&&s.jsx("div",{className:"tw-text-text-negative tw-mt-1 tw-text-s",children:"Please enter a valid URL."}),!u&&s.jsx("div",{className:"tw-mt-3",children:s.jsx(Wt,{url:l,onUrlChange:e,buttonSize:p??"medium",getAllDocuments:()=>r.getAllDocuments(),getDocumentPagesByDocumentId:v=>r.getDocumentPagesByDocumentId(v),getDocumentSectionsByDocumentPageId:v=>r.getDocumentSectionsByDocumentPageId(v)})}),s.jsxs("div",{className:"tw-mt-3 tw-flex tw-items-center tw-gap-1.5",children:[s.jsx(x.Checkbox,{id:"new-tab",value:i,onChange:()=>t==null?void 0:t(!i)}),s.jsx(x.Label,{id:"new-tab-label",htmlFor:"new-tab",className:"tw-whitespace-nowrap",children:"Open in new tab"})]})]})},Gt=({state:e,onTextChange:t,onUrlChange:n,onToggleTab:r,onCancel:o,onSave:i,isValidUrlOrEmpty:l,hasValues:c,testId:d,appBridge:h,children:p})=>s.jsxs(a.FloatingModalWrapper,{"data-test-id":d,padding:"28px",minWidth:"400px",children:[s.jsx(T.FormControl,{label:{children:"Text",htmlFor:"linkText",required:!0},children:s.jsx(x.TextInput,{id:"linkText",value:e.text,placeholder:"Link Text",onChange:u=>t(u.target.value)})}),p,s.jsx("div",{className:"tw-mt-5",children:s.jsx(qt,{url:e.url,newTab:e.newTab,onUrlChange:n,onToggleTab:r,isValidUrlOrEmpty:l,appBridge:h})}),s.jsx("div",{className:"tw-mt-3",children:s.jsxs("div",{className:"tw-pt-5 tw-flex tw-gap-x-3 tw-justify-end tw-border-t tw-border-t-black-10",children:[s.jsx(x.Button,{"data-test-id":"button",onPress:o,size:"medium",emphasis:"default",children:"Cancel"}),s.jsxs(x.Button,{"data-test-id":"button",onPress:i,size:"medium",disabled:!l(e==null?void 0:e.url)||!c,children:[s.jsx(A.IconCheckMark,{size:"20"}),"Save"]})]})})]}),Nr=e=>{var n;const t=a.getAboveNode(e,{match:{type:P}});return Array.isArray(t)&&((n=t[0])==null?void 0:n.buttonStyle)||"primary"},Ar={url:"",text:"",buttonStyle:"primary",newTab:!1},Lr=()=>{const[e,t]=g.useReducer((n,r)=>{const{type:o,payload:i}=r;switch(o){case"NEW_TAB":return{...n,newTab:!0};case"SAME_TAB":return{...n,newTab:!1};case"URL":case"TEXT":case"BUTTON_STYLE":case"INIT":return{...n,...i};default:return n}},Ar);return[e,t]},Rr=()=>{const e=a.useEditorRef(),[t,n]=Lr();g.useEffect(()=>{const u=Nr(e);n({type:"INIT",payload:{text:L.text()||L.url(),buttonStyle:u,newTab:!!L.newTab(),url:L.url()}})},[n,e]);const r=u=>{n({type:"TEXT",payload:{text:u}})},o=u=>{n({type:"BUTTON_STYLE",payload:{buttonStyle:u}})},i=u=>{n({type:"URL",payload:{url:u}})},l=u=>{n(u?{type:"NEW_TAB"}:{type:"SAME_TAB"})},c=()=>{N.reset()},d=u=>{if(!se(t.url)||!h)return;const f=Ce(t.url);N.text(t.text),N.url(f),N.buttonStyle(t.buttonStyle),N.newTab(t.newTab),Ye(e)&&(u==null||u.preventDefault())},h=t.url!==""&&t.text!=="",{appBridge:p}=a.getPluginOptions(e,P);return a.useHotkeys("enter",d,{enableOnFormTags:["INPUT"]},[]),{state:t,onTextChange:r,onButtonStyleChange:o,onUrlChange:i,onToggleTab:l,onCancel:c,onSave:d,hasValues:h,isValidUrlOrEmpty:se,appBridge:p}},Dr=()=>{const e=Rr(),{state:t,onButtonStyleChange:n}=e;return s.jsx(Gt,{...e,testId:"floating-button-insert",children:s.jsx("div",{className:"tw-pt-5",children:s.jsxs(T.FormControl,{label:{children:"Button Style",htmlFor:"buttonStyle",required:!0},children:[s.jsx(Ne,{id:"primary",styles:j.buttonPrimary,isActive:t.buttonStyle==="primary",onClick:()=>n("primary"),children:t.text||"Primary Button"}),s.jsx(Ne,{id:"secondary",styles:j.buttonSecondary,isActive:t.buttonStyle==="secondary",onClick:()=>n("secondary"),children:t.text||"Secondary Button"}),s.jsx(Ne,{id:"tertiary",styles:j.buttonTertiary,isActive:t.buttonStyle==="tertiary",onClick:()=>n("tertiary"),children:t.text||"Tertiary Button"})]})})})},Ne=({id:e,styles:t,isActive:n,onClick:r,children:o})=>{const[i,l]=g.useState(!1),c=()=>t&&t.hover&&i?{...t,...t.hover}:t;return s.jsx("button",{"data-test-id":`floating-button-insert-${e}`,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onClick:r,style:{...c(),marginTop:0,marginBottom:0},className:n?"tw-outline tw-outline-1 tw-outline-violet-60 tw-outline-offset-2 tw-w-fit":"tw-w-fit",children:o})},ot={placement:"bottom-start",strategy:"absolute",middleware:[a.offset(12),a.flip({padding:12,fallbackPlacements:["bottom-end","top-start","top-end"]})]},Mr=()=>{const{ref:e,...t}=_r(ot),{ref:n,...r}=Fr(ot),o=a.useEditorRef(),i=ge(),l=i.isOpen(o.id),c=i.isEditing(),d=i.mode(),h=s.jsx(Dr,{}),p=c?h:s.jsx(Pr,{});return s.jsxs(s.Fragment,{children:[l&&d==="insert"&&xe.createPortal(s.jsx("div",{"data-is-underlay":!0,ref:e,...t,style:{...t.style,...j[a.TextStyles.p]},children:h}),document.body),l&&d==="edit"&&xe.createPortal(s.jsx("div",{"data-is-underlay":!0,ref:n,...r,style:{...r.style,...j[a.TextStyles.p]},children:p}),document.body)]})},P="button",Kt="button-plugin",Yt=e=>a.createPluginFactory({key:P,isElement:!0,isInline:!0,props:({element:t})=>({nodeProps:{href:t==null?void 0:t.url,target:t==null?void 0:t.target}}),withOverrides:Dt,renderAfterEditable:Mr,options:{isUrl:ke,rangeBeforeOptions:{matchString:" ",skipInvalid:!0,afterMatch:!0},triggerFloatingButtonHotkeys:"command+shift+k, ctrl+shift+k",appBridge:e},then:(t,{type:n})=>({deserializeHtml:{rules:[{validNodeName:"A",validClassName:"btn"}],getNode:r=>({type:n,url:r.getAttribute("href"),target:r.getAttribute("target")||"_blank"})}})})();class Qt extends a.Plugin{constructor({styles:n=Pe,...r}){super(Kt,{button:Sr,markupElement:new kr,...r});B(this,"styles",{});B(this,"appBridge");this.styles=n,this.appBridge=r==null?void 0:r.appBridge}plugins(){return[Yt(this.appBridge)]}}const Fr=e=>{const t=a.useEditorRef(),n=ge().mode(),r=ge().isOpen(t.id),o=a.useEditorVersion(),{triggerFloatingButtonHotkeys:i}=a.getPluginOptions(t,P),l=g.useCallback(()=>{const u=a.getAboveNode(t,{match:{type:a.getPluginType(t,P)}});if(u){const[,f]=u;return a.getRangeBoundingClientRect(t,{anchor:a.getStartPoint(t,f),focus:a.getEndPoint(t,f)})}return a.getDefaultBoundingClientRect()},[t]),c=r&&n==="edit",{update:d,style:h,floating:p}=Jt({open:c,getBoundingClientRect:l,...e});return g.useEffect(()=>{const u=_t(t);if(u&&N.url(u),t.selection&&a.someNode(t,{match:{type:a.getPluginType(t,P)}})){N.show("edit",t.id),d();return}L.mode()==="edit"&&N.reset()},[t,o,d]),a.useHotkeys(i,u=>{u.preventDefault(),L.mode()==="edit"&&Se(t)},{enableOnContentEditable:!0},[]),Or(),Xt(),{style:h,ref:a.useComposedRef(p)}},Or=()=>{const e=a.useEditorRef();a.useHotkeys("*",t=>{t.key==="Enter"&&Ye(e)&&t.preventDefault()},{enableOnFormTags:["INPUT"]},[])},Xt=()=>{const e=a.useEditorRef();a.useHotkeys("escape",()=>{if(L.mode()==="edit"){if(L.isEditing()){N.show("edit",e.id),a.focusEditor(e,e.selection??void 0);return}N.reset()}},{enableOnFormTags:["INPUT"],enableOnContentEditable:!0},[])},_r=e=>{const t=a.useEditorRef(),n=a.useFocused(),r=ge().mode(),o=ge().isOpen(t.id),{triggerFloatingButtonHotkeys:i}=a.getPluginOptions(t,P);a.useHotkeys(i,h=>{h.preventDefault(),Xe(t,{focused:n})},{enableOnContentEditable:!0},[n]);const{update:l,style:c,floating:d}=Jt({open:o&&r==="insert",getBoundingClientRect:a.getSelectionBoundingClientRect,whileElementsMounted:void 0,...e});return g.useEffect(()=>{o&&l(),N.updated(o)},[o,l]),Xt(),{style:c,ref:a.useComposedRef(d)}},Ur=12,Hr=-22,Vr=96,Jt=e=>a.useVirtualFloating({placement:"bottom-start",middleware:[a.offset({mainAxis:Ur,alignmentAxis:Hr}),a.flip({padding:Vr})],...e}),Ae="[&_.tw-break-after-column]:tw-break-after-auto [&_.tw-break-inside-avoid-column]:tw-break-inside-auto [&_.tw-break-after-column.tw-pb-5]:tw-pb-0 @md:[&_.tw-break-after-column.tw-pb-5]:!tw-pb-5 @md:[&_.tw-break-after-column]:!tw-break-after-column @md:[&_.tw-break-inside-avoid-column]:!tw-break-inside-avoid-column",zr="[&_.tw-break-after-column]:tw-break-after-auto [&_.tw-break-inside-avoid-column]:tw-break-inside-auto [&_.tw-break-after-column.tw-pb-5]:tw-pb-0 @sm:[&_.tw-break-after-column.tw-pb-5]:!tw-pb-5 @sm:[&_.tw-break-after-column]:!tw-break-after-column @sm:[&_.tw-break-inside-avoid-column]:!tw-break-inside-avoid-column",it={1:"tw-columns-1",2:`tw-columns-1 @sm:!tw-columns-2 ${zr}`,3:`tw-columns-1 @md:!tw-columns-3 ${Ae}`,4:`tw-columns-1 @md:!tw-columns-4 ${Ae}`,5:`tw-columns-1 @md:!tw-columns-5 ${Ae}`},Zt=e=>e?it[e]||it[1]:"",$r=e=>{L.isOpen(e)&&N.reset()},en=g.memo(({isEnabled:e,value:t,columns:n,gap:r,placeholder:o,plugins:i,onTextChange:l,showSerializedText:c})=>{const d=Zt(n),[h,p]=g.useState(!1),u=g.useId(),f=g.useCallback(w=>{w!==t&&(l==null||l(w)),p(!1)},[l,t]),v=g.useCallback(()=>p(!0),[]);return g.useEffect(()=>{const w=C=>{C.preventDefault(),C.returnValue="Unprocessed changes"};return h&&window.addEventListener("beforeunload",w),()=>window.removeEventListener("beforeunload",w)},[h]),e?s.jsx(a.RichTextEditor,{id:u,value:t,border:!1,placeholder:o,plugins:i,onValueChanged:v,onTextChange:f,hideExternalFloatingModals:$r,placeholderOpacity:"high"}):s.jsx(lr,{value:t,gap:r,customClass:d,show:c,plugins:i})});en.displayName="InternalRichTextEditor";const Wr=e=>{const t=g.useRef(null),[n,r]=g.useState(!1),{isEditing:o,...i}=e,l=g.useCallback(c=>{c&&r(!0)},[]);return ir({ref:t,disabled:!o,onChange:l}),g.useEffect(()=>{o||r(!1)},[o]),s.jsx("div",{"data-test-id":"rich-text-editor-container",className:"tw-block tw-w-full tw-@container",ref:t,children:s.jsx(en,{...i,isEnabled:o&&n})})},qr=({editButtonProps:e,unlinkButtonProps:t})=>{const{element:n}=a.useLinkOpenButtonState(),r=n?Ge(n):"";return s.jsx(a.FloatingModalWrapper,{"data-test-id":"floating-link-edit",padding:"16px",minWidth:"400px",children:s.jsxs("span",{"data-test-id":"preview-link-flyout",className:"tw-flex tw-justify-between tw-items-center tw-gap-2",children:[s.jsx("a",{"data-test-id":"floating-link-edit-url",href:r,target:"_blank",rel:"noopener noreferrer",style:j[oe],className:"tw-break-all",children:r}),s.jsxs("span",{className:"tw-flex tw-gap-2",children:[s.jsx("button",{tabIndex:0,"data-test-id":"edit-link-button",className:"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",...e,children:s.jsx(A.IconPen,{size:16})}),s.jsx("button",{tabIndex:0,"data-test-id":"remove-link-button",className:"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",...t,children:s.jsx(A.IconTrashBin,{size:16})})]})]})})},tn=(e,t)=>{const n=a.getAboveNode(e,{match:{type:a.ELEMENT_LINK}});return Array.isArray(n)?t(n[0]):""},Gr=e=>tn(e,t=>{var n,r;return((r=(n=t.chosenLink)==null?void 0:n.searchResult)==null?void 0:r.link)||""}),Kr=e=>tn(e,t=>t.url||""),Yr={url:"",text:"",newTab:!1},Qr=()=>{const[e,t]=g.useReducer((n,r)=>{const{type:o,payload:i}=r;switch(o){case"NEW_TAB":return{...n,newTab:!0};case"SAME_TAB":return{...n,newTab:!1};case"URL":case"TEXT":case"INIT":return{...n,...i};default:return n}},Yr);return[e,t]},Xr=()=>{const e=a.useEditorRef(),[t,n]=Qr();g.useEffect(()=>{const p=Gr(e),u=Kr(e),f=a.floatingLinkSelectors.newTab();n({type:"INIT",payload:{text:a.floatingLinkSelectors.text()||a.floatingLinkSelectors.url(),newTab:f,url:p&&u===""?p:a.floatingLinkSelectors.url()}})},[n,e]);const r=p=>{n({type:"TEXT",payload:{text:p}})},o=p=>{n({type:"URL",payload:{url:p}})},i=p=>{n(p?{type:"NEW_TAB"}:{type:"SAME_TAB"})},l=()=>{a.floatingLinkActions.reset()},c=p=>{!se(t.url)||!d||(a.floatingLinkActions.text(t.text),a.floatingLinkActions.url(Ce(t.url)),a.floatingLinkActions.newTab(t.newTab),a.submitFloatingLink(e)&&(p==null||p.preventDefault()))},d=t.url!==""&&t.text!=="",{appBridge:h}=a.getPluginOptions(e,a.ELEMENT_LINK);return a.useHotkeys("enter",c,{enableOnFormTags:["INPUT"]},[]),{state:t,onTextChange:r,onUrlChange:o,onToggleTab:i,onCancel:l,onSave:c,hasValues:d,isValidUrlOrEmpty:se,appBridge:h}},Jr=()=>s.jsx(Gt,{...Xr(),testId:"floating-link-insert"}),lt={placement:"bottom-start",strategy:"absolute",middleware:[a.offset(12),a.flip({padding:12,fallbackPlacements:["bottom-end","top-start","top-end"]})]},Zr=()=>{const e=a.useFloatingLinkInsertState({floatingOptions:lt}),{props:t,ref:n,hidden:r}=a.useFloatingLinkInsert(e),o=a.useFloatingLinkEditState({floatingOptions:lt}),{props:i,ref:l,editButtonProps:c,unlinkButtonProps:d}=a.useFloatingLinkEdit(o);if(r)return null;const h=s.jsx(Jr,{}),p=o.isEditing?h:s.jsx(qr,{editButtonProps:c,unlinkButtonProps:d});return s.jsxs(s.Fragment,{children:[e.isOpen&&!o.isOpen&&xe.createPortal(s.jsx("div",{"data-is-underlay":!0,ref:n,...t,style:{...t.style,...j[b.p]},children:h}),document.body),o.isOpen&&xe.createPortal(s.jsx("div",{"data-is-underlay":!0,ref:l,...i,style:{...i.style,...j[b.p]},children:p}),document.body)]})},nn=g.forwardRef((e,t)=>{const n=a.useEditorRef(),r=a.useLinkToolbarButtonState(),{props:o}=a.useLinkToolbarButton(r);return s.jsx(a.ToolbarButton,{onMouseDown:i=>{i.preventDefault(),a.focusEditor(n,n.selection??n.prevSelection??void 0)},ref:t,...o,...e,children:s.jsx(a.IconStylingWrapper,{icon:s.jsx(A.IconLink,{size:16})})})});nn.displayName="LinkToolbarButton";const es=({id:e,editorId:t})=>{const n=a.useEditorState(a.useEventPlateId(t)),r=!!a.isRangeInSameBlock(n,{at:n.selection});return s.jsx("div",{"data-plugin-id":e,children:s.jsx(nn,{disabled:!r,tooltip:a.getTooltip(r?`Link
|
|
2
|
+
${a.getHotkeyByPlatform("Ctrl+Shift+K")}`:"Buttons can only be set for a single text block.")})})},oe="link-plugin";var b=(e=>(e.heading1="heading1",e.heading2="heading2",e.heading3="heading3",e.heading4="heading4",e.custom1="custom1",e.custom2="custom2",e.custom3="custom3",e.quote="quote",e.imageCaption="imageCaption",e.imageTitle="imageTitle",e.p="p",e))(b||{});const j={heading1:{fontSize:"var(--f-theme-settings-heading1-font-size)",lineHeight:"var(--f-theme-settings-heading1-line-height)",marginTop:"var(--f-theme-settings-heading1-margin-top)",marginBottom:"var(--f-theme-settings-heading1-margin-bottom)",textDecoration:"var(--f-theme-settings-heading1-text-decoration)",fontStyle:"var(--f-theme-settings-heading1-font-style)",textTransform:"var(--f-theme-settings-heading1-text-transform)",letterSpacing:"var(--f-theme-settings-heading1-letter-spacing)",fontWeight:"var(--f-theme-settings-heading1-font-weight)",fontFamily:"var(--f-theme-settings-heading1-font-family)",color:"var(--f-theme-settings-heading1-color)"},heading2:{fontSize:"var(--f-theme-settings-heading2-font-size)",lineHeight:"var(--f-theme-settings-heading2-line-height)",marginTop:"var(--f-theme-settings-heading2-margin-top)",marginBottom:"var(--f-theme-settings-heading2-margin-bottom)",textDecoration:"var(--f-theme-settings-heading2-text-decoration)",fontStyle:"var(--f-theme-settings-heading2-font-style)",textTransform:"var(--f-theme-settings-heading2-text-transform)",letterSpacing:"var(--f-theme-settings-heading2-letter-spacing)",fontWeight:"var(--f-theme-settings-heading2-font-weight)",fontFamily:"var(--f-theme-settings-heading2-font-family)",color:"var(--f-theme-settings-heading2-color)"},heading3:{fontSize:"var(--f-theme-settings-heading3-font-size)",lineHeight:"var(--f-theme-settings-heading3-line-height)",marginTop:"var(--f-theme-settings-heading3-margin-top)",marginBottom:"var(--f-theme-settings-heading3-margin-bottom)",textDecoration:"var(--f-theme-settings-heading3-text-decoration)",fontStyle:"var(--f-theme-settings-heading3-font-style)",textTransform:"var(--f-theme-settings-heading3-text-transform)",letterSpacing:"var(--f-theme-settings-heading3-letter-spacing)",fontWeight:"var(--f-theme-settings-heading3-font-weight)",fontFamily:"var(--f-theme-settings-heading3-font-family)",color:"var(--f-theme-settings-heading3-color)"},heading4:{fontSize:"var(--f-theme-settings-heading4-font-size)",lineHeight:"var(--f-theme-settings-heading4-line-height)",marginTop:"var(--f-theme-settings-heading4-margin-top)",marginBottom:"var(--f-theme-settings-heading4-margin-bottom)",textDecoration:"var(--f-theme-settings-heading4-text-decoration)",fontStyle:"var(--f-theme-settings-heading4-font-style)",textTransform:"var(--f-theme-settings-heading4-text-transform)",letterSpacing:"var(--f-theme-settings-heading4-letter-spacing)",fontWeight:"var(--f-theme-settings-heading4-font-weight)",fontFamily:"var(--f-theme-settings-heading4-font-family)",color:"var(--f-theme-settings-heading4-color)"},custom1:{fontSize:"var(--f-theme-settings-custom1-font-size)",lineHeight:"var(--f-theme-settings-custom1-line-height)",marginTop:"var(--f-theme-settings-custom1-margin-top)",marginBottom:"var(--f-theme-settings-custom1-margin-bottom)",textDecoration:"var(--f-theme-settings-custom1-text-decoration)",fontStyle:"var(--f-theme-settings-custom1-font-style)",textTransform:"var(--f-theme-settings-custom1-text-transform)",letterSpacing:"var(--f-theme-settings-custom1-letter-spacing)",fontWeight:"var(--f-theme-settings-custom1-font-weight)",fontFamily:"var(--f-theme-settings-custom1-font-family)",color:"var(--f-theme-settings-custom1-color)"},custom2:{fontSize:"var(--f-theme-settings-custom2-font-size)",lineHeight:"var(--f-theme-settings-custom2-line-height)",marginTop:"var(--f-theme-settings-custom2-margin-top)",marginBottom:"var(--f-theme-settings-custom2-margin-bottom)",textDecoration:"var(--f-theme-settings-custom2-text-decoration)",fontStyle:"var(--f-theme-settings-custom2-font-style)",textTransform:"var(--f-theme-settings-custom2-text-transform)",letterSpacing:"var(--f-theme-settings-custom2-letter-spacing)",fontWeight:"var(--f-theme-settings-custom2-font-weight)",fontFamily:"var(--f-theme-settings-custom2-font-family)",color:"var(--f-theme-settings-custom2-color)"},custom3:{fontSize:"var(--f-theme-settings-custom3-font-size)",lineHeight:"var(--f-theme-settings-custom3-line-height)",marginTop:"var(--f-theme-settings-custom3-margin-top)",marginBottom:"var(--f-theme-settings-custom3-margin-bottom)",textDecoration:"var(--f-theme-settings-custom3-text-decoration)",fontStyle:"var(--f-theme-settings-custom3-font-style)",textTransform:"var(--f-theme-settings-custom3-text-transform)",letterSpacing:"var(--f-theme-settings-custom3-letter-spacing)",fontWeight:"var(--f-theme-settings-custom3-font-weight)",fontFamily:"var(--f-theme-settings-custom3-font-family)",color:"var(--f-theme-settings-custom3-color)"},p:{fontSize:"var(--f-theme-settings-body-font-size)",lineHeight:"var(--f-theme-settings-body-line-height)",marginTop:"var(--f-theme-settings-body-margin-top)",marginBottom:"var(--f-theme-settings-body-margin-bottom)",textDecoration:"var(--f-theme-settings-body-text-decoration)",fontStyle:"var(--f-theme-settings-body-font-style)",textTransform:"var(--f-theme-settings-body-text-transform)",letterSpacing:"var(--f-theme-settings-body-letter-spacing)",fontWeight:"var(--f-theme-settings-body-font-weight)",fontFamily:"var(--f-theme-settings-body-font-family)",color:"var(--f-theme-settings-body-color)"},quote:{fontSize:"var(--f-theme-settings-quote-font-size)",lineHeight:"var(--f-theme-settings-quote-line-height)",marginTop:"var(--f-theme-settings-quote-margin-top)",marginBottom:"var(--f-theme-settings-quote-margin-bottom)",textDecoration:"var(--f-theme-settings-quote-text-decoration)",fontStyle:"var(--f-theme-settings-quote-font-style)",textTransform:"var(--f-theme-settings-quote-text-transform)",letterSpacing:"var(--f-theme-settings-quote-letter-spacing)",fontWeight:"var(--f-theme-settings-quote-font-weight)",fontFamily:"var(--f-theme-settings-quote-font-family)",color:"var(--f-theme-settings-quote-color)"},imageCaption:{fontSize:"var(--f-theme-settings-image-caption-font-size)",lineHeight:"var(--f-theme-settings-image-caption-line-height)",marginTop:"var(--f-theme-settings-image-caption-margin-top)",marginBottom:"var(--f-theme-settings-image-caption-margin-bottom)",textDecoration:"var(--f-theme-settings-image-caption-text-decoration)",fontStyle:"var(--f-theme-settings-image-caption-font-style)",textTransform:"var(--f-theme-settings-image-caption-text-transform)",letterSpacing:"var(--f-theme-settings-image-caption-letter-spacing)",fontWeight:"var(--f-theme-settings-image-caption-font-weight)",fontFamily:"var(--f-theme-settings-image-caption-font-family)",color:"var(--f-theme-settings-image-caption-color)"},imageTitle:{fontSize:"var(--f-theme-settings-image-title-font-size)",lineHeight:"var(--f-theme-settings-image-title-line-height)",marginTop:"var(--f-theme-settings-image-title-margin-top)",marginBottom:"var(--f-theme-settings-image-title-margin-bottom)",textDecoration:"var(--f-theme-settings-image-title-text-decoration)",fontStyle:"var(--f-theme-settings-image-title-font-style)",textTransform:"var(--f-theme-settings-image-title-text-transform)",letterSpacing:"var(--f-theme-settings-image-title-letter-spacing)",fontWeight:"var(--f-theme-settings-image-title-font-weight)",fontFamily:"var(--f-theme-settings-image-title-font-family)",color:"var(--f-theme-settings-image-title-color)"},[oe]:{fontSize:"var(--f-theme-settings-link-font-size)",lineHeight:"var(--f-theme-settings-link-line-height)",marginTop:"var(--f-theme-settings-link-margin-top)",marginBottom:"var(--f-theme-settings-link-margin-bottom)",textDecoration:"var(--f-theme-settings-link-text-decoration)",fontStyle:"var(--f-theme-settings-link-font-style)",textTransform:"var(--f-theme-settings-link-text-transform)",letterSpacing:"var(--f-theme-settings-link-letter-spacing)",fontWeight:"var(--f-theme-settings-link-font-weight)",fontFamily:"var(--f-theme-settings-link-font-family)",color:"var(--f-theme-settings-link-color)"},...Pe},Pr=()=>{const e=a.useEditorRef();return s.jsx(a.FloatingModalWrapper,{padding:"16px",minWidth:"400px","data-test-id":"floating-button-edit",children:s.jsxs("span",{"data-test-id":"preview-button-flyout",className:"tw-flex tw-justify-between tw-items-center tw-gap-2",children:[s.jsx("a",{"data-test-id":"floating-button-edit-url",href:L.url(),target:"_blank",rel:"noopener noreferrer",style:j[oe],className:"tw-break-all",children:L.url()}),s.jsxs("span",{className:"tw-flex tw-gap-2",children:[s.jsx("button",{onClick:()=>{Se(e)},tabIndex:0,"data-test-id":"edit-button-button",className:"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",children:s.jsx(A.IconPen,{size:16})}),s.jsx("button",{onClick:()=>{ae(e),a.focusEditor(e,e.selection??void 0)},tabIndex:0,"data-test-id":"remove-button-button",className:"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",children:s.jsx(A.IconTrashBin,{size:16})})]})]})})},zt=e=>e.filter(t=>{var n;return!!((n=t.title)!=null&&n.trim())}),$t=()=>s.jsx("div",{className:"tw-flex tw-justify-center tw-h-10 tw-items-center",children:s.jsx(x.LoadingCircle,{size:"small"})}),Tr=({section:e,selectedUrl:t,onSelectUrl:n})=>{const r=e.permanentLink===t;return s.jsx("button",{"data-test-id":"internal-link-selector-section-link","data-is-active":r,className:T.merge(["tw-py-2 tw-pr-2.5 tw-pl-14 tw-leading-5 tw-cursor-pointer tw-w-full",r?"tw-bg-box-selected-strong tw-text-box-selected-strong-inverse hover:tw-bg-box-selected-strong-hover:hover hover:tw-text-box-selected-strong-inverse-hover:hover":"hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover"]),onClick:()=>n(e.permanentLink),children:s.jsxs("div",{className:"tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-h-6",children:[s.jsx(A.IconDocumentText,{size:16}),s.jsx("span",{className:"tw-text-s",children:e.title}),s.jsx("span",{className:"tw-flex-auto tw-font-sans tw-text-xs tw-text-right",children:"Section"})]})})},jr=({page:e,selectedUrl:t,onSelectUrl:n,itemsToExpandInitially:r,getDocumentSectionsByDocumentPageId:o})=>{const[i,l]=g.useState(e.id===r.documentId),[c,d]=g.useState([]),h=e.permanentLink===t;g.useEffect(()=>{(async()=>{const f=await o(e.id),v=zt(f);d(v)})()},[e.id,o]),g.useEffect(()=>{e.id===r.pageId&&l(!0)},[r,e.id]);const p=c.length>0;return s.jsxs(s.Fragment,{children:[s.jsx("button",{"data-test-id":"internal-link-selector-page-link",className:T.merge(["tw-py-2 tw-pr-2.5 tw-leading-5 tw-cursor-pointer tw-flex tw-w-full",p?"tw-pl-7":"tw-pl-12",h?"tw-bg-box-selected-strong tw-text-box-selected-strong-inverse hover:tw-bg-box-selected-strong-hover:hover hover:tw-text-box-selected-strong-inverse-hover:hover":"hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover"]),onClick:()=>n(e.permanentLink),children:s.jsxs("div",{className:"tw-flex tw-flex-1 tw-space-x-1 tw-items-center tw-h-6",children:[p&&s.jsx("button",{"data-test-id":"tree-item-toggle",className:"tw-flex tw-items-center tw-justify-center -tw-mr-2 tw-pr-3.5 tw-pt-1.5 tw-pb-1.5 tw-pl-3.5 tw-cursor-pointer",onClick:()=>l(!i),onKeyDown:u=>u.key==="Enter"&&u.stopPropagation(),children:s.jsx("div",{className:T.merge(["tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong",i?"tw-rotate-90":""])})}),s.jsx("span",{className:"tw-text-s",children:e.title}),s.jsx("span",{className:"tw-flex-auto tw-font-sans tw-text-xs tw-text-right",children:"Page"})]},e.id)}),i&&c.length>0&&c.map(u=>s.jsx(Tr,{section:u,selectedUrl:t,onSelectUrl:n},u.id))]})},Er=({documentId:e,selectedUrl:t,onSelectUrl:n,itemsToExpandInitially:r,getDocumentSectionsByDocumentPageId:o,getDocumentPagesByDocumentId:i})=>{const[l,c]=g.useState([]),[d,h]=g.useState(!0),p=[...l.values()],u=!d&&p.length>0;return g.useEffect(()=>{i(e).then(f=>{const v=f.filter(C=>!!C.category).sort((C,R)=>C.category.sort===R.category.sort?C.sort-R.sort:C.category.sort-R.category.sort),w=f.filter(C=>!C.category).sort((C,R)=>C.sort-R.sort);c([...v,...w])}).finally(()=>{h(!1)})},[]),d?s.jsx($t,{}):u?s.jsx(s.Fragment,{children:p.map(f=>s.jsx(jr,{page:f,selectedUrl:t,onSelectUrl:n,itemsToExpandInitially:r,getDocumentSectionsByDocumentPageId:o},f.id))}):s.jsx("div",{className:"tw-h-10 tw-flex tw-items-center tw-pr-2.5 tw-pl-7 tw-leading-5 tw-text-s tw-text-text-weak",children:"This document does not contain any pages."})},Ir=({document:e,selectedUrl:t,onSelectUrl:n,itemsToExpandInitially:r,getDocumentSectionsByDocumentPageId:o,getDocumentPagesByDocumentId:i})=>{const[l,c]=g.useState(e.id===r.documentId),d=e.permanentLink===t;return g.useEffect(()=>{e.id===r.documentId&&c(!0)},[r,e.id]),s.jsxs(s.Fragment,{children:[s.jsxs("button",{"data-test-id":"internal-link-selector-document-link",className:T.merge(["tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-py-2 tw-pr-2.5 tw-leading-5 tw-cursor-pointer tw-w-full",d?"tw-bg-box-selected-strong tw-text-box-selected-strong-inverse hover:tw-bg-box-selected-strong-hover:hover hover:tw-text-box-selected-strong-inverse-hover:hover":"hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover"]),onClick:()=>n(e.permanentLink),children:[s.jsx("button",{type:"button",tabIndex:0,"data-test-id":"tree-item-toggle",className:"tw-flex tw-items-center tw-justify-center -tw-mr-2 tw-pr-3.5 tw-pt-1.5 tw-pb-1.5 tw-pl-3.5 tw-cursor-pointer",onClick:()=>c(!l),onKeyDown:h=>h.key==="Enter"&&h.stopPropagation(),children:s.jsx("div",{className:T.merge(["tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong",l?"tw-rotate-90":""])})}),s.jsx(A.IconColorFan,{size:16}),s.jsx("span",{className:"tw-text-s",children:e.title}),s.jsx("span",{className:"tw-flex-auto tw-font-sans tw-text-xs tw-text-right",children:"Document"})]}),l&&s.jsx(Er,{documentId:e.id,selectedUrl:t,onSelectUrl:n,itemsToExpandInitially:r,getDocumentSectionsByDocumentPageId:o,getDocumentPagesByDocumentId:i})]})},Br=({selectedUrl:e,onSelectUrl:t,getAllDocuments:n,getDocumentPagesByDocumentId:r,getDocumentSectionsByDocumentPageId:o})=>{const[i,l]=g.useState(!0),[c,d]=g.useState([]),[h,p]=g.useState({documentId:void 0,pageId:void 0});g.useEffect(()=>{e&&c.length>0&&u().then(f=>{p(f)})},[c.length]),g.useEffect(()=>{n().then(f=>{d(f)}).finally(()=>{l(!1)})},[]);const u=async()=>{const f={documentId:void 0,pageId:void 0};if(c.find(w=>w.permanentLink===e))return f;for(const w of c){const C=await r(w.id);if(!!C.find(I=>I.permanentLink===e))return f.documentId=w.id,f;for(const I of C){const M=await o(I.id);if(!!zt(M).find(U=>U.permanentLink===e))return f.documentId=w.id,f.pageId=I.id,f}}return f};return i?s.jsx($t,{}):s.jsx(s.Fragment,{children:c.map(f=>s.jsx(Ir,{document:f,selectedUrl:e,onSelectUrl:t,itemsToExpandInitially:h,getDocumentSectionsByDocumentPageId:o,getDocumentPagesByDocumentId:r},f.id))})},Wt=({url:e,onUrlChange:t,buttonSize:n="medium",getAllDocuments:r,getDocumentPagesByDocumentId:o,getDocumentSectionsByDocumentPageId:i})=>{const[l,c]=g.useState(!1),[d,h]=g.useState(e),p=w=>{h(w)},u=w=>{w.key==="Enter"&&(w.preventDefault(),f())};g.useEffect(()=>{e&&!d&&h(e)},[e,d]);const f=()=>{t==null||t(d),c(!1)},v={onOpenAutoFocus:()=>{},showUnderlay:!0,"data-is-underlay":!0,minWidth:"800px"};return s.jsx("div",{onPointerDownCapture:w=>{w.stopPropagation(),w.preventDefault()},onFocusCapture:w=>{w.stopPropagation(),w.preventDefault()},"data-test-id":"internal-link-selector",onKeyDown:u,children:s.jsxs(x.Dialog.Root,{modal:!0,open:l,onOpenChange:c,children:[s.jsx(x.Dialog.Trigger,{asChild:!0,children:s.jsxs(x.Button,{size:n,emphasis:"default",children:[s.jsx(A.IconLink,{size:"20"}),"Internal link"]})}),s.jsxs(x.Dialog.Content,{...v,children:[s.jsx(x.Dialog.Header,{children:s.jsx(x.Dialog.Title,{children:"Select internal link"})}),s.jsx(x.Dialog.Body,{padding:"none",children:s.jsx(x.ScrollArea,{padding:"compact",children:s.jsx(Br,{selectedUrl:d,onSelectUrl:p,getAllDocuments:r,getDocumentPagesByDocumentId:o,getDocumentSectionsByDocumentPageId:i})})}),s.jsxs(x.Dialog.Footer,{children:[s.jsx(x.Button,{size:n,emphasis:"default",onPress:()=>c(!1),children:"Cancel"}),s.jsx(x.Button,{size:n,disabled:!d,emphasis:"strong",onPress:()=>f(),children:"Choose"})]})]})]})})},qt=({onUrlChange:e,onToggleTab:t,isValidUrlOrEmpty:n,appBridge:r,placeholder:o,newTab:i,url:l="",required:c,info:d,label:h,buttonSize:p,hideInternalLinkButton:u})=>{const f=n?n(l):se(l);return s.jsxs("div",{"data-test-id":"link-input",children:[s.jsx(T.FormControl,{label:{children:h,htmlFor:"url",required:c,tooltip:d?{content:d,position:"top"}:void 0},children:s.jsx(x.TextInput,{"data-test-id":"text-input",id:"url",value:l,onChange:v=>e==null?void 0:e(v.target.value),placeholder:o??"https://example.com"})}),!f&&s.jsx("div",{className:"tw-text-text-negative tw-mt-1 tw-text-s",children:"Please enter a valid URL."}),!u&&s.jsx("div",{className:"tw-mt-3",children:s.jsx(Wt,{url:l,onUrlChange:e,buttonSize:p??"medium",getAllDocuments:()=>r.getAllDocuments(),getDocumentPagesByDocumentId:v=>r.getDocumentPagesByDocumentId(v),getDocumentSectionsByDocumentPageId:v=>r.getDocumentSectionsByDocumentPageId(v)})}),s.jsxs("div",{className:"tw-mt-3 tw-flex tw-items-center tw-gap-1.5",children:[s.jsx(x.Checkbox,{id:"new-tab",value:i,onChange:()=>t==null?void 0:t(!i)}),s.jsx(x.Label,{id:"new-tab-label",htmlFor:"new-tab",className:"tw-whitespace-nowrap",children:"Open in new tab"})]})]})},Gt=({state:e,onTextChange:t,onUrlChange:n,onToggleTab:r,onCancel:o,onSave:i,isValidUrlOrEmpty:l,hasValues:c,testId:d,appBridge:h,children:p})=>s.jsxs(a.FloatingModalWrapper,{"data-test-id":d,padding:"28px",minWidth:"400px",children:[s.jsx(T.FormControl,{label:{children:"Text",htmlFor:"linkText",required:!0},children:s.jsx(x.TextInput,{id:"linkText",value:e.text,placeholder:"Link Text",onChange:u=>t(u.target.value)})}),p,s.jsx("div",{className:"tw-mt-5",children:s.jsx(qt,{url:e.url,newTab:e.newTab,onUrlChange:n,onToggleTab:r,isValidUrlOrEmpty:l,appBridge:h})}),s.jsx("div",{className:"tw-mt-3",children:s.jsxs("div",{className:"tw-pt-5 tw-flex tw-gap-x-3 tw-justify-end tw-border-t tw-border-t-black-10",children:[s.jsx(x.Button,{"data-test-id":"button",onPress:o,size:"medium",emphasis:"default",children:"Cancel"}),s.jsxs(x.Button,{"data-test-id":"button",onPress:i,size:"medium",disabled:!l(e==null?void 0:e.url)||!c,children:[s.jsx(A.IconCheckMark,{size:"20"}),"Save"]})]})})]}),Nr=e=>{var n;const t=a.getAboveNode(e,{match:{type:P}});return Array.isArray(t)&&((n=t[0])==null?void 0:n.buttonStyle)||"primary"},Ar={url:"",text:"",buttonStyle:"primary",newTab:!1},Lr=()=>{const[e,t]=g.useReducer((n,r)=>{const{type:o,payload:i}=r;switch(o){case"NEW_TAB":return{...n,newTab:!0};case"SAME_TAB":return{...n,newTab:!1};case"URL":case"TEXT":case"BUTTON_STYLE":case"INIT":return{...n,...i};default:return n}},Ar);return[e,t]},Rr=()=>{const e=a.useEditorRef(),[t,n]=Lr();g.useEffect(()=>{const u=Nr(e);n({type:"INIT",payload:{text:L.text()||L.url(),buttonStyle:u,newTab:!!L.newTab(),url:L.url()}})},[n,e]);const r=u=>{n({type:"TEXT",payload:{text:u}})},o=u=>{n({type:"BUTTON_STYLE",payload:{buttonStyle:u}})},i=u=>{n({type:"URL",payload:{url:u}})},l=u=>{n(u?{type:"NEW_TAB"}:{type:"SAME_TAB"})},c=()=>{N.reset()},d=u=>{if(!se(t.url)||!h)return;const f=Ce(t.url);N.text(t.text),N.url(f),N.buttonStyle(t.buttonStyle),N.newTab(t.newTab),Ye(e)&&(u==null||u.preventDefault())},h=t.url!==""&&t.text!=="",{appBridge:p}=a.getPluginOptions(e,P);return a.useHotkeys("enter",d,{enableOnFormTags:["INPUT"]},[]),{state:t,onTextChange:r,onButtonStyleChange:o,onUrlChange:i,onToggleTab:l,onCancel:c,onSave:d,hasValues:h,isValidUrlOrEmpty:se,appBridge:p}},Dr=()=>{const e=Rr(),{state:t,onButtonStyleChange:n}=e;return s.jsx(Gt,{...e,testId:"floating-button-insert",children:s.jsx("div",{className:"tw-pt-5",children:s.jsxs(T.FormControl,{label:{children:"Button Style",htmlFor:"buttonStyle",required:!0},children:[s.jsx(Ne,{id:"primary",styles:j.buttonPrimary,isActive:t.buttonStyle==="primary",onClick:()=>n("primary"),children:t.text||"Primary Button"}),s.jsx(Ne,{id:"secondary",styles:j.buttonSecondary,isActive:t.buttonStyle==="secondary",onClick:()=>n("secondary"),children:t.text||"Secondary Button"}),s.jsx(Ne,{id:"tertiary",styles:j.buttonTertiary,isActive:t.buttonStyle==="tertiary",onClick:()=>n("tertiary"),children:t.text||"Tertiary Button"})]})})})},Ne=({id:e,styles:t,isActive:n,onClick:r,children:o})=>{const[i,l]=g.useState(!1),c=()=>t&&t.hover&&i?{...t,...t.hover}:t;return s.jsx("button",{"data-test-id":`floating-button-insert-${e}`,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onClick:r,style:{...c(),marginTop:0,marginBottom:0},className:n?"tw-outline tw-outline-1 tw-outline-violet-60 tw-outline-offset-2 tw-w-fit":"tw-w-fit",children:o})},ot={placement:"bottom-start",strategy:"absolute",middleware:[a.offset(12),a.flip({padding:12,fallbackPlacements:["bottom-end","top-start","top-end"]})]},Mr=()=>{const{ref:e,...t}=_r(ot),{ref:n,...r}=Fr(ot),o=a.useEditorRef(),i=ge(),l=i.isOpen(o.id),c=i.isEditing(),d=i.mode(),h=s.jsx(Dr,{}),p=c?h:s.jsx(Pr,{});return s.jsxs(s.Fragment,{children:[l&&d==="insert"&&xe.createPortal(s.jsx("div",{"data-is-underlay":!0,ref:e,...t,style:{...t.style,...j[a.TextStyles.p]},children:h}),document.body),l&&d==="edit"&&xe.createPortal(s.jsx("div",{"data-is-underlay":!0,ref:n,...r,style:{...r.style,...j[a.TextStyles.p]},children:p}),document.body)]})},P="button",Kt="button-plugin",Yt=e=>a.createPluginFactory({key:P,isElement:!0,isInline:!0,props:({element:t})=>({nodeProps:{href:t==null?void 0:t.url,target:t==null?void 0:t.target}}),withOverrides:Dt,renderAfterEditable:Mr,options:{isUrl:ke,rangeBeforeOptions:{matchString:" ",skipInvalid:!0,afterMatch:!0},triggerFloatingButtonHotkeys:"command+shift+k, ctrl+shift+k",appBridge:e},then:(t,{type:n})=>({deserializeHtml:{rules:[{validNodeName:"A",validClassName:"btn"}],getNode:r=>({type:n,url:r.getAttribute("href"),target:r.getAttribute("target")||"_blank"})}})})();class Qt extends a.Plugin{constructor({styles:n=Pe,...r}){super(Kt,{button:Sr,markupElement:new kr,...r});B(this,"styles",{});B(this,"appBridge");this.styles=n,this.appBridge=r==null?void 0:r.appBridge}plugins(){return[Yt(this.appBridge)]}}const Fr=e=>{const t=a.useEditorRef(),n=ge().mode(),r=ge().isOpen(t.id),o=a.useEditorVersion(),{triggerFloatingButtonHotkeys:i}=a.getPluginOptions(t,P),l=g.useCallback(()=>{const u=a.getAboveNode(t,{match:{type:a.getPluginType(t,P)}});if(u){const[,f]=u;return a.getRangeBoundingClientRect(t,{anchor:a.getStartPoint(t,f),focus:a.getEndPoint(t,f)})}return a.getDefaultBoundingClientRect()},[t]),c=r&&n==="edit",{update:d,style:h,floating:p}=Jt({open:c,getBoundingClientRect:l,...e});return g.useEffect(()=>{const u=_t(t);if(u&&N.url(u),t.selection&&a.someNode(t,{match:{type:a.getPluginType(t,P)}})){N.show("edit",t.id),d();return}L.mode()==="edit"&&N.reset()},[t,o,d]),a.useHotkeys(i,u=>{u.preventDefault(),L.mode()==="edit"&&Se(t)},{enableOnContentEditable:!0},[]),Or(),Xt(),{style:h,ref:a.useComposedRef(p)}},Or=()=>{const e=a.useEditorRef();a.useHotkeys("*",t=>{t.key==="Enter"&&Ye(e)&&t.preventDefault()},{enableOnFormTags:["INPUT"]},[])},Xt=()=>{const e=a.useEditorRef();a.useHotkeys("escape",()=>{if(L.mode()==="edit"){if(L.isEditing()){N.show("edit",e.id),a.focusEditor(e,e.selection??void 0);return}N.reset()}},{enableOnFormTags:["INPUT"],enableOnContentEditable:!0},[])},_r=e=>{const t=a.useEditorRef(),n=a.useFocused(),r=ge().mode(),o=ge().isOpen(t.id),{triggerFloatingButtonHotkeys:i}=a.getPluginOptions(t,P);a.useHotkeys(i,h=>{h.preventDefault(),Xe(t,{focused:n})},{enableOnContentEditable:!0},[n]);const{update:l,style:c,floating:d}=Jt({open:o&&r==="insert",getBoundingClientRect:a.getSelectionBoundingClientRect,whileElementsMounted:void 0,...e});return g.useEffect(()=>{o&&l(),N.updated(o)},[o,l]),Xt(),{style:c,ref:a.useComposedRef(d)}},Ur=12,Hr=-22,Vr=96,Jt=e=>a.useVirtualFloating({placement:"bottom-start",middleware:[a.offset({mainAxis:Ur,alignmentAxis:Hr}),a.flip({padding:Vr})],...e}),Ae="[&_.tw-break-after-column]:tw-break-after-auto [&_.tw-break-inside-avoid-column]:tw-break-inside-auto [&_.tw-break-after-column.tw-pb-5]:tw-pb-0 @md:[&_.tw-break-after-column.tw-pb-5]:!tw-pb-5 @md:[&_.tw-break-after-column]:!tw-break-after-column @md:[&_.tw-break-inside-avoid-column]:!tw-break-inside-avoid-column",zr="[&_.tw-break-after-column]:tw-break-after-auto [&_.tw-break-inside-avoid-column]:tw-break-inside-auto [&_.tw-break-after-column.tw-pb-5]:tw-pb-0 @sm:[&_.tw-break-after-column.tw-pb-5]:!tw-pb-5 @sm:[&_.tw-break-after-column]:!tw-break-after-column @sm:[&_.tw-break-inside-avoid-column]:!tw-break-inside-avoid-column",it={1:"tw-columns-1",2:`tw-columns-1 @sm:!tw-columns-2 ${zr}`,3:`tw-columns-1 @md:!tw-columns-3 ${Ae}`,4:`tw-columns-1 @md:!tw-columns-4 ${Ae}`,5:`tw-columns-1 @md:!tw-columns-5 ${Ae}`},Zt=e=>e?it[e]||it[1]:"",$r=e=>{L.isOpen(e)&&N.reset()},en=g.memo(({isEnabled:e,value:t,columns:n,gap:r,placeholder:o,plugins:i,onTextChange:l,showSerializedText:c})=>{const d=Zt(n),[h,p]=g.useState(!1),u=g.useId(),f=g.useCallback(w=>{w!==t&&(l==null||l(w)),p(!1)},[l,t]),v=g.useCallback(()=>p(!0),[]);return g.useEffect(()=>{const w=C=>{C.preventDefault(),C.returnValue="Unprocessed changes"};return h&&window.addEventListener("beforeunload",w),()=>window.removeEventListener("beforeunload",w)},[h]),e?s.jsx(a.RichTextEditor,{id:u,value:t,border:!1,placeholder:o,plugins:i,onValueChanged:v,onTextChange:f,hideExternalFloatingModals:$r,placeholderOpacity:"high"}):s.jsx(lr,{value:t,gap:r,customClass:d,show:c,plugins:i})});en.displayName="InternalRichTextEditor";const Wr=e=>{const t=g.useRef(null),[n,r]=g.useState(!1),{isEditing:o,...i}=e,l=g.useCallback(c=>{c&&r(!0)},[]);return ir({ref:t,disabled:!o,onChange:l}),g.useEffect(()=>{o||r(!1)},[o]),s.jsx("div",{"data-test-id":"rich-text-editor-container",className:"tw-block tw-w-full tw-@container",ref:t,children:s.jsx(en,{...i,isEnabled:o&&n})})},qr=({editButtonProps:e,unlinkButtonProps:t})=>{const{element:n}=a.useLinkOpenButtonState(),r=n?Ge(n):"";return s.jsx(a.FloatingModalWrapper,{"data-test-id":"floating-link-edit",padding:"16px",minWidth:"400px",children:s.jsxs("span",{"data-test-id":"preview-link-flyout",className:"tw-flex tw-justify-between tw-items-center tw-gap-2",children:[s.jsx("a",{"data-test-id":"floating-link-edit-url",href:r,target:"_blank",rel:"noopener noreferrer",style:j[oe],className:"tw-break-all",children:r}),s.jsxs("span",{className:"tw-flex tw-gap-2",children:[s.jsx("button",{tabIndex:0,"data-test-id":"edit-link-button",className:"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",...e,children:s.jsx(A.IconPen,{size:16})}),s.jsx("button",{tabIndex:0,"data-test-id":"remove-link-button",className:"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",...t,children:s.jsx(A.IconTrashBin,{size:16})})]})]})})},tn=(e,t)=>{const n=a.getAboveNode(e,{match:{type:a.ELEMENT_LINK}});return Array.isArray(n)?t(n[0]):""},Gr=e=>tn(e,t=>{var n,r;return((r=(n=t.chosenLink)==null?void 0:n.searchResult)==null?void 0:r.link)||""}),Kr=e=>tn(e,t=>t.url||""),Yr={url:"",text:"",newTab:!1},Qr=()=>{const[e,t]=g.useReducer((n,r)=>{const{type:o,payload:i}=r;switch(o){case"NEW_TAB":return{...n,newTab:!0};case"SAME_TAB":return{...n,newTab:!1};case"URL":case"TEXT":case"INIT":return{...n,...i};default:return n}},Yr);return[e,t]},Xr=()=>{const e=a.useEditorRef(),[t,n]=Qr();g.useEffect(()=>{const p=Gr(e),u=Kr(e),f=a.floatingLinkSelectors.newTab();n({type:"INIT",payload:{text:a.floatingLinkSelectors.text()||a.floatingLinkSelectors.url(),newTab:f,url:p&&u===""?p:a.floatingLinkSelectors.url()}})},[n,e]);const r=p=>{n({type:"TEXT",payload:{text:p}})},o=p=>{n({type:"URL",payload:{url:p}})},i=p=>{n(p?{type:"NEW_TAB"}:{type:"SAME_TAB"})},l=()=>{a.floatingLinkActions.reset()},c=p=>{!se(t.url)||!d||(a.floatingLinkActions.text(t.text),a.floatingLinkActions.url(Ce(t.url)),a.floatingLinkActions.newTab(t.newTab),a.submitFloatingLink(e)&&(p==null||p.preventDefault()))},d=t.url!==""&&t.text!=="",{appBridge:h}=a.getPluginOptions(e,a.ELEMENT_LINK);return a.useHotkeys("enter",c,{enableOnFormTags:["INPUT"]},[]),{state:t,onTextChange:r,onUrlChange:o,onToggleTab:i,onCancel:l,onSave:c,hasValues:d,isValidUrlOrEmpty:se,appBridge:h}},Jr=()=>s.jsx(Gt,{...Xr(),testId:"floating-link-insert"}),lt={placement:"bottom-start",strategy:"absolute",middleware:[a.offset(12),a.flip({padding:12,fallbackPlacements:["bottom-end","top-start","top-end"]})]},Zr=()=>{const e=a.useFloatingLinkInsertState({floatingOptions:lt}),{props:t,ref:n,hidden:r}=a.useFloatingLinkInsert(e),o=a.useFloatingLinkEditState({floatingOptions:lt}),{props:i,ref:l,editButtonProps:c,unlinkButtonProps:d}=a.useFloatingLinkEdit(o);if(r)return null;const h=s.jsx(Jr,{}),p=o.isEditing?h:s.jsx(qr,{editButtonProps:c,unlinkButtonProps:d});return s.jsxs(s.Fragment,{children:[e.isOpen&&!o.isOpen&&xe.createPortal(s.jsx("div",{"data-is-underlay":!0,ref:n,...t,style:{...t.style,...j[b.p]},children:h}),document.body),o.isOpen&&xe.createPortal(s.jsx("div",{"data-is-underlay":!0,ref:l,...i,style:{...i.style,...j[b.p]},children:p}),document.body)]})},nn=g.forwardRef((e,t)=>{const n=a.useEditorRef(),r=a.useLinkToolbarButtonState(),{props:o}=a.useLinkToolbarButton(r);return s.jsx(a.ToolbarButton,{onMouseDown:i=>{i.preventDefault(),a.focusEditor(n,n.selection??n.prevSelection??void 0)},ref:t,...o,...e,children:s.jsx(a.IconStylingWrapper,{icon:s.jsx(A.IconLink,{size:16})})})});nn.displayName="LinkToolbarButton";const es=({id:e,editorId:t})=>{const n=a.useEditorState(a.useEventPlateId(t)),r=!!a.isRangeInSameBlock(n,{at:n.selection});return s.jsx("div",{"data-plugin-id":e,children:s.jsx(nn,{disabled:!r,tooltip:a.getTooltip(r?`Link
|
|
3
3
|
${a.getHotkeyByPlatform("Ctrl+K")}`:"Links can only be set for a single text block.")})})},ts=e=>{var l,c;const{attributes:t,children:n}=e,{styles:r}=a.useRichTextEditorContext(),o=e.element.url||((c=(l=e.element.chosenLink)==null?void 0:l.searchResult)==null?void 0:c.link)||"",i=e.element.target||"_self";return s.jsx("a",{...t,href:o,target:i,style:r[oe],children:n})};class ns extends a.MarkupElement{constructor(t=a.ELEMENT_LINK,n=ts){super(t,n)}}const rn=e=>a.createPluginFactory({...a.createLinkPlugin(),renderAfterEditable:Zr,options:{isUrl:ke,rangeBeforeOptions:{matchString:" ",skipInvalid:!0,afterMatch:!0},triggerFloatingLinkHotkeys:"meta+k, ctrl+k",keepSelectedTextOnPaste:!0,appBridge:e}})();class sn extends a.Plugin{constructor({styles:n=j[oe],...r}){super(oe,{button:es,markupElement:new ns,...r});B(this,"styles",{});B(this,"appBridge");this.styles=n,this.appBridge=r.appBridge}plugins(){return[rn(this.appBridge)]}}const rs="breakAfterColumn",an="normal";class ss extends a.Plugin{constructor(n){super("break-after-plugin",{button:a.ColumnBreakButton,...n});B(this,"columns");B(this,"gap");B(this,"customClass");this.columns=(n==null?void 0:n.columns)??1,this.gap=(n==null?void 0:n.gap)??an,this.customClass=Zt(this.columns)}plugins(){return[a.createColumnBreakPlugin(this.columns,this.gap,this.customClass)]}}const as="textstyle-custom1-plugin";class on extends a.Plugin{constructor({styles:n=j.custom1,...r}={}){super(b.custom1,{label:"Custom 1",markupElement:new os,...r});B(this,"styles",{});this.styles=n}plugins(){return[is(this.styles)]}}class os extends a.MarkupElement{constructor(t=as,n=ln){super(t,n)}}const ln=({element:e,attributes:t,children:n,styles:r})=>{const o=e.align;return s.jsx("p",{...t,style:r,className:a.merge([o&&a.alignmentClassnames[o],a.getColumnBreakClasses(e)]),children:n})},is=e=>a.createPluginFactory({key:b.custom1,isElement:!0,deserializeHtml:{rules:[{validClassName:b.custom1}]}})({component:t=>s.jsx(ln,{...t,styles:e})}),ls="textstyle-custom2-plugin";class dn extends a.Plugin{constructor({styles:n=j.custom2,...r}={}){super(b.custom2,{label:"Custom 2",markupElement:new ds,...r});B(this,"styles",{});this.styles=n}plugins(){return[cs(this.styles)]}}class ds extends a.MarkupElement{constructor(t=ls,n=cn){super(t,n)}}const cn=({element:e,attributes:t,children:n,styles:r})=>{const o=e.align;return s.jsx("p",{...t,className:a.merge([o&&a.alignmentClassnames[o],a.getColumnBreakClasses(e)]),style:r,children:n})},cs=e=>a.createPluginFactory({key:b.custom2,isElement:!0,deserializeHtml:{rules:[{validClassName:b.custom2}]}})({component:t=>s.jsx(cn,{...t,styles:e})}),us="textstyle-custom3-plugin";class un extends a.Plugin{constructor({styles:n=j.custom3,...r}={}){super(a.TextStyles.custom3,{label:"Custom 3",markupElement:new gs,...r});B(this,"styles",{});this.styles=n}plugins(){return[ms(this.styles)]}}class gs extends a.MarkupElement{constructor(t=us,n=gn){super(t,n)}}const gn=({element:e,attributes:t,children:n,styles:r})=>{const o=e.align;return s.jsx("p",{...t,className:a.merge([o&&a.alignmentClassnames[o],a.getColumnBreakClasses(e)]),style:r,children:n})},ms=e=>a.createPluginFactory({key:a.TextStyles.custom3,isElement:!0,deserializeHtml:{rules:[{validClassName:a.TextStyles.custom3}]}})({component:t=>s.jsx(gn,{...t,styles:e})}),hs="textstyle-heading1-plugin";class mn extends a.Plugin{constructor({styles:n=j.heading1,...r}={}){super(b.heading1,{label:"Heading 1",markupElement:new fs,...r});B(this,"styles",{});this.styles=n}plugins(){return[ps(this.styles)]}}class fs extends a.MarkupElement{constructor(t=hs,n=Le){super(t,n)}}const Le=({element:e,attributes:t,children:n,styles:r})=>{const o=e.align;return s.jsx("h1",{...t,className:a.merge([o&&a.alignmentClassnames[o],a.getColumnBreakClasses(e)]),style:r,children:n})},ps=e=>a.createPluginFactory({key:b.heading1,isElement:!0,component:Le,deserializeHtml:{rules:[{validNodeName:["h1","H1"]}]}})({component:t=>s.jsx(Le,{...t,styles:e})}),xs="textstyle-heading2-plugin";class hn extends a.Plugin{constructor({styles:n=j.heading2,...r}={}){super(b.heading2,{label:"Heading 2",markupElement:new ws,...r});B(this,"styles",{});this.styles=n}plugins(){return[bs(this.styles)]}}class ws extends a.MarkupElement{constructor(t=xs,n=Re){super(t,n)}}const Re=({element:e,attributes:t,children:n,styles:r})=>{const o=e.align;return s.jsx("h2",{...t,className:a.merge([o&&a.alignmentClassnames[o],a.getColumnBreakClasses(e)]),style:r,children:n})},bs=e=>a.createPluginFactory({key:b.heading2,isElement:!0,component:Re,deserializeHtml:{rules:[{validNodeName:["h2","H2"]}]}})({component:t=>s.jsx(Re,{...t,styles:e})}),ys="textstyle-heading3-plugin";class fn extends a.Plugin{constructor({styles:n=j.heading3,...r}={}){super(b.heading3,{label:"Heading 3",markupElement:new vs,...r});B(this,"styles",{});this.styles=n}plugins(){return[Cs(this.styles)]}}class vs extends a.MarkupElement{constructor(t=ys,n=De){super(t,n)}}const De=({element:e,attributes:t,children:n,styles:r})=>{const o=e.align;return s.jsx("h3",{...t,className:a.merge([o&&a.alignmentClassnames[o],a.getColumnBreakClasses(e)]),style:r,children:n})},Cs=e=>a.createPluginFactory({key:b.heading3,isElement:!0,component:De,deserializeHtml:{rules:[{validNodeName:["h3","H3"]}]}})({component:t=>s.jsx(De,{...t,styles:e})}),ks="textstyle-heading4-plugin";class pn extends a.Plugin{constructor({styles:n=j.heading4,...r}={}){super(b.heading4,{label:"Heading 4",markupElement:new Ss,...r});B(this,"styles",{});this.styles=n}plugins(){return[Ps(this.styles)]}}class Ss extends a.MarkupElement{constructor(t=ks,n=Me){super(t,n)}}const Me=({element:e,attributes:t,children:n,styles:r})=>{const o=e.align;return s.jsx("h4",{...t,className:a.merge([o&&a.alignmentClassnames[o],a.getColumnBreakClasses(e)]),style:r,children:n})},Ps=e=>a.createPluginFactory({key:b.heading4,isElement:!0,component:Me,deserializeHtml:{rules:[{validNodeName:["h4","H4"]}]}})({component:t=>s.jsx(Me,{...t,styles:e})}),Ts="textstyle-imageCaption-plugin";class xn extends a.Plugin{constructor({styles:n=j.imageCaption,...r}={}){super(b.imageCaption,{label:"Image Caption",markupElement:new js,...r});B(this,"styles",{});this.styles=n}plugins(){return[Es(this.styles)]}}class js extends a.MarkupElement{constructor(t=Ts,n=Fe){super(t,n)}}const Fe=({element:e,attributes:t,children:n,styles:r})=>{const o=e.align;return s.jsx("p",{...t,className:a.merge([o&&a.alignmentClassnames[o],a.getColumnBreakClasses(e)]),style:r,children:n})},Es=e=>a.createPluginFactory({key:b.imageCaption,isElement:!0,component:Fe,deserializeHtml:{rules:[{validClassName:b.imageCaption}]}})({component:t=>s.jsx(Fe,{...t,styles:e})}),Is="textstyle-imageTitle-plugin";class wn extends a.Plugin{constructor({styles:n=j.imageTitle,...r}={}){super(b.imageTitle,{label:"Image Title",markupElement:new Bs,...r});B(this,"styles",{});this.styles=n}plugins(){return[Ns(this.styles)]}}class Bs extends a.MarkupElement{constructor(t=Is,n=Oe){super(t,n)}}const Oe=({element:e,attributes:t,children:n,styles:r})=>{const o=e.align;return s.jsx("p",{...t,className:a.merge([o&&a.alignmentClassnames[o],a.getColumnBreakClasses(e)]),style:r,children:n})},Ns=e=>a.createPluginFactory({key:b.imageTitle,isElement:!0,component:Oe,deserializeHtml:{rules:[{validClassName:b.imageTitle}]}})({component:t=>s.jsx(Oe,{...t,styles:e})});class bn extends a.Plugin{constructor({styles:n=j.p,...r}={}){super(b.p,{markupElement:new vn,label:"Body Text",...r});B(this,"styles",{});this.styles=n}plugins(){return[Cn(this.styles)]}}const yn="tw-m-0 tw-px-0 tw-py-0",we=({element:e,attributes:t,children:n,styles:r})=>{const o=e.align,i=a.merge([o&&a.alignmentClassnames[o],yn,a.getColumnBreakClasses(e)]);return s.jsx("p",{...t,className:i,style:r,children:n})};class vn extends a.MarkupElement{constructor(t=b.p,n=we){super(t,n)}}const Cn=e=>a.createPluginFactory({...a.createParagraphPlugin(),key:b.p,isElement:!0,component:we})({component:t=>s.jsx(we,{...t,styles:e})}),As="textstyle-quote-plugin";class kn extends a.Plugin{constructor({styles:n=j.quote,...r}={}){super(b.quote,{label:"Quote",markupElement:new Ls,...r});B(this,"styles",{});this.styles=n}plugins(){return[Sn(this.styles)]}}class Ls extends a.MarkupElement{constructor(t=As,n=be){super(t,n)}}const be=({element:e,attributes:t,children:n,styles:r})=>{const o=e.align;return s.jsx("blockquote",{...t,className:a.merge([o&&a.alignmentClassnames[o],a.getColumnBreakClasses(e)]),style:r,children:n})},Sn=e=>a.createPluginFactory({key:b.quote,isElement:!0,component:be,deserializeHtml:{rules:[{validNodeName:["blockquote","BLOCKQUOTE"]}]}})({component:t=>s.jsx(be,{...t,styles:e})}),Je=[new mn,new hn,new fn,new pn,new on,new dn,new un,new kn,new bn],re=[b.heading1,b.heading2,b.heading3,b.heading4,b.custom1,b.custom2,b.custom3,b.quote,b.p],Rs=[...Je,new xn,new wn],Ds=[...re,b.imageCaption,b.imageTitle],Ms=e=>new a.PluginComposer().setPlugin(new a.SoftBreakPlugin,new a.TextStylePlugin({textStyles:Je})).setPlugin([new a.BoldPlugin,new a.ItalicPlugin,new a.UnderlinePlugin,new a.StrikethroughPlugin,new sn({appBridge:e}),new Qt({appBridge:e}),new a.CodePlugin],[new a.AlignLeftPlugin({validTypes:re}),new a.AlignCenterPlugin({validTypes:re}),new a.AlignRightPlugin({validTypes:re}),new a.AlignJustifyPlugin({validTypes:re}),new a.UnorderedListPlugin,new a.CheckboxListPlugin,new a.OrderedListPlugin,new a.ResetFormattingPlugin,new a.AutoformatPlugin]),Fs="--f-theme-settings-",Os=e=>{const t=e!=null&&e.id?`hasBackground${e.id}`:"hasBackground",n=e!=null&&e.id?`backgroundColor${e.id}`:"backgroundColor",r=e!=null&&e.preventDefaultColor?void 0:(e==null?void 0:e.defaultColor)||Gn,o=e!=null&&e.label?e.label:"Background",i=e!=null&&e.switchLabel?e.switchLabel:void 0;return{id:t,label:o,type:"switch",switchLabel:i,defaultValue:!!(e!=null&&e.defaultValue),on:[{id:n,defaultValue:r,type:"colorInput"}]}},_s=e=>{const t=e!=null&&e.id?`hasBorder_${e.id}`:"hasBorder",n=e!=null&&e.id?`borderSelection_${e.id}`:"borderSelection",r=e!=null&&e.id?`borderStyle_${e.id}`:"borderStyle",o=e!=null&&e.id?`borderWidth_${e.id}`:"borderWidth",i=e!=null&&e.id?`borderColor_${e.id}`:"borderColor",l=(e==null?void 0:e.defaultColor)||ct,c=e!=null&&e.switchLabel?e.switchLabel:void 0;return{id:t,label:"Border",type:"switch",switchLabel:c,defaultValue:!!(e!=null&&e.defaultValue),on:[{id:n,type:"multiInput",layout:m.MultiInputLayout.Columns,lastItemFullWidth:!0,blocks:[{id:r,type:"dropdown",defaultValue:H.Solid,choices:[{value:H.Solid,label:H.Solid},{value:H.Dotted,label:H.Dotted},{value:H.Dashed,label:H.Dashed}]},{id:o,type:"input",defaultValue:Kn,rules:[m.numericalOrPixelRule,m.minimumNumericalOrPixelRule(0),m.maximumNumericalOrPixelOrAutoRule(500)],placeholder:"e.g. 3px",onChange:d=>m.appendUnit(d,o)},{id:i,type:"colorInput",defaultValue:l}]}],off:[]}},Ze=(e,t=q.None)=>({id:e,type:"segmentedControls",defaultValue:t,choices:[{value:q.None,label:"None"},{value:q.Small,label:"S"},{value:q.Medium,label:"M"},{value:q.Large,label:"L"}]}),Us=e=>{const t=e!=null&&e.id?`hasRadius_${e.id}`:"hasRadius",n=e!=null&&e.id?`radiusValue_${e.id}`:"radiusValue",r=e!=null&&e.id?`radiusChoice_${e.id}`:"radiusChoice",o=(e==null?void 0:e.defaultRadius)||q.None;return{id:t,label:"Corner radius",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"Determining how rounded the corners are.",show:i=>{var l;return e!=null&&e.dependentSettingId?!!((l=i.getBlock(e.dependentSettingId))!=null&&l.value):!0},onChange:i=>m.presetCustomValue(i,r,n,(e==null?void 0:e.radiusStyleMap)||X),on:[{id:n,type:"input",placeholder:"e.g. 10px",rules:[m.numericalOrPixelRule],onChange:i=>m.appendUnit(i,n)}],off:[Ze(r,o)]}},Hs=e=>{const t=e!=null&&e.id?`hasExtendedCustomRadius_${e.id}`:"hasExtendedCustomRadius",n=e!=null&&e.id?`extendedRadiusValue_${e.id}`:"extendedRadiusValue",r=e!=null&&e.id?`extendedRadiusChoice_${e.id}`:"extendedRadiusChoice",o=e!=null&&e.id?`extendedRadiusTopLeft_${e.id}`:"extendedRadiusTopLeft",i=e!=null&&e.id?`extendedRadiusTopRight_${e.id}`:"extendedRadiusTopRight",l=e!=null&&e.id?`extendedRadiusBottomLeft_${e.id}`:"extendedRadiusBottomLeft",c=e!=null&&e.id?`extendedRadiusBottomRight_${e.id}`:"extendedRadiusBottomRight";return{id:t,label:"Corner radius",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"Determining how rounded the corners are.",show:d=>{var h;return e!=null&&e.dependentSettingId?!!((h=d.getBlock(e.dependentSettingId))!=null&&h.value):!0},onChange:d=>{m.presetCustomValue(d,r,o,X),m.presetCustomValue(d,r,i,X),m.presetCustomValue(d,r,l,X),m.presetCustomValue(d,r,c,X)},on:[{id:n,type:"multiInput",layout:m.MultiInputLayout.Columns,blocks:[{id:o,type:"input",label:"Top Left",rules:[m.numericalOrPixelRule],onChange:d=>m.appendUnit(d,o)},{id:i,type:"input",label:"Top Right",rules:[m.numericalOrPixelRule],onChange:d=>m.appendUnit(d,i)},{id:l,type:"input",label:"Bottom Left",rules:[m.numericalOrPixelRule],onChange:d=>m.appendUnit(d,l)},{id:c,type:"input",label:"Bottom Right",rules:[m.numericalOrPixelRule],onChange:d=>m.appendUnit(d,c)}]}],off:[Ze(r,e==null?void 0:e.defaultValue)]}},Vs=e=>{const t=e!=null&&e.id?e.id:"hasCustomSpacing",n=e!=null&&e.dependentSettingId?e.dependentSettingId:"columns",r=e!=null&&e.spacingChoiceId?e.spacingChoiceId:"spacingChoice",o=e!=null&&e.spacingCustomId?e.spacingCustomId:"spacingCustom",i=e!=null&&e.defaultValueChoices?e.defaultValueChoices:Q.M;return{id:t,type:"switch",defaultValue:!1,switchLabel:"Custom",label:"Gutter",info:"An official nerds term for ‘gap’",onChange:l=>m.presetCustomValue(l,r,o,gt),show:l=>{var c;return((c=l.getBlock(n))==null?void 0:c.value)!=="1"},on:[{id:o,type:"input",rules:[m.numericalOrPixelRule],onChange:l=>m.appendUnit(l,o)}],off:[{id:r,type:"slider",defaultValue:i,choices:[{value:Q.Auto,label:"Auto"},{value:Q.S,label:"S"},{value:Q.M,label:"M"},{value:Q.L,label:"L"}]}]}},et=e=>({id:e,type:"segmentedControls",defaultValue:Y.None,choices:[{value:Y.None,label:"None"},{value:Y.Small,label:"S"},{value:Y.Medium,label:"M"},{value:Y.Large,label:"L"}]}),zs=e=>{const t=e!=null&&e.id?`hasCustomMarginValue_${e==null?void 0:e.id}`:"hasCustomMarginValue",n=e!=null&&e.id?`marginValue_${e==null?void 0:e.id}`:"marginValue",r=e!=null&&e.id?`marginChoice_${e==null?void 0:e.id}`:"marginChoice";return{id:t,label:"Margin",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"The spacing around UI elements to create more space",onChange:o=>m.presetCustomValue(o,r,n,(e==null?void 0:e.marginStyleMap)||ne),on:[{id:n,type:"input",placeholder:ue,rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)],onChange:o=>m.appendUnit(o,n)}],off:[et(r)]}},$s=e=>{const t=e!=null&&e.id?`hasExtendedCustomMargin_${e==null?void 0:e.id}`:"hasExtendedCustomMargin",n=e!=null&&e.id?`extendedMarginValues_${e==null?void 0:e.id}`:"extendedMarginValues",r=e!=null&&e.id?`extendedMarginChoice_${e==null?void 0:e.id}`:"extendedMarginChoice",o=e!=null&&e.id?`extendedMarginTop_${e==null?void 0:e.id}`:"extendedMarginTop",i=e!=null&&e.id?`extendedMarginLeft_${e==null?void 0:e.id}`:"extendedMarginLeft",l=e!=null&&e.id?`extendedMarginRight_${e==null?void 0:e.id}`:"extendedMarginRight",c=e!=null&&e.id?`extendedMarginBottom_${e==null?void 0:e.id}`:"extendedMarginBottom";return{id:t,label:"Margin",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"The spacing around UI elements to create more negative space",onChange:d=>{m.presetCustomValue(d,r,o,ne),m.presetCustomValue(d,r,i,ne),m.presetCustomValue(d,r,l,ne),m.presetCustomValue(d,r,c,ne)},on:[{id:n,type:"multiInput",layout:m.MultiInputLayout.Spider,blocks:[{id:o,type:"input",label:"Top",placeholder:ue,onChange:d=>m.appendUnit(d,o),rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)]},{id:i,type:"input",label:"Left",placeholder:ue,onChange:d=>m.appendUnit(d,i),rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)]},{id:l,type:"input",label:"Right",placeholder:ue,onChange:d=>m.appendUnit(d,l),rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)]},{id:c,type:"input",label:"Bottom",placeholder:ue,onChange:d=>m.appendUnit(d,c),rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)]}]}],off:[et(r)]}},tt=e=>({id:e,type:"segmentedControls",defaultValue:K.Small,choices:[{value:K.None,label:"None"},{value:K.Small,label:"S"},{value:K.Medium,label:"M"},{value:K.Large,label:"L"}]}),Ws=e=>{const t=e!=null&&e.id?`hasCustomPaddingValue_${e==null?void 0:e.id}`:"hasCustomPaddingValue",n=e!=null&&e.id?`paddingValue_${e==null?void 0:e.id}`:"paddingValue",r=e!=null&&e.id?`paddingChoice_${e==null?void 0:e.id}`:"paddingChoice";return{id:t,label:"Padding",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"The spacing around UI elements to create more negative space",onChange:o=>m.presetCustomValue(o,r,n,(e==null?void 0:e.paddingStyleMap)||te),on:[{id:n,type:"input",placeholder:ce,rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)],onChange:o=>m.appendUnit(o,n)}],off:[tt(r)]}},qs=e=>{const t=e!=null&&e.id?`hasExtendedCustomPadding_${e==null?void 0:e.id}`:"hasExtendedCustomPadding",n=e!=null&&e.id?`extendedPaddingValues_${e==null?void 0:e.id}`:"extendedPaddingValues",r=e!=null&&e.id?`extendedPaddingChoice_${e==null?void 0:e.id}`:"extendedPaddingChoice",o=e!=null&&e.id?`extendedPaddingTop_${e==null?void 0:e.id}`:"extendedPaddingTop",i=e!=null&&e.id?`extendedPaddingLeft_${e==null?void 0:e.id}`:"extendedPaddingLeft",l=e!=null&&e.id?`extendedPaddingRight_${e==null?void 0:e.id}`:"extendedPaddingRight",c=e!=null&&e.id?`extendedPaddingBottom_${e==null?void 0:e.id}`:"extendedPaddingBottom";return{id:t,label:"Padding",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"The spacing around UI elements to create more negative space",onChange:d=>{m.presetCustomValue(d,r,o,te),m.presetCustomValue(d,r,i,te),m.presetCustomValue(d,r,l,te),m.presetCustomValue(d,r,c,te)},on:[{id:n,type:"multiInput",layout:m.MultiInputLayout.Spider,blocks:[{id:o,type:"input",label:"Top",placeholder:ce,onChange:d=>m.appendUnit(d,o),rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)]},{id:i,type:"input",label:"Left",placeholder:ce,onChange:d=>m.appendUnit(d,i),rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)]},{id:l,type:"input",label:"Right",placeholder:ce,onChange:d=>m.appendUnit(d,l),rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)]},{id:c,type:"input",label:"Bottom",placeholder:ce,onChange:d=>m.appendUnit(d,c),rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)]}]}],off:[tt(r)]}},Gs=e=>{const t=nt(e==null?void 0:e.globalControlId);return{id:e!=null&&e.id?e.id:"downloadable",type:"switch",defaultValue:!1,label:"Downloadable",show:n=>{var r;return((r=n.getBlock(t))==null?void 0:r.value)===Z.Custom}}},nt=e=>e||"security",Ks=e=>[{id:nt(e),type:"segmentedControls",defaultValue:Z.Global,choices:[{value:Z.Global,label:"Global Settings"},{value:Z.Custom,label:"Custom"}]},{id:"globalSettingsInfo",type:"notification",footer:m.createFooter({label:"Change global settings [here].",replace:{here:{event:"general-settings.open"}}})}];var Pn=(e=>(e.Main="main",e.Basics="basics",e.Layout="layout",e.Style="style",e.Security="security",e.Targets="targets",e))(Pn||{});const Ys=e=>e,Qs=e=>e;exports.AllTextStylePlugins=Rs;exports.AllTextStyles=Ds;exports.AttachmentOperationsProvider=Xn;exports.Attachments=Ct;exports.AttachmentsProvider=xt;exports.AttachmentsToolbarButton=Pt;exports.BUTTON_PLUGIN=Kt;exports.BlockButtonStyles=Pe;exports.BlockInjectButton=Fn;exports.BlockItemWrapper=At;exports.BlockStyles=j;exports.BorderStyle=H;exports.BreakAfterPlugin=ss;exports.ButtonPlugin=Qt;exports.Custom1Plugin=on;exports.Custom2Plugin=dn;exports.Custom3Plugin=un;exports.DEFAULT_ATTACHMENTS_BUTTON_ID=St;exports.DEFAULT_DRAGGING_TOOLTIP=jt;exports.DEFAULT_DRAG_TOOLTIP=Tt;exports.DEFAULT_MENU_BUTTON_ID=$e;exports.DownloadButton=or;exports.DragHandleToolbarButton=Et;exports.DragPreviewContextProvider=mt;exports.ELEMENT_BUTTON=P;exports.FlyoutToolbarButton=It;exports.GAP_DEFAULT=an;exports.GutterSpacing=Q;exports.Heading1Plugin=mn;exports.Heading2Plugin=hn;exports.Heading3Plugin=fn;exports.Heading4Plugin=pn;exports.ImageCaptionPlugin=xn;exports.ImageTitlePlugin=wn;exports.KEY_ELEMENT_BREAK_AFTER_COLUMN=rs;exports.LinkInput=qt;exports.LinkPlugin=sn;exports.LinkSelector=Wt;exports.Margin=Y;exports.MenuToolbarButton=Bt;exports.MultiFlyoutContextProvider=ht;exports.PARAGRAPH_CLASSES=yn;exports.Padding=K;exports.ParagraphMarkupElement=vn;exports.ParagraphMarkupElementNode=we;exports.ParagraphPlugin=bn;exports.QuoteMarkupElementNode=be;exports.QuotePlugin=kn;exports.Radius=q;exports.RichTextEditor=Wr;exports.Sections=Pn;exports.Security=Z;exports.THEME_PREFIX=Fs;exports.TextStylePluginsWithoutImage=Je;exports.TextStyles=b;exports.TextStylesWithoutImage=re;exports.Toolbar=Nt;exports.addHttps=Ce;exports.borderStyleMap=ut;exports.convertToRteValue=dr;exports.createButtonNode=Ut;exports.createButtonPlugin=Yt;exports.createLinkPlugin=rn;exports.createParagraphPlugin=Cn;exports.createQuotePlugin=Sn;exports.customCoordinatesGetterFactory=bt;exports.defineBlock=Ys;exports.defineSettings=Qs;exports.getBackgroundColorStyles=qn;exports.getBackgroundSettings=Os;exports.getBorderRadiusSettings=Us;exports.getBorderRadiusSlider=Ze;exports.getBorderSettings=_s;exports.getBorderStyles=Yn;exports.getDefaultPluginsWithLinkChooser=Ms;exports.getExtendedBorderRadiusSettings=Hs;exports.getGutterSettings=Vs;exports.getLegacyUrl=hr;exports.getLinkFromEditor=pr;exports.getMarginExtendedSettings=$s;exports.getMarginSettings=zs;exports.getMarginSlider=et;exports.getPaddingExtendedSettings=qs;exports.getPaddingSettings=Ws;exports.getPaddingSlider=tt;exports.getRadiusStyles=Qn;exports.getReadableColor=$n;exports.getSecurityDownloadableSetting=Gs;exports.getSecurityGlobalControlId=nt;exports.getSecurityGlobalControlSetting=Ks;exports.getUrl=fr;exports.getUrlFromEditor=_t;exports.getUrlFromLinkOrLegacyLink=Ge;exports.gutterSpacingStyleMap=gt;exports.hasRichTextValue=Lt;exports.insertButton=Mt;exports.isDark=_n;exports.isDownloadable=cr;exports.isValidUrl=ke;exports.isValidUrlOrEmpty=se;exports.joinClassNames=V;exports.mapAppBridgeColorPaletteToFonduePalette=Rt;exports.mapAppBridgeColorPalettesToFonduePalettes=ur;exports.marginStyleMap=ne;exports.moveItemInArray=Wn;exports.paddingStyleMap=te;exports.radiusStyleMap=X;exports.relativeUrlRegex=Ke;exports.setAlpha=Vn;exports.submitFloatingButton=Ye;exports.toColorObject=zn;exports.toHex8String=Un;exports.toHexString=Hn;exports.toRgbaString=_e;exports.toShortRgba=ee;exports.triggerFloatingButton=Ht;exports.triggerFloatingButtonEdit=Se;exports.triggerFloatingButtonInsert=Xe;exports.unwrapButton=ae;exports.upsertButton=Ft;exports.upsertButtonText=Qe;exports.useAttachmentOperations=Ve;exports.useAttachments=pt;exports.useAttachmentsContext=wt;exports.useDndSensors=tr;exports.useDragPreviewContext=ie;exports.useMultiFlyoutContext=ft;exports.useMultiFlyoutState=ye;exports.withAttachmentsProvider=Jn;exports.withButton=Dt;exports.wrapButton=Ot;Object.keys(m).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>m[e]})});
|
|
4
4
|
//# sourceMappingURL=index.cjs.js.map
|