@orangecatai/adgen-canvas 0.0.35 → 0.0.36

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.
@@ -1,7 +1,7 @@
1
- import{$ as Ab,A as zR,B as JE,C as QE,D as Wp,E as Id,F as Kp,G as Yp,H as Td,I as e2,J as t2,K as o2,L as Wa,M as sl,N as n2,O as UR,P as rs,Q as ll,R as kd,T as r2,V as a2,W as i2,X as Xp,Y as s2,Z as Pb,_ as Ka,a as XE,aa as cl,b as ns,ba as l2,c as Ir,ca as Lb,d as jE,da as as,e as ft,ea as c2,f as ZE,fa as _b,g as Me,ga as d2,h as ol,ha as sr,i as Tr,ia as m2,j as yd,ja as jp,k as wd,ka as Db,l as nl,la as p2,m as vd,ma as u2,n as rl,na as g2,o as qE,oa as Cd,p as Sb,q as kr,r as Rn,s as Va,t as tn,u as sa,v as al,w as il,x as Mb,y as Ed,z as Vp}from"./chunk-R3CESCMK.js";import{a as C}from"./chunk-TE4JIU3E.js";import{M as Cb}from"./chunk-CLQPYXMS.js";import{c as YE}from"./chunk-3PELD44J.js";import{b as WE,c as KE,d as D}from"./chunk-SRAX5OIU.js";import Vae,{useEffect as Wae,useMemo as Kae}from"react";import{DEFAULT_UI_OPTIONS as OR,isShallowEqual as Yae}from"@orangecatai/common";import C_ from"clsx";import Ute from"lodash.throttle";import na,{useContext as ji}from"react";import{flushSync as mn}from"react-dom";import Hte from"roughjs/bin/rough";import{nanoid as Cv}from"nanoid";import{clamp as S_,pointFrom as Ae,pointDistance as $i,vector as M_,pointRotateRads as Sv,vectorFromPoint as Mv,vectorSubtract as P_,vectorDot as A_,vectorNormalize as L_}from"@orangecatai/math";import{COLOR_PALETTE as Gte,CODES as __,shouldResizeFromCenter as D_,shouldMaintainAspectRatio as fp,shouldRotateWithDiscreteAngle as R_,isArrowKey as Gf,KEYS as he,APP_NAME as $te,CURSOR_TYPE as Ft,DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT as Vte,DEFAULT_VERTICAL_ALIGN as N_,DRAGGING_THRESHOLD as B_,ELEMENT_SHIFT_TRANSLATE_AMOUNT as Wte,ELEMENT_TRANSLATE_AMOUNT as F_,EVENT as Be,FRAME_STYLE as Pn,IMAGE_MIME_TYPES as Kte,IMAGE_RENDER_TIMEOUT as Yte,LINE_CONFIRM_THRESHOLD as Pv,MAX_ALLOWED_FILE_BYTES as O_,MIME_TYPES as qr,MQ_RIGHT_SIDEBAR_MIN_WIDTH as Xte,POINTER_BUTTON as Ra,ROUNDNESS as $f,SCROLL_TIMEOUT as jte,TAP_TWICE_TIMEOUT as Zte,TEXT_TO_CENTER_SNAP_THRESHOLD as qte,THEME as Vf,TOUCH_CTX_MENU_TIMEOUT as Jte,VERTICAL_ALIGN as Qte,YOUTUBE_STATES as Wf,ZOOM_STEP as eoe,POINTER_EVENTS as Vi,TOOL_TYPE as Jr,supportsResizeObserver as toe,DEFAULT_COLLISION_THRESHOLD as z_,DEFAULT_TEXT_ALIGN as ooe,ARROW_TYPE as Wi,DEFAULT_REDUCED_GLOBAL_ALPHA as U_,isLocalLink as noe,normalizeLink as Av,toValidURL as roe,getGridPoint as Ao,getLineHeight as H_,debounce as G_,distance as ld,getFontString as Lv,getNearestScrollableContainer as aoe,isInputLike as $_,isToolIcon as ioe,isWritableElement as bp,sceneCoordsToViewportCoords as xp,tupleToCoors as _v,viewportCoordsToSceneCoords as At,wrapEvent as soe,updateObject as Dv,updateActiveTool as Qr,isTransparent as loe,easeToValuesRAF as coe,muteFSAbortError as doe,isTestEnv as CD,isDevEnv as SD,easeOut as moe,updateStable as yp,addEventListener as Vt,normalizeEOL as poe,getDateTime as V_,isShallowEqual as W_,arrayToMap as wp,applyDarkModeFilter as uoe,randomInteger as goe,CLASSES as Rv,Emitter as js,MINIMUM_ARROW_SIZE as hoe,DOUBLE_TAP_POSITION_THRESHOLD as foe,BIND_MODE_TIMEOUT as boe,invariant as ea,getFeatureFlag as Na,createUserAgentDescriptor as MD,getFormFactor as xoe,deriveStylesPanelMode as Qf,isIOS as yoe,isBrave as woe,isSafari as voe,loadDesktopUIModePreference as Eoe,setDesktopUIMode as Ioe,isSelectionLikeTool as Kf,oneOf as K_}from"@orangecatai/common";import{getObservedAppState as Toe,getCommonBounds as cd,getElementAbsoluteCoords as Yf,bindOrUnbindBindingElements as Y_,fixBindingsAfterDeletion as koe,getHoveredElementForBinding as wr,isBindingEnabled as vp,shouldEnableBindingForPointerEvent as Coe,updateBoundElements as Xf,LinearElementEditor as st,newElementWith as ta,newFrameElement as Nv,newFreeDrawElement as Soe,newEmbeddableElement as X_,newMagicFrameElement as j_,newIframeElement as Moe,newArrowElement as Poe,newElement as Aoe,newImageElement as Bv,newVideoElement as Z_,newLinearElement as Loe,newTextElement as q_,refreshTextDimensions as _oe,deepCopyElement as J_,duplicateElements as Fv,hasBoundTextElement as Q_,isArrowElement as dd,isBindingElement as oa,isBindingElementType as Doe,isBoundToContainer as Ov,isFrameLikeElement as Io,isImageElement as Ki,isVideoElement as Roe,isEmbeddableElement as Ba,isInitializedImageElement as Ep,isLinearElement as qo,isLinearElementType as Noe,isUsingAdaptiveRadius as Boe,isIframeElement as md,isIframeLikeElement as zv,isMagicFrameElement as Uv,isTextBindableContainer as eD,isElbowArrow as pn,isFlowchartNodeElement as Foe,isBindableElement as Hv,isTextElement as vr,getNormalizedDimensions as Ooe,isElementCompletelyInViewport as Gv,isElementInViewport as $v,isInvisiblySmallElement as tD,getCornerRadius as zoe,isPathALoop as oD,createSrcDoc as nD,embeddableURLValidator as Vv,maybeParseEmbedSrc as Uoe,getEmbedLink as jf,getInitializedImageElements as Hoe,normalizeSVG as rD,updateImageCache as Goe,getBoundTextElement as Wv,getContainerCenter as Kv,getContainerElement as aD,isValidTextContainer as $oe,redrawTextBoundingBox as Voe,hasBoundingBox as Woe,getFrameChildren as Yv,isCursorInFrame as iD,addElementsToFrame as Xv,replaceAllElementsInFrame as Koe,removeElementsFromFrame as Yoe,getElementsInResizingFrame as jv,getElementsInNewFrame as Xoe,getContainingFrame as Zf,orderFramesToBack as joe,elementOverlapsWithFrame as Zoe,updateFrameMembershipOfSelectedElements as sD,isElementInFrame as lD,getFrameLikeTitle as qoe,getElementsOverlappingFrame as Joe,filterElementsEligibleAsFrameChildren as Qoe,hitElementBoundText as ene,hitElementBoundingBoxOnly as tne,hitElementItself as Ip,getVisibleSceneBounds as one,FlowChartCreator as nne,FlowChartNavigator as rne,getLinkDirectionFromKey as cD,cropElement as ane,wrapText as ine,isElementLink as Zv,parseElementLinkFromURL as sne,isMeasureTextSupported as lne,normalizeText as cne,measureText as dD,getLineHeightInPx as dne,getApproxMinLineWidth as mne,getApproxMinLineHeight as pne,getMinTextElementWidth as une,ShapeCache as Tp,getRenderOpacity as mD,editGroupForSelectedElement as gne,getElementsInGroup as Zs,getSelectedGroupIdForElement as hne,getSelectedGroupIds as fne,isElementInGroup as pD,isSelectedViaGroup as bne,selectGroupsForSelectedElements as or,syncInvalidIndices as PD,syncMovedIndices as uD,excludeElementsInFramesFromSelection as xne,getSelectionStateForElements as yne,makeNextSelectedElementIds as gt,getResizeOffsetXY as wne,getResizeArrowDirection as vne,transformElements as Ene,getCursorForResizingElement as gD,getElementWithTransformHandleType as hD,getTransformHandleTypeFromCoords as fD,dragNewElement as bD,dragSelectedElements as Ine,getDragOffsetXY as Tne,isNonDeletedElement as xD,Scene as yD,Store as kne,CaptureUpdateAction as Lo,hitElementBoundingBox as Cne,isLineElement as qv,isSimpleArrow as Jv,StoreDelta as wD,positionElementsOnGrid as Qv,calculateFixedPointForNonElbowArrowBinding as vD,bindOrUnbindBindingElement as Sne,mutateElement as qf,getElementBounds as ED,doBoundsIntersect as Mne,isPointInElement as Pne,maxBindingDistance_simple as eE,convertToExcalidrawElements as ID,getSnapOutlineMidPoint as tE,handleFocusPointDrag as Ane,handleFocusPointHover as Lne,handleFocusPointPointerDown as _ne,handleFocusPointPointerUp as Dne,maybeHandleArrowPointlikeDrag as Jf,getUncroppedWidthAndHeight as Rne}from"@orangecatai/element";import{KEYS as a0,MOBILE_ACTION_BUTTON_BG as QR,updateActiveTool as e8}from"@orangecatai/common";import{getNonDeletedElements as i0}from"@orangecatai/element";import{fixBindingsAfterDeletion as t8}from"@orangecatai/element";import{LinearElementEditor as gT}from"@orangecatai/element";import{newElementWith as bu}from"@orangecatai/element";import{getContainerElement as hT}from"@orangecatai/element";import{isBoundToContainer as hu,isElbowArrow as o8,isFrameLikeElement as n8}from"@orangecatai/element";import{getFrameChildren as r8}from"@orangecatai/element";import{getElementsInGroup as s0,selectGroupsForSelectedElements as a8}from"@orangecatai/element";import{CaptureUpdateAction as fu}from"@orangecatai/element";import{isDevEnv as VR}from"@orangecatai/common";import{atom as je,createStore as HR}from"jotai";import{createIsolation as GR}from"jotai-scope";var h2=GR();var{useAtom:ve,useSetAtom:Cr,useAtomValue:dl,useStore:Qae}=h2,f2=h2.Provider,Yt=HR();var $R=WE({"./locales/ar-SA.json":()=>import("./locales/ar-SA-NXDWD63E.js"),"./locales/az-AZ.json":()=>import("./locales/az-AZ-MXSORGZV.js"),"./locales/bg-BG.json":()=>import("./locales/bg-BG-O6MV2KSF.js"),"./locales/bn-BD.json":()=>import("./locales/bn-BD-T2VJNT7N.js"),"./locales/bn-IN.json":()=>import("./locales/bn-IN-MMW2ORAC.js"),"./locales/ca-ES.json":()=>import("./locales/ca-ES-MKBCGNOG.js"),"./locales/cs-CZ.json":()=>import("./locales/cs-CZ-V77HGUP7.js"),"./locales/da-DK.json":()=>import("./locales/da-DK-I5RFNTM4.js"),"./locales/de-CH.json":()=>import("./locales/de-CH-WLRDEVBV.js"),"./locales/de-DE.json":()=>import("./locales/de-DE-DTI4WUSC.js"),"./locales/el-GR.json":()=>import("./locales/el-GR-ZXDJ2OS4.js"),"./locales/en.json":()=>import("./locales/en-ZZURI326.js"),"./locales/es-ES.json":()=>import("./locales/es-ES-DYQHAD43.js"),"./locales/eu-ES.json":()=>import("./locales/eu-ES-QDSYU5Y3.js"),"./locales/fa-IR.json":()=>import("./locales/fa-IR-26LZG4PM.js"),"./locales/fi-FI.json":()=>import("./locales/fi-FI-6YS4KDE4.js"),"./locales/fr-FR.json":()=>import("./locales/fr-FR-BRLLPTZC.js"),"./locales/gl-ES.json":()=>import("./locales/gl-ES-OKUZTLYG.js"),"./locales/he-IL.json":()=>import("./locales/he-IL-26MGYIU7.js"),"./locales/hi-IN.json":()=>import("./locales/hi-IN-Q4ZOGTP2.js"),"./locales/hu-HU.json":()=>import("./locales/hu-HU-P2OXPSN5.js"),"./locales/id-ID.json":()=>import("./locales/id-ID-2EIKXYN6.js"),"./locales/it-IT.json":()=>import("./locales/it-IT-4CFKVXI2.js"),"./locales/ja-JP.json":()=>import("./locales/ja-JP-MAND2Z4V.js"),"./locales/kaa.json":()=>import("./locales/kaa-HQRTCXTJ.js"),"./locales/kab-KAB.json":()=>import("./locales/kab-KAB-JKIKKTGH.js"),"./locales/kk-KZ.json":()=>import("./locales/kk-KZ-HXQ63ZFC.js"),"./locales/km-KH.json":()=>import("./locales/km-KH-PKL3LSGX.js"),"./locales/ko-KR.json":()=>import("./locales/ko-KR-KXLREZX3.js"),"./locales/ku-TR.json":()=>import("./locales/ku-TR-MJ4IER3X.js"),"./locales/lt-LT.json":()=>import("./locales/lt-LT-H6WFQ6FJ.js"),"./locales/lv-LV.json":()=>import("./locales/lv-LV-GOCK6SJW.js"),"./locales/mr-IN.json":()=>import("./locales/mr-IN-IXVLDMEQ.js"),"./locales/my-MM.json":()=>import("./locales/my-MM-YG6MYTTD.js"),"./locales/nb-NO.json":()=>import("./locales/nb-NO-XGWJISD2.js"),"./locales/nl-NL.json":()=>import("./locales/nl-NL-XVDVCPNC.js"),"./locales/nn-NO.json":()=>import("./locales/nn-NO-EMX5MJX5.js"),"./locales/oc-FR.json":()=>import("./locales/oc-FR-ROEINTVO.js"),"./locales/pa-IN.json":()=>import("./locales/pa-IN-ZYN6SUDY.js"),"./locales/percentages.json":()=>import("./locales/percentages-5DKR754L.js"),"./locales/pl-PL.json":()=>import("./locales/pl-PL-6VTG7PHC.js"),"./locales/pt-BR.json":()=>import("./locales/pt-BR-5YFKRR5G.js"),"./locales/pt-PT.json":()=>import("./locales/pt-PT-GEIXXZ67.js"),"./locales/ro-RO.json":()=>import("./locales/ro-RO-E2P6TFZI.js"),"./locales/ru-RU.json":()=>import("./locales/ru-RU-YBIIY43T.js"),"./locales/si-LK.json":()=>import("./locales/si-LK-673C2CI2.js"),"./locales/sk-SK.json":()=>import("./locales/sk-SK-CKZHQ4AP.js"),"./locales/sl-SI.json":()=>import("./locales/sl-SI-557H2GWM.js"),"./locales/sv-SE.json":()=>import("./locales/sv-SE-XOPKKDWS.js"),"./locales/ta-IN.json":()=>import("./locales/ta-IN-XBH7DQI3.js"),"./locales/th-TH.json":()=>import("./locales/th-TH-TOCWH3R4.js"),"./locales/tr-TR.json":()=>import("./locales/tr-TR-GXW6CYY5.js"),"./locales/uk-UA.json":()=>import("./locales/uk-UA-IJKTNUDG.js"),"./locales/uz-UZ.json":()=>import("./locales/uz-UZ-TBZZEA4V.js"),"./locales/vi-VN.json":()=>import("./locales/vi-VN-MULSGNVB.js"),"./locales/zh-CN.json":()=>import("./locales/zh-CN-MVX3E32U.js"),"./locales/zh-HK.json":()=>import("./locales/zh-HK-JNU5RLIE.js"),"./locales/zh-TW.json":()=>import("./locales/zh-TW-LENVCA6T.js")});var WR=85,Sr={code:"en",label:"English"},pl=[Sr,...[{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",rtl:!0},{code:"bg-BG",label:"\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438"},{code:"ca-ES",label:"Catal\xE0"},{code:"cs-CZ",label:"\u010Cesky"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",label:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC"},{code:"es-ES",label:"Espa\xF1ol"},{code:"eu-ES",label:"Euskara"},{code:"fa-IR",label:"\u0641\u0627\u0631\u0633\u06CC",rtl:!0},{code:"fi-FI",label:"Suomi"},{code:"fr-FR",label:"Fran\xE7ais"},{code:"gl-ES",label:"Galego"},{code:"he-IL",label:"\u05E2\u05D1\u05E8\u05D9\u05EA",rtl:!0},{code:"hi-IN",label:"\u0939\u093F\u0928\u094D\u0926\u0940"},{code:"hu-HU",label:"Magyar"},{code:"id-ID",label:"Bahasa Indonesia"},{code:"it-IT",label:"Italiano"},{code:"ja-JP",label:"\u65E5\u672C\u8A9E"},{code:"kab-KAB",label:"Taqbaylit"},{code:"kk-KZ",label:"\u049A\u0430\u0437\u0430\u049B \u0442\u0456\u043B\u0456"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4"},{code:"ku-TR",label:"Kurd\xEE"},{code:"lt-LT",label:"Lietuvi\u0173"},{code:"lv-LV",label:"Latvie\u0161u"},{code:"my-MM",label:"Burmese"},{code:"nb-NO",label:"Norsk bokm\xE5l"},{code:"nl-NL",label:"Nederlands"},{code:"nn-NO",label:"Norsk nynorsk"},{code:"oc-FR",label:"Occitan"},{code:"pa-IN",label:"\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40"},{code:"pl-PL",label:"Polski"},{code:"pt-BR",label:"Portugu\xEAs Brasileiro"},{code:"pt-PT",label:"Portugu\xEAs"},{code:"ro-RO",label:"Rom\xE2n\u0103"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439"},{code:"sk-SK",label:"Sloven\u010Dina"},{code:"sv-SE",label:"Svenska"},{code:"sl-SI",label:"Sloven\u0161\u010Dina"},{code:"tr-TR",label:"T\xFCrk\xE7e"},{code:"uk-UA",label:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430"},{code:"zh-CN",label:"\u7B80\u4F53\u4E2D\u6587"},{code:"zh-TW",label:"\u7E41\u9AD4\u4E2D\u6587"},{code:"vi-VN",label:"Ti\u1EBFng Vi\u1EC7t"},{code:"mr-IN",label:"\u092E\u0930\u093E\u0920\u0940"}].filter(e=>YE[e.code]>=WR).sort((e,t)=>e.label>t.label?1:-1)],qp="__test__";VR()&&pl.unshift({code:qp,label:"test language"},{code:`${qp}.rtl`,label:"\u202Atest language (rtl)\u202C",rtl:!0});var ml=Sr,Zp={},Jp=async e=>{if(ml=e,document.documentElement.dir=ml.rtl?"rtl":"ltr",document.documentElement.lang=ml.code,e.code.startsWith(qp))Zp={};else try{Zp=await $R(`./locales/${ml.code}.json`)}catch(t){console.error(`Failed to load language ${e.code}:`,t.message),Zp=Cb}Yt.set(x2,e.code)},la=()=>ml,b2=(e,t)=>{for(let o=0;o<t.length;++o){let n=t[o];if(e[n]===void 0)return;e=e[n]}if(typeof e=="string")return e},b=(e,t,o)=>{if(ml.code.startsWith(qp))return`\u202A[[${t?`${e}(${JSON.stringify(t).slice(1,-1)})`:e}]]\u202C`;let n=e.split("."),r=b2(Zp,n)||b2(Cb,n)||o;if(r===void 0){let a=`Can't find translation for ${e}`;if(C.PROD)return console.warn(a),"";throw new Error(a)}if(t)for(let a in t)r=r.replace(`{{${a}}}`,String(t[a]));return r},x2=je(Sr.code),bt=()=>{let e=dl(x2);return{t:b,langCode:e}};import KR from"clsx";import go from"react";import{THEME as YR}from"@orangecatai/common";import{Fragment as xt,jsx as x,jsxs as W}from"react/jsx-runtime";var lr=e=>"var(--icon-fill-color)",y2=e=>e===YR.LIGHT?"#fff":"#1e1e1e",N=(e,t=512)=>{let{width:o=512,height:n=o,mirror:r,style:a,...i}=typeof t=="number"?{width:t}:t;return x("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:`0 0 ${o} ${n}`,className:KR({"rtl-mirror":r}),style:a,...i,children:typeof e=="string"?x("path",{fill:"currentColor",d:e}):e})},te={width:24,height:24,fill:"none",strokeWidth:2,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},ze={width:20,height:20,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},gie=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("rect",{x:3,y:8,width:18,height:4,rx:1}),x("line",{x1:12,y1:8,x2:12,y2:21}),x("path",{d:"M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7"}),x("path",{d:"M7.5 8a2.5 2.5 0 0 1 0 -5a4.8 8 0 0 1 4.5 5a4.8 8 0 0 1 4.5 -5a2.5 2.5 0 0 1 0 5"})]}),te),Qp=N(W("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),x("path",{d:"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),x("line",{x1:"3",y1:"6",x2:"3",y2:"19"}),x("line",{x1:"12",y1:"6",x2:"12",y2:"19"}),x("line",{x1:"21",y1:"6",x2:"21",y2:"19"})]}),te),w2=N(W("svg",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),x("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),te),v2=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"12",cy:"12",r:"1"}),x("circle",{cx:"12",cy:"19",r:"1"}),x("circle",{cx:"12",cy:"5",r:"1"})]}),te),E2=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),x("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),x("path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]}),te),I2=N(W("svg",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M9 4v6l-2 4v2h10v-2l-2 -4v-6"}),x("line",{x1:"12",y1:"16",x2:"12",y2:"21"}),x("line",{x1:"8",y1:"4",x2:"16",y2:"4"})]}),te),Rb=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M6.5 9.5l3.5 -3"}),x("path",{d:"M14 5.5l3 1.5"}),x("path",{d:"M18.5 10l-2.5 7"}),x("path",{d:"M13.5 17.5l-7 -5"})]}),te),is=N(W("g",{children:[x("path",{d:"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z",stroke:"currentColor",strokeWidth:"1.25"}),x("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z",stroke:"currentColor",strokeWidth:"1.25"}),x("mask",{id:"UnlockedIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:6,y:1,width:9,height:9,children:x("path",{stroke:"none",d:"M6.399 9.561V5.175c0-.93.401-1.823 1.116-2.48a3.981 3.981 0 0 1 2.693-1.028c1.01 0 1.98.37 2.694 1.027.715.658 1.116 1.55 1.116 2.481",fill:"#fff"})}),x("g",{mask:"url(#UnlockedIcon)",children:x("path",{stroke:"none",d:"M5.149 9.561v1.25h2.5v-1.25h-2.5Zm5.06-7.894V.417v1.25Zm2.559 3.508v1.25h2.5v-1.25h-2.5ZM7.648 8.51V5.175h-2.5V8.51h2.5Zm0-3.334c0-.564.243-1.128.713-1.561L6.668 1.775c-.959.883-1.52 2.104-1.52 3.4h2.5Zm.713-1.561a2.732 2.732 0 0 1 1.847-.697v-2.5c-1.31 0-2.585.478-3.54 1.358L8.36 3.614Zm1.847-.697c.71 0 1.374.26 1.847.697l1.694-1.839a5.231 5.231 0 0 0-3.54-1.358v2.5Zm1.847.697c.47.433.713.997.713 1.561h2.5c0-1.296-.56-2.517-1.52-3.4l-1.693 1.839Z",fill:"currentColor"})})]}),ze),ul=N(W("g",{strokeWidth:"1.25",children:[x("path",{d:"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z"}),x("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z"}),x("path",{d:"M6.667 8.333V5.417C6.667 3.806 8.159 2.5 10 2.5c1.841 0 3.333 1.306 3.333 2.917v2.916"})]}),ze),T2=N(x("g",{fill:"currentColor",children:x("path",{d:"M12 2a5 5 0 0 1 5 5v3a3 3 0 0 1 3 3v6a3 3 0 0 1 -3 3h-10a3 3 0 0 1 -3 -3v-6a3 3 0 0 1 3 -3v-3a5 5 0 0 1 5 -5m0 12a2 2 0 0 0 -1.995 1.85l-.005 .15a2 2 0 1 0 2 -2m0 -10a3 3 0 0 0 -3 3v3h6v-3a3 3 0 0 0 -3 -3"})}),{width:24,height:24}),k2=N(W(xt,{children:[x("path",{d:"M38.5 83.5c-14-2-17.833-10.473-21-22.5C14.333 48.984 12 22 12 12.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z",fill:"currentColor"}),x("path",{d:"M12.005 10.478c1.92 3.495 3.838 7 7.905 14.423m-7.905-14.423c3.11 5.683 6.23 11.368 7.905 14.423m0 0c-3.68.226-7.35.455-13.91.85m13.91-.85c-5.279.33-10.566.647-13.91.85m0 0c1.936-4.931 3.882-9.86 6.005-15.273M6 25.75c2.069-5.257 4.135-10.505 6.005-15.272",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:41,height:94,fill:"none"}),C2=N(W(xt,{children:[x("path",{d:"M18.026 1.232c-5.268 13.125-5.548 33.555 3.285 42.311 8.823 8.75 33.31 12.304 42.422 13.523",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m72.181 59.247-13.058-10-2.948 13.62 16.006-3.62Z",fill:"currentColor"}),x("path",{d:"M72.181 59.247c-3.163-2.429-6.337-4.856-13.058-10m13.058 10c-5.145-3.936-10.292-7.882-13.058-10m0 0c-.78 3.603-1.563 7.196-2.948 13.62m2.948-13.62c-1.126 5.168-2.24 10.346-2.948 13.62m0 0c5.168-1.166 10.334-2.343 16.006-3.62m-16.006 3.62c5.51-1.248 11.01-2.495 16.006-3.62",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:85,height:71,fill:"none"}),S2=N(W(xt,{children:[x("path",{d:"M1 77c14-2 31.833-11.973 35-24 3.167-12.016-6-35-9.5-43.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m24.165 1.093-2.132 16.309 13.27-4.258-11.138-12.05Z",fill:"currentColor"}),x("path",{d:"M24.165 1.093c-.522 3.953-1.037 7.916-2.132 16.309m2.131-16.309c-.835 6.424-1.68 12.854-2.13 16.308m0 0c3.51-1.125 7.013-2.243 13.27-4.257m-13.27 4.257c5.038-1.608 10.08-3.232 13.27-4.257m0 0c-3.595-3.892-7.197-7.777-11.14-12.05m11.14 12.05c-3.837-4.148-7.667-8.287-11.14-12.05",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:38,height:78,fill:"none"}),hie=N(x("g",{fill:"currentColor",children:x("path",{d:"M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z",fill:"currentColor"})}),{width:40,height:40,fill:"none"}),ss=N(W("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 6l4.153 11.793a0.365 .365 0 0 0 .331 .207a0.366 .366 0 0 0 .332 -.207l2.184 -4.793l4.787 -1.994a0.355 .355 0 0 0 .213 -.323a0.355 .355 0 0 0 -.213 -.323l-11.787 -4.36z"}),x("path",{d:"M13.5 13.5l4.5 4.5"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),Ya=N(W("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,children:[x("path",{d:"M4.028 13.252c-.657 -.972 -1.028 -2.078 -1.028 -3.252c0 -3.866 4.03 -7 9 -7s9 3.134 9 7s-4.03 7 -9 7c-1.913 0 -3.686 -.464 -5.144 -1.255"}),x("path",{d:"M5 15m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M5 17c0 1.42 .316 2.805 1 4"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),gl=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})]}),te),hl=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M10.5 20.4l-6.9 -6.9c-.781 -.781 -.781 -2.219 0 -3l6.9 -6.9c.781 -.781 2.219 -.781 3 0l6.9 6.9c.781 .781 .781 2.219 0 3l-6.9 6.9c-.781 .781 -2.219 .781 -3 0z"})]}),te),fl=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"12",cy:"12",r:"9"})]}),te),eu=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),x("line",{x1:"15",y1:"16",x2:"19",y2:"12"}),x("line",{x1:"15",y1:"8",x2:"19",y2:"12"})]}),te),bl=N(x("path",{d:"M4.167 10h11.666",strokeWidth:"1.5"}),ze),M2=N(W("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z"}),x("path",{d:"M16 7h4"}),x("path",{d:"M18 19h-13a2 2 0 1 1 0 -4h4a2 2 0 1 0 0 -4h-3"})]}),te),Mr=N(W("g",{strokeWidth:"1.25",children:[x("path",{clipRule:"evenodd",d:"m7.643 15.69 7.774-7.773a2.357 2.357 0 1 0-3.334-3.334L4.31 12.357a3.333 3.333 0 0 0-.977 2.357v1.953h1.953c.884 0 1.732-.352 2.357-.977Z"}),x("path",{d:"m11.25 5.417 3.333 3.333"})]}),ze),Pr=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"20",x2:"7",y2:"20"}),x("line",{x1:"14",y1:"20",x2:"21",y2:"20"}),x("line",{x1:"6.9",y1:"15",x2:"13.8",y2:"15"}),x("line",{x1:"10.2",y1:"6.3",x2:"16",y2:"20"}),x("polyline",{points:"5 20 11 4 13 4 20 20"})]}),te),P2=N(W("g",{stroke:"currentColor",strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 7v-2h13v2"}),x("path",{d:"M10 5v14"}),x("path",{d:"M12 19h-4"}),x("path",{d:"M15 13v-1h6v1"}),x("path",{d:"M18 12v7"}),x("path",{d:"M17 19h2"})]}),te),xl=N(W("g",{strokeWidth:"1.25",children:[x("path",{d:"M12.5 6.667h.01"}),x("path",{d:"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z"}),x("path",{d:"m3.333 12.5 3.334-3.333c.773-.745 1.726-.745 2.5 0l4.166 4.166"}),x("path",{d:"m11.667 11.667.833-.834c.774-.744 1.726-.744 2.5 0l1.667 1.667"})]}),ze),A2=N(W("g",{strokeWidth:"1.25",children:[x("path",{d:"M15 10l4.553-2.843A1 1 0 0 1 21 8.059v7.882a1 1 0 0 1-1.447.902L15 14"}),x("rect",{x:"3",y:"6",width:"12",height:"12",rx:"2"})]}),ze),tu=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3"}),x("path",{d:"M18 13.3l-6.3 -6.3"})]}),te),Nb=N(x("path",{strokeWidth:"1.25",d:"M10 4.167v11.666M4.167 10h11.666"}),ze),Bb=N(x("path",{d:"M5 10h10",strokeWidth:"1.25"}),ze),L2=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M21 21l-6 -6"}),x("path",{d:"M3.268 12.043a7.017 7.017 0 0 0 6.634 4.957a7.012 7.012 0 0 0 7.043 -6.131a7 7 0 0 0 -5.314 -7.672a7.021 7.021 0 0 0 -8.241 4.403"}),x("path",{d:"M3 4v4h4"})]}),te),Co=N(x("path",{strokeWidth:"1.25",d:"M3.333 5.833h13.334M8.333 9.167v5M11.667 9.167v5M4.167 5.833l.833 10c0 .92.746 1.667 1.667 1.667h6.666c.92 0 1.667-.746 1.667-1.667l.833-10M7.5 5.833v-2.5c0-.46.373-.833.833-.833h3.334c.46 0 .833.373.833.833v2.5"}),ze),yl=N(W("g",{strokeWidth:"1.5",children:[x("polyline",{points:"12 16 18 10 12 4"}),x("polyline",{points:"8 4 2 10 8 16"})]}),ze),Sd=N(W("g",{strokeWidth:"1.25",children:[x("path",{d:"M14.375 6.458H8.958a2.5 2.5 0 0 0-2.5 2.5v5.417a2.5 2.5 0 0 0 2.5 2.5h5.417a2.5 2.5 0 0 0 2.5-2.5V8.958a2.5 2.5 0 0 0-2.5-2.5Z"}),x("path",{clipRule:"evenodd",d:"M11.667 3.125c.517 0 .986.21 1.325.55.34.338.55.807.55 1.325v1.458H8.333c-.485 0-.927.185-1.26.487-.343.312-.57.75-.609 1.24l-.005 5.357H5a1.87 1.87 0 0 1-1.326-.55 1.87 1.87 0 0 1-.549-1.325V5c0-.518.21-.987.55-1.326.338-.34.807-.549 1.325-.549h6.667Z"})]}),ze),Md=N(x("path",{clipRule:"evenodd",d:"M10 2.5h.328a6.25 6.25 0 0 0 6.6 10.372A7.5 7.5 0 1 1 10 2.493V2.5Z",stroke:"currentColor"}),ze),Pd=N(x("g",{stroke:"currentColor",strokeLinejoin:"round",children:x("path",{d:"M10 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM10 4.167V2.5M14.167 5.833l1.166-1.166M15.833 10H17.5M14.167 14.167l1.166 1.166M10 15.833V17.5M5.833 14.167l-1.166 1.166M5 10H3.333M5.833 5.833 4.667 4.667"})}),{...ze,strokeWidth:1.5}),_2=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),x("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),x("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]}),te),ls=N(x("path",{strokeWidth:"1.25",d:"M3.333 14.167v1.666c0 .92.747 1.667 1.667 1.667h10c.92 0 1.667-.746 1.667-1.667v-1.666M5.833 9.167 10 13.333l4.167-4.166M10 3.333v10"}),ze),wl=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"12",cy:"12",r:"9"}),x("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),x("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),te),D2=N(W("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"12",cy:"12",r:"9"}),x("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),x("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),te),Fb=N(x("path",{strokeWidth:"1.25",d:"M9.167 5.833H5.833c-1.254 0-2.5 1.282-2.5 2.5v5.834c0 1.283 1.252 2.5 2.5 2.5h5.834c1.251 0 2.5-1.25 2.5-2.5v-3.334M8.333 11.667l8.334-8.334M12.5 3.333h4.167V7.5"}),ze),ou=N(x("path",{d:"M7.5 15.833c-3.583 1.167-3.583-2.083-5-2.5m10 4.167v-2.917c0-.833.083-1.166-.417-1.666 2.334-.25 4.584-1.167 4.584-5a3.833 3.833 0 0 0-1.084-2.667 3.5 3.5 0 0 0-.083-2.667s-.917-.25-2.917 1.084a10.25 10.25 0 0 0-5.166 0C5.417 2.333 4.5 2.583 4.5 2.583a3.5 3.5 0 0 0-.083 2.667 3.833 3.833 0 0 0-1.084 2.667c0 3.833 2.25 4.75 4.584 5-.5.5-.5 1-.417 1.666V17.5",strokeWidth:"1.25"}),ze),R2=N(W("g",{strokeWidth:"1.25",children:[x("path",{d:"M7.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM12.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM6.25 6.25c2.917-.833 4.583-.833 7.5 0M5.833 13.75c2.917.833 5.417.833 8.334 0"}),x("path",{d:"M12.917 14.167c0 .833 1.25 2.5 1.666 2.5 1.25 0 2.361-1.39 2.917-2.5.556-1.39.417-4.861-1.25-9.584-1.214-.846-2.5-1.116-3.75-1.25l-.833 2.084M7.083 14.167c0 .833-1.13 2.5-1.526 2.5-1.191 0-2.249-1.39-2.778-2.5-.529-1.39-.397-4.861 1.19-9.584 1.157-.846 2.318-1.116 3.531-1.25l.833 2.084"})]}),ze),N2=N(W("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 4l11.733 16h4.267l-11.733 -16z"}),x("path",{d:"M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"})]}),te),nu=N(x("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),Ad=N(W("g",{strokeWidth:"1.25",children:[x("path",{d:"M8.333 11.667a2.917 2.917 0 0 0 4.167 0l3.333-3.334a2.946 2.946 0 1 0-4.166-4.166l-.417.416"}),x("path",{d:"M11.667 8.333a2.917 2.917 0 0 0-4.167 0l-3.333 3.334a2.946 2.946 0 0 0 4.166 4.166l.417-.416"})]}),ze),B2=N("M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z",{width:448,height:512}),F2=N("M252 54L203 8a28 27 0 00-20-8H28C12 0 0 12 0 27v195c0 15 12 26 28 26h204c15 0 28-11 28-26V73a28 27 0 00-8-19zM130 213c-21 0-37-16-37-36 0-19 16-35 37-35 20 0 37 16 37 35 0 20-17 36-37 36zm56-169v56c0 4-4 6-7 6H44c-4 0-7-2-7-6V42c0-4 3-7 7-7h133l4 2 3 2a7 7 0 012 5z M296 201l87 95-188 205-78 9c-10 1-19-8-18-20l9-84zm141-14l-41-44a31 31 0 00-46 0l-38 41 87 95 38-42c13-14 13-36 0-50z",{width:448,height:512}),vl=N(x("path",{d:"m9.257 6.351.183.183H15.819c.34 0 .727.182 1.051.506.323.323.505.708.505 1.05v5.819c0 .316-.183.7-.52 1.035-.337.338-.723.522-1.037.522H4.182c-.352 0-.74-.181-1.058-.5-.318-.318-.499-.705-.499-1.057V5.182c0-.351.181-.736.5-1.054.32-.321.71-.503 1.057-.503H6.53l2.726 2.726Z",strokeWidth:"1.25"}),ze),fie=N("M384 112v352c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h80c0-35.29 28.71-64 64-64s64 28.71 64 64h80c26.51 0 48 21.49 48 48zM192 40c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24m96 114v-20a6 6 0 0 0-6-6H102a6 6 0 0 0-6 6v20a6 6 0 0 0 6 6h180a6 6 0 0 0 6-6z",{width:384,height:512}),bie=N("M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"),ru=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 16l1.465 1.638a2 2 0 1 1 -3.015 .099l1.55 -1.737z"}),x("path",{d:"M13.737 9.737c2.299 -2.3 3.23 -5.095 2.081 -6.245c-1.15 -1.15 -3.945 -.217 -6.244 2.082c-2.3 2.299 -3.231 5.095 -2.082 6.244c1.15 1.15 3.946 .218 6.245 -2.081z"}),x("path",{d:"M7.492 11.818c.362 .362 .768 .676 1.208 .934l6.895 4.047c1.078 .557 2.255 -.075 3.692 -1.512c1.437 -1.437 2.07 -2.614 1.512 -3.692c-.372 -.718 -1.72 -3.017 -4.047 -6.895a6.015 6.015 0 0 0 -.934 -1.208"})]}),te),O2=N(x("g",{strokeWidth:1.5,children:x("path",{d:"M6 18l12 -12"})}),te),au=N(W("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M15 8h.01"}),x("path",{d:"M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5"}),x("path",{d:"M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4"}),x("path",{d:"M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598"}),x("path",{d:"M19 16v6"}),x("path",{d:"M22 19l-3 3l-3 -3"})]}),te),z2=N("M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z",{width:512,height:512}),xie=N("M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512}),yie=N("M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512}),U2=N("M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"),wie=N("M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"),Ob=N(x("path",{d:"M7.5 10.833 4.167 7.5 7.5 4.167M4.167 7.5h9.166a3.333 3.333 0 0 1 0 6.667H12.5",strokeWidth:"1.25"}),ze),zb=N(x("path",{d:"M12.5 10.833 15.833 7.5 12.5 4.167M15.833 7.5H6.667a3.333 3.333 0 1 0 0 6.667H7.5",strokeWidth:"1.25"}),ze),H2=N("M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z",{mirror:!0}),G2=N(x("path",{d:"M5 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 7.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 17.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM7.25 8.917l5.5-2.834M7.25 11.083l5.5 2.834",strokeWidth:"1.5"}),ze),vie=N("M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"),Eie=N("M16 5l-1.42 1.42-1.59-1.59V16h-1.98V4.83L9.42 6.42 8 5l4-4 4 4zm4 5v11c0 1.1-.9 2-2 2H6c-1.11 0-2-.9-2-2V10c0-1.11.89-2 2-2h3v2H6v11h12V10h-3V8h3c1.1 0 2 .89 2 2z",{width:24,height:24}),Iie=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M8 9h-1a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-8a2 2 0 0 0 -2 -2h-1"}),x("path",{d:"M12 14v-11"}),x("path",{d:"M9 6l3 -3l3 3"})]}),te),Tie=N(W(xt,{children:[x("path",{fill:"currentColor",d:"M40 5.6v6.1l-4.1.7c-8.9 1.4-16.5 6.9-20.6 15C13 32 10.9 43 12.4 43c.4 0 2.4-1.3 4.4-3 5-3.9 12.1-7 18.2-7.7l5-.6v12.8l11.2-11.3L62.5 22 51.2 10.8 40-.5v6.1zm10.2 22.6L44 34.5v-6.8l-6.9.6c-3.9.3-9.8 1.7-13.2 3.1-3.5 1.4-6.5 2.4-6.7 2.2-.9-1 3-7.5 6.4-10.8C28 18.6 34.4 16 40.1 16c3.7 0 3.9-.1 3.9-3.2V9.5l6.2 6.3 6.3 6.2-6.3 6.2z"}),x("path",{stroke:"currentColor",fill:"currentColor",d:"M0 36v20h48v-6.2c0-6 0-6.1-2-4.3-1.1 1-2 2.9-2 4.2V52H4V34c0-17.3-.1-18-2-18s-2 .7-2 20z"})]}),{width:64,height:64}),kie=N(x("path",{stroke:"currentColor",strokeWidth:"40",fill:"currentColor",d:"M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z"}),{width:1024}),$2=W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 10l0 10"}),x("path",{d:"M12 10l4 4"}),x("path",{d:"M12 10l-4 4"}),x("path",{d:"M4 4l16 0"})]}),V2=W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 5l0 14"}),x("path",{d:"M16 9l-4 -4"}),x("path",{d:"M8 9l4 -4"})]}),Ub=N(V2,te),Hb=N(V2,{...te,style:{transform:"rotate(180deg)"}}),Gb=N($2,te),$b=N($2,{...te,style:{transform:"rotate(180deg)"}}),Vb=N(W(xt,{children:[W("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M3.333 3.333h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v7.083c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V8.125c0-.92-.746-1.667-1.666-1.667ZM6.875 6.458h-.417c-.92 0-1.666.747-1.666 1.667v3.75c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667v-3.75c0-.92-.747-1.667-1.667-1.667Z"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),Wb=N(W(xt,{children:[W("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M6.875 3.125h-.417c-.92 0-1.666.746-1.666 1.667v7.083c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667V4.792c0-.92-.747-1.667-1.667-1.667ZM13.542 5.817h-.417c-.92 0-1.667.747-1.667 1.667v4.391c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V7.484c0-.92-.746-1.667-1.666-1.667Z"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),Kb=N(W(xt,{children:[W("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M15.208 4.792H8.125c-.92 0-1.667.746-1.667 1.666v.417c0 .92.747 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM12.516 11.458H8.125c-.92 0-1.667.746-1.667 1.667v.417c0 .92.747 1.666 1.667 1.666h4.391c.92 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.667-1.667Z"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),Yb=N(W(xt,{children:[W("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M16.667 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M11.875 4.792H4.792c-.92 0-1.667.746-1.667 1.666v.417c0 .92.746 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM11.683 11.458H7.292c-.92 0-1.667.746-1.667 1.667v.417c0 .92.746 1.666 1.667 1.666h4.39c.921 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.666-1.667Z"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),W2=N(W(xt,{children:[W("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M16.667 3.333v13.334M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M14.375 10.208v-.416c0-.92-.746-1.667-1.667-1.667H7.292c-.92 0-1.667.746-1.667 1.667v.416c0 .92.746 1.667 1.667 1.667h5.416c.92 0 1.667-.746 1.667-1.667Z"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),K2=N(W(xt,{children:[W("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M3.333 3.333h13.334M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M10.208 5.625h-.416c-.92 0-1.667.746-1.667 1.667v5.416c0 .92.746 1.667 1.667 1.667h.416c.92 0 1.667-.746 1.667-1.667V7.292c0-.92-.746-1.667-1.667-1.667Z"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),Xb=N(W("g",{stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M1.667 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M8.333 10h3.334",strokeLinejoin:"round"}),x("path",{d:"M15.417 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M6.875 4.792h-.417c-.92 0-1.666.746-1.666 1.666v7.084c0 .92.746 1.666 1.666 1.666h.417c.92 0 1.667-.746 1.667-1.666V6.458c0-.92-.747-1.666-1.667-1.666ZM13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v3.75c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667v-3.75c0-.92-.746-1.667-1.666-1.667Z"})]}),ze),jb=N(W("g",{stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M10 18.333v-2.916",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M10 11.667V8.333",strokeLinejoin:"round"}),x("path",{d:"M10 4.583V1.667",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M4.792 13.125v.417c0 .92.746 1.666 1.666 1.666h7.084c.92 0 1.666-.746 1.666-1.666v-.417c0-.92-.746-1.667-1.666-1.667H6.458c-.92 0-1.666.746-1.666 1.667ZM6.458 6.458v.417c0 .92.747 1.667 1.667 1.667h3.75c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666h-3.75c-.92 0-1.667.746-1.667 1.666Z"})]}),ze),iu=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"9",cy:"7",r:"4"}),x("path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"}),x("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}),x("path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85"})]}),te),Cie=N("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z"),Y2=N("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm96 328c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h160c8.8 0 16 7.2 16 16v160z"),Nn=N(W(xt,{children:[x("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:x("path",{d:"M15 5 5 15M5 5l10 10"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),Sie=N("M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z",{mirror:!0}),Mie=N("M11.553 22.894a.998.998 0 00.894 0s3.037-1.516 5.465-4.097C19.616 16.987 21 14.663 21 12V5a1 1 0 00-.649-.936l-8-3a.998.998 0 00-.702 0l-8 3A1 1 0 003 5v7c0 2.663 1.384 4.987 3.088 6.797 2.428 2.581 5.465 4.097 5.465 4.097zm-1.303-8.481l6.644-6.644a.856.856 0 111.212 1.212l-7.25 7.25a.856.856 0 01-1.212 0l-3.75-3.75a.856.856 0 111.212-1.212l3.144 3.144z",{width:24}),Pie=N("M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm32-48h224V288l-23.5-23.5c-4.7-4.7-12.3-4.7-17 0L176 352l-39.5-39.5c-4.7-4.7-12.3-4.7-17 0L80 352v64zm48-240c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z",{width:384,height:512}),Zb=go.memo(({theme:e})=>N(W(xt,{children:[x("path",{d:"M25 26H111V111H25",fill:lr(e)}),x("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:lr(e),strokeWidth:"2"}),x("path",{d:"M100 100H160V160H100",fill:lr(e)}),x("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:lr(e),strokeWidth:"2"}),W("g",{fill:y2(e),stroke:lr(e),strokeWidth:"6",children:[x("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),x("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),x("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),x("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),qb=go.memo(({theme:e})=>N(W(xt,{children:[x("path",{d:"M25 26H111V111H25",fill:lr(e)}),x("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:lr(e),strokeWidth:"2"}),x("path",{d:"M100 100H160V160H100",fill:lr(e)}),x("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:lr(e),strokeWidth:"2"}),W("g",{fill:y2(e),stroke:lr(e),strokeWidth:"6",children:[x("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),x("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),x("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),x("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),x("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),x("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),X2=N(x("g",{strokeWidth:1.25,children:x("path",{d:"M5.879 2.625h8.242a3.27 3.27 0 0 1 3.254 3.254v8.242a3.27 3.27 0 0 1-3.254 3.254H5.88a3.27 3.27 0 0 1-3.254-3.254V5.88A3.27 3.27 0 0 1 5.88 2.626l-.001-.001ZM4.518 16.118l7.608-12.83m.198 13.934 5.051-9.897M2.778 9.675l9.348-6.387m-7.608 12.83 12.857-8.793"})}),ze),j2=N(W(xt,{children:[x("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",stroke:"currentColor",strokeWidth:"1.25"}),x("mask",{id:"FillHachureIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:2,y:2,width:16,height:16,children:x("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"1.25"})}),x("g",{mask:"url(#FillHachureIcon)",children:x("path",{d:"M2.258 15.156 15.156 2.258M7.324 20.222 20.222 7.325m-20.444 5.35L12.675-.222m-8.157 18.34L17.416 5.22",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})]}),ze),Z2=N(W(xt,{children:[W("g",{clipPath:"url(#a)",children:[x("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",stroke:"currentColor",strokeWidth:"1.25"}),x("mask",{id:"FillCrossHatchIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:-1,y:-1,width:22,height:22,children:x("path",{d:"M2.426 15.044 15.044 2.426M7.383 20 20 7.383M0 12.617 12.617 0m-7.98 17.941L17.256 5.324m-2.211 12.25L2.426 4.956M20 12.617 7.383 0m5.234 20L0 7.383m17.941 7.98L5.324 2.745",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),x("g",{mask:"url(#FillCrossHatchIcon)",children:x("path",{d:"M14.121 2H5.88A3.879 3.879 0 0 0 2 5.879v8.242A3.879 3.879 0 0 0 5.879 18h8.242A3.879 3.879 0 0 0 18 14.121V5.88A3.879 3.879 0 0 0 14.121 2Z",fill:"currentColor"})})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),q2=N(W(xt,{children:[x("g",{clipPath:"url(#a)",children:x("path",{d:"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z",stroke:"currentColor",strokeWidth:"1.25"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),{...ze,fill:"currentColor"}),Jb=N(x(xt,{children:x("path",{d:"M4.167 10h11.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),ze),J2=N(x("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),ze),Q2=N(x("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"3.75",strokeLinecap:"round",strokeLinejoin:"round"}),ze),Aie=go.memo(({theme:e})=>N(x("path",{d:"M6 10H34",stroke:lr(e),strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})),eI=N(W("g",{strokeWidth:"2",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 12h2"}),x("path",{d:"M17 12h2"}),x("path",{d:"M11 12h2"})]}),te),tI=N(W("g",{strokeWidth:"2",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 12v.01"}),x("path",{d:"M8 12v.01"}),x("path",{d:"M12 12v.01"}),x("path",{d:"M16 12v.01"}),x("path",{d:"M20 12v.01"})]}),te),oI=N(x("path",{d:"M2.5 12.038c1.655-.885 5.9-3.292 8.568-4.354 2.668-1.063.101 2.821 1.32 3.104 1.218.283 5.112-1.814 5.112-1.814",strokeWidth:"1.25"}),ze),nI=N(x("path",{d:"M2.5 12.563c1.655-.886 5.9-3.293 8.568-4.355 2.668-1.062.101 2.822 1.32 3.105 1.218.283 5.112-1.814 5.112-1.814m-13.469 2.23c2.963-1.586 6.13-5.62 7.468-4.998 1.338.623-1.153 4.11-.132 5.595 1.02 1.487 6.133-1.43 6.133-1.43",strokeWidth:"1.25"}),ze),rI=N(x("path",{d:"M2.5 11.936c1.737-.879 8.627-5.346 10.42-5.268 1.795.078-.418 5.138.345 5.736.763.598 3.53-1.789 4.235-2.147M2.929 9.788c1.164-.519 5.47-3.28 6.987-3.114 1.519.165 1 3.827 2.121 4.109 1.122.281 3.839-2.016 4.606-2.42",strokeWidth:"1.25"}),ze),aI=N(W("svg",{strokeWidth:"1.5",children:[x("path",{d:"M3.33334 9.99998V6.66665C3.33334 6.04326 3.33403 4.9332 3.33539 3.33646C4.95233 3.33436 6.06276 3.33331 6.66668 3.33331H10"}),x("path",{d:"M13.3333 3.33331V3.34331"}),x("path",{d:"M16.6667 3.33331V3.34331"}),x("path",{d:"M16.6667 6.66669V6.67669"}),x("path",{d:"M16.6667 10V10.01"}),x("path",{d:"M3.33334 13.3333V13.3433"}),x("path",{d:"M16.6667 13.3333V13.3433"}),x("path",{d:"M3.33334 16.6667V16.6767"}),x("path",{d:"M6.66666 16.6667V16.6767"}),x("path",{d:"M10 16.6667V16.6767"}),x("path",{d:"M13.3333 16.6667V16.6767"}),x("path",{d:"M16.6667 16.6667V16.6767"})]}),ze),iI=N(W("g",{strokeWidth:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 12v-4a4 4 0 0 1 4 -4h4"}),x("line",{x1:"16",y1:"4",x2:"16",y2:"4.01"}),x("line",{x1:"20",y1:"4",x2:"20",y2:"4.01"}),x("line",{x1:"20",y1:"8",x2:"20",y2:"8.01"}),x("line",{x1:"20",y1:"12",x2:"20",y2:"12.01"}),x("line",{x1:"4",y1:"16",x2:"4",y2:"16.01"}),x("line",{x1:"20",y1:"16",x2:"20",y2:"16.01"}),x("line",{x1:"4",y1:"20",x2:"4",y2:"20.01"}),x("line",{x1:"8",y1:"20",x2:"8",y2:"20.01"}),x("line",{x1:"12",y1:"20",x2:"12",y2:"20.01"}),x("line",{x1:"16",y1:"20",x2:"16",y2:"20.01"}),x("line",{x1:"20",y1:"20",x2:"20",y2:"20.01"})]}),te),sI=go.memo(({flip:e=!1})=>N(W("g",{transform:e?"translate(24, 0) scale(-1, 1)":"",stroke:"currentColor",opacity:.3,strokeWidth:2,children:[x("path",{d:"M12 12l-9 0"}),x("path",{d:"M21 9l-6 6"}),x("path",{d:"M21 15l-6 -6"})]}),te)),lI=go.memo(({flip:e=!1})=>N(W("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",strokeWidth:2,fill:"none",children:[x("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),x("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})),cI=go.memo(({flip:e=!1})=>N(W("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[x("path",{d:"M32 10L6 10",strokeWidth:2}),x("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),dI=go.memo(({flip:e=!1})=>N(W("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,children:[x("path",{d:"M26 10L6 10"}),x("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),mI=go.memo(({flip:e=!1})=>N(x("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",children:x("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"currentColor",strokeWidth:2,fill:"none"})}),{width:40,height:20})),pI=go.memo(({flip:e=!1})=>N(W("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[x("path",{d:"M32 10L6 10",strokeWidth:2}),x("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})),uI=go.memo(({flip:e=!1})=>N(W("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,strokeLinejoin:"round",children:[x("path",{d:"M6,9.5H27"}),x("path",{d:"M27,5L34,10L27,14Z",fill:"none"})]}),{width:40,height:20})),gI=go.memo(({flip:e=!1})=>N(W("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[x("path",{d:"M6,9.5H20"}),x("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),hI=go.memo(({flip:e=!1})=>N(W("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[x("path",{d:"M6,9.5H20"}),x("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),fI=go.memo(({flip:e=!1})=>N(x("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:x("path",{d:"M34,10 H6 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),bI=go.memo(({flip:e=!1})=>N(x("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:x("path",{d:"M34,10 H6 M15,10 L15,15 L15,5"})}),{width:40,height:20})),xI=go.memo(({flip:e=!1})=>N(x("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:x("path",{d:"M34,10 H6 M15,10 L15,16 L15,4 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),yI=N(W(xt,{children:[x("g",{clipPath:"url(#a)",children:x("path",{d:"M14.167 6.667a3.333 3.333 0 0 0-3.334-3.334H9.167a3.333 3.333 0 0 0 0 6.667h1.666a3.333 3.333 0 0 1 0 6.667H9.167a3.333 3.333 0 0 1-3.334-3.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),wI=N(W(xt,{children:[x("g",{clipPath:"url(#a)",children:x("path",{d:"M5 16.667V3.333L10 15l5-11.667v13.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),vI=N(W(xt,{children:[x("g",{clipPath:"url(#a)",children:x("path",{d:"M5.833 3.333v13.334h8.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),EI=N(x(xt,{children:x("path",{d:"m1.667 3.333 6.666 13.334M8.333 3.333 1.667 16.667M11.667 3.333v13.334h6.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),ze),cs=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 7v-2h13v2"}),x("path",{d:"M10 5v14"}),x("path",{d:"M12 19h-4"}),x("path",{d:"M15 13v-1h6v1"}),x("path",{d:"M18 12v7"}),x("path",{d:"M17 19h2"})]}),te),II=N(x(xt,{children:W("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M7 12h10"}),x("path",{d:"M7 5v14"}),x("path",{d:"M17 5v14"}),x("path",{d:"M15 19h4"}),x("path",{d:"M15 5h4"}),x("path",{d:"M5 19h4"}),x("path",{d:"M5 5h4"})]})}),te),Ld=N(x(xt,{children:x("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:x("path",{d:"M5.833 16.667v-10a3.333 3.333 0 0 1 3.334-3.334h1.666a3.333 3.333 0 0 1 3.334 3.334v10M5.833 10.833h8.334"})})}),ze),Qb=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M7 8l-4 4l4 4"}),x("path",{d:"M17 8l4 4l-4 4"}),x("path",{d:"M14 4l-4 16"})]}),te),su=Qb,TI=N(W("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),x("line",{x1:"4",y1:"12",x2:"12",y2:"12"}),x("line",{x1:"4",y1:"16",x2:"16",y2:"16"})]}),te),kI=N(W("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),x("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),x("line",{x1:"6",y1:"16",x2:"18",y2:"16"})]}),te),CI=N(W("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),x("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),x("line",{x1:"8",y1:"16",x2:"20",y2:"16"})]}),te),SI=go.memo(({theme:e})=>N(W("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"4",x2:"20",y2:"4"}),x("rect",{x:"9",y:"8",width:"6",height:"12",rx:"2"})]}),te)),MI=go.memo(({theme:e})=>N(W("g",{strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"20",x2:"20",y2:"20"}),x("rect",{x:"9",y:"4",width:"6",height:"12",rx:"2"})]}),te)),PI=go.memo(({theme:e})=>N(W("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"12",x2:"9",y2:"12"}),x("line",{x1:"15",y1:"12",x2:"20",y2:"12"}),x("rect",{x:"9",y:"6",width:"6",height:"12",rx:"2"})]}),te)),lu=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M21 19h-18l9 -15"}),x("path",{d:"M20.615 15.171h.015"}),x("path",{d:"M19.515 11.771h.015"}),x("path",{d:"M17.715 8.671h.015"}),x("path",{d:"M15.415 5.971h.015"})]}),te),AI=N(x("path",{d:"M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z",fill:"currentColor"}),{width:640,height:512}),Lie=N(x("path",{d:"M480 416C497.7 416 512 430.3 512 448C512 465.7 497.7 480 480 480H150.6C133.7 480 117.4 473.3 105.4 461.3L25.37 381.3C.3786 356.3 .3786 315.7 25.37 290.7L258.7 57.37C283.7 32.38 324.3 32.38 349.3 57.37L486.6 194.7C511.6 219.7 511.6 260.3 486.6 285.3L355.9 416H480zM265.4 416L332.7 348.7L195.3 211.3L70.63 336L150.6 416L265.4 416z"})),El=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5"}),x("path",{d:"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5"}),x("path",{d:"M14 5.5a1.5 1.5 0 0 1 3 0v6.5"}),x("path",{d:"M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47"})]}),te),e0=N(W(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),x("path",{d:"M7 11l5 5l5 -5"}),x("path",{d:"M12 4l0 12"})]}),te),Il=N(W(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"}),x("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"})]}),te),LI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M7 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),x("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),x("path",{d:"M9.15 14.85l8.85 -10.85"}),x("path",{d:"M6 4l8.85 10.85"})]}),te),_I=N(W(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),x("path",{d:"M12 17l0 .01"}),x("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),te),_ie=N(W(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M7 4v16l13 -8z"})]}),te),Die=N(W(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M17 4h-10a3 3 0 0 0 -3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3 -3v-10a3 3 0 0 0 -3 -3z",strokeWidth:"0",fill:"currentColor"})]}),te),DI=N(W(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 12l5 5l10 -10"})]}),te),cu=N(W(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M10.24 3.957l-8.422 14.06a1.989 1.989 0 0 0 1.7 2.983h16.845a1.989 1.989 0 0 0 1.7 -2.983l-8.423 -14.06a1.989 1.989 0 0 0 -3.4 0z"}),x("path",{d:"M12 9v4"}),x("path",{d:"M12 17h.01"})]}),te),RI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M11 7l6 6"}),x("path",{d:"M4 16l11.7 -11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4l-11.7 11.7h-4v-4z"})]}),te),_d=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 3l-4 7h8z"}),x("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),x("path",{d:"M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"})]}),te),Ar=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 7l16 0"}),x("path",{d:"M4 17l16 0"}),x("path",{d:"M7 4l0 16"}),x("path",{d:"M17 4l0 16"})]}),te),du=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),x("circle",{cx:"8.5",cy:"8.5",r:"1.5",fill:"currentColor",stroke:"none"}),x("path",{d:"M3 16l5-5c.928-.893 2.072-.893 3 0l5 5"}),x("path",{d:"M14 14l1-1c.928-.893 2.072-.893 3 0l3 3"}),x("path",{d:"M17.5 4.5l0 3m-1.5-1.5l3 0",strokeWidth:"1.5",strokeLinecap:"round"})]}),te),mu=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("rect",{x:"3",y:"6",width:"12",height:"12",rx:"2"}),x("path",{d:"M15 10l4.553-2.07A1 1 0 0 1 21 8.87v6.26a1 1 0 0 1-1.447.94L15 14"}),x("path",{d:"M17.5 4.5l0 3m-1.5-1.5l3 0",strokeWidth:"1.5",strokeLinecap:"round"})]}),te),Tl=N(x("path",{fill:"currentColor",d:"M407.48,111.18C335.587,108.103 269.573,152.338 245.08,220C220.587,152.338 154.573,108.103 82.68,111.18C80.285,168.229 107.577,222.632 154.74,254.82C178.908,271.419 193.35,298.951 193.27,328.27L193.27,379.13L296.9,379.13L296.9,328.27C296.816,298.953 311.255,271.42 335.42,254.82C382.596,222.644 409.892,168.233 407.48,111.18Z"})),NI=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"}),x("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"})]}),te),BI=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 10l-2 1l8 4l8 -4l-2 -1"}),x("path",{d:"M4 15l8 4l8 -4"}),x("path",{d:"M12 4v7"}),x("path",{d:"M15 8l-3 3l-3 -3"})]}),te),Xa=N(W("g",{strokeWidth:"1.25",children:[x("path",{d:"M4.16602 10H15.8327"}),x("path",{d:"M12.5 13.3333L15.8333 10"}),x("path",{d:"M12.5 6.66666L15.8333 9.99999"})]}),ze),Lr=N(W("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",transform:"rotate(90 10 10)",children:[x("path",{clipRule:"evenodd",d:"m9.644 13.69 7.774-7.773a2.357 2.357 0 0 0-3.334-3.334l-7.773 7.774L8 12l1.643 1.69Z"}),x("path",{d:"m13.25 3.417 3.333 3.333M10 10l2-2M5 15l3-3M2.156 17.894l1-1M5.453 19.029l-.144-1.407M2.377 11.887l.866 1.118M8.354 17.273l-1.194-.758M.953 14.652l1.408.13"})]}),20),ds=N(W("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z"}),x("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),x("path",{d:"M15 6l3 3"}),x("path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}),x("path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"})]}),te),Rie=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z"}),x("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),x("path",{d:"M15 6l3 3"}),x("path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}),x("path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"})]}),te),Nie=N(W("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M11.217 19.384a3.501 3.501 0 0 0 6.783 -1.217v-5.167l-6 -3.35"}),x("path",{d:"M5.214 15.014a3.501 3.501 0 0 0 4.446 5.266l4.34 -2.534v-6.946"}),x("path",{d:"M6 7.63c-1.391 -.236 -2.787 .395 -3.534 1.689a3.474 3.474 0 0 0 1.271 4.745l4.263 2.514l6 -3.348"}),x("path",{d:"M12.783 4.616a3.501 3.501 0 0 0 -6.783 1.217v5.067l6 3.45"}),x("path",{d:"M18.786 8.986a3.501 3.501 0 0 0 -4.446 -5.266l-4.34 2.534v6.946"}),x("path",{d:"M18 16.302c1.391 .236 2.787 -.395 3.534 -1.689a3.474 3.474 0 0 0 -1.271 -4.745l-4.308 -2.514l-5.955 3.42"})]}),te),FI=N(W("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2"}),x("path",{d:"M4 16v2a2 2 0 0 0 2 2h2"}),x("path",{d:"M16 4h2a2 2 0 0 1 2 2v2"}),x("path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2"})]}),te),kl=N(W("g",{stroke:"currentColor",fill:"none",strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"}),x("path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"})]}),te),OI=N(W("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828"}),x("path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"}),x("path",{d:"M3 3l18 18"})]}),te),zI=N(W("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8"}),x("path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8"}),x("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),x("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),x("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),x("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),te),UI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8"}),x("path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8"}),x("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),x("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),x("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),x("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),te),fn=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),x("path",{d:"M21 21l-6 -6"})]}),te),HI=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M20.984 12.53a9 9 0 1 0 -7.552 8.355"}),x("path",{d:"M12 7v5l3 3"}),x("path",{d:"M19 16l-2 3h4l-2 3"})]}),te),GI=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 8l0 4l2 2"}),x("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})]}),te),$I=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M9 2m0 3a3 3 0 0 1 3 -3h0a3 3 0 0 1 3 3v5a3 3 0 0 1 -3 3h0a3 3 0 0 1 -3 -3z"}),x("path",{d:"M5 10a7 7 0 0 0 14 0"}),x("path",{d:"M8 21l8 0"}),x("path",{d:"M12 17l0 4"})]}),te),VI=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 3l18 18"}),x("path",{d:"M9 5a3 3 0 0 1 6 0v5a3 3 0 0 1 -.13 .874m-2 2a3 3 0 0 1 -3.87 -2.872v-1"}),x("path",{d:"M5 10a7 7 0 0 0 10.846 5.85m2 -2a6.967 6.967 0 0 0 1.152 -3.85"}),x("path",{d:"M8 21l8 0"}),x("path",{d:"M12 17l0 4"})]}),te),Dd=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11"})]}),te),WI=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M8 8m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z"}),x("path",{d:"M12 20v.01"}),x("path",{d:"M16 20v.01"}),x("path",{d:"M8 20v.01"}),x("path",{d:"M4 20v.01"}),x("path",{d:"M4 16v.01"}),x("path",{d:"M4 12v.01"}),x("path",{d:"M4 8v.01"}),x("path",{d:"M4 4v.01"}),x("path",{d:"M8 4v.01"}),x("path",{d:"M12 4v.01"}),x("path",{d:"M16 4v.01"}),x("path",{d:"M20 4v.01"}),x("path",{d:"M20 8v.01"}),x("path",{d:"M20 12v.01"}),x("path",{d:"M20 16v.01"}),x("path",{d:"M20 20v.01"})]}),te),KI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 3v18"}),x("path",{d:"M19 21v-18"}),x("path",{d:"M5 7h14"}),x("path",{d:"M5 15h14"}),x("path",{d:"M8 13v4"}),x("path",{d:"M11 13v4"}),x("path",{d:"M16 13v4"}),x("path",{d:"M14 5v4"}),x("path",{d:"M11 5v4"}),x("path",{d:"M8 5v4"}),x("path",{d:"M3 21h18"})]}),te),YI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 12l18 0"}),x("path",{d:"M7 16l10 0l-10 5l0 -5"}),x("path",{d:"M7 8l10 0l-10 -5l0 5"})]}),te),XI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 3l0 18"}),x("path",{d:"M16 7l0 10l5 0l-5 -10"}),x("path",{d:"M8 7l0 10l-5 0l5 -10"})]}),te),t0=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z"}),x("path",{d:"M19 6h1a2 2 0 0 1 2 2a5 5 0 0 1 -5 5l-5 0v2"}),x("path",{d:"M10 15m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"})]}),te),Cl=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0"}),x("path",{d:"M22 22l-3 -3"}),x("path",{d:"M6 18h-1a2 2 0 0 1 -2 -2v-1"}),x("path",{d:"M3 11v-1"}),x("path",{d:"M3 6v-1a2 2 0 0 1 2 -2h1"}),x("path",{d:"M10 3h1"}),x("path",{d:"M15 3h1a2 2 0 0 1 2 2v1"})]}),te),jI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),x("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),x("path",{d:"M4 20.25c0 .414 .336 .75 .75 .75h1.25a1 1 0 0 0 1 -1v-1a1 1 0 0 0 -1 -1h-1a1 1 0 0 1 -1 -1v-1a1 1 0 0 1 1 -1h1.25a.75 .75 0 0 1 .75 .75"}),x("path",{d:"M10 15l2 6l2 -6"}),x("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"})]}),te),ZI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),x("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),x("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"}),x("path",{d:"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"}),x("path",{d:"M11 21v-6l3 6v-6"})]}),te),qI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 13v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a2 2 0 0 0 6 0v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a8 8 0 0 1 -16 0"}),x("path",{d:"M4 8l5 0"}),x("path",{d:"M15 8l4 0"})]}),te),JI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 14c.83 .642 2.077 1.017 3.5 1c1.423 .017 2.67 -.358 3.5 -1c.83 -.642 2.077 -1.017 3.5 -1c1.423 -.017 2.67 .358 3.5 1"}),x("path",{d:"M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),x("path",{d:"M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),x("path",{d:"M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z"}),x("path",{d:"M16.746 16.726a3 3 0 1 0 .252 -5.555"})]}),te),QI=N(W("g",{stroke:"currentColor",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-16a1 1 0 0 1-1-1v-10zM7 20h10M9 16v4M15 16v4"})]}),{...te,strokeWidth:1.5}),Bie=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M15 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"}),x("path",{d:"M21 12h-13l3 -3"}),x("path",{d:"M11 15l-3 -3"})]}),te),eT=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M2 8a4 4 0 0 1 4 -4h12a4 4 0 0 1 4 4v8a4 4 0 0 1 -4 4h-12a4 4 0 0 1 -4 -4v-8z"}),x("path",{d:"M10 9l5 3l-5 3z"})]}),te),tT=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 6h18"}),x("path",{d:"M3 12h18"}),x("path",{d:"M3 18h18"}),x("path",{d:"M6 3v18"}),x("path",{d:"M12 3v18"}),x("path",{d:"M18 3v18"})]}),te),oT=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M17 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}),x("path",{d:"M3 17m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}),x("path",{d:"M17 5c-6.627 0 -12 5.373 -12 12"})]}),te),Sl=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 18l12 -12"}),x("path",{d:"M18 10v-4h-4"})]}),te),Ml=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7"}),x("path",{d:"M18 4l3 3l-3 3"})]}),te),Pl=N(W("g",{children:[x("path",{d:"M16,12L20,9L16,6"}),x("path",{d:"M6 20c0 -6.075 4.925 -11 11 -11h3"})]}),te),pu=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 9l6 6l6 -6"})]}),te),nT=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 15l6 -6l6 6"})]}),te),rT=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 15l6 -6l6 6"})]}),te),o0=N(W("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M8 5v10a1 1 0 0 0 1 1h10"}),x("path",{d:"M5 8h10a1 1 0 0 1 1 1v10"})]}),te),uu=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M19 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M5 7l0 10"}),x("path",{d:"M7 5l10 0"}),x("path",{d:"M7 19l10 0"}),x("path",{d:"M19 7l0 10"})]}),te),Fie=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 11v8a1 1 0 0 0 1 1h8m-9 -14v-1a1 1 0 0 1 1 -1h1m5 0h2m5 0h1a1 1 0 0 1 1 1v1m0 5v2m0 5v1a1 1 0 0 1 -1 1h-1"}),x("path",{d:"M4 12h7a1 1 0 0 1 1 1v7"})]}),te),aT=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 6l8 0"}),x("path",{d:"M16 6l4 0"}),x("path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 12l2 0"}),x("path",{d:"M10 12l10 0"}),x("path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 18l11 0"}),x("path",{d:"M19 18l1 0"})]}),te),iT=N(W("g",{strokeWidth:1,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 10l4 -4 L6 14l8 -8 L6 18l12 -12 L10 18l8 -8 L14 18l4 -4"})]}),te),sT=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"}),x("path",{d:"M13.5 6.5l4 4"})]}),te),Oie=N(W("g",{strokeWidth:1,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M11 7l-5 5l5 5"}),x("path",{d:"M17 7l-5 5l5 5"})]}),te),lT=N(W("g",{strokeWidth:"1.75",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"}),x("path",{d:"M15 4l0 16"})]}),te),zie=N(W("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 20l1.3 -3.9c-2.324 -3.437 -1.426 -7.872 2.1 -10.374c3.526 -2.501 8.59 -2.296 11.845 .48c3.255 2.777 3.695 7.266 1.029 10.501c-2.666 3.235 -7.615 4.215 -11.574 2.293l-4.7 1"})]}),te),Uie=N(W("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 4l18 0"}),x("path",{d:"M4 4v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-10"}),x("path",{d:"M12 16l0 4"}),x("path",{d:"M9 20l6 0"}),x("path",{d:"M8 12l3 -3l2 2l3 -3"})]}),te),cT=x("div",{style:{width:"1rem",height:"1rem"}}),dT=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("polyline",{points:"9 6 15 12 9 18"})]}),te),mT=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 6l8 0"}),x("path",{d:"M16 6l4 0"}),x("path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 12l2 0"}),x("path",{d:"M10 12l10 0"}),x("path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 18l11 0"}),x("path",{d:"M19 18l1 0"})]}),te);import pT from"clsx";import r0,{useEffect as ZR,useRef as uT,useState as qR}from"react";import{isPromiseLike as JR}from"@orangecatai/common";import XR from"react";import{jsx as n0}from"react/jsx-runtime";var jR=({size:e="1em",circleWidth:t=8,synchronized:o=!1,className:n=""})=>{let a=-(XR.useRef(Date.now()).current%1600);return n0("div",{className:`Spinner ${n}`,children:n0("svg",{viewBox:"0 0 100 100",style:{width:e,height:e,"--spinner-delay":o?`${a}ms`:0},children:n0("circle",{cx:"50",cy:"50",r:50-t/2,strokeWidth:t,fill:"none",strokeMiterlimit:"10"})})})},So=jR;import{jsx as Rd,jsxs as Nd}from"react/jsx-runtime";var be=r0.forwardRef(({size:e="medium",visible:t=!0,className:o="",...n},r)=>{let{id:a}=St(),i=r0.useRef(null);r0.useImperativeHandle(r,()=>i.current);let s=`ToolIcon_size_${e}`,[l,c]=qR(!1),m=uT(!0),p=async u=>{let h="onClick"in n&&n.onClick?.(u);if(JR(h))try{c(!0),await h}catch(g){if(g instanceof rl)console.warn(g);else throw g}finally{m.current&&c(!1)}};ZR(()=>(m.current=!0,()=>{m.current=!1}),[]);let d=uT(null);if(n.type==="button"||n.type==="icon"||n.type==="submit"){let u=n.type==="icon"?"button":n.type;return Nd("button",{className:pT("ToolIcon_type_button",s,o,t&&!n.hidden?"ToolIcon_type_button--show":"ToolIcon_type_button--hide",{ToolIcon:!n.hidden,"ToolIcon--selected":n.selected,"ToolIcon--plain":n.type==="icon"}),style:n.style,"data-testid":n["data-testid"],hidden:n.hidden,title:n.title,"aria-label":n["aria-label"],type:u,onClick:p,ref:i,disabled:l||n.isLoading||!!n.disabled,children:[(n.icon||n.label)&&Nd("div",{className:"ToolIcon__icon","aria-hidden":"true","aria-disabled":!!n.disabled,children:[n.icon||n.label,n.keyBindingLabel&&Rd("span",{className:"ToolIcon__keybinding",children:n.keyBindingLabel}),n.isLoading&&Rd(So,{})]}),n.showAriaLabel&&Nd("div",{className:"ToolIcon__label",children:[n["aria-label"]," ",l&&Rd(So,{})]}),n.children]})}return Nd("label",{className:pT("ToolIcon",o),title:n.title,onPointerDown:u=>{d.current=u.pointerType||null,n.onPointerDown?.({pointerType:u.pointerType||null})},onPointerUp:()=>{requestAnimationFrame(()=>{d.current=null})},children:[Rd("input",{className:`ToolIcon_type_radio ${s}`,type:"radio",name:n.name,"aria-label":n["aria-label"],"aria-keyshortcuts":n["aria-keyshortcuts"],"data-testid":n["data-testid"],id:`${a}-${n.id}`,onChange:()=>{n.onChange?.({pointerType:d.current})},checked:n.checked,ref:i}),Nd("div",{className:"ToolIcon__icon",children:[n.icon,n.keyBindingLabel&&Rd("span",{className:"ToolIcon__keybinding",children:n.keyBindingLabel})]})]})});be.displayName="ToolButton";var gu=[],X=e=>(gu=gu.concat(e),e);import{jsx as s8}from"react/jsx-runtime";var i8=(e,t,o)=>{let n=new Set(Me(e.filter(m=>n8(m)),t).map(m=>m.id)),r={},a=o.scene.getNonDeletedElementsMap(),i=new Set;for(let m of n){let p=r8(e,m);for(let d of p)if(!i.has(d.id)){if(hu(d)){let u=hT(d,a);u&&(r[u.id]=!0)}else r[d.id]=!0;i.add(d.id)}}let s=!0,l=e.map(m=>{if(t.selectedElementIds[m.id]){let p=hu(m)?hT(m,a):null;return m.frameId&&n.has(m.frameId)?(s=!1,r[m.id]=!0,m):p?.frameId&&n.has(p?.frameId)?m:(m.boundElements&&m.boundElements.forEach(d=>{let u=o.scene.getNonDeletedElementsMap().get(d.id);u&&o8(u)&&o.scene.mutateElement(u,{startBinding:m.id===u.startBinding?.elementId?null:u.startBinding,endBinding:m.id===u.endBinding?.elementId?null:u.endBinding})}),bu(m,{isDeleted:!0}))}return m.frameId&&n.has(m.frameId)?(s=!1,hu(m)||(r[m.id]=!0),bu(m,{frameId:null})):hu(m)&&t.selectedElementIds[m.containerId]?bu(m,{isDeleted:!0}):m}),c=t.editingGroupId;if(s&&t.editingGroupId){let m=s0(l,t.editingGroupId).filter(p=>!p.isDeleted);if(m.length>1)m[0]&&(r[m[0].id]=!0);else{c=null,m[0]&&(r[m[0].id]=!0);let p=m[0];if(p){let d=p.groupIds.findIndex(h=>h===t.editingGroupId),u=p.groupIds[d+1];if(u){let h=s0(l,u).filter(g=>!g.isDeleted);h.length>1&&(c=u,h.forEach(g=>{r[g.id]=!0}))}}}}return{elements:l,appState:{...t,...a8({selectedElementIds:r,editingGroupId:c},l,t,null)}}},fT=(e,t)=>{if(e.editingGroupId){let o=s0(i0(t),e.editingGroupId);if(o.length)return{...e,selectedElementIds:{[o[0].id]:!0}}}return e},Bd=X({name:"deleteSelectedElements",label:"labels.delete",icon:Co,trackEvent:{category:"element",action:"delete"},perform:(e,t,o,n)=>{if(t.selectedLinearElement?.isEditing){let{elementId:i,selectedPointsIndices:s}=t.selectedLinearElement,l=n.scene.getNonDeletedElementsMap(),c=gT.getElement(i,l);if(!c||s==null)return!1;if(s.length>=c.points.length){let m=e.map(d=>d.id===c.id?bu(d,{isDeleted:!0}):d),p=fT(t,m);return{elements:m,appState:{...p,selectedLinearElement:null},captureUpdate:fu.IMMEDIATELY}}return gT.deletePoints(c,n,s),{elements:e,appState:{...t,selectedLinearElement:{...t.selectedLinearElement,selectedPointsIndices:s?.[0]>0?[s[0]-1]:[0]}},captureUpdate:fu.IMMEDIATELY}}let{elements:r,appState:a}=i8(e,t,n);return t8(r,r.filter(i=>i.isDeleted)),a=fT(a,r),{elements:r,appState:{...a,activeTool:e8(t,{type:n.state.preferredSelectionTool.type}),multiElement:null,newElement:null,activeEmbeddable:null,selectedLinearElement:null},captureUpdate:ft(i0(e),t)?fu.IMMEDIATELY:fu.EVENTUALLY}},keyTest:(e,t,o)=>(e.key===a0.BACKSPACE||e.key===a0.DELETE)&&!e[a0.CTRL_OR_CMD],PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=ho()==="mobile";return s8(be,{type:"button",icon:Co,title:b("labels.delete"),"aria-label":b("labels.delete"),onClick:()=>o(null),disabled:!ft(i0(e),t),style:{...r&&t.openPopup!=="compactOtherProperties"?QR:{}}})}});import{KEYS as Al,CODES as Ll,isDarwin as xu}from"@orangecatai/common";import{moveOneLeft as l8,moveOneRight as c8,moveAllLeft as d8,moveAllRight as m8}from"@orangecatai/element";import{CaptureUpdateAction as yu}from"@orangecatai/element";import{isDarwin as bT}from"@orangecatai/common";var V=e=>e.replace(/\b(Opt(?:ion)?|Alt)\b/i,bT?b("keys.option"):b("keys.alt")).replace(/\bShift\b/i,b("keys.shift")).replace(/\b(Enter|Return)\b/i,b("keys.enter")).replace(/\b(Ctrl|Cmd|Command|CtrlOrCmd)\b/gi,bT?b("keys.cmd"):b("keys.ctrl")).replace(/\b(Esc(?:ape)?)\b/i,b("keys.escape")).replace(/\b(Space(?:bar)?)\b/i,b("keys.spacebar")).replace(/\b(Del(?:ete)?)\b/i,b("keys.delete"));import{jsx as wu}from"react/jsx-runtime";var l0=X({name:"sendBackward",label:"labels.sendBackward",keywords:["move down","zindex","layer"],icon:Hb,trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:l8(e,t,n.scene),appState:t,captureUpdate:yu.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[Al.CTRL_OR_CMD]&&!e.shiftKey&&e.code===Ll.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>wu("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${b("labels.sendBackward")} \u2014 ${V("CtrlOrCmd+[")}`,children:Hb})}),c0=X({name:"bringForward",label:"labels.bringForward",keywords:["move up","zindex","layer"],icon:Ub,trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:c8(e,t,n.scene),appState:t,captureUpdate:yu.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[Al.CTRL_OR_CMD]&&!e.shiftKey&&e.code===Ll.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>wu("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${b("labels.bringForward")} \u2014 ${V("CtrlOrCmd+]")}`,children:Ub})}),d0=X({name:"sendToBack",label:"labels.sendToBack",keywords:["move down","zindex","layer"],icon:$b,trackEvent:{category:"element"},perform:(e,t)=>({elements:d8(e,t),appState:t,captureUpdate:yu.IMMEDIATELY}),keyTest:e=>xu?e[Al.CTRL_OR_CMD]&&e.altKey&&e.code===Ll.BRACKET_LEFT:e[Al.CTRL_OR_CMD]&&e.shiftKey&&e.code===Ll.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>wu("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${b("labels.sendToBack")} \u2014 ${xu?V("CtrlOrCmd+Alt+["):V("CtrlOrCmd+Shift+[")}`,children:$b})}),m0=X({name:"bringToFront",label:"labels.bringToFront",keywords:["move up","zindex","layer"],icon:Gb,trackEvent:{category:"element"},perform:(e,t)=>({elements:m8(e,t),appState:t,captureUpdate:yu.IMMEDIATELY}),keyTest:e=>xu?e[Al.CTRL_OR_CMD]&&e.altKey&&e.code===Ll.BRACKET_RIGHT:e[Al.CTRL_OR_CMD]&&e.shiftKey&&e.code===Ll.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>wu("button",{type:"button",className:"zIndexButton",onClick:o=>e(null),title:`${b("labels.bringToFront")} \u2014 ${xu?V("CtrlOrCmd+Alt+]"):V("CtrlOrCmd+Shift+]")}`,children:Gb})});import{getNonDeletedElements as p8}from"@orangecatai/element";import{LinearElementEditor as u8}from"@orangecatai/element";import{isLinearElement as g8,isTextElement as h8}from"@orangecatai/element";import{arrayToMap as f8,KEYS as xT}from"@orangecatai/common";import{selectGroupsForSelectedElements as b8}from"@orangecatai/element";import{CaptureUpdateAction as x8}from"@orangecatai/element";var p0=X({name:"selectAll",label:"labels.selectAll",icon:WI,trackEvent:{category:"canvas"},viewMode:!1,perform:(e,t,o,n)=>{if(t.selectedLinearElement?.isEditing)return!1;let r=e.filter(a=>!a.isDeleted&&!(h8(a)&&a.containerId)&&!a.locked).reduce((a,i)=>(a[i.id]=!0,a),{});return{appState:{...t,...b8({editingGroupId:null,selectedElementIds:r},p8(e),t,n),selectedLinearElement:Object.keys(r).length===1&&g8(e[0])?new u8(e[0],f8(e)):null},captureUpdate:x8.IMMEDIATELY}},keyTest:e=>e[xT.CTRL_OR_CMD]&&e.key===xT.A});import{DEFAULT_GRID_SIZE as yT,KEYS as wT,MOBILE_ACTION_BUTTON_BG as y8,arrayToMap as vT}from"@orangecatai/common";import{getNonDeletedElements as ET}from"@orangecatai/element";import{LinearElementEditor as w8}from"@orangecatai/element";import{getSelectedElements as v8,getSelectionStateForElements as E8}from"@orangecatai/element";import{syncMovedIndices as I8}from"@orangecatai/element";import{duplicateElements as T8}from"@orangecatai/element";import{CaptureUpdateAction as IT}from"@orangecatai/element";import{jsx as k8}from"react/jsx-runtime";var u0=X({name:"duplicateSelection",label:"labels.duplicateSelection",icon:Sd,trackEvent:{category:"element"},perform:(e,t,o,n)=>{if(t.selectedElementsAreBeingDragged)return!1;if(t.selectedLinearElement?.isEditing)try{let i=w8.duplicateSelectedPoints(t,n.scene);return{elements:e,appState:i,captureUpdate:IT.IMMEDIATELY}}catch{return!1}let{duplicatedElements:r,elementsWithDuplicates:a}=T8({type:"in-place",elements:e,idsOfElementsToDuplicate:vT(v8(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),appState:t,randomizeSeed:!0,overrides:({origElement:i,origIdToDuplicateId:s})=>{let l=i.frameId&&s.get(i.frameId);return{x:i.x+yT/2,y:i.y+yT/2,frameId:l??i.frameId}}});if(n.props.onDuplicate&&a){let i=n.props.onDuplicate(a,e);i&&(a=i)}return{elements:I8(a,vT(r)),appState:{...t,...E8(r,ET(a),t)},captureUpdate:IT.IMMEDIATELY}},keyTest:e=>e[wT.CTRL_OR_CMD]&&e.key===wT.D,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=ho()==="mobile";return k8(be,{type:"button",icon:Sd,title:`${b("labels.duplicateSelection")} \u2014 ${V("CtrlOrCmd+D")}`,"aria-label":b("labels.duplicateSelection"),onClick:()=>o(null),disabled:!ft(ET(e),t),style:{...r&&t.openPopup!=="compactOtherProperties"?y8:{}}})}});import{pointFrom as C7}from"@orangecatai/math";import{useEffect as B0,useMemo as S7,useRef as F0,useState as M7}from"react";import{DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE as P7,DEFAULT_ELEMENT_BACKGROUND_PICKS as A7,DEFAULT_ELEMENT_STROKE_COLOR_PALETTE as L7,DEFAULT_ELEMENT_STROKE_PICKS as _7,ARROW_TYPE as Un,DEFAULT_FONT_FAMILY as D7,DEFAULT_FONT_SIZE as R7,FONT_FAMILY as N7,ROUNDNESS as Fu,STROKE_WIDTH as O0,VERTICAL_ALIGN as Nu,KEYS as zl,randomInteger as B7,arrayToMap as U0,getFontFamilyString as F7,getLineHeight as O7,isTransparent as z7,reduceToCommonValue as U7,invariant as H0,FONT_SIZES as Bu}from"@orangecatai/common";import{canBecomePolygon as H7,getNonDeletedElements as uk}from"@orangecatai/element";import{bindBindingElement as ck,calculateFixedPointForElbowArrowBinding as dk,updateBoundElements as G7}from"@orangecatai/element";import{LinearElementEditor as us}from"@orangecatai/element";import{newElementWith as io}from"@orangecatai/element";import{getBoundTextElement as ni,redrawTextBoundingBox as Xd}from"@orangecatai/element";import{isArrowElement as Ou,isBoundToContainer as $7,isElbowArrow as gk,isLinearElement as z0,isLineElement as mk,isTextElement as nn,isUsingAdaptiveRadius as V7}from"@orangecatai/element";import{hasStrokeColor as W7}from"@orangecatai/element";import{updateElbowArrowPoints as K7,CaptureUpdateAction as so,toggleLinePolygonState as Y7}from"@orangecatai/element";import{deriveStylesPanelMode as X7}from"@orangecatai/common";import{isDevEnv as C8}from"@orangecatai/common";var S8=new Set(["command_palette","export"]),Ne=(e,t,o,n)=>{try{if(typeof window>"u"||C.VITE_WORKER_ID||C.VITE_APP_ENABLE_TRACKING!=="true"||!S8.has(e)||C8())return;C.PROD||console.info("trackEvent",{category:e,action:t,label:o,value:n}),window.sa_event&&window.sa_event(t,{category:e,label:o,value:n})}catch(r){console.error("error during analytics",r)}};import L8 from"clsx";import M8 from"clsx";import{forwardRef as P8}from"react";import{jsx as A8}from"react/jsx-runtime";var _l=P8((e,t)=>{let{title:o,className:n,testId:r,active:a,standalone:i,icon:s,onClick:l}=e;return A8("button",{type:"button",ref:t,title:o,"data-testid":r,className:M8(n,{standalone:i,active:a}),onClick:l,style:e.style,children:s},o)});import{Fragment as D8,jsx as g0,jsxs as _8}from"react/jsx-runtime";var Bn=e=>g0(D8,{children:e.options.map(t=>e.type==="button"?g0(_l,{icon:t.icon,title:t.text,testId:t.testId,active:t.active??e.value===t.value,onClick:o=>e.onClick(t.value,o)},t.text):_8("label",{className:L8({active:e.value===t.value}),title:t.text,children:[g0("input",{type:"radio",name:e.group,onChange:()=>e.onChange(t.value),checked:e.value===t.value,"data-testid":t.testId}),t.icon]},t.text))});import{Popover as $T}from"radix-ui";import VT from"clsx";import{useRef as WT,useEffect as NN}from"react";import{COLOR_OUTLINE_CONTRAST_THRESHOLD as HT,COLOR_PALETTE as KT,isColorDark as GT,isWritableElement as BN}from"@orangecatai/common";import{jsx as R8}from"react/jsx-runtime";var vu=()=>R8("div",{style:{width:1,height:"1rem",backgroundColor:"var(--default-border-color)",margin:"0 auto"}});import{useEffect as z8,useRef as U8}from"react";import{createPortal as H8}from"react-dom";import{EVENT as Za,KEYS as G8,rgbToHex as $8}from"@orangecatai/common";import TT from"react";var h0=TT.createContext(null),Ze=()=>TT.useContext(h0);import{useState as N8,useLayoutEffect as kT}from"react";import{THEME as B8}from"@orangecatai/common";var Eu=e=>{let[t,o]=N8(null),n=qe(),{theme:r}=Ze(),{container:a}=St();return kT(()=>{t&&(t.className="",t.classList.add("excalidraw",...e?.className?.split(/\s+/)||[]),t.classList.toggle("excalidraw--mobile",n.formFactor==="phone"),t.classList.toggle("theme--dark",r===B8.DARK))},[t,r,n.formFactor,e?.className]),kT(()=>{let i=e?.parentSelector?a?.querySelector(e.parentSelector):document.body;if(!i)return;let s=document.createElement("div");return i.appendChild(s),o(s),()=>{i.removeChild(s)}},[a,e?.parentSelector]),t};import{useEffect as F8}from"react";import{EVENT as Iu}from"@orangecatai/common";function Dl(e,t,o){F8(()=>{function n(r){let a=r;if(!e.current)return;let i=o?.(a,e.current);if(i===!0)return;if(i===!1)return t(a);e.current.contains(a.target)||!document.documentElement.contains(a.target)||a.target.closest("[data-radix-portal]")||a.target===document.documentElement&&document.body.style.pointerEvents==="none"||a.target.closest("[data-prevent-outside-click]")||t(a)}return document.addEventListener(Iu.POINTER_DOWN,n),document.addEventListener(Iu.TOUCH_START,n),()=>{document.removeEventListener(Iu.POINTER_DOWN,n),document.removeEventListener(Iu.TOUCH_START,n)}},[e,t,o])}import{useRef as O8}from"react";var ja=e=>{let t=O8(e);return Object.assign(t.current,e),t.current};import{jsx as V8}from"react/jsx-runtime";var qa=je(null),CT=({onCancel:e,onChange:t,onSelect:o,colorPickerType:n})=>{let r=Eu({className:"excalidraw-eye-dropper-backdrop",parentSelector:".excalidraw-eye-dropper-container"}),a=Ze(),i=Fn(),s=Mt(),l=Me(i,a),c=ja({app:s,onCancel:e,onChange:t,onSelect:o,selectedElements:l}),{container:m}=St();z8(()=>{let d=p.current;if(!d||!s.canvas||!r)return;let u=!1,h=s.canvas.getContext("2d"),g=({clientX:k,clientY:S})=>{let T=h.getImageData((k-a.offsetLeft)*window.devicePixelRatio,(S-a.offsetTop)*window.devicePixelRatio,1,1).data;return $8(T[0],T[1],T[2])},f=({clientX:k,clientY:S,altKey:T})=>{d.style.top=`${S+20}px`,d.style.left=`${k+20}px`;let A=g({clientX:k,clientY:S});u&&c.onChange(n,A,c.selectedElements,{altKey:T}),d.style.background=A},w=()=>{c.onCancel()},y=(k,S)=>{c.onSelect(k,S)},v=k=>{u=!0,k.stopImmediatePropagation()},E=k=>{u=!1,m?.focus(),k.stopImmediatePropagation(),k.preventDefault(),y(g(k),k)},I=k=>{k.key===G8.ESCAPE&&(k.preventDefault(),k.stopImmediatePropagation(),w())};return r.tabIndex=-1,r.focus(),f({clientX:c.app.lastViewportPosition.x,clientY:c.app.lastViewportPosition.y,altKey:!1}),r.addEventListener(Za.KEYDOWN,I),r.addEventListener(Za.POINTER_DOWN,v),r.addEventListener(Za.POINTER_UP,E),window.addEventListener("pointermove",f,{passive:!0}),window.addEventListener(Za.BLUR,w),()=>{u=!1,r.removeEventListener(Za.KEYDOWN,I),r.removeEventListener(Za.POINTER_DOWN,v),r.removeEventListener(Za.POINTER_UP,E),window.removeEventListener("pointermove",f),window.removeEventListener(Za.BLUR,w)}},[c,s.canvas,r,n,m,a.offsetLeft,a.offsetTop]);let p=U8(null);return Dl(p,()=>{e()},d=>!!d.target.closest(".excalidraw-eye-dropper-trigger, .excalidraw-eye-dropper-backdrop")),r?H8(V8("div",{ref:p,className:"excalidraw-eye-dropper-preview"}),r):null};import{Popover as f0}from"radix-ui";import X8 from"clsx";import j8 from"react";import{isInteractive as Z8}from"@orangecatai/common";import W8 from"react";import K8 from"clsx";import{jsx as Y8}from"react/jsx-runtime";var $t=W8.forwardRef(({children:e,padding:t,className:o,style:n},r)=>Y8("div",{className:K8("Island",o),style:{"--padding":t,...n},ref:r,children:e}));import{jsx as b0,jsxs as q8}from"react/jsx-runtime";var ca=j8.forwardRef(({className:e,container:t,children:o,style:n,onClose:r,onKeyDown:a,onFocusOutside:i,onPointerLeave:s,onPointerDownOutside:l,preventAutoFocusOnTouch:c=!1},m)=>{let p=qe(),d=p.formFactor==="phone"&&!p.isLandscape;return b0(f0.Portal,{container:t,children:q8(f0.Content,{ref:m,className:X8("focus-visible-none",e),"data-prevent-outside-click":!0,side:d?"bottom":"right",align:d?"center":"start",alignOffset:-16,sideOffset:20,collisionBoundary:t??void 0,style:{zIndex:"var(--zIndex-ui-styles-popup)",marginLeft:p.formFactor==="phone"?"0.5rem":void 0},onPointerLeave:s,onKeyDown:a,onFocusOutside:i,onPointerDownOutside:l,onOpenAutoFocus:u=>{c&&p.isTouchScreen&&u.preventDefault()},onCloseAutoFocus:u=>{u.stopPropagation(),u.preventDefault(),t&&!Z8(document.activeElement)&&t.focus(),r()},children:[b0($t,{padding:3,style:n,children:o}),b0(f0.Arrow,{width:20,height:10,style:{fill:"var(--popup-bg-color)",filter:"drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)"}})]})})});import{useState as J8,useCallback as x0}from"react";var Tu=()=>document.querySelector(".excalidraw-wysiwyg"),ku=()=>{let e=Tu();return e?{start:e.selectionStart,end:e.selectionEnd}:null},Fd=e=>{setTimeout(()=>{let t=Tu();t&&(t.focus(),e&&(t.selectionStart=e.start,t.selectionEnd=e.end))},0)},Od=(e,t,o,n)=>{t&&n&&n();let r=t&&o?ku():null;e(),t&&o&&Fd(r)},ST=()=>{let[e,t]=J8(null),o=x0(()=>{let a=ku();t(a)},[]),n=x0(()=>{setTimeout(()=>{let a=Tu();a&&(a.focus(),e&&(a.selectionStart=e.start,a.selectionEnd=e.end,t(null)))},0)},[e]),r=x0(()=>{t(null)},[]);return{saveCaretPosition:o,restoreCaretPosition:n,clearSavedPosition:r,hasSavedPosition:!!e}},MT=(e=100)=>{let t=Tu();if(t){let o=t.onblur;t.onblur=null,setTimeout(()=>{t.onblur=o},e)}};import eN from"clsx";import{useCallback as tN,useEffect as w0,useRef as AT,useState as oN}from"react";import{KEYS as v0,normalizeInputColor as nN}from"@orangecatai/common";import{MAX_CUSTOM_COLORS_USED_IN_CANVAS as Q8}from"@orangecatai/common";var Ja=({palette:e,color:t})=>{if(!t)return null;for(let[o,n]of Object.entries(e))if(Array.isArray(n)){let r=n.indexOf(t);if(r>-1)return{colorName:o,shade:r}}else if(n===t)return{colorName:o,shade:null};return null},zd=[["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),y0=({color:e,palette:t})=>!Object.values(t).flat().includes(e),PT=(e,t,o)=>{let n={elementBackground:"backgroundColor",elementStroke:"strokeColor"},r=e.filter(i=>{if(i.isDeleted)return!1;let s=i[n[t]];return y0({color:s,palette:o})}),a=new Map;return r.forEach(i=>{let s=i[n[t]];a.has(s)?a.set(s,a.get(s)+1):a.set(s,1)}),[...a.entries()].sort((i,s)=>s[1]-i[1]).map(i=>i[0]).slice(0,Q8)},On=je(null);import{Fragment as rN,jsx as Cu,jsxs as LT}from"react/jsx-runtime";var _T=({color:e,onChange:t,label:o,colorPickerType:n,placeholder:r})=>{let a=qe(),[i,s]=oN(e),[l,c]=ve(On);w0(()=>{s(e)},[e]);let m=tN(g=>{let f=g.toLowerCase(),w=nN(f);w&&t(w),s(f)},[t]),p=AT(null),d=AT(null);w0(()=>{p.current&&p.current.focus()},[l]);let[u,h]=ve(qa);return w0(()=>()=>{h(null)},[h]),LT("div",{className:"color-picker__input-label",children:[Cu("div",{className:"color-picker__input-hash",children:"#"}),Cu("input",{ref:l==="hex"?p:void 0,style:{border:0,padding:0},spellCheck:!1,className:"color-picker-input","aria-label":o,onChange:g=>{m(g.target.value)},value:(i||"").replace(/^#/,""),onBlur:()=>{s(e)},tabIndex:-1,onFocus:()=>c("hex"),onKeyDown:g=>{g.key!==v0.TAB&&(g.key===v0.ESCAPE&&d.current?.focus(),g.stopPropagation())},placeholder:r}),a.formFactor!=="phone"&&LT(rN,{children:[Cu("div",{style:{width:"1px",height:"1.25rem",backgroundColor:"var(--default-border-color)"}}),Cu("div",{ref:d,className:eN("excalidraw-eye-dropper-trigger",{selected:u}),onClick:()=>h(g=>g?null:{keepOpenOnAlt:!1,onSelect:f=>t(f),colorPickerType:n}),title:`${b("labels.eyeDropper")} \u2014 ${v0.I.toLocaleUpperCase()} or ${V("Alt")} `,children:RI})]})]})};import k0,{useEffect as C0,useImperativeHandle as TN,useState as kN}from"react";import{EVENT as OT}from"@orangecatai/common";import{DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX as CN,DEFAULT_ELEMENT_STROKE_COLOR_INDEX as SN,KEYS as MN}from"@orangecatai/common";import lN from"clsx";import{useEffect as cN,useRef as dN}from"react";import{isColorDark as aN}from"@orangecatai/common";import{jsxs as sN}from"react/jsx-runtime";var iN=({color:e,keyLabel:t,isShade:o=!1})=>sN("div",{className:"color-picker__button__hotkey-label",style:{color:aN(e)?"#fff":"#000"},children:[o&&"\u21E7",t]}),Rl=iN;import{jsx as E0,jsxs as mN}from"react/jsx-runtime";var DT=({colors:e,color:t,onChange:o,label:n})=>{let[r,a]=ve(On),i=dN(null);return cN(()=>{i.current&&i.current.focus()},[t,r]),E0("div",{className:"color-picker-content--default",children:e.map((s,l)=>mN("button",{ref:t===s?i:void 0,tabIndex:-1,type:"button",className:lN("color-picker__button color-picker__button--large has-outline",{active:t===s,"is-transparent":s==="transparent"||!s}),onClick:()=>{o(s),a("custom")},title:s,"aria-label":n,style:{"--swatch-color":s},children:[E0("div",{className:"color-picker__button-outline"}),E0(Rl,{color:s,keyLabel:l+1})]},l))})};import pN from"clsx";import{useEffect as uN,useRef as gN}from"react";import{jsx as I0,jsxs as fN}from"react/jsx-runtime";var hN=({palette:e,color:t,onChange:o,activeShade:n,showHotKey:r=!0})=>{let a=Ja({color:t,palette:e}),[i,s]=ve(On),l=gN(null);return uN(()=>{l.current&&i==="baseColors"&&l.current.focus()},[a?.colorName,i]),I0("div",{className:"color-picker-content--default",children:Object.entries(e).map(([c,m],p)=>{let d=(Array.isArray(m)?m[n]:m)||"transparent",u=zd[p],h=b(`colors.${c.replace(/\d+/,"")}`,null,"");return fN("button",{ref:a?.colorName===c?l:void 0,tabIndex:-1,type:"button",className:pN("color-picker__button color-picker__button--large has-outline",{active:a?.colorName===c,"is-transparent":d==="transparent"||!d}),onClick:()=>{o(d),s("baseColors")},title:`${h}${d.startsWith("#")?` ${d}`:""} \u2014 ${u}`,"aria-label":`${h} \u2014 ${u}`,style:d?{"--swatch-color":d}:void 0,"data-testid":`color-${c}`,children:[I0("div",{className:"color-picker__button-outline"}),r&&I0(Rl,{color:d,keyLabel:u})]},c)})})},RT=hN;import{jsx as xN}from"react/jsx-runtime";var bN=({children:e})=>xN("div",{className:"color-picker__heading",children:e}),Nl=bN;import yN from"clsx";import{useEffect as wN,useRef as vN}from"react";import{jsx as Ud,jsxs as NT}from"react/jsx-runtime";var BT=({color:e,onChange:t,palette:o,showHotKey:n})=>{let r=Ja({color:e||"transparent",palette:o}),[a,i]=ve(On),s=vN(null);if(wN(()=>{s.current&&a==="shades"&&s.current.focus()},[r,a]),r){let{colorName:l,shade:c}=r,m=o[l];if(Array.isArray(m))return Ud("div",{className:"color-picker-content--default shades",children:m.map((p,d)=>NT("button",{ref:d===c&&a==="shades"?s:void 0,tabIndex:-1,type:"button",className:yN("color-picker__button color-picker__button--large has-outline",{active:d===c}),"aria-label":"Shade",title:`${l} - ${d+1}`,style:p?{"--swatch-color":p}:void 0,onClick:()=>{t(p),i("shades")},children:[Ud("div",{className:"color-picker__button-outline"}),n&&Ud(Rl,{color:p,keyLabel:d+1,isShade:!0})]},d))})}return NT("div",{className:"color-picker-content--default",style:{position:"relative"},tabIndex:-1,children:[Ud("button",{type:"button",tabIndex:-1,className:"color-picker__button color-picker__button--large color-picker__button--no-focus-visible"}),Ud("div",{tabIndex:-1,style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:"0.75rem"},children:b("colorPicker.noShades")})]})};import{COLORS_PER_ROW as Bl,COLOR_PALETTE as EN,KEYS as Hd}from"@orangecatai/common";var T0=(e,t,o)=>{let n=Math.ceil(o/Bl);switch(t=t??-1,e){case"ArrowLeft":{let r=t-1;return r<0?o-1:r}case"ArrowRight":return(t+1)%o;case"ArrowDown":{let r=t+Bl;return r>=o?t%Bl:r}case"ArrowUp":{let r=t-Bl,a=r<0?Bl*n+r:r;return a>=o?void 0:a}}},IN=({e,colorObj:t,onChange:o,palette:n,customColors:r,setActiveColorPickerSection:a,activeShade:i})=>{if(t?.shade!=null&&["Digit1","Digit2","Digit3","Digit4","Digit5"].includes(e.code)&&e.shiftKey){let s=Number(e.code.slice(-1))-1;return o(n[t.colorName][s]),a("shades"),!0}if(["1","2","3","4","5"].includes(e.key)&&r[Number(e.key)-1])return o(r[Number(e.key)-1]),a("custom"),!0;if(zd.includes(e.key)){let s=zd.indexOf(e.key),l=Object.keys(n)[s],c=n[l],m=Array.isArray(c)?c[i]:c;return o(m),a("baseColors"),!0}return!1},FT=({event:e,activeColorPickerSection:t,palette:o,color:n,onChange:r,customColors:a,setActiveColorPickerSection:i,updateData:s,activeShade:l,onEyeDropperToggle:c,onEscape:m})=>{if(e[Hd.CTRL_OR_CMD])return!1;if(e.key===Hd.ESCAPE)return m(e),!0;if(e.key===Hd.ALT)return c(!0),!0;if(e.key===Hd.I)return c(),!0;let p=Ja({color:n,palette:o});if(e.key===Hd.TAB){let d={custom:!!a.length,baseColors:!0,shades:p?.shade!=null,hex:!0},u=Object.entries(d).reduce((y,[v,E])=>(E&&y.push(v),y),[]),h=u.indexOf(t),g=e.shiftKey?-1:1,f=h+g>u.length-1?0:h+g<0?u.length-1:h+g,w=u[f];return w&&i(w),w==="custom"?r(a[0]):w==="baseColors"&&(Object.entries(o).find(([v,E])=>Array.isArray(E)?E.includes(n):E===n?v:null)||r(EN.black)),e.preventDefault(),e.stopPropagation(),!0}if(IN({e,colorObj:p,onChange:r,palette:o,customColors:a,setActiveColorPickerSection:i,activeShade:l}))return!0;if(t==="shades"&&p){let{shade:d}=p,u=T0(e.key,d,Bl);if(u!==void 0)return r(o[p.colorName][u]),!0}if(t==="baseColors"&&p){let{colorName:d}=p,u=Object.keys(o),h=u.indexOf(d),g=T0(e.key,h,u.length);if(g!==void 0){let f=u[g],w=o[f];return r(Array.isArray(w)?w[l]:w),!0}}if(t==="custom"){let d=n!=null?a.indexOf(n):0,u=T0(e.key,d,a.length);if(u!==void 0){let h=a[u];return r(h),!0}}return!1};import{jsx as Qa,jsxs as Su}from"react/jsx-runtime";var zT=k0.forwardRef(({color:e,onChange:t,type:o,elements:n,palette:r,updateData:a,children:i,showTitle:s,onEyeDropperToggle:l,onEscape:c,showHotKey:m=!0},p)=>{let d=s?o==="elementStroke"?b("labels.stroke"):o==="elementBackground"?b("labels.background"):null:null,[u]=k0.useState(()=>o==="canvasBackground"?[]:PT(n,o,r)),[h,g]=ve(On),f=Ja({color:e,palette:r});C0(()=>{if(!h){let E=!!e&&y0({color:e,palette:r}),I=E&&!u.includes(e);g(I?null:E?"custom":f?.shade!=null?"shades":"baseColors")}},[h,e,r,g,f,u]);let[w,y]=kN(f?.shade??(o==="elementBackground"?CN:SN));C0(()=>{f?.shade!=null&&y(f.shade);let E=I=>{I.key===MN.ALT&&l(!1)};return document.addEventListener(OT.KEYUP,E,{capture:!0}),()=>{document.removeEventListener(OT.KEYUP,E,{capture:!0})}},[f,l]);let v=k0.useRef(null);return TN(p,()=>v.current),C0(()=>{v?.current?.focus()},[]),Qa("div",{role:"dialog","aria-modal":"true","aria-label":b("labels.colorPicker"),children:Su("div",{ref:v,onKeyDown:E=>{FT({event:E,activeColorPickerSection:h,palette:r,color:e,onChange:t,onEyeDropperToggle:l,customColors:u,setActiveColorPickerSection:g,updateData:a,activeShade:w,onEscape:c})&&(E.preventDefault(),E.stopPropagation())},className:"color-picker-content properties-content",tabIndex:-1,children:[d&&Qa("div",{className:"color-picker__title",children:d}),!!u.length&&Su("div",{children:[Qa(Nl,{children:b("colorPicker.mostUsedCustomColors")}),Qa(DT,{colors:u,color:e,label:b("colorPicker.mostUsedCustomColors"),onChange:t})]}),Su("div",{children:[Qa(Nl,{children:b("colorPicker.colors")}),Qa(RT,{color:e,palette:r,onChange:t,activeShade:w,showHotKey:m})]}),Su("div",{children:[Qa(Nl,{children:b("colorPicker.shades")}),Qa(BT,{color:e,onChange:t,palette:r,showHotKey:m})]}),i]})})});import PN from"clsx";import{COLOR_OUTLINE_CONTRAST_THRESHOLD as AN,DEFAULT_CANVAS_BACKGROUND_PICKS as LN,DEFAULT_ELEMENT_BACKGROUND_PICKS as _N,DEFAULT_ELEMENT_STROKE_PICKS as DN,isColorDark as RN}from"@orangecatai/common";import{jsx as S0}from"react/jsx-runtime";var UT=({onChange:e,type:t,activeColor:o,topPicks:n})=>{let r;return t==="elementStroke"&&(r=DN),t==="elementBackground"&&(r=_N),t==="canvasBackground"&&(r=LN),n&&(r=n),r?S0("div",{className:"color-picker__top-picks",children:r.map(a=>S0("button",{className:PN("color-picker__button",{active:a===o,"is-transparent":a==="transparent"||!a,"has-outline":!RN(a,AN)}),style:{"--swatch-color":a},type:"button",title:a,onClick:()=>e(a),"data-testid":`color-top-pick-${a}`,children:S0("div",{className:"color-picker__button-outline"})},a))}):(console.error("Invalid type for TopPicks"),null)};import{jsx as zn,jsxs as Mu}from"react/jsx-runtime";var FN=({type:e,color:t,onChange:o,label:n,elements:r,palette:a=KT,updateData:i,getOpenPopup:s,appState:l})=>{let{container:c}=St(),m=ho(),p=m!=="full",d=m==="mobile",[,u]=ve(On),[h,g]=ve(qa),f=Mu("div",{children:[zn(Nl,{children:b("colorPicker.hexCode")}),zn(_T,{color:t||"",label:n,onChange:v=>{o(v)},colorPickerType:e,placeholder:b("colorPicker.color")})]}),w=WT(null),y=()=>{w.current?.focus()};return zn(ca,{container:c,style:{maxWidth:"13rem"},preventAutoFocusOnTouch:!!l.editingTextElement,onFocusOutside:v=>{BN(v.target)||y(),v.preventDefault()},onPointerDownOutside:v=>{h&&v.preventDefault()},onClose:()=>{s()===e&&i({openPopup:null}),u(null),l.editingTextElement&&setTimeout(()=>{let v=document.querySelector(".excalidraw-wysiwyg");v&&v.focus()},0)},children:a?zn(zT,{ref:w,palette:a,color:t,onChange:v=>{let E=l.editingTextElement?ku():null;o(v),l.editingTextElement&&E&&Fd(E)},onEyeDropperToggle:v=>{g(E=>v?(E=E||{keepOpenOnAlt:!0,onSelect:o,colorPickerType:e},E.keepOpenOnAlt=!0,E):v===!1||E?null:{keepOpenOnAlt:!1,onSelect:o,colorPickerType:e})},onEscape:v=>{h?g(null):i({openPopup:null})},type:e,elements:r,updateData:i,showTitle:p,showHotKey:!d,children:f}):f})},ON=({label:e,color:t,type:o,mode:n="background",onToggle:r,editingTextElement:a})=>{let i=ho(),s=i!=="full",l=i==="mobile",c=m=>{m.preventDefault(),m.stopPropagation(),a&&MT(),r()};return Mu($T.Trigger,{type:"button",className:VT("color-picker__button active-color properties-trigger",{"is-transparent":!t||t==="transparent","has-outline":!t||!GT(t,HT),"compact-sizing":s,"mobile-border":l}),"aria-label":e,style:t?{"--swatch-color":t}:void 0,title:o==="elementStroke"?b("labels.showStroke"):b("labels.showBackground"),"data-openpopup":o,onClick:c,children:[zn("div",{className:"color-picker__button-outline",children:!t&&O2}),s&&t&&n==="stroke"&&zn("div",{className:"color-picker__button-background",children:zn("span",{style:{color:t&&GT(t,HT)?"#fff":"#111"},children:iT})})]})},Gd=({type:e,color:t,onChange:o,label:n,elements:r,palette:a=KT,topPicks:i,updateData:s,appState:l})=>{let c=WT(l.openPopup);NN(()=>{c.current=l.openPopup},[l.openPopup]);let p=ho()!=="full";return zn("div",{children:Mu("div",{role:"dialog","aria-modal":"true",className:VT("color-picker-container",{"color-picker-container--no-top-picks":p}),children:[!p&&zn(UT,{activeColor:t,onChange:o,type:e,topPicks:i}),!p&&zn(vu,{}),Mu($T.Root,{open:l.openPopup===e,onOpenChange:d=>{d&&s({openPopup:e})},children:[zn(ON,{color:t,label:n,type:e,mode:e==="elementStroke"?"stroke":"background",editingTextElement:!!l.editingTextElement,onToggle:()=>{l.openPopup===e?s({openPopup:null}):l.openPopup?s({openPopup:e}):s({openPopup:e})}}),l.openPopup===e&&zn(FN,{type:e,color:t,onChange:o,label:n,elements:r,palette:a,updateData:s,getOpenPopup:()=>c.current,appState:l})]})]})})};import{Popover as p7}from"radix-ui";import u7 from"clsx";import g7,{useCallback as h7,useMemo as f7}from"react";import{FONT_FAMILY as L0}from"@orangecatai/common";import o7,{useMemo as oi,useState as n7,useRef as ZT,useEffect as qT,useCallback as JT,useSyncExternalStore as r7}from"react";import{arrayToList as a7,debounce as i7,FONT_FAMILY as ms,getFontFamilyString as s7}from"@orangecatai/common";import zN from"clsx";import UN from"react";import{jsx as HN,jsxs as GN}from"react/jsx-runtime";var Pu=UN.forwardRef(({className:e,placeholder:t,onChange:o},n)=>GN("div",{className:zN("QuickSearch__wrapper",e),children:[fn,HN("input",{ref:n,className:"QuickSearch__input",type:"text",placeholder:t,onChange:r=>o(r.target.value.trim().toLowerCase())})]}));import $N from"clsx";import{Children as VN}from"react";import{jsx as YT}from"react/jsx-runtime";var Au=({className:e,placeholder:t,children:o})=>{let n=!VN.count(o);return YT("div",{className:$N("ScrollableList__wrapper",e),role:"menu",children:n?YT("div",{className:"empty",children:t}):o})};import{jsx as WN,jsxs as KN}from"react/jsx-runtime";var XT=({children:e,className:t="",style:o,title:n})=>KN("div",{className:`dropdown-menu-group ${t}`,style:o,children:[n&&WN("p",{className:"dropdown-menu-group-title",children:n}),e]}),$d=XT;XT.displayName="DropdownMenuGroup";import{THEME as e7}from"@orangecatai/common";import{DropdownMenu as t7}from"radix-ui";import YN,{useContext as XN}from"react";import{composeEventHandlers as jN}from"@orangecatai/common";var M0=YN.createContext({}),ei=(e="",t=!1,o=!1)=>`dropdown-menu-item dropdown-menu-item-base ${e} ${t?"dropdown-menu-item--selected":""} ${o?"dropdown-menu-item--hovered":""}`.trim(),Lu=e=>{let t=XN(M0);return jN(e,o=>{t.onSelect?.(o)})};import{jsx as ZN}from"react/jsx-runtime";var Vd=({children:e,...t})=>ZN("span",{...t,style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",...t.style},children:e});import{Fragment as JN,jsx as Wd,jsxs as QN}from"react/jsx-runtime";var qN=({textStyle:e,icon:t,shortcut:o,children:n,badge:r})=>{let a=qe();return QN(JN,{children:[t&&Wd("div",{className:"dropdown-menu-item__icon",children:t}),Wd("div",{style:e,className:"dropdown-menu-item__text",children:Wd(Vd,{children:n})}),r&&Wd("div",{className:"dropdown-menu-item__badge",children:r}),o&&a.formFactor!=="phone"&&Wd("div",{className:"dropdown-menu-item__shortcut",children:o})]})},ti=qN;import{jsx as _u}from"react/jsx-runtime";var P0=({icon:e,badge:t,value:o,children:n,shortcut:r,className:a,selected:i,onSelect:s,...l})=>{let c=Lu(s);return _u(t7.Item,{className:"radix-menu-item",onSelect:c,asChild:!0,children:_u("button",{...l,value:o,className:ei(a,i),title:l.title??l["aria-label"],children:_u(ti,{icon:e,shortcut:r,badge:t,children:n})})})};P0.displayName="DropdownMenuItem";var Fl={GREEN:"green",RED:"red",BLUE:"blue"},Du=({type:e=Fl.BLUE,children:t})=>{let{theme:o}=on(),n={display:"inline-flex",marginLeft:"auto",padding:"2px 4px",borderRadius:6,fontSize:9,fontFamily:"Cascadia, monospace",border:o===e7.LIGHT?"1.5px solid white":"none"};switch(e){case Fl.GREEN:Object.assign(n,{backgroundColor:"var(--background-color-badge)",color:"var(--color-badge)"});break;case Fl.RED:Object.assign(n,{backgroundColor:"pink",color:"darkred"});break;case Fl.BLUE:default:Object.assign(n,{background:"var(--color-promo)",color:"var(--color-surface-lowest)"})}return _u("div",{className:"DropDownMenuItemBadge",style:n,children:t})};Du.displayName="DropdownMenuItemBadge";P0.Badge=Du;var No=P0;import{KEYS as Ol}from"@orangecatai/common";var jT=({event:e,inputRef:t,hoveredFont:o,filteredFonts:n,onClose:r,onSelect:a,onHover:i})=>{if(!e[Ol.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===Ol.F)return t.current?.focus(),!0;if(e.key===Ol.ESCAPE)return r(),!0;if(e.key===Ol.ENTER)return o?.value&&a(o.value),!0;if(e.key===Ol.ARROW_DOWN)return o?.next?i(o.next.value):n[0]?.value&&i(n[0].value),!0;if(e.key===Ol.ARROW_UP)return o?.prev?i(o.prev.value):n[n.length-1]?.value&&i(n[n.length-1].value),!0};import{jsx as da,jsxs as c7}from"react/jsx-runtime";var l7=e=>{switch(e){case ms.Excalifont:case ms.Virgil:return Mr;case ms.Nunito:case ms.Helvetica:return Ld;case ms["Lilita One"]:return II;case ms["Comic Shanns"]:case ms.Cascadia:return su;default:return Ld}},QT=o7.memo(({selectedFontFamily:e,hoveredFontFamily:t,onSelect:o,onHover:n,onLeave:r,onOpen:a,onClose:i})=>{let{container:s}=St(),l=Mt(),{fonts:c}=l,{showDeprecatedFonts:m}=_r(),p=ho(),[d,u]=n7(""),h=ZT(null),g=r7(Rn.subscribeToCustomFonts,Rn.getCustomFontVersion),f=oi(()=>Array.from(Rn.registered.entries()).filter(([P,{metadata:F}])=>!F.private&&!F.fallback).map(([P,{metadata:F,fontFaces:U}])=>{let B={value:P,icon:l7(P),text:U[0]?.fontFace?.family??"Unknown"};return F.deprecated&&Object.assign(B,{deprecated:F.deprecated,badge:{type:Fl.RED,placeholder:b("fontList.badge.old")}}),B}).sort((P,F)=>P.text.toLowerCase()>F.text.toLowerCase()?1:-1),[g]),w=oi(()=>new Set(c.getSceneFamilies()),[e]),y=oi(()=>f.filter(P=>w.has(P.value)),[f,w]),v=oi(()=>f.filter(P=>!w.has(P.value)&&(m||!P.deprecated)),[f,w,m]),E=oi(()=>a7([...y,...v].filter(P=>P.text?.toLowerCase().includes(d))),[y,v,d]),I=oi(()=>{let P;return t?P=E.find(F=>F.value===t):e&&(P=E.find(F=>F.value===e)),!P&&d&&(E[0]?.value?n(E[0].value):r()),P},[t,e,d,E,n,r]),k=JT(P=>{let F=null;if(l.state.editingTextElement){let U=document.querySelector(".excalidraw-wysiwyg");U&&(F={start:U.selectionStart,end:U.selectionEnd})}o(P),l.state.editingTextElement&&F&&setTimeout(()=>{let U=document.querySelector(".excalidraw-wysiwyg");U&&F&&(U.focus(),U.selectionStart=F.start,U.selectionEnd=F.end)},0)},[o,l.state.editingTextElement]),S=JT(P=>{jT({event:P,inputRef:h,hoveredFont:I,filteredFonts:E,onSelect:k,onHover:n,onClose:i})&&(P.preventDefault(),P.stopPropagation())},[I,E,k,n,i]);qT(()=>(a(),()=>{i()}),[]);let T=oi(()=>E.filter(P=>w.has(P.value)),[E,w]),A=oi(()=>E.filter(P=>!w.has(P.value)),[E,w]),R=({font:P,order:F})=>{let U=ZT(null),B=P.value===I?.value,G=P.value===e;return qT(()=>{B&&(F===0?U.current?.scrollIntoView?.({block:"end"}):U.current?.scrollIntoView?.({block:"nearest"}))},[B,F]),da("button",{ref:U,type:"button",value:P.value,className:ei("",G,B),title:P.text,tabIndex:G?0:-1,onClick:_=>{k(Number(_.currentTarget.value))},onMouseMove:()=>{I?.value!==P.value&&n(P.value)},children:da(ti,{icon:P.icon,badge:P.badge&&da(Du,{type:P.badge.type,children:P.badge.placeholder}),textStyle:{fontFamily:s7({fontFamily:P.value})},children:P.text})})},M=[];return T.length&&M.push(da($d,{title:b("fontList.sceneFonts"),children:T.map((P,F)=>da(R,{font:P,order:F},P.value))},"group_1")),A.length&&M.push(da($d,{title:b("fontList.availableFonts"),children:A.map((P,F)=>da(R,{font:P,order:F+T.length},P.value))},"group_2")),c7(ca,{className:"properties-content",container:s,style:{width:"15rem"},onClose:()=>{i(),l.state.editingTextElement&&setTimeout(()=>{let P=document.querySelector(".excalidraw-wysiwyg");P&&P.focus()},0)},onPointerLeave:r,onKeyDown:S,preventAutoFocusOnTouch:!!l.state.editingTextElement,children:[p==="full"&&da(Pu,{ref:h,placeholder:b("quickSearch.placeholder"),onChange:i7(u,20)}),da(Au,{className:"dropdown-menu fonts manual-hover",placeholder:b("fontList.empty"),children:M.length?M:null})]})},(e,t)=>e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily);import{Popover as d7}from"radix-ui";import{MOBILE_ACTION_BUTTON_BG as m7}from"@orangecatai/common";import{jsx as A0}from"react/jsx-runtime";var ek=({selectedFontFamily:e,isOpened:t=!1,compactMode:o=!1})=>{let n=Je(),r=o?{...m7,width:"2rem",height:"2rem"}:{};return A0(d7.Trigger,{asChild:!0,children:A0("div",{"data-openpopup":"fontFamily",className:"properties-trigger",children:A0(_l,{standalone:!0,icon:Pr,title:b("labels.showFonts"),className:"properties-trigger",testId:"font-family-show-fonts",active:t,onClick:()=>{n(a=>({openPopup:a.openPopup==="fontFamily"?null:a.openPopup}))},style:{border:"none",...r}})})})};import{jsx as Kd,jsxs as tk}from"react/jsx-runtime";var ok=[{value:L0.Excalifont,icon:Mr,text:b("labels.handDrawn"),testId:"font-family-hand-drawn"},{value:L0.Nunito,icon:Ld,text:b("labels.normal"),testId:"font-family-normal"},{value:L0["Comic Shanns"],icon:su,text:b("labels.code"),testId:"font-family-code"}],Zpe=new Set(ok.map(e=>e.value));var nk=g7.memo(({isOpened:e,selectedFontFamily:t,hoveredFontFamily:o,onSelect:n,onHover:r,onLeave:a,onPopupChange:i,compactMode:s=!1})=>{let l=f7(()=>ok,[]),c=h7(m=>{m&&n(m)},[n]);return tk("div",{role:"dialog","aria-modal":"true",className:u7("FontPicker__container",{"FontPicker__container--compact":s}),children:[!s&&Kd("div",{className:"buttonList",children:Kd(Bn,{type:"button",options:l,value:t,onClick:c})}),!s&&Kd(vu,{}),tk(p7.Root,{open:e,onOpenChange:i,children:[Kd(ek,{selectedFontFamily:t,isOpened:e,compactMode:s}),e&&Kd(QT,{selectedFontFamily:t,hoveredFontFamily:o,onSelect:c,onHover:r,onLeave:a,onOpen:()=>i(!0),onClose:()=>i(!1)})]})]})},(e,t)=>e.isOpened===t.isOpened&&e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily);import{Popover as _0}from"radix-ui";import w7 from"clsx";import Ru,{useEffect as v7}from"react";import{isArrowKey as E7,KEYS as ma}from"@orangecatai/common";import{jsx as b7}from"react/jsx-runtime";var Dr=({className:e,icon:t,size:o="1em"})=>b7("span",{className:e,style:{width:o,height:"100%",margin:"0 0.5ex 0 0.5ex",display:"inline-flex",lineHeight:0,verticalAlign:"middle",flex:"0 0 auto"},children:t});import{Fragment as y7,jsx as rk,jsxs as ak}from"react/jsx-runtime";var x7=({label:e,open:t,openTrigger:o,children:n,className:r,showCollapsedIcon:a=!0})=>ak(y7,{children:[ak("div",{style:{cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center"},className:r,onClick:o,children:[e,a&&rk(Dr,{icon:t?nT:pu})]}),t&&rk("div",{style:{display:"flex",flexDirection:"column"},children:n})]}),Yd=x7;import{jsx as ps,jsxs as D0}from"react/jsx-runtime";var I7=je(!1);function T7({options:e,value:t,label:o,onChange:n,onClose:r,numberOfOptionsToAlwaysShow:a=e.length}){let i=qe(),{container:s}=St(),l=g=>{let f=e.find(w=>w.keyBinding===g.key.toLowerCase());if(!(g.metaKey||g.altKey||g.ctrlKey)&&f)n(f.value),g.preventDefault();else if(g.key===ma.TAB){let w=e.findIndex(v=>v.value===t),y=g.shiftKey?(e.length+w-1)%e.length:(w+1)%e.length;n(e[y].value)}else if(E7(g.key)){let w=la().rtl,y=e.findIndex(v=>v.value===t);if(y!==-1){let v=e.length,E=y;switch(g.key){case(w?ma.ARROW_LEFT:ma.ARROW_RIGHT):E=(y+1)%v;break;case(w?ma.ARROW_RIGHT:ma.ARROW_LEFT):E=(v+y-1)%v;break;case ma.ARROW_DOWN:{E=(y+(a??1))%v;break}case ma.ARROW_UP:{E=(v+y-(a??1))%v;break}}n(e[E].value)}g.preventDefault()}else(g.key===ma.ESCAPE||g.key===ma.ENTER)&&(g.preventDefault(),r());g.nativeEvent.stopImmediatePropagation(),g.stopPropagation()},[c,m]=ve(I7),p=Ru.useMemo(()=>e.slice(0,a),[e,a]),d=Ru.useMemo(()=>e.slice(a),[e,a]);v7(()=>{p.some(g=>g.value===t)||m(!0)},[t,p,m]);let u=g=>ps("div",{className:"picker-content",children:g.map((f,w)=>D0("button",{type:"button",className:w7("picker-option",{active:t===f.value}),onClick:y=>{n(f.value)},title:`${f.text} ${f.keyBinding&&`\u2014 ${f.keyBinding.toUpperCase()}`}`,"aria-label":f.text||"none","aria-keyshortcuts":f.keyBinding||void 0,ref:y=>{t===f.value&&setTimeout(()=>{y?.focus()},0)},children:[f.icon,f.keyBinding&&ps("span",{className:"picker-keybinding",children:f.keyBinding})]},f.text))}),h=i.formFactor==="phone";return ps(_0.Content,{side:h?"right":"bottom",align:"start",sideOffset:h?8:12,style:{zIndex:"var(--zIndex-ui-styles-popup)"},onKeyDown:l,collisionBoundary:s??void 0,children:D0("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":o,children:[u(p),d.length>0&&ps(Yd,{label:b("labels.more_options"),open:c,openTrigger:()=>{m(g=>!g)},className:"picker-collapsible",children:u(d)})]})})}function R0({value:e,label:t,options:o,onChange:n,group:r="",numberOfOptionsToAlwaysShow:a}){let[i,s]=Ru.useState(!1),l=Ru.useRef(null);return ps("div",{children:D0(_0.Root,{open:i,onOpenChange:c=>s(c),children:[ps(_0.Trigger,{name:r,type:"button","aria-label":t,onClick:()=>s(!i),ref:l,className:i?"active":"",children:o.find(c=>c.value===e)?.icon}),i&&ps(T7,{options:o,value:e,label:t,onChange:n,onClose:()=>{s(!1)},numberOfOptionsToAlwaysShow:a})]})})}import ik,{useEffect as k7}from"react";import{jsx as N0,jsxs as sk}from"react/jsx-runtime";var lk=({updateData:e,app:t,testId:o})=>{let n=ik.useRef(null),r=ik.useRef(null),a=t.scene.getSelectedElements(t.state),i=!0,s=a.at(0),c=a.reduce((m,p)=>(m!=null&&m!==p.opacity&&(i=!1),m==null||m>p.opacity?p.opacity:m),s?.opacity??null)??t.state.currentItemOpacity;return k7(()=>{if(n.current&&r.current){let m=n.current,p=r.current,d=m.offsetWidth,u=15,h=c/100*(d-u)+u/2;p.style.left=`${h}px`,m.style.background=`linear-gradient(to right, var(--color-slider-track) 0%, var(--color-slider-track) ${c}%, var(--button-bg) ${c}%, var(--button-bg) 100%)`}},[c]),sk("label",{className:"control-label",children:[b("labels.opacity"),sk("div",{className:"range-wrapper",children:[N0("input",{style:{"--color-slider-track":i?void 0:"var(--button-bg)"},ref:n,type:"range",min:"0",max:"100",step:"10",onChange:m=>{e(+m.target.value)},value:c,className:"range-input","data-testid":o}),N0("div",{className:"value-bubble",ref:r,children:c!==0?c:null}),N0("div",{className:"zero-label",children:"0"})]})]})};import{Fragment as W0,jsx as De,jsxs as Vo}from"react/jsx-runtime";var hk=.1,Ul=e=>{let t=X7(e.editorInterface);return{stylesPanelMode:t,isCompact:t!=="full",isMobile:t==="mobile"}},$o=(e,t,o,n=!1)=>{let r=U0(Me(e,t,{includeBoundTextElement:n}));return e.map(a=>r.get(a.id)||a.id===t.editingTextElement?.id?o(a):a)},Bo=function(e,t,o,n,r){let a=t.state.editingTextElement,i=uk(e),s=null;if(a&&(s=o(a)),!s)if(ft(i,t.state)){let c=t.scene.getSelectedElements(t.state),m=n===!0?c:c.filter(p=>n(p));s=U7(m,o)??(typeof r=="function"?r(!0):r)}else s=typeof r=="function"?r(!1):r;return s},j7=(e,t,o)=>$7(t)||!t.autoResize?t:o.mutateElement(t,{x:e.textAlign==="left"?e.x:e.x+(e.width-t.width)/(e.textAlign==="center"?2:1),y:e.y+(e.height-t.height)/2}),G0=(e,t,o,n,r)=>{let a=new Set,i=$o(e,t,s=>{if(nn(s)){let l=n(s);a.add(l);let c=io(s,{fontSize:l});return Xd(c,o.scene.getContainerElement(s),o.scene),c=j7(s,c,o.scene),c}return s},!0);return Me(e,t,{includeBoundTextElement:!0}).forEach(s=>{nn(s)&&G7(s,o.scene)}),{elements:i,appState:{...t,currentItemFontSize:a.size===1?[...a][0]:r??t.currentItemFontSize},captureUpdate:so.IMMEDIATELY}},Z7=X({name:"changeStrokeColor",label:"labels.stroke",trackEvent:!1,perform:(e,t,o)=>({...o?.currentItemStrokeColor&&{elements:$o(e,t,n=>W7(n.type)?io(n,{strokeColor:o.currentItemStrokeColor}):n,!0)},appState:{...t,...o},captureUpdate:o?.currentItemStrokeColor?so.IMMEDIATELY:so.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{stylesPanelMode:a}=Ul(n);return Vo(W0,{children:[a==="full"&&De("h3",{"aria-hidden":"true",children:b("labels.stroke")}),De(Gd,{topPicks:_7,palette:L7,type:"elementStroke",label:b("labels.stroke"),color:Bo(e,n,i=>i.strokeColor,!0,i=>i?null:t.currentItemStrokeColor),onChange:i=>o({currentItemStrokeColor:i}),elements:e,appState:t,updateData:o})]})}}),q7=X({name:"changeBackgroundColor",label:"labels.changeBackground",trackEvent:!1,perform:(e,t,o,n)=>{if(!o?.currentItemBackgroundColor)return{appState:{...t,...o},captureUpdate:so.EVENTUALLY};let r,a=n.scene.getSelectedElements(t);if(!z7(o.currentItemBackgroundColor)&&a.every(s=>mk(s)&&H7(s.points))){let s=U0(a);r=e.map(l=>s.has(l.id)&&mk(l)?io(l,{backgroundColor:o.currentItemBackgroundColor,...Y7(l,!0)}):l)}else r=$o(e,t,s=>io(s,{backgroundColor:o.currentItemBackgroundColor}));return{elements:r,appState:{...t,...o},captureUpdate:so.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{stylesPanelMode:a}=Ul(n);return Vo(W0,{children:[a==="full"&&De("h3",{"aria-hidden":"true",children:b("labels.background")}),De(Gd,{topPicks:A7,palette:P7,type:"elementBackground",label:b("labels.background"),color:Bo(e,n,i=>i.backgroundColor,!0,i=>i?null:t.currentItemBackgroundColor),onChange:i=>o({currentItemBackgroundColor:i}),elements:e,appState:t,updateData:o})]})}}),J7=X({name:"changeFillStyle",label:"labels.fill",trackEvent:!1,perform:(e,t,o,n)=>(Ne("element","changeFillStyle",`${o} (${n.editorInterface.formFactor==="phone"?"mobile":"desktop"})`),{elements:$o(e,t,r=>io(r,{fillStyle:o})),appState:{...t,currentItemFillStyle:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=Me(e,t),a=r.length>0&&r.every(i=>i.fillStyle==="zigzag");return Vo("fieldset",{children:[De("legend",{children:b("labels.fill")}),De("div",{className:"buttonList",children:De(Bn,{type:"button",options:[{value:"hachure",text:`${a?b("labels.zigzag"):b("labels.hachure")} (${V("Alt-Click")})`,icon:a?X2:j2,active:a?!0:void 0,testId:"fill-hachure"},{value:"cross-hatch",text:b("labels.crossHatch"),icon:Z2,testId:"fill-cross-hatch"},{value:"solid",text:b("labels.solid"),icon:q2,testId:"fill-solid"}],value:Bo(e,n,i=>i.fillStyle,i=>i.hasOwnProperty("fillStyle"),i=>i?null:t.currentItemFillStyle),onClick:(i,s)=>{let l=s.altKey&&i==="hachure"&&r.every(c=>c.fillStyle==="hachure")?"zigzag":i;o(l)}})})]})}}),Q7=X({name:"changeStrokeWidth",label:"labels.strokeWidth",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>io(n,{strokeWidth:o})),appState:{...t,currentItemStrokeWidth:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>Vo("fieldset",{children:[De("legend",{children:b("labels.strokeWidth")}),De("div",{className:"buttonList",children:De(Bn,{group:"stroke-width",options:[{value:O0.thin,text:b("labels.thin"),icon:Jb,testId:"strokeWidth-thin"},{value:O0.bold,text:b("labels.bold"),icon:J2,testId:"strokeWidth-bold"},{value:O0.extraBold,text:b("labels.extraBold"),icon:Q2,testId:"strokeWidth-extraBold"}],value:Bo(e,n,a=>a.strokeWidth,a=>a.hasOwnProperty("strokeWidth"),a=>a?null:t.currentItemStrokeWidth),onChange:a=>o(a)})})]})}),e9=X({name:"changeSloppiness",label:"labels.sloppiness",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>io(n,{seed:B7(),roughness:o})),appState:{...t,currentItemRoughness:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>Vo("fieldset",{children:[De("legend",{children:b("labels.sloppiness")}),De("div",{className:"buttonList",children:De(Bn,{group:"sloppiness",options:[{value:0,text:b("labels.architect"),icon:oI},{value:1,text:b("labels.artist"),icon:nI},{value:2,text:b("labels.cartoonist"),icon:rI}],value:Bo(e,n,a=>a.roughness,a=>a.hasOwnProperty("roughness"),a=>a?null:t.currentItemRoughness),onChange:a=>o(a)})})]})}),tge=X({name:"changeStrokeStyle",label:"labels.strokeStyle",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>io(n,{strokeStyle:o})),appState:{...t,currentItemStrokeStyle:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>Vo("fieldset",{children:[De("legend",{children:b("labels.strokeStyle")}),De("div",{className:"buttonList",children:De(Bn,{group:"strokeStyle",options:[{value:"solid",text:b("labels.strokeStyle_solid"),icon:Jb},{value:"dashed",text:b("labels.strokeStyle_dashed"),icon:eI},{value:"dotted",text:b("labels.strokeStyle_dotted"),icon:tI}],value:Bo(e,n,a=>a.strokeStyle,a=>a.hasOwnProperty("strokeStyle"),a=>a?null:t.currentItemStrokeStyle),onChange:a=>o(a)})})]})}),t9=X({name:"changeOpacity",label:"labels.opacity",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>io(n,{opacity:o}),!0),appState:{...t,currentItemOpacity:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({app:e,updateData:t})=>De(lk,{updateData:t,app:e,testId:"opacity"})}),o9=X({name:"changeFontSize",label:"labels.fontSize",trackEvent:!1,perform:(e,t,o,n)=>G0(e,t,n,()=>(H0(o,"actionChangeFontSize: Expected a font size value"),o),o),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{isCompact:a}=Ul(n);return Vo("fieldset",{children:[De("legend",{children:b("labels.fontSize")}),De("div",{className:"buttonList",children:De(Bn,{group:"font-size",options:[{value:Bu.sm,text:b("labels.small"),icon:yI,testId:"fontSize-small"},{value:Bu.md,text:b("labels.medium"),icon:wI,testId:"fontSize-medium"},{value:Bu.lg,text:b("labels.large"),icon:vI,testId:"fontSize-large"},{value:Bu.xl,text:b("labels.veryLarge"),icon:EI,testId:"fontSize-veryLarge"}],value:Bo(e,n,i=>{if(nn(i))return i.fontSize;let s=ni(i,n.scene.getNonDeletedElementsMap());return s?s.fontSize:null},i=>nn(i)||ni(i,n.scene.getNonDeletedElementsMap())!==null,i=>i?null:t.currentItemFontSize||R7),onChange:i=>{Od(()=>o(i),a,!!t.editingTextElement,r?.onPreventClose)}})})]})}}),$0=X({name:"decreaseFontSize",label:"labels.decreaseFontSize",icon:cs,trackEvent:!1,perform:(e,t,o,n)=>G0(e,t,n,r=>Math.round(1/(1+hk)*r.fontSize)),keyTest:e=>e[zl.CTRL_OR_CMD]&&e.shiftKey&&(e.key===zl.CHEVRON_LEFT||e.key===zl.COMMA)}),V0=X({name:"increaseFontSize",label:"labels.increaseFontSize",icon:cs,trackEvent:!1,perform:(e,t,o,n)=>G0(e,t,n,r=>Math.round(r.fontSize*(1+hk))),keyTest:e=>e[zl.CTRL_OR_CMD]&&e.shiftKey&&(e.key===zl.CHEVRON_RIGHT||e.key===zl.PERIOD)}),n9=X({name:"changeFontFamily",label:"labels.fontFamily",trackEvent:!1,perform:(e,t,o,n)=>{let{cachedElements:r,resetAll:a,resetContainers:i,...s}=o;if(a)return{elements:$o(e,t,g=>{let f=r?.get(g.id);return f?io(g,{...f}):g},!0),appState:{...t,...s},captureUpdate:so.NEVER};H0(o,"actionChangeFontFamily: value must be defined");let{currentItemFontFamily:l,currentHoveredFontFamily:c}=o,m=so.EVENTUALLY,p,d=!1;if(l)p=l,m=so.IMMEDIATELY;else if(c){p=c,m=so.EVENTUALLY;let h=Me(e,t,{includeBoundTextElement:!0}).filter(g=>nn(g));if(h.length>200)d=!0;else{let g=0,f=0;for(;g<h.length&&f<5e3;){let w=h[g];f+=w?.originalText.length||0,g++}f>5e3&&(d=!0)}}let u={appState:{...t,...s},captureUpdate:m};if(p&&!d){let h=new Map,g=new Set,f=!1,w=Array.from(Rn.loadedFontsCache.values()),y=Object.entries(N7).find(([I,k])=>k===p)?.[0];c&&y&&w.some(I=>I.startsWith(y))&&(f=!0),Object.assign(u,{elements:$o(e,t,I=>{if(nn(I)&&(I.fontFamily!==p||l)){let k=io(I,{fontFamily:p,lineHeight:O7(p)}),S=r?.get(I.containerId||"")||{},T=n.scene.getContainerElement(I);return i&&T&&S&&n.scene.mutateElement(T,{...S}),f||(g=new Set([...g,...Array.from(k.originalText)])),h.set(k,T),k}return I},!0)});let v=`10px ${F7({fontFamily:p})}`,E=Array.from(g.values()).join();if(f||window.document.fonts.check(v,E))for(let[I,k]of h)Xd(I,k,n.scene);else window.document.fonts.load(v,E).then(I=>{for(let[k,S]of h){let T=n.scene.getElement(k.id),A=S?n.scene.getElement(S.id):null;T&&Xd(T,A,n.scene)}n.fonts.onLoaded(I)})}return u},PanelComponent:({elements:e,appState:t,app:o,updateData:n})=>{let r=F0(new Map),a=F0(null),[i,s]=M7({}),l=F0(!0),{stylesPanelMode:c,isCompact:m}=Ul(o),p=S7(()=>{let d=(u,h)=>Bo(u,o,g=>{if(nn(g))return g.fontFamily;let f=ni(g,h);return f?f.fontFamily:null},g=>nn(g)||ni(g,h)!==null,g=>g?null:t.currentItemFontFamily||D7);return i.openPopup==="fontFamily"&&t.openPopup==="fontFamily"?d(Array.from(r.current?.values()??[]),r.current):!i.openPopup&&t.openPopup!=="fontFamily"?d(e,o.scene.getNonDeletedElementsMap()):a.current},[i.openPopup,t,e,o]);return B0(()=>{a.current=p},[p]),B0(()=>{Object.keys(i).length&&(n(i),s({}))},[i]),B0(()=>(l.current=!1,()=>{l.current=!0}),[]),Vo(W0,{children:[c==="full"&&De("legend",{children:b("labels.fontFamily")}),De(nk,{isOpened:t.openPopup==="fontFamily",selectedFontFamily:p,hoveredFontFamily:t.currentHoveredFontFamily,compactMode:c!=="full",onSelect:d=>{Od(()=>{s({openPopup:null,currentHoveredFontFamily:null,currentItemFontFamily:d}),r.current.clear()},m,!!t.editingTextElement)},onHover:d=>{s({currentHoveredFontFamily:d,cachedElements:new Map(r.current),resetContainers:!0})},onLeave:()=>{s({currentHoveredFontFamily:null,cachedElements:new Map(r.current),resetAll:!0})},onPopupChange:d=>{if(d){r.current.clear();let{editingTextElement:u}=t;if(u?.type==="text"){let h=o.scene.getElement(u.id);r.current.set(u.id,io(h||u,{},!0))}else{let h=Me(e,t,{includeBoundTextElement:!0});for(let g of h)r.current.set(g.id,io(g,{},!0))}s({...i,openPopup:"fontFamily"})}else{let u={currentHoveredFontFamily:null,cachedElements:new Map(r.current),resetAll:!0};s({...u}),r.current.clear(),m&&t.editingTextElement&&Fd(null)}}})]})}}),r9=X({name:"changeTextAlign",label:"Change text alignment",trackEvent:!1,perform:(e,t,o,n)=>({elements:$o(e,t,r=>{if(nn(r)){let a=io(r,{textAlign:o});return Xd(a,n.scene.getContainerElement(r),n.scene),a}return r},!0),appState:{...t,currentItemTextAlign:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let a=n.scene.getNonDeletedElementsMap(),{isCompact:i}=Ul(n);return Vo("fieldset",{children:[De("legend",{children:b("labels.textAlign")}),De("div",{className:"buttonList",children:De(Bn,{group:"text-align",options:[{value:"left",text:b("labels.left"),icon:TI,testId:"align-left"},{value:"center",text:b("labels.center"),icon:kI,testId:"align-horizontal-center"},{value:"right",text:b("labels.right"),icon:CI,testId:"align-right"}],value:Bo(e,n,s=>{if(nn(s))return s.textAlign;let l=ni(s,a);return l?l.textAlign:null},s=>nn(s)||ni(s,a)!==null,s=>s?null:t.currentItemTextAlign),onChange:s=>{Od(()=>o(s),i,!!t.editingTextElement,r?.onPreventClose)}})})]})}}),a9=X({name:"changeVerticalAlign",label:"Change vertical alignment",trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:$o(e,t,r=>{if(nn(r)){let a=io(r,{verticalAlign:o});return Xd(a,n.scene.getContainerElement(r),n.scene),a}return r},!0),appState:{...t},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{isCompact:a}=Ul(n);return De("fieldset",{children:De("div",{className:"buttonList",children:De(Bn,{group:"text-align",options:[{value:Nu.TOP,text:b("labels.alignTop"),icon:De(SI,{theme:t.theme}),testId:"align-top"},{value:Nu.MIDDLE,text:b("labels.centerVertically"),icon:De(PI,{theme:t.theme}),testId:"align-middle"},{value:Nu.BOTTOM,text:b("labels.alignBottom"),icon:De(MI,{theme:t.theme}),testId:"align-bottom"}],value:Bo(e,n,i=>{if(nn(i)&&i.containerId)return i.verticalAlign;let s=ni(i,n.scene.getNonDeletedElementsMap());return s?s.verticalAlign:null},i=>nn(i)||ni(i,n.scene.getNonDeletedElementsMap())!==null,i=>i?null:Nu.MIDDLE),onChange:i=>{Od(()=>o(i),a,!!t.editingTextElement,r?.onPreventClose)}})})})}}),oge=X({name:"changeRoundness",label:"Change edge roundness",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>gk(n)?n:io(n,{roundness:o==="round"?{type:V7(n.type)?Fu.ADAPTIVE_RADIUS:Fu.PROPORTIONAL_RADIUS}:null})),appState:{...t,currentItemRoundness:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,renderAction:r})=>{let i=ol(uk(e),t).some(s=>s.roundness?.type===Fu.LEGACY);return Vo("fieldset",{children:[De("legend",{children:b("labels.edges")}),Vo("div",{className:"buttonList",children:[De(Bn,{group:"edges",options:[{value:"sharp",text:b("labels.sharp"),icon:aI},{value:"round",text:b("labels.round"),icon:iI}],value:Bo(e,n,s=>i?null:s.roundness?"round":"sharp",s=>!Ou(s)&&s.hasOwnProperty("roundness"),s=>s?null:t.currentItemRoundness),onChange:s=>o(s)}),r("togglePolygon")]})]})}}),pk=e=>[{value:null,text:b("labels.arrowhead_none"),keyBinding:"q",icon:De(sI,{flip:e})},{value:"arrow",text:b("labels.arrowhead_arrow"),keyBinding:"w",icon:De(lI,{flip:e})},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:De(pI,{flip:e}),keyBinding:"e"},{value:"triangle_outline",text:b("labels.arrowhead_triangle_outline"),icon:De(uI,{flip:e}),keyBinding:"r"},{value:"circle",text:b("labels.arrowhead_circle"),keyBinding:"a",icon:De(cI,{flip:e})},{value:"circle_outline",text:b("labels.arrowhead_circle_outline"),keyBinding:"s",icon:De(dI,{flip:e})},{value:"diamond",text:b("labels.arrowhead_diamond"),icon:De(gI,{flip:e}),keyBinding:"d"},{value:"diamond_outline",text:b("labels.arrowhead_diamond_outline"),icon:De(hI,{flip:e}),keyBinding:"f"},{value:"bar",text:b("labels.arrowhead_bar"),keyBinding:"z",icon:De(mI,{flip:e})},{value:"crowfoot_one",text:b("labels.arrowhead_crowfoot_one"),icon:De(bI,{flip:e}),keyBinding:"x"},{value:"crowfoot_many",text:b("labels.arrowhead_crowfoot_many"),icon:De(fI,{flip:e}),keyBinding:"c"},{value:"crowfoot_one_or_many",text:b("labels.arrowhead_crowfoot_one_or_many"),icon:De(xI,{flip:e}),keyBinding:"v"}],nge=X({name:"changeArrowhead",label:"Change arrowheads",trackEvent:!1,perform:(e,t,o)=>(H0(o,"actionChangeArrowhead: value must be defined"),{elements:$o(e,t,n=>{if(z0(n)){let{position:r,type:a}=o;if(r==="start")return io(n,{startArrowhead:a});if(r==="end")return io(n,{endArrowhead:a})}return n}),appState:{...t,[o.position==="start"?"currentItemStartArrowhead":"currentItemEndArrowhead"]:o.type},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=la().rtl;return Vo("fieldset",{children:[De("legend",{children:b("labels.arrowheads")}),Vo("div",{className:"iconSelectList buttonList",children:[De(R0,{label:"arrowhead_start",options:pk(!r),value:Bo(e,n,a=>z0(a)&&nl(a.type)?a.startArrowhead:t.currentItemStartArrowhead,!0,a=>a?null:t.currentItemStartArrowhead),onChange:a=>o({position:"start",type:a}),numberOfOptionsToAlwaysShow:4}),De(R0,{label:"arrowhead_end",group:"arrowheads",options:pk(!!r),value:Bo(e,n,a=>z0(a)&&nl(a.type)?a.endArrowhead:t.currentItemEndArrowhead,!0,a=>a?null:t.currentItemEndArrowhead),onChange:a=>o({position:"end",type:a}),numberOfOptionsToAlwaysShow:4})]})]})}}),i9=X({name:"changeArrowProperties",label:"Change arrow properties",trackEvent:!1,perform:(e,t,o,n)=>!1,PanelComponent:({elements:e,appState:t,updateData:o,app:n,renderAction:r})=>Vo("div",{className:"selected-shape-actions",children:[r("changeArrowhead"),r("changeArrowType")]})}),rge=X({name:"changeArrowType",label:"Change arrow types",trackEvent:!1,perform:(e,t,o,n)=>{let r=$o(e,t,s=>{if(!Ou(s))return s;let l=n.scene.getNonDeletedElementsMap(),c=us.getPointAtIndexGlobalCoordinates(s,0,l),m=us.getPointAtIndexGlobalCoordinates(s,-1,l),p=io(s,{x:o===Un.elbow?c[0]:s.x,y:o===Un.elbow?c[1]:s.y,roundness:o===Un.round?{type:Fu.PROPORTIONAL_RADIUS}:null,elbowed:o===Un.elbow,angle:o===Un.elbow?0:s.angle,points:o===Un.elbow||s.elbowed?[us.pointFromAbsoluteCoords({...s,x:c[0],y:c[1],angle:0},c,l),us.pointFromAbsoluteCoords({...s,x:c[0],y:c[1],angle:0},m,l)]:s.points});if(gk(p)){p.fixedSegments=null;let d=n.scene.getNonDeletedElementsMap();n.dismissLinearEditor();let u=us.getPointAtIndexGlobalCoordinates(p,0,d),h=us.getPointAtIndexGlobalCoordinates(p,-1,d),g=p.startBinding&&d.get(p.startBinding.elementId),f=p.endBinding&&d.get(p.endBinding.elementId),w=g&&p.startBinding?{...p.startBinding,...dk(p,g,"start",d)}:null,y=f&&p.endBinding?{...p.endBinding,...dk(p,f,"end",d)}:null;p={...p,startBinding:w,endBinding:y,...K7(p,d,{points:[u,h].map(v=>C7(v[0]-p.x,v[1]-p.y)),startBinding:w,endBinding:y,fixedSegments:null})}}else{let d=n.scene.getNonDeletedElementsMap();if(p.startBinding){let u=d.get(p.startBinding.elementId);u&&ck(p,u,t.bindMode==="inside"?"inside":"orbit","start",n.scene)}if(p.endBinding){let u=d.get(p.endBinding.elementId);u&&ck(p,u,t.bindMode==="inside"?"inside":"orbit","end",n.scene)}}return p}),a={...t,currentItemArrowType:o},i=t.selectedLinearElement?.elementId;if(i){let s=r.find(l=>l.id===i);s&&(a.selectedLinearElement=new us(s,U0(e)))}return{elements:r,appState:a,captureUpdate:so.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>Vo("fieldset",{children:[De("legend",{children:b("labels.arrowtypes")}),De("div",{className:"buttonList",children:De(Bn,{group:"arrowtypes",options:[{value:Un.sharp,text:b("labels.arrowtype_sharp"),icon:Sl,testId:"sharp-arrow"},{value:Un.round,text:b("labels.arrowtype_round"),icon:Pl,testId:"round-arrow"},{value:Un.elbow,text:b("labels.arrowtype_elbowed"),icon:Ml,testId:"elbow-arrow"}],value:Bo(e,n,r=>Ou(r)?r.elbowed?Un.elbow:r.roundness?Un.round:Un.sharp:null,r=>Ou(r),r=>r?null:t.currentItemArrowType),onChange:r=>o(r)})})]})});import{clamp as Z0,roundToStep as u9}from"@orangecatai/math";import{DEFAULT_CANVAS_BACKGROUND_PICKS as g9,CURSOR_TYPE as Ik,MAX_ZOOM as Tk,MIN_ZOOM as kk,THEME as jd,ZOOM_STEP as q0,updateActiveTool as Gl,CODES as Nr,KEYS as ua,viewportCoordsToSceneCoords as h9}from"@orangecatai/common";import{getElementAbsoluteCoords as wk,getNonDeletedElements as Ck,getVisibleElements as f9}from"@orangecatai/element";import{newElementWith as b9}from"@orangecatai/element";import{getCommonBounds as Sk}from"@orangecatai/element";import{CaptureUpdateAction as cr}from"@orangecatai/element";import{useEffect as s9}from"react";import{jsx as c9}from"react/jsx-runtime";var Hl=()=>{let e=document.querySelector(".excalidraw-tooltip");if(e)return e;let t=document.createElement("div");return document.body.appendChild(t),t.classList.add("excalidraw-tooltip"),t},K0=(e,t,o="bottom")=>{let n=e.getBoundingClientRect(),r=window.innerWidth,a=window.innerHeight,i=5,s=t.left+t.width/2-n.width/2;s<0?s=i:s+n.width>=r&&(s=r-n.width-i);let l;o==="bottom"?(l=t.top+t.height+i,l+n.height>=a&&(l=t.top-n.height-i)):(l=t.top-n.height-i,l<0&&(l=t.top+t.height+i)),Object.assign(e.style,{top:`${l}px`,left:`${s}px`})},l9=(e,t,o,n)=>{t.classList.add("excalidraw-tooltip--visible"),t.style.minWidth=n?"50ch":"10ch",t.style.maxWidth=n?"50ch":"15ch",t.textContent=o;let r=e.getBoundingClientRect();K0(t,r)},Fo=({children:e,label:t,long:o=!1,style:n,disabled:r})=>(s9(()=>()=>Hl().classList.remove("excalidraw-tooltip--visible"),[]),r?null:c9("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:a=>l9(a.currentTarget,Hl(),t,o),onPointerLeave:()=>Hl().classList.remove("excalidraw-tooltip--visible"),style:n,children:e}));import{CURSOR_TYPE as Y0,MIME_TYPES as X0,THEME as bk}from"@orangecatai/common";var xk='<svg viewBox="0 0 24 24" stroke-width="1" width="28" height="28" xmlns="http://www.w3.org/2000/svg">',d9='<path d="M6.164 11.755a5.314 5.314 0 0 1-4.932-5.298 5.314 5.314 0 0 1 5.311-5.311 5.314 5.314 0 0 1 5.307 5.113l8.773 8.773a3.322 3.322 0 0 1 0 4.696l-.895.895a3.322 3.322 0 0 1-4.696 0l-8.868-8.868Z" style="fill:#fff"/>',yk='<path stroke="#1b1b1f" fill="#fff" d="m7.868 11.113 7.773 7.774a2.359 2.359 0 0 0 1.667.691 2.368 2.368 0 0 0 2.357-2.358c0-.625-.248-1.225-.69-1.667L11.201 7.78 9.558 9.469l-1.69 1.643v.001Zm10.273 3.606-3.333 3.333m-3.25-6.583 2 2m-7-7 3 3M3.664 3.625l1 1M2.529 6.922l1.407-.144m5.735-2.932-1.118.866M4.285 9.823l.758-1.194m1.863-6.207-.13 1.408"/>',m9=`data:${X0.svg},${encodeURIComponent(`${xk}${yk}</svg>`)}`,p9=`data:${X0.svg},${encodeURIComponent(`${xk}${d9}${yk}</svg>`)}`,bn=e=>{e&&(e.style.cursor="")},pt=(e,t)=>{e&&(e.style.cursor=t)},Rr,fk,j0=(e,t)=>{let n=()=>{let r=t===bk.DARK;Rr=document.createElement("canvas"),Rr.theme=t,Rr.height=20,Rr.width=20;let a=Rr.getContext("2d");a.lineWidth=1,a.beginPath(),a.arc(Rr.width/2,Rr.height/2,5,0,2*Math.PI),a.fillStyle=r?"#000":"#fff",a.fill(),a.strokeStyle=r?"#fff":"#000",a.stroke(),fk=Rr.toDataURL(X0.svg)};(!Rr||Rr.theme!==t)&&n(),pt(e,`url(${fk}) ${20/2} ${20/2}, auto`)},xn=(e,t)=>{if(e)if(t.activeTool.type==="selection")bn(e);else if(sa(t))e.style.cursor=Y0.GRAB;else if(tn(t))j0(e,t.theme);else if(t.activeTool.type==="laser"){let o=t.theme===bk.LIGHT?m9:p9;e.style.cursor=`url(${o}), auto`}else["image","custom"].includes(t.activeTool.type)?t.activeTool.type!=="image"&&(e.style.cursor=Y0.AUTO):e.style.cursor=Y0.CROSSHAIR};var pa=({viewportX:e,viewportY:t,nextZoom:o},n)=>{let r=e-n.offsetLeft,a=t-n.offsetTop,i=n.zoom.value,s=n.scrollX+(r-r/i),l=n.scrollY+(a-a/i),c=-(r-r/o),m=-(a-a/o);return{scrollX:s+c,scrollY:l+m,zoom:{value:o}}};import{jsx as $l,jsxs as C9}from"react/jsx-runtime";var x9=X({name:"changeViewBackgroundColor",label:"labels.canvasBackground",trackEvent:!1,predicate:(e,t,o,n)=>!!n.props.UIOptions.canvasActions.changeViewBackgroundColor&&!t.viewModeEnabled,perform:(e,t,o)=>({appState:{...t,...o},captureUpdate:o?.viewBackgroundColor?cr.IMMEDIATELY:cr.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:o,appProps:n,data:r})=>$l(Gd,{palette:null,topPicks:g9,label:b("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:a=>o({viewBackgroundColor:a}),"data-testid":"canvas-background-picker",elements:e,appState:t,updateData:o})}),ga=X({name:"clearCanvas",label:"labels.clearCanvas",icon:Co,trackEvent:{category:"canvas"},predicate:(e,t,o,n)=>!!n.props.UIOptions.canvasActions.clearCanvas&&!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector",perform:(e,t,o,n)=>(n.imageCache.clear(),{elements:e.map(r=>b9(r,{isDeleted:!0})),appState:{...Va(),files:{},theme:t.theme,penMode:t.penMode,penDetected:t.penDetected,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,gridStep:t.gridStep,gridModeEnabled:t.gridModeEnabled,stats:t.stats,pasteDialog:t.pasteDialog,activeTool:t.activeTool.type==="image"?{...t.activeTool,type:n.state.preferredSelectionTool.type}:t.activeTool},captureUpdate:cr.IMMEDIATELY})}),zu=X({name:"zoomIn",label:"buttons.zoomIn",viewMode:!0,icon:Nb,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>({appState:{...t,...pa({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Ir(t.zoom.value+q0)},t),userToFollow:null},captureUpdate:cr.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>$l(be,{type:"button",className:"zoom-in-button zoom-button",icon:Nb,title:`${b("buttons.zoomIn")} \u2014 ${V("CtrlOrCmd++")}`,"aria-label":b("buttons.zoomIn"),disabled:t.zoom.value>=Tk,onClick:()=>{e(null)}}),keyTest:e=>(e.code===Nr.EQUAL||e.code===Nr.NUM_ADD)&&(e[ua.CTRL_OR_CMD]||e.shiftKey)}),Uu=X({name:"zoomOut",label:"buttons.zoomOut",icon:Bb,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>({appState:{...t,...pa({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Ir(t.zoom.value-q0)},t),userToFollow:null},captureUpdate:cr.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>$l(be,{type:"button",className:"zoom-out-button zoom-button",icon:Bb,title:`${b("buttons.zoomOut")} \u2014 ${V("CtrlOrCmd+-")}`,"aria-label":b("buttons.zoomOut"),disabled:t.zoom.value<=kk,onClick:()=>{e(null)}}),keyTest:e=>(e.code===Nr.MINUS||e.code===Nr.NUM_SUBTRACT)&&(e[ua.CTRL_OR_CMD]||e.shiftKey)}),Hu=X({name:"resetZoom",label:"buttons.resetZoom",icon:L2,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>({appState:{...t,...pa({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Ir(1)},t),userToFollow:null},captureUpdate:cr.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>$l(Fo,{label:b("buttons.resetZoom"),style:{height:"100%"},children:C9(be,{type:"button",className:"reset-zoom-button zoom-button",title:b("buttons.resetZoom"),"aria-label":b("buttons.resetZoom"),onClick:()=>{e(null)},children:[(t.zoom.value*100).toFixed(0),"%"]})}),keyTest:e=>(e.code===Nr.ZERO||e.code===Nr.NUM_ZERO)&&(e[ua.CTRL_OR_CMD]||e.shiftKey)}),y9=(e,t,o=1)=>{let[n,r,a,i]=e,s=a-n,l=t.width/s,c=i-r,m=t.height/c,d=Math.min(l,m)*Z0(o,.1,1);return Math.min(d,1)},w9=.8,v9=(e,t)=>e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1],E9=(e,t)=>[e[0]-t,e[1]-t,e[2]+t,e[3]+t],vk=(e,t)=>{let o=(e[0]+e[2])/2,n=(e[1]+e[3])/2;return Math.hypot(o-t.x,n-t.y)},Ek=e=>[e[0],e[1],e[2],e[3]],I9=(e,t)=>{let o=Ck(e);if(!o.length)return[];let n=f9(o),r=n.length?n:o,a=new Map(o.map(d=>[d.id,d])),i=h9({clientX:t.offsetLeft+t.width/2,clientY:t.offsetTop+t.height/2},t),s=r.reduce((d,u)=>{let h=Ek(wk(u,a));return d?vk(h,i)<vk(d.bounds,i)?{element:u,bounds:h}:d:{element:u,bounds:h}},null);if(!s)return[];let l=Math.max(160/t.zoom.value,.12*Math.min(t.width,t.height)/t.zoom.value),c=new Map([[s.element.id,s.element]]),m=s.bounds,p=!0;for(;p;){p=!1;let d=E9(m,l);for(let u of r){if(c.has(u.id))continue;let h=Ek(wk(u,a));v9(h,d)&&(c.set(u.id,u),m=Sk([...c.values()]),p=!0)}}return[...c.values()]},Mk=({bounds:e,appState:t,canvasOffsets:o,fitToViewport:n=!1,viewportZoomFactor:r=1,minZoom:a=-1/0,maxZoom:i=1/0})=>{r=Z0(r,kk,Tk);let[s,l,c,m]=e,p=(s+c)/2,d=(l+m)/2,u=o?.left??0,h=o?.top??0,g=o?.right??0,f=o?.bottom??0,w=t.width-u-g,y=t.height-h-f,v;if(n){let k=c-s,S=m-l;v=Math.min(w/k,y/S)*r}else v=y9(e,{width:w,height:y},r);let E=Ir(Z0(u9(v,q0,"floor"),a,i)),I=XE({scenePoint:{x:p,y:d},viewportDimensions:{width:t.width,height:t.height},offsets:o,zoom:{value:E}});return{appState:{...t,scrollX:I.scrollX,scrollY:I.scrollY,zoom:{value:E}},captureUpdate:cr.EVENTUALLY}},Vl=({canvasOffsets:e,targetElements:t,appState:o,fitToViewport:n,viewportZoomFactor:r,minZoom:a,maxZoom:i})=>{let s=Sk(Ck(t));return Mk({canvasOffsets:e,bounds:s,appState:o,fitToViewport:n,viewportZoomFactor:r,minZoom:a,maxZoom:i})},Uge=X({name:"zoomToFitSelectionInViewport",label:"labels.zoomToFitViewport",icon:Cl,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t);return Vl({targetElements:r.length?r:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:n.getEditorUIOffsets()})},keyTest:e=>e.code===Nr.TWO&&e.shiftKey&&!e.altKey&&!e[ua.CTRL_OR_CMD]}),Hge=X({name:"zoomToFitSelection",label:"helpDialog.zoomToSelection",icon:Cl,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t);return Vl({targetElements:r.length?r:e,appState:{...t,userToFollow:null},fitToViewport:!0,canvasOffsets:n.getEditorUIOffsets()})},keyTest:e=>e.code===Nr.THREE&&e.shiftKey&&!e.altKey&&!e[ua.CTRL_OR_CMD]}),T9=X({name:"zoomToFit",label:"helpDialog.zoomToFit",icon:Cl,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>Vl({targetElements:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:n.getEditorUIOffsets()}),keyTest:e=>e.code===Nr.ONE&&e.shiftKey&&!e.altKey&&!e[ua.CTRL_OR_CMD]}),k9=X({name:"scrollBackToContent",label:"buttons.scrollBackToContent",icon:Cl,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t),a=r.length?r:I9(e,t);return a.length?Vl({targetElements:a,appState:{...t,userToFollow:null},fitToViewport:!0,viewportZoomFactor:w9,canvasOffsets:n.getEditorUIOffsets()}):!1},PanelComponent:({updateData:e})=>$l(Fo,{label:b("buttons.scrollBackToContent"),style:{height:"100%"},children:$l(be,{type:"button",className:"scroll-back-to-content-button zoom-button",icon:Cl,title:b("buttons.scrollBackToContent"),"aria-label":b("buttons.scrollBackToContent"),onClick:()=>{e(null)}})})}),gs=X({name:"toggleTheme",label:(e,t)=>t.theme===jd.DARK?"buttons.lightMode":"buttons.darkMode",keywords:["toggle","dark","light","mode","theme"],icon:(e,t)=>e.theme===jd.LIGHT?Md:Pd,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o)=>({appState:{...t,theme:o||(t.theme===jd.LIGHT?jd.DARK:jd.LIGHT)},captureUpdate:cr.EVENTUALLY}),keyTest:e=>e.altKey&&e.shiftKey&&e.code===Nr.D,predicate:(e,t,o,n)=>!!n.props.UIOptions.canvasActions.toggleTheme}),Gge=X({name:"toggleEraserTool",label:"toolBar.eraser",trackEvent:{category:"toolbar"},perform:(e,t,o,n)=>{let r;return tn(t)?r=Gl(t,{...t.activeTool.lastActiveTool||{type:n.state.preferredSelectionTool.type},lastActiveToolBeforeEraser:null}):r=Gl(t,{type:"eraser",lastActiveToolBeforeEraser:t.activeTool}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:r},captureUpdate:cr.IMMEDIATELY}},keyTest:e=>e.key===ua.E}),$ge=X({name:"toggleLassoTool",label:"toolBar.lasso",icon:Ya,trackEvent:{category:"toolbar"},predicate:(e,t,o,n)=>n.state.preferredSelectionTool.type!=="lasso",perform:(e,t,o,n)=>{let r;return t.activeTool.type!=="lasso"?(r=Gl(t,{type:"lasso",fromSelection:!1}),pt(n.interactiveCanvas,Ik.CROSSHAIR)):r=Gl(t,{type:"selection"}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:r},captureUpdate:cr.NEVER}}}),Pk=X({name:"toggleHandTool",label:"toolBar.hand",trackEvent:{category:"toolbar"},icon:El,viewMode:!1,perform:(e,t,o,n)=>{let r;return sa(t)?r=Gl(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):(r=Gl(t,{type:"hand",lastActiveToolBeforeEraser:t.activeTool}),pt(n.interactiveCanvas,Ik.GRAB)),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:r},captureUpdate:cr.IMMEDIATELY}},keyTest:e=>!e.altKey&&!e[ua.CTRL_OR_CMD]&&e.key===ua.H});import{updateActiveTool as Ak}from"@orangecatai/common";import{CaptureUpdateAction as S9}from"@orangecatai/element";var M9=X({name:"setEmbeddableAsActiveTool",trackEvent:{category:"toolbar"},target:"Tool",label:"toolBar.embeddable",perform:(e,t,o,n)=>{let r=Ak(t,{type:"embeddable"});return xn(n.canvas,{...t,activeTool:r}),{elements:e,appState:{...t,activeTool:Ak(t,{type:"embeddable"})},captureUpdate:S9.EVENTUALLY}}});import{pointFrom as Lk}from"@orangecatai/math";import{bindOrUnbindBindingElement as P9}from"@orangecatai/element/binding";import{isValidPolygon as _k,LinearElementEditor as Gu,newElementWith as J0}from"@orangecatai/element";import{isBindingElement as Dk,isFreeDrawElement as Rk,isLinearElement as Nk,isLineElement as $u}from"@orangecatai/element";import{KEYS as Q0,arrayToMap as A9,invariant as Bk,shouldRotateWithDiscreteAngle as L9,updateActiveTool as Fk}from"@orangecatai/common";import{isPathALoop as _9}from"@orangecatai/element";import{isInvisiblySmallElement as ex}from"@orangecatai/element";import{CaptureUpdateAction as Ok}from"@orangecatai/element";import{jsx as D9}from"react/jsx-runtime";var Wo=X({name:"finalize",label:"",trackEvent:!1,perform:(e,t,o,n)=>{let r=e,{interactiveCanvas:a,focusContainer:i,scene:s}=n,l=s.getNonDeletedElementsMap();if(o&&t.selectedLinearElement){let{event:d,sceneCoords:u}=o,h=Gu.getElement(t.selectedLinearElement.elementId,l);Bk(h,"Arrow element should exist if selectedLinearElement is set"),Bk(u,"sceneCoords should be defined if actionFinalize is called with event");let g=Gu.handlePointerUp(d,t.selectedLinearElement,t,n.scene);if(Dk(h)&&!t.selectedLinearElement.segmentMidPointHoveredCoords){let f=!!t.newElement,y=(f||!t.selectedLinearElement.selectedPointsIndices?[h.points.length-1]:t.selectedLinearElement.selectedPointsIndices).reduce((v,E)=>(v.set(E,{point:Gu.pointFromAbsoluteCoords(h,Lk(u.x-g.pointerOffset.x,u.y-g.pointerOffset.y),l)}),v),new Map)??new Map;P9(h,y,u.x-g.pointerOffset.x,u.y-g.pointerOffset.y,s,t,{newArrow:f,altKey:d.altKey,angleLocked:L9(d)})}else $u(h)&&t.selectedLinearElement?.isEditing&&!t.newElement&&!_k(h.points)&&s.mutateElement(h,{polygon:!1});if(g!==t.selectedLinearElement){h&&ex(h)&&(r=r.map(w=>w.id===h.id?J0(w,{isDeleted:!0}):w));let f=t.activeTool?.locked;return{elements:h.points.length<2||ex(h)?e.map(w=>w.id===h.id?J0(w,{isDeleted:!0}):w):r,appState:{...t,cursorButton:"up",selectedLinearElement:f?null:{...g,selectedPointsIndices:null,isEditing:!1,initialState:{...g.initialState,lastClickedPoint:-1},pointerOffset:{x:0,y:0}},selectionElement:null,suggestedBinding:null,newElement:null,multiElement:null},captureUpdate:Ok.IMMEDIATELY}}}window.document.activeElement instanceof HTMLElement&&i();let c=null;if(t.multiElement)c=t.multiElement;else if(t.newElement?.type==="freedraw"||Dk(t.newElement))c=t.newElement;else if(Object.keys(t.selectedElementIds).length===1){let d=l.get(Object.keys(t.selectedElementIds)[0]);d&&(c=d)}if(c){if(t.selectedLinearElement&&t.multiElement&&c.type!=="freedraw"&&t.lastPointerDownWith!=="touch"){let{points:d}=c,{lastCommittedPoint:u}=t.selectedLinearElement;(!u||d[d.length-1]!==u)&&s.mutateElement(c,{points:c.points.slice(0,-1)})}if(c&&ex(c)&&(r=r.map(d=>d.id===c?.id?J0(d,{isDeleted:!0}):d)),Nk(c)||Rk(c)){if(_9(c.points,t.zoom.value)&&($u(c)||Rk(c))){let u=c.points,h=u[0],g=u.map((f,w)=>w===u.length-1?Lk(h[0],h[1]):f);$u(c)?s.mutateElement(c,{points:g,polygon:!0}):s.mutateElement(c,{points:g})}$u(c)&&!_k(c.points)&&s.mutateElement(c,{polygon:!1})}}(!t.activeTool.locked&&t.activeTool.type!=="freedraw"||!c)&&bn(a);let m;t.activeTool.type==="eraser"?m=Fk(t,{...t.activeTool.lastActiveTool||{type:n.state.preferredSelectionTool.type},lastActiveToolBeforeEraser:null}):m=Fk(t,{type:n.state.preferredSelectionTool.type});let p=c&&Nk(c)?new Gu(c,A9(r)):t.selectedLinearElement;return p=p&&{...p,isEditing:t.newElement?!1:p.isEditing,initialState:{...p.initialState,lastClickedPoint:-1,origin:null}},{elements:r,appState:{...t,cursorButton:"up",activeTool:(t.activeTool.locked||t.activeTool.type==="freedraw")&&c?t.activeTool:m,activeEmbeddable:null,newElement:null,selectionElement:null,multiElement:null,editingTextElement:null,startBoundElement:null,suggestedBinding:null,selectedElementIds:c&&!t.activeTool.locked&&t.activeTool.type!=="freedraw"?{...t.selectedElementIds,[c.id]:!0}:t.selectedElementIds,selectedLinearElement:p},captureUpdate:Ok.IMMEDIATELY}},keyTest:(e,t)=>e.key===Q0.ESCAPE&&(t.selectedLinearElement?.isEditing||!t.newElement&&t.multiElement===null)||(e.key===Q0.ESCAPE||e.key===Q0.ENTER)&&t.multiElement!==null,PanelComponent:({appState:e,updateData:t,data:o})=>D9(be,{type:"button",icon:U2,title:b("buttons.done"),"aria-label":b("buttons.done"),onClick:t,visible:e.multiElement!=null,size:o?.size||"medium",style:{pointerEvents:"all"}})});import{KEYS as Xl,DEFAULT_EXPORT_PADDING as IB,EXPORT_SCALES as TB,THEME as nx}from"@orangecatai/common";import{getNonDeletedElements as kB}from"@orangecatai/element";import{CaptureUpdateAction as pr}from"@orangecatai/element";import{viewportCoordsToSceneCoords as CB}from"@orangecatai/common";import R9 from"clsx";import{jsx as zk,jsxs as N9}from"react/jsx-runtime";var Zd=({children:e,checked:t,onChange:o,className:n})=>N9("div",{className:R9("Checkbox",n,{"is-checked":t}),onClick:r=>{o(!t,r),r.currentTarget.querySelector(".Checkbox-box").focus()},children:[zk("button",{type:"button",className:"Checkbox-box",role:"checkbox","aria-checked":t,children:nu}),zk("div",{className:"Checkbox-label",children:e})]});import{THEME as qd}from"@orangecatai/common";import{jsx as Jd}from"react/jsx-runtime";var Hk=e=>{let t=e.title||(e.value===qd.DARK?b("buttons.lightMode"):b("buttons.darkMode"));return Jd(be,{type:"icon",icon:e.value===qd.LIGHT?Uk.MOON:Uk.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===qd.DARK?qd.LIGHT:qd.DARK),"data-testid":"toggle-dark-mode"})},Uk={SUN:Jd("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:Jd("path",{fill:"currentColor",d:"M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z"})}),MOON:Jd("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:Jd("path",{fill:"currentColor",d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"})})};import{useState as B9}from"react";import{focusNearestParent as F9,KEYS as O9}from"@orangecatai/common";import{jsx as Gk,jsxs as z9}from"react/jsx-runtime";var $k=e=>{let{id:t}=St(),[o,n]=B9(e.value),r=i=>{e.ignoreFocus||F9(i.target);let s=i.target.value;s!==e.value&&e.onChange(s)},a=i=>{if(i.key===O9.ENTER){if(i.preventDefault(),i.nativeEvent.isComposing||i.keyCode===229)return;i.currentTarget.blur()}};return z9("div",{className:"ProjectName",children:[Gk("label",{className:"ProjectName-label",htmlFor:"filename",children:`${e.label}:`}),Gk("input",{type:"text",className:"TextInput",onBlur:r,onKeyDown:a,id:`${t}-filename`,value:o,onChange:i=>n(i.target.value)})]})};import{DEFAULT_EXPORT_PADDING as gB,DEFAULT_FILENAME as hB,IMAGE_MIME_TYPES as iC,isFirefox as fB,MIME_TYPES as bB,cloneJSON as xB,SVG_DOCUMENT_PREAMBLE as yB}from"@orangecatai/common";import{getNonDeletedElements as wB}from"@orangecatai/element";import{isFrameLikeElement as vB}from"@orangecatai/element";import{getElementsOverlappingFrame as EB}from"@orangecatai/element";import{ALLOWED_PASTE_MIME_TYPES as q9,EXPORT_DATA_TYPES as tm,MIME_TYPES as yn,arrayToMap as J9,isMemberOf as Q9,isPromiseLike as eB,EVENT as Ku}from"@orangecatai/common";import{mutateElement as tB}from"@orangecatai/element";import{deepCopyElement as oB}from"@orangecatai/element";import{isFrameLikeElement as nB,isInitializedImageElement as rB}from"@orangecatai/element";import{getContainingFrame as eC}from"@orangecatai/element";import{pointFrom as ri}from"@orangecatai/math";import{COLOR_PALETTE as Wk,DEFAULT_CHART_COLOR_INDEX as U9,getAllColorsSpecificShade as H9,DEFAULT_FONT_FAMILY as G9,DEFAULT_FONT_SIZE as Kk,VERTICAL_ALIGN as $9,randomId as Yk,isDevEnv as Xk,FONT_SIZES as V9}from"@orangecatai/common";import{newTextElement as Vu,newLinearElement as em,newElement as ox}from"@orangecatai/element";var dr=32,It=12,ai=256,jk=50,hs="NOT_SPREADSHEET",Wl="VALID_SPREADSHEET",Qd=e=>{let t=/^([-+]?)[$€£¥₩]?([-+]?)([\d.,]+)[%]?$/.exec(e);return t?parseFloat(`${(t[1]||t[2])+t[3]}`.replace(/,/g,"")):null},tx=(e,t)=>e.slice(1).every(o=>Qd(o[t])!==null),Vk=e=>{let t=e[0].length;if(t>2)return{type:hs,reason:"More than 2 columns"};if(t===1){if(!tx(e,0))return{type:hs,reason:"Value is not numeric"};let l=Qd(e[0][0])===null,c=(l?e.slice(1):e).map(m=>Qd(m[0]));return c.length<2?{type:hs,reason:"Less than two rows"}:{type:Wl,spreadsheet:{title:l?e[0][0]:null,labels:null,values:c}}}let o=tx(e,0),n=tx(e,1);if(!o&&!n)return{type:hs,reason:"Value is not numeric"};let[r,a]=n?[0,1]:[1,0],i=Qd(e[0][a])===null,s=i?e.slice(1):e;return s.length<2?{type:hs,reason:"Less than 2 rows"}:{type:Wl,spreadsheet:{title:i?e[0][a]:null,labels:s.map(l=>l[r]),values:s.map(l=>Qd(l[a]))}}},W9=e=>{let t=[];for(let o=0;o<e[0].length;o++){let n=[];for(let r=0;r<e.length;r++)n.push(e[r][o]);t.push(n)}return t},Zk=e=>{let t=e.trim().split(`
1
+ import{$ as Ab,A as zR,B as JE,C as QE,D as Wp,E as Id,F as Kp,G as Yp,H as Td,I as e2,J as t2,K as o2,L as Wa,M as sl,N as n2,O as UR,P as rs,Q as ll,R as kd,T as r2,V as a2,W as i2,X as Xp,Y as s2,Z as Pb,_ as Ka,a as XE,aa as cl,b as ns,ba as l2,c as Ir,ca as Lb,d as jE,da as as,e as ft,ea as c2,f as ZE,fa as _b,g as Me,ga as d2,h as ol,ha as sr,i as Tr,ia as m2,j as yd,ja as jp,k as wd,ka as Db,l as nl,la as p2,m as vd,ma as u2,n as rl,na as g2,o as qE,oa as Cd,p as Sb,q as kr,r as Rn,s as Va,t as tn,u as sa,v as al,w as il,x as Mb,y as Ed,z as Vp}from"./chunk-7MAYRMSQ.js";import{a as C}from"./chunk-KZGD5EMI.js";import{M as Cb}from"./chunk-CLQPYXMS.js";import{c as YE}from"./chunk-3PELD44J.js";import{b as WE,c as KE,d as D}from"./chunk-SRAX5OIU.js";import Vae,{useEffect as Wae,useMemo as Kae}from"react";import{DEFAULT_UI_OPTIONS as OR,isShallowEqual as Yae}from"@orangecatai/common";import C_ from"clsx";import Ute from"lodash.throttle";import na,{useContext as ji}from"react";import{flushSync as mn}from"react-dom";import Hte from"roughjs/bin/rough";import{nanoid as Cv}from"nanoid";import{clamp as S_,pointFrom as Ae,pointDistance as $i,vector as M_,pointRotateRads as Sv,vectorFromPoint as Mv,vectorSubtract as P_,vectorDot as A_,vectorNormalize as L_}from"@orangecatai/math";import{COLOR_PALETTE as Gte,CODES as __,shouldResizeFromCenter as D_,shouldMaintainAspectRatio as fp,shouldRotateWithDiscreteAngle as R_,isArrowKey as Gf,KEYS as he,APP_NAME as $te,CURSOR_TYPE as Ft,DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT as Vte,DEFAULT_VERTICAL_ALIGN as N_,DRAGGING_THRESHOLD as B_,ELEMENT_SHIFT_TRANSLATE_AMOUNT as Wte,ELEMENT_TRANSLATE_AMOUNT as F_,EVENT as Be,FRAME_STYLE as Pn,IMAGE_MIME_TYPES as Kte,IMAGE_RENDER_TIMEOUT as Yte,LINE_CONFIRM_THRESHOLD as Pv,MAX_ALLOWED_FILE_BYTES as O_,MIME_TYPES as qr,MQ_RIGHT_SIDEBAR_MIN_WIDTH as Xte,POINTER_BUTTON as Ra,ROUNDNESS as $f,SCROLL_TIMEOUT as jte,TAP_TWICE_TIMEOUT as Zte,TEXT_TO_CENTER_SNAP_THRESHOLD as qte,THEME as Vf,TOUCH_CTX_MENU_TIMEOUT as Jte,VERTICAL_ALIGN as Qte,YOUTUBE_STATES as Wf,ZOOM_STEP as eoe,POINTER_EVENTS as Vi,TOOL_TYPE as Jr,supportsResizeObserver as toe,DEFAULT_COLLISION_THRESHOLD as z_,DEFAULT_TEXT_ALIGN as ooe,ARROW_TYPE as Wi,DEFAULT_REDUCED_GLOBAL_ALPHA as U_,isLocalLink as noe,normalizeLink as Av,toValidURL as roe,getGridPoint as Ao,getLineHeight as H_,debounce as G_,distance as ld,getFontString as Lv,getNearestScrollableContainer as aoe,isInputLike as $_,isToolIcon as ioe,isWritableElement as bp,sceneCoordsToViewportCoords as xp,tupleToCoors as _v,viewportCoordsToSceneCoords as At,wrapEvent as soe,updateObject as Dv,updateActiveTool as Qr,isTransparent as loe,easeToValuesRAF as coe,muteFSAbortError as doe,isTestEnv as CD,isDevEnv as SD,easeOut as moe,updateStable as yp,addEventListener as Vt,normalizeEOL as poe,getDateTime as V_,isShallowEqual as W_,arrayToMap as wp,applyDarkModeFilter as uoe,randomInteger as goe,CLASSES as Rv,Emitter as js,MINIMUM_ARROW_SIZE as hoe,DOUBLE_TAP_POSITION_THRESHOLD as foe,BIND_MODE_TIMEOUT as boe,invariant as ea,getFeatureFlag as Na,createUserAgentDescriptor as MD,getFormFactor as xoe,deriveStylesPanelMode as Qf,isIOS as yoe,isBrave as woe,isSafari as voe,loadDesktopUIModePreference as Eoe,setDesktopUIMode as Ioe,isSelectionLikeTool as Kf,oneOf as K_}from"@orangecatai/common";import{getObservedAppState as Toe,getCommonBounds as cd,getElementAbsoluteCoords as Yf,bindOrUnbindBindingElements as Y_,fixBindingsAfterDeletion as koe,getHoveredElementForBinding as wr,isBindingEnabled as vp,shouldEnableBindingForPointerEvent as Coe,updateBoundElements as Xf,LinearElementEditor as st,newElementWith as ta,newFrameElement as Nv,newFreeDrawElement as Soe,newEmbeddableElement as X_,newMagicFrameElement as j_,newIframeElement as Moe,newArrowElement as Poe,newElement as Aoe,newImageElement as Bv,newVideoElement as Z_,newLinearElement as Loe,newTextElement as q_,refreshTextDimensions as _oe,deepCopyElement as J_,duplicateElements as Fv,hasBoundTextElement as Q_,isArrowElement as dd,isBindingElement as oa,isBindingElementType as Doe,isBoundToContainer as Ov,isFrameLikeElement as Io,isImageElement as Ki,isVideoElement as Roe,isEmbeddableElement as Ba,isInitializedImageElement as Ep,isLinearElement as qo,isLinearElementType as Noe,isUsingAdaptiveRadius as Boe,isIframeElement as md,isIframeLikeElement as zv,isMagicFrameElement as Uv,isTextBindableContainer as eD,isElbowArrow as pn,isFlowchartNodeElement as Foe,isBindableElement as Hv,isTextElement as vr,getNormalizedDimensions as Ooe,isElementCompletelyInViewport as Gv,isElementInViewport as $v,isInvisiblySmallElement as tD,getCornerRadius as zoe,isPathALoop as oD,createSrcDoc as nD,embeddableURLValidator as Vv,maybeParseEmbedSrc as Uoe,getEmbedLink as jf,getInitializedImageElements as Hoe,normalizeSVG as rD,updateImageCache as Goe,getBoundTextElement as Wv,getContainerCenter as Kv,getContainerElement as aD,isValidTextContainer as $oe,redrawTextBoundingBox as Voe,hasBoundingBox as Woe,getFrameChildren as Yv,isCursorInFrame as iD,addElementsToFrame as Xv,replaceAllElementsInFrame as Koe,removeElementsFromFrame as Yoe,getElementsInResizingFrame as jv,getElementsInNewFrame as Xoe,getContainingFrame as Zf,orderFramesToBack as joe,elementOverlapsWithFrame as Zoe,updateFrameMembershipOfSelectedElements as sD,isElementInFrame as lD,getFrameLikeTitle as qoe,getElementsOverlappingFrame as Joe,filterElementsEligibleAsFrameChildren as Qoe,hitElementBoundText as ene,hitElementBoundingBoxOnly as tne,hitElementItself as Ip,getVisibleSceneBounds as one,FlowChartCreator as nne,FlowChartNavigator as rne,getLinkDirectionFromKey as cD,cropElement as ane,wrapText as ine,isElementLink as Zv,parseElementLinkFromURL as sne,isMeasureTextSupported as lne,normalizeText as cne,measureText as dD,getLineHeightInPx as dne,getApproxMinLineWidth as mne,getApproxMinLineHeight as pne,getMinTextElementWidth as une,ShapeCache as Tp,getRenderOpacity as mD,editGroupForSelectedElement as gne,getElementsInGroup as Zs,getSelectedGroupIdForElement as hne,getSelectedGroupIds as fne,isElementInGroup as pD,isSelectedViaGroup as bne,selectGroupsForSelectedElements as or,syncInvalidIndices as PD,syncMovedIndices as uD,excludeElementsInFramesFromSelection as xne,getSelectionStateForElements as yne,makeNextSelectedElementIds as gt,getResizeOffsetXY as wne,getResizeArrowDirection as vne,transformElements as Ene,getCursorForResizingElement as gD,getElementWithTransformHandleType as hD,getTransformHandleTypeFromCoords as fD,dragNewElement as bD,dragSelectedElements as Ine,getDragOffsetXY as Tne,isNonDeletedElement as xD,Scene as yD,Store as kne,CaptureUpdateAction as Lo,hitElementBoundingBox as Cne,isLineElement as qv,isSimpleArrow as Jv,StoreDelta as wD,positionElementsOnGrid as Qv,calculateFixedPointForNonElbowArrowBinding as vD,bindOrUnbindBindingElement as Sne,mutateElement as qf,getElementBounds as ED,doBoundsIntersect as Mne,isPointInElement as Pne,maxBindingDistance_simple as eE,convertToExcalidrawElements as ID,getSnapOutlineMidPoint as tE,handleFocusPointDrag as Ane,handleFocusPointHover as Lne,handleFocusPointPointerDown as _ne,handleFocusPointPointerUp as Dne,maybeHandleArrowPointlikeDrag as Jf,getUncroppedWidthAndHeight as Rne}from"@orangecatai/element";import{KEYS as a0,MOBILE_ACTION_BUTTON_BG as QR,updateActiveTool as e8}from"@orangecatai/common";import{getNonDeletedElements as i0}from"@orangecatai/element";import{fixBindingsAfterDeletion as t8}from"@orangecatai/element";import{LinearElementEditor as gT}from"@orangecatai/element";import{newElementWith as bu}from"@orangecatai/element";import{getContainerElement as hT}from"@orangecatai/element";import{isBoundToContainer as hu,isElbowArrow as o8,isFrameLikeElement as n8}from"@orangecatai/element";import{getFrameChildren as r8}from"@orangecatai/element";import{getElementsInGroup as s0,selectGroupsForSelectedElements as a8}from"@orangecatai/element";import{CaptureUpdateAction as fu}from"@orangecatai/element";import{isDevEnv as VR}from"@orangecatai/common";import{atom as je,createStore as HR}from"jotai";import{createIsolation as GR}from"jotai-scope";var h2=GR();var{useAtom:ve,useSetAtom:Cr,useAtomValue:dl,useStore:Qae}=h2,f2=h2.Provider,Yt=HR();var $R=WE({"./locales/ar-SA.json":()=>import("./locales/ar-SA-NXDWD63E.js"),"./locales/az-AZ.json":()=>import("./locales/az-AZ-MXSORGZV.js"),"./locales/bg-BG.json":()=>import("./locales/bg-BG-O6MV2KSF.js"),"./locales/bn-BD.json":()=>import("./locales/bn-BD-T2VJNT7N.js"),"./locales/bn-IN.json":()=>import("./locales/bn-IN-MMW2ORAC.js"),"./locales/ca-ES.json":()=>import("./locales/ca-ES-MKBCGNOG.js"),"./locales/cs-CZ.json":()=>import("./locales/cs-CZ-V77HGUP7.js"),"./locales/da-DK.json":()=>import("./locales/da-DK-I5RFNTM4.js"),"./locales/de-CH.json":()=>import("./locales/de-CH-WLRDEVBV.js"),"./locales/de-DE.json":()=>import("./locales/de-DE-DTI4WUSC.js"),"./locales/el-GR.json":()=>import("./locales/el-GR-ZXDJ2OS4.js"),"./locales/en.json":()=>import("./locales/en-ZZURI326.js"),"./locales/es-ES.json":()=>import("./locales/es-ES-DYQHAD43.js"),"./locales/eu-ES.json":()=>import("./locales/eu-ES-QDSYU5Y3.js"),"./locales/fa-IR.json":()=>import("./locales/fa-IR-26LZG4PM.js"),"./locales/fi-FI.json":()=>import("./locales/fi-FI-6YS4KDE4.js"),"./locales/fr-FR.json":()=>import("./locales/fr-FR-BRLLPTZC.js"),"./locales/gl-ES.json":()=>import("./locales/gl-ES-OKUZTLYG.js"),"./locales/he-IL.json":()=>import("./locales/he-IL-26MGYIU7.js"),"./locales/hi-IN.json":()=>import("./locales/hi-IN-Q4ZOGTP2.js"),"./locales/hu-HU.json":()=>import("./locales/hu-HU-P2OXPSN5.js"),"./locales/id-ID.json":()=>import("./locales/id-ID-2EIKXYN6.js"),"./locales/it-IT.json":()=>import("./locales/it-IT-4CFKVXI2.js"),"./locales/ja-JP.json":()=>import("./locales/ja-JP-MAND2Z4V.js"),"./locales/kaa.json":()=>import("./locales/kaa-HQRTCXTJ.js"),"./locales/kab-KAB.json":()=>import("./locales/kab-KAB-JKIKKTGH.js"),"./locales/kk-KZ.json":()=>import("./locales/kk-KZ-HXQ63ZFC.js"),"./locales/km-KH.json":()=>import("./locales/km-KH-PKL3LSGX.js"),"./locales/ko-KR.json":()=>import("./locales/ko-KR-KXLREZX3.js"),"./locales/ku-TR.json":()=>import("./locales/ku-TR-MJ4IER3X.js"),"./locales/lt-LT.json":()=>import("./locales/lt-LT-H6WFQ6FJ.js"),"./locales/lv-LV.json":()=>import("./locales/lv-LV-GOCK6SJW.js"),"./locales/mr-IN.json":()=>import("./locales/mr-IN-IXVLDMEQ.js"),"./locales/my-MM.json":()=>import("./locales/my-MM-YG6MYTTD.js"),"./locales/nb-NO.json":()=>import("./locales/nb-NO-XGWJISD2.js"),"./locales/nl-NL.json":()=>import("./locales/nl-NL-XVDVCPNC.js"),"./locales/nn-NO.json":()=>import("./locales/nn-NO-EMX5MJX5.js"),"./locales/oc-FR.json":()=>import("./locales/oc-FR-ROEINTVO.js"),"./locales/pa-IN.json":()=>import("./locales/pa-IN-ZYN6SUDY.js"),"./locales/percentages.json":()=>import("./locales/percentages-5DKR754L.js"),"./locales/pl-PL.json":()=>import("./locales/pl-PL-6VTG7PHC.js"),"./locales/pt-BR.json":()=>import("./locales/pt-BR-5YFKRR5G.js"),"./locales/pt-PT.json":()=>import("./locales/pt-PT-GEIXXZ67.js"),"./locales/ro-RO.json":()=>import("./locales/ro-RO-E2P6TFZI.js"),"./locales/ru-RU.json":()=>import("./locales/ru-RU-YBIIY43T.js"),"./locales/si-LK.json":()=>import("./locales/si-LK-673C2CI2.js"),"./locales/sk-SK.json":()=>import("./locales/sk-SK-CKZHQ4AP.js"),"./locales/sl-SI.json":()=>import("./locales/sl-SI-557H2GWM.js"),"./locales/sv-SE.json":()=>import("./locales/sv-SE-XOPKKDWS.js"),"./locales/ta-IN.json":()=>import("./locales/ta-IN-XBH7DQI3.js"),"./locales/th-TH.json":()=>import("./locales/th-TH-TOCWH3R4.js"),"./locales/tr-TR.json":()=>import("./locales/tr-TR-GXW6CYY5.js"),"./locales/uk-UA.json":()=>import("./locales/uk-UA-IJKTNUDG.js"),"./locales/uz-UZ.json":()=>import("./locales/uz-UZ-TBZZEA4V.js"),"./locales/vi-VN.json":()=>import("./locales/vi-VN-MULSGNVB.js"),"./locales/zh-CN.json":()=>import("./locales/zh-CN-MVX3E32U.js"),"./locales/zh-HK.json":()=>import("./locales/zh-HK-JNU5RLIE.js"),"./locales/zh-TW.json":()=>import("./locales/zh-TW-LENVCA6T.js")});var WR=85,Sr={code:"en",label:"English"},pl=[Sr,...[{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",rtl:!0},{code:"bg-BG",label:"\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438"},{code:"ca-ES",label:"Catal\xE0"},{code:"cs-CZ",label:"\u010Cesky"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",label:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC"},{code:"es-ES",label:"Espa\xF1ol"},{code:"eu-ES",label:"Euskara"},{code:"fa-IR",label:"\u0641\u0627\u0631\u0633\u06CC",rtl:!0},{code:"fi-FI",label:"Suomi"},{code:"fr-FR",label:"Fran\xE7ais"},{code:"gl-ES",label:"Galego"},{code:"he-IL",label:"\u05E2\u05D1\u05E8\u05D9\u05EA",rtl:!0},{code:"hi-IN",label:"\u0939\u093F\u0928\u094D\u0926\u0940"},{code:"hu-HU",label:"Magyar"},{code:"id-ID",label:"Bahasa Indonesia"},{code:"it-IT",label:"Italiano"},{code:"ja-JP",label:"\u65E5\u672C\u8A9E"},{code:"kab-KAB",label:"Taqbaylit"},{code:"kk-KZ",label:"\u049A\u0430\u0437\u0430\u049B \u0442\u0456\u043B\u0456"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4"},{code:"ku-TR",label:"Kurd\xEE"},{code:"lt-LT",label:"Lietuvi\u0173"},{code:"lv-LV",label:"Latvie\u0161u"},{code:"my-MM",label:"Burmese"},{code:"nb-NO",label:"Norsk bokm\xE5l"},{code:"nl-NL",label:"Nederlands"},{code:"nn-NO",label:"Norsk nynorsk"},{code:"oc-FR",label:"Occitan"},{code:"pa-IN",label:"\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40"},{code:"pl-PL",label:"Polski"},{code:"pt-BR",label:"Portugu\xEAs Brasileiro"},{code:"pt-PT",label:"Portugu\xEAs"},{code:"ro-RO",label:"Rom\xE2n\u0103"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439"},{code:"sk-SK",label:"Sloven\u010Dina"},{code:"sv-SE",label:"Svenska"},{code:"sl-SI",label:"Sloven\u0161\u010Dina"},{code:"tr-TR",label:"T\xFCrk\xE7e"},{code:"uk-UA",label:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430"},{code:"zh-CN",label:"\u7B80\u4F53\u4E2D\u6587"},{code:"zh-TW",label:"\u7E41\u9AD4\u4E2D\u6587"},{code:"vi-VN",label:"Ti\u1EBFng Vi\u1EC7t"},{code:"mr-IN",label:"\u092E\u0930\u093E\u0920\u0940"}].filter(e=>YE[e.code]>=WR).sort((e,t)=>e.label>t.label?1:-1)],qp="__test__";VR()&&pl.unshift({code:qp,label:"test language"},{code:`${qp}.rtl`,label:"\u202Atest language (rtl)\u202C",rtl:!0});var ml=Sr,Zp={},Jp=async e=>{if(ml=e,document.documentElement.dir=ml.rtl?"rtl":"ltr",document.documentElement.lang=ml.code,e.code.startsWith(qp))Zp={};else try{Zp=await $R(`./locales/${ml.code}.json`)}catch(t){console.error(`Failed to load language ${e.code}:`,t.message),Zp=Cb}Yt.set(x2,e.code)},la=()=>ml,b2=(e,t)=>{for(let o=0;o<t.length;++o){let n=t[o];if(e[n]===void 0)return;e=e[n]}if(typeof e=="string")return e},b=(e,t,o)=>{if(ml.code.startsWith(qp))return`\u202A[[${t?`${e}(${JSON.stringify(t).slice(1,-1)})`:e}]]\u202C`;let n=e.split("."),r=b2(Zp,n)||b2(Cb,n)||o;if(r===void 0){let a=`Can't find translation for ${e}`;if(C.PROD)return console.warn(a),"";throw new Error(a)}if(t)for(let a in t)r=r.replace(`{{${a}}}`,String(t[a]));return r},x2=je(Sr.code),bt=()=>{let e=dl(x2);return{t:b,langCode:e}};import KR from"clsx";import go from"react";import{THEME as YR}from"@orangecatai/common";import{Fragment as xt,jsx as x,jsxs as W}from"react/jsx-runtime";var lr=e=>"var(--icon-fill-color)",y2=e=>e===YR.LIGHT?"#fff":"#1e1e1e",N=(e,t=512)=>{let{width:o=512,height:n=o,mirror:r,style:a,...i}=typeof t=="number"?{width:t}:t;return x("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:`0 0 ${o} ${n}`,className:KR({"rtl-mirror":r}),style:a,...i,children:typeof e=="string"?x("path",{fill:"currentColor",d:e}):e})},te={width:24,height:24,fill:"none",strokeWidth:2,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},ze={width:20,height:20,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},gie=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("rect",{x:3,y:8,width:18,height:4,rx:1}),x("line",{x1:12,y1:8,x2:12,y2:21}),x("path",{d:"M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7"}),x("path",{d:"M7.5 8a2.5 2.5 0 0 1 0 -5a4.8 8 0 0 1 4.5 5a4.8 8 0 0 1 4.5 -5a2.5 2.5 0 0 1 0 5"})]}),te),Qp=N(W("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),x("path",{d:"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),x("line",{x1:"3",y1:"6",x2:"3",y2:"19"}),x("line",{x1:"12",y1:"6",x2:"12",y2:"19"}),x("line",{x1:"21",y1:"6",x2:"21",y2:"19"})]}),te),w2=N(W("svg",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),x("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),te),v2=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"12",cy:"12",r:"1"}),x("circle",{cx:"12",cy:"19",r:"1"}),x("circle",{cx:"12",cy:"5",r:"1"})]}),te),E2=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),x("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),x("path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]}),te),I2=N(W("svg",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M9 4v6l-2 4v2h10v-2l-2 -4v-6"}),x("line",{x1:"12",y1:"16",x2:"12",y2:"21"}),x("line",{x1:"8",y1:"4",x2:"16",y2:"4"})]}),te),Rb=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M6.5 9.5l3.5 -3"}),x("path",{d:"M14 5.5l3 1.5"}),x("path",{d:"M18.5 10l-2.5 7"}),x("path",{d:"M13.5 17.5l-7 -5"})]}),te),is=N(W("g",{children:[x("path",{d:"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z",stroke:"currentColor",strokeWidth:"1.25"}),x("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z",stroke:"currentColor",strokeWidth:"1.25"}),x("mask",{id:"UnlockedIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:6,y:1,width:9,height:9,children:x("path",{stroke:"none",d:"M6.399 9.561V5.175c0-.93.401-1.823 1.116-2.48a3.981 3.981 0 0 1 2.693-1.028c1.01 0 1.98.37 2.694 1.027.715.658 1.116 1.55 1.116 2.481",fill:"#fff"})}),x("g",{mask:"url(#UnlockedIcon)",children:x("path",{stroke:"none",d:"M5.149 9.561v1.25h2.5v-1.25h-2.5Zm5.06-7.894V.417v1.25Zm2.559 3.508v1.25h2.5v-1.25h-2.5ZM7.648 8.51V5.175h-2.5V8.51h2.5Zm0-3.334c0-.564.243-1.128.713-1.561L6.668 1.775c-.959.883-1.52 2.104-1.52 3.4h2.5Zm.713-1.561a2.732 2.732 0 0 1 1.847-.697v-2.5c-1.31 0-2.585.478-3.54 1.358L8.36 3.614Zm1.847-.697c.71 0 1.374.26 1.847.697l1.694-1.839a5.231 5.231 0 0 0-3.54-1.358v2.5Zm1.847.697c.47.433.713.997.713 1.561h2.5c0-1.296-.56-2.517-1.52-3.4l-1.693 1.839Z",fill:"currentColor"})})]}),ze),ul=N(W("g",{strokeWidth:"1.25",children:[x("path",{d:"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z"}),x("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z"}),x("path",{d:"M6.667 8.333V5.417C6.667 3.806 8.159 2.5 10 2.5c1.841 0 3.333 1.306 3.333 2.917v2.916"})]}),ze),T2=N(x("g",{fill:"currentColor",children:x("path",{d:"M12 2a5 5 0 0 1 5 5v3a3 3 0 0 1 3 3v6a3 3 0 0 1 -3 3h-10a3 3 0 0 1 -3 -3v-6a3 3 0 0 1 3 -3v-3a5 5 0 0 1 5 -5m0 12a2 2 0 0 0 -1.995 1.85l-.005 .15a2 2 0 1 0 2 -2m0 -10a3 3 0 0 0 -3 3v3h6v-3a3 3 0 0 0 -3 -3"})}),{width:24,height:24}),k2=N(W(xt,{children:[x("path",{d:"M38.5 83.5c-14-2-17.833-10.473-21-22.5C14.333 48.984 12 22 12 12.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z",fill:"currentColor"}),x("path",{d:"M12.005 10.478c1.92 3.495 3.838 7 7.905 14.423m-7.905-14.423c3.11 5.683 6.23 11.368 7.905 14.423m0 0c-3.68.226-7.35.455-13.91.85m13.91-.85c-5.279.33-10.566.647-13.91.85m0 0c1.936-4.931 3.882-9.86 6.005-15.273M6 25.75c2.069-5.257 4.135-10.505 6.005-15.272",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:41,height:94,fill:"none"}),C2=N(W(xt,{children:[x("path",{d:"M18.026 1.232c-5.268 13.125-5.548 33.555 3.285 42.311 8.823 8.75 33.31 12.304 42.422 13.523",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m72.181 59.247-13.058-10-2.948 13.62 16.006-3.62Z",fill:"currentColor"}),x("path",{d:"M72.181 59.247c-3.163-2.429-6.337-4.856-13.058-10m13.058 10c-5.145-3.936-10.292-7.882-13.058-10m0 0c-.78 3.603-1.563 7.196-2.948 13.62m2.948-13.62c-1.126 5.168-2.24 10.346-2.948 13.62m0 0c5.168-1.166 10.334-2.343 16.006-3.62m-16.006 3.62c5.51-1.248 11.01-2.495 16.006-3.62",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:85,height:71,fill:"none"}),S2=N(W(xt,{children:[x("path",{d:"M1 77c14-2 31.833-11.973 35-24 3.167-12.016-6-35-9.5-43.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),x("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m24.165 1.093-2.132 16.309 13.27-4.258-11.138-12.05Z",fill:"currentColor"}),x("path",{d:"M24.165 1.093c-.522 3.953-1.037 7.916-2.132 16.309m2.131-16.309c-.835 6.424-1.68 12.854-2.13 16.308m0 0c3.51-1.125 7.013-2.243 13.27-4.257m-13.27 4.257c5.038-1.608 10.08-3.232 13.27-4.257m0 0c-3.595-3.892-7.197-7.777-11.14-12.05m11.14 12.05c-3.837-4.148-7.667-8.287-11.14-12.05",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:38,height:78,fill:"none"}),hie=N(x("g",{fill:"currentColor",children:x("path",{d:"M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z",fill:"currentColor"})}),{width:40,height:40,fill:"none"}),ss=N(W("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 6l4.153 11.793a0.365 .365 0 0 0 .331 .207a0.366 .366 0 0 0 .332 -.207l2.184 -4.793l4.787 -1.994a0.355 .355 0 0 0 .213 -.323a0.355 .355 0 0 0 -.213 -.323l-11.787 -4.36z"}),x("path",{d:"M13.5 13.5l4.5 4.5"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),Ya=N(W("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,children:[x("path",{d:"M4.028 13.252c-.657 -.972 -1.028 -2.078 -1.028 -3.252c0 -3.866 4.03 -7 9 -7s9 3.134 9 7s-4.03 7 -9 7c-1.913 0 -3.686 -.464 -5.144 -1.255"}),x("path",{d:"M5 15m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M5 17c0 1.42 .316 2.805 1 4"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),gl=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})]}),te),hl=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M10.5 20.4l-6.9 -6.9c-.781 -.781 -.781 -2.219 0 -3l6.9 -6.9c.781 -.781 2.219 -.781 3 0l6.9 6.9c.781 .781 .781 2.219 0 3l-6.9 6.9c-.781 .781 -2.219 .781 -3 0z"})]}),te),fl=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"12",cy:"12",r:"9"})]}),te),eu=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),x("line",{x1:"15",y1:"16",x2:"19",y2:"12"}),x("line",{x1:"15",y1:"8",x2:"19",y2:"12"})]}),te),bl=N(x("path",{d:"M4.167 10h11.666",strokeWidth:"1.5"}),ze),M2=N(W("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z"}),x("path",{d:"M16 7h4"}),x("path",{d:"M18 19h-13a2 2 0 1 1 0 -4h4a2 2 0 1 0 0 -4h-3"})]}),te),Mr=N(W("g",{strokeWidth:"1.25",children:[x("path",{clipRule:"evenodd",d:"m7.643 15.69 7.774-7.773a2.357 2.357 0 1 0-3.334-3.334L4.31 12.357a3.333 3.333 0 0 0-.977 2.357v1.953h1.953c.884 0 1.732-.352 2.357-.977Z"}),x("path",{d:"m11.25 5.417 3.333 3.333"})]}),ze),Pr=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"20",x2:"7",y2:"20"}),x("line",{x1:"14",y1:"20",x2:"21",y2:"20"}),x("line",{x1:"6.9",y1:"15",x2:"13.8",y2:"15"}),x("line",{x1:"10.2",y1:"6.3",x2:"16",y2:"20"}),x("polyline",{points:"5 20 11 4 13 4 20 20"})]}),te),P2=N(W("g",{stroke:"currentColor",strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 7v-2h13v2"}),x("path",{d:"M10 5v14"}),x("path",{d:"M12 19h-4"}),x("path",{d:"M15 13v-1h6v1"}),x("path",{d:"M18 12v7"}),x("path",{d:"M17 19h2"})]}),te),xl=N(W("g",{strokeWidth:"1.25",children:[x("path",{d:"M12.5 6.667h.01"}),x("path",{d:"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z"}),x("path",{d:"m3.333 12.5 3.334-3.333c.773-.745 1.726-.745 2.5 0l4.166 4.166"}),x("path",{d:"m11.667 11.667.833-.834c.774-.744 1.726-.744 2.5 0l1.667 1.667"})]}),ze),A2=N(W("g",{strokeWidth:"1.25",children:[x("path",{d:"M15 10l4.553-2.843A1 1 0 0 1 21 8.059v7.882a1 1 0 0 1-1.447.902L15 14"}),x("rect",{x:"3",y:"6",width:"12",height:"12",rx:"2"})]}),ze),tu=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3"}),x("path",{d:"M18 13.3l-6.3 -6.3"})]}),te),Nb=N(x("path",{strokeWidth:"1.25",d:"M10 4.167v11.666M4.167 10h11.666"}),ze),Bb=N(x("path",{d:"M5 10h10",strokeWidth:"1.25"}),ze),L2=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M21 21l-6 -6"}),x("path",{d:"M3.268 12.043a7.017 7.017 0 0 0 6.634 4.957a7.012 7.012 0 0 0 7.043 -6.131a7 7 0 0 0 -5.314 -7.672a7.021 7.021 0 0 0 -8.241 4.403"}),x("path",{d:"M3 4v4h4"})]}),te),Co=N(x("path",{strokeWidth:"1.25",d:"M3.333 5.833h13.334M8.333 9.167v5M11.667 9.167v5M4.167 5.833l.833 10c0 .92.746 1.667 1.667 1.667h6.666c.92 0 1.667-.746 1.667-1.667l.833-10M7.5 5.833v-2.5c0-.46.373-.833.833-.833h3.334c.46 0 .833.373.833.833v2.5"}),ze),yl=N(W("g",{strokeWidth:"1.5",children:[x("polyline",{points:"12 16 18 10 12 4"}),x("polyline",{points:"8 4 2 10 8 16"})]}),ze),Sd=N(W("g",{strokeWidth:"1.25",children:[x("path",{d:"M14.375 6.458H8.958a2.5 2.5 0 0 0-2.5 2.5v5.417a2.5 2.5 0 0 0 2.5 2.5h5.417a2.5 2.5 0 0 0 2.5-2.5V8.958a2.5 2.5 0 0 0-2.5-2.5Z"}),x("path",{clipRule:"evenodd",d:"M11.667 3.125c.517 0 .986.21 1.325.55.34.338.55.807.55 1.325v1.458H8.333c-.485 0-.927.185-1.26.487-.343.312-.57.75-.609 1.24l-.005 5.357H5a1.87 1.87 0 0 1-1.326-.55 1.87 1.87 0 0 1-.549-1.325V5c0-.518.21-.987.55-1.326.338-.34.807-.549 1.325-.549h6.667Z"})]}),ze),Md=N(x("path",{clipRule:"evenodd",d:"M10 2.5h.328a6.25 6.25 0 0 0 6.6 10.372A7.5 7.5 0 1 1 10 2.493V2.5Z",stroke:"currentColor"}),ze),Pd=N(x("g",{stroke:"currentColor",strokeLinejoin:"round",children:x("path",{d:"M10 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM10 4.167V2.5M14.167 5.833l1.166-1.166M15.833 10H17.5M14.167 14.167l1.166 1.166M10 15.833V17.5M5.833 14.167l-1.166 1.166M5 10H3.333M5.833 5.833 4.667 4.667"})}),{...ze,strokeWidth:1.5}),_2=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),x("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),x("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]}),te),ls=N(x("path",{strokeWidth:"1.25",d:"M3.333 14.167v1.666c0 .92.747 1.667 1.667 1.667h10c.92 0 1.667-.746 1.667-1.667v-1.666M5.833 9.167 10 13.333l4.167-4.166M10 3.333v10"}),ze),wl=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"12",cy:"12",r:"9"}),x("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),x("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),te),D2=N(W("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"12",cy:"12",r:"9"}),x("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),x("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),te),Fb=N(x("path",{strokeWidth:"1.25",d:"M9.167 5.833H5.833c-1.254 0-2.5 1.282-2.5 2.5v5.834c0 1.283 1.252 2.5 2.5 2.5h5.834c1.251 0 2.5-1.25 2.5-2.5v-3.334M8.333 11.667l8.334-8.334M12.5 3.333h4.167V7.5"}),ze),ou=N(x("path",{d:"M7.5 15.833c-3.583 1.167-3.583-2.083-5-2.5m10 4.167v-2.917c0-.833.083-1.166-.417-1.666 2.334-.25 4.584-1.167 4.584-5a3.833 3.833 0 0 0-1.084-2.667 3.5 3.5 0 0 0-.083-2.667s-.917-.25-2.917 1.084a10.25 10.25 0 0 0-5.166 0C5.417 2.333 4.5 2.583 4.5 2.583a3.5 3.5 0 0 0-.083 2.667 3.833 3.833 0 0 0-1.084 2.667c0 3.833 2.25 4.75 4.584 5-.5.5-.5 1-.417 1.666V17.5",strokeWidth:"1.25"}),ze),R2=N(W("g",{strokeWidth:"1.25",children:[x("path",{d:"M7.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM12.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM6.25 6.25c2.917-.833 4.583-.833 7.5 0M5.833 13.75c2.917.833 5.417.833 8.334 0"}),x("path",{d:"M12.917 14.167c0 .833 1.25 2.5 1.666 2.5 1.25 0 2.361-1.39 2.917-2.5.556-1.39.417-4.861-1.25-9.584-1.214-.846-2.5-1.116-3.75-1.25l-.833 2.084M7.083 14.167c0 .833-1.13 2.5-1.526 2.5-1.191 0-2.249-1.39-2.778-2.5-.529-1.39-.397-4.861 1.19-9.584 1.157-.846 2.318-1.116 3.531-1.25l.833 2.084"})]}),ze),N2=N(W("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 4l11.733 16h4.267l-11.733 -16z"}),x("path",{d:"M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"})]}),te),nu=N(x("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),Ad=N(W("g",{strokeWidth:"1.25",children:[x("path",{d:"M8.333 11.667a2.917 2.917 0 0 0 4.167 0l3.333-3.334a2.946 2.946 0 1 0-4.166-4.166l-.417.416"}),x("path",{d:"M11.667 8.333a2.917 2.917 0 0 0-4.167 0l-3.333 3.334a2.946 2.946 0 0 0 4.166 4.166l.417-.416"})]}),ze),B2=N("M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z",{width:448,height:512}),F2=N("M252 54L203 8a28 27 0 00-20-8H28C12 0 0 12 0 27v195c0 15 12 26 28 26h204c15 0 28-11 28-26V73a28 27 0 00-8-19zM130 213c-21 0-37-16-37-36 0-19 16-35 37-35 20 0 37 16 37 35 0 20-17 36-37 36zm56-169v56c0 4-4 6-7 6H44c-4 0-7-2-7-6V42c0-4 3-7 7-7h133l4 2 3 2a7 7 0 012 5z M296 201l87 95-188 205-78 9c-10 1-19-8-18-20l9-84zm141-14l-41-44a31 31 0 00-46 0l-38 41 87 95 38-42c13-14 13-36 0-50z",{width:448,height:512}),vl=N(x("path",{d:"m9.257 6.351.183.183H15.819c.34 0 .727.182 1.051.506.323.323.505.708.505 1.05v5.819c0 .316-.183.7-.52 1.035-.337.338-.723.522-1.037.522H4.182c-.352 0-.74-.181-1.058-.5-.318-.318-.499-.705-.499-1.057V5.182c0-.351.181-.736.5-1.054.32-.321.71-.503 1.057-.503H6.53l2.726 2.726Z",strokeWidth:"1.25"}),ze),fie=N("M384 112v352c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h80c0-35.29 28.71-64 64-64s64 28.71 64 64h80c26.51 0 48 21.49 48 48zM192 40c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24m96 114v-20a6 6 0 0 0-6-6H102a6 6 0 0 0-6 6v20a6 6 0 0 0 6 6h180a6 6 0 0 0 6-6z",{width:384,height:512}),bie=N("M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"),ru=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 16l1.465 1.638a2 2 0 1 1 -3.015 .099l1.55 -1.737z"}),x("path",{d:"M13.737 9.737c2.299 -2.3 3.23 -5.095 2.081 -6.245c-1.15 -1.15 -3.945 -.217 -6.244 2.082c-2.3 2.299 -3.231 5.095 -2.082 6.244c1.15 1.15 3.946 .218 6.245 -2.081z"}),x("path",{d:"M7.492 11.818c.362 .362 .768 .676 1.208 .934l6.895 4.047c1.078 .557 2.255 -.075 3.692 -1.512c1.437 -1.437 2.07 -2.614 1.512 -3.692c-.372 -.718 -1.72 -3.017 -4.047 -6.895a6.015 6.015 0 0 0 -.934 -1.208"})]}),te),O2=N(x("g",{strokeWidth:1.5,children:x("path",{d:"M6 18l12 -12"})}),te),au=N(W("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M15 8h.01"}),x("path",{d:"M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5"}),x("path",{d:"M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4"}),x("path",{d:"M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598"}),x("path",{d:"M19 16v6"}),x("path",{d:"M22 19l-3 3l-3 -3"})]}),te),z2=N("M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z",{width:512,height:512}),xie=N("M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512}),yie=N("M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512}),U2=N("M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"),wie=N("M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"),Ob=N(x("path",{d:"M7.5 10.833 4.167 7.5 7.5 4.167M4.167 7.5h9.166a3.333 3.333 0 0 1 0 6.667H12.5",strokeWidth:"1.25"}),ze),zb=N(x("path",{d:"M12.5 10.833 15.833 7.5 12.5 4.167M15.833 7.5H6.667a3.333 3.333 0 1 0 0 6.667H7.5",strokeWidth:"1.25"}),ze),H2=N("M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z",{mirror:!0}),G2=N(x("path",{d:"M5 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 7.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 17.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM7.25 8.917l5.5-2.834M7.25 11.083l5.5 2.834",strokeWidth:"1.5"}),ze),vie=N("M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"),Eie=N("M16 5l-1.42 1.42-1.59-1.59V16h-1.98V4.83L9.42 6.42 8 5l4-4 4 4zm4 5v11c0 1.1-.9 2-2 2H6c-1.11 0-2-.9-2-2V10c0-1.11.89-2 2-2h3v2H6v11h12V10h-3V8h3c1.1 0 2 .89 2 2z",{width:24,height:24}),Iie=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M8 9h-1a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-8a2 2 0 0 0 -2 -2h-1"}),x("path",{d:"M12 14v-11"}),x("path",{d:"M9 6l3 -3l3 3"})]}),te),Tie=N(W(xt,{children:[x("path",{fill:"currentColor",d:"M40 5.6v6.1l-4.1.7c-8.9 1.4-16.5 6.9-20.6 15C13 32 10.9 43 12.4 43c.4 0 2.4-1.3 4.4-3 5-3.9 12.1-7 18.2-7.7l5-.6v12.8l11.2-11.3L62.5 22 51.2 10.8 40-.5v6.1zm10.2 22.6L44 34.5v-6.8l-6.9.6c-3.9.3-9.8 1.7-13.2 3.1-3.5 1.4-6.5 2.4-6.7 2.2-.9-1 3-7.5 6.4-10.8C28 18.6 34.4 16 40.1 16c3.7 0 3.9-.1 3.9-3.2V9.5l6.2 6.3 6.3 6.2-6.3 6.2z"}),x("path",{stroke:"currentColor",fill:"currentColor",d:"M0 36v20h48v-6.2c0-6 0-6.1-2-4.3-1.1 1-2 2.9-2 4.2V52H4V34c0-17.3-.1-18-2-18s-2 .7-2 20z"})]}),{width:64,height:64}),kie=N(x("path",{stroke:"currentColor",strokeWidth:"40",fill:"currentColor",d:"M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z"}),{width:1024}),$2=W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 10l0 10"}),x("path",{d:"M12 10l4 4"}),x("path",{d:"M12 10l-4 4"}),x("path",{d:"M4 4l16 0"})]}),V2=W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 5l0 14"}),x("path",{d:"M16 9l-4 -4"}),x("path",{d:"M8 9l4 -4"})]}),Ub=N(V2,te),Hb=N(V2,{...te,style:{transform:"rotate(180deg)"}}),Gb=N($2,te),$b=N($2,{...te,style:{transform:"rotate(180deg)"}}),Vb=N(W(xt,{children:[W("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M3.333 3.333h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v7.083c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V8.125c0-.92-.746-1.667-1.666-1.667ZM6.875 6.458h-.417c-.92 0-1.666.747-1.666 1.667v3.75c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667v-3.75c0-.92-.747-1.667-1.667-1.667Z"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),Wb=N(W(xt,{children:[W("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M6.875 3.125h-.417c-.92 0-1.666.746-1.666 1.667v7.083c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667V4.792c0-.92-.747-1.667-1.667-1.667ZM13.542 5.817h-.417c-.92 0-1.667.747-1.667 1.667v4.391c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V7.484c0-.92-.746-1.667-1.666-1.667Z"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),Kb=N(W(xt,{children:[W("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M15.208 4.792H8.125c-.92 0-1.667.746-1.667 1.666v.417c0 .92.747 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM12.516 11.458H8.125c-.92 0-1.667.746-1.667 1.667v.417c0 .92.747 1.666 1.667 1.666h4.391c.92 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.667-1.667Z"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),Yb=N(W(xt,{children:[W("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M16.667 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M11.875 4.792H4.792c-.92 0-1.667.746-1.667 1.666v.417c0 .92.746 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM11.683 11.458H7.292c-.92 0-1.667.746-1.667 1.667v.417c0 .92.746 1.666 1.667 1.666h4.39c.921 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.666-1.667Z"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),W2=N(W(xt,{children:[W("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M16.667 3.333v13.334M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M14.375 10.208v-.416c0-.92-.746-1.667-1.667-1.667H7.292c-.92 0-1.667.746-1.667 1.667v.416c0 .92.746 1.667 1.667 1.667h5.416c.92 0 1.667-.746 1.667-1.667Z"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),K2=N(W(xt,{children:[W("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M3.333 3.333h13.334M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M10.208 5.625h-.416c-.92 0-1.667.746-1.667 1.667v5.416c0 .92.746 1.667 1.667 1.667h.416c.92 0 1.667-.746 1.667-1.667V7.292c0-.92-.746-1.667-1.667-1.667Z"})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),Xb=N(W("g",{stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M1.667 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M8.333 10h3.334",strokeLinejoin:"round"}),x("path",{d:"M15.417 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M6.875 4.792h-.417c-.92 0-1.666.746-1.666 1.666v7.084c0 .92.746 1.666 1.666 1.666h.417c.92 0 1.667-.746 1.667-1.666V6.458c0-.92-.747-1.666-1.667-1.666ZM13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v3.75c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667v-3.75c0-.92-.746-1.667-1.666-1.667Z"})]}),ze),jb=N(W("g",{stroke:"currentColor",strokeWidth:"1.25",children:[x("path",{d:"M10 18.333v-2.916",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M10 11.667V8.333",strokeLinejoin:"round"}),x("path",{d:"M10 4.583V1.667",strokeLinecap:"round",strokeLinejoin:"round"}),x("path",{d:"M4.792 13.125v.417c0 .92.746 1.666 1.666 1.666h7.084c.92 0 1.666-.746 1.666-1.666v-.417c0-.92-.746-1.667-1.666-1.667H6.458c-.92 0-1.666.746-1.666 1.667ZM6.458 6.458v.417c0 .92.747 1.667 1.667 1.667h3.75c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666h-3.75c-.92 0-1.667.746-1.667 1.666Z"})]}),ze),iu=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("circle",{cx:"9",cy:"7",r:"4"}),x("path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"}),x("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}),x("path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85"})]}),te),Cie=N("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z"),Y2=N("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm96 328c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h160c8.8 0 16 7.2 16 16v160z"),Nn=N(W(xt,{children:[x("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:x("path",{d:"M15 5 5 15M5 5l10 10"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),Sie=N("M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z",{mirror:!0}),Mie=N("M11.553 22.894a.998.998 0 00.894 0s3.037-1.516 5.465-4.097C19.616 16.987 21 14.663 21 12V5a1 1 0 00-.649-.936l-8-3a.998.998 0 00-.702 0l-8 3A1 1 0 003 5v7c0 2.663 1.384 4.987 3.088 6.797 2.428 2.581 5.465 4.097 5.465 4.097zm-1.303-8.481l6.644-6.644a.856.856 0 111.212 1.212l-7.25 7.25a.856.856 0 01-1.212 0l-3.75-3.75a.856.856 0 111.212-1.212l3.144 3.144z",{width:24}),Pie=N("M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm32-48h224V288l-23.5-23.5c-4.7-4.7-12.3-4.7-17 0L176 352l-39.5-39.5c-4.7-4.7-12.3-4.7-17 0L80 352v64zm48-240c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z",{width:384,height:512}),Zb=go.memo(({theme:e})=>N(W(xt,{children:[x("path",{d:"M25 26H111V111H25",fill:lr(e)}),x("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:lr(e),strokeWidth:"2"}),x("path",{d:"M100 100H160V160H100",fill:lr(e)}),x("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:lr(e),strokeWidth:"2"}),W("g",{fill:y2(e),stroke:lr(e),strokeWidth:"6",children:[x("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),x("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),x("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),x("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),qb=go.memo(({theme:e})=>N(W(xt,{children:[x("path",{d:"M25 26H111V111H25",fill:lr(e)}),x("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:lr(e),strokeWidth:"2"}),x("path",{d:"M100 100H160V160H100",fill:lr(e)}),x("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:lr(e),strokeWidth:"2"}),W("g",{fill:y2(e),stroke:lr(e),strokeWidth:"6",children:[x("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),x("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),x("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),x("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),x("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),x("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),X2=N(x("g",{strokeWidth:1.25,children:x("path",{d:"M5.879 2.625h8.242a3.27 3.27 0 0 1 3.254 3.254v8.242a3.27 3.27 0 0 1-3.254 3.254H5.88a3.27 3.27 0 0 1-3.254-3.254V5.88A3.27 3.27 0 0 1 5.88 2.626l-.001-.001ZM4.518 16.118l7.608-12.83m.198 13.934 5.051-9.897M2.778 9.675l9.348-6.387m-7.608 12.83 12.857-8.793"})}),ze),j2=N(W(xt,{children:[x("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",stroke:"currentColor",strokeWidth:"1.25"}),x("mask",{id:"FillHachureIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:2,y:2,width:16,height:16,children:x("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"1.25"})}),x("g",{mask:"url(#FillHachureIcon)",children:x("path",{d:"M2.258 15.156 15.156 2.258M7.324 20.222 20.222 7.325m-20.444 5.35L12.675-.222m-8.157 18.34L17.416 5.22",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})]}),ze),Z2=N(W(xt,{children:[W("g",{clipPath:"url(#a)",children:[x("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",stroke:"currentColor",strokeWidth:"1.25"}),x("mask",{id:"FillCrossHatchIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:-1,y:-1,width:22,height:22,children:x("path",{d:"M2.426 15.044 15.044 2.426M7.383 20 20 7.383M0 12.617 12.617 0m-7.98 17.941L17.256 5.324m-2.211 12.25L2.426 4.956M20 12.617 7.383 0m5.234 20L0 7.383m17.941 7.98L5.324 2.745",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),x("g",{mask:"url(#FillCrossHatchIcon)",children:x("path",{d:"M14.121 2H5.88A3.879 3.879 0 0 0 2 5.879v8.242A3.879 3.879 0 0 0 5.879 18h8.242A3.879 3.879 0 0 0 18 14.121V5.88A3.879 3.879 0 0 0 14.121 2Z",fill:"currentColor"})})]}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),q2=N(W(xt,{children:[x("g",{clipPath:"url(#a)",children:x("path",{d:"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z",stroke:"currentColor",strokeWidth:"1.25"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),{...ze,fill:"currentColor"}),Jb=N(x(xt,{children:x("path",{d:"M4.167 10h11.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),ze),J2=N(x("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),ze),Q2=N(x("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"3.75",strokeLinecap:"round",strokeLinejoin:"round"}),ze),Aie=go.memo(({theme:e})=>N(x("path",{d:"M6 10H34",stroke:lr(e),strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})),eI=N(W("g",{strokeWidth:"2",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 12h2"}),x("path",{d:"M17 12h2"}),x("path",{d:"M11 12h2"})]}),te),tI=N(W("g",{strokeWidth:"2",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 12v.01"}),x("path",{d:"M8 12v.01"}),x("path",{d:"M12 12v.01"}),x("path",{d:"M16 12v.01"}),x("path",{d:"M20 12v.01"})]}),te),oI=N(x("path",{d:"M2.5 12.038c1.655-.885 5.9-3.292 8.568-4.354 2.668-1.063.101 2.821 1.32 3.104 1.218.283 5.112-1.814 5.112-1.814",strokeWidth:"1.25"}),ze),nI=N(x("path",{d:"M2.5 12.563c1.655-.886 5.9-3.293 8.568-4.355 2.668-1.062.101 2.822 1.32 3.105 1.218.283 5.112-1.814 5.112-1.814m-13.469 2.23c2.963-1.586 6.13-5.62 7.468-4.998 1.338.623-1.153 4.11-.132 5.595 1.02 1.487 6.133-1.43 6.133-1.43",strokeWidth:"1.25"}),ze),rI=N(x("path",{d:"M2.5 11.936c1.737-.879 8.627-5.346 10.42-5.268 1.795.078-.418 5.138.345 5.736.763.598 3.53-1.789 4.235-2.147M2.929 9.788c1.164-.519 5.47-3.28 6.987-3.114 1.519.165 1 3.827 2.121 4.109 1.122.281 3.839-2.016 4.606-2.42",strokeWidth:"1.25"}),ze),aI=N(W("svg",{strokeWidth:"1.5",children:[x("path",{d:"M3.33334 9.99998V6.66665C3.33334 6.04326 3.33403 4.9332 3.33539 3.33646C4.95233 3.33436 6.06276 3.33331 6.66668 3.33331H10"}),x("path",{d:"M13.3333 3.33331V3.34331"}),x("path",{d:"M16.6667 3.33331V3.34331"}),x("path",{d:"M16.6667 6.66669V6.67669"}),x("path",{d:"M16.6667 10V10.01"}),x("path",{d:"M3.33334 13.3333V13.3433"}),x("path",{d:"M16.6667 13.3333V13.3433"}),x("path",{d:"M3.33334 16.6667V16.6767"}),x("path",{d:"M6.66666 16.6667V16.6767"}),x("path",{d:"M10 16.6667V16.6767"}),x("path",{d:"M13.3333 16.6667V16.6767"}),x("path",{d:"M16.6667 16.6667V16.6767"})]}),ze),iI=N(W("g",{strokeWidth:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 12v-4a4 4 0 0 1 4 -4h4"}),x("line",{x1:"16",y1:"4",x2:"16",y2:"4.01"}),x("line",{x1:"20",y1:"4",x2:"20",y2:"4.01"}),x("line",{x1:"20",y1:"8",x2:"20",y2:"8.01"}),x("line",{x1:"20",y1:"12",x2:"20",y2:"12.01"}),x("line",{x1:"4",y1:"16",x2:"4",y2:"16.01"}),x("line",{x1:"20",y1:"16",x2:"20",y2:"16.01"}),x("line",{x1:"4",y1:"20",x2:"4",y2:"20.01"}),x("line",{x1:"8",y1:"20",x2:"8",y2:"20.01"}),x("line",{x1:"12",y1:"20",x2:"12",y2:"20.01"}),x("line",{x1:"16",y1:"20",x2:"16",y2:"20.01"}),x("line",{x1:"20",y1:"20",x2:"20",y2:"20.01"})]}),te),sI=go.memo(({flip:e=!1})=>N(W("g",{transform:e?"translate(24, 0) scale(-1, 1)":"",stroke:"currentColor",opacity:.3,strokeWidth:2,children:[x("path",{d:"M12 12l-9 0"}),x("path",{d:"M21 9l-6 6"}),x("path",{d:"M21 15l-6 -6"})]}),te)),lI=go.memo(({flip:e=!1})=>N(W("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",strokeWidth:2,fill:"none",children:[x("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),x("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})),cI=go.memo(({flip:e=!1})=>N(W("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[x("path",{d:"M32 10L6 10",strokeWidth:2}),x("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),dI=go.memo(({flip:e=!1})=>N(W("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,children:[x("path",{d:"M26 10L6 10"}),x("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),mI=go.memo(({flip:e=!1})=>N(x("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",children:x("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"currentColor",strokeWidth:2,fill:"none"})}),{width:40,height:20})),pI=go.memo(({flip:e=!1})=>N(W("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[x("path",{d:"M32 10L6 10",strokeWidth:2}),x("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})),uI=go.memo(({flip:e=!1})=>N(W("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,strokeLinejoin:"round",children:[x("path",{d:"M6,9.5H27"}),x("path",{d:"M27,5L34,10L27,14Z",fill:"none"})]}),{width:40,height:20})),gI=go.memo(({flip:e=!1})=>N(W("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[x("path",{d:"M6,9.5H20"}),x("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),hI=go.memo(({flip:e=!1})=>N(W("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[x("path",{d:"M6,9.5H20"}),x("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),fI=go.memo(({flip:e=!1})=>N(x("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:x("path",{d:"M34,10 H6 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),bI=go.memo(({flip:e=!1})=>N(x("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:x("path",{d:"M34,10 H6 M15,10 L15,15 L15,5"})}),{width:40,height:20})),xI=go.memo(({flip:e=!1})=>N(x("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:x("path",{d:"M34,10 H6 M15,10 L15,16 L15,4 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),yI=N(W(xt,{children:[x("g",{clipPath:"url(#a)",children:x("path",{d:"M14.167 6.667a3.333 3.333 0 0 0-3.334-3.334H9.167a3.333 3.333 0 0 0 0 6.667h1.666a3.333 3.333 0 0 1 0 6.667H9.167a3.333 3.333 0 0 1-3.334-3.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),wI=N(W(xt,{children:[x("g",{clipPath:"url(#a)",children:x("path",{d:"M5 16.667V3.333L10 15l5-11.667v13.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),vI=N(W(xt,{children:[x("g",{clipPath:"url(#a)",children:x("path",{d:"M5.833 3.333v13.334h8.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),x("defs",{children:x("clipPath",{id:"a",children:x("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),ze),EI=N(x(xt,{children:x("path",{d:"m1.667 3.333 6.666 13.334M8.333 3.333 1.667 16.667M11.667 3.333v13.334h6.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),ze),cs=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 7v-2h13v2"}),x("path",{d:"M10 5v14"}),x("path",{d:"M12 19h-4"}),x("path",{d:"M15 13v-1h6v1"}),x("path",{d:"M18 12v7"}),x("path",{d:"M17 19h2"})]}),te),II=N(x(xt,{children:W("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M7 12h10"}),x("path",{d:"M7 5v14"}),x("path",{d:"M17 5v14"}),x("path",{d:"M15 19h4"}),x("path",{d:"M15 5h4"}),x("path",{d:"M5 19h4"}),x("path",{d:"M5 5h4"})]})}),te),Ld=N(x(xt,{children:x("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:x("path",{d:"M5.833 16.667v-10a3.333 3.333 0 0 1 3.334-3.334h1.666a3.333 3.333 0 0 1 3.334 3.334v10M5.833 10.833h8.334"})})}),ze),Qb=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M7 8l-4 4l4 4"}),x("path",{d:"M17 8l4 4l-4 4"}),x("path",{d:"M14 4l-4 16"})]}),te),su=Qb,TI=N(W("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),x("line",{x1:"4",y1:"12",x2:"12",y2:"12"}),x("line",{x1:"4",y1:"16",x2:"16",y2:"16"})]}),te),kI=N(W("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),x("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),x("line",{x1:"6",y1:"16",x2:"18",y2:"16"})]}),te),CI=N(W("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),x("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),x("line",{x1:"8",y1:"16",x2:"20",y2:"16"})]}),te),SI=go.memo(({theme:e})=>N(W("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"4",x2:"20",y2:"4"}),x("rect",{x:"9",y:"8",width:"6",height:"12",rx:"2"})]}),te)),MI=go.memo(({theme:e})=>N(W("g",{strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"20",x2:"20",y2:"20"}),x("rect",{x:"9",y:"4",width:"6",height:"12",rx:"2"})]}),te)),PI=go.memo(({theme:e})=>N(W("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("line",{x1:"4",y1:"12",x2:"9",y2:"12"}),x("line",{x1:"15",y1:"12",x2:"20",y2:"12"}),x("rect",{x:"9",y:"6",width:"6",height:"12",rx:"2"})]}),te)),lu=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M21 19h-18l9 -15"}),x("path",{d:"M20.615 15.171h.015"}),x("path",{d:"M19.515 11.771h.015"}),x("path",{d:"M17.715 8.671h.015"}),x("path",{d:"M15.415 5.971h.015"})]}),te),AI=N(x("path",{d:"M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z",fill:"currentColor"}),{width:640,height:512}),Lie=N(x("path",{d:"M480 416C497.7 416 512 430.3 512 448C512 465.7 497.7 480 480 480H150.6C133.7 480 117.4 473.3 105.4 461.3L25.37 381.3C.3786 356.3 .3786 315.7 25.37 290.7L258.7 57.37C283.7 32.38 324.3 32.38 349.3 57.37L486.6 194.7C511.6 219.7 511.6 260.3 486.6 285.3L355.9 416H480zM265.4 416L332.7 348.7L195.3 211.3L70.63 336L150.6 416L265.4 416z"})),El=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5"}),x("path",{d:"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5"}),x("path",{d:"M14 5.5a1.5 1.5 0 0 1 3 0v6.5"}),x("path",{d:"M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47"})]}),te),e0=N(W(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),x("path",{d:"M7 11l5 5l5 -5"}),x("path",{d:"M12 4l0 12"})]}),te),Il=N(W(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"}),x("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"})]}),te),LI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M7 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),x("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),x("path",{d:"M9.15 14.85l8.85 -10.85"}),x("path",{d:"M6 4l8.85 10.85"})]}),te),_I=N(W(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),x("path",{d:"M12 17l0 .01"}),x("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),te),_ie=N(W(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M7 4v16l13 -8z"})]}),te),Die=N(W(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M17 4h-10a3 3 0 0 0 -3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3 -3v-10a3 3 0 0 0 -3 -3z",strokeWidth:"0",fill:"currentColor"})]}),te),DI=N(W(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 12l5 5l10 -10"})]}),te),cu=N(W(xt,{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M10.24 3.957l-8.422 14.06a1.989 1.989 0 0 0 1.7 2.983h16.845a1.989 1.989 0 0 0 1.7 -2.983l-8.423 -14.06a1.989 1.989 0 0 0 -3.4 0z"}),x("path",{d:"M12 9v4"}),x("path",{d:"M12 17h.01"})]}),te),RI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M11 7l6 6"}),x("path",{d:"M4 16l11.7 -11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4l-11.7 11.7h-4v-4z"})]}),te),_d=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 3l-4 7h8z"}),x("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),x("path",{d:"M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"})]}),te),Ar=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 7l16 0"}),x("path",{d:"M4 17l16 0"}),x("path",{d:"M7 4l0 16"}),x("path",{d:"M17 4l0 16"})]}),te),du=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),x("circle",{cx:"8.5",cy:"8.5",r:"1.5",fill:"currentColor",stroke:"none"}),x("path",{d:"M3 16l5-5c.928-.893 2.072-.893 3 0l5 5"}),x("path",{d:"M14 14l1-1c.928-.893 2.072-.893 3 0l3 3"}),x("path",{d:"M17.5 4.5l0 3m-1.5-1.5l3 0",strokeWidth:"1.5",strokeLinecap:"round"})]}),te),mu=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("rect",{x:"3",y:"6",width:"12",height:"12",rx:"2"}),x("path",{d:"M15 10l4.553-2.07A1 1 0 0 1 21 8.87v6.26a1 1 0 0 1-1.447.94L15 14"}),x("path",{d:"M17.5 4.5l0 3m-1.5-1.5l3 0",strokeWidth:"1.5",strokeLinecap:"round"})]}),te),Tl=N(x("path",{fill:"currentColor",d:"M407.48,111.18C335.587,108.103 269.573,152.338 245.08,220C220.587,152.338 154.573,108.103 82.68,111.18C80.285,168.229 107.577,222.632 154.74,254.82C178.908,271.419 193.35,298.951 193.27,328.27L193.27,379.13L296.9,379.13L296.9,328.27C296.816,298.953 311.255,271.42 335.42,254.82C382.596,222.644 409.892,168.233 407.48,111.18Z"})),NI=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"}),x("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"})]}),te),BI=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 10l-2 1l8 4l8 -4l-2 -1"}),x("path",{d:"M4 15l8 4l8 -4"}),x("path",{d:"M12 4v7"}),x("path",{d:"M15 8l-3 3l-3 -3"})]}),te),Xa=N(W("g",{strokeWidth:"1.25",children:[x("path",{d:"M4.16602 10H15.8327"}),x("path",{d:"M12.5 13.3333L15.8333 10"}),x("path",{d:"M12.5 6.66666L15.8333 9.99999"})]}),ze),Lr=N(W("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",transform:"rotate(90 10 10)",children:[x("path",{clipRule:"evenodd",d:"m9.644 13.69 7.774-7.773a2.357 2.357 0 0 0-3.334-3.334l-7.773 7.774L8 12l1.643 1.69Z"}),x("path",{d:"m13.25 3.417 3.333 3.333M10 10l2-2M5 15l3-3M2.156 17.894l1-1M5.453 19.029l-.144-1.407M2.377 11.887l.866 1.118M8.354 17.273l-1.194-.758M.953 14.652l1.408.13"})]}),20),ds=N(W("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z"}),x("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),x("path",{d:"M15 6l3 3"}),x("path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}),x("path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"})]}),te),Rie=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z"}),x("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),x("path",{d:"M15 6l3 3"}),x("path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}),x("path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"})]}),te),Nie=N(W("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M11.217 19.384a3.501 3.501 0 0 0 6.783 -1.217v-5.167l-6 -3.35"}),x("path",{d:"M5.214 15.014a3.501 3.501 0 0 0 4.446 5.266l4.34 -2.534v-6.946"}),x("path",{d:"M6 7.63c-1.391 -.236 -2.787 .395 -3.534 1.689a3.474 3.474 0 0 0 1.271 4.745l4.263 2.514l6 -3.348"}),x("path",{d:"M12.783 4.616a3.501 3.501 0 0 0 -6.783 1.217v5.067l6 3.45"}),x("path",{d:"M18.786 8.986a3.501 3.501 0 0 0 -4.446 -5.266l-4.34 2.534v6.946"}),x("path",{d:"M18 16.302c1.391 .236 2.787 -.395 3.534 -1.689a3.474 3.474 0 0 0 -1.271 -4.745l-4.308 -2.514l-5.955 3.42"})]}),te),FI=N(W("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2"}),x("path",{d:"M4 16v2a2 2 0 0 0 2 2h2"}),x("path",{d:"M16 4h2a2 2 0 0 1 2 2v2"}),x("path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2"})]}),te),kl=N(W("g",{stroke:"currentColor",fill:"none",strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"}),x("path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"})]}),te),OI=N(W("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828"}),x("path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"}),x("path",{d:"M3 3l18 18"})]}),te),zI=N(W("g",{stroke:"currentColor",fill:"none",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8"}),x("path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8"}),x("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),x("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),x("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),x("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),te),UI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8"}),x("path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8"}),x("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),x("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),x("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),x("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),te),fn=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),x("path",{d:"M21 21l-6 -6"})]}),te),HI=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M20.984 12.53a9 9 0 1 0 -7.552 8.355"}),x("path",{d:"M12 7v5l3 3"}),x("path",{d:"M19 16l-2 3h4l-2 3"})]}),te),GI=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 8l0 4l2 2"}),x("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})]}),te),$I=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M9 2m0 3a3 3 0 0 1 3 -3h0a3 3 0 0 1 3 3v5a3 3 0 0 1 -3 3h0a3 3 0 0 1 -3 -3z"}),x("path",{d:"M5 10a7 7 0 0 0 14 0"}),x("path",{d:"M8 21l8 0"}),x("path",{d:"M12 17l0 4"})]}),te),VI=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 3l18 18"}),x("path",{d:"M9 5a3 3 0 0 1 6 0v5a3 3 0 0 1 -.13 .874m-2 2a3 3 0 0 1 -3.87 -2.872v-1"}),x("path",{d:"M5 10a7 7 0 0 0 10.846 5.85m2 -2a6.967 6.967 0 0 0 1.152 -3.85"}),x("path",{d:"M8 21l8 0"}),x("path",{d:"M12 17l0 4"})]}),te),Dd=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11"})]}),te),WI=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M8 8m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z"}),x("path",{d:"M12 20v.01"}),x("path",{d:"M16 20v.01"}),x("path",{d:"M8 20v.01"}),x("path",{d:"M4 20v.01"}),x("path",{d:"M4 16v.01"}),x("path",{d:"M4 12v.01"}),x("path",{d:"M4 8v.01"}),x("path",{d:"M4 4v.01"}),x("path",{d:"M8 4v.01"}),x("path",{d:"M12 4v.01"}),x("path",{d:"M16 4v.01"}),x("path",{d:"M20 4v.01"}),x("path",{d:"M20 8v.01"}),x("path",{d:"M20 12v.01"}),x("path",{d:"M20 16v.01"}),x("path",{d:"M20 20v.01"})]}),te),KI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 3v18"}),x("path",{d:"M19 21v-18"}),x("path",{d:"M5 7h14"}),x("path",{d:"M5 15h14"}),x("path",{d:"M8 13v4"}),x("path",{d:"M11 13v4"}),x("path",{d:"M16 13v4"}),x("path",{d:"M14 5v4"}),x("path",{d:"M11 5v4"}),x("path",{d:"M8 5v4"}),x("path",{d:"M3 21h18"})]}),te),YI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 12l18 0"}),x("path",{d:"M7 16l10 0l-10 5l0 -5"}),x("path",{d:"M7 8l10 0l-10 -5l0 5"})]}),te),XI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M12 3l0 18"}),x("path",{d:"M16 7l0 10l5 0l-5 -10"}),x("path",{d:"M8 7l0 10l-5 0l5 -10"})]}),te),t0=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z"}),x("path",{d:"M19 6h1a2 2 0 0 1 2 2a5 5 0 0 1 -5 5l-5 0v2"}),x("path",{d:"M10 15m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"})]}),te),Cl=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0"}),x("path",{d:"M22 22l-3 -3"}),x("path",{d:"M6 18h-1a2 2 0 0 1 -2 -2v-1"}),x("path",{d:"M3 11v-1"}),x("path",{d:"M3 6v-1a2 2 0 0 1 2 -2h1"}),x("path",{d:"M10 3h1"}),x("path",{d:"M15 3h1a2 2 0 0 1 2 2v1"})]}),te),jI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),x("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),x("path",{d:"M4 20.25c0 .414 .336 .75 .75 .75h1.25a1 1 0 0 0 1 -1v-1a1 1 0 0 0 -1 -1h-1a1 1 0 0 1 -1 -1v-1a1 1 0 0 1 1 -1h1.25a.75 .75 0 0 1 .75 .75"}),x("path",{d:"M10 15l2 6l2 -6"}),x("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"})]}),te),ZI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),x("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),x("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"}),x("path",{d:"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"}),x("path",{d:"M11 21v-6l3 6v-6"})]}),te),qI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 13v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a2 2 0 0 0 6 0v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a8 8 0 0 1 -16 0"}),x("path",{d:"M4 8l5 0"}),x("path",{d:"M15 8l4 0"})]}),te),JI=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 14c.83 .642 2.077 1.017 3.5 1c1.423 .017 2.67 -.358 3.5 -1c.83 -.642 2.077 -1.017 3.5 -1c1.423 -.017 2.67 .358 3.5 1"}),x("path",{d:"M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),x("path",{d:"M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),x("path",{d:"M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z"}),x("path",{d:"M16.746 16.726a3 3 0 1 0 .252 -5.555"})]}),te),QI=N(W("g",{stroke:"currentColor",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-16a1 1 0 0 1-1-1v-10zM7 20h10M9 16v4M15 16v4"})]}),{...te,strokeWidth:1.5}),Bie=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M15 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"}),x("path",{d:"M21 12h-13l3 -3"}),x("path",{d:"M11 15l-3 -3"})]}),te),eT=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M2 8a4 4 0 0 1 4 -4h12a4 4 0 0 1 4 4v8a4 4 0 0 1 -4 4h-12a4 4 0 0 1 -4 -4v-8z"}),x("path",{d:"M10 9l5 3l-5 3z"})]}),te),tT=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 6h18"}),x("path",{d:"M3 12h18"}),x("path",{d:"M3 18h18"}),x("path",{d:"M6 3v18"}),x("path",{d:"M12 3v18"}),x("path",{d:"M18 3v18"})]}),te),oT=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M17 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}),x("path",{d:"M3 17m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}),x("path",{d:"M17 5c-6.627 0 -12 5.373 -12 12"})]}),te),Sl=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 18l12 -12"}),x("path",{d:"M18 10v-4h-4"})]}),te),Ml=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7"}),x("path",{d:"M18 4l3 3l-3 3"})]}),te),Pl=N(W("g",{children:[x("path",{d:"M16,12L20,9L16,6"}),x("path",{d:"M6 20c0 -6.075 4.925 -11 11 -11h3"})]}),te),pu=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 9l6 6l6 -6"})]}),te),nT=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 15l6 -6l6 6"})]}),te),rT=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 15l6 -6l6 6"})]}),te),o0=N(W("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M8 5v10a1 1 0 0 0 1 1h10"}),x("path",{d:"M5 8h10a1 1 0 0 1 1 1v10"})]}),te),uu=N(W("g",{children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M5 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M19 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M5 7l0 10"}),x("path",{d:"M7 5l10 0"}),x("path",{d:"M7 19l10 0"}),x("path",{d:"M19 7l0 10"})]}),te),Fie=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 11v8a1 1 0 0 0 1 1h8m-9 -14v-1a1 1 0 0 1 1 -1h1m5 0h2m5 0h1a1 1 0 0 1 1 1v1m0 5v2m0 5v1a1 1 0 0 1 -1 1h-1"}),x("path",{d:"M4 12h7a1 1 0 0 1 1 1v7"})]}),te),aT=N(W("g",{strokeWidth:1.5,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 6l8 0"}),x("path",{d:"M16 6l4 0"}),x("path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 12l2 0"}),x("path",{d:"M10 12l10 0"}),x("path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 18l11 0"}),x("path",{d:"M19 18l1 0"})]}),te),iT=N(W("g",{strokeWidth:1,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M6 10l4 -4 L6 14l8 -8 L6 18l12 -12 L10 18l8 -8 L14 18l4 -4"})]}),te),sT=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"}),x("path",{d:"M13.5 6.5l4 4"})]}),te),Oie=N(W("g",{strokeWidth:1,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M11 7l-5 5l5 5"}),x("path",{d:"M17 7l-5 5l5 5"})]}),te),lT=N(W("g",{strokeWidth:"1.75",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"}),x("path",{d:"M15 4l0 16"})]}),te),zie=N(W("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 20l1.3 -3.9c-2.324 -3.437 -1.426 -7.872 2.1 -10.374c3.526 -2.501 8.59 -2.296 11.845 .48c3.255 2.777 3.695 7.266 1.029 10.501c-2.666 3.235 -7.615 4.215 -11.574 2.293l-4.7 1"})]}),te),Uie=N(W("g",{strokeWidth:"1.25",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M3 4l18 0"}),x("path",{d:"M4 4v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-10"}),x("path",{d:"M12 16l0 4"}),x("path",{d:"M9 20l6 0"}),x("path",{d:"M8 12l3 -3l2 2l3 -3"})]}),te),cT=x("div",{style:{width:"1rem",height:"1rem"}}),dT=N(W("g",{strokeWidth:"1.5",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("polyline",{points:"9 6 15 12 9 18"})]}),te),mT=N(W("g",{strokeWidth:1.25,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),x("path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 6l8 0"}),x("path",{d:"M16 6l4 0"}),x("path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 12l2 0"}),x("path",{d:"M10 12l10 0"}),x("path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),x("path",{d:"M4 18l11 0"}),x("path",{d:"M19 18l1 0"})]}),te);import pT from"clsx";import r0,{useEffect as ZR,useRef as uT,useState as qR}from"react";import{isPromiseLike as JR}from"@orangecatai/common";import XR from"react";import{jsx as n0}from"react/jsx-runtime";var jR=({size:e="1em",circleWidth:t=8,synchronized:o=!1,className:n=""})=>{let a=-(XR.useRef(Date.now()).current%1600);return n0("div",{className:`Spinner ${n}`,children:n0("svg",{viewBox:"0 0 100 100",style:{width:e,height:e,"--spinner-delay":o?`${a}ms`:0},children:n0("circle",{cx:"50",cy:"50",r:50-t/2,strokeWidth:t,fill:"none",strokeMiterlimit:"10"})})})},So=jR;import{jsx as Rd,jsxs as Nd}from"react/jsx-runtime";var be=r0.forwardRef(({size:e="medium",visible:t=!0,className:o="",...n},r)=>{let{id:a}=St(),i=r0.useRef(null);r0.useImperativeHandle(r,()=>i.current);let s=`ToolIcon_size_${e}`,[l,c]=qR(!1),m=uT(!0),p=async u=>{let h="onClick"in n&&n.onClick?.(u);if(JR(h))try{c(!0),await h}catch(g){if(g instanceof rl)console.warn(g);else throw g}finally{m.current&&c(!1)}};ZR(()=>(m.current=!0,()=>{m.current=!1}),[]);let d=uT(null);if(n.type==="button"||n.type==="icon"||n.type==="submit"){let u=n.type==="icon"?"button":n.type;return Nd("button",{className:pT("ToolIcon_type_button",s,o,t&&!n.hidden?"ToolIcon_type_button--show":"ToolIcon_type_button--hide",{ToolIcon:!n.hidden,"ToolIcon--selected":n.selected,"ToolIcon--plain":n.type==="icon"}),style:n.style,"data-testid":n["data-testid"],hidden:n.hidden,title:n.title,"aria-label":n["aria-label"],type:u,onClick:p,ref:i,disabled:l||n.isLoading||!!n.disabled,children:[(n.icon||n.label)&&Nd("div",{className:"ToolIcon__icon","aria-hidden":"true","aria-disabled":!!n.disabled,children:[n.icon||n.label,n.keyBindingLabel&&Rd("span",{className:"ToolIcon__keybinding",children:n.keyBindingLabel}),n.isLoading&&Rd(So,{})]}),n.showAriaLabel&&Nd("div",{className:"ToolIcon__label",children:[n["aria-label"]," ",l&&Rd(So,{})]}),n.children]})}return Nd("label",{className:pT("ToolIcon",o),title:n.title,onPointerDown:u=>{d.current=u.pointerType||null,n.onPointerDown?.({pointerType:u.pointerType||null})},onPointerUp:()=>{requestAnimationFrame(()=>{d.current=null})},children:[Rd("input",{className:`ToolIcon_type_radio ${s}`,type:"radio",name:n.name,"aria-label":n["aria-label"],"aria-keyshortcuts":n["aria-keyshortcuts"],"data-testid":n["data-testid"],id:`${a}-${n.id}`,onChange:()=>{n.onChange?.({pointerType:d.current})},checked:n.checked,ref:i}),Nd("div",{className:"ToolIcon__icon",children:[n.icon,n.keyBindingLabel&&Rd("span",{className:"ToolIcon__keybinding",children:n.keyBindingLabel})]})]})});be.displayName="ToolButton";var gu=[],X=e=>(gu=gu.concat(e),e);import{jsx as s8}from"react/jsx-runtime";var i8=(e,t,o)=>{let n=new Set(Me(e.filter(m=>n8(m)),t).map(m=>m.id)),r={},a=o.scene.getNonDeletedElementsMap(),i=new Set;for(let m of n){let p=r8(e,m);for(let d of p)if(!i.has(d.id)){if(hu(d)){let u=hT(d,a);u&&(r[u.id]=!0)}else r[d.id]=!0;i.add(d.id)}}let s=!0,l=e.map(m=>{if(t.selectedElementIds[m.id]){let p=hu(m)?hT(m,a):null;return m.frameId&&n.has(m.frameId)?(s=!1,r[m.id]=!0,m):p?.frameId&&n.has(p?.frameId)?m:(m.boundElements&&m.boundElements.forEach(d=>{let u=o.scene.getNonDeletedElementsMap().get(d.id);u&&o8(u)&&o.scene.mutateElement(u,{startBinding:m.id===u.startBinding?.elementId?null:u.startBinding,endBinding:m.id===u.endBinding?.elementId?null:u.endBinding})}),bu(m,{isDeleted:!0}))}return m.frameId&&n.has(m.frameId)?(s=!1,hu(m)||(r[m.id]=!0),bu(m,{frameId:null})):hu(m)&&t.selectedElementIds[m.containerId]?bu(m,{isDeleted:!0}):m}),c=t.editingGroupId;if(s&&t.editingGroupId){let m=s0(l,t.editingGroupId).filter(p=>!p.isDeleted);if(m.length>1)m[0]&&(r[m[0].id]=!0);else{c=null,m[0]&&(r[m[0].id]=!0);let p=m[0];if(p){let d=p.groupIds.findIndex(h=>h===t.editingGroupId),u=p.groupIds[d+1];if(u){let h=s0(l,u).filter(g=>!g.isDeleted);h.length>1&&(c=u,h.forEach(g=>{r[g.id]=!0}))}}}}return{elements:l,appState:{...t,...a8({selectedElementIds:r,editingGroupId:c},l,t,null)}}},fT=(e,t)=>{if(e.editingGroupId){let o=s0(i0(t),e.editingGroupId);if(o.length)return{...e,selectedElementIds:{[o[0].id]:!0}}}return e},Bd=X({name:"deleteSelectedElements",label:"labels.delete",icon:Co,trackEvent:{category:"element",action:"delete"},perform:(e,t,o,n)=>{if(t.selectedLinearElement?.isEditing){let{elementId:i,selectedPointsIndices:s}=t.selectedLinearElement,l=n.scene.getNonDeletedElementsMap(),c=gT.getElement(i,l);if(!c||s==null)return!1;if(s.length>=c.points.length){let m=e.map(d=>d.id===c.id?bu(d,{isDeleted:!0}):d),p=fT(t,m);return{elements:m,appState:{...p,selectedLinearElement:null},captureUpdate:fu.IMMEDIATELY}}return gT.deletePoints(c,n,s),{elements:e,appState:{...t,selectedLinearElement:{...t.selectedLinearElement,selectedPointsIndices:s?.[0]>0?[s[0]-1]:[0]}},captureUpdate:fu.IMMEDIATELY}}let{elements:r,appState:a}=i8(e,t,n);return t8(r,r.filter(i=>i.isDeleted)),a=fT(a,r),{elements:r,appState:{...a,activeTool:e8(t,{type:n.state.preferredSelectionTool.type}),multiElement:null,newElement:null,activeEmbeddable:null,selectedLinearElement:null},captureUpdate:ft(i0(e),t)?fu.IMMEDIATELY:fu.EVENTUALLY}},keyTest:(e,t,o)=>(e.key===a0.BACKSPACE||e.key===a0.DELETE)&&!e[a0.CTRL_OR_CMD],PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=ho()==="mobile";return s8(be,{type:"button",icon:Co,title:b("labels.delete"),"aria-label":b("labels.delete"),onClick:()=>o(null),disabled:!ft(i0(e),t),style:{...r&&t.openPopup!=="compactOtherProperties"?QR:{}}})}});import{KEYS as Al,CODES as Ll,isDarwin as xu}from"@orangecatai/common";import{moveOneLeft as l8,moveOneRight as c8,moveAllLeft as d8,moveAllRight as m8}from"@orangecatai/element";import{CaptureUpdateAction as yu}from"@orangecatai/element";import{isDarwin as bT}from"@orangecatai/common";var V=e=>e.replace(/\b(Opt(?:ion)?|Alt)\b/i,bT?b("keys.option"):b("keys.alt")).replace(/\bShift\b/i,b("keys.shift")).replace(/\b(Enter|Return)\b/i,b("keys.enter")).replace(/\b(Ctrl|Cmd|Command|CtrlOrCmd)\b/gi,bT?b("keys.cmd"):b("keys.ctrl")).replace(/\b(Esc(?:ape)?)\b/i,b("keys.escape")).replace(/\b(Space(?:bar)?)\b/i,b("keys.spacebar")).replace(/\b(Del(?:ete)?)\b/i,b("keys.delete"));import{jsx as wu}from"react/jsx-runtime";var l0=X({name:"sendBackward",label:"labels.sendBackward",keywords:["move down","zindex","layer"],icon:Hb,trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:l8(e,t,n.scene),appState:t,captureUpdate:yu.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[Al.CTRL_OR_CMD]&&!e.shiftKey&&e.code===Ll.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>wu("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${b("labels.sendBackward")} \u2014 ${V("CtrlOrCmd+[")}`,children:Hb})}),c0=X({name:"bringForward",label:"labels.bringForward",keywords:["move up","zindex","layer"],icon:Ub,trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:c8(e,t,n.scene),appState:t,captureUpdate:yu.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[Al.CTRL_OR_CMD]&&!e.shiftKey&&e.code===Ll.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>wu("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${b("labels.bringForward")} \u2014 ${V("CtrlOrCmd+]")}`,children:Ub})}),d0=X({name:"sendToBack",label:"labels.sendToBack",keywords:["move down","zindex","layer"],icon:$b,trackEvent:{category:"element"},perform:(e,t)=>({elements:d8(e,t),appState:t,captureUpdate:yu.IMMEDIATELY}),keyTest:e=>xu?e[Al.CTRL_OR_CMD]&&e.altKey&&e.code===Ll.BRACKET_LEFT:e[Al.CTRL_OR_CMD]&&e.shiftKey&&e.code===Ll.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>wu("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${b("labels.sendToBack")} \u2014 ${xu?V("CtrlOrCmd+Alt+["):V("CtrlOrCmd+Shift+[")}`,children:$b})}),m0=X({name:"bringToFront",label:"labels.bringToFront",keywords:["move up","zindex","layer"],icon:Gb,trackEvent:{category:"element"},perform:(e,t)=>({elements:m8(e,t),appState:t,captureUpdate:yu.IMMEDIATELY}),keyTest:e=>xu?e[Al.CTRL_OR_CMD]&&e.altKey&&e.code===Ll.BRACKET_RIGHT:e[Al.CTRL_OR_CMD]&&e.shiftKey&&e.code===Ll.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>wu("button",{type:"button",className:"zIndexButton",onClick:o=>e(null),title:`${b("labels.bringToFront")} \u2014 ${xu?V("CtrlOrCmd+Alt+]"):V("CtrlOrCmd+Shift+]")}`,children:Gb})});import{getNonDeletedElements as p8}from"@orangecatai/element";import{LinearElementEditor as u8}from"@orangecatai/element";import{isLinearElement as g8,isTextElement as h8}from"@orangecatai/element";import{arrayToMap as f8,KEYS as xT}from"@orangecatai/common";import{selectGroupsForSelectedElements as b8}from"@orangecatai/element";import{CaptureUpdateAction as x8}from"@orangecatai/element";var p0=X({name:"selectAll",label:"labels.selectAll",icon:WI,trackEvent:{category:"canvas"},viewMode:!1,perform:(e,t,o,n)=>{if(t.selectedLinearElement?.isEditing)return!1;let r=e.filter(a=>!a.isDeleted&&!(h8(a)&&a.containerId)&&!a.locked).reduce((a,i)=>(a[i.id]=!0,a),{});return{appState:{...t,...b8({editingGroupId:null,selectedElementIds:r},p8(e),t,n),selectedLinearElement:Object.keys(r).length===1&&g8(e[0])?new u8(e[0],f8(e)):null},captureUpdate:x8.IMMEDIATELY}},keyTest:e=>e[xT.CTRL_OR_CMD]&&e.key===xT.A});import{DEFAULT_GRID_SIZE as yT,KEYS as wT,MOBILE_ACTION_BUTTON_BG as y8,arrayToMap as vT}from"@orangecatai/common";import{getNonDeletedElements as ET}from"@orangecatai/element";import{LinearElementEditor as w8}from"@orangecatai/element";import{getSelectedElements as v8,getSelectionStateForElements as E8}from"@orangecatai/element";import{syncMovedIndices as I8}from"@orangecatai/element";import{duplicateElements as T8}from"@orangecatai/element";import{CaptureUpdateAction as IT}from"@orangecatai/element";import{jsx as k8}from"react/jsx-runtime";var u0=X({name:"duplicateSelection",label:"labels.duplicateSelection",icon:Sd,trackEvent:{category:"element"},perform:(e,t,o,n)=>{if(t.selectedElementsAreBeingDragged)return!1;if(t.selectedLinearElement?.isEditing)try{let i=w8.duplicateSelectedPoints(t,n.scene);return{elements:e,appState:i,captureUpdate:IT.IMMEDIATELY}}catch{return!1}let{duplicatedElements:r,elementsWithDuplicates:a}=T8({type:"in-place",elements:e,idsOfElementsToDuplicate:vT(v8(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),appState:t,randomizeSeed:!0,overrides:({origElement:i,origIdToDuplicateId:s})=>{let l=i.frameId&&s.get(i.frameId);return{x:i.x+yT/2,y:i.y+yT/2,frameId:l??i.frameId}}});if(n.props.onDuplicate&&a){let i=n.props.onDuplicate(a,e);i&&(a=i)}return{elements:I8(a,vT(r)),appState:{...t,...E8(r,ET(a),t)},captureUpdate:IT.IMMEDIATELY}},keyTest:e=>e[wT.CTRL_OR_CMD]&&e.key===wT.D,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=ho()==="mobile";return k8(be,{type:"button",icon:Sd,title:`${b("labels.duplicateSelection")} \u2014 ${V("CtrlOrCmd+D")}`,"aria-label":b("labels.duplicateSelection"),onClick:()=>o(null),disabled:!ft(ET(e),t),style:{...r&&t.openPopup!=="compactOtherProperties"?y8:{}}})}});import{pointFrom as C7}from"@orangecatai/math";import{useEffect as B0,useMemo as S7,useRef as F0,useState as M7}from"react";import{DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE as P7,DEFAULT_ELEMENT_BACKGROUND_PICKS as A7,DEFAULT_ELEMENT_STROKE_COLOR_PALETTE as L7,DEFAULT_ELEMENT_STROKE_PICKS as _7,ARROW_TYPE as Un,DEFAULT_FONT_FAMILY as D7,DEFAULT_FONT_SIZE as R7,FONT_FAMILY as N7,ROUNDNESS as Fu,STROKE_WIDTH as O0,VERTICAL_ALIGN as Nu,KEYS as zl,randomInteger as B7,arrayToMap as U0,getFontFamilyString as F7,getLineHeight as O7,isTransparent as z7,reduceToCommonValue as U7,invariant as H0,FONT_SIZES as Bu}from"@orangecatai/common";import{canBecomePolygon as H7,getNonDeletedElements as uk}from"@orangecatai/element";import{bindBindingElement as ck,calculateFixedPointForElbowArrowBinding as dk,updateBoundElements as G7}from"@orangecatai/element";import{LinearElementEditor as us}from"@orangecatai/element";import{newElementWith as io}from"@orangecatai/element";import{getBoundTextElement as ni,redrawTextBoundingBox as Xd}from"@orangecatai/element";import{isArrowElement as Ou,isBoundToContainer as $7,isElbowArrow as gk,isLinearElement as z0,isLineElement as mk,isTextElement as nn,isUsingAdaptiveRadius as V7}from"@orangecatai/element";import{hasStrokeColor as W7}from"@orangecatai/element";import{updateElbowArrowPoints as K7,CaptureUpdateAction as so,toggleLinePolygonState as Y7}from"@orangecatai/element";import{deriveStylesPanelMode as X7}from"@orangecatai/common";import{isDevEnv as C8}from"@orangecatai/common";var S8=new Set(["command_palette","export"]),Ne=(e,t,o,n)=>{try{if(typeof window>"u"||C.VITE_WORKER_ID||C.VITE_APP_ENABLE_TRACKING!=="true"||!S8.has(e)||C8())return;C.PROD||console.info("trackEvent",{category:e,action:t,label:o,value:n}),window.sa_event&&window.sa_event(t,{category:e,label:o,value:n})}catch(r){console.error("error during analytics",r)}};import L8 from"clsx";import M8 from"clsx";import{forwardRef as P8}from"react";import{jsx as A8}from"react/jsx-runtime";var _l=P8((e,t)=>{let{title:o,className:n,testId:r,active:a,standalone:i,icon:s,onClick:l}=e;return A8("button",{type:"button",ref:t,title:o,"data-testid":r,className:M8(n,{standalone:i,active:a}),onClick:l,style:e.style,children:s},o)});import{Fragment as D8,jsx as g0,jsxs as _8}from"react/jsx-runtime";var Bn=e=>g0(D8,{children:e.options.map(t=>e.type==="button"?g0(_l,{icon:t.icon,title:t.text,testId:t.testId,active:t.active??e.value===t.value,onClick:o=>e.onClick(t.value,o)},t.text):_8("label",{className:L8({active:e.value===t.value}),title:t.text,children:[g0("input",{type:"radio",name:e.group,onChange:()=>e.onChange(t.value),checked:e.value===t.value,"data-testid":t.testId}),t.icon]},t.text))});import{Popover as $T}from"radix-ui";import VT from"clsx";import{useRef as WT,useEffect as NN}from"react";import{COLOR_OUTLINE_CONTRAST_THRESHOLD as HT,COLOR_PALETTE as KT,isColorDark as GT,isWritableElement as BN}from"@orangecatai/common";import{jsx as R8}from"react/jsx-runtime";var vu=()=>R8("div",{style:{width:1,height:"1rem",backgroundColor:"var(--default-border-color)",margin:"0 auto"}});import{useEffect as z8,useRef as U8}from"react";import{createPortal as H8}from"react-dom";import{EVENT as Za,KEYS as G8,rgbToHex as $8}from"@orangecatai/common";import TT from"react";var h0=TT.createContext(null),Ze=()=>TT.useContext(h0);import{useState as N8,useLayoutEffect as kT}from"react";import{THEME as B8}from"@orangecatai/common";var Eu=e=>{let[t,o]=N8(null),n=qe(),{theme:r}=Ze(),{container:a}=St();return kT(()=>{t&&(t.className="",t.classList.add("excalidraw",...e?.className?.split(/\s+/)||[]),t.classList.toggle("excalidraw--mobile",n.formFactor==="phone"),t.classList.toggle("theme--dark",r===B8.DARK))},[t,r,n.formFactor,e?.className]),kT(()=>{let i=e?.parentSelector?a?.querySelector(e.parentSelector):document.body;if(!i)return;let s=document.createElement("div");return i.appendChild(s),o(s),()=>{i.removeChild(s)}},[a,e?.parentSelector]),t};import{useEffect as F8}from"react";import{EVENT as Iu}from"@orangecatai/common";function Dl(e,t,o){F8(()=>{function n(r){let a=r;if(!e.current)return;let i=o?.(a,e.current);if(i===!0)return;if(i===!1)return t(a);e.current.contains(a.target)||!document.documentElement.contains(a.target)||a.target.closest("[data-radix-portal]")||a.target===document.documentElement&&document.body.style.pointerEvents==="none"||a.target.closest("[data-prevent-outside-click]")||t(a)}return document.addEventListener(Iu.POINTER_DOWN,n),document.addEventListener(Iu.TOUCH_START,n),()=>{document.removeEventListener(Iu.POINTER_DOWN,n),document.removeEventListener(Iu.TOUCH_START,n)}},[e,t,o])}import{useRef as O8}from"react";var ja=e=>{let t=O8(e);return Object.assign(t.current,e),t.current};import{jsx as V8}from"react/jsx-runtime";var qa=je(null),CT=({onCancel:e,onChange:t,onSelect:o,colorPickerType:n})=>{let r=Eu({className:"excalidraw-eye-dropper-backdrop",parentSelector:".excalidraw-eye-dropper-container"}),a=Ze(),i=Fn(),s=Mt(),l=Me(i,a),c=ja({app:s,onCancel:e,onChange:t,onSelect:o,selectedElements:l}),{container:m}=St();z8(()=>{let d=p.current;if(!d||!s.canvas||!r)return;let u=!1,h=s.canvas.getContext("2d"),g=({clientX:k,clientY:S})=>{let T=h.getImageData((k-a.offsetLeft)*window.devicePixelRatio,(S-a.offsetTop)*window.devicePixelRatio,1,1).data;return $8(T[0],T[1],T[2])},f=({clientX:k,clientY:S,altKey:T})=>{d.style.top=`${S+20}px`,d.style.left=`${k+20}px`;let A=g({clientX:k,clientY:S});u&&c.onChange(n,A,c.selectedElements,{altKey:T}),d.style.background=A},w=()=>{c.onCancel()},y=(k,S)=>{c.onSelect(k,S)},v=k=>{u=!0,k.stopImmediatePropagation()},E=k=>{u=!1,m?.focus(),k.stopImmediatePropagation(),k.preventDefault(),y(g(k),k)},I=k=>{k.key===G8.ESCAPE&&(k.preventDefault(),k.stopImmediatePropagation(),w())};return r.tabIndex=-1,r.focus(),f({clientX:c.app.lastViewportPosition.x,clientY:c.app.lastViewportPosition.y,altKey:!1}),r.addEventListener(Za.KEYDOWN,I),r.addEventListener(Za.POINTER_DOWN,v),r.addEventListener(Za.POINTER_UP,E),window.addEventListener("pointermove",f,{passive:!0}),window.addEventListener(Za.BLUR,w),()=>{u=!1,r.removeEventListener(Za.KEYDOWN,I),r.removeEventListener(Za.POINTER_DOWN,v),r.removeEventListener(Za.POINTER_UP,E),window.removeEventListener("pointermove",f),window.removeEventListener(Za.BLUR,w)}},[c,s.canvas,r,n,m,a.offsetLeft,a.offsetTop]);let p=U8(null);return Dl(p,()=>{e()},d=>!!d.target.closest(".excalidraw-eye-dropper-trigger, .excalidraw-eye-dropper-backdrop")),r?H8(V8("div",{ref:p,className:"excalidraw-eye-dropper-preview"}),r):null};import{Popover as f0}from"radix-ui";import X8 from"clsx";import j8 from"react";import{isInteractive as Z8}from"@orangecatai/common";import W8 from"react";import K8 from"clsx";import{jsx as Y8}from"react/jsx-runtime";var $t=W8.forwardRef(({children:e,padding:t,className:o,style:n},r)=>Y8("div",{className:K8("Island",o),style:{"--padding":t,...n},ref:r,children:e}));import{jsx as b0,jsxs as q8}from"react/jsx-runtime";var ca=j8.forwardRef(({className:e,container:t,children:o,style:n,onClose:r,onKeyDown:a,onFocusOutside:i,onPointerLeave:s,onPointerDownOutside:l,preventAutoFocusOnTouch:c=!1},m)=>{let p=qe(),d=p.formFactor==="phone"&&!p.isLandscape;return b0(f0.Portal,{container:t,children:q8(f0.Content,{ref:m,className:X8("focus-visible-none",e),"data-prevent-outside-click":!0,side:d?"bottom":"right",align:d?"center":"start",alignOffset:-16,sideOffset:20,collisionBoundary:t??void 0,style:{zIndex:"var(--zIndex-ui-styles-popup)",marginLeft:p.formFactor==="phone"?"0.5rem":void 0},onPointerLeave:s,onKeyDown:a,onFocusOutside:i,onPointerDownOutside:l,onOpenAutoFocus:u=>{c&&p.isTouchScreen&&u.preventDefault()},onCloseAutoFocus:u=>{u.stopPropagation(),u.preventDefault(),t&&!Z8(document.activeElement)&&t.focus(),r()},children:[b0($t,{padding:3,style:n,children:o}),b0(f0.Arrow,{width:20,height:10,style:{fill:"var(--popup-bg-color)",filter:"drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)"}})]})})});import{useState as J8,useCallback as x0}from"react";var Tu=()=>document.querySelector(".excalidraw-wysiwyg"),ku=()=>{let e=Tu();return e?{start:e.selectionStart,end:e.selectionEnd}:null},Fd=e=>{setTimeout(()=>{let t=Tu();t&&(t.focus(),e&&(t.selectionStart=e.start,t.selectionEnd=e.end))},0)},Od=(e,t,o,n)=>{t&&n&&n();let r=t&&o?ku():null;e(),t&&o&&Fd(r)},ST=()=>{let[e,t]=J8(null),o=x0(()=>{let a=ku();t(a)},[]),n=x0(()=>{setTimeout(()=>{let a=Tu();a&&(a.focus(),e&&(a.selectionStart=e.start,a.selectionEnd=e.end,t(null)))},0)},[e]),r=x0(()=>{t(null)},[]);return{saveCaretPosition:o,restoreCaretPosition:n,clearSavedPosition:r,hasSavedPosition:!!e}},MT=(e=100)=>{let t=Tu();if(t){let o=t.onblur;t.onblur=null,setTimeout(()=>{t.onblur=o},e)}};import eN from"clsx";import{useCallback as tN,useEffect as w0,useRef as AT,useState as oN}from"react";import{KEYS as v0,normalizeInputColor as nN}from"@orangecatai/common";import{MAX_CUSTOM_COLORS_USED_IN_CANVAS as Q8}from"@orangecatai/common";var Ja=({palette:e,color:t})=>{if(!t)return null;for(let[o,n]of Object.entries(e))if(Array.isArray(n)){let r=n.indexOf(t);if(r>-1)return{colorName:o,shade:r}}else if(n===t)return{colorName:o,shade:null};return null},zd=[["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),y0=({color:e,palette:t})=>!Object.values(t).flat().includes(e),PT=(e,t,o)=>{let n={elementBackground:"backgroundColor",elementStroke:"strokeColor"},r=e.filter(i=>{if(i.isDeleted)return!1;let s=i[n[t]];return y0({color:s,palette:o})}),a=new Map;return r.forEach(i=>{let s=i[n[t]];a.has(s)?a.set(s,a.get(s)+1):a.set(s,1)}),[...a.entries()].sort((i,s)=>s[1]-i[1]).map(i=>i[0]).slice(0,Q8)},On=je(null);import{Fragment as rN,jsx as Cu,jsxs as LT}from"react/jsx-runtime";var _T=({color:e,onChange:t,label:o,colorPickerType:n,placeholder:r})=>{let a=qe(),[i,s]=oN(e),[l,c]=ve(On);w0(()=>{s(e)},[e]);let m=tN(g=>{let f=g.toLowerCase(),w=nN(f);w&&t(w),s(f)},[t]),p=AT(null),d=AT(null);w0(()=>{p.current&&p.current.focus()},[l]);let[u,h]=ve(qa);return w0(()=>()=>{h(null)},[h]),LT("div",{className:"color-picker__input-label",children:[Cu("div",{className:"color-picker__input-hash",children:"#"}),Cu("input",{ref:l==="hex"?p:void 0,style:{border:0,padding:0},spellCheck:!1,className:"color-picker-input","aria-label":o,onChange:g=>{m(g.target.value)},value:(i||"").replace(/^#/,""),onBlur:()=>{s(e)},tabIndex:-1,onFocus:()=>c("hex"),onKeyDown:g=>{g.key!==v0.TAB&&(g.key===v0.ESCAPE&&d.current?.focus(),g.stopPropagation())},placeholder:r}),a.formFactor!=="phone"&&LT(rN,{children:[Cu("div",{style:{width:"1px",height:"1.25rem",backgroundColor:"var(--default-border-color)"}}),Cu("div",{ref:d,className:eN("excalidraw-eye-dropper-trigger",{selected:u}),onClick:()=>h(g=>g?null:{keepOpenOnAlt:!1,onSelect:f=>t(f),colorPickerType:n}),title:`${b("labels.eyeDropper")} \u2014 ${v0.I.toLocaleUpperCase()} or ${V("Alt")} `,children:RI})]})]})};import k0,{useEffect as C0,useImperativeHandle as TN,useState as kN}from"react";import{EVENT as OT}from"@orangecatai/common";import{DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX as CN,DEFAULT_ELEMENT_STROKE_COLOR_INDEX as SN,KEYS as MN}from"@orangecatai/common";import lN from"clsx";import{useEffect as cN,useRef as dN}from"react";import{isColorDark as aN}from"@orangecatai/common";import{jsxs as sN}from"react/jsx-runtime";var iN=({color:e,keyLabel:t,isShade:o=!1})=>sN("div",{className:"color-picker__button__hotkey-label",style:{color:aN(e)?"#fff":"#000"},children:[o&&"\u21E7",t]}),Rl=iN;import{jsx as E0,jsxs as mN}from"react/jsx-runtime";var DT=({colors:e,color:t,onChange:o,label:n})=>{let[r,a]=ve(On),i=dN(null);return cN(()=>{i.current&&i.current.focus()},[t,r]),E0("div",{className:"color-picker-content--default",children:e.map((s,l)=>mN("button",{ref:t===s?i:void 0,tabIndex:-1,type:"button",className:lN("color-picker__button color-picker__button--large has-outline",{active:t===s,"is-transparent":s==="transparent"||!s}),onClick:()=>{o(s),a("custom")},title:s,"aria-label":n,style:{"--swatch-color":s},children:[E0("div",{className:"color-picker__button-outline"}),E0(Rl,{color:s,keyLabel:l+1})]},l))})};import pN from"clsx";import{useEffect as uN,useRef as gN}from"react";import{jsx as I0,jsxs as fN}from"react/jsx-runtime";var hN=({palette:e,color:t,onChange:o,activeShade:n,showHotKey:r=!0})=>{let a=Ja({color:t,palette:e}),[i,s]=ve(On),l=gN(null);return uN(()=>{l.current&&i==="baseColors"&&l.current.focus()},[a?.colorName,i]),I0("div",{className:"color-picker-content--default",children:Object.entries(e).map(([c,m],p)=>{let d=(Array.isArray(m)?m[n]:m)||"transparent",u=zd[p],h=b(`colors.${c.replace(/\d+/,"")}`,null,"");return fN("button",{ref:a?.colorName===c?l:void 0,tabIndex:-1,type:"button",className:pN("color-picker__button color-picker__button--large has-outline",{active:a?.colorName===c,"is-transparent":d==="transparent"||!d}),onClick:()=>{o(d),s("baseColors")},title:`${h}${d.startsWith("#")?` ${d}`:""} \u2014 ${u}`,"aria-label":`${h} \u2014 ${u}`,style:d?{"--swatch-color":d}:void 0,"data-testid":`color-${c}`,children:[I0("div",{className:"color-picker__button-outline"}),r&&I0(Rl,{color:d,keyLabel:u})]},c)})})},RT=hN;import{jsx as xN}from"react/jsx-runtime";var bN=({children:e})=>xN("div",{className:"color-picker__heading",children:e}),Nl=bN;import yN from"clsx";import{useEffect as wN,useRef as vN}from"react";import{jsx as Ud,jsxs as NT}from"react/jsx-runtime";var BT=({color:e,onChange:t,palette:o,showHotKey:n})=>{let r=Ja({color:e||"transparent",palette:o}),[a,i]=ve(On),s=vN(null);if(wN(()=>{s.current&&a==="shades"&&s.current.focus()},[r,a]),r){let{colorName:l,shade:c}=r,m=o[l];if(Array.isArray(m))return Ud("div",{className:"color-picker-content--default shades",children:m.map((p,d)=>NT("button",{ref:d===c&&a==="shades"?s:void 0,tabIndex:-1,type:"button",className:yN("color-picker__button color-picker__button--large has-outline",{active:d===c}),"aria-label":"Shade",title:`${l} - ${d+1}`,style:p?{"--swatch-color":p}:void 0,onClick:()=>{t(p),i("shades")},children:[Ud("div",{className:"color-picker__button-outline"}),n&&Ud(Rl,{color:p,keyLabel:d+1,isShade:!0})]},d))})}return NT("div",{className:"color-picker-content--default",style:{position:"relative"},tabIndex:-1,children:[Ud("button",{type:"button",tabIndex:-1,className:"color-picker__button color-picker__button--large color-picker__button--no-focus-visible"}),Ud("div",{tabIndex:-1,style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:"0.75rem"},children:b("colorPicker.noShades")})]})};import{COLORS_PER_ROW as Bl,COLOR_PALETTE as EN,KEYS as Hd}from"@orangecatai/common";var T0=(e,t,o)=>{let n=Math.ceil(o/Bl);switch(t=t??-1,e){case"ArrowLeft":{let r=t-1;return r<0?o-1:r}case"ArrowRight":return(t+1)%o;case"ArrowDown":{let r=t+Bl;return r>=o?t%Bl:r}case"ArrowUp":{let r=t-Bl,a=r<0?Bl*n+r:r;return a>=o?void 0:a}}},IN=({e,colorObj:t,onChange:o,palette:n,customColors:r,setActiveColorPickerSection:a,activeShade:i})=>{if(t?.shade!=null&&["Digit1","Digit2","Digit3","Digit4","Digit5"].includes(e.code)&&e.shiftKey){let s=Number(e.code.slice(-1))-1;return o(n[t.colorName][s]),a("shades"),!0}if(["1","2","3","4","5"].includes(e.key)&&r[Number(e.key)-1])return o(r[Number(e.key)-1]),a("custom"),!0;if(zd.includes(e.key)){let s=zd.indexOf(e.key),l=Object.keys(n)[s],c=n[l],m=Array.isArray(c)?c[i]:c;return o(m),a("baseColors"),!0}return!1},FT=({event:e,activeColorPickerSection:t,palette:o,color:n,onChange:r,customColors:a,setActiveColorPickerSection:i,updateData:s,activeShade:l,onEyeDropperToggle:c,onEscape:m})=>{if(e[Hd.CTRL_OR_CMD])return!1;if(e.key===Hd.ESCAPE)return m(e),!0;if(e.key===Hd.ALT)return c(!0),!0;if(e.key===Hd.I)return c(),!0;let p=Ja({color:n,palette:o});if(e.key===Hd.TAB){let d={custom:!!a.length,baseColors:!0,shades:p?.shade!=null,hex:!0},u=Object.entries(d).reduce((y,[v,E])=>(E&&y.push(v),y),[]),h=u.indexOf(t),g=e.shiftKey?-1:1,f=h+g>u.length-1?0:h+g<0?u.length-1:h+g,w=u[f];return w&&i(w),w==="custom"?r(a[0]):w==="baseColors"&&(Object.entries(o).find(([v,E])=>Array.isArray(E)?E.includes(n):E===n?v:null)||r(EN.black)),e.preventDefault(),e.stopPropagation(),!0}if(IN({e,colorObj:p,onChange:r,palette:o,customColors:a,setActiveColorPickerSection:i,activeShade:l}))return!0;if(t==="shades"&&p){let{shade:d}=p,u=T0(e.key,d,Bl);if(u!==void 0)return r(o[p.colorName][u]),!0}if(t==="baseColors"&&p){let{colorName:d}=p,u=Object.keys(o),h=u.indexOf(d),g=T0(e.key,h,u.length);if(g!==void 0){let f=u[g],w=o[f];return r(Array.isArray(w)?w[l]:w),!0}}if(t==="custom"){let d=n!=null?a.indexOf(n):0,u=T0(e.key,d,a.length);if(u!==void 0){let h=a[u];return r(h),!0}}return!1};import{jsx as Qa,jsxs as Su}from"react/jsx-runtime";var zT=k0.forwardRef(({color:e,onChange:t,type:o,elements:n,palette:r,updateData:a,children:i,showTitle:s,onEyeDropperToggle:l,onEscape:c,showHotKey:m=!0},p)=>{let d=s?o==="elementStroke"?b("labels.stroke"):o==="elementBackground"?b("labels.background"):null:null,[u]=k0.useState(()=>o==="canvasBackground"?[]:PT(n,o,r)),[h,g]=ve(On),f=Ja({color:e,palette:r});C0(()=>{if(!h){let E=!!e&&y0({color:e,palette:r}),I=E&&!u.includes(e);g(I?null:E?"custom":f?.shade!=null?"shades":"baseColors")}},[h,e,r,g,f,u]);let[w,y]=kN(f?.shade??(o==="elementBackground"?CN:SN));C0(()=>{f?.shade!=null&&y(f.shade);let E=I=>{I.key===MN.ALT&&l(!1)};return document.addEventListener(OT.KEYUP,E,{capture:!0}),()=>{document.removeEventListener(OT.KEYUP,E,{capture:!0})}},[f,l]);let v=k0.useRef(null);return TN(p,()=>v.current),C0(()=>{v?.current?.focus()},[]),Qa("div",{role:"dialog","aria-modal":"true","aria-label":b("labels.colorPicker"),children:Su("div",{ref:v,onKeyDown:E=>{FT({event:E,activeColorPickerSection:h,palette:r,color:e,onChange:t,onEyeDropperToggle:l,customColors:u,setActiveColorPickerSection:g,updateData:a,activeShade:w,onEscape:c})&&(E.preventDefault(),E.stopPropagation())},className:"color-picker-content properties-content",tabIndex:-1,children:[d&&Qa("div",{className:"color-picker__title",children:d}),!!u.length&&Su("div",{children:[Qa(Nl,{children:b("colorPicker.mostUsedCustomColors")}),Qa(DT,{colors:u,color:e,label:b("colorPicker.mostUsedCustomColors"),onChange:t})]}),Su("div",{children:[Qa(Nl,{children:b("colorPicker.colors")}),Qa(RT,{color:e,palette:r,onChange:t,activeShade:w,showHotKey:m})]}),Su("div",{children:[Qa(Nl,{children:b("colorPicker.shades")}),Qa(BT,{color:e,onChange:t,palette:r,showHotKey:m})]}),i]})})});import PN from"clsx";import{COLOR_OUTLINE_CONTRAST_THRESHOLD as AN,DEFAULT_CANVAS_BACKGROUND_PICKS as LN,DEFAULT_ELEMENT_BACKGROUND_PICKS as _N,DEFAULT_ELEMENT_STROKE_PICKS as DN,isColorDark as RN}from"@orangecatai/common";import{jsx as S0}from"react/jsx-runtime";var UT=({onChange:e,type:t,activeColor:o,topPicks:n})=>{let r;return t==="elementStroke"&&(r=DN),t==="elementBackground"&&(r=_N),t==="canvasBackground"&&(r=LN),n&&(r=n),r?S0("div",{className:"color-picker__top-picks",children:r.map(a=>S0("button",{className:PN("color-picker__button",{active:a===o,"is-transparent":a==="transparent"||!a,"has-outline":!RN(a,AN)}),style:{"--swatch-color":a},type:"button",title:a,onClick:()=>e(a),"data-testid":`color-top-pick-${a}`,children:S0("div",{className:"color-picker__button-outline"})},a))}):(console.error("Invalid type for TopPicks"),null)};import{jsx as zn,jsxs as Mu}from"react/jsx-runtime";var FN=({type:e,color:t,onChange:o,label:n,elements:r,palette:a=KT,updateData:i,getOpenPopup:s,appState:l})=>{let{container:c}=St(),m=ho(),p=m!=="full",d=m==="mobile",[,u]=ve(On),[h,g]=ve(qa),f=Mu("div",{children:[zn(Nl,{children:b("colorPicker.hexCode")}),zn(_T,{color:t||"",label:n,onChange:v=>{o(v)},colorPickerType:e,placeholder:b("colorPicker.color")})]}),w=WT(null),y=()=>{w.current?.focus()};return zn(ca,{container:c,style:{maxWidth:"13rem"},preventAutoFocusOnTouch:!!l.editingTextElement,onFocusOutside:v=>{BN(v.target)||y(),v.preventDefault()},onPointerDownOutside:v=>{h&&v.preventDefault()},onClose:()=>{s()===e&&i({openPopup:null}),u(null),l.editingTextElement&&setTimeout(()=>{let v=document.querySelector(".excalidraw-wysiwyg");v&&v.focus()},0)},children:a?zn(zT,{ref:w,palette:a,color:t,onChange:v=>{let E=l.editingTextElement?ku():null;o(v),l.editingTextElement&&E&&Fd(E)},onEyeDropperToggle:v=>{g(E=>v?(E=E||{keepOpenOnAlt:!0,onSelect:o,colorPickerType:e},E.keepOpenOnAlt=!0,E):v===!1||E?null:{keepOpenOnAlt:!1,onSelect:o,colorPickerType:e})},onEscape:v=>{h?g(null):i({openPopup:null})},type:e,elements:r,updateData:i,showTitle:p,showHotKey:!d,children:f}):f})},ON=({label:e,color:t,type:o,mode:n="background",onToggle:r,editingTextElement:a})=>{let i=ho(),s=i!=="full",l=i==="mobile",c=m=>{m.preventDefault(),m.stopPropagation(),a&&MT(),r()};return Mu($T.Trigger,{type:"button",className:VT("color-picker__button active-color properties-trigger",{"is-transparent":!t||t==="transparent","has-outline":!t||!GT(t,HT),"compact-sizing":s,"mobile-border":l}),"aria-label":e,style:t?{"--swatch-color":t}:void 0,title:o==="elementStroke"?b("labels.showStroke"):b("labels.showBackground"),"data-openpopup":o,onClick:c,children:[zn("div",{className:"color-picker__button-outline",children:!t&&O2}),s&&t&&n==="stroke"&&zn("div",{className:"color-picker__button-background",children:zn("span",{style:{color:t&&GT(t,HT)?"#fff":"#111"},children:iT})})]})},Gd=({type:e,color:t,onChange:o,label:n,elements:r,palette:a=KT,topPicks:i,updateData:s,appState:l})=>{let c=WT(l.openPopup);NN(()=>{c.current=l.openPopup},[l.openPopup]);let p=ho()!=="full";return zn("div",{children:Mu("div",{role:"dialog","aria-modal":"true",className:VT("color-picker-container",{"color-picker-container--no-top-picks":p}),children:[!p&&zn(UT,{activeColor:t,onChange:o,type:e,topPicks:i}),!p&&zn(vu,{}),Mu($T.Root,{open:l.openPopup===e,onOpenChange:d=>{d&&s({openPopup:e})},children:[zn(ON,{color:t,label:n,type:e,mode:e==="elementStroke"?"stroke":"background",editingTextElement:!!l.editingTextElement,onToggle:()=>{l.openPopup===e?s({openPopup:null}):l.openPopup?s({openPopup:e}):s({openPopup:e})}}),l.openPopup===e&&zn(FN,{type:e,color:t,onChange:o,label:n,elements:r,palette:a,updateData:s,getOpenPopup:()=>c.current,appState:l})]})]})})};import{Popover as p7}from"radix-ui";import u7 from"clsx";import g7,{useCallback as h7,useMemo as f7}from"react";import{FONT_FAMILY as L0}from"@orangecatai/common";import o7,{useMemo as oi,useState as n7,useRef as ZT,useEffect as qT,useCallback as JT,useSyncExternalStore as r7}from"react";import{arrayToList as a7,debounce as i7,FONT_FAMILY as ms,getFontFamilyString as s7}from"@orangecatai/common";import zN from"clsx";import UN from"react";import{jsx as HN,jsxs as GN}from"react/jsx-runtime";var Pu=UN.forwardRef(({className:e,placeholder:t,onChange:o},n)=>GN("div",{className:zN("QuickSearch__wrapper",e),children:[fn,HN("input",{ref:n,className:"QuickSearch__input",type:"text",placeholder:t,onChange:r=>o(r.target.value.trim().toLowerCase())})]}));import $N from"clsx";import{Children as VN}from"react";import{jsx as YT}from"react/jsx-runtime";var Au=({className:e,placeholder:t,children:o})=>{let n=!VN.count(o);return YT("div",{className:$N("ScrollableList__wrapper",e),role:"menu",children:n?YT("div",{className:"empty",children:t}):o})};import{jsx as WN,jsxs as KN}from"react/jsx-runtime";var XT=({children:e,className:t="",style:o,title:n})=>KN("div",{className:`dropdown-menu-group ${t}`,style:o,children:[n&&WN("p",{className:"dropdown-menu-group-title",children:n}),e]}),$d=XT;XT.displayName="DropdownMenuGroup";import{THEME as e7}from"@orangecatai/common";import{DropdownMenu as t7}from"radix-ui";import YN,{useContext as XN}from"react";import{composeEventHandlers as jN}from"@orangecatai/common";var M0=YN.createContext({}),ei=(e="",t=!1,o=!1)=>`dropdown-menu-item dropdown-menu-item-base ${e} ${t?"dropdown-menu-item--selected":""} ${o?"dropdown-menu-item--hovered":""}`.trim(),Lu=e=>{let t=XN(M0);return jN(e,o=>{t.onSelect?.(o)})};import{jsx as ZN}from"react/jsx-runtime";var Vd=({children:e,...t})=>ZN("span",{...t,style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",...t.style},children:e});import{Fragment as JN,jsx as Wd,jsxs as QN}from"react/jsx-runtime";var qN=({textStyle:e,icon:t,shortcut:o,children:n,badge:r})=>{let a=qe();return QN(JN,{children:[t&&Wd("div",{className:"dropdown-menu-item__icon",children:t}),Wd("div",{style:e,className:"dropdown-menu-item__text",children:Wd(Vd,{children:n})}),r&&Wd("div",{className:"dropdown-menu-item__badge",children:r}),o&&a.formFactor!=="phone"&&Wd("div",{className:"dropdown-menu-item__shortcut",children:o})]})},ti=qN;import{jsx as _u}from"react/jsx-runtime";var P0=({icon:e,badge:t,value:o,children:n,shortcut:r,className:a,selected:i,onSelect:s,...l})=>{let c=Lu(s);return _u(t7.Item,{className:"radix-menu-item",onSelect:c,asChild:!0,children:_u("button",{...l,value:o,className:ei(a,i),title:l.title??l["aria-label"],children:_u(ti,{icon:e,shortcut:r,badge:t,children:n})})})};P0.displayName="DropdownMenuItem";var Fl={GREEN:"green",RED:"red",BLUE:"blue"},Du=({type:e=Fl.BLUE,children:t})=>{let{theme:o}=on(),n={display:"inline-flex",marginLeft:"auto",padding:"2px 4px",borderRadius:6,fontSize:9,fontFamily:"Cascadia, monospace",border:o===e7.LIGHT?"1.5px solid white":"none"};switch(e){case Fl.GREEN:Object.assign(n,{backgroundColor:"var(--background-color-badge)",color:"var(--color-badge)"});break;case Fl.RED:Object.assign(n,{backgroundColor:"pink",color:"darkred"});break;case Fl.BLUE:default:Object.assign(n,{background:"var(--color-promo)",color:"var(--color-surface-lowest)"})}return _u("div",{className:"DropDownMenuItemBadge",style:n,children:t})};Du.displayName="DropdownMenuItemBadge";P0.Badge=Du;var No=P0;import{KEYS as Ol}from"@orangecatai/common";var jT=({event:e,inputRef:t,hoveredFont:o,filteredFonts:n,onClose:r,onSelect:a,onHover:i})=>{if(!e[Ol.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===Ol.F)return t.current?.focus(),!0;if(e.key===Ol.ESCAPE)return r(),!0;if(e.key===Ol.ENTER)return o?.value&&a(o.value),!0;if(e.key===Ol.ARROW_DOWN)return o?.next?i(o.next.value):n[0]?.value&&i(n[0].value),!0;if(e.key===Ol.ARROW_UP)return o?.prev?i(o.prev.value):n[n.length-1]?.value&&i(n[n.length-1].value),!0};import{jsx as da,jsxs as c7}from"react/jsx-runtime";var l7=e=>{switch(e){case ms.Excalifont:case ms.Virgil:return Mr;case ms.Nunito:case ms.Helvetica:return Ld;case ms["Lilita One"]:return II;case ms["Comic Shanns"]:case ms.Cascadia:return su;default:return Ld}},QT=o7.memo(({selectedFontFamily:e,hoveredFontFamily:t,onSelect:o,onHover:n,onLeave:r,onOpen:a,onClose:i})=>{let{container:s}=St(),l=Mt(),{fonts:c}=l,{showDeprecatedFonts:m}=_r(),p=ho(),[d,u]=n7(""),h=ZT(null),g=r7(Rn.subscribeToCustomFonts,Rn.getCustomFontVersion),f=oi(()=>Array.from(Rn.registered.entries()).filter(([P,{metadata:F}])=>!F.private&&!F.fallback).map(([P,{metadata:F,fontFaces:U}])=>{let B={value:P,icon:l7(P),text:U[0]?.fontFace?.family??"Unknown"};return F.deprecated&&Object.assign(B,{deprecated:F.deprecated,badge:{type:Fl.RED,placeholder:b("fontList.badge.old")}}),B}).sort((P,F)=>P.text.toLowerCase()>F.text.toLowerCase()?1:-1),[g]),w=oi(()=>new Set(c.getSceneFamilies()),[e]),y=oi(()=>f.filter(P=>w.has(P.value)),[f,w]),v=oi(()=>f.filter(P=>!w.has(P.value)&&(m||!P.deprecated)),[f,w,m]),E=oi(()=>a7([...y,...v].filter(P=>P.text?.toLowerCase().includes(d))),[y,v,d]),I=oi(()=>{let P;return t?P=E.find(F=>F.value===t):e&&(P=E.find(F=>F.value===e)),!P&&d&&(E[0]?.value?n(E[0].value):r()),P},[t,e,d,E,n,r]),k=JT(P=>{let F=null;if(l.state.editingTextElement){let U=document.querySelector(".excalidraw-wysiwyg");U&&(F={start:U.selectionStart,end:U.selectionEnd})}o(P),l.state.editingTextElement&&F&&setTimeout(()=>{let U=document.querySelector(".excalidraw-wysiwyg");U&&F&&(U.focus(),U.selectionStart=F.start,U.selectionEnd=F.end)},0)},[o,l.state.editingTextElement]),S=JT(P=>{jT({event:P,inputRef:h,hoveredFont:I,filteredFonts:E,onSelect:k,onHover:n,onClose:i})&&(P.preventDefault(),P.stopPropagation())},[I,E,k,n,i]);qT(()=>(a(),()=>{i()}),[]);let T=oi(()=>E.filter(P=>w.has(P.value)),[E,w]),A=oi(()=>E.filter(P=>!w.has(P.value)),[E,w]),R=({font:P,order:F})=>{let U=ZT(null),B=P.value===I?.value,G=P.value===e;return qT(()=>{B&&(F===0?U.current?.scrollIntoView?.({block:"end"}):U.current?.scrollIntoView?.({block:"nearest"}))},[B,F]),da("button",{ref:U,type:"button",value:P.value,className:ei("",G,B),title:P.text,tabIndex:G?0:-1,onClick:_=>{k(Number(_.currentTarget.value))},onMouseMove:()=>{I?.value!==P.value&&n(P.value)},children:da(ti,{icon:P.icon,badge:P.badge&&da(Du,{type:P.badge.type,children:P.badge.placeholder}),textStyle:{fontFamily:s7({fontFamily:P.value})},children:P.text})})},M=[];return T.length&&M.push(da($d,{title:b("fontList.sceneFonts"),children:T.map((P,F)=>da(R,{font:P,order:F},P.value))},"group_1")),A.length&&M.push(da($d,{title:b("fontList.availableFonts"),children:A.map((P,F)=>da(R,{font:P,order:F+T.length},P.value))},"group_2")),c7(ca,{className:"properties-content",container:s,style:{width:"15rem"},onClose:()=>{i(),l.state.editingTextElement&&setTimeout(()=>{let P=document.querySelector(".excalidraw-wysiwyg");P&&P.focus()},0)},onPointerLeave:r,onKeyDown:S,preventAutoFocusOnTouch:!!l.state.editingTextElement,children:[p==="full"&&da(Pu,{ref:h,placeholder:b("quickSearch.placeholder"),onChange:i7(u,20)}),da(Au,{className:"dropdown-menu fonts manual-hover",placeholder:b("fontList.empty"),children:M.length?M:null})]})},(e,t)=>e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily);import{Popover as d7}from"radix-ui";import{MOBILE_ACTION_BUTTON_BG as m7}from"@orangecatai/common";import{jsx as A0}from"react/jsx-runtime";var ek=({selectedFontFamily:e,isOpened:t=!1,compactMode:o=!1})=>{let n=Je(),r=o?{...m7,width:"2rem",height:"2rem"}:{};return A0(d7.Trigger,{asChild:!0,children:A0("div",{"data-openpopup":"fontFamily",className:"properties-trigger",children:A0(_l,{standalone:!0,icon:Pr,title:b("labels.showFonts"),className:"properties-trigger",testId:"font-family-show-fonts",active:t,onClick:()=>{n(a=>({openPopup:a.openPopup==="fontFamily"?null:a.openPopup}))},style:{border:"none",...r}})})})};import{jsx as Kd,jsxs as tk}from"react/jsx-runtime";var ok=[{value:L0.Excalifont,icon:Mr,text:b("labels.handDrawn"),testId:"font-family-hand-drawn"},{value:L0.Nunito,icon:Ld,text:b("labels.normal"),testId:"font-family-normal"},{value:L0["Comic Shanns"],icon:su,text:b("labels.code"),testId:"font-family-code"}],Zpe=new Set(ok.map(e=>e.value));var nk=g7.memo(({isOpened:e,selectedFontFamily:t,hoveredFontFamily:o,onSelect:n,onHover:r,onLeave:a,onPopupChange:i,compactMode:s=!1})=>{let l=f7(()=>ok,[]),c=h7(m=>{m&&n(m)},[n]);return tk("div",{role:"dialog","aria-modal":"true",className:u7("FontPicker__container",{"FontPicker__container--compact":s}),children:[!s&&Kd("div",{className:"buttonList",children:Kd(Bn,{type:"button",options:l,value:t,onClick:c})}),!s&&Kd(vu,{}),tk(p7.Root,{open:e,onOpenChange:i,children:[Kd(ek,{selectedFontFamily:t,isOpened:e,compactMode:s}),e&&Kd(QT,{selectedFontFamily:t,hoveredFontFamily:o,onSelect:c,onHover:r,onLeave:a,onOpen:()=>i(!0),onClose:()=>i(!1)})]})]})},(e,t)=>e.isOpened===t.isOpened&&e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily);import{Popover as _0}from"radix-ui";import w7 from"clsx";import Ru,{useEffect as v7}from"react";import{isArrowKey as E7,KEYS as ma}from"@orangecatai/common";import{jsx as b7}from"react/jsx-runtime";var Dr=({className:e,icon:t,size:o="1em"})=>b7("span",{className:e,style:{width:o,height:"100%",margin:"0 0.5ex 0 0.5ex",display:"inline-flex",lineHeight:0,verticalAlign:"middle",flex:"0 0 auto"},children:t});import{Fragment as y7,jsx as rk,jsxs as ak}from"react/jsx-runtime";var x7=({label:e,open:t,openTrigger:o,children:n,className:r,showCollapsedIcon:a=!0})=>ak(y7,{children:[ak("div",{style:{cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center"},className:r,onClick:o,children:[e,a&&rk(Dr,{icon:t?nT:pu})]}),t&&rk("div",{style:{display:"flex",flexDirection:"column"},children:n})]}),Yd=x7;import{jsx as ps,jsxs as D0}from"react/jsx-runtime";var I7=je(!1);function T7({options:e,value:t,label:o,onChange:n,onClose:r,numberOfOptionsToAlwaysShow:a=e.length}){let i=qe(),{container:s}=St(),l=g=>{let f=e.find(w=>w.keyBinding===g.key.toLowerCase());if(!(g.metaKey||g.altKey||g.ctrlKey)&&f)n(f.value),g.preventDefault();else if(g.key===ma.TAB){let w=e.findIndex(v=>v.value===t),y=g.shiftKey?(e.length+w-1)%e.length:(w+1)%e.length;n(e[y].value)}else if(E7(g.key)){let w=la().rtl,y=e.findIndex(v=>v.value===t);if(y!==-1){let v=e.length,E=y;switch(g.key){case(w?ma.ARROW_LEFT:ma.ARROW_RIGHT):E=(y+1)%v;break;case(w?ma.ARROW_RIGHT:ma.ARROW_LEFT):E=(v+y-1)%v;break;case ma.ARROW_DOWN:{E=(y+(a??1))%v;break}case ma.ARROW_UP:{E=(v+y-(a??1))%v;break}}n(e[E].value)}g.preventDefault()}else(g.key===ma.ESCAPE||g.key===ma.ENTER)&&(g.preventDefault(),r());g.nativeEvent.stopImmediatePropagation(),g.stopPropagation()},[c,m]=ve(I7),p=Ru.useMemo(()=>e.slice(0,a),[e,a]),d=Ru.useMemo(()=>e.slice(a),[e,a]);v7(()=>{p.some(g=>g.value===t)||m(!0)},[t,p,m]);let u=g=>ps("div",{className:"picker-content",children:g.map((f,w)=>D0("button",{type:"button",className:w7("picker-option",{active:t===f.value}),onClick:y=>{n(f.value)},title:`${f.text} ${f.keyBinding&&`\u2014 ${f.keyBinding.toUpperCase()}`}`,"aria-label":f.text||"none","aria-keyshortcuts":f.keyBinding||void 0,ref:y=>{t===f.value&&setTimeout(()=>{y?.focus()},0)},children:[f.icon,f.keyBinding&&ps("span",{className:"picker-keybinding",children:f.keyBinding})]},f.text))}),h=i.formFactor==="phone";return ps(_0.Content,{side:h?"right":"bottom",align:"start",sideOffset:h?8:12,style:{zIndex:"var(--zIndex-ui-styles-popup)"},onKeyDown:l,collisionBoundary:s??void 0,children:D0("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":o,children:[u(p),d.length>0&&ps(Yd,{label:b("labels.more_options"),open:c,openTrigger:()=>{m(g=>!g)},className:"picker-collapsible",children:u(d)})]})})}function R0({value:e,label:t,options:o,onChange:n,group:r="",numberOfOptionsToAlwaysShow:a}){let[i,s]=Ru.useState(!1),l=Ru.useRef(null);return ps("div",{children:D0(_0.Root,{open:i,onOpenChange:c=>s(c),children:[ps(_0.Trigger,{name:r,type:"button","aria-label":t,onClick:()=>s(!i),ref:l,className:i?"active":"",children:o.find(c=>c.value===e)?.icon}),i&&ps(T7,{options:o,value:e,label:t,onChange:n,onClose:()=>{s(!1)},numberOfOptionsToAlwaysShow:a})]})})}import ik,{useEffect as k7}from"react";import{jsx as N0,jsxs as sk}from"react/jsx-runtime";var lk=({updateData:e,app:t,testId:o})=>{let n=ik.useRef(null),r=ik.useRef(null),a=t.scene.getSelectedElements(t.state),i=!0,s=a.at(0),c=a.reduce((m,p)=>(m!=null&&m!==p.opacity&&(i=!1),m==null||m>p.opacity?p.opacity:m),s?.opacity??null)??t.state.currentItemOpacity;return k7(()=>{if(n.current&&r.current){let m=n.current,p=r.current,d=m.offsetWidth,u=15,h=c/100*(d-u)+u/2;p.style.left=`${h}px`,m.style.background=`linear-gradient(to right, var(--color-slider-track) 0%, var(--color-slider-track) ${c}%, var(--button-bg) ${c}%, var(--button-bg) 100%)`}},[c]),sk("label",{className:"control-label",children:[b("labels.opacity"),sk("div",{className:"range-wrapper",children:[N0("input",{style:{"--color-slider-track":i?void 0:"var(--button-bg)"},ref:n,type:"range",min:"0",max:"100",step:"10",onChange:m=>{e(+m.target.value)},value:c,className:"range-input","data-testid":o}),N0("div",{className:"value-bubble",ref:r,children:c!==0?c:null}),N0("div",{className:"zero-label",children:"0"})]})]})};import{Fragment as W0,jsx as De,jsxs as Vo}from"react/jsx-runtime";var hk=.1,Ul=e=>{let t=X7(e.editorInterface);return{stylesPanelMode:t,isCompact:t!=="full",isMobile:t==="mobile"}},$o=(e,t,o,n=!1)=>{let r=U0(Me(e,t,{includeBoundTextElement:n}));return e.map(a=>r.get(a.id)||a.id===t.editingTextElement?.id?o(a):a)},Bo=function(e,t,o,n,r){let a=t.state.editingTextElement,i=uk(e),s=null;if(a&&(s=o(a)),!s)if(ft(i,t.state)){let c=t.scene.getSelectedElements(t.state),m=n===!0?c:c.filter(p=>n(p));s=U7(m,o)??(typeof r=="function"?r(!0):r)}else s=typeof r=="function"?r(!1):r;return s},j7=(e,t,o)=>$7(t)||!t.autoResize?t:o.mutateElement(t,{x:e.textAlign==="left"?e.x:e.x+(e.width-t.width)/(e.textAlign==="center"?2:1),y:e.y+(e.height-t.height)/2}),G0=(e,t,o,n,r)=>{let a=new Set,i=$o(e,t,s=>{if(nn(s)){let l=n(s);a.add(l);let c=io(s,{fontSize:l});return Xd(c,o.scene.getContainerElement(s),o.scene),c=j7(s,c,o.scene),c}return s},!0);return Me(e,t,{includeBoundTextElement:!0}).forEach(s=>{nn(s)&&G7(s,o.scene)}),{elements:i,appState:{...t,currentItemFontSize:a.size===1?[...a][0]:r??t.currentItemFontSize},captureUpdate:so.IMMEDIATELY}},Z7=X({name:"changeStrokeColor",label:"labels.stroke",trackEvent:!1,perform:(e,t,o)=>({...o?.currentItemStrokeColor&&{elements:$o(e,t,n=>W7(n.type)?io(n,{strokeColor:o.currentItemStrokeColor}):n,!0)},appState:{...t,...o},captureUpdate:o?.currentItemStrokeColor?so.IMMEDIATELY:so.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{stylesPanelMode:a}=Ul(n);return Vo(W0,{children:[a==="full"&&De("h3",{"aria-hidden":"true",children:b("labels.stroke")}),De(Gd,{topPicks:_7,palette:L7,type:"elementStroke",label:b("labels.stroke"),color:Bo(e,n,i=>i.strokeColor,!0,i=>i?null:t.currentItemStrokeColor),onChange:i=>o({currentItemStrokeColor:i}),elements:e,appState:t,updateData:o})]})}}),q7=X({name:"changeBackgroundColor",label:"labels.changeBackground",trackEvent:!1,perform:(e,t,o,n)=>{if(!o?.currentItemBackgroundColor)return{appState:{...t,...o},captureUpdate:so.EVENTUALLY};let r,a=n.scene.getSelectedElements(t);if(!z7(o.currentItemBackgroundColor)&&a.every(s=>mk(s)&&H7(s.points))){let s=U0(a);r=e.map(l=>s.has(l.id)&&mk(l)?io(l,{backgroundColor:o.currentItemBackgroundColor,...Y7(l,!0)}):l)}else r=$o(e,t,s=>io(s,{backgroundColor:o.currentItemBackgroundColor}));return{elements:r,appState:{...t,...o},captureUpdate:so.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{stylesPanelMode:a}=Ul(n);return Vo(W0,{children:[a==="full"&&De("h3",{"aria-hidden":"true",children:b("labels.background")}),De(Gd,{topPicks:A7,palette:P7,type:"elementBackground",label:b("labels.background"),color:Bo(e,n,i=>i.backgroundColor,!0,i=>i?null:t.currentItemBackgroundColor),onChange:i=>o({currentItemBackgroundColor:i}),elements:e,appState:t,updateData:o})]})}}),J7=X({name:"changeFillStyle",label:"labels.fill",trackEvent:!1,perform:(e,t,o,n)=>(Ne("element","changeFillStyle",`${o} (${n.editorInterface.formFactor==="phone"?"mobile":"desktop"})`),{elements:$o(e,t,r=>io(r,{fillStyle:o})),appState:{...t,currentItemFillStyle:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=Me(e,t),a=r.length>0&&r.every(i=>i.fillStyle==="zigzag");return Vo("fieldset",{children:[De("legend",{children:b("labels.fill")}),De("div",{className:"buttonList",children:De(Bn,{type:"button",options:[{value:"hachure",text:`${a?b("labels.zigzag"):b("labels.hachure")} (${V("Alt-Click")})`,icon:a?X2:j2,active:a?!0:void 0,testId:"fill-hachure"},{value:"cross-hatch",text:b("labels.crossHatch"),icon:Z2,testId:"fill-cross-hatch"},{value:"solid",text:b("labels.solid"),icon:q2,testId:"fill-solid"}],value:Bo(e,n,i=>i.fillStyle,i=>i.hasOwnProperty("fillStyle"),i=>i?null:t.currentItemFillStyle),onClick:(i,s)=>{let l=s.altKey&&i==="hachure"&&r.every(c=>c.fillStyle==="hachure")?"zigzag":i;o(l)}})})]})}}),Q7=X({name:"changeStrokeWidth",label:"labels.strokeWidth",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>io(n,{strokeWidth:o})),appState:{...t,currentItemStrokeWidth:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>Vo("fieldset",{children:[De("legend",{children:b("labels.strokeWidth")}),De("div",{className:"buttonList",children:De(Bn,{group:"stroke-width",options:[{value:O0.thin,text:b("labels.thin"),icon:Jb,testId:"strokeWidth-thin"},{value:O0.bold,text:b("labels.bold"),icon:J2,testId:"strokeWidth-bold"},{value:O0.extraBold,text:b("labels.extraBold"),icon:Q2,testId:"strokeWidth-extraBold"}],value:Bo(e,n,a=>a.strokeWidth,a=>a.hasOwnProperty("strokeWidth"),a=>a?null:t.currentItemStrokeWidth),onChange:a=>o(a)})})]})}),e9=X({name:"changeSloppiness",label:"labels.sloppiness",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>io(n,{seed:B7(),roughness:o})),appState:{...t,currentItemRoughness:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>Vo("fieldset",{children:[De("legend",{children:b("labels.sloppiness")}),De("div",{className:"buttonList",children:De(Bn,{group:"sloppiness",options:[{value:0,text:b("labels.architect"),icon:oI},{value:1,text:b("labels.artist"),icon:nI},{value:2,text:b("labels.cartoonist"),icon:rI}],value:Bo(e,n,a=>a.roughness,a=>a.hasOwnProperty("roughness"),a=>a?null:t.currentItemRoughness),onChange:a=>o(a)})})]})}),tge=X({name:"changeStrokeStyle",label:"labels.strokeStyle",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>io(n,{strokeStyle:o})),appState:{...t,currentItemStrokeStyle:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>Vo("fieldset",{children:[De("legend",{children:b("labels.strokeStyle")}),De("div",{className:"buttonList",children:De(Bn,{group:"strokeStyle",options:[{value:"solid",text:b("labels.strokeStyle_solid"),icon:Jb},{value:"dashed",text:b("labels.strokeStyle_dashed"),icon:eI},{value:"dotted",text:b("labels.strokeStyle_dotted"),icon:tI}],value:Bo(e,n,a=>a.strokeStyle,a=>a.hasOwnProperty("strokeStyle"),a=>a?null:t.currentItemStrokeStyle),onChange:a=>o(a)})})]})}),t9=X({name:"changeOpacity",label:"labels.opacity",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>io(n,{opacity:o}),!0),appState:{...t,currentItemOpacity:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({app:e,updateData:t})=>De(lk,{updateData:t,app:e,testId:"opacity"})}),o9=X({name:"changeFontSize",label:"labels.fontSize",trackEvent:!1,perform:(e,t,o,n)=>G0(e,t,n,()=>(H0(o,"actionChangeFontSize: Expected a font size value"),o),o),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{isCompact:a}=Ul(n);return Vo("fieldset",{children:[De("legend",{children:b("labels.fontSize")}),De("div",{className:"buttonList",children:De(Bn,{group:"font-size",options:[{value:Bu.sm,text:b("labels.small"),icon:yI,testId:"fontSize-small"},{value:Bu.md,text:b("labels.medium"),icon:wI,testId:"fontSize-medium"},{value:Bu.lg,text:b("labels.large"),icon:vI,testId:"fontSize-large"},{value:Bu.xl,text:b("labels.veryLarge"),icon:EI,testId:"fontSize-veryLarge"}],value:Bo(e,n,i=>{if(nn(i))return i.fontSize;let s=ni(i,n.scene.getNonDeletedElementsMap());return s?s.fontSize:null},i=>nn(i)||ni(i,n.scene.getNonDeletedElementsMap())!==null,i=>i?null:t.currentItemFontSize||R7),onChange:i=>{Od(()=>o(i),a,!!t.editingTextElement,r?.onPreventClose)}})})]})}}),$0=X({name:"decreaseFontSize",label:"labels.decreaseFontSize",icon:cs,trackEvent:!1,perform:(e,t,o,n)=>G0(e,t,n,r=>Math.round(1/(1+hk)*r.fontSize)),keyTest:e=>e[zl.CTRL_OR_CMD]&&e.shiftKey&&(e.key===zl.CHEVRON_LEFT||e.key===zl.COMMA)}),V0=X({name:"increaseFontSize",label:"labels.increaseFontSize",icon:cs,trackEvent:!1,perform:(e,t,o,n)=>G0(e,t,n,r=>Math.round(r.fontSize*(1+hk))),keyTest:e=>e[zl.CTRL_OR_CMD]&&e.shiftKey&&(e.key===zl.CHEVRON_RIGHT||e.key===zl.PERIOD)}),n9=X({name:"changeFontFamily",label:"labels.fontFamily",trackEvent:!1,perform:(e,t,o,n)=>{let{cachedElements:r,resetAll:a,resetContainers:i,...s}=o;if(a)return{elements:$o(e,t,g=>{let f=r?.get(g.id);return f?io(g,{...f}):g},!0),appState:{...t,...s},captureUpdate:so.NEVER};H0(o,"actionChangeFontFamily: value must be defined");let{currentItemFontFamily:l,currentHoveredFontFamily:c}=o,m=so.EVENTUALLY,p,d=!1;if(l)p=l,m=so.IMMEDIATELY;else if(c){p=c,m=so.EVENTUALLY;let h=Me(e,t,{includeBoundTextElement:!0}).filter(g=>nn(g));if(h.length>200)d=!0;else{let g=0,f=0;for(;g<h.length&&f<5e3;){let w=h[g];f+=w?.originalText.length||0,g++}f>5e3&&(d=!0)}}let u={appState:{...t,...s},captureUpdate:m};if(p&&!d){let h=new Map,g=new Set,f=!1,w=Array.from(Rn.loadedFontsCache.values()),y=Object.entries(N7).find(([I,k])=>k===p)?.[0];c&&y&&w.some(I=>I.startsWith(y))&&(f=!0),Object.assign(u,{elements:$o(e,t,I=>{if(nn(I)&&(I.fontFamily!==p||l)){let k=io(I,{fontFamily:p,lineHeight:O7(p)}),S=r?.get(I.containerId||"")||{},T=n.scene.getContainerElement(I);return i&&T&&S&&n.scene.mutateElement(T,{...S}),f||(g=new Set([...g,...Array.from(k.originalText)])),h.set(k,T),k}return I},!0)});let v=`10px ${F7({fontFamily:p})}`,E=Array.from(g.values()).join();if(f||window.document.fonts.check(v,E))for(let[I,k]of h)Xd(I,k,n.scene);else window.document.fonts.load(v,E).then(I=>{for(let[k,S]of h){let T=n.scene.getElement(k.id),A=S?n.scene.getElement(S.id):null;T&&Xd(T,A,n.scene)}n.fonts.onLoaded(I)})}return u},PanelComponent:({elements:e,appState:t,app:o,updateData:n})=>{let r=F0(new Map),a=F0(null),[i,s]=M7({}),l=F0(!0),{stylesPanelMode:c,isCompact:m}=Ul(o),p=S7(()=>{let d=(u,h)=>Bo(u,o,g=>{if(nn(g))return g.fontFamily;let f=ni(g,h);return f?f.fontFamily:null},g=>nn(g)||ni(g,h)!==null,g=>g?null:t.currentItemFontFamily||D7);return i.openPopup==="fontFamily"&&t.openPopup==="fontFamily"?d(Array.from(r.current?.values()??[]),r.current):!i.openPopup&&t.openPopup!=="fontFamily"?d(e,o.scene.getNonDeletedElementsMap()):a.current},[i.openPopup,t,e,o]);return B0(()=>{a.current=p},[p]),B0(()=>{Object.keys(i).length&&(n(i),s({}))},[i]),B0(()=>(l.current=!1,()=>{l.current=!0}),[]),Vo(W0,{children:[c==="full"&&De("legend",{children:b("labels.fontFamily")}),De(nk,{isOpened:t.openPopup==="fontFamily",selectedFontFamily:p,hoveredFontFamily:t.currentHoveredFontFamily,compactMode:c!=="full",onSelect:d=>{Od(()=>{s({openPopup:null,currentHoveredFontFamily:null,currentItemFontFamily:d}),r.current.clear()},m,!!t.editingTextElement)},onHover:d=>{s({currentHoveredFontFamily:d,cachedElements:new Map(r.current),resetContainers:!0})},onLeave:()=>{s({currentHoveredFontFamily:null,cachedElements:new Map(r.current),resetAll:!0})},onPopupChange:d=>{if(d){r.current.clear();let{editingTextElement:u}=t;if(u?.type==="text"){let h=o.scene.getElement(u.id);r.current.set(u.id,io(h||u,{},!0))}else{let h=Me(e,t,{includeBoundTextElement:!0});for(let g of h)r.current.set(g.id,io(g,{},!0))}s({...i,openPopup:"fontFamily"})}else{let u={currentHoveredFontFamily:null,cachedElements:new Map(r.current),resetAll:!0};s({...u}),r.current.clear(),m&&t.editingTextElement&&Fd(null)}}})]})}}),r9=X({name:"changeTextAlign",label:"Change text alignment",trackEvent:!1,perform:(e,t,o,n)=>({elements:$o(e,t,r=>{if(nn(r)){let a=io(r,{textAlign:o});return Xd(a,n.scene.getContainerElement(r),n.scene),a}return r},!0),appState:{...t,currentItemTextAlign:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let a=n.scene.getNonDeletedElementsMap(),{isCompact:i}=Ul(n);return Vo("fieldset",{children:[De("legend",{children:b("labels.textAlign")}),De("div",{className:"buttonList",children:De(Bn,{group:"text-align",options:[{value:"left",text:b("labels.left"),icon:TI,testId:"align-left"},{value:"center",text:b("labels.center"),icon:kI,testId:"align-horizontal-center"},{value:"right",text:b("labels.right"),icon:CI,testId:"align-right"}],value:Bo(e,n,s=>{if(nn(s))return s.textAlign;let l=ni(s,a);return l?l.textAlign:null},s=>nn(s)||ni(s,a)!==null,s=>s?null:t.currentItemTextAlign),onChange:s=>{Od(()=>o(s),i,!!t.editingTextElement,r?.onPreventClose)}})})]})}}),a9=X({name:"changeVerticalAlign",label:"Change vertical alignment",trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:$o(e,t,r=>{if(nn(r)){let a=io(r,{verticalAlign:o});return Xd(a,n.scene.getContainerElement(r),n.scene),a}return r},!0),appState:{...t},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{isCompact:a}=Ul(n);return De("fieldset",{children:De("div",{className:"buttonList",children:De(Bn,{group:"text-align",options:[{value:Nu.TOP,text:b("labels.alignTop"),icon:De(SI,{theme:t.theme}),testId:"align-top"},{value:Nu.MIDDLE,text:b("labels.centerVertically"),icon:De(PI,{theme:t.theme}),testId:"align-middle"},{value:Nu.BOTTOM,text:b("labels.alignBottom"),icon:De(MI,{theme:t.theme}),testId:"align-bottom"}],value:Bo(e,n,i=>{if(nn(i)&&i.containerId)return i.verticalAlign;let s=ni(i,n.scene.getNonDeletedElementsMap());return s?s.verticalAlign:null},i=>nn(i)||ni(i,n.scene.getNonDeletedElementsMap())!==null,i=>i?null:Nu.MIDDLE),onChange:i=>{Od(()=>o(i),a,!!t.editingTextElement,r?.onPreventClose)}})})})}}),oge=X({name:"changeRoundness",label:"Change edge roundness",trackEvent:!1,perform:(e,t,o)=>({elements:$o(e,t,n=>gk(n)?n:io(n,{roundness:o==="round"?{type:V7(n.type)?Fu.ADAPTIVE_RADIUS:Fu.PROPORTIONAL_RADIUS}:null})),appState:{...t,currentItemRoundness:o},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,renderAction:r})=>{let i=ol(uk(e),t).some(s=>s.roundness?.type===Fu.LEGACY);return Vo("fieldset",{children:[De("legend",{children:b("labels.edges")}),Vo("div",{className:"buttonList",children:[De(Bn,{group:"edges",options:[{value:"sharp",text:b("labels.sharp"),icon:aI},{value:"round",text:b("labels.round"),icon:iI}],value:Bo(e,n,s=>i?null:s.roundness?"round":"sharp",s=>!Ou(s)&&s.hasOwnProperty("roundness"),s=>s?null:t.currentItemRoundness),onChange:s=>o(s)}),r("togglePolygon")]})]})}}),pk=e=>[{value:null,text:b("labels.arrowhead_none"),keyBinding:"q",icon:De(sI,{flip:e})},{value:"arrow",text:b("labels.arrowhead_arrow"),keyBinding:"w",icon:De(lI,{flip:e})},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:De(pI,{flip:e}),keyBinding:"e"},{value:"triangle_outline",text:b("labels.arrowhead_triangle_outline"),icon:De(uI,{flip:e}),keyBinding:"r"},{value:"circle",text:b("labels.arrowhead_circle"),keyBinding:"a",icon:De(cI,{flip:e})},{value:"circle_outline",text:b("labels.arrowhead_circle_outline"),keyBinding:"s",icon:De(dI,{flip:e})},{value:"diamond",text:b("labels.arrowhead_diamond"),icon:De(gI,{flip:e}),keyBinding:"d"},{value:"diamond_outline",text:b("labels.arrowhead_diamond_outline"),icon:De(hI,{flip:e}),keyBinding:"f"},{value:"bar",text:b("labels.arrowhead_bar"),keyBinding:"z",icon:De(mI,{flip:e})},{value:"crowfoot_one",text:b("labels.arrowhead_crowfoot_one"),icon:De(bI,{flip:e}),keyBinding:"x"},{value:"crowfoot_many",text:b("labels.arrowhead_crowfoot_many"),icon:De(fI,{flip:e}),keyBinding:"c"},{value:"crowfoot_one_or_many",text:b("labels.arrowhead_crowfoot_one_or_many"),icon:De(xI,{flip:e}),keyBinding:"v"}],nge=X({name:"changeArrowhead",label:"Change arrowheads",trackEvent:!1,perform:(e,t,o)=>(H0(o,"actionChangeArrowhead: value must be defined"),{elements:$o(e,t,n=>{if(z0(n)){let{position:r,type:a}=o;if(r==="start")return io(n,{startArrowhead:a});if(r==="end")return io(n,{endArrowhead:a})}return n}),appState:{...t,[o.position==="start"?"currentItemStartArrowhead":"currentItemEndArrowhead"]:o.type},captureUpdate:so.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=la().rtl;return Vo("fieldset",{children:[De("legend",{children:b("labels.arrowheads")}),Vo("div",{className:"iconSelectList buttonList",children:[De(R0,{label:"arrowhead_start",options:pk(!r),value:Bo(e,n,a=>z0(a)&&nl(a.type)?a.startArrowhead:t.currentItemStartArrowhead,!0,a=>a?null:t.currentItemStartArrowhead),onChange:a=>o({position:"start",type:a}),numberOfOptionsToAlwaysShow:4}),De(R0,{label:"arrowhead_end",group:"arrowheads",options:pk(!!r),value:Bo(e,n,a=>z0(a)&&nl(a.type)?a.endArrowhead:t.currentItemEndArrowhead,!0,a=>a?null:t.currentItemEndArrowhead),onChange:a=>o({position:"end",type:a}),numberOfOptionsToAlwaysShow:4})]})]})}}),i9=X({name:"changeArrowProperties",label:"Change arrow properties",trackEvent:!1,perform:(e,t,o,n)=>!1,PanelComponent:({elements:e,appState:t,updateData:o,app:n,renderAction:r})=>Vo("div",{className:"selected-shape-actions",children:[r("changeArrowhead"),r("changeArrowType")]})}),rge=X({name:"changeArrowType",label:"Change arrow types",trackEvent:!1,perform:(e,t,o,n)=>{let r=$o(e,t,s=>{if(!Ou(s))return s;let l=n.scene.getNonDeletedElementsMap(),c=us.getPointAtIndexGlobalCoordinates(s,0,l),m=us.getPointAtIndexGlobalCoordinates(s,-1,l),p=io(s,{x:o===Un.elbow?c[0]:s.x,y:o===Un.elbow?c[1]:s.y,roundness:o===Un.round?{type:Fu.PROPORTIONAL_RADIUS}:null,elbowed:o===Un.elbow,angle:o===Un.elbow?0:s.angle,points:o===Un.elbow||s.elbowed?[us.pointFromAbsoluteCoords({...s,x:c[0],y:c[1],angle:0},c,l),us.pointFromAbsoluteCoords({...s,x:c[0],y:c[1],angle:0},m,l)]:s.points});if(gk(p)){p.fixedSegments=null;let d=n.scene.getNonDeletedElementsMap();n.dismissLinearEditor();let u=us.getPointAtIndexGlobalCoordinates(p,0,d),h=us.getPointAtIndexGlobalCoordinates(p,-1,d),g=p.startBinding&&d.get(p.startBinding.elementId),f=p.endBinding&&d.get(p.endBinding.elementId),w=g&&p.startBinding?{...p.startBinding,...dk(p,g,"start",d)}:null,y=f&&p.endBinding?{...p.endBinding,...dk(p,f,"end",d)}:null;p={...p,startBinding:w,endBinding:y,...K7(p,d,{points:[u,h].map(v=>C7(v[0]-p.x,v[1]-p.y)),startBinding:w,endBinding:y,fixedSegments:null})}}else{let d=n.scene.getNonDeletedElementsMap();if(p.startBinding){let u=d.get(p.startBinding.elementId);u&&ck(p,u,t.bindMode==="inside"?"inside":"orbit","start",n.scene)}if(p.endBinding){let u=d.get(p.endBinding.elementId);u&&ck(p,u,t.bindMode==="inside"?"inside":"orbit","end",n.scene)}}return p}),a={...t,currentItemArrowType:o},i=t.selectedLinearElement?.elementId;if(i){let s=r.find(l=>l.id===i);s&&(a.selectedLinearElement=new us(s,U0(e)))}return{elements:r,appState:a,captureUpdate:so.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>Vo("fieldset",{children:[De("legend",{children:b("labels.arrowtypes")}),De("div",{className:"buttonList",children:De(Bn,{group:"arrowtypes",options:[{value:Un.sharp,text:b("labels.arrowtype_sharp"),icon:Sl,testId:"sharp-arrow"},{value:Un.round,text:b("labels.arrowtype_round"),icon:Pl,testId:"round-arrow"},{value:Un.elbow,text:b("labels.arrowtype_elbowed"),icon:Ml,testId:"elbow-arrow"}],value:Bo(e,n,r=>Ou(r)?r.elbowed?Un.elbow:r.roundness?Un.round:Un.sharp:null,r=>Ou(r),r=>r?null:t.currentItemArrowType),onChange:r=>o(r)})})]})});import{clamp as Z0,roundToStep as u9}from"@orangecatai/math";import{DEFAULT_CANVAS_BACKGROUND_PICKS as g9,CURSOR_TYPE as Ik,MAX_ZOOM as Tk,MIN_ZOOM as kk,THEME as jd,ZOOM_STEP as q0,updateActiveTool as Gl,CODES as Nr,KEYS as ua,viewportCoordsToSceneCoords as h9}from"@orangecatai/common";import{getElementAbsoluteCoords as wk,getNonDeletedElements as Ck,getVisibleElements as f9}from"@orangecatai/element";import{newElementWith as b9}from"@orangecatai/element";import{getCommonBounds as Sk}from"@orangecatai/element";import{CaptureUpdateAction as cr}from"@orangecatai/element";import{useEffect as s9}from"react";import{jsx as c9}from"react/jsx-runtime";var Hl=()=>{let e=document.querySelector(".excalidraw-tooltip");if(e)return e;let t=document.createElement("div");return document.body.appendChild(t),t.classList.add("excalidraw-tooltip"),t},K0=(e,t,o="bottom")=>{let n=e.getBoundingClientRect(),r=window.innerWidth,a=window.innerHeight,i=5,s=t.left+t.width/2-n.width/2;s<0?s=i:s+n.width>=r&&(s=r-n.width-i);let l;o==="bottom"?(l=t.top+t.height+i,l+n.height>=a&&(l=t.top-n.height-i)):(l=t.top-n.height-i,l<0&&(l=t.top+t.height+i)),Object.assign(e.style,{top:`${l}px`,left:`${s}px`})},l9=(e,t,o,n)=>{t.classList.add("excalidraw-tooltip--visible"),t.style.minWidth=n?"50ch":"10ch",t.style.maxWidth=n?"50ch":"15ch",t.textContent=o;let r=e.getBoundingClientRect();K0(t,r)},Fo=({children:e,label:t,long:o=!1,style:n,disabled:r})=>(s9(()=>()=>Hl().classList.remove("excalidraw-tooltip--visible"),[]),r?null:c9("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:a=>l9(a.currentTarget,Hl(),t,o),onPointerLeave:()=>Hl().classList.remove("excalidraw-tooltip--visible"),style:n,children:e}));import{CURSOR_TYPE as Y0,MIME_TYPES as X0,THEME as bk}from"@orangecatai/common";var xk='<svg viewBox="0 0 24 24" stroke-width="1" width="28" height="28" xmlns="http://www.w3.org/2000/svg">',d9='<path d="M6.164 11.755a5.314 5.314 0 0 1-4.932-5.298 5.314 5.314 0 0 1 5.311-5.311 5.314 5.314 0 0 1 5.307 5.113l8.773 8.773a3.322 3.322 0 0 1 0 4.696l-.895.895a3.322 3.322 0 0 1-4.696 0l-8.868-8.868Z" style="fill:#fff"/>',yk='<path stroke="#1b1b1f" fill="#fff" d="m7.868 11.113 7.773 7.774a2.359 2.359 0 0 0 1.667.691 2.368 2.368 0 0 0 2.357-2.358c0-.625-.248-1.225-.69-1.667L11.201 7.78 9.558 9.469l-1.69 1.643v.001Zm10.273 3.606-3.333 3.333m-3.25-6.583 2 2m-7-7 3 3M3.664 3.625l1 1M2.529 6.922l1.407-.144m5.735-2.932-1.118.866M4.285 9.823l.758-1.194m1.863-6.207-.13 1.408"/>',m9=`data:${X0.svg},${encodeURIComponent(`${xk}${yk}</svg>`)}`,p9=`data:${X0.svg},${encodeURIComponent(`${xk}${d9}${yk}</svg>`)}`,bn=e=>{e&&(e.style.cursor="")},pt=(e,t)=>{e&&(e.style.cursor=t)},Rr,fk,j0=(e,t)=>{let n=()=>{let r=t===bk.DARK;Rr=document.createElement("canvas"),Rr.theme=t,Rr.height=20,Rr.width=20;let a=Rr.getContext("2d");a.lineWidth=1,a.beginPath(),a.arc(Rr.width/2,Rr.height/2,5,0,2*Math.PI),a.fillStyle=r?"#000":"#fff",a.fill(),a.strokeStyle=r?"#fff":"#000",a.stroke(),fk=Rr.toDataURL(X0.svg)};(!Rr||Rr.theme!==t)&&n(),pt(e,`url(${fk}) ${20/2} ${20/2}, auto`)},xn=(e,t)=>{if(e)if(t.activeTool.type==="selection")bn(e);else if(sa(t))e.style.cursor=Y0.GRAB;else if(tn(t))j0(e,t.theme);else if(t.activeTool.type==="laser"){let o=t.theme===bk.LIGHT?m9:p9;e.style.cursor=`url(${o}), auto`}else["image","custom"].includes(t.activeTool.type)?t.activeTool.type!=="image"&&(e.style.cursor=Y0.AUTO):e.style.cursor=Y0.CROSSHAIR};var pa=({viewportX:e,viewportY:t,nextZoom:o},n)=>{let r=e-n.offsetLeft,a=t-n.offsetTop,i=n.zoom.value,s=n.scrollX+(r-r/i),l=n.scrollY+(a-a/i),c=-(r-r/o),m=-(a-a/o);return{scrollX:s+c,scrollY:l+m,zoom:{value:o}}};import{jsx as $l,jsxs as C9}from"react/jsx-runtime";var x9=X({name:"changeViewBackgroundColor",label:"labels.canvasBackground",trackEvent:!1,predicate:(e,t,o,n)=>!!n.props.UIOptions.canvasActions.changeViewBackgroundColor&&!t.viewModeEnabled,perform:(e,t,o)=>({appState:{...t,...o},captureUpdate:o?.viewBackgroundColor?cr.IMMEDIATELY:cr.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:o,appProps:n,data:r})=>$l(Gd,{palette:null,topPicks:g9,label:b("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:a=>o({viewBackgroundColor:a}),"data-testid":"canvas-background-picker",elements:e,appState:t,updateData:o})}),ga=X({name:"clearCanvas",label:"labels.clearCanvas",icon:Co,trackEvent:{category:"canvas"},predicate:(e,t,o,n)=>!!n.props.UIOptions.canvasActions.clearCanvas&&!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector",perform:(e,t,o,n)=>(n.imageCache.clear(),{elements:e.map(r=>b9(r,{isDeleted:!0})),appState:{...Va(),files:{},theme:t.theme,penMode:t.penMode,penDetected:t.penDetected,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,gridStep:t.gridStep,gridModeEnabled:t.gridModeEnabled,stats:t.stats,pasteDialog:t.pasteDialog,activeTool:t.activeTool.type==="image"?{...t.activeTool,type:n.state.preferredSelectionTool.type}:t.activeTool},captureUpdate:cr.IMMEDIATELY})}),zu=X({name:"zoomIn",label:"buttons.zoomIn",viewMode:!0,icon:Nb,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>({appState:{...t,...pa({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Ir(t.zoom.value+q0)},t),userToFollow:null},captureUpdate:cr.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>$l(be,{type:"button",className:"zoom-in-button zoom-button",icon:Nb,title:`${b("buttons.zoomIn")} \u2014 ${V("CtrlOrCmd++")}`,"aria-label":b("buttons.zoomIn"),disabled:t.zoom.value>=Tk,onClick:()=>{e(null)}}),keyTest:e=>(e.code===Nr.EQUAL||e.code===Nr.NUM_ADD)&&(e[ua.CTRL_OR_CMD]||e.shiftKey)}),Uu=X({name:"zoomOut",label:"buttons.zoomOut",icon:Bb,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>({appState:{...t,...pa({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Ir(t.zoom.value-q0)},t),userToFollow:null},captureUpdate:cr.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>$l(be,{type:"button",className:"zoom-out-button zoom-button",icon:Bb,title:`${b("buttons.zoomOut")} \u2014 ${V("CtrlOrCmd+-")}`,"aria-label":b("buttons.zoomOut"),disabled:t.zoom.value<=kk,onClick:()=>{e(null)}}),keyTest:e=>(e.code===Nr.MINUS||e.code===Nr.NUM_SUBTRACT)&&(e[ua.CTRL_OR_CMD]||e.shiftKey)}),Hu=X({name:"resetZoom",label:"buttons.resetZoom",icon:L2,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>({appState:{...t,...pa({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Ir(1)},t),userToFollow:null},captureUpdate:cr.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>$l(Fo,{label:b("buttons.resetZoom"),style:{height:"100%"},children:C9(be,{type:"button",className:"reset-zoom-button zoom-button",title:b("buttons.resetZoom"),"aria-label":b("buttons.resetZoom"),onClick:()=>{e(null)},children:[(t.zoom.value*100).toFixed(0),"%"]})}),keyTest:e=>(e.code===Nr.ZERO||e.code===Nr.NUM_ZERO)&&(e[ua.CTRL_OR_CMD]||e.shiftKey)}),y9=(e,t,o=1)=>{let[n,r,a,i]=e,s=a-n,l=t.width/s,c=i-r,m=t.height/c,d=Math.min(l,m)*Z0(o,.1,1);return Math.min(d,1)},w9=.8,v9=(e,t)=>e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1],E9=(e,t)=>[e[0]-t,e[1]-t,e[2]+t,e[3]+t],vk=(e,t)=>{let o=(e[0]+e[2])/2,n=(e[1]+e[3])/2;return Math.hypot(o-t.x,n-t.y)},Ek=e=>[e[0],e[1],e[2],e[3]],I9=(e,t)=>{let o=Ck(e);if(!o.length)return[];let n=f9(o),r=n.length?n:o,a=new Map(o.map(d=>[d.id,d])),i=h9({clientX:t.offsetLeft+t.width/2,clientY:t.offsetTop+t.height/2},t),s=r.reduce((d,u)=>{let h=Ek(wk(u,a));return d?vk(h,i)<vk(d.bounds,i)?{element:u,bounds:h}:d:{element:u,bounds:h}},null);if(!s)return[];let l=Math.max(160/t.zoom.value,.12*Math.min(t.width,t.height)/t.zoom.value),c=new Map([[s.element.id,s.element]]),m=s.bounds,p=!0;for(;p;){p=!1;let d=E9(m,l);for(let u of r){if(c.has(u.id))continue;let h=Ek(wk(u,a));v9(h,d)&&(c.set(u.id,u),m=Sk([...c.values()]),p=!0)}}return[...c.values()]},Mk=({bounds:e,appState:t,canvasOffsets:o,fitToViewport:n=!1,viewportZoomFactor:r=1,minZoom:a=-1/0,maxZoom:i=1/0})=>{r=Z0(r,kk,Tk);let[s,l,c,m]=e,p=(s+c)/2,d=(l+m)/2,u=o?.left??0,h=o?.top??0,g=o?.right??0,f=o?.bottom??0,w=t.width-u-g,y=t.height-h-f,v;if(n){let k=c-s,S=m-l;v=Math.min(w/k,y/S)*r}else v=y9(e,{width:w,height:y},r);let E=Ir(Z0(u9(v,q0,"floor"),a,i)),I=XE({scenePoint:{x:p,y:d},viewportDimensions:{width:t.width,height:t.height},offsets:o,zoom:{value:E}});return{appState:{...t,scrollX:I.scrollX,scrollY:I.scrollY,zoom:{value:E}},captureUpdate:cr.EVENTUALLY}},Vl=({canvasOffsets:e,targetElements:t,appState:o,fitToViewport:n,viewportZoomFactor:r,minZoom:a,maxZoom:i})=>{let s=Sk(Ck(t));return Mk({canvasOffsets:e,bounds:s,appState:o,fitToViewport:n,viewportZoomFactor:r,minZoom:a,maxZoom:i})},Uge=X({name:"zoomToFitSelectionInViewport",label:"labels.zoomToFitViewport",icon:Cl,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t);return Vl({targetElements:r.length?r:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:n.getEditorUIOffsets()})},keyTest:e=>e.code===Nr.TWO&&e.shiftKey&&!e.altKey&&!e[ua.CTRL_OR_CMD]}),Hge=X({name:"zoomToFitSelection",label:"helpDialog.zoomToSelection",icon:Cl,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t);return Vl({targetElements:r.length?r:e,appState:{...t,userToFollow:null},fitToViewport:!0,canvasOffsets:n.getEditorUIOffsets()})},keyTest:e=>e.code===Nr.THREE&&e.shiftKey&&!e.altKey&&!e[ua.CTRL_OR_CMD]}),T9=X({name:"zoomToFit",label:"helpDialog.zoomToFit",icon:Cl,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>Vl({targetElements:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:n.getEditorUIOffsets()}),keyTest:e=>e.code===Nr.ONE&&e.shiftKey&&!e.altKey&&!e[ua.CTRL_OR_CMD]}),k9=X({name:"scrollBackToContent",label:"buttons.scrollBackToContent",icon:Cl,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t),a=r.length?r:I9(e,t);return a.length?Vl({targetElements:a,appState:{...t,userToFollow:null},fitToViewport:!0,viewportZoomFactor:w9,canvasOffsets:n.getEditorUIOffsets()}):!1},PanelComponent:({updateData:e})=>$l(Fo,{label:b("buttons.scrollBackToContent"),style:{height:"100%"},children:$l(be,{type:"button",className:"scroll-back-to-content-button zoom-button",icon:Cl,title:b("buttons.scrollBackToContent"),"aria-label":b("buttons.scrollBackToContent"),onClick:()=>{e(null)}})})}),gs=X({name:"toggleTheme",label:(e,t)=>t.theme===jd.DARK?"buttons.lightMode":"buttons.darkMode",keywords:["toggle","dark","light","mode","theme"],icon:(e,t)=>e.theme===jd.LIGHT?Md:Pd,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o)=>({appState:{...t,theme:o||(t.theme===jd.LIGHT?jd.DARK:jd.LIGHT)},captureUpdate:cr.EVENTUALLY}),keyTest:e=>e.altKey&&e.shiftKey&&e.code===Nr.D,predicate:(e,t,o,n)=>!!n.props.UIOptions.canvasActions.toggleTheme}),Gge=X({name:"toggleEraserTool",label:"toolBar.eraser",trackEvent:{category:"toolbar"},perform:(e,t,o,n)=>{let r;return tn(t)?r=Gl(t,{...t.activeTool.lastActiveTool||{type:n.state.preferredSelectionTool.type},lastActiveToolBeforeEraser:null}):r=Gl(t,{type:"eraser",lastActiveToolBeforeEraser:t.activeTool}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:r},captureUpdate:cr.IMMEDIATELY}},keyTest:e=>e.key===ua.E}),$ge=X({name:"toggleLassoTool",label:"toolBar.lasso",icon:Ya,trackEvent:{category:"toolbar"},predicate:(e,t,o,n)=>n.state.preferredSelectionTool.type!=="lasso",perform:(e,t,o,n)=>{let r;return t.activeTool.type!=="lasso"?(r=Gl(t,{type:"lasso",fromSelection:!1}),pt(n.interactiveCanvas,Ik.CROSSHAIR)):r=Gl(t,{type:"selection"}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:r},captureUpdate:cr.NEVER}}}),Pk=X({name:"toggleHandTool",label:"toolBar.hand",trackEvent:{category:"toolbar"},icon:El,viewMode:!1,perform:(e,t,o,n)=>{let r;return sa(t)?r=Gl(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):(r=Gl(t,{type:"hand",lastActiveToolBeforeEraser:t.activeTool}),pt(n.interactiveCanvas,Ik.GRAB)),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:r},captureUpdate:cr.IMMEDIATELY}},keyTest:e=>!e.altKey&&!e[ua.CTRL_OR_CMD]&&e.key===ua.H});import{updateActiveTool as Ak}from"@orangecatai/common";import{CaptureUpdateAction as S9}from"@orangecatai/element";var M9=X({name:"setEmbeddableAsActiveTool",trackEvent:{category:"toolbar"},target:"Tool",label:"toolBar.embeddable",perform:(e,t,o,n)=>{let r=Ak(t,{type:"embeddable"});return xn(n.canvas,{...t,activeTool:r}),{elements:e,appState:{...t,activeTool:Ak(t,{type:"embeddable"})},captureUpdate:S9.EVENTUALLY}}});import{pointFrom as Lk}from"@orangecatai/math";import{bindOrUnbindBindingElement as P9}from"@orangecatai/element/binding";import{isValidPolygon as _k,LinearElementEditor as Gu,newElementWith as J0}from"@orangecatai/element";import{isBindingElement as Dk,isFreeDrawElement as Rk,isLinearElement as Nk,isLineElement as $u}from"@orangecatai/element";import{KEYS as Q0,arrayToMap as A9,invariant as Bk,shouldRotateWithDiscreteAngle as L9,updateActiveTool as Fk}from"@orangecatai/common";import{isPathALoop as _9}from"@orangecatai/element";import{isInvisiblySmallElement as ex}from"@orangecatai/element";import{CaptureUpdateAction as Ok}from"@orangecatai/element";import{jsx as D9}from"react/jsx-runtime";var Wo=X({name:"finalize",label:"",trackEvent:!1,perform:(e,t,o,n)=>{let r=e,{interactiveCanvas:a,focusContainer:i,scene:s}=n,l=s.getNonDeletedElementsMap();if(o&&t.selectedLinearElement){let{event:d,sceneCoords:u}=o,h=Gu.getElement(t.selectedLinearElement.elementId,l);Bk(h,"Arrow element should exist if selectedLinearElement is set"),Bk(u,"sceneCoords should be defined if actionFinalize is called with event");let g=Gu.handlePointerUp(d,t.selectedLinearElement,t,n.scene);if(Dk(h)&&!t.selectedLinearElement.segmentMidPointHoveredCoords){let f=!!t.newElement,y=(f||!t.selectedLinearElement.selectedPointsIndices?[h.points.length-1]:t.selectedLinearElement.selectedPointsIndices).reduce((v,E)=>(v.set(E,{point:Gu.pointFromAbsoluteCoords(h,Lk(u.x-g.pointerOffset.x,u.y-g.pointerOffset.y),l)}),v),new Map)??new Map;P9(h,y,u.x-g.pointerOffset.x,u.y-g.pointerOffset.y,s,t,{newArrow:f,altKey:d.altKey,angleLocked:L9(d)})}else $u(h)&&t.selectedLinearElement?.isEditing&&!t.newElement&&!_k(h.points)&&s.mutateElement(h,{polygon:!1});if(g!==t.selectedLinearElement){h&&ex(h)&&(r=r.map(w=>w.id===h.id?J0(w,{isDeleted:!0}):w));let f=t.activeTool?.locked;return{elements:h.points.length<2||ex(h)?e.map(w=>w.id===h.id?J0(w,{isDeleted:!0}):w):r,appState:{...t,cursorButton:"up",selectedLinearElement:f?null:{...g,selectedPointsIndices:null,isEditing:!1,initialState:{...g.initialState,lastClickedPoint:-1},pointerOffset:{x:0,y:0}},selectionElement:null,suggestedBinding:null,newElement:null,multiElement:null},captureUpdate:Ok.IMMEDIATELY}}}window.document.activeElement instanceof HTMLElement&&i();let c=null;if(t.multiElement)c=t.multiElement;else if(t.newElement?.type==="freedraw"||Dk(t.newElement))c=t.newElement;else if(Object.keys(t.selectedElementIds).length===1){let d=l.get(Object.keys(t.selectedElementIds)[0]);d&&(c=d)}if(c){if(t.selectedLinearElement&&t.multiElement&&c.type!=="freedraw"&&t.lastPointerDownWith!=="touch"){let{points:d}=c,{lastCommittedPoint:u}=t.selectedLinearElement;(!u||d[d.length-1]!==u)&&s.mutateElement(c,{points:c.points.slice(0,-1)})}if(c&&ex(c)&&(r=r.map(d=>d.id===c?.id?J0(d,{isDeleted:!0}):d)),Nk(c)||Rk(c)){if(_9(c.points,t.zoom.value)&&($u(c)||Rk(c))){let u=c.points,h=u[0],g=u.map((f,w)=>w===u.length-1?Lk(h[0],h[1]):f);$u(c)?s.mutateElement(c,{points:g,polygon:!0}):s.mutateElement(c,{points:g})}$u(c)&&!_k(c.points)&&s.mutateElement(c,{polygon:!1})}}(!t.activeTool.locked&&t.activeTool.type!=="freedraw"||!c)&&bn(a);let m;t.activeTool.type==="eraser"?m=Fk(t,{...t.activeTool.lastActiveTool||{type:n.state.preferredSelectionTool.type},lastActiveToolBeforeEraser:null}):m=Fk(t,{type:n.state.preferredSelectionTool.type});let p=c&&Nk(c)?new Gu(c,A9(r)):t.selectedLinearElement;return p=p&&{...p,isEditing:t.newElement?!1:p.isEditing,initialState:{...p.initialState,lastClickedPoint:-1,origin:null}},{elements:r,appState:{...t,cursorButton:"up",activeTool:(t.activeTool.locked||t.activeTool.type==="freedraw")&&c?t.activeTool:m,activeEmbeddable:null,newElement:null,selectionElement:null,multiElement:null,editingTextElement:null,startBoundElement:null,suggestedBinding:null,selectedElementIds:c&&!t.activeTool.locked&&t.activeTool.type!=="freedraw"?{...t.selectedElementIds,[c.id]:!0}:t.selectedElementIds,selectedLinearElement:p},captureUpdate:Ok.IMMEDIATELY}},keyTest:(e,t)=>e.key===Q0.ESCAPE&&(t.selectedLinearElement?.isEditing||!t.newElement&&t.multiElement===null)||(e.key===Q0.ESCAPE||e.key===Q0.ENTER)&&t.multiElement!==null,PanelComponent:({appState:e,updateData:t,data:o})=>D9(be,{type:"button",icon:U2,title:b("buttons.done"),"aria-label":b("buttons.done"),onClick:t,visible:e.multiElement!=null,size:o?.size||"medium",style:{pointerEvents:"all"}})});import{KEYS as Xl,DEFAULT_EXPORT_PADDING as IB,EXPORT_SCALES as TB,THEME as nx}from"@orangecatai/common";import{getNonDeletedElements as kB}from"@orangecatai/element";import{CaptureUpdateAction as pr}from"@orangecatai/element";import{viewportCoordsToSceneCoords as CB}from"@orangecatai/common";import R9 from"clsx";import{jsx as zk,jsxs as N9}from"react/jsx-runtime";var Zd=({children:e,checked:t,onChange:o,className:n})=>N9("div",{className:R9("Checkbox",n,{"is-checked":t}),onClick:r=>{o(!t,r),r.currentTarget.querySelector(".Checkbox-box").focus()},children:[zk("button",{type:"button",className:"Checkbox-box",role:"checkbox","aria-checked":t,children:nu}),zk("div",{className:"Checkbox-label",children:e})]});import{THEME as qd}from"@orangecatai/common";import{jsx as Jd}from"react/jsx-runtime";var Hk=e=>{let t=e.title||(e.value===qd.DARK?b("buttons.lightMode"):b("buttons.darkMode"));return Jd(be,{type:"icon",icon:e.value===qd.LIGHT?Uk.MOON:Uk.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===qd.DARK?qd.LIGHT:qd.DARK),"data-testid":"toggle-dark-mode"})},Uk={SUN:Jd("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:Jd("path",{fill:"currentColor",d:"M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z"})}),MOON:Jd("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:Jd("path",{fill:"currentColor",d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"})})};import{useState as B9}from"react";import{focusNearestParent as F9,KEYS as O9}from"@orangecatai/common";import{jsx as Gk,jsxs as z9}from"react/jsx-runtime";var $k=e=>{let{id:t}=St(),[o,n]=B9(e.value),r=i=>{e.ignoreFocus||F9(i.target);let s=i.target.value;s!==e.value&&e.onChange(s)},a=i=>{if(i.key===O9.ENTER){if(i.preventDefault(),i.nativeEvent.isComposing||i.keyCode===229)return;i.currentTarget.blur()}};return z9("div",{className:"ProjectName",children:[Gk("label",{className:"ProjectName-label",htmlFor:"filename",children:`${e.label}:`}),Gk("input",{type:"text",className:"TextInput",onBlur:r,onKeyDown:a,id:`${t}-filename`,value:o,onChange:i=>n(i.target.value)})]})};import{DEFAULT_EXPORT_PADDING as gB,DEFAULT_FILENAME as hB,IMAGE_MIME_TYPES as iC,isFirefox as fB,MIME_TYPES as bB,cloneJSON as xB,SVG_DOCUMENT_PREAMBLE as yB}from"@orangecatai/common";import{getNonDeletedElements as wB}from"@orangecatai/element";import{isFrameLikeElement as vB}from"@orangecatai/element";import{getElementsOverlappingFrame as EB}from"@orangecatai/element";import{ALLOWED_PASTE_MIME_TYPES as q9,EXPORT_DATA_TYPES as tm,MIME_TYPES as yn,arrayToMap as J9,isMemberOf as Q9,isPromiseLike as eB,EVENT as Ku}from"@orangecatai/common";import{mutateElement as tB}from"@orangecatai/element";import{deepCopyElement as oB}from"@orangecatai/element";import{isFrameLikeElement as nB,isInitializedImageElement as rB}from"@orangecatai/element";import{getContainingFrame as eC}from"@orangecatai/element";import{pointFrom as ri}from"@orangecatai/math";import{COLOR_PALETTE as Wk,DEFAULT_CHART_COLOR_INDEX as U9,getAllColorsSpecificShade as H9,DEFAULT_FONT_FAMILY as G9,DEFAULT_FONT_SIZE as Kk,VERTICAL_ALIGN as $9,randomId as Yk,isDevEnv as Xk,FONT_SIZES as V9}from"@orangecatai/common";import{newTextElement as Vu,newLinearElement as em,newElement as ox}from"@orangecatai/element";var dr=32,It=12,ai=256,jk=50,hs="NOT_SPREADSHEET",Wl="VALID_SPREADSHEET",Qd=e=>{let t=/^([-+]?)[$€£¥₩]?([-+]?)([\d.,]+)[%]?$/.exec(e);return t?parseFloat(`${(t[1]||t[2])+t[3]}`.replace(/,/g,"")):null},tx=(e,t)=>e.slice(1).every(o=>Qd(o[t])!==null),Vk=e=>{let t=e[0].length;if(t>2)return{type:hs,reason:"More than 2 columns"};if(t===1){if(!tx(e,0))return{type:hs,reason:"Value is not numeric"};let l=Qd(e[0][0])===null,c=(l?e.slice(1):e).map(m=>Qd(m[0]));return c.length<2?{type:hs,reason:"Less than two rows"}:{type:Wl,spreadsheet:{title:l?e[0][0]:null,labels:null,values:c}}}let o=tx(e,0),n=tx(e,1);if(!o&&!n)return{type:hs,reason:"Value is not numeric"};let[r,a]=n?[0,1]:[1,0],i=Qd(e[0][a])===null,s=i?e.slice(1):e;return s.length<2?{type:hs,reason:"Less than 2 rows"}:{type:Wl,spreadsheet:{title:i?e[0][a]:null,labels:s.map(l=>l[r]),values:s.map(l=>Qd(l[a]))}}},W9=e=>{let t=[];for(let o=0;o<e[0].length;o++){let n=[];for(let r=0;r<e.length;r++)n.push(e[r][o]);t.push(n)}return t},Zk=e=>{let t=e.trim().split(`
2
2
  `).map(a=>a.trim().split(" "));if(t.length&&t[0].length!==2&&(t=e.trim().split(`
3
3
  `).map(a=>a.trim().split(","))),t.length===0)return{type:hs,reason:"No values"};let o=t[0].length;if(!t.every(a=>a.length===o))return{type:hs,reason:"All rows don't have same number of columns"};let r=Vk(t);if(r.type!==Wl){let a=Vk(W9(t));if(a.type===Wl)return a}return r},Wu=H9(U9),Hn={fillStyle:"hachure",fontFamily:G9,fontSize:Kk,opacity:100,roughness:1,strokeColor:Wk.black,roundness:null,strokeStyle:"solid",strokeWidth:1,verticalAlign:$9.MIDDLE,locked:!1},qk=e=>{let t=(dr+It)*e.values.length+It,o=ai+It*2;return{chartWidth:t,chartHeight:o}},K9=(e,t,o,n,r)=>e.labels?.map((a,i)=>Vu({groupIds:[n],backgroundColor:r,...Hn,text:a.length>8?`${a.slice(0,5)}...`:a,x:t+i*(dr+It)+It*2,y:o+It/2,width:dr,angle:5.87,fontSize:V9.sm,textAlign:"center",verticalAlign:"top"}))||[],Y9=(e,t,o,n,r)=>{let a=Vu({groupIds:[n],backgroundColor:r,...Hn,x:t-It,y:o-It,text:"0",textAlign:"right"}),i=Vu({groupIds:[n],backgroundColor:r,...Hn,x:t-It,y:o-ai-a.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:"right"});return[a,i]},X9=(e,t,o,n,r)=>{let{chartWidth:a,chartHeight:i}=qk(e),s=em({backgroundColor:r,groupIds:[n],...Hn,type:"line",x:t,y:o,width:a,points:[ri(0,0),ri(a,0)]}),l=em({backgroundColor:r,groupIds:[n],...Hn,type:"line",x:t,y:o,height:i,points:[ri(0,0),ri(0,-i)]}),c=em({backgroundColor:r,groupIds:[n],...Hn,type:"line",x:t,y:o-ai-It,strokeStyle:"dotted",width:a,opacity:jk,points:[ri(0,0),ri(a,0)]});return[s,l,c]},Jk=(e,t,o,n,r,a)=>{let{chartWidth:i,chartHeight:s}=qk(e),l=e.title?Vu({backgroundColor:r,groupIds:[n],...Hn,text:e.title,x:t+i/2,y:o-ai-It*2-Kk,roundness:null,textAlign:"center"}):null,c=a?ox({backgroundColor:r,groupIds:[n],...Hn,type:"rectangle",x:t,y:o-s,width:i,height:s,strokeColor:Wk.black,fillStyle:"solid",opacity:6}):null;return[...c?[c]:[],...l?[l]:[],...K9(e,t,o,n,r),...Y9(e,t,o,n,r),...X9(e,t,o,n,r)]},j9=(e,t,o)=>{let n=Math.max(...e.values),r=Yk(),a=Wu[Math.floor(Math.random()*Wu.length)];return[...e.values.map((s,l)=>{let c=s/n*ai;return ox({backgroundColor:a,groupIds:[r],...Hn,type:"rectangle",x:t+l*(dr+It)+It,y:o-c-It,width:dr,height:c})}),...Jk(e,t,o,r,a,Xk())]},Z9=(e,t,o)=>{let n=Math.max(...e.values),r=Yk(),a=Wu[Math.floor(Math.random()*Wu.length)],i=0,s=[];for(let g of e.values){let f=i*(dr+It),w=-(g/n)*ai;s.push([f,w]),i++}let l=Math.max(...s.map(g=>g[0])),c=Math.max(...s.map(g=>g[1])),m=Math.min(...s.map(g=>g[0])),p=Math.min(...s.map(g=>g[1])),d=em({backgroundColor:a,groupIds:[r],...Hn,type:"line",x:t+It+dr/2,y:o-It,height:c-p,width:l-m,strokeWidth:2,points:s}),u=e.values.map((g,f)=>{let w=f*(dr+It)+It/2,y=-(g/n)*ai+It/2;return ox({backgroundColor:a,groupIds:[r],...Hn,fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+w+dr/2,y:o+y-It*2,width:It,height:It})}),h=e.values.map((g,f)=>{let w=f*(dr+It)+It/2,y=g/n*ai+It/2+It;return em({backgroundColor:a,groupIds:[r],...Hn,type:"line",x:t+w+dr/2+It/2,y:o-y,height:y,strokeStyle:"dotted",opacity:jk,points:[ri(0,0),ri(0,y)]})});return[...Jk(e,t,o,r,a,Xk()),d,...h,...u]},Qk=(e,t,o,n)=>e==="line"?Z9(t,o,n):j9(t,o,n);var ofe="clipboard"in navigator&&"readText"in navigator.clipboard,Yu="clipboard"in navigator&&"writeText"in navigator.clipboard,Kl="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,aB=e=>!!([tm.excalidraw,tm.excalidrawClipboard,tm.excalidrawClipboardWithAPI].includes(e?.type)&&Array.isArray(e.elements)),tC=({types:e,files:t})=>{!e&&!t&&console.warn("createPasteEvent: no types or files provided");let o=new ClipboardEvent(Ku.PASTE,{clipboardData:new DataTransfer});if(e)for(let[n,r]of Object.entries(e)){if(typeof r!="string"){t=t||[],t.push(r);continue}try{if(o.clipboardData?.items.add(r,n),o.clipboardData?.getData(n)!==r)throw new Error(`Failed to set "${n}" as clipboardData item`)}catch(a){throw new Error(a.message)}}if(t){let n=-1;for(let r of t){n++;try{if(o.clipboardData?.items.add(r),o.clipboardData?.files[n]!==r)throw new Error(`Failed to set file "${r.name}" as clipboardData item`)}catch(a){throw new Error(a.message)}}}return o},iB=({elements:e,files:t})=>{let o=J9(e),n=new Set(e.filter(s=>nB(s))),r=!1,a=e.reduce((s,l)=>(rB(l)&&(r=!0,t&&t[l.fileId]&&(s[l.fileId]=t[l.fileId])),s),{});r&&!t&&console.warn("copyToClipboard: attempting to file element(s) without providing associated `files` object.");let i={type:tm.excalidrawClipboard,elements:e.map(s=>{if(eC(s,o)&&!n.has(eC(s,o))){let l=oB(s);return tB(l,o,{frameId:null}),l}return s}),files:t?a:void 0};return JSON.stringify(i)},Xu=async(e,t,o)=>{let n=iB({elements:e,files:t});await mr({[yn.excalidrawClipboard]:n,[yn.text]:n},o)},sB=e=>{let t=Zk(e);return t.type===Wl?{spreadsheet:t.spreadsheet}:null};function oC(e){let t=[];for(let o of e.childNodes)if(o.nodeType===3){let n=o.textContent?.trim();n&&t.push({type:"text",value:n})}else if(o instanceof HTMLImageElement){let n=o.getAttribute("src");n&&n.startsWith("http")&&t.push({type:"imageUrl",value:n})}else t=t.concat(oC(o));return t}var lB=e=>{let t=e.value;try{let o=new DOMParser().parseFromString(t,yn.html),n=oC(o.body);if(n.length)return{type:"mixedContent",value:n}}catch(o){console.error(`error in parseHTMLFromPaste: ${o.message}`)}return null},nC=async()=>{let e={},t;try{t=await navigator.clipboard?.read()}catch(o){try{if(navigator.clipboard?.readText){console.warn(`navigator.clipboard.readText() failed (${o.message}). Failling back to navigator.clipboard.read()`);let n=await navigator.clipboard?.readText();if(n)return{[yn.text]:n}}}catch(n){if(navigator.clipboard?.read)console.warn(`navigator.clipboard.readText() failed (${n.message}). Failling back to navigator.clipboard.read()`);else{if(n.name==="DataError")return console.warn(`navigator.clipboard.read() error, clipboard is probably empty: ${n.message}`),e;throw n}}throw o}for(let o of t)for(let n of o.types)if(Q9(q9,n))try{if(n===yn.text||n===yn.html)e[n]=await(await o.getType(n)).text();else if(s2(n)){let r=await o.getType(n),a=g2(r,n,void 0);e[n]=a}else throw new Sb(`Unsupported clipboard type: ${n}`)}catch(r){console.warn(r instanceof Sb?r.message:`Cannot retrieve ${n} from clipboardItem: ${r.message}`)}return Object.keys(e).length===0&&console.warn("No clipboard data found from clipboard.read()."),e},cB=async(e,t=!1)=>{try{let o=e.findByType(yn.html),n=!t&&o&&lB(o);return n?n.value.every(r=>r.type==="text")?{type:"text",value:e.getData(yn.text)??n.value.map(r=>r.value).join(`
4
- `).trim()}:n:{type:"text",value:(e.getData(yn.text)||"").trim()}}catch{return{type:"text",value:""}}},dB=function(e){return this.find(t=>t.type===e)||null},mB=function(e){return this.find(o=>o.type===e)?.value??null},pB=function(){return this.filter(e=>e.kind==="file")},rC=e=>{let t;aC(e)?t=e.clipboardData?.items:t=e.dataTransfer?.items;let o=new Set;for(let n of Array.from(t||[]))o.has(n.type)||o.add(n.type);return o},Yl=async e=>{let t;aC(e)?t=e.clipboardData?.items:t=e.dataTransfer?.items;let o=(await Promise.all(Array.from(t||[]).map(async n=>{if(n.kind==="file"){let r=n.getAsFile();if(r){let a=await u2(n);return r=await Cd(r),{type:r.type,kind:"file",file:r,fileHandle:a}}}else if(n.kind==="string"){let{type:r}=n,a;return"clipboardData"in e&&e.clipboardData?a=e.clipboardData?.getData(r):a=await new Promise(i=>{n.getAsString(s=>i(s))}),{type:r,kind:"string",value:a}}return null}))).filter(n=>n!=null);return Object.assign(o,{findByType:dB,getData:mB,getFiles:pB})},ju=async(e,t=!1)=>{let o=await cB(e,t);if(o.type==="mixedContent")return{mixedContent:o.value};try{let n=!t&&sB(o.value);if(n)return n}catch(n){console.error(n)}try{let n=JSON.parse(o.value),r=n.type===tm.excalidrawClipboardWithAPI;if(aB(n))return{elements:n.elements,files:n.files,text:t?JSON.stringify(n.elements,null,2):void 0,programmaticAPI:r}}catch{}return{text:o.value}},Zu=async e=>{try{await navigator.clipboard.write([new ClipboardItem({[yn.png]:e})])}catch(t){if(eB(e))await navigator.clipboard.write([new ClipboardItem({[yn.png]:await e})]);else throw t}},mr=async(e,t)=>{e=e||"";let o=Object.entries(typeof e=="string"?{[yn.text]:e}:e);try{if(t){for(let[r,a]of o)if(t.clipboardData?.setData(r,a),t.clipboardData?.getData(r)!==a)throw new Error("Failed to setData on clipboardEvent");return}}catch(r){console.error(r)}let n=o.find(([r])=>r===yn.text);if(Yu&&n)try{await navigator.clipboard.writeText(n[1]);return}catch(r){console.error(r)}if(n&&!uB(n[1]))throw new Error("Error copying to clipboard.")},uB=e=>{e||(e=" ");let t=document.documentElement.getAttribute("dir")==="rtl",o=document.createElement("textarea");o.style.border="0",o.style.padding="0",o.style.margin="0",o.style.position="absolute",o.style[t?"right":"left"]="-9999px";let n=window.pageYOffset||document.documentElement.scrollTop;o.style.top=`${n}px`,o.style.fontSize="12pt",o.setAttribute("readonly",""),o.value=e,document.body.appendChild(o);let r=!1;try{o.select(),o.setSelectionRange(0,o.value.length),r=document.execCommand("copy")}catch(a){console.error(a)}return o.remove(),r},aC=e=>e.type===Ku.PASTE||e.type===Ku.COPY||e.type===Ku.CUT;var fs=(e,{selectedElementIds:t},o)=>{e=wB(e);let n=o&&ft(e,{selectedElementIds:t}),r=null,a=n?Me(e,{selectedElementIds:t},{includeBoundTextElement:!0}):e;return n&&(a.length===1&&vB(a[0])?(r=a[0],a=EB(e,r)):a.length>1&&(a=Me(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}))),{exportingFrame:r,exportedElements:xB(a)}},bs=async(e,t,o,n,{exportBackground:r,exportPadding:a=gB,viewBackgroundColor:i,name:s=o.name||hB,fileHandle:l=null,exportingFrame:c=null})=>{if(t.length===0)throw new Error(b("alerts.cannotExportEmptyCanvas"));if(e==="svg"||e==="clipboard-svg"){let p=sl(t,{exportBackground:r,exportWithDarkMode:o.exportWithDarkMode,viewBackgroundColor:i,exportPadding:a,exportScale:o.exportScale,exportEmbedScene:o.exportEmbedScene&&e==="svg"},n,{exportingFrame:c});if(e==="svg")return Mb(p.then(d=>new Blob([yB+d.outerHTML],{type:bB.svg})),{description:"Export to SVG",name:s,extension:o.exportEmbedScene?"excalidraw.svg":"svg",mimeTypes:[iC.svg],fileHandle:l});if(e==="clipboard-svg"){let d=await p.then(u=>u.outerHTML);try{await mr(d)}catch{throw new Error(b("errors.copyToSystemClipboardFailed"))}return}}let m=Wa(t,o,n,{exportBackground:r,viewBackgroundColor:i,exportPadding:a,exportingFrame:c});if(e==="png"){let p=as(m);return o.exportEmbedScene&&(p=p.then(d=>import("./data/image-EQCUXFMW.js").then(({encodePngMetadata:u})=>u({blob:d,metadata:Ed(t,o,n,"local")})))),Mb(p,{description:"Export to PNG",name:s,extension:o.exportEmbedScene?"excalidraw.png":"png",mimeTypes:[iC.png],fileHandle:l})}else if(e==="clipboard")try{let p=as(m);await Zu(p)}catch(p){throw console.warn(p),p.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(b("canvasError.canvasTooBig")):fB&&p.name==="TypeError"?new Error(`${b("alerts.couldNotCopyToClipboard")}
4
+ `).trim()}:n:{type:"text",value:(e.getData(yn.text)||"").trim()}}catch{return{type:"text",value:""}}},dB=function(e){return this.find(t=>t.type===e)||null},mB=function(e){return this.find(o=>o.type===e)?.value??null},pB=function(){return this.filter(e=>e.kind==="file")},rC=e=>{let t;aC(e)?t=e.clipboardData?.items:t=e.dataTransfer?.items;let o=new Set;for(let n of Array.from(t||[]))o.has(n.type)||o.add(n.type);return o},Yl=async e=>{let t;aC(e)?t=e.clipboardData?.items:t=e.dataTransfer?.items;let o=(await Promise.all(Array.from(t||[]).map(async n=>{if(n.kind==="file"){let r=n.getAsFile();if(r){let a=await u2(n);return r=await Cd(r),{type:r.type,kind:"file",file:r,fileHandle:a}}}else if(n.kind==="string"){let{type:r}=n,a;return"clipboardData"in e&&e.clipboardData?a=e.clipboardData?.getData(r):a=await new Promise(i=>{n.getAsString(s=>i(s))}),{type:r,kind:"string",value:a}}return null}))).filter(n=>n!=null);return Object.assign(o,{findByType:dB,getData:mB,getFiles:pB})},ju=async(e,t=!1)=>{let o=await cB(e,t);if(o.type==="mixedContent")return{mixedContent:o.value};try{let n=!t&&sB(o.value);if(n)return n}catch(n){console.error(n)}try{let n=JSON.parse(o.value),r=n.type===tm.excalidrawClipboardWithAPI;if(aB(n))return{elements:n.elements,files:n.files,text:t?JSON.stringify(n.elements,null,2):void 0,programmaticAPI:r}}catch{}return{text:o.value}},Zu=async e=>{try{await navigator.clipboard.write([new ClipboardItem({[yn.png]:e})])}catch(t){if(eB(e))await navigator.clipboard.write([new ClipboardItem({[yn.png]:await e})]);else throw t}},mr=async(e,t)=>{e=e||"";let o=Object.entries(typeof e=="string"?{[yn.text]:e}:e);try{if(t){for(let[r,a]of o)if(t.clipboardData?.setData(r,a),t.clipboardData?.getData(r)!==a)throw new Error("Failed to setData on clipboardEvent");return}}catch(r){console.error(r)}let n=o.find(([r])=>r===yn.text);if(Yu&&n)try{await navigator.clipboard.writeText(n[1]);return}catch(r){console.error(r)}if(n&&!uB(n[1]))throw new Error("Error copying to clipboard.")},uB=e=>{e||(e=" ");let t=document.documentElement.getAttribute("dir")==="rtl",o=document.createElement("textarea");o.style.border="0",o.style.padding="0",o.style.margin="0",o.style.position="absolute",o.style[t?"right":"left"]="-9999px";let n=window.pageYOffset||document.documentElement.scrollTop;o.style.top=`${n}px`,o.style.fontSize="12pt",o.setAttribute("readonly",""),o.value=e,document.body.appendChild(o);let r=!1;try{o.select(),o.setSelectionRange(0,o.value.length),r=document.execCommand("copy")}catch(a){console.error(a)}return o.remove(),r},aC=e=>e.type===Ku.PASTE||e.type===Ku.COPY||e.type===Ku.CUT;var fs=(e,{selectedElementIds:t},o)=>{e=wB(e);let n=o&&ft(e,{selectedElementIds:t}),r=null,a=n?Me(e,{selectedElementIds:t},{includeBoundTextElement:!0}):e;return n&&(a.length===1&&vB(a[0])?(r=a[0],a=EB(e,r)):a.length>1&&(a=Me(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}))),{exportingFrame:r,exportedElements:xB(a)}},bs=async(e,t,o,n,{exportBackground:r,exportPadding:a=gB,viewBackgroundColor:i,name:s=o.name||hB,fileHandle:l=null,exportingFrame:c=null})=>{if(t.length===0)throw new Error(b("alerts.cannotExportEmptyCanvas"));if(e==="svg"||e==="clipboard-svg"){let p=sl(t,{exportBackground:r,exportWithDarkMode:o.exportWithDarkMode,viewBackgroundColor:i,exportPadding:a,exportScale:o.exportScale,exportEmbedScene:o.exportEmbedScene&&e==="svg"},n,{exportingFrame:c});if(e==="svg")return Mb(p.then(d=>new Blob([yB+d.outerHTML],{type:bB.svg})),{description:"Export to SVG",name:s,extension:o.exportEmbedScene?"excalidraw.svg":"svg",mimeTypes:[iC.svg],fileHandle:l});if(e==="clipboard-svg"){let d=await p.then(u=>u.outerHTML);try{await mr(d)}catch{throw new Error(b("errors.copyToSystemClipboardFailed"))}return}}let m=Wa(t,o,n,{exportBackground:r,viewBackgroundColor:i,exportPadding:a,exportingFrame:c});if(e==="png"){let p=as(m);return o.exportEmbedScene&&(p=p.then(d=>import("./data/image-I3FR2Q7R.js").then(({encodePngMetadata:u})=>u({blob:d,metadata:Ed(t,o,n,"local")})))),Mb(p,{description:"Export to PNG",name:s,extension:o.exportEmbedScene?"excalidraw.png":"png",mimeTypes:[iC.png],fileHandle:l})}else if(e==="clipboard")try{let p=as(m);await Zu(p)}catch(p){throw console.warn(p),p.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(b("canvasError.canvasTooBig")):fB&&p.name==="TypeError"?new Error(`${b("alerts.couldNotCopyToClipboard")}
5
5
 
6
6
  ${b("hints.firefox_clipboard_write")}`):new Error(b("alerts.couldNotCopyToClipboard"))}else throw new Error("Unsupported export type")};var sC=async(e,t,o,n)=>{let{exportBackground:r,viewBackgroundColor:a,fileHandle:i}=t,s=a2(i);if(!i||!i2(s))throw new Error("fileHandle should exist and should be of type svg or png when resaving");t={...t,exportEmbedScene:!0};let{exportedElements:l,exportingFrame:c}=fs(e,t,!1);return await bs(s,l,t,o,{exportBackground:r,viewBackgroundColor:a,name:n,fileHandle:i,exportingFrame:c}),{fileHandle:i}};import{Fragment as SB,jsx as ha,jsxs as MB}from"react/jsx-runtime";var rx=X({name:"changeProjectName",label:"labels.fileTitle",trackEvent:!1,perform:(e,t,o)=>({appState:{...t,name:o},captureUpdate:pr.EVENTUALLY}),PanelComponent:({appState:e,updateData:t,appProps:o,data:n,app:r})=>ha($k,{label:b("labels.fileTitle"),value:r.getName(),onChange:a=>t(a),ignoreFocus:n?.ignoreFocus??!1})}),lC=X({name:"changeExportScale",label:"imageExportDialog.scale",trackEvent:{category:"export",action:"scale"},perform:(e,t,o)=>({appState:{...t,exportScale:o},captureUpdate:pr.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:o})=>{let n=kB(e),a=ft(n,t)?Me(n,t):n;return ha(SB,{children:TB.map(i=>{let[s,l]=n2(a,IB,i),c=`${b("imageExportDialog.label.scale")} ${i}x (${s}x${l})`;return ha(be,{size:"small",type:"radio",icon:`${i}x`,name:"export-canvas-scale",title:c,"aria-label":c,id:"export-canvas-scale",checked:i===t.exportScale,onChange:()=>o(i)},i)})})}}),ax=X({name:"changeExportBackground",label:"imageExportDialog.label.withBackground",trackEvent:{category:"export",action:"toggleBackground"},perform:(e,t,o)=>({appState:{...t,exportBackground:o},captureUpdate:pr.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>ha(Zd,{checked:e.exportBackground,onChange:o=>t(o),children:b("imageExportDialog.label.withBackground")})}),qu=X({name:"changeExportEmbedScene",label:"imageExportDialog.tooltip.embedScene",trackEvent:{category:"export",action:"embedScene"},perform:(e,t,o)=>({appState:{...t,exportEmbedScene:o},captureUpdate:pr.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>MB(Zd,{checked:e.exportEmbedScene,onChange:o=>t(o),children:[b("imageExportDialog.label.embedScene"),ha(Fo,{label:b("imageExportDialog.tooltip.embedScene"),long:!0,children:ha("div",{className:"excalidraw-tooltip-icon",children:H2})})]})}),xs=X({name:"saveToActiveFile",label:"buttons.save",icon:ls,trackEvent:{category:"export"},predicate:(e,t,o,n)=>!!n.props.UIOptions.canvasActions.saveToActiveFile&&!!t.fileHandle&&!t.viewModeEnabled,perform:async(e,t,o,n)=>{let r=!!t.fileHandle;try{let{fileHandle:a}=Xp(t.fileHandle)?await sC(e,t,n.files,n.getName()):await Vp(e,t,n.files,n.getName());return{captureUpdate:pr.EVENTUALLY,appState:{...t,fileHandle:a,toast:r?{message:a?.name?b("toast.fileSavedToFilename").replace("{filename}",`"${a.name}"`):b("toast.fileSaved")}:null}}}catch(a){return a?.name!=="AbortError"?console.error(a):console.warn(a),{captureUpdate:pr.EVENTUALLY}}},keyTest:e=>e.key===Xl.S&&e[Xl.CTRL_OR_CMD]&&!e.shiftKey}),om=X({name:"saveFileToDisk",label:"exportDialog.disk_title",icon:ls,viewMode:!0,trackEvent:{category:"export"},perform:async(e,t,o,n)=>{try{let{fileHandle:r}=await Vp(e,{...t,fileHandle:null},n.files,n.getName());return{captureUpdate:pr.EVENTUALLY,appState:{...t,openDialog:null,fileHandle:r,toast:{message:b("toast.fileSaved")}}}}catch(r){return r?.name!=="AbortError"?console.error(r):console.warn(r),{captureUpdate:pr.EVENTUALLY}}},keyTest:e=>e.key===Xl.S&&e.shiftKey&&e[Xl.CTRL_OR_CMD],PanelComponent:({updateData:e})=>ha(be,{type:"button",icon:F2,title:b("buttons.saveAs"),"aria-label":b("buttons.saveAs"),showAriaLabel:qe().formFactor==="phone",hidden:!al,onClick:()=>e(null),"data-testid":"save-as-button"})}),jl=X({name:"loadScene",label:"buttons.load",trackEvent:{category:"export"},predicate:(e,t,o,n)=>!!n.props.UIOptions.canvasActions.loadScene&&!t.viewModeEnabled,perform:async(e,t,o,n)=>{try{let r=await il({description:"Excalidraw or video files"});if(Ka(r)){let l=t.width/2+t.offsetLeft,c=t.height/2+t.offsetTop,{x:m,y:p}=CB({clientX:l,clientY:c},t);return await n.insertVideos([r],m,p),!1}let{elements:a,appState:i,files:s}=await cl(r,t,e,r.handle??null);return{elements:a,appState:i,files:s,captureUpdate:pr.IMMEDIATELY}}catch(r){return r?.name==="AbortError"?(console.warn(r),!1):{elements:e,appState:{...t,errorMessage:r.message},files:n.files,captureUpdate:pr.EVENTUALLY}}},keyTest:e=>e[Xl.CTRL_OR_CMD]&&e.key===Xl.O}),cC=X({name:"exportWithDarkMode",label:"imageExportDialog.label.darkMode",trackEvent:{category:"export",action:"toggleTheme"},perform:(e,t,o)=>({appState:{...t,exportWithDarkMode:o},captureUpdate:pr.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>ha("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:ha(Hk,{value:e.exportWithDarkMode?nx.DARK:nx.LIGHT,onChange:o=>{t(o===nx.DARK)},title:b("imageExportDialog.label.darkMode")})})});import{DEFAULT_FONT_SIZE as PB,DEFAULT_FONT_FAMILY as AB,DEFAULT_TEXT_ALIGN as LB,CODES as dC,KEYS as mC,getLineHeight as _B}from"@orangecatai/common";import{newElementWith as Ju}from"@orangecatai/element";import{hasBoundTextElement as DB,canApplyRoundnessTypeToElement as RB,getDefaultRoundnessTypeForElement as NB,isFrameLikeElement as BB,isArrowElement as FB,isExcalidrawElement as OB,isTextElement as ix}from"@orangecatai/element";import{getBoundTextElement as zB,redrawTextBoundingBox as UB}from"@orangecatai/element";import{CaptureUpdateAction as sx}from"@orangecatai/element";var pC="{}",lx=X({name:"copyStyles",label:"labels.copyStyles",icon:t0,trackEvent:{category:"element"},perform:(e,t,o,n)=>{let r=[],a=e.find(i=>t.selectedElementIds[i.id]);if(r.push(a),a&&DB(a)){let i=zB(a,n.scene.getNonDeletedElementsMap());r.push(i)}return a&&(pC=JSON.stringify(r)),{appState:{...t,toast:{message:b("toast.copyStyles")}},captureUpdate:sx.EVENTUALLY}},keyTest:e=>e[mC.CTRL_OR_CMD]&&e.altKey&&e.code===dC.C}),cx=X({name:"pasteStyles",label:"labels.pasteStyles",icon:t0,trackEvent:{category:"element"},perform:(e,t,o,n)=>{let r=JSON.parse(pC),a=r[0],i=r[1];if(!OB(a))return{elements:e,captureUpdate:sx.EVENTUALLY};let s=Me(e,t,{includeBoundTextElement:!0}),l=s.map(c=>c.id);return{elements:e.map(c=>{if(l.includes(c.id)){let m=a;if(ix(c)&&c.containerId&&(m=i),!m)return c;let p=Ju(c,{backgroundColor:m?.backgroundColor,strokeWidth:m?.strokeWidth,strokeColor:m?.strokeColor,strokeStyle:m?.strokeStyle,fillStyle:m?.fillStyle,opacity:m?.opacity,roughness:m?.roughness,roundness:m.roundness?RB(m.roundness.type,c)?m.roundness:NB(c):null});if(ix(p)){let d=m.fontSize||PB,u=m.fontFamily||AB;p=Ju(p,{fontSize:d,fontFamily:u,textAlign:m.textAlign||LB,lineHeight:m.lineHeight||_B(u)});let h=null;p.containerId&&(h=s.find(g=>ix(p)&&g.id===p.containerId)||null),UB(p,h,n.scene)}return p.type==="arrow"&&FB(m)&&(p=Ju(p,{startArrowhead:m.startArrowhead,endArrowhead:m.endArrowhead})),BB(c)&&(p=Ju(p,{roundness:null,backgroundColor:"transparent"})),p}return c}),captureUpdate:sx.IMMEDIATELY}},keyTest:e=>e[mC.CTRL_OR_CMD]&&e.altKey&&e.code===dC.V});import{KEYS as HB}from"@orangecatai/common";import{CaptureUpdateAction as GB}from"@orangecatai/element";var ys=X({name:"toggleShortcuts",label:"welcomeScreen.defaults.helpHint",icon:D2,viewMode:!0,trackEvent:{category:"menu",action:"toggleHelpDialog"},perform:(e,t,o,{focusContainer:n})=>(t.openDialog?.name==="help"&&n(),{appState:{...t,openDialog:t.openDialog?.name==="help"?null:{name:"help"},openMenu:null,openPopup:null},captureUpdate:GB.EVENTUALLY}),keyTest:e=>e.key===HB.QUESTION_MARK});import{getNonDeletedElements as eg}from"@orangecatai/element";import{newElementWith as hC}from"@orangecatai/element";import{isBoundToContainer as $B}from"@orangecatai/element";import{frameAndChildrenSelectedTogether as VB,getElementsInResizingFrame as WB,getFrameLikeElements as KB,getRootElements as YB,groupByFrameLikes as XB,removeElementsFromFrame as jB,replaceAllElementsInFrame as ZB}from"@orangecatai/element";import{KEYS as tg,randomId as qB,arrayToMap as dx}from"@orangecatai/common";import{getSelectedGroupIds as Qu,selectGroup as JB,selectGroupsForSelectedElements as QB,getElementsInGroup as uC,addToGroup as eF,removeFromSelectedGroups as tF,isElementInGroup as fC}from"@orangecatai/element";import{syncMovedIndices as oF}from"@orangecatai/element";import{CaptureUpdateAction as nm}from"@orangecatai/element";import{jsx as Zl}from"react/jsx-runtime";var nF=e=>{if(e.length>=2){let t=e[0].groupIds;for(let o of t)if(e.reduce((n,r)=>n&&fC(r,o),!0))return!0}return!1},gC=(e,t,o)=>{let n=o.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});return n.length>=2&&!nF(n)&&!VB(n)},mx=X({name:"group",label:"labels.group",icon:e=>Zl(Zb,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,o,n)=>{let r=YB(n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}));if(r.length<2)return{appState:t,elements:e,captureUpdate:nm.EVENTUALLY};let a=Qu(t);if(a.length===1){let f=a[0],w=new Set(uC(e,f).map(E=>E.id)),y=new Set(r.map(E=>E.id));if(new Set([...Array.from(w),...Array.from(y)]).size===w.size)return{appState:t,elements:e,captureUpdate:nm.EVENTUALLY}}let i=[...e];new Set(r.map(f=>f.frameId)).size>1&&XB(r).forEach((w,y)=>{jB(w,n.scene.getNonDeletedElementsMap())});let l=qB(),c=dx(r);i=i.map(f=>c.get(f.id)?hC(f,{groupIds:eF(f.groupIds,l,t.editingGroupId)}):f);let m=uC(i,l),p=m[m.length-1],d=i.lastIndexOf(p),u=i.slice(d+1),h=i.slice(0,d).filter(f=>!fC(f,l)),g=oF([...h,...m,...u],dx(m));return{appState:{...t,...JB(l,{...t,selectedGroupIds:{}},eg(i))},elements:g,captureUpdate:nm.IMMEDIATELY}},predicate:(e,t,o,n)=>gC(e,t,n),keyTest:e=>!e.shiftKey&&e[tg.CTRL_OR_CMD]&&e.key===tg.G,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>Zl(be,{hidden:!gC(e,t,n),type:"button",icon:Zl(Zb,{theme:t.theme}),onClick:()=>o(null),title:`${b("labels.group")} \u2014 ${V("CtrlOrCmd+G")}`,"aria-label":b("labels.group"),visible:ft(eg(e),t)})}),px=X({name:"ungroup",label:"labels.ungroup",icon:e=>Zl(qb,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,o,n)=>{let r=Qu(t),a=dx(e);if(r.length===0)return{appState:t,elements:e,captureUpdate:nm.EVENTUALLY};let i=[...e],s=[];i=i.map(d=>{$B(d)&&s.push(d.id);let u=tF(d.groupIds,t.selectedGroupIds);return u.length===d.groupIds.length?d:hC(d,{groupIds:u})});let l=QB(t,eg(i),t,null),c=n.scene.getSelectedElements(t),m=new Set(c.filter(d=>d.frameId).map(d=>d.frameId));return KB(e).filter(d=>m.has(d.id)).forEach(d=>{d&&(i=ZB(i,WB(i,d,t,a),d,n))}),l.selectedElementIds=Object.entries(l.selectedElementIds).reduce((d,[u,h])=>(h&&!s.includes(u)&&(d[u]=!0),d),{}),{appState:{...t,...l},elements:i,captureUpdate:nm.IMMEDIATELY}},keyTest:e=>e.shiftKey&&e[tg.CTRL_OR_CMD]&&e.key===tg.G.toUpperCase(),predicate:(e,t)=>Qu(t).length>0,PanelComponent:({elements:e,appState:t,updateData:o})=>Zl(be,{type:"button",hidden:Qu(t).length===0,icon:Zl(qb,{theme:t.theme}),onClick:()=>o(null),title:`${b("labels.ungroup")} \u2014 ${V("CtrlOrCmd+Shift+G")}`,"aria-label":b("labels.ungroup"),visible:ft(eg(e),t)})});import dF from"clsx";import{CaptureUpdateAction as vC}from"@orangecatai/element";import{invariant as mF}from"@orangecatai/common";import{COLOR_CHARCOAL_BLACK as rF,COLOR_VOICE_CALL as aF,COLOR_WHITE as ng,THEME as iF,UserIdleState as bC}from"@orangecatai/common";var og=(e,t,o,n,r,a,i)=>{e.beginPath(),e.moveTo(t+a,o),e.lineTo(t+n-a,o),e.quadraticCurveTo(t+n,o,t+n,o+a),e.lineTo(t+n,o+r-a),e.quadraticCurveTo(t+n,o+r,t+n-a,o+r),e.lineTo(t+a,o+r),e.quadraticCurveTo(t,o+r,t,o+r-a),e.lineTo(t,o+a),e.quadraticCurveTo(t,o,t+a,o),e.closePath(),e.fill(),i&&(e.strokeStyle=i),e.stroke()};function sF(e){let t=0;if(e.length===0)return t;for(let o=0;o<e.length;o++){let n=e.charCodeAt(o);t=(t<<5)-t+n}return t}var ws=(e,t)=>`hsl(${Math.abs(sF(t?.id||e))%37*10}, 100%, 83%)`,xC=e=>{let t=e?.trim()?.codePointAt(0);return(t?String.fromCodePoint(t):"?").toUpperCase()},yC=({context:e,renderConfig:t,appState:o,normalizedWidth:n,normalizedHeight:r})=>{for(let[a,i]of t.remotePointerViewportCoords){let{x:s,y:l}=i,c=o.collaborators.get(a);s-=o.offsetLeft,l-=o.offsetTop;let m=11,p=14,d=s<0||s>n-m||l<0||l>r-p;s=Math.max(s,0),s=Math.min(s,n-m),l=Math.max(l,0),l=Math.min(l,r-p);let u=ws(a,c);e.save(),e.strokeStyle=u,e.fillStyle=u;let h=t.remotePointerUserStates.get(a),g=d||h===bC.IDLE||h===bC.AWAY;g&&(e.globalAlpha=.3),t.remotePointerButton.get(a)==="down"&&(e.beginPath(),e.arc(s,l,15,0,2*Math.PI,!1),e.lineWidth=3,e.strokeStyle="#ffffff88",e.stroke(),e.closePath(),e.beginPath(),e.arc(s,l,15,0,2*Math.PI,!1),e.lineWidth=1,e.strokeStyle=u,e.stroke(),e.closePath());let f=o.theme===iF.DARK?"#2f6330":aF,w=c?.isSpeaking;w&&(e.fillStyle=f,e.strokeStyle=f,e.lineWidth=10,e.lineJoin="round",e.beginPath(),e.moveTo(s,l),e.lineTo(s+0,l+14),e.lineTo(s+4,l+9),e.lineTo(s+11,l+8),e.closePath(),e.stroke(),e.fill()),e.fillStyle=ng,e.strokeStyle=ng,e.lineWidth=6,e.lineJoin="round",e.beginPath(),e.moveTo(s,l),e.lineTo(s+0,l+14),e.lineTo(s+4,l+9),e.lineTo(s+11,l+8),e.closePath(),e.stroke(),e.fill(),e.fillStyle=u,e.strokeStyle=u,e.lineWidth=2,e.lineJoin="round",e.beginPath(),g?(e.moveTo(s-1,l-1),e.lineTo(s-1,l+15),e.lineTo(s+5,l+10),e.lineTo(s+12,l+9),e.closePath(),e.fill()):(e.moveTo(s,l),e.lineTo(s+0,l+14),e.lineTo(s+4,l+9),e.lineTo(s+11,l+8),e.closePath(),e.fill(),e.stroke());let y=t.remotePointerUsernames.get(a)||"";if(!d&&y){e.font="600 12px sans-serif";let v=(w?s+0:s)+m/2,E=(w?l+0:l)+p+2,I=5,k=3,S=e.measureText(y),T=S.actualBoundingBoxDescent+S.actualBoundingBoxAscent,A=Math.max(T,12),R=v-1,M=E-1,P=S.width+2+I*2+2,F=A+2+k*2+2;if(e.roundRect?(e.beginPath(),e.roundRect(R,M,P,F,8),e.fillStyle=u,e.fill(),e.strokeStyle=ng,e.stroke(),w&&(e.beginPath(),e.roundRect(R-2,M-2,P+4,F+4,8),e.strokeStyle=f,e.stroke())):og(e,R,M,P,F,8,ng),e.fillStyle=rF,e.fillText(y,v+I+1,E+k+S.actualBoundingBoxAscent+Math.floor((A-T)/2)+2),w){e.fillStyle=f;let U=8,B=8,G=5;e.fillRect(R+P+B,M+(F/2-U/2),2,U),e.fillRect(R+P+B+G,M+(F/2-U*2/2),2,U*2),e.fillRect(R+P+B+G*2,M+(F/2-U/2),2,U)}}e.restore(),e.closePath()}};import lF from"clsx";import{useState as cF}from"react";import{jsx as wC}from"react/jsx-runtime";var ux=({color:e,onClick:t,name:o,src:n,className:r})=>{let a=xC(o),[i,s]=cF(!1),l=!i&&n,c=l?void 0:{background:e};return wC("div",{className:lF("Avatar",r),style:c,onClick:t,children:l?wC("img",{className:"Avatar-img",src:n,alt:a,referrerPolicy:"no-referrer",onError:()=>s(!0)}):a})};import{jsx as Br,jsxs as rg}from"react/jsx-runtime";var pF=X({name:"goToCollaborator",label:"Go to a collaborator",viewMode:!0,trackEvent:{category:"collab"},perform:(e,t,o)=>(mF(o,"actionGoToCollaborator: collaborator should be defined when actionGoToCollaborator is called"),!o.socketId||t.userToFollow?.socketId===o.socketId||o.isCurrentUser?{appState:{...t,userToFollow:null},captureUpdate:vC.EVENTUALLY}:{appState:{...t,userToFollow:{socketId:o.socketId,username:o.username||""},openMenu:t.openMenu==="canvas"?null:t.openMenu},captureUpdate:vC.EVENTUALLY}),PanelComponent:({updateData:e,data:t,appState:o})=>{let{socketId:n,collaborator:r,withName:a,isBeingFollowed:i}=t,s=ws(n,r),l=dF({"is-followed":i,"is-current-user":r.isCurrentUser===!0,"is-speaking":r.isSpeaking,"is-in-call":r.isInCall,"is-muted":r.isMuted}),c=r.isInCall?r.isSpeaking?rg("div",{className:"UserList__collaborator-status-icon-speaking-indicator",title:b("userList.hint.isSpeaking"),children:[Br("div",{}),Br("div",{}),Br("div",{})]}):r.isMuted?Br("div",{className:"UserList__collaborator-status-icon-microphone-muted",title:b("userList.hint.micMuted"),children:VI}):Br("div",{title:b("userList.hint.inCall"),children:$I}):null;return a?rg("div",{className:`dropdown-menu-item dropdown-menu-item-base UserList__collaborator ${l}`,style:{"--avatar-size":"1.5rem"},onClick:()=>e(r),children:[Br(ux,{color:s,onClick:()=>{},name:r.username||"",src:r.avatarUrl,className:l}),Br("div",{className:"UserList__collaborator-name",children:r.username}),rg("div",{className:"UserList__collaborator-status-icons","aria-hidden":!0,children:[i&&Br("div",{className:"UserList__collaborator-status-icon-is-followed",title:b("userList.hint.followStatus"),children:kl}),c]})]}):rg("div",{className:`UserList__collaborator UserList__collaborator--avatar-only ${l}`,children:[Br(ux,{color:s,onClick:()=>{e(r)},name:r.username||"",src:r.avatarUrl,className:l}),c&&Br("div",{className:"UserList__collaborator-status-icon",children:c})]})}});import{LIBRARY_DISABLED_TYPES as uF,randomId as gF}from"@orangecatai/common";import{deepCopyElement as hF}from"@orangecatai/element";import{CaptureUpdateAction as gx}from"@orangecatai/element";var hx=X({name:"addToLibrary",trackEvent:{category:"element"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});for(let a of uF)if(r.some(i=>i.type===a))return{captureUpdate:gx.EVENTUALLY,appState:{...t,errorMessage:b(`errors.libraryElementTypeError.${a}`)}};return n.library.getLatestLibrary().then(a=>n.library.setLibrary([{id:gF(),status:"unpublished",elements:r.map(hF),created:Date.now()},...a])).then(()=>({captureUpdate:gx.EVENTUALLY,appState:{...t,toast:{message:b("toast.addedToLibrary")}}})).catch(a=>({captureUpdate:gx.EVENTUALLY,appState:{...t,errorMessage:a.message}}))},label:"labels.addToLibrary"});import{getNonDeletedElements as ql}from"@orangecatai/element";import{isFrameLikeElement as fF}from"@orangecatai/element";import{updateFrameMembershipOfSelectedElements as bF}from"@orangecatai/element";import{KEYS as ii,arrayToMap as xF}from"@orangecatai/common";import{alignElements as yF}from"@orangecatai/element";import{CaptureUpdateAction as Jl}from"@orangecatai/element";import{getSelectedElementsByGroup as wF}from"@orangecatai/element";import{jsx as ec}from"react/jsx-runtime";var Ko=(e,t)=>{let o=t.scene.getSelectedElements(e);return wF(o,t.scene.getNonDeletedElementsMap(),e).length>1&&!o.some(n=>fF(n))},Ql=(e,t,o,n)=>{let r=o.scene.getSelectedElements(t),a=yF(r,n,o.scene,t),i=xF(a);return bF(e.map(s=>i.get(s.id)||s),t,o)},vF=X({name:"alignTop",label:"labels.alignTop",icon:Vb,trackEvent:{category:"element"},predicate:(e,t,o,n)=>Ko(t,n),perform:(e,t,o,n)=>({appState:t,elements:Ql(e,t,n,{position:"start",axis:"y"}),captureUpdate:Jl.IMMEDIATELY}),keyTest:e=>e[ii.CTRL_OR_CMD]&&e.shiftKey&&e.key===ii.ARROW_UP,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>ec(be,{hidden:!Ko(t,n),type:"button",icon:Vb,onClick:()=>o(null),title:`${b("labels.alignTop")} \u2014 ${V("CtrlOrCmd+Shift+Up")}`,"aria-label":b("labels.alignTop"),visible:ft(ql(e),t)})}),EF=X({name:"alignBottom",label:"labels.alignBottom",icon:Wb,trackEvent:{category:"element"},predicate:(e,t,o,n)=>Ko(t,n),perform:(e,t,o,n)=>({appState:t,elements:Ql(e,t,n,{position:"end",axis:"y"}),captureUpdate:Jl.IMMEDIATELY}),keyTest:e=>e[ii.CTRL_OR_CMD]&&e.shiftKey&&e.key===ii.ARROW_DOWN,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>ec(be,{hidden:!Ko(t,n),type:"button",icon:Wb,onClick:()=>o(null),title:`${b("labels.alignBottom")} \u2014 ${V("CtrlOrCmd+Shift+Down")}`,"aria-label":b("labels.alignBottom"),visible:ft(ql(e),t)})}),IF=X({name:"alignLeft",label:"labels.alignLeft",icon:Kb,trackEvent:{category:"element"},predicate:(e,t,o,n)=>Ko(t,n),perform:(e,t,o,n)=>({appState:t,elements:Ql(e,t,n,{position:"start",axis:"x"}),captureUpdate:Jl.IMMEDIATELY}),keyTest:e=>e[ii.CTRL_OR_CMD]&&e.shiftKey&&e.key===ii.ARROW_LEFT,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>ec(be,{hidden:!Ko(t,n),type:"button",icon:Kb,onClick:()=>o(null),title:`${b("labels.alignLeft")} \u2014 ${V("CtrlOrCmd+Shift+Left")}`,"aria-label":b("labels.alignLeft"),visible:ft(ql(e),t)})}),TF=X({name:"alignRight",label:"labels.alignRight",icon:Yb,trackEvent:{category:"element"},predicate:(e,t,o,n)=>Ko(t,n),perform:(e,t,o,n)=>({appState:t,elements:Ql(e,t,n,{position:"end",axis:"x"}),captureUpdate:Jl.IMMEDIATELY}),keyTest:e=>e[ii.CTRL_OR_CMD]&&e.shiftKey&&e.key===ii.ARROW_RIGHT,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>ec(be,{hidden:!Ko(t,n),type:"button",icon:Yb,onClick:()=>o(null),title:`${b("labels.alignRight")} \u2014 ${V("CtrlOrCmd+Shift+Right")}`,"aria-label":b("labels.alignRight"),visible:ft(ql(e),t)})}),kF=X({name:"alignVerticallyCentered",label:"labels.centerVertically",icon:Xb,trackEvent:{category:"element"},predicate:(e,t,o,n)=>Ko(t,n),perform:(e,t,o,n)=>({appState:t,elements:Ql(e,t,n,{position:"center",axis:"y"}),captureUpdate:Jl.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>ec(be,{hidden:!Ko(t,n),type:"button",icon:Xb,onClick:()=>o(null),title:b("labels.centerVertically"),"aria-label":b("labels.centerVertically"),visible:ft(ql(e),t)})}),CF=X({name:"alignHorizontallyCentered",label:"labels.centerHorizontally",icon:jb,trackEvent:{category:"element"},predicate:(e,t,o,n)=>Ko(t,n),perform:(e,t,o,n)=>({appState:t,elements:Ql(e,t,n,{position:"center",axis:"x"}),captureUpdate:Jl.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>ec(be,{hidden:!Ko(t,n),type:"button",icon:jb,onClick:()=>o(null),title:b("labels.centerHorizontally"),"aria-label":b("labels.centerHorizontally"),visible:ft(ql(e),t)})});import{getNonDeletedElements as EC}from"@orangecatai/element";import{isFrameLikeElement as SF}from"@orangecatai/element";import{CODES as IC,KEYS as TC,arrayToMap as MF}from"@orangecatai/common";import{updateFrameMembershipOfSelectedElements as PF}from"@orangecatai/element";import{distributeElements as AF}from"@orangecatai/element";import{CaptureUpdateAction as kC}from"@orangecatai/element";import{getSelectedElementsByGroup as LF}from"@orangecatai/element";import{jsx as MC}from"react/jsx-runtime";var CC=(e,t)=>{let o=t.scene.getSelectedElements(e);return LF(o,t.scene.getNonDeletedElementsMap(),e).length>2&&!o.some(n=>SF(n))},SC=(e,t,o,n)=>{let r=o.scene.getSelectedElements(t),a=AF(r,o.scene.getNonDeletedElementsMap(),n,t,o.scene),i=MF(a);return PF(e.map(s=>i.get(s.id)||s),t,o)},_F=X({name:"distributeHorizontally",label:"labels.distributeHorizontally",trackEvent:{category:"element"},perform:(e,t,o,n)=>({appState:t,elements:SC(e,t,n,{space:"between",axis:"x"}),captureUpdate:kC.IMMEDIATELY}),keyTest:e=>!e[TC.CTRL_OR_CMD]&&e.altKey&&e.code===IC.H,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>MC(be,{hidden:!CC(t,n),type:"button",icon:W2,onClick:()=>o(null),title:`${b("labels.distributeHorizontally")} \u2014 ${V("Alt+H")}`,"aria-label":b("labels.distributeHorizontally"),visible:ft(EC(e),t)})}),DF=X({name:"distributeVertically",label:"labels.distributeVertically",trackEvent:{category:"element"},perform:(e,t,o,n)=>({appState:t,elements:SC(e,t,n,{space:"between",axis:"y"}),captureUpdate:kC.IMMEDIATELY}),keyTest:e=>!e[TC.CTRL_OR_CMD]&&e.altKey&&e.code===IC.V,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>MC(be,{hidden:!CC(t,n),type:"button",icon:K2,onClick:()=>o(null),title:`${b("labels.distributeVertically")} \u2014 ${V("Alt+V")}`,"aria-label":b("labels.distributeVertically"),visible:ft(EC(e),t)})});import{getNonDeletedElements as RF}from"@orangecatai/element";import{bindOrUnbindBindingElements as NF}from"@orangecatai/element";import{getCommonBoundingBox as PC}from"@orangecatai/element";import{newElementWith as BF}from"@orangecatai/element";import{deepCopyElement as FF}from"@orangecatai/element";import{resizeMultipleElements as OF}from"@orangecatai/element";import{isArrowElement as AC,isElbowArrow as zF}from"@orangecatai/element";import{updateFrameMembershipOfSelectedElements as LC}from"@orangecatai/element";import{CODES as _C,KEYS as UF,arrayToMap as HF}from"@orangecatai/common";import{CaptureUpdateAction as DC}from"@orangecatai/element";var fx=X({name:"flipHorizontal",label:"labels.flipHorizontal",icon:XI,trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:LC(RC(e,n.scene.getNonDeletedElementsMap(),t,"horizontal",n),t,n),appState:t,captureUpdate:DC.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===_C.H}),bx=X({name:"flipVertical",label:"labels.flipVertical",icon:YI,trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:LC(RC(e,n.scene.getNonDeletedElementsMap(),t,"vertical",n),t,n),appState:t,captureUpdate:DC.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===_C.V&&!e[UF.CTRL_OR_CMD]}),RC=(e,t,o,n,r)=>{let a=Me(RF(e),o,{includeBoundTextElement:!0,includeElementsInFrames:!0}),i=GF(a,t,n,r),s=HF(i);return e.map(l=>s.get(l.id)||l)},GF=(e,t,o,n)=>{if(e.every(d=>AC(d)&&(d.startBinding||d.endBinding)))return e.map(d=>{let u=d;return BF(u,{startArrowhead:u.endArrowhead,endArrowhead:u.startArrowhead})});let{midX:r,midY:a}=PC(e);OF(e,t,"nw",n.scene,new Map(Array.from(t.values()).map(d=>[d.id,FF(d)])),{flipByX:o==="horizontal",flipByY:o==="vertical",shouldResizeFromCenter:!0,shouldMaintainAspectRatio:!0}),NF(e.filter(AC),n.scene,n.state);let{elbowArrows:i,otherElements:s}=e.reduce((d,u)=>zF(u)?{...d,elbowArrows:d.elbowArrows.concat(u)}:{...d,otherElements:d.otherElements.concat(u)},{elbowArrows:[],otherElements:[]}),{midX:l,midY:c}=PC(e),[m,p]=[r-l,a-c];return s.forEach(d=>n.scene.mutateElement(d,{x:d.x+m,y:d.y+p})),i.forEach(d=>n.scene.mutateElement(d,{x:d.x+m,y:d.y+p})),e};import{isTextElement as $F}from"@orangecatai/element";import{getTextFromElements as VF}from"@orangecatai/element";import{CODES as WF,KEYS as NC,isFirefox as KF}from"@orangecatai/common";import{CaptureUpdateAction as wn}from"@orangecatai/element";var tc=X({name:"copy",label:"labels.copy",icon:Sd,trackEvent:{category:"element"},perform:async(e,t,o,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});try{await Xu(r,n.files,o)}catch(a){return{captureUpdate:wn.EVENTUALLY,appState:{...t,errorMessage:a.message}}}return{captureUpdate:wn.EVENTUALLY}},keyTest:void 0}),xx=X({name:"paste",label:"labels.paste",trackEvent:{category:"element"},perform:async(e,t,o,n)=>{let r;try{r=await nC()}catch(a){return a.name==="AbortError"||a.name==="NotAllowedError"?!1:(console.error(`actionPaste ${a.name}: ${a.message}`),KF?{captureUpdate:wn.EVENTUALLY,appState:{...t,errorMessage:b("hints.firefox_clipboard_write")}}:{captureUpdate:wn.EVENTUALLY,appState:{...t,errorMessage:b("errors.asyncPasteFailedOnRead")}})}try{n.pasteFromClipboard(tC({types:r}))}catch(a){return console.error(a),{captureUpdate:wn.EVENTUALLY,appState:{...t,errorMessage:b("errors.asyncPasteFailedOnParse")}}}return{captureUpdate:wn.EVENTUALLY}},keyTest:void 0}),ag=X({name:"cut",label:"labels.cut",icon:LI,trackEvent:{category:"element"},perform:(e,t,o,n)=>(tc.perform(e,t,o,n),Bd.perform(e,t,null,n)),keyTest:e=>e[NC.CTRL_OR_CMD]&&e.key===NC.X}),ig=X({name:"copyAsSvg",label:"labels.copyAsSvg",icon:jI,trackEvent:{category:"element"},perform:async(e,t,o,n)=>{if(!n.canvas)return{captureUpdate:wn.EVENTUALLY};let{exportedElements:r,exportingFrame:a}=fs(e,t,!0);try{await bs("clipboard-svg",r,t,n.files,{...t,exportingFrame:a,name:n.getName()});let i=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});return{appState:{toast:{message:b("toast.copyToClipboardAsSvg",{exportSelection:i.length?b("toast.selection"):b("toast.canvas"),exportColorScheme:t.exportWithDarkMode?b("buttons.darkMode"):b("buttons.lightMode")})}},captureUpdate:wn.EVENTUALLY}}catch(i){return console.error(i),{appState:{errorMessage:i.message},captureUpdate:wn.EVENTUALLY}}},predicate:e=>Yu&&e.length>0,keywords:["svg","clipboard","copy"]}),sg=X({name:"copyAsPng",label:"labels.copyAsPng",icon:ZI,trackEvent:{category:"element"},perform:async(e,t,o,n)=>{if(!n.canvas)return{captureUpdate:wn.EVENTUALLY};let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),{exportedElements:a,exportingFrame:i}=fs(e,t,!0);try{return await bs("clipboard",a,t,n.files,{...t,exportingFrame:i,name:n.getName()}),{appState:{...t,toast:{message:b("toast.copyToClipboardAsPng",{exportSelection:r.length?b("toast.selection"):b("toast.canvas"),exportColorScheme:t.exportWithDarkMode?b("buttons.darkMode"):b("buttons.lightMode")})}},captureUpdate:wn.EVENTUALLY}}catch(s){return console.error(s),{appState:{...t,errorMessage:s.message},captureUpdate:wn.EVENTUALLY}}},predicate:e=>Kl&&e.length>0,keyTest:e=>e.code===WF.C&&e.altKey&&e.shiftKey,keywords:["png","clipboard","copy"]}),lg=X({name:"copyText",label:"labels.copyText",trackEvent:{category:"element"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});try{mr(VF(r))}catch{throw new Error(b("errors.copyToSystemClipboardFailed"))}return{captureUpdate:wn.EVENTUALLY}},predicate:(e,t,o,n)=>Yu&&n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}).some($F),keywords:["text","clipboard","copy"]});import{CODES as YF,KEYS as XF}from"@orangecatai/common";import{CaptureUpdateAction as jF}from"@orangecatai/element";var oc=X({name:"gridMode",icon:tT,keywords:["snap"],label:"labels.toggleGrid",viewMode:!0,trackEvent:{category:"canvas",predicate:e=>e.gridModeEnabled},perform(e,t){return{appState:{...t,gridModeEnabled:!this.checked(t),objectsSnapModeEnabled:!1},captureUpdate:jF.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,o)=>o.gridModeEnabled===void 0,keyTest:e=>e[XF.CTRL_OR_CMD]&&e.code===YF.QUOTE});import{CODES as ZF,KEYS as qF}from"@orangecatai/common";import{CaptureUpdateAction as JF}from"@orangecatai/element";var si=X({name:"zenMode",label:"buttons.zenMode",icon:JI,viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.zenModeEnabled},perform(e,t){return{appState:{...t,zenModeEnabled:!this.checked(t)},captureUpdate:JF.EVENTUALLY}},checked:e=>e.zenModeEnabled,predicate:(e,t,o,n)=>n.editorInterface.formFactor!=="phone"&&typeof o.zenModeEnabled>"u",keyTest:e=>!e[qF.CTRL_OR_CMD]&&e.altKey&&e.code===ZF.Z});import{CODES as QF,KEYS as eO}from"@orangecatai/common";import{CaptureUpdateAction as tO}from"@orangecatai/element";var rm=X({name:"objectsSnapMode",label:"buttons.objectsSnapMode",icon:qI,viewMode:!1,trackEvent:{category:"canvas",predicate:e=>!e.objectsSnapModeEnabled},perform(e,t){return{appState:{...t,objectsSnapModeEnabled:!this.checked(t),gridModeEnabled:!1},captureUpdate:tO.EVENTUALLY}},checked:e=>e.objectsSnapModeEnabled,predicate:(e,t,o)=>typeof o.objectsSnapModeEnabled>"u",keyTest:e=>!e[eO.CTRL_OR_CMD]&&e.altKey&&e.code===QF.S});import{CODES as oO,KEYS as nO}from"@orangecatai/common";import{CaptureUpdateAction as rO}from"@orangecatai/element";var li=X({name:"stats",label:"stats.fullTitle",icon:KI,viewMode:!0,trackEvent:{category:"menu"},keywords:["edit","attributes","customize"],perform(e,t){return{appState:{...t,stats:{...t.stats,open:!this.checked(t)}},captureUpdate:rO.EVENTUALLY}},checked:e=>e.stats.open,keyTest:e=>!e[nO.CTRL_OR_CMD]&&e.altKey&&e.code===oO.SLASH});import{BOUND_TEXT_PADDING as BC,ROUNDNESS as FC,TEXT_ALIGN as UC,VERTICAL_ALIGN as HC,arrayToMap as GC,getFontString as aO}from"@orangecatai/common";import{getOriginalContainerHeightFromCache as iO,isBoundToContainer as OC,resetOriginalContainerCache as sO,updateOriginalContainerCache as lO}from"@orangecatai/element";import{computeBoundTextPosition as cO,computeContainerDimensionForBoundText as zC,getBoundTextElement as $C,redrawTextBoundingBox as VC}from"@orangecatai/element";import{hasBoundTextElement as dO,isArrowElement as mO,isTextBindableContainer as yx,isTextElement as am,isUsingAdaptiveRadius as pO}from"@orangecatai/element";import{measureText as uO}from"@orangecatai/element";import{syncMovedIndices as WC}from"@orangecatai/element";import{newElement as gO}from"@orangecatai/element";import{CaptureUpdateAction as wx}from"@orangecatai/element";var vx=X({name:"unbindText",label:"labels.unbindText",trackEvent:{category:"element"},predicate:(e,t,o,n)=>n.scene.getSelectedElements(t).some(a=>dO(a)),perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t),a=n.scene.getNonDeletedElementsMap();return r.forEach(i=>{let s=$C(i,a);if(s){let{width:l,height:c}=uO(s.originalText,aO(s),s.lineHeight),m=iO(i.id);sO(i.id);let{x:p,y:d}=cO(i,s,a);n.scene.mutateElement(s,{containerId:null,width:l,height:c,text:s.originalText,x:p,y:d}),n.scene.mutateElement(i,{boundElements:i.boundElements?.filter(u=>u.id!==s.id),height:m||i.height})}}),{elements:e,appState:t,captureUpdate:wx.IMMEDIATELY}}}),Ex=X({name:"bindText",label:"labels.bindText",trackEvent:{category:"element"},predicate:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t);if(r.length===2){let a=am(r[0])||am(r[1]),i;if(yx(r[0])?i=r[0]:yx(r[1])&&(i=r[1]),a&&i&&$C(i,n.scene.getNonDeletedElementsMap())===null)return!0}return!1},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t),a,i;am(r[0])&&yx(r[1])?(a=r[0],i=r[1]):(a=r[1],i=r[0]),n.scene.mutateElement(a,{containerId:i.id,verticalAlign:HC.MIDDLE,textAlign:UC.CENTER,autoResize:!0,angle:mO(i)?0:i?.angle??0}),n.scene.mutateElement(i,{boundElements:(i.boundElements||[]).concat({type:"text",id:a.id})});let s=i.height;return VC(a,i,n.scene),lO(i.id,s),{elements:hO(e,i,a),appState:{...t,selectedElementIds:{[i.id]:!0}},captureUpdate:wx.IMMEDIATELY}}}),hO=(e,t,o)=>{let n=e.slice(),r=n.findIndex(i=>i.id===o.id);n.splice(r,1);let a=n.findIndex(i=>i.id===t.id);return n.splice(a+1,0,o),WC(n,GC([t,o])),n},fO=(e,t,o)=>{let n=e.slice(),r=n.findIndex(i=>i.id===t.id);n.splice(r,1);let a=n.findIndex(i=>i.id===o.id);return n.splice(a,0,t),WC(n,GC([t,o])),n},KC=X({name:"wrapTextInContainer",label:"labels.createContainerFromText",trackEvent:{category:"element"},predicate:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t),a=r.some(i=>am(i)&&!OC(i));return r.length>0&&a},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t),a=e.slice(),i={};for(let s of r)if(am(s)&&!OC(s)){let l=gO({type:"rectangle",backgroundColor:t.currentItemBackgroundColor,boundElements:[...s.boundElements||[],{id:s.id,type:"text"}],angle:s.angle,fillStyle:t.currentItemFillStyle,strokeColor:t.currentItemStrokeColor,roughness:t.currentItemRoughness,strokeWidth:t.currentItemStrokeWidth,strokeStyle:t.currentItemStrokeStyle,roundness:t.currentItemRoundness==="round"?{type:pO("rectangle")?FC.ADAPTIVE_RADIUS:FC.PROPORTIONAL_RADIUS}:null,opacity:100,locked:!1,x:s.x-BC,y:s.y-BC,width:zC(s.width,"rectangle"),height:zC(s.height,"rectangle"),groupIds:s.groupIds,frameId:s.frameId});if(s.boundElements?.length){let c=s.boundElements.filter(p=>p.type==="arrow").map(p=>p.id);a.filter(p=>c.includes(p.id)).forEach(p=>{let d=p.startBinding,u=p.endBinding;d?.elementId===s.id&&(d={...d,elementId:l.id}),u?.elementId===s.id&&(u={...u,elementId:l.id}),(d||u)&&n.scene.mutateElement(p,{startBinding:d,endBinding:u})})}n.scene.mutateElement(s,{containerId:l.id,verticalAlign:HC.MIDDLE,boundElements:null,textAlign:UC.CENTER,autoResize:!0}),VC(s,l,n.scene),a=fO([...a,l],l,s),i[l.id]=!0}return{elements:a,appState:{...t,selectedElementIds:i},captureUpdate:wx.IMMEDIATELY}}});import{isEmbeddableElement as DO}from"@orangecatai/element";import{KEYS as o5}from"@orangecatai/common";import{CaptureUpdateAction as RO}from"@orangecatai/element";import{pointFrom as ZC}from"@orangecatai/math";import bO from"clsx";import{useCallback as YC,useEffect as XC,useLayoutEffect as xO,useRef as yO,useState as wO}from"react";import{EVENT as Ix,HYPERLINK_TOOLTIP_DELAY as vO,KEYS as cg}from"@orangecatai/common";import{getElementAbsoluteCoords as Mx}from"@orangecatai/element";import{hitElementBoundingBox as EO}from"@orangecatai/element";import{isElementLink as IO}from"@orangecatai/element";import{getEmbedLink as TO,embeddableURLValidator as kO}from"@orangecatai/element";import{sceneCoordsToViewportCoords as qC,viewportCoordsToSceneCoords as CO,wrapEvent as SO,isLocalLink as MO,normalizeLink as Tx}from"@orangecatai/common";import{isEmbeddableElement as kx}from"@orangecatai/element";import{jsx as nc,jsxs as jC}from"react/jsx-runtime";var Px=380,PO=42,Cx=5,JC=85,AO=500,Sx=!1,dg=new Map,QC=({element:e,scene:t,setAppState:o,onLinkOpen:n,setToast:r,updateEmbedValidationStatus:a})=>{let i=t.getNonDeletedElementsMap(),s=on(),l=_r(),c=qe(),m=e.link||"",[p,d]=wO(m),u=yO(null),h=s.showHyperlinkPopup==="editor",g=YC(()=>{if(!u.current)return;let E=Tx(u.current.value)||null;if(!e.link&&E&&Ne("hyperlink","create"),kx(e)){if(s.activeEmbeddable?.element===e&&o({activeEmbeddable:null}),!E){t.mutateElement(e,{link:null}),a(e,!1);return}if(!kO(E,l.validateEmbeddable))E&&r({message:b("toast.unableToEmbed"),closable:!0}),e.link&&dg.set(e.id,e.link),t.mutateElement(e,{link:E}),a(e,!1);else{let{width:I,height:k}=e,S=TO(E);S?.error instanceof URIError&&r({message:b("toast.unrecognizedLinkFormat"),closable:!0});let T=S?S.intrinsicSize.w/S.intrinsicSize.h:1,A=dg.get(e.id)!==e.link;t.mutateElement(e,{...A?{width:S?.type==="video"?I>k?I:k*T:I,height:S?.type==="video"&&I>k?I/T:k}:{},link:E}),a(e,!0),dg.has(e.id)&&dg.delete(e.id)}}else t.mutateElement(e,{link:E})},[e,t,r,l.validateEmbeddable,s.activeEmbeddable,o,a]);xO(()=>()=>{g()},[g]),XC(()=>{h&&u?.current&&!(c.formFactor==="phone"||c.isTouchScreen)&&u.current.select()},[h,c.formFactor,c.isTouchScreen]),XC(()=>{let E=null,I=k=>{if(h)return;E&&clearTimeout(E),_O(e,i,s,ZC(k.clientX,k.clientY))&&(E=window.setTimeout(()=>{o({showHyperlinkPopup:!1})},AO))};return window.addEventListener(Ix.POINTER_MOVE,I,!1),()=>{window.removeEventListener(Ix.POINTER_MOVE,I,!1),E&&clearTimeout(E)}},[s,e,h,o,i]);let f=YC(()=>{Ne("hyperlink","delete"),t.mutateElement(e,{link:null}),o({showHyperlinkPopup:!1})},[o,e,t]),w=()=>{Ne("hyperlink","edit","popup-ui"),o({showHyperlinkPopup:"editor"})},{x:y,y:v}=e5(e,s,i);return s.contextMenu||s.selectedElementsAreBeingDragged||s.resizingElement||s.isRotating||s.openMenu||s.viewModeEnabled?null:jC("div",{className:"excalidraw-hyperlinkContainer",style:{top:`${v}px`,left:`${y}px`,width:Px,padding:Cx},children:[h?nc("input",{className:bO("excalidraw-hyperlinkContainer-input"),placeholder:b("labels.link.hint"),ref:u,value:p,onChange:E=>d(E.target.value),autoFocus:!0,onKeyDown:E=>{E.stopPropagation(),E[cg.CTRL_OR_CMD]&&E.key===cg.K&&E.preventDefault(),(E.key===cg.ENTER||E.key===cg.ESCAPE)&&(g(),o({showHyperlinkPopup:"info"}))}}):e.link?nc("a",{href:Tx(e.link||""),className:"excalidraw-hyperlinkContainer-link",target:MO(e.link)?"_self":"_blank",onClick:E=>{if(e.link&&n){let I=SO(Ix.EXCALIDRAW_LINK,E.nativeEvent);n({...e,link:Tx(e.link)},I),I.defaultPrevented&&E.preventDefault()}},rel:"noopener noreferrer",children:e.link}):nc("div",{className:"excalidraw-hyperlinkContainer-link",children:b("labels.link.empty")}),jC("div",{className:"excalidraw-hyperlinkContainer__buttons",children:[!h&&nc(be,{type:"button",title:b("buttons.edit"),"aria-label":b("buttons.edit"),label:b("buttons.edit"),onClick:w,className:"excalidraw-hyperlinkContainer--edit",icon:Mr}),nc(be,{type:"button",title:b("labels.linkToElement"),"aria-label":b("labels.linkToElement"),label:b("labels.linkToElement"),onClick:()=>{o({openDialog:{name:"elementLinkSelector",sourceElementId:e.id}})},icon:uu}),m&&!kx(e)&&nc(be,{type:"button",title:b("buttons.remove"),"aria-label":b("buttons.remove"),label:b("buttons.remove"),onClick:f,className:"excalidraw-hyperlinkContainer--remove",icon:Co})]})]})},e5=(e,t,o)=>{let[n,r]=Mx(e,o),{x:a,y:i}=qC({sceneX:n+e.width/2,sceneY:r},t),s=a-t.offsetLeft-Px/2,l=i-t.offsetTop-JC;return{x:s,y:l}},Ax=(e,t)=>{let o=Me(e,t);return kx(o[0])?"labels.link.editEmbed":o[0]?.link?"labels.link.edit":"labels.link.create"},im=null,t5=(e,t,o)=>{im&&clearTimeout(im),im=window.setTimeout(()=>LO(e,t,o),vO)},LO=(e,t,o)=>{if(!e.link)return;let n=Hl();n.classList.add("excalidraw-tooltip--visible"),n.style.maxWidth="20rem",n.textContent=IO(e.link)?b("labels.link.goToElement"):e.link;let[r,a,i,s]=Mx(e,o),[l,c,m,p]=QE([r,a,i,s],e.angle,t),d=qC({sceneX:l,sceneY:c},t);K0(n,{left:d.x,top:d.y,width:m,height:p},"top"),Ne("hyperlink","tooltip","link-icon"),Sx=!0},Lx=()=>{im&&clearTimeout(im),Sx&&(Sx=!1,Hl().classList.remove("excalidraw-tooltip--visible"))},_O=(e,t,o,[n,r])=>{let{x:a,y:i}=CO({clientX:n,clientY:r},o),s=15/o.zoom.value;if(EO(ZC(a,i),e,t))return!1;let[l,c,m]=Mx(e,t);if(a>=l&&a<=m&&i>=c-JC&&i<=c)return!1;let{x:p,y:d}=e5(e,o,t);return!(n>=p-s&&n<=p+Px+Cx*2+s&&r>=d-s&&r<=d+s+Cx*2+PO)};import{jsx as NO}from"react/jsx-runtime";var sm=X({name:"hyperlink",label:(e,t)=>Ax(e,t),icon:Ad,perform:(e,t)=>t.showHyperlinkPopup==="editor"?!1:{elements:e,appState:{...t,showHyperlinkPopup:"editor",openMenu:null},captureUpdate:RO.IMMEDIATELY},trackEvent:{category:"hyperlink",action:"click"},keyTest:e=>e[o5.CTRL_OR_CMD]&&e.key===o5.K,predicate:(e,t)=>Me(e,t).length===1,PanelComponent:({elements:e,appState:t,updateData:o})=>{let n=Me(e,t);return NO(be,{type:"button",icon:Ad,"aria-label":b(Ax(e,t)),title:`${DO(e[0])?b("labels.link.labelEmbed"):b("labels.link.label")} - ${V("CtrlOrCmd+K")}`,onClick:()=>o(null),selected:n.length===1&&!!n[0].link})}});import{KEYS as n5,arrayToMap as Dx,randomId as BO}from"@orangecatai/common";import{elementsAreInSameGroup as FO,newElementWith as r5,selectGroupsFromGivenElements as a5}from"@orangecatai/element";import{CaptureUpdateAction as i5}from"@orangecatai/element";var _x=e=>e.every(t=>!t.locked),lm=X({name:"toggleElementLock",label:(e,t,o)=>{let n=o.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1});return _x(n)?"labels.elementLock.lock":"labels.elementLock.unlock"},icon:(e,t)=>{let o=Me(t,e);return _x(o)?ul:is},trackEvent:{category:"element"},predicate:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t);return r.length>0&&!r.some(a=>a.locked&&a.frameId)},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});if(!r.length)return!1;let a=_x(r),i=Dx(r),s=r.length>1&&FO(r),c=r.length===1||s?null:BO(),m={...t.lockedMultiSelections};if(a)m={...t.lockedMultiSelections,...c?{[c]:!0}:{}};else if(s){let w=r[0].groupIds.at(-1);delete m[w]}let p=e.map(w=>{if(!i.has(w.id))return w;let y=w.groupIds;return a?c&&(y=[...y,c]):y=y.filter(v=>!t.lockedMultiSelections[v]),r5(w,{locked:a,groupIds:y.length!==w.groupIds.length?y:w.groupIds})}),d=Dx(p),u=a?{}:Object.fromEntries(r.map(w=>[w.id,!0])),h=r.map(w=>d.get(w.id)||w),g=a?{}:a5(h,t),f=a?c||(s?r[0].groupIds.at(-1):r[0].id):null;return{elements:p,appState:{...t,selectedElementIds:u,selectedGroupIds:g,selectedLinearElement:a?null:t.selectedLinearElement,lockedMultiSelections:m,activeLockedId:f},captureUpdate:i5.IMMEDIATELY}},keyTest:(e,t,o,n)=>e.key.toLocaleLowerCase()===n5.L&&e[n5.CTRL_OR_CMD]&&e.shiftKey&&n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}).length>0}),s5=X({name:"unlockAllElements",trackEvent:{category:"canvas"},viewMode:!1,icon:is,predicate:(e,t)=>Me(e,t).length===0&&e.some(n=>n.locked),perform:(e,t)=>{let o=e.filter(i=>i.locked),n=e.map(i=>{if(i.locked){let s=i.groupIds.filter(l=>!t.lockedMultiSelections[l]);return r5(i,{locked:!1,groupIds:i.groupIds.length!==s.length?s:i.groupIds})}return i}),r=Dx(n),a=o.map(i=>r.get(i.id)||i);return{elements:n,appState:{...t,selectedElementIds:Object.fromEntries(o.map(i=>[i.id,!0])),selectedGroupIds:a5(a,t),lockedMultiSelections:{},activeLockedId:null},captureUpdate:i5.IMMEDIATELY}},label:"labels.elementLock.unlockAll"});import{isElbowArrow as I$,isLinearElement as T$,isLineElement as Ec}from"@orangecatai/element";import{arrayToMap as k$,invariant as H1}from"@orangecatai/common";import{toggleLinePolygonState as C$,CaptureUpdateAction as PS}from"@orangecatai/element";import nS from"clsx";import uG from"fuzzy";import{useEffect as Ug,useRef as rS,useMemo as gG,useState as zg}from"react";import{DEFAULT_SIDEBAR as eS,EVENT as Gg,KEYS as hr,capitalizeString as hG,isWritableElement as fG}from"@orangecatai/common";import{CaptureUpdateAction as yz}from"@orangecatai/element";import{useEffect as mm,useMemo as l5,useRef as Fx,useState as OO}from"react";import{getLinearElementSubType as ic,updateElbowArrowPoints as zO}from"@orangecatai/element";import{pointFrom as pg,pointRotateRads as UO}from"@orangecatai/math";import{hasBoundTextElement as HO,isArrowBoundToElement as GO,isArrowElement as $O,isElbowArrow as VO,isLinearElement as Hx,isUsingAdaptiveRadius as WO}from"@orangecatai/element";import{getCommonBoundingBox as KO,getElementAbsoluteCoords as YO}from"@orangecatai/element";import{getBoundTextElement as u5,getBoundTextMaxHeight as XO,getBoundTextMaxWidth as jO,redrawTextBoundingBox as ZO}from"@orangecatai/element";import{wrapText as qO}from"@orangecatai/element";import{assertNever as JO,CLASSES as QO,getFontString as Rx,isProdEnv as ez,mapFind as tz,reduceToCommonValue as oz,updateActiveTool as c5}from"@orangecatai/common";import{measureText as d5}from"@orangecatai/element";import{LinearElementEditor as nz}from"@orangecatai/element";import{newArrowElement as Nx,newElement as rz,newLinearElement as az}from"@orangecatai/element";import{ShapeCache as iz}from"@orangecatai/element";import{updateBindings as sz}from"@orangecatai/element";import{jsx as Ux}from"react/jsx-runtime";var lz=8,cz=10,cm=["rectangle","diamond","ellipse"],dm=["line","sharpArrow","curvedArrow","elbowArrow"],dz=new Set(cm),mz=new Set(dm),sc=e=>dz.has(e),gg=e=>e==="arrow"||mz.has(e),ur=je(null),pm=new Map,um=new Map,pz=({app:e})=>{let t=e.scene.getSelectedElements(e.state),o=Fx(null);return mm(()=>{if(t.length===0){e.updateEditorAtom(ur,null);return}let n=lc(t);n&&!o.current?o.current=n:(o.current&&!n||o.current&&n!==o.current)&&(e.updateEditorAtom(ur,null),o.current=null)},[t,e]),mm(()=>()=>{pm.clear(),um.clear()},[]),Ux(uz,{app:e,elements:t})},uz=({app:e,elements:t})=>{let o=lc(t),n=l5(()=>o==="generic"?h5(t):[],[o,t]),r=l5(()=>o==="linear"?zx(t):[],[o,t]),a=o==="generic"?n.every(p=>p.type===n[0].type):o==="linear"?r.every(p=>ic(p)===ic(r[0])):!1,[i,s]=OO({x:0,y:0}),l=Fx(""),c=Fx(null);mm(()=>{let p=[...n,...r].sort((f,w)=>f.id.localeCompare(w.id)),d=`
7
7
  ${e.state.scrollX}${e.state.scrollY}${e.state.offsetTop}${e.state.offsetLeft}${e.state.zoom.value}${p.map(f=>f.id).join(",")}`;if(d===l.current)return;l.current=d;let u;if(p.length===1){let[f,,,w,y,v]=YO(p[0],e.scene.getNonDeletedElementsMap());u=UO(pg(f,w),pg(y,v),p[0].angle)}else{let{minX:f,maxY:w}=KO(p);u=pg(f,w)}let{x:h,y:g}=b5({sceneX:u[0],sceneY:u[1]},e.state);s({x:h,y:g})},[n,r,e.scene,e.state]),mm(()=>{for(let p of r){let d=Ox(p.id,xz(p));um.has(d)||um.set(d,p)}},[r]),mm(()=>{for(let p of n)if(!pm.has(p.id)){let d=u5(p,e.scene.getNonDeletedElementsMap());d&&pm.set(p.id,{fontSize:d.fontSize})}},[n,e.scene]);let m=o==="linear"?[["line",bl],["sharpArrow",Sl],["curvedArrow",Pl],["elbowArrow",Ml]]:o==="generic"?[["rectangle",gl],["diamond",hl],["ellipse",fl]]:[];return Ux("div",{ref:c,tabIndex:-1,style:{position:"absolute",top:`${i.y+(cz+8)*e.state.zoom.value-e.state.offsetTop}px`,left:`${i.x-e.state.offsetLeft-lz}px`,zIndex:2},className:QO.CONVERT_ELEMENT_TYPE_POPUP,children:m.map(([p,d])=>{let u=a&&(o==="generic"&&n[0].type===p||o==="linear"&&ic(r[0])===p);return Ux(be,{className:"Shape",type:"radio",icon:d,checked:u,name:"convertElementType-option",title:p,keyBindingLabel:"","aria-label":p,"data-testid":`toolbar-${p}`,onChange:()=>{e.state.activeTool.type!==p&&Ne("convertElementType",p,"ui"),Gx(e,{conversionType:o,nextType:p}),c.current?.focus()}},`${t[0].id}${t[0].version}_${p}`)})})},gz=(e,t,o)=>{let n=jO(e,t),r=XO(e,t),a=qO(t.text,Rx(t),n),i=d5(a,Rx(t),t.lineHeight),s=t.fontSize;for(;(i.width>n||i.height>r)&&s>0;){s-=1;let l={...t,fontSize:s};i=d5(t.text,Rx(l),t.lineHeight)}hg(t,o.getNonDeletedElementsMap(),{fontSize:s,width:i.width,height:i.height}),ZO(t,e,o)},Gx=(e,{conversionType:t,nextType:o,direction:n="right"})=>{if(!t)return!1;let r=e.scene.getSelectedElements(e.state),a=r.reduce((s,l)=>({...s,[l.id]:!0}),{}),i=n==="right"?1:-1;if(t==="generic"){let s=h5(r),c=s.every(m=>m.type===s[0].type)?cm.indexOf(s[0].type):-1;if(o=o??cm[(c+cm.length+i)%cm.length],o&&sc(o)){let m={};for(let d of s){let u=p5(d,o,e);m[u.id]=u}let p=[];for(let d of e.scene.getElementsIncludingDeleted())m[d.id]?p.push(m[d.id]):p.push(d);e.scene.replaceAllElements(p);for(let d of Object.values(m)){let u=u5(d,e.scene.getNonDeletedElementsMap());u&&(pm.get(d.id)&&hg(u,e.scene.getNonDeletedElementsMap(),{fontSize:pm.get(d.id)?.fontSize??u.fontSize}),gz(d,u,e.scene))}e.setState(d=>({selectedElementIds:a,activeTool:c5(d,{type:"selection"})}))}}if(t==="linear"){let s=zx(r);if(!o){let c=oz(s,ic),m=c?dm.indexOf(c):-1;o=dm[(m+dm.length+i)%dm.length]}if(gg(o)){let c=[],m=e.scene.getElementsMapIncludingDeleted();for(let p of s){let d=um.get(Ox(p.id,o));if(d&&ic(d)===o)m.set(d.id,d),c.push(d);else{let u=p5(p,o,e);m.set(u.id,u),c.push(u)}}e.scene.replaceAllElements(m);for(let p of c)if(Hx(p))if(VO(p)){let d=hz(p);if(d.length<2)continue;let u=[];for(let g=1;g<d.length-2;g++)u.push({start:d[g],end:d[g+1],index:g+1});let h=zO(p,e.scene.getNonDeletedElementsMap(),{points:d,fixedSegments:u});hg(p,e.scene.getNonDeletedElementsMap(),{...h,endArrowhead:"arrow"})}else{let d=tz(["line","sharpArrow","curvedArrow"],u=>um.get(Ox(p.id,u)));if(d){let u=d.points;e.scene.mutateElement(p,{points:u})}}}let l=zx(e.scene.getSelectedElements(e.state));e.setState(c=>({selectedElementIds:a,selectedLinearElement:l.length===1?new nz(l[0],e.scene.getNonDeletedElementsMap()):null,activeTool:c5(c,{type:"selection"})}))}return!0},lc=e=>{if(e.length===0)return null;let t=!1;for(let o of e){if(sc(o.type))return"generic";g5(o)&&(t=!0)}return t?"linear":null},g5=e=>Hx(e)&&(!$O(e)||!GO(e)&&!HO(e)),Ox=(e,t)=>`${e}:${t}`,h5=e=>e.filter(t=>sc(t.type)),zx=e=>e.filter(t=>g5(t)),mg=20,rc=(e,t)=>e[0]===t[0],Bx=(e,t)=>e[1]===t[1],m5=(e,t)=>rc(e,t)?Math.abs(e[1]-t[1]):Math.abs(e[0]-t[0]),hz=e=>{let t=[e.points[0]],o=fz(e.points);for(let a=1;a<o.length;++a){let i=t[t.length-1],s=[...o[a]];Math.abs(s[0]-i[0])<mg?s[0]=i[0]:Math.abs(s[1]-i[1])<mg&&(s[1]=i[1]),rc(i,s)||Bx(i,s)||t.push(pg(i[0],s[1])),t.push(s)}let n=[t[0]];for(let a=1;a<t.length-1;++a)rc(t[a-1],t[a])&&rc(t[a],t[a+1])||Bx(t[a-1],t[a])&&Bx(t[a],t[a+1])||n.push(t[a]);n.push(t[t.length-1]);let r=[n[0]];for(let a=1;a<n.length-1;++a){let i=r[r.length-1],s=n[a],l=n[a+1],c=rc(i,s),m=rc(s,l);if(c!==m){let p=m5(i,s),d=m5(s,l);if(p<mg||d<mg){if(d<p)c?l[0]=i[0]:l[1]=i[1];else if(m)for(let u=r.length-1;u>=0&&r[u][0]===i[0];--u)r[u][0]=s[0];else for(let u=r.length-1;u>=0&&r[u][1]===i[1];--u)r[u][1]=s[1];continue}}r.push(s)}return r.push(n[n.length-1]),r},fz=e=>{if(e.length===0)return[];let t=[e[0]];for(let o=1;o<e.length;o++){let[n,r]=t[t.length-1],[a,i]=e[o];(n!==a||r!==i)&&t.push(e[o])}return t},p5=(e,t,o)=>{if(!bz(e.type,t)){if(!ez())throw Error(`Invalid conversion from ${e.type} to ${t}.`);return e}if(e.type===t)return e;if(iz.delete(e),sc(t)){let n=ac(rz({...e,type:t,roundness:t==="diamond"&&e.roundness?{type:WO(t)?ug.ADAPTIVE_RADIUS:ug.PROPORTIONAL_RADIUS}:e.roundness}));return sz(n,o.scene,o.state),n}if(gg(t))switch(t){case"line":return ac(az({...e,type:"line"}));case"sharpArrow":return ac(Nx({...e,type:"arrow",elbowed:!1,roundness:null,startArrowhead:o.state.currentItemStartArrowhead,endArrowhead:o.state.currentItemEndArrowhead}));case"curvedArrow":return ac(Nx({...e,type:"arrow",elbowed:!1,roundness:{type:ug.PROPORTIONAL_RADIUS},startArrowhead:o.state.currentItemStartArrowhead,endArrowhead:o.state.currentItemEndArrowhead}));case"elbowArrow":return ac(Nx({...e,type:"arrow",elbowed:!0,fixedSegments:null,roundness:null}))}return JO(t,`unhandled conversion type: ${t}`),e},bz=(e,t)=>!!(sc(e)&&sc(t)||gg(e)&&gg(t)),xz=e=>Hx(e)?ic(e):e.type,f5=pz;var x5=X({name:"toggleShapeSwitch",label:"labels.shapeSwitch",icon:()=>null,viewMode:!0,trackEvent:{category:"shape_switch",action:"toggle"},keywords:["change","switch","swap"],perform(e,t,o,n){return Yt.set(ur,{type:"panel"}),{captureUpdate:yz.NEVER}},checked:e=>e.gridModeEnabled,predicate:(e,t,o)=>lc(e)!==null});import{canCreateLinkFromElements as $x,defaultGetElementLinkFromSelection as wz,getLinkIdAndTypeFromSelection as vz}from"@orangecatai/element";import{CaptureUpdateAction as gm}from"@orangecatai/element";var fg=X({name:"copyElementLink",label:"labels.copyElementLink",icon:Il,trackEvent:{category:"element"},perform:async(e,t,o,n)=>{let r=Me(e,t);try{if(window.location){let a=vz(r,t);return a?(await mr(n.props.generateLinkForSelection?n.props.generateLinkForSelection(a.id,a.type):wz(a.id,a.type)),{appState:{toast:{message:b("toast.elementLinkCopied"),closable:!0}},captureUpdate:gm.EVENTUALLY}):{appState:t,elements:e,app:n,captureUpdate:gm.EVENTUALLY}}}catch(a){console.error(a)}return{appState:t,elements:e,app:n,captureUpdate:gm.EVENTUALLY}},predicate:(e,t)=>$x(Me(e,t))}),y5=X({name:"linkToElement",label:"labels.linkToElement",icon:uu,perform:(e,t,o,n)=>{let r=Me(e,t);return r.length!==1||!$x(r)?{elements:e,appState:t,app:n,captureUpdate:gm.EVENTUALLY}:{appState:{...t,openDialog:{name:"elementLinkSelector",sourceElementId:Me(e,t)[0].id}},captureUpdate:gm.IMMEDIATELY}},predicate:(e,t,o,n)=>{let r=Me(e,t);return t.openDialog?.name!=="elementLinkSelector"&&r.length===1&&$x(r)},trackEvent:!1});import{isDarwin as w5}from"@orangecatai/common";var Ez={toggleTheme:[V("Shift+Alt+D")],saveScene:[V("CtrlOrCmd+S")],loadScene:[V("CtrlOrCmd+O")],clearCanvas:[V("CtrlOrCmd+Delete")],imageExport:[V("CtrlOrCmd+Shift+E")],commandPalette:[V("CtrlOrCmd+/"),V("CtrlOrCmd+Shift+P")],cut:[V("CtrlOrCmd+X")],copy:[V("CtrlOrCmd+C")],paste:[V("CtrlOrCmd+V")],copyStyles:[V("CtrlOrCmd+Alt+C")],pasteStyles:[V("CtrlOrCmd+Alt+V")],selectAll:[V("CtrlOrCmd+A")],deleteSelectedElements:[V("Delete")],duplicateSelection:[V("CtrlOrCmd+D"),V(`Alt+${b("helpDialog.drag")}`)],sendBackward:[V("CtrlOrCmd+[")],bringForward:[V("CtrlOrCmd+]")],sendToBack:[w5?V("CtrlOrCmd+Alt+["):V("CtrlOrCmd+Shift+[")],bringToFront:[w5?V("CtrlOrCmd+Alt+]"):V("CtrlOrCmd+Shift+]")],copyAsPng:[V("Shift+Alt+C")],group:[V("CtrlOrCmd+G")],ungroup:[V("CtrlOrCmd+Shift+G")],gridMode:[V("CtrlOrCmd+'")],zenMode:[V("Alt+Z")],objectsSnapMode:[V("Alt+S")],stats:[V("Alt+/")],addToLibrary:[],flipHorizontal:[V("Shift+H")],flipVertical:[V("Shift+V")],viewMode:[V("Alt+R")],hyperlink:[V("CtrlOrCmd+K")],toggleElementLock:[V("CtrlOrCmd+Shift+L")],resetZoom:[V("CtrlOrCmd+0")],zoomOut:[V("CtrlOrCmd+-")],zoomIn:[V("CtrlOrCmd++")],zoomToFitSelection:[V("Shift+3")],zoomToFit:[V("Shift+1")],zoomToFitSelectionInViewport:[V("Shift+2")],toggleEraserTool:[V("E")],toggleHandTool:[V("H")],setFrameAsActiveTool:[V("F")],cycleThroughFrameChildren:[V("CtrlOrCmd+J")],openImageGenerator:[V("G")],openVideoGenerator:[V("M")],saveFileToDisk:[V("CtrlOrCmd+S")],saveToActiveFile:[V("CtrlOrCmd+S")],toggleShortcuts:[V("?")],searchMenu:[V("CtrlOrCmd+F")],wrapSelectionInFrame:[],toolLock:[V("Q")]},Tt=(e,t=0)=>{let o=Ez[e];return o&&o.length>0?o[t]||o[0]:""};var Iz="\\u0300-\\u036f",Tz="\\ufe20-\\ufe2f",kz="\\u20d0-\\u20ff",Cz=Iz+Tz+kz,Sz=`[${Cz}]`,Mz=RegExp(Sz,"g"),Pz=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Az={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"E",\u00E6:"e",\u00DE:"T",\u00FE:"t",\u00DF:"s",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"I",\u0133:"i",\u0152:"E",\u0153:"e",\u0149:"n",\u017F:"s"},vs=e=>e.replace(Pz,t=>Az[t]||t).replace(Mz,"");import WH from"clsx";import{useEffect as KH,useState as YH}from"react";import{KEYS as XH,queryFocusableElements as P3}from"@orangecatai/common";import{useCallback as Lz,useState as _z}from"react";var v5=()=>{let[e,t]=_z(null),o=Lz(n=>t(n),[]);return[e,o]};import{useState as I3,useCallback as m1,useMemo as T3,useEffect as p1,memo as k3,useRef as AH}from"react";import{LIBRARY_DISABLED_TYPES as LH,randomId as _H,isShallowEqual as DH,KEYS as RH,isWritableElement as NH,addEventListener as BH,EVENT as FH,CLASSES as w3}from"@orangecatai/common";import{useEffect as T5,useRef as k5}from"react";import{URL_HASH_KEYS as Kx,URL_QUERY_KEYS as Yx,APP_NAME as C5,EVENT as yg,DEFAULT_SIDEBAR as Bz,LIBRARY_SIDEBAR_TAB as Fz,arrayToMap as Xx,cloneJSON as Oz,preventUnload as zz,promiseTry as S5,resolvablePromise as Uz,toValidURL as Hz,Queue as Gz,Emitter as $z}from"@orangecatai/common";import{hashElementsVersion as Vz,hashString as Wz}from"@orangecatai/element";import{getCommonBoundingBox as Wx}from"@orangecatai/element";import{MIME_TYPES as Es}from"@orangecatai/common";var ci=({elements:e,appState:t,files:o,maxWidthOrHeight:n,getDimensions:r,exportPadding:a,exportingFrame:i})=>{let s=rs(e,null,{deleteInvisibleElements:!0}),l=ll(t,null),{exportBackground:c,viewBackgroundColor:m}=l;return Wa(s,{...l,offsetTop:0,offsetLeft:0,width:0,height:0},o||{},{exportBackground:c,exportPadding:a,viewBackgroundColor:m,exportingFrame:i},(p,d)=>{let u=document.createElement("canvas");if(n){typeof r=="function"&&console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");let g=Math.max(p,d),f=n<g?n/g:t?.exportScale??1;return u.width=p*f,u.height=d*f,{canvas:u,scale:f}}let h=r?.(p,d)||{width:p,height:d};return u.width=h.width,u.height=h.height,{canvas:u,scale:h.scale??1}})},bg=async e=>{let{mimeType:t=Es.png,quality:o}=e;t===Es.png&&typeof o=="number"&&console.warn(`"quality" will be ignored for "${Es.png}" mimeType`),t==="image/jpg"&&(t=Es.jpg),t===Es.jpg&&!e.appState?.exportBackground&&(console.warn(`Defaulting "exportBackground" to "true" for "${Es.jpg}" mimeType`),e={...e,appState:{...e.appState,exportBackground:!0}});let n=await ci(e);return o=o||(/image\/jpe?g/.test(t)?.92:.8),new Promise((r,a)=>{n.toBlob(async i=>{if(!i)return a(new Error("couldn't export to blob"));i&&t===Es.png&&e.appState?.exportEmbedScene&&(i=await r2({blob:i,metadata:Ed(e.elements,e.appState,e.files||{},"local")})),r(i)},t,o)})},cc=async({elements:e,appState:t=Va(),files:o={},exportPadding:n,renderEmbeddables:r,exportingFrame:a,skipInliningFonts:i,reuseImages:s})=>{let l=rs(e,null,{deleteInvisibleElements:!0}),m={...ll(t,null),exportPadding:n};return sl(l,m,o,{exportingFrame:a,renderEmbeddables:r,skipInliningFonts:i,reuseImages:s})},Dz=async e=>{if(e.type==="svg"){let t=await cc(e);await mr(t.outerHTML)}else if(e.type==="png")await Zu(bg(e));else if(e.type==="json")await Xu(e.elements,e.files);else throw new Error("Invalid export type")};import{useEffect as E5,useState as Rz}from"react";import{COLOR_PALETTE as Nz}from"@orangecatai/common";var Vx=je(new Map),I5=async e=>await cc({elements:e,appState:{exportBackground:!1,viewBackgroundColor:Nz.white},files:null,renderEmbeddables:!1,skipInliningFonts:!0}),xg=(e,t,o,n)=>{let[r,a]=Rz();return E5(()=>{if(t)if(e){let i=o.get(e);i?a(i):(async()=>{let s=await I5(t);s.querySelector(".style-fonts")?.remove(),s&&(o.set(e,s),a(s))})()}else(async()=>{let i=await I5(t);a(i)})()},[e,t,o,a]),E5(()=>{let i=n.current;if(i)return r&&(i.innerHTML=r.outerHTML),()=>{i.innerHTML=""}},[r,n]),r},dc=()=>{let[e]=ve(Vx);return{clearLibraryCache:()=>e.clear(),deleteItemsFromLibraryCache:n=>{n.forEach(r=>e.delete(r))},svgCache:e}};var Kz=["excalidraw.com","raw.githubusercontent.com/excalidraw/excalidraw-libraries"],P5=new $z,fa=je({status:"loaded",isInitialized:!1,libraryItems:[]}),hm=e=>Oz(e),Yz=(e,t)=>!e.find(o=>o.elements.length!==t.elements.length?!1:o.elements.every((n,r)=>n.id===t.elements[r].id&&n.versionNonce===t.elements[r].versionNonce)),A5=(e,t)=>{let o=[];for(let n of t)Yz(e,n)&&o.push(n);return[...o,...e]},L5=(e,t)=>{let o=Xx(t),n={deletedItems:new Map,addedItems:new Map,updatedItems:new Map};for(let a of e)o.has(a.id)||n.deletedItems.set(a.id,a);let r=Xx(e);for(let a of t){let i=r.get(a.id);i?qx(i)!==qx(a)&&n.updatedItems.set(a.id,a):n.addedItems.set(a.id,a)}return n},jx=class{constructor(t){D(this,"currLibraryItems",[]);D(this,"prevLibraryItems",hm(this.currLibraryItems));D(this,"app");D(this,"updateQueue",[]);D(this,"getLastUpdateTask",()=>this.updateQueue[this.updateQueue.length-1]);D(this,"notifyListeners",()=>{if(this.updateQueue.length>0)Yt.set(fa,t=>({status:"loading",libraryItems:this.currLibraryItems,isInitialized:t.isInitialized}));else{Yt.set(fa,{status:"loaded",libraryItems:this.currLibraryItems,isInitialized:!0});try{let t=this.prevLibraryItems;this.prevLibraryItems=hm(this.currLibraryItems);let o=hm(this.currLibraryItems);this.app.props.onLibraryChange?.(o),P5.trigger(L5(t,o),o)}catch(t){console.error(t)}}});D(this,"destroy",()=>{this.updateQueue=[],this.currLibraryItems=[],Yt.set(Vx,new Map)});D(this,"resetLibrary",()=>this.setLibrary([]));D(this,"getLatestLibrary",()=>new Promise(async t=>{try{let o=await(this.getLastUpdateTask()||this.currLibraryItems);this.updateQueue.length>0?t(this.getLatestLibrary()):t(hm(o))}catch{return t(this.currLibraryItems)}}));D(this,"updateLibrary",async({libraryItems:t,prompt:o=!1,merge:n=!1,openLibraryMenu:r=!1,defaultStatus:a="unpublished"})=>(r&&this.app.setState({openSidebar:{name:Bz.name,tab:Fz}}),this.setLibrary(()=>new Promise(async(i,s)=>{try{let l=await(typeof t=="function"&&!(t instanceof Blob)?t(this.currLibraryItems):t),c;l instanceof Blob?c=await Lb(l,a):c=kd(l,a),!o||window.confirm(b("alerts.confirmAddLibrary",{numShapes:c.length}))?(o&&this.app.focusContainer(),i(n?A5(this.currLibraryItems,c):c)):s(new rl)}catch(l){s(l)}}))));D(this,"setLibrary",t=>{let o=new Promise(async(n,r)=>{try{await this.getLastUpdateTask(),typeof t=="function"&&(t=t(this.currLibraryItems)),this.currLibraryItems=hm(await t),n(this.currLibraryItems)}catch(a){r(a)}}).catch(n=>{if(n.name==="AbortError")return console.warn("Library update aborted by user"),this.currLibraryItems;throw n}).finally(()=>{this.updateQueue=this.updateQueue.filter(n=>n!==o),this.notifyListeners()});return this.updateQueue.push(o),this.notifyListeners(),o});this.app=t}},_5=jx,pc=e=>{let o=Math.ceil(Math.sqrt(e.length)),n=[],r=u=>e.slice(u*o,u*o+o).reduce((g,f)=>{let{height:w}=Wx(f.elements);return Math.max(g,w)},0),a=u=>{let h=0,g=0,f=0;for(let w of e){if(h%o===0&&(g=0),g===u){let{width:y}=Wx(w.elements);f=Math.max(f,y)}h++,g++}return f},i=0,s=0,l=0,c=0,m=0,p=0,d=0;for(let u of e){m&&m%o===0&&(s+=l+50,i=0,p=0,d++),p===0&&(l=r(d)),c=a(p);let{minX:h,minY:g,width:f,height:w}=Wx(u.elements),y=(c-f)/2,v=(l-w)/2;n.push(...u.elements.map(E=>({...E,x:E.x+i+y-h,y:E.y+s+v-g}))),i+=c+50,m++,p++}return n},Xz=(e,t=Kz)=>{if(typeof t=="function"?t(e):t.some(o=>{let n=new URL(`https://${o.replace(/^https?:\/\//,"")}`),{hostname:r,pathname:a}=new URL(e);return new RegExp(`(^|\\.)${n.hostname}$`).test(r)&&new RegExp(`^${n.pathname.replace(/\/+$/,"")}(/+|$)`).test(a)}))return!0;throw new Error(`Invalid or disallowed library URL: "${e}"`)},Zx=()=>{let e=new URLSearchParams(window.location.hash.slice(1)).get(Kx.addLibrary)||new URLSearchParams(window.location.search).get(Yx.addLibrary),t=e?new URLSearchParams(window.location.hash.slice(1)).get("token"):null;return e?{libraryUrl:e,idToken:t}:null},di=class di{constructor(t){D(this,"adapter");this.adapter=t}static async getLibraryItems(t,o,n=!0){let r=()=>new Promise(async(a,i)=>{try{let s=await t.load({source:o});a(kd(s?.libraryItems||[],"published"))}catch(s){i(s)}});return n?di.queue.push(r):r()}getLibraryItems(t){return di.getLibraryItems(this.adapter,t,!1)}};D(di,"queue",new Gz),D(di,"run",async(t,o)=>{let n=new di(t);return di.queue.push(()=>o(n))});var mc=di,fm=0,wg=0,qx=e=>`${e.id}:${e.name||""}:${Vz(e.elements)}`,vg=e=>Wz(e.map(t=>qx(t)).sort().join()),M5=async(e,t)=>{try{return wg++,await mc.run(e,async o=>{let n=Xx(await o.getLibraryItems("save"));for(let[s]of t.deletedItems)n.delete(s);let r=[];for(let[s,l]of t.addedItems)n.has(s)?n.set(s,l):r.push(l);if(t.updatedItems)for(let[s,l]of t.updatedItems)n.set(s,l);let a=r.concat(Array.from(n.values())),i=vg(a);return i!==fm&&await e.save({libraryItems:a}),fm=i,a})}finally{wg--}},jz=e=>{let{excalidrawAPI:t}=e,o=k5(e);o.current=e;let n=k5(!1);T5(()=>{if(!t)return;n.current=!1;let r=async({libraryUrl:s,idToken:l})=>{let c=new Promise(async(p,d)=>{try{s=decodeURIComponent(s),s=Hz(s),Xz(s,o.current.validateLibraryUrl);let h=await(await fetch(s)).blob();p(h)}catch(u){d(u)}}),m=l!==t.id;await(m&&document.hidden?new Promise(p=>{window.addEventListener("focus",()=>p(),{once:!0})}):null);try{await t.updateLibrary({libraryItems:c,prompt:m,merge:!0,defaultStatus:"published",openLibraryMenu:!0})}catch(p){throw t.updateScene({appState:{errorMessage:p.message}}),p}finally{if(window.location.hash.includes(Kx.addLibrary)){let p=new URLSearchParams(window.location.hash.slice(1));p.delete(Kx.addLibrary),window.history.replaceState({},C5,`#${p.toString()}`)}else if(window.location.search.includes(Yx.addLibrary)){let p=new URLSearchParams(window.location.search);p.delete(Yx.addLibrary),window.history.replaceState({},C5,`?${p.toString()}`)}}},a=s=>{s.preventDefault();let l=Zx();l&&(s.stopImmediatePropagation(),window.history.replaceState({},"",s.oldURL),r(l))},i=Zx();if(i&&r(i),"getInitialLibraryItems"in o.current&&o.current.getInitialLibraryItems&&(console.warn("useHandleLibrar `opts.getInitialLibraryItems` is deprecated. Use `opts.adapter` instead."),Promise.resolve(o.current.getInitialLibraryItems()).then(s=>{t.updateLibrary({libraryItems:s,merge:!0})}).catch(s=>{console.error(`UseHandeLibrary getInitialLibraryItems failed: ${s?.message}`)})),"adapter"in o.current&&o.current.adapter){let s=o.current.adapter,l=o.current.migrationAdapter,c=Uz();l?c.resolve(S5(l.load).then(async m=>{let p=null;try{if(!m)return mc.getLibraryItems(s,"load");p=kd(m.libraryItems||[],"published");let d=await M5(s,L5([],p));try{await l.clear()}catch(u){console.error(`couldn't delete legacy library data: ${u.message}`)}return d}catch(d){return console.error(`couldn't migrate legacy library data: ${d.message}`),p}}).catch(m=>(console.error(`error during library migration: ${m.message}`),mc.getLibraryItems(s,"load")))):c.resolve(S5(mc.getLibraryItems,s,"load")),t.updateLibrary({libraryItems:c.then(m=>{let p=m||[];return fm=vg(p),p}),merge:!0}).finally(()=>{n.current=!0})}return window.addEventListener(yg.HASHCHANGE,a),()=>{window.removeEventListener(yg.HASHCHANGE,a)}},[t]),T5(()=>{let r=P5.on(async(i,s)=>{let l=n.current,c="adapter"in o.current&&o.current.adapter||null;try{c&&fm!==vg(s)&&await M5(c,i)}catch(m){console.error(`couldn't persist library update: ${m.message}`,i),l&&o.current.excalidrawAPI&&o.current.excalidrawAPI.updateScene({appState:{errorMessage:b("errors.saveLibraryError")}})}}),a=i=>{wg&&zz(i)};return window.addEventListener(yg.BEFORE_UNLOAD,a),()=>{window.removeEventListener(yg.BEFORE_UNLOAD,a),r(),fm=0,wg=0}},[])};import Qz from"clsx";import{VERSIONS as Zz}from"@orangecatai/common";import{jsx as Jz}from"react/jsx-runtime";var qz=({theme:e,id:t,libraryReturnUrl:o})=>{let n=o||window.location.origin+window.location.pathname;return Jz("a",{className:"library-menu-browse-button",href:`${C.VITE_APP_LIBRARY_URL}?target=${window.name||"_blank"}&referrer=${n}&useHash=true&token=${t}&theme=${e}&version=${Zz.excalidrawLibrary}`,target:"_excalidraw_libraries",children:b("labels.libraries")})},D5=qz;import{jsx as eU,jsxs as tU}from"react/jsx-runtime";var Eg=({libraryReturnUrl:e,theme:t,id:o,style:n,children:r,className:a})=>tU("div",{className:Qz("library-menu-control-buttons",a),style:n,children:[eU(D5,{id:o,libraryReturnUrl:e,theme:t}),r]});import{useCallback as hc,useEffect as s1,useMemo as l1,useRef as b3,useState as x3}from"react";import{MIME_TYPES as IH,arrayToMap as TH,nextAnimationFrame as kH}from"@orangecatai/common";import{duplicateElements as CH}from"@orangecatai/element";import SH from"clsx";import oU from"lodash.throttle";import{useEffect as nU}from"react";var rU=je(0),R5=e=>{let[t,o]=ve(rU);return nU(()=>{let{current:n}=e;if(!n)return;let r=oU(()=>{let{scrollTop:a}=n;o(a)},200);return n.addEventListener("scroll",r),()=>{r.cancel(),n.removeEventListener("scroll",r)}},[e,o]),t};import QU from"clsx";import{useCallback as eH,useState as r1}from"react";import{muteFSAbortError as tH}from"@orangecatai/common";import{flushSync as N5}from"react-dom";import aU from"clsx";import{jsx as Ig,jsxs as sU}from"react/jsx-runtime";var iU=({label:e,onClick:t,className:o,children:n,actionType:r,type:a="button",isLoading:i,...s})=>{let l=r?`Dialog__action-button--${r}`:"";return sU("button",{className:aU("Dialog__action-button",l,o),type:a,"aria-label":e,onClick:t,...s,children:[n&&Ig("div",{style:i?{visibility:"hidden"}:{},children:n}),Ig("div",{style:i?{visibility:"hidden"}:{},children:e}),i&&Ig("div",{style:{position:"absolute",inset:0},children:Ig(So,{})})]})},ba=iU;import{jsx as B5,jsxs as F5}from"react/jsx-runtime";var lU=e=>{let{onConfirm:t,onCancel:o,children:n,confirmText:r=b("buttons.confirm"),cancelText:a=b("buttons.cancel"),className:i="",...s}=e,l=Je(),c=Cr(uc),{container:m}=St();return F5(Xt,{onCloseRequest:o,size:"small",...s,className:`confirm-dialog ${i}`,children:[n,F5("div",{className:"confirm-dialog-buttons",children:[B5(ba,{label:a,onClick:()=>{l({openMenu:null}),c(!1),N5(()=>{o()}),m?.focus()}}),B5(ba,{label:r,onClick:()=>{l({openMenu:null}),c(!1),N5(()=>{t()}),m?.focus()},actionType:"danger"})]})]})},Tg=lU;import{useCallback as hU,useEffect as e1,useRef as O5,useState as Jx}from"react";import{EDITOR_LS_KEYS as Qx,EXPORT_DATA_TYPES as fU,MIME_TYPES as z5,VERSIONS as bU,chunk as xU,getExportSource as yU}from"@orangecatai/common";var Gn=class{static has(t){try{return!!window.localStorage.getItem(t)}catch(o){return console.warn(`localStorage.getItem error: ${o.message}`),!1}}static get(t){try{let o=window.localStorage.getItem(t);return o?JSON.parse(o):null}catch(o){return console.warn(`localStorage.getItem error: ${o.message}`),null}}};D(Gn,"set",(t,o)=>{try{return window.localStorage.setItem(t,JSON.stringify(o)),!0}catch(n){return console.warn(`localStorage.setItem error: ${n.message}`),!1}}),D(Gn,"delete",t=>{try{window.localStorage.removeItem(t)}catch(o){console.warn(`localStorage.removeItem error: ${o.message}`)}});import kg from"react";var cU=/({{[\w-]+}})|(<[\w-]+>)|(<\/[\w-]+>)/g,dU=/{{([\w-]+)}}/,mU=/<([\w-]+)>/,pU=/<\/([\w-]+)>/,uU=(e,t)=>{let o=[{name:"",children:[]}];return e.split(cU).filter(Boolean).forEach(n=>{let r=n.match(mU),a=n.match(pU),i=n.match(dU);if(r!==null){let s=r[1];t.hasOwnProperty(s)?o.push({name:s,children:[]}):console.warn(`Trans: missed to pass in prop ${s} for interpolating ${e}`)}else if(a!==null)if(a[1]===o[o.length-1].name){let l=o.pop(),c=kg.createElement(kg.Fragment,{},...l.children),m=t[l.name];typeof m=="function"&&o[o.length-1].children.push(m(c))}else console.warn(`Trans: unexpected end tag ${n} for interpolating ${e}`);else if(i!==null){let s=i[1];t.hasOwnProperty(s)?o[o.length-1].children.push(t[s]):console.warn(`Trans: key ${s} not in props for interpolating ${e}`)}else o[o.length-1].children.push(n)}),o.length!==1&&console.warn(`Trans: stack not empty for interpolating ${e}`),o[0].children},gU=({i18nKey:e,children:t,...o})=>{let{t:n}=bt();return kg.createElement(kg.Fragment,{},...uU(n(e),o))},Yo=gU;import{jsx as rt,jsxs as Oo}from"react/jsx-runtime";var wU=async e=>{let n=Math.round(8),r=Math.max(Math.round(128/64),2),a=xU(e,6),i=document.createElement("canvas");i.width=a[0].length*128+(a[0].length+1)*(n*2)-n*2,i.height=a.length*128+(a.length+1)*(n*2)-n*2;let s=i.getContext("2d");s.fillStyle="#fff",s.fillRect(0,0,i.width,i.height);for(let[l,c]of e.entries()){let m=await ci({elements:c.elements,files:null,maxWidthOrHeight:128}),{width:p,height:d}=m,u=Math.floor(l/6)*(128+n*2),h=l%6*(128+n*2);s.drawImage(m,h+(128-p)/2+n,u+(128-d)/2+n),s.lineWidth=r,s.strokeStyle="#ced4da",s.strokeRect(h+n/2,u+n/2,128+n,128+n)}return await jp(new File([await as(i)],"preview",{type:z5.png}),{outputType:z5.jpg,maxWidthOrHeight:5e3})},vU=({libItem:e,appState:t,index:o,onChange:n,onRemove:r})=>{let a=O5(null),i=O5(null);return e1(()=>{let s=a.current;s&&(async()=>{let l=await cc({elements:e.elements,appState:{...t,viewBackgroundColor:"#fff",exportBackground:!0},files:null,skipInliningFonts:!0});s.innerHTML=l.outerHTML})()},[e.elements,t]),Oo("div",{className:"single-library-item",children:[e.status==="published"&&rt("span",{className:"single-library-item-status",children:b("labels.statusPublished")}),rt("div",{ref:a,className:"single-library-item__svg"}),rt(be,{"aria-label":b("buttons.remove"),type:"button",icon:Nn,className:"single-library-item--remove",onClick:r.bind(null,e.id),title:b("buttons.remove")}),Oo("div",{style:{display:"flex",margin:"0.8rem 0",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[Oo("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[Oo("div",{style:{padding:"0.5em 0"},children:[rt("span",{style:{fontWeight:500,color:"#868e96"},children:b("publishDialog.itemName")}),rt("span",{"aria-hidden":"true",className:"required",children:"*"})]}),rt("input",{type:"text",ref:i,style:{width:"80%",padding:"0.2rem"},defaultValue:e.name,placeholder:"Item name",onChange:s=>{n(s.target.value,o)}})]}),rt("span",{className:"error",children:e.error})]})]})},EU=({onClose:e,libraryItems:t,appState:o,onSuccess:n,onError:r,updateItemsInStorage:a,onRemove:i})=>{let[s,l]=Jx({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),[c,m]=Jx(!1);e1(()=>{let v=Gn.get(Qx.PUBLISH_LIBRARY);v&&l(v)},[]);let[p,d]=Jx(t.slice());e1(()=>{d(t.slice())},[t]);let u=v=>{l({...s,[v.target.name]:v.target.value})},h=async v=>{v.preventDefault(),m(!0);let E=[],I=!1;if(p.forEach(M=>{let P="";M.name||(P=b("publishDialog.errors.required"),I=!0),E.push({...M,error:P})}),I){d(E),m(!1);return}let k=await wU(p),S={type:fU.excalidrawLibrary,version:bU.excalidrawLibrary,source:yU(),libraryItems:p},T=JSON.stringify(S,null,2),A=new Blob([T],{type:"application/json"}),R=new FormData;R.append("excalidrawLib",A),R.append("previewImage",k),R.append("previewImageType",k.type),R.append("title",s.name),R.append("authorName",s.authorName),R.append("githubHandle",s.githubHandle),R.append("name",s.name),R.append("description",s.description),R.append("twitterHandle",s.twitterHandle),R.append("website",s.website),fetch(`${C.VITE_APP_LIBRARY_BACKEND}/submit`,{method:"post",body:R}).then(M=>M.ok?M.json().then(({url:P})=>{Gn.delete(Qx.PUBLISH_LIBRARY),n({url:P,authorName:s.authorName,items:p})}):M.json().catch(()=>{throw new Error(M.statusText||"something went wrong")}).then(P=>{throw new Error(P.message||M.statusText||"something went wrong")}),M=>{console.error(M),r(M),m(!1)}).catch(M=>{console.error(M),r(M),m(!1)})},g=()=>{let v=[];return p.forEach((E,I)=>{v.push(rt("div",{className:"single-library-item-wrapper",children:rt(vU,{libItem:E,appState:o,index:I,onChange:(k,S)=>{let T=p.slice();T[S].name=k,d(T)},onRemove:i})},I))}),rt("div",{className:"selected-library-items",children:v})},f=hU(()=>{a(p),Gn.set(Qx.PUBLISH_LIBRARY,s),e()},[p,e,a,s]),w=!!t.length,y=t.some(v=>v.status==="published");return rt(Xt,{onCloseRequest:f,title:b("publishDialog.title"),className:"publish-library",children:w?Oo("form",{onSubmit:h,children:[rt("div",{className:"publish-library-note",children:rt(Yo,{i18nKey:"publishDialog.noteDescription",link:v=>rt("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener",children:v})})}),rt("span",{className:"publish-library-note",children:rt(Yo,{i18nKey:"publishDialog.noteGuidelines",link:v=>rt("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:v})})}),rt("div",{className:"publish-library-note",children:b("publishDialog.noteItems")}),y&&rt("span",{className:"publish-library-note publish-library-warning",children:b("publishDialog.republishWarning")}),g(),Oo("div",{className:"publish-library__fields",children:[Oo("label",{children:[Oo("div",{children:[rt("span",{children:b("publishDialog.libraryName")}),rt("span",{"aria-hidden":"true",className:"required",children:"*"})]}),rt("input",{type:"text",name:"name",required:!0,value:s.name,onChange:u,placeholder:b("publishDialog.placeholder.libraryName")})]}),Oo("label",{style:{alignItems:"flex-start"},children:[Oo("div",{children:[rt("span",{children:b("publishDialog.libraryDesc")}),rt("span",{"aria-hidden":"true",className:"required",children:"*"})]}),rt("textarea",{name:"description",rows:4,required:!0,value:s.description,onChange:u,placeholder:b("publishDialog.placeholder.libraryDesc")})]}),Oo("label",{children:[Oo("div",{children:[rt("span",{children:b("publishDialog.authorName")}),rt("span",{"aria-hidden":"true",className:"required",children:"*"})]}),rt("input",{type:"text",name:"authorName",required:!0,value:s.authorName,onChange:u,placeholder:b("publishDialog.placeholder.authorName")})]}),Oo("label",{children:[rt("span",{children:b("publishDialog.githubUsername")}),rt("input",{type:"text",name:"githubHandle",value:s.githubHandle,onChange:u,placeholder:b("publishDialog.placeholder.githubHandle")})]}),Oo("label",{children:[rt("span",{children:b("publishDialog.twitterUsername")}),rt("input",{type:"text",name:"twitterHandle",value:s.twitterHandle,onChange:u,placeholder:b("publishDialog.placeholder.twitterHandle")})]}),Oo("label",{children:[rt("span",{children:b("publishDialog.website")}),rt("input",{type:"text",name:"website",pattern:"https?://.+",title:b("publishDialog.errors.website"),value:s.website,onChange:u,placeholder:b("publishDialog.placeholder.website")})]}),rt("span",{className:"publish-library-note",children:rt(Yo,{i18nKey:"publishDialog.noteLicense",link:v=>rt("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:v})})})]}),Oo("div",{className:"publish-library__buttons",children:[rt(ba,{label:b("buttons.saveLibNames"),onClick:f,"data-testid":"cancel-clear-canvas-button"}),rt(ba,{type:"submit",label:b("buttons.submit"),actionType:"primary",isLoading:c})]})]}):rt("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:b("publishDialog.atleastOneLibItem")})})},U5=EU;import d3 from"react";import{DropdownMenu as jU}from"radix-ui";import{CLASSES as ZU}from"@orangecatai/common";import kU from"clsx";import{useCallback as CU,useEffect as SU,useRef as MU}from"react";import{CLASSES as PU,EVENT as V5,KEYS as AU}from"@orangecatai/common";import{DropdownMenu as LU}from"radix-ui";import{forwardRef as H5}from"react";import G5 from"clsx";import{jsx as $5}from"react/jsx-runtime";var IU=H5(({children:e,gap:t,align:o,justifyContent:n,className:r,style:a},i)=>$5("div",{className:G5("Stack Stack_horizontal",r),style:{"--gap":t,alignItems:o,justifyContent:n,...a},ref:i,children:e})),TU=H5(({children:e,gap:t,align:o,justifyContent:n,className:r,style:a},i)=>$5("div",{className:G5("Stack Stack_vertical",r),style:{"--gap":t,justifyItems:o,justifyContent:n,...a},ref:i,children:e})),fo={Row:IU,Col:TU};import{jsx as Cg}from"react/jsx-runtime";var W5=({children:e,onClickOutside:t,className:o="",onSelect:n,open:r=!0,align:a="end",style:i})=>{let s=qe(),l=MU(null),c=ja({onClickOutside:t});Dl(l,CU(p=>{l.current?.closest(`.${PU.DROPDOWN_MENU_EVENT_WRAPPER}`)?.contains(p.target)||c.onClickOutside?.()},[c])),SU(()=>{if(!r)return;let p=u=>{u.key===AU.ESCAPE&&(u.stopImmediatePropagation(),c.onClickOutside?.())},d={capture:!0};return document.addEventListener(V5.KEYDOWN,p,d),()=>{document.removeEventListener(V5.KEYDOWN,p,d)}},[c,r]);let m=kU(`dropdown-menu ${o}`,{"dropdown-menu--mobile":s.formFactor==="phone"}).trim();return Cg(M0.Provider,{value:{onSelect:n},children:Cg(LU.Content,{ref:l,className:m,style:i,"data-testid":"dropdown-menu",align:a,sideOffset:8,onCloseAutoFocus:p=>p.preventDefault(),children:s.formFactor==="phone"?Cg(fo.Col,{className:"dropdown-menu-container",children:e}):Cg($t,{className:"dropdown-menu-container",padding:2,children:e})})})};W5.displayName="DropdownMenuContent";var K5=W5;import{jsx as DU}from"react/jsx-runtime";var _U=({children:e,className:t="",selected:o,...n})=>DU("div",{...n,className:`dropdown-menu-item-base dropdown-menu-item-custom ${t} ${o?"dropdown-menu-item--selected":""}`.trim(),children:e}),Y5=_U;import{DropdownMenu as RU}from"radix-ui";import{jsx as t1}from"react/jsx-runtime";var X5=({icon:e,shortcut:t,href:o,children:n,onSelect:r,className:a="",selected:i,rel:s="noopener",...l})=>{let c=Lu(r);return t1(RU.Item,{className:"radix-menu-item",onSelect:c,asChild:!0,children:t1("a",{...l,href:o,target:"_blank",rel:`noopener ${s}`,className:ei(a,i),title:l.title??l["aria-label"],children:t1(ti,{icon:e,shortcut:t,children:n})})})},gc=X5;X5.displayName="DropdownMenuItemLink";import{jsx as NU}from"react/jsx-runtime";var j5=()=>NU("div",{style:{height:"1px",backgroundColor:"var(--default-border-color)",margin:"6px 0",flex:"0 0 auto"}}),Z5=j5;j5.displayName="DropdownMenuSeparator";import{DropdownMenu as GU}from"radix-ui";import BU from"clsx";import{DropdownMenu as FU}from"radix-ui";import{useCallback as OU,useState as q5}from"react";import{jsx as n1}from"react/jsx-runtime";var o1=-4,zU=4,J5=({children:e,className:t})=>{let o=qe(),n=BU(`dropdown-menu dropdown-submenu ${t}`,{"dropdown-menu--mobile":o.formFactor==="phone"}).trim(),r=OU(c=>{if(c){let p=c.closest(".dropdown-menu-container")?.getBoundingClientRect();if(p){let d=c.getBoundingClientRect().width,h=window.innerWidth-p.right;h<d+20&&(i(h-d+o1),l(o1+8))}}},[]),[a,i]=q5(zU),[s,l]=q5(o1);return n1(FU.SubContent,{className:n,sideOffset:a,alignOffset:s,collisionPadding:8,ref:r,children:o.formFactor==="phone"?n1(fo.Col,{className:"dropdown-menu-container",children:e}):n1($t,{className:"dropdown-menu-container",padding:2,style:{zIndex:1},children:e})})},Q5=J5;J5.displayName="DropdownMenuSubContent";import{DropdownMenu as UU}from"radix-ui";import{jsx as e3,jsxs as HU}from"react/jsx-runtime";var t3=({children:e,icon:t,shortcut:o,className:n})=>HU(UU.SubTrigger,{className:`${ei(n)} dropdown-menu__submenu-trigger`,children:[e3(ti,{icon:t,shortcut:o,children:e}),e3("div",{className:"dropdown-menu__submenu-trigger-icon",children:dT})]}),o3=t3;t3.displayName="DropdownMenuSubTrigger";import n3 from"react";var Sg=e=>t=>{let o=n3.Children.toArray(t).find(n=>n3.isValidElement(n)&&typeof n.type!="string"&&n?.type.displayName&&n.type.displayName===e);return o||null},r3=Sg("DropdownMenuTrigger"),a3=Sg("DropdownMenuContent"),i3=Sg("DropdownMenuSubTrigger"),s3=Sg("DropdownMenuSubContent");import{jsxs as $U}from"react/jsx-runtime";var Mg=({children:e})=>{let t=i3(e),o=s3(e);return $U(GU.Sub,{children:[t,o]})};Mg.Trigger=o3;Mg.Content=Q5;Mg.displayName="DropdownMenuSub";var mi=Mg;import VU from"clsx";import{DropdownMenu as WU}from"radix-ui";import{jsx as KU}from"react/jsx-runtime";var l3=({className:e="",children:t,onToggle:o,title:n,...r})=>{let a=qe(),i=VU(`dropdown-menu-button ${e}`,"zen-mode-transition",{"dropdown-menu-button--mobile":a.formFactor==="phone"}).trim();return KU(WU.Trigger,{className:i,onClick:o,type:"button","data-testid":"dropdown-menu-button",title:n,...r,children:t})},c3=l3;l3.displayName="DropdownMenuTrigger";import{jsx as XU}from"react/jsx-runtime";var YU=e=>XU(No,{...e,icon:e.checked?nu:cT}),xa=YU;import{jsx as JU,jsxs as qU}from"react/jsx-runtime";var gr=({children:e,open:t})=>{let o=r3(e),n=a3(e),r=n&&d3.isValidElement(n)?d3.cloneElement(n,{open:t}):n;return JU(jU.Root,{open:t,modal:!1,children:qU("div",{className:ZU.DROPDOWN_MENU_EVENT_WRAPPER,style:{display:"contents"},children:[o,r]})})};gr.Trigger=c3;gr.Content=K5;gr.Item=No;gr.ItemCheckbox=xa;gr.ItemLink=gc;gr.ItemCustom=Y5;gr.Group=$d;gr.Separator=Z5;gr.Sub=mi;var Ue=gr;gr.displayName="DropdownMenu";import{jsx as rn,jsxs as Pg}from"react/jsx-runtime";var oH=(e,t)=>e.filter(o=>t.includes(o.id)),nH=({setAppState:e,selectedItems:t,library:o,onRemoveFromLibrary:n,resetLibrary:r,onSelectItems:a,appState:i,className:s})=>{let[l]=ve(fa),[c,m]=ve(uc),p=()=>{let R=t.length?b("alerts.removeItemsFromsLibrary",{count:t.length}):b("alerts.resetLibrary"),M=t.length?b("confirmDialog.removeItemsFromLib"):b("confirmDialog.resetLibrary");return rn(Tg,{onConfirm:()=>{t.length?n():r(),u(!1)},onCancel:()=>{u(!1)},title:M,children:rn("p",{children:R})})},[d,u]=r1(!1),h=!!t.length,g=h?l.libraryItems.filter(R=>t.includes(R.id)):l.libraryItems,f=h?b("buttons.remove"):b("buttons.resetLibrary"),[w,y]=r1(!1),[v,E]=r1(null),I=eH(()=>Pg(Xt,{onCloseRequest:()=>E(null),title:b("publishSuccessDialog.title"),className:"publish-library-success",size:"small",children:[rn("p",{children:rn(Yo,{i18nKey:"publishSuccessDialog.content",authorName:v.authorName,link:R=>rn("a",{href:v?.url,target:"_blank",rel:"noopener noreferrer",children:R})})}),rn(be,{type:"button",title:b("buttons.close"),"aria-label":b("buttons.close"),label:b("buttons.close"),onClick:()=>E(null),"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]}),[E,v]),k=(R,M)=>{y(!1),E({url:R.url,authorName:R.authorName});let P=M.slice();P.forEach(F=>{t.includes(F.id)&&(F.status="published")}),o.setLibrary(P)},S=async()=>{try{await o.updateLibrary({libraryItems:il({description:"Excalidraw library files"}),merge:!0,openLibraryMenu:!0})}catch(R){if(R?.name==="AbortError"){console.warn(R);return}e({errorMessage:b("errors.importLibraryError")})}},T=async()=>{let R=h?g:await o.getLatestLibrary();JE(R).catch(tH).catch(M=>{e({errorMessage:M.message})})},A=()=>Pg(Ue,{open:c,children:[rn(Ue.Trigger,{onToggle:()=>m(!c),children:v2}),Pg(Ue.Content,{onClickOutside:()=>m(!1),onSelect:()=>m(!1),className:"library-menu",children:[!h&&rn(Ue.Item,{onSelect:S,icon:vl,"data-testid":"lib-dropdown--load",children:b("buttons.load")}),!!g.length&&rn(Ue.Item,{onSelect:T,icon:ls,"data-testid":"lib-dropdown--export",children:b("buttons.export")}),h&&rn(Ue.Item,{icon:AI,onSelect:()=>y(!0),"data-testid":"lib-dropdown--remove",children:b("buttons.publishLibrary")}),!!g.length&&rn(Ue.Item,{onSelect:()=>u(!0),icon:Co,children:f})]})]});return Pg("div",{className:QU("library-menu-dropdown-container",s),children:[A(),t.length>0&&rn("div",{className:"library-actions-counter",children:t.length}),d&&p(),w&&rn(U5,{onClose:()=>y(!1),libraryItems:oH(l.libraryItems,t),appState:i,onSuccess:R=>k(R,l.libraryItems),onError:R=>window.alert(R),updateItemsInStorage:()=>o.setLibrary(l.libraryItems),onRemove:R=>a(t.filter(M=>M!==R))}),v&&I()]})},m3=({selectedItems:e,onSelectItems:t,className:o})=>{let{library:n}=Mt(),{clearLibraryCache:r,deleteItemsFromLibraryCache:a}=dc(),i=Ze(),s=Je(),[l]=ve(fa),c=async p=>{let d=p.filter(u=>!e.includes(u.id));n.setLibrary(d).catch(()=>{s({errorMessage:b("alerts.errorRemovingFromLibrary")})}),a(e),t([])};return rn(nH,{appState:i,setAppState:s,selectedItems:e,onSelectItems:t,library:n,onRemoveFromLibrary:()=>c(l.libraryItems),resetLibrary:()=>{n.resetLibrary(),r()},className:o})};import{memo as mH,useEffect as pH,useState as uH}from"react";import rH,{useCallback as aH}from"react";function iH(){return[!1,aH(t=>t(),[])]}var p3=rH.useTransition||iH;import u3 from"clsx";import{memo as sH,useRef as lH,useState as cH}from"react";import{jsx as Ag,jsxs as dH}from"react/jsx-runtime";var g3=sH(({id:e,elements:t,isPending:o,onClick:n,selected:r,onToggle:a,onDrag:i,svgCache:s})=>{let l=lH(null),c=xg(e,t,s,l),[m,p]=cH(!1),d=qe().formFactor==="phone",u=o&&Ag("div",{className:"library-unit__adder",children:w2});return dH("div",{className:u3("library-unit",{"library-unit__active":t,"library-unit--hover":t&&m,"library-unit--selected":r,"library-unit--skeleton":!c}),onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[Ag("div",{className:u3("library-unit__dragger",{"library-unit__pulse":!!o}),ref:l,draggable:!!t,onClick:t||o?h=>{e&&h.shiftKey?a(e,h):n(e)}:void 0,onDragStart:h=>{if(!e){h.preventDefault();return}p(!1),i(e,h)}}),u,e&&t&&(m||d||r)&&Ag(Zd,{checked:r,onChange:(h,g)=>a(e,g),className:"library-unit__checkbox"})]})}),h3=()=>Ag("div",{className:"library-unit library-unit--skeleton"});import{Fragment as gH,jsx as Lg}from"react/jsx-runtime";var _g=({children:e})=>Lg("div",{className:"library-menu-items-container__grid",children:e}),bm=mH(({items:e,onItemSelectToggle:t,onItemDrag:o,isItemSelected:n,onClick:r,svgCache:a,itemsRenderedPerBatch:i})=>{let[,s]=p3(),[l,c]=uH(0);return pH(()=>{l<e.length&&s(()=>{c(l+i)})},[l,e.length,s,i]),Lg(gH,{children:e.map((m,p)=>p<l?Lg(g3,{elements:m?.elements,isPending:!m?.id&&!!m?.elements,onClick:r,svgCache:a,id:m?.id,selected:n(m.id),onToggle:t,onDrag:o},m?.id??p):Lg(h3,{},p))})});import a1 from"clsx";import{forwardRef as xH,useRef as yH,useImperativeHandle as wH,useLayoutEffect as vH,useState as EH}from"react";import hH from"clsx";import{composeEventHandlers as fH}from"@orangecatai/common";import{jsx as bH}from"react/jsx-runtime";var Xo=({type:e="button",onSelect:t,selected:o,children:n,className:r="",...a})=>bH("button",{onClick:fH(a.onClick,i=>{t()}),type:e,className:hH("excalidraw-button",r,{selected:o}),...a,children:n});import{jsx as i1,jsxs as f3}from"react/jsx-runtime";var pi=xH(({onChange:e,label:t,fullWidth:o,placeholder:n,readonly:r,selectOnRender:a,onKeyDown:i,isRedacted:s=!1,icon:l,className:c,type:m,...p},d)=>{let u=yH(null);wH(d,()=>u.current),vH(()=>{a&&(u.current?.focus(),u.current?.select())},[a]);let[h,g]=EH(!1);return f3("div",{className:a1("ExcTextField",c,{"ExcTextField--fullWidth":o,"ExcTextField--hasIcon":!!l}),onClick:()=>{u.current?.focus()},children:[l,t&&i1("div",{className:"ExcTextField__label",children:t}),f3("div",{className:a1("ExcTextField__input",{"ExcTextField__input--readonly":r}),children:[i1("input",{className:a1({"is-redacted":"value"in p&&p.value&&s&&!h}),readOnly:r,value:"value"in p?p.value:void 0,defaultValue:"defaultValue"in p?p.defaultValue:void 0,placeholder:n,ref:u,onChange:f=>e?.(f.target.value),onKeyDown:i,type:m}),s&&i1(Xo,{onSelect:()=>g(!h),style:{border:0,userSelect:"none"},children:h?OI:kl})]})]})});import{Fragment as y3,jsx as bo,jsxs as Fr}from"react/jsx-runtime";var MH=17,PH=64;function c1({isLoading:e,libraryItems:t,onAddToLibrary:o,onInsertLibraryItems:n,pendingElements:r,theme:a,id:i,libraryReturnUrl:s,onSelectItems:l,selectedItems:c}){let m=qe(),p=b3(null),d=R5(p);s1(()=>{d>0&&p.current?.scrollTo(0,d)},[]);let{svgCache:u}=dc(),[h,g]=x3(null),[f,w]=x3(""),y=!t.length&&!r.length,v=!y&&!!f.trim(),E=l1(()=>{let _=vs(f.trim().toLowerCase());return _?t.filter(L=>{let z=L.name||"";return z.trim()&&vs(z.toLowerCase()).includes(_)}):[]},[t,f]),I=l1(()=>t.filter(_=>_.status!=="published"),[t]),k=l1(()=>t.filter(_=>_.status==="published"),[t]),S=hc((_,L)=>{let z=!c.includes(_),O=[...I,...k];if(z){if(L.shiftKey&&h){let K=O.findIndex(fe=>fe.id===h),ie=O.findIndex(fe=>fe.id===_);if(K===-1||ie===-1){l([...c,_]);return}let Z=TH(c),Q=Math.min(K,ie),H=Math.max(K,ie),ne=O.reduce((fe,j,se)=>((se>=Q&&se<=H||Z.has(j.id))&&fe.push(j.id),fe),[]);l(ne)}else l([...c,_]);g(_)}else g(null),l(c.filter(K=>K!==_))},[h,l,k,c,I]);s1(()=>{c.length||g(null)},[c]);let T=hc(_=>{let L;return c.includes(_)?L=t.filter(z=>c.includes(z.id)):L=t.filter(z=>z.id===_),L.map(z=>({...z,elements:CH({type:"everything",elements:z.elements,randomizeSeed:!0}).duplicatedElements}))},[t,c]),A=hc((_,L)=>{let z={itemIds:c.includes(_)?c:[_]};L.dataTransfer.setData(IH.excalidrawlibIds,JSON.stringify(z))},[c]),R=hc(_=>_?c.includes(_):!1,[c]),M=hc(()=>{o(r)},[r,o]),P=hc(_=>{_&&n(T(_))},[T,n]),F=u.size>=(E.length?E:t).length?PH:MH,U=b3(null);s1(()=>{kH(()=>{U.current?.focus()})},[]);let B=!v&&Fr(y3,{children:[!y&&bo("div",{className:"library-menu-items-container__header",children:b("labels.personalLib")}),!r.length&&!I.length?Fr("div",{className:"library-menu-items__no-items",children:[!k.length&&bo("div",{className:"library-menu-items__no-items__label",children:b("library.noItems")}),bo("div",{className:"library-menu-items__no-items__hint",children:k.length>0?b("library.hint_emptyPrivateLibrary"):b("library.hint_emptyLibrary")})]}):Fr(_g,{children:[r.length>0&&bo(bm,{itemsRenderedPerBatch:F,items:[{id:null,elements:r}],onItemSelectToggle:S,onItemDrag:A,onClick:M,isItemSelected:R,svgCache:u}),bo(bm,{itemsRenderedPerBatch:F,items:I,onItemSelectToggle:S,onItemDrag:A,onClick:P,isItemSelected:R,svgCache:u})]}),k.length>0&&bo("div",{className:"library-menu-items-container__header",style:{marginTop:"0.75rem"},children:b("labels.excalidrawLib")}),k.length>0&&bo(_g,{children:bo(bm,{itemsRenderedPerBatch:F,items:k,onItemSelectToggle:S,onItemDrag:A,onClick:P,isItemSelected:R,svgCache:u})})]}),G=v&&Fr(y3,{children:[Fr("div",{className:"library-menu-items-container__header",children:[b("library.search.heading"),!e&&Fr("div",{className:"library-menu-items-container__header__hint",style:{cursor:"pointer"},onPointerDown:_=>_.preventDefault(),onClick:_=>{w("")},children:[bo("kbd",{children:"esc"})," to clear"]})]}),E.length>0?bo(_g,{children:bo(bm,{itemsRenderedPerBatch:F,items:E,onItemSelectToggle:S,onItemDrag:A,onClick:P,isItemSelected:R,svgCache:u})}):Fr("div",{className:"library-menu-items__no-items",children:[bo("div",{className:"library-menu-items__no-items__hint",children:b("library.search.noResults")}),bo(Xo,{onPointerDown:_=>_.preventDefault(),onSelect:()=>{w("")},style:{width:"auto",marginTop:"1rem"},children:b("library.search.clearSearch")})]})]});return Fr("div",{className:"library-menu-items-container",style:r.length||I.length||k.length?{justifyContent:"flex-start"}:{borderBottom:0},children:[Fr("div",{className:"library-menu-items-header",children:[!y&&bo(pi,{ref:U,type:"search",className:SH("library-menu-items-container__search",{hideCancelButton:m.formFactor!=="phone"}),placeholder:b("library.search.inputPlaceholder"),value:f,onChange:_=>w(_)}),bo(m3,{selectedItems:c,onSelectItems:l,className:"library-menu-dropdown-container--in-heading"})]}),Fr(fo.Col,{className:"library-menu-items-container__items",align:"start",gap:1,style:{flex:k.length>0?1:"0 1 auto",margin:y?"auto":0},ref:p,children:[e&&bo("div",{style:{position:"absolute",top:"var(--container-padding-y)",right:"var(--container-padding-x)",transform:"translateY(50%)"},children:bo(So,{})}),B,G,y&&bo(Eg,{style:{padding:"16px 0",width:"100%"},id:i,libraryReturnUrl:s,theme:a})]})]})}import{jsx as ui,jsxs as E3}from"react/jsx-runtime";var uc=je(!1),v3=({children:e})=>ui("div",{className:"layer-ui__library",children:e}),OH=k3(({onInsertLibraryItems:e,pendingElements:t,onAddToLibrary:o,setAppState:n,libraryReturnUrl:r,library:a,id:i,theme:s,selectedItems:l,onSelectItems:c})=>{let[m]=ve(fa),p=m1(h=>{(async(f,w)=>{Ne("element","addToLibrary","ui");for(let v of LH)if(f.some(E=>E.type===v))return n({errorMessage:b(`errors.libraryElementTypeError.${v}`)});let y=[{status:"unpublished",elements:f,id:_H(),created:Date.now()},...w];o(),a.setLibrary(y).catch(()=>{n({errorMessage:b("alerts.errorAddingToLibrary")})})})(h,m.libraryItems)},[o,a,n,m.libraryItems]),d=T3(()=>m.libraryItems,[m]);if(m.status==="loading"&&!m.isInitialized)return ui(v3,{children:ui("div",{className:"layer-ui__library-message",children:E3("div",{children:[ui(So,{size:"2em"}),ui("span",{children:b("labels.libraryLoadingMessage")})]})})});let u=m.libraryItems.length>0||t.length>0;return E3(v3,{children:[ui(c1,{isLoading:m.status==="loading",libraryItems:d,onAddToLibrary:p,onInsertLibraryItems:e,pendingElements:t,id:i,libraryReturnUrl:r,theme:s,onSelectItems:c,selectedItems:l}),u&&ui(Eg,{className:"library-menu-control-buttons--at-bottom",style:{padding:"16px 12px 0 12px"},id:i,libraryReturnUrl:r,theme:s})]})}),d1=(e,t)=>({elements:e,pending:Me(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}),selectedElementIds:t}),zH=(e,t)=>{let o=Fn(),[n,r]=I3(()=>d1(o,e.selectedElementIds)),a=AH(new Map);return p1(()=>{for(let i of n.pending)a.current.set(i.id,i.version)},[n.pending]),p1(()=>{t.state.cursorButton==="up"&&t.state.activeTool.type==="selection"&&r(i=>{if(!DH(i.selectedElementIds,e.selectedElementIds))return a.current.clear(),d1(o,e.selectedElementIds);let s=t.scene.getNonDeletedElementsMap();for(let l of Object.keys(e.selectedElementIds)){let c=s.get(l)?.version;if(c&&c!==a.current.get(l))return d1(o,e.selectedElementIds)}return i})},[t,t.state.cursorButton,t.state.activeTool.type,e.selectedElementIds,o]),n.pending},C3=k3(()=>{let e=Mt(),{onInsertElements:t}=e,o=_r(),n=Ze(),r=Je(),[a,i]=I3([]),s=T3(()=>e.library,[e.library]),l=zH(n,e);p1(()=>BH(document,FH.KEYDOWN,p=>{if(p.key===RH.ESCAPE&&p.target instanceof HTMLElement){let d=p.target;if(d.closest(`.${w3.SIDEBAR}`))a.length>0?(p.stopPropagation(),i([])):NH(d)&&d instanceof HTMLInputElement&&!d.value&&(p.stopPropagation(),r({openSidebar:null}),e.focusContainer());else if(a.length>0){let{x:u,y:h}=e.lastViewportPosition;document.elementFromPoint(u,h)?.closest(`.${w3.SIDEBAR}`)&&(p.stopPropagation(),i([]))}}},{capture:!0}),[a,r,e]);let c=m1(p=>{t(pc(p)),e.focusContainer()},[t,e]),m=m1(()=>{r({selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null})},[r]);return ui(OH,{pendingElements:l,onInsertLibraryItems:c,onAddToLibrary:m,setAppState:r,libraryReturnUrl:o.libraryReturnUrl,library:s,id:e.id,theme:n.theme,selectedItems:a,onSelectItems:i})});import UH from"clsx";import{useRef as HH}from"react";import{createPortal as GH}from"react-dom";import{KEYS as $H}from"@orangecatai/common";import{jsx as S3,jsxs as VH}from"react/jsx-runtime";var M3=e=>{let{closeOnClickOutside:t=!0}=e,o=Eu({className:"excalidraw-modal-container"}),n=HH(document.body.classList.contains("excalidraw-animations-disabled"));if(!o)return null;let r=a=>{a.key===$H.ESCAPE&&(a.nativeEvent.stopImmediatePropagation(),a.stopPropagation(),e.onCloseRequest())};return GH(VH("div",{className:UH("Modal",e.className,{"animations-disabled":n.current}),role:"dialog","aria-modal":"true",onKeyDown:r,"aria-labelledby":e.labelledBy,children:[S3("div",{className:"Modal__background",onClick:t?e.onCloseRequest:void 0}),S3("div",{className:"Modal__content",style:{"--max-width":`${e.maxWidth}px`},tabIndex:0,children:e.children})]}),o)};import{jsx as xm,jsxs as ZH}from"react/jsx-runtime";function jH(e){if(e&&typeof e=="number")return e;switch(e){case"small":return 550;case"wide":return 1024;case"regular":default:return 800}}var Xt=e=>{let[t,o]=v5(),[n]=YH(document.activeElement),{id:r}=St(),a=qe().formFactor==="phone";KH(()=>{if(!t)return;let c=P3(t);setTimeout(()=>{c.length>0&&e.autofocus!==!1&&(c[1]||c[0]).focus()});let m=p=>{if(p.key===XH.TAB){let d=P3(t),{activeElement:u}=document,h=d.findIndex(g=>g===u);h===0&&p.shiftKey?(d[d.length-1].focus(),p.preventDefault()):h===d.length-1&&!p.shiftKey&&(d[0].focus(),p.preventDefault())}};return t.addEventListener("keydown",m),()=>t.removeEventListener("keydown",m)},[t,e.autofocus]);let i=Je(),s=Cr(uc),l=()=>{i({openMenu:null}),s(!1),n.focus(),e.onCloseRequest()};return xm(M3,{className:WH("Dialog",e.className,{"Dialog--fullscreen":a}),labelledBy:"dialog-title",maxWidth:jH(e.size),onCloseRequest:l,closeOnClickOutside:e.closeOnClickOutside,children:ZH($t,{ref:o,children:[e.title&&xm("h2",{id:`${r}-dialog-title`,className:"Dialog__title",children:xm("span",{className:"Dialog__titleContent",children:e.title})}),a&&xm("button",{className:"Dialog__close",onClick:l,title:b("buttons.close"),"aria-label":b("buttons.close"),type:"button",children:Nn}),xm("div",{className:"Dialog__content",children:e.children})]})})};import{KEYS as Ot}from"@orangecatai/common";var Dg=[{icon:El,value:"hand",key:Ot.H,numericKey:null,fillable:!1,toolbar:!0},{icon:ss,value:"selection",key:Ot.V,numericKey:Ot[1],fillable:!0,toolbar:!0},{icon:gl,value:"rectangle",key:Ot.R,numericKey:Ot[2],fillable:!0,toolbar:!0},{icon:hl,value:"diamond",key:Ot.D,numericKey:Ot[3],fillable:!0,toolbar:!0},{icon:fl,value:"ellipse",key:Ot.O,numericKey:Ot[4],fillable:!0,toolbar:!0},{icon:eu,value:"arrow",key:Ot.A,numericKey:Ot[5],fillable:!0,toolbar:!0},{icon:bl,value:"line",key:Ot.L,numericKey:Ot[6],fillable:!0,toolbar:!0},{icon:Mr,value:"freedraw",key:[Ot.P,Ot.X],numericKey:Ot[7],fillable:!1,toolbar:!0},{icon:Pr,value:"text",key:Ot.T,numericKey:Ot[8],fillable:!1,toolbar:!0},{icon:xl,value:"image",key:null,numericKey:Ot[9],fillable:!1,toolbar:!0},{icon:tu,value:"eraser",key:Ot.E,numericKey:Ot[0],fillable:!1,toolbar:!0},{icon:Lr,value:"laser",key:Ot.K,numericKey:null,fillable:!1,toolbar:!1}],u1=e=>e.state.preferredSelectionTool.type==="lasso"?[{value:"lasso",icon:ss,key:Ot.V,numericKey:Ot[1],fillable:!0,toolbar:!0},...Dg.slice(1)]:Dg,A3=(e,t)=>u1(t).find((n,r)=>n.numericKey!=null&&e===n.numericKey.toString()||n.key&&(typeof n.key=="string"?n.key===e:n.key.includes(e)))?.value||null;import zr from"clsx";import{useRef as aG,useState as iG}from"react";import{Popover as hi}from"radix-ui";import{CLASSES as B3,KEYS as sG,capitalizeString as gi,isTransparent as Ng}from"@orangecatai/common";import{shouldAllowVerticalAlign as F3,suppportsHorizontalAlign as O3,hasBoundTextElement as Bg,isElbowArrow as b1,isImageElement as z3,isLinearElement as x1,isTextElement as Og,isArrowElement as R3,hasStrokeColor as N3,toolIsArrow as Fg}from"@orangecatai/element";import{createIsolation as qH}from"jotai-scope";import g1 from"react";import Or from"tunnel-rat";var h1=g1.createContext(null),kt=()=>g1.useContext(h1),JH=qH(),L3=()=>g1.useMemo(()=>({MainMenuTunnel:Or(),WelcomeScreenMenuHintTunnel:Or(),WelcomeScreenToolbarHintTunnel:Or(),WelcomeScreenHelpHintTunnel:Or(),WelcomeScreenCenterTunnel:Or(),FooterCenterTunnel:Or(),DefaultSidebarTriggerTunnel:Or(),DefaultSidebarTabTriggersTunnel:Or(),OverwriteConfirmDialogTunnel:Or(),TTDDialogTriggerTunnel:Or(),tunnelsJotai:JH}),[]);import{CODES as QH,KEYS as eG}from"@orangecatai/common";import{CaptureUpdateAction as tG}from"@orangecatai/element";var Is=X({name:"viewMode",label:"labels.viewMode",icon:kl,viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.viewModeEnabled},perform(e,t){return{appState:{...t,viewModeEnabled:!this.checked(t)},captureUpdate:tG.EVENTUALLY}},checked:e=>e.viewModeEnabled,predicate:(e,t,o)=>typeof o.viewModeEnabled>"u",keyTest:e=>!e[eG.CTRL_OR_CMD]&&e.altKey&&e.code===QH.R});import{useEffect as oG,useState as nG}from"react";import _3 from"clsx";import{capitalizeString as D3}from"@orangecatai/common";import{Popover as f1}from"radix-ui";import{jsx as Rg,jsxs as rG}from"react/jsx-runtime";var fc=({app:e,options:t,activeTool:o,defaultOption:n,className:r="Shape",namePrefix:a,title:i,"data-testid":s,onToolChange:l,displayedOption:c,fillable:m=!1})=>{let[p,d]=nG(!1),u=o.type,h=c.type===u,g=32/2+10,{container:f}=St();return!t.some(w=>w.type===u)&&p&&d(!1),oG(()=>{let w=e.onPointerDownEmitter.on(()=>{d(!1)});return()=>w?.()},[e]),rG(f1.Root,{open:p,children:[Rg(f1.Trigger,{asChild:!0,children:Rg(be,{className:_3(r,{fillable:m,active:t.some(w=>w.type===o.type)}),type:"radio",icon:c.icon,checked:h,name:"editor-current-shape",title:i,"aria-label":i,"data-testid":s,onPointerDown:()=>{d(w=>!w),l(n)}})}),Rg(f1.Content,{className:"tool-popover-content",sideOffset:g,collisionBoundary:f??void 0,children:t.map(({type:w,icon:y,title:v})=>Rg(be,{className:_3(r,{active:u===w}),type:"radio",icon:y,checked:u===w,name:`${a}-option`,title:v||D3(w),keyBindingLabel:"","aria-label":v||D3(w),"data-testid":`toolbar-${w}`,onChange:()=>{e.state.activeTool.type!==w&&Ne("toolbar",w,"ui"),e.setActiveTool({type:w}),l?.(w)}},w))})]})};import{Fragment as vn,jsx as xe,jsxs as Qe}from"react/jsx-runtime";var y1=zr([B3.SHAPE_ACTIONS_THEME_SCOPE,"properties-content"]),ym=(e,t)=>{let o=t[0]?.type||null;for(let n of t)if(n.type!==o){o=null;break}return N3(e.activeTool.type)&&o!=="image"&&o!=="frame"&&o!=="magicframe"||t.some(n=>N3(n.type))},wm=(e,t)=>Tr(e.activeTool.type)||t.some(o=>Tr(o.type)),U3=({appState:e,elementsMap:t,renderAction:o,app:n})=>{let r=ol(t,e),a=!1;r.length===2&&(Bg(r[0])||Bg(r[1]))&&(a=!0);let i=!!(e.editingTextElement||e.newElement),s=qe(),l=document.documentElement.getAttribute("dir")==="rtl",c=Tr(e.activeTool.type)&&!Ng(e.currentItemBackgroundColor)||r.some(h=>Tr(h.type)&&!Ng(h.backgroundColor)),m=r.length===1||a,p=!e.selectedLinearElement?.isEditing&&r.length===1&&x1(r[0])&&!b1(r[0]),d=!e.croppingElementId&&r.length===1&&z3(r[0]),u=!a&&Ko(e,n);return Qe("div",{className:"selected-shape-actions",children:[xe("div",{children:ym(e,r)&&o("changeStrokeColor")}),wm(e,r)&&xe("div",{children:o("changeBackgroundColor")}),c&&o("changeFillStyle"),(yd(e.activeTool.type)||r.some(h=>yd(h.type)))&&o("changeStrokeWidth"),(e.activeTool.type==="freedraw"||r.some(h=>h.type==="freedraw"))&&o("changeStrokeShape"),(wd(e.activeTool.type)||r.some(h=>wd(h.type)))&&Qe(vn,{children:[o("changeStrokeStyle"),o("changeSloppiness")]}),(vd(e.activeTool.type)||r.some(h=>vd(h.type)))&&xe(vn,{children:o("changeRoundness")}),(Fg(e.activeTool.type)||r.some(h=>Fg(h.type)))&&xe(vn,{children:o("changeArrowType")}),(e.activeTool.type==="text"||r.some(Og))&&Qe(vn,{children:[o("changeFontFamily"),o("changeFontSize"),(e.activeTool.type==="text"||O3(r,t))&&o("changeTextAlign")]}),F3(r,t)&&o("changeVerticalAlign"),(nl(e.activeTool.type)||r.some(h=>nl(h.type)))&&xe(vn,{children:o("changeArrowhead")}),o("changeOpacity"),Qe("fieldset",{children:[xe("legend",{children:b("labels.layers")}),Qe("div",{className:"buttonList",children:[o("sendToBack"),o("sendBackward"),o("bringForward"),o("bringToFront")]})]}),u&&!a&&Qe("fieldset",{children:[xe("legend",{children:b("labels.align")}),Qe("div",{className:"buttonList",children:[l?Qe(vn,{children:[o("alignRight"),o("alignHorizontallyCentered"),o("alignLeft")]}):Qe(vn,{children:[o("alignLeft"),o("alignHorizontallyCentered"),o("alignRight")]}),r.length>2&&o("distributeHorizontally"),xe("div",{style:{flexBasis:"100%",height:0}}),Qe("div",{style:{display:"flex",flexWrap:"wrap",gap:".5rem",marginTop:"-0.5rem"},children:[o("alignTop"),o("alignVerticallyCentered"),o("alignBottom"),r.length>2&&o("distributeVertically")]})]})]}),!i&&r.length>0&&Qe("fieldset",{children:[xe("legend",{children:b("labels.actions")}),Qe("div",{className:"buttonList",children:[s.formFactor!=="phone"&&o("duplicateSelection"),s.formFactor!=="phone"&&o("deleteSelectedElements"),o("group"),o("ungroup"),m&&o("hyperlink"),d&&o("cropEditor"),p&&o("toggleLinearEditor")]})]})]})},H3=({appState:e,renderAction:t,setAppState:o,targetElements:n,container:r})=>{let a=Tr(e.activeTool.type)&&!Ng(e.currentItemBackgroundColor)||n.some(l=>Tr(l.type)&&!Ng(l.backgroundColor)),i=n.length>0||e.activeTool.type!=="selection"&&e.activeTool.type!=="eraser"&&e.activeTool.type!=="hand"&&e.activeTool.type!=="laser"&&e.activeTool.type!=="lasso",s=e.openPopup==="compactStrokeStyles";return i?xe("div",{className:"compact-action-item",children:Qe(hi.Root,{open:s,onOpenChange:l=>{o(l?{openPopup:"compactStrokeStyles"}:{openPopup:null})},children:[xe(hi.Trigger,{asChild:!0,children:xe("button",{type:"button",className:zr("compact-action-button properties-trigger",{active:s}),title:b("labels.stroke"),onClick:l=>{l.preventDefault(),l.stopPropagation(),o({openPopup:s?null:"compactStrokeStyles"})},children:aT})}),s&&xe(ca,{className:y1,container:r,style:{maxWidth:"13rem"},onClose:()=>{},children:Qe("div",{className:"selected-shape-actions",children:[a&&t("changeFillStyle"),(yd(e.activeTool.type)||n.some(l=>yd(l.type)))&&t("changeStrokeWidth"),(wd(e.activeTool.type)||n.some(l=>wd(l.type)))&&Qe(vn,{children:[t("changeStrokeStyle"),t("changeSloppiness")]}),(vd(e.activeTool.type)||n.some(l=>vd(l.type)))&&t("changeRoundness"),t("changeOpacity")]})})]})}):null},G3=({appState:e,renderAction:t,setAppState:o,targetElements:n,container:r,app:a})=>{let i=Fg(e.activeTool.type)||n.some(l=>Fg(l.type)),s=e.openPopup==="compactArrowProperties";return i?xe("div",{className:"compact-action-item",children:Qe(hi.Root,{open:s,onOpenChange:l=>{o(l?{openPopup:"compactArrowProperties"}:{openPopup:null})},children:[xe(hi.Trigger,{asChild:!0,children:xe("button",{type:"button",className:zr("compact-action-button properties-trigger",{active:s}),title:b("labels.arrowtypes"),onClick:l=>{l.preventDefault(),l.stopPropagation(),o({openPopup:s?null:"compactArrowProperties"})},children:(()=>{let l=Bo(n,a,c=>R3(c)?c.elbowed?"elbow":c.roundness?"round":"sharp":null,c=>R3(c),c=>c?null:e.currentItemArrowType);return l==="elbow"?Ml:l==="round"?Pl:Sl})()})}),s&&xe(ca,{container:r,className:"properties-content",style:{maxWidth:"13rem"},onClose:()=>{},children:t("changeArrowProperties")})]})}):null},$3=({appState:e,renderAction:t,setAppState:o,targetElements:n,container:r,elementsMap:a})=>{let{saveCaretPosition:i,restoreCaretPosition:s}=ST(),l=e.openPopup==="compactTextProperties";return xe("div",{className:"compact-action-item",children:Qe(hi.Root,{open:l,onOpenChange:c=>{c?(e.editingTextElement&&i(),o({openPopup:"compactTextProperties"})):(o({openPopup:null}),e.editingTextElement&&s())},children:[xe(hi.Trigger,{asChild:!0,children:xe("button",{type:"button",className:zr("compact-action-button properties-trigger",{active:l}),title:b("labels.textAlign"),onClick:c=>{c.preventDefault(),c.stopPropagation(),l?o({openPopup:null}):(e.editingTextElement&&i(),o({openPopup:"compactTextProperties"}))},children:P2})}),e.openPopup==="compactTextProperties"&&xe(ca,{className:y1,container:r,style:{maxWidth:"13rem"},preventAutoFocusOnTouch:!!e.editingTextElement,onClose:()=>{e.editingTextElement&&s()},children:Qe("div",{className:"selected-shape-actions",children:[(e.activeTool.type==="text"||n.some(Og))&&t("changeFontSize"),(e.activeTool.type==="text"||O3(n,a))&&t("changeTextAlign"),F3(n,a)&&t("changeVerticalAlign")]})})]})})},V3=({appState:e,renderAction:t,targetElements:o,setAppState:n,container:r,app:a,showDuplicate:i,showDelete:s})=>{let l=!!(e.editingTextElement||e.newElement),c=!e.croppingElementId&&o.length===1&&z3(o[0]),m=o.length===1,p=Ko(e,a),d=!1;o.length===2&&(Bg(o[0])||Bg(o[1]))&&(d=!0);let u=document.documentElement.getAttribute("dir")==="rtl",h=e.openPopup==="compactOtherProperties";return l||o.length===0?null:xe("div",{className:"compact-action-item",children:Qe(hi.Root,{open:h,onOpenChange:g=>{n(g?{openPopup:"compactOtherProperties"}:{openPopup:null})},children:[xe(hi.Trigger,{asChild:!0,children:xe("button",{type:"button",className:zr("compact-action-button properties-trigger",{active:h}),title:b("labels.actions"),onClick:g=>{g.preventDefault(),g.stopPropagation(),n({openPopup:h?null:"compactOtherProperties"})},children:E2})}),h&&xe(ca,{className:y1,container:r,style:{maxWidth:"12rem",justifyContent:"center",alignItems:"center"},onClose:()=>{},children:Qe("div",{className:"selected-shape-actions",children:[Qe("fieldset",{children:[xe("legend",{children:b("labels.layers")}),Qe("div",{className:"buttonList",children:[t("sendToBack"),t("sendBackward"),t("bringForward"),t("bringToFront")]})]}),p&&!d&&Qe("fieldset",{children:[xe("legend",{children:b("labels.align")}),Qe("div",{className:"buttonList",children:[u?Qe(vn,{children:[t("alignRight"),t("alignHorizontallyCentered"),t("alignLeft")]}):Qe(vn,{children:[t("alignLeft"),t("alignHorizontallyCentered"),t("alignRight")]}),o.length>2&&t("distributeHorizontally"),xe("div",{style:{flexBasis:"100%",height:0}}),Qe("div",{style:{display:"flex",flexWrap:"wrap",gap:".5rem",marginTop:"-0.5rem"},children:[t("alignTop"),t("alignVerticallyCentered"),t("alignBottom"),o.length>2&&t("distributeVertically")]})]})]}),Qe("fieldset",{children:[xe("legend",{children:b("labels.actions")}),Qe("div",{className:"buttonList",children:[t("group"),t("ungroup"),m&&t("hyperlink"),c&&t("cropEditor"),i&&t("duplicateSelection"),s&&t("deleteSelectedElements")]})]})]})})]})})},lG=({appState:e,renderAction:t,targetElements:o})=>!e.selectedLinearElement?.isEditing&&o.length===1&&x1(o[0])&&!b1(o[0])?xe("div",{className:"compact-action-item",children:t("toggleLinearEditor")}):null,W3=({appState:e,elementsMap:t,renderAction:o,app:n,setAppState:r})=>{let a=ol(t,e),{container:i}=St(),s=!!(e.editingTextElement||e.newElement),l=!e.selectedLinearElement?.isEditing&&a.length===1&&x1(a[0])&&!b1(a[0]);return Qe("div",{className:"compact-shape-actions",children:[ym(e,a)&&xe("div",{className:zr("compact-action-item"),children:o("changeStrokeColor")}),wm(e,a)&&xe("div",{className:"compact-action-item",children:o("changeBackgroundColor")}),xe(H3,{appState:e,renderAction:o,setAppState:r,targetElements:a,container:i}),xe(G3,{appState:e,renderAction:o,setAppState:r,targetElements:a,container:i,app:n}),l&&xe("div",{className:"compact-action-item",children:o("toggleLinearEditor")}),(e.activeTool.type==="text"||a.some(Og))&&Qe(vn,{children:[xe("div",{className:"compact-action-item",children:o("changeFontFamily")}),xe($3,{appState:e,renderAction:o,setAppState:r,targetElements:a,container:i,elementsMap:t})]}),!s&&a.length>0&&xe("div",{className:"compact-action-item",children:o("duplicateSelection")}),!s&&a.length>0&&xe("div",{className:"compact-action-item",children:o("deleteSelectedElements")}),xe(V3,{appState:e,renderAction:o,targetElements:a,setAppState:r,container:i,app:n})]})},K3=({appState:e,elementsMap:t,renderAction:o,app:n,setAppState:r})=>{let a=ol(t,e),{container:i}=St(),s=aG(null),l=s.current?.getBoundingClientRect()?.width??0,c=9,m=6,p=32,d=c*p+(c-1)*m,u=p+m,h=l>=d+u,g=l>=d+2*u;return Qe($t,{className:"compact-shape-actions mobile-shape-actions",style:{flexDirection:"row",boxShadow:"none",padding:0,zIndex:2,backgroundColor:"transparent",height:p*1.35,marginBottom:4,alignItems:"center",gap:m,pointerEvents:"none"},ref:s,children:[Qe("div",{style:{display:"flex",flexDirection:"row",gap:m,flex:1},children:[ym(e,a)&&xe("div",{className:zr("compact-action-item"),children:o("changeStrokeColor")}),wm(e,a)&&xe("div",{className:"compact-action-item",children:o("changeBackgroundColor")}),xe(H3,{appState:e,renderAction:o,setAppState:r,targetElements:a,container:i}),xe(G3,{appState:e,renderAction:o,setAppState:r,targetElements:a,container:i,app:n}),xe(lG,{appState:e,renderAction:o,targetElements:a}),(e.activeTool.type==="text"||a.some(Og))&&Qe(vn,{children:[xe("div",{className:"compact-action-item",children:o("changeFontFamily")}),xe($3,{appState:e,renderAction:o,setAppState:r,targetElements:a,container:i,elementsMap:t})]}),xe(V3,{appState:e,renderAction:o,targetElements:a,setAppState:r,container:i,app:n,showDuplicate:!g,showDelete:!h})]}),Qe("div",{style:{display:"flex",flexDirection:"row",gap:m},children:[xe("div",{className:"compact-action-item",children:o("undo")}),xe("div",{className:"compact-action-item",children:o("redo")}),g&&xe("div",{className:"compact-action-item",children:o("duplicateSelection")}),h&&xe("div",{className:"compact-action-item",children:o("deleteSelectedElements")})]})]})},Y3=({activeTool:e,setAppState:t,app:o,UIOptions:n})=>{let[r,a]=iG(!1),i=ho(),s=i==="full",l=i==="compact",c=[{type:"selection",icon:ss,title:gi(b("toolBar.selection"))},{type:"lasso",icon:Ya,title:gi(b("toolBar.lasso"))}],m=e.type==="frame",p=e.type==="laser",d=s&&e.type==="lasso"&&o.state.preferredSelectionTool.type!=="lasso",u=e.type==="embeddable",{TTDDialogTriggerTunnel:h}=kt();return Qe(vn,{children:[u1(o).map(({value:g,icon:f,key:w,numericKey:y,fillable:v,toolbar:E})=>{if(E===!1||n.tools?.[g]===!1)return null;let I=b(`toolBar.${g}`),k=w&&gi(typeof w=="string"?w:w[0]),S=k?`${k} ${b("helpDialog.or")} ${y}`:`${y}`,T=g==="hand"?void 0:y||k;return(g==="selection"||g==="lasso")&&l?xe(fc,{app:o,options:c,activeTool:e,defaultOption:o.state.preferredSelectionTool.type,namePrefix:"selectionType",title:gi(b("toolBar.selection")),"data-testid":"toolbar-selection",onToolChange:A=>{(A==="selection"||A==="lasso")&&(o.setActiveTool({type:A}),t({preferredSelectionTool:{type:A,initialized:!0}}))},displayedOption:c.find(A=>A.type===o.state.preferredSelectionTool.type)||c[0],fillable:e.type==="selection"},"selection-popover"):xe(be,{className:zr("Shape",{fillable:v}),type:"radio",icon:f,checked:e.type===g,name:"editor-current-shape",title:`${gi(I)} \u2014 ${S}`,keyBindingLabel:T,"aria-label":gi(I),"aria-keyshortcuts":S,"data-testid":`toolbar-${g}`,onPointerDown:({pointerType:A})=>{!o.state.penDetected&&A==="pen"&&o.togglePenMode(!0),g==="selection"&&(o.state.activeTool.type==="selection"?o.setActiveTool({type:"lasso"}):o.setActiveTool({type:"selection"}))},onChange:({pointerType:A})=>{o.state.activeTool.type!==g&&Ne("toolbar",g,"ui"),g==="image"?o.setActiveTool({type:g}):o.setActiveTool({type:g})}},g)}),xe("div",{className:"App-toolbar__divider"}),xe(be,{className:"Shape",type:"radio",icon:du,checked:!1,name:"editor-current-shape",title:"Image Generator \u2014 G",keyBindingLabel:"G","aria-label":"Image Generator","data-testid":"toolbar-image-generator",onChange:()=>{Ne("toolbar","imageGenerator","ui"),o.onImageGeneratorSelect()}}),xe(be,{className:"Shape",type:"radio",icon:mu,checked:!1,name:"editor-current-shape",title:"Video Generator \u2014 M",keyBindingLabel:"M","aria-label":"Video Generator","data-testid":"toolbar-video-generator",onChange:()=>{Ne("toolbar","videoGenerator","ui"),o.onVideoGeneratorSelect()}}),xe(be,{className:"Shape",type:"radio",icon:Ar,checked:m,name:"editor-current-shape",title:`${gi(b("toolBar.frame"))} \u2014 F`,keyBindingLabel:"F","aria-label":gi(b("toolBar.frame")),"data-testid":"toolbar-frame",onChange:()=>{Ne("toolbar","frame","ui"),o.setActiveTool({type:"frame"})}}),Qe(Ue,{open:r,children:[xe(Ue.Trigger,{className:zr("App-toolbar__extra-tools-trigger",{"App-toolbar__extra-tools-trigger--selected":u||d||p&&!o.props.isCollaborating}),onToggle:()=>{a(!r),t({openMenu:null,openPopup:null})},title:b("toolBar.extraTools"),children:u?yl:p&&!o.props.isCollaborating?Lr:d?Ya:_d}),Qe(Ue.Content,{onClickOutside:()=>a(!1),onSelect:()=>a(!1),className:"App-toolbar__extra-tools-dropdown",children:[xe(Ue.Item,{onSelect:()=>o.setActiveTool({type:"embeddable"}),icon:yl,"data-testid":"toolbar-embeddable",selected:u,children:b("toolBar.embeddable")}),xe(Ue.Item,{onSelect:()=>o.setActiveTool({type:"laser"}),icon:Lr,"data-testid":"toolbar-laser",selected:p,shortcut:sG.K.toLocaleUpperCase(),children:b("toolBar.laser")}),s&&xe(Ue.Item,{onSelect:()=>o.setActiveTool({type:"lasso"}),icon:Ya,"data-testid":"toolbar-lasso",selected:d,children:b("toolBar.lasso")}),xe("div",{style:{margin:"6px 0",fontSize:14,fontWeight:600},children:"Generate"}),o.props.aiEnabled!==!1&&xe(h.Out,{}),xe(Ue.Item,{onSelect:()=>o.setOpenDialog({name:"ttd",tab:"mermaid"}),icon:Tl,"data-testid":"toolbar-mermaid",children:b("toolBar.mermaidToExcalidraw")}),o.props.aiEnabled!==!1&&o.plugins.diagramToCode&&xe(Ue.Item,{onSelect:()=>o.onMagicframeToolSelect(),icon:ds,"data-testid":"toolbar-magicframe",badge:xe(Ue.Item.Badge,{children:"AI"}),children:b("toolBar.magicframe")})]})]})]})},X3=({renderAction:e})=>e("scrollBackToContent"),j3=({renderAction:e,zoom:t})=>Qe(fo.Row,{align:"center",className:B3.ZOOM_ACTIONS,children:[e("zoomOut"),e("resetZoom"),e("zoomIn")]}),Z3=({renderAction:e,className:t})=>Qe("div",{className:`undo-redo-buttons ${t}`,children:[xe("div",{className:"undo-button-container",children:xe(Fo,{label:b("buttons.undo"),children:e("undo")})}),xe("div",{className:"redo-button-container",children:Qe(Fo,{label:b("buttons.redo"),children:[" ",e("redo")]})})]}),q3=({actionManager:e,showExitZenModeBtn:t})=>xe("button",{type:"button",className:zr("disable-zen-mode",{"disable-zen-mode--visible":t}),onClick:()=>e.executeAction(si),children:b("buttons.exitZenMode")}),J3=({actionManager:e})=>xe("button",{type:"button",className:"disable-view-mode",onClick:()=>e.executeAction(Is),children:sT});import{useRef as cG}from"react";var w1=e=>{let t=cG({userFn:e});return t.current.userFn=e,t.current.stableFn||(t.current.stableFn=(...o)=>t.current.userFn(...o)),t.current.stableFn};import{jsx as mG,jsxs as dG}from"react/jsx-runtime";var Ts=je(null),Q3=()=>{let[e,t]=ve(Ts),o=Rt();return e&&e==="clearCanvas"?mG(Tg,{onConfirm:()=>{o.executeAction(ga),t(null)},onCancel:()=>t(null),title:b("clearCanvasDialog.title"),children:dG("p",{className:"clear-canvas__content",children:[" ",b("alerts.clearReset")]})}):null};var v1={};KE(v1,{toggleTheme:()=>pG});var pG={...gs,category:"App",label:"Toggle theme",perform:({actionManager:e})=>{e.executeAction(gs,"commandPalette")}};import{jsx as xo,jsxs as Ur}from"react/jsx-runtime";var bG=je(null),Nt={app:"App",export:"Export",tools:"Tools",editor:"Editor",elements:"Elements",links:"Links",library:"Library"},tS=e=>{switch(e){case Nt.app:return 1;case Nt.export:return 2;case Nt.editor:return 3;case Nt.tools:return 4;case Nt.elements:return 5;case Nt.links:return 6;default:return 10}},Hg=({shortcut:e,className:t,children:o})=>{let n=e.replace("++","+$").split("+");return Ur("div",{className:nS("shortcut",t),children:[n.map((r,a)=>xo("div",{className:"shortcut-wrapper",children:xo("div",{className:"shortcut-key",children:r==="$"?"+":r})},r)),xo("div",{className:"shortcut-desc",children:o})]})},aS=e=>!e.altKey&&e[hr.CTRL_OR_CMD]&&(e.shiftKey&&e.key.toLowerCase()===hr.P||e.key===hr.SLASH),xG=Object.assign(e=>{let t=Ze(),o=Je();return Ug(()=>{let n=r=>{aS(r)&&(r.preventDefault(),r.stopPropagation(),o(a=>{let i=a.openDialog?.name==="commandPalette"?null:{name:"commandPalette"};return i&&Ne("command_palette","open","shortcut"),{openDialog:i}}))};return window.addEventListener(Gg.KEYDOWN,n,{capture:!0}),()=>window.removeEventListener(Gg.KEYDOWN,n,{capture:!0})},[o]),t.openDialog?.name!=="commandPalette"?null:xo(yG,{...e})},{defaultItems:v1});function yG({customCommandPaletteItems:e}){let t=Mt(),o=Ze(),n=Je(),r=_r(),a=Rt(),[i,s]=ve(bG),[l,c]=zg(null),m=rS(null),p=ja({uiAppState:o,customCommandPaletteItems:e,appProps:r}),[d]=ve(fa),u=gG(()=>d.libraryItems?.filter(T=>!!T.name).map(T=>({label:T.name,icon:xo(wG,{id:T.id,elements:T.elements}),category:"Library",order:tS("Library"),haystack:vs(T.name),perform:()=>{t.onInsertElements(pc([T]))}}))||[],[t,d.libraryItems]);Ug(()=>{let{uiAppState:T,customCommandPaletteItems:A,appProps:R}=p,M=B=>{let G="";return B.label&&(typeof B.label=="function"?G=b(B.label(t.scene.getNonDeletedElements(),T,t)):G=b(B.label)),G},P=B=>typeof B.icon=="function"?B.icon(T,t.scene.getNonDeletedElements()):B.icon,F=[],U=(B,G,_)=>{let L={label:M(B),icon:P(B),category:G,shortcut:Tt(B.name),keywords:B.keywords,predicate:B.predicate,viewMode:B.viewMode,perform:()=>{a.executeAction(B,"commandPalette")}};return _?_(L,B):L};if(T&&t.scene&&a){let B=[a.actions.group,a.actions.ungroup,a.actions.cut,a.actions.copy,a.actions.deleteSelectedElements,a.actions.wrapSelectionInFrame,a.actions.copyStyles,a.actions.pasteStyles,a.actions.bringToFront,a.actions.bringForward,a.actions.sendBackward,a.actions.sendToBack,a.actions.alignTop,a.actions.alignBottom,a.actions.alignLeft,a.actions.alignRight,a.actions.alignVerticallyCentered,a.actions.alignHorizontallyCentered,a.actions.duplicateSelection,a.actions.flipHorizontal,a.actions.flipVertical,a.actions.zoomToFitSelection,a.actions.zoomToFitSelectionInViewport,a.actions.increaseFontSize,a.actions.decreaseFontSize,a.actions.toggleLinearEditor,a.actions.cropEditor,a.actions.togglePolygon,sm,fg,y5].map(K=>U(K,Nt.elements,(ie,Z)=>({...ie,predicate:Z.predicate?Z.predicate:(Q,H,ne,fe)=>Me(Q,H).length>0}))),G=[a.actions.toggleHandTool,a.actions.setFrameAsActiveTool,a.actions.toggleLassoTool].map(K=>U(K,Nt.tools)),_=[a.actions.undo,a.actions.redo,a.actions.zoomIn,a.actions.zoomOut,a.actions.resetZoom,a.actions.zoomToFit,a.actions.zenMode,a.actions.viewMode,a.actions.gridMode,a.actions.objectsSnapMode,a.actions.toggleShortcuts,a.actions.selectAll,a.actions.toggleElementLock,a.actions.unlockAllElements,a.actions.stats].map(K=>U(K,Nt.editor)),L=[a.actions.saveToActiveFile,a.actions.saveFileToDisk,a.actions.copyAsPng,a.actions.copyAsSvg].map(K=>U(K,Nt.export));F=[...B,..._,{label:M(ga),icon:P(ga),shortcut:Tt(ga.name),category:Nt.editor,keywords:["delete","destroy"],viewMode:!1,perform:()=>{Yt.set(Ts,"clearCanvas")}},{label:b("buttons.exportImage"),category:Nt.export,icon:au,shortcut:Tt("imageExport"),keywords:["export","image","png","jpeg","svg","clipboard","picture"],perform:()=>{n({openDialog:{name:"imageExport"}})}},...L];let z=[{label:b("toolBar.library"),category:Nt.app,icon:Qp,viewMode:!1,perform:()=>{T.openSidebar?n({openSidebar:null}):n({openSidebar:{name:eS.name,tab:eS.defaultTab}})}},{label:b("search.title"),category:Nt.app,icon:fn,viewMode:!0,perform:()=>{a.executeAction(vm)}},{label:b("labels.shapeSwitch"),category:Nt.elements,icon:Dd,perform:()=>{a.executeAction(x5)}},{label:b("labels.changeStroke"),keywords:["color","outline"],category:Nt.elements,icon:ru,viewMode:!1,predicate:(K,ie)=>{let Z=Me(K,ie);return Z.length>0&&ym(ie,Z)},perform:()=>{n(K=>({openPopup:"elementStroke"}))}},{label:b("labels.changeBackground"),keywords:["color","fill"],icon:ru,category:Nt.elements,viewMode:!1,predicate:(K,ie)=>{let Z=Me(K,ie);return Z.length>0&&wm(ie,Z)},perform:()=>{n(K=>({openPopup:"elementBackground"}))}},{label:b("labels.canvasBackground"),keywords:["color"],icon:ru,category:Nt.editor,viewMode:!1,perform:()=>{n(K=>({openMenu:K.openMenu==="canvas"?null:"canvas",openPopup:"canvasBackground"}))}},...Dg.reduce((K,ie)=>{let{value:Z,icon:Q,key:H,numericKey:ne}=ie;if(R.UIOptions.tools?.[Z]===!1)return K;let j=H&&hG(typeof H=="string"?H:H[0])||ne,se={label:b(`toolBar.${Z}`),category:Nt.tools,shortcut:j,icon:Q,keywords:["toolbar"],viewMode:!1,perform:({event:we})=>{Z==="image"?t.setActiveTool({type:Z}):t.setActiveTool({type:Z})}};return K.push(se),K},[]),...G,{label:b("toolBar.lock"),category:Nt.tools,icon:T.activeTool.locked?ul:is,shortcut:hr.Q.toLocaleUpperCase(),viewMode:!1,perform:()=>{t.toggleLock()}},{label:`${b("labels.textToDiagram")}...`,category:Nt.tools,icon:UI,viewMode:!1,predicate:R.aiEnabled,perform:()=>{n(K=>({...K,openDialog:{name:"ttd",tab:"text-to-diagram"}}))}},{label:`${b("toolBar.mermaidToExcalidraw")}...`,category:Nt.tools,icon:Tl,viewMode:!1,predicate:R.aiEnabled,perform:()=>{n(K=>({...K,openDialog:{name:"ttd",tab:"mermaid"}}))}}],O=[...F,...z,...A||[]].map(K=>({...K,icon:K.icon||Dd,order:K.order??tS(K.category),haystack:`${vs(K.label.toLocaleLowerCase())} ${K.keywords?.join(" ")||""}`}));c(O),s([...O,...u].find(K=>K.label===i?.label)??null)}},[p,t,a,c,i?.label,s,n,u]);let[h,g]=zg(""),[f,w]=zg(null),[y,v]=zg({}),E=T=>{n({openDialog:null},T),g("")},I=(T,A)=>{o.openDialog?.name==="commandPalette"&&(A.stopPropagation(),A.preventDefault(),document.body.classList.add("excalidraw-animations-disabled"),E(()=>{T.perform({actionManager:a,event:A}),s(T),requestAnimationFrame(()=>{document.body.classList.remove("excalidraw-animations-disabled")})}))},k=w1(T=>T.viewMode===!1&&o.viewModeEnabled?!1:typeof T.predicate=="function"?T.predicate(t.scene.getNonDeletedElements(),o,r,t):T.predicate===void 0||T.predicate),S=w1(T=>{let A=fG(T.target)||aS(T)||T.key===hr.ESCAPE;if(A&&T.key!==hr.ARROW_UP&&T.key!==hr.ARROW_DOWN&&T.key!==hr.ENTER)return;let R=Object.values(y).flat(),M=i&&!h&&k(i);if(T.key===hr.ARROW_UP){T.preventDefault();let P=R.findIndex(B=>B.label===f?.label);if(M){if(P===0){w(i);return}if(f===i){let B=R[R.length-1];B&&w(B);return}}let F;P===-1?F=R.length-1:F=P===0?R.length-1:(P-1)%R.length;let U=R[F];U&&w(U);return}if(T.key===hr.ARROW_DOWN){T.preventDefault();let P=R.findIndex(B=>B.label===f?.label);if(M){if(!f||P===R.length-1){w(i);return}if(f===i){let B=R[0];B&&w(B);return}}let F=(P+1)%R.length,U=R[F];U&&w(U);return}if(T.key===hr.ENTER&&f&&setTimeout(()=>{I(f,T)}),!A){if(T.stopPropagation(),/^[a-zA-Z0-9]$/.test(T.key)){m?.current?.focus();return}T.preventDefault()}});return Ug(()=>(window.addEventListener(Gg.KEYDOWN,S,{capture:!0}),()=>window.removeEventListener(Gg.KEYDOWN,S,{capture:!0})),[S]),Ug(()=>{if(!l)return;let T=P=>{let F={};for(let U of P)F[U.category]?F[U.category].push(U):F[U.category]=[U];return F},A=h?.length>1?[...l.filter(k).sort((P,F)=>P.order-F.order),...u]:l.filter(k).sort((P,F)=>P.order-F.order),R=!h&&i&&k(i);if(!h){v(T(R?A.filter(P=>P.label!==i?.label):A)),w(R?i:A[0]||null);return}let M=vs(h.toLocaleLowerCase().replace(/[<>_| -]/g,""));A=uG.filter(M,A,{extract:P=>P.haystack??""}).sort((P,F)=>F.score-P.score).map(P=>P.original),v(T(A)),w(A[0]??null)},[h,l,k,i,u]),Ur(Xt,{onCloseRequest:()=>E(),closeOnClickOutside:!0,title:!1,size:720,autofocus:!0,className:"command-palette-dialog",children:[xo(pi,{value:h,placeholder:b("commandPalette.search.placeholder"),onChange:T=>{g(T)},selectOnRender:!0,ref:m}),t.editorInterface.formFactor!=="phone"&&Ur("div",{className:"shortcuts-wrapper",children:[xo(Hg,{shortcut:"\u2191\u2193",children:b("commandPalette.shortcuts.select")}),xo(Hg,{shortcut:"\u21B5",children:b("commandPalette.shortcuts.confirm")}),xo(Hg,{shortcut:V("Esc"),children:b("commandPalette.shortcuts.close")})]}),Ur("div",{className:"commands",children:[i&&!h&&Ur("div",{className:"command-category",children:[Ur("div",{className:"command-category-title",children:[b("commandPalette.recents"),xo("div",{className:"icon",style:{marginLeft:"6px"},children:HI})]}),xo(oS,{command:i,isSelected:i.label===f?.label,onClick:T=>I(i,T),disabled:!k(i),onMouseMove:()=>w(i),showShortcut:t.editorInterface.formFactor!=="phone",appState:o})]}),Object.keys(y).length>0?Object.keys(y).map((T,A)=>Ur("div",{className:"command-category",children:[xo("div",{className:"command-category-title",children:T}),y[T].map(R=>xo(oS,{command:R,isSelected:R.label===f?.label,onClick:M=>I(R,M),onMouseMove:()=>w(R),showShortcut:t.editorInterface.formFactor!=="phone",appState:o,size:T==="Library"?"large":"small"},R.label))]},T)):l?Ur("div",{className:"no-match",children:[xo("div",{className:"icon",children:fn})," ",b("commandPalette.search.noMatch")]}):null]})]})}var wG=({id:e,elements:t})=>{let o=rS(null),{svgCache:n}=dc();return xg(e,t,n,o),xo("div",{className:"library-item-icon",ref:o})},oS=({command:e,isSelected:t,disabled:o,onMouseMove:n,onClick:r,showShortcut:a,appState:i,size:s="small"})=>{let l=()=>{};return Ur("div",{className:nS("command-item",{"item-selected":t,"item-disabled":o,"command-item-large":s==="large"}),ref:c=>{t&&!o&&c?.scrollIntoView?.({block:"nearest"})},onClick:o?l:r,onMouseMove:o?l:n,title:o?b("commandPalette.itemNotAvailable"):"",children:[Ur("div",{className:"name",children:[e.icon&&xo(Dr,{className:"icon",size:"var(--icon-size, 1rem)",icon:typeof e.icon=="function"?e.icon(i,[]):e.icon}),xo(Vd,{children:e.label})]}),a&&e.shortcut&&xo(Hg,{shortcut:e.shortcut})]})};import{getSizeFromPoints as BAe,randomInteger as v$,getUpdatedTimestamp as E$}from"@orangecatai/common";import{simplify as i$}from"points-on-curve";import{getStroke as s$}from"perfect-freehand";import{pointsOnBezierCurves as ECe}from"points-on-curve";import{invariant as TCe}from"@orangecatai/common";import{curve as CCe,lineSegment as SCe,pointFrom as MCe,pointDistance as PCe,pointFromArray as ACe,pointFromVector as LCe,pointRotateRads as _Ce,polygon as DCe,polygonFromPoints as RCe,PRECISION as NCe,segmentsIntersectAt as BCe,vector as FCe,vectorAdd as OCe,vectorFromPoint as zCe,vectorScale as UCe}from"@orangecatai/math";import{getElementAbsoluteCoords as GCe}from"@orangecatai/element";var E1=e=>{if(!e)return[];for(let t of e.sets)if(t.type==="path")return t.ops;return e.sets[0].ops};import{pointFrom as l$,pointDistance as IS,pointRotateRads as vAe}from"@orangecatai/math";import{ROUGHNESS as c$,THEME as U1,isTransparent as km,assertNever as d$,COLOR_PALETTE as m$,LINE_POLYGON_POINT_MERGE_DISTANCE as IAe,applyDarkModeFilter as Jg}from"@orangecatai/common";import{RoughGenerator as p$}from"roughjs/bin/generator";import LPe from"roughjs/bin/rough";import{isRightAngleRads as DPe,lineSegment as RPe,pointFrom as NPe,pointRotateRads as BPe}from"@orangecatai/math";import{BOUND_TEXT_PADDING as OPe,DEFAULT_REDUCED_GLOBAL_ALPHA as zPe,ELEMENT_READY_TO_ERASE_OPACITY as UPe,FRAME_STYLE as HPe,DARK_THEME_FILTER as GPe,MIME_TYPES as vS,THEME as $Pe,distance as VPe,getFontString as WPe,isRTL as KPe,getVerticalOffset as YPe,invariant as XPe,applyDarkModeFilter as jPe,isSafari as ZPe}from"@orangecatai/common";import $Me from"roughjs/bin/rough";import{arrayToMap as WMe,invariant as gS,rescalePoints as KMe,sizeOf as YMe}from"@orangecatai/common";import{degreesToRadians as R1,lineSegment as jMe,pointDistance as ZMe,pointFrom as Mo,pointFromArray as GG,pointRotateRads as vc}from"@orangecatai/math";import{pointsOnBezierCurves as QMe}from"points-on-curve";import{pointCenter as rMe,pointFrom as aMe,pointRotateRads as iMe,pointsEqual as sMe,pointDistance as lMe,vectorFromPoint as cMe,curveLength as dMe,curvePointAtLength as mMe}from"@orangecatai/math";import{DRAGGING_THRESHOLD as gMe,KEYS as hMe,shouldRotateWithDiscreteAngle as fMe,getGridPoint as bMe,invariant as xMe,isShallowEqual as yMe,getFeatureFlag as wMe}from"@orangecatai/common";import{deconstructLinearOrFreeDrawElement as EMe,getSnapOutlineMidPoint as IMe,isPathALoop as TMe,moveArrowAboveBindable as kMe,projectFixedPointOntoDiagonal as CMe}from"@orangecatai/element";import{KEYS as r4e,arrayToMap as a4e,getFeatureFlag as i4e,invariant as s4e,isTransparent as l4e}from"@orangecatai/common";import{PRECISION as d4e,clamp as m4e,lineSegment as p4e,pointDistance as u4e,pointDistanceSq as g4e,pointFrom as h4e,pointFromVector as f4e,pointRotateRads as b4e,pointsEqual as x4e,vectorFromPoint as y4e,vectorNormalize as w4e,vectorScale as v4e}from"@orangecatai/math";import{invariant as A3e,isTransparent as L3e}from"@orangecatai/common";import{curveIntersectLineSegment as D3e,isPointWithinBounds as R3e,lineSegment as N3e,lineSegmentIntersectionPoints as B3e,pointFrom as F3e,pointFromVector as O3e,pointRotateRads as z3e,pointsEqual as U3e,vectorFromPoint as H3e,vectorNormalize as G3e,vectorScale as $3e}from"@orangecatai/math";import{ellipse as W3e,ellipseSegmentInterceptPoints as K3e}from"@orangecatai/math/ellipse";import{DEFAULT_ADAPTIVE_RADIUS as IG,DEFAULT_PROPORTIONAL_RADIUS as T1,invariant as QCe,LINE_CONFIRM_THRESHOLD as TG,ROUNDNESS as k1}from"@orangecatai/common";import{bezierEquation as t5e,curve as o5e,curveCatmullRomCubicApproxPoints as n5e,curveOffsetPoints as r5e,lineSegment as a5e,lineSegmentIntersectionPoints as i5e,pointDistance as kG,pointFrom as s5e,pointFromArray as l5e,pointFromVector as c5e,pointRotateRads as d5e,pointTranslate as m5e,rectangle as p5e,vectorFromPoint as u5e,vectorNormalize as g5e,vectorScale as h5e}from"@orangecatai/math";import{ROUNDNESS as KCe,assertNever as YCe}from"@orangecatai/common";import{pointsEqual as jCe}from"@orangecatai/math";var iS=e=>!!e&&e.type==="embeddable",sS=e=>!!e&&e.type==="iframe",I1=e=>!!e&&(e.type==="iframe"||e.type==="embeddable"),ks=e=>e!=null&&e.type==="text";var $g=e=>e!=null&&(e.type==="frame"||e.type==="magicframe");var Cs=e=>e!=null&&vG(e.type);var Ss=e=>e!=null&&e.type==="arrow",Em=e=>Ss(e)&&e.elbowed;var vG=e=>e==="arrow"||e==="line";var bc=e=>e!==null&&"containerId"in e&&e.containerId!==null&&ks(e);var Vg=(e,t=1)=>{if(e.length>=3){let[o,n]=[e[0],e[e.length-1]];return kG(o,n)<=TG/t}return!1},Im=(e,t)=>{if(t.roundness?.type===k1.PROPORTIONAL_RADIUS||t.roundness?.type===k1.LEGACY)return e*T1;if(t.roundness?.type===k1.ADAPTIVE_RADIUS){let o=t.roundness?.value??IG,n=o/T1;return e<=n?e*T1:o}return 0};import{ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO as Q5e,ARROW_LABEL_WIDTH_FRACTION as e3e,BOUND_TEXT_PADDING as t3e,DEFAULT_FONT_SIZE as o3e,TEXT_ALIGN as n3e,VERTICAL_ALIGN as r3e,getFontString as a3e,isProdEnv as i3e,invariant as s3e}from"@orangecatai/common";import{pointFrom as c3e,pointRotateRads as d3e}from"@orangecatai/math";import{BOUND_TEXT_PADDING as A5e,DEFAULT_FONT_SIZE as L5e,DEFAULT_FONT_FAMILY as _5e,getFontString as D5e,isTestEnv as R5e,normalizeEOL as N5e}from"@orangecatai/common";var B5e="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase();import{isDevEnv as $5e,isTestEnv as V5e}from"@orangecatai/common";import{curvePointDistance as y3e,distanceToLineSegment as w3e,pointRotateRads as v3e}from"@orangecatai/math";import{ellipse as I3e,ellipseDistanceFromPoint as T3e}from"@orangecatai/math/ellipse";import{invariant as iSe,isDevEnv as sSe,isTestEnv as lSe}from"@orangecatai/common";import{pointFrom as dSe,pointFromVector as mSe,pointRotateRads as pSe,pointScaleFromOrigin as uSe,pointsEqual as gSe,triangleIncludesPoint as hSe,vectorCross as fSe,vectorFromPoint as NG,vectorScale as bSe}from"@orangecatai/math";var _1=[1,0],dS=[0,1],D1=[-1,0],mS=[0,-1],Yg=e=>{let[t,o]=e,n=Math.abs(t),r=Math.abs(o);return t>r?_1:t<=-r?D1:o>n?dS:mS},pS=(e,t)=>Yg(NG(e,t)),Xg=(e,t)=>jg(pS(e,t)),L1=(e,t)=>e[0]===t[0]&&e[1]===t[1],jg=e=>L1(e,_1)||L1(e,D1);import{clamp as ISe,pointDistance as TSe,pointFrom as kSe,pointScaleFromOrigin as CSe,pointsEqual as SSe,pointTranslate as MSe,vector as PSe,vectorCross as ASe,vectorFromPoint as LSe,vectorScale as _Se}from"@orangecatai/math";import{BinaryHeap as RSe,invariant as NSe,isAnyTrue as BSe,getSizeFromPoints as FSe,isDevEnv as OSe,arrayToMap as zSe}from"@orangecatai/common";var D4e=10/1.5;import{SHIFT_LOCKING_ANGLE as O4e,viewportCoordsToSceneCoords as z4e}from"@orangecatai/common";import{normalizeRadians as H4e,radiansBetweenAngles as G4e,radiansDifference as $4e}from"@orangecatai/math";import{pointsEqual as W4e}from"@orangecatai/math";var Wg=e=>{let t=Math.floor(e.width/2)+1,o=0,n=e.width,r=Math.floor(e.height/2)+1,a=t,i=e.height;return[t,o,n,r,a,i,0,r]};var $G=e=>{switch(e){case"arrow":return 25;case"diamond":case"diamond_outline":return 12;case"crowfoot_many":case"crowfoot_one":case"crowfoot_one_or_many":return 20;default:return 15}},VG=e=>{switch(e){case"bar":return 90;case"arrow":return 20;default:return 25}},N1=(e,t,o,n)=>{if(t.length<1)return null;let r=E1(t[0]);if(r.length<1)return null;let a=o==="start"?1:r.length-1,i=r[a].data;gS(i.length===6,"Op data length is not 6");let s=Mo(i[4],i[5]),l=Mo(i[2],i[3]),c=Mo(i[0],i[1]),m=r[a-1],p=Mo(0,0);if(m.op==="move"){let B=GG(m.data);gS(B!=null,"Op data is not a point"),p=B}else m.op==="bcurveTo"&&(p=Mo(m.data[4],m.data[5]));let d=(B,G)=>Math.pow(1-B,3)*s[G]+3*B*Math.pow(1-B,2)*l[G]+3*Math.pow(B,2)*(1-B)*c[G]+p[G]*Math.pow(B,3),[u,h]=o==="start"?p:s,[g,f]=[d(.3,0),d(.3,1)],w=Math.hypot(u-g,h-f),y=(u-g)/w,v=(h-f)/w,E=$G(n),I=0;{let[B,G]=o==="end"?e.points[e.points.length-1]:e.points[0],[_,L]=e.points.length>1?o==="end"?e.points[e.points.length-2]:e.points[1]:[0,0];I=Math.hypot(B-_,G-L)}let S=Math.min(E,I*(n==="diamond"||n==="diamond_outline"?.25:.5)),T=u-y*S,A=h-v*S;if(n==="dot"||n==="circle"||n==="circle_outline"){let B=Math.hypot(A-h,T-u)+e.strokeWidth-2;return[u,h,B]}let R=VG(n);if(n==="crowfoot_many"||n==="crowfoot_one_or_many"){let[B,G]=vc(Mo(u,h),Mo(T,A),R1(-R)),[_,L]=vc(Mo(u,h),Mo(T,A),R1(R));return[T,A,B,G,_,L]}let[M,P]=vc(Mo(T,A),Mo(u,h),-R*Math.PI/180),[F,U]=vc(Mo(T,A),Mo(u,h),R1(R));if(n==="diamond"||n==="diamond_outline"){let B,G;if(o==="start"){let[_,L]=e.points.length>1?e.points[1]:[0,0];[B,G]=vc(Mo(u+S*2,h),Mo(u,h),Math.atan2(L-h,_-u))}else{let[_,L]=e.points.length>1?e.points[e.points.length-2]:[0,0];[B,G]=vc(Mo(u-S*2,h),Mo(u,h),Math.atan2(h-L,u-_))}return[u,h,M,P,B,G,F,U]}return[u,h,M,P,F,U]};import{pointFrom as u6e,pointCenter as g6e,pointRotateRads as h6e,vectorFromPoint as f6e,vectorNormalize as b6e,vectorSubtract as x6e,vectorAdd as y6e,vectorScale as w6e,pointFromVector as v6e,clamp as E6e,isCloseTo as I6e}from"@orangecatai/math";import{arrayToMap as cPe}from"@orangecatai/common";import{isPointWithinBounds as mPe,pointFrom as pPe}from"@orangecatai/math";import{vectorCross as M6e,vectorFromPoint as P6e}from"@orangecatai/math";import{arrayToMap as WG}from"@orangecatai/common";import{getElementBounds as KG}from"@orangecatai/element";import{isArrowElement as YG,isExcalidrawElement as XG,isFreeDrawElement as jG,isLinearElement as ZG,isTextElement as qG}from"@orangecatai/element";import{rangeIncludesValue as Zg,pointFrom as wa,pointRotateRads as JG,rangeInclusive as qg}from"@orangecatai/math";var QG=e=>e.type==="diamond"?[wa(e.width/2,0),wa(e.width,e.height/2),wa(e.width/2,e.height),wa(0,e.height/2)]:[wa(0,0),wa(0+e.width,0),wa(0+e.width,e.height),wa(0,e.height)],e$=e=>ZG(e)||jG(e)?e.points:QG(e),fS=e=>{let t=e.reduce((o,[n,r])=>(o.minY=Math.min(o.minY,r),o.minX=Math.min(o.minX,n),o.maxX=Math.max(o.maxX,n),o.maxY=Math.max(o.maxY,r),o),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,cx:0,cy:0});return t.cx=(t.maxX+t.minX)/2,t.cy=(t.maxY+t.minY)/2,t},bS=e=>{let t=e$(e),{cx:o,cy:n}=fS(t),r=wa(o,n),a=t.map(m=>JG(m,r,e.angle)),{minX:i,minY:s,maxX:l,maxY:c}=fS(a);return[i+e.x,s+e.y,l+e.x,c+e.y]},B1=(e,t,o=!1)=>{let n=bS(e),r=t[0]<=n[0]&&t[2]>=n[2]&&t[1]<=n[1]&&t[3]>=n[3];return o?r?!0:n[0]<=t[0]&&n[2]>=t[2]&&n[1]<=t[1]&&n[3]>=t[3]:r},xS=(e,t)=>{let o=bS(e);return(Zg(o[0],qg(t[0],t[2]))||Zg(t[0],qg(o[0],o[2])))&&(Zg(o[1],qg(t[1],t[3]))||Zg(t[1],qg(o[1],o[3])))},yS=({elements:e,bounds:t,type:o,errorMargin:n=0})=>{XG(t)&&(t=KG(t,WG(e)));let r=[t[0]-n,t[1]-n,t[2]+n,t[3]+n],a=new Set;for(let i of e){if(a.has(i.id))continue;if(o==="overlap"?xS(i,r):o==="inside"?B1(i,r):B1(i,r,!0)){if(a.add(i.id),i.boundElements)for(let l of i.boundElements)a.add(l.id);qG(i)&&i.containerId&&a.add(i.containerId),YG(i)&&(i.startBinding&&a.add(i.startBinding.elementId),i.endBinding&&a.add(i.endBinding?.elementId))}}return e.filter(i=>a.has(i.id))};import{arrayToMap as W6e,isShallowEqual as o$}from"@orangecatai/common";var t$=function(){let e=null,t=null,o=null,n=(a,i,s,l)=>{if(o!==void 0&&i===t&&a===e&&s.editingGroupId===o?.editingGroupId)return o;let c={};for(let d of a){let u=d.groupIds;if(s.editingGroupId){let h=u.indexOf(s.editingGroupId);h>-1&&(u=u.slice(0,h))}if(u.length>0){let h=u[u.length-1];c[h]=!0}}let m={},p=i.reduce((d,u)=>{if(u.isDeleted)return d;let h=u.groupIds.find(g=>c[g]);return h&&(d[u.id]=!0,Array.isArray(m[h])?m[h].push(u.id):m[h]=[u.id]),d},{});for(let d of Object.keys(m))m[d].length<2&&c[d]&&(c[d]=!1);return t=i,e=a,o={editingGroupId:s.editingGroupId,selectedGroupIds:c,selectedElementIds:F1({...s.selectedElementIds,...p},l)},o},r=(a,i,s,l)=>{let c=l?l.scene.getSelectedElements({selectedElementIds:a.selectedElementIds,elements:i}):O1(i,a);return c.length?n(c,i,a,s):{selectedGroupIds:{},editingGroupId:null,selectedElementIds:F1(a.selectedElementIds,s)}};return r.clearCache=()=>{t=null,e=null,o=null},r}();var J6e=function(){let e=null,t=null,o=null,n=(r,a)=>(o!=null&&r===e&&a.selectedElementIds===t||(o=r.some(i=>a.selectedElementIds[i.id]),e=r,t=a.selectedElementIds),o);return n.clearCache=()=>{e=null,t=null,o=null},n}(),O1=(e,t,o)=>{let n=new Set,r=[];for(let a of e.values()){if(t.selectedElementIds[a.id]){r.push(a),n.add(a.id);continue}if(o?.includeBoundTextElement&&bc(a)&&t.selectedElementIds[a?.containerId]){r.push(a),n.add(a.id);continue}}if(o?.includeElementsInFrames){let a=[];return r.forEach(i=>{$g(i)&&wS(e,i.id).forEach(s=>!n.has(s.id)&&a.push(s)),a.push(i)}),a}return r};var F1=(e,t)=>o$(t.selectedElementIds,e)?t.selectedElementIds:e;var wS=(e,t)=>{let o=[];for(let n of e.values())n.frameId===t&&o.push(n);return o};var r$=typeof document<"u"?document.createElement("img"):{src:""};r$.src=`data:${vS.svg},${encodeURIComponent('<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="image" class="svg-inline--fa fa-image fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#888" d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"></path></svg>')}`;var a$=typeof document<"u"?document.createElement("img"):{src:""};a$.src=`data:${vS.svg},${encodeURIComponent('<svg viewBox="0 0 668 668" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><path d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48ZM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56ZM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.81709 0 0 .81709 124.825 145.825)"/><path d="M256 8C119.034 8 8 119.033 8 256c0 136.967 111.034 248 248 248s248-111.034 248-248S392.967 8 256 8Zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676ZM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.30366 0 0 .30366 506.822 60.065)"/></svg>')}`;var z1=new WeakMap;var ES=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="line"||e==="diamond"||e==="image";var an=class an{};D(an,"rg",new p$),D(an,"cache",new WeakMap),D(an,"get",(t,o)=>{let n=an.cache.get(t);if(n&&(o===null||n.theme===o))return n.shape}),D(an,"delete",t=>{an.cache.delete(t),z1.delete(t)}),D(an,"destroy",()=>{an.cache=new WeakMap}),D(an,"generateElementShape",(t,o)=>{let n=o?.isExporting?void 0:an.get(t,o?o.theme:null);if(n!==void 0)return n;z1.delete(t);let r=h$(t,an.rg,o||{isExporting:!1,canvasBackgroundColor:m$.white,embedsValidationStatus:null,theme:U1.LIGHT});return o?.isExporting||an.cache.set(t,{shape:r,theme:o?.theme||U1.LIGHT}),r});var wc=an,u$=e=>[8,8+e],SS=e=>[1.5,6+e];function g$(e){let t=e.roughness,o=Math.max(e.width,e.height),n=Math.min(e.width,e.height);return n>=20&&o>=50||n>=15&&e.roundness&&ES(e.type)||Cs(e)&&o>=50?t:Math.min(t/(o<10?3:2),2.5)}var ya=(e,t=!1,o=!1)=>{let n={seed:e.seed,strokeLineDash:e.strokeStyle==="dashed"?u$(e.strokeWidth):e.strokeStyle==="dotted"?SS(e.strokeWidth):void 0,disableMultiStroke:e.strokeStyle!=="solid",strokeWidth:e.strokeStyle!=="solid"?e.strokeWidth+.5:e.strokeWidth,fillWeight:e.strokeWidth/2,hachureGap:e.strokeWidth*4,roughness:g$(e),stroke:o?Jg(e.strokeColor):e.strokeColor,preserveVertices:t||e.roughness<c$.cartoonist};switch(e.type){case"rectangle":case"iframe":case"embeddable":case"video":case"diamond":case"ellipse":return n.fillStyle=e.fillStyle,n.fill=km(e.backgroundColor)?void 0:o?Jg(e.backgroundColor):e.backgroundColor,e.type==="ellipse"&&(n.curveFitting=1),n;case"line":case"freedraw":return Vg(e.points)&&(n.fillStyle=e.fillStyle,n.fill=e.backgroundColor==="transparent"?void 0:o?Jg(e.backgroundColor):e.backgroundColor),n;case"arrow":return n;default:throw new Error(`Unimplemented type ${e.type}`)}},TS=(e,t,o)=>I1(e)&&(t||iS(e)&&o?.get(e.id)!==!0)&&km(e.backgroundColor)&&km(e.strokeColor)?{...e,roughness:0,backgroundColor:"#d3d3d3",fillStyle:"solid"}:sS(e)?{...e,strokeColor:km(e.strokeColor)?"#000000":e.strokeColor,backgroundColor:km(e.backgroundColor)?"#f4f4f6":e.backgroundColor}:e,kS=(e,t,o,n,r,a,i,s)=>{let l=N1(e,t,o,n);if(l===null)return[];let c=(p,d)=>{if(p===null)return[];let[,,u,h,g,f]=p;return[r.line(u,h,g,f,d)]},m=s?Jg(e.strokeColor):e.strokeColor;switch(n){case"dot":case"circle":case"circle_outline":{let[p,d,u]=l;return delete a.strokeLineDash,[r.circle(p,d,u,{...a,fill:n==="circle_outline"?i:m,fillStyle:"solid",stroke:m,roughness:Math.min(.5,a.roughness||0)})]}case"triangle":case"triangle_outline":{let[p,d,u,h,g,f]=l;return delete a.strokeLineDash,[r.polygon([[p,d],[u,h],[g,f],[p,d]],{...a,fill:n==="triangle_outline"?i:m,fillStyle:"solid",roughness:Math.min(1,a.roughness||0)})]}case"diamond":case"diamond_outline":{let[p,d,u,h,g,f,w,y]=l;return delete a.strokeLineDash,[r.polygon([[p,d],[u,h],[g,f],[w,y],[p,d]],{...a,fill:n==="diamond_outline"?i:m,fillStyle:"solid",roughness:Math.min(1,a.roughness||0)})]}case"crowfoot_one":return c(l,a);case"bar":case"arrow":case"crowfoot_many":case"crowfoot_one_or_many":default:{let[p,d,u,h,g,f]=l;if(e.strokeStyle==="dotted"){let w=SS(e.strokeWidth-1);a.strokeLineDash=[w[0],w[1]-1]}else delete a.strokeLineDash;return a.roughness=Math.min(1,a.roughness||0),[r.line(u,h,p,d,a),r.line(g,f,p,d,a),...n==="crowfoot_one_or_many"?c(N1(e,t,o,"crowfoot_one"),a):[]]}}};var h$=(e,t,{isExporting:o,canvasBackgroundColor:n,embedsValidationStatus:r,theme:a})=>{let i=a===U1.DARK;switch(e.type){case"rectangle":case"iframe":case"embeddable":case"video":{let s;if(e.roundness){let l=e.width,c=e.height,m=Im(Math.min(l,c),e);s=t.path(`M ${m} 0 L ${l-m} 0 Q ${l} 0, ${l} ${m} L ${l} ${c-m} Q ${l} ${c}, ${l-m} ${c} L ${m} ${c} Q 0 ${c}, 0 ${c-m} L 0 ${m} Q 0 0, ${m} 0`,ya(TS(e,o,r),!0,i))}else s=t.rectangle(0,0,e.width,e.height,ya(TS(e,o,r),!1,i));return s}case"diamond":{let s,[l,c,m,p,d,u,h,g]=Wg(e);if(e.roundness){let f=Im(Math.abs(l-h),e),w=Im(Math.abs(p-c),e);s=t.path(`M ${l+f} ${c+w} L ${m-f} ${p-w}