@decocms/mesh 2.29.0 → 2.29.2
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/client/assets/{AlertCircle-3Pxg2P_i.js → AlertCircle-BjDAjYli.js} +1 -1
- package/dist/client/assets/{ArrowLeft-UBssGQ3_.js → ArrowLeft-C3b0kZkv.js} +1 -1
- package/dist/client/assets/{ArrowUp-MnVdQxWX.js → ArrowUp-UuyzMrp7.js} +1 -1
- package/dist/client/assets/{Check-yoiyrqoL.js → Check-BBlt8nj4.js} +1 -1
- package/dist/client/assets/{ChevronDown-BlKqZ66z.js → ChevronDown-C2nnNiko.js} +1 -1
- package/dist/client/assets/{Code01-RmXixa6y.js → Code01-BkX8PbNA.js} +1 -1
- package/dist/client/assets/{Copy01-BLLmXBc5.js → Copy01-eVnag3mk.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-BMMtv2wO.js → DotsHorizontal-D8Oa-FB4.js} +1 -1
- package/dist/client/assets/{DotsVertical-PBjWbzwJ.js → DotsVertical-Cl1hRwhg.js} +1 -1
- package/dist/client/assets/{Download01-DF_DLE8P.js → Download01-BW7f1rv9.js} +1 -1
- package/dist/client/assets/{Edit01-DjKKkpJx.js → Edit01-C2f_e3xp.js} +1 -1
- package/dist/client/assets/{File06-BvoVIa2F.js → File06-D5XMLdKt.js} +1 -1
- package/dist/client/assets/{FilterLines-ysuOZUy8.js → FilterLines-ZY2ZET-V.js} +1 -1
- package/dist/client/assets/{FlipBackward-DwAzBzjC.js → FlipBackward-BX_e7PV2.js} +1 -1
- package/dist/client/assets/{GitBranch01-RTsu2Pt_.js → GitBranch01-BBkuZ0g6.js} +1 -1
- package/dist/client/assets/{Grid01-CNEf3UoL.js → Grid01-uChhmLMS.js} +1 -1
- package/dist/client/assets/{Home02-DsDxDk7R.js → Home02-C3AGNyGt.js} +1 -1
- package/dist/client/assets/{Image01-B3DlQYAI.js → Image01-Ca9fCk1g.js} +1 -1
- package/dist/client/assets/{Inbox01-CuXfbhAN.js → Inbox01-7yaEdhih.js} +1 -1
- package/dist/client/assets/{InfoCircle-BCsSecsp.js → InfoCircle-ZFVXEe-o.js} +1 -1
- package/dist/client/assets/{Key01-B3Ctc8kf.js → Key01-BVzZzDXG.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BNdqcBWP.js → LinkExternal01-DYbIdjWG.js} +1 -1
- package/dist/client/assets/{List-DFdv7PYp.js → List-DTNJ5e_Z.js} +1 -1
- package/dist/client/assets/{Loading01-BkVbIYYs.js → Loading01-CVbOjnPi.js} +1 -1
- package/dist/client/assets/{Lock01-Cza9iYC8.js → Lock01-Irv7dEl1.js} +1 -1
- package/dist/client/assets/{Play-DzPpZmgI.js → Play-el8E8avm.js} +1 -1
- package/dist/client/assets/{Plus-qNfisIQV.js → Plus-jsBXu2Jm.js} +1 -1
- package/dist/client/assets/{SearchMd-DEod-sVt.js → SearchMd-CDx95UHX.js} +1 -1
- package/dist/client/assets/{Terminal-DX8xM5mx.js → Terminal-C4vz1dQ0.js} +1 -1
- package/dist/client/assets/{Trash01-C_UVJByK.js → Trash01-hrLLpuYX.js} +1 -1
- package/dist/client/assets/{Upload01-BNJScnq4.js → Upload01-CdFUIAAb.js} +1 -1
- package/dist/client/assets/{X-DRPZjxg9.js → X-Bp6jT_CT.js} +1 -1
- package/dist/client/assets/{XClose-C6hd5X95.js → XClose-ChfIwjbU.js} +1 -1
- package/dist/client/assets/{agent-detail-DNkb-49S.js → agent-detail-BvL0RN-C.js} +1 -1
- package/dist/client/assets/{agents-BTk5hI-B.js → agents-CDU0paf2.js} +1 -1
- package/dist/client/assets/{alert-dialog-z1mADwEG.js → alert-dialog-5F29h7ch.js} +1 -1
- package/dist/client/assets/{auth-catchall-CMnpQH0c.js → auth-catchall-BnUTAkiU.js} +1 -1
- package/dist/client/assets/{avatar-CyD4y-Hs.js → avatar-_fJCi1jf.js} +1 -1
- package/dist/client/assets/{badge-BI_bD2v6.js → badge-DIpSEo79.js} +1 -1
- package/dist/client/assets/{binder-Cl6WsAkI.js → binder-QE3BUq_4.js} +1 -1
- package/dist/client/assets/{button-BjyFV51s.js → button-BID2CMhP.js} +1 -1
- package/dist/client/assets/{card-Bqtkl7sF.js → card-6juGo41K.js} +1 -1
- package/dist/client/assets/{checkbox-i6HycpjB.js → checkbox-BR6ZWQcp.js} +1 -1
- package/dist/client/assets/{collection-detail-BN9YxuXP.js → collection-detail-DdU0S4bC.js} +1 -1
- package/dist/client/assets/{collection-display-button-DbY33BY1.js → collection-display-button-CES97i9G.js} +1 -1
- package/dist/client/assets/{collection-header-Bqiij5-y.js → collection-header-C2jCnQ0V.js} +1 -1
- package/dist/client/assets/{collection-page-CK2pCBvw.js → collection-page-DQBRHwuf.js} +1 -1
- package/dist/client/assets/{collection-search-CDy1ALDw.js → collection-search-CYQ70Hoa.js} +1 -1
- package/dist/client/assets/{collection-tab-BldVah7T.js → collection-tab-5E9Q1B_9.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-m7An0eu5.js → collection-table-wrapper-CVkp-9hJ.js} +1 -1
- package/dist/client/assets/{connection-BsqnB2FJ.js → connection-CzagOXhI.js} +1 -1
- package/dist/client/assets/{connection-card-D5p4qN7C.js → connection-card-De1P7KUX.js} +1 -1
- package/dist/client/assets/{connection-detail-KMMxIPtX.js → connection-detail-C6yPmWnc.js} +1 -1
- package/dist/client/assets/{connections-BplBxopq.js → connections-JU4CGCz5.js} +1 -1
- package/dist/client/assets/constants-VQyKSexs.js +1 -0
- package/dist/client/assets/{create-organization-dialog-De9L3SMV.js → create-organization-dialog-DjIYezTr.js} +1 -1
- package/dist/client/assets/{dialog-BNsW_zrz.js → dialog-N6lD2G23.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CHWSOD8_.js → dropdown-menu-CZuHPcK3.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-BdNV8xr5.js → dynamic-plugin-layout-D2QU16mz.js} +1 -1
- package/dist/client/assets/{empty-state-DyuI9nxj.js → empty-state-B2MmEXSc.js} +1 -1
- package/dist/client/assets/{empty-state-C5i2xL9Y.js → empty-state-aph8hymo.js} +1 -1
- package/dist/client/assets/{env-vars-editor-CV9yJnb-.js → env-vars-editor-Bw5ArpUL.js} +1 -1
- package/dist/client/assets/{error-boundary-DAH5w09n.js → error-boundary-BSc3aikh.js} +1 -1
- package/dist/client/assets/extract-connection-data-DsBhcJbM.js +1 -0
- package/dist/client/assets/{file-browser-DahftWvE.js → file-browser-C7oCWAQD.js} +2 -2
- package/dist/client/assets/{form-CpXA-_lk.js → form-R15NVDAL.js} +1 -1
- package/dist/client/assets/{grid-view-wdDD9CmD.js → grid-view-CW_NhGu9.js} +1 -1
- package/dist/client/assets/{home-CBA6ueFs.js → home-QfrULyzV.js} +1 -1
- package/dist/client/assets/{index-Acn1-Gvl.js → index-BfX1PMhV.js} +2 -2
- package/dist/client/assets/{index-RkAiu7dw.js → index-C0cxXUhv.js} +2 -2
- package/dist/client/assets/{index-Bi6yHeuG.js → index-DJuj6s5W.js} +2 -2
- package/dist/client/assets/{index-mkoS7UEj.js → index-kNWs-Kaj.js} +1 -1
- package/dist/client/assets/{index-ipYvuB0t.js → index-wl-vFw7b.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DH6m7Sll.js → infiniteQueryObserver-CzQcKMvF.js} +1 -1
- package/dist/client/assets/{input-DRcixE8Y.js → input-DHdPZHvh.js} +1 -1
- package/dist/client/assets/{layout-BiNRh0l3.js → layout-DVqtFrGe.js} +1 -1
- package/dist/client/assets/{localstorage-keys-dTkn_1-n.js → localstorage-keys-CySryjw_.js} +1 -1
- package/dist/client/assets/{login-QUKgRhwS.js → login-DK-wLmSi.js} +1 -1
- package/dist/client/assets/{mcp-oauth-B-g9ojPu.js → mcp-oauth-C_uVzdje.js} +1 -1
- package/dist/client/assets/{mcp-server-card-XwnUNNr9.js → mcp-server-card-utdZ5S32.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-cPnmRiqN.js → mcp-server-detail-MhY6fdyG.js} +1 -1
- package/dist/client/assets/{members-Cei1ckuA.js → members-BM4vbqXY.js} +1 -1
- package/dist/client/assets/{monaco-editor-8ajNlMw5.js → monaco-editor-Bvv8L85C.js} +1 -1
- package/dist/client/assets/{monitoring-BK7JN-tH.js → monitoring-CaEhdIcr.js} +1 -1
- package/dist/client/assets/{oauth-callback-DljX8KLG.js → oauth-callback-HFODG9C4.js} +1 -1
- package/dist/client/assets/{page-C0J8_JPM.js → page-0IgoQPj0.js} +1 -1
- package/dist/client/assets/{page-5AfD8I9m.js → page-BbtKYCEh.js} +1 -1
- package/dist/client/assets/{pin-to-sidebar-button-KizaOWag.js → pin-to-sidebar-button-BTWnJIgz.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-IozJJ6yY.js → plugin-empty-state-LAcvmaUO.js} +1 -1
- package/dist/client/assets/{plugin-header-Cjl2nXLB.js → plugin-header-CIa7SNC1.js} +1 -1
- package/dist/client/assets/{plugins-BC6u2kHV.js → plugins-Zgv-qqyu.js} +1 -1
- package/dist/client/assets/{popover-CRsqCTCD.js → popover-ffhxj7L9.js} +1 -1
- package/dist/client/assets/{project-context-provider-CMPckjDL.js → project-context-provider-CG5Jt9jX.js} +1 -1
- package/dist/client/assets/{registry-utils-4u_OxIPh.js → registry-utils-Cqqa8TSE.js} +1 -1
- package/dist/client/assets/{resizable-CwB-UcIk.js → resizable-e7LRtN-0.js} +1 -1
- package/dist/client/assets/{resource-tabs-Bok-aIug.js → resource-tabs-B6SPH4Q6.js} +1 -1
- package/dist/client/assets/schema-BesiDnBO.js +1 -0
- package/dist/client/assets/{select-De66oXlo.js → select-Cd19OBy8.js} +1 -1
- package/dist/client/assets/{settings-Dg0_jjfj.js → settings-DgjJ7rwy.js} +1 -1
- package/dist/client/assets/shell-layout-C4m50Amb.js +3 -0
- package/dist/client/assets/{spinner-B5BpFruc.js → spinner-B3XPkxOB.js} +1 -1
- package/dist/client/assets/{switch-Dptn4iU8.js → switch-rXNPyRWr.js} +1 -1
- package/dist/client/assets/{textarea-Cp2Q3idX.js → textarea-B0dfI4Xu.js} +1 -1
- package/dist/client/assets/{tool-set-selector-BmmXkAMq.js → tool-set-selector-DCV0H2hh.js} +1 -1
- package/dist/client/assets/{tools-list-CWezcmVT.js → tools-list-DcCgeTm7.js} +1 -1
- package/dist/client/assets/{tooltip-D_6S8XJj.js → tooltip-BpIeWmG3.js} +1 -1
- package/dist/client/assets/{typewriter-title-CJ3wXYvb.js → typewriter-title-vmu3HKS1.js} +1 -1
- package/dist/client/assets/{use-binding-CtNasu81.js → use-binding-CmWOKG-X.js} +1 -1
- package/dist/client/assets/{use-collections-B3q4szKJ.js → use-collections-BRVu5nwP.js} +1 -1
- package/dist/client/assets/{use-connection-B4LwqzAy.js → use-connection-D__nfNf6.js} +1 -1
- package/dist/client/assets/{use-connection-resources-DhxK4nxY.js → use-connection-resources-CaArMBqO.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BHiCN5B5.js → use-create-virtual-mcp-CULFY9tZ.js} +1 -1
- package/dist/client/assets/{use-list-state-v0o-iQLf.js → use-list-state-D7wpG1Rh.js} +1 -1
- package/dist/client/assets/{use-mcp-Zshi-uBD.js → use-mcp-DsR0-4yM.js} +1 -1
- package/dist/client/assets/{use-members-Ck3lla8J.js → use-members-BTTcGaAb.js} +1 -1
- package/dist/client/assets/{use-mobile-JMRj2bzL.js → use-mobile-Bw0zGvKx.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CbfCpvPO.js → use-organization-settings-DYYG9Qqm.js} +1 -1
- package/dist/client/assets/{use-tool-call-uKJah0MZ.js → use-tool-call-DdCnWg9K.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-zI75jpyP.js → use-virtual-mcp-aCxo16E3.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-system-prompt-BL6VfgiI.js → use-virtual-mcp-system-prompt-Be4EZZHh.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Dee7xpCM.js +1 -0
- package/dist/client/assets/{useMutation-DiXSqFla.js → useMutation-DujnxbMG.js} +1 -1
- package/dist/client/assets/useQuery-CENoGrPp.js +1 -0
- package/dist/client/assets/{value-BYci-qfm.js → value-BpSoQ0Q3.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-C9TxrmrJ.js → view-mode-toggle--WEYRZgf.js} +1 -1
- package/dist/client/assets/{workflow-8HIYz4H7.js → workflow-DtxWy1GI.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +138 -138
- package/dist/server/migrate.js +52 -52
- package/dist/server/server.js +128 -128
- package/package.json +1 -1
- package/dist/client/assets/constants-Cy3ipE35.js +0 -1
- package/dist/client/assets/extract-connection-data-BwfQHbRv.js +0 -1
- package/dist/client/assets/schema-BG_5nil3.js +0 -1
- package/dist/client/assets/shell-layout-Cendnsq1.js +0 -3
- package/dist/client/assets/useInfiniteQuery-Bwi00IeS.js +0 -1
- package/dist/client/assets/useQuery-o2THkaxs.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ar as Tc,c as ve,K as di,v as Fc,j as c,f as Go,M as Pc,as as us,u as Ec,a as Ic,t as Ut,V as fi,at as Dc,r as P,au as $c,av as Ho,aw as kc,ax as Mc,W as Rc,h as Yo,i as mi,l as Bc,ay as Uc,az as Lc,aA as Vc,a8 as Wc,a6 as Rt,a3 as Nn,a1 as Yt,ap as zc,a2 as qc,aB as Kc,a4 as Gc,aC as Hc,y as Xo,J as Yc,aD as Xc,z as Ae,I as ds,_ as Jc,x as Zc,k as Qc,E as eu,B as tu}from"./index-RkAiu7dw.js";import{i as nu,a as ru}from"./mcp-oauth-B-g9ojPu.js";import{c as hi}from"./connection-BsqnB2FJ.js";import{p as iu,i as su}from"./schema-BG_5nil3.js";import{E as ou,r as au,e as Jo}from"./env-vars-editor-CV9yJnb-.js";import{I as lu,n as cu,E as uu}from"./empty-state-C5i2xL9Y.js";import{E as du}from"./error-boundary-DAH5w09n.js";import{u as pi,a as Zo}from"./use-connection-B4LwqzAy.js";import{u as Qo,b as ea}from"./use-binding-CtNasu81.js";import{u as fu}from"./use-tool-call-uKJah0MZ.js";import{P as mu}from"./pin-to-sidebar-button-KizaOWag.js";import{B as Wt,c as hu}from"./button-BjyFV51s.js";import{i as pu}from"./File06-BvoVIa2F.js";import{i as gu}from"./Key01-B3Ctc8kf.js";import{i as yn}from"./Loading01-BkVbIYYs.js";import{V as yu}from"./layout-BiNRh0l3.js";import{u as gi}from"./project-context-provider-CMPckjDL.js";import{B as fs}from"./badge-BI_bD2v6.js";import{F as ke,a as xu,b as Me,d as Re,f as Be,c as it,e as xr}from"./form-CpXA-_lk.js";import{I as lt}from"./input-DRcixE8Y.js";import{S as ta,a as na,b as ra,c as ia,d as kt,e as sa}from"./select-De66oXlo.js";import{i as ms,e as bu}from"./extract-connection-data-BwfQHbRv.js";import{u as vu,a as Su,i as yi}from"./use-virtual-mcp-zI75jpyP.js";import{s as br,f as oa,e as wu}from"./registry-utils-4u_OxIPh.js";import{i as ju}from"./Terminal-DX8xM5mx.js";import{i as Ou}from"./Grid01-CNEf3UoL.js";import{s as aa}from"./Plus-qNfisIQV.js";import{u as Au,R as Cu,I as _u,a as Nu}from"./index-ipYvuB0t.js";import{M as Tu}from"./constants-Cy3ipE35.js";import{R as hs,_ as Ct}from"./index-mkoS7UEj.js";import{V as Fu,M as Pu}from"./index-Acn1-Gvl.js";function Eu(t,e){return Au({...t,queries:t.queries.map(n=>({...n,suspense:!0,throwOnError:Tc,enabled:!0,placeholderData:void 0}))},e)}function Vw(t){const e=ve.c(9),{connectionId:n}=t;let r,i,s;e[0]!==n?(r=new URL(`/mcp/${n}`,window.location.origin),s=Fc,i=di.isMCPAuthenticated(r.href,null),e[0]=n,e[1]=r,e[2]=i,e[3]=s):(r=e[1],i=e[2],s=e[3]);let o;e[4]!==r?(o=()=>nu({url:r.href,token:null}),e[4]=r,e[5]=o):o=e[5];let a;e[6]!==i||e[7]!==o?(a={queryKey:i,queryFn:o},e[6]=i,e[7]=o,e[8]=a):a=e[8];const{data:l}=s(a);return l}const Bn=43200,ps=1440,gs=Symbol.for("constructDateFrom");function xi(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&gs in t?t[gs](e):t instanceof Date?new t.constructor(e):new Date(e)}function ht(t,e){return xi(t,t)}let Iu={};function Du(){return Iu}function ys(t){const e=ht(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function bi(t,...e){const n=xi.bind(null,t||e.find(r=>typeof r=="object"));return e.map(n)}function zn(t,e){const n=+ht(t)-+ht(e);return n<0?-1:n>0?1:n}function $u(t){return xi(t,Date.now())}function ku(t,e,n){const[r,i]=bi(n?.in,t,e),s=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return s*12+o}function Mu(t){return e=>{const r=(t?Math[t]:Math.trunc)(e);return r===0?0:r}}function Ru(t,e){return+ht(t)-+ht(e)}function Bu(t,e){const n=ht(t);return n.setHours(23,59,59,999),n}function Uu(t,e){const n=ht(t),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Lu(t,e){const n=ht(t);return+Bu(n)==+Uu(n)}function Vu(t,e,n){const[r,i,s]=bi(n?.in,t,t,e),o=zn(i,s),a=Math.abs(ku(i,s));if(a<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*a);let l=zn(i,s)===-o;Lu(r)&&a===1&&zn(r,s)===1&&(l=!1);const f=o*(a-+l);return f===0?0:f}function Wu(t,e,n){const r=Ru(t,e)/1e3;return Mu(n?.roundingMethod)(r)}const zu={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},qu=(t,e,n)=>{let r;const i=zu[t];return typeof i=="string"?r=i:e===1?r=i.one:r=i.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function vr(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const Ku={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Gu={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Hu={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Yu={date:vr({formats:Ku,defaultWidth:"full"}),time:vr({formats:Gu,defaultWidth:"full"}),dateTime:vr({formats:Hu,defaultWidth:"full"})},Xu={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ju=(t,e,n,r)=>Xu[t];function rn(t){return(e,n)=>{const r=n?.context?String(n.context):"standalone";let i;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=n?.width?String(n.width):o;i=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=n?.width?String(n.width):t.defaultWidth;i=t.values[a]||t.values[o]}const s=t.argumentCallback?t.argumentCallback(e):e;return i[s]}}const Zu={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Qu={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ed={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},td={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},nd={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},rd={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},id=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},sd={ordinalNumber:id,era:rn({values:Zu,defaultWidth:"wide"}),quarter:rn({values:Qu,defaultWidth:"wide",argumentCallback:t=>t-1}),month:rn({values:ed,defaultWidth:"wide"}),day:rn({values:td,defaultWidth:"wide"}),dayPeriod:rn({values:nd,defaultWidth:"wide",formattingValues:rd,defaultFormattingWidth:"wide"})};function sn(t){return(e,n={})=>{const r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=e.match(i);if(!s)return null;const o=s[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?ad(a,d=>d.test(o)):od(a,d=>d.test(o));let f;f=t.valueCallback?t.valueCallback(l):l,f=n.valueCallback?n.valueCallback(f):f;const u=e.slice(o.length);return{value:f,rest:u}}}function od(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function ad(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function ld(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const i=r[0],s=e.match(t.parsePattern);if(!s)return null;let o=t.valueCallback?t.valueCallback(s[0]):s[0];o=n.valueCallback?n.valueCallback(o):o;const a=e.slice(i.length);return{value:o,rest:a}}}const cd=/^(\d+)(th|st|nd|rd)?/i,ud=/\d+/i,dd={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},fd={any:[/^b/i,/^(a|c)/i]},md={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},hd={any:[/1/i,/2/i,/3/i,/4/i]},pd={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},gd={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},yd={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},xd={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},bd={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},vd={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Sd={ordinalNumber:ld({matchPattern:cd,parsePattern:ud,valueCallback:t=>parseInt(t,10)}),era:sn({matchPatterns:dd,defaultMatchWidth:"wide",parsePatterns:fd,defaultParseWidth:"any"}),quarter:sn({matchPatterns:md,defaultMatchWidth:"wide",parsePatterns:hd,defaultParseWidth:"any",valueCallback:t=>t+1}),month:sn({matchPatterns:pd,defaultMatchWidth:"wide",parsePatterns:gd,defaultParseWidth:"any"}),day:sn({matchPatterns:yd,defaultMatchWidth:"wide",parsePatterns:xd,defaultParseWidth:"any"}),dayPeriod:sn({matchPatterns:bd,defaultMatchWidth:"any",parsePatterns:vd,defaultParseWidth:"any"})},wd={code:"en-US",formatDistance:qu,formatLong:Yu,formatRelative:Ju,localize:sd,match:Sd,options:{weekStartsOn:0,firstWeekContainsDate:1}};function jd(t,e,n){const r=Du(),i=n?.locale??r.locale??wd,s=2520,o=zn(t,e);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:o}),[l,f]=bi(n?.in,...o>0?[e,t]:[t,e]),u=Wu(f,l),d=(ys(f)-ys(l))/1e3,h=Math.round((u-d)/60);let g;if(h<2)return n?.includeSeconds?u<5?i.formatDistance("lessThanXSeconds",5,a):u<10?i.formatDistance("lessThanXSeconds",10,a):u<20?i.formatDistance("lessThanXSeconds",20,a):u<40?i.formatDistance("halfAMinute",0,a):u<60?i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",1,a):h===0?i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",h,a);if(h<45)return i.formatDistance("xMinutes",h,a);if(h<90)return i.formatDistance("aboutXHours",1,a);if(h<ps){const m=Math.round(h/60);return i.formatDistance("aboutXHours",m,a)}else{if(h<s)return i.formatDistance("xDays",1,a);if(h<Bn){const m=Math.round(h/ps);return i.formatDistance("xDays",m,a)}else if(h<Bn*2)return g=Math.round(h/Bn),i.formatDistance("aboutXMonths",g,a)}if(g=Vu(f,l),g<12){const m=Math.round(h/Bn);return i.formatDistance("xMonths",m,a)}else{const m=g%12,p=Math.trunc(g/12);return m<3?i.formatDistance("aboutXYears",p,a):m<9?i.formatDistance("overXYears",p,a):i.formatDistance("almostXYears",p+1,a)}}function Od(t,e){return jd(t,$u(t),e)}function Ad(t){const e=ve.c(13),{virtualMcp:n,org:r}=t;let i;e[0]!==r||e[1]!==n.id?(i={org:r,agentId:n.id},e[0]=r,e[1]=n.id,e[2]=i):i=e[2];let s;e[3]!==n.icon||e[4]!==n.title?(s=n.icon?c.jsx("img",{src:n.icon,alt:n.title,className:"w-8 h-8 rounded-md object-cover shrink-0"}):c.jsx("div",{className:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center shrink-0",children:c.jsx(yi,{size:16,className:"text-primary"})}),e[3]=n.icon,e[4]=n.title,e[5]=s):s=e[5];let o;e[6]!==n.title?(o=c.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[6]=n.title,e[7]=o):o=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(Ou,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[8]=a):a=e[8];let l;return e[9]!==i||e[10]!==s||e[11]!==o?(l=c.jsxs(Pc,{to:"/$org/agents/$agentId",params:i,className:"flex items-center gap-3 p-3 rounded-lg border border-border hover:bg-muted/50 transition-colors group",children:[s,o,a]}),e[9]=i,e[10]=s,e[11]=o,e[12]=l):l=e[12],l}function xs(t){const e=ve.c(20),{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:o,hasExistingVirtualMcps:a}=t,l=Go(),f=Su();let u;e[0]!==f.create||e[1]!==i||e[2]!==s||e[3]!==n||e[4]!==r||e[5]!==l||e[6]!==o?(u=async()=>{const m=await f.create.mutateAsync({title:`${r} Agent`,description:i??null,icon:s??null,status:"active",tool_selection_mode:"inclusion",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});l({to:"/$org/agents/$agentId",params:{org:o,agentId:m.id}})},e[0]=f.create,e[1]=i,e[2]=s,e[3]=n,e[4]=r,e[5]=l,e[6]=o,e[7]=u):u=e[7];const d=u;if(a){let m;e[8]!==f.create.isPending?(m=f.create.isPending?c.jsx(yn,{size:16,className:"animate-spin"}):c.jsx(aa,{size:16}),e[8]=f.create.isPending,e[9]=m):m=e[9];let p;return e[10]!==f.create.isPending||e[11]!==d||e[12]!==m?(p=c.jsxs(Wt,{variant:"outline",size:"sm",className:"gap-1.5",onClick:d,disabled:f.create.isPending,children:[m,"Create another Agent"]}),e[10]=f.create.isPending,e[11]=d,e[12]=m,e[13]=p):p=e[13],p}let h;e[14]!==f.create.isPending?(h=f.create.isPending?c.jsx(yn,{size:20,className:"animate-spin"}):c.jsx(yi,{size:20}),e[14]=f.create.isPending,e[15]=h):h=e[15];let g;return e[16]!==f.create.isPending||e[17]!==d||e[18]!==h?(g=c.jsxs(Wt,{size:"lg",className:"gap-2 w-full",onClick:d,disabled:f.create.isPending,children:[h,"Create an agent"]}),e[16]=f.create.isPending,e[17]=d,e[18]=h,e[19]=g):g=e[19],g}function Cd(t){const e=ve.c(26),{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:o}=t;let a;e[0]!==n?(a={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=a):a=e[1];const l=vu(a);if(!(l.length>0)){let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("h4",{className:"text-sm font-medium text-foreground",children:"Use in your IDE"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Expose this connection via an Agent to use it in Cursor, VS Code, Claude Desktop, and other MCP-compatible tools."})]}),e[2]=p):p=e[2];let y;return e[3]!==i||e[4]!==s||e[5]!==n||e[6]!==r||e[7]!==o?(y=c.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[p,c.jsx(xs,{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:o,hasExistingVirtualMcps:!1})]}),e[3]=i,e[4]=s,e[5]=n,e[6]=r,e[7]=o,e[8]=y):y=e[8],y}let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("h4",{className:"text-sm font-medium text-foreground",children:"Agents"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection is used on the following agents."})]}),e[9]=u):u=e[9];let d;if(e[10]!==o||e[11]!==l){let p;e[13]!==o?(p=y=>c.jsx(Ad,{virtualMcp:y,org:o},y.id),e[13]=o,e[14]=p):p=e[14],d=l.map(p),e[10]=o,e[11]=l,e[12]=d}else d=e[12];let h;e[15]!==d?(h=c.jsx("div",{className:"flex flex-col gap-2",children:d}),e[15]=d,e[16]=h):h=e[16];let g;e[17]!==i||e[18]!==s||e[19]!==n||e[20]!==r||e[21]!==o?(g=c.jsx(xs,{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:o,hasExistingVirtualMcps:!0}),e[17]=i,e[18]=s,e[19]=n,e[20]=r,e[21]=o,e[22]=g):g=e[22];let m;return e[23]!==h||e[24]!==g?(m=c.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[u,h,g]}),e[23]=h,e[24]=g,e[25]=m):m=e[25],m}function _d({form:t,connection:e,hasOAuthToken:n}){const r=us({control:t.control,name:"ui_type"}),i=us({control:t.control,name:"connection_url"}),{stdioEnabled:s}=Ec(),o=(()=>{if(typeof i!="string"||!i)return!1;try{const u=new URL(i);return u.hostname==="api.githubcopilot.com"&&u.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),a=s||e.connection_type==="STDIO",l=e.connection_type==="VIRTUAL",f=l?iu(e.connection_url):null;return l?c.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("span",{className:"text-sm font-medium",children:"Type"}),c.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[c.jsx(yi,{className:"w-4 h-4 text-muted-foreground"}),c.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),f&&c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("span",{className:"text-sm font-medium",children:"Virtual MCP ID"}),c.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:c.jsx("code",{className:"text-sm text-muted-foreground",children:f})})]})]}):c.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[c.jsx(ke,{control:t.control,name:"ui_type",render:({field:u})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Type"}),c.jsxs(ta,{value:u.value,onValueChange:u.onChange,children:[c.jsx(Re,{children:c.jsx(na,{children:c.jsx(ra,{})})}),c.jsxs(ia,{children:[c.jsx(kt,{value:"HTTP",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(br,{className:"w-4 h-4"}),"HTTP"]})}),c.jsx(kt,{value:"SSE",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(br,{className:"w-4 h-4"}),"SSE"]})}),c.jsx(kt,{value:"Websocket",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(br,{className:"w-4 h-4"}),"Websocket"]})}),a&&c.jsxs(c.Fragment,{children:[c.jsx(kt,{value:"NPX",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(cu,{className:"w-4 h-4"}),"NPX Package"]})}),c.jsx(kt,{value:"STDIO",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(ju,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),c.jsx(Be,{})]})}),r==="NPX"&&c.jsx(ke,{control:t.control,name:"npx_package",render:({field:u})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"NPM Package"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"@perplexity-ai/mcp-server",...u,value:u.value||"",className:"h-10 rounded-lg"})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),c.jsx(Be,{})]})}),r==="STDIO"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(ke,{control:t.control,name:"stdio_command",render:({field:u})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Command"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"node, bun, python...",...u,value:u.value||"",className:"h-10 rounded-lg"})}),c.jsx(Be,{})]})}),c.jsx(ke,{control:t.control,name:"stdio_args",render:({field:u})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Arguments"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"arg1 arg2 --flag value",...u,value:u.value||"",className:"h-10 rounded-lg"})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments (no quotes needed)"}),c.jsx(Be,{})]})})]}),c.jsx(ke,{control:t.control,name:"stdio_cwd",render:({field:u})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Working Directory"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"/path/to/project (optional)",...u,value:u.value||"",className:"h-10 rounded-lg"})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),c.jsx(Be,{})]})})]}),(r==="NPX"||r==="STDIO")&&c.jsx(ke,{control:t.control,name:"env_vars",render:({field:u})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Environment Variables"}),c.jsx(Re,{children:c.jsx(ou,{value:u.value??[],onChange:u.onChange})}),c.jsx(Be,{})]})}),r!=="NPX"&&r!=="STDIO"&&c.jsxs(c.Fragment,{children:[c.jsx(ke,{control:t.control,name:"connection_url",render:({field:u})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"URL"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"https://example.com/mcp",...u,value:u.value??"",className:"h-10 rounded-lg"})}),c.jsx(Be,{})]})}),n?c.jsx("div",{className:"flex items-center",children:c.jsxs(fs,{variant:"success",className:"gap-1.5",children:[c.jsx(ms,{size:12}),"Authenticated via OAuth"]})}):e.connection_token?c.jsx("div",{className:"flex items-center",children:c.jsxs(fs,{variant:"secondary",className:"gap-1.5",children:[c.jsx(ms,{size:12}),"Token saved"]})}):null,c.jsx(ke,{control:t.control,name:"connection_token",render:({field:u})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:o?"GitHub Personal Access Token":"Token"}),c.jsx(Re,{children:c.jsx(lt,{type:"password",placeholder:e.connection_token?"Enter new token to replace...":o?"Paste your GitHub PAT (no 'Bearer' prefix)":"Enter access token...",...u,value:u.value||"",className:"h-10 rounded-lg",disabled:n})}),n?c.jsx(xr,{children:"This connection uses OAuth for authentication. Manage access in the MCP Configuration panel."}):e.connection_token?c.jsx(xr,{children:"A token is already saved. Enter a new token to replace it."}):o?c.jsxs(xr,{children:["(!) GitHub's hosted MCP at"," ",c.jsx("code",{children:"api.githubcopilot.com/mcp"})," currently requires a Personal Access Token (PAT). Create one at"," ",c.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"}),". Mesh will send it as"," ",c.jsx("code",{children:"Authorization: Bearer <PAT>"}),"."]}):null,c.jsx(Be,{})]})})]})]})}function Nd(t){const e=ve.c(31),{form:n,connection:r,hasOAuthToken:i}=t,{org:s}=gi();let o;e[0]!==r.icon||e[1]!==r.title?(o=c.jsx(lu,{icon:r.icon,name:r.title,size:"lg",className:"shadow-sm"}),e[0]=r.icon,e[1]=r.title,e[2]=o):o=e[2];let a;e[3]!==n.control?(a=c.jsxs("div",{className:"flex flex-col",children:[c.jsx(ke,{control:n.control,name:"title",render:Fd}),c.jsx(ke,{control:n.control,name:"description",render:Td})]}),e[3]=n.control,e[4]=a):a=e[4];let l;e[5]!==o||e[6]!==a?(l=c.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[o,a]}),e[5]=o,e[6]=a,e[7]=l):l=e[7];let f;e[8]!==r||e[9]!==n||e[10]!==i?(f=c.jsx(_d,{form:n,connection:r,hasOAuthToken:i}),e[8]=r,e[9]=n,e[10]=i,e[11]=f):f=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[12]=u):u=e[12];let d;e[13]!==r.updated_at?(d=r.updated_at?Od(new Date(r.updated_at),{addSuffix:!1}):"Unknown",e[13]=r.updated_at,e[14]=d):d=e[14];let h;e[15]!==d?(h=c.jsxs("div",{className:"flex items-center gap-4 p-5 border-b border-border",children:[u,c.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:d})]}),e[15]=d,e[16]=h):h=e[16];let g;e[17]!==r.description||e[18]!==r.icon||e[19]!==r.id||e[20]!==r.title||e[21]!==s.slug?(g=c.jsx(Cd,{connectionId:r.id,connectionTitle:r.title,connectionDescription:r.description,connectionIcon:r.icon,org:s.slug}),e[17]=r.description,e[18]=r.icon,e[19]=r.id,e[20]=r.title,e[21]=s.slug,e[22]=g):g=e[22];let m;e[23]!==l||e[24]!==f||e[25]!==h||e[26]!==g?(m=c.jsxs("div",{className:"flex flex-col",children:[l,f,h,g]}),e[23]=l,e[24]=f,e[25]=h,e[26]=g,e[27]=m):m=e[27];let p;return e[28]!==n||e[29]!==m?(p=c.jsx(xu,{...n,children:m}),e[28]=n,e[29]=m,e[30]=p):p=e[30],p}function Td(t){const{field:e}=t;return c.jsxs(Me,{className:"w-full space-y-0",children:[c.jsx(Re,{children:c.jsx(lt,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),c.jsx(Be,{})]})}function Fd(t){const{field:e}=t;return c.jsxs(Me,{className:"w-full space-y-0",children:[c.jsx("div",{className:"flex items-center gap-2.5",children:c.jsx(Re,{children:c.jsx(lt,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})})}),c.jsx(Be,{})]})}function Pd(t){return t.startsWith("@")?t:`@${t}`}function Ed(t){const e=t._meta?.[Tu]?.tools;if(!(!e||e.length===0))return e.map(n=>({name:n.name,inputSchema:n.inputSchema??void 0,outputSchema:n.outputSchema??void 0}))}function Id(t){const e=pi(),n=Qo(e),r=t?Pd(t):"",i=r?{where:{appName:r},includeTools:!0}:{},o=Eu({queries:n.map(l=>{const f=l.id,u=oa(l.tools)||"",d=hi(f),h=JSON.stringify(i);return{queryKey:di.toolCall(f,u,h),queryFn:async()=>{if(!u||!r)return null;try{return(await d(u,i))?.items?.[0]??null}catch{return null}},staleTime:300*1e3}})}).map(l=>l.data).find(l=>l!==null);return{bindingSchema:o?Ed(o):void 0}}function Dd(t){return t.startsWith("@")?t:`@${t}`}function $d(){const{org:t}=gi(),{data:e}=Ic.useSession(),n=Zo(),r=pi(),i=Qo(r);return{installByBinding:async o=>{if(!t||!e?.user?.id){Ut.error("Not authenticated");return}const a=Dd(o),f=(await Promise.all(i.map(async m=>{const p=oa(m.tools);if(!p)return null;const y=hi(m.id);try{const x=await y(p,{where:{appName:a}});return wu(x??[])[0]??null}catch{return null}}))).find(m=>m!==null);if(!f){Ut.error(`MCP Server not found in registry: ${o}`);return}const u=bu(f,t.id,e.user.id),d=u.connection_type==="STDIO",h=!!u.connection_url,g=d&&u.connection_headers&&typeof u.connection_headers=="object"&&"command"in u.connection_headers;if(!h&&!g){Ut.error("This MCP Server cannot be connected: no connection method available");return}return await n.create.mutateAsync(u),{id:u.id,connection:u}},isInstalling:n.create.isPending}}function Y(t){return typeof t!="object"||t===null||typeof t.lastModified=="number"&&typeof File<"u"&&t instanceof File||typeof t.getMonth=="function"&&typeof Date<"u"&&t instanceof Date?!1:!Array.isArray(t)}function kd(t){return t.additionalItems===!0&&console.warn("additionalItems=true is currently not supported"),Y(t.additionalItems)}function bs(t){if(t==="")return;if(t===null)return null;if(/\.$/.test(t)||/\.0$/.test(t)||/\.\d*0$/.test(t))return t;const e=Number(t);return typeof e=="number"&&!Number.isNaN(e)?e:t}const Qe="__additional_property",Zn="additionalProperties",pt="allOf",J="anyOf",_e="const",ir="default",vi="dependencies",Md="enum",xe="__errors",oe="$id",Si="if",zt="items",Rd="_$junk_option_schema_id$_",qn="$name",q="oneOf",Kr="patternProperties",te="properties",Sr="readonly",la="required",Qn="submitButtonOptions",ce="$ref",cn="$schema",ca="root",ua="_",Bd=["discriminator","propertyName"],vs="formContext",Ud="layoutGridLookupMap",wi="__rjsf_additionalProperties",da="__rjsf_rootSchema",Ld="ui:field",ji="ui:widget",ut="ui:options",Gr="ui:globalOptions",Vd="https://json-schema.org/draft/2019-09/schema",Kn="https://json-schema.org/draft/2020-12/schema";function U(t={},e={}){return t?Object.keys(t).filter(n=>n.indexOf("ui:")===0).reduce((n,r)=>{const i=t[r];return r===ji&&Y(i)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),n):r===ut&&Y(i)?{...n,...i}:{...n,[r.substring(3)]:i}},{...e}):{...e}}function fa(t,e={},n){if(!(t.additionalProperties||t.patternProperties))return!1;const{expandable:r=!0}=U(e);return r===!1?r:t.maxProperties!==void 0&&n?Object.keys(n).length<t.maxProperties:!0}var ma=typeof global=="object"&&global&&global.Object===Object&&global,Wd=typeof self=="object"&&self&&self.Object===Object&&self,Ye=ma||Wd||Function("return this")(),Ne=Ye.Symbol,ha=Object.prototype,zd=ha.hasOwnProperty,qd=ha.toString,on=Ne?Ne.toStringTag:void 0;function Kd(t){var e=zd.call(t,on),n=t[on];try{t[on]=void 0;var r=!0}catch{}var i=qd.call(t);return r&&(e?t[on]=n:delete t[on]),i}var Gd=Object.prototype,Hd=Gd.toString;function Yd(t){return Hd.call(t)}var Xd="[object Null]",Jd="[object Undefined]",Ss=Ne?Ne.toStringTag:void 0;function tt(t){return t==null?t===void 0?Jd:Xd:Ss&&Ss in Object(t)?Kd(t):Yd(t)}function pa(t,e){return function(n){return t(e(n))}}var sr=pa(Object.getPrototypeOf,Object);function Te(t){return t!=null&&typeof t=="object"}var Zd="[object Object]",Qd=Function.prototype,ef=Object.prototype,ga=Qd.toString,tf=ef.hasOwnProperty,nf=ga.call(Object);function gt(t){if(!Te(t)||tt(t)!=Zd)return!1;var e=sr(t);if(e===null)return!0;var n=tf.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&ga.call(n)==nf}function Hr(t){const e={[xe]:[],addError(n){this[xe].push(n)}};if(Array.isArray(t))return t.reduce((n,r,i)=>({...n,[i]:Hr(r)}),e);if(gt(t)){const n=t;return Object.keys(n).reduce((r,i)=>({...r,[i]:Hr(n[i])}),e)}return e}function rf(){this.__data__=[],this.size=0}function Tn(t,e){return t===e||t!==t&&e!==e}function or(t,e){for(var n=t.length;n--;)if(Tn(t[n][0],e))return n;return-1}var sf=Array.prototype,of=sf.splice;function af(t){var e=this.__data__,n=or(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():of.call(e,n,1),--this.size,!0}function lf(t){var e=this.__data__,n=or(e,t);return n<0?void 0:e[n][1]}function cf(t){return or(this.__data__,t)>-1}function uf(t,e){var n=this.__data__,r=or(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function nt(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}nt.prototype.clear=rf;nt.prototype.delete=af;nt.prototype.get=lf;nt.prototype.has=cf;nt.prototype.set=uf;function df(){this.__data__=new nt,this.size=0}function ff(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function mf(t){return this.__data__.get(t)}function hf(t){return this.__data__.has(t)}function Z(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var pf="[object AsyncFunction]",gf="[object Function]",yf="[object GeneratorFunction]",xf="[object Proxy]";function Fn(t){if(!Z(t))return!1;var e=tt(t);return e==gf||e==yf||e==pf||e==xf}var wr=Ye["__core-js_shared__"],ws=(function(){var t=/[^.]+$/.exec(wr&&wr.keys&&wr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function bf(t){return!!ws&&ws in t}var vf=Function.prototype,Sf=vf.toString;function _t(t){if(t!=null){try{return Sf.call(t)}catch{}try{return t+""}catch{}}return""}var wf=/[\\^$.*+?()[\]{}|]/g,jf=/^\[object .+?Constructor\]$/,Of=Function.prototype,Af=Object.prototype,Cf=Of.toString,_f=Af.hasOwnProperty,Nf=RegExp("^"+Cf.call(_f).replace(wf,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Tf(t){if(!Z(t)||bf(t))return!1;var e=Fn(t)?Nf:jf;return e.test(_t(t))}function Ff(t,e){return t?.[e]}function Nt(t,e){var n=Ff(t,e);return Tf(n)?n:void 0}var xn=Nt(Ye,"Map"),bn=Nt(Object,"create");function Pf(){this.__data__=bn?bn(null):{},this.size=0}function Ef(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var If="__lodash_hash_undefined__",Df=Object.prototype,$f=Df.hasOwnProperty;function kf(t){var e=this.__data__;if(bn){var n=e[t];return n===If?void 0:n}return $f.call(e,t)?e[t]:void 0}var Mf=Object.prototype,Rf=Mf.hasOwnProperty;function Bf(t){var e=this.__data__;return bn?e[t]!==void 0:Rf.call(e,t)}var Uf="__lodash_hash_undefined__";function Lf(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=bn&&e===void 0?Uf:e,this}function jt(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}jt.prototype.clear=Pf;jt.prototype.delete=Ef;jt.prototype.get=kf;jt.prototype.has=Bf;jt.prototype.set=Lf;function Vf(){this.size=0,this.__data__={hash:new jt,map:new(xn||nt),string:new jt}}function Wf(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ar(t,e){var n=t.__data__;return Wf(e)?n[typeof e=="string"?"string":"hash"]:n.map}function zf(t){var e=ar(this,t).delete(t);return this.size-=e?1:0,e}function qf(t){return ar(this,t).get(t)}function Kf(t){return ar(this,t).has(t)}function Gf(t,e){var n=ar(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function rt(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}rt.prototype.clear=Vf;rt.prototype.delete=zf;rt.prototype.get=qf;rt.prototype.has=Kf;rt.prototype.set=Gf;var Hf=200;function Yf(t,e){var n=this.__data__;if(n instanceof nt){var r=n.__data__;if(!xn||r.length<Hf-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new rt(r)}return n.set(t,e),this.size=n.size,this}function Ee(t){var e=this.__data__=new nt(t);this.size=e.size}Ee.prototype.clear=df;Ee.prototype.delete=ff;Ee.prototype.get=mf;Ee.prototype.has=hf;Ee.prototype.set=Yf;var Xf="__lodash_hash_undefined__";function Jf(t){return this.__data__.set(t,Xf),this}function Zf(t){return this.__data__.has(t)}function Ot(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new rt;++e<n;)this.add(t[e])}Ot.prototype.add=Ot.prototype.push=Jf;Ot.prototype.has=Zf;function Qf(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function vn(t,e){return t.has(e)}var em=1,tm=2;function ya(t,e,n,r,i,s){var o=n&em,a=t.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var f=s.get(t),u=s.get(e);if(f&&u)return f==e&&u==t;var d=-1,h=!0,g=n&tm?new Ot:void 0;for(s.set(t,e),s.set(e,t);++d<a;){var m=t[d],p=e[d];if(r)var y=o?r(p,m,d,e,t,s):r(m,p,d,t,e,s);if(y!==void 0){if(y)continue;h=!1;break}if(g){if(!Qf(e,function(x,S){if(!vn(g,S)&&(m===x||i(m,x,n,r,s)))return g.push(S)})){h=!1;break}}else if(!(m===p||i(m,p,n,r,s))){h=!1;break}}return s.delete(t),s.delete(e),h}var er=Ye.Uint8Array;function nm(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function Oi(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var rm=1,im=2,sm="[object Boolean]",om="[object Date]",am="[object Error]",lm="[object Map]",cm="[object Number]",um="[object RegExp]",dm="[object Set]",fm="[object String]",mm="[object Symbol]",hm="[object ArrayBuffer]",pm="[object DataView]",js=Ne?Ne.prototype:void 0,jr=js?js.valueOf:void 0;function gm(t,e,n,r,i,s,o){switch(n){case pm:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case hm:return!(t.byteLength!=e.byteLength||!s(new er(t),new er(e)));case sm:case om:case cm:return Tn(+t,+e);case am:return t.name==e.name&&t.message==e.message;case um:case fm:return t==e+"";case lm:var a=nm;case dm:var l=r&rm;if(a||(a=Oi),t.size!=e.size&&!l)return!1;var f=o.get(t);if(f)return f==e;r|=im,o.set(t,e);var u=ya(a(t),a(e),r,i,s,o);return o.delete(t),u;case mm:if(jr)return jr.call(t)==jr.call(e)}return!1}function Ai(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var ye=Array.isArray;function xa(t,e,n){var r=e(t);return ye(t)?r:Ai(r,n(t))}function ym(t,e){for(var n=-1,r=t==null?0:t.length,i=0,s=[];++n<r;){var o=t[n];e(o,n,t)&&(s[i++]=o)}return s}function ba(){return[]}var xm=Object.prototype,bm=xm.propertyIsEnumerable,Os=Object.getOwnPropertySymbols,Ci=Os?function(t){return t==null?[]:(t=Object(t),ym(Os(t),function(e){return bm.call(t,e)}))}:ba;function va(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var vm="[object Arguments]";function As(t){return Te(t)&&tt(t)==vm}var Sa=Object.prototype,Sm=Sa.hasOwnProperty,wm=Sa.propertyIsEnumerable,qt=As((function(){return arguments})())?As:function(t){return Te(t)&&Sm.call(t,"callee")&&!wm.call(t,"callee")};function jm(){return!1}var wa=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Cs=wa&&typeof module=="object"&&module&&!module.nodeType&&module,Om=Cs&&Cs.exports===wa,_s=Om?Ye.Buffer:void 0,Am=_s?_s.isBuffer:void 0,At=Am||jm,Cm=9007199254740991,_m=/^(?:0|[1-9]\d*)$/;function lr(t,e){var n=typeof t;return e=e??Cm,!!e&&(n=="number"||n!="symbol"&&_m.test(t))&&t>-1&&t%1==0&&t<e}var Nm=9007199254740991;function _i(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Nm}var Tm="[object Arguments]",Fm="[object Array]",Pm="[object Boolean]",Em="[object Date]",Im="[object Error]",Dm="[object Function]",$m="[object Map]",km="[object Number]",Mm="[object Object]",Rm="[object RegExp]",Bm="[object Set]",Um="[object String]",Lm="[object WeakMap]",Vm="[object ArrayBuffer]",Wm="[object DataView]",zm="[object Float32Array]",qm="[object Float64Array]",Km="[object Int8Array]",Gm="[object Int16Array]",Hm="[object Int32Array]",Ym="[object Uint8Array]",Xm="[object Uint8ClampedArray]",Jm="[object Uint16Array]",Zm="[object Uint32Array]",ue={};ue[zm]=ue[qm]=ue[Km]=ue[Gm]=ue[Hm]=ue[Ym]=ue[Xm]=ue[Jm]=ue[Zm]=!0;ue[Tm]=ue[Fm]=ue[Vm]=ue[Pm]=ue[Wm]=ue[Em]=ue[Im]=ue[Dm]=ue[$m]=ue[km]=ue[Mm]=ue[Rm]=ue[Bm]=ue[Um]=ue[Lm]=!1;function Qm(t){return Te(t)&&_i(t.length)&&!!ue[tt(t)]}function Ni(t){return function(e){return t(e)}}var ja=typeof exports=="object"&&exports&&!exports.nodeType&&exports,fn=ja&&typeof module=="object"&&module&&!module.nodeType&&module,eh=fn&&fn.exports===ja,Or=eh&&ma.process,Kt=(function(){try{var t=fn&&fn.require&&fn.require("util").types;return t||Or&&Or.binding&&Or.binding("util")}catch{}})(),Ns=Kt&&Kt.isTypedArray,Pn=Ns?Ni(Ns):Qm,th=Object.prototype,nh=th.hasOwnProperty;function Oa(t,e){var n=ye(t),r=!n&&qt(t),i=!n&&!r&&At(t),s=!n&&!r&&!i&&Pn(t),o=n||r||i||s,a=o?va(t.length,String):[],l=a.length;for(var f in t)(e||nh.call(t,f))&&!(o&&(f=="length"||i&&(f=="offset"||f=="parent")||s&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||lr(f,l)))&&a.push(f);return a}var rh=Object.prototype;function cr(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||rh;return t===n}var ih=pa(Object.keys,Object),sh=Object.prototype,oh=sh.hasOwnProperty;function Aa(t){if(!cr(t))return ih(t);var e=[];for(var n in Object(t))oh.call(t,n)&&n!="constructor"&&e.push(n);return e}function Tt(t){return t!=null&&_i(t.length)&&!Fn(t)}function Pe(t){return Tt(t)?Oa(t):Aa(t)}function Yr(t){return xa(t,Pe,Ci)}var ah=1,lh=Object.prototype,ch=lh.hasOwnProperty;function uh(t,e,n,r,i,s){var o=n&ah,a=Yr(t),l=a.length,f=Yr(e),u=f.length;if(l!=u&&!o)return!1;for(var d=l;d--;){var h=a[d];if(!(o?h in e:ch.call(e,h)))return!1}var g=s.get(t),m=s.get(e);if(g&&m)return g==e&&m==t;var p=!0;s.set(t,e),s.set(e,t);for(var y=o;++d<l;){h=a[d];var x=t[h],S=e[h];if(r)var j=o?r(S,x,h,e,t,s):r(x,S,h,t,e,s);if(!(j===void 0?x===S||i(x,S,n,r,s):j)){p=!1;break}y||(y=h=="constructor")}if(p&&!y){var b=t.constructor,v=e.constructor;b!=v&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof v=="function"&&v instanceof v)&&(p=!1)}return s.delete(t),s.delete(e),p}var Xr=Nt(Ye,"DataView"),Jr=Nt(Ye,"Promise"),Lt=Nt(Ye,"Set"),Zr=Nt(Ye,"WeakMap"),Ts="[object Map]",dh="[object Object]",Fs="[object Promise]",Ps="[object Set]",Es="[object WeakMap]",Is="[object DataView]",fh=_t(Xr),mh=_t(xn),hh=_t(Jr),ph=_t(Lt),gh=_t(Zr),Ce=tt;(Xr&&Ce(new Xr(new ArrayBuffer(1)))!=Is||xn&&Ce(new xn)!=Ts||Jr&&Ce(Jr.resolve())!=Fs||Lt&&Ce(new Lt)!=Ps||Zr&&Ce(new Zr)!=Es)&&(Ce=function(t){var e=tt(t),n=e==dh?t.constructor:void 0,r=n?_t(n):"";if(r)switch(r){case fh:return Is;case mh:return Ts;case hh:return Fs;case ph:return Ps;case gh:return Es}return e});var yh=1,Ds="[object Arguments]",$s="[object Array]",Un="[object Object]",xh=Object.prototype,ks=xh.hasOwnProperty;function bh(t,e,n,r,i,s){var o=ye(t),a=ye(e),l=o?$s:Ce(t),f=a?$s:Ce(e);l=l==Ds?Un:l,f=f==Ds?Un:f;var u=l==Un,d=f==Un,h=l==f;if(h&&At(t)){if(!At(e))return!1;o=!0,u=!1}if(h&&!u)return s||(s=new Ee),o||Pn(t)?ya(t,e,n,r,i,s):gm(t,e,l,n,r,i,s);if(!(n&yh)){var g=u&&ks.call(t,"__wrapped__"),m=d&&ks.call(e,"__wrapped__");if(g||m){var p=g?t.value():t,y=m?e.value():e;return s||(s=new Ee),i(p,y,n,r,s)}}return h?(s||(s=new Ee),uh(t,e,n,r,i,s)):!1}function En(t,e,n,r,i){return t===e?!0:t==null||e==null||!Te(t)&&!Te(e)?t!==t&&e!==e:bh(t,e,n,r,En,i)}function vh(t,e,n){n=typeof n=="function"?n:void 0;var r=n?n(t,e):void 0;return r===void 0?En(t,e,void 0,n):!!r}function le(t,e){return vh(t,e,(n,r)=>{if(typeof n=="function"&&typeof r=="function")return!0})}var Sh="[object Symbol]";function In(t){return typeof t=="symbol"||Te(t)&&tt(t)==Sh}var wh=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jh=/^\w*$/;function Ti(t,e){if(ye(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||In(t)?!0:jh.test(t)||!wh.test(t)||e!=null&&t in Object(e)}var Oh="Expected a function";function Fi(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Oh);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=t.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(Fi.Cache||rt),n}Fi.Cache=rt;var Ah=500;function Ch(t){var e=Fi(t,function(r){return n.size===Ah&&n.clear(),r}),n=e.cache;return e}var _h=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Nh=/\\(\\)?/g,Ca=Ch(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(_h,function(n,r,i,s){e.push(i?s.replace(Nh,"$1"):r||n)}),e});function Xt(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var Ms=Ne?Ne.prototype:void 0,Rs=Ms?Ms.toString:void 0;function _a(t){if(typeof t=="string")return t;if(ye(t))return Xt(t,_a)+"";if(In(t))return Rs?Rs.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Pi(t){return t==null?"":_a(t)}function Jt(t,e){return ye(t)?t:Ti(t,e)?[t]:Ca(Pi(t))}function Ft(t){if(typeof t=="string"||In(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function ur(t,e){e=Jt(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Ft(e[n++])];return n&&n==r?t:void 0}function I(t,e,n){var r=t==null?void 0:ur(t,e);return r===void 0?n:r}var Th=Object.prototype,Fh=Th.hasOwnProperty;function Ph(t,e){return t!=null&&Fh.call(t,e)}function Na(t,e,n){e=Jt(e,t);for(var r=-1,i=e.length,s=!1;++r<i;){var o=Ft(e[r]);if(!(s=t!=null&&n(t,o)))break;t=t[o]}return s||++r!=i?s:(i=t==null?0:t.length,!!i&&_i(i)&&lr(o,i)&&(ye(t)||qt(t)))}function X(t,e){return t!=null&&Na(t,e,Ph)}function dt(t,e){return En(t,e)}var tr=(function(){try{var t=Nt(Object,"defineProperty");return t({},"",{}),t}catch{}})();function Ei(t,e,n){e=="__proto__"&&tr?tr(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var Eh=Object.prototype,Ih=Eh.hasOwnProperty;function Ii(t,e,n){var r=t[e];(!(Ih.call(t,e)&&Tn(r,n))||n===void 0&&!(e in t))&&Ei(t,e,n)}function Di(t,e,n,r){if(!Z(t))return t;e=Jt(e,t);for(var i=-1,s=e.length,o=s-1,a=t;a!=null&&++i<s;){var l=Ft(e[i]),f=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=o){var u=a[l];f=r?r(u,l,a):void 0,f===void 0&&(f=Z(u)?u:lr(e[i+1])?[]:{})}Ii(a,l,f),a=a[l]}return t}function se(t,e,n){return t==null?t:Di(t,e,n)}function dr(t){return t}function Ta(t){return typeof t=="function"?t:dr}var Dh=/\s/;function $h(t){for(var e=t.length;e--&&Dh.test(t.charAt(e)););return e}var kh=/^\s+/;function Mh(t){return t&&t.slice(0,$h(t)+1).replace(kh,"")}var Bs=NaN,Rh=/^[-+]0x[0-9a-f]+$/i,Bh=/^0b[01]+$/i,Uh=/^0o[0-7]+$/i,Lh=parseInt;function Vh(t){if(typeof t=="number")return t;if(In(t))return Bs;if(Z(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Z(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Mh(t);var n=Bh.test(t);return n||Uh.test(t)?Lh(t.slice(2),n?2:8):Rh.test(t)?Bs:+t}var Us=1/0,Wh=17976931348623157e292;function zh(t){if(!t)return t===0?t:0;if(t=Vh(t),t===Us||t===-Us){var e=t<0?-1:1;return e*Wh}return t===t?t:0}function Fa(t){var e=zh(t),n=e%1;return e===e?n?e-n:e:0}var qh=9007199254740991,Ar=4294967295,Kh=Math.min;function Pa(t,e){if(t=Fa(t),t<1||t>qh)return[];var n=Ar,r=Kh(t,Ar);e=Ta(e),t-=Ar;for(var i=va(r,e);++n<t;)e(n);return i}function $i(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var Ls=Object.create,Ea=(function(){function t(){}return function(e){if(!Z(e))return{};if(Ls)return Ls(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();function Gh(t){return function(e,n,r){for(var i=-1,s=Object(e),o=r(e),a=o.length;a--;){var l=o[++i];if(n(s[l],l,s)===!1)break}return e}}var Ia=Gh();function Da(t,e){return t&&Ia(t,e,Pe)}var Hh=1,Yh=2;function Xh(t,e,n,r){var i=n.length,s=i;if(t==null)return!s;for(t=Object(t);i--;){var o=n[i];if(o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++i<s;){o=n[i];var a=o[0],l=t[a],f=o[1];if(o[2]){if(l===void 0&&!(a in t))return!1}else{var u=new Ee,d;if(!(d===void 0?En(f,l,Hh|Yh,r,u):d))return!1}}return!0}function $a(t){return t===t&&!Z(t)}function Jh(t){for(var e=Pe(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,$a(i)]}return e}function ka(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function Zh(t){var e=Jh(t);return e.length==1&&e[0][2]?ka(e[0][0],e[0][1]):function(n){return n===t||Xh(n,t,e)}}function Qh(t,e){return t!=null&&e in Object(t)}function Ma(t,e){return t!=null&&Na(t,e,Qh)}var ep=1,tp=2;function np(t,e){return Ti(t)&&$a(e)?ka(Ft(t),e):function(n){var r=I(n,t);return r===void 0&&r===e?Ma(n,t):En(e,r,ep|tp)}}function rp(t){return function(e){return e?.[t]}}function ip(t){return function(e){return ur(e,t)}}function sp(t){return Ti(t)?rp(Ft(t)):ip(t)}function ki(t){return typeof t=="function"?t:t==null?dr:typeof t=="object"?ye(t)?np(t[0],t[1]):Zh(t):sp(t)}function op(t,e,n){var r=ye(t),i=r||At(t)||Pn(t);if(e=ki(e),n==null){var s=t&&t.constructor;i?n=r?new s:[]:Z(t)?n=Fn(s)?Ea(sr(t)):{}:n={}}return(i?$i:Da)(t,function(o,a,l){return e(n,o,a,l)}),n}function Qr(t,e,n){(n!==void 0&&!Tn(t[e],n)||n===void 0&&!(e in t))&&Ei(t,e,n)}var Ra=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vs=Ra&&typeof module=="object"&&module&&!module.nodeType&&module,ap=Vs&&Vs.exports===Ra,Ws=ap?Ye.Buffer:void 0,zs=Ws?Ws.allocUnsafe:void 0;function Ba(t,e){if(e)return t.slice();var n=t.length,r=zs?zs(n):new t.constructor(n);return t.copy(r),r}function Mi(t){var e=new t.constructor(t.byteLength);return new er(e).set(new er(t)),e}function Ua(t,e){var n=e?Mi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ri(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function La(t){return typeof t.constructor=="function"&&!cr(t)?Ea(sr(t)):{}}function Sn(t){return Te(t)&&Tt(t)}function ei(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Zt(t,e,n,r){var i=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=void 0;l===void 0&&(l=t[a]),i?Ei(n,a,l):Ii(n,a,l)}return n}function lp(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var cp=Object.prototype,up=cp.hasOwnProperty;function dp(t){if(!Z(t))return lp(t);var e=cr(t),n=[];for(var r in t)r=="constructor"&&(e||!up.call(t,r))||n.push(r);return n}function Dn(t){return Tt(t)?Oa(t,!0):dp(t)}function fp(t){return Zt(t,Dn(t))}function mp(t,e,n,r,i,s,o){var a=ei(t,n),l=ei(e,n),f=o.get(l);if(f){Qr(t,n,f);return}var u=s?s(a,l,n+"",t,e,o):void 0,d=u===void 0;if(d){var h=ye(l),g=!h&&At(l),m=!h&&!g&&Pn(l);u=l,h||g||m?ye(a)?u=a:Sn(a)?u=Ri(a):g?(d=!1,u=Ba(l,!0)):m?(d=!1,u=Ua(l,!0)):u=[]:gt(l)||qt(l)?(u=a,qt(a)?u=fp(a):(!Z(a)||Fn(a))&&(u=La(l))):d=!1}d&&(o.set(l,u),i(u,l,r,s,o),o.delete(l)),Qr(t,n,u)}function Va(t,e,n,r,i){t!==e&&Ia(e,function(s,o){if(i||(i=new Ee),Z(s))mp(t,e,o,n,Va,r,i);else{var a=r?r(ei(t,o),s,o+"",t,e,i):void 0;a===void 0&&(a=s),Qr(t,o,a)}},Dn)}function hp(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var qs=Math.max;function Wa(t,e,n){return e=qs(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=qs(r.length-e,0),o=Array(s);++i<s;)o[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=n(o),hp(t,this,a)}}function pp(t){return function(){return t}}var gp=tr?function(t,e){return tr(t,"toString",{configurable:!0,enumerable:!1,value:pp(e),writable:!0})}:dr,yp=800,xp=16,bp=Date.now;function vp(t){var e=0,n=0;return function(){var r=bp(),i=xp-(r-n);if(n=r,i>0){if(++e>=yp)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var za=vp(gp);function fr(t,e){return za(Wa(t,e,dr),t+"")}function Sp(t,e,n){if(!Z(n))return!1;var r=typeof e;return(r=="number"?Tt(n)&&lr(e,n.length):r=="string"&&e in n)?Tn(n[e],t):!1}function wp(t){return fr(function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,o&&Sp(n[0],n[1],o)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var a=n[r];a&&t(e,a,r,s)}return e})}var jp=wp(function(t,e,n){Va(t,e,n)}),Ks=Ne?Ne.isConcatSpreadable:void 0;function Op(t){return ye(t)||qt(t)||!!(Ks&&t&&t[Ks])}function $n(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=Op),i||(i=[]);++s<o;){var a=t[s];e>0&&n(a)?e>1?$n(a,e-1,n,r,i):Ai(i,a):r||(i[i.length]=a)}return i}var Ap=1/0;function Cp(t){var e=t==null?0:t.length;return e?$n(t,Ap):[]}function _p(t,e,n,r){for(var i=t.length,s=n+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function Np(t){return t!==t}function Tp(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function qa(t,e,n){return e===e?Tp(t,e,n):_p(t,Np,n)}function Bi(t,e){var n=t==null?0:t.length;return!!n&&qa(t,e,0)>-1}function Gn(){}var Fp=1/0,Pp=Lt&&1/Oi(new Lt([,-0]))[1]==Fp?function(t){return new Lt(t)}:Gn,Ep=200;function Ka(t,e,n){var r=-1,i=Bi,s=t.length,o=!0,a=[],l=a;if(s>=Ep){var f=Pp(t);if(f)return Oi(f);o=!1,i=vn,l=new Ot}else l=a;e:for(;++r<s;){var u=t[r],d=u;if(u=u!==0?u:0,o&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue e;a.push(u)}else i(l,d,n)||(l!==a&&l.push(d),a.push(u))}return a}function Ga(t){return t&&t.length?Ka(t):[]}var Ip="[object Map]",Dp="[object Set]",$p=Object.prototype,kp=$p.hasOwnProperty;function me(t){if(t==null)return!0;if(Tt(t)&&(ye(t)||typeof t=="string"||typeof t.splice=="function"||At(t)||Pn(t)||qt(t)))return!t.length;var e=Ce(t);if(e==Ip||e==Dp)return!t.size;if(cr(t))return!Aa(t).length;for(var n in t)if(kp.call(t,n))return!1;return!0}const Mp=Object.prototype;function un(t){for(const e in t)if(Mp.hasOwnProperty.call(t,e))return!1;return!0}const Rp=["array","boolean","integer","null","number","object","string"];new Set(Rp);const Bp=["$defs","definitions","properties","patternProperties","dependencies"];new Set(Bp);const Up=["items","allOf","oneOf","anyOf"];new Set(Up);const Lp=["items","additionalItems","additionalProperties","propertyNames","contains","if","then","else","not"];new Set(Lp);function Hn(t){return typeof t=="object"}function Le(t){return Hn(t)?un(t):t===!0}function Bt(t,e){return t<e?-1:t>e?1:0}function Cr(t,e){const n=t.length;if(n===0)return e;let r=e.length;if(r===0)return t;if(n<r){const s=t;t=e,e=s,r=n}const i=new Set(t);for(let s=0;s<r;s++)i.add(e[s]);return Array.from(i)}function Vp(t,e){const n=[];if(t.length===0||e.length===0)return n;if(t.length>e.length){const i=t;t=e,e=i}const r=new Set(e);for(let i=0;i<t.length&&r.size>0;i++){const s=t[i];r.delete(s)&&n.push(s)}return n}function Gs(t){return t.length===0}function _r(t){return(e,n)=>{const r=e.length-n.length;if(r!==0)return r;for(let i=0;i<e.length;i++)if(e[i]!==n[i]){const s=t(e[i],n[i]);if(s!==0)return s}return 0}}function Ha(t,{threshold:e=12}={}){return n=>{const r=n.length;if(r===0)return n;if(r<=e){const o=[];let a=0;e:for(let l=0;l<r;l++){const f=n[l];for(let u=0;u<a;u++)if(t(f,o[u])===0)continue e;a=o.push(f)}return o}const i=n.slice().sort(t);let s=0;for(let o=1;o<r;o++)t(i[s],i[o])!==0&&++s!==o&&(i[s]=i[o]);return i.length=s+1,i}}function Wp(t){return(e,n)=>{const r=[];let i=e.length,s=n.length;if(i===0||s===0)return r;if(i>s){const u=e;e=n,n=u;const d=i;i=s,s=d}const o=[...e].sort(t),a=[...n].sort(t);let l=0,f=0;for(;l<i&&f<s;){const u=t(o[l],a[f]);u===0?((r.length===0||t(r[r.length-1],o[l])!==0)&&r.push(o[l]),l++,f++):u<0?l++:f++}return r}}function zp(t,e){return n=>{if(t.has(n))return t.get(n);const r=e(n);return t.set(n,r),r}}const Hs=zp,Ya=()=>0,qp=t=>t===void 0,Kp=t=>typeof t!="object",Ys={boolean:0,number:1,string:2};function Gp(t,e){const n=typeof t,r=typeof e;return n===r?Bt(t,e):Ys[n]-Ys[r]}function Hp(t,e){const n=t.length;if(n===0)return e;const r=e.length;if(r===0)return t;if(r>n){const o=t;t=e,e=o}const i=new Set(t),s=e.length;for(let o=0;o<s;o++){const a=e[o];i.has(a)||t.push(a)}return t}function mr(t,e,n=Ya){return(r,i)=>t(r)?t(i)?n(r,i):-1:t(i)?1:e(r,i)}function Mt(t){return mr(qp,t)}function ot(t,e){return mr(n=>n===void 0||t(n),e)}function Nr(t,e){return mr(Array.isArray,t,e)}const he=Mt(Bt),Tr=ot(t=>t===0,(t,e)=>t-e);function Yp({deduplicationCache:t=new WeakMap,sortedKeysCache:e=new WeakMap}={}){const n=Hs(e,p=>Object.keys(p).sort());function r(p){return(y,x)=>{const S=n(y),j=n(x),b=Math.min(S.length,j.length);for(let v=0;v<b;v++){const w=Bt(S[v],j[v]);if(w!==0)return w}if(S.length!==j.length)return S.length-j.length;for(let v=0;v<b;v++){const w=S[v],O=p(y[w],x[w]);if(O!==0)return O}return 0}}function i(p){const y=_r(p),x=Hs(t,Ha(p,{threshold:0}));return(S,j)=>y(x(S),x(j))}const s=i(Bt);function o(p,y){if(Hn(p)){if(Hn(y)){const x=Object.keys(p),S=Object.keys(y),j=Hp(x,S),b=j.length;for(let v=0;v<b;v++){const w=j[v];if(p[w]===y[w])continue;const A=(m[w]??a)(p[w],y[w]);if(A!==0)return A}return 0}return y===!0&&un(p)?0:1}return Hn(y)?p===!0&&un(y)?0:-1:Bt(p,y)}const a=Mt(f),l=mr(Kp,Nr(r(a),_r(f)),Gp);function f(p,y){return p===null?-1:y===null?1:l(p,y)}const u=Mt(o),d=ot(un,r(u)),h=Mt(i(o)),g=ot(Le,o),m={$id:he,$comment:he,$defs:d,$ref:he,$schema:he,const:a,contains:u,contentEncoding:he,contentMediaType:he,default:a,definitions:d,description:he,else:u,examples:a,exclusiveMaximum:he,exclusiveMinimum:he,format:he,if:u,maximum:he,maxItems:he,maxLength:he,maxProperties:he,minimum:he,multipleOf:he,not:u,pattern:he,propertyNames:u,readOnly:he,then:u,title:he,writeOnly:he,uniqueItems:ot(p=>p===!1,Ya),minLength:Tr,minItems:Tr,minProperties:Tr,required:ot(Gs,s),enum:ot(Gs,i(f)),type:Mt((p,y)=>{const x=Array.isArray(p),S=Array.isArray(y);return!x&&!S?Bt(p,y):s(x?p:[p],S?y:[y])}),items:ot(p=>!Array.isArray(p)&&Le(p),Nr(o,_r(o))),anyOf:h,allOf:h,oneOf:h,properties:d,patternProperties:d,additionalProperties:g,additionalItems:g,dependencies:ot(un,r(Mt(Nr(o,s))))};return{compareSchemaValues:f,compareSchemaDefinitions:o}}function Xs(t){return t}const Xa=(t,e)=>t?Xa(e%t,t):e,Xp=(t,e)=>Math.abs(t*e)/Xa(t,e);function Jp(t,e){return t===e?t:`^(?=.*(?:${t}))(?=.*(?:${e})).*$`}function*Fr(t,e,n){const r=t.length,i=e.length;if(r>0&&i>0)for(let s=0;s<r;s++){const o=t[s];for(let a=0;a<i;a++)yield n(o,e[a])}}function Pr(t,e){return t||e}function Js(t){return(e,n)=>{const r={...e},i=Object.keys(n),s=i.length;for(let o=0;o<s;o++){const a=i[o];r[a]=e[a]===void 0?n[a]:t(e[a],n[a])}return r}}function Zp(t){const e=new Map;for(const n of t)for(const r of n[0])e.set(r,n[1]);return e}function bt(t,e,n){n===void 0||Le(n)?delete t[e]:t[e]=n}const Qp=["properties","patternProperties","additionalProperties"];function Zs(t){const e=Object.keys(t),n=e.length,r=[];for(let i=0;i<n;i++){const s=e[i];r.push({regExp:new RegExp(s),schema:t[s]})}return[r,e]}const Qs=[[],[]];function eo(t,e,n){const r=n.length;for(let i=0;i<r;i++){const s=n[i];if(!s.regExp.test(e))continue;const o=s.schema;if(o===!1)return!0;t.push(o)}return!1}const eg=["items","additionalItems"],tg=["if","then","else"];function to(t,e){return e.if!==void 0&&(t.if=e.if),e.then!==void 0&&(t.then=e.then),e.else!==void 0&&(t.else=e.else),t}function Er(t,e){if(t===e)return t;switch(t){case"number":if(e==="integer")return"integer";case"integer":if(e==="number")return"integer";default:return}}function vt(t,e,n){return[t,e,n]}function ng(t){const e=new Map;for(const[n,r,i]of t){const s=o=>{if(!i(o))throw new Error(`Schema keys '${n}' and '${r}' are conflicting (${n}: ${JSON.stringify(o[n])}, ${r}: ${JSON.stringify(o[r])})`)};for(const o of[[n,r],[r,n]]){let a=e.get(o[0]);a===void 0&&(a=[],e.set(o[0],a)),a.push({oppositeKey:o[1],check:s})}}return e}const rg=[vt("minimum","maximum",t=>t.maximum>=t.minimum),vt("exclusiveMinimum","maximum",t=>t.maximum>t.exclusiveMinimum),vt("minimum","exclusiveMaximum",t=>t.exclusiveMaximum>t.minimum),vt("exclusiveMinimum","exclusiveMaximum",t=>t.exclusiveMaximum>t.exclusiveMinimum),vt("minLength","maxLength",t=>t.maxLength>=t.minLength),vt("minItems","maxItems",t=>t.maxItems>=t.minItems),vt("minProperties","maxProperties",t=>t.maxProperties>=t.minProperties)];function ig({mergePatterns:t=Jp,isSubRegExp:e=Object.is,intersectJson:n=Vp,deduplicateJsonSchemaDef:r=Xs,defaultMerger:i=Xs,assigners:s=[],checks:o=rg,mergers:a}={}){function l(b){const v=b.length;let w=b[0];for(let O=1;O<v;O++){const A=x(w,b[O]);if(A===!1)return!1;Le(A)||(w=A)}return w}function f(b,v,w,O,A,C,T){if(b.length=0,w===!1)return!1;if(b.push(w),A!==void 0){if(A===!1)return!1;b.push(A)}if(eo(b,v,C))return!1;const _=b.length<2;if(T===!1){if(_)return;if(eo(b,v,O))return!1}else _&&T!==void 0&&b.push(T);return b.length===1?b[0]:l(b)}function u(b,v,w,O,A,C){const T=w.length;if(T>0&&A!==!1)if(C)Object.assign(b,v);else for(let N=0;N<T;N++){const _=w[N];O.has(_)||(b[_]=x(v[_],A))}return b}const d=(b,{properties:v={},patternProperties:w,additionalProperties:O=!0},{properties:A={},patternProperties:C,additionalProperties:T=!0})=>{const N=Le(O),_=Le(T);if(N&&_)return bt(b,"properties",S(v,A)),bt(b,"patternProperties",w&&C?S(w,C):w??C),delete b.additionalProperties,b;const F=x(O,T);bt(b,"additionalProperties",F);const $={},E=Object.keys(v),D=E.length,[M,k]=w?Zs(w):Qs,[B,W]=C?Zs(C):Qs,R=[],V=new Set,Q=_?void 0:T;for(let H=0;H<D;H++){const re=E[H];V.add(re);const fe=f(R,re,v[re],M,A[re],B,Q);fe!==void 0&&($[re]=fe)}const ne=Object.keys(A),ie=ne.length,de=N?void 0:O;for(let H=0;H<ie;H++){const re=ne[H];if(V.has(re))continue;const fe=f(R,re,A[re],B,void 0,M,de);fe!==void 0&&($[re]=fe)}bt(b,"properties",$);let ee={};const z=new Set;if(k.length>0&&W.length>0){const H=Fr(k,W,(re,fe)=>{e(re,fe)&&z.add(re),e(fe,re)&&z.add(fe),ee[t(re,fe)]=x(w[re],C[fe])});for(;!H.next().done;);}return ee=u(ee,w,k,z,T,_),ee=u(ee,C,W,z,O,N),bt(b,"patternProperties",ee),b},h=(b,{items:v=[],additionalItems:w},{items:O=[],additionalItems:A})=>{const C=Array.isArray(v),T=Array.isArray(O),N=[];if(b.items=N,C&&T){const[_,F,$]=v.length<O.length?[v.length,w,O]:[O.length,A,v];let E=0;for(;E<_;E++)N.push(x(v[E],O[E]));if(F===!1)b.additionalItems=!1;else{const D=F===void 0||Le(F);for(;E<$.length;E++)N.push(D?$[E]:x($[E],F));bt(b,"additionalItems",w!==void 0&&A!==void 0?x(w,A):w??A)}}else if(C||T){const[_,F,$]=C?[v,O,w]:[O,v,A];bt(b,"additionalItems",$&&x($,F));for(let E=0;E<_.length;E++)N.push(x(_[E],F))}else delete b.additionalItems,b.items=x(v,O);return b},g=(b,v,w)=>{to(b,v);const O=to({},w);return b.allOf===void 0?b.allOf=[O]:b.allOf=b.allOf.concat(O),b};function m(b,v){return r(Array.from(Fr(b,v,x)))}const p=Zp([[Qp,d],[eg,h],[tg,g],...s]),y=ng(o);function x(b,v){if(b===!1||v===!1)return!1;if(Le(b))return Le(v)?!0:v;if(Le(v))return b;let w={...b};const O=new Set,A=new Set,C=Object.keys(v),T=C.length;for(let N=0;N<T;N++){const _=C[N],F=v[_];if(F===void 0)continue;const $=y.get(_);if($!==void 0){const k=$.length;for(let B=0;B<k;B++){const W=$[B];b[W.oppositeKey]!==void 0&&A.add(W.check)}}const E=b[_];if(E===void 0){w[_]=F;continue}const D=p.get(_);if(D){O.add(D);continue}const M=j[_]??i;w[_]=M(E,F)}for(const N of O)w=N(w,b,v);for(const N of A)N(w);return w}const S=Js(x),j={$id:i,$ref:i,$schema:i,$comment:i,$defs:S,definitions:S,type:(b,v)=>{if(b===v)return b;const w=Array.isArray(b),O=Array.isArray(v);if(!w&&!O){const A=Er(b,v);if(A!==void 0)return A}else if(w||O){const A=new Set;if(w&&O)for(const T of Fr(b,v,Er))T!==void 0&&A.add(T);else{const T=w?b:v,N=w?v:b,_=T.length;for(let F=0;F<_;F++){const $=Er(N,T[F]);$!==void 0&&A.add($)}}const C=A.size;if(C===1)return A.values().next().value;if(C>1)return Array.from(A)}throw new Error(`It is not possible to create an intersection of the following incompatible types: ${b.toString()}, ${v.toString()}`)},default:i,description:i,title:i,const:i,format:i,contentEncoding:i,contentMediaType:i,not:(b,v)=>{const w=r([b,v]);return w.length===1?w[0]:{anyOf:w}},pattern:t,readOnly:Pr,writeOnly:Pr,enum:(b,v)=>{const w=n(b,v);if(w.length===0)throw new Error(`Intersection of the following enums is empty: "${JSON.stringify(b)}", "${JSON.stringify(v)}"`);return w},anyOf:m,oneOf:m,allOf:(b,v)=>r(b.concat(v)),propertyNames:x,contains:x,dependencies:Js((b,v)=>Array.isArray(b)?Array.isArray(v)?Cr(b,v):x(v,{required:b}):Array.isArray(v)?x(b,{required:v}):x(b,v)),examples:(b,v)=>{if(!Array.isArray(b)||!Array.isArray(v))throw new Error(`Value of the 'examples' field should be an array, but got "${JSON.stringify(b)}" and "${JSON.stringify(v)}"`);return Cr(b,v)},multipleOf:(b,v)=>{let w=1;for(;!Number.isInteger(b)||!Number.isInteger(v);)w*=10,b*=10,v*=10;return Xp(b,v)/w},exclusiveMaximum:Math.min,maximum:Math.min,maxItems:Math.min,maxLength:Math.min,maxProperties:Math.min,exclusiveMinimum:Math.max,minimum:Math.max,minItems:Math.max,minLength:Math.max,minProperties:Math.max,uniqueItems:Pr,required:Cr,...a};return{mergeSchemaDefinitions:x,mergeArrayOfSchemaDefinitions:l}}function sg(t){const e=[],n=[t];for(;n.length>0;){const r=n.pop();if(typeof r=="boolean"||r.allOf===void 0){e.push(r);continue}const{allOf:i,...s}=r;e.push(s);for(let o=i.length-1;o>=0;o--)n.push(i[o])}return e}function og(t){return e=>t(sg(e))}var an={},no;function ag(){if(no)return an;no=1;var t=/~/,e=/~[01]/g;function n(f){switch(f){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+f)}function r(f){return t.test(f)?f.replace(e,n):f}function i(f,u,d){for(var h,g,m=1,p=u.length;m<p;){if(u[m]==="constructor"||u[m]==="prototype"||u[m]==="__proto__")return f;if(h=r(u[m++]),g=p>m,typeof f[h]>"u"&&(Array.isArray(f)&&h==="-"&&(h=f.length),g&&(u[m]!==""&&u[m]<1/0||u[m]==="-"?f[h]=[]:f[h]={})),!g)break;f=f[h]}var y=f[h];return d===void 0?delete f[h]:f[h]=d,y}function s(f){if(typeof f=="string"){if(f=f.split("/"),f[0]==="")return f;throw new Error("Invalid JSON pointer.")}else if(Array.isArray(f)){for(const u of f)if(typeof u!="string"&&typeof u!="number")throw new Error("Invalid JSON pointer. Must be of type string or number.");return f}throw new Error("Invalid JSON pointer.")}function o(f,u){if(typeof f!="object")throw new Error("Invalid input object.");u=s(u);var d=u.length;if(d===1)return f;for(var h=1;h<d;){if(f=f[r(u[h++])],d===h)return f;if(typeof f!="object"||f===null)return}}function a(f,u,d){if(typeof f!="object")throw new Error("Invalid input object.");if(u=s(u),u.length===0)throw new Error("Invalid JSON pointer for set.");return i(f,u,d)}function l(f){var u=s(f);return{get:function(d){return o(d,u)},set:function(d,h){return a(d,u,h)}}}return an.get=o,an.set=a,an.compile=l,an}var lg=ag();const Ir=fi(lg);function cg(t,e){return t&&Zt(e,Pe(e),t)}function ug(t,e){return t&&Zt(e,Dn(e),t)}function dg(t,e){return Zt(t,Ci(t),e)}var fg=Object.getOwnPropertySymbols,Ja=fg?function(t){for(var e=[];t;)Ai(e,Ci(t)),t=sr(t);return e}:ba;function mg(t,e){return Zt(t,Ja(t),e)}function Ui(t){return xa(t,Dn,Ja)}var hg=Object.prototype,pg=hg.hasOwnProperty;function gg(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&pg.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function yg(t,e){var n=e?Mi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var xg=/\w*$/;function bg(t){var e=new t.constructor(t.source,xg.exec(t));return e.lastIndex=t.lastIndex,e}var ro=Ne?Ne.prototype:void 0,io=ro?ro.valueOf:void 0;function vg(t){return io?Object(io.call(t)):{}}var Sg="[object Boolean]",wg="[object Date]",jg="[object Map]",Og="[object Number]",Ag="[object RegExp]",Cg="[object Set]",_g="[object String]",Ng="[object Symbol]",Tg="[object ArrayBuffer]",Fg="[object DataView]",Pg="[object Float32Array]",Eg="[object Float64Array]",Ig="[object Int8Array]",Dg="[object Int16Array]",$g="[object Int32Array]",kg="[object Uint8Array]",Mg="[object Uint8ClampedArray]",Rg="[object Uint16Array]",Bg="[object Uint32Array]";function Ug(t,e,n){var r=t.constructor;switch(e){case Tg:return Mi(t);case Sg:case wg:return new r(+t);case Fg:return yg(t,n);case Pg:case Eg:case Ig:case Dg:case $g:case kg:case Mg:case Rg:case Bg:return Ua(t,n);case jg:return new r;case Og:case _g:return new r(t);case Ag:return bg(t);case Cg:return new r;case Ng:return vg(t)}}var Lg="[object Map]";function Vg(t){return Te(t)&&Ce(t)==Lg}var so=Kt&&Kt.isMap,Wg=so?Ni(so):Vg,zg="[object Set]";function qg(t){return Te(t)&&Ce(t)==zg}var oo=Kt&&Kt.isSet,Kg=oo?Ni(oo):qg,Gg=1,Hg=2,Yg=4,Za="[object Arguments]",Xg="[object Array]",Jg="[object Boolean]",Zg="[object Date]",Qg="[object Error]",Qa="[object Function]",ey="[object GeneratorFunction]",ty="[object Map]",ny="[object Number]",el="[object Object]",ry="[object RegExp]",iy="[object Set]",sy="[object String]",oy="[object Symbol]",ay="[object WeakMap]",ly="[object ArrayBuffer]",cy="[object DataView]",uy="[object Float32Array]",dy="[object Float64Array]",fy="[object Int8Array]",my="[object Int16Array]",hy="[object Int32Array]",py="[object Uint8Array]",gy="[object Uint8ClampedArray]",yy="[object Uint16Array]",xy="[object Uint32Array]",ae={};ae[Za]=ae[Xg]=ae[ly]=ae[cy]=ae[Jg]=ae[Zg]=ae[uy]=ae[dy]=ae[fy]=ae[my]=ae[hy]=ae[ty]=ae[ny]=ae[el]=ae[ry]=ae[iy]=ae[sy]=ae[oy]=ae[py]=ae[gy]=ae[yy]=ae[xy]=!0;ae[Qg]=ae[Qa]=ae[ay]=!1;function mn(t,e,n,r,i,s){var o,a=e&Gg,l=e&Hg,f=e&Yg;if(n&&(o=i?n(t,r,i,s):n(t)),o!==void 0)return o;if(!Z(t))return t;var u=ye(t);if(u){if(o=gg(t),!a)return Ri(t,o)}else{var d=Ce(t),h=d==Qa||d==ey;if(At(t))return Ba(t,a);if(d==el||d==Za||h&&!i){if(o=l||h?{}:La(t),!a)return l?mg(t,ug(o,t)):dg(t,cg(o,t))}else{if(!ae[d])return i?t:{};o=Ug(t,d,a)}}s||(s=new Ee);var g=s.get(t);if(g)return g;s.set(t,o),Kg(t)?t.forEach(function(y){o.add(mn(y,e,n,y,t,s))}):Wg(t)&&t.forEach(function(y,x){o.set(x,mn(y,e,n,x,t,s))});var m=f?l?Ui:Yr:l?Dn:Pe,p=u?void 0:m(t);return $i(p||t,function(y,x){p&&(x=y,y=t[x]),Ii(o,x,mn(y,e,n,x,t,s))}),o}function tl(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function by(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}function vy(t,e){return e.length<2?t:ur(t,by(e,0,-1))}var Sy=Object.prototype,wy=Sy.hasOwnProperty;function nl(t,e){e=Jt(e,t);var n=-1,r=e.length;if(!r)return!0;for(var i=t==null||typeof t!="object"&&typeof t!="function";++n<r;){var s=e[n];if(typeof s=="string"){if(s==="__proto__"&&!wy.call(t,"__proto__"))return!1;if(s==="constructor"&&n+1<r&&typeof e[n+1]=="string"&&e[n+1]==="prototype"){if(i&&n===0)continue;return!1}}}var o=vy(t,e);return o==null||delete o[Ft(tl(e))]}function jy(t){return gt(t)?void 0:t}function ti(t){var e=t==null?0:t.length;return e?$n(t,1):[]}function rl(t){return za(Wa(t,void 0,ti),t+"")}var Oy=1,Ay=2,Cy=4,wn=rl(function(t,e){var n={};if(t==null)return n;var r=!1;e=Xt(e,function(s){return s=Jt(s,t),r||(r=s.length>1),s}),Zt(t,Ui(t),n),r&&(n=mn(n,Oy|Ay|Cy,jy));for(var i=e.length;i--;)nl(n,e[i]);return n}),_y=Dc();const Li=fi(_y);function nr(t,e){if(oe in t&&Li.equal(t[oe],e))return t;for(const n of Object.values(t))if(Array.isArray(n)){for(const r of n)if(Z(r)){const i=nr(r,e);if(i!==void 0)return i}}else if(Z(n)){const r=nr(n,e);if(r!==void 0)return r}}function ni(t,e){const n=I(t,oe,e);ce in t&&(t={...t,[ce]:Li.resolve(n,t[ce])});for(const[r,i]of Object.entries(t))Array.isArray(i)?t={...t,[r]:i.map(s=>Z(s)?ni(s,n):s)}:Z(i)&&(t={...t,[r]:ni(i,n)});return t}function Vi(t,e){const n=e[t];return[wn(e,[t]),n]}function il(t,e={},n=[],r=I(e,[oe])){const i=t||"";let s;if(i.startsWith("#")){const a=decodeURIComponent(i.substring(1));r===void 0||oe in e&&e[oe]===r?s=Ir.get(e,a):e[cn]===Kn&&(s=nr(e,r.replace(/\/$/,"")),s!==void 0&&(s=Ir.get(s,a)))}else if(e[cn]===Kn){const a=r?Li.resolve(r,i):i,[l,...f]=a.replace(/#\/?$/,"").split("#");s=nr(e,l.replace(/\/$/,"")),s!==void 0&&(r=s[oe],me(f)||(s=Ir.get(s,decodeURIComponent(f.join("#")))))}if(s===void 0)throw new Error(`Could not find a definition for ${t}.`);const o=s[ce];if(o){if(n.includes(o)){if(n.length===1)throw new Error(`Definition for ${t} is a circular reference`);const[u,...d]=n,h=[...d,i,u].join(" -> ");throw new Error(`Definition for ${u} contains a circular reference through ${h}`)}const[a,l]=Vi(ce,s),f=il(l,e,[...n,i],r);return Object.keys(a).length>0?e[cn]===Vd||e[cn]===Kn?{[pt]:[a,f]}:{...a,...f}:f}return s}function sl(t,e={},n=I(e,[oe])){return il(t,e,[],n)}var Ny="[object String]";function yt(t){return typeof t=="string"||!ye(t)&&Te(t)&&tt(t)==Ny}function Ge(t){let e;const n=I(t,Bd);return yt(n)?e=n:n!==void 0&&console.warn(`Expecting discriminator to be a string, got "${typeof n}" instead`),e}function jn(t){return Array.isArray(t)?"array":typeof t=="string"?"string":t==null?"null":typeof t=="boolean"?"boolean":isNaN(t)?typeof t=="object"?"object":"string":"number"}var Ty=fr(function(t){return Ka($n(t,1,Sn,!0))});function Ie(t){let{type:e}=t;return!e&&t.const?jn(t.const):!e&&t.enum?"string":!e&&(t.properties||t.additionalProperties||t.patternProperties)?"object":(Array.isArray(e)&&(e.length===2&&e.includes("null")?e=e.find(n=>n!=="null"):e=e[0]),e)}function et(t,e){const n=Object.assign({},t);return Object.keys(e).reduce((r,i)=>{const s=t?t[i]:{},o=e[i];return t&&i in t&&Y(o)?r[i]=et(s,o):t&&e&&(Ie(t)==="object"||Ie(e)==="object")&&i===la&&Array.isArray(s)&&Array.isArray(o)?r[i]=Ty(s,o):r[i]=o,r},n)}var Fy="[object Number]";function ol(t){return typeof t=="number"||Te(t)&&tt(t)==Fy}function al(t,e,n){var r;if(t&&n){const i=I(t,n);if(i===void 0)return;for(let s=0;s<e.length;s++){const o=e[s],a=I(o,[te,n],{});if(!(a.type==="object"||a.type==="array")&&(a.const===i||!((r=a.enum)===null||r===void 0)&&r.includes(i)))return s}}}function Wi(t,e,n,r,i){if(e===void 0)return 0;const s=al(e,n,i);if(ol(s))return s;for(let o=0;o<n.length;o++){const a=n[o];if(i&&X(a,[te,i])){const l=I(e,i),f=I(a,[te,i],{});if(t.isValid(f,l,r))return o}else if(a[te]){const l={anyOf:Object.keys(a[te]).map(u=>({required:[u]}))};let f;if(a.anyOf){const{...u}=a;u.allOf?u.allOf=u.allOf.slice():u.allOf=[],u.allOf.push(l),f=u}else f=Object.assign({},a,l);if(delete f.required,t.isValid(f,e,r))return o}else if(t.isValid(a,e,r))return o}return 0}function be(t,e,n={},r,i,s=!1){return We(t,e,n,r,void 0,void 0,i,s)[0]}function Py(t,e,n,r,i,s,o){const{if:a,then:l,else:f,...u}=e,d=t.isValid(a,s||{},n);let h=[u],g=[];if(r)l&&typeof l!="boolean"&&(g=g.concat(We(t,l,n,s,r,i,o))),f&&typeof f!="boolean"&&(g=g.concat(We(t,f,n,s,r,i,o)));else{const m=d?l:f;m&&typeof m!="boolean"&&(g=g.concat(We(t,m,n,s,r,i,o)))}return g.length&&(h=g.map(m=>et(u,m))),h.flatMap(m=>We(t,m,n,s,r,i,o))}function ll(t){return t.reduce((n,r)=>r.length>1?r.flatMap(i=>Pa(n.length,s=>[...n[s]].concat(i))):(n.forEach(i=>i.push(r[0])),n),[[]])}function cl(t,e){return Object.keys(t.patternProperties).filter(n=>RegExp(n).test(e)).reduce((n,r)=>(se(n,[r],t.patternProperties[r]),n),{})}function Ey(t,e,n,r,i,s,o,a){const l=ul(t,e,n,r,i,s,o,a);if(l.length>1||l[0]!==e)return l;if(vi in e)return dl(t,e,n,r,i,s,o).flatMap(u=>We(t,u,n,s,r,i,o));if(pt in e&&Array.isArray(e[pt])){const f=e.allOf.map(d=>We(t,d,n,s,r,i,o));return ll(f).map(d=>({...e,allOf:d}))}return[e]}function ul(t,e,n,r,i,s,o,a){const l=Vt(e,n,i,void 0,a);return l!==e?We(t,l,n,s,r,i,o,a):[e]}function Vt(t,e,n,r,i){if(!Y(t))return t;let s=t;if(ce in s){const{$ref:o,...a}=s;if(n.includes(o))return s;n.push(o),s={...sl(o,e,r),...a},oe in s&&(r=s[oe])}if(te in s){const o=[],a=op(s[te],(l,f,u)=>{const d=[...n];l[u]=Vt(f,e,d,r,i),o.push(d)},{});jp(n,Ga(Cp(o))),s={...s,[te]:a}}if(zt in s&&!Array.isArray(s.items)&&typeof s.items!="boolean"&&(s={...s,items:Vt(s.items,e,n,r,i)}),i){let o,a;J in t&&Array.isArray(t[J])?(o=J,a=s[J]):q in t&&Array.isArray(t[q])&&(o=q,a=s[q]),o&&a&&(s={...s,[o]:a.map(l=>Vt(l,e,n,r,i))})}return le(t,s)?t:s}function Iy(t,e,n,r,i){const s={...e,properties:{...e.properties}},o=r&&Y(r)?r:{};return Object.keys(o).forEach(a=>{if(!(a in s.properties)){if(Kr in s){const l=cl(s,a);if(!me(l)){s.properties[a]=be(t,{[pt]:Object.values(l)},n,I(o,[a]),i),se(s.properties,[a,Qe],!0);return}}if(Zn in s&&s.additionalProperties!==!1){let l;typeof s.additionalProperties!="boolean"?ce in s.additionalProperties?l=be(t,{[ce]:I(s.additionalProperties,[ce])},n,o,i):"type"in s.additionalProperties?l={...s.additionalProperties}:J in s.additionalProperties||q in s.additionalProperties?l={type:"object",...s.additionalProperties}:l={type:jn(I(o,[a]))}:l={type:jn(I(o,[a]))},s.properties[a]=l,se(s.properties,[a,Qe],!0)}else s.properties[a]={type:"null"},se(s.properties,[a,Qe],!0)}}),s}const{compareSchemaDefinitions:Dy,compareSchemaValues:$y}=Yp(),{mergeArrayOfSchemaDefinitions:ky}=ig({intersectJson:Wp($y),deduplicateJsonSchemaDef:Ha(Dy)}),My=og(ky);function Ry(t){return My(t)}function We(t,e,n,r,i=!1,s=[],o,a){return Y(e)?Ey(t,e,n,i,s,r,o,a).flatMap(f=>{var u;let d=f;if(Si in d)return Py(t,d,n,i,s,r,o);if(pt in d){if(i){const{allOf:g,...m}=d;return[...g,m]}try{const g=[],m=[];(u=d.allOf)===null||u===void 0||u.forEach(p=>{typeof p=="object"&&p.contains?g.push(p):m.push(p)}),g.length&&(d={...d,allOf:m}),d=o?o(d):Ry(d),g.length&&(d.allOf=g)}catch(g){console.warn(`could not merge subschemas in allOf:
|
|
1
|
+
import{ar as Tc,c as ve,K as di,v as Fc,j as c,f as Go,M as Pc,as as us,u as Ec,a as Ic,t as Ut,V as fi,at as Dc,r as P,au as $c,av as Ho,aw as kc,ax as Mc,W as Rc,h as Yo,i as mi,l as Bc,ay as Uc,az as Lc,aA as Vc,a8 as Wc,a6 as Rt,a3 as Nn,a1 as Yt,ap as zc,a2 as qc,aB as Kc,a4 as Gc,aC as Hc,y as Xo,J as Yc,aD as Xc,z as Ae,I as ds,_ as Jc,x as Zc,k as Qc,E as eu,B as tu}from"./index-C0cxXUhv.js";import{i as nu,a as ru}from"./mcp-oauth-C_uVzdje.js";import{c as hi}from"./connection-CzagOXhI.js";import{p as iu,i as su}from"./schema-BesiDnBO.js";import{E as ou,r as au,e as Jo}from"./env-vars-editor-Bw5ArpUL.js";import{I as lu,n as cu,E as uu}from"./empty-state-aph8hymo.js";import{E as du}from"./error-boundary-BSc3aikh.js";import{u as pi,a as Zo}from"./use-connection-D__nfNf6.js";import{u as Qo,b as ea}from"./use-binding-CmWOKG-X.js";import{u as fu}from"./use-tool-call-DdCnWg9K.js";import{P as mu}from"./pin-to-sidebar-button-BTWnJIgz.js";import{B as Wt,c as hu}from"./button-BID2CMhP.js";import{i as pu}from"./File06-D5XMLdKt.js";import{i as gu}from"./Key01-BVzZzDXG.js";import{i as yn}from"./Loading01-CVbOjnPi.js";import{V as yu}from"./layout-DVqtFrGe.js";import{u as gi}from"./project-context-provider-CG5Jt9jX.js";import{B as fs}from"./badge-DIpSEo79.js";import{F as ke,a as xu,b as Me,d as Re,f as Be,c as it,e as xr}from"./form-R15NVDAL.js";import{I as lt}from"./input-DHdPZHvh.js";import{S as ta,a as na,b as ra,c as ia,d as kt,e as sa}from"./select-Cd19OBy8.js";import{i as ms,M as bu,e as vu}from"./extract-connection-data-DsBhcJbM.js";import{u as Su,a as wu,i as yi}from"./use-virtual-mcp-aCxo16E3.js";import{s as br,f as oa,e as ju}from"./registry-utils-Cqqa8TSE.js";import{i as Ou}from"./Terminal-C4vz1dQ0.js";import{i as Au}from"./Grid01-uChhmLMS.js";import{s as aa}from"./Plus-jsBXu2Jm.js";import{u as Cu,R as _u,I as Nu,a as Tu}from"./index-wl-vFw7b.js";import"./constants-VQyKSexs.js";import{R as hs,_ as Ct}from"./index-kNWs-Kaj.js";import{V as Fu,M as Pu}from"./index-BfX1PMhV.js";function Eu(t,e){return Cu({...t,queries:t.queries.map(n=>({...n,suspense:!0,throwOnError:Tc,enabled:!0,placeholderData:void 0}))},e)}function Vw(t){const e=ve.c(9),{connectionId:n}=t;let r,i,s;e[0]!==n?(r=new URL(`/mcp/${n}`,window.location.origin),s=Fc,i=di.isMCPAuthenticated(r.href,null),e[0]=n,e[1]=r,e[2]=i,e[3]=s):(r=e[1],i=e[2],s=e[3]);let o;e[4]!==r?(o=()=>nu({url:r.href,token:null}),e[4]=r,e[5]=o):o=e[5];let a;e[6]!==i||e[7]!==o?(a={queryKey:i,queryFn:o},e[6]=i,e[7]=o,e[8]=a):a=e[8];const{data:l}=s(a);return l}const Bn=43200,ps=1440,gs=Symbol.for("constructDateFrom");function xi(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&gs in t?t[gs](e):t instanceof Date?new t.constructor(e):new Date(e)}function ht(t,e){return xi(t,t)}let Iu={};function Du(){return Iu}function ys(t){const e=ht(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function bi(t,...e){const n=xi.bind(null,t||e.find(r=>typeof r=="object"));return e.map(n)}function zn(t,e){const n=+ht(t)-+ht(e);return n<0?-1:n>0?1:n}function $u(t){return xi(t,Date.now())}function ku(t,e,n){const[r,i]=bi(n?.in,t,e),s=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return s*12+o}function Mu(t){return e=>{const r=(t?Math[t]:Math.trunc)(e);return r===0?0:r}}function Ru(t,e){return+ht(t)-+ht(e)}function Bu(t,e){const n=ht(t);return n.setHours(23,59,59,999),n}function Uu(t,e){const n=ht(t),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Lu(t,e){const n=ht(t);return+Bu(n)==+Uu(n)}function Vu(t,e,n){const[r,i,s]=bi(n?.in,t,t,e),o=zn(i,s),a=Math.abs(ku(i,s));if(a<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*a);let l=zn(i,s)===-o;Lu(r)&&a===1&&zn(r,s)===1&&(l=!1);const f=o*(a-+l);return f===0?0:f}function Wu(t,e,n){const r=Ru(t,e)/1e3;return Mu(n?.roundingMethod)(r)}const zu={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},qu=(t,e,n)=>{let r;const i=zu[t];return typeof i=="string"?r=i:e===1?r=i.one:r=i.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function vr(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const Ku={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Gu={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Hu={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Yu={date:vr({formats:Ku,defaultWidth:"full"}),time:vr({formats:Gu,defaultWidth:"full"}),dateTime:vr({formats:Hu,defaultWidth:"full"})},Xu={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ju=(t,e,n,r)=>Xu[t];function rn(t){return(e,n)=>{const r=n?.context?String(n.context):"standalone";let i;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=n?.width?String(n.width):o;i=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=n?.width?String(n.width):t.defaultWidth;i=t.values[a]||t.values[o]}const s=t.argumentCallback?t.argumentCallback(e):e;return i[s]}}const Zu={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Qu={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ed={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},td={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},nd={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},rd={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},id=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},sd={ordinalNumber:id,era:rn({values:Zu,defaultWidth:"wide"}),quarter:rn({values:Qu,defaultWidth:"wide",argumentCallback:t=>t-1}),month:rn({values:ed,defaultWidth:"wide"}),day:rn({values:td,defaultWidth:"wide"}),dayPeriod:rn({values:nd,defaultWidth:"wide",formattingValues:rd,defaultFormattingWidth:"wide"})};function sn(t){return(e,n={})=>{const r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=e.match(i);if(!s)return null;const o=s[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?ad(a,d=>d.test(o)):od(a,d=>d.test(o));let f;f=t.valueCallback?t.valueCallback(l):l,f=n.valueCallback?n.valueCallback(f):f;const u=e.slice(o.length);return{value:f,rest:u}}}function od(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function ad(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function ld(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const i=r[0],s=e.match(t.parsePattern);if(!s)return null;let o=t.valueCallback?t.valueCallback(s[0]):s[0];o=n.valueCallback?n.valueCallback(o):o;const a=e.slice(i.length);return{value:o,rest:a}}}const cd=/^(\d+)(th|st|nd|rd)?/i,ud=/\d+/i,dd={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},fd={any:[/^b/i,/^(a|c)/i]},md={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},hd={any:[/1/i,/2/i,/3/i,/4/i]},pd={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},gd={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},yd={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},xd={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},bd={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},vd={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Sd={ordinalNumber:ld({matchPattern:cd,parsePattern:ud,valueCallback:t=>parseInt(t,10)}),era:sn({matchPatterns:dd,defaultMatchWidth:"wide",parsePatterns:fd,defaultParseWidth:"any"}),quarter:sn({matchPatterns:md,defaultMatchWidth:"wide",parsePatterns:hd,defaultParseWidth:"any",valueCallback:t=>t+1}),month:sn({matchPatterns:pd,defaultMatchWidth:"wide",parsePatterns:gd,defaultParseWidth:"any"}),day:sn({matchPatterns:yd,defaultMatchWidth:"wide",parsePatterns:xd,defaultParseWidth:"any"}),dayPeriod:sn({matchPatterns:bd,defaultMatchWidth:"any",parsePatterns:vd,defaultParseWidth:"any"})},wd={code:"en-US",formatDistance:qu,formatLong:Yu,formatRelative:Ju,localize:sd,match:Sd,options:{weekStartsOn:0,firstWeekContainsDate:1}};function jd(t,e,n){const r=Du(),i=n?.locale??r.locale??wd,s=2520,o=zn(t,e);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:o}),[l,f]=bi(n?.in,...o>0?[e,t]:[t,e]),u=Wu(f,l),d=(ys(f)-ys(l))/1e3,h=Math.round((u-d)/60);let g;if(h<2)return n?.includeSeconds?u<5?i.formatDistance("lessThanXSeconds",5,a):u<10?i.formatDistance("lessThanXSeconds",10,a):u<20?i.formatDistance("lessThanXSeconds",20,a):u<40?i.formatDistance("halfAMinute",0,a):u<60?i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",1,a):h===0?i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",h,a);if(h<45)return i.formatDistance("xMinutes",h,a);if(h<90)return i.formatDistance("aboutXHours",1,a);if(h<ps){const m=Math.round(h/60);return i.formatDistance("aboutXHours",m,a)}else{if(h<s)return i.formatDistance("xDays",1,a);if(h<Bn){const m=Math.round(h/ps);return i.formatDistance("xDays",m,a)}else if(h<Bn*2)return g=Math.round(h/Bn),i.formatDistance("aboutXMonths",g,a)}if(g=Vu(f,l),g<12){const m=Math.round(h/Bn);return i.formatDistance("xMonths",m,a)}else{const m=g%12,p=Math.trunc(g/12);return m<3?i.formatDistance("aboutXYears",p,a):m<9?i.formatDistance("overXYears",p,a):i.formatDistance("almostXYears",p+1,a)}}function Od(t,e){return jd(t,$u(t),e)}function Ad(t){const e=ve.c(13),{virtualMcp:n,org:r}=t;let i;e[0]!==r||e[1]!==n.id?(i={org:r,agentId:n.id},e[0]=r,e[1]=n.id,e[2]=i):i=e[2];let s;e[3]!==n.icon||e[4]!==n.title?(s=n.icon?c.jsx("img",{src:n.icon,alt:n.title,className:"w-8 h-8 rounded-md object-cover shrink-0"}):c.jsx("div",{className:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center shrink-0",children:c.jsx(yi,{size:16,className:"text-primary"})}),e[3]=n.icon,e[4]=n.title,e[5]=s):s=e[5];let o;e[6]!==n.title?(o=c.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[6]=n.title,e[7]=o):o=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(Au,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[8]=a):a=e[8];let l;return e[9]!==i||e[10]!==s||e[11]!==o?(l=c.jsxs(Pc,{to:"/$org/agents/$agentId",params:i,className:"flex items-center gap-3 p-3 rounded-lg border border-border hover:bg-muted/50 transition-colors group",children:[s,o,a]}),e[9]=i,e[10]=s,e[11]=o,e[12]=l):l=e[12],l}function xs(t){const e=ve.c(20),{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:o,hasExistingVirtualMcps:a}=t,l=Go(),f=wu();let u;e[0]!==f.create||e[1]!==i||e[2]!==s||e[3]!==n||e[4]!==r||e[5]!==l||e[6]!==o?(u=async()=>{const m=await f.create.mutateAsync({title:`${r} Agent`,description:i??null,icon:s??null,status:"active",tool_selection_mode:"inclusion",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});l({to:"/$org/agents/$agentId",params:{org:o,agentId:m.id}})},e[0]=f.create,e[1]=i,e[2]=s,e[3]=n,e[4]=r,e[5]=l,e[6]=o,e[7]=u):u=e[7];const d=u;if(a){let m;e[8]!==f.create.isPending?(m=f.create.isPending?c.jsx(yn,{size:16,className:"animate-spin"}):c.jsx(aa,{size:16}),e[8]=f.create.isPending,e[9]=m):m=e[9];let p;return e[10]!==f.create.isPending||e[11]!==d||e[12]!==m?(p=c.jsxs(Wt,{variant:"outline",size:"sm",className:"gap-1.5",onClick:d,disabled:f.create.isPending,children:[m,"Create another Agent"]}),e[10]=f.create.isPending,e[11]=d,e[12]=m,e[13]=p):p=e[13],p}let h;e[14]!==f.create.isPending?(h=f.create.isPending?c.jsx(yn,{size:20,className:"animate-spin"}):c.jsx(yi,{size:20}),e[14]=f.create.isPending,e[15]=h):h=e[15];let g;return e[16]!==f.create.isPending||e[17]!==d||e[18]!==h?(g=c.jsxs(Wt,{size:"lg",className:"gap-2 w-full",onClick:d,disabled:f.create.isPending,children:[h,"Create an agent"]}),e[16]=f.create.isPending,e[17]=d,e[18]=h,e[19]=g):g=e[19],g}function Cd(t){const e=ve.c(26),{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:o}=t;let a;e[0]!==n?(a={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=a):a=e[1];const l=Su(a);if(!(l.length>0)){let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("h4",{className:"text-sm font-medium text-foreground",children:"Use in your IDE"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Expose this connection via an Agent to use it in Cursor, VS Code, Claude Desktop, and other MCP-compatible tools."})]}),e[2]=p):p=e[2];let y;return e[3]!==i||e[4]!==s||e[5]!==n||e[6]!==r||e[7]!==o?(y=c.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[p,c.jsx(xs,{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:o,hasExistingVirtualMcps:!1})]}),e[3]=i,e[4]=s,e[5]=n,e[6]=r,e[7]=o,e[8]=y):y=e[8],y}let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("h4",{className:"text-sm font-medium text-foreground",children:"Agents"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection is used on the following agents."})]}),e[9]=u):u=e[9];let d;if(e[10]!==o||e[11]!==l){let p;e[13]!==o?(p=y=>c.jsx(Ad,{virtualMcp:y,org:o},y.id),e[13]=o,e[14]=p):p=e[14],d=l.map(p),e[10]=o,e[11]=l,e[12]=d}else d=e[12];let h;e[15]!==d?(h=c.jsx("div",{className:"flex flex-col gap-2",children:d}),e[15]=d,e[16]=h):h=e[16];let g;e[17]!==i||e[18]!==s||e[19]!==n||e[20]!==r||e[21]!==o?(g=c.jsx(xs,{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:o,hasExistingVirtualMcps:!0}),e[17]=i,e[18]=s,e[19]=n,e[20]=r,e[21]=o,e[22]=g):g=e[22];let m;return e[23]!==h||e[24]!==g?(m=c.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[u,h,g]}),e[23]=h,e[24]=g,e[25]=m):m=e[25],m}function _d({form:t,connection:e,hasOAuthToken:n}){const r=us({control:t.control,name:"ui_type"}),i=us({control:t.control,name:"connection_url"}),{stdioEnabled:s}=Ec(),o=(()=>{if(typeof i!="string"||!i)return!1;try{const u=new URL(i);return u.hostname==="api.githubcopilot.com"&&u.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),a=s||e.connection_type==="STDIO",l=e.connection_type==="VIRTUAL",f=l?iu(e.connection_url):null;return l?c.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("span",{className:"text-sm font-medium",children:"Type"}),c.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[c.jsx(yi,{className:"w-4 h-4 text-muted-foreground"}),c.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),f&&c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("span",{className:"text-sm font-medium",children:"Virtual MCP ID"}),c.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:c.jsx("code",{className:"text-sm text-muted-foreground",children:f})})]})]}):c.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[c.jsx(ke,{control:t.control,name:"ui_type",render:({field:u})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Type"}),c.jsxs(ta,{value:u.value,onValueChange:u.onChange,children:[c.jsx(Re,{children:c.jsx(na,{children:c.jsx(ra,{})})}),c.jsxs(ia,{children:[c.jsx(kt,{value:"HTTP",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(br,{className:"w-4 h-4"}),"HTTP"]})}),c.jsx(kt,{value:"SSE",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(br,{className:"w-4 h-4"}),"SSE"]})}),c.jsx(kt,{value:"Websocket",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(br,{className:"w-4 h-4"}),"Websocket"]})}),a&&c.jsxs(c.Fragment,{children:[c.jsx(kt,{value:"NPX",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(cu,{className:"w-4 h-4"}),"NPX Package"]})}),c.jsx(kt,{value:"STDIO",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(Ou,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),c.jsx(Be,{})]})}),r==="NPX"&&c.jsx(ke,{control:t.control,name:"npx_package",render:({field:u})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"NPM Package"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"@perplexity-ai/mcp-server",...u,value:u.value||"",className:"h-10 rounded-lg"})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),c.jsx(Be,{})]})}),r==="STDIO"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(ke,{control:t.control,name:"stdio_command",render:({field:u})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Command"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"node, bun, python...",...u,value:u.value||"",className:"h-10 rounded-lg"})}),c.jsx(Be,{})]})}),c.jsx(ke,{control:t.control,name:"stdio_args",render:({field:u})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Arguments"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"arg1 arg2 --flag value",...u,value:u.value||"",className:"h-10 rounded-lg"})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments (no quotes needed)"}),c.jsx(Be,{})]})})]}),c.jsx(ke,{control:t.control,name:"stdio_cwd",render:({field:u})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Working Directory"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"/path/to/project (optional)",...u,value:u.value||"",className:"h-10 rounded-lg"})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),c.jsx(Be,{})]})})]}),(r==="NPX"||r==="STDIO")&&c.jsx(ke,{control:t.control,name:"env_vars",render:({field:u})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"Environment Variables"}),c.jsx(Re,{children:c.jsx(ou,{value:u.value??[],onChange:u.onChange})}),c.jsx(Be,{})]})}),r!=="NPX"&&r!=="STDIO"&&c.jsxs(c.Fragment,{children:[c.jsx(ke,{control:t.control,name:"connection_url",render:({field:u})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:"URL"}),c.jsx(Re,{children:c.jsx(lt,{placeholder:"https://example.com/mcp",...u,value:u.value??"",className:"h-10 rounded-lg"})}),c.jsx(Be,{})]})}),n?c.jsx("div",{className:"flex items-center",children:c.jsxs(fs,{variant:"success",className:"gap-1.5",children:[c.jsx(ms,{size:12}),"Authenticated via OAuth"]})}):e.connection_token?c.jsx("div",{className:"flex items-center",children:c.jsxs(fs,{variant:"secondary",className:"gap-1.5",children:[c.jsx(ms,{size:12}),"Token saved"]})}):null,c.jsx(ke,{control:t.control,name:"connection_token",render:({field:u})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(it,{className:"text-sm font-medium",children:o?"GitHub Personal Access Token":"Token"}),c.jsx(Re,{children:c.jsx(lt,{type:"password",placeholder:e.connection_token?"Enter new token to replace...":o?"Paste your GitHub PAT (no 'Bearer' prefix)":"Enter access token...",...u,value:u.value||"",className:"h-10 rounded-lg",disabled:n})}),n?c.jsx(xr,{children:"This connection uses OAuth for authentication. Manage access in the MCP Configuration panel."}):e.connection_token?c.jsx(xr,{children:"A token is already saved. Enter a new token to replace it."}):o?c.jsxs(xr,{children:["(!) GitHub's hosted MCP at"," ",c.jsx("code",{children:"api.githubcopilot.com/mcp"})," currently requires a Personal Access Token (PAT). Create one at"," ",c.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"}),". Mesh will send it as"," ",c.jsx("code",{children:"Authorization: Bearer <PAT>"}),"."]}):null,c.jsx(Be,{})]})})]})]})}function Nd(t){const e=ve.c(31),{form:n,connection:r,hasOAuthToken:i}=t,{org:s}=gi();let o;e[0]!==r.icon||e[1]!==r.title?(o=c.jsx(lu,{icon:r.icon,name:r.title,size:"lg",className:"shadow-sm"}),e[0]=r.icon,e[1]=r.title,e[2]=o):o=e[2];let a;e[3]!==n.control?(a=c.jsxs("div",{className:"flex flex-col",children:[c.jsx(ke,{control:n.control,name:"title",render:Fd}),c.jsx(ke,{control:n.control,name:"description",render:Td})]}),e[3]=n.control,e[4]=a):a=e[4];let l;e[5]!==o||e[6]!==a?(l=c.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[o,a]}),e[5]=o,e[6]=a,e[7]=l):l=e[7];let f;e[8]!==r||e[9]!==n||e[10]!==i?(f=c.jsx(_d,{form:n,connection:r,hasOAuthToken:i}),e[8]=r,e[9]=n,e[10]=i,e[11]=f):f=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=c.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[12]=u):u=e[12];let d;e[13]!==r.updated_at?(d=r.updated_at?Od(new Date(r.updated_at),{addSuffix:!1}):"Unknown",e[13]=r.updated_at,e[14]=d):d=e[14];let h;e[15]!==d?(h=c.jsxs("div",{className:"flex items-center gap-4 p-5 border-b border-border",children:[u,c.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:d})]}),e[15]=d,e[16]=h):h=e[16];let g;e[17]!==r.description||e[18]!==r.icon||e[19]!==r.id||e[20]!==r.title||e[21]!==s.slug?(g=c.jsx(Cd,{connectionId:r.id,connectionTitle:r.title,connectionDescription:r.description,connectionIcon:r.icon,org:s.slug}),e[17]=r.description,e[18]=r.icon,e[19]=r.id,e[20]=r.title,e[21]=s.slug,e[22]=g):g=e[22];let m;e[23]!==l||e[24]!==f||e[25]!==h||e[26]!==g?(m=c.jsxs("div",{className:"flex flex-col",children:[l,f,h,g]}),e[23]=l,e[24]=f,e[25]=h,e[26]=g,e[27]=m):m=e[27];let p;return e[28]!==n||e[29]!==m?(p=c.jsx(xu,{...n,children:m}),e[28]=n,e[29]=m,e[30]=p):p=e[30],p}function Td(t){const{field:e}=t;return c.jsxs(Me,{className:"w-full space-y-0",children:[c.jsx(Re,{children:c.jsx(lt,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),c.jsx(Be,{})]})}function Fd(t){const{field:e}=t;return c.jsxs(Me,{className:"w-full space-y-0",children:[c.jsx("div",{className:"flex items-center gap-2.5",children:c.jsx(Re,{children:c.jsx(lt,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})})}),c.jsx(Be,{})]})}function Pd(t){return t.startsWith("@")?t:`@${t}`}function Ed(t){const e=t._meta?.[bu]?.tools;if(!(!e||e.length===0))return e.map(n=>({name:n.name,inputSchema:n.inputSchema??void 0,outputSchema:n.outputSchema??void 0}))}function Id(t){const e=pi(),n=Qo(e),r=t?Pd(t):"",i=r?{where:{appName:r},includeTools:!0}:{},o=Eu({queries:n.map(l=>{const f=l.id,u=oa(l.tools)||"",d=hi(f),h=JSON.stringify(i);return{queryKey:di.toolCall(f,u,h),queryFn:async()=>{if(!u||!r)return null;try{return(await d(u,i))?.items?.[0]??null}catch{return null}},staleTime:300*1e3}})}).map(l=>l.data).find(l=>l!==null);return{bindingSchema:o?Ed(o):void 0}}function Dd(t){return t.startsWith("@")?t:`@${t}`}function $d(){const{org:t}=gi(),{data:e}=Ic.useSession(),n=Zo(),r=pi(),i=Qo(r);return{installByBinding:async o=>{if(!t||!e?.user?.id){Ut.error("Not authenticated");return}const a=Dd(o),f=(await Promise.all(i.map(async m=>{const p=oa(m.tools);if(!p)return null;const y=hi(m.id);try{const x=await y(p,{where:{appName:a}});return ju(x??[])[0]??null}catch{return null}}))).find(m=>m!==null);if(!f){Ut.error(`MCP Server not found in registry: ${o}`);return}const u=vu(f,t.id,e.user.id),d=u.connection_type==="STDIO",h=!!u.connection_url,g=d&&u.connection_headers&&typeof u.connection_headers=="object"&&"command"in u.connection_headers;if(!h&&!g){Ut.error("This MCP Server cannot be connected: no connection method available");return}return await n.create.mutateAsync(u),{id:u.id,connection:u}},isInstalling:n.create.isPending}}function Y(t){return typeof t!="object"||t===null||typeof t.lastModified=="number"&&typeof File<"u"&&t instanceof File||typeof t.getMonth=="function"&&typeof Date<"u"&&t instanceof Date?!1:!Array.isArray(t)}function kd(t){return t.additionalItems===!0&&console.warn("additionalItems=true is currently not supported"),Y(t.additionalItems)}function bs(t){if(t==="")return;if(t===null)return null;if(/\.$/.test(t)||/\.0$/.test(t)||/\.\d*0$/.test(t))return t;const e=Number(t);return typeof e=="number"&&!Number.isNaN(e)?e:t}const Qe="__additional_property",Zn="additionalProperties",pt="allOf",J="anyOf",_e="const",ir="default",vi="dependencies",Md="enum",xe="__errors",oe="$id",Si="if",zt="items",Rd="_$junk_option_schema_id$_",qn="$name",q="oneOf",Kr="patternProperties",te="properties",Sr="readonly",la="required",Qn="submitButtonOptions",ce="$ref",cn="$schema",ca="root",ua="_",Bd=["discriminator","propertyName"],vs="formContext",Ud="layoutGridLookupMap",wi="__rjsf_additionalProperties",da="__rjsf_rootSchema",Ld="ui:field",ji="ui:widget",ut="ui:options",Gr="ui:globalOptions",Vd="https://json-schema.org/draft/2019-09/schema",Kn="https://json-schema.org/draft/2020-12/schema";function U(t={},e={}){return t?Object.keys(t).filter(n=>n.indexOf("ui:")===0).reduce((n,r)=>{const i=t[r];return r===ji&&Y(i)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),n):r===ut&&Y(i)?{...n,...i}:{...n,[r.substring(3)]:i}},{...e}):{...e}}function fa(t,e={},n){if(!(t.additionalProperties||t.patternProperties))return!1;const{expandable:r=!0}=U(e);return r===!1?r:t.maxProperties!==void 0&&n?Object.keys(n).length<t.maxProperties:!0}var ma=typeof global=="object"&&global&&global.Object===Object&&global,Wd=typeof self=="object"&&self&&self.Object===Object&&self,Ye=ma||Wd||Function("return this")(),Ne=Ye.Symbol,ha=Object.prototype,zd=ha.hasOwnProperty,qd=ha.toString,on=Ne?Ne.toStringTag:void 0;function Kd(t){var e=zd.call(t,on),n=t[on];try{t[on]=void 0;var r=!0}catch{}var i=qd.call(t);return r&&(e?t[on]=n:delete t[on]),i}var Gd=Object.prototype,Hd=Gd.toString;function Yd(t){return Hd.call(t)}var Xd="[object Null]",Jd="[object Undefined]",Ss=Ne?Ne.toStringTag:void 0;function tt(t){return t==null?t===void 0?Jd:Xd:Ss&&Ss in Object(t)?Kd(t):Yd(t)}function pa(t,e){return function(n){return t(e(n))}}var sr=pa(Object.getPrototypeOf,Object);function Te(t){return t!=null&&typeof t=="object"}var Zd="[object Object]",Qd=Function.prototype,ef=Object.prototype,ga=Qd.toString,tf=ef.hasOwnProperty,nf=ga.call(Object);function gt(t){if(!Te(t)||tt(t)!=Zd)return!1;var e=sr(t);if(e===null)return!0;var n=tf.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&ga.call(n)==nf}function Hr(t){const e={[xe]:[],addError(n){this[xe].push(n)}};if(Array.isArray(t))return t.reduce((n,r,i)=>({...n,[i]:Hr(r)}),e);if(gt(t)){const n=t;return Object.keys(n).reduce((r,i)=>({...r,[i]:Hr(n[i])}),e)}return e}function rf(){this.__data__=[],this.size=0}function Tn(t,e){return t===e||t!==t&&e!==e}function or(t,e){for(var n=t.length;n--;)if(Tn(t[n][0],e))return n;return-1}var sf=Array.prototype,of=sf.splice;function af(t){var e=this.__data__,n=or(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():of.call(e,n,1),--this.size,!0}function lf(t){var e=this.__data__,n=or(e,t);return n<0?void 0:e[n][1]}function cf(t){return or(this.__data__,t)>-1}function uf(t,e){var n=this.__data__,r=or(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function nt(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}nt.prototype.clear=rf;nt.prototype.delete=af;nt.prototype.get=lf;nt.prototype.has=cf;nt.prototype.set=uf;function df(){this.__data__=new nt,this.size=0}function ff(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function mf(t){return this.__data__.get(t)}function hf(t){return this.__data__.has(t)}function Z(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var pf="[object AsyncFunction]",gf="[object Function]",yf="[object GeneratorFunction]",xf="[object Proxy]";function Fn(t){if(!Z(t))return!1;var e=tt(t);return e==gf||e==yf||e==pf||e==xf}var wr=Ye["__core-js_shared__"],ws=(function(){var t=/[^.]+$/.exec(wr&&wr.keys&&wr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function bf(t){return!!ws&&ws in t}var vf=Function.prototype,Sf=vf.toString;function _t(t){if(t!=null){try{return Sf.call(t)}catch{}try{return t+""}catch{}}return""}var wf=/[\\^$.*+?()[\]{}|]/g,jf=/^\[object .+?Constructor\]$/,Of=Function.prototype,Af=Object.prototype,Cf=Of.toString,_f=Af.hasOwnProperty,Nf=RegExp("^"+Cf.call(_f).replace(wf,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Tf(t){if(!Z(t)||bf(t))return!1;var e=Fn(t)?Nf:jf;return e.test(_t(t))}function Ff(t,e){return t?.[e]}function Nt(t,e){var n=Ff(t,e);return Tf(n)?n:void 0}var xn=Nt(Ye,"Map"),bn=Nt(Object,"create");function Pf(){this.__data__=bn?bn(null):{},this.size=0}function Ef(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var If="__lodash_hash_undefined__",Df=Object.prototype,$f=Df.hasOwnProperty;function kf(t){var e=this.__data__;if(bn){var n=e[t];return n===If?void 0:n}return $f.call(e,t)?e[t]:void 0}var Mf=Object.prototype,Rf=Mf.hasOwnProperty;function Bf(t){var e=this.__data__;return bn?e[t]!==void 0:Rf.call(e,t)}var Uf="__lodash_hash_undefined__";function Lf(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=bn&&e===void 0?Uf:e,this}function jt(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}jt.prototype.clear=Pf;jt.prototype.delete=Ef;jt.prototype.get=kf;jt.prototype.has=Bf;jt.prototype.set=Lf;function Vf(){this.size=0,this.__data__={hash:new jt,map:new(xn||nt),string:new jt}}function Wf(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ar(t,e){var n=t.__data__;return Wf(e)?n[typeof e=="string"?"string":"hash"]:n.map}function zf(t){var e=ar(this,t).delete(t);return this.size-=e?1:0,e}function qf(t){return ar(this,t).get(t)}function Kf(t){return ar(this,t).has(t)}function Gf(t,e){var n=ar(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function rt(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}rt.prototype.clear=Vf;rt.prototype.delete=zf;rt.prototype.get=qf;rt.prototype.has=Kf;rt.prototype.set=Gf;var Hf=200;function Yf(t,e){var n=this.__data__;if(n instanceof nt){var r=n.__data__;if(!xn||r.length<Hf-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new rt(r)}return n.set(t,e),this.size=n.size,this}function Ee(t){var e=this.__data__=new nt(t);this.size=e.size}Ee.prototype.clear=df;Ee.prototype.delete=ff;Ee.prototype.get=mf;Ee.prototype.has=hf;Ee.prototype.set=Yf;var Xf="__lodash_hash_undefined__";function Jf(t){return this.__data__.set(t,Xf),this}function Zf(t){return this.__data__.has(t)}function Ot(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new rt;++e<n;)this.add(t[e])}Ot.prototype.add=Ot.prototype.push=Jf;Ot.prototype.has=Zf;function Qf(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function vn(t,e){return t.has(e)}var em=1,tm=2;function ya(t,e,n,r,i,s){var o=n&em,a=t.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var f=s.get(t),u=s.get(e);if(f&&u)return f==e&&u==t;var d=-1,h=!0,g=n&tm?new Ot:void 0;for(s.set(t,e),s.set(e,t);++d<a;){var m=t[d],p=e[d];if(r)var y=o?r(p,m,d,e,t,s):r(m,p,d,t,e,s);if(y!==void 0){if(y)continue;h=!1;break}if(g){if(!Qf(e,function(x,S){if(!vn(g,S)&&(m===x||i(m,x,n,r,s)))return g.push(S)})){h=!1;break}}else if(!(m===p||i(m,p,n,r,s))){h=!1;break}}return s.delete(t),s.delete(e),h}var er=Ye.Uint8Array;function nm(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function Oi(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var rm=1,im=2,sm="[object Boolean]",om="[object Date]",am="[object Error]",lm="[object Map]",cm="[object Number]",um="[object RegExp]",dm="[object Set]",fm="[object String]",mm="[object Symbol]",hm="[object ArrayBuffer]",pm="[object DataView]",js=Ne?Ne.prototype:void 0,jr=js?js.valueOf:void 0;function gm(t,e,n,r,i,s,o){switch(n){case pm:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case hm:return!(t.byteLength!=e.byteLength||!s(new er(t),new er(e)));case sm:case om:case cm:return Tn(+t,+e);case am:return t.name==e.name&&t.message==e.message;case um:case fm:return t==e+"";case lm:var a=nm;case dm:var l=r&rm;if(a||(a=Oi),t.size!=e.size&&!l)return!1;var f=o.get(t);if(f)return f==e;r|=im,o.set(t,e);var u=ya(a(t),a(e),r,i,s,o);return o.delete(t),u;case mm:if(jr)return jr.call(t)==jr.call(e)}return!1}function Ai(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var ye=Array.isArray;function xa(t,e,n){var r=e(t);return ye(t)?r:Ai(r,n(t))}function ym(t,e){for(var n=-1,r=t==null?0:t.length,i=0,s=[];++n<r;){var o=t[n];e(o,n,t)&&(s[i++]=o)}return s}function ba(){return[]}var xm=Object.prototype,bm=xm.propertyIsEnumerable,Os=Object.getOwnPropertySymbols,Ci=Os?function(t){return t==null?[]:(t=Object(t),ym(Os(t),function(e){return bm.call(t,e)}))}:ba;function va(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var vm="[object Arguments]";function As(t){return Te(t)&&tt(t)==vm}var Sa=Object.prototype,Sm=Sa.hasOwnProperty,wm=Sa.propertyIsEnumerable,qt=As((function(){return arguments})())?As:function(t){return Te(t)&&Sm.call(t,"callee")&&!wm.call(t,"callee")};function jm(){return!1}var wa=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Cs=wa&&typeof module=="object"&&module&&!module.nodeType&&module,Om=Cs&&Cs.exports===wa,_s=Om?Ye.Buffer:void 0,Am=_s?_s.isBuffer:void 0,At=Am||jm,Cm=9007199254740991,_m=/^(?:0|[1-9]\d*)$/;function lr(t,e){var n=typeof t;return e=e??Cm,!!e&&(n=="number"||n!="symbol"&&_m.test(t))&&t>-1&&t%1==0&&t<e}var Nm=9007199254740991;function _i(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Nm}var Tm="[object Arguments]",Fm="[object Array]",Pm="[object Boolean]",Em="[object Date]",Im="[object Error]",Dm="[object Function]",$m="[object Map]",km="[object Number]",Mm="[object Object]",Rm="[object RegExp]",Bm="[object Set]",Um="[object String]",Lm="[object WeakMap]",Vm="[object ArrayBuffer]",Wm="[object DataView]",zm="[object Float32Array]",qm="[object Float64Array]",Km="[object Int8Array]",Gm="[object Int16Array]",Hm="[object Int32Array]",Ym="[object Uint8Array]",Xm="[object Uint8ClampedArray]",Jm="[object Uint16Array]",Zm="[object Uint32Array]",ue={};ue[zm]=ue[qm]=ue[Km]=ue[Gm]=ue[Hm]=ue[Ym]=ue[Xm]=ue[Jm]=ue[Zm]=!0;ue[Tm]=ue[Fm]=ue[Vm]=ue[Pm]=ue[Wm]=ue[Em]=ue[Im]=ue[Dm]=ue[$m]=ue[km]=ue[Mm]=ue[Rm]=ue[Bm]=ue[Um]=ue[Lm]=!1;function Qm(t){return Te(t)&&_i(t.length)&&!!ue[tt(t)]}function Ni(t){return function(e){return t(e)}}var ja=typeof exports=="object"&&exports&&!exports.nodeType&&exports,fn=ja&&typeof module=="object"&&module&&!module.nodeType&&module,eh=fn&&fn.exports===ja,Or=eh&&ma.process,Kt=(function(){try{var t=fn&&fn.require&&fn.require("util").types;return t||Or&&Or.binding&&Or.binding("util")}catch{}})(),Ns=Kt&&Kt.isTypedArray,Pn=Ns?Ni(Ns):Qm,th=Object.prototype,nh=th.hasOwnProperty;function Oa(t,e){var n=ye(t),r=!n&&qt(t),i=!n&&!r&&At(t),s=!n&&!r&&!i&&Pn(t),o=n||r||i||s,a=o?va(t.length,String):[],l=a.length;for(var f in t)(e||nh.call(t,f))&&!(o&&(f=="length"||i&&(f=="offset"||f=="parent")||s&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||lr(f,l)))&&a.push(f);return a}var rh=Object.prototype;function cr(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||rh;return t===n}var ih=pa(Object.keys,Object),sh=Object.prototype,oh=sh.hasOwnProperty;function Aa(t){if(!cr(t))return ih(t);var e=[];for(var n in Object(t))oh.call(t,n)&&n!="constructor"&&e.push(n);return e}function Tt(t){return t!=null&&_i(t.length)&&!Fn(t)}function Pe(t){return Tt(t)?Oa(t):Aa(t)}function Yr(t){return xa(t,Pe,Ci)}var ah=1,lh=Object.prototype,ch=lh.hasOwnProperty;function uh(t,e,n,r,i,s){var o=n&ah,a=Yr(t),l=a.length,f=Yr(e),u=f.length;if(l!=u&&!o)return!1;for(var d=l;d--;){var h=a[d];if(!(o?h in e:ch.call(e,h)))return!1}var g=s.get(t),m=s.get(e);if(g&&m)return g==e&&m==t;var p=!0;s.set(t,e),s.set(e,t);for(var y=o;++d<l;){h=a[d];var x=t[h],S=e[h];if(r)var j=o?r(S,x,h,e,t,s):r(x,S,h,t,e,s);if(!(j===void 0?x===S||i(x,S,n,r,s):j)){p=!1;break}y||(y=h=="constructor")}if(p&&!y){var b=t.constructor,v=e.constructor;b!=v&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof v=="function"&&v instanceof v)&&(p=!1)}return s.delete(t),s.delete(e),p}var Xr=Nt(Ye,"DataView"),Jr=Nt(Ye,"Promise"),Lt=Nt(Ye,"Set"),Zr=Nt(Ye,"WeakMap"),Ts="[object Map]",dh="[object Object]",Fs="[object Promise]",Ps="[object Set]",Es="[object WeakMap]",Is="[object DataView]",fh=_t(Xr),mh=_t(xn),hh=_t(Jr),ph=_t(Lt),gh=_t(Zr),Ce=tt;(Xr&&Ce(new Xr(new ArrayBuffer(1)))!=Is||xn&&Ce(new xn)!=Ts||Jr&&Ce(Jr.resolve())!=Fs||Lt&&Ce(new Lt)!=Ps||Zr&&Ce(new Zr)!=Es)&&(Ce=function(t){var e=tt(t),n=e==dh?t.constructor:void 0,r=n?_t(n):"";if(r)switch(r){case fh:return Is;case mh:return Ts;case hh:return Fs;case ph:return Ps;case gh:return Es}return e});var yh=1,Ds="[object Arguments]",$s="[object Array]",Un="[object Object]",xh=Object.prototype,ks=xh.hasOwnProperty;function bh(t,e,n,r,i,s){var o=ye(t),a=ye(e),l=o?$s:Ce(t),f=a?$s:Ce(e);l=l==Ds?Un:l,f=f==Ds?Un:f;var u=l==Un,d=f==Un,h=l==f;if(h&&At(t)){if(!At(e))return!1;o=!0,u=!1}if(h&&!u)return s||(s=new Ee),o||Pn(t)?ya(t,e,n,r,i,s):gm(t,e,l,n,r,i,s);if(!(n&yh)){var g=u&&ks.call(t,"__wrapped__"),m=d&&ks.call(e,"__wrapped__");if(g||m){var p=g?t.value():t,y=m?e.value():e;return s||(s=new Ee),i(p,y,n,r,s)}}return h?(s||(s=new Ee),uh(t,e,n,r,i,s)):!1}function En(t,e,n,r,i){return t===e?!0:t==null||e==null||!Te(t)&&!Te(e)?t!==t&&e!==e:bh(t,e,n,r,En,i)}function vh(t,e,n){n=typeof n=="function"?n:void 0;var r=n?n(t,e):void 0;return r===void 0?En(t,e,void 0,n):!!r}function le(t,e){return vh(t,e,(n,r)=>{if(typeof n=="function"&&typeof r=="function")return!0})}var Sh="[object Symbol]";function In(t){return typeof t=="symbol"||Te(t)&&tt(t)==Sh}var wh=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jh=/^\w*$/;function Ti(t,e){if(ye(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||In(t)?!0:jh.test(t)||!wh.test(t)||e!=null&&t in Object(e)}var Oh="Expected a function";function Fi(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Oh);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=t.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(Fi.Cache||rt),n}Fi.Cache=rt;var Ah=500;function Ch(t){var e=Fi(t,function(r){return n.size===Ah&&n.clear(),r}),n=e.cache;return e}var _h=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Nh=/\\(\\)?/g,Ca=Ch(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(_h,function(n,r,i,s){e.push(i?s.replace(Nh,"$1"):r||n)}),e});function Xt(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var Ms=Ne?Ne.prototype:void 0,Rs=Ms?Ms.toString:void 0;function _a(t){if(typeof t=="string")return t;if(ye(t))return Xt(t,_a)+"";if(In(t))return Rs?Rs.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Pi(t){return t==null?"":_a(t)}function Jt(t,e){return ye(t)?t:Ti(t,e)?[t]:Ca(Pi(t))}function Ft(t){if(typeof t=="string"||In(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function ur(t,e){e=Jt(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Ft(e[n++])];return n&&n==r?t:void 0}function I(t,e,n){var r=t==null?void 0:ur(t,e);return r===void 0?n:r}var Th=Object.prototype,Fh=Th.hasOwnProperty;function Ph(t,e){return t!=null&&Fh.call(t,e)}function Na(t,e,n){e=Jt(e,t);for(var r=-1,i=e.length,s=!1;++r<i;){var o=Ft(e[r]);if(!(s=t!=null&&n(t,o)))break;t=t[o]}return s||++r!=i?s:(i=t==null?0:t.length,!!i&&_i(i)&&lr(o,i)&&(ye(t)||qt(t)))}function X(t,e){return t!=null&&Na(t,e,Ph)}function dt(t,e){return En(t,e)}var tr=(function(){try{var t=Nt(Object,"defineProperty");return t({},"",{}),t}catch{}})();function Ei(t,e,n){e=="__proto__"&&tr?tr(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var Eh=Object.prototype,Ih=Eh.hasOwnProperty;function Ii(t,e,n){var r=t[e];(!(Ih.call(t,e)&&Tn(r,n))||n===void 0&&!(e in t))&&Ei(t,e,n)}function Di(t,e,n,r){if(!Z(t))return t;e=Jt(e,t);for(var i=-1,s=e.length,o=s-1,a=t;a!=null&&++i<s;){var l=Ft(e[i]),f=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=o){var u=a[l];f=r?r(u,l,a):void 0,f===void 0&&(f=Z(u)?u:lr(e[i+1])?[]:{})}Ii(a,l,f),a=a[l]}return t}function se(t,e,n){return t==null?t:Di(t,e,n)}function dr(t){return t}function Ta(t){return typeof t=="function"?t:dr}var Dh=/\s/;function $h(t){for(var e=t.length;e--&&Dh.test(t.charAt(e)););return e}var kh=/^\s+/;function Mh(t){return t&&t.slice(0,$h(t)+1).replace(kh,"")}var Bs=NaN,Rh=/^[-+]0x[0-9a-f]+$/i,Bh=/^0b[01]+$/i,Uh=/^0o[0-7]+$/i,Lh=parseInt;function Vh(t){if(typeof t=="number")return t;if(In(t))return Bs;if(Z(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Z(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Mh(t);var n=Bh.test(t);return n||Uh.test(t)?Lh(t.slice(2),n?2:8):Rh.test(t)?Bs:+t}var Us=1/0,Wh=17976931348623157e292;function zh(t){if(!t)return t===0?t:0;if(t=Vh(t),t===Us||t===-Us){var e=t<0?-1:1;return e*Wh}return t===t?t:0}function Fa(t){var e=zh(t),n=e%1;return e===e?n?e-n:e:0}var qh=9007199254740991,Ar=4294967295,Kh=Math.min;function Pa(t,e){if(t=Fa(t),t<1||t>qh)return[];var n=Ar,r=Kh(t,Ar);e=Ta(e),t-=Ar;for(var i=va(r,e);++n<t;)e(n);return i}function $i(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var Ls=Object.create,Ea=(function(){function t(){}return function(e){if(!Z(e))return{};if(Ls)return Ls(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();function Gh(t){return function(e,n,r){for(var i=-1,s=Object(e),o=r(e),a=o.length;a--;){var l=o[++i];if(n(s[l],l,s)===!1)break}return e}}var Ia=Gh();function Da(t,e){return t&&Ia(t,e,Pe)}var Hh=1,Yh=2;function Xh(t,e,n,r){var i=n.length,s=i;if(t==null)return!s;for(t=Object(t);i--;){var o=n[i];if(o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++i<s;){o=n[i];var a=o[0],l=t[a],f=o[1];if(o[2]){if(l===void 0&&!(a in t))return!1}else{var u=new Ee,d;if(!(d===void 0?En(f,l,Hh|Yh,r,u):d))return!1}}return!0}function $a(t){return t===t&&!Z(t)}function Jh(t){for(var e=Pe(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,$a(i)]}return e}function ka(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function Zh(t){var e=Jh(t);return e.length==1&&e[0][2]?ka(e[0][0],e[0][1]):function(n){return n===t||Xh(n,t,e)}}function Qh(t,e){return t!=null&&e in Object(t)}function Ma(t,e){return t!=null&&Na(t,e,Qh)}var ep=1,tp=2;function np(t,e){return Ti(t)&&$a(e)?ka(Ft(t),e):function(n){var r=I(n,t);return r===void 0&&r===e?Ma(n,t):En(e,r,ep|tp)}}function rp(t){return function(e){return e?.[t]}}function ip(t){return function(e){return ur(e,t)}}function sp(t){return Ti(t)?rp(Ft(t)):ip(t)}function ki(t){return typeof t=="function"?t:t==null?dr:typeof t=="object"?ye(t)?np(t[0],t[1]):Zh(t):sp(t)}function op(t,e,n){var r=ye(t),i=r||At(t)||Pn(t);if(e=ki(e),n==null){var s=t&&t.constructor;i?n=r?new s:[]:Z(t)?n=Fn(s)?Ea(sr(t)):{}:n={}}return(i?$i:Da)(t,function(o,a,l){return e(n,o,a,l)}),n}function Qr(t,e,n){(n!==void 0&&!Tn(t[e],n)||n===void 0&&!(e in t))&&Ei(t,e,n)}var Ra=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vs=Ra&&typeof module=="object"&&module&&!module.nodeType&&module,ap=Vs&&Vs.exports===Ra,Ws=ap?Ye.Buffer:void 0,zs=Ws?Ws.allocUnsafe:void 0;function Ba(t,e){if(e)return t.slice();var n=t.length,r=zs?zs(n):new t.constructor(n);return t.copy(r),r}function Mi(t){var e=new t.constructor(t.byteLength);return new er(e).set(new er(t)),e}function Ua(t,e){var n=e?Mi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ri(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function La(t){return typeof t.constructor=="function"&&!cr(t)?Ea(sr(t)):{}}function Sn(t){return Te(t)&&Tt(t)}function ei(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Zt(t,e,n,r){var i=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=void 0;l===void 0&&(l=t[a]),i?Ei(n,a,l):Ii(n,a,l)}return n}function lp(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var cp=Object.prototype,up=cp.hasOwnProperty;function dp(t){if(!Z(t))return lp(t);var e=cr(t),n=[];for(var r in t)r=="constructor"&&(e||!up.call(t,r))||n.push(r);return n}function Dn(t){return Tt(t)?Oa(t,!0):dp(t)}function fp(t){return Zt(t,Dn(t))}function mp(t,e,n,r,i,s,o){var a=ei(t,n),l=ei(e,n),f=o.get(l);if(f){Qr(t,n,f);return}var u=s?s(a,l,n+"",t,e,o):void 0,d=u===void 0;if(d){var h=ye(l),g=!h&&At(l),m=!h&&!g&&Pn(l);u=l,h||g||m?ye(a)?u=a:Sn(a)?u=Ri(a):g?(d=!1,u=Ba(l,!0)):m?(d=!1,u=Ua(l,!0)):u=[]:gt(l)||qt(l)?(u=a,qt(a)?u=fp(a):(!Z(a)||Fn(a))&&(u=La(l))):d=!1}d&&(o.set(l,u),i(u,l,r,s,o),o.delete(l)),Qr(t,n,u)}function Va(t,e,n,r,i){t!==e&&Ia(e,function(s,o){if(i||(i=new Ee),Z(s))mp(t,e,o,n,Va,r,i);else{var a=r?r(ei(t,o),s,o+"",t,e,i):void 0;a===void 0&&(a=s),Qr(t,o,a)}},Dn)}function hp(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var qs=Math.max;function Wa(t,e,n){return e=qs(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=qs(r.length-e,0),o=Array(s);++i<s;)o[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=n(o),hp(t,this,a)}}function pp(t){return function(){return t}}var gp=tr?function(t,e){return tr(t,"toString",{configurable:!0,enumerable:!1,value:pp(e),writable:!0})}:dr,yp=800,xp=16,bp=Date.now;function vp(t){var e=0,n=0;return function(){var r=bp(),i=xp-(r-n);if(n=r,i>0){if(++e>=yp)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var za=vp(gp);function fr(t,e){return za(Wa(t,e,dr),t+"")}function Sp(t,e,n){if(!Z(n))return!1;var r=typeof e;return(r=="number"?Tt(n)&&lr(e,n.length):r=="string"&&e in n)?Tn(n[e],t):!1}function wp(t){return fr(function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,o&&Sp(n[0],n[1],o)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var a=n[r];a&&t(e,a,r,s)}return e})}var jp=wp(function(t,e,n){Va(t,e,n)}),Ks=Ne?Ne.isConcatSpreadable:void 0;function Op(t){return ye(t)||qt(t)||!!(Ks&&t&&t[Ks])}function $n(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=Op),i||(i=[]);++s<o;){var a=t[s];e>0&&n(a)?e>1?$n(a,e-1,n,r,i):Ai(i,a):r||(i[i.length]=a)}return i}var Ap=1/0;function Cp(t){var e=t==null?0:t.length;return e?$n(t,Ap):[]}function _p(t,e,n,r){for(var i=t.length,s=n+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function Np(t){return t!==t}function Tp(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function qa(t,e,n){return e===e?Tp(t,e,n):_p(t,Np,n)}function Bi(t,e){var n=t==null?0:t.length;return!!n&&qa(t,e,0)>-1}function Gn(){}var Fp=1/0,Pp=Lt&&1/Oi(new Lt([,-0]))[1]==Fp?function(t){return new Lt(t)}:Gn,Ep=200;function Ka(t,e,n){var r=-1,i=Bi,s=t.length,o=!0,a=[],l=a;if(s>=Ep){var f=Pp(t);if(f)return Oi(f);o=!1,i=vn,l=new Ot}else l=a;e:for(;++r<s;){var u=t[r],d=u;if(u=u!==0?u:0,o&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue e;a.push(u)}else i(l,d,n)||(l!==a&&l.push(d),a.push(u))}return a}function Ga(t){return t&&t.length?Ka(t):[]}var Ip="[object Map]",Dp="[object Set]",$p=Object.prototype,kp=$p.hasOwnProperty;function me(t){if(t==null)return!0;if(Tt(t)&&(ye(t)||typeof t=="string"||typeof t.splice=="function"||At(t)||Pn(t)||qt(t)))return!t.length;var e=Ce(t);if(e==Ip||e==Dp)return!t.size;if(cr(t))return!Aa(t).length;for(var n in t)if(kp.call(t,n))return!1;return!0}const Mp=Object.prototype;function un(t){for(const e in t)if(Mp.hasOwnProperty.call(t,e))return!1;return!0}const Rp=["array","boolean","integer","null","number","object","string"];new Set(Rp);const Bp=["$defs","definitions","properties","patternProperties","dependencies"];new Set(Bp);const Up=["items","allOf","oneOf","anyOf"];new Set(Up);const Lp=["items","additionalItems","additionalProperties","propertyNames","contains","if","then","else","not"];new Set(Lp);function Hn(t){return typeof t=="object"}function Le(t){return Hn(t)?un(t):t===!0}function Bt(t,e){return t<e?-1:t>e?1:0}function Cr(t,e){const n=t.length;if(n===0)return e;let r=e.length;if(r===0)return t;if(n<r){const s=t;t=e,e=s,r=n}const i=new Set(t);for(let s=0;s<r;s++)i.add(e[s]);return Array.from(i)}function Vp(t,e){const n=[];if(t.length===0||e.length===0)return n;if(t.length>e.length){const i=t;t=e,e=i}const r=new Set(e);for(let i=0;i<t.length&&r.size>0;i++){const s=t[i];r.delete(s)&&n.push(s)}return n}function Gs(t){return t.length===0}function _r(t){return(e,n)=>{const r=e.length-n.length;if(r!==0)return r;for(let i=0;i<e.length;i++)if(e[i]!==n[i]){const s=t(e[i],n[i]);if(s!==0)return s}return 0}}function Ha(t,{threshold:e=12}={}){return n=>{const r=n.length;if(r===0)return n;if(r<=e){const o=[];let a=0;e:for(let l=0;l<r;l++){const f=n[l];for(let u=0;u<a;u++)if(t(f,o[u])===0)continue e;a=o.push(f)}return o}const i=n.slice().sort(t);let s=0;for(let o=1;o<r;o++)t(i[s],i[o])!==0&&++s!==o&&(i[s]=i[o]);return i.length=s+1,i}}function Wp(t){return(e,n)=>{const r=[];let i=e.length,s=n.length;if(i===0||s===0)return r;if(i>s){const u=e;e=n,n=u;const d=i;i=s,s=d}const o=[...e].sort(t),a=[...n].sort(t);let l=0,f=0;for(;l<i&&f<s;){const u=t(o[l],a[f]);u===0?((r.length===0||t(r[r.length-1],o[l])!==0)&&r.push(o[l]),l++,f++):u<0?l++:f++}return r}}function zp(t,e){return n=>{if(t.has(n))return t.get(n);const r=e(n);return t.set(n,r),r}}const Hs=zp,Ya=()=>0,qp=t=>t===void 0,Kp=t=>typeof t!="object",Ys={boolean:0,number:1,string:2};function Gp(t,e){const n=typeof t,r=typeof e;return n===r?Bt(t,e):Ys[n]-Ys[r]}function Hp(t,e){const n=t.length;if(n===0)return e;const r=e.length;if(r===0)return t;if(r>n){const o=t;t=e,e=o}const i=new Set(t),s=e.length;for(let o=0;o<s;o++){const a=e[o];i.has(a)||t.push(a)}return t}function mr(t,e,n=Ya){return(r,i)=>t(r)?t(i)?n(r,i):-1:t(i)?1:e(r,i)}function Mt(t){return mr(qp,t)}function ot(t,e){return mr(n=>n===void 0||t(n),e)}function Nr(t,e){return mr(Array.isArray,t,e)}const he=Mt(Bt),Tr=ot(t=>t===0,(t,e)=>t-e);function Yp({deduplicationCache:t=new WeakMap,sortedKeysCache:e=new WeakMap}={}){const n=Hs(e,p=>Object.keys(p).sort());function r(p){return(y,x)=>{const S=n(y),j=n(x),b=Math.min(S.length,j.length);for(let v=0;v<b;v++){const w=Bt(S[v],j[v]);if(w!==0)return w}if(S.length!==j.length)return S.length-j.length;for(let v=0;v<b;v++){const w=S[v],O=p(y[w],x[w]);if(O!==0)return O}return 0}}function i(p){const y=_r(p),x=Hs(t,Ha(p,{threshold:0}));return(S,j)=>y(x(S),x(j))}const s=i(Bt);function o(p,y){if(Hn(p)){if(Hn(y)){const x=Object.keys(p),S=Object.keys(y),j=Hp(x,S),b=j.length;for(let v=0;v<b;v++){const w=j[v];if(p[w]===y[w])continue;const A=(m[w]??a)(p[w],y[w]);if(A!==0)return A}return 0}return y===!0&&un(p)?0:1}return Hn(y)?p===!0&&un(y)?0:-1:Bt(p,y)}const a=Mt(f),l=mr(Kp,Nr(r(a),_r(f)),Gp);function f(p,y){return p===null?-1:y===null?1:l(p,y)}const u=Mt(o),d=ot(un,r(u)),h=Mt(i(o)),g=ot(Le,o),m={$id:he,$comment:he,$defs:d,$ref:he,$schema:he,const:a,contains:u,contentEncoding:he,contentMediaType:he,default:a,definitions:d,description:he,else:u,examples:a,exclusiveMaximum:he,exclusiveMinimum:he,format:he,if:u,maximum:he,maxItems:he,maxLength:he,maxProperties:he,minimum:he,multipleOf:he,not:u,pattern:he,propertyNames:u,readOnly:he,then:u,title:he,writeOnly:he,uniqueItems:ot(p=>p===!1,Ya),minLength:Tr,minItems:Tr,minProperties:Tr,required:ot(Gs,s),enum:ot(Gs,i(f)),type:Mt((p,y)=>{const x=Array.isArray(p),S=Array.isArray(y);return!x&&!S?Bt(p,y):s(x?p:[p],S?y:[y])}),items:ot(p=>!Array.isArray(p)&&Le(p),Nr(o,_r(o))),anyOf:h,allOf:h,oneOf:h,properties:d,patternProperties:d,additionalProperties:g,additionalItems:g,dependencies:ot(un,r(Mt(Nr(o,s))))};return{compareSchemaValues:f,compareSchemaDefinitions:o}}function Xs(t){return t}const Xa=(t,e)=>t?Xa(e%t,t):e,Xp=(t,e)=>Math.abs(t*e)/Xa(t,e);function Jp(t,e){return t===e?t:`^(?=.*(?:${t}))(?=.*(?:${e})).*$`}function*Fr(t,e,n){const r=t.length,i=e.length;if(r>0&&i>0)for(let s=0;s<r;s++){const o=t[s];for(let a=0;a<i;a++)yield n(o,e[a])}}function Pr(t,e){return t||e}function Js(t){return(e,n)=>{const r={...e},i=Object.keys(n),s=i.length;for(let o=0;o<s;o++){const a=i[o];r[a]=e[a]===void 0?n[a]:t(e[a],n[a])}return r}}function Zp(t){const e=new Map;for(const n of t)for(const r of n[0])e.set(r,n[1]);return e}function bt(t,e,n){n===void 0||Le(n)?delete t[e]:t[e]=n}const Qp=["properties","patternProperties","additionalProperties"];function Zs(t){const e=Object.keys(t),n=e.length,r=[];for(let i=0;i<n;i++){const s=e[i];r.push({regExp:new RegExp(s),schema:t[s]})}return[r,e]}const Qs=[[],[]];function eo(t,e,n){const r=n.length;for(let i=0;i<r;i++){const s=n[i];if(!s.regExp.test(e))continue;const o=s.schema;if(o===!1)return!0;t.push(o)}return!1}const eg=["items","additionalItems"],tg=["if","then","else"];function to(t,e){return e.if!==void 0&&(t.if=e.if),e.then!==void 0&&(t.then=e.then),e.else!==void 0&&(t.else=e.else),t}function Er(t,e){if(t===e)return t;switch(t){case"number":if(e==="integer")return"integer";case"integer":if(e==="number")return"integer";default:return}}function vt(t,e,n){return[t,e,n]}function ng(t){const e=new Map;for(const[n,r,i]of t){const s=o=>{if(!i(o))throw new Error(`Schema keys '${n}' and '${r}' are conflicting (${n}: ${JSON.stringify(o[n])}, ${r}: ${JSON.stringify(o[r])})`)};for(const o of[[n,r],[r,n]]){let a=e.get(o[0]);a===void 0&&(a=[],e.set(o[0],a)),a.push({oppositeKey:o[1],check:s})}}return e}const rg=[vt("minimum","maximum",t=>t.maximum>=t.minimum),vt("exclusiveMinimum","maximum",t=>t.maximum>t.exclusiveMinimum),vt("minimum","exclusiveMaximum",t=>t.exclusiveMaximum>t.minimum),vt("exclusiveMinimum","exclusiveMaximum",t=>t.exclusiveMaximum>t.exclusiveMinimum),vt("minLength","maxLength",t=>t.maxLength>=t.minLength),vt("minItems","maxItems",t=>t.maxItems>=t.minItems),vt("minProperties","maxProperties",t=>t.maxProperties>=t.minProperties)];function ig({mergePatterns:t=Jp,isSubRegExp:e=Object.is,intersectJson:n=Vp,deduplicateJsonSchemaDef:r=Xs,defaultMerger:i=Xs,assigners:s=[],checks:o=rg,mergers:a}={}){function l(b){const v=b.length;let w=b[0];for(let O=1;O<v;O++){const A=x(w,b[O]);if(A===!1)return!1;Le(A)||(w=A)}return w}function f(b,v,w,O,A,C,T){if(b.length=0,w===!1)return!1;if(b.push(w),A!==void 0){if(A===!1)return!1;b.push(A)}if(eo(b,v,C))return!1;const _=b.length<2;if(T===!1){if(_)return;if(eo(b,v,O))return!1}else _&&T!==void 0&&b.push(T);return b.length===1?b[0]:l(b)}function u(b,v,w,O,A,C){const T=w.length;if(T>0&&A!==!1)if(C)Object.assign(b,v);else for(let N=0;N<T;N++){const _=w[N];O.has(_)||(b[_]=x(v[_],A))}return b}const d=(b,{properties:v={},patternProperties:w,additionalProperties:O=!0},{properties:A={},patternProperties:C,additionalProperties:T=!0})=>{const N=Le(O),_=Le(T);if(N&&_)return bt(b,"properties",S(v,A)),bt(b,"patternProperties",w&&C?S(w,C):w??C),delete b.additionalProperties,b;const F=x(O,T);bt(b,"additionalProperties",F);const $={},E=Object.keys(v),D=E.length,[M,k]=w?Zs(w):Qs,[B,W]=C?Zs(C):Qs,R=[],V=new Set,Q=_?void 0:T;for(let H=0;H<D;H++){const re=E[H];V.add(re);const fe=f(R,re,v[re],M,A[re],B,Q);fe!==void 0&&($[re]=fe)}const ne=Object.keys(A),ie=ne.length,de=N?void 0:O;for(let H=0;H<ie;H++){const re=ne[H];if(V.has(re))continue;const fe=f(R,re,A[re],B,void 0,M,de);fe!==void 0&&($[re]=fe)}bt(b,"properties",$);let ee={};const z=new Set;if(k.length>0&&W.length>0){const H=Fr(k,W,(re,fe)=>{e(re,fe)&&z.add(re),e(fe,re)&&z.add(fe),ee[t(re,fe)]=x(w[re],C[fe])});for(;!H.next().done;);}return ee=u(ee,w,k,z,T,_),ee=u(ee,C,W,z,O,N),bt(b,"patternProperties",ee),b},h=(b,{items:v=[],additionalItems:w},{items:O=[],additionalItems:A})=>{const C=Array.isArray(v),T=Array.isArray(O),N=[];if(b.items=N,C&&T){const[_,F,$]=v.length<O.length?[v.length,w,O]:[O.length,A,v];let E=0;for(;E<_;E++)N.push(x(v[E],O[E]));if(F===!1)b.additionalItems=!1;else{const D=F===void 0||Le(F);for(;E<$.length;E++)N.push(D?$[E]:x($[E],F));bt(b,"additionalItems",w!==void 0&&A!==void 0?x(w,A):w??A)}}else if(C||T){const[_,F,$]=C?[v,O,w]:[O,v,A];bt(b,"additionalItems",$&&x($,F));for(let E=0;E<_.length;E++)N.push(x(_[E],F))}else delete b.additionalItems,b.items=x(v,O);return b},g=(b,v,w)=>{to(b,v);const O=to({},w);return b.allOf===void 0?b.allOf=[O]:b.allOf=b.allOf.concat(O),b};function m(b,v){return r(Array.from(Fr(b,v,x)))}const p=Zp([[Qp,d],[eg,h],[tg,g],...s]),y=ng(o);function x(b,v){if(b===!1||v===!1)return!1;if(Le(b))return Le(v)?!0:v;if(Le(v))return b;let w={...b};const O=new Set,A=new Set,C=Object.keys(v),T=C.length;for(let N=0;N<T;N++){const _=C[N],F=v[_];if(F===void 0)continue;const $=y.get(_);if($!==void 0){const k=$.length;for(let B=0;B<k;B++){const W=$[B];b[W.oppositeKey]!==void 0&&A.add(W.check)}}const E=b[_];if(E===void 0){w[_]=F;continue}const D=p.get(_);if(D){O.add(D);continue}const M=j[_]??i;w[_]=M(E,F)}for(const N of O)w=N(w,b,v);for(const N of A)N(w);return w}const S=Js(x),j={$id:i,$ref:i,$schema:i,$comment:i,$defs:S,definitions:S,type:(b,v)=>{if(b===v)return b;const w=Array.isArray(b),O=Array.isArray(v);if(!w&&!O){const A=Er(b,v);if(A!==void 0)return A}else if(w||O){const A=new Set;if(w&&O)for(const T of Fr(b,v,Er))T!==void 0&&A.add(T);else{const T=w?b:v,N=w?v:b,_=T.length;for(let F=0;F<_;F++){const $=Er(N,T[F]);$!==void 0&&A.add($)}}const C=A.size;if(C===1)return A.values().next().value;if(C>1)return Array.from(A)}throw new Error(`It is not possible to create an intersection of the following incompatible types: ${b.toString()}, ${v.toString()}`)},default:i,description:i,title:i,const:i,format:i,contentEncoding:i,contentMediaType:i,not:(b,v)=>{const w=r([b,v]);return w.length===1?w[0]:{anyOf:w}},pattern:t,readOnly:Pr,writeOnly:Pr,enum:(b,v)=>{const w=n(b,v);if(w.length===0)throw new Error(`Intersection of the following enums is empty: "${JSON.stringify(b)}", "${JSON.stringify(v)}"`);return w},anyOf:m,oneOf:m,allOf:(b,v)=>r(b.concat(v)),propertyNames:x,contains:x,dependencies:Js((b,v)=>Array.isArray(b)?Array.isArray(v)?Cr(b,v):x(v,{required:b}):Array.isArray(v)?x(b,{required:v}):x(b,v)),examples:(b,v)=>{if(!Array.isArray(b)||!Array.isArray(v))throw new Error(`Value of the 'examples' field should be an array, but got "${JSON.stringify(b)}" and "${JSON.stringify(v)}"`);return Cr(b,v)},multipleOf:(b,v)=>{let w=1;for(;!Number.isInteger(b)||!Number.isInteger(v);)w*=10,b*=10,v*=10;return Xp(b,v)/w},exclusiveMaximum:Math.min,maximum:Math.min,maxItems:Math.min,maxLength:Math.min,maxProperties:Math.min,exclusiveMinimum:Math.max,minimum:Math.max,minItems:Math.max,minLength:Math.max,minProperties:Math.max,uniqueItems:Pr,required:Cr,...a};return{mergeSchemaDefinitions:x,mergeArrayOfSchemaDefinitions:l}}function sg(t){const e=[],n=[t];for(;n.length>0;){const r=n.pop();if(typeof r=="boolean"||r.allOf===void 0){e.push(r);continue}const{allOf:i,...s}=r;e.push(s);for(let o=i.length-1;o>=0;o--)n.push(i[o])}return e}function og(t){return e=>t(sg(e))}var an={},no;function ag(){if(no)return an;no=1;var t=/~/,e=/~[01]/g;function n(f){switch(f){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+f)}function r(f){return t.test(f)?f.replace(e,n):f}function i(f,u,d){for(var h,g,m=1,p=u.length;m<p;){if(u[m]==="constructor"||u[m]==="prototype"||u[m]==="__proto__")return f;if(h=r(u[m++]),g=p>m,typeof f[h]>"u"&&(Array.isArray(f)&&h==="-"&&(h=f.length),g&&(u[m]!==""&&u[m]<1/0||u[m]==="-"?f[h]=[]:f[h]={})),!g)break;f=f[h]}var y=f[h];return d===void 0?delete f[h]:f[h]=d,y}function s(f){if(typeof f=="string"){if(f=f.split("/"),f[0]==="")return f;throw new Error("Invalid JSON pointer.")}else if(Array.isArray(f)){for(const u of f)if(typeof u!="string"&&typeof u!="number")throw new Error("Invalid JSON pointer. Must be of type string or number.");return f}throw new Error("Invalid JSON pointer.")}function o(f,u){if(typeof f!="object")throw new Error("Invalid input object.");u=s(u);var d=u.length;if(d===1)return f;for(var h=1;h<d;){if(f=f[r(u[h++])],d===h)return f;if(typeof f!="object"||f===null)return}}function a(f,u,d){if(typeof f!="object")throw new Error("Invalid input object.");if(u=s(u),u.length===0)throw new Error("Invalid JSON pointer for set.");return i(f,u,d)}function l(f){var u=s(f);return{get:function(d){return o(d,u)},set:function(d,h){return a(d,u,h)}}}return an.get=o,an.set=a,an.compile=l,an}var lg=ag();const Ir=fi(lg);function cg(t,e){return t&&Zt(e,Pe(e),t)}function ug(t,e){return t&&Zt(e,Dn(e),t)}function dg(t,e){return Zt(t,Ci(t),e)}var fg=Object.getOwnPropertySymbols,Ja=fg?function(t){for(var e=[];t;)Ai(e,Ci(t)),t=sr(t);return e}:ba;function mg(t,e){return Zt(t,Ja(t),e)}function Ui(t){return xa(t,Dn,Ja)}var hg=Object.prototype,pg=hg.hasOwnProperty;function gg(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&pg.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function yg(t,e){var n=e?Mi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var xg=/\w*$/;function bg(t){var e=new t.constructor(t.source,xg.exec(t));return e.lastIndex=t.lastIndex,e}var ro=Ne?Ne.prototype:void 0,io=ro?ro.valueOf:void 0;function vg(t){return io?Object(io.call(t)):{}}var Sg="[object Boolean]",wg="[object Date]",jg="[object Map]",Og="[object Number]",Ag="[object RegExp]",Cg="[object Set]",_g="[object String]",Ng="[object Symbol]",Tg="[object ArrayBuffer]",Fg="[object DataView]",Pg="[object Float32Array]",Eg="[object Float64Array]",Ig="[object Int8Array]",Dg="[object Int16Array]",$g="[object Int32Array]",kg="[object Uint8Array]",Mg="[object Uint8ClampedArray]",Rg="[object Uint16Array]",Bg="[object Uint32Array]";function Ug(t,e,n){var r=t.constructor;switch(e){case Tg:return Mi(t);case Sg:case wg:return new r(+t);case Fg:return yg(t,n);case Pg:case Eg:case Ig:case Dg:case $g:case kg:case Mg:case Rg:case Bg:return Ua(t,n);case jg:return new r;case Og:case _g:return new r(t);case Ag:return bg(t);case Cg:return new r;case Ng:return vg(t)}}var Lg="[object Map]";function Vg(t){return Te(t)&&Ce(t)==Lg}var so=Kt&&Kt.isMap,Wg=so?Ni(so):Vg,zg="[object Set]";function qg(t){return Te(t)&&Ce(t)==zg}var oo=Kt&&Kt.isSet,Kg=oo?Ni(oo):qg,Gg=1,Hg=2,Yg=4,Za="[object Arguments]",Xg="[object Array]",Jg="[object Boolean]",Zg="[object Date]",Qg="[object Error]",Qa="[object Function]",ey="[object GeneratorFunction]",ty="[object Map]",ny="[object Number]",el="[object Object]",ry="[object RegExp]",iy="[object Set]",sy="[object String]",oy="[object Symbol]",ay="[object WeakMap]",ly="[object ArrayBuffer]",cy="[object DataView]",uy="[object Float32Array]",dy="[object Float64Array]",fy="[object Int8Array]",my="[object Int16Array]",hy="[object Int32Array]",py="[object Uint8Array]",gy="[object Uint8ClampedArray]",yy="[object Uint16Array]",xy="[object Uint32Array]",ae={};ae[Za]=ae[Xg]=ae[ly]=ae[cy]=ae[Jg]=ae[Zg]=ae[uy]=ae[dy]=ae[fy]=ae[my]=ae[hy]=ae[ty]=ae[ny]=ae[el]=ae[ry]=ae[iy]=ae[sy]=ae[oy]=ae[py]=ae[gy]=ae[yy]=ae[xy]=!0;ae[Qg]=ae[Qa]=ae[ay]=!1;function mn(t,e,n,r,i,s){var o,a=e&Gg,l=e&Hg,f=e&Yg;if(n&&(o=i?n(t,r,i,s):n(t)),o!==void 0)return o;if(!Z(t))return t;var u=ye(t);if(u){if(o=gg(t),!a)return Ri(t,o)}else{var d=Ce(t),h=d==Qa||d==ey;if(At(t))return Ba(t,a);if(d==el||d==Za||h&&!i){if(o=l||h?{}:La(t),!a)return l?mg(t,ug(o,t)):dg(t,cg(o,t))}else{if(!ae[d])return i?t:{};o=Ug(t,d,a)}}s||(s=new Ee);var g=s.get(t);if(g)return g;s.set(t,o),Kg(t)?t.forEach(function(y){o.add(mn(y,e,n,y,t,s))}):Wg(t)&&t.forEach(function(y,x){o.set(x,mn(y,e,n,x,t,s))});var m=f?l?Ui:Yr:l?Dn:Pe,p=u?void 0:m(t);return $i(p||t,function(y,x){p&&(x=y,y=t[x]),Ii(o,x,mn(y,e,n,x,t,s))}),o}function tl(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function by(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}function vy(t,e){return e.length<2?t:ur(t,by(e,0,-1))}var Sy=Object.prototype,wy=Sy.hasOwnProperty;function nl(t,e){e=Jt(e,t);var n=-1,r=e.length;if(!r)return!0;for(var i=t==null||typeof t!="object"&&typeof t!="function";++n<r;){var s=e[n];if(typeof s=="string"){if(s==="__proto__"&&!wy.call(t,"__proto__"))return!1;if(s==="constructor"&&n+1<r&&typeof e[n+1]=="string"&&e[n+1]==="prototype"){if(i&&n===0)continue;return!1}}}var o=vy(t,e);return o==null||delete o[Ft(tl(e))]}function jy(t){return gt(t)?void 0:t}function ti(t){var e=t==null?0:t.length;return e?$n(t,1):[]}function rl(t){return za(Wa(t,void 0,ti),t+"")}var Oy=1,Ay=2,Cy=4,wn=rl(function(t,e){var n={};if(t==null)return n;var r=!1;e=Xt(e,function(s){return s=Jt(s,t),r||(r=s.length>1),s}),Zt(t,Ui(t),n),r&&(n=mn(n,Oy|Ay|Cy,jy));for(var i=e.length;i--;)nl(n,e[i]);return n}),_y=Dc();const Li=fi(_y);function nr(t,e){if(oe in t&&Li.equal(t[oe],e))return t;for(const n of Object.values(t))if(Array.isArray(n)){for(const r of n)if(Z(r)){const i=nr(r,e);if(i!==void 0)return i}}else if(Z(n)){const r=nr(n,e);if(r!==void 0)return r}}function ni(t,e){const n=I(t,oe,e);ce in t&&(t={...t,[ce]:Li.resolve(n,t[ce])});for(const[r,i]of Object.entries(t))Array.isArray(i)?t={...t,[r]:i.map(s=>Z(s)?ni(s,n):s)}:Z(i)&&(t={...t,[r]:ni(i,n)});return t}function Vi(t,e){const n=e[t];return[wn(e,[t]),n]}function il(t,e={},n=[],r=I(e,[oe])){const i=t||"";let s;if(i.startsWith("#")){const a=decodeURIComponent(i.substring(1));r===void 0||oe in e&&e[oe]===r?s=Ir.get(e,a):e[cn]===Kn&&(s=nr(e,r.replace(/\/$/,"")),s!==void 0&&(s=Ir.get(s,a)))}else if(e[cn]===Kn){const a=r?Li.resolve(r,i):i,[l,...f]=a.replace(/#\/?$/,"").split("#");s=nr(e,l.replace(/\/$/,"")),s!==void 0&&(r=s[oe],me(f)||(s=Ir.get(s,decodeURIComponent(f.join("#")))))}if(s===void 0)throw new Error(`Could not find a definition for ${t}.`);const o=s[ce];if(o){if(n.includes(o)){if(n.length===1)throw new Error(`Definition for ${t} is a circular reference`);const[u,...d]=n,h=[...d,i,u].join(" -> ");throw new Error(`Definition for ${u} contains a circular reference through ${h}`)}const[a,l]=Vi(ce,s),f=il(l,e,[...n,i],r);return Object.keys(a).length>0?e[cn]===Vd||e[cn]===Kn?{[pt]:[a,f]}:{...a,...f}:f}return s}function sl(t,e={},n=I(e,[oe])){return il(t,e,[],n)}var Ny="[object String]";function yt(t){return typeof t=="string"||!ye(t)&&Te(t)&&tt(t)==Ny}function Ge(t){let e;const n=I(t,Bd);return yt(n)?e=n:n!==void 0&&console.warn(`Expecting discriminator to be a string, got "${typeof n}" instead`),e}function jn(t){return Array.isArray(t)?"array":typeof t=="string"?"string":t==null?"null":typeof t=="boolean"?"boolean":isNaN(t)?typeof t=="object"?"object":"string":"number"}var Ty=fr(function(t){return Ka($n(t,1,Sn,!0))});function Ie(t){let{type:e}=t;return!e&&t.const?jn(t.const):!e&&t.enum?"string":!e&&(t.properties||t.additionalProperties||t.patternProperties)?"object":(Array.isArray(e)&&(e.length===2&&e.includes("null")?e=e.find(n=>n!=="null"):e=e[0]),e)}function et(t,e){const n=Object.assign({},t);return Object.keys(e).reduce((r,i)=>{const s=t?t[i]:{},o=e[i];return t&&i in t&&Y(o)?r[i]=et(s,o):t&&e&&(Ie(t)==="object"||Ie(e)==="object")&&i===la&&Array.isArray(s)&&Array.isArray(o)?r[i]=Ty(s,o):r[i]=o,r},n)}var Fy="[object Number]";function ol(t){return typeof t=="number"||Te(t)&&tt(t)==Fy}function al(t,e,n){var r;if(t&&n){const i=I(t,n);if(i===void 0)return;for(let s=0;s<e.length;s++){const o=e[s],a=I(o,[te,n],{});if(!(a.type==="object"||a.type==="array")&&(a.const===i||!((r=a.enum)===null||r===void 0)&&r.includes(i)))return s}}}function Wi(t,e,n,r,i){if(e===void 0)return 0;const s=al(e,n,i);if(ol(s))return s;for(let o=0;o<n.length;o++){const a=n[o];if(i&&X(a,[te,i])){const l=I(e,i),f=I(a,[te,i],{});if(t.isValid(f,l,r))return o}else if(a[te]){const l={anyOf:Object.keys(a[te]).map(u=>({required:[u]}))};let f;if(a.anyOf){const{...u}=a;u.allOf?u.allOf=u.allOf.slice():u.allOf=[],u.allOf.push(l),f=u}else f=Object.assign({},a,l);if(delete f.required,t.isValid(f,e,r))return o}else if(t.isValid(a,e,r))return o}return 0}function be(t,e,n={},r,i,s=!1){return We(t,e,n,r,void 0,void 0,i,s)[0]}function Py(t,e,n,r,i,s,o){const{if:a,then:l,else:f,...u}=e,d=t.isValid(a,s||{},n);let h=[u],g=[];if(r)l&&typeof l!="boolean"&&(g=g.concat(We(t,l,n,s,r,i,o))),f&&typeof f!="boolean"&&(g=g.concat(We(t,f,n,s,r,i,o)));else{const m=d?l:f;m&&typeof m!="boolean"&&(g=g.concat(We(t,m,n,s,r,i,o)))}return g.length&&(h=g.map(m=>et(u,m))),h.flatMap(m=>We(t,m,n,s,r,i,o))}function ll(t){return t.reduce((n,r)=>r.length>1?r.flatMap(i=>Pa(n.length,s=>[...n[s]].concat(i))):(n.forEach(i=>i.push(r[0])),n),[[]])}function cl(t,e){return Object.keys(t.patternProperties).filter(n=>RegExp(n).test(e)).reduce((n,r)=>(se(n,[r],t.patternProperties[r]),n),{})}function Ey(t,e,n,r,i,s,o,a){const l=ul(t,e,n,r,i,s,o,a);if(l.length>1||l[0]!==e)return l;if(vi in e)return dl(t,e,n,r,i,s,o).flatMap(u=>We(t,u,n,s,r,i,o));if(pt in e&&Array.isArray(e[pt])){const f=e.allOf.map(d=>We(t,d,n,s,r,i,o));return ll(f).map(d=>({...e,allOf:d}))}return[e]}function ul(t,e,n,r,i,s,o,a){const l=Vt(e,n,i,void 0,a);return l!==e?We(t,l,n,s,r,i,o,a):[e]}function Vt(t,e,n,r,i){if(!Y(t))return t;let s=t;if(ce in s){const{$ref:o,...a}=s;if(n.includes(o))return s;n.push(o),s={...sl(o,e,r),...a},oe in s&&(r=s[oe])}if(te in s){const o=[],a=op(s[te],(l,f,u)=>{const d=[...n];l[u]=Vt(f,e,d,r,i),o.push(d)},{});jp(n,Ga(Cp(o))),s={...s,[te]:a}}if(zt in s&&!Array.isArray(s.items)&&typeof s.items!="boolean"&&(s={...s,items:Vt(s.items,e,n,r,i)}),i){let o,a;J in t&&Array.isArray(t[J])?(o=J,a=s[J]):q in t&&Array.isArray(t[q])&&(o=q,a=s[q]),o&&a&&(s={...s,[o]:a.map(l=>Vt(l,e,n,r,i))})}return le(t,s)?t:s}function Iy(t,e,n,r,i){const s={...e,properties:{...e.properties}},o=r&&Y(r)?r:{};return Object.keys(o).forEach(a=>{if(!(a in s.properties)){if(Kr in s){const l=cl(s,a);if(!me(l)){s.properties[a]=be(t,{[pt]:Object.values(l)},n,I(o,[a]),i),se(s.properties,[a,Qe],!0);return}}if(Zn in s&&s.additionalProperties!==!1){let l;typeof s.additionalProperties!="boolean"?ce in s.additionalProperties?l=be(t,{[ce]:I(s.additionalProperties,[ce])},n,o,i):"type"in s.additionalProperties?l={...s.additionalProperties}:J in s.additionalProperties||q in s.additionalProperties?l={type:"object",...s.additionalProperties}:l={type:jn(I(o,[a]))}:l={type:jn(I(o,[a]))},s.properties[a]=l,se(s.properties,[a,Qe],!0)}else s.properties[a]={type:"null"},se(s.properties,[a,Qe],!0)}}),s}const{compareSchemaDefinitions:Dy,compareSchemaValues:$y}=Yp(),{mergeArrayOfSchemaDefinitions:ky}=ig({intersectJson:Wp($y),deduplicateJsonSchemaDef:Ha(Dy)}),My=og(ky);function Ry(t){return My(t)}function We(t,e,n,r,i=!1,s=[],o,a){return Y(e)?Ey(t,e,n,i,s,r,o,a).flatMap(f=>{var u;let d=f;if(Si in d)return Py(t,d,n,i,s,r,o);if(pt in d){if(i){const{allOf:g,...m}=d;return[...g,m]}try{const g=[],m=[];(u=d.allOf)===null||u===void 0||u.forEach(p=>{typeof p=="object"&&p.contains?g.push(p):m.push(p)}),g.length&&(d={...d,allOf:m}),d=o?o(d):Ry(d),g.length&&(d.allOf=g)}catch(g){console.warn(`could not merge subschemas in allOf:
|
|
2
2
|
`,g);const{allOf:m,...p}=d;return p}}return te in d&&Kr in d&&(d=Object.keys(d.properties).reduce((g,m)=>{const p=cl(g,m);return me(p)||(g.properties[m]=be(t,{allOf:[g.properties[m],...Object.values(p)]},n,I(r,[m]),o)),g},{...d,properties:{...d.properties}})),Kr in d||Zn in d&&d.additionalProperties!==!1?Iy(t,d,n,r,o):d}):[{}]}function By(t,e,n,r,i){let s;const{oneOf:o,anyOf:a,...l}=e;if(Array.isArray(o)?s=o:Array.isArray(a)&&(s=a),s){const f=i===void 0&&r?{}:i,u=Ge(e);s=s.map(h=>Vt(h,n,[]));const d=Wi(t,f,s,n,u);if(r)return s.map(h=>et(l,h));e=et(l,s[d])}return[e]}function dl(t,e,n,r,i,s,o){const{dependencies:a,...l}=e;return By(t,l,n,r,s).flatMap(u=>fl(t,a,u,n,r,i,s,o))}function fl(t,e,n,r,i,s,o,a){let l=[n];for(const f in e){if(!i&&I(o,[f])===void 0||n.properties&&!(f in n.properties))continue;const[u,d]=Vi(f,e);return Array.isArray(d)?l[0]=Uy(n,d):Y(d)&&(l=Ly(t,n,r,f,d,i,s,o,a)),l.flatMap(h=>fl(t,u,h,r,i,s,o,a))}return l}function Uy(t,e){if(!e)return t;const n=Array.isArray(t.required)?Array.from(new Set([...t.required,...e])):e;return{...t,required:n}}function Ly(t,e,n,r,i,s,o,a,l){return We(t,i,n,a,s,o,l).flatMap(u=>{const{oneOf:d,...h}=u;if(e=et(e,h),d===void 0)return e;const g=d.map(p=>typeof p=="boolean"||!(ce in p)?[p]:ul(t,p,n,s,o,a));return ll(g).flatMap(p=>Vy(t,e,n,r,p,s,o,a,l))})}function Vy(t,e,n,r,i,s,o,a,l){const f=i.filter(u=>{if(typeof u=="boolean"||!u||!u.properties)return!1;const{[r]:d}=u.properties;if(d){const h={type:"object",properties:{[r]:d}};return t.isValid(h,a,n)||s}return!1});return!s&&f.length!==1?(console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),[e]):f.flatMap(u=>{const d=u,[h]=Vi(r,d.properties),g={...d,properties:h};return We(t,g,n,a,s,o,l).map(p=>et(e,p))})}function dn(t,e,n,r,i,s={},o){if(Array.isArray(n[i])){const l=Ge(n)||r,f=n[i].map(d=>be(t,d,e,s,o)),u=I(s,l);if(u!==void 0)return f.find(d=>dt(I(d,[te,l,ir],I(d,[te,l,_e])),u))}}function ml(t,e,n,r,i){let s=n;if(X(n,ce)&&(s=be(t,n,e,void 0,i)),me(r))return s;const o=Array.isArray(r)?r:r.split("."),[a,...l]=o;if(a&&X(s,a))return s=I(s,a),ml(t,e,s,l,i)}function Yn(t,e,n,r,i,s){const o=ml(t,e,n,r,s);return o===void 0?i:o}const ao={title:"!@#$_UNKNOWN_$#@!"};function Wy(t,e,n,r,i={},s){const o=Array.isArray(r)?[...r]:r.split(".");let a=n;const l=o.pop();o.length&&o.forEach(h=>{a=Yn(t,e,a,[te,h],{},s),X(a,q)?a=dn(t,e,a,l,q,I(i,h),s):X(a,J)&&(a=dn(t,e,a,l,J,I(i,h),s))}),X(a,q)?a=dn(t,e,a,l,q,i,s):X(a,J)&&(a=dn(t,e,a,l,J,i,s));let f=Yn(t,e,a,[te,l],ao,s);f===ao&&(f=void 0);const u=Yn(t,e,a,la,[],s);let d;return f&&Array.isArray(u)&&(d=u.includes(l)),{field:f,isRequired:d}}function zy(t,e,n,r){var i=-1,s=t==null?0:t.length;for(r&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}function qy(t,e){return function(n,r){if(n==null)return n;if(!Tt(n))return t(n,r);for(var i=n.length,s=-1,o=Object(n);++s<i&&r(o[s],s,o)!==!1;);return n}}var hl=qy(Da);function Ky(t,e,n,r,i){return i(t,function(s,o,a){n=r?(r=!1,s):e(n,s,o,a)}),n}function Gy(t,e,n){var r=ye(t)?zy:Ky,i=arguments.length<3;return r(t,ki(e),n,i,hl)}const Hy={type:"object",$id:Rd,properties:{__not_really_there__:{type:"number"}}};function ri(t,e,n,r,i){let s=0;return n&&(Z(n.properties)?s+=Gy(n.properties,(o,a,l)=>{const f=I(r,l);if(typeof a=="boolean")return o;if(X(a,ce)){const u=be(t,a,e,f,i);return o+ri(t,e,u,f||{},i)}if((X(a,q)||X(a,J))&&f){const u=X(a,q)?q:J,d=Ge(a);return o+On(t,e,f,I(a,u),-1,d,i)}if(a.type==="object")return Z(f)&&(o+=1),o+ri(t,e,a,f,i);if(a.type===jn(f)){let u=o+1;return a.default?u+=f===a.default?1:-1:a.const&&(u+=f===a.const?1:-1),u}return o},0):yt(n.type)&&n.type===jn(r)&&(s+=1)),s}function On(t,e,n,r,i=-1,s,o){const a=r.map(h=>Vt(h,e,[])),l=al(n,r,s);if(ol(l))return l;const f=a.reduce((h,g,m)=>(Wi(t,n,[Hy,g],e,s)===1&&h.push(m),h),[]);if(f.length===1)return f[0];f.length||Pa(a.length,h=>f.push(h));const u=new Set,{bestIndex:d}=f.reduce((h,g)=>{const{bestScore:m}=h,p=a[g],y=ri(t,e,p,n,o);return u.add(y),y>m?{bestIndex:g,bestScore:y}:h},{bestIndex:i,bestScore:0});return u.size===1&&i>=0?i:d}function zi(t){return Array.isArray(t.items)&&t.items.length>0&&t.items.every(e=>Y(e))}function rr(t){return t==null}function An(t,e,n=!1,r=!1,i=!1){if(Array.isArray(e)){const s=Array.isArray(t)?t:[],o=i?s:e,a=i?e:s,l=o.map((f,u)=>a[u]!==void 0?An(s[u],e[u],n,r,i):f);return(n||i)&&l.length<a.length&&l.push(...a.slice(l.length)),l}if(Y(e)){const s=Object.assign({},t);return Object.keys(e).reduce((o,a)=>{var l;const f=I(e,a),u=Y(t)&&a in t,d=a in e,h=(l=I(t,a))!==null&&l!==void 0?l:{},g=u&&Object.entries(h).some(([,y])=>Y(y)),m=u&&Y(I(t,a)),p=d&&Y(f);return m&&p&&!g?(o[a]={...I(t,a),...f},o):(o[a]=An(I(t,a),f,n,r,i&&(u||!d)),o)},s)}return r&&(t!==void 0&&rr(e)||typeof e=="number"&&isNaN(e))||i&&!rr(e)?t:e}function Cn(t,e,n=!1){return Object.keys(e).reduce((r,i)=>{const s=t?t[i]:{},o=e[i];if(t&&i in t&&Y(o))r[i]=Cn(s,o,n);else if(n&&Array.isArray(s)&&Array.isArray(o)){let a=o;n==="preventDuplicates"&&(a=o.reduce((l,f)=>(s.includes(f)||l.push(f),l),[])),r[i]=s.concat(a)}else r[i]=o;return r},Object.assign({},t))}function pl(t){return Array.isArray(t.enum)&&t.enum.length===1||_e in t}function qi(t,e,n={},r){const i=be(t,e,n,void 0,r),s=i.oneOf||i.anyOf;return Array.isArray(i.enum)?!0:Array.isArray(s)?s.every(o=>typeof o!="boolean"&&pl(o)):!1}function Ki(t,e,n,r){return!e.uniqueItems||!e.items||typeof e.items=="boolean"?!1:qi(t,e.items,n,r)}function gl(t){const e=t[_e],n=Ie(t);return Y(e)&&yt(e?.$data)&&n!=="object"&&n!=="array"}function Yy(t){if(Md in t&&Array.isArray(t.enum)&&t.enum.length===1)return t.enum[0];if(_e in t)return t.const;throw new Error("schema cannot be inferred as a constant")}function Gt(t,e){if(t.enum){let s;if(e){const{enumNames:o}=U(e);s=o}return t.enum.map((o,a)=>({label:s?.[a]||String(o),value:o}))}let n,r;t.anyOf?(n=t.anyOf,r=e?.anyOf):t.oneOf&&(n=t.oneOf,r=e?.oneOf);let i=Ge(t);if(e){const{optionsSchemaSelector:s=i}=U(e);i=s}return n&&n.map((s,o)=>{const{title:a}=U(r?.[o]),l=s;let f,u=a;if(i){const d=I(l,[te,i],{});f=I(d,ir,I(d,_e)),u=u||d?.title||l.title||String(f)}else f=Yy(l),u=u||l.title||String(f);return{schema:l,label:u,value:f}})}const Xy=["string","number","integer","boolean","null"];var Ht;(function(t){t[t.Ignore=0]="Ignore",t[t.Invert=1]="Invert",t[t.Fallback=2]="Fallback"})(Ht||(Ht={}));function Dr(t,e=Ht.Ignore,n=-1){if(n>=0){if(Array.isArray(t.items)&&n<t.items.length){const r=t.items[n];if(typeof r!="boolean")return r}}else if(t.items&&!Array.isArray(t.items)&&typeof t.items!="boolean")return t.items;return e!==Ht.Ignore&&Y(t.additionalItems)?t.additionalItems:{}}function yl(t,e){const{default:n,type:r}=t;return Array.isArray(r)&&r.includes("null")&&me(e)&&n===null?null:e}function lo(t,e,n,r,i,s=[],o={},a=!1,l=!1){const{emptyObjectFields:f="populateAllDefaults"}=o;if(r===!0||a)t[e]=n;else if(r==="excludeObjectChildren")(l&&n!==void 0||!Y(n)||!me(n))&&(t[e]=n);else if(f!=="skipDefaults"){const u=i===void 0?s.includes(e):i;Y(n)?f==="skipEmptyDefaults"?me(n)||(t[e]=n):(!me(n)||s.includes(e))&&(u||f!=="populateRequiredDefaults")&&(t[e]=n):n!==void 0&&(f==="populateAllDefaults"||f==="skipEmptyDefaults"||u&&s.includes(e))&&(t[e]=n)}}function ft(t,e,n={}){const{parentDefaults:r,rawFormData:i,rootSchema:s={},includeUndefinedValues:o=!1,_recurseList:a=[],experimental_defaultFormStateBehavior:l=void 0,experimental_customMergeAllOf:f=void 0,required:u,shouldMergeDefaultsIntoFormData:d=!1,initialDefaultsGenerated:h}=n;let g=Y(i)?i:{};const m=Y(e)?e:{};let p=r,y=null,x=l,S=a;if(m[_e]!==void 0&&l?.constAsDefaults!=="never"&&!gl(m))p=m[_e];else if(Y(p)&&Y(m.default)&&!m[J]&&!m[q]&&!m[ce])p=Cn(p,m.default);else if(ir in m&&!m[J]&&!m[q]&&!m[ce])p=m.default;else if(ce in m){const v=m[ce];a.includes(v)||(S=a.concat(v),y=sl(v,s));const w=i===void 0||Y(i)&&me(i);y&&!p&&w&&(p=m.default),d&&y&&!Y(i)&&(g=i)}else if(vi in m){const v={...co(t,m,n,p),...g};y=dl(t,m,s,!1,[],v,f)[0]}else if(zi(m))p=m.items.map((v,w)=>ft(t,v,{rootSchema:s,includeUndefinedValues:o,_recurseList:a,experimental_defaultFormStateBehavior:l,experimental_customMergeAllOf:f,parentDefaults:Array.isArray(r)?r[w]:void 0,rawFormData:g,required:u,shouldMergeDefaultsIntoFormData:d}));else if(q in m){const{oneOf:v,...w}=m;if(v.length===0)return;const O=Ge(m),{type:A="null"}=w;!Array.isArray(A)&&Xy.includes(A)&&x?.constAsDefaults==="skipOneOf"&&(x={...x,constAsDefaults:"never"}),y=v[On(t,s,i??m.default,v,0,O,f)],y=et(w,y)}else if(J in m){const{anyOf:v,...w}=m;if(v.length===0)return;const O=Ge(m);y=v[On(t,s,i??m.default,v,0,O,f)],y=et(w,y)}if(y)return ft(t,y,{rootSchema:s,includeUndefinedValues:o,_recurseList:S,experimental_defaultFormStateBehavior:x,experimental_customMergeAllOf:f,parentDefaults:p,rawFormData:i??g,required:u,shouldMergeDefaultsIntoFormData:d,initialDefaultsGenerated:h});p===void 0&&(p=m.default);const j=co(t,m,n,p);let b=j??p;if(d){const{arrayMinItems:v={}}=l||{},{mergeExtraDefaults:w}=v,O=Jy(t,m,s,i,l,f);(!Y(i)||pt in m)&&(b=An(b,O,w,!0))}return b}function Jy(t,e,n,r,i,s){const o=!pl(e)&&qi(t,e,n,s);let a=r;if(o){const f=Gt(e);a=f?.some(d=>le(d.value,r))?r:void 0}return e[_e]&&i?.constAsDefaults==="always"&&(a=e.const),a}function Zy(t,e,{rawFormData:n,rootSchema:r={},includeUndefinedValues:i=!1,_recurseList:s=[],experimental_defaultFormStateBehavior:o=void 0,experimental_customMergeAllOf:a=void 0,required:l,shouldMergeDefaultsIntoFormData:f,initialDefaultsGenerated:u}={},d){{const h=Y(n)?n:{},g=e,p=o?.allOf==="populateDefaults"&&pt in g||o?.emptyObjectFields!=="skipEmptyDefaults"&&Si in g?be(t,g,r,h,a):g,y=p[_e],x=Object.keys(p.properties||{}).reduce((S,j)=>{var b;const v=I(p,[te,j],{}),w=Y(y)&&y[j]!==void 0,O=(Y(v)&&_e in v||w)&&o?.constAsDefaults!=="never"&&!gl(v),A=ft(t,v,{rootSchema:r,_recurseList:s,experimental_defaultFormStateBehavior:o,experimental_customMergeAllOf:a,includeUndefinedValues:i===!0,parentDefaults:I(d,[j]),rawFormData:I(h,[j]),required:(b=p.required)===null||b===void 0?void 0:b.includes(j),shouldMergeDefaultsIntoFormData:f,initialDefaultsGenerated:u});return lo(S,j,A,i,l,p.required,o,O,v?.type==="null"),S},{});if(p.additionalProperties&&!u){const S=Y(p.additionalProperties)?p.additionalProperties:{},j=new Set;Y(d)&&Object.keys(d).filter(v=>!p.properties||!p.properties[v]).forEach(v=>j.add(v));const b=[];Object.keys(h).filter(v=>!p.properties||!p.properties[v]).forEach(v=>{j.add(v),b.push(v)}),j.forEach(v=>{var w;const O=ft(t,S,{rootSchema:r,_recurseList:s,experimental_defaultFormStateBehavior:o,experimental_customMergeAllOf:a,includeUndefinedValues:i===!0,parentDefaults:I(d,[v]),rawFormData:I(h,[v]),required:(w=p.required)===null||w===void 0?void 0:w.includes(v),shouldMergeDefaultsIntoFormData:f,initialDefaultsGenerated:u});lo(x,v,O,i,l,b)})}return yl(e,x)}}function Qy(t,e,{rawFormData:n,rootSchema:r={},_recurseList:i=[],experimental_defaultFormStateBehavior:s=void 0,experimental_customMergeAllOf:o=void 0,required:a,requiredAsRoot:l=!1,shouldMergeDefaultsIntoFormData:f,initialDefaultsGenerated:u}={},d){var h,g;const m=e,p=(h=s?.arrayMinItems)!==null&&h!==void 0?h:{},{populate:y,mergeExtraDefaults:x}=p,S=y==="never",j=y==="requiredOnly",b=y==="all"||!S&&!j,v=(g=p?.computeSkipPopulate)!==null&&g!==void 0?g:(()=>!1),O=s?.emptyObjectFields==="skipEmptyDefaults"?void 0:[];if(Array.isArray(d)&&(d=d.map((N,_)=>{const F=Dr(m,Ht.Fallback,_),$=Array.isArray(n)?n[_]:void 0;return ft(t,F,{rootSchema:r,_recurseList:i,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:o,parentDefaults:N,rawFormData:$,required:a,shouldMergeDefaultsIntoFormData:f,initialDefaultsGenerated:u})})),Array.isArray(n)){const N=Dr(m);if(S)d=n;else{const _=n.map(($,E)=>ft(t,N,{rootSchema:r,_recurseList:i,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:o,rawFormData:$,parentDefaults:I(d,[E]),required:a,shouldMergeDefaultsIntoFormData:f,initialDefaultsGenerated:u}));d=An(d,_,(j&&a||b)&&x)}}if((Y(m)&&_e in m&&s?.constAsDefaults!=="never")===!1){if(S)return d??O;if(j&&!a)return d||void 0}let C;const T=Array.isArray(d)?d.length:0;if(!m.minItems||Ki(t,m,r,o)||v(t,m,r)||m.minItems<=T)C=d||!a&&!l?d:O;else{const N=d||[],_=Dr(m,Ht.Invert),F=_.default,$=Array.from({length:m.minItems-T},()=>ft(t,_,{parentDefaults:F,rootSchema:r,_recurseList:i,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:o,required:a,shouldMergeDefaultsIntoFormData:f}));C=N.concat($)}return yl(e,C)}function co(t,e,n={},r){switch(Ie(e)){case"object":return Zy(t,e,n,r);case"array":return Qy(t,e,n,r)}}function xl(t,e,n,r,i=!1,s,o,a){if(!Y(e))throw new Error("Invalid schema: "+e);const l=be(t,e,r,n,o),f=ft(t,l,{rootSchema:r,includeUndefinedValues:i,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:o,rawFormData:n,shouldMergeDefaultsIntoFormData:!0,initialDefaultsGenerated:a,requiredAsRoot:!0});if(l.type!=="object"&&Y(l.default))return{...f,...n};if(Y(n)||Array.isArray(n)){const{mergeDefaultsIntoFormData:u}=s||{};return An(f,n,!0,u==="useDefaultIfFormDataUndefined",!0)}return f}function bl(t={}){return"widget"in U(t)&&U(t).widget!=="hidden"}function vl(t,e,n={},r,i){if(n[ji]==="files")return!0;if(e.items){const s=be(t,e.items,r,void 0,i);return s.type==="string"&&s.format==="data-url"}return!1}function ex(t,e,n={},r,i,s){const o=U(n,i),{label:a=!0}=o;let l=!!a;if(l){const f=Ie(e),u=I(e,Qe,!1);f==="array"&&(l=u||Ki(t,e,r,s)||vl(t,e,n,r,s)||bl(n)),f==="object"&&(l=u),f==="boolean"&&n&&!n[ji]&&(l=!1),n&&n[Ld]&&(l=!1)}return l}function Sl(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=ur(t,o);n(a,o)&&Di(s,Jt(o,t),a)}return s}function tx(t,e){return Sl(t,e,function(n,r){return Ma(t,r)})}var Gi=rl(function(t,e){return t==null?{}:tx(t,e)});function St(t,e,n,r,i,s=[],o){if(ce in e||vi in e||pt in e||Si in e){const l=be(t,e,r,i,o);if(s.findIndex(u=>le(u,l))===-1)return St(t,l,n,r,i,s.concat(l),o)}let a={[qn]:n.replace(/^\./,"")};if(q in e||J in e){const l=q in e?e.oneOf:e.anyOf,f=Ge(e),u=On(t,r,i,l,0,f,o),d=l[u];a={...a,...St(t,d,n,r,i,s,o)}}if(Zn in e&&e[Zn]!==!1&&se(a,wi,!0),zt in e&&Array.isArray(i)){const{items:l,additionalItems:f}=e;Array.isArray(l)?i.forEach((u,d)=>{l[d]?a[d]=St(t,l[d],`${n}.${d}`,r,u,s,o):f?a[d]=St(t,f,`${n}.${d}`,r,u,s,o):console.warn(`Unable to generate path schema for "${n}.${d}". No schema defined for it`)}):i.forEach((u,d)=>{a[d]=St(t,l,`${n}.${d}`,r,u,s,o)})}else if(te in e)for(const l in e.properties){const f=I(e,[te,l],{});a[l]=St(t,f,`${n}.${l}`,r,I(i,[l]),s,o)}return a}function wl(t,e,n="",r,i,s){return St(t,e,n,r,i,void 0,s)}function jl(t,e){if(e.length===0&&typeof t!="object")return t;const n=Gi(t,e);return Array.isArray(t)?Object.keys(n).map(r=>n[r]):n}function Ol(t,e){const n=(i,s)=>typeof i!="object"||me(i)||s&&!me(i),r=(i,s=[],o=[[]])=>{const a=Object.keys(i);return a.forEach(l=>{const f=i[l];if(typeof f=="object"){const u=o.map(d=>[...d,l]);f[wi]&&f[qn]!==""?s.push(f[qn]):r(f,s,u)}else l===qn&&f!==""&&o.forEach(u=>{const d=I(e,u),h=a.length===1;(n(d,h)||Array.isArray(d)&&d.every(g=>n(g,h)))&&s.push(u)})}),s};return r(t)}function nx(t,e,n={},r){const i=be(t,e,n,r),s=wl(t,i,"",n,r),a=Ol(s,r).map(l=>Array.isArray(l)?l.join("."):l);return jl(r,a)}const Dt=Symbol("no Value");function ii(t,e,n,r,i={},s){let o;if(X(n,te)){const a={};if(X(r,te)){const u=I(r,te,{});Object.keys(u).forEach(d=>{X(i,d)&&(a[d]=void 0)})}const l=Object.keys(I(n,te,{})),f={};l.forEach(u=>{const d=I(i,u);let h=I(r,[te,u],{}),g=I(n,[te,u],{});X(h,ce)&&(h=be(t,h,e,d,s)),X(g,ce)&&(g=be(t,g,e,d,s));const m=I(h,"type"),p=I(g,"type");if(!m||m===p)if(X(a,u)&&delete a[u],p==="object"||p==="array"&&Array.isArray(d)){const y=ii(t,e,g,h,d,s);(y!==void 0||p==="array")&&(f[u]=y)}else{const y=I(g,"default",Dt),x=I(h,"default",Dt);y!==Dt&&y!==d&&(x===d?a[u]=y:I(g,"readOnly")===!0&&(a[u]=void 0));const S=I(g,"const",Dt),j=I(h,"const",Dt);S!==Dt&&S!==d&&(a[u]=j===d?S:void 0)}}),o={...typeof i=="string"||Array.isArray(i)?void 0:i,...a,...f}}else if(I(r,"type")==="array"&&I(n,"type")==="array"&&Array.isArray(i)){let a=I(r,"items"),l=I(n,"items");if(typeof a=="object"&&typeof l=="object"&&!Array.isArray(a)&&!Array.isArray(l)){X(a,ce)&&(a=be(t,a,e,i,s)),X(l,ce)&&(l=be(t,l,e,i,s));const f=I(a,"type"),u=I(l,"type");if(!f||f===u){const d=I(n,"maxItems",-1);u==="object"?o=i.reduce((h,g)=>{const m=ii(t,e,l,a,g,s);return m!==void 0&&(d<0||h.length<d)&&h.push(m),h},[]):o=d>0&&i.length>d?i.slice(0,d):i}}else typeof a=="boolean"&&typeof l=="boolean"&&a===l&&(o=i)}return o}class rx{constructor(e,n,r,i){n&&n[cn]===Kn?this.rootSchema=ni(n,I(n,oe,"#")):this.rootSchema=n,this.validator=e,this.experimental_defaultFormStateBehavior=r,this.experimental_customMergeAllOf=i}getRootSchema(){return this.rootSchema}getValidator(){return this.validator}doesSchemaUtilsDiffer(e,n,r={},i){return!e||!n?!1:this.validator!==e||!le(this.rootSchema,n)||!le(this.experimental_defaultFormStateBehavior,r)||this.experimental_customMergeAllOf!==i}findFieldInSchema(e,n,r){return Wy(this.validator,this.rootSchema,e,n,r,this.experimental_customMergeAllOf)}findSelectedOptionInXxxOf(e,n,r,i){return dn(this.validator,this.rootSchema,e,n,r,i,this.experimental_customMergeAllOf)}getDefaultFormState(e,n,r=!1,i){return xl(this.validator,e,n,this.rootSchema,r,this.experimental_defaultFormStateBehavior,this.experimental_customMergeAllOf,i)}getDisplayLabel(e,n,r){return ex(this.validator,e,n,this.rootSchema,r,this.experimental_customMergeAllOf)}getClosestMatchingOption(e,n,r,i){return On(this.validator,this.rootSchema,e,n,r,i,this.experimental_customMergeAllOf)}getFirstMatchingOption(e,n,r){return Wi(this.validator,e,n,this.rootSchema,r)}getFromSchema(e,n,r){return Yn(this.validator,this.rootSchema,e,n,r,this.experimental_customMergeAllOf)}isFilesArray(e,n){return vl(this.validator,e,n,this.rootSchema,this.experimental_customMergeAllOf)}isMultiSelect(e){return Ki(this.validator,e,this.rootSchema,this.experimental_customMergeAllOf)}isSelect(e){return qi(this.validator,e,this.rootSchema,this.experimental_customMergeAllOf)}omitExtraData(e,n){return nx(this.validator,e,this.rootSchema,n)}retrieveSchema(e,n,r){return be(this.validator,e,this.rootSchema,n,this.experimental_customMergeAllOf,r)}sanitizeDataForNewSchema(e,n,r){return ii(this.validator,this.rootSchema,e,n,r,this.experimental_customMergeAllOf)}toPathSchema(e,n,r){return wl(this.validator,e,n,this.rootSchema,r,this.experimental_customMergeAllOf)}}function ix(t,e,n={},r){return new rx(t,e,n,r)}function sx(t){var e;if(t.indexOf("data:")===-1)throw new Error("File is invalid: URI must be a dataURI");const r=t.slice(5).split(";base64,");if(r.length!==2)throw new Error("File is invalid: dataURI must be base64");const[i,s]=r,[o,...a]=i.split(";"),l=o||"",f=decodeURI(((e=a.map(u=>u.split("=")).find(([u])=>u==="name"))===null||e===void 0?void 0:e[1])||"unknown");try{const u=atob(s),d=new Array(u.length);for(let g=0;g<u.length;g++)d[g]=u.charCodeAt(g);return{blob:new window.Blob([new Uint8Array(d)],{type:l}),name:f}}catch(u){throw new Error("File is invalid: "+u.message)}}function at(t,e){let n=String(t);for(;n.length<e;)n="0"+n;return n}function Al(t,e){if(t<=0&&e<=0)t=new Date().getFullYear()+t,e=new Date().getFullYear()+e;else if(t<0||e<0)throw new Error(`Both start (${t}) and stop (${e}) must both be <= 0 or > 0, got one of each`);if(t>e)return Al(e,t).reverse();const n=[];for(let r=t;r<=e;r++)n.push({value:r,label:at(r,2)});return n}function uo(t,e){if(Object.is(t,e))return!0;if(t==null||e==null||typeof t!="object"||typeof e!="object")return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++){const s=n[i];if(!Object.prototype.hasOwnProperty.call(e,s)||!Object.is(t[s],e[s]))return!1}return!0}function ox(t,e){let n=t;if(Array.isArray(e)){const r=n.split(/(%\d)/);e.forEach((i,s)=>{const o=r.findIndex(a=>a===`%${s+1}`);o>=0&&(r[o]=i)}),n=r.join("")}return n}function ax(t,e){return ox(t,e)}function ge(t,e=[],n){if(Array.isArray(t))return t.map(s=>ge(s,e)).filter(s=>s!==n);const r=t===""||t===null?-1:Number(t),i=e[r];return i?i.value:n}function Cl(t,e,n=[]){const r=ge(t,n);return Array.isArray(e)?e.filter(i=>!le(i,r)):le(r,e)?void 0:e}function kn(t,e){return Array.isArray(e)?e.some(n=>le(n,t)):le(e,t)}function _l(t,e=[],n=!1){const r=e.map((i,s)=>kn(i.value,t)?String(s):void 0).filter(i=>typeof i<"u");return n?r:r[0]}function Nl(t,e,n=[]){const r=ge(t,n);if(!rr(r)){const i=n.findIndex(a=>r===a.value),s=n.map(({value:a})=>a);return e.slice(0,i).concat(r,e.slice(i)).sort((a,l)=>+(s.indexOf(a)>s.indexOf(l)))}return e}var lx=1,cx=4;function Hi(t){return mn(t,lx|cx)}function ux(t,e,n,r){return r=typeof r=="function"?r:void 0,t==null?t:Di(t,e,n,r)}class Tl{constructor(e){this.errorSchema={},this.resetAllErrors(e)}get ErrorSchema(){return this.errorSchema}getOrCreateErrorBlock(e){let r=Array.isArray(e)&&e.length>0||typeof e=="string"?I(this.errorSchema,e):this.errorSchema;return!r&&e&&(r={},ux(this.errorSchema,e,r,Object)),r}resetAllErrors(e){return this.errorSchema=e?Hi(e):{},this}addErrors(e,n){const r=this.getOrCreateErrorBlock(n);let i=I(r,xe);return Array.isArray(i)||(i=[],r[xe]=i),Array.isArray(e)?se(r,xe,[...new Set([...i,...e])]):se(r,xe,[...new Set([...i,e])]),this}setErrors(e,n){const r=this.getOrCreateErrorBlock(n),i=Array.isArray(e)?[...new Set([...e])]:[e];return se(r,xe,i),this}clearErrors(e){const n=this.getOrCreateErrorBlock(e);return se(n,xe,[]),this}}function dx(t,e){if(t==null)return{};var n=Xt(Ui(t),function(r){return[r]});return e=ki(e),Sl(t,n,function(r,i){return e(r,i[0])})}var fx=200;function mx(t,e,n,r){var i=-1,s=Bi,o=!0,a=t.length,l=[],f=e.length;if(!a)return l;e.length>=fx&&(s=vn,o=!1,e=new Ot(e));e:for(;++i<a;){var u=t[i],d=u;if(u=u!==0?u:0,o&&d===d){for(var h=f;h--;)if(e[h]===d)continue e;l.push(u)}else s(e,d,r)||l.push(u)}return l}var hx=fr(function(t,e){return Sn(t)?mx(t,$n(e,1,Sn,!0)):[]});function fo(t,e){const n=gt(t),r=gt(e);if(t===e||!n&&!r)return[];if(n&&!r)return Pe(t);if(!n&&r)return Pe(e);{const i=Pe(dx(t,(o,a)=>!le(o,I(e,a)))),s=hx(Pe(e),Pe(t));return[...i,...s]}}function px(t,e,n=[1900,new Date().getFullYear()+2],r="YMD"){const{day:i,month:s,year:o,hour:a,minute:l,second:f}=t,u={type:"day",range:[1,31],value:i},d={type:"month",range:[1,12],value:s},h={type:"year",range:n,value:o},g=[];switch(r){case"MDY":g.push(d,u,h);break;case"DMY":g.push(u,d,h);break;default:g.push(h,d,u)}return e&&g.push({type:"hour",range:[0,23],value:a},{type:"minute",range:[0,59],value:l},{type:"second",range:[0,59],value:f}),g}function Fl(t){const e={};return t.multipleOf&&(e.step=t.multipleOf),(t.minimum||t.minimum===0)&&(e.min=t.minimum),(t.maximum||t.maximum===0)&&(e.max=t.maximum),e}function Pl(t,e,n={},r=!0){const i={type:e||"text",...Fl(t)};return n.inputType?i.type=n.inputType:e||(t.type==="number"?(i.type="number",r&&i.step===void 0&&(i.step="any")):t.type==="integer"&&(i.type="number",i.step===void 0&&(i.step=1))),n.autocomplete&&(i.autoComplete=n.autocomplete),n.accept&&(i.accept=n.accept),i}const mo={props:{disabled:!1},submitText:"Submit",norender:!1};function El(t={}){const e=U(t);if(e&&e[Qn]){const n=e[Qn];return{...mo,...n}}return mo}function L(t,e,n={}){const{templates:r}=e;if(t==="ButtonTemplates")return r[t];if(Object.hasOwn(n,t)&&typeof n[t]=="string"&&Object.hasOwn(r,n[t])){const i=n[t];return r[i]}return n[t]||r[t]}var gx=0;function Il(t){var e=++gx;return Pi(t)+e}function Yi(){if(typeof process>"u"||I(process,"env.NODE_ENV")!=="test")return{};const t=new Map;return new Proxy({},{get(e,n){return t.has(n)||t.set(n,Il("test-id-")),t.get(n)}})}const $r={boolean:{checkbox:"CheckboxWidget",radio:"RadioWidget",select:"SelectWidget",hidden:"HiddenWidget"},string:{text:"TextWidget",password:"PasswordWidget",email:"EmailWidget",hostname:"TextWidget",ipv4:"TextWidget",ipv6:"TextWidget",uri:"URLWidget","data-url":"FileWidget",radio:"RadioWidget",select:"SelectWidget",textarea:"TextareaWidget",hidden:"HiddenWidget",date:"DateWidget",datetime:"DateTimeWidget","date-time":"DateTimeWidget","alt-date":"AltDateWidget","alt-datetime":"AltDateTimeWidget",time:"TimeWidget",color:"ColorWidget",file:"FileWidget"},number:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},integer:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},array:{select:"SelectWidget",checkboxes:"CheckboxesWidget",files:"FileWidget",hidden:"HiddenWidget"}};function yx(t){let e=I(t,"MergedWidget");if(!e){const n=t.defaultProps&&t.defaultProps.options||{};e=({options:r,...i})=>c.jsx(t,{options:{...n,...r},...i}),se(t,"MergedWidget",e)}return e}function He(t,e,n={}){const r=Ie(t);if(typeof e=="function"||e&&hs.isForwardRef(P.createElement(e))||hs.isMemo(e))return yx(e);if(typeof e!="string")throw new Error(`Unsupported widget definition: ${typeof e} in schema: ${JSON.stringify(t)}`);if(e in n){const i=n[e];return He(t,i,n)}if(typeof r=="string"){if(!(r in $r))throw new Error(`No widget for type '${r}' in schema: ${JSON.stringify(t)}`);if(e in $r[r]){const i=n[$r[r][e]];return He(t,i,n)}}throw new Error(`No widget '${e}' for type '${r}' in schema: ${JSON.stringify(t)}`)}function xx(t){let e=0;for(let n=0;n<t.length;n+=1){const r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return e.toString(16)}function bx(t){const e=new Set;return JSON.stringify(t,(n,r)=>(e.add(n),r)),JSON.stringify(t,Array.from(e).sort())}function ze(t){return xx(bx(t))}function vx(t){return ze(t)}function Sx(t,e,n={}){try{return He(t,e,n),!0}catch(r){const i=r;if(i.message&&(i.message.startsWith("No widget")||i.message.startsWith("Unsupported widget")))return!1;throw r}}function Pt(t,e){return`${yt(t)?t:t[oe]}__${e}`}function Et(t){return Pt(t,"description")}function Xi(t){return Pt(t,"error")}function _n(t){return Pt(t,"examples")}function Ji(t){return Pt(t,"help")}function hr(t){return Pt(t,"title")}function we(t,e=!1){const n=e?` ${_n(t)}`:"";return`${Xi(t)} ${Et(t)} ${Ji(t)}${n}`}function wt(t,e){return`${t}-${e}`}function qe(t,e){return Pt(t,e)}function kr(t,e){return Pt(t,`optional${e}`)}function Qt(t){return!rr(t)&&(!Z(t)||Array.isArray(t)||!me(t))}function wx(t,e){const{rootSchema:n,schemaUtils:r}=t;if(dt(e,n))return!0;if(ce in n){const i=r.retrieveSchema(n);return dt(e,i)}return!1}function Dl(t,e,n){return e?n:t}function jx(t){return t?new Date(t).toJSON():void 0}function Zi(t,e,n){const r=[Ud];return X(t,vs)&&r.unshift(vs),I(t,[...r,e],n)}function Ox(t,e){if(!Array.isArray(e))return t;const n=u=>u.reduce((d,h)=>(d[h]=!0,d),{}),r=u=>u.length>1?`properties '${u.join("', '")}'`:`property '${u[0]}'`,i=n(t),s=e.filter(u=>u==="*"||i[u]),o=n(s),a=t.filter(u=>!o[u]),l=s.indexOf("*");if(l===-1){if(a.length)throw new Error(`uiSchema order list does not contain ${r(a)}`);return s}if(l!==s.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");const f=[...s];return f.splice(l,1,...a),f}function Mr(t,e=!0){if(!t)return{year:-1,month:-1,day:-1,hour:e?-1:0,minute:e?-1:0,second:e?-1:0};const n=new Date(t);if(Number.isNaN(n.getTime()))throw new Error("Unable to parse date "+t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:e?n.getUTCHours():0,minute:e?n.getUTCMinutes():0,second:e?n.getUTCSeconds():0}}function hn(t){if(t.const||t.enum&&t.enum.length===1&&t.enum[0]===!0)return!0;if(t.anyOf&&t.anyOf.length===1)return hn(t.anyOf[0]);if(t.oneOf&&t.oneOf.length===1)return hn(t.oneOf[0]);if(t.allOf){const e=n=>hn(n);return t.allOf.some(e)}return!1}function $l(t,e,n,r="customDeep"){if(r==="always")return!0;if(r==="shallow"){const{props:o,state:a}=t;return!uo(o,e)||!uo(a,n)}const{props:i,state:s}=t;return!le(i,e)||!le(s,n)}function ho(t){const e=Ga(t.map(n=>Z(n)?Ie(n):void 0).flat().filter(n=>n!==void 0));return e.length===1?e[0]:e}function Mn(t,e,n,r){const{enableOptionalDataFieldForType:i=[]}=U(r,t.globalUiOptions);let s;return J in e&&Array.isArray(e[J])?s=ho(e[J]):q in e&&Array.isArray(e[q])?s=ho(e[q]):s=Ie(e),!wx(t,e)&&!n&&!!s&&!Array.isArray(s)&&!!i.find(o=>o===s)}function po(t,e=!0){const{year:n,month:r,day:i,hour:s=0,minute:o=0,second:a=0}=t,l=Date.UTC(n,r-1,i,s,o,a),f=new Date(l).toJSON();return e?f:f.slice(0,10)}function Qi(t,e=[]){if(!t)return[];let n=[];return xe in t&&(n=n.concat(t[xe].map(r=>{const i=`.${e.join(".")}`;return{property:i,message:r,stack:`${i} ${r}`}}))),Object.keys(t).reduce((r,i)=>{if(i!==xe){const s=t[i];gt(s)&&(r=r.concat(Qi(s,[...e,i])))}return r},n)}function kl(t){return ye(t)?Xt(t,Ft):In(t)?[t]:Ri(Ca(Pi(t)))}function Ax(t){const e=new Tl;return t.length&&t.forEach(n=>{const{property:r,message:i}=n,s=r==="."?[]:kl(r);s.length>0&&s[0]===""&&s.splice(0,1),i&&e.addErrors(i,s)}),e.ErrorSchema}function Fe(t,e,n,r){const i=Array.isArray(n)?n:n?.path,s=t===""?[]:[t],o=i?i.concat(...s):s,a=[e.idPrefix,...o].join(e.idSeparator);let l;return e.nameGenerator&&o.length>0&&(l=e.nameGenerator(o,e.idPrefix,r)),{path:o,[oe]:a,...l!==void 0&&{name:l}}}function Ml(t){return Object.keys(t).reduce((e,n)=>{if(n==="addError")return e;{const r=t[n];return gt(r)?{...e,[n]:Ml(r)}:{...e,[n]:r}}},{})}function Cx(t){return Object.values(t).every(e=>e!==-1)}function _x(t){const{className:e="form-control",type:n,range:r,value:i,select:s,rootId:o,name:a,disabled:l,readonly:f,autofocus:u,registry:d,onBlur:h,onFocus:g}=t,m=`${o}_${n}`,{SelectWidget:p}=d.widgets,y=P.useCallback(x=>s(n,x),[s,n]);return c.jsx(p,{schema:{type:"integer"},id:m,name:a,className:e,options:{enumOptions:Al(r[0],r[1])},placeholder:n,value:i,disabled:l,readonly:f,autofocus:u,onChange:y,onBlur:h,onFocus:g,registry:d,label:"","aria-describedby":we(o)})}function Nx(t){const{time:e=!1,disabled:n=!1,readonly:r=!1,options:i,onChange:s,value:o}=t,[a,l]=P.useState(Mr(o,e));P.useEffect(()=>{l(Mr(o,e))},[e,o]);const f=P.useCallback((g,m)=>{const p={...a,[g]:typeof m>"u"?-1:m};Cx(p)?s(po(p,e)):l(p)},[a,s,e]),u=P.useCallback(g=>{g.preventDefault(),!(n||r)&&s(void 0)},[n,r,s]),d=P.useCallback(g=>{if(g.preventDefault(),n||r)return;const m=Mr(new Date().toJSON(),e);s(po(m,e))},[n,r,e,s]);return{elements:P.useMemo(()=>px(a,e,i.yearsRange,i.format),[a,e,i.yearsRange,i.format]),handleChange:f,handleClear:u,handleSetNow:d}}function It(t){const e=P.useRef(t);return dt(t,e.current)||(e.current=t),e.current}function Tx(t,e){return t.replace(";base64",`;name=${encodeURIComponent(e)};base64`)}function Fx(t){const{name:e,size:n,type:r}=t;return new Promise((i,s)=>{const o=new window.FileReader;o.onerror=s,o.onload=a=>{var l;typeof((l=a.target)===null||l===void 0?void 0:l.result)=="string"?i({dataURL:Tx(a.target.result,e),name:e,size:n,type:r}):i({dataURL:null,name:e,size:n,type:r})},o.readAsDataURL(t)})}function Px(t){return Promise.all(Array.from(t).map(Fx))}function go(t){return t.reduce((e,n)=>{if(!n)return e;try{const{blob:r,name:i}=sx(n);return[...e,{dataURL:n,name:i,size:r.size,type:r.type}]}catch{return e}},[])}function Ex(t,e,n=!1){const r=P.useMemo(()=>n&&t?Array.isArray(t)?t:[t]:[],[t,n]),i=P.useMemo(()=>Array.isArray(t)?go(t):go([t||""]),[t]),s=P.useCallback(a=>{Px(a).then(l=>{const f=l.map(u=>u.dataURL||null);e(n?r.concat(...f):f[0])})},[r,n,e]),o=P.useCallback(a=>{if(n){const l=r.filter((f,u)=>u!==a);e(l)}else e(void 0)},[r,n,e]);return{filesInfo:i,handleChange:s,handleRemove:o}}function Ix(t){if(!t)return"";const e=new Date(t),n=at(e.getFullYear(),4),r=at(e.getMonth()+1,2),i=at(e.getDate(),2),s=at(e.getHours(),2),o=at(e.getMinutes(),2),a=at(e.getSeconds(),2),l=at(e.getMilliseconds(),3);return`${n}-${r}-${i}T${s}:${o}:${a}.${l}`}function Xn(t,e,n=!1){if(!e)return t;const{errors:r,errorSchema:i}=t;let s=Qi(e),o=e;return me(i)||(o=Cn(i,e,n?"preventDuplicates":!0),s=[...r].concat(s)),{errorSchema:o,errors:s}}function Dx(t){for(const e in t){const n=t,r=n[e];e===ce&&typeof r=="string"&&r.startsWith("#")?n[e]=da+r:n[e]=es(r)}return t}function $x(t){for(let e=0;e<t.length;e++)t[e]=es(t[e]);return t}function es(t){return Array.isArray(t)?$x([...t]):Z(t)?Dx({...t}):t}var K;(function(t){t.ArrayItemTitle="Item",t.MissingItems="Missing items definition",t.EmptyArray="No items yet. Use the button below to add some.",t.YesLabel="Yes",t.NoLabel="No",t.CloseLabel="Close",t.ErrorsLabel="Errors",t.NewStringDefault="New Value",t.AddButton="Add",t.AddItemButton="Add Item",t.CopyButton="Copy",t.MoveDownButton="Move down",t.MoveUpButton="Move up",t.RemoveButton="Remove",t.NowLabel="Now",t.ClearLabel="Clear",t.AriaDateLabel="Select a date",t.PreviewLabel="Preview",t.DecrementAriaLabel="Decrease value by 1",t.IncrementAriaLabel="Increase value by 1",t.OptionalObjectAdd="Add data for optional field",t.OptionalObjectRemove="Remove data for optional field",t.OptionalObjectEmptyMsg="No data for optional field",t.Type="Type",t.Value="Value",t.ClearButton="clear input",t.UnknownFieldType="Unknown field type %1",t.OptionPrefix="Option %1",t.TitleOptionPrefix="%1 option %2",t.KeyLabel="%1 Key",t.InvalidObjectField='Invalid "%1" object field configuration: _%2_.',t.UnsupportedField="Unsupported field schema.",t.UnsupportedFieldWithId="Unsupported field schema for field `%1`.",t.UnsupportedFieldWithReason="Unsupported field schema: _%1_.",t.UnsupportedFieldWithIdAndReason="Unsupported field schema for field `%1`: _%2_.",t.FilesInfo="**%1** (%2, %3 bytes)"})(K||(K={}));function kx(t,e){var n=ye(t)?$i:hl;return n(t,Ta(e))}function Mx(t,e){return t==null?!0:nl(t,e)}function si(){return Il("rjsf-array-item-")}function yo(t){return Array.isArray(t)?t.map(e=>({key:si(),item:e})):[]}function Rl(t){return Array.isArray(t)?t.map(e=>e.item):[]}function Rx(t){return Array.isArray(t.type)?!t.type.includes("null"):t.type!=="null"}function Bl(t,e,n,r){let{addable:i}=U(r,t.globalUiOptions);return i!==!1&&(e.maxItems!==void 0?i=n.length<e.maxItems:i=!0),i}function Ul(t,e,n,r){if(typeof t.items=="function")try{return t.items(e,n,r)}catch(i){console.error(`Error executing dynamic uiSchema.items function for item at index ${n}:`,i);return}else return t.items}function Bx(t,e){const{schemaUtils:n,globalFormOptions:r}=t;let i=e.items;return r.useFallbackUiForUnsupportedType&&!i?i={}:zi(e)&&kd(e)&&(i=e.additionalItems),n.getDefaultFormState(i)}function Ux(t){const{schema:e,fieldPathId:n,uiSchema:r,formData:i=[],disabled:s=!1,readonly:o=!1,autofocus:a=!1,required:l=!1,placeholder:f,onBlur:u,onFocus:d,registry:h,rawErrors:g,name:m,onSelectChange:p}=t,{widgets:y,schemaUtils:x,globalFormOptions:S,globalUiOptions:j}=h,b=x.retrieveSchema(e.items,i),v=Gt(b,r),{widget:w="select",title:O,...A}=U(r,j),C=He(e,w,y),T=O??e.title??m,N=x.getDisplayLabel(e,r,j),_=It(Fe("",S,n,!0));return c.jsx(C,{id:_[oe],name:m,multiple:!0,onChange:p,onBlur:u,onFocus:d,options:{...A,enumOptions:v},schema:e,uiSchema:r,registry:h,value:i,disabled:s,readonly:o,required:l,label:T,hideLabel:!N,placeholder:f,autofocus:a,rawErrors:g,htmlName:_.name})}function Lx(t){const{schema:e,fieldPathId:n,uiSchema:r,disabled:i=!1,readonly:s=!1,autofocus:o=!1,required:a=!1,hideError:l,placeholder:f,onBlur:u,onFocus:d,formData:h=[],registry:g,rawErrors:m,name:p,onSelectChange:y}=t,{widgets:x,schemaUtils:S,globalFormOptions:j,globalUiOptions:b}=g,{widget:v,title:w,...O}=U(r,b),A=He(e,v,x),C=w??e.title??p,T=S.getDisplayLabel(e,r,b),N=It(Fe("",j,n,!0));return c.jsx(A,{id:N[oe],name:p,multiple:!0,onChange:y,onBlur:u,onFocus:d,options:O,schema:e,uiSchema:r,registry:g,value:h,disabled:i,readonly:s,hideError:l,required:a,label:C,hideLabel:!T,placeholder:f,autofocus:o,rawErrors:m,htmlName:N.name})}function Vx(t){const{schema:e,uiSchema:n,fieldPathId:r,name:i,disabled:s=!1,readonly:o=!1,autofocus:a=!1,required:l=!1,onBlur:f,onFocus:u,registry:d,formData:h=[],rawErrors:g,onSelectChange:m}=t,{widgets:p,schemaUtils:y,globalFormOptions:x,globalUiOptions:S}=d,{widget:j="files",title:b,...v}=U(n,S),w=He(e,j,p),O=b??e.title??i,A=y.getDisplayLabel(e,n,S),C=It(Fe("",x,r,!0));return c.jsx(w,{options:v,id:C[oe],name:i,multiple:!0,onChange:m,onBlur:f,onFocus:u,schema:e,uiSchema:n,value:h,disabled:s,readonly:o,required:l,registry:d,autofocus:a,rawErrors:g,label:O,hideLabel:!A,htmlName:C.name})}function Ll(t){const{itemKey:e,index:n,name:r,disabled:i,hideError:s,readonly:o,registry:a,uiOptions:l,parentUiSchema:f,canAdd:u,canRemove:d=!0,canMoveUp:h,canMoveDown:g,itemSchema:m,itemData:p,itemUiSchema:y,itemFieldPathId:x,itemErrorSchema:S,autofocus:j,onBlur:b,onFocus:v,onChange:w,rawErrors:O,totalItems:A,title:C,handleAddItem:T,handleCopyItem:N,handleRemoveItem:_,handleReorderItems:F}=t,{schemaUtils:$,fields:{ArraySchemaField:E,SchemaField:D},globalUiOptions:M}=a,k=It(x),B=E||D,W=L("ArrayFieldItemTemplate",a,l),R=$.getDisplayLabel(m,y,M),{description:V}=U(y),Q=!!V||!!m.description,{orderable:ne=!0,removable:ie=!0,copyable:de=!1}=l,ee={moveUp:ne&&h,moveDown:ne&&g,copy:de&&u,remove:ie&&d,toolbar:!1};ee.toolbar=Object.keys(ee).some(pe=>ee[pe]);const z=P.useCallback(pe=>{T(pe,n+1)},[T,n]),H=P.useCallback(pe=>{N(pe,n)},[N,n]),re=P.useCallback(pe=>{_(pe,n)},[_,n]),fe=P.useCallback(pe=>{F(pe,n,n-1)},[F,n]),je=P.useCallback(pe=>{F(pe,n,n+1)},[F,n]),Se={children:c.jsx(B,{name:r,title:C,index:n,schema:m,uiSchema:y,formData:p,errorSchema:S,fieldPathId:k,required:Rx(m),onChange:w,onBlur:b,onFocus:v,registry:a,disabled:i,readonly:o,hideError:s,autofocus:j,rawErrors:O}),buttonsProps:{fieldPathId:k,disabled:i,readonly:o,canAdd:u,hasCopy:ee.copy,hasMoveUp:ee.moveUp,hasMoveDown:ee.moveDown,hasRemove:ee.remove,index:n,totalItems:A,onAddItem:z,onCopyItem:H,onRemoveItem:re,onMoveUpItem:fe,onMoveDownItem:je,registry:a,schema:m,uiSchema:y},itemKey:e,className:"rjsf-array-item",disabled:i,hasToolbar:ee.toolbar,index:n,totalItems:A,readonly:o,registry:a,schema:m,uiSchema:y,parentUiSchema:f,displayLabel:R,hasDescription:Q};return c.jsx(W,{...Se})}function Wx(t){const{schema:e,uiSchema:n={},errorSchema:r,fieldPathId:i,formData:s,name:o,title:a,disabled:l=!1,readonly:f=!1,autofocus:u=!1,required:d=!1,hideError:h=!1,registry:g,onBlur:m,onFocus:p,rawErrors:y,onChange:x,keyedFormData:S,handleAddItem:j,handleCopyItem:b,handleRemoveItem:v,handleReorderItems:w}=t,O=e.title||a||o,{schemaUtils:A,fields:C,formContext:T,globalFormOptions:N,globalUiOptions:_}=g,{OptionalDataControlsField:F}=C,$=U(n,_),E=Z(e.items)?e.items:{},D=A.retrieveSchema(E),M=Rl(S),k=Mn(g,e,d,n),B=Qt(s),W=Bl(g,e,M,n)&&(!k||B),R=B?S:[],V=k?" rjsf-optional-array-field":"",Q=t.childFieldPathId??i,ne=k?c.jsx(F,{...t,fieldPathId:Q}):void 0,ie={canAdd:W,items:R.map((ee,z)=>{const{key:H,item:re}=ee,fe=re,je=A.retrieveSchema(E,fe),Se=r?r[z]:void 0,pe=Fe(z,N,Q),Oe=Ul(n,re,z,T),De={itemKey:H,index:z,name:o&&`${o}-${z}`,registry:g,uiOptions:$,hideError:h,readonly:f,disabled:l,required:d,title:O?`${O}-${z+1}`:void 0,canAdd:W,canMoveUp:z>0,canMoveDown:z<M.length-1,itemSchema:je,itemFieldPathId:pe,itemErrorSchema:Se,itemData:fe,itemUiSchema:Oe,autofocus:u&&z===0,onBlur:m,onFocus:p,rawErrors:y,totalItems:S.length,handleAddItem:j,handleCopyItem:b,handleRemoveItem:v,handleReorderItems:w,onChange:x};return c.jsx(Ll,{...De},H)}),className:`rjsf-field rjsf-field-array rjsf-field-array-of-${D.type}${V}`,disabled:l,fieldPathId:i,uiSchema:n,onAddClick:j,readonly:f,required:d,schema:e,title:O,formData:M,rawErrors:y,registry:g,optionalDataControl:ne},de=L("ArrayFieldTemplate",g,$);return c.jsx(de,{...ie})}function zx(t){const{schema:e,uiSchema:n={},formData:r,errorSchema:i,fieldPathId:s,name:o,title:a,disabled:l=!1,readonly:f=!1,autofocus:u=!1,required:d=!1,hideError:h=!1,registry:g,onBlur:m,onFocus:p,rawErrors:y,keyedFormData:x,onChange:S,handleAddItem:j,handleCopyItem:b,handleRemoveItem:v,handleReorderItems:w}=t;let{formData:O=[]}=t;const A=e.title||a||o,{schemaUtils:C,fields:T,formContext:N,globalFormOptions:_,globalUiOptions:F}=g,$=U(n,F),{OptionalDataControlsField:E}=T,D=Mn(g,e,d,n),M=Qt(r),B=(Z(e.items)?e.items:[]).map((z,H)=>C.retrieveSchema(z,O[H])),W=Z(e.additionalItems)?C.retrieveSchema(e.additionalItems,r):null,R=t.childFieldPathId??s;O.length<B.length&&(O=O.concat(new Array(B.length-O.length)));const V=M?x:[],Q=D?" rjsf-optional-array-field":"",ne=D?c.jsx(E,{...t,fieldPathId:R}):void 0,ie=Bl(g,e,O,n)&&!!W&&(!D||M),de={canAdd:ie,className:`rjsf-field rjsf-field-array rjsf-field-array-fixed-items${Q}`,disabled:l,fieldPathId:s,formData:r,items:V.map((z,H)=>{const{key:re,item:fe}=z,je=fe,Se=H>=B.length,pe=(Se&&Z(e.additionalItems)?C.retrieveSchema(e.additionalItems,je):B[H])||{},Oe=Fe(H,_,R);let De;Se?De=n.additionalItems:Array.isArray(n.items)?De=n.items[H]:De=Ul(n,fe,H,N);const nn=i?i[H]:void 0,Je={index:H,itemKey:re,name:o&&`${o}-${H}`,registry:g,uiOptions:$,hideError:h,readonly:f,disabled:l,required:d,title:A?`${A}-${H+1}`:void 0,canAdd:ie,canRemove:Se,canMoveUp:H>=B.length+1,canMoveDown:Se&&H<O.length-1,itemSchema:pe,itemData:je,itemUiSchema:De,itemFieldPathId:Oe,itemErrorSchema:nn,autofocus:u&&H===0,onBlur:m,onFocus:p,rawErrors:y,totalItems:x.length,onChange:S,handleAddItem:j,handleCopyItem:b,handleRemoveItem:v,handleReorderItems:w};return c.jsx(Ll,{...Je},re)}),onAddClick:j,readonly:f,required:d,registry:g,schema:e,uiSchema:n,title:A,errorSchema:i,rawErrors:y,optionalDataControl:ne},ee=L("ArrayFieldTemplate",g,$);return c.jsx(ee,{...de})}function qx(t=[]){const e=P.useMemo(()=>ze(t),[t]),[n,r]=P.useState(()=>({formDataHash:e,keyedFormData:yo(t)}));let{keyedFormData:i,formDataHash:s}=n;if(e!==s){const a=Array.isArray(t)?t:[],l=i||[];i=a.length===l.length?l.map((f,u)=>({key:f.key,item:a[u]})):yo(a),s=e,r({formDataHash:s,keyedFormData:i})}const o=P.useCallback(a=>{const l=Rl(a),f=ze(l);return r({formDataHash:f,keyedFormData:a}),l},[]);return{keyedFormData:i,updateKeyedFormData:o}}function Kx(t){const{schema:e,uiSchema:n,errorSchema:r,fieldPathId:i,registry:s,formData:o,onChange:a}=t,{globalFormOptions:l,schemaUtils:f,translateString:u}=s,{keyedFormData:d,updateKeyedFormData:h}=qx(o),g=t.childFieldPathId??i,m=P.useCallback((w,O)=>{w&&w.preventDefault();let A;if(r){A={};for(const N in r){const _=parseInt(N);O===void 0||_<O?se(A,[_],r[N]):_>=O&&se(A,[_+1],r[N])}}const C={key:si(),item:Bx(s,e)},T=[...d];O!==void 0?T.splice(O,0,C):T.push(C),a(h(T),g.path,A)},[d,s,e,a,h,r,g]),p=P.useCallback((w,O)=>{w&&w.preventDefault();let A;if(r){A={};for(const N in r){const _=parseInt(N);_<=O?se(A,[_],r[N]):_>O&&se(A,[_+1],r[N])}}const C={key:si(),item:Hi(d[O].item)},T=[...d];O!==void 0?T.splice(O+1,0,C):T.push(C),a(h(T),g.path,A)},[d,a,h,r,g]),y=P.useCallback((w,O)=>{w&&w.preventDefault();let A;if(r){A={};for(const T in r){const N=parseInt(T);N<O?se(A,[N],r[T]):N>O&&se(A,[N-1],r[T])}}const C=d.filter((T,N)=>N!==O);a(h(C),g.path,A)},[d,a,h,r,g]),x=P.useCallback((w,O,A)=>{w&&(w.preventDefault(),w.currentTarget.blur());let C;if(r){C={};for(const _ in r){const F=parseInt(_);F==O?se(C,[A],r[O]):F==A?se(C,[O],r[A]):se(C,[_],r[F])}}function T(){const _=d.slice();return _.splice(O,1),_.splice(A,0,d[O]),_}const N=T();a(h(N),g.path,C)},[d,a,h,r,g]),S=P.useCallback((w,O,A,C)=>{a(w===void 0?null:w,O,A,C)},[a]),j=P.useCallback(w=>{a(w,g.path,void 0,g?.[oe])},[a,g]),b={...t,formData:o,fieldPathId:g,onSelectChange:j},v={...t,handleAddItem:m,handleCopyItem:p,handleRemoveItem:y,handleReorderItems:x,keyedFormData:d,onChange:S};if(!(zt in e)){if(!l.useFallbackUiForUnsupportedType){const O=U(n),A=L("UnsupportedFieldTemplate",s,O);return c.jsx(A,{schema:e,fieldPathId:i,reason:u(K.MissingItems),registry:s})}const w={...e,[zt]:{type:void 0}};b.schema=w,v.schema=w}return f.isMultiSelect(b.schema)?c.jsx(Ux,{...b}):bl(n)?c.jsx(Lx,{...b}):zi(b.schema)?c.jsx(zx,{...v}):f.isFilesArray(b.schema,n)?c.jsx(Vx,{...b}):c.jsx(Wx,{...v})}function Gx(t){const{schema:e,name:n,uiSchema:r,fieldPathId:i,formData:s,registry:o,required:a,disabled:l,readonly:f,hideError:u,autofocus:d,title:h,onChange:g,onFocus:m,onBlur:p,rawErrors:y}=t,{title:x}=e,{widgets:S,translateString:j,globalUiOptions:b}=o,{widget:v="checkbox",title:w,label:O=!0,enumNames:A,...C}=U(r,b),T=He(e,v,S),N=j(K.YesLabel),_=j(K.NoLabel);let F;const $=w??x??h??n;if(Array.isArray(e.oneOf))F=Gt({oneOf:e.oneOf.map(D=>{if(Z(D))return{...D,title:D.title||(D.const===!0?N:_)}}).filter(D=>D)},r);else{const D=e.enum??[!0,!1];!A&&D.length===2&&D.every(M=>typeof M=="boolean")?F=[{value:D[0],label:D[0]?N:_},{value:D[1],label:D[1]?N:_}]:F=Gt({enum:D},r)}const E=P.useCallback((D,M,k)=>g(D,i.path,M,k),[g,i]);return c.jsx(T,{options:{...C,enumOptions:F},schema:e,uiSchema:r,id:i.$id,name:n,onChange:E,onFocus:m,onBlur:p,label:$,hideLabel:!O,value:s,required:a,disabled:l,readonly:f,hideError:u,registry:o,autofocus:d,rawErrors:y,htmlName:i.name})}function Hx(t){return{type:"string",enum:["string","number","boolean","object","array"],default:"string",title:t}}function Yx(t){const e=typeof t;return e==="string"||e==="number"||e==="boolean"?e:e==="object"?Array.isArray(t)?"array":"object":"string"}function Xx(t,e){switch(e){case"string":return String(t);case"number":{const n=Number(t);return isNaN(n)?0:n}case"boolean":return!!t;default:return t}}function Jx(t){const{id:e,formData:n,displayLabel:r=!0,schema:i,name:s,uiSchema:o,required:a,disabled:l=!1,readonly:f=!1,onBlur:u,onFocus:d,registry:h,fieldPathId:g,onChange:m,errorSchema:p}=t,{translateString:y,fields:x,globalFormOptions:S}=h,[j,b]=P.useState(Yx(n)),v=U(o),w=It(Fe("__internal_type_selector",S,g)),O=y(K.Type),A=P.useMemo(()=>Hx(O),[O]),C=_=>{_!=null&&(b(_),m(Xx(n,_),g.path,p,e))};if(!S.useFallbackUiForUnsupportedType){const{reason:_=y(K.UnknownFieldType,[String(i.type)])}=t,F=L("UnsupportedFieldTemplate",h,v);return c.jsx(F,{schema:i,fieldPathId:g,reason:_,registry:h})}const T=L("FallbackFieldTemplate",h,v),{SchemaField:N}=x;return c.jsx(T,{schema:i,registry:h,typeSelector:c.jsx(N,{fieldPathId:w,name:`${s}__fallback_type`,schema:A,formData:j,onChange:C,onBlur:u,onFocus:d,registry:h,hideLabel:!r,disabled:l,readonly:f,required:a},n?ze(n):"__empty__"),schemaField:c.jsx(N,{...t,schema:{type:j,title:y(K.Value),...j==="object"&&{additionalProperties:!0}}})})}function Zx(t,e){return Xt(e,function(n){return t[n]})}function Qx(t){return t==null?[]:Zx(t,Pe(t))}var e0=Math.max;function t0(t,e,n,r){t=Tt(t)?t:Qx(t),n=n?Fa(n):0;var i=t.length;return n<0&&(n=e0(i+n,0)),yt(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&qa(t,e,n)>-1}var n0=Math.min;function r0(t,e,n){for(var r=Bi,i=t[0].length,s=t.length,o=s,a=Array(s),l=1/0,f=[];o--;){var u=t[o];l=n0(u.length,l),a[o]=i>=120&&u.length>=120?new Ot(o&&u):void 0}u=t[0];var d=-1,h=a[0];e:for(;++d<i&&f.length<l;){var g=u[d],m=g;if(g=g!==0?g:0,!(h?vn(h,m):r(f,m))){for(o=s;--o;){var p=a[o];if(!(p?vn(p,m):r(t[o],m)))continue e}h&&h.push(m),f.push(g)}}return f}function i0(t){return Sn(t)?t:[]}var xo=fr(function(t){var e=Xt(t,i0);return e.length&&e[0]===t[0]?r0(e):[]});function Vl(t){return t===void 0}var Ke;(function(t){t.ROW="ui:row",t.COLUMN="ui:col",t.COLUMNS="ui:columns",t.CONDITION="ui:condition"})(Ke||(Ke={}));var pn;(function(t){t.ALL="all",t.SOME="some",t.NONE="none"})(pn||(pn={}));const s0=/^\$lookup=(.+)/,Rr="layoutGrid";function bo(t,e){return t??e}function o0(t){return/^\d+?$/.test(t)}const mt=Yi();function a0(t,e,n,r,i){const s=I(n,[Gr],{}),o=I(n,t),a={...I(o,[ut],{}),...e,...s},l={...o};me(a)||se(l,[ut],a),me(s)||se(l,[Gr],s);let{readonly:f}=U(l);return(i===!0||Vl(f)&&r===!0)&&(f=!0,X(a,Sr)?se(l,[ut,Sr],!0):se(l,`ui:${Sr}`,!0)),{fieldUiSchema:l,uiReadonly:f}}function l0(t,e,n="$0m3tH1nG Un3xP3cT3d"){const r=ti([e]).sort(),i=ti([n]).sort();switch(t){case pn.ALL:return dt(r,i);case pn.SOME:return xo(r,i).length>0;case pn.NONE:return xo(r,i).length===0;default:return!1}}function pr(t,e,n){let r={},i=t[e];if(gt(i)){const{children:s,className:o,...a}=i;if(i=s,o){const f=o.split(" ").map(u=>Zi(n,u,u)).join(" ");r={...a,className:f}}else r=a}if(!Array.isArray(i))throw new TypeError(`Expected array for "${e}" in ${JSON.stringify(t)}`);return{children:i,gridProps:r}}function vo(t,e,n){let r;if(o0(n)&&t&&t?.type==="array"&&X(t,zt)){const i=Number(n),s=t[zt];Array.isArray(s)?i>s.length?r=tl(s):r=s[i]:r=s,e={[oe]:e[oe],path:[...e.path.slice(0,e.path.length-1),i]}}return{rawSchema:r,fieldPathId:e}}function c0(t,e,n,r,i){const{schemaUtils:s,globalFormOptions:o}=t;let a=n,l=i;const f=e.split("."),u=f.pop();let d=s.retrieveSchema(a,r),h=r,g=d.readOnly;f.forEach(y=>{if(l=Fe(y,o,l),X(d,te))a=I(d,[te,y],{});else if(d&&(X(d,q)||X(d,J))){const x=X(d,q)?q:J,S=s.findSelectedOptionInXxxOf(d,y,x,h);a=I(S,[te,y],{})}else{const x=vo(d,l,y);a=x.rawSchema??{},l=x.fieldPathId}h=I(h,y,{}),d=s.retrieveSchema(a,h),g=bo(d.readOnly,g)});let m,p=!1;if(me(d)&&(d=void 0),d&&u){if(d&&(X(d,q)||X(d,J))){const x=X(d,q)?q:J;d=s.findSelectedOptionInXxxOf(d,u,x,h)}l=Fe(u,o,l),p=d!==void 0&&Array.isArray(d.required)&&t0(d.required,u);const y=vo(d,l,u);if(y.rawSchema?(d=y.rawSchema,l=y.fieldPathId):(d=I(d,[te,u]),d=d&&s.retrieveSchema(d)),g=bo(d?.readOnly,g),d&&(X(d,q)||X(d,J))){const x=X(d,q)?q:J,S=Ge(d);m={options:d[x],hasDiscriminator:!!S}}}return{schema:d,isRequired:p,isReadonly:g,optionsInfo:m,fieldPathId:l}}function u0(t,e){let n=t;return yt(n)&&(n=Zi(e,n)),Fn(n)?n:null}function d0(t,e){let n,r=null,i={},s;if(yt(e)||Vl(e))n=e??"";else{const{name:o="",render:a,...l}=e;n=o,i=l,me(i)||kx(i,(f,u)=>{if(yt(f)){const d=s0.exec(f);if(Array.isArray(d)&&d.length>1){const h=d[1];i[u]=Zi(t,h,h)}}}),r=u0(a,t),!o&&r&&(s=c.jsx(r,{...l,"data-testid":mt.uiComponent}))}return{name:n,UIComponent:r,uiProps:i,rendered:s}}function gr(t){const{childrenLayoutGridSchemaId:e,...n}=t,{registry:r,schema:i,formData:s}=n,{schemaUtils:o}=r,a=o.retrieveSchema(i,s);return e.map(l=>P.createElement(ts,{...n,key:`layoutGrid-${ze(l)}`,schema:a,layoutGridSchema:l}))}function f0(t){const{layoutGridSchema:e,...n}=t,{formData:r,registry:i}=n,{children:s,gridProps:o}=pr(e,Ke.CONDITION,i),{operator:a,field:l="",value:f}=o,u=I(r,l,null);return l0(a,u,f)?c.jsx(gr,{...n,childrenLayoutGridSchemaId:s}):null}function m0(t){const{layoutGridSchema:e,...n}=t,{registry:r,uiSchema:i}=n,{children:s,gridProps:o}=pr(e,Ke.COLUMN,r),a=U(i),l=L("GridTemplate",r,a);return c.jsx(l,{column:!0,"data-testid":mt.col,...o,children:c.jsx(gr,{...n,childrenLayoutGridSchemaId:s})})}function h0(t){const{layoutGridSchema:e,...n}=t,{registry:r,uiSchema:i}=n,{children:s,gridProps:o}=pr(e,Ke.COLUMNS,r),a=U(i),l=L("GridTemplate",r,a);return s.map(f=>c.jsx(l,{column:!0,"data-testid":mt.col,...o,children:c.jsx(gr,{...n,childrenLayoutGridSchemaId:[f]})},`column-${ze(f)}`))}function p0(t){const{layoutGridSchema:e,...n}=t,{registry:r,uiSchema:i}=n,{children:s,gridProps:o}=pr(e,Ke.ROW,r),a=U(i),l=L("GridTemplate",r,a);return c.jsx(l,{...o,"data-testid":mt.row,children:c.jsx(gr,{...n,childrenLayoutGridSchemaId:s})})}function g0(t){const{gridSchema:e,schema:n,uiSchema:r,errorSchema:i,fieldPathId:s,onBlur:o,onFocus:a,formData:l,readonly:f,registry:u,layoutGridSchema:d,...h}=t,{onChange:g}=h,{fields:m}=u,{SchemaField:p,LayoutMultiSchemaField:y}=m,x=d0(u,e),{name:S,UIComponent:j,uiProps:b}=x,{schema:v,isRequired:w,isReadonly:O,optionsInfo:A,fieldPathId:C}=c0(u,S,n,l,s),T=It(C);if(x.rendered)return x.rendered;if(v){const N=A?.hasDiscriminator?y:p,{fieldUiSchema:_,uiReadonly:F}=a0(S,b,r,O,f);return c.jsx(N,{"data-testid":A?.hasDiscriminator?mt.layoutMultiSchemaField:mt.field,...h,name:S,required:w,readonly:F,schema:v,uiSchema:_,errorSchema:I(i,S),fieldPathId:T,formData:I(l,S),onChange:g,onBlur:o,onFocus:a,options:A?.options,registry:u})}return j?c.jsx(j,{"data-testid":mt.uiComponent,...h,name:S,required:w,formData:l,readOnly:!!O||f,errorSchema:i,uiSchema:r,schema:n,fieldPathId:s,onBlur:o,onFocus:a,registry:u,...b}):null}function ts(t){const{uiSchema:e}=t;let{layoutGridSchema:n}=t;const r=U(e);if(!n&&Rr in r&&Z(r[Rr])&&(n=r[Rr]),Z(n)){if(Ke.ROW in n)return c.jsx(p0,{...t,layoutGridSchema:n});if(Ke.COLUMN in n)return c.jsx(m0,{...t,layoutGridSchema:n});if(Ke.COLUMNS in n)return c.jsx(h0,{...t,layoutGridSchema:n});if(Ke.CONDITION in n)return c.jsx(f0,{...t,layoutGridSchema:n})}return c.jsx(g0,{...t,gridSchema:n})}ts.TEST_IDS=mt;function y0(t){const{fieldPathId:e,title:n,schema:r,uiSchema:i,required:s,registry:o,name:a}=t,l=U(i,o.globalUiOptions),{title:f}=l,{title:u}=r,d=f||n||u||a;if(!d)return null;const h=L("TitleFieldTemplate",o,l);return c.jsx(h,{id:hr(e),title:d,required:s,schema:r,uiSchema:i,registry:o})}function Br(t,e,n){const r="!@#!@$@#$!@$#";return t.map(({schema:s})=>s).find(s=>{const o=I(s,[te,e]);return I(o,ir,I(o,_e,r))===n})}function So(t,e,n,r,i){const s=e.map(l=>n.retrieveSchema(l,i));let o=t;X(t,q)?o={...t,[q]:s}:X(t,J)&&(o={...t,[J]:s});const a=Gt(o,r);if(!a)throw new Error(`No enumOptions were computed from the schema ${JSON.stringify(o)}`);return a}function x0(t){const{name:e,baseType:n,disabled:r=!1,formData:i,fieldPathId:s,onBlur:o,onChange:a,options:l,onFocus:f,registry:u,uiSchema:d,schema:h,autofocus:g,readonly:m,required:p,errorSchema:y,hideError:x=!1}=t,{widgets:S,schemaUtils:j,globalUiOptions:b}=u,[v,w]=P.useState(So(h,l,j,d,i)),O=I(s,oe),A=Ge(h),C=L("FieldErrorTemplate",u,l),T=L("FieldTemplate",u,l),N=ze(h),_=ze(l),F=d?ze(d):"",$=i?ze(i):"";P.useEffect(()=>{w(So(h,l,j,d,i))},[N,_,j,F,$]);const{widget:E=A?"radio":"select",title:D="",placeholder:M="",optionsSchemaSelector:k=A,hideError:B,...W}=U(d);if(!k)throw new Error("No selector field provided for the LayoutMultiSchemaField");const R=I(i,k);let V=I(v[0]?.schema,[te,k],{});const Q=Br(v,k,R);V=V?.type?V:{...V,type:Q?.type||n};const ne=He(V,E,S),ie=B===void 0?x:!!B,de=I(y,[xe],[]),ee=wn(y,[xe]),z=j.getDisplayLabel(h,d,b),H=je=>{const Se=Br(v,k,je),pe=Br(v,k,R);let Oe=j.sanitizeDataForNewSchema(Se,pe,i);Oe&&Se&&(Oe=j.getDefaultFormState(Se,Oe,"excludeObjectChildren")),Oe&&se(Oe,k,je),a(Oe,s.path,void 0,O)},re={enumOptions:v,...W},fe=!ie&&de.length>0?c.jsx(C,{fieldPathId:s,schema:h,errors:de,registry:u}):void 0;return c.jsx(T,{fieldPathId:s,id:O,schema:h,label:(D||h.title)??"",disabled:r||Array.isArray(v)&&me(v),uiSchema:d,required:p,readonly:!!m,registry:u,displayLabel:z,errors:fe,onChange:a,onKeyRename:Gn,onKeyRenameBlur:Gn,onRemoveProperty:Gn,children:c.jsx(ne,{id:O,name:e,schema:h,label:(D||h.title)??"",disabled:r||Array.isArray(v)&&me(v),uiSchema:d,autofocus:g,readonly:m,required:p,registry:u,multiple:!1,rawErrors:de,hideError:ie,hideLabel:!z,errorSchema:ee,placeholder:M,onChange:H,onBlur:o,onFocus:f,value:R,options:re,htmlName:s.name})})}class wo extends P.Component{constructor(e){super(e);const{formData:n,options:r,registry:{schemaUtils:i}}=this.props,s=r.map(o=>i.retrieveSchema(o,n));this.state={retrievedOptions:s,selectedOption:this.getMatchingOption(0,n,s)}}componentDidUpdate(e,n){const{formData:r,options:i,fieldPathId:s}=this.props,{selectedOption:o}=this.state;let a=this.state;if(!le(e.options,i)){const{registry:{schemaUtils:l}}=this.props,f=i.map(u=>l.retrieveSchema(u,r));a={selectedOption:o,retrievedOptions:f}}if(!le(r,e.formData)&&s.$id===e.fieldPathId.$id){const{retrievedOptions:l}=a,f=this.getMatchingOption(o,r,l);n&&f!==o&&(a={selectedOption:f,retrievedOptions:l})}a!==this.state&&this.setState(a)}getMatchingOption(e,n,r){const{schema:i,registry:{schemaUtils:s}}=this.props,o=Ge(i);return s.getClosestMatchingOption(n,r,e,o)}onOptionChange=e=>{const{selectedOption:n,retrievedOptions:r}=this.state,{formData:i,onChange:s,registry:o,fieldPathId:a}=this.props,{schemaUtils:l}=o,f=e!==void 0?parseInt(e,10):-1;if(f===n)return;const u=f>=0?r[f]:void 0,d=n>=0?r[n]:void 0;let h=l.sanitizeDataForNewSchema(u,d,i);u&&(h=l.getDefaultFormState(u,h,"excludeObjectChildren")),this.setState({selectedOption:f},()=>{s(h,a.path,void 0,this.getFieldId())})};getFieldId(){const{fieldPathId:e,schema:n}=this.props;return`${e.$id}${n.oneOf?"__oneof_select":"__anyof_select"}`}render(){const{name:e,disabled:n=!1,errorSchema:r={},formData:i,onBlur:s,onFocus:o,readonly:a,required:l=!1,registry:f,schema:u,uiSchema:d}=this.props,{widgets:h,fields:g,translateString:m,globalUiOptions:p,schemaUtils:y}=f,{SchemaField:x}=g,S=L("MultiSchemaFieldTemplate",f,p),j=Mn(f,u,l,d),b=Qt(i),{selectedOption:v,retrievedOptions:w}=this.state,{widget:O="select",placeholder:A,autofocus:C,autocomplete:T,title:N=u.title,..._}=U(d,p),F=He({type:"number"},O,h),$=I(r,xe,[]),E=wn(r,[xe]),D=y.getDisplayLabel(u,d,p),M=v>=0&&w[v]||null;let k;if(M){const{required:de}=u;k=de?et({required:de},M):M}let B=[];q in u&&d&&q in d?Array.isArray(d[q])?B=d[q]:console.warn(`uiSchema.oneOf is not an array for "${N||e}"`):J in u&&d&&J in d&&(Array.isArray(d[J])?B=d[J]:console.warn(`uiSchema.anyOf is not an array for "${N||e}"`));let W=d;v>=0&&B.length>v&&(W=B[v]);const R=N?K.TitleOptionPrefix:K.OptionPrefix,V=N?[N]:[],Q=w.map((de,ee)=>{const{title:z=de.title}=U(B[ee]);return{label:z||m(R,V.concat(String(ee+1))),value:ee}}),ne=!j||b?c.jsx(F,{id:this.getFieldId(),name:`${e}${u.oneOf?"__oneof_select":"__anyof_select"}`,schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:s,onFocus:o,disabled:n||me(Q),multiple:!1,rawErrors:$,errorSchema:E,value:v>=0?v:void 0,options:{enumOptions:Q,..._},registry:f,placeholder:A,autocomplete:T,autofocus:C,label:N??e,hideLabel:!D,readonly:a}):void 0,ie=k&&k.type!=="null"&&c.jsx(x,{...this.props,schema:k,uiSchema:W})||null;return c.jsx(S,{schema:u,registry:f,uiSchema:d,selector:ne,optionSchemaField:ie})}}const b0=/\.([0-9]*0)*$/,v0=/[0.]0*$/;function S0(t){const{registry:e,onChange:n,formData:r,value:i}=t,[s,o]=P.useState(i),{StringField:a}=e.fields;let l=r;const f=P.useCallback((u,d,h,g)=>{o(u),`${u}`.charAt(0)==="."&&(u=`0${u}`);const m=typeof u=="string"&&u.match(b0)?bs(u.replace(v0,"")):bs(u);n(m,d,h,g)},[n]);if(typeof s=="string"&&typeof l=="number"){const u=new RegExp(`^(${String(l).replace(".","\\.")})?\\.?0*$`);s.match(u)&&(l=s)}return c.jsx(a,{...t,formData:l,onChange:f})}function Ve(){return Ve=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ve.apply(null,arguments)}const Ln=["strong","em","del","mark"],jo=[["**",Ln[0]],["__",Ln[0]],["~~",Ln[2]],["==",Ln[3]],["*","em"],["_","em"]];function w0(t,e){for(var n=1,r=e+1;r<t.length&&n>0;)t[r]!=="\\"?(t[r]==="["&&n++,t[r]==="]"&&n--,r++):r+=2;if(n===0&&r<t.length&&(t[r]==="("||t[r]==="[")){var i=t[r]==="("?")":"]",s=1;for(r++;r<t.length&&s>0;)t[r]!=="\\"?(t[r]==="("&&i===")"&&s++,t[r]===i&&s--,r++):r+=2;if(s===0)return r}return-1}function j0(t,e){if(!e||!e.inline&&!e.simple)return null;var n=t[0];if(n!=="*"&&n!=="_"&&n!=="~"&&n!=="=")return null;for(var r="",i=0,s="",o=0;o<6;o++){var a=jo[o][0];if(t.startsWith(a)&&t.length>=2*a.length){r=a,i=a.length,s=jo[o][1];break}}if(!r)return null;for(var l=i,f=!1,u=!1,d="",h=0,g="",m=!1,p="";l<t.length;){var y=t[l];if(m)g+=y,m=!1,p=y,l++;else if(y!=="\\")if(y!=="`"||h!==0){if(y==="["&&!f&&h===0){var x=w0(t,l);if(x!==-1){g+=t.slice(l,x),l=x,p=t[x-1];continue}}if(u)g+=y,d?y===d&&(d=""):y==='"'||y==="'"?d=y:y===">"&&(u=!1),p=y,l++;else if(y!=="<"||f){if(y===`
|
|
3
3
|
`&&p===`
|
|
4
4
|
`&&!f&&h===0)return null;if(!f&&h===0){for(var S=0;l+S<t.length&&t[l+S]===r[0];)S++;if(S>=i&&(i!==1||r!=="*"&&r!=="_"||t[l-1]!==r&&t[l+1]!==r)){var j=[t.slice(0,l+S),s,g+t.slice(l+i,l+S)];return j.index=0,j.input=t,j}}g+=y,p=y,l++}else{var b=t[l+1],v=t.indexOf(">",l);if(v!==-1){var w=t.slice(l,v+1).endsWith("/>");b==="/"?h=Math.max(0,h-1):w||h++}u=!0,g+=y,p=y,l++}}else f=!f,g+=y,p=y,l++;else g+=y,m=!0,p=y,l++}return null}const O0=["children","options"],Oo=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((t,e)=>(t[e.toLowerCase()]=e,t),{class:"className",for:"htmlFor"}),Ao={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},A0=["style","script","pre"],C0=["src","href","data","formAction","srcDoc","action"],_0=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,N0=/\n{2,}$/,Co=/^(\s*>[\s\S]*?)(?=\n\n|$)/,T0=/^ *> ?/gm,F0=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,P0=/^ {2,}\n/,E0=/^(?:([-*_])( *\1){2,}) *(?:\n *)+\n/,_o=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,No=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,I0=/^(`+)((?:\\`|(?!\1)`|[^`])+)\1/,D0=/^(?:\n *)*\n/,$0=/\r\n?/g,k0=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,M0=/^\[\^([^\]]+)]/,R0=/\f/g,B0=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,U0=/^\[(x|\s)\]/,To=/^(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,Fo=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,Po=/^([^\n]+)\n *(=|-)\2{2,} *\n/,ns=/^<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>/i;function L0(t){const e=ns.exec(t);if(!e)return null;const n=e[1],r=n.toLowerCase(),i=r.length+1;let s=e[0].length;t[s]===`
|
|
@@ -22,4 +22,4 @@ import{ar as Tc,c as ve,K as di,v as Fc,j as c,f as Go,M as Pc,as as us,u as Ec,
|
|
|
22
22
|
`))return null;let y="",x=0;for(;;){const j=m.indexOf(`
|
|
23
23
|
`,x),b=m.slice(x,j===-1?void 0:j+1),v=m[x];if((v===">"||v==="#"||v==="|"||v==="`"||v==="~"||v==="*"||v==="-"||v==="_"||v===" ")&&Bo(s,b)||(y+=b,j===-1||!b.trim()))break;x=j+1}const S=gn(y);return S===""?null:[y,,S]}),u:3,i:Ob},22:{t:["["],o:st(Y0),u:0,i:m=>(u[m[1]]={target:m[2],title:m[4]},{})},23:{t:["!["],o:Vn(X0),u:0,i:m=>({alt:m[1]?Ue(m[1]):void 0,ref:m[2]})},24:{t:m=>m[0]==="["&&!$e(m,"]("),o:st(J0),u:0,i:(m,p,y)=>({children:p(m[1],y),fallbackChildren:m[0],ref:m[2]})},25:{t:["|"],o:Ze(Io),u:1,i:bb},27:{o:ct(function(m,p){let y;return ai(m,":")&&(y=ib.exec(m)),y||ab.exec(m)}),u:4,i(m){const p=m[0];return{text:$e(p,"&")?p.replace(V0,(y,x)=>e.namedCodesToUnicode[x]||y):p}}},34:{t:["*","_","~","="],o:ct(j0),u:2,i:(m,p,y)=>({children:p(m[2],y),tag:m[1]})},28:{t:["\\"],o:Vn(sb),u:1,i:m=>({text:m[1],type:"27"})}};e.disableParsingRawHTML===!0&&(delete d[11],delete d[13]);const h=(function(m){var p=Object.keys(m);function y(x,S){var j=[];if(S.prevCapture=S.prevCapture||"",x.trim())for(;x;)for(var b=0;b<p.length;){var v=p[b],w=m[v];if(!w.t||yb(x,S,w.t)){var O=w.o(x,S);if(O&&O[0]){x=x.substring(O[0].length);var A=w.i(O,y,S);S.prevCapture+=O[0],A.type||(A.type=v),j.push(A);break}b++}else b++}return S.prevCapture="",j}return p.sort(function(x,S){return m[x].u-m[S].u||(x<S?-1:1)}),function(x,S){return y((function(j){return j.replace($0,`
|
|
24
24
|
`).replace(R0,"").replace(Q0," ")})(x),S)}})(d),g=(function(m,p,y,x,S){function j(b){return Array.isArray(b)?b.map(v=>"text"in v?v.text:""):"text"in b?b.text:""}return function b(v,w={}){const O=(w.renderDepth||0)+1;if(O>2500)return j(v);w.renderDepth=O;try{if(Array.isArray(v)){const C=w.key,T=[];let N=!1;for(let _=0;_<v.length;_++){w.key=_;const F=b(v[_],w),$=$o(F);$&&N?T[T.length-1]+=F:F!==null&&T.push(F),N=$}return w.key=C,w.renderDepth=O-1,T}const A=(function(C,T,N){const _=()=>(function(F,$,E,D,M,k,B){switch(F.type){case"0":{const W={key:E.key};return F.alert&&(W.className="markdown-alert-"+k(F.alert.toLowerCase(),ln),F.children.unshift({attrs:{},children:[{type:"27",text:F.alert}],noInnerParse:!0,type:"11",tag:"header"})),D("blockquote",W,$(F.children,E))}case"1":return D("br",{key:E.key});case"2":return D("hr",{key:E.key});case"3":return D("pre",{key:E.key},D("code",Ve({},F.attrs,{className:F.lang?"lang-"+F.lang:""}),F.text));case"5":return D("code",{key:E.key},F.text);case"7":return D("a",{key:E.key,href:M(F.target,"a","href")},D("sup",{key:E.key},F.text));case"8":return D("input",{checked:F.completed,key:E.key,readOnly:!0,type:"checkbox"});case"9":return D("h"+F.level,{id:F.id,key:E.key},$(F.children,E));case"11":return D(F.tag,Ve({key:E.key},F.attrs),F.text||(F.children?$(F.children,E):""));case"13":return D(F.tag,Ve({},F.attrs,{key:E.key}));case"14":return D("img",{key:E.key,alt:F.alt||void 0,title:F.title||void 0,src:M(F.target,"img","src")});case"15":return D("a",{key:E.key,href:M(F.target,"a","href"),title:F.title},$(F.children,E));case"23":return B[F.ref]?D("img",{key:E.key,alt:F.alt,src:M(B[F.ref].target,"img","src"),title:B[F.ref].title}):null;case"24":return B[F.ref]?D("a",{key:E.key,href:M(B[F.ref].target,"a","href"),title:B[F.ref].title},$(F.children,E)):D("span",{key:E.key},F.fallbackChildren);case"25":{const W=F;return D("table",{key:E.key},D("thead",null,D("tr",null,W.header.map(function(R,V){return D("th",{key:V,style:Mo(W,V)},$(R,E))}))),D("tbody",null,W.cells.map(function(R,V){return D("tr",{key:V},R.map(function(Q,ne){return D("td",{key:ne,style:Mo(W,ne)},$(Q,E))}))})))}case"27":return F.text;case"34":return D(F.tag,{key:E.key},$(F.children,E));case"20":case"30":return D(F.ordered?"ol":"ul",{key:E.key,start:F.type==="20"?F.start:void 0},F.items.map(function(W,R){return D("li",{key:R},$(W,E))}));case"19":return`
|
|
25
|
-
`;case"21":return D("p",{key:E.key},$(F.children,E));default:return null}})(C,T,N,p,y,x,S);return m?m(_,C,T,N):_()})(v,b,w);return w.renderDepth=O-1,A}catch(A){if(A instanceof RangeError&&A.message.includes("Maximum call stack"))return j(v);throw A}}})(e.renderRule,a,r,n,u);return l(t)}const Rn=t=>{let{children:e,options:n}=t,r=(function(i,s){if(i==null)return{};var o={};for(var a in i)if({}.hasOwnProperty.call(i,a)){if(s.indexOf(a)!==-1)continue;o[a]=i[a]}return o})(t,O0);return Cb(e??"",Ve({},n,{wrapperProps:Ve({},n?.wrapperProps,r)}))},Jl=Symbol("remove-this-key"),Uo=Symbol("reset");function _b(t,e){return Array.isArray(t.required)&&t.required.indexOf(e)!==-1}function Nb(t,e){switch(e){case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{};default:return t(K.NewStringDefault)}}function Tb(t){const{fieldPathId:e,schema:n,registry:r,uiSchema:i,errorSchema:s,formData:o,onChange:a,onBlur:l,onFocus:f,disabled:u,readonly:d,required:h,hideError:g,propertyName:m,handleKeyRename:p,handleRemoveProperty:y,addedByAdditionalProperties:x}=t,[S,j]=P.useState(!1),{globalFormOptions:b,fields:v}=r,{SchemaField:w}=v,O=It(Fe(m,b,e.path)),A=P.useCallback((_,F,$,E)=>{_===void 0&&x&&(_=""),a(_,F,$,E)},[a,x]),C=P.useCallback(_=>{m!==_&&j(!0),p(m,_)},[m,p]),T=P.useCallback(_=>{const{target:{value:F}}=_;C(F)},[C]),N=P.useCallback(()=>{y(m)},[m,y]);return c.jsx(w,{name:m,required:h,schema:n,uiSchema:i,errorSchema:s,fieldPathId:O,formData:o,wasPropertyKeyModified:S,onKeyRename:C,onKeyRenameBlur:T,onRemoveProperty:N,onChange:A,onBlur:l,onFocus:f,registry:r,disabled:u,readonly:d,hideError:g})}function Fb(t){const{schema:e,uiSchema:n={},formData:r,errorSchema:i,fieldPathId:s,name:o,required:a=!1,disabled:l,readonly:f,hideError:u,onBlur:d,onFocus:h,onChange:g,registry:m,title:p}=t,{fields:y,schemaUtils:x,translateString:S,globalUiOptions:j}=m,{OptionalDataControlsField:b}=y,v=x.retrieveSchema(e,r,!0),w=U(n,j),{properties:O={}}=v,A=t.childFieldPathId??s,C=w.title??v.title??p??o,T=w.description??v.description,N=Mn(m,v,a,n),_=Qt(r);let F=[];const $=P.useCallback((R,V)=>{const{duplicateKeySuffixSeparator:Q="-"}=U(n,j);let ne=0,ie=R;for(;X(V,ie);)ie=`${R}${Q}${++ne}`;return ie},[n,j]),E=P.useCallback(()=>{if(!(v.additionalProperties||v.patternProperties))return;const{translateString:R}=m,V={...r},Q=$("newKey",V);if(v.patternProperties)se(V,Q,null);else{let ne,ie,de;if(Z(v.additionalProperties)){ne=v.additionalProperties.type,ie=v.additionalProperties.const,de=v.additionalProperties.default;let z=v.additionalProperties;if(ce in z){const{schemaUtils:H}=m;z=H.retrieveSchema({[ce]:z[ce]},r),ne=z.type,ie=z.const,de=z.default}!ne&&(J in z||q in z)&&(ne="object")}const ee=ie??de??Nb(R,ne);se(V,Q,ee)}g(V,A.path)},[r,g,m,A,$,v]),D=P.useCallback((R,V)=>{if(R!==V){const Q=$(V,r),ne={...r},ie={[R]:Q},de=Object.keys(ne).map(z=>({[ie[z]||z]:ne[z]})),ee=Object.assign({},...de);g(ee,A.path)}},[r,g,A,$]),M=P.useCallback(R=>{g(Jl,[...A.path,R])},[g,A]);if(!N||_)try{const R=Object.keys(O);F=Ox(R,w.order)}catch(R){return c.jsxs("div",{children:[c.jsx("p",{className:"rjsf-config-error",style:{color:"red"},children:c.jsx(Rn,{options:{disableParsingRawHTML:!0},children:S(K.InvalidObjectField,[o||"root",R.message])})}),c.jsx("pre",{children:JSON.stringify(v)})]})}const k=L("ObjectFieldTemplate",m,w),B=N?c.jsx(b,{...t,fieldPathId:A,schema:v}):void 0,W={title:w.label===!1?"":C,description:w.label===!1?void 0:T,properties:F.map(R=>{const V=X(v,[te,R,Qe]),Q=V?n.additionalProperties:n[R],ne=U(Q).widget==="hidden";return{content:c.jsx(Tb,{propertyName:R,required:_b(v,R),schema:I(v,[te,R],{}),uiSchema:Q,errorSchema:I(i,[R]),fieldPathId:A,formData:I(r,[R]),handleKeyRename:D,handleRemoveProperty:M,addedByAdditionalProperties:V,onChange:g,onBlur:d,onFocus:h,registry:m,disabled:l,readonly:f,hideError:u},R),name:R,readonly:f,disabled:l,required:a,hidden:ne}}),readonly:f,disabled:l,required:a,fieldPathId:s,uiSchema:n,errorSchema:i,schema:v,formData:r,registry:m,optionalDataControl:B,className:N?"rjsf-optional-object-field":void 0};return c.jsx(k,{...W,onAddProperty:E})}function Pb(t){const{schema:e,uiSchema:n={},formData:r,disabled:i=!1,readonly:s=!1,onChange:o,errorSchema:a,fieldPathId:l,registry:f}=t,{globalUiOptions:u={},schemaUtils:d,translateString:h}=f,g=U(n,u),m=L("OptionalDataControlsTemplate",f,g),p=Qt(r);let y,x,S,j;if(i||s)y=kr(l,"Msg"),x=p?void 0:h(K.OptionalObjectEmptyMsg);else{const b=p?K.OptionalObjectRemove:K.OptionalObjectAdd;x=h(b),p?(y=kr(l,"Remove"),j=()=>o(void 0,l.path,a)):(y=kr(l,"Add"),S=()=>{let v=d.getDefaultFormState(e,r,"excludeObjectChildren");v===void 0&&(v=Ie(e)==="array"?[]:{}),o(v,l.path,a)})}return x&&c.jsx(m,{id:y,registry:f,schema:e,uiSchema:n,label:x,onAddClick:S,onRemoveClick:j})}const Eb={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function Ib(t,e,n){const r=e.field,{fields:i}=n;if(typeof r=="function")return r;if(typeof r=="string"&&r in i)return i[r];const s=Ie(t),o=Array.isArray(s)?s[0]:s||"",a=t.$id;let l=Eb[o];return a&&a in i&&(l=a),!l&&(t.anyOf||t.oneOf)?()=>null:l in i?i[l]:i.FallbackField}function Db(t){const{schema:e,fieldPathId:n,uiSchema:r,formData:i,errorSchema:s,name:o,onChange:a,onKeyRename:l,onKeyRenameBlur:f,onRemoveProperty:u,required:d=!1,registry:h,wasPropertyKeyModified:g=!1}=t,{schemaUtils:m,globalFormOptions:p,globalUiOptions:y,fields:x}=h,{AnyOfField:S,OneOfField:j}=x,b=U(r,y),v=L("FieldTemplate",h,b),w=L("DescriptionFieldTemplate",h,b),O=L("FieldHelpTemplate",h,b),A=L("FieldErrorTemplate",h,b),C=m.retrieveSchema(e,i),T=n[oe],N=P.useCallback((De,nn,Je,Nc)=>a(De,nn,Je,Nc||T),[T,a]),_=Ib(C,b,h),F=!!(b.disabled??t.disabled),$=!!(b.readonly??(t.readonly||t.schema.readOnly||C.readOnly)),E=b.hideError,D=E===void 0?t.hideError:!!E,M=!!(b.autofocus??t.autofocus);if(Object.keys(C).length===0)return null;let k=m.getDisplayLabel(C,r,y);const B=b.field&&b.fieldReplacesAnyOrOneOf===!0;let W,R,V={fieldPathId:n};if((J in C||q in C)&&!B&&!m.isSelect(C)){C[J]?(W=S,R=C[J].map(Je=>m.retrieveSchema(Z(Je)?Je:{},i))):C[q]&&(W=j,R=C[q].map(Je=>m.retrieveSchema(Z(Je)?Je:{},i)));const De=Mn(h,C,d,r),nn=Qt(i);k=k&&(!De||nn),V={childFieldPathId:n,fieldPathId:Fe("XxxOf",p,n)}}const{__errors:Q,...ne}=s||{},ie=wn(r,["ui:classNames","classNames","ui:style"]);ut in ie&&(ie[ut]=wn(ie[ut],["classNames","style"]));const de=c.jsx(_,{...t,onChange:N,...V,schema:C,uiSchema:ie,disabled:F,readonly:$,hideError:D,autofocus:M,errorSchema:ne,rawErrors:Q}),ee=n[oe];let z;g?z=o:z=Qe in C?o:b.title||t.schema.title||C.title||t.title||o;const H=b.description||t.schema.description||C.description||"",re=b.help,fe=b.widget==="hidden",je=["rjsf-field",`rjsf-field-${Ie(C)}`];!D&&Q&&Q.length>0&&je.push("rjsf-field-error"),b.classNames&&je.push(b.classNames);const Se=c.jsx(O,{help:re,fieldPathId:n,schema:C,uiSchema:r,hasErrors:!D&&Q&&Q.length>0,registry:h}),pe=D||W&&!m.isSelect(C)?void 0:c.jsx(A,{errors:Q,errorSchema:s,fieldPathId:n,schema:C,uiSchema:r,registry:h}),Oe={description:c.jsx(w,{id:Et(ee),description:H,schema:C,uiSchema:r,registry:h}),rawDescription:H,help:Se,rawHelp:typeof re=="string"?re:void 0,errors:pe,rawErrors:D?void 0:Q,fieldPathId:n,id:ee,label:z,hidden:fe,onChange:a,onKeyRename:l,onKeyRenameBlur:f,onRemoveProperty:u,required:d,disabled:F,readonly:$,hideError:D,displayLabel:k,classNames:je.join(" ").trim(),style:b.style,formData:i,schema:C,uiSchema:r,registry:h};return c.jsx(v,{...Oe,children:c.jsxs(c.Fragment,{children:[de,W&&c.jsx(W,{name:o,disabled:F,readonly:$,hideError:D,errorSchema:s,formData:i,fieldPathId:n,onBlur:t.onBlur,onChange:t.onChange,onFocus:t.onFocus,options:R,registry:h,required:d,schema:C,uiSchema:r})]})})}class $b extends P.Component{shouldComponentUpdate(e){const{registry:{globalFormOptions:n}}=this.props,{experimental_componentUpdateStrategy:r="customDeep"}=n;return $l(this,e,this.state,r)}render(){return c.jsx(Db,{...this.props})}}function kb(t){const{schema:e,name:n,uiSchema:r,fieldPathId:i,formData:s,required:o,disabled:a=!1,readonly:l=!1,autofocus:f=!1,onChange:u,onBlur:d,onFocus:h,registry:g,rawErrors:m,hideError:p,title:y}=t,{title:x,format:S}=e,{widgets:j,schemaUtils:b,globalUiOptions:v}=g,w=b.isSelect(e)?Gt(e,r):void 0;let O=w?"select":"text";S&&Sx(e,S,j)&&(O=S);const{widget:A=O,placeholder:C="",title:T,...N}=U(r),_=b.getDisplayLabel(e,r,v),F=T??y??x??n,$=He(e,A,j),E=P.useCallback((D,M,k)=>u(D,i.path,M,k),[u,i]);return c.jsx($,{options:{...N,enumOptions:w},schema:e,uiSchema:r,id:i.$id,name:n,label:F,hideLabel:!_,hideError:p,value:s,onChange:E,onBlur:d,onFocus:h,required:o,disabled:a,readonly:l,autofocus:f,registry:g,placeholder:C,rawErrors:m,htmlName:i.name})}function Mb(t){const{formData:e,onChange:n,fieldPathId:r}=t;return P.useEffect(()=>{e===void 0&&n(null,r.path)},[r,e,n]),null}function Rb(){return{AnyOfField:wo,ArrayField:Kx,BooleanField:Gx,FallbackField:Jx,LayoutGridField:ts,LayoutHeaderField:y0,LayoutMultiSchemaField:x0,NumberField:S0,ObjectField:Fb,OneOfField:wo,OptionalDataControlsField:Pb,SchemaField:$b,StringField:kb,NullField:Mb}}function Bb(t){const{fieldPathId:e,description:n,registry:r,schema:i,uiSchema:s}=t,o=U(s,r.globalUiOptions),{label:a=!0}=o;if(!n||!a)return null;const l=L("DescriptionFieldTemplate",r,o);return c.jsx(l,{id:Et(e),description:n,schema:i,uiSchema:s,registry:r})}function Ub(t){const{children:e,className:n,buttonsProps:r,displayLabel:i,hasDescription:s,hasToolbar:o,registry:a,uiSchema:l}=t,f=U(l),u=L("ArrayFieldItemButtonsTemplate",a,f),d={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"},h=s?31:9,g={display:"flex",alignItems:i?"center":"baseline"},m={display:"flex",justifyContent:"flex-end",marginTop:i?`${h}px`:0};return c.jsxs("div",{className:n,style:g,children:[c.jsx("div",{className:o?"col-xs-9 col-md-10 col-xl-11":"col-xs-12",children:e}),o&&c.jsx("div",{className:"col-xs-3 col-md-2 col-xl-1 array-item-toolbox",children:c.jsx("div",{className:"btn-group",style:m,children:c.jsx(u,{...r,style:d})})})]})}function Lb(t){const{disabled:e,hasCopy:n,hasMoveDown:r,hasMoveUp:i,hasRemove:s,fieldPathId:o,onCopyItem:a,onRemoveItem:l,onMoveDownItem:f,onMoveUpItem:u,readonly:d,registry:h,uiSchema:g}=t,{CopyButton:m,MoveDownButton:p,MoveUpButton:y,RemoveButton:x}=h.templates.ButtonTemplates;return c.jsxs(c.Fragment,{children:[(i||r)&&c.jsx(y,{id:qe(o,"moveUp"),className:"rjsf-array-item-move-up",disabled:e||d||!i,onClick:u,uiSchema:g,registry:h}),(i||r)&&c.jsx(p,{id:qe(o,"moveDown"),className:"rjsf-array-item-move-down",disabled:e||d||!r,onClick:f,uiSchema:g,registry:h}),n&&c.jsx(m,{id:qe(o,"copy"),className:"rjsf-array-item-copy",disabled:e||d,onClick:a,uiSchema:g,registry:h}),s&&c.jsx(x,{id:qe(o,"remove"),className:"rjsf-array-item-remove",disabled:e||d,onClick:l,uiSchema:g,registry:h})]})}function Vb(t){const{canAdd:e,className:n,disabled:r,fieldPathId:i,uiSchema:s,items:o,optionalDataControl:a,onAddClick:l,readonly:f,registry:u,required:d,schema:h,title:g}=t,m=U(s),p=L("ArrayFieldDescriptionTemplate",u,m),y=L("ArrayFieldTitleTemplate",u,m),x=!f&&!r,{ButtonTemplates:{AddButton:S}}=u.templates;return c.jsxs("fieldset",{className:n,id:i.$id,children:[c.jsx(y,{fieldPathId:i,title:m.title||g,required:d,schema:h,uiSchema:s,registry:u,optionalDataControl:x?a:void 0}),c.jsx(p,{fieldPathId:i,description:m.description||h.description,schema:h,uiSchema:s,registry:u}),x?void 0:a,c.jsx("div",{className:"row array-item-list",children:o}),e&&c.jsx(S,{id:qe(i,"add"),className:"rjsf-array-item-add",onClick:l,disabled:r||f,uiSchema:s,registry:u})]})}function Wb(t){const{fieldPathId:e,title:n,schema:r,uiSchema:i,required:s,registry:o,optionalDataControl:a}=t,l=U(i,o.globalUiOptions),{label:f=!0}=l;if(!n||!f)return null;const u=L("TitleFieldTemplate",o,l);return c.jsx(u,{id:hr(e),title:n,required:s,schema:r,uiSchema:i,registry:o,optionalDataControl:a})}function zb(t){const{id:e,name:n,htmlName:r,value:i,readonly:s,disabled:o,autofocus:a,onBlur:l,onFocus:f,onChange:u,onChangeOverride:d,options:h,schema:g,uiSchema:m,registry:p,rawErrors:y,type:x,hideLabel:S,hideError:j,...b}=t,{ClearButton:v}=p.templates.ButtonTemplates;if(!e)throw console.log("No id for",t),new Error(`no id for props ${JSON.stringify(t)}`);const w={...b,...Pl(g,x,h)};let O;w.type==="number"||w.type==="integer"?O=i||i===0?i:"":O=i??"";const A=P.useCallback(({target:{value:_}})=>u(_===""?h.emptyValue:_),[u,h]),C=P.useCallback(({target:_})=>l(e,_&&_.value),[l,e]),T=P.useCallback(({target:_})=>f(e,_&&_.value),[f,e]),N=P.useCallback(_=>{_.preventDefault(),_.stopPropagation(),u(h.emptyValue??"")},[u,h.emptyValue]);return c.jsxs(c.Fragment,{children:[c.jsx("input",{id:e,name:r||e,className:"form-control",readOnly:s,disabled:o,autoFocus:a,value:O,...w,list:g.examples?_n(e):void 0,onChange:d||A,onBlur:C,onFocus:T,"aria-describedby":we(e,!!g.examples)}),h.allowClearTextInputs&&!s&&!o&&O&&c.jsx(v,{registry:p,onClick:N}),Array.isArray(g.examples)&&c.jsx("datalist",{id:_n(e),children:g.examples.concat(g.default&&!g.examples.includes(g.default)?[g.default]:[]).map(_=>c.jsx("option",{value:_},_))},`datalist_${e}`)]})}function qb({uiSchema:t}){const{submitText:e,norender:n,props:r={}}=El(t);return n?null:c.jsx("div",{children:c.jsx("button",{type:"submit",...r,className:`btn btn-info ${r.className||""}`,children:e})})}function xt(t){const{iconType:e="default",icon:n,className:r,uiSchema:i,registry:s,...o}=t;return c.jsx("button",{type:"button",className:`btn btn-${e} ${r}`,...o,children:c.jsx("i",{className:`glyphicon glyphicon-${n}`})})}function Kb(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.CopyButton),...t,icon:"copy"})}function Gb(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.MoveDownButton),...t,icon:"arrow-down"})}function Hb(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.MoveUpButton),...t,icon:"arrow-up"})}function Yb(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.RemoveButton),...t,iconType:"danger",icon:"remove"})}function Xb({id:t,className:e,onClick:n,disabled:r,registry:i,...s}){const{translateString:o}=i;return c.jsx(xt,{id:t,iconType:"default",icon:"remove",className:"btn-clear col-xs-12",title:o(K.ClearButton),onClick:n,disabled:r,registry:i,...s})}function Jb({id:t,className:e,onClick:n,disabled:r,registry:i}){const{translateString:s}=i;return c.jsx("div",{className:"row",children:c.jsx("p",{className:`col-xs-4 col-sm-2 col-lg-1 col-xs-offset-8 col-sm-offset-10 col-lg-offset-11 text-right ${e}`,children:c.jsx(xt,{id:t,iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:s(K.AddButton),onClick:n,disabled:r,registry:i})})})}function Zb(){return{SubmitButton:qb,AddButton:Jb,CopyButton:Kb,MoveDownButton:Gb,MoveUpButton:Hb,RemoveButton:Yb,ClearButton:Xb}}const Zl=Yi();function ss({description:t,registry:e,uiSchema:n={}}){const{globalUiOptions:r}=e;return U(n,r).enableMarkdownInDescription&&typeof t=="string"?c.jsx(Rn,{options:{disableParsingRawHTML:!0},"data-testid":Zl.markdown,children:t}):t}ss.TEST_IDS=Zl;function Qb(t){const{id:e,description:n,registry:r,uiSchema:i}=t;return n?c.jsx("div",{id:e,className:"field-description",children:c.jsx(ss,{description:n,registry:r,uiSchema:i})}):null}function ev({errors:t,registry:e}){const{translateString:n}=e;return c.jsxs("div",{className:"panel panel-danger errors",children:[c.jsx("div",{className:"panel-heading",children:c.jsx("h3",{className:"panel-title",children:n(K.ErrorsLabel)})}),c.jsx("ul",{className:"list-group",children:t.map((r,i)=>c.jsx("li",{className:"list-group-item text-danger",children:r.stack},i))})]})}function tv(t){const{schema:e,registry:n,typeSelector:r,schemaField:i}=t,s=L("MultiSchemaFieldTemplate",n);return c.jsx(s,{selector:r,optionSchemaField:i,schema:e,registry:n})}const nv="*";function Ql(t){const{label:e,required:n,id:r}=t;return e?c.jsxs("label",{className:"control-label",htmlFor:r,children:[e,n&&c.jsx("span",{className:"required",children:nv})]}):null}function rv(t){const{id:e,label:n,children:r,errors:i,help:s,description:o,hidden:a,required:l,displayLabel:f,registry:u,uiSchema:d}=t,h=U(d),g=L("WrapIfAdditionalTemplate",u,h);if(a)return c.jsx("div",{className:"hidden",children:r});const m=h.widget==="checkbox";return c.jsxs(g,{...t,children:[f&&!m&&c.jsx(Ql,{label:n,required:l,id:e}),f&&o?o:null,r,i,s]})}function iv(t){const{errors:e=[],fieldPathId:n}=t;if(e.length===0)return null;const r=Xi(n);return c.jsx("div",{children:c.jsx("ul",{id:r,className:"error-detail bs-callout bs-callout-info",children:e.filter(i=>!!i).map((i,s)=>c.jsx("li",{className:"text-danger",children:i},s))})})}const ec=Yi();function os({help:t,registry:e,uiSchema:n={}}){const{globalUiOptions:r}=e;return U(n,r).enableMarkdownInHelp&&typeof t=="string"?c.jsx(Rn,{options:{disableParsingRawHTML:!0},"data-testid":ec.markdown,children:t}):t}os.TEST_IDS=ec;function sv(t){const{fieldPathId:e,help:n,uiSchema:r,registry:i}=t;return n?c.jsx("div",{id:Ji(e),className:"help-block",children:c.jsx(os,{help:n,registry:i,uiSchema:r})}):null}function ov(t){const{children:e,column:n,className:r,...i}=t;return c.jsx("div",{className:r,...i,children:e})}function av(t){const{selector:e,optionSchemaField:n}=t;return c.jsxs("div",{className:"panel panel-default panel-body",children:[c.jsx("div",{className:"form-group",children:e}),n]})}function lv(t){const{className:e,description:n,disabled:r,formData:i,fieldPathId:s,onAddProperty:o,optionalDataControl:a,properties:l,readonly:f,registry:u,required:d,schema:h,title:g,uiSchema:m}=t,p=U(m),y=L("TitleFieldTemplate",u,p),x=L("DescriptionFieldTemplate",u,p);if((h.oneOf||h.anyOf)&&!h.properties&&l.length===0)return null;const j=!f&&!r,{ButtonTemplates:{AddButton:b}}=u.templates;return c.jsxs("fieldset",{className:e,id:s.$id,children:[g&&c.jsx(y,{id:hr(s),title:g,required:d,schema:h,uiSchema:m,registry:u,optionalDataControl:j?a:void 0}),n&&c.jsx(x,{id:Et(s),description:n,schema:h,uiSchema:m,registry:u}),j?void 0:a,l.map(v=>v.content),fa(h,m,i)&&c.jsx(b,{id:qe(s,"add"),className:"rjsf-object-property-expand",onClick:o,disabled:r||f,uiSchema:m,registry:u})]})}function cv(t){const{id:e,registry:n,label:r,onAddClick:i,onRemoveClick:s}=t;return i?c.jsx(xt,{id:e,registry:n,icon:"plus",className:"rjsf-add-optional-data btn-sm",onClick:i,title:r}):s?c.jsx(xt,{id:e,registry:n,icon:"remove",className:"rjsf-remove-optional-data btn-sm",onClick:s,title:r}):c.jsx("em",{id:e,children:r})}const uv="*";function dv(t){const{id:e,title:n,required:r,optionalDataControl:i}=t;return c.jsxs("legend",{id:e,children:[n,r&&c.jsx("span",{className:"required",children:uv}),i&&c.jsx("span",{className:"pull-right",style:{marginBottom:"2px"},children:i})]})}function fv(t){const{schema:e,fieldPathId:n,reason:r,registry:i}=t,{translateString:s}=i;let o=K.UnsupportedField;const a=[];return n&&n.$id&&(o=K.UnsupportedFieldWithId,a.push(n.$id)),r&&(o=o===K.UnsupportedField?K.UnsupportedFieldWithReason:K.UnsupportedFieldWithIdAndReason,a.push(r)),c.jsxs("div",{className:"unsupported-field",children:[c.jsx("p",{children:c.jsx(Rn,{options:{disableParsingRawHTML:!0},children:s(o,a)})}),e&&c.jsx("pre",{children:JSON.stringify(e,null,2)})]})}function mv(t){const{id:e,classNames:n,style:r,disabled:i,displayLabel:s,label:o,onKeyRenameBlur:a,onRemoveProperty:l,rawDescription:f,readonly:u,required:d,schema:h,hideError:g,rawErrors:m,children:p,uiSchema:y,registry:x}=t,{templates:S,translateString:j}=x,{RemoveButton:b}=S.ButtonTemplates,v=j(K.KeyLabel,[o]),w=Qe in h,O=!!f,A=["form-group",n];!g&&m&&m.length>0&&A.push("has-error has-danger");const C=A.join(" ").trim();if(!w)return c.jsx("div",{className:C,style:r,children:p});const T=O?46:26;return c.jsx("div",{className:C,style:r,children:c.jsxs("div",{className:"row",children:[c.jsx("div",{className:"col-xs-5 form-additional",children:c.jsxs("div",{className:"form-group",children:[s&&c.jsx(Ql,{label:v,required:d,id:`${e}-key`}),s&&f&&c.jsx("div",{children:" "}),c.jsx("input",{className:"form-control",type:"text",id:`${e}-key`,onBlur:a,defaultValue:o})]})}),c.jsx("div",{className:"form-additional form-group col-xs-5",children:p}),c.jsx("div",{className:"col-xs-2",style:{marginTop:s?`${T}px`:void 0},children:c.jsx(b,{id:qe(e,"remove"),className:"rjsf-object-property-remove btn-block",style:{border:"0"},disabled:i||u,onClick:l,uiSchema:y,registry:x})})]})})}function hv(){return{ArrayFieldDescriptionTemplate:Bb,ArrayFieldItemTemplate:Ub,ArrayFieldItemButtonsTemplate:Lb,ArrayFieldTemplate:Vb,ArrayFieldTitleTemplate:Wb,ButtonTemplates:Zb(),BaseInputTemplate:zb,DescriptionFieldTemplate:Qb,ErrorListTemplate:ev,FallbackFieldTemplate:tv,FieldTemplate:rv,FieldErrorTemplate:iv,FieldHelpTemplate:sv,GridTemplate:ov,MultiSchemaFieldTemplate:av,ObjectFieldTemplate:lv,OptionalDataControlsTemplate:cv,TitleFieldTemplate:dv,UnsupportedFieldTemplate:fv,WrapIfAdditionalTemplate:mv}}function pv(t){const{disabled:e=!1,readonly:n=!1,autofocus:r=!1,options:i,id:s,name:o,registry:a,onBlur:l,onFocus:f}=t,{translateString:u}=a,{elements:d,handleChange:h,handleClear:g,handleSetNow:m}=Nx(t);return c.jsxs("ul",{className:"list-inline",children:[d.map((p,y)=>c.jsx("li",{className:"list-inline-item",children:c.jsx(_x,{rootId:s,name:o,select:h,...p,disabled:e,readonly:n,registry:a,onBlur:l,onFocus:f,autofocus:r&&y===0})},y)),(i.hideNowButton!=="undefined"?!i.hideNowButton:!0)&&c.jsx("li",{className:"list-inline-item",children:c.jsx("a",{href:"#",className:"btn btn-info btn-now",onClick:m,children:u(K.NowLabel)})}),(i.hideClearButton!=="undefined"?!i.hideClearButton:!0)&&c.jsx("li",{className:"list-inline-item",children:c.jsx("a",{href:"#",className:"btn btn-warning btn-clear",onClick:g,children:u(K.ClearLabel)})})]})}function gv({time:t=!0,...e}){const{AltDateWidget:n}=e.registry.widgets;return c.jsx(n,{time:t,...e})}function yv({schema:t,uiSchema:e,options:n,id:r,value:i,disabled:s,readonly:o,label:a,hideLabel:l,autofocus:f=!1,onBlur:u,onFocus:d,onChange:h,registry:g,htmlName:m}){const p=L("DescriptionFieldTemplate",g,n),y=hn(t),x=P.useCallback(O=>h(O.target.checked),[h]),S=P.useCallback(O=>u(r,O.target.checked),[u,r]),j=P.useCallback(O=>d(r,O.target.checked),[d,r]),w=U(e).widget==="checkbox"?void 0:n.description??t.description;return c.jsxs("div",{className:`checkbox ${s||o?"disabled":""}`,children:[!l&&w&&c.jsx(p,{id:Et(r),description:w,schema:t,uiSchema:e,registry:g}),c.jsxs("label",{children:[c.jsx("input",{type:"checkbox",id:r,name:m||r,checked:typeof i>"u"?!1:i,required:y,disabled:s||o,autoFocus:f,onChange:x,onBlur:S,onFocus:j,"aria-describedby":we(r)}),Dl(c.jsx("span",{children:a}),l)]})]})}function xv({id:t,disabled:e,options:{inline:n=!1,enumOptions:r,enumDisabled:i,emptyValue:s},value:o,autofocus:a=!1,readonly:l,onChange:f,onBlur:u,onFocus:d,htmlName:h}){const g=Array.isArray(o)?o:[o],m=P.useCallback(({target:y})=>u(t,ge(y&&y.value,r,s)),[u,t,r,s]),p=P.useCallback(({target:y})=>d(t,ge(y&&y.value,r,s)),[d,t,r,s]);return c.jsx("div",{className:"checkboxes",id:t,children:Array.isArray(r)&&r.map((y,x)=>{const S=kn(y.value,g),j=Array.isArray(i)&&i.indexOf(y.value)!==-1,b=e||j||l?"disabled":"",v=O=>{O.target.checked?f(Nl(x,g,r)):f(Cl(x,g,r))},w=c.jsxs("span",{children:[c.jsx("input",{type:"checkbox",id:wt(t,x),name:h||t,checked:S,value:String(x),disabled:e||j||l,autoFocus:a&&x===0,onChange:v,onBlur:m,onFocus:p,"aria-describedby":we(t)}),c.jsx("span",{children:y.label})]});return n?c.jsx("label",{className:`checkbox-inline ${b}`,children:w},x):c.jsx("div",{className:`checkbox ${b}`,children:c.jsx("label",{children:w})},x)})})}function bv(t){const{disabled:e,readonly:n,options:r,registry:i}=t,s=L("BaseInputTemplate",i,r);return c.jsx(s,{type:"color",...t,disabled:e||n})}function vv(t){const{onChange:e,options:n,registry:r}=t,i=L("BaseInputTemplate",r,n),s=P.useCallback(o=>e(o||void 0),[e]);return c.jsx(i,{type:"date",...t,onChange:s})}function Sv(t){const{onChange:e,value:n,options:r,registry:i}=t,s=L("BaseInputTemplate",i,r);return c.jsx(s,{type:"datetime-local",...t,value:Ix(n),onChange:o=>e(jx(o))})}function wv(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"email",...t})}function jv({fileInfo:t,registry:e}){const{translateString:n}=e,{dataURL:r,type:i,name:s}=t;return r?["image/jpeg","image/png"].includes(i)?c.jsx("img",{src:r,style:{maxWidth:"100%"},className:"file-preview"}):c.jsxs(c.Fragment,{children:[" ",c.jsx("a",{download:`preview-${s}`,href:r,className:"file-download",children:n(K.PreviewLabel)})]}):null}function Ov({filesInfo:t,registry:e,preview:n,onRemove:r,options:i}){if(t.length===0)return null;const{translateString:s}=e,{RemoveButton:o}=L("ButtonTemplates",e,i);return c.jsx("ul",{className:"file-info",children:t.map((a,l)=>{const{name:f,size:u,type:d}=a,h=()=>r(l);return c.jsxs("li",{children:[c.jsx(Rn,{children:s(K.FilesInfo,[f,d,String(u)])}),n&&c.jsx(jv,{fileInfo:a,registry:e}),c.jsx(o,{onClick:h,registry:e})]},l)})})}function Av(t){const{disabled:e,readonly:n,required:r,multiple:i,onChange:s,value:o,options:a,registry:l}=t,{filesInfo:f,handleChange:u,handleRemove:d}=Ex(o,s,i),h=L("BaseInputTemplate",l,a),g=m=>{m.target.files&&u(m.target.files)};return c.jsxs("div",{children:[c.jsx(h,{...t,disabled:e||n,type:"file",required:o?!1:r,onChangeOverride:g,value:"",accept:a.accept?String(a.accept):void 0}),c.jsx(Ov,{filesInfo:f,onRemove:d,registry:l,preview:a.filePreview,options:a})]})}function Cv({id:t,value:e,htmlName:n}){return c.jsx("input",{type:"hidden",id:t,name:n||t,value:typeof e>"u"?"":e})}function _v(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"password",...t})}function Nv({options:t,value:e,required:n,disabled:r,readonly:i,autofocus:s=!1,onBlur:o,onFocus:a,onChange:l,id:f,htmlName:u}){const{enumOptions:d,enumDisabled:h,inline:g,emptyValue:m}=t,p=P.useCallback(({target:x})=>o(f,ge(x&&x.value,d,m)),[o,d,m,f]),y=P.useCallback(({target:x})=>a(f,ge(x&&x.value,d,m)),[a,d,m,f]);return c.jsx("div",{className:"field-radio-group",id:f,role:"radiogroup",children:Array.isArray(d)&&d.map((x,S)=>{const j=kn(x.value,e),b=Array.isArray(h)&&h.indexOf(x.value)!==-1,v=r||b||i?"disabled":"",w=()=>l(x.value),O=c.jsxs("span",{children:[c.jsx("input",{type:"radio",id:wt(f,S),checked:j,name:u||f,required:n,value:String(S),disabled:r||b||i,autoFocus:s&&S===0,onChange:w,onBlur:p,onFocus:y,"aria-describedby":we(f)}),c.jsx("span",{children:x.label})]});return g?c.jsx("label",{className:`radio-inline ${v}`,children:O},S):c.jsx("div",{className:`radio ${v}`,children:c.jsx("label",{children:O})},S)})})}function Tv(t){const{value:e,registry:{templates:{BaseInputTemplate:n}}}=t;return c.jsxs("div",{className:"field-range-wrapper",children:[c.jsx(n,{type:"range",...t}),c.jsx("span",{className:"range-view",children:e})]})}function Fv({id:t,value:e,required:n,disabled:r,readonly:i,autofocus:s,onChange:o,onFocus:a,onBlur:l,schema:f,options:u,htmlName:d}){const{stars:h=5,shape:g="star"}=u,m=f.maximum?Math.min(f.maximum,5):Math.min(Math.max(h,1),5),p=f.minimum||0,y=P.useCallback(b=>{!r&&!i&&o(b)},[o,r,i]),x=P.useCallback(b=>{if(a){const v=Number(b.target.dataset.value);a(t,v)}},[a,t]),S=P.useCallback(b=>{if(l){const v=Number(b.target.dataset.value);l(t,v)}},[l,t]),j=b=>g==="heart"?b?"♥":"♡":b?"★":"☆";return c.jsx(c.Fragment,{children:c.jsxs("div",{className:"rating-widget",style:{display:"inline-flex",fontSize:"1.5rem",cursor:r||i?"default":"pointer"},children:[[...Array(m)].map((b,v)=>{const w=p+v,O=w<=e;return c.jsx("span",{onClick:()=>y(w),onFocus:x,onBlur:S,"data-value":w,tabIndex:r||i?-1:0,role:"radio","aria-checked":w===e,"aria-label":`${w} ${g==="heart"?"heart":"star"}${w===1?"":"s"}`,style:{color:O?"#FFD700":"#ccc",padding:"0 0.2rem",transition:"color 0.2s",userSelect:"none"},children:j(O)},v)}),c.jsx("input",{type:"hidden",id:t,name:d||t,value:e||"",required:n,disabled:r||i,"aria-hidden":"true"})]})})}function Wr(t,e){return e?Array.from(t.target.options).slice().filter(n=>n.selected).map(n=>n.value):t.target.value}function Pv({schema:t,id:e,options:n,value:r,required:i,disabled:s,readonly:o,multiple:a=!1,autofocus:l=!1,onChange:f,onBlur:u,onFocus:d,placeholder:h,htmlName:g}){const{enumOptions:m,enumDisabled:p,emptyValue:y}=n,x=a?[]:"",S=P.useCallback(O=>{const A=Wr(O,a);return d(e,ge(A,m,y))},[d,e,a,m,y]),j=P.useCallback(O=>{const A=Wr(O,a);return u(e,ge(A,m,y))},[u,e,a,m,y]),b=P.useCallback(O=>{const A=Wr(O,a);return f(ge(A,m,y))},[f,a,m,y]),v=_l(r,m,a),w=!a&&t.default===void 0;return c.jsxs("select",{id:e,name:g||e,multiple:a,role:"combobox",className:"form-control",value:typeof v>"u"?x:v,required:i,disabled:s||o,autoFocus:l,onBlur:j,onFocus:S,onChange:b,"aria-describedby":we(e),children:[w&&c.jsx("option",{value:"",children:h}),Array.isArray(m)&&m.map(({value:O,label:A},C)=>{const T=p&&p.indexOf(O)!==-1;return c.jsx("option",{value:String(C),disabled:T,children:A},C)})]})}function Ev({id:t,options:e={},placeholder:n,value:r,required:i,disabled:s,readonly:o,autofocus:a=!1,onChange:l,onBlur:f,onFocus:u,htmlName:d}){const h=P.useCallback(({target:{value:p}})=>l(p===""?e.emptyValue:p),[l,e.emptyValue]),g=P.useCallback(({target:p})=>f(t,p&&p.value),[f,t]),m=P.useCallback(({target:p})=>u(t,p&&p.value),[t,u]);return c.jsx("textarea",{id:t,name:d||t,className:"form-control",value:r||"",placeholder:n,required:i,disabled:s,readOnly:o,autoFocus:a,rows:e.rows,onBlur:g,onFocus:m,onChange:h,"aria-describedby":we(t)})}function Iv(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{...t})}function Dv(t){const{onChange:e,options:n,registry:r}=t,i=L("BaseInputTemplate",r,n),s=P.useCallback(o=>e(o?`${o}:00`:void 0),[e]);return c.jsx(i,{type:"time",...t,onChange:s})}function $v(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"url",...t})}function kv(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"number",...t})}function Mv(){return{AltDateWidget:pv,AltDateTimeWidget:gv,CheckboxWidget:yv,CheckboxesWidget:xv,ColorWidget:bv,DateWidget:vv,DateTimeWidget:Sv,EmailWidget:wv,FileWidget:Av,HiddenWidget:Cv,PasswordWidget:_v,RadioWidget:Nv,RangeWidget:Tv,RatingWidget:Fv,SelectWidget:Pv,TextWidget:Iv,TextareaWidget:Ev,TimeWidget:Dv,UpDownWidget:kv,URLWidget:$v}}function Rv(){return{fields:Rb(),templates:hv(),widgets:Mv(),rootSchema:{},formContext:{},translateString:ax,globalFormOptions:{idPrefix:ca,idSeparator:ua,useFallbackUiForUnsupportedType:!1}}}function $t(t,e){return{...Gi(t,["schema","uiSchema","fieldPathId","schemaUtils","formData","edit","errors","errorSchema"]),...e!==void 0&&{status:e}}}let Bv=class extends P.Component{formElement;pendingChanges=[];_isProcessingUserChange=!1;constructor(e){if(super(e),!e.validator)throw new Error("A validator is required for Form functionality to work");const{formData:n,initialFormData:r,onChange:i}=e,s=n??r;this.state=this.getStateFromProps(e,s,void 0,void 0,void 0,!0),i&&!le(this.state.formData,s)&&i($t(this.state)),this.formElement=P.createRef()}getSnapshotBeforeUpdate(e,n){if(!le(this.props,e)){const r=fo(this.props.formData,e.formData),i=fo(this.props.formData,this.state.formData),s=!le(e.schema,this.props.schema),o=r.length>0||!le(e.formData,this.props.formData),a=i.length>0||!le(this.state.formData,this.props.formData),l=this.getStateFromProps(this.props,this.props.formData,s||o?void 0:this.state.retrievedSchema,s,r,!a),f=!le(l,n);return{nextState:l,shouldUpdate:f}}return{shouldUpdate:!1}}componentDidUpdate(e,n,r){if(r.shouldUpdate){const{nextState:i}=r,s=!le(i.formData,this.props.formData),o=this._isProcessingUserChange;if(this._isProcessingUserChange=!1,o&&s)return;s&&!le(i.formData,n.formData)&&this.props.onChange&&this.props.onChange($t(i)),this.setState(i)}}getStateFromProps(e,n,r,i=!1,s=[],o=!1){const a=this.state||{},l="schema"in e?e.schema:this.props.schema,f="validator"in e?e.validator:this.props.validator,u=("uiSchema"in e?e.uiSchema:this.props.uiSchema)||{},d=e.formData===void 0&&this.props.formData===void 0,h=typeof n<"u",g="liveValidate"in e?e.liveValidate:this.props.liveValidate,m=h&&!e.noValidate&&g,p="experimental_defaultFormStateBehavior"in e?e.experimental_defaultFormStateBehavior:this.props.experimental_defaultFormStateBehavior,y="experimental_customMergeAllOf"in e?e.experimental_customMergeAllOf:this.props.experimental_customMergeAllOf;let x=a.schemaUtils;(!x||x.doesSchemaUtilsDiffer(f,l,p,y))&&(x=ix(f,l,p,y));const S=x.getRootSchema();let j=n;n===Uo?j=void 0:n===void 0&&d&&(j=a.formData);const b=x.getDefaultFormState(S,j,!1,a.initialDefaultsGenerated),v=this.updateRetrievedSchema(r??x.retrieveSchema(S,b)),w=()=>e.noValidate||i?{errors:[],errorSchema:{}}:e.liveValidate?{errors:a.errors||[],errorSchema:a.errorSchema||{}}:{errors:a.schemaValidationErrors||[],errorSchema:a.schemaValidationErrorSchema||{}};let O,A,C=a.schemaValidationErrors,T=a.schemaValidationErrorSchema;if(m&&!o){const E=this.liveValidate(S,x,a.errorSchema,b,void 0,a.customErrors,r,r!==void 0);O=E.errors,A=E.errorSchema,C=E.schemaValidationErrors,T=E.schemaValidationErrorSchema}else{const E=w();if(O=E.errors,A=E.errorSchema,s.length>0&&!m){const M=s.reduce((k,B)=>(k[B]=void 0,k),{});A=T=Cn(E.errorSchema,M,"preventDuplicates")}const D=this.mergeErrors({errorSchema:A,errors:O},e.extraErrors,a.customErrors);O=D.errors,A=D.errorSchema}const N=this.getRegistry(e,S,x),_=le(a.registry,N)?a.registry:N,F=a.fieldPathId&&a.fieldPathId?.[oe]===_.globalFormOptions.idPrefix?a.fieldPathId:Fe("",_.globalFormOptions);return{schemaUtils:x,schema:S,uiSchema:u,fieldPathId:F,formData:b,edit:h,errors:O,errorSchema:A,schemaValidationErrors:C,schemaValidationErrorSchema:T,retrievedSchema:v,initialDefaultsGenerated:!0,registry:_}}shouldComponentUpdate(e,n){const{experimental_componentUpdateStrategy:r="customDeep"}=this.props;return $l(this,e,n,r)}validate(e,n=this.state.schema,r,i){const s=r||this.state.schemaUtils,{customValidate:o,transformErrors:a,uiSchema:l}=this.props,f=i??s.retrieveSchema(n,e);return s.getValidator().validateFormData(e,f,o,a,l)}renderErrors(e){const{errors:n,errorSchema:r,schema:i,uiSchema:s}=this.state,o=U(s),a=L("ErrorListTemplate",e,o);return n&&n.length?c.jsx(a,{errors:n,errorSchema:r||{},schema:i,uiSchema:s,registry:e}):null}mergeErrors(e,n,r){let i=e.errorSchema,s=e.errors;if(n){const o=Xn(e,n);i=o.errorSchema,s=o.errors}if(r){const o=Xn(e,r.ErrorSchema,!0);i=o.errorSchema,s=o.errors}return{errors:s,errorSchema:i}}liveValidate(e,n,r,i,s,o,a,l=!1){const f=this.validate(i,e,n,a),u=f.errors;let d=f.errorSchema;l&&(d=Cn(r,f.errorSchema,"preventDuplicates"));const h=u,g=d;return{...this.mergeErrors({errorSchema:d,errors:u},s,o),schemaValidationErrors:h,schemaValidationErrorSchema:g}}getUsedFormData=(e,n)=>jl(e,n);getFieldNames=(e,n)=>Ol(e,n);omitExtraData=e=>{const{schema:n,schemaUtils:r}=this.state;return r.omitExtraData(n,e)};setFieldValue=(e,n)=>{const{registry:r}=this.state,i=Array.isArray(e)?e:e.split("."),s=Fe("",r.globalFormOptions,i);this.onChange(n,i,void 0,s[oe])};onChange=(e,n,r,i)=>{this.pendingChanges.push({newValue:e,path:n,newErrorSchema:r,id:i}),this.pendingChanges.length===1&&this.processPendingChange()};processPendingChange(){if(this.pendingChanges.length===0)return;this._isProcessingUserChange=!0;const{newValue:e,path:n,id:r}=this.pendingChanges[0],{newErrorSchema:i}=this.pendingChanges[0],{extraErrors:s,omitExtraData:o,liveOmit:a,noValidate:l,liveValidate:f,onChange:u}=this.props,{formData:d,schemaUtils:h,schema:g,fieldPathId:m,schemaValidationErrorSchema:p,errors:y}=this.state;let{customErrors:x,errorSchema:S}=this.state;const j=m.path[0]||"",b=!n||n.length===0||n.length===1&&n[0]===j;let v=this.state.retrievedSchema,w=b?e:Hi(d);const O=Y(w)&&Object.keys(w).length>0&&Object.values(w).every(F=>F===void 0),A=d==null,C=O&&A?void 0:w;if(Y(w)||Array.isArray(w)){e===Jl?Mx(w,n):b||se(w,n,e);const F=this.getStateFromProps(this.props,C,void 0,void 0,void 0,!0);w=F.formData,v=F.retrievedSchema}const T=!l&&(f===!0||f==="onChange");let N={formData:w,schema:g},_=w;if(o===!0&&(a===!0||a==="onChange")&&(_=this.omitExtraData(w),N={formData:_}),i){const F=b?p:I(p,n);if(!me(F))b?S=i:se(S,n,i);else if(x||(x=new Tl),b){const $=I(i,xe);$&&x.setErrors($)}else se(x.ErrorSchema,n,i)}else x&&I(x.ErrorSchema,[...n,xe])&&x.clearErrors(n);if(T&&this.pendingChanges.length===1){const F=this.liveValidate(g,h,S,_,s,x,v);N={formData:_,...F,customErrors:x}}else if(!l&&i){const F=this.mergeErrors({errorSchema:S,errors:y},s,x);N={formData:_,...F,customErrors:x}}this.setState(N,()=>{u&&u($t({...this.state,...N}),r),this.pendingChanges.shift(),this.processPendingChange()})}updateRetrievedSchema(e){return le(e,this.state?.retrievedSchema)?this.state.retrievedSchema:e}reset=()=>{const{formData:e,initialFormData:n=Uo,onChange:r}=this.props,o={formData:this.getStateFromProps(this.props,e??n,void 0,void 0,void 0,!0).formData,errorSchema:{},errors:[],schemaValidationErrors:[],schemaValidationErrorSchema:{},initialDefaultsGenerated:!1,customErrors:void 0};this.setState(o,()=>r&&r($t({...this.state,...o})))};onBlur=(e,n)=>{const{onBlur:r,omitExtraData:i,liveOmit:s,liveValidate:o}=this.props;if(r&&r(e,n),i===!0&&s==="onBlur"||o==="onBlur"){const{onChange:a,extraErrors:l}=this.props,{formData:f}=this.state;let u=f,d={formData:u};if(i===!0&&s==="onBlur"&&(u=this.omitExtraData(f),d={formData:u}),o==="onBlur"){const{schema:g,schemaUtils:m,errorSchema:p,customErrors:y,retrievedSchema:x}=this.state,S=this.liveValidate(g,m,p,u,l,y,x);d={formData:u,...S,customErrors:y}}const h=Object.keys(d).filter(g=>!g.startsWith("schemaValidation")).some(g=>{const m=I(this.state,g),p=I(d,g);return!le(m,p)});this.setState(d,()=>{a&&h&&a($t({...this.state,...d}),e)})}};onFocus=(e,n)=>{const{onFocus:r}=this.props;r&&r(e,n)};onSubmit=e=>{if(e.preventDefault(),e.target!==e.currentTarget)return;e.persist();const{omitExtraData:n,extraErrors:r,noValidate:i,onSubmit:s}=this.props;let{formData:o}=this.state;if(n===!0&&(o=this.omitExtraData(o)),i||this.validateFormWithFormData(o)){const a=r||{},l=r?Qi(r):[];this.setState({formData:o,errors:l,errorSchema:a,schemaValidationErrors:[],schemaValidationErrorSchema:{}},()=>{s&&s($t({...this.state,formData:o},"submitted"),e)})}};getGlobalFormOptions(e){const{uiSchema:n={},experimental_componentUpdateStrategy:r,idSeparator:i=ua,idPrefix:s=ca,nameGenerator:o,useFallbackUiForUnsupportedType:a=!1}=e;return{idPrefix:n["ui:rootFieldId"]||s,idSeparator:i,useFallbackUiForUnsupportedType:a,...r!==void 0&&{experimental_componentUpdateStrategy:r},...o!==void 0&&{nameGenerator:o}}}getRegistry(e,n,r){const{translateString:i,uiSchema:s={}}=e,{fields:o,templates:a,widgets:l,formContext:f,translateString:u}=Rv();return{fields:{...o,...e.fields},templates:{...a,...e.templates,ButtonTemplates:{...a.ButtonTemplates,...e.templates?.ButtonTemplates}},widgets:{...l,...e.widgets},rootSchema:n,formContext:e.formContext||f,schemaUtils:r,translateString:i||u,globalUiOptions:s[Gr],globalFormOptions:this.getGlobalFormOptions(e)}}submit=()=>{if(this.formElement.current){const e=new CustomEvent("submit",{cancelable:!0});e.preventDefault(),this.formElement.current.dispatchEvent(e),this.formElement.current.requestSubmit()}};focusOnError(e){const{idPrefix:n="root",idSeparator:r="_"}=this.props,{property:i}=e,s=kl(i);s[0]===""?s[0]=n:s.unshift(n);const o=s.join(r);let a=this.formElement.current.elements[o];a||(a=this.formElement.current.querySelector(`input[id^="${o}"`)),a&&a.length&&(a=a[0]),a&&a.focus()}validateFormWithFormData=e=>{const{extraErrors:n,extraErrorsBlockSubmit:r,focusOnFirstError:i,onError:s}=this.props,{errors:o}=this.state,a=this.validate(e);let l=a.errors,f=a.errorSchema;const u=l,d=f,h=l.length>0||n&&r;if(h){if(n){const g=Xn(a,n);f=g.errorSchema,l=g.errors}i&&(typeof i=="function"?i(l[0]):this.focusOnError(l[0])),this.setState({errors:l,errorSchema:f,schemaValidationErrors:u,schemaValidationErrorSchema:d},()=>{s?s(l):console.error("Form validation failed",l)})}else o.length>0&&this.setState({errors:[],errorSchema:{},schemaValidationErrors:[],schemaValidationErrorSchema:{}});return!h};validateForm(){const{omitExtraData:e}=this.props;let{formData:n}=this.state;return e===!0&&(n=this.omitExtraData(n)),this.validateFormWithFormData(n)}render(){const{children:e,id:n,className:r="",tagName:i,name:s,method:o,target:a,action:l,autoComplete:f,enctype:u,acceptCharset:d,noHtml5Validate:h=!1,disabled:g,readonly:m,showErrorList:p="top",_internalFormWrapper:y}=this.props,{schema:x,uiSchema:S,formData:j,errorSchema:b,fieldPathId:v,registry:w}=this.state,{SchemaField:O}=w.fields,{SubmitButton:A}=w.templates.ButtonTemplates,C=y?i:void 0,T=y||i||"form";let{[Qn]:N={}}=U(S);g&&(N={...N,props:{...N.props,disabled:!0}});const _={[ut]:{[Qn]:N}};return c.jsxs(T,{className:r||"rjsf",id:n,name:s,method:o,target:a,action:l,autoComplete:f,encType:u,acceptCharset:d,noValidate:h,onSubmit:this.onSubmit,as:C,ref:this.formElement,children:[p==="top"&&this.renderErrors(w),c.jsx(O,{name:"",schema:x,uiSchema:S,errorSchema:b,fieldPathId:v,formData:j,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:w,disabled:g,readonly:m}),e||c.jsx(A,{uiSchema:_,registry:w}),p==="bottom"&&this.renderErrors(w)]})}};function Uv(t){return P.forwardRef(({fields:e,widgets:n,templates:r,...i},s)=>(e={...t?.fields,...e},n={...t?.widgets,...n},r={...t?.templates,...r,ButtonTemplates:{...t?.templates?.ButtonTemplates,...r?.ButtonTemplates}},c.jsx(Bv,{...t,...i,fields:e,widgets:n,templates:r,ref:s})))}var Wn={exports:{}},zr={},Lo;function Lv(){return Lo||(Lo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(C,T){return{validate:C,compare:T}}t.fullFormats={date:e(s,o),time:e(l,f),"date-time":e(d,h),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:p,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:A,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:x,int32:{type:"number",validate:b},int64:{type:"number",validate:v},float:{type:"number",validate:w},double:{type:"number",validate:w},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,f),"date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,h),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);function n(C){return C%4===0&&(C%100!==0||C%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(C){const T=r.exec(C);if(!T)return!1;const N=+T[1],_=+T[2],F=+T[3];return _>=1&&_<=12&&F>=1&&F<=(_===2&&n(N)?29:i[_])}function o(C,T){if(C&&T)return C>T?1:C<T?-1:0}const a=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function l(C,T){const N=a.exec(C);if(!N)return!1;const _=+N[1],F=+N[2],$=+N[3],E=N[5];return(_<=23&&F<=59&&$<=59||_===23&&F===59&&$===60)&&(!T||E!=="")}function f(C,T){if(!(C&&T))return;const N=a.exec(C),_=a.exec(T);if(N&&_)return C=N[1]+N[2]+N[3]+(N[4]||""),T=_[1]+_[2]+_[3]+(_[4]||""),C>T?1:C<T?-1:0}const u=/t|\s/i;function d(C){const T=C.split(u);return T.length===2&&s(T[0])&&l(T[1],!0)}function h(C,T){if(!(C&&T))return;const[N,_]=C.split(u),[F,$]=T.split(u),E=o(N,F);if(E!==void 0)return E||f(_,$)}const g=/\/|:/,m=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function p(C){return g.test(C)&&m.test(C)}const y=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function x(C){return y.lastIndex=0,y.test(C)}const S=-2147483648,j=2**31-1;function b(C){return Number.isInteger(C)&&C<=j&&C>=S}function v(C){return Number.isInteger(C)}function w(){return!0}const O=/[^\\]\\Z/;function A(C){if(O.test(C))return!1;try{return new RegExp(C),!0}catch{return!1}}})(zr)),zr}var qr={},Vo;function Vv(){return Vo||(Vo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const e=$c(),n=Ho(),r=n.operators,i={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},s={message:({keyword:a,schemaCode:l})=>n.str`should be ${i[a].okStr} ${l}`,params:({keyword:a,schemaCode:l})=>n._`{comparison: ${i[a].okStr}, limit: ${l}}`};t.formatLimitDefinition={keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:s,code(a){const{gen:l,data:f,schemaCode:u,keyword:d,it:h}=a,{opts:g,self:m}=h;if(!g.validateFormats)return;const p=new e.KeywordCxt(h,m.RULES.all.format.definition,"format");p.$data?y():x();function y(){const j=l.scopeValue("formats",{ref:m.formats,code:g.code.formats}),b=l.const("fmt",n._`${j}[${p.schemaCode}]`);a.fail$data(n.or(n._`typeof ${b} != "object"`,n._`${b} instanceof RegExp`,n._`typeof ${b}.compare != "function"`,S(b)))}function x(){const j=p.schema,b=m.formats[j];if(!b||b===!0)return;if(typeof b!="object"||b instanceof RegExp||typeof b.compare!="function")throw new Error(`"${d}": format "${j}" does not define "compare" function`);const v=l.scopeValue("formats",{key:j,ref:b,code:g.code.formats?n._`${g.code.formats}${n.getProperty(j)}`:void 0});a.fail$data(S(v))}function S(j){return n._`${j}.compare(${f}, ${u}) ${i[d].fail} 0`}},dependencies:["format"]};const o=a=>(a.addKeyword(t.formatLimitDefinition),a);t.default=o})(qr)),qr}var Wo;function Wv(){return Wo||(Wo=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const n=Lv(),r=Vv(),i=Ho(),s=new i.Name("fullFormats"),o=new i.Name("fastFormats"),a=(f,u={keywords:!0})=>{if(Array.isArray(u))return l(f,u,n.fullFormats,s),f;const[d,h]=u.mode==="fast"?[n.fastFormats,o]:[n.fullFormats,s],g=u.formats||n.formatNames;return l(f,g,d,h),u.keywords&&r.default(f),f};a.get=(f,u="full")=>{const h=(u==="fast"?n.fastFormats:n.fullFormats)[f];if(!h)throw new Error(`Unknown format "${f}"`);return h};function l(f,u,d,h){var g,m;(g=(m=f.opts.code).formats)!==null&&g!==void 0||(m.formats=i._`require("ajv-formats/dist/formats").${h}`);for(const p of u)f.addFormat(p,d[p])}t.exports=e=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a})(Wn,Wn.exports)),Wn.exports}var zv=Wv();const zo=fi(zv),qv={allErrors:!0,multipleOfPrecision:8,strict:!1,verbose:!0,discriminator:!1},Kv=/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,Gv=/^data:([a-z]+\/[a-z0-9-+.]+)?;(?:name=(.*);)?base64,(.*)$/;function Hv(t,e,n={},r,i=kc,s){let o=new i({...qv,...n});return r?zo(o,r):r!==!1&&zo(o),o.addFormat("data-url",Gv),o.addFormat("color",Kv),o.addKeyword(Qe),o.addKeyword(wi),Array.isArray(t)&&o.addMetaSchema(t),Z(e)&&Object.keys(e).forEach(a=>{o.addFormat(a,e[a])}),s&&(o=s(o)),o}function Yv(t=[],e){return t.map(r=>{var i;const{instancePath:s,keyword:o,params:a,schemaPath:l,parentSchema:f,...u}=r;let{message:d=""}=u,h=s.replace(/\//g,"."),g=`${h} ${d}`.trim(),m="";const p=[...((i=a.deps)===null||i===void 0?void 0:i.split(", "))||[],a.missingProperty,a.property].filter(y=>y);if(p.length>0)p.forEach(y=>{const x=h?`${h}.${y}`:y;let S=U(I(e,`${x.replace(/^\./,"")}`)).title;if(S===void 0){const j=l.replace(/\/properties\//g,"/").split("/").slice(1,-1).concat([y]);S=U(I(e,j)).title}if(S)d=d.replace(`'${y}'`,`'${S}'`),m=S;else{const j=I(f,[te,y,"title"]);j&&(d=d.replace(`'${y}'`,`'${j}'`),m=j)}}),g=d;else{const y=U(I(e,`${h.replace(/^\./,"")}`)).title;if(y)g=`'${y}' ${d}`.trim(),m=y;else{const x=f?.title;x&&(g=`'${x}' ${d}`.trim(),m=x)}}return"missingProperty"in a&&(h=h?`${h}.${a.missingProperty}`:a.missingProperty),{name:o,property:h,message:d,params:a,stack:g,schemaPath:l,title:m}}).reduce((r,i)=>{const{message:s,schemaPath:o}=i,a=o?.indexOf(`/${J}/`),l=o?.indexOf(`/${q}/`);let f;return a&&a>=0?f=o?.substring(0,a):l&&l>=0&&(f=o?.substring(0,l)),f&&r.find(d=>{var h;return d.message===s&&((h=d.schemaPath)===null||h===void 0?void 0:h.startsWith(f))})||r.push(i),r},[])}function Xv(t,e,n,r,i,s,o){const{validationError:a}=e;let l=Yv(e.errors,o);a&&(l=[...l,{stack:a.message}]),typeof s=="function"&&(l=s(l,o));let f=Ax(l);if(a&&(f={...f,$schema:{__errors:[a.message]}}),typeof i!="function")return{errors:l,errorSchema:f};const u=xl(t,r,n,r,!0),d=i(u,Hr(u),o,f),h=Ml(d);return Xn({errors:l,errorSchema:f},h)}class Jv{constructor(e,n){const{additionalMetaSchemas:r,customFormats:i,ajvOptionsOverrides:s,ajvFormatOptions:o,AjvClass:a,extenderFn:l}=e;this.ajv=Hv(r,i,s,o,a,l),this.localizer=n}reset(){this.ajv.removeSchema()}rawValidation(e,n){var r,i;let s,o;try{e[oe]&&(o=this.ajv.getSchema(e[oe])),o===void 0&&(o=this.ajv.compile(e)),o(n)}catch(l){s=l}let a;return o&&(typeof this.localizer=="function"&&(((r=o.errors)!==null&&r!==void 0?r:[]).forEach(l=>{var f;["missingProperty","property"].forEach(u=>{var d;!((d=l.params)===null||d===void 0)&&d[u]&&(l.params[u]=`'${l.params[u]}'`)}),!((f=l.params)===null||f===void 0)&&f.deps&&(l.params.deps=l.params.deps.split(", ").map(u=>`'${u}'`).join(", "))}),this.localizer(o.errors),((i=o.errors)!==null&&i!==void 0?i:[]).forEach(l=>{var f;["missingProperty","property"].forEach(u=>{var d;!((d=l.params)===null||d===void 0)&&d[u]&&(l.params[u]=l.params[u].slice(1,-1))}),!((f=l.params)===null||f===void 0)&&f.deps&&(l.params.deps=l.params.deps.split(", ").map(u=>u.slice(1,-1)).join(", "))})),a=o.errors||void 0,o.errors=null),{errors:a,validationError:s}}validateFormData(e,n,r,i,s){const o=this.rawValidation(n,e);return Xv(this,o,e,n,r,i,s)}handleSchemaUpdate(e){var n,r;const i=(n=e[oe])!==null&&n!==void 0?n:da;this.ajv.getSchema(i)===void 0?this.ajv.addSchema(e,i):le(e,(r=this.ajv.getSchema(i))===null||r===void 0?void 0:r.schema)||(this.ajv.removeSchema(i),this.ajv.addSchema(e,i))}isValid(e,n,r){var i;try{this.handleSchemaUpdate(r);const s=es(e),o=(i=s[oe])!==null&&i!==void 0?i:vx(s);let a;return a=this.ajv.getSchema(o),a===void 0&&(a=this.ajv.addSchema(s,o).getSchema(o)||this.ajv.compile(s)),a(n)}catch(s){return console.warn("Error encountered compiling schema:",s),!1}}}function Zv(t={},e){return new Jv(t,e)}const Qv=Zv();const e1=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),t1=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),qo=t=>{const e=t1(t);return e.charAt(0).toUpperCase()+e.slice(1)},tc=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),n1=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var r1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const i1=P.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>P.createElement("svg",{ref:l,...r1,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:tc("lucide",i),...!s&&!n1(a)&&{"aria-hidden":"true"},...a},[...o.map(([f,u])=>P.createElement(f,u)),...Array.isArray(s)?s:[s]]));const Xe=(t,e)=>{const n=P.forwardRef(({className:r,...i},s)=>P.createElement(i1,{ref:s,iconNode:e,className:tc(`lucide-${e1(qo(t))}`,`lucide-${t}`,r),...i}));return n.displayName=qo(t),n};const s1=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],o1=Xe("check",s1);const a1=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],nc=Xe("chevron-down",a1);const l1=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],c1=Xe("chevron-up",l1);const u1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],d1=Xe("circle-alert",u1);const f1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],rc=Xe("circle-plus",f1);const m1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],h1=Xe("circle",m1);const p1=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],g1=Xe("copy",p1);const y1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],x1=Xe("search",y1);const b1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],v1=Xe("trash-2",b1);const S1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ic=Xe("x",S1);function G(...t){return Mc(Rc(t))}const w1=mi("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",xs:"h-6 rounded-md gap-1 px-2 has-[>svg]:px-2",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function as({className:t,variant:e,size:n,asChild:r=!1,...i}){const s=r?Yo:"button";return c.jsx(s,{"data-slot":"button",className:G(w1({variant:e,size:n,className:t})),...i})}function j1({uiSchema:t,registry:e,className:n,...r}){const{translateString:i}=e;return c.jsx("div",{className:"p-0 m-0",children:c.jsxs(as,{...r,className:G("w-fit gap-2",n),variant:"outline",type:"button",children:[c.jsx(rc,{size:16})," ",i(K.AddItemButton)]})})}function O1(t){const{children:e,buttonsProps:n,displayLabel:r,hasDescription:i,hasToolbar:s,uiSchema:o,registry:a}=t,l=U(o),f=L("ArrayFieldItemButtonsTemplate",a,l),u=i?-6:22;return c.jsx("div",{children:c.jsxs("div",{className:"mb-2 flex flex-row flex-wrap items-center",children:[c.jsx("div",{className:"grow shrink",children:e}),c.jsx("div",{className:"flex items-end justify-end p-0.5",children:s&&c.jsx("div",{className:"flex gap-2",style:{marginLeft:"5px",marginTop:r?`${u}px`:void 0},children:c.jsx(f,{...n})})})]})})}function A1(t){const{canAdd:e,disabled:n,fieldPathId:r,uiSchema:i,items:s,optionalDataControl:o,onAddClick:a,readonly:l,registry:f,required:u,schema:d,title:h}=t,g=U(i),m=L("ArrayFieldDescriptionTemplate",f,g),p=L("ArrayFieldTitleTemplate",f,g),y=!l&&!n,{ButtonTemplates:{AddButton:x}}=f.templates;return c.jsx("div",{children:c.jsx("div",{className:"m-0 flex p-0",children:c.jsxs("div",{className:"m-0 w-full p-0",children:[c.jsx(p,{fieldPathId:r,title:g.title||h,schema:d,uiSchema:i,required:u,registry:f,optionalDataControl:y?o:void 0}),c.jsx(m,{fieldPathId:r,description:g.description||d.description,schema:d,uiSchema:i,registry:f}),c.jsxs("div",{className:"p-0 m-0 w-full mb-2",children:[y?void 0:o,s,e&&c.jsx("div",{className:"mt-2 flex justify-end",children:c.jsx(x,{id:qe(r,"add"),className:"rjsf-array-item-add",onClick:a,disabled:n||l,uiSchema:i,registry:f})})]},`array-item-list-${r.$id}`)]})})})}function sc({className:t,type:e,...n}){return c.jsx("input",{type:e,"data-slot":"input",className:G("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}function C1({id:t,htmlName:e,placeholder:n,required:r,readonly:i,disabled:s,type:o,value:a,onChange:l,onChangeOverride:f,onBlur:u,onFocus:d,autofocus:h,options:g,schema:m,rawErrors:p=[],children:y,extraProps:x,className:S,registry:j}){const{ClearButton:b}=j.templates.ButtonTemplates,v={...x,...Pl(m,o,g)},w=({target:{value:T}})=>l(T===""?g.emptyValue:T),O=({target:T})=>u(t,T&&T.value),A=({target:T})=>d(t,T&&T.value),C=P.useCallback(T=>{var N;T.preventDefault(),T.stopPropagation(),l((N=g.emptyValue)!==null&&N!==void 0?N:"")},[l,g.emptyValue]);return c.jsxs("div",{className:"p-0.5",children:[c.jsx(sc,{id:t,name:e||t,type:o,placeholder:n,autoFocus:h,required:r,disabled:s,readOnly:i,className:G({"border-destructive focus-visible:ring-0":p.length>0},S),list:m.examples?_n(t):void 0,...v,value:a||a===0?a:"",onChange:f||w,onBlur:O,onFocus:A,"aria-describedby":we(t,!!m.examples)}),g.allowClearTextInputs&&!i&&!s&&a&&c.jsx(b,{onClick:C,registry:j}),y,Array.isArray(m.examples)?c.jsx("datalist",{id:_n(t),children:m.examples.concat(m.default&&!m.examples.includes(m.default)?[m.default]:[]).map(T=>c.jsx("option",{value:T},T))}):null]})}function _1({id:t,description:e,registry:n,uiSchema:r}){return e?c.jsx("div",{children:c.jsx("div",{id:t,className:"text-sm text-muted-foreground",children:c.jsx(ss,{description:e,registry:n,uiSchema:r})})}):null}const N1=mi("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function T1({className:t,variant:e,...n}){return c.jsx("div",{"data-slot":"alert",role:"alert",className:G(N1({variant:e}),t),...n})}function F1({className:t,...e}){return c.jsx("div",{"data-slot":"alert-title",className:G("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...e})}function P1({className:t,...e}){return c.jsx("div",{"data-slot":"alert-description",className:G("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...e})}function E1({errors:t,registry:e}){const{translateString:n}=e;return c.jsxs(T1,{variant:"destructive",className:"mb-2",children:[c.jsx(d1,{className:"h-4 w-4"}),c.jsx(F1,{children:n(K.ErrorsLabel)}),c.jsx(P1,{className:"flex flex-col gap-1",children:t.map((r,i)=>c.jsxs("span",{children:["• ",r.stack]},i))})]})}function I1(t){const{errors:e=[],fieldPathId:n}=t;if(e.length===0)return null;const r=Xi(n);return c.jsx("div",{className:"flex flex-col gap-1",id:r,children:e.map((i,s)=>c.jsx("span",{className:"text-xs font-medium text-destructive mb-1",children:i},s))})}function D1(t){const{fieldPathId:e,help:n,uiSchema:r,registry:i,hasErrors:s}=t;return n?c.jsx("span",{className:G("text-xs font-medium text-muted-foreground",{"text-destructive":s}),id:Ji(e),children:c.jsx(os,{help:n,registry:i,uiSchema:r})}):null}function $1({id:t,children:e,displayLabel:n,rawErrors:r=[],errors:i,help:s,description:o,rawDescription:a,classNames:l,style:f,disabled:u,label:d,hidden:h,onKeyRename:g,onKeyRenameBlur:m,onRemoveProperty:p,readonly:y,required:x,schema:S,uiSchema:j,registry:b}){const v=U(j),w=L("WrapIfAdditionalTemplate",b,v);if(h)return c.jsx("div",{className:"hidden",children:e});const O=v.widget==="checkbox";return c.jsx(w,{classNames:l,style:f,disabled:u,id:t,label:d,displayLabel:n,onKeyRename:g,onKeyRenameBlur:m,onRemoveProperty:p,rawDescription:a,readonly:y,required:x,schema:S,uiSchema:j,registry:b,children:c.jsxs("div",{className:"flex flex-col gap-2",children:[n&&!O&&c.jsxs("label",{className:G("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{" text-destructive":r.length>0}),htmlFor:t,children:[d,x?"*":null]}),e,n&&a&&!O&&c.jsx("span",{className:G("text-xs font-medium text-muted-foreground",{" text-destructive":r.length>0}),children:o}),i,s]})})}function k1(t){const{children:e,column:n,className:r,...i}=t;return c.jsx("div",{className:G("grid gap-2",r),...i,children:e})}function en(t){const{icon:e,iconType:n,className:r,uiSchema:i,registry:s,...o}=t;return c.jsx(as,{size:"icon",variant:"outline",className:r,...o,type:"button",children:e})}function M1(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.CopyButton),...t,icon:c.jsx(g1,{className:"h-4 w-4"})})}function R1(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.MoveDownButton),...t,icon:c.jsx(nc,{className:"h-4 w-4"})})}function B1(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.MoveUpButton),...t,icon:c.jsx(c1,{className:"h-4 w-4"})})}function oc(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.RemoveButton),...t,className:"border-destructive",icon:c.jsx(v1,{className:"h-4 w-4 stroke-destructive"})})}function U1(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.ClearButton),...t,icon:c.jsx(ic,{})})}function L1({selector:t,optionSchemaField:e}){return c.jsxs("div",{className:G("p-4 border rounded-md bg-background shadow-sm"),children:[c.jsx("div",{className:G("mb-4"),children:t}),e]})}function V1({description:t,title:e,properties:n,required:r,uiSchema:i,fieldPathId:s,schema:o,formData:a,optionalDataControl:l,onAddProperty:f,disabled:u,readonly:d,registry:h}){const g=U(i),m=L("TitleFieldTemplate",h,g),p=L("DescriptionFieldTemplate",h,g),y=!d&&!u,{ButtonTemplates:{AddButton:x}}=h.templates;return c.jsxs(c.Fragment,{children:[e&&c.jsx(m,{id:hr(s),title:e,required:r,schema:o,uiSchema:i,registry:h,optionalDataControl:y?l:void 0}),t&&c.jsx(p,{id:Et(s),description:t,schema:o,uiSchema:i,registry:h}),c.jsxs("div",{className:"flex flex-col gap-2",children:[y?void 0:l,n.map((S,j)=>c.jsx("div",{className:`${S.hidden?"hidden":""} flex`,children:c.jsx("div",{className:"w-full",children:S.content})},j)),fa(o,i,a)?c.jsx("div",{className:"mt-2 flex justify-end",children:c.jsx(x,{id:qe(s,"add"),onClick:f,disabled:u||d,className:"rjsf-object-property-expand",uiSchema:i,registry:h})}):null]})]})}function W1(t){const{id:e,registry:n,label:r,onAddClick:i,onRemoveClick:s}=t;return i?c.jsx(en,{id:e,registry:n,className:"rjsf-add-optional-data",onClick:i,title:r,icon:c.jsx(rc,{}),size:"xs"}):s?c.jsx(oc,{id:e,registry:n,className:"rjsf-remove-optional-data",onClick:s,title:r,size:"xs"}):c.jsx("em",{id:e,children:r})}function z1(t){const{submitText:e,norender:n,props:r}=El(t.uiSchema);return n?null:c.jsx("div",{children:c.jsx(as,{type:"submit",...r,className:G("my-2",r?.className),children:e})})}function ac({className:t,orientation:e="horizontal",decorative:n=!0,...r}){return c.jsx(Bc,{"data-slot":"separator",decorative:n,orientation:e,className:G("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...r})}function q1({id:t,title:e,uiSchema:n,optionalDataControl:r}){const i=U(n);let s=c.jsx("h5",{children:i.title||e});return r&&(s=c.jsxs("div",{className:"flex flex-row",children:[c.jsx("div",{className:"flex-grow",children:s}),c.jsx("div",{className:"flex",children:r})]})),c.jsxs("div",{id:t,className:"my-1 flex flex-col gap-0.5",children:[s,c.jsx(ac,{dir:"horizontal",style:{height:"1px"},className:"my-1"})]})}function K1({classNames:t,style:e,children:n,disabled:r,id:i,label:s,displayLabel:o,onRemoveProperty:a,onKeyRenameBlur:l,rawDescription:f,readonly:u,required:d,schema:h,uiSchema:g,registry:m}){const{templates:p,translateString:y}=m,{RemoveButton:x}=p.ButtonTemplates,S=y(K.KeyLabel,[s]);if(!(Qe in h))return c.jsx("div",{className:t,style:e,children:n});const v=o?22+(f?-28:0):0,w=`${i}-key`;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`grid grid-cols-12 col-span-12 items-center gap-2 ${t}`,style:e,children:[c.jsx("div",{className:"grid gap-2 col-span-5",children:c.jsxs("div",{className:"flex flex-col gap-2",children:[o&&c.jsx("label",{htmlFor:w,className:"text-sm font-medium text-muted-foreground leading-none",children:S}),c.jsx("div",{className:"pl-0.5",children:c.jsx(sc,{required:d,defaultValue:s,disabled:r||u,id:w,name:w,onBlur:u?void 0:l,type:"text",className:"w-full border shadow-sm"})}),!!f&&c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c.jsx("div",{className:"text-sm text-muted-foreground",children:" "})})]})}),c.jsx("div",{className:"grid gap-2 col-span-6 pr-0.5",children:n}),c.jsx("div",{className:"grid gap-2 col-span-1",style:{marginTop:`${v}px`},children:c.jsx(x,{id:qe(i,"remove"),iconType:"block",className:"rjsf-object-property-remove w-full",disabled:r||u,onClick:a,uiSchema:g,registry:m})})]}),c.jsx(ac,{dir:"horizontal",className:"mt-2"})]})}function G1(){return{ArrayFieldItemTemplate:O1,ArrayFieldTemplate:A1,BaseInputTemplate:C1,ButtonTemplates:{AddButton:j1,CopyButton:M1,MoveDownButton:R1,MoveUpButton:B1,RemoveButton:oc,SubmitButton:z1,ClearButton:U1},DescriptionFieldTemplate:_1,ErrorListTemplate:E1,FieldErrorTemplate:I1,FieldHelpTemplate:D1,FieldTemplate:$1,GridTemplate:k1,MultiSchemaFieldTemplate:L1,ObjectFieldTemplate:V1,OptionalDataControlsTemplate:W1,TitleFieldTemplate:q1,WrapIfAdditionalTemplate:K1}}function H1(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var Y1=["color"],X1=P.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=H1(t,Y1);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),P.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});function lc({className:t,...e}){return c.jsx(Uc,{"data-slot":"checkbox",className:G("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:c.jsx(Lc,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:c.jsx(X1,{className:"size-3.5"})})})}function ls({className:t,...e}){return c.jsx(Vc,{"data-slot":"label",className:G("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...e})}function J1(t){const{id:e,htmlName:n,value:r,disabled:i,readonly:s,label:o,hideLabel:a,schema:l,autofocus:f,options:u,onChange:d,onBlur:h,onFocus:g,registry:m,uiSchema:p,className:y}=t,x=hn(l),S=L("DescriptionFieldTemplate",m,u),j=O=>d(O),b=()=>h(e,r),v=()=>g(e,r),w=u.description||l.description;return c.jsxs("div",{className:`relative ${i||s?"cursor-not-allowed opacity-50":""}`,"aria-describedby":we(e),children:[!a&&w&&c.jsx(S,{id:Et(e),description:w,schema:l,uiSchema:p,registry:m}),c.jsxs("div",{className:"flex items-center gap-2 my-2",children:[c.jsx(lc,{id:e,name:n||e,checked:typeof r>"u"?!1:!!r,required:x,disabled:i||s,autoFocus:f,onCheckedChange:j,onBlur:b,onFocus:v,className:y}),c.jsx(ls,{className:"leading-tight",htmlFor:e,children:Dl(o,a||!o)})]})]})}function Z1({id:t,htmlName:e,disabled:n,options:r,value:i,autofocus:s,readonly:o,required:a,onChange:l,onBlur:f,onFocus:u,className:d}){const{enumOptions:h,enumDisabled:g,inline:m,emptyValue:p}=r,y=Array.isArray(i)?i:[i],x=({target:j})=>f(t,ge(j&&j.value,h,p)),S=({target:j})=>u(t,ge(j&&j.value,h,p));return c.jsx("div",{className:G({"flex flex-col gap-2":!m,"flex flex-row gap-4 flex-wrap":m}),children:Array.isArray(h)&&h.map((j,b)=>{const v=kn(j.value,y),w=Array.isArray(g)&&g.indexOf(j.value)!==-1,O=wt(t,b);return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(lc,{id:O,name:e||t,required:a,disabled:n||w||o,onCheckedChange:A=>{l(A?Nl(b,y,h):Cl(b,y,h))},className:d,checked:v,autoFocus:s&&b===0,onBlur:x,onFocus:S,"aria-describedby":we(t)}),c.jsx(ls,{className:"leading-tight",htmlFor:wt(t,b),children:j.label})]},O)})})}function Q1({className:t,...e}){return c.jsx(Cu,{"data-slot":"radio-group",className:G("grid gap-3",t),...e})}function eS({className:t,...e}){return c.jsx(_u,{"data-slot":"radio-group-item",className:G("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:c.jsx(Nu,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:c.jsx(h1,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function tS({id:t,options:e,value:n,required:r,disabled:i,readonly:s,onChange:o,onBlur:a,onFocus:l,className:f}){const{enumOptions:u,enumDisabled:d,emptyValue:h}=e,g=x=>o(ge(x,u,h)),m=({target:x})=>a(t,ge(x&&x.value,u,h)),p=({target:x})=>l(t,ge(x&&x.value,u,h)),y=!!(e&&e.inline);return c.jsx("div",{className:"mb-0",children:c.jsx(Q1,{defaultValue:n?.toString(),required:r,disabled:i||s,onValueChange:x=>{g(x)},onBlur:m,onFocus:p,"aria-describedby":we(t),orientation:y?"horizontal":"vertical",className:G("flex flex-wrap",{"flex-col":!y},f),children:Array.isArray(u)&&u.map((x,S)=>{const j=Array.isArray(d)&&d.indexOf(x.value)!==-1,b=kn(x.value,n);return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(eS,{checked:b,value:S.toString(),id:wt(t,S),disabled:j}),c.jsx(ls,{className:"leading-tight",htmlFor:wt(t,S),children:x.label})]},wt(t,S))})})})}var cc=["PageUp","PageDown"],uc=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],dc={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},tn="Slider",[li,nS,rS]=zc(tn),[fc]=Gc(tn,[rS]),[iS,yr]=fc(tn),mc=P.forwardRef((t,e)=>{const{name:n,min:r=0,max:i=100,step:s=1,orientation:o="horizontal",disabled:a=!1,minStepsBetweenThumbs:l=0,defaultValue:f=[r],value:u,onValueChange:d=()=>{},onValueCommit:h=()=>{},inverted:g=!1,form:m,...p}=t,y=P.useRef(new Set),x=P.useRef(0),j=o==="horizontal"?sS:oS,[b=[],v]=Wc({prop:u,defaultProp:f,onChange:N=>{[...y.current][x.current]?.focus(),d(N)}}),w=P.useRef(b);function O(N){const _=dS(b,N);T(N,_)}function A(N){T(N,x.current)}function C(){const N=w.current[x.current];b[x.current]!==N&&h(b)}function T(N,_,{commit:F}={commit:!1}){const $=pS(s),E=gS(Math.round((N-r)/s)*s+r,$),D=sa(E,[r,i]);v((M=[])=>{const k=cS(M,D,_);if(hS(k,l*s)){x.current=k.indexOf(D);const B=String(k)!==String(M);return B&&F&&h(k),B?k:M}else return M})}return c.jsx(iS,{scope:t.__scopeSlider,name:n,disabled:a,min:r,max:i,valueIndexToChangeRef:x,thumbs:y.current,values:b,orientation:o,form:m,children:c.jsx(li.Provider,{scope:t.__scopeSlider,children:c.jsx(li.Slot,{scope:t.__scopeSlider,children:c.jsx(j,{"aria-disabled":a,"data-disabled":a?"":void 0,...p,ref:e,onPointerDown:Rt(p.onPointerDown,()=>{a||(w.current=b)}),min:r,max:i,inverted:g,onSlideStart:a?void 0:O,onSlideMove:a?void 0:A,onSlideEnd:a?void 0:C,onHomeKeyDown:()=>!a&&T(r,0,{commit:!0}),onEndKeyDown:()=>!a&&T(i,b.length-1,{commit:!0}),onStepKeyDown:({event:N,direction:_})=>{if(!a){const E=cc.includes(N.key)||N.shiftKey&&uc.includes(N.key)?10:1,D=x.current,M=b[D],k=s*E*_;T(M+k,D,{commit:!0})}}})})})})});mc.displayName=tn;var[hc,pc]=fc(tn,{startEdge:"left",endEdge:"right",size:"width",direction:1}),sS=P.forwardRef((t,e)=>{const{min:n,max:r,dir:i,inverted:s,onSlideStart:o,onSlideMove:a,onSlideEnd:l,onStepKeyDown:f,...u}=t,[d,h]=P.useState(null),g=Yt(e,j=>h(j)),m=P.useRef(void 0),p=qc(i),y=p==="ltr",x=y&&!s||!y&&s;function S(j){const b=m.current||d.getBoundingClientRect(),v=[0,b.width],O=cs(v,x?[n,r]:[r,n]);return m.current=b,O(j-b.left)}return c.jsx(hc,{scope:t.__scopeSlider,startEdge:x?"left":"right",endEdge:x?"right":"left",direction:x?1:-1,size:"width",children:c.jsx(gc,{dir:p,"data-orientation":"horizontal",...u,ref:g,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:j=>{const b=S(j.clientX);o?.(b)},onSlideMove:j=>{const b=S(j.clientX);a?.(b)},onSlideEnd:()=>{m.current=void 0,l?.()},onStepKeyDown:j=>{const v=dc[x?"from-left":"from-right"].includes(j.key);f?.({event:j,direction:v?-1:1})}})})}),oS=P.forwardRef((t,e)=>{const{min:n,max:r,inverted:i,onSlideStart:s,onSlideMove:o,onSlideEnd:a,onStepKeyDown:l,...f}=t,u=P.useRef(null),d=Yt(e,u),h=P.useRef(void 0),g=!i;function m(p){const y=h.current||u.current.getBoundingClientRect(),x=[0,y.height],j=cs(x,g?[r,n]:[n,r]);return h.current=y,j(p-y.top)}return c.jsx(hc,{scope:t.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:c.jsx(gc,{"data-orientation":"vertical",...f,ref:d,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:p=>{const y=m(p.clientY);s?.(y)},onSlideMove:p=>{const y=m(p.clientY);o?.(y)},onSlideEnd:()=>{h.current=void 0,a?.()},onStepKeyDown:p=>{const x=dc[g?"from-bottom":"from-top"].includes(p.key);l?.({event:p,direction:x?-1:1})}})})}),gc=P.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:o,onEndKeyDown:a,onStepKeyDown:l,...f}=t,u=yr(tn,n);return c.jsx(Nn.span,{...f,ref:e,onKeyDown:Rt(t.onKeyDown,d=>{d.key==="Home"?(o(d),d.preventDefault()):d.key==="End"?(a(d),d.preventDefault()):cc.concat(uc).includes(d.key)&&(l(d),d.preventDefault())}),onPointerDown:Rt(t.onPointerDown,d=>{const h=d.target;h.setPointerCapture(d.pointerId),d.preventDefault(),u.thumbs.has(h)?h.focus():r(d)}),onPointerMove:Rt(t.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&i(d)}),onPointerUp:Rt(t.onPointerUp,d=>{const h=d.target;h.hasPointerCapture(d.pointerId)&&(h.releasePointerCapture(d.pointerId),s(d))})})}),yc="SliderTrack",xc=P.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=yr(yc,n);return c.jsx(Nn.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:e})});xc.displayName=yc;var ci="SliderRange",bc=P.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=yr(ci,n),s=pc(ci,n),o=P.useRef(null),a=Yt(e,o),l=i.values.length,f=i.values.map(h=>wc(h,i.min,i.max)),u=l>1?Math.min(...f):0,d=100-Math.max(...f);return c.jsx(Nn.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:a,style:{...t.style,[s.startEdge]:u+"%",[s.endEdge]:d+"%"}})});bc.displayName=ci;var ui="SliderThumb",vc=P.forwardRef((t,e)=>{const n=nS(t.__scopeSlider),[r,i]=P.useState(null),s=Yt(e,a=>i(a)),o=P.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return c.jsx(aS,{...t,ref:s,index:o})}),aS=P.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:i,...s}=t,o=yr(ui,n),a=pc(ui,n),[l,f]=P.useState(null),u=Yt(e,S=>f(S)),d=l?o.form||!!l.closest("form"):!0,h=Kc(l),g=o.values[r],m=g===void 0?0:wc(g,o.min,o.max),p=uS(r,o.values.length),y=h?.[a.size],x=y?fS(y,m,a.direction):0;return P.useEffect(()=>{if(l)return o.thumbs.add(l),()=>{o.thumbs.delete(l)}},[l,o.thumbs]),c.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${m}% + ${x}px)`},children:[c.jsx(li.ItemSlot,{scope:t.__scopeSlider,children:c.jsx(Nn.span,{role:"slider","aria-label":t["aria-label"]||p,"aria-valuemin":o.min,"aria-valuenow":g,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...s,ref:u,style:g===void 0?{display:"none"}:t.style,onFocus:Rt(t.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),d&&c.jsx(Sc,{name:i??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:g},r)]})});vc.displayName=ui;var lS="RadioBubbleInput",Sc=P.forwardRef(({__scopeSlider:t,value:e,...n},r)=>{const i=P.useRef(null),s=Yt(i,r),o=Hc(e);return P.useEffect(()=>{const a=i.current;if(!a)return;const l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==e&&u){const d=new Event("input",{bubbles:!0});u.call(a,e),a.dispatchEvent(d)}},[o,e]),c.jsx(Nn.input,{style:{display:"none"},...n,ref:s,defaultValue:e})});Sc.displayName=lS;function cS(t=[],e,n){const r=[...t];return r[n]=e,r.sort((i,s)=>i-s)}function wc(t,e,n){const s=100/(n-e)*(t-e);return sa(s,[0,100])}function uS(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function dS(t,e){if(t.length===1)return 0;const n=t.map(i=>Math.abs(i-e)),r=Math.min(...n);return n.indexOf(r)}function fS(t,e,n){const r=t/2,s=cs([0,50],[0,r]);return(r-s(e)*n)*n}function mS(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function hS(t,e){if(e>0){const n=mS(t);return Math.min(...n)>=e}return!0}function cs(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function pS(t){return(String(t).split(".")[1]||"").length}function gS(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var yS=mc,xS=xc,bS=bc,vS=vc;function SS({className:t,defaultValue:e,value:n,min:r=0,max:i=100,...s}){const o=P.useMemo(()=>Array.isArray(n)?n:Array.isArray(e)?e:[r,i],[n,e,r,i]);return c.jsxs(yS,{"data-slot":"slider",defaultValue:e,value:n,min:r,max:i,className:G("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...s,children:[c.jsx(xS,{"data-slot":"slider-track",className:G("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:c.jsx(bS,{"data-slot":"slider-range",className:G("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:o.length},(a,l)=>c.jsx(vS,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},l))]})}const wS=["name","min","max","step","orientation","disabled","defaultValue","value","onValueChange","className","dir","inverted","minStepsBetweenThumbs"];function jS({value:t,readonly:e,disabled:n,options:r,schema:i,onChange:s,label:o,id:a}){const l=d=>s(d[0]),f={...Fl(i)},u={id:a,...Gi(r.props||{},wS)};return c.jsxs(c.Fragment,{children:[c.jsx(SS,{disabled:n||e,min:f.min,max:f.max,step:f.step,value:[t],onValueChange:l,...u,"aria-describedby":we(a)}),t]})}const OS=mi("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function AS({className:t,variant:e,asChild:n=!1,...r}){const i=n?Yo:"span";return c.jsx(i,{"data-slot":"badge",className:G(OS({variant:e}),t),...r})}const jc=P.forwardRef(({className:t,...e},n)=>c.jsx(Ct,{ref:n,"data-slot":"command",className:G("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),...e})),CS=P.forwardRef(({className:t,...e},n)=>c.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[c.jsx(x1,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),c.jsx(Ct.Input,{ref:n,className:G("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));CS.displayName=Ct.Input.displayName;function Oc({className:t,...e}){return c.jsx(Ct.List,{"data-slot":"command-list",className:G("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),...e})}function Ac({className:t,...e}){return c.jsx(Ct.Group,{"data-slot":"command-group",className:G("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),...e})}function Cc({className:t,...e}){return c.jsx(Ct.Item,{"data-slot":"command-item",className:G("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...e})}function _S({multiple:t,items:e=[],selected:n,onValueChange:r,autoFocus:i=!1,disabled:s=!1,ariaDescribedby:o,ariaPlaceholder:a,onFocus:l,onBlur:f,className:u,id:d}){const h=P.useRef(null),[g,m]=P.useState(!1),[p,y]=P.useState(""),x=P.useMemo(()=>e.filter(O=>n.some(A=>dt(O.value,A))),[e,n]),S=P.useMemo(()=>e.filter(O=>!x.some(A=>dt(A.value,O.value))),[e,x]),j=P.useCallback(O=>{if(s)return;const A=x.filter(C=>!dt(C.value,O.value));r?.(A.map(C=>C.index))},[x,r,s]),b=P.useCallback(O=>{if(!(s||!h.current||h.current.value!==""))if(O.key==="Delete"||O.key==="Backspace"){const A=x.slice(0,-1);r?.(A.map(C=>C.index))}else O.key==="Escape"&&h.current.blur()},[x,r,s]),v=P.useCallback(O=>{if(s)return;y("");const A=t?[...x,O]:[O];r?.(A.map(C=>C.index))},[t,x,r,s]),w=P.useCallback(O=>{s||m(!0),l?.(O)},[s,l]);return c.jsxs(jc,{onKeyDown:b,className:G("overflow-visible bg-transparent",u),autoFocus:i,"aria-disabled":s,onBlur:f,onFocus:w,"aria-describedby":o,"aria-placeholder":a,children:[c.jsx("div",{className:G("group border border-input px-3 py-2 text-sm ring-offset-background rounded-md focus-within:ring-1 focus-within:ring-ring focus-within:ring-offset-1",s&&"opacity-50 cursor-not-allowed"),children:c.jsxs("div",{className:"flex gap-1 flex-wrap",children:[x.map(O=>c.jsxs(AS,{variant:"secondary",children:[O.label,c.jsx("button",{type:"button",className:"rtl:mr-1 ltr:ml-1 ring-offset-background rounded-full outline-none focus:ring-1 focus:ring-ring focus:ring-offset-1",onKeyDown:A=>A.key==="Enter"&&!s&&j(O),onMouseDown:A=>{A.preventDefault(),A.stopPropagation()},onClick:()=>j(O),disabled:s,children:c.jsx(ic,{className:G("h-3 w-3 text-muted-foreground hover:text-foreground",s&&"pointer-events-none")})})]},O.value)),c.jsx(Ct.Input,{ref:h,value:p,onValueChange:y,onBlur:()=>m(!1),onFocus:()=>!s&&m(!0),placeholder:"Select ...",className:"rtl:mr-2 ltr:ml-2 bg-transparent outline-none placeholder:text-muted-foreground flex-1",disabled:s,"aria-controls":`command-item-input-${d}`,"aria-labelledby":`command-item-input-${d}`,id:`command-item-input-${d}`})]})}),g&&!s&&S.length>0&&c.jsx("div",{className:"relative mt-2",children:c.jsx("div",{className:"absolute w-full z-10 top-0 rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in",children:c.jsx(Ac,{className:"h-full overflow-auto",children:c.jsx(Oc,{children:S.map(O=>c.jsx(Cc,{disabled:O.disabled,onMouseDown:A=>{A.preventDefault(),A.stopPropagation()},"aria-controls":`${O.value}-command-item`,"aria-labelledby":`${O.value}-command-item`,id:`${O.value}-command-item`,onSelect:()=>v(O),className:"cursor-pointer",children:O.label},`${O.value}-command-item`))})})})})]})}function NS({items:t,selected:e,onValueChange:n,autoFocus:r=!1,disabled:i=!1,required:s=!1,placeholder:o="Select...",ariaDescribedby:a,ariaPlaceholder:l,onFocus:f,onBlur:u,className:d}){const[h,g]=P.useState(!1),m=t?.find(S=>S.value===e),p=P.useRef(null),y=P.useRef(null);P.useEffect(()=>{h&&p.current&&requestAnimationFrame(()=>{var S;(S=p.current)===null||S===void 0||S.scrollIntoView({block:"nearest"})})},[h]);const x=S=>{y.current&&!y.current.contains(S.relatedTarget)&&g(!1),u?.(S)};return c.jsxs(jc,{ref:y,className:G("overflow-visible bg-transparent",d),autoFocus:r,"aria-disabled":i,onBlur:x,onFocus:f,"aria-describedby":a,"aria-placeholder":l,children:[c.jsxs("div",{onClick:()=>!i&&g(!h),className:G("flex h-9 w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",!m&&s&&"border-red-500",i&&"opacity-50 cursor-not-allowed",d),children:[c.jsx("span",{className:G("flex-1 line-clamp-1",!m&&"text-muted-foreground"),children:m?.label||o}),c.jsx(nc,{className:"h-4 w-4 opacity-50"})]}),c.jsx("div",{className:"relative",children:h&&t&&t.length>0?c.jsx("div",{style:{top:"0.5rem"},className:"absolute w-full z-10 rounded-md border bg-popover text-popover-foreground shadow-md outline-none",children:c.jsx(Ac,{className:"h-full overflow-auto",children:c.jsx(Oc,{children:t.map(S=>c.jsxs(Cc,{ref:S.value===e?p:void 0,onMouseDown:j=>{j.preventDefault(),j.stopPropagation()},onSelect:()=>{S.disabled||(n?.(S.value),g(!1))},className:G("cursor-pointer relative flex items-center justify-between rounded-sm py-1.5 gap-2 rtl:flex-row-reverse",S.value===e&&"font-semibold",S.disabled&&"opacity-50 cursor-not-allowed"),children:[c.jsx("span",{children:S.label}),c.jsx("span",{className:"flex h-3.5 w-3.5 items-center justify-center",children:S.value===e&&c.jsx(o1,{className:"h-4 w-4"})})]},S.value))})})}):null})]})}function TS({id:t,options:e,required:n,disabled:r,readonly:i,value:s,multiple:o,autofocus:a,onChange:l,onBlur:f,onFocus:u,defaultValue:d,placeholder:h,rawErrors:g=[],className:m}){const{enumOptions:p,enumDisabled:y,emptyValue:x}=e,S=()=>{u(t,ge(s,p,x))},j=()=>{f(t,ge(s,p,x))},b=p?.map(({value:w,label:O},A)=>({value:o?w:A.toString(),label:O,index:A,disabled:Array.isArray(y)&&y.includes(w)})),v=G({"border-destructive":g.length>0},m);return c.jsx("div",{className:"p-0.5",children:o?c.jsx(_S,{id:t,autoFocus:a,disabled:r||i,multiple:!0,className:v,items:b,selected:s,onValueChange:w=>{l(ge(w,p,x))},onFocus:S,onBlur:j}):c.jsx(NS,{items:b,selected:_l(s??d,p,!1),onValueChange:w=>{l(ge(w,p,x))},autoFocus:a,disabled:r||i,required:n,placeholder:h,className:v,onFocus:S,onBlur:j,ariaDescribedby:we(t)})})}function FS({className:t,...e}){return c.jsx("textarea",{"data-slot":"textarea",className:G("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...e})}function PS({id:t,htmlName:e,placeholder:n,value:r,required:i,disabled:s,autofocus:o,readonly:a,onBlur:l,onFocus:f,onChange:u,options:d,className:h}){const g=({target:{value:y}})=>u(y===""?d.emptyValue:y),m=({target:y})=>l(t,y&&y.value),p=({target:y})=>f(t,y&&y.value);return c.jsx("div",{className:"flex p-0.5",children:c.jsx(FS,{id:t,name:e||t,placeholder:n,disabled:s,readOnly:a,value:r??"",required:i,autoFocus:o,rows:d.rows||5,onChange:g,onBlur:m,onFocus:p,"aria-describedby":we(t),className:h})})}function ES(){return{CheckboxWidget:J1,CheckboxesWidget:Z1,RadioWidget:tS,RangeWidget:jS,SelectWidget:TS,TextareaWidget:PS}}function IS(){return{templates:G1(),widgets:ES()}}function DS(){return Uv(IS())}const $S=DS();function kS(t){const e=t.properties;if(!e)return!1;const n=e.__type,r=e.__binding;return!!(n?.const||r?.const)}function MS(t){const e=t.properties;if(!e)return{};const n=e.__type,r=e.__binding;return{bindingType:n?.const,bindingSchema:r?.const}}function RS(t){return t.replace(/^root_/,"").split("_")[0]||""}function Ko(t){return typeof t!="string"?!1:(t.startsWith("@")?t.slice(1):t).includes("/")}function BS(t){const e=ve.c(8),{bindingSchema:n,bindingType:r,currentValue:i,onValueChange:s,placeholder:o,onAddNew:a,className:l}=t,f=Ko(n),u=Ko(r),d=f||u,h=f?n:u?r:void 0,{bindingSchema:g}=Id(h);let m;e:{if(d){m=g;break e}if(Array.isArray(n)){m=n;break e}if(typeof n=="string"){m=n;break e}m=void 0}const p=m;let y;return e[0]!==r||e[1]!==l||e[2]!==i||e[3]!==a||e[4]!==s||e[5]!==o||e[6]!==p?(y=c.jsx(US,{value:i,onValueChange:s,placeholder:o,binding:p,bindingType:r,onAddNew:a,className:l}),e[0]=r,e[1]=l,e[2]=i,e[3]=a,e[4]=s,e[5]=o,e[6]=p,e[7]=y):y=e[7],y}function US({value:t,onValueChange:e,placeholder:n="Select a connection...",binding:r,bindingType:i,onAddNew:s,className:o}){const[a,l]=P.useState(!1),{installByBinding:f,isInstalling:u}=$d(),d=a||u,h=pi(),g=ea({connections:h,binding:r}),m=(()=>{if(!i?.startsWith("@"))return null;const[S,j]=i.replace("@","").split("/");return S&&j?{scope:S,appName:j}:null})(),p=(()=>{let S=g;const j=Array.isArray(r)&&r.length>0;if(m&&!j&&(S=S.filter(b=>{const v=b.app_name,w=b.metadata?.scopeName;return v===m.appName&&w===m.scope})),t&&!S.some(b=>b.id===t)){const b=h?.find(v=>v.id===t);if(b)return[b,...S]}return S})(),y=i?.startsWith("@"),x=async()=>{if(y&&i){l(!0);try{const S=await f(i);S&&e(S.id)}catch(S){const j=S instanceof Error?S.message:String(S);Ut.error(`Failed to connect MCP: ${j}`)}finally{l(!1)}return}s?.()};return c.jsxs(ta,{value:t,onValueChange:e,children:[c.jsx(na,{size:"sm",className:hu("w-[200px]",o),children:c.jsx(ra,{placeholder:n})}),c.jsxs(ia,{children:[p.length===0?c.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No connections found"}):p.map(S=>c.jsx(kt,{value:S.id,children:c.jsxs("div",{className:"flex items-center gap-2",children:[S.icon?c.jsx("img",{src:S.icon,alt:S.title,className:"w-4 h-4 rounded"}):c.jsx("div",{className:"w-4 h-4 rounded bg-linear-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:S.title.slice(0,1).toUpperCase()}),c.jsx("span",{children:S.title})]})},S.id)),(s||y)&&c.jsx("div",{className:"border-t border-border",children:c.jsx(Wt,{onClick:S=>{S.preventDefault(),S.stopPropagation(),x()},disabled:d,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:d?c.jsxs(c.Fragment,{children:[c.jsx(yn,{size:16,className:"animate-spin"}),c.jsx("span",{children:"Connecting..."})]}):c.jsxs(c.Fragment,{children:[c.jsx(aa,{size:16}),c.jsx("span",{children:"Custom Connection"})]})})})]})]})}function LS(t){const e=ve.c(68),{schema:n,formData:r,title:i,description:s,registry:o}=t,a=o.formContext,l=t.properties[0]?.content?.key;let f;e[0]!==l||e[1]!==i?(f=i||(l?RS(l):""),e[0]=l,e[1]=i,e[2]=f):f=e[2];const u=f;if(kS(n)){const g=n;let m;e[3]!==g?(m=MS(g),e[3]=g,e[4]=m):m=e[4];const{bindingType:p,bindingSchema:y}=m,x=r?.value||"";let S;e[5]!==p||e[6]!==u||e[7]!==a||e[8]!==r?(S=M=>{const k={...r,value:M,...p&&{__type:p}};a?.onFieldChange(u,k)},e[5]=p,e[6]=u,e[7]=a,e[8]=r,e[9]=S):S=e[9];const j=S;let b;e[10]!==p||e[11]!==u||e[12]!==a?(b=M=>{a?.onFieldChange(u,{__type:p,value:{id:M.id,connectionId:M.connectionId}})},e[10]=p,e[11]=u,e[12]=a,e[13]=b):b=e[13];const v=b,w=WS;let O;e[14]!==u||e[15]!==i?(O=w(i||u),e[14]=u,e[15]=i,e[16]=O):O=e[16];const A=O;if(p==="@deco/agent"){let M;e[17]!==A?(M=c.jsx("label",{className:"text-sm font-medium truncate block",children:A}),e[17]=A,e[18]=M):M=e[18];let k;e[19]!==s?(k=s&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s}),e[19]=s,e[20]=k):k=e[20];let B;e[21]!==M||e[22]!==k?(B=c.jsxs("div",{className:"flex-1 min-w-0",children:[M,k]}),e[21]=M,e[22]=k,e[23]=B):B=e[23];const W=x||void 0;let R;e[24]!==j||e[25]!==W?(R=c.jsx(Fu,{selectedVirtualMcpId:W,onVirtualMcpChange:j,variant:"bordered",placeholder:"Select Agent",className:"w-[200px] shrink-0"}),e[24]=j,e[25]=W,e[26]=R):R=e[26];let V;return e[27]!==R||e[28]!==B?(V=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[B,R]}),e[27]=R,e[28]=B,e[29]=V):V=e[29],V}if(p==="@deco/language-model"){let M;e[30]!==A?(M=c.jsx("label",{className:"text-sm font-medium truncate block",children:A}),e[30]=A,e[31]=M):M=e[31];let k;e[32]!==s?(k=s&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s}),e[32]=s,e[33]=k):k=e[33];let B;e[34]!==M||e[35]!==k?(B=c.jsxs("div",{className:"flex-1 min-w-0",children:[M,k]}),e[34]=M,e[35]=k,e[36]=B):B=e[36];const W=x;let R;e[37]!==v||e[38]!==W?(R=c.jsx(Pu,{selectedModel:W,onModelChange:v,variant:"bordered",placeholder:"Select Language Model",className:"w-[200px] shrink-0"}),e[37]=v,e[38]=W,e[39]=R):R=e[39];let V;return e[40]!==R||e[41]!==B?(V=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[B,R]}),e[40]=R,e[41]=B,e[42]=V):V=e[42],V}let C;e[43]!==A?(C=c.jsx("label",{className:"text-sm font-medium truncate block",children:A}),e[43]=A,e[44]=C):C=e[44];let T;e[45]!==s?(T=s&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s}),e[45]=s,e[46]=T):T=e[46];let N;e[47]!==C||e[48]!==T?(N=c.jsxs("div",{className:"flex-1 min-w-0",children:[C,T]}),e[47]=C,e[48]=T,e[49]=N):N=e[49];let _;e[50]!==A?(_=A.toLowerCase(),e[50]=A,e[51]=_):_=e[51];const F=`Select ${_}...`;let $;e[52]!==a?($=()=>a?.onAddNew(),e[52]=a,e[53]=$):$=e[53];let E;e[54]!==y||e[55]!==p||e[56]!==x||e[57]!==j||e[58]!==F||e[59]!==$?(E=c.jsx(BS,{bindingSchema:y,bindingType:p,currentValue:x,onValueChange:j,placeholder:F,onAddNew:$,className:"w-[200px] shrink-0"}),e[54]=y,e[55]=p,e[56]=x,e[57]=j,e[58]=F,e[59]=$,e[60]=E):E=e[60];let D;return e[61]!==E||e[62]!==N?(D=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[N,E]}),e[61]=E,e[62]=N,e[63]=D):D=e[63],D}let d;e[64]!==t.properties?(d=t.properties.map(VS),e[64]=t.properties,e[65]=d):d=e[65];let h;return e[66]!==d?(h=c.jsx("div",{className:"flex flex-col gap-4",children:d}),e[66]=d,e[67]=h):h=e[67],h}function VS(t){return t.content}function WS(t){return t.toLowerCase().replace(/_/g," ").replace(/\b\w/g,zS)}function zS(t){return t.toUpperCase()}function qS(t){const e=ve.c(13),{label:n,children:r,description:i,id:s,schema:o}=t;if(s.includes("__type")||s.includes("__binding"))return null;if(o.type==="object")return r;let a;e[0]!==s||e[1]!==n?(a=n&&c.jsx("label",{className:"text-sm font-medium truncate block",htmlFor:s,children:n}),e[0]=s,e[1]=n,e[2]=a):a=e[2];let l;e[3]!==i?(l=i&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i}),e[3]=i,e[4]=l):l=e[4];let f;e[5]!==a||e[6]!==l?(f=c.jsxs("div",{className:"flex-1 min-w-0",children:[a,l]}),e[5]=a,e[6]=l,e[7]=f):f=e[7];let u;e[8]!==r?(u=c.jsx("div",{className:"w-[200px] shrink-0",children:r}),e[8]=r,e[9]=u):u=e[9];let d;return e[10]!==f||e[11]!==u?(d=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[f,u]}),e[10]=f,e[11]=u,e[12]=d):d=e[12],d}const KS={ObjectFieldTemplate:LS,FieldTemplate:qS};function GS(t){const e=ve.c(18),{formState:n,onFormStateChange:r,stateSchema:i}=t,{org:s}=gi(),o=Go();let a;e[0]!==r?(a=x=>{x.formData&&r(x.formData)},e[0]=r,e[1]=a):a=e[1];const l=a;let f;e[2]!==n||e[3]!==r?(f=(x,S)=>{const j={...n,[x]:S};r(j)},e[2]=n,e[3]=r,e[4]=f):f=e[4];const u=f;let d;e[5]!==o||e[6]!==s?(d=()=>{o({to:"/$org/mcps",params:{org:s.slug},search:{action:"create"}})},e[5]=o,e[6]=s,e[7]=d):d=e[7];const h=d;let g;e[8]!==n||e[9]!==h||e[10]!==u?(g={onFieldChange:u,formData:n,onAddNew:h},e[8]=n,e[9]=h,e[10]=u,e[11]=g):g=e[11];const m=g;let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(c.Fragment,{}),e[12]=p):p=e[12];let y;return e[13]!==m||e[14]!==n||e[15]!==l||e[16]!==i?(y=c.jsx("div",{className:"flex flex-col h-full overflow-auto p-5",children:c.jsx($S,{schema:i,validator:Qv,formData:n,onChange:l,formContext:m,liveValidate:!1,showErrorList:!1,templates:KS,children:p})}),e[13]=m,e[14]=n,e[15]=l,e[16]=i,e[17]=y):y=e[17],y}const HS=Xo({key:Ae().min(1,"Key is required"),value:Ae()}),YS=Xo({title:Ae().min(1,"Name is required"),description:Ae().nullable().optional(),ui_type:Jc(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:Ae().optional(),connection_token:Ae().nullable().optional(),npx_package:Ae().optional(),stdio_command:Ae().optional(),stdio_args:Ae().optional(),stdio_cwd:Ae().optional(),env_vars:ds(HS).optional(),configuration_scopes:ds(Ae()).nullable().optional(),configuration_state:Yc(Ae(),Xc()).nullable().optional()}).refine(t=>t.ui_type==="NPX"?!!t.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(t=>t.ui_type==="STDIO"?!!t.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(t=>t.ui_type==="HTTP"||t.ui_type==="SSE"||t.ui_type==="Websocket"?!!t.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function XS(t){return t.command==="npx"}function JS(t){return t.args?.find(e=>!e.startsWith("-"))??""}function ZS(t){return{command:t.command,args:t.args?.join(" ")??"",cwd:t.cwd??""}}function QS(t,e){const n={command:"npx",args:["-y",t]},r=Jo(e);return Object.keys(r).length>0&&(n.envVars=r),n}function ew(t,e,n,r){const i={command:t};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const s=Jo(r);return Object.keys(s).length>0&&(i.envVars=s),i}function tw(t,e){const n={title:t.title,description:t.description??"",configuration_state:t.configuration_state??{},configuration_scopes:e||t.configuration_scopes||[]};if(t.connection_type==="STDIO"&&su(t.connection_headers)){const r=t.connection_headers,i=au(r.envVars);if(XS(r)){const o=JS(r);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:o,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const s=ZS(r);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:s.command,stdio_args:s.args,stdio_cwd:s.cwd,env_vars:i}}return{...n,ui_type:t.connection_type,connection_url:t.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function nw(t){let e,n=null,r=null,i=null;return t.ui_type==="NPX"?(e="STDIO",n="",i=QS(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(e="STDIO",n="",i=ew(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(e=t.ui_type,n=t.connection_url||"",r=t.connection_token||null),{title:t.title,description:t.description||null,connection_type:e,connection_url:n,...r&&{connection_token:r},...i&&{connection_headers:i},configuration_state:t.configuration_state??null,configuration_scopes:t.configuration_scopes??null}}function rw(t){const e=ve.c(13);let n;e[0]!==t?(n=hi(t),e[0]=t,e[1]=n):n=e[1];const r=n;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i={},e[2]=i):i=e[2];let s;e[3]!==t||e[4]!==r?(s={toolCaller:r,toolName:"MCP_CONFIGURATION",toolInputParams:i,scope:t},e[3]=t,e[4]=r,e[5]=s):s=e[5];const{data:o}=fu(s);let a;e[6]!==o.stateSchema?(a=o.stateSchema??{type:"object",properties:{}},e[6]=o.stateSchema,e[7]=a):a=e[7];const l=a;let f;e[8]!==o.scopes?(f=o.scopes??[],e[8]=o.scopes,e[9]=f):f=e[9];const u=f;let d;return e[10]!==u||e[11]!==l?(d={stateSchema:l,scopes:u},e[10]=u,e[11]=l,e[12]=d):d=e[12],d}function iw(t){const e=ve.c(4),{onAuthenticate:n,buttonText:r}=t,i=r===void 0?"Authenticate":r;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Authentication Required"}),c.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"This connection requires OAuth authentication to access resources."})]}),e[0]=s):s=e[0];let o;return e[1]!==i||e[2]!==n?(o=c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[s,c.jsx(Wt,{onClick:n,size:"lg",children:i})]})}),e[1]=i,e[2]=n,e[3]=o):o=e[3],o}function sw(t){const e=ve.c(7),{hasReadme:n,onViewReadme:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(gu,{size:48,className:"text-muted-foreground"}),e[0]=i):i=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Manual Authentication Required"}),c.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"This server requires an API key or token that must be configured manually. Check the server's documentation for instructions on obtaining credentials."})]}),e[1]=s):s=e[1];let o;e[2]!==n||e[3]!==r?(o=n&&r&&c.jsxs(Wt,{onClick:r,variant:"outline",size:"lg",children:[c.jsx(pu,{size:18,className:"mr-2"}),"View README"]}),e[2]=n,e[3]=r,e[4]=o):o=e[4];let a;return e[5]!==o?(a=c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[i,s,o]})}),e[5]=o,e[6]=a):a=e[6],a}function ow(){const t=ve.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx("img",{src:"/empty-state-error.svg",alt:"",width:160,height:160,"aria-hidden":"true"}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[e,c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Server Error"}),c.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"The MCP server is currently experiencing issues. Please try again later or check the server's status."})]})]})}),t[1]=n):n=t[1],n}function aw(t){const e=ve.c(3),n=rw(t.connection.id);let r;return e[0]!==n||e[1]!==t?(r=c.jsx(_c,{...t,...n}),e[0]=n,e[1]=t,e[2]=r):r=e[2],r}function lw(t){const e=ve.c(2);let n;return e[0]!==t?(n=c.jsx(_c,{...t}),e[0]=t,e[1]=n):n=e[1],n}function cw(t){const e=ve.c(13),{hasMcpBinding:n,stateSchema:r,formState:i,onFormStateChange:s,onAuthenticate:o,onViewReadme:a,isMCPAuthenticated:l,supportsOAuth:f,isServerError:u,hasReadme:d}=t,h=r&&r.properties&&typeof r.properties=="object"&&Object.keys(r.properties).length>0;if(!l){if(u){let y;return e[0]===Symbol.for("react.memo_cache_sentinel")?(y=c.jsx(ow,{}),e[0]=y):y=e[0],y}if(f){let y;return e[1]!==o?(y=c.jsx(iw,{onAuthenticate:o}),e[1]=o,e[2]=y):y=e[2],y}let p;return e[3]!==d||e[4]!==a?(p=c.jsx(sw,{hasReadme:d,onViewReadme:a}),e[3]=d,e[4]=a,e[5]=p):p=e[5],p}if(!n)return null;if(!h||!r){let p;return e[6]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx("div",{className:"w-3/5 min-w-0 overflow-auto flex items-center justify-center",children:c.jsx(uu,{image:c.jsx("img",{src:"/empty-state-success-muted.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),title:"This server is all set!",description:"No additional configuration is needed. Everything is ready to go."})}),e[6]=p):p=e[6],p}let g;e[7]!==i?(g=i??{},e[7]=i,e[8]=g):g=e[8];let m;return e[9]!==s||e[10]!==r||e[11]!==g?(m=c.jsx("div",{className:"w-3/5 min-w-0 overflow-auto",children:c.jsx(GS,{stateSchema:r,formState:g,onFormStateChange:s})}),e[9]=s,e[10]=r,e[11]=g,e[12]=m):m=e[12],m}function _c(t){const{connection:e,onUpdate:n,isUpdating:r,scopes:i,hasMcpBinding:s,stateSchema:o,onViewReadme:a}=t,l=Zo(),f=Zc(),d=Qc().location.href,g=!!e?.metadata?.repository?.url,m=eu({resolver:tu(YS),values:tw(e,i)}),p=m.watch("configuration_state"),y=m.formState.isDirty,x=b=>{m.setValue("configuration_state",b,{shouldDirty:!0})},S=async()=>{if(!await m.trigger())return;const v=m.getValues(),w=nw(v);await n(w),m.reset(v)},j=async()=>{const{token:b,tokenInfo:v,error:w}=await ru({connectionId:e.id});if(w||!b){Ut.error(`Authentication failed: ${w}`);return}if(v)try{const A=await fetch(`/api/connections/${e.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:v.accessToken,refreshToken:v.refreshToken,expiresIn:v.expiresIn,scope:v.scope,clientId:v.clientId,clientSecret:v.clientSecret,tokenEndpoint:v.tokenEndpoint})});if(!A.ok)console.error("Failed to save OAuth token:",await A.text()),await l.update.mutateAsync({id:e.id,data:{connection_token:b}});else try{await l.update.mutateAsync({id:e.id,data:{}})}catch(C){console.warn("Failed to refresh connection tools after OAuth:",C)}}catch(A){console.error("Error saving OAuth token:",A),await l.update.mutateAsync({id:e.id,data:{connection_token:b}})}else await l.update.mutateAsync({id:e.id,data:{connection_token:b}});const O=new URL(`/mcp/${e.id}`,window.location.origin);await f.invalidateQueries({queryKey:di.isMCPAuthenticated(O.href,null)}),Ut.success("Authentication successful")};return c.jsxs(c.Fragment,{children:[c.jsxs(yu,{children:[c.jsx(mu,{title:`${e.title}: Settings`,url:d,icon:e.icon??"settings"}),y&&c.jsxs(Wt,{onClick:S,disabled:r,size:"sm",className:"h-7",children:[r&&c.jsx(yn,{size:16,className:"mr-2 animate-spin"}),"Save Changes"]})]}),c.jsxs("div",{className:"flex h-full",children:[c.jsx("div",{className:"w-2/5 shrink-0 border-r border-border overflow-auto",children:c.jsx(Nd,{form:m,connection:e,hasOAuthToken:t.hasOAuthToken})}),c.jsx(du,{children:c.jsx(P.Suspense,{fallback:c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsx(yn,{size:32,className:"animate-spin text-muted-foreground"})}),children:c.jsx(cw,{hasMcpBinding:s,stateSchema:o,formState:p??void 0,onFormStateChange:x,onAuthenticate:j,onViewReadme:a,isMCPAuthenticated:t.isMCPAuthenticated,supportsOAuth:t.supportsOAuth,isServerError:t.isServerError,hasReadme:g})})})]})]})}function zw(t){const e=ve.c(5);let n;e[0]!==t.connection?(n={connections:[t.connection],binding:"MCP"},e[0]=t.connection,e[1]=n):n=e[1];const i=ea(n).length>0;let s;return e[2]!==i||e[3]!==t?(s=c.jsx("div",{className:"flex-1",children:i?c.jsx(aw,{...t,hasMcpBinding:!0}):c.jsx(lw,{...t,hasMcpBinding:!1})}),e[2]=i,e[3]=t,e[4]=s):s=e[4],s}export{Bv as F,sw as M,iw as O,zw as S,Vw as u,Qv as v};
|
|
25
|
+
`;case"21":return D("p",{key:E.key},$(F.children,E));default:return null}})(C,T,N,p,y,x,S);return m?m(_,C,T,N):_()})(v,b,w);return w.renderDepth=O-1,A}catch(A){if(A instanceof RangeError&&A.message.includes("Maximum call stack"))return j(v);throw A}}})(e.renderRule,a,r,n,u);return l(t)}const Rn=t=>{let{children:e,options:n}=t,r=(function(i,s){if(i==null)return{};var o={};for(var a in i)if({}.hasOwnProperty.call(i,a)){if(s.indexOf(a)!==-1)continue;o[a]=i[a]}return o})(t,O0);return Cb(e??"",Ve({},n,{wrapperProps:Ve({},n?.wrapperProps,r)}))},Jl=Symbol("remove-this-key"),Uo=Symbol("reset");function _b(t,e){return Array.isArray(t.required)&&t.required.indexOf(e)!==-1}function Nb(t,e){switch(e){case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{};default:return t(K.NewStringDefault)}}function Tb(t){const{fieldPathId:e,schema:n,registry:r,uiSchema:i,errorSchema:s,formData:o,onChange:a,onBlur:l,onFocus:f,disabled:u,readonly:d,required:h,hideError:g,propertyName:m,handleKeyRename:p,handleRemoveProperty:y,addedByAdditionalProperties:x}=t,[S,j]=P.useState(!1),{globalFormOptions:b,fields:v}=r,{SchemaField:w}=v,O=It(Fe(m,b,e.path)),A=P.useCallback((_,F,$,E)=>{_===void 0&&x&&(_=""),a(_,F,$,E)},[a,x]),C=P.useCallback(_=>{m!==_&&j(!0),p(m,_)},[m,p]),T=P.useCallback(_=>{const{target:{value:F}}=_;C(F)},[C]),N=P.useCallback(()=>{y(m)},[m,y]);return c.jsx(w,{name:m,required:h,schema:n,uiSchema:i,errorSchema:s,fieldPathId:O,formData:o,wasPropertyKeyModified:S,onKeyRename:C,onKeyRenameBlur:T,onRemoveProperty:N,onChange:A,onBlur:l,onFocus:f,registry:r,disabled:u,readonly:d,hideError:g})}function Fb(t){const{schema:e,uiSchema:n={},formData:r,errorSchema:i,fieldPathId:s,name:o,required:a=!1,disabled:l,readonly:f,hideError:u,onBlur:d,onFocus:h,onChange:g,registry:m,title:p}=t,{fields:y,schemaUtils:x,translateString:S,globalUiOptions:j}=m,{OptionalDataControlsField:b}=y,v=x.retrieveSchema(e,r,!0),w=U(n,j),{properties:O={}}=v,A=t.childFieldPathId??s,C=w.title??v.title??p??o,T=w.description??v.description,N=Mn(m,v,a,n),_=Qt(r);let F=[];const $=P.useCallback((R,V)=>{const{duplicateKeySuffixSeparator:Q="-"}=U(n,j);let ne=0,ie=R;for(;X(V,ie);)ie=`${R}${Q}${++ne}`;return ie},[n,j]),E=P.useCallback(()=>{if(!(v.additionalProperties||v.patternProperties))return;const{translateString:R}=m,V={...r},Q=$("newKey",V);if(v.patternProperties)se(V,Q,null);else{let ne,ie,de;if(Z(v.additionalProperties)){ne=v.additionalProperties.type,ie=v.additionalProperties.const,de=v.additionalProperties.default;let z=v.additionalProperties;if(ce in z){const{schemaUtils:H}=m;z=H.retrieveSchema({[ce]:z[ce]},r),ne=z.type,ie=z.const,de=z.default}!ne&&(J in z||q in z)&&(ne="object")}const ee=ie??de??Nb(R,ne);se(V,Q,ee)}g(V,A.path)},[r,g,m,A,$,v]),D=P.useCallback((R,V)=>{if(R!==V){const Q=$(V,r),ne={...r},ie={[R]:Q},de=Object.keys(ne).map(z=>({[ie[z]||z]:ne[z]})),ee=Object.assign({},...de);g(ee,A.path)}},[r,g,A,$]),M=P.useCallback(R=>{g(Jl,[...A.path,R])},[g,A]);if(!N||_)try{const R=Object.keys(O);F=Ox(R,w.order)}catch(R){return c.jsxs("div",{children:[c.jsx("p",{className:"rjsf-config-error",style:{color:"red"},children:c.jsx(Rn,{options:{disableParsingRawHTML:!0},children:S(K.InvalidObjectField,[o||"root",R.message])})}),c.jsx("pre",{children:JSON.stringify(v)})]})}const k=L("ObjectFieldTemplate",m,w),B=N?c.jsx(b,{...t,fieldPathId:A,schema:v}):void 0,W={title:w.label===!1?"":C,description:w.label===!1?void 0:T,properties:F.map(R=>{const V=X(v,[te,R,Qe]),Q=V?n.additionalProperties:n[R],ne=U(Q).widget==="hidden";return{content:c.jsx(Tb,{propertyName:R,required:_b(v,R),schema:I(v,[te,R],{}),uiSchema:Q,errorSchema:I(i,[R]),fieldPathId:A,formData:I(r,[R]),handleKeyRename:D,handleRemoveProperty:M,addedByAdditionalProperties:V,onChange:g,onBlur:d,onFocus:h,registry:m,disabled:l,readonly:f,hideError:u},R),name:R,readonly:f,disabled:l,required:a,hidden:ne}}),readonly:f,disabled:l,required:a,fieldPathId:s,uiSchema:n,errorSchema:i,schema:v,formData:r,registry:m,optionalDataControl:B,className:N?"rjsf-optional-object-field":void 0};return c.jsx(k,{...W,onAddProperty:E})}function Pb(t){const{schema:e,uiSchema:n={},formData:r,disabled:i=!1,readonly:s=!1,onChange:o,errorSchema:a,fieldPathId:l,registry:f}=t,{globalUiOptions:u={},schemaUtils:d,translateString:h}=f,g=U(n,u),m=L("OptionalDataControlsTemplate",f,g),p=Qt(r);let y,x,S,j;if(i||s)y=kr(l,"Msg"),x=p?void 0:h(K.OptionalObjectEmptyMsg);else{const b=p?K.OptionalObjectRemove:K.OptionalObjectAdd;x=h(b),p?(y=kr(l,"Remove"),j=()=>o(void 0,l.path,a)):(y=kr(l,"Add"),S=()=>{let v=d.getDefaultFormState(e,r,"excludeObjectChildren");v===void 0&&(v=Ie(e)==="array"?[]:{}),o(v,l.path,a)})}return x&&c.jsx(m,{id:y,registry:f,schema:e,uiSchema:n,label:x,onAddClick:S,onRemoveClick:j})}const Eb={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function Ib(t,e,n){const r=e.field,{fields:i}=n;if(typeof r=="function")return r;if(typeof r=="string"&&r in i)return i[r];const s=Ie(t),o=Array.isArray(s)?s[0]:s||"",a=t.$id;let l=Eb[o];return a&&a in i&&(l=a),!l&&(t.anyOf||t.oneOf)?()=>null:l in i?i[l]:i.FallbackField}function Db(t){const{schema:e,fieldPathId:n,uiSchema:r,formData:i,errorSchema:s,name:o,onChange:a,onKeyRename:l,onKeyRenameBlur:f,onRemoveProperty:u,required:d=!1,registry:h,wasPropertyKeyModified:g=!1}=t,{schemaUtils:m,globalFormOptions:p,globalUiOptions:y,fields:x}=h,{AnyOfField:S,OneOfField:j}=x,b=U(r,y),v=L("FieldTemplate",h,b),w=L("DescriptionFieldTemplate",h,b),O=L("FieldHelpTemplate",h,b),A=L("FieldErrorTemplate",h,b),C=m.retrieveSchema(e,i),T=n[oe],N=P.useCallback((De,nn,Je,Nc)=>a(De,nn,Je,Nc||T),[T,a]),_=Ib(C,b,h),F=!!(b.disabled??t.disabled),$=!!(b.readonly??(t.readonly||t.schema.readOnly||C.readOnly)),E=b.hideError,D=E===void 0?t.hideError:!!E,M=!!(b.autofocus??t.autofocus);if(Object.keys(C).length===0)return null;let k=m.getDisplayLabel(C,r,y);const B=b.field&&b.fieldReplacesAnyOrOneOf===!0;let W,R,V={fieldPathId:n};if((J in C||q in C)&&!B&&!m.isSelect(C)){C[J]?(W=S,R=C[J].map(Je=>m.retrieveSchema(Z(Je)?Je:{},i))):C[q]&&(W=j,R=C[q].map(Je=>m.retrieveSchema(Z(Je)?Je:{},i)));const De=Mn(h,C,d,r),nn=Qt(i);k=k&&(!De||nn),V={childFieldPathId:n,fieldPathId:Fe("XxxOf",p,n)}}const{__errors:Q,...ne}=s||{},ie=wn(r,["ui:classNames","classNames","ui:style"]);ut in ie&&(ie[ut]=wn(ie[ut],["classNames","style"]));const de=c.jsx(_,{...t,onChange:N,...V,schema:C,uiSchema:ie,disabled:F,readonly:$,hideError:D,autofocus:M,errorSchema:ne,rawErrors:Q}),ee=n[oe];let z;g?z=o:z=Qe in C?o:b.title||t.schema.title||C.title||t.title||o;const H=b.description||t.schema.description||C.description||"",re=b.help,fe=b.widget==="hidden",je=["rjsf-field",`rjsf-field-${Ie(C)}`];!D&&Q&&Q.length>0&&je.push("rjsf-field-error"),b.classNames&&je.push(b.classNames);const Se=c.jsx(O,{help:re,fieldPathId:n,schema:C,uiSchema:r,hasErrors:!D&&Q&&Q.length>0,registry:h}),pe=D||W&&!m.isSelect(C)?void 0:c.jsx(A,{errors:Q,errorSchema:s,fieldPathId:n,schema:C,uiSchema:r,registry:h}),Oe={description:c.jsx(w,{id:Et(ee),description:H,schema:C,uiSchema:r,registry:h}),rawDescription:H,help:Se,rawHelp:typeof re=="string"?re:void 0,errors:pe,rawErrors:D?void 0:Q,fieldPathId:n,id:ee,label:z,hidden:fe,onChange:a,onKeyRename:l,onKeyRenameBlur:f,onRemoveProperty:u,required:d,disabled:F,readonly:$,hideError:D,displayLabel:k,classNames:je.join(" ").trim(),style:b.style,formData:i,schema:C,uiSchema:r,registry:h};return c.jsx(v,{...Oe,children:c.jsxs(c.Fragment,{children:[de,W&&c.jsx(W,{name:o,disabled:F,readonly:$,hideError:D,errorSchema:s,formData:i,fieldPathId:n,onBlur:t.onBlur,onChange:t.onChange,onFocus:t.onFocus,options:R,registry:h,required:d,schema:C,uiSchema:r})]})})}class $b extends P.Component{shouldComponentUpdate(e){const{registry:{globalFormOptions:n}}=this.props,{experimental_componentUpdateStrategy:r="customDeep"}=n;return $l(this,e,this.state,r)}render(){return c.jsx(Db,{...this.props})}}function kb(t){const{schema:e,name:n,uiSchema:r,fieldPathId:i,formData:s,required:o,disabled:a=!1,readonly:l=!1,autofocus:f=!1,onChange:u,onBlur:d,onFocus:h,registry:g,rawErrors:m,hideError:p,title:y}=t,{title:x,format:S}=e,{widgets:j,schemaUtils:b,globalUiOptions:v}=g,w=b.isSelect(e)?Gt(e,r):void 0;let O=w?"select":"text";S&&Sx(e,S,j)&&(O=S);const{widget:A=O,placeholder:C="",title:T,...N}=U(r),_=b.getDisplayLabel(e,r,v),F=T??y??x??n,$=He(e,A,j),E=P.useCallback((D,M,k)=>u(D,i.path,M,k),[u,i]);return c.jsx($,{options:{...N,enumOptions:w},schema:e,uiSchema:r,id:i.$id,name:n,label:F,hideLabel:!_,hideError:p,value:s,onChange:E,onBlur:d,onFocus:h,required:o,disabled:a,readonly:l,autofocus:f,registry:g,placeholder:C,rawErrors:m,htmlName:i.name})}function Mb(t){const{formData:e,onChange:n,fieldPathId:r}=t;return P.useEffect(()=>{e===void 0&&n(null,r.path)},[r,e,n]),null}function Rb(){return{AnyOfField:wo,ArrayField:Kx,BooleanField:Gx,FallbackField:Jx,LayoutGridField:ts,LayoutHeaderField:y0,LayoutMultiSchemaField:x0,NumberField:S0,ObjectField:Fb,OneOfField:wo,OptionalDataControlsField:Pb,SchemaField:$b,StringField:kb,NullField:Mb}}function Bb(t){const{fieldPathId:e,description:n,registry:r,schema:i,uiSchema:s}=t,o=U(s,r.globalUiOptions),{label:a=!0}=o;if(!n||!a)return null;const l=L("DescriptionFieldTemplate",r,o);return c.jsx(l,{id:Et(e),description:n,schema:i,uiSchema:s,registry:r})}function Ub(t){const{children:e,className:n,buttonsProps:r,displayLabel:i,hasDescription:s,hasToolbar:o,registry:a,uiSchema:l}=t,f=U(l),u=L("ArrayFieldItemButtonsTemplate",a,f),d={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"},h=s?31:9,g={display:"flex",alignItems:i?"center":"baseline"},m={display:"flex",justifyContent:"flex-end",marginTop:i?`${h}px`:0};return c.jsxs("div",{className:n,style:g,children:[c.jsx("div",{className:o?"col-xs-9 col-md-10 col-xl-11":"col-xs-12",children:e}),o&&c.jsx("div",{className:"col-xs-3 col-md-2 col-xl-1 array-item-toolbox",children:c.jsx("div",{className:"btn-group",style:m,children:c.jsx(u,{...r,style:d})})})]})}function Lb(t){const{disabled:e,hasCopy:n,hasMoveDown:r,hasMoveUp:i,hasRemove:s,fieldPathId:o,onCopyItem:a,onRemoveItem:l,onMoveDownItem:f,onMoveUpItem:u,readonly:d,registry:h,uiSchema:g}=t,{CopyButton:m,MoveDownButton:p,MoveUpButton:y,RemoveButton:x}=h.templates.ButtonTemplates;return c.jsxs(c.Fragment,{children:[(i||r)&&c.jsx(y,{id:qe(o,"moveUp"),className:"rjsf-array-item-move-up",disabled:e||d||!i,onClick:u,uiSchema:g,registry:h}),(i||r)&&c.jsx(p,{id:qe(o,"moveDown"),className:"rjsf-array-item-move-down",disabled:e||d||!r,onClick:f,uiSchema:g,registry:h}),n&&c.jsx(m,{id:qe(o,"copy"),className:"rjsf-array-item-copy",disabled:e||d,onClick:a,uiSchema:g,registry:h}),s&&c.jsx(x,{id:qe(o,"remove"),className:"rjsf-array-item-remove",disabled:e||d,onClick:l,uiSchema:g,registry:h})]})}function Vb(t){const{canAdd:e,className:n,disabled:r,fieldPathId:i,uiSchema:s,items:o,optionalDataControl:a,onAddClick:l,readonly:f,registry:u,required:d,schema:h,title:g}=t,m=U(s),p=L("ArrayFieldDescriptionTemplate",u,m),y=L("ArrayFieldTitleTemplate",u,m),x=!f&&!r,{ButtonTemplates:{AddButton:S}}=u.templates;return c.jsxs("fieldset",{className:n,id:i.$id,children:[c.jsx(y,{fieldPathId:i,title:m.title||g,required:d,schema:h,uiSchema:s,registry:u,optionalDataControl:x?a:void 0}),c.jsx(p,{fieldPathId:i,description:m.description||h.description,schema:h,uiSchema:s,registry:u}),x?void 0:a,c.jsx("div",{className:"row array-item-list",children:o}),e&&c.jsx(S,{id:qe(i,"add"),className:"rjsf-array-item-add",onClick:l,disabled:r||f,uiSchema:s,registry:u})]})}function Wb(t){const{fieldPathId:e,title:n,schema:r,uiSchema:i,required:s,registry:o,optionalDataControl:a}=t,l=U(i,o.globalUiOptions),{label:f=!0}=l;if(!n||!f)return null;const u=L("TitleFieldTemplate",o,l);return c.jsx(u,{id:hr(e),title:n,required:s,schema:r,uiSchema:i,registry:o,optionalDataControl:a})}function zb(t){const{id:e,name:n,htmlName:r,value:i,readonly:s,disabled:o,autofocus:a,onBlur:l,onFocus:f,onChange:u,onChangeOverride:d,options:h,schema:g,uiSchema:m,registry:p,rawErrors:y,type:x,hideLabel:S,hideError:j,...b}=t,{ClearButton:v}=p.templates.ButtonTemplates;if(!e)throw console.log("No id for",t),new Error(`no id for props ${JSON.stringify(t)}`);const w={...b,...Pl(g,x,h)};let O;w.type==="number"||w.type==="integer"?O=i||i===0?i:"":O=i??"";const A=P.useCallback(({target:{value:_}})=>u(_===""?h.emptyValue:_),[u,h]),C=P.useCallback(({target:_})=>l(e,_&&_.value),[l,e]),T=P.useCallback(({target:_})=>f(e,_&&_.value),[f,e]),N=P.useCallback(_=>{_.preventDefault(),_.stopPropagation(),u(h.emptyValue??"")},[u,h.emptyValue]);return c.jsxs(c.Fragment,{children:[c.jsx("input",{id:e,name:r||e,className:"form-control",readOnly:s,disabled:o,autoFocus:a,value:O,...w,list:g.examples?_n(e):void 0,onChange:d||A,onBlur:C,onFocus:T,"aria-describedby":we(e,!!g.examples)}),h.allowClearTextInputs&&!s&&!o&&O&&c.jsx(v,{registry:p,onClick:N}),Array.isArray(g.examples)&&c.jsx("datalist",{id:_n(e),children:g.examples.concat(g.default&&!g.examples.includes(g.default)?[g.default]:[]).map(_=>c.jsx("option",{value:_},_))},`datalist_${e}`)]})}function qb({uiSchema:t}){const{submitText:e,norender:n,props:r={}}=El(t);return n?null:c.jsx("div",{children:c.jsx("button",{type:"submit",...r,className:`btn btn-info ${r.className||""}`,children:e})})}function xt(t){const{iconType:e="default",icon:n,className:r,uiSchema:i,registry:s,...o}=t;return c.jsx("button",{type:"button",className:`btn btn-${e} ${r}`,...o,children:c.jsx("i",{className:`glyphicon glyphicon-${n}`})})}function Kb(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.CopyButton),...t,icon:"copy"})}function Gb(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.MoveDownButton),...t,icon:"arrow-down"})}function Hb(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.MoveUpButton),...t,icon:"arrow-up"})}function Yb(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.RemoveButton),...t,iconType:"danger",icon:"remove"})}function Xb({id:t,className:e,onClick:n,disabled:r,registry:i,...s}){const{translateString:o}=i;return c.jsx(xt,{id:t,iconType:"default",icon:"remove",className:"btn-clear col-xs-12",title:o(K.ClearButton),onClick:n,disabled:r,registry:i,...s})}function Jb({id:t,className:e,onClick:n,disabled:r,registry:i}){const{translateString:s}=i;return c.jsx("div",{className:"row",children:c.jsx("p",{className:`col-xs-4 col-sm-2 col-lg-1 col-xs-offset-8 col-sm-offset-10 col-lg-offset-11 text-right ${e}`,children:c.jsx(xt,{id:t,iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:s(K.AddButton),onClick:n,disabled:r,registry:i})})})}function Zb(){return{SubmitButton:qb,AddButton:Jb,CopyButton:Kb,MoveDownButton:Gb,MoveUpButton:Hb,RemoveButton:Yb,ClearButton:Xb}}const Zl=Yi();function ss({description:t,registry:e,uiSchema:n={}}){const{globalUiOptions:r}=e;return U(n,r).enableMarkdownInDescription&&typeof t=="string"?c.jsx(Rn,{options:{disableParsingRawHTML:!0},"data-testid":Zl.markdown,children:t}):t}ss.TEST_IDS=Zl;function Qb(t){const{id:e,description:n,registry:r,uiSchema:i}=t;return n?c.jsx("div",{id:e,className:"field-description",children:c.jsx(ss,{description:n,registry:r,uiSchema:i})}):null}function ev({errors:t,registry:e}){const{translateString:n}=e;return c.jsxs("div",{className:"panel panel-danger errors",children:[c.jsx("div",{className:"panel-heading",children:c.jsx("h3",{className:"panel-title",children:n(K.ErrorsLabel)})}),c.jsx("ul",{className:"list-group",children:t.map((r,i)=>c.jsx("li",{className:"list-group-item text-danger",children:r.stack},i))})]})}function tv(t){const{schema:e,registry:n,typeSelector:r,schemaField:i}=t,s=L("MultiSchemaFieldTemplate",n);return c.jsx(s,{selector:r,optionSchemaField:i,schema:e,registry:n})}const nv="*";function Ql(t){const{label:e,required:n,id:r}=t;return e?c.jsxs("label",{className:"control-label",htmlFor:r,children:[e,n&&c.jsx("span",{className:"required",children:nv})]}):null}function rv(t){const{id:e,label:n,children:r,errors:i,help:s,description:o,hidden:a,required:l,displayLabel:f,registry:u,uiSchema:d}=t,h=U(d),g=L("WrapIfAdditionalTemplate",u,h);if(a)return c.jsx("div",{className:"hidden",children:r});const m=h.widget==="checkbox";return c.jsxs(g,{...t,children:[f&&!m&&c.jsx(Ql,{label:n,required:l,id:e}),f&&o?o:null,r,i,s]})}function iv(t){const{errors:e=[],fieldPathId:n}=t;if(e.length===0)return null;const r=Xi(n);return c.jsx("div",{children:c.jsx("ul",{id:r,className:"error-detail bs-callout bs-callout-info",children:e.filter(i=>!!i).map((i,s)=>c.jsx("li",{className:"text-danger",children:i},s))})})}const ec=Yi();function os({help:t,registry:e,uiSchema:n={}}){const{globalUiOptions:r}=e;return U(n,r).enableMarkdownInHelp&&typeof t=="string"?c.jsx(Rn,{options:{disableParsingRawHTML:!0},"data-testid":ec.markdown,children:t}):t}os.TEST_IDS=ec;function sv(t){const{fieldPathId:e,help:n,uiSchema:r,registry:i}=t;return n?c.jsx("div",{id:Ji(e),className:"help-block",children:c.jsx(os,{help:n,registry:i,uiSchema:r})}):null}function ov(t){const{children:e,column:n,className:r,...i}=t;return c.jsx("div",{className:r,...i,children:e})}function av(t){const{selector:e,optionSchemaField:n}=t;return c.jsxs("div",{className:"panel panel-default panel-body",children:[c.jsx("div",{className:"form-group",children:e}),n]})}function lv(t){const{className:e,description:n,disabled:r,formData:i,fieldPathId:s,onAddProperty:o,optionalDataControl:a,properties:l,readonly:f,registry:u,required:d,schema:h,title:g,uiSchema:m}=t,p=U(m),y=L("TitleFieldTemplate",u,p),x=L("DescriptionFieldTemplate",u,p);if((h.oneOf||h.anyOf)&&!h.properties&&l.length===0)return null;const j=!f&&!r,{ButtonTemplates:{AddButton:b}}=u.templates;return c.jsxs("fieldset",{className:e,id:s.$id,children:[g&&c.jsx(y,{id:hr(s),title:g,required:d,schema:h,uiSchema:m,registry:u,optionalDataControl:j?a:void 0}),n&&c.jsx(x,{id:Et(s),description:n,schema:h,uiSchema:m,registry:u}),j?void 0:a,l.map(v=>v.content),fa(h,m,i)&&c.jsx(b,{id:qe(s,"add"),className:"rjsf-object-property-expand",onClick:o,disabled:r||f,uiSchema:m,registry:u})]})}function cv(t){const{id:e,registry:n,label:r,onAddClick:i,onRemoveClick:s}=t;return i?c.jsx(xt,{id:e,registry:n,icon:"plus",className:"rjsf-add-optional-data btn-sm",onClick:i,title:r}):s?c.jsx(xt,{id:e,registry:n,icon:"remove",className:"rjsf-remove-optional-data btn-sm",onClick:s,title:r}):c.jsx("em",{id:e,children:r})}const uv="*";function dv(t){const{id:e,title:n,required:r,optionalDataControl:i}=t;return c.jsxs("legend",{id:e,children:[n,r&&c.jsx("span",{className:"required",children:uv}),i&&c.jsx("span",{className:"pull-right",style:{marginBottom:"2px"},children:i})]})}function fv(t){const{schema:e,fieldPathId:n,reason:r,registry:i}=t,{translateString:s}=i;let o=K.UnsupportedField;const a=[];return n&&n.$id&&(o=K.UnsupportedFieldWithId,a.push(n.$id)),r&&(o=o===K.UnsupportedField?K.UnsupportedFieldWithReason:K.UnsupportedFieldWithIdAndReason,a.push(r)),c.jsxs("div",{className:"unsupported-field",children:[c.jsx("p",{children:c.jsx(Rn,{options:{disableParsingRawHTML:!0},children:s(o,a)})}),e&&c.jsx("pre",{children:JSON.stringify(e,null,2)})]})}function mv(t){const{id:e,classNames:n,style:r,disabled:i,displayLabel:s,label:o,onKeyRenameBlur:a,onRemoveProperty:l,rawDescription:f,readonly:u,required:d,schema:h,hideError:g,rawErrors:m,children:p,uiSchema:y,registry:x}=t,{templates:S,translateString:j}=x,{RemoveButton:b}=S.ButtonTemplates,v=j(K.KeyLabel,[o]),w=Qe in h,O=!!f,A=["form-group",n];!g&&m&&m.length>0&&A.push("has-error has-danger");const C=A.join(" ").trim();if(!w)return c.jsx("div",{className:C,style:r,children:p});const T=O?46:26;return c.jsx("div",{className:C,style:r,children:c.jsxs("div",{className:"row",children:[c.jsx("div",{className:"col-xs-5 form-additional",children:c.jsxs("div",{className:"form-group",children:[s&&c.jsx(Ql,{label:v,required:d,id:`${e}-key`}),s&&f&&c.jsx("div",{children:" "}),c.jsx("input",{className:"form-control",type:"text",id:`${e}-key`,onBlur:a,defaultValue:o})]})}),c.jsx("div",{className:"form-additional form-group col-xs-5",children:p}),c.jsx("div",{className:"col-xs-2",style:{marginTop:s?`${T}px`:void 0},children:c.jsx(b,{id:qe(e,"remove"),className:"rjsf-object-property-remove btn-block",style:{border:"0"},disabled:i||u,onClick:l,uiSchema:y,registry:x})})]})})}function hv(){return{ArrayFieldDescriptionTemplate:Bb,ArrayFieldItemTemplate:Ub,ArrayFieldItemButtonsTemplate:Lb,ArrayFieldTemplate:Vb,ArrayFieldTitleTemplate:Wb,ButtonTemplates:Zb(),BaseInputTemplate:zb,DescriptionFieldTemplate:Qb,ErrorListTemplate:ev,FallbackFieldTemplate:tv,FieldTemplate:rv,FieldErrorTemplate:iv,FieldHelpTemplate:sv,GridTemplate:ov,MultiSchemaFieldTemplate:av,ObjectFieldTemplate:lv,OptionalDataControlsTemplate:cv,TitleFieldTemplate:dv,UnsupportedFieldTemplate:fv,WrapIfAdditionalTemplate:mv}}function pv(t){const{disabled:e=!1,readonly:n=!1,autofocus:r=!1,options:i,id:s,name:o,registry:a,onBlur:l,onFocus:f}=t,{translateString:u}=a,{elements:d,handleChange:h,handleClear:g,handleSetNow:m}=Nx(t);return c.jsxs("ul",{className:"list-inline",children:[d.map((p,y)=>c.jsx("li",{className:"list-inline-item",children:c.jsx(_x,{rootId:s,name:o,select:h,...p,disabled:e,readonly:n,registry:a,onBlur:l,onFocus:f,autofocus:r&&y===0})},y)),(i.hideNowButton!=="undefined"?!i.hideNowButton:!0)&&c.jsx("li",{className:"list-inline-item",children:c.jsx("a",{href:"#",className:"btn btn-info btn-now",onClick:m,children:u(K.NowLabel)})}),(i.hideClearButton!=="undefined"?!i.hideClearButton:!0)&&c.jsx("li",{className:"list-inline-item",children:c.jsx("a",{href:"#",className:"btn btn-warning btn-clear",onClick:g,children:u(K.ClearLabel)})})]})}function gv({time:t=!0,...e}){const{AltDateWidget:n}=e.registry.widgets;return c.jsx(n,{time:t,...e})}function yv({schema:t,uiSchema:e,options:n,id:r,value:i,disabled:s,readonly:o,label:a,hideLabel:l,autofocus:f=!1,onBlur:u,onFocus:d,onChange:h,registry:g,htmlName:m}){const p=L("DescriptionFieldTemplate",g,n),y=hn(t),x=P.useCallback(O=>h(O.target.checked),[h]),S=P.useCallback(O=>u(r,O.target.checked),[u,r]),j=P.useCallback(O=>d(r,O.target.checked),[d,r]),w=U(e).widget==="checkbox"?void 0:n.description??t.description;return c.jsxs("div",{className:`checkbox ${s||o?"disabled":""}`,children:[!l&&w&&c.jsx(p,{id:Et(r),description:w,schema:t,uiSchema:e,registry:g}),c.jsxs("label",{children:[c.jsx("input",{type:"checkbox",id:r,name:m||r,checked:typeof i>"u"?!1:i,required:y,disabled:s||o,autoFocus:f,onChange:x,onBlur:S,onFocus:j,"aria-describedby":we(r)}),Dl(c.jsx("span",{children:a}),l)]})]})}function xv({id:t,disabled:e,options:{inline:n=!1,enumOptions:r,enumDisabled:i,emptyValue:s},value:o,autofocus:a=!1,readonly:l,onChange:f,onBlur:u,onFocus:d,htmlName:h}){const g=Array.isArray(o)?o:[o],m=P.useCallback(({target:y})=>u(t,ge(y&&y.value,r,s)),[u,t,r,s]),p=P.useCallback(({target:y})=>d(t,ge(y&&y.value,r,s)),[d,t,r,s]);return c.jsx("div",{className:"checkboxes",id:t,children:Array.isArray(r)&&r.map((y,x)=>{const S=kn(y.value,g),j=Array.isArray(i)&&i.indexOf(y.value)!==-1,b=e||j||l?"disabled":"",v=O=>{O.target.checked?f(Nl(x,g,r)):f(Cl(x,g,r))},w=c.jsxs("span",{children:[c.jsx("input",{type:"checkbox",id:wt(t,x),name:h||t,checked:S,value:String(x),disabled:e||j||l,autoFocus:a&&x===0,onChange:v,onBlur:m,onFocus:p,"aria-describedby":we(t)}),c.jsx("span",{children:y.label})]});return n?c.jsx("label",{className:`checkbox-inline ${b}`,children:w},x):c.jsx("div",{className:`checkbox ${b}`,children:c.jsx("label",{children:w})},x)})})}function bv(t){const{disabled:e,readonly:n,options:r,registry:i}=t,s=L("BaseInputTemplate",i,r);return c.jsx(s,{type:"color",...t,disabled:e||n})}function vv(t){const{onChange:e,options:n,registry:r}=t,i=L("BaseInputTemplate",r,n),s=P.useCallback(o=>e(o||void 0),[e]);return c.jsx(i,{type:"date",...t,onChange:s})}function Sv(t){const{onChange:e,value:n,options:r,registry:i}=t,s=L("BaseInputTemplate",i,r);return c.jsx(s,{type:"datetime-local",...t,value:Ix(n),onChange:o=>e(jx(o))})}function wv(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"email",...t})}function jv({fileInfo:t,registry:e}){const{translateString:n}=e,{dataURL:r,type:i,name:s}=t;return r?["image/jpeg","image/png"].includes(i)?c.jsx("img",{src:r,style:{maxWidth:"100%"},className:"file-preview"}):c.jsxs(c.Fragment,{children:[" ",c.jsx("a",{download:`preview-${s}`,href:r,className:"file-download",children:n(K.PreviewLabel)})]}):null}function Ov({filesInfo:t,registry:e,preview:n,onRemove:r,options:i}){if(t.length===0)return null;const{translateString:s}=e,{RemoveButton:o}=L("ButtonTemplates",e,i);return c.jsx("ul",{className:"file-info",children:t.map((a,l)=>{const{name:f,size:u,type:d}=a,h=()=>r(l);return c.jsxs("li",{children:[c.jsx(Rn,{children:s(K.FilesInfo,[f,d,String(u)])}),n&&c.jsx(jv,{fileInfo:a,registry:e}),c.jsx(o,{onClick:h,registry:e})]},l)})})}function Av(t){const{disabled:e,readonly:n,required:r,multiple:i,onChange:s,value:o,options:a,registry:l}=t,{filesInfo:f,handleChange:u,handleRemove:d}=Ex(o,s,i),h=L("BaseInputTemplate",l,a),g=m=>{m.target.files&&u(m.target.files)};return c.jsxs("div",{children:[c.jsx(h,{...t,disabled:e||n,type:"file",required:o?!1:r,onChangeOverride:g,value:"",accept:a.accept?String(a.accept):void 0}),c.jsx(Ov,{filesInfo:f,onRemove:d,registry:l,preview:a.filePreview,options:a})]})}function Cv({id:t,value:e,htmlName:n}){return c.jsx("input",{type:"hidden",id:t,name:n||t,value:typeof e>"u"?"":e})}function _v(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"password",...t})}function Nv({options:t,value:e,required:n,disabled:r,readonly:i,autofocus:s=!1,onBlur:o,onFocus:a,onChange:l,id:f,htmlName:u}){const{enumOptions:d,enumDisabled:h,inline:g,emptyValue:m}=t,p=P.useCallback(({target:x})=>o(f,ge(x&&x.value,d,m)),[o,d,m,f]),y=P.useCallback(({target:x})=>a(f,ge(x&&x.value,d,m)),[a,d,m,f]);return c.jsx("div",{className:"field-radio-group",id:f,role:"radiogroup",children:Array.isArray(d)&&d.map((x,S)=>{const j=kn(x.value,e),b=Array.isArray(h)&&h.indexOf(x.value)!==-1,v=r||b||i?"disabled":"",w=()=>l(x.value),O=c.jsxs("span",{children:[c.jsx("input",{type:"radio",id:wt(f,S),checked:j,name:u||f,required:n,value:String(S),disabled:r||b||i,autoFocus:s&&S===0,onChange:w,onBlur:p,onFocus:y,"aria-describedby":we(f)}),c.jsx("span",{children:x.label})]});return g?c.jsx("label",{className:`radio-inline ${v}`,children:O},S):c.jsx("div",{className:`radio ${v}`,children:c.jsx("label",{children:O})},S)})})}function Tv(t){const{value:e,registry:{templates:{BaseInputTemplate:n}}}=t;return c.jsxs("div",{className:"field-range-wrapper",children:[c.jsx(n,{type:"range",...t}),c.jsx("span",{className:"range-view",children:e})]})}function Fv({id:t,value:e,required:n,disabled:r,readonly:i,autofocus:s,onChange:o,onFocus:a,onBlur:l,schema:f,options:u,htmlName:d}){const{stars:h=5,shape:g="star"}=u,m=f.maximum?Math.min(f.maximum,5):Math.min(Math.max(h,1),5),p=f.minimum||0,y=P.useCallback(b=>{!r&&!i&&o(b)},[o,r,i]),x=P.useCallback(b=>{if(a){const v=Number(b.target.dataset.value);a(t,v)}},[a,t]),S=P.useCallback(b=>{if(l){const v=Number(b.target.dataset.value);l(t,v)}},[l,t]),j=b=>g==="heart"?b?"♥":"♡":b?"★":"☆";return c.jsx(c.Fragment,{children:c.jsxs("div",{className:"rating-widget",style:{display:"inline-flex",fontSize:"1.5rem",cursor:r||i?"default":"pointer"},children:[[...Array(m)].map((b,v)=>{const w=p+v,O=w<=e;return c.jsx("span",{onClick:()=>y(w),onFocus:x,onBlur:S,"data-value":w,tabIndex:r||i?-1:0,role:"radio","aria-checked":w===e,"aria-label":`${w} ${g==="heart"?"heart":"star"}${w===1?"":"s"}`,style:{color:O?"#FFD700":"#ccc",padding:"0 0.2rem",transition:"color 0.2s",userSelect:"none"},children:j(O)},v)}),c.jsx("input",{type:"hidden",id:t,name:d||t,value:e||"",required:n,disabled:r||i,"aria-hidden":"true"})]})})}function Wr(t,e){return e?Array.from(t.target.options).slice().filter(n=>n.selected).map(n=>n.value):t.target.value}function Pv({schema:t,id:e,options:n,value:r,required:i,disabled:s,readonly:o,multiple:a=!1,autofocus:l=!1,onChange:f,onBlur:u,onFocus:d,placeholder:h,htmlName:g}){const{enumOptions:m,enumDisabled:p,emptyValue:y}=n,x=a?[]:"",S=P.useCallback(O=>{const A=Wr(O,a);return d(e,ge(A,m,y))},[d,e,a,m,y]),j=P.useCallback(O=>{const A=Wr(O,a);return u(e,ge(A,m,y))},[u,e,a,m,y]),b=P.useCallback(O=>{const A=Wr(O,a);return f(ge(A,m,y))},[f,a,m,y]),v=_l(r,m,a),w=!a&&t.default===void 0;return c.jsxs("select",{id:e,name:g||e,multiple:a,role:"combobox",className:"form-control",value:typeof v>"u"?x:v,required:i,disabled:s||o,autoFocus:l,onBlur:j,onFocus:S,onChange:b,"aria-describedby":we(e),children:[w&&c.jsx("option",{value:"",children:h}),Array.isArray(m)&&m.map(({value:O,label:A},C)=>{const T=p&&p.indexOf(O)!==-1;return c.jsx("option",{value:String(C),disabled:T,children:A},C)})]})}function Ev({id:t,options:e={},placeholder:n,value:r,required:i,disabled:s,readonly:o,autofocus:a=!1,onChange:l,onBlur:f,onFocus:u,htmlName:d}){const h=P.useCallback(({target:{value:p}})=>l(p===""?e.emptyValue:p),[l,e.emptyValue]),g=P.useCallback(({target:p})=>f(t,p&&p.value),[f,t]),m=P.useCallback(({target:p})=>u(t,p&&p.value),[t,u]);return c.jsx("textarea",{id:t,name:d||t,className:"form-control",value:r||"",placeholder:n,required:i,disabled:s,readOnly:o,autoFocus:a,rows:e.rows,onBlur:g,onFocus:m,onChange:h,"aria-describedby":we(t)})}function Iv(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{...t})}function Dv(t){const{onChange:e,options:n,registry:r}=t,i=L("BaseInputTemplate",r,n),s=P.useCallback(o=>e(o?`${o}:00`:void 0),[e]);return c.jsx(i,{type:"time",...t,onChange:s})}function $v(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"url",...t})}function kv(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"number",...t})}function Mv(){return{AltDateWidget:pv,AltDateTimeWidget:gv,CheckboxWidget:yv,CheckboxesWidget:xv,ColorWidget:bv,DateWidget:vv,DateTimeWidget:Sv,EmailWidget:wv,FileWidget:Av,HiddenWidget:Cv,PasswordWidget:_v,RadioWidget:Nv,RangeWidget:Tv,RatingWidget:Fv,SelectWidget:Pv,TextWidget:Iv,TextareaWidget:Ev,TimeWidget:Dv,UpDownWidget:kv,URLWidget:$v}}function Rv(){return{fields:Rb(),templates:hv(),widgets:Mv(),rootSchema:{},formContext:{},translateString:ax,globalFormOptions:{idPrefix:ca,idSeparator:ua,useFallbackUiForUnsupportedType:!1}}}function $t(t,e){return{...Gi(t,["schema","uiSchema","fieldPathId","schemaUtils","formData","edit","errors","errorSchema"]),...e!==void 0&&{status:e}}}let Bv=class extends P.Component{formElement;pendingChanges=[];_isProcessingUserChange=!1;constructor(e){if(super(e),!e.validator)throw new Error("A validator is required for Form functionality to work");const{formData:n,initialFormData:r,onChange:i}=e,s=n??r;this.state=this.getStateFromProps(e,s,void 0,void 0,void 0,!0),i&&!le(this.state.formData,s)&&i($t(this.state)),this.formElement=P.createRef()}getSnapshotBeforeUpdate(e,n){if(!le(this.props,e)){const r=fo(this.props.formData,e.formData),i=fo(this.props.formData,this.state.formData),s=!le(e.schema,this.props.schema),o=r.length>0||!le(e.formData,this.props.formData),a=i.length>0||!le(this.state.formData,this.props.formData),l=this.getStateFromProps(this.props,this.props.formData,s||o?void 0:this.state.retrievedSchema,s,r,!a),f=!le(l,n);return{nextState:l,shouldUpdate:f}}return{shouldUpdate:!1}}componentDidUpdate(e,n,r){if(r.shouldUpdate){const{nextState:i}=r,s=!le(i.formData,this.props.formData),o=this._isProcessingUserChange;if(this._isProcessingUserChange=!1,o&&s)return;s&&!le(i.formData,n.formData)&&this.props.onChange&&this.props.onChange($t(i)),this.setState(i)}}getStateFromProps(e,n,r,i=!1,s=[],o=!1){const a=this.state||{},l="schema"in e?e.schema:this.props.schema,f="validator"in e?e.validator:this.props.validator,u=("uiSchema"in e?e.uiSchema:this.props.uiSchema)||{},d=e.formData===void 0&&this.props.formData===void 0,h=typeof n<"u",g="liveValidate"in e?e.liveValidate:this.props.liveValidate,m=h&&!e.noValidate&&g,p="experimental_defaultFormStateBehavior"in e?e.experimental_defaultFormStateBehavior:this.props.experimental_defaultFormStateBehavior,y="experimental_customMergeAllOf"in e?e.experimental_customMergeAllOf:this.props.experimental_customMergeAllOf;let x=a.schemaUtils;(!x||x.doesSchemaUtilsDiffer(f,l,p,y))&&(x=ix(f,l,p,y));const S=x.getRootSchema();let j=n;n===Uo?j=void 0:n===void 0&&d&&(j=a.formData);const b=x.getDefaultFormState(S,j,!1,a.initialDefaultsGenerated),v=this.updateRetrievedSchema(r??x.retrieveSchema(S,b)),w=()=>e.noValidate||i?{errors:[],errorSchema:{}}:e.liveValidate?{errors:a.errors||[],errorSchema:a.errorSchema||{}}:{errors:a.schemaValidationErrors||[],errorSchema:a.schemaValidationErrorSchema||{}};let O,A,C=a.schemaValidationErrors,T=a.schemaValidationErrorSchema;if(m&&!o){const E=this.liveValidate(S,x,a.errorSchema,b,void 0,a.customErrors,r,r!==void 0);O=E.errors,A=E.errorSchema,C=E.schemaValidationErrors,T=E.schemaValidationErrorSchema}else{const E=w();if(O=E.errors,A=E.errorSchema,s.length>0&&!m){const M=s.reduce((k,B)=>(k[B]=void 0,k),{});A=T=Cn(E.errorSchema,M,"preventDuplicates")}const D=this.mergeErrors({errorSchema:A,errors:O},e.extraErrors,a.customErrors);O=D.errors,A=D.errorSchema}const N=this.getRegistry(e,S,x),_=le(a.registry,N)?a.registry:N,F=a.fieldPathId&&a.fieldPathId?.[oe]===_.globalFormOptions.idPrefix?a.fieldPathId:Fe("",_.globalFormOptions);return{schemaUtils:x,schema:S,uiSchema:u,fieldPathId:F,formData:b,edit:h,errors:O,errorSchema:A,schemaValidationErrors:C,schemaValidationErrorSchema:T,retrievedSchema:v,initialDefaultsGenerated:!0,registry:_}}shouldComponentUpdate(e,n){const{experimental_componentUpdateStrategy:r="customDeep"}=this.props;return $l(this,e,n,r)}validate(e,n=this.state.schema,r,i){const s=r||this.state.schemaUtils,{customValidate:o,transformErrors:a,uiSchema:l}=this.props,f=i??s.retrieveSchema(n,e);return s.getValidator().validateFormData(e,f,o,a,l)}renderErrors(e){const{errors:n,errorSchema:r,schema:i,uiSchema:s}=this.state,o=U(s),a=L("ErrorListTemplate",e,o);return n&&n.length?c.jsx(a,{errors:n,errorSchema:r||{},schema:i,uiSchema:s,registry:e}):null}mergeErrors(e,n,r){let i=e.errorSchema,s=e.errors;if(n){const o=Xn(e,n);i=o.errorSchema,s=o.errors}if(r){const o=Xn(e,r.ErrorSchema,!0);i=o.errorSchema,s=o.errors}return{errors:s,errorSchema:i}}liveValidate(e,n,r,i,s,o,a,l=!1){const f=this.validate(i,e,n,a),u=f.errors;let d=f.errorSchema;l&&(d=Cn(r,f.errorSchema,"preventDuplicates"));const h=u,g=d;return{...this.mergeErrors({errorSchema:d,errors:u},s,o),schemaValidationErrors:h,schemaValidationErrorSchema:g}}getUsedFormData=(e,n)=>jl(e,n);getFieldNames=(e,n)=>Ol(e,n);omitExtraData=e=>{const{schema:n,schemaUtils:r}=this.state;return r.omitExtraData(n,e)};setFieldValue=(e,n)=>{const{registry:r}=this.state,i=Array.isArray(e)?e:e.split("."),s=Fe("",r.globalFormOptions,i);this.onChange(n,i,void 0,s[oe])};onChange=(e,n,r,i)=>{this.pendingChanges.push({newValue:e,path:n,newErrorSchema:r,id:i}),this.pendingChanges.length===1&&this.processPendingChange()};processPendingChange(){if(this.pendingChanges.length===0)return;this._isProcessingUserChange=!0;const{newValue:e,path:n,id:r}=this.pendingChanges[0],{newErrorSchema:i}=this.pendingChanges[0],{extraErrors:s,omitExtraData:o,liveOmit:a,noValidate:l,liveValidate:f,onChange:u}=this.props,{formData:d,schemaUtils:h,schema:g,fieldPathId:m,schemaValidationErrorSchema:p,errors:y}=this.state;let{customErrors:x,errorSchema:S}=this.state;const j=m.path[0]||"",b=!n||n.length===0||n.length===1&&n[0]===j;let v=this.state.retrievedSchema,w=b?e:Hi(d);const O=Y(w)&&Object.keys(w).length>0&&Object.values(w).every(F=>F===void 0),A=d==null,C=O&&A?void 0:w;if(Y(w)||Array.isArray(w)){e===Jl?Mx(w,n):b||se(w,n,e);const F=this.getStateFromProps(this.props,C,void 0,void 0,void 0,!0);w=F.formData,v=F.retrievedSchema}const T=!l&&(f===!0||f==="onChange");let N={formData:w,schema:g},_=w;if(o===!0&&(a===!0||a==="onChange")&&(_=this.omitExtraData(w),N={formData:_}),i){const F=b?p:I(p,n);if(!me(F))b?S=i:se(S,n,i);else if(x||(x=new Tl),b){const $=I(i,xe);$&&x.setErrors($)}else se(x.ErrorSchema,n,i)}else x&&I(x.ErrorSchema,[...n,xe])&&x.clearErrors(n);if(T&&this.pendingChanges.length===1){const F=this.liveValidate(g,h,S,_,s,x,v);N={formData:_,...F,customErrors:x}}else if(!l&&i){const F=this.mergeErrors({errorSchema:S,errors:y},s,x);N={formData:_,...F,customErrors:x}}this.setState(N,()=>{u&&u($t({...this.state,...N}),r),this.pendingChanges.shift(),this.processPendingChange()})}updateRetrievedSchema(e){return le(e,this.state?.retrievedSchema)?this.state.retrievedSchema:e}reset=()=>{const{formData:e,initialFormData:n=Uo,onChange:r}=this.props,o={formData:this.getStateFromProps(this.props,e??n,void 0,void 0,void 0,!0).formData,errorSchema:{},errors:[],schemaValidationErrors:[],schemaValidationErrorSchema:{},initialDefaultsGenerated:!1,customErrors:void 0};this.setState(o,()=>r&&r($t({...this.state,...o})))};onBlur=(e,n)=>{const{onBlur:r,omitExtraData:i,liveOmit:s,liveValidate:o}=this.props;if(r&&r(e,n),i===!0&&s==="onBlur"||o==="onBlur"){const{onChange:a,extraErrors:l}=this.props,{formData:f}=this.state;let u=f,d={formData:u};if(i===!0&&s==="onBlur"&&(u=this.omitExtraData(f),d={formData:u}),o==="onBlur"){const{schema:g,schemaUtils:m,errorSchema:p,customErrors:y,retrievedSchema:x}=this.state,S=this.liveValidate(g,m,p,u,l,y,x);d={formData:u,...S,customErrors:y}}const h=Object.keys(d).filter(g=>!g.startsWith("schemaValidation")).some(g=>{const m=I(this.state,g),p=I(d,g);return!le(m,p)});this.setState(d,()=>{a&&h&&a($t({...this.state,...d}),e)})}};onFocus=(e,n)=>{const{onFocus:r}=this.props;r&&r(e,n)};onSubmit=e=>{if(e.preventDefault(),e.target!==e.currentTarget)return;e.persist();const{omitExtraData:n,extraErrors:r,noValidate:i,onSubmit:s}=this.props;let{formData:o}=this.state;if(n===!0&&(o=this.omitExtraData(o)),i||this.validateFormWithFormData(o)){const a=r||{},l=r?Qi(r):[];this.setState({formData:o,errors:l,errorSchema:a,schemaValidationErrors:[],schemaValidationErrorSchema:{}},()=>{s&&s($t({...this.state,formData:o},"submitted"),e)})}};getGlobalFormOptions(e){const{uiSchema:n={},experimental_componentUpdateStrategy:r,idSeparator:i=ua,idPrefix:s=ca,nameGenerator:o,useFallbackUiForUnsupportedType:a=!1}=e;return{idPrefix:n["ui:rootFieldId"]||s,idSeparator:i,useFallbackUiForUnsupportedType:a,...r!==void 0&&{experimental_componentUpdateStrategy:r},...o!==void 0&&{nameGenerator:o}}}getRegistry(e,n,r){const{translateString:i,uiSchema:s={}}=e,{fields:o,templates:a,widgets:l,formContext:f,translateString:u}=Rv();return{fields:{...o,...e.fields},templates:{...a,...e.templates,ButtonTemplates:{...a.ButtonTemplates,...e.templates?.ButtonTemplates}},widgets:{...l,...e.widgets},rootSchema:n,formContext:e.formContext||f,schemaUtils:r,translateString:i||u,globalUiOptions:s[Gr],globalFormOptions:this.getGlobalFormOptions(e)}}submit=()=>{if(this.formElement.current){const e=new CustomEvent("submit",{cancelable:!0});e.preventDefault(),this.formElement.current.dispatchEvent(e),this.formElement.current.requestSubmit()}};focusOnError(e){const{idPrefix:n="root",idSeparator:r="_"}=this.props,{property:i}=e,s=kl(i);s[0]===""?s[0]=n:s.unshift(n);const o=s.join(r);let a=this.formElement.current.elements[o];a||(a=this.formElement.current.querySelector(`input[id^="${o}"`)),a&&a.length&&(a=a[0]),a&&a.focus()}validateFormWithFormData=e=>{const{extraErrors:n,extraErrorsBlockSubmit:r,focusOnFirstError:i,onError:s}=this.props,{errors:o}=this.state,a=this.validate(e);let l=a.errors,f=a.errorSchema;const u=l,d=f,h=l.length>0||n&&r;if(h){if(n){const g=Xn(a,n);f=g.errorSchema,l=g.errors}i&&(typeof i=="function"?i(l[0]):this.focusOnError(l[0])),this.setState({errors:l,errorSchema:f,schemaValidationErrors:u,schemaValidationErrorSchema:d},()=>{s?s(l):console.error("Form validation failed",l)})}else o.length>0&&this.setState({errors:[],errorSchema:{},schemaValidationErrors:[],schemaValidationErrorSchema:{}});return!h};validateForm(){const{omitExtraData:e}=this.props;let{formData:n}=this.state;return e===!0&&(n=this.omitExtraData(n)),this.validateFormWithFormData(n)}render(){const{children:e,id:n,className:r="",tagName:i,name:s,method:o,target:a,action:l,autoComplete:f,enctype:u,acceptCharset:d,noHtml5Validate:h=!1,disabled:g,readonly:m,showErrorList:p="top",_internalFormWrapper:y}=this.props,{schema:x,uiSchema:S,formData:j,errorSchema:b,fieldPathId:v,registry:w}=this.state,{SchemaField:O}=w.fields,{SubmitButton:A}=w.templates.ButtonTemplates,C=y?i:void 0,T=y||i||"form";let{[Qn]:N={}}=U(S);g&&(N={...N,props:{...N.props,disabled:!0}});const _={[ut]:{[Qn]:N}};return c.jsxs(T,{className:r||"rjsf",id:n,name:s,method:o,target:a,action:l,autoComplete:f,encType:u,acceptCharset:d,noValidate:h,onSubmit:this.onSubmit,as:C,ref:this.formElement,children:[p==="top"&&this.renderErrors(w),c.jsx(O,{name:"",schema:x,uiSchema:S,errorSchema:b,fieldPathId:v,formData:j,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:w,disabled:g,readonly:m}),e||c.jsx(A,{uiSchema:_,registry:w}),p==="bottom"&&this.renderErrors(w)]})}};function Uv(t){return P.forwardRef(({fields:e,widgets:n,templates:r,...i},s)=>(e={...t?.fields,...e},n={...t?.widgets,...n},r={...t?.templates,...r,ButtonTemplates:{...t?.templates?.ButtonTemplates,...r?.ButtonTemplates}},c.jsx(Bv,{...t,...i,fields:e,widgets:n,templates:r,ref:s})))}var Wn={exports:{}},zr={},Lo;function Lv(){return Lo||(Lo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(C,T){return{validate:C,compare:T}}t.fullFormats={date:e(s,o),time:e(l,f),"date-time":e(d,h),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:p,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:A,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:x,int32:{type:"number",validate:b},int64:{type:"number",validate:v},float:{type:"number",validate:w},double:{type:"number",validate:w},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,f),"date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,h),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);function n(C){return C%4===0&&(C%100!==0||C%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(C){const T=r.exec(C);if(!T)return!1;const N=+T[1],_=+T[2],F=+T[3];return _>=1&&_<=12&&F>=1&&F<=(_===2&&n(N)?29:i[_])}function o(C,T){if(C&&T)return C>T?1:C<T?-1:0}const a=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function l(C,T){const N=a.exec(C);if(!N)return!1;const _=+N[1],F=+N[2],$=+N[3],E=N[5];return(_<=23&&F<=59&&$<=59||_===23&&F===59&&$===60)&&(!T||E!=="")}function f(C,T){if(!(C&&T))return;const N=a.exec(C),_=a.exec(T);if(N&&_)return C=N[1]+N[2]+N[3]+(N[4]||""),T=_[1]+_[2]+_[3]+(_[4]||""),C>T?1:C<T?-1:0}const u=/t|\s/i;function d(C){const T=C.split(u);return T.length===2&&s(T[0])&&l(T[1],!0)}function h(C,T){if(!(C&&T))return;const[N,_]=C.split(u),[F,$]=T.split(u),E=o(N,F);if(E!==void 0)return E||f(_,$)}const g=/\/|:/,m=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function p(C){return g.test(C)&&m.test(C)}const y=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function x(C){return y.lastIndex=0,y.test(C)}const S=-2147483648,j=2**31-1;function b(C){return Number.isInteger(C)&&C<=j&&C>=S}function v(C){return Number.isInteger(C)}function w(){return!0}const O=/[^\\]\\Z/;function A(C){if(O.test(C))return!1;try{return new RegExp(C),!0}catch{return!1}}})(zr)),zr}var qr={},Vo;function Vv(){return Vo||(Vo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const e=$c(),n=Ho(),r=n.operators,i={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},s={message:({keyword:a,schemaCode:l})=>n.str`should be ${i[a].okStr} ${l}`,params:({keyword:a,schemaCode:l})=>n._`{comparison: ${i[a].okStr}, limit: ${l}}`};t.formatLimitDefinition={keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:s,code(a){const{gen:l,data:f,schemaCode:u,keyword:d,it:h}=a,{opts:g,self:m}=h;if(!g.validateFormats)return;const p=new e.KeywordCxt(h,m.RULES.all.format.definition,"format");p.$data?y():x();function y(){const j=l.scopeValue("formats",{ref:m.formats,code:g.code.formats}),b=l.const("fmt",n._`${j}[${p.schemaCode}]`);a.fail$data(n.or(n._`typeof ${b} != "object"`,n._`${b} instanceof RegExp`,n._`typeof ${b}.compare != "function"`,S(b)))}function x(){const j=p.schema,b=m.formats[j];if(!b||b===!0)return;if(typeof b!="object"||b instanceof RegExp||typeof b.compare!="function")throw new Error(`"${d}": format "${j}" does not define "compare" function`);const v=l.scopeValue("formats",{key:j,ref:b,code:g.code.formats?n._`${g.code.formats}${n.getProperty(j)}`:void 0});a.fail$data(S(v))}function S(j){return n._`${j}.compare(${f}, ${u}) ${i[d].fail} 0`}},dependencies:["format"]};const o=a=>(a.addKeyword(t.formatLimitDefinition),a);t.default=o})(qr)),qr}var Wo;function Wv(){return Wo||(Wo=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const n=Lv(),r=Vv(),i=Ho(),s=new i.Name("fullFormats"),o=new i.Name("fastFormats"),a=(f,u={keywords:!0})=>{if(Array.isArray(u))return l(f,u,n.fullFormats,s),f;const[d,h]=u.mode==="fast"?[n.fastFormats,o]:[n.fullFormats,s],g=u.formats||n.formatNames;return l(f,g,d,h),u.keywords&&r.default(f),f};a.get=(f,u="full")=>{const h=(u==="fast"?n.fastFormats:n.fullFormats)[f];if(!h)throw new Error(`Unknown format "${f}"`);return h};function l(f,u,d,h){var g,m;(g=(m=f.opts.code).formats)!==null&&g!==void 0||(m.formats=i._`require("ajv-formats/dist/formats").${h}`);for(const p of u)f.addFormat(p,d[p])}t.exports=e=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a})(Wn,Wn.exports)),Wn.exports}var zv=Wv();const zo=fi(zv),qv={allErrors:!0,multipleOfPrecision:8,strict:!1,verbose:!0,discriminator:!1},Kv=/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,Gv=/^data:([a-z]+\/[a-z0-9-+.]+)?;(?:name=(.*);)?base64,(.*)$/;function Hv(t,e,n={},r,i=kc,s){let o=new i({...qv,...n});return r?zo(o,r):r!==!1&&zo(o),o.addFormat("data-url",Gv),o.addFormat("color",Kv),o.addKeyword(Qe),o.addKeyword(wi),Array.isArray(t)&&o.addMetaSchema(t),Z(e)&&Object.keys(e).forEach(a=>{o.addFormat(a,e[a])}),s&&(o=s(o)),o}function Yv(t=[],e){return t.map(r=>{var i;const{instancePath:s,keyword:o,params:a,schemaPath:l,parentSchema:f,...u}=r;let{message:d=""}=u,h=s.replace(/\//g,"."),g=`${h} ${d}`.trim(),m="";const p=[...((i=a.deps)===null||i===void 0?void 0:i.split(", "))||[],a.missingProperty,a.property].filter(y=>y);if(p.length>0)p.forEach(y=>{const x=h?`${h}.${y}`:y;let S=U(I(e,`${x.replace(/^\./,"")}`)).title;if(S===void 0){const j=l.replace(/\/properties\//g,"/").split("/").slice(1,-1).concat([y]);S=U(I(e,j)).title}if(S)d=d.replace(`'${y}'`,`'${S}'`),m=S;else{const j=I(f,[te,y,"title"]);j&&(d=d.replace(`'${y}'`,`'${j}'`),m=j)}}),g=d;else{const y=U(I(e,`${h.replace(/^\./,"")}`)).title;if(y)g=`'${y}' ${d}`.trim(),m=y;else{const x=f?.title;x&&(g=`'${x}' ${d}`.trim(),m=x)}}return"missingProperty"in a&&(h=h?`${h}.${a.missingProperty}`:a.missingProperty),{name:o,property:h,message:d,params:a,stack:g,schemaPath:l,title:m}}).reduce((r,i)=>{const{message:s,schemaPath:o}=i,a=o?.indexOf(`/${J}/`),l=o?.indexOf(`/${q}/`);let f;return a&&a>=0?f=o?.substring(0,a):l&&l>=0&&(f=o?.substring(0,l)),f&&r.find(d=>{var h;return d.message===s&&((h=d.schemaPath)===null||h===void 0?void 0:h.startsWith(f))})||r.push(i),r},[])}function Xv(t,e,n,r,i,s,o){const{validationError:a}=e;let l=Yv(e.errors,o);a&&(l=[...l,{stack:a.message}]),typeof s=="function"&&(l=s(l,o));let f=Ax(l);if(a&&(f={...f,$schema:{__errors:[a.message]}}),typeof i!="function")return{errors:l,errorSchema:f};const u=xl(t,r,n,r,!0),d=i(u,Hr(u),o,f),h=Ml(d);return Xn({errors:l,errorSchema:f},h)}class Jv{constructor(e,n){const{additionalMetaSchemas:r,customFormats:i,ajvOptionsOverrides:s,ajvFormatOptions:o,AjvClass:a,extenderFn:l}=e;this.ajv=Hv(r,i,s,o,a,l),this.localizer=n}reset(){this.ajv.removeSchema()}rawValidation(e,n){var r,i;let s,o;try{e[oe]&&(o=this.ajv.getSchema(e[oe])),o===void 0&&(o=this.ajv.compile(e)),o(n)}catch(l){s=l}let a;return o&&(typeof this.localizer=="function"&&(((r=o.errors)!==null&&r!==void 0?r:[]).forEach(l=>{var f;["missingProperty","property"].forEach(u=>{var d;!((d=l.params)===null||d===void 0)&&d[u]&&(l.params[u]=`'${l.params[u]}'`)}),!((f=l.params)===null||f===void 0)&&f.deps&&(l.params.deps=l.params.deps.split(", ").map(u=>`'${u}'`).join(", "))}),this.localizer(o.errors),((i=o.errors)!==null&&i!==void 0?i:[]).forEach(l=>{var f;["missingProperty","property"].forEach(u=>{var d;!((d=l.params)===null||d===void 0)&&d[u]&&(l.params[u]=l.params[u].slice(1,-1))}),!((f=l.params)===null||f===void 0)&&f.deps&&(l.params.deps=l.params.deps.split(", ").map(u=>u.slice(1,-1)).join(", "))})),a=o.errors||void 0,o.errors=null),{errors:a,validationError:s}}validateFormData(e,n,r,i,s){const o=this.rawValidation(n,e);return Xv(this,o,e,n,r,i,s)}handleSchemaUpdate(e){var n,r;const i=(n=e[oe])!==null&&n!==void 0?n:da;this.ajv.getSchema(i)===void 0?this.ajv.addSchema(e,i):le(e,(r=this.ajv.getSchema(i))===null||r===void 0?void 0:r.schema)||(this.ajv.removeSchema(i),this.ajv.addSchema(e,i))}isValid(e,n,r){var i;try{this.handleSchemaUpdate(r);const s=es(e),o=(i=s[oe])!==null&&i!==void 0?i:vx(s);let a;return a=this.ajv.getSchema(o),a===void 0&&(a=this.ajv.addSchema(s,o).getSchema(o)||this.ajv.compile(s)),a(n)}catch(s){return console.warn("Error encountered compiling schema:",s),!1}}}function Zv(t={},e){return new Jv(t,e)}const Qv=Zv();const e1=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),t1=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),qo=t=>{const e=t1(t);return e.charAt(0).toUpperCase()+e.slice(1)},tc=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),n1=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var r1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const i1=P.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>P.createElement("svg",{ref:l,...r1,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:tc("lucide",i),...!s&&!n1(a)&&{"aria-hidden":"true"},...a},[...o.map(([f,u])=>P.createElement(f,u)),...Array.isArray(s)?s:[s]]));const Xe=(t,e)=>{const n=P.forwardRef(({className:r,...i},s)=>P.createElement(i1,{ref:s,iconNode:e,className:tc(`lucide-${e1(qo(t))}`,`lucide-${t}`,r),...i}));return n.displayName=qo(t),n};const s1=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],o1=Xe("check",s1);const a1=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],nc=Xe("chevron-down",a1);const l1=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],c1=Xe("chevron-up",l1);const u1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],d1=Xe("circle-alert",u1);const f1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],rc=Xe("circle-plus",f1);const m1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],h1=Xe("circle",m1);const p1=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],g1=Xe("copy",p1);const y1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],x1=Xe("search",y1);const b1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],v1=Xe("trash-2",b1);const S1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ic=Xe("x",S1);function G(...t){return Mc(Rc(t))}const w1=mi("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",xs:"h-6 rounded-md gap-1 px-2 has-[>svg]:px-2",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function as({className:t,variant:e,size:n,asChild:r=!1,...i}){const s=r?Yo:"button";return c.jsx(s,{"data-slot":"button",className:G(w1({variant:e,size:n,className:t})),...i})}function j1({uiSchema:t,registry:e,className:n,...r}){const{translateString:i}=e;return c.jsx("div",{className:"p-0 m-0",children:c.jsxs(as,{...r,className:G("w-fit gap-2",n),variant:"outline",type:"button",children:[c.jsx(rc,{size:16})," ",i(K.AddItemButton)]})})}function O1(t){const{children:e,buttonsProps:n,displayLabel:r,hasDescription:i,hasToolbar:s,uiSchema:o,registry:a}=t,l=U(o),f=L("ArrayFieldItemButtonsTemplate",a,l),u=i?-6:22;return c.jsx("div",{children:c.jsxs("div",{className:"mb-2 flex flex-row flex-wrap items-center",children:[c.jsx("div",{className:"grow shrink",children:e}),c.jsx("div",{className:"flex items-end justify-end p-0.5",children:s&&c.jsx("div",{className:"flex gap-2",style:{marginLeft:"5px",marginTop:r?`${u}px`:void 0},children:c.jsx(f,{...n})})})]})})}function A1(t){const{canAdd:e,disabled:n,fieldPathId:r,uiSchema:i,items:s,optionalDataControl:o,onAddClick:a,readonly:l,registry:f,required:u,schema:d,title:h}=t,g=U(i),m=L("ArrayFieldDescriptionTemplate",f,g),p=L("ArrayFieldTitleTemplate",f,g),y=!l&&!n,{ButtonTemplates:{AddButton:x}}=f.templates;return c.jsx("div",{children:c.jsx("div",{className:"m-0 flex p-0",children:c.jsxs("div",{className:"m-0 w-full p-0",children:[c.jsx(p,{fieldPathId:r,title:g.title||h,schema:d,uiSchema:i,required:u,registry:f,optionalDataControl:y?o:void 0}),c.jsx(m,{fieldPathId:r,description:g.description||d.description,schema:d,uiSchema:i,registry:f}),c.jsxs("div",{className:"p-0 m-0 w-full mb-2",children:[y?void 0:o,s,e&&c.jsx("div",{className:"mt-2 flex justify-end",children:c.jsx(x,{id:qe(r,"add"),className:"rjsf-array-item-add",onClick:a,disabled:n||l,uiSchema:i,registry:f})})]},`array-item-list-${r.$id}`)]})})})}function sc({className:t,type:e,...n}){return c.jsx("input",{type:e,"data-slot":"input",className:G("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}function C1({id:t,htmlName:e,placeholder:n,required:r,readonly:i,disabled:s,type:o,value:a,onChange:l,onChangeOverride:f,onBlur:u,onFocus:d,autofocus:h,options:g,schema:m,rawErrors:p=[],children:y,extraProps:x,className:S,registry:j}){const{ClearButton:b}=j.templates.ButtonTemplates,v={...x,...Pl(m,o,g)},w=({target:{value:T}})=>l(T===""?g.emptyValue:T),O=({target:T})=>u(t,T&&T.value),A=({target:T})=>d(t,T&&T.value),C=P.useCallback(T=>{var N;T.preventDefault(),T.stopPropagation(),l((N=g.emptyValue)!==null&&N!==void 0?N:"")},[l,g.emptyValue]);return c.jsxs("div",{className:"p-0.5",children:[c.jsx(sc,{id:t,name:e||t,type:o,placeholder:n,autoFocus:h,required:r,disabled:s,readOnly:i,className:G({"border-destructive focus-visible:ring-0":p.length>0},S),list:m.examples?_n(t):void 0,...v,value:a||a===0?a:"",onChange:f||w,onBlur:O,onFocus:A,"aria-describedby":we(t,!!m.examples)}),g.allowClearTextInputs&&!i&&!s&&a&&c.jsx(b,{onClick:C,registry:j}),y,Array.isArray(m.examples)?c.jsx("datalist",{id:_n(t),children:m.examples.concat(m.default&&!m.examples.includes(m.default)?[m.default]:[]).map(T=>c.jsx("option",{value:T},T))}):null]})}function _1({id:t,description:e,registry:n,uiSchema:r}){return e?c.jsx("div",{children:c.jsx("div",{id:t,className:"text-sm text-muted-foreground",children:c.jsx(ss,{description:e,registry:n,uiSchema:r})})}):null}const N1=mi("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function T1({className:t,variant:e,...n}){return c.jsx("div",{"data-slot":"alert",role:"alert",className:G(N1({variant:e}),t),...n})}function F1({className:t,...e}){return c.jsx("div",{"data-slot":"alert-title",className:G("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...e})}function P1({className:t,...e}){return c.jsx("div",{"data-slot":"alert-description",className:G("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...e})}function E1({errors:t,registry:e}){const{translateString:n}=e;return c.jsxs(T1,{variant:"destructive",className:"mb-2",children:[c.jsx(d1,{className:"h-4 w-4"}),c.jsx(F1,{children:n(K.ErrorsLabel)}),c.jsx(P1,{className:"flex flex-col gap-1",children:t.map((r,i)=>c.jsxs("span",{children:["• ",r.stack]},i))})]})}function I1(t){const{errors:e=[],fieldPathId:n}=t;if(e.length===0)return null;const r=Xi(n);return c.jsx("div",{className:"flex flex-col gap-1",id:r,children:e.map((i,s)=>c.jsx("span",{className:"text-xs font-medium text-destructive mb-1",children:i},s))})}function D1(t){const{fieldPathId:e,help:n,uiSchema:r,registry:i,hasErrors:s}=t;return n?c.jsx("span",{className:G("text-xs font-medium text-muted-foreground",{"text-destructive":s}),id:Ji(e),children:c.jsx(os,{help:n,registry:i,uiSchema:r})}):null}function $1({id:t,children:e,displayLabel:n,rawErrors:r=[],errors:i,help:s,description:o,rawDescription:a,classNames:l,style:f,disabled:u,label:d,hidden:h,onKeyRename:g,onKeyRenameBlur:m,onRemoveProperty:p,readonly:y,required:x,schema:S,uiSchema:j,registry:b}){const v=U(j),w=L("WrapIfAdditionalTemplate",b,v);if(h)return c.jsx("div",{className:"hidden",children:e});const O=v.widget==="checkbox";return c.jsx(w,{classNames:l,style:f,disabled:u,id:t,label:d,displayLabel:n,onKeyRename:g,onKeyRenameBlur:m,onRemoveProperty:p,rawDescription:a,readonly:y,required:x,schema:S,uiSchema:j,registry:b,children:c.jsxs("div",{className:"flex flex-col gap-2",children:[n&&!O&&c.jsxs("label",{className:G("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{" text-destructive":r.length>0}),htmlFor:t,children:[d,x?"*":null]}),e,n&&a&&!O&&c.jsx("span",{className:G("text-xs font-medium text-muted-foreground",{" text-destructive":r.length>0}),children:o}),i,s]})})}function k1(t){const{children:e,column:n,className:r,...i}=t;return c.jsx("div",{className:G("grid gap-2",r),...i,children:e})}function en(t){const{icon:e,iconType:n,className:r,uiSchema:i,registry:s,...o}=t;return c.jsx(as,{size:"icon",variant:"outline",className:r,...o,type:"button",children:e})}function M1(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.CopyButton),...t,icon:c.jsx(g1,{className:"h-4 w-4"})})}function R1(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.MoveDownButton),...t,icon:c.jsx(nc,{className:"h-4 w-4"})})}function B1(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.MoveUpButton),...t,icon:c.jsx(c1,{className:"h-4 w-4"})})}function oc(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.RemoveButton),...t,className:"border-destructive",icon:c.jsx(v1,{className:"h-4 w-4 stroke-destructive"})})}function U1(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.ClearButton),...t,icon:c.jsx(ic,{})})}function L1({selector:t,optionSchemaField:e}){return c.jsxs("div",{className:G("p-4 border rounded-md bg-background shadow-sm"),children:[c.jsx("div",{className:G("mb-4"),children:t}),e]})}function V1({description:t,title:e,properties:n,required:r,uiSchema:i,fieldPathId:s,schema:o,formData:a,optionalDataControl:l,onAddProperty:f,disabled:u,readonly:d,registry:h}){const g=U(i),m=L("TitleFieldTemplate",h,g),p=L("DescriptionFieldTemplate",h,g),y=!d&&!u,{ButtonTemplates:{AddButton:x}}=h.templates;return c.jsxs(c.Fragment,{children:[e&&c.jsx(m,{id:hr(s),title:e,required:r,schema:o,uiSchema:i,registry:h,optionalDataControl:y?l:void 0}),t&&c.jsx(p,{id:Et(s),description:t,schema:o,uiSchema:i,registry:h}),c.jsxs("div",{className:"flex flex-col gap-2",children:[y?void 0:l,n.map((S,j)=>c.jsx("div",{className:`${S.hidden?"hidden":""} flex`,children:c.jsx("div",{className:"w-full",children:S.content})},j)),fa(o,i,a)?c.jsx("div",{className:"mt-2 flex justify-end",children:c.jsx(x,{id:qe(s,"add"),onClick:f,disabled:u||d,className:"rjsf-object-property-expand",uiSchema:i,registry:h})}):null]})]})}function W1(t){const{id:e,registry:n,label:r,onAddClick:i,onRemoveClick:s}=t;return i?c.jsx(en,{id:e,registry:n,className:"rjsf-add-optional-data",onClick:i,title:r,icon:c.jsx(rc,{}),size:"xs"}):s?c.jsx(oc,{id:e,registry:n,className:"rjsf-remove-optional-data",onClick:s,title:r,size:"xs"}):c.jsx("em",{id:e,children:r})}function z1(t){const{submitText:e,norender:n,props:r}=El(t.uiSchema);return n?null:c.jsx("div",{children:c.jsx(as,{type:"submit",...r,className:G("my-2",r?.className),children:e})})}function ac({className:t,orientation:e="horizontal",decorative:n=!0,...r}){return c.jsx(Bc,{"data-slot":"separator",decorative:n,orientation:e,className:G("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...r})}function q1({id:t,title:e,uiSchema:n,optionalDataControl:r}){const i=U(n);let s=c.jsx("h5",{children:i.title||e});return r&&(s=c.jsxs("div",{className:"flex flex-row",children:[c.jsx("div",{className:"flex-grow",children:s}),c.jsx("div",{className:"flex",children:r})]})),c.jsxs("div",{id:t,className:"my-1 flex flex-col gap-0.5",children:[s,c.jsx(ac,{dir:"horizontal",style:{height:"1px"},className:"my-1"})]})}function K1({classNames:t,style:e,children:n,disabled:r,id:i,label:s,displayLabel:o,onRemoveProperty:a,onKeyRenameBlur:l,rawDescription:f,readonly:u,required:d,schema:h,uiSchema:g,registry:m}){const{templates:p,translateString:y}=m,{RemoveButton:x}=p.ButtonTemplates,S=y(K.KeyLabel,[s]);if(!(Qe in h))return c.jsx("div",{className:t,style:e,children:n});const v=o?22+(f?-28:0):0,w=`${i}-key`;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`grid grid-cols-12 col-span-12 items-center gap-2 ${t}`,style:e,children:[c.jsx("div",{className:"grid gap-2 col-span-5",children:c.jsxs("div",{className:"flex flex-col gap-2",children:[o&&c.jsx("label",{htmlFor:w,className:"text-sm font-medium text-muted-foreground leading-none",children:S}),c.jsx("div",{className:"pl-0.5",children:c.jsx(sc,{required:d,defaultValue:s,disabled:r||u,id:w,name:w,onBlur:u?void 0:l,type:"text",className:"w-full border shadow-sm"})}),!!f&&c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c.jsx("div",{className:"text-sm text-muted-foreground",children:" "})})]})}),c.jsx("div",{className:"grid gap-2 col-span-6 pr-0.5",children:n}),c.jsx("div",{className:"grid gap-2 col-span-1",style:{marginTop:`${v}px`},children:c.jsx(x,{id:qe(i,"remove"),iconType:"block",className:"rjsf-object-property-remove w-full",disabled:r||u,onClick:a,uiSchema:g,registry:m})})]}),c.jsx(ac,{dir:"horizontal",className:"mt-2"})]})}function G1(){return{ArrayFieldItemTemplate:O1,ArrayFieldTemplate:A1,BaseInputTemplate:C1,ButtonTemplates:{AddButton:j1,CopyButton:M1,MoveDownButton:R1,MoveUpButton:B1,RemoveButton:oc,SubmitButton:z1,ClearButton:U1},DescriptionFieldTemplate:_1,ErrorListTemplate:E1,FieldErrorTemplate:I1,FieldHelpTemplate:D1,FieldTemplate:$1,GridTemplate:k1,MultiSchemaFieldTemplate:L1,ObjectFieldTemplate:V1,OptionalDataControlsTemplate:W1,TitleFieldTemplate:q1,WrapIfAdditionalTemplate:K1}}function H1(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var Y1=["color"],X1=P.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=H1(t,Y1);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),P.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});function lc({className:t,...e}){return c.jsx(Uc,{"data-slot":"checkbox",className:G("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:c.jsx(Lc,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:c.jsx(X1,{className:"size-3.5"})})})}function ls({className:t,...e}){return c.jsx(Vc,{"data-slot":"label",className:G("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...e})}function J1(t){const{id:e,htmlName:n,value:r,disabled:i,readonly:s,label:o,hideLabel:a,schema:l,autofocus:f,options:u,onChange:d,onBlur:h,onFocus:g,registry:m,uiSchema:p,className:y}=t,x=hn(l),S=L("DescriptionFieldTemplate",m,u),j=O=>d(O),b=()=>h(e,r),v=()=>g(e,r),w=u.description||l.description;return c.jsxs("div",{className:`relative ${i||s?"cursor-not-allowed opacity-50":""}`,"aria-describedby":we(e),children:[!a&&w&&c.jsx(S,{id:Et(e),description:w,schema:l,uiSchema:p,registry:m}),c.jsxs("div",{className:"flex items-center gap-2 my-2",children:[c.jsx(lc,{id:e,name:n||e,checked:typeof r>"u"?!1:!!r,required:x,disabled:i||s,autoFocus:f,onCheckedChange:j,onBlur:b,onFocus:v,className:y}),c.jsx(ls,{className:"leading-tight",htmlFor:e,children:Dl(o,a||!o)})]})]})}function Z1({id:t,htmlName:e,disabled:n,options:r,value:i,autofocus:s,readonly:o,required:a,onChange:l,onBlur:f,onFocus:u,className:d}){const{enumOptions:h,enumDisabled:g,inline:m,emptyValue:p}=r,y=Array.isArray(i)?i:[i],x=({target:j})=>f(t,ge(j&&j.value,h,p)),S=({target:j})=>u(t,ge(j&&j.value,h,p));return c.jsx("div",{className:G({"flex flex-col gap-2":!m,"flex flex-row gap-4 flex-wrap":m}),children:Array.isArray(h)&&h.map((j,b)=>{const v=kn(j.value,y),w=Array.isArray(g)&&g.indexOf(j.value)!==-1,O=wt(t,b);return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(lc,{id:O,name:e||t,required:a,disabled:n||w||o,onCheckedChange:A=>{l(A?Nl(b,y,h):Cl(b,y,h))},className:d,checked:v,autoFocus:s&&b===0,onBlur:x,onFocus:S,"aria-describedby":we(t)}),c.jsx(ls,{className:"leading-tight",htmlFor:wt(t,b),children:j.label})]},O)})})}function Q1({className:t,...e}){return c.jsx(_u,{"data-slot":"radio-group",className:G("grid gap-3",t),...e})}function eS({className:t,...e}){return c.jsx(Nu,{"data-slot":"radio-group-item",className:G("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:c.jsx(Tu,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:c.jsx(h1,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function tS({id:t,options:e,value:n,required:r,disabled:i,readonly:s,onChange:o,onBlur:a,onFocus:l,className:f}){const{enumOptions:u,enumDisabled:d,emptyValue:h}=e,g=x=>o(ge(x,u,h)),m=({target:x})=>a(t,ge(x&&x.value,u,h)),p=({target:x})=>l(t,ge(x&&x.value,u,h)),y=!!(e&&e.inline);return c.jsx("div",{className:"mb-0",children:c.jsx(Q1,{defaultValue:n?.toString(),required:r,disabled:i||s,onValueChange:x=>{g(x)},onBlur:m,onFocus:p,"aria-describedby":we(t),orientation:y?"horizontal":"vertical",className:G("flex flex-wrap",{"flex-col":!y},f),children:Array.isArray(u)&&u.map((x,S)=>{const j=Array.isArray(d)&&d.indexOf(x.value)!==-1,b=kn(x.value,n);return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(eS,{checked:b,value:S.toString(),id:wt(t,S),disabled:j}),c.jsx(ls,{className:"leading-tight",htmlFor:wt(t,S),children:x.label})]},wt(t,S))})})})}var cc=["PageUp","PageDown"],uc=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],dc={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},tn="Slider",[li,nS,rS]=zc(tn),[fc]=Gc(tn,[rS]),[iS,yr]=fc(tn),mc=P.forwardRef((t,e)=>{const{name:n,min:r=0,max:i=100,step:s=1,orientation:o="horizontal",disabled:a=!1,minStepsBetweenThumbs:l=0,defaultValue:f=[r],value:u,onValueChange:d=()=>{},onValueCommit:h=()=>{},inverted:g=!1,form:m,...p}=t,y=P.useRef(new Set),x=P.useRef(0),j=o==="horizontal"?sS:oS,[b=[],v]=Wc({prop:u,defaultProp:f,onChange:N=>{[...y.current][x.current]?.focus(),d(N)}}),w=P.useRef(b);function O(N){const _=dS(b,N);T(N,_)}function A(N){T(N,x.current)}function C(){const N=w.current[x.current];b[x.current]!==N&&h(b)}function T(N,_,{commit:F}={commit:!1}){const $=pS(s),E=gS(Math.round((N-r)/s)*s+r,$),D=sa(E,[r,i]);v((M=[])=>{const k=cS(M,D,_);if(hS(k,l*s)){x.current=k.indexOf(D);const B=String(k)!==String(M);return B&&F&&h(k),B?k:M}else return M})}return c.jsx(iS,{scope:t.__scopeSlider,name:n,disabled:a,min:r,max:i,valueIndexToChangeRef:x,thumbs:y.current,values:b,orientation:o,form:m,children:c.jsx(li.Provider,{scope:t.__scopeSlider,children:c.jsx(li.Slot,{scope:t.__scopeSlider,children:c.jsx(j,{"aria-disabled":a,"data-disabled":a?"":void 0,...p,ref:e,onPointerDown:Rt(p.onPointerDown,()=>{a||(w.current=b)}),min:r,max:i,inverted:g,onSlideStart:a?void 0:O,onSlideMove:a?void 0:A,onSlideEnd:a?void 0:C,onHomeKeyDown:()=>!a&&T(r,0,{commit:!0}),onEndKeyDown:()=>!a&&T(i,b.length-1,{commit:!0}),onStepKeyDown:({event:N,direction:_})=>{if(!a){const E=cc.includes(N.key)||N.shiftKey&&uc.includes(N.key)?10:1,D=x.current,M=b[D],k=s*E*_;T(M+k,D,{commit:!0})}}})})})})});mc.displayName=tn;var[hc,pc]=fc(tn,{startEdge:"left",endEdge:"right",size:"width",direction:1}),sS=P.forwardRef((t,e)=>{const{min:n,max:r,dir:i,inverted:s,onSlideStart:o,onSlideMove:a,onSlideEnd:l,onStepKeyDown:f,...u}=t,[d,h]=P.useState(null),g=Yt(e,j=>h(j)),m=P.useRef(void 0),p=qc(i),y=p==="ltr",x=y&&!s||!y&&s;function S(j){const b=m.current||d.getBoundingClientRect(),v=[0,b.width],O=cs(v,x?[n,r]:[r,n]);return m.current=b,O(j-b.left)}return c.jsx(hc,{scope:t.__scopeSlider,startEdge:x?"left":"right",endEdge:x?"right":"left",direction:x?1:-1,size:"width",children:c.jsx(gc,{dir:p,"data-orientation":"horizontal",...u,ref:g,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:j=>{const b=S(j.clientX);o?.(b)},onSlideMove:j=>{const b=S(j.clientX);a?.(b)},onSlideEnd:()=>{m.current=void 0,l?.()},onStepKeyDown:j=>{const v=dc[x?"from-left":"from-right"].includes(j.key);f?.({event:j,direction:v?-1:1})}})})}),oS=P.forwardRef((t,e)=>{const{min:n,max:r,inverted:i,onSlideStart:s,onSlideMove:o,onSlideEnd:a,onStepKeyDown:l,...f}=t,u=P.useRef(null),d=Yt(e,u),h=P.useRef(void 0),g=!i;function m(p){const y=h.current||u.current.getBoundingClientRect(),x=[0,y.height],j=cs(x,g?[r,n]:[n,r]);return h.current=y,j(p-y.top)}return c.jsx(hc,{scope:t.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:c.jsx(gc,{"data-orientation":"vertical",...f,ref:d,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:p=>{const y=m(p.clientY);s?.(y)},onSlideMove:p=>{const y=m(p.clientY);o?.(y)},onSlideEnd:()=>{h.current=void 0,a?.()},onStepKeyDown:p=>{const x=dc[g?"from-bottom":"from-top"].includes(p.key);l?.({event:p,direction:x?-1:1})}})})}),gc=P.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:o,onEndKeyDown:a,onStepKeyDown:l,...f}=t,u=yr(tn,n);return c.jsx(Nn.span,{...f,ref:e,onKeyDown:Rt(t.onKeyDown,d=>{d.key==="Home"?(o(d),d.preventDefault()):d.key==="End"?(a(d),d.preventDefault()):cc.concat(uc).includes(d.key)&&(l(d),d.preventDefault())}),onPointerDown:Rt(t.onPointerDown,d=>{const h=d.target;h.setPointerCapture(d.pointerId),d.preventDefault(),u.thumbs.has(h)?h.focus():r(d)}),onPointerMove:Rt(t.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&i(d)}),onPointerUp:Rt(t.onPointerUp,d=>{const h=d.target;h.hasPointerCapture(d.pointerId)&&(h.releasePointerCapture(d.pointerId),s(d))})})}),yc="SliderTrack",xc=P.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=yr(yc,n);return c.jsx(Nn.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:e})});xc.displayName=yc;var ci="SliderRange",bc=P.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=yr(ci,n),s=pc(ci,n),o=P.useRef(null),a=Yt(e,o),l=i.values.length,f=i.values.map(h=>wc(h,i.min,i.max)),u=l>1?Math.min(...f):0,d=100-Math.max(...f);return c.jsx(Nn.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:a,style:{...t.style,[s.startEdge]:u+"%",[s.endEdge]:d+"%"}})});bc.displayName=ci;var ui="SliderThumb",vc=P.forwardRef((t,e)=>{const n=nS(t.__scopeSlider),[r,i]=P.useState(null),s=Yt(e,a=>i(a)),o=P.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return c.jsx(aS,{...t,ref:s,index:o})}),aS=P.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:i,...s}=t,o=yr(ui,n),a=pc(ui,n),[l,f]=P.useState(null),u=Yt(e,S=>f(S)),d=l?o.form||!!l.closest("form"):!0,h=Kc(l),g=o.values[r],m=g===void 0?0:wc(g,o.min,o.max),p=uS(r,o.values.length),y=h?.[a.size],x=y?fS(y,m,a.direction):0;return P.useEffect(()=>{if(l)return o.thumbs.add(l),()=>{o.thumbs.delete(l)}},[l,o.thumbs]),c.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${m}% + ${x}px)`},children:[c.jsx(li.ItemSlot,{scope:t.__scopeSlider,children:c.jsx(Nn.span,{role:"slider","aria-label":t["aria-label"]||p,"aria-valuemin":o.min,"aria-valuenow":g,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...s,ref:u,style:g===void 0?{display:"none"}:t.style,onFocus:Rt(t.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),d&&c.jsx(Sc,{name:i??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:g},r)]})});vc.displayName=ui;var lS="RadioBubbleInput",Sc=P.forwardRef(({__scopeSlider:t,value:e,...n},r)=>{const i=P.useRef(null),s=Yt(i,r),o=Hc(e);return P.useEffect(()=>{const a=i.current;if(!a)return;const l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==e&&u){const d=new Event("input",{bubbles:!0});u.call(a,e),a.dispatchEvent(d)}},[o,e]),c.jsx(Nn.input,{style:{display:"none"},...n,ref:s,defaultValue:e})});Sc.displayName=lS;function cS(t=[],e,n){const r=[...t];return r[n]=e,r.sort((i,s)=>i-s)}function wc(t,e,n){const s=100/(n-e)*(t-e);return sa(s,[0,100])}function uS(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function dS(t,e){if(t.length===1)return 0;const n=t.map(i=>Math.abs(i-e)),r=Math.min(...n);return n.indexOf(r)}function fS(t,e,n){const r=t/2,s=cs([0,50],[0,r]);return(r-s(e)*n)*n}function mS(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function hS(t,e){if(e>0){const n=mS(t);return Math.min(...n)>=e}return!0}function cs(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function pS(t){return(String(t).split(".")[1]||"").length}function gS(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var yS=mc,xS=xc,bS=bc,vS=vc;function SS({className:t,defaultValue:e,value:n,min:r=0,max:i=100,...s}){const o=P.useMemo(()=>Array.isArray(n)?n:Array.isArray(e)?e:[r,i],[n,e,r,i]);return c.jsxs(yS,{"data-slot":"slider",defaultValue:e,value:n,min:r,max:i,className:G("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...s,children:[c.jsx(xS,{"data-slot":"slider-track",className:G("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:c.jsx(bS,{"data-slot":"slider-range",className:G("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:o.length},(a,l)=>c.jsx(vS,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},l))]})}const wS=["name","min","max","step","orientation","disabled","defaultValue","value","onValueChange","className","dir","inverted","minStepsBetweenThumbs"];function jS({value:t,readonly:e,disabled:n,options:r,schema:i,onChange:s,label:o,id:a}){const l=d=>s(d[0]),f={...Fl(i)},u={id:a,...Gi(r.props||{},wS)};return c.jsxs(c.Fragment,{children:[c.jsx(SS,{disabled:n||e,min:f.min,max:f.max,step:f.step,value:[t],onValueChange:l,...u,"aria-describedby":we(a)}),t]})}const OS=mi("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function AS({className:t,variant:e,asChild:n=!1,...r}){const i=n?Yo:"span";return c.jsx(i,{"data-slot":"badge",className:G(OS({variant:e}),t),...r})}const jc=P.forwardRef(({className:t,...e},n)=>c.jsx(Ct,{ref:n,"data-slot":"command",className:G("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),...e})),CS=P.forwardRef(({className:t,...e},n)=>c.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[c.jsx(x1,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),c.jsx(Ct.Input,{ref:n,className:G("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));CS.displayName=Ct.Input.displayName;function Oc({className:t,...e}){return c.jsx(Ct.List,{"data-slot":"command-list",className:G("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),...e})}function Ac({className:t,...e}){return c.jsx(Ct.Group,{"data-slot":"command-group",className:G("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),...e})}function Cc({className:t,...e}){return c.jsx(Ct.Item,{"data-slot":"command-item",className:G("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...e})}function _S({multiple:t,items:e=[],selected:n,onValueChange:r,autoFocus:i=!1,disabled:s=!1,ariaDescribedby:o,ariaPlaceholder:a,onFocus:l,onBlur:f,className:u,id:d}){const h=P.useRef(null),[g,m]=P.useState(!1),[p,y]=P.useState(""),x=P.useMemo(()=>e.filter(O=>n.some(A=>dt(O.value,A))),[e,n]),S=P.useMemo(()=>e.filter(O=>!x.some(A=>dt(A.value,O.value))),[e,x]),j=P.useCallback(O=>{if(s)return;const A=x.filter(C=>!dt(C.value,O.value));r?.(A.map(C=>C.index))},[x,r,s]),b=P.useCallback(O=>{if(!(s||!h.current||h.current.value!==""))if(O.key==="Delete"||O.key==="Backspace"){const A=x.slice(0,-1);r?.(A.map(C=>C.index))}else O.key==="Escape"&&h.current.blur()},[x,r,s]),v=P.useCallback(O=>{if(s)return;y("");const A=t?[...x,O]:[O];r?.(A.map(C=>C.index))},[t,x,r,s]),w=P.useCallback(O=>{s||m(!0),l?.(O)},[s,l]);return c.jsxs(jc,{onKeyDown:b,className:G("overflow-visible bg-transparent",u),autoFocus:i,"aria-disabled":s,onBlur:f,onFocus:w,"aria-describedby":o,"aria-placeholder":a,children:[c.jsx("div",{className:G("group border border-input px-3 py-2 text-sm ring-offset-background rounded-md focus-within:ring-1 focus-within:ring-ring focus-within:ring-offset-1",s&&"opacity-50 cursor-not-allowed"),children:c.jsxs("div",{className:"flex gap-1 flex-wrap",children:[x.map(O=>c.jsxs(AS,{variant:"secondary",children:[O.label,c.jsx("button",{type:"button",className:"rtl:mr-1 ltr:ml-1 ring-offset-background rounded-full outline-none focus:ring-1 focus:ring-ring focus:ring-offset-1",onKeyDown:A=>A.key==="Enter"&&!s&&j(O),onMouseDown:A=>{A.preventDefault(),A.stopPropagation()},onClick:()=>j(O),disabled:s,children:c.jsx(ic,{className:G("h-3 w-3 text-muted-foreground hover:text-foreground",s&&"pointer-events-none")})})]},O.value)),c.jsx(Ct.Input,{ref:h,value:p,onValueChange:y,onBlur:()=>m(!1),onFocus:()=>!s&&m(!0),placeholder:"Select ...",className:"rtl:mr-2 ltr:ml-2 bg-transparent outline-none placeholder:text-muted-foreground flex-1",disabled:s,"aria-controls":`command-item-input-${d}`,"aria-labelledby":`command-item-input-${d}`,id:`command-item-input-${d}`})]})}),g&&!s&&S.length>0&&c.jsx("div",{className:"relative mt-2",children:c.jsx("div",{className:"absolute w-full z-10 top-0 rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in",children:c.jsx(Ac,{className:"h-full overflow-auto",children:c.jsx(Oc,{children:S.map(O=>c.jsx(Cc,{disabled:O.disabled,onMouseDown:A=>{A.preventDefault(),A.stopPropagation()},"aria-controls":`${O.value}-command-item`,"aria-labelledby":`${O.value}-command-item`,id:`${O.value}-command-item`,onSelect:()=>v(O),className:"cursor-pointer",children:O.label},`${O.value}-command-item`))})})})})]})}function NS({items:t,selected:e,onValueChange:n,autoFocus:r=!1,disabled:i=!1,required:s=!1,placeholder:o="Select...",ariaDescribedby:a,ariaPlaceholder:l,onFocus:f,onBlur:u,className:d}){const[h,g]=P.useState(!1),m=t?.find(S=>S.value===e),p=P.useRef(null),y=P.useRef(null);P.useEffect(()=>{h&&p.current&&requestAnimationFrame(()=>{var S;(S=p.current)===null||S===void 0||S.scrollIntoView({block:"nearest"})})},[h]);const x=S=>{y.current&&!y.current.contains(S.relatedTarget)&&g(!1),u?.(S)};return c.jsxs(jc,{ref:y,className:G("overflow-visible bg-transparent",d),autoFocus:r,"aria-disabled":i,onBlur:x,onFocus:f,"aria-describedby":a,"aria-placeholder":l,children:[c.jsxs("div",{onClick:()=>!i&&g(!h),className:G("flex h-9 w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",!m&&s&&"border-red-500",i&&"opacity-50 cursor-not-allowed",d),children:[c.jsx("span",{className:G("flex-1 line-clamp-1",!m&&"text-muted-foreground"),children:m?.label||o}),c.jsx(nc,{className:"h-4 w-4 opacity-50"})]}),c.jsx("div",{className:"relative",children:h&&t&&t.length>0?c.jsx("div",{style:{top:"0.5rem"},className:"absolute w-full z-10 rounded-md border bg-popover text-popover-foreground shadow-md outline-none",children:c.jsx(Ac,{className:"h-full overflow-auto",children:c.jsx(Oc,{children:t.map(S=>c.jsxs(Cc,{ref:S.value===e?p:void 0,onMouseDown:j=>{j.preventDefault(),j.stopPropagation()},onSelect:()=>{S.disabled||(n?.(S.value),g(!1))},className:G("cursor-pointer relative flex items-center justify-between rounded-sm py-1.5 gap-2 rtl:flex-row-reverse",S.value===e&&"font-semibold",S.disabled&&"opacity-50 cursor-not-allowed"),children:[c.jsx("span",{children:S.label}),c.jsx("span",{className:"flex h-3.5 w-3.5 items-center justify-center",children:S.value===e&&c.jsx(o1,{className:"h-4 w-4"})})]},S.value))})})}):null})]})}function TS({id:t,options:e,required:n,disabled:r,readonly:i,value:s,multiple:o,autofocus:a,onChange:l,onBlur:f,onFocus:u,defaultValue:d,placeholder:h,rawErrors:g=[],className:m}){const{enumOptions:p,enumDisabled:y,emptyValue:x}=e,S=()=>{u(t,ge(s,p,x))},j=()=>{f(t,ge(s,p,x))},b=p?.map(({value:w,label:O},A)=>({value:o?w:A.toString(),label:O,index:A,disabled:Array.isArray(y)&&y.includes(w)})),v=G({"border-destructive":g.length>0},m);return c.jsx("div",{className:"p-0.5",children:o?c.jsx(_S,{id:t,autoFocus:a,disabled:r||i,multiple:!0,className:v,items:b,selected:s,onValueChange:w=>{l(ge(w,p,x))},onFocus:S,onBlur:j}):c.jsx(NS,{items:b,selected:_l(s??d,p,!1),onValueChange:w=>{l(ge(w,p,x))},autoFocus:a,disabled:r||i,required:n,placeholder:h,className:v,onFocus:S,onBlur:j,ariaDescribedby:we(t)})})}function FS({className:t,...e}){return c.jsx("textarea",{"data-slot":"textarea",className:G("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...e})}function PS({id:t,htmlName:e,placeholder:n,value:r,required:i,disabled:s,autofocus:o,readonly:a,onBlur:l,onFocus:f,onChange:u,options:d,className:h}){const g=({target:{value:y}})=>u(y===""?d.emptyValue:y),m=({target:y})=>l(t,y&&y.value),p=({target:y})=>f(t,y&&y.value);return c.jsx("div",{className:"flex p-0.5",children:c.jsx(FS,{id:t,name:e||t,placeholder:n,disabled:s,readOnly:a,value:r??"",required:i,autoFocus:o,rows:d.rows||5,onChange:g,onBlur:m,onFocus:p,"aria-describedby":we(t),className:h})})}function ES(){return{CheckboxWidget:J1,CheckboxesWidget:Z1,RadioWidget:tS,RangeWidget:jS,SelectWidget:TS,TextareaWidget:PS}}function IS(){return{templates:G1(),widgets:ES()}}function DS(){return Uv(IS())}const $S=DS();function kS(t){const e=t.properties;if(!e)return!1;const n=e.__type,r=e.__binding;return!!(n?.const||r?.const)}function MS(t){const e=t.properties;if(!e)return{};const n=e.__type,r=e.__binding;return{bindingType:n?.const,bindingSchema:r?.const}}function RS(t){return t.replace(/^root_/,"").split("_")[0]||""}function Ko(t){return typeof t!="string"?!1:(t.startsWith("@")?t.slice(1):t).includes("/")}function BS(t){const e=ve.c(8),{bindingSchema:n,bindingType:r,currentValue:i,onValueChange:s,placeholder:o,onAddNew:a,className:l}=t,f=Ko(n),u=Ko(r),d=f||u,h=f?n:u?r:void 0,{bindingSchema:g}=Id(h);let m;e:{if(d){m=g;break e}if(Array.isArray(n)){m=n;break e}if(typeof n=="string"){m=n;break e}m=void 0}const p=m;let y;return e[0]!==r||e[1]!==l||e[2]!==i||e[3]!==a||e[4]!==s||e[5]!==o||e[6]!==p?(y=c.jsx(US,{value:i,onValueChange:s,placeholder:o,binding:p,bindingType:r,onAddNew:a,className:l}),e[0]=r,e[1]=l,e[2]=i,e[3]=a,e[4]=s,e[5]=o,e[6]=p,e[7]=y):y=e[7],y}function US({value:t,onValueChange:e,placeholder:n="Select a connection...",binding:r,bindingType:i,onAddNew:s,className:o}){const[a,l]=P.useState(!1),{installByBinding:f,isInstalling:u}=$d(),d=a||u,h=pi(),g=ea({connections:h,binding:r}),m=(()=>{if(!i?.startsWith("@"))return null;const[S,j]=i.replace("@","").split("/");return S&&j?{scope:S,appName:j}:null})(),p=(()=>{let S=g;const j=Array.isArray(r)&&r.length>0;if(m&&!j&&(S=S.filter(b=>{const v=b.app_name,w=b.metadata?.scopeName;return v===m.appName&&w===m.scope})),t&&!S.some(b=>b.id===t)){const b=h?.find(v=>v.id===t);if(b)return[b,...S]}return S})(),y=i?.startsWith("@"),x=async()=>{if(y&&i){l(!0);try{const S=await f(i);S&&e(S.id)}catch(S){const j=S instanceof Error?S.message:String(S);Ut.error(`Failed to connect MCP: ${j}`)}finally{l(!1)}return}s?.()};return c.jsxs(ta,{value:t,onValueChange:e,children:[c.jsx(na,{size:"sm",className:hu("w-[200px]",o),children:c.jsx(ra,{placeholder:n})}),c.jsxs(ia,{children:[p.length===0?c.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No connections found"}):p.map(S=>c.jsx(kt,{value:S.id,children:c.jsxs("div",{className:"flex items-center gap-2",children:[S.icon?c.jsx("img",{src:S.icon,alt:S.title,className:"w-4 h-4 rounded"}):c.jsx("div",{className:"w-4 h-4 rounded bg-linear-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:S.title.slice(0,1).toUpperCase()}),c.jsx("span",{children:S.title})]})},S.id)),(s||y)&&c.jsx("div",{className:"border-t border-border",children:c.jsx(Wt,{onClick:S=>{S.preventDefault(),S.stopPropagation(),x()},disabled:d,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:d?c.jsxs(c.Fragment,{children:[c.jsx(yn,{size:16,className:"animate-spin"}),c.jsx("span",{children:"Connecting..."})]}):c.jsxs(c.Fragment,{children:[c.jsx(aa,{size:16}),c.jsx("span",{children:"Custom Connection"})]})})})]})]})}function LS(t){const e=ve.c(68),{schema:n,formData:r,title:i,description:s,registry:o}=t,a=o.formContext,l=t.properties[0]?.content?.key;let f;e[0]!==l||e[1]!==i?(f=i||(l?RS(l):""),e[0]=l,e[1]=i,e[2]=f):f=e[2];const u=f;if(kS(n)){const g=n;let m;e[3]!==g?(m=MS(g),e[3]=g,e[4]=m):m=e[4];const{bindingType:p,bindingSchema:y}=m,x=r?.value||"";let S;e[5]!==p||e[6]!==u||e[7]!==a||e[8]!==r?(S=M=>{const k={...r,value:M,...p&&{__type:p}};a?.onFieldChange(u,k)},e[5]=p,e[6]=u,e[7]=a,e[8]=r,e[9]=S):S=e[9];const j=S;let b;e[10]!==p||e[11]!==u||e[12]!==a?(b=M=>{a?.onFieldChange(u,{__type:p,value:{id:M.id,connectionId:M.connectionId}})},e[10]=p,e[11]=u,e[12]=a,e[13]=b):b=e[13];const v=b,w=WS;let O;e[14]!==u||e[15]!==i?(O=w(i||u),e[14]=u,e[15]=i,e[16]=O):O=e[16];const A=O;if(p==="@deco/agent"){let M;e[17]!==A?(M=c.jsx("label",{className:"text-sm font-medium truncate block",children:A}),e[17]=A,e[18]=M):M=e[18];let k;e[19]!==s?(k=s&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s}),e[19]=s,e[20]=k):k=e[20];let B;e[21]!==M||e[22]!==k?(B=c.jsxs("div",{className:"flex-1 min-w-0",children:[M,k]}),e[21]=M,e[22]=k,e[23]=B):B=e[23];const W=x||void 0;let R;e[24]!==j||e[25]!==W?(R=c.jsx(Fu,{selectedVirtualMcpId:W,onVirtualMcpChange:j,variant:"bordered",placeholder:"Select Agent",className:"w-[200px] shrink-0"}),e[24]=j,e[25]=W,e[26]=R):R=e[26];let V;return e[27]!==R||e[28]!==B?(V=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[B,R]}),e[27]=R,e[28]=B,e[29]=V):V=e[29],V}if(p==="@deco/language-model"){let M;e[30]!==A?(M=c.jsx("label",{className:"text-sm font-medium truncate block",children:A}),e[30]=A,e[31]=M):M=e[31];let k;e[32]!==s?(k=s&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s}),e[32]=s,e[33]=k):k=e[33];let B;e[34]!==M||e[35]!==k?(B=c.jsxs("div",{className:"flex-1 min-w-0",children:[M,k]}),e[34]=M,e[35]=k,e[36]=B):B=e[36];const W=x;let R;e[37]!==v||e[38]!==W?(R=c.jsx(Pu,{selectedModel:W,onModelChange:v,variant:"bordered",placeholder:"Select Language Model",className:"w-[200px] shrink-0"}),e[37]=v,e[38]=W,e[39]=R):R=e[39];let V;return e[40]!==R||e[41]!==B?(V=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[B,R]}),e[40]=R,e[41]=B,e[42]=V):V=e[42],V}let C;e[43]!==A?(C=c.jsx("label",{className:"text-sm font-medium truncate block",children:A}),e[43]=A,e[44]=C):C=e[44];let T;e[45]!==s?(T=s&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s}),e[45]=s,e[46]=T):T=e[46];let N;e[47]!==C||e[48]!==T?(N=c.jsxs("div",{className:"flex-1 min-w-0",children:[C,T]}),e[47]=C,e[48]=T,e[49]=N):N=e[49];let _;e[50]!==A?(_=A.toLowerCase(),e[50]=A,e[51]=_):_=e[51];const F=`Select ${_}...`;let $;e[52]!==a?($=()=>a?.onAddNew(),e[52]=a,e[53]=$):$=e[53];let E;e[54]!==y||e[55]!==p||e[56]!==x||e[57]!==j||e[58]!==F||e[59]!==$?(E=c.jsx(BS,{bindingSchema:y,bindingType:p,currentValue:x,onValueChange:j,placeholder:F,onAddNew:$,className:"w-[200px] shrink-0"}),e[54]=y,e[55]=p,e[56]=x,e[57]=j,e[58]=F,e[59]=$,e[60]=E):E=e[60];let D;return e[61]!==E||e[62]!==N?(D=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[N,E]}),e[61]=E,e[62]=N,e[63]=D):D=e[63],D}let d;e[64]!==t.properties?(d=t.properties.map(VS),e[64]=t.properties,e[65]=d):d=e[65];let h;return e[66]!==d?(h=c.jsx("div",{className:"flex flex-col gap-4",children:d}),e[66]=d,e[67]=h):h=e[67],h}function VS(t){return t.content}function WS(t){return t.toLowerCase().replace(/_/g," ").replace(/\b\w/g,zS)}function zS(t){return t.toUpperCase()}function qS(t){const e=ve.c(13),{label:n,children:r,description:i,id:s,schema:o}=t;if(s.includes("__type")||s.includes("__binding"))return null;if(o.type==="object")return r;let a;e[0]!==s||e[1]!==n?(a=n&&c.jsx("label",{className:"text-sm font-medium truncate block",htmlFor:s,children:n}),e[0]=s,e[1]=n,e[2]=a):a=e[2];let l;e[3]!==i?(l=i&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i}),e[3]=i,e[4]=l):l=e[4];let f;e[5]!==a||e[6]!==l?(f=c.jsxs("div",{className:"flex-1 min-w-0",children:[a,l]}),e[5]=a,e[6]=l,e[7]=f):f=e[7];let u;e[8]!==r?(u=c.jsx("div",{className:"w-[200px] shrink-0",children:r}),e[8]=r,e[9]=u):u=e[9];let d;return e[10]!==f||e[11]!==u?(d=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[f,u]}),e[10]=f,e[11]=u,e[12]=d):d=e[12],d}const KS={ObjectFieldTemplate:LS,FieldTemplate:qS};function GS(t){const e=ve.c(18),{formState:n,onFormStateChange:r,stateSchema:i}=t,{org:s}=gi(),o=Go();let a;e[0]!==r?(a=x=>{x.formData&&r(x.formData)},e[0]=r,e[1]=a):a=e[1];const l=a;let f;e[2]!==n||e[3]!==r?(f=(x,S)=>{const j={...n,[x]:S};r(j)},e[2]=n,e[3]=r,e[4]=f):f=e[4];const u=f;let d;e[5]!==o||e[6]!==s?(d=()=>{o({to:"/$org/mcps",params:{org:s.slug},search:{action:"create"}})},e[5]=o,e[6]=s,e[7]=d):d=e[7];const h=d;let g;e[8]!==n||e[9]!==h||e[10]!==u?(g={onFieldChange:u,formData:n,onAddNew:h},e[8]=n,e[9]=h,e[10]=u,e[11]=g):g=e[11];const m=g;let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(c.Fragment,{}),e[12]=p):p=e[12];let y;return e[13]!==m||e[14]!==n||e[15]!==l||e[16]!==i?(y=c.jsx("div",{className:"flex flex-col h-full overflow-auto p-5",children:c.jsx($S,{schema:i,validator:Qv,formData:n,onChange:l,formContext:m,liveValidate:!1,showErrorList:!1,templates:KS,children:p})}),e[13]=m,e[14]=n,e[15]=l,e[16]=i,e[17]=y):y=e[17],y}const HS=Xo({key:Ae().min(1,"Key is required"),value:Ae()}),YS=Xo({title:Ae().min(1,"Name is required"),description:Ae().nullable().optional(),ui_type:Jc(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:Ae().optional(),connection_token:Ae().nullable().optional(),npx_package:Ae().optional(),stdio_command:Ae().optional(),stdio_args:Ae().optional(),stdio_cwd:Ae().optional(),env_vars:ds(HS).optional(),configuration_scopes:ds(Ae()).nullable().optional(),configuration_state:Yc(Ae(),Xc()).nullable().optional()}).refine(t=>t.ui_type==="NPX"?!!t.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(t=>t.ui_type==="STDIO"?!!t.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(t=>t.ui_type==="HTTP"||t.ui_type==="SSE"||t.ui_type==="Websocket"?!!t.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function XS(t){return t.command==="npx"}function JS(t){return t.args?.find(e=>!e.startsWith("-"))??""}function ZS(t){return{command:t.command,args:t.args?.join(" ")??"",cwd:t.cwd??""}}function QS(t,e){const n={command:"npx",args:["-y",t]},r=Jo(e);return Object.keys(r).length>0&&(n.envVars=r),n}function ew(t,e,n,r){const i={command:t};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const s=Jo(r);return Object.keys(s).length>0&&(i.envVars=s),i}function tw(t,e){const n={title:t.title,description:t.description??"",configuration_state:t.configuration_state??{},configuration_scopes:e||t.configuration_scopes||[]};if(t.connection_type==="STDIO"&&su(t.connection_headers)){const r=t.connection_headers,i=au(r.envVars);if(XS(r)){const o=JS(r);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:o,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const s=ZS(r);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:s.command,stdio_args:s.args,stdio_cwd:s.cwd,env_vars:i}}return{...n,ui_type:t.connection_type,connection_url:t.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function nw(t){let e,n=null,r=null,i=null;return t.ui_type==="NPX"?(e="STDIO",n="",i=QS(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(e="STDIO",n="",i=ew(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(e=t.ui_type,n=t.connection_url||"",r=t.connection_token||null),{title:t.title,description:t.description||null,connection_type:e,connection_url:n,...r&&{connection_token:r},...i&&{connection_headers:i},configuration_state:t.configuration_state??null,configuration_scopes:t.configuration_scopes??null}}function rw(t){const e=ve.c(13);let n;e[0]!==t?(n=hi(t),e[0]=t,e[1]=n):n=e[1];const r=n;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i={},e[2]=i):i=e[2];let s;e[3]!==t||e[4]!==r?(s={toolCaller:r,toolName:"MCP_CONFIGURATION",toolInputParams:i,scope:t},e[3]=t,e[4]=r,e[5]=s):s=e[5];const{data:o}=fu(s);let a;e[6]!==o.stateSchema?(a=o.stateSchema??{type:"object",properties:{}},e[6]=o.stateSchema,e[7]=a):a=e[7];const l=a;let f;e[8]!==o.scopes?(f=o.scopes??[],e[8]=o.scopes,e[9]=f):f=e[9];const u=f;let d;return e[10]!==u||e[11]!==l?(d={stateSchema:l,scopes:u},e[10]=u,e[11]=l,e[12]=d):d=e[12],d}function iw(t){const e=ve.c(4),{onAuthenticate:n,buttonText:r}=t,i=r===void 0?"Authenticate":r;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Authentication Required"}),c.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"This connection requires OAuth authentication to access resources."})]}),e[0]=s):s=e[0];let o;return e[1]!==i||e[2]!==n?(o=c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[s,c.jsx(Wt,{onClick:n,size:"lg",children:i})]})}),e[1]=i,e[2]=n,e[3]=o):o=e[3],o}function sw(t){const e=ve.c(7),{hasReadme:n,onViewReadme:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(gu,{size:48,className:"text-muted-foreground"}),e[0]=i):i=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Manual Authentication Required"}),c.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"This server requires an API key or token that must be configured manually. Check the server's documentation for instructions on obtaining credentials."})]}),e[1]=s):s=e[1];let o;e[2]!==n||e[3]!==r?(o=n&&r&&c.jsxs(Wt,{onClick:r,variant:"outline",size:"lg",children:[c.jsx(pu,{size:18,className:"mr-2"}),"View README"]}),e[2]=n,e[3]=r,e[4]=o):o=e[4];let a;return e[5]!==o?(a=c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[i,s,o]})}),e[5]=o,e[6]=a):a=e[6],a}function ow(){const t=ve.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx("img",{src:"/empty-state-error.svg",alt:"",width:160,height:160,"aria-hidden":"true"}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[e,c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Server Error"}),c.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"The MCP server is currently experiencing issues. Please try again later or check the server's status."})]})]})}),t[1]=n):n=t[1],n}function aw(t){const e=ve.c(3),n=rw(t.connection.id);let r;return e[0]!==n||e[1]!==t?(r=c.jsx(_c,{...t,...n}),e[0]=n,e[1]=t,e[2]=r):r=e[2],r}function lw(t){const e=ve.c(2);let n;return e[0]!==t?(n=c.jsx(_c,{...t}),e[0]=t,e[1]=n):n=e[1],n}function cw(t){const e=ve.c(13),{hasMcpBinding:n,stateSchema:r,formState:i,onFormStateChange:s,onAuthenticate:o,onViewReadme:a,isMCPAuthenticated:l,supportsOAuth:f,isServerError:u,hasReadme:d}=t,h=r&&r.properties&&typeof r.properties=="object"&&Object.keys(r.properties).length>0;if(!l){if(u){let y;return e[0]===Symbol.for("react.memo_cache_sentinel")?(y=c.jsx(ow,{}),e[0]=y):y=e[0],y}if(f){let y;return e[1]!==o?(y=c.jsx(iw,{onAuthenticate:o}),e[1]=o,e[2]=y):y=e[2],y}let p;return e[3]!==d||e[4]!==a?(p=c.jsx(sw,{hasReadme:d,onViewReadme:a}),e[3]=d,e[4]=a,e[5]=p):p=e[5],p}if(!n)return null;if(!h||!r){let p;return e[6]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx("div",{className:"w-3/5 min-w-0 overflow-auto flex items-center justify-center",children:c.jsx(uu,{image:c.jsx("img",{src:"/empty-state-success-muted.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),title:"This server is all set!",description:"No additional configuration is needed. Everything is ready to go."})}),e[6]=p):p=e[6],p}let g;e[7]!==i?(g=i??{},e[7]=i,e[8]=g):g=e[8];let m;return e[9]!==s||e[10]!==r||e[11]!==g?(m=c.jsx("div",{className:"w-3/5 min-w-0 overflow-auto",children:c.jsx(GS,{stateSchema:r,formState:g,onFormStateChange:s})}),e[9]=s,e[10]=r,e[11]=g,e[12]=m):m=e[12],m}function _c(t){const{connection:e,onUpdate:n,isUpdating:r,scopes:i,hasMcpBinding:s,stateSchema:o,onViewReadme:a}=t,l=Zo(),f=Zc(),d=Qc().location.href,g=!!e?.metadata?.repository?.url,m=eu({resolver:tu(YS),values:tw(e,i)}),p=m.watch("configuration_state"),y=m.formState.isDirty,x=b=>{m.setValue("configuration_state",b,{shouldDirty:!0})},S=async()=>{if(!await m.trigger())return;const v=m.getValues(),w=nw(v);await n(w),m.reset(v)},j=async()=>{const{token:b,tokenInfo:v,error:w}=await ru({connectionId:e.id});if(w||!b){Ut.error(`Authentication failed: ${w}`);return}if(v)try{const A=await fetch(`/api/connections/${e.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:v.accessToken,refreshToken:v.refreshToken,expiresIn:v.expiresIn,scope:v.scope,clientId:v.clientId,clientSecret:v.clientSecret,tokenEndpoint:v.tokenEndpoint})});if(!A.ok)console.error("Failed to save OAuth token:",await A.text()),await l.update.mutateAsync({id:e.id,data:{connection_token:b}});else try{await l.update.mutateAsync({id:e.id,data:{}})}catch(C){console.warn("Failed to refresh connection tools after OAuth:",C)}}catch(A){console.error("Error saving OAuth token:",A),await l.update.mutateAsync({id:e.id,data:{connection_token:b}})}else await l.update.mutateAsync({id:e.id,data:{connection_token:b}});const O=new URL(`/mcp/${e.id}`,window.location.origin);await f.invalidateQueries({queryKey:di.isMCPAuthenticated(O.href,null)}),Ut.success("Authentication successful")};return c.jsxs(c.Fragment,{children:[c.jsxs(yu,{children:[c.jsx(mu,{title:`${e.title}: Settings`,url:d,icon:e.icon??"settings"}),y&&c.jsxs(Wt,{onClick:S,disabled:r,size:"sm",className:"h-7",children:[r&&c.jsx(yn,{size:16,className:"mr-2 animate-spin"}),"Save Changes"]})]}),c.jsxs("div",{className:"flex h-full",children:[c.jsx("div",{className:"w-2/5 shrink-0 border-r border-border overflow-auto",children:c.jsx(Nd,{form:m,connection:e,hasOAuthToken:t.hasOAuthToken})}),c.jsx(du,{children:c.jsx(P.Suspense,{fallback:c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsx(yn,{size:32,className:"animate-spin text-muted-foreground"})}),children:c.jsx(cw,{hasMcpBinding:s,stateSchema:o,formState:p??void 0,onFormStateChange:x,onAuthenticate:j,onViewReadme:a,isMCPAuthenticated:t.isMCPAuthenticated,supportsOAuth:t.supportsOAuth,isServerError:t.isServerError,hasReadme:g})})})]})]})}function zw(t){const e=ve.c(5);let n;e[0]!==t.connection?(n={connections:[t.connection],binding:"MCP"},e[0]=t.connection,e[1]=n):n=e[1];const i=ea(n).length>0;let s;return e[2]!==i||e[3]!==t?(s=c.jsx("div",{className:"flex-1",children:i?c.jsx(aw,{...t,hasMcpBinding:!0}):c.jsx(lw,{...t,hasMcpBinding:!1})}),e[2]=i,e[3]=t,e[4]=s):s=e[4],s}export{Bv as F,sw as M,iw as O,zw as S,Vw as u,Qv as v};
|