UNPKG

text-editor-drcsystems

Version:
7 lines 502 kB
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ "use strict";var e=require("react"),i=require("@lexical/html"),o=require("@lexical/react/LexicalAutoFocusPlugin"),s=require("@lexical/react/LexicalCharacterLimitPlugin"),t=require("@lexical/react/LexicalCheckListPlugin"),n=require("@lexical/react/LexicalClearEditorPlugin"),a=require("@lexical/react/LexicalCollaborationPlugin"),r=require("@lexical/react/LexicalComposerContext"),c=require("@lexical/react/LexicalErrorBoundary"),l=require("@lexical/react/LexicalHashtagPlugin"),d=require("@lexical/react/LexicalHistoryPlugin"),g=require("@lexical/react/LexicalHorizontalRulePlugin"),m=require("@lexical/react/LexicalListPlugin"),u=require("@lexical/react/LexicalOnChangePlugin"),_=require("@lexical/react/LexicalPlainTextPlugin"),p=require("@lexical/react/LexicalRichTextPlugin"),v=require("@lexical/react/LexicalTabIndentationPlugin"),y=require("@lexical/react/LexicalTablePlugin"),h=require("@lexical/code"),f=require("@lexical/markdown"),b=require("@lexical/react/LexicalCollaborationContext"),j=require("@lexical/utils"),w=require("@lexical/yjs"),k=require("lexical"),E=require("react-dom"),C=require("@lexical/react/LexicalHorizontalRuleNode"),N=require("@lexical/table"),x=require("@lexical/react/LexicalBlockWithAlignableContents"),S=require("@lexical/react/LexicalDecoratorBlockNode"),T=require("@lexical/selection"),P=require("@lexical/react/LexicalAutoEmbedPlugin"),O=require("@lexical/react/LexicalAutoLinkPlugin"),A=require("@lexical/link"),M=require("lodash"),R=require("@lexical/mark"),D=require("@lexical/react/LexicalComposer"),F=require("@lexical/text"),B=require("yjs"),L=require("@lexical/list"),$=require("@lexical/react/LexicalTypeaheadMenuPlugin"),I=require("@lexical/rich-text"),z=require("@lexical/react/LexicalMarkdownShortcutPlugin"),q=require("@lexical/react/useLexicalEditable"),K=require("@lexical/react/LexicalTableOfContents__EXPERIMENTAL"),W=require("@lexical/hashtag"),H=require("@lexical/overflow"),Y=require("use-debounce"),U=require("@lexical/react/LexicalNestedComposer"),J=require("@lexical/react/useLexicalNodeSelection"),G=require("@lexical/react/useLexicalTextEntity"),X=require("@lexical/react/LexicalLinkPlugin"),V=require("@lexical/react/LexicalTreeView"),Z=require("y-websocket"),Q=require("@lexical/react/LexicalContentEditable"),ee=require("@lexical/clipboard");const ie="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,oe=new URL(window.location.href),se=new URLSearchParams(oe.search),te=se.get("collabEndpoint")||"ws://localhost:1234",ne=se.get("collabId")||"0";function ae(e,i){let o=i.get(e);return void 0===o?(o=new B.Doc,i.set(e,o)):o.load(),new Z.WebsocketProvider(te,"playground/"+ne+"/"+e,o,{connect:!1})}const re=e.createContext({}),ce=()=>e.useContext(re),le=e.createContext(null);function de(){const i=e.useContext(le);if(null==i)throw Error("Cannot find an EditorComposerContext");return i}function ge({onClose:i,children:o,title:s,closeOnClickOutside:t}){const n=e.useRef(null);return e.useEffect((()=>{null!==n.current&&n.current.focus()}),[]),e.useEffect((()=>{let e=null;const o=e=>{27===e.keyCode&&i()},s=e=>{const o=e.target;null!==n.current&&!n.current.contains(o)&&t&&i()},a=n.current;return null!==a&&(e=a.parentElement,null!==e&&e.addEventListener("click",s)),window.addEventListener("keydown",o),()=>{window.removeEventListener("keydown",o),null!==e&&e?.removeEventListener("click",s)}}),[t,i]),e.createElement("div",{className:"Modal__overlay",role:"dialog"},e.createElement("div",{className:"Modal__modal",tabIndex:-1,ref:n},e.createElement("h2",{className:"Modal__title"},s),e.createElement("button",{className:"Modal__closeButton","aria-label":"Close modal",type:"button",onClick:i},"X"),e.createElement("div",{className:"Modal__content"},o)))}function me({onClose:i,children:o,title:s,closeOnClickOutside:t=!1}){return E.createPortal(e.createElement(ge,{onClose:i,title:s,closeOnClickOutside:t},o),document.body)}function ue(){const[i,o]=e.useState(null),s=e.useCallback((()=>{o(null)}),[]);return[e.useMemo((()=>{if(null===i)return null;const{title:o,content:t,closeOnClickOutside:n}=i;return e.createElement(me,{onClose:s,title:o,closeOnClickOutside:n},t)}),[i,s]),e.useCallback(((e,i,t=!1)=>{o({closeOnClickOutside:t,content:i(s),title:e})}),[s])]}function _e(e,i,o){return i in e?Object.defineProperty(e,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[i]=o,e}function pe(){return pe=Object.assign?Object.assign.bind():function(e){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(e[s]=o[s])}return e},pe.apply(this,arguments)}function ve(...e){return e.filter(Boolean).join(" ")}function ye({"data-test-id":i,children:o,className:s,onClick:t,disabled:n,small:a,title:r}){return e.createElement("button",pe({type:"button",disabled:n,className:ve("Button__root",n&&"Button__disabled",a&&"Button__small",s),onClick:t,title:r,"aria-label":r},i&&{"data-test-id":i}),o)}const he=e.lazy((()=>Promise.resolve().then((function(){return Fn}))));function fe(e){if(e instanceof HTMLImageElement){const{alt:i,src:o,width:s,height:t}=e;return{node:we({altText:i,height:t,src:o,width:s})}}return null}const be=e=>ve(e.image,"editor-image");class je extends k.DecoratorNode{static getType(){return"image"}static clone(e){return new je(e.__src,e.__altText,e.__maxWidth,e.__width,e.__height,e.__showCaption,e.__caption,e.__captionsEnabled,e.__key,e.__file)}static importJSON(e){const{altText:i,height:o,width:s,maxWidth:t,caption:n,src:a,showCaption:r}=e,c=we({altText:i,height:o,maxWidth:t,showCaption:r,src:a,width:s}),l=c.__caption,d=l.parseEditorState(n.editorState);return d.isEmpty()||l.setEditorState(d),c}exportDOM(e){const i=be(e._config.theme),o=document.createElement("img");return o.className=i,o.setAttribute("src",this.__src),o.setAttribute("alt",this.__altText),o.setAttribute("width",this.__width.toString()),o.setAttribute("height",this.__height.toString()),{element:o}}static importDOM(){return{img:e=>({conversion:fe,priority:0})}}constructor(e,i,o,s,t,n,a,r,c,l){super(c),_e(this,"__src",void 0),_e(this,"__altText",void 0),_e(this,"__width",void 0),_e(this,"__height",void 0),_e(this,"__maxWidth",void 0),_e(this,"__showCaption",void 0),_e(this,"__caption",void 0),_e(this,"__captionsEnabled",void 0),_e(this,"__file",void 0),this.__src=e,this.__altText=i,this.__maxWidth=o,this.__width=s||"inherit",this.__height=t||"inherit",this.__showCaption=n||!1,this.__caption=a||k.createEditor(),this.__captionsEnabled=r||void 0===r,this.__file=l}exportJSON(){return{altText:this.getAltText(),caption:this.__caption.toJSON(),height:"inherit"===this.__height?0:this.__height,maxWidth:this.__maxWidth,showCaption:this.__showCaption,src:this.getSrc(),type:"image",version:1,width:"inherit"===this.__width?0:this.__width}}setWidthAndHeight(e,i){const o=this.getWritable();o.__width=e,o.__height=i}setShowCaption(e){this.getWritable().__showCaption=e}setSrc(e){this.getWritable().__src=e}settext(e){this.getWritable().__altText=e}setFile(e){this.getWritable().__file=e}createDOM(e){const i=document.createElement("span"),o=e.theme,s=be(o);return void 0!==s&&(i.className=s),i}updateDOM(){return!1}getSrc(){return this.__src}getAltText(){return this.__altText}getFile(){return this.__file}decorate(){return e.createElement(e.Suspense,{fallback:null},e.createElement(he,{src:this.__src,altText:this.__altText,width:this.__width,height:this.__height,maxWidth:this.__maxWidth,nodeKey:this.getKey(),showCaption:this.__showCaption,caption:this.__caption,captionsEnabled:this.__captionsEnabled,resizable:!0}))}}function we({altText:e,height:i,maxWidth:o=500,captionsEnabled:s,src:t,width:n,showCaption:a,caption:r,key:c,file:l}){return k.$applyNodeReplacement(new je(t,e,o,n,i,a,r,s,c,l))}function ke(e){return e instanceof je}function Ee(e){const i=e.getAttribute("data-lexical-tweet-id");if(i){return{node:Se(i)}}return null}let Ce=!0;function Ne({className:i,format:o,loadingComponent:s,nodeKey:t,onError:n,onLoad:a,tweetID:r}){const c=e.useRef(null),l=e.useRef(""),[d,g]=e.useState(!1),m=e.useCallback((async()=>{try{await window.twttr.widgets.createTweet(r,c.current),g(!1),Ce=!1,a&&a()}catch(e){n&&n(String(e))}}),[n,a,r]);return e.useEffect((()=>{if(r!==l.current){if(g(!0),Ce){const e=document.createElement("script");e.src="https://platform.twitter.com/widgets.js",e.async=!0,document.body?.appendChild(e),e.onload=m,n&&(e.onerror=n)}else m();l&&(l.current=r)}}),[m,n,r]),e.createElement(x.BlockWithAlignableContents,{className:i,format:o,nodeKey:t},d?s:null,e.createElement("div",{style:{display:"inline-block",width:"550px"},ref:c}))}class xe extends S.DecoratorBlockNode{static getType(){return"tweet"}static clone(e){return new xe(e.__id,e.__format,e.__key)}static importJSON(e){const i=Se(e.id);return i.setFormat(e.format),i}exportJSON(){return{...super.exportJSON(),id:this.getId(),type:"tweet",version:1}}static importDOM(){return{div:e=>e.hasAttribute("data-lexical-tweet-id")?{conversion:Ee,priority:2}:null}}exportDOM(){const e=document.createElement("div");e.setAttribute("data-lexical-tweet-id",this.__id);const i=document.createTextNode(this.getTextContent());return e.append(i),{element:e}}constructor(e,i,o){super(i,o),_e(this,"__id",void 0),this.__id=e}getId(){return this.__id}getTextContent(e,i){return`https://twitter.com/i/web/status/${this.__id}`}decorate(i,o){const s=o.theme.embedBlock||{},t={base:s.base||"",focus:s.focus||""};return e.createElement(Ne,{className:t,format:this.__format,loadingComponent:"Loading...",nodeKey:this.getKey(),tweetID:this.__id})}isInline(){return!1}}function Se(e){return new xe(e)}const Te={dependencies:[C.HorizontalRuleNode],export:e=>C.$isHorizontalRuleNode(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,i,o,s)=>{const t=C.$createHorizontalRuleNode();s||null!=e.getNextSibling()?e.replace(t):e.insertBefore(t),t.selectNext()},type:"element"},Pe={dependencies:[je],export:(e,i,o)=>ke(e)?`![${e.getAltText()}](${e.getSrc()})`:null,importRegExp:/!(?:\[([^[]*)\])(?:\(([^(]+)\))/,regExp:/!(?:\[([^[]*)\])(?:\(([^(]+)\))$/,replace:(e,i)=>{const[,o,s]=i,t=we({altText:o,maxWidth:800,src:s});e.replace(t)},trigger:")",type:"text-match"},Oe={dependencies:[xe],export:e=>function(e){return e instanceof xe}(e)?`<tweet id="${e.getId()}" />`:null,regExp:/<tweet id="([^"]+?)"\s?\/>\s?$/,replace:(e,i,o)=>{const[,s]=o,t=Se(s);e.replace(t)},type:"element"},Ae=/^(?:\|)(.+)(?:\|)\s?$/,Me={dependencies:[N.TableNode,N.TableRowNode,N.TableCellNode],export:(e,i)=>{if(!N.$isTableNode(e))return null;const o=[];for(const s of e.getChildren()){const e=[];if(N.$isTableRowNode(s))for(const o of s.getChildren())k.$isElementNode(o)&&e.push(i(o));o.push(`| ${e.join(" | ")} |`)}return o.join("\n")},regExp:Ae,replace:(e,i,o)=>{const s=De(o[0]);if(null==s)return;const t=[s];let n=e.getPreviousSibling(),a=s.length;for(;n&&k.$isParagraphNode(n)&&1===n.getChildrenSize();){const e=n.getFirstChild();if(!k.$isTextNode(e))break;const i=De(e.getTextContent());if(null==i)break;a=Math.max(a,i.length),t.unshift(i);const o=n.getPreviousSibling();n.remove(),n=o}const r=N.$createTableNode();for(const e of t){const i=N.$createTableRowNode();r.append(i);for(let o=0;o<a;o++)i.append(o<e.length?e[o]:Re(null))}const c=e.getPreviousSibling();N.$isTableNode(c)&&function(e){const i=e.getFirstChild();return N.$isTableRowNode(i)?i.getChildrenSize():0}(c)===a?(c.append(...r.getChildren()),e.remove()):e.replace(r),r.selectEnd()},type:"element"};const Re=e=>{const i=N.$createTableCellNode(N.TableCellHeaderStates.NO_STATUS),o=k.$createParagraphNode();return null!=e&&o.append(k.$createTextNode(e.trim())),i.append(o),i},De=e=>{const i=e.match(Ae);return i&&i[1]?i[1].split("|").map((e=>Re(e))):null},Fe=[Me,Te,Pe,Oe,f.CHECK_LIST,...f.ELEMENT_TRANSFORMERS,...f.TEXT_FORMAT_TRANSFORMERS,...f.TEXT_MATCH_TRANSFORMERS];function Be({isRichText:i}){const[o]=r.useLexicalComposerContext(),[s,t]=e.useState((()=>o.isEditable()));e.useState(!1);const[n,a]=e.useState(!1),[c,l]=e.useState(!0),[d,g]=ue(),{isCollabActive:m}=b.useCollaborationContext();return e.useEffect((()=>j.mergeRegister(o.registerEditableListener((e=>{t(e)})),o.registerCommand(w.CONNECTED_COMMAND,(e=>(a(e),!1)),k.COMMAND_PRIORITY_EDITOR))),[o]),e.useEffect((()=>o.registerUpdateListener((({dirtyElements:e,prevEditorState:i,tags:t})=>{!s&&e.size>0&&!t.has("historic")&&!t.has("collaboration")&&async function(e){const i=JSON.stringify(e.getEditorState());let o=null;try{o=await fetch("http://localhost:1235/validateEditorState",{body:i,headers:{Accept:"application/json","Content-type":"application/json"},method:"POST"})}catch{}if(null!==o&&403===o.status)throw new Error("Editor state validation failed! Server did not accept changes.")}(o),o.getEditorState().read((()=>{const e=k.$getRoot().getChildren();if(e.length>1)l(!1);else if(k.$isParagraphNode(e[0])){const i=e[0].getChildren();l(0===i.length)}else l(!1)}))}))),[o,s]),e.useCallback((()=>{o.update((()=>{const e=k.$getRoot(),i=e.getFirstChild();if(h.$isCodeNode(i)&&"markdown"===i.getLanguage())f.$convertFromMarkdownString(i.getTextContent(),Fe);else{const i=f.$convertToMarkdownString(Fe);e.clear().append(h.$createCodeNode("markdown").append(k.$createTextNode(i)))}e.selectEnd()}))}),[o]),e.createElement("div",{className:"actions"},m&&e.createElement("button",{type:"button",className:"action-button connect",onClick:()=>{o.dispatchCommand(w.TOGGLE_CONNECT_COMMAND,!n)},title:(n?"Disconnect":"Connect")+" Collaborative Editing","aria-label":(n?"Disconnect from":"Connect to")+" a collaborative editing server"},e.createElement("i",{className:n?"disconnect":"connect"})),d)}const Le=e.createContext([e=>()=>{},e=>{}]),$e=()=>{const[i,o]=e.useContext(Le),[s,t]=e.useState(null);return e.useEffect((()=>i((e=>{t(e)}))),[i]),[s,o]};class Ie extends k.DecoratorNode{static clone(e){return new Ie(e.__key)}static getType(){return"autocomplete"}static importJSON(e){return ze(e.uuid)}exportJSON(){return{...super.exportJSON(),type:"autocomplete",uuid:this.__uuid,version:1}}constructor(e,i){super(i),_e(this,"__uuid",void 0),this.__uuid=e}updateDOM(e,i,o){return!1}createDOM(e){return document.createElement("span")}decorate(){return this.__uuid!==Ye?null:e.createElement(qe,null)}}function ze(e){return new Ie(e)}function qe(){const[i]=$e(),o=window.navigator.userAgentData,s=void 0!==o?o.mobile:window.innerWidth<=800&&window.innerHeight<=600;return e.createElement("span",{style:{color:"#ccc"},spellCheck:"false"},i," ",s?"(SWIPE ⮕)":"(TAB)")}const Ke=new WeakMap;function We(e){const i=e.changedTouches[0];return void 0===i?null:[i.clientX,i.clientY]}function He(e,i){let o=Ke.get(e);if(void 0===o){const i=new Set,s=e=>{void 0!==o&&(o.start=We(e))},t=e=>{if(void 0===o)return;const s=o.start;if(null===s)return;const t=We(e);for(const o of i)null!==t&&o([t[0]-s[0],t[1]-s[1]],e)};e.addEventListener("touchstart",s),e.addEventListener("touchend",t),o={handleTouchend:t,handleTouchstart:s,listeners:i,start:null},Ke.set(e,o)}return o.listeners.add(i),()=>function(e,i){const o=Ke.get(e);if(void 0===o)return;const s=o.listeners;s.delete(i),0===s.size&&(Ke.delete(e),e.removeEventListener("touchstart",o.handleTouchstart),e.removeEventListener("touchend",o.handleTouchend))}(e,i)}const Ye=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5);function Ue(e){if(!k.$isRangeSelection(e)||!e.isCollapsed())return[!1,""];const i=e.getNodes()[0],o=e.anchor;if(!k.$isTextNode(i)||!i.isSimpleText()||!T.$isAtNodeEnd(o))return[!1,""];const s=[],t=i.getTextContent();let n,a=i.getTextContentSize();for(;a--&&a>=0&&" "!==(n=t[a]);)s.push(n);return 0===s.length?[!1,""]:[!0,s.reverse().join("")]}function Je(){const[i]=r.useLexicalComposerContext(),[,o]=$e(),s=e.useCallback((e=>{const i=new Ge;console.time("query");const o=i.query(e);return console.timeEnd("query"),o}),[]);return e.useEffect((()=>{let e=null,t=null,n=null,a=null;function r(){const i=null!==e?k.$getNodeByKey(e):null;null!==i&&i.isAttached()&&(i.remove(),e=null),null!==a&&(a.dismiss(),a=null),t=null,n=null,o(null)}function c(){if(null===n||null===e)return!1;const i=k.$getNodeByKey(e);if(null===i)return!1;const o=k.$createTextNode(n);return i.replace(o),o.selectNext(),r(),!0}function l(e){return!!c()&&(e.preventDefault(),!0)}const d=i.getRootElement();return j.mergeRegister(i.registerNodeTransform(Ie,(function(i){const o=i.getKey();i.__uuid===Ye&&o!==e&&r()})),i.registerUpdateListener((function(){i.update((()=>{const c=k.$getSelection(),[l,d]=Ue(c);l?d!==t&&(r(),a=s(d),a.promise.then((s=>{null!==a&&function(s,r){a===s&&null!==r&&i.update((()=>{const i=k.$getSelection(),[s,a]=Ue(i);if(!s||a!==t||!k.$isRangeSelection(i))return;const c=i.clone(),l=ze(Ye);e=l.getKey(),i.insertNodes([l]),k.$setSelection(c),n=r,o(r)}),{tag:"history-merge"})}(a,s)})).catch((e=>{console.error(e)})),t=d):r()}))})),i.registerCommand(k.KEY_TAB_COMMAND,l,k.COMMAND_PRIORITY_LOW),i.registerCommand(k.KEY_ARROW_RIGHT_COMMAND,l,k.COMMAND_PRIORITY_LOW),...null!==d?[(g=d,m=function(e,o){i.update((()=>{c()&&o.preventDefault()}))},He(g,((e,i)=>{const[o,s]=e;o>0&&o>Math.abs(s)&&m(o,i)})))]:[],(function(){i.update((()=>{r()}))}));var g,m}),[i,s,o]),null}class Ge{constructor(){_e(this,"DATABASE",Xe),_e(this,"LATENCY",200),_e(this,"query",(e=>{let i=!1;return{dismiss:()=>{i=!0},promise:new Promise(((o,s)=>{setTimeout((()=>{if(i)return s("Dismissed");const t=e.length;if(""===e||t<4)return o(null);const n=e.charCodeAt(0),a=n>=65&&n<=90,r=a?String.fromCharCode(n+32)+e.substring(1):e,c=this.DATABASE.find((e=>e.startsWith(r)??null));if(void 0===c)return o(null);const l=(a?String.fromCharCode(c.charCodeAt(0)-32)+c.substring(1):c).substring(t);return o(""===l?null:l)}),this.LATENCY)}))}}))}}const Xe=["information","available","copyright","university","management","international","development","education","community","technology","following","resources","including","directory","government","department","description","insurance","different","categories","conditions","accessories","september","questions","application","financial","equipment","performance","experience","important","activities","additional","something","professional","committee","washington","california","reference","companies","computers","president","australia","discussion","entertainment","agreement","marketing","association","collection","solutions","electronics","technical","microsoft","conference","environment","statement","downloads","applications","requirements","individual","subscribe","everything","production","commercial","advertising","treatment","newsletter","knowledge","currently","construction","registered","protection","engineering","published","corporate","customers","materials","countries","standards","political","advertise","environmental","availability","employment","commission","administration","institute","sponsored","electronic","condition","effective","organization","selection","corporation","executive","necessary","according","particular","facilities","opportunities","appropriate","statistics","investment","christmas","registration","furniture","wednesday","structure","distribution","industrial","potential","responsible","communications","associated","foundation","documents","communication","independent","operating","developed","telephone","population","navigation","operations","therefore","christian","understand","publications","worldwide","connection","publisher","introduction","properties","accommodation","excellent","opportunity","assessment","especially","interface","operation","restaurants","beautiful","locations","significant","technologies","manufacturer","providing","authority","considered","programme","enterprise","educational","employees","alternative","processing","responsibility","resolution","publication","relations","photography","components","assistance","completed","organizations","otherwise","transportation","disclaimer","membership","recommended","background","character","maintenance","functions","trademarks","phentermine","submitted","television","interested","throughout","established","programming","regarding","instructions","increased","understanding","beginning","associates","instruments","businesses","specified","restaurant","procedures","relationship","traditional","sometimes","themselves","transport","interesting","evaluation","implementation","galleries","references","presented","literature","respective","definition","secretary","networking","australian","magazines","francisco","individuals","guidelines","installation","described","attention","difference","regulations","certificate","directions","documentation","automotive","successful","communities","situation","publishing","emergency","developing","determine","temperature","announcements","historical","ringtones","difficult","scientific","satellite","particularly","functional","monitoring","architecture","recommend","dictionary","accounting","manufacturing","professor","generally","continued","techniques","permission","generation","component","guarantee","processes","interests","paperback","classifieds","supported","competition","providers","characters","thousands","apartments","generated","administrative","practices","reporting","essential","affiliate","immediately","designated","integrated","configuration","comprehensive","universal","presentation","languages","compliance","improvement","pennsylvania","challenge","acceptance","strategies","affiliates","multimedia","certified","computing","interactive","procedure","leadership","religious","breakfast","developer","approximately","recommendations","comparison","automatically","minnesota","adventure","institutions","assistant","advertisement","headlines","yesterday","determined","wholesale","extension","statements","completely","electrical","applicable","manufacturers","classical","dedicated","direction","basketball","wisconsin","personnel","identified","professionals","advantage","newsletters","estimated","anonymous","miscellaneous","integration","interview","framework","installed","massachusetts","associate","frequently","discussions","laboratory","destination","intelligence","specifications","tripadvisor","residential","decisions","industries","partnership","editorial","expression","provisions","principles","suggestions","replacement","strategic","economics","compatible","apartment","netherlands","consulting","recreation","participants","favorites","translation","estimates","protected","philadelphia","officials","contained","legislation","parameters","relationships","tennessee","representative","frequency","introduced","departments","residents","displayed","performed","administrator","addresses","permanent","agriculture","constitutes","portfolio","practical","delivered","collectibles","infrastructure","exclusive","originally","utilities","philosophy","regulation","reduction","nutrition","recording","secondary","wonderful","announced","prevention","mentioned","automatic","healthcare","maintained","increasing","connected","directors","participation","containing","combination","amendment","guaranteed","libraries","distributed","singapore","enterprises","convention","principal","certification","previously","buildings","household","batteries","positions","subscription","contemporary","panasonic","permalink","signature","provision","certainly","newspaper","liability","trademark","trackback","americans","promotion","conversion","reasonable","broadband","influence","importance","webmaster","prescription","specifically","represent","conservation","louisiana","javascript","marketplace","evolution","certificates","objectives","suggested","concerned","structures","encyclopedia","continuing","interracial","competitive","suppliers","preparation","receiving","accordance","discussed","elizabeth","reservations","playstation","instruction","annotation","differences","establish","expressed","paragraph","mathematics","compensation","conducted","percentage","mississippi","requested","connecticut","personals","immediate","agricultural","supporting","collections","participate","specialist","experienced","investigation","institution","searching","proceedings","transmission","characteristics","experiences","extremely","verzeichnis","contracts","concerning","developers","equivalent","chemistry","neighborhood","variables","continues","curriculum","psychology","responses","circumstances","identification","appliances","elementary","unlimited","printable","enforcement","hardcover","celebrity","chocolate","hampshire","bluetooth","controlled","requirement","authorities","representatives","pregnancy","biography","attractions","transactions","authorized","retirement","financing","efficiency","efficient","commitment","specialty","interviews","qualified","discovery","classified","confidence","lifestyle","consistent","clearance","connections","inventory","converter","organisation","objective","indicated","securities","volunteer","democratic","switzerland","parameter","processor","dimensions","contribute","challenges","recognition","submission","encourage","regulatory","inspection","consumers","territory","transaction","manchester","contributions","continuous","resulting","cambridge","initiative","execution","disability","increases","contractor","examination","indicates","committed","extensive","affordable","candidate","databases","outstanding","perspective","messenger","tournament","consideration","discounts","catalogue","publishers","caribbean","reservation","remaining","depending","expansion","purchased","performing","collected","absolutely","featuring","implement","scheduled","calculator","significantly","temporary","sufficient","awareness","vancouver","contribution","measurement","constitution","packaging","consultation","northwest","classroom","democracy","wallpaper","merchandise","resistance","baltimore","candidates","charlotte","biological","transition","preferences","instrument","classification","physician","hollywood","wikipedia","spiritual","photographs","relatively","satisfaction","represents","pittsburgh","preferred","intellectual","comfortable","interaction","listening","effectively","experimental","revolution","consolidation","landscape","dependent","mechanical","consultants","applicant","cooperation","acquisition","implemented","directories","recognized","notification","licensing","textbooks","diversity","cleveland","investments","accessibility","sensitive","templates","completion","universities","technique","contractors","subscriptions","calculate","alexander","broadcast","converted","anniversary","improvements","specification","accessible","accessory","typically","representation","arrangements","conferences","uniprotkb","consumption","birmingham","afternoon","consultant","controller","ownership","committees","legislative","researchers","unsubscribe","molecular","residence","attorneys","operators","sustainable","philippines","statistical","innovation","employers","definitions","elections","stainless","newspapers","hospitals","exception","successfully","indonesia","primarily","capabilities","recommendation","recruitment","organized","improving","expensive","organisations","explained","programmes","expertise","mechanism","jewellery","eventually","agreements","considering","innovative","conclusion","disorders","collaboration","detection","formation","engineers","proposals","moderator","tutorials","settlement","collectables","fantastic","governments","purchasing","appointed","operational","corresponding","descriptions","determination","animation","productions","telecommunications","instructor","approaches","highlights","designers","melbourne","scientists","blackjack","argentina","possibility","commissioner","dangerous","reliability","unfortunately","respectively","volunteers","attachment","appointment","workshops","hurricane","represented","mortgages","responsibilities","carefully","productivity","investors","underground","diagnosis","principle","vacations","calculated","appearance","incorporated","notebooks","algorithm","valentine","involving","investing","christopher","admission","terrorism","parliament","situations","allocated","corrections","structural","municipal","describes","disabilities","substance","prohibited","addressed","simulation","initiatives","concentration","interpretation","bankruptcy","optimization","substances","discovered","restrictions","participating","exhibition","composition","nationwide","definitely","existence","commentary","limousines","developments","immigration","destinations","necessarily","attribute","apparently","surrounding","mountains","popularity","postposted","coordinator","obviously","fundamental","substantial","progressive","championship","sacramento","impossible","depression","testimonials","memorabilia","cartridge","explanation","cincinnati","subsection","electricity","permitted","workplace","confirmed","wallpapers","infection","eligibility","involvement","placement","observations","vbulletin","subsequent","motorcycle","disclosure","establishment","presentations","undergraduate","occupation","donations","associations","citysearch","radiation","seriously","elsewhere","pollution","conservative","guestbook","effectiveness","demonstrate","atmosphere","experiment","purchases","federation","assignment","chemicals","everybody","nashville","counseling","acceptable","satisfied","measurements","milwaukee","medication","warehouse","shareware","violation","configure","stability","southwest","institutional","expectations","independence","metabolism","personally","excellence","somewhere","attributes","recognize","screening","thumbnail","forgotten","intelligent","edinburgh","obligation","regardless","restricted","republican","merchants","attendance","arguments","amsterdam","adventures","announcement","appreciate","regularly","mechanisms","customize","tradition","indicators","emissions","physicians","complaint","experiments","afghanistan","scholarship","governance","supplements","camcorder","implementing","ourselves","conversation","capability","producing","precision","contributed","reproduction","ingredients","franchise","complaints","promotions","rehabilitation","maintaining","environments","reception","correctly","consequences","geography","appearing","integrity","discrimination","processed","implications","functionality","intermediate","emotional","platforms","overnight","geographic","preliminary","districts","introduce","promotional","chevrolet","specialists","generator","suspension","correction","authentication","communicate","supplement","showtimes","promoting","machinery","bandwidth","probability","dimension","schedules","admissions","quarterly","illustrated","continental","alternate","achievement","limitations","automated","passenger","convenient","orientation","childhood","flexibility","jurisdiction","displaying","encouraged","cartridges","declaration","automation","advantages","preparing","recipient","extensions","athletics","southeast","alternatives","determining","personalized","conditioning","partnerships","destruction","increasingly","migration","basically","conventional","applicants","occupational","adjustment","treatments","camcorders","difficulty","collective","coalition","enrollment","producers","collector","interfaces","advertisers","representing","observation","restoration","convenience","returning","opposition","container","defendant","confirmation","supervisor","peripherals","bestsellers","departure","minneapolis","interactions","intervention","attraction","modification","customized","understood","assurance","happening","amendments","metropolitan","compilation","verification","attractive","recordings","jefferson","gardening","obligations","orchestra","polyphonic","outsourcing","adjustable","allocation","discipline","demonstrated","identifying","alphabetical","dispatched","installing","voluntary","photographer","messaging","constructed","additions","requiring","engagement","refinance","calendars","arrangement","conclusions","bibliography","compatibility","furthermore","cooperative","measuring","jacksonville","headquarters","transfers","transformation","attachments","administrators","personality","facilitate","subscriber","priorities","bookstore","parenting","incredible","commonwealth","pharmaceutical","manhattan","workforce","organizational","portuguese","everywhere","discharge","halloween","hazardous","methodology","housewares","reputation","resistant","democrats","recycling","qualifications","slideshow","variation","transferred","photograph","distributor","underlying","wrestling","photoshop","gathering","projection","mathematical","specialized","diagnostic","indianapolis","corporations","criticism","automobile","confidential","statutory","accommodations","northeast","downloaded","paintings","injection","yorkshire","populations","protective","initially","indicator","eliminate","sunglasses","preference","threshold","venezuela","exploration","sequences","astronomy","translate","announces","compression","establishing","constitutional","perfectly","instantly","litigation","submissions","broadcasting","horizontal","terrorist","informational","ecommerce","suffering","prospective","ultimately","artificial","spectacular","coordination","connector","affiliated","activation","naturally","subscribers","mitsubishi","underwear","potentially","constraints","inclusive","dimensional","considerable","selecting","processors","pantyhose","difficulties","complexity","constantly","barcelona","presidential","documentary","territories","palestinian","legislature","hospitality","procurement","theoretical","exercises","surveillance","protocols","highlight","substitute","inclusion","hopefully","brilliant","evaluated","assignments","termination","households","authentic","montgomery","architectural","louisville","macintosh","movements","amenities","virtually","authorization","projector","comparative","psychological","surprised","genealogy","expenditure","liverpool","connectivity","algorithms","similarly","collaborative","excluding","commander","suggestion","spotlight","investigate","connecting","logistics","proportion","significance","symposium","essentials","protecting","transmitted","screenshots","intensive","switching","correspondence","supervision","expenditures","separation","testimony","celebrities","mandatory","boundaries","syndication","celebration","filtering","luxembourg","offensive","deployment","colleagues","separated","directive","governing","retailers","occasionally","attending","recruiting","instructional","traveling","permissions","biotechnology","prescribed","catherine","reproduced","calculation","consolidated","occasions","equations","exceptional","respondents","considerations","queensland","musicians","composite","unavailable","essentially","designing","assessments","brunswick","sensitivity","preservation","streaming","intensity","technological","syndicate","antivirus","addressing","discounted","bangladesh","constitute","concluded","desperate","demonstration","governmental","manufactured","graduation","variations","addiction","springfield","synthesis","undefined","unemployment","enhancement","newcastle","performances","societies","brazilian","identical","petroleum","norwegian","retention","exchanges","soundtrack","wondering","profession","separately","physiology","collecting","participant","scholarships","recreational","dominican","friendship","expanding","provincial","investigations","medications","rochester","advertiser","encryption","downloadable","sophisticated","possession","laboratories","vegetables","thumbnails","stockings","respondent","destroyed","manufacture","wordpress","vulnerability","accountability","celebrate","accredited","appliance","compressed","scheduling","perspectives","mortality","christians","therapeutic","impressive","accordingly","architect","challenging","microwave","accidents","relocation","contributors","violations","temperatures","competitions","discretion","cosmetics","repository","concentrations","christianity","negotiations","realistic","generating","christina","congressional","photographic","modifications","millennium","achieving","fisheries","exceptions","reactions","macromedia","companion","divisions","additionally","fellowship","victorian","copyrights","lithuania","mastercard","chronicles","obtaining","distribute","decorative","enlargement","campaigns","conjunction","instances","indigenous","validation","corruption","incentives","cholesterol","differential","scientist","starsmerchant","arthritis","nevertheless","practitioners","transcript","inflation","compounds","contracting","structured","reasonably","graduates","recommends","controlling","distributors","arlington","particles","extraordinary","indicating","coordinate","exclusively","limitation","widescreen","illustration","construct","inquiries","inspiration","affecting","downloading","aggregate","forecasts","complicated","shopzilla","decorating","expressions","shakespeare","connectors","conflicts","travelers","offerings","incorrect","furnishings","guatemala","perception","renaissance","pathology","ordinance","photographers","infections","configured","festivals","possibilities","contributing","analytical","circulation","assumption","jerusalem","transexuales","invention","technician","executives","enquiries","cognitive","exploring","registrar","supporters","withdrawal","predicted","saskatchewan","cancellation","ministers","veterinary","prostores","relevance","incentive","butterfly","mechanics","numerical","reflection","accompanied","invitation","princeton","spirituality","meanwhile","proprietary","childrens","thumbzilla","porcelain","pichunter","translated","columnists","consensus","delivering","journalism","intention","undertaken","statewide","semiconductor","illustrations","happiness","substantially","identifier","calculations","conducting","accomplished","calculators","impression","correlation","fragrance","neighbors","transparent","charleston","champions","selections","projectors","inappropriate","comparing","vocational","pharmacies","introducing","appreciated","albuquerque","distinguished","projected","assumptions","shareholders","developmental","regulated","anticipated","completing","comparable","confusion","copyrighted","warranties","documented","paperbacks","keyboards","vulnerable","reflected","respiratory","notifications","transexual","mainstream","evaluating","subcommittee","maternity","journalists","foundations","volleyball","liabilities","decreased","tolerance","creativity","describing","lightning","quotations","inspector","bookmarks","behavioral","riverside","bathrooms","abilities","initiated","nonprofit","lancaster","suspended","containers","attitudes","simultaneously","integrate","sociology","screenshot","exhibitions","confident","retrieved","officially","consortium","recipients","delicious","traditions","periodically","hungarian","referring","transform","educators","vegetable","humanities","independently","alignment","henderson","britannica","competitors","visibility","consciousness","encounter","resolutions","accessing","attempted","witnesses","administered","strengthen","frederick","aggressive","advertisements","sublimedirectory","disturbed","determines","sculpture","motivation","pharmacology","passengers","quantities","petersburg","consistently","powerpoint","obituaries","punishment","appreciation","subsequently","providence","restriction","incorporate","backgrounds","treasurer","lightweight","transcription","complications","scripting","remembered","synthetic","testament","specifics","partially","wilderness","generations","tournaments","sponsorship","headphones","proceeding","volkswagen","uncertainty","breakdown","reconstruction","subsidiary","strengths","encouraging","furnished","terrorists","comparisons","beneficial","distributions","viewpicture","threatened","republicans","discusses","responded","abstracts","prediction","pharmaceuticals","thesaurus","individually","battlefield","literally","ecological","appraisal","consisting","submitting","citations","geographical","mozambique","disclaimers","championships","sheffield","finishing","wellington","prospects","bulgarian","aboriginal","remarkable","preventing","productive","boulevard","compliant","penalties","imagination","refurbished","activated","conferencing","armstrong","politicians","trackbacks","accommodate","christine","accepting","precipitation","isolation","sustained","approximate","programmer","greetings","inherited","incomplete","chronicle","legitimate","biographies","investigator","plaintiff","prisoners","mediterranean","nightlife","architects","entrepreneur","freelance","excessive","screensaver","valuation","unexpected","cigarette","characteristic","metallica","consequently","appointments","narrative","academics","quantitative","screensavers","subdivision","distinction","livestock","exemption","sustainability","formatting","nutritional","nicaragua","affiliation","relatives","satisfactory","revolutionary","bracelets","telephony","breathing","thickness","adjustments","graphical","discussing","aerospace","meaningful","maintains","shortcuts","voyeurweb","extending","specifies","accreditation","blackberry","meditation","microphone","macedonia","combining","instrumental","organizing","moderators","kazakhstan","standings","partition","invisible","translations","commodity","kilometers","thanksgiving","guarantees","indication","congratulations","cigarettes","controllers","consultancy","conventions","coordinates","responding","physically","stakeholders","hydrocodone","consecutive","attempting","representations","competing","peninsula","accurately","considers","ministries","vacancies","parliamentary","acknowledge","thoroughly","nottingham","identifies","questionnaire","qualification","modelling","miniature","interstate","consequence","systematic","perceived","madagascar","presenting","troubleshooting","uzbekistan","centuries","magnitude","richardson","fragrances","vocabulary","earthquake","fundraising","geological","assessing","introduces","webmasters","computational","acdbentity","participated","handhelds","answering","impressed","conspiracy","organizer","combinations","preceding","cumulative","amplifier","arbitrary","prominent","lexington","contacted","recorders","occasional","innovations","postcards","reviewing","explicitly","transsexual","citizenship","informative","girlfriend","bloomberg","hierarchy","influenced","abandoned","complement","mauritius","checklist","requesting","lauderdale","scenarios","extraction","elevation","utilization","beverages","calibration","efficiently","entertaining","prerequisite","hypothesis","medicines","regression","enhancements","renewable","intersection","passwords","consistency","collectors","azerbaijan","astrology","occurring","supplemental","travelling","induction","precisely","spreading","provinces","widespread","incidence","incidents","enhancing","interference","palestine","listprice","atmospheric","knowledgestorm","referenced","publicity","proposition","allowance","designation","duplicate","criterion","civilization","vietnamese","tremendous","corrected","encountered","internationally","surrounded","creatures","commented","accomplish","vegetarian","newfoundland","investigated","ambassador","stephanie","contacting","vegetation","findarticles","specially","infectious","continuity","phenomenon","conscious","referrals","differently","integrating","revisions","reasoning","charitable","annotated","convinced","burlington","replacing","researcher","watershed","occupations","acknowledged","equilibrium","characterized","privilege","qualifying","estimation","pediatric","techrepublic","institutes","brochures","traveller","appropriations","suspected","benchmark","beginners","instructors","highlighted","stationery","unauthorized","competent","contributor","demonstrates","gradually","desirable","journalist","afterwards","religions","explosion","signatures","disciplines","daughters","conversations","simplified","motherboard","bibliographic","champagne","deviation","superintendent","housewives","influences","inspections","irrigation","hydraulic","robertson","penetration","conviction","omissions","retrieval","qualities","prototype","importantly","apparatus","explaining","nomination","empirical","dependence","sexuality","polyester","commitments","suggesting","remainder","privileges","televisions","specializing","commodities","motorcycles","concentrate","reproductive","molecules","refrigerator","intervals","sentences","exclusion","workstation","holocaust","receivers","disposition","navigator","investigators","marijuana","cathedral","fairfield","fascinating","landscapes","lafayette","computation","cardiovascular","salvation","predictions","accompanying","selective","arbitration","configuring","editorials","sacrifice","removable","convergence","gibraltar","anthropology","malpractice","reporters","necessity","rendering","hepatitis","nationally","waterproof","specialties","humanitarian","invitations","functioning","economies","alexandria","bacterial","undertake","continuously","achievements","convertible","secretariat","paragraphs","adolescent","nominations","cancelled","introductory","reservoir","occurrence","worcester","demographic","disciplinary","respected","portraits","interpreted","evaluations","elimination","hypothetical","immigrants","complimentary","helicopter","performer","commissions","powerseller","graduated","surprising","unnecessary","dramatically","yugoslavia","characterization","likelihood","fundamentals","contamination","endangered","compromise","expiration","namespace","peripheral","negotiation","opponents","nominated","confidentiality","electoral","changelog","alternatively","greensboro","controversial","recovered","upgrading","frontpage","demanding","defensive","forbidden","programmers","monitored","installations","deutschland","practitioner","motivated","smithsonian","examining","revelation","delegation","dictionaries","greenhouse","transparency","currencies","survivors","positioning","descending","temporarily","frequencies","reflections","municipality","detective","experiencing","fireplace","endorsement","psychiatry","persistent","summaries","looksmart","magnificent","colleague","adaptation","paintball","enclosure","supervisors","westminster","distances","absorption","treasures","transcripts","disappointed","continually","communist","collectible","entrepreneurs","creations","acquisitions","biodiversity","excitement","presently","mysterious","librarian","subsidiaries","stockholm","indonesian","therapist","promising","relaxation","thereafter","commissioners","forwarding","nightmare","reductions","southampton","organisms","telescope","portsmouth","advancement","harassment","generators","generates","replication","inexpensive","receptors","interventions","huntington","internship","aluminium","snowboard","beastality","evanescence","coordinated","shipments","antarctica","chancellor","controversy","legendary","beautifully","antibodies","examinations","immunology","departmental","terminology","gentleman","reproduce","convicted","roommates","threatening","spokesman","activists","frankfurt","encourages","assembled","restructuring","terminals","simulations","sufficiently","conditional","crossword","conceptual","liechtenstein","translator","automobiles","continent","longitude","challenged","telecharger","insertion","instrumentation","constraint","groundwater","strengthening","insulation","infringement","subjective","swaziland","varieties","mediawiki","configurations"];function Ve({"data-test-id":i,children:o}){return e.createElement("div",{className:"DialogActions","data-test-id":i},o)}function Ze({className:i,format:o,nodeKey:s,documentID:t}){return e.createElement(x.BlockWithAlignableContents,{className:i,format:o,nodeKey:s},e.createElement("iframe",{width:"560",height:"315",src:`https://www.figma.com/embed?embed_host=lexical&url= https://www.figma.com/file/${t}`,allowFullScreen:!0}))}class Qe extends S.DecoratorBlockNode{static getType(){return"figma"}static clone(e){return new Qe(e.__id,e.__format,e.__key)}static importJSON(e){const i=ei(e.documentID);return i.setFormat(e.format),i}exportJSON(){return{...super.exportJSON(),documentID:this.__id,type:"figma",version:1}}constructor(e,i,o){super(i,o),_e(this,"__id",void 0),this.__id=e}updateDOM(){return!1}getId(){return this.__id}getTextContent(e,i){return`https://www.figma.com/file/${this.__id}`}decorate(i,o){const s=o.theme.embedBlock||{},t={base:s.base||"",focus:s.focus||""};return e.createElement(Ze,{className:t,format:this.__format,nodeKey:this.getKey(),documentID:this.__id})}isInline(){return!1}}function ei(e){return new Qe(e)}const ii=k.createCommand("INSERT_FIGMA_COMMAND");function oi(){const[i]=r.useLexicalComposerContext();return e.useEffect((()=>{if(!i.hasNodes([Qe]))throw new Error("FigmaPlugin: FigmaNode not registered on editor");return i.registerCommand(ii,(e=>{const i=ei(e);return j.$insertNodeToNearestRoot(i),!0}),k.COMMAND_PRIORITY_EDITOR)}),[i]),null}function si({className:i,format:o,nodeKey:s,data:t}){const{url:n,id:a}=t,r=n.split("."),c=r[r.length-1]?.toLowerCase();let l=n.split("/").pop()||"Open Document";l=l.length>25?l.slice(0,25)+"..."+c:l;return e.createElement(x.BlockWithAlignableContents,{className:i,format:o,nodeKey:s},e.createElement("p",null,e.createElement("a",{href:`https://view.officeapps.live.com/op/view.aspx?src=${n}`,target:"_blank",rel:a,title:a},e.createElement("span",{"data-lexical-text":"true",style:{backgroundColor:"rgb(140, 116, 247)",borderRadius:"8px",color:"white",display:"inline-block",fontFamily:"Arial, sans-serif",fontWeight:"bold",padding:"6px",textDecoration:"none",height:"30px",width:"250px"},title:a},l)),"  "))}function ti(e){const i=e.getAttribute("data-lexical-office-url"),o=e.getAttribute("data-lexical-office-id");if(i&&o){return{node:ai({url:i,id:o})}}return null}class ni extends S.DecoratorBlockNode{static getType(){return"office"}static clone(e){return new ni(e.__data,e.__format,e.__key)}static importJSON(e){const i=ai(e.data);return i.setFormat(e.format),i