@orangecatai/adgen-canvas 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/{chunk-UJP3DIYP.js → chunk-7JV3TYRQ.js} +3 -3
- package/dist/dev/{chunk-4VEZT6GV.js → chunk-N5ZWSPF6.js} +2 -2
- package/dist/dev/data/{image-PZBTJSVV.js → image-2XZ3M7M6.js} +3 -3
- package/dist/dev/index.js +3 -3
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/{chunk-62H5HX6J.js → chunk-3WJLWPNH.js} +1 -1
- package/dist/prod/{chunk-VXQSQDGS.js → chunk-WMOQJMH6.js} +2 -2
- package/dist/prod/data/image-3F2KCNSC.js +1 -0
- package/dist/prod/index.js +2 -2
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/excalidraw/types.d.ts +1 -1
- package/package.json +1 -1
- package/dist/prod/data/image-REZEAPVS.js +0 -1
- /package/dist/dev/{chunk-UJP3DIYP.js.map → chunk-7JV3TYRQ.js.map} +0 -0
- /package/dist/dev/{chunk-4VEZT6GV.js.map → chunk-N5ZWSPF6.js.map} +0 -0
- /package/dist/dev/data/{image-PZBTJSVV.js.map → image-2XZ3M7M6.js.map} +0 -0
package/dist/prod/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{$ as mh,A as ch,B as eL,C as iE,D as sE,E as rm,F as ql,G as am,H as im,I as Jl,J as lE,K as cE,L as dE,M as zr,N as Yi,O as mE,P as tL,Q as Ga,R as $i,S as Ql,U as pE,W as uE,X as gE,Y as sm,Z as hE,_ as dh,a as oE,aa as lm,b as Ha,ba as fE,c as Ln,ca as ph,d as nE,da as Ua,e as Ge,ea as bE,f as rE,fa as Vi,g as de,ga as xE,h as Hi,ha as So,i as _n,ia as uh,j as Kl,ja as yE,k as Xl,ka as cm,l as Gi,la as gh,m as Zl,ma as EE,n as Ui,na as wE,o as aE,oa as vE,p as sh,pa as ec,q as Dn,r as Ho,s as Or,t as ho,u as pr,v as Wi,w as om,x as lh,y as jl,z as nm}from"./chunk-VXQSQDGS.js";import{a as T}from"./chunk-62H5HX6J.js";import{M as ih}from"./chunk-MSBJ7C4T.js";import{c as tE}from"./chunk-3PELD44J.js";import{b as Qy,c as eE,d as A}from"./chunk-SRAX5OIU.js";import uee,{useEffect as gee,useMemo as hee}from"react";import{DEFAULT_UI_OPTIONS as zA,isShallowEqual as fee}from"@orangecatai/common";import RP from"clsx";import Rj from"lodash.throttle";import cr,{useContext as Ba}from"react";import{flushSync as Io}from"react-dom";import Nj from"roughjs/bin/rough";import{nanoid as R1}from"nanoid";import{clamp as NP,pointFrom as pe,pointDistance as Pa,vector as BP,pointRotateRads as N1,vectorFromPoint as B1,vectorSubtract as FP,vectorDot as OP,vectorNormalize as zP}from"@orangecatai/math";import{COLOR_PALETTE as Bj,CODES as HP,shouldResizeFromCenter as GP,shouldMaintainAspectRatio as Dd,shouldRotateWithDiscreteAngle as UP,isArrowKey as Lg,KEYS as ne,APP_NAME as Fj,CURSOR_TYPE as lt,DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT as Oj,DEFAULT_VERTICAL_ALIGN as WP,DRAGGING_THRESHOLD as YP,ELEMENT_SHIFT_TRANSLATE_AMOUNT as zj,ELEMENT_TRANSLATE_AMOUNT as $P,EVENT as he,FRAME_STYLE as ln,IMAGE_MIME_TYPES as Hj,IMAGE_RENDER_TIMEOUT as Gj,LINE_CONFIRM_THRESHOLD as F1,MAX_ALLOWED_FILE_BYTES as VP,MIME_TYPES as rr,MQ_RIGHT_SIDEBAR_MIN_WIDTH as Uj,POINTER_BUTTON as Aa,ROUNDNESS as _g,SCROLL_TIMEOUT as Wj,TAP_TWICE_TIMEOUT as Yj,TEXT_TO_CENTER_SNAP_THRESHOLD as $j,THEME as Dg,TOUCH_CTX_MENU_TIMEOUT as Vj,VERTICAL_ALIGN as Kj,YOUTUBE_STATES as Rg,ZOOM_STEP as Xj,POINTER_EVENTS as Nl,TOOL_TYPE as ar,supportsResizeObserver as Zj,DEFAULT_COLLISION_THRESHOLD as KP,DEFAULT_TEXT_ALIGN as jj,ARROW_TYPE as La,DEFAULT_REDUCED_GLOBAL_ALPHA as qj,isLocalLink as Jj,normalizeLink as O1,toValidURL as Qj,getGridPoint as Jt,getLineHeight as XP,debounce as ZP,distance as Bl,getFontString as z1,getNearestScrollableContainer as eq,isInputLike as jP,isToolIcon as tq,isWritableElement as Rd,sceneCoordsToViewportCoords as Ng,tupleToCoors as H1,viewportCoordsToSceneCoords as rt,wrapEvent as oq,updateObject as G1,updateActiveTool as ir,isTransparent as nq,easeToValuesRAF as rq,muteFSAbortError as aq,isTestEnv as N6,isDevEnv as B6,easeOut as iq,updateStable as Nd,addEventListener as ht,normalizeEOL as sq,getDateTime as qP,isShallowEqual as JP,arrayToMap as Bg,applyDarkModeFilter as lq,randomInteger as cq,CLASSES as U1,Emitter as Ai,MINIMUM_ARROW_SIZE as dq,DOUBLE_TAP_POSITION_THRESHOLD as mq,BIND_MODE_TIMEOUT as pq,invariant as sr,getFeatureFlag as Rr,createUserAgentDescriptor as F6,getFormFactor as uq,deriveStylesPanelMode as Wg,isIOS as gq,isBrave as hq,isSafari as fq,loadDesktopUIModePreference as bq,setDesktopUIMode as xq,isSelectionLikeTool as Fg,oneOf as QP}from"@orangecatai/common";import{getObservedAppState as yq,getCommonBounds as Fl,getElementAbsoluteCoords as Og,bindOrUnbindBindingElements as e6,fixBindingsAfterDeletion as Eq,getHoveredElementForBinding as Cn,isBindingEnabled as Bd,shouldEnableBindingForPointerEvent as wq,updateBoundElements as zg,LinearElementEditor as _e,newElementWith as _a,newFrameElement as t6,newFreeDrawElement as vq,newEmbeddableElement as o6,newMagicFrameElement as n6,newIframeElement as Iq,newArrowElement as Tq,newElement as Cq,newImageElement as W1,newLinearElement as kq,newTextElement as r6,refreshTextDimensions as Sq,deepCopyElement as a6,duplicateElements as Y1,hasBoundTextElement as i6,isArrowElement as Ol,isBindingElement as lr,isBindingElementType as Mq,isBoundToContainer as $1,isFrameLikeElement as Qt,isImageElement as Da,isEmbeddableElement as Nr,isInitializedImageElement as Fd,isLinearElement as mo,isLinearElementType as Pq,isUsingAdaptiveRadius as Aq,isIframeElement as zl,isIframeLikeElement as V1,isMagicFrameElement as K1,isTextBindableContainer as s6,isElbowArrow as To,isFlowchartNodeElement as Lq,isBindableElement as X1,isTextElement as kn,getNormalizedDimensions as _q,isElementCompletelyInViewport as Z1,isElementInViewport as l6,isInvisiblySmallElement as c6,getCornerRadius as Dq,isPathALoop as d6,createSrcDoc as m6,embeddableURLValidator as j1,maybeParseEmbedSrc as Rq,getEmbedLink as Hg,getInitializedImageElements as Nq,normalizeSVG as p6,updateImageCache as Bq,getBoundTextElement as q1,getContainerCenter as J1,getContainerElement as u6,isValidTextContainer as Fq,redrawTextBoundingBox as Oq,hasBoundingBox as zq,getFrameChildren as Q1,isCursorInFrame as g6,addElementsToFrame as ey,replaceAllElementsInFrame as Hq,removeElementsFromFrame as Gq,getElementsInResizingFrame as ty,getElementsInNewFrame as Uq,getContainingFrame as oy,elementOverlapsWithFrame as Wq,updateFrameMembershipOfSelectedElements as h6,isElementInFrame as f6,getFrameLikeTitle as Yq,getElementsOverlappingFrame as $q,filterElementsEligibleAsFrameChildren as Vq,hitElementBoundText as Kq,hitElementBoundingBoxOnly as Xq,hitElementItself as Od,getVisibleSceneBounds as Zq,FlowChartCreator as jq,FlowChartNavigator as qq,getLinkDirectionFromKey as b6,cropElement as Jq,wrapText as Qq,isElementLink as ny,parseElementLinkFromURL as eJ,isMeasureTextSupported as tJ,normalizeText as oJ,measureText as x6,getLineHeightInPx as nJ,getApproxMinLineWidth as rJ,getApproxMinLineHeight as aJ,getMinTextElementWidth as iJ,ShapeCache as zd,getRenderOpacity as sJ,editGroupForSelectedElement as lJ,getElementsInGroup as Li,getSelectedGroupIdForElement as cJ,getSelectedGroupIds as dJ,isElementInGroup as y6,isSelectedViaGroup as mJ,selectGroupsForSelectedElements as cn,syncInvalidIndices as O6,syncMovedIndices as E6,excludeElementsInFramesFromSelection as pJ,getSelectionStateForElements as uJ,makeNextSelectedElementIds as ze,getResizeOffsetXY as gJ,getResizeArrowDirection as hJ,transformElements as fJ,getCursorForResizingElement as w6,getElementWithTransformHandleType as v6,getTransformHandleTypeFromCoords as I6,dragNewElement as T6,dragSelectedElements as bJ,getDragOffsetXY as xJ,isNonDeletedElement as C6,Scene as k6,Store as yJ,CaptureUpdateAction as po,hitElementBoundingBox as EJ,isLineElement as ry,isSimpleArrow as ay,StoreDelta as S6,positionElementsOnGrid as M6,calculateFixedPointForNonElbowArrowBinding as P6,bindOrUnbindBindingElement as wJ,mutateElement as Gg,getElementBounds as A6,doBoundsIntersect as vJ,isPointInElement as IJ,maxBindingDistance_simple as iy,convertToExcalidrawElements as L6,getSnapOutlineMidPoint as sy,handleFocusPointDrag as TJ,handleFocusPointHover as CJ,handleFocusPointPointerDown as kJ,handleFocusPointPointerUp as SJ,maybeHandleArrowPointlikeDrag as Ug,getUncroppedWidthAndHeight as MJ}from"@orangecatai/element";import{KEYS as Hh,MOBILE_ACTION_BUTTON_BG as gL,updateActiveTool as hL}from"@orangecatai/common";import{getNonDeletedElements as Gh}from"@orangecatai/element";import{fixBindingsAfterDeletion as fL}from"@orangecatai/element";import{LinearElementEditor as vv}from"@orangecatai/element";import{newElementWith as Pm}from"@orangecatai/element";import{getContainerElement as Iv}from"@orangecatai/element";import{isBoundToContainer as Sm,isElbowArrow as bL,isFrameLikeElement as xL}from"@orangecatai/element";import{getFrameChildren as yL}from"@orangecatai/element";import{getElementsInGroup as Uh,selectGroupsForSelectedElements as EL}from"@orangecatai/element";import{CaptureUpdateAction as Mm}from"@orangecatai/element";import{isDevEnv as aL}from"@orangecatai/common";import{atom as Pe,createStore as oL}from"jotai";import{createIsolation as nL}from"jotai-scope";var IE=nL();var{useAtom:le,useSetAtom:Rn,useAtomValue:Ki,useStore:vee}=IE,TE=IE.Provider,Et=oL();var rL=Qy({"./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-RQF5X6GM.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 iL=85,Nn={code:"en",label:"English"},Zi=[Nn,...[{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=>tE[e.code]>=iL).sort((e,t)=>e.label>t.label?1:-1)],mm="__test__";aL()&&Zi.unshift({code:mm,label:"test language"},{code:`${mm}.rtl`,label:"\u202Atest language (rtl)\u202C",rtl:!0});var Xi=Nn,dm={},pm=async e=>{if(Xi=e,document.documentElement.dir=Xi.rtl?"rtl":"ltr",document.documentElement.lang=Xi.code,e.code.startsWith(mm))dm={};else try{dm=await rL(`./locales/${Xi.code}.json`)}catch(t){console.error(`Failed to load language ${e.code}:`,t.message),dm=ih}Et.set(kE,e.code)},ur=()=>Xi,CE=(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},f=(e,t,o)=>{if(Xi.code.startsWith(mm))return`\u202A[[${t?`${e}(${JSON.stringify(t).slice(1,-1)})`:e}]]\u202C`;let n=e.split("."),r=CE(dm,n)||CE(ih,n)||o;if(r===void 0){let a=`Can't find translation for ${e}`;if(T.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},kE=Pe(Nn.code),Ue=()=>{let e=Ki(kE);return{t:f,langCode:e}};import sL from"clsx";import _t from"react";import{THEME as lL}from"@orangecatai/common";import{Fragment as We,jsx as b,jsxs as H}from"react/jsx-runtime";var pn=e=>"var(--icon-fill-color)",SE=e=>e===lL.LIGHT?"#fff":"#1e1e1e",R=(e,t=512)=>{let{width:o=512,height:n=o,mirror:r,style:a,...i}=typeof t=="number"?{width:t}:t;return b("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:`0 0 ${o} ${n}`,className:sL({"rtl-mirror":r}),style:a,...i,children:typeof e=="string"?b("path",{fill:"currentColor",d:e}):e})},K={width:24,height:24,fill:"none",strokeWidth:2,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},Ee={width:20,height:20,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},Fee=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("rect",{x:3,y:8,width:18,height:4,rx:1}),b("line",{x1:12,y1:8,x2:12,y2:21}),b("path",{d:"M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7"}),b("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"})]}),K),um=R(H("g",{strokeWidth:"1.25",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),b("path",{d:"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),b("line",{x1:"3",y1:"6",x2:"3",y2:"19"}),b("line",{x1:"12",y1:"6",x2:"12",y2:"19"}),b("line",{x1:"21",y1:"6",x2:"21",y2:"19"})]}),K),ME=R(H("svg",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),b("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),K),PE=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("circle",{cx:"12",cy:"12",r:"1"}),b("circle",{cx:"12",cy:"19",r:"1"}),b("circle",{cx:"12",cy:"5",r:"1"})]}),K),AE=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),b("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),b("path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]}),K),LE=R(H("svg",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M9 4v6l-2 4v2h10v-2l-2 -4v-6"}),b("line",{x1:"12",y1:"16",x2:"12",y2:"21"}),b("line",{x1:"8",y1:"4",x2:"16",y2:"4"})]}),K),hh=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M6.5 9.5l3.5 -3"}),b("path",{d:"M14 5.5l3 1.5"}),b("path",{d:"M18.5 10l-2.5 7"}),b("path",{d:"M13.5 17.5l-7 -5"})]}),K),Wa=R(H("g",{children:[b("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"}),b("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"}),b("mask",{id:"UnlockedIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:6,y:1,width:9,height:9,children:b("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"})}),b("g",{mask:"url(#UnlockedIcon)",children:b("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"})})]}),Ee),ji=R(H("g",{strokeWidth:"1.25",children:[b("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"}),b("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z"}),b("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"})]}),Ee),_E=R(b("g",{fill:"currentColor",children:b("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}),DE=R(H(We,{children:[b("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"}),b("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z",fill:"currentColor"}),b("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"}),RE=R(H(We,{children:[b("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"}),b("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m72.181 59.247-13.058-10-2.948 13.62 16.006-3.62Z",fill:"currentColor"}),b("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"}),NE=R(H(We,{children:[b("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"}),b("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m24.165 1.093-2.132 16.309 13.27-4.258-11.138-12.05Z",fill:"currentColor"}),b("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"}),Oee=R(b("g",{fill:"currentColor",children:b("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"}),Ya=R(H("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M13.5 13.5l4.5 4.5"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),Hr=R(H("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,children:[b("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"}),b("path",{d:"M5 15m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M5 17c0 1.42 .316 2.805 1 4"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),qi=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})]}),K),Ji=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"})]}),K),Qi=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("circle",{cx:"12",cy:"12",r:"9"})]}),K),gm=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),b("line",{x1:"15",y1:"16",x2:"19",y2:"12"}),b("line",{x1:"15",y1:"8",x2:"19",y2:"12"})]}),K),es=R(b("path",{d:"M4.167 10h11.666",strokeWidth:"1.5"}),Ee),BE=R(H("g",{strokeWidth:"1.25",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z"}),b("path",{d:"M16 7h4"}),b("path",{d:"M18 19h-13a2 2 0 1 1 0 -4h4a2 2 0 1 0 0 -4h-3"})]}),K),Bn=R(H("g",{strokeWidth:"1.25",children:[b("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"}),b("path",{d:"m11.25 5.417 3.333 3.333"})]}),Ee),Fn=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"4",y1:"20",x2:"7",y2:"20"}),b("line",{x1:"14",y1:"20",x2:"21",y2:"20"}),b("line",{x1:"6.9",y1:"15",x2:"13.8",y2:"15"}),b("line",{x1:"10.2",y1:"6.3",x2:"16",y2:"20"}),b("polyline",{points:"5 20 11 4 13 4 20 20"})]}),K),FE=R(H("g",{stroke:"currentColor",strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M3 7v-2h13v2"}),b("path",{d:"M10 5v14"}),b("path",{d:"M12 19h-4"}),b("path",{d:"M15 13v-1h6v1"}),b("path",{d:"M18 12v7"}),b("path",{d:"M17 19h2"})]}),K),ts=R(H("g",{strokeWidth:"1.25",children:[b("path",{d:"M12.5 6.667h.01"}),b("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"}),b("path",{d:"m3.333 12.5 3.334-3.333c.773-.745 1.726-.745 2.5 0l4.166 4.166"}),b("path",{d:"m11.667 11.667.833-.834c.774-.744 1.726-.744 2.5 0l1.667 1.667"})]}),Ee),hm=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M18 13.3l-6.3 -6.3"})]}),K),fh=R(b("path",{strokeWidth:"1.25",d:"M10 4.167v11.666M4.167 10h11.666"}),Ee),bh=R(b("path",{d:"M5 10h10",strokeWidth:"1.25"}),Ee),OE=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M21 21l-6 -6"}),b("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"}),b("path",{d:"M3 4v4h4"})]}),K),Ut=R(b("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"}),Ee),os=R(H("g",{strokeWidth:"1.5",children:[b("polyline",{points:"12 16 18 10 12 4"}),b("polyline",{points:"8 4 2 10 8 16"})]}),Ee),tc=R(H("g",{strokeWidth:"1.25",children:[b("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"}),b("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"})]}),Ee),oc=R(b("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"}),Ee),nc=R(b("g",{stroke:"currentColor",strokeLinejoin:"round",children:b("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"})}),{...Ee,strokeWidth:1.5}),zE=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),b("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),b("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]}),K),$a=R(b("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"}),Ee),ns=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("circle",{cx:"12",cy:"12",r:"9"}),b("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),b("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),K),HE=R(H("g",{strokeWidth:"1.25",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("circle",{cx:"12",cy:"12",r:"9"}),b("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),b("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),K),xh=R(b("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"}),Ee),fm=R(b("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"}),Ee),GE=R(H("g",{strokeWidth:"1.25",children:[b("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"}),b("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"})]}),Ee),UE=R(H("g",{strokeWidth:"1.25",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M4 4l11.733 16h4.267l-11.733 -16z"}),b("path",{d:"M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"})]}),K),bm=R(b("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),rc=R(H("g",{strokeWidth:"1.25",children:[b("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"}),b("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"})]}),Ee),WE=R("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}),YE=R("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}),rs=R(b("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"}),Ee),zee=R("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}),Hee=R("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"),xm=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M5 16l1.465 1.638a2 2 0 1 1 -3.015 .099l1.55 -1.737z"}),b("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"}),b("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"})]}),K),$E=R(b("g",{strokeWidth:1.5,children:b("path",{d:"M6 18l12 -12"})}),K),ym=R(H("g",{strokeWidth:"1.25",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M15 8h.01"}),b("path",{d:"M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5"}),b("path",{d:"M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4"}),b("path",{d:"M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598"}),b("path",{d:"M19 16v6"}),b("path",{d:"M22 19l-3 3l-3 -3"})]}),K),VE=R("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}),Gee=R("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}),Uee=R("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}),KE=R("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"),Wee=R("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"),yh=R(b("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"}),Ee),Eh=R(b("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"}),Ee),XE=R("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}),ZE=R(b("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"}),Ee),Yee=R("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"),$ee=R("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}),Vee=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M12 14v-11"}),b("path",{d:"M9 6l3 -3l3 3"})]}),K),Kee=R(H(We,{children:[b("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"}),b("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}),Xee=R(b("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}),jE=H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M12 10l0 10"}),b("path",{d:"M12 10l4 4"}),b("path",{d:"M12 10l-4 4"}),b("path",{d:"M4 4l16 0"})]}),qE=H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M12 5l0 14"}),b("path",{d:"M16 9l-4 -4"}),b("path",{d:"M8 9l4 -4"})]}),wh=R(qE,K),vh=R(qE,{...K,style:{transform:"rotate(180deg)"}}),Ih=R(jE,K),Th=R(jE,{...K,style:{transform:"rotate(180deg)"}}),Ch=R(H(We,{children:[H("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[b("path",{d:"M3.333 3.333h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),b("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"})]}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),kh=R(H(We,{children:[H("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[b("path",{d:"M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),b("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"})]}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),Sh=R(H(We,{children:[H("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[b("path",{d:"M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),b("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"})]}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),Mh=R(H(We,{children:[H("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[b("path",{d:"M16.667 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),b("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"})]}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),JE=R(H(We,{children:[H("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[b("path",{d:"M16.667 3.333v13.334M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),b("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"})]}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),QE=R(H(We,{children:[H("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[b("path",{d:"M3.333 3.333h13.334M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),b("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"})]}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),Ph=R(H("g",{stroke:"currentColor",strokeWidth:"1.25",children:[b("path",{d:"M1.667 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),b("path",{d:"M8.333 10h3.334",strokeLinejoin:"round"}),b("path",{d:"M15.417 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),b("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"})]}),Ee),Ah=R(H("g",{stroke:"currentColor",strokeWidth:"1.25",children:[b("path",{d:"M10 18.333v-2.916",strokeLinecap:"round",strokeLinejoin:"round"}),b("path",{d:"M10 11.667V8.333",strokeLinejoin:"round"}),b("path",{d:"M10 4.583V1.667",strokeLinecap:"round",strokeLinejoin:"round"}),b("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"})]}),Ee),Em=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("circle",{cx:"9",cy:"7",r:"4"}),b("path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"}),b("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}),b("path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85"})]}),K),Zee=R("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"),ew=R("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"),Go=R(H(We,{children:[b("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:b("path",{d:"M15 5 5 15M5 5l10 10"})}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),jee=R("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}),qee=R("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}),Jee=R("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}),Lh=_t.memo(({theme:e})=>R(H(We,{children:[b("path",{d:"M25 26H111V111H25",fill:pn(e)}),b("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:pn(e),strokeWidth:"2"}),b("path",{d:"M100 100H160V160H100",fill:pn(e)}),b("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:pn(e),strokeWidth:"2"}),H("g",{fill:SE(e),stroke:pn(e),strokeWidth:"6",children:[b("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),b("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),b("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),b("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),_h=_t.memo(({theme:e})=>R(H(We,{children:[b("path",{d:"M25 26H111V111H25",fill:pn(e)}),b("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:pn(e),strokeWidth:"2"}),b("path",{d:"M100 100H160V160H100",fill:pn(e)}),b("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:pn(e),strokeWidth:"2"}),H("g",{fill:SE(e),stroke:pn(e),strokeWidth:"6",children:[b("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),b("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),b("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),b("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),b("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),b("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),tw=R(b("g",{strokeWidth:1.25,children:b("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"})}),Ee),ow=R(H(We,{children:[b("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"}),b("mask",{id:"FillHachureIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:2,y:2,width:16,height:16,children:b("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"})}),b("g",{mask:"url(#FillHachureIcon)",children:b("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"})})]}),Ee),nw=R(H(We,{children:[H("g",{clipPath:"url(#a)",children:[b("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"}),b("mask",{id:"FillCrossHatchIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:-1,y:-1,width:22,height:22,children:b("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"})}),b("g",{mask:"url(#FillCrossHatchIcon)",children:b("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"})})]}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),rw=R(H(We,{children:[b("g",{clipPath:"url(#a)",children:b("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"})}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),{...Ee,fill:"currentColor"}),Dh=R(b(We,{children:b("path",{d:"M4.167 10h11.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),Ee),aw=R(b("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),Ee),iw=R(b("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"3.75",strokeLinecap:"round",strokeLinejoin:"round"}),Ee),Qee=_t.memo(({theme:e})=>R(b("path",{d:"M6 10H34",stroke:pn(e),strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})),sw=R(H("g",{strokeWidth:"2",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M5 12h2"}),b("path",{d:"M17 12h2"}),b("path",{d:"M11 12h2"})]}),K),lw=R(H("g",{strokeWidth:"2",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M4 12v.01"}),b("path",{d:"M8 12v.01"}),b("path",{d:"M12 12v.01"}),b("path",{d:"M16 12v.01"}),b("path",{d:"M20 12v.01"})]}),K),cw=R(b("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"}),Ee),dw=R(b("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"}),Ee),mw=R(b("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"}),Ee),pw=R(H("svg",{strokeWidth:"1.5",children:[b("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"}),b("path",{d:"M13.3333 3.33331V3.34331"}),b("path",{d:"M16.6667 3.33331V3.34331"}),b("path",{d:"M16.6667 6.66669V6.67669"}),b("path",{d:"M16.6667 10V10.01"}),b("path",{d:"M3.33334 13.3333V13.3433"}),b("path",{d:"M16.6667 13.3333V13.3433"}),b("path",{d:"M3.33334 16.6667V16.6767"}),b("path",{d:"M6.66666 16.6667V16.6767"}),b("path",{d:"M10 16.6667V16.6767"}),b("path",{d:"M13.3333 16.6667V16.6767"}),b("path",{d:"M16.6667 16.6667V16.6767"})]}),Ee),uw=R(H("g",{strokeWidth:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M4 12v-4a4 4 0 0 1 4 -4h4"}),b("line",{x1:"16",y1:"4",x2:"16",y2:"4.01"}),b("line",{x1:"20",y1:"4",x2:"20",y2:"4.01"}),b("line",{x1:"20",y1:"8",x2:"20",y2:"8.01"}),b("line",{x1:"20",y1:"12",x2:"20",y2:"12.01"}),b("line",{x1:"4",y1:"16",x2:"4",y2:"16.01"}),b("line",{x1:"20",y1:"16",x2:"20",y2:"16.01"}),b("line",{x1:"4",y1:"20",x2:"4",y2:"20.01"}),b("line",{x1:"8",y1:"20",x2:"8",y2:"20.01"}),b("line",{x1:"12",y1:"20",x2:"12",y2:"20.01"}),b("line",{x1:"16",y1:"20",x2:"16",y2:"20.01"}),b("line",{x1:"20",y1:"20",x2:"20",y2:"20.01"})]}),K),gw=_t.memo(({flip:e=!1})=>R(H("g",{transform:e?"translate(24, 0) scale(-1, 1)":"",stroke:"currentColor",opacity:.3,strokeWidth:2,children:[b("path",{d:"M12 12l-9 0"}),b("path",{d:"M21 9l-6 6"}),b("path",{d:"M21 15l-6 -6"})]}),K)),hw=_t.memo(({flip:e=!1})=>R(H("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",strokeWidth:2,fill:"none",children:[b("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),b("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})),fw=_t.memo(({flip:e=!1})=>R(H("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[b("path",{d:"M32 10L6 10",strokeWidth:2}),b("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),bw=_t.memo(({flip:e=!1})=>R(H("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,children:[b("path",{d:"M26 10L6 10"}),b("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),xw=_t.memo(({flip:e=!1})=>R(b("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",children:b("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"currentColor",strokeWidth:2,fill:"none"})}),{width:40,height:20})),yw=_t.memo(({flip:e=!1})=>R(H("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[b("path",{d:"M32 10L6 10",strokeWidth:2}),b("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})),Ew=_t.memo(({flip:e=!1})=>R(H("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,strokeLinejoin:"round",children:[b("path",{d:"M6,9.5H27"}),b("path",{d:"M27,5L34,10L27,14Z",fill:"none"})]}),{width:40,height:20})),ww=_t.memo(({flip:e=!1})=>R(H("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[b("path",{d:"M6,9.5H20"}),b("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),vw=_t.memo(({flip:e=!1})=>R(H("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[b("path",{d:"M6,9.5H20"}),b("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),Iw=_t.memo(({flip:e=!1})=>R(b("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:b("path",{d:"M34,10 H6 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),Tw=_t.memo(({flip:e=!1})=>R(b("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:b("path",{d:"M34,10 H6 M15,10 L15,15 L15,5"})}),{width:40,height:20})),Cw=_t.memo(({flip:e=!1})=>R(b("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:b("path",{d:"M34,10 H6 M15,10 L15,16 L15,4 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),kw=R(H(We,{children:[b("g",{clipPath:"url(#a)",children:b("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"})}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),Sw=R(H(We,{children:[b("g",{clipPath:"url(#a)",children:b("path",{d:"M5 16.667V3.333L10 15l5-11.667v13.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),Mw=R(H(We,{children:[b("g",{clipPath:"url(#a)",children:b("path",{d:"M5.833 3.333v13.334h8.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),Pw=R(b(We,{children:b("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"})}),Ee),Va=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M3 7v-2h13v2"}),b("path",{d:"M10 5v14"}),b("path",{d:"M12 19h-4"}),b("path",{d:"M15 13v-1h6v1"}),b("path",{d:"M18 12v7"}),b("path",{d:"M17 19h2"})]}),K),Aw=R(b(We,{children:H("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M7 12h10"}),b("path",{d:"M7 5v14"}),b("path",{d:"M17 5v14"}),b("path",{d:"M15 19h4"}),b("path",{d:"M15 5h4"}),b("path",{d:"M5 19h4"}),b("path",{d:"M5 5h4"})]})}),K),ac=R(b(We,{children:b("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:b("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"})})}),Ee),Rh=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M7 8l-4 4l4 4"}),b("path",{d:"M17 8l4 4l-4 4"}),b("path",{d:"M14 4l-4 16"})]}),K),wm=Rh,Lw=R(H("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),b("line",{x1:"4",y1:"12",x2:"12",y2:"12"}),b("line",{x1:"4",y1:"16",x2:"16",y2:"16"})]}),K),_w=R(H("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),b("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),b("line",{x1:"6",y1:"16",x2:"18",y2:"16"})]}),K),Dw=R(H("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),b("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),b("line",{x1:"8",y1:"16",x2:"20",y2:"16"})]}),K),Rw=_t.memo(({theme:e})=>R(H("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"4",y1:"4",x2:"20",y2:"4"}),b("rect",{x:"9",y:"8",width:"6",height:"12",rx:"2"})]}),K)),Nw=_t.memo(({theme:e})=>R(H("g",{strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"4",y1:"20",x2:"20",y2:"20"}),b("rect",{x:"9",y:"4",width:"6",height:"12",rx:"2"})]}),K)),Bw=_t.memo(({theme:e})=>R(H("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"4",y1:"12",x2:"9",y2:"12"}),b("line",{x1:"15",y1:"12",x2:"20",y2:"12"}),b("rect",{x:"9",y:"6",width:"6",height:"12",rx:"2"})]}),K)),vm=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M21 19h-18l9 -15"}),b("path",{d:"M20.615 15.171h.015"}),b("path",{d:"M19.515 11.771h.015"}),b("path",{d:"M17.715 8.671h.015"}),b("path",{d:"M15.415 5.971h.015"})]}),K),Fw=R(b("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}),ete=R(b("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"})),as=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5"}),b("path",{d:"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5"}),b("path",{d:"M14 5.5a1.5 1.5 0 0 1 3 0v6.5"}),b("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"})]}),K),Nh=R(H(We,{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),b("path",{d:"M7 11l5 5l5 -5"}),b("path",{d:"M12 4l0 12"})]}),K),is=R(H(We,{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"})]}),K),Ow=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M7 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),b("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),b("path",{d:"M9.15 14.85l8.85 -10.85"}),b("path",{d:"M6 4l8.85 10.85"})]}),K),zw=R(H(We,{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),b("path",{d:"M12 17l0 .01"}),b("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),K),tte=R(H(We,{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M7 4v16l13 -8z"})]}),K),ote=R(H(We,{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"})]}),K),Hw=R(H(We,{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M5 12l5 5l10 -10"})]}),K),Im=R(H(We,{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M12 9v4"}),b("path",{d:"M12 17h.01"})]}),K),Gw=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M11 7l6 6"}),b("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"})]}),K),ic=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M12 3l-4 7h8z"}),b("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),b("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"})]}),K),On=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M4 7l16 0"}),b("path",{d:"M4 17l16 0"}),b("path",{d:"M7 4l0 16"}),b("path",{d:"M17 4l0 16"})]}),K),Uw=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),b("circle",{cx:"8.5",cy:"8.5",r:"1.5",fill:"currentColor",stroke:"none"}),b("path",{d:"M3 16l5-5c.928-.893 2.072-.893 3 0l5 5"}),b("path",{d:"M14 14l1-1c.928-.893 2.072-.893 3 0l3 3"}),b("path",{d:"M17.5 4.5l0 3m-1.5-1.5l3 0",strokeWidth:"1.5",strokeLinecap:"round"})]}),K),ss=R(b("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"})),Ww=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"}),b("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"})]}),K),Yw=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M6 10l-2 1l8 4l8 -4l-2 -1"}),b("path",{d:"M4 15l8 4l8 -4"}),b("path",{d:"M12 4v7"}),b("path",{d:"M15 8l-3 3l-3 -3"})]}),K),Gr=R(H("g",{strokeWidth:"1.25",children:[b("path",{d:"M4.16602 10H15.8327"}),b("path",{d:"M12.5 13.3333L15.8333 10"}),b("path",{d:"M12.5 6.66666L15.8333 9.99999"})]}),Ee),zn=R(H("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",transform:"rotate(90 10 10)",children:[b("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"}),b("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),Ka=R(H("g",{stroke:"currentColor",fill:"none",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z"}),b("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),b("path",{d:"M15 6l3 3"}),b("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"}),b("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"})]}),K),nte=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z"}),b("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),b("path",{d:"M15 6l3 3"}),b("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"}),b("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"})]}),K),rte=R(H("g",{stroke:"currentColor",fill:"none",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M11.217 19.384a3.501 3.501 0 0 0 6.783 -1.217v-5.167l-6 -3.35"}),b("path",{d:"M5.214 15.014a3.501 3.501 0 0 0 4.446 5.266l4.34 -2.534v-6.946"}),b("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"}),b("path",{d:"M12.783 4.616a3.501 3.501 0 0 0 -6.783 1.217v5.067l6 3.45"}),b("path",{d:"M18.786 8.986a3.501 3.501 0 0 0 -4.446 -5.266l-4.34 2.534v6.946"}),b("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"})]}),K),$w=R(H("g",{stroke:"currentColor",fill:"none",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2"}),b("path",{d:"M4 16v2a2 2 0 0 0 2 2h2"}),b("path",{d:"M16 4h2a2 2 0 0 1 2 2v2"}),b("path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2"})]}),K),ls=R(H("g",{stroke:"currentColor",fill:"none",strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"}),b("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"})]}),K),Vw=R(H("g",{stroke:"currentColor",fill:"none",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828"}),b("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"}),b("path",{d:"M3 3l18 18"})]}),K),Kw=R(H("g",{stroke:"currentColor",fill:"none",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("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"}),b("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),b("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),b("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),b("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),K),Xw=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("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"}),b("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),b("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),b("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),b("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),K),Mo=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),b("path",{d:"M21 21l-6 -6"})]}),K),Zw=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M20.984 12.53a9 9 0 1 0 -7.552 8.355"}),b("path",{d:"M12 7v5l3 3"}),b("path",{d:"M19 16l-2 3h4l-2 3"})]}),K),jw=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M12 8l0 4l2 2"}),b("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})]}),K),qw=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M5 10a7 7 0 0 0 14 0"}),b("path",{d:"M8 21l8 0"}),b("path",{d:"M12 17l0 4"})]}),K),Jw=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M3 3l18 18"}),b("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"}),b("path",{d:"M5 10a7 7 0 0 0 10.846 5.85m2 -2a6.967 6.967 0 0 0 1.152 -3.85"}),b("path",{d:"M8 21l8 0"}),b("path",{d:"M12 17l0 4"})]}),K),sc=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11"})]}),K),Qw=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M12 20v.01"}),b("path",{d:"M16 20v.01"}),b("path",{d:"M8 20v.01"}),b("path",{d:"M4 20v.01"}),b("path",{d:"M4 16v.01"}),b("path",{d:"M4 12v.01"}),b("path",{d:"M4 8v.01"}),b("path",{d:"M4 4v.01"}),b("path",{d:"M8 4v.01"}),b("path",{d:"M12 4v.01"}),b("path",{d:"M16 4v.01"}),b("path",{d:"M20 4v.01"}),b("path",{d:"M20 8v.01"}),b("path",{d:"M20 12v.01"}),b("path",{d:"M20 16v.01"}),b("path",{d:"M20 20v.01"})]}),K),ev=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M5 3v18"}),b("path",{d:"M19 21v-18"}),b("path",{d:"M5 7h14"}),b("path",{d:"M5 15h14"}),b("path",{d:"M8 13v4"}),b("path",{d:"M11 13v4"}),b("path",{d:"M16 13v4"}),b("path",{d:"M14 5v4"}),b("path",{d:"M11 5v4"}),b("path",{d:"M8 5v4"}),b("path",{d:"M3 21h18"})]}),K),tv=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M3 12l18 0"}),b("path",{d:"M7 16l10 0l-10 5l0 -5"}),b("path",{d:"M7 8l10 0l-10 -5l0 5"})]}),K),ov=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M12 3l0 18"}),b("path",{d:"M16 7l0 10l5 0l-5 -10"}),b("path",{d:"M8 7l0 10l-5 0l5 -10"})]}),K),Bh=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M19 6h1a2 2 0 0 1 2 2a5 5 0 0 1 -5 5l-5 0v2"}),b("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"})]}),K),cs=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0"}),b("path",{d:"M22 22l-3 -3"}),b("path",{d:"M6 18h-1a2 2 0 0 1 -2 -2v-1"}),b("path",{d:"M3 11v-1"}),b("path",{d:"M3 6v-1a2 2 0 0 1 2 -2h1"}),b("path",{d:"M10 3h1"}),b("path",{d:"M15 3h1a2 2 0 0 1 2 2v1"})]}),K),nv=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),b("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),b("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"}),b("path",{d:"M10 15l2 6l2 -6"}),b("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"})]}),K),rv=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),b("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),b("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"}),b("path",{d:"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"}),b("path",{d:"M11 21v-6l3 6v-6"})]}),K),av=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M4 8l5 0"}),b("path",{d:"M15 8l4 0"})]}),K),iv=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),b("path",{d:"M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),b("path",{d:"M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z"}),b("path",{d:"M16.746 16.726a3 3 0 1 0 .252 -5.555"})]}),K),sv=R(H("g",{stroke:"currentColor",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"})]}),{...K,strokeWidth:1.5}),ate=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M21 12h-13l3 -3"}),b("path",{d:"M11 15l-3 -3"})]}),K),lv=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M10 9l5 3l-5 3z"})]}),K),cv=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M3 6h18"}),b("path",{d:"M3 12h18"}),b("path",{d:"M3 18h18"}),b("path",{d:"M6 3v18"}),b("path",{d:"M12 3v18"}),b("path",{d:"M18 3v18"})]}),K),dv=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("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"}),b("path",{d:"M17 5c-6.627 0 -12 5.373 -12 12"})]}),K),ds=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M6 18l12 -12"}),b("path",{d:"M18 10v-4h-4"})]}),K),ms=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7"}),b("path",{d:"M18 4l3 3l-3 3"})]}),K),ps=R(H("g",{children:[b("path",{d:"M16,12L20,9L16,6"}),b("path",{d:"M6 20c0 -6.075 4.925 -11 11 -11h3"})]}),K),Tm=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M6 9l6 6l6 -6"})]}),K),mv=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M6 15l6 -6l6 6"})]}),K),pv=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M6 15l6 -6l6 6"})]}),K),Fh=R(H("g",{strokeWidth:"1.25",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M8 5v10a1 1 0 0 0 1 1h10"}),b("path",{d:"M5 8h10a1 1 0 0 1 1 1v10"})]}),K),Cm=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M5 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M19 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M5 7l0 10"}),b("path",{d:"M7 5l10 0"}),b("path",{d:"M7 19l10 0"}),b("path",{d:"M19 7l0 10"})]}),K),ite=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M4 12h7a1 1 0 0 1 1 1v7"})]}),K),uv=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M4 6l8 0"}),b("path",{d:"M16 6l4 0"}),b("path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M4 12l2 0"}),b("path",{d:"M10 12l10 0"}),b("path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M4 18l11 0"}),b("path",{d:"M19 18l1 0"})]}),K),gv=R(H("g",{strokeWidth:1,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M6 10l4 -4 L6 14l8 -8 L6 18l12 -12 L10 18l8 -8 L14 18l4 -4"})]}),K),hv=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"}),b("path",{d:"M13.5 6.5l4 4"})]}),K),ste=R(H("g",{strokeWidth:1,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M11 7l-5 5l5 5"}),b("path",{d:"M17 7l-5 5l5 5"})]}),K),fv=R(H("g",{strokeWidth:"1.75",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M15 4l0 16"})]}),K),lte=R(H("g",{strokeWidth:"1.25",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"})]}),K),cte=R(H("g",{strokeWidth:"1.25",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M3 4l18 0"}),b("path",{d:"M4 4v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-10"}),b("path",{d:"M12 16l0 4"}),b("path",{d:"M9 20l6 0"}),b("path",{d:"M8 12l3 -3l2 2l3 -3"})]}),K),bv=b("div",{style:{width:"1rem",height:"1rem"}}),xv=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("polyline",{points:"9 6 15 12 9 18"})]}),K),yv=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M4 6l8 0"}),b("path",{d:"M16 6l4 0"}),b("path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M4 12l2 0"}),b("path",{d:"M10 12l10 0"}),b("path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M4 18l11 0"}),b("path",{d:"M19 18l1 0"})]}),K);import Ev from"clsx";import zh,{useEffect as mL,useRef as wv,useState as pL}from"react";import{isPromiseLike as uL}from"@orangecatai/common";import cL from"react";import{jsx as Oh}from"react/jsx-runtime";var dL=({size:e="1em",circleWidth:t=8,synchronized:o=!1,className:n=""})=>{let a=-(cL.useRef(Date.now()).current%1600);return Oh("div",{className:`Spinner ${n}`,children:Oh("svg",{viewBox:"0 0 100 100",style:{width:e,height:e,"--spinner-delay":o?`${a}ms`:0},children:Oh("circle",{cx:"50",cy:"50",r:50-t/2,strokeWidth:t,fill:"none",strokeMiterlimit:"10"})})})},Wt=dL;import{jsx as lc,jsxs as cc}from"react/jsx-runtime";var ae=zh.forwardRef(({size:e="medium",visible:t=!0,className:o="",...n},r)=>{let{id:a}=Qe(),i=zh.useRef(null);zh.useImperativeHandle(r,()=>i.current);let s=`ToolIcon_size_${e}`,[l,c]=pL(!1),m=wv(!0),p=async u=>{let h="onClick"in n&&n.onClick?.(u);if(uL(h))try{c(!0),await h}catch(g){if(g instanceof Ui)console.warn(g);else throw g}finally{m.current&&c(!1)}};mL(()=>(m.current=!0,()=>{m.current=!1}),[]);let d=wv(null);if(n.type==="button"||n.type==="icon"||n.type==="submit"){let u=n.type==="icon"?"button":n.type;return cc("button",{className:Ev("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)&&cc("div",{className:"ToolIcon__icon","aria-hidden":"true","aria-disabled":!!n.disabled,children:[n.icon||n.label,n.keyBindingLabel&&lc("span",{className:"ToolIcon__keybinding",children:n.keyBindingLabel}),n.isLoading&&lc(Wt,{})]}),n.showAriaLabel&&cc("div",{className:"ToolIcon__label",children:[n["aria-label"]," ",l&&lc(Wt,{})]}),n.children]})}return cc("label",{className:Ev("ToolIcon",o),title:n.title,onPointerDown:u=>{d.current=u.pointerType||null,n.onPointerDown?.({pointerType:u.pointerType||null})},onPointerUp:()=>{requestAnimationFrame(()=>{d.current=null})},children:[lc("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}),cc("div",{className:"ToolIcon__icon",children:[n.icon,n.keyBindingLabel&&lc("span",{className:"ToolIcon__keybinding",children:n.keyBindingLabel})]})]})});ae.displayName="ToolButton";var km=[],W=e=>(km=km.concat(e),e);import{jsx as vL}from"react/jsx-runtime";var wL=(e,t,o)=>{let n=new Set(de(e.filter(m=>xL(m)),t).map(m=>m.id)),r={},a=o.scene.getNonDeletedElementsMap(),i=new Set;for(let m of n){let p=yL(e,m);for(let d of p)if(!i.has(d.id)){if(Sm(d)){let u=Iv(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=Sm(m)?Iv(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&&bL(u)&&o.scene.mutateElement(u,{startBinding:m.id===u.startBinding?.elementId?null:u.startBinding,endBinding:m.id===u.endBinding?.elementId?null:u.endBinding})}),Pm(m,{isDeleted:!0}))}return m.frameId&&n.has(m.frameId)?(s=!1,Sm(m)||(r[m.id]=!0),Pm(m,{frameId:null})):Sm(m)&&t.selectedElementIds[m.containerId]?Pm(m,{isDeleted:!0}):m}),c=t.editingGroupId;if(s&&t.editingGroupId){let m=Uh(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=Uh(l,u).filter(g=>!g.isDeleted);h.length>1&&(c=u,h.forEach(g=>{r[g.id]=!0}))}}}}return{elements:l,appState:{...t,...EL({selectedElementIds:r,editingGroupId:c},l,t,null)}}},Tv=(e,t)=>{if(e.editingGroupId){let o=Uh(Gh(t),e.editingGroupId);if(o.length)return{...e,selectedElementIds:{[o[0].id]:!0}}}return e},dc=W({name:"deleteSelectedElements",label:"labels.delete",icon:Ut,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=vv.getElement(i,l);if(!c||s==null)return!1;if(s.length>=c.points.length){let m=e.map(d=>d.id===c.id?Pm(d,{isDeleted:!0}):d),p=Tv(t,m);return{elements:m,appState:{...p,selectedLinearElement:null},captureUpdate:Mm.IMMEDIATELY}}return vv.deletePoints(c,n,s),{elements:e,appState:{...t,selectedLinearElement:{...t.selectedLinearElement,selectedPointsIndices:s?.[0]>0?[s[0]-1]:[0]}},captureUpdate:Mm.IMMEDIATELY}}let{elements:r,appState:a}=wL(e,t,n);return fL(r,r.filter(i=>i.isDeleted)),a=Tv(a,r),{elements:r,appState:{...a,activeTool:hL(t,{type:n.state.preferredSelectionTool.type}),multiElement:null,newElement:null,activeEmbeddable:null,selectedLinearElement:null},captureUpdate:Ge(Gh(e),t)?Mm.IMMEDIATELY:Mm.EVENTUALLY}},keyTest:(e,t,o)=>(e.key===Hh.BACKSPACE||e.key===Hh.DELETE)&&!e[Hh.CTRL_OR_CMD],PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=Dt()==="mobile";return vL(ae,{type:"button",icon:Ut,title:f("labels.delete"),"aria-label":f("labels.delete"),onClick:()=>o(null),disabled:!Ge(Gh(e),t),style:{...r&&t.openPopup!=="compactOtherProperties"?gL:{}}})}});import{KEYS as us,CODES as gs,isDarwin as Am}from"@orangecatai/common";import{moveOneLeft as IL,moveOneRight as TL,moveAllLeft as CL,moveAllRight as kL}from"@orangecatai/element";import{CaptureUpdateAction as Lm}from"@orangecatai/element";import{isDarwin as Cv}from"@orangecatai/common";var G=e=>e.replace(/\b(Opt(?:ion)?|Alt)\b/i,Cv?f("keys.option"):f("keys.alt")).replace(/\bShift\b/i,f("keys.shift")).replace(/\b(Enter|Return)\b/i,f("keys.enter")).replace(/\b(Ctrl|Cmd|Command|CtrlOrCmd)\b/gi,Cv?f("keys.cmd"):f("keys.ctrl")).replace(/\b(Esc(?:ape)?)\b/i,f("keys.escape")).replace(/\b(Space(?:bar)?)\b/i,f("keys.spacebar")).replace(/\b(Del(?:ete)?)\b/i,f("keys.delete"));import{jsx as _m}from"react/jsx-runtime";var Wh=W({name:"sendBackward",label:"labels.sendBackward",keywords:["move down","zindex","layer"],icon:vh,trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:IL(e,t,n.scene),appState:t,captureUpdate:Lm.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[us.CTRL_OR_CMD]&&!e.shiftKey&&e.code===gs.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>_m("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${f("labels.sendBackward")} \u2014 ${G("CtrlOrCmd+[")}`,children:vh})}),Yh=W({name:"bringForward",label:"labels.bringForward",keywords:["move up","zindex","layer"],icon:wh,trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:TL(e,t,n.scene),appState:t,captureUpdate:Lm.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[us.CTRL_OR_CMD]&&!e.shiftKey&&e.code===gs.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>_m("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${f("labels.bringForward")} \u2014 ${G("CtrlOrCmd+]")}`,children:wh})}),$h=W({name:"sendToBack",label:"labels.sendToBack",keywords:["move down","zindex","layer"],icon:Th,trackEvent:{category:"element"},perform:(e,t)=>({elements:CL(e,t),appState:t,captureUpdate:Lm.IMMEDIATELY}),keyTest:e=>Am?e[us.CTRL_OR_CMD]&&e.altKey&&e.code===gs.BRACKET_LEFT:e[us.CTRL_OR_CMD]&&e.shiftKey&&e.code===gs.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>_m("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${f("labels.sendToBack")} \u2014 ${Am?G("CtrlOrCmd+Alt+["):G("CtrlOrCmd+Shift+[")}`,children:Th})}),Vh=W({name:"bringToFront",label:"labels.bringToFront",keywords:["move up","zindex","layer"],icon:Ih,trackEvent:{category:"element"},perform:(e,t)=>({elements:kL(e,t),appState:t,captureUpdate:Lm.IMMEDIATELY}),keyTest:e=>Am?e[us.CTRL_OR_CMD]&&e.altKey&&e.code===gs.BRACKET_RIGHT:e[us.CTRL_OR_CMD]&&e.shiftKey&&e.code===gs.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>_m("button",{type:"button",className:"zIndexButton",onClick:o=>e(null),title:`${f("labels.bringToFront")} \u2014 ${Am?G("CtrlOrCmd+Alt+]"):G("CtrlOrCmd+Shift+]")}`,children:Ih})});import{getNonDeletedElements as SL}from"@orangecatai/element";import{LinearElementEditor as ML}from"@orangecatai/element";import{isLinearElement as PL,isTextElement as AL}from"@orangecatai/element";import{arrayToMap as LL,KEYS as kv}from"@orangecatai/common";import{selectGroupsForSelectedElements as _L}from"@orangecatai/element";import{CaptureUpdateAction as DL}from"@orangecatai/element";var Kh=W({name:"selectAll",label:"labels.selectAll",icon:Qw,trackEvent:{category:"canvas"},viewMode:!1,perform:(e,t,o,n)=>{if(t.selectedLinearElement?.isEditing)return!1;let r=e.filter(a=>!a.isDeleted&&!(AL(a)&&a.containerId)&&!a.locked).reduce((a,i)=>(a[i.id]=!0,a),{});return{appState:{...t,..._L({editingGroupId:null,selectedElementIds:r},SL(e),t,n),selectedLinearElement:Object.keys(r).length===1&&PL(e[0])?new ML(e[0],LL(e)):null},captureUpdate:DL.IMMEDIATELY}},keyTest:e=>e[kv.CTRL_OR_CMD]&&e.key===kv.A});import{DEFAULT_GRID_SIZE as Sv,KEYS as Mv,MOBILE_ACTION_BUTTON_BG as RL,arrayToMap as Pv}from"@orangecatai/common";import{getNonDeletedElements as Av}from"@orangecatai/element";import{LinearElementEditor as NL}from"@orangecatai/element";import{getSelectedElements as BL,getSelectionStateForElements as FL}from"@orangecatai/element";import{syncMovedIndices as OL}from"@orangecatai/element";import{duplicateElements as zL}from"@orangecatai/element";import{CaptureUpdateAction as Lv}from"@orangecatai/element";import{jsx as HL}from"react/jsx-runtime";var Xh=W({name:"duplicateSelection",label:"labels.duplicateSelection",icon:tc,trackEvent:{category:"element"},perform:(e,t,o,n)=>{if(t.selectedElementsAreBeingDragged)return!1;if(t.selectedLinearElement?.isEditing)try{let i=NL.duplicateSelectedPoints(t,n.scene);return{elements:e,appState:i,captureUpdate:Lv.IMMEDIATELY}}catch{return!1}let{duplicatedElements:r,elementsWithDuplicates:a}=zL({type:"in-place",elements:e,idsOfElementsToDuplicate:Pv(BL(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+Sv/2,y:i.y+Sv/2,frameId:l??i.frameId}}});if(n.props.onDuplicate&&a){let i=n.props.onDuplicate(a,e);i&&(a=i)}return{elements:OL(a,Pv(r)),appState:{...t,...FL(r,Av(a),t)},captureUpdate:Lv.IMMEDIATELY}},keyTest:e=>e[Mv.CTRL_OR_CMD]&&e.key===Mv.D,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=Dt()==="mobile";return HL(ae,{type:"button",icon:tc,title:`${f("labels.duplicateSelection")} \u2014 ${G("CtrlOrCmd+D")}`,"aria-label":f("labels.duplicateSelection"),onClick:()=>o(null),disabled:!Ge(Av(e),t),style:{...r&&t.openPopup!=="compactOtherProperties"?RL:{}}})}});import{pointFrom as GD}from"@orangecatai/math";import{useEffect as xf,useMemo as UD,useRef as yf,useState as WD}from"react";import{DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE as YD,DEFAULT_ELEMENT_BACKGROUND_PICKS as $D,DEFAULT_ELEMENT_STROKE_COLOR_PALETTE as VD,DEFAULT_ELEMENT_STROKE_PICKS as KD,ARROW_TYPE as Vo,DEFAULT_FONT_FAMILY as XD,DEFAULT_FONT_SIZE as ZD,FONT_FAMILY as jD,ROUNDNESS as Zm,STROKE_WIDTH as Ef,VERTICAL_ALIGN as Km,KEYS as vs,randomInteger as qD,arrayToMap as vf,getFontFamilyString as JD,getLineHeight as QD,isTransparent as e8,reduceToCommonValue as t8,invariant as If,FONT_SIZES as Xm}from"@orangecatai/common";import{canBecomePolygon as o8,getNonDeletedElements as w2}from"@orangecatai/element";import{bindBindingElement as b2,calculateFixedPointForElbowArrowBinding as x2,updateBoundElements as n8}from"@orangecatai/element";import{LinearElementEditor as ja}from"@orangecatai/element";import{newElementWith as kt}from"@orangecatai/element";import{getBoundTextElement as qr,redrawTextBoundingBox as vc}from"@orangecatai/element";import{isArrowElement as jm,isBoundToContainer as r8,isElbowArrow as v2,isLinearElement as wf,isLineElement as y2,isTextElement as fo,isUsingAdaptiveRadius as a8}from"@orangecatai/element";import{hasStrokeColor as i8}from"@orangecatai/element";import{updateElbowArrowPoints as s8,CaptureUpdateAction as St,toggleLinePolygonState as l8}from"@orangecatai/element";import{deriveStylesPanelMode as c8}from"@orangecatai/common";import{isDevEnv as GL}from"@orangecatai/common";var UL=new Set(["command_palette","export"]),be=(e,t,o,n)=>{try{if(typeof window>"u"||T.VITE_WORKER_ID||T.VITE_APP_ENABLE_TRACKING!=="true"||!UL.has(e)||GL())return;T.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 VL from"clsx";import WL from"clsx";import{forwardRef as YL}from"react";import{jsx as $L}from"react/jsx-runtime";var hs=YL((e,t)=>{let{title:o,className:n,testId:r,active:a,standalone:i,icon:s,onClick:l}=e;return $L("button",{type:"button",ref:t,title:o,"data-testid":r,className:WL(n,{standalone:i,active:a}),onClick:l,style:e.style,children:s},o)});import{Fragment as XL,jsx as Zh,jsxs as KL}from"react/jsx-runtime";var Uo=e=>Zh(XL,{children:e.options.map(t=>e.type==="button"?Zh(hs,{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):KL("label",{className:VL({active:e.value===t.value}),title:t.text,children:[Zh("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 qv}from"radix-ui";import Jv from"clsx";import{useRef as Qv,useEffect as j_}from"react";import{COLOR_OUTLINE_CONTRAST_THRESHOLD as Zv,COLOR_PALETTE as e2,isColorDark as jv,isWritableElement as q_}from"@orangecatai/common";import{jsx as ZL}from"react/jsx-runtime";var Dm=()=>ZL("div",{style:{width:1,height:"1rem",backgroundColor:"var(--default-border-color)",margin:"0 auto"}});import{useEffect as e_,useRef as t_}from"react";import{createPortal as o_}from"react-dom";import{EVENT as Wr,KEYS as n_,rgbToHex as r_}from"@orangecatai/common";import _v from"react";var jh=_v.createContext(null),Ie=()=>_v.useContext(jh);import{useState as jL,useLayoutEffect as Dv}from"react";import{THEME as qL}from"@orangecatai/common";var Rm=e=>{let[t,o]=jL(null),n=Te(),{theme:r}=Ie(),{container:a}=Qe();return Dv(()=>{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===qL.DARK))},[t,r,n.formFactor,e?.className]),Dv(()=>{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 JL}from"react";import{EVENT as Nm}from"@orangecatai/common";function fs(e,t,o){JL(()=>{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(Nm.POINTER_DOWN,n),document.addEventListener(Nm.TOUCH_START,n),()=>{document.removeEventListener(Nm.POINTER_DOWN,n),document.removeEventListener(Nm.TOUCH_START,n)}},[e,t,o])}import{useRef as QL}from"react";var Ur=e=>{let t=QL(e);return Object.assign(t.current,e),t.current};import{jsx as a_}from"react/jsx-runtime";var Yr=Pe(null),Rv=({onCancel:e,onChange:t,onSelect:o,colorPickerType:n})=>{let r=Rm({className:"excalidraw-eye-dropper-backdrop",parentSelector:".excalidraw-eye-dropper-container"}),a=Ie(),i=$r(),s=tt(),l=de(i,a),c=Ur({app:s,onCancel:e,onChange:t,onSelect:o,selectedElements:l}),{container:m}=Qe();e_(()=>{let d=p.current;if(!d||!s.canvas||!r)return;let u=!1,h=s.canvas.getContext("2d"),g=({clientX:C,clientY:P})=>{let S=h.getImageData((C-a.offsetLeft)*window.devicePixelRatio,(P-a.offsetTop)*window.devicePixelRatio,1,1).data;return r_(S[0],S[1],S[2])},x=({clientX:C,clientY:P,altKey:S})=>{d.style.top=`${P+20}px`,d.style.left=`${C+20}px`;let D=g({clientX:C,clientY:P});u&&c.onChange(n,D,c.selectedElements,{altKey:S}),d.style.background=D},E=()=>{c.onCancel()},y=(C,P)=>{c.onSelect(C,P)},w=C=>{u=!0,C.stopImmediatePropagation()},v=C=>{u=!1,m?.focus(),C.stopImmediatePropagation(),C.preventDefault(),y(g(C),C)},I=C=>{C.key===n_.ESCAPE&&(C.preventDefault(),C.stopImmediatePropagation(),E())};return r.tabIndex=-1,r.focus(),x({clientX:c.app.lastViewportPosition.x,clientY:c.app.lastViewportPosition.y,altKey:!1}),r.addEventListener(Wr.KEYDOWN,I),r.addEventListener(Wr.POINTER_DOWN,w),r.addEventListener(Wr.POINTER_UP,v),window.addEventListener("pointermove",x,{passive:!0}),window.addEventListener(Wr.BLUR,E),()=>{u=!1,r.removeEventListener(Wr.KEYDOWN,I),r.removeEventListener(Wr.POINTER_DOWN,w),r.removeEventListener(Wr.POINTER_UP,v),window.removeEventListener("pointermove",x),window.removeEventListener(Wr.BLUR,E)}},[c,s.canvas,r,n,m,a.offsetLeft,a.offsetTop]);let p=t_(null);return fs(p,()=>{e()},d=>!!d.target.closest(".excalidraw-eye-dropper-trigger, .excalidraw-eye-dropper-backdrop")),r?o_(a_("div",{ref:p,className:"excalidraw-eye-dropper-preview"}),r):null};import{Popover as qh}from"radix-ui";import c_ from"clsx";import d_ from"react";import{isInteractive as m_}from"@orangecatai/common";import i_ from"react";import s_ from"clsx";import{jsx as l_}from"react/jsx-runtime";var gt=i_.forwardRef(({children:e,padding:t,className:o,style:n},r)=>l_("div",{className:s_("Island",o),style:{"--padding":t,...n},ref:r,children:e}));import{jsx as Jh,jsxs as p_}from"react/jsx-runtime";var gr=d_.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=Te(),d=p.formFactor==="phone"&&!p.isLandscape;return Jh(qh.Portal,{container:t,children:p_(qh.Content,{ref:m,className:c_("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&&!m_(document.activeElement)&&t.focus(),r()},children:[Jh(gt,{padding:3,style:n,children:o}),Jh(qh.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 u_,useCallback as Qh}from"react";var Bm=()=>document.querySelector(".excalidraw-wysiwyg"),Fm=()=>{let e=Bm();return e?{start:e.selectionStart,end:e.selectionEnd}:null},mc=e=>{setTimeout(()=>{let t=Bm();t&&(t.focus(),e&&(t.selectionStart=e.start,t.selectionEnd=e.end))},0)},pc=(e,t,o,n)=>{t&&n&&n();let r=t&&o?Fm():null;e(),t&&o&&mc(r)},Nv=()=>{let[e,t]=u_(null),o=Qh(()=>{let a=Fm();t(a)},[]),n=Qh(()=>{setTimeout(()=>{let a=Bm();a&&(a.focus(),e&&(a.selectionStart=e.start,a.selectionEnd=e.end,t(null)))},0)},[e]),r=Qh(()=>{t(null)},[]);return{saveCaretPosition:o,restoreCaretPosition:n,clearSavedPosition:r,hasSavedPosition:!!e}},Bv=(e=100)=>{let t=Bm();if(t){let o=t.onblur;t.onblur=null,setTimeout(()=>{t.onblur=o},e)}};import h_ from"clsx";import{useCallback as f_,useEffect as tf,useRef as Ov,useState as b_}from"react";import{KEYS as of,normalizeInputColor as x_}from"@orangecatai/common";import{MAX_CUSTOM_COLORS_USED_IN_CANVAS as g_}from"@orangecatai/common";var Vr=({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},uc=[["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),ef=({color:e,palette:t})=>!Object.values(t).flat().includes(e),Fv=(e,t,o)=>{let n={elementBackground:"backgroundColor",elementStroke:"strokeColor"},r=e.filter(i=>{if(i.isDeleted)return!1;let s=i[n[t]];return ef({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,g_)},Wo=Pe(null);import{Fragment as y_,jsx as Om,jsxs as zv}from"react/jsx-runtime";var Hv=({color:e,onChange:t,label:o,colorPickerType:n,placeholder:r})=>{let a=Te(),[i,s]=b_(e),[l,c]=le(Wo);tf(()=>{s(e)},[e]);let m=f_(g=>{let x=g.toLowerCase(),E=x_(x);E&&t(E),s(x)},[t]),p=Ov(null),d=Ov(null);tf(()=>{p.current&&p.current.focus()},[l]);let[u,h]=le(Yr);return tf(()=>()=>{h(null)},[h]),zv("div",{className:"color-picker__input-label",children:[Om("div",{className:"color-picker__input-hash",children:"#"}),Om("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!==of.TAB&&(g.key===of.ESCAPE&&d.current?.focus(),g.stopPropagation())},placeholder:r}),a.formFactor!=="phone"&&zv(y_,{children:[Om("div",{style:{width:"1px",height:"1.25rem",backgroundColor:"var(--default-border-color)"}}),Om("div",{ref:d,className:h_("excalidraw-eye-dropper-trigger",{selected:u}),onClick:()=>h(g=>g?null:{keepOpenOnAlt:!1,onSelect:x=>t(x),colorPickerType:n}),title:`${f("labels.eyeDropper")} \u2014 ${of.I.toLocaleUpperCase()} or ${G("Alt")} `,children:Gw})]})]})};import sf,{useEffect as lf,useImperativeHandle as z_,useState as H_}from"react";import{EVENT as Vv}from"@orangecatai/common";import{DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX as G_,DEFAULT_ELEMENT_STROKE_COLOR_INDEX as U_,KEYS as W_}from"@orangecatai/common";import I_ from"clsx";import{useEffect as T_,useRef as C_}from"react";import{isColorDark as E_}from"@orangecatai/common";import{jsxs as v_}from"react/jsx-runtime";var w_=({color:e,keyLabel:t,isShade:o=!1})=>v_("div",{className:"color-picker__button__hotkey-label",style:{color:E_(e)?"#fff":"#000"},children:[o&&"\u21E7",t]}),bs=w_;import{jsx as nf,jsxs as k_}from"react/jsx-runtime";var Gv=({colors:e,color:t,onChange:o,label:n})=>{let[r,a]=le(Wo),i=C_(null);return T_(()=>{i.current&&i.current.focus()},[t,r]),nf("div",{className:"color-picker-content--default",children:e.map((s,l)=>k_("button",{ref:t===s?i:void 0,tabIndex:-1,type:"button",className:I_("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:[nf("div",{className:"color-picker__button-outline"}),nf(bs,{color:s,keyLabel:l+1})]},l))})};import S_ from"clsx";import{useEffect as M_,useRef as P_}from"react";import{jsx as rf,jsxs as L_}from"react/jsx-runtime";var A_=({palette:e,color:t,onChange:o,activeShade:n,showHotKey:r=!0})=>{let a=Vr({color:t,palette:e}),[i,s]=le(Wo),l=P_(null);return M_(()=>{l.current&&i==="baseColors"&&l.current.focus()},[a?.colorName,i]),rf("div",{className:"color-picker-content--default",children:Object.entries(e).map(([c,m],p)=>{let d=(Array.isArray(m)?m[n]:m)||"transparent",u=uc[p],h=f(`colors.${c.replace(/\d+/,"")}`,null,"");return L_("button",{ref:a?.colorName===c?l:void 0,tabIndex:-1,type:"button",className:S_("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:[rf("div",{className:"color-picker__button-outline"}),r&&rf(bs,{color:d,keyLabel:u})]},c)})})},Uv=A_;import{jsx as D_}from"react/jsx-runtime";var __=({children:e})=>D_("div",{className:"color-picker__heading",children:e}),xs=__;import R_ from"clsx";import{useEffect as N_,useRef as B_}from"react";import{jsx as gc,jsxs as Wv}from"react/jsx-runtime";var Yv=({color:e,onChange:t,palette:o,showHotKey:n})=>{let r=Vr({color:e||"transparent",palette:o}),[a,i]=le(Wo),s=B_(null);if(N_(()=>{s.current&&a==="shades"&&s.current.focus()},[r,a]),r){let{colorName:l,shade:c}=r,m=o[l];if(Array.isArray(m))return gc("div",{className:"color-picker-content--default shades",children:m.map((p,d)=>Wv("button",{ref:d===c&&a==="shades"?s:void 0,tabIndex:-1,type:"button",className:R_("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:[gc("div",{className:"color-picker__button-outline"}),n&&gc(bs,{color:p,keyLabel:d+1,isShade:!0})]},d))})}return Wv("div",{className:"color-picker-content--default",style:{position:"relative"},tabIndex:-1,children:[gc("button",{type:"button",tabIndex:-1,className:"color-picker__button color-picker__button--large color-picker__button--no-focus-visible"}),gc("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:f("colorPicker.noShades")})]})};import{COLORS_PER_ROW as ys,COLOR_PALETTE as F_,KEYS as hc}from"@orangecatai/common";var af=(e,t,o)=>{let n=Math.ceil(o/ys);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+ys;return r>=o?t%ys:r}case"ArrowUp":{let r=t-ys,a=r<0?ys*n+r:r;return a>=o?void 0:a}}},O_=({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(uc.includes(e.key)){let s=uc.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},$v=({event:e,activeColorPickerSection:t,palette:o,color:n,onChange:r,customColors:a,setActiveColorPickerSection:i,updateData:s,activeShade:l,onEyeDropperToggle:c,onEscape:m})=>{if(e[hc.CTRL_OR_CMD])return!1;if(e.key===hc.ESCAPE)return m(e),!0;if(e.key===hc.ALT)return c(!0),!0;if(e.key===hc.I)return c(),!0;let p=Vr({color:n,palette:o});if(e.key===hc.TAB){let d={custom:!!a.length,baseColors:!0,shades:p?.shade!=null,hex:!0},u=Object.entries(d).reduce((y,[w,v])=>(v&&y.push(w),y),[]),h=u.indexOf(t),g=e.shiftKey?-1:1,x=h+g>u.length-1?0:h+g<0?u.length-1:h+g,E=u[x];return E&&i(E),E==="custom"?r(a[0]):E==="baseColors"&&(Object.entries(o).find(([w,v])=>Array.isArray(v)?v.includes(n):v===n?w:null)||r(F_.black)),e.preventDefault(),e.stopPropagation(),!0}if(O_({e,colorObj:p,onChange:r,palette:o,customColors:a,setActiveColorPickerSection:i,activeShade:l}))return!0;if(t==="shades"&&p){let{shade:d}=p,u=af(e.key,d,ys);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=af(e.key,h,u.length);if(g!==void 0){let x=u[g],E=o[x];return r(Array.isArray(E)?E[l]:E),!0}}if(t==="custom"){let d=n!=null?a.indexOf(n):0,u=af(e.key,d,a.length);if(u!==void 0){let h=a[u];return r(h),!0}}return!1};import{jsx as Kr,jsxs as zm}from"react/jsx-runtime";var Kv=sf.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"?f("labels.stroke"):o==="elementBackground"?f("labels.background"):null:null,[u]=sf.useState(()=>o==="canvasBackground"?[]:Fv(n,o,r)),[h,g]=le(Wo),x=Vr({color:e,palette:r});lf(()=>{if(!h){let v=!!e&&ef({color:e,palette:r}),I=v&&!u.includes(e);g(I?null:v?"custom":x?.shade!=null?"shades":"baseColors")}},[h,e,r,g,x,u]);let[E,y]=H_(x?.shade??(o==="elementBackground"?G_:U_));lf(()=>{x?.shade!=null&&y(x.shade);let v=I=>{I.key===W_.ALT&&l(!1)};return document.addEventListener(Vv.KEYUP,v,{capture:!0}),()=>{document.removeEventListener(Vv.KEYUP,v,{capture:!0})}},[x,l]);let w=sf.useRef(null);return z_(p,()=>w.current),lf(()=>{w?.current?.focus()},[]),Kr("div",{role:"dialog","aria-modal":"true","aria-label":f("labels.colorPicker"),children:zm("div",{ref:w,onKeyDown:v=>{$v({event:v,activeColorPickerSection:h,palette:r,color:e,onChange:t,onEyeDropperToggle:l,customColors:u,setActiveColorPickerSection:g,updateData:a,activeShade:E,onEscape:c})&&(v.preventDefault(),v.stopPropagation())},className:"color-picker-content properties-content",tabIndex:-1,children:[d&&Kr("div",{className:"color-picker__title",children:d}),!!u.length&&zm("div",{children:[Kr(xs,{children:f("colorPicker.mostUsedCustomColors")}),Kr(Gv,{colors:u,color:e,label:f("colorPicker.mostUsedCustomColors"),onChange:t})]}),zm("div",{children:[Kr(xs,{children:f("colorPicker.colors")}),Kr(Uv,{color:e,palette:r,onChange:t,activeShade:E,showHotKey:m})]}),zm("div",{children:[Kr(xs,{children:f("colorPicker.shades")}),Kr(Yv,{color:e,onChange:t,palette:r,showHotKey:m})]}),i]})})});import Y_ from"clsx";import{COLOR_OUTLINE_CONTRAST_THRESHOLD as $_,DEFAULT_CANVAS_BACKGROUND_PICKS as V_,DEFAULT_ELEMENT_BACKGROUND_PICKS as K_,DEFAULT_ELEMENT_STROKE_PICKS as X_,isColorDark as Z_}from"@orangecatai/common";import{jsx as cf}from"react/jsx-runtime";var Xv=({onChange:e,type:t,activeColor:o,topPicks:n})=>{let r;return t==="elementStroke"&&(r=X_),t==="elementBackground"&&(r=K_),t==="canvasBackground"&&(r=V_),n&&(r=n),r?cf("div",{className:"color-picker__top-picks",children:r.map(a=>cf("button",{className:Y_("color-picker__button",{active:a===o,"is-transparent":a==="transparent"||!a,"has-outline":!Z_(a,$_)}),style:{"--swatch-color":a},type:"button",title:a,onClick:()=>e(a),"data-testid":`color-top-pick-${a}`,children:cf("div",{className:"color-picker__button-outline"})},a))}):(console.error("Invalid type for TopPicks"),null)};import{jsx as Yo,jsxs as Hm}from"react/jsx-runtime";var J_=({type:e,color:t,onChange:o,label:n,elements:r,palette:a=e2,updateData:i,getOpenPopup:s,appState:l})=>{let{container:c}=Qe(),m=Dt(),p=m!=="full",d=m==="mobile",[,u]=le(Wo),[h,g]=le(Yr),x=Hm("div",{children:[Yo(xs,{children:f("colorPicker.hexCode")}),Yo(Hv,{color:t||"",label:n,onChange:w=>{o(w)},colorPickerType:e,placeholder:f("colorPicker.color")})]}),E=Qv(null),y=()=>{E.current?.focus()};return Yo(gr,{container:c,style:{maxWidth:"13rem"},preventAutoFocusOnTouch:!!l.editingTextElement,onFocusOutside:w=>{q_(w.target)||y(),w.preventDefault()},onPointerDownOutside:w=>{h&&w.preventDefault()},onClose:()=>{s()===e&&i({openPopup:null}),u(null),l.editingTextElement&&setTimeout(()=>{let w=document.querySelector(".excalidraw-wysiwyg");w&&w.focus()},0)},children:a?Yo(Kv,{ref:E,palette:a,color:t,onChange:w=>{let v=l.editingTextElement?Fm():null;o(w),l.editingTextElement&&v&&mc(v)},onEyeDropperToggle:w=>{g(v=>w?(v=v||{keepOpenOnAlt:!0,onSelect:o,colorPickerType:e},v.keepOpenOnAlt=!0,v):w===!1||v?null:{keepOpenOnAlt:!1,onSelect:o,colorPickerType:e})},onEscape:w=>{h?g(null):i({openPopup:null})},type:e,elements:r,updateData:i,showTitle:p,showHotKey:!d,children:x}):x})},Q_=({label:e,color:t,type:o,mode:n="background",onToggle:r,editingTextElement:a})=>{let i=Dt(),s=i!=="full",l=i==="mobile",c=m=>{m.preventDefault(),m.stopPropagation(),a&&Bv(),r()};return Hm(qv.Trigger,{type:"button",className:Jv("color-picker__button active-color properties-trigger",{"is-transparent":!t||t==="transparent","has-outline":!t||!jv(t,Zv),"compact-sizing":s,"mobile-border":l}),"aria-label":e,style:t?{"--swatch-color":t}:void 0,title:o==="elementStroke"?f("labels.showStroke"):f("labels.showBackground"),"data-openpopup":o,onClick:c,children:[Yo("div",{className:"color-picker__button-outline",children:!t&&$E}),s&&t&&n==="stroke"&&Yo("div",{className:"color-picker__button-background",children:Yo("span",{style:{color:t&&jv(t,Zv)?"#fff":"#111"},children:gv})})]})},fc=({type:e,color:t,onChange:o,label:n,elements:r,palette:a=e2,topPicks:i,updateData:s,appState:l})=>{let c=Qv(l.openPopup);j_(()=>{c.current=l.openPopup},[l.openPopup]);let p=Dt()!=="full";return Yo("div",{children:Hm("div",{role:"dialog","aria-modal":"true",className:Jv("color-picker-container",{"color-picker-container--no-top-picks":p}),children:[!p&&Yo(Xv,{activeColor:t,onChange:o,type:e,topPicks:i}),!p&&Yo(Dm,{}),Hm(qv.Root,{open:l.openPopup===e,onOpenChange:d=>{d&&s({openPopup:e})},children:[Yo(Q_,{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&&Yo(J_,{type:e,color:t,onChange:o,label:n,elements:r,palette:a,updateData:s,getOpenPopup:()=>c.current,appState:l})]})]})})};import{Popover as SD}from"radix-ui";import MD from"clsx";import PD,{useCallback as AD,useMemo as LD}from"react";import{FONT_FAMILY as uf}from"@orangecatai/common";import bD,{useMemo as jr,useState as xD,useRef as r2,useEffect as a2,useCallback as i2,useSyncExternalStore as yD}from"react";import{arrayToList as ED,debounce as wD,FONT_FAMILY as Xa,getFontFamilyString as vD}from"@orangecatai/common";import eD from"clsx";import tD from"react";import{jsx as oD,jsxs as nD}from"react/jsx-runtime";var Gm=tD.forwardRef(({className:e,placeholder:t,onChange:o},n)=>nD("div",{className:eD("QuickSearch__wrapper",e),children:[Mo,oD("input",{ref:n,className:"QuickSearch__input",type:"text",placeholder:t,onChange:r=>o(r.target.value.trim().toLowerCase())})]}));import rD from"clsx";import{Children as aD}from"react";import{jsx as t2}from"react/jsx-runtime";var Um=({className:e,placeholder:t,children:o})=>{let n=!aD.count(o);return t2("div",{className:rD("ScrollableList__wrapper",e),role:"menu",children:n?t2("div",{className:"empty",children:t}):o})};import{jsx as iD,jsxs as sD}from"react/jsx-runtime";var o2=({children:e,className:t="",style:o,title:n})=>sD("div",{className:`dropdown-menu-group ${t}`,style:o,children:[n&&iD("p",{className:"dropdown-menu-group-title",children:n}),e]}),bc=o2;o2.displayName="DropdownMenuGroup";import{THEME as hD}from"@orangecatai/common";import{DropdownMenu as fD}from"radix-ui";import lD,{useContext as cD}from"react";import{composeEventHandlers as dD}from"@orangecatai/common";var df=lD.createContext({}),Xr=(e="",t=!1,o=!1)=>`dropdown-menu-item dropdown-menu-item-base ${e} ${t?"dropdown-menu-item--selected":""} ${o?"dropdown-menu-item--hovered":""}`.trim(),Wm=e=>{let t=cD(df);return dD(e,o=>{t.onSelect?.(o)})};import{jsx as mD}from"react/jsx-runtime";var xc=({children:e,...t})=>mD("span",{...t,style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",...t.style},children:e});import{Fragment as uD,jsx as yc,jsxs as gD}from"react/jsx-runtime";var pD=({textStyle:e,icon:t,shortcut:o,children:n,badge:r})=>{let a=Te();return gD(uD,{children:[t&&yc("div",{className:"dropdown-menu-item__icon",children:t}),yc("div",{style:e,className:"dropdown-menu-item__text",children:yc(xc,{children:n})}),r&&yc("div",{className:"dropdown-menu-item__badge",children:r}),o&&a.formFactor!=="phone"&&yc("div",{className:"dropdown-menu-item__shortcut",children:o})]})},Zr=pD;import{jsx as Ym}from"react/jsx-runtime";var mf=({icon:e,badge:t,value:o,children:n,shortcut:r,className:a,selected:i,onSelect:s,...l})=>{let c=Wm(s);return Ym(fD.Item,{className:"radix-menu-item",onSelect:c,asChild:!0,children:Ym("button",{...l,value:o,className:Xr(a,i),title:l.title??l["aria-label"],children:Ym(Zr,{icon:e,shortcut:r,badge:t,children:n})})})};mf.displayName="DropdownMenuItem";var Es={GREEN:"green",RED:"red",BLUE:"blue"},$m=({type:e=Es.BLUE,children:t})=>{let{theme:o}=$o(),n={display:"inline-flex",marginLeft:"auto",padding:"2px 4px",borderRadius:6,fontSize:9,fontFamily:"Cascadia, monospace",border:o===hD.LIGHT?"1.5px solid white":"none"};switch(e){case Es.GREEN:Object.assign(n,{backgroundColor:"var(--background-color-badge)",color:"var(--color-badge)"});break;case Es.RED:Object.assign(n,{backgroundColor:"pink",color:"darkred"});break;case Es.BLUE:default:Object.assign(n,{background:"var(--color-promo)",color:"var(--color-surface-lowest)"})}return Ym("div",{className:"DropDownMenuItemBadge",style:n,children:t})};$m.displayName="DropdownMenuItemBadge";mf.Badge=$m;var to=mf;import{KEYS as ws}from"@orangecatai/common";var n2=({event:e,inputRef:t,hoveredFont:o,filteredFonts:n,onClose:r,onSelect:a,onHover:i})=>{if(!e[ws.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===ws.F)return t.current?.focus(),!0;if(e.key===ws.ESCAPE)return r(),!0;if(e.key===ws.ENTER)return o?.value&&a(o.value),!0;if(e.key===ws.ARROW_DOWN)return o?.next?i(o.next.value):n[0]?.value&&i(n[0].value),!0;if(e.key===ws.ARROW_UP)return o?.prev?i(o.prev.value):n[n.length-1]?.value&&i(n[n.length-1].value),!0};import{jsx as hr,jsxs as TD}from"react/jsx-runtime";var ID=e=>{switch(e){case Xa.Excalifont:case Xa.Virgil:return Bn;case Xa.Nunito:case Xa.Helvetica:return ac;case Xa["Lilita One"]:return Aw;case Xa["Comic Shanns"]:case Xa.Cascadia:return wm;default:return ac}},s2=bD.memo(({selectedFontFamily:e,hoveredFontFamily:t,onSelect:o,onHover:n,onLeave:r,onOpen:a,onClose:i})=>{let{container:s}=Qe(),l=tt(),{fonts:c}=l,{showDeprecatedFonts:m}=Hn(),p=Dt(),[d,u]=xD(""),h=r2(null),g=yD(Ho.subscribeToCustomFonts,Ho.getCustomFontVersion),x=jr(()=>Array.from(Ho.registered.entries()).filter(([M,{metadata:B}])=>!B.private&&!B.fallback).map(([M,{metadata:B,fontFaces:O}])=>{let N={value:M,icon:ID(M),text:O[0]?.fontFace?.family??"Unknown"};return B.deprecated&&Object.assign(N,{deprecated:B.deprecated,badge:{type:Es.RED,placeholder:f("fontList.badge.old")}}),N}).sort((M,B)=>M.text.toLowerCase()>B.text.toLowerCase()?1:-1),[g]),E=jr(()=>new Set(c.getSceneFamilies()),[e]),y=jr(()=>x.filter(M=>E.has(M.value)),[x,E]),w=jr(()=>x.filter(M=>!E.has(M.value)&&(m||!M.deprecated)),[x,E,m]),v=jr(()=>ED([...y,...w].filter(M=>M.text?.toLowerCase().includes(d))),[y,w,d]),I=jr(()=>{let M;return t?M=v.find(B=>B.value===t):e&&(M=v.find(B=>B.value===e)),!M&&d&&(v[0]?.value?n(v[0].value):r()),M},[t,e,d,v,n,r]),C=i2(M=>{let B=null;if(l.state.editingTextElement){let O=document.querySelector(".excalidraw-wysiwyg");O&&(B={start:O.selectionStart,end:O.selectionEnd})}o(M),l.state.editingTextElement&&B&&setTimeout(()=>{let O=document.querySelector(".excalidraw-wysiwyg");O&&B&&(O.focus(),O.selectionStart=B.start,O.selectionEnd=B.end)},0)},[o,l.state.editingTextElement]),P=i2(M=>{n2({event:M,inputRef:h,hoveredFont:I,filteredFonts:v,onSelect:C,onHover:n,onClose:i})&&(M.preventDefault(),M.stopPropagation())},[I,v,C,n,i]);a2(()=>(a(),()=>{i()}),[]);let S=jr(()=>v.filter(M=>E.has(M.value)),[v,E]),D=jr(()=>v.filter(M=>!E.has(M.value)),[v,E]),_=({font:M,order:B})=>{let O=r2(null),N=M.value===I?.value,z=M.value===e;return a2(()=>{N&&(B===0?O.current?.scrollIntoView?.({block:"end"}):O.current?.scrollIntoView?.({block:"nearest"}))},[N,B]),hr("button",{ref:O,type:"button",value:M.value,className:Xr("",z,N),title:M.text,tabIndex:z?0:-1,onClick:L=>{C(Number(L.currentTarget.value))},onMouseMove:()=>{I?.value!==M.value&&n(M.value)},children:hr(Zr,{icon:M.icon,badge:M.badge&&hr($m,{type:M.badge.type,children:M.badge.placeholder}),textStyle:{fontFamily:vD({fontFamily:M.value})},children:M.text})})},k=[];return S.length&&k.push(hr(bc,{title:f("fontList.sceneFonts"),children:S.map((M,B)=>hr(_,{font:M,order:B},M.value))},"group_1")),D.length&&k.push(hr(bc,{title:f("fontList.availableFonts"),children:D.map((M,B)=>hr(_,{font:M,order:B+S.length},M.value))},"group_2")),TD(gr,{className:"properties-content",container:s,style:{width:"15rem"},onClose:()=>{i(),l.state.editingTextElement&&setTimeout(()=>{let M=document.querySelector(".excalidraw-wysiwyg");M&&M.focus()},0)},onPointerLeave:r,onKeyDown:P,preventAutoFocusOnTouch:!!l.state.editingTextElement,children:[p==="full"&&hr(Gm,{ref:h,placeholder:f("quickSearch.placeholder"),onChange:wD(u,20)}),hr(Um,{className:"dropdown-menu fonts manual-hover",placeholder:f("fontList.empty"),children:k.length?k:null})]})},(e,t)=>e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily);import{Popover as CD}from"radix-ui";import{MOBILE_ACTION_BUTTON_BG as kD}from"@orangecatai/common";import{jsx as pf}from"react/jsx-runtime";var l2=({selectedFontFamily:e,isOpened:t=!1,compactMode:o=!1})=>{let n=Ce(),r=o?{...kD,width:"2rem",height:"2rem"}:{};return pf(CD.Trigger,{asChild:!0,children:pf("div",{"data-openpopup":"fontFamily",className:"properties-trigger",children:pf(hs,{standalone:!0,icon:Fn,title:f("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 Ec,jsxs as c2}from"react/jsx-runtime";var d2=[{value:uf.Excalifont,icon:Bn,text:f("labels.handDrawn"),testId:"font-family-hand-drawn"},{value:uf.Nunito,icon:ac,text:f("labels.normal"),testId:"font-family-normal"},{value:uf["Comic Shanns"],icon:wm,text:f("labels.code"),testId:"font-family-code"}],yse=new Set(d2.map(e=>e.value));var m2=PD.memo(({isOpened:e,selectedFontFamily:t,hoveredFontFamily:o,onSelect:n,onHover:r,onLeave:a,onPopupChange:i,compactMode:s=!1})=>{let l=LD(()=>d2,[]),c=AD(m=>{m&&n(m)},[n]);return c2("div",{role:"dialog","aria-modal":"true",className:MD("FontPicker__container",{"FontPicker__container--compact":s}),children:[!s&&Ec("div",{className:"buttonList",children:Ec(Uo,{type:"button",options:l,value:t,onClick:c})}),!s&&Ec(Dm,{}),c2(SD.Root,{open:e,onOpenChange:i,children:[Ec(l2,{selectedFontFamily:t,isOpened:e,compactMode:s}),e&&Ec(s2,{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 gf}from"radix-ui";import ND from"clsx";import Vm,{useEffect as BD}from"react";import{isArrowKey as FD,KEYS as fr}from"@orangecatai/common";import{jsx as _D}from"react/jsx-runtime";var Gn=({className:e,icon:t,size:o="1em"})=>_D("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 RD,jsx as p2,jsxs as u2}from"react/jsx-runtime";var DD=({label:e,open:t,openTrigger:o,children:n,className:r,showCollapsedIcon:a=!0})=>u2(RD,{children:[u2("div",{style:{cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center"},className:r,onClick:o,children:[e,a&&p2(Gn,{icon:t?mv:Tm})]}),t&&p2("div",{style:{display:"flex",flexDirection:"column"},children:n})]}),wc=DD;import{jsx as Za,jsxs as hf}from"react/jsx-runtime";var OD=Pe(!1);function zD({options:e,value:t,label:o,onChange:n,onClose:r,numberOfOptionsToAlwaysShow:a=e.length}){let i=Te(),{container:s}=Qe(),l=g=>{let x=e.find(E=>E.keyBinding===g.key.toLowerCase());if(!(g.metaKey||g.altKey||g.ctrlKey)&&x)n(x.value),g.preventDefault();else if(g.key===fr.TAB){let E=e.findIndex(w=>w.value===t),y=g.shiftKey?(e.length+E-1)%e.length:(E+1)%e.length;n(e[y].value)}else if(FD(g.key)){let E=ur().rtl,y=e.findIndex(w=>w.value===t);if(y!==-1){let w=e.length,v=y;switch(g.key){case(E?fr.ARROW_LEFT:fr.ARROW_RIGHT):v=(y+1)%w;break;case(E?fr.ARROW_RIGHT:fr.ARROW_LEFT):v=(w+y-1)%w;break;case fr.ARROW_DOWN:{v=(y+(a??1))%w;break}case fr.ARROW_UP:{v=(w+y-(a??1))%w;break}}n(e[v].value)}g.preventDefault()}else(g.key===fr.ESCAPE||g.key===fr.ENTER)&&(g.preventDefault(),r());g.nativeEvent.stopImmediatePropagation(),g.stopPropagation()},[c,m]=le(OD),p=Vm.useMemo(()=>e.slice(0,a),[e,a]),d=Vm.useMemo(()=>e.slice(a),[e,a]);BD(()=>{p.some(g=>g.value===t)||m(!0)},[t,p,m]);let u=g=>Za("div",{className:"picker-content",children:g.map((x,E)=>hf("button",{type:"button",className:ND("picker-option",{active:t===x.value}),onClick:y=>{n(x.value)},title:`${x.text} ${x.keyBinding&&`\u2014 ${x.keyBinding.toUpperCase()}`}`,"aria-label":x.text||"none","aria-keyshortcuts":x.keyBinding||void 0,ref:y=>{t===x.value&&setTimeout(()=>{y?.focus()},0)},children:[x.icon,x.keyBinding&&Za("span",{className:"picker-keybinding",children:x.keyBinding})]},x.text))}),h=i.formFactor==="phone";return Za(gf.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:hf("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":o,children:[u(p),d.length>0&&Za(wc,{label:f("labels.more_options"),open:c,openTrigger:()=>{m(g=>!g)},className:"picker-collapsible",children:u(d)})]})})}function ff({value:e,label:t,options:o,onChange:n,group:r="",numberOfOptionsToAlwaysShow:a}){let[i,s]=Vm.useState(!1),l=Vm.useRef(null);return Za("div",{children:hf(gf.Root,{open:i,onOpenChange:c=>s(c),children:[Za(gf.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&&Za(zD,{options:o,value:e,label:t,onChange:n,onClose:()=>{s(!1)},numberOfOptionsToAlwaysShow:a})]})})}import g2,{useEffect as HD}from"react";import{jsx as bf,jsxs as h2}from"react/jsx-runtime";var f2=({updateData:e,app:t,testId:o})=>{let n=g2.useRef(null),r=g2.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 HD(()=>{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]),h2("label",{className:"control-label",children:[f("labels.opacity"),h2("div",{className:"range-wrapper",children:[bf("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}),bf("div",{className:"value-bubble",ref:r,children:c!==0?c:null}),bf("div",{className:"zero-label",children:"0"})]})]})};import{Fragment as Sf,jsx as ge,jsxs as no}from"react/jsx-runtime";var I2=.1,Is=e=>{let t=c8(e.editorInterface);return{stylesPanelMode:t,isCompact:t!=="full",isMobile:t==="mobile"}},oo=(e,t,o,n=!1)=>{let r=vf(de(e,t,{includeBoundTextElement:n}));return e.map(a=>r.get(a.id)||a.id===t.editingTextElement?.id?o(a):a)},Kt=function(e,t,o,n,r){let a=t.state.editingTextElement,i=w2(e),s=null;if(a&&(s=o(a)),!s)if(Ge(i,t.state)){let c=t.scene.getSelectedElements(t.state),m=n===!0?c:c.filter(p=>n(p));s=t8(m,o)??(typeof r=="function"?r(!0):r)}else s=typeof r=="function"?r(!1):r;return s},d8=(e,t,o)=>r8(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}),Tf=(e,t,o,n,r)=>{let a=new Set,i=oo(e,t,s=>{if(fo(s)){let l=n(s);a.add(l);let c=kt(s,{fontSize:l});return vc(c,o.scene.getContainerElement(s),o.scene),c=d8(s,c,o.scene),c}return s},!0);return de(e,t,{includeBoundTextElement:!0}).forEach(s=>{fo(s)&&n8(s,o.scene)}),{elements:i,appState:{...t,currentItemFontSize:a.size===1?[...a][0]:r??t.currentItemFontSize},captureUpdate:St.IMMEDIATELY}},m8=W({name:"changeStrokeColor",label:"labels.stroke",trackEvent:!1,perform:(e,t,o)=>({...o?.currentItemStrokeColor&&{elements:oo(e,t,n=>i8(n.type)?kt(n,{strokeColor:o.currentItemStrokeColor}):n,!0)},appState:{...t,...o},captureUpdate:o?.currentItemStrokeColor?St.IMMEDIATELY:St.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{stylesPanelMode:a}=Is(n);return no(Sf,{children:[a==="full"&&ge("h3",{"aria-hidden":"true",children:f("labels.stroke")}),ge(fc,{topPicks:KD,palette:VD,type:"elementStroke",label:f("labels.stroke"),color:Kt(e,n,i=>i.strokeColor,!0,i=>i?null:t.currentItemStrokeColor),onChange:i=>o({currentItemStrokeColor:i}),elements:e,appState:t,updateData:o})]})}}),p8=W({name:"changeBackgroundColor",label:"labels.changeBackground",trackEvent:!1,perform:(e,t,o,n)=>{if(!o?.currentItemBackgroundColor)return{appState:{...t,...o},captureUpdate:St.EVENTUALLY};let r,a=n.scene.getSelectedElements(t);if(!e8(o.currentItemBackgroundColor)&&a.every(s=>y2(s)&&o8(s.points))){let s=vf(a);r=e.map(l=>s.has(l.id)&&y2(l)?kt(l,{backgroundColor:o.currentItemBackgroundColor,...l8(l,!0)}):l)}else r=oo(e,t,s=>kt(s,{backgroundColor:o.currentItemBackgroundColor}));return{elements:r,appState:{...t,...o},captureUpdate:St.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{stylesPanelMode:a}=Is(n);return no(Sf,{children:[a==="full"&&ge("h3",{"aria-hidden":"true",children:f("labels.background")}),ge(fc,{topPicks:$D,palette:YD,type:"elementBackground",label:f("labels.background"),color:Kt(e,n,i=>i.backgroundColor,!0,i=>i?null:t.currentItemBackgroundColor),onChange:i=>o({currentItemBackgroundColor:i}),elements:e,appState:t,updateData:o})]})}}),u8=W({name:"changeFillStyle",label:"labels.fill",trackEvent:!1,perform:(e,t,o,n)=>(be("element","changeFillStyle",`${o} (${n.editorInterface.formFactor==="phone"?"mobile":"desktop"})`),{elements:oo(e,t,r=>kt(r,{fillStyle:o})),appState:{...t,currentItemFillStyle:o},captureUpdate:St.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=de(e,t),a=r.length>0&&r.every(i=>i.fillStyle==="zigzag");return no("fieldset",{children:[ge("legend",{children:f("labels.fill")}),ge("div",{className:"buttonList",children:ge(Uo,{type:"button",options:[{value:"hachure",text:`${a?f("labels.zigzag"):f("labels.hachure")} (${G("Alt-Click")})`,icon:a?tw:ow,active:a?!0:void 0,testId:"fill-hachure"},{value:"cross-hatch",text:f("labels.crossHatch"),icon:nw,testId:"fill-cross-hatch"},{value:"solid",text:f("labels.solid"),icon:rw,testId:"fill-solid"}],value:Kt(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)}})})]})}}),g8=W({name:"changeStrokeWidth",label:"labels.strokeWidth",trackEvent:!1,perform:(e,t,o)=>({elements:oo(e,t,n=>kt(n,{strokeWidth:o})),appState:{...t,currentItemStrokeWidth:o},captureUpdate:St.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>no("fieldset",{children:[ge("legend",{children:f("labels.strokeWidth")}),ge("div",{className:"buttonList",children:ge(Uo,{group:"stroke-width",options:[{value:Ef.thin,text:f("labels.thin"),icon:Dh,testId:"strokeWidth-thin"},{value:Ef.bold,text:f("labels.bold"),icon:aw,testId:"strokeWidth-bold"},{value:Ef.extraBold,text:f("labels.extraBold"),icon:iw,testId:"strokeWidth-extraBold"}],value:Kt(e,n,a=>a.strokeWidth,a=>a.hasOwnProperty("strokeWidth"),a=>a?null:t.currentItemStrokeWidth),onChange:a=>o(a)})})]})}),h8=W({name:"changeSloppiness",label:"labels.sloppiness",trackEvent:!1,perform:(e,t,o)=>({elements:oo(e,t,n=>kt(n,{seed:qD(),roughness:o})),appState:{...t,currentItemRoughness:o},captureUpdate:St.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>no("fieldset",{children:[ge("legend",{children:f("labels.sloppiness")}),ge("div",{className:"buttonList",children:ge(Uo,{group:"sloppiness",options:[{value:0,text:f("labels.architect"),icon:cw},{value:1,text:f("labels.artist"),icon:dw},{value:2,text:f("labels.cartoonist"),icon:mw}],value:Kt(e,n,a=>a.roughness,a=>a.hasOwnProperty("roughness"),a=>a?null:t.currentItemRoughness),onChange:a=>o(a)})})]})}),Tle=W({name:"changeStrokeStyle",label:"labels.strokeStyle",trackEvent:!1,perform:(e,t,o)=>({elements:oo(e,t,n=>kt(n,{strokeStyle:o})),appState:{...t,currentItemStrokeStyle:o},captureUpdate:St.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>no("fieldset",{children:[ge("legend",{children:f("labels.strokeStyle")}),ge("div",{className:"buttonList",children:ge(Uo,{group:"strokeStyle",options:[{value:"solid",text:f("labels.strokeStyle_solid"),icon:Dh},{value:"dashed",text:f("labels.strokeStyle_dashed"),icon:sw},{value:"dotted",text:f("labels.strokeStyle_dotted"),icon:lw}],value:Kt(e,n,a=>a.strokeStyle,a=>a.hasOwnProperty("strokeStyle"),a=>a?null:t.currentItemStrokeStyle),onChange:a=>o(a)})})]})}),f8=W({name:"changeOpacity",label:"labels.opacity",trackEvent:!1,perform:(e,t,o)=>({elements:oo(e,t,n=>kt(n,{opacity:o}),!0),appState:{...t,currentItemOpacity:o},captureUpdate:St.IMMEDIATELY}),PanelComponent:({app:e,updateData:t})=>ge(f2,{updateData:t,app:e,testId:"opacity"})}),b8=W({name:"changeFontSize",label:"labels.fontSize",trackEvent:!1,perform:(e,t,o,n)=>Tf(e,t,n,()=>(If(o,"actionChangeFontSize: Expected a font size value"),o),o),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{isCompact:a}=Is(n);return no("fieldset",{children:[ge("legend",{children:f("labels.fontSize")}),ge("div",{className:"buttonList",children:ge(Uo,{group:"font-size",options:[{value:Xm.sm,text:f("labels.small"),icon:kw,testId:"fontSize-small"},{value:Xm.md,text:f("labels.medium"),icon:Sw,testId:"fontSize-medium"},{value:Xm.lg,text:f("labels.large"),icon:Mw,testId:"fontSize-large"},{value:Xm.xl,text:f("labels.veryLarge"),icon:Pw,testId:"fontSize-veryLarge"}],value:Kt(e,n,i=>{if(fo(i))return i.fontSize;let s=qr(i,n.scene.getNonDeletedElementsMap());return s?s.fontSize:null},i=>fo(i)||qr(i,n.scene.getNonDeletedElementsMap())!==null,i=>i?null:t.currentItemFontSize||ZD),onChange:i=>{pc(()=>o(i),a,!!t.editingTextElement,r?.onPreventClose)}})})]})}}),Cf=W({name:"decreaseFontSize",label:"labels.decreaseFontSize",icon:Va,trackEvent:!1,perform:(e,t,o,n)=>Tf(e,t,n,r=>Math.round(1/(1+I2)*r.fontSize)),keyTest:e=>e[vs.CTRL_OR_CMD]&&e.shiftKey&&(e.key===vs.CHEVRON_LEFT||e.key===vs.COMMA)}),kf=W({name:"increaseFontSize",label:"labels.increaseFontSize",icon:Va,trackEvent:!1,perform:(e,t,o,n)=>Tf(e,t,n,r=>Math.round(r.fontSize*(1+I2))),keyTest:e=>e[vs.CTRL_OR_CMD]&&e.shiftKey&&(e.key===vs.CHEVRON_RIGHT||e.key===vs.PERIOD)}),x8=W({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:oo(e,t,g=>{let x=r?.get(g.id);return x?kt(g,{...x}):g},!0),appState:{...t,...s},captureUpdate:St.NEVER};If(o,"actionChangeFontFamily: value must be defined");let{currentItemFontFamily:l,currentHoveredFontFamily:c}=o,m=St.EVENTUALLY,p,d=!1;if(l)p=l,m=St.IMMEDIATELY;else if(c){p=c,m=St.EVENTUALLY;let h=de(e,t,{includeBoundTextElement:!0}).filter(g=>fo(g));if(h.length>200)d=!0;else{let g=0,x=0;for(;g<h.length&&x<5e3;){let E=h[g];x+=E?.originalText.length||0,g++}x>5e3&&(d=!0)}}let u={appState:{...t,...s},captureUpdate:m};if(p&&!d){let h=new Map,g=new Set,x=!1,E=Array.from(Ho.loadedFontsCache.values()),y=Object.entries(jD).find(([I,C])=>C===p)?.[0];c&&y&&E.some(I=>I.startsWith(y))&&(x=!0),Object.assign(u,{elements:oo(e,t,I=>{if(fo(I)&&(I.fontFamily!==p||l)){let C=kt(I,{fontFamily:p,lineHeight:QD(p)}),P=r?.get(I.containerId||"")||{},S=n.scene.getContainerElement(I);return i&&S&&P&&n.scene.mutateElement(S,{...P}),x||(g=new Set([...g,...Array.from(C.originalText)])),h.set(C,S),C}return I},!0)});let w=`10px ${JD({fontFamily:p})}`,v=Array.from(g.values()).join();if(x||window.document.fonts.check(w,v))for(let[I,C]of h)vc(I,C,n.scene);else window.document.fonts.load(w,v).then(I=>{for(let[C,P]of h){let S=n.scene.getElement(C.id),D=P?n.scene.getElement(P.id):null;S&&vc(S,D,n.scene)}n.fonts.onLoaded(I)})}return u},PanelComponent:({elements:e,appState:t,app:o,updateData:n})=>{let r=yf(new Map),a=yf(null),[i,s]=WD({}),l=yf(!0),{stylesPanelMode:c,isCompact:m}=Is(o),p=UD(()=>{let d=(u,h)=>Kt(u,o,g=>{if(fo(g))return g.fontFamily;let x=qr(g,h);return x?x.fontFamily:null},g=>fo(g)||qr(g,h)!==null,g=>g?null:t.currentItemFontFamily||XD);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 xf(()=>{a.current=p},[p]),xf(()=>{Object.keys(i).length&&(n(i),s({}))},[i]),xf(()=>(l.current=!1,()=>{l.current=!0}),[]),no(Sf,{children:[c==="full"&&ge("legend",{children:f("labels.fontFamily")}),ge(m2,{isOpened:t.openPopup==="fontFamily",selectedFontFamily:p,hoveredFontFamily:t.currentHoveredFontFamily,compactMode:c!=="full",onSelect:d=>{pc(()=>{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,kt(h||u,{},!0))}else{let h=de(e,t,{includeBoundTextElement:!0});for(let g of h)r.current.set(g.id,kt(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&&mc(null)}}})]})}}),y8=W({name:"changeTextAlign",label:"Change text alignment",trackEvent:!1,perform:(e,t,o,n)=>({elements:oo(e,t,r=>{if(fo(r)){let a=kt(r,{textAlign:o});return vc(a,n.scene.getContainerElement(r),n.scene),a}return r},!0),appState:{...t,currentItemTextAlign:o},captureUpdate:St.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let a=n.scene.getNonDeletedElementsMap(),{isCompact:i}=Is(n);return no("fieldset",{children:[ge("legend",{children:f("labels.textAlign")}),ge("div",{className:"buttonList",children:ge(Uo,{group:"text-align",options:[{value:"left",text:f("labels.left"),icon:Lw,testId:"align-left"},{value:"center",text:f("labels.center"),icon:_w,testId:"align-horizontal-center"},{value:"right",text:f("labels.right"),icon:Dw,testId:"align-right"}],value:Kt(e,n,s=>{if(fo(s))return s.textAlign;let l=qr(s,a);return l?l.textAlign:null},s=>fo(s)||qr(s,a)!==null,s=>s?null:t.currentItemTextAlign),onChange:s=>{pc(()=>o(s),i,!!t.editingTextElement,r?.onPreventClose)}})})]})}}),E8=W({name:"changeVerticalAlign",label:"Change vertical alignment",trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:oo(e,t,r=>{if(fo(r)){let a=kt(r,{verticalAlign:o});return vc(a,n.scene.getContainerElement(r),n.scene),a}return r},!0),appState:{...t},captureUpdate:St.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{isCompact:a}=Is(n);return ge("fieldset",{children:ge("div",{className:"buttonList",children:ge(Uo,{group:"text-align",options:[{value:Km.TOP,text:f("labels.alignTop"),icon:ge(Rw,{theme:t.theme}),testId:"align-top"},{value:Km.MIDDLE,text:f("labels.centerVertically"),icon:ge(Bw,{theme:t.theme}),testId:"align-middle"},{value:Km.BOTTOM,text:f("labels.alignBottom"),icon:ge(Nw,{theme:t.theme}),testId:"align-bottom"}],value:Kt(e,n,i=>{if(fo(i)&&i.containerId)return i.verticalAlign;let s=qr(i,n.scene.getNonDeletedElementsMap());return s?s.verticalAlign:null},i=>fo(i)||qr(i,n.scene.getNonDeletedElementsMap())!==null,i=>i?null:Km.MIDDLE),onChange:i=>{pc(()=>o(i),a,!!t.editingTextElement,r?.onPreventClose)}})})})}}),Cle=W({name:"changeRoundness",label:"Change edge roundness",trackEvent:!1,perform:(e,t,o)=>({elements:oo(e,t,n=>v2(n)?n:kt(n,{roundness:o==="round"?{type:a8(n.type)?Zm.ADAPTIVE_RADIUS:Zm.PROPORTIONAL_RADIUS}:null})),appState:{...t,currentItemRoundness:o},captureUpdate:St.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,renderAction:r})=>{let i=Hi(w2(e),t).some(s=>s.roundness?.type===Zm.LEGACY);return no("fieldset",{children:[ge("legend",{children:f("labels.edges")}),no("div",{className:"buttonList",children:[ge(Uo,{group:"edges",options:[{value:"sharp",text:f("labels.sharp"),icon:pw},{value:"round",text:f("labels.round"),icon:uw}],value:Kt(e,n,s=>i?null:s.roundness?"round":"sharp",s=>!jm(s)&&s.hasOwnProperty("roundness"),s=>s?null:t.currentItemRoundness),onChange:s=>o(s)}),r("togglePolygon")]})]})}}),E2=e=>[{value:null,text:f("labels.arrowhead_none"),keyBinding:"q",icon:ge(gw,{flip:e})},{value:"arrow",text:f("labels.arrowhead_arrow"),keyBinding:"w",icon:ge(hw,{flip:e})},{value:"triangle",text:f("labels.arrowhead_triangle"),icon:ge(yw,{flip:e}),keyBinding:"e"},{value:"triangle_outline",text:f("labels.arrowhead_triangle_outline"),icon:ge(Ew,{flip:e}),keyBinding:"r"},{value:"circle",text:f("labels.arrowhead_circle"),keyBinding:"a",icon:ge(fw,{flip:e})},{value:"circle_outline",text:f("labels.arrowhead_circle_outline"),keyBinding:"s",icon:ge(bw,{flip:e})},{value:"diamond",text:f("labels.arrowhead_diamond"),icon:ge(ww,{flip:e}),keyBinding:"d"},{value:"diamond_outline",text:f("labels.arrowhead_diamond_outline"),icon:ge(vw,{flip:e}),keyBinding:"f"},{value:"bar",text:f("labels.arrowhead_bar"),keyBinding:"z",icon:ge(xw,{flip:e})},{value:"crowfoot_one",text:f("labels.arrowhead_crowfoot_one"),icon:ge(Tw,{flip:e}),keyBinding:"x"},{value:"crowfoot_many",text:f("labels.arrowhead_crowfoot_many"),icon:ge(Iw,{flip:e}),keyBinding:"c"},{value:"crowfoot_one_or_many",text:f("labels.arrowhead_crowfoot_one_or_many"),icon:ge(Cw,{flip:e}),keyBinding:"v"}],kle=W({name:"changeArrowhead",label:"Change arrowheads",trackEvent:!1,perform:(e,t,o)=>(If(o,"actionChangeArrowhead: value must be defined"),{elements:oo(e,t,n=>{if(wf(n)){let{position:r,type:a}=o;if(r==="start")return kt(n,{startArrowhead:a});if(r==="end")return kt(n,{endArrowhead:a})}return n}),appState:{...t,[o.position==="start"?"currentItemStartArrowhead":"currentItemEndArrowhead"]:o.type},captureUpdate:St.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=ur().rtl;return no("fieldset",{children:[ge("legend",{children:f("labels.arrowheads")}),no("div",{className:"iconSelectList buttonList",children:[ge(ff,{label:"arrowhead_start",options:E2(!r),value:Kt(e,n,a=>wf(a)&&Gi(a.type)?a.startArrowhead:t.currentItemStartArrowhead,!0,a=>a?null:t.currentItemStartArrowhead),onChange:a=>o({position:"start",type:a}),numberOfOptionsToAlwaysShow:4}),ge(ff,{label:"arrowhead_end",group:"arrowheads",options:E2(!!r),value:Kt(e,n,a=>wf(a)&&Gi(a.type)?a.endArrowhead:t.currentItemEndArrowhead,!0,a=>a?null:t.currentItemEndArrowhead),onChange:a=>o({position:"end",type:a}),numberOfOptionsToAlwaysShow:4})]})]})}}),w8=W({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})=>no("div",{className:"selected-shape-actions",children:[r("changeArrowhead"),r("changeArrowType")]})}),Sle=W({name:"changeArrowType",label:"Change arrow types",trackEvent:!1,perform:(e,t,o,n)=>{let r=oo(e,t,s=>{if(!jm(s))return s;let l=n.scene.getNonDeletedElementsMap(),c=ja.getPointAtIndexGlobalCoordinates(s,0,l),m=ja.getPointAtIndexGlobalCoordinates(s,-1,l),p=kt(s,{x:o===Vo.elbow?c[0]:s.x,y:o===Vo.elbow?c[1]:s.y,roundness:o===Vo.round?{type:Zm.PROPORTIONAL_RADIUS}:null,elbowed:o===Vo.elbow,angle:o===Vo.elbow?0:s.angle,points:o===Vo.elbow||s.elbowed?[ja.pointFromAbsoluteCoords({...s,x:c[0],y:c[1],angle:0},c,l),ja.pointFromAbsoluteCoords({...s,x:c[0],y:c[1],angle:0},m,l)]:s.points});if(v2(p)){p.fixedSegments=null;let d=n.scene.getNonDeletedElementsMap();n.dismissLinearEditor();let u=ja.getPointAtIndexGlobalCoordinates(p,0,d),h=ja.getPointAtIndexGlobalCoordinates(p,-1,d),g=p.startBinding&&d.get(p.startBinding.elementId),x=p.endBinding&&d.get(p.endBinding.elementId),E=g&&p.startBinding?{...p.startBinding,...x2(p,g,"start",d)}:null,y=x&&p.endBinding?{...p.endBinding,...x2(p,x,"end",d)}:null;p={...p,startBinding:E,endBinding:y,...s8(p,d,{points:[u,h].map(w=>GD(w[0]-p.x,w[1]-p.y)),startBinding:E,endBinding:y,fixedSegments:null})}}else{let d=n.scene.getNonDeletedElementsMap();if(p.startBinding){let u=d.get(p.startBinding.elementId);u&&b2(p,u,t.bindMode==="inside"?"inside":"orbit","start",n.scene)}if(p.endBinding){let u=d.get(p.endBinding.elementId);u&&b2(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 ja(s,vf(e)))}return{elements:r,appState:a,captureUpdate:St.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>no("fieldset",{children:[ge("legend",{children:f("labels.arrowtypes")}),ge("div",{className:"buttonList",children:ge(Uo,{group:"arrowtypes",options:[{value:Vo.sharp,text:f("labels.arrowtype_sharp"),icon:ds,testId:"sharp-arrow"},{value:Vo.round,text:f("labels.arrowtype_round"),icon:ps,testId:"round-arrow"},{value:Vo.elbow,text:f("labels.arrowtype_elbowed"),icon:ms,testId:"elbow-arrow"}],value:Kt(e,n,r=>jm(r)?r.elbowed?Vo.elbow:r.roundness?Vo.round:Vo.sharp:null,r=>jm(r),r=>r?null:t.currentItemArrowType),onChange:r=>o(r)})})]})});import{clamp as _f,roundToStep as M8}from"@orangecatai/math";import{DEFAULT_CANVAS_BACKGROUND_PICKS as P8,CURSOR_TYPE as L2,MAX_ZOOM as _2,MIN_ZOOM as D2,THEME as Ic,ZOOM_STEP as Df,updateActiveTool as Cs,CODES as Wn,KEYS as xr,viewportCoordsToSceneCoords as A8}from"@orangecatai/common";import{getElementAbsoluteCoords as M2,getNonDeletedElements as R2,getVisibleElements as L8}from"@orangecatai/element";import{newElementWith as _8}from"@orangecatai/element";import{getCommonBounds as N2}from"@orangecatai/element";import{CaptureUpdateAction as un}from"@orangecatai/element";import{useEffect as v8}from"react";import{jsx as T8}from"react/jsx-runtime";var Ts=()=>{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},Mf=(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`})},I8=(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();Mf(t,r)},Xt=({children:e,label:t,long:o=!1,style:n,disabled:r})=>(v8(()=>()=>Ts().classList.remove("excalidraw-tooltip--visible"),[]),r?null:T8("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:a=>I8(a.currentTarget,Ts(),t,o),onPointerLeave:()=>Ts().classList.remove("excalidraw-tooltip--visible"),style:n,children:e}));import{CURSOR_TYPE as Pf,MIME_TYPES as Af,THEME as C2}from"@orangecatai/common";var k2='<svg viewBox="0 0 24 24" stroke-width="1" width="28" height="28" xmlns="http://www.w3.org/2000/svg">',C8='<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"/>',S2='<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"/>',k8=`data:${Af.svg},${encodeURIComponent(`${k2}${S2}</svg>`)}`,S8=`data:${Af.svg},${encodeURIComponent(`${k2}${C8}${S2}</svg>`)}`,Po=e=>{e&&(e.style.cursor="")},Be=(e,t)=>{e&&(e.style.cursor=t)},Un,T2,Lf=(e,t)=>{let n=()=>{let r=t===C2.DARK;Un=document.createElement("canvas"),Un.theme=t,Un.height=20,Un.width=20;let a=Un.getContext("2d");a.lineWidth=1,a.beginPath(),a.arc(Un.width/2,Un.height/2,5,0,2*Math.PI),a.fillStyle=r?"#000":"#fff",a.fill(),a.strokeStyle=r?"#fff":"#000",a.stroke(),T2=Un.toDataURL(Af.svg)};(!Un||Un.theme!==t)&&n(),Be(e,`url(${T2}) ${20/2} ${20/2}, auto`)},Ao=(e,t)=>{if(e)if(t.activeTool.type==="selection")Po(e);else if(pr(t))e.style.cursor=Pf.GRAB;else if(ho(t))Lf(e,t.theme);else if(t.activeTool.type==="laser"){let o=t.theme===C2.LIGHT?k8:S8;e.style.cursor=`url(${o}), auto`}else["image","custom"].includes(t.activeTool.type)?t.activeTool.type!=="image"&&(e.style.cursor=Pf.AUTO):e.style.cursor=Pf.CROSSHAIR};var br=({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 ks,jsxs as G8}from"react/jsx-runtime";var D8=W({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?un.IMMEDIATELY:un.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:o,appProps:n,data:r})=>ks(fc,{palette:null,topPicks:P8,label:f("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:a=>o({viewBackgroundColor:a}),"data-testid":"canvas-background-picker",elements:e,appState:t,updateData:o})}),yr=W({name:"clearCanvas",label:"labels.clearCanvas",icon:Ut,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=>_8(r,{isDeleted:!0})),appState:{...Or(),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:un.IMMEDIATELY})}),qm=W({name:"zoomIn",label:"buttons.zoomIn",viewMode:!0,icon:fh,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>({appState:{...t,...br({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Ln(t.zoom.value+Df)},t),userToFollow:null},captureUpdate:un.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>ks(ae,{type:"button",className:"zoom-in-button zoom-button",icon:fh,title:`${f("buttons.zoomIn")} \u2014 ${G("CtrlOrCmd++")}`,"aria-label":f("buttons.zoomIn"),disabled:t.zoom.value>=_2,onClick:()=>{e(null)}}),keyTest:e=>(e.code===Wn.EQUAL||e.code===Wn.NUM_ADD)&&(e[xr.CTRL_OR_CMD]||e.shiftKey)}),Jm=W({name:"zoomOut",label:"buttons.zoomOut",icon:bh,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>({appState:{...t,...br({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Ln(t.zoom.value-Df)},t),userToFollow:null},captureUpdate:un.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>ks(ae,{type:"button",className:"zoom-out-button zoom-button",icon:bh,title:`${f("buttons.zoomOut")} \u2014 ${G("CtrlOrCmd+-")}`,"aria-label":f("buttons.zoomOut"),disabled:t.zoom.value<=D2,onClick:()=>{e(null)}}),keyTest:e=>(e.code===Wn.MINUS||e.code===Wn.NUM_SUBTRACT)&&(e[xr.CTRL_OR_CMD]||e.shiftKey)}),Qm=W({name:"resetZoom",label:"buttons.resetZoom",icon:OE,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>({appState:{...t,...br({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Ln(1)},t),userToFollow:null},captureUpdate:un.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>ks(Xt,{label:f("buttons.resetZoom"),style:{height:"100%"},children:G8(ae,{type:"button",className:"reset-zoom-button zoom-button",title:f("buttons.resetZoom"),"aria-label":f("buttons.resetZoom"),onClick:()=>{e(null)},children:[(t.zoom.value*100).toFixed(0),"%"]})}),keyTest:e=>(e.code===Wn.ZERO||e.code===Wn.NUM_ZERO)&&(e[xr.CTRL_OR_CMD]||e.shiftKey)}),R8=(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)*_f(o,.1,1);return Math.min(d,1)},N8=.8,B8=(e,t)=>e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1],F8=(e,t)=>[e[0]-t,e[1]-t,e[2]+t,e[3]+t],P2=(e,t)=>{let o=(e[0]+e[2])/2,n=(e[1]+e[3])/2;return Math.hypot(o-t.x,n-t.y)},A2=e=>[e[0],e[1],e[2],e[3]],O8=(e,t)=>{let o=R2(e);if(!o.length)return[];let n=L8(o),r=n.length?n:o,a=new Map(o.map(d=>[d.id,d])),i=A8({clientX:t.offsetLeft+t.width/2,clientY:t.offsetTop+t.height/2},t),s=r.reduce((d,u)=>{let h=A2(M2(u,a));return d?P2(h,i)<P2(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=F8(m,l);for(let u of r){if(c.has(u.id))continue;let h=A2(M2(u,a));B8(h,d)&&(c.set(u.id,u),m=N2([...c.values()]),p=!0)}}return[...c.values()]},B2=({bounds:e,appState:t,canvasOffsets:o,fitToViewport:n=!1,viewportZoomFactor:r=1,minZoom:a=-1/0,maxZoom:i=1/0})=>{r=_f(r,D2,_2);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,x=o?.bottom??0,E=t.width-u-g,y=t.height-h-x,w;if(n){let C=c-s,P=m-l;w=Math.min(E/C,y/P)*r}else w=R8(e,{width:E,height:y},r);let v=Ln(_f(M8(w,Df,"floor"),a,i)),I=oE({scenePoint:{x:p,y:d},viewportDimensions:{width:t.width,height:t.height},offsets:o,zoom:{value:v}});return{appState:{...t,scrollX:I.scrollX,scrollY:I.scrollY,zoom:{value:v}},captureUpdate:un.EVENTUALLY}},Ss=({canvasOffsets:e,targetElements:t,appState:o,fitToViewport:n,viewportZoomFactor:r,minZoom:a,maxZoom:i})=>{let s=N2(R2(t));return B2({canvasOffsets:e,bounds:s,appState:o,fitToViewport:n,viewportZoomFactor:r,minZoom:a,maxZoom:i})},cce=W({name:"zoomToFitSelectionInViewport",label:"labels.zoomToFitViewport",icon:cs,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t);return Ss({targetElements:r.length?r:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:n.getEditorUIOffsets()})},keyTest:e=>e.code===Wn.TWO&&e.shiftKey&&!e.altKey&&!e[xr.CTRL_OR_CMD]}),dce=W({name:"zoomToFitSelection",label:"helpDialog.zoomToSelection",icon:cs,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t);return Ss({targetElements:r.length?r:e,appState:{...t,userToFollow:null},fitToViewport:!0,canvasOffsets:n.getEditorUIOffsets()})},keyTest:e=>e.code===Wn.THREE&&e.shiftKey&&!e.altKey&&!e[xr.CTRL_OR_CMD]}),z8=W({name:"zoomToFit",label:"helpDialog.zoomToFit",icon:cs,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>Ss({targetElements:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:n.getEditorUIOffsets()}),keyTest:e=>e.code===Wn.ONE&&e.shiftKey&&!e.altKey&&!e[xr.CTRL_OR_CMD]}),H8=W({name:"scrollBackToContent",label:"buttons.scrollBackToContent",icon:cs,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t),a=r.length?r:O8(e,t);return a.length?Ss({targetElements:a,appState:{...t,userToFollow:null},fitToViewport:!0,viewportZoomFactor:N8,canvasOffsets:n.getEditorUIOffsets()}):!1},PanelComponent:({updateData:e})=>ks(Xt,{label:f("buttons.scrollBackToContent"),style:{height:"100%"},children:ks(ae,{type:"button",className:"scroll-back-to-content-button zoom-button",icon:cs,title:f("buttons.scrollBackToContent"),"aria-label":f("buttons.scrollBackToContent"),onClick:()=>{e(null)}})})}),qa=W({name:"toggleTheme",label:(e,t)=>t.theme===Ic.DARK?"buttons.lightMode":"buttons.darkMode",keywords:["toggle","dark","light","mode","theme"],icon:(e,t)=>e.theme===Ic.LIGHT?oc:nc,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o)=>({appState:{...t,theme:o||(t.theme===Ic.LIGHT?Ic.DARK:Ic.LIGHT)},captureUpdate:un.EVENTUALLY}),keyTest:e=>e.altKey&&e.shiftKey&&e.code===Wn.D,predicate:(e,t,o,n)=>!!n.props.UIOptions.canvasActions.toggleTheme}),mce=W({name:"toggleEraserTool",label:"toolBar.eraser",trackEvent:{category:"toolbar"},perform:(e,t,o,n)=>{let r;return ho(t)?r=Cs(t,{...t.activeTool.lastActiveTool||{type:n.state.preferredSelectionTool.type},lastActiveToolBeforeEraser:null}):r=Cs(t,{type:"eraser",lastActiveToolBeforeEraser:t.activeTool}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:r},captureUpdate:un.IMMEDIATELY}},keyTest:e=>e.key===xr.E}),pce=W({name:"toggleLassoTool",label:"toolBar.lasso",icon:Hr,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=Cs(t,{type:"lasso",fromSelection:!1}),Be(n.interactiveCanvas,L2.CROSSHAIR)):r=Cs(t,{type:"selection"}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:r},captureUpdate:un.NEVER}}}),F2=W({name:"toggleHandTool",label:"toolBar.hand",trackEvent:{category:"toolbar"},icon:as,viewMode:!1,perform:(e,t,o,n)=>{let r;return pr(t)?r=Cs(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):(r=Cs(t,{type:"hand",lastActiveToolBeforeEraser:t.activeTool}),Be(n.interactiveCanvas,L2.GRAB)),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:r},captureUpdate:un.IMMEDIATELY}},keyTest:e=>!e.altKey&&!e[xr.CTRL_OR_CMD]&&e.key===xr.H});import{updateActiveTool as O2}from"@orangecatai/common";import{CaptureUpdateAction as U8}from"@orangecatai/element";var W8=W({name:"setEmbeddableAsActiveTool",trackEvent:{category:"toolbar"},target:"Tool",label:"toolBar.embeddable",perform:(e,t,o,n)=>{let r=O2(t,{type:"embeddable"});return Ao(n.canvas,{...t,activeTool:r}),{elements:e,appState:{...t,activeTool:O2(t,{type:"embeddable"})},captureUpdate:U8.EVENTUALLY}}});import{pointFrom as z2}from"@orangecatai/math";import{bindOrUnbindBindingElement as Y8}from"@orangecatai/element/binding";import{isValidPolygon as H2,LinearElementEditor as ep,newElementWith as Rf}from"@orangecatai/element";import{isBindingElement as G2,isFreeDrawElement as U2,isLinearElement as W2,isLineElement as tp}from"@orangecatai/element";import{KEYS as Nf,arrayToMap as $8,invariant as Y2,shouldRotateWithDiscreteAngle as V8,updateActiveTool as $2}from"@orangecatai/common";import{isPathALoop as K8}from"@orangecatai/element";import{isInvisiblySmallElement as Bf}from"@orangecatai/element";import{CaptureUpdateAction as V2}from"@orangecatai/element";import{jsx as X8}from"react/jsx-runtime";var ro=W({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=ep.getElement(t.selectedLinearElement.elementId,l);Y2(h,"Arrow element should exist if selectedLinearElement is set"),Y2(u,"sceneCoords should be defined if actionFinalize is called with event");let g=ep.handlePointerUp(d,t.selectedLinearElement,t,n.scene);if(G2(h)&&!t.selectedLinearElement.segmentMidPointHoveredCoords){let x=!!t.newElement,y=(x||!t.selectedLinearElement.selectedPointsIndices?[h.points.length-1]:t.selectedLinearElement.selectedPointsIndices).reduce((w,v)=>(w.set(v,{point:ep.pointFromAbsoluteCoords(h,z2(u.x-g.pointerOffset.x,u.y-g.pointerOffset.y),l)}),w),new Map)??new Map;Y8(h,y,u.x-g.pointerOffset.x,u.y-g.pointerOffset.y,s,t,{newArrow:x,altKey:d.altKey,angleLocked:V8(d)})}else tp(h)&&t.selectedLinearElement?.isEditing&&!t.newElement&&!H2(h.points)&&s.mutateElement(h,{polygon:!1});if(g!==t.selectedLinearElement){h&&Bf(h)&&(r=r.map(E=>E.id===h.id?Rf(E,{isDeleted:!0}):E));let x=t.activeTool?.locked;return{elements:h.points.length<2||Bf(h)?e.map(E=>E.id===h.id?Rf(E,{isDeleted:!0}):E):r,appState:{...t,cursorButton:"up",selectedLinearElement:x?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:V2.IMMEDIATELY}}}window.document.activeElement instanceof HTMLElement&&i();let c=null;if(t.multiElement)c=t.multiElement;else if(t.newElement?.type==="freedraw"||G2(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&&Bf(c)&&(r=r.map(d=>d.id===c?.id?Rf(d,{isDeleted:!0}):d)),W2(c)||U2(c)){if(K8(c.points,t.zoom.value)&&(tp(c)||U2(c))){let u=c.points,h=u[0],g=u.map((x,E)=>E===u.length-1?z2(h[0],h[1]):x);tp(c)?s.mutateElement(c,{points:g,polygon:!0}):s.mutateElement(c,{points:g})}tp(c)&&!H2(c.points)&&s.mutateElement(c,{polygon:!1})}}(!t.activeTool.locked&&t.activeTool.type!=="freedraw"||!c)&&Po(a);let m;t.activeTool.type==="eraser"?m=$2(t,{...t.activeTool.lastActiveTool||{type:n.state.preferredSelectionTool.type},lastActiveToolBeforeEraser:null}):m=$2(t,{type:n.state.preferredSelectionTool.type});let p=c&&W2(c)?new ep(c,$8(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:V2.IMMEDIATELY}},keyTest:(e,t)=>e.key===Nf.ESCAPE&&(t.selectedLinearElement?.isEditing||!t.newElement&&t.multiElement===null)||(e.key===Nf.ESCAPE||e.key===Nf.ENTER)&&t.multiElement!==null,PanelComponent:({appState:e,updateData:t,data:o})=>X8(ae,{type:"button",icon:KE,title:f("buttons.done"),"aria-label":f("buttons.done"),onClick:t,visible:e.multiElement!=null,size:o?.size||"medium",style:{pointerEvents:"all"}})});import{KEYS as Ls,DEFAULT_EXPORT_PADDING as OR,EXPORT_SCALES as zR,THEME as zf}from"@orangecatai/common";import{getNonDeletedElements as HR}from"@orangecatai/element";import{CaptureUpdateAction as fn}from"@orangecatai/element";import Z8 from"clsx";import{jsx as K2,jsxs as j8}from"react/jsx-runtime";var Tc=({children:e,checked:t,onChange:o,className:n})=>j8("div",{className:Z8("Checkbox",n,{"is-checked":t}),onClick:r=>{o(!t,r),r.currentTarget.querySelector(".Checkbox-box").focus()},children:[K2("button",{type:"button",className:"Checkbox-box",role:"checkbox","aria-checked":t,children:bm}),K2("div",{className:"Checkbox-label",children:e})]});import{THEME as Cc}from"@orangecatai/common";import{jsx as kc}from"react/jsx-runtime";var Z2=e=>{let t=e.title||(e.value===Cc.DARK?f("buttons.lightMode"):f("buttons.darkMode"));return kc(ae,{type:"icon",icon:e.value===Cc.LIGHT?X2.MOON:X2.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===Cc.DARK?Cc.LIGHT:Cc.DARK),"data-testid":"toggle-dark-mode"})},X2={SUN:kc("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:kc("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:kc("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:kc("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 q8}from"react";import{focusNearestParent as J8,KEYS as Q8}from"@orangecatai/common";import{jsx as j2,jsxs as eR}from"react/jsx-runtime";var q2=e=>{let{id:t}=Qe(),[o,n]=q8(e.value),r=i=>{e.ignoreFocus||J8(i.target);let s=i.target.value;s!==e.value&&e.onChange(s)},a=i=>{if(i.key===Q8.ENTER){if(i.preventDefault(),i.nativeEvent.isComposing||i.keyCode===229)return;i.currentTarget.blur()}};return eR("div",{className:"ProjectName",children:[j2("label",{className:"ProjectName-label",htmlFor:"filename",children:`${e.label}:`}),j2("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 PR,DEFAULT_FILENAME as AR,IMAGE_MIME_TYPES as gI,isFirefox as LR,MIME_TYPES as _R,cloneJSON as DR,SVG_DOCUMENT_PREAMBLE as RR}from"@orangecatai/common";import{getNonDeletedElements as NR}from"@orangecatai/element";import{isFrameLikeElement as BR}from"@orangecatai/element";import{getElementsOverlappingFrame as FR}from"@orangecatai/element";import{ALLOWED_PASTE_MIME_TYPES as pR,EXPORT_DATA_TYPES as Pc,MIME_TYPES as Lo,arrayToMap as uR,isMemberOf as gR,isPromiseLike as hR,EVENT as rp}from"@orangecatai/common";import{mutateElement as fR}from"@orangecatai/element";import{deepCopyElement as bR}from"@orangecatai/element";import{isFrameLikeElement as xR,isInitializedImageElement as yR}from"@orangecatai/element";import{getContainingFrame as lI}from"@orangecatai/element";import{pointFrom as Jr}from"@orangecatai/math";import{COLOR_PALETTE as Q2,DEFAULT_CHART_COLOR_INDEX as tR,getAllColorsSpecificShade as oR,DEFAULT_FONT_FAMILY as nR,DEFAULT_FONT_SIZE as eI,VERTICAL_ALIGN as rR,randomId as tI,isDevEnv as oI,FONT_SIZES as aR}from"@orangecatai/common";import{newTextElement as op,newLinearElement as Mc,newElement as Of}from"@orangecatai/element";var gn=32,Ke=12,Qr=256,nI=50,Ja="NOT_SPREADSHEET",Ms="VALID_SPREADSHEET",Sc=e=>{let t=/^([-+]?)[$€£¥₩]?([-+]?)([\d.,]+)[%]?$/.exec(e);return t?parseFloat(`${(t[1]||t[2])+t[3]}`.replace(/,/g,"")):null},Ff=(e,t)=>e.slice(1).every(o=>Sc(o[t])!==null),J2=e=>{let t=e[0].length;if(t>2)return{type:Ja,reason:"More than 2 columns"};if(t===1){if(!Ff(e,0))return{type:Ja,reason:"Value is not numeric"};let l=Sc(e[0][0])===null,c=(l?e.slice(1):e).map(m=>Sc(m[0]));return c.length<2?{type:Ja,reason:"Less than two rows"}:{type:Ms,spreadsheet:{title:l?e[0][0]:null,labels:null,values:c}}}let o=Ff(e,0),n=Ff(e,1);if(!o&&!n)return{type:Ja,reason:"Value is not numeric"};let[r,a]=n?[0,1]:[1,0],i=Sc(e[0][a])===null,s=i?e.slice(1):e;return s.length<2?{type:Ja,reason:"Less than 2 rows"}:{type:Ms,spreadsheet:{title:i?e[0][a]:null,labels:s.map(l=>l[r]),values:s.map(l=>Sc(l[a]))}}},iR=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},rI=e=>{let t=e.trim().split(`
|
|
1
|
+
import{$ as mh,A as ch,B as eL,C as iE,D as sE,E as rm,F as ql,G as am,H as im,I as Jl,J as lE,K as cE,L as dE,M as zr,N as Yi,O as mE,P as tL,Q as Ga,R as $i,S as Ql,U as pE,W as uE,X as gE,Y as sm,Z as hE,_ as dh,a as oE,aa as lm,b as Ha,ba as fE,c as Ln,ca as ph,d as nE,da as Ua,e as Ge,ea as bE,f as rE,fa as Vi,g as de,ga as xE,h as Hi,ha as So,i as _n,ia as uh,j as Kl,ja as yE,k as Xl,ka as cm,l as Gi,la as gh,m as Zl,ma as EE,n as Ui,na as wE,o as aE,oa as vE,p as sh,pa as ec,q as Dn,r as Ho,s as Or,t as ho,u as pr,v as Wi,w as om,x as lh,y as jl,z as nm}from"./chunk-WMOQJMH6.js";import{a as T}from"./chunk-3WJLWPNH.js";import{M as ih}from"./chunk-MSBJ7C4T.js";import{c as tE}from"./chunk-3PELD44J.js";import{b as Qy,c as eE,d as A}from"./chunk-SRAX5OIU.js";import uee,{useEffect as gee,useMemo as hee}from"react";import{DEFAULT_UI_OPTIONS as zA,isShallowEqual as fee}from"@orangecatai/common";import RP from"clsx";import Rj from"lodash.throttle";import cr,{useContext as Ba}from"react";import{flushSync as Io}from"react-dom";import Nj from"roughjs/bin/rough";import{nanoid as R1}from"nanoid";import{clamp as NP,pointFrom as pe,pointDistance as Pa,vector as BP,pointRotateRads as N1,vectorFromPoint as B1,vectorSubtract as FP,vectorDot as OP,vectorNormalize as zP}from"@orangecatai/math";import{COLOR_PALETTE as Bj,CODES as HP,shouldResizeFromCenter as GP,shouldMaintainAspectRatio as Dd,shouldRotateWithDiscreteAngle as UP,isArrowKey as Lg,KEYS as ne,APP_NAME as Fj,CURSOR_TYPE as lt,DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT as Oj,DEFAULT_VERTICAL_ALIGN as WP,DRAGGING_THRESHOLD as YP,ELEMENT_SHIFT_TRANSLATE_AMOUNT as zj,ELEMENT_TRANSLATE_AMOUNT as $P,EVENT as he,FRAME_STYLE as ln,IMAGE_MIME_TYPES as Hj,IMAGE_RENDER_TIMEOUT as Gj,LINE_CONFIRM_THRESHOLD as F1,MAX_ALLOWED_FILE_BYTES as VP,MIME_TYPES as rr,MQ_RIGHT_SIDEBAR_MIN_WIDTH as Uj,POINTER_BUTTON as Aa,ROUNDNESS as _g,SCROLL_TIMEOUT as Wj,TAP_TWICE_TIMEOUT as Yj,TEXT_TO_CENTER_SNAP_THRESHOLD as $j,THEME as Dg,TOUCH_CTX_MENU_TIMEOUT as Vj,VERTICAL_ALIGN as Kj,YOUTUBE_STATES as Rg,ZOOM_STEP as Xj,POINTER_EVENTS as Nl,TOOL_TYPE as ar,supportsResizeObserver as Zj,DEFAULT_COLLISION_THRESHOLD as KP,DEFAULT_TEXT_ALIGN as jj,ARROW_TYPE as La,DEFAULT_REDUCED_GLOBAL_ALPHA as qj,isLocalLink as Jj,normalizeLink as O1,toValidURL as Qj,getGridPoint as Jt,getLineHeight as XP,debounce as ZP,distance as Bl,getFontString as z1,getNearestScrollableContainer as eq,isInputLike as jP,isToolIcon as tq,isWritableElement as Rd,sceneCoordsToViewportCoords as Ng,tupleToCoors as H1,viewportCoordsToSceneCoords as rt,wrapEvent as oq,updateObject as G1,updateActiveTool as ir,isTransparent as nq,easeToValuesRAF as rq,muteFSAbortError as aq,isTestEnv as N6,isDevEnv as B6,easeOut as iq,updateStable as Nd,addEventListener as ht,normalizeEOL as sq,getDateTime as qP,isShallowEqual as JP,arrayToMap as Bg,applyDarkModeFilter as lq,randomInteger as cq,CLASSES as U1,Emitter as Ai,MINIMUM_ARROW_SIZE as dq,DOUBLE_TAP_POSITION_THRESHOLD as mq,BIND_MODE_TIMEOUT as pq,invariant as sr,getFeatureFlag as Rr,createUserAgentDescriptor as F6,getFormFactor as uq,deriveStylesPanelMode as Wg,isIOS as gq,isBrave as hq,isSafari as fq,loadDesktopUIModePreference as bq,setDesktopUIMode as xq,isSelectionLikeTool as Fg,oneOf as QP}from"@orangecatai/common";import{getObservedAppState as yq,getCommonBounds as Fl,getElementAbsoluteCoords as Og,bindOrUnbindBindingElements as e6,fixBindingsAfterDeletion as Eq,getHoveredElementForBinding as Cn,isBindingEnabled as Bd,shouldEnableBindingForPointerEvent as wq,updateBoundElements as zg,LinearElementEditor as _e,newElementWith as _a,newFrameElement as t6,newFreeDrawElement as vq,newEmbeddableElement as o6,newMagicFrameElement as n6,newIframeElement as Iq,newArrowElement as Tq,newElement as Cq,newImageElement as W1,newLinearElement as kq,newTextElement as r6,refreshTextDimensions as Sq,deepCopyElement as a6,duplicateElements as Y1,hasBoundTextElement as i6,isArrowElement as Ol,isBindingElement as lr,isBindingElementType as Mq,isBoundToContainer as $1,isFrameLikeElement as Qt,isImageElement as Da,isEmbeddableElement as Nr,isInitializedImageElement as Fd,isLinearElement as mo,isLinearElementType as Pq,isUsingAdaptiveRadius as Aq,isIframeElement as zl,isIframeLikeElement as V1,isMagicFrameElement as K1,isTextBindableContainer as s6,isElbowArrow as To,isFlowchartNodeElement as Lq,isBindableElement as X1,isTextElement as kn,getNormalizedDimensions as _q,isElementCompletelyInViewport as Z1,isElementInViewport as l6,isInvisiblySmallElement as c6,getCornerRadius as Dq,isPathALoop as d6,createSrcDoc as m6,embeddableURLValidator as j1,maybeParseEmbedSrc as Rq,getEmbedLink as Hg,getInitializedImageElements as Nq,normalizeSVG as p6,updateImageCache as Bq,getBoundTextElement as q1,getContainerCenter as J1,getContainerElement as u6,isValidTextContainer as Fq,redrawTextBoundingBox as Oq,hasBoundingBox as zq,getFrameChildren as Q1,isCursorInFrame as g6,addElementsToFrame as ey,replaceAllElementsInFrame as Hq,removeElementsFromFrame as Gq,getElementsInResizingFrame as ty,getElementsInNewFrame as Uq,getContainingFrame as oy,elementOverlapsWithFrame as Wq,updateFrameMembershipOfSelectedElements as h6,isElementInFrame as f6,getFrameLikeTitle as Yq,getElementsOverlappingFrame as $q,filterElementsEligibleAsFrameChildren as Vq,hitElementBoundText as Kq,hitElementBoundingBoxOnly as Xq,hitElementItself as Od,getVisibleSceneBounds as Zq,FlowChartCreator as jq,FlowChartNavigator as qq,getLinkDirectionFromKey as b6,cropElement as Jq,wrapText as Qq,isElementLink as ny,parseElementLinkFromURL as eJ,isMeasureTextSupported as tJ,normalizeText as oJ,measureText as x6,getLineHeightInPx as nJ,getApproxMinLineWidth as rJ,getApproxMinLineHeight as aJ,getMinTextElementWidth as iJ,ShapeCache as zd,getRenderOpacity as sJ,editGroupForSelectedElement as lJ,getElementsInGroup as Li,getSelectedGroupIdForElement as cJ,getSelectedGroupIds as dJ,isElementInGroup as y6,isSelectedViaGroup as mJ,selectGroupsForSelectedElements as cn,syncInvalidIndices as O6,syncMovedIndices as E6,excludeElementsInFramesFromSelection as pJ,getSelectionStateForElements as uJ,makeNextSelectedElementIds as ze,getResizeOffsetXY as gJ,getResizeArrowDirection as hJ,transformElements as fJ,getCursorForResizingElement as w6,getElementWithTransformHandleType as v6,getTransformHandleTypeFromCoords as I6,dragNewElement as T6,dragSelectedElements as bJ,getDragOffsetXY as xJ,isNonDeletedElement as C6,Scene as k6,Store as yJ,CaptureUpdateAction as po,hitElementBoundingBox as EJ,isLineElement as ry,isSimpleArrow as ay,StoreDelta as S6,positionElementsOnGrid as M6,calculateFixedPointForNonElbowArrowBinding as P6,bindOrUnbindBindingElement as wJ,mutateElement as Gg,getElementBounds as A6,doBoundsIntersect as vJ,isPointInElement as IJ,maxBindingDistance_simple as iy,convertToExcalidrawElements as L6,getSnapOutlineMidPoint as sy,handleFocusPointDrag as TJ,handleFocusPointHover as CJ,handleFocusPointPointerDown as kJ,handleFocusPointPointerUp as SJ,maybeHandleArrowPointlikeDrag as Ug,getUncroppedWidthAndHeight as MJ}from"@orangecatai/element";import{KEYS as Hh,MOBILE_ACTION_BUTTON_BG as gL,updateActiveTool as hL}from"@orangecatai/common";import{getNonDeletedElements as Gh}from"@orangecatai/element";import{fixBindingsAfterDeletion as fL}from"@orangecatai/element";import{LinearElementEditor as vv}from"@orangecatai/element";import{newElementWith as Pm}from"@orangecatai/element";import{getContainerElement as Iv}from"@orangecatai/element";import{isBoundToContainer as Sm,isElbowArrow as bL,isFrameLikeElement as xL}from"@orangecatai/element";import{getFrameChildren as yL}from"@orangecatai/element";import{getElementsInGroup as Uh,selectGroupsForSelectedElements as EL}from"@orangecatai/element";import{CaptureUpdateAction as Mm}from"@orangecatai/element";import{isDevEnv as aL}from"@orangecatai/common";import{atom as Pe,createStore as oL}from"jotai";import{createIsolation as nL}from"jotai-scope";var IE=nL();var{useAtom:le,useSetAtom:Rn,useAtomValue:Ki,useStore:vee}=IE,TE=IE.Provider,Et=oL();var rL=Qy({"./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-RQF5X6GM.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 iL=85,Nn={code:"en",label:"English"},Zi=[Nn,...[{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=>tE[e.code]>=iL).sort((e,t)=>e.label>t.label?1:-1)],mm="__test__";aL()&&Zi.unshift({code:mm,label:"test language"},{code:`${mm}.rtl`,label:"\u202Atest language (rtl)\u202C",rtl:!0});var Xi=Nn,dm={},pm=async e=>{if(Xi=e,document.documentElement.dir=Xi.rtl?"rtl":"ltr",document.documentElement.lang=Xi.code,e.code.startsWith(mm))dm={};else try{dm=await rL(`./locales/${Xi.code}.json`)}catch(t){console.error(`Failed to load language ${e.code}:`,t.message),dm=ih}Et.set(kE,e.code)},ur=()=>Xi,CE=(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},f=(e,t,o)=>{if(Xi.code.startsWith(mm))return`\u202A[[${t?`${e}(${JSON.stringify(t).slice(1,-1)})`:e}]]\u202C`;let n=e.split("."),r=CE(dm,n)||CE(ih,n)||o;if(r===void 0){let a=`Can't find translation for ${e}`;if(T.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},kE=Pe(Nn.code),Ue=()=>{let e=Ki(kE);return{t:f,langCode:e}};import sL from"clsx";import _t from"react";import{THEME as lL}from"@orangecatai/common";import{Fragment as We,jsx as b,jsxs as H}from"react/jsx-runtime";var pn=e=>"var(--icon-fill-color)",SE=e=>e===lL.LIGHT?"#fff":"#1e1e1e",R=(e,t=512)=>{let{width:o=512,height:n=o,mirror:r,style:a,...i}=typeof t=="number"?{width:t}:t;return b("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:`0 0 ${o} ${n}`,className:sL({"rtl-mirror":r}),style:a,...i,children:typeof e=="string"?b("path",{fill:"currentColor",d:e}):e})},K={width:24,height:24,fill:"none",strokeWidth:2,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},Ee={width:20,height:20,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},Fee=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("rect",{x:3,y:8,width:18,height:4,rx:1}),b("line",{x1:12,y1:8,x2:12,y2:21}),b("path",{d:"M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7"}),b("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"})]}),K),um=R(H("g",{strokeWidth:"1.25",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),b("path",{d:"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),b("line",{x1:"3",y1:"6",x2:"3",y2:"19"}),b("line",{x1:"12",y1:"6",x2:"12",y2:"19"}),b("line",{x1:"21",y1:"6",x2:"21",y2:"19"})]}),K),ME=R(H("svg",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),b("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),K),PE=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("circle",{cx:"12",cy:"12",r:"1"}),b("circle",{cx:"12",cy:"19",r:"1"}),b("circle",{cx:"12",cy:"5",r:"1"})]}),K),AE=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),b("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),b("path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]}),K),LE=R(H("svg",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M9 4v6l-2 4v2h10v-2l-2 -4v-6"}),b("line",{x1:"12",y1:"16",x2:"12",y2:"21"}),b("line",{x1:"8",y1:"4",x2:"16",y2:"4"})]}),K),hh=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M6.5 9.5l3.5 -3"}),b("path",{d:"M14 5.5l3 1.5"}),b("path",{d:"M18.5 10l-2.5 7"}),b("path",{d:"M13.5 17.5l-7 -5"})]}),K),Wa=R(H("g",{children:[b("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"}),b("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"}),b("mask",{id:"UnlockedIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:6,y:1,width:9,height:9,children:b("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"})}),b("g",{mask:"url(#UnlockedIcon)",children:b("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"})})]}),Ee),ji=R(H("g",{strokeWidth:"1.25",children:[b("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"}),b("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z"}),b("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"})]}),Ee),_E=R(b("g",{fill:"currentColor",children:b("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}),DE=R(H(We,{children:[b("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"}),b("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z",fill:"currentColor"}),b("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"}),RE=R(H(We,{children:[b("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"}),b("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m72.181 59.247-13.058-10-2.948 13.62 16.006-3.62Z",fill:"currentColor"}),b("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"}),NE=R(H(We,{children:[b("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"}),b("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m24.165 1.093-2.132 16.309 13.27-4.258-11.138-12.05Z",fill:"currentColor"}),b("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"}),Oee=R(b("g",{fill:"currentColor",children:b("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"}),Ya=R(H("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M13.5 13.5l4.5 4.5"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),Hr=R(H("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,children:[b("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"}),b("path",{d:"M5 15m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M5 17c0 1.42 .316 2.805 1 4"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),qi=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})]}),K),Ji=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"})]}),K),Qi=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("circle",{cx:"12",cy:"12",r:"9"})]}),K),gm=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),b("line",{x1:"15",y1:"16",x2:"19",y2:"12"}),b("line",{x1:"15",y1:"8",x2:"19",y2:"12"})]}),K),es=R(b("path",{d:"M4.167 10h11.666",strokeWidth:"1.5"}),Ee),BE=R(H("g",{strokeWidth:"1.25",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z"}),b("path",{d:"M16 7h4"}),b("path",{d:"M18 19h-13a2 2 0 1 1 0 -4h4a2 2 0 1 0 0 -4h-3"})]}),K),Bn=R(H("g",{strokeWidth:"1.25",children:[b("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"}),b("path",{d:"m11.25 5.417 3.333 3.333"})]}),Ee),Fn=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"4",y1:"20",x2:"7",y2:"20"}),b("line",{x1:"14",y1:"20",x2:"21",y2:"20"}),b("line",{x1:"6.9",y1:"15",x2:"13.8",y2:"15"}),b("line",{x1:"10.2",y1:"6.3",x2:"16",y2:"20"}),b("polyline",{points:"5 20 11 4 13 4 20 20"})]}),K),FE=R(H("g",{stroke:"currentColor",strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M3 7v-2h13v2"}),b("path",{d:"M10 5v14"}),b("path",{d:"M12 19h-4"}),b("path",{d:"M15 13v-1h6v1"}),b("path",{d:"M18 12v7"}),b("path",{d:"M17 19h2"})]}),K),ts=R(H("g",{strokeWidth:"1.25",children:[b("path",{d:"M12.5 6.667h.01"}),b("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"}),b("path",{d:"m3.333 12.5 3.334-3.333c.773-.745 1.726-.745 2.5 0l4.166 4.166"}),b("path",{d:"m11.667 11.667.833-.834c.774-.744 1.726-.744 2.5 0l1.667 1.667"})]}),Ee),hm=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M18 13.3l-6.3 -6.3"})]}),K),fh=R(b("path",{strokeWidth:"1.25",d:"M10 4.167v11.666M4.167 10h11.666"}),Ee),bh=R(b("path",{d:"M5 10h10",strokeWidth:"1.25"}),Ee),OE=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M21 21l-6 -6"}),b("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"}),b("path",{d:"M3 4v4h4"})]}),K),Ut=R(b("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"}),Ee),os=R(H("g",{strokeWidth:"1.5",children:[b("polyline",{points:"12 16 18 10 12 4"}),b("polyline",{points:"8 4 2 10 8 16"})]}),Ee),tc=R(H("g",{strokeWidth:"1.25",children:[b("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"}),b("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"})]}),Ee),oc=R(b("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"}),Ee),nc=R(b("g",{stroke:"currentColor",strokeLinejoin:"round",children:b("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"})}),{...Ee,strokeWidth:1.5}),zE=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),b("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),b("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]}),K),$a=R(b("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"}),Ee),ns=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("circle",{cx:"12",cy:"12",r:"9"}),b("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),b("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),K),HE=R(H("g",{strokeWidth:"1.25",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("circle",{cx:"12",cy:"12",r:"9"}),b("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),b("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),K),xh=R(b("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"}),Ee),fm=R(b("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"}),Ee),GE=R(H("g",{strokeWidth:"1.25",children:[b("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"}),b("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"})]}),Ee),UE=R(H("g",{strokeWidth:"1.25",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M4 4l11.733 16h4.267l-11.733 -16z"}),b("path",{d:"M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"})]}),K),bm=R(b("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),rc=R(H("g",{strokeWidth:"1.25",children:[b("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"}),b("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"})]}),Ee),WE=R("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}),YE=R("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}),rs=R(b("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"}),Ee),zee=R("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}),Hee=R("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"),xm=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M5 16l1.465 1.638a2 2 0 1 1 -3.015 .099l1.55 -1.737z"}),b("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"}),b("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"})]}),K),$E=R(b("g",{strokeWidth:1.5,children:b("path",{d:"M6 18l12 -12"})}),K),ym=R(H("g",{strokeWidth:"1.25",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M15 8h.01"}),b("path",{d:"M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5"}),b("path",{d:"M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4"}),b("path",{d:"M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598"}),b("path",{d:"M19 16v6"}),b("path",{d:"M22 19l-3 3l-3 -3"})]}),K),VE=R("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}),Gee=R("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}),Uee=R("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}),KE=R("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"),Wee=R("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"),yh=R(b("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"}),Ee),Eh=R(b("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"}),Ee),XE=R("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}),ZE=R(b("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"}),Ee),Yee=R("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"),$ee=R("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}),Vee=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M12 14v-11"}),b("path",{d:"M9 6l3 -3l3 3"})]}),K),Kee=R(H(We,{children:[b("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"}),b("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}),Xee=R(b("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}),jE=H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M12 10l0 10"}),b("path",{d:"M12 10l4 4"}),b("path",{d:"M12 10l-4 4"}),b("path",{d:"M4 4l16 0"})]}),qE=H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M12 5l0 14"}),b("path",{d:"M16 9l-4 -4"}),b("path",{d:"M8 9l4 -4"})]}),wh=R(qE,K),vh=R(qE,{...K,style:{transform:"rotate(180deg)"}}),Ih=R(jE,K),Th=R(jE,{...K,style:{transform:"rotate(180deg)"}}),Ch=R(H(We,{children:[H("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[b("path",{d:"M3.333 3.333h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),b("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"})]}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),kh=R(H(We,{children:[H("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[b("path",{d:"M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),b("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"})]}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),Sh=R(H(We,{children:[H("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[b("path",{d:"M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),b("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"})]}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),Mh=R(H(We,{children:[H("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[b("path",{d:"M16.667 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),b("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"})]}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),JE=R(H(We,{children:[H("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[b("path",{d:"M16.667 3.333v13.334M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),b("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"})]}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),QE=R(H(We,{children:[H("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[b("path",{d:"M3.333 3.333h13.334M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),b("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"})]}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),Ph=R(H("g",{stroke:"currentColor",strokeWidth:"1.25",children:[b("path",{d:"M1.667 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),b("path",{d:"M8.333 10h3.334",strokeLinejoin:"round"}),b("path",{d:"M15.417 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),b("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"})]}),Ee),Ah=R(H("g",{stroke:"currentColor",strokeWidth:"1.25",children:[b("path",{d:"M10 18.333v-2.916",strokeLinecap:"round",strokeLinejoin:"round"}),b("path",{d:"M10 11.667V8.333",strokeLinejoin:"round"}),b("path",{d:"M10 4.583V1.667",strokeLinecap:"round",strokeLinejoin:"round"}),b("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"})]}),Ee),Em=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("circle",{cx:"9",cy:"7",r:"4"}),b("path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"}),b("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}),b("path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85"})]}),K),Zee=R("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"),ew=R("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"),Go=R(H(We,{children:[b("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:b("path",{d:"M15 5 5 15M5 5l10 10"})}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),jee=R("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}),qee=R("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}),Jee=R("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}),Lh=_t.memo(({theme:e})=>R(H(We,{children:[b("path",{d:"M25 26H111V111H25",fill:pn(e)}),b("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:pn(e),strokeWidth:"2"}),b("path",{d:"M100 100H160V160H100",fill:pn(e)}),b("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:pn(e),strokeWidth:"2"}),H("g",{fill:SE(e),stroke:pn(e),strokeWidth:"6",children:[b("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),b("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),b("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),b("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),_h=_t.memo(({theme:e})=>R(H(We,{children:[b("path",{d:"M25 26H111V111H25",fill:pn(e)}),b("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:pn(e),strokeWidth:"2"}),b("path",{d:"M100 100H160V160H100",fill:pn(e)}),b("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:pn(e),strokeWidth:"2"}),H("g",{fill:SE(e),stroke:pn(e),strokeWidth:"6",children:[b("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),b("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),b("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),b("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),b("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),b("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),tw=R(b("g",{strokeWidth:1.25,children:b("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"})}),Ee),ow=R(H(We,{children:[b("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"}),b("mask",{id:"FillHachureIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:2,y:2,width:16,height:16,children:b("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"})}),b("g",{mask:"url(#FillHachureIcon)",children:b("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"})})]}),Ee),nw=R(H(We,{children:[H("g",{clipPath:"url(#a)",children:[b("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"}),b("mask",{id:"FillCrossHatchIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:-1,y:-1,width:22,height:22,children:b("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"})}),b("g",{mask:"url(#FillCrossHatchIcon)",children:b("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"})})]}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),rw=R(H(We,{children:[b("g",{clipPath:"url(#a)",children:b("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"})}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),{...Ee,fill:"currentColor"}),Dh=R(b(We,{children:b("path",{d:"M4.167 10h11.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),Ee),aw=R(b("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),Ee),iw=R(b("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"3.75",strokeLinecap:"round",strokeLinejoin:"round"}),Ee),Qee=_t.memo(({theme:e})=>R(b("path",{d:"M6 10H34",stroke:pn(e),strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})),sw=R(H("g",{strokeWidth:"2",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M5 12h2"}),b("path",{d:"M17 12h2"}),b("path",{d:"M11 12h2"})]}),K),lw=R(H("g",{strokeWidth:"2",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M4 12v.01"}),b("path",{d:"M8 12v.01"}),b("path",{d:"M12 12v.01"}),b("path",{d:"M16 12v.01"}),b("path",{d:"M20 12v.01"})]}),K),cw=R(b("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"}),Ee),dw=R(b("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"}),Ee),mw=R(b("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"}),Ee),pw=R(H("svg",{strokeWidth:"1.5",children:[b("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"}),b("path",{d:"M13.3333 3.33331V3.34331"}),b("path",{d:"M16.6667 3.33331V3.34331"}),b("path",{d:"M16.6667 6.66669V6.67669"}),b("path",{d:"M16.6667 10V10.01"}),b("path",{d:"M3.33334 13.3333V13.3433"}),b("path",{d:"M16.6667 13.3333V13.3433"}),b("path",{d:"M3.33334 16.6667V16.6767"}),b("path",{d:"M6.66666 16.6667V16.6767"}),b("path",{d:"M10 16.6667V16.6767"}),b("path",{d:"M13.3333 16.6667V16.6767"}),b("path",{d:"M16.6667 16.6667V16.6767"})]}),Ee),uw=R(H("g",{strokeWidth:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M4 12v-4a4 4 0 0 1 4 -4h4"}),b("line",{x1:"16",y1:"4",x2:"16",y2:"4.01"}),b("line",{x1:"20",y1:"4",x2:"20",y2:"4.01"}),b("line",{x1:"20",y1:"8",x2:"20",y2:"8.01"}),b("line",{x1:"20",y1:"12",x2:"20",y2:"12.01"}),b("line",{x1:"4",y1:"16",x2:"4",y2:"16.01"}),b("line",{x1:"20",y1:"16",x2:"20",y2:"16.01"}),b("line",{x1:"4",y1:"20",x2:"4",y2:"20.01"}),b("line",{x1:"8",y1:"20",x2:"8",y2:"20.01"}),b("line",{x1:"12",y1:"20",x2:"12",y2:"20.01"}),b("line",{x1:"16",y1:"20",x2:"16",y2:"20.01"}),b("line",{x1:"20",y1:"20",x2:"20",y2:"20.01"})]}),K),gw=_t.memo(({flip:e=!1})=>R(H("g",{transform:e?"translate(24, 0) scale(-1, 1)":"",stroke:"currentColor",opacity:.3,strokeWidth:2,children:[b("path",{d:"M12 12l-9 0"}),b("path",{d:"M21 9l-6 6"}),b("path",{d:"M21 15l-6 -6"})]}),K)),hw=_t.memo(({flip:e=!1})=>R(H("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",strokeWidth:2,fill:"none",children:[b("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),b("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})),fw=_t.memo(({flip:e=!1})=>R(H("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[b("path",{d:"M32 10L6 10",strokeWidth:2}),b("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),bw=_t.memo(({flip:e=!1})=>R(H("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,children:[b("path",{d:"M26 10L6 10"}),b("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),xw=_t.memo(({flip:e=!1})=>R(b("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",children:b("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"currentColor",strokeWidth:2,fill:"none"})}),{width:40,height:20})),yw=_t.memo(({flip:e=!1})=>R(H("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[b("path",{d:"M32 10L6 10",strokeWidth:2}),b("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})),Ew=_t.memo(({flip:e=!1})=>R(H("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,strokeLinejoin:"round",children:[b("path",{d:"M6,9.5H27"}),b("path",{d:"M27,5L34,10L27,14Z",fill:"none"})]}),{width:40,height:20})),ww=_t.memo(({flip:e=!1})=>R(H("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[b("path",{d:"M6,9.5H20"}),b("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),vw=_t.memo(({flip:e=!1})=>R(H("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[b("path",{d:"M6,9.5H20"}),b("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),Iw=_t.memo(({flip:e=!1})=>R(b("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:b("path",{d:"M34,10 H6 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),Tw=_t.memo(({flip:e=!1})=>R(b("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:b("path",{d:"M34,10 H6 M15,10 L15,15 L15,5"})}),{width:40,height:20})),Cw=_t.memo(({flip:e=!1})=>R(b("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:b("path",{d:"M34,10 H6 M15,10 L15,16 L15,4 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),kw=R(H(We,{children:[b("g",{clipPath:"url(#a)",children:b("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"})}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),Sw=R(H(We,{children:[b("g",{clipPath:"url(#a)",children:b("path",{d:"M5 16.667V3.333L10 15l5-11.667v13.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),Mw=R(H(We,{children:[b("g",{clipPath:"url(#a)",children:b("path",{d:"M5.833 3.333v13.334h8.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),b("defs",{children:b("clipPath",{id:"a",children:b("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ee),Pw=R(b(We,{children:b("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"})}),Ee),Va=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M3 7v-2h13v2"}),b("path",{d:"M10 5v14"}),b("path",{d:"M12 19h-4"}),b("path",{d:"M15 13v-1h6v1"}),b("path",{d:"M18 12v7"}),b("path",{d:"M17 19h2"})]}),K),Aw=R(b(We,{children:H("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M7 12h10"}),b("path",{d:"M7 5v14"}),b("path",{d:"M17 5v14"}),b("path",{d:"M15 19h4"}),b("path",{d:"M15 5h4"}),b("path",{d:"M5 19h4"}),b("path",{d:"M5 5h4"})]})}),K),ac=R(b(We,{children:b("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:b("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"})})}),Ee),Rh=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M7 8l-4 4l4 4"}),b("path",{d:"M17 8l4 4l-4 4"}),b("path",{d:"M14 4l-4 16"})]}),K),wm=Rh,Lw=R(H("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),b("line",{x1:"4",y1:"12",x2:"12",y2:"12"}),b("line",{x1:"4",y1:"16",x2:"16",y2:"16"})]}),K),_w=R(H("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),b("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),b("line",{x1:"6",y1:"16",x2:"18",y2:"16"})]}),K),Dw=R(H("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),b("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),b("line",{x1:"8",y1:"16",x2:"20",y2:"16"})]}),K),Rw=_t.memo(({theme:e})=>R(H("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"4",y1:"4",x2:"20",y2:"4"}),b("rect",{x:"9",y:"8",width:"6",height:"12",rx:"2"})]}),K)),Nw=_t.memo(({theme:e})=>R(H("g",{strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"4",y1:"20",x2:"20",y2:"20"}),b("rect",{x:"9",y:"4",width:"6",height:"12",rx:"2"})]}),K)),Bw=_t.memo(({theme:e})=>R(H("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("line",{x1:"4",y1:"12",x2:"9",y2:"12"}),b("line",{x1:"15",y1:"12",x2:"20",y2:"12"}),b("rect",{x:"9",y:"6",width:"6",height:"12",rx:"2"})]}),K)),vm=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M21 19h-18l9 -15"}),b("path",{d:"M20.615 15.171h.015"}),b("path",{d:"M19.515 11.771h.015"}),b("path",{d:"M17.715 8.671h.015"}),b("path",{d:"M15.415 5.971h.015"})]}),K),Fw=R(b("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}),ete=R(b("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"})),as=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5"}),b("path",{d:"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5"}),b("path",{d:"M14 5.5a1.5 1.5 0 0 1 3 0v6.5"}),b("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"})]}),K),Nh=R(H(We,{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),b("path",{d:"M7 11l5 5l5 -5"}),b("path",{d:"M12 4l0 12"})]}),K),is=R(H(We,{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"})]}),K),Ow=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M7 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),b("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),b("path",{d:"M9.15 14.85l8.85 -10.85"}),b("path",{d:"M6 4l8.85 10.85"})]}),K),zw=R(H(We,{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),b("path",{d:"M12 17l0 .01"}),b("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),K),tte=R(H(We,{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M7 4v16l13 -8z"})]}),K),ote=R(H(We,{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"})]}),K),Hw=R(H(We,{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M5 12l5 5l10 -10"})]}),K),Im=R(H(We,{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M12 9v4"}),b("path",{d:"M12 17h.01"})]}),K),Gw=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M11 7l6 6"}),b("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"})]}),K),ic=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M12 3l-4 7h8z"}),b("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),b("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"})]}),K),On=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M4 7l16 0"}),b("path",{d:"M4 17l16 0"}),b("path",{d:"M7 4l0 16"}),b("path",{d:"M17 4l0 16"})]}),K),Uw=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),b("circle",{cx:"8.5",cy:"8.5",r:"1.5",fill:"currentColor",stroke:"none"}),b("path",{d:"M3 16l5-5c.928-.893 2.072-.893 3 0l5 5"}),b("path",{d:"M14 14l1-1c.928-.893 2.072-.893 3 0l3 3"}),b("path",{d:"M17.5 4.5l0 3m-1.5-1.5l3 0",strokeWidth:"1.5",strokeLinecap:"round"})]}),K),ss=R(b("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"})),Ww=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"}),b("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"})]}),K),Yw=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M6 10l-2 1l8 4l8 -4l-2 -1"}),b("path",{d:"M4 15l8 4l8 -4"}),b("path",{d:"M12 4v7"}),b("path",{d:"M15 8l-3 3l-3 -3"})]}),K),Gr=R(H("g",{strokeWidth:"1.25",children:[b("path",{d:"M4.16602 10H15.8327"}),b("path",{d:"M12.5 13.3333L15.8333 10"}),b("path",{d:"M12.5 6.66666L15.8333 9.99999"})]}),Ee),zn=R(H("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",transform:"rotate(90 10 10)",children:[b("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"}),b("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),Ka=R(H("g",{stroke:"currentColor",fill:"none",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z"}),b("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),b("path",{d:"M15 6l3 3"}),b("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"}),b("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"})]}),K),nte=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z"}),b("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),b("path",{d:"M15 6l3 3"}),b("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"}),b("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"})]}),K),rte=R(H("g",{stroke:"currentColor",fill:"none",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M11.217 19.384a3.501 3.501 0 0 0 6.783 -1.217v-5.167l-6 -3.35"}),b("path",{d:"M5.214 15.014a3.501 3.501 0 0 0 4.446 5.266l4.34 -2.534v-6.946"}),b("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"}),b("path",{d:"M12.783 4.616a3.501 3.501 0 0 0 -6.783 1.217v5.067l6 3.45"}),b("path",{d:"M18.786 8.986a3.501 3.501 0 0 0 -4.446 -5.266l-4.34 2.534v6.946"}),b("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"})]}),K),$w=R(H("g",{stroke:"currentColor",fill:"none",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2"}),b("path",{d:"M4 16v2a2 2 0 0 0 2 2h2"}),b("path",{d:"M16 4h2a2 2 0 0 1 2 2v2"}),b("path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2"})]}),K),ls=R(H("g",{stroke:"currentColor",fill:"none",strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"}),b("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"})]}),K),Vw=R(H("g",{stroke:"currentColor",fill:"none",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828"}),b("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"}),b("path",{d:"M3 3l18 18"})]}),K),Kw=R(H("g",{stroke:"currentColor",fill:"none",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("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"}),b("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),b("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),b("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),b("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),K),Xw=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("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"}),b("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),b("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),b("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),b("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),K),Mo=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),b("path",{d:"M21 21l-6 -6"})]}),K),Zw=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M20.984 12.53a9 9 0 1 0 -7.552 8.355"}),b("path",{d:"M12 7v5l3 3"}),b("path",{d:"M19 16l-2 3h4l-2 3"})]}),K),jw=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M12 8l0 4l2 2"}),b("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})]}),K),qw=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M5 10a7 7 0 0 0 14 0"}),b("path",{d:"M8 21l8 0"}),b("path",{d:"M12 17l0 4"})]}),K),Jw=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M3 3l18 18"}),b("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"}),b("path",{d:"M5 10a7 7 0 0 0 10.846 5.85m2 -2a6.967 6.967 0 0 0 1.152 -3.85"}),b("path",{d:"M8 21l8 0"}),b("path",{d:"M12 17l0 4"})]}),K),sc=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11"})]}),K),Qw=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M12 20v.01"}),b("path",{d:"M16 20v.01"}),b("path",{d:"M8 20v.01"}),b("path",{d:"M4 20v.01"}),b("path",{d:"M4 16v.01"}),b("path",{d:"M4 12v.01"}),b("path",{d:"M4 8v.01"}),b("path",{d:"M4 4v.01"}),b("path",{d:"M8 4v.01"}),b("path",{d:"M12 4v.01"}),b("path",{d:"M16 4v.01"}),b("path",{d:"M20 4v.01"}),b("path",{d:"M20 8v.01"}),b("path",{d:"M20 12v.01"}),b("path",{d:"M20 16v.01"}),b("path",{d:"M20 20v.01"})]}),K),ev=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M5 3v18"}),b("path",{d:"M19 21v-18"}),b("path",{d:"M5 7h14"}),b("path",{d:"M5 15h14"}),b("path",{d:"M8 13v4"}),b("path",{d:"M11 13v4"}),b("path",{d:"M16 13v4"}),b("path",{d:"M14 5v4"}),b("path",{d:"M11 5v4"}),b("path",{d:"M8 5v4"}),b("path",{d:"M3 21h18"})]}),K),tv=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M3 12l18 0"}),b("path",{d:"M7 16l10 0l-10 5l0 -5"}),b("path",{d:"M7 8l10 0l-10 -5l0 5"})]}),K),ov=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M12 3l0 18"}),b("path",{d:"M16 7l0 10l5 0l-5 -10"}),b("path",{d:"M8 7l0 10l-5 0l5 -10"})]}),K),Bh=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M19 6h1a2 2 0 0 1 2 2a5 5 0 0 1 -5 5l-5 0v2"}),b("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"})]}),K),cs=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0"}),b("path",{d:"M22 22l-3 -3"}),b("path",{d:"M6 18h-1a2 2 0 0 1 -2 -2v-1"}),b("path",{d:"M3 11v-1"}),b("path",{d:"M3 6v-1a2 2 0 0 1 2 -2h1"}),b("path",{d:"M10 3h1"}),b("path",{d:"M15 3h1a2 2 0 0 1 2 2v1"})]}),K),nv=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),b("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),b("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"}),b("path",{d:"M10 15l2 6l2 -6"}),b("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"})]}),K),rv=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),b("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),b("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"}),b("path",{d:"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"}),b("path",{d:"M11 21v-6l3 6v-6"})]}),K),av=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M4 8l5 0"}),b("path",{d:"M15 8l4 0"})]}),K),iv=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),b("path",{d:"M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),b("path",{d:"M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z"}),b("path",{d:"M16.746 16.726a3 3 0 1 0 .252 -5.555"})]}),K),sv=R(H("g",{stroke:"currentColor",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"})]}),{...K,strokeWidth:1.5}),ate=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M21 12h-13l3 -3"}),b("path",{d:"M11 15l-3 -3"})]}),K),lv=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M10 9l5 3l-5 3z"})]}),K),cv=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M3 6h18"}),b("path",{d:"M3 12h18"}),b("path",{d:"M3 18h18"}),b("path",{d:"M6 3v18"}),b("path",{d:"M12 3v18"}),b("path",{d:"M18 3v18"})]}),K),dv=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("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"}),b("path",{d:"M17 5c-6.627 0 -12 5.373 -12 12"})]}),K),ds=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M6 18l12 -12"}),b("path",{d:"M18 10v-4h-4"})]}),K),ms=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7"}),b("path",{d:"M18 4l3 3l-3 3"})]}),K),ps=R(H("g",{children:[b("path",{d:"M16,12L20,9L16,6"}),b("path",{d:"M6 20c0 -6.075 4.925 -11 11 -11h3"})]}),K),Tm=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M6 9l6 6l6 -6"})]}),K),mv=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M6 15l6 -6l6 6"})]}),K),pv=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M6 15l6 -6l6 6"})]}),K),Fh=R(H("g",{strokeWidth:"1.25",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M8 5v10a1 1 0 0 0 1 1h10"}),b("path",{d:"M5 8h10a1 1 0 0 1 1 1v10"})]}),K),Cm=R(H("g",{children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M5 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M19 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M5 7l0 10"}),b("path",{d:"M7 5l10 0"}),b("path",{d:"M7 19l10 0"}),b("path",{d:"M19 7l0 10"})]}),K),ite=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M4 12h7a1 1 0 0 1 1 1v7"})]}),K),uv=R(H("g",{strokeWidth:1.5,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M4 6l8 0"}),b("path",{d:"M16 6l4 0"}),b("path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M4 12l2 0"}),b("path",{d:"M10 12l10 0"}),b("path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M4 18l11 0"}),b("path",{d:"M19 18l1 0"})]}),K),gv=R(H("g",{strokeWidth:1,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M6 10l4 -4 L6 14l8 -8 L6 18l12 -12 L10 18l8 -8 L14 18l4 -4"})]}),K),hv=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"}),b("path",{d:"M13.5 6.5l4 4"})]}),K),ste=R(H("g",{strokeWidth:1,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M11 7l-5 5l5 5"}),b("path",{d:"M17 7l-5 5l5 5"})]}),K),fv=R(H("g",{strokeWidth:"1.75",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"}),b("path",{d:"M15 4l0 16"})]}),K),lte=R(H("g",{strokeWidth:"1.25",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("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"})]}),K),cte=R(H("g",{strokeWidth:"1.25",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M3 4l18 0"}),b("path",{d:"M4 4v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-10"}),b("path",{d:"M12 16l0 4"}),b("path",{d:"M9 20l6 0"}),b("path",{d:"M8 12l3 -3l2 2l3 -3"})]}),K),bv=b("div",{style:{width:"1rem",height:"1rem"}}),xv=R(H("g",{strokeWidth:"1.5",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("polyline",{points:"9 6 15 12 9 18"})]}),K),yv=R(H("g",{strokeWidth:1.25,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),b("path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M4 6l8 0"}),b("path",{d:"M16 6l4 0"}),b("path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M4 12l2 0"}),b("path",{d:"M10 12l10 0"}),b("path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),b("path",{d:"M4 18l11 0"}),b("path",{d:"M19 18l1 0"})]}),K);import Ev from"clsx";import zh,{useEffect as mL,useRef as wv,useState as pL}from"react";import{isPromiseLike as uL}from"@orangecatai/common";import cL from"react";import{jsx as Oh}from"react/jsx-runtime";var dL=({size:e="1em",circleWidth:t=8,synchronized:o=!1,className:n=""})=>{let a=-(cL.useRef(Date.now()).current%1600);return Oh("div",{className:`Spinner ${n}`,children:Oh("svg",{viewBox:"0 0 100 100",style:{width:e,height:e,"--spinner-delay":o?`${a}ms`:0},children:Oh("circle",{cx:"50",cy:"50",r:50-t/2,strokeWidth:t,fill:"none",strokeMiterlimit:"10"})})})},Wt=dL;import{jsx as lc,jsxs as cc}from"react/jsx-runtime";var ae=zh.forwardRef(({size:e="medium",visible:t=!0,className:o="",...n},r)=>{let{id:a}=Qe(),i=zh.useRef(null);zh.useImperativeHandle(r,()=>i.current);let s=`ToolIcon_size_${e}`,[l,c]=pL(!1),m=wv(!0),p=async u=>{let h="onClick"in n&&n.onClick?.(u);if(uL(h))try{c(!0),await h}catch(g){if(g instanceof Ui)console.warn(g);else throw g}finally{m.current&&c(!1)}};mL(()=>(m.current=!0,()=>{m.current=!1}),[]);let d=wv(null);if(n.type==="button"||n.type==="icon"||n.type==="submit"){let u=n.type==="icon"?"button":n.type;return cc("button",{className:Ev("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)&&cc("div",{className:"ToolIcon__icon","aria-hidden":"true","aria-disabled":!!n.disabled,children:[n.icon||n.label,n.keyBindingLabel&&lc("span",{className:"ToolIcon__keybinding",children:n.keyBindingLabel}),n.isLoading&&lc(Wt,{})]}),n.showAriaLabel&&cc("div",{className:"ToolIcon__label",children:[n["aria-label"]," ",l&&lc(Wt,{})]}),n.children]})}return cc("label",{className:Ev("ToolIcon",o),title:n.title,onPointerDown:u=>{d.current=u.pointerType||null,n.onPointerDown?.({pointerType:u.pointerType||null})},onPointerUp:()=>{requestAnimationFrame(()=>{d.current=null})},children:[lc("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}),cc("div",{className:"ToolIcon__icon",children:[n.icon,n.keyBindingLabel&&lc("span",{className:"ToolIcon__keybinding",children:n.keyBindingLabel})]})]})});ae.displayName="ToolButton";var km=[],W=e=>(km=km.concat(e),e);import{jsx as vL}from"react/jsx-runtime";var wL=(e,t,o)=>{let n=new Set(de(e.filter(m=>xL(m)),t).map(m=>m.id)),r={},a=o.scene.getNonDeletedElementsMap(),i=new Set;for(let m of n){let p=yL(e,m);for(let d of p)if(!i.has(d.id)){if(Sm(d)){let u=Iv(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=Sm(m)?Iv(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&&bL(u)&&o.scene.mutateElement(u,{startBinding:m.id===u.startBinding?.elementId?null:u.startBinding,endBinding:m.id===u.endBinding?.elementId?null:u.endBinding})}),Pm(m,{isDeleted:!0}))}return m.frameId&&n.has(m.frameId)?(s=!1,Sm(m)||(r[m.id]=!0),Pm(m,{frameId:null})):Sm(m)&&t.selectedElementIds[m.containerId]?Pm(m,{isDeleted:!0}):m}),c=t.editingGroupId;if(s&&t.editingGroupId){let m=Uh(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=Uh(l,u).filter(g=>!g.isDeleted);h.length>1&&(c=u,h.forEach(g=>{r[g.id]=!0}))}}}}return{elements:l,appState:{...t,...EL({selectedElementIds:r,editingGroupId:c},l,t,null)}}},Tv=(e,t)=>{if(e.editingGroupId){let o=Uh(Gh(t),e.editingGroupId);if(o.length)return{...e,selectedElementIds:{[o[0].id]:!0}}}return e},dc=W({name:"deleteSelectedElements",label:"labels.delete",icon:Ut,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=vv.getElement(i,l);if(!c||s==null)return!1;if(s.length>=c.points.length){let m=e.map(d=>d.id===c.id?Pm(d,{isDeleted:!0}):d),p=Tv(t,m);return{elements:m,appState:{...p,selectedLinearElement:null},captureUpdate:Mm.IMMEDIATELY}}return vv.deletePoints(c,n,s),{elements:e,appState:{...t,selectedLinearElement:{...t.selectedLinearElement,selectedPointsIndices:s?.[0]>0?[s[0]-1]:[0]}},captureUpdate:Mm.IMMEDIATELY}}let{elements:r,appState:a}=wL(e,t,n);return fL(r,r.filter(i=>i.isDeleted)),a=Tv(a,r),{elements:r,appState:{...a,activeTool:hL(t,{type:n.state.preferredSelectionTool.type}),multiElement:null,newElement:null,activeEmbeddable:null,selectedLinearElement:null},captureUpdate:Ge(Gh(e),t)?Mm.IMMEDIATELY:Mm.EVENTUALLY}},keyTest:(e,t,o)=>(e.key===Hh.BACKSPACE||e.key===Hh.DELETE)&&!e[Hh.CTRL_OR_CMD],PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=Dt()==="mobile";return vL(ae,{type:"button",icon:Ut,title:f("labels.delete"),"aria-label":f("labels.delete"),onClick:()=>o(null),disabled:!Ge(Gh(e),t),style:{...r&&t.openPopup!=="compactOtherProperties"?gL:{}}})}});import{KEYS as us,CODES as gs,isDarwin as Am}from"@orangecatai/common";import{moveOneLeft as IL,moveOneRight as TL,moveAllLeft as CL,moveAllRight as kL}from"@orangecatai/element";import{CaptureUpdateAction as Lm}from"@orangecatai/element";import{isDarwin as Cv}from"@orangecatai/common";var G=e=>e.replace(/\b(Opt(?:ion)?|Alt)\b/i,Cv?f("keys.option"):f("keys.alt")).replace(/\bShift\b/i,f("keys.shift")).replace(/\b(Enter|Return)\b/i,f("keys.enter")).replace(/\b(Ctrl|Cmd|Command|CtrlOrCmd)\b/gi,Cv?f("keys.cmd"):f("keys.ctrl")).replace(/\b(Esc(?:ape)?)\b/i,f("keys.escape")).replace(/\b(Space(?:bar)?)\b/i,f("keys.spacebar")).replace(/\b(Del(?:ete)?)\b/i,f("keys.delete"));import{jsx as _m}from"react/jsx-runtime";var Wh=W({name:"sendBackward",label:"labels.sendBackward",keywords:["move down","zindex","layer"],icon:vh,trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:IL(e,t,n.scene),appState:t,captureUpdate:Lm.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[us.CTRL_OR_CMD]&&!e.shiftKey&&e.code===gs.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>_m("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${f("labels.sendBackward")} \u2014 ${G("CtrlOrCmd+[")}`,children:vh})}),Yh=W({name:"bringForward",label:"labels.bringForward",keywords:["move up","zindex","layer"],icon:wh,trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:TL(e,t,n.scene),appState:t,captureUpdate:Lm.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[us.CTRL_OR_CMD]&&!e.shiftKey&&e.code===gs.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>_m("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${f("labels.bringForward")} \u2014 ${G("CtrlOrCmd+]")}`,children:wh})}),$h=W({name:"sendToBack",label:"labels.sendToBack",keywords:["move down","zindex","layer"],icon:Th,trackEvent:{category:"element"},perform:(e,t)=>({elements:CL(e,t),appState:t,captureUpdate:Lm.IMMEDIATELY}),keyTest:e=>Am?e[us.CTRL_OR_CMD]&&e.altKey&&e.code===gs.BRACKET_LEFT:e[us.CTRL_OR_CMD]&&e.shiftKey&&e.code===gs.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>_m("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${f("labels.sendToBack")} \u2014 ${Am?G("CtrlOrCmd+Alt+["):G("CtrlOrCmd+Shift+[")}`,children:Th})}),Vh=W({name:"bringToFront",label:"labels.bringToFront",keywords:["move up","zindex","layer"],icon:Ih,trackEvent:{category:"element"},perform:(e,t)=>({elements:kL(e,t),appState:t,captureUpdate:Lm.IMMEDIATELY}),keyTest:e=>Am?e[us.CTRL_OR_CMD]&&e.altKey&&e.code===gs.BRACKET_RIGHT:e[us.CTRL_OR_CMD]&&e.shiftKey&&e.code===gs.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>_m("button",{type:"button",className:"zIndexButton",onClick:o=>e(null),title:`${f("labels.bringToFront")} \u2014 ${Am?G("CtrlOrCmd+Alt+]"):G("CtrlOrCmd+Shift+]")}`,children:Ih})});import{getNonDeletedElements as SL}from"@orangecatai/element";import{LinearElementEditor as ML}from"@orangecatai/element";import{isLinearElement as PL,isTextElement as AL}from"@orangecatai/element";import{arrayToMap as LL,KEYS as kv}from"@orangecatai/common";import{selectGroupsForSelectedElements as _L}from"@orangecatai/element";import{CaptureUpdateAction as DL}from"@orangecatai/element";var Kh=W({name:"selectAll",label:"labels.selectAll",icon:Qw,trackEvent:{category:"canvas"},viewMode:!1,perform:(e,t,o,n)=>{if(t.selectedLinearElement?.isEditing)return!1;let r=e.filter(a=>!a.isDeleted&&!(AL(a)&&a.containerId)&&!a.locked).reduce((a,i)=>(a[i.id]=!0,a),{});return{appState:{...t,..._L({editingGroupId:null,selectedElementIds:r},SL(e),t,n),selectedLinearElement:Object.keys(r).length===1&&PL(e[0])?new ML(e[0],LL(e)):null},captureUpdate:DL.IMMEDIATELY}},keyTest:e=>e[kv.CTRL_OR_CMD]&&e.key===kv.A});import{DEFAULT_GRID_SIZE as Sv,KEYS as Mv,MOBILE_ACTION_BUTTON_BG as RL,arrayToMap as Pv}from"@orangecatai/common";import{getNonDeletedElements as Av}from"@orangecatai/element";import{LinearElementEditor as NL}from"@orangecatai/element";import{getSelectedElements as BL,getSelectionStateForElements as FL}from"@orangecatai/element";import{syncMovedIndices as OL}from"@orangecatai/element";import{duplicateElements as zL}from"@orangecatai/element";import{CaptureUpdateAction as Lv}from"@orangecatai/element";import{jsx as HL}from"react/jsx-runtime";var Xh=W({name:"duplicateSelection",label:"labels.duplicateSelection",icon:tc,trackEvent:{category:"element"},perform:(e,t,o,n)=>{if(t.selectedElementsAreBeingDragged)return!1;if(t.selectedLinearElement?.isEditing)try{let i=NL.duplicateSelectedPoints(t,n.scene);return{elements:e,appState:i,captureUpdate:Lv.IMMEDIATELY}}catch{return!1}let{duplicatedElements:r,elementsWithDuplicates:a}=zL({type:"in-place",elements:e,idsOfElementsToDuplicate:Pv(BL(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+Sv/2,y:i.y+Sv/2,frameId:l??i.frameId}}});if(n.props.onDuplicate&&a){let i=n.props.onDuplicate(a,e);i&&(a=i)}return{elements:OL(a,Pv(r)),appState:{...t,...FL(r,Av(a),t)},captureUpdate:Lv.IMMEDIATELY}},keyTest:e=>e[Mv.CTRL_OR_CMD]&&e.key===Mv.D,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=Dt()==="mobile";return HL(ae,{type:"button",icon:tc,title:`${f("labels.duplicateSelection")} \u2014 ${G("CtrlOrCmd+D")}`,"aria-label":f("labels.duplicateSelection"),onClick:()=>o(null),disabled:!Ge(Av(e),t),style:{...r&&t.openPopup!=="compactOtherProperties"?RL:{}}})}});import{pointFrom as GD}from"@orangecatai/math";import{useEffect as xf,useMemo as UD,useRef as yf,useState as WD}from"react";import{DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE as YD,DEFAULT_ELEMENT_BACKGROUND_PICKS as $D,DEFAULT_ELEMENT_STROKE_COLOR_PALETTE as VD,DEFAULT_ELEMENT_STROKE_PICKS as KD,ARROW_TYPE as Vo,DEFAULT_FONT_FAMILY as XD,DEFAULT_FONT_SIZE as ZD,FONT_FAMILY as jD,ROUNDNESS as Zm,STROKE_WIDTH as Ef,VERTICAL_ALIGN as Km,KEYS as vs,randomInteger as qD,arrayToMap as vf,getFontFamilyString as JD,getLineHeight as QD,isTransparent as e8,reduceToCommonValue as t8,invariant as If,FONT_SIZES as Xm}from"@orangecatai/common";import{canBecomePolygon as o8,getNonDeletedElements as w2}from"@orangecatai/element";import{bindBindingElement as b2,calculateFixedPointForElbowArrowBinding as x2,updateBoundElements as n8}from"@orangecatai/element";import{LinearElementEditor as ja}from"@orangecatai/element";import{newElementWith as kt}from"@orangecatai/element";import{getBoundTextElement as qr,redrawTextBoundingBox as vc}from"@orangecatai/element";import{isArrowElement as jm,isBoundToContainer as r8,isElbowArrow as v2,isLinearElement as wf,isLineElement as y2,isTextElement as fo,isUsingAdaptiveRadius as a8}from"@orangecatai/element";import{hasStrokeColor as i8}from"@orangecatai/element";import{updateElbowArrowPoints as s8,CaptureUpdateAction as St,toggleLinePolygonState as l8}from"@orangecatai/element";import{deriveStylesPanelMode as c8}from"@orangecatai/common";import{isDevEnv as GL}from"@orangecatai/common";var UL=new Set(["command_palette","export"]),be=(e,t,o,n)=>{try{if(typeof window>"u"||T.VITE_WORKER_ID||T.VITE_APP_ENABLE_TRACKING!=="true"||!UL.has(e)||GL())return;T.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 VL from"clsx";import WL from"clsx";import{forwardRef as YL}from"react";import{jsx as $L}from"react/jsx-runtime";var hs=YL((e,t)=>{let{title:o,className:n,testId:r,active:a,standalone:i,icon:s,onClick:l}=e;return $L("button",{type:"button",ref:t,title:o,"data-testid":r,className:WL(n,{standalone:i,active:a}),onClick:l,style:e.style,children:s},o)});import{Fragment as XL,jsx as Zh,jsxs as KL}from"react/jsx-runtime";var Uo=e=>Zh(XL,{children:e.options.map(t=>e.type==="button"?Zh(hs,{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):KL("label",{className:VL({active:e.value===t.value}),title:t.text,children:[Zh("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 qv}from"radix-ui";import Jv from"clsx";import{useRef as Qv,useEffect as j_}from"react";import{COLOR_OUTLINE_CONTRAST_THRESHOLD as Zv,COLOR_PALETTE as e2,isColorDark as jv,isWritableElement as q_}from"@orangecatai/common";import{jsx as ZL}from"react/jsx-runtime";var Dm=()=>ZL("div",{style:{width:1,height:"1rem",backgroundColor:"var(--default-border-color)",margin:"0 auto"}});import{useEffect as e_,useRef as t_}from"react";import{createPortal as o_}from"react-dom";import{EVENT as Wr,KEYS as n_,rgbToHex as r_}from"@orangecatai/common";import _v from"react";var jh=_v.createContext(null),Ie=()=>_v.useContext(jh);import{useState as jL,useLayoutEffect as Dv}from"react";import{THEME as qL}from"@orangecatai/common";var Rm=e=>{let[t,o]=jL(null),n=Te(),{theme:r}=Ie(),{container:a}=Qe();return Dv(()=>{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===qL.DARK))},[t,r,n.formFactor,e?.className]),Dv(()=>{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 JL}from"react";import{EVENT as Nm}from"@orangecatai/common";function fs(e,t,o){JL(()=>{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(Nm.POINTER_DOWN,n),document.addEventListener(Nm.TOUCH_START,n),()=>{document.removeEventListener(Nm.POINTER_DOWN,n),document.removeEventListener(Nm.TOUCH_START,n)}},[e,t,o])}import{useRef as QL}from"react";var Ur=e=>{let t=QL(e);return Object.assign(t.current,e),t.current};import{jsx as a_}from"react/jsx-runtime";var Yr=Pe(null),Rv=({onCancel:e,onChange:t,onSelect:o,colorPickerType:n})=>{let r=Rm({className:"excalidraw-eye-dropper-backdrop",parentSelector:".excalidraw-eye-dropper-container"}),a=Ie(),i=$r(),s=tt(),l=de(i,a),c=Ur({app:s,onCancel:e,onChange:t,onSelect:o,selectedElements:l}),{container:m}=Qe();e_(()=>{let d=p.current;if(!d||!s.canvas||!r)return;let u=!1,h=s.canvas.getContext("2d"),g=({clientX:C,clientY:P})=>{let S=h.getImageData((C-a.offsetLeft)*window.devicePixelRatio,(P-a.offsetTop)*window.devicePixelRatio,1,1).data;return r_(S[0],S[1],S[2])},x=({clientX:C,clientY:P,altKey:S})=>{d.style.top=`${P+20}px`,d.style.left=`${C+20}px`;let D=g({clientX:C,clientY:P});u&&c.onChange(n,D,c.selectedElements,{altKey:S}),d.style.background=D},E=()=>{c.onCancel()},y=(C,P)=>{c.onSelect(C,P)},w=C=>{u=!0,C.stopImmediatePropagation()},v=C=>{u=!1,m?.focus(),C.stopImmediatePropagation(),C.preventDefault(),y(g(C),C)},I=C=>{C.key===n_.ESCAPE&&(C.preventDefault(),C.stopImmediatePropagation(),E())};return r.tabIndex=-1,r.focus(),x({clientX:c.app.lastViewportPosition.x,clientY:c.app.lastViewportPosition.y,altKey:!1}),r.addEventListener(Wr.KEYDOWN,I),r.addEventListener(Wr.POINTER_DOWN,w),r.addEventListener(Wr.POINTER_UP,v),window.addEventListener("pointermove",x,{passive:!0}),window.addEventListener(Wr.BLUR,E),()=>{u=!1,r.removeEventListener(Wr.KEYDOWN,I),r.removeEventListener(Wr.POINTER_DOWN,w),r.removeEventListener(Wr.POINTER_UP,v),window.removeEventListener("pointermove",x),window.removeEventListener(Wr.BLUR,E)}},[c,s.canvas,r,n,m,a.offsetLeft,a.offsetTop]);let p=t_(null);return fs(p,()=>{e()},d=>!!d.target.closest(".excalidraw-eye-dropper-trigger, .excalidraw-eye-dropper-backdrop")),r?o_(a_("div",{ref:p,className:"excalidraw-eye-dropper-preview"}),r):null};import{Popover as qh}from"radix-ui";import c_ from"clsx";import d_ from"react";import{isInteractive as m_}from"@orangecatai/common";import i_ from"react";import s_ from"clsx";import{jsx as l_}from"react/jsx-runtime";var gt=i_.forwardRef(({children:e,padding:t,className:o,style:n},r)=>l_("div",{className:s_("Island",o),style:{"--padding":t,...n},ref:r,children:e}));import{jsx as Jh,jsxs as p_}from"react/jsx-runtime";var gr=d_.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=Te(),d=p.formFactor==="phone"&&!p.isLandscape;return Jh(qh.Portal,{container:t,children:p_(qh.Content,{ref:m,className:c_("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&&!m_(document.activeElement)&&t.focus(),r()},children:[Jh(gt,{padding:3,style:n,children:o}),Jh(qh.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 u_,useCallback as Qh}from"react";var Bm=()=>document.querySelector(".excalidraw-wysiwyg"),Fm=()=>{let e=Bm();return e?{start:e.selectionStart,end:e.selectionEnd}:null},mc=e=>{setTimeout(()=>{let t=Bm();t&&(t.focus(),e&&(t.selectionStart=e.start,t.selectionEnd=e.end))},0)},pc=(e,t,o,n)=>{t&&n&&n();let r=t&&o?Fm():null;e(),t&&o&&mc(r)},Nv=()=>{let[e,t]=u_(null),o=Qh(()=>{let a=Fm();t(a)},[]),n=Qh(()=>{setTimeout(()=>{let a=Bm();a&&(a.focus(),e&&(a.selectionStart=e.start,a.selectionEnd=e.end,t(null)))},0)},[e]),r=Qh(()=>{t(null)},[]);return{saveCaretPosition:o,restoreCaretPosition:n,clearSavedPosition:r,hasSavedPosition:!!e}},Bv=(e=100)=>{let t=Bm();if(t){let o=t.onblur;t.onblur=null,setTimeout(()=>{t.onblur=o},e)}};import h_ from"clsx";import{useCallback as f_,useEffect as tf,useRef as Ov,useState as b_}from"react";import{KEYS as of,normalizeInputColor as x_}from"@orangecatai/common";import{MAX_CUSTOM_COLORS_USED_IN_CANVAS as g_}from"@orangecatai/common";var Vr=({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},uc=[["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),ef=({color:e,palette:t})=>!Object.values(t).flat().includes(e),Fv=(e,t,o)=>{let n={elementBackground:"backgroundColor",elementStroke:"strokeColor"},r=e.filter(i=>{if(i.isDeleted)return!1;let s=i[n[t]];return ef({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,g_)},Wo=Pe(null);import{Fragment as y_,jsx as Om,jsxs as zv}from"react/jsx-runtime";var Hv=({color:e,onChange:t,label:o,colorPickerType:n,placeholder:r})=>{let a=Te(),[i,s]=b_(e),[l,c]=le(Wo);tf(()=>{s(e)},[e]);let m=f_(g=>{let x=g.toLowerCase(),E=x_(x);E&&t(E),s(x)},[t]),p=Ov(null),d=Ov(null);tf(()=>{p.current&&p.current.focus()},[l]);let[u,h]=le(Yr);return tf(()=>()=>{h(null)},[h]),zv("div",{className:"color-picker__input-label",children:[Om("div",{className:"color-picker__input-hash",children:"#"}),Om("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!==of.TAB&&(g.key===of.ESCAPE&&d.current?.focus(),g.stopPropagation())},placeholder:r}),a.formFactor!=="phone"&&zv(y_,{children:[Om("div",{style:{width:"1px",height:"1.25rem",backgroundColor:"var(--default-border-color)"}}),Om("div",{ref:d,className:h_("excalidraw-eye-dropper-trigger",{selected:u}),onClick:()=>h(g=>g?null:{keepOpenOnAlt:!1,onSelect:x=>t(x),colorPickerType:n}),title:`${f("labels.eyeDropper")} \u2014 ${of.I.toLocaleUpperCase()} or ${G("Alt")} `,children:Gw})]})]})};import sf,{useEffect as lf,useImperativeHandle as z_,useState as H_}from"react";import{EVENT as Vv}from"@orangecatai/common";import{DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX as G_,DEFAULT_ELEMENT_STROKE_COLOR_INDEX as U_,KEYS as W_}from"@orangecatai/common";import I_ from"clsx";import{useEffect as T_,useRef as C_}from"react";import{isColorDark as E_}from"@orangecatai/common";import{jsxs as v_}from"react/jsx-runtime";var w_=({color:e,keyLabel:t,isShade:o=!1})=>v_("div",{className:"color-picker__button__hotkey-label",style:{color:E_(e)?"#fff":"#000"},children:[o&&"\u21E7",t]}),bs=w_;import{jsx as nf,jsxs as k_}from"react/jsx-runtime";var Gv=({colors:e,color:t,onChange:o,label:n})=>{let[r,a]=le(Wo),i=C_(null);return T_(()=>{i.current&&i.current.focus()},[t,r]),nf("div",{className:"color-picker-content--default",children:e.map((s,l)=>k_("button",{ref:t===s?i:void 0,tabIndex:-1,type:"button",className:I_("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:[nf("div",{className:"color-picker__button-outline"}),nf(bs,{color:s,keyLabel:l+1})]},l))})};import S_ from"clsx";import{useEffect as M_,useRef as P_}from"react";import{jsx as rf,jsxs as L_}from"react/jsx-runtime";var A_=({palette:e,color:t,onChange:o,activeShade:n,showHotKey:r=!0})=>{let a=Vr({color:t,palette:e}),[i,s]=le(Wo),l=P_(null);return M_(()=>{l.current&&i==="baseColors"&&l.current.focus()},[a?.colorName,i]),rf("div",{className:"color-picker-content--default",children:Object.entries(e).map(([c,m],p)=>{let d=(Array.isArray(m)?m[n]:m)||"transparent",u=uc[p],h=f(`colors.${c.replace(/\d+/,"")}`,null,"");return L_("button",{ref:a?.colorName===c?l:void 0,tabIndex:-1,type:"button",className:S_("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:[rf("div",{className:"color-picker__button-outline"}),r&&rf(bs,{color:d,keyLabel:u})]},c)})})},Uv=A_;import{jsx as D_}from"react/jsx-runtime";var __=({children:e})=>D_("div",{className:"color-picker__heading",children:e}),xs=__;import R_ from"clsx";import{useEffect as N_,useRef as B_}from"react";import{jsx as gc,jsxs as Wv}from"react/jsx-runtime";var Yv=({color:e,onChange:t,palette:o,showHotKey:n})=>{let r=Vr({color:e||"transparent",palette:o}),[a,i]=le(Wo),s=B_(null);if(N_(()=>{s.current&&a==="shades"&&s.current.focus()},[r,a]),r){let{colorName:l,shade:c}=r,m=o[l];if(Array.isArray(m))return gc("div",{className:"color-picker-content--default shades",children:m.map((p,d)=>Wv("button",{ref:d===c&&a==="shades"?s:void 0,tabIndex:-1,type:"button",className:R_("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:[gc("div",{className:"color-picker__button-outline"}),n&&gc(bs,{color:p,keyLabel:d+1,isShade:!0})]},d))})}return Wv("div",{className:"color-picker-content--default",style:{position:"relative"},tabIndex:-1,children:[gc("button",{type:"button",tabIndex:-1,className:"color-picker__button color-picker__button--large color-picker__button--no-focus-visible"}),gc("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:f("colorPicker.noShades")})]})};import{COLORS_PER_ROW as ys,COLOR_PALETTE as F_,KEYS as hc}from"@orangecatai/common";var af=(e,t,o)=>{let n=Math.ceil(o/ys);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+ys;return r>=o?t%ys:r}case"ArrowUp":{let r=t-ys,a=r<0?ys*n+r:r;return a>=o?void 0:a}}},O_=({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(uc.includes(e.key)){let s=uc.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},$v=({event:e,activeColorPickerSection:t,palette:o,color:n,onChange:r,customColors:a,setActiveColorPickerSection:i,updateData:s,activeShade:l,onEyeDropperToggle:c,onEscape:m})=>{if(e[hc.CTRL_OR_CMD])return!1;if(e.key===hc.ESCAPE)return m(e),!0;if(e.key===hc.ALT)return c(!0),!0;if(e.key===hc.I)return c(),!0;let p=Vr({color:n,palette:o});if(e.key===hc.TAB){let d={custom:!!a.length,baseColors:!0,shades:p?.shade!=null,hex:!0},u=Object.entries(d).reduce((y,[w,v])=>(v&&y.push(w),y),[]),h=u.indexOf(t),g=e.shiftKey?-1:1,x=h+g>u.length-1?0:h+g<0?u.length-1:h+g,E=u[x];return E&&i(E),E==="custom"?r(a[0]):E==="baseColors"&&(Object.entries(o).find(([w,v])=>Array.isArray(v)?v.includes(n):v===n?w:null)||r(F_.black)),e.preventDefault(),e.stopPropagation(),!0}if(O_({e,colorObj:p,onChange:r,palette:o,customColors:a,setActiveColorPickerSection:i,activeShade:l}))return!0;if(t==="shades"&&p){let{shade:d}=p,u=af(e.key,d,ys);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=af(e.key,h,u.length);if(g!==void 0){let x=u[g],E=o[x];return r(Array.isArray(E)?E[l]:E),!0}}if(t==="custom"){let d=n!=null?a.indexOf(n):0,u=af(e.key,d,a.length);if(u!==void 0){let h=a[u];return r(h),!0}}return!1};import{jsx as Kr,jsxs as zm}from"react/jsx-runtime";var Kv=sf.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"?f("labels.stroke"):o==="elementBackground"?f("labels.background"):null:null,[u]=sf.useState(()=>o==="canvasBackground"?[]:Fv(n,o,r)),[h,g]=le(Wo),x=Vr({color:e,palette:r});lf(()=>{if(!h){let v=!!e&&ef({color:e,palette:r}),I=v&&!u.includes(e);g(I?null:v?"custom":x?.shade!=null?"shades":"baseColors")}},[h,e,r,g,x,u]);let[E,y]=H_(x?.shade??(o==="elementBackground"?G_:U_));lf(()=>{x?.shade!=null&&y(x.shade);let v=I=>{I.key===W_.ALT&&l(!1)};return document.addEventListener(Vv.KEYUP,v,{capture:!0}),()=>{document.removeEventListener(Vv.KEYUP,v,{capture:!0})}},[x,l]);let w=sf.useRef(null);return z_(p,()=>w.current),lf(()=>{w?.current?.focus()},[]),Kr("div",{role:"dialog","aria-modal":"true","aria-label":f("labels.colorPicker"),children:zm("div",{ref:w,onKeyDown:v=>{$v({event:v,activeColorPickerSection:h,palette:r,color:e,onChange:t,onEyeDropperToggle:l,customColors:u,setActiveColorPickerSection:g,updateData:a,activeShade:E,onEscape:c})&&(v.preventDefault(),v.stopPropagation())},className:"color-picker-content properties-content",tabIndex:-1,children:[d&&Kr("div",{className:"color-picker__title",children:d}),!!u.length&&zm("div",{children:[Kr(xs,{children:f("colorPicker.mostUsedCustomColors")}),Kr(Gv,{colors:u,color:e,label:f("colorPicker.mostUsedCustomColors"),onChange:t})]}),zm("div",{children:[Kr(xs,{children:f("colorPicker.colors")}),Kr(Uv,{color:e,palette:r,onChange:t,activeShade:E,showHotKey:m})]}),zm("div",{children:[Kr(xs,{children:f("colorPicker.shades")}),Kr(Yv,{color:e,onChange:t,palette:r,showHotKey:m})]}),i]})})});import Y_ from"clsx";import{COLOR_OUTLINE_CONTRAST_THRESHOLD as $_,DEFAULT_CANVAS_BACKGROUND_PICKS as V_,DEFAULT_ELEMENT_BACKGROUND_PICKS as K_,DEFAULT_ELEMENT_STROKE_PICKS as X_,isColorDark as Z_}from"@orangecatai/common";import{jsx as cf}from"react/jsx-runtime";var Xv=({onChange:e,type:t,activeColor:o,topPicks:n})=>{let r;return t==="elementStroke"&&(r=X_),t==="elementBackground"&&(r=K_),t==="canvasBackground"&&(r=V_),n&&(r=n),r?cf("div",{className:"color-picker__top-picks",children:r.map(a=>cf("button",{className:Y_("color-picker__button",{active:a===o,"is-transparent":a==="transparent"||!a,"has-outline":!Z_(a,$_)}),style:{"--swatch-color":a},type:"button",title:a,onClick:()=>e(a),"data-testid":`color-top-pick-${a}`,children:cf("div",{className:"color-picker__button-outline"})},a))}):(console.error("Invalid type for TopPicks"),null)};import{jsx as Yo,jsxs as Hm}from"react/jsx-runtime";var J_=({type:e,color:t,onChange:o,label:n,elements:r,palette:a=e2,updateData:i,getOpenPopup:s,appState:l})=>{let{container:c}=Qe(),m=Dt(),p=m!=="full",d=m==="mobile",[,u]=le(Wo),[h,g]=le(Yr),x=Hm("div",{children:[Yo(xs,{children:f("colorPicker.hexCode")}),Yo(Hv,{color:t||"",label:n,onChange:w=>{o(w)},colorPickerType:e,placeholder:f("colorPicker.color")})]}),E=Qv(null),y=()=>{E.current?.focus()};return Yo(gr,{container:c,style:{maxWidth:"13rem"},preventAutoFocusOnTouch:!!l.editingTextElement,onFocusOutside:w=>{q_(w.target)||y(),w.preventDefault()},onPointerDownOutside:w=>{h&&w.preventDefault()},onClose:()=>{s()===e&&i({openPopup:null}),u(null),l.editingTextElement&&setTimeout(()=>{let w=document.querySelector(".excalidraw-wysiwyg");w&&w.focus()},0)},children:a?Yo(Kv,{ref:E,palette:a,color:t,onChange:w=>{let v=l.editingTextElement?Fm():null;o(w),l.editingTextElement&&v&&mc(v)},onEyeDropperToggle:w=>{g(v=>w?(v=v||{keepOpenOnAlt:!0,onSelect:o,colorPickerType:e},v.keepOpenOnAlt=!0,v):w===!1||v?null:{keepOpenOnAlt:!1,onSelect:o,colorPickerType:e})},onEscape:w=>{h?g(null):i({openPopup:null})},type:e,elements:r,updateData:i,showTitle:p,showHotKey:!d,children:x}):x})},Q_=({label:e,color:t,type:o,mode:n="background",onToggle:r,editingTextElement:a})=>{let i=Dt(),s=i!=="full",l=i==="mobile",c=m=>{m.preventDefault(),m.stopPropagation(),a&&Bv(),r()};return Hm(qv.Trigger,{type:"button",className:Jv("color-picker__button active-color properties-trigger",{"is-transparent":!t||t==="transparent","has-outline":!t||!jv(t,Zv),"compact-sizing":s,"mobile-border":l}),"aria-label":e,style:t?{"--swatch-color":t}:void 0,title:o==="elementStroke"?f("labels.showStroke"):f("labels.showBackground"),"data-openpopup":o,onClick:c,children:[Yo("div",{className:"color-picker__button-outline",children:!t&&$E}),s&&t&&n==="stroke"&&Yo("div",{className:"color-picker__button-background",children:Yo("span",{style:{color:t&&jv(t,Zv)?"#fff":"#111"},children:gv})})]})},fc=({type:e,color:t,onChange:o,label:n,elements:r,palette:a=e2,topPicks:i,updateData:s,appState:l})=>{let c=Qv(l.openPopup);j_(()=>{c.current=l.openPopup},[l.openPopup]);let p=Dt()!=="full";return Yo("div",{children:Hm("div",{role:"dialog","aria-modal":"true",className:Jv("color-picker-container",{"color-picker-container--no-top-picks":p}),children:[!p&&Yo(Xv,{activeColor:t,onChange:o,type:e,topPicks:i}),!p&&Yo(Dm,{}),Hm(qv.Root,{open:l.openPopup===e,onOpenChange:d=>{d&&s({openPopup:e})},children:[Yo(Q_,{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&&Yo(J_,{type:e,color:t,onChange:o,label:n,elements:r,palette:a,updateData:s,getOpenPopup:()=>c.current,appState:l})]})]})})};import{Popover as SD}from"radix-ui";import MD from"clsx";import PD,{useCallback as AD,useMemo as LD}from"react";import{FONT_FAMILY as uf}from"@orangecatai/common";import bD,{useMemo as jr,useState as xD,useRef as r2,useEffect as a2,useCallback as i2,useSyncExternalStore as yD}from"react";import{arrayToList as ED,debounce as wD,FONT_FAMILY as Xa,getFontFamilyString as vD}from"@orangecatai/common";import eD from"clsx";import tD from"react";import{jsx as oD,jsxs as nD}from"react/jsx-runtime";var Gm=tD.forwardRef(({className:e,placeholder:t,onChange:o},n)=>nD("div",{className:eD("QuickSearch__wrapper",e),children:[Mo,oD("input",{ref:n,className:"QuickSearch__input",type:"text",placeholder:t,onChange:r=>o(r.target.value.trim().toLowerCase())})]}));import rD from"clsx";import{Children as aD}from"react";import{jsx as t2}from"react/jsx-runtime";var Um=({className:e,placeholder:t,children:o})=>{let n=!aD.count(o);return t2("div",{className:rD("ScrollableList__wrapper",e),role:"menu",children:n?t2("div",{className:"empty",children:t}):o})};import{jsx as iD,jsxs as sD}from"react/jsx-runtime";var o2=({children:e,className:t="",style:o,title:n})=>sD("div",{className:`dropdown-menu-group ${t}`,style:o,children:[n&&iD("p",{className:"dropdown-menu-group-title",children:n}),e]}),bc=o2;o2.displayName="DropdownMenuGroup";import{THEME as hD}from"@orangecatai/common";import{DropdownMenu as fD}from"radix-ui";import lD,{useContext as cD}from"react";import{composeEventHandlers as dD}from"@orangecatai/common";var df=lD.createContext({}),Xr=(e="",t=!1,o=!1)=>`dropdown-menu-item dropdown-menu-item-base ${e} ${t?"dropdown-menu-item--selected":""} ${o?"dropdown-menu-item--hovered":""}`.trim(),Wm=e=>{let t=cD(df);return dD(e,o=>{t.onSelect?.(o)})};import{jsx as mD}from"react/jsx-runtime";var xc=({children:e,...t})=>mD("span",{...t,style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",...t.style},children:e});import{Fragment as uD,jsx as yc,jsxs as gD}from"react/jsx-runtime";var pD=({textStyle:e,icon:t,shortcut:o,children:n,badge:r})=>{let a=Te();return gD(uD,{children:[t&&yc("div",{className:"dropdown-menu-item__icon",children:t}),yc("div",{style:e,className:"dropdown-menu-item__text",children:yc(xc,{children:n})}),r&&yc("div",{className:"dropdown-menu-item__badge",children:r}),o&&a.formFactor!=="phone"&&yc("div",{className:"dropdown-menu-item__shortcut",children:o})]})},Zr=pD;import{jsx as Ym}from"react/jsx-runtime";var mf=({icon:e,badge:t,value:o,children:n,shortcut:r,className:a,selected:i,onSelect:s,...l})=>{let c=Wm(s);return Ym(fD.Item,{className:"radix-menu-item",onSelect:c,asChild:!0,children:Ym("button",{...l,value:o,className:Xr(a,i),title:l.title??l["aria-label"],children:Ym(Zr,{icon:e,shortcut:r,badge:t,children:n})})})};mf.displayName="DropdownMenuItem";var Es={GREEN:"green",RED:"red",BLUE:"blue"},$m=({type:e=Es.BLUE,children:t})=>{let{theme:o}=$o(),n={display:"inline-flex",marginLeft:"auto",padding:"2px 4px",borderRadius:6,fontSize:9,fontFamily:"Cascadia, monospace",border:o===hD.LIGHT?"1.5px solid white":"none"};switch(e){case Es.GREEN:Object.assign(n,{backgroundColor:"var(--background-color-badge)",color:"var(--color-badge)"});break;case Es.RED:Object.assign(n,{backgroundColor:"pink",color:"darkred"});break;case Es.BLUE:default:Object.assign(n,{background:"var(--color-promo)",color:"var(--color-surface-lowest)"})}return Ym("div",{className:"DropDownMenuItemBadge",style:n,children:t})};$m.displayName="DropdownMenuItemBadge";mf.Badge=$m;var to=mf;import{KEYS as ws}from"@orangecatai/common";var n2=({event:e,inputRef:t,hoveredFont:o,filteredFonts:n,onClose:r,onSelect:a,onHover:i})=>{if(!e[ws.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===ws.F)return t.current?.focus(),!0;if(e.key===ws.ESCAPE)return r(),!0;if(e.key===ws.ENTER)return o?.value&&a(o.value),!0;if(e.key===ws.ARROW_DOWN)return o?.next?i(o.next.value):n[0]?.value&&i(n[0].value),!0;if(e.key===ws.ARROW_UP)return o?.prev?i(o.prev.value):n[n.length-1]?.value&&i(n[n.length-1].value),!0};import{jsx as hr,jsxs as TD}from"react/jsx-runtime";var ID=e=>{switch(e){case Xa.Excalifont:case Xa.Virgil:return Bn;case Xa.Nunito:case Xa.Helvetica:return ac;case Xa["Lilita One"]:return Aw;case Xa["Comic Shanns"]:case Xa.Cascadia:return wm;default:return ac}},s2=bD.memo(({selectedFontFamily:e,hoveredFontFamily:t,onSelect:o,onHover:n,onLeave:r,onOpen:a,onClose:i})=>{let{container:s}=Qe(),l=tt(),{fonts:c}=l,{showDeprecatedFonts:m}=Hn(),p=Dt(),[d,u]=xD(""),h=r2(null),g=yD(Ho.subscribeToCustomFonts,Ho.getCustomFontVersion),x=jr(()=>Array.from(Ho.registered.entries()).filter(([M,{metadata:B}])=>!B.private&&!B.fallback).map(([M,{metadata:B,fontFaces:O}])=>{let N={value:M,icon:ID(M),text:O[0]?.fontFace?.family??"Unknown"};return B.deprecated&&Object.assign(N,{deprecated:B.deprecated,badge:{type:Es.RED,placeholder:f("fontList.badge.old")}}),N}).sort((M,B)=>M.text.toLowerCase()>B.text.toLowerCase()?1:-1),[g]),E=jr(()=>new Set(c.getSceneFamilies()),[e]),y=jr(()=>x.filter(M=>E.has(M.value)),[x,E]),w=jr(()=>x.filter(M=>!E.has(M.value)&&(m||!M.deprecated)),[x,E,m]),v=jr(()=>ED([...y,...w].filter(M=>M.text?.toLowerCase().includes(d))),[y,w,d]),I=jr(()=>{let M;return t?M=v.find(B=>B.value===t):e&&(M=v.find(B=>B.value===e)),!M&&d&&(v[0]?.value?n(v[0].value):r()),M},[t,e,d,v,n,r]),C=i2(M=>{let B=null;if(l.state.editingTextElement){let O=document.querySelector(".excalidraw-wysiwyg");O&&(B={start:O.selectionStart,end:O.selectionEnd})}o(M),l.state.editingTextElement&&B&&setTimeout(()=>{let O=document.querySelector(".excalidraw-wysiwyg");O&&B&&(O.focus(),O.selectionStart=B.start,O.selectionEnd=B.end)},0)},[o,l.state.editingTextElement]),P=i2(M=>{n2({event:M,inputRef:h,hoveredFont:I,filteredFonts:v,onSelect:C,onHover:n,onClose:i})&&(M.preventDefault(),M.stopPropagation())},[I,v,C,n,i]);a2(()=>(a(),()=>{i()}),[]);let S=jr(()=>v.filter(M=>E.has(M.value)),[v,E]),D=jr(()=>v.filter(M=>!E.has(M.value)),[v,E]),_=({font:M,order:B})=>{let O=r2(null),N=M.value===I?.value,z=M.value===e;return a2(()=>{N&&(B===0?O.current?.scrollIntoView?.({block:"end"}):O.current?.scrollIntoView?.({block:"nearest"}))},[N,B]),hr("button",{ref:O,type:"button",value:M.value,className:Xr("",z,N),title:M.text,tabIndex:z?0:-1,onClick:L=>{C(Number(L.currentTarget.value))},onMouseMove:()=>{I?.value!==M.value&&n(M.value)},children:hr(Zr,{icon:M.icon,badge:M.badge&&hr($m,{type:M.badge.type,children:M.badge.placeholder}),textStyle:{fontFamily:vD({fontFamily:M.value})},children:M.text})})},k=[];return S.length&&k.push(hr(bc,{title:f("fontList.sceneFonts"),children:S.map((M,B)=>hr(_,{font:M,order:B},M.value))},"group_1")),D.length&&k.push(hr(bc,{title:f("fontList.availableFonts"),children:D.map((M,B)=>hr(_,{font:M,order:B+S.length},M.value))},"group_2")),TD(gr,{className:"properties-content",container:s,style:{width:"15rem"},onClose:()=>{i(),l.state.editingTextElement&&setTimeout(()=>{let M=document.querySelector(".excalidraw-wysiwyg");M&&M.focus()},0)},onPointerLeave:r,onKeyDown:P,preventAutoFocusOnTouch:!!l.state.editingTextElement,children:[p==="full"&&hr(Gm,{ref:h,placeholder:f("quickSearch.placeholder"),onChange:wD(u,20)}),hr(Um,{className:"dropdown-menu fonts manual-hover",placeholder:f("fontList.empty"),children:k.length?k:null})]})},(e,t)=>e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily);import{Popover as CD}from"radix-ui";import{MOBILE_ACTION_BUTTON_BG as kD}from"@orangecatai/common";import{jsx as pf}from"react/jsx-runtime";var l2=({selectedFontFamily:e,isOpened:t=!1,compactMode:o=!1})=>{let n=Ce(),r=o?{...kD,width:"2rem",height:"2rem"}:{};return pf(CD.Trigger,{asChild:!0,children:pf("div",{"data-openpopup":"fontFamily",className:"properties-trigger",children:pf(hs,{standalone:!0,icon:Fn,title:f("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 Ec,jsxs as c2}from"react/jsx-runtime";var d2=[{value:uf.Excalifont,icon:Bn,text:f("labels.handDrawn"),testId:"font-family-hand-drawn"},{value:uf.Nunito,icon:ac,text:f("labels.normal"),testId:"font-family-normal"},{value:uf["Comic Shanns"],icon:wm,text:f("labels.code"),testId:"font-family-code"}],yse=new Set(d2.map(e=>e.value));var m2=PD.memo(({isOpened:e,selectedFontFamily:t,hoveredFontFamily:o,onSelect:n,onHover:r,onLeave:a,onPopupChange:i,compactMode:s=!1})=>{let l=LD(()=>d2,[]),c=AD(m=>{m&&n(m)},[n]);return c2("div",{role:"dialog","aria-modal":"true",className:MD("FontPicker__container",{"FontPicker__container--compact":s}),children:[!s&&Ec("div",{className:"buttonList",children:Ec(Uo,{type:"button",options:l,value:t,onClick:c})}),!s&&Ec(Dm,{}),c2(SD.Root,{open:e,onOpenChange:i,children:[Ec(l2,{selectedFontFamily:t,isOpened:e,compactMode:s}),e&&Ec(s2,{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 gf}from"radix-ui";import ND from"clsx";import Vm,{useEffect as BD}from"react";import{isArrowKey as FD,KEYS as fr}from"@orangecatai/common";import{jsx as _D}from"react/jsx-runtime";var Gn=({className:e,icon:t,size:o="1em"})=>_D("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 RD,jsx as p2,jsxs as u2}from"react/jsx-runtime";var DD=({label:e,open:t,openTrigger:o,children:n,className:r,showCollapsedIcon:a=!0})=>u2(RD,{children:[u2("div",{style:{cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center"},className:r,onClick:o,children:[e,a&&p2(Gn,{icon:t?mv:Tm})]}),t&&p2("div",{style:{display:"flex",flexDirection:"column"},children:n})]}),wc=DD;import{jsx as Za,jsxs as hf}from"react/jsx-runtime";var OD=Pe(!1);function zD({options:e,value:t,label:o,onChange:n,onClose:r,numberOfOptionsToAlwaysShow:a=e.length}){let i=Te(),{container:s}=Qe(),l=g=>{let x=e.find(E=>E.keyBinding===g.key.toLowerCase());if(!(g.metaKey||g.altKey||g.ctrlKey)&&x)n(x.value),g.preventDefault();else if(g.key===fr.TAB){let E=e.findIndex(w=>w.value===t),y=g.shiftKey?(e.length+E-1)%e.length:(E+1)%e.length;n(e[y].value)}else if(FD(g.key)){let E=ur().rtl,y=e.findIndex(w=>w.value===t);if(y!==-1){let w=e.length,v=y;switch(g.key){case(E?fr.ARROW_LEFT:fr.ARROW_RIGHT):v=(y+1)%w;break;case(E?fr.ARROW_RIGHT:fr.ARROW_LEFT):v=(w+y-1)%w;break;case fr.ARROW_DOWN:{v=(y+(a??1))%w;break}case fr.ARROW_UP:{v=(w+y-(a??1))%w;break}}n(e[v].value)}g.preventDefault()}else(g.key===fr.ESCAPE||g.key===fr.ENTER)&&(g.preventDefault(),r());g.nativeEvent.stopImmediatePropagation(),g.stopPropagation()},[c,m]=le(OD),p=Vm.useMemo(()=>e.slice(0,a),[e,a]),d=Vm.useMemo(()=>e.slice(a),[e,a]);BD(()=>{p.some(g=>g.value===t)||m(!0)},[t,p,m]);let u=g=>Za("div",{className:"picker-content",children:g.map((x,E)=>hf("button",{type:"button",className:ND("picker-option",{active:t===x.value}),onClick:y=>{n(x.value)},title:`${x.text} ${x.keyBinding&&`\u2014 ${x.keyBinding.toUpperCase()}`}`,"aria-label":x.text||"none","aria-keyshortcuts":x.keyBinding||void 0,ref:y=>{t===x.value&&setTimeout(()=>{y?.focus()},0)},children:[x.icon,x.keyBinding&&Za("span",{className:"picker-keybinding",children:x.keyBinding})]},x.text))}),h=i.formFactor==="phone";return Za(gf.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:hf("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":o,children:[u(p),d.length>0&&Za(wc,{label:f("labels.more_options"),open:c,openTrigger:()=>{m(g=>!g)},className:"picker-collapsible",children:u(d)})]})})}function ff({value:e,label:t,options:o,onChange:n,group:r="",numberOfOptionsToAlwaysShow:a}){let[i,s]=Vm.useState(!1),l=Vm.useRef(null);return Za("div",{children:hf(gf.Root,{open:i,onOpenChange:c=>s(c),children:[Za(gf.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&&Za(zD,{options:o,value:e,label:t,onChange:n,onClose:()=>{s(!1)},numberOfOptionsToAlwaysShow:a})]})})}import g2,{useEffect as HD}from"react";import{jsx as bf,jsxs as h2}from"react/jsx-runtime";var f2=({updateData:e,app:t,testId:o})=>{let n=g2.useRef(null),r=g2.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 HD(()=>{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]),h2("label",{className:"control-label",children:[f("labels.opacity"),h2("div",{className:"range-wrapper",children:[bf("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}),bf("div",{className:"value-bubble",ref:r,children:c!==0?c:null}),bf("div",{className:"zero-label",children:"0"})]})]})};import{Fragment as Sf,jsx as ge,jsxs as no}from"react/jsx-runtime";var I2=.1,Is=e=>{let t=c8(e.editorInterface);return{stylesPanelMode:t,isCompact:t!=="full",isMobile:t==="mobile"}},oo=(e,t,o,n=!1)=>{let r=vf(de(e,t,{includeBoundTextElement:n}));return e.map(a=>r.get(a.id)||a.id===t.editingTextElement?.id?o(a):a)},Kt=function(e,t,o,n,r){let a=t.state.editingTextElement,i=w2(e),s=null;if(a&&(s=o(a)),!s)if(Ge(i,t.state)){let c=t.scene.getSelectedElements(t.state),m=n===!0?c:c.filter(p=>n(p));s=t8(m,o)??(typeof r=="function"?r(!0):r)}else s=typeof r=="function"?r(!1):r;return s},d8=(e,t,o)=>r8(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}),Tf=(e,t,o,n,r)=>{let a=new Set,i=oo(e,t,s=>{if(fo(s)){let l=n(s);a.add(l);let c=kt(s,{fontSize:l});return vc(c,o.scene.getContainerElement(s),o.scene),c=d8(s,c,o.scene),c}return s},!0);return de(e,t,{includeBoundTextElement:!0}).forEach(s=>{fo(s)&&n8(s,o.scene)}),{elements:i,appState:{...t,currentItemFontSize:a.size===1?[...a][0]:r??t.currentItemFontSize},captureUpdate:St.IMMEDIATELY}},m8=W({name:"changeStrokeColor",label:"labels.stroke",trackEvent:!1,perform:(e,t,o)=>({...o?.currentItemStrokeColor&&{elements:oo(e,t,n=>i8(n.type)?kt(n,{strokeColor:o.currentItemStrokeColor}):n,!0)},appState:{...t,...o},captureUpdate:o?.currentItemStrokeColor?St.IMMEDIATELY:St.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{stylesPanelMode:a}=Is(n);return no(Sf,{children:[a==="full"&&ge("h3",{"aria-hidden":"true",children:f("labels.stroke")}),ge(fc,{topPicks:KD,palette:VD,type:"elementStroke",label:f("labels.stroke"),color:Kt(e,n,i=>i.strokeColor,!0,i=>i?null:t.currentItemStrokeColor),onChange:i=>o({currentItemStrokeColor:i}),elements:e,appState:t,updateData:o})]})}}),p8=W({name:"changeBackgroundColor",label:"labels.changeBackground",trackEvent:!1,perform:(e,t,o,n)=>{if(!o?.currentItemBackgroundColor)return{appState:{...t,...o},captureUpdate:St.EVENTUALLY};let r,a=n.scene.getSelectedElements(t);if(!e8(o.currentItemBackgroundColor)&&a.every(s=>y2(s)&&o8(s.points))){let s=vf(a);r=e.map(l=>s.has(l.id)&&y2(l)?kt(l,{backgroundColor:o.currentItemBackgroundColor,...l8(l,!0)}):l)}else r=oo(e,t,s=>kt(s,{backgroundColor:o.currentItemBackgroundColor}));return{elements:r,appState:{...t,...o},captureUpdate:St.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{stylesPanelMode:a}=Is(n);return no(Sf,{children:[a==="full"&&ge("h3",{"aria-hidden":"true",children:f("labels.background")}),ge(fc,{topPicks:$D,palette:YD,type:"elementBackground",label:f("labels.background"),color:Kt(e,n,i=>i.backgroundColor,!0,i=>i?null:t.currentItemBackgroundColor),onChange:i=>o({currentItemBackgroundColor:i}),elements:e,appState:t,updateData:o})]})}}),u8=W({name:"changeFillStyle",label:"labels.fill",trackEvent:!1,perform:(e,t,o,n)=>(be("element","changeFillStyle",`${o} (${n.editorInterface.formFactor==="phone"?"mobile":"desktop"})`),{elements:oo(e,t,r=>kt(r,{fillStyle:o})),appState:{...t,currentItemFillStyle:o},captureUpdate:St.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=de(e,t),a=r.length>0&&r.every(i=>i.fillStyle==="zigzag");return no("fieldset",{children:[ge("legend",{children:f("labels.fill")}),ge("div",{className:"buttonList",children:ge(Uo,{type:"button",options:[{value:"hachure",text:`${a?f("labels.zigzag"):f("labels.hachure")} (${G("Alt-Click")})`,icon:a?tw:ow,active:a?!0:void 0,testId:"fill-hachure"},{value:"cross-hatch",text:f("labels.crossHatch"),icon:nw,testId:"fill-cross-hatch"},{value:"solid",text:f("labels.solid"),icon:rw,testId:"fill-solid"}],value:Kt(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)}})})]})}}),g8=W({name:"changeStrokeWidth",label:"labels.strokeWidth",trackEvent:!1,perform:(e,t,o)=>({elements:oo(e,t,n=>kt(n,{strokeWidth:o})),appState:{...t,currentItemStrokeWidth:o},captureUpdate:St.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>no("fieldset",{children:[ge("legend",{children:f("labels.strokeWidth")}),ge("div",{className:"buttonList",children:ge(Uo,{group:"stroke-width",options:[{value:Ef.thin,text:f("labels.thin"),icon:Dh,testId:"strokeWidth-thin"},{value:Ef.bold,text:f("labels.bold"),icon:aw,testId:"strokeWidth-bold"},{value:Ef.extraBold,text:f("labels.extraBold"),icon:iw,testId:"strokeWidth-extraBold"}],value:Kt(e,n,a=>a.strokeWidth,a=>a.hasOwnProperty("strokeWidth"),a=>a?null:t.currentItemStrokeWidth),onChange:a=>o(a)})})]})}),h8=W({name:"changeSloppiness",label:"labels.sloppiness",trackEvent:!1,perform:(e,t,o)=>({elements:oo(e,t,n=>kt(n,{seed:qD(),roughness:o})),appState:{...t,currentItemRoughness:o},captureUpdate:St.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>no("fieldset",{children:[ge("legend",{children:f("labels.sloppiness")}),ge("div",{className:"buttonList",children:ge(Uo,{group:"sloppiness",options:[{value:0,text:f("labels.architect"),icon:cw},{value:1,text:f("labels.artist"),icon:dw},{value:2,text:f("labels.cartoonist"),icon:mw}],value:Kt(e,n,a=>a.roughness,a=>a.hasOwnProperty("roughness"),a=>a?null:t.currentItemRoughness),onChange:a=>o(a)})})]})}),Tle=W({name:"changeStrokeStyle",label:"labels.strokeStyle",trackEvent:!1,perform:(e,t,o)=>({elements:oo(e,t,n=>kt(n,{strokeStyle:o})),appState:{...t,currentItemStrokeStyle:o},captureUpdate:St.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>no("fieldset",{children:[ge("legend",{children:f("labels.strokeStyle")}),ge("div",{className:"buttonList",children:ge(Uo,{group:"strokeStyle",options:[{value:"solid",text:f("labels.strokeStyle_solid"),icon:Dh},{value:"dashed",text:f("labels.strokeStyle_dashed"),icon:sw},{value:"dotted",text:f("labels.strokeStyle_dotted"),icon:lw}],value:Kt(e,n,a=>a.strokeStyle,a=>a.hasOwnProperty("strokeStyle"),a=>a?null:t.currentItemStrokeStyle),onChange:a=>o(a)})})]})}),f8=W({name:"changeOpacity",label:"labels.opacity",trackEvent:!1,perform:(e,t,o)=>({elements:oo(e,t,n=>kt(n,{opacity:o}),!0),appState:{...t,currentItemOpacity:o},captureUpdate:St.IMMEDIATELY}),PanelComponent:({app:e,updateData:t})=>ge(f2,{updateData:t,app:e,testId:"opacity"})}),b8=W({name:"changeFontSize",label:"labels.fontSize",trackEvent:!1,perform:(e,t,o,n)=>Tf(e,t,n,()=>(If(o,"actionChangeFontSize: Expected a font size value"),o),o),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{isCompact:a}=Is(n);return no("fieldset",{children:[ge("legend",{children:f("labels.fontSize")}),ge("div",{className:"buttonList",children:ge(Uo,{group:"font-size",options:[{value:Xm.sm,text:f("labels.small"),icon:kw,testId:"fontSize-small"},{value:Xm.md,text:f("labels.medium"),icon:Sw,testId:"fontSize-medium"},{value:Xm.lg,text:f("labels.large"),icon:Mw,testId:"fontSize-large"},{value:Xm.xl,text:f("labels.veryLarge"),icon:Pw,testId:"fontSize-veryLarge"}],value:Kt(e,n,i=>{if(fo(i))return i.fontSize;let s=qr(i,n.scene.getNonDeletedElementsMap());return s?s.fontSize:null},i=>fo(i)||qr(i,n.scene.getNonDeletedElementsMap())!==null,i=>i?null:t.currentItemFontSize||ZD),onChange:i=>{pc(()=>o(i),a,!!t.editingTextElement,r?.onPreventClose)}})})]})}}),Cf=W({name:"decreaseFontSize",label:"labels.decreaseFontSize",icon:Va,trackEvent:!1,perform:(e,t,o,n)=>Tf(e,t,n,r=>Math.round(1/(1+I2)*r.fontSize)),keyTest:e=>e[vs.CTRL_OR_CMD]&&e.shiftKey&&(e.key===vs.CHEVRON_LEFT||e.key===vs.COMMA)}),kf=W({name:"increaseFontSize",label:"labels.increaseFontSize",icon:Va,trackEvent:!1,perform:(e,t,o,n)=>Tf(e,t,n,r=>Math.round(r.fontSize*(1+I2))),keyTest:e=>e[vs.CTRL_OR_CMD]&&e.shiftKey&&(e.key===vs.CHEVRON_RIGHT||e.key===vs.PERIOD)}),x8=W({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:oo(e,t,g=>{let x=r?.get(g.id);return x?kt(g,{...x}):g},!0),appState:{...t,...s},captureUpdate:St.NEVER};If(o,"actionChangeFontFamily: value must be defined");let{currentItemFontFamily:l,currentHoveredFontFamily:c}=o,m=St.EVENTUALLY,p,d=!1;if(l)p=l,m=St.IMMEDIATELY;else if(c){p=c,m=St.EVENTUALLY;let h=de(e,t,{includeBoundTextElement:!0}).filter(g=>fo(g));if(h.length>200)d=!0;else{let g=0,x=0;for(;g<h.length&&x<5e3;){let E=h[g];x+=E?.originalText.length||0,g++}x>5e3&&(d=!0)}}let u={appState:{...t,...s},captureUpdate:m};if(p&&!d){let h=new Map,g=new Set,x=!1,E=Array.from(Ho.loadedFontsCache.values()),y=Object.entries(jD).find(([I,C])=>C===p)?.[0];c&&y&&E.some(I=>I.startsWith(y))&&(x=!0),Object.assign(u,{elements:oo(e,t,I=>{if(fo(I)&&(I.fontFamily!==p||l)){let C=kt(I,{fontFamily:p,lineHeight:QD(p)}),P=r?.get(I.containerId||"")||{},S=n.scene.getContainerElement(I);return i&&S&&P&&n.scene.mutateElement(S,{...P}),x||(g=new Set([...g,...Array.from(C.originalText)])),h.set(C,S),C}return I},!0)});let w=`10px ${JD({fontFamily:p})}`,v=Array.from(g.values()).join();if(x||window.document.fonts.check(w,v))for(let[I,C]of h)vc(I,C,n.scene);else window.document.fonts.load(w,v).then(I=>{for(let[C,P]of h){let S=n.scene.getElement(C.id),D=P?n.scene.getElement(P.id):null;S&&vc(S,D,n.scene)}n.fonts.onLoaded(I)})}return u},PanelComponent:({elements:e,appState:t,app:o,updateData:n})=>{let r=yf(new Map),a=yf(null),[i,s]=WD({}),l=yf(!0),{stylesPanelMode:c,isCompact:m}=Is(o),p=UD(()=>{let d=(u,h)=>Kt(u,o,g=>{if(fo(g))return g.fontFamily;let x=qr(g,h);return x?x.fontFamily:null},g=>fo(g)||qr(g,h)!==null,g=>g?null:t.currentItemFontFamily||XD);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 xf(()=>{a.current=p},[p]),xf(()=>{Object.keys(i).length&&(n(i),s({}))},[i]),xf(()=>(l.current=!1,()=>{l.current=!0}),[]),no(Sf,{children:[c==="full"&&ge("legend",{children:f("labels.fontFamily")}),ge(m2,{isOpened:t.openPopup==="fontFamily",selectedFontFamily:p,hoveredFontFamily:t.currentHoveredFontFamily,compactMode:c!=="full",onSelect:d=>{pc(()=>{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,kt(h||u,{},!0))}else{let h=de(e,t,{includeBoundTextElement:!0});for(let g of h)r.current.set(g.id,kt(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&&mc(null)}}})]})}}),y8=W({name:"changeTextAlign",label:"Change text alignment",trackEvent:!1,perform:(e,t,o,n)=>({elements:oo(e,t,r=>{if(fo(r)){let a=kt(r,{textAlign:o});return vc(a,n.scene.getContainerElement(r),n.scene),a}return r},!0),appState:{...t,currentItemTextAlign:o},captureUpdate:St.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let a=n.scene.getNonDeletedElementsMap(),{isCompact:i}=Is(n);return no("fieldset",{children:[ge("legend",{children:f("labels.textAlign")}),ge("div",{className:"buttonList",children:ge(Uo,{group:"text-align",options:[{value:"left",text:f("labels.left"),icon:Lw,testId:"align-left"},{value:"center",text:f("labels.center"),icon:_w,testId:"align-horizontal-center"},{value:"right",text:f("labels.right"),icon:Dw,testId:"align-right"}],value:Kt(e,n,s=>{if(fo(s))return s.textAlign;let l=qr(s,a);return l?l.textAlign:null},s=>fo(s)||qr(s,a)!==null,s=>s?null:t.currentItemTextAlign),onChange:s=>{pc(()=>o(s),i,!!t.editingTextElement,r?.onPreventClose)}})})]})}}),E8=W({name:"changeVerticalAlign",label:"Change vertical alignment",trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:oo(e,t,r=>{if(fo(r)){let a=kt(r,{verticalAlign:o});return vc(a,n.scene.getContainerElement(r),n.scene),a}return r},!0),appState:{...t},captureUpdate:St.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,data:r})=>{let{isCompact:a}=Is(n);return ge("fieldset",{children:ge("div",{className:"buttonList",children:ge(Uo,{group:"text-align",options:[{value:Km.TOP,text:f("labels.alignTop"),icon:ge(Rw,{theme:t.theme}),testId:"align-top"},{value:Km.MIDDLE,text:f("labels.centerVertically"),icon:ge(Bw,{theme:t.theme}),testId:"align-middle"},{value:Km.BOTTOM,text:f("labels.alignBottom"),icon:ge(Nw,{theme:t.theme}),testId:"align-bottom"}],value:Kt(e,n,i=>{if(fo(i)&&i.containerId)return i.verticalAlign;let s=qr(i,n.scene.getNonDeletedElementsMap());return s?s.verticalAlign:null},i=>fo(i)||qr(i,n.scene.getNonDeletedElementsMap())!==null,i=>i?null:Km.MIDDLE),onChange:i=>{pc(()=>o(i),a,!!t.editingTextElement,r?.onPreventClose)}})})})}}),Cle=W({name:"changeRoundness",label:"Change edge roundness",trackEvent:!1,perform:(e,t,o)=>({elements:oo(e,t,n=>v2(n)?n:kt(n,{roundness:o==="round"?{type:a8(n.type)?Zm.ADAPTIVE_RADIUS:Zm.PROPORTIONAL_RADIUS}:null})),appState:{...t,currentItemRoundness:o},captureUpdate:St.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n,renderAction:r})=>{let i=Hi(w2(e),t).some(s=>s.roundness?.type===Zm.LEGACY);return no("fieldset",{children:[ge("legend",{children:f("labels.edges")}),no("div",{className:"buttonList",children:[ge(Uo,{group:"edges",options:[{value:"sharp",text:f("labels.sharp"),icon:pw},{value:"round",text:f("labels.round"),icon:uw}],value:Kt(e,n,s=>i?null:s.roundness?"round":"sharp",s=>!jm(s)&&s.hasOwnProperty("roundness"),s=>s?null:t.currentItemRoundness),onChange:s=>o(s)}),r("togglePolygon")]})]})}}),E2=e=>[{value:null,text:f("labels.arrowhead_none"),keyBinding:"q",icon:ge(gw,{flip:e})},{value:"arrow",text:f("labels.arrowhead_arrow"),keyBinding:"w",icon:ge(hw,{flip:e})},{value:"triangle",text:f("labels.arrowhead_triangle"),icon:ge(yw,{flip:e}),keyBinding:"e"},{value:"triangle_outline",text:f("labels.arrowhead_triangle_outline"),icon:ge(Ew,{flip:e}),keyBinding:"r"},{value:"circle",text:f("labels.arrowhead_circle"),keyBinding:"a",icon:ge(fw,{flip:e})},{value:"circle_outline",text:f("labels.arrowhead_circle_outline"),keyBinding:"s",icon:ge(bw,{flip:e})},{value:"diamond",text:f("labels.arrowhead_diamond"),icon:ge(ww,{flip:e}),keyBinding:"d"},{value:"diamond_outline",text:f("labels.arrowhead_diamond_outline"),icon:ge(vw,{flip:e}),keyBinding:"f"},{value:"bar",text:f("labels.arrowhead_bar"),keyBinding:"z",icon:ge(xw,{flip:e})},{value:"crowfoot_one",text:f("labels.arrowhead_crowfoot_one"),icon:ge(Tw,{flip:e}),keyBinding:"x"},{value:"crowfoot_many",text:f("labels.arrowhead_crowfoot_many"),icon:ge(Iw,{flip:e}),keyBinding:"c"},{value:"crowfoot_one_or_many",text:f("labels.arrowhead_crowfoot_one_or_many"),icon:ge(Cw,{flip:e}),keyBinding:"v"}],kle=W({name:"changeArrowhead",label:"Change arrowheads",trackEvent:!1,perform:(e,t,o)=>(If(o,"actionChangeArrowhead: value must be defined"),{elements:oo(e,t,n=>{if(wf(n)){let{position:r,type:a}=o;if(r==="start")return kt(n,{startArrowhead:a});if(r==="end")return kt(n,{endArrowhead:a})}return n}),appState:{...t,[o.position==="start"?"currentItemStartArrowhead":"currentItemEndArrowhead"]:o.type},captureUpdate:St.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>{let r=ur().rtl;return no("fieldset",{children:[ge("legend",{children:f("labels.arrowheads")}),no("div",{className:"iconSelectList buttonList",children:[ge(ff,{label:"arrowhead_start",options:E2(!r),value:Kt(e,n,a=>wf(a)&&Gi(a.type)?a.startArrowhead:t.currentItemStartArrowhead,!0,a=>a?null:t.currentItemStartArrowhead),onChange:a=>o({position:"start",type:a}),numberOfOptionsToAlwaysShow:4}),ge(ff,{label:"arrowhead_end",group:"arrowheads",options:E2(!!r),value:Kt(e,n,a=>wf(a)&&Gi(a.type)?a.endArrowhead:t.currentItemEndArrowhead,!0,a=>a?null:t.currentItemEndArrowhead),onChange:a=>o({position:"end",type:a}),numberOfOptionsToAlwaysShow:4})]})]})}}),w8=W({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})=>no("div",{className:"selected-shape-actions",children:[r("changeArrowhead"),r("changeArrowType")]})}),Sle=W({name:"changeArrowType",label:"Change arrow types",trackEvent:!1,perform:(e,t,o,n)=>{let r=oo(e,t,s=>{if(!jm(s))return s;let l=n.scene.getNonDeletedElementsMap(),c=ja.getPointAtIndexGlobalCoordinates(s,0,l),m=ja.getPointAtIndexGlobalCoordinates(s,-1,l),p=kt(s,{x:o===Vo.elbow?c[0]:s.x,y:o===Vo.elbow?c[1]:s.y,roundness:o===Vo.round?{type:Zm.PROPORTIONAL_RADIUS}:null,elbowed:o===Vo.elbow,angle:o===Vo.elbow?0:s.angle,points:o===Vo.elbow||s.elbowed?[ja.pointFromAbsoluteCoords({...s,x:c[0],y:c[1],angle:0},c,l),ja.pointFromAbsoluteCoords({...s,x:c[0],y:c[1],angle:0},m,l)]:s.points});if(v2(p)){p.fixedSegments=null;let d=n.scene.getNonDeletedElementsMap();n.dismissLinearEditor();let u=ja.getPointAtIndexGlobalCoordinates(p,0,d),h=ja.getPointAtIndexGlobalCoordinates(p,-1,d),g=p.startBinding&&d.get(p.startBinding.elementId),x=p.endBinding&&d.get(p.endBinding.elementId),E=g&&p.startBinding?{...p.startBinding,...x2(p,g,"start",d)}:null,y=x&&p.endBinding?{...p.endBinding,...x2(p,x,"end",d)}:null;p={...p,startBinding:E,endBinding:y,...s8(p,d,{points:[u,h].map(w=>GD(w[0]-p.x,w[1]-p.y)),startBinding:E,endBinding:y,fixedSegments:null})}}else{let d=n.scene.getNonDeletedElementsMap();if(p.startBinding){let u=d.get(p.startBinding.elementId);u&&b2(p,u,t.bindMode==="inside"?"inside":"orbit","start",n.scene)}if(p.endBinding){let u=d.get(p.endBinding.elementId);u&&b2(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 ja(s,vf(e)))}return{elements:r,appState:a,captureUpdate:St.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>no("fieldset",{children:[ge("legend",{children:f("labels.arrowtypes")}),ge("div",{className:"buttonList",children:ge(Uo,{group:"arrowtypes",options:[{value:Vo.sharp,text:f("labels.arrowtype_sharp"),icon:ds,testId:"sharp-arrow"},{value:Vo.round,text:f("labels.arrowtype_round"),icon:ps,testId:"round-arrow"},{value:Vo.elbow,text:f("labels.arrowtype_elbowed"),icon:ms,testId:"elbow-arrow"}],value:Kt(e,n,r=>jm(r)?r.elbowed?Vo.elbow:r.roundness?Vo.round:Vo.sharp:null,r=>jm(r),r=>r?null:t.currentItemArrowType),onChange:r=>o(r)})})]})});import{clamp as _f,roundToStep as M8}from"@orangecatai/math";import{DEFAULT_CANVAS_BACKGROUND_PICKS as P8,CURSOR_TYPE as L2,MAX_ZOOM as _2,MIN_ZOOM as D2,THEME as Ic,ZOOM_STEP as Df,updateActiveTool as Cs,CODES as Wn,KEYS as xr,viewportCoordsToSceneCoords as A8}from"@orangecatai/common";import{getElementAbsoluteCoords as M2,getNonDeletedElements as R2,getVisibleElements as L8}from"@orangecatai/element";import{newElementWith as _8}from"@orangecatai/element";import{getCommonBounds as N2}from"@orangecatai/element";import{CaptureUpdateAction as un}from"@orangecatai/element";import{useEffect as v8}from"react";import{jsx as T8}from"react/jsx-runtime";var Ts=()=>{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},Mf=(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`})},I8=(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();Mf(t,r)},Xt=({children:e,label:t,long:o=!1,style:n,disabled:r})=>(v8(()=>()=>Ts().classList.remove("excalidraw-tooltip--visible"),[]),r?null:T8("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:a=>I8(a.currentTarget,Ts(),t,o),onPointerLeave:()=>Ts().classList.remove("excalidraw-tooltip--visible"),style:n,children:e}));import{CURSOR_TYPE as Pf,MIME_TYPES as Af,THEME as C2}from"@orangecatai/common";var k2='<svg viewBox="0 0 24 24" stroke-width="1" width="28" height="28" xmlns="http://www.w3.org/2000/svg">',C8='<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"/>',S2='<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"/>',k8=`data:${Af.svg},${encodeURIComponent(`${k2}${S2}</svg>`)}`,S8=`data:${Af.svg},${encodeURIComponent(`${k2}${C8}${S2}</svg>`)}`,Po=e=>{e&&(e.style.cursor="")},Be=(e,t)=>{e&&(e.style.cursor=t)},Un,T2,Lf=(e,t)=>{let n=()=>{let r=t===C2.DARK;Un=document.createElement("canvas"),Un.theme=t,Un.height=20,Un.width=20;let a=Un.getContext("2d");a.lineWidth=1,a.beginPath(),a.arc(Un.width/2,Un.height/2,5,0,2*Math.PI),a.fillStyle=r?"#000":"#fff",a.fill(),a.strokeStyle=r?"#fff":"#000",a.stroke(),T2=Un.toDataURL(Af.svg)};(!Un||Un.theme!==t)&&n(),Be(e,`url(${T2}) ${20/2} ${20/2}, auto`)},Ao=(e,t)=>{if(e)if(t.activeTool.type==="selection")Po(e);else if(pr(t))e.style.cursor=Pf.GRAB;else if(ho(t))Lf(e,t.theme);else if(t.activeTool.type==="laser"){let o=t.theme===C2.LIGHT?k8:S8;e.style.cursor=`url(${o}), auto`}else["image","custom"].includes(t.activeTool.type)?t.activeTool.type!=="image"&&(e.style.cursor=Pf.AUTO):e.style.cursor=Pf.CROSSHAIR};var br=({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 ks,jsxs as G8}from"react/jsx-runtime";var D8=W({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?un.IMMEDIATELY:un.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:o,appProps:n,data:r})=>ks(fc,{palette:null,topPicks:P8,label:f("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:a=>o({viewBackgroundColor:a}),"data-testid":"canvas-background-picker",elements:e,appState:t,updateData:o})}),yr=W({name:"clearCanvas",label:"labels.clearCanvas",icon:Ut,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=>_8(r,{isDeleted:!0})),appState:{...Or(),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:un.IMMEDIATELY})}),qm=W({name:"zoomIn",label:"buttons.zoomIn",viewMode:!0,icon:fh,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>({appState:{...t,...br({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Ln(t.zoom.value+Df)},t),userToFollow:null},captureUpdate:un.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>ks(ae,{type:"button",className:"zoom-in-button zoom-button",icon:fh,title:`${f("buttons.zoomIn")} \u2014 ${G("CtrlOrCmd++")}`,"aria-label":f("buttons.zoomIn"),disabled:t.zoom.value>=_2,onClick:()=>{e(null)}}),keyTest:e=>(e.code===Wn.EQUAL||e.code===Wn.NUM_ADD)&&(e[xr.CTRL_OR_CMD]||e.shiftKey)}),Jm=W({name:"zoomOut",label:"buttons.zoomOut",icon:bh,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>({appState:{...t,...br({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Ln(t.zoom.value-Df)},t),userToFollow:null},captureUpdate:un.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>ks(ae,{type:"button",className:"zoom-out-button zoom-button",icon:bh,title:`${f("buttons.zoomOut")} \u2014 ${G("CtrlOrCmd+-")}`,"aria-label":f("buttons.zoomOut"),disabled:t.zoom.value<=D2,onClick:()=>{e(null)}}),keyTest:e=>(e.code===Wn.MINUS||e.code===Wn.NUM_SUBTRACT)&&(e[xr.CTRL_OR_CMD]||e.shiftKey)}),Qm=W({name:"resetZoom",label:"buttons.resetZoom",icon:OE,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>({appState:{...t,...br({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Ln(1)},t),userToFollow:null},captureUpdate:un.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>ks(Xt,{label:f("buttons.resetZoom"),style:{height:"100%"},children:G8(ae,{type:"button",className:"reset-zoom-button zoom-button",title:f("buttons.resetZoom"),"aria-label":f("buttons.resetZoom"),onClick:()=>{e(null)},children:[(t.zoom.value*100).toFixed(0),"%"]})}),keyTest:e=>(e.code===Wn.ZERO||e.code===Wn.NUM_ZERO)&&(e[xr.CTRL_OR_CMD]||e.shiftKey)}),R8=(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)*_f(o,.1,1);return Math.min(d,1)},N8=.8,B8=(e,t)=>e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1],F8=(e,t)=>[e[0]-t,e[1]-t,e[2]+t,e[3]+t],P2=(e,t)=>{let o=(e[0]+e[2])/2,n=(e[1]+e[3])/2;return Math.hypot(o-t.x,n-t.y)},A2=e=>[e[0],e[1],e[2],e[3]],O8=(e,t)=>{let o=R2(e);if(!o.length)return[];let n=L8(o),r=n.length?n:o,a=new Map(o.map(d=>[d.id,d])),i=A8({clientX:t.offsetLeft+t.width/2,clientY:t.offsetTop+t.height/2},t),s=r.reduce((d,u)=>{let h=A2(M2(u,a));return d?P2(h,i)<P2(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=F8(m,l);for(let u of r){if(c.has(u.id))continue;let h=A2(M2(u,a));B8(h,d)&&(c.set(u.id,u),m=N2([...c.values()]),p=!0)}}return[...c.values()]},B2=({bounds:e,appState:t,canvasOffsets:o,fitToViewport:n=!1,viewportZoomFactor:r=1,minZoom:a=-1/0,maxZoom:i=1/0})=>{r=_f(r,D2,_2);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,x=o?.bottom??0,E=t.width-u-g,y=t.height-h-x,w;if(n){let C=c-s,P=m-l;w=Math.min(E/C,y/P)*r}else w=R8(e,{width:E,height:y},r);let v=Ln(_f(M8(w,Df,"floor"),a,i)),I=oE({scenePoint:{x:p,y:d},viewportDimensions:{width:t.width,height:t.height},offsets:o,zoom:{value:v}});return{appState:{...t,scrollX:I.scrollX,scrollY:I.scrollY,zoom:{value:v}},captureUpdate:un.EVENTUALLY}},Ss=({canvasOffsets:e,targetElements:t,appState:o,fitToViewport:n,viewportZoomFactor:r,minZoom:a,maxZoom:i})=>{let s=N2(R2(t));return B2({canvasOffsets:e,bounds:s,appState:o,fitToViewport:n,viewportZoomFactor:r,minZoom:a,maxZoom:i})},cce=W({name:"zoomToFitSelectionInViewport",label:"labels.zoomToFitViewport",icon:cs,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t);return Ss({targetElements:r.length?r:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:n.getEditorUIOffsets()})},keyTest:e=>e.code===Wn.TWO&&e.shiftKey&&!e.altKey&&!e[xr.CTRL_OR_CMD]}),dce=W({name:"zoomToFitSelection",label:"helpDialog.zoomToSelection",icon:cs,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t);return Ss({targetElements:r.length?r:e,appState:{...t,userToFollow:null},fitToViewport:!0,canvasOffsets:n.getEditorUIOffsets()})},keyTest:e=>e.code===Wn.THREE&&e.shiftKey&&!e.altKey&&!e[xr.CTRL_OR_CMD]}),z8=W({name:"zoomToFit",label:"helpDialog.zoomToFit",icon:cs,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>Ss({targetElements:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:n.getEditorUIOffsets()}),keyTest:e=>e.code===Wn.ONE&&e.shiftKey&&!e.altKey&&!e[xr.CTRL_OR_CMD]}),H8=W({name:"scrollBackToContent",label:"buttons.scrollBackToContent",icon:cs,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t),a=r.length?r:O8(e,t);return a.length?Ss({targetElements:a,appState:{...t,userToFollow:null},fitToViewport:!0,viewportZoomFactor:N8,canvasOffsets:n.getEditorUIOffsets()}):!1},PanelComponent:({updateData:e})=>ks(Xt,{label:f("buttons.scrollBackToContent"),style:{height:"100%"},children:ks(ae,{type:"button",className:"scroll-back-to-content-button zoom-button",icon:cs,title:f("buttons.scrollBackToContent"),"aria-label":f("buttons.scrollBackToContent"),onClick:()=>{e(null)}})})}),qa=W({name:"toggleTheme",label:(e,t)=>t.theme===Ic.DARK?"buttons.lightMode":"buttons.darkMode",keywords:["toggle","dark","light","mode","theme"],icon:(e,t)=>e.theme===Ic.LIGHT?oc:nc,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,o)=>({appState:{...t,theme:o||(t.theme===Ic.LIGHT?Ic.DARK:Ic.LIGHT)},captureUpdate:un.EVENTUALLY}),keyTest:e=>e.altKey&&e.shiftKey&&e.code===Wn.D,predicate:(e,t,o,n)=>!!n.props.UIOptions.canvasActions.toggleTheme}),mce=W({name:"toggleEraserTool",label:"toolBar.eraser",trackEvent:{category:"toolbar"},perform:(e,t,o,n)=>{let r;return ho(t)?r=Cs(t,{...t.activeTool.lastActiveTool||{type:n.state.preferredSelectionTool.type},lastActiveToolBeforeEraser:null}):r=Cs(t,{type:"eraser",lastActiveToolBeforeEraser:t.activeTool}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:r},captureUpdate:un.IMMEDIATELY}},keyTest:e=>e.key===xr.E}),pce=W({name:"toggleLassoTool",label:"toolBar.lasso",icon:Hr,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=Cs(t,{type:"lasso",fromSelection:!1}),Be(n.interactiveCanvas,L2.CROSSHAIR)):r=Cs(t,{type:"selection"}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:r},captureUpdate:un.NEVER}}}),F2=W({name:"toggleHandTool",label:"toolBar.hand",trackEvent:{category:"toolbar"},icon:as,viewMode:!1,perform:(e,t,o,n)=>{let r;return pr(t)?r=Cs(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):(r=Cs(t,{type:"hand",lastActiveToolBeforeEraser:t.activeTool}),Be(n.interactiveCanvas,L2.GRAB)),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:r},captureUpdate:un.IMMEDIATELY}},keyTest:e=>!e.altKey&&!e[xr.CTRL_OR_CMD]&&e.key===xr.H});import{updateActiveTool as O2}from"@orangecatai/common";import{CaptureUpdateAction as U8}from"@orangecatai/element";var W8=W({name:"setEmbeddableAsActiveTool",trackEvent:{category:"toolbar"},target:"Tool",label:"toolBar.embeddable",perform:(e,t,o,n)=>{let r=O2(t,{type:"embeddable"});return Ao(n.canvas,{...t,activeTool:r}),{elements:e,appState:{...t,activeTool:O2(t,{type:"embeddable"})},captureUpdate:U8.EVENTUALLY}}});import{pointFrom as z2}from"@orangecatai/math";import{bindOrUnbindBindingElement as Y8}from"@orangecatai/element/binding";import{isValidPolygon as H2,LinearElementEditor as ep,newElementWith as Rf}from"@orangecatai/element";import{isBindingElement as G2,isFreeDrawElement as U2,isLinearElement as W2,isLineElement as tp}from"@orangecatai/element";import{KEYS as Nf,arrayToMap as $8,invariant as Y2,shouldRotateWithDiscreteAngle as V8,updateActiveTool as $2}from"@orangecatai/common";import{isPathALoop as K8}from"@orangecatai/element";import{isInvisiblySmallElement as Bf}from"@orangecatai/element";import{CaptureUpdateAction as V2}from"@orangecatai/element";import{jsx as X8}from"react/jsx-runtime";var ro=W({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=ep.getElement(t.selectedLinearElement.elementId,l);Y2(h,"Arrow element should exist if selectedLinearElement is set"),Y2(u,"sceneCoords should be defined if actionFinalize is called with event");let g=ep.handlePointerUp(d,t.selectedLinearElement,t,n.scene);if(G2(h)&&!t.selectedLinearElement.segmentMidPointHoveredCoords){let x=!!t.newElement,y=(x||!t.selectedLinearElement.selectedPointsIndices?[h.points.length-1]:t.selectedLinearElement.selectedPointsIndices).reduce((w,v)=>(w.set(v,{point:ep.pointFromAbsoluteCoords(h,z2(u.x-g.pointerOffset.x,u.y-g.pointerOffset.y),l)}),w),new Map)??new Map;Y8(h,y,u.x-g.pointerOffset.x,u.y-g.pointerOffset.y,s,t,{newArrow:x,altKey:d.altKey,angleLocked:V8(d)})}else tp(h)&&t.selectedLinearElement?.isEditing&&!t.newElement&&!H2(h.points)&&s.mutateElement(h,{polygon:!1});if(g!==t.selectedLinearElement){h&&Bf(h)&&(r=r.map(E=>E.id===h.id?Rf(E,{isDeleted:!0}):E));let x=t.activeTool?.locked;return{elements:h.points.length<2||Bf(h)?e.map(E=>E.id===h.id?Rf(E,{isDeleted:!0}):E):r,appState:{...t,cursorButton:"up",selectedLinearElement:x?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:V2.IMMEDIATELY}}}window.document.activeElement instanceof HTMLElement&&i();let c=null;if(t.multiElement)c=t.multiElement;else if(t.newElement?.type==="freedraw"||G2(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&&Bf(c)&&(r=r.map(d=>d.id===c?.id?Rf(d,{isDeleted:!0}):d)),W2(c)||U2(c)){if(K8(c.points,t.zoom.value)&&(tp(c)||U2(c))){let u=c.points,h=u[0],g=u.map((x,E)=>E===u.length-1?z2(h[0],h[1]):x);tp(c)?s.mutateElement(c,{points:g,polygon:!0}):s.mutateElement(c,{points:g})}tp(c)&&!H2(c.points)&&s.mutateElement(c,{polygon:!1})}}(!t.activeTool.locked&&t.activeTool.type!=="freedraw"||!c)&&Po(a);let m;t.activeTool.type==="eraser"?m=$2(t,{...t.activeTool.lastActiveTool||{type:n.state.preferredSelectionTool.type},lastActiveToolBeforeEraser:null}):m=$2(t,{type:n.state.preferredSelectionTool.type});let p=c&&W2(c)?new ep(c,$8(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:V2.IMMEDIATELY}},keyTest:(e,t)=>e.key===Nf.ESCAPE&&(t.selectedLinearElement?.isEditing||!t.newElement&&t.multiElement===null)||(e.key===Nf.ESCAPE||e.key===Nf.ENTER)&&t.multiElement!==null,PanelComponent:({appState:e,updateData:t,data:o})=>X8(ae,{type:"button",icon:KE,title:f("buttons.done"),"aria-label":f("buttons.done"),onClick:t,visible:e.multiElement!=null,size:o?.size||"medium",style:{pointerEvents:"all"}})});import{KEYS as Ls,DEFAULT_EXPORT_PADDING as OR,EXPORT_SCALES as zR,THEME as zf}from"@orangecatai/common";import{getNonDeletedElements as HR}from"@orangecatai/element";import{CaptureUpdateAction as fn}from"@orangecatai/element";import Z8 from"clsx";import{jsx as K2,jsxs as j8}from"react/jsx-runtime";var Tc=({children:e,checked:t,onChange:o,className:n})=>j8("div",{className:Z8("Checkbox",n,{"is-checked":t}),onClick:r=>{o(!t,r),r.currentTarget.querySelector(".Checkbox-box").focus()},children:[K2("button",{type:"button",className:"Checkbox-box",role:"checkbox","aria-checked":t,children:bm}),K2("div",{className:"Checkbox-label",children:e})]});import{THEME as Cc}from"@orangecatai/common";import{jsx as kc}from"react/jsx-runtime";var Z2=e=>{let t=e.title||(e.value===Cc.DARK?f("buttons.lightMode"):f("buttons.darkMode"));return kc(ae,{type:"icon",icon:e.value===Cc.LIGHT?X2.MOON:X2.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===Cc.DARK?Cc.LIGHT:Cc.DARK),"data-testid":"toggle-dark-mode"})},X2={SUN:kc("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:kc("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:kc("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:kc("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 q8}from"react";import{focusNearestParent as J8,KEYS as Q8}from"@orangecatai/common";import{jsx as j2,jsxs as eR}from"react/jsx-runtime";var q2=e=>{let{id:t}=Qe(),[o,n]=q8(e.value),r=i=>{e.ignoreFocus||J8(i.target);let s=i.target.value;s!==e.value&&e.onChange(s)},a=i=>{if(i.key===Q8.ENTER){if(i.preventDefault(),i.nativeEvent.isComposing||i.keyCode===229)return;i.currentTarget.blur()}};return eR("div",{className:"ProjectName",children:[j2("label",{className:"ProjectName-label",htmlFor:"filename",children:`${e.label}:`}),j2("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 PR,DEFAULT_FILENAME as AR,IMAGE_MIME_TYPES as gI,isFirefox as LR,MIME_TYPES as _R,cloneJSON as DR,SVG_DOCUMENT_PREAMBLE as RR}from"@orangecatai/common";import{getNonDeletedElements as NR}from"@orangecatai/element";import{isFrameLikeElement as BR}from"@orangecatai/element";import{getElementsOverlappingFrame as FR}from"@orangecatai/element";import{ALLOWED_PASTE_MIME_TYPES as pR,EXPORT_DATA_TYPES as Pc,MIME_TYPES as Lo,arrayToMap as uR,isMemberOf as gR,isPromiseLike as hR,EVENT as rp}from"@orangecatai/common";import{mutateElement as fR}from"@orangecatai/element";import{deepCopyElement as bR}from"@orangecatai/element";import{isFrameLikeElement as xR,isInitializedImageElement as yR}from"@orangecatai/element";import{getContainingFrame as lI}from"@orangecatai/element";import{pointFrom as Jr}from"@orangecatai/math";import{COLOR_PALETTE as Q2,DEFAULT_CHART_COLOR_INDEX as tR,getAllColorsSpecificShade as oR,DEFAULT_FONT_FAMILY as nR,DEFAULT_FONT_SIZE as eI,VERTICAL_ALIGN as rR,randomId as tI,isDevEnv as oI,FONT_SIZES as aR}from"@orangecatai/common";import{newTextElement as op,newLinearElement as Mc,newElement as Of}from"@orangecatai/element";var gn=32,Ke=12,Qr=256,nI=50,Ja="NOT_SPREADSHEET",Ms="VALID_SPREADSHEET",Sc=e=>{let t=/^([-+]?)[$€£¥₩]?([-+]?)([\d.,]+)[%]?$/.exec(e);return t?parseFloat(`${(t[1]||t[2])+t[3]}`.replace(/,/g,"")):null},Ff=(e,t)=>e.slice(1).every(o=>Sc(o[t])!==null),J2=e=>{let t=e[0].length;if(t>2)return{type:Ja,reason:"More than 2 columns"};if(t===1){if(!Ff(e,0))return{type:Ja,reason:"Value is not numeric"};let l=Sc(e[0][0])===null,c=(l?e.slice(1):e).map(m=>Sc(m[0]));return c.length<2?{type:Ja,reason:"Less than two rows"}:{type:Ms,spreadsheet:{title:l?e[0][0]:null,labels:null,values:c}}}let o=Ff(e,0),n=Ff(e,1);if(!o&&!n)return{type:Ja,reason:"Value is not numeric"};let[r,a]=n?[0,1]:[1,0],i=Sc(e[0][a])===null,s=i?e.slice(1):e;return s.length<2?{type:Ja,reason:"Less than 2 rows"}:{type:Ms,spreadsheet:{title:i?e[0][a]:null,labels:s.map(l=>l[r]),values:s.map(l=>Sc(l[a]))}}},iR=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},rI=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:Ja,reason:"No values"};let o=t[0].length;if(!t.every(a=>a.length===o))return{type:Ja,reason:"All rows don't have same number of columns"};let r=J2(t);if(r.type!==Ms){let a=J2(iR(t));if(a.type===Ms)return a}return r},np=oR(tR),Ko={fillStyle:"hachure",fontFamily:nR,fontSize:eI,opacity:100,roughness:1,strokeColor:Q2.black,roundness:null,strokeStyle:"solid",strokeWidth:1,verticalAlign:rR.MIDDLE,locked:!1},aI=e=>{let t=(gn+Ke)*e.values.length+Ke,o=Qr+Ke*2;return{chartWidth:t,chartHeight:o}},sR=(e,t,o,n,r)=>e.labels?.map((a,i)=>op({groupIds:[n],backgroundColor:r,...Ko,text:a.length>8?`${a.slice(0,5)}...`:a,x:t+i*(gn+Ke)+Ke*2,y:o+Ke/2,width:gn,angle:5.87,fontSize:aR.sm,textAlign:"center",verticalAlign:"top"}))||[],lR=(e,t,o,n,r)=>{let a=op({groupIds:[n],backgroundColor:r,...Ko,x:t-Ke,y:o-Ke,text:"0",textAlign:"right"}),i=op({groupIds:[n],backgroundColor:r,...Ko,x:t-Ke,y:o-Qr-a.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:"right"});return[a,i]},cR=(e,t,o,n,r)=>{let{chartWidth:a,chartHeight:i}=aI(e),s=Mc({backgroundColor:r,groupIds:[n],...Ko,type:"line",x:t,y:o,width:a,points:[Jr(0,0),Jr(a,0)]}),l=Mc({backgroundColor:r,groupIds:[n],...Ko,type:"line",x:t,y:o,height:i,points:[Jr(0,0),Jr(0,-i)]}),c=Mc({backgroundColor:r,groupIds:[n],...Ko,type:"line",x:t,y:o-Qr-Ke,strokeStyle:"dotted",width:a,opacity:nI,points:[Jr(0,0),Jr(a,0)]});return[s,l,c]},iI=(e,t,o,n,r,a)=>{let{chartWidth:i,chartHeight:s}=aI(e),l=e.title?op({backgroundColor:r,groupIds:[n],...Ko,text:e.title,x:t+i/2,y:o-Qr-Ke*2-eI,roundness:null,textAlign:"center"}):null,c=a?Of({backgroundColor:r,groupIds:[n],...Ko,type:"rectangle",x:t,y:o-s,width:i,height:s,strokeColor:Q2.black,fillStyle:"solid",opacity:6}):null;return[...c?[c]:[],...l?[l]:[],...sR(e,t,o,n,r),...lR(e,t,o,n,r),...cR(e,t,o,n,r)]},dR=(e,t,o)=>{let n=Math.max(...e.values),r=tI(),a=np[Math.floor(Math.random()*np.length)];return[...e.values.map((s,l)=>{let c=s/n*Qr;return Of({backgroundColor:a,groupIds:[r],...Ko,type:"rectangle",x:t+l*(gn+Ke)+Ke,y:o-c-Ke,width:gn,height:c})}),...iI(e,t,o,r,a,oI())]},mR=(e,t,o)=>{let n=Math.max(...e.values),r=tI(),a=np[Math.floor(Math.random()*np.length)],i=0,s=[];for(let g of e.values){let x=i*(gn+Ke),E=-(g/n)*Qr;s.push([x,E]),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=Mc({backgroundColor:a,groupIds:[r],...Ko,type:"line",x:t+Ke+gn/2,y:o-Ke,height:c-p,width:l-m,strokeWidth:2,points:s}),u=e.values.map((g,x)=>{let E=x*(gn+Ke)+Ke/2,y=-(g/n)*Qr+Ke/2;return Of({backgroundColor:a,groupIds:[r],...Ko,fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+E+gn/2,y:o+y-Ke*2,width:Ke,height:Ke})}),h=e.values.map((g,x)=>{let E=x*(gn+Ke)+Ke/2,y=g/n*Qr+Ke/2+Ke;return Mc({backgroundColor:a,groupIds:[r],...Ko,type:"line",x:t+E+gn/2+Ke/2,y:o-y,height:y,strokeStyle:"dotted",opacity:nI,points:[Jr(0,0),Jr(0,y)]})});return[...iI(e,t,o,r,a,oI()),d,...h,...u]},sI=(e,t,o,n)=>e==="line"?mR(t,o,n):dR(t,o,n);var Cde="clipboard"in navigator&&"readText"in navigator.clipboard,ap="clipboard"in navigator&&"writeText"in navigator.clipboard,Ps="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,ER=e=>!!([Pc.excalidraw,Pc.excalidrawClipboard,Pc.excalidrawClipboardWithAPI].includes(e?.type)&&Array.isArray(e.elements)),cI=({types:e,files:t})=>{!e&&!t&&console.warn("createPasteEvent: no types or files provided");let o=new ClipboardEvent(rp.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},wR=({elements:e,files:t})=>{let o=uR(e),n=new Set(e.filter(s=>xR(s))),r=!1,a=e.reduce((s,l)=>(yR(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:Pc.excalidrawClipboard,elements:e.map(s=>{if(lI(s,o)&&!n.has(lI(s,o))){let l=bR(s);return fR(l,o,{frameId:null}),l}return s}),files:t?a:void 0};return JSON.stringify(i)},ip=async(e,t,o)=>{let n=wR({elements:e,files:t});await hn({[Lo.excalidrawClipboard]:n,[Lo.text]:n},o)},vR=e=>{let t=rI(e);return t.type===Ms?{spreadsheet:t.spreadsheet}:null};function dI(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(dI(o));return t}var IR=e=>{let t=e.value;try{let o=new DOMParser().parseFromString(t,Lo.html),n=dI(o.body);if(n.length)return{type:"mixedContent",value:n}}catch(o){console.error(`error in parseHTMLFromPaste: ${o.message}`)}return null},mI=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{[Lo.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(gR(pR,n))try{if(n===Lo.text||n===Lo.html)e[n]=await(await o.getType(n)).text();else if(hE(n)){let r=await o.getType(n),a=vE(r,n,void 0);e[n]=a}else throw new sh(`Unsupported clipboard type: ${n}`)}catch(r){console.warn(r instanceof sh?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},TR=async(e,t=!1)=>{try{let o=e.findByType(Lo.html),n=!t&&o&&IR(o);return n?n.value.every(r=>r.type==="text")?{type:"text",value:e.getData(Lo.text)??n.value.map(r=>r.value).join(`
|
|
4
|
-
`).trim()}:n:{type:"text",value:(e.getData(Lo.text)||"").trim()}}catch{return{type:"text",value:""}}},CR=function(e){return this.find(t=>t.type===e)||null},kR=function(e){return this.find(o=>o.type===e)?.value??null},SR=function(){return this.filter(e=>e.kind==="file")},pI=e=>{let t;uI(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},As=async e=>{let t;uI(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 wE(n);return r=await ec(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:CR,getData:kR,getFiles:SR})},sp=async(e,t=!1)=>{let o=await TR(e,t);if(o.type==="mixedContent")return{mixedContent:o.value};try{let n=!t&&vR(o.value);if(n)return n}catch(n){console.error(n)}try{let n=JSON.parse(o.value),r=n.type===Pc.excalidrawClipboardWithAPI;if(ER(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}},lp=async e=>{try{await navigator.clipboard.write([new ClipboardItem({[Lo.png]:e})])}catch(t){if(hR(e))await navigator.clipboard.write([new ClipboardItem({[Lo.png]:await e})]);else throw t}},hn=async(e,t)=>{e=e||"";let o=Object.entries(typeof e=="string"?{[Lo.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===Lo.text);if(ap&&n)try{await navigator.clipboard.writeText(n[1]);return}catch(r){console.error(r)}if(n&&!MR(n[1]))throw new Error("Error copying to clipboard.")},MR=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},uI=e=>e.type===rp.PASTE||e.type===rp.COPY||e.type===rp.CUT;var Qa=(e,{selectedElementIds:t},o)=>{e=NR(e);let n=o&&Ge(e,{selectedElementIds:t}),r=null,a=n?de(e,{selectedElementIds:t},{includeBoundTextElement:!0}):e;return n&&(a.length===1&&BR(a[0])?(r=a[0],a=FR(e,r)):a.length>1&&(a=de(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}))),{exportingFrame:r,exportedElements:DR(a)}},ei=async(e,t,o,n,{exportBackground:r,exportPadding:a=PR,viewBackgroundColor:i,name:s=o.name||AR,fileHandle:l=null,exportingFrame:c=null})=>{if(t.length===0)throw new Error(f("alerts.cannotExportEmptyCanvas"));if(e==="svg"||e==="clipboard-svg"){let p=Yi(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 lh(p.then(d=>new Blob([RR+d.outerHTML],{type:_R.svg})),{description:"Export to SVG",name:s,extension:o.exportEmbedScene?"excalidraw.svg":"svg",mimeTypes:[gI.svg],fileHandle:l});if(e==="clipboard-svg"){let d=await p.then(u=>u.outerHTML);try{await hn(d)}catch{throw new Error(f("errors.copyToSystemClipboardFailed"))}return}}let m=zr(t,o,n,{exportBackground:r,viewBackgroundColor:i,exportPadding:a,exportingFrame:c});if(e==="png"){let p=Ua(m);return o.exportEmbedScene&&(p=p.then(d=>import("./data/image-
|
|
4
|
+
`).trim()}:n:{type:"text",value:(e.getData(Lo.text)||"").trim()}}catch{return{type:"text",value:""}}},CR=function(e){return this.find(t=>t.type===e)||null},kR=function(e){return this.find(o=>o.type===e)?.value??null},SR=function(){return this.filter(e=>e.kind==="file")},pI=e=>{let t;uI(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},As=async e=>{let t;uI(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 wE(n);return r=await ec(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:CR,getData:kR,getFiles:SR})},sp=async(e,t=!1)=>{let o=await TR(e,t);if(o.type==="mixedContent")return{mixedContent:o.value};try{let n=!t&&vR(o.value);if(n)return n}catch(n){console.error(n)}try{let n=JSON.parse(o.value),r=n.type===Pc.excalidrawClipboardWithAPI;if(ER(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}},lp=async e=>{try{await navigator.clipboard.write([new ClipboardItem({[Lo.png]:e})])}catch(t){if(hR(e))await navigator.clipboard.write([new ClipboardItem({[Lo.png]:await e})]);else throw t}},hn=async(e,t)=>{e=e||"";let o=Object.entries(typeof e=="string"?{[Lo.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===Lo.text);if(ap&&n)try{await navigator.clipboard.writeText(n[1]);return}catch(r){console.error(r)}if(n&&!MR(n[1]))throw new Error("Error copying to clipboard.")},MR=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},uI=e=>e.type===rp.PASTE||e.type===rp.COPY||e.type===rp.CUT;var Qa=(e,{selectedElementIds:t},o)=>{e=NR(e);let n=o&&Ge(e,{selectedElementIds:t}),r=null,a=n?de(e,{selectedElementIds:t},{includeBoundTextElement:!0}):e;return n&&(a.length===1&&BR(a[0])?(r=a[0],a=FR(e,r)):a.length>1&&(a=de(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}))),{exportingFrame:r,exportedElements:DR(a)}},ei=async(e,t,o,n,{exportBackground:r,exportPadding:a=PR,viewBackgroundColor:i,name:s=o.name||AR,fileHandle:l=null,exportingFrame:c=null})=>{if(t.length===0)throw new Error(f("alerts.cannotExportEmptyCanvas"));if(e==="svg"||e==="clipboard-svg"){let p=Yi(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 lh(p.then(d=>new Blob([RR+d.outerHTML],{type:_R.svg})),{description:"Export to SVG",name:s,extension:o.exportEmbedScene?"excalidraw.svg":"svg",mimeTypes:[gI.svg],fileHandle:l});if(e==="clipboard-svg"){let d=await p.then(u=>u.outerHTML);try{await hn(d)}catch{throw new Error(f("errors.copyToSystemClipboardFailed"))}return}}let m=zr(t,o,n,{exportBackground:r,viewBackgroundColor:i,exportPadding:a,exportingFrame:c});if(e==="png"){let p=Ua(m);return o.exportEmbedScene&&(p=p.then(d=>import("./data/image-3F2KCNSC.js").then(({encodePngMetadata:u})=>u({blob:d,metadata:jl(t,o,n,"local")})))),lh(p,{description:"Export to PNG",name:s,extension:o.exportEmbedScene?"excalidraw.png":"png",mimeTypes:[gI.png],fileHandle:l})}else if(e==="clipboard")try{let p=Ua(m);await lp(p)}catch(p){throw console.warn(p),p.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(f("canvasError.canvasTooBig")):LR&&p.name==="TypeError"?new Error(`${f("alerts.couldNotCopyToClipboard")}
|
|
5
5
|
|
|
6
6
|
${f("hints.firefox_clipboard_write")}`):new Error(f("alerts.couldNotCopyToClipboard"))}else throw new Error("Unsupported export type")};var hI=async(e,t,o,n)=>{let{exportBackground:r,viewBackgroundColor:a,fileHandle:i}=t,s=uE(i);if(!i||!gE(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}=Qa(e,t,!1);return await ei(s,l,t,o,{exportBackground:r,viewBackgroundColor:a,name:n,fileHandle:i,exportingFrame:c}),{fileHandle:i}};import{Fragment as GR,jsx as Er,jsxs as UR}from"react/jsx-runtime";var Hf=W({name:"changeProjectName",label:"labels.fileTitle",trackEvent:!1,perform:(e,t,o)=>({appState:{...t,name:o},captureUpdate:fn.EVENTUALLY}),PanelComponent:({appState:e,updateData:t,appProps:o,data:n,app:r})=>Er(q2,{label:f("labels.fileTitle"),value:r.getName(),onChange:a=>t(a),ignoreFocus:n?.ignoreFocus??!1})}),fI=W({name:"changeExportScale",label:"imageExportDialog.scale",trackEvent:{category:"export",action:"scale"},perform:(e,t,o)=>({appState:{...t,exportScale:o},captureUpdate:fn.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:o})=>{let n=HR(e),a=Ge(n,t)?de(n,t):n;return Er(GR,{children:zR.map(i=>{let[s,l]=mE(a,OR,i),c=`${f("imageExportDialog.label.scale")} ${i}x (${s}x${l})`;return Er(ae,{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)})})}}),Gf=W({name:"changeExportBackground",label:"imageExportDialog.label.withBackground",trackEvent:{category:"export",action:"toggleBackground"},perform:(e,t,o)=>({appState:{...t,exportBackground:o},captureUpdate:fn.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>Er(Tc,{checked:e.exportBackground,onChange:o=>t(o),children:f("imageExportDialog.label.withBackground")})}),cp=W({name:"changeExportEmbedScene",label:"imageExportDialog.tooltip.embedScene",trackEvent:{category:"export",action:"embedScene"},perform:(e,t,o)=>({appState:{...t,exportEmbedScene:o},captureUpdate:fn.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>UR(Tc,{checked:e.exportEmbedScene,onChange:o=>t(o),children:[f("imageExportDialog.label.embedScene"),Er(Xt,{label:f("imageExportDialog.tooltip.embedScene"),long:!0,children:Er("div",{className:"excalidraw-tooltip-icon",children:XE})})]})}),ti=W({name:"saveToActiveFile",label:"buttons.save",icon:$a,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}=sm(t.fileHandle)?await hI(e,t,n.files,n.getName()):await nm(e,t,n.files,n.getName());return{captureUpdate:fn.EVENTUALLY,appState:{...t,fileHandle:a,toast:r?{message:a?.name?f("toast.fileSavedToFilename").replace("{filename}",`"${a.name}"`):f("toast.fileSaved")}:null}}}catch(a){return a?.name!=="AbortError"?console.error(a):console.warn(a),{captureUpdate:fn.EVENTUALLY}}},keyTest:e=>e.key===Ls.S&&e[Ls.CTRL_OR_CMD]&&!e.shiftKey}),Ac=W({name:"saveFileToDisk",label:"exportDialog.disk_title",icon:$a,viewMode:!0,trackEvent:{category:"export"},perform:async(e,t,o,n)=>{try{let{fileHandle:r}=await nm(e,{...t,fileHandle:null},n.files,n.getName());return{captureUpdate:fn.EVENTUALLY,appState:{...t,openDialog:null,fileHandle:r,toast:{message:f("toast.fileSaved")}}}}catch(r){return r?.name!=="AbortError"?console.error(r):console.warn(r),{captureUpdate:fn.EVENTUALLY}}},keyTest:e=>e.key===Ls.S&&e.shiftKey&&e[Ls.CTRL_OR_CMD],PanelComponent:({updateData:e})=>Er(ae,{type:"button",icon:YE,title:f("buttons.saveAs"),"aria-label":f("buttons.saveAs"),showAriaLabel:Te().formFactor==="phone",hidden:!Wi,onClick:()=>e(null),"data-testid":"save-as-button"})}),_s=W({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{elements:r,appState:a,files:i}=await ch(t,e);return{elements:r,appState:a,files:i,captureUpdate:fn.IMMEDIATELY}}catch(r){return r?.name==="AbortError"?(console.warn(r),!1):{elements:e,appState:{...t,errorMessage:r.message},files:n.files,captureUpdate:fn.EVENTUALLY}}},keyTest:e=>e[Ls.CTRL_OR_CMD]&&e.key===Ls.O}),bI=W({name:"exportWithDarkMode",label:"imageExportDialog.label.darkMode",trackEvent:{category:"export",action:"toggleTheme"},perform:(e,t,o)=>({appState:{...t,exportWithDarkMode:o},captureUpdate:fn.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>Er("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:Er(Z2,{value:e.exportWithDarkMode?zf.DARK:zf.LIGHT,onChange:o=>{t(o===zf.DARK)},title:f("imageExportDialog.label.darkMode")})})});import{DEFAULT_FONT_SIZE as WR,DEFAULT_FONT_FAMILY as YR,DEFAULT_TEXT_ALIGN as $R,CODES as xI,KEYS as yI,getLineHeight as VR}from"@orangecatai/common";import{newElementWith as dp}from"@orangecatai/element";import{hasBoundTextElement as KR,canApplyRoundnessTypeToElement as XR,getDefaultRoundnessTypeForElement as ZR,isFrameLikeElement as jR,isArrowElement as qR,isExcalidrawElement as JR,isTextElement as Uf}from"@orangecatai/element";import{getBoundTextElement as QR,redrawTextBoundingBox as e7}from"@orangecatai/element";import{CaptureUpdateAction as Wf}from"@orangecatai/element";var EI="{}",Yf=W({name:"copyStyles",label:"labels.copyStyles",icon:Bh,trackEvent:{category:"element"},perform:(e,t,o,n)=>{let r=[],a=e.find(i=>t.selectedElementIds[i.id]);if(r.push(a),a&&KR(a)){let i=QR(a,n.scene.getNonDeletedElementsMap());r.push(i)}return a&&(EI=JSON.stringify(r)),{appState:{...t,toast:{message:f("toast.copyStyles")}},captureUpdate:Wf.EVENTUALLY}},keyTest:e=>e[yI.CTRL_OR_CMD]&&e.altKey&&e.code===xI.C}),$f=W({name:"pasteStyles",label:"labels.pasteStyles",icon:Bh,trackEvent:{category:"element"},perform:(e,t,o,n)=>{let r=JSON.parse(EI),a=r[0],i=r[1];if(!JR(a))return{elements:e,captureUpdate:Wf.EVENTUALLY};let s=de(e,t,{includeBoundTextElement:!0}),l=s.map(c=>c.id);return{elements:e.map(c=>{if(l.includes(c.id)){let m=a;if(Uf(c)&&c.containerId&&(m=i),!m)return c;let p=dp(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?XR(m.roundness.type,c)?m.roundness:ZR(c):null});if(Uf(p)){let d=m.fontSize||WR,u=m.fontFamily||YR;p=dp(p,{fontSize:d,fontFamily:u,textAlign:m.textAlign||$R,lineHeight:m.lineHeight||VR(u)});let h=null;p.containerId&&(h=s.find(g=>Uf(p)&&g.id===p.containerId)||null),e7(p,h,n.scene)}return p.type==="arrow"&&qR(m)&&(p=dp(p,{startArrowhead:m.startArrowhead,endArrowhead:m.endArrowhead})),jR(c)&&(p=dp(p,{roundness:null,backgroundColor:"transparent"})),p}return c}),captureUpdate:Wf.IMMEDIATELY}},keyTest:e=>e[yI.CTRL_OR_CMD]&&e.altKey&&e.code===xI.V});import{KEYS as t7}from"@orangecatai/common";import{CaptureUpdateAction as o7}from"@orangecatai/element";var oi=W({name:"toggleShortcuts",label:"welcomeScreen.defaults.helpHint",icon:HE,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:o7.EVENTUALLY}),keyTest:e=>e.key===t7.QUESTION_MARK});import{getNonDeletedElements as pp}from"@orangecatai/element";import{newElementWith as II}from"@orangecatai/element";import{isBoundToContainer as n7}from"@orangecatai/element";import{frameAndChildrenSelectedTogether as r7,getElementsInResizingFrame as a7,getFrameLikeElements as i7,getRootElements as s7,groupByFrameLikes as l7,removeElementsFromFrame as c7,replaceAllElementsInFrame as d7}from"@orangecatai/element";import{KEYS as up,randomId as m7,arrayToMap as Vf}from"@orangecatai/common";import{getSelectedGroupIds as mp,selectGroup as p7,selectGroupsForSelectedElements as u7,getElementsInGroup as wI,addToGroup as g7,removeFromSelectedGroups as h7,isElementInGroup as TI}from"@orangecatai/element";import{syncMovedIndices as f7}from"@orangecatai/element";import{CaptureUpdateAction as Lc}from"@orangecatai/element";import{jsx as Ds}from"react/jsx-runtime";var b7=e=>{if(e.length>=2){let t=e[0].groupIds;for(let o of t)if(e.reduce((n,r)=>n&&TI(r,o),!0))return!0}return!1},vI=(e,t,o)=>{let n=o.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});return n.length>=2&&!b7(n)&&!r7(n)},Kf=W({name:"group",label:"labels.group",icon:e=>Ds(Lh,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,o,n)=>{let r=s7(n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}));if(r.length<2)return{appState:t,elements:e,captureUpdate:Lc.EVENTUALLY};let a=mp(t);if(a.length===1){let x=a[0],E=new Set(wI(e,x).map(v=>v.id)),y=new Set(r.map(v=>v.id));if(new Set([...Array.from(E),...Array.from(y)]).size===E.size)return{appState:t,elements:e,captureUpdate:Lc.EVENTUALLY}}let i=[...e];new Set(r.map(x=>x.frameId)).size>1&&l7(r).forEach((E,y)=>{c7(E,n.scene.getNonDeletedElementsMap())});let l=m7(),c=Vf(r);i=i.map(x=>c.get(x.id)?II(x,{groupIds:g7(x.groupIds,l,t.editingGroupId)}):x);let m=wI(i,l),p=m[m.length-1],d=i.lastIndexOf(p),u=i.slice(d+1),h=i.slice(0,d).filter(x=>!TI(x,l)),g=f7([...h,...m,...u],Vf(m));return{appState:{...t,...p7(l,{...t,selectedGroupIds:{}},pp(i))},elements:g,captureUpdate:Lc.IMMEDIATELY}},predicate:(e,t,o,n)=>vI(e,t,n),keyTest:e=>!e.shiftKey&&e[up.CTRL_OR_CMD]&&e.key===up.G,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>Ds(ae,{hidden:!vI(e,t,n),type:"button",icon:Ds(Lh,{theme:t.theme}),onClick:()=>o(null),title:`${f("labels.group")} \u2014 ${G("CtrlOrCmd+G")}`,"aria-label":f("labels.group"),visible:Ge(pp(e),t)})}),Xf=W({name:"ungroup",label:"labels.ungroup",icon:e=>Ds(_h,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,o,n)=>{let r=mp(t),a=Vf(e);if(r.length===0)return{appState:t,elements:e,captureUpdate:Lc.EVENTUALLY};let i=[...e],s=[];i=i.map(d=>{n7(d)&&s.push(d.id);let u=h7(d.groupIds,t.selectedGroupIds);return u.length===d.groupIds.length?d:II(d,{groupIds:u})});let l=u7(t,pp(i),t,null),c=n.scene.getSelectedElements(t),m=new Set(c.filter(d=>d.frameId).map(d=>d.frameId));return i7(e).filter(d=>m.has(d.id)).forEach(d=>{d&&(i=d7(i,a7(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:Lc.IMMEDIATELY}},keyTest:e=>e.shiftKey&&e[up.CTRL_OR_CMD]&&e.key===up.G.toUpperCase(),predicate:(e,t)=>mp(t).length>0,PanelComponent:({elements:e,appState:t,updateData:o})=>Ds(ae,{type:"button",hidden:mp(t).length===0,icon:Ds(_h,{theme:t.theme}),onClick:()=>o(null),title:`${f("labels.ungroup")} \u2014 ${G("CtrlOrCmd+Shift+G")}`,"aria-label":f("labels.ungroup"),visible:Ge(pp(e),t)})});import T7 from"clsx";import{CaptureUpdateAction as PI}from"@orangecatai/element";import{invariant as C7}from"@orangecatai/common";import{COLOR_CHARCOAL_BLACK as x7,COLOR_VOICE_CALL as y7,COLOR_WHITE as hp,THEME as E7,UserIdleState as CI}from"@orangecatai/common";var gp=(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 w7(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 ni=(e,t)=>`hsl(${Math.abs(w7(t?.id||e))%37*10}, 100%, 83%)`,kI=e=>{let t=e?.trim()?.codePointAt(0);return(t?String.fromCodePoint(t):"?").toUpperCase()},SI=({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=ni(a,c);e.save(),e.strokeStyle=u,e.fillStyle=u;let h=t.remotePointerUserStates.get(a),g=d||h===CI.IDLE||h===CI.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 x=o.theme===E7.DARK?"#2f6330":y7,E=c?.isSpeaking;E&&(e.fillStyle=x,e.strokeStyle=x,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=hp,e.strokeStyle=hp,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 w=(E?s+0:s)+m/2,v=(E?l+0:l)+p+2,I=5,C=3,P=e.measureText(y),S=P.actualBoundingBoxDescent+P.actualBoundingBoxAscent,D=Math.max(S,12),_=w-1,k=v-1,M=P.width+2+I*2+2,B=D+2+C*2+2;if(e.roundRect?(e.beginPath(),e.roundRect(_,k,M,B,8),e.fillStyle=u,e.fill(),e.strokeStyle=hp,e.stroke(),E&&(e.beginPath(),e.roundRect(_-2,k-2,M+4,B+4,8),e.strokeStyle=x,e.stroke())):gp(e,_,k,M,B,8,hp),e.fillStyle=x7,e.fillText(y,w+I+1,v+C+P.actualBoundingBoxAscent+Math.floor((D-S)/2)+2),E){e.fillStyle=x;let O=8,N=8,z=5;e.fillRect(_+M+N,k+(B/2-O/2),2,O),e.fillRect(_+M+N+z,k+(B/2-O*2/2),2,O*2),e.fillRect(_+M+N+z*2,k+(B/2-O/2),2,O)}}e.restore(),e.closePath()}};import v7 from"clsx";import{useState as I7}from"react";import{jsx as MI}from"react/jsx-runtime";var Zf=({color:e,onClick:t,name:o,src:n,className:r})=>{let a=kI(o),[i,s]=I7(!1),l=!i&&n,c=l?void 0:{background:e};return MI("div",{className:v7("Avatar",r),style:c,onClick:t,children:l?MI("img",{className:"Avatar-img",src:n,alt:a,referrerPolicy:"no-referrer",onError:()=>s(!0)}):a})};import{jsx as Yn,jsxs as fp}from"react/jsx-runtime";var k7=W({name:"goToCollaborator",label:"Go to a collaborator",viewMode:!0,trackEvent:{category:"collab"},perform:(e,t,o)=>(C7(o,"actionGoToCollaborator: collaborator should be defined when actionGoToCollaborator is called"),!o.socketId||t.userToFollow?.socketId===o.socketId||o.isCurrentUser?{appState:{...t,userToFollow:null},captureUpdate:PI.EVENTUALLY}:{appState:{...t,userToFollow:{socketId:o.socketId,username:o.username||""},openMenu:t.openMenu==="canvas"?null:t.openMenu},captureUpdate:PI.EVENTUALLY}),PanelComponent:({updateData:e,data:t,appState:o})=>{let{socketId:n,collaborator:r,withName:a,isBeingFollowed:i}=t,s=ni(n,r),l=T7({"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?fp("div",{className:"UserList__collaborator-status-icon-speaking-indicator",title:f("userList.hint.isSpeaking"),children:[Yn("div",{}),Yn("div",{}),Yn("div",{})]}):r.isMuted?Yn("div",{className:"UserList__collaborator-status-icon-microphone-muted",title:f("userList.hint.micMuted"),children:Jw}):Yn("div",{title:f("userList.hint.inCall"),children:qw}):null;return a?fp("div",{className:`dropdown-menu-item dropdown-menu-item-base UserList__collaborator ${l}`,style:{"--avatar-size":"1.5rem"},onClick:()=>e(r),children:[Yn(Zf,{color:s,onClick:()=>{},name:r.username||"",src:r.avatarUrl,className:l}),Yn("div",{className:"UserList__collaborator-name",children:r.username}),fp("div",{className:"UserList__collaborator-status-icons","aria-hidden":!0,children:[i&&Yn("div",{className:"UserList__collaborator-status-icon-is-followed",title:f("userList.hint.followStatus"),children:ls}),c]})]}):fp("div",{className:`UserList__collaborator UserList__collaborator--avatar-only ${l}`,children:[Yn(Zf,{color:s,onClick:()=>{e(r)},name:r.username||"",src:r.avatarUrl,className:l}),c&&Yn("div",{className:"UserList__collaborator-status-icon",children:c})]})}});import{LIBRARY_DISABLED_TYPES as S7,randomId as M7}from"@orangecatai/common";import{deepCopyElement as P7}from"@orangecatai/element";import{CaptureUpdateAction as jf}from"@orangecatai/element";var qf=W({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 S7)if(r.some(i=>i.type===a))return{captureUpdate:jf.EVENTUALLY,appState:{...t,errorMessage:f(`errors.libraryElementTypeError.${a}`)}};return n.library.getLatestLibrary().then(a=>n.library.setLibrary([{id:M7(),status:"unpublished",elements:r.map(P7),created:Date.now()},...a])).then(()=>({captureUpdate:jf.EVENTUALLY,appState:{...t,toast:{message:f("toast.addedToLibrary")}}})).catch(a=>({captureUpdate:jf.EVENTUALLY,appState:{...t,errorMessage:a.message}}))},label:"labels.addToLibrary"});import{getNonDeletedElements as Rs}from"@orangecatai/element";import{isFrameLikeElement as A7}from"@orangecatai/element";import{updateFrameMembershipOfSelectedElements as L7}from"@orangecatai/element";import{KEYS as ea,arrayToMap as _7}from"@orangecatai/common";import{alignElements as D7}from"@orangecatai/element";import{CaptureUpdateAction as Ns}from"@orangecatai/element";import{getSelectedElementsByGroup as R7}from"@orangecatai/element";import{jsx as Fs}from"react/jsx-runtime";var ao=(e,t)=>{let o=t.scene.getSelectedElements(e);return R7(o,t.scene.getNonDeletedElementsMap(),e).length>1&&!o.some(n=>A7(n))},Bs=(e,t,o,n)=>{let r=o.scene.getSelectedElements(t),a=D7(r,n,o.scene,t),i=_7(a);return L7(e.map(s=>i.get(s.id)||s),t,o)},N7=W({name:"alignTop",label:"labels.alignTop",icon:Ch,trackEvent:{category:"element"},predicate:(e,t,o,n)=>ao(t,n),perform:(e,t,o,n)=>({appState:t,elements:Bs(e,t,n,{position:"start",axis:"y"}),captureUpdate:Ns.IMMEDIATELY}),keyTest:e=>e[ea.CTRL_OR_CMD]&&e.shiftKey&&e.key===ea.ARROW_UP,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>Fs(ae,{hidden:!ao(t,n),type:"button",icon:Ch,onClick:()=>o(null),title:`${f("labels.alignTop")} \u2014 ${G("CtrlOrCmd+Shift+Up")}`,"aria-label":f("labels.alignTop"),visible:Ge(Rs(e),t)})}),B7=W({name:"alignBottom",label:"labels.alignBottom",icon:kh,trackEvent:{category:"element"},predicate:(e,t,o,n)=>ao(t,n),perform:(e,t,o,n)=>({appState:t,elements:Bs(e,t,n,{position:"end",axis:"y"}),captureUpdate:Ns.IMMEDIATELY}),keyTest:e=>e[ea.CTRL_OR_CMD]&&e.shiftKey&&e.key===ea.ARROW_DOWN,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>Fs(ae,{hidden:!ao(t,n),type:"button",icon:kh,onClick:()=>o(null),title:`${f("labels.alignBottom")} \u2014 ${G("CtrlOrCmd+Shift+Down")}`,"aria-label":f("labels.alignBottom"),visible:Ge(Rs(e),t)})}),F7=W({name:"alignLeft",label:"labels.alignLeft",icon:Sh,trackEvent:{category:"element"},predicate:(e,t,o,n)=>ao(t,n),perform:(e,t,o,n)=>({appState:t,elements:Bs(e,t,n,{position:"start",axis:"x"}),captureUpdate:Ns.IMMEDIATELY}),keyTest:e=>e[ea.CTRL_OR_CMD]&&e.shiftKey&&e.key===ea.ARROW_LEFT,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>Fs(ae,{hidden:!ao(t,n),type:"button",icon:Sh,onClick:()=>o(null),title:`${f("labels.alignLeft")} \u2014 ${G("CtrlOrCmd+Shift+Left")}`,"aria-label":f("labels.alignLeft"),visible:Ge(Rs(e),t)})}),O7=W({name:"alignRight",label:"labels.alignRight",icon:Mh,trackEvent:{category:"element"},predicate:(e,t,o,n)=>ao(t,n),perform:(e,t,o,n)=>({appState:t,elements:Bs(e,t,n,{position:"end",axis:"x"}),captureUpdate:Ns.IMMEDIATELY}),keyTest:e=>e[ea.CTRL_OR_CMD]&&e.shiftKey&&e.key===ea.ARROW_RIGHT,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>Fs(ae,{hidden:!ao(t,n),type:"button",icon:Mh,onClick:()=>o(null),title:`${f("labels.alignRight")} \u2014 ${G("CtrlOrCmd+Shift+Right")}`,"aria-label":f("labels.alignRight"),visible:Ge(Rs(e),t)})}),z7=W({name:"alignVerticallyCentered",label:"labels.centerVertically",icon:Ph,trackEvent:{category:"element"},predicate:(e,t,o,n)=>ao(t,n),perform:(e,t,o,n)=>({appState:t,elements:Bs(e,t,n,{position:"center",axis:"y"}),captureUpdate:Ns.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>Fs(ae,{hidden:!ao(t,n),type:"button",icon:Ph,onClick:()=>o(null),title:f("labels.centerVertically"),"aria-label":f("labels.centerVertically"),visible:Ge(Rs(e),t)})}),H7=W({name:"alignHorizontallyCentered",label:"labels.centerHorizontally",icon:Ah,trackEvent:{category:"element"},predicate:(e,t,o,n)=>ao(t,n),perform:(e,t,o,n)=>({appState:t,elements:Bs(e,t,n,{position:"center",axis:"x"}),captureUpdate:Ns.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>Fs(ae,{hidden:!ao(t,n),type:"button",icon:Ah,onClick:()=>o(null),title:f("labels.centerHorizontally"),"aria-label":f("labels.centerHorizontally"),visible:Ge(Rs(e),t)})});import{getNonDeletedElements as AI}from"@orangecatai/element";import{isFrameLikeElement as G7}from"@orangecatai/element";import{CODES as LI,KEYS as _I,arrayToMap as U7}from"@orangecatai/common";import{updateFrameMembershipOfSelectedElements as W7}from"@orangecatai/element";import{distributeElements as Y7}from"@orangecatai/element";import{CaptureUpdateAction as DI}from"@orangecatai/element";import{getSelectedElementsByGroup as $7}from"@orangecatai/element";import{jsx as BI}from"react/jsx-runtime";var RI=(e,t)=>{let o=t.scene.getSelectedElements(e);return $7(o,t.scene.getNonDeletedElementsMap(),e).length>2&&!o.some(n=>G7(n))},NI=(e,t,o,n)=>{let r=o.scene.getSelectedElements(t),a=Y7(r,o.scene.getNonDeletedElementsMap(),n,t,o.scene),i=U7(a);return W7(e.map(s=>i.get(s.id)||s),t,o)},V7=W({name:"distributeHorizontally",label:"labels.distributeHorizontally",trackEvent:{category:"element"},perform:(e,t,o,n)=>({appState:t,elements:NI(e,t,n,{space:"between",axis:"x"}),captureUpdate:DI.IMMEDIATELY}),keyTest:e=>!e[_I.CTRL_OR_CMD]&&e.altKey&&e.code===LI.H,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>BI(ae,{hidden:!RI(t,n),type:"button",icon:JE,onClick:()=>o(null),title:`${f("labels.distributeHorizontally")} \u2014 ${G("Alt+H")}`,"aria-label":f("labels.distributeHorizontally"),visible:Ge(AI(e),t)})}),K7=W({name:"distributeVertically",label:"labels.distributeVertically",trackEvent:{category:"element"},perform:(e,t,o,n)=>({appState:t,elements:NI(e,t,n,{space:"between",axis:"y"}),captureUpdate:DI.IMMEDIATELY}),keyTest:e=>!e[_I.CTRL_OR_CMD]&&e.altKey&&e.code===LI.V,PanelComponent:({elements:e,appState:t,updateData:o,app:n})=>BI(ae,{hidden:!RI(t,n),type:"button",icon:QE,onClick:()=>o(null),title:`${f("labels.distributeVertically")} \u2014 ${G("Alt+V")}`,"aria-label":f("labels.distributeVertically"),visible:Ge(AI(e),t)})});import{getNonDeletedElements as X7}from"@orangecatai/element";import{bindOrUnbindBindingElements as Z7}from"@orangecatai/element";import{getCommonBoundingBox as FI}from"@orangecatai/element";import{newElementWith as j7}from"@orangecatai/element";import{deepCopyElement as q7}from"@orangecatai/element";import{resizeMultipleElements as J7}from"@orangecatai/element";import{isArrowElement as OI,isElbowArrow as Q7}from"@orangecatai/element";import{updateFrameMembershipOfSelectedElements as zI}from"@orangecatai/element";import{CODES as HI,KEYS as eN,arrayToMap as tN}from"@orangecatai/common";import{CaptureUpdateAction as GI}from"@orangecatai/element";var Jf=W({name:"flipHorizontal",label:"labels.flipHorizontal",icon:ov,trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:zI(UI(e,n.scene.getNonDeletedElementsMap(),t,"horizontal",n),t,n),appState:t,captureUpdate:GI.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===HI.H}),Qf=W({name:"flipVertical",label:"labels.flipVertical",icon:tv,trackEvent:{category:"element"},perform:(e,t,o,n)=>({elements:zI(UI(e,n.scene.getNonDeletedElementsMap(),t,"vertical",n),t,n),appState:t,captureUpdate:GI.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===HI.V&&!e[eN.CTRL_OR_CMD]}),UI=(e,t,o,n,r)=>{let a=de(X7(e),o,{includeBoundTextElement:!0,includeElementsInFrames:!0}),i=oN(a,t,n,r),s=tN(i);return e.map(l=>s.get(l.id)||l)},oN=(e,t,o,n)=>{if(e.every(d=>OI(d)&&(d.startBinding||d.endBinding)))return e.map(d=>{let u=d;return j7(u,{startArrowhead:u.endArrowhead,endArrowhead:u.startArrowhead})});let{midX:r,midY:a}=FI(e);J7(e,t,"nw",n.scene,new Map(Array.from(t.values()).map(d=>[d.id,q7(d)])),{flipByX:o==="horizontal",flipByY:o==="vertical",shouldResizeFromCenter:!0,shouldMaintainAspectRatio:!0}),Z7(e.filter(OI),n.scene,n.state);let{elbowArrows:i,otherElements:s}=e.reduce((d,u)=>Q7(u)?{...d,elbowArrows:d.elbowArrows.concat(u)}:{...d,otherElements:d.otherElements.concat(u)},{elbowArrows:[],otherElements:[]}),{midX:l,midY:c}=FI(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 nN}from"@orangecatai/element";import{getTextFromElements as rN}from"@orangecatai/element";import{CODES as aN,KEYS as WI,isFirefox as iN}from"@orangecatai/common";import{CaptureUpdateAction as _o}from"@orangecatai/element";var Os=W({name:"copy",label:"labels.copy",icon:tc,trackEvent:{category:"element"},perform:async(e,t,o,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});try{await ip(r,n.files,o)}catch(a){return{captureUpdate:_o.EVENTUALLY,appState:{...t,errorMessage:a.message}}}return{captureUpdate:_o.EVENTUALLY}},keyTest:void 0}),eb=W({name:"paste",label:"labels.paste",trackEvent:{category:"element"},perform:async(e,t,o,n)=>{let r;try{r=await mI()}catch(a){return a.name==="AbortError"||a.name==="NotAllowedError"?!1:(console.error(`actionPaste ${a.name}: ${a.message}`),iN?{captureUpdate:_o.EVENTUALLY,appState:{...t,errorMessage:f("hints.firefox_clipboard_write")}}:{captureUpdate:_o.EVENTUALLY,appState:{...t,errorMessage:f("errors.asyncPasteFailedOnRead")}})}try{n.pasteFromClipboard(cI({types:r}))}catch(a){return console.error(a),{captureUpdate:_o.EVENTUALLY,appState:{...t,errorMessage:f("errors.asyncPasteFailedOnParse")}}}return{captureUpdate:_o.EVENTUALLY}},keyTest:void 0}),bp=W({name:"cut",label:"labels.cut",icon:Ow,trackEvent:{category:"element"},perform:(e,t,o,n)=>(Os.perform(e,t,o,n),dc.perform(e,t,null,n)),keyTest:e=>e[WI.CTRL_OR_CMD]&&e.key===WI.X}),xp=W({name:"copyAsSvg",label:"labels.copyAsSvg",icon:nv,trackEvent:{category:"element"},perform:async(e,t,o,n)=>{if(!n.canvas)return{captureUpdate:_o.EVENTUALLY};let{exportedElements:r,exportingFrame:a}=Qa(e,t,!0);try{await ei("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:f("toast.copyToClipboardAsSvg",{exportSelection:i.length?f("toast.selection"):f("toast.canvas"),exportColorScheme:t.exportWithDarkMode?f("buttons.darkMode"):f("buttons.lightMode")})}},captureUpdate:_o.EVENTUALLY}}catch(i){return console.error(i),{appState:{errorMessage:i.message},captureUpdate:_o.EVENTUALLY}}},predicate:e=>ap&&e.length>0,keywords:["svg","clipboard","copy"]}),yp=W({name:"copyAsPng",label:"labels.copyAsPng",icon:rv,trackEvent:{category:"element"},perform:async(e,t,o,n)=>{if(!n.canvas)return{captureUpdate:_o.EVENTUALLY};let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),{exportedElements:a,exportingFrame:i}=Qa(e,t,!0);try{return await ei("clipboard",a,t,n.files,{...t,exportingFrame:i,name:n.getName()}),{appState:{...t,toast:{message:f("toast.copyToClipboardAsPng",{exportSelection:r.length?f("toast.selection"):f("toast.canvas"),exportColorScheme:t.exportWithDarkMode?f("buttons.darkMode"):f("buttons.lightMode")})}},captureUpdate:_o.EVENTUALLY}}catch(s){return console.error(s),{appState:{...t,errorMessage:s.message},captureUpdate:_o.EVENTUALLY}}},predicate:e=>Ps&&e.length>0,keyTest:e=>e.code===aN.C&&e.altKey&&e.shiftKey,keywords:["png","clipboard","copy"]}),Ep=W({name:"copyText",label:"labels.copyText",trackEvent:{category:"element"},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});try{hn(rN(r))}catch{throw new Error(f("errors.copyToSystemClipboardFailed"))}return{captureUpdate:_o.EVENTUALLY}},predicate:(e,t,o,n)=>ap&&n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}).some(nN),keywords:["text","clipboard","copy"]});import{CODES as sN,KEYS as lN}from"@orangecatai/common";import{CaptureUpdateAction as cN}from"@orangecatai/element";var zs=W({name:"gridMode",icon:cv,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:cN.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,o)=>o.gridModeEnabled===void 0,keyTest:e=>e[lN.CTRL_OR_CMD]&&e.code===sN.QUOTE});import{CODES as dN,KEYS as mN}from"@orangecatai/common";import{CaptureUpdateAction as pN}from"@orangecatai/element";var ta=W({name:"zenMode",label:"buttons.zenMode",icon:iv,viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.zenModeEnabled},perform(e,t){return{appState:{...t,zenModeEnabled:!this.checked(t)},captureUpdate:pN.EVENTUALLY}},checked:e=>e.zenModeEnabled,predicate:(e,t,o,n)=>n.editorInterface.formFactor!=="phone"&&typeof o.zenModeEnabled>"u",keyTest:e=>!e[mN.CTRL_OR_CMD]&&e.altKey&&e.code===dN.Z});import{CODES as uN,KEYS as gN}from"@orangecatai/common";import{CaptureUpdateAction as hN}from"@orangecatai/element";var _c=W({name:"objectsSnapMode",label:"buttons.objectsSnapMode",icon:av,viewMode:!1,trackEvent:{category:"canvas",predicate:e=>!e.objectsSnapModeEnabled},perform(e,t){return{appState:{...t,objectsSnapModeEnabled:!this.checked(t),gridModeEnabled:!1},captureUpdate:hN.EVENTUALLY}},checked:e=>e.objectsSnapModeEnabled,predicate:(e,t,o)=>typeof o.objectsSnapModeEnabled>"u",keyTest:e=>!e[gN.CTRL_OR_CMD]&&e.altKey&&e.code===uN.S});import{CODES as fN,KEYS as bN}from"@orangecatai/common";import{CaptureUpdateAction as xN}from"@orangecatai/element";var oa=W({name:"stats",label:"stats.fullTitle",icon:ev,viewMode:!0,trackEvent:{category:"menu"},keywords:["edit","attributes","customize"],perform(e,t){return{appState:{...t,stats:{...t.stats,open:!this.checked(t)}},captureUpdate:xN.EVENTUALLY}},checked:e=>e.stats.open,keyTest:e=>!e[bN.CTRL_OR_CMD]&&e.altKey&&e.code===fN.SLASH});import{BOUND_TEXT_PADDING as YI,ROUNDNESS as $I,TEXT_ALIGN as XI,VERTICAL_ALIGN as ZI,arrayToMap as jI,getFontString as yN}from"@orangecatai/common";import{getOriginalContainerHeightFromCache as EN,isBoundToContainer as VI,resetOriginalContainerCache as wN,updateOriginalContainerCache as vN}from"@orangecatai/element";import{computeBoundTextPosition as IN,computeContainerDimensionForBoundText as KI,getBoundTextElement as qI,redrawTextBoundingBox as JI}from"@orangecatai/element";import{hasBoundTextElement as TN,isArrowElement as CN,isTextBindableContainer as tb,isTextElement as Dc,isUsingAdaptiveRadius as kN}from"@orangecatai/element";import{measureText as SN}from"@orangecatai/element";import{syncMovedIndices as QI}from"@orangecatai/element";import{newElement as MN}from"@orangecatai/element";import{CaptureUpdateAction as ob}from"@orangecatai/element";var nb=W({name:"unbindText",label:"labels.unbindText",trackEvent:{category:"element"},predicate:(e,t,o,n)=>n.scene.getSelectedElements(t).some(a=>TN(a)),perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t),a=n.scene.getNonDeletedElementsMap();return r.forEach(i=>{let s=qI(i,a);if(s){let{width:l,height:c}=SN(s.originalText,yN(s),s.lineHeight),m=EN(i.id);wN(i.id);let{x:p,y:d}=IN(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:ob.IMMEDIATELY}}}),rb=W({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=Dc(r[0])||Dc(r[1]),i;if(tb(r[0])?i=r[0]:tb(r[1])&&(i=r[1]),a&&i&&qI(i,n.scene.getNonDeletedElementsMap())===null)return!0}return!1},perform:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t),a,i;Dc(r[0])&&tb(r[1])?(a=r[0],i=r[1]):(a=r[1],i=r[0]),n.scene.mutateElement(a,{containerId:i.id,verticalAlign:ZI.MIDDLE,textAlign:XI.CENTER,autoResize:!0,angle:CN(i)?0:i?.angle??0}),n.scene.mutateElement(i,{boundElements:(i.boundElements||[]).concat({type:"text",id:a.id})});let s=i.height;return JI(a,i,n.scene),vN(i.id,s),{elements:PN(e,i,a),appState:{...t,selectedElementIds:{[i.id]:!0}},captureUpdate:ob.IMMEDIATELY}}}),PN=(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),QI(n,jI([t,o])),n},AN=(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),QI(n,jI([t,o])),n},eT=W({name:"wrapTextInContainer",label:"labels.createContainerFromText",trackEvent:{category:"element"},predicate:(e,t,o,n)=>{let r=n.scene.getSelectedElements(t),a=r.some(i=>Dc(i)&&!VI(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(Dc(s)&&!VI(s)){let l=MN({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:kN("rectangle")?$I.ADAPTIVE_RADIUS:$I.PROPORTIONAL_RADIUS}:null,opacity:100,locked:!1,x:s.x-YI,y:s.y-YI,width:KI(s.width,"rectangle"),height:KI(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:ZI.MIDDLE,boundElements:null,textAlign:XI.CENTER,autoResize:!0}),JI(s,l,n.scene),a=AN([...a,l],l,s),i[l.id]=!0}return{elements:a,appState:{...t,selectedElementIds:i},captureUpdate:ob.IMMEDIATELY}}});import{isEmbeddableElement as KN}from"@orangecatai/element";import{KEYS as dT}from"@orangecatai/common";import{CaptureUpdateAction as XN}from"@orangecatai/element";import{pointFrom as rT}from"@orangecatai/math";import LN from"clsx";import{useCallback as tT,useEffect as oT,useLayoutEffect as _N,useRef as DN,useState as RN}from"react";import{EVENT as ab,HYPERLINK_TOOLTIP_DELAY as NN,KEYS as wp}from"@orangecatai/common";import{getElementAbsoluteCoords as db}from"@orangecatai/element";import{hitElementBoundingBox as BN}from"@orangecatai/element";import{isElementLink as FN}from"@orangecatai/element";import{getEmbedLink as ON,embeddableURLValidator as zN}from"@orangecatai/element";import{sceneCoordsToViewportCoords as aT,viewportCoordsToSceneCoords as HN,wrapEvent as GN,isLocalLink as UN,normalizeLink as ib}from"@orangecatai/common";import{isEmbeddableElement as sb}from"@orangecatai/element";import{jsx as Hs,jsxs as nT}from"react/jsx-runtime";var mb=380,WN=42,lb=5,iT=85,YN=500,cb=!1,vp=new Map,sT=({element:e,scene:t,setAppState:o,onLinkOpen:n,setToast:r,updateEmbedValidationStatus:a})=>{let i=t.getNonDeletedElementsMap(),s=$o(),l=Hn(),c=Te(),m=e.link||"",[p,d]=RN(m),u=DN(null),h=s.showHyperlinkPopup==="editor",g=tT(()=>{if(!u.current)return;let v=ib(u.current.value)||null;if(!e.link&&v&&be("hyperlink","create"),sb(e)){if(s.activeEmbeddable?.element===e&&o({activeEmbeddable:null}),!v){t.mutateElement(e,{link:null}),a(e,!1);return}if(!zN(v,l.validateEmbeddable))v&&r({message:f("toast.unableToEmbed"),closable:!0}),e.link&&vp.set(e.id,e.link),t.mutateElement(e,{link:v}),a(e,!1);else{let{width:I,height:C}=e,P=ON(v);P?.error instanceof URIError&&r({message:f("toast.unrecognizedLinkFormat"),closable:!0});let S=P?P.intrinsicSize.w/P.intrinsicSize.h:1,D=vp.get(e.id)!==e.link;t.mutateElement(e,{...D?{width:P?.type==="video"?I>C?I:C*S:I,height:P?.type==="video"&&I>C?I/S:C}:{},link:v}),a(e,!0),vp.has(e.id)&&vp.delete(e.id)}}else t.mutateElement(e,{link:v})},[e,t,r,l.validateEmbeddable,s.activeEmbeddable,o,a]);_N(()=>()=>{g()},[g]),oT(()=>{h&&u?.current&&!(c.formFactor==="phone"||c.isTouchScreen)&&u.current.select()},[h,c.formFactor,c.isTouchScreen]),oT(()=>{let v=null,I=C=>{if(h)return;v&&clearTimeout(v),VN(e,i,s,rT(C.clientX,C.clientY))&&(v=window.setTimeout(()=>{o({showHyperlinkPopup:!1})},YN))};return window.addEventListener(ab.POINTER_MOVE,I,!1),()=>{window.removeEventListener(ab.POINTER_MOVE,I,!1),v&&clearTimeout(v)}},[s,e,h,o,i]);let x=tT(()=>{be("hyperlink","delete"),t.mutateElement(e,{link:null}),o({showHyperlinkPopup:!1})},[o,e,t]),E=()=>{be("hyperlink","edit","popup-ui"),o({showHyperlinkPopup:"editor"})},{x:y,y:w}=lT(e,s,i);return s.contextMenu||s.selectedElementsAreBeingDragged||s.resizingElement||s.isRotating||s.openMenu||s.viewModeEnabled?null:nT("div",{className:"excalidraw-hyperlinkContainer",style:{top:`${w}px`,left:`${y}px`,width:mb,padding:lb},children:[h?Hs("input",{className:LN("excalidraw-hyperlinkContainer-input"),placeholder:f("labels.link.hint"),ref:u,value:p,onChange:v=>d(v.target.value),autoFocus:!0,onKeyDown:v=>{v.stopPropagation(),v[wp.CTRL_OR_CMD]&&v.key===wp.K&&v.preventDefault(),(v.key===wp.ENTER||v.key===wp.ESCAPE)&&(g(),o({showHyperlinkPopup:"info"}))}}):e.link?Hs("a",{href:ib(e.link||""),className:"excalidraw-hyperlinkContainer-link",target:UN(e.link)?"_self":"_blank",onClick:v=>{if(e.link&&n){let I=GN(ab.EXCALIDRAW_LINK,v.nativeEvent);n({...e,link:ib(e.link)},I),I.defaultPrevented&&v.preventDefault()}},rel:"noopener noreferrer",children:e.link}):Hs("div",{className:"excalidraw-hyperlinkContainer-link",children:f("labels.link.empty")}),nT("div",{className:"excalidraw-hyperlinkContainer__buttons",children:[!h&&Hs(ae,{type:"button",title:f("buttons.edit"),"aria-label":f("buttons.edit"),label:f("buttons.edit"),onClick:E,className:"excalidraw-hyperlinkContainer--edit",icon:Bn}),Hs(ae,{type:"button",title:f("labels.linkToElement"),"aria-label":f("labels.linkToElement"),label:f("labels.linkToElement"),onClick:()=>{o({openDialog:{name:"elementLinkSelector",sourceElementId:e.id}})},icon:Cm}),m&&!sb(e)&&Hs(ae,{type:"button",title:f("buttons.remove"),"aria-label":f("buttons.remove"),label:f("buttons.remove"),onClick:x,className:"excalidraw-hyperlinkContainer--remove",icon:Ut})]})]})},lT=(e,t,o)=>{let[n,r]=db(e,o),{x:a,y:i}=aT({sceneX:n+e.width/2,sceneY:r},t),s=a-t.offsetLeft-mb/2,l=i-t.offsetTop-iT;return{x:s,y:l}},pb=(e,t)=>{let o=de(e,t);return sb(o[0])?"labels.link.editEmbed":o[0]?.link?"labels.link.edit":"labels.link.create"},Rc=null,cT=(e,t,o)=>{Rc&&clearTimeout(Rc),Rc=window.setTimeout(()=>$N(e,t,o),NN)},$N=(e,t,o)=>{if(!e.link)return;let n=Ts();n.classList.add("excalidraw-tooltip--visible"),n.style.maxWidth="20rem",n.textContent=FN(e.link)?f("labels.link.goToElement"):e.link;let[r,a,i,s]=db(e,o),[l,c,m,p]=sE([r,a,i,s],e.angle,t),d=aT({sceneX:l,sceneY:c},t);Mf(n,{left:d.x,top:d.y,width:m,height:p},"top"),be("hyperlink","tooltip","link-icon"),cb=!0},ub=()=>{Rc&&clearTimeout(Rc),cb&&(cb=!1,Ts().classList.remove("excalidraw-tooltip--visible"))},VN=(e,t,o,[n,r])=>{let{x:a,y:i}=HN({clientX:n,clientY:r},o),s=15/o.zoom.value;if(BN(rT(a,i),e,t))return!1;let[l,c,m]=db(e,t);if(a>=l&&a<=m&&i>=c-iT&&i<=c)return!1;let{x:p,y:d}=lT(e,o,t);return!(n>=p-s&&n<=p+mb+lb*2+s&&r>=d-s&&r<=d+s+lb*2+WN)};import{jsx as ZN}from"react/jsx-runtime";var Nc=W({name:"hyperlink",label:(e,t)=>pb(e,t),icon:rc,perform:(e,t)=>t.showHyperlinkPopup==="editor"?!1:{elements:e,appState:{...t,showHyperlinkPopup:"editor",openMenu:null},captureUpdate:XN.IMMEDIATELY},trackEvent:{category:"hyperlink",action:"click"},keyTest:e=>e[dT.CTRL_OR_CMD]&&e.key===dT.K,predicate:(e,t)=>de(e,t).length===1,PanelComponent:({elements:e,appState:t,updateData:o})=>{let n=de(e,t);return ZN(ae,{type:"button",icon:rc,"aria-label":f(pb(e,t)),title:`${KN(e[0])?f("labels.link.labelEmbed"):f("labels.link.label")} - ${G("CtrlOrCmd+K")}`,onClick:()=>o(null),selected:n.length===1&&!!n[0].link})}});import{KEYS as mT,arrayToMap as hb,randomId as jN}from"@orangecatai/common";import{elementsAreInSameGroup as qN,newElementWith as pT,selectGroupsFromGivenElements as uT}from"@orangecatai/element";import{CaptureUpdateAction as gT}from"@orangecatai/element";var gb=e=>e.every(t=>!t.locked),Bc=W({name:"toggleElementLock",label:(e,t,o)=>{let n=o.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1});return gb(n)?"labels.elementLock.lock":"labels.elementLock.unlock"},icon:(e,t)=>{let o=de(t,e);return gb(o)?ji:Wa},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=gb(r),i=hb(r),s=r.length>1&&qN(r),c=r.length===1||s?null:jN(),m={...t.lockedMultiSelections};if(a)m={...t.lockedMultiSelections,...c?{[c]:!0}:{}};else if(s){let E=r[0].groupIds.at(-1);delete m[E]}let p=e.map(E=>{if(!i.has(E.id))return E;let y=E.groupIds;return a?c&&(y=[...y,c]):y=y.filter(w=>!t.lockedMultiSelections[w]),pT(E,{locked:a,groupIds:y.length!==E.groupIds.length?y:E.groupIds})}),d=hb(p),u=a?{}:Object.fromEntries(r.map(E=>[E.id,!0])),h=r.map(E=>d.get(E.id)||E),g=a?{}:uT(h,t),x=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:x},captureUpdate:gT.IMMEDIATELY}},keyTest:(e,t,o,n)=>e.key.toLocaleLowerCase()===mT.L&&e[mT.CTRL_OR_CMD]&&e.shiftKey&&n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}).length>0}),hT=W({name:"unlockAllElements",trackEvent:{category:"canvas"},viewMode:!1,icon:Wa,predicate:(e,t)=>de(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 pT(i,{locked:!1,groupIds:i.groupIds.length!==s.length?s:i.groupIds})}return i}),r=hb(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:uT(a,t),lockedMultiSelections:{},activeLockedId:null},captureUpdate:gT.IMMEDIATELY}},label:"labels.elementLock.unlockAll"});import{isElbowArrow as Fz,isLinearElement as Oz,isLineElement as al}from"@orangecatai/element";import{arrayToMap as zz,invariant as I0}from"@orangecatai/common";import{toggleLinePolygonState as Hz,CaptureUpdateAction as O5}from"@orangecatai/element";import p5 from"clsx";import SO from"fuzzy";import{useEffect as qp,useRef as u5,useMemo as MO,useState as jp}from"react";import{DEFAULT_SIDEBAR as c5,EVENT as Qp,KEYS as yn,capitalizeString as PO,isWritableElement as AO}from"@orangecatai/common";import{CaptureUpdateAction as D9}from"@orangecatai/element";import{useEffect as zc,useMemo as fT,useRef as yb,useState as JN}from"react";import{getLinearElementSubType as Ws,updateElbowArrowPoints as QN}from"@orangecatai/element";import{pointFrom as Tp,pointRotateRads as e9}from"@orangecatai/math";import{hasBoundTextElement as t9,isArrowBoundToElement as o9,isArrowElement as n9,isElbowArrow as r9,isLinearElement as Ib,isUsingAdaptiveRadius as a9}from"@orangecatai/element";import{getCommonBoundingBox as i9,getElementAbsoluteCoords as s9}from"@orangecatai/element";import{getBoundTextElement as wT,getBoundTextMaxHeight as l9,getBoundTextMaxWidth as c9,redrawTextBoundingBox as d9}from"@orangecatai/element";import{wrapText as m9}from"@orangecatai/element";import{assertNever as p9,CLASSES as u9,getFontString as fb,isProdEnv as g9,mapFind as h9,reduceToCommonValue as f9,updateActiveTool as bT}from"@orangecatai/common";import{measureText as xT}from"@orangecatai/element";import{LinearElementEditor as b9}from"@orangecatai/element";import{newArrowElement as bb,newElement as x9,newLinearElement as y9}from"@orangecatai/element";import{ShapeCache as E9}from"@orangecatai/element";import{updateBindings as w9}from"@orangecatai/element";import{jsx as vb}from"react/jsx-runtime";var v9=8,I9=10,Fc=["rectangle","diamond","ellipse"],Oc=["line","sharpArrow","curvedArrow","elbowArrow"],T9=new Set(Fc),C9=new Set(Oc),Ys=e=>T9.has(e),kp=e=>e==="arrow"||C9.has(e),bn=Pe(null),Hc=new Map,Gc=new Map,k9=({app:e})=>{let t=e.scene.getSelectedElements(e.state),o=yb(null);return zc(()=>{if(t.length===0){e.updateEditorAtom(bn,null);return}let n=$s(t);n&&!o.current?o.current=n:(o.current&&!n||o.current&&n!==o.current)&&(e.updateEditorAtom(bn,null),o.current=null)},[t,e]),zc(()=>()=>{Hc.clear(),Gc.clear()},[]),vb(S9,{app:e,elements:t})},S9=({app:e,elements:t})=>{let o=$s(t),n=fT(()=>o==="generic"?IT(t):[],[o,t]),r=fT(()=>o==="linear"?wb(t):[],[o,t]),a=o==="generic"?n.every(p=>p.type===n[0].type):o==="linear"?r.every(p=>Ws(p)===Ws(r[0])):!1,[i,s]=JN({x:0,y:0}),l=yb(""),c=yb(null);zc(()=>{let p=[...n,...r].sort((x,E)=>x.id.localeCompare(E.id)),d=`
|
|
7
7
|
${e.state.scrollX}${e.state.scrollY}${e.state.offsetTop}${e.state.offsetLeft}${e.state.zoom.value}${p.map(x=>x.id).join(",")}`;if(d===l.current)return;l.current=d;let u;if(p.length===1){let[x,,,E,y,w]=s9(p[0],e.scene.getNonDeletedElementsMap());u=e9(Tp(x,E),Tp(y,w),p[0].angle)}else{let{minX:x,maxY:E}=i9(p);u=Tp(x,E)}let{x:h,y:g}=CT({sceneX:u[0],sceneY:u[1]},e.state);s({x:h,y:g})},[n,r,e.scene,e.state]),zc(()=>{for(let p of r){let d=Eb(p.id,_9(p));Gc.has(d)||Gc.set(d,p)}},[r]),zc(()=>{for(let p of n)if(!Hc.has(p.id)){let d=wT(p,e.scene.getNonDeletedElementsMap());d&&Hc.set(p.id,{fontSize:d.fontSize})}},[n,e.scene]);let m=o==="linear"?[["line",es],["sharpArrow",ds],["curvedArrow",ps],["elbowArrow",ms]]:o==="generic"?[["rectangle",qi],["diamond",Ji],["ellipse",Qi]]:[];return vb("div",{ref:c,tabIndex:-1,style:{position:"absolute",top:`${i.y+(I9+8)*e.state.zoom.value-e.state.offsetTop}px`,left:`${i.x-e.state.offsetLeft-v9}px`,zIndex:2},className:u9.CONVERT_ELEMENT_TYPE_POPUP,children:m.map(([p,d])=>{let u=a&&(o==="generic"&&n[0].type===p||o==="linear"&&Ws(r[0])===p);return vb(ae,{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&&be("convertElementType",p,"ui"),Tb(e,{conversionType:o,nextType:p}),c.current?.focus()}},`${t[0].id}${t[0].version}_${p}`)})})},M9=(e,t,o)=>{let n=c9(e,t),r=l9(e,t),a=m9(t.text,fb(t),n),i=xT(a,fb(t),t.lineHeight),s=t.fontSize;for(;(i.width>n||i.height>r)&&s>0;){s-=1;let l={...t,fontSize:s};i=xT(t.text,fb(l),t.lineHeight)}Sp(t,o.getNonDeletedElementsMap(),{fontSize:s,width:i.width,height:i.height}),d9(t,e,o)},Tb=(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=IT(r),c=s.every(m=>m.type===s[0].type)?Fc.indexOf(s[0].type):-1;if(o=o??Fc[(c+Fc.length+i)%Fc.length],o&&Ys(o)){let m={};for(let d of s){let u=ET(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=wT(d,e.scene.getNonDeletedElementsMap());u&&(Hc.get(d.id)&&Sp(u,e.scene.getNonDeletedElementsMap(),{fontSize:Hc.get(d.id)?.fontSize??u.fontSize}),M9(d,u,e.scene))}e.setState(d=>({selectedElementIds:a,activeTool:bT(d,{type:"selection"})}))}}if(t==="linear"){let s=wb(r);if(!o){let c=f9(s,Ws),m=c?Oc.indexOf(c):-1;o=Oc[(m+Oc.length+i)%Oc.length]}if(kp(o)){let c=[],m=e.scene.getElementsMapIncludingDeleted();for(let p of s){let d=Gc.get(Eb(p.id,o));if(d&&Ws(d)===o)m.set(d.id,d),c.push(d);else{let u=ET(p,o,e);m.set(u.id,u),c.push(u)}}e.scene.replaceAllElements(m);for(let p of c)if(Ib(p))if(r9(p)){let d=P9(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=QN(p,e.scene.getNonDeletedElementsMap(),{points:d,fixedSegments:u});Sp(p,e.scene.getNonDeletedElementsMap(),{...h,endArrowhead:"arrow"})}else{let d=h9(["line","sharpArrow","curvedArrow"],u=>Gc.get(Eb(p.id,u)));if(d){let u=d.points;e.scene.mutateElement(p,{points:u})}}}let l=wb(e.scene.getSelectedElements(e.state));e.setState(c=>({selectedElementIds:a,selectedLinearElement:l.length===1?new b9(l[0],e.scene.getNonDeletedElementsMap()):null,activeTool:bT(c,{type:"selection"})}))}return!0},$s=e=>{if(e.length===0)return null;let t=!1;for(let o of e){if(Ys(o.type))return"generic";vT(o)&&(t=!0)}return t?"linear":null},vT=e=>Ib(e)&&(!n9(e)||!o9(e)&&!t9(e)),Eb=(e,t)=>`${e}:${t}`,IT=e=>e.filter(t=>Ys(t.type)),wb=e=>e.filter(t=>vT(t)),Ip=20,Gs=(e,t)=>e[0]===t[0],xb=(e,t)=>e[1]===t[1],yT=(e,t)=>Gs(e,t)?Math.abs(e[1]-t[1]):Math.abs(e[0]-t[0]),P9=e=>{let t=[e.points[0]],o=A9(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])<Ip?s[0]=i[0]:Math.abs(s[1]-i[1])<Ip&&(s[1]=i[1]),Gs(i,s)||xb(i,s)||t.push(Tp(i[0],s[1])),t.push(s)}let n=[t[0]];for(let a=1;a<t.length-1;++a)Gs(t[a-1],t[a])&&Gs(t[a],t[a+1])||xb(t[a-1],t[a])&&xb(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=Gs(i,s),m=Gs(s,l);if(c!==m){let p=yT(i,s),d=yT(s,l);if(p<Ip||d<Ip){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},A9=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},ET=(e,t,o)=>{if(!L9(e.type,t)){if(!g9())throw Error(`Invalid conversion from ${e.type} to ${t}.`);return e}if(e.type===t)return e;if(E9.delete(e),Ys(t)){let n=Us(x9({...e,type:t,roundness:t==="diamond"&&e.roundness?{type:a9(t)?Cp.ADAPTIVE_RADIUS:Cp.PROPORTIONAL_RADIUS}:e.roundness}));return w9(n,o.scene,o.state),n}if(kp(t))switch(t){case"line":return Us(y9({...e,type:"line"}));case"sharpArrow":return Us(bb({...e,type:"arrow",elbowed:!1,roundness:null,startArrowhead:o.state.currentItemStartArrowhead,endArrowhead:o.state.currentItemEndArrowhead}));case"curvedArrow":return Us(bb({...e,type:"arrow",elbowed:!1,roundness:{type:Cp.PROPORTIONAL_RADIUS},startArrowhead:o.state.currentItemStartArrowhead,endArrowhead:o.state.currentItemEndArrowhead}));case"elbowArrow":return Us(bb({...e,type:"arrow",elbowed:!0,fixedSegments:null,roundness:null}))}return p9(t,`unhandled conversion type: ${t}`),e},L9=(e,t)=>!!(Ys(e)&&Ys(t)||kp(e)&&kp(t)),_9=e=>Ib(e)?Ws(e):e.type,TT=k9;var kT=W({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 Et.set(bn,{type:"panel"}),{captureUpdate:D9.NEVER}},checked:e=>e.gridModeEnabled,predicate:(e,t,o)=>$s(e)!==null});import{canCreateLinkFromElements as Cb,defaultGetElementLinkFromSelection as R9,getLinkIdAndTypeFromSelection as N9}from"@orangecatai/element";import{CaptureUpdateAction as Uc}from"@orangecatai/element";var Mp=W({name:"copyElementLink",label:"labels.copyElementLink",icon:is,trackEvent:{category:"element"},perform:async(e,t,o,n)=>{let r=de(e,t);try{if(window.location){let a=N9(r,t);return a?(await hn(n.props.generateLinkForSelection?n.props.generateLinkForSelection(a.id,a.type):R9(a.id,a.type)),{appState:{toast:{message:f("toast.elementLinkCopied"),closable:!0}},captureUpdate:Uc.EVENTUALLY}):{appState:t,elements:e,app:n,captureUpdate:Uc.EVENTUALLY}}}catch(a){console.error(a)}return{appState:t,elements:e,app:n,captureUpdate:Uc.EVENTUALLY}},predicate:(e,t)=>Cb(de(e,t))}),ST=W({name:"linkToElement",label:"labels.linkToElement",icon:Cm,perform:(e,t,o,n)=>{let r=de(e,t);return r.length!==1||!Cb(r)?{elements:e,appState:t,app:n,captureUpdate:Uc.EVENTUALLY}:{appState:{...t,openDialog:{name:"elementLinkSelector",sourceElementId:de(e,t)[0].id}},captureUpdate:Uc.IMMEDIATELY}},predicate:(e,t,o,n)=>{let r=de(e,t);return t.openDialog?.name!=="elementLinkSelector"&&r.length===1&&Cb(r)},trackEvent:!1});import{isDarwin as MT}from"@orangecatai/common";var B9={toggleTheme:[G("Shift+Alt+D")],saveScene:[G("CtrlOrCmd+S")],loadScene:[G("CtrlOrCmd+O")],clearCanvas:[G("CtrlOrCmd+Delete")],imageExport:[G("CtrlOrCmd+Shift+E")],commandPalette:[G("CtrlOrCmd+/"),G("CtrlOrCmd+Shift+P")],cut:[G("CtrlOrCmd+X")],copy:[G("CtrlOrCmd+C")],paste:[G("CtrlOrCmd+V")],copyStyles:[G("CtrlOrCmd+Alt+C")],pasteStyles:[G("CtrlOrCmd+Alt+V")],selectAll:[G("CtrlOrCmd+A")],deleteSelectedElements:[G("Delete")],duplicateSelection:[G("CtrlOrCmd+D"),G(`Alt+${f("helpDialog.drag")}`)],sendBackward:[G("CtrlOrCmd+[")],bringForward:[G("CtrlOrCmd+]")],sendToBack:[MT?G("CtrlOrCmd+Alt+["):G("CtrlOrCmd+Shift+[")],bringToFront:[MT?G("CtrlOrCmd+Alt+]"):G("CtrlOrCmd+Shift+]")],copyAsPng:[G("Shift+Alt+C")],group:[G("CtrlOrCmd+G")],ungroup:[G("CtrlOrCmd+Shift+G")],gridMode:[G("CtrlOrCmd+'")],zenMode:[G("Alt+Z")],objectsSnapMode:[G("Alt+S")],stats:[G("Alt+/")],addToLibrary:[],flipHorizontal:[G("Shift+H")],flipVertical:[G("Shift+V")],viewMode:[G("Alt+R")],hyperlink:[G("CtrlOrCmd+K")],toggleElementLock:[G("CtrlOrCmd+Shift+L")],resetZoom:[G("CtrlOrCmd+0")],zoomOut:[G("CtrlOrCmd+-")],zoomIn:[G("CtrlOrCmd++")],zoomToFitSelection:[G("Shift+3")],zoomToFit:[G("Shift+1")],zoomToFitSelectionInViewport:[G("Shift+2")],toggleEraserTool:[G("E")],toggleHandTool:[G("H")],setFrameAsActiveTool:[G("F")],saveFileToDisk:[G("CtrlOrCmd+S")],saveToActiveFile:[G("CtrlOrCmd+S")],toggleShortcuts:[G("?")],searchMenu:[G("CtrlOrCmd+F")],wrapSelectionInFrame:[],toolLock:[G("Q")]},Xe=(e,t=0)=>{let o=B9[e];return o&&o.length>0?o[t]||o[0]:""};var F9="\\u0300-\\u036f",O9="\\ufe20-\\ufe2f",z9="\\u20d0-\\u20ff",H9=F9+O9+z9,G9=`[${H9}]`,U9=RegExp(G9,"g"),W9=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Y9={\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"},ri=e=>e.replace(W9,t=>Y9[t]||t).replace(U9,"");import aO from"clsx";import{useEffect as iO,useState as sO}from"react";import{KEYS as lO,queryFocusableElements as OC}from"@orangecatai/common";import{useCallback as $9,useState as V9}from"react";var PT=()=>{let[e,t]=V9(null),o=$9(n=>t(n),[]);return[e,o]};import{useState as _C,useCallback as Kb,useMemo as DC,useEffect as Xb,memo as RC,useRef as YF}from"react";import{LIBRARY_DISABLED_TYPES as $F,randomId as VF,isShallowEqual as KF,KEYS as XF,isWritableElement as ZF,addEventListener as jF,EVENT as qF,CLASSES as PC}from"@orangecatai/common";import{useEffect as DT,useRef as RT}from"react";import{URL_HASH_KEYS as Mb,URL_QUERY_KEYS as Pb,APP_NAME as NT,EVENT as Ap,DEFAULT_SIDEBAR as j9,LIBRARY_SIDEBAR_TAB as q9,arrayToMap as Ab,cloneJSON as J9,preventUnload as Q9,promiseTry as BT,resolvablePromise as eB,toValidURL as tB,Queue as oB,Emitter as nB}from"@orangecatai/common";import{hashElementsVersion as rB,hashString as aB}from"@orangecatai/element";import{getCommonBoundingBox as Sb}from"@orangecatai/element";import{MIME_TYPES as ai}from"@orangecatai/common";var na=({elements:e,appState:t,files:o,maxWidthOrHeight:n,getDimensions:r,exportPadding:a,exportingFrame:i})=>{let s=Ga(e,null,{deleteInvisibleElements:!0}),l=$i(t,null),{exportBackground:c,viewBackgroundColor:m}=l;return zr(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),x=n<g?n/g:t?.exportScale??1;return u.width=p*x,u.height=d*x,{canvas:u,scale:x}}let h=r?.(p,d)||{width:p,height:d};return u.width=h.width,u.height=h.height,{canvas:u,scale:h.scale??1}})},AT=async e=>{let{mimeType:t=ai.png,quality:o}=e;t===ai.png&&typeof o=="number"&&console.warn(`"quality" will be ignored for "${ai.png}" mimeType`),t==="image/jpg"&&(t=ai.jpg),t===ai.jpg&&!e.appState?.exportBackground&&(console.warn(`Defaulting "exportBackground" to "true" for "${ai.jpg}" mimeType`),e={...e,appState:{...e.appState,exportBackground:!0}});let n=await na(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===ai.png&&e.appState?.exportEmbedScene&&(i=await pE({blob:i,metadata:jl(e.elements,e.appState,e.files||{},"local")})),r(i)},t,o)})},Vs=async({elements:e,appState:t=Or(),files:o={},exportPadding:n,renderEmbeddables:r,exportingFrame:a,skipInliningFonts:i,reuseImages:s})=>{let l=Ga(e,null,{deleteInvisibleElements:!0}),m={...$i(t,null),exportPadding:n};return Yi(l,m,o,{exportingFrame:a,renderEmbeddables:r,skipInliningFonts:i,reuseImages:s})},K9=async e=>{if(e.type==="svg"){let t=await Vs(e);await hn(t.outerHTML)}else if(e.type==="png")await lp(AT(e));else if(e.type==="json")await ip(e.elements,e.files);else throw new Error("Invalid export type")};import{useEffect as LT,useState as X9}from"react";import{COLOR_PALETTE as Z9}from"@orangecatai/common";var kb=Pe(new Map),_T=async e=>await Vs({elements:e,appState:{exportBackground:!1,viewBackgroundColor:Z9.white},files:null,renderEmbeddables:!1,skipInliningFonts:!0}),Pp=(e,t,o,n)=>{let[r,a]=X9();return LT(()=>{if(t)if(e){let i=o.get(e);i?a(i):(async()=>{let s=await _T(t);s.querySelector(".style-fonts")?.remove(),s&&(o.set(e,s),a(s))})()}else(async()=>{let i=await _T(t);a(i)})()},[e,t,o,a]),LT(()=>{let i=n.current;if(i)return r&&(i.innerHTML=r.outerHTML),()=>{i.innerHTML=""}},[r,n]),r},Ks=()=>{let[e]=le(kb);return{clearLibraryCache:()=>e.clear(),deleteItemsFromLibraryCache:n=>{n.forEach(r=>e.delete(r))},svgCache:e}};var iB=["excalidraw.com","raw.githubusercontent.com/excalidraw/excalidraw-libraries"],OT=new nB,wr=Pe({status:"loaded",isInitialized:!1,libraryItems:[]}),Wc=e=>J9(e),sB=(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)),zT=(e,t)=>{let o=[];for(let n of t)sB(e,n)&&o.push(n);return[...o,...e]},HT=(e,t)=>{let o=Ab(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=Ab(e);for(let a of t){let i=r.get(a.id);i?Db(i)!==Db(a)&&n.updatedItems.set(a.id,a):n.addedItems.set(a.id,a)}return n},Lb=class{constructor(t){A(this,"currLibraryItems",[]);A(this,"prevLibraryItems",Wc(this.currLibraryItems));A(this,"app");A(this,"updateQueue",[]);A(this,"getLastUpdateTask",()=>this.updateQueue[this.updateQueue.length-1]);A(this,"notifyListeners",()=>{if(this.updateQueue.length>0)Et.set(wr,t=>({status:"loading",libraryItems:this.currLibraryItems,isInitialized:t.isInitialized}));else{Et.set(wr,{status:"loaded",libraryItems:this.currLibraryItems,isInitialized:!0});try{let t=this.prevLibraryItems;this.prevLibraryItems=Wc(this.currLibraryItems);let o=Wc(this.currLibraryItems);this.app.props.onLibraryChange?.(o),OT.trigger(HT(t,o),o)}catch(t){console.error(t)}}});A(this,"destroy",()=>{this.updateQueue=[],this.currLibraryItems=[],Et.set(kb,new Map)});A(this,"resetLibrary",()=>this.setLibrary([]));A(this,"getLatestLibrary",()=>new Promise(async t=>{try{let o=await(this.getLastUpdateTask()||this.currLibraryItems);this.updateQueue.length>0?t(this.getLatestLibrary()):t(Wc(o))}catch{return t(this.currLibraryItems)}}));A(this,"updateLibrary",async({libraryItems:t,prompt:o=!1,merge:n=!1,openLibraryMenu:r=!1,defaultStatus:a="unpublished"})=>(r&&this.app.setState({openSidebar:{name:j9.name,tab:q9}}),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 ph(l,a):c=Ql(l,a),!o||window.confirm(f("alerts.confirmAddLibrary",{numShapes:c.length}))?(o&&this.app.focusContainer(),i(n?zT(this.currLibraryItems,c):c)):s(new Ui)}catch(l){s(l)}}))));A(this,"setLibrary",t=>{let o=new Promise(async(n,r)=>{try{await this.getLastUpdateTask(),typeof t=="function"&&(t=t(this.currLibraryItems)),this.currLibraryItems=Wc(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}},GT=Lb,Zs=e=>{let o=Math.ceil(Math.sqrt(e.length)),n=[],r=u=>e.slice(u*o,u*o+o).reduce((g,x)=>{let{height:E}=Sb(x.elements);return Math.max(g,E)},0),a=u=>{let h=0,g=0,x=0;for(let E of e){if(h%o===0&&(g=0),g===u){let{width:y}=Sb(E.elements);x=Math.max(x,y)}h++,g++}return x},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:x,height:E}=Sb(u.elements),y=(c-x)/2,w=(l-E)/2;n.push(...u.elements.map(v=>({...v,x:v.x+i+y-h,y:v.y+s+w-g}))),i+=c+50,m++,p++}return n},lB=(e,t=iB)=>{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}"`)},_b=()=>{let e=new URLSearchParams(window.location.hash.slice(1)).get(Mb.addLibrary)||new URLSearchParams(window.location.search).get(Pb.addLibrary),t=e?new URLSearchParams(window.location.hash.slice(1)).get("token"):null;return e?{libraryUrl:e,idToken:t}:null},ra=class ra{constructor(t){A(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(Ql(s?.libraryItems||[],"published"))}catch(s){i(s)}});return n?ra.queue.push(r):r()}getLibraryItems(t){return ra.getLibraryItems(this.adapter,t,!1)}};A(ra,"queue",new oB),A(ra,"run",async(t,o)=>{let n=new ra(t);return ra.queue.push(()=>o(n))});var Xs=ra,Yc=0,Lp=0,Db=e=>`${e.id}:${e.name||""}:${rB(e.elements)}`,_p=e=>aB(e.map(t=>Db(t)).sort().join()),FT=async(e,t)=>{try{return Lp++,await Xs.run(e,async o=>{let n=Ab(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=_p(a);return i!==Yc&&await e.save({libraryItems:a}),Yc=i,a})}finally{Lp--}},cB=e=>{let{excalidrawAPI:t}=e,o=RT(e);o.current=e;let n=RT(!1);DT(()=>{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=tB(s),lB(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(Mb.addLibrary)){let p=new URLSearchParams(window.location.hash.slice(1));p.delete(Mb.addLibrary),window.history.replaceState({},NT,`#${p.toString()}`)}else if(window.location.search.includes(Pb.addLibrary)){let p=new URLSearchParams(window.location.search);p.delete(Pb.addLibrary),window.history.replaceState({},NT,`?${p.toString()}`)}}},a=s=>{s.preventDefault();let l=_b();l&&(s.stopImmediatePropagation(),window.history.replaceState({},"",s.oldURL),r(l))},i=_b();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=eB();l?c.resolve(BT(l.load).then(async m=>{let p=null;try{if(!m)return Xs.getLibraryItems(s,"load");p=Ql(m.libraryItems||[],"published");let d=await FT(s,HT([],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}`),Xs.getLibraryItems(s,"load")))):c.resolve(BT(Xs.getLibraryItems,s,"load")),t.updateLibrary({libraryItems:c.then(m=>{let p=m||[];return Yc=_p(p),p}),merge:!0}).finally(()=>{n.current=!0})}return window.addEventListener(Ap.HASHCHANGE,a),()=>{window.removeEventListener(Ap.HASHCHANGE,a)}},[t]),DT(()=>{let r=OT.on(async(i,s)=>{let l=n.current,c="adapter"in o.current&&o.current.adapter||null;try{c&&Yc!==_p(s)&&await FT(c,i)}catch(m){console.error(`couldn't persist library update: ${m.message}`,i),l&&o.current.excalidrawAPI&&o.current.excalidrawAPI.updateScene({appState:{errorMessage:f("errors.saveLibraryError")}})}}),a=i=>{Lp&&Q9(i)};return window.addEventListener(Ap.BEFORE_UNLOAD,a),()=>{window.removeEventListener(Ap.BEFORE_UNLOAD,a),r(),Yc=0,Lp=0}},[])};import uB from"clsx";import{VERSIONS as dB}from"@orangecatai/common";import{jsx as pB}from"react/jsx-runtime";var mB=({theme:e,id:t,libraryReturnUrl:o})=>{let n=o||window.location.origin+window.location.pathname;return pB("a",{className:"library-menu-browse-button",href:`${T.VITE_APP_LIBRARY_URL}?target=${window.name||"_blank"}&referrer=${n}&useHash=true&token=${t}&theme=${e}&version=${dB.excalidrawLibrary}`,target:"_excalidraw_libraries",children:f("labels.libraries")})},UT=mB;import{jsx as gB,jsxs as hB}from"react/jsx-runtime";var Dp=({libraryReturnUrl:e,theme:t,id:o,style:n,children:r,className:a})=>hB("div",{className:uB("library-menu-control-buttons",a),style:n,children:[gB(UT,{id:o,libraryReturnUrl:e,theme:t}),r]});import{useCallback as Js,useEffect as Wb,useMemo as Yb,useRef as kC,useState as SC}from"react";import{MIME_TYPES as FF,arrayToMap as OF,nextAnimationFrame as zF}from"@orangecatai/common";import{duplicateElements as HF}from"@orangecatai/element";import GF from"clsx";import fB from"lodash.throttle";import{useEffect as bB}from"react";var xB=Pe(0),WT=e=>{let[t,o]=le(xB);return bB(()=>{let{current:n}=e;if(!n)return;let r=fB(()=>{let{scrollTop:a}=n;o(a)},200);return n.addEventListener("scroll",r),()=>{r.cancel(),n.removeEventListener("scroll",r)}},[e,o]),t};import uF from"clsx";import{useCallback as gF,useState as Hb}from"react";import{muteFSAbortError as hF}from"@orangecatai/common";import{flushSync as YT}from"react-dom";import yB from"clsx";import{jsx as Rp,jsxs as wB}from"react/jsx-runtime";var EB=({label:e,onClick:t,className:o,children:n,actionType:r,type:a="button",isLoading:i,...s})=>{let l=r?`Dialog__action-button--${r}`:"";return wB("button",{className:yB("Dialog__action-button",l,o),type:a,"aria-label":e,onClick:t,...s,children:[n&&Rp("div",{style:i?{visibility:"hidden"}:{},children:n}),Rp("div",{style:i?{visibility:"hidden"}:{},children:e}),i&&Rp("div",{style:{position:"absolute",inset:0},children:Rp(Wt,{})})]})},vr=EB;import{jsx as $T,jsxs as VT}from"react/jsx-runtime";var vB=e=>{let{onConfirm:t,onCancel:o,children:n,confirmText:r=f("buttons.confirm"),cancelText:a=f("buttons.cancel"),className:i="",...s}=e,l=Ce(),c=Rn(js),{container:m}=Qe();return VT(bt,{onCloseRequest:o,size:"small",...s,className:`confirm-dialog ${i}`,children:[n,VT("div",{className:"confirm-dialog-buttons",children:[$T(vr,{label:a,onClick:()=>{l({openMenu:null}),c(!1),YT(()=>{o()}),m?.focus()}}),$T(vr,{label:r,onClick:()=>{l({openMenu:null}),c(!1),YT(()=>{t()}),m?.focus()},actionType:"danger"})]})]})},Np=vB;import{useCallback as PB,useEffect as Bb,useRef as KT,useState as Rb}from"react";import{EDITOR_LS_KEYS as Nb,EXPORT_DATA_TYPES as AB,MIME_TYPES as XT,VERSIONS as LB,chunk as _B,getExportSource as DB}from"@orangecatai/common";var Xo=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}}};A(Xo,"set",(t,o)=>{try{return window.localStorage.setItem(t,JSON.stringify(o)),!0}catch(n){return console.warn(`localStorage.setItem error: ${n.message}`),!1}}),A(Xo,"delete",t=>{try{window.localStorage.removeItem(t)}catch(o){console.warn(`localStorage.removeItem error: ${o.message}`)}});import Bp from"react";var IB=/({{[\w-]+}})|(<[\w-]+>)|(<\/[\w-]+>)/g,TB=/{{([\w-]+)}}/,CB=/<([\w-]+)>/,kB=/<\/([\w-]+)>/,SB=(e,t)=>{let o=[{name:"",children:[]}];return e.split(IB).filter(Boolean).forEach(n=>{let r=n.match(CB),a=n.match(kB),i=n.match(TB);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=Bp.createElement(Bp.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},MB=({i18nKey:e,children:t,...o})=>{let{t:n}=Ue();return Bp.createElement(Bp.Fragment,{},...SB(n(e),o))},io=MB;import{jsx as Ae,jsxs as Zt}from"react/jsx-runtime";var RB=async e=>{let n=Math.round(8),r=Math.max(Math.round(128/64),2),a=_B(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 na({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 cm(new File([await Ua(i)],"preview",{type:XT.png}),{outputType:XT.jpg,maxWidthOrHeight:5e3})},NB=({libItem:e,appState:t,index:o,onChange:n,onRemove:r})=>{let a=KT(null),i=KT(null);return Bb(()=>{let s=a.current;s&&(async()=>{let l=await Vs({elements:e.elements,appState:{...t,viewBackgroundColor:"#fff",exportBackground:!0},files:null,skipInliningFonts:!0});s.innerHTML=l.outerHTML})()},[e.elements,t]),Zt("div",{className:"single-library-item",children:[e.status==="published"&&Ae("span",{className:"single-library-item-status",children:f("labels.statusPublished")}),Ae("div",{ref:a,className:"single-library-item__svg"}),Ae(ae,{"aria-label":f("buttons.remove"),type:"button",icon:Go,className:"single-library-item--remove",onClick:r.bind(null,e.id),title:f("buttons.remove")}),Zt("div",{style:{display:"flex",margin:"0.8rem 0",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[Zt("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[Zt("div",{style:{padding:"0.5em 0"},children:[Ae("span",{style:{fontWeight:500,color:"#868e96"},children:f("publishDialog.itemName")}),Ae("span",{"aria-hidden":"true",className:"required",children:"*"})]}),Ae("input",{type:"text",ref:i,style:{width:"80%",padding:"0.2rem"},defaultValue:e.name,placeholder:"Item name",onChange:s=>{n(s.target.value,o)}})]}),Ae("span",{className:"error",children:e.error})]})]})},BB=({onClose:e,libraryItems:t,appState:o,onSuccess:n,onError:r,updateItemsInStorage:a,onRemove:i})=>{let[s,l]=Rb({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),[c,m]=Rb(!1);Bb(()=>{let w=Xo.get(Nb.PUBLISH_LIBRARY);w&&l(w)},[]);let[p,d]=Rb(t.slice());Bb(()=>{d(t.slice())},[t]);let u=w=>{l({...s,[w.target.name]:w.target.value})},h=async w=>{w.preventDefault(),m(!0);let v=[],I=!1;if(p.forEach(k=>{let M="";k.name||(M=f("publishDialog.errors.required"),I=!0),v.push({...k,error:M})}),I){d(v),m(!1);return}let C=await RB(p),P={type:AB.excalidrawLibrary,version:LB.excalidrawLibrary,source:DB(),libraryItems:p},S=JSON.stringify(P,null,2),D=new Blob([S],{type:"application/json"}),_=new FormData;_.append("excalidrawLib",D),_.append("previewImage",C),_.append("previewImageType",C.type),_.append("title",s.name),_.append("authorName",s.authorName),_.append("githubHandle",s.githubHandle),_.append("name",s.name),_.append("description",s.description),_.append("twitterHandle",s.twitterHandle),_.append("website",s.website),fetch(`${T.VITE_APP_LIBRARY_BACKEND}/submit`,{method:"post",body:_}).then(k=>k.ok?k.json().then(({url:M})=>{Xo.delete(Nb.PUBLISH_LIBRARY),n({url:M,authorName:s.authorName,items:p})}):k.json().catch(()=>{throw new Error(k.statusText||"something went wrong")}).then(M=>{throw new Error(M.message||k.statusText||"something went wrong")}),k=>{console.error(k),r(k),m(!1)}).catch(k=>{console.error(k),r(k),m(!1)})},g=()=>{let w=[];return p.forEach((v,I)=>{w.push(Ae("div",{className:"single-library-item-wrapper",children:Ae(NB,{libItem:v,appState:o,index:I,onChange:(C,P)=>{let S=p.slice();S[P].name=C,d(S)},onRemove:i})},I))}),Ae("div",{className:"selected-library-items",children:w})},x=PB(()=>{a(p),Xo.set(Nb.PUBLISH_LIBRARY,s),e()},[p,e,a,s]),E=!!t.length,y=t.some(w=>w.status==="published");return Ae(bt,{onCloseRequest:x,title:f("publishDialog.title"),className:"publish-library",children:E?Zt("form",{onSubmit:h,children:[Ae("div",{className:"publish-library-note",children:Ae(io,{i18nKey:"publishDialog.noteDescription",link:w=>Ae("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener",children:w})})}),Ae("span",{className:"publish-library-note",children:Ae(io,{i18nKey:"publishDialog.noteGuidelines",link:w=>Ae("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:w})})}),Ae("div",{className:"publish-library-note",children:f("publishDialog.noteItems")}),y&&Ae("span",{className:"publish-library-note publish-library-warning",children:f("publishDialog.republishWarning")}),g(),Zt("div",{className:"publish-library__fields",children:[Zt("label",{children:[Zt("div",{children:[Ae("span",{children:f("publishDialog.libraryName")}),Ae("span",{"aria-hidden":"true",className:"required",children:"*"})]}),Ae("input",{type:"text",name:"name",required:!0,value:s.name,onChange:u,placeholder:f("publishDialog.placeholder.libraryName")})]}),Zt("label",{style:{alignItems:"flex-start"},children:[Zt("div",{children:[Ae("span",{children:f("publishDialog.libraryDesc")}),Ae("span",{"aria-hidden":"true",className:"required",children:"*"})]}),Ae("textarea",{name:"description",rows:4,required:!0,value:s.description,onChange:u,placeholder:f("publishDialog.placeholder.libraryDesc")})]}),Zt("label",{children:[Zt("div",{children:[Ae("span",{children:f("publishDialog.authorName")}),Ae("span",{"aria-hidden":"true",className:"required",children:"*"})]}),Ae("input",{type:"text",name:"authorName",required:!0,value:s.authorName,onChange:u,placeholder:f("publishDialog.placeholder.authorName")})]}),Zt("label",{children:[Ae("span",{children:f("publishDialog.githubUsername")}),Ae("input",{type:"text",name:"githubHandle",value:s.githubHandle,onChange:u,placeholder:f("publishDialog.placeholder.githubHandle")})]}),Zt("label",{children:[Ae("span",{children:f("publishDialog.twitterUsername")}),Ae("input",{type:"text",name:"twitterHandle",value:s.twitterHandle,onChange:u,placeholder:f("publishDialog.placeholder.twitterHandle")})]}),Zt("label",{children:[Ae("span",{children:f("publishDialog.website")}),Ae("input",{type:"text",name:"website",pattern:"https?://.+",title:f("publishDialog.errors.website"),value:s.website,onChange:u,placeholder:f("publishDialog.placeholder.website")})]}),Ae("span",{className:"publish-library-note",children:Ae(io,{i18nKey:"publishDialog.noteLicense",link:w=>Ae("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:w})})})]}),Zt("div",{className:"publish-library__buttons",children:[Ae(vr,{label:f("buttons.saveLibNames"),onClick:x,"data-testid":"cancel-clear-canvas-button"}),Ae(vr,{type:"submit",label:f("buttons.submit"),actionType:"primary",isLoading:c})]})]}):Ae("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:f("publishDialog.atleastOneLibItem")})})},ZT=BB;import yC from"react";import{DropdownMenu as cF}from"radix-ui";import{CLASSES as dF}from"@orangecatai/common";import zB from"clsx";import{useCallback as HB,useEffect as GB,useRef as UB}from"react";import{CLASSES as WB,EVENT as QT,KEYS as YB}from"@orangecatai/common";import{DropdownMenu as $B}from"radix-ui";import{forwardRef as jT}from"react";import qT from"clsx";import{jsx as JT}from"react/jsx-runtime";var FB=jT(({children:e,gap:t,align:o,justifyContent:n,className:r,style:a},i)=>JT("div",{className:qT("Stack Stack_horizontal",r),style:{"--gap":t,alignItems:o,justifyContent:n,...a},ref:i,children:e})),OB=jT(({children:e,gap:t,align:o,justifyContent:n,className:r,style:a},i)=>JT("div",{className:qT("Stack Stack_vertical",r),style:{"--gap":t,justifyItems:o,justifyContent:n,...a},ref:i,children:e})),Rt={Row:FB,Col:OB};import{jsx as Fp}from"react/jsx-runtime";var eC=({children:e,onClickOutside:t,className:o="",onSelect:n,open:r=!0,align:a="end",style:i})=>{let s=Te(),l=UB(null),c=Ur({onClickOutside:t});fs(l,HB(p=>{l.current?.closest(`.${WB.DROPDOWN_MENU_EVENT_WRAPPER}`)?.contains(p.target)||c.onClickOutside?.()},[c])),GB(()=>{if(!r)return;let p=u=>{u.key===YB.ESCAPE&&(u.stopImmediatePropagation(),c.onClickOutside?.())},d={capture:!0};return document.addEventListener(QT.KEYDOWN,p,d),()=>{document.removeEventListener(QT.KEYDOWN,p,d)}},[c,r]);let m=zB(`dropdown-menu ${o}`,{"dropdown-menu--mobile":s.formFactor==="phone"}).trim();return Fp(df.Provider,{value:{onSelect:n},children:Fp($B.Content,{ref:l,className:m,style:i,"data-testid":"dropdown-menu",align:a,sideOffset:8,onCloseAutoFocus:p=>p.preventDefault(),children:s.formFactor==="phone"?Fp(Rt.Col,{className:"dropdown-menu-container",children:e}):Fp(gt,{className:"dropdown-menu-container",padding:2,children:e})})})};eC.displayName="DropdownMenuContent";var tC=eC;import{jsx as KB}from"react/jsx-runtime";var VB=({children:e,className:t="",selected:o,...n})=>KB("div",{...n,className:`dropdown-menu-item-base dropdown-menu-item-custom ${t} ${o?"dropdown-menu-item--selected":""}`.trim(),children:e}),oC=VB;import{DropdownMenu as XB}from"radix-ui";import{jsx as Fb}from"react/jsx-runtime";var nC=({icon:e,shortcut:t,href:o,children:n,onSelect:r,className:a="",selected:i,rel:s="noopener",...l})=>{let c=Wm(r);return Fb(XB.Item,{className:"radix-menu-item",onSelect:c,asChild:!0,children:Fb("a",{...l,href:o,target:"_blank",rel:`noopener ${s}`,className:Xr(a,i),title:l.title??l["aria-label"],children:Fb(Zr,{icon:e,shortcut:t,children:n})})})},qs=nC;nC.displayName="DropdownMenuItemLink";import{jsx as ZB}from"react/jsx-runtime";var rC=()=>ZB("div",{style:{height:"1px",backgroundColor:"var(--default-border-color)",margin:"6px 0",flex:"0 0 auto"}}),aC=rC;rC.displayName="DropdownMenuSeparator";import{DropdownMenu as oF}from"radix-ui";import jB from"clsx";import{DropdownMenu as qB}from"radix-ui";import{useCallback as JB,useState as iC}from"react";import{jsx as zb}from"react/jsx-runtime";var Ob=-4,QB=4,sC=({children:e,className:t})=>{let o=Te(),n=jB(`dropdown-menu dropdown-submenu ${t}`,{"dropdown-menu--mobile":o.formFactor==="phone"}).trim(),r=JB(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+Ob),l(Ob+8))}}},[]),[a,i]=iC(QB),[s,l]=iC(Ob);return zb(qB.SubContent,{className:n,sideOffset:a,alignOffset:s,collisionPadding:8,ref:r,children:o.formFactor==="phone"?zb(Rt.Col,{className:"dropdown-menu-container",children:e}):zb(gt,{className:"dropdown-menu-container",padding:2,style:{zIndex:1},children:e})})},lC=sC;sC.displayName="DropdownMenuSubContent";import{DropdownMenu as eF}from"radix-ui";import{jsx as cC,jsxs as tF}from"react/jsx-runtime";var dC=({children:e,icon:t,shortcut:o,className:n})=>tF(eF.SubTrigger,{className:`${Xr(n)} dropdown-menu__submenu-trigger`,children:[cC(Zr,{icon:t,shortcut:o,children:e}),cC("div",{className:"dropdown-menu__submenu-trigger-icon",children:xv})]}),mC=dC;dC.displayName="DropdownMenuSubTrigger";import pC from"react";var Op=e=>t=>{let o=pC.Children.toArray(t).find(n=>pC.isValidElement(n)&&typeof n.type!="string"&&n?.type.displayName&&n.type.displayName===e);return o||null},uC=Op("DropdownMenuTrigger"),gC=Op("DropdownMenuContent"),hC=Op("DropdownMenuSubTrigger"),fC=Op("DropdownMenuSubContent");import{jsxs as nF}from"react/jsx-runtime";var zp=({children:e})=>{let t=hC(e),o=fC(e);return nF(oF.Sub,{children:[t,o]})};zp.Trigger=mC;zp.Content=lC;zp.displayName="DropdownMenuSub";var aa=zp;import rF from"clsx";import{DropdownMenu as aF}from"radix-ui";import{jsx as iF}from"react/jsx-runtime";var bC=({className:e="",children:t,onToggle:o,title:n,...r})=>{let a=Te(),i=rF(`dropdown-menu-button ${e}`,"zen-mode-transition",{"dropdown-menu-button--mobile":a.formFactor==="phone"}).trim();return iF(aF.Trigger,{className:i,onClick:o,type:"button","data-testid":"dropdown-menu-button",title:n,...r,children:t})},xC=bC;bC.displayName="DropdownMenuTrigger";import{jsx as lF}from"react/jsx-runtime";var sF=e=>lF(to,{...e,icon:e.checked?bm:bv}),Ir=sF;import{jsx as pF,jsxs as mF}from"react/jsx-runtime";var xn=({children:e,open:t})=>{let o=uC(e),n=gC(e),r=n&&yC.isValidElement(n)?yC.cloneElement(n,{open:t}):n;return pF(cF.Root,{open:t,modal:!1,children:mF("div",{className:dF.DROPDOWN_MENU_EVENT_WRAPPER,style:{display:"contents"},children:[o,r]})})};xn.Trigger=xC;xn.Content=tC;xn.Item=to;xn.ItemCheckbox=Ir;xn.ItemLink=qs;xn.ItemCustom=oC;xn.Group=bc;xn.Separator=aC;xn.Sub=aa;var ye=xn;xn.displayName="DropdownMenu";import{jsx as bo,jsxs as Hp}from"react/jsx-runtime";var fF=(e,t)=>e.filter(o=>t.includes(o.id)),bF=({setAppState:e,selectedItems:t,library:o,onRemoveFromLibrary:n,resetLibrary:r,onSelectItems:a,appState:i,className:s})=>{let[l]=le(wr),[c,m]=le(js),p=()=>{let _=t.length?f("alerts.removeItemsFromsLibrary",{count:t.length}):f("alerts.resetLibrary"),k=t.length?f("confirmDialog.removeItemsFromLib"):f("confirmDialog.resetLibrary");return bo(Np,{onConfirm:()=>{t.length?n():r(),u(!1)},onCancel:()=>{u(!1)},title:k,children:bo("p",{children:_})})},[d,u]=Hb(!1),h=!!t.length,g=h?l.libraryItems.filter(_=>t.includes(_.id)):l.libraryItems,x=h?f("buttons.remove"):f("buttons.resetLibrary"),[E,y]=Hb(!1),[w,v]=Hb(null),I=gF(()=>Hp(bt,{onCloseRequest:()=>v(null),title:f("publishSuccessDialog.title"),className:"publish-library-success",size:"small",children:[bo("p",{children:bo(io,{i18nKey:"publishSuccessDialog.content",authorName:w.authorName,link:_=>bo("a",{href:w?.url,target:"_blank",rel:"noopener noreferrer",children:_})})}),bo(ae,{type:"button",title:f("buttons.close"),"aria-label":f("buttons.close"),label:f("buttons.close"),onClick:()=>v(null),"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]}),[v,w]),C=(_,k)=>{y(!1),v({url:_.url,authorName:_.authorName});let M=k.slice();M.forEach(B=>{t.includes(B.id)&&(B.status="published")}),o.setLibrary(M)},P=async()=>{try{await o.updateLibrary({libraryItems:om({description:"Excalidraw library files"}),merge:!0,openLibraryMenu:!0})}catch(_){if(_?.name==="AbortError"){console.warn(_);return}e({errorMessage:f("errors.importLibraryError")})}},S=async()=>{let _=h?g:await o.getLatestLibrary();iE(_).catch(hF).catch(k=>{e({errorMessage:k.message})})},D=()=>Hp(ye,{open:c,children:[bo(ye.Trigger,{onToggle:()=>m(!c),children:PE}),Hp(ye.Content,{onClickOutside:()=>m(!1),onSelect:()=>m(!1),className:"library-menu",children:[!h&&bo(ye.Item,{onSelect:P,icon:rs,"data-testid":"lib-dropdown--load",children:f("buttons.load")}),!!g.length&&bo(ye.Item,{onSelect:S,icon:$a,"data-testid":"lib-dropdown--export",children:f("buttons.export")}),h&&bo(ye.Item,{icon:Fw,onSelect:()=>y(!0),"data-testid":"lib-dropdown--remove",children:f("buttons.publishLibrary")}),!!g.length&&bo(ye.Item,{onSelect:()=>u(!0),icon:Ut,children:x})]})]});return Hp("div",{className:uF("library-menu-dropdown-container",s),children:[D(),t.length>0&&bo("div",{className:"library-actions-counter",children:t.length}),d&&p(),E&&bo(ZT,{onClose:()=>y(!1),libraryItems:fF(l.libraryItems,t),appState:i,onSuccess:_=>C(_,l.libraryItems),onError:_=>window.alert(_),updateItemsInStorage:()=>o.setLibrary(l.libraryItems),onRemove:_=>a(t.filter(k=>k!==_))}),w&&I()]})},EC=({selectedItems:e,onSelectItems:t,className:o})=>{let{library:n}=tt(),{clearLibraryCache:r,deleteItemsFromLibraryCache:a}=Ks(),i=Ie(),s=Ce(),[l]=le(wr),c=async p=>{let d=p.filter(u=>!e.includes(u.id));n.setLibrary(d).catch(()=>{s({errorMessage:f("alerts.errorRemovingFromLibrary")})}),a(e),t([])};return bo(bF,{appState:i,setAppState:s,selectedItems:e,onSelectItems:t,library:n,onRemoveFromLibrary:()=>c(l.libraryItems),resetLibrary:()=>{n.resetLibrary(),r()},className:o})};import{memo as CF,useEffect as kF,useState as SF}from"react";import xF,{useCallback as yF}from"react";function EF(){return[!1,yF(t=>t(),[])]}var wC=xF.useTransition||EF;import vC from"clsx";import{memo as wF,useRef as vF,useState as IF}from"react";import{jsx as Gp,jsxs as TF}from"react/jsx-runtime";var IC=wF(({id:e,elements:t,isPending:o,onClick:n,selected:r,onToggle:a,onDrag:i,svgCache:s})=>{let l=vF(null),c=Pp(e,t,s,l),[m,p]=IF(!1),d=Te().formFactor==="phone",u=o&&Gp("div",{className:"library-unit__adder",children:ME});return TF("div",{className:vC("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:[Gp("div",{className:vC("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)&&Gp(Tc,{checked:r,onChange:(h,g)=>a(e,g),className:"library-unit__checkbox"})]})}),TC=()=>Gp("div",{className:"library-unit library-unit--skeleton"});import{Fragment as MF,jsx as Up}from"react/jsx-runtime";var Wp=({children:e})=>Up("div",{className:"library-menu-items-container__grid",children:e}),$c=CF(({items:e,onItemSelectToggle:t,onItemDrag:o,isItemSelected:n,onClick:r,svgCache:a,itemsRenderedPerBatch:i})=>{let[,s]=wC(),[l,c]=SF(0);return kF(()=>{l<e.length&&s(()=>{c(l+i)})},[l,e.length,s,i]),Up(MF,{children:e.map((m,p)=>p<l?Up(IC,{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):Up(TC,{},p))})});import Gb from"clsx";import{forwardRef as _F,useRef as DF,useImperativeHandle as RF,useLayoutEffect as NF,useState as BF}from"react";import PF from"clsx";import{composeEventHandlers as AF}from"@orangecatai/common";import{jsx as LF}from"react/jsx-runtime";var so=({type:e="button",onSelect:t,selected:o,children:n,className:r="",...a})=>LF("button",{onClick:AF(a.onClick,i=>{t()}),type:e,className:PF("excalidraw-button",r,{selected:o}),...a,children:n});import{jsx as Ub,jsxs as CC}from"react/jsx-runtime";var ia=_F(({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=DF(null);RF(d,()=>u.current),NF(()=>{a&&(u.current?.focus(),u.current?.select())},[a]);let[h,g]=BF(!1);return CC("div",{className:Gb("ExcTextField",c,{"ExcTextField--fullWidth":o,"ExcTextField--hasIcon":!!l}),onClick:()=>{u.current?.focus()},children:[l,t&&Ub("div",{className:"ExcTextField__label",children:t}),CC("div",{className:Gb("ExcTextField__input",{"ExcTextField__input--readonly":r}),children:[Ub("input",{className:Gb({"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:x=>e?.(x.target.value),onKeyDown:i,type:m}),s&&Ub(so,{onSelect:()=>g(!h),style:{border:0,userSelect:"none"},children:h?Vw:ls})]})]})});import{Fragment as MC,jsx as Nt,jsxs as $n}from"react/jsx-runtime";var UF=17,WF=64;function $b({isLoading:e,libraryItems:t,onAddToLibrary:o,onInsertLibraryItems:n,pendingElements:r,theme:a,id:i,libraryReturnUrl:s,onSelectItems:l,selectedItems:c}){let m=Te(),p=kC(null),d=WT(p);Wb(()=>{d>0&&p.current?.scrollTo(0,d)},[]);let{svgCache:u}=Ks(),[h,g]=SC(null),[x,E]=SC(""),y=!t.length&&!r.length,w=!y&&!!x.trim(),v=Yb(()=>{let L=ri(x.trim().toLowerCase());return L?t.filter(F=>{let $=F.name||"";return $.trim()&&ri($.toLowerCase()).includes(L)}):[]},[t,x]),I=Yb(()=>t.filter(L=>L.status!=="published"),[t]),C=Yb(()=>t.filter(L=>L.status==="published"),[t]),P=Js((L,F)=>{let $=!c.includes(L),Q=[...I,...C];if($){if(F.shiftKey&&h){let Z=Q.findIndex(fe=>fe.id===h),U=Q.findIndex(fe=>fe.id===L);if(Z===-1||U===-1){l([...c,L]);return}let q=OF(c),re=Math.min(Z,U),J=Math.max(Z,U),se=Q.reduce((fe,Me,ct)=>((ct>=re&&ct<=J||q.has(Me.id))&&fe.push(Me.id),fe),[]);l(se)}else l([...c,L]);g(L)}else g(null),l(c.filter(Z=>Z!==L))},[h,l,C,c,I]);Wb(()=>{c.length||g(null)},[c]);let S=Js(L=>{let F;return c.includes(L)?F=t.filter($=>c.includes($.id)):F=t.filter($=>$.id===L),F.map($=>({...$,elements:HF({type:"everything",elements:$.elements,randomizeSeed:!0}).duplicatedElements}))},[t,c]),D=Js((L,F)=>{let $={itemIds:c.includes(L)?c:[L]};F.dataTransfer.setData(FF.excalidrawlibIds,JSON.stringify($))},[c]),_=Js(L=>L?c.includes(L):!1,[c]),k=Js(()=>{o(r)},[r,o]),M=Js(L=>{L&&n(S(L))},[S,n]),B=u.size>=(v.length?v:t).length?WF:UF,O=kC(null);Wb(()=>{zF(()=>{O.current?.focus()})},[]);let N=!w&&$n(MC,{children:[!y&&Nt("div",{className:"library-menu-items-container__header",children:f("labels.personalLib")}),!r.length&&!I.length?$n("div",{className:"library-menu-items__no-items",children:[!C.length&&Nt("div",{className:"library-menu-items__no-items__label",children:f("library.noItems")}),Nt("div",{className:"library-menu-items__no-items__hint",children:C.length>0?f("library.hint_emptyPrivateLibrary"):f("library.hint_emptyLibrary")})]}):$n(Wp,{children:[r.length>0&&Nt($c,{itemsRenderedPerBatch:B,items:[{id:null,elements:r}],onItemSelectToggle:P,onItemDrag:D,onClick:k,isItemSelected:_,svgCache:u}),Nt($c,{itemsRenderedPerBatch:B,items:I,onItemSelectToggle:P,onItemDrag:D,onClick:M,isItemSelected:_,svgCache:u})]}),C.length>0&&Nt("div",{className:"library-menu-items-container__header",style:{marginTop:"0.75rem"},children:f("labels.excalidrawLib")}),C.length>0&&Nt(Wp,{children:Nt($c,{itemsRenderedPerBatch:B,items:C,onItemSelectToggle:P,onItemDrag:D,onClick:M,isItemSelected:_,svgCache:u})})]}),z=w&&$n(MC,{children:[$n("div",{className:"library-menu-items-container__header",children:[f("library.search.heading"),!e&&$n("div",{className:"library-menu-items-container__header__hint",style:{cursor:"pointer"},onPointerDown:L=>L.preventDefault(),onClick:L=>{E("")},children:[Nt("kbd",{children:"esc"})," to clear"]})]}),v.length>0?Nt(Wp,{children:Nt($c,{itemsRenderedPerBatch:B,items:v,onItemSelectToggle:P,onItemDrag:D,onClick:M,isItemSelected:_,svgCache:u})}):$n("div",{className:"library-menu-items__no-items",children:[Nt("div",{className:"library-menu-items__no-items__hint",children:f("library.search.noResults")}),Nt(so,{onPointerDown:L=>L.preventDefault(),onSelect:()=>{E("")},style:{width:"auto",marginTop:"1rem"},children:f("library.search.clearSearch")})]})]});return $n("div",{className:"library-menu-items-container",style:r.length||I.length||C.length?{justifyContent:"flex-start"}:{borderBottom:0},children:[$n("div",{className:"library-menu-items-header",children:[!y&&Nt(ia,{ref:O,type:"search",className:GF("library-menu-items-container__search",{hideCancelButton:m.formFactor!=="phone"}),placeholder:f("library.search.inputPlaceholder"),value:x,onChange:L=>E(L)}),Nt(EC,{selectedItems:c,onSelectItems:l,className:"library-menu-dropdown-container--in-heading"})]}),$n(Rt.Col,{className:"library-menu-items-container__items",align:"start",gap:1,style:{flex:C.length>0?1:"0 1 auto",margin:y?"auto":0},ref:p,children:[e&&Nt("div",{style:{position:"absolute",top:"var(--container-padding-y)",right:"var(--container-padding-x)",transform:"translateY(50%)"},children:Nt(Wt,{})}),N,z,y&&Nt(Dp,{style:{padding:"16px 0",width:"100%"},id:i,libraryReturnUrl:s,theme:a})]})]})}import{jsx as sa,jsxs as LC}from"react/jsx-runtime";var js=Pe(!1),AC=({children:e})=>sa("div",{className:"layer-ui__library",children:e}),JF=RC(({onInsertLibraryItems:e,pendingElements:t,onAddToLibrary:o,setAppState:n,libraryReturnUrl:r,library:a,id:i,theme:s,selectedItems:l,onSelectItems:c})=>{let[m]=le(wr),p=Kb(h=>{(async(x,E)=>{be("element","addToLibrary","ui");for(let w of $F)if(x.some(v=>v.type===w))return n({errorMessage:f(`errors.libraryElementTypeError.${w}`)});let y=[{status:"unpublished",elements:x,id:VF(),created:Date.now()},...E];o(),a.setLibrary(y).catch(()=>{n({errorMessage:f("alerts.errorAddingToLibrary")})})})(h,m.libraryItems)},[o,a,n,m.libraryItems]),d=DC(()=>m.libraryItems,[m]);if(m.status==="loading"&&!m.isInitialized)return sa(AC,{children:sa("div",{className:"layer-ui__library-message",children:LC("div",{children:[sa(Wt,{size:"2em"}),sa("span",{children:f("labels.libraryLoadingMessage")})]})})});let u=m.libraryItems.length>0||t.length>0;return LC(AC,{children:[sa($b,{isLoading:m.status==="loading",libraryItems:d,onAddToLibrary:p,onInsertLibraryItems:e,pendingElements:t,id:i,libraryReturnUrl:r,theme:s,onSelectItems:c,selectedItems:l}),u&&sa(Dp,{className:"library-menu-control-buttons--at-bottom",style:{padding:"16px 12px 0 12px"},id:i,libraryReturnUrl:r,theme:s})]})}),Vb=(e,t)=>({elements:e,pending:de(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}),selectedElementIds:t}),QF=(e,t)=>{let o=$r(),[n,r]=_C(()=>Vb(o,e.selectedElementIds)),a=YF(new Map);return Xb(()=>{for(let i of n.pending)a.current.set(i.id,i.version)},[n.pending]),Xb(()=>{t.state.cursorButton==="up"&&t.state.activeTool.type==="selection"&&r(i=>{if(!KF(i.selectedElementIds,e.selectedElementIds))return a.current.clear(),Vb(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 Vb(o,e.selectedElementIds)}return i})},[t,t.state.cursorButton,t.state.activeTool.type,e.selectedElementIds,o]),n.pending},NC=RC(()=>{let e=tt(),{onInsertElements:t}=e,o=Hn(),n=Ie(),r=Ce(),[a,i]=_C([]),s=DC(()=>e.library,[e.library]),l=QF(n,e);Xb(()=>jF(document,qF.KEYDOWN,p=>{if(p.key===XF.ESCAPE&&p.target instanceof HTMLElement){let d=p.target;if(d.closest(`.${PC.SIDEBAR}`))a.length>0?(p.stopPropagation(),i([])):ZF(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(`.${PC.SIDEBAR}`)&&(p.stopPropagation(),i([]))}}},{capture:!0}),[a,r,e]);let c=Kb(p=>{t(Zs(p)),e.focusContainer()},[t,e]),m=Kb(()=>{r({selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null})},[r]);return sa(JF,{pendingElements:l,onInsertLibraryItems:c,onAddToLibrary:m,setAppState:r,libraryReturnUrl:o.libraryReturnUrl,library:s,id:e.id,theme:n.theme,selectedItems:a,onSelectItems:i})});import eO from"clsx";import{useRef as tO}from"react";import{createPortal as oO}from"react-dom";import{KEYS as nO}from"@orangecatai/common";import{jsx as BC,jsxs as rO}from"react/jsx-runtime";var FC=e=>{let{closeOnClickOutside:t=!0}=e,o=Rm({className:"excalidraw-modal-container"}),n=tO(document.body.classList.contains("excalidraw-animations-disabled"));if(!o)return null;let r=a=>{a.key===nO.ESCAPE&&(a.nativeEvent.stopImmediatePropagation(),a.stopPropagation(),e.onCloseRequest())};return oO(rO("div",{className:eO("Modal",e.className,{"animations-disabled":n.current}),role:"dialog","aria-modal":"true",onKeyDown:r,"aria-labelledby":e.labelledBy,children:[BC("div",{className:"Modal__background",onClick:t?e.onCloseRequest:void 0}),BC("div",{className:"Modal__content",style:{"--max-width":`${e.maxWidth}px`},tabIndex:0,children:e.children})]}),o)};import{jsx as Vc,jsxs as dO}from"react/jsx-runtime";function cO(e){if(e&&typeof e=="number")return e;switch(e){case"small":return 550;case"wide":return 1024;case"regular":default:return 800}}var bt=e=>{let[t,o]=PT(),[n]=sO(document.activeElement),{id:r}=Qe(),a=Te().formFactor==="phone";iO(()=>{if(!t)return;let c=OC(t);setTimeout(()=>{c.length>0&&e.autofocus!==!1&&(c[1]||c[0]).focus()});let m=p=>{if(p.key===lO.TAB){let d=OC(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=Ce(),s=Rn(js),l=()=>{i({openMenu:null}),s(!1),n.focus(),e.onCloseRequest()};return Vc(FC,{className:aO("Dialog",e.className,{"Dialog--fullscreen":a}),labelledBy:"dialog-title",maxWidth:cO(e.size),onCloseRequest:l,closeOnClickOutside:e.closeOnClickOutside,children:dO(gt,{ref:o,children:[e.title&&Vc("h2",{id:`${r}-dialog-title`,className:"Dialog__title",children:Vc("span",{className:"Dialog__titleContent",children:e.title})}),a&&Vc("button",{className:"Dialog__close",onClick:l,title:f("buttons.close"),"aria-label":f("buttons.close"),type:"button",children:Go}),Vc("div",{className:"Dialog__content",children:e.children})]})})};import{KEYS as dt}from"@orangecatai/common";var Yp=[{icon:as,value:"hand",key:dt.H,numericKey:null,fillable:!1,toolbar:!0},{icon:Ya,value:"selection",key:dt.V,numericKey:dt[1],fillable:!0,toolbar:!0},{icon:qi,value:"rectangle",key:dt.R,numericKey:dt[2],fillable:!0,toolbar:!0},{icon:Ji,value:"diamond",key:dt.D,numericKey:dt[3],fillable:!0,toolbar:!0},{icon:Qi,value:"ellipse",key:dt.O,numericKey:dt[4],fillable:!0,toolbar:!0},{icon:gm,value:"arrow",key:dt.A,numericKey:dt[5],fillable:!0,toolbar:!0},{icon:es,value:"line",key:dt.L,numericKey:dt[6],fillable:!0,toolbar:!0},{icon:Bn,value:"freedraw",key:[dt.P,dt.X],numericKey:dt[7],fillable:!1,toolbar:!0},{icon:Fn,value:"text",key:dt.T,numericKey:dt[8],fillable:!1,toolbar:!0},{icon:ts,value:"image",key:null,numericKey:dt[9],fillable:!1,toolbar:!0},{icon:hm,value:"eraser",key:dt.E,numericKey:dt[0],fillable:!1,toolbar:!0},{icon:zn,value:"laser",key:dt.K,numericKey:null,fillable:!1,toolbar:!1}],Zb=e=>e.state.preferredSelectionTool.type==="lasso"?[{value:"lasso",icon:Ya,key:dt.V,numericKey:dt[1],fillable:!0,toolbar:!0},...Yp.slice(1)]:Yp,zC=(e,t)=>Zb(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 Kn from"clsx";import{useRef as yO,useState as EO}from"react";import{Popover as ca}from"radix-ui";import{CLASSES as $C,KEYS as wO,capitalizeString as la,isTransparent as Vp}from"@orangecatai/common";import{shouldAllowVerticalAlign as VC,suppportsHorizontalAlign as KC,hasBoundTextElement as Kp,isElbowArrow as Qb,isImageElement as XC,isLinearElement as e0,isTextElement as Zp,isArrowElement as WC,hasStrokeColor as YC,toolIsArrow as Xp}from"@orangecatai/element";import{createIsolation as mO}from"jotai-scope";import jb from"react";import Vn from"tunnel-rat";var qb=jb.createContext(null),Ze=()=>jb.useContext(qb),pO=mO(),HC=()=>jb.useMemo(()=>({MainMenuTunnel:Vn(),WelcomeScreenMenuHintTunnel:Vn(),WelcomeScreenToolbarHintTunnel:Vn(),WelcomeScreenHelpHintTunnel:Vn(),WelcomeScreenCenterTunnel:Vn(),FooterCenterTunnel:Vn(),DefaultSidebarTriggerTunnel:Vn(),DefaultSidebarTabTriggersTunnel:Vn(),OverwriteConfirmDialogTunnel:Vn(),TTDDialogTriggerTunnel:Vn(),tunnelsJotai:pO}),[]);import{CODES as uO,KEYS as gO}from"@orangecatai/common";import{CaptureUpdateAction as hO}from"@orangecatai/element";var ii=W({name:"viewMode",label:"labels.viewMode",icon:ls,viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.viewModeEnabled},perform(e,t){return{appState:{...t,viewModeEnabled:!this.checked(t)},captureUpdate:hO.EVENTUALLY}},checked:e=>e.viewModeEnabled,predicate:(e,t,o)=>typeof o.viewModeEnabled>"u",keyTest:e=>!e[gO.CTRL_OR_CMD]&&e.altKey&&e.code===uO.R});import{useEffect as fO,useState as bO}from"react";import GC from"clsx";import{capitalizeString as UC}from"@orangecatai/common";import{Popover as Jb}from"radix-ui";import{jsx as $p,jsxs as xO}from"react/jsx-runtime";var Qs=({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]=bO(!1),u=o.type,h=c.type===u,g=32/2+10,{container:x}=Qe();return!t.some(E=>E.type===u)&&p&&d(!1),fO(()=>{let E=e.onPointerDownEmitter.on(()=>{d(!1)});return()=>E?.()},[e]),xO(Jb.Root,{open:p,children:[$p(Jb.Trigger,{asChild:!0,children:$p(ae,{className:GC(r,{fillable:m,active:t.some(E=>E.type===o.type)}),type:"radio",icon:c.icon,checked:h,name:"editor-current-shape",title:i,"aria-label":i,"data-testid":s,onPointerDown:()=>{d(E=>!E),l(n)}})}),$p(Jb.Content,{className:"tool-popover-content",sideOffset:g,collisionBoundary:x??void 0,children:t.map(({type:E,icon:y,title:w})=>$p(ae,{className:GC(r,{active:u===E}),type:"radio",icon:y,checked:u===E,name:`${a}-option`,title:w||UC(E),keyBindingLabel:"","aria-label":w||UC(E),"data-testid":`toolbar-${E}`,onChange:()=>{e.state.activeTool.type!==E&&be("toolbar",E,"ui"),e.setActiveTool({type:E}),l?.(E)}},E))})]})};import{Fragment as Do,jsx as ie,jsxs as ke}from"react/jsx-runtime";var t0=Kn([$C.SHAPE_ACTIONS_THEME_SCOPE,"properties-content"]),Kc=(e,t)=>{let o=t[0]?.type||null;for(let n of t)if(n.type!==o){o=null;break}return YC(e.activeTool.type)&&o!=="image"&&o!=="frame"&&o!=="magicframe"||t.some(n=>YC(n.type))},Xc=(e,t)=>_n(e.activeTool.type)||t.some(o=>_n(o.type)),ZC=({appState:e,elementsMap:t,renderAction:o,app:n})=>{let r=Hi(t,e),a=!1;r.length===2&&(Kp(r[0])||Kp(r[1]))&&(a=!0);let i=!!(e.editingTextElement||e.newElement),s=Te(),l=document.documentElement.getAttribute("dir")==="rtl",c=_n(e.activeTool.type)&&!Vp(e.currentItemBackgroundColor)||r.some(h=>_n(h.type)&&!Vp(h.backgroundColor)),m=r.length===1||a,p=!e.selectedLinearElement?.isEditing&&r.length===1&&e0(r[0])&&!Qb(r[0]),d=!e.croppingElementId&&r.length===1&&XC(r[0]),u=!a&&ao(e,n);return ke("div",{className:"selected-shape-actions",children:[ie("div",{children:Kc(e,r)&&o("changeStrokeColor")}),Xc(e,r)&&ie("div",{children:o("changeBackgroundColor")}),c&&o("changeFillStyle"),(Kl(e.activeTool.type)||r.some(h=>Kl(h.type)))&&o("changeStrokeWidth"),(e.activeTool.type==="freedraw"||r.some(h=>h.type==="freedraw"))&&o("changeStrokeShape"),(Xl(e.activeTool.type)||r.some(h=>Xl(h.type)))&&ke(Do,{children:[o("changeStrokeStyle"),o("changeSloppiness")]}),(Zl(e.activeTool.type)||r.some(h=>Zl(h.type)))&&ie(Do,{children:o("changeRoundness")}),(Xp(e.activeTool.type)||r.some(h=>Xp(h.type)))&&ie(Do,{children:o("changeArrowType")}),(e.activeTool.type==="text"||r.some(Zp))&&ke(Do,{children:[o("changeFontFamily"),o("changeFontSize"),(e.activeTool.type==="text"||KC(r,t))&&o("changeTextAlign")]}),VC(r,t)&&o("changeVerticalAlign"),(Gi(e.activeTool.type)||r.some(h=>Gi(h.type)))&&ie(Do,{children:o("changeArrowhead")}),o("changeOpacity"),ke("fieldset",{children:[ie("legend",{children:f("labels.layers")}),ke("div",{className:"buttonList",children:[o("sendToBack"),o("sendBackward"),o("bringForward"),o("bringToFront")]})]}),u&&!a&&ke("fieldset",{children:[ie("legend",{children:f("labels.align")}),ke("div",{className:"buttonList",children:[l?ke(Do,{children:[o("alignRight"),o("alignHorizontallyCentered"),o("alignLeft")]}):ke(Do,{children:[o("alignLeft"),o("alignHorizontallyCentered"),o("alignRight")]}),r.length>2&&o("distributeHorizontally"),ie("div",{style:{flexBasis:"100%",height:0}}),ke("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&&ke("fieldset",{children:[ie("legend",{children:f("labels.actions")}),ke("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")]})]})]})},jC=({appState:e,renderAction:t,setAppState:o,targetElements:n,container:r})=>{let a=_n(e.activeTool.type)&&!Vp(e.currentItemBackgroundColor)||n.some(l=>_n(l.type)&&!Vp(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?ie("div",{className:"compact-action-item",children:ke(ca.Root,{open:s,onOpenChange:l=>{o(l?{openPopup:"compactStrokeStyles"}:{openPopup:null})},children:[ie(ca.Trigger,{asChild:!0,children:ie("button",{type:"button",className:Kn("compact-action-button properties-trigger",{active:s}),title:f("labels.stroke"),onClick:l=>{l.preventDefault(),l.stopPropagation(),o({openPopup:s?null:"compactStrokeStyles"})},children:uv})}),s&&ie(gr,{className:t0,container:r,style:{maxWidth:"13rem"},onClose:()=>{},children:ke("div",{className:"selected-shape-actions",children:[a&&t("changeFillStyle"),(Kl(e.activeTool.type)||n.some(l=>Kl(l.type)))&&t("changeStrokeWidth"),(Xl(e.activeTool.type)||n.some(l=>Xl(l.type)))&&ke(Do,{children:[t("changeStrokeStyle"),t("changeSloppiness")]}),(Zl(e.activeTool.type)||n.some(l=>Zl(l.type)))&&t("changeRoundness"),t("changeOpacity")]})})]})}):null},qC=({appState:e,renderAction:t,setAppState:o,targetElements:n,container:r,app:a})=>{let i=Xp(e.activeTool.type)||n.some(l=>Xp(l.type)),s=e.openPopup==="compactArrowProperties";return i?ie("div",{className:"compact-action-item",children:ke(ca.Root,{open:s,onOpenChange:l=>{o(l?{openPopup:"compactArrowProperties"}:{openPopup:null})},children:[ie(ca.Trigger,{asChild:!0,children:ie("button",{type:"button",className:Kn("compact-action-button properties-trigger",{active:s}),title:f("labels.arrowtypes"),onClick:l=>{l.preventDefault(),l.stopPropagation(),o({openPopup:s?null:"compactArrowProperties"})},children:(()=>{let l=Kt(n,a,c=>WC(c)?c.elbowed?"elbow":c.roundness?"round":"sharp":null,c=>WC(c),c=>c?null:e.currentItemArrowType);return l==="elbow"?ms:l==="round"?ps:ds})()})}),s&&ie(gr,{container:r,className:"properties-content",style:{maxWidth:"13rem"},onClose:()=>{},children:t("changeArrowProperties")})]})}):null},JC=({appState:e,renderAction:t,setAppState:o,targetElements:n,container:r,elementsMap:a})=>{let{saveCaretPosition:i,restoreCaretPosition:s}=Nv(),l=e.openPopup==="compactTextProperties";return ie("div",{className:"compact-action-item",children:ke(ca.Root,{open:l,onOpenChange:c=>{c?(e.editingTextElement&&i(),o({openPopup:"compactTextProperties"})):(o({openPopup:null}),e.editingTextElement&&s())},children:[ie(ca.Trigger,{asChild:!0,children:ie("button",{type:"button",className:Kn("compact-action-button properties-trigger",{active:l}),title:f("labels.textAlign"),onClick:c=>{c.preventDefault(),c.stopPropagation(),l?o({openPopup:null}):(e.editingTextElement&&i(),o({openPopup:"compactTextProperties"}))},children:FE})}),e.openPopup==="compactTextProperties"&&ie(gr,{className:t0,container:r,style:{maxWidth:"13rem"},preventAutoFocusOnTouch:!!e.editingTextElement,onClose:()=>{e.editingTextElement&&s()},children:ke("div",{className:"selected-shape-actions",children:[(e.activeTool.type==="text"||n.some(Zp))&&t("changeFontSize"),(e.activeTool.type==="text"||KC(n,a))&&t("changeTextAlign"),VC(n,a)&&t("changeVerticalAlign")]})})]})})},QC=({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&&XC(o[0]),m=o.length===1,p=ao(e,a),d=!1;o.length===2&&(Kp(o[0])||Kp(o[1]))&&(d=!0);let u=document.documentElement.getAttribute("dir")==="rtl",h=e.openPopup==="compactOtherProperties";return l||o.length===0?null:ie("div",{className:"compact-action-item",children:ke(ca.Root,{open:h,onOpenChange:g=>{n(g?{openPopup:"compactOtherProperties"}:{openPopup:null})},children:[ie(ca.Trigger,{asChild:!0,children:ie("button",{type:"button",className:Kn("compact-action-button properties-trigger",{active:h}),title:f("labels.actions"),onClick:g=>{g.preventDefault(),g.stopPropagation(),n({openPopup:h?null:"compactOtherProperties"})},children:AE})}),h&&ie(gr,{className:t0,container:r,style:{maxWidth:"12rem",justifyContent:"center",alignItems:"center"},onClose:()=>{},children:ke("div",{className:"selected-shape-actions",children:[ke("fieldset",{children:[ie("legend",{children:f("labels.layers")}),ke("div",{className:"buttonList",children:[t("sendToBack"),t("sendBackward"),t("bringForward"),t("bringToFront")]})]}),p&&!d&&ke("fieldset",{children:[ie("legend",{children:f("labels.align")}),ke("div",{className:"buttonList",children:[u?ke(Do,{children:[t("alignRight"),t("alignHorizontallyCentered"),t("alignLeft")]}):ke(Do,{children:[t("alignLeft"),t("alignHorizontallyCentered"),t("alignRight")]}),o.length>2&&t("distributeHorizontally"),ie("div",{style:{flexBasis:"100%",height:0}}),ke("div",{style:{display:"flex",flexWrap:"wrap",gap:".5rem",marginTop:"-0.5rem"},children:[t("alignTop"),t("alignVerticallyCentered"),t("alignBottom"),o.length>2&&t("distributeVertically")]})]})]}),ke("fieldset",{children:[ie("legend",{children:f("labels.actions")}),ke("div",{className:"buttonList",children:[t("group"),t("ungroup"),m&&t("hyperlink"),c&&t("cropEditor"),i&&t("duplicateSelection"),s&&t("deleteSelectedElements")]})]})]})})]})})},vO=({appState:e,renderAction:t,targetElements:o})=>!e.selectedLinearElement?.isEditing&&o.length===1&&e0(o[0])&&!Qb(o[0])?ie("div",{className:"compact-action-item",children:t("toggleLinearEditor")}):null,e5=({appState:e,elementsMap:t,renderAction:o,app:n,setAppState:r})=>{let a=Hi(t,e),{container:i}=Qe(),s=!!(e.editingTextElement||e.newElement),l=!e.selectedLinearElement?.isEditing&&a.length===1&&e0(a[0])&&!Qb(a[0]);return ke("div",{className:"compact-shape-actions",children:[Kc(e,a)&&ie("div",{className:Kn("compact-action-item"),children:o("changeStrokeColor")}),Xc(e,a)&&ie("div",{className:"compact-action-item",children:o("changeBackgroundColor")}),ie(jC,{appState:e,renderAction:o,setAppState:r,targetElements:a,container:i}),ie(qC,{appState:e,renderAction:o,setAppState:r,targetElements:a,container:i,app:n}),l&&ie("div",{className:"compact-action-item",children:o("toggleLinearEditor")}),(e.activeTool.type==="text"||a.some(Zp))&&ke(Do,{children:[ie("div",{className:"compact-action-item",children:o("changeFontFamily")}),ie(JC,{appState:e,renderAction:o,setAppState:r,targetElements:a,container:i,elementsMap:t})]}),!s&&a.length>0&&ie("div",{className:"compact-action-item",children:o("duplicateSelection")}),!s&&a.length>0&&ie("div",{className:"compact-action-item",children:o("deleteSelectedElements")}),ie(QC,{appState:e,renderAction:o,targetElements:a,setAppState:r,container:i,app:n})]})},t5=({appState:e,elementsMap:t,renderAction:o,app:n,setAppState:r})=>{let a=Hi(t,e),{container:i}=Qe(),s=yO(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 ke(gt,{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:[ke("div",{style:{display:"flex",flexDirection:"row",gap:m,flex:1},children:[Kc(e,a)&&ie("div",{className:Kn("compact-action-item"),children:o("changeStrokeColor")}),Xc(e,a)&&ie("div",{className:"compact-action-item",children:o("changeBackgroundColor")}),ie(jC,{appState:e,renderAction:o,setAppState:r,targetElements:a,container:i}),ie(qC,{appState:e,renderAction:o,setAppState:r,targetElements:a,container:i,app:n}),ie(vO,{appState:e,renderAction:o,targetElements:a}),(e.activeTool.type==="text"||a.some(Zp))&&ke(Do,{children:[ie("div",{className:"compact-action-item",children:o("changeFontFamily")}),ie(JC,{appState:e,renderAction:o,setAppState:r,targetElements:a,container:i,elementsMap:t})]}),ie(QC,{appState:e,renderAction:o,targetElements:a,setAppState:r,container:i,app:n,showDuplicate:!g,showDelete:!h})]}),ke("div",{style:{display:"flex",flexDirection:"row",gap:m},children:[ie("div",{className:"compact-action-item",children:o("undo")}),ie("div",{className:"compact-action-item",children:o("redo")}),g&&ie("div",{className:"compact-action-item",children:o("duplicateSelection")}),h&&ie("div",{className:"compact-action-item",children:o("deleteSelectedElements")})]})]})},o5=({activeTool:e,setAppState:t,app:o,UIOptions:n})=>{let[r,a]=EO(!1),i=Dt(),s=i==="full",l=i==="compact",c=[{type:"selection",icon:Ya,title:la(f("toolBar.selection"))},{type:"lasso",icon:Hr,title:la(f("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}=Ze();return ke(Do,{children:[Zb(o).map(({value:g,icon:x,key:E,numericKey:y,fillable:w,toolbar:v})=>{if(v===!1||n.tools?.[g]===!1)return null;let I=f(`toolBar.${g}`),C=E&&la(typeof E=="string"?E:E[0]),P=C?`${C} ${f("helpDialog.or")} ${y}`:`${y}`,S=g==="hand"?void 0:y||C;return(g==="selection"||g==="lasso")&&l?ie(Qs,{app:o,options:c,activeTool:e,defaultOption:o.state.preferredSelectionTool.type,namePrefix:"selectionType",title:la(f("toolBar.selection")),"data-testid":"toolbar-selection",onToolChange:D=>{(D==="selection"||D==="lasso")&&(o.setActiveTool({type:D}),t({preferredSelectionTool:{type:D,initialized:!0}}))},displayedOption:c.find(D=>D.type===o.state.preferredSelectionTool.type)||c[0],fillable:e.type==="selection"},"selection-popover"):ie(ae,{className:Kn("Shape",{fillable:w}),type:"radio",icon:x,checked:e.type===g,name:"editor-current-shape",title:`${la(I)} \u2014 ${P}`,keyBindingLabel:S,"aria-label":la(I),"aria-keyshortcuts":P,"data-testid":`toolbar-${g}`,onPointerDown:({pointerType:D})=>{!o.state.penDetected&&D==="pen"&&o.togglePenMode(!0),g==="selection"&&(o.state.activeTool.type==="selection"?o.setActiveTool({type:"lasso"}):o.setActiveTool({type:"selection"}))},onChange:({pointerType:D})=>{o.state.activeTool.type!==g&&be("toolbar",g,"ui"),g==="image"?o.setActiveTool({type:g}):o.setActiveTool({type:g})}},g)}),ie("div",{className:"App-toolbar__divider"}),ie(ae,{className:"Shape",type:"radio",icon:Uw,checked:!1,name:"editor-current-shape",title:"Image Generator \u2014 A",keyBindingLabel:"A","aria-label":"Image Generator","data-testid":"toolbar-image-generator",onChange:()=>{be("toolbar","imageGenerator","ui"),o.onImageGeneratorSelect()}}),ie(ae,{className:"Shape",type:"radio",icon:On,checked:m,name:"editor-current-shape",title:`${la(f("toolBar.frame"))} \u2014 F`,keyBindingLabel:"F","aria-label":la(f("toolBar.frame")),"data-testid":"toolbar-frame",onChange:()=>{be("toolbar","frame","ui"),o.setActiveTool({type:"frame"})}}),ke(ye,{open:r,children:[ie(ye.Trigger,{className:Kn("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:f("toolBar.extraTools"),children:u?os:p&&!o.props.isCollaborating?zn:d?Hr:ic}),ke(ye.Content,{onClickOutside:()=>a(!1),onSelect:()=>a(!1),className:"App-toolbar__extra-tools-dropdown",children:[ie(ye.Item,{onSelect:()=>o.setActiveTool({type:"embeddable"}),icon:os,"data-testid":"toolbar-embeddable",selected:u,children:f("toolBar.embeddable")}),ie(ye.Item,{onSelect:()=>o.setActiveTool({type:"laser"}),icon:zn,"data-testid":"toolbar-laser",selected:p,shortcut:wO.K.toLocaleUpperCase(),children:f("toolBar.laser")}),s&&ie(ye.Item,{onSelect:()=>o.setActiveTool({type:"lasso"}),icon:Hr,"data-testid":"toolbar-lasso",selected:d,children:f("toolBar.lasso")}),ie("div",{style:{margin:"6px 0",fontSize:14,fontWeight:600},children:"Generate"}),o.props.aiEnabled!==!1&&ie(h.Out,{}),ie(ye.Item,{onSelect:()=>o.setOpenDialog({name:"ttd",tab:"mermaid"}),icon:ss,"data-testid":"toolbar-mermaid",children:f("toolBar.mermaidToExcalidraw")}),o.props.aiEnabled!==!1&&o.plugins.diagramToCode&&ie(ye.Item,{onSelect:()=>o.onMagicframeToolSelect(),icon:Ka,"data-testid":"toolbar-magicframe",badge:ie(ye.Item.Badge,{children:"AI"}),children:f("toolBar.magicframe")})]})]})]})},n5=({renderAction:e})=>e("scrollBackToContent"),r5=({renderAction:e,zoom:t})=>ke(Rt.Row,{align:"center",className:$C.ZOOM_ACTIONS,children:[e("zoomOut"),e("resetZoom"),e("zoomIn")]}),a5=({renderAction:e,className:t})=>ke("div",{className:`undo-redo-buttons ${t}`,children:[ie("div",{className:"undo-button-container",children:ie(Xt,{label:f("buttons.undo"),children:e("undo")})}),ie("div",{className:"redo-button-container",children:ke(Xt,{label:f("buttons.redo"),children:[" ",e("redo")]})})]}),i5=({actionManager:e,showExitZenModeBtn:t})=>ie("button",{type:"button",className:Kn("disable-zen-mode",{"disable-zen-mode--visible":t}),onClick:()=>e.executeAction(ta),children:f("buttons.exitZenMode")}),s5=({actionManager:e})=>ie("button",{type:"button",className:"disable-view-mode",onClick:()=>e.executeAction(ii),children:hv});import{useRef as IO}from"react";var o0=e=>{let t=IO({userFn:e});return t.current.userFn=e,t.current.stableFn||(t.current.stableFn=(...o)=>t.current.userFn(...o)),t.current.stableFn};import{jsx as CO,jsxs as TO}from"react/jsx-runtime";var si=Pe(null),l5=()=>{let[e,t]=le(si),o=at();return e&&e==="clearCanvas"?CO(Np,{onConfirm:()=>{o.executeAction(yr),t(null)},onCancel:()=>t(null),title:f("clearCanvasDialog.title"),children:TO("p",{className:"clear-canvas__content",children:[" ",f("alerts.clearReset")]})}):null};var n0={};eE(n0,{toggleTheme:()=>kO});var kO={...qa,category:"App",label:"Toggle theme",perform:({actionManager:e})=>{e.executeAction(qa,"commandPalette")}};import{jsx as Bt,jsxs as Xn}from"react/jsx-runtime";var LO=Pe(null),it={app:"App",export:"Export",tools:"Tools",editor:"Editor",elements:"Elements",links:"Links",library:"Library"},d5=e=>{switch(e){case it.app:return 1;case it.export:return 2;case it.editor:return 3;case it.tools:return 4;case it.elements:return 5;case it.links:return 6;default:return 10}},Jp=({shortcut:e,className:t,children:o})=>{let n=e.replace("++","+$").split("+");return Xn("div",{className:p5("shortcut",t),children:[n.map((r,a)=>Bt("div",{className:"shortcut-wrapper",children:Bt("div",{className:"shortcut-key",children:r==="$"?"+":r})},r)),Bt("div",{className:"shortcut-desc",children:o})]})},g5=e=>!e.altKey&&e[yn.CTRL_OR_CMD]&&(e.shiftKey&&e.key.toLowerCase()===yn.P||e.key===yn.SLASH),_O=Object.assign(e=>{let t=Ie(),o=Ce();return qp(()=>{let n=r=>{g5(r)&&(r.preventDefault(),r.stopPropagation(),o(a=>{let i=a.openDialog?.name==="commandPalette"?null:{name:"commandPalette"};return i&&be("command_palette","open","shortcut"),{openDialog:i}}))};return window.addEventListener(Qp.KEYDOWN,n,{capture:!0}),()=>window.removeEventListener(Qp.KEYDOWN,n,{capture:!0})},[o]),t.openDialog?.name!=="commandPalette"?null:Bt(DO,{...e})},{defaultItems:n0});function DO({customCommandPaletteItems:e}){let t=tt(),o=Ie(),n=Ce(),r=Hn(),a=at(),[i,s]=le(LO),[l,c]=jp(null),m=u5(null),p=Ur({uiAppState:o,customCommandPaletteItems:e,appProps:r}),[d]=le(wr),u=MO(()=>d.libraryItems?.filter(S=>!!S.name).map(S=>({label:S.name,icon:Bt(RO,{id:S.id,elements:S.elements}),category:"Library",order:d5("Library"),haystack:ri(S.name),perform:()=>{t.onInsertElements(Zs([S]))}}))||[],[t,d.libraryItems]);qp(()=>{let{uiAppState:S,customCommandPaletteItems:D,appProps:_}=p,k=N=>{let z="";return N.label&&(typeof N.label=="function"?z=f(N.label(t.scene.getNonDeletedElements(),S,t)):z=f(N.label)),z},M=N=>typeof N.icon=="function"?N.icon(S,t.scene.getNonDeletedElements()):N.icon,B=[],O=(N,z,L)=>{let F={label:k(N),icon:M(N),category:z,shortcut:Xe(N.name),keywords:N.keywords,predicate:N.predicate,viewMode:N.viewMode,perform:()=>{a.executeAction(N,"commandPalette")}};return L?L(F,N):F};if(S&&t.scene&&a){let N=[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,Nc,Mp,ST].map(Z=>O(Z,it.elements,(U,q)=>({...U,predicate:q.predicate?q.predicate:(re,J,se,fe)=>de(re,J).length>0}))),z=[a.actions.toggleHandTool,a.actions.setFrameAsActiveTool,a.actions.toggleLassoTool].map(Z=>O(Z,it.tools)),L=[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(Z=>O(Z,it.editor)),F=[a.actions.saveToActiveFile,a.actions.saveFileToDisk,a.actions.copyAsPng,a.actions.copyAsSvg].map(Z=>O(Z,it.export));B=[...N,...L,{label:k(yr),icon:M(yr),shortcut:Xe(yr.name),category:it.editor,keywords:["delete","destroy"],viewMode:!1,perform:()=>{Et.set(si,"clearCanvas")}},{label:f("buttons.exportImage"),category:it.export,icon:ym,shortcut:Xe("imageExport"),keywords:["export","image","png","jpeg","svg","clipboard","picture"],perform:()=>{n({openDialog:{name:"imageExport"}})}},...F];let $=[{label:f("toolBar.library"),category:it.app,icon:um,viewMode:!1,perform:()=>{S.openSidebar?n({openSidebar:null}):n({openSidebar:{name:c5.name,tab:c5.defaultTab}})}},{label:f("search.title"),category:it.app,icon:Mo,viewMode:!0,perform:()=>{a.executeAction(Zc)}},{label:f("labels.shapeSwitch"),category:it.elements,icon:sc,perform:()=>{a.executeAction(kT)}},{label:f("labels.changeStroke"),keywords:["color","outline"],category:it.elements,icon:xm,viewMode:!1,predicate:(Z,U)=>{let q=de(Z,U);return q.length>0&&Kc(U,q)},perform:()=>{n(Z=>({openPopup:"elementStroke"}))}},{label:f("labels.changeBackground"),keywords:["color","fill"],icon:xm,category:it.elements,viewMode:!1,predicate:(Z,U)=>{let q=de(Z,U);return q.length>0&&Xc(U,q)},perform:()=>{n(Z=>({openPopup:"elementBackground"}))}},{label:f("labels.canvasBackground"),keywords:["color"],icon:xm,category:it.editor,viewMode:!1,perform:()=>{n(Z=>({openMenu:Z.openMenu==="canvas"?null:"canvas",openPopup:"canvasBackground"}))}},...Yp.reduce((Z,U)=>{let{value:q,icon:re,key:J,numericKey:se}=U;if(_.UIOptions.tools?.[q]===!1)return Z;let Me=J&&PO(typeof J=="string"?J:J[0])||se,ct={label:f(`toolBar.${q}`),category:it.tools,shortcut:Me,icon:re,keywords:["toolbar"],viewMode:!1,perform:({event:Lt})=>{q==="image"?t.setActiveTool({type:q}):t.setActiveTool({type:q})}};return Z.push(ct),Z},[]),...z,{label:f("toolBar.lock"),category:it.tools,icon:S.activeTool.locked?ji:Wa,shortcut:yn.Q.toLocaleUpperCase(),viewMode:!1,perform:()=>{t.toggleLock()}},{label:`${f("labels.textToDiagram")}...`,category:it.tools,icon:Xw,viewMode:!1,predicate:_.aiEnabled,perform:()=>{n(Z=>({...Z,openDialog:{name:"ttd",tab:"text-to-diagram"}}))}},{label:`${f("toolBar.mermaidToExcalidraw")}...`,category:it.tools,icon:ss,viewMode:!1,predicate:_.aiEnabled,perform:()=>{n(Z=>({...Z,openDialog:{name:"ttd",tab:"mermaid"}}))}}],Q=[...B,...$,...D||[]].map(Z=>({...Z,icon:Z.icon||sc,order:Z.order??d5(Z.category),haystack:`${ri(Z.label.toLocaleLowerCase())} ${Z.keywords?.join(" ")||""}`}));c(Q),s([...Q,...u].find(Z=>Z.label===i?.label)??null)}},[p,t,a,c,i?.label,s,n,u]);let[h,g]=jp(""),[x,E]=jp(null),[y,w]=jp({}),v=S=>{n({openDialog:null},S),g("")},I=(S,D)=>{o.openDialog?.name==="commandPalette"&&(D.stopPropagation(),D.preventDefault(),document.body.classList.add("excalidraw-animations-disabled"),v(()=>{S.perform({actionManager:a,event:D}),s(S),requestAnimationFrame(()=>{document.body.classList.remove("excalidraw-animations-disabled")})}))},C=o0(S=>S.viewMode===!1&&o.viewModeEnabled?!1:typeof S.predicate=="function"?S.predicate(t.scene.getNonDeletedElements(),o,r,t):S.predicate===void 0||S.predicate),P=o0(S=>{let D=AO(S.target)||g5(S)||S.key===yn.ESCAPE;if(D&&S.key!==yn.ARROW_UP&&S.key!==yn.ARROW_DOWN&&S.key!==yn.ENTER)return;let _=Object.values(y).flat(),k=i&&!h&&C(i);if(S.key===yn.ARROW_UP){S.preventDefault();let M=_.findIndex(N=>N.label===x?.label);if(k){if(M===0){E(i);return}if(x===i){let N=_[_.length-1];N&&E(N);return}}let B;M===-1?B=_.length-1:B=M===0?_.length-1:(M-1)%_.length;let O=_[B];O&&E(O);return}if(S.key===yn.ARROW_DOWN){S.preventDefault();let M=_.findIndex(N=>N.label===x?.label);if(k){if(!x||M===_.length-1){E(i);return}if(x===i){let N=_[0];N&&E(N);return}}let B=(M+1)%_.length,O=_[B];O&&E(O);return}if(S.key===yn.ENTER&&x&&setTimeout(()=>{I(x,S)}),!D){if(S.stopPropagation(),/^[a-zA-Z0-9]$/.test(S.key)){m?.current?.focus();return}S.preventDefault()}});return qp(()=>(window.addEventListener(Qp.KEYDOWN,P,{capture:!0}),()=>window.removeEventListener(Qp.KEYDOWN,P,{capture:!0})),[P]),qp(()=>{if(!l)return;let S=M=>{let B={};for(let O of M)B[O.category]?B[O.category].push(O):B[O.category]=[O];return B},D=h?.length>1?[...l.filter(C).sort((M,B)=>M.order-B.order),...u]:l.filter(C).sort((M,B)=>M.order-B.order),_=!h&&i&&C(i);if(!h){w(S(_?D.filter(M=>M.label!==i?.label):D)),E(_?i:D[0]||null);return}let k=ri(h.toLocaleLowerCase().replace(/[<>_| -]/g,""));D=SO.filter(k,D,{extract:M=>M.haystack??""}).sort((M,B)=>B.score-M.score).map(M=>M.original),w(S(D)),E(D[0]??null)},[h,l,C,i,u]),Xn(bt,{onCloseRequest:()=>v(),closeOnClickOutside:!0,title:!1,size:720,autofocus:!0,className:"command-palette-dialog",children:[Bt(ia,{value:h,placeholder:f("commandPalette.search.placeholder"),onChange:S=>{g(S)},selectOnRender:!0,ref:m}),t.editorInterface.formFactor!=="phone"&&Xn("div",{className:"shortcuts-wrapper",children:[Bt(Jp,{shortcut:"\u2191\u2193",children:f("commandPalette.shortcuts.select")}),Bt(Jp,{shortcut:"\u21B5",children:f("commandPalette.shortcuts.confirm")}),Bt(Jp,{shortcut:G("Esc"),children:f("commandPalette.shortcuts.close")})]}),Xn("div",{className:"commands",children:[i&&!h&&Xn("div",{className:"command-category",children:[Xn("div",{className:"command-category-title",children:[f("commandPalette.recents"),Bt("div",{className:"icon",style:{marginLeft:"6px"},children:Zw})]}),Bt(m5,{command:i,isSelected:i.label===x?.label,onClick:S=>I(i,S),disabled:!C(i),onMouseMove:()=>E(i),showShortcut:t.editorInterface.formFactor!=="phone",appState:o})]}),Object.keys(y).length>0?Object.keys(y).map((S,D)=>Xn("div",{className:"command-category",children:[Bt("div",{className:"command-category-title",children:S}),y[S].map(_=>Bt(m5,{command:_,isSelected:_.label===x?.label,onClick:k=>I(_,k),onMouseMove:()=>E(_),showShortcut:t.editorInterface.formFactor!=="phone",appState:o,size:S==="Library"?"large":"small"},_.label))]},S)):l?Xn("div",{className:"no-match",children:[Bt("div",{className:"icon",children:Mo})," ",f("commandPalette.search.noMatch")]}):null]})]})}var RO=({id:e,elements:t})=>{let o=u5(null),{svgCache:n}=Ks();return Pp(e,t,n,o),Bt("div",{className:"library-item-icon",ref:o})},m5=({command:e,isSelected:t,disabled:o,onMouseMove:n,onClick:r,showShortcut:a,appState:i,size:s="small"})=>{let l=()=>{};return Xn("div",{className:p5("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?f("commandPalette.itemNotAvailable"):"",children:[Xn("div",{className:"name",children:[e.icon&&Bt(Gn,{className:"icon",size:"var(--icon-size, 1rem)",icon:typeof e.icon=="function"?e.icon(i,[]):e.icon}),Bt(xc,{children:e.label})]}),a&&e.shortcut&&Bt(Jp,{shortcut:e.shortcut})]})};import{getSizeFromPoints as oSe,randomInteger as Nz,getUpdatedTimestamp as Bz}from"@orangecatai/common";import{simplify as Ez}from"points-on-curve";import{getStroke as wz}from"perfect-freehand";import{pointsOnBezierCurves as Uwe}from"points-on-curve";import{invariant as Ywe}from"@orangecatai/common";import{curve as Vwe,lineSegment as Kwe,pointFrom as Xwe,pointDistance as Zwe,pointFromArray as jwe,pointFromVector as qwe,pointRotateRads as Jwe,polygon as Qwe,polygonFromPoints as eve,PRECISION as tve,segmentsIntersectAt as ove,vector as nve,vectorAdd as rve,vectorFromPoint as ave,vectorScale as ive}from"@orangecatai/math";import{getElementAbsoluteCoords as lve}from"@orangecatai/element";var r0=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 vz,pointDistance as _5,pointRotateRads as G3e}from"@orangecatai/math";import{ROUGHNESS as Iz,THEME as v0,isTransparent as Qc,assertNever as Tz,COLOR_PALETTE as Cz,LINE_POLYGON_POINT_MERGE_DISTANCE as W3e,applyDarkModeFilter as cu}from"@orangecatai/common";import{RoughGenerator as kz}from"roughjs/bin/generator";import qke from"roughjs/bin/rough";import{isRightAngleRads as Qke,lineSegment as e3e,pointFrom as t3e,pointRotateRads as o3e}from"@orangecatai/math";import{BOUND_TEXT_PADDING as r3e,DEFAULT_REDUCED_GLOBAL_ALPHA as a3e,ELEMENT_READY_TO_ERASE_OPACITY as i3e,FRAME_STYLE as s3e,DARK_THEME_FILTER as l3e,MIME_TYPES as A5,THEME as c3e,distance as d3e,getFontString as m3e,isRTL as p3e,getVerticalOffset as u3e,invariant as g3e,applyDarkModeFilter as h3e,isSafari as f3e}from"@orangecatai/common";import c5e from"roughjs/bin/rough";import{arrayToMap as m5e,invariant as I5,rescalePoints as p5e,sizeOf as u5e}from"@orangecatai/common";import{degreesToRadians as f0,lineSegment as h5e,pointDistance as f5e,pointFrom as Yt,pointFromArray as oz,pointRotateRads as rl}from"@orangecatai/math";import{pointsOnBezierCurves as y5e}from"points-on-curve";import{pointCenter as TCe,pointFrom as CCe,pointRotateRads as kCe,pointsEqual as SCe,pointDistance as MCe,vectorFromPoint as PCe,curveLength as ACe,curvePointAtLength as LCe}from"@orangecatai/math";import{DRAGGING_THRESHOLD as RCe,KEYS as NCe,shouldRotateWithDiscreteAngle as BCe,getGridPoint as FCe,invariant as OCe,isShallowEqual as zCe,getFeatureFlag as HCe}from"@orangecatai/common";import{deconstructLinearOrFreeDrawElement as UCe,getSnapOutlineMidPoint as WCe,isPathALoop as YCe,moveArrowAboveBindable as $Ce,projectFixedPointOntoDiagonal as VCe}from"@orangecatai/element";import{KEYS as TTe,arrayToMap as CTe,getFeatureFlag as kTe,invariant as STe,isTransparent as MTe}from"@orangecatai/common";import{PRECISION as ATe,clamp as LTe,lineSegment as _Te,pointDistance as DTe,pointDistanceSq as RTe,pointFrom as NTe,pointFromVector as BTe,pointRotateRads as FTe,pointsEqual as OTe,vectorFromPoint as zTe,vectorNormalize as HTe,vectorScale as GTe}from"@orangecatai/math";import{invariant as j2e,isTransparent as q2e}from"@orangecatai/common";import{curveIntersectLineSegment as Q2e,isPointWithinBounds as eIe,lineSegment as tIe,lineSegmentIntersectionPoints as oIe,pointFrom as nIe,pointFromVector as rIe,pointRotateRads as aIe,pointsEqual as iIe,vectorFromPoint as sIe,vectorNormalize as lIe,vectorScale as cIe}from"@orangecatai/math";import{ellipse as mIe,ellipseSegmentInterceptPoints as pIe}from"@orangecatai/math/ellipse";import{DEFAULT_ADAPTIVE_RADIUS as FO,DEFAULT_PROPORTIONAL_RADIUS as i0,invariant as yve,LINE_CONFIRM_THRESHOLD as OO,ROUNDNESS as s0}from"@orangecatai/common";import{bezierEquation as wve,curve as vve,curveCatmullRomCubicApproxPoints as Ive,curveOffsetPoints as Tve,lineSegment as Cve,lineSegmentIntersectionPoints as kve,pointDistance as zO,pointFrom as Sve,pointFromArray as Mve,pointFromVector as Pve,pointRotateRads as Ave,pointTranslate as Lve,rectangle as _ve,vectorFromPoint as Dve,vectorNormalize as Rve,vectorScale as Nve}from"@orangecatai/math";import{ROUNDNESS as pve,assertNever as uve}from"@orangecatai/common";import{pointsEqual as hve}from"@orangecatai/math";var h5=e=>!!e&&e.type==="embeddable",f5=e=>!!e&&e.type==="iframe",a0=e=>!!e&&(e.type==="iframe"||e.type==="embeddable"),li=e=>e!=null&&e.type==="text";var eu=e=>e!=null&&(e.type==="frame"||e.type==="magicframe");var ci=e=>e!=null&&NO(e.type);var di=e=>e!=null&&e.type==="arrow",jc=e=>di(e)&&e.elbowed;var NO=e=>e==="arrow"||e==="line";var el=e=>e!==null&&"containerId"in e&&e.containerId!==null&&li(e);var tu=(e,t=1)=>{if(e.length>=3){let[o,n]=[e[0],e[e.length-1]];return zO(o,n)<=OO/t}return!1},qc=(e,t)=>{if(t.roundness?.type===s0.PROPORTIONAL_RADIUS||t.roundness?.type===s0.LEGACY)return e*i0;if(t.roundness?.type===s0.ADAPTIVE_RADIUS){let o=t.roundness?.value??FO,n=o/i0;return e<=n?e*i0:o}return 0};import{ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO as y2e,ARROW_LABEL_WIDTH_FRACTION as E2e,BOUND_TEXT_PADDING as w2e,DEFAULT_FONT_SIZE as v2e,TEXT_ALIGN as I2e,VERTICAL_ALIGN as T2e,getFontString as C2e,isProdEnv as k2e,invariant as S2e}from"@orangecatai/common";import{pointFrom as P2e,pointRotateRads as A2e}from"@orangecatai/math";import{BOUND_TEXT_PADDING as jve,DEFAULT_FONT_SIZE as qve,DEFAULT_FONT_FAMILY as Jve,getFontString as Qve,isTestEnv as e2e,normalizeEOL as t2e}from"@orangecatai/common";var o2e="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase();import{isDevEnv as c2e,isTestEnv as d2e}from"@orangecatai/common";import{curvePointDistance as z2e,distanceToLineSegment as H2e,pointRotateRads as G2e}from"@orangecatai/math";import{ellipse as W2e,ellipseDistanceFromPoint as Y2e}from"@orangecatai/math/ellipse";import{invariant as kIe,isDevEnv as SIe,isTestEnv as MIe}from"@orangecatai/common";import{pointFrom as AIe,pointFromVector as LIe,pointRotateRads as _Ie,pointScaleFromOrigin as DIe,pointsEqual as RIe,triangleIncludesPoint as NIe,vectorCross as BIe,vectorFromPoint as ZO,vectorScale as FIe}from"@orangecatai/math";var g0=[1,0],y5=[0,1],h0=[-1,0],E5=[0,-1],ru=e=>{let[t,o]=e,n=Math.abs(t),r=Math.abs(o);return t>r?g0:t<=-r?h0:o>n?y5:E5},w5=(e,t)=>ru(ZO(e,t)),au=(e,t)=>iu(w5(e,t)),u0=(e,t)=>e[0]===t[0]&&e[1]===t[1],iu=e=>u0(e,g0)||u0(e,h0);import{clamp as WIe,pointDistance as YIe,pointFrom as $Ie,pointScaleFromOrigin as VIe,pointsEqual as KIe,pointTranslate as XIe,vector as ZIe,vectorCross as jIe,vectorFromPoint as qIe,vectorScale as JIe}from"@orangecatai/math";import{BinaryHeap as eTe,invariant as tTe,isAnyTrue as oTe,getSizeFromPoints as nTe,isDevEnv as rTe,arrayToMap as aTe}from"@orangecatai/common";var QTe=10/1.5;import{SHIFT_LOCKING_ANGLE as rCe,viewportCoordsToSceneCoords as aCe}from"@orangecatai/common";import{normalizeRadians as sCe,radiansBetweenAngles as lCe,radiansDifference as cCe}from"@orangecatai/math";import{pointsEqual as mCe}from"@orangecatai/math";var ou=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 nz=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}},rz=e=>{switch(e){case"bar":return 90;case"arrow":return 20;default:return 25}},b0=(e,t,o,n)=>{if(t.length<1)return null;let r=r0(t[0]);if(r.length<1)return null;let a=o==="start"?1:r.length-1,i=r[a].data;I5(i.length===6,"Op data length is not 6");let s=Yt(i[4],i[5]),l=Yt(i[2],i[3]),c=Yt(i[0],i[1]),m=r[a-1],p=Yt(0,0);if(m.op==="move"){let N=oz(m.data);I5(N!=null,"Op data is not a point"),p=N}else m.op==="bcurveTo"&&(p=Yt(m.data[4],m.data[5]));let d=(N,z)=>Math.pow(1-N,3)*s[z]+3*N*Math.pow(1-N,2)*l[z]+3*Math.pow(N,2)*(1-N)*c[z]+p[z]*Math.pow(N,3),[u,h]=o==="start"?p:s,[g,x]=[d(.3,0),d(.3,1)],E=Math.hypot(u-g,h-x),y=(u-g)/E,w=(h-x)/E,v=nz(n),I=0;{let[N,z]=o==="end"?e.points[e.points.length-1]:e.points[0],[L,F]=e.points.length>1?o==="end"?e.points[e.points.length-2]:e.points[1]:[0,0];I=Math.hypot(N-L,z-F)}let P=Math.min(v,I*(n==="diamond"||n==="diamond_outline"?.25:.5)),S=u-y*P,D=h-w*P;if(n==="dot"||n==="circle"||n==="circle_outline"){let N=Math.hypot(D-h,S-u)+e.strokeWidth-2;return[u,h,N]}let _=rz(n);if(n==="crowfoot_many"||n==="crowfoot_one_or_many"){let[N,z]=rl(Yt(u,h),Yt(S,D),f0(-_)),[L,F]=rl(Yt(u,h),Yt(S,D),f0(_));return[S,D,N,z,L,F]}let[k,M]=rl(Yt(S,D),Yt(u,h),-_*Math.PI/180),[B,O]=rl(Yt(S,D),Yt(u,h),f0(_));if(n==="diamond"||n==="diamond_outline"){let N,z;if(o==="start"){let[L,F]=e.points.length>1?e.points[1]:[0,0];[N,z]=rl(Yt(u+P*2,h),Yt(u,h),Math.atan2(F-h,L-u))}else{let[L,F]=e.points.length>1?e.points[e.points.length-2]:[0,0];[N,z]=rl(Yt(u-P*2,h),Yt(u,h),Math.atan2(h-F,u-L))}return[u,h,k,M,N,z,B,O]}return[u,h,k,M,B,O]};import{pointFrom as D5e,pointCenter as R5e,pointRotateRads as N5e,vectorFromPoint as B5e,vectorNormalize as F5e,vectorSubtract as O5e,vectorAdd as z5e,vectorScale as H5e,pointFromVector as G5e,clamp as U5e,isCloseTo as W5e}from"@orangecatai/math";import{arrayToMap as Pke}from"@orangecatai/common";import{isPointWithinBounds as Lke,pointFrom as _ke}from"@orangecatai/math";import{vectorCross as X5e,vectorFromPoint as Z5e}from"@orangecatai/math";import{arrayToMap as az}from"@orangecatai/common";import{getElementBounds as iz}from"@orangecatai/element";import{isArrowElement as sz,isExcalidrawElement as lz,isFreeDrawElement as cz,isLinearElement as dz,isTextElement as mz}from"@orangecatai/element";import{rangeIncludesValue as su,pointFrom as Cr,pointRotateRads as pz,rangeInclusive as lu}from"@orangecatai/math";var uz=e=>e.type==="diamond"?[Cr(e.width/2,0),Cr(e.width,e.height/2),Cr(e.width/2,e.height),Cr(0,e.height/2)]:[Cr(0,0),Cr(0+e.width,0),Cr(0+e.width,e.height),Cr(0,e.height)],gz=e=>dz(e)||cz(e)?e.points:uz(e),C5=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},k5=e=>{let t=gz(e),{cx:o,cy:n}=C5(t),r=Cr(o,n),a=t.map(m=>pz(m,r,e.angle)),{minX:i,minY:s,maxX:l,maxY:c}=C5(a);return[i+e.x,s+e.y,l+e.x,c+e.y]},x0=(e,t,o=!1)=>{let n=k5(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},S5=(e,t)=>{let o=k5(e);return(su(o[0],lu(t[0],t[2]))||su(t[0],lu(o[0],o[2])))&&(su(o[1],lu(t[1],t[3]))||su(t[1],lu(o[1],o[3])))},M5=({elements:e,bounds:t,type:o,errorMargin:n=0})=>{lz(t)&&(t=iz(t,az(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"?S5(i,r):o==="inside"?x0(i,r):x0(i,r,!0)){if(a.add(i.id),i.boundElements)for(let l of i.boundElements)a.add(l.id);mz(i)&&i.containerId&&a.add(i.containerId),sz(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 mke,isShallowEqual as fz}from"@orangecatai/common";var hz=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:y0({...s.selectedElementIds,...p},l)},o},r=(a,i,s,l)=>{let c=l?l.scene.getSelectedElements({selectedElementIds:a.selectedElementIds,elements:i}):E0(i,a);return c.length?n(c,i,a,s):{selectedGroupIds:{},editingGroupId:null,selectedElementIds:y0(a.selectedElementIds,s)}};return r.clearCache=()=>{t=null,e=null,o=null},r}();var xke=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}(),E0=(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&&el(a)&&t.selectedElementIds[a?.containerId]){r.push(a),n.add(a.id);continue}}if(o?.includeElementsInFrames){let a=[];return r.forEach(i=>{eu(i)&&P5(e,i.id).forEach(s=>!n.has(s.id)&&a.push(s)),a.push(i)}),a}return r};var y0=(e,t)=>fz(t.selectedElementIds,e)?t.selectedElementIds:e;var P5=(e,t)=>{let o=[];for(let n of e.values())n.frameId===t&&o.push(n);return o};var xz=typeof document<"u"?document.createElement("img"):{src:""};xz.src=`data:${A5.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 yz=typeof document<"u"?document.createElement("img"):{src:""};yz.src=`data:${A5.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 w0=new WeakMap;var L5=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="line"||e==="diamond"||e==="image";var xo=class xo{};A(xo,"rg",new kz),A(xo,"cache",new WeakMap),A(xo,"get",(t,o)=>{let n=xo.cache.get(t);if(n&&(o===null||n.theme===o))return n.shape}),A(xo,"delete",t=>{xo.cache.delete(t),w0.delete(t)}),A(xo,"destroy",()=>{xo.cache=new WeakMap}),A(xo,"generateElementShape",(t,o)=>{let n=o?.isExporting?void 0:xo.get(t,o?o.theme:null);if(n!==void 0)return n;w0.delete(t);let r=Pz(t,xo.rg,o||{isExporting:!1,canvasBackgroundColor:Cz.white,embedsValidationStatus:null,theme:v0.LIGHT});return o?.isExporting||xo.cache.set(t,{shape:r,theme:o?.theme||v0.LIGHT}),r});var nl=xo,Sz=e=>[8,8+e],B5=e=>[1.5,6+e];function Mz(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&&L5(e.type)||ci(e)&&o>=50?t:Math.min(t/(o<10?3:2),2.5)}var Tr=(e,t=!1,o=!1)=>{let n={seed:e.seed,strokeLineDash:e.strokeStyle==="dashed"?Sz(e.strokeWidth):e.strokeStyle==="dotted"?B5(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:Mz(e),stroke:o?cu(e.strokeColor):e.strokeColor,preserveVertices:t||e.roughness<Iz.cartoonist};switch(e.type){case"rectangle":case"iframe":case"embeddable":case"diamond":case"ellipse":return n.fillStyle=e.fillStyle,n.fill=Qc(e.backgroundColor)?void 0:o?cu(e.backgroundColor):e.backgroundColor,e.type==="ellipse"&&(n.curveFitting=1),n;case"line":case"freedraw":return tu(e.points)&&(n.fillStyle=e.fillStyle,n.fill=e.backgroundColor==="transparent"?void 0:o?cu(e.backgroundColor):e.backgroundColor),n;case"arrow":return n;default:throw new Error(`Unimplemented type ${e.type}`)}},D5=(e,t,o)=>a0(e)&&(t||h5(e)&&o?.get(e.id)!==!0)&&Qc(e.backgroundColor)&&Qc(e.strokeColor)?{...e,roughness:0,backgroundColor:"#d3d3d3",fillStyle:"solid"}:f5(e)?{...e,strokeColor:Qc(e.strokeColor)?"#000000":e.strokeColor,backgroundColor:Qc(e.backgroundColor)?"#f4f4f6":e.backgroundColor}:e,R5=(e,t,o,n,r,a,i,s)=>{let l=b0(e,t,o,n);if(l===null)return[];let c=(p,d)=>{if(p===null)return[];let[,,u,h,g,x]=p;return[r.line(u,h,g,x,d)]},m=s?cu(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,x]=l;return delete a.strokeLineDash,[r.polygon([[p,d],[u,h],[g,x],[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,x,E,y]=l;return delete a.strokeLineDash,[r.polygon([[p,d],[u,h],[g,x],[E,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,x]=l;if(e.strokeStyle==="dotted"){let E=B5(e.strokeWidth-1);a.strokeLineDash=[E[0],E[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,x,p,d,a),...n==="crowfoot_one_or_many"?c(b0(e,t,o,"crowfoot_one"),a):[]]}}};var Pz=(e,t,{isExporting:o,canvasBackgroundColor:n,embedsValidationStatus:r,theme:a})=>{let i=a===v0.DARK;switch(e.type){case"rectangle":case"iframe":case"embeddable":{let s;if(e.roundness){let l=e.width,c=e.height,m=qc(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`,Tr(D5(e,o,r),!0,i))}else s=t.rectangle(0,0,e.width,e.height,Tr(D5(e,o,r),!1,i));return s}case"diamond":{let s,[l,c,m,p,d,u,h,g]=ou(e);if(e.roundness){let x=qc(Math.abs(l-h),e),E=qc(Math.abs(p-c),e);s=t.path(`M ${l+x} ${c+E} L ${m-x} ${p-E}
|