@multiplayer-app/ai-agent-react 0.1.0-beta.31 → 0.1.0-beta.32
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/ai-agent-react.cjs.js +1 -1
- package/dist/ai-agent-react.cjs.js.map +1 -1
- package/dist/ai-agent-react.es.js +21 -3
- package/dist/ai-agent-react.es.js.map +1 -1
- package/dist/components/ToolRenderers/FormProposalToolRenderer/FormProposalToolRenderer.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -8316,7 +8316,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
8316
8316
|
*/const Gve=Object.freeze(Object.defineProperty({__proto__:null,AArrowDown:Z7,AArrowUp:Q7,ALargeSmall:e_,Accessibility:n_,Activity:a_,AirVent:o_,Airplay:l_,AlarmClock:g_,AlarmClockCheck:u_,AlarmClockMinus:p_,AlarmClockOff:m_,AlarmClockPlus:b_,AlarmSmoke:v_,Album:w_,AlignCenterHorizontal:E_,AlignCenterVertical:S_,AlignEndHorizontal:A_,AlignEndVertical:C_,AlignHorizontalDistributeCenter:I_,AlignHorizontalDistributeEnd:L_,AlignHorizontalDistributeStart:z_,AlignHorizontalJustifyCenter:F_,AlignHorizontalJustifyEnd:B_,AlignHorizontalJustifyStart:U_,AlignHorizontalSpaceAround:j_,AlignHorizontalSpaceBetween:K_,AlignStartHorizontal:G_,AlignStartVertical:Z_,AlignVerticalDistributeCenter:Q_,AlignVerticalDistributeEnd:ew,AlignVerticalDistributeStart:aw,AlignVerticalJustifyCenter:nw,AlignVerticalJustifyEnd:ow,AlignVerticalJustifyStart:lw,AlignVerticalSpaceAround:uw,AlignVerticalSpaceBetween:pw,Ambulance:mw,Ampersand:gw,Ampersands:bw,Amphora:vw,Anchor:ww,Angry:Ew,Annoyed:Sw,Antenna:Aw,Anvil:Cw,Aperture:Iw,AppWindow:zw,AppWindowMac:Lw,Apple:Fw,Archive:jw,ArchiveRestore:Bw,ArchiveX:Uw,Armchair:Gw,ArrowBigDown:Zw,ArrowBigDownDash:Kw,ArrowBigLeft:ex,ArrowBigLeftDash:Qw,ArrowBigRight:ax,ArrowBigRightDash:nx,ArrowBigUp:lx,ArrowBigUpDash:ox,ArrowDown:Lx,ArrowDown01:ux,ArrowDown10:px,ArrowDownAZ:mx,ArrowDownFromLine:gx,ArrowDownLeft:bx,ArrowDownNarrowWide:vx,ArrowDownRight:wx,ArrowDownToDot:Ex,ArrowDownToLine:Sx,ArrowDownUp:Ax,ArrowDownWideNarrow:Cx,ArrowDownZA:Ix,ArrowLeft:Ux,ArrowLeftFromLine:zx,ArrowLeftRight:Fx,ArrowLeftToLine:Bx,ArrowRight:Zx,ArrowRightFromLine:jx,ArrowRightLeft:Gx,ArrowRightToLine:Kx,ArrowUp:jd,ArrowUp01:Qx,ArrowUp10:e9,ArrowUpAZ:n9,ArrowUpDown:a9,ArrowUpFromDot:o9,ArrowUpFromLine:l9,ArrowUpLeft:u9,ArrowUpNarrowWide:p9,ArrowUpRight:m9,ArrowUpToLine:g9,ArrowUpWideNarrow:b9,ArrowUpZA:v9,ArrowsUpFromLine:M9,Asterisk:x9,AtSign:N9,Atom:T9,AudioLines:R9,AudioWaveform:O9,Award:D9,Axe:$9,Axis3d:q9,Baby:P9,Backpack:H9,Badge:ME,BadgeAlert:V9,BadgeCent:W9,BadgeCheck:Y9,BadgeDollarSign:X9,BadgeEuro:J9,BadgeIndianRupee:tE,BadgeInfo:rE,BadgeJapaneseYen:iE,BadgeMinus:sE,BadgePercent:cE,BadgePlus:dE,BadgePoundSterling:hE,BadgeQuestionMark:fE,BadgeRussianRuble:yE,BadgeSwissFranc:kE,BadgeTurkishLira:_E,BadgeX:xE,BaggageClaim:NE,Ban:TE,Banana:RE,Bandage:OE,Banknote:HE,BanknoteArrowDown:DE,BanknoteArrowUp:$E,BanknoteX:PE,Barcode:qE,Barrel:VE,Baseline:WE,Bath:YE,Battery:cM,BatteryCharging:JE,BatteryFull:XE,BatteryLow:tM,BatteryMedium:rM,BatteryPlus:iM,BatteryWarning:sM,Beaker:dM,Bean:fM,BeanOff:hM,Bed:_M,BedDouble:yM,BedSingle:kM,Beef:xM,Beer:NM,BeerOff:MM,Bell:qM,BellDot:TM,BellElectric:RM,BellMinus:OM,BellOff:DM,BellPlus:$M,BellRing:PM,BetweenHorizontalEnd:HM,BetweenHorizontalStart:VM,BetweenVerticalEnd:WM,BetweenVerticalStart:YM,BicepsFlexed:XM,Bike:JM,Binary:tS,Binoculars:rS,Biohazard:iS,Bird:sS,Birdhouse:cS,Bitcoin:dS,Blend:hS,Blinds:fS,Blocks:yS,Bluetooth:MS,BluetoothConnected:kS,BluetoothOff:_S,BluetoothSearching:xS,Bold:NS,Bolt:TS,Bomb:RS,Bone:OS,Book:TN,BookA:DS,BookAlert:$S,BookAudio:PS,BookCheck:qS,BookCopy:HS,BookDashed:WS,BookDown:VS,BookHeadphones:YS,BookHeart:XS,BookImage:JS,BookKey:tN,BookLock:rN,BookMarked:iN,BookMinus:sN,BookOpen:dN,BookOpenCheck:cN,BookOpenText:hN,BookPlus:fN,BookText:yN,BookType:kN,BookUp:xN,BookUp2:_N,BookUser:MN,BookX:NN,Bookmark:PN,BookmarkCheck:RN,BookmarkMinus:ON,BookmarkPlus:DN,BookmarkX:$N,BoomBox:qN,Bot:WN,BotMessageSquare:HN,BotOff:VN,BottleWine:XN,BowArrow:YN,Box:JN,Boxes:tA,Braces:rA,Brackets:iA,Brain:hA,BrainCircuit:sA,BrainCog:cA,BrickWall:yA,BrickWallFire:dA,BrickWallShield:fA,Briefcase:NA,BriefcaseBusiness:kA,BriefcaseConveyorBelt:_A,BriefcaseMedical:xA,BringToFront:MA,Brush:RA,BrushCleaning:TA,Bubbles:OA,Bug:PA,BugOff:DA,BugPlay:$A,Building:HA,Building2:qA,Bus:WA,BusFront:VA,Cable:XA,CableCar:YA,Cake:tT,CakeSlice:JA,Calculator:rT,Calendar:VT,Calendar1:iT,CalendarArrowDown:sT,CalendarArrowUp:cT,CalendarCheck:hT,CalendarCheck2:dT,CalendarClock:yT,CalendarCog:fT,CalendarDays:kT,CalendarFold:_T,CalendarHeart:xT,CalendarMinus:NT,CalendarMinus2:MT,CalendarOff:TT,CalendarPlus:OT,CalendarPlus2:RT,CalendarRange:DT,CalendarSearch:$T,CalendarSync:PT,CalendarX:HT,CalendarX2:qT,Calendars:WT,Camera:XT,CameraOff:YT,Candy:rC,CandyCane:JT,CandyOff:tC,Cannabis:iC,Captions:cC,CaptionsOff:sC,Car:fC,CarFront:dC,CarTaxiFront:hC,Caravan:yC,CardSim:kC,Carrot:_C,CaseLower:xC,CaseSensitive:MC,CaseUpper:NC,CassetteTape:TC,Cast:RC,Castle:OC,Cat:DC,Cctv:$C,ChartArea:PC,ChartBar:YC,ChartBarBig:qC,ChartBarDecreasing:HC,ChartBarIncreasing:VC,ChartBarStacked:WC,ChartCandlestick:XC,ChartColumn:sR,ChartColumnBig:JC,ChartColumnDecreasing:tR,ChartColumnIncreasing:rR,ChartColumnStacked:iR,ChartGantt:cR,ChartLine:dR,ChartNetwork:hR,ChartNoAxesColumn:kR,ChartNoAxesColumnDecreasing:fR,ChartNoAxesColumnIncreasing:yR,ChartNoAxesCombined:xR,ChartNoAxesGantt:_R,ChartPie:MR,ChartScatter:NR,ChartSpline:TR,Check:DR,CheckCheck:RR,CheckLine:OR,ChefHat:$R,Cherry:PR,ChessBishop:qR,ChessKing:HR,ChessKnight:WR,ChessPawn:VR,ChessQueen:YR,ChessRook:XR,ChevronDown:a5,ChevronFirst:eI,ChevronLast:nI,ChevronLeft:oI,ChevronRight:aI,ChevronUp:lI,ChevronsDown:pI,ChevronsDownUp:uI,ChevronsLeft:bI,ChevronsLeftRight:gI,ChevronsLeftRightEllipsis:mI,ChevronsRight:wI,ChevronsRightLeft:vI,ChevronsUp:SI,ChevronsUpDown:EI,Chromium:AI,Church:II,Cigarette:LI,CigaretteOff:CI,Circle:gL,CircleAlert:zI,CircleArrowDown:FI,CircleArrowLeft:BI,CircleArrowOutDownLeft:UI,CircleArrowOutDownRight:jI,CircleArrowOutUpLeft:GI,CircleArrowOutUpRight:KI,CircleArrowRight:ZI,CircleArrowUp:QI,CircleCheck:nO,CircleCheckBig:eO,CircleChevronDown:aO,CircleChevronLeft:oO,CircleChevronRight:lO,CircleChevronUp:uO,CircleDashed:pO,CircleDivide:mO,CircleDollarSign:gO,CircleDot:vO,CircleDotDashed:bO,CircleEllipsis:wO,CircleEqual:EO,CircleFadingArrowUp:SO,CircleFadingPlus:AO,CircleGauge:CO,CircleMinus:IO,CircleOff:LO,CircleParking:FO,CircleParkingOff:zO,CirclePause:BO,CirclePercent:UO,CirclePlay:jO,CirclePlus:GO,CirclePoundSterling:KO,CirclePower:ZO,CircleQuestionMark:QO,CircleSlash:nL,CircleSlash2:eL,CircleSmall:aL,CircleStar:oL,CircleStop:lL,CircleUser:pL,CircleUserRound:uL,CircleX:mL,CircuitBoard:bL,Citrus:vL,Clapperboard:wL,Clipboard:GL,ClipboardCheck:EL,ClipboardClock:SL,ClipboardCopy:AL,ClipboardList:CL,ClipboardMinus:IL,ClipboardPaste:LL,ClipboardPen:FL,ClipboardPenLine:zL,ClipboardPlus:BL,ClipboardType:UL,ClipboardX:jL,Clock:CD,Clock1:KL,Clock10:ZL,Clock11:QL,Clock12:eD,Clock2:nD,Clock3:aD,Clock4:oD,Clock5:lD,Clock6:uD,Clock7:pD,Clock8:mD,Clock9:gD,ClockAlert:bD,ClockArrowDown:vD,ClockArrowUp:wD,ClockCheck:ED,ClockFading:SD,ClockPlus:AD,ClosedCaption:ID,Cloud:mz,CloudAlert:LD,CloudCheck:FD,CloudCog:zD,CloudDownload:BD,CloudDrizzle:UD,CloudFog:jD,CloudHail:GD,CloudLightning:KD,CloudMoon:QD,CloudMoonRain:ZD,CloudOff:ez,CloudRain:az,CloudRainWind:nz,CloudSnow:oz,CloudSun:uz,CloudSunRain:lz,CloudUpload:pz,Cloudy:gz,Clover:bz,Club:vz,Code:Ez,CodeXml:wz,Codepen:Sz,Codesandbox:Az,Coffee:Cz,Cog:Lz,Coins:Iz,Columns2:zz,Columns3:Bz,Columns3Cog:Fz,Columns4:Uz,Combine:jz,Command:Gz,Compass:Kz,Component:Zz,Computer:Qz,ConciergeBell:e$,Cone:n$,Construction:a$,Contact:l$,ContactRound:o$,Container:u$,Contrast:p$,Cookie:m$,CookingPot:g$,Copy:A$,CopyCheck:b$,CopyMinus:v$,CopyPlus:w$,CopySlash:E$,CopyX:S$,Copyleft:C$,Copyright:I$,CornerDownLeft:L$,CornerDownRight:z$,CornerLeftDown:F$,CornerLeftUp:B$,CornerRightDown:U$,CornerRightUp:j$,CornerUpLeft:G$,CornerUpRight:K$,Cpu:Z$,CreativeCommons:Q$,CreditCard:eF,Croissant:nF,Crop:aF,Cross:oF,Crosshair:lF,Crown:uF,Cuboid:pF,CupSoda:mF,Currency:gF,Cylinder:bF,Dam:vF,Database:SF,DatabaseBackup:wF,DatabaseZap:EF,DecimalsArrowLeft:AF,DecimalsArrowRight:CF,Delete:IF,Dessert:LF,Diameter:zF,Diamond:jF,DiamondMinus:FF,DiamondPercent:BF,DiamondPlus:UF,Dice1:GF,Dice2:KF,Dice3:ZF,Dice4:QF,Dice5:eP,Dice6:nP,Dices:aP,Diff:oP,Disc:mP,Disc2:lP,Disc3:uP,DiscAlbum:pP,Divide:gP,Dna:vP,DnaOff:bP,Dock:wP,Dog:EP,DollarSign:SP,Donut:AP,DoorClosed:IP,DoorClosedLocked:CP,DoorOpen:LP,Dot:zP,Download:FP,DraftingCompass:BP,Drama:UP,Dribbble:jP,Drill:GP,Drone:KP,Droplet:QP,DropletOff:ZP,Droplets:eB,Drum:nB,Drumstick:oB,Dumbbell:aB,Ear:uB,EarOff:lB,Earth:mB,EarthLock:pB,Eclipse:bB,Egg:wB,EggFried:gB,EggOff:vB,Ellipsis:SB,EllipsisVertical:EB,Equal:IB,EqualApproximately:AB,EqualNot:CB,Eraser:LB,EthernetPort:zB,Euro:FB,EvCharger:BB,Expand:jB,ExternalLink:UB,Eye:QB,EyeClosed:GB,EyeOff:KB,Facebook:ZB,Factory:eq,Fan:nq,FastForward:aq,Feather:lq,Fence:oq,FerrisWheel:uq,Figma:pq,File:hH,FileArchive:mq,FileAxis3d:gq,FileBadge:bq,FileBox:vq,FileBraces:Eq,FileBracesCorner:wq,FileChartColumn:Aq,FileChartColumnIncreasing:Sq,FileChartLine:Cq,FileChartPie:Iq,FileCheck:zq,FileCheckCorner:Lq,FileClock:Bq,FileCode:Uq,FileCodeCorner:Fq,FileCog:jq,FileDiff:Gq,FileDigit:Kq,FileDown:Zq,FileExclamationPoint:Qq,FileHeadphone:eU,FileHeart:nU,FileImage:aU,FileInput:oU,FileKey:lU,FileLock:uU,FileMinus:mU,FileMinusCorner:pU,FileMusic:gU,FileOutput:bU,FilePen:wU,FilePenLine:vU,FilePlay:EU,FilePlus:AU,FilePlusCorner:SU,FileQuestionMark:CU,FileScan:IU,FileSearch:zU,FileSearchCorner:LU,FileSignal:BU,FileSliders:FU,FileSpreadsheet:jU,FileStack:UU,FileSymlink:GU,FileTerminal:YU,FileText:i5,FileType:JU,FileTypeCorner:XU,FileUp:tH,FileUser:rH,FileVideoCamera:iH,FileVolume:sH,FileX:dH,FileXCorner:cH,Files:fH,Film:yH,FingerprintPattern:kH,FireExtinguisher:_H,Fish:NH,FishOff:xH,FishSymbol:MH,Flag:DH,FlagOff:TH,FlagTriangleLeft:RH,FlagTriangleRight:OH,Flame:qH,FlameKindling:$H,Flashlight:HH,FlashlightOff:PH,FlaskConical:WH,FlaskConicalOff:VH,FlaskRound:YH,FlipHorizontal:JH,FlipHorizontal2:XH,FlipVertical:rj,FlipVertical2:tj,Flower:sj,Flower2:ij,Focus:cj,FoldHorizontal:dj,FoldVertical:hj,Folder:kV,FolderArchive:fj,FolderCheck:yj,FolderClock:kj,FolderClosed:xj,FolderCode:_j,FolderCog:Mj,FolderDot:Nj,FolderDown:Tj,FolderGit:Oj,FolderGit2:Rj,FolderHeart:Dj,FolderInput:$j,FolderKanban:Pj,FolderKey:qj,FolderLock:Hj,FolderMinus:Vj,FolderOpen:Wj,FolderOpenDot:Yj,FolderOutput:Xj,FolderPen:Jj,FolderPlus:tV,FolderRoot:rV,FolderSearch:sV,FolderSearch2:iV,FolderSymlink:cV,FolderSync:dV,FolderTree:hV,FolderUp:fV,FolderX:yV,Folders:_V,Footprints:xV,Forklift:MV,Form:o5,Forward:AV,Frame:CV,Framer:IV,Frown:LV,Fuel:zV,Fullscreen:FV,Funnel:jV,FunnelPlus:UV,FunnelX:BV,GalleryHorizontal:GV,GalleryHorizontalEnd:KV,GalleryThumbnails:ZV,GalleryVertical:eG,GalleryVerticalEnd:QV,Gamepad:oG,Gamepad2:nG,GamepadDirectional:aG,Gauge:lG,Gavel:uG,Gem:pG,GeorgianLari:mG,Ghost:gG,Gift:vG,GitBranch:EG,GitBranchMinus:bG,GitBranchPlus:wG,GitCommitHorizontal:SG,GitCommitVertical:AG,GitCompare:IG,GitCompareArrows:CG,GitFork:LG,GitGraph:zG,GitMerge:FG,GitPullRequest:ZG,GitPullRequestArrow:BG,GitPullRequestClosed:UG,GitPullRequestCreate:jG,GitPullRequestCreateArrow:GG,GitPullRequestDraft:KG,Github:eW,Gitlab:QG,GlassWater:aW,Glasses:nW,Globe:Vd,GlobeLock:oW,Goal:cW,Gpu:dW,GraduationCap:hW,Grape:fW,Grid2x2:xW,Grid2x2Check:yW,Grid2x2Plus:kW,Grid2x2X:_W,Grid3x2:MW,Grid3x3:NW,Grip:OW,GripHorizontal:TW,GripVertical:RW,Group:DW,Guitar:$W,Ham:PW,Hamburger:qW,Hammer:HW,Hand:rK,HandCoins:WW,HandFist:VW,HandGrab:YW,HandHeart:XW,HandHelping:JW,HandMetal:iK,HandPlatter:tK,Handbag:cK,Handshake:sK,HardDrive:fK,HardDriveDownload:dK,HardDriveUpload:hK,HardHat:yK,Hash:kK,HatGlasses:_K,Haze:xK,HdmiPort:MK,Heading:PK,Heading1:NK,Heading2:TK,Heading3:OK,Heading4:RK,Heading5:DK,Heading6:$K,HeadphoneOff:qK,Headphones:HK,Headset:VK,Heart:iY,HeartCrack:WK,HeartHandshake:YK,HeartMinus:XK,HeartOff:JK,HeartPlus:tY,HeartPulse:rY,Heater:sY,Helicopter:cY,Hexagon:dY,Highlighter:hY,History:fY,Hop:kY,HopOff:yY,Hospital:_Y,Hotel:xY,Hourglass:MY,House:DY,HouseHeart:NY,HousePlug:TY,HousePlus:RY,HouseWifi:OY,IceCreamBowl:$Y,IceCreamCone:PY,IdCard:HY,IdCardLanyard:qY,Image:iZ,ImageDown:VY,ImageMinus:WY,ImageOff:YY,ImagePlay:XY,ImagePlus:JY,ImageUp:tZ,ImageUpscale:rZ,Images:sZ,Import:cZ,Inbox:dZ,IndianRupee:hZ,Infinity:fZ,Info:yZ,InspectionPanel:kZ,Instagram:_Z,Italic:xZ,IterationCcw:MZ,IterationCw:NZ,JapaneseYen:TZ,Joystick:RZ,Kanban:OZ,Kayak:DZ,Key:qZ,KeyRound:$Z,KeySquare:PZ,Keyboard:WZ,KeyboardMusic:HZ,KeyboardOff:VZ,Lamp:iX,LampCeiling:YZ,LampDesk:XZ,LampFloor:JZ,LampWallDown:tX,LampWallUp:rX,LandPlot:sX,Landmark:cX,Languages:dX,Laptop:yX,LaptopMinimal:fX,LaptopMinimalCheck:hX,Lasso:_X,LassoSelect:kX,Laugh:xX,Layers:NX,Layers2:MX,LayoutDashboard:TX,LayoutGrid:RX,LayoutList:OX,LayoutPanelLeft:DX,LayoutPanelTop:$X,LayoutTemplate:PX,Leaf:qX,LeafyGreen:HX,Lectern:VX,Library:YX,LibraryBig:WX,LifeBuoy:XX,Ligature:JX,Lightbulb:tQ,LightbulbOff:rQ,LineSquiggle:iQ,Link:uQ,Link2:s5,Link2Off:sQ,Linkedin:pQ,List:eJ,ListCheck:gQ,ListChecks:mQ,ListChevronsDownUp:vQ,ListChevronsUpDown:bQ,ListCollapse:wQ,ListEnd:EQ,ListFilter:AQ,ListFilterPlus:SQ,ListIndentDecrease:CQ,ListIndentIncrease:IQ,ListMinus:zQ,ListMusic:LQ,ListOrdered:FQ,ListPlus:BQ,ListRestart:UQ,ListStart:jQ,ListTodo:GQ,ListTree:KQ,ListVideo:ZQ,ListX:QQ,Loader:oJ,LoaderCircle:nJ,LoaderPinwheel:aJ,Locate:uJ,LocateFixed:lJ,LocateOff:pJ,Lock:vJ,LockKeyhole:bJ,LockKeyholeOpen:mJ,LockOpen:gJ,LogIn:wJ,LogOut:EJ,Logs:SJ,Lollipop:AJ,Luggage:CJ,Magnet:IJ,Mail:ZJ,MailCheck:LJ,MailMinus:zJ,MailOpen:FJ,MailPlus:BJ,MailQuestionMark:UJ,MailSearch:jJ,MailWarning:GJ,MailX:KJ,Mailbox:QJ,Mails:eee,Map:Iee,MapMinus:nee,MapPin:Aee,MapPinCheck:oee,MapPinCheckInside:aee,MapPinHouse:lee,MapPinMinus:pee,MapPinMinusInside:uee,MapPinOff:mee,MapPinPen:gee,MapPinPlus:bee,MapPinPlusInside:vee,MapPinX:Eee,MapPinXInside:wee,MapPinned:Cee,MapPlus:See,Mars:zee,MarsStroke:Lee,Martini:Fee,Maximize:Uee,Maximize2:Bee,Medal:jee,Megaphone:Kee,MegaphoneOff:Gee,Meh:Zee,MemoryStick:Qee,Menu:ete,Merge:nte,MessageCircle:Ete,MessageCircleCode:ate,MessageCircleDashed:ote,MessageCircleHeart:lte,MessageCircleMore:ute,MessageCircleOff:pte,MessageCirclePlus:mte,MessageCircleQuestionMark:gte,MessageCircleReply:bte,MessageCircleWarning:vte,MessageCircleX:wte,MessageSquare:nne,MessageSquareCode:Ste,MessageSquareDashed:Ate,MessageSquareDiff:Cte,MessageSquareDot:Ite,MessageSquareHeart:Lte,MessageSquareLock:zte,MessageSquareMore:Fte,MessageSquareOff:Bte,MessageSquarePlus:Ute,MessageSquareQuote:jte,MessageSquareReply:Gte,MessageSquareShare:Kte,MessageSquareText:Zte,MessageSquareWarning:Qte,MessageSquareX:ene,MessagesSquare:ane,Mic:une,MicOff:one,MicVocal:lne,Microchip:pne,Microscope:mne,Microwave:gne,Milestone:bne,Milk:vne,MilkOff:wne,Minimize:Sne,Minimize2:Ene,Minus:Ane,Monitor:ere,MonitorCheck:Cne,MonitorCloud:Ine,MonitorCog:Lne,MonitorDot:zne,MonitorDown:Fne,MonitorOff:Bne,MonitorPause:jne,MonitorPlay:Une,MonitorSmartphone:Gne,MonitorSpeaker:Kne,MonitorStop:Zne,MonitorUp:Qne,MonitorX:nre,Moon:lre,MoonStar:are,Motorbike:ore,Mountain:pre,MountainSnow:ure,Mouse:Sre,MouseOff:mre,MousePointer:Ere,MousePointer2:bre,MousePointer2Off:gre,MousePointerBan:vre,MousePointerClick:wre,Move:eae,Move3d:Are,MoveDiagonal:Ire,MoveDiagonal2:Cre,MoveDown:Fre,MoveDownLeft:Lre,MoveDownRight:zre,MoveHorizontal:Ure,MoveLeft:Bre,MoveRight:jre,MoveUp:Zre,MoveUpLeft:Gre,MoveUpRight:Kre,MoveVertical:Qre,Music:oae,Music2:nae,Music3:aae,Music4:lae,Navigation:gae,Navigation2:uae,Navigation2Off:pae,NavigationOff:mae,Network:bae,Newspaper:vae,Nfc:wae,NonBinary:Eae,Notebook:Iae,NotebookPen:Sae,NotebookTabs:Aae,NotebookText:Cae,NotepadText:zae,NotepadTextDashed:Lae,Nut:Bae,NutOff:Fae,Octagon:Zae,OctagonAlert:Uae,OctagonMinus:jae,OctagonPause:Gae,OctagonX:Kae,Omega:eie,Option:Qae,Orbit:nie,Origami:aie,Package:bie,Package2:oie,PackageCheck:lie,PackageMinus:uie,PackageOpen:pie,PackagePlus:mie,PackageSearch:gie,PackageX:vie,PaintBucket:wie,PaintRoller:Eie,Paintbrush:Aie,PaintbrushVertical:Sie,Palette:Cie,Panda:Iie,PanelBottom:Bie,PanelBottomClose:Lie,PanelBottomDashed:zie,PanelBottomOpen:Fie,PanelLeft:Zie,PanelLeftClose:Gie,PanelLeftDashed:Uie,PanelLeftOpen:jie,PanelLeftRightDashed:Kie,PanelRight:aoe,PanelRightClose:eoe,PanelRightDashed:Qie,PanelRightOpen:noe,PanelTop:moe,PanelTopBottomDashed:ooe,PanelTopClose:loe,PanelTopDashed:uoe,PanelTopOpen:poe,PanelsLeftBottom:goe,PanelsRightBottom:boe,PanelsTopLeft:voe,Paperclip:lo,Parentheses:xoe,ParkingMeter:Moe,PartyPopper:Noe,Pause:Toe,PawPrint:Roe,PcCase:Ooe,Pen:qoe,PenLine:Doe,PenOff:$oe,PenTool:Poe,Pencil:Yoe,PencilLine:Hoe,PencilOff:Voe,PencilRuler:Woe,Pentagon:Xoe,Percent:Joe,PersonStanding:tse,PhilippinePeso:rse,Phone:yse,PhoneCall:ise,PhoneForwarded:sse,PhoneIncoming:cse,PhoneMissed:dse,PhoneOff:hse,PhoneOutgoing:fse,Pi:kse,Piano:_se,Pickaxe:xse,PictureInPicture:Nse,PictureInPicture2:Mse,PiggyBank:Tse,Pilcrow:Dse,PilcrowLeft:Rse,PilcrowRight:Ose,Pill:Pse,PillBottle:$se,Pin:Vse,PinOff:qse,Pipette:Hse,Pizza:Wse,Plane:Jse,PlaneLanding:Yse,PlaneTakeoff:Xse,Play:tle,Plug:sle,Plug2:ile,PlugZap:rle,Plus:cle,Pocket:hle,PocketKnife:dle,Podcast:fle,Pointer:kle,PointerOff:yle,Popcorn:_le,Popsicle:xle,PoundSterling:Mle,Power:Tle,PowerOff:Nle,Presentation:Rle,Printer:Dle,PrinterCheck:Ole,Projector:$le,Proportions:Ple,Puzzle:qle,Pyramid:Hle,QrCode:Vle,Quote:Wle,Rabbit:Yle,Radar:Xle,Radiation:Jle,Radical:tce,Radio:sce,RadioReceiver:rce,RadioTower:ice,Radius:cce,RailSymbol:dce,Rainbow:hce,Rat:fce,Ratio:yce,Receipt:$ce,ReceiptCent:kce,ReceiptEuro:_ce,ReceiptIndianRupee:xce,ReceiptJapaneseYen:Mce,ReceiptPoundSterling:Nce,ReceiptRussianRuble:Tce,ReceiptSwissFranc:Rce,ReceiptText:Oce,ReceiptTurkishLira:Dce,RectangleCircle:Pce,RectangleEllipsis:qce,RectangleGoggles:Hce,RectangleHorizontal:Vce,RectangleVertical:Wce,Recycle:Yce,Redo:t1e,Redo2:Xce,RedoDot:Jce,RefreshCcw:i1e,RefreshCcwDot:r1e,RefreshCw:c1e,RefreshCwOff:s1e,Refrigerator:d1e,Regex:h1e,RemoveFormatting:f1e,Repeat:_1e,Repeat1:y1e,Repeat2:k1e,Replace:M1e,ReplaceAll:x1e,Reply:R1e,ReplyAll:N1e,Rewind:T1e,Ribbon:O1e,Rocket:D1e,RockingChair:$1e,RollerCoaster:P1e,Rose:q1e,Rotate3d:H1e,RotateCcw:Y1e,RotateCcwKey:V1e,RotateCcwSquare:W1e,RotateCw:J1e,RotateCwSquare:X1e,Route:s0e,RouteOff:t0e,Router:r0e,Rows2:i0e,Rows3:c0e,Rows4:d0e,Rss:h0e,Ruler:y0e,RulerDimensionLine:f0e,RussianRuble:k0e,Sailboat:_0e,Salad:x0e,Sandwich:M0e,Satellite:T0e,SatelliteDish:N0e,SaudiRiyal:R0e,Save:$0e,SaveAll:O0e,SaveOff:D0e,Scale:H0e,Scale3d:P0e,Scaling:q0e,Scan:oue,ScanBarcode:V0e,ScanEye:W0e,ScanFace:Y0e,ScanHeart:X0e,ScanLine:J0e,ScanQrCode:tue,ScanSearch:rue,ScanText:Gd,School:lue,Scissors:pue,ScissorsLineDashed:uue,ScreenShare:gue,ScreenShareOff:mue,Scroll:vue,ScrollText:bue,Search:Cue,SearchCheck:wue,SearchCode:Eue,SearchSlash:Sue,SearchX:Aue,Section:Iue,Send:Fue,SendHorizontal:Lue,SendToBack:zue,SeparatorHorizontal:Bue,SeparatorVertical:Uue,Server:Zue,ServerCog:jue,ServerCrash:Gue,ServerOff:Kue,Settings:ede,Settings2:Que,Shapes:nde,Share:ode,Share2:ade,Sheet:lde,Shell:ude,Shield:Lde,ShieldAlert:pde,ShieldBan:mde,ShieldCheck:gde,ShieldEllipsis:bde,ShieldHalf:vde,ShieldMinus:wde,ShieldOff:Ede,ShieldPlus:Sde,ShieldQuestionMark:Ade,ShieldUser:Ide,ShieldX:Cde,Ship:Fde,ShipWheel:zde,Shirt:Bde,ShoppingBag:Ude,ShoppingBasket:jde,ShoppingCart:Kde,Shovel:Gde,ShowerHead:Zde,Shredder:Qde,Shrimp:epe,Shrink:npe,Shrub:ape,Shuffle:ope,Sigma:lpe,Signal:gpe,SignalHigh:upe,SignalLow:ppe,SignalMedium:mpe,SignalZero:vpe,Signature:bpe,Signpost:Spe,SignpostBig:wpe,Siren:Epe,SkipBack:Ape,SkipForward:Cpe,Skull:Ipe,Slack:Lpe,Slash:zpe,Slice:Fpe,SlidersHorizontal:Bpe,SlidersVertical:Upe,Smartphone:Kpe,SmartphoneCharging:jpe,SmartphoneNfc:Gpe,Smile:Qpe,SmilePlus:Zpe,Snail:ehe,Snowflake:nhe,SoapDispenserDroplet:ahe,Sofa:ohe,SolarPanel:lhe,Soup:uhe,Space:phe,Spade:mhe,Sparkle:ghe,Sparkles:bhe,Speaker:vhe,Speech:whe,SpellCheck:She,SpellCheck2:Ehe,Spline:Che,SplinePointer:Ahe,Split:Ihe,Spool:Lhe,Spotlight:zhe,SprayCan:Fhe,Sprout:Bhe,Square:l5,SquareActivity:Uhe,SquareArrowDown:Khe,SquareArrowDownLeft:jhe,SquareArrowDownRight:Ghe,SquareArrowLeft:Zhe,SquareArrowOutDownLeft:Qhe,SquareArrowOutDownRight:e2e,SquareArrowOutUpLeft:n2e,SquareArrowOutUpRight:a2e,SquareArrowRight:o2e,SquareArrowUp:p2e,SquareArrowUpLeft:l2e,SquareArrowUpRight:u2e,SquareAsterisk:m2e,SquareBottomDashedScissors:b2e,SquareChartGantt:g2e,SquareCheck:v2e,SquareCheckBig:w2e,SquareChevronDown:S2e,SquareChevronLeft:E2e,SquareChevronRight:A2e,SquareChevronUp:C2e,SquareCode:I2e,SquareDashed:j2e,SquareDashedBottom:z2e,SquareDashedBottomCode:L2e,SquareDashedKanban:F2e,SquareDashedMousePointer:B2e,SquareDashedTopSolid:U2e,SquareDivide:G2e,SquareDot:K2e,SquareEqual:Z2e,SquareFunction:Q2e,SquareKanban:eme,SquareLibrary:nme,SquareM:ame,SquareMenu:ome,SquareMinus:lme,SquareMousePointer:ume,SquareParking:mme,SquareParkingOff:pme,SquarePause:gme,SquarePen:bme,SquarePercent:vme,SquarePi:wme,SquarePilcrow:Eme,SquarePlay:Cme,SquarePlus:Sme,SquarePower:Ame,SquareRadical:Ime,SquareRoundCorner:Lme,SquareScissors:zme,SquareSigma:Fme,SquareSlash:Bme,SquareSplitHorizontal:Ume,SquareSplitVertical:jme,SquareSquare:Kme,SquareStack:Gme,SquareStar:Qme,SquareStop:Zme,SquareTerminal:efe,SquareUser:afe,SquareUserRound:nfe,SquareX:ofe,SquaresExclude:cfe,SquaresIntersect:dfe,SquaresSubtract:hfe,SquaresUnite:ffe,Squircle:kfe,SquircleDashed:yfe,Squirrel:_fe,Stamp:xfe,Star:Tfe,StarHalf:Mfe,StarOff:Nfe,StepBack:Rfe,StepForward:Ofe,Stethoscope:Dfe,Sticker:$fe,StickyNote:Pfe,Store:qfe,StretchHorizontal:Hfe,StretchVertical:Vfe,Strikethrough:Wfe,Subscript:Yfe,Sun:ige,SunDim:Xfe,SunMedium:Jfe,SunMoon:tge,SunSnow:rge,Sunrise:sge,Sunset:cge,Superscript:dge,SwatchBook:hge,SwissFranc:fge,SwitchCamera:yge,Sword:kge,Swords:_ge,Syringe:xge,Table:Pge,Table2:Nge,TableCellsMerge:Mge,TableCellsSplit:Tge,TableColumnsSplit:Rge,TableOfContents:Oge,TableProperties:Dge,TableRowsSplit:$ge,Tablet:Hge,TabletSmartphone:qge,Tablets:Vge,Tag:Wge,Tags:Yge,Tally1:Xge,Tally2:Jge,Tally3:tye,Tally4:rye,Tally5:iye,Tangent:sye,Target:cye,Telescope:dye,Tent:fye,TentTree:hye,Terminal:kye,TestTube:_ye,TestTubeDiagonal:yye,TestTubes:xye,TextAlignCenter:Mye,TextAlignEnd:Nye,TextAlignJustify:Tye,TextAlignStart:Rye,TextCursor:Dye,TextCursorInput:Oye,TextInitial:$ye,TextQuote:Pye,TextSearch:qye,TextSelect:Hye,TextWrap:Wye,Theater:Vye,Thermometer:Jye,ThermometerSnowflake:Yye,ThermometerSun:Xye,ThumbsDown:t4e,ThumbsUp:r4e,Ticket:y4e,TicketCheck:s4e,TicketMinus:i4e,TicketPercent:c4e,TicketPlus:d4e,TicketSlash:h4e,TicketX:f4e,Tickets:k4e,TicketsPlane:_4e,Timer:N4e,TimerOff:x4e,TimerReset:M4e,ToggleLeft:T4e,ToggleRight:R4e,Toilet:O4e,ToolCase:D4e,Tornado:$4e,Torus:P4e,Touchpad:H4e,TouchpadOff:q4e,TowerControl:V4e,ToyBrick:W4e,Tractor:Y4e,TrafficCone:J4e,TrainFront:tbe,TrainFrontTunnel:X4e,TrainTrack:rbe,TramFront:sbe,Transgender:ibe,Trash:ube,Trash2:c5,TreeDeciduous:pbe,TreePalm:gbe,TreePine:mbe,Trees:bbe,Trello:wbe,TrendingDown:vbe,TrendingUp:Sbe,TrendingUpDown:Ebe,Triangle:Lbe,TriangleAlert:Abe,TriangleDashed:Cbe,TriangleRight:Ibe,Trophy:zbe,Truck:Bbe,TruckElectric:Fbe,TurkishLira:Ube,Turntable:Gbe,Turtle:jbe,Tv:Qbe,TvMinimal:Zbe,TvMinimalPlay:Kbe,Twitch:eke,Twitter:nke,Type:oke,TypeOutline:ake,Umbrella:uke,UmbrellaOff:lke,Underline:pke,Undo:gke,Undo2:bke,UndoDot:mke,UnfoldHorizontal:vke,UnfoldVertical:wke,Ungroup:Eke,University:Ake,Unlink:Cke,Unlink2:Ske,Unplug:Ike,Upload:Lke,Usb:zke,User:b5e,UserCheck:Fke,UserCog:Bke,UserLock:Uke,UserMinus:jke,UserPen:Gke,UserPlus:Kke,UserRound:u5e,UserRoundCheck:Zke,UserRoundCog:Qke,UserRoundMinus:e5e,UserRoundPen:n5e,UserRoundPlus:a5e,UserRoundSearch:l5e,UserRoundX:o5e,UserSearch:p5e,UserStar:m5e,UserX:g5e,Users:E5e,UsersRound:v5e,Utensils:S5e,UtensilsCrossed:w5e,UtilityPole:A5e,Variable:C5e,Vault:I5e,VectorSquare:L5e,Vegan:z5e,VenetianMask:F5e,Venus:U5e,VenusAndMars:B5e,Vibrate:G5e,VibrateOff:j5e,Video:Z5e,VideoOff:K5e,Videotape:Q5e,View:e3e,Voicemail:n3e,Volleyball:a3e,Volume:m3e,Volume1:o3e,Volume2:l3e,VolumeOff:u3e,VolumeX:p3e,Vote:g3e,Wallet:w3e,WalletCards:b3e,WalletMinimal:v3e,Wallpaper:E3e,Wand:S3e,WandSparkles:A3e,Warehouse:C3e,WashingMachine:I3e,Watch:L3e,Waves:U3e,WavesArrowDown:z3e,WavesArrowUp:F3e,WavesLadder:B3e,Waypoints:j3e,Webcam:G3e,Webhook:Z3e,WebhookOff:K3e,Weight:Q3e,Wheat:nve,WheatOff:eve,WholeWord:ave,Wifi:wve,WifiCog:ove,WifiHigh:lve,WifiLow:uve,WifiOff:pve,WifiPen:mve,WifiSync:gve,WifiZero:bve,Wind:Eve,WindArrowDown:vve,Wine:Sve,WineOff:Ave,Workflow:Cve,Worm:Ive,Wrench:Lve,X:u5,Youtube:zve,Zap:Hve,ZapOff:Pve,ZoomIn:qve,ZoomOut:Vve},Symbol.toStringTag,{value:"Module"}));function co(){return typeof window<"u"}function Jr(e){return Wd(e)?(e.nodeName||"").toLowerCase():"#document"}function jt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Cn(e){var t;return(t=(Wd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Wd(e){return co()?e instanceof Node||e instanceof jt(e).Node:!1}function ot(e){return co()?e instanceof Element||e instanceof jt(e).Element:!1}function Rt(e){return co()?e instanceof HTMLElement||e instanceof jt(e).HTMLElement:!1}function rd(e){return!co()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof jt(e).ShadowRoot}const Wve=new Set(["inline","contents"]);function Fa(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=dn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Wve.has(a)}const Kve=new Set(["table","td","th"]);function Yve(e){return Kve.has(Jr(e))}const Zve=[":popover-open",":modal"];function uo(e){return Zve.some(t=>{try{return e.matches(t)}catch{return!1}})}const Xve=["transform","translate","scale","rotate","perspective"],Qve=["transform","translate","scale","rotate","perspective","filter"],Jve=["paint","layout","strict","content"];function Kd(e){const t=po(),n=ot(e)?dn(e):e;return Xve.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Qve.some(r=>(n.willChange||"").includes(r))||Jve.some(r=>(n.contain||"").includes(r))}function e6e(e){let t=jn(e);for(;Rt(t)&&!qn(t);){if(Kd(t))return t;if(uo(t))return null;t=jn(t)}return null}function po(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const t6e=new Set(["html","body","#document"]);function qn(e){return t6e.has(Jr(e))}function dn(e){return jt(e).getComputedStyle(e)}function ho(e){return ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jn(e){if(Jr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||rd(e)&&e.host||Cn(e);return rd(t)?t.host:t}function d5(e){const t=jn(e);return qn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Rt(t)&&Fa(t)?t:d5(t)}function rr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=d5(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=jt(a);if(i){const s=ad(o);return t.concat(o,o.visualViewport||[],Fa(a)?a:[],s&&n?rr(s):[])}return t.concat(a,rr(a,[],n))}function ad(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Bi=Math.min,vr=Math.max,qi=Math.round,Vr=Math.floor,Nn=e=>({x:e,y:e}),n6e={left:"right",right:"left",bottom:"top",top:"bottom"},r6e={start:"end",end:"start"};function Oh(e,t,n){return vr(e,Bi(t,n))}function mo(e,t){return typeof e=="function"?e(t):e}function wr(e){return e.split("-")[0]}function fo(e){return e.split("-")[1]}function p5(e){return e==="x"?"y":"x"}function h5(e){return e==="y"?"height":"width"}const a6e=new Set(["top","bottom"]);function er(e){return a6e.has(wr(e))?"y":"x"}function m5(e){return p5(er(e))}function i6e(e,t,n){n===void 0&&(n=!1);const r=fo(e),a=m5(e),i=h5(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Ui(o)),[o,Ui(o)]}function o6e(e){const t=Ui(e);return[id(e),t,id(t)]}function id(e){return e.replace(/start|end/g,t=>r6e[t])}const Lh=["left","right"],Dh=["right","left"],s6e=["top","bottom"],l6e=["bottom","top"];function c6e(e,t,n){switch(e){case"top":case"bottom":return n?t?Dh:Lh:t?Lh:Dh;case"left":case"right":return t?s6e:l6e;default:return[]}}function u6e(e,t,n,r){const a=fo(e);let i=c6e(wr(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(id)))),i}function Ui(e){return e.replace(/left|right|bottom|top/g,t=>n6e[t])}function d6e(e){return{top:0,right:0,bottom:0,left:0,...e}}function p6e(e){return typeof e!="number"?d6e(e):{top:e,right:e,bottom:e,left:e}}function Hi(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}/*!
|
|
8317
8317
|
* tabbable 6.3.0
|
|
8318
8318
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
8319
|
-
*/var h6e=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],od=h6e.join(","),f5=typeof Element>"u",Ea=f5?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ji=!f5&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Ma=function(t,n){var r;n===void 0&&(n=!0);var a=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=a===""||a==="true",o=i||n&&t&&Ma(t.parentNode);return o},m6e=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},f6e=function(t,n,r){if(Ma(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(od));return n&&Ea.call(t,od)&&a.unshift(t),a=a.filter(r),a},sd=function(t,n,r){for(var a=[],i=Array.from(t);i.length;){var o=i.shift();if(!Ma(o,!1))if(o.tagName==="SLOT"){var s=o.assignedElements(),l=s.length?s:o.children,u=sd(l,!0,r);r.flatten?a.push.apply(a,u):a.push({scopeParent:o,candidates:u})}else{var d=Ea.call(o,od);d&&r.filter(o)&&(n||!t.includes(o))&&a.push(o);var p=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),m=!Ma(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(p&&m){var h=sd(p===!0?o.children:p.children,!0,r);r.flatten?a.push.apply(a,h):a.push({scopeParent:o,candidates:h})}else i.unshift.apply(i,o.children)}}return a},g5=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},y5=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||m6e(t))&&!g5(t)?0:t.tabIndex},g6e=function(t,n){var r=y5(t);return r<0&&n&&!g5(t)?0:r},y6e=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},b5=function(t){return t.tagName==="INPUT"},b6e=function(t){return b5(t)&&t.type==="hidden"},k6e=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},v6e=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},_6e=function(t){if(!t.name)return!0;var n=t.form||ji(t),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=r(window.CSS.escape(t.name));else try{a=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var i=v6e(a,t.form);return!i||i===t},w6e=function(t){return b5(t)&&t.type==="radio"},x6e=function(t){return w6e(t)&&!_6e(t)},E6e=function(t){var n,r=t&&ji(t),a=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var o,s,l;for(i=!!((o=a)!==null&&o!==void 0&&(s=o.ownerDocument)!==null&&s!==void 0&&s.contains(a)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&a;){var u,d,p;r=ji(a),a=(u=r)===null||u===void 0?void 0:u.host,i=!!((d=a)!==null&&d!==void 0&&(p=d.ownerDocument)!==null&&p!==void 0&&p.contains(a))}}return i},zh=function(t){var n=t.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},M6e=function(t,n){var r=n.displayCheck,a=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var i=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(t).visibility==="hidden")return!0;var o=Ea.call(t,"details>summary:first-of-type"),s=o?t.parentElement:t;if(Ea.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof a=="function"){for(var l=t;t;){var u=t.parentElement,d=ji(t);if(u&&!u.shadowRoot&&a(u)===!0)return zh(t);t.assignedSlot?t=t.assignedSlot:!u&&d!==t.ownerDocument?t=d.host:t=u}t=l}if(E6e(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return zh(t);return!1},S6e=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var a=n.children.item(r);if(a.tagName==="LEGEND")return Ea.call(n,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}n=n.parentElement}return!1},N6e=function(t,n){return!(n.disabled||Ma(n)||b6e(n)||M6e(n,t)||k6e(n)||S6e(n))},$h=function(t,n){return!(x6e(n)||y5(n)<0||!N6e(t,n))},A6e=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},k5=function(t){var n=[],r=[];return t.forEach(function(a,i){var o=!!a.scopeParent,s=o?a.scopeParent:a,l=g6e(s,o),u=o?k5(a.candidates):s;l===0?o?n.push.apply(n,u):n.push(s):r.push({documentOrder:i,tabIndex:l,item:a,isScope:o,content:u})}),r.sort(y6e).reduce(function(a,i){return i.isScope?a.push.apply(a,i.content):a.push(i.content),a},[]).concat(n)},v5=function(t,n){n=n||{};var r;return n.getShadowRoot?r=sd([t],n.includeContainer,{filter:$h.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:A6e}):r=f6e(t,n.includeContainer,$h.bind(null,n)),k5(r)};function _5(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function w5(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function x5(){return/apple/i.test(navigator.vendor)}function ld(){const e=/android/i;return e.test(_5())||e.test(w5())}function T6e(){return _5().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function E5(){return w5().includes("jsdom/")}const Fh="data-floating-ui-focusable",C6e="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ko="ArrowLeft",Yo="ArrowRight",R6e="ArrowUp",I6e="ArrowDown";function Sa(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function xr(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&rd(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Pr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Zo(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function O6e(e){return e.matches("html,body")}function yn(e){return e?.ownerDocument||document}function Yd(e){return Rt(e)&&e.matches(C6e)}function L6e(e){return e?e.getAttribute("role")==="combobox"&&Yd(e):!1}function D6e(e){if(!e||E5())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function M5(e){return e?e.hasAttribute(Fh)?e:e.querySelector("["+Fh+"]")||e:null}function ba(e,t,n){return n===void 0&&(n=!0),e.filter(a=>{var i;return a.parentId===t&&(!n||((i=a.context)==null?void 0:i.open))}).flatMap(a=>[a,...ba(e,a.id,n)])}function z6e(e,t){let n,r=-1;function a(i,o){o>r&&(n=i,r=o),ba(e,i).forEach(l=>{a(l.id,o+1)})}return a(t,0),e.find(i=>i.id===n)}function rn(e){e.preventDefault(),e.stopPropagation()}function $6e(e){return"nativeEvent"in e}function F6e(e){return e.mozInputSource===0&&e.isTrusted?!0:ld()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function P6e(e){return E5()?!1:!ld()&&e.width===0&&e.height===0||ld()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Na(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var B6e=typeof document<"u",q6e=function(){},Nt=B6e?ee.useLayoutEffect:q6e;const U6e={...ne};function Pn(e){const t=ne.useRef(e);return Nt(()=>{t.current=e}),t}const H6e=U6e.useInsertionEffect,j6e=H6e||(e=>e());function Xt(e){const t=ne.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return j6e(()=>{t.current=e}),ne.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t.current==null?void 0:t.current(...r)},[])}function Ja(e,t,n){return Math.floor(e/t)!==n}function ka(e,t){return t<0||t>=e.current.length}function Xo(e,t){return At(e,{disabledIndices:t})}function Ph(e,t){return At(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function At(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:a,amount:i=1}=t===void 0?{}:t,o=n;do o+=r?-i:i;while(o>=0&&o<=e.current.length-1&&Ni(e,o,a));return o}function V6e(e,t){let{event:n,orientation:r,loop:a,rtl:i,cols:o,disabledIndices:s,minIndex:l,maxIndex:u,prevIndex:d,stopEvent:p=!1}=t,m=d;if(n.key===R6e){if(p&&rn(n),d===-1)m=u;else if(m=At(e,{startingIndex:m,amount:o,decrement:!0,disabledIndices:s}),a&&(d-o<l||m<0)){const h=d%o,g=u%o,y=u-(g-h);g===h?m=u:m=g>h?y:y-o}ka(e,m)&&(m=d)}if(n.key===I6e&&(p&&rn(n),d===-1?m=l:(m=At(e,{startingIndex:d,amount:o,disabledIndices:s}),a&&d+o>u&&(m=At(e,{startingIndex:d%o-o,amount:o,disabledIndices:s}))),ka(e,m)&&(m=d)),r==="both"){const h=Vr(d/o);n.key===(i?Ko:Yo)&&(p&&rn(n),d%o!==o-1?(m=At(e,{startingIndex:d,disabledIndices:s}),a&&Ja(m,o,h)&&(m=At(e,{startingIndex:d-d%o-1,disabledIndices:s}))):a&&(m=At(e,{startingIndex:d-d%o-1,disabledIndices:s})),Ja(m,o,h)&&(m=d)),n.key===(i?Yo:Ko)&&(p&&rn(n),d%o!==0?(m=At(e,{startingIndex:d,decrement:!0,disabledIndices:s}),a&&Ja(m,o,h)&&(m=At(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:s}))):a&&(m=At(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:s})),Ja(m,o,h)&&(m=d));const g=Vr(u/o)===h;ka(e,m)&&(a&&g?m=n.key===(i?Yo:Ko)?u:At(e,{startingIndex:d-d%o-1,disabledIndices:s}):m=d)}return m}function G6e(e,t,n){const r=[];let a=0;return e.forEach((i,o)=>{let{width:s,height:l}=i;if(s>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+o+" is greater than grid columns");let u=!1;for(n&&(a=0);!u;){const d=[];for(let p=0;p<s;p++)for(let m=0;m<l;m++)d.push(a+p+m*t);a%t+s<=t&&d.every(p=>r[p]==null)?(d.forEach(p=>{r[p]=o}),u=!0):a++}}),[...r]}function W6e(e,t,n,r,a){if(e===-1)return-1;const i=n.indexOf(e),o=t[e];switch(a){case"tl":return i;case"tr":return o?i+o.width-1:i;case"bl":return o?i+(o.height-1)*r:i;case"br":return n.lastIndexOf(e)}}function K6e(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Ni(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const r=e.current[t];return r==null||r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true"}const S5=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function N5(e,t){const n=v5(e,S5()),r=n.length;if(r===0)return;const a=Sa(yn(e)),i=n.indexOf(a),o=i===-1?t===1?0:r-1:i+t;return n[o]}function Y6e(e){return N5(yn(e).body,1)||e}function Z6e(e){return N5(yn(e).body,-1)||e}function Qo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!xr(n,r)}function X6e(e){v5(e,S5()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Bh(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function qh(e,t,n){let{reference:r,floating:a}=e;const i=er(t),o=m5(t),s=h5(o),l=wr(t),u=i==="y",d=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,m=r[s]/2-a[s]/2;let h;switch(l){case"top":h={x:d,y:r.y-a.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:p};break;case"left":h={x:r.x-a.width,y:p};break;default:h={x:r.x,y:r.y}}switch(fo(t)){case"start":h[o]-=m*(n&&u?-1:1);break;case"end":h[o]+=m*(n&&u?-1:1);break}return h}const Q6e=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:o}=n,s=i.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:p}=qh(u,r,l),m=r,h={},g=0;for(let y=0;y<s.length;y++){const{name:v,fn:_}=s[y],{x:k,y:w,data:M,reset:S}=await _({x:d,y:p,initialPlacement:r,placement:m,strategy:a,middlewareData:h,rects:u,platform:o,elements:{reference:e,floating:t}});d=k??d,p=w??p,h={...h,[v]:{...h[v],...M}},S&&g<=50&&(g++,typeof S=="object"&&(S.placement&&(m=S.placement),S.rects&&(u=S.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):S.rects),{x:d,y:p}=qh(u,m,l)),y=-1)}return{x:d,y:p,placement:m,strategy:a,middlewareData:h}};async function A5(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:o,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:m=!1,padding:h=0}=mo(t,e),g=p6e(h),v=s[m?p==="floating"?"reference":"floating":p],_=Hi(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:d,strategy:l})),k=p==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),M=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},S=Hi(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:k,offsetParent:w,strategy:l}):k);return{top:(_.top-S.top+g.top)/M.y,bottom:(S.bottom-_.bottom+g.bottom)/M.y,left:(_.left-S.left+g.left)/M.x,right:(S.right-_.right+g.right)/M.x}}const J6e=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:o,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...v}=mo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const _=wr(a),k=er(s),w=wr(s)===s,M=await(l.isRTL==null?void 0:l.isRTL(u.floating)),S=m||(w||!y?[Ui(s)]:o6e(s)),E=g!=="none";!m&&E&&S.push(...u6e(s,y,g,M));const F=[s,...S],P=await A5(t,v),R=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&R.push(P[_]),p){const V=i6e(a,o,M);R.push(P[V[0]],P[V[1]])}if(D=[...D,{placement:a,overflows:R}],!R.every(V=>V<=0)){var W,K;const V=(((W=i.flip)==null?void 0:W.index)||0)+1,I=F[V];if(I&&(!(p==="alignment"?k!==er(I):!1)||D.every(C=>er(C.placement)===k?C.overflows[0]>0:!0)))return{data:{index:V,overflows:D},reset:{placement:I}};let q=(K=D.filter(G=>G.overflows[0]<=0).sort((G,C)=>G.overflows[1]-C.overflows[1])[0])==null?void 0:K.placement;if(!q)switch(h){case"bestFit":{var J;const G=(J=D.filter(C=>{if(E){const Y=er(C.placement);return Y===k||Y==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(Y=>Y>0).reduce((Y,N)=>Y+N,0)]).sort((C,Y)=>C[1]-Y[1])[0])==null?void 0:J[0];G&&(q=G);break}case"initialPlacement":q=s;break}if(a!==q)return{reset:{placement:q}}}return{}}}},e8e=new Set(["left","top"]);async function t8e(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=wr(n),s=fo(n),l=er(n)==="y",u=e8e.has(o)?-1:1,d=i&&l?-1:1,p=mo(t,e);let{mainAxis:m,crossAxis:h,alignmentAxis:g}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return s&&typeof g=="number"&&(h=s==="end"?g*-1:g),l?{x:h*d,y:m*u}:{x:m*u,y:h*d}}const n8e=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:o,middlewareData:s}=t,l=await t8e(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:a+l.x,y:i+l.y,data:{...l,placement:o}}}}},r8e=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:s={fn:v=>{let{x:_,y:k}=v;return{x:_,y:k}}},...l}=mo(e,t),u={x:n,y:r},d=await A5(t,l),p=er(wr(a)),m=p5(p);let h=u[m],g=u[p];if(i){const v=m==="y"?"top":"left",_=m==="y"?"bottom":"right",k=h+d[v],w=h-d[_];h=Oh(k,h,w)}if(o){const v=p==="y"?"top":"left",_=p==="y"?"bottom":"right",k=g+d[v],w=g-d[_];g=Oh(k,g,w)}const y=s.fn({...t,[m]:h,[p]:g});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[m]:i,[p]:o}}}}}};function T5(e){const t=dn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Rt(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,s=qi(n)!==i||qi(r)!==o;return s&&(n=i,r=o),{width:n,height:r,$:s}}function Zd(e){return ot(e)?e:e.contextElement}function Wr(e){const t=Zd(e);if(!Rt(t))return Nn(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=T5(t);let o=(i?qi(n.width):n.width)/r,s=(i?qi(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const a8e=Nn(0);function C5(e){const t=jt(e);return!po()||!t.visualViewport?a8e:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function i8e(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==jt(e)?!1:t}function Er(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=Zd(e);let o=Nn(1);t&&(r?ot(r)&&(o=Wr(r)):o=Wr(e));const s=i8e(i,n,r)?C5(i):Nn(0);let l=(a.left+s.x)/o.x,u=(a.top+s.y)/o.y,d=a.width/o.x,p=a.height/o.y;if(i){const m=jt(i),h=r&&ot(r)?jt(r):r;let g=m,y=ad(g);for(;y&&r&&h!==g;){const v=Wr(y),_=y.getBoundingClientRect(),k=dn(y),w=_.left+(y.clientLeft+parseFloat(k.paddingLeft))*v.x,M=_.top+(y.clientTop+parseFloat(k.paddingTop))*v.y;l*=v.x,u*=v.y,d*=v.x,p*=v.y,l+=w,u+=M,g=jt(y),y=ad(g)}}return Hi({width:d,height:p,x:l,y:u})}function go(e,t){const n=ho(e).scrollLeft;return t?t.left+n:Er(Cn(e)).left+n}function R5(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-go(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function o8e(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=Cn(r),s=t?uo(t.floating):!1;if(r===o||s&&i)return n;let l={scrollLeft:0,scrollTop:0},u=Nn(1);const d=Nn(0),p=Rt(r);if((p||!p&&!i)&&((Jr(r)!=="body"||Fa(o))&&(l=ho(r)),Rt(r))){const h=Er(r);u=Wr(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const m=o&&!p&&!i?R5(o,l):Nn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+m.x,y:n.y*u.y-l.scrollTop*u.y+d.y+m.y}}function s8e(e){return Array.from(e.getClientRects())}function l8e(e){const t=Cn(e),n=ho(e),r=e.ownerDocument.body,a=vr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=vr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+go(e);const s=-n.scrollTop;return dn(r).direction==="rtl"&&(o+=vr(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:s}}const Uh=25;function c8e(e,t){const n=jt(e),r=Cn(e),a=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,s=0,l=0;if(a){i=a.width,o=a.height;const d=po();(!d||d&&t==="fixed")&&(s=a.offsetLeft,l=a.offsetTop)}const u=go(r);if(u<=0){const d=r.ownerDocument,p=d.body,m=getComputedStyle(p),h=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,g=Math.abs(r.clientWidth-p.clientWidth-h);g<=Uh&&(i-=g)}else u<=Uh&&(i+=u);return{width:i,height:o,x:s,y:l}}const u8e=new Set(["absolute","fixed"]);function d8e(e,t){const n=Er(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Rt(e)?Wr(e):Nn(1),o=e.clientWidth*i.x,s=e.clientHeight*i.y,l=a*i.x,u=r*i.y;return{width:o,height:s,x:l,y:u}}function Hh(e,t,n){let r;if(t==="viewport")r=c8e(e,n);else if(t==="document")r=l8e(Cn(e));else if(ot(t))r=d8e(t,n);else{const a=C5(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Hi(r)}function I5(e,t){const n=jn(e);return n===t||!ot(n)||qn(n)?!1:dn(n).position==="fixed"||I5(n,t)}function p8e(e,t){const n=t.get(e);if(n)return n;let r=rr(e,[],!1).filter(s=>ot(s)&&Jr(s)!=="body"),a=null;const i=dn(e).position==="fixed";let o=i?jn(e):e;for(;ot(o)&&!qn(o);){const s=dn(o),l=Kd(o);!l&&s.position==="fixed"&&(a=null),(i?!l&&!a:!l&&s.position==="static"&&!!a&&u8e.has(a.position)||Fa(o)&&!l&&I5(e,o))?r=r.filter(d=>d!==o):a=s,o=jn(o)}return t.set(e,r),r}function h8e(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?uo(t)?[]:p8e(t,this._c):[].concat(n),r],s=o[0],l=o.reduce((u,d)=>{const p=Hh(t,d,a);return u.top=vr(p.top,u.top),u.right=Bi(p.right,u.right),u.bottom=Bi(p.bottom,u.bottom),u.left=vr(p.left,u.left),u},Hh(t,s,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function m8e(e){const{width:t,height:n}=T5(e);return{width:t,height:n}}function f8e(e,t,n){const r=Rt(t),a=Cn(t),i=n==="fixed",o=Er(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Nn(0);function u(){l.x=go(a)}if(r||!r&&!i)if((Jr(t)!=="body"||Fa(a))&&(s=ho(t)),r){const h=Er(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else a&&u();i&&!r&&a&&u();const d=a&&!r&&!i?R5(a,s):Nn(0),p=o.left+s.scrollLeft-l.x-d.x,m=o.top+s.scrollTop-l.y-d.y;return{x:p,y:m,width:o.width,height:o.height}}function Jo(e){return dn(e).position==="static"}function jh(e,t){if(!Rt(e)||dn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Cn(e)===n&&(n=n.ownerDocument.body),n}function O5(e,t){const n=jt(e);if(uo(e))return n;if(!Rt(e)){let a=jn(e);for(;a&&!qn(a);){if(ot(a)&&!Jo(a))return a;a=jn(a)}return n}let r=jh(e,t);for(;r&&Yve(r)&&Jo(r);)r=jh(r,t);return r&&qn(r)&&Jo(r)&&!Kd(r)?n:r||e6e(e)||n}const g8e=async function(e){const t=this.getOffsetParent||O5,n=this.getDimensions,r=await n(e.floating);return{reference:f8e(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function y8e(e){return dn(e).direction==="rtl"}const b8e={convertOffsetParentRelativeRectToViewportRelativeRect:o8e,getDocumentElement:Cn,getClippingRect:h8e,getOffsetParent:O5,getElementRects:g8e,getClientRects:s8e,getDimensions:m8e,getScale:Wr,isElement:ot,isRTL:y8e};function L5(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function k8e(e,t){let n=null,r;const a=Cn(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:d,top:p,width:m,height:h}=u;if(s||t(),!m||!h)return;const g=Vr(p),y=Vr(a.clientWidth-(d+m)),v=Vr(a.clientHeight-(p+h)),_=Vr(d),w={rootMargin:-g+"px "+-y+"px "+-v+"px "+-_+"px",threshold:vr(0,Bi(1,l))||1};let M=!0;function S(E){const F=E[0].intersectionRatio;if(F!==l){if(!M)return o();F?o(!1,F):r=setTimeout(()=>{o(!1,1e-7)},1e3)}F===1&&!L5(u,e.getBoundingClientRect())&&o(),M=!1}try{n=new IntersectionObserver(S,{...w,root:a.ownerDocument})}catch{n=new IntersectionObserver(S,w)}n.observe(e)}return o(!0),i}function D5(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Zd(e),d=a||i?[...u?rr(u):[],...rr(t)]:[];d.forEach(_=>{a&&_.addEventListener("scroll",n,{passive:!0}),i&&_.addEventListener("resize",n)});const p=u&&s?k8e(u,n):null;let m=-1,h=null;o&&(h=new ResizeObserver(_=>{let[k]=_;k&&k.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g,y=l?Er(e):null;l&&v();function v(){const _=Er(e);y&&!L5(y,_)&&n(),y=_,g=requestAnimationFrame(v)}return n(),()=>{var _;d.forEach(k=>{a&&k.removeEventListener("scroll",n),i&&k.removeEventListener("resize",n)}),p?.(),(_=h)==null||_.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const v8e=n8e,_8e=r8e,w8e=J6e,x8e=(e,t,n)=>{const r=new Map,a={platform:b8e,...n},i={...a.platform,_c:r};return Q6e(e,t,{...a,platform:i})};var E8e=typeof document<"u",M8e=function(){},Ai=E8e?ee.useLayoutEffect:M8e;function Vi(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Vi(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Vi(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function z5(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Vh(e,t){const n=z5(e);return Math.round(t*n)/n}function es(e){const t=ne.useRef(e);return Ai(()=>{t.current=e}),t}function S8e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:o}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[d,p]=ne.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=ne.useState(r);Vi(m,r)||h(r);const[g,y]=ne.useState(null),[v,_]=ne.useState(null),k=ne.useCallback(C=>{C!==E.current&&(E.current=C,y(C))},[]),w=ne.useCallback(C=>{C!==F.current&&(F.current=C,_(C))},[]),M=i||g,S=o||v,E=ne.useRef(null),F=ne.useRef(null),P=ne.useRef(d),R=l!=null,D=es(l),W=es(a),K=es(u),J=ne.useCallback(()=>{if(!E.current||!F.current)return;const C={placement:t,strategy:n,middleware:m};W.current&&(C.platform=W.current),x8e(E.current,F.current,C).then(Y=>{const N={...Y,isPositioned:K.current!==!1};V.current&&!Vi(P.current,N)&&(P.current=N,Xk.flushSync(()=>{p(N)}))})},[m,t,n,W,K]);Ai(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,p(C=>({...C,isPositioned:!1})))},[u]);const V=ne.useRef(!1);Ai(()=>(V.current=!0,()=>{V.current=!1}),[]),Ai(()=>{if(M&&(E.current=M),S&&(F.current=S),M&&S){if(D.current)return D.current(M,S,J);J()}},[M,S,J,D,R]);const I=ne.useMemo(()=>({reference:E,floating:F,setReference:k,setFloating:w}),[k,w]),q=ne.useMemo(()=>({reference:M,floating:S}),[M,S]),G=ne.useMemo(()=>{const C={position:n,left:0,top:0};if(!q.floating)return C;const Y=Vh(q.floating,d.x),N=Vh(q.floating,d.y);return s?{...C,transform:"translate("+Y+"px, "+N+"px)",...z5(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:N}},[n,s,q.floating,d.x,d.y]);return ne.useMemo(()=>({...d,update:J,refs:I,elements:q,floatingStyles:G}),[d,J,I,q,G])}const $5=(e,t)=>({...v8e(e),options:[e,t]}),F5=(e,t)=>({..._8e(e),options:[e,t]}),P5=(e,t)=>({...w8e(e),options:[e,t]}),N8e="data-floating-ui-focusable",Gh="active",Wh="selected",Pa="ArrowLeft",Ba="ArrowRight",B5="ArrowUp",yo="ArrowDown",A8e={...ne};let Kh=!1,T8e=0;const Yh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+T8e++;function C8e(){const[e,t]=ne.useState(()=>Kh?Yh():void 0);return Nt(()=>{e==null&&t(Yh())},[]),ne.useEffect(()=>{Kh=!0},[]),e}const R8e=A8e.useId,Xd=R8e||C8e;let Aa;process.env.NODE_ENV!=="production"&&(Aa=new Set);function ts(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const a="Floating UI: "+n.join(" ");if(!((e=Aa)!=null&&e.has(a))){var i;(i=Aa)==null||i.add(a),console.warn(a)}}function I8e(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const a="Floating UI: "+n.join(" ");if(!((e=Aa)!=null&&e.has(a))){var i;(i=Aa)==null||i.add(a),console.error(a)}}function O8e(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(a=>a(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const L8e=ne.createContext(null),D8e=ne.createContext(null),bo=()=>{var e;return((e=ne.useContext(L8e))==null?void 0:e.id)||null},ko=()=>ne.useContext(D8e);function qa(e){return"data-floating-ui-"+e}function nn(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Zh=qa("safe-polygon");function ns(e,t,n){if(n&&!Na(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function rs(e){return typeof e=="function"?e():e}function z8e(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:a,events:i,elements:o}=e,{enabled:s=!0,delay:l=0,handleClose:u=null,mouseOnly:d=!1,restMs:p=0,move:m=!0}=t,h=ko(),g=bo(),y=Pn(u),v=Pn(l),_=Pn(n),k=Pn(p),w=ne.useRef(),M=ne.useRef(-1),S=ne.useRef(),E=ne.useRef(-1),F=ne.useRef(!0),P=ne.useRef(!1),R=ne.useRef(()=>{}),D=ne.useRef(!1),W=Xt(()=>{var G;const C=(G=a.current.openEvent)==null?void 0:G.type;return C?.includes("mouse")&&C!=="mousedown"});ne.useEffect(()=>{if(!s)return;function G(C){let{open:Y}=C;Y||(nn(M),nn(E),F.current=!0,D.current=!1)}return i.on("openchange",G),()=>{i.off("openchange",G)}},[s,i]),ne.useEffect(()=>{if(!s||!y.current||!n)return;function G(Y){W()&&r(!1,Y,"hover")}const C=yn(o.floating).documentElement;return C.addEventListener("mouseleave",G),()=>{C.removeEventListener("mouseleave",G)}},[o.floating,n,r,s,y,W]);const K=ne.useCallback(function(G,C,Y){C===void 0&&(C=!0),Y===void 0&&(Y="hover");const N=ns(v.current,"close",w.current);N&&!S.current?(nn(M),M.current=window.setTimeout(()=>r(!1,G,Y),N)):C&&(nn(M),r(!1,G,Y))},[v,r]),J=Xt(()=>{R.current(),S.current=void 0}),V=Xt(()=>{if(P.current){const G=yn(o.floating).body;G.style.pointerEvents="",G.removeAttribute(Zh),P.current=!1}}),I=Xt(()=>a.current.openEvent?["click","mousedown"].includes(a.current.openEvent.type):!1);ne.useEffect(()=>{if(!s)return;function G(te){if(nn(M),F.current=!1,d&&!Na(w.current)||rs(k.current)>0&&!ns(v.current,"open"))return;const O=ns(v.current,"open",w.current);O?M.current=window.setTimeout(()=>{_.current||r(!0,te,"hover")},O):n||r(!0,te,"hover")}function C(te){if(I()){V();return}R.current();const O=yn(o.floating);if(nn(E),D.current=!1,y.current&&a.current.floatingContext){n||nn(M),S.current=y.current({...a.current.floatingContext,tree:h,x:te.clientX,y:te.clientY,onClose(){V(),J(),I()||K(te,!0,"safe-polygon")}});const ge=S.current;O.addEventListener("mousemove",ge),R.current=()=>{O.removeEventListener("mousemove",ge)};return}(w.current==="touch"?!xr(o.floating,te.relatedTarget):!0)&&K(te)}function Y(te){I()||a.current.floatingContext&&(y.current==null||y.current({...a.current.floatingContext,tree:h,x:te.clientX,y:te.clientY,onClose(){V(),J(),I()||K(te)}})(te))}function N(){nn(M)}function Z(te){I()||K(te,!1)}if(ot(o.domReference)){const te=o.domReference,O=o.floating;return n&&te.addEventListener("mouseleave",Y),m&&te.addEventListener("mousemove",G,{once:!0}),te.addEventListener("mouseenter",G),te.addEventListener("mouseleave",C),O&&(O.addEventListener("mouseleave",Y),O.addEventListener("mouseenter",N),O.addEventListener("mouseleave",Z)),()=>{n&&te.removeEventListener("mouseleave",Y),m&&te.removeEventListener("mousemove",G),te.removeEventListener("mouseenter",G),te.removeEventListener("mouseleave",C),O&&(O.removeEventListener("mouseleave",Y),O.removeEventListener("mouseenter",N),O.removeEventListener("mouseleave",Z))}}},[o,s,e,d,m,K,J,V,r,n,_,h,v,y,a,I,k]),Nt(()=>{var G;if(s&&n&&(G=y.current)!=null&&(G=G.__options)!=null&&G.blockPointerEvents&&W()){P.current=!0;const Y=o.floating;if(ot(o.domReference)&&Y){var C;const N=yn(o.floating).body;N.setAttribute(Zh,"");const Z=o.domReference,te=h==null||(C=h.nodesRef.current.find(O=>O.id===g))==null||(C=C.context)==null?void 0:C.elements.floating;return te&&(te.style.pointerEvents=""),N.style.pointerEvents="none",Z.style.pointerEvents="auto",Y.style.pointerEvents="auto",()=>{N.style.pointerEvents="",Z.style.pointerEvents="",Y.style.pointerEvents=""}}}},[s,n,g,o,h,y,W]),Nt(()=>{n||(w.current=void 0,D.current=!1,J(),V())},[n,J,V]),ne.useEffect(()=>()=>{J(),nn(M),nn(E),V()},[s,o.domReference,J,V]);const q=ne.useMemo(()=>{function G(C){w.current=C.pointerType}return{onPointerDown:G,onPointerEnter:G,onMouseMove(C){const{nativeEvent:Y}=C;function N(){!F.current&&!_.current&&r(!0,Y,"hover")}d&&!Na(w.current)||n||rs(k.current)===0||D.current&&C.movementX**2+C.movementY**2<2||(nn(E),w.current==="touch"?N():(D.current=!0,E.current=window.setTimeout(N,rs(k.current))))}}},[d,r,n,_,k]);return ne.useMemo(()=>s?{reference:q}:{},[s,q])}let Xh=0;function $8e(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:a=!1}=t;r&&cancelAnimationFrame(Xh);const i=()=>e?.focus({preventScroll:n});a?i():Xh=requestAnimationFrame(i)}const q5={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Qh=ne.forwardRef(function(t,n){const[r,a]=ne.useState();Nt(()=>{x5()&&a("button")},[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[qa("focus-guard")]:"",style:q5};return T.jsx("span",{...t,...i})}),U5=ne.createContext(null),Jh=qa("portal");function F8e(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Xd(),a=B8e(),[i,o]=ne.useState(null),s=ne.useRef(null);return Nt(()=>()=>{i?.remove(),queueMicrotask(()=>{s.current=null})},[i]),Nt(()=>{if(!r||s.current)return;const l=t?document.getElementById(t):null;if(!l)return;const u=document.createElement("div");u.id=r,u.setAttribute(Jh,""),l.appendChild(u),s.current=u,o(u)},[t,r]),Nt(()=>{if(n===null||!r||s.current)return;let l=n||a?.portalNode;l&&!Wd(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));const d=document.createElement("div");d.id=r,d.setAttribute(Jh,""),l=u||l,l.appendChild(d),s.current=d,o(d)},[t,n,r,a]),i}function P8e(e){const{children:t,id:n,root:r,preserveTabOrder:a=!0}=e,i=F8e({id:n,root:r}),[o,s]=ne.useState(null),l=ne.useRef(null),u=ne.useRef(null),d=ne.useRef(null),p=ne.useRef(null),m=o?.modal,h=o?.open,g=!!o&&!o.modal&&o.open&&a&&!!(r||i);return ne.useEffect(()=>{if(!i||!a||m)return;function y(v){i&&Qo(v)&&(v.type==="focusin"?Bh:X6e)(i)}return i.addEventListener("focusin",y,!0),i.addEventListener("focusout",y,!0),()=>{i.removeEventListener("focusin",y,!0),i.removeEventListener("focusout",y,!0)}},[i,a,m]),ne.useEffect(()=>{i&&(h||Bh(i))},[h,i]),T.jsxs(U5.Provider,{value:ne.useMemo(()=>({preserveTabOrder:a,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:p,portalNode:i,setFocusManagerState:s}),[a,i]),children:[g&&i&&T.jsx(Qh,{"data-type":"outside",ref:l,onFocus:y=>{if(Qo(y,i)){var v;(v=d.current)==null||v.focus()}else{const _=o?o.domReference:null,k=Z6e(_);k?.focus()}}}),g&&i&&T.jsx("span",{"aria-owns":i.id,style:q5}),i&&Xk.createPortal(t,i),g&&i&&T.jsx(Qh,{"data-type":"outside",ref:u,onFocus:y=>{if(Qo(y,i)){var v;(v=p.current)==null||v.focus()}else{const _=o?o.domReference:null,k=Y6e(_);k?.focus(),o?.closeOnFocusOut&&o?.onOpenChange(!1,y.nativeEvent,"focus-out")}}})]})}const B8e=()=>ne.useContext(U5);function e2(e){return Rt(e.target)&&e.target.tagName==="BUTTON"}function q8e(e){return Rt(e.target)&&e.target.tagName==="A"}function t2(e){return Yd(e)}function U8e(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:a,elements:{domReference:i}}=e,{enabled:o=!0,event:s="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0,stickIfOpen:p=!0}=t,m=ne.useRef(),h=ne.useRef(!1),g=ne.useMemo(()=>({onPointerDown(y){m.current=y.pointerType},onMouseDown(y){const v=m.current;y.button===0&&s!=="click"&&(Na(v,!0)&&u||(n&&l&&(!(a.current.openEvent&&p)||a.current.openEvent.type==="mousedown")?r(!1,y.nativeEvent,"click"):(y.preventDefault(),r(!0,y.nativeEvent,"click"))))},onClick(y){const v=m.current;if(s==="mousedown"&&m.current){m.current=void 0;return}Na(v,!0)&&u||(n&&l&&(!(a.current.openEvent&&p)||a.current.openEvent.type==="click")?r(!1,y.nativeEvent,"click"):r(!0,y.nativeEvent,"click"))},onKeyDown(y){m.current=void 0,!(y.defaultPrevented||!d||e2(y))&&(y.key===" "&&!t2(i)&&(y.preventDefault(),h.current=!0),!q8e(y)&&y.key==="Enter"&&r(!(n&&l),y.nativeEvent,"click"))},onKeyUp(y){y.defaultPrevented||!d||e2(y)||t2(i)||y.key===" "&&h.current&&(h.current=!1,r(!(n&&l),y.nativeEvent,"click"))}}),[a,i,s,u,d,r,n,p,l]);return ne.useMemo(()=>o?{reference:g}:{},[o,g])}const H8e={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},j8e={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},n2=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function H5(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:a,dataRef:i}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:l=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:p="pointerdown",ancestorScroll:m=!1,bubbles:h,capture:g}=t,y=ko(),v=Xt(typeof l=="function"?l:()=>!1),_=typeof l=="function"?v:l,k=ne.useRef(!1),{escapeKey:w,outsidePress:M}=n2(h),{escapeKey:S,outsidePress:E}=n2(g),F=ne.useRef(!1),P=Xt(V=>{var I;if(!n||!o||!s||V.key!=="Escape"||F.current)return;const q=(I=i.current.floatingContext)==null?void 0:I.nodeId,G=y?ba(y.nodesRef.current,q):[];if(!w&&(V.stopPropagation(),G.length>0)){let C=!0;if(G.forEach(Y=>{var N;if((N=Y.context)!=null&&N.open&&!Y.context.dataRef.current.__escapeKeyBubbles){C=!1;return}}),!C)return}r(!1,$6e(V)?V.nativeEvent:V,"escape-key")}),R=Xt(V=>{var I;const q=()=>{var G;P(V),(G=Pr(V))==null||G.removeEventListener("keydown",q)};(I=Pr(V))==null||I.addEventListener("keydown",q)}),D=Xt(V=>{var I;const q=i.current.insideReactTree;i.current.insideReactTree=!1;const G=k.current;if(k.current=!1,u==="click"&&G||q||typeof _=="function"&&!_(V))return;const C=Pr(V),Y="["+qa("inert")+"]",N=yn(a.floating).querySelectorAll(Y);let Z=ot(C)?C:null;for(;Z&&!qn(Z);){const ge=jn(Z);if(qn(ge)||!ot(ge))break;Z=ge}if(N.length&&ot(C)&&!O6e(C)&&!xr(C,a.floating)&&Array.from(N).every(ge=>!xr(Z,ge)))return;if(Rt(C)&&J){const ge=qn(C),ve=dn(C),Re=/auto|scroll/,qe=ge||Re.test(ve.overflowX),He=ge||Re.test(ve.overflowY),re=qe&&C.clientWidth>0&&C.scrollWidth>C.clientWidth,Me=He&&C.clientHeight>0&&C.scrollHeight>C.clientHeight,Ge=ve.direction==="rtl",Je=Me&&(Ge?V.offsetX<=C.offsetWidth-C.clientWidth:V.offsetX>C.clientWidth),ze=re&&V.offsetY>C.clientHeight;if(Je||ze)return}const te=(I=i.current.floatingContext)==null?void 0:I.nodeId,O=y&&ba(y.nodesRef.current,te).some(ge=>{var ve;return Zo(V,(ve=ge.context)==null?void 0:ve.elements.floating)});if(Zo(V,a.floating)||Zo(V,a.domReference)||O)return;const pe=y?ba(y.nodesRef.current,te):[];if(pe.length>0){let ge=!0;if(pe.forEach(ve=>{var Re;if((Re=ve.context)!=null&&Re.open&&!ve.context.dataRef.current.__outsidePressBubbles){ge=!1;return}}),!ge)return}r(!1,V,"outside-press")}),W=Xt(V=>{var I;const q=()=>{var G;D(V),(G=Pr(V))==null||G.removeEventListener(u,q)};(I=Pr(V))==null||I.addEventListener(u,q)});ne.useEffect(()=>{if(!n||!o)return;i.current.__escapeKeyBubbles=w,i.current.__outsidePressBubbles=M;let V=-1;function I(N){r(!1,N,"ancestor-scroll")}function q(){window.clearTimeout(V),F.current=!0}function G(){V=window.setTimeout(()=>{F.current=!1},po()?5:0)}const C=yn(a.floating);s&&(C.addEventListener("keydown",S?R:P,S),C.addEventListener("compositionstart",q),C.addEventListener("compositionend",G)),_&&C.addEventListener(u,E?W:D,E);let Y=[];return m&&(ot(a.domReference)&&(Y=rr(a.domReference)),ot(a.floating)&&(Y=Y.concat(rr(a.floating))),!ot(a.reference)&&a.reference&&a.reference.contextElement&&(Y=Y.concat(rr(a.reference.contextElement)))),Y=Y.filter(N=>{var Z;return N!==((Z=C.defaultView)==null?void 0:Z.visualViewport)}),Y.forEach(N=>{N.addEventListener("scroll",I,{passive:!0})}),()=>{s&&(C.removeEventListener("keydown",S?R:P,S),C.removeEventListener("compositionstart",q),C.removeEventListener("compositionend",G)),_&&C.removeEventListener(u,E?W:D,E),Y.forEach(N=>{N.removeEventListener("scroll",I)}),window.clearTimeout(V)}},[i,a,s,_,u,n,r,m,o,w,M,P,S,R,D,E,W]),ne.useEffect(()=>{i.current.insideReactTree=!1},[i,_,u]);const K=ne.useMemo(()=>({onKeyDown:P,...d&&{[H8e[p]]:V=>{r(!1,V.nativeEvent,"reference-press")},...p!=="click"&&{onClick(V){r(!1,V.nativeEvent,"reference-press")}}}}),[P,r,d,p]),J=ne.useMemo(()=>({onKeyDown:P,onMouseDown(){k.current=!0},onMouseUp(){k.current=!0},[j8e[u]]:()=>{i.current.insideReactTree=!0}}),[P,u,i]);return ne.useMemo(()=>o?{reference:K,floating:J}:{},[o,K,J])}function V8e(e){const{open:t=!1,onOpenChange:n,elements:r}=e,a=Xd(),i=ne.useRef({}),[o]=ne.useState(()=>O8e()),s=bo()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!ot(h)&&I8e("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=ne.useState(r.reference),d=Xt((h,g,y)=>{i.current.openEvent=h?g:void 0,o.emit("openchange",{open:h,event:g,reason:y,nested:s}),n?.(h,g,y)}),p=ne.useMemo(()=>({setPositionReference:u}),[]),m=ne.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return ne.useMemo(()=>({dataRef:i,open:t,onOpenChange:d,elements:m,events:o,floatingId:a,refs:p}),[t,d,m,o,a,p])}function j5(e){e===void 0&&(e={});const{nodeId:t}=e,n=V8e({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,a=r.elements,[i,o]=ne.useState(null),[s,l]=ne.useState(null),d=a?.domReference||i,p=ne.useRef(null),m=ko();Nt(()=>{d&&(p.current=d)},[d]);const h=S8e({...e,elements:{...a,...s&&{reference:s}}}),g=ne.useCallback(w=>{const M=ot(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;l(M),h.refs.setReference(M)},[h.refs]),y=ne.useCallback(w=>{(ot(w)||w===null)&&(p.current=w,o(w)),(ot(h.refs.reference.current)||h.refs.reference.current===null||w!==null&&!ot(w))&&h.refs.setReference(w)},[h.refs]),v=ne.useMemo(()=>({...h.refs,setReference:y,setPositionReference:g,domReference:p}),[h.refs,y,g]),_=ne.useMemo(()=>({...h.elements,domReference:d}),[h.elements,d]),k=ne.useMemo(()=>({...h,...r,refs:v,elements:_,nodeId:t}),[h,v,_,t,r]);return Nt(()=>{r.dataRef.current.floatingContext=k;const w=m?.nodesRef.current.find(M=>M.id===t);w&&(w.context=k)}),ne.useMemo(()=>({...h,context:k,refs:v,elements:_}),[h,v,_,k])}function as(){return T6e()&&x5()}function G8e(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:a,dataRef:i,elements:o}=e,{enabled:s=!0,visibleOnly:l=!0}=t,u=ne.useRef(!1),d=ne.useRef(-1),p=ne.useRef(!0);ne.useEffect(()=>{if(!s)return;const h=jt(o.domReference);function g(){!n&&Rt(o.domReference)&&o.domReference===Sa(yn(o.domReference))&&(u.current=!0)}function y(){p.current=!0}function v(){p.current=!1}return h.addEventListener("blur",g),as()&&(h.addEventListener("keydown",y,!0),h.addEventListener("pointerdown",v,!0)),()=>{h.removeEventListener("blur",g),as()&&(h.removeEventListener("keydown",y,!0),h.removeEventListener("pointerdown",v,!0))}},[o.domReference,n,s]),ne.useEffect(()=>{if(!s)return;function h(g){let{reason:y}=g;(y==="reference-press"||y==="escape-key")&&(u.current=!0)}return a.on("openchange",h),()=>{a.off("openchange",h)}},[a,s]),ne.useEffect(()=>()=>{nn(d)},[]);const m=ne.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(h){if(u.current)return;const g=Pr(h.nativeEvent);if(l&&ot(g)){if(as()&&!h.relatedTarget){if(!p.current&&!Yd(g))return}else if(!D6e(g))return}r(!0,h.nativeEvent,"focus")},onBlur(h){u.current=!1;const g=h.relatedTarget,y=h.nativeEvent,v=ot(g)&&g.hasAttribute(qa("focus-guard"))&&g.getAttribute("data-type")==="outside";d.current=window.setTimeout(()=>{var _;const k=Sa(o.domReference?o.domReference.ownerDocument:document);!g&&k===o.domReference||xr((_=i.current.floatingContext)==null?void 0:_.refs.floating.current,k)||xr(o.domReference,k)||v||r(!1,y,"focus")})}}),[i,o.domReference,r,l]);return ne.useMemo(()=>s?{reference:m}:{},[s,m])}function is(e,t,n){const r=new Map,a=n==="item";let i=e;if(a&&e){const{[Gh]:o,[Wh]:s,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[N8e]:""},...i,...t.map(o=>{const s=o?o[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((o,s)=>(s&&Object.entries(s).forEach(l=>{let[u,d]=l;if(!(a&&[Gh,Wh].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof d=="function"){var p;(p=r.get(u))==null||p.push(d),o[u]=function(){for(var m,h=arguments.length,g=new Array(h),y=0;y<h;y++)g[y]=arguments[y];return(m=r.get(u))==null?void 0:m.map(v=>v(...g)).find(v=>v!==void 0)}}}else o[u]=d}),o),{})}}function V5(e){e===void 0&&(e=[]);const t=e.map(s=>s?.reference),n=e.map(s=>s?.floating),r=e.map(s=>s?.item),a=ne.useCallback(s=>is(s,e,"reference"),t),i=ne.useCallback(s=>is(s,e,"floating"),n),o=ne.useCallback(s=>is(s,e,"item"),r);return ne.useMemo(()=>({getReferenceProps:a,getFloatingProps:i,getItemProps:o}),[a,i,o])}const W8e="Escape";function vo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function ei(e,t){return vo(t,e===B5||e===yo,e===Pa||e===Ba)}function os(e,t,n){return vo(t,e===yo,n?e===Pa:e===Ba)||e==="Enter"||e===" "||e===""}function r2(e,t,n){return vo(t,n?e===Pa:e===Ba,e===yo)}function a2(e,t,n,r){const a=n?e===Ba:e===Pa,i=e===B5;return t==="both"||t==="horizontal"&&r&&r>1?e===W8e:vo(t,a,i)}function K8e(e,t){const{open:n,onOpenChange:r,elements:a,floatingId:i}=e,{listRef:o,activeIndex:s,onNavigate:l=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:p=!1,loop:m=!1,nested:h=!1,rtl:g=!1,virtual:y=!1,focusItemOnOpen:v="auto",focusItemOnHover:_=!0,openOnArrowKeyDown:k=!0,disabledIndices:w=void 0,orientation:M="vertical",parentOrientation:S,cols:E=1,scrollItemIntoView:F=!0,virtualItemRef:P,itemSizes:R,dense:D=!1}=t;process.env.NODE_ENV!=="production"&&(p&&(m||ts("`useListNavigation` looping must be enabled to allow escaping."),y||ts("`useListNavigation` must be virtual to allow escaping.")),M==="vertical"&&E>1&&ts("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const W=M5(a.floating),K=Pn(W),J=bo(),V=ko();Nt(()=>{e.dataRef.current.orientation=M},[e,M]);const I=Xt(()=>{l(C.current===-1?null:C.current)}),q=L6e(a.domReference),G=ne.useRef(v),C=ne.useRef(d??-1),Y=ne.useRef(null),N=ne.useRef(!0),Z=ne.useRef(I),te=ne.useRef(!!a.floating),O=ne.useRef(n),pe=ne.useRef(!1),ge=ne.useRef(!1),ve=Pn(w),Re=Pn(n),qe=Pn(F),He=Pn(d),[re,Me]=ne.useState(),[Ge,Je]=ne.useState(),ze=Xt(()=>{function _e(B){if(y){var X;(X=B.id)!=null&&X.endsWith("-fui-option")&&(B.id=i+"-"+Math.random().toString(16).slice(2,10)),Me(B.id),V?.events.emit("virtualfocus",B),P&&(P.current=B)}else $8e(B,{sync:pe.current,preventScroll:!0})}const Pe=o.current[C.current],xe=ge.current;Pe&&_e(Pe),(pe.current?B=>B():requestAnimationFrame)(()=>{const B=o.current[C.current]||Pe;if(!B)return;Pe||_e(B);const X=qe.current;X&&ke&&(xe||!N.current)&&(B.scrollIntoView==null||B.scrollIntoView(typeof X=="boolean"?{block:"nearest",inline:"nearest"}:X))})});Nt(()=>{u&&(n&&a.floating?G.current&&d!=null&&(ge.current=!0,C.current=d,I()):te.current&&(C.current=-1,Z.current()))},[u,n,a.floating,d,I]),Nt(()=>{if(u&&n&&a.floating)if(s==null){if(pe.current=!1,He.current!=null)return;if(te.current&&(C.current=-1,ze()),(!O.current||!te.current)&&G.current&&(Y.current!=null||G.current===!0&&Y.current==null)){let _e=0;const Pe=()=>{o.current[0]==null?(_e<2&&(_e?requestAnimationFrame:queueMicrotask)(Pe),_e++):(C.current=Y.current==null||os(Y.current,M,g)||h?Xo(o,ve.current):Ph(o,ve.current),Y.current=null,I())};Pe()}}else ka(o,s)||(C.current=s,ze(),ge.current=!1)},[u,n,a.floating,s,He,h,o,M,g,I,ze,ve]),Nt(()=>{var _e;if(!u||a.floating||!V||y||!te.current)return;const Pe=V.nodesRef.current,xe=(_e=Pe.find(X=>X.id===J))==null||(_e=_e.context)==null?void 0:_e.elements.floating,Xe=Sa(yn(a.floating)),B=Pe.some(X=>X.context&&xr(X.context.elements.floating,Xe));xe&&!B&&N.current&&xe.focus({preventScroll:!0})},[u,a.floating,V,J,y]),Nt(()=>{if(!u||!V||!y||J)return;function _e(Pe){Je(Pe.id),P&&(P.current=Pe)}return V.events.on("virtualfocus",_e),()=>{V.events.off("virtualfocus",_e)}},[u,V,y,J,P]),Nt(()=>{Z.current=I,O.current=n,te.current=!!a.floating}),Nt(()=>{n||(Y.current=null,G.current=v)},[n,v]);const we=s!=null,ke=ne.useMemo(()=>{function _e(xe){if(!Re.current)return;const Xe=o.current.indexOf(xe);Xe!==-1&&C.current!==Xe&&(C.current=Xe,I())}return{onFocus(xe){let{currentTarget:Xe}=xe;pe.current=!0,_e(Xe)},onClick:xe=>{let{currentTarget:Xe}=xe;return Xe.focus({preventScroll:!0})},onMouseMove(xe){let{currentTarget:Xe}=xe;pe.current=!0,ge.current=!1,_&&_e(Xe)},onPointerLeave(xe){let{pointerType:Xe}=xe;if(!(!N.current||Xe==="touch")&&(pe.current=!0,!!_&&(C.current=-1,I(),!y))){var B;(B=K.current)==null||B.focus({preventScroll:!0})}}}},[Re,K,_,o,I,y]),De=ne.useCallback(()=>{var _e;return S??(V==null||(_e=V.nodesRef.current.find(Pe=>Pe.id===J))==null||(_e=_e.context)==null||(_e=_e.dataRef)==null?void 0:_e.current.orientation)},[J,V,S]),de=Xt(_e=>{if(N.current=!1,pe.current=!0,_e.which===229||!Re.current&&_e.currentTarget===K.current)return;if(h&&a2(_e.key,M,g,E)){ei(_e.key,De())||rn(_e),r(!1,_e.nativeEvent,"list-navigation"),Rt(a.domReference)&&(y?V?.events.emit("virtualfocus",a.domReference):a.domReference.focus());return}const Pe=C.current,xe=Xo(o,w),Xe=Ph(o,w);if(q||(_e.key==="Home"&&(rn(_e),C.current=xe,I()),_e.key==="End"&&(rn(_e),C.current=Xe,I())),E>1){const B=R||Array.from({length:o.current.length},()=>({width:1,height:1})),X=G6e(B,E,D),le=X.findIndex(je=>je!=null&&!Ni(o,je,w)),he=X.reduce((je,wt,Et)=>wt!=null&&!Ni(o,wt,w)?Et:je,-1),Se=X[V6e({current:X.map(je=>je!=null?o.current[je]:null)},{event:_e,orientation:M,loop:m,rtl:g,cols:E,disabledIndices:K6e([...(typeof w!="function"?w:null)||o.current.map((je,wt)=>Ni(o,wt,w)?wt:void 0),void 0],X),minIndex:le,maxIndex:he,prevIndex:W6e(C.current>Xe?xe:C.current,B,X,E,_e.key===yo?"bl":_e.key===(g?Pa:Ba)?"tr":"tl"),stopEvent:!0})];if(Se!=null&&(C.current=Se,I()),M==="both")return}if(ei(_e.key,M)){if(rn(_e),n&&!y&&Sa(_e.currentTarget.ownerDocument)===_e.currentTarget){C.current=os(_e.key,M,g)?xe:Xe,I();return}os(_e.key,M,g)?m?C.current=Pe>=Xe?p&&Pe!==o.current.length?-1:xe:At(o,{startingIndex:Pe,disabledIndices:w}):C.current=Math.min(Xe,At(o,{startingIndex:Pe,disabledIndices:w})):m?C.current=Pe<=xe?p&&Pe!==-1?o.current.length:Xe:At(o,{startingIndex:Pe,decrement:!0,disabledIndices:w}):C.current=Math.max(xe,At(o,{startingIndex:Pe,decrement:!0,disabledIndices:w})),ka(o,C.current)&&(C.current=-1),I()}}),et=ne.useMemo(()=>y&&n&&we&&{"aria-activedescendant":Ge||re},[y,n,we,Ge,re]),Ce=ne.useMemo(()=>({"aria-orientation":M==="both"?void 0:M,...q?{}:et,onKeyDown:de,onPointerMove(){N.current=!0}}),[et,de,M,q]),We=ne.useMemo(()=>{function _e(xe){v==="auto"&&F6e(xe.nativeEvent)&&(G.current=!0)}function Pe(xe){G.current=v,v==="auto"&&P6e(xe.nativeEvent)&&(G.current=!0)}return{...et,onKeyDown(xe){N.current=!1;const Xe=xe.key.startsWith("Arrow"),B=["Home","End"].includes(xe.key),X=Xe||B,le=r2(xe.key,M,g),he=a2(xe.key,M,g,E),Se=r2(xe.key,De(),g),je=ei(xe.key,M),wt=(h?Se:je)||xe.key==="Enter"||xe.key.trim()==="";if(y&&n){const gt=V?.nodesRef.current.find(Mt=>Mt.parentId==null),St=V&>?z6e(V.nodesRef.current,gt.id):null;if(X&&St&&P){const Mt=new KeyboardEvent("keydown",{key:xe.key,bubbles:!0});if(le||he){var Et,vn;const Xa=((Et=St.context)==null?void 0:Et.elements.domReference)===xe.currentTarget,zn=he&&!Xa?(vn=St.context)==null?void 0:vn.elements.domReference:le?o.current.find(Ir=>Ir?.id===re):null;zn&&(rn(xe),zn.dispatchEvent(Mt),Je(void 0))}if((je||B)&&St.context&&St.context.open&&St.parentId&&xe.currentTarget!==St.context.elements.domReference){var _n;rn(xe),(_n=St.context.elements.domReference)==null||_n.dispatchEvent(Mt);return}}return de(xe)}if(!(!n&&!k&&Xe)){if(wt){const gt=ei(xe.key,De());Y.current=h&>?null:xe.key}if(h){Se&&(rn(xe),n?(C.current=Xo(o,ve.current),I()):r(!0,xe.nativeEvent,"list-navigation"));return}je&&(d!=null&&(C.current=d),rn(xe),!n&&k?r(!0,xe.nativeEvent,"list-navigation"):de(xe),n&&I())}},onFocus(){n&&!y&&(C.current=-1,I())},onPointerDown:Pe,onPointerEnter:Pe,onMouseDown:_e,onClick:_e}},[re,et,E,de,ve,v,o,h,I,r,n,k,M,De,g,d,V,y,P]);return ne.useMemo(()=>u?{reference:We,floating:Ce,item:ke}:{},[u,We,Ce,ke])}const Y8e=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function G5(e,t){var n,r;t===void 0&&(t={});const{open:a,elements:i,floatingId:o}=e,{enabled:s=!0,role:l="dialog"}=t,u=Xd(),d=((n=i.domReference)==null?void 0:n.id)||u,p=ne.useMemo(()=>{var k;return((k=M5(i.floating))==null?void 0:k.id)||o},[i.floating,o]),m=(r=Y8e.get(l))!=null?r:l,g=bo()!=null,y=ne.useMemo(()=>m==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:a?p:void 0}:{"aria-expanded":a?"true":"false","aria-haspopup":m==="alertdialog"?"dialog":m,"aria-controls":a?p:void 0,...m==="listbox"&&{role:"combobox"},...m==="menu"&&{id:d},...m==="menu"&&g&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[m,p,g,a,d,l]),v=ne.useMemo(()=>{const k={id:p,...m&&{role:m}};return m==="tooltip"||l==="label"?k:{...k,...m==="menu"&&{"aria-labelledby":d}}},[m,p,d,l]),_=ne.useCallback(k=>{let{active:w,selected:M}=k;const S={role:"option",...w&&{id:p+"-fui-option"}};switch(l){case"select":case"combobox":return{...S,"aria-selected":M}}return{}},[p,l]);return ne.useMemo(()=>s?{reference:y,floating:v,item:_}:{},[s,y,v,_])}const Jn=({content:e,children:t,placement:n="top",delay:r=300,disabled:a=!1,className:i=""})=>{const[o,s]=ee.useState(!1),{refs:l,floatingStyles:u,context:d,isPositioned:p}=j5({open:o,onOpenChange:s,placement:n,strategy:"absolute",whileElementsMounted:D5,middleware:[$5(8),P5(),F5({padding:8})]}),m=z8e(d,{delay:{open:r,close:0},enabled:!a}),h=G8e(d,{enabled:!a}),g=H5(d,{enabled:!0,outsidePress:!0,outsidePressEvent:"mousedown",referencePress:!0,referencePressEvent:"mousedown",escapeKey:!0,ancestorScroll:!0}),y=G5(d,{role:"tooltip"}),{getReferenceProps:v,getFloatingProps:_}=V5([m,h,g,y]);return ee.useEffect(()=>{if(!o||a)return;const k=()=>{s(!1)};return window.addEventListener("scroll",k,!0),document.addEventListener("scroll",k,!0),()=>{window.removeEventListener("scroll",k,!0),document.removeEventListener("scroll",k,!0)}},[o,a]),a||!e?T.jsx(T.Fragment,{children:t}):T.jsxs(T.Fragment,{children:[T.jsx("span",{ref:l.setReference,...v(),children:t}),o&&T.jsx(P8e,{children:T.jsx("div",{ref:l.setFloating,style:{...u,opacity:p?1:0,pointerEvents:"none",transition:p?"opacity 0.15s ease-out":"none"},className:`mp-agent-tooltip ${i}`.trim(),..._(),children:e})})]})},ar=({icon:e,size:t="md",iconSize:n,type:r="button",className:a="",tooltip:i,tooltipPlacement:o,...s})=>{const l=Gve[e],u=n??(t==="sm"?14:20),d=T.jsx("button",{type:r,className:`mp-agent-icon-button mp-agent-icon-button-${t} ${a}`.trim(),...s,children:l&&T.jsx(l,{size:u})});return i?T.jsx(Jn,{content:i,placement:o,children:d}):d},Qd=({text:e})=>{const[t,n]=ee.useState(!1),r=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)}catch(a){console.error("Failed to copy:",a)}};return T.jsx(Jn,{content:"Copy to clipboard",children:T.jsx(ar,{icon:t?"Check":"Copy",onClick:r,"aria-label":"Copy message",size:"sm"})})},i2=300,W5=ee.memo(({field:e,isExpanded:t,canApply:n,onToggleExpand:r,onApply:a})=>{const i=e.value.length>i2,o=i&&!t?`${e.value.slice(0,i2)}...`:e.value,s=ee.useCallback(()=>{r(e.name)},[e.name,r]),l=ee.useCallback(()=>{a(e)},[e,a]);return T.jsxs("div",{className:"mp-agent-form-proposal-row",children:[T.jsxs("div",{className:"mp-agent-form-proposal-main",children:[T.jsx("div",{className:"mp-agent-form-proposal-label",children:e.label||e.name}),T.jsx("div",{className:"mp-agent-form-proposal-value-container",children:T.jsxs("div",{className:"mp-agent-form-proposal-value",children:[o,i&&T.jsx("button",{type:"button",onClick:s,className:"mp-agent-form-proposal-show-all",children:t?"Show less":"Show all"})]})})]}),T.jsxs("div",{className:"mp-agent-form-proposal-actions-row",children:[n&&T.jsx(ar,{icon:"Check",onClick:l,tooltip:`Apply ${e.name}`,size:"sm"}),T.jsx(Qd,{text:e.value})]})]})});W5.displayName="FormFieldRow";const Z8e=e=>{if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)},X8e=e=>{const t=e.output??e.input??{},n=Array.isArray(t.fields)?t.fields.map(r=>({name:typeof r?.name=="string"?r.name:"",label:typeof r?.label=="string"?r.label:void 0,value:Z8e(r?.value),inputType:typeof r?.inputType=="string"?r.inputType:void 0,options:Array.isArray(r?.options)?r.options:void 0})).filter(r=>r.name.length>0):[];return{formId:typeof t.formId=="string"?t.formId:void 0,formName:typeof t.formName=="string"?t.formName:void 0,fields:n,notes:typeof t.notes=="string"?t.notes:void 0}},K5=({call:e,chatId:t})=>{const n=ht(),r=ee.useMemo(()=>X8e(e),[e]),[a,i]=ee.useState(new Set),o=ee.useMemo(()=>{const M=(e.output??{})?._mp?.lastAction,S=typeof M?.action=="string"?M.action:void 0,E=typeof M?.at=="string"?M.at:void 0;return{action:S,at:E}},[e.output]),s=ee.useMemo(()=>o.action==="apply",[o.action]),l=ee.useMemo(()=>o.action==="reject",[o.action]),u=ee.useMemo(()=>e.status===exports.AgentToolCallStatus.Succeeded&&!!r.formId&&r.fields.length>0&&!s,[e.status,r.formId,r.fields.length,s]),d=ee.useMemo(()=>e.status===exports.AgentToolCallStatus.Succeeded&&!!r.formId&&r.fields.length>0&&!s&&!l,[e.status,r.formId,r.fields.length,s,l]),p=ee.useCallback(async k=>{r.formId&&n.transport.recordToolCallAction&&await n.transport.recordToolCallAction(t,{toolCallId:e.id,action:k.action,data:{formId:r.formId,formName:r.formName,fields:k.fields},systemMessage:k.action==="apply"?`Applied ${k.fields.length} field(s) to ${r.formName??r.formId}.`:`Rejected ${r.formName??r.formId} suggestion.`},{excludeSocketId:!1})},[r.formId,r.formName,t,e.id,n.transport]),m=ee.useCallback(async k=>{if(r.formId){try{await p({action:"apply",fields:k})}catch{return}n.events.dispatchEvent(new CustomEvent(Hd,{detail:{chatId:t,toolCallId:e.id,formId:r.formId,...r.formName?{formName:r.formName}:{},fields:k}}))}},[r.formId,r.formName,t,e.id,n.events,p]),h=ee.useCallback(async()=>{if(r.formId)try{await p({action:"reject",fields:r.fields})}catch{return}},[r.formId,r.fields,p]),g=ee.useCallback(k=>{i(w=>{if(w.has(k)){if(w.size===1)return new Set;const M=new Set(w);return M.delete(k),M}else{const M=new Set(w);return M.add(k),M}})},[]),y=ee.useCallback(k=>{m([k])},[m]),v=ee.useCallback(()=>{m(r.fields)},[m,r.fields]);if(e.status===exports.AgentToolCallStatus.Failed&&e.error)return T.jsx("div",{className:"mp-agent-tool-body",children:T.jsx("div",{className:"mp-agent-tool-simple-message",children:"Failed to propose form values"})});if(e.status!==exports.AgentToolCallStatus.Succeeded)return T.jsx("div",{className:"mp-agent-tool-simple-message",children:"Preparing form fill proposal…"});if(!r.formId||r.fields.length===0)return T.jsx("div",{className:"mp-agent-tool-simple-message",children:"No form fields proposed."});const _=ee.useMemo(()=>r.formName?`Proposed values for ${r.formName} (${r.formId})`:`Proposed values for ${r.formId}`,[r.formName,r.formId]);return T.jsxs("div",{className:"mp-agent-tool-body",children:[T.jsx("div",{className:"mp-agent-tool-simple-message",children:_}),r.notes?T.jsx("div",{className:"mp-agent-tool-simple-message",children:r.notes}):null,T.jsx("div",{className:"mp-agent-form-proposal-fields",children:r.fields.map(k=>T.jsx(W5,{field:k,isExpanded:a.has(k.name),canApply:u,onToggleExpand:g,onApply:y},k.name))}),T.jsxs("div",{className:"mp-agent-form-proposal-actions",children:[(s||l)&&T.jsxs("div",{className:"mp-agent-form-proposal-status",children:[T.jsx("span",{className:`mp-agent-form-proposal-badge ${s?"is-applied":"is-rejected"}`,children:s?"Applied":"Rejected"}),o.at?T.jsx("span",{className:"mp-agent-form-proposal-status-time",children:T.jsx(H7,{date:o.at})}):null]}),!d&&!u?null:T.jsxs(T.Fragment,{children:[T.jsx("button",{type:"button",disabled:!d,onClick:h,className:"mp-agent-form-proposal-reject",children:"Reject"}),T.jsx("button",{type:"button",disabled:!u,onClick:v,className:"mp-agent-form-proposal-apply-all",children:"Apply all"})]})]})]})},_o=e=>{const{id:t,name:n,url:r,capturedAt:a,source:i,security:o,target:s,kind:l,...u}=e,d=r??i?.url,p=i||d?{...i??{},...d?{url:d}:{}}:void 0,m=l==="webSnippet"||l==="formSnapshot"||l==="formField"?!0:void 0,h=o||(m!==void 0?{containsPII:m,redactionsApplied:[]}:void 0),g=typeof n=="string"&&n.trim().length?n.trim():l==="webSnippet"?u?.title?`Selection: ${String(u.title)}`:"Selection":l==="formField"?"Form field":l==="formSnapshot"?"Form snapshot":"Context";return{id:t??Tt.nanoid(),type:exports.AgentAttachmentType.Context,name:g,...d?{url:d}:{},metadata:{schemaVersion:1,kind:l,capturedAt:a??new Date().toISOString(),...p?{source:p}:{},...h?{security:h}:{},...s?{target:s}:{},...u}}},Q8e=e=>{try{const t=new URL(e),n=`${t.searchParams.toString()} ${t.hash}`.toLowerCase();return/(token|key|auth|session|code|password|secret|email)/.test(n)}catch{return/(token|key|auth|session|code|password|secret|email)/.test(e.toLowerCase())}},Y5=(e={})=>{if(typeof window>"u")return;const t=e.url??window.location?.href;if(!t)return;const n=e.includeTitle!==!1,r=e.includeReferrer!==!1,a=e.includeViewport!==!1,i=e.includeUserAgent===!0,o=n&&typeof document<"u"?document.title:void 0,s=r&&typeof document<"u"?document.referrer:void 0;let l;try{l=new URL(t)}catch{}const u={url:t,...l?{origin:l.origin,pathname:l.pathname,search:l.search,hash:l.hash}:{},...n&&o?{title:o}:{},...r&&s?{referrer:s}:{},...i&&typeof navigator<"u"?{userAgent:navigator.userAgent}:{},...typeof navigator<"u"&&navigator.language?{language:navigator.language}:{},...typeof Intl<"u"?{timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,locale:Intl.DateTimeFormat().resolvedOptions().locale}:{},...a&&typeof window<"u"?{viewport:{width:window.innerWidth,height:window.innerHeight,devicePixelRatio:window.devicePixelRatio}}:{},...e.extra?e.extra:{}},d=Q8e(t)?!0:void 0;return _o({kind:"pageContext",name:e.name??"Page context",url:t,title:o,summary:l?`${l.pathname}${l.search}${l.hash}`:void 0,data:u,source:{app:"browser",url:t,route:l?`${l.pathname}${l.search}${l.hash}`:void 0},...d?{security:{containsPII:!0,redactionsApplied:[]}}:{}})},Z5=()=>{if(typeof window>"u"||typeof document>"u")return;const e=window.getSelection?.();if(!e||e.rangeCount===0)return;const t=e.getRangeAt(0),n=e.toString().trim();if(!n)return;const r=(t.commonAncestorContainer.nodeType===Node.ELEMENT_NODE?t.commonAncestorContainer:t.commonAncestorContainer.parentElement)??void 0,a=r?J8e(r):void 0,i=r?.textContent??"",o=i.indexOf(n),s=o>=0?o:void 0,l=o>=0?o+n.length:void 0,u=o>=0?i.slice(Math.max(0,o-80),o).trim():void 0,d=o>=0?i.slice(o+n.length,o+n.length+80).trim():void 0;return{selectedText:n,target:{type:"text",exact:n,...u?{prefix:u}:{},...d?{suffix:d}:{},...a?{domPath:a}:{},...s!==void 0?{startOffset:s}:{},...l!==void 0?{endOffset:l}:{}}}},J8e=e=>{if(e.id)return`#${o2(e.id)}`;const t=[];let n=e;for(;n&&n.nodeType===1&&t.length<6;){const r=n.tagName.toLowerCase();if(n.id){t.unshift(`#${o2(n.id)}`);break}const a=n.parentElement;if(!a){t.unshift(r);break}const o=Array.from(a.children).filter(s=>s.tagName===n.tagName).indexOf(n)+1;t.unshift(`${r}:nth-of-type(${o})`),n=a}return t.join(" > ")},o2=e=>e.replace(/[^a-zA-Z0-9_-]/g,"\\$&");class X5{constructor(t){this.rawConfig=t,this.events=new EventTarget;const n=td.parse(t);this.config={...n,toolRenderers:t.toolRenderers,tools:t.tools,pageContext:t.pageContext?{...n.pageContext,...t.pageContext}:n.pageContext,translations:t.translations?{...Fi,...t.translations}:Fi},this.transport=this.createTransport(this.config.transport),this.tools=new B7(this.config.tools),this.tools.bindInvoke(this.invokeTool.bind(this)),this.configureTransportAfterCreate(this.transport),Object.entries(t.toolRenderers??{}).forEach(([r,a])=>{a&&this.toolRendererMap.set(r,a)}),this.toolRendererMap.has("propose_form_values")||this.toolRendererMap.set("propose_form_values",K5),this.queryClient=new io.QueryClient({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1}}})}config;transport;tools;queryClient;events;toolRendererMap=new Map;storeRef;pageContextProviders=new Set;createTransport(t){return t.mode==="proxy"?new jr(t):new Wo(t)}configureTransportAfterCreate(t){this.config.transport.mode==="direct"&&t instanceof Wo&&(t.setToolRegistry(this.tools),t.setContextKeys(this.config.contextKeys.map(n=>({key:n.key,tools:n.tools}))),this.config.models&&t.setModels(this.config.models),t.setUntitledChatText(this.config.translations.untitledChat))}updateTransportConfig(t){const n=td.parse({...this.rawConfig,transport:t}),r=this.config.transport,a=this.transport;this.rawConfig={...this.rawConfig,transport:t},this.config.transport=n.transport;const i=this.config.transport.mode;if(r.mode!==i){a.cancelStream?.(),this.transport=this.createTransport(this.config.transport),this.configureTransportAfterCreate(this.transport),this.events.dispatchEvent(new CustomEvent("runtime:transport-config-changed",{detail:{previous:r,next:this.config.transport}}));return}i==="proxy"&&a instanceof jr?a.updateConfig(this.config.transport):i==="direct"&&a instanceof Wo?(a.updateConfig(this.config.transport),this.configureTransportAfterCreate(a)):(a.cancelStream?.(),this.transport=this.createTransport(this.config.transport),this.configureTransportAfterCreate(this.transport)),this.events.dispatchEvent(new CustomEvent("runtime:transport-config-changed",{detail:{previous:r,next:this.config.transport}}))}setTransportHeaders(t){const n=this.config.transport;this.updateTransportConfig({...n,headers:t})}mergeTransportHeaders(t){const n=this.config.transport;this.updateTransportConfig({...n,headers:{...n.headers??{},...t}})}removeTransportHeaders(t){const n=this.config.transport;if(!n.headers||t.length===0)return;const r={...n.headers};for(const a of t)delete r[a];this.updateTransportConfig({...n,headers:Object.keys(r).length?r:void 0})}get defaultContextKey(){return this.config.defaultContextKey??this.config.contextKeys[0]?.key}get store(){if(!this.storeRef)throw new Error("AgentRuntime store has not been attached yet");return this.storeRef}attachStore(t){this.storeRef=t}registerTool(t){this.tools.register(t)}registerToolRenderer(t,n){this.toolRendererMap.set(t,n)}registerPageContextProvider(t){return this.pageContextProviders.add(t),()=>{this.pageContextProviders.delete(t)}}getPageContextInput(){if(typeof window>"u")return{};const t=window.location?.href;let n;if(t)try{const a=new URL(t);n=`${a.pathname}${a.search}${a.hash}`}catch{}const r=typeof document<"u"?document.title:void 0;return{url:t,route:n,title:r}}getPageContextData(t){const n=t??this.getPageContextInput(),r={};let a=!1;const i=this.config.pageContext?.getData;if(i)try{const o=i(n);o&&typeof o=="object"&&(Object.assign(r,o),a=!0)}catch{}for(const o of this.pageContextProviders)try{const s=o(n);s&&typeof s=="object"&&(Object.assign(r,s),a=!0)}catch{}return a?r:void 0}buildPageContextAttachment(){const t=this.config.pageContext,n=this.getPageContextData();return Y5({...t?.includeUserAgent!==void 0?{includeUserAgent:t.includeUserAgent}:{},...t?.includeReferrer!==void 0?{includeReferrer:t.includeReferrer}:{},...t?.includeViewport!==void 0?{includeViewport:t.includeViewport}:{},...t?.includeTitle!==void 0?{includeTitle:t.includeTitle}:{},...t?.name?{name:t.name}:{},...n?{extra:n}:{}})}getToolRenderer(t){return this.toolRendererMap.get(t.name)}ensureStore(t){if(!this.storeRef)throw new Error(`Cannot ${t} before AgentRuntime is mounted`);return this.storeRef}resolveChatId(t){const r=this.ensureStore("invoke tools").getState(),a=t?.chatId??r.activeChatId;if(!a||!r.chats[a])throw new Error("Tool invocation requires an active chat. Select or create a chat first.");return a}buildToolContext(t){const n=this.ensureStore("create tool context");return{chatId:t,agentId:this.config.appId,workspaceId:this.config.workspaceId,appendSystemMessage:r=>{n.getState().appendSystemMessage(t,r)}}}writeToolCall(t,n){this.ensureStore("write tool call").getState().upsertToolCall(t,{...n})}async invokeTool(t,n={},r){const a=this.resolveChatId(r),i={id:Tt.nanoid(),name:t,input:n,status:exports.AgentToolCallStatus.Running};this.writeToolCall(a,i);const o=this.buildToolContext(a);try{const s=await this.tools.execute(t,n,o,i);return this.writeToolCall(a,s),s}catch(s){const l={...i,status:exports.AgentToolCallStatus.Failed,error:s instanceof Error?s.message:"Unknown tool error"};throw this.writeToolCall(a,l),s}}}const e7e={background:"#050505",surface:"#0f0f11",text:"#f7f7f7",subtext:"#8f9baa",border:"#1f2229",accent:"#6c63ff",accentSoft:"rgba(108, 99, 255, 0.14)",warning:"#ffb347",danger:"#ff5f56",fontFamily:'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',radius:"12px",fontSize:"14px"},Q5=e=>({...e7e,...e}),J5=ee.createContext(Q5()),t7e=e=>({"--mp-agents-bg":e.background,"--mp-agents-surface":e.surface,"--mp-agents-text":e.text,"--mp-agents-subtext":e.subtext,"--mp-agents-border":e.border,"--mp-agents-accent":e.accent,"--mp-agents-accent-soft":e.accentSoft,"--mp-agents-warning":e.warning,"--mp-agents-danger":e.danger,"--mp-agents-radius":e.radius,"--mp-agents-font-size":e.fontSize}),e3=({value:e,children:t})=>{const n=ee.useMemo(()=>Q5(e),[e]);return T.jsxs(J5.Provider,{value:n,children:[T.jsx("style",{children:`:root {
|
|
8319
|
+
*/var h6e=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],od=h6e.join(","),f5=typeof Element>"u",Ea=f5?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ji=!f5&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Ma=function(t,n){var r;n===void 0&&(n=!0);var a=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=a===""||a==="true",o=i||n&&t&&Ma(t.parentNode);return o},m6e=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},f6e=function(t,n,r){if(Ma(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(od));return n&&Ea.call(t,od)&&a.unshift(t),a=a.filter(r),a},sd=function(t,n,r){for(var a=[],i=Array.from(t);i.length;){var o=i.shift();if(!Ma(o,!1))if(o.tagName==="SLOT"){var s=o.assignedElements(),l=s.length?s:o.children,u=sd(l,!0,r);r.flatten?a.push.apply(a,u):a.push({scopeParent:o,candidates:u})}else{var d=Ea.call(o,od);d&&r.filter(o)&&(n||!t.includes(o))&&a.push(o);var p=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),m=!Ma(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(p&&m){var h=sd(p===!0?o.children:p.children,!0,r);r.flatten?a.push.apply(a,h):a.push({scopeParent:o,candidates:h})}else i.unshift.apply(i,o.children)}}return a},g5=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},y5=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||m6e(t))&&!g5(t)?0:t.tabIndex},g6e=function(t,n){var r=y5(t);return r<0&&n&&!g5(t)?0:r},y6e=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},b5=function(t){return t.tagName==="INPUT"},b6e=function(t){return b5(t)&&t.type==="hidden"},k6e=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},v6e=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},_6e=function(t){if(!t.name)return!0;var n=t.form||ji(t),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=r(window.CSS.escape(t.name));else try{a=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var i=v6e(a,t.form);return!i||i===t},w6e=function(t){return b5(t)&&t.type==="radio"},x6e=function(t){return w6e(t)&&!_6e(t)},E6e=function(t){var n,r=t&&ji(t),a=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var o,s,l;for(i=!!((o=a)!==null&&o!==void 0&&(s=o.ownerDocument)!==null&&s!==void 0&&s.contains(a)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&a;){var u,d,p;r=ji(a),a=(u=r)===null||u===void 0?void 0:u.host,i=!!((d=a)!==null&&d!==void 0&&(p=d.ownerDocument)!==null&&p!==void 0&&p.contains(a))}}return i},zh=function(t){var n=t.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},M6e=function(t,n){var r=n.displayCheck,a=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var i=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(t).visibility==="hidden")return!0;var o=Ea.call(t,"details>summary:first-of-type"),s=o?t.parentElement:t;if(Ea.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof a=="function"){for(var l=t;t;){var u=t.parentElement,d=ji(t);if(u&&!u.shadowRoot&&a(u)===!0)return zh(t);t.assignedSlot?t=t.assignedSlot:!u&&d!==t.ownerDocument?t=d.host:t=u}t=l}if(E6e(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return zh(t);return!1},S6e=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var a=n.children.item(r);if(a.tagName==="LEGEND")return Ea.call(n,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}n=n.parentElement}return!1},N6e=function(t,n){return!(n.disabled||Ma(n)||b6e(n)||M6e(n,t)||k6e(n)||S6e(n))},$h=function(t,n){return!(x6e(n)||y5(n)<0||!N6e(t,n))},A6e=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},k5=function(t){var n=[],r=[];return t.forEach(function(a,i){var o=!!a.scopeParent,s=o?a.scopeParent:a,l=g6e(s,o),u=o?k5(a.candidates):s;l===0?o?n.push.apply(n,u):n.push(s):r.push({documentOrder:i,tabIndex:l,item:a,isScope:o,content:u})}),r.sort(y6e).reduce(function(a,i){return i.isScope?a.push.apply(a,i.content):a.push(i.content),a},[]).concat(n)},v5=function(t,n){n=n||{};var r;return n.getShadowRoot?r=sd([t],n.includeContainer,{filter:$h.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:A6e}):r=f6e(t,n.includeContainer,$h.bind(null,n)),k5(r)};function _5(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function w5(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function x5(){return/apple/i.test(navigator.vendor)}function ld(){const e=/android/i;return e.test(_5())||e.test(w5())}function T6e(){return _5().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function E5(){return w5().includes("jsdom/")}const Fh="data-floating-ui-focusable",C6e="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ko="ArrowLeft",Yo="ArrowRight",R6e="ArrowUp",I6e="ArrowDown";function Sa(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function xr(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&rd(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Pr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Zo(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function O6e(e){return e.matches("html,body")}function yn(e){return e?.ownerDocument||document}function Yd(e){return Rt(e)&&e.matches(C6e)}function L6e(e){return e?e.getAttribute("role")==="combobox"&&Yd(e):!1}function D6e(e){if(!e||E5())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function M5(e){return e?e.hasAttribute(Fh)?e:e.querySelector("["+Fh+"]")||e:null}function ba(e,t,n){return n===void 0&&(n=!0),e.filter(a=>{var i;return a.parentId===t&&(!n||((i=a.context)==null?void 0:i.open))}).flatMap(a=>[a,...ba(e,a.id,n)])}function z6e(e,t){let n,r=-1;function a(i,o){o>r&&(n=i,r=o),ba(e,i).forEach(l=>{a(l.id,o+1)})}return a(t,0),e.find(i=>i.id===n)}function rn(e){e.preventDefault(),e.stopPropagation()}function $6e(e){return"nativeEvent"in e}function F6e(e){return e.mozInputSource===0&&e.isTrusted?!0:ld()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function P6e(e){return E5()?!1:!ld()&&e.width===0&&e.height===0||ld()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Na(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var B6e=typeof document<"u",q6e=function(){},Nt=B6e?ee.useLayoutEffect:q6e;const U6e={...ne};function Pn(e){const t=ne.useRef(e);return Nt(()=>{t.current=e}),t}const H6e=U6e.useInsertionEffect,j6e=H6e||(e=>e());function Xt(e){const t=ne.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return j6e(()=>{t.current=e}),ne.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t.current==null?void 0:t.current(...r)},[])}function Ja(e,t,n){return Math.floor(e/t)!==n}function ka(e,t){return t<0||t>=e.current.length}function Xo(e,t){return At(e,{disabledIndices:t})}function Ph(e,t){return At(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function At(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:a,amount:i=1}=t===void 0?{}:t,o=n;do o+=r?-i:i;while(o>=0&&o<=e.current.length-1&&Ni(e,o,a));return o}function V6e(e,t){let{event:n,orientation:r,loop:a,rtl:i,cols:o,disabledIndices:s,minIndex:l,maxIndex:u,prevIndex:d,stopEvent:p=!1}=t,m=d;if(n.key===R6e){if(p&&rn(n),d===-1)m=u;else if(m=At(e,{startingIndex:m,amount:o,decrement:!0,disabledIndices:s}),a&&(d-o<l||m<0)){const h=d%o,g=u%o,y=u-(g-h);g===h?m=u:m=g>h?y:y-o}ka(e,m)&&(m=d)}if(n.key===I6e&&(p&&rn(n),d===-1?m=l:(m=At(e,{startingIndex:d,amount:o,disabledIndices:s}),a&&d+o>u&&(m=At(e,{startingIndex:d%o-o,amount:o,disabledIndices:s}))),ka(e,m)&&(m=d)),r==="both"){const h=Vr(d/o);n.key===(i?Ko:Yo)&&(p&&rn(n),d%o!==o-1?(m=At(e,{startingIndex:d,disabledIndices:s}),a&&Ja(m,o,h)&&(m=At(e,{startingIndex:d-d%o-1,disabledIndices:s}))):a&&(m=At(e,{startingIndex:d-d%o-1,disabledIndices:s})),Ja(m,o,h)&&(m=d)),n.key===(i?Yo:Ko)&&(p&&rn(n),d%o!==0?(m=At(e,{startingIndex:d,decrement:!0,disabledIndices:s}),a&&Ja(m,o,h)&&(m=At(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:s}))):a&&(m=At(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:s})),Ja(m,o,h)&&(m=d));const g=Vr(u/o)===h;ka(e,m)&&(a&&g?m=n.key===(i?Yo:Ko)?u:At(e,{startingIndex:d-d%o-1,disabledIndices:s}):m=d)}return m}function G6e(e,t,n){const r=[];let a=0;return e.forEach((i,o)=>{let{width:s,height:l}=i;if(s>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+o+" is greater than grid columns");let u=!1;for(n&&(a=0);!u;){const d=[];for(let p=0;p<s;p++)for(let m=0;m<l;m++)d.push(a+p+m*t);a%t+s<=t&&d.every(p=>r[p]==null)?(d.forEach(p=>{r[p]=o}),u=!0):a++}}),[...r]}function W6e(e,t,n,r,a){if(e===-1)return-1;const i=n.indexOf(e),o=t[e];switch(a){case"tl":return i;case"tr":return o?i+o.width-1:i;case"bl":return o?i+(o.height-1)*r:i;case"br":return n.lastIndexOf(e)}}function K6e(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Ni(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const r=e.current[t];return r==null||r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true"}const S5=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function N5(e,t){const n=v5(e,S5()),r=n.length;if(r===0)return;const a=Sa(yn(e)),i=n.indexOf(a),o=i===-1?t===1?0:r-1:i+t;return n[o]}function Y6e(e){return N5(yn(e).body,1)||e}function Z6e(e){return N5(yn(e).body,-1)||e}function Qo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!xr(n,r)}function X6e(e){v5(e,S5()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Bh(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function qh(e,t,n){let{reference:r,floating:a}=e;const i=er(t),o=m5(t),s=h5(o),l=wr(t),u=i==="y",d=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,m=r[s]/2-a[s]/2;let h;switch(l){case"top":h={x:d,y:r.y-a.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:p};break;case"left":h={x:r.x-a.width,y:p};break;default:h={x:r.x,y:r.y}}switch(fo(t)){case"start":h[o]-=m*(n&&u?-1:1);break;case"end":h[o]+=m*(n&&u?-1:1);break}return h}const Q6e=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:o}=n,s=i.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:p}=qh(u,r,l),m=r,h={},g=0;for(let y=0;y<s.length;y++){const{name:v,fn:_}=s[y],{x:k,y:w,data:M,reset:S}=await _({x:d,y:p,initialPlacement:r,placement:m,strategy:a,middlewareData:h,rects:u,platform:o,elements:{reference:e,floating:t}});d=k??d,p=w??p,h={...h,[v]:{...h[v],...M}},S&&g<=50&&(g++,typeof S=="object"&&(S.placement&&(m=S.placement),S.rects&&(u=S.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):S.rects),{x:d,y:p}=qh(u,m,l)),y=-1)}return{x:d,y:p,placement:m,strategy:a,middlewareData:h}};async function A5(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:o,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:m=!1,padding:h=0}=mo(t,e),g=p6e(h),v=s[m?p==="floating"?"reference":"floating":p],_=Hi(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:d,strategy:l})),k=p==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),M=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},S=Hi(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:k,offsetParent:w,strategy:l}):k);return{top:(_.top-S.top+g.top)/M.y,bottom:(S.bottom-_.bottom+g.bottom)/M.y,left:(_.left-S.left+g.left)/M.x,right:(S.right-_.right+g.right)/M.x}}const J6e=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:o,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...v}=mo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const _=wr(a),k=er(s),w=wr(s)===s,M=await(l.isRTL==null?void 0:l.isRTL(u.floating)),S=m||(w||!y?[Ui(s)]:o6e(s)),E=g!=="none";!m&&E&&S.push(...u6e(s,y,g,M));const F=[s,...S],P=await A5(t,v),R=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&R.push(P[_]),p){const V=i6e(a,o,M);R.push(P[V[0]],P[V[1]])}if(D=[...D,{placement:a,overflows:R}],!R.every(V=>V<=0)){var W,K;const V=(((W=i.flip)==null?void 0:W.index)||0)+1,I=F[V];if(I&&(!(p==="alignment"?k!==er(I):!1)||D.every(C=>er(C.placement)===k?C.overflows[0]>0:!0)))return{data:{index:V,overflows:D},reset:{placement:I}};let q=(K=D.filter(G=>G.overflows[0]<=0).sort((G,C)=>G.overflows[1]-C.overflows[1])[0])==null?void 0:K.placement;if(!q)switch(h){case"bestFit":{var J;const G=(J=D.filter(C=>{if(E){const Y=er(C.placement);return Y===k||Y==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(Y=>Y>0).reduce((Y,N)=>Y+N,0)]).sort((C,Y)=>C[1]-Y[1])[0])==null?void 0:J[0];G&&(q=G);break}case"initialPlacement":q=s;break}if(a!==q)return{reset:{placement:q}}}return{}}}},e8e=new Set(["left","top"]);async function t8e(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=wr(n),s=fo(n),l=er(n)==="y",u=e8e.has(o)?-1:1,d=i&&l?-1:1,p=mo(t,e);let{mainAxis:m,crossAxis:h,alignmentAxis:g}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return s&&typeof g=="number"&&(h=s==="end"?g*-1:g),l?{x:h*d,y:m*u}:{x:m*u,y:h*d}}const n8e=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:o,middlewareData:s}=t,l=await t8e(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:a+l.x,y:i+l.y,data:{...l,placement:o}}}}},r8e=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:s={fn:v=>{let{x:_,y:k}=v;return{x:_,y:k}}},...l}=mo(e,t),u={x:n,y:r},d=await A5(t,l),p=er(wr(a)),m=p5(p);let h=u[m],g=u[p];if(i){const v=m==="y"?"top":"left",_=m==="y"?"bottom":"right",k=h+d[v],w=h-d[_];h=Oh(k,h,w)}if(o){const v=p==="y"?"top":"left",_=p==="y"?"bottom":"right",k=g+d[v],w=g-d[_];g=Oh(k,g,w)}const y=s.fn({...t,[m]:h,[p]:g});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[m]:i,[p]:o}}}}}};function T5(e){const t=dn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Rt(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,s=qi(n)!==i||qi(r)!==o;return s&&(n=i,r=o),{width:n,height:r,$:s}}function Zd(e){return ot(e)?e:e.contextElement}function Wr(e){const t=Zd(e);if(!Rt(t))return Nn(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=T5(t);let o=(i?qi(n.width):n.width)/r,s=(i?qi(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const a8e=Nn(0);function C5(e){const t=jt(e);return!po()||!t.visualViewport?a8e:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function i8e(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==jt(e)?!1:t}function Er(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=Zd(e);let o=Nn(1);t&&(r?ot(r)&&(o=Wr(r)):o=Wr(e));const s=i8e(i,n,r)?C5(i):Nn(0);let l=(a.left+s.x)/o.x,u=(a.top+s.y)/o.y,d=a.width/o.x,p=a.height/o.y;if(i){const m=jt(i),h=r&&ot(r)?jt(r):r;let g=m,y=ad(g);for(;y&&r&&h!==g;){const v=Wr(y),_=y.getBoundingClientRect(),k=dn(y),w=_.left+(y.clientLeft+parseFloat(k.paddingLeft))*v.x,M=_.top+(y.clientTop+parseFloat(k.paddingTop))*v.y;l*=v.x,u*=v.y,d*=v.x,p*=v.y,l+=w,u+=M,g=jt(y),y=ad(g)}}return Hi({width:d,height:p,x:l,y:u})}function go(e,t){const n=ho(e).scrollLeft;return t?t.left+n:Er(Cn(e)).left+n}function R5(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-go(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function o8e(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=Cn(r),s=t?uo(t.floating):!1;if(r===o||s&&i)return n;let l={scrollLeft:0,scrollTop:0},u=Nn(1);const d=Nn(0),p=Rt(r);if((p||!p&&!i)&&((Jr(r)!=="body"||Fa(o))&&(l=ho(r)),Rt(r))){const h=Er(r);u=Wr(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const m=o&&!p&&!i?R5(o,l):Nn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+m.x,y:n.y*u.y-l.scrollTop*u.y+d.y+m.y}}function s8e(e){return Array.from(e.getClientRects())}function l8e(e){const t=Cn(e),n=ho(e),r=e.ownerDocument.body,a=vr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=vr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+go(e);const s=-n.scrollTop;return dn(r).direction==="rtl"&&(o+=vr(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:s}}const Uh=25;function c8e(e,t){const n=jt(e),r=Cn(e),a=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,s=0,l=0;if(a){i=a.width,o=a.height;const d=po();(!d||d&&t==="fixed")&&(s=a.offsetLeft,l=a.offsetTop)}const u=go(r);if(u<=0){const d=r.ownerDocument,p=d.body,m=getComputedStyle(p),h=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,g=Math.abs(r.clientWidth-p.clientWidth-h);g<=Uh&&(i-=g)}else u<=Uh&&(i+=u);return{width:i,height:o,x:s,y:l}}const u8e=new Set(["absolute","fixed"]);function d8e(e,t){const n=Er(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Rt(e)?Wr(e):Nn(1),o=e.clientWidth*i.x,s=e.clientHeight*i.y,l=a*i.x,u=r*i.y;return{width:o,height:s,x:l,y:u}}function Hh(e,t,n){let r;if(t==="viewport")r=c8e(e,n);else if(t==="document")r=l8e(Cn(e));else if(ot(t))r=d8e(t,n);else{const a=C5(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Hi(r)}function I5(e,t){const n=jn(e);return n===t||!ot(n)||qn(n)?!1:dn(n).position==="fixed"||I5(n,t)}function p8e(e,t){const n=t.get(e);if(n)return n;let r=rr(e,[],!1).filter(s=>ot(s)&&Jr(s)!=="body"),a=null;const i=dn(e).position==="fixed";let o=i?jn(e):e;for(;ot(o)&&!qn(o);){const s=dn(o),l=Kd(o);!l&&s.position==="fixed"&&(a=null),(i?!l&&!a:!l&&s.position==="static"&&!!a&&u8e.has(a.position)||Fa(o)&&!l&&I5(e,o))?r=r.filter(d=>d!==o):a=s,o=jn(o)}return t.set(e,r),r}function h8e(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?uo(t)?[]:p8e(t,this._c):[].concat(n),r],s=o[0],l=o.reduce((u,d)=>{const p=Hh(t,d,a);return u.top=vr(p.top,u.top),u.right=Bi(p.right,u.right),u.bottom=Bi(p.bottom,u.bottom),u.left=vr(p.left,u.left),u},Hh(t,s,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function m8e(e){const{width:t,height:n}=T5(e);return{width:t,height:n}}function f8e(e,t,n){const r=Rt(t),a=Cn(t),i=n==="fixed",o=Er(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Nn(0);function u(){l.x=go(a)}if(r||!r&&!i)if((Jr(t)!=="body"||Fa(a))&&(s=ho(t)),r){const h=Er(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else a&&u();i&&!r&&a&&u();const d=a&&!r&&!i?R5(a,s):Nn(0),p=o.left+s.scrollLeft-l.x-d.x,m=o.top+s.scrollTop-l.y-d.y;return{x:p,y:m,width:o.width,height:o.height}}function Jo(e){return dn(e).position==="static"}function jh(e,t){if(!Rt(e)||dn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Cn(e)===n&&(n=n.ownerDocument.body),n}function O5(e,t){const n=jt(e);if(uo(e))return n;if(!Rt(e)){let a=jn(e);for(;a&&!qn(a);){if(ot(a)&&!Jo(a))return a;a=jn(a)}return n}let r=jh(e,t);for(;r&&Yve(r)&&Jo(r);)r=jh(r,t);return r&&qn(r)&&Jo(r)&&!Kd(r)?n:r||e6e(e)||n}const g8e=async function(e){const t=this.getOffsetParent||O5,n=this.getDimensions,r=await n(e.floating);return{reference:f8e(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function y8e(e){return dn(e).direction==="rtl"}const b8e={convertOffsetParentRelativeRectToViewportRelativeRect:o8e,getDocumentElement:Cn,getClippingRect:h8e,getOffsetParent:O5,getElementRects:g8e,getClientRects:s8e,getDimensions:m8e,getScale:Wr,isElement:ot,isRTL:y8e};function L5(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function k8e(e,t){let n=null,r;const a=Cn(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:d,top:p,width:m,height:h}=u;if(s||t(),!m||!h)return;const g=Vr(p),y=Vr(a.clientWidth-(d+m)),v=Vr(a.clientHeight-(p+h)),_=Vr(d),w={rootMargin:-g+"px "+-y+"px "+-v+"px "+-_+"px",threshold:vr(0,Bi(1,l))||1};let M=!0;function S(E){const F=E[0].intersectionRatio;if(F!==l){if(!M)return o();F?o(!1,F):r=setTimeout(()=>{o(!1,1e-7)},1e3)}F===1&&!L5(u,e.getBoundingClientRect())&&o(),M=!1}try{n=new IntersectionObserver(S,{...w,root:a.ownerDocument})}catch{n=new IntersectionObserver(S,w)}n.observe(e)}return o(!0),i}function D5(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Zd(e),d=a||i?[...u?rr(u):[],...rr(t)]:[];d.forEach(_=>{a&&_.addEventListener("scroll",n,{passive:!0}),i&&_.addEventListener("resize",n)});const p=u&&s?k8e(u,n):null;let m=-1,h=null;o&&(h=new ResizeObserver(_=>{let[k]=_;k&&k.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g,y=l?Er(e):null;l&&v();function v(){const _=Er(e);y&&!L5(y,_)&&n(),y=_,g=requestAnimationFrame(v)}return n(),()=>{var _;d.forEach(k=>{a&&k.removeEventListener("scroll",n),i&&k.removeEventListener("resize",n)}),p?.(),(_=h)==null||_.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const v8e=n8e,_8e=r8e,w8e=J6e,x8e=(e,t,n)=>{const r=new Map,a={platform:b8e,...n},i={...a.platform,_c:r};return Q6e(e,t,{...a,platform:i})};var E8e=typeof document<"u",M8e=function(){},Ai=E8e?ee.useLayoutEffect:M8e;function Vi(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Vi(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Vi(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function z5(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Vh(e,t){const n=z5(e);return Math.round(t*n)/n}function es(e){const t=ne.useRef(e);return Ai(()=>{t.current=e}),t}function S8e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:o}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[d,p]=ne.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=ne.useState(r);Vi(m,r)||h(r);const[g,y]=ne.useState(null),[v,_]=ne.useState(null),k=ne.useCallback(C=>{C!==E.current&&(E.current=C,y(C))},[]),w=ne.useCallback(C=>{C!==F.current&&(F.current=C,_(C))},[]),M=i||g,S=o||v,E=ne.useRef(null),F=ne.useRef(null),P=ne.useRef(d),R=l!=null,D=es(l),W=es(a),K=es(u),J=ne.useCallback(()=>{if(!E.current||!F.current)return;const C={placement:t,strategy:n,middleware:m};W.current&&(C.platform=W.current),x8e(E.current,F.current,C).then(Y=>{const N={...Y,isPositioned:K.current!==!1};V.current&&!Vi(P.current,N)&&(P.current=N,Xk.flushSync(()=>{p(N)}))})},[m,t,n,W,K]);Ai(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,p(C=>({...C,isPositioned:!1})))},[u]);const V=ne.useRef(!1);Ai(()=>(V.current=!0,()=>{V.current=!1}),[]),Ai(()=>{if(M&&(E.current=M),S&&(F.current=S),M&&S){if(D.current)return D.current(M,S,J);J()}},[M,S,J,D,R]);const I=ne.useMemo(()=>({reference:E,floating:F,setReference:k,setFloating:w}),[k,w]),q=ne.useMemo(()=>({reference:M,floating:S}),[M,S]),G=ne.useMemo(()=>{const C={position:n,left:0,top:0};if(!q.floating)return C;const Y=Vh(q.floating,d.x),N=Vh(q.floating,d.y);return s?{...C,transform:"translate("+Y+"px, "+N+"px)",...z5(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:N}},[n,s,q.floating,d.x,d.y]);return ne.useMemo(()=>({...d,update:J,refs:I,elements:q,floatingStyles:G}),[d,J,I,q,G])}const $5=(e,t)=>({...v8e(e),options:[e,t]}),F5=(e,t)=>({..._8e(e),options:[e,t]}),P5=(e,t)=>({...w8e(e),options:[e,t]}),N8e="data-floating-ui-focusable",Gh="active",Wh="selected",Pa="ArrowLeft",Ba="ArrowRight",B5="ArrowUp",yo="ArrowDown",A8e={...ne};let Kh=!1,T8e=0;const Yh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+T8e++;function C8e(){const[e,t]=ne.useState(()=>Kh?Yh():void 0);return Nt(()=>{e==null&&t(Yh())},[]),ne.useEffect(()=>{Kh=!0},[]),e}const R8e=A8e.useId,Xd=R8e||C8e;let Aa;process.env.NODE_ENV!=="production"&&(Aa=new Set);function ts(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const a="Floating UI: "+n.join(" ");if(!((e=Aa)!=null&&e.has(a))){var i;(i=Aa)==null||i.add(a),console.warn(a)}}function I8e(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const a="Floating UI: "+n.join(" ");if(!((e=Aa)!=null&&e.has(a))){var i;(i=Aa)==null||i.add(a),console.error(a)}}function O8e(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(a=>a(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const L8e=ne.createContext(null),D8e=ne.createContext(null),bo=()=>{var e;return((e=ne.useContext(L8e))==null?void 0:e.id)||null},ko=()=>ne.useContext(D8e);function qa(e){return"data-floating-ui-"+e}function nn(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Zh=qa("safe-polygon");function ns(e,t,n){if(n&&!Na(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function rs(e){return typeof e=="function"?e():e}function z8e(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:a,events:i,elements:o}=e,{enabled:s=!0,delay:l=0,handleClose:u=null,mouseOnly:d=!1,restMs:p=0,move:m=!0}=t,h=ko(),g=bo(),y=Pn(u),v=Pn(l),_=Pn(n),k=Pn(p),w=ne.useRef(),M=ne.useRef(-1),S=ne.useRef(),E=ne.useRef(-1),F=ne.useRef(!0),P=ne.useRef(!1),R=ne.useRef(()=>{}),D=ne.useRef(!1),W=Xt(()=>{var G;const C=(G=a.current.openEvent)==null?void 0:G.type;return C?.includes("mouse")&&C!=="mousedown"});ne.useEffect(()=>{if(!s)return;function G(C){let{open:Y}=C;Y||(nn(M),nn(E),F.current=!0,D.current=!1)}return i.on("openchange",G),()=>{i.off("openchange",G)}},[s,i]),ne.useEffect(()=>{if(!s||!y.current||!n)return;function G(Y){W()&&r(!1,Y,"hover")}const C=yn(o.floating).documentElement;return C.addEventListener("mouseleave",G),()=>{C.removeEventListener("mouseleave",G)}},[o.floating,n,r,s,y,W]);const K=ne.useCallback(function(G,C,Y){C===void 0&&(C=!0),Y===void 0&&(Y="hover");const N=ns(v.current,"close",w.current);N&&!S.current?(nn(M),M.current=window.setTimeout(()=>r(!1,G,Y),N)):C&&(nn(M),r(!1,G,Y))},[v,r]),J=Xt(()=>{R.current(),S.current=void 0}),V=Xt(()=>{if(P.current){const G=yn(o.floating).body;G.style.pointerEvents="",G.removeAttribute(Zh),P.current=!1}}),I=Xt(()=>a.current.openEvent?["click","mousedown"].includes(a.current.openEvent.type):!1);ne.useEffect(()=>{if(!s)return;function G(te){if(nn(M),F.current=!1,d&&!Na(w.current)||rs(k.current)>0&&!ns(v.current,"open"))return;const O=ns(v.current,"open",w.current);O?M.current=window.setTimeout(()=>{_.current||r(!0,te,"hover")},O):n||r(!0,te,"hover")}function C(te){if(I()){V();return}R.current();const O=yn(o.floating);if(nn(E),D.current=!1,y.current&&a.current.floatingContext){n||nn(M),S.current=y.current({...a.current.floatingContext,tree:h,x:te.clientX,y:te.clientY,onClose(){V(),J(),I()||K(te,!0,"safe-polygon")}});const ge=S.current;O.addEventListener("mousemove",ge),R.current=()=>{O.removeEventListener("mousemove",ge)};return}(w.current==="touch"?!xr(o.floating,te.relatedTarget):!0)&&K(te)}function Y(te){I()||a.current.floatingContext&&(y.current==null||y.current({...a.current.floatingContext,tree:h,x:te.clientX,y:te.clientY,onClose(){V(),J(),I()||K(te)}})(te))}function N(){nn(M)}function Z(te){I()||K(te,!1)}if(ot(o.domReference)){const te=o.domReference,O=o.floating;return n&&te.addEventListener("mouseleave",Y),m&&te.addEventListener("mousemove",G,{once:!0}),te.addEventListener("mouseenter",G),te.addEventListener("mouseleave",C),O&&(O.addEventListener("mouseleave",Y),O.addEventListener("mouseenter",N),O.addEventListener("mouseleave",Z)),()=>{n&&te.removeEventListener("mouseleave",Y),m&&te.removeEventListener("mousemove",G),te.removeEventListener("mouseenter",G),te.removeEventListener("mouseleave",C),O&&(O.removeEventListener("mouseleave",Y),O.removeEventListener("mouseenter",N),O.removeEventListener("mouseleave",Z))}}},[o,s,e,d,m,K,J,V,r,n,_,h,v,y,a,I,k]),Nt(()=>{var G;if(s&&n&&(G=y.current)!=null&&(G=G.__options)!=null&&G.blockPointerEvents&&W()){P.current=!0;const Y=o.floating;if(ot(o.domReference)&&Y){var C;const N=yn(o.floating).body;N.setAttribute(Zh,"");const Z=o.domReference,te=h==null||(C=h.nodesRef.current.find(O=>O.id===g))==null||(C=C.context)==null?void 0:C.elements.floating;return te&&(te.style.pointerEvents=""),N.style.pointerEvents="none",Z.style.pointerEvents="auto",Y.style.pointerEvents="auto",()=>{N.style.pointerEvents="",Z.style.pointerEvents="",Y.style.pointerEvents=""}}}},[s,n,g,o,h,y,W]),Nt(()=>{n||(w.current=void 0,D.current=!1,J(),V())},[n,J,V]),ne.useEffect(()=>()=>{J(),nn(M),nn(E),V()},[s,o.domReference,J,V]);const q=ne.useMemo(()=>{function G(C){w.current=C.pointerType}return{onPointerDown:G,onPointerEnter:G,onMouseMove(C){const{nativeEvent:Y}=C;function N(){!F.current&&!_.current&&r(!0,Y,"hover")}d&&!Na(w.current)||n||rs(k.current)===0||D.current&&C.movementX**2+C.movementY**2<2||(nn(E),w.current==="touch"?N():(D.current=!0,E.current=window.setTimeout(N,rs(k.current))))}}},[d,r,n,_,k]);return ne.useMemo(()=>s?{reference:q}:{},[s,q])}let Xh=0;function $8e(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:a=!1}=t;r&&cancelAnimationFrame(Xh);const i=()=>e?.focus({preventScroll:n});a?i():Xh=requestAnimationFrame(i)}const q5={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Qh=ne.forwardRef(function(t,n){const[r,a]=ne.useState();Nt(()=>{x5()&&a("button")},[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[qa("focus-guard")]:"",style:q5};return T.jsx("span",{...t,...i})}),U5=ne.createContext(null),Jh=qa("portal");function F8e(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Xd(),a=B8e(),[i,o]=ne.useState(null),s=ne.useRef(null);return Nt(()=>()=>{i?.remove(),queueMicrotask(()=>{s.current=null})},[i]),Nt(()=>{if(!r||s.current)return;const l=t?document.getElementById(t):null;if(!l)return;const u=document.createElement("div");u.id=r,u.setAttribute(Jh,""),l.appendChild(u),s.current=u,o(u)},[t,r]),Nt(()=>{if(n===null||!r||s.current)return;let l=n||a?.portalNode;l&&!Wd(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));const d=document.createElement("div");d.id=r,d.setAttribute(Jh,""),l=u||l,l.appendChild(d),s.current=d,o(d)},[t,n,r,a]),i}function P8e(e){const{children:t,id:n,root:r,preserveTabOrder:a=!0}=e,i=F8e({id:n,root:r}),[o,s]=ne.useState(null),l=ne.useRef(null),u=ne.useRef(null),d=ne.useRef(null),p=ne.useRef(null),m=o?.modal,h=o?.open,g=!!o&&!o.modal&&o.open&&a&&!!(r||i);return ne.useEffect(()=>{if(!i||!a||m)return;function y(v){i&&Qo(v)&&(v.type==="focusin"?Bh:X6e)(i)}return i.addEventListener("focusin",y,!0),i.addEventListener("focusout",y,!0),()=>{i.removeEventListener("focusin",y,!0),i.removeEventListener("focusout",y,!0)}},[i,a,m]),ne.useEffect(()=>{i&&(h||Bh(i))},[h,i]),T.jsxs(U5.Provider,{value:ne.useMemo(()=>({preserveTabOrder:a,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:p,portalNode:i,setFocusManagerState:s}),[a,i]),children:[g&&i&&T.jsx(Qh,{"data-type":"outside",ref:l,onFocus:y=>{if(Qo(y,i)){var v;(v=d.current)==null||v.focus()}else{const _=o?o.domReference:null,k=Z6e(_);k?.focus()}}}),g&&i&&T.jsx("span",{"aria-owns":i.id,style:q5}),i&&Xk.createPortal(t,i),g&&i&&T.jsx(Qh,{"data-type":"outside",ref:u,onFocus:y=>{if(Qo(y,i)){var v;(v=p.current)==null||v.focus()}else{const _=o?o.domReference:null,k=Y6e(_);k?.focus(),o?.closeOnFocusOut&&o?.onOpenChange(!1,y.nativeEvent,"focus-out")}}})]})}const B8e=()=>ne.useContext(U5);function e2(e){return Rt(e.target)&&e.target.tagName==="BUTTON"}function q8e(e){return Rt(e.target)&&e.target.tagName==="A"}function t2(e){return Yd(e)}function U8e(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:a,elements:{domReference:i}}=e,{enabled:o=!0,event:s="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0,stickIfOpen:p=!0}=t,m=ne.useRef(),h=ne.useRef(!1),g=ne.useMemo(()=>({onPointerDown(y){m.current=y.pointerType},onMouseDown(y){const v=m.current;y.button===0&&s!=="click"&&(Na(v,!0)&&u||(n&&l&&(!(a.current.openEvent&&p)||a.current.openEvent.type==="mousedown")?r(!1,y.nativeEvent,"click"):(y.preventDefault(),r(!0,y.nativeEvent,"click"))))},onClick(y){const v=m.current;if(s==="mousedown"&&m.current){m.current=void 0;return}Na(v,!0)&&u||(n&&l&&(!(a.current.openEvent&&p)||a.current.openEvent.type==="click")?r(!1,y.nativeEvent,"click"):r(!0,y.nativeEvent,"click"))},onKeyDown(y){m.current=void 0,!(y.defaultPrevented||!d||e2(y))&&(y.key===" "&&!t2(i)&&(y.preventDefault(),h.current=!0),!q8e(y)&&y.key==="Enter"&&r(!(n&&l),y.nativeEvent,"click"))},onKeyUp(y){y.defaultPrevented||!d||e2(y)||t2(i)||y.key===" "&&h.current&&(h.current=!1,r(!(n&&l),y.nativeEvent,"click"))}}),[a,i,s,u,d,r,n,p,l]);return ne.useMemo(()=>o?{reference:g}:{},[o,g])}const H8e={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},j8e={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},n2=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function H5(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:a,dataRef:i}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:l=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:p="pointerdown",ancestorScroll:m=!1,bubbles:h,capture:g}=t,y=ko(),v=Xt(typeof l=="function"?l:()=>!1),_=typeof l=="function"?v:l,k=ne.useRef(!1),{escapeKey:w,outsidePress:M}=n2(h),{escapeKey:S,outsidePress:E}=n2(g),F=ne.useRef(!1),P=Xt(V=>{var I;if(!n||!o||!s||V.key!=="Escape"||F.current)return;const q=(I=i.current.floatingContext)==null?void 0:I.nodeId,G=y?ba(y.nodesRef.current,q):[];if(!w&&(V.stopPropagation(),G.length>0)){let C=!0;if(G.forEach(Y=>{var N;if((N=Y.context)!=null&&N.open&&!Y.context.dataRef.current.__escapeKeyBubbles){C=!1;return}}),!C)return}r(!1,$6e(V)?V.nativeEvent:V,"escape-key")}),R=Xt(V=>{var I;const q=()=>{var G;P(V),(G=Pr(V))==null||G.removeEventListener("keydown",q)};(I=Pr(V))==null||I.addEventListener("keydown",q)}),D=Xt(V=>{var I;const q=i.current.insideReactTree;i.current.insideReactTree=!1;const G=k.current;if(k.current=!1,u==="click"&&G||q||typeof _=="function"&&!_(V))return;const C=Pr(V),Y="["+qa("inert")+"]",N=yn(a.floating).querySelectorAll(Y);let Z=ot(C)?C:null;for(;Z&&!qn(Z);){const ge=jn(Z);if(qn(ge)||!ot(ge))break;Z=ge}if(N.length&&ot(C)&&!O6e(C)&&!xr(C,a.floating)&&Array.from(N).every(ge=>!xr(Z,ge)))return;if(Rt(C)&&J){const ge=qn(C),ve=dn(C),Re=/auto|scroll/,qe=ge||Re.test(ve.overflowX),He=ge||Re.test(ve.overflowY),re=qe&&C.clientWidth>0&&C.scrollWidth>C.clientWidth,Me=He&&C.clientHeight>0&&C.scrollHeight>C.clientHeight,Ge=ve.direction==="rtl",Je=Me&&(Ge?V.offsetX<=C.offsetWidth-C.clientWidth:V.offsetX>C.clientWidth),ze=re&&V.offsetY>C.clientHeight;if(Je||ze)return}const te=(I=i.current.floatingContext)==null?void 0:I.nodeId,O=y&&ba(y.nodesRef.current,te).some(ge=>{var ve;return Zo(V,(ve=ge.context)==null?void 0:ve.elements.floating)});if(Zo(V,a.floating)||Zo(V,a.domReference)||O)return;const pe=y?ba(y.nodesRef.current,te):[];if(pe.length>0){let ge=!0;if(pe.forEach(ve=>{var Re;if((Re=ve.context)!=null&&Re.open&&!ve.context.dataRef.current.__outsidePressBubbles){ge=!1;return}}),!ge)return}r(!1,V,"outside-press")}),W=Xt(V=>{var I;const q=()=>{var G;D(V),(G=Pr(V))==null||G.removeEventListener(u,q)};(I=Pr(V))==null||I.addEventListener(u,q)});ne.useEffect(()=>{if(!n||!o)return;i.current.__escapeKeyBubbles=w,i.current.__outsidePressBubbles=M;let V=-1;function I(N){r(!1,N,"ancestor-scroll")}function q(){window.clearTimeout(V),F.current=!0}function G(){V=window.setTimeout(()=>{F.current=!1},po()?5:0)}const C=yn(a.floating);s&&(C.addEventListener("keydown",S?R:P,S),C.addEventListener("compositionstart",q),C.addEventListener("compositionend",G)),_&&C.addEventListener(u,E?W:D,E);let Y=[];return m&&(ot(a.domReference)&&(Y=rr(a.domReference)),ot(a.floating)&&(Y=Y.concat(rr(a.floating))),!ot(a.reference)&&a.reference&&a.reference.contextElement&&(Y=Y.concat(rr(a.reference.contextElement)))),Y=Y.filter(N=>{var Z;return N!==((Z=C.defaultView)==null?void 0:Z.visualViewport)}),Y.forEach(N=>{N.addEventListener("scroll",I,{passive:!0})}),()=>{s&&(C.removeEventListener("keydown",S?R:P,S),C.removeEventListener("compositionstart",q),C.removeEventListener("compositionend",G)),_&&C.removeEventListener(u,E?W:D,E),Y.forEach(N=>{N.removeEventListener("scroll",I)}),window.clearTimeout(V)}},[i,a,s,_,u,n,r,m,o,w,M,P,S,R,D,E,W]),ne.useEffect(()=>{i.current.insideReactTree=!1},[i,_,u]);const K=ne.useMemo(()=>({onKeyDown:P,...d&&{[H8e[p]]:V=>{r(!1,V.nativeEvent,"reference-press")},...p!=="click"&&{onClick(V){r(!1,V.nativeEvent,"reference-press")}}}}),[P,r,d,p]),J=ne.useMemo(()=>({onKeyDown:P,onMouseDown(){k.current=!0},onMouseUp(){k.current=!0},[j8e[u]]:()=>{i.current.insideReactTree=!0}}),[P,u,i]);return ne.useMemo(()=>o?{reference:K,floating:J}:{},[o,K,J])}function V8e(e){const{open:t=!1,onOpenChange:n,elements:r}=e,a=Xd(),i=ne.useRef({}),[o]=ne.useState(()=>O8e()),s=bo()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!ot(h)&&I8e("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=ne.useState(r.reference),d=Xt((h,g,y)=>{i.current.openEvent=h?g:void 0,o.emit("openchange",{open:h,event:g,reason:y,nested:s}),n?.(h,g,y)}),p=ne.useMemo(()=>({setPositionReference:u}),[]),m=ne.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return ne.useMemo(()=>({dataRef:i,open:t,onOpenChange:d,elements:m,events:o,floatingId:a,refs:p}),[t,d,m,o,a,p])}function j5(e){e===void 0&&(e={});const{nodeId:t}=e,n=V8e({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,a=r.elements,[i,o]=ne.useState(null),[s,l]=ne.useState(null),d=a?.domReference||i,p=ne.useRef(null),m=ko();Nt(()=>{d&&(p.current=d)},[d]);const h=S8e({...e,elements:{...a,...s&&{reference:s}}}),g=ne.useCallback(w=>{const M=ot(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;l(M),h.refs.setReference(M)},[h.refs]),y=ne.useCallback(w=>{(ot(w)||w===null)&&(p.current=w,o(w)),(ot(h.refs.reference.current)||h.refs.reference.current===null||w!==null&&!ot(w))&&h.refs.setReference(w)},[h.refs]),v=ne.useMemo(()=>({...h.refs,setReference:y,setPositionReference:g,domReference:p}),[h.refs,y,g]),_=ne.useMemo(()=>({...h.elements,domReference:d}),[h.elements,d]),k=ne.useMemo(()=>({...h,...r,refs:v,elements:_,nodeId:t}),[h,v,_,t,r]);return Nt(()=>{r.dataRef.current.floatingContext=k;const w=m?.nodesRef.current.find(M=>M.id===t);w&&(w.context=k)}),ne.useMemo(()=>({...h,context:k,refs:v,elements:_}),[h,v,_,k])}function as(){return T6e()&&x5()}function G8e(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:a,dataRef:i,elements:o}=e,{enabled:s=!0,visibleOnly:l=!0}=t,u=ne.useRef(!1),d=ne.useRef(-1),p=ne.useRef(!0);ne.useEffect(()=>{if(!s)return;const h=jt(o.domReference);function g(){!n&&Rt(o.domReference)&&o.domReference===Sa(yn(o.domReference))&&(u.current=!0)}function y(){p.current=!0}function v(){p.current=!1}return h.addEventListener("blur",g),as()&&(h.addEventListener("keydown",y,!0),h.addEventListener("pointerdown",v,!0)),()=>{h.removeEventListener("blur",g),as()&&(h.removeEventListener("keydown",y,!0),h.removeEventListener("pointerdown",v,!0))}},[o.domReference,n,s]),ne.useEffect(()=>{if(!s)return;function h(g){let{reason:y}=g;(y==="reference-press"||y==="escape-key")&&(u.current=!0)}return a.on("openchange",h),()=>{a.off("openchange",h)}},[a,s]),ne.useEffect(()=>()=>{nn(d)},[]);const m=ne.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(h){if(u.current)return;const g=Pr(h.nativeEvent);if(l&&ot(g)){if(as()&&!h.relatedTarget){if(!p.current&&!Yd(g))return}else if(!D6e(g))return}r(!0,h.nativeEvent,"focus")},onBlur(h){u.current=!1;const g=h.relatedTarget,y=h.nativeEvent,v=ot(g)&&g.hasAttribute(qa("focus-guard"))&&g.getAttribute("data-type")==="outside";d.current=window.setTimeout(()=>{var _;const k=Sa(o.domReference?o.domReference.ownerDocument:document);!g&&k===o.domReference||xr((_=i.current.floatingContext)==null?void 0:_.refs.floating.current,k)||xr(o.domReference,k)||v||r(!1,y,"focus")})}}),[i,o.domReference,r,l]);return ne.useMemo(()=>s?{reference:m}:{},[s,m])}function is(e,t,n){const r=new Map,a=n==="item";let i=e;if(a&&e){const{[Gh]:o,[Wh]:s,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[N8e]:""},...i,...t.map(o=>{const s=o?o[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((o,s)=>(s&&Object.entries(s).forEach(l=>{let[u,d]=l;if(!(a&&[Gh,Wh].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof d=="function"){var p;(p=r.get(u))==null||p.push(d),o[u]=function(){for(var m,h=arguments.length,g=new Array(h),y=0;y<h;y++)g[y]=arguments[y];return(m=r.get(u))==null?void 0:m.map(v=>v(...g)).find(v=>v!==void 0)}}}else o[u]=d}),o),{})}}function V5(e){e===void 0&&(e=[]);const t=e.map(s=>s?.reference),n=e.map(s=>s?.floating),r=e.map(s=>s?.item),a=ne.useCallback(s=>is(s,e,"reference"),t),i=ne.useCallback(s=>is(s,e,"floating"),n),o=ne.useCallback(s=>is(s,e,"item"),r);return ne.useMemo(()=>({getReferenceProps:a,getFloatingProps:i,getItemProps:o}),[a,i,o])}const W8e="Escape";function vo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function ei(e,t){return vo(t,e===B5||e===yo,e===Pa||e===Ba)}function os(e,t,n){return vo(t,e===yo,n?e===Pa:e===Ba)||e==="Enter"||e===" "||e===""}function r2(e,t,n){return vo(t,n?e===Pa:e===Ba,e===yo)}function a2(e,t,n,r){const a=n?e===Ba:e===Pa,i=e===B5;return t==="both"||t==="horizontal"&&r&&r>1?e===W8e:vo(t,a,i)}function K8e(e,t){const{open:n,onOpenChange:r,elements:a,floatingId:i}=e,{listRef:o,activeIndex:s,onNavigate:l=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:p=!1,loop:m=!1,nested:h=!1,rtl:g=!1,virtual:y=!1,focusItemOnOpen:v="auto",focusItemOnHover:_=!0,openOnArrowKeyDown:k=!0,disabledIndices:w=void 0,orientation:M="vertical",parentOrientation:S,cols:E=1,scrollItemIntoView:F=!0,virtualItemRef:P,itemSizes:R,dense:D=!1}=t;process.env.NODE_ENV!=="production"&&(p&&(m||ts("`useListNavigation` looping must be enabled to allow escaping."),y||ts("`useListNavigation` must be virtual to allow escaping.")),M==="vertical"&&E>1&&ts("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const W=M5(a.floating),K=Pn(W),J=bo(),V=ko();Nt(()=>{e.dataRef.current.orientation=M},[e,M]);const I=Xt(()=>{l(C.current===-1?null:C.current)}),q=L6e(a.domReference),G=ne.useRef(v),C=ne.useRef(d??-1),Y=ne.useRef(null),N=ne.useRef(!0),Z=ne.useRef(I),te=ne.useRef(!!a.floating),O=ne.useRef(n),pe=ne.useRef(!1),ge=ne.useRef(!1),ve=Pn(w),Re=Pn(n),qe=Pn(F),He=Pn(d),[re,Me]=ne.useState(),[Ge,Je]=ne.useState(),ze=Xt(()=>{function _e(B){if(y){var X;(X=B.id)!=null&&X.endsWith("-fui-option")&&(B.id=i+"-"+Math.random().toString(16).slice(2,10)),Me(B.id),V?.events.emit("virtualfocus",B),P&&(P.current=B)}else $8e(B,{sync:pe.current,preventScroll:!0})}const Pe=o.current[C.current],xe=ge.current;Pe&&_e(Pe),(pe.current?B=>B():requestAnimationFrame)(()=>{const B=o.current[C.current]||Pe;if(!B)return;Pe||_e(B);const X=qe.current;X&&ke&&(xe||!N.current)&&(B.scrollIntoView==null||B.scrollIntoView(typeof X=="boolean"?{block:"nearest",inline:"nearest"}:X))})});Nt(()=>{u&&(n&&a.floating?G.current&&d!=null&&(ge.current=!0,C.current=d,I()):te.current&&(C.current=-1,Z.current()))},[u,n,a.floating,d,I]),Nt(()=>{if(u&&n&&a.floating)if(s==null){if(pe.current=!1,He.current!=null)return;if(te.current&&(C.current=-1,ze()),(!O.current||!te.current)&&G.current&&(Y.current!=null||G.current===!0&&Y.current==null)){let _e=0;const Pe=()=>{o.current[0]==null?(_e<2&&(_e?requestAnimationFrame:queueMicrotask)(Pe),_e++):(C.current=Y.current==null||os(Y.current,M,g)||h?Xo(o,ve.current):Ph(o,ve.current),Y.current=null,I())};Pe()}}else ka(o,s)||(C.current=s,ze(),ge.current=!1)},[u,n,a.floating,s,He,h,o,M,g,I,ze,ve]),Nt(()=>{var _e;if(!u||a.floating||!V||y||!te.current)return;const Pe=V.nodesRef.current,xe=(_e=Pe.find(X=>X.id===J))==null||(_e=_e.context)==null?void 0:_e.elements.floating,Xe=Sa(yn(a.floating)),B=Pe.some(X=>X.context&&xr(X.context.elements.floating,Xe));xe&&!B&&N.current&&xe.focus({preventScroll:!0})},[u,a.floating,V,J,y]),Nt(()=>{if(!u||!V||!y||J)return;function _e(Pe){Je(Pe.id),P&&(P.current=Pe)}return V.events.on("virtualfocus",_e),()=>{V.events.off("virtualfocus",_e)}},[u,V,y,J,P]),Nt(()=>{Z.current=I,O.current=n,te.current=!!a.floating}),Nt(()=>{n||(Y.current=null,G.current=v)},[n,v]);const we=s!=null,ke=ne.useMemo(()=>{function _e(xe){if(!Re.current)return;const Xe=o.current.indexOf(xe);Xe!==-1&&C.current!==Xe&&(C.current=Xe,I())}return{onFocus(xe){let{currentTarget:Xe}=xe;pe.current=!0,_e(Xe)},onClick:xe=>{let{currentTarget:Xe}=xe;return Xe.focus({preventScroll:!0})},onMouseMove(xe){let{currentTarget:Xe}=xe;pe.current=!0,ge.current=!1,_&&_e(Xe)},onPointerLeave(xe){let{pointerType:Xe}=xe;if(!(!N.current||Xe==="touch")&&(pe.current=!0,!!_&&(C.current=-1,I(),!y))){var B;(B=K.current)==null||B.focus({preventScroll:!0})}}}},[Re,K,_,o,I,y]),De=ne.useCallback(()=>{var _e;return S??(V==null||(_e=V.nodesRef.current.find(Pe=>Pe.id===J))==null||(_e=_e.context)==null||(_e=_e.dataRef)==null?void 0:_e.current.orientation)},[J,V,S]),de=Xt(_e=>{if(N.current=!1,pe.current=!0,_e.which===229||!Re.current&&_e.currentTarget===K.current)return;if(h&&a2(_e.key,M,g,E)){ei(_e.key,De())||rn(_e),r(!1,_e.nativeEvent,"list-navigation"),Rt(a.domReference)&&(y?V?.events.emit("virtualfocus",a.domReference):a.domReference.focus());return}const Pe=C.current,xe=Xo(o,w),Xe=Ph(o,w);if(q||(_e.key==="Home"&&(rn(_e),C.current=xe,I()),_e.key==="End"&&(rn(_e),C.current=Xe,I())),E>1){const B=R||Array.from({length:o.current.length},()=>({width:1,height:1})),X=G6e(B,E,D),le=X.findIndex(je=>je!=null&&!Ni(o,je,w)),he=X.reduce((je,wt,Et)=>wt!=null&&!Ni(o,wt,w)?Et:je,-1),Se=X[V6e({current:X.map(je=>je!=null?o.current[je]:null)},{event:_e,orientation:M,loop:m,rtl:g,cols:E,disabledIndices:K6e([...(typeof w!="function"?w:null)||o.current.map((je,wt)=>Ni(o,wt,w)?wt:void 0),void 0],X),minIndex:le,maxIndex:he,prevIndex:W6e(C.current>Xe?xe:C.current,B,X,E,_e.key===yo?"bl":_e.key===(g?Pa:Ba)?"tr":"tl"),stopEvent:!0})];if(Se!=null&&(C.current=Se,I()),M==="both")return}if(ei(_e.key,M)){if(rn(_e),n&&!y&&Sa(_e.currentTarget.ownerDocument)===_e.currentTarget){C.current=os(_e.key,M,g)?xe:Xe,I();return}os(_e.key,M,g)?m?C.current=Pe>=Xe?p&&Pe!==o.current.length?-1:xe:At(o,{startingIndex:Pe,disabledIndices:w}):C.current=Math.min(Xe,At(o,{startingIndex:Pe,disabledIndices:w})):m?C.current=Pe<=xe?p&&Pe!==-1?o.current.length:Xe:At(o,{startingIndex:Pe,decrement:!0,disabledIndices:w}):C.current=Math.max(xe,At(o,{startingIndex:Pe,decrement:!0,disabledIndices:w})),ka(o,C.current)&&(C.current=-1),I()}}),et=ne.useMemo(()=>y&&n&&we&&{"aria-activedescendant":Ge||re},[y,n,we,Ge,re]),Ce=ne.useMemo(()=>({"aria-orientation":M==="both"?void 0:M,...q?{}:et,onKeyDown:de,onPointerMove(){N.current=!0}}),[et,de,M,q]),We=ne.useMemo(()=>{function _e(xe){v==="auto"&&F6e(xe.nativeEvent)&&(G.current=!0)}function Pe(xe){G.current=v,v==="auto"&&P6e(xe.nativeEvent)&&(G.current=!0)}return{...et,onKeyDown(xe){N.current=!1;const Xe=xe.key.startsWith("Arrow"),B=["Home","End"].includes(xe.key),X=Xe||B,le=r2(xe.key,M,g),he=a2(xe.key,M,g,E),Se=r2(xe.key,De(),g),je=ei(xe.key,M),wt=(h?Se:je)||xe.key==="Enter"||xe.key.trim()==="";if(y&&n){const gt=V?.nodesRef.current.find(Mt=>Mt.parentId==null),St=V&>?z6e(V.nodesRef.current,gt.id):null;if(X&&St&&P){const Mt=new KeyboardEvent("keydown",{key:xe.key,bubbles:!0});if(le||he){var Et,vn;const Xa=((Et=St.context)==null?void 0:Et.elements.domReference)===xe.currentTarget,zn=he&&!Xa?(vn=St.context)==null?void 0:vn.elements.domReference:le?o.current.find(Ir=>Ir?.id===re):null;zn&&(rn(xe),zn.dispatchEvent(Mt),Je(void 0))}if((je||B)&&St.context&&St.context.open&&St.parentId&&xe.currentTarget!==St.context.elements.domReference){var _n;rn(xe),(_n=St.context.elements.domReference)==null||_n.dispatchEvent(Mt);return}}return de(xe)}if(!(!n&&!k&&Xe)){if(wt){const gt=ei(xe.key,De());Y.current=h&>?null:xe.key}if(h){Se&&(rn(xe),n?(C.current=Xo(o,ve.current),I()):r(!0,xe.nativeEvent,"list-navigation"));return}je&&(d!=null&&(C.current=d),rn(xe),!n&&k?r(!0,xe.nativeEvent,"list-navigation"):de(xe),n&&I())}},onFocus(){n&&!y&&(C.current=-1,I())},onPointerDown:Pe,onPointerEnter:Pe,onMouseDown:_e,onClick:_e}},[re,et,E,de,ve,v,o,h,I,r,n,k,M,De,g,d,V,y,P]);return ne.useMemo(()=>u?{reference:We,floating:Ce,item:ke}:{},[u,We,Ce,ke])}const Y8e=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function G5(e,t){var n,r;t===void 0&&(t={});const{open:a,elements:i,floatingId:o}=e,{enabled:s=!0,role:l="dialog"}=t,u=Xd(),d=((n=i.domReference)==null?void 0:n.id)||u,p=ne.useMemo(()=>{var k;return((k=M5(i.floating))==null?void 0:k.id)||o},[i.floating,o]),m=(r=Y8e.get(l))!=null?r:l,g=bo()!=null,y=ne.useMemo(()=>m==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:a?p:void 0}:{"aria-expanded":a?"true":"false","aria-haspopup":m==="alertdialog"?"dialog":m,"aria-controls":a?p:void 0,...m==="listbox"&&{role:"combobox"},...m==="menu"&&{id:d},...m==="menu"&&g&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[m,p,g,a,d,l]),v=ne.useMemo(()=>{const k={id:p,...m&&{role:m}};return m==="tooltip"||l==="label"?k:{...k,...m==="menu"&&{"aria-labelledby":d}}},[m,p,d,l]),_=ne.useCallback(k=>{let{active:w,selected:M}=k;const S={role:"option",...w&&{id:p+"-fui-option"}};switch(l){case"select":case"combobox":return{...S,"aria-selected":M}}return{}},[p,l]);return ne.useMemo(()=>s?{reference:y,floating:v,item:_}:{},[s,y,v,_])}const Jn=({content:e,children:t,placement:n="top",delay:r=300,disabled:a=!1,className:i=""})=>{const[o,s]=ee.useState(!1),{refs:l,floatingStyles:u,context:d,isPositioned:p}=j5({open:o,onOpenChange:s,placement:n,strategy:"absolute",whileElementsMounted:D5,middleware:[$5(8),P5(),F5({padding:8})]}),m=z8e(d,{delay:{open:r,close:0},enabled:!a}),h=G8e(d,{enabled:!a}),g=H5(d,{enabled:!0,outsidePress:!0,outsidePressEvent:"mousedown",referencePress:!0,referencePressEvent:"mousedown",escapeKey:!0,ancestorScroll:!0}),y=G5(d,{role:"tooltip"}),{getReferenceProps:v,getFloatingProps:_}=V5([m,h,g,y]);return ee.useEffect(()=>{if(!o||a)return;const k=()=>{s(!1)};return window.addEventListener("scroll",k,!0),document.addEventListener("scroll",k,!0),()=>{window.removeEventListener("scroll",k,!0),document.removeEventListener("scroll",k,!0)}},[o,a]),a||!e?T.jsx(T.Fragment,{children:t}):T.jsxs(T.Fragment,{children:[T.jsx("span",{ref:l.setReference,...v(),children:t}),o&&T.jsx(P8e,{children:T.jsx("div",{ref:l.setFloating,style:{...u,opacity:p?1:0,pointerEvents:"none",transition:p?"opacity 0.15s ease-out":"none"},className:`mp-agent-tooltip ${i}`.trim(),..._(),children:e})})]})},ar=({icon:e,size:t="md",iconSize:n,type:r="button",className:a="",tooltip:i,tooltipPlacement:o,...s})=>{const l=Gve[e],u=n??(t==="sm"?14:20),d=T.jsx("button",{type:r,className:`mp-agent-icon-button mp-agent-icon-button-${t} ${a}`.trim(),...s,children:l&&T.jsx(l,{size:u})});return i?T.jsx(Jn,{content:i,placement:o,children:d}):d},Qd=({text:e})=>{const[t,n]=ee.useState(!1),r=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)}catch(a){console.error("Failed to copy:",a)}};return T.jsx(Jn,{content:"Copy to clipboard",children:T.jsx(ar,{icon:t?"Check":"Copy",onClick:r,"aria-label":"Copy message",size:"sm"})})},i2=300,W5=ee.memo(({field:e,isExpanded:t,canApply:n,onToggleExpand:r,onApply:a})=>{const i=e.value.length>i2,o=i&&!t?`${e.value.slice(0,i2)}...`:e.value,s=ee.useCallback(()=>{r(e.name)},[e.name,r]),l=ee.useCallback(()=>{a(e)},[e,a]);return T.jsxs("div",{className:"mp-agent-form-proposal-row",children:[T.jsxs("div",{className:"mp-agent-form-proposal-main",children:[T.jsx("div",{className:"mp-agent-form-proposal-label",children:e.label||e.name}),T.jsx("div",{className:"mp-agent-form-proposal-value-container",children:T.jsxs("div",{className:"mp-agent-form-proposal-value",children:[o,i&&T.jsx("button",{type:"button",onClick:s,className:"mp-agent-form-proposal-show-all",children:t?"Show less":"Show all"})]})})]}),T.jsxs("div",{className:"mp-agent-form-proposal-actions-row",children:[n&&T.jsx(ar,{icon:"Check",onClick:l,tooltip:`Apply ${e.name}`,size:"sm"}),T.jsx(Qd,{text:e.value})]})]})});W5.displayName="FormFieldRow";const Z8e=e=>{if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)},X8e=e=>{const t=e.output??e.input??{},n=Array.isArray(t.fields)?t.fields.map(r=>({name:typeof r?.name=="string"?r.name:"",label:typeof r?.label=="string"?r.label:void 0,value:Z8e(r?.value),inputType:typeof r?.inputType=="string"?r.inputType:void 0,options:Array.isArray(r?.options)?r.options:void 0})).filter(r=>r.name.length>0):[];return{formId:typeof t.formId=="string"?t.formId:void 0,formName:typeof t.formName=="string"?t.formName:void 0,fields:n,notes:typeof t.notes=="string"?t.notes:void 0}},K5=({call:e,chatId:t})=>{const n=ht(),r=ee.useMemo(()=>X8e(e),[e]),[a,i]=ee.useState(new Set),o=ee.useMemo(()=>{const M=(e.output??{})?._mp?.lastAction,S=typeof M?.action=="string"?M.action:void 0,E=typeof M?.at=="string"?M.at:void 0;return{action:S,at:E}},[e.output]),s=ee.useMemo(()=>o.action==="apply",[o.action]),l=ee.useMemo(()=>o.action==="reject",[o.action]),u=ee.useMemo(()=>e.status===exports.AgentToolCallStatus.Succeeded&&!!r.formId&&r.fields.length>0&&!s,[e.status,r.formId,r.fields.length,s]),d=ee.useMemo(()=>e.status===exports.AgentToolCallStatus.Succeeded&&!!r.formId&&r.fields.length>0&&!s&&!l,[e.status,r.formId,r.fields.length,s,l]),p=ee.useCallback(async k=>{r.formId&&n.transport.recordToolCallAction&&await n.transport.recordToolCallAction(t,{toolCallId:e.id,action:k.action,data:{formId:r.formId,formName:r.formName,fields:k.fields},systemMessage:k.action==="apply"?`Applied ${k.fields.length} field(s) to ${r.formName??r.formId}.`:`Rejected ${r.formName??r.formId} suggestion.`},{excludeSocketId:!1})},[r.formId,r.formName,t,e.id,n.transport]),m=ee.useCallback(async k=>{if(r.formId){try{await p({action:"apply",fields:k})}catch{return}n.events.dispatchEvent(new CustomEvent(Hd,{detail:{chatId:t,toolCallId:e.id,formId:r.formId,...r.formName?{formName:r.formName}:{},fields:k}}))}},[r.formId,r.formName,t,e.id,n.events,p]),h=ee.useCallback(async()=>{if(r.formId)try{await p({action:"reject",fields:r.fields})}catch{return}},[r.formId,r.fields,p]),g=ee.useCallback(k=>{i(w=>{if(w.has(k)){if(w.size===1)return new Set;const M=new Set(w);return M.delete(k),M}else{const M=new Set(w);return M.add(k),M}})},[]),y=ee.useCallback(k=>{m([k])},[m]),v=ee.useCallback(()=>{m(r.fields)},[m,r.fields]);if(e.status===exports.AgentToolCallStatus.Failed&&e.error)return T.jsx("div",{className:"mp-agent-tool-body",children:T.jsx("div",{className:"mp-agent-tool-simple-message",children:"Failed to propose form values"})});if(e.status!==exports.AgentToolCallStatus.Succeeded)return T.jsx("div",{className:"mp-agent-tool-simple-message",children:"Preparing form fill proposal…"});if(!r.formId||r.fields.length===0)return T.jsx("div",{className:"mp-agent-tool-simple-message",children:"No form fields proposed."});const _=ee.useMemo(()=>r.formName?`Proposed values for ${r.formName}`:`Proposed values for ${r.formId}`,[r.formName,r.formId]);return T.jsxs("div",{className:"mp-agent-tool-body",children:[T.jsx("div",{className:"mp-agent-tool-simple-message",children:_}),r.notes?T.jsx("div",{className:"mp-agent-tool-simple-message",children:r.notes}):null,T.jsx("div",{className:"mp-agent-form-proposal-fields",children:r.fields.map(k=>T.jsx(W5,{field:k,isExpanded:a.has(k.name),canApply:u,onToggleExpand:g,onApply:y},k.name))}),T.jsxs("div",{className:"mp-agent-form-proposal-actions",children:[(s||l)&&T.jsxs("div",{className:"mp-agent-form-proposal-status",children:[T.jsx("span",{className:`mp-agent-form-proposal-badge ${s?"is-applied":"is-rejected"}`,children:s?"Applied":"Rejected"}),o.at?T.jsx("span",{className:"mp-agent-form-proposal-status-time",children:T.jsx(H7,{date:o.at})}):null]}),!d&&!u?null:T.jsxs(T.Fragment,{children:[T.jsx("button",{type:"button",disabled:!d,onClick:h,className:"mp-agent-form-proposal-reject",children:"Reject"}),T.jsx("button",{type:"button",disabled:!u,onClick:v,className:"mp-agent-form-proposal-apply-all",children:"Apply all"})]})]})]})},_o=e=>{const{id:t,name:n,url:r,capturedAt:a,source:i,security:o,target:s,kind:l,...u}=e,d=r??i?.url,p=i||d?{...i??{},...d?{url:d}:{}}:void 0,m=l==="webSnippet"||l==="formSnapshot"||l==="formField"?!0:void 0,h=o||(m!==void 0?{containsPII:m,redactionsApplied:[]}:void 0),g=typeof n=="string"&&n.trim().length?n.trim():l==="webSnippet"?u?.title?`Selection: ${String(u.title)}`:"Selection":l==="formField"?"Form field":l==="formSnapshot"?"Form snapshot":"Context";return{id:t??Tt.nanoid(),type:exports.AgentAttachmentType.Context,name:g,...d?{url:d}:{},metadata:{schemaVersion:1,kind:l,capturedAt:a??new Date().toISOString(),...p?{source:p}:{},...h?{security:h}:{},...s?{target:s}:{},...u}}},Q8e=e=>{try{const t=new URL(e),n=`${t.searchParams.toString()} ${t.hash}`.toLowerCase();return/(token|key|auth|session|code|password|secret|email)/.test(n)}catch{return/(token|key|auth|session|code|password|secret|email)/.test(e.toLowerCase())}},Y5=(e={})=>{if(typeof window>"u")return;const t=e.url??window.location?.href;if(!t)return;const n=e.includeTitle!==!1,r=e.includeReferrer!==!1,a=e.includeViewport!==!1,i=e.includeUserAgent===!0,o=n&&typeof document<"u"?document.title:void 0,s=r&&typeof document<"u"?document.referrer:void 0;let l;try{l=new URL(t)}catch{}const u={url:t,...l?{origin:l.origin,pathname:l.pathname,search:l.search,hash:l.hash}:{},...n&&o?{title:o}:{},...r&&s?{referrer:s}:{},...i&&typeof navigator<"u"?{userAgent:navigator.userAgent}:{},...typeof navigator<"u"&&navigator.language?{language:navigator.language}:{},...typeof Intl<"u"?{timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,locale:Intl.DateTimeFormat().resolvedOptions().locale}:{},...a&&typeof window<"u"?{viewport:{width:window.innerWidth,height:window.innerHeight,devicePixelRatio:window.devicePixelRatio}}:{},...e.extra?e.extra:{}},d=Q8e(t)?!0:void 0;return _o({kind:"pageContext",name:e.name??"Page context",url:t,title:o,summary:l?`${l.pathname}${l.search}${l.hash}`:void 0,data:u,source:{app:"browser",url:t,route:l?`${l.pathname}${l.search}${l.hash}`:void 0},...d?{security:{containsPII:!0,redactionsApplied:[]}}:{}})},Z5=()=>{if(typeof window>"u"||typeof document>"u")return;const e=window.getSelection?.();if(!e||e.rangeCount===0)return;const t=e.getRangeAt(0),n=e.toString().trim();if(!n)return;const r=(t.commonAncestorContainer.nodeType===Node.ELEMENT_NODE?t.commonAncestorContainer:t.commonAncestorContainer.parentElement)??void 0,a=r?J8e(r):void 0,i=r?.textContent??"",o=i.indexOf(n),s=o>=0?o:void 0,l=o>=0?o+n.length:void 0,u=o>=0?i.slice(Math.max(0,o-80),o).trim():void 0,d=o>=0?i.slice(o+n.length,o+n.length+80).trim():void 0;return{selectedText:n,target:{type:"text",exact:n,...u?{prefix:u}:{},...d?{suffix:d}:{},...a?{domPath:a}:{},...s!==void 0?{startOffset:s}:{},...l!==void 0?{endOffset:l}:{}}}},J8e=e=>{if(e.id)return`#${o2(e.id)}`;const t=[];let n=e;for(;n&&n.nodeType===1&&t.length<6;){const r=n.tagName.toLowerCase();if(n.id){t.unshift(`#${o2(n.id)}`);break}const a=n.parentElement;if(!a){t.unshift(r);break}const o=Array.from(a.children).filter(s=>s.tagName===n.tagName).indexOf(n)+1;t.unshift(`${r}:nth-of-type(${o})`),n=a}return t.join(" > ")},o2=e=>e.replace(/[^a-zA-Z0-9_-]/g,"\\$&");class X5{constructor(t){this.rawConfig=t,this.events=new EventTarget;const n=td.parse(t);this.config={...n,toolRenderers:t.toolRenderers,tools:t.tools,pageContext:t.pageContext?{...n.pageContext,...t.pageContext}:n.pageContext,translations:t.translations?{...Fi,...t.translations}:Fi},this.transport=this.createTransport(this.config.transport),this.tools=new B7(this.config.tools),this.tools.bindInvoke(this.invokeTool.bind(this)),this.configureTransportAfterCreate(this.transport),Object.entries(t.toolRenderers??{}).forEach(([r,a])=>{a&&this.toolRendererMap.set(r,a)}),this.toolRendererMap.has("propose_form_values")||this.toolRendererMap.set("propose_form_values",K5),this.queryClient=new io.QueryClient({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1}}})}config;transport;tools;queryClient;events;toolRendererMap=new Map;storeRef;pageContextProviders=new Set;createTransport(t){return t.mode==="proxy"?new jr(t):new Wo(t)}configureTransportAfterCreate(t){this.config.transport.mode==="direct"&&t instanceof Wo&&(t.setToolRegistry(this.tools),t.setContextKeys(this.config.contextKeys.map(n=>({key:n.key,tools:n.tools}))),this.config.models&&t.setModels(this.config.models),t.setUntitledChatText(this.config.translations.untitledChat))}updateTransportConfig(t){const n=td.parse({...this.rawConfig,transport:t}),r=this.config.transport,a=this.transport;this.rawConfig={...this.rawConfig,transport:t},this.config.transport=n.transport;const i=this.config.transport.mode;if(r.mode!==i){a.cancelStream?.(),this.transport=this.createTransport(this.config.transport),this.configureTransportAfterCreate(this.transport),this.events.dispatchEvent(new CustomEvent("runtime:transport-config-changed",{detail:{previous:r,next:this.config.transport}}));return}i==="proxy"&&a instanceof jr?a.updateConfig(this.config.transport):i==="direct"&&a instanceof Wo?(a.updateConfig(this.config.transport),this.configureTransportAfterCreate(a)):(a.cancelStream?.(),this.transport=this.createTransport(this.config.transport),this.configureTransportAfterCreate(this.transport)),this.events.dispatchEvent(new CustomEvent("runtime:transport-config-changed",{detail:{previous:r,next:this.config.transport}}))}setTransportHeaders(t){const n=this.config.transport;this.updateTransportConfig({...n,headers:t})}mergeTransportHeaders(t){const n=this.config.transport;this.updateTransportConfig({...n,headers:{...n.headers??{},...t}})}removeTransportHeaders(t){const n=this.config.transport;if(!n.headers||t.length===0)return;const r={...n.headers};for(const a of t)delete r[a];this.updateTransportConfig({...n,headers:Object.keys(r).length?r:void 0})}get defaultContextKey(){return this.config.defaultContextKey??this.config.contextKeys[0]?.key}get store(){if(!this.storeRef)throw new Error("AgentRuntime store has not been attached yet");return this.storeRef}attachStore(t){this.storeRef=t}registerTool(t){this.tools.register(t)}registerToolRenderer(t,n){this.toolRendererMap.set(t,n)}registerPageContextProvider(t){return this.pageContextProviders.add(t),()=>{this.pageContextProviders.delete(t)}}getPageContextInput(){if(typeof window>"u")return{};const t=window.location?.href;let n;if(t)try{const a=new URL(t);n=`${a.pathname}${a.search}${a.hash}`}catch{}const r=typeof document<"u"?document.title:void 0;return{url:t,route:n,title:r}}getPageContextData(t){const n=t??this.getPageContextInput(),r={};let a=!1;const i=this.config.pageContext?.getData;if(i)try{const o=i(n);o&&typeof o=="object"&&(Object.assign(r,o),a=!0)}catch{}for(const o of this.pageContextProviders)try{const s=o(n);s&&typeof s=="object"&&(Object.assign(r,s),a=!0)}catch{}return a?r:void 0}buildPageContextAttachment(){const t=this.config.pageContext,n=this.getPageContextData();return Y5({...t?.includeUserAgent!==void 0?{includeUserAgent:t.includeUserAgent}:{},...t?.includeReferrer!==void 0?{includeReferrer:t.includeReferrer}:{},...t?.includeViewport!==void 0?{includeViewport:t.includeViewport}:{},...t?.includeTitle!==void 0?{includeTitle:t.includeTitle}:{},...t?.name?{name:t.name}:{},...n?{extra:n}:{}})}getToolRenderer(t){return this.toolRendererMap.get(t.name)}ensureStore(t){if(!this.storeRef)throw new Error(`Cannot ${t} before AgentRuntime is mounted`);return this.storeRef}resolveChatId(t){const r=this.ensureStore("invoke tools").getState(),a=t?.chatId??r.activeChatId;if(!a||!r.chats[a])throw new Error("Tool invocation requires an active chat. Select or create a chat first.");return a}buildToolContext(t){const n=this.ensureStore("create tool context");return{chatId:t,agentId:this.config.appId,workspaceId:this.config.workspaceId,appendSystemMessage:r=>{n.getState().appendSystemMessage(t,r)}}}writeToolCall(t,n){this.ensureStore("write tool call").getState().upsertToolCall(t,{...n})}async invokeTool(t,n={},r){const a=this.resolveChatId(r),i={id:Tt.nanoid(),name:t,input:n,status:exports.AgentToolCallStatus.Running};this.writeToolCall(a,i);const o=this.buildToolContext(a);try{const s=await this.tools.execute(t,n,o,i);return this.writeToolCall(a,s),s}catch(s){const l={...i,status:exports.AgentToolCallStatus.Failed,error:s instanceof Error?s.message:"Unknown tool error"};throw this.writeToolCall(a,l),s}}}const e7e={background:"#050505",surface:"#0f0f11",text:"#f7f7f7",subtext:"#8f9baa",border:"#1f2229",accent:"#6c63ff",accentSoft:"rgba(108, 99, 255, 0.14)",warning:"#ffb347",danger:"#ff5f56",fontFamily:'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',radius:"12px",fontSize:"14px"},Q5=e=>({...e7e,...e}),J5=ee.createContext(Q5()),t7e=e=>({"--mp-agents-bg":e.background,"--mp-agents-surface":e.surface,"--mp-agents-text":e.text,"--mp-agents-subtext":e.subtext,"--mp-agents-border":e.border,"--mp-agents-accent":e.accent,"--mp-agents-accent-soft":e.accentSoft,"--mp-agents-warning":e.warning,"--mp-agents-danger":e.danger,"--mp-agents-radius":e.radius,"--mp-agents-font-size":e.fontSize}),e3=({value:e,children:t})=>{const n=ee.useMemo(()=>Q5(e),[e]);return T.jsxs(J5.Provider,{value:n,children:[T.jsx("style",{children:`:root {
|
|
8320
8320
|
${Object.entries(t7e(n)).map(([r,a])=>`${r}: ${a};`).join(`
|
|
8321
8321
|
`)}
|
|
8322
8322
|
}`}),t]})},n7e=()=>ee.useContext(J5),ti=e=>e.type===exports.AgentAttachmentType.Context&&e?.metadata?.kind==="pageContext";var an=(e=>(e.Idle="idle",e.Sending="sending",e.Streaming="streaming",e))(an||{});const r7e=e=>Yk.create()((t,n)=>({contextKey:e,activeChatId:void 0,draftChatKey:`draft-${Tt.nanoid()}`,chats:{},reasoningByChat:{},artifactsByChat:{},messageQueueByChat:{},pendingAssistantByChat:{},isChatHistoryOpen:!1,composerDraftByChat:{},composerErrorByChat:{},pageContextDismissedByChatKey:{},composer:{temperature:.4},statusByChat:{},setContextKey:r=>t({contextKey:r}),setActiveChat:r=>{t(a=>{let i=a.contextKey,o;if(r){const l=a.chats[r];l?.contextKey&&(i=l.contextKey),o=l?.model}return{activeChatId:r,contextKey:i,composer:r?{...a.composer,model:o}:a.composer}})},upsertChat:r=>t(a=>{const i=a.activeChatId===r.id;return{chats:{...a.chats,[r.id]:r},...i?{composer:{...a.composer,model:r.model}}:{}}}),hydrateChats:r=>t(a=>{const i={};r.forEach(l=>{i[l.id]=l});const o=a.activeChatId&&i[a.activeChatId]?a.activeChatId:r[0]?.id,s=o?i[o]:void 0;return{chats:i,activeChatId:o,composer:{...a.composer,model:s?.model}}}),removeChat:r=>t(a=>{if(!a.chats[r])return a;const{[r]:i,...o}=a.chats,{[r]:s,...l}=a.reasoningByChat,{[r]:u,...d}=a.artifactsByChat,{[r]:p,...m}=a.pendingAssistantByChat,{[r]:h,...g}=a.messageQueueByChat,{[r]:y,...v}=a.statusByChat,{[r]:_,...k}=a.pageContextDismissedByChatKey,w=a.activeChatId===r;return{chats:o,statusByChat:v,reasoningByChat:l,artifactsByChat:d,messageQueueByChat:g,pendingAssistantByChat:m,pageContextDismissedByChatKey:k,...w?{activeChatId:void 0}:{}}}),pushReasoning:(r,a)=>t(i=>({reasoningByChat:{...i.reasoningByChat,[r]:[...i.reasoningByChat[r]??[],a]}})),consumeStreamChunk:(r,a)=>t(i=>{if(!a.message)return i;const o=i.chats[r];if(!o)return i;const s=o.messages.filter(l=>l.id!==a.message.id);return s.push(a.message),{chats:{...i.chats,[r]:{...o,messages:s}}}}),setArtifacts:(r,a)=>t(i=>({artifactsByChat:{...i.artifactsByChat,[r]:a}})),setComposerOptions:r=>t(a=>({composer:{...a.composer,...r}})),setComposerDraft:(r,a)=>t(i=>({composerDraftByChat:{...i.composerDraftByChat,[r]:{value:a.value??"",attachments:a.attachments??[]}}})),setComposerValue:(r,a)=>t(i=>{const o=i.composerDraftByChat[r]??{value:"",attachments:[]};return{composerDraftByChat:{...i.composerDraftByChat,[r]:{...o,value:a}}}}),addComposerAttachments:(r,a)=>t(i=>{const o=i.composerDraftByChat[r]??{value:"",attachments:[]};if(!a||a.length===0)return i;const s=o.attachments??[],l=s.find(ti),u=a.find(ti);if(u){const m=a.filter(_=>!ti(_)),h=s.filter(_=>!ti(_)),y=[l?{...u,id:l.id}:u,...m,...h],v=new Map;for(const _ of y)v.set(_.id,_);return{composerDraftByChat:{...i.composerDraftByChat,[r]:{...o,attachments:Array.from(v.values())}}}}const d=[...a,...s],p=new Map;for(const m of d)p.set(m.id,m);return{composerDraftByChat:{...i.composerDraftByChat,[r]:{...o,attachments:Array.from(p.values())}}}}),removeComposerAttachment:(r,a)=>t(i=>{const o=i.composerDraftByChat[r];return o?{composerDraftByChat:{...i.composerDraftByChat,[r]:{...o,attachments:o.attachments.filter(s=>s.id!==a)}}}:i}),clearComposerDraft:r=>t(a=>({composerDraftByChat:{...a.composerDraftByChat,[r]:{value:"",attachments:[]}}})),setComposerError:(r,a)=>t(i=>({composerErrorByChat:{...i.composerErrorByChat,[r]:a}})),setPageContextDismissed:(r,a)=>t(i=>({pageContextDismissedByChatKey:{...i.pageContextDismissedByChatKey,[r]:a}})),setChatStatus:(r,a)=>t(i=>({statusByChat:{...i.statusByChat,[r]:a}})),setPendingAssistant:(r,a)=>t(i=>({pendingAssistantByChat:{...i.pendingAssistantByChat,[r]:a}})),commitPendingAssistant:r=>t(a=>{const i=a.pendingAssistantByChat[r];if(!i)return a;const o=a.chats[r];if(!o)return{pendingAssistantByChat:{...a.pendingAssistantByChat,[r]:void 0}};const l=typeof i.content=="string"&&i.content.trim().length>0?(()=>{if(o.messages[o.messages.length-1]?.id===i.id)return o.messages;const d={...i,chat:r};return[...o.messages,d]})():o.messages;return{chats:{...a.chats,[r]:{...o,messages:l}},pendingAssistantByChat:{...a.pendingAssistantByChat,[r]:void 0}}}),enqueueQueuedMessage:(r,a,i)=>t(o=>{const s={id:Tt.nanoid(),content:a,...i&&i.length>0?{attachments:i}:{},createdAt:new Date().toISOString()},l=o.messageQueueByChat[r]??[];return{messageQueueByChat:{...o.messageQueueByChat,[r]:[...l,s]}}}),removeQueuedMessage:(r,a)=>t(i=>{const o=i.messageQueueByChat[r];if(!o||o.length===0)return i;const s=o.filter(l=>l.id!==a);return{messageQueueByChat:{...i.messageQueueByChat,[r]:s}}}),moveChatKeyState:(r,a)=>t(i=>{if(r===a)return i;const o=i.messageQueueByChat[r]??[],s=i.messageQueueByChat[a]??[],l=i.pendingAssistantByChat[r],u=i.statusByChat[r],d=i.composerDraftByChat[r],p=i.composerDraftByChat[a],m=i.composerErrorByChat[r],h=i.composerErrorByChat[a],g=i.pageContextDismissedByChatKey[r],y=i.pageContextDismissedByChatKey[a];return o.length>0||!!l||u!==void 0&&u!=="idle"||!!d||!!m?{messageQueueByChat:{...i.messageQueueByChat,[r]:[],...o.length>0?{[a]:[...s,...o]}:{}},pendingAssistantByChat:{...i.pendingAssistantByChat,...l?{[a]:l}:{},[r]:void 0},statusByChat:{...i.statusByChat,...u?{[a]:u}:{},[r]:"idle"},composerDraftByChat:{...i.composerDraftByChat,...d&&!p?{[a]:d}:{},[r]:{value:"",attachments:[]}},composerErrorByChat:{...i.composerErrorByChat,...m&&!h?{[a]:m}:{},[r]:void 0},pageContextDismissedByChatKey:{...i.pageContextDismissedByChatKey,...g!==void 0&&y===void 0?{[a]:g}:{},[r]:!1}}:i}),appendSystemMessage:(r,a)=>t(i=>{const o=i.chats[r];if(!o)return i;const s={id:Tt.nanoid(),chat:r,content:a,role:exports.MessageRole.System,createdAt:new Date().toISOString()};return{chats:{...i.chats,[r]:{...o,messages:[...o.messages,s]}}}}),upsertToolCall:(r,a)=>t(i=>{const o=i.chats[r];if(!o)return i;const s=[...o.messages],l=s.findIndex(u=>u.role===exports.MessageRole.Tool&&u.toolCalls?.some(d=>d.id===a.id));if(l>=0){const u=s[l],d=(u.toolCalls??[]).map(p=>p.id===a.id?a:p);s[l]={...u,toolCalls:d}}else s.push({id:`tool-${a.id}`,chat:r,role:exports.MessageRole.Tool,content:"",createdAt:new Date().toISOString(),toolCalls:[a]});return{chats:{...i.chats,[r]:{...o,messages:s}}}}),setChatHistoryOpen:r=>t({isChatHistoryOpen:r}),toggleChatHistory:()=>t(r=>({isChatHistoryOpen:!r.isChatHistoryOpen}))})),s2="mp-agent-selected-model",ha="__auto__";function t3(e){return e.mode==="direct"?`${s2}-${e.mode}-${e.provider}`:`${s2}-${e.mode}`}function l2(e,t){try{const n=t3(e);localStorage.setItem(n,t)}catch(n){console.warn("Failed to save selected model to localStorage:",n)}}function a7e(e){try{const t=t3(e);return localStorage.getItem(t)}catch(t){return console.warn("Failed to load selected model from localStorage:",t),null}}function n3(e,t){return!e||e.length===0?[]:t.mode==="direct"&&t.provider!=="custom"?e.filter(n=>n.provider?n.provider===t.provider:!0):e}function i7e(e,t,n){const r=a7e(t);if(r){if(r===ha)return;if(n3(e,t).some(i=>i.id===r))return r}}const Tn=Object.create(null);Tn.open="0";Tn.close="1";Tn.ping="2";Tn.pong="3";Tn.message="4";Tn.upgrade="5";Tn.noop="6";const Ti=Object.create(null);Object.keys(Tn).forEach(e=>{Ti[Tn[e]]=e});const cd={type:"error",data:"parser error"},r3=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",a3=typeof ArrayBuffer=="function",i3=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Jd=({type:e,data:t},n,r)=>r3&&t instanceof Blob?n?r(t):c2(t,r):a3&&(t instanceof ArrayBuffer||i3(t))?n?r(t):c2(new Blob([t]),r):r(Tn[e]+(t||"")),c2=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function u2(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let ss;function o7e(e,t){if(r3&&e.data instanceof Blob)return e.data.arrayBuffer().then(u2).then(t);if(a3&&(e.data instanceof ArrayBuffer||i3(e.data)))return t(u2(e.data));Jd(e,!1,n=>{ss||(ss=new TextEncoder),t(ss.encode(n))})}const d2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ma=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<d2.length;e++)ma[d2.charCodeAt(e)]=e;const s7e=e=>{let t=e.length*.75,n=e.length,r,a=0,i,o,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(r=0;r<n;r+=4)i=ma[e.charCodeAt(r)],o=ma[e.charCodeAt(r+1)],s=ma[e.charCodeAt(r+2)],l=ma[e.charCodeAt(r+3)],d[a++]=i<<2|o>>4,d[a++]=(o&15)<<4|s>>2,d[a++]=(s&3)<<6|l&63;return u},l7e=typeof ArrayBuffer=="function",ep=(e,t)=>{if(typeof e!="string")return{type:"message",data:o3(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:c7e(e.substring(1),t)}:Ti[n]?e.length>1?{type:Ti[n],data:e.substring(1)}:{type:Ti[n]}:cd},c7e=(e,t)=>{if(l7e){const n=s7e(e);return o3(n,t)}else return{base64:!0,data:e}},o3=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},s3="",u7e=(e,t)=>{const n=e.length,r=new Array(n);let a=0;e.forEach((i,o)=>{Jd(i,!1,s=>{r[o]=s,++a===n&&t(r.join(s3))})})},d7e=(e,t)=>{const n=e.split(s3),r=[];for(let a=0;a<n.length;a++){const i=ep(n[a],t);if(r.push(i),i.type==="error")break}return r};function p7e(){return new TransformStream({transform(e,t){o7e(e,n=>{const r=n.length;let a;if(r<126)a=new Uint8Array(1),new DataView(a.buffer).setUint8(0,r);else if(r<65536){a=new Uint8Array(3);const i=new DataView(a.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{a=new Uint8Array(9);const i=new DataView(a.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(a[0]|=128),t.enqueue(a),t.enqueue(n)})}})}let ls;function ni(e){return e.reduce((t,n)=>t+n.length,0)}function ri(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let a=0;a<t;a++)n[a]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function h7e(e,t){ls||(ls=new TextDecoder);const n=[];let r=0,a=-1,i=!1;return new TransformStream({transform(o,s){for(n.push(o);;){if(r===0){if(ni(n)<1)break;const l=ri(n,1);i=(l[0]&128)===128,a=l[0]&127,a<126?r=3:a===126?r=1:r=2}else if(r===1){if(ni(n)<2)break;const l=ri(n,2);a=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(ni(n)<8)break;const l=ri(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),d=u.getUint32(0);if(d>Math.pow(2,21)-1){s.enqueue(cd);break}a=d*Math.pow(2,32)+u.getUint32(4),r=3}else{if(ni(n)<a)break;const l=ri(n,a);s.enqueue(ep(i?l:ls.decode(l),t)),r=0}if(a===0||a>e){s.enqueue(cd);break}}}})}const l3=4;function kt(e){if(e)return m7e(e)}function m7e(e){for(var t in kt.prototype)e[t]=kt.prototype[t];return e}kt.prototype.on=kt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};kt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};kt.prototype.off=kt.prototype.removeListener=kt.prototype.removeAllListeners=kt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,a=0;a<n.length;a++)if(r=n[a],r===t||r.fn===t){n.splice(a,1);break}return n.length===0&&delete this._callbacks["$"+e],this};kt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,a=n.length;r<a;++r)n[r].apply(this,t)}return this};kt.prototype.emitReserved=kt.prototype.emit;kt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};kt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const wo=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),on=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),f7e="arraybuffer";function c3(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const g7e=on.setTimeout,y7e=on.clearTimeout;function xo(e,t){t.useNativeTimers?(e.setTimeoutFn=g7e.bind(on),e.clearTimeoutFn=y7e.bind(on)):(e.setTimeoutFn=on.setTimeout.bind(on),e.clearTimeoutFn=on.clearTimeout.bind(on))}const b7e=1.33;function k7e(e){return typeof e=="string"?v7e(e):Math.ceil((e.byteLength||e.size)*b7e)}function v7e(e){let t=0,n=0;for(let r=0,a=e.length;r<a;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function u3(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function _7e(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function w7e(e){let t={},n=e.split("&");for(let r=0,a=n.length;r<a;r++){let i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}class x7e extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class tp extends kt{constructor(t){super(),this.writable=!1,xo(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new x7e(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=ep(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=_7e(t);return n.length?"?"+n:""}}class E7e extends tp{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};d7e(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,u7e(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=u3()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let d3=!1;try{d3=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const M7e=d3;function S7e(){}class N7e extends E7e{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(a,i)=>{this.onError("xhr post error",a,i)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class An extends kt{constructor(t,n,r){super(),this.createRequest=t,xo(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=c3(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let a in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(a)&&r.setRequestHeader(a,this._opts.extraHeaders[a])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var a;r.readyState===3&&((a=this._opts.cookieJar)===null||a===void 0||a.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(a){this.setTimeoutFn(()=>{this._onError(a)},0);return}typeof document<"u"&&(this._index=An.requestsCount++,An.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=S7e,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete An.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}An.requestsCount=0;An.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",p2);else if(typeof addEventListener=="function"){const e="onpagehide"in on?"pagehide":"unload";addEventListener(e,p2,!1)}}function p2(){for(let e in An.requests)An.requests.hasOwnProperty(e)&&An.requests[e].abort()}const A7e=function(){const e=p3({xdomain:!1});return e&&e.responseType!==null}();class T7e extends N7e{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=A7e&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new An(p3,this.uri(),t)}}function p3(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||M7e))return new XMLHttpRequest}catch{}if(!t)try{return new on[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const h3=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class C7e extends tp{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=h3?{}:c3(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(a){return this.emitReserved("error",a)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],a=n===t.length-1;Jd(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}a&&wo(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=u3()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const cs=on.WebSocket||on.MozWebSocket;class R7e extends C7e{createSocket(t,n,r){return h3?new cs(t,n,r):n?new cs(t,n):new cs(t)}doWrite(t,n){this.ws.send(n)}}class I7e extends tp{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=h7e(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),a=p7e();a.readable.pipeTo(t.writable),this._writer=a.writable.getWriter();const i=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),i())}).catch(s=>{})};i();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],a=n===t.length-1;this._writer.write(r).then(()=>{a&&wo(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const O7e={websocket:R7e,webtransport:I7e,polling:T7e},L7e=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,D7e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ud(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let a=L7e.exec(e||""),i={},o=14;for(;o--;)i[D7e[o]]=a[o]||"";return n!=-1&&r!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=z7e(i,i.path),i.queryKey=$7e(i,i.query),i}function z7e(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function $7e(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,a,i){a&&(n[a]=i)}),n}const dd=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ci=[];dd&&addEventListener("offline",()=>{Ci.forEach(e=>e())},!1);class ir extends kt{constructor(t,n){if(super(),this.binaryType=f7e,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=ud(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=ud(n.host).host);xo(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const a=r.prototype.name;this.transports.push(a),this._transportsByName[a]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=w7e(this.opts.query)),dd&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Ci.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=l3,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&ir.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",ir.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const a=this.writeBuffer[r].data;if(a&&(n+=k7e(a)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,wo(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,a){if(typeof n=="function"&&(a=n,n=void 0),typeof r=="function"&&(a=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:t,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),a&&this.once("flush",a),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(ir.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),dd&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Ci.indexOf(this._offlineEventListener);r!==-1&&Ci.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}ir.protocol=l3;class F7e extends ir{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;ir.priorWebsocketSuccess=!1;const a=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ir.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function i(){r||(r=!0,d(),n.close(),n=null)}const o=p=>{const m=new Error("probe error: "+p);m.transport=n.name,i(),this.emitReserved("upgradeError",m)};function s(){o("transport closed")}function l(){o("socket closed")}function u(p){n&&p.name!==n.name&&i()}const d=()=>{n.removeListener("open",a),n.removeListener("error",o),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",a),n.once("error",o),n.once("close",s),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let P7e=class extends F7e{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(a=>O7e[a]).filter(a=>!!a)),super(t,r)}};function B7e(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=ud(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}const q7e=typeof ArrayBuffer=="function",U7e=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,m3=Object.prototype.toString,H7e=typeof Blob=="function"||typeof Blob<"u"&&m3.call(Blob)==="[object BlobConstructor]",j7e=typeof File=="function"||typeof File<"u"&&m3.call(File)==="[object FileConstructor]";function np(e){return q7e&&(e instanceof ArrayBuffer||U7e(e))||H7e&&e instanceof Blob||j7e&&e instanceof File}function Ri(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Ri(e[n]))return!0;return!1}if(np(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Ri(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Ri(e[n]))return!0;return!1}function V7e(e){const t=[],n=e.data,r=e;return r.data=pd(n,t),r.attachments=t.length,{packet:r,buffers:t}}function pd(e,t){if(!e)return e;if(np(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=pd(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=pd(e[r],t));return n}return e}function G7e(e,t){return e.data=hd(e.data,t),delete e.attachments,e}function hd(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=hd(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=hd(e[n],t));return e}const W7e=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],K7e=5;var Ke;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Ke||(Ke={}));class Y7e{constructor(t){this.replacer=t}encode(t){return(t.type===Ke.EVENT||t.type===Ke.ACK)&&Ri(t)?this.encodeAsBinary({type:t.type===Ke.EVENT?Ke.BINARY_EVENT:Ke.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Ke.BINARY_EVENT||t.type===Ke.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=V7e(t),r=this.encodeAsString(n.packet),a=n.buffers;return a.unshift(r),a}}function h2(e){return Object.prototype.toString.call(e)==="[object Object]"}class rp extends kt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Ke.BINARY_EVENT;r||n.type===Ke.BINARY_ACK?(n.type=r?Ke.EVENT:Ke.ACK,this.reconstructor=new Z7e(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(np(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Ke[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Ke.BINARY_EVENT||r.type===Ke.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(i,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const a=t.charAt(n+1);if(a!==""&&Number(a)==a){const i=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(rp.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Ke.CONNECT:return h2(n);case Ke.DISCONNECT:return n===void 0;case Ke.CONNECT_ERROR:return typeof n=="string"||h2(n);case Ke.EVENT:case Ke.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&W7e.indexOf(n[0])===-1);case Ke.ACK:case Ke.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Z7e{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=G7e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const X7e=Object.freeze(Object.defineProperty({__proto__:null,Decoder:rp,Encoder:Y7e,get PacketType(){return Ke},protocol:K7e},Symbol.toStringTag,{value:"Module"}));function fn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Q7e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class f3 extends kt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[fn(t,"open",this.onopen.bind(this)),fn(t,"packet",this.onpacket.bind(this)),fn(t,"error",this.onerror.bind(this)),fn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,a,i;if(Q7e.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:Ke.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,p=n.pop();this._registerAckCallback(d,p),o.id=d}const s=(a=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||a===void 0?void 0:a.writable,l=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!s||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const a=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(a===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},a),o=(...s)=>{this.io.clearTimeoutFn(i),n.apply(this,s)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,a)=>{const i=(o,s)=>o?a(o):r(s);i.withError=!0,n.push(i),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((a,...i)=>r!==this._queue[0]?void 0:(a!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(a)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Ke.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Ke.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ke.EVENT:case Ke.BINARY_EVENT:this.onevent(t);break;case Ke.ACK:case Ke.BINARY_ACK:this.onack(t);break;case Ke.DISCONNECT:this.ondisconnect();break;case Ke.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...a){r||(r=!0,n.packet({type:Ke.ACK,id:t,data:a}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ke.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function ea(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}ea.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};ea.prototype.reset=function(){this.attempts=0};ea.prototype.setMin=function(e){this.ms=e};ea.prototype.setMax=function(e){this.max=e};ea.prototype.setJitter=function(e){this.jitter=e};class md extends kt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,xo(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new ea({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const a=n.parser||X7e;this.encoder=new a.Encoder,this.decoder=new a.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new P7e(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const a=fn(n,"open",function(){r.onopen(),t&&t()}),i=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},o=fn(n,"error",i);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{a(),i(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(a),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(fn(t,"ping",this.onping.bind(this)),fn(t,"data",this.ondata.bind(this)),fn(t,"error",this.onerror.bind(this)),fn(t,"close",this.onclose.bind(this)),fn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){wo(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new f3(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(a=>{a?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",a)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const la={};function Ii(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=B7e(e,t.path||"/socket.io"),r=n.source,a=n.id,i=n.path,o=la[a]&&i in la[a].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return s?l=new md(r,t):(la[a]||(la[a]=new md(r,t)),l=la[a]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Ii,{Manager:md,Socket:f3,io:Ii,connect:Ii});const m2="mp-agents-guest-user-id";function ap(){if(typeof window>"u")return`${Pi.DefaultUserId}-${Tt.nanoid()}`;const e=localStorage.getItem(m2);if(e)return e;const t=`${Pi.DefaultUserId}-${Tt.nanoid()}`;return localStorage.setItem(m2,t),t}const J7e=ee.createContext(null),e_e=({children:e})=>{const t=ht(),n=Te(h=>h.upsertChat),r=Te(h=>h.contextKey),a=ee.useMemo(()=>t.config.user?.id??ap(),[t.config.user?.id]),i=t.config.transport,[o,s]=ee.useState(null),[l,u]=ee.useState(void 0),d=ee.useRef(r),p=ee.useRef(n);ee.useEffect(()=>{d.current=r,p.current=n},[r,n]),ee.useEffect(()=>{if(i.mode!=="proxy"){s(null),u(void 0),t.transport instanceof jr&&t.transport.setSocketId(void 0);return}const h=i.baseUrl,g=new URL(h,window.location.origin),y=`${g.protocol}//${g.host}`,v={},_=i;_.headers&&Object.assign(v,_.headers);const k={},w=_.apiKey&&`Bearer ${_.apiKey}`||_.headers?.Authorization;w&&(k.authorization=w,v.Authorization=w);const M=i.socketPath??Pi.Path,S=Ii(y,{path:M,auth:k,transports:["websocket","polling"],...Object.keys(v).length>0&&{extraHeaders:v}});s(S);const E=()=>{u(S.id),t.transport instanceof jr&&t.transport.setSocketId(S.id)},F=()=>{u(void 0),t.transport instanceof jr&&t.transport.setSocketId(void 0)},P=W=>{W.contextKey===d.current&&p.current(W)},R=W=>{const J=t.store.getState().chats[W.chat];if(!J)return;const V=J.messages.findIndex(I=>I.id===W.id);if(V>=0){const I=[...J.messages];I[V]=W,p.current({...J,messages:I});return}p.current({...J,messages:[...J.messages,W]})},D=W=>{const J=t.store.getState().chats[W.id];p.current({...W,messages:J?J.messages:[]})};return S.on("connect",E),S.on("disconnect",F),S.on("connect_error",W=>{console.error("Socket.IO connection error:",W.message)}),S.on(Si.ChatNew,P),S.on(Si.MessageNew,R),S.on(Si.ChatUpdate,D),()=>{t.transport instanceof jr&&t.transport.setSocketId(void 0),u(void 0),s(null),S.disconnect()}},[t,t.transport,i.mode,i.mode==="proxy"?i.baseUrl:void 0,i.mode==="proxy"?i.apiKey:void 0,i.mode==="proxy"?i.socketPath:void 0,i.mode==="proxy"?JSON.stringify(i.headers??{}):"",a]);const m=ee.useMemo(()=>({socket:o,socketId:l}),[o,l]);return T.jsx(J7e.Provider,{value:m,children:e})},ip=ee.createContext(null),t_e=({config:e,children:t})=>{const n=ee.useRef();n.current||(n.current=new X5(e));const[,r]=ee.useState(0);ee.useEffect(()=>{const o=n.current,s=()=>r(l=>l+1);return o.events.addEventListener("runtime:transport-config-changed",s),()=>{o.events.removeEventListener("runtime:transport-config-changed",s)}},[]);const a=ee.useRef();if(!a.current){const o=n.current.defaultContextKey??n.current.config.contextKeys[0]?.key??"default";a.current=r7e(o),n.current.attachStore(a.current);const s=i7e(n.current.config.models,n.current.config.transport);a.current.getState().setComposerOptions({model:s})}const i=ee.useMemo(()=>({runtime:n.current,store:a.current}),[]);return T.jsx(ip.Provider,{value:i,children:T.jsx(io.QueryClientProvider,{client:i.runtime.queryClient,children:T.jsx(e3,{value:i.runtime.config.theme,children:T.jsx(e_e,{children:t})})})})},ht=()=>{const e=ee.useContext(ip);if(!e)throw new Error("useAgentRuntime must be used inside <AgentProvider />");return e.runtime},Te=e=>{const t=ee.useContext(ip);if(!t)throw new Error("useAgentStore must be used inside <AgentProvider />");return Yk.useStore(t.store,e)},g3=()=>{const e=ht(),t=Te(a=>a.hydrateChats),n=e.config.user?.id??ap(),r=io.useQuery({queryKey:["mp-agents","chats",n],queryFn:()=>e.transport.listChats({userId:n}),enabled:!!n});return ee.useEffect(()=>{r.data&&t(r.data)},[r.data,t]),r},y3=(e={},t=[])=>{const{threshold:n=50,scrollOnMount:r=!0}=e,a=ee.useRef(null),i=ee.useRef(null),[o,s]=ee.useState(!0),l=ee.useRef(!1),u=ee.useRef(!1),d=ee.useRef(),p=ee.useCallback(()=>{const g=a.current;if(!g)return!1;const{scrollTop:y,scrollHeight:v,clientHeight:_}=g;return v-y-_<=n},[n]),m=ee.useCallback(()=>{const g=a.current,y=i.current;!g||!y||y.scrollIntoView({behavior:"auto",block:"end"})},[]),h=ee.useCallback(()=>{const g=p();s(g),g&&(l.current=!1)},[p]);return ee.useEffect(()=>{const g=a.current;if(!g)return;let y=g.scrollTop,v;const _=()=>{const k=g.scrollTop;if(!u.current){const w=k<y,M=k>y;(w||M&&!p())&&(l.current=!0)}y=k,h(),v&&clearTimeout(v),v=window.setTimeout(()=>{u.current=!1},150)};return g.addEventListener("scroll",_,{passive:!0}),()=>{g.removeEventListener("scroll",_),v&&clearTimeout(v)}},[p,h]),ee.useEffect(()=>{const g=a.current;if(!g)return;const y=new MutationObserver(()=>{!l.current&&o&&(d.current&&cancelAnimationFrame(d.current),d.current=requestAnimationFrame(()=>{u.current=!0,m(),setTimeout(()=>{u.current=!1},50)})),h()});return y.observe(g,{childList:!0,subtree:!0,characterData:!0,attributes:!1}),()=>{y.disconnect(),d.current&&cancelAnimationFrame(d.current)}},[o,m,h]),ee.useEffect(()=>{t.length!==0&&!l.current&&o&&(d.current&&cancelAnimationFrame(d.current),d.current=requestAnimationFrame(()=>{u.current=!0,m(),setTimeout(()=>{u.current=!1},50)}))},[...t]),ee.useEffect(()=>{if(r&&a.current){const g=window.setTimeout(()=>{u.current=!0,m(),setTimeout(()=>{u.current=!1},50)},100);return()=>{clearTimeout(g)}}},[r,m]),{containerRef:a,sentinelRef:i,isNearBottom:o,scrollToBottom:m,checkIsNearBottom:p}},b3=()=>{const e=ht();return io.useQuery({queryKey:["mp-agents","models"],queryFn:async()=>e.transport.listModels?await e.transport.listModels():[],staleTime:5*60*1e3,refetchOnWindowFocus:!1})},k3=()=>{const e=Te(s=>s.activeChatId??s.draftChatKey),t=Te(s=>s.composerDraftByChat[e]??{value:"",attachments:[]}),n=Te(s=>s.setComposerValue),r=Te(s=>s.setComposerDraft),a=Te(s=>s.clearComposerDraft),i=Te(s=>s.addComposerAttachments),o=Te(s=>s.removeComposerAttachment);return{chatKey:e,draft:t,setValue:s=>n(e,s),setDraft:s=>r(e,s),clearDraft:()=>a(e),addAttachments:s=>i(e,s),removeAttachment:s=>o(e,s)}},Mr=()=>ht().config.translations??Fi,n_e=(e,t=[])=>{const n=ht(),r=ee.useRef(e),a=ee.useCallback(e,t);r.current=a;const i=ee.useCallback(o=>r.current(o),[]);ee.useEffect(()=>n.registerPageContextProvider(i),[n,i])},v3=(e,t,n=[],r)=>{const a=ht(),i=ee.useRef(t),o=ee.useCallback(t,n);i.current=o;const s=ee.useCallback(u=>{i.current(u)},[]),l=typeof r=="boolean"?r:r?.capture;ee.useEffect(()=>(a.events.addEventListener(e,s,r),()=>{a.events.removeEventListener(e,s,l)}),[a,e,s,l])},r_e=({formId:e,onApply:t,enabled:n=!0})=>{v3(Hd,r=>{n&&r.detail.formId===e&&t(r.detail)},[n,e,t])},a_e=({initialSystemPrompt:e,composerFormRef:t})=>{const n=ht(),{statusByChat:r,composer:a,contextKey:i,activeChatId:o,draftChatKey:s,messageQueueByChat:l,upsertChat:u,setChatStatus:d,setActiveChat:p,setComposerError:m,moveChatKeyState:h,removeQueuedMessage:g,setPendingAssistant:y,enqueueQueuedMessage:v,commitPendingAssistant:_,setPageContextDismissed:k}=Te(C=>({composer:C.composer,contextKey:C.contextKey,statusByChat:C.statusByChat,activeChatId:C.activeChatId,draftChatKey:C.draftChatKey,messageQueueByChat:C.messageQueueByChat,upsertChat:C.upsertChat,setActiveChat:C.setActiveChat,setChatStatus:C.setChatStatus,setComposerError:C.setComposerError,moveChatKeyState:C.moveChatKeyState,setPendingAssistant:C.setPendingAssistant,removeQueuedMessage:C.removeQueuedMessage,enqueueQueuedMessage:C.enqueueQueuedMessage,commitPendingAssistant:C.commitPendingAssistant,setPageContextDismissed:C.setPageContextDismissed})),w=ee.useCallback(C=>!C||C.length===0?!1:C.some(Y=>Y.type===exports.AgentAttachmentType.Context&&Y?.metadata?.kind==="pageContext"),[]),M=ee.useRef(!1),S=ee.useRef(!1),E=ee.useRef(void 0),F=ee.useRef(new Set),P=o??s,R=l[P]??[],D=r[P]??an.Idle,W=ee.useCallback(async(C,Y)=>{if(!n.transport.generateTitle)return;const N=n.config.features?.titleGeneration==="llm"?"llm":"local";let Z;try{Z=await n.transport.generateTitle({userId:Y,content:C,strategy:N,contextKey:i})}catch{}return Z},[n.transport,n.config.features?.titleGeneration,i]),K=ee.useCallback(async(C,Y)=>{const N=n.config.user?.id??"guest",Z=!o,te=o??s,O={current:te};E.current=te;const pe={value:C,attachments:Y??[]};m(O.current,void 0);let ge;if(Z){const we=await W(C,N);we&&we.trim().length>0&&(ge={...ge??{},title:we})}const Re=(o?n.store.getState().chats[o]:void 0)?.model,qe=a.model!==Re;let He,re=!1;qe?(He=a.model,re=!0):Re?(He=Re,re=!1):(He=void 0,re=!1);const Me={userId:N,content:C,metadata:ge,contextKey:i,...Z?{}:{chatId:o},...re?{model:He}:{},...Y&&Y.length>0?{attachments:Y}:{}},Ge=()=>{y(O.current,void 0)},Je=we=>{if(we?.name==="AbortError"){const ke=E.current??O.current;return F.current.has(ke)?(_(O.current),F.current.delete(ke)):(Ge(),t.current.setDraft(pe)),{type:"aborted"}}throw we},ze=async()=>{let we=`pending-${Date.now()}`,ke="",De;d(O.current,an.Streaming),y(O.current,{id:we,content:"",reasoning:"",toolCalls:[],attachments:[],chat:o||"",role:exports.MessageRole.Assistant,createdAt:new Date().toISOString()});try{let de=o;const et=await n.transport.streamMessage(Me,Ce=>{if(Ce.type===exports.StreamChunkType.Chat&&Ce.chat){u({...Ce.chat,messages:[]}),de=Ce.chat.id,Z&&(E.current=Ce.chat.id,h(O.current,Ce.chat.id),O.current=Ce.chat.id,p(Ce.chat.id));return}if(Ce.type===exports.StreamChunkType.Reasoning&&Ce.reasoning){ke+=Ce.reasoning,De={...De??{id:we,chat:de,role:exports.MessageRole.Assistant,content:"",createdAt:new Date().toISOString()},reasoning:ke},y(O.current,De);return}if(Ce.type===exports.StreamChunkType.Error&&Ce.error)throw new Error(Ce.error);Ce.message&&Ce.message.role===exports.MessageRole.User||Ce.message&&(we=Ce.message.id,De={...Ce.message,reasoning:ke||Ce.message.reasoning},y(O.current,De))},{streamKey:E.current});if(et){const Ce=ke&&De?{...et,messages:et.messages.map(_e=>_e.id===De.id&&_e.role===exports.MessageRole.Assistant?{..._e,reasoning:ke}:_e)}:et;return u(Ce),(n.store.getState().activeChatId??n.store.getState().draftChatKey)===O.current&&p(Ce.id),Ge(),{type:"success"}}return Ge(),{type:"success"}}catch(de){return Je(de)}};try{const we=await ze();return we.type==="success"&&(M.current=!1),we}catch(we){Ge();const ke=we?.chat;ke&&(u(ke),p(ke.id));const De=we instanceof Error?we:new Error("Failed to send message");return m(O.current,De.message||"Failed to send message"),t.current.setDraft(pe),M.current=!1,{type:"error",error:De}}finally{S.current=!1,d(O.current,an.Idle),E.current=void 0}},[o,i,a.model,n.transport,n.config.user?.id,u,p,y,d,W,e,h,t,m]),J=ee.useCallback(async()=>{if(D!==an.Idle||S.current||!R.length||M.current)return;const C=R[0];S.current=!0,g(P,C.id);try{await K(C.content,C.attachments)}finally{S.current=!1}},[D,R,P,K,g]);ee.useEffect(()=>{J()},[J]);const V=ee.useCallback(async C=>{if(S.current)return;const Y=R.find(N=>N.id===C);if(Y){M.current=!1,S.current=!0,g(P,C);try{await K(Y.content,Y.attachments)}finally{S.current=!1}}},[R,P,g,K]),I=ee.useCallback(async C=>{const N=t.current.getDraft().attachments;if(w(N)&&k(P,!0),D!==an.Idle){v(P,C,N),t.current.clearDraft();return}M.current=!1,t.current.clearDraft(),await K(C,N)},[D,v,P,K,t,w,k]),q=ee.useCallback(()=>{M.current=!0;const C=E.current??P;F.current.add(C),n.transport.cancelStream?.(C),_(C),d(C,an.Idle)},[P,n.transport,_,d]),G=ee.useCallback(async C=>{D===an.Streaming&&q(),await V(C)},[D,q,V]);return{pendingKey:P,queuedMessages:R,activeChatStatus:D,activeChatId:o,removeQueuedMessage:g,handleSubmit:I,handleStop:q,handleQueuedClick:G}},i_e=({queuedMessages:e,onSendQueued:t,onRemoveQueued:n})=>e.length?T.jsxs("div",{className:"mp-agent-composer-queue",children:[T.jsx("div",{className:"mp-agent-composer-queue-header",children:T.jsxs("span",{children:[e.length," message",e.length>1?"s":""," queued"]})}),T.jsx("div",{className:"mp-agent-composer-queue-items",children:e.map(r=>T.jsxs("div",{className:"mp-agent-composer-queue-item",children:[T.jsxs("span",{className:"mp-agent-composer-queue-item-text",children:[r.content,r.attachments?.length?T.jsxs("span",{style:{marginLeft:8,opacity:.7,display:"inline-flex",alignItems:"center",gap:4},children:[T.jsx(lo,{size:12}),r.attachments.length]}):null]}),T.jsxs("div",{className:"mp-agent-composer-queue-item-actions",children:[T.jsx("button",{type:"button",className:"mp-agent-composer-queue-button",onClick:()=>t(r.id),"aria-label":"Send queued message",children:T.jsx(jd,{size:12})}),T.jsx("button",{type:"button",className:"mp-agent-composer-queue-button",onClick:()=>n(r.id),"aria-label":"Remove queued message",children:T.jsx(c5,{size:12})})]})]},r.id))})]}):null,o_e=({options:e,value:t,onChange:n,placeholder:r="Select...",disabled:a=!1,className:i="",triggerClassName:o="",placement:s="bottom-start",searchable:l=!1,searchPlaceholder:u="Search...",searchFilter:d})=>{const[p,m]=ee.useState(!1),[h,g]=ee.useState(null),[y,v]=ee.useState(""),_=ee.useRef([]),k=ee.useRef(null),{refs:w,floatingStyles:M,context:S,isPositioned:E}=j5({open:p,onOpenChange:m,placement:s,strategy:"absolute",whileElementsMounted:D5,middleware:[$5(8),P5({fallbackPlacements:["top-start","bottom-start","top-end","bottom-end"]}),F5({padding:8})]}),F=U8e(S,{enabled:!a}),P=H5(S),R=G5(S),W=K8e(S,{listRef:_,activeIndex:h,onNavigate:g,enabled:p&&!l,virtual:!1}),{getReferenceProps:K,getFloatingProps:J,getItemProps:V}=V5(l?[F,P,R]:[F,P,R,W]),I=e.findIndex(Z=>Z.value===t),q=I>=0?e[I]:void 0,G=ee.useMemo(()=>{const Z=y.trim().toLowerCase();if(!l||!Z)return e;const O=d?pe=>d(pe,Z):pe=>`${pe.label} ${pe.description??""}`.toLowerCase().includes(Z);return e.filter(O)},[e,y,l,d]);ee.useEffect(()=>{if(!p){g(null),v("");return}l&&setTimeout(()=>k.current?.focus(),0);const Z=G.findIndex(te=>te.value===t);g(Z>=0?Z:0)},[p,l,t,G]),ee.useEffect(()=>{p&&g(G.length>0?0:null)},[y,G.length,p]);const C=Z=>G.length===0?null:Z<0?G.length-1:Z>=G.length?0:Z,Y=Z=>{Z!=null&&_.current[Z]?.scrollIntoView({block:"nearest"})},N=Z=>{n(Z),m(!1),g(null),v("")};return T.jsxs("div",{className:`mp-agent-dropdown ${i}`,children:[T.jsxs("button",{ref:w.setReference,type:"button",className:`mp-agent-dropdown-trigger ${o}`,disabled:a,"aria-expanded":p,"aria-haspopup":"listbox",...K(),children:[T.jsx("span",{className:"mp-agent-dropdown-trigger-content",children:q?T.jsxs(T.Fragment,{children:[q.icon&&T.jsx("span",{className:"mp-agent-dropdown-trigger-icon",children:q.icon}),T.jsx("span",{className:"mp-agent-dropdown-trigger-label",children:q.label})]}):T.jsx("span",{className:"mp-agent-dropdown-trigger-placeholder",children:r})}),T.jsx(a5,{size:16,className:`mp-agent-dropdown-chevron ${p?"open":""}`})]}),p&&T.jsxs("div",{role:"listbox",ref:w.setFloating,style:{...M,opacity:E?1:0,pointerEvents:E?"auto":"none",transition:E?"opacity 0.15s ease-out":"none"},className:"mp-agent-dropdown-menu",...J(),children:[l&&T.jsx("div",{className:"mp-agent-dropdown-search",onKeyDown:Z=>Z.stopPropagation(),children:T.jsx("input",{ref:k,className:"mp-agent-dropdown-search-input",value:y,placeholder:u,onChange:Z=>v(Z.target.value),onKeyDown:Z=>{if(Z.key==="Escape"){Z.preventDefault(),m(!1),v("");return}if(Z.key==="ArrowDown"||Z.key==="ArrowUp"){Z.preventDefault();const te=Z.key==="ArrowDown"?1:-1,O=h??(te>0?-1:0),pe=C(O+te);g(pe),Y(pe);return}if(Z.key==="Enter"){if(h==null)return;const te=G[h];if(!te)return;Z.preventDefault(),N(te.value)}}})}),T.jsxs("div",{className:"mp-agent-dropdown-list",children:[G.map((Z,te)=>T.jsxs("button",{ref:O=>{_.current[te]=O},type:"button",className:`mp-agent-dropdown-item ${t===Z.value?"selected":""} ${h===te?"active":""}`,role:"option","aria-selected":t===Z.value,...V({onClick:()=>N(Z.value),onMouseEnter:()=>{g(te)},onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),N(Z.value))}}),children:[Z.icon&&T.jsx("span",{className:"mp-agent-dropdown-item-icon",children:Z.icon}),T.jsxs("span",{className:"mp-agent-dropdown-item-content",children:[T.jsx("span",{className:"mp-agent-dropdown-item-label",children:Z.label}),Z.description&&T.jsx("span",{className:"mp-agent-dropdown-item-description",children:Z.description})]})]},Z.value)),l&&G.length===0&&T.jsx("div",{className:"mp-agent-dropdown-empty","aria-label":"No results",children:"No results"})]})]})]})},s_e=ee.memo(()=>{const e=ht(),t=Te(p=>p.composer),n=Te(p=>p.contextKey),r=Te(p=>p.setComposerOptions),a=e.config.models,{data:i,isLoading:o}=b3(),s=ee.useMemo(()=>{const p=i&&i.length>0?i:a;return n3(p,e.config.transport).filter(h=>!h.contexts?.length||h.contexts.includes(n))},[i,a,e.config.transport,n]),l=ee.useMemo(()=>{const p=s.slice().sort((m,h)=>m.label.localeCompare(h.label,void 0,{sensitivity:"base"})).map(m=>({value:m.id,label:m.label}));return[{value:ha,label:"Auto"},...p]},[s]),u=ee.useMemo(()=>t.model!==void 0?t.model:ha,[t.model]),d=ee.useCallback(p=>{p===ha?(r({model:void 0}),l2(e.config.transport,ha)):(r({model:p}),l2(e.config.transport,p))},[r,e.config.transport]);return o&&!a?.length||l.length===0?null:T.jsx(o_e,{options:l,value:u,onChange:d,placeholder:"Select model...",searchable:!0,searchPlaceholder:"Search models...",placement:"top-start",triggerClassName:"mp-agent-model-selector-trigger"})}),l_e=e=>{const t=e.trim();if(!t||/\s/.test(t))return;const n=i=>i.replace(/[)\].,;:!?]+$/,"");if(!/^https?:\/\//i.test(t))return;const r=i=>{try{const o=new URL(i);return o.protocol!=="http:"&&o.protocol!=="https:"?void 0:o.toString()}catch{return}},a=n(t);return r(a)},c_e=e=>{try{const t=new URL(e);return t.hostname+(t.pathname&&t.pathname!=="/"?t.pathname:"")}catch{return e}};function u_e(e,t){return e.size>t.maxFileSize?{type:"size",message:`File "${e.name}" exceeds maximum size of ${op(t.maxFileSize)}`,fileName:e.name}:null}function d_e(e,t,n){if(e.length+t.filter(s=>s.type==="file").length>n.maxFilesPerMessage)return{type:"count",message:`Maximum ${n.maxFilesPerMessage} files per message allowed`};for(const s of e){const l=u_e(s,n);if(l)return l}const a=t.filter(s=>s.type==="file").reduce((s,l)=>{const u=l.metadata?.size||l.size||0;return s+u},0),i=e.reduce((s,l)=>s+l.size,0);return a+i>n.maxTotalAttachmentsSize?{type:"totalSize",message:`Total attachment size exceeds maximum of ${op(n.maxTotalAttachmentsSize)}`}:null}function op(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return Math.round(e/Math.pow(t,r)*100)/100+" "+n[r]}function p_e(){return{maxFileSize:10*1024*1024,maxTotalAttachmentsSize:50*1024*1024,maxFilesPerMessage:10,allowedMimeTypes:void 0}}const _3=e=>{switch(e.type){case exports.AgentAttachmentType.Link:return T.jsx(s5,{size:12});case exports.AgentAttachmentType.Artifact:return T.jsx(lo,{size:12});case exports.AgentAttachmentType.Context:switch(e?.metadata?.kind){case"pageContext":return T.jsx(Vd,{size:12});case"formSnapshot":case"formField":return T.jsx(o5,{size:12});default:return T.jsx(Gd,{size:12})}case exports.AgentAttachmentType.File:default:return T.jsx(i5,{size:12})}},h_e=({attachments:e})=>!e||e.length===0?null:T.jsx("div",{className:"mp-agent-message-attachments","aria-label":"Message attachments",children:e.map(t=>{const n=T.jsxs(T.Fragment,{children:[T.jsx("span",{className:"mp-agent-message-attachment-icon",children:_3(t)}),T.jsx("span",{className:"mp-agent-message-attachment-name",children:t.name})]});return t.url?T.jsx("a",{className:"mp-agent-message-attachment",href:t.url,target:"_blank",rel:"noreferrer",title:t.url,children:n},t.id):T.jsx("span",{className:"mp-agent-message-attachment",title:t.mimeType??t.name,children:n},t.id)})}),m_e=({attachments:e,onRemove:t,uploadProgress:n,uploadErrors:r})=>{const a=Mr();return!e||e.length===0?null:T.jsx("div",{className:"mp-agent-composer-attachments","aria-label":a.attachments,children:e.map(i=>{const o=n?.get(i.id),s=r?.get(i.name),l=i.metadata?.size||i.size,u=l?` (${op(l)})`:"";return T.jsxs("span",{className:`mp-agent-attachment-chip ${s?"mp-agent-attachment-chip-error":""} ${o?.status==="uploading"?"mp-agent-attachment-chip-uploading":""}`,title:s||i.name,children:[T.jsx("span",{className:"mp-agent-attachment-chip-icon",children:_3(i)}),T.jsxs("span",{className:"mp-agent-attachment-chip-name",title:i.name,children:[i.name,u]}),o?.status==="uploading"&&T.jsxs("span",{className:"mp-agent-attachment-chip-progress",children:[o.progress,"%"]}),s&&T.jsx("span",{className:"mp-agent-attachment-chip-error-text",title:s,children:"⚠"}),t?T.jsx(ar,{size:"sm",icon:"X",type:"button",onClick:d=>{d.preventDefault(),d.stopPropagation(),t(i.id)},"aria-label":`Remove attachment ${i.name}`}):null]},i.id)})})};async function f_e(e,t,n,r){const a=await fetch(r.presignedUrlEndpoint,{method:"POST",headers:{"Content-Type":"application/json",...r.getAuthHeaders?.()||{}},body:JSON.stringify({filename:e.name,mimeType:e.type||"application/octet-stream",size:e.size,chatId:t,userId:n})});if(!a.ok){const o=await a.text();throw new Error(`Failed to get presigned URL: ${a.status} ${o}`)}const i=await a.json();return{url:i.url,key:i.key}}async function g_e(e,t,n){return new Promise((r,a)=>{const i=new XMLHttpRequest;i.upload.addEventListener("progress",o=>{if(o.lengthComputable&&n){const s=Math.round(o.loaded/o.total*100);n(s)}}),i.addEventListener("load",()=>{i.status>=200&&i.status<300?r():a(new Error(`Upload failed: ${i.status} ${i.statusText}`))}),i.addEventListener("error",()=>{a(new Error("Upload failed: network error"))}),i.addEventListener("abort",()=>{a(new Error("Upload aborted"))}),i.open("PUT",t),i.setRequestHeader("Content-Type",e.type||"application/octet-stream"),i.send(e)})}async function y_e(e,t,n){const r=Tt.nanoid(),a={fileId:r,fileName:e.name,progress:0,status:"pending"};try{n.onProgress?.({...a,status:"uploading",progress:0});const{url:i,key:o}=await f_e(e,n.chatId,n.userId,t);return await g_e(e,i,s=>{n.onProgress?.({...a,status:"uploading",progress:s})}),n.onProgress?.({...a,status:"completed",progress:100}),{id:r,type:exports.AgentAttachmentType.File,name:e.name,mimeType:e.type||void 0,size:e.size,metadata:{uploadedAt:new Date().toISOString(),s3Key:o,processingStatus:"pending",size:e.size,lastModified:e.lastModified}}}catch(i){const o=i instanceof Error?i.message:"Unknown error";throw n.onProgress?.({...a,status:"error",error:o}),i}}async function b_e(e,t,n){const r=await Promise.allSettled(e.map(o=>y_e(o,t,n))),a=[],i=[];if(r.forEach((o,s)=>{o.status==="fulfilled"?a.push(o.value):i.push(new Error(`Failed to process ${e[s].name}: ${o.reason}`))}),i.length>0&&a.length===0)throw i[0];return i.length>0&&console.warn("Some files failed to upload:",i),a}const fd="mp-agent:locationchange",f2="__mp_agent_history_patched__",g2=()=>{try{window.dispatchEvent(new Event(fd))}catch{}},k_e=()=>{if(typeof window>"u")return;const e=window;if(!e[f2]){e[f2]=!0;try{const t=history.pushState;history.pushState=function(...n){const r=t.apply(this,n);return g2(),r}}catch{}try{const t=history.replaceState;history.replaceState=function(...n){const r=t.apply(this,n);return g2(),r}}catch{}}},v_e=e=>{if(typeof window>"u")return()=>{};k_e();const t=()=>e();return window.addEventListener("popstate",t),window.addEventListener("hashchange",t),window.addEventListener(fd,t),()=>{window.removeEventListener("popstate",t),window.removeEventListener("hashchange",t),window.removeEventListener(fd,t)}},__e=ee.forwardRef(({autoFocus:e,activeChatId:t,status:n,onStop:r,onSubmit:a},i)=>{const o=Mr(),s=ht(),l=ee.useRef(null),u=ee.useRef(null),d=Te(re=>re.activeChatId??re.draftChatKey),p=Te(re=>re.composerDraftByChat[d]??{value:"",attachments:[]}),m=Te(re=>re.composerErrorByChat[d]),h=Te(re=>re.pageContextDismissedByChatKey[d]??!1),g=Te(re=>re.setComposerValue),y=Te(re=>re.setComposerDraft),v=Te(re=>re.clearComposerDraft),_=Te(re=>re.setComposerError),k=Te(re=>re.addComposerAttachments),w=Te(re=>re.removeComposerAttachment),M=Te(re=>re.setPageContextDismissed),S=p.value,E=p.attachments,[F,P]=ee.useState(new Map),[R,D]=ee.useState(new Map),W=ee.useRef(S),K=ee.useRef(E),J=ee.useRef(h),V=s.config.features?.pageContextAttachments!==!1,I=re=>re.type===exports.AgentAttachmentType.Context&&re?.metadata?.kind==="pageContext",q=E.some(I),G=()=>{if(V)return s.buildPageContextAttachment()};ee.useEffect(()=>{K.current=E},[E]),ee.useEffect(()=>{W.current=S},[S]),ee.useEffect(()=>{J.current=h},[h]),ee.useEffect(()=>{if(!V||h||q)return;const re=G();re&&k(d,[re])},[V,h,q,d,k]),ee.useEffect(()=>{if(V&&!(typeof window>"u"))return v_e(()=>{if(J.current)return;const re=K.current,Me=re.find(I);if(!Me)return;const Ge=G();if(!Ge)return;const Je={...Ge,id:Me.id},ze=re.map(we=>we.id===Me.id?Je:we);y(d,{value:W.current,attachments:ze})})},[V,d,y]),ee.useImperativeHandle(i,()=>({setValue:re=>{g(d,re)},getDraft:()=>({value:S,attachments:E}),setDraft:re=>{y(d,{value:re.value,attachments:re.attachments??[]})},clearDraft:()=>{v(d)}})),ee.useEffect(()=>{const re=l.current;re&&(re.style.height="auto",re.style.height=`${Math.min(re.scrollHeight,200)}px`)},[S]);const C=async re=>{if(!re||re.length===0)return;const Me=Array.from(re),Ge=p_e(),Je=d_e(Me,E,Ge);if(Je){D(ze=>{const we=new Map(ze);return Me.forEach(ke=>{we.set(ke.name,Je.message)}),we});return}D(ze=>{const we=new Map(ze);return Me.forEach(ke=>we.delete(ke.name)),we});try{const ze=s.config.transport;if(ze.mode!=="proxy")throw new Error("File uploads are only supported with proxy transport");const we={presignedUrlEndpoint:`${ze.baseUrl}/files/upload/presigned`,getAuthHeaders:()=>{const De={};return ze.headers?ze.headers:(ze.apiKey&&(De.Authorization=`Bearer ${ze.apiKey}`),De)}},ke=await b_e(Me,we,{chatId:t,userId:s.config.user?.id,onProgress:De=>{P(de=>{const et=new Map(de);return et.set(De.fileId,De),et})}});k(d,ke),setTimeout(()=>{P(De=>{const de=new Map(De);return ke.forEach(et=>de.delete(et.id)),de})},2e3)}catch(ze){const we=ze instanceof Error?ze.message:"Failed to upload files";D(ke=>{const De=new Map(ke);return Me.forEach(de=>{De.set(de.name,we)}),De})}},Y=()=>{u.current?.click()},N=re=>{const Me=l_e(re);if(!Me)return!1;if(E.some(ze=>ze.type===exports.AgentAttachmentType.Link&&ze.url===Me))return!0;const Ge=c_e(Me),Je={id:Tt.nanoid(),url:Me,name:Ge,type:exports.AgentAttachmentType.Link};return k(d,[Je]),!0},Z=async re=>{await C(re.target.files),re.target.value=""},te=re=>{const Me=E.find(Ge=>Ge.id===re);Me&&I(Me)&&M(d,!0),w(d,re)},O=()=>{if(typeof window>"u"||typeof document>"u")return!1;const re=Z5(),Me=re?.selectedText??window.getSelection?.()?.toString()?.trim()??"";if(!Me)return!1;const Ge=window.location?.href,Je=Me.slice(0,20),ze=Me.length>20?Je+"...":Me,we=_o({kind:"webSnippet",url:Ge,title:ze,selectedText:Me,source:{app:"browser",url:Ge},...re?.target?{target:re.target}:{}});return k(d,[we]),!0},pe=re=>{re.preventDefault();const Me=S.trim();Me&&(_(d,void 0),a(Me))},ge=re=>{re.key==="Enter"&&!re.shiftKey&&(re.preventDefault(),pe(re))},ve=re=>{m&&_(d,void 0),g(d,re.target.value)},Re=re=>{if(re.nativeEvent.shiftKey)return;const Me=re.clipboardData?.getData("text/plain")??"";if(!Me)return;N(Me)&&re.preventDefault()},He=!!S.trim();return T.jsxs("form",{onSubmit:pe,className:"mp-agent-composer-input-wrapper",children:[T.jsx("input",{ref:u,type:"file",multiple:!0,style:{display:"none"},onChange:Z}),T.jsx(m_e,{attachments:E,onRemove:te,uploadProgress:F,uploadErrors:R}),T.jsx("textarea",{rows:2,name:"message",ref:l,value:S,autoFocus:e,className:"mp-agent-composer-textarea",placeholder:t?o.followUp:o.newChat,onChange:ve,onKeyDown:ge,onPaste:Re}),T.jsxs("div",{className:"mp-agent-composer-actions",children:[T.jsxs("div",{className:"mp-agent-composer-actions-left",children:[s.config.features?.modelSwitching&&T.jsx(s_e,{}),T.jsx(Jn,{content:o.attachFiles,children:T.jsx("button",{type:"button",className:"mp-agent-composer-button mp-agent-composer-tool-button",onClick:Y,"aria-label":o.attachFiles,children:T.jsx(lo,{size:16})})}),T.jsx(Jn,{content:o.attachSelectionToContext,children:T.jsx("button",{type:"button",className:"mp-agent-composer-button mp-agent-composer-tool-button",onClick:()=>{O()},"aria-label":o.attachSelectionToContext,children:T.jsx(Gd,{size:16})})}),V&&!q&&T.jsx(Jn,{content:"Attach page context",children:T.jsx("button",{type:"button",className:"mp-agent-composer-button mp-agent-composer-tool-button",onClick:()=>{M(d,!1);const re=G();re&&k(d,[re])},"aria-label":"Attach page context",children:T.jsx(Vd,{size:16})})})]}),T.jsx("div",{className:"mp-agent-composer-actions-right",children:n===an.Streaming&&!He?T.jsx(Jn,{content:o.stopStreaming,children:T.jsx("button",{type:"button",onClick:r,"aria-label":o.stopStreaming,className:"mp-agent-composer-button mp-agent-composer-send-button",children:T.jsx(l5,{size:12})})}):T.jsx(Jn,{content:He?o.sendMessage:o.typeMessageToSend,children:T.jsx("button",{type:"submit",disabled:!He,"aria-label":o.sendMessage,className:"mp-agent-composer-button mp-agent-composer-send-button",children:T.jsx(jd,{size:16})})})})]}),m?T.jsx("div",{className:"mp-agent-composer-error",children:m}):null]})}),w3=({autoFocus:e})=>{const t=ee.useRef({setValue:()=>{},getDraft:()=>({value:"",attachments:[]}),setDraft:()=>{},clearDraft:()=>{}}),{pendingKey:n,queuedMessages:r,activeChatStatus:a,activeChatId:i,handleSubmit:o,handleStop:s,handleQueuedClick:l,removeQueuedMessage:u}=a_e({composerFormRef:t});return T.jsx("div",{className:"mp-agent-composer-wrapper",children:T.jsxs("div",{className:"mp-agent-composer",children:[T.jsx(i_e,{queuedMessages:r,onSendQueued:l,onRemoveQueued:d=>u(n,d)}),T.jsx(__e,{status:a,ref:t,autoFocus:e,activeChatId:i,onStop:s,onSubmit:o})]})})},w_e=()=>{const e=ht(),t=e.config.user?.id??ap(),n=Te(u=>u.activeChatId),r=Te(u=>u.removeChat),a=Te(u=>u.setActiveChat),[i,o]=ee.useState(new Set),s=ee.useCallback(async u=>{o(d=>new Set(d).add(u));try{await e.transport.deleteChat(u),r(u),n===u&&a(void 0),e.queryClient.invalidateQueries({queryKey:["mp-agents","chats",t]})}finally{o(d=>{const p=new Set(d);return p.delete(u),p})}},[n,r,e.queryClient,e.transport,a,t]),l=ee.useCallback(u=>i.has(u),[i]);return{deleteChat:s,isDeleting:l}},x_e=()=>{const e=Mr(),{deleteChat:t,isDeleting:n}=w_e(),r=Te(s=>s.chats),a=Te(s=>s.activeChatId),i=Te(s=>s.setActiveChat),o=ee.useMemo(()=>Object.values(r).sort((s,l)=>s.updatedAt===l.updatedAt?0:s.updatedAt<l.updatedAt?1:-1),[r]);return T.jsxs("section",{className:"mp-agent-chat-history",children:[T.jsx("h4",{children:e.chats}),o.length===0?T.jsx("div",{className:"mp-agent-chat-history-empty",children:e.noChatsYet}):T.jsx("ul",{className:"mp-agent-chat-history-list",children:o.map(s=>{const l=s.id===a;return T.jsxs("li",{onClick:()=>i(s.id),className:`mp-agent-chat-history-item${l?" active":""}`,children:[T.jsxs("div",{className:"mp-agent-chat-history-item-content",children:[T.jsx("span",{className:"mp-agent-chat-history-item-title",children:s.title||e.untitledChat}),T.jsx("span",{className:"mp-agent-chat-history-item-meta",children:new Date(s.updatedAt).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]}),T.jsx("div",{className:"mp-agent-chat-history-item-actions",children:T.jsx(Jn,{content:e.deleteChat,children:T.jsx(ar,{size:"sm",icon:"Archive","aria-label":e.deleteChat,disabled:n(s.id),onClick:u=>{u.stopPropagation(),t(s.id)}})})})]},s.id)})})]})},E_e=e=>{const t=ht(),n=Te(a=>a.isChatHistoryOpen);return!(t.config.features?.historySidebar!==!1)||!n?null:T.jsx("div",{className:"mp-agent-chat-history-panel",children:T.jsx(x_e,{})})},M_e=({onClose:e})=>{const t=Mr(),r=ht().config.features?.historySidebar!==!1,a=Te(l=>l.isChatHistoryOpen),i=Te(l=>l.setChatHistoryOpen),o=Te(l=>l.setActiveChat),s=()=>{o(void 0)};return T.jsxs("div",{className:"mp-agent-agent-controls",children:[T.jsxs("div",{className:"mp-agent-agent-controls-left",children:[r&&T.jsx(ar,{onClick:()=>i(!a),icon:a?"PanelLeftClose":"PanelLeftOpen",tooltip:a?t.hideChatHistory:t.showChatHistory,"aria-label":a?t.hideChatHistory:t.showChatHistory}),T.jsx(ar,{onClick:s,icon:"SquarePen","aria-label":t.newChat,tooltip:t.newChat})]}),t.panelTitle&&T.jsx("div",{className:"mp-agent-agent-controls-title",children:T.jsx("h4",{children:t.panelTitle})}),e&&T.jsx("div",{className:"mp-agent-agent-controls-right",children:T.jsx(ar,{onClick:e,icon:"X","aria-label":t.close,tooltip:t.close})})]})},S_e=({children:e})=>{const t=Te(n=>n.isChatHistoryOpen);return T.jsx("section",{className:`mp-agent-main ${t?"with-chat-history":""}`,children:e})},x3=ee.memo(({role:e,isGrouped:t})=>{if(t)return T.jsx("div",{className:"mp-agent-message-avatar-spacer"});const n=e===exports.MessageRole.User,r=n?"You":"AI";return T.jsx("div",{className:`mp-agent-message-avatar ${n?"mp-agent-message-avatar-user":""}`,children:T.jsx("div",{className:"mp-agent-message-avatar-icon",children:r})})});x3.displayName="MessageAvatar";const N_e=e=>e?new Date(e).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"}):"",E3=ee.memo(({role:e,createdAt:t,isGrouped:n})=>{if(n)return null;const a=e===exports.MessageRole.User?"You":"Assistant";return T.jsxs("div",{className:"mp-agent-message-header",children:[T.jsx("span",{className:"mp-agent-message-role",children:a}),T.jsx("span",{className:"mp-agent-message-time",children:N_e(t)})]})});E3.displayName="MessageHeader";function y2(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const o=n.slice(a,r).trim();(o||!i)&&t.push(o),a=r+1,r=n.indexOf(",",a)}return t}function A_e(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const T_e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,C_e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,R_e={};function b2(e,t){return(R_e.jsx?C_e:T_e).test(e)}const I_e=/[ \t\n\f\r]/g;function O_e(e){return typeof e=="object"?e.type==="text"?k2(e.value):!1:k2(e)}function k2(e){return e.replace(I_e,"")===""}let Ua=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};Ua.prototype.normal={};Ua.prototype.property={};Ua.prototype.space=void 0;function M3(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Ua(n,r,t)}function Ta(e){return e.toLowerCase()}let Vt=class{constructor(t,n){this.attribute=n,this.property=t}};Vt.prototype.attribute="";Vt.prototype.booleanish=!1;Vt.prototype.boolean=!1;Vt.prototype.commaOrSpaceSeparated=!1;Vt.prototype.commaSeparated=!1;Vt.prototype.defined=!1;Vt.prototype.mustUseProperty=!1;Vt.prototype.number=!1;Vt.prototype.overloadedBoolean=!1;Vt.prototype.property="";Vt.prototype.spaceSeparated=!1;Vt.prototype.space=void 0;let L_e=0;const $e=Sr(),bt=Sr(),gd=Sr(),ce=Sr(),it=Sr(),Kr=Sr(),Yt=Sr();function Sr(){return 2**++L_e}const yd=Object.freeze(Object.defineProperty({__proto__:null,boolean:$e,booleanish:bt,commaOrSpaceSeparated:Yt,commaSeparated:Kr,number:ce,overloadedBoolean:gd,spaceSeparated:it},Symbol.toStringTag,{value:"Module"})),us=Object.keys(yd);let sp=class extends Vt{constructor(t,n,r,a){let i=-1;if(super(t,n),v2(this,"space",a),typeof r=="number")for(;++i<us.length;){const o=us[i];v2(this,us[i],(r&yd[o])===yd[o])}}};sp.prototype.defined=!0;function v2(e,t,n){n&&(e[t]=n)}function ta(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const i=new sp(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Ta(r)]=r,n[Ta(i.attribute)]=r}return new Ua(t,n,e.space)}const S3=ta({properties:{ariaActiveDescendant:null,ariaAtomic:bt,ariaAutoComplete:null,ariaBusy:bt,ariaChecked:bt,ariaColCount:ce,ariaColIndex:ce,ariaColSpan:ce,ariaControls:it,ariaCurrent:null,ariaDescribedBy:it,ariaDetails:null,ariaDisabled:bt,ariaDropEffect:it,ariaErrorMessage:null,ariaExpanded:bt,ariaFlowTo:it,ariaGrabbed:bt,ariaHasPopup:null,ariaHidden:bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:it,ariaLevel:ce,ariaLive:null,ariaModal:bt,ariaMultiLine:bt,ariaMultiSelectable:bt,ariaOrientation:null,ariaOwns:it,ariaPlaceholder:null,ariaPosInSet:ce,ariaPressed:bt,ariaReadOnly:bt,ariaRelevant:null,ariaRequired:bt,ariaRoleDescription:it,ariaRowCount:ce,ariaRowIndex:ce,ariaRowSpan:ce,ariaSelected:bt,ariaSetSize:ce,ariaSort:null,ariaValueMax:ce,ariaValueMin:ce,ariaValueNow:ce,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function N3(e,t){return t in e?e[t]:t}function A3(e,t){return N3(e,t.toLowerCase())}const D_e=ta({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Kr,acceptCharset:it,accessKey:it,action:null,allow:null,allowFullScreen:$e,allowPaymentRequest:$e,allowUserMedia:$e,alt:null,as:null,async:$e,autoCapitalize:null,autoComplete:it,autoFocus:$e,autoPlay:$e,blocking:it,capture:null,charSet:null,checked:$e,cite:null,className:it,cols:ce,colSpan:null,content:null,contentEditable:bt,controls:$e,controlsList:it,coords:ce|Kr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$e,defer:$e,dir:null,dirName:null,disabled:$e,download:gd,draggable:bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$e,formTarget:null,headers:it,height:ce,hidden:gd,high:ce,href:null,hrefLang:null,htmlFor:it,httpEquiv:it,id:null,imageSizes:null,imageSrcSet:null,inert:$e,inputMode:null,integrity:null,is:null,isMap:$e,itemId:null,itemProp:it,itemRef:it,itemScope:$e,itemType:it,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$e,low:ce,manifest:null,max:null,maxLength:ce,media:null,method:null,min:null,minLength:ce,multiple:$e,muted:$e,name:null,nonce:null,noModule:$e,noValidate:$e,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:$e,optimum:ce,pattern:null,ping:it,placeholder:null,playsInline:$e,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$e,referrerPolicy:null,rel:it,required:$e,reversed:$e,rows:ce,rowSpan:ce,sandbox:it,scope:null,scoped:$e,seamless:$e,selected:$e,shadowRootClonable:$e,shadowRootDelegatesFocus:$e,shadowRootMode:null,shape:null,size:ce,sizes:null,slot:null,span:ce,spellCheck:bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ce,step:null,style:null,tabIndex:ce,target:null,title:null,translate:null,type:null,typeMustMatch:$e,useMap:null,value:bt,width:ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:it,axis:null,background:null,bgColor:null,border:ce,borderColor:null,bottomMargin:ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:$e,declare:$e,event:null,face:null,frame:null,frameBorder:null,hSpace:ce,leftMargin:ce,link:null,longDesc:null,lowSrc:null,marginHeight:ce,marginWidth:ce,noResize:$e,noHref:$e,noShade:$e,noWrap:$e,object:null,profile:null,prompt:null,rev:null,rightMargin:ce,rules:null,scheme:null,scrolling:bt,standby:null,summary:null,text:null,topMargin:ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ce,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:$e,disableRemotePlayback:$e,prefix:null,property:null,results:ce,security:null,unselectable:null},space:"html",transform:A3}),z_e=ta({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Yt,accentHeight:ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ce,amplitude:ce,arabicForm:null,ascent:ce,attributeName:null,attributeType:null,azimuth:ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ce,by:null,calcMode:null,capHeight:ce,className:it,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ce,diffuseConstant:ce,direction:null,display:null,dur:null,divisor:ce,dominantBaseline:null,download:$e,dx:null,dy:null,edgeMode:null,editable:null,elevation:ce,enableBackground:null,end:null,event:null,exponent:ce,externalResourcesRequired:null,fill:null,fillOpacity:ce,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Kr,g2:Kr,glyphName:Kr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ce,horizOriginX:ce,horizOriginY:ce,id:null,ideographic:ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ce,k:ce,k1:ce,k2:ce,k3:ce,k4:ce,kernelMatrix:Yt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ce,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ce,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ce,overlineThickness:ce,paintOrder:null,panose1:null,path:null,pathLength:ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:it,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ce,pointsAtY:ce,pointsAtZ:ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Yt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Yt,rev:Yt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Yt,requiredFeatures:Yt,requiredFonts:Yt,requiredFormats:Yt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ce,specularExponent:ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ce,strikethroughThickness:ce,string:null,stroke:null,strokeDashArray:Yt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ce,strokeOpacity:ce,strokeWidth:null,style:null,surfaceScale:ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Yt,tabIndex:ce,tableValues:null,target:null,targetX:ce,targetY:ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Yt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ce,underlineThickness:ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ce,values:null,vAlphabetic:ce,vMathematical:ce,vectorEffect:null,vHanging:ce,vIdeographic:ce,version:null,vertAdvY:ce,vertOriginX:ce,vertOriginY:ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:N3}),T3=ta({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),C3=ta({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:A3}),R3=ta({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),$_e={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},F_e=/[A-Z]/g,_2=/-[a-z]/g,P_e=/^data[-\w.:]+$/i;function I3(e,t){const n=Ta(t);let r=t,a=Vt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&P_e.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(_2,q_e);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!_2.test(i)){let o=i.replace(F_e,B_e);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}a=sp}return new a(r,t)}function B_e(e){return"-"+e.toLowerCase()}function q_e(e){return e.charAt(1).toUpperCase()}const O3=M3([S3,D_e,T3,C3,R3],"html"),Eo=M3([S3,z_e,T3,C3,R3],"svg");function w2(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function U_e(e){return e.join(" ").trim()}var lp={},x2=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,H_e=/\n/g,j_e=/^\s*/,V_e=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,G_e=/^:\s*/,W_e=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,K_e=/^[;\s]*/,Y_e=/^\s+|\s+$/g,Z_e=`
|