@blocknote/core 0.1.0-alpha.3
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/README.md +99 -0
- package/dist/blocknote.js +4485 -0
- package/dist/blocknote.js.map +1 -0
- package/dist/blocknote.umd.cjs +90 -0
- package/dist/blocknote.umd.cjs.map +1 -0
- package/dist/style.css +1 -0
- package/package.json +109 -0
- package/src/BlockNoteExtensions.ts +90 -0
- package/src/EditorContent.tsx +1 -0
- package/src/assets/inter-v12-latin/inter-v12-latin-100.woff +0 -0
- package/src/assets/inter-v12-latin/inter-v12-latin-100.woff2 +0 -0
- package/src/assets/inter-v12-latin/inter-v12-latin-200.woff +0 -0
- package/src/assets/inter-v12-latin/inter-v12-latin-200.woff2 +0 -0
- package/src/assets/inter-v12-latin/inter-v12-latin-300.woff +0 -0
- package/src/assets/inter-v12-latin/inter-v12-latin-300.woff2 +0 -0
- package/src/assets/inter-v12-latin/inter-v12-latin-500.woff +0 -0
- package/src/assets/inter-v12-latin/inter-v12-latin-500.woff2 +0 -0
- package/src/assets/inter-v12-latin/inter-v12-latin-600.woff +0 -0
- package/src/assets/inter-v12-latin/inter-v12-latin-600.woff2 +0 -0
- package/src/assets/inter-v12-latin/inter-v12-latin-700.woff +0 -0
- package/src/assets/inter-v12-latin/inter-v12-latin-700.woff2 +0 -0
- package/src/assets/inter-v12-latin/inter-v12-latin-800.woff +0 -0
- package/src/assets/inter-v12-latin/inter-v12-latin-800.woff2 +0 -0
- package/src/assets/inter-v12-latin/inter-v12-latin-900.woff +0 -0
- package/src/assets/inter-v12-latin/inter-v12-latin-900.woff2 +0 -0
- package/src/assets/inter-v12-latin/inter-v12-latin-regular.woff +0 -0
- package/src/assets/inter-v12-latin/inter-v12-latin-regular.woff2 +0 -0
- package/src/editor.module.css +3 -0
- package/src/extensions/Blocks/OrderedListPlugin.ts +46 -0
- package/src/extensions/Blocks/PreviousBlockTypePlugin.ts +146 -0
- package/src/extensions/Blocks/commands/joinBackward.ts +274 -0
- package/src/extensions/Blocks/helpers/findBlock.ts +3 -0
- package/src/extensions/Blocks/helpers/setBlockHeading.ts +30 -0
- package/src/extensions/Blocks/index.ts +15 -0
- package/src/extensions/Blocks/nodes/Block.module.css +226 -0
- package/src/extensions/Blocks/nodes/Block.ts +390 -0
- package/src/extensions/Blocks/nodes/BlockGroup.ts +28 -0
- package/src/extensions/Blocks/nodes/Content.ts +50 -0
- package/src/extensions/Blocks/nodes/README.md +26 -0
- package/src/extensions/Blocks/rule.ts +48 -0
- package/src/extensions/BubbleMenu/BubbleMenuExtension.tsx +28 -0
- package/src/extensions/BubbleMenu/BubbleMenuPlugin.ts +245 -0
- package/src/extensions/BubbleMenu/component/BubbleMenu.tsx +216 -0
- package/src/extensions/BubbleMenu/component/DropdownBlockItem.module.css +13 -0
- package/src/extensions/BubbleMenu/component/DropdownBlockItem.tsx +25 -0
- package/src/extensions/BubbleMenu/component/LinkToolbarButton.tsx +67 -0
- package/src/extensions/DraggableBlocks/DraggableBlocksExtension.ts +15 -0
- package/src/extensions/DraggableBlocks/DraggableBlocksPlugin.tsx +266 -0
- package/src/extensions/DraggableBlocks/components/DragHandle.module.css +33 -0
- package/src/extensions/DraggableBlocks/components/DragHandle.tsx +108 -0
- package/src/extensions/DraggableBlocks/components/DragHandleMenu.module.css +10 -0
- package/src/extensions/DraggableBlocks/components/DragHandleMenu.tsx +18 -0
- package/src/extensions/Hyperlinks/HyperlinkMark.tsx +16 -0
- package/src/extensions/Hyperlinks/HyperlinkMenuPlugin.tsx +200 -0
- package/src/extensions/Hyperlinks/menus/HyperlinkBasicMenu.tsx +59 -0
- package/src/extensions/Hyperlinks/menus/HyperlinkEditMenu.tsx +72 -0
- package/src/extensions/Hyperlinks/menus/atlaskit/PanelTextInput.tsx +173 -0
- package/src/extensions/Hyperlinks/menus/atlaskit/PanelTextInputStyles.ts +36 -0
- package/src/extensions/Hyperlinks/menus/atlaskit/README.md +1 -0
- package/src/extensions/Hyperlinks/menus/atlaskit/ToolbarComponent.tsx +61 -0
- package/src/extensions/Paragraph/FixedParagraph.ts +12 -0
- package/src/extensions/Placeholder/PlaceholderExtension.ts +127 -0
- package/src/extensions/SlashMenu/SlashMenuExtension.ts +43 -0
- package/src/extensions/SlashMenu/SlashMenuItem.ts +56 -0
- package/src/extensions/SlashMenu/defaultCommands.tsx +229 -0
- package/src/extensions/SlashMenu/index.ts +11 -0
- package/src/extensions/TrailingNode/TrailingNodeExtension.ts +70 -0
- package/src/extensions/UniqueID/UniqueID.ts +281 -0
- package/src/extensions/helpers/formatKeyboardShortcut.ts +9 -0
- package/src/fonts-inter.css +94 -0
- package/src/globals.css +28 -0
- package/src/index.ts +5 -0
- package/src/lib/atlaskit/browser.ts +47 -0
- package/src/root.module.css +19 -0
- package/src/shared/components/toolbar/SimpleToolbarButton.module.css +13 -0
- package/src/shared/components/toolbar/SimpleToolbarButton.tsx +56 -0
- package/src/shared/components/toolbar/Toolbar.module.css +10 -0
- package/src/shared/components/toolbar/Toolbar.tsx +5 -0
- package/src/shared/components/toolbar/ToolbarSeparator.module.css +13 -0
- package/src/shared/components/toolbar/ToolbarSeparator.tsx +7 -0
- package/src/shared/components/tooltip/TooltipContent.module.css +15 -0
- package/src/shared/components/tooltip/TooltipContent.tsx +23 -0
- package/src/shared/hooks/useEditorForceUpdate.tsx +30 -0
- package/src/shared/plugins/suggestion/SuggestionItem.ts +31 -0
- package/src/shared/plugins/suggestion/SuggestionListReactRenderer.ts +227 -0
- package/src/shared/plugins/suggestion/SuggestionPlugin.ts +365 -0
- package/src/shared/plugins/suggestion/components/SuggestionGroup.module.css +45 -0
- package/src/shared/plugins/suggestion/components/SuggestionGroup.tsx +134 -0
- package/src/shared/plugins/suggestion/components/SuggestionList.module.css +10 -0
- package/src/shared/plugins/suggestion/components/SuggestionList.tsx +91 -0
- package/src/style.css +7 -0
- package/src/useEditor.ts +47 -0
- package/src/vite-env.d.ts +1 -0
- package/types/src/BlockNoteExtensions.d.ts +4 -0
- package/types/src/EditorContent.d.ts +1 -0
- package/types/src/extensions/Blocks/OrderedListPlugin.d.ts +2 -0
- package/types/src/extensions/Blocks/PreviousBlockTypePlugin.d.ts +13 -0
- package/types/src/extensions/Blocks/commands/joinBackward.d.ts +14 -0
- package/types/src/extensions/Blocks/helpers/findBlock.d.ts +6 -0
- package/types/src/extensions/Blocks/helpers/setBlockHeading.d.ts +5 -0
- package/types/src/extensions/Blocks/index.d.ts +1 -0
- package/types/src/extensions/Blocks/nodes/Block.d.ts +32 -0
- package/types/src/extensions/Blocks/nodes/BlockGroup.d.ts +2 -0
- package/types/src/extensions/Blocks/nodes/Content.d.ts +5 -0
- package/types/src/extensions/Blocks/rule.d.ts +16 -0
- package/types/src/extensions/BubbleMenu/BubbleMenuExtension.d.ts +5 -0
- package/types/src/extensions/BubbleMenu/BubbleMenuPlugin.d.ts +46 -0
- package/types/src/extensions/BubbleMenu/component/BubbleMenu.d.ts +5 -0
- package/types/src/extensions/BubbleMenu/component/DropdownBlockItem.d.ts +10 -0
- package/types/src/extensions/BubbleMenu/component/LinkToolbarButton.d.ts +11 -0
- package/types/src/extensions/DraggableBlocks/DraggableBlocksExtension.d.ts +7 -0
- package/types/src/extensions/DraggableBlocks/DraggableBlocksPlugin.d.ts +18 -0
- package/types/src/extensions/DraggableBlocks/components/DragHandle.d.ts +12 -0
- package/types/src/extensions/DraggableBlocks/components/DragHandleMenu.d.ts +6 -0
- package/types/src/extensions/Hyperlinks/HyperlinkMark.d.ts +7 -0
- package/types/src/extensions/Hyperlinks/HyperlinkMenuPlugin.d.ts +2 -0
- package/types/src/extensions/Hyperlinks/menus/HyperlinkBasicMenu.d.ts +12 -0
- package/types/src/extensions/Hyperlinks/menus/HyperlinkEditMenu.d.ts +10 -0
- package/types/src/extensions/Hyperlinks/menus/atlaskit/PanelTextInput.d.ts +39 -0
- package/types/src/extensions/Hyperlinks/menus/atlaskit/PanelTextInputStyles.d.ts +1 -0
- package/types/src/extensions/Hyperlinks/menus/atlaskit/ToolbarComponent.d.ts +11 -0
- package/types/src/extensions/Paragraph/FixedParagraph.d.ts +1 -0
- package/types/src/extensions/Placeholder/PlaceholderExtension.d.ts +25 -0
- package/types/src/extensions/SlashMenu/SlashMenuExtension.d.ts +10 -0
- package/types/src/extensions/SlashMenu/SlashMenuItem.d.ts +43 -0
- package/types/src/extensions/SlashMenu/defaultCommands.d.ts +8 -0
- package/types/src/extensions/SlashMenu/index.d.ts +5 -0
- package/types/src/extensions/TrailingNode/TrailingNodeExtension.d.ts +10 -0
- package/types/src/extensions/UniqueID/UniqueID.d.ts +3 -0
- package/types/src/extensions/helpers/formatKeyboardShortcut.d.ts +1 -0
- package/types/src/index.d.ts +4 -0
- package/types/src/lib/atlaskit/browser.d.ts +12 -0
- package/types/src/shared/components/toolbar/SimpleToolbarButton.d.ts +16 -0
- package/types/src/shared/components/toolbar/Toolbar.d.ts +4 -0
- package/types/src/shared/components/toolbar/ToolbarSeparator.d.ts +2 -0
- package/types/src/shared/components/tooltip/TooltipContent.d.ts +15 -0
- package/types/src/shared/hooks/useEditorForceUpdate.d.ts +2 -0
- package/types/src/shared/plugins/suggestion/SuggestionItem.d.ts +29 -0
- package/types/src/shared/plugins/suggestion/SuggestionListReactRenderer.d.ts +71 -0
- package/types/src/shared/plugins/suggestion/SuggestionPlugin.d.ts +74 -0
- package/types/src/shared/plugins/suggestion/components/SuggestionGroup.d.ts +23 -0
- package/types/src/shared/plugins/suggestion/components/SuggestionList.d.ts +26 -0
- package/types/src/useEditor.d.ts +8 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
(function(C,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("@tiptap/core"),require("@tiptap/extension-bold"),require("@tiptap/extension-code"),require("@tiptap/extension-dropcursor"),require("@tiptap/extension-gapcursor"),require("@tiptap/extension-hard-break"),require("@tiptap/extension-italic"),require("@tiptap/extension-underline"),require("@tiptap/extension-history"),require("@tiptap/extension-strike"),require("@tiptap/extension-text"),require("prosemirror-state"),require("prosemirror-model"),require("prosemirror-view"),require("react-dom"),require("react"),require("@atlaskit/button"),require("@tippyjs/react"),require("styled-components"),require("@atlaskit/dropdown-menu"),require("lodash"),require("@tiptap/react"),require("@atlaskit/menu"),require("@tiptap/extension-link"),require("@tiptap/extension-paragraph"),require("uuid")):typeof define=="function"&&define.amd?define(["exports","@tiptap/core","@tiptap/extension-bold","@tiptap/extension-code","@tiptap/extension-dropcursor","@tiptap/extension-gapcursor","@tiptap/extension-hard-break","@tiptap/extension-italic","@tiptap/extension-underline","@tiptap/extension-history","@tiptap/extension-strike","@tiptap/extension-text","prosemirror-state","prosemirror-model","prosemirror-view","react-dom","react","@atlaskit/button","@tippyjs/react","styled-components","@atlaskit/dropdown-menu","lodash","@tiptap/react","@atlaskit/menu","@tiptap/extension-link","@tiptap/extension-paragraph","uuid"],E):(C=typeof globalThis<"u"?globalThis:C||self,E(C.blocknote={},C.core,C.Bold,C.Code,C.DropCursor,C.GapCursor,C.HardBreak,C.Italic,C.Underline,C.extensionHistory,C.Strike,C.Text,C.prosemirrorState,C.prosemirrorModel,C.pv,C.ReactDOM,C.React,C.Button,C.Tippy,C.styled,C.DropdownMenu,C.lodash,C.react,C.menu,C.extensionLink,C.Paragraph,C.uuid))})(this,function(C,E,De,ri,ii,oi,ai,si,ci,li,ui,di,H,O,ye,fi,ne,pi,hi,Mn,Gt,Yt,Xt,Je,mi,vi,gi){"use strict";var Qs=Object.defineProperty;var ec=(C,E,De)=>E in C?Qs(C,E,{enumerable:!0,configurable:!0,writable:!0,value:De}):C[E]=De;var P=(C,E,De)=>(ec(C,typeof E!="symbol"?E+"":E,De),De);const q=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function yi(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const bi=q(De),wi=q(ri),Ei=q(ii),xi=q(oi),ki=q(ai),Ti=q(si),Ci=q(ci),Si=q(ui),Oi=q(di),Ai=yi(ye),Te=q(fi),M=q(ne),In=q(pi),He=q(hi),Ge=q(Mn),Ni=q(Gt),Ri=q(vi),tc="",Dn=65535,Hn=Math.pow(2,16);function Mi(e,t){return e+t*Hn}function Ln(e){return e&Dn}function Ii(e){return(e-(e&Dn))/Hn}const _n=1,Bn=2,At=4,Pn=8;class zn{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Pn)>0}get deletedBefore(){return(this.delInfo&(_n|At))>0}get deletedAfter(){return(this.delInfo&(Bn|At))>0}get deletedAcross(){return(this.delInfo&At)>0}}class se{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&se.empty)return se.empty}recover(t){let n=0,r=Ln(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+Ii(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?i:0);if(c>t)break;let d=this.ranges[a+o],u=this.ranges[a+s],f=c+d;if(t<=f){let v=d?t==c?-1:t==f?1:n:n,m=c+i+(v<0?0:u);if(r)return m;let y=t==(n<0?c:f)?null:Mi(a/3,t-c),h=t==c?Bn:t==f?_n:At;return(n<0?t!=c:t!=f)&&(h|=Pn),new zn(m,h,y)}i+=u-d}return r?t+i:new zn(t+i,0,null)}touches(t,n){let r=0,i=Ln(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?r:0);if(c>t)break;let d=this.ranges[a+o],u=c+d;if(t<=u&&a==i*3)return!0;r+=this.ranges[a+s]-d}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),c=s+(this.inverted?0:o),d=this.ranges[i+n],u=this.ranges[i+r];t(a,a+d,c,c+u),o+=u-d}}invert(){return new se(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?se.empty:new se(t<0?[0,-t,0]:[0,0,t])}}se.empty=new se([]);const Zt=Object.create(null);class Ce{getMap(){return se.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Zt[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Zt)throw new RangeError("Duplicate use of step JSON ID "+t);return Zt[t]=n,n.prototype.jsonID=t,n}}class Y{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Y(t,null)}static fail(t){return new Y(null,t)}static fromReplace(t,n,r,i){try{return Y.ok(t.replace(n,r,i))}catch(o){if(o instanceof O.ReplaceError)return Y.fail(o.message);throw o}}}function Qt(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(Qt(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return O.Fragment.fromArray(r)}class Le extends Ce{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new O.Slice(Qt(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Y.fromReplace(t,this.from,this.to,o)}invert(){return new _e(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Le(n.pos,r.pos,this.mark)}merge(t){return t instanceof Le&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Le(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Le(n.from,n.to,t.markFromJSON(n.mark))}}Ce.jsonID("addMark",Le);class _e extends Ce{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new O.Slice(Qt(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Y.fromReplace(t,this.from,this.to,r)}invert(){return new Le(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new _e(n.pos,r.pos,this.mark)}merge(t){return t instanceof _e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new _e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new _e(n.from,n.to,t.markFromJSON(n.mark))}}Ce.jsonID("removeMark",_e);class de extends Ce{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&en(t,this.from,this.to)?Y.fail("Structure replace would overwrite content"):Y.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new se([this.from,this.to-this.from,this.slice.size])}invert(t){return new de(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new de(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof de)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?O.Slice.empty:new O.Slice(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new de(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?O.Slice.empty:new O.Slice(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new de(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new de(n.from,n.to,O.Slice.fromJSON(t,n.slice),!!n.structure)}}Ce.jsonID("replace",de);class Se extends Ce{constructor(t,n,r,i,o,s,a=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(t){if(this.structure&&(en(t,this.from,this.gapFrom)||en(t,this.gapTo,this.to)))return Y.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Y.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Y.fromReplace(t,this.from,this.to,r):Y.fail("Content does not fit in gap")}getMap(){return new se([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Se(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Se(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Se(n.from,n.to,n.gapFrom,n.gapTo,O.Slice.fromJSON(t,n.slice),n.insert,!!n.structure)}}Ce.jsonID("replaceAround",Se);function en(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function Di(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Fn(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),s=e.$to.indexAfter(r);if(r<e.depth&&i.canReplace(o,s,n))return r;if(r==0||i.type.spec.isolating||!Di(i,o,s))break}return null}function Vn(e,t){let n=e.resolve(t),r=n.index();return Hi(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Hi(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function Li(e,t,n=t,r=O.Slice.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return _i(i,o,r)?new de(t,n,r):new Bi(i,o,r).fit()}function _i(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class Bi{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=O.Fragment.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=O.Fragment.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let c=new O.Slice(o,s,a);return t>-1?new Se(r.pos,t,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new de(r.pos,i.pos,c):null}findFittable(){for(let t=1;t<=2;t++)for(let n=this.unplaced.openStart;n>=0;n--){let r,i=null;n?(i=tn(this.unplaced.content,n-1).firstChild,r=i.content):r=this.unplaced.content;let o=r.firstChild;for(let s=this.depth;s>=0;s--){let{type:a,match:c}=this.frontier[s],d,u=null;if(t==1&&(o?c.matchType(o.type)||(u=c.fillBefore(O.Fragment.from(o),!1)):i&&a.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:s,parent:i,inject:u};if(t==2&&o&&(d=c.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:s,parent:i,wrap:d};if(i&&c.matchType(i.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=tn(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new O.Slice(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=tn(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new O.Slice(ut(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new O.Slice(ut(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let h=0;h<o.length;h++)this.openFrontierNode(o[h]);let s=this.unplaced,a=r?r.content:s.content,c=s.openStart-t,d=0,u=[],{match:f,type:v}=this.frontier[n];if(i){for(let h=0;h<i.childCount;h++)u.push(i.child(h));f=f.matchFragment(i)}let m=a.size+t-(s.content.size-s.openEnd);for(;d<a.childCount;){let h=a.child(d),w=f.matchType(h.type);if(!w)break;d++,(d>1||c==0||h.content.size)&&(f=w,u.push(jn(h.mark(v.allowedMarks(h.marks)),d==1?c:0,d==a.childCount?m:-1)))}let y=d==a.childCount;y||(m=-1),this.placed=dt(this.placed,n,O.Fragment.from(u)),this.frontier[n].match=f,y&&m<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let h=0,w=a;h<m;h++){let x=w.lastChild;this.frontier.push({type:x.type,match:x.contentMatchAt(x.childCount)}),w=x.content}this.unplaced=y?t==0?O.Slice.empty:new O.Slice(ut(s.content,t-1,1),t-1,m<0?s.openEnd:t-1):new O.Slice(ut(s.content,t,d),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!nn(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),s=nn(t,n,i,r,o);if(!!s){for(let a=n-1;a>=0;a--){let{match:c,type:d}=this.frontier[a],u=nn(t,a,d,c,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=dt(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,o)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=dt(this.placed,this.depth,O.Fragment.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(O.Fragment.empty,!0);n.childCount&&(this.placed=dt(this.placed,this.frontier.length,n))}}function ut(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(ut(e.firstChild.content,t-1,n)))}function dt(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(dt(e.lastChild.content,t-1,n)))}function tn(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function jn(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,jn(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(O.Fragment.empty,!0)))),e.copy(r)}function nn(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!Pi(n,o.content,s)?a:null}function Pi(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}let ft=class extends Error{};ft=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},ft.prototype=Object.create(Error.prototype),ft.prototype.constructor=ft,ft.prototype.name="TransformError";const zi=(e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;let i=Fi(r);if(!i){let s=r.blockRange(),a=s&&Fn(s);return a===null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Vi(e,i,t))return!0;if(r.parent.content.size===0&&(Nt(o,"end")||H.NodeSelection.isSelectable(o))){let s=Li(e.doc,r.before(),r.after(),O.Slice.empty);if(s&&s.slice.size<s.to-s.from){if(t){let a=e.tr.step(s);a.setSelection(Nt(o,"end")?H.Selection.findFrom(a.doc.resolve(a.mapping.map(i.pos,-1)),-1):H.NodeSelection.create(a.doc,i.pos-o.nodeSize)),t(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth===r.depth-1?(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1};function Fi(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Vi(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(ji(e,t,n))return!0;let a=t.parent.canReplace(t.index(),t.index()+1),c=H.Selection.findFrom(t,1),d=c&&c.$from.blockRange(c.$to),u=d&&Fn(d);if(u!=null&&u>=t.depth)return n&&n(e.tr.lift(d,u).scrollIntoView()),!0;if(a&&Nt(i,"start",!0)&&Nt(r,"end")){let f=r,v=[];for(;v.push(f),!f.isTextblock;)f=f.lastChild;let m=i,y=1;for(;!m.isTextblock;m=m.firstChild)y++;if(f.canReplace(f.childCount,f.childCount,m.content)){if(n){let h=O.Fragment.empty;for(let x=v.length-1;x>=0;x--)h=O.Fragment.from(v[x].copy(h));let w=e.tr.step(new Se(t.pos-v.length,t.pos+i.nodeSize,t.pos+y,t.pos+i.nodeSize-y,new O.Slice(h,v.length,0),0,!0));n(w.scrollIntoView())}return!0}}if(a&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let f=t.pos+i.nodeSize,v=O.Fragment.empty;for(let h=o.length-1;h>=0;h--)v=O.Fragment.from(o[h].create(null,v));v=O.Fragment.from(r.copy(v));let m=e.tr.step(new Se(t.pos-1,f,t.pos,f,new O.Slice(v,1,0),o.length,!0)),y=f+2*o.length;Vn(m.doc,y)&&m.join(y),n(m.scrollIntoView())}return!0}return!1}function Nt(e,t,n=!1){for(let r=e;r;r=t==="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!==1)return!1}return!1}function ji(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||Vn(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}const Be=E.findParentNode(e=>e.type.name==="tcblock");function qn(e,t,n){const r=Be(e.selection);return r?(t&&e.setNodeMarkup(r.pos,void 0,{...r.node.attrs,headingType:n}),!0):!1}const qi=new H.PluginKey("ordered-list"),Wi=()=>new H.Plugin({key:qi,appendTransaction:(e,t,n)=>{const r=n.tr;let i=!1,o=1,s=0;return n.doc.descendants((a,c)=>{a.type.name==="tcblock"&&!a.attrs.listType&&(o=1),s===0&&a.type.name==="tcblock"&&a.attrs.listType==="oli"?(s=a.content.childCount,a.content.child(0).attrs.position!==`${o}.`&&(r.setNodeMarkup(c+1,void 0,{...a.attrs,position:`${o}.`}),i=!0),o++):s>0&&s--}),i?r:null}}),Wn=new H.PluginKey("previous-blocks"),$i=()=>new H.Plugin({key:Wn,view(e){return{update:async(t,n)=>{var r;(r=this.key)!=null&&r.getState(t.state).needsUpdate&&setTimeout(()=>{t.dispatch(t.state.tr.setMeta(Wn,{clearUpdate:!0}))},0)}}},state:{init(){return{prevBlockAttrs:{},needsUpdate:!1}},apply(e,t,n,r){if(t.needsUpdate=!1,t.prevBlockAttrs={},!e.docChanged||n.doc.eq(r.doc))return t;const i=E.combineTransactionSteps(n.doc,[e]);return E.getChangedRanges(i).forEach(()=>{const s=E.findChildren(n.doc,d=>d.attrs.id),a=new Map(s.map(d=>[d.node.attrs.id,d])),c=E.findChildren(r.doc,d=>d.attrs.id);for(let d of c){const u=a.get(d.node.attrs.id);if(u){const f={listType:d.node.attrs.listType,blockColor:d.node.attrs.blockColor,blockStyle:d.node.attrs.blockStyle,headingType:d.node.attrs.headingType,depth:r.doc.resolve(d.pos).depth},v={listType:u.node.attrs.listType,blockColor:u.node.attrs.blockColor,blockStyle:u.node.attrs.blockStyle,headingType:u.node.attrs.headingType,depth:n.doc.resolve(u.pos).depth};JSON.stringify(v)!==JSON.stringify(f)&&(v.depthChange=v.depth-f.depth,t.prevBlockAttrs[d.node.attrs.id]=v,t.needsUpdate=!0)}}}),t}},props:{decorations(e){const t=this.getState(e);if(!t.needsUpdate)return;const n=[];return e.doc.descendants((r,i)=>{if(!r.attrs.id)return;const o=t.prevBlockAttrs[r.attrs.id];if(!o)return;const s={};for(let[c,d]of Object.entries(o))s["data-prev-"+c]=d||"none";const a=ye.Decoration.node(i,i+r.nodeSize,{...s});n.push(a)}),ye.DecorationSet.create(e.doc,n)}}});function rn(e){return new E.InputRule({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=E.callOrReturn(e.getAttributes,void 0,r)||{},s=i.node(-1);if(s.type!==e.type)return null;t.tr.setNodeMarkup(n.from-2,void 0,{...s.attrs,...o}).delete(n.from,n.to)}})}const Pe={blockOuter:"_blockOuter_4ownn_5",block:"_block_4ownn_5",blockContent:"_blockContent_4ownn_25",blockGroup:"_blockGroup_4ownn_35",isEmpty:"_isEmpty_4ownn_198",isFilter:"_isFilter_4ownn_199",hasAnchor:"_hasAnchor_4ownn_212"},Ui=E.Node.create({name:"tcblock",group:"block",addOptions(){return{HTMLAttributes:{}}},content:"tccontent blockgroup?",defining:!0,addAttributes(){return{listType:{default:void 0,renderHTML:e=>({"data-listType":e.listType}),parseHTML:e=>e.getAttribute("data-listType")},blockColor:{default:void 0,renderHTML:e=>({"data-blockColor":e.blockColor}),parseHTML:e=>e.getAttribute("data-blockColor")},blockStyle:{default:void 0,renderHTML:e=>({"data-blockStyle":e.blockStyle}),parseHTML:e=>e.getAttribute("data-blockStyle")},headingType:{default:void 0,keepOnSplit:!1,renderHTML:e=>({"data-headingType":e.headingType}),parseHTML:e=>e.getAttribute("data-headingType")}}},parseHTML(){return[{tag:"div"}]},renderHTML({HTMLAttributes:e}){return["div",E.mergeAttributes(this.options.HTMLAttributes,e,{class:Pe.blockOuter}),["div",E.mergeAttributes(this.options.HTMLAttributes,e,{class:Pe.block}),0]]},addInputRules(){return[...[1,2,3].map(e=>rn({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{headingType:e}})),rn({find:/^\s*([-+*])\s$/,type:this.type,getAttributes:{listType:"li"}}),rn({find:new RegExp(/^1.\s/),type:this.type,getAttributes:{listType:"oli"}})]},addCommands(){return{setBlockHeading:e=>({tr:t,dispatch:n})=>qn(t,n,e.level),unsetBlockHeading:()=>({tr:e,dispatch:t})=>qn(e,t,void 0),unsetList:()=>({tr:e,dispatch:t})=>{const n=e.selection.$anchor.node(-1),r=e.selection.$anchor.posAtIndex(0,-1)-1;return n.type.name==="tcblock"&&n.attrs.listType&&t?(e.setNodeMarkup(r,void 0,{...n.attrs,listType:void 0}),!0):!1},addNewBlockAsSibling:e=>({tr:t,dispatch:n,state:r})=>{var a;const i=Be(t.selection);if(!i)return!1;if(((a=i.node.firstChild)==null?void 0:a.textContent.length)===0)return n&&t.setNodeMarkup(i.pos,void 0,e),!0;const o=i.pos+i.node.nodeSize;let s=r.schema.nodes.tcblock.createAndFill(e);return n&&(t.insert(o,s),t.setSelection(new H.TextSelection(t.doc.resolve(o+1)))),!0},setBlockList:e=>({tr:t,dispatch:n})=>{const r=t.selection.$anchor.node(-1),i=t.selection.$anchor.posAtIndex(0,-1)-1;return r.type.name==="tcblock"?(n&&t.setNodeMarkup(i,void 0,{...r.attrs,listType:e}),!0):!1},joinBackward:()=>({view:e,dispatch:t,state:n})=>zi(n,t,e)}},addProseMirrorPlugins(){return[$i(),Wi()]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.first(({commands:n})=>[()=>n.undoInputRule(),()=>n.command(({tr:r})=>{const{selection:i,doc:o}=r,{empty:s,$anchor:a}=i,{pos:c,parent:d}=a,u=H.Selection.atStart(o).from===c;return!s||!u||!d.type.isTextblock||d.textContent.length?!1:n.clearNodes()}),()=>n.deleteSelection(),()=>n.command(({tr:r})=>{const i=r.selection.$anchor.parentOffset===0,o=r.selection.$anchor.node(-1);return i&&o.type.name==="tcblock"?n.first([()=>n.unsetList(),()=>n.liftListItem("tcblock")]):!1}),({chain:r})=>r().command(({tr:i,state:o,dispatch:s})=>{const a=i.selection.$anchor.parentOffset===0,c=i.selection.$anchor,d=c.node(-1);if(a&&d.type.name==="tcblock"){if(d.childCount===2){const u=c.posAtIndex(1,-1)+1,f=c.posAtIndex(2,-1)-1,v=o.doc.resolve(u).blockRange(o.doc.resolve(f));s&&i.lift(v,c.depth-2)}return!0}return!1}).joinBackward().run(),()=>n.selectNodeBackward()]),Enter:()=>this.editor.commands.first(({commands:n})=>[()=>n.splitListItem("tcblock"),({tr:r,dispatch:i})=>{if(r.selection.$from.depth!==3)return!1;const s=r.selection.$anchor.node(-1),a=r.selection.$anchor.posAtIndex(0,-1)-1;return s.type.name==="tcblock"&&s.attrs.listType?(i&&r.setNodeMarkup(a,void 0,{...s.attrs,listType:void 0}),!0):!1},({tr:r,dispatch:i})=>{const o=r.selection.$from;return i&&r.split(o.pos,2).scrollIntoView(),!0}]),Tab:()=>this.editor.commands.sinkListItem("tcblock"),"Shift-Tab":()=>this.editor.commands.liftListItem("tcblock"),"Mod-Alt-0":()=>this.editor.chain().unsetList().unsetBlockHeading().run(),"Mod-Alt-1":()=>this.editor.commands.setBlockHeading({level:1}),"Mod-Alt-2":()=>this.editor.commands.setBlockHeading({level:2}),"Mod-Alt-3":()=>this.editor.commands.setBlockHeading({level:3}),"Mod-Shift-7":()=>this.editor.commands.setBlockList("li"),"Mod-Shift-8":()=>this.editor.commands.setBlockList("oli")}}}),Ki=E.Node.create({name:"blockgroup",addOptions(){return{HTMLAttributes:{}}},content:"tcblock+",parseHTML(){return[{tag:"div"}]},renderHTML({HTMLAttributes:e}){return["div",E.mergeAttributes(this.options.HTMLAttributes,e,{class:Pe.blockGroup}),0]}}),Ji=[E.Node.create({name:"tccontent",addOptions(){return{HTMLAttributes:{}}},addAttributes(){return{position:{default:void 0,renderHTML:e=>({"data-position":e.position}),parseHTML:e=>e.getAttribute("data-position")}}},content:"inline*",parseHTML(){return[{tag:"div"}]},renderHTML({HTMLAttributes:e}){return["div",E.mergeAttributes(this.options.HTMLAttributes,e,{class:Pe.blockContent}),["div",0]]}}),Ui,Ki,E.Node.create({name:"doc",topNode:!0,content:"blockgroup"})];var J="top",re="bottom",ie="right",G="left",Rt="auto",pt=[J,re,ie,G],Ye="start",ht="end",Gi="clippingParents",$n="viewport",mt="popper",Yi="reference",Un=pt.reduce(function(e,t){return e.concat([t+"-"+Ye,t+"-"+ht])},[]),Kn=[].concat(pt,[Rt]).reduce(function(e,t){return e.concat([t,t+"-"+Ye,t+"-"+ht])},[]),Xi="beforeRead",Zi="read",Qi="afterRead",eo="beforeMain",to="main",no="afterMain",ro="beforeWrite",io="write",oo="afterWrite",on=[Xi,Zi,Qi,eo,to,no,ro,io,oo];function fe(e){return e?(e.nodeName||"").toLowerCase():null}function oe(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function ze(e){var t=oe(e).Element;return e instanceof t||e instanceof Element}function X(e){var t=oe(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function an(e){if(typeof ShadowRoot>"u")return!1;var t=oe(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function ao(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!X(o)||!fe(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function so(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),a=s.reduce(function(c,d){return c[d]="",c},{});!X(i)||!fe(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}const Jn={name:"applyStyles",enabled:!0,phase:"write",fn:ao,effect:so,requires:["computeStyles"]};function ce(e){return e.split("-")[0]}var Fe=Math.max,Mt=Math.min,Xe=Math.round;function sn(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Gn(){return!/^((?!chrome|android).)*safari/i.test(sn())}function Ze(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&X(e)&&(i=e.offsetWidth>0&&Xe(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Xe(r.height)/e.offsetHeight||1);var s=ze(e)?oe(e):window,a=s.visualViewport,c=!Gn()&&n,d=(r.left+(c&&a?a.offsetLeft:0))/i,u=(r.top+(c&&a?a.offsetTop:0))/o,f=r.width/i,v=r.height/o;return{width:f,height:v,top:u,right:d+f,bottom:u+v,left:d,x:d,y:u}}function cn(e){var t=Ze(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Yn(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&an(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function le(e){return oe(e).getComputedStyle(e)}function co(e){return["table","td","th"].indexOf(fe(e))>=0}function Oe(e){return((ze(e)?e.ownerDocument:e.document)||window.document).documentElement}function It(e){return fe(e)==="html"?e:e.assignedSlot||e.parentNode||(an(e)?e.host:null)||Oe(e)}function Xn(e){return!X(e)||le(e).position==="fixed"?null:e.offsetParent}function lo(e){var t=/firefox/i.test(sn()),n=/Trident/i.test(sn());if(n&&X(e)){var r=le(e);if(r.position==="fixed")return null}var i=It(e);for(an(i)&&(i=i.host);X(i)&&["html","body"].indexOf(fe(i))<0;){var o=le(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function vt(e){for(var t=oe(e),n=Xn(e);n&&co(n)&&le(n).position==="static";)n=Xn(n);return n&&(fe(n)==="html"||fe(n)==="body"&&le(n).position==="static")?t:n||lo(e)||t}function ln(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function gt(e,t,n){return Fe(e,Mt(t,n))}function uo(e,t,n){var r=gt(e,t,n);return r>n?n:r}function Zn(){return{top:0,right:0,bottom:0,left:0}}function Qn(e){return Object.assign({},Zn(),e)}function er(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var fo=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Qn(typeof t!="number"?t:er(t,pt))};function po(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=ce(n.placement),c=ln(a),d=[G,ie].indexOf(a)>=0,u=d?"height":"width";if(!(!o||!s)){var f=fo(i.padding,n),v=cn(o),m=c==="y"?J:G,y=c==="y"?re:ie,h=n.rects.reference[u]+n.rects.reference[c]-s[c]-n.rects.popper[u],w=s[c]-n.rects.reference[c],x=vt(o),S=x?c==="y"?x.clientHeight||0:x.clientWidth||0:0,A=h/2-w/2,l=f[m],k=S-v[u]-f[y],g=S/2-v[u]/2+A,N=gt(l,g,k),z=c;n.modifiersData[r]=(t={},t[z]=N,t.centerOffset=N-g,t)}}function ho(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;if(i!=null&&!(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i))){if(process.env.NODE_ENV!=="production"&&(X(i)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" "))),!Yn(t.elements.popper,i)){process.env.NODE_ENV!=="production"&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" "));return}t.elements.arrow=i}}const mo={name:"arrow",enabled:!0,phase:"main",fn:po,effect:ho,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Qe(e){return e.split("-")[1]}var vo={top:"auto",right:"auto",bottom:"auto",left:"auto"};function go(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:Xe(t*i)/i||0,y:Xe(n*i)/i||0}}function tr(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,c=e.gpuAcceleration,d=e.adaptive,u=e.roundOffsets,f=e.isFixed,v=s.x,m=v===void 0?0:v,y=s.y,h=y===void 0?0:y,w=typeof u=="function"?u({x:m,y:h}):{x:m,y:h};m=w.x,h=w.y;var x=s.hasOwnProperty("x"),S=s.hasOwnProperty("y"),A=G,l=J,k=window;if(d){var g=vt(n),N="clientHeight",z="clientWidth";if(g===oe(n)&&(g=Oe(n),le(g).position!=="static"&&a==="absolute"&&(N="scrollHeight",z="scrollWidth")),g=g,i===J||(i===G||i===ie)&&o===ht){l=re;var F=f&&g===k&&k.visualViewport?k.visualViewport.height:g[N];h-=F-r.height,h*=c?1:-1}if(i===G||(i===J||i===re)&&o===ht){A=ie;var _=f&&g===k&&k.visualViewport?k.visualViewport.width:g[z];m-=_-r.width,m*=c?1:-1}}var I=Object.assign({position:a},d&&vo),L=u===!0?go({x:m,y:h}):{x:m,y:h};if(m=L.x,h=L.y,c){var B;return Object.assign({},I,(B={},B[l]=S?"0":"",B[A]=x?"0":"",B.transform=(k.devicePixelRatio||1)<=1?"translate("+m+"px, "+h+"px)":"translate3d("+m+"px, "+h+"px, 0)",B))}return Object.assign({},I,(t={},t[l]=S?h+"px":"",t[A]=x?m+"px":"",t.transform="",t))}function yo(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,c=a===void 0?!0:a;if(process.env.NODE_ENV!=="production"){var d=le(t.elements.popper).transitionProperty||"";s&&["transform","top","right","bottom","left"].some(function(f){return d.indexOf(f)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',`
|
|
2
|
+
|
|
3
|
+
`,'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.",`
|
|
4
|
+
|
|
5
|
+
`,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var u={placement:ce(t.placement),variation:Qe(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,tr(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,tr(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const bo={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:yo,data:{}};var Dt={passive:!0};function wo(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,c=oe(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",n.update,Dt)}),a&&c.addEventListener("resize",n.update,Dt),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",n.update,Dt)}),a&&c.removeEventListener("resize",n.update,Dt)}}const Eo={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:wo,data:{}};var xo={left:"right",right:"left",bottom:"top",top:"bottom"};function Ht(e){return e.replace(/left|right|bottom|top/g,function(t){return xo[t]})}var ko={start:"end",end:"start"};function nr(e){return e.replace(/start|end/g,function(t){return ko[t]})}function un(e){var t=oe(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function dn(e){return Ze(Oe(e)).left+un(e).scrollLeft}function To(e,t){var n=oe(e),r=Oe(e),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,c=0;if(i){o=i.width,s=i.height;var d=Gn();(d||!d&&t==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:a+dn(e),y:c}}function Co(e){var t,n=Oe(e),r=un(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=Fe(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Fe(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+dn(e),c=-r.scrollTop;return le(i||n).direction==="rtl"&&(a+=Fe(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:c}}function fn(e){var t=le(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function rr(e){return["html","body","#document"].indexOf(fe(e))>=0?e.ownerDocument.body:X(e)&&fn(e)?e:rr(It(e))}function yt(e,t){var n;t===void 0&&(t=[]);var r=rr(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=oe(r),s=i?[o].concat(o.visualViewport||[],fn(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(yt(It(s)))}function pn(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function So(e,t){var n=Ze(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function ir(e,t,n){return t===$n?pn(To(e,n)):ze(t)?So(t,n):pn(Co(Oe(e)))}function Oo(e){var t=yt(It(e)),n=["absolute","fixed"].indexOf(le(e).position)>=0,r=n&&X(e)?vt(e):e;return ze(r)?t.filter(function(i){return ze(i)&&Yn(i,r)&&fe(i)!=="body"}):[]}function Ao(e,t,n,r){var i=t==="clippingParents"?Oo(e):[].concat(t),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(c,d){var u=ir(e,d,r);return c.top=Fe(u.top,c.top),c.right=Mt(u.right,c.right),c.bottom=Mt(u.bottom,c.bottom),c.left=Fe(u.left,c.left),c},ir(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function or(e){var t=e.reference,n=e.element,r=e.placement,i=r?ce(r):null,o=r?Qe(r):null,s=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,c;switch(i){case J:c={x:s,y:t.y-n.height};break;case re:c={x:s,y:t.y+t.height};break;case ie:c={x:t.x+t.width,y:a};break;case G:c={x:t.x-n.width,y:a};break;default:c={x:t.x,y:t.y}}var d=i?ln(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(o){case Ye:c[d]=c[d]-(t[u]/2-n[u]/2);break;case ht:c[d]=c[d]+(t[u]/2-n[u]/2);break}}return c}function bt(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,s=o===void 0?e.strategy:o,a=n.boundary,c=a===void 0?Gi:a,d=n.rootBoundary,u=d===void 0?$n:d,f=n.elementContext,v=f===void 0?mt:f,m=n.altBoundary,y=m===void 0?!1:m,h=n.padding,w=h===void 0?0:h,x=Qn(typeof w!="number"?w:er(w,pt)),S=v===mt?Yi:mt,A=e.rects.popper,l=e.elements[y?S:v],k=Ao(ze(l)?l:l.contextElement||Oe(e.elements.popper),c,u,s),g=Ze(e.elements.reference),N=or({reference:g,element:A,strategy:"absolute",placement:i}),z=pn(Object.assign({},A,N)),F=v===mt?z:g,_={top:k.top-F.top+x.top,bottom:F.bottom-k.bottom+x.bottom,left:k.left-F.left+x.left,right:F.right-k.right+x.right},I=e.modifiersData.offset;if(v===mt&&I){var L=I[i];Object.keys(_).forEach(function(B){var ee=[ie,re].indexOf(B)>=0?1:-1,te=[J,re].indexOf(B)>=0?"y":"x";_[B]+=L[te]*ee})}return _}function No(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,c=n.allowedAutoPlacements,d=c===void 0?Kn:c,u=Qe(r),f=u?a?Un:Un.filter(function(y){return Qe(y)===u}):pt,v=f.filter(function(y){return d.indexOf(y)>=0});v.length===0&&(v=f,process.env.NODE_ENV!=="production"&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var m=v.reduce(function(y,h){return y[h]=bt(e,{placement:h,boundary:i,rootBoundary:o,padding:s})[ce(h)],y},{});return Object.keys(m).sort(function(y,h){return m[y]-m[h]})}function Ro(e){if(ce(e)===Rt)return[];var t=Ht(e);return[nr(e),t,nr(t)]}function Mo(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,c=n.fallbackPlacements,d=n.padding,u=n.boundary,f=n.rootBoundary,v=n.altBoundary,m=n.flipVariations,y=m===void 0?!0:m,h=n.allowedAutoPlacements,w=t.options.placement,x=ce(w),S=x===w,A=c||(S||!y?[Ht(w)]:Ro(w)),l=[w].concat(A).reduce(function(we,ue){return we.concat(ce(ue)===Rt?No(t,{placement:ue,boundary:u,rootBoundary:f,padding:d,flipVariations:y,allowedAutoPlacements:h}):ue)},[]),k=t.rects.reference,g=t.rects.popper,N=new Map,z=!0,F=l[0],_=0;_<l.length;_++){var I=l[_],L=ce(I),B=Qe(I)===Ye,ee=[J,re].indexOf(L)>=0,te=ee?"width":"height",W=bt(t,{placement:I,boundary:u,rootBoundary:f,altBoundary:v,padding:d}),$=ee?B?ie:G:B?re:J;k[te]>g[te]&&($=Ht($));var j=Ht($),me=[];if(o&&me.push(W[L]<=0),a&&me.push(W[$]<=0,W[j]<=0),me.every(function(we){return we})){F=I,z=!1;break}N.set(I,me)}if(z)for(var ve=y?3:1,We=function(ue){var Ee=l.find(function(ot){var xe=N.get(ot);if(xe)return xe.slice(0,ue).every(function(at){return at})});if(Ee)return F=Ee,"break"},ge=ve;ge>0;ge--){var $e=We(ge);if($e==="break")break}t.placement!==F&&(t.modifiersData[r]._skip=!0,t.placement=F,t.reset=!0)}}const Io={name:"flip",enabled:!0,phase:"main",fn:Mo,requiresIfExists:["offset"],data:{_skip:!1}};function ar(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function sr(e){return[J,ie,re,G].some(function(t){return e[t]>=0})}function Do(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=bt(t,{elementContext:"reference"}),a=bt(t,{altBoundary:!0}),c=ar(s,r),d=ar(a,i,o),u=sr(c),f=sr(d);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const Ho={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Do};function Lo(e,t,n){var r=ce(e),i=[G,J].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[G,ie].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function _o(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,s=Kn.reduce(function(u,f){return u[f]=Lo(f,t.rects,o),u},{}),a=s[t.placement],c=a.x,d=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=d),t.modifiersData[r]=s}const Bo={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:_o};function Po(e){var t=e.state,n=e.name;t.modifiersData[n]=or({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const zo={name:"popperOffsets",enabled:!0,phase:"read",fn:Po,data:{}};function Fo(e){return e==="x"?"y":"x"}function Vo(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,c=n.boundary,d=n.rootBoundary,u=n.altBoundary,f=n.padding,v=n.tether,m=v===void 0?!0:v,y=n.tetherOffset,h=y===void 0?0:y,w=bt(t,{boundary:c,rootBoundary:d,padding:f,altBoundary:u}),x=ce(t.placement),S=Qe(t.placement),A=!S,l=ln(x),k=Fo(l),g=t.modifiersData.popperOffsets,N=t.rects.reference,z=t.rects.popper,F=typeof h=="function"?h(Object.assign({},t.rects,{placement:t.placement})):h,_=typeof F=="number"?{mainAxis:F,altAxis:F}:Object.assign({mainAxis:0,altAxis:0},F),I=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,L={x:0,y:0};if(!!g){if(o){var B,ee=l==="y"?J:G,te=l==="y"?re:ie,W=l==="y"?"height":"width",$=g[l],j=$+w[ee],me=$-w[te],ve=m?-z[W]/2:0,We=S===Ye?N[W]:z[W],ge=S===Ye?-z[W]:-N[W],$e=t.elements.arrow,we=m&&$e?cn($e):{width:0,height:0},ue=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Zn(),Ee=ue[ee],ot=ue[te],xe=gt(0,N[W],we[W]),at=A?N[W]/2-ve-xe-Ee-_.mainAxis:We-xe-Ee-_.mainAxis,Me=A?-N[W]/2+ve+xe+ot+_.mainAxis:ge+xe+ot+_.mainAxis,st=t.elements.arrow&&vt(t.elements.arrow),Pt=st?l==="y"?st.clientTop||0:st.clientLeft||0:0,kt=(B=I==null?void 0:I[l])!=null?B:0,zt=$+at-kt-Pt,Ft=$+Me-kt,Tt=gt(m?Mt(j,zt):j,$,m?Fe(me,Ft):me);g[l]=Tt,L[l]=Tt-$}if(a){var Ct,Vt=l==="x"?J:G,jt=l==="x"?re:ie,ke=g[k],Ie=k==="y"?"height":"width",St=ke+w[Vt],Ue=ke-w[jt],Ot=[J,G].indexOf(x)!==-1,qt=(Ct=I==null?void 0:I[k])!=null?Ct:0,Wt=Ot?St:ke-N[Ie]-z[Ie]-qt+_.altAxis,$t=Ot?ke+N[Ie]+z[Ie]-qt-_.altAxis:Ue,Ut=m&&Ot?uo(Wt,ke,$t):gt(m?Wt:St,ke,m?$t:Ue);g[k]=Ut,L[k]=Ut-ke}t.modifiersData[r]=L}}const jo={name:"preventOverflow",enabled:!0,phase:"main",fn:Vo,requiresIfExists:["offset"]};function qo(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Wo(e){return e===oe(e)||!X(e)?un(e):qo(e)}function $o(e){var t=e.getBoundingClientRect(),n=Xe(t.width)/e.offsetWidth||1,r=Xe(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Uo(e,t,n){n===void 0&&(n=!1);var r=X(t),i=X(t)&&$o(t),o=Oe(t),s=Ze(e,i,n),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((fe(t)!=="body"||fn(o))&&(a=Wo(t)),X(t)?(c=Ze(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=dn(o))),{x:s.left+a.scrollLeft-c.x,y:s.top+a.scrollTop-c.y,width:s.width,height:s.height}}function Ko(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var c=t.get(a);c&&i(c)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function Jo(e){var t=Ko(e);return on.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function Go(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Ae(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return[].concat(n).reduce(function(i,o){return i.replace(/%s/,o)},e)}var Ve='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',Yo='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',cr=["name","enabled","phase","fn","effect","requires","options"];function Xo(e){e.forEach(function(t){[].concat(Object.keys(t),cr).filter(function(n,r,i){return i.indexOf(n)===r}).forEach(function(n){switch(n){case"name":typeof t.name!="string"&&console.error(Ae(Ve,String(t.name),'"name"','"string"','"'+String(t.name)+'"'));break;case"enabled":typeof t.enabled!="boolean"&&console.error(Ae(Ve,t.name,'"enabled"','"boolean"','"'+String(t.enabled)+'"'));break;case"phase":on.indexOf(t.phase)<0&&console.error(Ae(Ve,t.name,'"phase"',"either "+on.join(", "),'"'+String(t.phase)+'"'));break;case"fn":typeof t.fn!="function"&&console.error(Ae(Ve,t.name,'"fn"','"function"','"'+String(t.fn)+'"'));break;case"effect":t.effect!=null&&typeof t.effect!="function"&&console.error(Ae(Ve,t.name,'"effect"','"function"','"'+String(t.fn)+'"'));break;case"requires":t.requires!=null&&!Array.isArray(t.requires)&&console.error(Ae(Ve,t.name,'"requires"','"array"','"'+String(t.requires)+'"'));break;case"requiresIfExists":Array.isArray(t.requiresIfExists)||console.error(Ae(Ve,t.name,'"requiresIfExists"','"array"','"'+String(t.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+t.name+'" modifier, valid properties are '+cr.map(function(r){return'"'+r+'"'}).join(", ")+'; but "'+n+'" was provided.')}t.requires&&t.requires.forEach(function(r){e.find(function(i){return i.name===r})==null&&console.error(Ae(Yo,String(t.name),r,r))})})})}function Zo(e,t){var n=new Set;return e.filter(function(r){var i=t(r);if(!n.has(i))return n.add(i),!0})}function Qo(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var lr="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",ea="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",ur={placement:"bottom",modifiers:[],strategy:"absolute"};function dr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function ta(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?ur:i;return function(a,c,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},ur,o),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},f=[],v=!1,m={state:u,setOptions:function(x){var S=typeof x=="function"?x(u.options):x;h(),u.options=Object.assign({},o,u.options,S),u.scrollParents={reference:ze(a)?yt(a):a.contextElement?yt(a.contextElement):[],popper:yt(c)};var A=Jo(Qo([].concat(r,u.options.modifiers)));if(u.orderedModifiers=A.filter(function(I){return I.enabled}),process.env.NODE_ENV!=="production"){var l=Zo([].concat(A,u.options.modifiers),function(I){var L=I.name;return L});if(Xo(l),ce(u.options.placement)===Rt){var k=u.orderedModifiers.find(function(I){var L=I.name;return L==="flip"});k||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" "))}var g=le(c),N=g.marginTop,z=g.marginRight,F=g.marginBottom,_=g.marginLeft;[N,z,F,_].some(function(I){return parseFloat(I)})&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" "))}return y(),m.update()},forceUpdate:function(){if(!v){var x=u.elements,S=x.reference,A=x.popper;if(!dr(S,A)){process.env.NODE_ENV!=="production"&&console.error(lr);return}u.rects={reference:Uo(S,vt(A),u.options.strategy==="fixed"),popper:cn(A)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(I){return u.modifiersData[I.name]=Object.assign({},I.data)});for(var l=0,k=0;k<u.orderedModifiers.length;k++){if(process.env.NODE_ENV!=="production"&&(l+=1,l>100)){console.error(ea);break}if(u.reset===!0){u.reset=!1,k=-1;continue}var g=u.orderedModifiers[k],N=g.fn,z=g.options,F=z===void 0?{}:z,_=g.name;typeof N=="function"&&(u=N({state:u,options:F,name:_,instance:m})||u)}}},update:Go(function(){return new Promise(function(w){m.forceUpdate(),w(u)})}),destroy:function(){h(),v=!0}};if(!dr(a,c))return process.env.NODE_ENV!=="production"&&console.error(lr),m;m.setOptions(d).then(function(w){!v&&d.onFirstUpdate&&d.onFirstUpdate(w)});function y(){u.orderedModifiers.forEach(function(w){var x=w.name,S=w.options,A=S===void 0?{}:S,l=w.effect;if(typeof l=="function"){var k=l({state:u,name:x,instance:m,options:A}),g=function(){};f.push(k||g)}})}function h(){f.forEach(function(w){return w()}),f=[]}return m}}var na=[Eo,zo,bo,Jn,Bo,Io,jo,mo,Ho],ra=ta({defaultModifiers:na}),ia="tippy-box",fr="tippy-content",oa="tippy-backdrop",pr="tippy-arrow",hr="tippy-svg-arrow",je={passive:!0,capture:!0},mr=function(){return document.body};function aa(e,t){return{}.hasOwnProperty.call(e,t)}function hn(e,t,n){if(Array.isArray(e)){var r=e[t];return r==null?Array.isArray(n)?n[t]:n:r}return e}function mn(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function vr(e,t){return typeof e=="function"?e.apply(void 0,t):e}function gr(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function sa(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function ca(e){return e.split(/\s+/).filter(Boolean)}function et(e){return[].concat(e)}function yr(e,t){e.indexOf(t)===-1&&e.push(t)}function la(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function ua(e){return e.split("-")[0]}function Lt(e){return[].slice.call(e)}function br(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function wt(){return document.createElement("div")}function Et(e){return["Element","Fragment"].some(function(t){return mn(e,t)})}function da(e){return mn(e,"NodeList")}function fa(e){return mn(e,"MouseEvent")}function pa(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function ha(e){return Et(e)?[e]:da(e)?Lt(e):Array.isArray(e)?e:Lt(document.querySelectorAll(e))}function vn(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function wr(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function ma(e){var t,n=et(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function va(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,s=i.popperState,a=i.props,c=a.interactiveBorder,d=ua(s.placement),u=s.modifiersData.offset;if(!u)return!0;var f=d==="bottom"?u.top.y:0,v=d==="top"?u.bottom.y:0,m=d==="right"?u.left.x:0,y=d==="left"?u.right.x:0,h=o.top-r+f>c,w=r-o.bottom-v>c,x=o.left-n+m>c,S=n-o.right-y>c;return h||w||x||S})}function gn(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function Er(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var pe={isTouch:!1},xr=0;function ga(){pe.isTouch||(pe.isTouch=!0,window.performance&&document.addEventListener("mousemove",kr))}function kr(){var e=performance.now();e-xr<20&&(pe.isTouch=!1,document.removeEventListener("mousemove",kr)),xr=e}function ya(){var e=document.activeElement;if(pa(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function ba(){document.addEventListener("touchstart",ga,je),window.addEventListener("blur",ya)}var wa=typeof window<"u"&&typeof document<"u",Ea=wa?!!window.msCrypto:!1;function tt(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Tr(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function xa(e){return Tr(`
|
|
6
|
+
%ctippy.js
|
|
7
|
+
|
|
8
|
+
%c`+Tr(e)+`
|
|
9
|
+
|
|
10
|
+
%c\u{1F477}\u200D This is a development-only message. It will be removed in production.
|
|
11
|
+
`)}function Cr(e){return[xa(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var xt;process.env.NODE_ENV!=="production"&&ka();function ka(){xt=new Set}function be(e,t){if(e&&!xt.has(t)){var n;xt.add(t),(n=console).warn.apply(n,Cr(t))}}function yn(e,t){if(e&&!xt.has(t)){var n;xt.add(t),(n=console).error.apply(n,Cr(t))}}function Ta(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;yn(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),yn(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var Sr={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Ca={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Z=Object.assign({appendTo:mr,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Sr,Ca),Sa=Object.keys(Z),Oa=function(t){process.env.NODE_ENV!=="production"&&Nr(t,[]);var n=Object.keys(t);n.forEach(function(r){Z[r]=t[r]})};function Or(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var a;r[o]=e[o]!==void 0?e[o]:(a=Z[o])!=null?a:s}return r},{});return Object.assign({},e,n)}function Aa(e,t){var n=t?Object.keys(Or(Object.assign({},Z,{plugins:t}))):Sa,r=n.reduce(function(i,o){var s=(e.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function Ar(e,t){var n=Object.assign({},t,{content:vr(t.content,[e])},t.ignoreAttributes?{}:Aa(e,t.plugins));return n.aria=Object.assign({},Z.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}function Nr(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var i=sa(Z,Object.keys(Sr)),o=!aa(i,r);o&&(o=t.filter(function(s){return s.name===r}).length===0),be(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
|
|
12
|
+
|
|
13
|
+
`,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
|
|
14
|
+
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var Na=function(){return"innerHTML"};function bn(e,t){e[Na()]=t}function Rr(e){var t=wt();return e===!0?t.className=pr:(t.className=hr,Et(e)?t.appendChild(e):bn(t,e)),t}function Mr(e,t){Et(t.content)?(bn(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?bn(e,t.content):e.textContent=t.content)}function wn(e){var t=e.firstElementChild,n=Lt(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(fr)}),arrow:n.find(function(r){return r.classList.contains(pr)||r.classList.contains(hr)}),backdrop:n.find(function(r){return r.classList.contains(oa)})}}function Ir(e){var t=wt(),n=wt();n.className=ia,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=wt();r.className=fr,r.setAttribute("data-state","hidden"),Mr(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,s){var a=wn(t),c=a.box,d=a.content,u=a.arrow;s.theme?c.setAttribute("data-theme",s.theme):c.removeAttribute("data-theme"),typeof s.animation=="string"?c.setAttribute("data-animation",s.animation):c.removeAttribute("data-animation"),s.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?c.setAttribute("role",s.role):c.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&Mr(d,e.props),s.arrow?u?o.arrow!==s.arrow&&(c.removeChild(u),c.appendChild(Rr(s.arrow))):c.appendChild(Rr(s.arrow)):u&&c.removeChild(u)}return{popper:t,onUpdate:i}}Ir.$$tippy=!0;var Ra=1,_t=[],En=[];function Ma(e,t){var n=Ar(e,Object.assign({},Z,Or(br(t)))),r,i,o,s=!1,a=!1,c=!1,d=!1,u,f,v,m=[],y=gr(zt,n.interactiveDebounce),h,w=Ra++,x=null,S=la(n.plugins),A={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},l={id:w,reference:e,popper:wt(),popperInstance:x,props:n,state:A,plugins:S,clearDelayTimeouts:Wt,setProps:$t,setContent:Ut,show:Ks,hide:Js,hideWithInteractivity:Gs,enable:Ot,disable:qt,unmount:Ys,destroy:Xs};if(!n.render)return process.env.NODE_ENV!=="production"&&yn(!0,"render() function has not been supplied."),l;var k=n.render(l),g=k.popper,N=k.onUpdate;g.setAttribute("data-tippy-root",""),g.id="tippy-"+l.id,l.popper=g,e._tippy=l,g._tippy=l;var z=S.map(function(p){return p.fn(l)}),F=e.hasAttribute("aria-expanded");return st(),ve(),$(),j("onCreate",[l]),n.showOnCreate&&St(),g.addEventListener("mouseenter",function(){l.props.interactive&&l.state.isVisible&&l.clearDelayTimeouts()}),g.addEventListener("mouseleave",function(){l.props.interactive&&l.props.trigger.indexOf("mouseenter")>=0&&ee().addEventListener("mousemove",y)}),l;function _(){var p=l.props.touch;return Array.isArray(p)?p:[p,0]}function I(){return _()[0]==="hold"}function L(){var p;return!!((p=l.props.render)!=null&&p.$$tippy)}function B(){return h||e}function ee(){var p=B().parentNode;return p?ma(p):document}function te(){return wn(g)}function W(p){return l.state.isMounted&&!l.state.isVisible||pe.isTouch||u&&u.type==="focus"?0:hn(l.props.delay,p?0:1,Z.delay)}function $(p){p===void 0&&(p=!1),g.style.pointerEvents=l.props.interactive&&!p?"":"none",g.style.zIndex=""+l.props.zIndex}function j(p,b,T){if(T===void 0&&(T=!0),z.forEach(function(R){R[p]&&R[p].apply(R,b)}),T){var D;(D=l.props)[p].apply(D,b)}}function me(){var p=l.props.aria;if(!!p.content){var b="aria-"+p.content,T=g.id,D=et(l.props.triggerTarget||e);D.forEach(function(R){var K=R.getAttribute(b);if(l.state.isVisible)R.setAttribute(b,K?K+" "+T:T);else{var ae=K&&K.replace(T,"").trim();ae?R.setAttribute(b,ae):R.removeAttribute(b)}})}}function ve(){if(!(F||!l.props.aria.expanded)){var p=et(l.props.triggerTarget||e);p.forEach(function(b){l.props.interactive?b.setAttribute("aria-expanded",l.state.isVisible&&b===B()?"true":"false"):b.removeAttribute("aria-expanded")})}}function We(){ee().removeEventListener("mousemove",y),_t=_t.filter(function(p){return p!==y})}function ge(p){if(!(pe.isTouch&&(c||p.type==="mousedown"))){var b=p.composedPath&&p.composedPath()[0]||p.target;if(!(l.props.interactive&&Er(g,b))){if(et(l.props.triggerTarget||e).some(function(T){return Er(T,b)})){if(pe.isTouch||l.state.isVisible&&l.props.trigger.indexOf("click")>=0)return}else j("onClickOutside",[l,p]);l.props.hideOnClick===!0&&(l.clearDelayTimeouts(),l.hide(),a=!0,setTimeout(function(){a=!1}),l.state.isMounted||Ee())}}}function $e(){c=!0}function we(){c=!1}function ue(){var p=ee();p.addEventListener("mousedown",ge,!0),p.addEventListener("touchend",ge,je),p.addEventListener("touchstart",we,je),p.addEventListener("touchmove",$e,je)}function Ee(){var p=ee();p.removeEventListener("mousedown",ge,!0),p.removeEventListener("touchend",ge,je),p.removeEventListener("touchstart",we,je),p.removeEventListener("touchmove",$e,je)}function ot(p,b){at(p,function(){!l.state.isVisible&&g.parentNode&&g.parentNode.contains(g)&&b()})}function xe(p,b){at(p,b)}function at(p,b){var T=te().box;function D(R){R.target===T&&(gn(T,"remove",D),b())}if(p===0)return b();gn(T,"remove",f),gn(T,"add",D),f=D}function Me(p,b,T){T===void 0&&(T=!1);var D=et(l.props.triggerTarget||e);D.forEach(function(R){R.addEventListener(p,b,T),m.push({node:R,eventType:p,handler:b,options:T})})}function st(){I()&&(Me("touchstart",kt,{passive:!0}),Me("touchend",Ft,{passive:!0})),ca(l.props.trigger).forEach(function(p){if(p!=="manual")switch(Me(p,kt),p){case"mouseenter":Me("mouseleave",Ft);break;case"focus":Me(Ea?"focusout":"blur",Tt);break;case"focusin":Me("focusout",Tt);break}})}function Pt(){m.forEach(function(p){var b=p.node,T=p.eventType,D=p.handler,R=p.options;b.removeEventListener(T,D,R)}),m=[]}function kt(p){var b,T=!1;if(!(!l.state.isEnabled||Ct(p)||a)){var D=((b=u)==null?void 0:b.type)==="focus";u=p,h=p.currentTarget,ve(),!l.state.isVisible&&fa(p)&&_t.forEach(function(R){return R(p)}),p.type==="click"&&(l.props.trigger.indexOf("mouseenter")<0||s)&&l.props.hideOnClick!==!1&&l.state.isVisible?T=!0:St(p),p.type==="click"&&(s=!T),T&&!D&&Ue(p)}}function zt(p){var b=p.target,T=B().contains(b)||g.contains(b);if(!(p.type==="mousemove"&&T)){var D=Ie().concat(g).map(function(R){var K,ae=R._tippy,ct=(K=ae.popperInstance)==null?void 0:K.state;return ct?{popperRect:R.getBoundingClientRect(),popperState:ct,props:n}:null}).filter(Boolean);va(D,p)&&(We(),Ue(p))}}function Ft(p){var b=Ct(p)||l.props.trigger.indexOf("click")>=0&&s;if(!b){if(l.props.interactive){l.hideWithInteractivity(p);return}Ue(p)}}function Tt(p){l.props.trigger.indexOf("focusin")<0&&p.target!==B()||l.props.interactive&&p.relatedTarget&&g.contains(p.relatedTarget)||Ue(p)}function Ct(p){return pe.isTouch?I()!==p.type.indexOf("touch")>=0:!1}function Vt(){jt();var p=l.props,b=p.popperOptions,T=p.placement,D=p.offset,R=p.getReferenceClientRect,K=p.moveTransition,ae=L()?wn(g).arrow:null,ct=R?{getBoundingClientRect:R,contextElement:R.contextElement||B()}:e,ni={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Kt){var lt=Kt.state;if(L()){var Zs=te(),Rn=Zs.box;["placement","reference-hidden","escaped"].forEach(function(Jt){Jt==="placement"?Rn.setAttribute("data-placement",lt.placement):lt.attributes.popper["data-popper-"+Jt]?Rn.setAttribute("data-"+Jt,""):Rn.removeAttribute("data-"+Jt)}),lt.attributes.popper={}}}},Ke=[{name:"offset",options:{offset:D}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!K}},ni];L()&&ae&&Ke.push({name:"arrow",options:{element:ae,padding:3}}),Ke.push.apply(Ke,(b==null?void 0:b.modifiers)||[]),l.popperInstance=ra(ct,g,Object.assign({},b,{placement:T,onFirstUpdate:v,modifiers:Ke}))}function jt(){l.popperInstance&&(l.popperInstance.destroy(),l.popperInstance=null)}function ke(){var p=l.props.appendTo,b,T=B();l.props.interactive&&p===mr||p==="parent"?b=T.parentNode:b=vr(p,[T]),b.contains(g)||b.appendChild(g),l.state.isMounted=!0,Vt(),process.env.NODE_ENV!=="production"&&be(l.props.interactive&&p===Z.appendTo&&T.nextElementSibling!==g,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
|
|
15
|
+
|
|
16
|
+
`,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
|
|
17
|
+
|
|
18
|
+
`,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
|
|
19
|
+
|
|
20
|
+
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Ie(){return Lt(g.querySelectorAll("[data-tippy-root]"))}function St(p){l.clearDelayTimeouts(),p&&j("onTrigger",[l,p]),ue();var b=W(!0),T=_(),D=T[0],R=T[1];pe.isTouch&&D==="hold"&&R&&(b=R),b?r=setTimeout(function(){l.show()},b):l.show()}function Ue(p){if(l.clearDelayTimeouts(),j("onUntrigger",[l,p]),!l.state.isVisible){Ee();return}if(!(l.props.trigger.indexOf("mouseenter")>=0&&l.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(p.type)>=0&&s)){var b=W(!1);b?i=setTimeout(function(){l.state.isVisible&&l.hide()},b):o=requestAnimationFrame(function(){l.hide()})}}function Ot(){l.state.isEnabled=!0}function qt(){l.hide(),l.state.isEnabled=!1}function Wt(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function $t(p){if(process.env.NODE_ENV!=="production"&&be(l.state.isDestroyed,tt("setProps")),!l.state.isDestroyed){j("onBeforeUpdate",[l,p]),Pt();var b=l.props,T=Ar(e,Object.assign({},b,br(p),{ignoreAttributes:!0}));l.props=T,st(),b.interactiveDebounce!==T.interactiveDebounce&&(We(),y=gr(zt,T.interactiveDebounce)),b.triggerTarget&&!T.triggerTarget?et(b.triggerTarget).forEach(function(D){D.removeAttribute("aria-expanded")}):T.triggerTarget&&e.removeAttribute("aria-expanded"),ve(),$(),N&&N(b,T),l.popperInstance&&(Vt(),Ie().forEach(function(D){requestAnimationFrame(D._tippy.popperInstance.forceUpdate)})),j("onAfterUpdate",[l,p])}}function Ut(p){l.setProps({content:p})}function Ks(){process.env.NODE_ENV!=="production"&&be(l.state.isDestroyed,tt("show"));var p=l.state.isVisible,b=l.state.isDestroyed,T=!l.state.isEnabled,D=pe.isTouch&&!l.props.touch,R=hn(l.props.duration,0,Z.duration);if(!(p||b||T||D)&&!B().hasAttribute("disabled")&&(j("onShow",[l],!1),l.props.onShow(l)!==!1)){if(l.state.isVisible=!0,L()&&(g.style.visibility="visible"),$(),ue(),l.state.isMounted||(g.style.transition="none"),L()){var K=te(),ae=K.box,ct=K.content;vn([ae,ct],0)}v=function(){var Ke;if(!(!l.state.isVisible||d)){if(d=!0,g.offsetHeight,g.style.transition=l.props.moveTransition,L()&&l.props.animation){var Nn=te(),Kt=Nn.box,lt=Nn.content;vn([Kt,lt],R),wr([Kt,lt],"visible")}me(),ve(),yr(En,l),(Ke=l.popperInstance)==null||Ke.forceUpdate(),j("onMount",[l]),l.props.animation&&L()&&xe(R,function(){l.state.isShown=!0,j("onShown",[l])})}},ke()}}function Js(){process.env.NODE_ENV!=="production"&&be(l.state.isDestroyed,tt("hide"));var p=!l.state.isVisible,b=l.state.isDestroyed,T=!l.state.isEnabled,D=hn(l.props.duration,1,Z.duration);if(!(p||b||T)&&(j("onHide",[l],!1),l.props.onHide(l)!==!1)){if(l.state.isVisible=!1,l.state.isShown=!1,d=!1,s=!1,L()&&(g.style.visibility="hidden"),We(),Ee(),$(!0),L()){var R=te(),K=R.box,ae=R.content;l.props.animation&&(vn([K,ae],D),wr([K,ae],"hidden"))}me(),ve(),l.props.animation?L()&&ot(D,l.unmount):l.unmount()}}function Gs(p){process.env.NODE_ENV!=="production"&&be(l.state.isDestroyed,tt("hideWithInteractivity")),ee().addEventListener("mousemove",y),yr(_t,y),y(p)}function Ys(){process.env.NODE_ENV!=="production"&&be(l.state.isDestroyed,tt("unmount")),l.state.isVisible&&l.hide(),l.state.isMounted&&(jt(),Ie().forEach(function(p){p._tippy.unmount()}),g.parentNode&&g.parentNode.removeChild(g),En=En.filter(function(p){return p!==l}),l.state.isMounted=!1,j("onHidden",[l]))}function Xs(){process.env.NODE_ENV!=="production"&&be(l.state.isDestroyed,tt("destroy")),!l.state.isDestroyed&&(l.clearDelayTimeouts(),l.unmount(),Pt(),delete e._tippy,l.state.isDestroyed=!0,j("onDestroy",[l]))}}function nt(e,t){t===void 0&&(t={});var n=Z.plugins.concat(t.plugins||[]);process.env.NODE_ENV!=="production"&&(Ta(e),Nr(t,n)),ba();var r=Object.assign({},t,{plugins:n}),i=ha(e);if(process.env.NODE_ENV!=="production"){var o=Et(r.content),s=i.length>1;be(o&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
|
|
21
|
+
|
|
22
|
+
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
23
|
+
|
|
24
|
+
`,`1) content: element.innerHTML
|
|
25
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var a=i.reduce(function(c,d){var u=d&&Ma(d,r);return u&&c.push(u),c},[]);return Et(e)?a[0]:a}nt.defaultProps=Z,nt.setDefaultProps=Oa,nt.currentInput=pe,Object.assign({},Jn,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),nt.setDefaultProps({render:Ir});class Ia{constructor({editor:t,element:n,view:r,tippyOptions:i={},shouldShow:o}){P(this,"editor");P(this,"element");P(this,"view");P(this,"preventHide",!1);P(this,"preventShow",!1);P(this,"tippy");P(this,"tippyOptions");P(this,"shouldShow",({view:t,state:n,from:r,to:i})=>{const{doc:o,selection:s}=n,{empty:a}=s,c=!o.textBetween(r,i).length&&E.isTextSelection(n.selection);return!(!t.hasFocus()||a||c)});P(this,"mousedownHandler",()=>{this.preventHide=!0});P(this,"viewMousedownHandler",()=>{this.preventShow=!0});P(this,"viewMouseupHandler",()=>{this.preventShow=!1,setTimeout(()=>this.update(this.editor.view))});P(this,"dragstartHandler",()=>{this.hide()});P(this,"focusHandler",()=>{setTimeout(()=>this.update(this.editor.view))});P(this,"blurHandler",({event:t})=>{var n;if(this.preventHide){this.preventHide=!1;return}(t==null?void 0:t.relatedTarget)&&((n=this.element.parentNode)==null?void 0:n.contains(t.relatedTarget))||this.hide()});this.editor=t,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("mousedown",this.viewMousedownHandler),this.view.dom.addEventListener("mouseup",this.viewMouseupHandler),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=nt(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",r=>{this.blurHandler({event:r})}))}update(t,n){var v,m;const{state:r,composing:i}=t,{doc:o,selection:s}=r,a=n&&n.doc.eq(o)&&n.selection.eq(s);if(i||a)return;this.createTooltip();const{ranges:c}=s,d=Math.min(...c.map(y=>y.$from.pos)),u=Math.max(...c.map(y=>y.$to.pos));if(!((v=this.shouldShow)==null?void 0:v.call(this,{editor:this.editor,view:t,state:r,oldState:n,from:d,to:u}))||this.preventShow){this.hide();return}(m=this.tippy)==null||m.setProps({getReferenceClientRect:()=>{if(E.isNodeSelection(r.selection)){const y=t.nodeDOM(d);if(y)return y.getBoundingClientRect()}return E.posToDOMRect(t,d,u)}}),this.show()}show(){var t;(t=this.tippy)==null||t.show()}hide(){var t;(t=this.tippy)==null||t.hide()}destroy(){var t;(t=this.tippy)==null||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("mousedown",this.viewMousedownHandler),this.view.dom.removeEventListener("mouseup",this.viewMouseupHandler),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Da=e=>new H.Plugin({key:new H.PluginKey("BubbleMenuPlugin"),view:t=>new Ia({view:t,...e})});var Dr={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Hr=M.default.createContext&&M.default.createContext(Dr),Ne=globalThis&&globalThis.__assign||function(){return Ne=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ne.apply(this,arguments)},Ha=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function Lr(e){return e&&e.map(function(t,n){return M.default.createElement(t.tag,Ne({key:n},t.attr),Lr(t.child))})}function V(e){return function(t){return M.default.createElement(La,Ne({attr:Ne({},e.attr)},t),Lr(e.child))}}function La(e){var t=function(n){var r=e.attr,i=e.size,o=e.title,s=Ha(e,["attr","size","title"]),a=i||n.size||"1em",c;return n.className&&(c=n.className),e.className&&(c=(c?c+" ":"")+e.className),M.default.createElement("svg",Ne({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,s,{className:c,style:Ne(Ne({color:e.color||n.color},n.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&M.default.createElement("title",null,o),e.children)};return Hr!==void 0?M.default.createElement(Hr.Consumer,null,function(n){return t(n)}):t(Dr)}function _a(e){return V({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 11h4.5a2.5 2.5 0 1 0 0-5H8v5zm10 4.5a4.5 4.5 0 0 1-4.5 4.5H6V4h6.5a4.5 4.5 0 0 1 3.256 7.606A4.498 4.498 0 0 1 18 15.5zM8 13v5h5.5a2.5 2.5 0 1 0 0-5H8z"}}]}]})(e)}function _r(e){return V({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M13 20h-2v-7H4v7H2V4h2v7h7V4h2v16zm8-12v12h-2v-9.796l-2 .536V8.67L19.5 8H21z"}}]}]})(e)}function Br(e){return V({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M4 4v7h7V4h2v16h-2v-7H4v7H2V4h2zm14.5 4c2.071 0 3.75 1.679 3.75 3.75 0 .857-.288 1.648-.772 2.28l-.148.18L18.034 18H22v2h-7v-1.556l4.82-5.546c.268-.307.43-.709.43-1.148 0-.966-.784-1.75-1.75-1.75-.918 0-1.671.707-1.744 1.606l-.006.144h-2C14.75 9.679 16.429 8 18.5 8z"}}]}]})(e)}function Pr(e){return V({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M22 8l-.002 2-2.505 2.883c1.59.435 2.757 1.89 2.757 3.617 0 2.071-1.679 3.75-3.75 3.75-1.826 0-3.347-1.305-3.682-3.033l1.964-.382c.156.806.866 1.415 1.718 1.415.966 0 1.75-.784 1.75-1.75s-.784-1.75-1.75-1.75c-.286 0-.556.069-.794.19l-1.307-1.547L19.35 10H15V8h7zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2z"}}]}]})(e)}function Ba(e){return V({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm8-5h10v2H11v-2zm0-5h10v2H11V9zm-8 3.5L7 9v7l-4-3.5z"}}]}]})(e)}function Pa(e){return V({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm8-5h10v2H11v-2zm0-5h10v2H11V9zm-4 3.5L3 16V9l4 3.5z"}}]}]})(e)}function za(e){return V({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 20H7v-2h2.927l2.116-12H9V4h8v2h-2.927l-2.116 12H15z"}}]}]})(e)}function Fa(e){return V({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 17h5v2h-3v3h-2v-5zM7 7H2V5h3V2h2v5zm11.364 8.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}]}]})(e)}function zr(e){return V({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18.364 15.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}]}]})(e)}function Fr(e){return V({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zM5 3v3h1v1H3V6h1V4H3V3h2zM3 14v-2.5h2V11H3v-1h3v2.5H4v.5h2v1H3zm2 5.5H3v-1h2V18H3v-1h3v4H3v-1h2v-.5zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}]}]})(e)}function Vr(e){return V({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zM4.5 6.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 6.9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}]}]})(e)}function Va(e){return V({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.154 14c.23.516.346 1.09.346 1.72 0 1.342-.524 2.392-1.571 3.147C14.88 19.622 13.433 20 11.586 20c-1.64 0-3.263-.381-4.87-1.144V16.6c1.52.877 3.075 1.316 4.666 1.316 2.551 0 3.83-.732 3.839-2.197a2.21 2.21 0 0 0-.648-1.603l-.12-.117H3v-2h18v2h-3.846zm-4.078-3H7.629a4.086 4.086 0 0 1-.481-.522C6.716 9.92 6.5 9.246 6.5 8.452c0-1.236.466-2.287 1.397-3.153C8.83 4.433 10.271 4 12.222 4c1.471 0 2.879.328 4.222.984v2.152c-1.2-.687-2.515-1.03-3.946-1.03-2.48 0-3.719.782-3.719 2.346 0 .42.218.786.654 1.099.436.313.974.562 1.613.75.62.18 1.297.414 2.03.699z"}}]}]})(e)}function xn(e){return V({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 6v15h-2V6H5V4h14v2z"}}]}]})(e)}function ja(e){return V({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 3v9a4 4 0 1 0 8 0V3h2v9a6 6 0 1 1-12 0V3h2zM4 20h16v2H4v-2z"}}]}]})(e)}function qa(e){return V({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm11-3v9l-3.794-3.793-5.999 6-1.414-1.414 5.999-6L12 3h9z"}}]}]})(e)}const kn={icon:"_icon_1sxr9_1",isSelected:"_isSelected_1sxr9_7",isDisabled:"_isDisabled_1sxr9_11"},jr={tooltip:"_tooltip_mmzq3_1",secondaryText:"_secondaryText_mmzq3_12"},Tn=e=>React.createElement("div",{className:jr.tooltip},React.createElement("div",null,e.mainTooltip),e.secondaryTooltip&&React.createElement("div",{className:jr.secondaryText},e.secondaryTooltip)),he=ne.forwardRef((e,t)=>{const n=e.icon;return M.default.createElement(He.default,{content:M.default.createElement(Tn,{mainTooltip:e.mainTooltip,secondaryTooltip:e.secondaryTooltip})},M.default.createElement(In.default,{ref:t,appearance:"subtle",onClick:e.onClick,isSelected:e.isSelected||!1,isDisabled:e.isDisabled||!1,iconBefore:n&&M.default.createElement(n,{className:kn.icon+" "+(e.isSelected?kn.isSelected:"")+" "+(e.isDisabled?kn.isDisabled:"")})},e.children))}),Wa={toolbar:"_toolbar_1rs9g_1"},qr=e=>React.createElement("div",{className:Wa.toolbar},e.children);function $a(){const[,e]=ne.useState(0);return()=>e(t=>t+1)}const Ua=e=>{const t=$a();ne.useEffect(()=>{const n=()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})};return e.on("transaction",n),()=>{e.off("transaction",n)}},[e])},U={mac:!1,ie:!1,ie_version:0,gecko:!1,chrome:!1,chrome_version:0,android:!1,ios:!1,webkit:!1};if(typeof navigator<"u"){const e=/Edge\/(\d+)/.exec(navigator.userAgent),t=/MSIE \d/.test(navigator.userAgent),n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);U.mac=/Mac/.test(navigator.platform);let r=U.ie=!!(t||n||e);U.ie_version=t?document.documentMode||6:n?+n[1]:e?+e[1]:null,U.gecko=!r&&/gecko\/\d/i.test(navigator.userAgent),U.chrome=!r&&/Chrome\//.test(navigator.userAgent),U.chrome_version=parseInt((navigator.userAgent.match(/Chrome\/(\d{2})/)||[])[1],10),U.android=/Android \d/.test(navigator.userAgent),U.ios=!r&&/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),U.webkit=!r&&!!document.documentElement&&"WebkitAppearance"in document.documentElement.style}function Q(e){return U.ios||U.mac?e.replace("Mod","\u2318"):e.replace("Mod","Ctrl")}var Ka="#EBECF0",Ja="#97A0AF",Ga="#505F79",Ya="#172B4D";const Xa=Ge.default.input`
|
|
26
|
+
input& {
|
|
27
|
+
autofocus: true;
|
|
28
|
+
background: transparent;
|
|
29
|
+
border: 0;
|
|
30
|
+
border-radius: 0;
|
|
31
|
+
box-sizing: content-box;
|
|
32
|
+
color: ${Ga};
|
|
33
|
+
flex-grow: 1;
|
|
34
|
+
font-size: 13px;
|
|
35
|
+
line-height: 20px;
|
|
36
|
+
padding: 0;
|
|
37
|
+
${e=>e.width?`width: ${e.width}px`:""};
|
|
38
|
+
min-width: 145px;
|
|
39
|
+
|
|
40
|
+
/* Hides IE10+ built-in [x] clear input button */
|
|
41
|
+
&::-ms-clear {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:focus {
|
|
46
|
+
outline: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&::placeholder {
|
|
50
|
+
color: ${Ya};
|
|
51
|
+
opacity: 0.5;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`,Cn=90,Za=89;class Wr extends ne.PureComponent{constructor(n){super(n);P(this,"input");P(this,"focusTimeoutId");P(this,"onMouseDown",()=>{const{onMouseDown:n}=this.props;n&&n()});P(this,"onBlur",n=>{const{onBlur:r}=this.props;r&&r(n)});P(this,"handleChange",()=>{const{onChange:n}=this.props;this.input&&this.setState({value:this.input.value}),n&&this.input&&n(this.input.value)});P(this,"handleKeydown",n=>{const{onUndo:r,onRedo:i,onSubmit:o,onCancel:s}=this.props;n.keyCode===13&&o?(n.preventDefault(),o(this.input.value)):n.keyCode===27&&s?s(n):typeof r=="function"&&this.isUndoEvent(n)?(n.preventDefault(),r()):typeof i=="function"&&this.isRedoEvent(n)&&(n.preventDefault(),i()),this.props.onKeyDown&&this.props.onKeyDown(n)});P(this,"handleRef",n=>{n instanceof HTMLInputElement?(this.input=n,this.props.autoFocus&&(this.focusTimeoutId=window.setTimeout(()=>this.focus()))):this.input=void 0});this.state={value:n.defaultValue||""}}UNSAFE_componentWillReceiveProps(n){n.defaultValue!==this.props.defaultValue&&this.setState({value:n.defaultValue})}componentWillUnmount(){window.clearTimeout(this.focusTimeoutId)}render(){const{placeholder:n,width:r,maxLength:i,testId:o,ariaLabel:s}=this.props,{value:a}=this.state;return React.createElement(Xa,{"data-testid":o||"",type:"text",placeholder:n,value:a,onChange:this.handleChange,onKeyDown:this.handleKeydown,onMouseDown:this.onMouseDown,onBlur:this.onBlur,ref:this.handleRef,width:r,maxLength:i,"aria-label":s,id:this.props.id,style:{fontSize:"0.8rem"}})}focus(){const{input:n}=this;if(n){const r=typeof this.props.autoFocus=="object"?this.props.autoFocus:{};n.focus(r)}}isUndoEvent(n){return n.keyCode===Cn&&(U.mac&&n.metaKey&&!n.shiftKey||!U.mac&&n.ctrlKey)}isRedoEvent(n){return!U.mac&&n.ctrlKey&&n.keyCode===Za||U.mac&&n.metaKey&&n.shiftKey&&n.keyCode===Cn||n.ctrlKey&&n.shiftKey&&n.keyCode===Cn}}const $r=420,Qa=360,Ur=`
|
|
55
|
+
display: flex;
|
|
56
|
+
line-height: 0;
|
|
57
|
+
padding: 4px 0;
|
|
58
|
+
align-items: center;
|
|
59
|
+
`,es=Ge.default.div`
|
|
60
|
+
${Ur}
|
|
61
|
+
border-bottom: none !important;
|
|
62
|
+
`,ts=Ge.default.div`
|
|
63
|
+
width: ${$r}px;
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
overflow: auto;
|
|
67
|
+
padding: 0;
|
|
68
|
+
|
|
69
|
+
${({provider:e})=>Mn.css`
|
|
70
|
+
width: ${e?$r:Qa}px;
|
|
71
|
+
`};
|
|
72
|
+
line-height: initial;
|
|
73
|
+
`,ns=Ge.default.div`
|
|
74
|
+
${Ur};
|
|
75
|
+
border-top: 1px solid ${Ka};
|
|
76
|
+
`,Kr=Ge.default.span`
|
|
77
|
+
color: ${Ja};
|
|
78
|
+
padding: 3px 6px;
|
|
79
|
+
width: 32px;
|
|
80
|
+
`,rs=Ge.default.div`
|
|
81
|
+
background-color: white;
|
|
82
|
+
border-radius: 3px;
|
|
83
|
+
box-shadow: rgb(9 30 66 / 31%) 0px 0px 1px,
|
|
84
|
+
rgb(9 30 66 / 25%) 0px 4px 8px -2px;
|
|
85
|
+
padding: 3px 6px;
|
|
86
|
+
display: flex;
|
|
87
|
+
line-height: 1;
|
|
88
|
+
box-sizing: border-box;
|
|
89
|
+
`,Jr=e=>{const[t,n]=ne.useState(e.url),[r,i]=ne.useState(e.text);return React.createElement(rs,null,React.createElement(ts,{provider:!1},React.createElement(es,null,React.createElement(Kr,null,React.createElement(He.default,{content:React.createElement(Tn,{mainTooltip:"Edit URL"}),placement:"left"},React.createElement("span",null,React.createElement(zr,{size:20})))),React.createElement(Wr,{defaultValue:t,autoFocus:!0,onSubmit:o=>{e.onSubmit(o,r)},onChange:o=>{n(o)}})),React.createElement(ns,null,React.createElement(Kr,null,React.createElement(He.default,{content:React.createElement(Tn,{mainTooltip:"Edit title"}),placement:"left"},React.createElement("span",null,React.createElement(xn,{size:20})))),React.createElement(Wr,{defaultValue:r,onSubmit:o=>{e.onSubmit(t,o)},onChange:o=>{i(o)}}))))},is=e=>{const[t,n]=ne.useState(),r=ne.useCallback(()=>{const i=(d,u)=>{if(d==="")return;const f=e.editor.schema.mark("link",{href:d});let{from:v,to:m}=e.editor.state.selection;e.editor.view.dispatch(e.editor.view.state.tr.insertText(u,v,m).addMark(v,v+u.length,f))},{from:o,to:s}=e.editor.state.selection,a=e.editor.state.doc.textBetween(o,s),c=e.editor.isActive("link")&&e.editor.getAttributes("link").href||"";n(React.createElement(Jr,{key:Math.random()+"",url:c,text:a,onSubmit:i}))},[e.editor]);return React.createElement(He.default,{content:t,trigger:"click",onShow:i=>{r()},interactive:!0,maxWidth:500},React.createElement(he,{...e}))};function os(e){return V({tag:"svg",attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16.972 6.251c-.967-.538-2.185-.188-2.72.777l-3.713 6.682-2.125-2.125c-.781-.781-2.047-.781-2.828 0-.781.781-.781 2.047 0 2.828l4 4c.378.379.888.587 1.414.587l.277-.02c.621-.087 1.166-.46 1.471-1.009l5-9c.537-.966.189-2.183-.776-2.72z"}}]})(e)}const Gr={item_container:"_item_container_1fy3g_1",logo_and_item_container:"_logo_and_item_container_1fy3g_8"};function rt(e){const t=e.icon;return React.createElement(Gt.DropdownItem,{onClick:e.onClick},React.createElement("div",{className:`${Gr.item_container}`},React.createElement("div",{className:`${Gr.logo_and_item_container}`},React.createElement(t,null),e.title),e.isSelected&&React.createElement(os,null)))}function as(e,t){const n=["Heading 1","Heading 2","Heading 3"],r={li:"Bullet List",oli:"Numbered List"};return e?n[e-1]:t?r[t]:"Text"}const ss=e=>{Ua(e.editor);const t=Be(e.editor.state.selection),n=t==null?void 0:t.node.attrs.headingType,r=t==null?void 0:t.node.attrs.listType,i=as(n,r);return React.createElement(qr,null,React.createElement(Ni.default,{trigger:i},React.createElement(Gt.DropdownItemGroup,null,React.createElement(rt,{title:"Text",icon:xn,isSelected:i==="Paragraph",onClick:()=>e.editor.chain().focus().unsetBlockHeading().unsetList().run()}),React.createElement(rt,{title:"Heading 1",icon:_r,isSelected:i==="Heading 1",onClick:()=>e.editor.chain().focus().unsetList().setBlockHeading({level:1}).run()}),React.createElement(rt,{title:"Heading 2",icon:Br,isSelected:i==="Heading 2",onClick:()=>e.editor.chain().focus().unsetList().setBlockHeading({level:2}).run()}),React.createElement(rt,{title:"Heading 3",icon:Pr,isSelected:i==="Heading 3",onClick:()=>e.editor.chain().focus().unsetList().setBlockHeading({level:3}).run()}),React.createElement(rt,{title:"Bullet List",icon:Vr,isSelected:i==="Bullet List",onClick:()=>e.editor.chain().focus().unsetBlockHeading().setBlockList("li").run()}),React.createElement(rt,{title:"Numbered List",icon:Fr,isSelected:i==="Numbered List",onClick:()=>e.editor.chain().focus().unsetBlockHeading().setBlockList("oli").run()}))),React.createElement(he,{onClick:()=>e.editor.chain().focus().toggleBold().run(),isSelected:e.editor.isActive("bold"),mainTooltip:"Bold",secondaryTooltip:Q("Mod+B"),icon:_a}),React.createElement(he,{onClick:()=>e.editor.chain().focus().toggleItalic().run(),isSelected:e.editor.isActive("italic"),mainTooltip:"Italic",secondaryTooltip:Q("Mod+I"),icon:za}),React.createElement(he,{onClick:()=>e.editor.chain().focus().toggleUnderline().run(),isSelected:e.editor.isActive("underline"),mainTooltip:"Underline",secondaryTooltip:Q("Mod+U"),icon:ja}),React.createElement(he,{onClick:()=>e.editor.chain().focus().toggleStrike().run(),isDisabled:e.editor.isActive("strike"),mainTooltip:"Strike-through",secondaryTooltip:Q("Mod+Shift+X"),icon:Va}),React.createElement(he,{onClick:()=>e.editor.chain().focus().sinkListItem("tcblock").run(),isDisabled:!e.editor.can().sinkListItem("tcblock"),mainTooltip:"Indent",secondaryTooltip:Q("Tab"),icon:Pa}),React.createElement(he,{onClick:()=>e.editor.chain().focus().liftListItem("tcblock").run(),isDisabled:!e.editor.can().command(({state:o})=>{const s=Be(o.selection);return s?s.depth>2:!1}),mainTooltip:"Decrease Indent",secondaryTooltip:Q("Shift+Tab"),icon:Ba}),React.createElement(is,{isSelected:e.editor.isActive("link"),mainTooltip:"Link",secondaryTooltip:Q("Mod+K"),icon:zr,editor:e.editor}))},Bt={bnRoot:"_bnRoot_15721_7"},cs=E.Extension.create({name:"BubbleMenuExtension",addProseMirrorPlugins(){const e=document.createElement("div");return e.className=Bt.bnRoot,Te.default.render(React.createElement(ss,{editor:this.editor}),e),[Da({editor:this.editor,element:e,pluginKey:new H.PluginKey("BubbleMenuPlugin"),tippyOptions:{appendTo:document.body}})]}});function ls(e){return V({tag:"svg",attr:{t:"1551322312294",style:"",viewBox:"0 0 1024 1024",version:"1.1"},child:[{tag:"defs",attr:{},child:[]},{tag:"path",attr:{d:"M474 152m8 0l60 0q8 0 8 8l0 704q0 8-8 8l-60 0q-8 0-8-8l0-704q0-8 8-8Z"}},{tag:"path",attr:{d:"M168 474m8 0l672 0q8 0 8 8l0 60q0 8-8 8l-672 0q-8 0-8-8l0-60q0-8 8-8Z"}}]})(e)}const us={menuList:"_menuList_drels_1"},Re={suggestionWrapper:"_suggestionWrapper_hy0qj_1",buttonName:"_buttonName_hy0qj_9",buttonHint:"_buttonHint_hy0qj_13",buttonShortcut:"_buttonShortcut_hy0qj_17",iconWrapper:"_iconWrapper_hy0qj_25",icon:"_icon_hy0qj_25",selectedIcon:"_selectedIcon_hy0qj_42"},ds=5;function fs(e){return M.default.createElement("div",{className:Re.suggestionWrapper},M.default.createElement("div",null,M.default.createElement("div",{className:Re.buttonName},e.item.name),e.item.hint&&M.default.createElement("div",{className:Re.buttonHint},e.item.hint)),e.item.shortcut&&M.default.createElement("div",null,M.default.createElement("div",{className:Re.buttonShortcut},e.item.shortcut)))}function ps(e,t){const n=e.icon;return n&&M.default.createElement("div",{className:Re.iconWrapper},M.default.createElement(n,{className:Re.icon+" "+(t?Re.selectedIcon:"")}))}function hs(e){let t=e.selectedIndex!==void 0&&e.selectedIndex===e.index;const n=M.default.useRef(null);return M.default.useEffect(()=>{t&&n.current&&n.current.getBoundingClientRect().left>ds&&n.current.scrollIntoView({behavior:"smooth",block:"nearest"})},[t]),M.default.createElement("div",{className:Re.buttonItem},M.default.createElement(Je.ButtonItem,{isSelected:t,iconBefore:ps(e.item,t),onClick:r=>{setTimeout(()=>{e.clickItem(e.item)},0)},ref:n},M.default.createElement(fs,{item:e.item})))}function ms(e){return M.default.createElement(Je.Section,{title:e.name},e.items.map((t,n)=>M.default.createElement(hs,{item:t,key:n,index:n,selectedIndex:e.selectedIndex,clickItem:e.clickItem})))}function vs(e){const t=[];let n=0;for(const r in e.groups){const i=e.groups[r];t.push(React.createElement(ms,{key:r,name:r,items:i,selectedIndex:e.selectedIndex>=n?e.selectedIndex-n:void 0,clickItem:e.onSelectItem})),n+=i.length}return React.createElement("div",{className:us.menuList+" "+Bt.bnRoot},React.createElement(Je.MenuGroup,null,t.length>0?t:React.createElement(Je.Section,{title:"No match found"}," ")))}function gs(e){let t,n,r=!0,i=0,o;const s=a=>{if(!o)throw new Error("props not set");let c=0;for(const d in o.groups){const u=o.groups[d],f=u.length;if(a<c+f)return u[a-c];c+=f}throw Error("item not found")};return{getComponent:()=>{if(!(!n||!n[0]))return n[0].reference},onStart:a=>{o=a,r=!1,i=0;const c={groups:a.groups,count:a.count,onSelectItem:a.onSelectItem,selectedIndex:i};t=new Xt.ReactRenderer(vs,{editor:e,props:c}),n=nt("body",{getReferenceClientRect:a.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate:a=>{o=a,o.groups!==t.props.groups&&(i=0);const c={groups:o.groups,count:o.count,onSelectItem:o.onSelectItem,selectedIndex:i};t.updateProps(c),n[0].setProps({getReferenceClientRect:o.clientRect})},onKeyDown:a=>{if(!o)return!1;if(a.key==="ArrowUp")return i=(i+o.count-1)%o.count,t.updateProps({selectedIndex:i}),!0;if(a.key==="ArrowDown")return i=(i+1)%o.count,t.updateProps({selectedIndex:i}),!0;if(a.key==="Enter"){const c=s(i);return o.onSelectItem(c),!0}return a.key==="Escape"?(o.onClose(),!0):!1},onExit:a=>{if(r)return;r=!0;const c=n[0],d=t;c.hide(),setTimeout(()=>{c.destroy(),d.destroy()},1e3)}}}function ys(e,t){if(!t.empty)return;const n=t.$anchor.nodeBefore;if(!n||!n.text)return;const r=new RegExp(`${Yt.escapeRegExp(e)}([^${Yt.escapeRegExp(e)}]*)$`),i=n.text.match(r);if(!!i)return{query:i[1],range:{from:t.$anchor.pos-i[1].length-e.length,to:t.$anchor.pos}}}function bs({pluginKey:e,editor:t,char:n,onSelectItem:r=()=>{},items:i=()=>[]}){if(n.length!==1)throw new Error("'char' should be a single character");const o=gs(t);return new H.Plugin({key:e,filterTransaction(s){const a=s.getMeta("blur");if(a!=null&&a.event.relatedTarget){const c=o.getComponent();if(c!=null&&c.contains(a.event.relatedTarget))return!1}return!0},view(){return{update:async(s,a)=>{var S,A,l,k,g;const c=(S=this.key)==null?void 0:S.getState(a),d=(A=this.key)==null?void 0:A.getState(s.state),u=!c.active&&d.active,f=c.active&&!d.active,v=!u&&!f&&c.query!==d.query;if(!u&&!v&&!f)return;const m=f?c:d,y=document.querySelector(`[data-decoration-id="${m.decorationId}"]`),h=Yt.groupBy(m.items,"groupName"),w=()=>{s.dispatch(s.state.tr.setMeta(e,{deactivate:!0}))},x={groups:v||u?h:{},count:m.items.length,onSelectItem:N=>{w(),r({item:N,editor:t,range:m.range})},clientRect:y?()=>y.getBoundingClientRect():null,onClose:()=>{var N;w(),(N=o.onExit)==null||N.call(o,x)}};f&&((l=o.onExit)==null||l.call(o,x)),v&&((k=o.onUpdate)==null||k.call(o,x)),u&&((g=o.onStart)==null||g.call(o,x))}}},state:{init(){return{active:!1,range:{},query:null,notFoundCount:0,items:[],type:"slash",decorationId:null}},apply(s,a,c,d){var v,m,y;const{selection:u}=s,f={...a};if(u.from===u.to&&!((v=s.getMeta(e))!=null&&v.deactivate)&&!s.getMeta("focus")&&!s.getMeta("blur")&&!s.getMeta("pointer")){if(a.active&&u.from<=a.range.from)f.active=!1;else if((m=s.getMeta(e))!=null&&m.activate){const h=`id_${Math.floor(Math.random()*4294967295)}`;f.decorationId=h,f.range={from:u.from-1,to:u.to},f.query="",f.active=!0,f.type=(y=s.getMeta(e))==null?void 0:y.type}else if(a.active){const h=ys(a.type==="slash"?n:"",u);if(!h)throw new Error("active but no match (suggestions)");f.range=h.range,f.active=!0,f.decorationId=a.decorationId,f.query=h.query}}else f.active=!1;return f.active&&(f.items=i(f.query),f.items.length?f.notFoundCount=0:f.range.to>a.range.to?f.notFoundCount=a.notFoundCount+1:f.notFoundCount=a.notFoundCount,f.notFoundCount>3&&(f.active=!1)),f.active||(f.decorationId=null,f.range={},f.query=null,f.notFoundCount=0,f.items=[]),f}},props:{handleKeyDown(s,a){var d;const{active:c}=this.getState(s.state);return c?((d=o.onKeyDown)==null?void 0:d.call(o,a))||!1:a.key===n?(s.dispatch(s.state.tr.insertText(n).scrollIntoView().setMeta(e,{activate:!0,type:"slash"})),!0):!1},decorations(s){const{active:a,range:c,decorationId:d,type:u}=this.getState(s);if(!a)return null;if(u==="drag"){const f=Be(s.selection);if(f)return ye.DecorationSet.create(s.doc,[ye.Decoration.node(f.pos,f.pos+f.node.nodeSize,{nodeName:"span",class:"suggestion-decorator","data-decoration-id":d})])}return ye.DecorationSet.create(s.doc,[ye.Decoration.inline(c.from,c.to,{nodeName:"span",class:"suggestion-decorator","data-decoration-id":d})])}}})}var qe=(e=>(e.HEADINGS="Headings",e.BASIC_BLOCKS="Basic Blocks",e.CODE="Code Blocks",e.INLINE="Inline",e.EMBED="Embed",e.PLUGIN="Plugin",e))(qe||{});class it{constructor(t,n,r,i=[],o,s,a){P(this,"groupName");this.name=t,this.group=n,this.execute=r,this.aliases=i,this.icon=o,this.hint=s,this.shortcut=a,this.groupName=n}match(t){return this.name.toLowerCase().startsWith(t.toLowerCase())||this.aliases.filter(n=>n.toLowerCase().startsWith(t.toLowerCase())).length!==0}}const ws={heading:new it("Heading",qe.HEADINGS,(e,t)=>e.chain().focus().deleteRange(t).addNewBlockAsSibling({headingType:1}).run(),["h","heading1","h1"],_r,"Used for a top-level heading",Q("Mod-Alt-1")),heading2:new it("Heading 2",qe.HEADINGS,(e,t)=>e.chain().focus().deleteRange(t).addNewBlockAsSibling({headingType:2}).run(),["h2","heading2","subheading"],Br,"Used for key sections",Q("Mod-Alt-2")),heading3:new it("Heading 3",qe.HEADINGS,(e,t)=>e.chain().focus().deleteRange(t).addNewBlockAsSibling({headingType:3}).run(),["h3","heading3","subheading"],Pr,"Used for subsections and group headings",Q("Mod-Alt-3")),numberedList:new it("Numbered List",qe.BASIC_BLOCKS,(e,t)=>e.chain().focus().deleteRange(t).addNewBlockAsSibling({listType:"oli"}).run(),["li","list","numberedlist","numbered list"],Fr,"Used to display a numbered list",Q("Mod-Shift-7")),bulletlist:new it("Bullet List",qe.BASIC_BLOCKS,(e,t)=>e.chain().focus().deleteRange(t).addNewBlockAsSibling({listType:"li"}).run(),["ul","list","bulletlist","bullet list"],Vr,"Used to display an unordered list",Q("Mod-Shift-8")),paragraph:new it("Paragraph",qe.BASIC_BLOCKS,(e,t)=>e.chain().focus().deleteRange(t).addNewBlockAsSibling().run(),["p"],xn,"Used for the body of your document",Q("Mod-Alt-0"))},Sn=new H.PluginKey("suggestions-slash-commands"),Es=E.Extension.create({name:"slash-command",addOptions(){return{commands:ws}},addProseMirrorPlugins(){return[bs({pluginKey:Sn,editor:this.editor,char:"/",items:e=>{const t=[];for(const n in this.options.commands)t.push(this.options.commands[n]);return t.filter(n=>n.match(e))},onSelectItem:({item:e,editor:t,range:n})=>{e.execute(t,n)}})]}}),Yr={dragHandle:"_dragHandle_tsup4_1",dragHandleAdd:"_dragHandleAdd_tsup4_19"},xs={menuList:"_menuList_drels_1"},ks=e=>React.createElement("div",{className:xs.menuList},React.createElement(Je.MenuGroup,null,React.createElement(Je.ButtonItem,{onClick:e.onDelete},"Delete"))),Ts=e=>{const[t,n]=ne.useState(!1),[r,i]=ne.useState(!1),o=()=>{const a=e.view.posAtCoords(e.coords);if(!a)return;const c=Be(H.TextSelection.create(e.view.state.doc,a.pos));c&&(e.view.dispatch&&e.view.dispatch(e.view.state.tr.deleteRange(c.pos,c.pos+c.node.nodeSize)),i(!0))},s=()=>{var d;n(!0),e.onAddClicked&&e.onAddClicked();const a=e.view.posAtCoords(e.coords);if(!a)return;const c=Be(H.TextSelection.create(e.view.state.doc,a.pos));if(!!c){if(((d=c.node.firstChild)==null?void 0:d.textContent.length)!==0){const u=c.pos+c.node.nodeSize;let f=e.view.state.schema.nodes.tccontent.createAndFill();e.view.state.tr.insert(u,f),e.view.dispatch(e.view.state.tr.insert(u,f)),e.view.dispatch(e.view.state.tr.setSelection(new H.TextSelection(e.view.state.tr.doc.resolve(u+1))))}e.view.focus(),e.view.dispatch(e.view.state.tr.scrollIntoView().setMeta(Sn,{activate:!0,type:"drag"}))}};return r||t?null:React.createElement("div",{style:{display:"flex",flexDirection:"row"}},React.createElement(ls,{size:24,fillOpacity:"0.25",className:Yr.dragHandleAdd,onClick:s}),React.createElement(He.default,{content:React.createElement(ks,{onDelete:o}),placement:"left",trigger:"click",duration:0,interactiveBorder:100,interactive:!0,onShow:e.onShow,onHide:e.onHide},React.createElement("div",{className:Yr.dragHandle})))},Cs=Ai.__serializeForClipboard;let On;function Ss(){if(!On){const e=document.querySelector(".ProseMirror > [class*='blockGroup']");e&&(On=Xr(e).left)}return On}function Os(e){let t={left:e.left+document.body.scrollLeft,top:e.top+document.body.scrollTop,width:e.width,height:e.height,bottom:0,right:0};return t.bottom=t.top+t.height,t.right=t.left+t.width,t}function Xr(e){return Os(e.getBoundingClientRect())}function As(e,t){let n=An(e,t);if(n&&n.node.nodeType===1){const r=t.docView;let i=r.nearestDesc(n.node,!0);return!i||i===r?null:i.posBefore}return null}function An(e,t){var i;let n=t.posAtCoords(e);if(!n)return;let r=t.domAtPos(n.pos).node;if(r!==t.dom){for(;r&&r.parentNode&&r.parentNode!==t.dom&&!((i=r.hasAttribute)!=null&&i.call(r,"data-id"));)r=r.parentNode;if(!!r)return{node:r,id:r.getAttribute("data-id")}}}function Ns(e,t){if(!e.dataTransfer)return;let n={left:t.dom.clientWidth/2,top:e.clientY},r=As(n,t);if(r!=null){t.dispatch(t.state.tr.setSelection(H.NodeSelection.create(t.state.doc,r)));let i=t.state.selection.content(),{dom:o,text:s}=Cs(t,i);e.dataTransfer.clearData(),e.dataTransfer.setData("text/html",o.innerHTML),e.dataTransfer.setData("text/plain",s),e.dataTransfer.effectAllowed="move";const a=An(n,t);e.dataTransfer.setDragImage(a==null?void 0:a.node,0,0),t.dragging={slice:i,move:!0}}}const Rs=()=>{let e,n=!1,r=!1;const i=()=>{n=!0},o=()=>{n=!1},s=()=>{r=!0};return new H.Plugin({key:new H.PluginKey("DraggableBlocksPlugin"),view(a){return e=document.createElement("div"),e.setAttribute("draggable","true"),e.style.position="absolute",e.style.height="24px",document.body.append(e),e.addEventListener("dragstart",c=>Ns(c,a)),{destroy(){if(!e)throw new Error("unexpected");e.parentNode.removeChild(e),e=void 0}}},props:{handleKeyDown(a,c){if(!e)throw new Error("unexpected");return n=!1,r=!1,Te.default.render(React.createElement(React.Fragment,null),e),!1},handleDOMEvents:{mouseleave(a,c){if(!e)throw new Error("unexpected");return!0},mousedown(a,c){if(!e)throw new Error("unexpected");return n=!1,r=!1,Te.default.render(React.createElement(React.Fragment,null),e),!1},mousemove(a,c){if(!e)throw new Error("unexpected");if(n||r)return!0;const d={left:a.dom.clientWidth/2,top:c.clientY},u=An(d,a);if(!u)return console.warn("Perhaps we should hide element?"),!0;const f=u.node.firstChild;if(!f)return!0;const v=Xr(f),m=u.node.ownerDocument.defaultView,y=e.getBoundingClientRect(),h=Ss()-48+m.pageXOffset;return v.top+=v.height/2-y.height/2+m.pageYOffset,e.style.left=h+"px",e.style.top=v.top+"px",Te.default.render(React.createElement(Ts,{onShow:i,onHide:o,onAddClicked:s,key:u.id+"",view:a,coords:d}),e),!0}}}})},Ms=E.Extension.create({name:"DraggableBlocksExtension",priority:1e3,addProseMirrorPlugins(){return[Rs()]}}),Is={separator:"_separator_1j7dp_1"},Zr=()=>React.createElement(In.default,{appearance:"subtle",className:Is.separator}),Ds=e=>{const[t,n]=ne.useState(!1);if(t)return e.editMenu;function r(i){n(!0),i.stopPropagation()}return M.default.createElement(qr,null,M.default.createElement(he,{mainTooltip:"Edit",isSelected:!1,onClick:r},"Edit Link"),M.default.createElement(Zr,null),M.default.createElement(he,{mainTooltip:"Open in new tab",isSelected:!1,onClick:()=>{window.open(e.href,"_blank")},icon:qa}),M.default.createElement(Zr,null),M.default.createElement(he,{mainTooltip:"Remove link",isSelected:!1,onClick:e.removeHandler,icon:Fa}))},Qr=new H.PluginKey("HyperlinkMenuPlugin"),Hs=e=>{const{anchorPos:t,...n}=e;return React.createElement(He.default,{getReferenceClientRect:()=>t,content:React.createElement(Jr,{...n}),interactive:!0,interactiveBorder:30,showOnCreate:!0,trigger:"click",hideOnClick:!0,className:Bt.bnRoot,appendTo:document.body},React.createElement("div",null))},Ls=()=>{const e=document.createElement("div");let t,n="hidden",r=0;return new H.Plugin({key:Qr,view(){return{update:async(i,o)=>{const s=i.state.selection;if(s.from!==s.to){n!=="hidden"&&(n="hidden",Te.default.render(React.createElement(React.Fragment,null),e));return}let a,c,d,u=!1;if(t){a=i.posAtDOM(t.firstChild,0),c=i.state.doc.resolve(a);const l=c.parent.childAfter(c.parentOffset).node;d=l==null?void 0:l.marks.find(k=>k.type.name.startsWith("link"))}if(!d&&(i.hasFocus()||n==="cursor-based")){a=s.from,c=i.state.doc.resolve(a);const l=c.parent.childAfter(c.parentOffset).node;d=l==null?void 0:l.marks.find(k=>k.type.name.startsWith("link")),u=!0}if(!d||!a||!c){n==="cursor-based"&&(n="hidden",Te.default.render(React.createElement(React.Fragment,null),e));return}const f=E.getMarkRange(c,d.type,d.attrs);if(!f)return;const v=i.state.doc.textBetween(f.from,f.to),m=d.attrs.href,y={...i.coordsAtPos(Math.round((f.from+f.to)/2)),height:0,width:0},h=d,w=(l,k)=>{n="hidden",Te.default.render(React.createElement(React.Fragment,null),e),h.attrs={...h.attrs,href:l};const g=i.state.tr.insertText(k,f.from,f.to);g.addMark(f.from,f.from+k.length,h),i.dispatch(g)},x=()=>{i.dispatch(i.state.tr.removeMark(f.from,f.to,h.type).setMeta("preventAutolink",!0))},S=Hs({anchorPos:y,text:v,url:m,onSubmit:w}),A=React.createElement(He.default,{key:r+"",getReferenceClientRect:()=>y,content:React.createElement(Ds,{editMenu:S,removeHandler:x,href:m}),onHide:()=>{r++,n="hidden"},aria:{expanded:!1},interactive:!0,interactiveBorder:30,triggerTarget:t,showOnCreate:u,appendTo:document.body},React.createElement("div",null));Te.default.render(A,e),n=u?"cursor-based":"mouse-based"}}},props:{handleDOMEvents:{mouseover(i,o){const s=o.target instanceof HTMLAnchorElement&&o.target.nodeName==="A"?o.target:void 0;return s!==t&&(t=s,i.dispatch(i.state.tr.setMeta(Qr,{hoveredLinkChanged:!0}))),!1}}}})},_s=mi.Link.extend({priority:500,addProseMirrorPlugins(){var e;return[...((e=this.parent)==null?void 0:e.call(this))||[],Ls()]}}),Bs=Ri.default.extend({addKeyboardShortcuts:()=>({"Mod-Alt-0":()=>!1})}),Ps=E.Extension.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",isFilterClass:"is-filter",hasAnchorClass:"has-anchor",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new H.Plugin({props:{decorations:e=>{const{doc:t,selection:n}=e,r=Sn.getState(e),i=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:o}=n,s=[];if(!!i)return t.descendants((a,c)=>{const d=o>=c&&o<=c+a.nodeSize,u=!a.isLeaf&&!a.childCount;if((d||!this.options.showOnlyCurrent)&&u){const f=[this.options.emptyNodeClass];this.editor.isEmpty&&f.push(this.options.emptyEditorClass),d&&f.push(this.options.hasAnchorClass),r.type==="drag"&&r.active&&f.push(this.options.isFilterClass);const v=ye.Decoration.node(c,c+a.nodeSize,{class:f.join(" ")});s.push(v)}return this.options.includeChildren}),ye.DecorationSet.create(t,s)}}})]}}),zs=E.Extension.create({name:"trailingNode",addProseMirrorPlugins(){const e=new H.PluginKey(this.name);return[new H.Plugin({key:e,appendTransaction:(t,n,r)=>{const{doc:i,tr:o,schema:s}=r,a=e.getState(r),c=i.content.size-2,d=s.nodes.tcblock,u=s.nodes.tccontent;if(!!a)return o.insert(c,d.create(void 0,u.create()))},state:{init:(t,n)=>{},apply:(t,n)=>{if(!t.docChanged)return n;let r=t.doc.lastChild;if(!r||r.type.name!=="blockgroup")throw new Error("Expected blockgroup");if(r=r.lastChild,!r||r.type.name!=="tcblock")throw new Error("Expected tcblock");return r.nodeSize>4}}})]}});function Fs(e,t=JSON.stringify){const n={};return e.filter(r=>{const i=t(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function Vs(e){const t=e.filter((r,i)=>e.indexOf(r)!==i);return Fs(t)}const js=E.Extension.create({name:"uniqueID",priority:1e4,addOptions(){return{attributeName:"id",types:[],generateID:()=>gi.v4(),filterTransaction:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{[this.options.attributeName]:{default:null,parseHTML:e=>e.getAttribute(`data-${this.options.attributeName}`),renderHTML:e=>e[this.options.attributeName]?{[`data-${this.options.attributeName}`]:e[this.options.attributeName]}:{}}}}]},onCreate(){if(this.editor.extensionManager.extensions.find(c=>c.name==="collaboration"))return;const{view:e,state:t}=this.editor,{tr:n,doc:r}=t,{types:i,attributeName:o,generateID:s}=this.options;E.findChildren(r,c=>i.includes(c.type.name)&&c.attrs[o]===null).forEach(({node:c,pos:d})=>{n.setNodeMarkup(d,void 0,{...c.attrs,[o]:s()})}),n.setMeta("addToHistory",!1),e.dispatch(n)},addProseMirrorPlugins(){let e=null,t=!1;return[new H.Plugin({key:new H.PluginKey("uniqueID"),appendTransaction:(n,r,i)=>{console.log("appendTransaction");const o=n.some(y=>y.docChanged)&&!r.doc.eq(i.doc),s=this.options.filterTransaction&&n.some(y=>{var h,w;return!(!((w=(h=this.options).filterTransaction)===null||w===void 0)&&w.call(h,y))});if(!o||s)return;const{tr:a}=i,{types:c,attributeName:d,generateID:u}=this.options,f=E.combineTransactionSteps(r.doc,n),{mapping:v}=f;if(E.getChangedRanges(f).forEach(({newRange:y})=>{const h=E.findChildrenInRange(i.doc,y,S=>c.includes(S.type.name)),w=h.map(({node:S})=>S.attrs[d]).filter(S=>S!==null),x=Vs(w);h.forEach(({node:S,pos:A})=>{var l;const k=(l=a.doc.nodeAt(A))===null||l===void 0?void 0:l.attrs[d];if(k===null){a.setNodeMarkup(A,void 0,{...S.attrs,[d]:u()});return}const{deleted:g}=v.invert().mapResult(A);g&&x.includes(k)&&a.setNodeMarkup(A,void 0,{...S.attrs,[d]:u()})})}),!!a.steps.length)return a},view(n){const r=i=>{var o;e=!((o=n.dom.parentElement)===null||o===void 0)&&o.contains(i.target)?n.dom.parentElement:null};return window.addEventListener("dragstart",r),{destroy(){window.removeEventListener("dragstart",r)}}},props:{handleDOMEvents:{drop:(n,r)=>{var i;return(e!==n.dom.parentElement||((i=r.dataTransfer)===null||i===void 0?void 0:i.effectAllowed)==="copy")&&(e=null,t=!0),!1},paste:()=>(t=!0,!1)},transformPasted:n=>{if(!t)return n;const{types:r,attributeName:i}=this.options,o=s=>{const a=[];return s.forEach(c=>{if(c.isText){a.push(c);return}if(!r.includes(c.type.name)){a.push(c.copy(o(c.content)));return}const d=c.type.create({...c.attrs,[i]:null},o(c.content),c.marks);a.push(d)}),O.Fragment.from(a)};return t=!1,new O.Slice(o(n.content),n.openStart,n.openEnd)}}})]}}),qs=E.Node.create({name:"doc",topNode:!0,content:"block+"}),ei=()=>[E.extensions.ClipboardTextSerializer,E.extensions.Commands,E.extensions.Editable,E.extensions.FocusEvents,E.extensions.Tabindex,xi.default,Ps.configure({emptyNodeClass:Pe.isEmpty,hasAnchorClass:Pe.hasAnchor,isFilterClass:Pe.isFilter,includeChildren:!0,showOnlyCurrent:!1}),js.configure({types:["tcblock"]}),ki.default,Oi.default,bi.default,wi.default,Ti.default,Si.default,Ci.default,_s,Bs,...Ji,Ms,Ei.default.configure({width:5,color:"#ddeeff"}),cs,li.History,Es,zs],Ws={bnEditor:"_bnEditor_1bxtz_1"},ti=ei(),$s={enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!1},Us=(e={},t=[])=>{var i,o,s;const n=e.disableHistoryExtension?ti.filter(a=>a.name!=="history"):ti,r={...$s,...e,extensions:e.enableBlockNoteExtensions===!1?e.extensions:[...e.extensions||[],...n],editorProps:{attributes:{...((i=e.editorProps)==null?void 0:i.attributes)||{},class:[Ws.bnEditor,Bt.bnRoot,((s=(o=e.editorProps)==null?void 0:o.attributes)==null?void 0:s.class)||""].join(" ")}}};return Xt.useEditor(r,t)};Object.defineProperty(C,"EditorContent",{enumerable:!0,get:()=>Xt.EditorContent}),C.Document=qs,C.getBlockNoteExtensions=ei,C.useEditor=Us,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
90
|
+
//# sourceMappingURL=blocknote.umd.cjs.map
|